diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..747ebf7a6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,33 @@ +# .dockerignore +Dockerfile +docker-compose.yml + +# .gitignore +# Temporary files +*~ +tmp +# All build folders +/build*/ +# Visual Studio Code +.vscode/settings.json +.vscode/launch.json +.vscode/*.log +*.code-workspace +# JetBrains IDE +.idea/ +# Cmake Projects in root ### +compile_commands.json +# Clangd index +.clangd/ +.cache/ +# BeyondCompare backup files +*.orig +# SonarScanner files +.scannerwork/ +# Generated debconf files +applications/*/debconf/config +# Macos fs igores +*.DS_Store +# Other files +*.swp +*.gcov diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 716a65bcf..000000000 --- a/.gitattributes +++ /dev/null @@ -1,6 +0,0 @@ -"bridge_binaries.zip" filter=lfs diff=lfs merge=lfs -text -"zap-2022.1.10.dmg" filter=lfs diff=lfs merge=lfs -text -"slc_cli_mac.zip" filter=lfs diff=lfs merge=lfs -text -"zap_apack_mac.zip" filter=lfs diff=lfs merge=lfs -text -"slc_cli_linux.zip" filter=lfs diff=lfs merge=lfs -text -"zap_apack_linux.zip" filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/build-rootfs.yml b/.github/workflows/build-rootfs.yml index 449edd856..a48806909 100644 --- a/.github/workflows/build-rootfs.yml +++ b/.github/workflows/build-rootfs.yml @@ -8,6 +8,8 @@ on: # yamllint disable-line rule:truthy - '*' jobs: build: + permissions: + contents: read runs-on: ubuntu-24.04 strategy: matrix: @@ -16,9 +18,13 @@ jobs: - arm64 # - armhf # TODO Enable when supported steps: - - uses: actions/checkout@v4.1.1 + # yamllint disable-line rule:line-length + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 + # Relate-to: https://github.com/actions/checkout/pull/2081#2025 + ref: ${{ github.ref }} + - id: describe name: Describe HEAD run: >- @@ -31,7 +37,8 @@ jobs: UNIFYSDK_GIT_TAG=${{ secrets.UNIFYSDK_GIT_TAG }} ./scripts/build-rootfs.sh - name: Upload artifacts - uses: actions/upload-artifact@v4 + # yamllint disable-line rule:line-length + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: # yamllint disable-line rule:line-length name: ${{ github.event.repository.name }}-${{ steps.describe.outputs.describe }}-${{ matrix.arch }} @@ -42,8 +49,12 @@ jobs: ./scripts/build-rootfs.sh docs/dist - name: Upload Release Asset id: upload-release-asset - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') + env: + token-defined: ${{ secrets.GH_UNIFY_ACCESS_TOKEN != '' }} + # yamllint disable-line rule:line-length + if: ${{ env.token-defined == true && startsWith(github.ref, 'refs/tags/') }} + # yamllint disable-line rule:line-length + uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2 with: files: build/dist/* # yamllint disable-line rule:line-length @@ -52,7 +63,8 @@ jobs: - name: Upload pages artifact id: deployment if: startsWith(github.ref, 'refs/tags/') && matrix.arch == 'amd64' - uses: actions/upload-pages-artifact@v3.0.1 + # yamllint disable-line rule:line-length + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: docs/ deploy: @@ -67,5 +79,6 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + # yamllint disable-line rule:line-length + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 if: startsWith(github.ref, 'refs/tags/') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e586166f..7326fd085 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,18 +1,23 @@ # YAML -*- mode: yaml; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*- +# SPDX-License-Identifier: Zlib +# SPDX-FileCopyrightText: Silicon Laboratories Inc. https://www.silabs.com --- -name: z-wave-protocol-controller Build in docker +name: build on: # yamllint disable-line rule:truthy push: jobs: build: + permissions: + contents: read env: - project-name: z-wave-protocol-controller # This should be lowercase for docker (and aligned) + project-name: z-wave-protocol-controller # Align to docker (lowercase) runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4.1.1 + # yamllint disable-line rule:line-length + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - id: describe @@ -22,18 +27,33 @@ jobs: | tee $GITHUB_OUTPUT - name: Build Docker image from sources run: >- + df -h + && docker build --tag "${{ env.project-name }}:latest" - --build-arg UNIFYSDK_GIT_REPOSITORY=${{ secrets.UNIFYSDK_GIT_REPOSITORY }} - --build-arg UNIFYSDK_GIT_TAG=${{ secrets.UNIFYSDK_GIT_TAG }} + --build-arg + UNIFYSDK_GIT_REPOSITORY=${{ secrets.UNIFYSDK_GIT_REPOSITORY }} + --build-arg + UNIFYSDK_GIT_TAG=${{ secrets.UNIFYSDK_GIT_TAG }} . + && + df -h + + - name: Upload container image + # yamllint disable-line rule:line-length + uses: ishworkh/container-image-artifact-upload@5d71a2417f0576fa11fe770fb04ece58c4587714 # v2.0.0 + with: + image: "${{ env.project-name }}:latest" + retention_days: 10 + - name: Extract artifacts run: >- container=$(docker create "${{ env.project-name }}:latest") && docker cp - ${container}:/usr/local/opt/${{ env.project-name }}/build/dist . + ${container}:/usr/local/opt/${{ env.project-name }}/dist . - name: Upload artifacts - uses: actions/upload-artifact@v4 + # yamllint disable-line rule:line-length + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: # yamllint disable-line name: ${{ github.event.repository.name }}-${{ steps.describe.outputs.describe }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..78c1f761a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,97 @@ +# YAML -*- mode: yaml; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*- +# SPDX-License-Identifier: Zlib +# SPDX-FileCopyrightText: Silicon Laboratories Inc. https://www.silabs.com +--- + +name: test + +# yamllint disable-line rule:line-length +run-name: "test: ${{ github.event.workflow_run.head_branch }}#${{ github.event.workflow_run.head_commit.id }}" + +on: # yamllint disable-line rule:truthy + workflow_run: + workflows: ["build"] + types: + - completed + +jobs: + test: + permissions: + contents: read + statuses: write + env: + project-name: z-wave-protocol-controller # Align to docker (lowercase) + runs-on: ubuntu-24.04 + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Download image + # yamllint disable-line rule:line-length + uses: ishworkh/container-image-artifact-download@ccb3671db007622e886a2d7037eb62b119d5ffaf # v2.0.0 + with: + image: "${{ env.project-name }}:latest" + workflow: "build" + token: ${{ secrets.GH_SL_ACCESS_TOKEN }} + workflow_run_id: ${{ github.event.workflow_run.id }} + + # yamllint disable-line rule:line-length + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + ref: ${{ github.event.workflow_run.head_commit.id }} + + - name: Download embedded applications package + # yamllint disable-line rule:line-length + uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12 + with: + repository: 'Z-Wave-Alliance/z-wave-stack-binaries' + tag: 'v25.1.0-28-g7e0b50f' + fileName: 'z-wave-stack-binaries-*-Linux.tar.gz' + token: ${{ secrets.GH_ZWAVE_ACCESS_TOKEN }} + latest: true + + - name: Setup + env: + debian_packages: time screen docker-compose mosquitto-clients jq wget + run: >- + set -x + && sudo apt update + && sudo apt install -y --no-install-recommends + ${{ env.debian_packages }} + && sudo apt-get clean -y + && echo "https://github.com/Z-Wave-Alliance/z-wave-stack/issues/733" + && mkdir -p z-wave-stack-binaries + && tar xfz z-wave-stack-binaries-*-Linux.tar.gz + -C z-wave-stack-binaries + && rm z-wave-stack-binaries-*-Linux.tar.gz + && date -u + + - name: Run + id: run + run: | + set -x + export ZPC_RUN_MODE="docker" + export ZPC_COMMAND="docker run ${{ env.project-name }}" + $ZPC_COMMAND --version + docker-compose pull + export ZPC_COMMAND="docker-compose up --abort-on-container-exit" + cd z-wave-stack-binaries/bin && file -E *_x86_REALTIME.elf && cd - + export ZPC_ARGS="--log.level=d" + ./scripts/tests/z-wave-stack-binaries-test.sh + continue-on-error: true + + - name: Propagate run status to commit status + # yamllint disable-line rule:line-length + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + if: always() + env: + status: ${{ steps.run.outcome }} + sha: ${{ github.event.workflow_run.head_commit.id }} + with: + script: | + await github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: process.env.sha, + state: process.env.status + }) + process.exit(process.env.status == 'success' ? 0 : 1); diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..70cdacc5b --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# .gitignore +# Temporary files +*~ +tmp +# All build folders +/build*/ +# Visual Studio Code +.vscode/settings.json +.vscode/launch.json +.vscode/*.log +*.code-workspace +# JetBrains IDE +.idea/ +# Cmake Projects in root ### +compile_commands.json +# Clangd index +.clangd/ +.cache/ +# BeyondCompare backup files +*.orig +# SonarScanner files +.scannerwork/ +# Generated debconf files +applications/*/debconf/config +# Macos fs igores +*.DS_Store +# Other files +*.swp +*.gcov diff --git a/CMakeLists.txt b/CMakeLists.txt index 37c5447dc..07edd7f9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,12 +14,19 @@ if(NOT DEFINED COMMON_LOCATION) endif() if(BUILD_TESTING) + include(cmake/modules/FindCMock.cmake) + set(THS-CMOCK_LOCATION "${cmock_SOURCE_DIR}") + set(THS-UNITY_LOCATION "${cmock_SOURCE_DIR}/vendor/unity") # https://gitlab.kitware.com/cmake/cmake/-/issues/22813#note_1620373 - option(BUILD_TESTING_PROPERTY_DISABLED "WARNING: Bypass some tests" True) + option(BUILD_TESTING_PROPERTY_DISABLED "WARNING: Bypass some tests" false) if(BUILD_TESTING_PROPERTY_DISABLED) message(WARNING "TODO: Some tests are bypassed, please help fixing them") endif() - include(${CMAKE_SOURCE_DIR}/components/testframework/target_add_unittest.cmake) + # Testframework deduplicated, only one to be used + set(ZPC_TESTFRAMEWORK_PATH + ${unifysdk_SOURCE_DIR}/components/testframework + ) + include(${ZPC_TESTFRAMEWORK_PATH}/target_add_unittest.cmake) include(cmake/include/unittest.cmake) endif() diff --git a/Dockerfile b/Dockerfile index 0429d9de2..982a66f38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,11 @@ -FROM debian:bookworm +# SPDX-License-Identifier: Zlib +# SPDX-FileCopyrightText: Silicon Laboratories Inc. https://www.silabs.com -ENV DEBIAN_FRONTEND noninteractive -ENV LC_ALL en_US.UTF-8 -ENV LANG ${LC_ALL} +FROM debian:bookworm as builder ARG UNIFYSDK_GIT_REPOSITORY https://github.com/SiliconLabs/UnifySDK ARG UNIFYSDK_GIT_TAG main -RUN echo "# log: Configuring locales" \ - && set -x \ - && apt-get update -y \ - && apt-get install -y locales \ - && echo "${LC_ALL} UTF-8" | tee /etc/locale.gen \ - && locale-gen ${LC_ALL} \ - && dpkg-reconfigure locales \ - && TZ=Etc/UTC apt-get -y install tzdata \ - && date -u - ENV project z-wave-protocol-controller ENV workdir /usr/local/opt/${project} ADD . ${workdir} @@ -25,14 +14,40 @@ WORKDIR ${workdir} RUN echo "# log: Setup system" \ && set -x \ - && apt-get install -y make sudo \ + && df -h \ + && apt-get update \ + && apt-get install -y --no-install-recommends -- make sudo \ && ./helper.mk help setup \ && date -u RUN echo "# log: Build" \ && set -x \ && ./helper.mk \ + && date -u \ + && echo "# log: Clean to only keep packages to save space" \ + && mkdir -p dist \ + && cd dist \ + && unzip ../build/dist/${project}*.zip \ + && cd - \ + && ./helper.mk distclean \ + && date -u + +FROM debian:bookworm +ENV project z-wave-protocol-controller +ENV workdir /usr/local/opt/${project} +COPY --from=builder ${workdir}/dist/ ${workdir}/dist/ +WORKDIR ${workdir} + +RUN echo "# log: Install to system" \ + && set -x \ + && apt-get update \ + && dpkg -i ./dist/${project}*/*.deb \ + || apt install -f -y --no-install-recommends \ + && echo "TODO: rm -rf dist # If artifacts are no more needed" \ + && apt-get clean -y \ + && rm -rf /var/lib/{apt,dpkg,cache,log}/ \ + && df -h \ && date -u -ENTRYPOINT [ "/usr/local/opt/z-wave-protocol-controller/helper.mk" ] -CMD [ "help" ] +ENTRYPOINT [ "/usr/bin/zpc" ] +CMD [ "--help" ] diff --git a/NEWS.md b/NEWS.md index ee0cf8a8e..f0388102c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. **Full Changelog**: https://github.com/SiliconLabsSoftware/z-wave-protocol-controller/commits +## next + +Integrate internal changes progressively: + +``` +applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2: zw-libs2#zwave-sdk-7.24.0-rc0-gd9252947 +applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework: zw-testframework#zwave-sdk-7.20.0-ga-15-gccbd3fb +``` + ## ver_1.7.0 **Full Changelog**: diff --git a/README.md b/README.md index c1694343e..a9c4f8775 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ ## About -Z-Wave-Protocol-Controller is a Linux application to control Z-Wave networks with a Silicon Labs NCP, -It has grown as part of Unify SDK project and is now maintained as an external project. +Z-Wave-Protocol-Controller is a Linux application to control Z-Wave +networks with a Silicon Labs NCP, It has grown as part of Unify SDK +project and is now maintained as an external project. ## News @@ -22,6 +23,159 @@ Or relevant sources pages, to get started head to: ## Quickstart +### Native (Linux) build + +The project is CMake based, to prepare the environment, +have a look at [./helper.mk](helper.mk)'s details +for needed steps to setup developer system before using CMake normally. + +At the moment stable version of Debian (12) is supported, +so it should work also in relatives projects (Ubuntu, RaspiOS, WSL2 etc) +and should be easy to adapt to other distributions. + +```sh +sudo apt-get install -y sudo make git + +git clone https://github.com/SiliconLabsSoftware/z-wave-protocol-controller +cd z-wave-protocol-controller + +./helper.mk help +./helper.mk setup # To setup developer system (once) +./helper.mk VERBOSE=1 # Default build tasks verbosely (depends on setup)" +./helper.mk run # Run entry-point application +``` + +It should print zpc's help. + +To use it, a Silicon Labs' Z-Wave NCP should be plugged in USB port. + +To setup the device zwave_ncp_serial_api_controller application should be flashed using +[simplicity-studio](https://www.silabs.com/developer-tools/simplicity-studio) + +Alternatively demo-applications package can be downloaded from +[SiliconLabs SDK repository](https://github.com/SiliconLabs/simplicity_sdk/releases) +and flashed using command-line tool +[SimplicityCommander](https://www.silabs.com/documents/public/software/SimplicityCommander-Linux.zip) +. + +Then to verify you can check firmware version using zpc: + +```sh +lsusb # Should list the NCP device (WSL users should attach device first) +serial=$(ls /dev/serial/by-id/usb-Silicon_Labs* | head -n1) +./helper.mk all run run_args="--zpc.serial=${serial} --zpc.ncp_version" +# [zpc_ncp_update] chip_serial_api_version: 7.23.1 +``` + +Then let's interact with ZPC's inbuilt shell without installing it. + +```sh +sudo apt install -y mosquitto # Is a strong runtime dependency +serial=$(ls /dev/serial/by-id/usb-Silicon_Labs* | head -n1) +run_args="--zpc.serial=${serial}" +mapdir="applications/zpc/components/dotdot_mapper/rules" +run_args="$run_args --mapdir=${mapdir}" +datastore_file="tmp.db" +run_args="$run_args --zpc.datastore_file=${datastore_file}" +cache_path="tmp" +run_args="$run_args --zpc.ota.cache_path=${cache_path}" +mkdir -p ${cache_path} +./helper.mk run run_args="$run_args" + + +ZPC>help +================================================== +Unify Command line interface Help: +================================================== +(...) +exit :Exit the application +(...) +zwave_home_id Print Z-Wave Home ID +(...) +zwave_add_node :Add a Z-Wave node to the network +(...) +zwave_set_default Reset Z-Wave network +(...) +ZPC> zwave_home_id +Z-Wave Home ID: +1BADC0DE +ZPC> zwave_add_node +(...) +``` + +Set endnode to learn mode and the controller should see it: + +```sh +(...) +Please verify the DSK and insert the missing part (first 5 digits) +Usage: zwave_accept_dsk +ZPC> zwave_accept_dsk (...) +``` + +Then you will have to learn how to use couple of shell commands +"attribute_store_log" and "attribute_store_set_desired", +as explained in the reference documentation. + +```sh +ZPC>attribute_store_log +(...) +ZPC>attribute_store_log_search OnOff +(...) +│ │ │ │───(110) ZCL OnOff OnOff ..................................... 0 +(...) +ZPC>attribute_store_set_desired 110,1 +(...) +``` + +### WSL2 build + +How to use a z-wave controller with ZPC running in WSL2 ? + +You can use this [script](./scripts/wslusb.ps1). + +Start by installing the usbipd service as described at: https://learn.microsoft.com/en-us/windows/wsl/connect-usb + +```sh +# You can list devices using: + +(Powershell)$ ./wslusb.ps1 -List + +# Get the BUSID of the device you want to mount + +(Powershell)$ ./wslusb.ps1 -Attach + +# Check that the device is correctly mounted into WSL2 + +(WSL2)$ lsusb # you should see your device here + +# Detach the device with + +(Powershell)$ ./wslusb.ps1 -Detach +``` + +### More + +Refer to [./doc](doc) for more (using shell, MQTT, WebApp etc). + + +### Docker build + +The fastest (less than 20min) way to build z-wave-protocol-controller from scratch +is to delegate all tasks to docker. + +```sh +docker build https://github.com/SiliconLabsSoftware/z-wave-protocol-controller.git#ver_1.7.0 +``` + +This one-liner will do download latest release, setup environment, build, test, package... + +Also a docker-compose file is provided to start ZPC and use it along a MQTT client +(eg: +[mosquitto-clients](https://github.com/eclipse-mosquitto/mosquitto/) +). + +Power users might prefer to work in sources tree in a native GNU/Linux +environment as explained above. ## Contributing diff --git a/applications/zpc/CMakeLists.txt b/applications/zpc/CMakeLists.txt index 884a5273c..2047e2520 100644 --- a/applications/zpc/CMakeLists.txt +++ b/applications/zpc/CMakeLists.txt @@ -33,16 +33,13 @@ include(${COMMON_PATH}/cmake/include/zap.cmake) include(${COMMON_PATH}/cmake/include/unittest.cmake) include(${COMMON_PATH}/cmake/include/version_file.cmake) -# Overload test system with downstream one (patched for z-wave ?) -set(UNIFY-TESTFRAMEWORK_PATH - ${CMAKE_SOURCE_DIR}/components/testframework) -message(STATUS "Using: ${UNIFY-TESTFRAMEWORK_PATH}") -if(NOT EXISTS ${UNIFY-TESTFRAMEWORK_PATH}) - message(FATAL_ERROR "Path to unify testframework does not exist: ${UNIFY-TESTFRAMEWORK_PATH}") +message(STATUS "Using: ${ZPC_TESTFRAMEWORK_PATH}") +if(NOT EXISTS ${ZPC_TESTFRAMEWORK_PATH}) + message(FATAL_ERROR "Path to unify testframework does not exist: ${ZPC_TESTFRAMEWORK_PATH}") endif() -include(${UNIFY-TESTFRAMEWORK_PATH}/add_mock.cmake) -include(${UNIFY-TESTFRAMEWORK_PATH}/target_add_unittest.cmake) +include(${ZPC_TESTFRAMEWORK_PATH}/add_mock.cmake) +include(${ZPC_TESTFRAMEWORK_PATH}/target_add_unittest.cmake) include_directories( include @@ -188,3 +185,29 @@ add_component_to_uic( ${CMAKE_BINARY_DIR}/applications/zpc/debconf/conffiles;\ ${CMAKE_BINARY_DIR}/applications/zpc/debconf/postinst;\ ${CMAKE_BINARY_DIR}/applications/zpc/debconf/prerm") + + +add_library( + testlib + SHARED testlib.c +) +target_link_libraries( + testlib + PRIVATE zwave_s2_testlib + zwave_network_management_testlib + zwave_transports_testlib + uic_contiki_testlib + uic_contiki_platform_testlib + uic_log_testlib + uic_main_testlib +) +target_compile_definitions( + testlib + PRIVATE CMAKE_PROJECT_VERSION="${CMAKE_PROJECT_VERSION}" + ZWAVE_TESTLIB +) + +install(TARGETS testlib + LIBRARY DESTINATION lib + COMPONENT uic-zpc) + diff --git a/applications/zpc/components/Cargo.lock b/applications/zpc/components/Cargo.lock index 897bc238d..42f875cf8 100644 --- a/applications/zpc/components/Cargo.lock +++ b/applications/zpc/components/Cargo.lock @@ -950,9 +950,9 @@ dependencies = [ [[package]] name = "unsafe-libyaml" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "which" diff --git a/applications/zpc/components/dotdot_mapper/test/CMakeLists.txt b/applications/zpc/components/dotdot_mapper/test/CMakeLists.txt index 0d2766f24..4de928c44 100644 --- a/applications/zpc/components/dotdot_mapper/test/CMakeLists.txt +++ b/applications/zpc/components/dotdot_mapper/test/CMakeLists.txt @@ -48,7 +48,8 @@ target_add_unittest( zpc_attribute_store_test_helper zwave_network_management_mock uic_dotdot_mqtt_mock) -if(${BUILD_TESTING_PROPERTY_DISABLED}) +if(${ZPC_BUILD_TESTING_PROPERTY_DISABLED}) + message(WARNING "Please fix this test") set_tests_properties(binding_cluster_mapper_test PROPERTIES DISABLED True) endif() diff --git a/applications/zpc/components/network_monitor/src/network_monitor.cpp b/applications/zpc/components/network_monitor/src/network_monitor.cpp index 23290487b..4a112a008 100644 --- a/applications/zpc/components/network_monitor/src/network_monitor.cpp +++ b/applications/zpc/components/network_monitor/src/network_monitor.cpp @@ -291,8 +291,10 @@ static void network_monitor_on_network_ready(zwave_home_id_t home_id, zwave_node_id_t node_id, zwave_keyset_t granted_keys, - zwave_kex_fail_type_t kex_fail_type) + zwave_kex_fail_type_t kex_fail_type, + zwave_protocol_t inclusion_protocol) { + (void) inclusion_protocol; network_data *data = new network_data; data->node_id = node_id; data->home_id = home_id; @@ -716,49 +718,44 @@ static void network_initialized = true; } -static void network_monitor_handle_event_network_ready(network_data *event_data) +static void network_monitor_handle_event_network_ready(network_data const &event_data) { // Make sure that UNID / ZPC UNID are configured correctly. - zwave_unid_set_home_id(event_data->home_id); - zwave_unid_from_node_id(event_data->node_id, zpc_unid); + zwave_unid_set_home_id(event_data.home_id); + zwave_unid_from_node_id(event_data.node_id, zpc_unid); // Save our updated granted keys/KEX fail network_monitor_create_attribute_store_network_nodes( - event_data->granted_keys, - event_data->kex_fail_type); + event_data.granted_keys, + event_data.kex_fail_type); // Pause node resolution on any other network than ours in the Attribute Store. network_monitor_activate_network_resolution(true); - - delete event_data; } static void network_monitor_handle_event_node_id_assigned( - node_id_assigned_event_data *event_data) + node_id_assigned_event_data const &event_data) { network_monitor_add_attribute_store_node( - event_data->node_id, + event_data.node_id, ZCL_NODE_STATE_NETWORK_STATUS_COMMISIONING_STARTED); - zwave_store_inclusion_protocol(event_data->node_id, - event_data->inclusion_protocol); - - delete event_data; + zwave_store_inclusion_protocol(event_data.node_id, + event_data.inclusion_protocol); } static void - network_monitor_handle_event_node_added(node_added_event_data *event_data) + network_monitor_handle_event_node_added(node_added_event_data const &event_data) { // Attribute store node should already exist, but in case NODE_ID_ASSIGNED_EVENT // did not happen before this event, we ensure the node exists in the attribute store. - network_monitor_update_new_node_attribute_store(*event_data); + network_monitor_update_new_node_attribute_store(event_data); - zwave_store_inclusion_protocol(event_data->node_id, - event_data->inclusion_protocol); + zwave_store_inclusion_protocol(event_data.node_id, + event_data.inclusion_protocol); // Finally we want to update our local cache of the node list: zwave_network_management_get_network_node_list(current_node_list); // TODO: Add timeout system to detect node interview failed - delete event_data; } static void network_monitor_handle_event_node_interview_initiated( @@ -1088,18 +1085,33 @@ PROCESS_THREAD(network_monitor_process, ev, data) break; case NETWORK_READY_EVENT: - network_monitor_handle_event_network_ready( - static_cast(data)); + if (data) { + network_data const *event_data + = static_cast(data); + data = NULL; + network_monitor_handle_event_network_ready(*event_data); + delete event_data; //< Allocated by network_monitor_on_network_ready + }; break; case NODE_ID_ASSIGNED_EVENT: - network_monitor_handle_event_node_id_assigned( - static_cast(data)); + if (data) { + node_id_assigned_event_data const *event_data + = static_cast(data); + data = NULL; + network_monitor_handle_event_node_id_assigned(*event_data); + delete event_data; //< Allocated by network_monitor_on_node_id_assigned + }; break; case NODE_ADDED_EVENT: - network_monitor_handle_event_node_added( - static_cast(data)); + if (data) { + node_added_event_data const *event_data + = static_cast(data); + data = NULL; + network_monitor_handle_event_node_added(*event_data); + delete event_data; //< Allocated by network_monitor_on_node_added + }; break; case NODE_INTERVIEW_INITIATED_EVENT: diff --git a/applications/zpc/components/network_monitor/test/zwave_network_monitor_test.c b/applications/zpc/components/network_monitor/test/zwave_network_monitor_test.c index 7cff989ee..c686f356c 100644 --- a/applications/zpc/components/network_monitor/test/zwave_network_monitor_test.c +++ b/applications/zpc/components/network_monitor/test/zwave_network_monitor_test.c @@ -1074,7 +1074,7 @@ void test_on_network_ready() sizeof(current_node_list)); TEST_ASSERT_NOT_NULL(zwave_callbacks->on_new_network_entered); - zwave_callbacks->on_new_network_entered(home_id, zpc_node_id, 2, 3); + zwave_callbacks->on_new_network_entered(home_id, zpc_node_id, 2, 3, PROTOCOL_ZWAVE); contiki_test_helper_run(1); // Go around and check our attribute store. diff --git a/applications/zpc/components/zpc_attribute_resolver/src/zpc_attribute_resolver_group.cpp b/applications/zpc/components/zpc_attribute_resolver/src/zpc_attribute_resolver_group.cpp index 84324704e..079299d94 100644 --- a/applications/zpc/components/zpc_attribute_resolver/src/zpc_attribute_resolver_group.cpp +++ b/applications/zpc/components/zpc_attribute_resolver/src/zpc_attribute_resolver_group.cpp @@ -16,6 +16,8 @@ // Unify Includes #include "attribute_resolver_rule.h" +#include "attribute_resolver.hpp" + #include "attribute_store.h" #include "attribute_store_helper.h" #include "zpc_attribute_store_network_helper.h" @@ -187,8 +189,9 @@ static sl_status_t assign_multicast_pool(attribute_store_node_t node) uint16_t payload_length = 0; std::array payload = {0}; - attribute_resolver_function_t resolution_function - = attribute_resolver_set_function(attribute_store_get_node_type(node)); + auto resolution_function + = attribute_resolver::set_function( + attribute_store_get_node_type(node)); if (resolution_function == nullptr) { return SL_STATUS_FAIL; diff --git a/applications/zpc/components/zpc_attribute_resolver/test/CMakeLists.txt b/applications/zpc/components/zpc_attribute_resolver/test/CMakeLists.txt index 18c80b950..4f64932f3 100644 --- a/applications/zpc/components/zpc_attribute_resolver/test/CMakeLists.txt +++ b/applications/zpc/components/zpc_attribute_resolver/test/CMakeLists.txt @@ -6,6 +6,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() target_add_unittest(zpc_attribute_resolver SOURCES zpc_attribute_resolver_test.c + attribute_resolver_hpp_stub.cpp DEPENDS uic_attribute_store_mock uic_attribute_resolver_rule_mock diff --git a/applications/zpc/components/zpc_attribute_resolver/test/attribute_resolver_hpp_stub.cpp b/applications/zpc/components/zpc_attribute_resolver/test/attribute_resolver_hpp_stub.cpp new file mode 100644 index 000000000..1431fc99b --- /dev/null +++ b/applications/zpc/components/zpc_attribute_resolver/test/attribute_resolver_hpp_stub.cpp @@ -0,0 +1,31 @@ +/****************************************************************************** + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ****************************************************************************** + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + *****************************************************************************/ + +#include "attribute_resolver.hpp" +#include "attribute_resolver_hpp_stub.h" + +attribute_resolver_function_t set_function_stub = nullptr; + +void attribute_resolver_set_function_stub( + attribute_resolver_function_t function) +{ + set_function_stub = function; +} + +namespace attribute_resolver +{ +attribute_resolver_function set_function(attribute_store_type_t node_type) +{ + return set_function_stub; +} +} // namespace attribute_resolver \ No newline at end of file diff --git a/applications/zpc/components/zpc_attribute_resolver/test/attribute_resolver_hpp_stub.h b/applications/zpc/components/zpc_attribute_resolver/test/attribute_resolver_hpp_stub.h new file mode 100644 index 000000000..021998691 --- /dev/null +++ b/applications/zpc/components/zpc_attribute_resolver/test/attribute_resolver_hpp_stub.h @@ -0,0 +1,33 @@ +/****************************************************************************** + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ****************************************************************************** + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + *****************************************************************************/ +#ifndef ATTRIBUTE_RESOLVER_HPP_STUB_H +#define ATTRIBUTE_RESOLVER_HPP_STUB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "attribute_resolver.h" + +/** + * Since this test use a LOT of mock, we mock this function that + * was switched to C++ due to internal rework. + */ +void attribute_resolver_set_function_stub( + attribute_resolver_function_t function); + +#ifdef __cplusplus +} +#endif + +#endif // ATTRIBUTE_RESOLVER_HPP_STUB_H \ No newline at end of file diff --git a/applications/zpc/components/zpc_attribute_resolver/test/zpc_attribute_resolver_test.c b/applications/zpc/components/zpc_attribute_resolver/test/zpc_attribute_resolver_test.c index d3dece4d2..7f1ab6ff1 100644 --- a/applications/zpc/components/zpc_attribute_resolver/test/zpc_attribute_resolver_test.c +++ b/applications/zpc/components/zpc_attribute_resolver/test/zpc_attribute_resolver_test.c @@ -32,6 +32,8 @@ #include "zwave_controller_utils_mock.h" #include "zwave_controller_keyset_mock.h" #include "zwave_utils_mock.h" +// Local mock +#include "attribute_resolver_hpp_stub.h" // Interface includes #include "sl_status.h" @@ -40,6 +42,7 @@ // Generic includes #include + // Static test variables static resolver_on_set_rule_registered_t set_rule_notification_function = NULL; static attribute_store_node_changed_callback_t set_notification_function = NULL; @@ -120,6 +123,8 @@ void suiteSetUp() received_resolver_config.get_retry_count = 0; received_send_data_complete = NULL; received_user = NULL; + + attribute_resolver_set_function_stub(rule_function_stub); } /// Teardown the test suite (called once after all test_xxx functions are called) @@ -612,8 +617,8 @@ void test_zpc_attribute_resolver_group_2_nodes_happy_case() encapsulation_1); attribute_store_get_node_type_ExpectAndReturn(test_node_2, test_node_2_type); - attribute_resolver_set_function_ExpectAndReturn(test_node_2_type, - &rule_function_stub); + // attribute_resolver_set_function_ExpectAndReturn(test_node_2_type, + // &rule_function_stub); zwave_node_want_supervision_frame_ExpectAndReturn(zwave_node_id_2, zwave_endpoint_id_1, true); @@ -640,8 +645,10 @@ void test_zpc_attribute_resolver_group_2_nodes_happy_case() encapsulation_1); attribute_store_get_node_type_ExpectAndReturn(test_node_1, test_node_1_type); - attribute_resolver_set_function_ExpectAndReturn(test_node_1_type, - &rule_function_stub); + + // attribute_resolver_register_rule(test_node_1_type, + // &rule_function_stub); + zwave_node_want_supervision_frame_ExpectAndReturn(zwave_node_id_1, zwave_endpoint_id_1, true); @@ -849,8 +856,8 @@ void test_zpc_attribute_resolver_group_unknown_protocol() encapsulation_1); attribute_store_get_node_type_ExpectAndReturn(test_node_1, test_node_1_type); - attribute_resolver_set_function_ExpectAndReturn(test_node_1_type, - &rule_function_stub); + // attribute_resolver_set_function_ExpectAndReturn(test_node_1_type, + // &rule_function_stub); zwave_node_want_supervision_frame_ExpectAndReturn(zwave_node_id_1, zwave_endpoint_id_1, true); @@ -977,8 +984,8 @@ void test_zpc_attribute_resolver_group_no_reported_value() encapsulation_1); attribute_store_get_node_type_ExpectAndReturn(test_node_1, test_node_1_type); - attribute_resolver_set_function_ExpectAndReturn(test_node_1_type, - &rule_function_stub); + // attribute_resolver_set_function_ExpectAndReturn(test_node_1_type, + // &rule_function_stub); zwave_node_want_supervision_frame_ExpectAndReturn(zwave_node_id_1, zwave_endpoint_id_1, true); diff --git a/applications/zpc/components/zpc_attribute_store/include/attribute_store_defined_attribute_types.h b/applications/zpc/components/zpc_attribute_store/include/attribute_store_defined_attribute_types.h index 06b4bd856..c9c84d9b6 100644 --- a/applications/zpc/components/zpc_attribute_store/include/attribute_store_defined_attribute_types.h +++ b/applications/zpc/components/zpc_attribute_store/include/attribute_store_defined_attribute_types.h @@ -93,6 +93,11 @@ DEFINE_ATTRIBUTE(ATTRIBUTE_ZWAVE_FAILING_NODE_PING_INTERVAL, 0x0017) ///< Used by poll engine to request of for polling of the attributer DEFINE_ATTRIBUTE(ATTRIBUTE_POLL_ENGINE_MARK, 0x0018) +///< This represents whether a Z-Wave node supports NLS. +DEFINE_ATTRIBUTE(ATTRIBUTE_ZWAVE_NLS_SUPPORT, 0x0019) +///< This represents whether a Z-Wave node has NLS enabled. +DEFINE_ATTRIBUTE(ATTRIBUTE_ZWAVE_NLS_STATE, 0x0020) + // Generic endpoint attributes, should be attached under endpoints // Suggested range 0x100..0x1FF (using Z-Wave Protocol CC identifier) /** This represents the list of supported command classes (NIF) for a node */ @@ -107,10 +112,6 @@ DEFINE_ATTRIBUTE(ATTRIBUTE_ZWAVE_GENERIC_DEVICE_CLASS, 0x0104) DEFINE_ATTRIBUTE(ATTRIBUTE_ZWAVE_SPECIFIC_DEVICE_CLASS, 0x0105) ///< This represent a zwave_key_protocol_combination_t DEFINE_ATTRIBUTE(ATTRIBUTE_ZWAVE_KEY_AND_PROTOCOL_TO_DISCOVER, 0x0106) -/** This represents whether a Z-Wave node/endpoint supports NLS. */ -DEFINE_ATTRIBUTE(ATTRIBUTE_ZWAVE_NLS_SUPPORT, 0x0107) -/** This represents whether a Z-Wave node/endpoint has NLS enabled. */ -DEFINE_ATTRIBUTE(ATTRIBUTE_ZWAVE_NLS_STATE, 0x0108) // Generic attributes that can be placed anywhere under an endpoint. /** This indicates if more reports are expected to "complete" the value of an attribute */ @@ -561,10 +562,6 @@ DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_CONFIGURATION_PARAMETERS_TO_DISCOVER, /// zwave_cc_version_t DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_CRC16_VERSION, ((COMMAND_CLASS_CRC_16_ENCAP << 8) | 0x01)) -// Flag to disable CRC16 response if necessary (default is enabled) -// Should not be used (unless with some faulty devices) -DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_CRC16_DISABLE_CRC16, - ((COMMAND_CLASS_CRC_16_ENCAP << 8) | 0x02)) ///////////////////////////////////////////////// // Device Reset Locally Command Class diff --git a/applications/zpc/components/zpc_attribute_store/include/zwave_utils.h b/applications/zpc/components/zpc_attribute_store/include/zwave_utils.h index c754cd9d6..e000880fc 100644 --- a/applications/zpc/components/zpc_attribute_store/include/zwave_utils.h +++ b/applications/zpc/components/zpc_attribute_store/include/zwave_utils.h @@ -32,8 +32,6 @@ #include "zwave_command_class_wake_up_types.h" #include "attribute_store_defined_attribute_types.h" -#include "attribute_store.h" - /** * @ingroup zpc_utils * @{ @@ -169,6 +167,15 @@ sl_status_t zwave_store_inclusion_protocol(zwave_node_id_t node_id, sl_status_t zwave_get_node_granted_keys(zwave_node_id_t node_id, zwave_keyset_t *keys); +/** + * @brief Set the node granted keys object + * + * @param node_id + * @param keys + */ +sl_status_t zwave_set_node_granted_keys(zwave_node_id_t node_id, + zwave_keyset_t *keyset); + /** * @brief Verify whether a node/endpoint supports a Command Class * using the attribute Store. @@ -216,22 +223,12 @@ zwave_cc_version_t zwave_endpoint_id_t endpoint_id); /** - * @brief Get endpoint node associated with the ZWave NodeID and Endpoint ID - * - * @param node_id The Z-Wave NodeID for which we want to find the endpoint - * @param endpoint_id The Z-Wave Endpoint ID for which we want to find the endpoint - * - * @returns The attribute store node associated with the endpoint. - */ -attribute_store_node_t zwave_get_endpoint_node(zwave_node_id_t node_id, - zwave_endpoint_id_t endpoint_id); - /** * @brief Verify if we registered a node as supporting S2. * * @param node_id The NodeID that supports S2. * @returns True if the node has been registered to support S2, false otherwise */ - bool zwave_security_validation_is_node_s2_capable(zwave_node_id_t node_id); +bool zwave_security_validation_is_node_s2_capable(zwave_node_id_t node_id); /** * @brief Sets a node as S2 capable, meaning that we know it supports S2, diff --git a/applications/zpc/components/zpc_attribute_store/src/zpc_attribute_store_type_registration.cpp b/applications/zpc/components/zpc_attribute_store/src/zpc_attribute_store_type_registration.cpp index f0d72d7f9..05407b023 100644 --- a/applications/zpc/components/zpc_attribute_store/src/zpc_attribute_store_type_registration.cpp +++ b/applications/zpc/components/zpc_attribute_store/src/zpc_attribute_store_type_registration.cpp @@ -51,6 +51,8 @@ static const std::vector attribute_schema = { {ATTRIBUTE_MULTICAST_GROUP_LIST, "Multicast Group list", ATTRIBUTE_NODE_ID, EMPTY_STORAGE_TYPE}, {ATTRIBUTE_MULTICAST_GROUP, "Multicast Group", ATTRIBUTE_MULTICAST_GROUP_LIST, U8_STORAGE_TYPE}, {ATTRIBUTE_ZWAVE_FAILING_NODE_PING_INTERVAL, "NOP interval", ATTRIBUTE_NODE_ID, UNSIGNED_LONG_STORAGE_TYPE}, + {ATTRIBUTE_ZWAVE_NLS_SUPPORT, "NLS support", ATTRIBUTE_NODE_ID, U8_STORAGE_TYPE}, + {ATTRIBUTE_ZWAVE_NLS_STATE, "NLS state", ATTRIBUTE_NODE_ID, U8_STORAGE_TYPE}, {ATTRIBUTE_POLL_ENGINE_MARK, "Poll Engine Mark", ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE, UNKNOWN_STORAGE_TYPE}, ///////////////////////////////////////////////////////////////////// // Generic Z-Wave Endpoint ID attributes @@ -61,8 +63,6 @@ static const std::vector attribute_schema = { {ATTRIBUTE_ZWAVE_GENERIC_DEVICE_CLASS, "Generic Device Class", ATTRIBUTE_ENDPOINT_ID, U8_STORAGE_TYPE}, {ATTRIBUTE_ZWAVE_SPECIFIC_DEVICE_CLASS, "Specific Device Class", ATTRIBUTE_ENDPOINT_ID, U8_STORAGE_TYPE}, {ATTRIBUTE_ZWAVE_KEY_AND_PROTOCOL_TO_DISCOVER, "Network Key / Protocol to probe", ATTRIBUTE_ENDPOINT_ID, BYTE_ARRAY_STORAGE_TYPE}, - {ATTRIBUTE_ZWAVE_NLS_SUPPORT, "NLS support", ATTRIBUTE_NODE_ID, U8_STORAGE_TYPE}, - {ATTRIBUTE_ZWAVE_NLS_STATE, "NLS state", ATTRIBUTE_NODE_ID, U8_STORAGE_TYPE}, ///////////////////////////////////////////////////////////////////// // Generic Z-Wave attributes ///////////////////////////////////////////////////////////////////// @@ -192,7 +192,6 @@ static const std::vector attribute_schema = { // Device Reset Locally Command Class attributes ///////////////////////////////////////////////////////////////////// {ATTRIBUTE_COMMAND_CLASS_CRC16_VERSION, "CRC16 Version", ATTRIBUTE_ENDPOINT_ID, U8_STORAGE_TYPE}, - {ATTRIBUTE_COMMAND_CLASS_CRC16_DISABLE_CRC16, "Disable CRC16 frames", ATTRIBUTE_ENDPOINT_ID, U8_STORAGE_TYPE}, ///////////////////////////////////////////////////////////////////// // Inclusion Controller Command Class attributes ///////////////////////////////////////////////////////////////////// diff --git a/applications/zpc/components/zpc_attribute_store/src/zwave_utils.c b/applications/zpc/components/zpc_attribute_store/src/zwave_utils.c index 46a6fac3c..3035ee776 100644 --- a/applications/zpc/components/zpc_attribute_store/src/zwave_utils.c +++ b/applications/zpc/components/zpc_attribute_store/src/zwave_utils.c @@ -263,6 +263,25 @@ sl_status_t zwave_get_node_granted_keys(zwave_node_id_t node_id, sizeof(zwave_keyset_t)); } +// Write the granted keys for a node from the attribute store +sl_status_t zwave_set_node_granted_keys(zwave_node_id_t node_id, + zwave_keyset_t *keyset) +{ + // Find the node from the attribute store: + unid_t unid; + zwave_unid_from_node_id(node_id, unid); + + // Find out attribute store node based on the UNID + attribute_store_node_t node_id_node + = attribute_store_network_helper_create_node_id_node(unid); + + // Write down the granted keys for that node + return attribute_store_set_child_reported(node_id_node, + ATTRIBUTE_GRANTED_SECURITY_KEYS, + keyset, + sizeof(zwave_keyset_t)); +} + bool zwave_node_want_supervision_frame(zwave_node_id_t node_id, zwave_endpoint_id_t endpoint_id) { @@ -359,8 +378,10 @@ zwave_cc_version_t zwave_node_id_t node_id, zwave_endpoint_id_t endpoint_id) { + unid_t node_unid; + zwave_unid_from_node_id(node_id, node_unid); attribute_store_node_t endpoint_node - = zwave_get_endpoint_node(node_id, endpoint_id); + = attribute_store_network_helper_get_endpoint_node(node_unid, endpoint_id); if (endpoint_node == ATTRIBUTE_STORE_INVALID_NODE) { return 0; @@ -376,16 +397,6 @@ zwave_cc_version_t return version; } -attribute_store_node_t zwave_get_endpoint_node(zwave_node_id_t node_id, - zwave_endpoint_id_t endpoint_id) -{ - unid_t node_unid; - zwave_unid_from_node_id(node_id, node_unid); - return attribute_store_network_helper_get_endpoint_node(node_unid, - endpoint_id); - -} - bool zwave_security_validation_is_node_s2_capable(zwave_node_id_t node_id) { attribute_store_node_t node_id_node diff --git a/applications/zpc/components/zpc_attribute_store/test/zwave_utils_test.c b/applications/zpc/components/zpc_attribute_store/test/zwave_utils_test.c index 04a0f83b8..b8c5d0646 100644 --- a/applications/zpc/components/zpc_attribute_store/test/zwave_utils_test.c +++ b/applications/zpc/components/zpc_attribute_store/test/zwave_utils_test.c @@ -39,6 +39,29 @@ int suiteTearDown(int num_failures) /// Called before each and every test void setUp() {} +void test_set_node_granted_keys_happy_case() +{ + zwave_node_id_t test_node_id = 119; + attribute_store_node_t test_node_id_node = 1; + zwave_keyset_t keyset + = ZWAVE_CONTROLLER_S2_AUTHENTICATED_KEY | ZWAVE_CONTROLLER_S2_ACCESS_KEY; + + attribute_store_network_helper_create_node_id_node_ExpectAndReturn( + 0, + test_node_id_node); + attribute_store_network_helper_create_node_id_node_IgnoreArg_node_unid(); + + attribute_store_set_child_reported_ExpectAndReturn( + test_node_id_node, + ATTRIBUTE_GRANTED_SECURITY_KEYS, + &keyset, + sizeof(keyset), + SL_STATUS_OK); + + TEST_ASSERT_EQUAL(SL_STATUS_OK, + zwave_set_node_granted_keys(test_node_id, &keyset)); +} + void test_get_nls_state_reported_happy_case() { zwave_node_id_t test_node_id = 119; diff --git a/applications/zpc/components/zwave/CMakeLists.txt b/applications/zpc/components/zwave/CMakeLists.txt index e53018ee9..fcd048883 100644 --- a/applications/zpc/components/zwave/CMakeLists.txt +++ b/applications/zpc/components/zwave/CMakeLists.txt @@ -42,3 +42,29 @@ uic_add_shared_library( target_link_libraries(zwave PUBLIC zwave_definitions unify) +uic_add_shared_library( + zwave_testlib + zwave_transports_testlib + zwave_network_management_testlib + zwave_s2_testlib + zwave_controller_testlib + zwave_rx_testlib + multicast_follow_ups_transport + zwave_tx_groups + zwave_security_validation + zwave_tx + zwave_tx_scheme_selector + zwave_s0_testlib + zwave_api_transport + zwave_s2_nonce_management + s2_controller + s2crypto + aes + zwave_multi_channel + transport_service_wrapper + transport_service + zpc_utils + zwave_api) + +target_link_libraries(zwave_testlib PUBLIC +zwave_definitions unify_testlib) \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_controller/CMakeLists.txt b/applications/zpc/components/zwave/zwave_controller/CMakeLists.txt index 8a7a6dd4b..74f3ed0b6 100644 --- a/applications/zpc/components/zwave/zwave_controller/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_controller/CMakeLists.txt @@ -1,10 +1,13 @@ # Library +set(COMMON_SOURCES + src/zwave_controller.c src/zwave_controller_callbacks.c + src/zwave_controller_crc16.c src/zwave_controller_keyset.c + src/zwave_controller_transport.c src/zwave_controller_utils.c + src/zwave_controller_storage.c) + add_library( zwave_controller - src/zwave_controller.c src/zwave_controller_callbacks.c - src/zwave_controller_crc16.c src/zwave_controller_keyset.c - src/zwave_controller_transport.c src/zwave_controller_utils.c - src/zwave_controller_storage.c) + ${COMMON_SOURCES}) target_include_directories(zwave_controller PUBLIC include src) target_link_libraries( @@ -21,3 +24,21 @@ if(BUILD_TESTING) add_subdirectory(test) endif() + + +# zwave_controller_testlib library +add_library( + zwave_controller_testlib + ${COMMON_SOURCES}) + +target_include_directories(zwave_controller_testlib PUBLIC include src) +target_link_libraries( + zwave_controller_testlib + PUBLIC zwave_rx_testlib zwave_tx zwave_network_management_testlib zwave_tx_scheme_selector + zwave_definitions zwave_tx_groups + PRIVATE unify_testlib zwave_s0 zwave_s2_testlib zpc_utils) +install(TARGETS zwave_controller_testlib LIBRARY DESTINATION lib) + +target_compile_definitions( + zwave_controller_testlib + PRIVATE ZWAVE_TESTLIB) \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_controller/include/zwave_controller.h b/applications/zpc/components/zwave/zwave_controller/include/zwave_controller.h index 1caf6a5ed..364afb763 100644 --- a/applications/zpc/components/zwave/zwave_controller/include/zwave_controller.h +++ b/applications/zpc/components/zwave/zwave_controller/include/zwave_controller.h @@ -43,6 +43,20 @@ extern "C" { #endif +typedef struct +{ + /// The following three configuration types describes the Node type structure + /// that will be used in the ZPC Node Information Frames. + // Z-Wave Basic Device Type + uint8_t zpc_basic_device_type; + /// Z-Wave Generic Device Type + uint8_t zpc_generic_device_type; + /// Z-Wave Specific Device Type + uint8_t zpc_specific_device_type; +} zwave_controller_config_t; + +void zwave_controller_set_config(const zwave_controller_config_t *config); + /** * @brief Set the application part of the node information frame (NIF). * diff --git a/applications/zpc/components/zwave/zwave_controller/include/zwave_controller_callbacks.h b/applications/zpc/components/zwave/zwave_controller/include/zwave_controller_callbacks.h index eac6657cf..a137a5dc8 100644 --- a/applications/zpc/components/zwave/zwave_controller/include/zwave_controller_callbacks.h +++ b/applications/zpc/components/zwave/zwave_controller/include/zwave_controller_callbacks.h @@ -129,7 +129,8 @@ typedef struct { void (*on_new_network_entered)(zwave_home_id_t home_id, zwave_node_id_t node_id, zwave_keyset_t granted_keys, - zwave_kex_fail_type_t kex_fail_type); + zwave_kex_fail_type_t kex_fail_type, + zwave_protocol_t inclusion_protocol); /// This function is used to inform which S2 keys have been requested /// during S2 bootstrapping, the receiver must call diff --git a/applications/zpc/components/zwave/zwave_controller/include/zwave_controller_internal.h b/applications/zpc/components/zwave/zwave_controller/include/zwave_controller_internal.h index 66ddb5329..51bc90af9 100644 --- a/applications/zpc/components/zwave/zwave_controller/include/zwave_controller_internal.h +++ b/applications/zpc/components/zwave/zwave_controller/include/zwave_controller_internal.h @@ -83,7 +83,8 @@ void zwave_controller_on_new_network_entered( zwave_home_id_t home_id, zwave_node_id_t node_id, zwave_keyset_t granted_keys, - zwave_kex_fail_type_t kex_fail_type); + zwave_kex_fail_type_t kex_fail_type, + zwave_protocol_t inclusion_protocol); /// see @ref zwave_controller_callbacks_t void zwave_controller_on_keys_report(bool csa, zwave_keyset_t keys); /// see @ref zwave_controller_callbacks_t diff --git a/applications/zpc/components/zwave/zwave_controller/src/zwave_controller.c b/applications/zpc/components/zwave/zwave_controller/src/zwave_controller.c index f33c86425..caa0c247f 100644 --- a/applications/zpc/components/zwave/zwave_controller/src/zwave_controller.c +++ b/applications/zpc/components/zwave/zwave_controller/src/zwave_controller.c @@ -2,7 +2,7 @@ * # License * Copyright 2021 Silicon Laboratories Inc. www.silabs.com ****************************************************************************** - * The licensor of this software is Silicon Laboratories Inc. Your use of this +* The licensor of this software is Silicon Laboratories Inc. Your use of this * software is governed by the terms of Silicon Labs Master Software License * Agreement (MSLA) available at * www.silabs.com/about-us/legal/master-software-license-agreement. This @@ -14,6 +14,7 @@ //Generic includes #include #include +#include // Includes from other components #include "sl_log.h" @@ -22,7 +23,9 @@ #include "ZW_classcmd.h" #include "zwave_s2_transport.h" +#ifndef ZWAVE_TESTLIB #include "zpc_config.h" +#endif // Includes from this component #include "zwave_controller_utils.h" @@ -33,13 +36,30 @@ // Setup Log ID #define LOG_TAG "zwapi_controller" +#ifdef ZWAVE_TESTLIB +static const zwave_controller_config_t* zwave_controller_config = NULL; + +void zwave_controller_set_config(const zwave_controller_config_t *config) +{ + zwave_controller_config = config; +} +#endif // ZWAVE_TESTLIB + void zwave_controller_set_application_nif(const uint8_t *command_classes, uint8_t command_classes_length) { +#ifndef ZWAVE_TESTLIB node_type_t my_node_type = {.basic = zpc_get_config()->zpc_basic_device_type, .generic = zpc_get_config()->zpc_generic_device_type, .specific = zpc_get_config()->zpc_specific_device_type}; +#else // ZWAVE_TESTLIB + assert(zwave_controller_config != NULL); + node_type_t my_node_type + = {.basic = zwave_controller_config->zpc_basic_device_type, + .generic = zwave_controller_config->zpc_generic_device_type, + .specific = zwave_controller_config->zpc_specific_device_type}; +#endif // ZWAVE_TESTLIB // Tell the Z-Wave module what our NIF should be: zwapi_set_application_node_information(APPLICATION_NODEINFO_LISTENING, my_node_type, diff --git a/applications/zpc/components/zwave/zwave_controller/src/zwave_controller_callbacks.c b/applications/zpc/components/zwave/zwave_controller/src/zwave_controller_callbacks.c index d92b3da52..cab2ab7a7 100644 --- a/applications/zpc/components/zwave/zwave_controller/src/zwave_controller_callbacks.c +++ b/applications/zpc/components/zwave/zwave_controller/src/zwave_controller_callbacks.c @@ -268,19 +268,22 @@ void zwave_controller_on_new_network_entered( zwave_home_id_t home_id, zwave_node_id_t node_id, zwave_keyset_t granted_keys, - zwave_kex_fail_type_t kex_fail_type) + zwave_kex_fail_type_t kex_fail_type, + zwave_protocol_t inclusion_protocol) { sl_log_info(LOG_TAG, "New network ready to be operated. " - "HomeID %08X - ZPC NodeID: %d - Granted keys: 0x%02X", + "HomeID %08X - ZPC NodeID: %d - Granted keys: 0x%02X - Inclusion Protocol: %d", home_id, node_id, - granted_keys); + granted_keys, + inclusion_protocol); ZWAVE_CONTROLLER_DISPATCH_CALLBACKS(on_new_network_entered, home_id, node_id, granted_keys, - kex_fail_type) + kex_fail_type, + inclusion_protocol) } void zwave_controller_on_keys_report(bool csa, zwave_keyset_t keys) @@ -313,23 +316,11 @@ void zwave_controller_on_frame_received( frame_length); //If no transport plugins needs the frame parse it on to upper layers if (status == SL_STATUS_NOT_FOUND) { - // Check if the frame is a protocol CC - if (frame_data[0] == ZWAVE_CMD_CLASS_PROTOCOL || frame_data[0] == ZWAVE_CMD_CLASS_PROTOCOL_LR) - { - ZWAVE_CONTROLLER_DISPATCH_CALLBACKS(on_protocol_frame_received, - connection_info, - rx_options, - frame_data, - frame_length); - } - else - { - ZWAVE_CONTROLLER_DISPATCH_CALLBACKS(on_application_frame_received, - connection_info, - rx_options, - frame_data, - frame_length); - } + ZWAVE_CONTROLLER_DISPATCH_CALLBACKS(on_application_frame_received, + connection_info, + rx_options, + frame_data, + frame_length); } } diff --git a/applications/zpc/components/zwave/zwave_controller/test/zwave_controller_callbacks_test.c b/applications/zpc/components/zwave/zwave_controller/test/zwave_controller_callbacks_test.c index 98d5eb83e..81beafdd6 100644 --- a/applications/zpc/components/zwave/zwave_controller/test/zwave_controller_callbacks_test.c +++ b/applications/zpc/components/zwave/zwave_controller/test/zwave_controller_callbacks_test.c @@ -98,15 +98,6 @@ static void zwave_controller_on_protocol_cc_encryption_request( zwave_controller_on_protocol_cc_encryption_request_count += 1; } -static void zwave_controller_on_protocol_frame_received( - const zwave_controller_connection_info_t *connection_info, - const zwave_rx_receive_options_t *rx_options, - const uint8_t *frame_data, - uint16_t frame_length) -{ - zwave_controller_on_protocol_frame_received_count += 1; -} - static void zwave_controller_on_node_event_test(zwave_node_id_t node_id) { zwave_controller_on_node_event_test_call_count += 1; @@ -344,74 +335,6 @@ void test_zwave_controller_on_protocol_cc_encryption_request_received() callbacks.on_protocol_cc_encryption_request = NULL; } -void test_zwave_controller_on_controller_protocol_frames() -{ - // We need to inject a valid frame, as this will go through the transports - zwave_controller_on_frame_received(&info, - &rx_options, - protocol_frame_data, - sizeof(protocol_frame_data)); - TEST_ASSERT_EQUAL(0, zwave_controller_on_protocol_frame_received_count); - TEST_ASSERT_EQUAL(0, zwave_controller_on_rx_frame_received_count); - TEST_ASSERT_EQUAL(0, zwave_controller_on_application_frame_received_count); - - callbacks.on_rx_frame_received - = &zwave_controller_on_rx_frame_received_callback; - callbacks.on_application_frame_received - = &zwave_controller_on_application_frame_received; - callbacks.on_protocol_frame_received - = &zwave_controller_on_protocol_frame_received; - TEST_ASSERT_EQUAL(SL_STATUS_OK, - zwave_controller_register_callbacks(&callbacks)); - - zwave_controller_on_frame_received(&info, - &rx_options, - protocol_frame_data, - sizeof(protocol_frame_data)); - TEST_ASSERT_EQUAL(1, zwave_controller_on_protocol_frame_received_count); - TEST_ASSERT_EQUAL(0, zwave_controller_on_application_frame_received_count); - TEST_ASSERT_EQUAL(0, zwave_controller_on_rx_frame_received_count); - - // remove these callbacks: - callbacks.on_rx_frame_received = NULL; - callbacks.on_application_frame_received = NULL; - callbacks.on_protocol_frame_received = NULL; -} - -void test_zwave_controller_on_controller_protocol_lr_frames() -{ - // We need to inject a valid frame, as this will go through the transports - zwave_controller_on_frame_received(&info, - &rx_options, - protocol_lr_frame_data, - sizeof(protocol_lr_frame_data)); - TEST_ASSERT_EQUAL(0, zwave_controller_on_protocol_frame_received_count); - TEST_ASSERT_EQUAL(0, zwave_controller_on_rx_frame_received_count); - TEST_ASSERT_EQUAL(0, zwave_controller_on_application_frame_received_count); - - callbacks.on_rx_frame_received - = &zwave_controller_on_rx_frame_received_callback; - callbacks.on_application_frame_received - = &zwave_controller_on_application_frame_received; - callbacks.on_protocol_frame_received - = &zwave_controller_on_protocol_frame_received; - TEST_ASSERT_EQUAL(SL_STATUS_OK, - zwave_controller_register_callbacks(&callbacks)); - - zwave_controller_on_frame_received(&info, - &rx_options, - protocol_lr_frame_data, - sizeof(protocol_lr_frame_data)); - TEST_ASSERT_EQUAL(1, zwave_controller_on_protocol_frame_received_count); - TEST_ASSERT_EQUAL(0, zwave_controller_on_application_frame_received_count); - TEST_ASSERT_EQUAL(0, zwave_controller_on_rx_frame_received_count); - - // remove these callbacks: - callbacks.on_rx_frame_received = NULL; - callbacks.on_application_frame_received = NULL; - callbacks.on_protocol_frame_received = NULL; -} - void test_zwave_controller_on_network_address_update() { // Nothing happens with no callback registered diff --git a/applications/zpc/components/zwave/zwave_definitions/include/zwave_network_management_types.h b/applications/zpc/components/zwave/zwave_definitions/include/zwave_network_management_types.h index 5c89e27ce..24c681302 100644 --- a/applications/zpc/components/zwave/zwave_definitions/include/zwave_network_management_types.h +++ b/applications/zpc/components/zwave/zwave_definitions/include/zwave_network_management_types.h @@ -104,6 +104,8 @@ typedef enum { typedef enum { /// No Learn mode intent. ZWAVE_NETWORK_MANAGEMENT_LEARN_NONE, + /// Classic Z-Wave learn mode, ie without Network Wide Inclusion + ZWAVE_NETWORK_MANAGEMENT_LEARN_DIRECT_RANGE, /// Network Wide Inclusion learn mode ZWAVE_NETWORK_MANAGEMENT_LEARN_NWI, /// Enable Network Wide Exclusion diff --git a/applications/zpc/components/zwave/zwave_definitions/include/zwave_rf_region.h b/applications/zpc/components/zwave/zwave_definitions/include/zwave_rf_region.h index 5b1cb622f..d8641e664 100644 --- a/applications/zpc/components/zwave/zwave_definitions/include/zwave_rf_region.h +++ b/applications/zpc/components/zwave/zwave_definitions/include/zwave_rf_region.h @@ -54,7 +54,9 @@ typedef enum { ///< Radio is located in Korea. 3 Channel region. ZWAVE_RF_REGION_KR = 0x21, ///< RF region is unknown - ZWAVE_RF_REGION_UNDEFINED = 0xFE + ZWAVE_RF_REGION_UNDEFINED = 0xFE, + ///< Radio is located in Library Default Region EU. 2 Channel region. + ZWAVE_RF_REGION_DEFAULT = 0xFF } zwave_rf_region_t; ///@} diff --git a/applications/zpc/components/zwave/zwave_network_management/CMakeLists.txt b/applications/zpc/components/zwave/zwave_network_management/CMakeLists.txt index 0e3fa62f2..2e715de70 100644 --- a/applications/zpc/components/zwave/zwave_network_management/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_network_management/CMakeLists.txt @@ -1,14 +1,17 @@ +set (COMMON_SOURCES + src/nm_state_machine.c + src/state_logging.c + src/zwave_network_management.c + src/zwave_network_management_fixt.c + src/zwave_network_management_process.c + src/zwave_network_management_helpers.c + src/zwave_network_management_callbacks.c + src/zwave_network_management_return_route_queue.c) + # Library add_library( zwave_network_management - src/nm_state_machine.c - src/state_logging.c - src/zwave_network_management.c - src/zwave_network_management_fixt.c - src/zwave_network_management_process.c - src/zwave_network_management_helpers.c - src/zwave_network_management_callbacks.c - src/zwave_network_management_return_route_queue.c) + ${COMMON_SOURCES}) target_link_libraries(zwave_network_management PUBLIC unify @@ -28,3 +31,18 @@ if(BUILD_TESTING) target_link_libraries(zwave_network_management_helpers_mock PUBLIC zwave_controller) endif() + +# zwave_network_management_testlib library +add_library( + zwave_network_management_testlib + ${COMMON_SOURCES}) + +target_link_libraries(zwave_network_management_testlib + PUBLIC unify_testlib + PRIVATE zwave_s0 zwave_s2_testlib zwave_controller_testlib) +target_include_directories(zwave_network_management_testlib PUBLIC include) +install(TARGETS zwave_network_management_testlib LIBRARY DESTINATION lib) + +target_compile_definitions( + zwave_network_management_testlib + PRIVATE ZWAVE_TESTLIB) diff --git a/applications/zpc/components/zwave/zwave_network_management/include/zwave_network_management.h b/applications/zpc/components/zwave/zwave_network_management/include/zwave_network_management.h index 30acf2875..5c70fdb64 100644 --- a/applications/zpc/components/zwave/zwave_network_management/include/zwave_network_management.h +++ b/applications/zpc/components/zwave/zwave_network_management/include/zwave_network_management.h @@ -88,6 +88,8 @@ sl_status_t zwave_network_management_abort(); */ sl_status_t zwave_network_management_add_node(); +sl_status_t zwave_network_management_add_node_classic(); + /** * @brief Put the Z-Wave controller in SmartStart add node mode. * @@ -184,6 +186,8 @@ sl_status_t zwave_network_management_dsk_set(zwave_dsk_t dsk); */ sl_status_t zwave_network_management_remove_node(); +sl_status_t zwave_network_management_remove_node_classic(); + /** * @brief Put the Z-Wave controller in learn mode. * diff --git a/applications/zpc/components/zwave/zwave_network_management/src/nm_state_machine.c b/applications/zpc/components/zwave/zwave_network_management/src/nm_state_machine.c index a6c2e0e8c..64b656bc8 100644 --- a/applications/zpc/components/zwave/zwave_network_management/src/nm_state_machine.c +++ b/applications/zpc/components/zwave/zwave_network_management/src/nm_state_machine.c @@ -44,7 +44,9 @@ #include "zwave_s2_network.h" #include "zwave_s2_keystore.h" #include "zwave_tx.h" +#ifndef ZWAVE_TESTLIB #include "zwave_smartstart_management.h" +#endif // Unify components #include "sl_log.h" @@ -267,14 +269,17 @@ static void on_new_network(zwave_kex_fail_type_t kex_fail) network_management_refresh_network_information(); nms.granted_keys = zwave_s2_keystore_get_assigned_keys(); +#ifndef ZWAVE_TESTLIB // Take the SUC/SIS role if noboby has it in our new network. network_management_take_sis_role_if_no_suc_in_network(); +#endif //Call the upper layer callbacks zwave_controller_on_new_network_entered(nms.cached_home_id, nms.cached_local_node_id, nms.granted_keys, - kex_fail); + kex_fail, + nms.inclusion_protocol); } static void @@ -335,7 +340,9 @@ void nm_state_machine_init() sl_log_info(LOG_TAG, "NodeID %d is present in our network", node_id); } +#ifndef ZWAVE_TESTLIB network_management_take_sis_role_if_no_suc_in_network(); +#endif } void nm_fsm_post_event(nm_event_t ev, void *event_data) @@ -350,7 +357,9 @@ void nm_fsm_post_event(nm_event_t ev, void *event_data) if (ev == NM_EV_LEARN_SET) { // Make sure to stop ongoing network management operations network_management_stop_ongoing_operations(); - if (nms.learn_mode_intent == ZWAVE_NETWORK_MANAGEMENT_LEARN_NWI) { + if (nms.learn_mode_intent == ZWAVE_NETWORK_MANAGEMENT_LEARN_DIRECT_RANGE) { + zwapi_set_learn_mode(LEARN_MODE_DIRECT_RANGE, &on_learn_mode_callback); + } else if (nms.learn_mode_intent == ZWAVE_NETWORK_MANAGEMENT_LEARN_NWI) { zwapi_set_learn_mode(LEARN_MODE_NWI, &on_learn_mode_callback); } else if (nms.learn_mode_intent == ZWAVE_NETWORK_MANAGEMENT_LEARN_NWE) { @@ -423,9 +432,12 @@ void nm_fsm_post_event(nm_event_t ev, void *event_data) } else if (ev == NM_EV_NODE_REMOVE) { network_management_stop_ongoing_operations(); nms.node_id_being_handled = 0; + uint8_t mode = REMOVE_NODE_ANY; + if (nms.network_wide) { + mode |= REMOVE_NODE_OPTION_NETWORK_WIDE; + } sl_status_t remove_node_status = zwapi_remove_node_from_network( - (REMOVE_NODE_ANY | REMOVE_NODE_OPTION_NETWORK_WIDE), - on_remove_node_status_update); + mode, on_remove_node_status_update); if (remove_node_status == SL_STATUS_OK) { nms.state = NM_WAITING_FOR_NODE_REMOVAL; etimer_set(&nms.timer, ADD_REMOVE_TIMEOUT); @@ -433,8 +445,11 @@ void nm_fsm_post_event(nm_event_t ev, void *event_data) } else if (ev == NM_EV_NODE_ADD) { network_management_stop_ongoing_operations(); network_management_refresh_cached_node_list(); - zwapi_add_node_to_network(ADD_NODE_ANY | ADD_NODE_OPTION_NETWORK_WIDE, - add_node_status_update); + uint8_t mode = ADD_NODE_ANY; + if (nms.network_wide) { + mode |= ADD_NODE_OPTION_NETWORK_WIDE; + } + zwapi_add_node_to_network(mode, add_node_status_update); nms.state = NM_WAITING_FOR_ADD; nms.flags = NMS_FLAG_S2_ADD; nms.inclusion_protocol = PROTOCOL_ZWAVE; @@ -780,24 +795,28 @@ void nm_fsm_post_event(nm_event_t ev, void *event_data) zwave_s2_dsk_accept(REJECT_DSK, 0, 0); } } else { - if (find_dsk_obfuscated_bytes_from_smart_start_list( - nms.reported_dsk, - OBFUSCATED_DSK_LEN)) { - sl_log_debug(LOG_TAG, - "SmartStart: Input DSK found in provisioning list\n"); - sl_log_byte_arr(LOG_TAG, - SL_LOG_DEBUG, - nms.reported_dsk, - sizeof(zwave_dsk_t)) +#ifndef ZWAVE_TESTLIB + if (find_dsk_obfuscated_bytes_from_smart_start_list( + nms.reported_dsk, + OBFUSCATED_DSK_LEN)) { + sl_log_debug(LOG_TAG, + "SmartStart: Input DSK found in provisioning list\n"); + sl_log_byte_arr(LOG_TAG, + SL_LOG_DEBUG, + nms.reported_dsk, + sizeof(zwave_dsk_t)) zwave_s2_dsk_accept(ACCEPT_DSK, nms.reported_dsk, OBFUSCATED_DSK_LEN); - } else { - // Non-SmartStart inclusions sends the request upwards - zwave_controller_on_dsk_report(nms.reported_dsk_blanked, - nms.reported_dsk, - nms.requested_keys); - } + } else { +#endif + // Non-SmartStart inclusions sends the request upwards + zwave_controller_on_dsk_report(nms.reported_dsk_blanked, + nms.reported_dsk, + nms.requested_keys); +#ifndef ZWAVE_TESTLIB + } +#endif } } else if (ev == NM_EV_ADD_SECURITY_KEYS_SET) { zwave_s2_key_grant(nms.accepted_s2_bootstrapping, @@ -872,11 +891,14 @@ void nm_fsm_post_event(nm_event_t ev, void *event_data) if (ev == NM_EV_TIMEOUT || ev == NM_EV_ABORT) { // Just stop trying when we time out or abort zwapi_set_learn_mode(LEARN_MODE_DISABLE, NULL); + network_management_refresh_network_information(); nms.state = NM_IDLE; } else if (ev == NM_EV_LEARN_STARTED) { + nms.inclusion_protocol = PROTOCOL_ZWAVE; /* Start security here to make sure the timers are started in time */ // Do not accept S0 bootstrapping after a SmartStart inclusion. - if (nms.learn_mode_intent == ZWAVE_NETWORK_MANAGEMENT_LEARN_NWI) { + if (nms.learn_mode_intent == ZWAVE_NETWORK_MANAGEMENT_LEARN_DIRECT_RANGE + || nms.learn_mode_intent == ZWAVE_NETWORK_MANAGEMENT_LEARN_NWI) { zwave_s0_start_learn_mode(nms.node_id_being_handled); zwave_s2_start_learn_mode(nms.node_id_being_handled); } else if (nms.learn_mode_intent @@ -932,6 +954,12 @@ void nm_fsm_post_event(nm_event_t ev, void *event_data) zwave_controller_on_error( ZWAVE_NETWORK_MANAGEMENT_ERROR_NODE_LEARN_MODE_FAIL); nms.state = NM_IDLE; + } else if (ev == NM_EV_ABORT) { + zwapi_set_learn_mode(LEARN_MODE_DISABLE, NULL); + zwave_s2_abort_join(); + zwave_s0_stop_bootstrapping(); + network_management_refresh_network_information(); + nms.state = NM_IDLE; } break; case NM_WAIT_FOR_SECURE_LEARN: diff --git a/applications/zpc/components/zwave/zwave_network_management/src/nm_state_machine.h b/applications/zpc/components/zwave/zwave_network_management/src/nm_state_machine.h index 9a6d0fa7a..92aef1112 100644 --- a/applications/zpc/components/zwave/zwave_network_management/src/nm_state_machine.h +++ b/applications/zpc/components/zwave/zwave_network_management/src/nm_state_machine.h @@ -83,6 +83,9 @@ typedef struct network_mgmt_state { /// Whether S0 inclusion/bootstrapping is enabled. bool s0_inclusion_enabled; + + /// Indicates if node inclusion / exclusion should be network wide. + bool network_wide; } network_mgmt_state_t; extern network_mgmt_state_t nms; diff --git a/applications/zpc/components/zwave/zwave_network_management/src/zwave_network_management.c b/applications/zpc/components/zwave/zwave_network_management/src/zwave_network_management.c index 393e3861b..a18ce8c48 100644 --- a/applications/zpc/components/zwave/zwave_network_management/src/zwave_network_management.c +++ b/applications/zpc/components/zwave/zwave_network_management/src/zwave_network_management.c @@ -112,6 +112,13 @@ sl_status_t zwave_network_management_remove_failed(zwave_node_id_t node_id) return SL_STATUS_OK; } +static sl_status_t zwave_network_management_remove_node_internal() +{ + sl_log_info(LOG_TAG, "Initiating a Z-Wave Network Exclusion\n"); + process_post(&zwave_network_management_process, NM_EV_NODE_REMOVE, 0); + return SL_STATUS_OK; +} + sl_status_t zwave_network_management_remove_node() { if (false == network_management_is_ready_for_a_new_operation()) { @@ -121,9 +128,20 @@ sl_status_t zwave_network_management_remove_node() return SL_STATUS_FAIL; } - sl_log_info(LOG_TAG, "Initiating a Z-Wave Network Exclusion\n"); - process_post(&zwave_network_management_process, NM_EV_NODE_REMOVE, 0); - return SL_STATUS_OK; + nms.network_wide = true; + return zwave_network_management_remove_node_internal(); +} + +sl_status_t zwave_network_management_remove_node_classic() +{ + if (false == network_management_is_ready_for_a_new_operation()) { + sl_log_info(LOG_TAG, + "Network management is not ready for a new operation. " + "Ignoring Remove Node request.\n"); + return SL_STATUS_FAIL; + } + nms.network_wide = false; + return zwave_network_management_remove_node_internal(); } static sl_status_t zwave_network_management_stop_add_mode() @@ -155,6 +173,13 @@ sl_status_t zwave_network_management_abort() return SL_STATUS_IDLE; } +static sl_status_t zwave_network_management_add_node_internal() +{ + sl_log_info(LOG_TAG, "Initiating a Z-Wave Network Inclusion\n"); + process_post(&zwave_network_management_process, NM_EV_NODE_ADD, 0); + return SL_STATUS_OK; +} + sl_status_t zwave_network_management_add_node() { if (false == network_management_is_ready_for_a_new_operation()) { @@ -164,9 +189,21 @@ sl_status_t zwave_network_management_add_node() return SL_STATUS_FAIL; } - sl_log_info(LOG_TAG, "Initiating a Z-Wave Network Inclusion\n"); - process_post(&zwave_network_management_process, NM_EV_NODE_ADD, 0); - return SL_STATUS_OK; + nms.network_wide = true; + return zwave_network_management_add_node_internal(); +} + +sl_status_t zwave_network_management_add_node_classic() +{ + if (false == network_management_is_ready_for_a_new_operation()) { + sl_log_info(LOG_TAG, + "Network management is not ready for a new operation. " + "Ignoring Add node request.\n"); + return SL_STATUS_FAIL; + } + + nms.network_wide = false; + return zwave_network_management_add_node_internal(); } sl_status_t zwave_network_management_keys_set(bool accept, diff --git a/applications/zpc/components/zwave/zwave_network_management/test/zwave_network_management_learn_mode_test.c b/applications/zpc/components/zwave/zwave_network_management/test/zwave_network_management_learn_mode_test.c index 6fe3b8046..299350ec2 100644 --- a/applications/zpc/components/zwave/zwave_network_management/test/zwave_network_management_learn_mode_test.c +++ b/applications/zpc/components/zwave/zwave_network_management/test/zwave_network_management_learn_mode_test.c @@ -103,6 +103,8 @@ void test_zwave_network_management_stop_learn_mode_happy_case() zwapi_set_learn_mode_ExpectAndReturn(LEARN_MODE_DISABLE, NULL, SL_STATUS_OK); reset_nms_last_operation_data_Expect(); + network_management_refresh_network_information_Expect(); + contiki_test_helper_run(1); // State must have been updated to IDLE TEST_ASSERT_EQUAL(NM_IDLE, zwave_network_management_get_state()); @@ -185,6 +187,7 @@ void test_zwave_network_management_learn_mode_nwi_timeout() TEST_ASSERT_EQUAL(NM_LEARN_MODE, zwave_network_management_get_state()); TEST_ASSERT_EQUAL(ZWAVE_NETWORK_MANAGEMENT_LEARN_NWI, nms.learn_mode_intent); + network_management_refresh_network_information_Expect(); // Pass the timeout, it will tell the Z-Wave API to abort zwapi_set_learn_mode_ExpectAndReturn(LEARN_MODE_DISABLE, NULL, SL_STATUS_OK); reset_nms_last_operation_data_Expect(); @@ -212,6 +215,7 @@ void test_zwave_network_management_learn_mode_nwe_timeout() TEST_ASSERT_EQUAL(NM_LEARN_MODE, zwave_network_management_get_state()); TEST_ASSERT_EQUAL(ZWAVE_NETWORK_MANAGEMENT_LEARN_NWE, nms.learn_mode_intent); + network_management_refresh_network_information_Expect(); // Pass the timeout, it will tell the Z-Wave API to abort zwapi_set_learn_mode_ExpectAndReturn(LEARN_MODE_DISABLE, NULL, SL_STATUS_OK); reset_nms_last_operation_data_Expect(); diff --git a/applications/zpc/components/zwave/zwave_network_management/test/zwave_network_management_test.c b/applications/zpc/components/zwave/zwave_network_management/test/zwave_network_management_test.c index 1f4f78462..efea2510e 100644 --- a/applications/zpc/components/zwave/zwave_network_management/test/zwave_network_management_test.c +++ b/applications/zpc/components/zwave/zwave_network_management/test/zwave_network_management_test.c @@ -1324,7 +1324,8 @@ void test_set_default() home_id, node_id, 0x87, - ZWAVE_NETWORK_MANAGEMENT_KEX_FAIL_NONE); + ZWAVE_NETWORK_MANAGEMENT_KEX_FAIL_NONE, + PROTOCOL_ZWAVE); //expect_smart_start_enable(); @@ -2426,6 +2427,9 @@ void test_zwave_network_management_learn_mode_abort() contiki_test_helper_run(0); TEST_ASSERT_EQUAL(NM_LEARN_MODE, zwave_network_management_get_state()); + zwapi_memory_get_ids_ExpectAndReturn(0, 0, SL_STATUS_OK); + zwapi_memory_get_ids_IgnoreArg_home_id(); + zwapi_memory_get_ids_IgnoreArg_node_id(); zwave_network_management_abort(); TEST_ASSERT_EQUAL(NM_LEARN_MODE, zwave_network_management_get_state()); diff --git a/applications/zpc/components/zwave/zwave_rx/CMakeLists.txt b/applications/zpc/components/zwave/zwave_rx/CMakeLists.txt index 201c18aa3..f1a13ed29 100644 --- a/applications/zpc/components/zwave/zwave_rx/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_rx/CMakeLists.txt @@ -11,8 +11,18 @@ target_include_directories(zwave_rx PUBLIC include) target_link_libraries(zwave_rx PRIVATE zwave_controller zwave_definitions - unify - PUBLIC zpc_config) + unify) + +IF(NOT ZWAVE_BUILD_SYSTEM EQUAL 1) + target_link_libraries(zwave_rx + PUBLIC zpc_config + PRIVATE unify) +ENDIF() + +IF(ZWAVE_BUILD_SYSTEM EQUAL 1) + target_link_libraries(zwave_rx + PUBLIC zpc_config) +ENDIF() if(BUILD_TESTING) # CMock for Z - Wave RX @@ -20,3 +30,18 @@ if(BUILD_TESTING) add_subdirectory(test) endif() + +# zwave_rx_testlib library +add_library(zwave_rx_testlib ${SOURCE_LIST} src/zwave_rx_zwapi_callbacks.c) + +target_include_directories(zwave_rx_testlib PUBLIC include) + +target_link_libraries(zwave_rx_testlib + PRIVATE zwave_controller_testlib + zwave_definitions + unify_testlib) + +target_link_libraries(zwave_rx_testlib + PRIVATE uic_main_fd_testlib) + +target_compile_definitions(zwave_rx_testlib PRIVATE ZWAVE_TESTLIB) diff --git a/applications/zpc/components/zwave/zwave_rx/include/zwave_rx_fixt.h b/applications/zpc/components/zwave/zwave_rx/include/zwave_rx_fixt.h index 07fffce4a..5e4b27a2d 100644 --- a/applications/zpc/components/zwave/zwave_rx/include/zwave_rx_fixt.h +++ b/applications/zpc/components/zwave/zwave_rx/include/zwave_rx_fixt.h @@ -33,6 +33,26 @@ extern "C" { #endif +typedef struct +{ + /// Name of the serial port of the Z-Wave module + const char *serial_port; + /// If set the Serial log will be written here + const char *serial_log_file; + /// Z-Wave RF Region setting. It can be one of the following: + // "EU", "US","ANZ", HK", "IN", "IL", "RU", "CN", "JP", "KR" + const char *zwave_rf_region; + /// Transmit power for the Z-Wave module. Refer to \ref zwave_rx_init + int zwave_normal_tx_power_dbm; + /// Measured 0dBm output power for the Z-Wave module. + /// Refer to \ref zwave_rx_init + int zwave_measured_0dbm_power; + /// Max Z-Wave Long Range Transmit power + int zwave_max_lr_tx_power_dbm; +} zwave_rx_config_t; + +void zwave_rx_set_config(const zwave_rx_config_t* config); + /** Setup fixture for Z-Wave RX. * * This setup function will initialize the communication with the diff --git a/applications/zpc/components/zwave/zwave_rx/src/zwave_rx.c b/applications/zpc/components/zwave/zwave_rx/src/zwave_rx.c index b5e11e97a..1baffb95c 100644 --- a/applications/zpc/components/zwave/zwave_rx/src/zwave_rx.c +++ b/applications/zpc/components/zwave/zwave_rx/src/zwave_rx.c @@ -175,7 +175,12 @@ sl_status_t zwave_rx_init(const char *serial_port, // if the module does not support it, we still try and fail, we should not run // if the user config indicates an RF region and the Z-Wave API runs another. sl_log_info(LOG_TAG, "Setting the Z-Wave RF region to %d\n", region); - if (region != zwapi_get_rf_region()) { + zwave_rf_region_t current_region = zwapi_get_rf_region(); + if (current_region == ZWAVE_RF_REGION_DEFAULT) + { + current_region = ZWAVE_RF_REGION_EU; + } + if (region != current_region) { command_status = zwapi_set_rf_region(region); if (command_status == SL_STATUS_NOT_SUPPORTED) { sl_log_critical( diff --git a/applications/zpc/components/zwave/zwave_rx/src/zwave_rx_fixt.c b/applications/zpc/components/zwave/zwave_rx/src/zwave_rx_fixt.c index 487d1bdb3..2a8845997 100644 --- a/applications/zpc/components/zwave/zwave_rx/src/zwave_rx_fixt.c +++ b/applications/zpc/components/zwave/zwave_rx/src/zwave_rx_fixt.c @@ -14,14 +14,20 @@ #include #include #include +#include // Includes from other components #include "sl_status.h" +#ifndef ZWAVE_TESTLIB #include "zpc_config.h" +#endif #include "uic_main_externals.h" #include "zwave_api.h" // Includes from this component +#ifdef ZWAVE_TESTLIB +#include "zwave_rx_fixt.h" +#endif #include "zwave_rx.h" #include "zwave_rx_internals.h" #include "zwave_rx_process.h" @@ -64,23 +70,37 @@ static uint8_t zwave_rx_zpc_config_to_rf_region(const char *region_string) return ZWAVE_RX_FIXT_DEFAULT_RF_REGION; } +#ifdef ZWAVE_TESTLIB +static const zwave_rx_config_t *zwave_rx_config = NULL; + +void zwave_rx_set_config(const zwave_rx_config_t* config) +{ + zwave_rx_config = config; +} +#endif // ZWAVE_TESTLIB + sl_status_t zwave_rx_fixt_setup(void) { int zpc_zwave_serial_read_fd = 0; sl_status_t rx_init_status = SL_STATUS_FAIL; +#ifndef ZWAVE_TESTLIB + const zpc_config_t * zwave_rx_config = zpc_get_config(); +#endif + + assert(zwave_rx_config != NULL); // Enable serial log before init, so we can see initialization frames too - rx_init_status = zwapi_log_to_file_enable(zpc_get_config()->serial_log_file); + rx_init_status = zwapi_log_to_file_enable(zwave_rx_config->serial_log_file); // Now initialize the serial port if (SL_STATUS_OK == rx_init_status) { rx_init_status = zwave_rx_init( - zpc_get_config()->serial_port, + zwave_rx_config->serial_port, &zpc_zwave_serial_read_fd, - zpc_get_config()->zwave_normal_tx_power_dbm, - zpc_get_config()->zwave_measured_0dbm_power, - zpc_get_config()->zwave_max_lr_tx_power_dbm, - zwave_rx_zpc_config_to_rf_region(zpc_get_config()->zwave_rf_region)); + zwave_rx_config->zwave_normal_tx_power_dbm, + zwave_rx_config->zwave_measured_0dbm_power, + zwave_rx_config->zwave_max_lr_tx_power_dbm, + zwave_rx_zpc_config_to_rf_region(zwave_rx_config->zwave_rf_region)); } if (SL_STATUS_OK == rx_init_status) { diff --git a/applications/zpc/components/zwave/zwave_rx/src/zwave_rx_process.c b/applications/zpc/components/zwave/zwave_rx/src/zwave_rx_process.c index 437545fe0..4ed1df678 100644 --- a/applications/zpc/components/zwave/zwave_rx/src/zwave_rx_process.c +++ b/applications/zpc/components/zwave/zwave_rx/src/zwave_rx_process.c @@ -16,7 +16,9 @@ #include "zwave_rx_internals.h" // Includes from other components +#ifndef ZWAVE_TESTLIB #include "zpc_config.h" +#endif #include "zwapi_init.h" // Contiki includes diff --git a/applications/zpc/components/zwave/zwave_rx/test/CMakeLists.txt b/applications/zpc/components/zwave/zwave_rx/test/CMakeLists.txt index dd38ce8a2..0e13f698f 100644 --- a/applications/zpc/components/zwave/zwave_rx/test/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_rx/test/CMakeLists.txt @@ -8,13 +8,12 @@ target_add_unittest( zwave_rx SOURCES zwave_rx_test.c - zwave_rx_test_zpc_config_mock.c DEPENDS zwave_api_mock uic_main_fd_mock zwave_controller_mock + zpc_config_mock uic_contiki_stub) - target_include_directories(zwave_rx_test PRIVATE ../src) target_add_unittest( diff --git a/applications/zpc/components/zwave/zwave_rx/test/zwave_rx_test.c b/applications/zpc/components/zwave/zwave_rx/test/zwave_rx_test.c index 3f89ee4a0..8ff54d2ce 100644 --- a/applications/zpc/components/zwave/zwave_rx/test/zwave_rx_test.c +++ b/applications/zpc/components/zwave/zwave_rx/test/zwave_rx_test.c @@ -30,6 +30,7 @@ #include "zwave_controller_callbacks_mock.h" #include "zwave_controller_internal_mock.h" #include "zwave_controller_utils_mock.h" +#include "zpc_config_mock.h" // Includes from this component #include "zwave_rx_test.h" @@ -43,6 +44,15 @@ static zwapi_callbacks_t *registered_zwapi_callbacks = NULL; static zwapi_chip_data_t test_chip_data = {0}; static zwapi_protocol_version_information_t test_protocol_version = {0}; +static const zpc_config_t my_test_configuration = { + .serial_log_file = "", + .serial_port = ZWAVE_RX_TEST_SERIAL_PORT, + .zwave_normal_tx_power_dbm = ZWAVE_RX_TEST_MAXIMUM_POWER_DBM, + .zwave_measured_0dbm_power = ZWAVE_RX_TEST_MEASURED_0DBM_POWER, + .zwave_rf_region = ZWAVE_RX_TEST_RF_REGION_STRING + // All other fields will be zero-initialized +}; + // Stub function used for retrieving callbacks registered to the zwapi module sl_status_t zwapi_init_stub(const char *serial_port, int *serial_fd, @@ -82,6 +92,7 @@ static void rx_init_successful_test_helper() zwapi_init_ExpectAndReturn(ZWAVE_RX_TEST_SERIAL_PORT, 0, 0, SL_STATUS_OK); zwapi_init_IgnoreArg_serial_fd(); zwapi_init_IgnoreArg_callbacks(); + zpc_get_config_IgnoreAndReturn(&my_test_configuration); zwapi_log_to_file_enable_ExpectAndReturn("", SL_STATUS_OK); // 2. zwapi_get_chip_data returns a controller library type zwapi_get_chip_data_Stub( @@ -129,7 +140,8 @@ static void rx_init_successful_test_helper() } /// Setup the test suite (called once before all test_xxx functions are called) -void suiteSetUp() {} +void suiteSetUp() { +} /// Teardown the test suite (called once after all test_xxx functions are called) int suiteTearDown(int num_failures) @@ -145,6 +157,7 @@ void setUp() /// Test of rx init where enabling the log file fails void test_zwave_rx_init_zwapi_init_log_file_fails(void) { + zpc_get_config_IgnoreAndReturn(&my_test_configuration); // Intialize Z-Wave RX, we expect it to call zwapi functions. zwapi_log_to_file_enable_ExpectAndReturn("", SL_STATUS_FAIL); @@ -156,6 +169,7 @@ void test_zwave_rx_init_zwapi_init_log_file_fails(void) void test_zwave_rx_init_zwapi_init_fails(void) { // Intialize Z-Wave RX, we expect it to call zwapi functions. + zpc_get_config_IgnoreAndReturn(&my_test_configuration); zwapi_log_to_file_enable_ExpectAndReturn("", SL_STATUS_OK); zwapi_init_ExpectAndReturn(ZWAVE_RX_TEST_SERIAL_PORT, 0, 0, SL_STATUS_FAIL); zwapi_init_IgnoreArg_callbacks(); @@ -174,6 +188,8 @@ void test_zwave_rx_init_wrong_library() || library == ZWAVE_LIBRARY_TYPE_CONTROLLER_STATIC) { continue; } + zpc_get_config_IgnoreAndReturn(&my_test_configuration); + // Intialize Z-Wave RX, we expect it to call zwapi functions. zwapi_log_to_file_enable_ExpectAndReturn("", SL_STATUS_OK); zwapi_init_ExpectAndReturn(ZWAVE_RX_TEST_SERIAL_PORT, 0, 0, SL_STATUS_OK); @@ -201,6 +217,7 @@ void test_zwave_rx_init_not_gecko_chip() zwapi_init_ExpectAndReturn(ZWAVE_RX_TEST_SERIAL_PORT, 0, 0, SL_STATUS_OK); zwapi_init_IgnoreArg_callbacks(); zwapi_init_IgnoreArg_serial_fd(); + zpc_get_config_IgnoreAndReturn(&my_test_configuration); zwapi_log_to_file_enable_ExpectAndReturn("", SL_STATUS_OK); // 2. zwapi_get_chip_data returns a controller library type @@ -244,6 +261,7 @@ void test_zwave_rx_init_cannot_set_rf_resgion() zwapi_init_ExpectAndReturn(ZWAVE_RX_TEST_SERIAL_PORT, 0, 0, SL_STATUS_OK); zwapi_init_IgnoreArg_callbacks(); zwapi_init_IgnoreArg_serial_fd(); + zpc_get_config_IgnoreAndReturn(&my_test_configuration); zwapi_log_to_file_enable_ExpectAndReturn("", SL_STATUS_OK); // 2. zwapi_get_chip_data returns a controller library type @@ -283,6 +301,7 @@ void test_zwave_rx_init_failure_lr_max_power() zwapi_init_ExpectAndReturn(ZWAVE_RX_TEST_SERIAL_PORT, 0, 0, SL_STATUS_OK); zwapi_init_IgnoreArg_callbacks(); zwapi_init_IgnoreArg_serial_fd(); + zpc_get_config_IgnoreAndReturn(&my_test_configuration); zwapi_log_to_file_enable_ExpectAndReturn("", SL_STATUS_OK); // 2. zwapi_get_chip_data returns a controller library type @@ -343,6 +362,7 @@ void test_zwave_rx_init_non_critical_failures() zwapi_init_ExpectAndReturn(ZWAVE_RX_TEST_SERIAL_PORT, 0, 0, SL_STATUS_OK); zwapi_init_IgnoreArg_callbacks(); zwapi_init_IgnoreArg_serial_fd(); + zpc_get_config_IgnoreAndReturn(&my_test_configuration); zwapi_log_to_file_enable_ExpectAndReturn("", SL_STATUS_OK); // 2. zwapi_get_chip_data returns a controller library type diff --git a/applications/zpc/components/zwave/zwave_rx/test/zwave_rx_test_zpc_config_mock.c b/applications/zpc/components/zwave/zwave_rx/test/zwave_rx_test_zpc_config_mock.c deleted file mode 100644 index 7a2ce4ae7..000000000 --- a/applications/zpc/components/zwave/zwave_rx/test/zwave_rx_test_zpc_config_mock.c +++ /dev/null @@ -1,32 +0,0 @@ -/* # License - * Copyright 2021 Silicon Laboratories Inc. www.silabs.com - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - */ - -#include "zpc_config.h" -#include "zwave_rx_test.h" - -#include -/* - * This is a mockfile for the config system. The CMock framework cannot be used - * here because this is not a unity test case. - */ - -static zpc_config_t my_test_configuration = { - .serial_log_file = "", - .serial_port = ZWAVE_RX_TEST_SERIAL_PORT, - .zwave_normal_tx_power_dbm = ZWAVE_RX_TEST_MAXIMUM_POWER_DBM, - .zwave_measured_0dbm_power = ZWAVE_RX_TEST_MEASURED_0DBM_POWER, - .zwave_rf_region = ZWAVE_RX_TEST_RF_REGION_STRING -}; - -const zpc_config_t *zpc_get_config() -{ - return &my_test_configuration; -} diff --git a/applications/zpc/components/zwave/zwave_transports/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/CMakeLists.txt index 04f8b98bd..05468f0c2 100644 --- a/applications/zpc/components/zwave/zwave_transports/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_transports/CMakeLists.txt @@ -11,7 +11,6 @@ target_link_libraries( PUBLIC zwave_controller zwave_tx zwave_rx - zwave_crc16 zwave_s0 zwave_s2 zwave_api_transport @@ -22,7 +21,6 @@ target_link_libraries( zwave_tx_scheme_selector) install(TARGETS zwave_transports LIBRARY DESTINATION lib) -add_subdirectory(crc16) add_subdirectory(s0) add_subdirectory(s2) add_subdirectory(multi_channel) @@ -34,3 +32,26 @@ if(BUILD_TESTING) # Unit tests add_subdirectory(test) endif() + +# zwave_transports testlib library +add_library(zwave_transports_testlib src/zwave_transports_fixt.c) + +target_include_directories( + zwave_transports_testlib + PUBLIC include + PRIVATE src) + +target_link_libraries( + zwave_transports_testlib + PUBLIC zwave_controller_testlib + zwave_tx + zwave_rx_testlib + zwave_s0_testlib + zwave_s2_testlib + zwave_api_transport + zwave_definitions + multicast_follow_ups_transport + zwave_multi_channel + transport_service_wrapper + zwave_tx_scheme_selector) +install(TARGETS zwave_transports_testlib LIBRARY DESTINATION lib) \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_transports/crc16/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/crc16/CMakeLists.txt deleted file mode 100644 index ca49a7bb7..000000000 --- a/applications/zpc/components/zwave/zwave_transports/crc16/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -# Library -add_library(zwave_crc16 - src/zwave_crc16_transport.c -) - -target_include_directories(zwave_crc16 - PUBLIC include -) - -target_link_libraries(zwave_crc16 - PUBLIC zwave_controller unify - PRIVATE zpc_attribute_store zwave_command_classes -) - -if(BUILD_TESTING) - #target_add_mock(zwave_crc16) - add_subdirectory(test) -endif() diff --git a/applications/zpc/components/zwave/zwave_transports/crc16/include/zwave_crc16_transport.h b/applications/zpc/components/zwave/zwave_transports/crc16/include/zwave_crc16_transport.h deleted file mode 100644 index f714d4b05..000000000 --- a/applications/zpc/components/zwave/zwave_transports/crc16/include/zwave_crc16_transport.h +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** - * # License - * Copyright 2024 Silicon Laboratories Inc. www.silabs.com - ****************************************************************************** - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - *****************************************************************************/ - -/** - * @defgroup zwave_crc16_transport CRC16 Transport - * @ingroup zwave_transports - * @brief Transport for CRC16 - * - * @{ - */ - -#ifndef ZWAVE_CRC_16_TRANSPORT_H -#define ZWAVE_CRC_16_TRANSPORT_H - -#include "sl_status.h" -#include "zwave_node_id_definitions.h" - -// We allow to encapsulate the maximum minus our encapsulation command overhead -#define CRC_16_ENCAPSULATION_HEADER 2 -#define CRC_16_ENCAPSULATION_FOOTER 2 -#define CRC_16_ENCAPSULATION_OVERHEAD (CRC_16_ENCAPSULATION_HEADER + CRC_16_ENCAPSULATION_FOOTER) - -#define CRC_16_ENCAPSULATED_COMMAND_MAXIMUM_SIZE \ - (ZWAVE_MAX_FRAME_SIZE - CRC_16_ENCAPSULATION_OVERHEAD) - -typedef struct zwave_crc16_encapsulation_frame { - uint8_t command_class; /* The command class */ - uint8_t command; /* The command */ - uint8_t encapsulated_command - [CRC_16_ENCAPSULATED_COMMAND_MAXIMUM_SIZE]; /* The checksum will be appended to the command*/ -/* Encapsulated command */ -} zwave_crc16_encapsulation_frame_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Initialize the CRC16 Transport - * * - * @returns SL_STATUS_OK if successful - * @returns SL_STATUS_FAIL if an error occurred - */ -sl_status_t zwave_crc16_transport_init(void); - -#ifdef __cplusplus -} -#endif - -#endif //ZWAVE_CRC_16_TRANSPORT_H -/** @} end zwave_crc16_transport */ diff --git a/applications/zpc/components/zwave/zwave_transports/crc16/src/zwave_crc16_transport.c b/applications/zpc/components/zwave/zwave_transports/crc16/src/zwave_crc16_transport.c deleted file mode 100644 index f5ba14e53..000000000 --- a/applications/zpc/components/zwave/zwave_transports/crc16/src/zwave_crc16_transport.c +++ /dev/null @@ -1,370 +0,0 @@ -/****************************************************************************** -* # License -* Copyright 2021 Silicon Laboratories Inc. www.silabs.com -****************************************************************************** -* The licensor of this software is Silicon Laboratories Inc. Your use of this -* software is governed by the terms of Silicon Labs Master Software License -* Agreement (MSLA) available at -* www.silabs.com/about-us/legal/master-software-license-agreement. This -* software is distributed to you in Source Code format and is governed by the -* sections of the MSLA applicable to Source Code. -* -*****************************************************************************/ - -#include "zwave_controller_crc16.h" - -// Generic includes -#include -#include - -// Includes from this component -#include "zwave_crc16_transport.h" -#include "zwave_command_class_crc16.h" - -// Includes from other components -#include "ZW_classcmd.h" -#include "zwave_command_class_indices.h" -#include "zwave_controller_connection_info.h" -#include "zwave_controller_transport.h" -#include "zwave_controller_internal.h" -#include "zwave_rx.h" -#include "zwave_tx.h" -#include "zwave_utils.h" - -// Unify includes -#include "sl_log.h" - -#define LOG_TAG "zwave_crc16_transport" - -#define CRC_INITAL_VALUE 0x1D0Fu - -// Send data state -typedef struct send_data_state { - // User Callback to invoken when transmission is completed - on_zwave_tx_send_data_complete_t on_send_data_complete; - // User pointer to use for the invoking the on_send_data_complete function - void *user; - // Are we idle or currently transmitting. - bool transmission_ongoing; - // Save the Parent Tx session ID to be able to abort - zwave_tx_session_id_t parent_session_id; -} send_data_state_t; -static send_data_state_t state; - -/////////////////////////////////////////////////////////////////////////////// -// Private helper functions -/////////////////////////////////////////////////////////////////////////////// -/** - * @brief Initializes our array of callback settings by setting - * everything to NULL - */ -static void reset_send_data_settings() -{ - state.transmission_ongoing = false; - state.on_send_data_complete = NULL; - state.user = NULL; - state.parent_session_id = NULL; -} - -static void zwave_crc16_transport_start_transmission( - on_zwave_tx_send_data_complete_t callback, - void *user, - zwave_tx_session_id_t parent_session_id) -{ - state.transmission_ongoing = true; - state.on_send_data_complete = callback; - state.user = user; - state.parent_session_id = parent_session_id; -} - -/////////////////////////////////////////////////////////////////////////////// -// Z-Wave Controller transport functions -/////////////////////////////////////////////////////////////////////////////// -/** - * @defgroup crc16_transport Multi Channel Transport - * @ingroup crc16_command_class - * @brief CRC 16 encapsulation and decapsulation module - * - * This module allows to send and receive Multi Channel encapsulated - * frames. - * - * @{ - */ -/** - * @brief Callback function registered to Z-Wave TX \ref zwave_tx_send_data - * - * It helps tracking when a frame was fully transmitted and will invoke the - * callback of the component that called the \ref - * zwave_command_class_crc16_send_data function - * - * @param status Indicates how the transmission operation was completed. - * Refer for \ref zwapi_transmit_complete_codes for details. - * @param tx_info zwapi_tx_report_t reported by the @ref zwave_api. It - * contains transmission details, refer to \ref zwapi_tx_report_t. - * @param user User pointer provided in \ref zwave_command_class_crc16_send_data() - */ -static void on_crc16_send_complete(uint8_t status, - const zwapi_tx_report_t *tx_info, - void *user) -{ - (void)user; - // Call the registered callback directly and tell them we are happy with the - // transmission of our Multi Channel encapsulated frame. No retry or - // additional frames needed - if (state.transmission_ongoing == false) { - sl_log_warning(LOG_TAG, - "Send data complete callback while no transmission " - "is ongoing. Ignoring."); - return; - } - - // Give the caller a callback, if they wanted one - if (state.on_send_data_complete != NULL) { - state.on_send_data_complete(status, tx_info, state.user); - } - - reset_send_data_settings(); -} - -/** - * @brief Encapsulates with CRC16 - * @param connection Connection object describing the source and - * destination. - * @param data_length Length of the frame to send - * @param data Points to the payload to send - * @param tx_options Transmit options to use. - * @param on_send_data_complete Callback function that will be called when - * the send operation has completed - * @param user User pointer passed in argument of the on_send_complete - * callback function - * @param parent_session_id Value of the frame in the TX Queue that is the parent - * of this frame. Frames MUST have a valid parent - * - * @returns - * - SL_STATUS_OK The transmission request has been accepted and callback will be - * triggered when the operation is completed. - * - SL_STATUS_NOT_SUPPORTED If no endpoint encapsulation is to be applied - * - SL_STATUS_FAIL If the transmission cannot be done at the moment. - */ -static sl_status_t zwave_command_class_crc16_send_data( - const zwave_controller_connection_info_t *connection, - uint16_t data_length, - const uint8_t *data, - const zwave_tx_options_t *tx_options, - const on_zwave_tx_send_data_complete_t on_send_data_complete, - void *user, - zwave_tx_session_id_t parent_session_id) -{ - // Check if the frame is already CRC16 encapsulated - if ((data_length >= 1) - && (data[COMMAND_CLASS_INDEX] == COMMAND_CLASS_CRC_16_ENCAP)) { - return SL_STATUS_NOT_SUPPORTED; - } - - // Is the frame too big for us? - if (data_length > CRC_16_ENCAPSULATED_COMMAND_MAXIMUM_SIZE) { - sl_log_critical(LOG_TAG, "Frame is too big for CRC16 encapsulation"); - return SL_STATUS_WOULD_OVERFLOW; - } - - // CC:0056.01.00.21.003 : The CRC-16 Encapsulation Command Class MUST NOT be encapsulated by any other Command Class. - if (connection->encapsulation != ZWAVE_CONTROLLER_ENCAPSULATION_NONE) { - return SL_STATUS_NOT_SUPPORTED; - } - - if (state.transmission_ongoing) { - sl_log_critical(LOG_TAG, - "Transmission is ongoing, cannot send another frame"); - return SL_STATUS_BUSY; - } - - // Retrieve the Attribute Store node for the endpoint: - attribute_store_node_t endpoint_node - = zwave_get_endpoint_node(connection->remote.node_id, - connection->remote.endpoint_id); - // Check if end node support CRC_16 - if (!zwave_command_class_crc16_is_supported(endpoint_node)) { - return SL_STATUS_NOT_SUPPORTED; - } - - // If we don't expect any response we check if the sender wants us to use CRC16 - // or not - if (tx_options != NULL && tx_options->number_of_responses == 0 - && !zwave_command_class_crc16_is_expecting_crc16_response( - connection->remote.node_id, - connection->remote.endpoint_id)) { - return SL_STATUS_NOT_SUPPORTED; - } - - zwave_crc16_encapsulation_frame_t frame = {0}; - uint8_t *raw_frame = (uint8_t *)&frame; - uint16_t frame_length = 0; - - frame.command_class = COMMAND_CLASS_CRC_16_ENCAP; - frame.command = CRC_16_ENCAP; - memcpy(frame.encapsulated_command, data, data_length); - - frame_length = data_length + CRC_16_ENCAPSULATION_HEADER; - // Compute the CRC16 of the frame data with the header - uint16_t crc16 - = zwave_controller_crc16(CRC_INITAL_VALUE, raw_frame, frame_length); - - raw_frame[frame_length++] = (crc16 >> 8) & 0xFF; - raw_frame[frame_length++] = crc16 & 0xFF; - - // New frame will be a child of original frame - zwave_tx_options_t multi_channel_tx_options; - - if (tx_options) { - multi_channel_tx_options = *tx_options; - } - - multi_channel_tx_options.transport.parent_session_id = parent_session_id; - multi_channel_tx_options.transport.valid_parent_session_id = true; - - sl_status_t transmit_status = zwave_tx_send_data(connection, - frame_length, - (const uint8_t *)raw_frame, - &multi_channel_tx_options, - &on_crc16_send_complete, - NULL, - NULL); - - if (transmit_status != SL_STATUS_OK) { - return SL_STATUS_FAIL; - } - - // Clear flag now that we have sent the frame - zwave_command_class_crc16_clear_expect_crc16_response( - connection->remote.node_id, - connection->remote.endpoint_id); - - zwave_crc16_transport_start_transmission(on_send_data_complete, - user, - parent_session_id); - - return SL_STATUS_OK; -} - -/** - * @brief Decapsulate Multi Channel encapsulation and inject the frame back to - * the Z-Wave Controller - * - * The provided payload will be Multi Channel decapsulated and the endpoint - * data will be copied in - * connection->remote.endpoint_id and connection->local.endpoint_id and passed - * to the \ref zwave_controller_on_frame_received() function. - * - * Bit addressing can be used by setting the endpoint value directly (1 bit - * bit addressing and 7 bits endpoint identifier) - * - * @param connection_info Connection object describing the source and - * destination. - * @param rx_options Connection object describing the source and - * destination. - * @param frame_data Length of the frame to send - * @param frame_length Points to the payload to send - * - * @returns - * - SL_STATUS_NOT_SUPPORTED if the frame data is not CRC16 encapsulated - * properly to generate a decapsulated frame - * - SL_STATUS_NOT_FOUND if the frame is not encapsulated but should not be - * discarded. - * - SL_STATUS_WOULD_OVERFLOW If the decapsulated frame is too large to fit in - * our local buffer - * - SL_STATUS_OK If the frame was decapsulated and should be discarded - * because its decapsulated version has been passed - * to the Z-Wave Controller. - * - SL_STATUS_FAIl if the frame should be discarded - */ -static sl_status_t zwave_command_class_crc16_decapsulate( - const zwave_controller_connection_info_t *connection_info, - const zwave_rx_receive_options_t *rx_options, - const uint8_t *frame_data, - uint16_t frame_length) -{ - if (frame_length <= COMMAND_INDEX - || frame_data[COMMAND_CLASS_INDEX] != COMMAND_CLASS_CRC_16_ENCAP - || frame_data[COMMAND_INDEX] != CRC_16_ENCAP) { - // SL_STATUS_NOT_FOUND will pass the frame to the upper layer, - // CC:0056.01.00.21.006 b. If the request is sent non-encapsulated, the response MUST be sent non-encapsulated - return SL_STATUS_NOT_FOUND; - } - - if (frame_length <= CRC_16_ENCAPSULATION_OVERHEAD) { - return SL_STATUS_NOT_SUPPORTED; - } - - uint8_t decapsulated_frame[ZWAVE_MAX_FRAME_SIZE] = {0}; - uint16_t decapsulated_frame_length = 0; - - if (frame_length - CRC_16_ENCAPSULATION_OVERHEAD - > sizeof(decapsulated_frame)) { - return SL_STATUS_WOULD_OVERFLOW; - } - decapsulated_frame_length = frame_length - CRC_16_ENCAPSULATION_OVERHEAD; - memcpy(decapsulated_frame, - &frame_data[CRC_16_ENCAPSULATION_HEADER], - decapsulated_frame_length); - - uint16_t expected_crc16 - = (frame_data[frame_length - 2] << 8) | frame_data[frame_length - 1]; - - // CC:0056.01.01.11.005: The checksum data MUST be built by taking all bytes starting from the CRC16 Command Class - // identifier (COMMAND_CLASS_CRC_16_ENCAP) until the last byte of the Data field. - // This means we have ton compute the CRC16 of the frame data with the header, but without the CRC16 footer - uint16_t computed_crc16 - = zwave_controller_crc16(CRC_INITAL_VALUE, - frame_data, - frame_length - CRC_16_ENCAPSULATION_FOOTER); - - if (expected_crc16 != computed_crc16) { - sl_log_warning(LOG_TAG, - "CRC16 check failed, discarding frame : %d", - computed_crc16); - return SL_STATUS_FAIL; - } - - // zwave_command_class_crc16_set_expect_crc16_response( - // connection_info->remote.node_id, - // connection_info->remote.endpoint_id); - - zwave_controller_on_frame_received(connection_info, - rx_options, - decapsulated_frame, - decapsulated_frame_length); - - return SL_STATUS_OK; -} - -static sl_status_t - zwave_command_class_crc16_abort_send_data(zwave_tx_session_id_t session_id) -{ - if (state.transmission_ongoing == true - && state.parent_session_id == session_id) { - sl_log_debug(LOG_TAG, "Aborting CRC16 session for frame id=%p", session_id); - on_crc16_send_complete(TRANSMIT_COMPLETE_FAIL, NULL, NULL); - return SL_STATUS_OK; - } - - return SL_STATUS_NOT_FOUND; -} - -/////////////////////////////////////////////////////////////////////////////// -// Shared functions within the component -/////////////////////////////////////////////////////////////////////////////// -sl_status_t zwave_crc16_transport_init() -{ - reset_send_data_settings(); - - // Register our transport to the Z-Wave Controller Transport - zwave_controller_transport_t transport = {0}; - transport.priority = 4; - transport.command_class = COMMAND_CLASS_CRC_16_ENCAP; - transport.version = CRC_16_ENCAP_VERSION; - transport.on_frame_received = &zwave_command_class_crc16_decapsulate; - transport.send_data = &zwave_command_class_crc16_send_data; - transport.abort_send_data = &zwave_command_class_crc16_abort_send_data; - - return zwave_controller_transport_register(&transport); -} diff --git a/applications/zpc/components/zwave/zwave_transports/crc16/test/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/crc16/test/CMakeLists.txt deleted file mode 100644 index e6edab286..000000000 --- a/applications/zpc/components/zwave/zwave_transports/crc16/test/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # "--allow-multiple-definition" can cause some weird symptons as we leave it - # up to the linker which symbol gets merged into the test binary. - add_link_options("-Wl,--unresolved-symbols=ignore-in-object-files" - "-Wl,--allow-multiple-definition") -endif() - -# CRC16 transport test -target_add_unittest(zwave_crc16 -SOURCES zwave_crc16_transport_test.c -DEPENDS - zwave_command_classes_mock - zwave_controller_mock - zwave_tx_mock - zpc_attribute_store_mock -) diff --git a/applications/zpc/components/zwave/zwave_transports/crc16/test/zwave_crc16_transport_test.c b/applications/zpc/components/zwave/zwave_transports/crc16/test/zwave_crc16_transport_test.c deleted file mode 100644 index df17007ff..000000000 --- a/applications/zpc/components/zwave/zwave_transports/crc16/test/zwave_crc16_transport_test.c +++ /dev/null @@ -1,589 +0,0 @@ -/****************************************************************************** - * # License - * Copyright 2021 Silicon Laboratories Inc. www.silabs.com - ****************************************************************************** - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - *****************************************************************************/ -#include "zwave_crc16_transport.h" - -// Generic includes -#include - -// Test includes -#include "unity.h" - -// Includes from other components -#include "ZW_classcmd.h" - -// Mocks -#include "zwave_controller_transport_mock.h" -#include "zwave_controller_internal_mock.h" -#include "zwave_controller_crc16_mock.h" -#include "zwave_utils_mock.h" -#include "zwave_tx_mock.h" -#include "zwave_command_class_crc16_mock.h" - -#define CRC_INITAL_VALUE 0x1D0Fu - -// Static variables -static zwave_controller_transport_t crc_16_transport = {}; -static zwave_controller_connection_info_t last_received_connection_info = {}; -static zwave_tx_options_t last_received_tx_options = {}; -static zwave_rx_receive_options_t last_received_rx_options = {}; -static uint8_t last_received_frame[ZWAVE_MAX_FRAME_SIZE] = {}; -static uint8_t last_received_frame_length = 0; -static on_zwave_tx_send_data_complete_t crc_16_on_send_complete = NULL; -static void *last_received_user_pointer = NULL; -static uint8_t send_data_callback_counter = 0; -static uint8_t my_user_variable = 0x93; - -sl_status_t zwave_controller_transport_register_stub( - const zwave_controller_transport_t *transport, int cmock_num_calls) -{ - TEST_ASSERT_EQUAL(COMMAND_CLASS_CRC_16_ENCAP, transport->command_class); - TEST_ASSERT_EQUAL(CRC_16_ENCAP_VERSION, transport->version); - TEST_ASSERT_EQUAL(4, transport->priority); - - // Save the transport for our tests - crc_16_transport = *transport; - - return SL_STATUS_OK; -} - -void zwave_controller_on_frame_received_stub( - const zwave_controller_connection_info_t *connection_info, - const zwave_rx_receive_options_t *rx_options, - const uint8_t *frame_data, - uint16_t frame_length, - int cmock_num_calls) -{ - // Save the received data for test verification - last_received_connection_info = *connection_info; - last_received_rx_options = *rx_options; - memcpy(last_received_frame, frame_data, frame_length); - last_received_frame_length = frame_length; -} - -sl_status_t zwave_tx_send_data_stub( - const zwave_controller_connection_info_t *connection, - uint16_t data_length, - const uint8_t *data, - const zwave_tx_options_t *tx_options, - const on_zwave_tx_send_data_complete_t on_send_complete, - void *user, - zwave_tx_session_id_t *session, - int cmock_num_calls) -{ - // Save the received data for test verification - last_received_connection_info = *connection; - last_received_tx_options = *tx_options; - crc_16_on_send_complete = on_send_complete; - last_received_user_pointer = user; - memcpy(last_received_frame, data, data_length); - last_received_frame_length = data_length; - - TEST_ASSERT_EQUAL_PTR(NULL, session); - return SL_STATUS_OK; -} - -static void test_send_data_callback(uint8_t status, - const zwapi_tx_report_t *tx_info, - void *user) -{ - send_data_callback_counter += 1; - TEST_ASSERT_EQUAL_PTR(&my_user_variable, user); - TEST_ASSERT_EQUAL_PTR(NULL, tx_info); -} - -/// Setup the test suite (called once before all test_xxx functions are called) -void suiteSetUp() {} - -/// Teardown the test suite (called once after all test_xxx functions are called) -int suiteTearDown(int num_failures) -{ - return num_failures; -} - -/// Called before each and every test -void setUp() -{ - send_data_callback_counter = 0; - crc_16_on_send_complete = NULL; - last_received_user_pointer = NULL; -} - -// Keep this test first -void test_zwave_crc_16_transport_init() -{ - // Nothing to test here really. We intercept the registered transport. - zwave_controller_transport_register_AddCallback( - zwave_controller_transport_register_stub); - - zwave_controller_transport_register_ExpectAndReturn(NULL, SL_STATUS_OK); - zwave_controller_transport_register_IgnoreArg_transport(); - // Call the function - TEST_ASSERT_EQUAL(SL_STATUS_OK, zwave_crc16_transport_init()); -} - -void test_decapsulation_happy_case() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.on_frame_received); - - zwave_controller_connection_info_t connection_info = {}; - zwave_rx_receive_options_t rx_options = {}; - const uint8_t frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x01, 0x02, 0x03, 0x04, 0x05}; - const uint8_t checksum_frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x01, 0x02, 0x03}; - - zwave_controller_on_frame_received_Stub( - zwave_controller_on_frame_received_stub); - - zwave_controller_crc16_ExpectAndReturn(CRC_INITAL_VALUE, - checksum_frame_data, - 5, - 0x0405); - - TEST_ASSERT_EQUAL(SL_STATUS_OK, - crc_16_transport.on_frame_received(&connection_info, - &rx_options, - frame_data, - sizeof(frame_data))); - - // Verify that our decapsulation worked - TEST_ASSERT_EQUAL(0x00, last_received_connection_info.remote.endpoint_id); - TEST_ASSERT_EQUAL(0x00, last_received_connection_info.local.endpoint_id); - TEST_ASSERT_EQUAL(false, last_received_connection_info.local.is_multicast); - TEST_ASSERT_EQUAL(3, last_received_frame_length); - const uint8_t expected_frame_data[] = {0x01, 0x02, 0x03}; - TEST_ASSERT_EQUAL_INT8_ARRAY(expected_frame_data, - last_received_frame, - last_received_frame_length); -} - -void test_decapsulation_overflow() -{ - //zwave_command_class_crc_16_transport_init_verification(); - // Test with wrong command - TEST_ASSERT_NOT_NULL(crc_16_transport.on_frame_received); - - zwave_controller_connection_info_t connection_info = {}; - zwave_rx_receive_options_t rx_options = {}; - const uint8_t frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x01, 0x02, 0x03, 0x04, 0x05}; - - TEST_ASSERT_EQUAL( - SL_STATUS_WOULD_OVERFLOW, - crc_16_transport.on_frame_received(&connection_info, - &rx_options, - frame_data, - ZWAVE_MAX_FRAME_SIZE - + CRC_16_ENCAPSULATION_OVERHEAD + 1)); -} - -void test_decapsulation_too_short_frame() -{ - //zwave_command_class_crc_16_transport_init_verification(); - // Test with wrong command - TEST_ASSERT_NOT_NULL(crc_16_transport.on_frame_received); - - zwave_controller_connection_info_t connection_info = {}; - zwave_rx_receive_options_t rx_options = {}; - const uint8_t frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x01, 0x02, 0x03, 0x04, 0x05}; - - TEST_ASSERT_EQUAL(SL_STATUS_NOT_SUPPORTED, - crc_16_transport.on_frame_received(&connection_info, - &rx_options, - frame_data, - 4)); -} - -void test_decapsulation_too_wrong_command() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.on_frame_received); - - zwave_controller_connection_info_t connection_info = {}; - zwave_rx_receive_options_t rx_options = {}; - const uint8_t frame_data[] = {COMMAND_CLASS_CRC_16_ENCAP, - CRC_16_ENCAP + 1, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05}; - - TEST_ASSERT_EQUAL(SL_STATUS_NOT_FOUND, - crc_16_transport.on_frame_received(&connection_info, - &rx_options, - frame_data, - sizeof(frame_data))); -} - -void test_decapsulation_too_wrong_command_class() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.on_frame_received); - - zwave_controller_connection_info_t connection_info = {}; - zwave_rx_receive_options_t rx_options = {}; - const uint8_t frame_data[] = {COMMAND_CLASS_CRC_16_ENCAP + 1, - CRC_16_ENCAP, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05}; - - TEST_ASSERT_EQUAL(SL_STATUS_NOT_FOUND, - crc_16_transport.on_frame_received(&connection_info, - &rx_options, - frame_data, - sizeof(frame_data))); -} - -void test_encapsulation_happy_case() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.send_data); - - zwave_controller_connection_info_t connection_info = {}; - zwave_tx_options_t tx_options = {}; - tx_options.number_of_responses = 0; - const uint8_t frame_data[] = {0x01, 0x02, 0x03}; - connection_info.remote.endpoint_id = 2; - connection_info.remote.node_id = 5; - connection_info.local.endpoint_id = 1; - connection_info.local.node_id = 0; - connection_info.encapsulation = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; - zwave_tx_session_id_t parent_session_id = (void *)23; - - zwave_tx_send_data_Stub(zwave_tx_send_data_stub); - - zwave_get_endpoint_node_ExpectAndReturn(connection_info.remote.node_id, - connection_info.remote.endpoint_id, - 0); - zwave_command_class_crc16_is_supported_ExpectAndReturn(0, true); - zwave_command_class_crc16_is_expecting_crc16_response_ExpectAndReturn( - connection_info.remote.node_id, - connection_info.remote.endpoint_id, - true); - zwave_command_class_crc16_clear_expect_crc16_response_Expect( - connection_info.remote.node_id, - connection_info.remote.endpoint_id); - - const uint8_t checksum_frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x01, 0x02, 0x03}; - zwave_controller_crc16_ExpectAndReturn(CRC_INITAL_VALUE, - checksum_frame_data, - 5, - 0x0405); - - TEST_ASSERT_EQUAL(SL_STATUS_OK, - crc_16_transport.send_data(&connection_info, - sizeof(frame_data), - frame_data, - &tx_options, - test_send_data_callback, - &my_user_variable, - parent_session_id)); - - // Verify that our decapsulation worked - TEST_ASSERT_EQUAL(2, last_received_connection_info.remote.endpoint_id); - TEST_ASSERT_EQUAL(1, last_received_connection_info.local.endpoint_id); - TEST_ASSERT_TRUE(last_received_tx_options.transport.valid_parent_session_id); - TEST_ASSERT_EQUAL_PTR(parent_session_id, - last_received_tx_options.transport.parent_session_id); - - const uint8_t expected_frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x01, 0x02, 0x03, 0x04, 0x05}; - TEST_ASSERT_EQUAL(sizeof(expected_frame_data), last_received_frame_length); - TEST_ASSERT_EQUAL_INT8_ARRAY(expected_frame_data, - last_received_frame, - last_received_frame_length); - - TEST_ASSERT_EQUAL(0, send_data_callback_counter); - - TEST_ASSERT_NOT_NULL(crc_16_on_send_complete); - crc_16_on_send_complete(TRANSMIT_COMPLETE_OK, - NULL, - last_received_user_pointer); - - TEST_ASSERT_EQUAL(1, send_data_callback_counter); -} - -// Test if the number of responses is set to 1 we can -// still send the frame -void test_encapsulation_happy_case_with_number_of_response_1() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.send_data); - - zwave_controller_connection_info_t connection_info = {}; - zwave_tx_options_t tx_options = {}; - tx_options.number_of_responses = 1; - const uint8_t frame_data[] = {0x01, 0x02, 0x03}; - connection_info.remote.endpoint_id = 2; - connection_info.remote.node_id = 5; - connection_info.local.endpoint_id = 1; - connection_info.local.node_id = 0; - connection_info.encapsulation = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; - zwave_tx_session_id_t parent_session_id = (void *)23; - - zwave_tx_send_data_Stub(zwave_tx_send_data_stub); - - zwave_get_endpoint_node_ExpectAndReturn(connection_info.remote.node_id, - connection_info.remote.endpoint_id, - 0); - zwave_command_class_crc16_is_supported_ExpectAndReturn(0, true); - zwave_command_class_crc16_clear_expect_crc16_response_Expect( - connection_info.remote.node_id, - connection_info.remote.endpoint_id); - - const uint8_t checksum_frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x01, 0x02, 0x03}; - zwave_controller_crc16_ExpectAndReturn(CRC_INITAL_VALUE, - checksum_frame_data, - 5, - 0x0405); - - TEST_ASSERT_EQUAL(SL_STATUS_OK, - crc_16_transport.send_data(&connection_info, - sizeof(frame_data), - frame_data, - &tx_options, - test_send_data_callback, - &my_user_variable, - parent_session_id)); - - // Verify that our decapsulation worked - TEST_ASSERT_EQUAL(2, last_received_connection_info.remote.endpoint_id); - TEST_ASSERT_EQUAL(1, last_received_connection_info.local.endpoint_id); - TEST_ASSERT_TRUE(last_received_tx_options.transport.valid_parent_session_id); - TEST_ASSERT_EQUAL_PTR(parent_session_id, - last_received_tx_options.transport.parent_session_id); - - const uint8_t expected_frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x01, 0x02, 0x03, 0x04, 0x05}; - TEST_ASSERT_EQUAL(sizeof(expected_frame_data), last_received_frame_length); - TEST_ASSERT_EQUAL_INT8_ARRAY(expected_frame_data, - last_received_frame, - last_received_frame_length); - - TEST_ASSERT_EQUAL(0, send_data_callback_counter); - - TEST_ASSERT_NOT_NULL(crc_16_on_send_complete); - crc_16_on_send_complete(TRANSMIT_COMPLETE_OK, - NULL, - last_received_user_pointer); - - TEST_ASSERT_EQUAL(1, send_data_callback_counter); -} - - -void test_encapsulation_overflow() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.send_data); - - zwave_controller_connection_info_t connection_info = {}; - connection_info.remote.endpoint_id = 2; - connection_info.local.endpoint_id = 1; - connection_info.encapsulation = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; - const uint8_t frame_data[] = {0x03, 0x04, 0x05}; - - TEST_ASSERT_EQUAL( - SL_STATUS_WOULD_OVERFLOW, - crc_16_transport.send_data(&connection_info, - CRC_16_ENCAPSULATED_COMMAND_MAXIMUM_SIZE + 1, - frame_data, - NULL, - NULL, - NULL, - NULL)); - - TEST_ASSERT_EQUAL(0, send_data_callback_counter); -} - -void test_encapsulation_no_crc16_support() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.send_data); - - zwave_controller_connection_info_t connection_info = {}; - connection_info.remote.endpoint_id = 2; - connection_info.local.endpoint_id = 1; - connection_info.encapsulation = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; - const uint8_t frame_data[] = {0x03, 0x04, 0x05}; - - zwave_get_endpoint_node_ExpectAndReturn(connection_info.remote.node_id, - connection_info.remote.endpoint_id, - 15); - zwave_command_class_crc16_is_supported_ExpectAndReturn(15, false); - - TEST_ASSERT_EQUAL(SL_STATUS_NOT_SUPPORTED, - crc_16_transport.send_data(&connection_info, - sizeof(frame_data), - frame_data, - NULL, - NULL, - NULL, - NULL)); - - TEST_ASSERT_EQUAL(0, send_data_callback_counter); -} - -void test_encapsulation_response_expected_no_crc16() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.send_data); - - zwave_controller_connection_info_t connection_info = {}; - connection_info.remote.endpoint_id = 2; - connection_info.local.endpoint_id = 1; - connection_info.encapsulation = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; - const uint8_t frame_data[] = {0x03, 0x04, 0x05}; - - zwave_get_endpoint_node_ExpectAndReturn(connection_info.remote.node_id, - connection_info.remote.endpoint_id, - 15); - zwave_command_class_crc16_is_supported_ExpectAndReturn(15, true); - zwave_command_class_crc16_is_expecting_crc16_response_ExpectAndReturn( - connection_info.remote.node_id, - connection_info.remote.endpoint_id, - false); - - zwave_tx_options_t tx_options = {}; - tx_options.number_of_responses = 0; - TEST_ASSERT_EQUAL(SL_STATUS_NOT_SUPPORTED, - crc_16_transport.send_data(&connection_info, - sizeof(frame_data), - frame_data, - &tx_options, - NULL, - NULL, - NULL)); - - TEST_ASSERT_EQUAL(0, send_data_callback_counter); -} - -void test_encapsulation_already_encapsulated() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.send_data); - - zwave_controller_connection_info_t connection_info = {}; - connection_info.remote.endpoint_id = 2; - connection_info.local.endpoint_id = 1; - connection_info.encapsulation = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; - const uint8_t frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x03, 0x04, 0x05}; - - TEST_ASSERT_EQUAL(SL_STATUS_NOT_SUPPORTED, - crc_16_transport.send_data(&connection_info, - sizeof(frame_data), - frame_data, - NULL, - NULL, - NULL, - NULL)); - - TEST_ASSERT_EQUAL(0, send_data_callback_counter); -} - -void test_encapsulation_other_than_none() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.send_data); - - zwave_controller_connection_info_t connection_info = {}; - connection_info.remote.endpoint_id = 2; - connection_info.local.endpoint_id = 1; - const uint8_t frame_data[] = {0x03, 0x04, 0x05}; - const uint8_t tested_encapsulations[] - = {ZWAVE_CONTROLLER_ENCAPSULATION_SECURITY_0, - ZWAVE_CONTROLLER_ENCAPSULATION_SECURITY_2_ACCESS, - ZWAVE_CONTROLLER_ENCAPSULATION_SECURITY_2_AUTHENTICATED, - ZWAVE_CONTROLLER_ENCAPSULATION_SECURITY_2_UNAUTHENTICATED, - ZWAVE_CONTROLLER_ENCAPSULATION_NETWORK_SCHEME}; - - for (size_t i = 0; i < sizeof(tested_encapsulations); i++) { - connection_info.encapsulation - = (zwave_controller_encapsulation_scheme_t)tested_encapsulations[i]; - TEST_ASSERT_EQUAL(SL_STATUS_NOT_SUPPORTED, - crc_16_transport.send_data(&connection_info, - sizeof(frame_data), - frame_data, - NULL, - NULL, - NULL, - NULL)); - } - - TEST_ASSERT_EQUAL(0, send_data_callback_counter); -} - -void test_abort_send_data() -{ - TEST_ASSERT_NOT_NULL(crc_16_transport.send_data); - TEST_ASSERT_NOT_NULL(crc_16_transport.abort_send_data); - - zwave_controller_connection_info_t connection_info = {}; - zwave_tx_options_t tx_options = {}; - const uint8_t frame_data[] = {0x01, 0x02, 0x03}; - zwave_tx_session_id_t parent_session_id = (void *)23; - connection_info.encapsulation = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; - - // Try to abort now, nothing will happen - TEST_ASSERT_EQUAL(SL_STATUS_NOT_FOUND, - crc_16_transport.abort_send_data(parent_session_id)); - - zwave_tx_send_data_Stub(zwave_tx_send_data_stub); - - zwave_get_endpoint_node_ExpectAndReturn(connection_info.remote.node_id, - connection_info.remote.endpoint_id, - 0); - zwave_command_class_crc16_is_supported_ExpectAndReturn(0, true); - zwave_command_class_crc16_is_expecting_crc16_response_ExpectAndReturn( - connection_info.remote.node_id, - connection_info.remote.endpoint_id, - true); - zwave_command_class_crc16_clear_expect_crc16_response_Expect( - connection_info.remote.node_id, - connection_info.remote.endpoint_id); - - const uint8_t checksum_frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x01, 0x02, 0x03}; - zwave_controller_crc16_ExpectAndReturn(CRC_INITAL_VALUE, - checksum_frame_data, - 5, - 0x0405); - - TEST_ASSERT_EQUAL(SL_STATUS_OK, - crc_16_transport.send_data(&connection_info, - sizeof(frame_data), - frame_data, - &tx_options, - test_send_data_callback, - &my_user_variable, - parent_session_id)); - - // Verify that our decapsulation worked - TEST_ASSERT_EQUAL(0, last_received_connection_info.remote.endpoint_id); - TEST_ASSERT_EQUAL(0, last_received_connection_info.local.endpoint_id); - TEST_ASSERT_TRUE(last_received_tx_options.transport.valid_parent_session_id); - TEST_ASSERT_EQUAL_PTR(parent_session_id, - last_received_tx_options.transport.parent_session_id); - const uint8_t expected_frame_data[] - = {COMMAND_CLASS_CRC_16_ENCAP, CRC_16_ENCAP, 0x01, 0x02, 0x03, 0x04, 0x05}; - TEST_ASSERT_EQUAL(sizeof(expected_frame_data), last_received_frame_length); - TEST_ASSERT_EQUAL_INT8_ARRAY(expected_frame_data, - last_received_frame, - last_received_frame_length); - - TEST_ASSERT_EQUAL(0, send_data_callback_counter); - - // Try to abort now, it will trigger a callback - TEST_ASSERT_EQUAL(SL_STATUS_OK, - crc_16_transport.abort_send_data(parent_session_id)); - - TEST_ASSERT_EQUAL(1, send_data_callback_counter); -} diff --git a/applications/zpc/components/zwave/zwave_transports/s0/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/s0/CMakeLists.txt index 5250e472d..5f42e2fc6 100644 --- a/applications/zpc/components/zwave/zwave_transports/s0/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_transports/s0/CMakeLists.txt @@ -20,3 +20,16 @@ if(BUILD_TESTING) add_mock(zwave_s0_transport_mock include/zwave_s0_transport.h) target_interface_libraries(zwave_s0_transport_mock zwave_controller) endif() + +# zwave_s0_testlib library +add_library(zwave_s0_testlib src/zwave_s0_network.c src/zwave_s0_sm.c + src/zwave_s0_transport.c) +# Make libs2 build as if its built by ZIPGW and ZW_CONTROLLER +target_compile_definitions(zwave_s0_testlib PRIVATE ZIPGW ZW_CONTROLLER ZWAVE_TESTLIB) + +target_include_directories(zwave_s0_testlib PUBLIC include) +target_link_libraries( + zwave_s0_testlib + PRIVATE unify_testlib zwave_s2_testlib zwave_controller_testlib +) +install(TARGETS zwave_s0_testlib LIBRARY DESTINATION lib) \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_transports/s0/src/zwave_s0_transport.c b/applications/zpc/components/zwave/zwave_transports/s0/src/zwave_s0_transport.c index f419e02f8..3f0c27c24 100644 --- a/applications/zpc/components/zwave/zwave_transports/s0/src/zwave_s0_transport.c +++ b/applications/zpc/components/zwave/zwave_transports/s0/src/zwave_s0_transport.c @@ -1225,6 +1225,7 @@ sl_status_t sl_log_debug(LOG_TAG, "supporting_node_scheme = %d\n", supporting_node_scheme); +#ifndef ZWAVE_TESTLIB if (supporting_node_scheme == ZWAVE_CONTROLLER_ENCAPSULATION_SECURITY_0) { sl_log_error(LOG_TAG, "Not implemented: ZPC's highest security scheme is " @@ -1234,7 +1235,9 @@ sl_status_t // never be S0 // UIC-794: Implement if ZPC has S0 as highest key. // Sending S0 supported command class get - } else { // Always respond with empty S0 command supported report for ZPC + } else +#endif + { // Always respond with empty S0 command supported report for ZPC zwave_controller_connection_info_t c2; memcpy(&c2, c, sizeof(zwave_controller_connection_info_t)); c2.encapsulation = ZWAVE_CONTROLLER_ENCAPSULATION_SECURITY_0; @@ -1334,12 +1337,14 @@ sl_status_t zwave_s0_on_abort_send_data(zwave_tx_session_id_t session_id) static void s0_on_new_network(zwave_home_id_t home_id, zwave_node_id_t node_id, zwave_keyset_t granted_keys, - zwave_kex_fail_type_t kex_fail_type) + zwave_kex_fail_type_t kex_fail_type, + zwave_protocol_t inclusion_protocol) { UNUSED(home_id); UNUSED(node_id); UNUSED(granted_keys); UNUSED(kex_fail_type); + UNUSED(inclusion_protocol); zwave_s0_network_init(); } diff --git a/applications/zpc/components/zwave/zwave_transports/s2/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/s2/CMakeLists.txt index a711289ff..7ddb6d1c4 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_transports/s2/CMakeLists.txt @@ -14,11 +14,14 @@ target_compile_definitions(zwave_s2_nonce_management PRIVATE ZW_CONTROLLER) set(KEYSTORE_SOURCES "src/zwave_s2_keystore.c") +set(COMMON_SOURCES + src/zwave_s2_fixt.c ${KEYSTORE_SOURCES} src/zwave_s2_network.c + src/zwave_s2_printf.c src/zwave_s2_process.c src/zwave_s2_transport.c) + # Z-Wave S2 main library add_library( zwave_s2 - src/zwave_s2_fixt.c ${KEYSTORE_SOURCES} src/zwave_s2_network.c - src/zwave_s2_printf.c src/zwave_s2_process.c src/zwave_s2_transport.c src/zwave_s2_protocol_cc_encryption.c) + ${COMMON_SOURCES}) set(DEFAULT_ZW-LIBS2_PATH libs/zw-libs2) if(EXISTS ${ZW-LIBS2_LOCATION}) @@ -40,13 +43,39 @@ target_include_directories( zwave_s2 PUBLIC include PRIVATE ${ZW-LIBS2_PATH}/include src) - install(TARGETS zwave_s2 LIBRARY DESTINATION lib) +# Z-Wave S2 inclusion library for controller +add_library( + s2_controller + ${ZW-LIBS2_PATH}/protocol/S2.c + ${ZW-LIBS2_PATH}/inclusion/s2_inclusion.c + src/zwave_s2_inclusion_controller.c) + +set_target_properties( + s2_controller + PROPERTIES + COMPILE_DEFINITIONS "ZW_CONTROLLER") + +target_link_libraries( + s2_controller + s2crypto + aes) + +target_include_directories( + s2_controller + PUBLIC + include + PRIVATE + ${ZPC_SOURCE_DIR}/components/zwave/zwave_definitions/include + ${ZW-LIBS2_PATH}/include + ${ZW-LIBS2_PATH}/inclusion + src) + target_link_libraries( zwave_s2 PUBLIC zwave_s2_nonce_management unify - PRIVATE s2_controller zwave_controller zwave_s0 zpc_attribute_store) + PRIVATE s2_controller zwave_controller zwave_s0 zpc_attribute_store zpc_utils) target_compile_definitions(zwave_s2 PRIVATE ZIPGW ZW_CONTROLLER) @@ -57,6 +86,28 @@ if(BUILD_TESTING) add_mock(libs2_mock ${ZW-LIBS2_PATH}/include/S2.h ${ZW-LIBS2_PATH}/include/s2_inclusion.h ${ZW-LIBS2_PATH}/include/s2_protocol.h) + add_mock(libs2_external_mock ${ZW-LIBS2_PATH}/include/S2_external.h) target_interface_libraries(libs2_mock zwave_definitions s2crypto aes) + target_interface_libraries(libs2_external_mock zwave_definitions s2crypto aes) target_compile_definitions(libs2_mock PUBLIC ZIPGW) + target_compile_definitions(libs2_external_mock PUBLIC ZIPGW) endif() + +# ZWAVE_TESTLIB S2 Library +add_library( + zwave_s2_testlib + ${COMMON_SOURCES}) + +target_include_directories( + zwave_s2_testlib + PUBLIC include + PRIVATE ${ZW-LIBS2_PATH}/include src) + +install(TARGETS zwave_s2_testlib LIBRARY DESTINATION lib) + +target_link_libraries( + zwave_s2_testlib + PUBLIC zwave_s2_nonce_management unify_testlib + PRIVATE s2_controller zwave_controller_testlib zwave_s0) + +target_compile_definitions(zwave_s2_testlib PRIVATE ZIPGW ZW_CONTROLLER ZWAVE_TESTLIB) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/CMakeLists.txt index f7fbade25..f7e1d2f4a 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/CMakeLists.txt @@ -8,7 +8,7 @@ if("${PROJECT_NAME}" STREQUAL "") add_definitions(-Dx86) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") # For gov/cobertura: do not use .c.o on the object files, only .o set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage") @@ -20,9 +20,14 @@ if("${PROJECT_NAME}" STREQUAL "") endif() find_path( - ZWAVE_INCLUDE_DIR ZW_classcmd.h + ZWAVE_CLASSCMD_DIR ZW_classcmd.h HINTS ENV ZWLIBROOT ${PROJECT_SOURCE_DIR}/.. - ${PROJECT_SOURCE_DIR}/../../ZWave/API + ${PROJECT_SOURCE_DIR}/../../ThirdParty/generated/ + PATH_SUFFIXES include) + find_path( + ZWAVE_INCLUDE_DIR ZW.h + HINTS ENV ZWLIBROOT ${PROJECT_SOURCE_DIR}/.. + ${PROJECT_SOURCE_DIR}/../../ZWave/API/ PATH_SUFFIXES include) SET(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --verbose --errors-for-leak-kinds=all --show-leak-kinds=all --leak-check=full --error-exitcode=1 --track-origins=yes") include(CTest) @@ -40,20 +45,15 @@ set(CROSS_SYSTEM_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE) # Setting -DOPTIONAL_SYSTEM_INCLUDE= allows to specify # addional include path(s) when building libs2. include_directories(include ${ZWAVE_INCLUDE_DIR} ${CROSS_SYSTEM_INCLUDE} - ${OPTIONAL_SYSTEM_INCLUDE}) + ${OPTIONAL_SYSTEM_INCLUDE} ${ZWAVE_CLASSCMD_DIR}) if("${CMAKE_PROJECT_NAME}" STREQUAL "SDK") set(SKIP_TESTING true) endif() -if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/inclusion/s2_inclusion_controller.c) - set(ENABLE_CONTROLLER true) -endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/inclusion/s2_inclusion_controller.c) - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3") if(NOT DEFINED SKIP_TESTING OR CMAKE_BUILD_TYPE STREQUAL Test) enable_testing() - add_subdirectory(TestFramework) add_subdirectory(test) message(STATUS "Adding unit test for libs2") else() @@ -84,11 +84,3 @@ endif(NOT "${CMAKE_PROJECT_NAME}" STREQUAL "SDK") target_include_directories(s2_slave PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") - -if(ENABLE_CONTROLLER) - # Library for controllers - add_library(s2_controller protocol/S2.c inclusion/s2_inclusion.c inclusion/s2_inclusion_controller.c) - set_target_properties(s2_controller PROPERTIES COMPILE_DEFINITIONS "ZW_CONTROLLER") - target_link_libraries(s2_controller s2crypto aes) - target_include_directories(s2_controller PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") -endif(ENABLE_CONTROLLER) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/CMakeFunctions.cmake b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/CMakeFunctions.cmake deleted file mode 100644 index de1cf2af7..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/CMakeFunctions.cmake +++ /dev/null @@ -1,226 +0,0 @@ - -# © 2018 Silicon Laboratories Inc. -## -# @b Syntax -# -#   @c add_unity_test( \b NAME \ [TEST_BASE \\>] FILES \ LIBRARIES \ [USE_CPP]) -# -# Function for adding a unit test CMake target. -# -# -# @b Example @b 1 -# -# -# from @b Components\\FileSystem\\Test\\CMakeLists.txt file -# @code{.py} -# add_unity_test(NAME TestFileSystem FILES ../FileSystem.c TestFileSystem.cpp LIBRARIES Assert USE_CPP) -# @endcode -# -# -# @b Example @b 2 -# -# -# from @b ZWave\\Protocol\\Test\\CMakeLists.txt file -# @code{.py} -# add_unity_test(NAME TestTransmitSingleCastLinkLayer -# FILES ../ZW_DataLinkLayer.c TestTransmitSingleCastLinkLayer.c -# LIBRARIES mock ZW_RadioPhyMock Assert ) -# @endcode -# -# -# @b Parameters -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -#
   \[in\]NAME \Name of test executeable to build
\[in\]TEST_BASE \\>\[Optional\] Unit test file from which the runner should be generated, if TEST_BASE is not -# provided, the \.\ from first parameter will be used.
\[in\]FILES \List of files used for building the test
\[in\]LIBRARIES \List of libraries to link for the test executable (unity is automatically included)
\[in\]USE_CPP\[Optional\] Set this flag if the test executable must be compiled using C++
-# -if (NOT COMMAND ADD_UNITY_TEST) -function(ADD_UNITY_TEST) - set(OPTIONS USE_CPP DISABLED USE_UNITY_WITH_CMOCK) - set(SINGLE_VALUE_ARGS "NAME" "TEST_BASE") - set(MULTI_VALUE_ARGS "FILES" "LIBRARIES" "INCLUDES") - cmake_parse_arguments(ADD_UNITY_TEST "${OPTIONS}" "${SINGLE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN} ) - - set(RUNNER_EXTENSION c) - if (ADD_UNITY_TEST_USE_CPP) - set(RUNNER_EXTENSION cpp) - endif (ADD_UNITY_TEST_USE_CPP) - - set(RUNNER_BASE "${ADD_UNITY_TEST_NAME}.${RUNNER_EXTENSION}") - if (NOT ${ADD_UNITY_TEST_TEST_BASE} STREQUAL "") - set(RUNNER_BASE "${ADD_UNITY_TEST_TEST_BASE}") - endif (NOT ${ADD_UNITY_TEST_TEST_BASE} STREQUAL "") - - if ("${ADD_UNITY_TEST_NAME}" STREQUAL "") - list(GET ADD_UNITY_TEST_UNPARSED_ARGUMENTS 0 ADD_UNITY_TEST_NAME) - list(REMOVE_AT ADD_UNITY_TEST_UNPARSED_ARGUMENTS 0) - set(RUNNER_BASE "${ADD_UNITY_TEST_NAME}.${RUNNER_EXTENSION}") - set(ADD_UNITY_TEST_FILES "${ADD_UNITY_TEST_UNPARSED_ARGUMENTS}") - endif ("${ADD_UNITY_TEST_NAME}" STREQUAL "") - - add_executable(${ADD_UNITY_TEST_NAME} ${ADD_UNITY_TEST_NAME}_runner.${RUNNER_EXTENSION} ${RUNNER_BASE} ${ADD_UNITY_TEST_FILES}) - - add_custom_command(OUTPUT ${ADD_UNITY_TEST_NAME}_runner.${RUNNER_EXTENSION} - COMMAND ${PYTHON_EXECUTABLE} ${TEST_TOOLS_DIR}/gen_test_runner.py ${RUNNER_BASE} > ${CMAKE_CURRENT_BINARY_DIR}/${ADD_UNITY_TEST_NAME}_runner.${RUNNER_EXTENSION} - DEPENDS ${RUNNER_BASE} ${TEST_TOOLS_DIR}/gen_test_runner.py - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - add_test(${ADD_UNITY_TEST_NAME} ${ADD_UNITY_TEST_NAME} ) - target_link_libraries( ${ADD_UNITY_TEST_NAME} ${ADD_UNITY_TEST_LIBRARIES}) - if (NOT ADD_UNITY_TEST_USE_UNITY_WITH_CMOCK) - target_link_libraries( ${ADD_UNITY_TEST_NAME} unity) - endif (NOT ADD_UNITY_TEST_USE_UNITY_WITH_CMOCK) - - target_include_directories(${ADD_UNITY_TEST_NAME} PRIVATE . ${ADD_UNITY_TEST_INCLUDES}) - - if(${ADD_UNITY_TEST_DISABLED}) - set_tests_properties(${TEST_NAME} PROPERTIES DISABLED True) - endif() -endfunction(ADD_UNITY_TEST) -endif (NOT COMMAND ADD_UNITY_TEST) - - -## -# @b Syntax -# -#   @c unity_test( \b TEST [\b RUNNER_EXTENSION] [\b SOURCE_NAME]) -# -# This function calls a python script in order to generate the unity runner for the test. -# The name of the test suite is mandatory and the runner will be named: ${TEST}_runner.c -# The function also takes the following optional arguments: -# Optional arg 0: Extension of runner, e.g. .cpp instead of .c -# Optional argument can be used as: unity_test( my_unity_test cpp ) -# Optional arg 1: Name of source without extension which is hardcoded to be ".c". This can be used -# if several targets with different defines, etc. based on the same source file are desired. -# -# \warning This function is deprecated, use @ref add_unity_test instead -# -if (NOT COMMAND unity_test) -function(unity_test TEST ) - message(WARNING "Use of unity_test function is depricated please use add_unity_test(..)") - set(RUNNER_EXTENSION c) - set(SOURCE_NAME ${TEST}) - set(OPTIONAL_ARGS ${ARGN}) - list(LENGTH OPTIONAL_ARGS OPTIONAL_ARGS_LENGTH) - if (OPTIONAL_ARGS_LENGTH GREATER 0) - list (GET OPTIONAL_ARGS 0 RUNNER_EXTENSION) - endif(OPTIONAL_ARGS_LENGTH GREATER 0) - if (OPTIONAL_ARGS_LENGTH GREATER 1) - list (GET OPTIONAL_ARGS 1 SOURCE_NAME) - endif (OPTIONAL_ARGS_LENGTH GREATER 1) - #message( "RUNNER_EXTENSION = ${RUNNER_EXTENSION}") - #message( "SOURCE_NAME = ${SOURCE_NAME}") - - add_custom_command(OUTPUT ${TEST}_runner.${RUNNER_EXTENSION} - COMMAND ${PYTHON_EXECUTABLE} ${TEST_TOOLS_DIR}/gen_test_runner.py ${SOURCE_NAME}.${RUNNER_EXTENSION} > ${CMAKE_CURRENT_BINARY_DIR}/${TEST}_runner.${RUNNER_EXTENSION} - DEPENDS ${SOURCE_NAME}.${RUNNER_EXTENSION} ${TEST_TOOLS_DIR}/gen_test_runner.py - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - add_test(${TEST} ${TEST}) -endfunction(unity_test) -endif (NOT COMMAND unity_test) - -## -# @b Syntax -# -#   @c cross_system_dir(@b IN_SEARCH_PATH, @b IN_MATCH_PATTERN, @b OUT_CROSS_SYSTEM_DIR ) -# -# Function for searching and returning the correct folder during cross compilation -# Folders are returned according to first match: -# -# -# ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}: If two level folder with .variant - with same name exists. -# -# ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}: If .variant does not exist but two level folder with same name exists. -# -# ${CMAKE_SYSTEM_NAME}/[Gg]eneric: If ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR} does not exists but folder ${CMAKE_SYSTEM_NAME}/${IN_MATCH_PATTERN}/[Gg]eneric exists. -# -# ${CMAKE_SYSTEM_NAME}/: If folder with same name exists. -# -# ${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}: If folder with same name exists. -# -# ${CMAKE_SYSTEM_PROCESSOR}: If .variant does not exist, but folder with same name exists. -# -# [Gg]eneric: If ${CMAKE_SYSTEM_PROCESSOR} does not exists but folder '[Gg]eneric' exists. -# -# ${IN_MATCH_PATTERN}: The folder itself is returned -# -# '': If no matches are found -# -# For all tests above, it applies that if ${IN_MATCH_PATTERN} is set then the folder is only -# returned if a file/folder matching the pattern is found. -# e.g. if ${IN_MATCH_PATTERN} is set to 'include' and ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR} -# does not contain an 'include' file/folder then the tests continues to 2) -# If IN_MATCH_PATTERN is empty string, i.e. "", then the first matched folder is returned. -# -# -# @b Example -# -# Example from @b SubTree/TestFramework/unity/CMakeLists.txt file where \ref cross_system_dir is -# used. -# -# In @c unity cross_system_dir is used to determine platform dependent implementation of the file -# @c unity_print to use for compilation. -# -# - On host system (Windows/Linux on x86), the file @c generic/unity_print.c is used. -# - On cross system, @b CMAKE_SYSTEM_PROCESSOR=asip, the file @c asip/unity_print.c is used. -# - On cross system, @b CMAKE_SYSTEM_PROCESSOR=zw700, the file @c zw700/unity_print.c is used. -# - On cross system, @b CMAKE_SYSTEM_PROCESSOR=c51, the file @c c51/unity_print.c is used. -# -# @code -#CROSS_SYSTEM_DIR("." "" CROSS_SYSTEM_DIR) -# -#SET(SOURCES -# unity.c -# ${CROSS_SYSTEM_DIR}/unity_print.c ) -# @endcode -# -# @param[in] IN_SEARCH_PATH Name of path/folder that should be seached -# @param[in] IN_MATCH_PATTERN Name of subfolder/file in search path that should be found, set to "" / or empty variable if no match folder is needed -# @param[out] OUT_CROSS_SYSTEM_DIR Name of path/folder which matched above rule -IF (NOT COMMAND CROSS_SYSTEM_DIR) - FUNCTION(CROSS_SYSTEM_DIR IN_SEARCH_PATH IN_MATCH_PATTERN OUT_CROSS_SYSTEM_DIR) - IF(NOT (IS_ABSOLUTE ${IN_SEARCH_PATH})) - SET(IN_SEARCH_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${IN_SEARCH_PATH}") - ENDIF(NOT (IS_ABSOLUTE ${IN_SEARCH_PATH})) - - IF((CMAKE_SYSTEM_NAME) AND (CMAKE_SYSTEM_PROCESSOR) AND (CMAKE_SYSTEM_PROCESSOR_VARIANT) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}/${IN_MATCH_PATTERN})) # 1. /SYSTEM_NAME/SYSTEM_PROCESSOR.SYSTEM_PROCESSOR_VARIANT/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_NAME) AND (CMAKE_SYSTEM_PROCESSOR) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}/${IN_MATCH_PATTERN})) # 2. /SYSTEM_NAME/SYSTEM_PROCESSOR/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_NAME) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/Generic/${IN_MATCH_PATTERN})) # 3. /SYSTEM_NAME/Generic/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/Generic" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_NAME) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/generic/${IN_MATCH_PATTERN})) # 3. /SYSTEM_NAME/generic/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/generic" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_NAME) AND (NOT (${CMAKE_SYSTEM_NAME} STREQUAL "Generic")) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/${IN_MATCH_PATTERN})) # 4. /SYSTEM_NAME/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_PROCESSOR) AND (CMAKE_SYSTEM_PROCESSOR_VARIANT) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}/${IN_MATCH_PATTERN})) # 5. /SYSTEM_PROCESSOR.SYSTEM_PROCESSOR_VARIANT/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_PROCESSOR) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_PROCESSOR}/${IN_MATCH_PATTERN})) # 6. /SYSTEM_PROCESSOR/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_PROCESSOR}" PARENT_SCOPE) - ELSEIF(EXISTS ${IN_SEARCH_PATH}/Generic/${IN_MATCH_PATTERN}) # 7. /Generic/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/Generic" PARENT_SCOPE) - ELSEIF(EXISTS ${IN_SEARCH_PATH}/generic/${IN_MATCH_PATTERN}) # 7. /generic/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/generic" PARENT_SCOPE) - ELSEIF(EXISTS ${IN_SEARCH_PATH}/${IN_MATCH_PATTERN}) # 8. /IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}" PARENT_SCOPE) - ELSE() - IF("${IN_MATCH_PATTERN}" STREQUAL "") - MESSAGE(WARNING "CROSS_SYSTEM_DIR failed to find cross platform implementation, returning empty string.\n Fix this warning by creating a cross platform folder for ${CMAKE_SYSTEM_NAME}:${CMAKE_SYSTEM_PROCESSOR} in ${IN_SEARCH_PATH}.") - ELSE("${IN_MATCH_PATTERN}" STREQUAL "") - MESSAGE(WARNING "CROSS_SYSTEM_DIR failed to find cross platform implementation, returning empty string.\n Fix this warning by creating a cross platform folder for ${CMAKE_SYSTEM_NAME}:${CMAKE_SYSTEM_PROCESSOR} in ${IN_SEARCH_PATH} containing ${IN_MATCH_PATTERN}") - ENDIF("${IN_MATCH_PATTERN}" STREQUAL "") - SET(${OUT_CROSS_SYSTEM_DIR} "" PARENT_SCOPE) - ENDIF() - ENDFUNCTION(CROSS_SYSTEM_DIR IN_SEARCH_PATH IN_MATCH_PATTERN OUT_CROSS_SYSTEM_DIR) -ENDIF (NOT COMMAND CROSS_SYSTEM_DIR) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/CMakeLists.txt deleted file mode 100644 index 9fb2cbee7..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# Prevent multiple "inclusions" of TestFramework -if (NOT TARGET unity) - message(STATUS "TestFramework from ${CMAKE_CURRENT_SOURCE_DIR} included") - add_definitions( -DUNIT_TEST ) - - set(TEST_TOOLS_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE INTERNAL test_tools_dir) - - find_package(PythonInterp) - - include(CMakeFunctions.cmake) - - add_subdirectory(unity) - # Check whether the building of mock framework is disabled. - # Building of the mock framework can be disabled for the c51 or asip simply by adding the following line to the specific project at higher level: - # e.g.: set(DISABLE_MOCK 1) - # Warning, Do not set DISABLE_MOCK in this file. - if (NOT DEFINED DISABLE_MOCK) - add_subdirectory(mock) - endif (NOT DEFINED DISABLE_MOCK) -else() - message(STATUS "TestFramework from ${CMAKE_CURRENT_SOURCE_DIR} NOT included") -endif() diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/README.debugging b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/README.debugging deleted file mode 100644 index 432069d4a..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/README.debugging +++ /dev/null @@ -1,11 +0,0 @@ -# Debugging failed asserts - -In order to debug a failed assertion, it can be helpful to run the unit test in a -debugger and set a breakpoint. The table shows where to place the -breakpoint when troubleshooting different assertion error messages. - -|Test Error Message | Where to put breakpoint | -| --- | --- | -|":38:test_name:FAIL: Expected 3 Was 5" (and similar)|UnityTestResultsFailBegin()| -|"Expected mock call(s) never occurred, see list above for details."|mock_call_expected_did_not_occur()| -|"Unexpected mock call occurred: "|mock_call_did_not_find()| \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/gen_test_runner.py b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/gen_test_runner.py deleted file mode 100644 index 574490dea..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/gen_test_runner.py +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2018 Silicon Laboratories Inc. - -import sys -import os -import re -from io import open - -n=0 -regexp = '^void (test_[A-Za-z0-9_]+)\(.*\).*' - -filename, file_type = os.path.splitext(sys.argv[1]) - -funcs = [] - -for l in open(sys.argv[1], encoding='utf-8'): - m = re.search(regexp, l) - if(m): - funcs.append( (m.group(1).strip(),n) ) - n=n+1 - -print(''' -/* AUTOGENERATED FILE. DO NOT EDIT. */ -''') - -if(file_type == '.cpp'): - print(''' -extern "C" { -''') - -print(''' - #include "unity.h" - #include "unity_print.h" - #include "unity_internals.h" -#ifndef __codasip__ - #include "string.h" -#endif /* __codasip__ */ -''') - -if(file_type == '.cpp'): - print(''' -} -''') - -print(''' -int verbose; -''') - -for f in funcs: - print("void {}();".format(f[0])) - -print(''' - -// Inspired by how Unity creates the setUp and tearDown functions -// Purpose is a setup and teardown method called before suite is run, -// and after suite is run. -#if defined(UNITY_WEAK_ATTRIBUTE) - void setUpSuite(void); - void tearDownSuite(void); - UNITY_WEAK_ATTRIBUTE void setUpSuite(void) { } - UNITY_WEAK_ATTRIBUTE void tearDownSuite(void) { } -#elif defined(UNITY_WEAK_PRAGMA) -# pragma weak setUpSuite - void setUpSuite(void); -# pragma weak tearDownSuite - void tearDownSuite(void); -#else - void setUpSuite(void); - void tearDownSuite(void); -#endif -''') - -print(''' - -#ifdef __C51__ -#include "reg51.h" - -void setUp() { -#if 1 -SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */ -TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */ -TH1 = 0xf3; /* TH1: reload value for 2400 baud */ -TR1 = 1; /* TR1: timer 1 run */ -TI = 1; /* TI: set TI to send first char of UART */ -#else - int bBaudRate; - WATCHDOG_DISABLE; - bBaudRate = 1152; - bBaudRate = (80000/bBaudRate ) + (((80000 %bBaudRate ) >= (bBaudRate >> 1)) ? 1:0); - UART0_SET_BAUD_RATE(68); - UART0_TX_ENABLE; - - OPEN_IOS - UART0BUF = '*'; -#endif - -} - -void tearDown() { - -} - -extern int main(void) { - int i; - int ret; - - setUpSuite(); - verbose=0; - unity_print_init(); - UNITY_BEGIN(); - -''') -for f in funcs: - print(' UnityDefaultTestRun(&{}, "{}", {});'.format(f[0], f[0], f[1])) -print(''' - ret = UNITY_END(); - unity_print_close(); - tearDownSuite(); - while(1); -} -#else -int main(int argc, char** argp) { - int ret; - setUpSuite(); - unity_print_init(); - UNITY_BEGIN(); - - - if(argc==2) { - verbose=1; -''') -for f in funcs: - print(' if(strcmp(argp[1],"{}") == 0) UnityDefaultTestRun(&{}, "{}", {});'.format(f[0], f[0], f[0], f[1])) -print(''' - } else { - -''') -for f in funcs: - print(' UnityDefaultTestRun(&{}, "{}", {});'.format(f[0], f[0], f[1])) -print(''' - } - - ret = UNITY_END(); - unity_print_close(); - tearDownSuite(); - return ret; -} -#endif - -''') diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/CMakeLists.txt deleted file mode 100644 index a087970a9..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ - -# mock target may be imported be several projects, e.g. 700 series and libs2 simultaneously. -# This test ensures that the target named 'mock' will only be declared if it is not already declared. -if (NOT TARGET mock) - add_library(mock mock_control.c) - if (TARGET unity2) - target_link_libraries(mock unity2) - target_compile_definitions(mock PUBLIC USE_UNITY2) - message(STATUS "Linking mock framework with unity2") - else() - target_link_libraries(mock unity) - endif (TARGET unity2) - target_include_directories(mock PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - add_subdirectory(test) -endif (NOT TARGET mock) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/mock_control.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/mock_control.c deleted file mode 100644 index 24523d88c..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/mock_control.c +++ /dev/null @@ -1,171 +0,0 @@ -/* © 2014 Silicon Laboratories Inc. - */ - -/* - * mock_control.c - * - * Created on: Aug 14, 2015 - * Author: trasmussen - */ - -#include "mock_control.h" -#include -#include "unity.h" - -#define MOCK_CALL_DB_SIZE 8192 /**< Size of the mock call database. */ -#define FAKE_CALL_DB_SIZE 255 /**< Size of the fake call database. */ -#define STUB_CALL_DB_SIZE 255 /**< Size of the stub call database. */ -#define MAX_MESSAGE_LENGTH 4096 /**< Size of error message length, increase value if long messages are needed. */ - - -const mock_t default_entry = { - .p_func_name = "default", - .expect_arg = {{0}, {0}, {0}, {0}}, - .actual_arg = {{0}, {0}, {0}, {0}}, - .compare_rule_arg = {COMPARE_STRICT, COMPARE_STRICT, COMPARE_STRICT, COMPARE_STRICT}, - .error_code = {0}, - .return_code = {0}, - .executed = false -}; - -static mock_t mock_call_db[MOCK_CALL_DB_SIZE]; -static uint32_t mock_db_idx; - -static stub_t stub_call_db[STUB_CALL_DB_SIZE]; -static uint32_t stub_db_idx; - -static fake_t fake_call_db[FAKE_CALL_DB_SIZE]; -static uint32_t fake_db_idx; - -uint32_t g_mock_index; - -void mock_call_expect_ex(uint32_t line_number, const char * p_func_name, mock_t ** pp_mock) -{ - // Reset the entry before usage. - mock_call_db[mock_db_idx] = default_entry; - - // Assign entry and increment. - *pp_mock = &mock_call_db[mock_db_idx]; - (*pp_mock)->p_func_name = p_func_name; - (*pp_mock)->executed = false; - (*pp_mock)->line_number = line_number; - (*pp_mock)->mock_id = 0; - mock_db_idx++; -} - -void mock_calls_clear(void) -{ - mock_db_idx = 0; - stub_db_idx = 0; - fake_db_idx = 0; -} - -/** - * This is a separate function so we can place a breakpoint on it to diagnose - * "Expected mock call(s) never occurred" errors easily. - */ -static void mock_call_expected_did_not_occur() -{ - TEST_FAIL_MESSAGE("Expected mock call(s) never occurred, set breakpoint on mock_call_expected_did_not_occur() for details."); -} - -void mock_calls_verify(void) -{ - bool failed = false; - uint16_t i; - for (i = 0; i < mock_db_idx; i++) - { - if (false == mock_call_db[i].executed) - { - char error_msg[MAX_MESSAGE_LENGTH]; - sprintf(error_msg, " - Mock not called: %s(...) @ %s:%lu", mock_call_db[i].p_func_name, Unity.CurrentTestName, (long unsigned)mock_call_db[i].line_number); - UnityPrint(error_msg); - UNITY_OUTPUT_CHAR('\n'); - - failed = true; - } - mock_call_db[i] = default_entry; - } - mock_db_idx = 0; - stub_db_idx = 0; - fake_db_idx = 0; - - if (failed) - { - mock_call_expected_did_not_occur(); - } -} - -/** - * This is a separate function so we can place a breakpoint on it to diagnose Unexpected - * mock call errors easily. - */ -static void mock_call_did_not_find(char const * const p_function_name) -{ - char error_msg[MAX_MESSAGE_LENGTH]; - sprintf(error_msg, "Unexpected mock call occurred: %s(...). Set breakpoint on mock_call_did_not_find() for details.", p_function_name); - UNITY_TEST_FAIL(0, error_msg); -} - -bool mock_call_find(char const * const p_function_name, mock_t ** pp_mock) -{ - uint32_t i; - for (i = 0; i < mock_db_idx; i++) - { - if ((false == mock_call_db[i].executed) && - strcmp(mock_call_db[i].p_func_name, p_function_name) == 0) - { - *pp_mock = &mock_call_db[i]; - g_mock_index = i; - (*pp_mock)->executed = true; - return true; - } - } - mock_db_idx = 0; - stub_db_idx = 0; - fake_db_idx = 0; - - mock_call_did_not_find(p_function_name); - return false; -} - -bool mock_call_used_as_stub(char const * const p_file_name, char const * const p_function_name) -{ - uint32_t i; - for (i = 0; i < stub_db_idx; i++) - { - if ((strcmp(stub_call_db[i].p_name, p_function_name) == 0) || - (strcmp(stub_call_db[i].p_name, p_file_name) == 0)) - { - return true; - } - } - return false; -} - -void mock_call_use_as_stub(const char * const p_name) -{ - // Assign entry and increment. - stub_call_db[stub_db_idx++].p_name = p_name; -} - -bool mock_call_used_as_fake(char const * const p_file_name, char const * const p_function_name) -{ - uint32_t i; - for (i = 0; i < fake_db_idx; i++) - { - if ((strcmp(fake_call_db[i].p_name, p_function_name) == 0) || - (strcmp(fake_call_db[i].p_name, p_file_name) == 0)) - { - return true; - } - } - return false; -} - -void mock_call_use_as_fake(char * const p_name) -{ - // Assign entry and increment. - fake_call_db[fake_db_idx++].p_name = p_name; -} - diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/mock_control.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/mock_control.h deleted file mode 100644 index 3d27239f4..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/mock_control.h +++ /dev/null @@ -1,710 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ -/* - * mock_control.h - * - * Created on: Aug 14, 2015 - * Author: trasmussen - */ - -#ifndef _MOCK_CONTROL_H_ -#define _MOCK_CONTROL_H_ - -#include -#include -#include -#include "unity.h" - -#define TO_STR(TEXT) #TEXT /**< Macro for converting anything to a string, usefull when expecting a function call. */ -#define TO_STR_MACRO(TEXT) TO_STR(TEXT) - -#define ARG0 0 -#define ARG1 1 -#define ARG2 2 -#define ARG3 3 -#define ARG4 4 -#define ARG5 5 -#define ARG6 6 -#define ARG7 7 -#define ARG8 8 - -#define NUMBER_OF_ARGS 9 - -extern uint32_t g_mock_index; -#if defined(USE_UNITY2) -extern struct UNITY_STORAGE_T Unity; -#else -extern struct _Unity Unity; -#endif - -typedef enum -{ - COMPARE_STRICT = 0x00, - COMPARE_NULL, - COMPARE_NOT_NULL, - COMPARE_ANY, - COMPARE_DELTA, -}mock_rules_t; -// Other compare rules to be considered: COMPARE_RANGE, ... - -// The type of "value" should have same size as the "void *", -// if they differ in size test will fail on MIPS32 and other BE platforms, -// thus using uintptr_t which is a unsigned int with same size as a pointer. -typedef union -{ - void * pointer; - uintptr_t value; - // Short versions of above types for macro use. - void * p; - uintptr_t v; -}mock_type_t; - -typedef struct -{ - const char * p_func_name; /**< Pointer to the name of the function that this mock object covers. The function name - is specified when setting up an expected call in the mock framework, as: - mock_call_expect(TO_STR(), &p_mock); */ - mock_type_t expect_arg[NUMBER_OF_ARGS]; /**< Array of expected arguments which will be specified in the unit test, and validated - in the mock, when mocked is called by the tested unit. Setup of an expected argument - on the mock is done as (example is first argument, 0, expected to be 0x11): - p_mock->expect_arg[0].value = 0x11; - p_mock->expect_arg[0].pointer = p_some_pointer; */ - mock_type_t delta_arg[NUMBER_OF_ARGS]; /**< Array of delta values when compare rule is set to COMPARE_DELTA. - Following example would pass on any value between 5 and 15: - p_mock->compare_rule[0] = COMPARE_DELTA; - p_mock->expect_arg[0].value = 10; - p_mock->delta_arg[0].value = 5; */ - mock_type_t actual_arg[NUMBER_OF_ARGS]; /**< Array of the actual args. The actual parameters passed in the call to the function - mocked will be stored in actual_arg. This can be used for implementing additional - post processing checks or validation rules not implemented in the mock itself. - It may also be used for obtaining e.g. function pointers to callback functions. */ - mock_type_t output_arg[NUMBER_OF_ARGS]; /**< Array of output arguments. This array holds data to be copied as output valus in - parameters list when the functoin is called. As example, an array could be returned: - p_mock->output[0].value = length_output_array; - p_mock->output[1].pointer = output_array; */ - mock_type_t error_code; /**< Error code. The error code is useful for verifying the behavior of the unit under - test when a function call returns an error. When the error code is set, the mock - will return the error code imidiately, and not validate parametes. (This is - identical to setting compare_rule_rule to COMPARE_ANY) - Note that not all functions returns errors code, so the API should be examined to - see if this type can be used. - p_mock->error_code.value = ERROR_CODE_TO_TEST; */ - mock_type_t return_code; /**< Return value/code to be returned when mock is called. This is the return value of - the function and not to be mistaken with output values provided thought pointer - parameters of the function. To have the function returning the value 10, simply do: - p_mock->return_code.value = 10; */ - mock_rules_t compare_rule_arg[NUMBER_OF_ARGS]; /**< Compare rule to be used for parameter at index n. - Default compare rule is COMPARE_STRICT. So this value needs only to be set if the - parameter should be checked against a different rule, as example, COMPARE_ANY. - For a full list of vsupported compare rules, refer to @ref mock_rules_t. */ - bool executed; /**< Internal boolean used for identifying executed mocks. */ - uint32_t mock_index; /**< Internal index for identifying the index of the mock. */ - uint32_t line_number; /**< Internal line number to identify the line in the unit test where the mock was created. */ - uint32_t mock_id; /**< A mock id value that can be set by the user to identify the mock in the test-case as the one that is failing. */ -}mock_t; -// If compare range is added, then consider to also add: expect_arg_bound_upper, expect_arg_bound_lower. - -typedef struct -{ - const char * p_name; -}stub_t; - -typedef struct -{ - char * p_name; -}fake_t; - -#define MOCK_CALL_COMPARE_INPUT_UINT8(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, UINT8) - -#define MOCK_CALL_COMPARE_INPUT_UINT16(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, UINT16) - -#define MOCK_CALL_COMPARE_INPUT_UINT32(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, UINT32) - -#define MOCK_CALL_COMPARE_INPUT_INT8(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, INT8) - -#define MOCK_CALL_COMPARE_INPUT_INT32(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, INT32) - -#define MOCK_CALL_COMPARE_INPUT_HEX64(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, HEX64) - -#define MOCK_CALL_COMPARE_INPUT_HEX32(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, HEX32) - -#define MOCK_CALL_COMPARE_INPUT_HEX16(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, HEX16) - -#define MOCK_CALL_COMPARE_INPUT_HEX8(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, HEX8) - -#define MOCK_CALL_COMPARE_INPUT_HEX_ARRAY(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, HEX_ARRAY) - - -#define MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, TYPE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as argument " #ARGUMENT " in %s(...), mock call expect@%s:%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_##TYPE##_MESSAGE(P_MOCK->expect_arg[ARGUMENT].v, RECV_VALUE, __str); \ - break; \ - case COMPARE_DELTA: \ - sprintf(__str, " as argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_##TYPE##_WITHIN_MESSAGE(P_MOCK->delta_arg[ARGUMENT].value, P_MOCK->expect_arg[ARGUMENT].value, RECV_VALUE, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - case COMPARE_NULL: \ - TEST_FAIL_MESSAGE("Comparing as pointer on something not a pointer in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - - -#define MOCK_CALL_COMPARE_INPUT_BOOL(P_MOCK, ARGUMENT, RECV_VALUE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_MESSAGE((P_MOCK->expect_arg[ARGUMENT].v == RECV_VALUE), __str); \ - break; \ - case COMPARE_DELTA: \ - TEST_FAIL_MESSAGE("Comparing as bool in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_NOT_NULL: \ - case COMPARE_NULL: \ - TEST_FAIL_MESSAGE("Comparing as pointer on something not a pointer in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT8(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_MEMBER(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER, UINT8) - -#define MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT16(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_MEMBER(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER, UINT16) - -#define MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT32(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_MEMBER(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER, UINT32) - -#define MOCK_CALL_COMPARE_STRUCT_MEMBER(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER, TYPE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as '" TO_STR(MEMBER) "' in argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_##TYPE##_MESSAGE(((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->MEMBER, \ - ((STRUCT_TYPE *)RECV_POINTER)->MEMBER, __str); \ - break; \ - case COMPARE_DELTA: \ - sprintf(__str, " as '" TO_STR(MEMBER) "' in argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_##TYPE##_WITHIN_MESSAGE(P_MOCK->delta_arg[ARGUMENT].value, \ - ((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->MEMBER, \ - ((STRUCT_TYPE *)RECV_POINTER)->MEMBER, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - sprintf(__str, " Expected Non-NULL in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NOT_NULL_MESSAGE(RECV_POINTER, __str); \ - break; \ - case COMPARE_NULL: \ - sprintf(__str, " Expected NULL for argument %u in %s(...), mock call expect@%s::%lu. mock_id:%lu", ARGUMENT, __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NULL_MESSAGE(RECV_POINTER, __str); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_UINT8(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER, UINT8) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_UINT16(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER, UINT16) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_UINT32(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER, UINT32) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER, TYPE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as '" TO_STR(LENGTH_MEMBER) "' in argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_UINT32_MESSAGE(((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->LENGTH_MEMBER, \ - ((STRUCT_TYPE *)RECV_POINTER)->LENGTH_MEMBER, __str); \ - sprintf(__str, " as '" TO_STR(ARRAY_MEMBER) "' in argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_##TYPE##_ARRAY_MESSAGE(((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->ARRAY_MEMBER, \ - ((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER, \ - ((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->LENGTH_MEMBER, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - sprintf(__str, " Expected Non-NULL in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NOT_NULL_MESSAGE(((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER, __str); \ - break; \ - case COMPARE_NULL: \ - sprintf(__str, " Expected NULL for argument %u in %s(...), mock call expect@%s::%lu. mock_id:%lu", ARGUMENT, __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NULL_MESSAGE(((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER, __str); \ - break; \ - case COMPARE_DELTA: \ - TEST_FAIL_MESSAGE("Comparing delta on array is not possible in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH_UINT8(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH, UINT8) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH_UINT16(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH, UINT16) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH_UINT32(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH, UINT32) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH, TYPE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as '" TO_STR(ARRAY_MEMBER) "' in argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_##TYPE##_ARRAY_MESSAGE(((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->ARRAY_MEMBER, \ - ((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER, LENGTH, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - TEST_ASSERT_NOT_NULL(((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER); \ - break; \ - case COMPARE_NULL: \ - TEST_ASSERT_NULL(((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER); \ - break; \ - case COMPARE_DELTA: \ - TEST_FAIL_MESSAGE("Comparing delta on array is not possible in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_COMPARE_INPUT_UINT8_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH) \ - MOCK_CALL_COMPARE_INPUT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH, UINT8) - -#define MOCK_CALL_COMPARE_INPUT_UINT16_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH) \ - MOCK_CALL_COMPARE_INPUT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH, UINT16) - -#define MOCK_CALL_COMPARE_INPUT_UINT32_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH) \ - MOCK_CALL_COMPARE_INPUT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH, UINT32) - -#define MOCK_CALL_COMPARE_INPUT_INT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH) \ - MOCK_CALL_COMPARE_INPUT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH, INT) - -#define MOCK_CALL_COMPARE_INPUT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH, TYPE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as length for array in argument " #ARGUMENT " in %s(...), mock call expect@%s:%lu. mock_id:%lu, ", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_UINT32_MESSAGE(EXPECT_LENGTH, RECV_LENGTH, __str); \ - sprintf(__str, " as argument " #ARGUMENT " in %s(...), mock call expect@%s:%lu, mock_id:%lu.", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_##TYPE##_ARRAY_MESSAGE(P_MOCK->expect_arg[ARGUMENT].p, P_RECV_ARRAY, EXPECT_LENGTH, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - sprintf(__str, " Expected Non-NULL in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NOT_NULL_MESSAGE(P_RECV_ARRAY, __str); \ - break; \ - case COMPARE_NULL: \ - sprintf(__str, " Expected NULL for argument %u in %s(...), mock call expect@%s::%lu. mock_id:%lu", ARGUMENT, __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NULL_MESSAGE(P_RECV_ARRAY, __str); \ - break; \ - case COMPARE_DELTA: \ - TEST_FAIL_MESSAGE("Comparing delta on array is not possible in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_SET_OUTPUT_ARRAY(P_RESULT_ARRAY, P_OUT_ARRAY, LENGTH, TYPE) do { \ - uint32_t __loop_i; \ - TYPE * __result_array = (TYPE *)P_RESULT_ARRAY; \ - for (__loop_i = 0; __loop_i < LENGTH; __loop_i++) \ - { \ - P_OUT_ARRAY[__loop_i] = __result_array[__loop_i]; \ - } \ - }while(0) - -#define MOCK_CALL_COMPARE_INPUT_POINTER(P_MOCK, ARGUMENT, P_RECV_VALUE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as argument " #ARGUMENT " in %s(...), mock index=%lu, " __FILE__ ":" TO_STR_MACRO(__LINE__), __FUNCTION__, (long unsigned)g_mock_index); \ - TEST_ASSERT_EQUAL_PTR_MESSAGE(P_MOCK->expect_arg[ARGUMENT].p, P_RECV_VALUE, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - sprintf(__str, " Expected Non-NULL as argument " #ARGUMENT " in %s(...), mock call expect@%s:%lu, mock_id:%lu, ", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NOT_NULL_MESSAGE(P_RECV_VALUE, __str); \ - break; \ - case COMPARE_NULL: \ - sprintf(__str, " Expected NULL for argument %u in %s(...), mock call expect@%s::%lu. mock_id:%lu", ARGUMENT, __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NULL_MESSAGE(P_RECV_VALUE, __str); \ - break; \ - case COMPARE_ANY: \ - break; \ - case COMPARE_DELTA: \ - TEST_FAIL_MESSAGE("Comparing delta on pointer in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_FIND_RETURN_ON_FAILURE(P_MOCK, DEFAULT_VAL) do { \ - if (!mock_call_find(__FUNCTION__, &P_MOCK)) \ - { \ - return DEFAULT_VAL; \ - } \ -}while(0) - -#define MOCK_CALL_FIND_RETURN_VOID_ON_FAILURE(P_MOCK) do { \ - if (!mock_call_find(__FUNCTION__, &P_MOCK)) \ - { \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_IF_USED_AS_STUB(DEFAULT_VAL) do { \ - if (mock_call_used_as_stub( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return DEFAULT_VAL; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_IF_USED_AS_STUB() do { \ - if (mock_call_used_as_stub( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG1(P_FUNCTION, ARG0) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG2(P_FUNCTION, ARG0, ARG1) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG3(P_FUNCTION, ARG0, ARG1, ARG2) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG4(P_FUNCTION, ARG0, ARG1, ARG2, ARG3) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG5(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG6(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG7(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG8(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG9(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG1(P_FUNCTION, ARG0) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG2(P_FUNCTION, ARG0, ARG1) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG3(P_FUNCTION, ARG0, ARG1, ARG2) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG4(P_FUNCTION, ARG0, ARG1, ARG2, ARG3) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG5(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG6(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG7(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG8(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG9(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_IF_ERROR_SET(P_MOCK, TYPE) do { \ - if (P_MOCK->error_code.value != 0 ) \ - { \ - return (TYPE)P_MOCK->error_code.value; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VALUE(P_MOCK, TYPE) do { \ - return (TYPE)P_MOCK->return_code.value; \ -}while(0) - -#define MOCK_CALL_RETURN_POINTER(P_MOCK, TYPE) do { \ - return (TYPE)P_MOCK->return_code.pointer; \ -}while(0) - - -#if __C51__ -#define MOCK_CALL_ACTUAL_ARG1(P_MOCK, ARG0) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG2(P_MOCK, ARG0, ARG1) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG3(P_MOCK, ARG0, ARG1, ARG2) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \ - P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG4(P_MOCK, ARG0, ARG1, ARG2, ARG3) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \ - P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \ - P_MOCK->actual_arg[3].value = (uint32_t) ARG3; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG5(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \ - P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \ - P_MOCK->actual_arg[3].value = (uint32_t) ARG3; \ - P_MOCK->actual_arg[4].value = (uint32_t) ARG4; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG6(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \ - P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \ - P_MOCK->actual_arg[3].value = (uint32_t) ARG3; \ - P_MOCK->actual_arg[4].value = (uint32_t) ARG4; \ - P_MOCK->actual_arg[5].value = (uint32_t) ARG5; \ - }while(0) -#else -#define MOCK_CALL_ACTUAL_ARG1(P_MOCK, ARG0) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG2(P_MOCK, ARG0, ARG1) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG3(P_MOCK, ARG0, ARG1, ARG2) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG4(P_MOCK, ARG0, ARG1, ARG2, ARG3) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG5(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - P_MOCK->actual_arg[4].pointer = (void *)(uintptr_t) ARG4; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG6(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - P_MOCK->actual_arg[4].pointer = (void *)(uintptr_t) ARG4; \ - P_MOCK->actual_arg[5].pointer = (void *)(uintptr_t) ARG5; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG7(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - P_MOCK->actual_arg[4].pointer = (void *)(uintptr_t) ARG4; \ - P_MOCK->actual_arg[5].pointer = (void *)(uintptr_t) ARG5; \ - P_MOCK->actual_arg[6].pointer = (void *)(uintptr_t) ARG6; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG8(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - P_MOCK->actual_arg[4].pointer = (void *)(uintptr_t) ARG4; \ - P_MOCK->actual_arg[5].pointer = (void *)(uintptr_t) ARG5; \ - P_MOCK->actual_arg[6].pointer = (void *)(uintptr_t) ARG6; \ - P_MOCK->actual_arg[7].pointer = (void *)(uintptr_t) ARG7; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG9(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - P_MOCK->actual_arg[4].pointer = (void *)(uintptr_t) ARG4; \ - P_MOCK->actual_arg[5].pointer = (void *)(uintptr_t) ARG5; \ - P_MOCK->actual_arg[6].pointer = (void *)(uintptr_t) ARG6; \ - P_MOCK->actual_arg[7].pointer = (void *)(uintptr_t) ARG7; \ - P_MOCK->actual_arg[8].pointer = (void *)(uintptr_t) ARG8; \ - }while(0) -#endif - -#define N_ARGS_COUNT(_1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) N -#define N_ARGS(...) N_ARGS_COUNT(__VA_ARGS__, 9, 8, 7, 6, 5, 4, 3, 2, 1) - -#define MOCK_CALL_RETURN_VOID_FAKE_HELPER_IMPL(P_FUNCTION, COUNT, ...) MOCK_CALL_RETURN_VOID_FAKE_ARG ## COUNT (P_FUNCTION, __VA_ARGS__) -#define MOCK_CALL_RETURN_VOID_FAKE_HELPER(P_FUNCTION, COUNT, ...) MOCK_CALL_RETURN_VOID_FAKE_HELPER_IMPL(P_FUNCTION, COUNT, __VA_ARGS__) -#define MOCK_CALL_RETURN_VOID_IF_USED_AS_FAKE(P_FUNCTION, ...) MOCK_CALL_RETURN_VOID_FAKE_HELPER(P_FUNCTION, N_ARGS(__VA_ARGS__), __VA_ARGS__) - -#define MOCK_CALL_RETURN_FAKE_HELPER_IMPL(P_FUNCTION, COUNT, ...) MOCK_CALL_RETURN_FAKE_ARG ## COUNT (P_FUNCTION, __VA_ARGS__) -#define MOCK_CALL_RETURN_FAKE_HELPER(P_FUNCTION, COUNT, ...) MOCK_CALL_RETURN_FAKE_HELPER_IMPL(P_FUNCTION, COUNT, __VA_ARGS__) -#define MOCK_CALL_RETURN_IF_USED_AS_FAKE(P_FUNCTION, ...) MOCK_CALL_RETURN_FAKE_HELPER(P_FUNCTION, N_ARGS(__VA_ARGS__), __VA_ARGS__) - -#define MOCK_CALL_ACTUAL_IMPL(P_MOCK, COUNT, ...) MOCK_CALL_ACTUAL_ARG ## COUNT (P_MOCK, __VA_ARGS__) -#define MOCK_CALL_ACTUAL_HELPER(P_MOCK, COUNT, ...) MOCK_CALL_ACTUAL_IMPL(P_MOCK, COUNT, __VA_ARGS__) -#define MOCK_CALL_ACTUAL(P_MOCK, ...) MOCK_CALL_ACTUAL_HELPER(P_MOCK, N_ARGS(__VA_ARGS__), __VA_ARGS__) - -void mock_call_expect_ex(uint32_t line_number, const char * p_func_name, mock_t ** pp_mock); -#define mock_call_expect(fn, mock) mock_call_expect_ex(__LINE__, fn, mock) - -/**@brief Function for clearing all expectation in the mock framework. - * - * @details A prematurely unit abort might result in the mock database not being cleaned up. - * This can potentially interfere with following test cases. - * To ensure that the mock db is properly initialized for a test case, then it is advise - * to clear the db at the start of a test case, by calling @ref mock_calls_clear. - */ -void mock_calls_clear(void); - -/**@brief Function for verifying that all expected calls to mocks has occured. - * - * @details During a unit test several mock calls may be expected. During test execution the mock - * framework monitors the calls to each expected call. The mock framework can evaluate - * upon each mock call whether the call is expected. - * At the end of a unit test @ref mock_calls_verify must be executed to ensure that all - * expectation regarding mock calls are met. As example, function_A was expected to be - * called from the unit under test, but due to error in implementation, this never happened. - * This is validated when @ref mock_calls_verify is executed. - */ -void mock_calls_verify(void); - -bool mock_call_find(char const * const p_func_name, mock_t ** pp_mock); - -bool mock_call_used_as_stub(char const * const p_file_name, char const * const p_function_name); - -void mock_call_use_as_stub(const char * const p_name); - -bool mock_call_used_as_fake(char const * const p_file_name, char const * const p_function_name); - -void mock_call_use_as_fake(char * const p_name); - -#endif // _MOCK_CONTROL_H_ - diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/CMakeLists.txt deleted file mode 100644 index afdf03e10..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_definitions( -DUNIT_TEST ) - -add_unity_test(NAME test_mock_framework FILES test_mock_framework.c example_test_mock.c LIBRARIES mock) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/example_test_mock.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/example_test_mock.c deleted file mode 100644 index 21ea54d7d..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/example_test_mock.c +++ /dev/null @@ -1,135 +0,0 @@ -/* © 2014 Silicon Laboratories Inc. - */ - -/* - * ZW_timer_mock.c - * - * Created on: Aug 14, 2015 - * Author: trasmussen - */ - -#include "example_test_mock.h" -#include -#include -#include "mock_control.h" -#include "unity.h" - -#define MOCK_FILE "example_test_mock.c" - -uint32_t mock_function_simple_input(uint8_t arg0, uint16_t arg1, uint32_t arg2) -{ - mock_t * p_mock; - - MOCK_CALL_RETURN_IF_USED_AS_STUB(0x00); - MOCK_CALL_FIND_RETURN_ON_FAILURE(p_mock, 0xFF); - MOCK_CALL_ACTUAL(p_mock, arg0, arg1, arg2); - MOCK_CALL_RETURN_IF_ERROR_SET(p_mock, uint32_t); - MOCK_CALL_COMPARE_INPUT_UINT8(p_mock, ARG0, arg0); - MOCK_CALL_COMPARE_INPUT_UINT16(p_mock, ARG1, arg1); - MOCK_CALL_COMPARE_INPUT_UINT32(p_mock, ARG2, arg2); - MOCK_CALL_RETURN_VALUE(p_mock, uint32_t); -} - -uint32_t mock_function_pointer_input(void * void_pointer , uint32_t * num_pointer, mock_callback_function_t func_pointer) -{ - mock_t * p_mock; - - MOCK_CALL_RETURN_IF_USED_AS_STUB(0x00); - MOCK_CALL_FIND_RETURN_ON_FAILURE(p_mock, 0xFF); - MOCK_CALL_ACTUAL(p_mock, void_pointer, num_pointer, func_pointer); - MOCK_CALL_RETURN_IF_ERROR_SET(p_mock, uint32_t); - MOCK_CALL_COMPARE_INPUT_POINTER(p_mock, ARG0, void_pointer); - MOCK_CALL_COMPARE_INPUT_POINTER(p_mock, ARG1, num_pointer); - MOCK_CALL_COMPARE_INPUT_POINTER(p_mock, ARG2, func_pointer); - MOCK_CALL_RETURN_VALUE(p_mock, uint32_t); -} - -/** - * @brief This function provides a fake implementation example when using the mock function - * \ref mock_function_array as fake. - * - * @param[in] p_in_array Pointer to an array. - * @param[in] in_length Length of array. - * @param[out] p_out_array Pointer to an array. - * @param[in,out] p_in_out_length Pointer where size of incoming array is specified, used for actual length when outgoing. - * - * @return Return value represented by uint32_t. - - */ -static uint32_t mock_function_array_fake(uint8_t * p_in_array, uint32_t in_length, - uint8_t * p_out_array, uint32_t *p_in_out_length) -{ - memcpy(p_out_array, p_in_array, in_length); - return 0; -} - -/**@brief This function provides a function for mock calls that takes arrays with length information as input/output. - * - * @param[in] p_in_array Pointer to an array. - * @param[in] in_length Length of array. - * @param[out] p_out_array Pointer to an array. - * @param[in,out] p_in_out_length Pointer where size of incoming array is specified, used for actual length when outgoing. - * - * @return Return value represented by uint32_t. - */ -uint32_t mock_function_array(uint8_t * p_in_array, uint32_t in_length, - uint8_t * p_out_array, uint32_t *p_in_out_length) -{ - mock_t * p_mock; - - MOCK_CALL_RETURN_IF_USED_AS_STUB(0x00); - MOCK_CALL_RETURN_IF_USED_AS_FAKE(mock_function_array_fake, p_in_array, in_length, p_out_array, p_in_out_length); - MOCK_CALL_FIND_RETURN_ON_FAILURE(p_mock, 0xFF); - MOCK_CALL_ACTUAL(p_mock, p_in_array, in_length, p_out_array, p_in_out_length); - MOCK_CALL_RETURN_IF_ERROR_SET(p_mock, uint32_t); - - // Validating array input according to expectation setup in unit test. - MOCK_CALL_COMPARE_INPUT_UINT8_ARRAY(p_mock, ARG0, p_mock->expect_arg[1].v, p_in_array, in_length); - MOCK_CALL_COMPARE_INPUT_UINT8(p_mock, ARG3, *p_in_out_length); - - // Setting data output according to rules setup in unit test. - MOCK_CALL_SET_OUTPUT_ARRAY(p_mock->output_arg[2].p, p_out_array, p_mock->output_arg[3].v, uint8_t); - *p_in_out_length = p_mock->output_arg[3].v; - - MOCK_CALL_RETURN_VALUE(p_mock, uint32_t); -} - -/** - * Fake implementation example when using the mock function \ref mock_function_struct as fake. - */ -static void mock_function_struct_fake(test_mock_struct_t * p_test_struct) -{ - p_test_struct->member_byte = p_test_struct->member_byte + 1; - p_test_struct->member = p_test_struct->member + 2; - p_test_struct->union_member.submember_b = p_test_struct->union_member.submember_b + 3; -} - -void mock_function_struct(test_mock_struct_t * p_test_struct) -{ - mock_t * p_mock; - - MOCK_CALL_RETURN_VOID_IF_USED_AS_STUB(); - MOCK_CALL_RETURN_VOID_IF_USED_AS_FAKE(mock_function_struct_fake, p_test_struct); - MOCK_CALL_FIND_RETURN_VOID_ON_FAILURE(p_mock); - MOCK_CALL_ACTUAL(p_mock, p_test_struct); - - // This type of compare is comparing raw memory. - // It is usefull if it can be ensure that ALL mem is filled out as expected. - // If only certain fields are to be examined, used the example below. - //MOCK_CALL_COMPARE_INPUT_POINTER(p_mock, ARG0, p_test_struct); - - // This validation checks only fields required in the struct - recommended. - MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT8(p_mock, ARG0, p_test_struct, test_mock_struct_t, member_byte); - MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT32(p_mock, ARG0, p_test_struct, test_mock_struct_t, member); - MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT32(p_mock, ARG0, p_test_struct, test_mock_struct_t, union_member.submember_a); - MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT32(p_mock, ARG0, p_test_struct, test_mock_struct_t, union_member.submember_b); -} - - -void mock_function_void(void) -{ - mock_t * p_mock; - - MOCK_CALL_RETURN_VOID_IF_USED_AS_STUB(); - MOCK_CALL_FIND_RETURN_VOID_ON_FAILURE(p_mock); -} diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/example_test_mock.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/example_test_mock.h deleted file mode 100644 index 2ca5653d2..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/example_test_mock.h +++ /dev/null @@ -1,100 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. */ -/* - * example_test_mock.h - * - * Created on: Aug 21, 2015 - * Author: trasmussen - */ -#ifndef _EXAMPLE_TEST_MOCK_H_ -#define _EXAMPLE_TEST_MOCK_H_ - -#include -#include - -#if __C51__ - typedef uint16_t WORD; - typedef uint8_t BYTE; - #define CODE code - #define VOID_CALLBACKFUNC(completedFunc) void (CODE *completedFunc) - #define STRIP_GENERIC_PTR(p) ((unsigned) (void *) (p)) - #define IS_NULL(x) (STRIP_GENERIC_PTR(x) == 0) - #define NON_NULL(x) (STRIP_GENERIC_PTR(x) != 0) -#elif __GNUC__ - typedef uint16_t WORD; - typedef uint8_t BYTE; - #define CODE - #define VOID_CALLBACKFUNC(completedFunc) void (*completedFunc) - #define IS_NULL(x) (x == 0) - #define NON_NULL(x) (x != 0) -#else - #error Unknown compiler -#endif - -/**@brief Mock file for testing the mock framework. - * - * In order to verify that the mock framework itself is testing correctly, this mock file has - * been created. This file can also be used as a generic template for creation of new mocks. - * - * Feel free to add more mock templates and extend the test cases in order to make it easier for your - * co-workers to create new mocks. - */ - -/**@brief Example of a callback function which can be used for further testing. - */ -typedef void (*mock_callback_function_t)(uint32_t test_number); - -typedef struct -{ - uint8_t member_byte; - uint32_t member; - union - { - uint8_t submember_a; - uint32_t submember_b; - }union_member; -}test_mock_struct_t; - -/**@brief This function provides a simple function for mock calls that takes normal types. - * - * @param[in] arg0 First argument represented by uint8_t. - * @param[in] arg1 Second argument represented by uint16_t. - * @param[in] arg2 Third argument represented by uint32_t. - * - * @return Return value represented by uint32_t. - */ -uint32_t mock_function_simple_input(uint8_t arg0, uint16_t arg1, uint32_t arg2); - -/**@brief This function provides a simple function for mock calls that takes pointers as input. - * - * @param[in] void_pointer First argument represented by a void pointer. - * @param[in] num_pointer Second argument represented by a pointer to uint32_t data. - * @param[in] func_pointer Third argument represented by a function pointer to a mock_callback_function_t callback function. - * - * @return Return value represented by uint32_t. - */ -uint32_t mock_function_pointer_input(void * void_pointer , uint32_t * num_pointer, mock_callback_function_t func_pointer); - -/**@brief This function provides a function for mock calls that takes arrays with length information as input/output. - * - * @param[in] in_array Pointer to an array. - * @param[in] in_length Length of array. - * @param[out] out_array Pointer to an array. - * @param[in,out] in_out_length Pointer where size of incoming array is specified, used for actual length when outgoing. - * - * @return Return value represented by uint32_t. - */ -uint32_t mock_function_array(uint8_t * in_array, uint32_t in_length, - uint8_t * out_array, uint32_t *in_out_length); - -/**@brief This function provides a function for void mock calls. - */ -void mock_function_void(void); - -/**@brief This function provides a function for mock calls that takes a pointer to a struct as input. - * - * @param[in] p_test_struct Pointer to the test struct. - */ -void mock_function_struct(test_mock_struct_t * p_test_struct); - - -#endif /* _EXAMPLE_TEST_MOCK_H_ */ diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/test_mock_framework.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/test_mock_framework.c deleted file mode 100644 index d648c690f..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/test_mock_framework.c +++ /dev/null @@ -1,367 +0,0 @@ -/* © 2014 Silicon Laboratories Inc. - */ - -/* - * test_kex.c - * - * Created on: Aug 12, 2015 - * Author: trasmussen - */ - -/** Extensions to mock framework: - * - Setting of output values: - * - Structs, due to nature of structs, this must be handled by the mock itself. - * - void functions (in mock), when used as stub and default value in error, done, needs testing. - */ - -#include -#include -#include -#include "unity.h" -#include "example_test_mock.h" - -void setUpSuite(void) { - -} - -void tearDownSuite(void) { - -} - -static bool m_callback_executed = false; -static uint32_t m_callback_test_number; - -void callback_func_used_for_mock_verification(uint32_t test_number) -{ - m_callback_executed = true; - m_callback_test_number = test_number; -} - -/* Test that ensures the mock framework and db are correctly configured :-) - * This test verifies normal mock operations with following compare rules: - * Compare Strict : The value received in the mock must match exactly the value expected (default setting) - * Compare Any : Any value will be expepted in the mock - * Compare Delta : The value +/- the delta will be expepted in the mock - * Expected outcome: Test pass - */ -void test_mock_framework_compare_rules_simple() { - mock_t * p_mock; - - // Expected values. - const uint8_t expected_return_value = 0; - - // Clearing the mock db. - mock_calls_clear(); - - // Compare strict (default setting) - mock_call_expect(TO_STR(mock_function_simple_input), &p_mock); - p_mock->expect_arg[0].value = 0x12; // Default rule: Compare strict. - p_mock->expect_arg[1].value = 0x1234; // Default rule: Compare strict. - p_mock->expect_arg[2].value = 0x12345678; // Default rule: Compare strict. - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(mock_function_simple_input), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_DELTA; - p_mock->compare_rule_arg[1] = COMPARE_STRICT; - p_mock->compare_rule_arg[2] = COMPARE_ANY; - p_mock->expect_arg[0].value = 10; - p_mock->delta_arg[0].value = 2; - p_mock->expect_arg[1].value = 0x12; - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(mock_function_simple_input), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_DELTA; - p_mock->compare_rule_arg[1] = COMPARE_DELTA; - p_mock->compare_rule_arg[2] = COMPARE_DELTA; - p_mock->expect_arg[0].value = 0x50; - p_mock->delta_arg[0].value = 0x10; - p_mock->expect_arg[1].value = 0x5050; - p_mock->delta_arg[1].value = 0x500; - p_mock->expect_arg[2].value = 0x12121212; - p_mock->delta_arg[2].value = 0x100000; - p_mock->return_code.value = 0; - - // When starting the timer we expect to receive the first handle. - uint8_t retval = mock_function_simple_input(0x12, 0x1234, 0x12345678); - TEST_ASSERT_EQUAL_INT(expected_return_value, retval); - - retval = mock_function_simple_input(12, 0x12, 15); - TEST_ASSERT_EQUAL_INT(expected_return_value, retval); - - retval = mock_function_simple_input(0x40, 0x5500, 0x12021212); - TEST_ASSERT_EQUAL_INT(expected_return_value, retval); - - mock_calls_verify(); -} - -/* Test that ensures the mock framework and db are correctly configured :-) - * This test ensures that is the mock function is configured to return an error for error handling - * verification, then arguments are not verified. - * - * Expected outcome: Test pass - */ -void test_mock_framework_error_return() { - mock_t * p_mock; - - // Expected values. - const uint8_t expected_return_value = 0xFF; - - // Clearing the mock db. - mock_calls_clear(); - - // Expected mock calls and corresponding setup. - // 1) TimerStart, which returns an error. - mock_call_expect(TO_STR(mock_function_simple_input), &p_mock); - p_mock->error_code.value = 255; - - // When calling the mock we expect to receive an error back to ensure the mock behavois as defined. - uint8_t retval = mock_function_simple_input(1, 2, 3); - TEST_ASSERT_EQUAL_INT(expected_return_value, retval); - - mock_calls_verify(); -} - -/* Test that ensures the mock framework and db are correctly configured :-) - * - */ -void test_mock_framework_stub_function() -{ - // Expected mock calls and corresponding setup. - mock_call_use_as_stub(TO_STR(mock_function_simple_input)); - - mock_function_simple_input(1, 2 , 3); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - mock_function_simple_input(0x12, 0x9876, 0x98765432); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - mock_function_simple_input(0, 0, 0); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - - mock_calls_verify(); -} - -/* Test that ensures the mock framework and db are correctly configured :-) - * - * This test ensures that a given mock file is completely used as a stub on all functions. - */ -void test_mock_framework_stub_file() -{ - uint32_t number = 10; - uint32_t * p_number = &number; - void * p_void = &number; - - // Clearing the mock db. - mock_calls_clear(); - - // Expected mock calls and corresponding setup. - mock_call_use_as_stub("example_test_mock.c"); - - mock_function_simple_input(1, 2 , 3); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - mock_function_simple_input(0x12, 0x9876, 0x98765432); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - mock_function_simple_input(0, 0, 0); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - mock_function_pointer_input(p_void, p_number, callback_func_used_for_mock_verification); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - - mock_calls_verify(); -} - -void test_mock_framework_array() -{ - mock_t * p_mock; - // This is the expected array that will be specified as expected in p_mock. - uint8_t expected_array[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 9}; - uint32_t expected_length = 10; - // This is the actual array that will be passed to the function call (mock) and will internally - // within the mock be compared against the expected. - uint8_t actual_array[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 9}; - uint32_t actual_length = 10; - - // This is the out array that will be specified as output in p_mock, the mock will copy the - // content to the parameter passed in the function call. - uint8_t out_array[10] = {9, 1, 2, 3, 4, 5, 6, 7, 8, 9}; - uint32_t out_length = 10; - - // This is the return array which contains no data, but is expected to be filled with out array - // in p_mock, the mock is expected to copy the content of out_array to the parameter passed in - // the function call (return_array). - uint8_t return_array[20]; - uint32_t return_length = 20; - - // This is the expected array that whichi is used in this test to ensure that what was returned - // in return array as expected. - uint8_t expected_out_array[10] = {9, 1, 2, 3, 4, 5, 6, 7, 8, 9};; - uint32_t expected_out_length = 10; - - // Clearing the mock db. - mock_calls_clear(); - - mock_call_expect(TO_STR(mock_function_array), &p_mock); - p_mock->expect_arg[0].pointer = expected_array; // Default rule: Compare strict. - p_mock->expect_arg[1].value = expected_length; // Default rule: Compare strict. - p_mock->expect_arg[3].value = return_length; // Default rule: Compare strict. - // Control the output from the mock when mock_function_array(...) is called. - p_mock->output_arg[2].pointer = out_array; // Output: Reversed array. - p_mock->output_arg[3].value = out_length; // Output: Reversed array. - - p_mock->return_code.value = 0; - - mock_function_array(actual_array, actual_length, return_array, &return_length); - - // Validating that the mock returned the correct output. - TEST_ASSERT_EQUAL_UINT32(expected_out_length, return_length); - TEST_ASSERT_EQUAL_UINT8_ARRAY(expected_out_array, return_array, expected_out_length); - - mock_calls_verify(); -} - - -/* Test that ensures the mock framework and db are correctly configured :-) - * - */ -void test_mock_framework_pointer() -{ - mock_t * p_mock; - // Clearing the mock db. - mock_calls_clear(); - - // As we are emulating a unit under test providing an internal function pointer, we don't have the knowledge on which. - // It is just expected that the function pointer is NOT NULL. - // Thereafter we execute whatever actual argument that was stored to ensure the functionality was indeed as expected. - mock_call_expect(TO_STR(mock_function_pointer_input), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->compare_rule_arg[1] = COMPARE_ANY; - p_mock->compare_rule_arg[2] = COMPARE_NOT_NULL; // This is where we expect the function pointer tro be passed and retrieved. - p_mock->return_code.value = 0; - - mock_function_pointer_input(NULL, NULL, callback_func_used_for_mock_verification); - - // Potential value which can be fetched, e.g. to get a callback handle inside the mock or post validation of a value/struct. - // We try and fetch actual_arg[2] from the mock, which should contain argument 2 above (callback_func_used_for_mock_verification), - // in case the mock is correctly created and then cast it. - mock_callback_function_t cb = (mock_callback_function_t)p_mock->actual_arg[2].pointer; - TEST_ASSERT_EQUAL_PTR(callback_func_used_for_mock_verification, cb); - - // By calling the callback function here, then it is ensured that the actual callback passed to - // the mock, and received back through the actual_arg list are the same. - // The function pointers has already been compared so this is an additional verification. - // Values are not correct until the mock has been called so we verify m_callback_executed is FALSE. - TEST_ASSERT_FALSE(m_callback_executed); - cb(0x34325354); - TEST_ASSERT_TRUE(m_callback_executed); - TEST_ASSERT_EQUAL_UINT32(0x34325354, m_callback_test_number); - - mock_calls_verify(); -} - -void mock_function_void(void); -/* Test that ensures the mock framework and db are correctly configured :-) - * - */ -void test_mock_framework_void_function() -{ - mock_t * p_mock; - // Clearing the mock db. - mock_calls_clear(); - - // As we are emulating a unit under test providing an internal function pointer, we don't have the knowledge on which. - // It is just expected that the function pointer is NOT NULL. - // Thereafter we execute whatever actual argument that was stored to ensure the functionality was indeed as expected. - mock_call_expect(TO_STR(mock_function_void), &p_mock); - mock_call_expect(TO_STR(mock_function_void), &p_mock); - mock_call_expect(TO_STR(mock_function_void), &p_mock); - - mock_function_void(); - mock_function_void(); - mock_function_void(); - - mock_calls_verify(); -} - -/** TODO Test array embedded in struct. */ -void test_mock_framework_struct() { - mock_t * p_mock; - - test_mock_struct_t expect_struct_2 = - { - .member_byte = 0xAB, - .member = 0x23455432, - .union_member = {.submember_b = 0x3333} - }; - - test_mock_struct_t actual_struct_1; - - test_mock_struct_t actual_struct_2 = - { - .member_byte = 0xAB, - .member = 0x23455432, - .union_member = {.submember_b = 0x3333} - }; - - // Clearing the mock db. - mock_calls_clear(); - - // Compare strict (default setting) - mock_call_expect(TO_STR(mock_function_struct), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - - mock_call_expect(TO_STR(mock_function_struct), &p_mock); - p_mock->expect_arg[0].pointer = &expect_struct_2; - - mock_function_struct(&actual_struct_1); - - mock_function_struct(&actual_struct_2); - - mock_calls_verify(); -} - -/* Test that ensures the framework and cmake files are correctly configured :-) */ -/* Seconde test to ensure the framework and cmake files are correctly configured :-) - * Expected outcome: Test pass - */ -void test_mock_first_build_pass() { - TEST_ASSERT_TRUE(1); -} - -/* Test that ensures that fake implementation of a function is correctly executed. - * When the mock is setup as a fake then it is expected that data will be copied from buffer_in to buffer_out. - * Expected outcome: Test pass - * Buffer_out == buffer_in - */ -void test_mock_fake_handling() { - uint8_t buffer_in[] = {0xDE, 0xAD, 0xBE, 0xEF}; - uint8_t buffer_out[] = {0xCA, 0xFE, 0xBA, 0xBE}; - uint32_t buffer_out_length = sizeof(buffer_out); - test_mock_struct_t test_struct = {.member_byte = 0xA5, - .member = 0xDEADC0DE, - .union_member.submember_b = 0xDEADBEEF - }; - - // Clearing the mock db. - mock_calls_clear(); - - // Setup the array function to be use its fake implementation (memcpy) - mock_call_use_as_fake(TO_STR(mock_function_array)); - mock_call_use_as_fake(TO_STR(mock_function_struct)); - - uint32_t compare_result = memcmp(buffer_in, buffer_out, sizeof(buffer_in)); - TEST_ASSERT_TRUE(compare_result != 0); - - // Calling mock_function_array(...) should result in the fake implementation to be used, thus - // content of buffer_in should be copied to buffer_out. - mock_function_array(buffer_in, sizeof(buffer_in), buffer_out, &buffer_out_length); - - TEST_ASSERT_EQUAL_UINT32(sizeof(buffer_in), buffer_out_length); - TEST_ASSERT_EQUAL_UINT8_ARRAY(buffer_in, buffer_out, sizeof(buffer_in)); - - // Calling mock_function_array(...) should result in the fake implementation to be used, thus - // content of buffer_in should be copied to buffer_out. - mock_function_array(buffer_in, sizeof(buffer_in), buffer_out, &buffer_out_length); - - TEST_ASSERT_EQUAL_UINT32(sizeof(buffer_in), buffer_out_length); - TEST_ASSERT_EQUAL_UINT8_ARRAY(buffer_in, buffer_out, sizeof(buffer_in)); - - // Calling mock_function_struct(...) should result in the fake implementation to be used, thus - // content of test_struct should be update with +1, +2, +3, as seen in the fake implementation. - mock_function_struct(&test_struct); - TEST_ASSERT_EQUAL_UINT8(0xA6, test_struct.member_byte); - TEST_ASSERT_EQUAL_UINT32(0xDEADC0E0, test_struct.member); - TEST_ASSERT_EQUAL_UINT32(0xDEADBEF2, test_struct.union_member.submember_b); - - mock_calls_verify(); -} - diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/python/__init__.py b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/python/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/python/remote_execution.py b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/python/remote_execution.py deleted file mode 100644 index 6e89bfeee..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/python/remote_execution.py +++ /dev/null @@ -1,297 +0,0 @@ -#!/usr/bin/python -# Copyright (c) 2018 Silicon Laboratories Inc. - -import sys -import os -import paramiko -import socket -import threading -import time -import re -from . import xunit -from distutils.version import StrictVersion - -zw700versions = [(StrictVersion('0.1.9'), './bin/start-700_platform.sh -k ~/{} -r 256', './bin/start-700_platform.sh -s'), - (StrictVersion('0.1.8'), './bin/start-700_platform.sh -k ~/{} -r 256 -c', './bin/start-700_platform.sh -s'), - (StrictVersion('0.0.1'), './bin/start-700_platform.sh -k ~/{} -r 256', 'killall toplevel')] - -DEBUG = 0 - -class RemoteTestSession(): - def __init__(self, server, username='developer', password='1234', timeout=60, xmlfile=None): - self.server = server - self.xmlfile = xmlfile - self.testResult = [] - self.testTime = 0.0 - self.commands = zw700versions[-1] - - self.username = username - self.password = password - self.timeout = timeout - - self.remotesession_stdin = None - - self.sshclient = paramiko.SSHClient() - self.sshclient.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - if DEBUG: print('Connecting to: %s' % self.server) - self.sshclient.connect(self.server, username=self.username, password=self.password) - self.sftpsession = self.sshclient.open_sftp() - self.getServerVersion() - - def put(self, localFile, remoteFile): - # Use SFTP module to upload file - self.sftpsession.put(localFile, remoteFile) - - def executeTest(self, remoteFile): - self.testResult = [] - consoleThread = RemoteTestConsoleThread(self, self.server, 11236) - consoleThread.start() - if DEBUG: print('Running %s remotely' % remoteFile) - remote_cmd = self.commands[1].format(remoteFile) - stdin, stdout, stderr = self.sshclient.exec_command(remote_cmd) - if DEBUG: - s = stdout.read() - if s: - print('commands[1] stdout:') - print('%s' % s) - s = stderr.read() - if s: - print('commands[1] stderr:') - print('%s' % s) - stdin.close() - stdout.close() - stderr.close() - consoleThread.join() - - def getTestResult(self): - return self.testResult - - def getTestResultXml(self, testname): - return xunit.TestSuite().fromUnity(self.testResult, name=testname, time=self.testTime, hostname=self.server) - - def setTestResult(self, testResult, time=0.0): - self.testResult = testResult - self.testTime = time - - def endTest(self): - remote_cmd = self.commands[2] - stdin, stdout, stderr = self.sshclient.exec_command(remote_cmd) - if DEBUG: - s = stdout.read() - if s: - print('commands[2] stdout:') - print('%s' % s) - s = stderr.read() - if s: - print('commands[2] stderr:') - print('%s' % s) - stdin.close() - stdout.close() - stderr.close() - - def getTimeout(self): - return self.timeout - - def getServerVersion(self): - systemtype = 'Unknown' - version = 'Unknown' - remote_cmd = './bin/start-700_platform.sh -v -k none' - stdin, stdout, stderr = self.sshclient.exec_command(remote_cmd) - versionstr = stdout.read() - versionlist = re.findall(r".*;.*;?", versionstr, re.MULTILINE) - if len(versionlist) > 0: - versiongrp = re.match(r"([^;]*);([^;]*)(.*)?", versionlist[0]) - if versiongrp.group(1) is not None and versiongrp.group(1) != "": systemtype = versiongrp.group(1) - if versiongrp.group(2) is not None and versiongrp.group(2) != "": version = versiongrp.group(2) - for i in zw700versions: - if StrictVersion(version) >= StrictVersion('%s' % (i[0])): - if DEBUG: print('System version: %s, Version required: %s or newer' % (version, i[0])) - self.commands = i - break - - if DEBUG: print('Remote server: System: %s, Version: %s' % (systemtype, version)) - - def close(self): - self.sftpsession.close() - self.sshclient.close() - -class TimeoutMonitorThread(threading.Thread): - - def __init__(self, sshsession): - super(TimeoutMonitorThread, self).__init__() - self.sshsession = sshsession - self.timeout = sshsession.getTimeout() - self.starttime = 0 - self.stoptime = 0 - self.status = 'stopped' - - def run(self): - if DEBUG: print('TimeoutMonitor started') - self.starttime = time.time() - self.timeouttime = self.starttime + self.timeout - currentTime = time.time() - while currentTime < self.timeouttime: - time.sleep(0.2) - currentTime = time.time() - - self.stoptime = time.time() - if self.timeouttime and (currentTime >= self.timeouttime ): - if DEBUG: print('Timeout reached') - self.status = 'expired' - else: - if DEBUG: print('TimeoutMonitor stopped') - self.status = 'stopped' - self.sshsession.endTest() - - def resettimer(self): - currentTime = time.time() - self.timeouttime = currentTime + self.timeout - - def status(self): - return self.status - - def timeElapsed(self): - return self.stoptime - self.starttime - - def exit(self): - self.timeouttime = 0 - -class RemoteTestConsoleThread(threading.Thread): - - def __init__(self, sshsession, host, port): - super(RemoteTestConsoleThread, self).__init__() - self.sshsession = sshsession - self.host = host - self.port = port - - def run(self): - self.running = 50 - receive_buffer = '' - timeoutThread = TimeoutMonitorThread(self.sshsession) - timeoutThread.start() - while self.running: - try: - self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.socket.connect((self.host, self.port)) - if DEBUG: print('Connected %s:%d' % (self.host, self.port)) - while self.running: - try: - if not self.running: break - new_data = self.socket.recv(1024) - if not new_data: break - timeoutThread.resettimer() - receive_buffer += new_data - - retval = re.search(r"\x04", new_data) - if retval: - if DEBUG: print('Test completed') - self.running = 0 - timeoutThread.exit() - self.sshsession.endTest() - - except IOError as e: - if DEBUG: print('Connection has been closed / 2') - self.running = 0 - - self.socket.close() - except IOError as e: - if DEBUG: print('Connection closed / 1') - if self.running: self.running -= 1 - if self.running: - time.sleep(0.2) - console_output = receive_buffer.splitlines() - - # make sure timeout thread is stopped and joined - timeoutThread.exit() - timeoutThread.join() - - if timeoutThread.status == 'expired': - summary = '%i Tests 1 Failures 0 Ignored' % ((len(console_output)+1), ) - console_output.append(':9999:Unknown:FAIL: Timeout') - console_output.append('-----------------------') - console_output.append(summary) - console_output.append('FAIL') - totaltime = timeoutThread.timeElapsed() - self.sshsession.setTestResult(console_output, totaltime) - - def exit(self): - if self.running == 1: - self.running = 0 - try: - eof_message = b'' - self.socket.shutdown(socket.SHUT_RDWR) - self.socket.sendto(eof_message, (self.host, self.port)) - except IOError as e: - if DEBUG: print('Connection exit / 4') - self.socket.close() - -def usage(): - print('Usage') - print('') - print(' remote_execution.py [options]') - print('') - print('Options') - print(' -h, --help = Print this help text.') - print(' -V, --verbose = Enable verbose output') - print(' -r, --remote-target = Remote target for test execution (Currently only SSH targets are supported)') - print(' can be dns name or ip of remote system') - print(' -u, --user = Username when accessing remote test system (only for SSH targets), default=developer') - print(' -p, --password = Password for user specified by \'-u\' or \'--user\' (only for SSH targets), , default=1234') - print(' -f, --file = Test file (executable) to upload to remote target') - print(' -t, --timeout = Timeout before terminating a stalled test in seconds, default=10 seconds') - print(' -o, --out = Test report in Xunit xml format') - -def main(argv): - import getopt - opts, args = getopt.getopt(sys.argv[1:], 'hVr:u:p:f:t:o:', ['help', 'verbose', 'remote-target=', 'user=', 'password=', 'file=', 'timeout=', 'out=']) - - remote_target = "" - username = "developer" - password = "1234" - file = "" - timeout = 10 - xml = None - xmlfile = None - - global DEBUG - - for opt, arg in opts: - if opt in ('-h', '--help'): - usage() - sys.exit(0) - elif opt in ('-V', '--verbose'): - DEBUG = True - elif opt in ('-r', '--remote-target'): - remote_target = arg - elif opt in ('-u', '--user'): - username = arg - elif opt in ('-p', '--password'): - password = arg - elif opt in ('-f', '--file'): - file = arg - elif opt in ('-t', '--timeout'): - timeout = int(arg) - elif opt in ('-o', '--out'): - from . import xunit - import xml.etree.ElementTree as ElementTree - xml = xunit.Xunit() - xmlfile = arg - - test_session = RemoteTestSession(remote_target, username, password, timeout=timeout) - testsuitename = os.path.basename(file) - remote_file = 'projects/700series/images/%s' % testsuitename - if DEBUG: print('Uploading: %s' % testsuitename) - test_session.put(file, remote_file) - - test_session.executeTest(remote_file) - if xmlfile is not None: - xml.append(test_session.getTestResultXml(testsuitename)) - ElementTree.ElementTree(xml.getTree()).write(xmlfile, encoding="UTF-8", xml_declaration=True) - if DEBUG: - result = test_session.getTestResult() - for line in result: - print(line) - - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/python/xunit.py b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/python/xunit.py deleted file mode 100644 index 68ac71514..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/python/xunit.py +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright (c) 2018 Silicon Laboratories Inc. -import os -import xml.etree.ElementTree as ElementTree -import re - -class Xunit(): - def __init__(self, testsuite=None): - self.testsuites = ElementTree.Element("testsuites") - self.testsuites.text = '\n' - self.testsuites.tail = '\n' - - if testsuite is not None: - self.testsuites.append(testsuite) - - def append(self, testsuite): - testsuitetree = testsuite.getTree() - self.testsuites.append(testsuitetree) - - def getTree(self): - return self.testsuites - - def tostring(self): - xmlout = '\n' - xmlout += ElementTree.tostring(self.testsuites) - return xmlout - -class TestSuite(): - def __init__(self, name="", hostname=None): - self.testsuite = ElementTree.Element("testsuite") - self.testsuite.set('name', name) - self.testsuite.text = '\n' - self.testsuite.tail = '\n' - if hostname is not None: - self.testsuite.set('hostname', hostname) - - self.testsuite.set('failures', "0") - - self.tests = 0 - self.passed = 0 - self.failures = 0 - self.skipped = 0 - self.time = 0.0 - - def getTree(self): - return self.testsuite - - def append(self, testcase): - sub = ElementTree.SubElement(self.testsuite, "testcase") - sub.set('name', testcase.getName()) - sub.set('time', str(testcase.getTime())) - sub.text = '\n' - sub.tail = '\n' - self.tests += 1 - self.time += testcase.getTime() - if testcase.failed(): - self.failures += 1 - sub = ElementTree.SubElement(sub, "error") - sub.set('message', testcase.getMessage()) - sub.text = testcase.getVerboseMessage() - sub.tail = '\n' - - if testcase.skipped(): - self.skipped += 1 - sub = ElementTree.SubElement(sub, "skipped") - sub.text = '\n' - sub.tail = '\n' - self.testsuite.set('tests', str(self.tests)) - self.testsuite.set('errors', str(self.failures)) - self.testsuite.set('skipped', str(self.skipped)) - self.testsuite.set('time', str(self.time)) - - def setTime(self, time): - self.time = time - self.testsuite.set('time', str(self.time)) - - def fromUnity(self, report, name="", time=None, hostname=None): - self.testsuite.set('name', name) - self.testsuite.text = '\n' - self.testsuite.tail = '\n' - - for line in report: - passed = re.match(r":[0-9]*:(.*):PASS.*", line) - failed = re.match(r":[0-9]*:(.*):FAIL:(.*)", line) - ignore = re.match(r":[0-9]*:(.*):IGNORE:(.*)", line) - if passed: - testcase = TestCase(passed.group(1)) - self.append(testcase) - elif failed: - testcase = TestCase(failed.group(1), error=True) - testcase.setMessage(failed.group(2)) - self.append(testcase) - elif ignore: - testcase = TestCase(ignore.group(1), ignore=True) - testcase.setMessage(ignore.group(2)) - self.append(testcase) - - self.testsuite.set('tests', str(self.tests)) - self.testsuite.set('errors', str(self.failures)) - self.testsuite.set('skipped', str(self.skipped)) - self.testsuite.set('time', str(self.time)) - if time is not None: - self.testsuite.set('time', str(time)) - if hostname is not None: - self.testsuite.set('hostname', hostname) - return self - - def fromCtest(self, report, hostname=None): - testsuites = [] - - current = '1' - next = '2' - testsuiterep = [] - time = 0.0 - for line in report: - found = re.match(r"[ \t]*[0-9]*/[0-9]* Test[ \t]*#[0-9]*:.*([0-9]*\.[0-9]*)[ \t]*sec.*", line) - if found: - time = float(found.group(1)) - - found = re.match(r""+current+": (.*)", line) - if found: - testsuiterep.append(found.group(1)) - - found = re.match(r""+next+": (.*)", line) - if found: - testsuitename = os.path.basename(re.sub(r"^Test[ \t]*command:[ \t]*(.*)[\r|\n]+$", "\\1", testsuiterep[0])) - testsuite = TestSuite().fromUnity(testsuiterep, name=testsuitename, hostname=hostname, time=time) - testsuites.append(testsuite) - - current = str(int(current) + 1) - next = str(int(next) + 1) - time = 0.0 - testsuiterep = [] - testsuiterep.append(found.group(1)) - - testsuitename = os.path.basename(re.sub(r"^Test[ \t]*command:[ \t]*(.*)[\r|\n]+$", "\\1", testsuiterep[0])) - testsuite = TestSuite().fromUnity(testsuiterep, name=testsuitename, hostname=hostname, time=time) - testsuites.append(testsuite) - return testsuites - -class TestCase(): - def __init__(self, name="", error=False, ignore=False, time=0.0): - self.name = name - self.time = time - self.error = error - self.ignore = ignore - self.message = '' - self.vmessage = '' - - def failed(self): - return self.error - - def skipped(self): - return self.ignore - - def getName(self): - return self.name - - def getTime(self): - return self.time - - def getMessage(self): - return self.message - - def getVerboseMessage(self): - return self.vmessage - - def setMessage(self, message): - self.message = message - - def setVerboseMessage(self, message): - self.vmessage = message diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/CMakeLists.txt deleted file mode 100644 index 306ed3d6b..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ - -CROSS_SYSTEM_DIR("." "" CROSS_SYSTEM_DIR) - -SET(SOURCES - unity.c - ${CROSS_SYSTEM_DIR}/unity_print.c -) - -# unity target may be imported be several projects, e.g. 700 series and libs2 simultaneously. -# This test ensures that the target named 'unity' will only be declared if it is not already declared. -if (NOT TARGET unity) - add_library(unity ${SOURCES} ) - target_compile_definitions(unity PUBLIC "-DUNITY_EXCLUDE_FLOAT -DUNITY_OUTPUT_CHAR=ZW_putchar") - target_include_directories(unity PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -endif (NOT TARGET unity) - diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/asip/unity_print.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/asip/unity_print.c deleted file mode 100644 index 33380b1ca..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/asip/unity_print.c +++ /dev/null @@ -1,44 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ - -#include "../unity_print.h" -#include - -#define ASIP_THREEPORT_ThreadAnd (0x8020) - -/*extern uint8_t * gUnityMessageBuffer; -extern uint16_t gUnityMessageBufferSize;*/ - - -uint8_t p [1024]; - -uint8_t * gUnityMessageBuffer = p; -uint16_t gUnityMessageBufferSize = sizeof(p); -/*void longjmp() { - while(1); -} -int setjmp() -{ - return 0; -} -*/ -static uint16_t mMessageBufferIndex; - -void unity_print_init(void) -{ - gUnityMessageBuffer[gUnityMessageBufferSize-1] = 0; -} - -int ZW_putchar(int c) -{ - if (c != 0 && (mMessageBufferIndex < gUnityMessageBufferSize)) - gUnityMessageBuffer[mMessageBufferIndex++] = c; - return 0; -} - -void unity_print_close(void) -{ - *((int *)ASIP_THREEPORT_ThreadAnd) = 0x00000000; - while(1); -} - diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/colour_prompt.rb b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/colour_prompt.rb deleted file mode 100644 index 8adab6e61..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/colour_prompt.rb +++ /dev/null @@ -1,115 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -if RUBY_PLATFORM =~/(win|w)32$/ - begin - require 'Win32API' - rescue LoadError - puts "ERROR! \"Win32API\" library not found" - puts "\"Win32API\" is required for colour on a windows machine" - puts " try => \"gem install Win32API\" on the command line" - puts - end - # puts - # puts 'Windows Environment Detected...' - # puts 'Win32API Library Found.' - # puts -end - -class ColourCommandLine - def initialize - if RUBY_PLATFORM =~/(win|w)32$/ - get_std_handle = Win32API.new("kernel32", "GetStdHandle", ['L'], 'L') - @set_console_txt_attrb = - Win32API.new("kernel32","SetConsoleTextAttribute",['L','N'], 'I') - @hout = get_std_handle.call(-11) - end - end - - def change_to(new_colour) - if RUBY_PLATFORM =~/(win|w)32$/ - @set_console_txt_attrb.call(@hout,self.win32_colour(new_colour)) - else - "\033[30;#{posix_colour(new_colour)};22m" - end - end - - def win32_colour(colour) - case colour - when :black then 0 - when :dark_blue then 1 - when :dark_green then 2 - when :dark_cyan then 3 - when :dark_red then 4 - when :dark_purple then 5 - when :dark_yellow, :narrative then 6 - when :default_white, :default, :dark_white then 7 - when :silver then 8 - when :blue then 9 - when :green, :success then 10 - when :cyan, :output then 11 - when :red, :failure then 12 - when :purple then 13 - when :yellow then 14 - when :white then 15 - else - 0 - end - end - - def posix_colour(colour) - # ANSI Escape Codes - Foreground colors - # | Code | Color | - # | 39 | Default foreground color | - # | 30 | Black | - # | 31 | Red | - # | 32 | Green | - # | 33 | Yellow | - # | 34 | Blue | - # | 35 | Magenta | - # | 36 | Cyan | - # | 37 | Light gray | - # | 90 | Dark gray | - # | 91 | Light red | - # | 92 | Light green | - # | 93 | Light yellow | - # | 94 | Light blue | - # | 95 | Light magenta | - # | 96 | Light cyan | - # | 97 | White | - - case colour - when :black then 30 - when :red, :failure then 31 - when :green, :success then 32 - when :yellow then 33 - when :blue, :narrative then 34 - when :purple, :magenta then 35 - when :cyan, :output then 36 - when :white, :default_white then 37 - when :default then 39 - else - 39 - end - end - - def out_c(mode, colour, str) - case RUBY_PLATFORM - when /(win|w)32$/ - change_to(colour) - $stdout.puts str if mode == :puts - $stdout.print str if mode == :print - change_to(:default_white) - else - $stdout.puts("#{change_to(colour)}#{str}\033[0m") if mode == :puts - $stdout.print("#{change_to(colour)}#{str}\033[0m") if mode == :print - end - end -end # ColourCommandLine - -def colour_puts(role,str) ColourCommandLine.new.out_c(:puts, role, str) end -def colour_print(role,str) ColourCommandLine.new.out_c(:print, role, str) end - diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/colour_reporter.rb b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/colour_reporter.rb deleted file mode 100644 index 89e79519c..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/colour_reporter.rb +++ /dev/null @@ -1,39 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -require "#{File.expand_path(File.dirname(__FILE__))}/colour_prompt" - -$colour_output = true - -def report(message) - if not $colour_output - $stdout.puts(message) - else - message = message.join('\n') if (message.class == Array) - message.each_line do |line| - line.chomp! - colour = case(line) - when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i - ($1.to_i == 0) ? :green : :red - when /PASS/ - :green - when /^OK$/ - :green - when /(?:FAIL|ERROR)/ - :red - when /IGNORE/ - :yellow - when /^(?:Creating|Compiling|Linking)/ - :white - else - :silver - end - colour_puts(colour, line) - end - end - $stdout.flush - $stderr.flush -end \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/generate_config.yml b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/generate_config.yml deleted file mode 100644 index ce66cead5..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/generate_config.yml +++ /dev/null @@ -1,36 +0,0 @@ -#this is a sample configuration file for generate_module -#you would use it by calling generate_module with the -ygenerate_config.yml option -#files like this are useful for customizing generate_module to your environment -:generate_module: - :defaults: - #these defaults are used in place of any missing options at the command line - :path_src: ../src/ - :path_inc: ../src/ - :path_tst: ../test/ - :update_svn: true - :includes: - #use [] for no additional includes, otherwise list the includes on separate lines - :src: - - Defs.h - - Board.h - :inc: [] - :tst: - - Defs.h - - Board.h - - Exception.h - :boilerplates: - #these are inserted at the top of generated files. - #just comment out or remove if not desired. - #use %1$s where you would like the file name to appear (path/extension not included) - :src: | - //------------------------------------------- - // %1$s.c - //------------------------------------------- - :inc: | - //------------------------------------------- - // %1$s.h - //------------------------------------------- - :tst: | - //------------------------------------------- - // Test%1$s.c : Units tests for %1$s.c - //------------------------------------------- diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/generate_module.rb b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/generate_module.rb deleted file mode 100644 index 4a020ebbf..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/generate_module.rb +++ /dev/null @@ -1,202 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -# This script creates all the files with start code necessary for a new module. -# A simple module only requires a source file, header file, and test file. -# Triad modules require a source, header, and test file for each triad type (like model, conductor, and hardware). - -require 'rubygems' -require 'fileutils' - -HERE = File.expand_path(File.dirname(__FILE__)) + '/' - -#help text when requested -HELP_TEXT = [ "\nGENERATE MODULE\n-------- ------", - "\nUsage: ruby generate_module [options] module_name", - " -i\"include\" sets the path to output headers to 'include' (DEFAULT ../src)", - " -s\"../src\" sets the path to output source to '../src' (DEFAULT ../src)", - " -t\"C:/test\" sets the path to output source to 'C:/test' (DEFAULT ../test)", - " -p\"MCH\" sets the output pattern to MCH.", - " dh - driver hardware.", - " dih - driver interrupt hardware.", - " mch - model conductor hardware.", - " mvp - model view presenter.", - " src - just a single source module. (DEFAULT)", - " -d destroy module instead of creating it.", - " -u update subversion too (requires subversion command line)", - " -y\"my.yml\" selects a different yaml config file for module generation", - "" ].join("\n") - -#Built in patterns -PATTERNS = { 'src' => {'' => { :inc => [] } }, - 'dh' => {'Driver' => { :inc => ['%1$sHardware.h'] }, - 'Hardware' => { :inc => [] } - }, - 'dih' => {'Driver' => { :inc => ['%1$sHardware.h', '%1$sInterrupt.h'] }, - 'Interrupt'=> { :inc => ['%1$sHardware.h'] }, - 'Hardware' => { :inc => [] } - }, - 'mch' => {'Model' => { :inc => [] }, - 'Conductor'=> { :inc => ['%1$sModel.h', '%1$sHardware.h'] }, - 'Hardware' => { :inc => [] } - }, - 'mvp' => {'Model' => { :inc => [] }, - 'Presenter'=> { :inc => ['%1$sModel.h', '%1$sView.h'] }, - 'View' => { :inc => [] } - } - } - -#TEMPLATE_TST -TEMPLATE_TST = %q[#include "unity.h" -%2$s#include "%1$s.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void test_%1$s_NeedToImplement(void) -{ - TEST_IGNORE(); -} -] - -#TEMPLATE_SRC -TEMPLATE_SRC = %q[%2$s#include "%1$s.h" -] - -#TEMPLATE_INC -TEMPLATE_INC = %q[#ifndef _%3$s_H -#define _%3$s_H%2$s - -#endif // _%3$s_H -] - -# Parse the command line parameters. -ARGV.each do |arg| - case(arg) - when /^-d/ then @destroy = true - when /^-u/ then @update_svn = true - when /^-p(\w+)/ then @pattern = $1 - when /^-s(.+)/ then @path_src = $1 - when /^-i(.+)/ then @path_inc = $1 - when /^-t(.+)/ then @path_tst = $1 - when /^-y(.+)/ then @yaml_config = $1 - when /^(\w+)/ - raise "ERROR: You can't have more than one Module name specified!" unless @module_name.nil? - @module_name = arg - when /^-(h|-help)/ - puts HELP_TEXT - exit - else - raise "ERROR: Unknown option specified '#{arg}'" - end -end -raise "ERROR: You must have a Module name specified! (use option -h for help)" if @module_name.nil? - -#load yaml file if one was requested -if @yaml_config - require 'yaml' - cfg = YAML.load_file(HERE + @yaml_config)[:generate_module] - @path_src = cfg[:defaults][:path_src] if @path_src.nil? - @path_inc = cfg[:defaults][:path_inc] if @path_inc.nil? - @path_tst = cfg[:defaults][:path_tst] if @path_tst.nil? - @update_svn = cfg[:defaults][:update_svn] if @update_svn.nil? - @extra_inc = cfg[:includes] - @boilerplates = cfg[:boilerplates] -else - @boilerplates = {} -end - -# Create default file paths if none were provided -@path_src = HERE + "../src/" if @path_src.nil? -@path_inc = @path_src if @path_inc.nil? -@path_tst = HERE + "../test/" if @path_tst.nil? -@path_src += '/' unless (@path_src[-1] == 47) -@path_inc += '/' unless (@path_inc[-1] == 47) -@path_tst += '/' unless (@path_tst[-1] == 47) -@pattern = 'src' if @pattern.nil? -@includes = { :src => [], :inc => [], :tst => [] } -@includes.merge!(@extra_inc) unless @extra_inc.nil? - -#create triad definition -TRIAD = [ { :ext => '.c', :path => @path_src, :template => TEMPLATE_SRC, :inc => :src, :boilerplate => @boilerplates[:src] }, - { :ext => '.h', :path => @path_inc, :template => TEMPLATE_INC, :inc => :inc, :boilerplate => @boilerplates[:inc] }, - { :ext => '.c', :path => @path_tst+'Test', :template => TEMPLATE_TST, :inc => :tst, :boilerplate => @boilerplates[:tst] }, - ] - -#prepare the pattern for use -@patterns = PATTERNS[@pattern.downcase] -raise "ERROR: The design pattern specified isn't one that I recognize!" if @patterns.nil? - -# Assemble the path/names of the files we need to work with. -files = [] -TRIAD.each do |triad| - @patterns.each_pair do |pattern_file, pattern_traits| - files << { - :path => "#{triad[:path]}#{@module_name}#{pattern_file}#{triad[:ext]}", - :name => "#{@module_name}#{pattern_file}", - :template => triad[:template], - :boilerplate => triad[:boilerplate], - :includes => case(triad[:inc]) - when :src then @includes[:src] | pattern_traits[:inc].map{|f| f % [@module_name]} - when :inc then @includes[:inc] - when :tst then @includes[:tst] | pattern_traits[:inc].map{|f| "Mock#{f}"% [@module_name]} - end - } - end -end - -# destroy files if that was what was requested -if @destroy - files.each do |filespec| - file = filespec[:path] - if File.exist?(file) - if @update_svn - `svn delete \"#{file}\" --force` - puts "File #{file} deleted and removed from source control" - else - FileUtils.remove(file) - puts "File #{file} deleted" - end - else - puts "File #{file} does not exist so cannot be removed." - end - end - puts "Destroy Complete" - exit -end - -#Abort if any module already exists -files.each do |file| - raise "ERROR: File #{file[:name]} already exists. Exiting." if File.exist?(file[:path]) -end - -# Create Source Modules -files.each_with_index do |file, i| - File.open(file[:path], 'w') do |f| - f.write(file[:boilerplate] % [file[:name]]) unless file[:boilerplate].nil? - f.write(file[:template] % [ file[:name], - file[:includes].map{|f| "#include \"#{f}\"\n"}.join, - file[:name].upcase ] - ) - end - if (@update_svn) - `svn add \"#{file[:path]}\"` - if $?.exitstatus == 0 - puts "File #{file[:path]} created and added to source control" - else - puts "File #{file[:path]} created but FAILED adding to source control!" - end - else - puts "File #{file[:path]} created" - end -end - -puts 'Generate Complete' diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/generate_test_runner.rb b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/generate_test_runner.rb deleted file mode 100644 index e29a9be95..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/generate_test_runner.rb +++ /dev/null @@ -1,374 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -$QUICK_RUBY_VERSION = RUBY_VERSION.split('.').inject(0){|vv,v| vv * 100 + v.to_i } -File.expand_path(File.join(File.dirname(__FILE__),'colour_prompt')) - -class UnityTestRunnerGenerator - - def initialize(options = nil) - @options = UnityTestRunnerGenerator.default_options - case(options) - when NilClass then @options - when String then @options.merge!(UnityTestRunnerGenerator.grab_config(options)) - when Hash then @options.merge!(options) - else raise "If you specify arguments, it should be a filename or a hash of options" - end - require "#{File.expand_path(File.dirname(__FILE__))}/type_sanitizer" - end - - def self.default_options - { - :includes => [], - :plugins => [], - :framework => :unity, - :test_prefix => "test|spec|should", - :setup_name => "setUp", - :teardown_name => "tearDown", - } - end - - def self.grab_config(config_file) - options = self.default_options - unless (config_file.nil? or config_file.empty?) - require 'yaml' - yaml_guts = YAML.load_file(config_file) - options.merge!(yaml_guts[:unity] || yaml_guts[:cmock]) - raise "No :unity or :cmock section found in #{config_file}" unless options - end - return(options) - end - - def run(input_file, output_file, options=nil) - tests = [] - testfile_includes = [] - used_mocks = [] - - @options.merge!(options) unless options.nil? - module_name = File.basename(input_file) - - #pull required data from source file - source = File.read(input_file) - source = source.force_encoding("ISO-8859-1").encode("utf-8", :replace => nil) if ($QUICK_RUBY_VERSION > 10900) - tests = find_tests(source) - headers = find_includes(source) - testfile_includes = (headers[:local] + headers[:system]) - used_mocks = find_mocks(testfile_includes) - testfile_includes = (testfile_includes - used_mocks) - testfile_includes.delete_if{|inc| inc =~ /(unity|cmock)/} - - #build runner file - generate(input_file, output_file, tests, used_mocks, testfile_includes) - - #determine which files were used to return them - all_files_used = [input_file, output_file] - all_files_used += testfile_includes.map {|filename| filename + '.c'} unless testfile_includes.empty? - all_files_used += @options[:includes] unless @options[:includes].empty? - return all_files_used.uniq - end - - def generate(input_file, output_file, tests, used_mocks, testfile_includes) - File.open(output_file, 'w') do |output| - create_header(output, used_mocks, testfile_includes) - create_externs(output, tests, used_mocks) - create_mock_management(output, used_mocks) - create_suite_setup_and_teardown(output) - create_reset(output, used_mocks) - create_main(output, input_file, tests, used_mocks) - end - - if (@options[:header_file] && !@options[:header_file].empty?) - File.open(@options[:header_file], 'w') do |output| - create_h_file(output, @options[:header_file], tests, testfile_includes) - end - end - end - - def find_tests(source) - tests_and_line_numbers = [] - - source_scrubbed = source.gsub(/\/\/.*$/, '') # remove line comments - source_scrubbed = source_scrubbed.gsub(/\/\*.*?\*\//m, '') # remove block comments - lines = source_scrubbed.split(/(^\s*\#.*$) # Treat preprocessor directives as a logical line - | (;|\{|\}) /x) # Match ;, {, and } as end of lines - - lines.each_with_index do |line, index| - #find tests - if line =~ /^((?:\s*TEST_CASE\s*\(.*?\)\s*)*)\s*void\s+((?:#{@options[:test_prefix]}).*)\s*\(\s*(.*)\s*\)/ - arguments = $1 - name = $2 - call = $3 - params = $4 - args = nil - if (@options[:use_param_tests] and !arguments.empty?) - args = [] - arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) {|a| args << a[0]} - end - tests_and_line_numbers << { :test => name, :args => args, :call => call, :params => params, :line_number => 0 } - end - end - tests_and_line_numbers.uniq! {|v| v[:test] } - - #determine line numbers and create tests to run - source_lines = source.split("\n") - source_index = 0; - tests_and_line_numbers.size.times do |i| - source_lines[source_index..-1].each_with_index do |line, index| - if (line =~ /#{tests_and_line_numbers[i][:test]}/) - source_index += index - tests_and_line_numbers[i][:line_number] = source_index + 1 - break - end - end - end - - return tests_and_line_numbers - end - - def find_includes(source) - - #remove comments (block and line, in three steps to ensure correct precedence) - source.gsub!(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks - source.gsub!(/\/\*.*?\*\//m, '') # remove block comments - source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain) - - #parse out includes - includes = { - :local => source.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/).flatten, - :system => source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" } - } - return includes - end - - def find_mocks(includes) - mock_headers = [] - includes.each do |include_file| - mock_headers << File.basename(include_file) if (include_file =~ /^mock/i) - end - return mock_headers - end - - def create_header(output, mocks, testfile_includes=[]) - output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') - create_runtest(output, mocks) - output.puts("\n//=======Automagically Detected Files To Include=====") - output.puts("#include \"#{@options[:framework].to_s}.h\"") - output.puts('#include "cmock.h"') unless (mocks.empty?) - output.puts('#include ') - output.puts('#include ') - output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception) - if (@options[:header_file] && !@options[:header_file].empty?) - output.puts("#include \"#{File.basename(@options[:header_file])}\"") - else - @options[:includes].flatten.uniq.compact.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}") - end - testfile_includes.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}") - end - end - mocks.each do |mock| - output.puts("#include \"#{mock.gsub('.h','')}.h\"") - end - if @options[:enforce_strict_ordering] - output.puts('') - output.puts('int GlobalExpectCount;') - output.puts('int GlobalVerifyOrder;') - output.puts('char* GlobalOrderError;') - end - end - - def create_externs(output, tests, mocks) - output.puts("\n//=======External Functions This Runner Calls=====") - output.puts("extern void #{@options[:setup_name]}(void);") - output.puts("extern void #{@options[:teardown_name]}(void);") - tests.each do |test| - output.puts("extern void #{test[:test]}(#{test[:call] || 'void'});") - end - output.puts('') - end - - def create_mock_management(output, mocks) - unless (mocks.empty?) - output.puts("\n//=======Mock Management=====") - output.puts("static void CMock_Init(void)") - output.puts("{") - if @options[:enforce_strict_ordering] - output.puts(" GlobalExpectCount = 0;") - output.puts(" GlobalVerifyOrder = 0;") - output.puts(" GlobalOrderError = NULL;") - end - mocks.each do |mock| - mock_clean = TypeSanitizer.sanitize_c_identifier(mock) - output.puts(" #{mock_clean}_Init();") - end - output.puts("}\n") - - output.puts("static void CMock_Verify(void)") - output.puts("{") - mocks.each do |mock| - mock_clean = TypeSanitizer.sanitize_c_identifier(mock) - output.puts(" #{mock_clean}_Verify();") - end - output.puts("}\n") - - output.puts("static void CMock_Destroy(void)") - output.puts("{") - mocks.each do |mock| - mock_clean = TypeSanitizer.sanitize_c_identifier(mock) - output.puts(" #{mock_clean}_Destroy();") - end - output.puts("}\n") - end - end - - def create_suite_setup_and_teardown(output) - unless (@options[:suite_setup].nil?) - output.puts("\n//=======Suite Setup=====") - output.puts("static int suite_setup(void)") - output.puts("{") - output.puts(@options[:suite_setup]) - output.puts("}") - end - unless (@options[:suite_teardown].nil?) - output.puts("\n//=======Suite Teardown=====") - output.puts("static int suite_teardown(int num_failures)") - output.puts("{") - output.puts(@options[:suite_teardown]) - output.puts("}") - end - end - - def create_runtest(output, used_mocks) - cexception = @options[:plugins].include? :cexception - va_args1 = @options[:use_param_tests] ? ', ...' : '' - va_args2 = @options[:use_param_tests] ? '__VA_ARGS__' : '' - output.puts("\n//=======Test Runner Used To Run Each Test Below=====") - output.puts("#define RUN_TEST_NO_ARGS") if @options[:use_param_tests] - output.puts("#define RUN_TEST(TestFunc, TestLineNum#{va_args1}) \\") - output.puts("{ \\") - output.puts(" Unity.CurrentTestName = #TestFunc#{va_args2.empty? ? '' : " \"(\" ##{va_args2} \")\""}; \\") - output.puts(" Unity.CurrentTestLineNumber = TestLineNum; \\") - output.puts(" Unity.NumberOfTests++; \\") - output.puts(" CMock_Init(); \\") unless (used_mocks.empty?) - output.puts(" if (TEST_PROTECT()) \\") - output.puts(" { \\") - output.puts(" CEXCEPTION_T e; \\") if cexception - output.puts(" Try { \\") if cexception - output.puts(" #{@options[:setup_name]}(); \\") - output.puts(" TestFunc(#{va_args2}); \\") - output.puts(" } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, \"Unhandled Exception!\"); } \\") if cexception - output.puts(" } \\") - output.puts(" if (TEST_PROTECT() && !TEST_IS_IGNORED) \\") - output.puts(" { \\") - output.puts(" #{@options[:teardown_name]}(); \\") - output.puts(" CMock_Verify(); \\") unless (used_mocks.empty?) - output.puts(" } \\") - output.puts(" CMock_Destroy(); \\") unless (used_mocks.empty?) - output.puts(" UnityConcludeTest(); \\") - output.puts("}\n") - end - - def create_reset(output, used_mocks) - output.puts("\n//=======Test Reset Option=====") - output.puts("void resetTest(void);") - output.puts("void resetTest(void)") - output.puts("{") - output.puts(" CMock_Verify();") unless (used_mocks.empty?) - output.puts(" CMock_Destroy();") unless (used_mocks.empty?) - output.puts(" #{@options[:teardown_name]}();") - output.puts(" CMock_Init();") unless (used_mocks.empty?) - output.puts(" #{@options[:setup_name]}();") - output.puts("}") - end - - def create_main(output, filename, tests, used_mocks) - output.puts("\n\n//=======MAIN=====") - output.puts("int main(void)") - output.puts("{") - output.puts(" suite_setup();") unless @options[:suite_setup].nil? - output.puts(" UnityBegin(\"#{filename}\");") - if (@options[:use_param_tests]) - tests.each do |test| - if ((test[:args].nil?) or (test[:args].empty?)) - output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]}, RUN_TEST_NO_ARGS);") - else - test[:args].each {|args| output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]}, #{args});")} - end - end - else - tests.each { |test| output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]});") } - end - output.puts() - output.puts(" CMock_Guts_MemFreeFinal();") unless used_mocks.empty? - output.puts(" return #{@options[:suite_teardown].nil? ? "" : "suite_teardown"}(UnityEnd());") - output.puts("}") - end - - def create_h_file(output, filename, tests, testfile_includes) - filename = filename.upcase.gsub(/(?:\/|\\|\.)*/,'_') - output.puts("/* AUTOGENERATED FILE. DO NOT EDIT. */") - output.puts("#ifndef _#{filename}") - output.puts("#define _#{filename}\n\n") - @options[:includes].flatten.uniq.compact.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}") - end - testfile_includes.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}") - end - output.puts "\n" - tests.each {|test| output.puts("void #{test[:test]}(#{test[:params]});") } - output.puts("#endif\n\n") - end -end - -if ($0 == __FILE__) - options = { :includes => [] } - yaml_file = nil - - #parse out all the options first (these will all be removed as we go) - ARGV.reject! do |arg| - case(arg) - when '-cexception' - options[:plugins] = [:cexception]; true - when /\.*\.ya?ml/ - options = UnityTestRunnerGenerator.grab_config(arg); true - when /\.*\.h/ - options[:includes] << arg; true - when /--(\w+)=\"?(.*)\"?/ - options[$1.to_sym] = $2; true - else false - end - end - - #make sure there is at least one parameter left (the input file) - if !ARGV[0] - puts ["\nusage: ruby #{__FILE__} (files) (options) input_test_file (output)", - "\n input_test_file - this is the C file you want to create a runner for", - " output - this is the name of the runner file to generate", - " defaults to (input_test_file)_Runner", - " files:", - " *.yml / *.yaml - loads configuration from here in :unity or :cmock", - " *.h - header files are added as #includes in runner", - " options:", - " -cexception - include cexception support", - " --setup_name=\"\" - redefine setUp func name to something else", - " --teardown_name=\"\" - redefine tearDown func name to something else", - " --test_prefix=\"\" - redefine test prefix from default test|spec|should", - " --suite_setup=\"\" - code to execute for setup of entire suite", - " --suite_teardown=\"\" - code to execute for teardown of entire suite", - " --use_param_tests=1 - enable parameterized tests (disabled by default)", - " --header_file=\"\" - path/name of test header file to generate too" - ].join("\n") - exit 1 - end - - #create the default test runner name if not specified - ARGV[1] = ARGV[0].gsub(".c","_Runner.c") if (!ARGV[1]) - - - UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1]) -end diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/parseOutput.rb b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/parseOutput.rb deleted file mode 100644 index 7ea180f4c..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/parseOutput.rb +++ /dev/null @@ -1,191 +0,0 @@ -#============================================================ -# Author: John Theofanopoulos -# A simple parser. Takes the output files generated during the build process and -# extracts information relating to the tests. -# -# Notes: -# To capture an output file under VS builds use the following: -# devenv [build instructions] > Output.txt & type Output.txt -# -# To capture an output file under GCC/Linux builds use the following: -# make | tee Output.txt -# -# To use this parser use the following command -# ruby parseOutput.rb [options] [file] -# options: -xml : produce a JUnit compatible XML file -# file : file to scan for results -#============================================================ - - -class ParseOutput -# The following flag is set to true when a test is found or false otherwise. - @testFlag - @xmlOut - @arrayList - @totalTests - @classIndex - -# Set the flag to indicate if there will be an XML output file or not - def setXmlOutput() - @xmlOut = true - end - -# if write our output to XML - def writeXmlOuput() - output = File.open("report.xml", "w") - output << "\n" - @arrayList.each do |item| - output << item << "\n" - end - output << "\n" - end - -# This function will try and determine when the suite is changed. This is -# is the name that gets added to the classname parameter. - def testSuiteVerify(testSuiteName) - if @testFlag == false - @testFlag = true; - # Split the path name - testName = testSuiteName.split("/") - # Remove the extension - baseName = testName[testName.size - 1].split(".") - @testSuite = "test." + baseName[0] - printf "New Test: %s\n", @testSuite - end - end - - -# Test was flagged as having passed so format the output - def testPassed(array) - lastItem = array.length - 1 - testName = array[lastItem - 1] - testSuiteVerify(array[@className]) - printf "%-40s PASS\n", testName - if @xmlOut == true - @arrayList.push " " - end - end - -# Test was flagged as being ingored so format the output - def testIgnored(array) - lastItem = array.length - 1 - testName = array[lastItem - 2] - reason = array[lastItem].chomp - testSuiteVerify(array[@className]) - printf "%-40s IGNORED\n", testName - if @xmlOut == true - @arrayList.push " " - @arrayList.push " " + reason + " " - @arrayList.push " " - end - end - -# Test was flagged as having failed so format the line - def testFailed(array) - lastItem = array.length - 1 - testName = array[lastItem - 2] - reason = array[lastItem].chomp + " at line: " + array[lastItem - 3] - testSuiteVerify(array[@className]) - printf "%-40s FAILED\n", testName - if @xmlOut == true - @arrayList.push " " - @arrayList.push " " + reason + " " - @arrayList.push " " - end - end - - -# Figure out what OS we are running on. For now we are assuming if it's not Windows it must -# be Unix based. - def detectOS() - myOS = RUBY_PLATFORM.split("-") - if myOS.size == 2 - if myOS[1] == "mingw32" - @className = 1 - else - @className = 0 - end - else - @className = 0 - end - - end - -# Main function used to parse the file that was captured. - def process(name) - @testFlag = false - @arrayList = Array.new - - detectOS() - - puts "Parsing file: " + name - - - testPass = 0 - testFail = 0 - testIgnore = 0 - puts "" - puts "=================== RESULTS =====================" - puts "" - File.open(name).each do |line| - # Typical test lines look like this: - # /.c:36:test_tc1000_opsys:FAIL: Expected 1 Was 0 - # /.c:112:test_tc5004_initCanChannel:IGNORE: Not Yet Implemented - # /.c:115:test_tc5100_initCanVoidPtrs:PASS - # - # where path is different on Unix vs Windows devices (Windows leads with a drive letter) - lineArray = line.split(":") - lineSize = lineArray.size - # If we were able to split the line then we can look to see if any of our target words - # were found. Case is important. - if lineSize >= 4 - # Determine if this test passed - if line.include? ":PASS" - testPassed(lineArray) - testPass += 1 - elsif line.include? ":FAIL:" - testFailed(lineArray) - testFail += 1 - elsif line.include? ":IGNORE:" - testIgnored(lineArray) - testIgnore += 1 - # If none of the keywords are found there are no more tests for this suite so clear - # the test flag - else - @testFlag = false - end - else - @testFlag = false - end - end - puts "" - puts "=================== SUMMARY =====================" - puts "" - puts "Tests Passed : " + testPass.to_s - puts "Tests Failed : " + testFail.to_s - puts "Tests Ignored : " + testIgnore.to_s - @totalTests = testPass + testFail + testIgnore - if @xmlOut == true - heading = "" - @arrayList.insert(0, heading) - writeXmlOuput() - end - - # return result - end - - end - -# If the command line has no values in, used a default value of Output.txt -parseMyFile = ParseOutput.new - -if ARGV.size >= 1 - ARGV.each do |a| - if a == "-xml" - parseMyFile.setXmlOutput(); - else - parseMyFile.process(a) - break - end - end -end diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/test_file_filter.rb b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/test_file_filter.rb deleted file mode 100644 index 3dbc26a28..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/test_file_filter.rb +++ /dev/null @@ -1,23 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -require'yaml' - -module RakefileHelpers - class TestFileFilter - def initialize(all_files = false) - @all_files = all_files - if not @all_files == true - if File.exist?('test_file_filter.yml') - filters = YAML.load_file( 'test_file_filter.yml' ) - @all_files, @only_files, @exclude_files = - filters[:all_files], filters[:only_files], filters[:exclude_files] - end - end - end - attr_accessor :all_files, :only_files, :exclude_files - end -end diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/type_sanitizer.rb b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/type_sanitizer.rb deleted file mode 100644 index 7c2c0ac2c..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/type_sanitizer.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TypeSanitizer - - def self.sanitize_c_identifier(unsanitized) - # convert filename to valid C identifier by replacing invalid chars with '_' - return unsanitized.gsub(/[-\/\\\.\,\s]/, "_") - end - -end diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/unity_test_summary.py b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/unity_test_summary.py deleted file mode 100644 index f25fe31a4..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/unity_test_summary.py +++ /dev/null @@ -1,135 +0,0 @@ -#! python3 -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de -# [Released under MIT License. Please refer to license.txt for details] -# Based on the ruby script by Mike Karlesky, Mark VanderVoord, Greg Williams -# ========================================== -import sys -import os -import re -from glob import glob - -class UnityTestSummary: - def __init__(self): - self.report = '' - self.total_tests = 0 - self.failures = 0 - self.ignored = 0 - - def run(self): - # Clean up result file names - results = [] - for target in self.targets: - results.append(target.replace('\\', '/')) - - # Dig through each result file, looking for details on pass/fail: - failure_output = [] - ignore_output = [] - - for result_file in results: - lines = list([line.rstrip() for line in open(result_file, "r").read().split('\n')]) - if len(lines) == 0: - raise Exception("Empty test result file: %s" % result_file) - - details = self.get_details(result_file, lines) - failures = details['failures'] - ignores = details['ignores'] - if len(failures) > 0: failure_output.append('\n'.join(failures)) - if len(ignores) > 0: ignore_output.append('n'.join(ignores)) - tests,failures,ignored = self.parse_test_summary('\n'.join(lines)) - self.total_tests += tests - self.failures += failures - self.ignored += ignored - - if self.ignored > 0: - self.report += "\n" - self.report += "--------------------------\n" - self.report += "UNITY IGNORED TEST SUMMARY\n" - self.report += "--------------------------\n" - self.report += "\n".join(ignore_output) - - if self.failures > 0: - self.report += "\n" - self.report += "--------------------------\n" - self.report += "UNITY FAILED TEST SUMMARY\n" - self.report += "--------------------------\n" - self.report += '\n'.join(failure_output) - - self.report += "\n" - self.report += "--------------------------\n" - self.report += "OVERALL UNITY TEST SUMMARY\n" - self.report += "--------------------------\n" - self.report += "{total_tests} TOTAL TESTS {failures} TOTAL FAILURES {ignored} IGNORED\n".format(total_tests = self.total_tests, failures=self.failures, ignored=self.ignored) - self.report += "\n" - - return self.report - - def set_targets(self, target_array): - self.targets = target_array - - def set_root_path(self, path): - self.root = path - - def usage(self, err_msg=None): - print("\nERROR: ") - if err_msg: - print(err_msg) - print("\nUsage: unity_test_summary.py result_file_directory/ root_path/") - print(" result_file_directory - The location of your results files.") - print(" Defaults to current directory if not specified.") - print(" Should end in / if specified.") - print(" root_path - Helpful for producing more verbose output if using relative paths.") - sys.exit(1) - - def get_details(self, result_file, lines): - results = { 'failures': [], 'ignores': [], 'successes': [] } - for line in lines: - parts = line.split(':') - if len(parts) != 5: - continue - src_file,src_line,test_name,status,msg = parts - if len(self.root) > 0: - line_out = "%s%s" % (self.root, line) - else: - line_out = line - if status == 'IGNORE': - results['ignores'].append(line_out) - elif status == 'FAIL': - results['failures'].append(line_out) - elif status == 'PASS': - results['successes'].append(line_out) - return results - - def parse_test_summary(self, summary): - m = re.search(r"([0-9]+) Tests ([0-9]+) Failures ([0-9]+) Ignored", summary) - if not m: - raise Exception("Couldn't parse test results: %s" % summary) - - return int(m.group(1)), int(m.group(2)), int(m.group(3)) - - -if __name__ == '__main__': - uts = UnityTestSummary() - try: - #look in the specified or current directory for result files - if len(sys.argv) > 1: - targets_dir = sys.argv[1] - else: - targets_dir = './' - targets = list([x.replace('\\', '/') for x in glob(targets_dir + '*.test*')]) - if len(targets) == 0: - raise Exception("No *.testpass or *.testfail files found in '%s'" % targets_dir) - uts.set_targets(targets) - - #set the root path - if len(sys.argv) > 2: - root_path = sys.argv[2] - else: - root_path = os.path.split(__file__)[0] - uts.set_root_path(root_path) - - #run the summarizer - print((uts.run())) - except Exception as e: - uts.usage(e) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/unity_test_summary.rb b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/unity_test_summary.rb deleted file mode 100644 index 39e309420..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/auto/unity_test_summary.rb +++ /dev/null @@ -1,148 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -#!/usr/bin/ruby -# -# unity_test_summary.rb -# -require 'fileutils' -require 'set' - -class UnityTestSummary - include FileUtils::Verbose - - attr_reader :report, :total_tests, :failures, :ignored - - def initialize(opts = {}) - @report = '' - @total_tests = 0 - @failures = 0 - @ignored = 0 - - - end - - def run - # Clean up result file names - results = @targets.map {|target| target.gsub(/\\/,'/')} - - # Dig through each result file, looking for details on pass/fail: - failure_output = [] - ignore_output = [] - - results.each do |result_file| - lines = File.readlines(result_file).map { |line| line.chomp } - if lines.length == 0 - raise "Empty test result file: #{result_file}" - else - output = get_details(result_file, lines) - failure_output << output[:failures] unless output[:failures].empty? - ignore_output << output[:ignores] unless output[:ignores].empty? - tests,failures,ignored = parse_test_summary(lines) - @total_tests += tests - @failures += failures - @ignored += ignored - end - end - - if @ignored > 0 - @report += "\n" - @report += "--------------------------\n" - @report += "UNITY IGNORED TEST SUMMARY\n" - @report += "--------------------------\n" - @report += ignore_output.flatten.join("\n") - end - - if @failures > 0 - @report += "\n" - @report += "--------------------------\n" - @report += "UNITY FAILED TEST SUMMARY\n" - @report += "--------------------------\n" - @report += failure_output.flatten.join("\n") - end - - @report += "\n" - @report += "--------------------------\n" - @report += "OVERALL UNITY TEST SUMMARY\n" - @report += "--------------------------\n" - @report += "#{@total_tests} TOTAL TESTS #{@failures} TOTAL FAILURES #{@ignored} IGNORED\n" - @report += "\n" - end - - def set_targets(target_array) - @targets = target_array - end - - def set_root_path(path) - @root = path - end - - def usage(err_msg=nil) - puts "\nERROR: " - puts err_msg if err_msg - puts "\nUsage: unity_test_summary.rb result_file_directory/ root_path/" - puts " result_file_directory - The location of your results files." - puts " Defaults to current directory if not specified." - puts " Should end in / if specified." - puts " root_path - Helpful for producing more verbose output if using relative paths." - exit 1 - end - - protected - - def get_details(result_file, lines) - results = { :failures => [], :ignores => [], :successes => [] } - lines.each do |line| - src_file,src_line,test_name,status,msg = line.split(/:/) - line_out = ((@root && (@root != 0)) ? "#{@root}#{line}" : line ).gsub(/\//, "\\") - case(status) - when 'IGNORE' then results[:ignores] << line_out - when 'FAIL' then results[:failures] << line_out - when 'PASS' then results[:successes] << line_out - end - end - return results - end - - def parse_test_summary(summary) - if summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ } - [$1.to_i,$2.to_i,$3.to_i] - else - raise "Couldn't parse test results: #{summary}" - end - end - - def here; File.expand_path(File.dirname(__FILE__)); end - -end - -if $0 == __FILE__ - - #parse out the command options - opts, args = ARGV.partition {|v| v =~ /^--\w+/} - opts.map! {|v| v[2..-1].to_sym } - - #create an instance to work with - uts = UnityTestSummary.new(opts) - - begin - #look in the specified or current directory for result files - args[0] ||= './' - targets = "#{ARGV[0].gsub(/\\/, '/')}**/*.test*" - results = Dir[targets] - raise "No *.testpass, *.testfail, or *.testresults files found in '#{targets}'" if results.empty? - uts.set_targets(results) - - #set the root path - args[1] ||= Dir.pwd + '/' - uts.set_root_path(ARGV[1]) - - #run the summarizer - puts uts.run - rescue Exception => e - uts.usage e.message - end -end diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/c51/unity_print.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/c51/unity_print.c deleted file mode 100644 index 93afdbcb8..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/c51/unity_print.c +++ /dev/null @@ -1,97 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ - -#include "../unity_print.h" -#include -#include "reg51.h" - -sfr SFRPAGE = 0xFF; -sfr UART0BRL = 0xAF; -sfr UARTCON = 0xEC; -sfr UARTSTAT = 0xED; -sfr UART0BUF = 0xEF; - -sfr WDTCON = 0xE4; - -#define WDTCON_PAGE SFRPAGE=0x02 -#define WATCHDOG_DISABLE {WDTCON_PAGE; WDTCON = WDTCON_NOTIFY_BIT; WDTCON = 0;} -#define WDTCON_NOTIFY_BIT 0x04 - -#define UARTCON_PAGE -#define UARTSTAT_PAGE -#define UART0BUF_PAGE /* ANY */ -#define UART0BRL_PAGE SFRPAGE=0x02 -#define UART0BRL_BRL0_BITS 0xFF - -#define UARTCON_CTX1_BIT 0x80 -#define UARTCON_REN1_BIT 0x40 -#define UARTCON_CTX0_BIT 0x08 -#define UARTCON_REN0_BIT 0x04 -#define UARTCON_BRH0_BITS 0x03 - -#define UARTSTAT_TA0_BIT 0x01 - -sfr RSETVEC = 0xE6; -#define RSETVEC_PORTKEEP_BIT 0x40 -#define RSETVEC_PAGE SFRPAGE=0x02 - -#define SFR_AND(r,v) {r##_PAGE;r=(r&v);} -#define SFR_SET(r,v) {r##_PAGE;r=v;} -#define SFR_OR(r,v) {r##_PAGE;r=(r|v);} - -#define OPEN_IOS {SFR_AND(RSETVEC,~RSETVEC_PORTKEEP_BIT);} - -#define UART0_SET_BAUD_RATE(BAUD_TIMER) {SFR_AND(UARTCON, ~UARTCON_BRH0_BITS);\ - SFR_OR(UARTCON,((BAUD_TIMER & 0x0300) >> 8));\ - SFR_SET(UART0BRL, (BAUD_TIMER & (0x00FF)));\ - } -#define UART0_TX_WRITE_BUFFER(TX_DATA) {SFR_SET(UART0BUF, TX_DATA);} -#define UART0_TX_ENABLE {SFR_OR(UARTCON, UARTCON_CTX0_BIT);} -#define UART0_TX_ACTIVE_GET (UARTSTAT & UARTSTAT_TA0_BIT) - - -void unity_print_init(void) -{ -#if 1 - SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */ - TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */ - TH1 = 0xf3; /* TH1: reload value for 2400 baud */ - TR1 = 1; /* TR1: timer 1 run */ - TI = 1; /* TI: set TI to send first char of UART */ -#else - int bBaudRate; - WATCHDOG_DISABLE; - bBaudRate = 1152; - bBaudRate = (80000/bBaudRate ) + (((80000 %bBaudRate ) >= (bBaudRate >> 1)) ? 1:0); - UART0_SET_BAUD_RATE(68); - UART0_TX_ENABLE; - - OPEN_IOS - UART0BUF = '*'; -#endif - -} - -#if 0 -char -putchar( - char c) /* IN a byte to write to the UART transmit register.*/ -{ - while(UART0_TX_ACTIVE_GET); - UART0_TX_WRITE_BUFFER(c); - return c; -} -#endif - -void unity_print_close(void) -{ - // Do nothing. -} - -int ZW_putchar(int c) -{ - while(UART0_TX_ACTIVE_GET); - UART0_TX_WRITE_BUFFER(c); - return c; -} - diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/generic/unity_print.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/generic/unity_print.c deleted file mode 100644 index d7f312ac3..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/generic/unity_print.c +++ /dev/null @@ -1,27 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ - -#include "../unity_print.h" -#include -#include - - -void unity_print_init(void) -{ - // Do nothing. On i386 output is automatically sent to stdout. - // Disable all print buffering. This ensures output is written to stdout as early as possible - // and minimizes risk of lost print messages if program seg faults. - setvbuf(stdout, NULL, _IONBF, 0); - setvbuf(stderr, NULL, _IONBF, 0); -} - -void unity_print_close(void) -{ - // Do nothing. On i386 output is automatically sent to stdout. -} - -int ZW_putchar(int c) -{ - return putchar(c); -} - diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/license.txt b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/license.txt deleted file mode 100644 index d0f635fa3..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/license.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams - -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. diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity.c deleted file mode 100644 index ebe6fd5e6..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity.c +++ /dev/null @@ -1,1323 +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] -============================================================================ */ - -#include "unity.h" - -#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); } -#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); } -/// return prematurely if we are already in failure or ignore state -#define UNITY_SKIP_EXECUTION { if ((Unity.CurrentTestFailed != 0) || (Unity.CurrentTestIgnored != 0)) {return;} } -#define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\n'); } - -struct _Unity Unity; - -const char UnityStrOk[] = "OK"; -const char UnityStrPass[] = " "; -const char UnityStrFail[] = " "; -const char UnityStrIgnore[] = "IGNORE"; -const char UnityStrNull[] = "NULL"; -const char UnityStrSpacer[] = ". "; -const char UnityStrExpected[] = " Expected "; -const char UnityStrWas[] = " Was "; -const char UnityStrTo[] = " To "; -const char UnityStrElement[] = " Element "; -const char UnityStrByte[] = " Byte "; -const char UnityStrMemory[] = " Memory Mismatch."; -const char UnityStrDelta[] = " Values Not Within Delta "; -const char UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless."; -const char UnityStrNullPointerForExpected[] = " Expected pointer to be NULL"; -const char UnityStrNullPointerForActual[] = " Actual pointer was NULL"; -const char UnityStrNot[] = "Not "; -const char UnityStrInf[] = "Infinity"; -const char UnityStrNegInf[] = "Negative Infinity"; -const char UnityStrNaN[] = "NaN"; -const char UnityStrDet[] = "Determinate"; -const char UnityStrErrFloat[] = "Unity Floating Point Disabled"; -const char UnityStrErrDouble[] = "Unity Double Precision Disabled"; -const char UnityStrErr64[] = "Unity 64-bit Support Disabled"; -const char UnityStrBreaker[] = "-----------------------"; -const char UnityStrResultsTests[] = " Tests "; -const char UnityStrResultsFailures[] = " Failures "; -const char UnityStrResultsIgnored[] = " Ignored "; - -#ifndef UNITY_EXCLUDE_FLOAT -// Dividing by these constants produces +/- infinity. -// The rationale is given in UnityAssertFloatIsInf's body. -static const _UF f_zero = 0.0f; -#ifndef UNITY_EXCLUDE_DOUBLE -static const _UD d_zero = 0.0; -#endif -#endif - -// compiler-generic print formatting masks -const _U_UINT UnitySizeMask[] = -{ - 255u, // 0xFF - 65535u, // 0xFFFF - 65535u, - 4294967295u, // 0xFFFFFFFF - 4294967295u, - 4294967295u, - 4294967295u -#ifdef UNITY_SUPPORT_64 - ,0xFFFFFFFFFFFFFFFF -#endif -}; - -void UnityPrintFail(void); -void UnityPrintOk(void); - -//----------------------------------------------- -// Pretty Printers & Test Result Output Handlers -//----------------------------------------------- - -void UnityPrint(const char* string) -{ - const char* pch = string; - - if (pch != NULL) - { - while (*pch) - { - // printable characters plus CR & LF are printed - if ((*pch <= 126) && (*pch >= 32)) - { - UNITY_OUTPUT_CHAR(*pch); - } - //write escaped carriage returns - else if (*pch == 13) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('r'); - } - //write escaped line feeds - else if (*pch == 10) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('n'); - } - // unprintable characters are shown as codes - else - { - UNITY_OUTPUT_CHAR('\\'); - UnityPrintNumberHex((_U_UINT)*pch, 2); - } - pch++; - } - } -} - -void UnityPrintLen(const char* string, const _UU32 length); -void UnityPrintLen(const char* string, const _UU32 length) -{ - const char* pch = string; - - if (pch != NULL) - { - while (*pch && (pch - string) < length) - { - // printable characters plus CR & LF are printed - if ((*pch <= 126) && (*pch >= 32)) - { - UNITY_OUTPUT_CHAR(*pch); - } - //write escaped carriage returns - else if (*pch == 13) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('r'); - } - //write escaped line feeds - else if (*pch == 10) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('n'); - } - // unprintable characters are shown as codes - else - { - UNITY_OUTPUT_CHAR('\\'); - UnityPrintNumberHex((_U_UINT)*pch, 2); - } - pch++; - } - } -} - -//----------------------------------------------- -void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T style) -{ - if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) - { - UnityPrintNumber(number); - } - else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) - { - UnityPrintNumberUnsigned( (_U_UINT)number & UnitySizeMask[((_U_UINT)style & (_U_UINT)0x0F) - 1] ); - } - else - { - UnityPrintNumberHex((_U_UINT)number, (char)((style & 0x000F) << 1)); - } -} - -//----------------------------------------------- -/// basically do an itoa using as little ram as possible -void UnityPrintNumber(const _U_SINT number_to_print) -{ -#ifdef __codasip__ - _U_UINT nibbles = 0; - _U_UINT tmp; - tmp = number_to_print; - do - { - tmp >>= 4; - nibbles++; - } - while (tmp > 0); - UnityPrintNumberHex(number_to_print , nibbles); -#else - _U_SINT divisor = 1; - _U_SINT next_divisor; - _U_UINT number; - if (number_to_print == (1l << (UNITY_LONG_WIDTH-1))) - { - //The largest representable negative number - UNITY_OUTPUT_CHAR('-'); - number = (1ul << (UNITY_LONG_WIDTH-1)); - } - else if (number_to_print < 0) - { - //Some other negative number - UNITY_OUTPUT_CHAR('-'); - number = (_U_UINT)(-number_to_print); - } - else - { - //Positive number - number = (_U_UINT)number_to_print; - } - - // figure out initial divisor - while (number / divisor > 9) - { - next_divisor = divisor * 10; - if (next_divisor > divisor) - divisor = next_divisor; - else - break; - } - - // now mod and print, then divide divisor - do - { - UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10))); - divisor /= 10; - } - while (divisor > 0); -#endif /* __codasip__ */ -} - -//----------------------------------------------- -/// basically do an itoa using as little ram as possible -void UnityPrintNumberUnsigned(const _U_UINT number) -{ -#ifdef __codasip__ - _U_UINT nibbles = 0; - _U_UINT tmp; - tmp = number; - do - { - tmp = tmp >> 4; - nibbles++; - } - while (tmp > 0); - UnityPrintNumberHex(number, nibbles); -#else - _U_UINT divisor = 1; - _U_UINT next_divisor; - // figure out initial divisor - while (number / divisor > 9) - { - next_divisor = divisor * 10; - if (next_divisor > divisor) - divisor = next_divisor; - else - break; - } - - // now mod and print, then divide divisor - do - { - UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10))); - divisor /= 10; - } - while (divisor > 0); -#endif /* __codasip__ */ -} - -//----------------------------------------------- -void UnityPrintNumberHex(const _U_UINT number, const char nibbles_to_print) -{ - _U_UINT nibble; - char nibbles = nibbles_to_print; - UNITY_OUTPUT_CHAR('0'); - UNITY_OUTPUT_CHAR('x'); - - while (nibbles > 0) - { - nibble = (number >> (--nibbles << 2)) & 0x0000000F; - if (nibble <= 9) - { - UNITY_OUTPUT_CHAR((char)('0' + nibble)); - } - else - { - UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble)); - } - } -} - -//----------------------------------------------- -void UnityPrintMask(const _U_UINT mask, const _U_UINT number) -{ - _U_UINT current_bit = (_U_UINT)1 << (UNITY_INT_WIDTH - 1); - _US32 i; - - for (i = 0; i < UNITY_INT_WIDTH; i++) - { - if (current_bit & mask) - { - if (current_bit & number) - { - UNITY_OUTPUT_CHAR('1'); - } - else - { - UNITY_OUTPUT_CHAR('0'); - } - } - else - { - UNITY_OUTPUT_CHAR('X'); - } - current_bit = current_bit >> 1; - } -} - -//----------------------------------------------- -#ifdef UNITY_FLOAT_VERBOSE -#include -void UnityPrintFloat(_UF number) -{ - char TempBuffer[32]; - sprintf(TempBuffer, "%.6f", number); - UnityPrint(TempBuffer); -} -#endif - -//----------------------------------------------- - -void UnityPrintFail(void); -void UnityPrintFail(void) -{ - UnityPrint(UnityStrFail); -} - -void UnityPrintOk(void); -void UnityPrintOk(void) -{ - UnityPrint(UnityStrOk); -} - -//----------------------------------------------- -static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line); -static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line) -{ -#ifndef UNITY_FIXTURES - UnityPrint(file); - UNITY_OUTPUT_CHAR(':'); - UnityPrintNumber((_U_SINT)line); - UNITY_OUTPUT_CHAR(':'); - UnityPrint(Unity.CurrentTestName); - UNITY_OUTPUT_CHAR(':'); -#else - UNITY_UNUSED(file); - UNITY_UNUSED(line); -#endif -} - -//----------------------------------------------- -static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line); -static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line) -{ -#ifndef UNITY_FIXTURES - UnityTestResultsBegin(Unity.TestFile, line); -#else - UNITY_UNUSED(line); -#endif - UnityPrint(UnityStrFail); - UNITY_OUTPUT_CHAR(':'); -} - -//----------------------------------------------- -void UnityConcludeTest(void) -{ - if (Unity.CurrentTestIgnored) - { - Unity.TestIgnores++; - } - else if (!Unity.CurrentTestFailed) - { - UnityTestResultsBegin(Unity.TestFile, Unity.CurrentTestLineNumber); - UnityPrint(UnityStrPass); - } - else - { - Unity.TestFailures++; - } - - Unity.CurrentTestFailed = 0; - Unity.CurrentTestIgnored = 0; - UNITY_PRINT_EOL; -} - -//----------------------------------------------- -static void UnityAddMsgIfSpecified(const char* msg); -static void UnityAddMsgIfSpecified(const char* msg) -{ - if (msg) - { - UnityPrint(UnityStrSpacer); - UnityPrint(msg); - } -} - -//----------------------------------------------- -static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual); -static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual) -{ - UnityPrint(UnityStrExpected); - if (expected != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrint(expected); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } - UnityPrint(UnityStrWas); - if (actual != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrint(actual); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } -} - -//----------------------------------------------- -static void UnityPrintExpectedAndActualStringsLen(const char* expected, const char* actual, const _UU32 length) -{ - UnityPrint(UnityStrExpected); - if (expected != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrintLen(expected, length); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } - UnityPrint(UnityStrWas); - if (actual != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrintLen(actual, length); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } -} - - - -//----------------------------------------------- -// Assertion & Control Helpers -//----------------------------------------------- - -static int UnityCheckArraysForNull(UNITY_PTR_ATTRIBUTE const void* expected, UNITY_PTR_ATTRIBUTE const void* actual, const UNITY_LINE_TYPE lineNumber, const char* msg) -{ - //return true if they are both NULL - if ((expected == NULL) && (actual == NULL)) - return 1; - - //throw error if just expected is NULL - if (expected == NULL) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrNullPointerForExpected); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - //throw error if just actual is NULL - if (actual == NULL) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrNullPointerForActual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - //return false if neither is NULL - return 0; -} - -//----------------------------------------------- -// Assertion Functions -//----------------------------------------------- - -void UnityAssertBits(const _U_SINT mask, - const _U_SINT expected, - const _U_SINT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - UNITY_SKIP_EXECUTION; - - if ((mask & expected) != (mask & actual)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - UnityPrintMask((_U_UINT)mask, (_U_UINT)expected); - UnityPrint(UnityStrWas); - UnityPrintMask((_U_UINT)mask, (_U_UINT)actual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- -void UnityAssertEqualNumber(const _U_SINT expected, - const _U_SINT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style) -{ - UNITY_SKIP_EXECUTION; - - if (expected != actual) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expected, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- -void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected, - UNITY_PTR_ATTRIBUTE const void* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style) -{ - _UU32 elements = num_elements; - UNITY_PTR_ATTRIBUTE const void* ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)expected; - UNITY_PTR_ATTRIBUTE const void* ptr_act = (UNITY_PTR_ATTRIBUTE const void*)actual; - - UNITY_SKIP_EXECUTION; - - if (elements == 0) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrPointless); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE const void*)expected, (UNITY_PTR_ATTRIBUTE const void*)actual, lineNumber, msg) == 1) - return; - - // If style is UNITY_DISPLAY_STYLE_INT, we'll fall into the default case rather than the INT16 or INT32 (etc) case - // as UNITY_DISPLAY_STYLE_INT includes a flag for UNITY_DISPLAY_RANGE_AUTO, which the width-specific - // variants do not. Therefore remove this flag. - switch(style & (UNITY_DISPLAY_STYLE_T)(~UNITY_DISPLAY_RANGE_AUTO)) - { - case UNITY_DISPLAY_STYLE_HEX8: - case UNITY_DISPLAY_STYLE_INT8: - case UNITY_DISPLAY_STYLE_UINT8: - while (elements--) - { - if (*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US8*)ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_exp, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_act, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 1); - ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 1); - } - break; - case UNITY_DISPLAY_STYLE_HEX16: - case UNITY_DISPLAY_STYLE_INT16: - case UNITY_DISPLAY_STYLE_UINT16: - while (elements--) - { - if (*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US16*)ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_exp, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_act, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 2); - ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 2); - } - break; -#ifdef UNITY_SUPPORT_64 - case UNITY_DISPLAY_STYLE_HEX64: - case UNITY_DISPLAY_STYLE_INT64: - case UNITY_DISPLAY_STYLE_UINT64: - while (elements--) - { - if (*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US64*)ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_exp, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_act, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 8); - ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 8); - } - break; -#endif - default: - while (elements--) - { - if (*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US32*)ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_exp, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_act, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 4); - ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 4); - } - break; - } -} - -//----------------------------------------------- -#ifndef UNITY_EXCLUDE_FLOAT -void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected, - UNITY_PTR_ATTRIBUTE const _UF* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UU32 elements = num_elements; - UNITY_PTR_ATTRIBUTE const _UF* ptr_expected = expected; - UNITY_PTR_ATTRIBUTE const _UF* ptr_actual = actual; - _UF diff, tol; - - UNITY_SKIP_EXECUTION; - - if (elements == 0) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrPointless); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE const void*)expected, (UNITY_PTR_ATTRIBUTE const void*)actual, lineNumber, msg) == 1) - return; - - while (elements--) - { - diff = *ptr_expected - *ptr_actual; - if (diff < 0.0f) - diff = 0.0f - diff; - tol = UNITY_FLOAT_PRECISION * *ptr_expected; - if (tol < 0.0f) - tol = 0.0f - tol; - - //This first part of this condition will catch any NaN or Infinite values - if ((diff * 0.0f != 0.0f) || (diff > tol)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); -#ifdef UNITY_FLOAT_VERBOSE - UnityPrint(UnityStrExpected); - UnityPrintFloat(*ptr_expected); - UnityPrint(UnityStrWas); - UnityPrintFloat(*ptr_actual); -#else - UnityPrint(UnityStrDelta); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_expected++; - ptr_actual++; - } -} - -//----------------------------------------------- -void UnityAssertFloatsWithin(const _UF delta, - const _UF expected, - const _UF actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UF diff = actual - expected; - _UF pos_delta = delta; - - UNITY_SKIP_EXECUTION; - - if (diff < 0.0f) - { - diff = 0.0f - diff; - } - if (pos_delta < 0.0f) - { - pos_delta = 0.0f - pos_delta; - } - - //This first part of this condition will catch any NaN or Infinite values - if ((diff * 0.0f != 0.0f) || (pos_delta < diff)) - { - UnityTestResultsFailBegin(lineNumber); -#ifdef UNITY_FLOAT_VERBOSE - UnityPrint(UnityStrExpected); - UnityPrintFloat(expected); - UnityPrint(UnityStrWas); - UnityPrintFloat(actual); -#else - UnityPrint(UnityStrDelta); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- -void UnityAssertFloatSpecial(const _UF actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style) -{ - const char* trait_names[] = { UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet }; - _U_SINT should_be_trait = ((_U_SINT)style & 1); - _U_SINT is_trait = !should_be_trait; - _U_SINT trait_index = style >> 1; - - UNITY_SKIP_EXECUTION; - - switch(style) - { - //To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly - //We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise - case UNITY_FLOAT_IS_INF: - case UNITY_FLOAT_IS_NOT_INF: - is_trait = ((1.0f / f_zero) == actual) ? 1 : 0; - break; - case UNITY_FLOAT_IS_NEG_INF: - case UNITY_FLOAT_IS_NOT_NEG_INF: - is_trait = ((-1.0f / f_zero) == actual) ? 1 : 0; - break; - - //NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN. - case UNITY_FLOAT_IS_NAN: - case UNITY_FLOAT_IS_NOT_NAN: - is_trait = (actual == actual) ? 0 : 1; - break; - - //A determinate number is non infinite and not NaN. (therefore the opposite of the two above) - case UNITY_FLOAT_IS_DET: - case UNITY_FLOAT_IS_NOT_DET: - if ( (actual != actual) || ((1.0f / f_zero) == actual) || ((-1.0f / f_zero) == actual) ) - is_trait = 0; - else - is_trait = 1; - break; - default: - ; - } - - if (is_trait != should_be_trait) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - if (!should_be_trait) - UnityPrint(UnityStrNot); - UnityPrint(trait_names[trait_index]); - UnityPrint(UnityStrWas); -#ifdef UNITY_FLOAT_VERBOSE - UnityPrintFloat(actual); -#else - if (should_be_trait) - UnityPrint(UnityStrNot); - UnityPrint(trait_names[trait_index]); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -#endif //not UNITY_EXCLUDE_FLOAT - -//----------------------------------------------- -#ifndef UNITY_EXCLUDE_DOUBLE -void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected, - UNITY_PTR_ATTRIBUTE const _UD* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UU32 elements = num_elements; - UNITY_PTR_ATTRIBUTE const _UD* ptr_expected = expected; - UNITY_PTR_ATTRIBUTE const _UD* ptr_actual = actual; - _UD diff, tol; - - UNITY_SKIP_EXECUTION; - - if (elements == 0) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrPointless); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1) - return; - - while (elements--) - { - diff = *ptr_expected - *ptr_actual; - if (diff < 0.0) - diff = 0.0 - diff; - tol = UNITY_DOUBLE_PRECISION * *ptr_expected; - if (tol < 0.0) - tol = 0.0 - tol; - - //This first part of this condition will catch any NaN or Infinite values - if ((diff * 0.0 != 0.0) || (diff > tol)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); -#ifdef UNITY_DOUBLE_VERBOSE - UnityPrint(UnityStrExpected); - UnityPrintFloat((float)(*ptr_expected)); - UnityPrint(UnityStrWas); - UnityPrintFloat((float)(*ptr_actual)); -#else - UnityPrint(UnityStrDelta); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_expected++; - ptr_actual++; - } -} - -//----------------------------------------------- -void UnityAssertDoublesWithin(const _UD delta, - const _UD expected, - const _UD actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UD diff = actual - expected; - _UD pos_delta = delta; - - UNITY_SKIP_EXECUTION; - - if (diff < 0.0) - { - diff = 0.0 - diff; - } - if (pos_delta < 0.0) - { - pos_delta = 0.0 - pos_delta; - } - - //This first part of this condition will catch any NaN or Infinite values - if ((diff * 0.0 != 0.0) || (pos_delta < diff)) - { - UnityTestResultsFailBegin(lineNumber); -#ifdef UNITY_DOUBLE_VERBOSE - UnityPrint(UnityStrExpected); - UnityPrintFloat((float)expected); - UnityPrint(UnityStrWas); - UnityPrintFloat((float)actual); -#else - UnityPrint(UnityStrDelta); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- - -void UnityAssertDoubleSpecial(const _UD actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style) -{ - const char* trait_names[] = { UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet }; - _U_SINT should_be_trait = ((_U_SINT)style & 1); - _U_SINT is_trait = !should_be_trait; - _U_SINT trait_index = style >> 1; - - UNITY_SKIP_EXECUTION; - - switch(style) - { - //To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly - //We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise - case UNITY_FLOAT_IS_INF: - case UNITY_FLOAT_IS_NOT_INF: - is_trait = ((1.0 / d_zero) == actual) ? 1 : 0; - break; - case UNITY_FLOAT_IS_NEG_INF: - case UNITY_FLOAT_IS_NOT_NEG_INF: - is_trait = ((-1.0 / d_zero) == actual) ? 1 : 0; - break; - - //NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN. - case UNITY_FLOAT_IS_NAN: - case UNITY_FLOAT_IS_NOT_NAN: - is_trait = (actual == actual) ? 0 : 1; - break; - - //A determinate number is non infinite and not NaN. (therefore the opposite of the two above) - case UNITY_FLOAT_IS_DET: - case UNITY_FLOAT_IS_NOT_DET: - if ( (actual != actual) || ((1.0 / d_zero) == actual) || ((-1.0 / d_zero) == actual) ) - is_trait = 0; - else - is_trait = 1; - break; - default: - ; - } - - if (is_trait != should_be_trait) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - if (!should_be_trait) - UnityPrint(UnityStrNot); - UnityPrint(trait_names[trait_index]); - UnityPrint(UnityStrWas); -#ifdef UNITY_DOUBLE_VERBOSE - UnityPrintFloat(actual); -#else - if (should_be_trait) - UnityPrint(UnityStrNot); - UnityPrint(trait_names[trait_index]); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - - -#endif // not UNITY_EXCLUDE_DOUBLE - -//----------------------------------------------- -void UnityAssertNumbersWithin( const _U_SINT delta, - const _U_SINT expected, - const _U_SINT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style) -{ - UNITY_SKIP_EXECUTION; - - if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) - { - if (actual > expected) - Unity.CurrentTestFailed = ((actual - expected) > delta); - else - Unity.CurrentTestFailed = ((expected - actual) > delta); - } - else - { - if ((_U_UINT)actual > (_U_UINT)expected) - Unity.CurrentTestFailed = ((_U_UINT)(actual - expected) > (_U_UINT)delta); - else - Unity.CurrentTestFailed = ((_U_UINT)(expected - actual) > (_U_UINT)delta); - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrDelta); - UnityPrintNumberByStyle(delta, style); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expected, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- -void UnityAssertEqualString(const char* expected, - const char* actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UU32 i; - - UNITY_SKIP_EXECUTION; - - // if both pointers not null compare the strings - if (expected && actual) - { - for (i = 0; expected[i] || actual[i]; i++) - { - if (expected[i] != actual[i]) - { - Unity.CurrentTestFailed = 1; - break; - } - } - } - else - { // handle case of one pointers being null (if both null, test should pass) - if (expected != actual) - { - Unity.CurrentTestFailed = 1; - } - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrintExpectedAndActualStrings(expected, actual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- -void UnityAssertEqualStringLen(const char* expected, - const char* actual, - const _UU32 length, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UU32 i; - - UNITY_SKIP_EXECUTION; - - // if both pointers not null compare the strings - if (expected && actual) - { - for (i = 0; (expected[i] || actual[i]) && i < length; i++) - { - if (expected[i] != actual[i]) - { - Unity.CurrentTestFailed = 1; - break; - } - } - } - else - { // handle case of one pointers being null (if both null, test should pass) - if (expected != actual) - { - Unity.CurrentTestFailed = 1; - } - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrintExpectedAndActualStringsLen(expected, actual, length); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - - -//----------------------------------------------- -void UnityAssertEqualStringArray( const char** expected, - const char** actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UU32 i, j = 0; - - UNITY_SKIP_EXECUTION; - - // if no elements, it's an error - if (num_elements == 0) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrPointless); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1) - return; - - do - { - // if both pointers not null compare the strings - if (expected[j] && actual[j]) - { - for (i = 0; expected[j][i] || actual[j][i]; i++) - { - if (expected[j][i] != actual[j][i]) - { - Unity.CurrentTestFailed = 1; - break; - } - } - } - else - { // handle case of one pointers being null (if both null, test should pass) - if (expected[j] != actual[j]) - { - Unity.CurrentTestFailed = 1; - } - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - if (num_elements > 1) - { - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((j), UNITY_DISPLAY_STYLE_UINT); - } - UnityPrintExpectedAndActualStrings((const char*)(expected[j]), (const char*)(actual[j])); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - } while (++j < num_elements); -} - -//----------------------------------------------- -void UnityAssertEqualMemory( UNITY_PTR_ATTRIBUTE const void* expected, - UNITY_PTR_ATTRIBUTE const void* actual, - const _UU32 length, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - UNITY_PTR_ATTRIBUTE const unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; - UNITY_PTR_ATTRIBUTE const unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE const unsigned char*)actual; - _UU32 elements = num_elements; - _UU32 bytes; - - UNITY_SKIP_EXECUTION; - - if ((elements == 0) || (length == 0)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrPointless); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE const void*)expected, (UNITY_PTR_ATTRIBUTE const void*)actual, lineNumber, msg) == 1) - return; - - while (elements--) - { - ///////////////////////////////////// - bytes = length; - while (bytes--) - { - if (*ptr_exp != *ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrMemory); - if (num_elements > 1) - { - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); - } - UnityPrint(UnityStrByte); - UnityPrintNumberByStyle((length - bytes - 1), UNITY_DISPLAY_STYLE_UINT); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp += 1; - ptr_act += 1; - } - ///////////////////////////////////// - - } -} - -//----------------------------------------------- -// Control Functions -//----------------------------------------------- - -void UnityFail(const char* msg, const UNITY_LINE_TYPE line) -{ - UNITY_SKIP_EXECUTION; - - UnityTestResultsBegin(Unity.TestFile, line); - UnityPrintFail(); - if (msg != NULL) - { - UNITY_OUTPUT_CHAR(':'); - if (msg[0] != ' ') - { - UNITY_OUTPUT_CHAR(' '); - } - UnityPrint(msg); - } - UNITY_FAIL_AND_BAIL; -} - -//----------------------------------------------- -void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line) -{ - UNITY_SKIP_EXECUTION; - - UnityTestResultsBegin(Unity.TestFile, line); - UnityPrint(UnityStrIgnore); - if (msg != NULL) - { - UNITY_OUTPUT_CHAR(':'); - UNITY_OUTPUT_CHAR(' '); - UnityPrint(msg); - } - UNITY_IGNORE_AND_BAIL; -} - -//----------------------------------------------- -#if defined(UNITY_WEAK_ATTRIBUTE) - void setUp(void); - void tearDown(void); - UNITY_WEAK_ATTRIBUTE void setUp(void) { } - UNITY_WEAK_ATTRIBUTE void tearDown(void) { } -#elif defined(UNITY_WEAK_PRAGMA) -# pragma weak setUp - void setUp(void); -# pragma weak tearDown - void tearDown(void); -#else - void setUp(void); - void tearDown(void); -#endif -//----------------------------------------------- -void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum) -{ - Unity.CurrentTestName = FuncName; - Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum; - Unity.NumberOfTests++; - if (TEST_PROTECT()) - { - setUp(); - Func(); - } - if (TEST_PROTECT() && !(Unity.CurrentTestIgnored)) - { - tearDown(); - } - UnityConcludeTest(); -} - -//----------------------------------------------- -void UnityBegin(const char* filename) -{ - Unity.TestFile = filename; - Unity.CurrentTestName = NULL; - Unity.CurrentTestLineNumber = 0; - Unity.NumberOfTests = 0; - Unity.TestFailures = 0; - Unity.TestIgnores = 0; - Unity.CurrentTestFailed = 0; - Unity.CurrentTestIgnored = 0; - - UNITY_OUTPUT_START(); -} - -//----------------------------------------------- -int UnityEnd(void) -{ - UNITY_PRINT_EOL; - UnityPrint(UnityStrBreaker); - UNITY_PRINT_EOL; - UnityPrintNumber((_U_SINT)(Unity.NumberOfTests)); - UnityPrint(UnityStrResultsTests); - UnityPrintNumber((_U_SINT)(Unity.TestFailures)); - UnityPrint(UnityStrResultsFailures); - UnityPrintNumber((_U_SINT)(Unity.TestIgnores)); - UnityPrint(UnityStrResultsIgnored); - UNITY_PRINT_EOL; - if (Unity.TestFailures == 0U) - { - UnityPrintOk(); - } - else - { - UnityPrintFail(); - } - UNITY_PRINT_EOL; - UNITY_OUTPUT_COMPLETE(); - return (int)(Unity.TestFailures); -} - -//----------------------------------------------- diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity.h deleted file mode 100644 index e883bb587..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity.h +++ /dev/null @@ -1,281 +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" - -//------------------------------------------------------- -// 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 -// - define UNITY_EXCLUDE_SIZEOF to stop attempting to use sizeof in macros -// - If you cannot use the automatic methods above, you can force Unity by using these options: -// - define UNITY_SUPPORT_64 -// - define UNITY_INT_WIDTH -// - UNITY_LONG_WIDTH -// - 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_FLOAT_VERBOSE to print floating point values in errors (uses sprintf) -// - 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_DOUBLE_VERBOSE to print floating point values in errors (uses sprintf) - -// Output -// - by default, Unity prints to standard out with putchar. define UNITY_OUTPUT_CHAR(a) with a different function if desired - -// 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 - -//------------------------------------------------------- -// 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() - -//------------------------------------------------------- -// 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), (_UU32)(-1), (actual), __LINE__, NULL) -#define TEST_ASSERT_BITS_LOW(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (_UU32)(0), (actual), __LINE__, NULL) -#define TEST_ASSERT_BIT_HIGH(bit, actual) UNITY_TEST_ASSERT_BITS(((_UU32)1 << bit), (_UU32)(-1), (actual), __LINE__, NULL) -#define TEST_ASSERT_BIT_LOW(bit, actual) UNITY_TEST_ASSERT_BITS(((_UU32)1 << bit), (_UU32)(0), (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) - -//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_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_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), (_UU32)(-1), (actual), __LINE__, message) -#define TEST_ASSERT_BITS_LOW_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (_UU32)(0), (actual), __LINE__, message) -#define TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((_UU32)1 << bit), (_UU32)(-1), (actual), __LINE__, message) -#define TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((_UU32)1 << bit), (_UU32)(0), (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_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) - -//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_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_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/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity_internals.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity_internals.h deleted file mode 100644 index aa113e3df..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity_internals.h +++ /dev/null @@ -1,707 +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 - -#ifdef UNITY_INCLUDE_CONFIG_H -#include "unity_config.h" -#endif - -#include - -// Unity Attempts to Auto-Detect Integer Types -// Attempt 1: UINT_MAX, ULONG_MAX, etc in -// Attempt 2: UINT_MAX, ULONG_MAX, etc in -// Attempt 3: Deduced from sizeof() macros -#ifndef UNITY_EXCLUDE_STDINT_H -#include -#endif - -#ifndef UNITY_EXCLUDE_LIMITS_H -#include -#endif - -#ifndef UNITY_EXCLUDE_SIZEOF -#ifndef UINT_MAX -#define UINT_MAX (sizeof(unsigned int) * 256 - 1) -#endif -#ifndef ULONG_MAX -#define ULONG_MAX (sizeof(unsigned long) * 256 - 1) -#endif -#ifndef UINTPTR_MAX -//apparently this is not a constant expression: (sizeof(unsigned int *) * 256 - 1) so we have to just let this fall through -#endif -#endif -//------------------------------------------------------- -// Guess Widths If Not Specified -//------------------------------------------------------- - -// Determine the size of an int, if not already specificied. -// We cannot use sizeof(int), because it is not yet defined -// at this stage in the trnslation 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 - #endif -#endif -#ifndef UNITY_INT_WIDTH - #define UNITY_INT_WIDTH (32) -#endif - -// Determine the size of a long, if not already specified, -// by following the process used above to define -// UNITY_INT_WIDTH. -#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 - #endif -#endif -#ifndef UNITY_LONG_WIDTH - #define UNITY_LONG_WIDTH (32) -#endif - -// Determine the size of a pointer, if not already specified, -// by following the process used above to define -// UNITY_INT_WIDTH. -#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 - #endif -#endif -#ifndef UNITY_POINTER_WIDTH - #ifdef INTPTR_MAX - #if (INTPTR_MAX <= 0x7FFF) - #define UNITY_POINTER_WIDTH (16) - #elif (INTPTR_MAX <= 0x7FFFFFFF) - #define UNITY_POINTER_WIDTH (32) - #elif (INTPTR_MAX <= 0x7FFFFFFFFFFFFFFF) - #define UNITY_POINTER_WIDTH (64) - #endif - #endif -#endif -#ifndef UNITY_POINTER_WIDTH - #define UNITY_POINTER_WIDTH UNITY_LONG_WIDTH -#endif - -//------------------------------------------------------- -// Int Support (Define types based on detected sizes) -//------------------------------------------------------- - -#if (UNITY_INT_WIDTH == 32) - typedef unsigned char _UU8; - typedef unsigned short _UU16; - typedef unsigned int _UU32; - typedef signed char _US8; - typedef signed short _US16; - typedef signed int _US32; -#elif (UNITY_INT_WIDTH == 16) - typedef unsigned char _UU8; - typedef unsigned int _UU16; - typedef unsigned long _UU32; - typedef signed char _US8; - typedef signed int _US16; - typedef signed long _US32; -#else - #error Invalid UNITY_INT_WIDTH specified! (16 or 32 are supported) -#endif - -//------------------------------------------------------- -// 64-bit Support -//------------------------------------------------------- - -#ifndef UNITY_SUPPORT_64 -#if UNITY_LONG_WIDTH > 32 -#define UNITY_SUPPORT_64 -#endif -#endif -#ifndef UNITY_SUPPORT_64 -#if UNITY_POINTER_WIDTH > 32 -#define UNITY_SUPPORT_64 -#endif -#endif - -#ifndef UNITY_SUPPORT_64 - -//No 64-bit Support -typedef _UU32 _U_UINT; -typedef _US32 _U_SINT; - -#else - -//64-bit Support -#if (UNITY_LONG_WIDTH == 32) - typedef unsigned long long _UU64; - typedef signed long long _US64; -#elif (UNITY_LONG_WIDTH == 64) - typedef unsigned long _UU64; - typedef signed long _US64; -#else - #error Invalid UNITY_LONG_WIDTH specified! (32 or 64 are supported) -#endif -typedef _UU64 _U_UINT; -typedef _US64 _U_SINT; - -#endif - -//------------------------------------------------------- -// Pointer Support -//------------------------------------------------------- - -#if (UNITY_POINTER_WIDTH == 32) - typedef _UU32 _UP; -#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX32 -#elif (UNITY_POINTER_WIDTH == 64) - typedef _UU64 _UP; -#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX64 -#elif (UNITY_POINTER_WIDTH == 16) - typedef _UU16 _UP; -#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 - -//------------------------------------------------------- -// Float Support -//------------------------------------------------------- - -#ifdef UNITY_EXCLUDE_FLOAT - -//No Floating Point Support -#undef UNITY_INCLUDE_FLOAT -#undef UNITY_FLOAT_PRECISION -#undef UNITY_FLOAT_TYPE -#undef UNITY_FLOAT_VERBOSE - -#else - -#ifndef UNITY_INCLUDE_FLOAT -#define UNITY_INCLUDE_FLOAT -#endif - -//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 _UF; - -#endif - -//------------------------------------------------------- -// Double Float Support -//------------------------------------------------------- - -//unlike FLOAT, we DON'T include by default -#ifndef UNITY_EXCLUDE_DOUBLE -#ifndef UNITY_INCLUDE_DOUBLE -#define UNITY_EXCLUDE_DOUBLE -#endif -#endif - -#ifdef UNITY_EXCLUDE_DOUBLE - -//No Floating Point Support -#undef UNITY_DOUBLE_PRECISION -#undef UNITY_DOUBLE_TYPE -#undef UNITY_DOUBLE_VERBOSE - -#ifdef UNITY_INCLUDE_DOUBLE -#undef UNITY_INCLUDE_DOUBLE -#endif - -#else - -//Double Floating Point Support -#ifndef UNITY_DOUBLE_PRECISION -#define UNITY_DOUBLE_PRECISION (1e-12f) -#endif -#ifndef UNITY_DOUBLE_TYPE -#define UNITY_DOUBLE_TYPE double -#endif -typedef UNITY_DOUBLE_TYPE _UD; - -#endif - -#ifdef UNITY_DOUBLE_VERBOSE -#ifndef UNITY_FLOAT_VERBOSE -#define UNITY_FLOAT_VERBOSE -#endif -#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) putchar(a) -#else -//If defined as something else, make sure we declare it here so it's ready for use -#ifndef NULL -#define NULL 0 -#endif // NULL -extern int UNITY_OUTPUT_CHAR(int); -#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 _U_UINT -#endif - -#ifndef UNITY_COUNTER_TYPE -#define UNITY_COUNTER_TYPE _U_UINT -#endif - -//------------------------------------------------------- -// Language Features Available -//------------------------------------------------------- -#if !defined(UNITY_WEAK_ATTRIBUTE) && !defined(UNITY_WEAK_PRAGMA) -# ifdef __GNUC__ // includes clang -# if !(defined(__WIN32__) && defined(__clang__)) -# define UNITY_WEAK_ATTRIBUTE __attribute__((weak)) -# endif -# endif -# ifdef _MSC_VER -# define UNITY_WEAK_ATTRIBUTE -# 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) -#define UNITY_DISPLAY_RANGE_AUTO (0x80) - -typedef enum -{ -#if (UNITY_INT_WIDTH == 16) - UNITY_DISPLAY_STYLE_INT = 2 + UNITY_DISPLAY_RANGE_INT + UNITY_DISPLAY_RANGE_AUTO, -#elif (UNITY_INT_WIDTH == 32) - UNITY_DISPLAY_STYLE_INT = 4 + UNITY_DISPLAY_RANGE_INT + UNITY_DISPLAY_RANGE_AUTO, -#elif (UNITY_INT_WIDTH == 64) - UNITY_DISPLAY_STYLE_INT = 8 + UNITY_DISPLAY_RANGE_INT + UNITY_DISPLAY_RANGE_AUTO, -#endif - 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 - -#if (UNITY_INT_WIDTH == 16) - UNITY_DISPLAY_STYLE_UINT = 2 + UNITY_DISPLAY_RANGE_UINT + UNITY_DISPLAY_RANGE_AUTO, -#elif (UNITY_INT_WIDTH == 32) - UNITY_DISPLAY_STYLE_UINT = 4 + UNITY_DISPLAY_RANGE_UINT + UNITY_DISPLAY_RANGE_AUTO, -#elif (UNITY_INT_WIDTH == 64) - UNITY_DISPLAY_STYLE_UINT = 8 + UNITY_DISPLAY_RANGE_UINT + UNITY_DISPLAY_RANGE_AUTO, -#endif - 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; - -#ifndef UNITY_EXCLUDE_FLOAT -typedef enum _UNITY_FLOAT_TRAIT_T -{ - 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_TRAIT_T; -#endif - -struct _Unity -{ - const char* TestFile; - const char* CurrentTestName; - UNITY_LINE_TYPE CurrentTestLineNumber; - UNITY_COUNTER_TYPE NumberOfTests; - UNITY_COUNTER_TYPE TestFailures; - UNITY_COUNTER_TYPE TestIgnores; - UNITY_COUNTER_TYPE CurrentTestFailed; - UNITY_COUNTER_TYPE CurrentTestIgnored; - jmp_buf AbortFrame; -}; - -extern struct _Unity 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); - -//------------------------------------------------------- -// Test Output -//------------------------------------------------------- - -void UnityPrint(const char* string); -void UnityPrintMask(const _U_UINT mask, const _U_UINT number); -void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T style); -void UnityPrintNumber(const _U_SINT number); -void UnityPrintNumberUnsigned(const _U_UINT number); -void UnityPrintNumberHex(const _U_UINT number, const char nibbles); - -#ifdef UNITY_FLOAT_VERBOSE -void UnityPrintFloat(const _UF number); -#endif - -//------------------------------------------------------- -// Test Assertion Fuctions -//------------------------------------------------------- -// 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 _U_SINT expected, - const _U_SINT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style); - -void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected, - UNITY_PTR_ATTRIBUTE const void* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style); - -void UnityAssertBits(const _U_SINT mask, - const _U_SINT expected, - const _U_SINT 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 _UU32 length, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualStringArray( const char** expected, - const char** actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualMemory( UNITY_PTR_ATTRIBUTE const void* expected, - UNITY_PTR_ATTRIBUTE const void* actual, - const _UU32 length, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertNumbersWithin(const _U_SINT delta, - const _U_SINT expected, - const _U_SINT 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 _UF delta, - const _UF expected, - const _UF actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected, - UNITY_PTR_ATTRIBUTE const _UF* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertFloatSpecial(const _UF actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style); -#endif - -#ifndef UNITY_EXCLUDE_DOUBLE -void UnityAssertDoublesWithin(const _UD delta, - const _UD expected, - const _UD actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected, - UNITY_PTR_ATTRIBUTE const _UD* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertDoubleSpecial(const _UD actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style); -#endif - -//------------------------------------------------------- -// Error Strings We Might Need -//------------------------------------------------------- - -extern const char UnityStrErrFloat[]; -extern const char UnityStrErrDouble[]; -extern const char UnityStrErr64[]; - -//------------------------------------------------------- -// Test Running Macros -//------------------------------------------------------- - -#define TEST_PROTECT() (setjmp(Unity.AbortFrame) == 0) - -#define TEST_ABORT() {longjmp(Unity.AbortFrame, 1);} - -//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("") -#endif - -#ifndef UNITY_END -#define UNITY_END() UnityEnd() -#endif - -#define UNITY_UNUSED(x) (void)(sizeof(x)) - -//------------------------------------------------------- -// 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((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UU8 )(expected), (_U_SINT)(_UU8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UU16)(expected), (_U_SINT)(_UU16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UU32)(expected), (_U_SINT)(_UU32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message) UnityAssertBits((_U_SINT)(mask), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line) - -#define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_US8 )(delta), (_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_INT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_US16)(delta), (_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_INT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_US32)(delta), (_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_UINT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU8 )(delta), (_U_SINT)(_U_UINT)(_UU8 )(expected), (_U_SINT)(_U_UINT)(_UU8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_UINT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU16)(delta), (_U_SINT)(_U_UINT)(_UU16)(expected), (_U_SINT)(_U_UINT)(_UU16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_UINT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU32)(delta), (_U_SINT)(_U_UINT)(_UU32)(expected), (_U_SINT)(_U_UINT)(_UU32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU8 )(delta), (_U_SINT)(_U_UINT)(_UU8 )(expected), (_U_SINT)(_U_UINT)(_UU8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU16)(delta), (_U_SINT)(_U_UINT)(_UU16)(expected), (_U_SINT)(_U_UINT)(_UU16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU32)(delta), (_U_SINT)(_U_UINT)(_UU32)(expected), (_U_SINT)(_U_UINT)(_UU32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32) - -#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UP)(expected), (_U_SINT)(_UP)(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), (_UU32)(len), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_PTR_ATTRIBUTE void*)(expected), (UNITY_PTR_ATTRIBUTE void*)(actual), (_UU32)(len), 1, (message), (UNITY_LINE_TYPE)line) - -#define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(_UP*)(expected), (const void*)(_UP*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_POINTER) -#define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((const char**)(expected), (const char**)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_PTR_ATTRIBUTE void*)(expected), (UNITY_PTR_ATTRIBUTE void*)(actual), (_UU32)(len), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line) - -#ifdef UNITY_SUPPORT_64 -#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(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_PTR_ATTRIBUTE const _U_SINT*)(expected), (UNITY_PTR_ATTRIBUTE const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const _U_SINT*)(expected), (UNITY_PTR_ATTRIBUTE const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const _U_SINT*)(expected), (UNITY_PTR_ATTRIBUTE const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (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) -#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_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((_UF)(delta), (_UF)(expected), (_UF)(actual), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((_UF)(expected) * (_UF)UNITY_FLOAT_PRECISION, (_UF)expected, (_UF)actual, (UNITY_LINE_TYPE)line, message) -#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray((_UF*)(expected), (_UF*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NEG_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NAN) -#define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_DET) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_NEG_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_NAN) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((_UF)(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_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((_UD)(delta), (_UD)(expected), (_UD)(actual), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((_UD)(expected) * (_UD)UNITY_DOUBLE_PRECISION, (_UD)expected, (_UD)actual, (UNITY_LINE_TYPE)line, message) -#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray((_UD*)(expected), (_UD*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NEG_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NAN) -#define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_DET) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_NEG_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_NAN) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_DET) -#endif - -//End of UNITY_INTERNALS_H -#endif diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity_print.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity_print.h deleted file mode 100644 index f09abaa07..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/unity_print.h +++ /dev/null @@ -1,11 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ - -#ifndef UNITY_PRINT_H -#define UNITY_PRINT_H - -void unity_print_init(void); - -void unity_print_close(void); - -#endif // UNITY_PRINT_H diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/zw700/unity_print.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/zw700/unity_print.c deleted file mode 100644 index fe066b22c..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/unity/zw700/unity_print.c +++ /dev/null @@ -1,76 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ - -#include "../unity_print.h" -#include "../unity.h" -#include -#include -#include - -#define UNITY_PRINT_BAUD_RATE 115200 /**< Baud rate to use for unity printing, 115200. */ -#define UNITY_PRINT_TX_ENABLE 1 -#define UNITY_PRINT_RX_ENABLE 1 -#define UNITY_PRINT_UART_CTRL_HS_TEST (1 << 6) - -#define __XTAL ( 9600000UL) /* Oscillator frequency */ -#define __SYSTEM_CLOCK (5*__XTAL) - -extern uint8_t * gUnityMessageBuffer; -extern uint32_t gUnityMessageBufferSize; - -uint8_t * gUnityMessageBuffer __attribute__((weak)) = NULL; -uint32_t gUnityMessageBufferSize __attribute__((weak)) = 0; - -void unity_print_init(void) -{ - // ZW_UART0_init(1152,1,1); - ARM_UART0->BAUDDIV = __SYSTEM_CLOCK / UNITY_PRINT_BAUD_RATE; - ARM_UART0->CTRL |= APB_UART_CTRL_TX_ENABLE; - ARM_UART0->CTRL |= APB_UART_CTRL_RX_ENABLE; - ARM_UART0->CTRL |= UNITY_PRINT_UART_CTRL_HS_TEST; -} - -int ZW_putchar(int c) -{ - while(ARM_UART0->STATE & APB_UART_STATE_TX_FULL ); - ARM_UART0->DATA = c; // Transmit char - return c; -} - -/** Function for printing ASIP messages. - * - * @details When unit testing on ASIP a memory buffer is used to pass the log messages from the - * ASIP to the ARM Cortex CPU. This function is used for reading the memory buffer from - * the ASIP and write the content to the UART. - */ -static void unity_print_asip(void) -{ - uint32_t messageBufferIndex = 0; - - if ((gUnityMessageBuffer == NULL) || (gUnityMessageBufferSize == 0)) - { - return; - } - - UnityPrint("UnityAsip - start."); - ZW_putchar('\n'); - while((messageBufferIndex < gUnityMessageBufferSize) && (gUnityMessageBuffer[messageBufferIndex] != 0)) - { - ZW_putchar(gUnityMessageBuffer[messageBufferIndex++]); - } - ZW_putchar('\n'); - UnityPrint("UnityAsip - end."); - ZW_putchar('\n'); -} - -void unity_print_close(void) -{ - unity_print_asip(); - ZW_putchar('\04'); -} - -int fputc(int c, FILE * stream) -{ - (void)stream; - return ZW_putchar(c); -} diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/S2_external.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/S2_external.h index 3087ff20f..06b6a77d6 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/S2_external.h +++ b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/S2_external.h @@ -120,26 +120,29 @@ void S2_get_commands_supported(node_t lnode, uint8_t class_id, const uint8_t ** * \param nls_capability The NLS capability of the source node * \param nls_state The NLS state of the source node */ -void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, uint8_t nls_capability, uint8_t nls_state); +void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, bool nls_capability, bool nls_state); /** * Get the NLS nodes list * \param srcNode Source node ID of the frame - * \param class_id the security class this request was on * \param request request field. 0 for the first node in the list, 1 for the next node in the list + * \param is_last_node out pointer to be filled by the host indicating whether the node in question is the last one or not + * \param node_id out pointer to be filled by the host indicating the node ID in question + * \param granted_keys out pointer to be filled by the host indicating the granted keys of the node in question + * \param nls_state out pointer to be filled by the host indicating the NLS state of the node in question + * \return 0 in case of success or else in case of error */ -void S2_nls_node_list_get(node_t srcNode, uint8_t class_id, uint8_t request); +int8_t S2_get_nls_node_list(node_t srcNode, bool request, bool *is_last_node, uint16_t *node_id, uint8_t *granted_keys, bool *nls_state); /** * Get the NLS node list report * \param srcNode Source node ID of the frame - * \param class_id the security class this request was on - * \param last_node wether the node in list is last or not * \param id_of_node the Node ID of the node being advertised * \param keys_node_bitmask granted keys for current Node ID * \param nls_state NLS state of the current node ID + * \return 0 in case of success or else in case of error */ -void S2_nls_node_list_report(node_t srcNode, uint8_t class_id, uint8_t last_node, uint16_t id_of_node, uint8_t keys_node_bitmask, uint8_t nls_state); +int8_t S2_notify_nls_node_list_report(node_t srcNode, uint16_t id_of_node, uint8_t keys_node_bitmask, bool nls_state); /** * Makes time in ms available to LibS2 @@ -190,6 +193,14 @@ void S2_resynchronization_event( */ void S2_save_nls_state(void); +/** + * Load NLS state stored in device memory in S2 context + * + * \param ctxt the S2 context + * \param nls_state NLS state + */ +void S2_load_nls_state(struct S2* ctxt, uint8_t nls_state); + /** * @} */ diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/mock/s2_extern_mock.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/mock/s2_extern_mock.c index 3cb6747cb..b327ec295 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/mock/s2_extern_mock.c +++ b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/mock/s2_extern_mock.c @@ -80,7 +80,7 @@ uint8_t S2_send_frame(struct S2* ctxt,const s2_connection_t* conn, uint8_t* buf, MOCK_CALL_RETURN_VALUE(p_mock, uint8_t); } -void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, uint8_t nls_capability, uint8_t nls_state) +void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, bool nls_capability, bool nls_state) { mock_t * p_mock; @@ -90,24 +90,28 @@ void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, uint8_t nls_ca MOCK_CALL_ACTUAL(p_mock, srcNode, class_id, nls_capability, nls_state); } -void S2_nls_node_list_get(node_t srcNode, uint8_t class_id, uint8_t request) +int8_t S2_get_nls_node_list(node_t srcNode, bool request, bool *is_last_node, uint16_t *node_id, uint8_t *granted_keys, bool *nls_state) { mock_t * p_mock; - MOCK_CALL_RETURN_VOID_IF_USED_AS_STUB(); - MOCK_CALL_FIND_RETURN_VOID_ON_FAILURE(p_mock); + MOCK_CALL_RETURN_IF_USED_AS_STUB(0); + MOCK_CALL_FIND_RETURN_ON_FAILURE(p_mock, -1); + + MOCK_CALL_ACTUAL(p_mock, srcNode, request, is_last_node, node_id, granted_keys, nls_state); - MOCK_CALL_ACTUAL(p_mock, srcNode, class_id, request); + MOCK_CALL_RETURN_VALUE(p_mock, int8_t); } -void S2_nls_node_list_report(node_t srcNode, uint8_t class_id, uint8_t last_node, uint16_t id_of_node, uint8_t keys_node_bitmask, uint8_t nls_state) +int8_t S2_notify_nls_node_list_report(node_t srcNode, uint16_t id_of_node, uint8_t keys_node_bitmask, bool nls_state) { mock_t * p_mock; - MOCK_CALL_RETURN_VOID_IF_USED_AS_STUB(); - MOCK_CALL_FIND_RETURN_VOID_ON_FAILURE(p_mock); + MOCK_CALL_RETURN_IF_USED_AS_STUB(0); + MOCK_CALL_FIND_RETURN_ON_FAILURE(p_mock, -1); + + MOCK_CALL_ACTUAL(p_mock, srcNode, id_of_node, keys_node_bitmask, nls_state); - MOCK_CALL_ACTUAL(p_mock, srcNode, class_id, last_node, id_of_node, keys_node_bitmask, nls_state); + MOCK_CALL_RETURN_VALUE(p_mock, int8_t); } void S2_set_timeout(struct S2* ctxt, uint32_t interval) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/s2_classcmd.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/s2_classcmd.h index 56b659d8d..16828e2f3 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/s2_classcmd.h +++ b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/s2_classcmd.h @@ -123,11 +123,11 @@ /** Following define are related to the NLS Node List Report frame. */ #define SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_FIELD 0x01 //< Field denoting if its the last node of the list -#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_POS 0x01 //< Position of last node field -#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_MSB_POS 2 //< Position of MSB byte of NodeID -#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_LSB_POS 3 //< Position of LSB byte of NodeID -#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_GRANTED_KEYS_POS 4 //< Position of granted keys byte of NodeID -#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NLS_STATE_POS 5 //< Position of NLS state byte of NodeID +#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_POS 2 //< Position of last node field +#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_MSB_POS 3 //< Position of MSB byte of NodeID +#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_LSB_POS 4 //< Position of LSB byte of NodeID +#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_GRANTED_KEYS_POS 5 //< Position of granted keys byte of NodeID +#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NLS_STATE_POS 6 //< Position of NLS state byte of NodeID /** Length definitions */ #define SECURITY_2_NONCE_GET_LENGTH 3 @@ -143,7 +143,7 @@ #define SECURITY_2_V2_NLS_STATE_SET_LENGTH 3 #define SECURITY_2_V2_NLS_STATE_GET_LENGTH 2 #define SECURITY_2_V2_NLS_STATE_REPORT_LENGTH 3 -#define SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH 2 +#define SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH 3 #define SECURITY_2_V2_NLS_NODE_LIST_REPORT_LENGTH 7 #define SECURITY_2_EC_PUBLIC_KEY_LENGTH 32 diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/s2_protocol.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/s2_protocol.h index e4bb0a5e4..df0c62ce2 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/s2_protocol.h +++ b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/s2_protocol.h @@ -229,6 +229,32 @@ struct S2 public_key_t public_key; bool is_keys_restored; + +#ifdef ZW_CONTROLLER + /* This structure stores flags that are associated to some NLS related + commands that are used to retransmit the frames that cannot be sent due + to the S2 state machine not being IDLE. */ + struct { + uint8_t send_nls_node_list_get: 1; + uint8_t send_nls_node_list_report: 1; + uint8_t reserved: 6; + } delayed_transmission_flags; + + /* This union stores some parameters that are associated to some NLS related + commands. They are used to cache information to be sent later on using the flags + above. */ + union { + struct { + uint8_t is_last_node; + uint8_t granted_keys; + uint16_t node_id; + uint8_t nls_state; + } nls_node_report; + struct { + uint8_t request; // 0: first node, 1: next node + } get_nls_node_list; + } delayed_transmission_cache; +#endif //network_key_t temp_network_key; uint8_t nls_state; }; diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/test/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/test/CMakeLists.txt index dc95dab45..2293eab50 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/test/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/test/CMakeLists.txt @@ -16,56 +16,3 @@ add_unity_test(NAME test_inclusion_joining_node_slave s2_inclusion_mocks crypto_mocks ) - -if(ENABLE_CONTROLLER) - add_unity_test(NAME test_inclusion_including_node - FILES - ../s2_inclusion.c - ../s2_inclusion_controller.c - test_inclusion_including_node.c - LIBRARIES - mock - s2_mock - s2_inclusion_mocks - crypto_mocks - ) - set_target_properties(test_inclusion_including_node - PROPERTIES - COMPILE_DEFINITIONS "ZW_CONTROLLER" - ) - - add_unity_test(NAME test_inclusion_joining_node_controller - TEST_BASE - test_inclusion_joining_node.c - FILES - ../s2_inclusion.c - ../s2_inclusion_controller.c - test_inclusion_joining_node.c - LIBRARIES - mock - s2_mock - s2_inclusion_mocks - crypto_mocks - ) - set_target_properties(test_inclusion_joining_node_controller - PROPERTIES - COMPILE_DEFINITIONS "ZW_CONTROLLER" - ) - - add_unity_test(NAME test_inclusion - FILES - ../s2_inclusion.c - ../s2_inclusion_controller.c - test_inclusion.c - LIBRARIES - mock - s2_mock - s2_inclusion_mocks - s2crypto - aes - ) - set_target_properties(test_inclusion - PROPERTIES - COMPILE_DEFINITIONS "ZW_CONTROLLER" - ) -endif(ENABLE_CONTROLLER) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/test/test_inclusion.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/test/test_inclusion.c deleted file mode 100644 index cc5887b7d..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/test/test_inclusion.c +++ /dev/null @@ -1,353 +0,0 @@ -/* © 2015Silicon Laboratories Inc. - */ -/* - * Created on: Aug 25, 2015 - * Author: trasmussen - */ - -#include "s2_inclusion.h" -#include -#include -#include -#include "s2_protocol.h" -#include "unity.h" -#include "curve25519.h" -#include "s2_keystore.h" - -void setUpSuite(void) { - -} - -void tearDownSuite(void) { - -} - -#define ELEM_COUNT(ARRAY) (sizeof(ARRAY)/(sizeof(ARRAY[0]))) -#define UNIT_TEST_TEMP_KEY_SECURE 5 //< Value identifying index for the temporary key in S2 network key when transmitting secure frames. -#define UNIT_TEST_NETWORK_KEY 6 //< Value identifying index for the temporary key in S2 network key when transmitting secure frames. - -// Public key A as used in ECDH curve test cases. -static uint8_t m_test_public_key_a[] = {0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, - 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, - 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4, - 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a}; - -// Public key B as used in ECDH curve test cases. -static uint8_t m_test_public_key_b[] = {0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, - 0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, - 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d, - 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f}; - -// Private key A as used in ECDH curve test cases. -static uint8_t m_test_private_key_a[] = {0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, - 0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2, 0x66, 0x45, - 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a, - 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a}; - -// Private key B as used in ECDH curve test cases. -static uint8_t m_test_private_key_b[] = {0x5d, 0xab, 0x08, 0x7e, 0x62, 0x4a, 0x8a, 0x4b, - 0x79, 0xe1, 0x7f, 0x8b, 0x83, 0x80, 0x0e, 0xe6, - 0x6f, 0x3b, 0xb1, 0x29, 0x26, 0x18, 0xb6, 0xfd, - 0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb}; - -//static uint8_t m_test_public_key_a[32]; -//static uint8_t m_test_public_key_b[32]; - -static uint8_t m_test_network_key_s2_class_0[] = {0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, - 0x00, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99}; - -static uint8_t m_test_network_key_s0[] = {0xCA, 0xFE, 0xBA, 0xBE, 0x44, 0x33, 0x22, 0x11, - 0xCA, 0xFE, 0xBA, 0xBE, 0xCC, 0xBB, 0xAA, 0x99}; - -void compare_any_all_args(mock_t *p_mock) -{ - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For this call we just expect any, as we will feed the actual output into next event. - p_mock->compare_rule_arg[1] = COMPARE_ANY; - p_mock->compare_rule_arg[2] = COMPARE_ANY; - p_mock->compare_rule_arg[3] = COMPARE_ANY; -} - -/** This is not a real test case but a test to ensure that the including node - * code in inclusion is correctly working when building for a controller. - */ -void test_controller_build(void) -{ -#ifndef ZW_CONTROLLER - TEST_FAIL_MESSAGE("ZW_CONTROLLER is not defined but including node (ZW Controller) test cases are being executed."); -#endif -} - -/** Verification that the normal flow succeeds in inclusion of a new node. - * - * It verifies the behavior as seen from an including node (Controller node) as described in SDS11274. - * - * When a node is to be included securely it is expected that a ZW_SendData is send. - * For this the common S2_send_frame(...) defined in s2.h is used, which will be implemented elsewhere. - */ -void test_kex_joining_node_state_machine(void) { - mock_t * p_kex_get_mock; - mock_t * p_kex_report_mock; - mock_t * p_kex_set_mock; - mock_t * p_pub_key_b_report_mock; - mock_t * p_pub_key_a_report_mock; - mock_t * p_network_key_joining_update_temp_key_mock; - mock_t * p_network_key_including_update_temp_key_mock; - - mock_t * p_echo_kex_set_mock; - mock_t * p_echo_kex_report_mock; - mock_t * p_network_key_get_round1_mock; - mock_t * p_network_key_report_round1_mock; - mock_t * p_network_key_verify_round1_mock; - mock_t * p_network_key_update_round1_mock; - mock_t * p_transfer_end_round1_mock; - mock_t * p_network_key_get_round2_mock; - mock_t * p_network_key_report_round2_mock; - mock_t * p_network_key_verify_round2_mock; - mock_t * p_network_key_update_round2_mock; - mock_t * p_transfer_end_round2_mock; - mock_t * p_transfer_end_complete_mock; - - mock_t * p_keystore_clear; - mock_t * p_keystore_read_pub_a; - mock_t * p_keystore_read_pub_b; - mock_t * p_keystore_read_priv_a; - mock_t * p_keystore_read_priv_b; - mock_t * p_keystore_read_network_key_s2_class_0; - mock_t * p_keystore_read_network_key_s0; - - struct S2 s2_including_context; - struct S2 s2_joining_context; - s2_connection_t s2_joining_conn; - s2_connection_t s2_including_conn; - - s2_joining_conn.l_node = 2; - s2_joining_conn.r_node = 1; - s2_joining_conn.class_id = 0xFF; - s2_joining_conn.rx_options = 0x00; - - s2_including_conn.l_node = 1; - s2_including_conn.r_node = 2; - s2_including_conn.class_id = 0xFF; - s2_including_conn.rx_options = 0x00; - - /**************************** - * Mock expectation section * - ****************************/ - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(s2_inclusion_event_handler)); - mock_call_use_as_stub(TO_STR(keystore_network_key_write)); - - // Keystore calls. - mock_call_expect(TO_STR(keystore_network_key_clear), &p_keystore_clear); - p_keystore_clear->expect_arg[0].value = 0xFF; - - mock_call_expect(TO_STR(keystore_dynamic_public_key_read), &p_keystore_read_pub_b); - p_keystore_read_pub_b->output_arg[0].pointer = m_test_public_key_b; - - mock_call_expect(TO_STR(keystore_public_key_read), &p_keystore_read_pub_a); - p_keystore_read_pub_a->output_arg[0].pointer = m_test_public_key_a; - - // When calculating the shared secret - Joining node. - mock_call_expect(TO_STR(keystore_dynamic_private_key_read), &p_keystore_read_priv_b); - p_keystore_read_priv_b->output_arg[0].pointer = m_test_private_key_b; - mock_call_expect(TO_STR(keystore_dynamic_public_key_read), &p_keystore_read_pub_b); - p_keystore_read_pub_b->output_arg[0].pointer = m_test_public_key_b; - mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_joining_update_temp_key_mock); - compare_any_all_args(p_network_key_joining_update_temp_key_mock); - - // When calculating the shared secret - Joining node. - mock_call_expect(TO_STR(keystore_private_key_read), &p_keystore_read_priv_a); - p_keystore_read_priv_a->output_arg[0].pointer = m_test_private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_keystore_read_pub_a); - p_keystore_read_pub_a->output_arg[0].pointer = m_test_public_key_a; - mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_including_update_temp_key_mock); - compare_any_all_args(p_network_key_including_update_temp_key_mock); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_keystore_read_network_key_s2_class_0); - p_keystore_read_network_key_s2_class_0->expect_arg[0].value = KEY_CLASS_S2_UNAUTHENTICATED; - p_keystore_read_network_key_s2_class_0->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_keystore_read_network_key_s0); - p_keystore_read_network_key_s0->expect_arg[0].value = KEY_CLASS_S0; - p_keystore_read_network_key_s0->output_arg[1].pointer = m_test_network_key_s0; - - // Expectations of call for transmitting network frames. - mock_call_expect(TO_STR(S2_send_frame), &p_kex_get_mock); - compare_any_all_args(p_kex_get_mock); - - mock_call_expect(TO_STR(S2_send_frame), &p_kex_report_mock); - compare_any_all_args(p_kex_report_mock); - - mock_call_expect(TO_STR(S2_send_frame), &p_kex_set_mock); - compare_any_all_args(p_kex_set_mock); - - mock_call_expect(TO_STR(S2_send_frame), &p_pub_key_b_report_mock); - compare_any_all_args(p_pub_key_b_report_mock); - - mock_call_expect(TO_STR(S2_send_frame), &p_pub_key_a_report_mock); - compare_any_all_args(p_pub_key_a_report_mock); - - mock_call_expect(TO_STR(S2_send_data), &p_echo_kex_set_mock); - compare_any_all_args(p_echo_kex_set_mock); - - mock_call_expect(TO_STR(S2_send_data), &p_echo_kex_report_mock); - compare_any_all_args(p_echo_kex_report_mock); - - mock_call_expect(TO_STR(S2_send_data), &p_network_key_get_round1_mock); - compare_any_all_args(p_network_key_get_round1_mock); - - mock_call_expect(TO_STR(S2_send_data), &p_network_key_report_round1_mock); - compare_any_all_args(p_network_key_report_round1_mock); - - mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_update_round1_mock); - compare_any_all_args(p_network_key_update_round1_mock); - mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_update_round1_mock); - compare_any_all_args(p_network_key_update_round1_mock); - - mock_call_expect(TO_STR(S2_send_data), &p_network_key_verify_round1_mock); - compare_any_all_args(p_network_key_verify_round1_mock); - - mock_call_expect(TO_STR(S2_send_data), &p_transfer_end_round1_mock); - compare_any_all_args(p_transfer_end_round1_mock); - - mock_call_expect(TO_STR(S2_send_data), &p_network_key_get_round2_mock); - compare_any_all_args(p_network_key_get_round2_mock); - - mock_call_expect(TO_STR(S2_send_data), &p_network_key_report_round2_mock); - compare_any_all_args(p_network_key_report_round2_mock); - - mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_update_round2_mock); - compare_any_all_args(p_network_key_update_round2_mock); - mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_update_round2_mock); - compare_any_all_args(p_network_key_update_round2_mock); - - mock_call_expect(TO_STR(S2_send_data), &p_network_key_verify_round2_mock); - compare_any_all_args(p_network_key_verify_round2_mock); - - mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_update_round2_mock); - compare_any_all_args(p_network_key_update_round2_mock); - - mock_call_expect( TO_STR(S2_send_data), &p_transfer_end_round2_mock); - compare_any_all_args(p_transfer_end_round2_mock); - - - mock_call_expect( TO_STR(S2_send_data), &p_transfer_end_complete_mock); - compare_any_all_args(p_transfer_end_complete_mock); - - /******************* - * Testing section * - *******************/ - // All output from previous call (which is recordered by the mock) will be fed into the state - // machine for the opposit site context. - s2_joining_context.inclusion_state = 0; - s2_including_context.inclusion_state = 0; - - s2_inclusion_init(SECURITY_2_SCHEME_1_SUPPORT, - KEX_REPORT_CURVE_25519, - 0x81 /* SECURITY_2_KEY_0 | SECURITY_2_KEY_2_CLASS_0 */); - - s2_inclusion_joining_start(&s2_joining_context,&s2_joining_conn,0); - s2_inclusion_including_start(&s2_including_context,&s2_including_conn); - - s2_joining_context.buf = p_kex_get_mock->actual_arg[2].pointer; - s2_joining_context.length = p_kex_get_mock->actual_arg[3].value; - s2_joining_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); - - s2_including_context.buf = p_kex_report_mock->actual_arg[2].pointer; - s2_including_context.length = p_kex_report_mock->actual_arg[3].value; - s2_including_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_including_context, &s2_including_conn); - - s2_inclusion_key_grant(&s2_including_context, 1, 0x81,0); - - s2_joining_context.buf = p_kex_set_mock->actual_arg[2].pointer; - s2_joining_context.length = p_kex_set_mock->actual_arg[3].value; - s2_joining_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); - - s2_including_context.buf = p_pub_key_b_report_mock->actual_arg[2].pointer; - s2_including_context.length = p_pub_key_b_report_mock->actual_arg[3].value; - s2_including_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_including_context, &s2_including_conn); - - s2_joining_context.buf = p_pub_key_a_report_mock->actual_arg[2].pointer; - s2_joining_context.length = p_pub_key_a_report_mock->actual_arg[3].value; - s2_joining_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); - - - s2_inclusion_challenge_response(&s2_including_context, 1, m_test_public_key_b, 2); - s2_inclusion_challenge_response(&s2_joining_context, 1,m_test_public_key_a, 0); - - - s2_including_context.buf = p_echo_kex_set_mock->actual_arg[2].pointer; - s2_including_context.length = p_echo_kex_set_mock->actual_arg[3].value; - s2_including_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_including_context, &s2_including_conn); - - s2_joining_context.buf = p_echo_kex_report_mock->actual_arg[2].pointer; - s2_joining_context.length = p_echo_kex_report_mock->actual_arg[3].value; - s2_joining_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); - - s2_including_context.buf = p_network_key_get_round1_mock->actual_arg[2].pointer; - s2_including_context.length = p_network_key_get_round1_mock->actual_arg[3].value; - s2_including_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_including_context, &s2_including_conn); - - s2_joining_context.buf = p_network_key_report_round1_mock->actual_arg[2].pointer; - s2_joining_context.length = p_network_key_report_round1_mock->actual_arg[3].value; - s2_joining_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); - - s2_including_context.buf = p_network_key_verify_round1_mock->actual_arg[2].pointer; - s2_including_context.length = p_network_key_verify_round1_mock->actual_arg[3].value; - s2_including_conn.class_id = 0x00; - s2_inclusion_post_event(&s2_including_context, &s2_including_conn); - - s2_joining_context.buf = p_transfer_end_round1_mock->actual_arg[2].pointer; - s2_joining_context.length = p_transfer_end_round1_mock->actual_arg[3].value; - s2_joining_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); - - s2_including_context.buf = p_network_key_get_round2_mock->actual_arg[2].pointer; - s2_including_context.length = p_network_key_get_round2_mock->actual_arg[3].value; - s2_including_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_including_context, &s2_including_conn); - - s2_joining_context.buf = p_network_key_report_round2_mock->actual_arg[2].pointer; - s2_joining_context.length = p_network_key_report_round2_mock->actual_arg[3].value; - s2_joining_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); - - s2_including_context.buf = p_network_key_verify_round2_mock->actual_arg[2].pointer; - s2_including_context.length = p_network_key_verify_round2_mock->actual_arg[3].value; - s2_including_conn.class_id = UNIT_TEST_NETWORK_KEY; - s2_inclusion_post_event(&s2_including_context, &s2_including_conn); - - s2_joining_context.buf = p_transfer_end_round2_mock->actual_arg[2].pointer; - s2_joining_context.length = p_transfer_end_round2_mock->actual_arg[3].value; - s2_joining_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); - - // Verify that both sides agree on the calculated temporary key. - // Original test compared ->actual_arg[1] instead of ->actual_arg[2]. - // ->actual_arg[1] contained a 0 (NULL) and thus always returned without comparing. - // Index 2 is containing the actual indexes, however, those do not match. - // However, that was also the case when NULL pointer was wrongly compared. - // ToDo: EInvestigate if and how the calculated temp key should be compared. Test is disabled for now. -// TEST_ASSERT_EQUAL_UINT8_ARRAY(p_network_key_joining_update_temp_key_mock->actual_arg[2].pointer, -// p_network_key_including_update_temp_key_mock->actual_arg[2].pointer, -// 16); - - // Verify the mock has been called and stop test if not, to avoid p_transfer_end_complete_mock->actual_arg[2].pointer dereference 0x00. - TEST_ASSERT_TRUE(p_transfer_end_complete_mock->executed); - // 0x0C in second byte is the command value, here a TRANSFER_END is expected. - TEST_ASSERT_EQUAL_UINT8(0x0C, ((uint8_t *)p_transfer_end_complete_mock->actual_arg[2].pointer)[1]); - // 0x01 in third byte denotes the if key exchange is complete. - TEST_ASSERT_EQUAL_UINT8(0x01, ((uint8_t *)p_transfer_end_complete_mock->actual_arg[2].pointer)[2]); - - mock_calls_verify(); -} diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/test/test_inclusion_including_node.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/test/test_inclusion_including_node.c deleted file mode 100644 index 7afe0b2b0..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/test/test_inclusion_including_node.c +++ /dev/null @@ -1,6502 +0,0 @@ -/* © 2014 Silicon Laboratories Inc. - */ -/* - * test_inclusion.c - * - * Created on: Aug 25, 2015 - * Author: trasmussen - */ - -#include "s2_inclusion.h" -#include -#include -#include -#include "platform.h" -#include "unity.h" -#include "s2_protocol.h" - -#include "ZW_classcmd.h" -#include "s2_classcmd.h" - -void setUpSuite(void) { - -} - -void tearDownSuite(void) { - -} - -#define ELEM_COUNT(ARRAY) (sizeof(ARRAY)/(sizeof(ARRAY[0]))) -#define UNIT_TEST_TEMP_KEY_SECURE 5 //< Value identifying index for the temporary key in S2 network key when transmitting secure frames. -#define UNIT_TEST_NETWORK_KEY 6 //< Value identifying index for the temporary key in S2 network key when transmitting secure frames. - -/** Overview of behavior which should be implemented: - * General inclusion: - * - Implement SM according to designed flow. - * - Identify all events and actions which must be handled and executed during node inclusion. - * - It is expected that a common S2 layer resides above the inclusion module (and other S2 - * related modules) which is responsible for dispatching packet/events based on command. - * In the tests it is expected that a learn request will initiate the inclusion flow. - * - Early discussions on future direction has been initiated between Torsten, Jakob, and Anders on event generation - * Early ideas is to have an event notification system which could be simplified version of SKB in Linux. - * This work must progress but in S2_inclusion.c a simple notification system will be taken into use with refactoring possibilities. - * - * - * Error handling: - * - Timeout: it must be ensured that a proper timer API is available for the inclusion state machine is available. - * In case a timeout occurs, it must be ensured that the inclusion state machine returns to idle and - * appropriate error is notified to callback provided by protocol layer. - * Error handler provided by protocol layer is expected to be implemented by application.. - * The SM will not be responsible for further actions due to timeouts. - * - */ - -/** Current working assumptions: - * Lib S2 - message encapsulation/inclusion mode and context handling - * - Currently context is updated with peer, buffer, and length in libs2 protocol (message - * encapsulation handling), this should be moved to common place. s2 dispatch layer ? - * - Libs2 S2.c contains the entry point for frames receined, S2_application_command_handler(.), - * this should ideally be refactored to upper dispatcher layer which should be common for encapsulation handling and inclusion. - */ - -/** Currently identyfied test cases not yet implemented. - * - * - Key Verify failure. - * - */ -#define UNIT_TEST_BUF_SIZE 256 - -static uint8_t m_test_mem_pool[4][256]; // Statically allocated chunks of memory that can be freely used during the test. - -// Public key A as used in ECDH curve test cases. -static uint8_t m_test_public_key_a[] = {0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, - 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, - 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4, - 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a}; - -// Public key B as used in ECDH curve test cases. -static uint8_t m_test_public_key_b[] = {0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, - 0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, - 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d, - 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f}; - - -// Obfuscated Public key B where first bytes are masked out as used for DSK input. -static uint8_t m_test_obfuscated_public_key_b[] = {0x00, 0x00, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, - 0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, - 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d, - 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f}; - - -//static uint8_t m_temp_key[] = {0x7E, 0xFE, 0x12, 0x32, 0x45, 0x65, 0x78, 0x98, -// 0x7E, 0xFE, 0x12, 0x32, 0x45, 0x65, 0x78, 0x98}; - -static uint8_t m_test_network_key_s2_class_0[] = {0x11, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, - 0x00, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99}; - -static uint8_t m_test_network_key_s2_class_1[] = {0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, - 0x00, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99}; - -static uint8_t m_test_network_key_s2_class_2[] = {0x22, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, - 0x00, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99}; - -static uint8_t m_test_network_key_s0[] = {0xCA, 0xFE, 0xBA, 0xBE, 0x44, 0x33, 0x22, 0x11, - 0xCA, 0xFE, 0xBA, 0xBE, 0xCC, 0xBB, 0xAA, 0x99}; - -s2_connection_t s2_conn; -/** Event listener for S2 inclusion. - * - * S2 will use an event listening scheme for posting notifications upwards. - * How the notification is stored/handled is outside scope of the state machine, but it is - * imagined that such system would implement a queing system to allow inclusion operations - * to progress as fast as possible. - * - * This forward declares the mock funtion used, because the callback is a function pointer with no named declaration. - */ -void s2_event_handler(zwave_event_t * p_zwave_evt); - -/** Forward declaration of helper classes. - * All helper classes are implemented in buttom of file to easily keep them seperated from the test cases. - */ -void helper_func_kex_report_frame(struct S2 *p_context); -void helper_func_echo_kex_report_frame_expect(uint8_t expected_scheme, uint8_t expected_curves, uint8_t expected_keys); -void helper_func_kex_set_frame_expect(uint8_t expected_scheme, uint8_t expected_curves, uint8_t expected_keys); -void helper_func_pub_key_frame(struct S2 *p_context); -void helper_func_echo_kex_set_frame(struct S2 *p_context); -void helper_func_net_key_get_frame(struct S2 *p_context, uint8_t key); -void helper_func_net_key_verify_frame(struct S2 *p_context, uint8_t key); -void helper_func_transfer_end_final_frame(struct S2 *p_context); -void helper_func_verify_idle_state(struct S2 *p_context); -void helper_func_kex_get_frame_expect(void); -void helper_func_restore_keys_expect(void); -static void helper_func_init_s2_conn(void); - -/** This is not a real test case but a test to ensure that the including node - * code in inclusion is correctly working when building for a controller. - */ -void test_controller_build(void) -{ -#ifndef ZW_CONTROLLER - TEST_FAIL_MESSAGE("ZW_CONTROLLER is not defined but including node (ZW Controller) test cases are being executed."); -#endif -} - -/** Verification that the normal flow succeeds in inclusion of a new node when using SSA. - * - * It verifies the behavior as seen from an including node (Controller node) as described in SDS11274. - * - * When a node is to be included securely it is expected that a ZW_SendData is send. - * For this the common S2_send_frame(...) defined in s2.h is used, which will be implemented elsewhere. - */ -void test_kex_including_node_state_machine_csa(void) { - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x06, // bit 0 is echo field, bit 1 is CSA, bit 2 is NLS support. - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test expectation setup. - * This section set up the expectations in the system when the inclusion state machine progresses: - * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. - * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. - * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. - * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. - * 5) Exchange of public keys. - * a) Public KeyB is received from joining node A. - * - Public KeyB must be pushed upwards as event to be presented to user for further verification. - * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. - * Currently that use case is outside the scope of libs2. - * - When Public KeyB is received, the controller must send its public KeyA. - * Public KeyB shall be provided by the application. - * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. - * This is done in security sub module (currently under development) - * - The security context must be re-initialized with temporary derived key. - * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. - * 6) Echoing of KEX frames. - * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be - * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). - * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. - * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. - * 7) Network key exchange: - * a) Joining node will request the network key, by sending a 'Network Key Get'. - * b) Including node shall reply with a 'Network Key Set'. - * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' - * - Including node must verify that it can succesfully decrypt the message using the key. - * d) Including node shall reply with a 'Transfer End'. - * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. - * - */ - mock_t * p_mock; - - // Expect a S2 KEX Get to be sent. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x01; - p_expected_report_event->evt.s2_event.s2_data.kex_report.nls_available = 0x01; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, - 0x02, // bit0: echo field, bit1: CSA, bit2-7: Reserved. - 0x02, // Selected schemes: scheme 1. - 0x01, // Selected curve25519 - 0x82 // Keys to exchange, Security2, class 1 - Security0, network key. - }; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0; - memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_challenge_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent minus the first 4 bytes. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0x00, 0x00, 0x00, 0x00, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - - // Expect Echo(KEX Report) to be sent. - uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x07, 0x02, 0x01, 0x82}; // Note: Echo flag set. - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - // Expect Net Key Report to be sent. - uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02, }; - memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); - - // Expect S2 Transfer End to be sent. - uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x80; - p_mock->output_arg[1].pointer = m_test_network_key_s0; - - // Expect Net Key Set to be sent. - uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; - memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); - - // Expect S2 Transfer End to be sent. - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_mem_pool[0]; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_mem_pool[1]; - - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event ; - - /** - * Test execution. - */ - struct S2 s2_context; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82, 0x01); - - uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. - memcpy(&public_key_frame[3], m_test_public_key_b, sizeof(m_test_public_key_b)); - s2_context.buf = public_key_frame; - s2_context.length = sizeof(public_key_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, NULL, 0); - - // Echo(KEX Set) frame received. - // bit0: echo field set, bit1-7: Reserved. - // Selected schemes: scheme 0 and scheme 2. - // Selected curve25519 - // Keys to exchange, Security2, class 2 - Security0, network key. - uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x03, 0x02, 0x01, 0x82}; - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_frame; - s2_context.length = sizeof(s2_net_key_get_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_frame; - s2_context.length = sizeof(s2_net_key_verify_frame); - s2_conn.class_id = 0x01; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_0_frame; - s2_context.length = sizeof(s2_net_key_get_0_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_0_frame; - s2_context.length = sizeof(s2_net_key_verify_0_frame); - s2_conn.class_id = UNIT_TEST_NETWORK_KEY; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // S2 Transfer end frame received. - // bit0: Key request complete set, - // bit1: Key verified not set, - // bit2-7: Reserved. - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - -/** Verification that the normal flow succeeds in inclusion of a new node when using SSA. - * - * It verifies the behavior as seen from an including node (Controller node) as described in SDS11274. - * - * When a node is to be included securely it is expected that a ZW_SendData is send. - * For this the common S2_send_frame(...) defined in s2.h is used, which will be implemented elsewhere. - */ -static void kex_including_node_state_machine_bad_tansfer_end(uint8_t transfer_end_code) { - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x00, // // bit 0 is echo field, bit 1 is CSA. - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test expectation setup. - * This section set up the expectations in the system when the inclusion state machine progresses: - * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. - * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. - * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. - * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. - * 5) Exchange of public keys. - * a) Public KeyB is received from joining node A. - * - Public KeyB must be pushed upwards as event to be presented to user for further verification. - * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. - * Currently that use case is outside the scope of libs2. - * - When Public KeyB is received, the controller must send its public KeyA. - * Public KeyB shall be provided by the application. - * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. - * This is done in security sub module (currently under development) - * - The security context must be re-initialized with temporary derived key. - * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. - * 6) Echoing of KEX frames. - * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be - * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). - * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. - * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. - * 7) Network key exchange: - * a) Joining node will request the network key, by sending a 'Network Key Get'. - * b) Including node shall reply with a 'Network Key Set'. - * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' - * - Including node must verify that it can succesfully decrypt the message using the key. - * d) Including node shall reply with a 'Transfer End'. - * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. - * - */ - mock_t * p_mock; - - // Expect a S2 KEX Get to be sent. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x00; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, - 0x00, // bit0: echo field, bit1-7: Reserved. - 0x02, // Selected schemes: scheme 1. - 0x01, // Selected curve25519 - 0x82 // Keys to exchange, Security2, class 1 - Security0, network key. - }; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_obfuscated_public_key_b); - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_challenge_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - - // Expect Echo(KEX Report) to be sent. - uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; // Note: Echo flag set. - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - // Expect Net Key Report to be sent. - uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02, }; - memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); - - // Expect S2 Transfer End to be sent. - uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x80; - p_mock->output_arg[1].pointer = m_test_network_key_s0; - - // Expect Net Key Set to be sent. - uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; - memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); - - // Expect S2 Transfer End to be sent. - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - // Expect that we send a KEX fail - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - uint8_t S2_kex_fail_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x09}; - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_fail_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x9; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event ; - - /** - * Test execution. - */ - struct S2 s2_context; - s2_conn.l_node = 1; - s2_conn.l_node = 2; - s2_conn.class_id = 0xFF; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82, 0x00); - - uint8_t public_key_frame[3 + sizeof(m_test_obfuscated_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. - memcpy(&public_key_frame[3], m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); - s2_context.buf = public_key_frame; - s2_context.length = sizeof(public_key_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // This should ensure the full public key is available. - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); - TEST_ASSERT_EQUAL_UINT8_ARRAY(s2_context.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - // Echo(KEX Set) frame received. - // bit0: echo field set, bit1-7: Reserved. - // Selected schemes: scheme 0 and scheme 2. - // Selected curve25519 - // Keys to exchange, Security2, class 2 - Security0, network key. - uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; - - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_frame; - s2_context.length = sizeof(s2_net_key_get_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_frame; - s2_context.length = sizeof(s2_net_key_verify_frame); - s2_conn.class_id = 0x01; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_0_frame; - s2_context.length = sizeof(s2_net_key_get_0_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_0_frame; - s2_context.length = sizeof(s2_net_key_verify_0_frame); - s2_conn.class_id = UNIT_TEST_NETWORK_KEY; - s2_inclusion_post_event(&s2_context, &s2_conn); - - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, transfer_end_code}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - -void test_kex_including_node_state_machine_bad_tansfer_end2(uint8_t transfer_end_code) { - // S2 Transfer end frame received. - // bit0: Key request complete not set, - // bit1: Key verified set, - // bit2-7: Reserved. - kex_including_node_state_machine_bad_tansfer_end(2); -} - -void test_kex_including_node_state_machine_bad_tansfer_end3(uint8_t transfer_end_code) { - // S2 Transfer end frame received. - // bit0: Key request complete set, - // bit1: Key verified set, - // bit2-7: Reserved. - kex_including_node_state_machine_bad_tansfer_end(3); -} - - -void test_kex_including_node_state_machine_ssa(void) { - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x00, // // bit 0 is echo field, bit 1 is CSA. - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test expectation setup. - * This section set up the expectations in the system when the inclusion state machine progresses: - * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. - * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. - * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. - * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. - * 5) Exchange of public keys. - * a) Public KeyB is received from joining node A. - * - Public KeyB must be pushed upwards as event to be presented to user for further verification. - * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. - * Currently that use case is outside the scope of libs2. - * - When Public KeyB is received, the controller must send its public KeyA. - * Public KeyB shall be provided by the application. - * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. - * This is done in security sub module (currently under development) - * - The security context must be re-initialized with temporary derived key. - * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. - * 6) Echoing of KEX frames. - * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be - * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). - * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. - * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. - * 7) Network key exchange: - * a) Joining node will request the network key, by sending a 'Network Key Get'. - * b) Including node shall reply with a 'Network Key Set'. - * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' - * - Including node must verify that it can succesfully decrypt the message using the key. - * d) Including node shall reply with a 'Transfer End'. - * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. - * - */ - mock_t * p_mock; - - // Expect a S2 KEX Get to be sent. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x00; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, - 0x00, // bit0: echo field, bit1-7: Reserved. - 0x02, // Selected schemes: scheme 1. - 0x01, // Selected curve25519 - 0x82 // Keys to exchange, Security2, class 1 - Security0, network key. - }; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_obfuscated_public_key_b); - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_challenge_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - - // Expect Echo(KEX Report) to be sent. - uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; // Note: Echo flag set. - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - // Expect Net Key Report to be sent. - uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02, }; - memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); - - // Expect S2 Transfer End to be sent. - uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x80; - p_mock->output_arg[1].pointer = m_test_network_key_s0; - - // Expect Net Key Set to be sent. - uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; - memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); - - // Expect S2 Transfer End to be sent. - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event ; - - /** - * Test execution. - */ - struct S2 s2_context; - s2_conn.l_node = 1; - s2_conn.l_node = 2; - s2_conn.class_id = 0xFF; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82, 0x00); - - uint8_t public_key_frame[3 + sizeof(m_test_obfuscated_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. - memcpy(&public_key_frame[3], m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); - s2_context.buf = public_key_frame; - s2_context.length = sizeof(public_key_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // This should ensure the full public key is available. - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); - TEST_ASSERT_EQUAL_UINT8_ARRAY(s2_context.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - // Echo(KEX Set) frame received. - // bit0: echo field set, bit1-7: Reserved. - // Selected schemes: scheme 0 and scheme 2. - // Selected curve25519 - // Keys to exchange, Security2, class 2 - Security0, network key. - uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; - - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_frame; - s2_context.length = sizeof(s2_net_key_get_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_frame; - s2_context.length = sizeof(s2_net_key_verify_frame); - s2_conn.class_id = 0x01; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_0_frame; - s2_context.length = sizeof(s2_net_key_get_0_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_0_frame; - s2_context.length = sizeof(s2_net_key_verify_0_frame); - s2_conn.class_id = UNIT_TEST_NETWORK_KEY; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // S2 Transfer end frame received. - // bit0: Key request complete set, - // bit1: Key verified not set, - // bit2-7: Reserved. - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - -/** Verification that the normal flow succeeds when send done is succesful. - * - */ -void test_kex_including_node_sond_complete(void) { -// uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. -// 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, -// 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, -// 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; -// -// uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. -// 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, -// 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, -// 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; -// - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x00, // bit 0 is echo field, rest are reserved - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - mock_call_use_as_stub(TO_STR(s2_event_handler)); - mock_call_use_as_stub(TO_STR(S2_send_data)); - mock_call_use_as_stub(TO_STR(S2_send_frame)); - mock_call_use_as_stub(TO_STR(s2_keystore_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test execution. - */ - struct S2 s2_context; - s2_conn.l_node = 1; - s2_conn.r_node = 2; - s2_conn.class_id = 0xFF; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_KEX_REPORT, s2_context.inclusion_state); - - // KEX Report frame received. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_KEY_USER_ACCEPT, s2_context.inclusion_state); - - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_PUB_KEY_B, s2_context.inclusion_state); - - uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. - memcpy(&public_key_frame[3], m_test_public_key_b, sizeof(m_test_public_key_b)); - s2_context.buf = public_key_frame; - s2_context.length = sizeof(public_key_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_USER_ACCEPT, s2_context.inclusion_state); - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); - TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_ECHO_KEX_SET, s2_context.inclusion_state); - - // Echo(KEX Set) frame received. - // bit0: echo field set, bit1-7: Reserved. - // Selected schemes: scheme 0 and scheme 2. - // Selected curve25519 - // Keys to exchange, Security2, class 2 - Security0, network key. - uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_NET_KEY_GET, s2_context.inclusion_state); - - // Network Key Get frame received. - uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_frame; - s2_context.length = sizeof(s2_net_key_get_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_NET_KEY_VERIFY, s2_context.inclusion_state); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_frame; - s2_context.length = sizeof(s2_net_key_verify_frame); - s2_conn.class_id = 0x01; - s2_inclusion_post_event(&s2_context, &s2_conn); - TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_NET_KEY_GET, s2_context.inclusion_state); - - // Network Key Get frame received. - uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_0_frame; - s2_context.length = sizeof(s2_net_key_get_0_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_NET_KEY_VERIFY, s2_context.inclusion_state); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_0_frame; - s2_context.length = sizeof(s2_net_key_verify_0_frame); - s2_conn.class_id = UNIT_TEST_NETWORK_KEY; - s2_inclusion_post_event(&s2_context, &s2_conn); - TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_TRANSFER_END, s2_context.inclusion_state); - - // S2 Transfer end frame received. - // bit0: Key request complete set, - // bit1: Key verified not set, - // bit2-7: Reserved. - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - TEST_ASSERT_EQUAL_UINT8(S2_INC_IDLE, s2_context.inclusion_state); - - mock_calls_verify(); -} - -/** Test case for ensuring correct timer handling during inclusion. - * - * Purpose: In order to ensure correct inclusion flow and avoid deadlock during inclusion it is - * important that in case messages are never received during inclusion, then the state - * machine must return to idle a push a corresponding event. - * - * Not to test: This test case will only verify expectations related to the timer handling. - * Thus content of frames sent between the nodes during inclusion are not - * relevant for this test as they are verified in: test_kex_including_node_state_machine() - * NOTE: messages related to Timeout will be verified in this test. - */ -void test_kex_inclusion_timer_handling(void) { - mock_t * p_mock; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(S2_send_frame)); - mock_call_use_as_stub(TO_STR(S2_send_data)); - mock_call_use_as_stub(TO_STR(s2_event_handler)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(s2_keystore_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - s2_conn.l_node = 1; - s2_conn.r_node = 2; - s2_conn.class_id = 0xFF; - - /** Timer start expected on every transmitted frame. - * For flow chart, see SDS11274. - * Timer values: - * - TA1, TA2, TA4, TA5, TA6, TA7, TA : 10s - * - TA3 : 20s - * - TAI1, TAI2 : 240s - */ - - // When initiating the secure inclusion of node B, then we expect a Timer Start call. - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 1000; - p_mock->return_code.value = 1; - - // When receiving next frame we expect the timer to be stopped. - mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); - - // After pushing up the event with requested keys, then we expect a reset of the timer with 240s for user input. - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 24000; - p_mock->return_code.value = 1; - - // After user acceptance we expect the timer to be stopped. - mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); - - // After transmitting KEX Set we expect a reset of the timer. - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 1000; - p_mock->return_code.value = 1; - - // When receiving next frame we expect the timer to be stopped. - mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); - - // After transmitting Public Key and pushing event upwards with received public key we expect a reset of the timer. - // Timeout is 240s for the user to provide the missing part of the DSK. - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 24000; - p_mock->return_code.value = 1; - - // After receiving the echo Kex set we expect the timer to be stopped. - mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); - - // After transmitting echo(KEX Report) we expect a reset of the timer. - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 1000; - p_mock->return_code.value = 1; - - // When receiving next frame (Net Key Get) we expect the timer to be stopped. - mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); - - // After transmitting Network Key Set we expect a reset of the timer. - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 1000; - p_mock->return_code.value = 1; - - // When receiving next frame (Net Key Verify, key 0x02) we expect the timer to be stopped. - mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); - - // After transmitting Transfer End we expect a reset of the timer. - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 1000; - p_mock->return_code.value = 1; - - // When receiving next frame (Net Key Get) we expect the timer to be stopped. - mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); - - // After transmitting Network Key Set we expect a reset of the timer. - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 1000; - p_mock->return_code.value = 1; - - // When receiving next frame (Net Key Verify, key 0x80) we expect the timer to be stopped. - mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); - - // After transmitting Transfer End we expect a reset of the timer. - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 1000; - p_mock->return_code.value = 1; - - // When receiving the final transfer end frame we expect the timer to be stopped. - mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context, &s2_conn); - - helper_func_kex_report_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); - - helper_func_echo_kex_set_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_get_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_verify_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_get_frame(&s2_context, 0x80); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_verify_frame(&s2_context, 0x80); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_transfer_end_final_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - - -/** Test case for ensuring correct timer handling on timeout during inclusion in case a timeout - * occurs after sending KEX Get. - * - * Purpose: In order to ensure correct inclusion flow and avoid deadlock during inclusion it is - * important that in case messages are never received during inclusion, then the state - * machine must return to idle and push a corresponding event. - * - * Test: This test case will verify expectations related to the timer handling. - * If a joining node does not respond within the timeout to a S2 inclusion frame then the - * state machine must return to idle and push the corresponding event upwards to application. - * After timeout, we expect the system to retry node inclusion. - * - */ -void test_kex_inclusion_timeout_kex_get_with_retry(void) { - mock_t * p_mock; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - - mock_calls_clear(); - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - - /** Timer start expected on every transmitted frame. - * For flow chart, see SDS11274. - * Timer values: - * - TA1, TA2, TA4, TA5, TA6, TA7, TA : 10s - * - TA3 : 20s - * - TI1 : 240s - */ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // When initiating the secure inclusion of node B, then we expect a Timer Start call. - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 1000; - p_mock->return_code.value = 1; - - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // When the secure inclusion fails we expect any inclusion timers to be stopped. - mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); - - // After receiving a timeout it is expected that the inclusion state machine is back in idle and - // that we can initiate a new inclusion which will also trigger a new set timeout call. - uint8_t S2_kex_get_frame_retry[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame_retry; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame_retry); - - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 1000; - p_mock->return_code.value = 1; - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - s2_inclusion_notify_timeout(&s2_context); - - // Retry node inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - mock_calls_verify(); -} - - -/** Test case for ensuring correct timer handling on timeout during inclusion in case a timeout - * occurs after sending KEX Set. - * - * Purpose: In order to ensure correct inclusion flow and avoid deadlock during inclusion it is - * important that in case messages are never received during inclusion, then the state - * machine must return to idle and push a corresponding event. - * - * Test: This test case will verify expectations related to the timer handling. - * If a joining node does not respond within the timeout to a S2 inclusion frame then the - * state machine must return to idle and push the corresponding event upwards to application. - * After timeout, we expect the system to retry node inclusion. - * - */ -void test_kex_inclusion_timeout_kex_set_with_retry(void) { - mock_t * p_mock; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // After receiving a timeout it is expected that the inclusion state machine is back in idle and - // that we can initiate a new inclusion. - uint8_t S2_kex_get_frame_retry[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame_retry; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame_retry); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received. - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x02, 0x01, 0x82}; // Scheme 1, curve25519, S2, key 1, and S0 network key. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - - // Trigger a timeout. - s2_inclusion_notify_timeout(&s2_context); - - // Retry node inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - mock_calls_verify(); -} - -/** Test case for ensuring correct timer handling on timeout during inclusion in case a timeout - * occurs after any state. - * - * Purpose: In order to ensure correct inclusion flow and avoid deadlock during inclusion it is - * important that in case messages are never received during inclusion, then the state - * machine must return to idle and push a corresponding event. - * - * Test: This test case will verify expectations related to the timer handling. - * If a joining node does not respond within the timeout to a S2 inclusion frame then the - * state machine must return to idle and push the corresponding event upwards to application. - * After timeout, we expect the system to retry node inclusion. - * As this test case must covers timeout in ANY state, it will loop over the expectations and - * decrement a counter to go one step further on each loop. - * - */ -#define NO_OF_STATES 6 -void test_kex_inclusion_timeout_all_states(void) { - mock_t * p_mock; - uint32_t i; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - helper_func_init_s2_conn(); - - /** The loop which will set up the expectation based on the round. */ - for (i = 0; i < NO_OF_STATES; i++) - { - // Expect a S2 KEX Get to be sent. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - if (i == 0){ - helper_func_restore_keys_expect(); - - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Trigger a timeout. - s2_inclusion_notify_timeout(&s2_context); - continue; // if first iteration, continue here to test timeout for timeout. - } - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - helper_func_kex_report_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - - if (i == 1) - { - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - helper_func_restore_keys_expect(); - - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Trigger a timeout. - s2_inclusion_notify_timeout(&s2_context); - continue; // if second iteration, break here to test timeout for timeout. - } - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); - - if (i == 2){ - helper_func_restore_keys_expect(); - - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Trigger a timeout. - s2_inclusion_notify_timeout(&s2_context); - continue; // if third iteration, break here to test timeout for timeout. - } - - // Expect Echo(KEX Report) to be sent. - uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - helper_func_echo_kex_set_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - if (i == 3){ - helper_func_restore_keys_expect(); - - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Trigger a timeout. - s2_inclusion_notify_timeout(&s2_context); - continue; // if fourth iteration, break here to test timeout for timeout. - } - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - // Expect Net Key Set to be sent. - static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; - memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); - - helper_func_net_key_get_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - if (i == 4){ - helper_func_restore_keys_expect(); - - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Trigger a timeout. - s2_inclusion_notify_timeout(&s2_context); - continue; // if fifth iteration, break here to test timeout for timeout. - } - - // Expect S2 Transfer End to be sent. - static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - helper_func_net_key_verify_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - if (i == 5){ - helper_func_restore_keys_expect(); - - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Trigger a timeout. - s2_inclusion_notify_timeout(&s2_context); - continue; // if sixth iteration, break here to test timeout for timeout. - } - } - - // After receiving a timeout it is expected that the inclusion state machine is back in idle and - // that we can initiate a new inclusion which will also trigger a new set timeout call. - static uint8_t S2_kex_get_frame_retry[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame_retry; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame_retry); - - // At final stage retry node inclusion to ensure we are in idle stage. - s2_inclusion_including_start(&s2_context,&s2_conn); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling when frames are received in wrong order during inclusion. - * This could either be implementation error or more critical, someone trying to find weakness in - * the system. Therefore the system must silently return to idle. - * - * An error should still be returned upwards to the application. - */ -void test_kex_inclusion_invalid_frame_order_all_states(void) { - mock_t * p_mock; - uint32_t i; - static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - /** The loop which will set up the expectation based on the round. */ - for (i = 0; i < NO_OF_STATES; i++) - { - // Expect a S2 KEX Get to be sent. - static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - if (i == 0){ - // The invalid frame. - uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; - - helper_func_restore_keys_expect(); - - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Let's try to directly fetch a network key. - memcpy((uint8_t *)s2_context.buf, s2_frame, sizeof(s2_frame)); - s2_context.length = sizeof(s2_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - //s2_context.buf = frame_buffer; // Reset buffer back. - continue; // if first iteration, continue here to test timeout for timeout. - } - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - helper_func_kex_report_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - - if (i == 1) - { - // The invalid frame - Let's send a KEX Get the opposite direction. - uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - - helper_func_restore_keys_expect(); - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Let's try to directly fetch a network key. - memcpy((uint8_t *)s2_context.buf, s2_frame, sizeof(s2_frame)); - s2_context.length = sizeof(s2_frame); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; -// s2_context.buf = frame_buffer; // Reset buffer back. - continue; // if first iteration, continue here to test timeout for timeout. - } - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0x02; - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); - - if (i == 2){ - uint8_t S2_pub_key_A_return[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - helper_func_restore_keys_expect(); - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Let's try to reply by sending back public key frame to examine behavior. - memcpy((uint8_t *)s2_context.buf, S2_pub_key_A_return, sizeof(S2_pub_key_A_return)); - s2_context.length = sizeof(S2_pub_key_A_return); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_context.buf = frame_buffer; // Reset buffer back. - continue; // if first iteration, continue here to test timeout for timeout. - } - - // Expect Echo(KEX Report) to be sent. - static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - helper_func_echo_kex_set_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - if (i == 3){ - // The invalid frame. - uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; - - helper_func_restore_keys_expect(); - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x07; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // When inclusion fails, we expect a KEX Fail to be sent to inclusion_peer. - uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x07}; // KEX_FAIL_AUTH = 0x05 - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); - - // Let's try to check what happens if we intercept and try to restart secure inclusion by - // sending a KEX Report. Will we be accepted ? - memcpy((uint8_t *)s2_context.buf, s2_frame, sizeof(s2_frame)); - s2_context.length = sizeof(s2_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - //s2_context.buf = frame_buffer; // Reset buffer back. - - s2_inclusion_send_done(&s2_context, 1); - - continue; // if first iteration, continue here to test timeout for timeout. - } - - // Expect Net Key Set to be sent. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; - memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); - - helper_func_net_key_get_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - if (i == 4){ - // Go to transfer end without verifying the key. - uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - - helper_func_restore_keys_expect(); - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - memcpy((uint8_t *)s2_context.buf, s2_frame, sizeof(s2_frame)); - s2_context.length = sizeof(s2_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - continue; // if fifth iteration, break here to test timeout for timeout. - } - - // Expect S2 Transfer End to be sent. - static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - helper_func_net_key_verify_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - if (i == 5){ - // Retry the echo to see if we can get further back in the loop than officially allowed. - // This should just be ignored as it should be considered a duplicate frame and hence ignored. - uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; - - memcpy((uint8_t *)s2_context.buf, s2_frame, sizeof(s2_frame)); - s2_context.length = sizeof(s2_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // In order to get back to idle for processing next loop of test we simply issue a transfer - // end out of the correct inclusion sequence which we force the system back to idle. - // Go to transfer end without verifying the key. - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x03}; - - helper_func_restore_keys_expect(); - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - memcpy((uint8_t *)s2_context.buf, s2_transfer_end_frame, sizeof(s2_transfer_end_frame)); - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_context.buf = frame_buffer; // Reset buffer back. - continue; - } - } - - // After receiving a timeout it is expected that the inclusion state machine is back in idle and - // that we can initiate a new inclusion which will also trigger a new set timeout call. - static uint8_t S2_kex_get_frame_retry[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame_retry; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame_retry); - - // At final stage retry node inclusion to ensure we are in idle stage. - s2_inclusion_including_start(&s2_context,&s2_conn); - - mock_calls_verify(); -} - -void test_kex_inclusion_duplicate_frame_order_all_states(void) { - mock_t * p_mock; - uint32_t i; - static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - // Expect a S2 KEX Get to be sent. - static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Echo(KEX Report) to be sent. - static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - // Expect Net Key Set to be sent. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; - memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); - - // Expect S2 Transfer End to be sent. - static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - // Expect Net Key Set to be sent. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x80; - p_mock->output_arg[1].pointer = m_test_network_key_s0; - - static uint8_t S2_net_key_set_frame_s0[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80}; - memcpy(&S2_net_key_set_frame_s0[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame_s0; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame_s0); - - // Expect S2 Transfer End to be sent. - //static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - helper_func_restore_keys_expect(); - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event ; - - /** The loop which will set up the expectation based on the round. */ - for (i = 0; i < 7; i++) - { - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - if (i == 0) - continue; - helper_func_kex_report_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - if (i == 1) - { - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - continue; // if first iteration, continue here to test timeout for timeout. - } - - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - if (i == 2){ - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); - continue; - } - - helper_func_echo_kex_set_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - if (i == 3) - continue; - - helper_func_net_key_get_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - if (i == 4) - continue; - - helper_func_net_key_verify_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_get_frame(&s2_context, 0x80); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_verify_frame(&s2_context, 0x80); - s2_inclusion_post_event(&s2_context, &s2_conn); - - if (i == 5) - continue; - - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - } - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case the node is not supporting - * mandatory schemes, or the schemes supported are not supported by the controller. - * - * Purpose: In order to ensure a node can be correctly included there must be a match between the - * schemes supported by both inclusion and joining node. If this cannot be established - * between the node, then it must be ensured that appropriate failure is returned. - * - * Test: This test case will in case the following schemes are received from joining node as - * supported then a KEX_FAIL_SCHEME is returned. - */ -void test_kex_inclusion_error_schemes(void) { - mock_t * p_mock; - uint32_t i; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - uint8_t s2_kex_report_frame[6]; - struct S2 s2_context; - - uint8_t scheme_scheme_fail_test_vector[][2] = { - {0x00, 0x00}, // Scheme 2 = false, scheme 0 = false, key request don't care. This should return FAIL_KEY_REPORT. - {0x01, 0x80}, // Scheme 2 = false, scheme 0 = true, key request don't care. This should return FAIL_KEY_REPORT. - }; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - for (i = 0; i < ELEM_COUNT(scheme_scheme_fail_test_vector); i++) - { - - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // Expect a S2 KEX Fail as the including node received an unsupported combination of security schemes. - uint8_t S2_kex_set_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x02}; // KEX_FAIL_KEX_SCHEME = 0x02 - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_error_frame); - - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x02; // KEX_FAIL_KEX_SCHEME Scheme failure indicating that no scheme is supported by controller or joining node specified an invalid scheme. - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - With an unsupported scheme set. - s2_kex_report_frame[0] = COMMAND_CLASS_SECURITY_2; - s2_kex_report_frame[1] = KEX_REPORT; - s2_kex_report_frame[2] = 0x00, // bit 0 is echo field, rest are reserved - s2_kex_report_frame[3] = scheme_scheme_fail_test_vector[i][0]; // Supported schemes. - s2_kex_report_frame[4] = 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - s2_kex_report_frame[5] = scheme_scheme_fail_test_vector[i][1]; // Requested keys bit. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_send_done(&s2_context, 1); - } - - // Retry node inclusion. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case the node is not supporting - * curve 25519, or other curves requested are not (yet) supported by the controller. - * - * Purpose: In order to ensure a node can be correctly included there must be a match between the - * curves supported by both inclusion and joining node. If the curve supported by joining - * node is not matching a curve on inclusion node a failure is returned. - * - * Test: This test case will a KEX_FAIL_CURVE is returned when invalid set of schemes is requested. - */ -void test_kex_inclusion_error_curves(void) { - mock_t * p_mock; - zwave_event_t * p_expected_event; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - - uint8_t S2_kex_set_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x03}; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // Expect a S2 KEX Fail as the including node is not supporting curve 25519, or other curves requested are not (yet) supported by the controller - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_error_frame); - - p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x03; // KEX_FAIL_KEX_CURVES Curve failure indicating that no curve is supported by controller or joining node specified an invalid curve. - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - Unknown curve set. - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x00, // bit 0 is echo field, rest are reserved - 0x02, // Supported schemes. Scheme 1. - 0x02, // Supported ECDH Profiles, bit1=1 is unknown cureve value. - 0x01}; // Requested keys bit0=Security2 Class 0 key. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_send_done(&s2_context, 1); - - // Retry node inclusion. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case there is an invalid combination - * of scheme support and key request. - * - * Purpose: In order to ensure a node can be correctly included there must be a match between the - * schemes supported by both inclusion and joining node and the request for keys to exchange. - * - * Test: This test case will a KEX_FAIL_KEY is returned when invalid set of schemes/keys is requested. - */ -void test_kex_inclusion_error_keys(void) { - uint32_t i; - mock_t * p_mock; - zwave_event_t * p_expected_event; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - uint8_t s2_kex_report_frame[6]; - struct S2 s2_context; - - uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x01}; // KEX_FAIL_KEX_KEY = 0x01 - uint8_t scheme_key_request_fail_test_vector[] = { - 0x00, // key request S2 = no, key request S0 = no. This should return FAIL_KEY_REPORT. - }; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - for (i = 0; i < ELEM_COUNT(scheme_key_request_fail_test_vector); i++) - { - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // Expect a S2 KEX Fail as the case there is an invalid combination of scheme support and key request. - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); - - p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x01; // KEX_FAIL_KEX_KEY Key failure indicating that no match exists between requested/granted keys in the network. - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - Invalid mix of schemes and keys. - s2_kex_report_frame[0] = COMMAND_CLASS_SECURITY_2; - s2_kex_report_frame[1] = KEX_REPORT; - s2_kex_report_frame[2] = 0x00, // bit 0 is echo field, rest are reserved - s2_kex_report_frame[3] = 0x02; // Supported schemes. - s2_kex_report_frame[4] = 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - s2_kex_report_frame[5] = scheme_key_request_fail_test_vector[i]; // Requested keys bit. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_send_done(&s2_context, 1); - } - - // Retry node inclusion. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in all cases when there is a valid combination - * of scheme support and key request. - * - * Purpose: In order to ensure a node can be correctly included there must be a match between the - * schemes supported by both inclusion and joining node and the request for keys to exchange. - * - * Test: This test case will ensure a KEX Set is transmitted when a valid set of schemes/keys is requested. - */ -void test_kex_inclusion_valid_keys(void) { - uint32_t i; - mock_t * p_mock; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - uint8_t s2_kex_report_frame[6]; - struct S2 s2_context; - - uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; // Scheme 0 and 2, curve25519, S2, key 2, and S0 network key. - - // Double array, each row is a test, first two bytes in column is received frame, second two bytes are the expected output. - uint8_t scheme_key_request_pass_test_vector[][4] = { - {0x02, 0x01, 0x02, 0x01}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. - {0x02, 0x02, 0x02, 0x02}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. - {0x02, 0x03, 0x02, 0x03}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. - {0x02, 0x04, 0x02, 0x04}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. - {0x02, 0x05, 0x02, 0x05}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. - {0x02, 0x06, 0x02, 0x06}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. - {0x02, 0x07, 0x02, 0x07}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. - {0x02, 0x80, 0x02, 0x80}, // Scheme 1 = true, key request S2 = no, key request S0 = yes. Valid request. - {0x02, 0x81, 0x02, 0x81}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. - {0x02, 0x82, 0x02, 0x82}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. - {0x02, 0x83, 0x02, 0x83}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. - {0x02, 0x84, 0x02, 0x84}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. - {0x02, 0x85, 0x02, 0x85}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. - {0x02, 0x86, 0x02, 0x86}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. - {0x02, 0x87, 0x02, 0x87}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. - }; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(s2_event_handler)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_public_key_read)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - for (i = 0; i < ELEM_COUNT(scheme_key_request_pass_test_vector); i++) - { - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - S2_kex_set_frame[3] = scheme_key_request_pass_test_vector[i][2]; - S2_kex_set_frame[5] = scheme_key_request_pass_test_vector[i][3]; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - Valid mix of schemes and keys. - s2_kex_report_frame[0] = COMMAND_CLASS_SECURITY_2; - s2_kex_report_frame[1] = KEX_REPORT; - s2_kex_report_frame[2] = 0x00, // bit 0 is echo field, rest are reserved - s2_kex_report_frame[3] = scheme_key_request_pass_test_vector[i][0]; // Supported schemes. - s2_kex_report_frame[4] = 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - s2_kex_report_frame[5] = scheme_key_request_pass_test_vector[i][1]; // Requested keys bit. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, scheme_key_request_pass_test_vector[i][3],0); // Granted keys. - - // Inject a timeout to ensure state goes back to idle so we can test next combination. - s2_inclusion_notify_timeout(&s2_context); - } - // Retry node inclusion. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case the joining node is - * requesting more keys than what was granted in KEX Set - * - * Purpose: In order to ensure a node can be correctly included there must be a match between the - * Key granted in KEX Set and the keys requested during key exchange. - * - * Test: This test case will ensure a KEX_FAIL_KEY_GET is returned when non granted key is requested. - */ -void test_kex_inclusion_error_key_get_request(void) { - uint32_t i; - mock_t * p_mock; - zwave_event_t * p_expected_event; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x00, 0x01, 0x00}; - uint8_t s2_echo_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x00, 0x01, 0x00}; - uint8_t s2_net_key_get_frame[6] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x00}; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - struct S2 s2_context; - - uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x08}; // KEX_FAIL_KEY_GET = 0x08 - - // Double array, each row is a test, first two bytes in column is reported/granted keys, third byte is the requested key. - uint8_t key_get_request_fail_test_vector[][3] = { - {0x02, 0x01, 0x02}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 1. - {0x02, 0x01, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. - {0x02, 0x01, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. - {0x02, 0x02, 0x01}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 0. - {0x02, 0x02, 0x04}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 2. - {0x02, 0x02, 0x08}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class x. - {0x02, 0x02, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. - {0x02, 0x03, 0x04}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 2. - {0x02, 0x03, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class x. - {0x02, 0x03, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. - {0x02, 0x04, 0x01}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 0. - {0x02, 0x04, 0x02}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 1. - {0x02, 0x04, 0x08}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class x. - {0x02, 0x04, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. - {0x02, 0x05, 0x02}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 1. - {0x02, 0x05, 0x08}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class x. - {0x02, 0x05, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. - {0x02, 0x06, 0x01}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 1. - {0x02, 0x06, 0x08}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class x. - {0x02, 0x06, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. - {0x02, 0x07, 0x08}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class x. - {0x02, 0x07, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. - {0x02, 0x81, 0x02}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 1. - {0x02, 0x81, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. - {0x02, 0x81, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. - {0x02, 0x82, 0x01}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 0. - {0x02, 0x82, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. - {0x02, 0x82, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. - {0x02, 0x84, 0x01}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 0. - {0x02, 0x84, 0x02}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 1. - {0x02, 0x84, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. - {0x02, 0x85, 0x02}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 1. - {0x02, 0x85, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. - {0x02, 0x86, 0x01}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 0. - {0x02, 0x86, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. - {0x02, 0x81, 0x02}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 1. - {0x02, 0x81, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. - {0x02, 0x82, 0x01}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 0. - {0x02, 0x82, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. - {0x02, 0x83, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. - {0x02, 0x83, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. - {0x02, 0x87, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. - - - - {0x02, 0x83, 0x10}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. - {0x02, 0x83, 0x20}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. - {0x02, 0x83, 0x40}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. - }; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - for (i = 0; i < ELEM_COUNT(key_get_request_fail_test_vector); i++) - { - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = key_get_request_fail_test_vector[i][1]; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - helper_func_kex_set_frame_expect(key_get_request_fail_test_vector[i][0], 0x01, - key_get_request_fail_test_vector[i][1]); - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; -// p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.security_keys = key_get_request_fail_test_vector[i][1]; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = key_get_request_fail_test_vector[i][1]; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = ((key_get_request_fail_test_vector[i][1] & 0x06)?2:0); - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - helper_func_echo_kex_report_frame_expect(key_get_request_fail_test_vector[i][0], 0x01, - key_get_request_fail_test_vector[i][1]); - - // Expect a S2 KEX Fail as the the joining node is requesting more keys than what was granted in KEX Set - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); - - p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x08; //KEX_FAIL_KEY_GET The joining node has requested a key, which was not granted by the including node at an earlier stage - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - Valid mix of schemes and keys. - s2_kex_report_frame[3] = key_get_request_fail_test_vector[i][0]; // Supported schemes. - s2_kex_report_frame[5] = key_get_request_fail_test_vector[i][1]; // Requested keys bit. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, key_get_request_fail_test_vector[i][1],0); // Granted keys. - - s2_context.buf = frame_buffer; - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); - - // KEX Echo Set frame received - Valid mix of schemes and keys. - s2_echo_kex_set_frame[3] = key_get_request_fail_test_vector[i][0]; // Supported schemes. - s2_echo_kex_set_frame[5] = key_get_request_fail_test_vector[i][1]; // Requested keys bit. - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network key get frame received - Invalid key requested. - s2_net_key_get_frame[2] = key_get_request_fail_test_vector[i][2]; // Requested key. - s2_context.buf = s2_net_key_get_frame; - s2_context.length = sizeof(s2_net_key_get_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_send_done(&s2_context, 1); - } - - // Retry node inclusion. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case the user rejects the node - * from inclusion after receiving KEX Report containing requested keys. - * - * Test: This test case will ensure a KEX_FAIL_USER_CANCEL is returned when user rejects inclusion. - */ -void test_kex_inclusion_key_grant_user_reject(void) { - mock_t * p_mock; - zwave_event_t * p_expected_event; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x02, 0x01, 0x83}; - - struct S2 s2_context; - s2_connection_t s2_conn; - uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x06}; // KEX_FAIL_CANCEL = 0x06 - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - memset(&s2_conn, 0, sizeof(s2_conn)); - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x83; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Fail as the user cancelled inclusion. - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); - - p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x06; //KEX_FAIL_CANCEL User has cancelled the S2 bootstrapping. - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - Valid mix of schemes and keys. - memcpy((uint8_t *)s2_context.buf, s2_kex_report_frame, sizeof(s2_kex_report_frame)); - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 0, 0x00,0); // Granted keys. - -// helper_func_pub_key_frame(&s2_context); -// s2_inclusion_post_event_peer(&s2_context, &s2_conn); - -// s2_inclusion_challenge_response(&s2_context, 0, 0xAABB); - - s2_inclusion_send_done(&s2_context, 1); - - // Retry node inclusion. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case the user rejects the node - * from inclusion during DSK input. - * - * Test: This test case will ensure a KEX_FAIL_USER_CANCEL is returned when user rejects inclusion. - */ -void test_kex_inclusion_user_reject(void) { - mock_t * p_mock; - zwave_event_t * p_expected_event; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x02, 0x01, 0x81}; - //uint8_t s2_echo_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x81}; - //uint8_t s2_net_key_get_frame[6] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x01}; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - struct S2 s2_context; - s2_connection_t s2_conn; - uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x06}; // KEX_FAIL_CANCEL = 0x06 - - memset(&s2_conn, 0, sizeof(s2_conn)); - s2_conn.rx_options = 0x00; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x81; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - helper_func_kex_set_frame_expect(0x02, 0x01, 0x81); - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x81; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0; - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // Expect a S2 KEX Fail as the including node received an unsupported combination of security schemes. - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); - - p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x06; //KEX_FAIL_CANCEL User has cancelled the S2 bootstrapping. - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - Valid mix of schemes and keys. - memcpy((uint8_t *)s2_context.buf, s2_kex_report_frame, sizeof(s2_kex_report_frame)); - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x81,0); // Granted keys. - - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 0, m_test_public_key_b, 2); - - s2_inclusion_send_done(&s2_context, 1); - - // Retry node inclusion. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case an echo kex set is received. - * As user has not accepted the inclusion, then the Temporary Shared Secret has not been - * established, thus receiving such a frame is an error. - */ -void test_kex_inclusion_pending_user_accept_echo_kex_set_received(void) { - mock_t * p_mock; - zwave_event_t * p_expected_event; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x02, 0x01, 0x81}; - uint8_t s2_echo_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x81}; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - struct S2 s2_context; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x81; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - helper_func_kex_set_frame_expect(0x02, 0x01, 0x81); - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x81; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0; - - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // Expect an inclusion error to be pushed upwards. - p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - Valid mix of schemes and keys. - memcpy((uint8_t *)s2_context.buf, s2_kex_report_frame, sizeof(s2_kex_report_frame)); - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x81,0); // Granted keys. - - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - // No challenge response received, anyway we receive Key get frame, which is invalid. - // s2_inclusion_challenge_response(&s2_context, 0, 0xAABB); - - // KEX Echo Set frame received - Valid mix of schemes and keys. - memcpy((uint8_t *)s2_context.buf, s2_echo_kex_set_frame, sizeof(s2_echo_kex_set_frame)); - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Retry node inclusion. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case the joining node is - * requesting more than a single key in Network Key Get request. - * - * Test: This test case will ensure a KEX_FAIL_KEY_GET is returned when more than one key is requested. - */ -void test_kex_inclusion_error_multi_key_get_request(void) { - uint32_t i; - mock_t * p_mock; - zwave_event_t * p_expected_event; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x00, 0x01, 0x00}; - uint8_t s2_echo_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x00, 0x01, 0x00}; - uint8_t s2_net_key_get_frame[6] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x00}; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - struct S2 s2_context; - - uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x08}; // KEX_FAIL_KEY_GET = 0x08 - - // Double array, each row is a test, first two bytes in column is reported/granted keys, third byte is the requested key. - uint8_t key_get_request_fail_test_vector[][3] = { - {0x02, 0x83, 0x83}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request all keys. - {0x02, 0x83, 0x03}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request all S2 keys. - {0x02, 0x83, 0x81}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - two keys. - {0x02, 0x83, 0x82}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - two keys. - }; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - //mock_call_use_as_stub(TO_STR(s2_event_handler)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - for (i = 0; i < ELEM_COUNT(key_get_request_fail_test_vector); i++) - { - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = key_get_request_fail_test_vector[i][1]; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - helper_func_kex_set_frame_expect(key_get_request_fail_test_vector[i][0], 0x01, - key_get_request_fail_test_vector[i][1]); - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; -// p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.security_keys = key_get_request_fail_test_vector[i][1]; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = key_get_request_fail_test_vector[i][1]; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = (key_get_request_fail_test_vector[i][1] & 0x06) ? 2 : 0; - - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - helper_func_echo_kex_report_frame_expect(key_get_request_fail_test_vector[i][0], 0x01, - key_get_request_fail_test_vector[i][1]); - - // Expect a S2 KEX Fail as the including node received an unsupported combination of security schemes. - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); - - p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x08; //KEX_FAIL_KEY_GET The joining node has requested a key, which was not granted by the including node at an earlier stage. - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - Valid mix of schemes and keys. - s2_kex_report_frame[3] = key_get_request_fail_test_vector[i][0]; // Supported schemes. - s2_kex_report_frame[5] = key_get_request_fail_test_vector[i][1]; // Requested keys bit. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, key_get_request_fail_test_vector[i][1],0); // Granted keys. - - s2_context.buf = frame_buffer; - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b,2 ); - - // KEX Echo Set frame received - Valid mix of schemes and keys. - s2_echo_kex_set_frame[3] = key_get_request_fail_test_vector[i][0]; // Supported schemes. - s2_echo_kex_set_frame[5] = key_get_request_fail_test_vector[i][1]; // Requested keys bit. - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network key get frame received - Invalid key requested. - s2_net_key_get_frame[2] = key_get_request_fail_test_vector[i][2]; // Requested key. - s2_context.buf = s2_net_key_get_frame; - s2_context.length = sizeof(s2_net_key_get_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_send_done(&s2_context, 1); - } - - // Retry node inclusion. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case the joining node is - * transmitting its public key with including node flag set, TO#7554. - * - * Purpose: In order to ensure correct key exchange it is important that the nodes agrees on who - * is including/joining node. - * - * Test: This test case will ensure that the state machine returns to idle as the wrong including - * bit is identical to a unexpected frame at this stages in the state machine. - */ -void test_kex_inclusion_error_public_key_including_bit(void) { - mock_t * p_mock; - zwave_event_t * p_expected_event; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x02, 0x01, 0x02}; - struct S2 s2_context; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x02; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - helper_func_kex_set_frame_expect(0x02, 0x01, 0x02); - - // When including fails we expect at call to keystore in order to restore keys. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - - p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - Valid mix of schemes and keys. - memcpy((uint8_t *)s2_context.buf, s2_kex_report_frame, sizeof(s2_kex_report_frame)); - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x02, 0); // Granted keys. - - frame_buffer[0] = COMMAND_CLASS_SECURITY_2; - frame_buffer[1] = PUBLIC_KEY_REPORT; - frame_buffer[2] = 0x01; // Including bit set (error) - memcpy(&frame_buffer[3], m_test_public_key_b, sizeof(m_test_public_key_b)); - s2_context.buf = frame_buffer; - s2_conn.class_id = 0xFF; - s2_context.length = 3 + sizeof(m_test_public_key_b); - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Retry node inclusion to ensure we are in idle state. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case the joining node is - * transmitting frames with reserved bits set (which should be ignored). - */ -void test_kex_inclusion_public_key_reserved_bits(void) { - mock_t * p_mock; - static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - // Expect a S2 KEX Get to be sent. - static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Echo(KEX Report) to be sent. - static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - // Expect Net Key Set to be sent. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; - memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); - - // Expect S2 Transfer End to be sent. - static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - // Expect Net Key Set to be sent. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x80; - p_mock->output_arg[1].pointer = m_test_network_key_s0; - - static uint8_t S2_net_key_set_frame_s0[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80}; - memcpy(&S2_net_key_set_frame_s0[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame_s0; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame_s0); - - // Expect S2 Transfer End to be sent. - //static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - helper_func_restore_keys_expect(); - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event ; - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - helper_func_kex_report_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - - frame_buffer[0] = COMMAND_CLASS_SECURITY_2; - frame_buffer[1] = PUBLIC_KEY_REPORT; - frame_buffer[2] = 0xA2; // Setting a couple of reserved bits which should be ignored on remote side. - memcpy(&frame_buffer[3], m_test_public_key_b, sizeof(m_test_public_key_b)); - s2_context.buf = frame_buffer; - s2_context.length = 3 + sizeof(m_test_public_key_b); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); - - helper_func_echo_kex_set_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_get_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_verify_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_get_frame(&s2_context, 0x80); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_verify_frame(&s2_context, 0x80); - s2_inclusion_post_event(&s2_context, &s2_conn); - - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling of node inclusion in case the joining node is - * not echo'ing KEX Set with identical fields. - * - * Purpose: In order to ensure a node can be correctly included the KEX Set and the echo KEX Set - * must be identical except for the echo flag. - * - * Test: This test case will ensure a KEX_FAIL_AUTH is returned when the echo KEX Set does not - * match the KEX Set frame. - */ -void test_kex_inclusion_error_echo_kex_set(void) { - uint32_t i; - mock_t * p_mock; - zwave_event_t * p_expected_event; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x00, 0x01, 0x00}; - uint8_t s2_echo_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x00, 0x01, 0x00}; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - struct S2 s2_context; - - uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x07}; // KEX_FAIL_AUTH = 0x07 - - // Double array, each row is a test, first two bytes in column is reported/granted keys, third and fourth bytes are hte bytes in echo KEX Set. - uint8_t key_echo_fail_test_vector[][4] = { - {0x02, 0x01, 0x02, 0x02}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x01, 0x02, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x01, 0x02, 0x04}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x01, 0x02, 0x80}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x02, 0x02, 0x01}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x02, 0x02, 0x04}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x02, 0x02, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x02, 0x02, 0x80}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - - {0x02, 0x01, 0x03, 0x01}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x02, 0x03, 0x02}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x03, 0x03, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x03, 0x72, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x03, 0xF2, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x03, 0xFA, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - - {0x02, 0x81, 0x02, 0x82}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x81, 0x02, 0x83}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x81, 0x02, 0x84}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x81, 0x02, 0x80}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x82, 0x02, 0x81}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x82, 0x02, 0x83}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x82, 0x02, 0x84}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x82, 0x02, 0x80}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x83, 0x02, 0x81}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x83, 0x02, 0x82}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x83, 0x02, 0x84}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x83, 0x02, 0x80}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x83, 0x02, 0x07}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x83, 0x02, 0x78}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x83, 0x02, 0xFF}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x83, 0x02, 0x00}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - - {0x02, 0x83, 0x7C, 0x83}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x83, 0xF3, 0x83}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - {0x02, 0x83, 0xFC, 0x83}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. - }; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - for (i = 0; i < ELEM_COUNT(key_echo_fail_test_vector); i++) - { - /**************************** - * Mock expectation section * - ****************************/ - - // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = key_echo_fail_test_vector[i][1]; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - helper_func_kex_set_frame_expect(key_echo_fail_test_vector[i][0], 0x01, - key_echo_fail_test_vector[i][1]); - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; -// p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.security_keys = key_echo_fail_test_vector[i][1]; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = key_echo_fail_test_vector[i][1]; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = (key_echo_fail_test_vector[i][1] & 0x06) ? 2 : 0; - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect a S2 KEX Fail as the including node received an unsupported combination of security schemes. - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - - p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x07; //KEX_FAIL_AUTH The Echo KEX Set/Report frame did not match the earlier exchanged frame. - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /******************* - * Testing section * - *******************/ - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received - Valid mix of schemes and keys. - s2_kex_report_frame[3] = key_echo_fail_test_vector[i][0]; // Supported schemes. - s2_kex_report_frame[5] = key_echo_fail_test_vector[i][1]; // Requested keys bit. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, key_echo_fail_test_vector[i][1],0); // Granted keys. - - s2_context.buf = frame_buffer; - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); - - // KEX Echo Set frame received - Valid mix of schemes and keys. - s2_echo_kex_set_frame[3] = key_echo_fail_test_vector[i][2]; // Wrong match supported schemes. - s2_echo_kex_set_frame[5] = key_echo_fail_test_vector[i][3]; // Wrong match requested keys bit. - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_send_done(&s2_context, 1); - } - - // Retry node inclusion. - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Test case for ensuring correct timer handling on timeout while in idle. - * - * Purpose: In order to ensure correct inclusion flow and avoid deadlock during inclusion it is - * important that in case messages are never received during inclusion, then the state - * machine must return to idle and push a corresponding event. - * - * Test: This test case will verify expectations related to the timer handling. - * If a joining node does not respond within the timeout to a S2 inclusion frame then the - * state machine must return to idle and push the corresponding event upwards to application. - * After timeout, we expect nothing to happen as we are already in idle. - * - */ -void test_kex_inclusion_timeout_when_idle(void) { - mock_t * p_mock; - uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(keystore_network_key_read)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - - // No timeout event/node inclusion failure is expected as we are already in idle. - - // After timeout we will issue a node inclusion just to insure we were in idle and that a node - // may be included after timeout. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // Trigger a timeout. - s2_inclusion_notify_timeout(&s2_context); - - // Node id (first step in inclusion) has been assigned. - // Let's initiate a secure inclusion after the timeout to verify the state of the system. - s2_inclusion_including_start(&s2_context,&s2_conn); - - mock_calls_verify(); -} - -/** Verification that the ECHO Kex report match the received frame even if only a subset of keys are granted. - */ -void test_kex_including_node_key_grant_subset(void) { - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x00, // bit 0 is echo field, rest are reserved - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x87};// Requested keys bits. Security 2 class 1, Security 0 network key. - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test expectation setup. - */ - mock_t * p_mock; - - // Expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x87; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - helper_func_kex_set_frame_expect(0x02, 0x01, 0x82); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_challenge_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - - // Expect Echo(KEX Report) to be sent. - uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x87}; // Note: Echo flag set. - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - // Expect Net Key Report to be sent. - uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02, }; - memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); - - // Expect S2 Transfer End to be sent. - uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x80; - p_mock->output_arg[1].pointer = m_test_network_key_s0; - - // Expect Net Key Set to be sent. - uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; - memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); - - // Expect S2 Transfer End to be sent. - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. - helper_func_restore_keys_expect(); - - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event ; - - /** - * Test execution. - */ - struct S2 s2_context; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82, 0); - - uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. - memcpy(&public_key_frame[3], m_test_public_key_b, sizeof(m_test_public_key_b)); - s2_context.buf = public_key_frame; - s2_context.length = sizeof(public_key_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); - - // Echo(KEX Set) frame received. - // bit0: echo field set, bit1-7: Reserved. - // Selected schemes: scheme 0 and scheme 2. - // Selected curve25519 - // Keys to exchange, Security2, class 2 - Security0, network key. - uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_frame; - s2_context.length = sizeof(s2_net_key_get_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_frame; - s2_context.length = sizeof(s2_net_key_verify_frame); - s2_conn.class_id = 0x01; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_0_frame; - s2_context.length = sizeof(s2_net_key_get_0_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_0_frame; - s2_context.length = sizeof(s2_net_key_verify_0_frame); - s2_conn.class_id = UNIT_TEST_NETWORK_KEY; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // S2 Transfer end frame received. - // bit0: Key request complete set, - // bit1: Key verified not set, - // bit2-7: Reserved. - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - -/** Verification that the in case an decryption failure is reported from the S2 protocol layer, - * that the S2 inclusion state machine transmits the corresponding error to the inclusion_peer. - */ -void test_kex_including_node_decrypt_failed(void) { - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x00, // bit 0 is echo field, rest are reserved - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. - zwave_event_t * p_expected_event; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test expectation setup. - */ - mock_t * p_mock; - - // Expect a S2 KEX Get to be sent. - helper_func_kex_get_frame_expect(); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - helper_func_kex_set_frame_expect(0x02, 0x01, 0x82); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key[0] = 0x00; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key[1] = 0x00; - memcpy(&p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key[2], &m_test_public_key_b[2], sizeof(m_test_public_key_b) - 2); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_challenge_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // When inclusion fails, we expect a KEX Fail to be sent to inclusion_peer. - uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x05}; // KEX_FAIL_DECRYPT = 0x05 - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); - - // When inclusion fails, we expect keys to be restored and a corresponding failed inclusion event from libs2. - helper_func_restore_keys_expect(); - - p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x05; //KEX_FAIL_DECRYPT Node failed to decrypt received frame. - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - /** - * Test execution. - */ - struct S2 s2_context; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - - uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00, 0x00, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. - memcpy(&public_key_frame[5], &m_test_public_key_b[2], sizeof(m_test_public_key_b) - 2); - s2_context.buf = public_key_frame; - s2_context.length = sizeof(public_key_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // A ECHO KEX Set was received, unfortunately the missing part of the DSK has not yet been - // provided by the end user, resulting in s2_inclusion_decryption_failure(...) from S2 - // protocol layer. - // This is supposed to be ignored by the state machine. - s2_inclusion_decryption_failure(&s2_context,&s2_context.inclusion_peer); - - s2_inclusion_decryption_failure(&s2_context,&s2_context.inclusion_peer); - - // User provides wrong key. - - const uint8_t wrong_key[] = {0xBB,0xCC}; - s2_inclusion_challenge_response(&s2_context, 1, wrong_key, 2); - - //The joing node's retry of A ECHO KEX Set was received, public key is set but with wrong value. - // This result in s2_inclusion_decryption_failure(...) from S2 protocol layer which should - // trigger transmission of a KEX Fail. - s2_inclusion_decryption_failure(&s2_context,&s2_context.inclusion_peer); - - s2_inclusion_send_done(&s2_context, 1); - - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -/** Verification that in case the inclusion state machine is in idle, then AUTH Failed should not - * be returned for an invalid encrypted frame. TO#06510 - */ -void test_kex_invalid_crypt_frame_idle(void) { - - mock_calls_clear(); - - /** - * Test expectation setup. - */ - - /** - * Test execution. - */ - struct S2 s2_context; - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // S2 Transfer end frame received. - // bit0: Key request complete set, - // bit1: Key verified not set, - // bit2-7: Reserved. - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_verify_idle_state(&s2_context); - - mock_calls_verify(); -} - -void test_kex_inclusion_tx_queue_full(void) { - mock_t * p_mock; - static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - // Expect a S2 KEX Get to be sent. - static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - p_mock->return_code.value = 1; - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - p_mock->return_code.value = 1; - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - p_mock->return_code.value = 1; - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Echo(KEX Report) to be sent. - static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - p_mock->return_code.value = 1; - - // Expect Net Key Set to be sent. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; - memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); - p_mock->return_code.value = 1; - - // Expect S2 Transfer End to be sent. - static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - p_mock->return_code.value = 1; - - // Expect Net Key Set to be sent. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x80; - p_mock->output_arg[1].pointer = m_test_network_key_s0; - - static uint8_t S2_net_key_set_frame_s0[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80}; - memcpy(&S2_net_key_set_frame_s0[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame_s0; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame_s0); - p_mock->return_code.value = 1; - - // Expect S2 Transfer End to be sent. - //static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - p_mock->return_code.value = 1; - - helper_func_restore_keys_expect(); - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event; - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - s2_inclusion_send_done(&s2_context, 1); - - helper_func_kex_report_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - s2_inclusion_send_done(&s2_context, 1); - - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_inclusion_send_done(&s2_context, 0); - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); - s2_inclusion_send_done(&s2_context, 1); - - helper_func_echo_kex_set_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_inclusion_send_done(&s2_context, 1); - - helper_func_net_key_get_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_inclusion_send_done(&s2_context, 1); - - helper_func_net_key_verify_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_inclusion_send_done(&s2_context, 1); - - helper_func_net_key_get_frame(&s2_context, 0x80); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_inclusion_send_done(&s2_context, 1); - - helper_func_net_key_verify_frame(&s2_context, 0x80); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_inclusion_send_done(&s2_context, 1); - - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - -/** Verification that in case the including only offers unauthenticated keys (with CSA still set) then the full public key is transmitted. - * - * Expectation: CSA is requested and accepted - * Including node sends its full public key - * Joining node sends its full public key - * Only S2 unauthenticated and S0 keys are transfered - */ -void test_kex_including_node_csa_unauthenticated_only(void) { - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x06, // bit 0 is echo field, bit 1 is CSA, bit 2 is NLS support. - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x87};// Requested keys bits. Security 2 class 1, Security 0 network key. - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test expectation setup. - * This section set up the expectations in the system when the inclusion state machine progresses: - * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. - * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. - * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. - * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. - * 5) Exchange of public keys. - * a) Public KeyB is received from joining node A. - * - Public KeyB must be pushed upwards as event to be presented to user for further verification. - * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. - * Currently that use case is outside the scope of libs2. - * - When Public KeyB is received, the controller must send its public KeyA. - * Public KeyB shall be provided by the application. - * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. - * This is done in security sub module (currently under development) - * - The security context must be re-initialized with temporary derived key. - * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. - * 6) Echoing of KEX frames. - * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be - * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). - * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. - * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. - * 7) Network key exchange: - * a) Joining node will request the network key, by sending a 'Network Key Get'. - * b) Including node shall reply with a 'Network Key Set'. - * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' - * - Including node must verify that it can succesfully decrypt the message using the key. - * d) Including node shall reply with a 'Transfer End'. - * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. - * - */ - mock_t * p_mock; - - // Expect a S2 KEX Get to be sent. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x87; - p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x01; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, - 0x02, // bit0: echo field, bit1: CSA, bit2-7: Reserved. - 0x02, // Selected schemes: scheme 1. - 0x01, // Selected curve25519 - 0x81 // Keys to exchange, Security2, class 1 - Security0, network key. - }; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x81; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0; - memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_challenge_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - - // Expect Echo(KEX Report) to be sent. - uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x07, 0x02, 0x01, 0x87}; // Note: Echo flag set. - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - // Expect Net Key Report to be sent. - uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x01, }; - memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_0, sizeof(m_test_network_key_s2_class_0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); - - // Expect S2 Transfer End to be sent. - uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x80; - p_mock->output_arg[1].pointer = m_test_network_key_s0; - - // Expect Net Key Set to be sent. - uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; - memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); - - // Expect S2 Transfer End to be sent. - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x81; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event ; - - /** - * Test execution. - */ - struct S2 s2_context; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x81, 0x01); - - uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. - memcpy(&public_key_frame[3], m_test_public_key_b, sizeof(m_test_public_key_b)); - s2_context.buf = public_key_frame; - s2_context.length = sizeof(public_key_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, NULL, 0); - - // Echo(KEX Set) frame received. - // bit0: echo field set, bit1-7: Reserved. - // Selected schemes: scheme 0 and scheme 2. - // Selected curve25519 - // Keys to exchange, Security2, class 2 - Security0, network key. - uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x03, 0x02, 0x01, 0x81}; - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x01}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_frame; - s2_context.length = sizeof(s2_net_key_get_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_frame; - s2_context.length = sizeof(s2_net_key_verify_frame); - s2_conn.class_id = 0x00; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_0_frame; - s2_context.length = sizeof(s2_net_key_get_0_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_0_frame; - s2_context.length = sizeof(s2_net_key_verify_0_frame); - s2_conn.class_id = UNIT_TEST_NETWORK_KEY; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // S2 Transfer end frame received. - // bit0: Key request complete set, - // bit1: Key verified not set, - // bit2-7: Reserved. - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - -/** Verification that in case the including disables/rejects a CSA request then the full public key is transmitted. - * - * Expectation: Including node sends its full public key - * Joining node sends its full public key - * Only S2 unauthenticated and S0 keys are transfered - */ -void test_kex_including_node_csa_disable(void) { - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x06, // bit 0 is echo field, bit 1 is CSA, bit 2 is NLS support. - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x87};// Requested keys bits. Security 2 class 1, Security 0 network key. - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test expectation setup. - * This section set up the expectations in the system when the inclusion state machine progresses: - * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. - * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. - * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. - * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. - * 5) Exchange of public keys. - * a) Public KeyB is received from joining node A. - * - Public KeyB must be pushed upwards as event to be presented to user for further verification. - * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. - * Currently that use case is outside the scope of libs2. - * - When Public KeyB is received, the controller must send its public KeyA. - * Public KeyB shall be provided by the application. - * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. - * This is done in security sub module (currently under development) - * - The security context must be re-initialized with temporary derived key. - * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. - * 6) Echoing of KEX frames. - * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be - * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). - * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. - * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. - * 7) Network key exchange: - * a) Joining node will request the network key, by sending a 'Network Key Get'. - * b) Including node shall reply with a 'Network Key Set'. - * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' - * - Including node must verify that it can succesfully decrypt the message using the key. - * d) Including node shall reply with a 'Transfer End'. - * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. - * - */ - mock_t * p_mock; - - // Expect a S2 KEX Get to be sent. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x87; - p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x01; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, - 0x00, // bit0: echo field, bit1: CSA, bit2-7: Reserved. - 0x02, // Selected schemes: scheme 1. - 0x01, // Selected curve25519 - 0x81 // Keys to exchange, Security2, class 1 - Security0, network key. - }; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x81; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0; - memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_challenge_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - - // Expect Echo(KEX Report) to be sent. - uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x07, 0x02, 0x01, 0x87}; // Note: Echo flag set. - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - // Expect Net Key Report to be sent. - uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x01, }; - memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_0, sizeof(m_test_network_key_s2_class_0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); - - // Expect S2 Transfer End to be sent. - uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x80; - p_mock->output_arg[1].pointer = m_test_network_key_s0; - - // Expect Net Key Set to be sent. - uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; - memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); - - // Expect S2 Transfer End to be sent. - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x81; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event ; - - /** - * Test execution. - */ - struct S2 s2_context; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x81, 0x00); - - uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. - memcpy(&public_key_frame[3], m_test_public_key_b, sizeof(m_test_public_key_b)); - s2_context.buf = public_key_frame; - s2_context.length = sizeof(public_key_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, NULL, 0); - - // Echo(KEX Set) frame received. - // bit0: echo field set, bit1-7: Reserved. - // Selected schemes: scheme 0 and scheme 2. - // Selected curve25519 - // Keys to exchange, Security2, class 2 - Security0, network key. - uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x81}; - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x01}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_frame; - s2_context.length = sizeof(s2_net_key_get_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_frame; - s2_context.length = sizeof(s2_net_key_verify_frame); - s2_conn.class_id = 0x00; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Get frame received. - uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. - s2_context.buf = s2_net_key_get_0_frame; - s2_context.length = sizeof(s2_net_key_get_0_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Network Key Verify frame received. - uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - s2_context.buf = s2_net_key_verify_0_frame; - s2_context.length = sizeof(s2_net_key_verify_0_frame); - s2_conn.class_id = UNIT_TEST_NETWORK_KEY; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // S2 Transfer end frame received. - // bit0: Key request complete set, - // bit1: Key verified not set, - // bit2-7: Reserved. - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - -/** Test case for ensuring correct handling when KEX fail frames are received from opposite side during inclusion. - * This could either be implementation error or more critical, someone trying to find weakness in - * the system. As an error is received from opposite side over the air, the system must silently return to idle. - * - * An error should still be returned upwards to the application including the KEX fail type of remote side. - */ -void test_kex_inclusion_kex_fail_frame_all_states(void) { - mock_t * p_mock; - uint32_t i; - static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - /** The loop which will set up the expectation based on the round. */ - for (i = 0; i < 4; i++) - { - // Expect a S2 KEX Get to be sent. - static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - helper_func_kex_report_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - - if (i == 0) - { - // The KEX Fail frame. - uint8_t s2_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, KEX_FAIL_KEX_KEY}; - - helper_func_restore_keys_expect(); - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x01; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Let's try to directly fetch a network key. - memcpy((uint8_t *)s2_context.buf, s2_error_frame, sizeof(s2_error_frame)); - s2_context.length = sizeof(s2_error_frame); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; -// s2_context.buf = frame_buffer; // Reset buffer back. - continue; // if first iteration, continue here to test timeout for timeout. - } - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); - - if (i == 1){ - // The KEX Fail frame. - uint8_t s2_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, KEX_FAIL_CANCEL}; - - helper_func_restore_keys_expect(); - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x06; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Let's try to reply by sending back public key frame to examine behavior. - memcpy((uint8_t *)s2_context.buf, s2_error_frame, sizeof(s2_error_frame)); - s2_context.length = sizeof(s2_error_frame); - s2_inclusion_post_event(&s2_context, &s2_conn); - s2_context.buf = frame_buffer; // Reset buffer back. - continue; // if first iteration, continue here to test timeout for timeout. - } - - // Expect Echo(KEX Report) to be sent. - static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - helper_func_echo_kex_set_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - if (i == 2){ - // The KEX Fail frame. - uint8_t s2_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, KEX_FAIL_AUTH}; - - helper_func_restore_keys_expect(); - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x07; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - // Let's try to check what happens if we intercept and try to restart secure inclusion by - // sending a KEX Report. Will we be accepted ? - memcpy((uint8_t *)s2_context.buf, s2_error_frame, sizeof(s2_error_frame)); - s2_context.length = sizeof(s2_error_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - //s2_context.buf = frame_buffer; // Reset buffer back. - continue; // if first iteration, continue here to test timeout for timeout. - } - - // Expect Net Key Set to be sent. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; - memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); - - helper_func_net_key_get_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - if (i == 3){ - // The KEX Fail frame. - uint8_t s2_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, KEX_FAIL_KEY_REPORT}; - - helper_func_restore_keys_expect(); - // This test will trigger a timeout to the inclusion module after which we expect to receive a - // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x0A; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - memcpy((uint8_t *)s2_context.buf, s2_error_frame, sizeof(s2_error_frame)); - s2_context.length = sizeof(s2_error_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - continue; // if fifth iteration, break here to test timeout for timeout. - } - - // Expect S2 Transfer End to be sent. - static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - helper_func_net_key_verify_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - } - - // After receiving a timeout it is expected that the inclusion state machine is back in idle and - // that we can initiate a new inclusion which will also trigger a new set timeout call. - static uint8_t S2_kex_get_frame_retry[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame_retry; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame_retry); - - // At final stage retry node inclusion to ensure we are in idle stage. - s2_inclusion_including_start(&s2_context,&s2_conn); - - mock_calls_verify(); -} - -/** - * This test verifies that a KEX_FAIL is returned in case the NET KEY VERIFY frame was wrongly encrypted with the Temp key when transmitted by the joining node. - */ -void test_kex_inclusion_net_key_verify_temp_key_encrypted_error(void) { - mock_t * p_mock; - zwave_event_t * p_expected_event; - static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - - // Expect a S2 KEX Get to be sent. - static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x07}; // KEX_FAIL_KEY_GET = 0x08 - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Echo(KEX Report) to be sent. - static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - // Expect Net Key Set to be sent. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; - memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); - - p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x07; //KEX_FAIL_AUTH The Echo KEX Set/Report frame did not match the earlier exchanged frame. - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - helper_func_restore_keys_expect(); - - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - helper_func_kex_report_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); - helper_func_echo_kex_set_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_get_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_verify_frame(&s2_context, 0x03); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_send_done(&s2_context, 1); - - mock_calls_verify(); -} - -/** - * This test verifies that a KEX_FAIL is returned in case the NET KEY VERIFY frame was wrongly encrypted with the Temp key when transmitted by the joining node. - */ -void test_kex_inclusion_net_key_verify_unencrypted_error(void) { - mock_t * p_mock; - zwave_event_t * p_expected_event; - static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; - struct S2 s2_context; - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - memset(&s2_context, 0, sizeof(s2_context)); - s2_context.inclusion_state = S2_INC_IDLE; - s2_context.buf = frame_buffer; - s2_inclusion_set_event_handler(s2_event_handler); - helper_func_init_s2_conn(); - - // Expect a S2 KEX Get to be sent. - static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; - p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; - memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_inc_req_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x07}; // KEX_FAIL_KEY_GET = 0x08 - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Echo(KEX Report) to be sent. - static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - // Expect Net Key Set to be sent. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; - memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_error_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); - - p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x07; //KEX_FAIL_AUTH The Echo KEX Set/Report frame did not match the earlier exchanged frame. - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event; - - helper_func_restore_keys_expect(); - - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - helper_func_kex_report_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x82,0); - helper_func_pub_key_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); - helper_func_echo_kex_set_frame(&s2_context); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_get_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - - helper_func_net_key_verify_frame(&s2_context, 0x00); - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_send_done(&s2_context, 1); - - mock_calls_verify(); -} - -/** Helper function sections - Start */ - -/** This helper function set up an expected KEX get frame to be send (through the mock). */ -void helper_func_kex_get_frame_expect(void) -{ - mock_t * p_mock; - // Static to keep in scope for complete test. - static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); -} - -/** This helper function set up the expectation of restoring all keys, either upon completion or error. */ -void helper_func_restore_keys_expect(void) -{ - mock_t * p_mock; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - -} - -/** This helper function set up an expected KEX set frame to be send (through the mock). - * param[in] expected_scheme Expected value for scheme field. - * param[in] expected_curves Expected value for curves field. - * param[in] expected_keys Expected value for keys field. - */ -void helper_func_kex_set_frame_expect(uint8_t expected_scheme, uint8_t expected_curves, uint8_t expected_keys) -{ - mock_t * p_mock; - static uint8_t s2_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x00, 0x00, 0x00}; - // Expect a S2 KEX Set when the scheme/key request combination was accepted. - s2_kex_set_frame[3] = expected_scheme; - s2_kex_set_frame[4] = expected_curves; - s2_kex_set_frame[5] = expected_keys; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = s2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(s2_kex_set_frame); -} - -/** This helper function set up an expected Echo KEX report frame to be send (through the mock). - * param[in] expected_scheme Expected value for scheme field. - * param[in] expected_curves Expected value for curves field. - * param[in] expected_keys Expected value for keys field. - */ -void helper_func_echo_kex_report_frame_expect(uint8_t expected_scheme, uint8_t expected_curves, uint8_t expected_keys) -{ - mock_t * p_mock; - // Expect Echo(KEX Report) to be sent. - static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x00, 0x00, 0x00}; - S2_echo_kex_report_frame[3] = expected_scheme; - S2_echo_kex_report_frame[4] = expected_curves; - S2_echo_kex_report_frame[5] = expected_keys; - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); -} - -/** This helper function constructs a KEX Report frame and update p_context */ -void helper_func_kex_report_frame(struct S2 *p_context) -{ - uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x00, // Reserved, csa off, echo off => 0x00 - 0x02, // Supported schemes, Scheme 1 = 1 => 0x02 - 0x01, // Curve25519 support => 0x01 - 0x82}; // Security2, Class 1 key = 1, Security0, Network key = 1 => 0x82 - memcpy((uint8_t *)p_context->buf, s2_frame, sizeof(s2_frame)); - p_context->length = sizeof(s2_frame); - s2_conn.class_id = 0xFF; -} - -void helper_func_pub_key_frame(struct S2 *p_context) -{ - uint8_t * p_tmp = (uint8_t *)p_context->buf; - p_tmp[0] = COMMAND_CLASS_SECURITY_2; - p_tmp[1] = PUBLIC_KEY_REPORT; - p_tmp[2] = 0x00; - memcpy(&p_tmp[3], m_test_public_key_b, sizeof(m_test_public_key_b)); - p_context->length = 3 + sizeof(m_test_public_key_b); - s2_conn.class_id = 0xFF; -} - -void helper_func_echo_kex_set_frame(struct S2 *p_context) -{ - uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; // This data must be compared to earlier sent data. As long as frames are not defined, this data is unknown. - memcpy((uint8_t *)p_context->buf, s2_frame, sizeof(s2_frame)); - p_context->length = sizeof(s2_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; -} - -void helper_func_net_key_get_frame(struct S2 *p_context, uint8_t key) -{ - uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, key}; - memcpy((uint8_t *)p_context->buf, s2_frame, sizeof(s2_frame)); - p_context->length = sizeof(s2_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; -} - - // The context must be updated to net key must be updated when S2 Network Key Set has been tranmitted. - -void helper_func_net_key_verify_frame(struct S2 *p_context, uint8_t key) -{ - uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; - memcpy((uint8_t *)p_context->buf, s2_frame, sizeof(s2_frame)); - p_context->length = sizeof(s2_frame); - switch (key) - { - case 0x00: - s2_conn.class_id = 0xFF; - break; - case 0x01: - s2_conn.class_id = 0x00; - break; - case 0x02: - s2_conn.class_id = 0x01; - break; - case 0x04: - s2_conn.class_id = 0x02; - break; - case 0x80: - s2_conn.class_id = UNIT_TEST_NETWORK_KEY; - break; - } -} - -void helper_func_transfer_end_final_frame(struct S2 *p_context) -{ - uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - memcpy((uint8_t *)p_context->buf, s2_frame, sizeof(s2_frame)); - p_context->length = sizeof(s2_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; -} - - -void helper_func_verify_idle_state(struct S2 *p_context) -{ - mock_t * p_mock; - - // No timeout event/node inclusion failure is expected as we are verifying that the system is in idle. - - // After timeout we will issue a node inclusion just to insure we were in idle and that a node - // may be included after timeout. - - if (!mock_call_used_as_stub(TO_STR(S2_send_frame), "s2_extern_mock.c")) - { - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - } - - if (!mock_call_used_as_stub(TO_STR(s2_inclusion_set_timeout), "s2_inclusion_extern_mock.c")) - { - mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->expect_arg[1].value = 1000; - p_mock->return_code.value = 1; - } - - // Node id (first step in inclusion) has been assigned. - // Let's initiate a secure inclusion after the timeout to verify the state of the system. - s2_inclusion_including_start(p_context,&s2_conn); -} - - - - - - -void kex_including_node_state_machine_no_keys(int positive_test) { - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x00, // // bit 0 is echo field, bit 1 is CSA. - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test expectation setup. - * This section set up the expectations in the system when the inclusion state machine progresses: - * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. - * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. - * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. - * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. - * 5) Exchange of public keys. - * a) Public KeyB is received from joining node A. - * - Public KeyB must be pushed upwards as event to be presented to user for further verification. - * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. - * Currently that use case is outside the scope of libs2. - * - When Public KeyB is received, the controller must send its public KeyA. - * Public KeyB shall be provided by the application. - * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. - * This is done in security sub module (currently under development) - * - The security context must be re-initialized with temporary derived key. - * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. - * 6) Echoing of KEX frames. - * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be - * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). - * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. - * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. - * 7) Network key exchange: - * a) Joining node will request the network key, by sending a 'Network Key Get'. - * b) Including node shall reply with a 'Network Key Set'. - * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' - * - Including node must verify that it can succesfully decrypt the message using the key. - * d) Including node shall reply with a 'Transfer End'. - * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. - * - */ - mock_t * p_mock; - - // Expect a S2 KEX Get to be sent. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; - p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x00; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, - 0x00, // bit0: echo field, bit1-7: Reserved. - 0x02, // Selected schemes: scheme 1. - 0x01, // Selected curve25519 - positive_test ? 0x00 : 0x82 // Keys to exchange, Security2, class 1 - Security0, network key. - }; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_obfuscated_public_key_b); - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = positive_test ? 0x00 : 0x82; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = positive_test ? 0 : 2; - memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_challenge_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - - // Expect Echo(KEX Report) to be sent. - uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; // Note: Echo flag set. - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - - // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - - if(positive_test) { - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x00; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event ; - } else { - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event ; - } - - /** - * Test execution. - */ - struct S2 s2_context; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, positive_test ? 0x00: 0x82, 0x00); - - uint8_t public_key_frame[3 + sizeof(m_test_obfuscated_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. - memcpy(&public_key_frame[3], m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); - s2_context.buf = public_key_frame; - s2_context.length = sizeof(public_key_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // This should ensure the full public key is available. - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); - TEST_ASSERT_EQUAL_UINT8_ARRAY(s2_context.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - // Echo(KEX Set) frame received. - // bit0: echo field set, bit1-7: Reserved. - // Selected schemes: scheme 0 and scheme 2. - // Selected curve25519 - // Keys to exchange, Security2, class 2 - Security0, network key. - uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, positive_test? 0x00: 0x82}; - - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // S2 Transfer end frame received. - // bit0: Key request complete set, - // bit1: Key verified not set, - // bit2-7: Reserved. - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - - -void test_kex_including_node_state_machine_no_keys_pos(void) { - kex_including_node_state_machine_no_keys(1); -} -void test_kex_including_node_state_machine_no_keys_neg(void) { - kex_including_node_state_machine_no_keys(0); -} - -static void helper_func_init_s2_conn(void) -{ - s2_conn.l_node = 1; - s2_conn.r_node = 2; - s2_conn.class_id = 0xFF; - s2_conn.rx_options = 0x00; -} - -/* Test what happens when LR end nodes request the Unauthenticated key a.k.a. SWPROT-4909 - * */ -void test_kex_including_node_LR_unauth_keys(void) { - uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - - uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, - 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; - - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x00, // // bit 0 is echo field, bit 1 is CSA. - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x03};// Requested keys bits. Request unauth and auth - - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test expectation setup. - * This section set up the expectations in the system when the inclusion state machine progresses: - * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. - * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. - * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. - * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. - * 5) Exchange of public keys. - * a) Public KeyB is received from joining node A. - * - Public KeyB must be pushed upwards as event to be presented to user for further verification. - * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. - * Currently that use case is outside the scope of libs2. - * - When Public KeyB is received, the controller must send its public KeyA. - * Public KeyB shall be provided by the application. - * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. - * This is done in security sub module (currently under development) - * - The security context must be re-initialized with temporary derived key. - * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. - * 6) Echoing of KEX frames. - * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be - * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). - * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. - * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. - * 7) Network key exchange: - * a) Joining node will request the network key, by sending a 'Network Key Get'. - * b) Including node shall reply with a 'Network Key Set'. - * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' - * - Including node must verify that it can succesfully decrypt the message using the key. - * d) Including node shall reply with a 'Transfer End'. - * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. - * - */ - mock_t * p_mock; - - // Expect a S2 KEX Get to be sent. - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. - // The operator (or including app automatically) can then respond with granted keys. - // Expect that the LR invalid key 0x01 has been filtered out by libs2. - zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; - p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; - p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x02; // 0x01 bit must be filtered out by libs2 - p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x00; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_report_event; - - // Expect a S2 KEX Set to be sent. - uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, - 0x00, // bit0: echo field, bit1-7: Reserved. - 0x02, // Selected schemes: scheme 1. - 0x01, // Selected curve25519 - 0x02 // Keys to exchange, Security2, auth. Unauth has been filtered out since it is not valid for LR - }; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_set_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); - - // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. - // Therefore we copy the key minus header frame into expected data. - zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; - p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_obfuscated_public_key_b); - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x02; - p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0x02; - memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_challenge_event; - - // When the public key is received, we expect a call to the keystore in order to obtain our public key. - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - // Expect Public KeyA to be sent. - uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, - 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; - p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); - - // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. - mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); - p_mock->output_arg[0].pointer = private_key_a; - mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); - p_mock->output_arg[0].pointer = public_key_a; - - - // Expect Echo(KEX Report) to be sent. - uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x03}; // Note: Echo flag set. - - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. - p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); - - //Expect LR Auth key to be read - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; // Just using a random key here, arg0 with the index is what matters - - // Expect Net Key Report to be sent. - uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02, }; - memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_0, sizeof(m_test_network_key_s2_class_0)); - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; - p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); - - // Expect S2 Transfer End to be sent. - uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; // 0x02 = Key Verified - mock_call_expect(TO_STR(S2_send_data), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_transfer_end_frame; - p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); - - - // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - - zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; - p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x02; - - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_complete_event ; - - /** - * Test execution. - */ - struct S2 s2_context; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_conn.l_node = 1; - s2_conn.r_node = 1000; /* LR inclusion*/ - s2_conn.class_id = 0xFF; - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // KEX Report frame received. - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x02, 0x00); - - uint8_t public_key_frame[3 + sizeof(m_test_obfuscated_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. - memcpy(&public_key_frame[3], m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); - s2_context.buf = public_key_frame; - s2_context.length = sizeof(public_key_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - // This should ensure the full public key is available. - s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); - TEST_ASSERT_EQUAL_UINT8_ARRAY(s2_context.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); - - // Echo(KEX Set) frame received. - // bit0: echo field set, bit1-7: Reserved. - // Selected schemes: scheme 0 and scheme 2. - // Selected curve25519 - // Keys to exchange, Security2, class 2. Unauth Key was not granted because it is invalid in LR. - uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x02}; - - s2_context.buf = s2_echo_kex_set_frame; - s2_context.length = sizeof(s2_echo_kex_set_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - //Inject the Net Key Get but only for LR Auth - helper_func_net_key_get_frame(&s2_context, 0x02); - s2_inclusion_post_event(&s2_context, &s2_conn); - - // Inject Net Key Verify - helper_func_net_key_verify_frame(&s2_context, 0x02); - s2_conn.class_id = 0x03; /* Slot for LR unauth key class */ - s2_inclusion_post_event(&s2_context, &s2_conn); - - // S2 Transfer end frame received. - // bit0: Key request complete set, - // bit1: Key verified not set, - // bit2-7: Reserved. - uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; - s2_context.buf = s2_transfer_end_frame; - s2_context.length = sizeof(s2_transfer_end_frame); - s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; - s2_inclusion_post_event(&s2_context, &s2_conn); - - mock_calls_verify(); -} - - - - -/* Test what happens when LR end nodes request the Unauthenticated and S0 key* */ -void test_kex_including_node_LR_unauth_s0_keys(void) -{ - mock_calls_clear(); - mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); - mock_call_use_as_stub(TO_STR(curve25519_mock.c)); - mock_call_use_as_stub(TO_STR(kderiv_mock.c)); - - // Stubbed as it is about to be removed. - mock_call_use_as_stub(TO_STR(S2_network_key_update)); - - /** - * Test expectation setup. - * This section set up the expectations in the system when the inclusion state machine progresses: - * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. - * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. - * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. - * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. - * 5) Exchange of public keys. - * a) Public KeyB is received from joining node A. - * - Public KeyB must be pushed upwards as event to be presented to user for further verification. - * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. - * Currently that use case is outside the scope of libs2. - * - When Public KeyB is received, the controller must send its public KeyA. - * Public KeyB shall be provided by the application. - * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. - * This is done in security sub module (currently under development) - * - The security context must be re-initialized with temporary derived key. - * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. - * 6) Echoing of KEX frames. - * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be - * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). - * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. - * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. - * 7) Network key exchange: - * a) Joining node will request the network key, by sending a 'Network Key Get'. - * b) Including node shall reply with a 'Network Key Set'. - * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' - * - Including node must verify that it can succesfully decrypt the message using the key. - * d) Including node shall reply with a 'Transfer End'. - * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. - * - */ - mock_t * p_mock; - - struct S2 s2_context; - - /*FIXME S2_init_ctx() bomb placed */ - - s2_conn.l_node = 1; - s2_conn.r_node = 1000; /* LR inclusion*/ - s2_conn.class_id = 0xFF; - - s2_context.inclusion_state = S2_INC_IDLE; - s2_inclusion_set_event_handler(s2_event_handler); - - // Expect a S2 KEX Get to be sent from libs2(DUT nodeid 1) to unit test (nodeid 1000). - uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_get_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); - - // Node id (first step in inclusion) has been assigned. - // Continue with secure inclusion. - s2_inclusion_including_start(&s2_context,&s2_conn); - - // Expect inclusion fail event - zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; - p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; - p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x01; - mock_call_expect(TO_STR(s2_event_handler), &p_mock); - p_mock->expect_arg[0].pointer = p_expected_event ; - - - // Expect a S2 KEX FAIL to be sent.from libs2(DUT nodeid 1) to unit test (nodeid 1000). - // And it should match following frame - uint8_t S2_kex_fail_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, - 0x01, //KEX_FAIL_KEX_KEYS - }; - mock_call_expect(TO_STR(S2_send_frame), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. - p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. - p_mock->expect_arg[2].pointer = S2_kex_fail_frame; - p_mock->expect_arg[3].value = sizeof(S2_kex_fail_frame); - - // When S2 inclusion has failed, we expect keys to be restored - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x01; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x02; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x04; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x08; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); - p_mock->expect_arg[0].value = 0x10; - p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; - - // Inject KEX REPORT from unit test - uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, - 0x00, // // bit 0 is echo field, bit 1 is CSA. - 0x02, // Supported schemes. Scheme 1. - 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. - 0x81};// Requested keys bits. Request unauth and auth - s2_context.buf = s2_kex_report_frame; - s2_context.length = sizeof(s2_kex_report_frame); - s2_conn.class_id = 0xFF; - s2_inclusion_post_event(&s2_context, &s2_conn); - - s2_inclusion_key_grant(&s2_context, 1, 0x00, 0x00); - - mock_calls_verify(); -} diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/protocol/S2.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/protocol/S2.c index 2ce5c4f66..be7d09a4e 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/protocol/S2.c +++ b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/protocol/S2.c @@ -66,6 +66,10 @@ S2_is_peernode(struct S2* p_context, const s2_connection_t* peer); #ifdef ZW_CONTROLLER static void S2_send_nls_state_set(struct S2* p_context, s2_connection_t* con, bool nls_active); static void S2_send_nls_state_get(struct S2* p_context, s2_connection_t* con); +static void S2_prepare_nls_node_list_get(uint8_t *buf, bool request); +static void S2_send_nls_node_list_get(struct S2* p_context, s2_connection_t* con, bool request); +static void S2_prepare_nls_node_list_report(uint8_t *buf, bool is_last_node, uint16_t node_id, uint8_t granted_keys, uint8_t nls_state); +static void S2_send_nls_node_list_report(struct S2* p_context, s2_connection_t* con, bool is_last_node, uint16_t node_id, uint8_t granted_keys, uint8_t nls_state); #endif /* ZW_CONTROLLER */ static void S2_send_nls_state_report(struct S2* p_context, s2_connection_t* con); static void S2_command_handler(struct S2* p_context, s2_connection_t* src, uint8_t* cmd, uint16_t cmd_length); @@ -1432,6 +1436,10 @@ static void S2_command_handler(struct S2* p_context, s2_connection_t* src, uint8 if (cmd_length == SECURITY_2_V2_NLS_STATE_GET_LENGTH) { S2_send_nls_state_report(ctxt, src); +#ifdef ZW_CONTROLLER + ctxt->delayed_transmission_flags.send_nls_node_list_get = 1; + ctxt->delayed_transmission_cache.get_nls_node_list.request = 0; // request first node +#endif } break; case NLS_STATE_SET_V2: @@ -1445,25 +1453,59 @@ static void S2_command_handler(struct S2* p_context, s2_connection_t* src, uint8 case NLS_STATE_REPORT_V2: if (cmd_length == SECURITY_2_V2_NLS_STATE_REPORT_LENGTH) { - S2_notify_nls_state_report(src->r_node, src->class_id, - cmd[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] & SECURITY_2_V2_NLS_STATE_REPORT_CAPABILITY_FIELD, - cmd[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] & SECURITY_2_V2_NLS_STATE_REPORT_STATE_FIELD); + bool capability = (cmd[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] & SECURITY_2_V2_NLS_STATE_REPORT_CAPABILITY_FIELD) ? true : false; + bool state = (cmd[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] & SECURITY_2_V2_NLS_STATE_REPORT_STATE_FIELD) ? true : false; + + if (state) { + ctxt->nls_state = 1; // There is at least one an NLS-enabled node in the network + } + S2_save_nls_state(); + + S2_notify_nls_state_report(src->r_node, src->class_id, capability, state); } break; case NLS_NODE_LIST_GET_V2: if (cmd_length == SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH) { - S2_nls_node_list_get(src->l_node, src->class_id, cmd[SECURITY_2_V2_NLS_NODE_LIST_GET_REQUEST_POS]); + bool is_last_node = false; + uint16_t node_id = 0; + uint8_t granted_keys = 0; + bool nls_state = false; + uint8_t retval; + bool request = (cmd[SECURITY_2_V2_NLS_NODE_LIST_GET_REQUEST_POS] == 1) ? true : false; + + retval = S2_get_nls_node_list(src->r_node, request, &is_last_node, &node_id, &granted_keys, &nls_state); + if (nls_state && retval == 0) { + if (S2_is_send_data_busy(ctxt)) { + ctxt->delayed_transmission_flags.send_nls_node_list_report = 1; + ctxt->delayed_transmission_cache.nls_node_report.is_last_node = (uint8_t)is_last_node; + ctxt->delayed_transmission_cache.nls_node_report.node_id = node_id; + ctxt->delayed_transmission_cache.nls_node_report.granted_keys = granted_keys; + ctxt->delayed_transmission_cache.nls_node_report.nls_state = (uint8_t)nls_state; + } else { + S2_send_nls_node_list_report(ctxt, src, is_last_node, node_id, granted_keys, nls_state); + } + } } break; case NLS_NODE_LIST_REPORT_V2: if (cmd_length == SECURITY_2_V2_NLS_NODE_LIST_REPORT_LENGTH) { - S2_nls_node_list_report(src->l_node, src->class_id, - cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_POS], - (uint16_t) (cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_MSB_POS] << 8 | cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_LSB_POS]), - cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_GRANTED_KEYS_POS], - cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NLS_STATE_POS]); + bool is_last_node = (cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_POS] & SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_FIELD) ? true : false; + bool nls_state = (cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NLS_STATE_POS] != 0) ? true : false; + + int8_t retval = S2_notify_nls_node_list_report(src->r_node, + (uint16_t)(cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_MSB_POS] << 8 | cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_LSB_POS]), + cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_GRANTED_KEYS_POS], + nls_state); + if (!is_last_node && retval == 0) { + if (S2_is_send_data_busy(ctxt)) { + ctxt->delayed_transmission_flags.send_nls_node_list_get = 1; + ctxt->delayed_transmission_cache.get_nls_node_list.request = 1; // request next node + } else { + S2_send_nls_node_list_get(ctxt, src, true); + } + } } break; #endif // ZW_CONTROLLER @@ -1612,6 +1654,51 @@ S2_fsm_post_event(struct S2* p_context, event_t e, event_data_t* d) { ctxt->fsm = IDLE; S2_post_send_done_event(ctxt, d->d.tx.status); +#ifdef ZW_CONTROLLER + if (ctxt->delayed_transmission_flags.send_nls_node_list_get && ctxt->nls_state) + { + ctxt->delayed_transmission_flags.send_nls_node_list_get = 0; + + uint8_t buf[SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH] = { 0 }; + + S2_prepare_nls_node_list_get( + buf, + ctxt->delayed_transmission_cache.get_nls_node_list.request); + + ctxt->buf = buf; + ctxt->length = sizeof(buf); + + // Clear cache + ctxt->delayed_transmission_cache.get_nls_node_list.request = 0; + + goto send_msg_state_enter; + } + + if (ctxt->delayed_transmission_flags.send_nls_node_list_report && ctxt->nls_state) + { + ctxt->delayed_transmission_flags.send_nls_node_list_report = 0; + + uint8_t buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_LENGTH] = { 0 }; + + S2_prepare_nls_node_list_report( + buf, + ctxt->delayed_transmission_cache.nls_node_report.is_last_node, + ctxt->delayed_transmission_cache.nls_node_report.node_id, + ctxt->delayed_transmission_cache.nls_node_report.granted_keys, + ctxt->delayed_transmission_cache.nls_node_report.nls_state); + + ctxt->buf = buf; + ctxt->length = sizeof(buf); + + // Clear cache + ctxt->delayed_transmission_cache.nls_node_report.is_last_node = 0; + ctxt->delayed_transmission_cache.nls_node_report.node_id = 0; + ctxt->delayed_transmission_cache.nls_node_report.granted_keys = 0; + ctxt->delayed_transmission_cache.nls_node_report.nls_state = 0; + + goto send_msg_state_enter; + } +#endif } else if (e == GOT_NONCE_REPORT && !S2_is_peernode(ctxt, d->con)) { @@ -1882,6 +1969,28 @@ S2_is_send_data_multicast_busy(struct S2* p_context) return ctxt->fsm != IDLE; } +void S2_load_nls_state(struct S2* p_context, uint8_t nls_state) +{ + CTX_DEF + ctxt->nls_state = nls_state; +} + +static void S2_send_nls_state_report(struct S2* p_context, s2_connection_t* con) +{ + CTX_DEF + + uint8_t plain_text[SECURITY_2_V2_NLS_STATE_REPORT_LENGTH] = { 0 }; + uint8_t nls_bitfield; + nls_bitfield = SECURITY_2_V2_NLS_STATE_REPORT_CAPABILITY_FIELD | (ctxt->nls_state ? SECURITY_2_V2_NLS_STATE_REPORT_STATE_FIELD : 0); // A node sending this frame will always support NLS + plain_text[SECURITY_2_COMMAND_CLASS_POS] = COMMAND_CLASS_SECURITY_2_V2; + plain_text[SECURITY_2_COMMAND_POS] = NLS_STATE_REPORT_V2; + plain_text[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] = nls_bitfield; + + S2_send_data(ctxt, con, plain_text, SECURITY_2_V2_NLS_STATE_REPORT_LENGTH); +} + +#ifdef ZW_CONTROLLER + static void S2_send_nls_state_set(struct S2* p_context, s2_connection_t* con, bool nls_active) { CTX_DEF @@ -1905,16 +2014,44 @@ static void S2_send_nls_state_get(struct S2* p_context, s2_connection_t* con) S2_send_data(ctxt, con, plain_text, SECURITY_2_V2_NLS_STATE_GET_LENGTH); } -static void S2_send_nls_state_report(struct S2* p_context, s2_connection_t* con) +static void S2_prepare_nls_node_list_get(uint8_t *buf, bool request) +{ + buf[SECURITY_2_COMMAND_CLASS_POS] = COMMAND_CLASS_SECURITY_2_V2; + buf[SECURITY_2_COMMAND_POS] = NLS_NODE_LIST_GET_V2; + buf[SECURITY_2_V2_NLS_NODE_LIST_GET_REQUEST_POS] = (uint8_t)request; +} + +static void S2_send_nls_node_list_get(struct S2* p_context, s2_connection_t* con, bool request) { CTX_DEF - uint8_t plain_text[SECURITY_2_V2_NLS_STATE_REPORT_LENGTH] = { 0 }; - uint8_t nls_bitfield; - nls_bitfield = ctxt->nls_state ? SECURITY_2_V2_NLS_STATE_REPORT_STATE_FIELD | SECURITY_2_V2_NLS_STATE_REPORT_CAPABILITY_FIELD : 0; // A node sending this frame will always support NLS - plain_text[SECURITY_2_COMMAND_CLASS_POS] = COMMAND_CLASS_SECURITY_2_V2; - plain_text[SECURITY_2_COMMAND_POS] = NLS_STATE_REPORT_V2; - plain_text[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] = nls_bitfield; + uint8_t buf[SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH] = { 0 }; - S2_send_data(ctxt, con, plain_text, SECURITY_2_V2_NLS_STATE_REPORT_LENGTH); -} \ No newline at end of file + S2_prepare_nls_node_list_get(buf, request); + + S2_send_data(ctxt, con, buf, SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH); +} + +static void S2_prepare_nls_node_list_report(uint8_t *buf, bool is_last_node, uint16_t node_id, uint8_t granted_keys, uint8_t nls_state) +{ + buf[SECURITY_2_COMMAND_CLASS_POS] = COMMAND_CLASS_SECURITY_2_V2; + buf[SECURITY_2_COMMAND_POS] = NLS_NODE_LIST_REPORT_V2; + buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_POS] = (uint8_t)is_last_node; + buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_MSB_POS] = (node_id >> 8) & 0xFF; + buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_LSB_POS] = (node_id >> 0) & 0xFF; + buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_GRANTED_KEYS_POS] = granted_keys; + buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NLS_STATE_POS] = nls_state; +} + +static void S2_send_nls_node_list_report(struct S2* p_context, s2_connection_t* con, bool is_last_node, uint16_t node_id, uint8_t granted_keys, uint8_t nls_state) +{ + CTX_DEF + + uint8_t buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_LENGTH] = { 0 }; + + S2_prepare_nls_node_list_report(buf, is_last_node, node_id, granted_keys, nls_state); + + S2_send_data(ctxt, con, buf, SECURITY_2_V2_NLS_NODE_LIST_REPORT_LENGTH); +} + +#endif \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/CMakeLists.txt index 7e2283c30..22eaea04d 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/CMakeLists.txt @@ -7,11 +7,6 @@ add_compile_definitions( #add_executable( test_ccm test_ccm.c ../crypto/ccm/ccm.c ../crypto/aes/aes.c ) #add_test( test_ccm test_ccm ) -if(ENABLE_CONTROLLER) - # Add test for protocol - add_unity_test(NAME test_protocol FILES test_protocol.c LIBRARIES s2_controller s2crypto aes) -endif(ENABLE_CONTROLLER) - # Add test for AES-CMAC add_unity_test(NAME test_aes_cmac FILES test_aes_cmac.c LIBRARIES s2crypto aes) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/MockZW_timer_api.c b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/MockZW_timer_api.c deleted file mode 100644 index e03b07330..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/MockZW_timer_api.c +++ /dev/null @@ -1,402 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ -/* AUTOGENERATED FILE. DO NOT EDIT. */ -#include -#include -#include -#include "unity.h" -#include "cmock.h" -#include "MockZW_timer_api.h" - -typedef struct _CMOCK_TimerStart_CALL_INSTANCE -{ - UNITY_LINE_TYPE LineNumber; - uint8_t ReturnVal; - func Expected_cb; - uint8_t Expected_timerTicks; - uint8_t Expected_repeats; - int IgnoreArg_cb; - int IgnoreArg_timerTicks; - int IgnoreArg_repeats; - -} CMOCK_TimerStart_CALL_INSTANCE; - -typedef struct _CMOCK_TimerCancel_CALL_INSTANCE -{ - UNITY_LINE_TYPE LineNumber; - uint8_t ReturnVal; - uint8_t Expected_timerHandle; - int IgnoreArg_timerHandle; - -} CMOCK_TimerCancel_CALL_INSTANCE; - -typedef struct _CMOCK_getTickTime_CALL_INSTANCE -{ - UNITY_LINE_TYPE LineNumber; - uint16_t ReturnVal; - -} CMOCK_getTickTime_CALL_INSTANCE; - -typedef struct _CMOCK_getTickTimePassed_CALL_INSTANCE -{ - UNITY_LINE_TYPE LineNumber; - uint16_t ReturnVal; - uint16_t Expected_wStartTickTime; - int IgnoreArg_wStartTickTime; - -} CMOCK_getTickTimePassed_CALL_INSTANCE; - -static struct MockZW_timer_apiInstance -{ - int TimerStart_IgnoreBool; - uint8_t TimerStart_FinalReturn; - CMOCK_TimerStart_CALLBACK TimerStart_CallbackFunctionPointer; - int TimerStart_CallbackCalls; - CMOCK_MEM_INDEX_TYPE TimerStart_CallInstance; - int TimerCancel_IgnoreBool; - uint8_t TimerCancel_FinalReturn; - CMOCK_TimerCancel_CALLBACK TimerCancel_CallbackFunctionPointer; - int TimerCancel_CallbackCalls; - CMOCK_MEM_INDEX_TYPE TimerCancel_CallInstance; - int getTickTime_IgnoreBool; - uint16_t getTickTime_FinalReturn; - CMOCK_getTickTime_CALLBACK getTickTime_CallbackFunctionPointer; - int getTickTime_CallbackCalls; - CMOCK_MEM_INDEX_TYPE getTickTime_CallInstance; - int getTickTimePassed_IgnoreBool; - uint16_t getTickTimePassed_FinalReturn; - CMOCK_getTickTimePassed_CALLBACK getTickTimePassed_CallbackFunctionPointer; - int getTickTimePassed_CallbackCalls; - CMOCK_MEM_INDEX_TYPE getTickTimePassed_CallInstance; -} Mock; - -extern jmp_buf AbortFrame; - -void MockZW_timer_api_Verify(void) -{ - UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; - if (Mock.TimerStart_IgnoreBool) - Mock.TimerStart_CallInstance = CMOCK_GUTS_NONE; - UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.TimerStart_CallInstance, cmock_line, "Function 'TimerStart' called less times than expected."); - if (Mock.TimerStart_CallbackFunctionPointer != NULL) - Mock.TimerStart_CallInstance = CMOCK_GUTS_NONE; - if (Mock.TimerCancel_IgnoreBool) - Mock.TimerCancel_CallInstance = CMOCK_GUTS_NONE; - UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.TimerCancel_CallInstance, cmock_line, "Function 'TimerCancel' called less times than expected."); - if (Mock.TimerCancel_CallbackFunctionPointer != NULL) - Mock.TimerCancel_CallInstance = CMOCK_GUTS_NONE; - if (Mock.getTickTime_IgnoreBool) - Mock.getTickTime_CallInstance = CMOCK_GUTS_NONE; - UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.getTickTime_CallInstance, cmock_line, "Function 'getTickTime' called less times than expected."); - if (Mock.getTickTime_CallbackFunctionPointer != NULL) - Mock.getTickTime_CallInstance = CMOCK_GUTS_NONE; - if (Mock.getTickTimePassed_IgnoreBool) - Mock.getTickTimePassed_CallInstance = CMOCK_GUTS_NONE; - UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.getTickTimePassed_CallInstance, cmock_line, "Function 'getTickTimePassed' called less times than expected."); - if (Mock.getTickTimePassed_CallbackFunctionPointer != NULL) - Mock.getTickTimePassed_CallInstance = CMOCK_GUTS_NONE; -} - -void MockZW_timer_api_Init(void) -{ - MockZW_timer_api_Destroy(); -} - -void MockZW_timer_api_Destroy(void) -{ - CMock_Guts_MemFreeAll(); - memset(&Mock, 0, sizeof(Mock)); - Mock.TimerStart_CallbackFunctionPointer = NULL; - Mock.TimerStart_CallbackCalls = 0; - Mock.TimerCancel_CallbackFunctionPointer = NULL; - Mock.TimerCancel_CallbackCalls = 0; - Mock.getTickTime_CallbackFunctionPointer = NULL; - Mock.getTickTime_CallbackCalls = 0; - Mock.getTickTimePassed_CallbackFunctionPointer = NULL; - Mock.getTickTimePassed_CallbackCalls = 0; -} - -uint8_t TimerStart(func cb, uint8_t timerTicks, uint8_t repeats) -{ - UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; - CMOCK_TimerStart_CALL_INSTANCE* cmock_call_instance = (CMOCK_TimerStart_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.TimerStart_CallInstance); - Mock.TimerStart_CallInstance = CMock_Guts_MemNext(Mock.TimerStart_CallInstance); - if (Mock.TimerStart_IgnoreBool) - { - if (cmock_call_instance == NULL) - return (uint8_t)Mock.TimerStart_FinalReturn; - memcpy(&Mock.TimerStart_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(uint8_t)); - return (uint8_t)cmock_call_instance->ReturnVal; - } - if (Mock.TimerStart_CallbackFunctionPointer != NULL) - { - return Mock.TimerStart_CallbackFunctionPointer(cb, timerTicks, repeats, Mock.TimerStart_CallbackCalls++); - } - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'TimerStart' called more times than expected."); - cmock_line = cmock_call_instance->LineNumber; - if (!cmock_call_instance->IgnoreArg_cb) - { - UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_cb), (void*)(&cb), sizeof(func), cmock_line, "Function 'TimerStart' called with unexpected value for argument 'cb'."); - } - if (!cmock_call_instance->IgnoreArg_timerTicks) - { - UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_timerTicks), (void*)(&timerTicks), sizeof(uint8_t), cmock_line, "Function 'TimerStart' called with unexpected value for argument 'timerTicks'."); - } - if (!cmock_call_instance->IgnoreArg_repeats) - { - UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_repeats), (void*)(&repeats), sizeof(uint8_t), cmock_line, "Function 'TimerStart' called with unexpected value for argument 'repeats'."); - } - return cmock_call_instance->ReturnVal; -} - -void CMockExpectParameters_TimerStart(CMOCK_TimerStart_CALL_INSTANCE* cmock_call_instance, func cb, uint8_t timerTicks, uint8_t repeats) -{ - memcpy(&cmock_call_instance->Expected_cb, &cb, sizeof(func)); - cmock_call_instance->IgnoreArg_cb = 0; - memcpy(&cmock_call_instance->Expected_timerTicks, &timerTicks, sizeof(uint8_t)); - cmock_call_instance->IgnoreArg_timerTicks = 0; - memcpy(&cmock_call_instance->Expected_repeats, &repeats, sizeof(uint8_t)); - cmock_call_instance->IgnoreArg_repeats = 0; -} - -void TimerStart_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, uint8_t cmock_to_return) -{ - CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_TimerStart_CALL_INSTANCE)); - CMOCK_TimerStart_CALL_INSTANCE* cmock_call_instance = (CMOCK_TimerStart_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more."); - memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); - Mock.TimerStart_CallInstance = CMock_Guts_MemChain(Mock.TimerStart_CallInstance, cmock_guts_index); - Mock.TimerStart_IgnoreBool = (int)0; - cmock_call_instance->LineNumber = cmock_line; - cmock_call_instance->ReturnVal = cmock_to_return; - Mock.TimerStart_IgnoreBool = (int)1; -} - -void TimerStart_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, func cb, uint8_t timerTicks, uint8_t repeats, uint8_t cmock_to_return) -{ - CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_TimerStart_CALL_INSTANCE)); - CMOCK_TimerStart_CALL_INSTANCE* cmock_call_instance = (CMOCK_TimerStart_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more."); - memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); - Mock.TimerStart_CallInstance = CMock_Guts_MemChain(Mock.TimerStart_CallInstance, cmock_guts_index); - Mock.TimerStart_IgnoreBool = (int)0; - cmock_call_instance->LineNumber = cmock_line; - CMockExpectParameters_TimerStart(cmock_call_instance, cb, timerTicks, repeats); - memcpy(&cmock_call_instance->ReturnVal, &cmock_to_return, sizeof(uint8_t)); -} - -void TimerStart_StubWithCallback(CMOCK_TimerStart_CALLBACK Callback) -{ - Mock.TimerStart_CallbackFunctionPointer = Callback; -} - -void TimerStart_CMockIgnoreArg_cb(UNITY_LINE_TYPE cmock_line) -{ - CMOCK_TimerStart_CALL_INSTANCE* cmock_call_instance = (CMOCK_TimerStart_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.TimerStart_CallInstance)); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "cb IgnoreArg called before Expect on 'TimerStart'."); - cmock_call_instance->IgnoreArg_cb = 1; -} - -void TimerStart_CMockIgnoreArg_timerTicks(UNITY_LINE_TYPE cmock_line) -{ - CMOCK_TimerStart_CALL_INSTANCE* cmock_call_instance = (CMOCK_TimerStart_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.TimerStart_CallInstance)); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "timerTicks IgnoreArg called before Expect on 'TimerStart'."); - cmock_call_instance->IgnoreArg_timerTicks = 1; -} - -void TimerStart_CMockIgnoreArg_repeats(UNITY_LINE_TYPE cmock_line) -{ - CMOCK_TimerStart_CALL_INSTANCE* cmock_call_instance = (CMOCK_TimerStart_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.TimerStart_CallInstance)); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "repeats IgnoreArg called before Expect on 'TimerStart'."); - cmock_call_instance->IgnoreArg_repeats = 1; -} - -uint8_t TimerCancel(uint8_t timerHandle) -{ - UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; - CMOCK_TimerCancel_CALL_INSTANCE* cmock_call_instance = (CMOCK_TimerCancel_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.TimerCancel_CallInstance); - Mock.TimerCancel_CallInstance = CMock_Guts_MemNext(Mock.TimerCancel_CallInstance); - if (Mock.TimerCancel_IgnoreBool) - { - if (cmock_call_instance == NULL) - return (uint8_t)Mock.TimerCancel_FinalReturn; - memcpy(&Mock.TimerCancel_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(uint8_t)); - return (uint8_t)cmock_call_instance->ReturnVal; - } - if (Mock.TimerCancel_CallbackFunctionPointer != NULL) - { - return Mock.TimerCancel_CallbackFunctionPointer(timerHandle, Mock.TimerCancel_CallbackCalls++); - } - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'TimerCancel' called more times than expected."); - cmock_line = cmock_call_instance->LineNumber; - if (!cmock_call_instance->IgnoreArg_timerHandle) - { - UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_timerHandle), (void*)(&timerHandle), sizeof(uint8_t), cmock_line, "Function 'TimerCancel' called with unexpected value for argument 'timerHandle'."); - } - return cmock_call_instance->ReturnVal; -} - -void CMockExpectParameters_TimerCancel(CMOCK_TimerCancel_CALL_INSTANCE* cmock_call_instance, uint8_t timerHandle) -{ - memcpy(&cmock_call_instance->Expected_timerHandle, &timerHandle, sizeof(uint8_t)); - cmock_call_instance->IgnoreArg_timerHandle = 0; -} - -void TimerCancel_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, uint8_t cmock_to_return) -{ - CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_TimerCancel_CALL_INSTANCE)); - CMOCK_TimerCancel_CALL_INSTANCE* cmock_call_instance = (CMOCK_TimerCancel_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more."); - memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); - Mock.TimerCancel_CallInstance = CMock_Guts_MemChain(Mock.TimerCancel_CallInstance, cmock_guts_index); - Mock.TimerCancel_IgnoreBool = (int)0; - cmock_call_instance->LineNumber = cmock_line; - cmock_call_instance->ReturnVal = cmock_to_return; - Mock.TimerCancel_IgnoreBool = (int)1; -} - -void TimerCancel_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, uint8_t timerHandle, uint8_t cmock_to_return) -{ - CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_TimerCancel_CALL_INSTANCE)); - CMOCK_TimerCancel_CALL_INSTANCE* cmock_call_instance = (CMOCK_TimerCancel_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more."); - memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); - Mock.TimerCancel_CallInstance = CMock_Guts_MemChain(Mock.TimerCancel_CallInstance, cmock_guts_index); - Mock.TimerCancel_IgnoreBool = (int)0; - cmock_call_instance->LineNumber = cmock_line; - CMockExpectParameters_TimerCancel(cmock_call_instance, timerHandle); - memcpy(&cmock_call_instance->ReturnVal, &cmock_to_return, sizeof(uint8_t)); -} - -void TimerCancel_StubWithCallback(CMOCK_TimerCancel_CALLBACK Callback) -{ - Mock.TimerCancel_CallbackFunctionPointer = Callback; -} - -void TimerCancel_CMockIgnoreArg_timerHandle(UNITY_LINE_TYPE cmock_line) -{ - CMOCK_TimerCancel_CALL_INSTANCE* cmock_call_instance = (CMOCK_TimerCancel_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.TimerCancel_CallInstance)); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "timerHandle IgnoreArg called before Expect on 'TimerCancel'."); - cmock_call_instance->IgnoreArg_timerHandle = 1; -} - -uint16_t getTickTime(void) -{ - UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; - CMOCK_getTickTime_CALL_INSTANCE* cmock_call_instance = (CMOCK_getTickTime_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.getTickTime_CallInstance); - Mock.getTickTime_CallInstance = CMock_Guts_MemNext(Mock.getTickTime_CallInstance); - if (Mock.getTickTime_IgnoreBool) - { - if (cmock_call_instance == NULL) - return (uint16_t)Mock.getTickTime_FinalReturn; - memcpy(&Mock.getTickTime_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(uint16_t)); - return (uint16_t)cmock_call_instance->ReturnVal; - } - if (Mock.getTickTime_CallbackFunctionPointer != NULL) - { - return Mock.getTickTime_CallbackFunctionPointer(Mock.getTickTime_CallbackCalls++); - } - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'getTickTime' called more times than expected."); - cmock_line = cmock_call_instance->LineNumber; - return cmock_call_instance->ReturnVal; -} - -void getTickTime_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, uint16_t cmock_to_return) -{ - CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_getTickTime_CALL_INSTANCE)); - CMOCK_getTickTime_CALL_INSTANCE* cmock_call_instance = (CMOCK_getTickTime_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more."); - memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); - Mock.getTickTime_CallInstance = CMock_Guts_MemChain(Mock.getTickTime_CallInstance, cmock_guts_index); - Mock.getTickTime_IgnoreBool = (int)0; - cmock_call_instance->LineNumber = cmock_line; - cmock_call_instance->ReturnVal = cmock_to_return; - Mock.getTickTime_IgnoreBool = (int)1; -} - -void getTickTime_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, uint16_t cmock_to_return) -{ - CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_getTickTime_CALL_INSTANCE)); - CMOCK_getTickTime_CALL_INSTANCE* cmock_call_instance = (CMOCK_getTickTime_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more."); - memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); - Mock.getTickTime_CallInstance = CMock_Guts_MemChain(Mock.getTickTime_CallInstance, cmock_guts_index); - Mock.getTickTime_IgnoreBool = (int)0; - cmock_call_instance->LineNumber = cmock_line; - memcpy(&cmock_call_instance->ReturnVal, &cmock_to_return, sizeof(uint16_t)); -} - -void getTickTime_StubWithCallback(CMOCK_getTickTime_CALLBACK Callback) -{ - Mock.getTickTime_CallbackFunctionPointer = Callback; -} - -uint16_t getTickTimePassed(uint16_t wStartTickTime) -{ - UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; - CMOCK_getTickTimePassed_CALL_INSTANCE* cmock_call_instance = (CMOCK_getTickTimePassed_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.getTickTimePassed_CallInstance); - Mock.getTickTimePassed_CallInstance = CMock_Guts_MemNext(Mock.getTickTimePassed_CallInstance); - if (Mock.getTickTimePassed_IgnoreBool) - { - if (cmock_call_instance == NULL) - return (uint16_t)Mock.getTickTimePassed_FinalReturn; - memcpy(&Mock.getTickTimePassed_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(uint16_t)); - return (uint16_t)cmock_call_instance->ReturnVal; - } - if (Mock.getTickTimePassed_CallbackFunctionPointer != NULL) - { - return Mock.getTickTimePassed_CallbackFunctionPointer(wStartTickTime, Mock.getTickTimePassed_CallbackCalls++); - } - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'getTickTimePassed' called more times than expected."); - cmock_line = cmock_call_instance->LineNumber; - if (!cmock_call_instance->IgnoreArg_wStartTickTime) - { - UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_wStartTickTime), (void*)(&wStartTickTime), sizeof(uint16_t), cmock_line, "Function 'getTickTimePassed' called with unexpected value for argument 'wStartTickTime'."); - } - return cmock_call_instance->ReturnVal; -} - -void CMockExpectParameters_getTickTimePassed(CMOCK_getTickTimePassed_CALL_INSTANCE* cmock_call_instance, uint16_t wStartTickTime) -{ - memcpy(&cmock_call_instance->Expected_wStartTickTime, &wStartTickTime, sizeof(uint16_t)); - cmock_call_instance->IgnoreArg_wStartTickTime = 0; -} - -void getTickTimePassed_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, uint16_t cmock_to_return) -{ - CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_getTickTimePassed_CALL_INSTANCE)); - CMOCK_getTickTimePassed_CALL_INSTANCE* cmock_call_instance = (CMOCK_getTickTimePassed_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more."); - memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); - Mock.getTickTimePassed_CallInstance = CMock_Guts_MemChain(Mock.getTickTimePassed_CallInstance, cmock_guts_index); - Mock.getTickTimePassed_IgnoreBool = (int)0; - cmock_call_instance->LineNumber = cmock_line; - cmock_call_instance->ReturnVal = cmock_to_return; - Mock.getTickTimePassed_IgnoreBool = (int)1; -} - -void getTickTimePassed_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, uint16_t wStartTickTime, uint16_t cmock_to_return) -{ - CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_getTickTimePassed_CALL_INSTANCE)); - CMOCK_getTickTimePassed_CALL_INSTANCE* cmock_call_instance = (CMOCK_getTickTimePassed_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more."); - memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); - Mock.getTickTimePassed_CallInstance = CMock_Guts_MemChain(Mock.getTickTimePassed_CallInstance, cmock_guts_index); - Mock.getTickTimePassed_IgnoreBool = (int)0; - cmock_call_instance->LineNumber = cmock_line; - CMockExpectParameters_getTickTimePassed(cmock_call_instance, wStartTickTime); - memcpy(&cmock_call_instance->ReturnVal, &cmock_to_return, sizeof(uint16_t)); -} - -void getTickTimePassed_StubWithCallback(CMOCK_getTickTimePassed_CALLBACK Callback) -{ - Mock.getTickTimePassed_CallbackFunctionPointer = Callback; -} - -void getTickTimePassed_CMockIgnoreArg_wStartTickTime(UNITY_LINE_TYPE cmock_line) -{ - CMOCK_getTickTimePassed_CALL_INSTANCE* cmock_call_instance = (CMOCK_getTickTimePassed_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.getTickTimePassed_CallInstance)); - UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "wStartTickTime IgnoreArg called before Expect on 'getTickTimePassed'."); - cmock_call_instance->IgnoreArg_wStartTickTime = 1; -} - diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/MockZW_timer_api.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/MockZW_timer_api.h deleted file mode 100644 index 262ccf613..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/MockZW_timer_api.h +++ /dev/null @@ -1,60 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ -/* AUTOGENERATED FILE. DO NOT EDIT. */ -#ifndef _MOCKZW_TIMER_API_H -#define _MOCKZW_TIMER_API_H - -#include "ZW_timer_api.h" - -/* Ignore the following warnings, since we are copying code */ -#if defined(__GNUC__) && !defined(__ICC) -#if !defined(__clang__) -#pragma GCC diagnostic ignored "-Wpragmas" -#endif -#pragma GCC diagnostic ignored "-Wunknown-pragmas" -#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier" -#endif - -void MockZW_timer_api_Init(void); -void MockZW_timer_api_Destroy(void); -void MockZW_timer_api_Verify(void); - - - - -#define TimerStart_IgnoreAndReturn(cmock_retval) TimerStart_CMockIgnoreAndReturn(__LINE__, cmock_retval) -void TimerStart_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, uint8_t cmock_to_return); -#define TimerStart_ExpectAndReturn(cb, timerTicks, repeats, cmock_retval) TimerStart_CMockExpectAndReturn(__LINE__, cb, timerTicks, repeats, cmock_retval) -void TimerStart_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, func cb, uint8_t timerTicks, uint8_t repeats, uint8_t cmock_to_return); -typedef uint8_t (* CMOCK_TimerStart_CALLBACK)(func cb, uint8_t timerTicks, uint8_t repeats, int cmock_num_calls); -void TimerStart_StubWithCallback(CMOCK_TimerStart_CALLBACK Callback); -#define TimerStart_IgnoreArg_cb() TimerStart_CMockIgnoreArg_cb(__LINE__) -void TimerStart_CMockIgnoreArg_cb(UNITY_LINE_TYPE cmock_line); -#define TimerStart_IgnoreArg_timerTicks() TimerStart_CMockIgnoreArg_timerTicks(__LINE__) -void TimerStart_CMockIgnoreArg_timerTicks(UNITY_LINE_TYPE cmock_line); -#define TimerStart_IgnoreArg_repeats() TimerStart_CMockIgnoreArg_repeats(__LINE__) -void TimerStart_CMockIgnoreArg_repeats(UNITY_LINE_TYPE cmock_line); -#define TimerCancel_IgnoreAndReturn(cmock_retval) TimerCancel_CMockIgnoreAndReturn(__LINE__, cmock_retval) -void TimerCancel_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, uint8_t cmock_to_return); -#define TimerCancel_ExpectAndReturn(timerHandle, cmock_retval) TimerCancel_CMockExpectAndReturn(__LINE__, timerHandle, cmock_retval) -void TimerCancel_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, uint8_t timerHandle, uint8_t cmock_to_return); -typedef uint8_t (* CMOCK_TimerCancel_CALLBACK)(uint8_t timerHandle, int cmock_num_calls); -void TimerCancel_StubWithCallback(CMOCK_TimerCancel_CALLBACK Callback); -#define TimerCancel_IgnoreArg_timerHandle() TimerCancel_CMockIgnoreArg_timerHandle(__LINE__) -void TimerCancel_CMockIgnoreArg_timerHandle(UNITY_LINE_TYPE cmock_line); -#define getTickTime_IgnoreAndReturn(cmock_retval) getTickTime_CMockIgnoreAndReturn(__LINE__, cmock_retval) -void getTickTime_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, uint16_t cmock_to_return); -#define getTickTime_ExpectAndReturn(cmock_retval) getTickTime_CMockExpectAndReturn(__LINE__, cmock_retval) -void getTickTime_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, uint16_t cmock_to_return); -typedef uint16_t (* CMOCK_getTickTime_CALLBACK)(int cmock_num_calls); -void getTickTime_StubWithCallback(CMOCK_getTickTime_CALLBACK Callback); -#define getTickTimePassed_IgnoreAndReturn(cmock_retval) getTickTimePassed_CMockIgnoreAndReturn(__LINE__, cmock_retval) -void getTickTimePassed_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, uint16_t cmock_to_return); -#define getTickTimePassed_ExpectAndReturn(wStartTickTime, cmock_retval) getTickTimePassed_CMockExpectAndReturn(__LINE__, wStartTickTime, cmock_retval) -void getTickTimePassed_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, uint16_t wStartTickTime, uint16_t cmock_to_return); -typedef uint16_t (* CMOCK_getTickTimePassed_CALLBACK)(uint16_t wStartTickTime, int cmock_num_calls); -void getTickTimePassed_StubWithCallback(CMOCK_getTickTimePassed_CALLBACK Callback); -#define getTickTimePassed_IgnoreArg_wStartTickTime() getTickTimePassed_CMockIgnoreArg_wStartTickTime(__LINE__) -void getTickTimePassed_CMockIgnoreArg_wStartTickTime(UNITY_LINE_TYPE cmock_line); - -#endif diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/cmock.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/cmock.h deleted file mode 100644 index 13e679807..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/cmock.h +++ /dev/null @@ -1,38 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#ifndef CMOCK_FRAMEWORK_H -#define CMOCK_FRAMEWORK_H - -//should be big enough to index full range of CMOCK_MEM_MAX -#ifndef CMOCK_MEM_INDEX_TYPE -#define CMOCK_MEM_INDEX_TYPE unsigned int -#endif - -#define CMOCK_GUTS_NONE (0) - -#define CMOCK_ARG_MODE CMOCK_MEM_INDEX_TYPE -#define CMOCK_ARG_ALL 0 -#define CMOCK_ARG_NONE ((CMOCK_MEM_INDEX_TYPE)(~0)) - -//------------------------------------------------------- -// Memory API -//------------------------------------------------------- -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNew(CMOCK_MEM_INDEX_TYPE size); -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemChain(CMOCK_MEM_INDEX_TYPE root_index, CMOCK_MEM_INDEX_TYPE obj_index); -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNext(CMOCK_MEM_INDEX_TYPE previous_item_index); -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemEndOfChain(CMOCK_MEM_INDEX_TYPE root_index); - -void* CMock_Guts_GetAddressFor(CMOCK_MEM_INDEX_TYPE index); - -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesFree(void); -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesUsed(void); -void CMock_Guts_MemFreeAll(void); -void CMock_Guts_MemFreeFinal(void); - -#endif //CMOCK_FRAMEWORK diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/cmock_internals.h b/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/cmock_internals.h deleted file mode 100644 index fa2d0aead..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/cmock/cmock_internals.h +++ /dev/null @@ -1,68 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#ifndef CMOCK_FRAMEWORK_INTERNALS_H -#define CMOCK_FRAMEWORK_INTERNALS_H - -#include "cmock.h" - -//define CMOCK_MEM_DYNAMIC to grab memory as needed with malloc -//when you do that, CMOCK_MEM_SIZE is used for incremental size instead of total -#ifdef CMOCK_MEM_STATIC -#undef CMOCK_MEM_DYNAMIC -#endif - -#ifdef CMOCK_MEM_DYNAMIC -#include -#endif - -//this is used internally during pointer arithmetic. make sure this type is the same size as the target's pointer type -#ifndef CMOCK_MEM_PTR_AS_INT -#ifdef UNITY_POINTER_WIDTH -#ifdef UNITY_INT_WIDTH -#if UNITY_POINTER_WIDTH == UNITY_INT_WIDTH -#define CMOCK_MEM_PTR_AS_INT unsigned int -#endif -#endif -#endif -#endif - -#ifndef CMOCK_MEM_PTR_AS_INT -#ifdef UNITY_POINTER_WIDTH -#ifdef UNITY_LONG_WIDTH -#if UNITY_POINTER_WIDTH == UNITY_LONG_WIDTH -#define CMOCK_MEM_PTR_AS_INT unsigned long -#endif -#if UNITY_POINTER_WIDTH > UNITY_LONG_WIDTH -#define CMOCK_MEM_PTR_AS_INT unsigned long long -#endif -#endif -#endif -#endif - -#ifndef CMOCK_MEM_PTR_AS_INT -#define CMOCK_MEM_PTR_AS_INT unsigned long -#endif - -//0 for no alignment, 1 for 16-bit, 2 for 32-bit, 3 for 64-bit -#ifndef CMOCK_MEM_ALIGN -#define CMOCK_MEM_ALIGN (2) -#endif - -//amount of memory to allow cmock to use in its internal heap -#ifndef CMOCK_MEM_SIZE -#define CMOCK_MEM_SIZE (32768) -#endif - -//automatically calculated defs for easier reading -#define CMOCK_MEM_ALIGN_SIZE (CMOCK_MEM_INDEX_TYPE)(1u << CMOCK_MEM_ALIGN) -#define CMOCK_MEM_ALIGN_MASK (CMOCK_MEM_INDEX_TYPE)(CMOCK_MEM_ALIGN_SIZE - 1) -#define CMOCK_MEM_INDEX_SIZE (CMOCK_MEM_INDEX_TYPE)(CMOCK_MEM_PTR_AS_INT)((sizeof(CMOCK_MEM_INDEX_TYPE) > CMOCK_MEM_ALIGN_SIZE) ? sizeof(CMOCK_MEM_INDEX_TYPE) : CMOCK_MEM_ALIGN_SIZE) - - -#endif //CMOCK_FRAMEWORK_INTERNALS diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/s2_inclusion_controller.c b/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_inclusion_controller.c similarity index 99% rename from applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/s2_inclusion_controller.c rename to applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_inclusion_controller.c index f39b55dcb..43702452d 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/inclusion/s2_inclusion_controller.c +++ b/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_inclusion_controller.c @@ -619,4 +619,4 @@ void s2_inclusion_including_start(struct S2 *p_context, const s2_connection_t* c process_event(S2_INCLUDING_START); mp_context->is_keys_restored = false; } -} +} \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_network.c b/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_network.c index 294e450d2..66593c612 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_network.c +++ b/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_network.c @@ -22,6 +22,11 @@ #include "zwave_s2_internal.h" #include "zwave_s2_keystore_int.h" #include "zwave_helper_macros.h" +#include "zwapi_protocol_controller.h" + +#ifndef ZWAVE_TESTLIB +#include "zwave_utils.h" +#endif #define LOG_TAG "zwave_s2_network" @@ -136,6 +141,24 @@ void zwave_s2_network_init() // Print out our keys on the console zwave_s2_log_security_keys(SL_LOG_INFO); #endif + + uint8_t nls_state = 0; + zwave_node_id_t node_id = zwave_network_management_get_node_id(); + sl_status_t status = zwapi_get_node_nls(node_id, &nls_state); + if (status != SL_STATUS_OK) { + sl_log_error(LOG_TAG, "Unable to read NLS state for Node ID: %d\n", node_id); + return; + } + + sl_log_info(LOG_TAG, "NLS state %s for Node ID: %d\n", nls_state == 1 ? "active" : "not active", node_id); + + S2_load_nls_state(s2_ctx, nls_state); +#ifndef ZWAVE_TESTLIB + status = zwave_store_nls_state(node_id, nls_state, REPORTED_ATTRIBUTE); +#endif + if (status != SL_STATUS_OK) { + sl_log_error(LOG_TAG, "Unable to store NLS state in attribute store for Node ID: %d\n", node_id); + } } void zwave_s2_start_learn_mode(zwave_node_id_t node_id) diff --git a/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_process.c b/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_process.c index c5507c60e..b7d7000ab 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_process.c +++ b/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_process.c @@ -22,7 +22,6 @@ #include "zwave_s2_keystore_int.h" #include "zwave_s2_network.h" #include "zwave_s2_transport.h" -#include "zwave_s2_protocol_cc_encryption.h" #define LOG_TAG "zwave_s2_process" @@ -72,11 +71,13 @@ static void zwave_s2_on_network_address_update(zwave_home_id_t home_id, static void zwave_s2_on_new_network_entered(zwave_home_id_t home_id, zwave_node_id_t node_id, zwave_keyset_t granted_keys, - zwave_kex_fail_type_t kex_fail_type) + zwave_kex_fail_type_t kex_fail_type, + zwave_protocol_t inclusion_protocol) { (void)node_id; (void)granted_keys; (void)kex_fail_type; + (void)inclusion_protocol; zwave_s2_refresh_home_id(home_id); } @@ -86,7 +87,6 @@ static void zwave_s2_init() .on_network_address_update = zwave_s2_on_network_address_update, .on_new_network_entered = zwave_s2_on_new_network_entered, .on_multicast_group_deleted = zwave_s2_on_on_multicast_group_deleted, - .on_protocol_cc_encryption_request = zwave_s2_on_protocol_cc_encryption_request, }; zwave_controller_register_callbacks(&callbacks); diff --git a/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_protocol_cc_encryption.c b/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_protocol_cc_encryption.c deleted file mode 100644 index 5dc7d34f7..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_protocol_cc_encryption.c +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** - * # License - * Copyright 2021 Silicon Laboratories Inc. www.silabs.com - ****************************************************************************** - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - *****************************************************************************/ -#include "zwave_controller_transport.h" -#include "zwave_controller_transport_internal.h" -#include "sl_log.h" -#include "zwave_controller.h" -#include "zwave_s2_internal.h" -#include "zwave_s2_transport.h" -#include "zwave_s2_protocol_cc_encryption.h" -#include "zwave_tx_scheme_selector.h" - -#define LOG_TAG "zwave_s2_protocol_cc_encryption" - -protocol_metadata_t metadata = {0}; - -static void on_send_protocol_data_callback_received(uint8_t status, const zwapi_tx_report_t *tx_info, void *user) -{ - protocol_metadata_t *metadata = (protocol_metadata_t *)user; - - if (status == TRANSMIT_COMPLETE_FAIL || status == TRANSMIT_COMPLETE_VERIFIED) { - zwave_controller_request_protocol_cc_encryption_callback(status, tx_info, metadata->session_id); - } else { - sl_log_debug(LOG_TAG, "Send Protocol Data callback, status: %d", status); - } -} - -void zwave_s2_on_protocol_cc_encryption_request( - const zwave_node_id_t destination_node_id, - const uint8_t payload_length, - const uint8_t *const payload, - const uint8_t protocol_metadata_length, - const uint8_t *const protocol_metadata, - const uint8_t use_supervision, - const uint8_t session_id) -{ - zwave_controller_connection_info_t connection_info = {0}; - zwave_tx_options_t tx_options = {0}; - uint8_t number_of_expected_responses = 1; - uint32_t discard_timeout_ms = 5000; - sl_status_t ret = SL_STATUS_OK; - zwave_tx_session_id_t tx_session_id = NULL; - - zwave_tx_scheme_get_node_connection_info(destination_node_id, 0, &connection_info); - zwave_tx_scheme_get_node_tx_options( - ZWAVE_TX_QOS_MAX_PRIORITY, - number_of_expected_responses, - discard_timeout_ms, - &tx_options); - - // Other TX options are set in the transport layer in `S2_send_frame` - tx_options.transport.is_protocol_frame = true; - - metadata.session_id = session_id; - metadata.data_length = protocol_metadata_length; - memcpy(metadata.data, protocol_metadata, protocol_metadata_length); - - // Following command will trigger a "Send Protocol Data" command and the callback - // provided to this function will be triggered when the callback data frame of - // the "Send Protocol Data" command is received. - ret = zwave_tx_send_data(&connection_info, - payload_length, - payload, - &tx_options, - on_send_protocol_data_callback_received, - (void *)&metadata, - &tx_session_id); - if (ret != SL_STATUS_OK) { - sl_log_error(LOG_TAG, "Unable to send S2 data. Error code %d.", ret); - } -} diff --git a/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_transport.c b/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_transport.c index 5ffc23b6f..911cfaec6 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_transport.c +++ b/applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_transport.c @@ -37,7 +37,10 @@ #include "zwave_rx.h" #include "zwave_tx.h" #include "zwave_tx_groups.h" + +#ifndef ZWAVE_TESTLIB #include "zwave_utils.h" +#endif #include "sys/clock.h" #include "sl_log.h" @@ -57,6 +60,9 @@ #define S2_NONCE_REPORT_MOS_SOS_INDEX 3 #define S2_NONCE_REPORT_MOS_SOS_MASK 0x3 +// Number of nodes per byte in NLS state node mask +#define NLS_ENABLED_NODES_PER_BYTE 8 + struct S2 *s2_ctx; typedef enum { SINGLECAST, MULTICAST } zwave_s2_current_transmission_type_t; @@ -84,6 +90,17 @@ static s2_transport_session_state_t state = {}; static uint8_t secure_nif[ZWAVE_MAX_FRAME_SIZE]; static uint8_t secure_nif_length; +// NLS context +typedef struct s2_node_nls_context { + zwave_nodemask_t node_list; // bitmask containing NLS enabled nodes in the network + uint16_t node_list_length; // length of the list in bytes (is not equal to the number of nodes in the network) + zwave_node_id_t next_sent_node_id; // node ID of the NLS enabled node to be sent next + uint16_t nls_enabled_node_cnt; // total number of NLS enabled nodes in the network + uint16_t nls_enabled_node_sent_cnt; // number of NLS enabled nodes already sent to the joining node +} s2_node_nls_context_t; + +static s2_node_nls_context_t node_nls_context = {0}; + static uint8_t encapsulation_to_class(zwave_controller_encapsulation_scheme_t encap) { @@ -414,21 +431,23 @@ uint8_t S2_send_frame_multi(struct S2 *ctxt, 0); } -void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, uint8_t nls_capability, uint8_t nls_state) +void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, bool nls_capability, bool nls_state) { (void)class_id; - sl_log_debug(LOG_TAG, "NLS state report received for node %d, capability : %d, state: %d", srcNode, (bool)nls_capability, (bool)nls_state); + sl_log_debug(LOG_TAG, "NLS state report received for node %d, capability : %d, state: %d", srcNode, nls_capability, nls_state); +#ifndef ZWAVE_TESTLIB if (zwave_store_nls_support((zwave_node_id_t)srcNode, - (bool)nls_capability, + nls_capability, REPORTED_ATTRIBUTE) || zwave_store_nls_state((zwave_node_id_t)srcNode, - (bool)nls_state, + nls_state, REPORTED_ATTRIBUTE)) { sl_log_error(LOG_TAG, "Error setting NLS attributes"); return; } +#endif if(nls_capability && nls_state) { if (SL_STATUS_OK != zwapi_enable_node_nls(srcNode)) { @@ -439,26 +458,195 @@ void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, uint8_t nls_ca void S2_save_nls_state(void) { - // not relevant for ZPC + zwave_node_id_t node_id = zwave_network_management_get_node_id(); + + sl_status_t status = SL_STATUS_FAIL; +#ifndef ZWAVE_TESTLIB + status = zwave_store_nls_state(node_id, s2_ctx->nls_state, REPORTED_ATTRIBUTE); + if (status != SL_STATUS_OK) { + sl_log_error(LOG_TAG, "Unable to save NLS state in attribute store for Node ID: %d\n", node_id); + return; + } +#endif + + if (s2_ctx->nls_state) { + status = zwapi_enable_node_nls(node_id); + if (SL_STATUS_OK != status) { + sl_log_error(LOG_TAG, "Error saving NLS state in the controller NVM for Node ID: %d", node_id); + return; + } + } + + sl_log_debug(LOG_TAG, "NLS state saved in the controller NVM for Node ID: %d\n", node_id); } -void S2_nls_node_list_get(node_t srcNode, uint8_t class_id, uint8_t request) +sl_status_t compute_next_nls_enabled_node(void) { - // to be implemented later on - (void)srcNode; - (void)class_id; - (void)request; + for (uint16_t i = (node_nls_context.next_sent_node_id + 1); + i <= (node_nls_context.node_list_length * NLS_ENABLED_NODES_PER_BYTE); + i++) { + uint8_t nls_enabled = ZW_IS_NODE_IN_MASK(i, node_nls_context.node_list); + if (nls_enabled) { + node_nls_context.next_sent_node_id = i; + return SL_STATUS_OK; + } + } + + return SL_STATUS_NOT_FOUND; } -void S2_nls_node_list_report(node_t srcNode, uint8_t class_id, uint8_t last_node, uint16_t id_of_node, uint8_t keys_node_bitmask, uint8_t nls_state) +static uint16_t compute_nls_enabled_node_cnt(void) { - // to be implemented later on - (void)srcNode; - (void)class_id; - (void)last_node; - (void)id_of_node; - (void)keys_node_bitmask; - (void)nls_state; + for (uint16_t i = 1; + i <= (node_nls_context.node_list_length * NLS_ENABLED_NODES_PER_BYTE); + i++) { + uint8_t nls_enabled = ZW_IS_NODE_IN_MASK(i, node_nls_context.node_list); + if (nls_enabled) { + node_nls_context.nls_enabled_node_cnt++; + } + } + + return node_nls_context.nls_enabled_node_cnt; +} + +/* +This command is received by the trust center (SIS). We can retrieve the list from the controller when the +joining node requests it for the first node (request flag is set to 0) and then send the cached +information for the remaining nodes. + +This function is not supposed to send a frame. It just fills the necessary fields of the report frame of the +command in question and let libS2 send it. + +If there is no NLS enabled nodes or last NLS enabled node is sent, `nls_state` is not set to true so libS2 +should not send the report frame. +*/ +int8_t S2_get_nls_node_list(node_t srcNode, + bool request, + bool *is_last_node, + uint16_t *node_id, + uint8_t *granted_keys, + bool *nls_state) +{ + sl_status_t status = SL_STATUS_OK; + *is_last_node = false; + *node_id = 0; + *granted_keys = 0; + *nls_state = false; + + sl_log_debug(LOG_TAG, + "NLS Node List Get received from node %d, request: %d", + srcNode, + request); + + if (request == false) { + memset(&node_nls_context, 0, sizeof(s2_node_nls_context_t)); + status = zwapi_get_nls_nodes(&node_nls_context.node_list_length, + node_nls_context.node_list); + if (status != SL_STATUS_OK) { + sl_log_error(LOG_TAG, "Error getting NLS nodes, %d", status); + return -1; + } + compute_nls_enabled_node_cnt(); + } + + if (node_nls_context.nls_enabled_node_cnt == 0) { + sl_log_warning(LOG_TAG, "No NLS enabled nodes found in the controller NVM"); + return -1; + } + + if (node_nls_context.nls_enabled_node_sent_cnt + == node_nls_context.nls_enabled_node_cnt) { + sl_log_warning(LOG_TAG, "All NLS enabled nodes are already sent"); + return -1; + } + + if (node_nls_context.nls_enabled_node_sent_cnt + == node_nls_context.nls_enabled_node_cnt - 1) { + *is_last_node = true; + } + + status = compute_next_nls_enabled_node(); + if (status != SL_STATUS_OK) { + sl_log_debug(LOG_TAG, "No NLS enabled nodes found in the controller NVM"); + return -1; + } + +#ifndef ZWAVE_TESTLIB + zwave_keyset_t keyset = {0}; + status + = zwave_get_node_granted_keys(node_nls_context.next_sent_node_id, &keyset); + if (status != SL_STATUS_OK) { + sl_log_error(LOG_TAG, + "Error getting granted keys of the node %d", + node_nls_context.next_sent_node_id); + return -1; + } + *granted_keys = (uint8_t)keyset; +#endif + + node_nls_context.nls_enabled_node_sent_cnt++; + + *node_id = node_nls_context.next_sent_node_id; + *nls_state = true; + + return 0; +} + +/* +This command is received by the joining node (secondary controller). +*/ +int8_t S2_notify_nls_node_list_report(node_t srcNode, + uint16_t id_of_node, + uint8_t keys_node_bitmask, + bool nls_state) +{ + sl_status_t status = SL_STATUS_OK; + + sl_log_debug(LOG_TAG, + "NLS Node List Report received from the node %d, NLS state: %d", + srcNode, + nls_state); + + if (nls_state) { + status = zwapi_enable_node_nls(id_of_node); + if (SL_STATUS_OK != status) { + sl_log_error( + LOG_TAG, + "Error saving NLS state of the node %d in the controller NVM", + id_of_node); + return -1; + } + +#ifndef ZWAVE_TESTLIB + if (zwave_store_nls_support((zwave_node_id_t)id_of_node, + true, + REPORTED_ATTRIBUTE) + || zwave_store_nls_state((zwave_node_id_t)id_of_node, + true, + REPORTED_ATTRIBUTE)) { + sl_log_error(LOG_TAG, + "Error setting NLS attributes of the node %d", + id_of_node); + return -1; + } + + status = zwave_set_node_granted_keys((zwave_node_id_t)id_of_node, + &keys_node_bitmask); + if (SL_STATUS_OK != status) { + sl_log_error(LOG_TAG, + "Error setting granted keys of the node %d", + id_of_node); + return -1; + } +#endif + + sl_log_debug(LOG_TAG, "Saved NLS state of the node %d", id_of_node); + return 0; + } + + // Consider the case as error where NLS state is sent as 0. The protocol + // should send only NLS enabled nodes. + return -1; } /************************* Our interface functions ****************************/ @@ -685,4 +873,4 @@ sl_status_t zwave_s2_abort_send_data(zwave_tx_session_id_t session_id) return SL_STATUS_OK; } return SL_STATUS_NOT_FOUND; -} \ No newline at end of file +} diff --git a/applications/zpc/components/zwave/zwave_transports/s2/test/CMakeLists.txt b/applications/zpc/components/zwave/zwave_transports/s2/test/CMakeLists.txt index db26978a4..7cdcffdaf 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/test/CMakeLists.txt +++ b/applications/zpc/components/zwave/zwave_transports/s2/test/CMakeLists.txt @@ -42,6 +42,7 @@ target_add_unittest( zwave_s2_network_test.c DEPENDS libs2_mock + libs2_external_mock zwave_network_management_mock zwave_api_mock uic_contiki_stub @@ -61,21 +62,7 @@ target_add_unittest( zwave_api_mock uic_contiki_stub zwave_tx_mock - zwave_network_management_mock) - -# ####################### S2 Protocol CC Encryption test ################################## -target_add_unittest( - zwave_s2 - NAME - zwave_s2_protocol_cc_encryption_test - SOURCES - zwave_s2_protocol_cc_encryption_test.c - DEPENDS - zwave_controller ## Non-mock, we use the real thing here - libs2_mock - zwave_api_mock - uic_contiki_stub - zwave_tx_mock + zpc_attribute_store_test_helper zwave_network_management_mock) # ####################### S2 Nonce Management test ################################## @@ -88,3 +75,109 @@ target_add_unittest( DEPENDS zwave_network_management_mock) target_compile_definitions(zwave_s2_nonce_management_test PRIVATE ZW_CONTROLLER) + +# ####################### S2 Inclusion Controller test ################################## +add_definitions(-DDllExport=extern) + +add_unity_test( + NAME + zwave_s2_inclusion_including_node + FILES + ../${ZW-LIBS2_PATH}/inclusion/s2_inclusion.c + ../src/zwave_s2_inclusion_controller.c + zwave_s2_inclusion_including_node.c + LIBRARIES + mock + s2_mock + s2_inclusion_mocks + crypto_mocks +) +set_target_properties( + zwave_s2_inclusion_including_node + PROPERTIES + COMPILE_DEFINITIONS "ZW_CONTROLLER" +) +target_include_directories( + zwave_s2_inclusion_including_node + PRIVATE + ${ZPC_SOURCE_DIR}/components/zwave/zwave_definitions/include + ../${ZW-LIBS2_PATH}/include + ../${ZW-LIBS2_PATH}/inclusion + src +) + +add_unity_test( + NAME + zwave_s2_inclusion_joining_node_controller + TEST_BASE + zwave_s2_inclusion_including_node.c + FILES + ../${ZW-LIBS2_PATH}/inclusion/s2_inclusion.c + ../src/zwave_s2_inclusion_controller.c + zwave_s2_inclusion_including_node.c + LIBRARIES + mock + s2_mock + s2_inclusion_mocks + crypto_mocks +) +set_target_properties( + zwave_s2_inclusion_joining_node_controller + PROPERTIES + COMPILE_DEFINITIONS "ZW_CONTROLLER" +) +target_include_directories( + zwave_s2_inclusion_joining_node_controller + PRIVATE + ${ZPC_SOURCE_DIR}/components/zwave/zwave_definitions/include + ../${ZW-LIBS2_PATH}/include + ../${ZW-LIBS2_PATH}/inclusion + src +) + +add_unity_test( + NAME + zwave_s2_inclusion + FILES + ../${ZW-LIBS2_PATH}/inclusion/s2_inclusion.c + ../src/zwave_s2_inclusion_controller.c + zwave_s2_inclusion.c + LIBRARIES + mock + s2_mock + s2_inclusion_mocks + s2crypto + aes +) +set_target_properties( + zwave_s2_inclusion + PROPERTIES + COMPILE_DEFINITIONS "ZW_CONTROLLER" +) +target_include_directories( + zwave_s2_inclusion + PRIVATE + ${ZPC_SOURCE_DIR}/components/zwave/zwave_definitions/include + ../${ZW-LIBS2_PATH}/include + ../${ZW-LIBS2_PATH}/inclusion + src +) + +add_unity_test( + NAME + zwave_s2_protocol + FILES + zwave_s2_protocol.c + LIBRARIES + s2_controller + s2crypto + aes +) +target_include_directories( + zwave_s2_protocol + PRIVATE + ${ZPC_SOURCE_DIR}/components/zwave/zwave_definitions/include + ../${ZW-LIBS2_PATH}/include + ../${ZW-LIBS2_PATH}/inclusion + src +) \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_inclusion.c b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_inclusion.c new file mode 100644 index 000000000..b8ad1150a --- /dev/null +++ b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_inclusion.c @@ -0,0 +1,353 @@ +/* © 2015Silicon Laboratories Inc. + */ +/* + * Created on: Aug 25, 2015 + * Author: trasmussen + */ + + #include "s2_inclusion.h" + #include + #include + #include + #include "s2_protocol.h" + #include "unity.h" + #include "curve25519.h" + #include "s2_keystore.h" + + void setUpSuite(void) { + + } + + void tearDownSuite(void) { + + } + + #define ELEM_COUNT(ARRAY) (sizeof(ARRAY)/(sizeof(ARRAY[0]))) + #define UNIT_TEST_TEMP_KEY_SECURE 5 //< Value identifying index for the temporary key in S2 network key when transmitting secure frames. + #define UNIT_TEST_NETWORK_KEY 6 //< Value identifying index for the temporary key in S2 network key when transmitting secure frames. + + // Public key A as used in ECDH curve test cases. + static uint8_t m_test_public_key_a[] = {0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, + 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, + 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4, + 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a}; + + // Public key B as used in ECDH curve test cases. + static uint8_t m_test_public_key_b[] = {0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, + 0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, + 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d, + 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f}; + + // Private key A as used in ECDH curve test cases. + static uint8_t m_test_private_key_a[] = {0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, + 0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2, 0x66, 0x45, + 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a, + 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a}; + + // Private key B as used in ECDH curve test cases. + static uint8_t m_test_private_key_b[] = {0x5d, 0xab, 0x08, 0x7e, 0x62, 0x4a, 0x8a, 0x4b, + 0x79, 0xe1, 0x7f, 0x8b, 0x83, 0x80, 0x0e, 0xe6, + 0x6f, 0x3b, 0xb1, 0x29, 0x26, 0x18, 0xb6, 0xfd, + 0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb}; + + //static uint8_t m_test_public_key_a[32]; + //static uint8_t m_test_public_key_b[32]; + + static uint8_t m_test_network_key_s2_class_0[] = {0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, + 0x00, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99}; + + static uint8_t m_test_network_key_s0[] = {0xCA, 0xFE, 0xBA, 0xBE, 0x44, 0x33, 0x22, 0x11, + 0xCA, 0xFE, 0xBA, 0xBE, 0xCC, 0xBB, 0xAA, 0x99}; + + void compare_any_all_args(mock_t *p_mock) + { + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For this call we just expect any, as we will feed the actual output into next event. + p_mock->compare_rule_arg[1] = COMPARE_ANY; + p_mock->compare_rule_arg[2] = COMPARE_ANY; + p_mock->compare_rule_arg[3] = COMPARE_ANY; + } + + /** This is not a real test case but a test to ensure that the including node + * code in inclusion is correctly working when building for a controller. + */ + void test_controller_build(void) + { + #ifndef ZW_CONTROLLER + TEST_FAIL_MESSAGE("ZW_CONTROLLER is not defined but including node (ZW Controller) test cases are being executed."); + #endif + } + + /** Verification that the normal flow succeeds in inclusion of a new node. + * + * It verifies the behavior as seen from an including node (Controller node) as described in SDS11274. + * + * When a node is to be included securely it is expected that a ZW_SendData is send. + * For this the common S2_send_frame(...) defined in s2.h is used, which will be implemented elsewhere. + */ + void test_kex_joining_node_state_machine(void) { + mock_t * p_kex_get_mock; + mock_t * p_kex_report_mock; + mock_t * p_kex_set_mock; + mock_t * p_pub_key_b_report_mock; + mock_t * p_pub_key_a_report_mock; + mock_t * p_network_key_joining_update_temp_key_mock; + mock_t * p_network_key_including_update_temp_key_mock; + + mock_t * p_echo_kex_set_mock; + mock_t * p_echo_kex_report_mock; + mock_t * p_network_key_get_round1_mock; + mock_t * p_network_key_report_round1_mock; + mock_t * p_network_key_verify_round1_mock; + mock_t * p_network_key_update_round1_mock; + mock_t * p_transfer_end_round1_mock; + mock_t * p_network_key_get_round2_mock; + mock_t * p_network_key_report_round2_mock; + mock_t * p_network_key_verify_round2_mock; + mock_t * p_network_key_update_round2_mock; + mock_t * p_transfer_end_round2_mock; + mock_t * p_transfer_end_complete_mock; + + mock_t * p_keystore_clear; + mock_t * p_keystore_read_pub_a; + mock_t * p_keystore_read_pub_b; + mock_t * p_keystore_read_priv_a; + mock_t * p_keystore_read_priv_b; + mock_t * p_keystore_read_network_key_s2_class_0; + mock_t * p_keystore_read_network_key_s0; + + struct S2 s2_including_context; + struct S2 s2_joining_context; + s2_connection_t s2_joining_conn; + s2_connection_t s2_including_conn; + + s2_joining_conn.l_node = 2; + s2_joining_conn.r_node = 1; + s2_joining_conn.class_id = 0xFF; + s2_joining_conn.rx_options = 0x00; + + s2_including_conn.l_node = 1; + s2_including_conn.r_node = 2; + s2_including_conn.class_id = 0xFF; + s2_including_conn.rx_options = 0x00; + + /**************************** + * Mock expectation section * + ****************************/ + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(s2_inclusion_event_handler)); + mock_call_use_as_stub(TO_STR(keystore_network_key_write)); + + // Keystore calls. + mock_call_expect(TO_STR(keystore_network_key_clear), &p_keystore_clear); + p_keystore_clear->expect_arg[0].value = 0xFF; + + mock_call_expect(TO_STR(keystore_dynamic_public_key_read), &p_keystore_read_pub_b); + p_keystore_read_pub_b->output_arg[0].pointer = m_test_public_key_b; + + mock_call_expect(TO_STR(keystore_public_key_read), &p_keystore_read_pub_a); + p_keystore_read_pub_a->output_arg[0].pointer = m_test_public_key_a; + + // When calculating the shared secret - Joining node. + mock_call_expect(TO_STR(keystore_dynamic_private_key_read), &p_keystore_read_priv_b); + p_keystore_read_priv_b->output_arg[0].pointer = m_test_private_key_b; + mock_call_expect(TO_STR(keystore_dynamic_public_key_read), &p_keystore_read_pub_b); + p_keystore_read_pub_b->output_arg[0].pointer = m_test_public_key_b; + mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_joining_update_temp_key_mock); + compare_any_all_args(p_network_key_joining_update_temp_key_mock); + + // When calculating the shared secret - Joining node. + mock_call_expect(TO_STR(keystore_private_key_read), &p_keystore_read_priv_a); + p_keystore_read_priv_a->output_arg[0].pointer = m_test_private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_keystore_read_pub_a); + p_keystore_read_pub_a->output_arg[0].pointer = m_test_public_key_a; + mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_including_update_temp_key_mock); + compare_any_all_args(p_network_key_including_update_temp_key_mock); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_keystore_read_network_key_s2_class_0); + p_keystore_read_network_key_s2_class_0->expect_arg[0].value = KEY_CLASS_S2_UNAUTHENTICATED; + p_keystore_read_network_key_s2_class_0->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_keystore_read_network_key_s0); + p_keystore_read_network_key_s0->expect_arg[0].value = KEY_CLASS_S0; + p_keystore_read_network_key_s0->output_arg[1].pointer = m_test_network_key_s0; + + // Expectations of call for transmitting network frames. + mock_call_expect(TO_STR(S2_send_frame), &p_kex_get_mock); + compare_any_all_args(p_kex_get_mock); + + mock_call_expect(TO_STR(S2_send_frame), &p_kex_report_mock); + compare_any_all_args(p_kex_report_mock); + + mock_call_expect(TO_STR(S2_send_frame), &p_kex_set_mock); + compare_any_all_args(p_kex_set_mock); + + mock_call_expect(TO_STR(S2_send_frame), &p_pub_key_b_report_mock); + compare_any_all_args(p_pub_key_b_report_mock); + + mock_call_expect(TO_STR(S2_send_frame), &p_pub_key_a_report_mock); + compare_any_all_args(p_pub_key_a_report_mock); + + mock_call_expect(TO_STR(S2_send_data), &p_echo_kex_set_mock); + compare_any_all_args(p_echo_kex_set_mock); + + mock_call_expect(TO_STR(S2_send_data), &p_echo_kex_report_mock); + compare_any_all_args(p_echo_kex_report_mock); + + mock_call_expect(TO_STR(S2_send_data), &p_network_key_get_round1_mock); + compare_any_all_args(p_network_key_get_round1_mock); + + mock_call_expect(TO_STR(S2_send_data), &p_network_key_report_round1_mock); + compare_any_all_args(p_network_key_report_round1_mock); + + mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_update_round1_mock); + compare_any_all_args(p_network_key_update_round1_mock); + mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_update_round1_mock); + compare_any_all_args(p_network_key_update_round1_mock); + + mock_call_expect(TO_STR(S2_send_data), &p_network_key_verify_round1_mock); + compare_any_all_args(p_network_key_verify_round1_mock); + + mock_call_expect(TO_STR(S2_send_data), &p_transfer_end_round1_mock); + compare_any_all_args(p_transfer_end_round1_mock); + + mock_call_expect(TO_STR(S2_send_data), &p_network_key_get_round2_mock); + compare_any_all_args(p_network_key_get_round2_mock); + + mock_call_expect(TO_STR(S2_send_data), &p_network_key_report_round2_mock); + compare_any_all_args(p_network_key_report_round2_mock); + + mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_update_round2_mock); + compare_any_all_args(p_network_key_update_round2_mock); + mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_update_round2_mock); + compare_any_all_args(p_network_key_update_round2_mock); + + mock_call_expect(TO_STR(S2_send_data), &p_network_key_verify_round2_mock); + compare_any_all_args(p_network_key_verify_round2_mock); + + mock_call_expect(TO_STR(S2_network_key_update), &p_network_key_update_round2_mock); + compare_any_all_args(p_network_key_update_round2_mock); + + mock_call_expect( TO_STR(S2_send_data), &p_transfer_end_round2_mock); + compare_any_all_args(p_transfer_end_round2_mock); + + + mock_call_expect( TO_STR(S2_send_data), &p_transfer_end_complete_mock); + compare_any_all_args(p_transfer_end_complete_mock); + + /******************* + * Testing section * + *******************/ + // All output from previous call (which is recordered by the mock) will be fed into the state + // machine for the opposit site context. + s2_joining_context.inclusion_state = 0; + s2_including_context.inclusion_state = 0; + + s2_inclusion_init(SECURITY_2_SCHEME_1_SUPPORT, + KEX_REPORT_CURVE_25519, + 0x81 /* SECURITY_2_KEY_0 | SECURITY_2_KEY_2_CLASS_0 */); + + s2_inclusion_joining_start(&s2_joining_context,&s2_joining_conn,0); + s2_inclusion_including_start(&s2_including_context,&s2_including_conn); + + s2_joining_context.buf = p_kex_get_mock->actual_arg[2].pointer; + s2_joining_context.length = p_kex_get_mock->actual_arg[3].value; + s2_joining_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); + + s2_including_context.buf = p_kex_report_mock->actual_arg[2].pointer; + s2_including_context.length = p_kex_report_mock->actual_arg[3].value; + s2_including_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_including_context, &s2_including_conn); + + s2_inclusion_key_grant(&s2_including_context, 1, 0x81,0); + + s2_joining_context.buf = p_kex_set_mock->actual_arg[2].pointer; + s2_joining_context.length = p_kex_set_mock->actual_arg[3].value; + s2_joining_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); + + s2_including_context.buf = p_pub_key_b_report_mock->actual_arg[2].pointer; + s2_including_context.length = p_pub_key_b_report_mock->actual_arg[3].value; + s2_including_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_including_context, &s2_including_conn); + + s2_joining_context.buf = p_pub_key_a_report_mock->actual_arg[2].pointer; + s2_joining_context.length = p_pub_key_a_report_mock->actual_arg[3].value; + s2_joining_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); + + + s2_inclusion_challenge_response(&s2_including_context, 1, m_test_public_key_b, 2); + s2_inclusion_challenge_response(&s2_joining_context, 1,m_test_public_key_a, 0); + + + s2_including_context.buf = p_echo_kex_set_mock->actual_arg[2].pointer; + s2_including_context.length = p_echo_kex_set_mock->actual_arg[3].value; + s2_including_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_including_context, &s2_including_conn); + + s2_joining_context.buf = p_echo_kex_report_mock->actual_arg[2].pointer; + s2_joining_context.length = p_echo_kex_report_mock->actual_arg[3].value; + s2_joining_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); + + s2_including_context.buf = p_network_key_get_round1_mock->actual_arg[2].pointer; + s2_including_context.length = p_network_key_get_round1_mock->actual_arg[3].value; + s2_including_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_including_context, &s2_including_conn); + + s2_joining_context.buf = p_network_key_report_round1_mock->actual_arg[2].pointer; + s2_joining_context.length = p_network_key_report_round1_mock->actual_arg[3].value; + s2_joining_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); + + s2_including_context.buf = p_network_key_verify_round1_mock->actual_arg[2].pointer; + s2_including_context.length = p_network_key_verify_round1_mock->actual_arg[3].value; + s2_including_conn.class_id = 0x00; + s2_inclusion_post_event(&s2_including_context, &s2_including_conn); + + s2_joining_context.buf = p_transfer_end_round1_mock->actual_arg[2].pointer; + s2_joining_context.length = p_transfer_end_round1_mock->actual_arg[3].value; + s2_joining_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); + + s2_including_context.buf = p_network_key_get_round2_mock->actual_arg[2].pointer; + s2_including_context.length = p_network_key_get_round2_mock->actual_arg[3].value; + s2_including_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_including_context, &s2_including_conn); + + s2_joining_context.buf = p_network_key_report_round2_mock->actual_arg[2].pointer; + s2_joining_context.length = p_network_key_report_round2_mock->actual_arg[3].value; + s2_joining_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); + + s2_including_context.buf = p_network_key_verify_round2_mock->actual_arg[2].pointer; + s2_including_context.length = p_network_key_verify_round2_mock->actual_arg[3].value; + s2_including_conn.class_id = UNIT_TEST_NETWORK_KEY; + s2_inclusion_post_event(&s2_including_context, &s2_including_conn); + + s2_joining_context.buf = p_transfer_end_round2_mock->actual_arg[2].pointer; + s2_joining_context.length = p_transfer_end_round2_mock->actual_arg[3].value; + s2_joining_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_joining_context, &s2_joining_conn); + + // Verify that both sides agree on the calculated temporary key. + // Original test compared ->actual_arg[1] instead of ->actual_arg[2]. + // ->actual_arg[1] contained a 0 (NULL) and thus always returned without comparing. + // Index 2 is containing the actual indexes, however, those do not match. + // However, that was also the case when NULL pointer was wrongly compared. + // ToDo: EInvestigate if and how the calculated temp key should be compared. Test is disabled for now. + // TEST_ASSERT_EQUAL_UINT8_ARRAY(p_network_key_joining_update_temp_key_mock->actual_arg[2].pointer, + // p_network_key_including_update_temp_key_mock->actual_arg[2].pointer, + // 16); + + // Verify the mock has been called and stop test if not, to avoid p_transfer_end_complete_mock->actual_arg[2].pointer dereference 0x00. + TEST_ASSERT_TRUE(p_transfer_end_complete_mock->executed); + // 0x0C in second byte is the command value, here a TRANSFER_END is expected. + TEST_ASSERT_EQUAL_UINT8(0x0C, ((uint8_t *)p_transfer_end_complete_mock->actual_arg[2].pointer)[1]); + // 0x01 in third byte denotes the if key exchange is complete. + TEST_ASSERT_EQUAL_UINT8(0x01, ((uint8_t *)p_transfer_end_complete_mock->actual_arg[2].pointer)[2]); + + mock_calls_verify(); + } \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_inclusion_including_node.c b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_inclusion_including_node.c new file mode 100644 index 000000000..f837623da --- /dev/null +++ b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_inclusion_including_node.c @@ -0,0 +1,6502 @@ +/* © 2014 Silicon Laboratories Inc. + */ +/* + * zwave_s2_inclusion_including_node.c + * + * Created on: Aug 25, 2015 + * Author: trasmussen + */ + + #include "s2_inclusion.h" + #include + #include + #include + #include "platform.h" + #include "unity.h" + #include "s2_protocol.h" + + #include "ZW_classcmd.h" + #include "s2_classcmd.h" + + void setUpSuite(void) { + + } + + void tearDownSuite(void) { + + } + + #define ELEM_COUNT(ARRAY) (sizeof(ARRAY)/(sizeof(ARRAY[0]))) + #define UNIT_TEST_TEMP_KEY_SECURE 5 //< Value identifying index for the temporary key in S2 network key when transmitting secure frames. + #define UNIT_TEST_NETWORK_KEY 6 //< Value identifying index for the temporary key in S2 network key when transmitting secure frames. + + /** Overview of behavior which should be implemented: + * General inclusion: + * - Implement SM according to designed flow. + * - Identify all events and actions which must be handled and executed during node inclusion. + * - It is expected that a common S2 layer resides above the inclusion module (and other S2 + * related modules) which is responsible for dispatching packet/events based on command. + * In the tests it is expected that a learn request will initiate the inclusion flow. + * - Early discussions on future direction has been initiated between Torsten, Jakob, and Anders on event generation + * Early ideas is to have an event notification system which could be simplified version of SKB in Linux. + * This work must progress but in S2_inclusion.c a simple notification system will be taken into use with refactoring possibilities. + * + * + * Error handling: + * - Timeout: it must be ensured that a proper timer API is available for the inclusion state machine is available. + * In case a timeout occurs, it must be ensured that the inclusion state machine returns to idle and + * appropriate error is notified to callback provided by protocol layer. + * Error handler provided by protocol layer is expected to be implemented by application.. + * The SM will not be responsible for further actions due to timeouts. + * + */ + + /** Current working assumptions: + * Lib S2 - message encapsulation/inclusion mode and context handling + * - Currently context is updated with peer, buffer, and length in libs2 protocol (message + * encapsulation handling), this should be moved to common place. s2 dispatch layer ? + * - Libs2 S2.c contains the entry point for frames receined, S2_application_command_handler(.), + * this should ideally be refactored to upper dispatcher layer which should be common for encapsulation handling and inclusion. + */ + + /** Currently identyfied test cases not yet implemented. + * + * - Key Verify failure. + * + */ + #define UNIT_TEST_BUF_SIZE 256 + + static uint8_t m_test_mem_pool[4][256]; // Statically allocated chunks of memory that can be freely used during the test. + + // Public key A as used in ECDH curve test cases. + static uint8_t m_test_public_key_a[] = {0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, + 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, + 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4, + 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a}; + + // Public key B as used in ECDH curve test cases. + static uint8_t m_test_public_key_b[] = {0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, + 0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, + 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d, + 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f}; + + + // Obfuscated Public key B where first bytes are masked out as used for DSK input. + static uint8_t m_test_obfuscated_public_key_b[] = {0x00, 0x00, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, + 0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, + 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d, + 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f}; + + + //static uint8_t m_temp_key[] = {0x7E, 0xFE, 0x12, 0x32, 0x45, 0x65, 0x78, 0x98, + // 0x7E, 0xFE, 0x12, 0x32, 0x45, 0x65, 0x78, 0x98}; + + static uint8_t m_test_network_key_s2_class_0[] = {0x11, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, + 0x00, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99}; + + static uint8_t m_test_network_key_s2_class_1[] = {0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, + 0x00, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99}; + + static uint8_t m_test_network_key_s2_class_2[] = {0x22, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, + 0x00, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99}; + + static uint8_t m_test_network_key_s0[] = {0xCA, 0xFE, 0xBA, 0xBE, 0x44, 0x33, 0x22, 0x11, + 0xCA, 0xFE, 0xBA, 0xBE, 0xCC, 0xBB, 0xAA, 0x99}; + + s2_connection_t s2_conn; + /** Event listener for S2 inclusion. + * + * S2 will use an event listening scheme for posting notifications upwards. + * How the notification is stored/handled is outside scope of the state machine, but it is + * imagined that such system would implement a queing system to allow inclusion operations + * to progress as fast as possible. + * + * This forward declares the mock funtion used, because the callback is a function pointer with no named declaration. + */ + void s2_event_handler(zwave_event_t * p_zwave_evt); + + /** Forward declaration of helper classes. + * All helper classes are implemented in buttom of file to easily keep them seperated from the test cases. + */ + void helper_func_kex_report_frame(struct S2 *p_context); + void helper_func_echo_kex_report_frame_expect(uint8_t expected_scheme, uint8_t expected_curves, uint8_t expected_keys); + void helper_func_kex_set_frame_expect(uint8_t expected_scheme, uint8_t expected_curves, uint8_t expected_keys); + void helper_func_pub_key_frame(struct S2 *p_context); + void helper_func_echo_kex_set_frame(struct S2 *p_context); + void helper_func_net_key_get_frame(struct S2 *p_context, uint8_t key); + void helper_func_net_key_verify_frame(struct S2 *p_context, uint8_t key); + void helper_func_transfer_end_final_frame(struct S2 *p_context); + void helper_func_verify_idle_state(struct S2 *p_context); + void helper_func_kex_get_frame_expect(void); + void helper_func_restore_keys_expect(void); + static void helper_func_init_s2_conn(void); + + /** This is not a real test case but a test to ensure that the including node + * code in inclusion is correctly working when building for a controller. + */ + void test_controller_build(void) + { + #ifndef ZW_CONTROLLER + TEST_FAIL_MESSAGE("ZW_CONTROLLER is not defined but including node (ZW Controller) test cases are being executed."); + #endif + } + + /** Verification that the normal flow succeeds in inclusion of a new node when using SSA. + * + * It verifies the behavior as seen from an including node (Controller node) as described in SDS11274. + * + * When a node is to be included securely it is expected that a ZW_SendData is send. + * For this the common S2_send_frame(...) defined in s2.h is used, which will be implemented elsewhere. + */ + void test_kex_including_node_state_machine_csa(void) { + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x06, // bit 0 is echo field, bit 1 is CSA, bit 2 is NLS support. + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test expectation setup. + * This section set up the expectations in the system when the inclusion state machine progresses: + * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. + * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. + * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. + * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. + * 5) Exchange of public keys. + * a) Public KeyB is received from joining node A. + * - Public KeyB must be pushed upwards as event to be presented to user for further verification. + * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. + * Currently that use case is outside the scope of libs2. + * - When Public KeyB is received, the controller must send its public KeyA. + * Public KeyB shall be provided by the application. + * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. + * This is done in security sub module (currently under development) + * - The security context must be re-initialized with temporary derived key. + * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. + * 6) Echoing of KEX frames. + * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be + * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). + * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. + * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. + * 7) Network key exchange: + * a) Joining node will request the network key, by sending a 'Network Key Get'. + * b) Including node shall reply with a 'Network Key Set'. + * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' + * - Including node must verify that it can succesfully decrypt the message using the key. + * d) Including node shall reply with a 'Transfer End'. + * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. + * + */ + mock_t * p_mock; + + // Expect a S2 KEX Get to be sent. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x01; + p_expected_report_event->evt.s2_event.s2_data.kex_report.nls_available = 0x01; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, + 0x02, // bit0: echo field, bit1: CSA, bit2-7: Reserved. + 0x02, // Selected schemes: scheme 1. + 0x01, // Selected curve25519 + 0x82 // Keys to exchange, Security2, class 1 - Security0, network key. + }; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0; + memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_challenge_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent minus the first 4 bytes. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0x00, 0x00, 0x00, 0x00, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + + // Expect Echo(KEX Report) to be sent. + uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x07, 0x02, 0x01, 0x82}; // Note: Echo flag set. + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + // Expect Net Key Report to be sent. + uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02, }; + memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); + + // Expect S2 Transfer End to be sent. + uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x80; + p_mock->output_arg[1].pointer = m_test_network_key_s0; + + // Expect Net Key Set to be sent. + uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; + memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); + + // Expect S2 Transfer End to be sent. + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_mem_pool[0]; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_mem_pool[1]; + + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event ; + + /** + * Test execution. + */ + struct S2 s2_context; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82, 0x01); + + uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. + memcpy(&public_key_frame[3], m_test_public_key_b, sizeof(m_test_public_key_b)); + s2_context.buf = public_key_frame; + s2_context.length = sizeof(public_key_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, NULL, 0); + + // Echo(KEX Set) frame received. + // bit0: echo field set, bit1-7: Reserved. + // Selected schemes: scheme 0 and scheme 2. + // Selected curve25519 + // Keys to exchange, Security2, class 2 - Security0, network key. + uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x03, 0x02, 0x01, 0x82}; + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_frame; + s2_context.length = sizeof(s2_net_key_get_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_frame; + s2_context.length = sizeof(s2_net_key_verify_frame); + s2_conn.class_id = 0x01; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_0_frame; + s2_context.length = sizeof(s2_net_key_get_0_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_0_frame; + s2_context.length = sizeof(s2_net_key_verify_0_frame); + s2_conn.class_id = UNIT_TEST_NETWORK_KEY; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // S2 Transfer end frame received. + // bit0: Key request complete set, + // bit1: Key verified not set, + // bit2-7: Reserved. + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + /** Verification that the normal flow succeeds in inclusion of a new node when using SSA. + * + * It verifies the behavior as seen from an including node (Controller node) as described in SDS11274. + * + * When a node is to be included securely it is expected that a ZW_SendData is send. + * For this the common S2_send_frame(...) defined in s2.h is used, which will be implemented elsewhere. + */ + static void kex_including_node_state_machine_bad_tansfer_end(uint8_t transfer_end_code) { + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x00, // // bit 0 is echo field, bit 1 is CSA. + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test expectation setup. + * This section set up the expectations in the system when the inclusion state machine progresses: + * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. + * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. + * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. + * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. + * 5) Exchange of public keys. + * a) Public KeyB is received from joining node A. + * - Public KeyB must be pushed upwards as event to be presented to user for further verification. + * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. + * Currently that use case is outside the scope of libs2. + * - When Public KeyB is received, the controller must send its public KeyA. + * Public KeyB shall be provided by the application. + * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. + * This is done in security sub module (currently under development) + * - The security context must be re-initialized with temporary derived key. + * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. + * 6) Echoing of KEX frames. + * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be + * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). + * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. + * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. + * 7) Network key exchange: + * a) Joining node will request the network key, by sending a 'Network Key Get'. + * b) Including node shall reply with a 'Network Key Set'. + * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' + * - Including node must verify that it can succesfully decrypt the message using the key. + * d) Including node shall reply with a 'Transfer End'. + * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. + * + */ + mock_t * p_mock; + + // Expect a S2 KEX Get to be sent. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x00; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, + 0x00, // bit0: echo field, bit1-7: Reserved. + 0x02, // Selected schemes: scheme 1. + 0x01, // Selected curve25519 + 0x82 // Keys to exchange, Security2, class 1 - Security0, network key. + }; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_obfuscated_public_key_b); + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_challenge_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + + // Expect Echo(KEX Report) to be sent. + uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; // Note: Echo flag set. + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + // Expect Net Key Report to be sent. + uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02, }; + memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); + + // Expect S2 Transfer End to be sent. + uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x80; + p_mock->output_arg[1].pointer = m_test_network_key_s0; + + // Expect Net Key Set to be sent. + uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; + memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); + + // Expect S2 Transfer End to be sent. + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + // Expect that we send a KEX fail + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + uint8_t S2_kex_fail_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x09}; + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_fail_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x9; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event ; + + /** + * Test execution. + */ + struct S2 s2_context; + s2_conn.l_node = 1; + s2_conn.l_node = 2; + s2_conn.class_id = 0xFF; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82, 0x00); + + uint8_t public_key_frame[3 + sizeof(m_test_obfuscated_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. + memcpy(&public_key_frame[3], m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); + s2_context.buf = public_key_frame; + s2_context.length = sizeof(public_key_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // This should ensure the full public key is available. + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); + TEST_ASSERT_EQUAL_UINT8_ARRAY(s2_context.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + // Echo(KEX Set) frame received. + // bit0: echo field set, bit1-7: Reserved. + // Selected schemes: scheme 0 and scheme 2. + // Selected curve25519 + // Keys to exchange, Security2, class 2 - Security0, network key. + uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; + + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_frame; + s2_context.length = sizeof(s2_net_key_get_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_frame; + s2_context.length = sizeof(s2_net_key_verify_frame); + s2_conn.class_id = 0x01; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_0_frame; + s2_context.length = sizeof(s2_net_key_get_0_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_0_frame; + s2_context.length = sizeof(s2_net_key_verify_0_frame); + s2_conn.class_id = UNIT_TEST_NETWORK_KEY; + s2_inclusion_post_event(&s2_context, &s2_conn); + + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, transfer_end_code}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + void test_kex_including_node_state_machine_bad_tansfer_end2(uint8_t transfer_end_code) { + // S2 Transfer end frame received. + // bit0: Key request complete not set, + // bit1: Key verified set, + // bit2-7: Reserved. + kex_including_node_state_machine_bad_tansfer_end(2); + } + + void test_kex_including_node_state_machine_bad_tansfer_end3(uint8_t transfer_end_code) { + // S2 Transfer end frame received. + // bit0: Key request complete set, + // bit1: Key verified set, + // bit2-7: Reserved. + kex_including_node_state_machine_bad_tansfer_end(3); + } + + + void test_kex_including_node_state_machine_ssa(void) { + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x00, // // bit 0 is echo field, bit 1 is CSA. + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test expectation setup. + * This section set up the expectations in the system when the inclusion state machine progresses: + * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. + * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. + * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. + * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. + * 5) Exchange of public keys. + * a) Public KeyB is received from joining node A. + * - Public KeyB must be pushed upwards as event to be presented to user for further verification. + * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. + * Currently that use case is outside the scope of libs2. + * - When Public KeyB is received, the controller must send its public KeyA. + * Public KeyB shall be provided by the application. + * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. + * This is done in security sub module (currently under development) + * - The security context must be re-initialized with temporary derived key. + * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. + * 6) Echoing of KEX frames. + * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be + * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). + * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. + * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. + * 7) Network key exchange: + * a) Joining node will request the network key, by sending a 'Network Key Get'. + * b) Including node shall reply with a 'Network Key Set'. + * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' + * - Including node must verify that it can succesfully decrypt the message using the key. + * d) Including node shall reply with a 'Transfer End'. + * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. + * + */ + mock_t * p_mock; + + // Expect a S2 KEX Get to be sent. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x00; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, + 0x00, // bit0: echo field, bit1-7: Reserved. + 0x02, // Selected schemes: scheme 1. + 0x01, // Selected curve25519 + 0x82 // Keys to exchange, Security2, class 1 - Security0, network key. + }; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_obfuscated_public_key_b); + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_challenge_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + + // Expect Echo(KEX Report) to be sent. + uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; // Note: Echo flag set. + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + // Expect Net Key Report to be sent. + uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02, }; + memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); + + // Expect S2 Transfer End to be sent. + uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x80; + p_mock->output_arg[1].pointer = m_test_network_key_s0; + + // Expect Net Key Set to be sent. + uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; + memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); + + // Expect S2 Transfer End to be sent. + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event ; + + /** + * Test execution. + */ + struct S2 s2_context; + s2_conn.l_node = 1; + s2_conn.l_node = 2; + s2_conn.class_id = 0xFF; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82, 0x00); + + uint8_t public_key_frame[3 + sizeof(m_test_obfuscated_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. + memcpy(&public_key_frame[3], m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); + s2_context.buf = public_key_frame; + s2_context.length = sizeof(public_key_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // This should ensure the full public key is available. + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); + TEST_ASSERT_EQUAL_UINT8_ARRAY(s2_context.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + // Echo(KEX Set) frame received. + // bit0: echo field set, bit1-7: Reserved. + // Selected schemes: scheme 0 and scheme 2. + // Selected curve25519 + // Keys to exchange, Security2, class 2 - Security0, network key. + uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; + + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_frame; + s2_context.length = sizeof(s2_net_key_get_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_frame; + s2_context.length = sizeof(s2_net_key_verify_frame); + s2_conn.class_id = 0x01; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_0_frame; + s2_context.length = sizeof(s2_net_key_get_0_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_0_frame; + s2_context.length = sizeof(s2_net_key_verify_0_frame); + s2_conn.class_id = UNIT_TEST_NETWORK_KEY; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // S2 Transfer end frame received. + // bit0: Key request complete set, + // bit1: Key verified not set, + // bit2-7: Reserved. + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + /** Verification that the normal flow succeeds when send done is succesful. + * + */ + void test_kex_including_node_sond_complete(void) { + // uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + // 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + // 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + // 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + // + // uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + // 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + // 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + // 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + // + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x00, // bit 0 is echo field, rest are reserved + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + mock_call_use_as_stub(TO_STR(s2_event_handler)); + mock_call_use_as_stub(TO_STR(S2_send_data)); + mock_call_use_as_stub(TO_STR(S2_send_frame)); + mock_call_use_as_stub(TO_STR(s2_keystore_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test execution. + */ + struct S2 s2_context; + s2_conn.l_node = 1; + s2_conn.r_node = 2; + s2_conn.class_id = 0xFF; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_KEX_REPORT, s2_context.inclusion_state); + + // KEX Report frame received. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_KEY_USER_ACCEPT, s2_context.inclusion_state); + + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_PUB_KEY_B, s2_context.inclusion_state); + + uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. + memcpy(&public_key_frame[3], m_test_public_key_b, sizeof(m_test_public_key_b)); + s2_context.buf = public_key_frame; + s2_context.length = sizeof(public_key_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_USER_ACCEPT, s2_context.inclusion_state); + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); + TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_ECHO_KEX_SET, s2_context.inclusion_state); + + // Echo(KEX Set) frame received. + // bit0: echo field set, bit1-7: Reserved. + // Selected schemes: scheme 0 and scheme 2. + // Selected curve25519 + // Keys to exchange, Security2, class 2 - Security0, network key. + uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_NET_KEY_GET, s2_context.inclusion_state); + + // Network Key Get frame received. + uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_frame; + s2_context.length = sizeof(s2_net_key_get_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_NET_KEY_VERIFY, s2_context.inclusion_state); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_frame; + s2_context.length = sizeof(s2_net_key_verify_frame); + s2_conn.class_id = 0x01; + s2_inclusion_post_event(&s2_context, &s2_conn); + TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_NET_KEY_GET, s2_context.inclusion_state); + + // Network Key Get frame received. + uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_0_frame; + s2_context.length = sizeof(s2_net_key_get_0_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_NET_KEY_VERIFY, s2_context.inclusion_state); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_0_frame; + s2_context.length = sizeof(s2_net_key_verify_0_frame); + s2_conn.class_id = UNIT_TEST_NETWORK_KEY; + s2_inclusion_post_event(&s2_context, &s2_conn); + TEST_ASSERT_EQUAL_UINT8(S2_AWAITING_TRANSFER_END, s2_context.inclusion_state); + + // S2 Transfer end frame received. + // bit0: Key request complete set, + // bit1: Key verified not set, + // bit2-7: Reserved. + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + TEST_ASSERT_EQUAL_UINT8(S2_INC_IDLE, s2_context.inclusion_state); + + mock_calls_verify(); + } + + /** Test case for ensuring correct timer handling during inclusion. + * + * Purpose: In order to ensure correct inclusion flow and avoid deadlock during inclusion it is + * important that in case messages are never received during inclusion, then the state + * machine must return to idle a push a corresponding event. + * + * Not to test: This test case will only verify expectations related to the timer handling. + * Thus content of frames sent between the nodes during inclusion are not + * relevant for this test as they are verified in: test_kex_including_node_state_machine() + * NOTE: messages related to Timeout will be verified in this test. + */ + void test_kex_inclusion_timer_handling(void) { + mock_t * p_mock; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(S2_send_frame)); + mock_call_use_as_stub(TO_STR(S2_send_data)); + mock_call_use_as_stub(TO_STR(s2_event_handler)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(s2_keystore_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + s2_conn.l_node = 1; + s2_conn.r_node = 2; + s2_conn.class_id = 0xFF; + + /** Timer start expected on every transmitted frame. + * For flow chart, see SDS11274. + * Timer values: + * - TA1, TA2, TA4, TA5, TA6, TA7, TA : 10s + * - TA3 : 20s + * - TAI1, TAI2 : 240s + */ + + // When initiating the secure inclusion of node B, then we expect a Timer Start call. + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 1000; + p_mock->return_code.value = 1; + + // When receiving next frame we expect the timer to be stopped. + mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); + + // After pushing up the event with requested keys, then we expect a reset of the timer with 240s for user input. + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 24000; + p_mock->return_code.value = 1; + + // After user acceptance we expect the timer to be stopped. + mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); + + // After transmitting KEX Set we expect a reset of the timer. + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 1000; + p_mock->return_code.value = 1; + + // When receiving next frame we expect the timer to be stopped. + mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); + + // After transmitting Public Key and pushing event upwards with received public key we expect a reset of the timer. + // Timeout is 240s for the user to provide the missing part of the DSK. + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 24000; + p_mock->return_code.value = 1; + + // After receiving the echo Kex set we expect the timer to be stopped. + mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); + + // After transmitting echo(KEX Report) we expect a reset of the timer. + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 1000; + p_mock->return_code.value = 1; + + // When receiving next frame (Net Key Get) we expect the timer to be stopped. + mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); + + // After transmitting Network Key Set we expect a reset of the timer. + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 1000; + p_mock->return_code.value = 1; + + // When receiving next frame (Net Key Verify, key 0x02) we expect the timer to be stopped. + mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); + + // After transmitting Transfer End we expect a reset of the timer. + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 1000; + p_mock->return_code.value = 1; + + // When receiving next frame (Net Key Get) we expect the timer to be stopped. + mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); + + // After transmitting Network Key Set we expect a reset of the timer. + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 1000; + p_mock->return_code.value = 1; + + // When receiving next frame (Net Key Verify, key 0x80) we expect the timer to be stopped. + mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); + + // After transmitting Transfer End we expect a reset of the timer. + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 1000; + p_mock->return_code.value = 1; + + // When receiving the final transfer end frame we expect the timer to be stopped. + mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context, &s2_conn); + + helper_func_kex_report_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); + + helper_func_echo_kex_set_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_get_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_verify_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_get_frame(&s2_context, 0x80); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_verify_frame(&s2_context, 0x80); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_transfer_end_final_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + + /** Test case for ensuring correct timer handling on timeout during inclusion in case a timeout + * occurs after sending KEX Get. + * + * Purpose: In order to ensure correct inclusion flow and avoid deadlock during inclusion it is + * important that in case messages are never received during inclusion, then the state + * machine must return to idle and push a corresponding event. + * + * Test: This test case will verify expectations related to the timer handling. + * If a joining node does not respond within the timeout to a S2 inclusion frame then the + * state machine must return to idle and push the corresponding event upwards to application. + * After timeout, we expect the system to retry node inclusion. + * + */ + void test_kex_inclusion_timeout_kex_get_with_retry(void) { + mock_t * p_mock; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + + mock_calls_clear(); + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + + /** Timer start expected on every transmitted frame. + * For flow chart, see SDS11274. + * Timer values: + * - TA1, TA2, TA4, TA5, TA6, TA7, TA : 10s + * - TA3 : 20s + * - TI1 : 240s + */ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // When initiating the secure inclusion of node B, then we expect a Timer Start call. + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 1000; + p_mock->return_code.value = 1; + + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // When the secure inclusion fails we expect any inclusion timers to be stopped. + mock_call_expect(TO_STR(s2_inclusion_stop_timeout), &p_mock); + + // After receiving a timeout it is expected that the inclusion state machine is back in idle and + // that we can initiate a new inclusion which will also trigger a new set timeout call. + uint8_t S2_kex_get_frame_retry[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame_retry; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame_retry); + + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 1000; + p_mock->return_code.value = 1; + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + s2_inclusion_notify_timeout(&s2_context); + + // Retry node inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + mock_calls_verify(); + } + + + /** Test case for ensuring correct timer handling on timeout during inclusion in case a timeout + * occurs after sending KEX Set. + * + * Purpose: In order to ensure correct inclusion flow and avoid deadlock during inclusion it is + * important that in case messages are never received during inclusion, then the state + * machine must return to idle and push a corresponding event. + * + * Test: This test case will verify expectations related to the timer handling. + * If a joining node does not respond within the timeout to a S2 inclusion frame then the + * state machine must return to idle and push the corresponding event upwards to application. + * After timeout, we expect the system to retry node inclusion. + * + */ + void test_kex_inclusion_timeout_kex_set_with_retry(void) { + mock_t * p_mock; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // After receiving a timeout it is expected that the inclusion state machine is back in idle and + // that we can initiate a new inclusion. + uint8_t S2_kex_get_frame_retry[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame_retry; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame_retry); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received. + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x02, 0x01, 0x82}; // Scheme 1, curve25519, S2, key 1, and S0 network key. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + + // Trigger a timeout. + s2_inclusion_notify_timeout(&s2_context); + + // Retry node inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + mock_calls_verify(); + } + + /** Test case for ensuring correct timer handling on timeout during inclusion in case a timeout + * occurs after any state. + * + * Purpose: In order to ensure correct inclusion flow and avoid deadlock during inclusion it is + * important that in case messages are never received during inclusion, then the state + * machine must return to idle and push a corresponding event. + * + * Test: This test case will verify expectations related to the timer handling. + * If a joining node does not respond within the timeout to a S2 inclusion frame then the + * state machine must return to idle and push the corresponding event upwards to application. + * After timeout, we expect the system to retry node inclusion. + * As this test case must covers timeout in ANY state, it will loop over the expectations and + * decrement a counter to go one step further on each loop. + * + */ + #define NO_OF_STATES 6 + void test_kex_inclusion_timeout_all_states(void) { + mock_t * p_mock; + uint32_t i; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + helper_func_init_s2_conn(); + + /** The loop which will set up the expectation based on the round. */ + for (i = 0; i < NO_OF_STATES; i++) + { + // Expect a S2 KEX Get to be sent. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + if (i == 0){ + helper_func_restore_keys_expect(); + + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Trigger a timeout. + s2_inclusion_notify_timeout(&s2_context); + continue; // if first iteration, continue here to test timeout for timeout. + } + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + helper_func_kex_report_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + + if (i == 1) + { + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + helper_func_restore_keys_expect(); + + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Trigger a timeout. + s2_inclusion_notify_timeout(&s2_context); + continue; // if second iteration, break here to test timeout for timeout. + } + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); + + if (i == 2){ + helper_func_restore_keys_expect(); + + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Trigger a timeout. + s2_inclusion_notify_timeout(&s2_context); + continue; // if third iteration, break here to test timeout for timeout. + } + + // Expect Echo(KEX Report) to be sent. + uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + helper_func_echo_kex_set_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + if (i == 3){ + helper_func_restore_keys_expect(); + + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Trigger a timeout. + s2_inclusion_notify_timeout(&s2_context); + continue; // if fourth iteration, break here to test timeout for timeout. + } + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + // Expect Net Key Set to be sent. + static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; + memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); + + helper_func_net_key_get_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + if (i == 4){ + helper_func_restore_keys_expect(); + + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Trigger a timeout. + s2_inclusion_notify_timeout(&s2_context); + continue; // if fifth iteration, break here to test timeout for timeout. + } + + // Expect S2 Transfer End to be sent. + static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + helper_func_net_key_verify_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + if (i == 5){ + helper_func_restore_keys_expect(); + + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Trigger a timeout. + s2_inclusion_notify_timeout(&s2_context); + continue; // if sixth iteration, break here to test timeout for timeout. + } + } + + // After receiving a timeout it is expected that the inclusion state machine is back in idle and + // that we can initiate a new inclusion which will also trigger a new set timeout call. + static uint8_t S2_kex_get_frame_retry[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame_retry; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame_retry); + + // At final stage retry node inclusion to ensure we are in idle stage. + s2_inclusion_including_start(&s2_context,&s2_conn); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling when frames are received in wrong order during inclusion. + * This could either be implementation error or more critical, someone trying to find weakness in + * the system. Therefore the system must silently return to idle. + * + * An error should still be returned upwards to the application. + */ + void test_kex_inclusion_invalid_frame_order_all_states(void) { + mock_t * p_mock; + uint32_t i; + static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + /** The loop which will set up the expectation based on the round. */ + for (i = 0; i < NO_OF_STATES; i++) + { + // Expect a S2 KEX Get to be sent. + static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + if (i == 0){ + // The invalid frame. + uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; + + helper_func_restore_keys_expect(); + + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Let's try to directly fetch a network key. + memcpy((uint8_t *)s2_context.buf, s2_frame, sizeof(s2_frame)); + s2_context.length = sizeof(s2_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + //s2_context.buf = frame_buffer; // Reset buffer back. + continue; // if first iteration, continue here to test timeout for timeout. + } + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + helper_func_kex_report_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + + if (i == 1) + { + // The invalid frame - Let's send a KEX Get the opposite direction. + uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + + helper_func_restore_keys_expect(); + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Let's try to directly fetch a network key. + memcpy((uint8_t *)s2_context.buf, s2_frame, sizeof(s2_frame)); + s2_context.length = sizeof(s2_frame); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + // s2_context.buf = frame_buffer; // Reset buffer back. + continue; // if first iteration, continue here to test timeout for timeout. + } + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0x02; + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); + + if (i == 2){ + uint8_t S2_pub_key_A_return[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + helper_func_restore_keys_expect(); + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Let's try to reply by sending back public key frame to examine behavior. + memcpy((uint8_t *)s2_context.buf, S2_pub_key_A_return, sizeof(S2_pub_key_A_return)); + s2_context.length = sizeof(S2_pub_key_A_return); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_context.buf = frame_buffer; // Reset buffer back. + continue; // if first iteration, continue here to test timeout for timeout. + } + + // Expect Echo(KEX Report) to be sent. + static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + helper_func_echo_kex_set_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + if (i == 3){ + // The invalid frame. + uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; + + helper_func_restore_keys_expect(); + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x07; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // When inclusion fails, we expect a KEX Fail to be sent to inclusion_peer. + uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x07}; // KEX_FAIL_AUTH = 0x05 + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); + + // Let's try to check what happens if we intercept and try to restart secure inclusion by + // sending a KEX Report. Will we be accepted ? + memcpy((uint8_t *)s2_context.buf, s2_frame, sizeof(s2_frame)); + s2_context.length = sizeof(s2_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + //s2_context.buf = frame_buffer; // Reset buffer back. + + s2_inclusion_send_done(&s2_context, 1); + + continue; // if first iteration, continue here to test timeout for timeout. + } + + // Expect Net Key Set to be sent. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; + memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); + + helper_func_net_key_get_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + if (i == 4){ + // Go to transfer end without verifying the key. + uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + + helper_func_restore_keys_expect(); + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + memcpy((uint8_t *)s2_context.buf, s2_frame, sizeof(s2_frame)); + s2_context.length = sizeof(s2_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + continue; // if fifth iteration, break here to test timeout for timeout. + } + + // Expect S2 Transfer End to be sent. + static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + helper_func_net_key_verify_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + if (i == 5){ + // Retry the echo to see if we can get further back in the loop than officially allowed. + // This should just be ignored as it should be considered a duplicate frame and hence ignored. + uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; + + memcpy((uint8_t *)s2_context.buf, s2_frame, sizeof(s2_frame)); + s2_context.length = sizeof(s2_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // In order to get back to idle for processing next loop of test we simply issue a transfer + // end out of the correct inclusion sequence which we force the system back to idle. + // Go to transfer end without verifying the key. + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x03}; + + helper_func_restore_keys_expect(); + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + memcpy((uint8_t *)s2_context.buf, s2_transfer_end_frame, sizeof(s2_transfer_end_frame)); + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_context.buf = frame_buffer; // Reset buffer back. + continue; + } + } + + // After receiving a timeout it is expected that the inclusion state machine is back in idle and + // that we can initiate a new inclusion which will also trigger a new set timeout call. + static uint8_t S2_kex_get_frame_retry[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame_retry; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame_retry); + + // At final stage retry node inclusion to ensure we are in idle stage. + s2_inclusion_including_start(&s2_context,&s2_conn); + + mock_calls_verify(); + } + + void test_kex_inclusion_duplicate_frame_order_all_states(void) { + mock_t * p_mock; + uint32_t i; + static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + // Expect a S2 KEX Get to be sent. + static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Echo(KEX Report) to be sent. + static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + // Expect Net Key Set to be sent. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; + memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); + + // Expect S2 Transfer End to be sent. + static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + // Expect Net Key Set to be sent. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x80; + p_mock->output_arg[1].pointer = m_test_network_key_s0; + + static uint8_t S2_net_key_set_frame_s0[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80}; + memcpy(&S2_net_key_set_frame_s0[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame_s0; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame_s0); + + // Expect S2 Transfer End to be sent. + //static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + helper_func_restore_keys_expect(); + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event ; + + /** The loop which will set up the expectation based on the round. */ + for (i = 0; i < 7; i++) + { + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + if (i == 0) + continue; + helper_func_kex_report_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + if (i == 1) + { + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + continue; // if first iteration, continue here to test timeout for timeout. + } + + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + if (i == 2){ + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); + continue; + } + + helper_func_echo_kex_set_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + if (i == 3) + continue; + + helper_func_net_key_get_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + if (i == 4) + continue; + + helper_func_net_key_verify_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_get_frame(&s2_context, 0x80); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_verify_frame(&s2_context, 0x80); + s2_inclusion_post_event(&s2_context, &s2_conn); + + if (i == 5) + continue; + + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + } + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case the node is not supporting + * mandatory schemes, or the schemes supported are not supported by the controller. + * + * Purpose: In order to ensure a node can be correctly included there must be a match between the + * schemes supported by both inclusion and joining node. If this cannot be established + * between the node, then it must be ensured that appropriate failure is returned. + * + * Test: This test case will in case the following schemes are received from joining node as + * supported then a KEX_FAIL_SCHEME is returned. + */ + void test_kex_inclusion_error_schemes(void) { + mock_t * p_mock; + uint32_t i; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + uint8_t s2_kex_report_frame[6]; + struct S2 s2_context; + + uint8_t scheme_scheme_fail_test_vector[][2] = { + {0x00, 0x00}, // Scheme 2 = false, scheme 0 = false, key request don't care. This should return FAIL_KEY_REPORT. + {0x01, 0x80}, // Scheme 2 = false, scheme 0 = true, key request don't care. This should return FAIL_KEY_REPORT. + }; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + for (i = 0; i < ELEM_COUNT(scheme_scheme_fail_test_vector); i++) + { + + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // Expect a S2 KEX Fail as the including node received an unsupported combination of security schemes. + uint8_t S2_kex_set_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x02}; // KEX_FAIL_KEX_SCHEME = 0x02 + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_error_frame); + + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x02; // KEX_FAIL_KEX_SCHEME Scheme failure indicating that no scheme is supported by controller or joining node specified an invalid scheme. + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - With an unsupported scheme set. + s2_kex_report_frame[0] = COMMAND_CLASS_SECURITY_2; + s2_kex_report_frame[1] = KEX_REPORT; + s2_kex_report_frame[2] = 0x00, // bit 0 is echo field, rest are reserved + s2_kex_report_frame[3] = scheme_scheme_fail_test_vector[i][0]; // Supported schemes. + s2_kex_report_frame[4] = 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + s2_kex_report_frame[5] = scheme_scheme_fail_test_vector[i][1]; // Requested keys bit. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_send_done(&s2_context, 1); + } + + // Retry node inclusion. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case the node is not supporting + * curve 25519, or other curves requested are not (yet) supported by the controller. + * + * Purpose: In order to ensure a node can be correctly included there must be a match between the + * curves supported by both inclusion and joining node. If the curve supported by joining + * node is not matching a curve on inclusion node a failure is returned. + * + * Test: This test case will a KEX_FAIL_CURVE is returned when invalid set of schemes is requested. + */ + void test_kex_inclusion_error_curves(void) { + mock_t * p_mock; + zwave_event_t * p_expected_event; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + + uint8_t S2_kex_set_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x03}; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // Expect a S2 KEX Fail as the including node is not supporting curve 25519, or other curves requested are not (yet) supported by the controller + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_error_frame); + + p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x03; // KEX_FAIL_KEX_CURVES Curve failure indicating that no curve is supported by controller or joining node specified an invalid curve. + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - Unknown curve set. + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x00, // bit 0 is echo field, rest are reserved + 0x02, // Supported schemes. Scheme 1. + 0x02, // Supported ECDH Profiles, bit1=1 is unknown cureve value. + 0x01}; // Requested keys bit0=Security2 Class 0 key. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_send_done(&s2_context, 1); + + // Retry node inclusion. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case there is an invalid combination + * of scheme support and key request. + * + * Purpose: In order to ensure a node can be correctly included there must be a match between the + * schemes supported by both inclusion and joining node and the request for keys to exchange. + * + * Test: This test case will a KEX_FAIL_KEY is returned when invalid set of schemes/keys is requested. + */ + void test_kex_inclusion_error_keys(void) { + uint32_t i; + mock_t * p_mock; + zwave_event_t * p_expected_event; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + uint8_t s2_kex_report_frame[6]; + struct S2 s2_context; + + uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x01}; // KEX_FAIL_KEX_KEY = 0x01 + uint8_t scheme_key_request_fail_test_vector[] = { + 0x00, // key request S2 = no, key request S0 = no. This should return FAIL_KEY_REPORT. + }; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + for (i = 0; i < ELEM_COUNT(scheme_key_request_fail_test_vector); i++) + { + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // Expect a S2 KEX Fail as the case there is an invalid combination of scheme support and key request. + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); + + p_expected_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x01; // KEX_FAIL_KEX_KEY Key failure indicating that no match exists between requested/granted keys in the network. + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - Invalid mix of schemes and keys. + s2_kex_report_frame[0] = COMMAND_CLASS_SECURITY_2; + s2_kex_report_frame[1] = KEX_REPORT; + s2_kex_report_frame[2] = 0x00, // bit 0 is echo field, rest are reserved + s2_kex_report_frame[3] = 0x02; // Supported schemes. + s2_kex_report_frame[4] = 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + s2_kex_report_frame[5] = scheme_key_request_fail_test_vector[i]; // Requested keys bit. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_send_done(&s2_context, 1); + } + + // Retry node inclusion. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in all cases when there is a valid combination + * of scheme support and key request. + * + * Purpose: In order to ensure a node can be correctly included there must be a match between the + * schemes supported by both inclusion and joining node and the request for keys to exchange. + * + * Test: This test case will ensure a KEX Set is transmitted when a valid set of schemes/keys is requested. + */ + void test_kex_inclusion_valid_keys(void) { + uint32_t i; + mock_t * p_mock; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + uint8_t s2_kex_report_frame[6]; + struct S2 s2_context; + + uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; // Scheme 0 and 2, curve25519, S2, key 2, and S0 network key. + + // Double array, each row is a test, first two bytes in column is received frame, second two bytes are the expected output. + uint8_t scheme_key_request_pass_test_vector[][4] = { + {0x02, 0x01, 0x02, 0x01}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. + {0x02, 0x02, 0x02, 0x02}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. + {0x02, 0x03, 0x02, 0x03}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. + {0x02, 0x04, 0x02, 0x04}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. + {0x02, 0x05, 0x02, 0x05}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. + {0x02, 0x06, 0x02, 0x06}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. + {0x02, 0x07, 0x02, 0x07}, // Scheme 1 = true, key request S2 = yes, key request S0 = no. Valid request. + {0x02, 0x80, 0x02, 0x80}, // Scheme 1 = true, key request S2 = no, key request S0 = yes. Valid request. + {0x02, 0x81, 0x02, 0x81}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. + {0x02, 0x82, 0x02, 0x82}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. + {0x02, 0x83, 0x02, 0x83}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. + {0x02, 0x84, 0x02, 0x84}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. + {0x02, 0x85, 0x02, 0x85}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. + {0x02, 0x86, 0x02, 0x86}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. + {0x02, 0x87, 0x02, 0x87}, // Scheme 1 = true, key request S2 = yes, key request S0 = yes. Valid request. + }; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(s2_event_handler)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_public_key_read)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + for (i = 0; i < ELEM_COUNT(scheme_key_request_pass_test_vector); i++) + { + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + S2_kex_set_frame[3] = scheme_key_request_pass_test_vector[i][2]; + S2_kex_set_frame[5] = scheme_key_request_pass_test_vector[i][3]; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - Valid mix of schemes and keys. + s2_kex_report_frame[0] = COMMAND_CLASS_SECURITY_2; + s2_kex_report_frame[1] = KEX_REPORT; + s2_kex_report_frame[2] = 0x00, // bit 0 is echo field, rest are reserved + s2_kex_report_frame[3] = scheme_key_request_pass_test_vector[i][0]; // Supported schemes. + s2_kex_report_frame[4] = 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + s2_kex_report_frame[5] = scheme_key_request_pass_test_vector[i][1]; // Requested keys bit. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, scheme_key_request_pass_test_vector[i][3],0); // Granted keys. + + // Inject a timeout to ensure state goes back to idle so we can test next combination. + s2_inclusion_notify_timeout(&s2_context); + } + // Retry node inclusion. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case the joining node is + * requesting more keys than what was granted in KEX Set + * + * Purpose: In order to ensure a node can be correctly included there must be a match between the + * Key granted in KEX Set and the keys requested during key exchange. + * + * Test: This test case will ensure a KEX_FAIL_KEY_GET is returned when non granted key is requested. + */ + void test_kex_inclusion_error_key_get_request(void) { + uint32_t i; + mock_t * p_mock; + zwave_event_t * p_expected_event; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x00, 0x01, 0x00}; + uint8_t s2_echo_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x00, 0x01, 0x00}; + uint8_t s2_net_key_get_frame[6] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x00}; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + struct S2 s2_context; + + uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x08}; // KEX_FAIL_KEY_GET = 0x08 + + // Double array, each row is a test, first two bytes in column is reported/granted keys, third byte is the requested key. + uint8_t key_get_request_fail_test_vector[][3] = { + {0x02, 0x01, 0x02}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 1. + {0x02, 0x01, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. + {0x02, 0x01, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. + {0x02, 0x02, 0x01}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 0. + {0x02, 0x02, 0x04}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 2. + {0x02, 0x02, 0x08}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class x. + {0x02, 0x02, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. + {0x02, 0x03, 0x04}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 2. + {0x02, 0x03, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class x. + {0x02, 0x03, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. + {0x02, 0x04, 0x01}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 0. + {0x02, 0x04, 0x02}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 1. + {0x02, 0x04, 0x08}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class x. + {0x02, 0x04, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. + {0x02, 0x05, 0x02}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 1. + {0x02, 0x05, 0x08}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class x. + {0x02, 0x05, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. + {0x02, 0x06, 0x01}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class 1. + {0x02, 0x06, 0x08}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class x. + {0x02, 0x06, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. + {0x02, 0x07, 0x08}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S2 class x. + {0x02, 0x07, 0x80}, // Scheme 2 = true, scheme 0 = false, key request S2 = yes - Request S0 Network key. + {0x02, 0x81, 0x02}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 1. + {0x02, 0x81, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. + {0x02, 0x81, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. + {0x02, 0x82, 0x01}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 0. + {0x02, 0x82, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. + {0x02, 0x82, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. + {0x02, 0x84, 0x01}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 0. + {0x02, 0x84, 0x02}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 1. + {0x02, 0x84, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. + {0x02, 0x85, 0x02}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 1. + {0x02, 0x85, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. + {0x02, 0x86, 0x01}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 0. + {0x02, 0x86, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. + {0x02, 0x81, 0x02}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 1. + {0x02, 0x81, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. + {0x02, 0x82, 0x01}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 0. + {0x02, 0x82, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. + {0x02, 0x83, 0x04}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request S2 class 2. + {0x02, 0x83, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. + {0x02, 0x87, 0x08}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. + + + + {0x02, 0x83, 0x10}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. + {0x02, 0x83, 0x20}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. + {0x02, 0x83, 0x40}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request unknown/unsupported key. + }; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + for (i = 0; i < ELEM_COUNT(key_get_request_fail_test_vector); i++) + { + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = key_get_request_fail_test_vector[i][1]; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + helper_func_kex_set_frame_expect(key_get_request_fail_test_vector[i][0], 0x01, + key_get_request_fail_test_vector[i][1]); + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + // p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.security_keys = key_get_request_fail_test_vector[i][1]; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = key_get_request_fail_test_vector[i][1]; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = ((key_get_request_fail_test_vector[i][1] & 0x06)?2:0); + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + helper_func_echo_kex_report_frame_expect(key_get_request_fail_test_vector[i][0], 0x01, + key_get_request_fail_test_vector[i][1]); + + // Expect a S2 KEX Fail as the the joining node is requesting more keys than what was granted in KEX Set + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); + + p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x08; //KEX_FAIL_KEY_GET The joining node has requested a key, which was not granted by the including node at an earlier stage + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - Valid mix of schemes and keys. + s2_kex_report_frame[3] = key_get_request_fail_test_vector[i][0]; // Supported schemes. + s2_kex_report_frame[5] = key_get_request_fail_test_vector[i][1]; // Requested keys bit. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, key_get_request_fail_test_vector[i][1],0); // Granted keys. + + s2_context.buf = frame_buffer; + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); + + // KEX Echo Set frame received - Valid mix of schemes and keys. + s2_echo_kex_set_frame[3] = key_get_request_fail_test_vector[i][0]; // Supported schemes. + s2_echo_kex_set_frame[5] = key_get_request_fail_test_vector[i][1]; // Requested keys bit. + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network key get frame received - Invalid key requested. + s2_net_key_get_frame[2] = key_get_request_fail_test_vector[i][2]; // Requested key. + s2_context.buf = s2_net_key_get_frame; + s2_context.length = sizeof(s2_net_key_get_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_send_done(&s2_context, 1); + } + + // Retry node inclusion. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case the user rejects the node + * from inclusion after receiving KEX Report containing requested keys. + * + * Test: This test case will ensure a KEX_FAIL_USER_CANCEL is returned when user rejects inclusion. + */ + void test_kex_inclusion_key_grant_user_reject(void) { + mock_t * p_mock; + zwave_event_t * p_expected_event; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x02, 0x01, 0x83}; + + struct S2 s2_context; + s2_connection_t s2_conn; + uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x06}; // KEX_FAIL_CANCEL = 0x06 + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + memset(&s2_conn, 0, sizeof(s2_conn)); + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x83; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Fail as the user cancelled inclusion. + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); + + p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x06; //KEX_FAIL_CANCEL User has cancelled the S2 bootstrapping. + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - Valid mix of schemes and keys. + memcpy((uint8_t *)s2_context.buf, s2_kex_report_frame, sizeof(s2_kex_report_frame)); + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 0, 0x00,0); // Granted keys. + + // helper_func_pub_key_frame(&s2_context); + // s2_inclusion_post_event_peer(&s2_context, &s2_conn); + + // s2_inclusion_challenge_response(&s2_context, 0, 0xAABB); + + s2_inclusion_send_done(&s2_context, 1); + + // Retry node inclusion. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case the user rejects the node + * from inclusion during DSK input. + * + * Test: This test case will ensure a KEX_FAIL_USER_CANCEL is returned when user rejects inclusion. + */ + void test_kex_inclusion_user_reject(void) { + mock_t * p_mock; + zwave_event_t * p_expected_event; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x02, 0x01, 0x81}; + //uint8_t s2_echo_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x81}; + //uint8_t s2_net_key_get_frame[6] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x01}; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + struct S2 s2_context; + s2_connection_t s2_conn; + uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x06}; // KEX_FAIL_CANCEL = 0x06 + + memset(&s2_conn, 0, sizeof(s2_conn)); + s2_conn.rx_options = 0x00; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x81; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + helper_func_kex_set_frame_expect(0x02, 0x01, 0x81); + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x81; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0; + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // Expect a S2 KEX Fail as the including node received an unsupported combination of security schemes. + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); + + p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x06; //KEX_FAIL_CANCEL User has cancelled the S2 bootstrapping. + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - Valid mix of schemes and keys. + memcpy((uint8_t *)s2_context.buf, s2_kex_report_frame, sizeof(s2_kex_report_frame)); + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x81,0); // Granted keys. + + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 0, m_test_public_key_b, 2); + + s2_inclusion_send_done(&s2_context, 1); + + // Retry node inclusion. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case an echo kex set is received. + * As user has not accepted the inclusion, then the Temporary Shared Secret has not been + * established, thus receiving such a frame is an error. + */ + void test_kex_inclusion_pending_user_accept_echo_kex_set_received(void) { + mock_t * p_mock; + zwave_event_t * p_expected_event; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x02, 0x01, 0x81}; + uint8_t s2_echo_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x81}; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + struct S2 s2_context; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x81; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + helper_func_kex_set_frame_expect(0x02, 0x01, 0x81); + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x81; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0; + + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // Expect an inclusion error to be pushed upwards. + p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - Valid mix of schemes and keys. + memcpy((uint8_t *)s2_context.buf, s2_kex_report_frame, sizeof(s2_kex_report_frame)); + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x81,0); // Granted keys. + + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + // No challenge response received, anyway we receive Key get frame, which is invalid. + // s2_inclusion_challenge_response(&s2_context, 0, 0xAABB); + + // KEX Echo Set frame received - Valid mix of schemes and keys. + memcpy((uint8_t *)s2_context.buf, s2_echo_kex_set_frame, sizeof(s2_echo_kex_set_frame)); + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Retry node inclusion. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case the joining node is + * requesting more than a single key in Network Key Get request. + * + * Test: This test case will ensure a KEX_FAIL_KEY_GET is returned when more than one key is requested. + */ + void test_kex_inclusion_error_multi_key_get_request(void) { + uint32_t i; + mock_t * p_mock; + zwave_event_t * p_expected_event; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x00, 0x01, 0x00}; + uint8_t s2_echo_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x00, 0x01, 0x00}; + uint8_t s2_net_key_get_frame[6] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x00}; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + struct S2 s2_context; + + uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x08}; // KEX_FAIL_KEY_GET = 0x08 + + // Double array, each row is a test, first two bytes in column is reported/granted keys, third byte is the requested key. + uint8_t key_get_request_fail_test_vector[][3] = { + {0x02, 0x83, 0x83}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request all keys. + {0x02, 0x83, 0x03}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - Request all S2 keys. + {0x02, 0x83, 0x81}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - two keys. + {0x02, 0x83, 0x82}, // Scheme 2 = true, scheme 0 = true, key request S2 = yes - two keys. + }; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + //mock_call_use_as_stub(TO_STR(s2_event_handler)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + for (i = 0; i < ELEM_COUNT(key_get_request_fail_test_vector); i++) + { + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = key_get_request_fail_test_vector[i][1]; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + helper_func_kex_set_frame_expect(key_get_request_fail_test_vector[i][0], 0x01, + key_get_request_fail_test_vector[i][1]); + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + // p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.security_keys = key_get_request_fail_test_vector[i][1]; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = key_get_request_fail_test_vector[i][1]; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = (key_get_request_fail_test_vector[i][1] & 0x06) ? 2 : 0; + + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + helper_func_echo_kex_report_frame_expect(key_get_request_fail_test_vector[i][0], 0x01, + key_get_request_fail_test_vector[i][1]); + + // Expect a S2 KEX Fail as the including node received an unsupported combination of security schemes. + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); + + p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x08; //KEX_FAIL_KEY_GET The joining node has requested a key, which was not granted by the including node at an earlier stage. + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - Valid mix of schemes and keys. + s2_kex_report_frame[3] = key_get_request_fail_test_vector[i][0]; // Supported schemes. + s2_kex_report_frame[5] = key_get_request_fail_test_vector[i][1]; // Requested keys bit. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, key_get_request_fail_test_vector[i][1],0); // Granted keys. + + s2_context.buf = frame_buffer; + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b,2 ); + + // KEX Echo Set frame received - Valid mix of schemes and keys. + s2_echo_kex_set_frame[3] = key_get_request_fail_test_vector[i][0]; // Supported schemes. + s2_echo_kex_set_frame[5] = key_get_request_fail_test_vector[i][1]; // Requested keys bit. + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network key get frame received - Invalid key requested. + s2_net_key_get_frame[2] = key_get_request_fail_test_vector[i][2]; // Requested key. + s2_context.buf = s2_net_key_get_frame; + s2_context.length = sizeof(s2_net_key_get_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_send_done(&s2_context, 1); + } + + // Retry node inclusion. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case the joining node is + * transmitting its public key with including node flag set, TO#7554. + * + * Purpose: In order to ensure correct key exchange it is important that the nodes agrees on who + * is including/joining node. + * + * Test: This test case will ensure that the state machine returns to idle as the wrong including + * bit is identical to a unexpected frame at this stages in the state machine. + */ + void test_kex_inclusion_error_public_key_including_bit(void) { + mock_t * p_mock; + zwave_event_t * p_expected_event; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x02, 0x01, 0x02}; + struct S2 s2_context; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x02; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + helper_func_kex_set_frame_expect(0x02, 0x01, 0x02); + + // When including fails we expect at call to keystore in order to restore keys. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + + p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - Valid mix of schemes and keys. + memcpy((uint8_t *)s2_context.buf, s2_kex_report_frame, sizeof(s2_kex_report_frame)); + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x02, 0); // Granted keys. + + frame_buffer[0] = COMMAND_CLASS_SECURITY_2; + frame_buffer[1] = PUBLIC_KEY_REPORT; + frame_buffer[2] = 0x01; // Including bit set (error) + memcpy(&frame_buffer[3], m_test_public_key_b, sizeof(m_test_public_key_b)); + s2_context.buf = frame_buffer; + s2_conn.class_id = 0xFF; + s2_context.length = 3 + sizeof(m_test_public_key_b); + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Retry node inclusion to ensure we are in idle state. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case the joining node is + * transmitting frames with reserved bits set (which should be ignored). + */ + void test_kex_inclusion_public_key_reserved_bits(void) { + mock_t * p_mock; + static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + // Expect a S2 KEX Get to be sent. + static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Echo(KEX Report) to be sent. + static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + // Expect Net Key Set to be sent. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; + memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); + + // Expect S2 Transfer End to be sent. + static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + // Expect Net Key Set to be sent. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x80; + p_mock->output_arg[1].pointer = m_test_network_key_s0; + + static uint8_t S2_net_key_set_frame_s0[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80}; + memcpy(&S2_net_key_set_frame_s0[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame_s0; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame_s0); + + // Expect S2 Transfer End to be sent. + //static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + helper_func_restore_keys_expect(); + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event ; + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + helper_func_kex_report_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + + frame_buffer[0] = COMMAND_CLASS_SECURITY_2; + frame_buffer[1] = PUBLIC_KEY_REPORT; + frame_buffer[2] = 0xA2; // Setting a couple of reserved bits which should be ignored on remote side. + memcpy(&frame_buffer[3], m_test_public_key_b, sizeof(m_test_public_key_b)); + s2_context.buf = frame_buffer; + s2_context.length = 3 + sizeof(m_test_public_key_b); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); + + helper_func_echo_kex_set_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_get_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_verify_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_get_frame(&s2_context, 0x80); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_verify_frame(&s2_context, 0x80); + s2_inclusion_post_event(&s2_context, &s2_conn); + + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling of node inclusion in case the joining node is + * not echo'ing KEX Set with identical fields. + * + * Purpose: In order to ensure a node can be correctly included the KEX Set and the echo KEX Set + * must be identical except for the echo flag. + * + * Test: This test case will ensure a KEX_FAIL_AUTH is returned when the echo KEX Set does not + * match the KEX Set frame. + */ + void test_kex_inclusion_error_echo_kex_set(void) { + uint32_t i; + mock_t * p_mock; + zwave_event_t * p_expected_event; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + uint8_t s2_kex_report_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x00, 0x00, 0x01, 0x00}; + uint8_t s2_echo_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x00, 0x01, 0x00}; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + struct S2 s2_context; + + uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x07}; // KEX_FAIL_AUTH = 0x07 + + // Double array, each row is a test, first two bytes in column is reported/granted keys, third and fourth bytes are hte bytes in echo KEX Set. + uint8_t key_echo_fail_test_vector[][4] = { + {0x02, 0x01, 0x02, 0x02}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x01, 0x02, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x01, 0x02, 0x04}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x01, 0x02, 0x80}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x02, 0x02, 0x01}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x02, 0x02, 0x04}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x02, 0x02, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x02, 0x02, 0x80}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + + {0x02, 0x01, 0x03, 0x01}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x02, 0x03, 0x02}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x03, 0x03, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x03, 0x72, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x03, 0xF2, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x03, 0xFA, 0x03}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + + {0x02, 0x81, 0x02, 0x82}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x81, 0x02, 0x83}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x81, 0x02, 0x84}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x81, 0x02, 0x80}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x82, 0x02, 0x81}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x82, 0x02, 0x83}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x82, 0x02, 0x84}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x82, 0x02, 0x80}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x83, 0x02, 0x81}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x83, 0x02, 0x82}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x83, 0x02, 0x84}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x83, 0x02, 0x80}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x83, 0x02, 0x07}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x83, 0x02, 0x78}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x83, 0x02, 0xFF}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x83, 0x02, 0x00}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + + {0x02, 0x83, 0x7C, 0x83}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x83, 0xF3, 0x83}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + {0x02, 0x83, 0xFC, 0x83}, // Scheme 1 = true, key request S2 = yes - Wrong echo frame. + }; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + for (i = 0; i < ELEM_COUNT(key_echo_fail_test_vector); i++) + { + /**************************** + * Mock expectation section * + ****************************/ + + // When initiating the secure inclusion of node B, then we expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = key_echo_fail_test_vector[i][1]; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + helper_func_kex_set_frame_expect(key_echo_fail_test_vector[i][0], 0x01, + key_echo_fail_test_vector[i][1]); + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + // p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.security_keys = key_echo_fail_test_vector[i][1]; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = key_echo_fail_test_vector[i][1]; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = (key_echo_fail_test_vector[i][1] & 0x06) ? 2 : 0; + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect a S2 KEX Fail as the including node received an unsupported combination of security schemes. + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + + p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x07; //KEX_FAIL_AUTH The Echo KEX Set/Report frame did not match the earlier exchanged frame. + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /******************* + * Testing section * + *******************/ + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received - Valid mix of schemes and keys. + s2_kex_report_frame[3] = key_echo_fail_test_vector[i][0]; // Supported schemes. + s2_kex_report_frame[5] = key_echo_fail_test_vector[i][1]; // Requested keys bit. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, key_echo_fail_test_vector[i][1],0); // Granted keys. + + s2_context.buf = frame_buffer; + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); + + // KEX Echo Set frame received - Valid mix of schemes and keys. + s2_echo_kex_set_frame[3] = key_echo_fail_test_vector[i][2]; // Wrong match supported schemes. + s2_echo_kex_set_frame[5] = key_echo_fail_test_vector[i][3]; // Wrong match requested keys bit. + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_send_done(&s2_context, 1); + } + + // Retry node inclusion. + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Test case for ensuring correct timer handling on timeout while in idle. + * + * Purpose: In order to ensure correct inclusion flow and avoid deadlock during inclusion it is + * important that in case messages are never received during inclusion, then the state + * machine must return to idle and push a corresponding event. + * + * Test: This test case will verify expectations related to the timer handling. + * If a joining node does not respond within the timeout to a S2 inclusion frame then the + * state machine must return to idle and push the corresponding event upwards to application. + * After timeout, we expect nothing to happen as we are already in idle. + * + */ + void test_kex_inclusion_timeout_when_idle(void) { + mock_t * p_mock; + uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(keystore_network_key_read)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + + // No timeout event/node inclusion failure is expected as we are already in idle. + + // After timeout we will issue a node inclusion just to insure we were in idle and that a node + // may be included after timeout. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // Trigger a timeout. + s2_inclusion_notify_timeout(&s2_context); + + // Node id (first step in inclusion) has been assigned. + // Let's initiate a secure inclusion after the timeout to verify the state of the system. + s2_inclusion_including_start(&s2_context,&s2_conn); + + mock_calls_verify(); + } + + /** Verification that the ECHO Kex report match the received frame even if only a subset of keys are granted. + */ + void test_kex_including_node_key_grant_subset(void) { + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x00, // bit 0 is echo field, rest are reserved + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x87};// Requested keys bits. Security 2 class 1, Security 0 network key. + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test expectation setup. + */ + mock_t * p_mock; + + // Expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x87; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + helper_func_kex_set_frame_expect(0x02, 0x01, 0x82); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_challenge_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + + // Expect Echo(KEX Report) to be sent. + uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x87}; // Note: Echo flag set. + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + // Expect Net Key Report to be sent. + uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02, }; + memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); + + // Expect S2 Transfer End to be sent. + uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x80; + p_mock->output_arg[1].pointer = m_test_network_key_s0; + + // Expect Net Key Set to be sent. + uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; + memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); + + // Expect S2 Transfer End to be sent. + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. + helper_func_restore_keys_expect(); + + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event ; + + /** + * Test execution. + */ + struct S2 s2_context; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82, 0); + + uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. + memcpy(&public_key_frame[3], m_test_public_key_b, sizeof(m_test_public_key_b)); + s2_context.buf = public_key_frame; + s2_context.length = sizeof(public_key_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); + + // Echo(KEX Set) frame received. + // bit0: echo field set, bit1-7: Reserved. + // Selected schemes: scheme 0 and scheme 2. + // Selected curve25519 + // Keys to exchange, Security2, class 2 - Security0, network key. + uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x02}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_frame; + s2_context.length = sizeof(s2_net_key_get_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_frame; + s2_context.length = sizeof(s2_net_key_verify_frame); + s2_conn.class_id = 0x01; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_0_frame; + s2_context.length = sizeof(s2_net_key_get_0_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_0_frame; + s2_context.length = sizeof(s2_net_key_verify_0_frame); + s2_conn.class_id = UNIT_TEST_NETWORK_KEY; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // S2 Transfer end frame received. + // bit0: Key request complete set, + // bit1: Key verified not set, + // bit2-7: Reserved. + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + /** Verification that the in case an decryption failure is reported from the S2 protocol layer, + * that the S2 inclusion state machine transmits the corresponding error to the inclusion_peer. + */ + void test_kex_including_node_decrypt_failed(void) { + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x00, // bit 0 is echo field, rest are reserved + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. + zwave_event_t * p_expected_event; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test expectation setup. + */ + mock_t * p_mock; + + // Expect a S2 KEX Get to be sent. + helper_func_kex_get_frame_expect(); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + helper_func_kex_set_frame_expect(0x02, 0x01, 0x82); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key[0] = 0x00; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key[1] = 0x00; + memcpy(&p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key[2], &m_test_public_key_b[2], sizeof(m_test_public_key_b) - 2); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_challenge_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // When inclusion fails, we expect a KEX Fail to be sent to inclusion_peer. + uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x05}; // KEX_FAIL_DECRYPT = 0x05 + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); + + // When inclusion fails, we expect keys to be restored and a corresponding failed inclusion event from libs2. + helper_func_restore_keys_expect(); + + p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x05; //KEX_FAIL_DECRYPT Node failed to decrypt received frame. + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + /** + * Test execution. + */ + struct S2 s2_context; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + + uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00, 0x00, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. + memcpy(&public_key_frame[5], &m_test_public_key_b[2], sizeof(m_test_public_key_b) - 2); + s2_context.buf = public_key_frame; + s2_context.length = sizeof(public_key_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // A ECHO KEX Set was received, unfortunately the missing part of the DSK has not yet been + // provided by the end user, resulting in s2_inclusion_decryption_failure(...) from S2 + // protocol layer. + // This is supposed to be ignored by the state machine. + s2_inclusion_decryption_failure(&s2_context,&s2_context.inclusion_peer); + + s2_inclusion_decryption_failure(&s2_context,&s2_context.inclusion_peer); + + // User provides wrong key. + + const uint8_t wrong_key[] = {0xBB,0xCC}; + s2_inclusion_challenge_response(&s2_context, 1, wrong_key, 2); + + //The joing node's retry of A ECHO KEX Set was received, public key is set but with wrong value. + // This result in s2_inclusion_decryption_failure(...) from S2 protocol layer which should + // trigger transmission of a KEX Fail. + s2_inclusion_decryption_failure(&s2_context,&s2_context.inclusion_peer); + + s2_inclusion_send_done(&s2_context, 1); + + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + /** Verification that in case the inclusion state machine is in idle, then AUTH Failed should not + * be returned for an invalid encrypted frame. TO#06510 + */ + void test_kex_invalid_crypt_frame_idle(void) { + + mock_calls_clear(); + + /** + * Test expectation setup. + */ + + /** + * Test execution. + */ + struct S2 s2_context; + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // S2 Transfer end frame received. + // bit0: Key request complete set, + // bit1: Key verified not set, + // bit2-7: Reserved. + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_verify_idle_state(&s2_context); + + mock_calls_verify(); + } + + void test_kex_inclusion_tx_queue_full(void) { + mock_t * p_mock; + static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + // Expect a S2 KEX Get to be sent. + static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + p_mock->return_code.value = 0; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + p_mock->return_code.value = 1; + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + p_mock->return_code.value = 0; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + p_mock->return_code.value = 1; + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + p_mock->return_code.value = 0; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + p_mock->return_code.value = 0; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + p_mock->return_code.value = 1; + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Echo(KEX Report) to be sent. + static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + p_mock->return_code.value = 0; + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + p_mock->return_code.value = 1; + + // Expect Net Key Set to be sent. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; + memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); + p_mock->return_code.value = 0; + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); + p_mock->return_code.value = 1; + + // Expect S2 Transfer End to be sent. + static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + p_mock->return_code.value = 0; + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + p_mock->return_code.value = 1; + + // Expect Net Key Set to be sent. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x80; + p_mock->output_arg[1].pointer = m_test_network_key_s0; + + static uint8_t S2_net_key_set_frame_s0[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80}; + memcpy(&S2_net_key_set_frame_s0[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame_s0; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame_s0); + p_mock->return_code.value = 1; + + // Expect S2 Transfer End to be sent. + //static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + p_mock->return_code.value = 0; + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + p_mock->return_code.value = 1; + + helper_func_restore_keys_expect(); + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x82; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event; + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + s2_inclusion_send_done(&s2_context, 1); + + helper_func_kex_report_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + s2_inclusion_send_done(&s2_context, 1); + + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_inclusion_send_done(&s2_context, 0); + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); + s2_inclusion_send_done(&s2_context, 1); + + helper_func_echo_kex_set_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_inclusion_send_done(&s2_context, 1); + + helper_func_net_key_get_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_inclusion_send_done(&s2_context, 1); + + helper_func_net_key_verify_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_inclusion_send_done(&s2_context, 1); + + helper_func_net_key_get_frame(&s2_context, 0x80); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_inclusion_send_done(&s2_context, 1); + + helper_func_net_key_verify_frame(&s2_context, 0x80); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_inclusion_send_done(&s2_context, 1); + + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + /** Verification that in case the including only offers unauthenticated keys (with CSA still set) then the full public key is transmitted. + * + * Expectation: CSA is requested and accepted + * Including node sends its full public key + * Joining node sends its full public key + * Only S2 unauthenticated and S0 keys are transfered + */ + void test_kex_including_node_csa_unauthenticated_only(void) { + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x06, // bit 0 is echo field, bit 1 is CSA, bit 2 is NLS support. + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x87};// Requested keys bits. Security 2 class 1, Security 0 network key. + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test expectation setup. + * This section set up the expectations in the system when the inclusion state machine progresses: + * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. + * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. + * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. + * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. + * 5) Exchange of public keys. + * a) Public KeyB is received from joining node A. + * - Public KeyB must be pushed upwards as event to be presented to user for further verification. + * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. + * Currently that use case is outside the scope of libs2. + * - When Public KeyB is received, the controller must send its public KeyA. + * Public KeyB shall be provided by the application. + * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. + * This is done in security sub module (currently under development) + * - The security context must be re-initialized with temporary derived key. + * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. + * 6) Echoing of KEX frames. + * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be + * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). + * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. + * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. + * 7) Network key exchange: + * a) Joining node will request the network key, by sending a 'Network Key Get'. + * b) Including node shall reply with a 'Network Key Set'. + * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' + * - Including node must verify that it can succesfully decrypt the message using the key. + * d) Including node shall reply with a 'Transfer End'. + * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. + * + */ + mock_t * p_mock; + + // Expect a S2 KEX Get to be sent. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x87; + p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x01; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, + 0x02, // bit0: echo field, bit1: CSA, bit2-7: Reserved. + 0x02, // Selected schemes: scheme 1. + 0x01, // Selected curve25519 + 0x81 // Keys to exchange, Security2, class 1 - Security0, network key. + }; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x81; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0; + memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_challenge_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + + // Expect Echo(KEX Report) to be sent. + uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x07, 0x02, 0x01, 0x87}; // Note: Echo flag set. + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + // Expect Net Key Report to be sent. + uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x01, }; + memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_0, sizeof(m_test_network_key_s2_class_0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); + + // Expect S2 Transfer End to be sent. + uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x80; + p_mock->output_arg[1].pointer = m_test_network_key_s0; + + // Expect Net Key Set to be sent. + uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; + memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); + + // Expect S2 Transfer End to be sent. + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x81; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event ; + + /** + * Test execution. + */ + struct S2 s2_context; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x81, 0x01); + + uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. + memcpy(&public_key_frame[3], m_test_public_key_b, sizeof(m_test_public_key_b)); + s2_context.buf = public_key_frame; + s2_context.length = sizeof(public_key_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, NULL, 0); + + // Echo(KEX Set) frame received. + // bit0: echo field set, bit1-7: Reserved. + // Selected schemes: scheme 0 and scheme 2. + // Selected curve25519 + // Keys to exchange, Security2, class 2 - Security0, network key. + uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x03, 0x02, 0x01, 0x81}; + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x01}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_frame; + s2_context.length = sizeof(s2_net_key_get_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_frame; + s2_context.length = sizeof(s2_net_key_verify_frame); + s2_conn.class_id = 0x00; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_0_frame; + s2_context.length = sizeof(s2_net_key_get_0_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_0_frame; + s2_context.length = sizeof(s2_net_key_verify_0_frame); + s2_conn.class_id = UNIT_TEST_NETWORK_KEY; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // S2 Transfer end frame received. + // bit0: Key request complete set, + // bit1: Key verified not set, + // bit2-7: Reserved. + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + /** Verification that in case the including disables/rejects a CSA request then the full public key is transmitted. + * + * Expectation: Including node sends its full public key + * Joining node sends its full public key + * Only S2 unauthenticated and S0 keys are transfered + */ + void test_kex_including_node_csa_disable(void) { + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x06, // bit 0 is echo field, bit 1 is CSA, bit 2 is NLS support. + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x87};// Requested keys bits. Security 2 class 1, Security 0 network key. + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test expectation setup. + * This section set up the expectations in the system when the inclusion state machine progresses: + * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. + * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. + * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. + * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. + * 5) Exchange of public keys. + * a) Public KeyB is received from joining node A. + * - Public KeyB must be pushed upwards as event to be presented to user for further verification. + * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. + * Currently that use case is outside the scope of libs2. + * - When Public KeyB is received, the controller must send its public KeyA. + * Public KeyB shall be provided by the application. + * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. + * This is done in security sub module (currently under development) + * - The security context must be re-initialized with temporary derived key. + * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. + * 6) Echoing of KEX frames. + * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be + * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). + * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. + * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. + * 7) Network key exchange: + * a) Joining node will request the network key, by sending a 'Network Key Get'. + * b) Including node shall reply with a 'Network Key Set'. + * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' + * - Including node must verify that it can succesfully decrypt the message using the key. + * d) Including node shall reply with a 'Transfer End'. + * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. + * + */ + mock_t * p_mock; + + // Expect a S2 KEX Get to be sent. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x87; + p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x01; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, + 0x00, // bit0: echo field, bit1: CSA, bit2-7: Reserved. + 0x02, // Selected schemes: scheme 1. + 0x01, // Selected curve25519 + 0x81 // Keys to exchange, Security2, class 1 - Security0, network key. + }; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x81; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0; + memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_challenge_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + + // Expect Echo(KEX Report) to be sent. + uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x07, 0x02, 0x01, 0x87}; // Note: Echo flag set. + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + // Expect Net Key Report to be sent. + uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x01, }; + memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_0, sizeof(m_test_network_key_s2_class_0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); + + // Expect S2 Transfer End to be sent. + uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x80; + p_mock->output_arg[1].pointer = m_test_network_key_s0; + + // Expect Net Key Set to be sent. + uint8_t S2_net_key_report_0_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x80, }; + memcpy(&S2_net_key_report_0_frame[3], m_test_network_key_s0, sizeof(m_test_network_key_s0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_0_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_0_frame); + + // Expect S2 Transfer End to be sent. + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x81; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event ; + + /** + * Test execution. + */ + struct S2 s2_context; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x81, 0x00); + + uint8_t public_key_frame[3 + sizeof(m_test_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. + memcpy(&public_key_frame[3], m_test_public_key_b, sizeof(m_test_public_key_b)); + s2_context.buf = public_key_frame; + s2_context.length = sizeof(public_key_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, NULL, 0); + + // Echo(KEX Set) frame received. + // bit0: echo field set, bit1-7: Reserved. + // Selected schemes: scheme 0 and scheme 2. + // Selected curve25519 + // Keys to exchange, Security2, class 2 - Security0, network key. + uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x81}; + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x01}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_frame; + s2_context.length = sizeof(s2_net_key_get_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_frame; + s2_context.length = sizeof(s2_net_key_verify_frame); + s2_conn.class_id = 0x00; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Get frame received. + uint8_t s2_net_key_get_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, 0x80}; // Keys requested, Security2, class 2 - Security0, network key. + s2_context.buf = s2_net_key_get_0_frame; + s2_context.length = sizeof(s2_net_key_get_0_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Network Key Verify frame received. + uint8_t s2_net_key_verify_0_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + s2_context.buf = s2_net_key_verify_0_frame; + s2_context.length = sizeof(s2_net_key_verify_0_frame); + s2_conn.class_id = UNIT_TEST_NETWORK_KEY; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // S2 Transfer end frame received. + // bit0: Key request complete set, + // bit1: Key verified not set, + // bit2-7: Reserved. + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + /** Test case for ensuring correct handling when KEX fail frames are received from opposite side during inclusion. + * This could either be implementation error or more critical, someone trying to find weakness in + * the system. As an error is received from opposite side over the air, the system must silently return to idle. + * + * An error should still be returned upwards to the application including the KEX fail type of remote side. + */ + void test_kex_inclusion_kex_fail_frame_all_states(void) { + mock_t * p_mock; + uint32_t i; + static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + /** The loop which will set up the expectation based on the round. */ + for (i = 0; i < 4; i++) + { + // Expect a S2 KEX Get to be sent. + static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + helper_func_kex_report_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + + if (i == 0) + { + // The KEX Fail frame. + uint8_t s2_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, KEX_FAIL_KEX_KEY}; + + helper_func_restore_keys_expect(); + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x01; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Let's try to directly fetch a network key. + memcpy((uint8_t *)s2_context.buf, s2_error_frame, sizeof(s2_error_frame)); + s2_context.length = sizeof(s2_error_frame); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + // s2_context.buf = frame_buffer; // Reset buffer back. + continue; // if first iteration, continue here to test timeout for timeout. + } + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); + + if (i == 1){ + // The KEX Fail frame. + uint8_t s2_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, KEX_FAIL_CANCEL}; + + helper_func_restore_keys_expect(); + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x06; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Let's try to reply by sending back public key frame to examine behavior. + memcpy((uint8_t *)s2_context.buf, s2_error_frame, sizeof(s2_error_frame)); + s2_context.length = sizeof(s2_error_frame); + s2_inclusion_post_event(&s2_context, &s2_conn); + s2_context.buf = frame_buffer; // Reset buffer back. + continue; // if first iteration, continue here to test timeout for timeout. + } + + // Expect Echo(KEX Report) to be sent. + static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + helper_func_echo_kex_set_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + if (i == 2){ + // The KEX Fail frame. + uint8_t s2_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, KEX_FAIL_AUTH}; + + helper_func_restore_keys_expect(); + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x07; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + // Let's try to check what happens if we intercept and try to restart secure inclusion by + // sending a KEX Report. Will we be accepted ? + memcpy((uint8_t *)s2_context.buf, s2_error_frame, sizeof(s2_error_frame)); + s2_context.length = sizeof(s2_error_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + //s2_context.buf = frame_buffer; // Reset buffer back. + continue; // if first iteration, continue here to test timeout for timeout. + } + + // Expect Net Key Set to be sent. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; + memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); + + helper_func_net_key_get_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + if (i == 3){ + // The KEX Fail frame. + uint8_t s2_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, KEX_FAIL_KEY_REPORT}; + + helper_func_restore_keys_expect(); + // This test will trigger a timeout to the inclusion module after which we expect to receive a + // callback event with a S2_NODE_INCLUSION_FAILED_EVENT. + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x0A; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + memcpy((uint8_t *)s2_context.buf, s2_error_frame, sizeof(s2_error_frame)); + s2_context.length = sizeof(s2_error_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + continue; // if fifth iteration, break here to test timeout for timeout. + } + + // Expect S2 Transfer End to be sent. + static uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + helper_func_net_key_verify_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + } + + // After receiving a timeout it is expected that the inclusion state machine is back in idle and + // that we can initiate a new inclusion which will also trigger a new set timeout call. + static uint8_t S2_kex_get_frame_retry[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame_retry; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame_retry); + + // At final stage retry node inclusion to ensure we are in idle stage. + s2_inclusion_including_start(&s2_context,&s2_conn); + + mock_calls_verify(); + } + + /** + * This test verifies that a KEX_FAIL is returned in case the NET KEY VERIFY frame was wrongly encrypted with the Temp key when transmitted by the joining node. + */ + void test_kex_inclusion_net_key_verify_temp_key_encrypted_error(void) { + mock_t * p_mock; + zwave_event_t * p_expected_event; + static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + + // Expect a S2 KEX Get to be sent. + static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x07}; // KEX_FAIL_KEY_GET = 0x08 + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Echo(KEX Report) to be sent. + static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + // Expect Net Key Set to be sent. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; + memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); + + p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x07; //KEX_FAIL_AUTH The Echo KEX Set/Report frame did not match the earlier exchanged frame. + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + helper_func_restore_keys_expect(); + + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + helper_func_kex_report_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); + helper_func_echo_kex_set_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_get_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_verify_frame(&s2_context, 0x03); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_send_done(&s2_context, 1); + + mock_calls_verify(); + } + + /** + * This test verifies that a KEX_FAIL is returned in case the NET KEY VERIFY frame was wrongly encrypted with the Temp key when transmitted by the joining node. + */ + void test_kex_inclusion_net_key_verify_unencrypted_error(void) { + mock_t * p_mock; + zwave_event_t * p_expected_event; + static uint8_t frame_buffer[UNIT_TEST_BUF_SIZE]; + struct S2 s2_context; + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + memset(&s2_context, 0, sizeof(s2_context)); + s2_context.inclusion_state = S2_INC_IDLE; + s2_context.buf = frame_buffer; + s2_inclusion_set_event_handler(s2_event_handler); + helper_func_init_s2_conn(); + + // Expect a S2 KEX Get to be sent. + static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + static uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_inc_req_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_inc_req_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_public_key_b); + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x82; + p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.dsk_length = 2; + memcpy(p_expected_inc_req_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_inc_req_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t S2_kex_error_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, 0x07}; // KEX_FAIL_KEY_GET = 0x08 + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Echo(KEX Report) to be sent. + static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + // Expect Net Key Set to be sent. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + static uint8_t S2_net_key_set_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02}; + memcpy(&S2_net_key_set_frame[3], m_test_network_key_s2_class_1, sizeof(m_test_network_key_s2_class_1)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_set_frame); + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_error_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_error_frame); + + p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x07; //KEX_FAIL_AUTH The Echo KEX Set/Report frame did not match the earlier exchanged frame. + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event; + + helper_func_restore_keys_expect(); + + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + helper_func_kex_report_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x82,0); + helper_func_pub_key_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_a, 2); + helper_func_echo_kex_set_frame(&s2_context); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_get_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + + helper_func_net_key_verify_frame(&s2_context, 0x00); + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_send_done(&s2_context, 1); + + mock_calls_verify(); + } + + /** Helper function sections - Start */ + + /** This helper function set up an expected KEX get frame to be send (through the mock). */ + void helper_func_kex_get_frame_expect(void) + { + mock_t * p_mock; + // Static to keep in scope for complete test. + static uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + } + + /** This helper function set up the expectation of restoring all keys, either upon completion or error. */ + void helper_func_restore_keys_expect(void) + { + mock_t * p_mock; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + + } + + /** This helper function set up an expected KEX set frame to be send (through the mock). + * param[in] expected_scheme Expected value for scheme field. + * param[in] expected_curves Expected value for curves field. + * param[in] expected_keys Expected value for keys field. + */ + void helper_func_kex_set_frame_expect(uint8_t expected_scheme, uint8_t expected_curves, uint8_t expected_keys) + { + mock_t * p_mock; + static uint8_t s2_kex_set_frame[6] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x00, 0x00, 0x00, 0x00}; + // Expect a S2 KEX Set when the scheme/key request combination was accepted. + s2_kex_set_frame[3] = expected_scheme; + s2_kex_set_frame[4] = expected_curves; + s2_kex_set_frame[5] = expected_keys; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = s2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(s2_kex_set_frame); + } + + /** This helper function set up an expected Echo KEX report frame to be send (through the mock). + * param[in] expected_scheme Expected value for scheme field. + * param[in] expected_curves Expected value for curves field. + * param[in] expected_keys Expected value for keys field. + */ + void helper_func_echo_kex_report_frame_expect(uint8_t expected_scheme, uint8_t expected_curves, uint8_t expected_keys) + { + mock_t * p_mock; + // Expect Echo(KEX Report) to be sent. + static uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x00, 0x00, 0x00}; + S2_echo_kex_report_frame[3] = expected_scheme; + S2_echo_kex_report_frame[4] = expected_curves; + S2_echo_kex_report_frame[5] = expected_keys; + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + } + + /** This helper function constructs a KEX Report frame and update p_context */ + void helper_func_kex_report_frame(struct S2 *p_context) + { + uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x00, // Reserved, csa off, echo off => 0x00 + 0x02, // Supported schemes, Scheme 1 = 1 => 0x02 + 0x01, // Curve25519 support => 0x01 + 0x82}; // Security2, Class 1 key = 1, Security0, Network key = 1 => 0x82 + memcpy((uint8_t *)p_context->buf, s2_frame, sizeof(s2_frame)); + p_context->length = sizeof(s2_frame); + s2_conn.class_id = 0xFF; + } + + void helper_func_pub_key_frame(struct S2 *p_context) + { + uint8_t * p_tmp = (uint8_t *)p_context->buf; + p_tmp[0] = COMMAND_CLASS_SECURITY_2; + p_tmp[1] = PUBLIC_KEY_REPORT; + p_tmp[2] = 0x00; + memcpy(&p_tmp[3], m_test_public_key_b, sizeof(m_test_public_key_b)); + p_context->length = 3 + sizeof(m_test_public_key_b); + s2_conn.class_id = 0xFF; + } + + void helper_func_echo_kex_set_frame(struct S2 *p_context) + { + uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x82}; // This data must be compared to earlier sent data. As long as frames are not defined, this data is unknown. + memcpy((uint8_t *)p_context->buf, s2_frame, sizeof(s2_frame)); + p_context->length = sizeof(s2_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + } + + void helper_func_net_key_get_frame(struct S2 *p_context, uint8_t key) + { + uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_GET, key}; + memcpy((uint8_t *)p_context->buf, s2_frame, sizeof(s2_frame)); + p_context->length = sizeof(s2_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + } + + // The context must be updated to net key must be updated when S2 Network Key Set has been tranmitted. + + void helper_func_net_key_verify_frame(struct S2 *p_context, uint8_t key) + { + uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_VERIFY}; + memcpy((uint8_t *)p_context->buf, s2_frame, sizeof(s2_frame)); + p_context->length = sizeof(s2_frame); + switch (key) + { + case 0x00: + s2_conn.class_id = 0xFF; + break; + case 0x01: + s2_conn.class_id = 0x00; + break; + case 0x02: + s2_conn.class_id = 0x01; + break; + case 0x04: + s2_conn.class_id = 0x02; + break; + case 0x80: + s2_conn.class_id = UNIT_TEST_NETWORK_KEY; + break; + } + } + + void helper_func_transfer_end_final_frame(struct S2 *p_context) + { + uint8_t s2_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + memcpy((uint8_t *)p_context->buf, s2_frame, sizeof(s2_frame)); + p_context->length = sizeof(s2_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + } + + + void helper_func_verify_idle_state(struct S2 *p_context) + { + mock_t * p_mock; + + // No timeout event/node inclusion failure is expected as we are verifying that the system is in idle. + + // After timeout we will issue a node inclusion just to insure we were in idle and that a node + // may be included after timeout. + + if (!mock_call_used_as_stub(TO_STR(S2_send_frame), "s2_extern_mock.c")) + { + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + } + + if (!mock_call_used_as_stub(TO_STR(s2_inclusion_set_timeout), "s2_inclusion_extern_mock.c")) + { + mock_call_expect(TO_STR(s2_inclusion_set_timeout), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; + p_mock->expect_arg[1].value = 1000; + p_mock->return_code.value = 1; + } + + // Node id (first step in inclusion) has been assigned. + // Let's initiate a secure inclusion after the timeout to verify the state of the system. + s2_inclusion_including_start(p_context,&s2_conn); + } + + + + + + + void kex_including_node_state_machine_no_keys(int positive_test) { + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x00, // // bit 0 is echo field, bit 1 is CSA. + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x82};// Requested keys bits. Security 2 class 1, Security 0 network key. + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test expectation setup. + * This section set up the expectations in the system when the inclusion state machine progresses: + * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. + * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. + * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. + * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. + * 5) Exchange of public keys. + * a) Public KeyB is received from joining node A. + * - Public KeyB must be pushed upwards as event to be presented to user for further verification. + * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. + * Currently that use case is outside the scope of libs2. + * - When Public KeyB is received, the controller must send its public KeyA. + * Public KeyB shall be provided by the application. + * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. + * This is done in security sub module (currently under development) + * - The security context must be re-initialized with temporary derived key. + * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. + * 6) Echoing of KEX frames. + * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be + * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). + * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. + * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. + * 7) Network key exchange: + * a) Joining node will request the network key, by sending a 'Network Key Get'. + * b) Including node shall reply with a 'Network Key Set'. + * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' + * - Including node must verify that it can succesfully decrypt the message using the key. + * d) Including node shall reply with a 'Transfer End'. + * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. + * + */ + mock_t * p_mock; + + // Expect a S2 KEX Get to be sent. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x82; + p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x00; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, + 0x00, // bit0: echo field, bit1-7: Reserved. + 0x02, // Selected schemes: scheme 1. + 0x01, // Selected curve25519 + positive_test ? 0x00 : 0x82 // Keys to exchange, Security2, class 1 - Security0, network key. + }; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_obfuscated_public_key_b); + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = positive_test ? 0x00 : 0x82; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = positive_test ? 0 : 2; + memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_challenge_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + + // Expect Echo(KEX Report) to be sent. + uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x82}; // Note: Echo flag set. + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + + // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + + if(positive_test) { + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x00; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event ; + } else { + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x00; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event ; + } + + /** + * Test execution. + */ + struct S2 s2_context; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, positive_test ? 0x00: 0x82, 0x00); + + uint8_t public_key_frame[3 + sizeof(m_test_obfuscated_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. + memcpy(&public_key_frame[3], m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); + s2_context.buf = public_key_frame; + s2_context.length = sizeof(public_key_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // This should ensure the full public key is available. + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); + TEST_ASSERT_EQUAL_UINT8_ARRAY(s2_context.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + // Echo(KEX Set) frame received. + // bit0: echo field set, bit1-7: Reserved. + // Selected schemes: scheme 0 and scheme 2. + // Selected curve25519 + // Keys to exchange, Security2, class 2 - Security0, network key. + uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, positive_test? 0x00: 0x82}; + + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // S2 Transfer end frame received. + // bit0: Key request complete set, + // bit1: Key verified not set, + // bit2-7: Reserved. + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + + void test_kex_including_node_state_machine_no_keys_pos(void) { + kex_including_node_state_machine_no_keys(1); + } + void test_kex_including_node_state_machine_no_keys_neg(void) { + kex_including_node_state_machine_no_keys(0); + } + + static void helper_func_init_s2_conn(void) + { + s2_conn.l_node = 1; + s2_conn.r_node = 2; + s2_conn.class_id = 0xFF; + s2_conn.rx_options = 0x00; + } + + /* Test what happens when LR end nodes request the Unauthenticated key a.k.a. SWPROT-4909 + * */ + void test_kex_including_node_LR_unauth_keys(void) { + uint8_t public_key_a[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + + uint8_t private_key_a[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, // Private key. + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0, + 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; + + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x00, // // bit 0 is echo field, bit 1 is CSA. + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x03};// Requested keys bits. Request unauth and auth + + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test expectation setup. + * This section set up the expectations in the system when the inclusion state machine progresses: + * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. + * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. + * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. + * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. + * 5) Exchange of public keys. + * a) Public KeyB is received from joining node A. + * - Public KeyB must be pushed upwards as event to be presented to user for further verification. + * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. + * Currently that use case is outside the scope of libs2. + * - When Public KeyB is received, the controller must send its public KeyA. + * Public KeyB shall be provided by the application. + * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. + * This is done in security sub module (currently under development) + * - The security context must be re-initialized with temporary derived key. + * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. + * 6) Echoing of KEX frames. + * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be + * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). + * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. + * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. + * 7) Network key exchange: + * a) Joining node will request the network key, by sending a 'Network Key Get'. + * b) Including node shall reply with a 'Network Key Set'. + * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' + * - Including node must verify that it can succesfully decrypt the message using the key. + * d) Including node shall reply with a 'Transfer End'. + * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. + * + */ + mock_t * p_mock; + + // Expect a S2 KEX Get to be sent. + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // When the KEX Report is received, we expect that the event from libs2 contains the key requested in order to present it for the operator. + // The operator (or including app automatically) can then respond with granted keys. + // Expect that the LR invalid key 0x01 has been filtered out by libs2. + zwave_event_t * p_expected_report_event = (zwave_event_t *)m_test_mem_pool[0]; + p_expected_report_event->event_type = S2_NODE_INCLUSION_KEX_REPORT_EVENT; + p_expected_report_event->evt.s2_event.s2_data.kex_report.security_keys = 0x02; // 0x01 bit must be filtered out by libs2 + p_expected_report_event->evt.s2_event.s2_data.kex_report.csa = 0x00; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_report_event; + + // Expect a S2 KEX Set to be sent. + uint8_t S2_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, + 0x00, // bit0: echo field, bit1-7: Reserved. + 0x02, // Selected schemes: scheme 1. + 0x01, // Selected curve25519 + 0x02 // Keys to exchange, Security2, auth. Unauth has been filtered out since it is not valid for LR + }; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_set_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_set_frame); + + // When the public key is received, we expect that the event from libs2 contains the key in order to present it for the operator. + // Therefore we copy the key minus header frame into expected data. + zwave_event_t * p_expected_challenge_event = (zwave_event_t *)m_test_mem_pool[1]; + p_expected_challenge_event->event_type = S2_NODE_INCLUSION_PUBLIC_KEY_CHALLENGE_EVENT; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.length = sizeof(m_test_obfuscated_public_key_b); + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.granted_keys = 0x02; + p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.dsk_length = 0x02; + memcpy(p_expected_challenge_event->evt.s2_event.s2_data.challenge_req.public_key, m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_challenge_event; + + // When the public key is received, we expect a call to the keystore in order to obtain our public key. + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + // Expect Public KeyA to be sent. + uint8_t S2_pub_key_A_frame[] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x01, // Including node bit set + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, // Public key as being set by upper layer. + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_pub_key_A_frame; + p_mock->expect_arg[3].value = sizeof(S2_pub_key_A_frame); + + // After our public key has been sent, we expect user acceptance of the inclusion, which will result in key updates and key derivation. + mock_call_expect(TO_STR(keystore_private_key_read), &p_mock); + p_mock->output_arg[0].pointer = private_key_a; + mock_call_expect(TO_STR(keystore_public_key_read), &p_mock); + p_mock->output_arg[0].pointer = public_key_a; + + + // Expect Echo(KEX Report) to be sent. + uint8_t S2_echo_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, 0x01, 0x02, 0x01, 0x03}; // Note: Echo flag set. + + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_echo_kex_report_frame; // Ideally, this should be updated to be identically to replayed received KEX Set. + p_mock->expect_arg[3].value = sizeof(S2_echo_kex_report_frame); + + //Expect LR Auth key to be read + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; // Just using a random key here, arg0 with the index is what matters + + // Expect Net Key Report to be sent. + uint8_t S2_net_key_report_2_frame[19] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_NETWORK_KEY_REPORT, 0x02, }; + memcpy(&S2_net_key_report_2_frame[3], m_test_network_key_s2_class_0, sizeof(m_test_network_key_s2_class_0)); + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_net_key_report_2_frame; + p_mock->expect_arg[3].value = sizeof(S2_net_key_report_2_frame); + + // Expect S2 Transfer End to be sent. + uint8_t S2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x02}; // 0x02 = Key Verified + mock_call_expect(TO_STR(S2_send_data), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_transfer_end_frame; + p_mock->expect_arg[3].value = sizeof(S2_transfer_end_frame); + + + // When S2 Transfer End is received, we expect keys to be restored and a corresponding Node inclusion complete event from libs2. + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + + zwave_event_t * p_expected_complete_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_complete_event->event_type = S2_NODE_INCLUSION_COMPLETE_EVENT; + p_expected_complete_event->evt.s2_event.s2_data.inclusion_complete.exchanged_keys = 0x02; + + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_complete_event ; + + /** + * Test execution. + */ + struct S2 s2_context; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_conn.l_node = 1; + s2_conn.r_node = 1000; /* LR inclusion*/ + s2_conn.class_id = 0xFF; + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // KEX Report frame received. + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x02, 0x00); + + uint8_t public_key_frame[3 + sizeof(m_test_obfuscated_public_key_b)] = {COMMAND_CLASS_SECURITY_2, PUBLIC_KEY_REPORT, 0x00}; // Key exchange received from slave - public key for secure exchange of LTK. + memcpy(&public_key_frame[3], m_test_obfuscated_public_key_b, sizeof(m_test_obfuscated_public_key_b)); + s2_context.buf = public_key_frame; + s2_context.length = sizeof(public_key_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + // This should ensure the full public key is available. + s2_inclusion_challenge_response(&s2_context, 1, m_test_public_key_b, 2); + TEST_ASSERT_EQUAL_UINT8_ARRAY(s2_context.public_key, m_test_public_key_b, sizeof(m_test_public_key_b)); + + // Echo(KEX Set) frame received. + // bit0: echo field set, bit1-7: Reserved. + // Selected schemes: scheme 0 and scheme 2. + // Selected curve25519 + // Keys to exchange, Security2, class 2. Unauth Key was not granted because it is invalid in LR. + uint8_t s2_echo_kex_set_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_SET, 0x01, 0x02, 0x01, 0x02}; + + s2_context.buf = s2_echo_kex_set_frame; + s2_context.length = sizeof(s2_echo_kex_set_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + //Inject the Net Key Get but only for LR Auth + helper_func_net_key_get_frame(&s2_context, 0x02); + s2_inclusion_post_event(&s2_context, &s2_conn); + + // Inject Net Key Verify + helper_func_net_key_verify_frame(&s2_context, 0x02); + s2_conn.class_id = 0x03; /* Slot for LR unauth key class */ + s2_inclusion_post_event(&s2_context, &s2_conn); + + // S2 Transfer end frame received. + // bit0: Key request complete set, + // bit1: Key verified not set, + // bit2-7: Reserved. + uint8_t s2_transfer_end_frame[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_TRANSFER_END, 0x01}; + s2_context.buf = s2_transfer_end_frame; + s2_context.length = sizeof(s2_transfer_end_frame); + s2_conn.class_id = UNIT_TEST_TEMP_KEY_SECURE; + s2_inclusion_post_event(&s2_context, &s2_conn); + + mock_calls_verify(); + } + + + + + /* Test what happens when LR end nodes request the Unauthenticated and S0 key* */ + void test_kex_including_node_LR_unauth_s0_keys(void) + { + mock_calls_clear(); + mock_call_use_as_stub(TO_STR(s2_inclusion_extern_mock.c)); + mock_call_use_as_stub(TO_STR(curve25519_mock.c)); + mock_call_use_as_stub(TO_STR(kderiv_mock.c)); + + // Stubbed as it is about to be removed. + mock_call_use_as_stub(TO_STR(S2_network_key_update)); + + /** + * Test expectation setup. + * This section set up the expectations in the system when the inclusion state machine progresses: + * 1) Starting in idle it is expected that an S2 frame KEX1 will be transmitted based on external event when a node id has been assigned. + * 2) After S2 KEX Get has been transmitted, the FSM awaits a S2 KEX Report as response. + * 3) After S2 KEX Report is received then S2 KEX Set shall be sent. + * 4) After S2 KEX Set has been transmitted, the FSM awaits a Public KeyB from joining node. + * 5) Exchange of public keys. + * a) Public KeyB is received from joining node A. + * - Public KeyB must be pushed upwards as event to be presented to user for further verification. + * If node is rejected, then node is part of network insecurely. Should this be changed ? Maybe force a node exclude. + * Currently that use case is outside the scope of libs2. + * - When Public KeyB is received, the controller must send its public KeyA. + * Public KeyB shall be provided by the application. + * - Using Pub KeyB and Private KeyA then a temporary key, KeyT is derived from the x coordinate of the shared secret. + * This is done in security sub module (currently under development) + * - The security context must be re-initialized with temporary derived key. + * b) Public KeyA is transmitted from including node A, the state machine will await 'Echo (KEX Set)'. + * 6) Echoing of KEX frames. + * a) A 'Echo(KEX Set)' is expected to be received from the joining node, and it must be + * verified that 'Echo(KEX Set)' is identical to the KEX Set sent at step 3). + * b) 'Echo(KEX Report)' with content identical to packet received in 3) shall be replied to the joining node. + * x) Nonce exchange: When joining node wants to send 'Echo(KEX Set)' the S2 protocol layer will exchange a nonce prior to communication. + * 7) Network key exchange: + * a) Joining node will request the network key, by sending a 'Network Key Get'. + * b) Including node shall reply with a 'Network Key Set'. + * c) Joining node shall confirm with a 'Network Key Verify' which is encrypted using the the key obtained by 'NetworkKey-expand' + * - Including node must verify that it can succesfully decrypt the message using the key. + * d) Including node shall reply with a 'Transfer End'. + * e) Joining node shall reply with a 'Transfer End' if no more keys shall be exchanged. + * + */ + mock_t * p_mock; + + struct S2 s2_context; + + /*FIXME S2_init_ctx() bomb placed */ + + s2_conn.l_node = 1; + s2_conn.r_node = 1000; /* LR inclusion*/ + s2_conn.class_id = 0xFF; + + s2_context.inclusion_state = S2_INC_IDLE; + s2_inclusion_set_event_handler(s2_event_handler); + + // Expect a S2 KEX Get to be sent from libs2(DUT nodeid 1) to unit test (nodeid 1000). + uint8_t S2_kex_get_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_GET}; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_get_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_get_frame); + + // Node id (first step in inclusion) has been assigned. + // Continue with secure inclusion. + s2_inclusion_including_start(&s2_context,&s2_conn); + + // Expect inclusion fail event + zwave_event_t * p_expected_event = (zwave_event_t *)m_test_mem_pool[2]; + p_expected_event->event_type = S2_NODE_INCLUSION_FAILED_EVENT; + p_expected_event->evt.s2_event.s2_data.inclusion_fail.kex_fail_type = 0x01; + mock_call_expect(TO_STR(s2_event_handler), &p_mock); + p_mock->expect_arg[0].pointer = p_expected_event ; + + + // Expect a S2 KEX FAIL to be sent.from libs2(DUT nodeid 1) to unit test (nodeid 1000). + // And it should match following frame + uint8_t S2_kex_fail_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_FAIL, + 0x01, //KEX_FAIL_KEX_KEYS + }; + mock_call_expect(TO_STR(S2_send_frame), &p_mock); + p_mock->compare_rule_arg[0] = COMPARE_ANY; // For the outline, we just expect any/null pointers now. + p_mock->compare_rule_arg[1] = COMPARE_NOT_NULL; // This shall be updated once excact frame is defined for S2 frames. + p_mock->expect_arg[2].pointer = S2_kex_fail_frame; + p_mock->expect_arg[3].value = sizeof(S2_kex_fail_frame); + + // When S2 inclusion has failed, we expect keys to be restored + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x01; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_0; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x02; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_1; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x04; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x08; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + mock_call_expect(TO_STR(keystore_network_key_read), &p_mock); + p_mock->expect_arg[0].value = 0x10; + p_mock->output_arg[1].pointer = m_test_network_key_s2_class_2; + + // Inject KEX REPORT from unit test + uint8_t s2_kex_report_frame[] = {COMMAND_CLASS_SECURITY_2, KEX_REPORT, + 0x00, // // bit 0 is echo field, bit 1 is CSA. + 0x02, // Supported schemes. Scheme 1. + 0x01, // Supported ECDH Profiles, bit0=1 is curve 25519 value. + 0x81};// Requested keys bits. Request unauth and auth + s2_context.buf = s2_kex_report_frame; + s2_context.length = sizeof(s2_kex_report_frame); + s2_conn.class_id = 0xFF; + s2_inclusion_post_event(&s2_context, &s2_conn); + + s2_inclusion_key_grant(&s2_context, 1, 0x00, 0x00); + + mock_calls_verify(); + } \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_network_test.c b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_network_test.c index 04744879c..8914fe79b 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_network_test.c +++ b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_network_test.c @@ -17,10 +17,12 @@ #include "S2_mock.h" #include "s2_inclusion_mock.h" +#include "S2_external_mock.h" #include "zwave_s2_network.h" #include "zwave_s2_network_callbacks_mock.h" #include "sl_log.h" #include "zwapi_protocol_mem_mock.h" +#include "zwapi_protocol_controller_mock.h" // Includes from LibS2 #include "s2_protocol.h" @@ -53,6 +55,7 @@ void setUp() // Configure our HomeID and NodeID for the test: zwave_network_management_get_home_id_IgnoreAndReturn(test_home_id); zwave_network_management_get_node_id_IgnoreAndReturn(test_node_id); + clock_time_IgnoreAndReturn(0); s2_ctx = &test_ctx; memset(s2_ctx, 0, sizeof(struct S2)); contiki_test_helper_init(); @@ -74,6 +77,8 @@ static void void test_s2_network_init() { + uint8_t nls_state = false; + S2_destroy_Expect(s2_ctx); s2_inclusion_init_IgnoreAndReturn(true); s2_inclusion_set_event_handler_StubWithCallback( @@ -82,6 +87,9 @@ void test_s2_network_init() zwapi_memory_get_buffer_IgnoreAndReturn(SL_STATUS_OK); + zwapi_get_node_nls_ExpectAndReturn(1, &nls_state, SL_STATUS_OK); + S2_load_nls_state_Ignore(); + zwave_s2_network_init(); } diff --git a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/test_protocol.c b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_protocol.c similarity index 66% rename from applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/test_protocol.c rename to applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_protocol.c index 20b96011b..d56f9f73c 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/test/test_protocol.c +++ b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_protocol.c @@ -1,7 +1,7 @@ /* © 2014 Silicon Laboratories Inc. */ /* - * test_protocol.c + * zwave_s2_protocol.c * * Created on: Jun 24, 2015 * Author: aes @@ -38,6 +38,24 @@ struct test_state int s2_send_done; s2_tx_status_t s2_send_status; + bool S2_save_nls_state_called; + + bool S2_notify_nls_state_report_nls_capability; + bool S2_notify_nls_state_report_nls_state; + bool S2_notify_nls_state_report_called; + + bool S2_nls_node_list_get_request; + bool S2_nls_node_list_get_called; + bool S2_nls_node_list_get_is_last_node; + uint16_t S2_nls_node_list_get_node_id; + uint8_t S2_nls_node_list_get_granted_keys; + bool S2_nls_node_list_nls_state; + + uint16_t S2_nls_node_list_report_id_of_node; + uint8_t S2_nls_node_list_report_keys_node_bitmask; + bool S2_nls_node_list_report_nls_state; + bool S2_nls_node_list_report_called; + int send_data_return_fail; //Make send_data return fail uint8_t rx_frame[1280]; @@ -109,17 +127,40 @@ S2_send_frame(struct S2* ctxt, const s2_connection_t* dst, uint8_t* buf, uint16_ return 1; } -void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, uint8_t nls_capability, uint8_t nls_state) -{} +void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, bool nls_capability, bool nls_state) +{ + ts.S2_notify_nls_state_report_nls_capability = nls_capability; + ts.S2_notify_nls_state_report_nls_state = nls_state; + ts.S2_notify_nls_state_report_called = true; +} + +int8_t S2_get_nls_node_list(node_t srcNode, bool request, bool *is_last_node, uint16_t *node_id, uint8_t *granted_keys, bool *nls_state) +{ + ts.S2_nls_node_list_get_request = request; + ts.S2_nls_node_list_get_called = true; + + *is_last_node = ts.S2_nls_node_list_get_is_last_node; + *node_id = ts.S2_nls_node_list_get_node_id; + *granted_keys = ts.S2_nls_node_list_get_granted_keys; + *nls_state = ts.S2_nls_node_list_nls_state; + + return 0; +} -void S2_nls_node_list_get(node_t srcNode, uint8_t class_id, uint8_t request) -{} +int8_t S2_notify_nls_node_list_report(node_t srcNode, uint16_t id_of_node, uint8_t keys_node_bitmask, bool nls_state) +{ + ts.S2_nls_node_list_report_id_of_node = id_of_node; + ts.S2_nls_node_list_report_keys_node_bitmask = keys_node_bitmask; + ts.S2_nls_node_list_report_nls_state = nls_state; + ts.S2_nls_node_list_report_called = true; -void S2_nls_node_list_report(node_t srcNode, uint8_t class_id, uint8_t last_node, uint16_t id_of_node, uint8_t keys_node_bitmask, uint8_t nls_state) -{} + return 0; +} void S2_save_nls_state(void) -{} +{ + ts.S2_save_nls_state_called = true; +} void S2_set_timeout(struct S2* ctxt, uint32_t interval) @@ -272,6 +313,11 @@ my_setup(void) } +void setUp(void) +{ + memset(&ts, 0, sizeof(ts)); +} + void tearDownSuite(void) { if(ctx1) { @@ -389,7 +435,750 @@ void test_single_frame_transmission(void) TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test } +/** + * The goal of this test is to test the flow described in the Z-Wave AWG specification + * Figure 4.21: Joining node asks for NLS enabled nodes. + * + * As exactly described in the spec, secondary controller sends 3 times NLS_NODE_LIST_GET_V2 + * in a row until the last node flag sent by the primary controller is true. + */ +void test_secondary_controller_joining_to_network_happy_case(void) +{ + test_s2_send_data(); + /* ----------- now send second frame with SPAN established --------- * + */ + + ts.fcount = 0; //Reset frame count + ts.rx_frame_len = 0; + + /* --- step 1 (NLS_STATE_SET_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_STATE_SET_V2 frame + uint8_t nls_state = 1; // enable NLS + uint8_t nls_state_set[] = {COMMAND_CLASS_SECURITY_2, NLS_STATE_SET_V2, nls_state}; + S2_send_data(ctx1, &conn12, (uint8_t *)nls_state_set, sizeof(nls_state_set)); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + + // Secondary controller receives the encapsulated NLS_STATE_SET_V2 frame + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ctx2->nls_state); // Test the flag in the context of secondary controller + TEST_ASSERT_EQUAL(true, ts.S2_save_nls_state_called); // Test callback + TEST_ASSERT_EQUAL(1, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + + /* --- step 2 (NLS_STATE_GET_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_STATE_GET_V2 frame + uint8_t nls_state_get[] = {COMMAND_CLASS_SECURITY_2, NLS_STATE_GET_V2}; + S2_send_data(ctx1, &conn12, (uint8_t *)nls_state_get, sizeof(nls_state_get)); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(14, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(2, ts.fcount); + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + + // Secondary controller receives the encapsulated NLS_STATE_GET_V2 frame + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ctx2->delayed_transmission_flags.send_nls_node_list_get); + + /* --- step 3 (NLS_STATE_REPORT_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_STATE_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(3, ts.fcount); + + // Primary controller receives the encapsulated NLS_STATE_REPORT_V2 frame + TEST_ASSERT_EQUAL(false, ts.S2_notify_nls_state_report_nls_capability); + TEST_ASSERT_EQUAL(false, ts.S2_notify_nls_state_report_nls_state); + TEST_ASSERT_EQUAL(false, ts.S2_notify_nls_state_report_called); + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ts.S2_notify_nls_state_report_called); + TEST_ASSERT_EQUAL(true, ts.S2_notify_nls_state_report_nls_capability); + TEST_ASSERT_EQUAL(true, ts.S2_notify_nls_state_report_nls_state); + TEST_ASSERT_EQUAL(3, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + + // Secondary controller receives an ack following to the transmitted encapsulated NLS_STATE_REPORT_V2 frame + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + + /* --- step 4 (NLS_NODE_LIST_GET_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_NODE_LIST_GET_v2 frame + TEST_ASSERT_EQUAL(false, ctx2->delayed_transmission_flags.send_nls_node_list_get); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(4, ts.fcount); + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); + + // Primary controller receives the encapsulated NLS_NODE_LIST_GET_V2 frame + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_called); + ts.S2_nls_node_list_get_is_last_node = false; + ts.S2_nls_node_list_get_node_id = 4; + ts.S2_nls_node_list_get_granted_keys = 0xFF; + ts.S2_nls_node_list_nls_state = true; + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_called); + + /* --- step 5 (NLS_NODE_LIST_REPORT_V2 from primary to secondary controller) --- */ + // Primary controller sends an encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx1->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(19, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(5, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx1->fsm); + + // Secondary controller receives the encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_report_nls_state); + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_node_id, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_granted_keys, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_nls_state, ts.S2_nls_node_list_report_nls_state); + + /* --- step 6 (NLS_NODE_LIST_GET_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_NODE_LIST_GET_v2 frame + TEST_ASSERT_EQUAL(false, ctx2->delayed_transmission_flags.send_nls_node_list_get); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(6, ts.fcount); + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); + ts.S2_nls_node_list_get_called = false; + + // Primary controller receives the encapsulated NLS_NODE_LIST_GET_V2 frame + ts.S2_nls_node_list_get_is_last_node = false; + ts.S2_nls_node_list_get_node_id = 5; + ts.S2_nls_node_list_get_granted_keys = 0xFF; + ts.S2_nls_node_list_nls_state = true; + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_called); + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_called); + + /* --- step 7 (NLS_NODE_LIST_REPORT_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx1->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(19, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(7, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx1->fsm); + ts.S2_nls_node_list_report_called = 0; + ts.S2_nls_node_list_report_id_of_node = 0; + ts.S2_nls_node_list_report_keys_node_bitmask = 0; + ts.S2_nls_node_list_report_nls_state = false; + + // Secondary controller receives the encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_report_nls_state); + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_node_id, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_granted_keys, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_nls_state, ts.S2_nls_node_list_report_nls_state); + + /* --- step 8 (NLS_NODE_LIST_GET_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_NODE_LIST_GET_v2 frame + TEST_ASSERT_EQUAL(false, ctx2->delayed_transmission_flags.send_nls_node_list_get); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(8, ts.fcount); + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); + ts.S2_nls_node_list_get_called = false; + + // Primary controller receives the encapsulated NLS_NODE_LIST_GET_V2 frame + ts.S2_nls_node_list_get_is_last_node = true; + ts.S2_nls_node_list_get_node_id = 6; + ts.S2_nls_node_list_get_granted_keys = 0xFF; + ts.S2_nls_node_list_nls_state = true; + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_called); + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_called); + + /* --- step 9 (NLS_NODE_LIST_REPORT_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx1->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(19, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(9, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx1->fsm); + ts.S2_nls_node_list_report_called = 0; + ts.S2_nls_node_list_report_id_of_node = 0; + ts.S2_nls_node_list_report_keys_node_bitmask = 0; + ts.S2_nls_node_list_report_nls_state = false; + + // Secondary controller receives the encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_report_nls_state); + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_node_id, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_granted_keys, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_nls_state, ts.S2_nls_node_list_report_nls_state); + + /* --- step 10 (Secondary controller gets last_node flag finally and does not re-initiate another NLS_NODE_LIST_GET_v2) --- */ + + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); +} + +/** + * The goal of this test is to test the flow described in the Z-Wave AWG specification + * Figure 4.21: Joining node asks for NLS enabled nodes exactly like the previous happy case + * test except that this test is focused on delayed transmissions where the S2 state machine + * is caught busy and the frames are scheduled for later transmissions. + * + * As exactly described in the spec, secondary controller sends 3 times NLS_NODE_LIST_GET_V2 + * in a row until the last node flag sent by the primary controller is true. + */ +void test_secondary_controller_joining_to_network_delayed_transmissions(void) +{ + test_s2_send_data(); + /* ----------- now send second frame with SPAN established --------- * + */ + + ts.fcount = 0; //Reset frame count + ts.rx_frame_len = 0; + + /* --- step 1 (NLS_STATE_SET_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_STATE_SET_V2 frame + uint8_t nls_state = 1; // enable NLS + uint8_t nls_state_set[] = {COMMAND_CLASS_SECURITY_2, NLS_STATE_SET_V2, nls_state}; + S2_send_data(ctx1, &conn12, (uint8_t *)nls_state_set, sizeof(nls_state_set)); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + + // Secondary controller receives the encapsulated NLS_STATE_SET_V2 frame + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ctx2->nls_state); // Test the flag in the context of secondary controller + TEST_ASSERT_EQUAL(true, ts.S2_save_nls_state_called); // Test callback + TEST_ASSERT_EQUAL(1, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + + /* --- step 2 (NLS_STATE_GET_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_STATE_GET_V2 frame + uint8_t nls_state_get[] = {COMMAND_CLASS_SECURITY_2, NLS_STATE_GET_V2}; + S2_send_data(ctx1, &conn12, (uint8_t *)nls_state_get, sizeof(nls_state_get)); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(14, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(2, ts.fcount); + // Let's not receive the ack to simulate delaying of the encapsulated NLS_NODE_LIST_REPORT_V2 frame + + // Secondary controller receives the encapsulated NLS_STATE_GET_V2 frame + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ctx2->delayed_transmission_flags.send_nls_node_list_get); + + /* --- step 3 (NLS_STATE_REPORT_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_STATE_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(3, ts.fcount); + + // Primary controller receives the encapsulated NLS_STATE_REPORT_V2 frame + TEST_ASSERT_EQUAL(false, ts.S2_notify_nls_state_report_nls_capability); + TEST_ASSERT_EQUAL(false, ts.S2_notify_nls_state_report_nls_state); + TEST_ASSERT_EQUAL(false, ts.S2_notify_nls_state_report_called); + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ts.S2_notify_nls_state_report_called); + TEST_ASSERT_EQUAL(true, ts.S2_notify_nls_state_report_nls_capability); + TEST_ASSERT_EQUAL(true, ts.S2_notify_nls_state_report_nls_state); + TEST_ASSERT_EQUAL(3, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + + // Secondary controller receives an ack following to the transmitted encapsulated NLS_STATE_REPORT_V2 frame + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + + /* --- step 4 (NLS_NODE_LIST_GET_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_NODE_LIST_GET_v2 frame + TEST_ASSERT_EQUAL(false, ctx2->delayed_transmission_flags.send_nls_node_list_get); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(4, ts.fcount); + // Let's not receive the ack to simulate delaying of the encapsulated NLS_NODE_LIST_GET_V2 frame + + // Primary controller receives the encapsulated NLS_NODE_LIST_GET_V2 frame before the ack of the encapsulated NLS_STATE_GET_V2 + // frame sent at step 2 so the next encapsulated NLS_NODE_LIST_REPORT_V2 transmission is delayed + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_called); + ts.S2_nls_node_list_get_is_last_node = false; + ts.S2_nls_node_list_get_node_id = 4; + ts.S2_nls_node_list_get_granted_keys = 0xFF; + ts.S2_nls_node_list_nls_state = true; + TEST_ASSERT_EQUAL(SENDING_MSG, ctx1->fsm); + TEST_ASSERT_EQUAL(0, ctx1->delayed_transmission_flags.send_nls_node_list_report); + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ctx1->delayed_transmission_flags.send_nls_node_list_report); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_called); + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); // Receive the ack of the encapsulated NLS_STATE_GET_V2 frame + TEST_ASSERT_EQUAL(0, ctx1->delayed_transmission_flags.send_nls_node_list_report); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx1->fsm); + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx1->fsm); + + /* --- step 5 (NLS_NODE_LIST_REPORT_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(19, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(5, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx1->fsm); + + // Secondary controller receives the encapsulated NLS_NODE_LIST_REPORT_V2 frame before the ack of the encapsulated NLS_NODE_LIST_GET_V2 + // frame sent at step 4 so the next encapsulated NLS_NODE_LIST_GET_V2 transmission is delayed + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_report_nls_state); + TEST_ASSERT_EQUAL(0, ctx2->delayed_transmission_flags.send_nls_node_list_get); + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ctx2->delayed_transmission_flags.send_nls_node_list_get); + TEST_ASSERT_EQUAL(1, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_node_id, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_granted_keys, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_nls_state, ts.S2_nls_node_list_report_nls_state); + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); // Receive the ack of the encapsulated NLS_NODE_LIST_GET_V2 frame + TEST_ASSERT_EQUAL(0, ctx2->delayed_transmission_flags.send_nls_node_list_get); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); + + /* --- step 6 (NLS_NODE_LIST_GET_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_NODE_LIST_GET_v2 frame + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(6, ts.fcount); + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); + ts.S2_nls_node_list_get_called = false; + + // Primary controller receives the encapsulated NLS_NODE_LIST_GET_V2 frame + ts.S2_nls_node_list_get_is_last_node = false; + ts.S2_nls_node_list_get_node_id = 5; + ts.S2_nls_node_list_get_granted_keys = 0xFF; + ts.S2_nls_node_list_nls_state = true; + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_called); + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_called); + + /* --- step 7 (NLS_NODE_LIST_REPORT_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx1->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(19, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(7, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx1->fsm); + ts.S2_nls_node_list_report_called = 0; + ts.S2_nls_node_list_report_id_of_node = 0; + ts.S2_nls_node_list_report_keys_node_bitmask = 0; + ts.S2_nls_node_list_report_nls_state = false; + + // Secondary controller receives the encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_report_nls_state); + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_node_id, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_granted_keys, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_nls_state, ts.S2_nls_node_list_report_nls_state); + + /* --- step 8 (NLS_NODE_LIST_GET_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_NODE_LIST_GET_v2 frame + TEST_ASSERT_EQUAL(false, ctx2->delayed_transmission_flags.send_nls_node_list_get); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(8, ts.fcount); + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); + ts.S2_nls_node_list_get_called = false; + + // Primary controller receives the encapsulated NLS_NODE_LIST_GET_V2 frame + ts.S2_nls_node_list_get_is_last_node = true; + ts.S2_nls_node_list_get_node_id = 6; + ts.S2_nls_node_list_get_granted_keys = 0xFF; + ts.S2_nls_node_list_nls_state = true; + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_called); + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_called); + + /* --- step 9 (NLS_NODE_LIST_REPORT_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx1->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(19, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(9, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx1->fsm); + ts.S2_nls_node_list_report_called = 0; + ts.S2_nls_node_list_report_id_of_node = 0; + ts.S2_nls_node_list_report_keys_node_bitmask = 0; + ts.S2_nls_node_list_report_nls_state = false; + + // Secondary controller receives the encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_report_nls_state); + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_node_id, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_granted_keys, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_nls_state, ts.S2_nls_node_list_report_nls_state); + + /* --- step 10 (Secondary controller gets last_node flag finally and does not re-initiate another NLS_NODE_LIST_GET_v2) --- */ + + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); +} + +/** + * This test is very similar to the original test_secondary_controller_joining_to_network_happy_case test + * except that the ack for the NLS_STATE_REPORT_V2 is delayed and unluckily the secondary controller receives + * an irrelevant packet instead of the ack. Luckily, the secondary controller is still able to receive the ack + * after the irrelevant packet reception and the flow continues as expected. + */ +void test_secondary_controller_joining_to_network_nls_state_report_ack_received_after_irrelevent_packet_reception(void) +{ + test_s2_send_data(); + /* ----------- now send second frame with SPAN established --------- * + */ + + ts.fcount = 0; //Reset frame count + ts.rx_frame_len = 0; + + /* --- step 1 (NLS_STATE_SET_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_STATE_SET_V2 frame + uint8_t nls_state = 1; // enable NLS + uint8_t nls_state_set[] = {COMMAND_CLASS_SECURITY_2, NLS_STATE_SET_V2, nls_state}; + S2_send_data(ctx1, &conn12, (uint8_t *)nls_state_set, sizeof(nls_state_set)); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + + // Secondary controller receives the encapsulated NLS_STATE_SET_V2 frame + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ctx2->nls_state); // Test the flag in the context of secondary controller + TEST_ASSERT_EQUAL(true, ts.S2_save_nls_state_called); // Test callback + TEST_ASSERT_EQUAL(1, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + + /* --- step 2 (NLS_STATE_GET_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_STATE_GET_V2 frame + uint8_t nls_state_get[] = {COMMAND_CLASS_SECURITY_2, NLS_STATE_GET_V2}; + S2_send_data(ctx1, &conn12, (uint8_t *)nls_state_get, sizeof(nls_state_get)); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(14, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(2, ts.fcount); + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + + // Secondary controller receives the encapsulated NLS_STATE_GET_V2 frame + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ctx2->delayed_transmission_flags.send_nls_node_list_get); + + /* --- step 3 (NLS_STATE_REPORT_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_STATE_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(3, ts.fcount); + + // Primary controller receives the encapsulated NLS_STATE_REPORT_V2 frame + TEST_ASSERT_EQUAL(false, ts.S2_notify_nls_state_report_nls_capability); + TEST_ASSERT_EQUAL(false, ts.S2_notify_nls_state_report_nls_state); + TEST_ASSERT_EQUAL(false, ts.S2_notify_nls_state_report_called); + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ts.S2_notify_nls_state_report_called); + TEST_ASSERT_EQUAL(true, ts.S2_notify_nls_state_report_nls_capability); + TEST_ASSERT_EQUAL(true, ts.S2_notify_nls_state_report_nls_state); + TEST_ASSERT_EQUAL(3, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + + /* --- step 3.1 (Secondary controller gets an irrelevant packet instead of the ack) --- */ + + // Irrelevant packet triggers a transmission of SECURITY_2_NONCE_REPORT frame without a need for an ack + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + uint8_t inject_frame[]="irrelevant packet"; + inject_frame[0] = COMMAND_CLASS_SECURITY_2; + inject_frame[1] = SECURITY_2_NONCE_GET; + S2_application_command_handler(ctx2, &conn31, inject_frame, sizeof(inject_frame)); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); // We're still lucky that state machine is still in the same state + + /* --- step 3.2 (Secondary controller finally receives the ack it is waiting) --- */ + + // Secondary controller receives the ack following to the transmitted encapsulated NLS_STATE_REPORT_V2 frame a little bit later + // after having recevied an irrelevant packet + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + + /* --- step 4 (NLS_NODE_LIST_GET_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_NODE_LIST_GET_v2 frame + TEST_ASSERT_EQUAL(false, ctx2->delayed_transmission_flags.send_nls_node_list_get); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(5, ts.fcount); + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); + + // Primary controller receives the encapsulated NLS_NODE_LIST_GET_V2 frame + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_called); + ts.S2_nls_node_list_get_is_last_node = false; + ts.S2_nls_node_list_get_node_id = 4; + ts.S2_nls_node_list_get_granted_keys = 0xFF; + ts.S2_nls_node_list_nls_state = true; + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_called); + + /* --- step 5 (NLS_NODE_LIST_REPORT_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx1->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(19, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(6, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx1->fsm); + + // Secondary controller receives the encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_report_nls_state); + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_node_id, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_granted_keys, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_nls_state, ts.S2_nls_node_list_report_nls_state); + + /* --- step 6 (NLS_NODE_LIST_GET_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_NODE_LIST_GET_v2 frame + TEST_ASSERT_EQUAL(false, ctx2->delayed_transmission_flags.send_nls_node_list_get); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(7, ts.fcount); + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); + ts.S2_nls_node_list_get_called = false; + + // Primary controller receives the encapsulated NLS_NODE_LIST_GET_V2 frame + ts.S2_nls_node_list_get_is_last_node = false; + ts.S2_nls_node_list_get_node_id = 5; + ts.S2_nls_node_list_get_granted_keys = 0xFF; + ts.S2_nls_node_list_nls_state = true; + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_called); + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_called); + + /* --- step 7 (NLS_NODE_LIST_REPORT_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx1->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(19, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(8, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx1->fsm); + ts.S2_nls_node_list_report_called = 0; + ts.S2_nls_node_list_report_id_of_node = 0; + ts.S2_nls_node_list_report_keys_node_bitmask = 0; + ts.S2_nls_node_list_report_nls_state = false; + + // Secondary controller receives the encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_report_nls_state); + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_node_id, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_granted_keys, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_nls_state, ts.S2_nls_node_list_report_nls_state); + + /* --- step 8 (NLS_NODE_LIST_GET_V2 from secondary to primary controller) --- */ + + // Secondary controller immediately responds to the primary controller with an encapsulated NLS_NODE_LIST_GET_v2 frame + TEST_ASSERT_EQUAL(false, ctx2->delayed_transmission_flags.send_nls_node_list_get); + TEST_ASSERT_EQUAL(SENDING_MSG, ctx2->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(15, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(9, ts.fcount); + S2_send_frame_done_notify(ctx2, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); + ts.S2_nls_node_list_get_called = false; + + // Primary controller receives the encapsulated NLS_NODE_LIST_GET_V2 frame + ts.S2_nls_node_list_get_is_last_node = true; + ts.S2_nls_node_list_get_node_id = 6; + ts.S2_nls_node_list_get_granted_keys = 0xFF; + ts.S2_nls_node_list_nls_state = true; + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_get_called); + S2_application_command_handler(ctx1, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_request); + TEST_ASSERT_EQUAL(true, ts.S2_nls_node_list_get_called); + + /* --- step 9 (NLS_NODE_LIST_REPORT_V2 from primary to secondary controller) --- */ + + // Primary controller sends an encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(SENDING_MSG, ctx1->fsm); + TEST_ASSERT_EQUAL(COMMAND_CLASS_SECURITY_2, ts.frame[0]); + TEST_ASSERT_EQUAL(SECURITY_2_MESSAGE_ENCAPSULATION, ts.frame[1]); + TEST_ASSERT_EQUAL(0, ts.frame[3]); // No extension sent + TEST_ASSERT_EQUAL(19, ts.frame_len); // Lenght of encrypted frame + TEST_ASSERT_EQUAL(10, ts.fcount); + TEST_ASSERT_EQUAL(0, ts.rx_frame_len); + TEST_ASSERT_EQUAL(0, ts.sync_ev.count); // Test that no sync events were emitted during test + S2_send_frame_done_notify(ctx1, S2_TRANSMIT_COMPLETE_OK, 0x42); + TEST_ASSERT_EQUAL(IDLE, ctx1->fsm); + ts.S2_nls_node_list_report_called = 0; + ts.S2_nls_node_list_report_id_of_node = 0; + ts.S2_nls_node_list_report_keys_node_bitmask = 0; + ts.S2_nls_node_list_report_nls_state = false; + + // Secondary controller receives the encapsulated NLS_NODE_LIST_REPORT_V2 frame + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(0, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(false, ts.S2_nls_node_list_report_nls_state); + S2_application_command_handler(ctx2, &ts.last_trans, ts.frame, ts.frame_len); + TEST_ASSERT_EQUAL(1, ts.S2_nls_node_list_report_called); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_node_id, ts.S2_nls_node_list_report_id_of_node); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_get_granted_keys, ts.S2_nls_node_list_report_keys_node_bitmask); + TEST_ASSERT_EQUAL(ts.S2_nls_node_list_nls_state, ts.S2_nls_node_list_report_nls_state); + + /* --- step 10 (Secondary controller gets last_node flag finally and does not re-initiate another NLS_NODE_LIST_GET_v2) --- */ + + TEST_ASSERT_EQUAL(IDLE, ctx2->fsm); +} /** * Make send data return false in nonce get @@ -2461,4 +3250,4 @@ void S2_dbg_printf(const char *format, ...) vfprintf(stdout, format, argptr); va_end(argptr); -} +} \ No newline at end of file diff --git a/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_protocol_cc_encryption_test.c b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_protocol_cc_encryption_test.c deleted file mode 100644 index b90d6f0d8..000000000 --- a/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_protocol_cc_encryption_test.c +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** - * # License - * Copyright 2021 Silicon Laboratories Inc. www.silabs.com - ****************************************************************************** - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - *****************************************************************************/ -#include - -#include "contiki_test_helper.h" - -#include "zwave_s2_protocol_cc_encryption.h" - -#include "zwave_controller_connection_info.h" - -#include "zwave_tx_mock.h" - -#include "sl_log.h" -#include "sl_status.h" - -#include "unity.h" - -/// Setup the test suite (called once before all test_xxx functions are called) -void suiteSetUp() {} - -/// Teardown the test suite (called once after all test_xxx functions are called) -int suiteTearDown(int num_failures) -{ - return num_failures; -} - -void setUp() -{ - contiki_test_helper_init(); -} - -void tearDown() {} - -void test_zwave_s2_on_protocol_cc_encryption_request_happy_case() -{ - zwave_node_id_t destination_node_id = 2; - uint8_t payload[] = {0x01, 0x02, 0x03}; - uint8_t payload_length = sizeof(payload); - uint8_t protocol_metadata[] = {0xA1, 0xA2, 0xA3}; - uint8_t protocol_metadata_length = sizeof(protocol_metadata); - uint8_t use_supervision = 1; - uint8_t session_id = 1; - zwave_controller_connection_info_t connection_info = {0}; - zwave_tx_options_t tx_options = {0}; - zwave_tx_session_id_t tx_session_id = NULL; - protocol_metadata_t metadata = {0}; - - // Expected TX options - tx_options.transport.is_protocol_frame = true; - tx_options.number_of_responses = 1; - tx_options.discard_timeout_ms = 5000; - tx_options.qos_priority = ZWAVE_TX_QOS_MAX_PRIORITY; - - // Expected connection info - connection_info.encapsulation = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; - connection_info.local.node_id = 0; - connection_info.remote.node_id = 2; - - // Expected protocol metadata - metadata.session_id = session_id; - metadata.data_length = protocol_metadata_length; - memcpy(metadata.data, protocol_metadata, protocol_metadata_length); - - zwave_tx_send_data_ExpectWithArrayAndReturn(&connection_info, - sizeof(connection_info), - payload_length, - payload, - sizeof(payload), - &tx_options, - sizeof(tx_options), - NULL, - (void *)&metadata, - sizeof(protocol_metadata_t), - &tx_session_id, - sizeof(zwave_tx_session_id_t), - SL_STATUS_OK); - zwave_tx_send_data_IgnoreArg_on_send_complete(); - - zwave_s2_on_protocol_cc_encryption_request(destination_node_id, - payload_length, - payload, - protocol_metadata_length, - protocol_metadata, - use_supervision, - session_id); -} diff --git a/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_transport_test.c b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_transport_test.c index a7bec0e5d..5f9db3000 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_transport_test.c +++ b/applications/zpc/components/zwave/zwave_transports/s2/test/zwave_s2_transport_test.c @@ -23,16 +23,26 @@ #include "S2_mock.h" #include "zwapi_protocol_mem_mock.h" #include "zwave_tx_mock.h" +#include "zwapi_protocol_controller_mock.h" +#include "zwave_network_management_mock.h" +#include "zwave_utils.h" // ZPC Components #include "zwave_controller_callbacks.h" #include "s2_classcmd.h" #include "ZW_classcmd.h" #include "zwave_rx.h" +#include "attribute_store_fixt.h" +#include "datastore_fixt.h" +#include "zpc_attribute_store_type_registration.h" +#include "zpc_attribute_store_test_helper.h" +#include "zpc_attribute_store_network_helper.h" // Unify components #include "sl_status.h" #include "sl_log.h" +#include "unify_dotdot_attribute_store.h" +#include "attribute_store_helper.h" // Generic includes #include @@ -49,6 +59,45 @@ static zwave_rx_receive_options_t my_rx_options; static uint8_t my_frame_data[100]; static uint16_t my_frame_length; +extern const unify_dotdot_attribute_store_configuration_t zpc_configuration; + +static void create_basic_network(void) +{ + const zwave_home_id_t home_id = 0xcafecafe; + zwave_keyset_t granted_keys = 0xFF; + + unify_dotdot_attribute_store_set_configuration(&zpc_configuration); + + // Configure the UNID module to know our UNID. + zwave_unid_set_home_id(home_id); + + // Make sure to start from scratch + attribute_store_delete_node(attribute_store_get_root()); + // HomeID + attribute_store_node_t home_id_node + = attribute_store_add_node(ATTRIBUTE_HOME_ID, attribute_store_get_root()); + attribute_store_set_reported(home_id_node, &home_id, sizeof(zwave_home_id_t)); + + attribute_store_node_t node_id_node; + zwave_node_id_t node_id; + + node_id = 1; // ZPC + node_id_node = attribute_store_add_node(ATTRIBUTE_NODE_ID, home_id_node); + attribute_store_set_reported(node_id_node, &node_id, sizeof(node_id)); + + node_id = 3; // Z-Wave node + node_id_node = attribute_store_add_node(ATTRIBUTE_NODE_ID, home_id_node); + attribute_store_set_reported(node_id_node, &node_id, sizeof(node_id)); + node_id_node = attribute_store_add_node(ATTRIBUTE_GRANTED_SECURITY_KEYS, node_id_node); + zwave_set_node_granted_keys(node_id, &granted_keys); + + node_id = 4; // Z-Wave node + node_id_node = attribute_store_add_node(ATTRIBUTE_NODE_ID, home_id_node); + attribute_store_set_reported(node_id_node, &node_id, sizeof(node_id)); + node_id_node = attribute_store_add_node(ATTRIBUTE_GRANTED_SECURITY_KEYS, node_id_node); + zwave_set_node_granted_keys(node_id, &granted_keys); +} + /// Setup the test suite (called once before all test_xxx functions are called) void suiteSetUp() {} @@ -62,9 +111,19 @@ void setUp() { num_callbacks = 0; contiki_test_helper_init(); + + datastore_fixt_setup(":memory:"); + attribute_store_init(); + zpc_attribute_store_register_known_attribute_types(); + + create_basic_network(); } -void tearDown() {} +void tearDown() +{ + attribute_store_teardown(); + datastore_fixt_teardown(); +} // Used to catch the status codes static void on_zwave_tx_send_data_complete(uint8_t status, @@ -384,3 +443,220 @@ void test_zwave_s2_abort_send_data() //Abort the tranmission TEST_ASSERT_EQUAL(SL_STATUS_OK, zwave_s2_abort_send_data(session)); } + +void test_zwave_s2_nls_node_list_get_test_request_0_node_exists_last_node() +{ + zwave_nodemask_t node_list = {0}; + uint16_t node_list_length = 0; + int8_t status; + + // Variables for test input + node_t src_node; + bool request; + + // Variables to be filled by the function being tested + bool is_last_node; + uint16_t node_id; + uint8_t granted_keys; + bool nls_state; + + // Set expected values + node_list[0] = 0x08; // Node 4 is NLS enabled + node_list_length = 1; + + zwapi_get_nls_nodes_ExpectAndReturn(NULL, NULL, SL_STATUS_OK); + zwapi_get_nls_nodes_IgnoreArg_list_length(); + zwapi_get_nls_nodes_IgnoreArg_node_list(); + zwapi_get_nls_nodes_ReturnThruPtr_list_length(&node_list_length); + zwapi_get_nls_nodes_ReturnArrayThruPtr_node_list(node_list, + sizeof(node_list)); + + src_node = 1; + request = false; // Request 1st node + status = S2_get_nls_node_list(src_node, + request, + &is_last_node, + &node_id, + &granted_keys, + &nls_state); + + TEST_ASSERT_EQUAL(0, status); + TEST_ASSERT_EQUAL(true, is_last_node); + TEST_ASSERT_EQUAL(4, node_id); + TEST_ASSERT_EQUAL(0xFF, granted_keys); + TEST_ASSERT_EQUAL(true, nls_state); +} + +void test_zwave_s2_nls_node_list_get_test_request_0_node_exists_not_last_node() +{ + zwave_nodemask_t node_list = {0}; + uint16_t node_list_length = 0; + int8_t status; + + // Variables for test input + node_t src_node; + bool request; + + // Variables to be filled by the function being tested + bool is_last_node; + uint16_t node_id; + uint8_t granted_keys; + bool nls_state; + + // Set expected values + node_list[0] = 0x0C; // Node 3 and 4 are NLS enabled + node_list_length = 1; + + zwapi_get_nls_nodes_ExpectAndReturn(NULL, NULL, SL_STATUS_OK); + zwapi_get_nls_nodes_IgnoreArg_list_length(); + zwapi_get_nls_nodes_IgnoreArg_node_list(); + zwapi_get_nls_nodes_ReturnThruPtr_list_length(&node_list_length); + zwapi_get_nls_nodes_ReturnArrayThruPtr_node_list(node_list, + sizeof(node_list)); + + src_node = 1; + request = false; // Request 1st node + status = S2_get_nls_node_list(src_node, + request, + &is_last_node, + &node_id, + &granted_keys, + &nls_state); + + TEST_ASSERT_EQUAL(0, status); + TEST_ASSERT_EQUAL(false, is_last_node); + TEST_ASSERT_EQUAL(3, node_id); + TEST_ASSERT_EQUAL(0xFF, granted_keys); + TEST_ASSERT_EQUAL(true, nls_state); + + src_node = 1; + request = true; // Request 2nd node + status = S2_get_nls_node_list(src_node, + request, + &is_last_node, + &node_id, + &granted_keys, + &nls_state); + + TEST_ASSERT_EQUAL(0, status); + TEST_ASSERT_EQUAL(true, is_last_node); + TEST_ASSERT_EQUAL(4, node_id); + TEST_ASSERT_EQUAL(0xFF, granted_keys); + TEST_ASSERT_EQUAL(true, nls_state); + + src_node = 1; + request = true; // Request a non-existant node + status = S2_get_nls_node_list(src_node, + request, + &is_last_node, + &node_id, + &granted_keys, + &nls_state); + + TEST_ASSERT_EQUAL(-1, status); + TEST_ASSERT_EQUAL(false, nls_state); +} + +void test_zwave_s2_nls_node_list_get_test_request_0_node_does_not_exist() +{ + zwave_nodemask_t node_list = {0}; + uint16_t node_list_length = 0; + int8_t status; + + // Variables for test input + node_t src_node; + bool request; + + // Variables to be filled by the function being tested + bool is_last_node; + uint16_t node_id; + uint8_t granted_keys; + bool nls_state; + + // Set expected values + node_list[0] = 0x00; + node_list_length = 1; + + zwapi_get_nls_nodes_ExpectAndReturn(NULL, NULL, SL_STATUS_OK); + zwapi_get_nls_nodes_IgnoreArg_list_length(); + zwapi_get_nls_nodes_IgnoreArg_node_list(); + zwapi_get_nls_nodes_ReturnThruPtr_list_length(&node_list_length); + zwapi_get_nls_nodes_ReturnArrayThruPtr_node_list(node_list, + sizeof(node_list)); + + src_node = 1; + request = false; // Request 1st node + status = S2_get_nls_node_list(src_node, + request, + &is_last_node, + &node_id, + &granted_keys, + &nls_state); + + TEST_ASSERT_EQUAL(-1, status); + TEST_ASSERT_EQUAL(false, nls_state); +} + +void test_zwave_s2_nls_node_list_report_test_happy_case() +{ + int8_t status; + + // Variables for test input + node_t src_node; + uint16_t node_id; + uint8_t granted_keys; + bool nls_state; + + src_node = 1; + node_id = 3; + granted_keys = 0xFF; + nls_state = true; + + zwapi_enable_node_nls_ExpectAndReturn(node_id, SL_STATUS_OK); + + status = S2_notify_nls_node_list_report(src_node, node_id, granted_keys, nls_state); + + TEST_ASSERT_EQUAL(0, status); +} + +void test_zwave_s2_nls_node_list_report_test_node_does_not_exist() +{ + int8_t status; + + // Variables for test input + node_t src_node; + uint16_t node_id; + uint8_t granted_keys; + bool nls_state; + + src_node = 1; + node_id = 6; // Non existant node + granted_keys = 0xFF; + nls_state = true; + + zwapi_enable_node_nls_ExpectAndReturn(node_id, SL_STATUS_OK); + + status = S2_notify_nls_node_list_report(src_node, node_id, granted_keys, nls_state); + + TEST_ASSERT_EQUAL(-1, status); +} + +void test_zwave_s2_nls_node_list_report_test_nls_state_not_set() +{ + int8_t status; + + // Variables for test input + node_t src_node; + uint16_t node_id; + uint8_t granted_keys; + bool nls_state; + + src_node = 1; + node_id = 3; // Non existant node + granted_keys = 0xFF; + nls_state = false; + + status = S2_notify_nls_node_list_report(src_node, node_id, granted_keys, nls_state); + + TEST_ASSERT_EQUAL(-1, status); +} diff --git a/applications/zpc/components/zwave/zwave_transports/src/zwave_transports_fixt.c b/applications/zpc/components/zwave/zwave_transports/src/zwave_transports_fixt.c index a7ff02dd8..4c5554746 100644 --- a/applications/zpc/components/zwave/zwave_transports/src/zwave_transports_fixt.c +++ b/applications/zpc/components/zwave/zwave_transports/src/zwave_transports_fixt.c @@ -18,7 +18,6 @@ #include "zwave_transport_service_wrapper.h" #include "multicast_follow_ups_transport.h" #include "zwave_api_transport.h" -#include "zwave_crc16_transport.h" // Generic includes #include @@ -33,7 +32,6 @@ sl_status_t zwave_transports_init(void) // Do not abort initialization if some transports fail. initialization_status |= zwave_multi_channel_transport_init(); initialization_status |= zwave_s0_transport_init(); - initialization_status |= zwave_crc16_transport_init(); // S2 inits itself with the Contiki process. initialization_status |= zwave_transport_service_transport_init(); initialization_status |= multicast_follow_ups_transport_init(); diff --git a/applications/zpc/components/zwave/zwave_tx/src/zwave_tx_callbacks.cpp b/applications/zpc/components/zwave/zwave_tx/src/zwave_tx_callbacks.cpp index 2d9d5b9ef..9dba67f1a 100644 --- a/applications/zpc/components/zwave/zwave_tx/src/zwave_tx_callbacks.cpp +++ b/applications/zpc/components/zwave/zwave_tx/src/zwave_tx_callbacks.cpp @@ -95,7 +95,8 @@ void on_zwave_transport_send_data_complete(uint8_t status, void zwave_tx_on_new_network_entered(zwave_home_id_t, zwave_node_id_t, zwave_keyset_t, - zwave_kex_fail_type_t) + zwave_kex_fail_type_t, + zwave_protocol_t) { // This will re-init and unlock the Tx Queue to accept frames again. zwave_tx_process_open_tx_queue(); diff --git a/applications/zpc/components/zwave/zwave_tx/src/zwave_tx_callbacks.h b/applications/zpc/components/zwave/zwave_tx/src/zwave_tx_callbacks.h index 4c724ca6d..9e42d6ca0 100644 --- a/applications/zpc/components/zwave/zwave_tx/src/zwave_tx_callbacks.h +++ b/applications/zpc/components/zwave/zwave_tx/src/zwave_tx_callbacks.h @@ -61,7 +61,8 @@ void zwave_tx_on_frame_received(zwave_node_id_t node_id); void zwave_tx_on_new_network_entered(zwave_home_id_t home_id, zwave_node_id_t node_id, zwave_keyset_t granted_keys, - zwave_kex_fail_type_t kex_fail_type); + zwave_kex_fail_type_t kex_fail_type, + zwave_protocol_t inclusion_protocol); #ifdef __cplusplus } diff --git a/applications/zpc/components/zwave/zwave_tx/test/zwave_tx_test.c b/applications/zpc/components/zwave/zwave_tx/test/zwave_tx_test.c index c891827ee..89ad96e8d 100644 --- a/applications/zpc/components/zwave/zwave_tx/test/zwave_tx_test.c +++ b/applications/zpc/components/zwave/zwave_tx/test/zwave_tx_test.c @@ -773,7 +773,7 @@ void test_zwave_tx_queue_flush_while_empty() // Tx queue opens again after entering a new netowrk TEST_ASSERT_NOT_NULL(zwave_controller_callbacks->on_new_network_entered); - zwave_controller_callbacks->on_new_network_entered(1, 2, 3, 4); + zwave_controller_callbacks->on_new_network_entered(1, 2, 3, 4, 5); // Tx Queue is happy again TEST_ASSERT_EQUAL(SL_STATUS_OK, diff --git a/applications/zpc/components/zwave_api/external/ext_transport_security.c b/applications/zpc/components/zwave_api/external/ext_transport_security.c deleted file mode 100644 index 2d7b8d742..000000000 --- a/applications/zpc/components/zwave_api/external/ext_transport_security.c +++ /dev/null @@ -1,20 +0,0 @@ -// CLEANUP: Moved from Serialapi.c - -#ifdef SECURITY_SUPPORT -#include "rijndael-alg-fst.h" -bool SerialAPI_AES128_Encrypt(const uint8_t *ext_input, uint8_t *ext_output, const uint8_t *cipherKey) CC_REENTRANT_ARG{ - int Nr; /* key-length-dependent number of rounds */ - u32 rk[4*(MAXNR + 1)]; /* key schedule */ - /*if(zwapi_support_command_func(FUNC_ID_ZW_AES_ECB)) { - memcpy(&buffer[0],cipherKey,16); - memcpy(&buffer[16],ext_input,16); - zwapi_session_send_frame_with_response(FUNC_ID_ZW_AES_ECB, buffer, 32 , buffer, &byLen ); - memcpy(ext_output,&buffer[IDX_DATA],16); - return 1; - } else*/ { - Nr = rijndaelKeySetupEnc(rk, cipherKey, 128); - rijndaelEncrypt(rk, Nr, ext_input, ext_output); - return 1; - } -} -#endif diff --git a/applications/zpc/components/zwave_api/external/ext_transport_security.h b/applications/zpc/components/zwave_api/external/ext_transport_security.h deleted file mode 100644 index 5de0159bc..000000000 --- a/applications/zpc/components/zwave_api/external/ext_transport_security.h +++ /dev/null @@ -1,5 +0,0 @@ -// CLEANUP: Moved from Serialapi.h - since it does not use the serial API - -/* Access hardware AES encrypter. ext_input,ext_output,ext_key are all 16 byte arrays - * Returns true if routine went well. */ -bool SerialAPI_AES128_Encrypt(const uint8_t *ext_input, uint8_t *ext_output, const uint8_t *ext_key); diff --git a/applications/zpc/components/zwave_api/include/zwapi_protocol_controller.h b/applications/zpc/components/zwave_api/include/zwapi_protocol_controller.h index 01594c6d6..237606048 100644 --- a/applications/zpc/components/zwave_api/include/zwapi_protocol_controller.h +++ b/applications/zpc/components/zwave_api/include/zwapi_protocol_controller.h @@ -1077,6 +1077,48 @@ sl_status_t zwapi_get_nls_nodes(uint16_t *list_length, sl_status_t zwapi_request_protocol_cc_encryption_callback( uint8_t tx_status, const zwapi_tx_report_t *tx_report, uint8_t session_id); +/** + * @brief Assign a priority return route to a Routing End Node. + * + * This function assigns a specified priority return route to a Routing End Node + * for communication with a destination node. The route is defined by up to 4 repeater nodes + * and a speed value. + * + * @param bNodeID The Routing End Node ID to which the route will be assigned. + * @param bDstNodeID The destination Node ID for the return route. + * @param route Pointer to an array of 4 node IDs representing the repeaters in the route. + * If a repeater is not used, set its value to 0. + * @param speed The speed to use for the route (e.g., ZW_PRIORITY_ROUTE_SPEED_9600, etc.). + * @param completedFunc Callback function called when the operation is complete. + * The parameter bStatus indicates the transmit complete status. + * + * @returns SL_STATUS_OK or SL_STATUS_FAIL. + */ +sl_status_t zwapi_assign_priority_return_route(zwave_node_id_t bNodeID, + zwave_node_id_t bDstNodeID, + uint8_t * route, // route length is always 4 + uint8_t speed, + void (*completedFunc)(uint8_t bStatus)); + +/** + * @brief Assign a priority SUC return route to a Routing End Node. + * + * This function assigns a specified priority return route from the SUC (Static Update Controller) + * to a Routing End Node. The route is defined by up to 4 repeater nodes and a speed value. + * + * @param bNodeID The Routing End Node ID to which the SUC return route will be assigned. + * @param route Pointer to an array of 4 node IDs representing the repeaters in the route. + * If a repeater is not used, set its value to 0. + * @param speed The speed to use for the route (e.g., ZW_PRIORITY_ROUTE_SPEED_9600, etc.). + * @param completedFunc Callback function called when the operation is complete. + * The parameter bStatus indicates the transmit complete status. + * + * @returns SL_STATUS_OK or SL_STATUS_FAIL. + */ +sl_status_t zwapi_assign_priority_suc_return_route(zwave_node_id_t bNodeID, + uint8_t * route, // route length is always 4 + uint8_t speed, + void (*completedFunc)(uint8_t bStatus)); /// @} End of group ZWAPI_CONTROLLER #ifdef __cplusplus diff --git a/applications/zpc/components/zwave_api/src/zwapi_internal.h b/applications/zpc/components/zwave_api/src/zwapi_internal.h index b14dee57d..f9224c20a 100644 --- a/applications/zpc/components/zwave_api/src/zwapi_internal.h +++ b/applications/zpc/components/zwave_api/src/zwapi_internal.h @@ -45,8 +45,10 @@ extern void (*zwapi_add_node_to_network_callback)(struct LEARN_INFO *); extern void (*zwapi_transfer_primary_ctrl_role_callback)(struct LEARN_INFO *); extern void (*zwapi_send_controller_replication_callback)(uint8_t txStatus); extern void (*zwapi_assign_return_route_callback)(uint8_t bStatus); +extern void (*zwapi_assign_priority_return_route_callback)(uint8_t bStatus); extern void (*zwapi_assign_suc_return_route_callback)(uint8_t bStatus); extern void (*zwapi_delete_suc_return_route_callback)(uint8_t bStatus); +extern void (*zwapi_assign_priority_suc_return_route_callback)(uint8_t bStatus); extern void (*zwapi_delete_return_route_callback)(uint8_t bStatus); extern void (*zwapi_set_learn_mode_callback)(struct LEARN_INFO *); extern void (*zwapi_set_virtual_node_to_learn_mode_callback)( diff --git a/applications/zpc/components/zwave_api/src/zwapi_protocol_controller.c b/applications/zpc/components/zwave_api/src/zwapi_protocol_controller.c index 7e25b8828..e042d4d48 100644 --- a/applications/zpc/components/zwave_api/src/zwapi_protocol_controller.c +++ b/applications/zpc/components/zwave_api/src/zwapi_protocol_controller.c @@ -235,6 +235,41 @@ sl_status_t zwapi_assign_return_route(zwave_node_id_t bSrcNodeID, return SL_STATUS_FAIL; } +sl_status_t zwapi_assign_priority_return_route(zwave_node_id_t bNodeID, + zwave_node_id_t bDstNodeID, + uint8_t * route, + uint8_t speed, + void (*completedFunc)(uint8_t bStatus)) +{ + uint8_t func_id, response_length = 0, index = 0; + uint8_t request_buffer[REQUEST_BUFFER_SIZE] = {0}, + response_buffer[FRAME_LENGTH_MAX] = {0}; + func_id = (completedFunc == NULL ? 0 : 0x03); + zwapi_write_node_id(request_buffer, &index, bNodeID); + zwapi_write_node_id(request_buffer, &index, bDstNodeID); + request_buffer[index++] = route[0]; + request_buffer[index++] = route[1]; + request_buffer[index++] = route[2]; + request_buffer[index++] = route[3]; + request_buffer[index++] = speed; + request_buffer[index++] = func_id; + zwapi_assign_priority_return_route_callback = completedFunc; + + sl_status_t send_command_status + = zwapi_send_command_with_response(FUNC_ID_ZW_ASSIGN_PRIORITY_RETURN_ROUTE, + request_buffer, + index, + response_buffer, + &response_length); + + if (send_command_status == SL_STATUS_OK && response_length > IDX_DATA + && response_buffer[IDX_DATA] == ZW_COMMAND_RETURN_VALUE_TRUE) { + return SL_STATUS_OK; + } + + return SL_STATUS_FAIL; +} + sl_status_t zwapi_delete_return_route(zwave_node_id_t nodeID, void (*completedFunc)(uint8_t)) { @@ -287,6 +322,39 @@ sl_status_t zwapi_assign_suc_return_route(zwave_node_id_t bSrcNodeID, return SL_STATUS_FAIL; } +sl_status_t zwapi_assign_priority_suc_return_route(zwave_node_id_t bNodeID, + uint8_t * route, + uint8_t speed, + void (*completedFunc)(uint8_t bStatus)) +{ + uint8_t func_id, response_length = 0, index = 0; + uint8_t request_buffer[REQUEST_BUFFER_SIZE] = {0}, + response_buffer[FRAME_LENGTH_MAX] = {0}; + func_id = (completedFunc == NULL ? 0 : 0x03); + zwapi_write_node_id(request_buffer, &index, bNodeID); + request_buffer[index++] = route[0]; + request_buffer[index++] = route[1]; + request_buffer[index++] = route[2]; + request_buffer[index++] = route[3]; + request_buffer[index++] = speed; + request_buffer[index++] = func_id; + zwapi_assign_priority_suc_return_route_callback = completedFunc; + + sl_status_t send_command_status + = zwapi_send_command_with_response(FUNC_ID_ZW_ASSIGN_PRIORITY_SUC_RETURN_ROUTE, + request_buffer, + index, + response_buffer, + &response_length); + + if (send_command_status == SL_STATUS_OK && response_length > IDX_DATA + && response_buffer[IDX_DATA] == ZW_COMMAND_RETURN_VALUE_TRUE) { + return SL_STATUS_OK; + } + + return SL_STATUS_FAIL; +} + sl_status_t zwapi_delete_suc_return_route(zwave_node_id_t nodeID, void (*completedFunc)(uint8_t)) { diff --git a/applications/zpc/components/zwave_api/src/zwapi_protocol_rx_dispatch.c b/applications/zpc/components/zwave_api/src/zwapi_protocol_rx_dispatch.c index b74fe59fb..f4c223bee 100644 --- a/applications/zpc/components/zwave_api/src/zwapi_protocol_rx_dispatch.c +++ b/applications/zpc/components/zwave_api/src/zwapi_protocol_rx_dispatch.c @@ -53,8 +53,10 @@ void (*zwapi_add_node_to_network_callback)(struct LEARN_INFO *); void (*zwapi_transfer_primary_ctrl_role_callback)(struct LEARN_INFO *); void (*zwapi_send_controller_replication_callback)(uint8_t txStatus); void (*zwapi_assign_return_route_callback)(uint8_t bStatus); +void (*zwapi_assign_priority_return_route_callback)(uint8_t bStatus); void (*zwapi_assign_suc_return_route_callback)(uint8_t bStatus); void (*zwapi_delete_suc_return_route_callback)(uint8_t bStatus); +void (*zwapi_assign_priority_suc_return_route_callback)(uint8_t bStatus); void (*zwapi_delete_return_route_callback)(uint8_t bStatus); void (*zwapi_set_learn_mode_callback)(struct LEARN_INFO *); void (*zwapi_set_virtual_node_to_learn_mode_callback)(uint8_t bStatus, @@ -68,31 +70,33 @@ void (*zwapi_replace_failed_node_callback)(uint8_t txStatus); void zwave_api_protocol_init_callbacks(void) { - zwapi_send_data_callback = NULL; - zwapi_send_nop_callback = NULL; - zwapi_send_data_multi_callback = NULL; - zwapi_send_test_frame_callback = NULL; - zwapi_send_data_bridge_callback = NULL; - zwapi_send_data_multi_bridge_callback = NULL; - zwapi_send_node_information_callback = NULL; - zwapi_memory_put_buffer_callback = NULL; - zwapi_set_default_callback = NULL; - zwapi_create_new_primarly_ctrl_callback = NULL; - zwapi_remove_node_from_network_callback = NULL; - zwapi_add_node_to_network_callback = NULL; - zwapi_transfer_primary_ctrl_role_callback = NULL; - zwapi_send_controller_replication_callback = NULL; - zwapi_assign_return_route_callback = NULL; - zwapi_assign_suc_return_route_callback = NULL; - zwapi_delete_suc_return_route_callback = NULL; - zwapi_delete_return_route_callback = NULL; - zwapi_set_learn_mode_callback = NULL; - zwapi_set_virtual_node_to_learn_mode_callback = NULL; - zwapi_request_neighbor_update_callback = NULL; - zwapi_set_suc_node_id_callback = NULL; - zwapi_request_network_update_callback = NULL; - zwapi_remove_failed_node_callback = NULL; - zwapi_replace_failed_node_callback = NULL; + zwapi_send_data_callback = NULL; + zwapi_send_nop_callback = NULL; + zwapi_send_data_multi_callback = NULL; + zwapi_send_test_frame_callback = NULL; + zwapi_send_data_bridge_callback = NULL; + zwapi_send_data_multi_bridge_callback = NULL; + zwapi_send_node_information_callback = NULL; + zwapi_memory_put_buffer_callback = NULL; + zwapi_set_default_callback = NULL; + zwapi_create_new_primarly_ctrl_callback = NULL; + zwapi_remove_node_from_network_callback = NULL; + zwapi_add_node_to_network_callback = NULL; + zwapi_transfer_primary_ctrl_role_callback = NULL; + zwapi_send_controller_replication_callback = NULL; + zwapi_assign_return_route_callback = NULL; + zwapi_assign_priority_return_route_callback = NULL; + zwapi_assign_suc_return_route_callback = NULL; + zwapi_delete_suc_return_route_callback = NULL; + zwapi_assign_priority_suc_return_route_callback = NULL; + zwapi_delete_return_route_callback = NULL; + zwapi_set_learn_mode_callback = NULL; + zwapi_set_virtual_node_to_learn_mode_callback = NULL; + zwapi_request_neighbor_update_callback = NULL; + zwapi_set_suc_node_id_callback = NULL; + zwapi_request_network_update_callback = NULL; + zwapi_remove_failed_node_callback = NULL; + zwapi_replace_failed_node_callback = NULL; } /* Check if the received frame will overflow zwapi_command_buffer buffer */ @@ -552,6 +556,12 @@ void zwave_api_protocol_rx_dispatch(uint8_t *pData, uint16_t len) } break; + case FUNC_ID_ZW_ASSIGN_PRIORITY_RETURN_ROUTE: + if (zwapi_assign_priority_return_route_callback != NULL) { + zwapi_assign_priority_return_route_callback(pData[IDX_DATA + 1]); + } + break; + case FUNC_ID_ZW_ASSIGN_SUC_RETURN_ROUTE: if (zwapi_assign_suc_return_route_callback != NULL) { zwapi_assign_suc_return_route_callback(pData[IDX_DATA + 1]); @@ -564,6 +574,12 @@ void zwave_api_protocol_rx_dispatch(uint8_t *pData, uint16_t len) } break; + case FUNC_ID_ZW_ASSIGN_PRIORITY_SUC_RETURN_ROUTE: + if (zwapi_assign_priority_suc_return_route_callback != NULL) { + zwapi_assign_priority_suc_return_route_callback(pData[IDX_DATA + 1]); + } + break; + case FUNC_ID_ZW_SET_LEARN_MODE: if (zwapi_set_learn_mode_callback != NULL) { int bytes_to_read = IDX_DATA + 3; diff --git a/applications/zpc/components/zwave_command_classes/CMakeLists.txt b/applications/zpc/components/zwave_command_classes/CMakeLists.txt index c59c6587e..c10fcd01c 100644 --- a/applications/zpc/components/zwave_command_classes/CMakeLists.txt +++ b/applications/zpc/components/zwave_command_classes/CMakeLists.txt @@ -18,7 +18,6 @@ add_library( src/zwave_command_class_battery.cpp src/zwave_command_class_central_scene.c src/zwave_command_class_configuration_control.c - src/zwave_command_class_crc16.cpp src/zwave_command_class_device_reset_locally.cpp src/zwave_command_class_door_lock_control.cpp src/zwave_command_class_firmware_update.c @@ -62,7 +61,8 @@ add_library( src/zwave_command_classes_fixt.c src/zwave_command_classes_utils.c src/zwave_command_class_inclusion_controller.cpp - src/zwave_command_class_transport_service.c) + src/zwave_command_class_transport_service.c + src/zwave_command_class_protocol.c) install(TARGETS zwave_command_classes LIBRARY DESTINATION lib) target_include_directories( diff --git a/applications/zpc/components/zwave_command_classes/include/zwave_command_class_crc16.h b/applications/zpc/components/zwave_command_classes/include/zwave_command_class_crc16.h deleted file mode 100644 index 1d341cefb..000000000 --- a/applications/zpc/components/zwave_command_classes/include/zwave_command_class_crc16.h +++ /dev/null @@ -1,91 +0,0 @@ -/****************************************************************************** - * # License - * Copyright 2024 Silicon Laboratories Inc. www.silabs.com - ****************************************************************************** - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - *****************************************************************************/ - -/** - * @defgroup zwave_command_class_crc16 - * @brief CRC16 Encap support - * - * Provides utility functions for CRC16 Encap support. - * - * You can check if endpoint node actually supports CRC16 Encap. - * Also you can flag a node and endpoint as expecting a CRC16 response to make sure that - * you use the same encapsulation as the sender. - * @{ - */ - -#ifndef ZWAVE_COMMAND_CLASS_CRC16_H -#define ZWAVE_COMMAND_CLASS_CRC16_H - -#include "sl_status.h" -#include "zwave_node_id_definitions.h" -#include "attribute_store.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Check if the CRC16 command class is supported by a given node and endpoint. - * - * @param endpoint_node Endpoint node - * - * @return false if the node is still in interviewing state - * @return false if the node does not support CRC16 - * @return false if the node explicitly does not want to send crc16 frame - * @return true if the node supports CRC16 - */ -bool zwave_command_class_crc16_is_supported( - attribute_store_node_t endpoint_node); - -/** - * @brief Clear the CRC16 expecting response flag for a given node and endpoint. - * - * @note Nothing happens if the flag is not set. - * - * @param node_id Node ID - * @param endpoint_id Endpoint ID - */ -void zwave_command_class_crc16_clear_expect_crc16_response( - zwave_node_id_t node_id, zwave_endpoint_id_t endpoint_id); - -/** - * @brief Mark the given node_id and endpoint_id as expecting a CRC16 response. - * - * @note You can call this multiple times on the same node_id and endpoint_id to have multiples CRC16 responses - * - * @param node_id Node ID - * @param endpoint_id Endpoint ID - */ -void zwave_command_class_crc16_set_expect_crc16_response( - zwave_node_id_t node_id, zwave_endpoint_id_t endpoint_id); - -/** - * @brief Check if the given node_id and endpoint_id is expecting a CRC16 response. - * - * @param node_id Node ID - * @param endpoint_id Endpoint ID - * - * @return true if the node_id and endpoint_id is expecting a CRC16 response, false otherwise. - */ -bool zwave_command_class_crc16_is_expecting_crc16_response( - zwave_node_id_t node_id, zwave_endpoint_id_t endpoint_id); - -sl_status_t zwave_command_class_crc16_init(); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif //ZWAVE_COMMAND_CLASS_CRC16_H -/** @} end zwave_command_class_crc16 */ diff --git a/applications/zpc/components/zwave/zwave_transports/s2/include/zwave_s2_protocol_cc_encryption.h b/applications/zpc/components/zwave_command_classes/include/zwave_command_class_protocol.h similarity index 50% rename from applications/zpc/components/zwave/zwave_transports/s2/include/zwave_s2_protocol_cc_encryption.h rename to applications/zpc/components/zwave_command_classes/include/zwave_command_class_protocol.h index db257f59f..2dd8dd55b 100644 --- a/applications/zpc/components/zwave/zwave_transports/s2/include/zwave_s2_protocol_cc_encryption.h +++ b/applications/zpc/components/zwave_command_classes/include/zwave_command_class_protocol.h @@ -11,40 +11,34 @@ * *****************************************************************************/ -/** - * @defgroup zwave_s2_protocol_cc_encryption Security 2 Protocol Command Class Encryption - * @ingroup zwave_transports - * @brief Protocol Command Class Encryption implementation for Z-Wave S2 - * - * @{ - */ - -#ifndef ZWAVE_S2_PROTOCOL_CC_ENCRYPTION_H -#define ZWAVE_S2_PROTOCOL_CC_ENCRYPTION_H +#ifndef ZWAVE_COMMAND_CLASS_PROTOCOL_H +#define ZWAVE_COMMAND_CLASS_PROTOCOL_H -#include #include "sl_status.h" -#include "zwave_node_id_definitions.h" +#include "zwave_controller_connection_info.h" +#include "zwave_rx.h" +#include "zwave_tx.h" #ifdef __cplusplus extern "C" { #endif /** - * @brief Triggered when a Protocol CC Encryption Request is received. * - * This callback has to be registered to the Z-Wave Controller callbacks. + * @brief Setup fixture for the Protocol Command Class. * - * @param destination_node_id Destination node ID. - * @param payload_length Length of the payload to be encrypted. - * @param payload Payload to be encrypted. - * @param protocol_metadata_length Length of the protocol metadata. - * @param protocol_metadata Protocol metadata. - * @param use_supervision Whether to use supervision. - * @param session_id Session ID. + * This setup will register the Protocol command handler + * to the Z-Wave CC framework, * + * @returns SL_STATUS_OK if successful + * @returns SL_STATUS_FAIL if an error occurred */ -void zwave_s2_on_protocol_cc_encryption_request( +sl_status_t zwave_command_class_protocol_init(void); + +/** + * @brief + */ +void zwave_on_protocol_cc_encryption_request( const zwave_node_id_t destination_node_id, const uint8_t payload_length, const uint8_t *const payload, @@ -57,6 +51,4 @@ void zwave_s2_on_protocol_cc_encryption_request( } #endif -#endif //ZWAVE_S2_PROTOCOL_CC_ENCRYPTION_H -/** @} end zwave_s2_protocol_cc_encryption */ - +#endif //ZWAVE_COMMAND_CLASS_PROTOCOL_H \ No newline at end of file diff --git a/applications/zpc/components/zwave_command_classes/src/zwave_command_class_crc16.cpp b/applications/zpc/components/zwave_command_classes/src/zwave_command_class_crc16.cpp deleted file mode 100644 index 6525aa5f2..000000000 --- a/applications/zpc/components/zwave_command_classes/src/zwave_command_class_crc16.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/****************************************************************************** - * # License - * Copyright 2024 Silicon Laboratories Inc. www.silabs.com - ****************************************************************************** - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - *****************************************************************************/ -// Includes from this component -#include "zwave_command_class_crc16.h" -#include "zwave_command_classes_utils.h" - -// Generic includes -#include -#include -#include // make_pair - -// Includes from other ZPC Components -#include "zwave_command_class_indices.h" -#include "zwave_command_handler.h" -#include "zpc_attribute_store_network_helper.h" -#include "attribute_store_defined_attribute_types.h" -#include "ZW_classcmd.h" -#include "zpc_attribute_resolver.h" - -// Includes from other Unify Components -#include "dotdot_mqtt.h" -#include "dotdot_mqtt_generated_commands.h" -#include "attribute_store_helper.h" -#include "attribute_resolver.h" -#include "attribute_timeouts.h" -#include "sl_log.h" - -// Cpp include -#include "attribute.hpp" -#include "zwave_frame_generator.hpp" -#include "zwave_frame_parser.hpp" - - -// Attribute macro, shortening those long defines for attribute types: -#define ATTRIBUTE(type) ATTRIBUTE_COMMAND_CLASS_CRC16_##type - -// Log tag -constexpr char LOG_TAG[] = "zwave_command_class_crc16"; - -using crc16_disabled_flag_t = uint8_t; -constexpr uint8_t CRC16_DISABLED_FLAG_OFF = 0x00; -constexpr uint8_t CRC16_DISABLED_FLAG_ON = 0x01; - -namespace -{ -using connection_info_pair_t = std::pair; -std::vector // NOSONAR : false positive - expecting_crc16_response; // NOSONAR : false positive -} - -/////////////////////////////////////////////////////////////////////////////// -// Helper -/////////////////////////////////////////////////////////////////////////////// -bool zwave_command_class_crc16_is_supported(attribute_store_node_t node) -{ - attribute_store::attribute endpoint_node(node); - - auto network_status_node = endpoint_node.parent().child_by_type( - DOTDOT_ATTRIBUTE_ID_STATE_NETWORK_STATUS); - if (!network_status_node.reported_exists()) { - return false; - } - - if (network_status_node.reported() - != ZCL_NODE_STATE_NETWORK_STATUS_ONLINE_FUNCTIONAL) { - return false; - } - - auto disabled_crc16_node - = endpoint_node.child_by_type(ATTRIBUTE(DISABLE_CRC16)); - - if (disabled_crc16_node.is_valid() && disabled_crc16_node.reported_exists() - && disabled_crc16_node.reported() - == CRC16_DISABLED_FLAG_ON) { - return false; - } - - // Check if the endpoint supports CRC16 - return endpoint_node.child_by_type(ATTRIBUTE(VERSION)).is_valid(); -} - -/////////////////////////////////////////////////////////////////////////////// -// Current state -/////////////////////////////////////////////////////////////////////////////// - -std::vector::iterator - find_expecting_crc16_response(zwave_node_id_t node_id, - zwave_endpoint_id_t endpoint_id) -{ - return std::find_if(expecting_crc16_response.begin(), - expecting_crc16_response.end(), - [node_id, endpoint_id](const auto &pair) { - return pair.first == node_id - && pair.second == endpoint_id; - }); -} - -void zwave_command_class_crc16_clear_expect_crc16_response( - zwave_node_id_t node_id, zwave_endpoint_id_t endpoint_id) -{ - sl_log_debug(LOG_TAG, - "Clearing expecting CRC16 response for node %d, endpoint %d", - node_id, - endpoint_id); - auto it = find_expecting_crc16_response(node_id, endpoint_id); - if (it != expecting_crc16_response.end()) { - sl_log_debug(LOG_TAG, - "Removing expecting CRC16 response for node %d, endpoint %d", - node_id, - endpoint_id); - expecting_crc16_response.erase(it); - } -} - -void zwave_command_class_crc16_set_expect_crc16_response( - zwave_node_id_t node_id, zwave_endpoint_id_t endpoint_id) -{ - sl_log_debug(LOG_TAG, - "Setting expecting CRC16 response for node %d, endpoint %d", - node_id, - endpoint_id); - expecting_crc16_response.emplace_back(std::make_pair(node_id, endpoint_id)); -} - -bool zwave_command_class_crc16_is_expecting_crc16_response( - zwave_node_id_t node_id, zwave_endpoint_id_t endpoint_id) -{ - return find_expecting_crc16_response(node_id, endpoint_id) - != expecting_crc16_response.end(); -} - -/////////////////////////////////////////////////////////////////////////////// -// Incoming commands handler -/////////////////////////////////////////////////////////////////////////////// -static sl_status_t zwave_command_class_crc16_support_handler( - const zwave_controller_connection_info_t *connection_info, - const uint8_t *frame_data, - uint16_t frame_length) -{ - if (frame_length <= COMMAND_INDEX) { - return SL_STATUS_NOT_SUPPORTED; - } - - sl_log_critical(LOG_TAG, "CRC16 Encapsulation command received"); - - switch (frame_data[COMMAND_INDEX]) { - default: - return SL_STATUS_NOT_SUPPORTED; - } -} - -/////////////////////////////////////////////////////////////////////////////// -// Attribute Store callback functions -/////////////////////////////////////////////////////////////////////////////// -static void zwave_command_class_crc16_on_version_attribute_update( - attribute_store_node_t updated_node, attribute_store_change_t change) -{ - if (change == ATTRIBUTE_DELETED) { - return; - } - - // Confirm that we have a version attribute update - assert(ATTRIBUTE(VERSION) == attribute_store_get_node_type(updated_node)); - - attribute_store::attribute version_node(updated_node); - - // Wait for the version - if (!version_node.reported_exists()) { - return; - } - - // Now we know we have a CRC16 supporting endpoint. - attribute_store::attribute endpoint_node - = version_node.first_parent(ATTRIBUTE_ENDPOINT_ID); - - auto disable_crc16_node - = endpoint_node.emplace_node(ATTRIBUTE(DISABLE_CRC16)); - - // By default we enable CRC16 response if supported - if (!disable_crc16_node.reported_exists()) { - disable_crc16_node.set_reported( - CRC16_DISABLED_FLAG_OFF); - } -} - -/////////////////////////////////////////////////////////////////////////////// -// Public interface functions -/////////////////////////////////////////////////////////////////////////////// -sl_status_t zwave_command_class_crc16_init() -{ - // Attribute store callbacks - attribute_store_register_callback_by_type( - zwave_command_class_crc16_on_version_attribute_update, - ATTRIBUTE(VERSION)); - - // The support side of things: Register our handler to the Z-Wave CC framework: - zwave_command_handler_t handler = {}; - // Need to register the support handler to be included in the NIF - handler.support_handler = &zwave_command_class_crc16_support_handler; - handler.control_handler = NULL; - // Not supported, so this does not really matter - handler.minimal_scheme = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; - handler.manual_security_validation = false; - handler.command_class = COMMAND_CLASS_CRC_16_ENCAP; - handler.version = CRC_16_ENCAP_VERSION; - handler.command_class_name = "CRC16 Encapsulation"; - handler.comments = ""; - - zwave_command_handler_register_handler(handler); - - return SL_STATUS_OK; -} - diff --git a/applications/zpc/components/zwave_command_classes/src/zwave_command_class_protocol.c b/applications/zpc/components/zwave_command_classes/src/zwave_command_class_protocol.c new file mode 100644 index 000000000..4f8a64ef7 --- /dev/null +++ b/applications/zpc/components/zwave_command_classes/src/zwave_command_class_protocol.c @@ -0,0 +1,217 @@ +/****************************************************************************** + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ****************************************************************************** + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + *****************************************************************************/ + +// Attribute store helpers +#include "attribute_store_defined_attribute_types.h" +#include "attribute_store_helper.h" + +// Includes from other components +#include "sl_log.h" +#include "attribute_store.h" +#include "attribute_resolver.h" +#include "zwave_unid.h" +#include "ZW_classcmd.h" +#include "zwave_tx.h" +#include "zwave_controller_keyset.h" +#include "zwave_controller_utils.h" +#include "zwave_utils.h" +#include "zwave_command_handler.h" +#include "zwave_command_class_indices.h" +#include "zwapi_protocol_controller.h" +#include "zwave_command_class_protocol.h" +#include "zwave_command_class_supervision.h" +#include "zwave_tx_scheme_selector.h" + +// Generic includes +#include "assert.h" +#include "string.h" + +// Log tag +#define LOG_TAG "zwave_command_class_protocol" + +protocol_metadata_t metadata = {0}; + +static zwave_controller_callbacks_t zwave_command_class_protocol_callbacks = { + .on_protocol_cc_encryption_request = zwave_on_protocol_cc_encryption_request +}; + +static void on_send_protocol_data_callback_received(uint8_t status, const zwapi_tx_report_t *tx_info, void *user) +{ + protocol_metadata_t *metadata = (protocol_metadata_t *)user; + + if (status == TRANSMIT_COMPLETE_FAIL || status == TRANSMIT_COMPLETE_VERIFIED) { + zwave_controller_request_protocol_cc_encryption_callback(status, tx_info, metadata->session_id); + } else { + sl_log_debug(LOG_TAG, "Send Protocol Data callback, status: %d", status); + } +} + +void zwave_on_protocol_cc_encryption_request( + const zwave_node_id_t destination_node_id, + const uint8_t payload_length, + const uint8_t *const payload, + const uint8_t protocol_metadata_length, + const uint8_t *const protocol_metadata, + const uint8_t use_supervision, + const uint8_t session_id) +{ + zwave_controller_connection_info_t connection_info = {0}; + zwave_tx_options_t tx_options = {0}; + uint8_t number_of_expected_responses = 1; + uint32_t discard_timeout_ms = 5000; + // sl_status_t ret = SL_STATUS_OK; + zwave_tx_session_id_t tx_session_id = NULL; + + zwave_tx_scheme_get_node_connection_info(destination_node_id, 0, &connection_info); + zwave_tx_scheme_get_node_tx_options( + ZWAVE_TX_QOS_MAX_PRIORITY, + number_of_expected_responses, + discard_timeout_ms, + &tx_options); + + // Other TX options are set in the transport layer in `S2_send_frame` + tx_options.transport.is_protocol_frame = true; + + metadata.session_id = session_id; + metadata.data_length = protocol_metadata_length; + memcpy(metadata.data, protocol_metadata, protocol_metadata_length); + + if (use_supervision) + { + zwave_command_class_supervision_send_data( + &connection_info, + payload_length, + payload, + &tx_options, + &on_send_protocol_data_callback_received, + (void *)&metadata, + &tx_session_id); + } else { + zwave_tx_send_data( + &connection_info, + payload_length, + payload, + &tx_options, + &on_send_protocol_data_callback_received, + (void *)&metadata, + &tx_session_id); + } +} + +sl_status_t zwave_command_class_protocol_support_handler( + const zwave_controller_connection_info_t *connection, + const uint8_t *frame_data, + uint16_t frame_length) +{ + // Frame too short, it should have not come here. + if (frame_length <= COMMAND_INDEX) { + return SL_STATUS_NOT_SUPPORTED; + } + + sl_log_info(LOG_TAG, "Protocol command received from NodeID %d:%d", + connection->remote.node_id, connection->remote.endpoint_id); + + sl_status_t status = + zwapi_transfer_protocol_cc( + connection->remote.node_id, + zwave_controller_get_key_from_encapsulation(connection->encapsulation), + frame_length, + frame_data); + + switch (status) { + case SL_STATUS_OK: + sl_log_info(LOG_TAG, + "Command from NodeID %d:%d was handled successfully.", + connection->remote.node_id, + connection->remote.endpoint_id); + break; + + case SL_STATUS_FAIL: + sl_log_warning(LOG_TAG, + "Command from NodeID %d:%d had an error during handling. " + "Not all parameters were accepted", + connection->remote.node_id, + connection->remote.endpoint_id); + break; + + case SL_STATUS_BUSY: + // This should not happen, or if it happens, we should be able to return + // an application busy message or similar. + sl_log_warning(LOG_TAG, + "Frame handler is busy and could not handle frame from " + "NodeID %d:%d correctly.", + connection->remote.node_id, + connection->remote.endpoint_id); + break; + + case SL_STATUS_NOT_SUPPORTED: + sl_log_warning( + LOG_TAG, + "Command from NodeID %d:%d got rejected because it is not supported. " + "It was possibly also rejected due to security filtering", + connection->remote.node_id, + connection->remote.endpoint_id); + break; + + default: + sl_log_warning( + LOG_TAG, + "Command from NodeID %d:%d had an unexpected return status: 0x%04X\n", + connection->remote.node_id, + connection->remote.endpoint_id, + status); + break; + } + return status; +} + +sl_status_t zwave_command_class_protocol_init() +{ + zwave_command_handler_t handler_protocol = { 0 }; + handler_protocol.support_handler = &zwave_command_class_protocol_support_handler; + handler_protocol.control_handler = NULL; + handler_protocol.minimal_scheme = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; + handler_protocol.command_class = ZWAVE_CMD_CLASS_PROTOCOL; + handler_protocol.version = 1; + handler_protocol.command_class_name = "Protocol"; + handler_protocol.manual_security_validation = false; + + if(SL_STATUS_OK != zwave_controller_register_callbacks(&zwave_command_class_protocol_callbacks)) + { + sl_log_error(LOG_TAG, "Failed to register callbacks for Protocol Command Class"); + return SL_STATUS_FAIL; + } + + if(SL_STATUS_OK != zwave_command_handler_register_handler(handler_protocol)) + { + sl_log_error(LOG_TAG, "Failed to register Protocol Command Class"); + return SL_STATUS_FAIL; + } + + zwave_command_handler_t handler_protocol_lr = { 0 }; + handler_protocol_lr.support_handler = &zwave_command_class_protocol_support_handler; + handler_protocol_lr.control_handler = NULL; + handler_protocol_lr.minimal_scheme = ZWAVE_CONTROLLER_ENCAPSULATION_NONE; + handler_protocol_lr.command_class = ZWAVE_CMD_CLASS_PROTOCOL_LR; + handler_protocol_lr.version = 1; + handler_protocol_lr.command_class_name = "Protocol LR"; + handler_protocol_lr.manual_security_validation = false; + + if (SL_STATUS_OK != zwave_command_handler_register_handler(handler_protocol_lr)) + { + sl_log_error(LOG_TAG, "Failed to register Protocol Command Class"); + return SL_STATUS_FAIL; + } + + return SL_STATUS_OK; +} \ No newline at end of file diff --git a/applications/zpc/components/zwave_command_classes/src/zwave_command_class_supervision.c b/applications/zpc/components/zwave_command_classes/src/zwave_command_class_supervision.c index c7d716c60..f9ee011bb 100644 --- a/applications/zpc/components/zwave_command_classes/src/zwave_command_class_supervision.c +++ b/applications/zpc/components/zwave_command_classes/src/zwave_command_class_supervision.c @@ -503,10 +503,17 @@ sl_status_t zwave_command_class_supervision_send_data( supervision_tx_options.number_of_responses = tx_options->number_of_responses; supervision_tx_options.number_of_responses += 1; - intptr_t user_parameter = (intptr_t)INVALID_SUPERVISION_ID; - if (connection->remote.is_multicast == false) { - user_parameter = (intptr_t)supervision_id; + intptr_t user_parameter; + if (!tx_options->transport.is_protocol_frame) + { + user_parameter = (intptr_t)INVALID_SUPERVISION_ID; + if (connection->remote.is_multicast == false) { + user_parameter = (intptr_t)supervision_id; + } + } else { + user_parameter = (intptr_t) user; } + sl_status_t zwave_tx_status = zwave_tx_send_data( connection, supervision_frame_size, diff --git a/applications/zpc/components/zwave_command_classes/src/zwave_command_classes_fixt.c b/applications/zpc/components/zwave_command_classes/src/zwave_command_classes_fixt.c index 32d1c1522..812209cf4 100644 --- a/applications/zpc/components/zwave_command_classes/src/zwave_command_classes_fixt.c +++ b/applications/zpc/components/zwave_command_classes/src/zwave_command_classes_fixt.c @@ -20,7 +20,6 @@ #include "zwave_command_class_binary_switch.h" #include "zwave_command_class_central_scene.h" #include "zwave_command_class_configuration.h" -#include "zwave_command_class_crc16.h" #include "zwave_command_class_granted_keys_resolver.h" #include "zwave_command_class_indicator.h" #include "zwave_command_class_manufacturer_specific.h" @@ -59,6 +58,7 @@ #include "zwave_command_class_indicator_control.h" #include "zwave_command_class_manufacturer_specific_control.h" #include "zwave_command_class_humidity_control_mode.h" +#include "zwave_command_class_protocol.h" // Generic includes #include @@ -94,7 +94,6 @@ sl_status_t zwave_command_classes_init() status |= zwave_command_class_battery_init(); status |= zwave_command_class_binary_switch_init(); status |= zwave_command_class_central_scene_init(); - status |= zwave_command_class_crc16_init(); status |= zwave_command_class_configuration_init(); status |= zwave_command_class_device_reset_locally_init(); status |= zwave_command_class_humidity_control_mode_init(); @@ -129,6 +128,7 @@ sl_status_t zwave_command_classes_init() status |= zwave_command_class_version_init(); status |= zwave_command_class_wake_up_init(); status |= zwave_command_class_zwave_plus_info_init(); + status |= zwave_command_class_protocol_init(); // Auto-generated handlers with overrides status |= zwave_command_class_indicator_control_init(); diff --git a/applications/zpc/components/zwave_command_classes/test/CMakeLists.txt b/applications/zpc/components/zwave_command_classes/test/CMakeLists.txt index 63b79e147..661ff4a84 100644 --- a/applications/zpc/components/zwave_command_classes/test/CMakeLists.txt +++ b/applications/zpc/components/zwave_command_classes/test/CMakeLists.txt @@ -54,8 +54,10 @@ target_add_unittest( zwave_command_class_time_parameters_test.c DEPENDS zwave_command_class_test_helpers - ${MOCK_LIBS}) -if(${BUILD_TESTING_PROPERTY_DISABLED}) + ${MOCK_LIBS} +) +if(${ZPC_BUILD_TESTING_PROPERTY_DISABLED}) + message(WARNING "Please fix this test") set_tests_properties(zwave_command_class_time_parameters_test PROPERTIES DISABLED True) endif() @@ -436,12 +438,13 @@ target_add_unittest( zwave_tx_mock uic_dotdot_mqtt_mock ) -if(${BUILD_TESTING_PROPERTY_DISABLED}) +if(${ZPC_BUILD_TESTING_PROPERTY_DISABLED}) + message(WARNING "Please fix this test") set_tests_properties(zwave_command_class_switch_multilevel_test PROPERTIES DISABLED True ) endif() - + # Z-Wave Color Switch Command Class test target_add_unittest( zwave_command_classes @@ -817,13 +820,13 @@ target_add_unittest( uic_attribute_resolver_mock zpc_attribute_resolver_mock ) -if(${BUILD_TESTING_PROPERTY_DISABLED}) +if(${ZPC_BUILD_TESTING_PROPERTY_DISABLED}) + message(WARNING "Please fix this test") set_tests_properties(zwave_command_class_user_code_test PROPERTIES DISABLED True ) endif() - # Humidity Control Mode test target_add_unittest( zwave_command_classes @@ -854,33 +857,32 @@ target_add_unittest( zpc_attribute_resolver_mock uic_dotdot_mqtt_mock) -# Humidity Control SetPoint test -target_add_unittest( - zwave_command_classes - NAME - zwave_command_class_humidity_control_setpoint_test - SOURCES - zwave_command_class_humidity_control_setpoint_test.cpp - DEPENDS - zpc_attribute_store_test_helper - zwave_controller - zwave_command_handler_mock - uic_attribute_resolver_mock - zpc_attribute_resolver_mock - uic_dotdot_mqtt_mock) + # Humidity Control SetPoint test + target_add_unittest( + zwave_command_classes + NAME + zwave_command_class_humidity_control_setpoint_test + SOURCES + zwave_command_class_humidity_control_setpoint_test.cpp + DEPENDS + zpc_attribute_store_test_helper + zwave_controller + zwave_command_handler_mock + uic_attribute_resolver_mock + zpc_attribute_resolver_mock + uic_dotdot_mqtt_mock) -# Humidity Control SetPoint test target_add_unittest( zwave_command_classes NAME - zwave_command_class_crc16_test + zwave_command_class_protocol_test SOURCES - zwave_command_class_crc16_test.cpp + zwave_command_class_protocol_test.c DEPENDS - zpc_attribute_store_test_helper zwave_command_class_test_helpers - zwave_controller + zwave_controller_mock zwave_command_handler_mock - uic_attribute_resolver_mock - zpc_attribute_resolver_mock - uic_dotdot_mqtt_mock) + zwave_api_mock + zwave_tx_mock + zwave_tx_scheme_selector_mock +) diff --git a/applications/zpc/components/zwave_command_classes/test/zwave_command_class_crc16_test.cpp b/applications/zpc/components/zwave_command_classes/test/zwave_command_class_crc16_test.cpp deleted file mode 100644 index 55c349abd..000000000 --- a/applications/zpc/components/zwave_command_classes/test/zwave_command_class_crc16_test.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/****************************************************************************** - * # License - * Copyright 2024 Silicon Laboratories Inc. www.silabs.com - ****************************************************************************** - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - *****************************************************************************/ -// Base class -#include "zwave_command_class_crc16.h" -#include "zwave_command_classes_utils.h" -#include "unity.h" - -// Generic includes -#include - -// Unify -#include "datastore.h" -#include "attribute_store.h" -#include "attribute_store_fixt.h" -// Interface includes -#include "ZW_classcmd.h" -#include "zap-types.h" - -// ZPC includes -#include "attribute_store_defined_attribute_types.h" -#include "zpc_attribute_store_type_registration.h" - -// Test helpers -#include "zwave_command_class_test_helper.hpp" - - -// Attribute macro, shortening those long defines for attribute types: -#define ATTRIBUTE(type) ATTRIBUTE_COMMAND_CLASS_CRC16_##type - - -using namespace zwave_command_class_test_helper; - -extern "C" { - -/// Setup the test suite (called once before all test_xxx functions are called) -void suiteSetUp() -{ - datastore_init(":memory:"); - attribute_store_init(); - zpc_attribute_store_register_known_attribute_types(); -} - -/// Teardown the test suite (called once after all test_xxx functions are called) -int suiteTearDown(int num_failures) -{ - attribute_store_teardown(); - datastore_teardown(); - return num_failures; -} - -// Tested command class handler -const zwave_struct_handler_args command_class_handler - = {.command_class_id = COMMAND_CLASS_CRC_16_ENCAP, - .supported_version = CRC_16_ENCAP_VERSION, - .scheme = ZWAVE_CONTROLLER_ENCAPSULATION_NONE, - .has_control_handler = false, - .has_support_handler = true}; - -/// Called before each and every test -void setUp() -{ - zwave_setUp(command_class_handler, - &zwave_command_class_crc16_init); -} - -void helper_set_network_status(NodeStateNetworkStatus status) -{ - cpp_endpoint_id_node.parent() - .emplace_node(DOTDOT_ATTRIBUTE_ID_STATE_NETWORK_STATUS) - .set_reported(status); -} - -void test_attribute_initialized_happy_case() -{ - helper_set_version(1); - - // Set the network status to online - helper_set_network_status(ZCL_NODE_STATE_NETWORK_STATUS_ONLINE_FUNCTIONAL); - - // Test that the attribute is initialized - auto disable_crc16_node = helper_test_and_get_node(ATTRIBUTE(DISABLE_CRC16)); - TEST_ASSERT_EQUAL_MESSAGE(0x00, - disable_crc16_node.reported(), - "DISABLE_CRC16 flag should be set to off"); - - TEST_ASSERT_EQUAL_MESSAGE( - true, - zwave_command_class_crc16_is_supported(endpoint_id_node), - "CRC16 should be marked as supported"); - - // Set disabled to true - disable_crc16_node.set_reported(0x01); - - TEST_ASSERT_EQUAL_MESSAGE( - false, - zwave_command_class_crc16_is_supported(endpoint_id_node), - "CRC16 should be marked as supported"); -} - -void test_zwave_command_class_crc16_is_supported_interview() -{ - helper_set_version(1); - - // Set the network status to online - helper_set_network_status(ZCL_NODE_STATE_NETWORK_STATUS_ONLINE_INTERVIEWING); - - // Test that the attribute is initialized - auto disable_crc16_node = helper_test_and_get_node(ATTRIBUTE(DISABLE_CRC16)); - TEST_ASSERT_EQUAL_MESSAGE(0x00, - disable_crc16_node.reported(), - "DISABLE_CRC16 flag should be set to off"); - - TEST_ASSERT_EQUAL_MESSAGE( - false, - zwave_command_class_crc16_is_supported(endpoint_id_node), - "CRC16 should be marked as NOT supported since we are interviewing"); - - helper_set_network_status(ZCL_NODE_STATE_NETWORK_STATUS_ONLINE_FUNCTIONAL); - - TEST_ASSERT_EQUAL_MESSAGE( - true, - zwave_command_class_crc16_is_supported(endpoint_id_node), - "CRC16 should be marked as supported since we are done with the interview"); -} - -void test_zwave_command_class_crc16_expect_crc16_response_once_happy_case() -{ - TEST_ASSERT_EQUAL_MESSAGE( - false, - zwave_command_class_crc16_is_expecting_crc16_response(node_id, endpoint_id), - "Current endpoint should not be marked as expecting a response"); - - zwave_command_class_crc16_set_expect_crc16_response(node_id, endpoint_id); - - TEST_ASSERT_EQUAL_MESSAGE( - true, - zwave_command_class_crc16_is_expecting_crc16_response(node_id, endpoint_id), - "Current endpoint should be marked as expecting a response"); - - zwave_command_class_crc16_clear_expect_crc16_response(node_id, endpoint_id); - - TEST_ASSERT_EQUAL_MESSAGE( - false, - zwave_command_class_crc16_is_expecting_crc16_response(node_id, endpoint_id), - "Current endpoint should not be marked as expecting a response since it " - "should be cleared"); -} - -void test_zwave_command_class_crc16_expect_crc16_response_stacked_happy_case() -{ - constexpr int MAX_RESPONSES = 12; - // test if we can set the flag multiple times - for (int i = 0; i < MAX_RESPONSES; i++) { - zwave_command_class_crc16_set_expect_crc16_response(node_id, endpoint_id); - } - // test if we can set the flag to another response - zwave_command_class_crc16_set_expect_crc16_response(node_id, endpoint_id + 1); - - TEST_ASSERT_EQUAL_MESSAGE( - true, - zwave_command_class_crc16_is_expecting_crc16_response(node_id, endpoint_id), - "Current endpoint should be marked as expecting a response"); - - // Clear 1 response - zwave_command_class_crc16_clear_expect_crc16_response(node_id, endpoint_id); - - TEST_ASSERT_EQUAL_MESSAGE( - true, - zwave_command_class_crc16_is_expecting_crc16_response(node_id, endpoint_id), - "Current endpoint should be marked as expecting a response since it " - "still have responses to send"); - - // Test if we can clear all the responses - // Also test if we can clear more than the number of responses - for (int i = 0; i < MAX_RESPONSES; i++) { - zwave_command_class_crc16_clear_expect_crc16_response(node_id, endpoint_id); - } - - TEST_ASSERT_EQUAL_MESSAGE( - false, - zwave_command_class_crc16_is_expecting_crc16_response(node_id, endpoint_id), - "Current endpoint should NOT be marked as expecting a response since it " - "should be all cleared"); - - // Test other frame - TEST_ASSERT_EQUAL_MESSAGE( - true, - zwave_command_class_crc16_is_expecting_crc16_response(node_id, - endpoint_id + 1), - "Other endpoint should be marked as expecting a response since it " - "still have responses to send"); - - zwave_command_class_crc16_clear_expect_crc16_response(node_id, - endpoint_id + 1); - - TEST_ASSERT_EQUAL_MESSAGE( - false, - zwave_command_class_crc16_is_expecting_crc16_response(node_id, - endpoint_id + 1), - "Other endpoint should NOT be marked as expecting a response since it " - "should be cleared"); -} - -} // extern "C" diff --git a/applications/zpc/components/zwave_command_classes/test/zwave_command_class_protocol_test.c b/applications/zpc/components/zwave_command_classes/test/zwave_command_class_protocol_test.c new file mode 100644 index 000000000..fcdaf3388 --- /dev/null +++ b/applications/zpc/components/zwave_command_classes/test/zwave_command_class_protocol_test.c @@ -0,0 +1,220 @@ +/****************************************************************************** + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ****************************************************************************** + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + *****************************************************************************/ + +// Generic includes +#include + +// Test includes +#include "unity.h" + +// Interface includes +#include "attribute_store_defined_attribute_types.h" +#include "zwave_command_class_wake_up_types.h" +#include "ZW_classcmd.h" +#include "zwave_command_class_protocol.h" +#include "zwave_controller_utils.h" + +// Includes from other components +#include "sl_log.h" +#include "zwave_controller_connection_info.h" +#include "zwave_tx_groups.h" + +// Mock includes +#include "zwave_command_handler_mock.h" +#include "zwave_tx_scheme_selector_mock.h" +#include "attribute_store_mock.h" +#include "attribute_store_helper_mock.h" +#include "attribute_resolver_mock.h" +#include "zwapi_protocol_controller_mock.h" +#include "zwave_controller_keyset_mock.h" +#include "zwave_tx_mock.h" +#include "zwave_controller_callbacks_mock.h" + +#define LOG_TAG "zwave_command_class_protocol_test" + +static zwave_command_handler_t protocol_handler = {}; + +static sl_status_t zwave_command_handler_register_handler_stub( + zwave_command_handler_t new_command_class_handler, int cmock_num_calls) +{ + protocol_handler = new_command_class_handler; + + TEST_ASSERT_EQUAL(ZWAVE_CONTROLLER_ENCAPSULATION_NONE, + protocol_handler.minimal_scheme); + TEST_ASSERT_TRUE(ZWAVE_CMD_CLASS_PROTOCOL ==protocol_handler.command_class + || ZWAVE_CMD_CLASS_PROTOCOL_LR == protocol_handler.command_class); + TEST_ASSERT_EQUAL(1, protocol_handler.version); + TEST_ASSERT_NULL(protocol_handler.control_handler); + TEST_ASSERT_NOT_NULL(protocol_handler.support_handler); + TEST_ASSERT_FALSE(protocol_handler.manual_security_validation); + + return SL_STATUS_OK; +} + +static sl_status_t zwave_controller_register_callback_stub( + const zwave_controller_callbacks_t *callback, int cmock_num_calls) +{ + TEST_ASSERT_NOT_NULL(callback); + TEST_ASSERT_NOT_NULL(callback->on_protocol_cc_encryption_request); + + return SL_STATUS_OK; +} + +void suiteSetUp() {} + +int suiteTearDown(int num_failures) +{ + return num_failures; +} + +void setUp() +{ + // Handler registration + zwave_command_handler_register_handler_Stub( + &zwave_command_handler_register_handler_stub); + + zwave_controller_register_callbacks_Stub( + &zwave_controller_register_callback_stub); + + zwave_command_class_protocol_init(); +} + +void tearDown() {} + +void test_zwave_command_class_protocol_init() +{ + // Call the function + TEST_ASSERT_EQUAL(SL_STATUS_OK, zwave_command_class_protocol_init()); +} + +void test_zwave_command_class_protocol_handler(void) +{ + uint8_t test_frame_data[5] = { 0}; + + test_frame_data[0] = ZWAVE_CMD_CLASS_PROTOCOL; + + zwave_controller_connection_info_t connection = { 0 }; + connection.encapsulation = ZWAVE_CONTROLLER_ENCAPSULATION_SECURITY_2_AUTHENTICATED; + connection.remote.node_id = 2; + connection.local.node_id = 1; + + // Test with wrong command length + TEST_ASSERT_EQUAL( + SL_STATUS_NOT_SUPPORTED, + protocol_handler.support_handler(&connection, + test_frame_data, + 1)); // wrong length + + // Test with correct length + zwave_controller_get_key_from_encapsulation_ExpectAndReturn(ZWAVE_CONTROLLER_ENCAPSULATION_SECURITY_2_AUTHENTICATED, ZWAVE_CONTROLLER_S2_AUTHENTICATED_KEY); + + zwapi_transfer_protocol_cc_ExpectAndReturn(2, + ZWAVE_CONTROLLER_S2_AUTHENTICATED_KEY, + 5, + (uint8_t*) &test_frame_data, + SL_STATUS_OK); + + TEST_ASSERT_EQUAL( + SL_STATUS_OK, + protocol_handler.support_handler(&connection, + test_frame_data, + sizeof(test_frame_data))); +} + +void test_zwave_s2_on_protocol_cc_encryption_request_happy_case() +{ + zwave_node_id_t destination_node_id = 2; + uint8_t payload[] = {0x01, 0x02, 0x03}; + uint8_t payload_length = sizeof(payload) / sizeof(payload[0]); + uint8_t protocol_metadata[] = {0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7}; + uint8_t protocol_metadata_length = sizeof(protocol_metadata) / sizeof(protocol_metadata[0]); + uint8_t use_supervision = 0; + uint8_t session_id = 1; + zwave_controller_connection_info_t connection_info = {0}; + zwave_tx_options_t tx_options = {0}; + zwave_tx_session_id_t tx_session_id = NULL; + protocol_metadata_t metadata = {0}; + + // Expected TX options + tx_options.transport.is_protocol_frame = true; + + // Expected protocol metadata + metadata.session_id = session_id; + metadata.data_length = protocol_metadata_length; + memcpy(metadata.data, protocol_metadata, protocol_metadata_length); + + zwave_tx_scheme_get_node_connection_info_Expect(destination_node_id, 0, NULL); + zwave_tx_scheme_get_node_connection_info_IgnoreArg_connection_info(); + zwave_tx_scheme_get_node_tx_options_Expect(ZWAVE_TX_QOS_MAX_PRIORITY, 1, 5000, NULL); + zwave_tx_scheme_get_node_tx_options_IgnoreArg_tx_options(); + + zwave_tx_send_data_ExpectWithArrayAndReturn(&connection_info, + sizeof(connection_info), + payload_length, + payload, + sizeof(payload), + &tx_options, + sizeof(tx_options), + NULL, + (void *)&metadata, + sizeof(protocol_metadata_t), + &tx_session_id, + sizeof(zwave_tx_session_id_t), + SL_STATUS_OK); + zwave_tx_send_data_IgnoreArg_on_send_complete(); + + zwave_on_protocol_cc_encryption_request(destination_node_id, + payload_length, + payload, + protocol_metadata_length, + protocol_metadata, + use_supervision, + session_id); + + // Test with supervision + use_supervision = 1; + + zwave_tx_scheme_get_node_connection_info_Expect(destination_node_id, 0, NULL); + zwave_tx_scheme_get_node_connection_info_IgnoreArg_connection_info(); + zwave_tx_scheme_get_node_tx_options_Expect(ZWAVE_TX_QOS_MAX_PRIORITY, 1, 5000, NULL); + zwave_tx_scheme_get_node_tx_options_IgnoreArg_tx_options(); + + uint16_t supervision_frame_size = 4 + payload_length; // sizeof(frame) - SUPERVISION_ENCAPSULATED_COMMAND_MAXIMUM_SIZE + tx_options.number_of_responses += 1; // supervision get expects 1 frame in response + + zwave_tx_send_data_ExpectWithArrayAndReturn(&connection_info, + sizeof(connection_info), + supervision_frame_size, + payload, + sizeof(payload), + &tx_options, + sizeof(tx_options), + NULL, + (void *)&metadata, + sizeof(protocol_metadata_t), + &tx_session_id, + sizeof(zwave_tx_session_id_t), + SL_STATUS_OK); + zwave_tx_send_data_IgnoreArg_on_send_complete(); + zwave_tx_send_data_IgnoreArg_data(); + zwave_tx_send_data_IgnoreArg_user(); + + zwave_on_protocol_cc_encryption_request(destination_node_id, + payload_length, + payload, + protocol_metadata_length, + protocol_metadata, + use_supervision, + session_id); +} + diff --git a/applications/zpc/components/zwave_command_classes/test/zwave_command_class_time_parameters_test.c b/applications/zpc/components/zwave_command_classes/test/zwave_command_class_time_parameters_test.c index 40d722f53..18a8690c7 100644 --- a/applications/zpc/components/zwave_command_classes/test/zwave_command_class_time_parameters_test.c +++ b/applications/zpc/components/zwave_command_classes/test/zwave_command_class_time_parameters_test.c @@ -11,6 +11,7 @@ * *****************************************************************************/ +#include #include #include #include @@ -48,7 +49,9 @@ struct tm test_time_info = {.tm_year = TEST_YEAR - 1900, .tm_isdst = -1}; /// Setup the test suite (called once before all test_xxx functions are called) -void suiteSetUp() {} +void suiteSetUp() { + setenv("TZ", "UTC", 1); +} /// Teardown the test suite (called once after all test_xxx functions are called) int suiteTearDown(int num_failures) diff --git a/applications/zpc/components/zwave_command_handler/scripts/extract_get.py b/applications/zpc/components/zwave_command_handler/scripts/extract_get.py index 72a6cbc93..c96acd2be 100755 --- a/applications/zpc/components/zwave_command_handler/scripts/extract_get.py +++ b/applications/zpc/components/zwave_command_handler/scripts/extract_get.py @@ -2,10 +2,9 @@ # Copyright (c) 2014 Silicon Laboratories Inc. -from __future__ import print_function -import xml.dom.minidom import sys -import os.path + +from defusedxml import minidom gets = [] sets = [] @@ -14,10 +13,8 @@ if __name__ == '__main__': - if(sys.argv[1] == '-'): - x = xml.dom.minidom.parse(sys.stdin) - else: - x = xml.dom.minidom.parse(sys.argv[1]) + file = sys.stdin if sys.argv[1] == '-' else sys.argv[1] + x = minidom.parse(file, forbid_dtd=True) classes = dict() diff --git a/applications/zpc/components/zwave_command_handler/src/zwave_command_handler.cpp b/applications/zpc/components/zwave_command_handler/src/zwave_command_handler.cpp index 1717c1c04..a5abeb33b 100644 --- a/applications/zpc/components/zwave_command_handler/src/zwave_command_handler.cpp +++ b/applications/zpc/components/zwave_command_handler/src/zwave_command_handler.cpp @@ -53,7 +53,7 @@ std::multiset static zwave_controller_callbacks_t zwave_command_handler_callbacks = { .on_new_network_entered = zwave_command_handler_on_new_network_entered, .on_application_frame_received = zwave_command_handler_on_frame_received, - .on_protocol_frame_received = zwave_command_handler_on_protocol_frame_received + .on_protocol_frame_received = zwave_command_handler_on_protocol_frame_received, }; /////////////////////////////////////////////////////////////////////////////// @@ -157,7 +157,8 @@ sl_status_t zwave_command_handler_init(void) zwave_network_management_get_home_id(), zwave_network_management_get_node_id(), my_granted_keys, - kex_fail); + kex_fail, + PROTOCOL_ZWAVE); // Register on_frame_received and on_new_network_entered callbacks zwave_controller_register_callbacks(&zwave_command_handler_callbacks); diff --git a/applications/zpc/components/zwave_command_handler/src/zwave_command_handler_callbacks.cpp b/applications/zpc/components/zwave_command_handler/src/zwave_command_handler_callbacks.cpp index 995e94660..e193dbc22 100644 --- a/applications/zpc/components/zwave_command_handler/src/zwave_command_handler_callbacks.cpp +++ b/applications/zpc/components/zwave_command_handler/src/zwave_command_handler_callbacks.cpp @@ -125,7 +125,8 @@ void zwave_command_handler_on_new_network_entered( zwave_home_id_t home_id, zwave_node_id_t node_id, zwave_keyset_t granted_keys, - zwave_kex_fail_type_t kex_fail_type) + zwave_kex_fail_type_t kex_fail_type, + zwave_protocol_t inclusion_protocol) { sl_log_debug(LOG_TAG, "Setting NIF for HomeID: %08X NodeID: %03u\n", diff --git a/applications/zpc/components/zwave_command_handler/src/zwave_command_handler_callbacks.h b/applications/zpc/components/zwave_command_handler/src/zwave_command_handler_callbacks.h index 43f679459..66f550d82 100644 --- a/applications/zpc/components/zwave_command_handler/src/zwave_command_handler_callbacks.h +++ b/applications/zpc/components/zwave_command_handler/src/zwave_command_handler_callbacks.h @@ -41,7 +41,8 @@ void zwave_command_handler_on_new_network_entered( zwave_home_id_t home_id, zwave_node_id_t node_id, zwave_keyset_t granted_keys, - zwave_kex_fail_type_t kex_fail_type); + zwave_kex_fail_type_t kex_fail_type, + zwave_protocol_t inclusion_protocol); /** * Callback for receiving an application Z-Wave frame. diff --git a/applications/zpc/components/zwave_command_handler/test/zwave_command_handler_test.c b/applications/zpc/components/zwave_command_handler/test/zwave_command_handler_test.c index e95dd6a3d..5427cd17e 100644 --- a/applications/zpc/components/zwave_command_handler/test/zwave_command_handler_test.c +++ b/applications/zpc/components/zwave_command_handler/test/zwave_command_handler_test.c @@ -230,6 +230,7 @@ void test_entering_a_new_network() zwave_home_id_t home_id = 0x12345678; zwave_node_id_t node_id = 0x12; zwave_kex_fail_type_t kex_fail_type = 0x00; + zwave_protocol_t protocol = PROTOCOL_ZWAVE; // When entering a new network, we expect the NIF to get set. zwave_controller_get_highest_encapsulation_ExpectAndReturn( @@ -251,7 +252,8 @@ void test_entering_a_new_network() zwave_controller_callbacks->on_new_network_entered(home_id, node_id, our_granted_keys, - kex_fail_type); + kex_fail_type, + protocol); // No frame should have been received here. TEST_ASSERT_EQUAL_UINT8(0, cc_zwave_plus_handle_counter); diff --git a/applications/zpc/doc/supported_command_classes.rst b/applications/zpc/doc/supported_command_classes.rst index c980153b7..ed651e4e0 100644 --- a/applications/zpc/doc/supported_command_classes.rst +++ b/applications/zpc/doc/supported_command_classes.rst @@ -21,47 +21,52 @@ When starting ZPC from the command line, it will also display all the current su .. code-block:: bash $ zpc - | Command Class | Version | Support | Control | Security Level | Comment | - | ---------------------------------- | ------- | ------- | ------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | Alarm Sensor | 1 | | x | N/A | | - | Association | 2 | x | x | Network Scheme | | - | Association Group Info (AGI) | 3 | x | x | Network Scheme | | - | Barrier Operator | 1 | | x | N/A | | - | Basic | 2 | | x | N/A | | - | Battery | 3 | | x | N/A | Control Part is auto-generated. | - | Binary Sensor | 1 | | x | N/A | Control Part is auto-generated. | - | Binary Switch | 2 | | x | N/A | | - | Central Scene | 3 | | x | N/A | Partial control: key attributes are not displayed in the UI. | - | Color Switch | 3 | | x | N/A | Partial Control:
1. Durations are ignored
2. No support for Start/Stop Level Change
3. No support for other Color Component IDs than 0,1,2,3,4 | - | Configuration | 4 | | x | N/A | | - | Device Reset Locally | 1 | x | x | Network Scheme | | - | Door Lock | 4 | | x | N/A | | - | Firmware Update | 7 | x | x | Network Scheme | | - | Inclusion Controller | 1 | x | x | Unencrypted | | - | Indicator | 3 | x | x | Network Scheme | | - | Manufacturer Specific | 2 | x | x | Network Scheme | | - | Meter | 6 | | x | N/A | Partial control:
1. Meter Reset Command is not supported due to missing dotdot ZCL equivalent functionality. | - | Multi Channel | 4 | | x | N/A | | - | Multi Channel Association | 3 | x | x | Network Scheme | | - | Multi Command | 1 | x | | Unencrypted | | - | Multilevel Sensor | 11 | | x | N/A | Partial control:
1. Not all scales are supported
2. Not all types are shown in the UI. | - | Multilevel Switch | 4 | | x | N/A | | - | Notification | 8 | | x | N/A | Partial Control:
1. No Push/Pull discovery is done.
2. No Pull sensor support.
3. Unknown types are not supported.
4. No Regular probing is done. | - | Powerlevel | 1 | x | | Network Scheme | | - | Scene Activation | 1 | | x | N/A | | - | Scene Actuator Configuration | 1 | | x | N/A | No interview performed automatically. | - | Scene Controller Configuration | 1 | | x | N/A | | - | Security 0 | 1 | x | x | Unencrypted | | - | Security 2 | 1 | x | x | Unencrypted | | - | Sound Switch | 2 | | x | N/A | You can control the specific tone play with the ON_OFF_ON_TIME ZCL attribute. See code or python CTT script for details. | - | Supervision | 2 | x | x | Unencrypted | | - | Thermostat Mode | 3 | | x | N/A | Partial Control: Not all modes can be set | - | Thermostat Setpoint | 3 | | x | N/A | Partial Control:
1. No discovery of ambiguous types in v1-v2
2. Only a few setpoints can be configured.
3. Precision/size fields in the set are determined
automatically by the controller. | - | Time | 1 | x | | Unencrypted | | - | Transport Service | 2 | x | x | Unencrypted | | - | User Code | 2 | | x | N/A | Partial Control | - | User Credential | 1 | | x | N/A | Experimental | - | Version | 3 | x | x | Network Scheme | | - | Wake Up | 3 | | x | N/A | | - | Z-Wave Plus Info | 2 | x | x | Unencrypted | | + Command Class | Version | Support | Control | Security Level | Comment | + | ------------------------------ | ------- | ------- | ------- | --------------------------- | ------- | + | Alarm Sensor | 1 | | x | N/A | | + | Association | 2 | x | x | Network Scheme | | + | Association Group Info (AGI) | 3 | x | x | Network Scheme | | + | Barrier Operator | 1 | | x | N/A | | + | Basic | 2 | | x | N/A | | + | Battery | 3 | | x | N/A | | + | Binary Sensor | 1 | | x | N/A | Control Part is auto-generated. | + | Binary Switch | 2 | | x | N/A | | + | CRC16 Encapsulation | 1 | x | | Unencrypted | | + | Central Scene | 3 | | x | N/A | Partial control: key attributes are not displayed in the UI. | + | Color Switch | 3 | | x | N/A | Partial Control:
1. Durations are ignored
2. No support for Start/Stop Level Change
3. No support for other Color Component IDs than 0,1,2,3,4 | + | Configuration | 4 | | x | N/A | | + | Device Reset Locally | 1 | x | x | Network Scheme | | + | Door Lock | 4 | | x | N/A | | + | Firmware Update | 7 | x | x | Network Scheme | | + | Humidity Control Mode | 2 | | x | N/A | Experimental | + | Inclusion Controller | 1 | x | x | Unencrypted | | + | Indicator | 3 | x | x | Network Scheme | | + | Manufacturer Specific | 2 | x | x | Network Scheme | | + | Meter | 6 | | x | N/A | Partial control:
1. Meter Reset Command is not supported due to missing dotdot ZCL equivalent functionality. | + | Multi Channel | 4 | | x | N/A | | + | Multi Channel Association | 3 | x | x | Network Scheme | | + | Multi Command | 1 | x | | Unencrypted | | + | Multilevel Sensor | 11 | | x | N/A | Partial control:
1. Not all scales are supported
2. Not all types are shown in the UI. | + | Multilevel Switch | 4 | | x | N/A | | + | Notification | 8 | | x | N/A | | + | Powerlevel | 1 | x | | Network Scheme | | + | Scene Activation | 1 | | x | N/A | | + | Scene Actuator Configuration | 1 | | x | N/A | No interview performed automatically. | + | Scene Controller Configuration | 1 | | x | N/A | | + | Security 0 | 1 | x | x | Unencrypted | | + | Security 2 | 1 | x | x | Unencrypted | | + | Sound Switch | 2 | | x | N/A | You can control the specific tone play with the ON_OFF_ON_TIME ZCL attribute. See code or python CTT script for details. | + | Supervision | 2 | x | x | Unencrypted | | + | Thermostat Fan Mode | 5 | | x | N/A | Experimental | + | Thermostat Fan State | 2 | | x | N/A | Experimental | + | Thermostat Mode | 3 | | x | N/A | Partial Control: Not all modes can be set | + | Thermostat Operating State | 2 | | x | N/A | Experimental. Log related functions are not yet exposed to MQTT. | + | Thermostat Setpoint | 3 | | x | N/A | Only Cool & Heat setpoint can be controlled from MQTT | + | Time | 1 | x | | Unencrypted | | + | Time Parameters | 1 | x | | Unencrypted | | + | Transport Service | 2 | x | x | Unencrypted | | + | User Code | 2 | | x | N/A | Partial Control | + | Version | 3 | x | x | Network Scheme | | + | Wake Up | 3 | | x | N/A | | + | Z-Wave Plus Info | 2 | x | x | Unencrypted | | diff --git a/applications/zpc/main.c b/applications/zpc/main.c index 0c41e3e75..8ce055310 100644 --- a/applications/zpc/main.c +++ b/applications/zpc/main.c @@ -204,6 +204,7 @@ static uic_fixt_shutdown_step_t uic_fixt_shutdown_steps_list[] {&dotdot_mapper_teardown, "DotDot mapper"}, {NULL, "Terminator"}}; + int main(int argc, char **argv) { attribute_mapper_config_init(); //TODO how do we want to do this diff --git a/applications/zpc/testlib.c b/applications/zpc/testlib.c new file mode 100644 index 000000000..5d60f6900 --- /dev/null +++ b/applications/zpc/testlib.c @@ -0,0 +1,145 @@ +/****************************************************************************** + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ****************************************************************************** + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + *****************************************************************************/ +#include +#include + +#include "sl_log.h" +#include "uic_main.h" +#include "uic_main_externals.h" +#include "zwave_controller.h" +#include "zwave_network_management_fixt.h" +#include "zwave_rx_fixt.h" +#include "zwave_s2_fixt.h" +#include "zwave_tx_fixt.h" +#include "zwave_transports_fixt.h" +#include "process.h" + + +typedef void (*blocked_cb_t)(void); + +static int pipefd[2]; + +PROCESS(block_process, "Block process"); + +void testlib_block(blocked_cb_t cb) +{ + const int result __attribute__((unused)) = write(pipefd[1], &cb, sizeof(cb)); +} + +void block_poll() +{ + blocked_cb_t cb; + const int result __attribute__((unused)) = read(pipefd[0], &cb, sizeof(cb)); + if (cb) + cb(); +} + +PROCESS_THREAD(block_process, ev, data) +{ + (void)(data); + PROCESS_POLLHANDLER(block_poll()); + + PROCESS_BEGIN(); + + while (1) { + PROCESS_WAIT_EVENT(); + } + + PROCESS_END(); +} + +typedef uint32_t (*get_tick_t)(void); +get_tick_t get_tick_fcn; + +void testlib_set_emulated_tick_mode(get_tick_t get_tick) +{ + get_tick_fcn = get_tick; +} + +typedef void (*post_init_cb_t)(void); + +static post_init_cb_t post_init_cb; + +void testlib_register_post_init_cb(post_init_cb_t cb) +{ + post_init_cb = cb; +} + +sl_status_t post_init(void) +{ + const int result __attribute__((unused)) = pipe(pipefd); + uic_main_ext_register_rfd(pipefd[0], NULL, &block_process); + + process_start(&block_process, NULL); + + if (post_init_cb) + post_init_cb(); + + return SL_STATUS_OK; +} + +static uic_fixt_setup_step_t uic_fixt_setup_steps_list[] = { + /* The Z-Wave API depends on the configuration component. */ + {&zwave_rx_fixt_setup, "Z-Wave RX"}, + /** Start Z-Wave TX */ + {&zwave_tx_fixt_setup, "Z-Wave TX"}, + /** Let the Network management initialize its state machine + and cache our NodeID/ HomeID from the Z-Wave API */ + {&zwave_network_management_fixt_setup, "Z-Wave Network Management"}, + /** Start Z-Wave S2 */ + {&zwave_s2_fixt_setup, "Z-Wave S2"}, + /** Initializes all Z-Wave transports */ + {&zwave_transports_init, "Z-Wave Transports"}, + {&post_init, "post_init"}, + {NULL, "Terminator"}}; + +/** Final tear-down steps. + * + * @ingroup uic_fixt_int + * + * Functions to take down components and free allocated resources. The + * function are executed in order, after all contiki processes have + * been stopped. + */ +static uic_fixt_shutdown_step_t uic_fixt_shutdown_steps_list[] + = {{&zwave_network_management_fixt_teardown, "Z-Wave Network Management"}, + {&zwave_rx_fixt_teardown, "Z-Wave RX"}, + {NULL, "Terminator"}}; + +int main(int argc, char **argv) +{ + const zwave_rx_config_t rx_config = { + .serial_port = argv[1], + .serial_log_file = argv[2], + .zwave_rf_region = argv[4], + .zwave_normal_tx_power_dbm = 0, + .zwave_measured_0dbm_power = 0, + .zwave_max_lr_tx_power_dbm = 0, + }; + zwave_rx_set_config(&rx_config); + + const zwave_controller_config_t controller_config = { + .zpc_basic_device_type = 2, + .zpc_generic_device_type = 1, + .zpc_specific_device_type = 0, + }; + zwave_controller_set_config(&controller_config); + + sl_log_init(argv[3]); + + return uic_main(uic_fixt_setup_steps_list, + uic_fixt_shutdown_steps_list, + argc, + argv, + CMAKE_PROJECT_VERSION); +} diff --git a/cmake/include/compiler_options.cmake b/cmake/include/compiler_options.cmake index 1f83caa00..751ffe84b 100644 --- a/cmake/include/compiler_options.cmake +++ b/cmake/include/compiler_options.cmake @@ -31,8 +31,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # Do not allow fallback to previous C++ set(CMAKE_CXX_EXTENSIONS ON) # Enable gnu++11 extentions # Set compiler Flags -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -Wall") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Werror -Wall") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -Werror -Wall") # Only add code coverage when CMAKE_GCOV is True if(CMAKE_GCOV) diff --git a/cmake/modules/FindCMock.cmake b/cmake/modules/FindCMock.cmake new file mode 100644 index 000000000..950175309 --- /dev/null +++ b/cmake/modules/FindCMock.cmake @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: Silicon Laboratories Inc. +# SPDX-License-Identifier: Zlib +# +# This recipe allows to download CMock +# It can be used by projects which are depending on it +# Feel free to copy this (up to date) file everywhere it is needed + +include(FetchContent) + +if(NOT DEFINED CMOCK_GIT_REPOSITORY) + if(DEFINED ENV{CMOCK_GIT_REPOSITORY}) + set(CMOCK_GIT_REPOSITORY $ENV{CMOCK_GIT_REPOSITORY}) + endif() +endif() +if("${CMOCK_GIT_REPOSITORY}" STREQUAL "") + set(CMOCK_GIT_REPOSITORY "https://github.com/ThrowTheSwitch/CMock") +endif() + +if(NOT DEFINED CMOCK_GIT_TAG) + if(DEFINED ENV{CMOCK_GIT_TAG}) + set(CMOCK_GIT_TAG $ENV{CMOCK_GIT_TAG}) + else() + set(CMOCK_GIT_TAG "v2.5.3") + endif() +endif() + +FetchContent_Declare( + CMock + GIT_REPOSITORY ${CMOCK_GIT_REPOSITORY} + GIT_TAG ${CMOCK_GIT_TAG} + GIT_SUBMODULES_RECURSE True + GIT_SHALLOW 1 +) + +message(STATUS "${CMAKE_PROJECT_NAME}: Depends: ${CMOCK_GIT_REPOSITORY}#${CMOCK_GIT_TAG}") +string(REGEX MATCH ".*/?main/?.*" CMOCK_UNSTABLE_GIT_TAG "${CMOCK_GIT_TAG}") +if(CMOCK_GIT_TAG STREQUAL "" OR CMOCK_UNSTABLE_GIT_TAG) + message(WARNING "${CMAKE_PROJECT_NAME}: Declare CMOCK_GIT_TAG to stable version not: ${CMOCK_UNSTABLE_GIT_TAG}") +endif() + +set(FETCHCONTENT_QUIET FALSE) +FetchContent_MakeAvailable(CMock) + +message(STATUS "CMock Sources: ${cmock_SOURCE_DIR}") +message(STATUS "CMock Binaries: ${cmock_BINARY_DIR}") diff --git a/cmake/modules/FindUnifySDK.cmake b/cmake/modules/FindUnifySDK.cmake index 4eb31e53f..e9affdb62 100644 --- a/cmake/modules/FindUnifySDK.cmake +++ b/cmake/modules/FindUnifySDK.cmake @@ -29,6 +29,12 @@ if("${UNIFYSDK_GIT_TAG}" STREQUAL "") set(UNIFYSDK_GIT_TAG "main") # Override CMake default ("master") endif() +file(GLOB UNIFYSDK_PATCHES + LIST_DIRECTORIES false + ${PROJECT_SOURCE_DIR}/patches/UnifySDK/*.patch +) + +set(ENV{GIT_LFS_SKIP_SMUDGE} "1") find_package(Git) FetchContent_Declare( UnifySDK @@ -36,14 +42,14 @@ FetchContent_Declare( GIT_TAG ${UNIFYSDK_GIT_TAG} GIT_SUBMODULES_RECURSE True GIT_SHALLOW 1 + GIT_PROGRESS True # Prevent "fatal: unable to auto-detect email address" GIT_CONFIG user.email=nobody@UnifySDK.localhost PATCH_COMMAND ${GIT_EXECUTABLE} - -C - am - ${PROJECT_SOURCE_DIR}/patches/UnifySDK/0001-UIC-3202-Relax-compiler-warnings-to-support-more-com.patch + -C am --ignore-whitespace + "${UNIFYSDK_PATCHES}" ) message(STATUS "${CMAKE_PROJECT_NAME}: Depends: ${UNIFYSDK_GIT_REPOSITORY}#${UNIFYSDK_GIT_TAG}") diff --git a/cmake/release-version.cmake b/cmake/release-version.cmake deleted file mode 100644 index af95759ae..000000000 --- a/cmake/release-version.cmake +++ /dev/null @@ -1 +0,0 @@ -SET(GIT_VERSION "ver_1.7.0") diff --git a/components/testframework/CMakeLists.txt b/components/testframework/CMakeLists.txt deleted file mode 100644 index c2765b432..000000000 --- a/components/testframework/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -set(Boost_USE_MULTITHREADED ON) -find_package(Boost REQUIRED) -# Find nlohmann_json, unfortunately the find_package doesn't work for this when -# cross compiling, thus we use the simplified method find_path instead -find_path(nlohmann_json_include nlohmann/json.hpp REQUIRED) - -if(EXISTS ${ZW-TESTFRAMEWORK_LOCATION}) - message(STATUS "Found zwave testframework: ${ZW-TESTFRAMEWORK_LOCATION}") - include_directories(${ZW-TESTFRAMEWORK_LOCATION}) -else() - add_subdirectory(libs/testframework) -endif() - -set(DEFAULT_THS-CMOCK_PATH libs/cmock) -if(EXISTS ${THS-CMOCK_LOCATION}) - set(THS-CMOCK_PATH ${THS-CMOCK_LOCATION}) -else() - set(THS-CMOCK_PATH ${DEFAULT_THS-CMOCK_PATH}) -endif() -if(EXISTS ${THS-CMOCK_PATH}) - message(STATUS "Found ths-cmock: ${THS-CMOCK_PATH}") -else() - message(STATUS "Did not find ths-cmock at ${THS-CMOCK_PATH}") -endif() - -set(DEFAULT_THS-UNITY_PATH libs/cmock/vendor/unity) -if(EXISTS ${THS-UNITY_LOCATION}) - set(THS-UNITY_PATH ${THS-UNITY_LOCATION}) -else() - set(THS-UNITY_PATH ${DEFAULT_THS-UNITY_PATH}) -endif() -if(EXISTS ${THS-UNITY_PATH}) - message(STATUS "Found ths-unity: ${THS-UNITY_PATH}") -else() - message(STATUS "Did not find ths-unity at ${THS-UNITY_PATH}") -endif() -add_library(unity2 ${THS-UNITY_PATH}/src/unity.c src/unity_helpers.cpp) - -target_include_directories(unity2 PUBLIC ${THS-UNITY_PATH}/src include - ${nlohmann_json_include}) -target_compile_definitions(unity2 PUBLIC UNITY_SUPPORT_64 UNITY_INCLUDE_DOUBLE - UNITY_DOUBLE_PRECISION=1e-12f) - -add_library(cmock STATIC ${THS-CMOCK_PATH}/src/cmock.c) -target_include_directories(cmock PUBLIC ${THS-CMOCK_PATH}/src) -target_link_libraries(cmock unity2) - -include(add_mock.cmake) -include(target_add_unittest.cmake) - diff --git a/components/testframework/add_mock.cmake b/components/testframework/add_mock.cmake deleted file mode 100644 index 5a3f03981..000000000 --- a/components/testframework/add_mock.cmake +++ /dev/null @@ -1,123 +0,0 @@ -find_package(Ruby) -# The RUBY_EXECUTABLE variable does not exist when the ADD_MOCK function is -# called So instaed store the value in cache and use the cached value -set(CMOCK_RUBY_EXECUTABLE - ${RUBY_EXECUTABLE} - CACHE INTERNAL "") - -set(DIR_OF_ADD_MOCK_CMAKE - ${CMAKE_CURRENT_LIST_DIR} - CACHE INTERNAL "DIR_OF_ADD_MOCK_CMAKE") - -# Documentation add_mock( header1 [header2] ... [headerN] ) -# -# Make a mock library using cmake given a list of header files. -function(ADD_MOCK TARGET) - set(CMOCK_DIR "${DIR_OF_ADD_MOCK_CMAKE}") - - set(MOCK_HEADERS ${ARGV}) - # Pop the first argument of the list - list(REMOVE_AT MOCK_HEADERS 0) - - foreach(HEADER ${MOCK_HEADERS}) - get_filename_component(BASE ${HEADER} NAME_WE) - get_filename_component(DIR ${HEADER} DIRECTORY) - - if(IS_ABSOLUTE ${HEADER}) - list(APPEND MOCK_HEADER_FILES "${HEADER}") - list(APPEND MOCK_HEADER_DIRS "${DIR}") - else() - list(APPEND MOCK_HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${HEADER}") - list(APPEND MOCK_HEADER_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}") - endif() - - list(APPEND MOCK_SOURCE_FILES - "${CMAKE_CURRENT_BINARY_DIR}/mocks/${BASE}_mock.c") - endforeach() - - list(REMOVE_DUPLICATES MOCK_HEADER_DIRS) - - if(NOT EXISTS ${UNIFY-TESTFRAMEWORK_LOCATION}) - set(UNIFY-TESTFRAMEWORK_LOCATION ${DIR_OF_ADD_MOCK_CMAKE}) - endif() - - set(ZWAVE_UNITY_CONFIG ${UNIFY-TESTFRAMEWORK_LOCATION}/unify_cmock_config.yml) - - if(NOT EXISTS ${ZWAVE_UNITY_CONFIG}) - message( - FATAL_ERROR - "Did not find unify_cmock_config.yml at ${ZWAVE_UNITY_CONFIG}") - endif() - - if((EXISTS ${THS-CMOCK_LOCATION}) AND (EXISTS ${THS-UNITY_LOCATION})) - set(UNITY_DIR ${THS-UNITY_LOCATION}) - add_custom_command( - OUTPUT ${MOCK_SOURCE_FILES} - DEPENDS ${MOCK_HEADER_FILES} - COMMAND - UNITY_DIR=${THS-UNITY_LOCATION} ${CMOCK_RUBY_EXECUTABLE} - ${THS-CMOCK_LOCATION}/lib/cmock.rb -o${ZWAVE_UNITY_CONFIG} - ${MOCK_HEADER_FILES}) - else() - if (NOT EXISTS ${CMOCK_DIR}/libs/cmock/lib/cmock.rb) - message(FATAL_ERROR "Did not find cmock.rb.") - endif() - add_custom_command( - OUTPUT ${MOCK_SOURCE_FILES} - DEPENDS ${MOCK_HEADER_FILES} - COMMAND ${CMOCK_RUBY_EXECUTABLE} ${CMOCK_DIR}/libs/cmock/lib/cmock.rb - -o${CMOCK_DIR}/unify_cmock_config.yml ${MOCK_HEADER_FILES}) - endif() - - add_library(${TARGET} ${MOCK_SOURCE_FILES}) - target_include_directories(${TARGET} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/mocks - ${MOCK_HEADER_DIRS}) - target_link_libraries(${TARGET} PUBLIC cmock) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - target_compile_options(${TARGET} PRIVATE "-fPIC") - endif() -endfunction() - -# Generates a mocking library based of the provided target. -# It will generate mock implemenations for every header in the public include directory of the provided target. -# uses unity/cmock to generate mocks. -function(target_add_mock) - # first argument is the target to make unit-test exe of. - list(POP_FRONT ARGV TARGET) - get_target_property(incl_dirs ${TARGET} INTERFACE_INCLUDE_DIRECTORIES) - set(headers "") - foreach(dir ${incl_dirs}) - # strip out any includes that wrapped in BUILD_INTERFACE expressions if present - string(REGEX - REPLACE "\\s*(:?\\\$?" - "\\2" dir "${dir}") - file(GLOB files ${dir}/*.h) - list(APPEND headers "${files}") - endforeach() - - # add additional headers - list(APPEND headers "${ARGV}") - - list(LENGTH headers len) - if(NOT ${len} EQUAL 0) - add_mock("${TARGET}_mock" ${headers}) - get_target_property(libs ${TARGET} LINK_LIBRARIES) - foreach(lib ${libs}) - # filter libs-list so actual cmake targets are left. - # $:$>" - ) - endif() - endforeach() - else() - message(WARNING "Nothing to mock for ${TARGET}. no headers found") - message(WARNING "looked in \"${incl_dirs}\"") - endif() - -endfunction() diff --git a/components/testframework/include/unity_helpers.h b/components/testframework/include/unity_helpers.h deleted file mode 100644 index 31f0cd67d..000000000 --- a/components/testframework/include/unity_helpers.h +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * # License - * Copyright 2021 Silicon Laboratories Inc. www.silabs.com - ****************************************************************************** - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - *****************************************************************************/ - -/** - * @file unity_helpers.h - * @brief Various helpers/extensions for unity test framework - * - * This component contains various additions to the unity test framework - * - * @{ - */ - -#ifndef UNITY_CPP_HELPERS_HPP -#define UNITY_CPP_HELPERS_HPP -#ifdef __cplusplus -extern "C" { -#endif - -void INTERNAL_TEST_ASSERT_EQUAL_JSON(const char *expected, - const char *actual, - unsigned int line); -/** - * @brief Test that two JSON objects are equal, - * - * see @ref INTERNAL_TEST_ASSERT_EQUAL_JSON implementations for details - */ -#define TEST_ASSERT_EQUAL_JSON(expected, actual) \ - INTERNAL_TEST_ASSERT_EQUAL_JSON(expected, actual, __LINE__) - -#ifdef __cplusplus -} -#endif -#endif //UNITY_CPP_HELPERS_HPP -/** @} end unity_cpp_helpers */ diff --git a/components/testframework/libs/cmock/.travis.yml b/components/testframework/libs/cmock/.travis.yml deleted file mode 100644 index d9e84ad22..000000000 --- a/components/testframework/libs/cmock/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -sudo: required -language: ruby c - -matrix: - include: - #- os: osx - # compiler: clang - # osx_image: xcode7.3 - - os: linux - dist: trusty - rvm: "2.4" - compiler: gcc - - os: linux - dist: xenial - rvm: "2.7" - compiler: clang - -before_install: - - sudo apt-get install --assume-yes --quiet gcc-multilib - -install: - - gem install bundler - - bundle install - - gem install rspec - - gem install rubocop -v 0.57.2 - -script: - - cd test && rake ci diff --git a/components/testframework/libs/cmock/Gemfile b/components/testframework/libs/cmock/Gemfile deleted file mode 100644 index 96ac06ec6..000000000 --- a/components/testframework/libs/cmock/Gemfile +++ /dev/null @@ -1,8 +0,0 @@ -source "http://rubygems.org/" - -gem "bundler" -gem "rake" -gem "minitest" -gem "require_all" -gem "constructor" -gem "diy" diff --git a/components/testframework/libs/cmock/LICENSE.txt b/components/testframework/libs/cmock/LICENSE.txt deleted file mode 100644 index 98167e40c..000000000 --- a/components/testframework/libs/cmock/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams - -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. \ No newline at end of file diff --git a/components/testframework/libs/cmock/README.md b/components/testframework/libs/cmock/README.md deleted file mode 100644 index 112007367..000000000 --- a/components/testframework/libs/cmock/README.md +++ /dev/null @@ -1,34 +0,0 @@ -CMock - Mock/stub generator for C -================================= - -[![CMock Build Status](https://api.travis-ci.org/ThrowTheSwitch/CMock.png?branch=master)](https://travis-ci.org/ThrowTheSwitch/CMock) - -Getting Started -================ - -If you're using Ceedling, there is no need to install CMock. It will handle it for you. -For everyone else, the simplest way is to grab it off github. You can also download it -as a zip if you prefer. The Github method looks something like this: - - > git clone --recursive https://github.com/throwtheswitch/cmock.git - > cd cmock - > bundle install # Ensures you have all RubyGems needed - -If you plan to help with the development of CMock (or just want to verify that it can -perform its self tests on your system) then you can enter the test directory and then -ask it to test: - - > cd test - > rake # Run all CMock self tests - -API Documentation -================= - -* Not sure what you're doing? - * [View docs/CMock_Summary.md](docs/CMock_Summary.md) -* Interested in our MIT-style license? - * [View docs/license.txt](docs/license.txt) -* Are there examples? - * They are all in [/examples](examples/) -* Any other resources to check out? - * Definitely! Check out our developer portal on [ThrowTheSwitch.org](http://throwtheswitch.org) diff --git a/components/testframework/libs/cmock/config/production_environment.rb b/components/testframework/libs/cmock/config/production_environment.rb deleted file mode 100644 index 082b63fde..000000000 --- a/components/testframework/libs/cmock/config/production_environment.rb +++ /dev/null @@ -1,12 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -# Setup our load path: -[ - 'lib' -].each do |dir| - $:.unshift(File.join(__dir__ + '/../', dir)) -end diff --git a/components/testframework/libs/cmock/config/test_environment.rb b/components/testframework/libs/cmock/config/test_environment.rb deleted file mode 100644 index aeae3a342..000000000 --- a/components/testframework/libs/cmock/config/test_environment.rb +++ /dev/null @@ -1,16 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -# Setup our load path: -[ - './lib', - './vendor/behaviors/lib', - './vendor/hardmock/lib', - './vendor/unity/auto/', - './test/system/' -].each do |dir| - $:.unshift(File.join(File.expand_path(File.dirname(__FILE__) + '/../'), dir)) -end diff --git a/components/testframework/libs/cmock/docs/CMock_Summary.md b/components/testframework/libs/cmock/docs/CMock_Summary.md deleted file mode 100644 index 9db2b8e35..000000000 --- a/components/testframework/libs/cmock/docs/CMock_Summary.md +++ /dev/null @@ -1,810 +0,0 @@ -CMock: A Summary -================ - -*[ThrowTheSwitch.org](http://throwtheswitch.org)* - -*This documentation is released under a Creative Commons 3.0 Attribution Share-Alike License* - - -What Exactly Are We Talking About Here? ---------------------------------------- - -CMock is a nice little tool which takes your header files and creates -a Mock interface for it so that you can more easily unit test modules -that touch other modules. For each function prototype in your -header, like this one: - - int DoesSomething(int a, int b); - - -...you get an automatically generated DoesSomething function -that you can link to instead of your real DoesSomething function. -By using this Mocked version, you can then verify that it receives -the data you want, and make it return whatever data you desire, -make it throw errors when you want, and more... Create these for -everything your latest real module touches, and you're suddenly -in a position of power: You can control and verify every detail -of your latest creation. - -To make that easier, CMock also gives you a bunch of functions -like the ones below, so you can tell that generated DoesSomething -function how to behave for each test: - - void DoesSomething_ExpectAndReturn(int a, int b, int toReturn); - void DoesSomething_ExpectAndThrow(int a, int b, EXCEPTION_T error); - void DoesSomething_StubWithCallback(CMOCK_DoesSomething_CALLBACK YourCallback); - void DoesSomething_IgnoreAndReturn(int toReturn); - - -You can pile a bunch of these back to back, and it remembers what -you wanted to pass when, like so: - - test_CallsDoesSomething_ShouldDoJustThat(void) - { - DoesSomething_ExpectAndReturn(1,2,3); - DoesSomething_ExpectAndReturn(4,5,6); - DoesSomething_ExpectAndThrow(7,8, STATUS_ERROR_OOPS); - - CallsDoesSomething( ); - } - - -This test will call CallsDoesSomething, which is the function -we are testing. We are expecting that function to call DoesSomething -three times. The first time, we check to make sure it's called -as DoesSomething(1, 2) and we'll magically return a 3. The second -time we check for DoesSomething(4, 5) and we'll return a 6. The -third time we verify DoesSomething(7, 8) and we'll throw an error -instead of returning anything. If CallsDoesSomething gets -any of this wrong, it fails the test. It will fail if you didn't -call DoesSomething enough, or too much, or with the wrong arguments, -or in the wrong order. - -CMock is based on Unity, which it uses for all internal testing. -It uses Ruby to do all the main work (versions 2.0.0 and above). - - -Installing -========== - -The first thing you need to do to install CMock is to get yourself -a copy of Ruby. If you're on linux or osx, you probably already -have it. You can prove it by typing the following: - - ruby --version - - -If it replied in a way that implies ignorance, then you're going to -need to install it. You can go to [ruby-lang](https://ruby-lang.org) -to get the latest version. You're also going to need to do that if it -replied with a version that is older than 2.0.0. Go ahead. We'll wait. - -Once you have Ruby, you have three options: - -* Clone the latest [CMock repo on github](https://github.com/ThrowTheSwitch/CMock/) -* Download the latest [CMock zip from github](https://github.com/ThrowTheSwitch/CMock/) -* Install Ceedling (which has it built in!) through your commandline using `gem install ceedling`. - - -Generated Mock Module Summary -============================= - -In addition to the mocks themselves, CMock will generate the -following functions for use in your tests. The expect functions -are always generated. The other functions are only generated -if those plugins are enabled: - - -Expect: -------- - -Your basic staple Expects which will be used for most of your day -to day CMock work. By calling this, you are telling CMock that you -expect that function to be called during your test. It also specifies -which arguments you expect it to be called with, and what return -value you want returned when that happens. You can call this function -multiple times back to back in order to queue up multiple calls. - -* `void func(void)` => `void func_Expect(void)` -* `void func(params)` => `void func_Expect(expected_params)` -* `retval func(void)` => `void func_ExpectAndReturn(retval_to_return)` -* `retval func(params)` => `void func_ExpectAndReturn(expected_params, retval_to_return)` - - -ExpectAnyArgs: --------------- - -This behaves just like the Expects calls, except that it doesn't really -care what the arguments are that the mock gets called with. It still counts -the number of times the mock is called and it still handles return values -if there are some. Note that an ExpectAnyArgs call is not generated for -functions that have no arguments, because it would act exactly like the existing -Expect and ExpectAndReturn calls. - -* `void func(params)` => `void func_ExpectAnyArgs(void)` -* `retval func(params)` => `void func_ExpectAnyArgsAndReturn(retval_to_return)` - - -Array: ------- - -An ExpectWithArray is another variant of Expect. Like expect, it cares about -the number of times a mock is called, the arguments it is called with, and the -values it is to return. This variant has another feature, though. For anything -that resembles a pointer or array, it breaks the argument into TWO arguments. -The first is the original pointer. The second specify the number of elements -it is to verify of that array. If you specify 1, it'll check one object. If 2, -it'll assume your pointer is pointing at the first of two elements in an array. -If you specify zero elements, it will check just the pointer if -`:smart` mode is configured or fail if `:compare_data` is set. - -* `void func(void)` => (nothing. In fact, an additional function is only generated if the params list contains pointers) -* `void func(ptr * param, other)` => `void func_ExpectWithArray(ptr* param, int param_depth, other)` -* `retval func(void)` => (nothing. In fact, an additional function is only generated if the params list contains pointers) -* `retval func(other, ptr* param)` => `void func_ExpectWithArrayAndReturn(other, ptr* param, int param_depth, retval_to_return)` - - -Ignore: -------- - -Maybe you don't care about the number of times a particular function is called or -the actual arguments it is called with. In that case, you want to use Ignore. Ignore -only needs to be called once per test. It will then ignore any further calls to that -particular mock. The IgnoreAndReturn works similarly, except that it has the added -benefit of knowing what to return when that call happens. If the mock is called more -times than IgnoreAndReturn was called, it will keep returning the last value without -complaint. If it's called fewer times, it will also ignore that. You SAID you didn't -care how many times it was called, right? - -* `void func(void)` => `void func_Ignore(void)` -* `void func(params)` => `void func_Ignore(void)` -* `retval func(void)` => `void func_IgnoreAndReturn(retval_to_return)` -* `retval func(params)` => `void func_IgnoreAndReturn(retval_to_return)` - -StopIgnore: -------- - -Maybe you want to ignore a particular function for part of a test but dont want to -ignore it later on. In that case, you want to use StopIgnore which will cancel the -previously called Ignore or IgnoreAndReturn requiring you to Expect or otherwise -handle the call to a function. - -* `void func(void)` => `void func_StopIgnore(void)` -* `void func(params)` => `void func_StopIgnore(void)` -* `retval func(void)` => `void func_StopIgnore(void)` -* `retval func(params)` => `void func_StopIgnore(void)` - -Ignore Arg: ------------- - -Maybe you overall want to use Expect and its similar variations, but you don't care -what is passed to a particular argument. This is particularly useful when that argument -is a pointer to a value that is supposed to be filled in by the function. You don't want -to use ExpectAnyArgs, because you still care about the other arguments. Instead, after -an Expect call is made, you can call this function. It tells CMock to ignore -a particular argument for the rest of this test, for this mock function. You may call -multiple instances of this to ignore multiple arguments after each expectation if -desired. - -* `void func(params)` => `void func_IgnoreArg_paramName(void)` - - -ReturnThruPtr: --------------- - -Another option which operates on a particular argument of a function is the ReturnThruPtr -plugin. For every argument that resembles a pointer or reference, CMock generates an -instance of this function. Just as the AndReturn functions support injecting one or more -return values into a queue, this function lets you specify one or more return values which -are queued up and copied into the space being pointed at each time the mock is called. - -* `void func(param1)` => `void func_ReturnThruPtr_paramName(val_to_return)` -* => `void func_ReturnArrayThruPtr_paramName(cal_to_return, len)` -* => `void func_ReturnMemThruPtr_paramName(val_to_return, size)` - - -Callback: ---------- - -If all those other options don't work, and you really need to do something custom, you -still have a choice. As soon as you stub a callback in a test, it will call the callback -whenever the mock is encountered and return the retval returned from the callback (if any). - -* `void func(void)` => `void func_[AddCallback,Stub](CMOCK_func_CALLBACK callback)` -where `CMOCK_func_CALLBACK` looks like: `void func(int NumCalls)` -* `void func(params)` => `void func_[AddCallback,Stub](CMOCK_func_CALLBACK callback)` -where `CMOCK_func_CALLBACK` looks like: `void func(params, int NumCalls)` -* `retval func(void)` => `void func_[AddCallback,Stub](CMOCK_func_CALLBACK callback)` -where `CMOCK_func_CALLBACK` looks like: `retval func(int NumCalls)` -* `retval func(params)` => `void func_[AddCallback,Stub](CMOCK_func_CALLBACK callback)` -where `CMOCK_func_CALLBACK` looks like: `retval func(params, int NumCalls)` - -You can choose from two options: - -* `func_AddCallback` tells the mock to check its arguments and calling -order (based on any Expects you've set up) before calling the callback. -* `func_Stub` tells the mock to skip all the normal checks and jump directly -to the callback instead. In this case, you are replacing the normal mock calls -with your own custom stub function. - -There is also an older name, `func_StubWithCallback`, which is just an alias -for either `func_AddCallback` or `func_Stub` depending on setting of the -`:callback_after_arg_check` toggle. This is deprecated and we recommend using -the two options above. - - -Cexception: ------------ - -Finally, if you are using Cexception for error handling, you can use this to throw errors -from inside mocks. Like Expects, it remembers which call was supposed to throw the error, -and it still checks parameters first. - -* `void func(void)` => `void func_ExpectAndThrow(value_to_throw)` -* `void func(params)` => `void func_ExpectAndThrow(expected_params, value_to_throw)` -* `retval func(void)` => `void func_ExpectAndThrow(value_to_throw)` -* `retval func(params)` => `void func_ExpectAndThrow(expected_params, value_to_throw)` - - - -Running CMock -============= - -CMock is a Ruby script and class. You can therefore use it directly -from the command line, or include it in your own scripts or rakefiles. - - -Mocking from the Command Line ------------------------------ - -After unpacking CMock, you will find cmock.rb in the 'lib' directory. -This is the file that you want to run. It takes a list of header files -to be mocked, as well as an optional yaml file for a more detailed -configuration (see config options below). - -For example, this will create three mocks using the configuration -specified in MyConfig.yml: - - ruby cmock.rb -oMyConfig.yml super.h duper.h awesome.h - -And this will create two mocks using the default configuration: - - ruby cmock.rb ../mocking/stuff/is/fun.h ../try/it/yourself.h - - -Mocking From Scripts or Rake ----------------------------- - -CMock can be used directly from your own scripts or from a rakefile. -Start by including cmock.rb, then create an instance of CMock. -When you create your instance, you may initialize it in one of -three ways. - -You may specify nothing, allowing it to run with default settings: - - require 'cmock.rb' - cmock = CMock.new - -You may specify a YAML file containing the configuration options -you desire: - - cmock = CMock.new('../MyConfig.yml') - -You may specify the options explicitly: - - cmock = Cmock.new(:plugins => [:cexception, :ignore], :mock_path => 'my/mocks/') - -Creating Skeletons: -------------------- - -Not only is CMock able to generate mock files from a header file, but it is also able -to generate (and update) skeleton C files from headers. It does this by creating a -(mostly) empty implementation for every function that is declared in the header. If you later -add to that header list, just run this feature again and it will add prototypes for the missing -functions! - -Like the normal usecase for CMock, this feature can be used from the command line -or from within its ruby API. For example, from the command line, add `--skeleton` to -generate a skeleton instead: - -``` -ruby cmock.rb --skeleton ../create/c/for/this.h -``` - -Config Options: ---------------- - -The following configuration options can be specified in the -yaml file or directly when instantiating. - -Passed as Ruby, they look like this: - - { :attributes => [“__funky”, “__intrinsic”], :when_ptr => :compare } - -Defined in the yaml file, they look more like this: - - :cmock: - :attributes: - - __funky - - __intrinsic - :when_ptr: :compare - -In all cases, you can just include the things that you want to override -from the defaults. We've tried to specify what the defaults are below. - -* `:attributes`: - These are attributes that CMock should ignore for you for testing - purposes. Custom compiler extensions and externs are handy things to - put here. If your compiler is choking on some extended syntax, this - is often a good place to look. - - * defaults: ['__ramfunc', '__irq', '__fiq', 'register', 'extern'] - * **note:** this option will reinsert these attributes onto the mock's calls. - If that isn't what you are looking for, check out :strippables. - -* `:c_calling_conventions`: - Similarly, CMock may need to understand which C calling conventions - might show up in your codebase. If it encounters something it doesn't - recognize, it's not going to mock it. We have the most common covered, - but there are many compilers out there, and therefore many other options. - - * defaults: ['__stdcall', '__cdecl', '__fastcall'] - * **note:** this option will reinsert these attributes onto the mock's calls. - If that isn't what you are looking for, check out :strippables. - -* `:callback_after_arg_check`: - Tell `:callback` plugin to do the normal argument checking **before** it - calls the callback function by setting this to true. When false, the - callback function is called **instead** of the argument verification. - - * default: false - -* `:callback_include_count`: - Tell `:callback` plugin to include an extra parameter to specify the - number of times the callback has been called. If set to false, the - callback has the same interface as the mocked function. This can be - handy when you're wanting to use callback as a stub. - - * default: true - -* `:cexception_include`: - Tell `:cexception` plugin where to find CException.h... You only need to - define this if it's not in your build path already... which it usually - will be for the purpose of your builds. - - * default: *nil* - -* `:enforce_strict_ordering`: - CMock always enforces the order that you call a particular function, - so if you expect GrabNabber(int size) to be called three times, it - will verify that the sizes are in the order you specified. You might - *also* want to make sure that all different functions are called in a - particular order. If so, set this to true. - - * default: false - -* `:framework`: - Currently the only option is `:unity.` Eventually if we support other - unity test frameworks (or if you write one for us), they'll get added - here. - - : default: :unity - -* `:includes`: - An array of additional include files which should be added to the - mocks. Useful for global types and definitions used in your project. - There are more specific versions if you care WHERE in the mock files - the includes get placed. You can define any or all of these options. - - * `:includes` - * `:includes_h_pre_orig_header` - * `:includes_h_post_orig_header` - * `:includes_c_pre_header` - * `:includes_c_post_header` - * default: nil #for all 5 options - -* `:memcmp_if_unknown`: - C developers create a lot of types, either through typedef or preprocessor - macros. CMock isn't going to automatically know what you were thinking all - the time (though it tries its best). If it comes across a type it doesn't - recognize, you have a choice on how you want it to handle it. It can either - perform a raw memory comparison and report any differences, or it can fail - with a meaningful message. Either way, this feature will only happen after - all other mechanisms have failed (The thing encountered isn't a standard - type. It isn't in the :treat_as list. It isn't in a custom unity_helper). - - * default: true - -* `:mock_path`: - The directory where you would like the mock files generated to be - placed. - - * default: mocks - -* `:mock_prefix`: - The prefix to prepend to your mock files. For example, if it's `Mock`, a file - “USART.h” will get a mock called “MockUSART.c”. This CAN be used with a suffix - at the same time. - - * default: Mock - -* `:mock_suffix`: - The suffix to append to your mock files. For example, it it's `_Mock`, a file - "USART.h" will get a mock called "USART_Mock.h". This CAN be used with a prefix - at the same time. - - * default: "" - -* `:plugins`: - An array of which plugins to enable. ':expect' is always active. Also - available currently: - - * `:ignore` - * `:ignore_arg` - * `:expect_any_args` - * `:array` - * `:cexception` - * `:callback` - * `:return_thru_ptr` - -* `:strippables`: - An array containing a list of items to remove from the header - before deciding what should be mocked. This can be something simple - like a compiler extension CMock wouldn't recognize, or could be a - regex to reject certain function name patterns. This is a great way to - get rid of compiler extensions when your test compiler doesn't support - them. For example, use `:strippables: ['(?:functionName\s*\(+.*?\)+)']` - to prevent a function `functionName` from being mocked. By default, it - is ignoring all gcc attribute extensions. - - * default: ['(?:__attribute__\s*\(+.*?\)+)'] - -* `:subdir`: - This is a relative subdirectory for your mocks. Set this to e.g. "sys" in - order to create a mock for `sys/types.h` in `(:mock_path)/sys/`. - - * default: "" - -* `:treat_as`: - The `:treat_as` list is a shortcut for when you have created typedefs - of standard types. Why create a custom unity helper for UINT16 when - the unity function TEST_ASSERT_EQUAL_HEX16 will work just perfectly? - Just add 'UINT16' => 'HEX16' to your list (actually, don't. We already - did that one for you). Maybe you have a type that is a pointer to an - array of unsigned characters? No problem, just add 'UINT8_T*' => - 'HEX8*' - - * NOTE: unlike the other options, your specifications MERGE with the - default list. Therefore, if you want to override something, you must - reassign it to something else (or to *nil* if you don't want it) - - * default: - * 'int': 'INT' - * 'char': 'INT8' - * 'short': 'INT16' - * 'long': 'INT' - * 'int8': 'INT8' - * 'int16': 'INT16' - * 'int32': 'INT' - * 'int8_t': 'INT8' - * 'int16_t': 'INT16' - * 'int32_t': 'INT' - * 'INT8_T': 'INT8' - * 'INT16_T': 'INT16' - * 'INT32_T': 'INT' - * 'bool': 'INT' - * 'bool_t': 'INT' - * 'BOOL': 'INT' - * 'BOOL_T': 'INT' - * 'unsigned int': 'HEX32' - * 'unsigned long': 'HEX32' - * 'uint32': 'HEX32' - * 'uint32_t': 'HEX32' - * 'UINT32': 'HEX32' - * 'UINT32_T': 'HEX32' - * 'void*': 'HEX8_ARRAY' - * 'unsigned short': 'HEX16' - * 'uint16': 'HEX16' - * 'uint16_t': 'HEX16' - * 'UINT16': 'HEX16' - * 'UINT16_T': 'HEX16' - * 'unsigned char': 'HEX8' - * 'uint8': 'HEX8' - * 'uint8_t': 'HEX8' - * 'UINT8': 'HEX8' - * 'UINT8_T': 'HEX8' - * 'char*': 'STRING' - * 'pCHAR': 'STRING' - * 'cstring': 'STRING' - * 'CSTRING': 'STRING' - * 'float': 'FLOAT' - * 'double': 'FLOAT' - -* `:treat_as_array`: - A specialized sort of `:treat_as` to be used when you've created a - typedef of an array type, such as `typedef int TenIntegers[10];`. This - is a hash of typedef name to element type. For example: - - { "TenIntegers" => "int", - "ArrayOfFloat" => "float" } - - Telling CMock about these typedefs allows it to be more intelligent - about parameters of such types, so that you can use features like - ExpectWithArray and ReturnArrayThruPtr with them. - -* `:treat_as_void`: - We've seen "fun" legacy systems typedef 'void' with a custom type, - like MY_VOID. Add any instances of those to this list to help CMock - understand how to deal with your code. - - * default: [] - -* `:treat_externs`: - This specifies how you want CMock to handle functions that have been - marked as extern in the header file. Should it mock them? - - * `:include` will mock externed functions - * `:exclude` will ignore externed functions (default). - -* `:treat_inlines`: - This specifies how you want CMock to handle functions that have been - marked as inline in the header file. Should it mock them? - - * `:include` will mock inlined functions - * `:exclude` will ignore inlined functions (default). - - CMock will look for the following default patterns (simplified from the actual regex): - - "static inline" - - "inline static" - - "inline" - - "static" - You can override these patterns, check out :inline_function_patterns. - - Enabling this feature does require a change in the build system that - is using CMock. To understand why, we need to give some more info - on how we are handling inline functions internally. - Let's say we want to mock a header called example.h. example.h - contains inline functions, we cannot include this header in the - mocks or test code if we want to mock the inline functions simply - because the inline functions contain an implementation that we want - to override in our mocks! - So, to circumvent this, we generate a new header, also named - example.h, in the same directory as mock_example.h/c . This newly - generated header should/is exactly the same as the original header, - only difference is the inline functions are transformed to 'normal' - functions declarations. Placing the new header in the same - directory as mock_example.h/c ensures that they will include the new - header and not the old one. - However, CMock has no control in how the build system is configured - and which include paths the test code is compiled with. In order - for the test code to also see the newly generated header ,and not - the old header with inline functions, the build system has to add - the mock folder to the include paths. - Furthermore, we need to keep the order of include paths in mind. We - have to set the mock folder before the other includes to avoid the - test code including the original header instead of the newly - generated header (without inline functions). - -* `:unity_helper_path`: - If you have created a header with your own extensions to unity to - handle your own types, you can set this argument to that path. CMock - will then automagically pull in your helpers and use them. The only - trick is that you make sure you follow the naming convention: - `UNITY_TEST_ASSERT_EQUAL_YourType`. If it finds macros of the right - shape that match that pattern, it'll use them. - - * default: [] - -* `:verbosity`: - How loud should CMock be? - - * 0 for errors only - * 1 for errors and warnings - * 2 for normal (default) - * 3 for verbose - -* `:weak`: - When set this to some value, the generated mocks are defined as weak - symbols using the configured format. This allows them to be overridden - in particular tests. - - * Set to '__attribute ((weak))' for weak mocks when using GCC. - * Set to any non-empty string for weak mocks when using IAR. - * default: "" - -* `:when_no_prototypes`: - When you give CMock a header file and ask it to create a mock out of - it, it usually contains function prototypes (otherwise what was the - point?). You can control what happens when this isn't true. You can - set this to `:warn,` `:ignore,` or `:error` - - * default: :warn - -* `:when_ptr`: - You can customize how CMock deals with pointers (c strings result in - string comparisons... we're talking about **other** pointers here). Your - options are `:compare_ptr` to just verify the pointers are the same, - `:compare_data` or `:smart` to verify that the data is the same. - `:compare_data` and `:smart` behaviors will change slightly based on - if you have the array plugin enabled. By default, they compare a - single element of what is being pointed to. So if you have a pointer - to a struct called ORGAN_T, it will compare one ORGAN_T (whatever that - is). - - * default: :smart - -* `:array_size_type`: -* `:array_size_name`: - When the `:array` plugin is disabled, these options do nothing. - - When the `:array` plugin is enabled, these options allow CMock to recognize - functions with parameters that might refer to an array, like the following, - and treat them more intelligently: - - * `void GoBananas(Banana * bananas, int num_bananas)` - * `int write_data(int fd, const uint8_t * data, uint32_t size)` - - To recognize functions like these, CMock looks for a parameter list - containing a pointer (which could be an array) followed by something that - could be an array size. "Something", by default, means an `int` or `size_t` - parameter with a name containing "size" or "len". - - `:array_size_type` is a list of additional types (besides `int` and `size_t`) - that could be used for an array size parameter. For example, to get CMock to - recognize that `uint32_t size` is an array size, you'd need to say: - - cfg[:array_size_type] = ['uint32_t'] - - `:array_size_name` is a regular expression used to match an array size - parameter by name. By default, it's 'size|len'. To get CMock to recognize a - name like `num_bananas`, you could tell it to also accept names containing - 'num_' like this: - - cfg[:array_size_name] = 'size|len|num_' - - Parameters must match *both* `:array_size_type` and `:array_size_name` (and - must come right after a pointer parameter) to be treated as an array size. - - Once you've told it how to recognize your arrays, CMock will give you `_Expect` - calls that work more like `_ExpectWithArray`, and compare an array of objects - rather than just a single object. - - For example, if you write the following, CMock will check that GoBananas is - called and passed an array containing a green banana followed by a yellow - banana: - - Banana b[2] = {GreenBanana, YellowBanana}; - GoBananas_Expect(b, 2); - - In other words, `GoBananas_Expect(b, 2)` now works just the same as: - - GoBananas_ExpectWithArray(b, 2, 2); - - `:array_as_byte`: - When checking arrays, the element size will always be 1, ie depth is the number - of bytes to check. - -* `:fail_on_unexpected_calls`: - By default, CMock will fail a test if a mock is called without `_Expect` and `_Ignore` - called first. While this forces test writers to be more explicit in their expectations, - it can clutter tests with `_Expect` or `_Ignore` calls for functions which are not the focus - of the test. While this is a good indicator that this module should be refactored, some - users are not fans of the additional noise. - - Therefore, :fail_on_unexpected_calls can be set to false to force all mocks to start with - the assumption that they are operating as `_Ignore` unless otherwise specified. - - * default: true - * **note:** - If this option is disabled, the mocked functions will return - a default value (0) when called (and only if they have to return something of course). - -* `:inline_function_patterns`: - An array containing a list of strings to detect inline functions. - This option is only taken into account if you enable :treat_inlines. - These strings are interpreted as regex patterns so be sure to escape - certain characters. For example, use `:inline_function_patterns: ['static inline __attribute__ \(\(always_inline\)\)']` - to recognize `static inline __attribute__ ((always_inline)) int my_func(void)` - as an inline function. - The default patterns are are: - - * default: ['(static\s+inline|inline\s+static)\s*', '(\bstatic\b|\binline\b)\s*'] - * **note:** - The order of patterns is important here! - We go from specific patterns ('static inline') to general patterns ('inline'), - otherwise we would miss functions that use 'static inline' iso 'inline'. - - -Compiled Options: ------------------ - -A number of #defines also exist for customizing the cmock experience. -Feel free to pass these into your compiler or whatever is most -convenient. CMock will otherwise do its best to guess what you want -based on other settings, particularly Unity's settings. - -* `CMOCK_MEM_STATIC` or `CMOCK_MEM_DYNAMIC` - Define one of these to determine if you want to dynamically add - memory during tests as required from the heap. If static, you - can control the total footprint of Cmock. If dynamic, you will - need to make sure you make some heap space available for Cmock. - -* `CMOCK_MEM_SIZE` - In static mode this is the total amount of memory you are allocating - to Cmock. In Dynamic mode this is the size of each chunk allocated - at once (larger numbers grab more memory but require fewer mallocs). - -* `CMOCK_MEM_ALIGN` - The way to align your data to. Not everything is as flexible as - a PC, as most embedded designers know. This defaults to 2, meaning - align to the closest 2^2 -> 4 bytes (32 bits). You can turn off alignment - by setting 0, force alignment to the closest uint16 with 1 or even - to the closest uint64 with 3. - -* `CMOCK_MEM_PTR_AS_INT` - This is used internally to hold pointers... it needs to be big - enough. On most processors a pointer is the same as an unsigned - long... but maybe that's not true for yours? - -* `CMOCK_MEM_INDEX_TYPE` - This needs to be something big enough to point anywhere in Cmock's - memory space... usually it's a size_t. - -Other Tips -========== - -resetTest ---------- - -While this isn't strictly a CMock feature, often users of CMock are using -either the test runner generator scripts in Unity or using Ceedling. In -either case, there is a handy function called `resetTest` which gets -generated with your runner. You can then use this handy function in your tests -themselves. Call it during a test to have CMock validate everything to this point -and start over clean. This is really useful when wanting to test a function in -an iterative manner with different arguments. - -C++ Support ---------- -C++ unit test/mocking frameworks often use a completely different approach (vs. -CMock) that relies on overloading virtual class members and does not support -directly mocking static class member methods or free functions (i.e., functions -in plain C). One workaround is to wrap the non-virtual functions in an object -that exposes them as virtual methods and modify your code to inject mocks at -run-time... but there is another way! - -Simply use CMock to mock the static member methods and a C++ mocking framework -to handle the virtual methods. (Yes, you can mix mocks from CMock and a C++ -mocking framework together in the same test!) - -Keep in mind that since C++ mocking frameworks often link the real object to the -unit test too, we need to resolve multiple definition errors with something like -the following in the source of the real implementation for any functions that -CMock mocks: - - #if defined(TEST) - __attribute__((weak)) - #endif - -To address potential issues with re-using the same function name in different -namespaces/classes, the generated function names include the namespace(s) and -class. For example: - - namespace MyNamespace { - class MyClass { - static int DoesSomething(int a, int b); - }; - } - -Will generate functions like - - void MyNamespace_MyClass_DoesSomething_ExpectAndReturn(int a, int b, int toReturn); - -Examples -======== - -You can look in the [examples directory](/examples/) for a couple of examples on how -you might tool CMock into your build process. You may also want to consider -using [Ceedling](https://throwtheswitch.org/ceedling). Please note that -these examples are meant to show how the build process works. They have -failing tests ON PURPOSE to show what that would look like. Don't be alarmed. ;) diff --git a/components/testframework/libs/cmock/docs/ThrowTheSwitchCodingStandard.md b/components/testframework/libs/cmock/docs/ThrowTheSwitchCodingStandard.md deleted file mode 100644 index a85adef3d..000000000 --- a/components/testframework/libs/cmock/docs/ThrowTheSwitchCodingStandard.md +++ /dev/null @@ -1,207 +0,0 @@ -# ThrowTheSwitch.org Coding Standard - -Hi. Welcome to the coding standard for ThrowTheSwitch.org. For the most part, -we try to follow these standards to unify our contributors' code into a cohesive -unit (puns intended). You might find places where these standards aren't -followed. We're not perfect. Please be polite where you notice these discrepancies -and we'll try to be polite when we notice yours. - -;) - - -## Why Have A Coding Standard? - -Being consistent makes code easier to understand. We've made an attempt to keep -our standard simple because we also believe that we can only expect someone to -follow something that is understandable. Please do your best. - - -## Our Philosophy - -Before we get into details on syntax, let's take a moment to talk about our -vision for these tools. We're C developers and embedded software developers. -These tools are great to test any C code, but catering to embedded software has -made us more tolerant of compiler quirks. There are a LOT of quirky compilers -out there. By quirky I mean "doesn't follow standards because they feel like -they have a license to do as they wish." - -Our philosophy is "support every compiler we can". Most often, this means that -we aim for writing C code that is standards compliant (often C89... that seems -to be a sweet spot that is almost always compatible). But it also means these -tools are tolerant of things that aren't common. Some that aren't even -compliant. There are configuration options to override the size of standard -types. There are configuration options to force Unity to not use certain -standard library functions. A lot of Unity is configurable and we have worked -hard to make it not TOO ugly in the process. - -Similarly, our tools that parse C do their best. They aren't full C parsers -(yet) and, even if they were, they would still have to accept non-standard -additions like gcc extensions or specifying `@0x1000` to force a variable to -compile to a particular location. It's just what we do, because we like -everything to Just Work™. - -Speaking of having things Just Work™, that's our second philosophy. By that, we -mean that we do our best to have EVERY configuration option have a logical -default. We believe that if you're working with a simple compiler and target, -you shouldn't need to configure very much... we try to make the tools guess as -much as they can, but give the user the power to override it when it's wrong. - - -## Naming Things - -Let's talk about naming things. Programming is all about naming things. We name -files, functions, variables, and so much more. While we're not always going to -find the best name for something, we actually put quite a bit of effort into -finding *What Something WANTS to be Called*™. - -When naming things, we more or less follow this hierarchy, the first being the -most important to us (but we do all four whenever possible): -1. Readable -2. Descriptive -3. Consistent -4. Memorable - - -#### Readable - -We want to read our code. This means we like names and flow that are more -naturally read. We try to avoid double negatives. We try to avoid cryptic -abbreviations (sticking to ones we feel are common). - - -#### Descriptive - -We like descriptive names for things, especially functions and variables. -Finding the right name for something is an important endeavor. You might notice -from poking around our code that this often results in names that are a little -longer than the average. Guilty. We're okay with a tiny bit more typing if it -means our code is easier to understand. - -There are two exceptions to this rule that we also stick to as religiously as -possible: - -First, while we realize hungarian notation (and similar systems for encoding -type information into variable names) is providing a more descriptive name, we -feel that (for the average developer) it takes away from readability and -therefore is to be avoided. - -Second, loop counters and other local throw-away variables often have a purpose -which is obvious. There's no need, therefore, to get carried away with complex -naming. We find i, j, and k are better loop counters than loopCounterVar or -whatnot. We only break this rule when we see that more description could improve -understanding of an algorithm. - - -#### Consistent - -We like consistency, but we're not really obsessed with it. We try to name our -configuration macros in a consistent fashion... you'll notice a repeated use of -UNITY_EXCLUDE_BLAH or UNITY_USES_BLAH macros. This helps users avoid having to -remember each macro's details. - - -#### Memorable - -Where ever it doesn't violate the above principles, we try to apply memorable -names. Sometimes this means using something that is simply descriptive, but -often we strive for descriptive AND unique... we like quirky names that stand -out in our memory and are easier to search for. Take a look through the file -names in Ceedling and you'll get a good idea of what we are talking about here. -Why use preprocess when you can use preprocessinator? Or what better describes a -module in charge of invoking tasks during releases than release_invoker? Don't -get carried away. The names are still descriptive and fulfill the above -requirements, but they don't feel stale. - - -## C and C++ Details - -We don't really want to add to the style battles out there. Tabs or spaces? -How many spaces? Where do the braces go? These are age-old questions that will -never be answered... or at least not answered in a way that will make everyone -happy. - -We've decided on our own style preferences. If you'd like to contribute to these -projects (and we hope that you do), then we ask if you do your best to follow -the same. It will only hurt a little. We promise. - - -#### Whitespace - -Our C-style is to use spaces and to use 4 of them per indent level. It's a nice -power-of-2 number that looks decent on a wide screen. We have no more reason -than that. We break that rule when we have lines that wrap (macros or function -arguments or whatnot). When that happens, we like to indent further to line -things up in nice tidy columns. - -```C - if (stuff_happened) - { - do_something(); - } -``` - - -#### Case - -- Files - all lower case with underscores. -- Variables - all lower case with underscores -- Macros - all caps with underscores. -- Typedefs - all caps with underscores. (also ends with _T). -- Functions - camel cased. Usually named ModuleName_FuncName -- Constants and Globals - camel cased. - - -#### Braces - -The left brace is on the next line after the declaration. The right brace is -directly below that. Everything in between in indented one level. If you're -catching an error and you have a one-line, go ahead and to it on the same line. - -```C - while (blah) - { - //Like so. Even if only one line, we use braces. - } -``` - - -#### Comments - -Do you know what we hate? Old-school C block comments. BUT, we're using them -anyway. As we mentioned, our goal is to support every compiler we can, -especially embedded compilers. There are STILL C compilers out there that only -support old-school block comments. So that is what we're using. We apologize. We -think they are ugly too. - - -## Ruby Details - -Is there really such thing as a Ruby coding standard? Ruby is such a free form -language, it seems almost sacrilegious to suggest that people should comply to -one method! We'll keep it really brief! - - -#### Whitespace - -Our Ruby style is to use spaces and to use 2 of them per indent level. It's a -nice power-of-2 number that really grooves with Ruby's compact style. We have no -more reason than that. We break that rule when we have lines that wrap. When -that happens, we like to indent further to line things up in nice tidy columns. - - -#### Case - -- Files - all lower case with underscores. -- Variables - all lower case with underscores -- Classes, Modules, etc - Camel cased. -- Functions - all lower case with underscores -- Constants - all upper case with underscores - - -## Documentation - -Egad. Really? We use markdown and we like pdf files because they can be made to -look nice while still being portable. Good enough? - - -*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* diff --git a/components/testframework/libs/cmock/examples/make_example/Makefile b/components/testframework/libs/cmock/examples/make_example/Makefile deleted file mode 100644 index a0fe53227..000000000 --- a/components/testframework/libs/cmock/examples/make_example/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -CC ?= gcc -export BUILD_DIR ?= ./build -export SRC_DIR ?= ./src -export TEST_DIR ?= ./test -export TEST_BUILD_DIR ?= ${BUILD_DIR}/test -TEST_MAKEFILE = ${TEST_BUILD_DIR}/MakefileTestSupport -OBJ ?= ${BUILD_DIR}/obj -OBJ_DIR = ${OBJ} - -default: all - -all: setup test ${BUILD_DIR}/main run - -setup: - mkdir -p ${BUILD_DIR} - mkdir -p ${OBJ} - ruby ../../scripts/create_makefile.rb --silent - -clean: - rm -rf ${BUILD_DIR} - -${BUILD_DIR}/main: ${SRC_DIR}/main.c ${SRC_DIR}/foo.c - ${CC} $< -o $@ - -run: - ./build/main || true - -test: setup - --include ${TEST_MAKEFILE} diff --git a/components/testframework/libs/cmock/examples/make_example/src/foo.c b/components/testframework/libs/cmock/examples/make_example/src/foo.c deleted file mode 100644 index 5490203d1..000000000 --- a/components/testframework/libs/cmock/examples/make_example/src/foo.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "foo.h" - -void foo_init(void) -{ -} diff --git a/components/testframework/libs/cmock/examples/make_example/src/foo.h b/components/testframework/libs/cmock/examples/make_example/src/foo.h deleted file mode 100644 index 3d2b5fba6..000000000 --- a/components/testframework/libs/cmock/examples/make_example/src/foo.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef _foo_h - -void foo_init(void); - -#endif diff --git a/components/testframework/libs/cmock/examples/make_example/src/main.c b/components/testframework/libs/cmock/examples/make_example/src/main.c deleted file mode 100644 index 52e86795a..000000000 --- a/components/testframework/libs/cmock/examples/make_example/src/main.c +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include "foo.h" - -int real_main(int argc, char ** argv) -{ - printf("Hello world!\n"); - return 0; -} - -#ifndef TEST -int main(int argc, char ** argv) -{ - return real_main(argc, argv); -} -#endif diff --git a/components/testframework/libs/cmock/examples/make_example/test/test_foo.c b/components/testframework/libs/cmock/examples/make_example/test/test_foo.c deleted file mode 100644 index 80f17f337..000000000 --- a/components/testframework/libs/cmock/examples/make_example/test/test_foo.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "unity.h" -#include "foo.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void test_foo_init_should_initialize_multiplier() -{ - foo_init(); - - TEST_ASSERT_FALSE(1); -} diff --git a/components/testframework/libs/cmock/examples/make_example/test/test_main.c b/components/testframework/libs/cmock/examples/make_example/test/test_main.c deleted file mode 100644 index f9b674906..000000000 --- a/components/testframework/libs/cmock/examples/make_example/test/test_main.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "unity.h" -#include "mock_foo.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void test_main_should_initialize_foo(void) -{ - TEST_IGNORE_MESSAGE("TODO: Implement main!"); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/gcc.yml b/components/testframework/libs/cmock/examples/temp_sensor/gcc.yml deleted file mode 100644 index f41bf07d3..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/gcc.yml +++ /dev/null @@ -1,44 +0,0 @@ -compiler: - path: gcc - source_path: 'src/' - unit_tests_path: &unit_tests_path 'test/' - build_path: &build_path 'build/' - options: - - -c - includes: - prefix: '-I' - items: - - 'src/' - - '../../src/' - - '../../vendor/unity/src/' - - '../../vendor/unity/examples/example_3/helper/' - - './build/mocks/' - - *unit_tests_path - defines: - prefix: '-D' - items: - - __monitor - object_files: - prefix: '-o' - extension: '.o' - destination: *build_path -linker: - path: gcc - options: - - -lm - includes: - prefix: '-I' - object_files: - path: *build_path - extension: '.o' - bin_files: - prefix: '-o' - extension: '.exe' - destination: *build_path -:cmock: - :plugins: [] - :includes: - - Types.h - :mock_path: ./build/mocks - -colour: true diff --git a/components/testframework/libs/cmock/examples/temp_sensor/iar_v4.yml b/components/testframework/libs/cmock/examples/temp_sensor/iar_v4.yml deleted file mode 100644 index 762175215..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/iar_v4.yml +++ /dev/null @@ -1,92 +0,0 @@ -tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\' -compiler: - path: [*tools_root, 'arm\bin\iccarm.exe'] - source_path: 'src\' - unit_tests_path: &unit_tests_path 'test\' - build_path: &build_path 'build\' - options: - - --dlib_config - - [*tools_root, 'arm\lib\dl4tptinl8n.h'] - - -z3 - - --no_cse - - --no_unroll - - --no_inline - - --no_code_motion - - --no_tbaa - - --no_clustering - - --no_scheduling - - --debug - - --cpu_mode thumb - - --endian little - - --cpu ARM7TDMI - - --stack_align 4 - - --interwork - - -e - - --silent - - --warnings_are_errors - - --fpu None - - --diag_suppress Pa050 - includes: - prefix: '-I' - items: - - 'src/' - - '../../src/' - - '../../vendor/unity/src/' - - '../../vendor/unity/examples/example_3/helper/' - - './build/mocks/' - - [*tools_root, 'arm\inc\'] - - *unit_tests_path - defines: - prefix: '-D' - items: - object_files: - prefix: '-o' - extension: '.r79' - destination: *build_path -linker: - path: [*tools_root, 'common\bin\xlink.exe'] - options: - - -rt - - [*tools_root, 'arm\lib\dl4tptinl8n.r79'] - - -D_L_EXTMEM_START=0 - - -D_L_EXTMEM_SIZE=0 - - -D_L_HEAP_SIZE=120 - - -D_L_STACK_SIZE=32 - - -e_small_write=_formatted_write - - -s - - __program_start - - -f - - [*tools_root, '\arm\config\lnkarm.xcl'] - includes: - prefix: '-I' - items: - - [*tools_root, 'arm\config\'] - - [*tools_root, 'arm\lib\'] - object_files: - path: *build_path - extension: '.r79' - bin_files: - prefix: '-o' - extension: '.d79' - destination: *build_path -simulator: - path: [*tools_root, 'common\bin\CSpyBat.exe'] - pre_support: - - --silent - - [*tools_root, 'arm\bin\armproc.dll'] - - [*tools_root, 'arm\bin\armsim.dll'] - post_support: - - --plugin - - [*tools_root, 'arm\bin\armbat.dll'] - - --backend - - -B - - -p - - [*tools_root, 'arm\config\ioat91sam7X256.ddf'] - - -d - - sim -:cmock: - :plugins: [] - :includes: - - Types.h - :mock_path: ./build/mocks - diff --git a/components/testframework/libs/cmock/examples/temp_sensor/iar_v5.yml b/components/testframework/libs/cmock/examples/temp_sensor/iar_v5.yml deleted file mode 100644 index 01786496a..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/iar_v5.yml +++ /dev/null @@ -1,81 +0,0 @@ -tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 5.3\' -compiler: - path: [*tools_root, 'arm\bin\iccarm.exe'] - source_path: 'src\' - unit_tests_path: &unit_tests_path 'test\' - build_path: &build_path 'build\' - options: - - --dlib_config - - [*tools_root, 'arm\inc\DLib_Config_Normal.h'] - - --no_cse - - --no_unroll - - --no_inline - - --no_code_motion - - --no_tbaa - - --no_clustering - - --no_scheduling - - --debug - - --cpu_mode thumb - - --endian=little - - --cpu=ARM7TDMI - - --interwork - - --warnings_are_errors - - --fpu=None - - --diag_suppress=Pa050 - - --diag_suppress=Pe111 - - -e - - -On - includes: - prefix: '-I' - items: - - 'src/' - - '../../src/' - - '../../vendor/unity/src/' - - '../../vendor/unity/examples/example_3/helper/' - - './build/mocks/' - - [*tools_root, 'arm\inc\'] - - *unit_tests_path - defines: - prefix: '-D' - items: - object_files: - prefix: '-o' - extension: '.r79' - destination: *build_path -linker: - path: [*tools_root, 'arm\bin\ilinkarm.exe'] - options: - - --redirect _Printf=_PrintfLarge - - --redirect _Scanf=_ScanfSmall - - --semihosting - - --entry __iar_program_start - - --config - - [*tools_root, 'arm\config\generic.icf'] - object_files: - path: *build_path - extension: '.o' - bin_files: - prefix: '-o' - extension: '.out' - destination: *build_path -simulator: - path: [*tools_root, 'common\bin\CSpyBat.exe'] - pre_support: - - --silent - - [*tools_root, 'arm\bin\armproc.dll'] - - [*tools_root, 'arm\bin\armsim.dll'] - post_support: - - --plugin - - [*tools_root, 'arm\bin\armbat.dll'] - - --backend - - -B - - -p - - [*tools_root, 'arm\config\debugger\atmel\ioat91sam7X256.ddf'] - - -d - - sim -:cmock: - :plugins: [] - :includes: - - Types.h - :mock_path: ./build/mocks - diff --git a/components/testframework/libs/cmock/examples/temp_sensor/rakefile.rb b/components/testframework/libs/cmock/examples/temp_sensor/rakefile.rb deleted file mode 100644 index 06ab1d51d..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/rakefile.rb +++ /dev/null @@ -1,42 +0,0 @@ -HERE = __dir__ + '/' - -require 'rake' -require 'rake/clean' -require 'rake/testtask' -require './rakefile_helper' - -include RakefileHelpers - -REQUIRED_DIRS = ['./build', './build/mocks'].freeze -REQUIRED_DIRS.each do |v| - directory v -end - -# Load default configuration, for now -DEFAULT_CONFIG_FILE = 'gcc.yml'.freeze -configure_toolchain(DEFAULT_CONFIG_FILE) - -task :unit do - run_tests(unit_test_files) -end - -desc 'Generate test summary' -task :summary do - report_summary -end - -desc 'Build and test Unity' -task :all => %i[clean unit summary] -task :default => REQUIRED_DIRS + %i[clobber all] -task :ci => [:default] -task :cruise => [:default] - -desc 'Load configuration' -task :config, :config_file do |_t, args| - configure_toolchain(args[:config_file]) -end - -desc 'Return error on Failures' -task :strict do - $return_error_on_failures = true -end diff --git a/components/testframework/libs/cmock/examples/temp_sensor/rakefile_helper.rb b/components/testframework/libs/cmock/examples/temp_sensor/rakefile_helper.rb deleted file mode 100644 index ce401d371..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/rakefile_helper.rb +++ /dev/null @@ -1,268 +0,0 @@ -require 'yaml' -require 'fileutils' -require '../../vendor/unity/auto/unity_test_summary' -require '../../vendor/unity/auto/generate_test_runner' -require '../../vendor/unity/auto/colour_reporter' - -module RakefileHelpers - $return_error_on_failures = false - - C_EXTENSION = '.c'.freeze - - def load_configuration(config_file) - $cfg_file = config_file - $cfg = YAML.load(File.read($cfg_file)) - $colour_output = false unless $cfg['colour'] - end - - def configure_clean - CLEAN.include($cfg['compiler']['build_path'] + '*.*') unless $cfg['compiler']['build_path'].nil? - end - - def configure_toolchain(config_file = DEFAULT_CONFIG_FILE) - config_file += '.yml' unless config_file =~ /\.yml$/ - load_configuration(config_file) - configure_clean - end - - def unit_test_files - path = $cfg['compiler']['unit_tests_path'] + 'Test*' + C_EXTENSION - path.tr!('\\', '/') - FileList.new(path) - end - - def local_include_dirs - include_dirs = $cfg['compiler']['includes']['items'].dup - include_dirs.delete_if { |dir| dir.is_a?(Array) } - include_dirs - end - - def extract_headers(filename) - includes = [] - lines = File.readlines(filename) - lines.each do |line| - m = line.match(/^\s*#include\s+\"\s*(.+\.[hH])\s*\"/) - unless m.nil? - includes << m[1] - end - end - includes - end - - def find_source_file(header, paths) - paths.each do |dir| - src_file = dir + header.ext(C_EXTENSION) - if File.exist?(src_file) - return src_file - end - end - nil - end - - def tackit(strings) - case strings - when Array - "\"#{strings.join}\"" - when /^-/ - strings - when /\s/ - "\"#{strings}\"" - else - strings - end - end - - def squash(prefix, items) - result = '' - items.each { |item| result += " #{prefix}#{tackit(item)}" } - result - end - - def build_compiler_fields - command = tackit($cfg['compiler']['path']) - defines = if $cfg['compiler']['defines']['items'].nil? - '' - else - squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items']) - end - options = squash('', $cfg['compiler']['options']) - includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items']) - includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) - { :command => command, :defines => defines, :options => options, :includes => includes } - end - - def compile(file, _defines = []) - compiler = build_compiler_fields - cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{compiler[:options]}#{compiler[:includes]} #{file} " \ - "#{$cfg['compiler']['object_files']['prefix']}#{$cfg['compiler']['object_files']['destination']}" - obj_file = "#{File.basename(file, C_EXTENSION)}#{$cfg['compiler']['object_files']['extension']}" - execute(cmd_str + obj_file) - obj_file - end - - def build_linker_fields - command = tackit($cfg['linker']['path']) - options = if $cfg['linker']['options'].nil? - '' - else - squash('', $cfg['linker']['options']) - end - includes = if $cfg['linker']['includes'].nil? || $cfg['linker']['includes']['items'].nil? - '' - else - squash($cfg['linker']['includes']['prefix'], $cfg['linker']['includes']['items']) - end - includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) - { :command => command, :options => options, :includes => includes } - end - - def link_it(exe_name, obj_list) - linker = build_linker_fields - cmd_str = "#{linker[:command]}#{linker[:includes]} " + - (obj_list.map { |obj| "#{$cfg['linker']['object_files']['path']}#{obj} " }).join + - $cfg['linker']['bin_files']['prefix'] + ' ' + - $cfg['linker']['bin_files']['destination'] + - exe_name + $cfg['linker']['bin_files']['extension'] + " #{linker[:options]}" - execute(cmd_str) - end - - def build_simulator_fields - return nil if $cfg['simulator'].nil? - - command = if $cfg['simulator']['path'].nil? - '' - else - (tackit($cfg['simulator']['path']) + ' ') - end - pre_support = if $cfg['simulator']['pre_support'].nil? - '' - else - squash('', $cfg['simulator']['pre_support']) - end - post_support = if $cfg['simulator']['post_support'].nil? - '' - else - squash('', $cfg['simulator']['post_support']) - end - { :command => command, :pre_support => pre_support, :post_support => post_support } - end - - def execute(command_string, verbose = true, ok_to_fail = false) - report command_string - output = `#{command_string}`.chomp - report(output) if verbose && !output.nil? && !output.empty? - unless (!$?.nil? && $?.exitstatus.zero?) || ok_to_fail - raise "Command failed. (Returned #{$?.exitstatus})" - end - - output - end - - def report_summary - summary = UnityTestSummary.new - summary.root = HERE - results_glob = "#{$cfg['compiler']['build_path']}*.test*" - results_glob.tr!('\\', '/') - results = Dir[results_glob] - summary.targets = results - report summary.run - raise 'There were failures' if (summary.failures > 0) && $return_error_on_failures - end - - def run_tests(test_files) - report 'Running system tests...' - - # Tack on TEST define for compiling unit tests - load_configuration($cfg_file) - test_defines = ['TEST'] - $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? - $cfg['compiler']['defines']['items'] << 'TEST' - - include_dirs = local_include_dirs - - # Build and execute each unit test - test_files.each do |test| - obj_list = [] - - # Detect dependencies and build required required modules - header_list = (extract_headers(test) + ['cmock.h'] + [$cfg[:cmock][:unity_helper_path]]).compact.uniq - header_list.each do |header| - # create mocks if needed - next unless header =~ /Mock/ - - require '../../lib/cmock.rb' - @cmock ||= CMock.new($cfg_file) - @cmock.setup_mocks([$cfg['compiler']['source_path'] + header.gsub('Mock', '')]) - end - - # compile all mocks - header_list.each do |header| - # compile source file header if it exists - src_file = find_source_file(header, include_dirs) - unless src_file.nil? - obj_list << compile(src_file, test_defines) - end - end - - # Build the test runner (generate if configured to do so) - test_base = File.basename(test, C_EXTENSION) - runner_name = test_base + '_Runner.c' - if $cfg['compiler']['runner_path'].nil? - runner_path = $cfg['compiler']['build_path'] + runner_name - test_gen = UnityTestRunnerGenerator.new($cfg_file) - test_gen.run(test, runner_path) - else - runner_path = $cfg['compiler']['runner_path'] + runner_name - end - - obj_list << compile(runner_path, test_defines) - - # Build the test module - obj_list << compile(test, test_defines) - - # Link the test executable - link_it(test_base, obj_list) - - # Execute unit test and generate results file - simulator = build_simulator_fields - executable = $cfg['linker']['bin_files']['destination'] + test_base + $cfg['linker']['bin_files']['extension'] - cmd_str = if simulator.nil? - executable - else - "#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}" - end - output = execute(cmd_str, true, true) - test_results = $cfg['compiler']['build_path'] + test_base - test_results += if output.match(/OK$/m).nil? - '.testfail' - else - '.testpass' - end - File.open(test_results, 'w') { |f| f.print output } - end - end - - def build_application(main) - report 'Building application...' - - obj_list = [] - load_configuration($cfg_file) - main_path = $cfg['compiler']['source_path'] + main + C_EXTENSION - - # Detect dependencies and build required required modules - include_dirs = local_include_dirs - extract_headers(main_path).each do |header| - src_file = find_source_file(header, include_dirs) - unless src_file.nil? - obj_list << compile(src_file) - end - end - - # Build the main source file - main_base = File.basename(main_path, C_EXTENSION) - obj_list << compile(main_path) - - # Create the executable - link_it(main_base, obj_list) - end -end diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AT91SAM7X256.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AT91SAM7X256.h deleted file mode 100644 index baa031398..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AT91SAM7X256.h +++ /dev/null @@ -1,2556 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h -// Object : AT91SAM7X256 definitions -// Generated : AT91 SW Application Group 01/16/2006 (16:36:21) -// -// CVS Reference : /AT91SAM7X256.pl/1.15/Wed Nov 2 13:56:49 2005// -// CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// -// CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// -// CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// -// CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// -// CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// -// CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// -// CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// -// CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// -// CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// -// CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// -// CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// -// CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// -// CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// -// CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// -// CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// -// CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// -// CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// -// CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// -// CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// -// CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// -// CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// -// CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// -// ---------------------------------------------------------------------------- - -#ifndef AT91SAM7X256_H -#define AT91SAM7X256_H - -typedef volatile unsigned int AT91_REG;// Hardware register definition - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR System Peripherals -// ***************************************************************************** -typedef struct _AT91S_SYS { - AT91_REG AIC_SMR[32]; // Source Mode Register - AT91_REG AIC_SVR[32]; // Source Vector Register - AT91_REG AIC_IVR; // IRQ Vector Register - AT91_REG AIC_FVR; // FIQ Vector Register - AT91_REG AIC_ISR; // Interrupt Status Register - AT91_REG AIC_IPR; // Interrupt Pending Register - AT91_REG AIC_IMR; // Interrupt Mask Register - AT91_REG AIC_CISR; // Core Interrupt Status Register - AT91_REG Reserved0[2]; // - AT91_REG AIC_IECR; // Interrupt Enable Command Register - AT91_REG AIC_IDCR; // Interrupt Disable Command Register - AT91_REG AIC_ICCR; // Interrupt Clear Command Register - AT91_REG AIC_ISCR; // Interrupt Set Command Register - AT91_REG AIC_EOICR; // End of Interrupt Command Register - AT91_REG AIC_SPU; // Spurious Vector Register - AT91_REG AIC_DCR; // Debug Control Register (Protect) - AT91_REG Reserved1[1]; // - AT91_REG AIC_FFER; // Fast Forcing Enable Register - AT91_REG AIC_FFDR; // Fast Forcing Disable Register - AT91_REG AIC_FFSR; // Fast Forcing Status Register - AT91_REG Reserved2[45]; // - AT91_REG DBGU_CR; // Control Register - AT91_REG DBGU_MR; // Mode Register - AT91_REG DBGU_IER; // Interrupt Enable Register - AT91_REG DBGU_IDR; // Interrupt Disable Register - AT91_REG DBGU_IMR; // Interrupt Mask Register - AT91_REG DBGU_CSR; // Channel Status Register - AT91_REG DBGU_RHR; // Receiver Holding Register - AT91_REG DBGU_THR; // Transmitter Holding Register - AT91_REG DBGU_BRGR; // Baud Rate Generator Register - AT91_REG Reserved3[7]; // - AT91_REG DBGU_CIDR; // Chip ID Register - AT91_REG DBGU_EXID; // Chip ID Extension Register - AT91_REG DBGU_FNTR; // Force NTRST Register - AT91_REG Reserved4[45]; // - AT91_REG DBGU_RPR; // Receive Pointer Register - AT91_REG DBGU_RCR; // Receive Counter Register - AT91_REG DBGU_TPR; // Transmit Pointer Register - AT91_REG DBGU_TCR; // Transmit Counter Register - AT91_REG DBGU_RNPR; // Receive Next Pointer Register - AT91_REG DBGU_RNCR; // Receive Next Counter Register - AT91_REG DBGU_TNPR; // Transmit Next Pointer Register - AT91_REG DBGU_TNCR; // Transmit Next Counter Register - AT91_REG DBGU_PTCR; // PDC Transfer Control Register - AT91_REG DBGU_PTSR; // PDC Transfer Status Register - AT91_REG Reserved5[54]; // - AT91_REG PIOA_PER; // PIO Enable Register - AT91_REG PIOA_PDR; // PIO Disable Register - AT91_REG PIOA_PSR; // PIO Status Register - AT91_REG Reserved6[1]; // - AT91_REG PIOA_OER; // Output Enable Register - AT91_REG PIOA_ODR; // Output Disable Registerr - AT91_REG PIOA_OSR; // Output Status Register - AT91_REG Reserved7[1]; // - AT91_REG PIOA_IFER; // Input Filter Enable Register - AT91_REG PIOA_IFDR; // Input Filter Disable Register - AT91_REG PIOA_IFSR; // Input Filter Status Register - AT91_REG Reserved8[1]; // - AT91_REG PIOA_SODR; // Set Output Data Register - AT91_REG PIOA_CODR; // Clear Output Data Register - AT91_REG PIOA_ODSR; // Output Data Status Register - AT91_REG PIOA_PDSR; // Pin Data Status Register - AT91_REG PIOA_IER; // Interrupt Enable Register - AT91_REG PIOA_IDR; // Interrupt Disable Register - AT91_REG PIOA_IMR; // Interrupt Mask Register - AT91_REG PIOA_ISR; // Interrupt Status Register - AT91_REG PIOA_MDER; // Multi-driver Enable Register - AT91_REG PIOA_MDDR; // Multi-driver Disable Register - AT91_REG PIOA_MDSR; // Multi-driver Status Register - AT91_REG Reserved9[1]; // - AT91_REG PIOA_PPUDR; // Pull-up Disable Register - AT91_REG PIOA_PPUER; // Pull-up Enable Register - AT91_REG PIOA_PPUSR; // Pull-up Status Register - AT91_REG Reserved10[1]; // - AT91_REG PIOA_ASR; // Select A Register - AT91_REG PIOA_BSR; // Select B Register - AT91_REG PIOA_ABSR; // AB Select Status Register - AT91_REG Reserved11[9]; // - AT91_REG PIOA_OWER; // Output Write Enable Register - AT91_REG PIOA_OWDR; // Output Write Disable Register - AT91_REG PIOA_OWSR; // Output Write Status Register - AT91_REG Reserved12[85]; // - AT91_REG PIOB_PER; // PIO Enable Register - AT91_REG PIOB_PDR; // PIO Disable Register - AT91_REG PIOB_PSR; // PIO Status Register - AT91_REG Reserved13[1]; // - AT91_REG PIOB_OER; // Output Enable Register - AT91_REG PIOB_ODR; // Output Disable Registerr - AT91_REG PIOB_OSR; // Output Status Register - AT91_REG Reserved14[1]; // - AT91_REG PIOB_IFER; // Input Filter Enable Register - AT91_REG PIOB_IFDR; // Input Filter Disable Register - AT91_REG PIOB_IFSR; // Input Filter Status Register - AT91_REG Reserved15[1]; // - AT91_REG PIOB_SODR; // Set Output Data Register - AT91_REG PIOB_CODR; // Clear Output Data Register - AT91_REG PIOB_ODSR; // Output Data Status Register - AT91_REG PIOB_PDSR; // Pin Data Status Register - AT91_REG PIOB_IER; // Interrupt Enable Register - AT91_REG PIOB_IDR; // Interrupt Disable Register - AT91_REG PIOB_IMR; // Interrupt Mask Register - AT91_REG PIOB_ISR; // Interrupt Status Register - AT91_REG PIOB_MDER; // Multi-driver Enable Register - AT91_REG PIOB_MDDR; // Multi-driver Disable Register - AT91_REG PIOB_MDSR; // Multi-driver Status Register - AT91_REG Reserved16[1]; // - AT91_REG PIOB_PPUDR; // Pull-up Disable Register - AT91_REG PIOB_PPUER; // Pull-up Enable Register - AT91_REG PIOB_PPUSR; // Pull-up Status Register - AT91_REG Reserved17[1]; // - AT91_REG PIOB_ASR; // Select A Register - AT91_REG PIOB_BSR; // Select B Register - AT91_REG PIOB_ABSR; // AB Select Status Register - AT91_REG Reserved18[9]; // - AT91_REG PIOB_OWER; // Output Write Enable Register - AT91_REG PIOB_OWDR; // Output Write Disable Register - AT91_REG PIOB_OWSR; // Output Write Status Register - AT91_REG Reserved19[341]; // - AT91_REG PMC_SCER; // System Clock Enable Register - AT91_REG PMC_SCDR; // System Clock Disable Register - AT91_REG PMC_SCSR; // System Clock Status Register - AT91_REG Reserved20[1]; // - AT91_REG PMC_PCER; // Peripheral Clock Enable Register - AT91_REG PMC_PCDR; // Peripheral Clock Disable Register - AT91_REG PMC_PCSR; // Peripheral Clock Status Register - AT91_REG Reserved21[1]; // - AT91_REG PMC_MOR; // Main Oscillator Register - AT91_REG PMC_MCFR; // Main Clock Frequency Register - AT91_REG Reserved22[1]; // - AT91_REG PMC_PLLR; // PLL Register - AT91_REG PMC_MCKR; // Master Clock Register - AT91_REG Reserved23[3]; // - AT91_REG PMC_PCKR[4]; // Programmable Clock Register - AT91_REG Reserved24[4]; // - AT91_REG PMC_IER; // Interrupt Enable Register - AT91_REG PMC_IDR; // Interrupt Disable Register - AT91_REG PMC_SR; // Status Register - AT91_REG PMC_IMR; // Interrupt Mask Register - AT91_REG Reserved25[36]; // - AT91_REG RSTC_RCR; // Reset Control Register - AT91_REG RSTC_RSR; // Reset Status Register - AT91_REG RSTC_RMR; // Reset Mode Register - AT91_REG Reserved26[5]; // - AT91_REG RTTC_RTMR; // Real-time Mode Register - AT91_REG RTTC_RTAR; // Real-time Alarm Register - AT91_REG RTTC_RTVR; // Real-time Value Register - AT91_REG RTTC_RTSR; // Real-time Status Register - AT91_REG PITC_PIMR; // Period Interval Mode Register - AT91_REG PITC_PISR; // Period Interval Status Register - AT91_REG PITC_PIVR; // Period Interval Value Register - AT91_REG PITC_PIIR; // Period Interval Image Register - AT91_REG WDTC_WDCR; // Watchdog Control Register - AT91_REG WDTC_WDMR; // Watchdog Mode Register - AT91_REG WDTC_WDSR; // Watchdog Status Register - AT91_REG Reserved27[5]; // - AT91_REG VREG_MR; // Voltage Regulator Mode Register -} AT91S_SYS, *AT91PS_SYS; - - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Advanced Interrupt Controller -// ***************************************************************************** -typedef struct _AT91S_AIC { - AT91_REG AIC_SMR[32]; // Source Mode Register - AT91_REG AIC_SVR[32]; // Source Vector Register - AT91_REG AIC_IVR; // IRQ Vector Register - AT91_REG AIC_FVR; // FIQ Vector Register - AT91_REG AIC_ISR; // Interrupt Status Register - AT91_REG AIC_IPR; // Interrupt Pending Register - AT91_REG AIC_IMR; // Interrupt Mask Register - AT91_REG AIC_CISR; // Core Interrupt Status Register - AT91_REG Reserved0[2]; // - AT91_REG AIC_IECR; // Interrupt Enable Command Register - AT91_REG AIC_IDCR; // Interrupt Disable Command Register - AT91_REG AIC_ICCR; // Interrupt Clear Command Register - AT91_REG AIC_ISCR; // Interrupt Set Command Register - AT91_REG AIC_EOICR; // End of Interrupt Command Register - AT91_REG AIC_SPU; // Spurious Vector Register - AT91_REG AIC_DCR; // Debug Control Register (Protect) - AT91_REG Reserved1[1]; // - AT91_REG AIC_FFER; // Fast Forcing Enable Register - AT91_REG AIC_FFDR; // Fast Forcing Disable Register - AT91_REG AIC_FFSR; // Fast Forcing Status Register -} AT91S_AIC, *AT91PS_AIC; - -// -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- -#define AT91C_AIC_PRIOR ((unsigned int) 0x7 << 0) // (AIC) Priority Level -#define AT91C_AIC_PRIOR_LOWEST ((unsigned int) 0x0) // (AIC) Lowest priority level -#define AT91C_AIC_PRIOR_HIGHEST ((unsigned int) 0x7) // (AIC) Highest priority level -#define AT91C_AIC_SRCTYPE ((unsigned int) 0x3 << 5) // (AIC) Interrupt Source Type -#define AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL ((unsigned int) 0x0 << 5) // (AIC) External Sources Code Label Low-level Sensitive -#define AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL ((unsigned int) 0x0 << 5) // (AIC) Internal Sources Code Label High-level Sensitive -#define AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE ((unsigned int) 0x1 << 5) // (AIC) Internal Sources Code Label Positive Edge triggered -#define AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE ((unsigned int) 0x1 << 5) // (AIC) External Sources Code Label Negative Edge triggered -#define AT91C_AIC_SRCTYPE_HIGH_LEVEL ((unsigned int) 0x2 << 5) // (AIC) Internal Or External Sources Code Label High-level Sensitive -#define AT91C_AIC_SRCTYPE_POSITIVE_EDGE ((unsigned int) 0x3 << 5) // (AIC) Internal Or External Sources Code Label Positive Edge triggered -// -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- -#define AT91C_AIC_NFIQ ((unsigned int) 0x1 << 0) // (AIC) NFIQ Status -#define AT91C_AIC_NIRQ ((unsigned int) 0x1 << 1) // (AIC) NIRQ Status -// -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- -#define AT91C_AIC_DCR_PROT ((unsigned int) 0x1 << 0) // (AIC) Protection Mode -#define AT91C_AIC_DCR_GMSK ((unsigned int) 0x1 << 1) // (AIC) General Mask - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Peripheral DMA Controller -// ***************************************************************************** -typedef struct _AT91S_PDC { - AT91_REG PDC_RPR; // Receive Pointer Register - AT91_REG PDC_RCR; // Receive Counter Register - AT91_REG PDC_TPR; // Transmit Pointer Register - AT91_REG PDC_TCR; // Transmit Counter Register - AT91_REG PDC_RNPR; // Receive Next Pointer Register - AT91_REG PDC_RNCR; // Receive Next Counter Register - AT91_REG PDC_TNPR; // Transmit Next Pointer Register - AT91_REG PDC_TNCR; // Transmit Next Counter Register - AT91_REG PDC_PTCR; // PDC Transfer Control Register - AT91_REG PDC_PTSR; // PDC Transfer Status Register -} AT91S_PDC, *AT91PS_PDC; - -// -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- -#define AT91C_PDC_RXTEN ((unsigned int) 0x1 << 0) // (PDC) Receiver Transfer Enable -#define AT91C_PDC_RXTDIS ((unsigned int) 0x1 << 1) // (PDC) Receiver Transfer Disable -#define AT91C_PDC_TXTEN ((unsigned int) 0x1 << 8) // (PDC) Transmitter Transfer Enable -#define AT91C_PDC_TXTDIS ((unsigned int) 0x1 << 9) // (PDC) Transmitter Transfer Disable -// -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Debug Unit -// ***************************************************************************** -typedef struct _AT91S_DBGU { - AT91_REG DBGU_CR; // Control Register - AT91_REG DBGU_MR; // Mode Register - AT91_REG DBGU_IER; // Interrupt Enable Register - AT91_REG DBGU_IDR; // Interrupt Disable Register - AT91_REG DBGU_IMR; // Interrupt Mask Register - AT91_REG DBGU_CSR; // Channel Status Register - AT91_REG DBGU_RHR; // Receiver Holding Register - AT91_REG DBGU_THR; // Transmitter Holding Register - AT91_REG DBGU_BRGR; // Baud Rate Generator Register - AT91_REG Reserved0[7]; // - AT91_REG DBGU_CIDR; // Chip ID Register - AT91_REG DBGU_EXID; // Chip ID Extension Register - AT91_REG DBGU_FNTR; // Force NTRST Register - AT91_REG Reserved1[45]; // - AT91_REG DBGU_RPR; // Receive Pointer Register - AT91_REG DBGU_RCR; // Receive Counter Register - AT91_REG DBGU_TPR; // Transmit Pointer Register - AT91_REG DBGU_TCR; // Transmit Counter Register - AT91_REG DBGU_RNPR; // Receive Next Pointer Register - AT91_REG DBGU_RNCR; // Receive Next Counter Register - AT91_REG DBGU_TNPR; // Transmit Next Pointer Register - AT91_REG DBGU_TNCR; // Transmit Next Counter Register - AT91_REG DBGU_PTCR; // PDC Transfer Control Register - AT91_REG DBGU_PTSR; // PDC Transfer Status Register -} AT91S_DBGU, *AT91PS_DBGU; - -// -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- -#define AT91C_US_RSTRX ((unsigned int) 0x1 << 2) // (DBGU) Reset Receiver -#define AT91C_US_RSTTX ((unsigned int) 0x1 << 3) // (DBGU) Reset Transmitter -#define AT91C_US_RXEN ((unsigned int) 0x1 << 4) // (DBGU) Receiver Enable -#define AT91C_US_RXDIS ((unsigned int) 0x1 << 5) // (DBGU) Receiver Disable -#define AT91C_US_TXEN ((unsigned int) 0x1 << 6) // (DBGU) Transmitter Enable -#define AT91C_US_TXDIS ((unsigned int) 0x1 << 7) // (DBGU) Transmitter Disable -#define AT91C_US_RSTSTA ((unsigned int) 0x1 << 8) // (DBGU) Reset Status Bits -// -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- -#define AT91C_US_PAR ((unsigned int) 0x7 << 9) // (DBGU) Parity type -#define AT91C_US_PAR_EVEN ((unsigned int) 0x0 << 9) // (DBGU) Even Parity -#define AT91C_US_PAR_ODD ((unsigned int) 0x1 << 9) // (DBGU) Odd Parity -#define AT91C_US_PAR_SPACE ((unsigned int) 0x2 << 9) // (DBGU) Parity forced to 0 (Space) -#define AT91C_US_PAR_MARK ((unsigned int) 0x3 << 9) // (DBGU) Parity forced to 1 (Mark) -#define AT91C_US_PAR_NONE ((unsigned int) 0x4 << 9) // (DBGU) No Parity -#define AT91C_US_PAR_MULTI_DROP ((unsigned int) 0x6 << 9) // (DBGU) Multi-drop mode -#define AT91C_US_CHMODE ((unsigned int) 0x3 << 14) // (DBGU) Channel Mode -#define AT91C_US_CHMODE_NORMAL ((unsigned int) 0x0 << 14) // (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. -#define AT91C_US_CHMODE_AUTO ((unsigned int) 0x1 << 14) // (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. -#define AT91C_US_CHMODE_LOCAL ((unsigned int) 0x2 << 14) // (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. -#define AT91C_US_CHMODE_REMOTE ((unsigned int) 0x3 << 14) // (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. -// -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- -#define AT91C_US_RXRDY ((unsigned int) 0x1 << 0) // (DBGU) RXRDY Interrupt -#define AT91C_US_TXRDY ((unsigned int) 0x1 << 1) // (DBGU) TXRDY Interrupt -#define AT91C_US_ENDRX ((unsigned int) 0x1 << 3) // (DBGU) End of Receive Transfer Interrupt -#define AT91C_US_ENDTX ((unsigned int) 0x1 << 4) // (DBGU) End of Transmit Interrupt -#define AT91C_US_OVRE ((unsigned int) 0x1 << 5) // (DBGU) Overrun Interrupt -#define AT91C_US_FRAME ((unsigned int) 0x1 << 6) // (DBGU) Framing Error Interrupt -#define AT91C_US_PARE ((unsigned int) 0x1 << 7) // (DBGU) Parity Error Interrupt -#define AT91C_US_TXEMPTY ((unsigned int) 0x1 << 9) // (DBGU) TXEMPTY Interrupt -#define AT91C_US_TXBUFE ((unsigned int) 0x1 << 11) // (DBGU) TXBUFE Interrupt -#define AT91C_US_RXBUFF ((unsigned int) 0x1 << 12) // (DBGU) RXBUFF Interrupt -#define AT91C_US_COMM_TX ((unsigned int) 0x1 << 30) // (DBGU) COMM_TX Interrupt -#define AT91C_US_COMM_RX ((unsigned int) 0x1 << 31) // (DBGU) COMM_RX Interrupt -// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- -// -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- -#define AT91C_US_FORCE_NTRST ((unsigned int) 0x1 << 0) // (DBGU) Force NTRST in JTAG - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Parallel Input Output Controler -// ***************************************************************************** -typedef struct _AT91S_PIO { - AT91_REG PIO_PER; // PIO Enable Register - AT91_REG PIO_PDR; // PIO Disable Register - AT91_REG PIO_PSR; // PIO Status Register - AT91_REG Reserved0[1]; // - AT91_REG PIO_OER; // Output Enable Register - AT91_REG PIO_ODR; // Output Disable Registerr - AT91_REG PIO_OSR; // Output Status Register - AT91_REG Reserved1[1]; // - AT91_REG PIO_IFER; // Input Filter Enable Register - AT91_REG PIO_IFDR; // Input Filter Disable Register - AT91_REG PIO_IFSR; // Input Filter Status Register - AT91_REG Reserved2[1]; // - AT91_REG PIO_SODR; // Set Output Data Register - AT91_REG PIO_CODR; // Clear Output Data Register - AT91_REG PIO_ODSR; // Output Data Status Register - AT91_REG PIO_PDSR; // Pin Data Status Register - AT91_REG PIO_IER; // Interrupt Enable Register - AT91_REG PIO_IDR; // Interrupt Disable Register - AT91_REG PIO_IMR; // Interrupt Mask Register - AT91_REG PIO_ISR; // Interrupt Status Register - AT91_REG PIO_MDER; // Multi-driver Enable Register - AT91_REG PIO_MDDR; // Multi-driver Disable Register - AT91_REG PIO_MDSR; // Multi-driver Status Register - AT91_REG Reserved3[1]; // - AT91_REG PIO_PPUDR; // Pull-up Disable Register - AT91_REG PIO_PPUER; // Pull-up Enable Register - AT91_REG PIO_PPUSR; // Pull-up Status Register - AT91_REG Reserved4[1]; // - AT91_REG PIO_ASR; // Select A Register - AT91_REG PIO_BSR; // Select B Register - AT91_REG PIO_ABSR; // AB Select Status Register - AT91_REG Reserved5[9]; // - AT91_REG PIO_OWER; // Output Write Enable Register - AT91_REG PIO_OWDR; // Output Write Disable Register - AT91_REG PIO_OWSR; // Output Write Status Register -} AT91S_PIO, *AT91PS_PIO; - - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Clock Generator Controler -// ***************************************************************************** -typedef struct _AT91S_CKGR { - AT91_REG CKGR_MOR; // Main Oscillator Register - AT91_REG CKGR_MCFR; // Main Clock Frequency Register - AT91_REG Reserved0[1]; // - AT91_REG CKGR_PLLR; // PLL Register -} AT91S_CKGR, *AT91PS_CKGR; - -// -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- -#define AT91C_CKGR_MOSCEN ((unsigned int) 0x1 << 0) // (CKGR) Main Oscillator Enable -#define AT91C_CKGR_OSCBYPASS ((unsigned int) 0x1 << 1) // (CKGR) Main Oscillator Bypass -#define AT91C_CKGR_OSCOUNT ((unsigned int) 0xFF << 8) // (CKGR) Main Oscillator Start-up Time -// -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- -#define AT91C_CKGR_MAINF ((unsigned int) 0xFFFF << 0) // (CKGR) Main Clock Frequency -#define AT91C_CKGR_MAINRDY ((unsigned int) 0x1 << 16) // (CKGR) Main Clock Ready -// -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- -#define AT91C_CKGR_DIV ((unsigned int) 0xFF << 0) // (CKGR) Divider Selected -#define AT91C_CKGR_DIV_0 ((unsigned int) 0x0) // (CKGR) Divider output is 0 -#define AT91C_CKGR_DIV_BYPASS ((unsigned int) 0x1) // (CKGR) Divider is bypassed -#define AT91C_CKGR_PLLCOUNT ((unsigned int) 0x3F << 8) // (CKGR) PLL Counter -#define AT91C_CKGR_OUT ((unsigned int) 0x3 << 14) // (CKGR) PLL Output Frequency Range -#define AT91C_CKGR_OUT_0 ((unsigned int) 0x0 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_1 ((unsigned int) 0x1 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_2 ((unsigned int) 0x2 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_3 ((unsigned int) 0x3 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_MUL ((unsigned int) 0x7FF << 16) // (CKGR) PLL Multiplier -#define AT91C_CKGR_USBDIV ((unsigned int) 0x3 << 28) // (CKGR) Divider for USB Clocks -#define AT91C_CKGR_USBDIV_0 ((unsigned int) 0x0 << 28) // (CKGR) Divider output is PLL clock output -#define AT91C_CKGR_USBDIV_1 ((unsigned int) 0x1 << 28) // (CKGR) Divider output is PLL clock output divided by 2 -#define AT91C_CKGR_USBDIV_2 ((unsigned int) 0x2 << 28) // (CKGR) Divider output is PLL clock output divided by 4 - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Power Management Controler -// ***************************************************************************** -typedef struct _AT91S_PMC { - AT91_REG PMC_SCER; // System Clock Enable Register - AT91_REG PMC_SCDR; // System Clock Disable Register - AT91_REG PMC_SCSR; // System Clock Status Register - AT91_REG Reserved0[1]; // - AT91_REG PMC_PCER; // Peripheral Clock Enable Register - AT91_REG PMC_PCDR; // Peripheral Clock Disable Register - AT91_REG PMC_PCSR; // Peripheral Clock Status Register - AT91_REG Reserved1[1]; // - AT91_REG PMC_MOR; // Main Oscillator Register - AT91_REG PMC_MCFR; // Main Clock Frequency Register - AT91_REG Reserved2[1]; // - AT91_REG PMC_PLLR; // PLL Register - AT91_REG PMC_MCKR; // Master Clock Register - AT91_REG Reserved3[3]; // - AT91_REG PMC_PCKR[4]; // Programmable Clock Register - AT91_REG Reserved4[4]; // - AT91_REG PMC_IER; // Interrupt Enable Register - AT91_REG PMC_IDR; // Interrupt Disable Register - AT91_REG PMC_SR; // Status Register - AT91_REG PMC_IMR; // Interrupt Mask Register -} AT91S_PMC, *AT91PS_PMC; - -// -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- -#define AT91C_PMC_PCK ((unsigned int) 0x1 << 0) // (PMC) Processor Clock -#define AT91C_PMC_UDP ((unsigned int) 0x1 << 7) // (PMC) USB Device Port Clock -#define AT91C_PMC_PCK0 ((unsigned int) 0x1 << 8) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK1 ((unsigned int) 0x1 << 9) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK2 ((unsigned int) 0x1 << 10) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK3 ((unsigned int) 0x1 << 11) // (PMC) Programmable Clock Output -// -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- -// -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- -// -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- -// -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- -// -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- -// -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- -#define AT91C_PMC_CSS ((unsigned int) 0x3 << 0) // (PMC) Programmable Clock Selection -#define AT91C_PMC_CSS_SLOW_CLK ((unsigned int) 0x0) // (PMC) Slow Clock is selected -#define AT91C_PMC_CSS_MAIN_CLK ((unsigned int) 0x1) // (PMC) Main Clock is selected -#define AT91C_PMC_CSS_PLL_CLK ((unsigned int) 0x3) // (PMC) Clock from PLL is selected -#define AT91C_PMC_PRES ((unsigned int) 0x7 << 2) // (PMC) Programmable Clock Prescaler -#define AT91C_PMC_PRES_CLK ((unsigned int) 0x0 << 2) // (PMC) Selected clock -#define AT91C_PMC_PRES_CLK_2 ((unsigned int) 0x1 << 2) // (PMC) Selected clock divided by 2 -#define AT91C_PMC_PRES_CLK_4 ((unsigned int) 0x2 << 2) // (PMC) Selected clock divided by 4 -#define AT91C_PMC_PRES_CLK_8 ((unsigned int) 0x3 << 2) // (PMC) Selected clock divided by 8 -#define AT91C_PMC_PRES_CLK_16 ((unsigned int) 0x4 << 2) // (PMC) Selected clock divided by 16 -#define AT91C_PMC_PRES_CLK_32 ((unsigned int) 0x5 << 2) // (PMC) Selected clock divided by 32 -#define AT91C_PMC_PRES_CLK_64 ((unsigned int) 0x6 << 2) // (PMC) Selected clock divided by 64 -// -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- -// -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- -#define AT91C_PMC_MOSCS ((unsigned int) 0x1 << 0) // (PMC) MOSC Status/Enable/Disable/Mask -#define AT91C_PMC_LOCK ((unsigned int) 0x1 << 2) // (PMC) PLL Status/Enable/Disable/Mask -#define AT91C_PMC_MCKRDY ((unsigned int) 0x1 << 3) // (PMC) MCK_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK0RDY ((unsigned int) 0x1 << 8) // (PMC) PCK0_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK1RDY ((unsigned int) 0x1 << 9) // (PMC) PCK1_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK2RDY ((unsigned int) 0x1 << 10) // (PMC) PCK2_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK3RDY ((unsigned int) 0x1 << 11) // (PMC) PCK3_RDY Status/Enable/Disable/Mask -// -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- -// -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- -// -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Reset Controller Interface -// ***************************************************************************** -typedef struct _AT91S_RSTC { - AT91_REG RSTC_RCR; // Reset Control Register - AT91_REG RSTC_RSR; // Reset Status Register - AT91_REG RSTC_RMR; // Reset Mode Register -} AT91S_RSTC, *AT91PS_RSTC; - -// -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- -#define AT91C_RSTC_PROCRST ((unsigned int) 0x1 << 0) // (RSTC) Processor Reset -#define AT91C_RSTC_PERRST ((unsigned int) 0x1 << 2) // (RSTC) Peripheral Reset -#define AT91C_RSTC_EXTRST ((unsigned int) 0x1 << 3) // (RSTC) External Reset -#define AT91C_RSTC_KEY ((unsigned int) 0xFF << 24) // (RSTC) Password -// -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- -#define AT91C_RSTC_URSTS ((unsigned int) 0x1 << 0) // (RSTC) User Reset Status -#define AT91C_RSTC_BODSTS ((unsigned int) 0x1 << 1) // (RSTC) Brownout Detection Status -#define AT91C_RSTC_RSTTYP ((unsigned int) 0x7 << 8) // (RSTC) Reset Type -#define AT91C_RSTC_RSTTYP_POWERUP ((unsigned int) 0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising. -#define AT91C_RSTC_RSTTYP_WAKEUP ((unsigned int) 0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising. -#define AT91C_RSTC_RSTTYP_WATCHDOG ((unsigned int) 0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occured. -#define AT91C_RSTC_RSTTYP_SOFTWARE ((unsigned int) 0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software. -#define AT91C_RSTC_RSTTYP_USER ((unsigned int) 0x4 << 8) // (RSTC) User Reset. NRST pin detected low. -#define AT91C_RSTC_RSTTYP_BROWNOUT ((unsigned int) 0x5 << 8) // (RSTC) Brownout Reset occured. -#define AT91C_RSTC_NRSTL ((unsigned int) 0x1 << 16) // (RSTC) NRST pin level -#define AT91C_RSTC_SRCMP ((unsigned int) 0x1 << 17) // (RSTC) Software Reset Command in Progress. -// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- -#define AT91C_RSTC_URSTEN ((unsigned int) 0x1 << 0) // (RSTC) User Reset Enable -#define AT91C_RSTC_URSTIEN ((unsigned int) 0x1 << 4) // (RSTC) User Reset Interrupt Enable -#define AT91C_RSTC_ERSTL ((unsigned int) 0xF << 8) // (RSTC) User Reset Length -#define AT91C_RSTC_BODIEN ((unsigned int) 0x1 << 16) // (RSTC) Brownout Detection Interrupt Enable - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface -// ***************************************************************************** -typedef struct _AT91S_RTTC { - AT91_REG RTTC_RTMR; // Real-time Mode Register - AT91_REG RTTC_RTAR; // Real-time Alarm Register - AT91_REG RTTC_RTVR; // Real-time Value Register - AT91_REG RTTC_RTSR; // Real-time Status Register -} AT91S_RTTC, *AT91PS_RTTC; - -// -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- -#define AT91C_RTTC_RTPRES ((unsigned int) 0xFFFF << 0) // (RTTC) Real-time Timer Prescaler Value -#define AT91C_RTTC_ALMIEN ((unsigned int) 0x1 << 16) // (RTTC) Alarm Interrupt Enable -#define AT91C_RTTC_RTTINCIEN ((unsigned int) 0x1 << 17) // (RTTC) Real Time Timer Increment Interrupt Enable -#define AT91C_RTTC_RTTRST ((unsigned int) 0x1 << 18) // (RTTC) Real Time Timer Restart -// -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- -#define AT91C_RTTC_ALMV ((unsigned int) 0x0 << 0) // (RTTC) Alarm Value -// -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- -#define AT91C_RTTC_CRTV ((unsigned int) 0x0 << 0) // (RTTC) Current Real-time Value -// -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- -#define AT91C_RTTC_ALMS ((unsigned int) 0x1 << 0) // (RTTC) Real-time Alarm Status -#define AT91C_RTTC_RTTINC ((unsigned int) 0x1 << 1) // (RTTC) Real-time Timer Increment - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface -// ***************************************************************************** -typedef struct _AT91S_PITC { - AT91_REG PITC_PIMR; // Period Interval Mode Register - AT91_REG PITC_PISR; // Period Interval Status Register - AT91_REG PITC_PIVR; // Period Interval Value Register - AT91_REG PITC_PIIR; // Period Interval Image Register -} AT91S_PITC, *AT91PS_PITC; - -// -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- -#define AT91C_PITC_PIV ((unsigned int) 0xFFFFF << 0) // (PITC) Periodic Interval Value -#define AT91C_PITC_PITEN ((unsigned int) 0x1 << 24) // (PITC) Periodic Interval Timer Enabled -#define AT91C_PITC_PITIEN ((unsigned int) 0x1 << 25) // (PITC) Periodic Interval Timer Interrupt Enable -// -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- -#define AT91C_PITC_PITS ((unsigned int) 0x1 << 0) // (PITC) Periodic Interval Timer Status -// -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- -#define AT91C_PITC_CPIV ((unsigned int) 0xFFFFF << 0) // (PITC) Current Periodic Interval Value -#define AT91C_PITC_PICNT ((unsigned int) 0xFFF << 20) // (PITC) Periodic Interval Counter -// -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface -// ***************************************************************************** -typedef struct _AT91S_WDTC { - AT91_REG WDTC_WDCR; // Watchdog Control Register - AT91_REG WDTC_WDMR; // Watchdog Mode Register - AT91_REG WDTC_WDSR; // Watchdog Status Register -} AT91S_WDTC, *AT91PS_WDTC; - -// -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- -#define AT91C_WDTC_WDRSTT ((unsigned int) 0x1 << 0) // (WDTC) Watchdog Restart -#define AT91C_WDTC_KEY ((unsigned int) 0xFF << 24) // (WDTC) Watchdog KEY Password -// -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- -#define AT91C_WDTC_WDV ((unsigned int) 0xFFF << 0) // (WDTC) Watchdog Timer Restart -#define AT91C_WDTC_WDFIEN ((unsigned int) 0x1 << 12) // (WDTC) Watchdog Fault Interrupt Enable -#define AT91C_WDTC_WDRSTEN ((unsigned int) 0x1 << 13) // (WDTC) Watchdog Reset Enable -#define AT91C_WDTC_WDRPROC ((unsigned int) 0x1 << 14) // (WDTC) Watchdog Timer Restart -#define AT91C_WDTC_WDDIS ((unsigned int) 0x1 << 15) // (WDTC) Watchdog Disable -#define AT91C_WDTC_WDD ((unsigned int) 0xFFF << 16) // (WDTC) Watchdog Delta Value -#define AT91C_WDTC_WDDBGHLT ((unsigned int) 0x1 << 28) // (WDTC) Watchdog Debug Halt -#define AT91C_WDTC_WDIDLEHLT ((unsigned int) 0x1 << 29) // (WDTC) Watchdog Idle Halt -// -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- -#define AT91C_WDTC_WDUNF ((unsigned int) 0x1 << 0) // (WDTC) Watchdog Underflow -#define AT91C_WDTC_WDERR ((unsigned int) 0x1 << 1) // (WDTC) Watchdog Error - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface -// ***************************************************************************** -typedef struct _AT91S_VREG { - AT91_REG VREG_MR; // Voltage Regulator Mode Register -} AT91S_VREG, *AT91PS_VREG; - -// -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- -#define AT91C_VREG_PSTDBY ((unsigned int) 0x1 << 0) // (VREG) Voltage Regulator Power Standby Mode - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Memory Controller Interface -// ***************************************************************************** -typedef struct _AT91S_MC { - AT91_REG MC_RCR; // MC Remap Control Register - AT91_REG MC_ASR; // MC Abort Status Register - AT91_REG MC_AASR; // MC Abort Address Status Register - AT91_REG Reserved0[21]; // - AT91_REG MC_FMR; // MC Flash Mode Register - AT91_REG MC_FCR; // MC Flash Command Register - AT91_REG MC_FSR; // MC Flash Status Register -} AT91S_MC, *AT91PS_MC; - -// -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- -#define AT91C_MC_RCB ((unsigned int) 0x1 << 0) // (MC) Remap Command Bit -// -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- -#define AT91C_MC_UNDADD ((unsigned int) 0x1 << 0) // (MC) Undefined Addess Abort Status -#define AT91C_MC_MISADD ((unsigned int) 0x1 << 1) // (MC) Misaligned Addess Abort Status -#define AT91C_MC_ABTSZ ((unsigned int) 0x3 << 8) // (MC) Abort Size Status -#define AT91C_MC_ABTSZ_BYTE ((unsigned int) 0x0 << 8) // (MC) Byte -#define AT91C_MC_ABTSZ_HWORD ((unsigned int) 0x1 << 8) // (MC) Half-word -#define AT91C_MC_ABTSZ_WORD ((unsigned int) 0x2 << 8) // (MC) Word -#define AT91C_MC_ABTTYP ((unsigned int) 0x3 << 10) // (MC) Abort Type Status -#define AT91C_MC_ABTTYP_DATAR ((unsigned int) 0x0 << 10) // (MC) Data Read -#define AT91C_MC_ABTTYP_DATAW ((unsigned int) 0x1 << 10) // (MC) Data Write -#define AT91C_MC_ABTTYP_FETCH ((unsigned int) 0x2 << 10) // (MC) Code Fetch -#define AT91C_MC_MST0 ((unsigned int) 0x1 << 16) // (MC) Master 0 Abort Source -#define AT91C_MC_MST1 ((unsigned int) 0x1 << 17) // (MC) Master 1 Abort Source -#define AT91C_MC_SVMST0 ((unsigned int) 0x1 << 24) // (MC) Saved Master 0 Abort Source -#define AT91C_MC_SVMST1 ((unsigned int) 0x1 << 25) // (MC) Saved Master 1 Abort Source -// -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- -#define AT91C_MC_FRDY ((unsigned int) 0x1 << 0) // (MC) Flash Ready -#define AT91C_MC_LOCKE ((unsigned int) 0x1 << 2) // (MC) Lock Error -#define AT91C_MC_PROGE ((unsigned int) 0x1 << 3) // (MC) Programming Error -#define AT91C_MC_NEBP ((unsigned int) 0x1 << 7) // (MC) No Erase Before Programming -#define AT91C_MC_FWS ((unsigned int) 0x3 << 8) // (MC) Flash Wait State -#define AT91C_MC_FWS_0FWS ((unsigned int) 0x0 << 8) // (MC) 1 cycle for Read, 2 for Write operations -#define AT91C_MC_FWS_1FWS ((unsigned int) 0x1 << 8) // (MC) 2 cycles for Read, 3 for Write operations -#define AT91C_MC_FWS_2FWS ((unsigned int) 0x2 << 8) // (MC) 3 cycles for Read, 4 for Write operations -#define AT91C_MC_FWS_3FWS ((unsigned int) 0x3 << 8) // (MC) 4 cycles for Read, 4 for Write operations -#define AT91C_MC_FMCN ((unsigned int) 0xFF << 16) // (MC) Flash Microsecond Cycle Number -// -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- -#define AT91C_MC_FCMD ((unsigned int) 0xF << 0) // (MC) Flash Command -#define AT91C_MC_FCMD_START_PROG ((unsigned int) 0x1) // (MC) Starts the programming of th epage specified by PAGEN. -#define AT91C_MC_FCMD_LOCK ((unsigned int) 0x2) // (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -#define AT91C_MC_FCMD_PROG_AND_LOCK ((unsigned int) 0x3) // (MC) The lock sequence automatically happens after the programming sequence is completed. -#define AT91C_MC_FCMD_UNLOCK ((unsigned int) 0x4) // (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -#define AT91C_MC_FCMD_ERASE_ALL ((unsigned int) 0x8) // (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. -#define AT91C_MC_FCMD_SET_GP_NVM ((unsigned int) 0xB) // (MC) Set General Purpose NVM bits. -#define AT91C_MC_FCMD_CLR_GP_NVM ((unsigned int) 0xD) // (MC) Clear General Purpose NVM bits. -#define AT91C_MC_FCMD_SET_SECURITY ((unsigned int) 0xF) // (MC) Set Security Bit. -#define AT91C_MC_PAGEN ((unsigned int) 0x3FF << 8) // (MC) Page Number -#define AT91C_MC_KEY ((unsigned int) 0xFF << 24) // (MC) Writing Protect Key -// -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- -#define AT91C_MC_SECURITY ((unsigned int) 0x1 << 4) // (MC) Security Bit Status -#define AT91C_MC_GPNVM0 ((unsigned int) 0x1 << 8) // (MC) Sector 0 Lock Status -#define AT91C_MC_GPNVM1 ((unsigned int) 0x1 << 9) // (MC) Sector 1 Lock Status -#define AT91C_MC_GPNVM2 ((unsigned int) 0x1 << 10) // (MC) Sector 2 Lock Status -#define AT91C_MC_GPNVM3 ((unsigned int) 0x1 << 11) // (MC) Sector 3 Lock Status -#define AT91C_MC_GPNVM4 ((unsigned int) 0x1 << 12) // (MC) Sector 4 Lock Status -#define AT91C_MC_GPNVM5 ((unsigned int) 0x1 << 13) // (MC) Sector 5 Lock Status -#define AT91C_MC_GPNVM6 ((unsigned int) 0x1 << 14) // (MC) Sector 6 Lock Status -#define AT91C_MC_GPNVM7 ((unsigned int) 0x1 << 15) // (MC) Sector 7 Lock Status -#define AT91C_MC_LOCKS0 ((unsigned int) 0x1 << 16) // (MC) Sector 0 Lock Status -#define AT91C_MC_LOCKS1 ((unsigned int) 0x1 << 17) // (MC) Sector 1 Lock Status -#define AT91C_MC_LOCKS2 ((unsigned int) 0x1 << 18) // (MC) Sector 2 Lock Status -#define AT91C_MC_LOCKS3 ((unsigned int) 0x1 << 19) // (MC) Sector 3 Lock Status -#define AT91C_MC_LOCKS4 ((unsigned int) 0x1 << 20) // (MC) Sector 4 Lock Status -#define AT91C_MC_LOCKS5 ((unsigned int) 0x1 << 21) // (MC) Sector 5 Lock Status -#define AT91C_MC_LOCKS6 ((unsigned int) 0x1 << 22) // (MC) Sector 6 Lock Status -#define AT91C_MC_LOCKS7 ((unsigned int) 0x1 << 23) // (MC) Sector 7 Lock Status -#define AT91C_MC_LOCKS8 ((unsigned int) 0x1 << 24) // (MC) Sector 8 Lock Status -#define AT91C_MC_LOCKS9 ((unsigned int) 0x1 << 25) // (MC) Sector 9 Lock Status -#define AT91C_MC_LOCKS10 ((unsigned int) 0x1 << 26) // (MC) Sector 10 Lock Status -#define AT91C_MC_LOCKS11 ((unsigned int) 0x1 << 27) // (MC) Sector 11 Lock Status -#define AT91C_MC_LOCKS12 ((unsigned int) 0x1 << 28) // (MC) Sector 12 Lock Status -#define AT91C_MC_LOCKS13 ((unsigned int) 0x1 << 29) // (MC) Sector 13 Lock Status -#define AT91C_MC_LOCKS14 ((unsigned int) 0x1 << 30) // (MC) Sector 14 Lock Status -#define AT91C_MC_LOCKS15 ((unsigned int) 0x1 << 31) // (MC) Sector 15 Lock Status - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Serial Parallel Interface -// ***************************************************************************** -typedef struct _AT91S_SPI { - AT91_REG SPI_CR; // Control Register - AT91_REG SPI_MR; // Mode Register - AT91_REG SPI_RDR; // Receive Data Register - AT91_REG SPI_TDR; // Transmit Data Register - AT91_REG SPI_SR; // Status Register - AT91_REG SPI_IER; // Interrupt Enable Register - AT91_REG SPI_IDR; // Interrupt Disable Register - AT91_REG SPI_IMR; // Interrupt Mask Register - AT91_REG Reserved0[4]; // - AT91_REG SPI_CSR[4]; // Chip Select Register - AT91_REG Reserved1[48]; // - AT91_REG SPI_RPR; // Receive Pointer Register - AT91_REG SPI_RCR; // Receive Counter Register - AT91_REG SPI_TPR; // Transmit Pointer Register - AT91_REG SPI_TCR; // Transmit Counter Register - AT91_REG SPI_RNPR; // Receive Next Pointer Register - AT91_REG SPI_RNCR; // Receive Next Counter Register - AT91_REG SPI_TNPR; // Transmit Next Pointer Register - AT91_REG SPI_TNCR; // Transmit Next Counter Register - AT91_REG SPI_PTCR; // PDC Transfer Control Register - AT91_REG SPI_PTSR; // PDC Transfer Status Register -} AT91S_SPI, *AT91PS_SPI; - -// -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- -#define AT91C_SPI_SPIEN ((unsigned int) 0x1 << 0) // (SPI) SPI Enable -#define AT91C_SPI_SPIDIS ((unsigned int) 0x1 << 1) // (SPI) SPI Disable -#define AT91C_SPI_SWRST ((unsigned int) 0x1 << 7) // (SPI) SPI Software reset -#define AT91C_SPI_LASTXFER ((unsigned int) 0x1 << 24) // (SPI) SPI Last Transfer -// -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- -#define AT91C_SPI_MSTR ((unsigned int) 0x1 << 0) // (SPI) Master/Slave Mode -#define AT91C_SPI_PS ((unsigned int) 0x1 << 1) // (SPI) Peripheral Select -#define AT91C_SPI_PS_FIXED ((unsigned int) 0x0 << 1) // (SPI) Fixed Peripheral Select -#define AT91C_SPI_PS_VARIABLE ((unsigned int) 0x1 << 1) // (SPI) Variable Peripheral Select -#define AT91C_SPI_PCSDEC ((unsigned int) 0x1 << 2) // (SPI) Chip Select Decode -#define AT91C_SPI_FDIV ((unsigned int) 0x1 << 3) // (SPI) Clock Selection -#define AT91C_SPI_MODFDIS ((unsigned int) 0x1 << 4) // (SPI) Mode Fault Detection -#define AT91C_SPI_LLB ((unsigned int) 0x1 << 7) // (SPI) Clock Selection -#define AT91C_SPI_PCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select -#define AT91C_SPI_DLYBCS ((unsigned int) 0xFF << 24) // (SPI) Delay Between Chip Selects -// -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- -#define AT91C_SPI_RD ((unsigned int) 0xFFFF << 0) // (SPI) Receive Data -#define AT91C_SPI_RPCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select Status -// -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- -#define AT91C_SPI_TD ((unsigned int) 0xFFFF << 0) // (SPI) Transmit Data -#define AT91C_SPI_TPCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select Status -// -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- -#define AT91C_SPI_RDRF ((unsigned int) 0x1 << 0) // (SPI) Receive Data Register Full -#define AT91C_SPI_TDRE ((unsigned int) 0x1 << 1) // (SPI) Transmit Data Register Empty -#define AT91C_SPI_MODF ((unsigned int) 0x1 << 2) // (SPI) Mode Fault Error -#define AT91C_SPI_OVRES ((unsigned int) 0x1 << 3) // (SPI) Overrun Error Status -#define AT91C_SPI_ENDRX ((unsigned int) 0x1 << 4) // (SPI) End of Receiver Transfer -#define AT91C_SPI_ENDTX ((unsigned int) 0x1 << 5) // (SPI) End of Receiver Transfer -#define AT91C_SPI_RXBUFF ((unsigned int) 0x1 << 6) // (SPI) RXBUFF Interrupt -#define AT91C_SPI_TXBUFE ((unsigned int) 0x1 << 7) // (SPI) TXBUFE Interrupt -#define AT91C_SPI_NSSR ((unsigned int) 0x1 << 8) // (SPI) NSSR Interrupt -#define AT91C_SPI_TXEMPTY ((unsigned int) 0x1 << 9) // (SPI) TXEMPTY Interrupt -#define AT91C_SPI_SPIENS ((unsigned int) 0x1 << 16) // (SPI) Enable Status -// -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- -// -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- -// -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- -// -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- -#define AT91C_SPI_CPOL ((unsigned int) 0x1 << 0) // (SPI) Clock Polarity -#define AT91C_SPI_NCPHA ((unsigned int) 0x1 << 1) // (SPI) Clock Phase -#define AT91C_SPI_CSAAT ((unsigned int) 0x1 << 3) // (SPI) Chip Select Active After Transfer -#define AT91C_SPI_BITS ((unsigned int) 0xF << 4) // (SPI) Bits Per Transfer -#define AT91C_SPI_BITS_8 ((unsigned int) 0x0 << 4) // (SPI) 8 Bits Per transfer -#define AT91C_SPI_BITS_9 ((unsigned int) 0x1 << 4) // (SPI) 9 Bits Per transfer -#define AT91C_SPI_BITS_10 ((unsigned int) 0x2 << 4) // (SPI) 10 Bits Per transfer -#define AT91C_SPI_BITS_11 ((unsigned int) 0x3 << 4) // (SPI) 11 Bits Per transfer -#define AT91C_SPI_BITS_12 ((unsigned int) 0x4 << 4) // (SPI) 12 Bits Per transfer -#define AT91C_SPI_BITS_13 ((unsigned int) 0x5 << 4) // (SPI) 13 Bits Per transfer -#define AT91C_SPI_BITS_14 ((unsigned int) 0x6 << 4) // (SPI) 14 Bits Per transfer -#define AT91C_SPI_BITS_15 ((unsigned int) 0x7 << 4) // (SPI) 15 Bits Per transfer -#define AT91C_SPI_BITS_16 ((unsigned int) 0x8 << 4) // (SPI) 16 Bits Per transfer -#define AT91C_SPI_SCBR ((unsigned int) 0xFF << 8) // (SPI) Serial Clock Baud Rate -#define AT91C_SPI_DLYBS ((unsigned int) 0xFF << 16) // (SPI) Delay Before SPCK -#define AT91C_SPI_DLYBCT ((unsigned int) 0xFF << 24) // (SPI) Delay Between Consecutive Transfers - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Usart -// ***************************************************************************** -typedef struct _AT91S_USART { - AT91_REG US_CR; // Control Register - AT91_REG US_MR; // Mode Register - AT91_REG US_IER; // Interrupt Enable Register - AT91_REG US_IDR; // Interrupt Disable Register - AT91_REG US_IMR; // Interrupt Mask Register - AT91_REG US_CSR; // Channel Status Register - AT91_REG US_RHR; // Receiver Holding Register - AT91_REG US_THR; // Transmitter Holding Register - AT91_REG US_BRGR; // Baud Rate Generator Register - AT91_REG US_RTOR; // Receiver Time-out Register - AT91_REG US_TTGR; // Transmitter Time-guard Register - AT91_REG Reserved0[5]; // - AT91_REG US_FIDI; // FI_DI_Ratio Register - AT91_REG US_NER; // Nb Errors Register - AT91_REG Reserved1[1]; // - AT91_REG US_IF; // IRDA_FILTER Register - AT91_REG Reserved2[44]; // - AT91_REG US_RPR; // Receive Pointer Register - AT91_REG US_RCR; // Receive Counter Register - AT91_REG US_TPR; // Transmit Pointer Register - AT91_REG US_TCR; // Transmit Counter Register - AT91_REG US_RNPR; // Receive Next Pointer Register - AT91_REG US_RNCR; // Receive Next Counter Register - AT91_REG US_TNPR; // Transmit Next Pointer Register - AT91_REG US_TNCR; // Transmit Next Counter Register - AT91_REG US_PTCR; // PDC Transfer Control Register - AT91_REG US_PTSR; // PDC Transfer Status Register -} AT91S_USART, *AT91PS_USART; - -// -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- -#define AT91C_US_STTBRK ((unsigned int) 0x1 << 9) // (USART) Start Break -#define AT91C_US_STPBRK ((unsigned int) 0x1 << 10) // (USART) Stop Break -#define AT91C_US_STTTO ((unsigned int) 0x1 << 11) // (USART) Start Time-out -#define AT91C_US_SENDA ((unsigned int) 0x1 << 12) // (USART) Send Address -#define AT91C_US_RSTIT ((unsigned int) 0x1 << 13) // (USART) Reset Iterations -#define AT91C_US_RSTNACK ((unsigned int) 0x1 << 14) // (USART) Reset Non Acknowledge -#define AT91C_US_RETTO ((unsigned int) 0x1 << 15) // (USART) Rearm Time-out -#define AT91C_US_DTREN ((unsigned int) 0x1 << 16) // (USART) Data Terminal ready Enable -#define AT91C_US_DTRDIS ((unsigned int) 0x1 << 17) // (USART) Data Terminal ready Disable -#define AT91C_US_RTSEN ((unsigned int) 0x1 << 18) // (USART) Request to Send enable -#define AT91C_US_RTSDIS ((unsigned int) 0x1 << 19) // (USART) Request to Send Disable -// -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- -#define AT91C_US_USMODE ((unsigned int) 0xF << 0) // (USART) Usart mode -#define AT91C_US_USMODE_NORMAL ((unsigned int) 0x0) // (USART) Normal -#define AT91C_US_USMODE_RS485 ((unsigned int) 0x1) // (USART) RS485 -#define AT91C_US_USMODE_HWHSH ((unsigned int) 0x2) // (USART) Hardware Handshaking -#define AT91C_US_USMODE_MODEM ((unsigned int) 0x3) // (USART) Modem -#define AT91C_US_USMODE_ISO7816_0 ((unsigned int) 0x4) // (USART) ISO7816 protocol: T = 0 -#define AT91C_US_USMODE_ISO7816_1 ((unsigned int) 0x6) // (USART) ISO7816 protocol: T = 1 -#define AT91C_US_USMODE_IRDA ((unsigned int) 0x8) // (USART) IrDA -#define AT91C_US_USMODE_SWHSH ((unsigned int) 0xC) // (USART) Software Handshaking -#define AT91C_US_CLKS ((unsigned int) 0x3 << 4) // (USART) Clock Selection (Baud Rate generator Input Clock -#define AT91C_US_CLKS_CLOCK ((unsigned int) 0x0 << 4) // (USART) Clock -#define AT91C_US_CLKS_FDIV1 ((unsigned int) 0x1 << 4) // (USART) fdiv1 -#define AT91C_US_CLKS_SLOW ((unsigned int) 0x2 << 4) // (USART) slow_clock (ARM) -#define AT91C_US_CLKS_EXT ((unsigned int) 0x3 << 4) // (USART) External (SCK) -#define AT91C_US_CHRL ((unsigned int) 0x3 << 6) // (USART) Clock Selection (Baud Rate generator Input Clock -#define AT91C_US_CHRL_5_BITS ((unsigned int) 0x0 << 6) // (USART) Character Length: 5 bits -#define AT91C_US_CHRL_6_BITS ((unsigned int) 0x1 << 6) // (USART) Character Length: 6 bits -#define AT91C_US_CHRL_7_BITS ((unsigned int) 0x2 << 6) // (USART) Character Length: 7 bits -#define AT91C_US_CHRL_8_BITS ((unsigned int) 0x3 << 6) // (USART) Character Length: 8 bits -#define AT91C_US_SYNC ((unsigned int) 0x1 << 8) // (USART) Synchronous Mode Select -#define AT91C_US_NBSTOP ((unsigned int) 0x3 << 12) // (USART) Number of Stop bits -#define AT91C_US_NBSTOP_1_BIT ((unsigned int) 0x0 << 12) // (USART) 1 stop bit -#define AT91C_US_NBSTOP_15_BIT ((unsigned int) 0x1 << 12) // (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits -#define AT91C_US_NBSTOP_2_BIT ((unsigned int) 0x2 << 12) // (USART) 2 stop bits -#define AT91C_US_MSBF ((unsigned int) 0x1 << 16) // (USART) Bit Order -#define AT91C_US_MODE9 ((unsigned int) 0x1 << 17) // (USART) 9-bit Character length -#define AT91C_US_CKLO ((unsigned int) 0x1 << 18) // (USART) Clock Output Select -#define AT91C_US_OVER ((unsigned int) 0x1 << 19) // (USART) Over Sampling Mode -#define AT91C_US_INACK ((unsigned int) 0x1 << 20) // (USART) Inhibit Non Acknowledge -#define AT91C_US_DSNACK ((unsigned int) 0x1 << 21) // (USART) Disable Successive NACK -#define AT91C_US_MAX_ITER ((unsigned int) 0x1 << 24) // (USART) Number of Repetitions -#define AT91C_US_FILTER ((unsigned int) 0x1 << 28) // (USART) Receive Line Filter -// -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- -#define AT91C_US_RXBRK ((unsigned int) 0x1 << 2) // (USART) Break Received/End of Break -#define AT91C_US_TIMEOUT ((unsigned int) 0x1 << 8) // (USART) Receiver Time-out -#define AT91C_US_ITERATION ((unsigned int) 0x1 << 10) // (USART) Max number of Repetitions Reached -#define AT91C_US_NACK ((unsigned int) 0x1 << 13) // (USART) Non Acknowledge -#define AT91C_US_RIIC ((unsigned int) 0x1 << 16) // (USART) Ring INdicator Input Change Flag -#define AT91C_US_DSRIC ((unsigned int) 0x1 << 17) // (USART) Data Set Ready Input Change Flag -#define AT91C_US_DCDIC ((unsigned int) 0x1 << 18) // (USART) Data Carrier Flag -#define AT91C_US_CTSIC ((unsigned int) 0x1 << 19) // (USART) Clear To Send Input Change Flag -// -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- -#define AT91C_US_RI ((unsigned int) 0x1 << 20) // (USART) Image of RI Input -#define AT91C_US_DSR ((unsigned int) 0x1 << 21) // (USART) Image of DSR Input -#define AT91C_US_DCD ((unsigned int) 0x1 << 22) // (USART) Image of DCD Input -#define AT91C_US_CTS ((unsigned int) 0x1 << 23) // (USART) Image of CTS Input - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface -// ***************************************************************************** -typedef struct _AT91S_SSC { - AT91_REG SSC_CR; // Control Register - AT91_REG SSC_CMR; // Clock Mode Register - AT91_REG Reserved0[2]; // - AT91_REG SSC_RCMR; // Receive Clock ModeRegister - AT91_REG SSC_RFMR; // Receive Frame Mode Register - AT91_REG SSC_TCMR; // Transmit Clock Mode Register - AT91_REG SSC_TFMR; // Transmit Frame Mode Register - AT91_REG SSC_RHR; // Receive Holding Register - AT91_REG SSC_THR; // Transmit Holding Register - AT91_REG Reserved1[2]; // - AT91_REG SSC_RSHR; // Receive Sync Holding Register - AT91_REG SSC_TSHR; // Transmit Sync Holding Register - AT91_REG Reserved2[2]; // - AT91_REG SSC_SR; // Status Register - AT91_REG SSC_IER; // Interrupt Enable Register - AT91_REG SSC_IDR; // Interrupt Disable Register - AT91_REG SSC_IMR; // Interrupt Mask Register - AT91_REG Reserved3[44]; // - AT91_REG SSC_RPR; // Receive Pointer Register - AT91_REG SSC_RCR; // Receive Counter Register - AT91_REG SSC_TPR; // Transmit Pointer Register - AT91_REG SSC_TCR; // Transmit Counter Register - AT91_REG SSC_RNPR; // Receive Next Pointer Register - AT91_REG SSC_RNCR; // Receive Next Counter Register - AT91_REG SSC_TNPR; // Transmit Next Pointer Register - AT91_REG SSC_TNCR; // Transmit Next Counter Register - AT91_REG SSC_PTCR; // PDC Transfer Control Register - AT91_REG SSC_PTSR; // PDC Transfer Status Register -} AT91S_SSC, *AT91PS_SSC; - -// -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- -#define AT91C_SSC_RXEN ((unsigned int) 0x1 << 0) // (SSC) Receive Enable -#define AT91C_SSC_RXDIS ((unsigned int) 0x1 << 1) // (SSC) Receive Disable -#define AT91C_SSC_TXEN ((unsigned int) 0x1 << 8) // (SSC) Transmit Enable -#define AT91C_SSC_TXDIS ((unsigned int) 0x1 << 9) // (SSC) Transmit Disable -#define AT91C_SSC_SWRST ((unsigned int) 0x1 << 15) // (SSC) Software Reset -// -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- -#define AT91C_SSC_CKS ((unsigned int) 0x3 << 0) // (SSC) Receive/Transmit Clock Selection -#define AT91C_SSC_CKS_DIV ((unsigned int) 0x0) // (SSC) Divided Clock -#define AT91C_SSC_CKS_TK ((unsigned int) 0x1) // (SSC) TK Clock signal -#define AT91C_SSC_CKS_RK ((unsigned int) 0x2) // (SSC) RK pin -#define AT91C_SSC_CKO ((unsigned int) 0x7 << 2) // (SSC) Receive/Transmit Clock Output Mode Selection -#define AT91C_SSC_CKO_NONE ((unsigned int) 0x0 << 2) // (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only -#define AT91C_SSC_CKO_CONTINOUS ((unsigned int) 0x1 << 2) // (SSC) Continuous Receive/Transmit Clock RK pin: Output -#define AT91C_SSC_CKO_DATA_TX ((unsigned int) 0x2 << 2) // (SSC) Receive/Transmit Clock only during data transfers RK pin: Output -#define AT91C_SSC_CKI ((unsigned int) 0x1 << 5) // (SSC) Receive/Transmit Clock Inversion -#define AT91C_SSC_CKG ((unsigned int) 0x3 << 6) // (SSC) Receive/Transmit Clock Gating Selection -#define AT91C_SSC_CKG_NONE ((unsigned int) 0x0 << 6) // (SSC) Receive/Transmit Clock Gating: None, continuous clock -#define AT91C_SSC_CKG_LOW ((unsigned int) 0x1 << 6) // (SSC) Receive/Transmit Clock enabled only if RF Low -#define AT91C_SSC_CKG_HIGH ((unsigned int) 0x2 << 6) // (SSC) Receive/Transmit Clock enabled only if RF High -#define AT91C_SSC_START ((unsigned int) 0xF << 8) // (SSC) Receive/Transmit Start Selection -#define AT91C_SSC_START_CONTINOUS ((unsigned int) 0x0 << 8) // (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. -#define AT91C_SSC_START_TX ((unsigned int) 0x1 << 8) // (SSC) Transmit/Receive start -#define AT91C_SSC_START_LOW_RF ((unsigned int) 0x2 << 8) // (SSC) Detection of a low level on RF input -#define AT91C_SSC_START_HIGH_RF ((unsigned int) 0x3 << 8) // (SSC) Detection of a high level on RF input -#define AT91C_SSC_START_FALL_RF ((unsigned int) 0x4 << 8) // (SSC) Detection of a falling edge on RF input -#define AT91C_SSC_START_RISE_RF ((unsigned int) 0x5 << 8) // (SSC) Detection of a rising edge on RF input -#define AT91C_SSC_START_LEVEL_RF ((unsigned int) 0x6 << 8) // (SSC) Detection of any level change on RF input -#define AT91C_SSC_START_EDGE_RF ((unsigned int) 0x7 << 8) // (SSC) Detection of any edge on RF input -#define AT91C_SSC_START_0 ((unsigned int) 0x8 << 8) // (SSC) Compare 0 -#define AT91C_SSC_STOP ((unsigned int) 0x1 << 12) // (SSC) Receive Stop Selection -#define AT91C_SSC_STTDLY ((unsigned int) 0xFF << 16) // (SSC) Receive/Transmit Start Delay -#define AT91C_SSC_PERIOD ((unsigned int) 0xFF << 24) // (SSC) Receive/Transmit Period Divider Selection -// -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- -#define AT91C_SSC_DATLEN ((unsigned int) 0x1F << 0) // (SSC) Data Length -#define AT91C_SSC_LOOP ((unsigned int) 0x1 << 5) // (SSC) Loop Mode -#define AT91C_SSC_MSBF ((unsigned int) 0x1 << 7) // (SSC) Most Significant Bit First -#define AT91C_SSC_DATNB ((unsigned int) 0xF << 8) // (SSC) Data Number per Frame -#define AT91C_SSC_FSLEN ((unsigned int) 0xF << 16) // (SSC) Receive/Transmit Frame Sync length -#define AT91C_SSC_FSOS ((unsigned int) 0x7 << 20) // (SSC) Receive/Transmit Frame Sync Output Selection -#define AT91C_SSC_FSOS_NONE ((unsigned int) 0x0 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only -#define AT91C_SSC_FSOS_NEGATIVE ((unsigned int) 0x1 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse -#define AT91C_SSC_FSOS_POSITIVE ((unsigned int) 0x2 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse -#define AT91C_SSC_FSOS_LOW ((unsigned int) 0x3 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer -#define AT91C_SSC_FSOS_HIGH ((unsigned int) 0x4 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer -#define AT91C_SSC_FSOS_TOGGLE ((unsigned int) 0x5 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer -#define AT91C_SSC_FSEDGE ((unsigned int) 0x1 << 24) // (SSC) Frame Sync Edge Detection -// -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- -// -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- -#define AT91C_SSC_DATDEF ((unsigned int) 0x1 << 5) // (SSC) Data Default Value -#define AT91C_SSC_FSDEN ((unsigned int) 0x1 << 23) // (SSC) Frame Sync Data Enable -// -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- -#define AT91C_SSC_TXRDY ((unsigned int) 0x1 << 0) // (SSC) Transmit Ready -#define AT91C_SSC_TXEMPTY ((unsigned int) 0x1 << 1) // (SSC) Transmit Empty -#define AT91C_SSC_ENDTX ((unsigned int) 0x1 << 2) // (SSC) End Of Transmission -#define AT91C_SSC_TXBUFE ((unsigned int) 0x1 << 3) // (SSC) Transmit Buffer Empty -#define AT91C_SSC_RXRDY ((unsigned int) 0x1 << 4) // (SSC) Receive Ready -#define AT91C_SSC_OVRUN ((unsigned int) 0x1 << 5) // (SSC) Receive Overrun -#define AT91C_SSC_ENDRX ((unsigned int) 0x1 << 6) // (SSC) End of Reception -#define AT91C_SSC_RXBUFF ((unsigned int) 0x1 << 7) // (SSC) Receive Buffer Full -#define AT91C_SSC_CP0 ((unsigned int) 0x1 << 8) // (SSC) Compare 0 -#define AT91C_SSC_CP1 ((unsigned int) 0x1 << 9) // (SSC) Compare 1 -#define AT91C_SSC_TXSYN ((unsigned int) 0x1 << 10) // (SSC) Transmit Sync -#define AT91C_SSC_RXSYN ((unsigned int) 0x1 << 11) // (SSC) Receive Sync -#define AT91C_SSC_TXENA ((unsigned int) 0x1 << 16) // (SSC) Transmit Enable -#define AT91C_SSC_RXENA ((unsigned int) 0x1 << 17) // (SSC) Receive Enable -// -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- -// -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- -// -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Two-wire Interface -// ***************************************************************************** -typedef struct _AT91S_TWI { - AT91_REG TWI_CR; // Control Register - AT91_REG TWI_MMR; // Master Mode Register - AT91_REG Reserved0[1]; // - AT91_REG TWI_IADR; // Internal Address Register - AT91_REG TWI_CWGR; // Clock Waveform Generator Register - AT91_REG Reserved1[3]; // - AT91_REG TWI_SR; // Status Register - AT91_REG TWI_IER; // Interrupt Enable Register - AT91_REG TWI_IDR; // Interrupt Disable Register - AT91_REG TWI_IMR; // Interrupt Mask Register - AT91_REG TWI_RHR; // Receive Holding Register - AT91_REG TWI_THR; // Transmit Holding Register -} AT91S_TWI, *AT91PS_TWI; - -// -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- -#define AT91C_TWI_START ((unsigned int) 0x1 << 0) // (TWI) Send a START Condition -#define AT91C_TWI_STOP ((unsigned int) 0x1 << 1) // (TWI) Send a STOP Condition -#define AT91C_TWI_MSEN ((unsigned int) 0x1 << 2) // (TWI) TWI Master Transfer Enabled -#define AT91C_TWI_MSDIS ((unsigned int) 0x1 << 3) // (TWI) TWI Master Transfer Disabled -#define AT91C_TWI_SWRST ((unsigned int) 0x1 << 7) // (TWI) Software Reset -// -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- -#define AT91C_TWI_IADRSZ ((unsigned int) 0x3 << 8) // (TWI) Internal Device Address Size -#define AT91C_TWI_IADRSZ_NO ((unsigned int) 0x0 << 8) // (TWI) No internal device address -#define AT91C_TWI_IADRSZ_1_BYTE ((unsigned int) 0x1 << 8) // (TWI) One-byte internal device address -#define AT91C_TWI_IADRSZ_2_BYTE ((unsigned int) 0x2 << 8) // (TWI) Two-byte internal device address -#define AT91C_TWI_IADRSZ_3_BYTE ((unsigned int) 0x3 << 8) // (TWI) Three-byte internal device address -#define AT91C_TWI_MREAD ((unsigned int) 0x1 << 12) // (TWI) Master Read Direction -#define AT91C_TWI_DADR ((unsigned int) 0x7F << 16) // (TWI) Device Address -// -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- -#define AT91C_TWI_CLDIV ((unsigned int) 0xFF << 0) // (TWI) Clock Low Divider -#define AT91C_TWI_CHDIV ((unsigned int) 0xFF << 8) // (TWI) Clock High Divider -#define AT91C_TWI_CKDIV ((unsigned int) 0x7 << 16) // (TWI) Clock Divider -// -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- -#define AT91C_TWI_TXCOMP ((unsigned int) 0x1 << 0) // (TWI) Transmission Completed -#define AT91C_TWI_RXRDY ((unsigned int) 0x1 << 1) // (TWI) Receive holding register ReaDY -#define AT91C_TWI_TXRDY ((unsigned int) 0x1 << 2) // (TWI) Transmit holding register ReaDY -#define AT91C_TWI_OVRE ((unsigned int) 0x1 << 6) // (TWI) Overrun Error -#define AT91C_TWI_UNRE ((unsigned int) 0x1 << 7) // (TWI) Underrun Error -#define AT91C_TWI_NACK ((unsigned int) 0x1 << 8) // (TWI) Not Acknowledged -// -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- -// -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- -// -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR PWMC Channel Interface -// ***************************************************************************** -typedef struct _AT91S_PWMC_CH { - AT91_REG PWMC_CMR; // Channel Mode Register - AT91_REG PWMC_CDTYR; // Channel Duty Cycle Register - AT91_REG PWMC_CPRDR; // Channel Period Register - AT91_REG PWMC_CCNTR; // Channel Counter Register - AT91_REG PWMC_CUPDR; // Channel Update Register - AT91_REG PWMC_Reserved[3]; // Reserved -} AT91S_PWMC_CH, *AT91PS_PWMC_CH; - -// -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- -#define AT91C_PWMC_CPRE ((unsigned int) 0xF << 0) // (PWMC_CH) Channel Pre-scaler : PWMC_CLKx -#define AT91C_PWMC_CPRE_MCK ((unsigned int) 0x0) // (PWMC_CH) -#define AT91C_PWMC_CPRE_MCKA ((unsigned int) 0xB) // (PWMC_CH) -#define AT91C_PWMC_CPRE_MCKB ((unsigned int) 0xC) // (PWMC_CH) -#define AT91C_PWMC_CALG ((unsigned int) 0x1 << 8) // (PWMC_CH) Channel Alignment -#define AT91C_PWMC_CPOL ((unsigned int) 0x1 << 9) // (PWMC_CH) Channel Polarity -#define AT91C_PWMC_CPD ((unsigned int) 0x1 << 10) // (PWMC_CH) Channel Update Period -// -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- -#define AT91C_PWMC_CDTY ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Duty Cycle -// -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- -#define AT91C_PWMC_CPRD ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Period -// -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- -#define AT91C_PWMC_CCNT ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Counter -// -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- -#define AT91C_PWMC_CUPD ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Update - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface -// ***************************************************************************** -typedef struct _AT91S_PWMC { - AT91_REG PWMC_MR; // PWMC Mode Register - AT91_REG PWMC_ENA; // PWMC Enable Register - AT91_REG PWMC_DIS; // PWMC Disable Register - AT91_REG PWMC_SR; // PWMC Status Register - AT91_REG PWMC_IER; // PWMC Interrupt Enable Register - AT91_REG PWMC_IDR; // PWMC Interrupt Disable Register - AT91_REG PWMC_IMR; // PWMC Interrupt Mask Register - AT91_REG PWMC_ISR; // PWMC Interrupt Status Register - AT91_REG Reserved0[55]; // - AT91_REG PWMC_VR; // PWMC Version Register - AT91_REG Reserved1[64]; // - AT91S_PWMC_CH PWMC_CH[4]; // PWMC Channel -} AT91S_PWMC, *AT91PS_PWMC; - -// -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- -#define AT91C_PWMC_DIVA ((unsigned int) 0xFF << 0) // (PWMC) CLKA divide factor. -#define AT91C_PWMC_PREA ((unsigned int) 0xF << 8) // (PWMC) Divider Input Clock Prescaler A -#define AT91C_PWMC_PREA_MCK ((unsigned int) 0x0 << 8) // (PWMC) -#define AT91C_PWMC_DIVB ((unsigned int) 0xFF << 16) // (PWMC) CLKB divide factor. -#define AT91C_PWMC_PREB ((unsigned int) 0xF << 24) // (PWMC) Divider Input Clock Prescaler B -#define AT91C_PWMC_PREB_MCK ((unsigned int) 0x0 << 24) // (PWMC) -// -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- -#define AT91C_PWMC_CHID0 ((unsigned int) 0x1 << 0) // (PWMC) Channel ID 0 -#define AT91C_PWMC_CHID1 ((unsigned int) 0x1 << 1) // (PWMC) Channel ID 1 -#define AT91C_PWMC_CHID2 ((unsigned int) 0x1 << 2) // (PWMC) Channel ID 2 -#define AT91C_PWMC_CHID3 ((unsigned int) 0x1 << 3) // (PWMC) Channel ID 3 -// -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- -// -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- -// -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- -// -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- -// -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- -// -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR USB Device Interface -// ***************************************************************************** -typedef struct _AT91S_UDP { - AT91_REG UDP_NUM; // Frame Number Register - AT91_REG UDP_GLBSTATE; // Global State Register - AT91_REG UDP_FADDR; // Function Address Register - AT91_REG Reserved0[1]; // - AT91_REG UDP_IER; // Interrupt Enable Register - AT91_REG UDP_IDR; // Interrupt Disable Register - AT91_REG UDP_IMR; // Interrupt Mask Register - AT91_REG UDP_ISR; // Interrupt Status Register - AT91_REG UDP_ICR; // Interrupt Clear Register - AT91_REG Reserved1[1]; // - AT91_REG UDP_RSTEP; // Reset Endpoint Register - AT91_REG Reserved2[1]; // - AT91_REG UDP_CSR[6]; // Endpoint Control and Status Register - AT91_REG Reserved3[2]; // - AT91_REG UDP_FDR[6]; // Endpoint FIFO Data Register - AT91_REG Reserved4[3]; // - AT91_REG UDP_TXVC; // Transceiver Control Register -} AT91S_UDP, *AT91PS_UDP; - -// -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- -#define AT91C_UDP_FRM_NUM ((unsigned int) 0x7FF << 0) // (UDP) Frame Number as Defined in the Packet Field Formats -#define AT91C_UDP_FRM_ERR ((unsigned int) 0x1 << 16) // (UDP) Frame Error -#define AT91C_UDP_FRM_OK ((unsigned int) 0x1 << 17) // (UDP) Frame OK -// -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- -#define AT91C_UDP_FADDEN ((unsigned int) 0x1 << 0) // (UDP) Function Address Enable -#define AT91C_UDP_CONFG ((unsigned int) 0x1 << 1) // (UDP) Configured -#define AT91C_UDP_ESR ((unsigned int) 0x1 << 2) // (UDP) Enable Send Resume -#define AT91C_UDP_RSMINPR ((unsigned int) 0x1 << 3) // (UDP) A Resume Has Been Sent to the Host -#define AT91C_UDP_RMWUPE ((unsigned int) 0x1 << 4) // (UDP) Remote Wake Up Enable -// -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- -#define AT91C_UDP_FADD ((unsigned int) 0xFF << 0) // (UDP) Function Address Value -#define AT91C_UDP_FEN ((unsigned int) 0x1 << 8) // (UDP) Function Enable -// -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- -#define AT91C_UDP_EPINT0 ((unsigned int) 0x1 << 0) // (UDP) Endpoint 0 Interrupt -#define AT91C_UDP_EPINT1 ((unsigned int) 0x1 << 1) // (UDP) Endpoint 0 Interrupt -#define AT91C_UDP_EPINT2 ((unsigned int) 0x1 << 2) // (UDP) Endpoint 2 Interrupt -#define AT91C_UDP_EPINT3 ((unsigned int) 0x1 << 3) // (UDP) Endpoint 3 Interrupt -#define AT91C_UDP_EPINT4 ((unsigned int) 0x1 << 4) // (UDP) Endpoint 4 Interrupt -#define AT91C_UDP_EPINT5 ((unsigned int) 0x1 << 5) // (UDP) Endpoint 5 Interrupt -#define AT91C_UDP_RXSUSP ((unsigned int) 0x1 << 8) // (UDP) USB Suspend Interrupt -#define AT91C_UDP_RXRSM ((unsigned int) 0x1 << 9) // (UDP) USB Resume Interrupt -#define AT91C_UDP_EXTRSM ((unsigned int) 0x1 << 10) // (UDP) USB External Resume Interrupt -#define AT91C_UDP_SOFINT ((unsigned int) 0x1 << 11) // (UDP) USB Start Of frame Interrupt -#define AT91C_UDP_WAKEUP ((unsigned int) 0x1 << 13) // (UDP) USB Resume Interrupt -// -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- -// -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- -// -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- -#define AT91C_UDP_ENDBUSRES ((unsigned int) 0x1 << 12) // (UDP) USB End Of Bus Reset Interrupt -// -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- -// -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- -#define AT91C_UDP_EP0 ((unsigned int) 0x1 << 0) // (UDP) Reset Endpoint 0 -#define AT91C_UDP_EP1 ((unsigned int) 0x1 << 1) // (UDP) Reset Endpoint 1 -#define AT91C_UDP_EP2 ((unsigned int) 0x1 << 2) // (UDP) Reset Endpoint 2 -#define AT91C_UDP_EP3 ((unsigned int) 0x1 << 3) // (UDP) Reset Endpoint 3 -#define AT91C_UDP_EP4 ((unsigned int) 0x1 << 4) // (UDP) Reset Endpoint 4 -#define AT91C_UDP_EP5 ((unsigned int) 0x1 << 5) // (UDP) Reset Endpoint 5 -// -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- -#define AT91C_UDP_TXCOMP ((unsigned int) 0x1 << 0) // (UDP) Generates an IN packet with data previously written in the DPR -#define AT91C_UDP_RX_DATA_BK0 ((unsigned int) 0x1 << 1) // (UDP) Receive Data Bank 0 -#define AT91C_UDP_RXSETUP ((unsigned int) 0x1 << 2) // (UDP) Sends STALL to the Host (Control endpoints) -#define AT91C_UDP_ISOERROR ((unsigned int) 0x1 << 3) // (UDP) Isochronous error (Isochronous endpoints) -#define AT91C_UDP_TXPKTRDY ((unsigned int) 0x1 << 4) // (UDP) Transmit Packet Ready -#define AT91C_UDP_FORCESTALL ((unsigned int) 0x1 << 5) // (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). -#define AT91C_UDP_RX_DATA_BK1 ((unsigned int) 0x1 << 6) // (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). -#define AT91C_UDP_DIR ((unsigned int) 0x1 << 7) // (UDP) Transfer Direction -#define AT91C_UDP_EPTYPE ((unsigned int) 0x7 << 8) // (UDP) Endpoint type -#define AT91C_UDP_EPTYPE_CTRL ((unsigned int) 0x0 << 8) // (UDP) Control -#define AT91C_UDP_EPTYPE_ISO_OUT ((unsigned int) 0x1 << 8) // (UDP) Isochronous OUT -#define AT91C_UDP_EPTYPE_BULK_OUT ((unsigned int) 0x2 << 8) // (UDP) Bulk OUT -#define AT91C_UDP_EPTYPE_INT_OUT ((unsigned int) 0x3 << 8) // (UDP) Interrupt OUT -#define AT91C_UDP_EPTYPE_ISO_IN ((unsigned int) 0x5 << 8) // (UDP) Isochronous IN -#define AT91C_UDP_EPTYPE_BULK_IN ((unsigned int) 0x6 << 8) // (UDP) Bulk IN -#define AT91C_UDP_EPTYPE_INT_IN ((unsigned int) 0x7 << 8) // (UDP) Interrupt IN -#define AT91C_UDP_DTGLE ((unsigned int) 0x1 << 11) // (UDP) Data Toggle -#define AT91C_UDP_EPEDS ((unsigned int) 0x1 << 15) // (UDP) Endpoint Enable Disable -#define AT91C_UDP_RXBYTECNT ((unsigned int) 0x7FF << 16) // (UDP) Number Of Bytes Available in the FIFO -// -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- -#define AT91C_UDP_TXVDIS ((unsigned int) 0x1 << 8) // (UDP) -#define AT91C_UDP_PUON ((unsigned int) 0x1 << 9) // (UDP) Pull-up ON - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Timer Counter Channel Interface -// ***************************************************************************** -typedef struct _AT91S_TC { - AT91_REG TC_CCR; // Channel Control Register - AT91_REG TC_CMR; // Channel Mode Register (Capture Mode / Waveform Mode) - AT91_REG Reserved0[2]; // - AT91_REG TC_CV; // Counter Value - AT91_REG TC_RA; // Register A - AT91_REG TC_RB; // Register B - AT91_REG TC_RC; // Register C - AT91_REG TC_SR; // Status Register - AT91_REG TC_IER; // Interrupt Enable Register - AT91_REG TC_IDR; // Interrupt Disable Register - AT91_REG TC_IMR; // Interrupt Mask Register -} AT91S_TC, *AT91PS_TC; - -// -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- -#define AT91C_TC_CLKEN ((unsigned int) 0x1 << 0) // (TC) Counter Clock Enable Command -#define AT91C_TC_CLKDIS ((unsigned int) 0x1 << 1) // (TC) Counter Clock Disable Command -#define AT91C_TC_SWTRG ((unsigned int) 0x1 << 2) // (TC) Software Trigger Command -// -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- -#define AT91C_TC_CLKS ((unsigned int) 0x7 << 0) // (TC) Clock Selection -#define AT91C_TC_CLKS_TIMER_DIV1_CLOCK ((unsigned int) 0x0) // (TC) Clock selected: TIMER_DIV1_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV2_CLOCK ((unsigned int) 0x1) // (TC) Clock selected: TIMER_DIV2_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV3_CLOCK ((unsigned int) 0x2) // (TC) Clock selected: TIMER_DIV3_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV4_CLOCK ((unsigned int) 0x3) // (TC) Clock selected: TIMER_DIV4_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV5_CLOCK ((unsigned int) 0x4) // (TC) Clock selected: TIMER_DIV5_CLOCK -#define AT91C_TC_CLKS_XC0 ((unsigned int) 0x5) // (TC) Clock selected: XC0 -#define AT91C_TC_CLKS_XC1 ((unsigned int) 0x6) // (TC) Clock selected: XC1 -#define AT91C_TC_CLKS_XC2 ((unsigned int) 0x7) // (TC) Clock selected: XC2 -#define AT91C_TC_CLKI ((unsigned int) 0x1 << 3) // (TC) Clock Invert -#define AT91C_TC_BURST ((unsigned int) 0x3 << 4) // (TC) Burst Signal Selection -#define AT91C_TC_BURST_NONE ((unsigned int) 0x0 << 4) // (TC) The clock is not gated by an external signal -#define AT91C_TC_BURST_XC0 ((unsigned int) 0x1 << 4) // (TC) XC0 is ANDed with the selected clock -#define AT91C_TC_BURST_XC1 ((unsigned int) 0x2 << 4) // (TC) XC1 is ANDed with the selected clock -#define AT91C_TC_BURST_XC2 ((unsigned int) 0x3 << 4) // (TC) XC2 is ANDed with the selected clock -#define AT91C_TC_CPCSTOP ((unsigned int) 0x1 << 6) // (TC) Counter Clock Stopped with RC Compare -#define AT91C_TC_LDBSTOP ((unsigned int) 0x1 << 6) // (TC) Counter Clock Stopped with RB Loading -#define AT91C_TC_LDBDIS ((unsigned int) 0x1 << 7) // (TC) Counter Clock Disabled with RB Loading -#define AT91C_TC_CPCDIS ((unsigned int) 0x1 << 7) // (TC) Counter Clock Disable with RC Compare -#define AT91C_TC_ETRGEDG ((unsigned int) 0x3 << 8) // (TC) External Trigger Edge Selection -#define AT91C_TC_ETRGEDG_NONE ((unsigned int) 0x0 << 8) // (TC) Edge: None -#define AT91C_TC_ETRGEDG_RISING ((unsigned int) 0x1 << 8) // (TC) Edge: rising edge -#define AT91C_TC_ETRGEDG_FALLING ((unsigned int) 0x2 << 8) // (TC) Edge: falling edge -#define AT91C_TC_ETRGEDG_BOTH ((unsigned int) 0x3 << 8) // (TC) Edge: each edge -#define AT91C_TC_EEVTEDG ((unsigned int) 0x3 << 8) // (TC) External Event Edge Selection -#define AT91C_TC_EEVTEDG_NONE ((unsigned int) 0x0 << 8) // (TC) Edge: None -#define AT91C_TC_EEVTEDG_RISING ((unsigned int) 0x1 << 8) // (TC) Edge: rising edge -#define AT91C_TC_EEVTEDG_FALLING ((unsigned int) 0x2 << 8) // (TC) Edge: falling edge -#define AT91C_TC_EEVTEDG_BOTH ((unsigned int) 0x3 << 8) // (TC) Edge: each edge -#define AT91C_TC_ABETRG ((unsigned int) 0x1 << 10) // (TC) TIOA or TIOB External Trigger Selection -#define AT91C_TC_EEVT ((unsigned int) 0x3 << 10) // (TC) External Event Selection -#define AT91C_TC_EEVT_TIOB ((unsigned int) 0x0 << 10) // (TC) Signal selected as external event: TIOB TIOB direction: input -#define AT91C_TC_EEVT_XC0 ((unsigned int) 0x1 << 10) // (TC) Signal selected as external event: XC0 TIOB direction: output -#define AT91C_TC_EEVT_XC1 ((unsigned int) 0x2 << 10) // (TC) Signal selected as external event: XC1 TIOB direction: output -#define AT91C_TC_EEVT_XC2 ((unsigned int) 0x3 << 10) // (TC) Signal selected as external event: XC2 TIOB direction: output -#define AT91C_TC_ENETRG ((unsigned int) 0x1 << 12) // (TC) External Event Trigger enable -#define AT91C_TC_WAVESEL ((unsigned int) 0x3 << 13) // (TC) Waveform Selection -#define AT91C_TC_WAVESEL_UP ((unsigned int) 0x0 << 13) // (TC) UP mode without atomatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UPDOWN ((unsigned int) 0x1 << 13) // (TC) UPDOWN mode without automatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UP_AUTO ((unsigned int) 0x2 << 13) // (TC) UP mode with automatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UPDOWN_AUTO ((unsigned int) 0x3 << 13) // (TC) UPDOWN mode with automatic trigger on RC Compare -#define AT91C_TC_CPCTRG ((unsigned int) 0x1 << 14) // (TC) RC Compare Trigger Enable -#define AT91C_TC_WAVE ((unsigned int) 0x1 << 15) // (TC) -#define AT91C_TC_LDRA ((unsigned int) 0x3 << 16) // (TC) RA Loading Selection -#define AT91C_TC_LDRA_NONE ((unsigned int) 0x0 << 16) // (TC) Edge: None -#define AT91C_TC_LDRA_RISING ((unsigned int) 0x1 << 16) // (TC) Edge: rising edge of TIOA -#define AT91C_TC_LDRA_FALLING ((unsigned int) 0x2 << 16) // (TC) Edge: falling edge of TIOA -#define AT91C_TC_LDRA_BOTH ((unsigned int) 0x3 << 16) // (TC) Edge: each edge of TIOA -#define AT91C_TC_ACPA ((unsigned int) 0x3 << 16) // (TC) RA Compare Effect on TIOA -#define AT91C_TC_ACPA_NONE ((unsigned int) 0x0 << 16) // (TC) Effect: none -#define AT91C_TC_ACPA_SET ((unsigned int) 0x1 << 16) // (TC) Effect: set -#define AT91C_TC_ACPA_CLEAR ((unsigned int) 0x2 << 16) // (TC) Effect: clear -#define AT91C_TC_ACPA_TOGGLE ((unsigned int) 0x3 << 16) // (TC) Effect: toggle -#define AT91C_TC_LDRB ((unsigned int) 0x3 << 18) // (TC) RB Loading Selection -#define AT91C_TC_LDRB_NONE ((unsigned int) 0x0 << 18) // (TC) Edge: None -#define AT91C_TC_LDRB_RISING ((unsigned int) 0x1 << 18) // (TC) Edge: rising edge of TIOA -#define AT91C_TC_LDRB_FALLING ((unsigned int) 0x2 << 18) // (TC) Edge: falling edge of TIOA -#define AT91C_TC_LDRB_BOTH ((unsigned int) 0x3 << 18) // (TC) Edge: each edge of TIOA -#define AT91C_TC_ACPC ((unsigned int) 0x3 << 18) // (TC) RC Compare Effect on TIOA -#define AT91C_TC_ACPC_NONE ((unsigned int) 0x0 << 18) // (TC) Effect: none -#define AT91C_TC_ACPC_SET ((unsigned int) 0x1 << 18) // (TC) Effect: set -#define AT91C_TC_ACPC_CLEAR ((unsigned int) 0x2 << 18) // (TC) Effect: clear -#define AT91C_TC_ACPC_TOGGLE ((unsigned int) 0x3 << 18) // (TC) Effect: toggle -#define AT91C_TC_AEEVT ((unsigned int) 0x3 << 20) // (TC) External Event Effect on TIOA -#define AT91C_TC_AEEVT_NONE ((unsigned int) 0x0 << 20) // (TC) Effect: none -#define AT91C_TC_AEEVT_SET ((unsigned int) 0x1 << 20) // (TC) Effect: set -#define AT91C_TC_AEEVT_CLEAR ((unsigned int) 0x2 << 20) // (TC) Effect: clear -#define AT91C_TC_AEEVT_TOGGLE ((unsigned int) 0x3 << 20) // (TC) Effect: toggle -#define AT91C_TC_ASWTRG ((unsigned int) 0x3 << 22) // (TC) Software Trigger Effect on TIOA -#define AT91C_TC_ASWTRG_NONE ((unsigned int) 0x0 << 22) // (TC) Effect: none -#define AT91C_TC_ASWTRG_SET ((unsigned int) 0x1 << 22) // (TC) Effect: set -#define AT91C_TC_ASWTRG_CLEAR ((unsigned int) 0x2 << 22) // (TC) Effect: clear -#define AT91C_TC_ASWTRG_TOGGLE ((unsigned int) 0x3 << 22) // (TC) Effect: toggle -#define AT91C_TC_BCPB ((unsigned int) 0x3 << 24) // (TC) RB Compare Effect on TIOB -#define AT91C_TC_BCPB_NONE ((unsigned int) 0x0 << 24) // (TC) Effect: none -#define AT91C_TC_BCPB_SET ((unsigned int) 0x1 << 24) // (TC) Effect: set -#define AT91C_TC_BCPB_CLEAR ((unsigned int) 0x2 << 24) // (TC) Effect: clear -#define AT91C_TC_BCPB_TOGGLE ((unsigned int) 0x3 << 24) // (TC) Effect: toggle -#define AT91C_TC_BCPC ((unsigned int) 0x3 << 26) // (TC) RC Compare Effect on TIOB -#define AT91C_TC_BCPC_NONE ((unsigned int) 0x0 << 26) // (TC) Effect: none -#define AT91C_TC_BCPC_SET ((unsigned int) 0x1 << 26) // (TC) Effect: set -#define AT91C_TC_BCPC_CLEAR ((unsigned int) 0x2 << 26) // (TC) Effect: clear -#define AT91C_TC_BCPC_TOGGLE ((unsigned int) 0x3 << 26) // (TC) Effect: toggle -#define AT91C_TC_BEEVT ((unsigned int) 0x3 << 28) // (TC) External Event Effect on TIOB -#define AT91C_TC_BEEVT_NONE ((unsigned int) 0x0 << 28) // (TC) Effect: none -#define AT91C_TC_BEEVT_SET ((unsigned int) 0x1 << 28) // (TC) Effect: set -#define AT91C_TC_BEEVT_CLEAR ((unsigned int) 0x2 << 28) // (TC) Effect: clear -#define AT91C_TC_BEEVT_TOGGLE ((unsigned int) 0x3 << 28) // (TC) Effect: toggle -#define AT91C_TC_BSWTRG ((unsigned int) 0x3 << 30) // (TC) Software Trigger Effect on TIOB -#define AT91C_TC_BSWTRG_NONE ((unsigned int) 0x0 << 30) // (TC) Effect: none -#define AT91C_TC_BSWTRG_SET ((unsigned int) 0x1 << 30) // (TC) Effect: set -#define AT91C_TC_BSWTRG_CLEAR ((unsigned int) 0x2 << 30) // (TC) Effect: clear -#define AT91C_TC_BSWTRG_TOGGLE ((unsigned int) 0x3 << 30) // (TC) Effect: toggle -// -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- -#define AT91C_TC_COVFS ((unsigned int) 0x1 << 0) // (TC) Counter Overflow -#define AT91C_TC_LOVRS ((unsigned int) 0x1 << 1) // (TC) Load Overrun -#define AT91C_TC_CPAS ((unsigned int) 0x1 << 2) // (TC) RA Compare -#define AT91C_TC_CPBS ((unsigned int) 0x1 << 3) // (TC) RB Compare -#define AT91C_TC_CPCS ((unsigned int) 0x1 << 4) // (TC) RC Compare -#define AT91C_TC_LDRAS ((unsigned int) 0x1 << 5) // (TC) RA Loading -#define AT91C_TC_LDRBS ((unsigned int) 0x1 << 6) // (TC) RB Loading -#define AT91C_TC_ETRGS ((unsigned int) 0x1 << 7) // (TC) External Trigger -#define AT91C_TC_CLKSTA ((unsigned int) 0x1 << 16) // (TC) Clock Enabling -#define AT91C_TC_MTIOA ((unsigned int) 0x1 << 17) // (TC) TIOA Mirror -#define AT91C_TC_MTIOB ((unsigned int) 0x1 << 18) // (TC) TIOA Mirror -// -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- -// -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- -// -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Timer Counter Interface -// ***************************************************************************** -typedef struct _AT91S_TCB { - AT91S_TC TCB_TC0; // TC Channel 0 - AT91_REG Reserved0[4]; // - AT91S_TC TCB_TC1; // TC Channel 1 - AT91_REG Reserved1[4]; // - AT91S_TC TCB_TC2; // TC Channel 2 - AT91_REG Reserved2[4]; // - AT91_REG TCB_BCR; // TC Block Control Register - AT91_REG TCB_BMR; // TC Block Mode Register -} AT91S_TCB, *AT91PS_TCB; - -// -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- -#define AT91C_TCB_SYNC ((unsigned int) 0x1 << 0) // (TCB) Synchro Command -// -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- -#define AT91C_TCB_TC0XC0S ((unsigned int) 0x3 << 0) // (TCB) External Clock Signal 0 Selection -#define AT91C_TCB_TC0XC0S_TCLK0 ((unsigned int) 0x0) // (TCB) TCLK0 connected to XC0 -#define AT91C_TCB_TC0XC0S_NONE ((unsigned int) 0x1) // (TCB) None signal connected to XC0 -#define AT91C_TCB_TC0XC0S_TIOA1 ((unsigned int) 0x2) // (TCB) TIOA1 connected to XC0 -#define AT91C_TCB_TC0XC0S_TIOA2 ((unsigned int) 0x3) // (TCB) TIOA2 connected to XC0 -#define AT91C_TCB_TC1XC1S ((unsigned int) 0x3 << 2) // (TCB) External Clock Signal 1 Selection -#define AT91C_TCB_TC1XC1S_TCLK1 ((unsigned int) 0x0 << 2) // (TCB) TCLK1 connected to XC1 -#define AT91C_TCB_TC1XC1S_NONE ((unsigned int) 0x1 << 2) // (TCB) None signal connected to XC1 -#define AT91C_TCB_TC1XC1S_TIOA0 ((unsigned int) 0x2 << 2) // (TCB) TIOA0 connected to XC1 -#define AT91C_TCB_TC1XC1S_TIOA2 ((unsigned int) 0x3 << 2) // (TCB) TIOA2 connected to XC1 -#define AT91C_TCB_TC2XC2S ((unsigned int) 0x3 << 4) // (TCB) External Clock Signal 2 Selection -#define AT91C_TCB_TC2XC2S_TCLK2 ((unsigned int) 0x0 << 4) // (TCB) TCLK2 connected to XC2 -#define AT91C_TCB_TC2XC2S_NONE ((unsigned int) 0x1 << 4) // (TCB) None signal connected to XC2 -#define AT91C_TCB_TC2XC2S_TIOA0 ((unsigned int) 0x2 << 4) // (TCB) TIOA0 connected to XC2 -#define AT91C_TCB_TC2XC2S_TIOA1 ((unsigned int) 0x3 << 4) // (TCB) TIOA2 connected to XC2 - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface -// ***************************************************************************** -typedef struct _AT91S_CAN_MB { - AT91_REG CAN_MB_MMR; // MailBox Mode Register - AT91_REG CAN_MB_MAM; // MailBox Acceptance Mask Register - AT91_REG CAN_MB_MID; // MailBox ID Register - AT91_REG CAN_MB_MFID; // MailBox Family ID Register - AT91_REG CAN_MB_MSR; // MailBox Status Register - AT91_REG CAN_MB_MDL; // MailBox Data Low Register - AT91_REG CAN_MB_MDH; // MailBox Data High Register - AT91_REG CAN_MB_MCR; // MailBox Control Register -} AT91S_CAN_MB, *AT91PS_CAN_MB; - -// -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- -#define AT91C_CAN_MTIMEMARK ((unsigned int) 0xFFFF << 0) // (CAN_MB) Mailbox Timemark -#define AT91C_CAN_PRIOR ((unsigned int) 0xF << 16) // (CAN_MB) Mailbox Priority -#define AT91C_CAN_MOT ((unsigned int) 0x7 << 24) // (CAN_MB) Mailbox Object Type -#define AT91C_CAN_MOT_DIS ((unsigned int) 0x0 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_RX ((unsigned int) 0x1 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_RXOVERWRITE ((unsigned int) 0x2 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_TX ((unsigned int) 0x3 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_CONSUMER ((unsigned int) 0x4 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_PRODUCER ((unsigned int) 0x5 << 24) // (CAN_MB) -// -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- -#define AT91C_CAN_MIDvB ((unsigned int) 0x3FFFF << 0) // (CAN_MB) Complementary bits for identifier in extended mode -#define AT91C_CAN_MIDvA ((unsigned int) 0x7FF << 18) // (CAN_MB) Identifier for standard frame mode -#define AT91C_CAN_MIDE ((unsigned int) 0x1 << 29) // (CAN_MB) Identifier Version -// -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- -// -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- -// -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- -#define AT91C_CAN_MTIMESTAMP ((unsigned int) 0xFFFF << 0) // (CAN_MB) Timer Value -#define AT91C_CAN_MDLC ((unsigned int) 0xF << 16) // (CAN_MB) Mailbox Data Length Code -#define AT91C_CAN_MRTR ((unsigned int) 0x1 << 20) // (CAN_MB) Mailbox Remote Transmission Request -#define AT91C_CAN_MABT ((unsigned int) 0x1 << 22) // (CAN_MB) Mailbox Message Abort -#define AT91C_CAN_MRDY ((unsigned int) 0x1 << 23) // (CAN_MB) Mailbox Ready -#define AT91C_CAN_MMI ((unsigned int) 0x1 << 24) // (CAN_MB) Mailbox Message Ignored -// -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- -// -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- -// -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- -#define AT91C_CAN_MACR ((unsigned int) 0x1 << 22) // (CAN_MB) Abort Request for Mailbox -#define AT91C_CAN_MTCR ((unsigned int) 0x1 << 23) // (CAN_MB) Mailbox Transfer Command - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Control Area Network Interface -// ***************************************************************************** -typedef struct _AT91S_CAN { - AT91_REG CAN_MR; // Mode Register - AT91_REG CAN_IER; // Interrupt Enable Register - AT91_REG CAN_IDR; // Interrupt Disable Register - AT91_REG CAN_IMR; // Interrupt Mask Register - AT91_REG CAN_SR; // Status Register - AT91_REG CAN_BR; // Baudrate Register - AT91_REG CAN_TIM; // Timer Register - AT91_REG CAN_TIMESTP; // Time Stamp Register - AT91_REG CAN_ECR; // Error Counter Register - AT91_REG CAN_TCR; // Transfer Command Register - AT91_REG CAN_ACR; // Abort Command Register - AT91_REG Reserved0[52]; // - AT91_REG CAN_VR; // Version Register - AT91_REG Reserved1[64]; // - AT91S_CAN_MB CAN_MB0; // CAN Mailbox 0 - AT91S_CAN_MB CAN_MB1; // CAN Mailbox 1 - AT91S_CAN_MB CAN_MB2; // CAN Mailbox 2 - AT91S_CAN_MB CAN_MB3; // CAN Mailbox 3 - AT91S_CAN_MB CAN_MB4; // CAN Mailbox 4 - AT91S_CAN_MB CAN_MB5; // CAN Mailbox 5 - AT91S_CAN_MB CAN_MB6; // CAN Mailbox 6 - AT91S_CAN_MB CAN_MB7; // CAN Mailbox 7 - AT91S_CAN_MB CAN_MB8; // CAN Mailbox 8 - AT91S_CAN_MB CAN_MB9; // CAN Mailbox 9 - AT91S_CAN_MB CAN_MB10; // CAN Mailbox 10 - AT91S_CAN_MB CAN_MB11; // CAN Mailbox 11 - AT91S_CAN_MB CAN_MB12; // CAN Mailbox 12 - AT91S_CAN_MB CAN_MB13; // CAN Mailbox 13 - AT91S_CAN_MB CAN_MB14; // CAN Mailbox 14 - AT91S_CAN_MB CAN_MB15; // CAN Mailbox 15 -} AT91S_CAN, *AT91PS_CAN; - -// -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- -#define AT91C_CAN_CANEN ((unsigned int) 0x1 << 0) // (CAN) CAN Controller Enable -#define AT91C_CAN_LPM ((unsigned int) 0x1 << 1) // (CAN) Disable/Enable Low Power Mode -#define AT91C_CAN_ABM ((unsigned int) 0x1 << 2) // (CAN) Disable/Enable Autobaud/Listen Mode -#define AT91C_CAN_OVL ((unsigned int) 0x1 << 3) // (CAN) Disable/Enable Overload Frame -#define AT91C_CAN_TEOF ((unsigned int) 0x1 << 4) // (CAN) Time Stamp messages at each end of Frame -#define AT91C_CAN_TTM ((unsigned int) 0x1 << 5) // (CAN) Disable/Enable Time Trigger Mode -#define AT91C_CAN_TIMFRZ ((unsigned int) 0x1 << 6) // (CAN) Enable Timer Freeze -#define AT91C_CAN_DRPT ((unsigned int) 0x1 << 7) // (CAN) Disable Repeat -// -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- -#define AT91C_CAN_MB0 ((unsigned int) 0x1 << 0) // (CAN) Mailbox 0 Flag -#define AT91C_CAN_MB1 ((unsigned int) 0x1 << 1) // (CAN) Mailbox 1 Flag -#define AT91C_CAN_MB2 ((unsigned int) 0x1 << 2) // (CAN) Mailbox 2 Flag -#define AT91C_CAN_MB3 ((unsigned int) 0x1 << 3) // (CAN) Mailbox 3 Flag -#define AT91C_CAN_MB4 ((unsigned int) 0x1 << 4) // (CAN) Mailbox 4 Flag -#define AT91C_CAN_MB5 ((unsigned int) 0x1 << 5) // (CAN) Mailbox 5 Flag -#define AT91C_CAN_MB6 ((unsigned int) 0x1 << 6) // (CAN) Mailbox 6 Flag -#define AT91C_CAN_MB7 ((unsigned int) 0x1 << 7) // (CAN) Mailbox 7 Flag -#define AT91C_CAN_MB8 ((unsigned int) 0x1 << 8) // (CAN) Mailbox 8 Flag -#define AT91C_CAN_MB9 ((unsigned int) 0x1 << 9) // (CAN) Mailbox 9 Flag -#define AT91C_CAN_MB10 ((unsigned int) 0x1 << 10) // (CAN) Mailbox 10 Flag -#define AT91C_CAN_MB11 ((unsigned int) 0x1 << 11) // (CAN) Mailbox 11 Flag -#define AT91C_CAN_MB12 ((unsigned int) 0x1 << 12) // (CAN) Mailbox 12 Flag -#define AT91C_CAN_MB13 ((unsigned int) 0x1 << 13) // (CAN) Mailbox 13 Flag -#define AT91C_CAN_MB14 ((unsigned int) 0x1 << 14) // (CAN) Mailbox 14 Flag -#define AT91C_CAN_MB15 ((unsigned int) 0x1 << 15) // (CAN) Mailbox 15 Flag -#define AT91C_CAN_ERRA ((unsigned int) 0x1 << 16) // (CAN) Error Active Mode Flag -#define AT91C_CAN_WARN ((unsigned int) 0x1 << 17) // (CAN) Warning Limit Flag -#define AT91C_CAN_ERRP ((unsigned int) 0x1 << 18) // (CAN) Error Passive Mode Flag -#define AT91C_CAN_BOFF ((unsigned int) 0x1 << 19) // (CAN) Bus Off Mode Flag -#define AT91C_CAN_SLEEP ((unsigned int) 0x1 << 20) // (CAN) Sleep Flag -#define AT91C_CAN_WAKEUP ((unsigned int) 0x1 << 21) // (CAN) Wakeup Flag -#define AT91C_CAN_TOVF ((unsigned int) 0x1 << 22) // (CAN) Timer Overflow Flag -#define AT91C_CAN_TSTP ((unsigned int) 0x1 << 23) // (CAN) Timestamp Flag -#define AT91C_CAN_CERR ((unsigned int) 0x1 << 24) // (CAN) CRC Error -#define AT91C_CAN_SERR ((unsigned int) 0x1 << 25) // (CAN) Stuffing Error -#define AT91C_CAN_AERR ((unsigned int) 0x1 << 26) // (CAN) Acknowledgment Error -#define AT91C_CAN_FERR ((unsigned int) 0x1 << 27) // (CAN) Form Error -#define AT91C_CAN_BERR ((unsigned int) 0x1 << 28) // (CAN) Bit Error -// -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- -// -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- -// -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- -#define AT91C_CAN_RBSY ((unsigned int) 0x1 << 29) // (CAN) Receiver Busy -#define AT91C_CAN_TBSY ((unsigned int) 0x1 << 30) // (CAN) Transmitter Busy -#define AT91C_CAN_OVLY ((unsigned int) 0x1 << 31) // (CAN) Overload Busy -// -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- -#define AT91C_CAN_PHASE2 ((unsigned int) 0x7 << 0) // (CAN) Phase 2 segment -#define AT91C_CAN_PHASE1 ((unsigned int) 0x7 << 4) // (CAN) Phase 1 segment -#define AT91C_CAN_PROPAG ((unsigned int) 0x7 << 8) // (CAN) Programmation time segment -#define AT91C_CAN_SYNC ((unsigned int) 0x3 << 12) // (CAN) Re-synchronization jump width segment -#define AT91C_CAN_BRP ((unsigned int) 0x7F << 16) // (CAN) Baudrate Prescaler -#define AT91C_CAN_SMP ((unsigned int) 0x1 << 24) // (CAN) Sampling mode -// -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- -#define AT91C_CAN_TIMER ((unsigned int) 0xFFFF << 0) // (CAN) Timer field -// -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- -// -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- -#define AT91C_CAN_REC ((unsigned int) 0xFF << 0) // (CAN) Receive Error Counter -#define AT91C_CAN_TEC ((unsigned int) 0xFF << 16) // (CAN) Transmit Error Counter -// -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- -#define AT91C_CAN_TIMRST ((unsigned int) 0x1 << 31) // (CAN) Timer Reset Field -// -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 -// ***************************************************************************** -typedef struct _AT91S_EMAC { - AT91_REG EMAC_NCR; // Network Control Register - AT91_REG EMAC_NCFGR; // Network Configuration Register - AT91_REG EMAC_NSR; // Network Status Register - AT91_REG Reserved0[2]; // - AT91_REG EMAC_TSR; // Transmit Status Register - AT91_REG EMAC_RBQP; // Receive Buffer Queue Pointer - AT91_REG EMAC_TBQP; // Transmit Buffer Queue Pointer - AT91_REG EMAC_RSR; // Receive Status Register - AT91_REG EMAC_ISR; // Interrupt Status Register - AT91_REG EMAC_IER; // Interrupt Enable Register - AT91_REG EMAC_IDR; // Interrupt Disable Register - AT91_REG EMAC_IMR; // Interrupt Mask Register - AT91_REG EMAC_MAN; // PHY Maintenance Register - AT91_REG EMAC_PTR; // Pause Time Register - AT91_REG EMAC_PFR; // Pause Frames received Register - AT91_REG EMAC_FTO; // Frames Transmitted OK Register - AT91_REG EMAC_SCF; // Single Collision Frame Register - AT91_REG EMAC_MCF; // Multiple Collision Frame Register - AT91_REG EMAC_FRO; // Frames Received OK Register - AT91_REG EMAC_FCSE; // Frame Check Sequence Error Register - AT91_REG EMAC_ALE; // Alignment Error Register - AT91_REG EMAC_DTF; // Deferred Transmission Frame Register - AT91_REG EMAC_LCOL; // Late Collision Register - AT91_REG EMAC_ECOL; // Excessive Collision Register - AT91_REG EMAC_TUND; // Transmit Underrun Error Register - AT91_REG EMAC_CSE; // Carrier Sense Error Register - AT91_REG EMAC_RRE; // Receive Ressource Error Register - AT91_REG EMAC_ROV; // Receive Overrun Errors Register - AT91_REG EMAC_RSE; // Receive Symbol Errors Register - AT91_REG EMAC_ELE; // Excessive Length Errors Register - AT91_REG EMAC_RJA; // Receive Jabbers Register - AT91_REG EMAC_USF; // Undersize Frames Register - AT91_REG EMAC_STE; // SQE Test Error Register - AT91_REG EMAC_RLE; // Receive Length Field Mismatch Register - AT91_REG EMAC_TPF; // Transmitted Pause Frames Register - AT91_REG EMAC_HRB; // Hash Address Bottom[31:0] - AT91_REG EMAC_HRT; // Hash Address Top[63:32] - AT91_REG EMAC_SA1L; // Specific Address 1 Bottom, First 4 bytes - AT91_REG EMAC_SA1H; // Specific Address 1 Top, Last 2 bytes - AT91_REG EMAC_SA2L; // Specific Address 2 Bottom, First 4 bytes - AT91_REG EMAC_SA2H; // Specific Address 2 Top, Last 2 bytes - AT91_REG EMAC_SA3L; // Specific Address 3 Bottom, First 4 bytes - AT91_REG EMAC_SA3H; // Specific Address 3 Top, Last 2 bytes - AT91_REG EMAC_SA4L; // Specific Address 4 Bottom, First 4 bytes - AT91_REG EMAC_SA4H; // Specific Address 4 Top, Last 2 bytes - AT91_REG EMAC_TID; // Type ID Checking Register - AT91_REG EMAC_TPQ; // Transmit Pause Quantum Register - AT91_REG EMAC_USRIO; // USER Input/Output Register - AT91_REG EMAC_WOL; // Wake On LAN Register - AT91_REG Reserved1[13]; // - AT91_REG EMAC_REV; // Revision Register -} AT91S_EMAC, *AT91PS_EMAC; - -// -------- EMAC_NCR : (EMAC Offset: 0x0) -------- -#define AT91C_EMAC_LB ((unsigned int) 0x1 << 0) // (EMAC) Loopback. Optional. When set, loopback signal is at high level. -#define AT91C_EMAC_LLB ((unsigned int) 0x1 << 1) // (EMAC) Loopback local. -#define AT91C_EMAC_RE ((unsigned int) 0x1 << 2) // (EMAC) Receive enable. -#define AT91C_EMAC_TE ((unsigned int) 0x1 << 3) // (EMAC) Transmit enable. -#define AT91C_EMAC_MPE ((unsigned int) 0x1 << 4) // (EMAC) Management port enable. -#define AT91C_EMAC_CLRSTAT ((unsigned int) 0x1 << 5) // (EMAC) Clear statistics registers. -#define AT91C_EMAC_INCSTAT ((unsigned int) 0x1 << 6) // (EMAC) Increment statistics registers. -#define AT91C_EMAC_WESTAT ((unsigned int) 0x1 << 7) // (EMAC) Write enable for statistics registers. -#define AT91C_EMAC_BP ((unsigned int) 0x1 << 8) // (EMAC) Back pressure. -#define AT91C_EMAC_TSTART ((unsigned int) 0x1 << 9) // (EMAC) Start Transmission. -#define AT91C_EMAC_THALT ((unsigned int) 0x1 << 10) // (EMAC) Transmission Halt. -#define AT91C_EMAC_TPFR ((unsigned int) 0x1 << 11) // (EMAC) Transmit pause frame -#define AT91C_EMAC_TZQ ((unsigned int) 0x1 << 12) // (EMAC) Transmit zero quantum pause frame -// -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- -#define AT91C_EMAC_SPD ((unsigned int) 0x1 << 0) // (EMAC) Speed. -#define AT91C_EMAC_FD ((unsigned int) 0x1 << 1) // (EMAC) Full duplex. -#define AT91C_EMAC_JFRAME ((unsigned int) 0x1 << 3) // (EMAC) Jumbo Frames. -#define AT91C_EMAC_CAF ((unsigned int) 0x1 << 4) // (EMAC) Copy all frames. -#define AT91C_EMAC_NBC ((unsigned int) 0x1 << 5) // (EMAC) No broadcast. -#define AT91C_EMAC_MTI ((unsigned int) 0x1 << 6) // (EMAC) Multicast hash event enable -#define AT91C_EMAC_UNI ((unsigned int) 0x1 << 7) // (EMAC) Unicast hash enable. -#define AT91C_EMAC_BIG ((unsigned int) 0x1 << 8) // (EMAC) Receive 1522 bytes. -#define AT91C_EMAC_EAE ((unsigned int) 0x1 << 9) // (EMAC) External address match enable. -#define AT91C_EMAC_CLK ((unsigned int) 0x3 << 10) // (EMAC) -#define AT91C_EMAC_CLK_HCLK_8 ((unsigned int) 0x0 << 10) // (EMAC) HCLK divided by 8 -#define AT91C_EMAC_CLK_HCLK_16 ((unsigned int) 0x1 << 10) // (EMAC) HCLK divided by 16 -#define AT91C_EMAC_CLK_HCLK_32 ((unsigned int) 0x2 << 10) // (EMAC) HCLK divided by 32 -#define AT91C_EMAC_CLK_HCLK_64 ((unsigned int) 0x3 << 10) // (EMAC) HCLK divided by 64 -#define AT91C_EMAC_RTY ((unsigned int) 0x1 << 12) // (EMAC) -#define AT91C_EMAC_PAE ((unsigned int) 0x1 << 13) // (EMAC) -#define AT91C_EMAC_RBOF ((unsigned int) 0x3 << 14) // (EMAC) -#define AT91C_EMAC_RBOF_OFFSET_0 ((unsigned int) 0x0 << 14) // (EMAC) no offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_1 ((unsigned int) 0x1 << 14) // (EMAC) one byte offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_2 ((unsigned int) 0x2 << 14) // (EMAC) two bytes offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_3 ((unsigned int) 0x3 << 14) // (EMAC) three bytes offset from start of receive buffer -#define AT91C_EMAC_RLCE ((unsigned int) 0x1 << 16) // (EMAC) Receive Length field Checking Enable -#define AT91C_EMAC_DRFCS ((unsigned int) 0x1 << 17) // (EMAC) Discard Receive FCS -#define AT91C_EMAC_EFRHD ((unsigned int) 0x1 << 18) // (EMAC) -#define AT91C_EMAC_IRXFCS ((unsigned int) 0x1 << 19) // (EMAC) Ignore RX FCS -// -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- -#define AT91C_EMAC_LINKR ((unsigned int) 0x1 << 0) // (EMAC) -#define AT91C_EMAC_MDIO ((unsigned int) 0x1 << 1) // (EMAC) -#define AT91C_EMAC_IDLE ((unsigned int) 0x1 << 2) // (EMAC) -// -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- -#define AT91C_EMAC_UBR ((unsigned int) 0x1 << 0) // (EMAC) -#define AT91C_EMAC_COL ((unsigned int) 0x1 << 1) // (EMAC) -#define AT91C_EMAC_RLES ((unsigned int) 0x1 << 2) // (EMAC) -#define AT91C_EMAC_TGO ((unsigned int) 0x1 << 3) // (EMAC) Transmit Go -#define AT91C_EMAC_BEX ((unsigned int) 0x1 << 4) // (EMAC) Buffers exhausted mid frame -#define AT91C_EMAC_COMP ((unsigned int) 0x1 << 5) // (EMAC) -#define AT91C_EMAC_UND ((unsigned int) 0x1 << 6) // (EMAC) -// -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- -#define AT91C_EMAC_BNA ((unsigned int) 0x1 << 0) // (EMAC) -#define AT91C_EMAC_REC ((unsigned int) 0x1 << 1) // (EMAC) -#define AT91C_EMAC_OVR ((unsigned int) 0x1 << 2) // (EMAC) -// -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- -#define AT91C_EMAC_MFD ((unsigned int) 0x1 << 0) // (EMAC) -#define AT91C_EMAC_RCOMP ((unsigned int) 0x1 << 1) // (EMAC) -#define AT91C_EMAC_RXUBR ((unsigned int) 0x1 << 2) // (EMAC) -#define AT91C_EMAC_TXUBR ((unsigned int) 0x1 << 3) // (EMAC) -#define AT91C_EMAC_TUNDR ((unsigned int) 0x1 << 4) // (EMAC) -#define AT91C_EMAC_RLEX ((unsigned int) 0x1 << 5) // (EMAC) -#define AT91C_EMAC_TXERR ((unsigned int) 0x1 << 6) // (EMAC) -#define AT91C_EMAC_TCOMP ((unsigned int) 0x1 << 7) // (EMAC) -#define AT91C_EMAC_LINK ((unsigned int) 0x1 << 9) // (EMAC) -#define AT91C_EMAC_ROVR ((unsigned int) 0x1 << 10) // (EMAC) -#define AT91C_EMAC_HRESP ((unsigned int) 0x1 << 11) // (EMAC) -#define AT91C_EMAC_PFRE ((unsigned int) 0x1 << 12) // (EMAC) -#define AT91C_EMAC_PTZ ((unsigned int) 0x1 << 13) // (EMAC) -// -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- -// -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- -// -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- -// -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- -#define AT91C_EMAC_DATA ((unsigned int) 0xFFFF << 0) // (EMAC) -#define AT91C_EMAC_CODE ((unsigned int) 0x3 << 16) // (EMAC) -#define AT91C_EMAC_REGA ((unsigned int) 0x1F << 18) // (EMAC) -#define AT91C_EMAC_PHYA ((unsigned int) 0x1F << 23) // (EMAC) -#define AT91C_EMAC_RW ((unsigned int) 0x3 << 28) // (EMAC) -#define AT91C_EMAC_SOF ((unsigned int) 0x3 << 30) // (EMAC) -// -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- -#define AT91C_EMAC_RMII ((unsigned int) 0x1 << 0) // (EMAC) Reduce MII -#define AT91C_EMAC_CLKEN ((unsigned int) 0x1 << 1) // (EMAC) Clock Enable -// -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- -#define AT91C_EMAC_IP ((unsigned int) 0xFFFF << 0) // (EMAC) ARP request IP address -#define AT91C_EMAC_MAG ((unsigned int) 0x1 << 16) // (EMAC) Magic packet event enable -#define AT91C_EMAC_ARP ((unsigned int) 0x1 << 17) // (EMAC) ARP request event enable -#define AT91C_EMAC_SA1 ((unsigned int) 0x1 << 18) // (EMAC) Specific address register 1 event enable -// -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- -#define AT91C_EMAC_REVREF ((unsigned int) 0xFFFF << 0) // (EMAC) -#define AT91C_EMAC_PARTREF ((unsigned int) 0xFFFF << 16) // (EMAC) - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Analog to Digital Convertor -// ***************************************************************************** -typedef struct _AT91S_ADC { - AT91_REG ADC_CR; // ADC Control Register - AT91_REG ADC_MR; // ADC Mode Register - AT91_REG Reserved0[2]; // - AT91_REG ADC_CHER; // ADC Channel Enable Register - AT91_REG ADC_CHDR; // ADC Channel Disable Register - AT91_REG ADC_CHSR; // ADC Channel Status Register - AT91_REG ADC_SR; // ADC Status Register - AT91_REG ADC_LCDR; // ADC Last Converted Data Register - AT91_REG ADC_IER; // ADC Interrupt Enable Register - AT91_REG ADC_IDR; // ADC Interrupt Disable Register - AT91_REG ADC_IMR; // ADC Interrupt Mask Register - AT91_REG ADC_CDR0; // ADC Channel Data Register 0 - AT91_REG ADC_CDR1; // ADC Channel Data Register 1 - AT91_REG ADC_CDR2; // ADC Channel Data Register 2 - AT91_REG ADC_CDR3; // ADC Channel Data Register 3 - AT91_REG ADC_CDR4; // ADC Channel Data Register 4 - AT91_REG ADC_CDR5; // ADC Channel Data Register 5 - AT91_REG ADC_CDR6; // ADC Channel Data Register 6 - AT91_REG ADC_CDR7; // ADC Channel Data Register 7 - AT91_REG Reserved1[44]; // - AT91_REG ADC_RPR; // Receive Pointer Register - AT91_REG ADC_RCR; // Receive Counter Register - AT91_REG ADC_TPR; // Transmit Pointer Register - AT91_REG ADC_TCR; // Transmit Counter Register - AT91_REG ADC_RNPR; // Receive Next Pointer Register - AT91_REG ADC_RNCR; // Receive Next Counter Register - AT91_REG ADC_TNPR; // Transmit Next Pointer Register - AT91_REG ADC_TNCR; // Transmit Next Counter Register - AT91_REG ADC_PTCR; // PDC Transfer Control Register - AT91_REG ADC_PTSR; // PDC Transfer Status Register -} AT91S_ADC, *AT91PS_ADC; - -// -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- -#define AT91C_ADC_SWRST ((unsigned int) 0x1 << 0) // (ADC) Software Reset -#define AT91C_ADC_START ((unsigned int) 0x1 << 1) // (ADC) Start Conversion -// -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- -#define AT91C_ADC_TRGEN ((unsigned int) 0x1 << 0) // (ADC) Trigger Enable -#define AT91C_ADC_TRGEN_DIS ((unsigned int) 0x0) // (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software -#define AT91C_ADC_TRGEN_EN ((unsigned int) 0x1) // (ADC) Hardware trigger selected by TRGSEL field is enabled. -#define AT91C_ADC_TRGSEL ((unsigned int) 0x7 << 1) // (ADC) Trigger Selection -#define AT91C_ADC_TRGSEL_TIOA0 ((unsigned int) 0x0 << 1) // (ADC) Selected TRGSEL = TIAO0 -#define AT91C_ADC_TRGSEL_TIOA1 ((unsigned int) 0x1 << 1) // (ADC) Selected TRGSEL = TIAO1 -#define AT91C_ADC_TRGSEL_TIOA2 ((unsigned int) 0x2 << 1) // (ADC) Selected TRGSEL = TIAO2 -#define AT91C_ADC_TRGSEL_TIOA3 ((unsigned int) 0x3 << 1) // (ADC) Selected TRGSEL = TIAO3 -#define AT91C_ADC_TRGSEL_TIOA4 ((unsigned int) 0x4 << 1) // (ADC) Selected TRGSEL = TIAO4 -#define AT91C_ADC_TRGSEL_TIOA5 ((unsigned int) 0x5 << 1) // (ADC) Selected TRGSEL = TIAO5 -#define AT91C_ADC_TRGSEL_EXT ((unsigned int) 0x6 << 1) // (ADC) Selected TRGSEL = External Trigger -#define AT91C_ADC_LOWRES ((unsigned int) 0x1 << 4) // (ADC) Resolution. -#define AT91C_ADC_LOWRES_10_BIT ((unsigned int) 0x0 << 4) // (ADC) 10-bit resolution -#define AT91C_ADC_LOWRES_8_BIT ((unsigned int) 0x1 << 4) // (ADC) 8-bit resolution -#define AT91C_ADC_SLEEP ((unsigned int) 0x1 << 5) // (ADC) Sleep Mode -#define AT91C_ADC_SLEEP_NORMAL_MODE ((unsigned int) 0x0 << 5) // (ADC) Normal Mode -#define AT91C_ADC_SLEEP_MODE ((unsigned int) 0x1 << 5) // (ADC) Sleep Mode -#define AT91C_ADC_PRESCAL ((unsigned int) 0x3F << 8) // (ADC) Prescaler rate selection -#define AT91C_ADC_STARTUP ((unsigned int) 0x1F << 16) // (ADC) Startup Time -#define AT91C_ADC_SHTIM ((unsigned int) 0xF << 24) // (ADC) Sample & Hold Time -// -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- -#define AT91C_ADC_CH0 ((unsigned int) 0x1 << 0) // (ADC) Channel 0 -#define AT91C_ADC_CH1 ((unsigned int) 0x1 << 1) // (ADC) Channel 1 -#define AT91C_ADC_CH2 ((unsigned int) 0x1 << 2) // (ADC) Channel 2 -#define AT91C_ADC_CH3 ((unsigned int) 0x1 << 3) // (ADC) Channel 3 -#define AT91C_ADC_CH4 ((unsigned int) 0x1 << 4) // (ADC) Channel 4 -#define AT91C_ADC_CH5 ((unsigned int) 0x1 << 5) // (ADC) Channel 5 -#define AT91C_ADC_CH6 ((unsigned int) 0x1 << 6) // (ADC) Channel 6 -#define AT91C_ADC_CH7 ((unsigned int) 0x1 << 7) // (ADC) Channel 7 -// -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- -// -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- -// -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- -#define AT91C_ADC_EOC0 ((unsigned int) 0x1 << 0) // (ADC) End of Conversion -#define AT91C_ADC_EOC1 ((unsigned int) 0x1 << 1) // (ADC) End of Conversion -#define AT91C_ADC_EOC2 ((unsigned int) 0x1 << 2) // (ADC) End of Conversion -#define AT91C_ADC_EOC3 ((unsigned int) 0x1 << 3) // (ADC) End of Conversion -#define AT91C_ADC_EOC4 ((unsigned int) 0x1 << 4) // (ADC) End of Conversion -#define AT91C_ADC_EOC5 ((unsigned int) 0x1 << 5) // (ADC) End of Conversion -#define AT91C_ADC_EOC6 ((unsigned int) 0x1 << 6) // (ADC) End of Conversion -#define AT91C_ADC_EOC7 ((unsigned int) 0x1 << 7) // (ADC) End of Conversion -#define AT91C_ADC_OVRE0 ((unsigned int) 0x1 << 8) // (ADC) Overrun Error -#define AT91C_ADC_OVRE1 ((unsigned int) 0x1 << 9) // (ADC) Overrun Error -#define AT91C_ADC_OVRE2 ((unsigned int) 0x1 << 10) // (ADC) Overrun Error -#define AT91C_ADC_OVRE3 ((unsigned int) 0x1 << 11) // (ADC) Overrun Error -#define AT91C_ADC_OVRE4 ((unsigned int) 0x1 << 12) // (ADC) Overrun Error -#define AT91C_ADC_OVRE5 ((unsigned int) 0x1 << 13) // (ADC) Overrun Error -#define AT91C_ADC_OVRE6 ((unsigned int) 0x1 << 14) // (ADC) Overrun Error -#define AT91C_ADC_OVRE7 ((unsigned int) 0x1 << 15) // (ADC) Overrun Error -#define AT91C_ADC_DRDY ((unsigned int) 0x1 << 16) // (ADC) Data Ready -#define AT91C_ADC_GOVRE ((unsigned int) 0x1 << 17) // (ADC) General Overrun -#define AT91C_ADC_ENDRX ((unsigned int) 0x1 << 18) // (ADC) End of Receiver Transfer -#define AT91C_ADC_RXBUFF ((unsigned int) 0x1 << 19) // (ADC) RXBUFF Interrupt -// -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- -#define AT91C_ADC_LDATA ((unsigned int) 0x3FF << 0) // (ADC) Last Data Converted -// -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- -// -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- -// -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- -// -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- -#define AT91C_ADC_DATA ((unsigned int) 0x3FF << 0) // (ADC) Converted Data -// -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- -// -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- -// -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- -// -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- -// -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- -// -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- -// -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- - -// ***************************************************************************** -// REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 -// ***************************************************************************** -// ========== Register definition for SYS peripheral ========== -// ========== Register definition for AIC peripheral ========== -#define AT91C_AIC_ICCR ((AT91_REG *) 0xFFFFF128) // (AIC) Interrupt Clear Command Register -#define AT91C_AIC_IECR ((AT91_REG *) 0xFFFFF120) // (AIC) Interrupt Enable Command Register -#define AT91C_AIC_SMR ((AT91_REG *) 0xFFFFF000) // (AIC) Source Mode Register -#define AT91C_AIC_ISCR ((AT91_REG *) 0xFFFFF12C) // (AIC) Interrupt Set Command Register -#define AT91C_AIC_EOICR ((AT91_REG *) 0xFFFFF130) // (AIC) End of Interrupt Command Register -#define AT91C_AIC_DCR ((AT91_REG *) 0xFFFFF138) // (AIC) Debug Control Register (Protect) -#define AT91C_AIC_FFER ((AT91_REG *) 0xFFFFF140) // (AIC) Fast Forcing Enable Register -#define AT91C_AIC_SVR ((AT91_REG *) 0xFFFFF080) // (AIC) Source Vector Register -#define AT91C_AIC_SPU ((AT91_REG *) 0xFFFFF134) // (AIC) Spurious Vector Register -#define AT91C_AIC_FFDR ((AT91_REG *) 0xFFFFF144) // (AIC) Fast Forcing Disable Register -#define AT91C_AIC_FVR ((AT91_REG *) 0xFFFFF104) // (AIC) FIQ Vector Register -#define AT91C_AIC_FFSR ((AT91_REG *) 0xFFFFF148) // (AIC) Fast Forcing Status Register -#define AT91C_AIC_IMR ((AT91_REG *) 0xFFFFF110) // (AIC) Interrupt Mask Register -#define AT91C_AIC_ISR ((AT91_REG *) 0xFFFFF108) // (AIC) Interrupt Status Register -#define AT91C_AIC_IVR ((AT91_REG *) 0xFFFFF100) // (AIC) IRQ Vector Register -#define AT91C_AIC_IDCR ((AT91_REG *) 0xFFFFF124) // (AIC) Interrupt Disable Command Register -#define AT91C_AIC_CISR ((AT91_REG *) 0xFFFFF114) // (AIC) Core Interrupt Status Register -#define AT91C_AIC_IPR ((AT91_REG *) 0xFFFFF10C) // (AIC) Interrupt Pending Register -// ========== Register definition for PDC_DBGU peripheral ========== -#define AT91C_DBGU_TNCR ((AT91_REG *) 0xFFFFF31C) // (PDC_DBGU) Transmit Next Counter Register -#define AT91C_DBGU_RNCR ((AT91_REG *) 0xFFFFF314) // (PDC_DBGU) Receive Next Counter Register -#define AT91C_DBGU_PTCR ((AT91_REG *) 0xFFFFF320) // (PDC_DBGU) PDC Transfer Control Register -#define AT91C_DBGU_PTSR ((AT91_REG *) 0xFFFFF324) // (PDC_DBGU) PDC Transfer Status Register -#define AT91C_DBGU_RCR ((AT91_REG *) 0xFFFFF304) // (PDC_DBGU) Receive Counter Register -#define AT91C_DBGU_TCR ((AT91_REG *) 0xFFFFF30C) // (PDC_DBGU) Transmit Counter Register -#define AT91C_DBGU_RPR ((AT91_REG *) 0xFFFFF300) // (PDC_DBGU) Receive Pointer Register -#define AT91C_DBGU_TPR ((AT91_REG *) 0xFFFFF308) // (PDC_DBGU) Transmit Pointer Register -#define AT91C_DBGU_RNPR ((AT91_REG *) 0xFFFFF310) // (PDC_DBGU) Receive Next Pointer Register -#define AT91C_DBGU_TNPR ((AT91_REG *) 0xFFFFF318) // (PDC_DBGU) Transmit Next Pointer Register -// ========== Register definition for DBGU peripheral ========== -#define AT91C_DBGU_EXID ((AT91_REG *) 0xFFFFF244) // (DBGU) Chip ID Extension Register -#define AT91C_DBGU_THR ((AT91_REG *) 0xFFFFF21C) // (DBGU) Transmitter Holding Register -#define AT91C_DBGU_CSR ((AT91_REG *) 0xFFFFF214) // (DBGU) Channel Status Register -#define AT91C_DBGU_IDR ((AT91_REG *) 0xFFFFF20C) // (DBGU) Interrupt Disable Register -#define AT91C_DBGU_MR ((AT91_REG *) 0xFFFFF204) // (DBGU) Mode Register -#define AT91C_DBGU_FNTR ((AT91_REG *) 0xFFFFF248) // (DBGU) Force NTRST Register -#define AT91C_DBGU_CIDR ((AT91_REG *) 0xFFFFF240) // (DBGU) Chip ID Register -#define AT91C_DBGU_BRGR ((AT91_REG *) 0xFFFFF220) // (DBGU) Baud Rate Generator Register -#define AT91C_DBGU_RHR ((AT91_REG *) 0xFFFFF218) // (DBGU) Receiver Holding Register -#define AT91C_DBGU_IMR ((AT91_REG *) 0xFFFFF210) // (DBGU) Interrupt Mask Register -#define AT91C_DBGU_IER ((AT91_REG *) 0xFFFFF208) // (DBGU) Interrupt Enable Register -#define AT91C_DBGU_CR ((AT91_REG *) 0xFFFFF200) // (DBGU) Control Register -// ========== Register definition for PIOA peripheral ========== -#define AT91C_PIOA_IMR ((AT91_REG *) 0xFFFFF448) // (PIOA) Interrupt Mask Register -#define AT91C_PIOA_IER ((AT91_REG *) 0xFFFFF440) // (PIOA) Interrupt Enable Register -#define AT91C_PIOA_OWDR ((AT91_REG *) 0xFFFFF4A4) // (PIOA) Output Write Disable Register -#define AT91C_PIOA_ISR ((AT91_REG *) 0xFFFFF44C) // (PIOA) Interrupt Status Register -#define AT91C_PIOA_PPUDR ((AT91_REG *) 0xFFFFF460) // (PIOA) Pull-up Disable Register -#define AT91C_PIOA_MDSR ((AT91_REG *) 0xFFFFF458) // (PIOA) Multi-driver Status Register -#define AT91C_PIOA_MDER ((AT91_REG *) 0xFFFFF450) // (PIOA) Multi-driver Enable Register -#define AT91C_PIOA_PER ((AT91_REG *) 0xFFFFF400) // (PIOA) PIO Enable Register -#define AT91C_PIOA_PSR ((AT91_REG *) 0xFFFFF408) // (PIOA) PIO Status Register -#define AT91C_PIOA_OER ((AT91_REG *) 0xFFFFF410) // (PIOA) Output Enable Register -#define AT91C_PIOA_BSR ((AT91_REG *) 0xFFFFF474) // (PIOA) Select B Register -#define AT91C_PIOA_PPUER ((AT91_REG *) 0xFFFFF464) // (PIOA) Pull-up Enable Register -#define AT91C_PIOA_MDDR ((AT91_REG *) 0xFFFFF454) // (PIOA) Multi-driver Disable Register -#define AT91C_PIOA_PDR ((AT91_REG *) 0xFFFFF404) // (PIOA) PIO Disable Register -#define AT91C_PIOA_ODR ((AT91_REG *) 0xFFFFF414) // (PIOA) Output Disable Registerr -#define AT91C_PIOA_IFDR ((AT91_REG *) 0xFFFFF424) // (PIOA) Input Filter Disable Register -#define AT91C_PIOA_ABSR ((AT91_REG *) 0xFFFFF478) // (PIOA) AB Select Status Register -#define AT91C_PIOA_ASR ((AT91_REG *) 0xFFFFF470) // (PIOA) Select A Register -#define AT91C_PIOA_PPUSR ((AT91_REG *) 0xFFFFF468) // (PIOA) Pull-up Status Register -#define AT91C_PIOA_ODSR ((AT91_REG *) 0xFFFFF438) // (PIOA) Output Data Status Register -#define AT91C_PIOA_SODR ((AT91_REG *) 0xFFFFF430) // (PIOA) Set Output Data Register -#define AT91C_PIOA_IFSR ((AT91_REG *) 0xFFFFF428) // (PIOA) Input Filter Status Register -#define AT91C_PIOA_IFER ((AT91_REG *) 0xFFFFF420) // (PIOA) Input Filter Enable Register -#define AT91C_PIOA_OSR ((AT91_REG *) 0xFFFFF418) // (PIOA) Output Status Register -#define AT91C_PIOA_IDR ((AT91_REG *) 0xFFFFF444) // (PIOA) Interrupt Disable Register -#define AT91C_PIOA_PDSR ((AT91_REG *) 0xFFFFF43C) // (PIOA) Pin Data Status Register -#define AT91C_PIOA_CODR ((AT91_REG *) 0xFFFFF434) // (PIOA) Clear Output Data Register -#define AT91C_PIOA_OWSR ((AT91_REG *) 0xFFFFF4A8) // (PIOA) Output Write Status Register -#define AT91C_PIOA_OWER ((AT91_REG *) 0xFFFFF4A0) // (PIOA) Output Write Enable Register -// ========== Register definition for PIOB peripheral ========== -#define AT91C_PIOB_OWSR ((AT91_REG *) 0xFFFFF6A8) // (PIOB) Output Write Status Register -#define AT91C_PIOB_PPUSR ((AT91_REG *) 0xFFFFF668) // (PIOB) Pull-up Status Register -#define AT91C_PIOB_PPUDR ((AT91_REG *) 0xFFFFF660) // (PIOB) Pull-up Disable Register -#define AT91C_PIOB_MDSR ((AT91_REG *) 0xFFFFF658) // (PIOB) Multi-driver Status Register -#define AT91C_PIOB_MDER ((AT91_REG *) 0xFFFFF650) // (PIOB) Multi-driver Enable Register -#define AT91C_PIOB_IMR ((AT91_REG *) 0xFFFFF648) // (PIOB) Interrupt Mask Register -#define AT91C_PIOB_OSR ((AT91_REG *) 0xFFFFF618) // (PIOB) Output Status Register -#define AT91C_PIOB_OER ((AT91_REG *) 0xFFFFF610) // (PIOB) Output Enable Register -#define AT91C_PIOB_PSR ((AT91_REG *) 0xFFFFF608) // (PIOB) PIO Status Register -#define AT91C_PIOB_PER ((AT91_REG *) 0xFFFFF600) // (PIOB) PIO Enable Register -#define AT91C_PIOB_BSR ((AT91_REG *) 0xFFFFF674) // (PIOB) Select B Register -#define AT91C_PIOB_PPUER ((AT91_REG *) 0xFFFFF664) // (PIOB) Pull-up Enable Register -#define AT91C_PIOB_IFDR ((AT91_REG *) 0xFFFFF624) // (PIOB) Input Filter Disable Register -#define AT91C_PIOB_ODR ((AT91_REG *) 0xFFFFF614) // (PIOB) Output Disable Registerr -#define AT91C_PIOB_ABSR ((AT91_REG *) 0xFFFFF678) // (PIOB) AB Select Status Register -#define AT91C_PIOB_ASR ((AT91_REG *) 0xFFFFF670) // (PIOB) Select A Register -#define AT91C_PIOB_IFER ((AT91_REG *) 0xFFFFF620) // (PIOB) Input Filter Enable Register -#define AT91C_PIOB_IFSR ((AT91_REG *) 0xFFFFF628) // (PIOB) Input Filter Status Register -#define AT91C_PIOB_SODR ((AT91_REG *) 0xFFFFF630) // (PIOB) Set Output Data Register -#define AT91C_PIOB_ODSR ((AT91_REG *) 0xFFFFF638) // (PIOB) Output Data Status Register -#define AT91C_PIOB_CODR ((AT91_REG *) 0xFFFFF634) // (PIOB) Clear Output Data Register -#define AT91C_PIOB_PDSR ((AT91_REG *) 0xFFFFF63C) // (PIOB) Pin Data Status Register -#define AT91C_PIOB_OWER ((AT91_REG *) 0xFFFFF6A0) // (PIOB) Output Write Enable Register -#define AT91C_PIOB_IER ((AT91_REG *) 0xFFFFF640) // (PIOB) Interrupt Enable Register -#define AT91C_PIOB_OWDR ((AT91_REG *) 0xFFFFF6A4) // (PIOB) Output Write Disable Register -#define AT91C_PIOB_MDDR ((AT91_REG *) 0xFFFFF654) // (PIOB) Multi-driver Disable Register -#define AT91C_PIOB_ISR ((AT91_REG *) 0xFFFFF64C) // (PIOB) Interrupt Status Register -#define AT91C_PIOB_IDR ((AT91_REG *) 0xFFFFF644) // (PIOB) Interrupt Disable Register -#define AT91C_PIOB_PDR ((AT91_REG *) 0xFFFFF604) // (PIOB) PIO Disable Register -// ========== Register definition for CKGR peripheral ========== -#define AT91C_CKGR_PLLR ((AT91_REG *) 0xFFFFFC2C) // (CKGR) PLL Register -#define AT91C_CKGR_MCFR ((AT91_REG *) 0xFFFFFC24) // (CKGR) Main Clock Frequency Register -#define AT91C_CKGR_MOR ((AT91_REG *) 0xFFFFFC20) // (CKGR) Main Oscillator Register -// ========== Register definition for PMC peripheral ========== -#define AT91C_PMC_SCSR ((AT91_REG *) 0xFFFFFC08) // (PMC) System Clock Status Register -#define AT91C_PMC_SCER ((AT91_REG *) 0xFFFFFC00) // (PMC) System Clock Enable Register -#define AT91C_PMC_IMR ((AT91_REG *) 0xFFFFFC6C) // (PMC) Interrupt Mask Register -#define AT91C_PMC_IDR ((AT91_REG *) 0xFFFFFC64) // (PMC) Interrupt Disable Register -#define AT91C_PMC_PCDR ((AT91_REG *) 0xFFFFFC14) // (PMC) Peripheral Clock Disable Register -#define AT91C_PMC_SCDR ((AT91_REG *) 0xFFFFFC04) // (PMC) System Clock Disable Register -#define AT91C_PMC_SR ((AT91_REG *) 0xFFFFFC68) // (PMC) Status Register -#define AT91C_PMC_IER ((AT91_REG *) 0xFFFFFC60) // (PMC) Interrupt Enable Register -#define AT91C_PMC_MCKR ((AT91_REG *) 0xFFFFFC30) // (PMC) Master Clock Register -#define AT91C_PMC_MOR ((AT91_REG *) 0xFFFFFC20) // (PMC) Main Oscillator Register -#define AT91C_PMC_PCER ((AT91_REG *) 0xFFFFFC10) // (PMC) Peripheral Clock Enable Register -#define AT91C_PMC_PCSR ((AT91_REG *) 0xFFFFFC18) // (PMC) Peripheral Clock Status Register -#define AT91C_PMC_PLLR ((AT91_REG *) 0xFFFFFC2C) // (PMC) PLL Register -#define AT91C_PMC_MCFR ((AT91_REG *) 0xFFFFFC24) // (PMC) Main Clock Frequency Register -#define AT91C_PMC_PCKR ((AT91_REG *) 0xFFFFFC40) // (PMC) Programmable Clock Register -// ========== Register definition for RSTC peripheral ========== -#define AT91C_RSTC_RSR ((AT91_REG *) 0xFFFFFD04) // (RSTC) Reset Status Register -#define AT91C_RSTC_RMR ((AT91_REG *) 0xFFFFFD08) // (RSTC) Reset Mode Register -#define AT91C_RSTC_RCR ((AT91_REG *) 0xFFFFFD00) // (RSTC) Reset Control Register -// ========== Register definition for RTTC peripheral ========== -#define AT91C_RTTC_RTSR ((AT91_REG *) 0xFFFFFD2C) // (RTTC) Real-time Status Register -#define AT91C_RTTC_RTAR ((AT91_REG *) 0xFFFFFD24) // (RTTC) Real-time Alarm Register -#define AT91C_RTTC_RTVR ((AT91_REG *) 0xFFFFFD28) // (RTTC) Real-time Value Register -#define AT91C_RTTC_RTMR ((AT91_REG *) 0xFFFFFD20) // (RTTC) Real-time Mode Register -// ========== Register definition for PITC peripheral ========== -#define AT91C_PITC_PIIR ((AT91_REG *) 0xFFFFFD3C) // (PITC) Period Interval Image Register -#define AT91C_PITC_PISR ((AT91_REG *) 0xFFFFFD34) // (PITC) Period Interval Status Register -#define AT91C_PITC_PIVR ((AT91_REG *) 0xFFFFFD38) // (PITC) Period Interval Value Register -#define AT91C_PITC_PIMR ((AT91_REG *) 0xFFFFFD30) // (PITC) Period Interval Mode Register -// ========== Register definition for WDTC peripheral ========== -#define AT91C_WDTC_WDMR ((AT91_REG *) 0xFFFFFD44) // (WDTC) Watchdog Mode Register -#define AT91C_WDTC_WDSR ((AT91_REG *) 0xFFFFFD48) // (WDTC) Watchdog Status Register -#define AT91C_WDTC_WDCR ((AT91_REG *) 0xFFFFFD40) // (WDTC) Watchdog Control Register -// ========== Register definition for VREG peripheral ========== -#define AT91C_VREG_MR ((AT91_REG *) 0xFFFFFD60) // (VREG) Voltage Regulator Mode Register -// ========== Register definition for MC peripheral ========== -#define AT91C_MC_FCR ((AT91_REG *) 0xFFFFFF64) // (MC) MC Flash Command Register -#define AT91C_MC_ASR ((AT91_REG *) 0xFFFFFF04) // (MC) MC Abort Status Register -#define AT91C_MC_FSR ((AT91_REG *) 0xFFFFFF68) // (MC) MC Flash Status Register -#define AT91C_MC_FMR ((AT91_REG *) 0xFFFFFF60) // (MC) MC Flash Mode Register -#define AT91C_MC_AASR ((AT91_REG *) 0xFFFFFF08) // (MC) MC Abort Address Status Register -#define AT91C_MC_RCR ((AT91_REG *) 0xFFFFFF00) // (MC) MC Remap Control Register -// ========== Register definition for PDC_SPI1 peripheral ========== -#define AT91C_SPI1_RNPR ((AT91_REG *) 0xFFFE4110) // (PDC_SPI1) Receive Next Pointer Register -#define AT91C_SPI1_TPR ((AT91_REG *) 0xFFFE4108) // (PDC_SPI1) Transmit Pointer Register -#define AT91C_SPI1_RPR ((AT91_REG *) 0xFFFE4100) // (PDC_SPI1) Receive Pointer Register -#define AT91C_SPI1_PTSR ((AT91_REG *) 0xFFFE4124) // (PDC_SPI1) PDC Transfer Status Register -#define AT91C_SPI1_RCR ((AT91_REG *) 0xFFFE4104) // (PDC_SPI1) Receive Counter Register -#define AT91C_SPI1_TCR ((AT91_REG *) 0xFFFE410C) // (PDC_SPI1) Transmit Counter Register -#define AT91C_SPI1_RNCR ((AT91_REG *) 0xFFFE4114) // (PDC_SPI1) Receive Next Counter Register -#define AT91C_SPI1_TNCR ((AT91_REG *) 0xFFFE411C) // (PDC_SPI1) Transmit Next Counter Register -#define AT91C_SPI1_TNPR ((AT91_REG *) 0xFFFE4118) // (PDC_SPI1) Transmit Next Pointer Register -#define AT91C_SPI1_PTCR ((AT91_REG *) 0xFFFE4120) // (PDC_SPI1) PDC Transfer Control Register -// ========== Register definition for SPI1 peripheral ========== -#define AT91C_SPI1_CSR ((AT91_REG *) 0xFFFE4030) // (SPI1) Chip Select Register -#define AT91C_SPI1_IDR ((AT91_REG *) 0xFFFE4018) // (SPI1) Interrupt Disable Register -#define AT91C_SPI1_SR ((AT91_REG *) 0xFFFE4010) // (SPI1) Status Register -#define AT91C_SPI1_RDR ((AT91_REG *) 0xFFFE4008) // (SPI1) Receive Data Register -#define AT91C_SPI1_CR ((AT91_REG *) 0xFFFE4000) // (SPI1) Control Register -#define AT91C_SPI1_IMR ((AT91_REG *) 0xFFFE401C) // (SPI1) Interrupt Mask Register -#define AT91C_SPI1_IER ((AT91_REG *) 0xFFFE4014) // (SPI1) Interrupt Enable Register -#define AT91C_SPI1_TDR ((AT91_REG *) 0xFFFE400C) // (SPI1) Transmit Data Register -#define AT91C_SPI1_MR ((AT91_REG *) 0xFFFE4004) // (SPI1) Mode Register -// ========== Register definition for PDC_SPI0 peripheral ========== -#define AT91C_SPI0_PTCR ((AT91_REG *) 0xFFFE0120) // (PDC_SPI0) PDC Transfer Control Register -#define AT91C_SPI0_TNPR ((AT91_REG *) 0xFFFE0118) // (PDC_SPI0) Transmit Next Pointer Register -#define AT91C_SPI0_RNPR ((AT91_REG *) 0xFFFE0110) // (PDC_SPI0) Receive Next Pointer Register -#define AT91C_SPI0_TPR ((AT91_REG *) 0xFFFE0108) // (PDC_SPI0) Transmit Pointer Register -#define AT91C_SPI0_RPR ((AT91_REG *) 0xFFFE0100) // (PDC_SPI0) Receive Pointer Register -#define AT91C_SPI0_PTSR ((AT91_REG *) 0xFFFE0124) // (PDC_SPI0) PDC Transfer Status Register -#define AT91C_SPI0_TNCR ((AT91_REG *) 0xFFFE011C) // (PDC_SPI0) Transmit Next Counter Register -#define AT91C_SPI0_RNCR ((AT91_REG *) 0xFFFE0114) // (PDC_SPI0) Receive Next Counter Register -#define AT91C_SPI0_TCR ((AT91_REG *) 0xFFFE010C) // (PDC_SPI0) Transmit Counter Register -#define AT91C_SPI0_RCR ((AT91_REG *) 0xFFFE0104) // (PDC_SPI0) Receive Counter Register -// ========== Register definition for SPI0 peripheral ========== -#define AT91C_SPI0_CSR ((AT91_REG *) 0xFFFE0030) // (SPI0) Chip Select Register -#define AT91C_SPI0_IDR ((AT91_REG *) 0xFFFE0018) // (SPI0) Interrupt Disable Register -#define AT91C_SPI0_SR ((AT91_REG *) 0xFFFE0010) // (SPI0) Status Register -#define AT91C_SPI0_RDR ((AT91_REG *) 0xFFFE0008) // (SPI0) Receive Data Register -#define AT91C_SPI0_CR ((AT91_REG *) 0xFFFE0000) // (SPI0) Control Register -#define AT91C_SPI0_IMR ((AT91_REG *) 0xFFFE001C) // (SPI0) Interrupt Mask Register -#define AT91C_SPI0_IER ((AT91_REG *) 0xFFFE0014) // (SPI0) Interrupt Enable Register -#define AT91C_SPI0_TDR ((AT91_REG *) 0xFFFE000C) // (SPI0) Transmit Data Register -#define AT91C_SPI0_MR ((AT91_REG *) 0xFFFE0004) // (SPI0) Mode Register -// ========== Register definition for PDC_US1 peripheral ========== -#define AT91C_US1_PTSR ((AT91_REG *) 0xFFFC4124) // (PDC_US1) PDC Transfer Status Register -#define AT91C_US1_TNCR ((AT91_REG *) 0xFFFC411C) // (PDC_US1) Transmit Next Counter Register -#define AT91C_US1_RNCR ((AT91_REG *) 0xFFFC4114) // (PDC_US1) Receive Next Counter Register -#define AT91C_US1_TCR ((AT91_REG *) 0xFFFC410C) // (PDC_US1) Transmit Counter Register -#define AT91C_US1_RCR ((AT91_REG *) 0xFFFC4104) // (PDC_US1) Receive Counter Register -#define AT91C_US1_PTCR ((AT91_REG *) 0xFFFC4120) // (PDC_US1) PDC Transfer Control Register -#define AT91C_US1_TNPR ((AT91_REG *) 0xFFFC4118) // (PDC_US1) Transmit Next Pointer Register -#define AT91C_US1_RNPR ((AT91_REG *) 0xFFFC4110) // (PDC_US1) Receive Next Pointer Register -#define AT91C_US1_TPR ((AT91_REG *) 0xFFFC4108) // (PDC_US1) Transmit Pointer Register -#define AT91C_US1_RPR ((AT91_REG *) 0xFFFC4100) // (PDC_US1) Receive Pointer Register -// ========== Register definition for US1 peripheral ========== -#define AT91C_US1_RHR ((AT91_REG *) 0xFFFC4018) // (US1) Receiver Holding Register -#define AT91C_US1_IMR ((AT91_REG *) 0xFFFC4010) // (US1) Interrupt Mask Register -#define AT91C_US1_IER ((AT91_REG *) 0xFFFC4008) // (US1) Interrupt Enable Register -#define AT91C_US1_CR ((AT91_REG *) 0xFFFC4000) // (US1) Control Register -#define AT91C_US1_RTOR ((AT91_REG *) 0xFFFC4024) // (US1) Receiver Time-out Register -#define AT91C_US1_THR ((AT91_REG *) 0xFFFC401C) // (US1) Transmitter Holding Register -#define AT91C_US1_CSR ((AT91_REG *) 0xFFFC4014) // (US1) Channel Status Register -#define AT91C_US1_IDR ((AT91_REG *) 0xFFFC400C) // (US1) Interrupt Disable Register -#define AT91C_US1_FIDI ((AT91_REG *) 0xFFFC4040) // (US1) FI_DI_Ratio Register -#define AT91C_US1_BRGR ((AT91_REG *) 0xFFFC4020) // (US1) Baud Rate Generator Register -#define AT91C_US1_TTGR ((AT91_REG *) 0xFFFC4028) // (US1) Transmitter Time-guard Register -#define AT91C_US1_IF ((AT91_REG *) 0xFFFC404C) // (US1) IRDA_FILTER Register -#define AT91C_US1_NER ((AT91_REG *) 0xFFFC4044) // (US1) Nb Errors Register -#define AT91C_US1_MR ((AT91_REG *) 0xFFFC4004) // (US1) Mode Register -// ========== Register definition for PDC_US0 peripheral ========== -#define AT91C_US0_PTCR ((AT91_REG *) 0xFFFC0120) // (PDC_US0) PDC Transfer Control Register -#define AT91C_US0_TNPR ((AT91_REG *) 0xFFFC0118) // (PDC_US0) Transmit Next Pointer Register -#define AT91C_US0_RNPR ((AT91_REG *) 0xFFFC0110) // (PDC_US0) Receive Next Pointer Register -#define AT91C_US0_TPR ((AT91_REG *) 0xFFFC0108) // (PDC_US0) Transmit Pointer Register -#define AT91C_US0_RPR ((AT91_REG *) 0xFFFC0100) // (PDC_US0) Receive Pointer Register -#define AT91C_US0_PTSR ((AT91_REG *) 0xFFFC0124) // (PDC_US0) PDC Transfer Status Register -#define AT91C_US0_TNCR ((AT91_REG *) 0xFFFC011C) // (PDC_US0) Transmit Next Counter Register -#define AT91C_US0_RNCR ((AT91_REG *) 0xFFFC0114) // (PDC_US0) Receive Next Counter Register -#define AT91C_US0_TCR ((AT91_REG *) 0xFFFC010C) // (PDC_US0) Transmit Counter Register -#define AT91C_US0_RCR ((AT91_REG *) 0xFFFC0104) // (PDC_US0) Receive Counter Register -// ========== Register definition for US0 peripheral ========== -#define AT91C_US0_TTGR ((AT91_REG *) 0xFFFC0028) // (US0) Transmitter Time-guard Register -#define AT91C_US0_BRGR ((AT91_REG *) 0xFFFC0020) // (US0) Baud Rate Generator Register -#define AT91C_US0_RHR ((AT91_REG *) 0xFFFC0018) // (US0) Receiver Holding Register -#define AT91C_US0_IMR ((AT91_REG *) 0xFFFC0010) // (US0) Interrupt Mask Register -#define AT91C_US0_NER ((AT91_REG *) 0xFFFC0044) // (US0) Nb Errors Register -#define AT91C_US0_RTOR ((AT91_REG *) 0xFFFC0024) // (US0) Receiver Time-out Register -#define AT91C_US0_FIDI ((AT91_REG *) 0xFFFC0040) // (US0) FI_DI_Ratio Register -#define AT91C_US0_CR ((AT91_REG *) 0xFFFC0000) // (US0) Control Register -#define AT91C_US0_IER ((AT91_REG *) 0xFFFC0008) // (US0) Interrupt Enable Register -#define AT91C_US0_IF ((AT91_REG *) 0xFFFC004C) // (US0) IRDA_FILTER Register -#define AT91C_US0_MR ((AT91_REG *) 0xFFFC0004) // (US0) Mode Register -#define AT91C_US0_IDR ((AT91_REG *) 0xFFFC000C) // (US0) Interrupt Disable Register -#define AT91C_US0_CSR ((AT91_REG *) 0xFFFC0014) // (US0) Channel Status Register -#define AT91C_US0_THR ((AT91_REG *) 0xFFFC001C) // (US0) Transmitter Holding Register -// ========== Register definition for PDC_SSC peripheral ========== -#define AT91C_SSC_PTCR ((AT91_REG *) 0xFFFD4120) // (PDC_SSC) PDC Transfer Control Register -#define AT91C_SSC_TNPR ((AT91_REG *) 0xFFFD4118) // (PDC_SSC) Transmit Next Pointer Register -#define AT91C_SSC_RNPR ((AT91_REG *) 0xFFFD4110) // (PDC_SSC) Receive Next Pointer Register -#define AT91C_SSC_TPR ((AT91_REG *) 0xFFFD4108) // (PDC_SSC) Transmit Pointer Register -#define AT91C_SSC_RPR ((AT91_REG *) 0xFFFD4100) // (PDC_SSC) Receive Pointer Register -#define AT91C_SSC_PTSR ((AT91_REG *) 0xFFFD4124) // (PDC_SSC) PDC Transfer Status Register -#define AT91C_SSC_TNCR ((AT91_REG *) 0xFFFD411C) // (PDC_SSC) Transmit Next Counter Register -#define AT91C_SSC_RNCR ((AT91_REG *) 0xFFFD4114) // (PDC_SSC) Receive Next Counter Register -#define AT91C_SSC_TCR ((AT91_REG *) 0xFFFD410C) // (PDC_SSC) Transmit Counter Register -#define AT91C_SSC_RCR ((AT91_REG *) 0xFFFD4104) // (PDC_SSC) Receive Counter Register -// ========== Register definition for SSC peripheral ========== -#define AT91C_SSC_RFMR ((AT91_REG *) 0xFFFD4014) // (SSC) Receive Frame Mode Register -#define AT91C_SSC_CMR ((AT91_REG *) 0xFFFD4004) // (SSC) Clock Mode Register -#define AT91C_SSC_IDR ((AT91_REG *) 0xFFFD4048) // (SSC) Interrupt Disable Register -#define AT91C_SSC_SR ((AT91_REG *) 0xFFFD4040) // (SSC) Status Register -#define AT91C_SSC_RSHR ((AT91_REG *) 0xFFFD4030) // (SSC) Receive Sync Holding Register -#define AT91C_SSC_RHR ((AT91_REG *) 0xFFFD4020) // (SSC) Receive Holding Register -#define AT91C_SSC_TCMR ((AT91_REG *) 0xFFFD4018) // (SSC) Transmit Clock Mode Register -#define AT91C_SSC_RCMR ((AT91_REG *) 0xFFFD4010) // (SSC) Receive Clock ModeRegister -#define AT91C_SSC_CR ((AT91_REG *) 0xFFFD4000) // (SSC) Control Register -#define AT91C_SSC_IMR ((AT91_REG *) 0xFFFD404C) // (SSC) Interrupt Mask Register -#define AT91C_SSC_IER ((AT91_REG *) 0xFFFD4044) // (SSC) Interrupt Enable Register -#define AT91C_SSC_TSHR ((AT91_REG *) 0xFFFD4034) // (SSC) Transmit Sync Holding Register -#define AT91C_SSC_THR ((AT91_REG *) 0xFFFD4024) // (SSC) Transmit Holding Register -#define AT91C_SSC_TFMR ((AT91_REG *) 0xFFFD401C) // (SSC) Transmit Frame Mode Register -// ========== Register definition for TWI peripheral ========== -#define AT91C_TWI_RHR ((AT91_REG *) 0xFFFB8030) // (TWI) Receive Holding Register -#define AT91C_TWI_IDR ((AT91_REG *) 0xFFFB8028) // (TWI) Interrupt Disable Register -#define AT91C_TWI_SR ((AT91_REG *) 0xFFFB8020) // (TWI) Status Register -#define AT91C_TWI_CWGR ((AT91_REG *) 0xFFFB8010) // (TWI) Clock Waveform Generator Register -#define AT91C_TWI_CR ((AT91_REG *) 0xFFFB8000) // (TWI) Control Register -#define AT91C_TWI_THR ((AT91_REG *) 0xFFFB8034) // (TWI) Transmit Holding Register -#define AT91C_TWI_IMR ((AT91_REG *) 0xFFFB802C) // (TWI) Interrupt Mask Register -#define AT91C_TWI_IER ((AT91_REG *) 0xFFFB8024) // (TWI) Interrupt Enable Register -#define AT91C_TWI_IADR ((AT91_REG *) 0xFFFB800C) // (TWI) Internal Address Register -#define AT91C_TWI_MMR ((AT91_REG *) 0xFFFB8004) // (TWI) Master Mode Register -// ========== Register definition for PWMC_CH3 peripheral ========== -#define AT91C_PWMC_CH3_CUPDR ((AT91_REG *) 0xFFFCC270) // (PWMC_CH3) Channel Update Register -#define AT91C_PWMC_CH3_CPRDR ((AT91_REG *) 0xFFFCC268) // (PWMC_CH3) Channel Period Register -#define AT91C_PWMC_CH3_CMR ((AT91_REG *) 0xFFFCC260) // (PWMC_CH3) Channel Mode Register -#define AT91C_PWMC_CH3_Reserved ((AT91_REG *) 0xFFFCC274) // (PWMC_CH3) Reserved -#define AT91C_PWMC_CH3_CCNTR ((AT91_REG *) 0xFFFCC26C) // (PWMC_CH3) Channel Counter Register -#define AT91C_PWMC_CH3_CDTYR ((AT91_REG *) 0xFFFCC264) // (PWMC_CH3) Channel Duty Cycle Register -// ========== Register definition for PWMC_CH2 peripheral ========== -#define AT91C_PWMC_CH2_CUPDR ((AT91_REG *) 0xFFFCC250) // (PWMC_CH2) Channel Update Register -#define AT91C_PWMC_CH2_CPRDR ((AT91_REG *) 0xFFFCC248) // (PWMC_CH2) Channel Period Register -#define AT91C_PWMC_CH2_CMR ((AT91_REG *) 0xFFFCC240) // (PWMC_CH2) Channel Mode Register -#define AT91C_PWMC_CH2_Reserved ((AT91_REG *) 0xFFFCC254) // (PWMC_CH2) Reserved -#define AT91C_PWMC_CH2_CCNTR ((AT91_REG *) 0xFFFCC24C) // (PWMC_CH2) Channel Counter Register -#define AT91C_PWMC_CH2_CDTYR ((AT91_REG *) 0xFFFCC244) // (PWMC_CH2) Channel Duty Cycle Register -// ========== Register definition for PWMC_CH1 peripheral ========== -#define AT91C_PWMC_CH1_CUPDR ((AT91_REG *) 0xFFFCC230) // (PWMC_CH1) Channel Update Register -#define AT91C_PWMC_CH1_CPRDR ((AT91_REG *) 0xFFFCC228) // (PWMC_CH1) Channel Period Register -#define AT91C_PWMC_CH1_CMR ((AT91_REG *) 0xFFFCC220) // (PWMC_CH1) Channel Mode Register -#define AT91C_PWMC_CH1_Reserved ((AT91_REG *) 0xFFFCC234) // (PWMC_CH1) Reserved -#define AT91C_PWMC_CH1_CCNTR ((AT91_REG *) 0xFFFCC22C) // (PWMC_CH1) Channel Counter Register -#define AT91C_PWMC_CH1_CDTYR ((AT91_REG *) 0xFFFCC224) // (PWMC_CH1) Channel Duty Cycle Register -// ========== Register definition for PWMC_CH0 peripheral ========== -#define AT91C_PWMC_CH0_CUPDR ((AT91_REG *) 0xFFFCC210) // (PWMC_CH0) Channel Update Register -#define AT91C_PWMC_CH0_CPRDR ((AT91_REG *) 0xFFFCC208) // (PWMC_CH0) Channel Period Register -#define AT91C_PWMC_CH0_CMR ((AT91_REG *) 0xFFFCC200) // (PWMC_CH0) Channel Mode Register -#define AT91C_PWMC_CH0_Reserved ((AT91_REG *) 0xFFFCC214) // (PWMC_CH0) Reserved -#define AT91C_PWMC_CH0_CCNTR ((AT91_REG *) 0xFFFCC20C) // (PWMC_CH0) Channel Counter Register -#define AT91C_PWMC_CH0_CDTYR ((AT91_REG *) 0xFFFCC204) // (PWMC_CH0) Channel Duty Cycle Register -// ========== Register definition for PWMC peripheral ========== -#define AT91C_PWMC_VR ((AT91_REG *) 0xFFFCC0FC) // (PWMC) PWMC Version Register -#define AT91C_PWMC_ISR ((AT91_REG *) 0xFFFCC01C) // (PWMC) PWMC Interrupt Status Register -#define AT91C_PWMC_IDR ((AT91_REG *) 0xFFFCC014) // (PWMC) PWMC Interrupt Disable Register -#define AT91C_PWMC_SR ((AT91_REG *) 0xFFFCC00C) // (PWMC) PWMC Status Register -#define AT91C_PWMC_ENA ((AT91_REG *) 0xFFFCC004) // (PWMC) PWMC Enable Register -#define AT91C_PWMC_IMR ((AT91_REG *) 0xFFFCC018) // (PWMC) PWMC Interrupt Mask Register -#define AT91C_PWMC_MR ((AT91_REG *) 0xFFFCC000) // (PWMC) PWMC Mode Register -#define AT91C_PWMC_DIS ((AT91_REG *) 0xFFFCC008) // (PWMC) PWMC Disable Register -#define AT91C_PWMC_IER ((AT91_REG *) 0xFFFCC010) // (PWMC) PWMC Interrupt Enable Register -// ========== Register definition for UDP peripheral ========== -#define AT91C_UDP_TXVC ((AT91_REG *) 0xFFFB0074) // (UDP) Transceiver Control Register -#define AT91C_UDP_ISR ((AT91_REG *) 0xFFFB001C) // (UDP) Interrupt Status Register -#define AT91C_UDP_IDR ((AT91_REG *) 0xFFFB0014) // (UDP) Interrupt Disable Register -#define AT91C_UDP_CSR ((AT91_REG *) 0xFFFB0030) // (UDP) Endpoint Control and Status Register -#define AT91C_UDP_RSTEP ((AT91_REG *) 0xFFFB0028) // (UDP) Reset Endpoint Register -#define AT91C_UDP_ICR ((AT91_REG *) 0xFFFB0020) // (UDP) Interrupt Clear Register -#define AT91C_UDP_GLBSTATE ((AT91_REG *) 0xFFFB0004) // (UDP) Global State Register -#define AT91C_UDP_NUM ((AT91_REG *) 0xFFFB0000) // (UDP) Frame Number Register -#define AT91C_UDP_FADDR ((AT91_REG *) 0xFFFB0008) // (UDP) Function Address Register -#define AT91C_UDP_IER ((AT91_REG *) 0xFFFB0010) // (UDP) Interrupt Enable Register -#define AT91C_UDP_IMR ((AT91_REG *) 0xFFFB0018) // (UDP) Interrupt Mask Register -#define AT91C_UDP_FDR ((AT91_REG *) 0xFFFB0050) // (UDP) Endpoint FIFO Data Register -// ========== Register definition for TC0 peripheral ========== -#define AT91C_TC0_IMR ((AT91_REG *) 0xFFFA002C) // (TC0) Interrupt Mask Register -#define AT91C_TC0_IER ((AT91_REG *) 0xFFFA0024) // (TC0) Interrupt Enable Register -#define AT91C_TC0_RC ((AT91_REG *) 0xFFFA001C) // (TC0) Register C -#define AT91C_TC0_RA ((AT91_REG *) 0xFFFA0014) // (TC0) Register A -#define AT91C_TC0_CMR ((AT91_REG *) 0xFFFA0004) // (TC0) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC0_IDR ((AT91_REG *) 0xFFFA0028) // (TC0) Interrupt Disable Register -#define AT91C_TC0_SR ((AT91_REG *) 0xFFFA0020) // (TC0) Status Register -#define AT91C_TC0_RB ((AT91_REG *) 0xFFFA0018) // (TC0) Register B -#define AT91C_TC0_CV ((AT91_REG *) 0xFFFA0010) // (TC0) Counter Value -#define AT91C_TC0_CCR ((AT91_REG *) 0xFFFA0000) // (TC0) Channel Control Register -// ========== Register definition for TC1 peripheral ========== -#define AT91C_TC1_IMR ((AT91_REG *) 0xFFFA006C) // (TC1) Interrupt Mask Register -#define AT91C_TC1_IER ((AT91_REG *) 0xFFFA0064) // (TC1) Interrupt Enable Register -#define AT91C_TC1_RC ((AT91_REG *) 0xFFFA005C) // (TC1) Register C -#define AT91C_TC1_RA ((AT91_REG *) 0xFFFA0054) // (TC1) Register A -#define AT91C_TC1_CMR ((AT91_REG *) 0xFFFA0044) // (TC1) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC1_IDR ((AT91_REG *) 0xFFFA0068) // (TC1) Interrupt Disable Register -#define AT91C_TC1_SR ((AT91_REG *) 0xFFFA0060) // (TC1) Status Register -#define AT91C_TC1_RB ((AT91_REG *) 0xFFFA0058) // (TC1) Register B -#define AT91C_TC1_CV ((AT91_REG *) 0xFFFA0050) // (TC1) Counter Value -#define AT91C_TC1_CCR ((AT91_REG *) 0xFFFA0040) // (TC1) Channel Control Register -// ========== Register definition for TC2 peripheral ========== -#define AT91C_TC2_IMR ((AT91_REG *) 0xFFFA00AC) // (TC2) Interrupt Mask Register -#define AT91C_TC2_IER ((AT91_REG *) 0xFFFA00A4) // (TC2) Interrupt Enable Register -#define AT91C_TC2_RC ((AT91_REG *) 0xFFFA009C) // (TC2) Register C -#define AT91C_TC2_RA ((AT91_REG *) 0xFFFA0094) // (TC2) Register A -#define AT91C_TC2_CMR ((AT91_REG *) 0xFFFA0084) // (TC2) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC2_IDR ((AT91_REG *) 0xFFFA00A8) // (TC2) Interrupt Disable Register -#define AT91C_TC2_SR ((AT91_REG *) 0xFFFA00A0) // (TC2) Status Register -#define AT91C_TC2_RB ((AT91_REG *) 0xFFFA0098) // (TC2) Register B -#define AT91C_TC2_CV ((AT91_REG *) 0xFFFA0090) // (TC2) Counter Value -#define AT91C_TC2_CCR ((AT91_REG *) 0xFFFA0080) // (TC2) Channel Control Register -// ========== Register definition for TCB peripheral ========== -#define AT91C_TCB_BMR ((AT91_REG *) 0xFFFA00C4) // (TCB) TC Block Mode Register -#define AT91C_TCB_BCR ((AT91_REG *) 0xFFFA00C0) // (TCB) TC Block Control Register -// ========== Register definition for CAN_MB0 peripheral ========== -#define AT91C_CAN_MB0_MCR ((AT91_REG *) 0xFFFD021C) // (CAN_MB0) MailBox Control Register -#define AT91C_CAN_MB0_MDL ((AT91_REG *) 0xFFFD0214) // (CAN_MB0) MailBox Data Low Register -#define AT91C_CAN_MB0_MFID ((AT91_REG *) 0xFFFD020C) // (CAN_MB0) MailBox Family ID Register -#define AT91C_CAN_MB0_MAM ((AT91_REG *) 0xFFFD0204) // (CAN_MB0) MailBox Acceptance Mask Register -#define AT91C_CAN_MB0_MDH ((AT91_REG *) 0xFFFD0218) // (CAN_MB0) MailBox Data High Register -#define AT91C_CAN_MB0_MSR ((AT91_REG *) 0xFFFD0210) // (CAN_MB0) MailBox Status Register -#define AT91C_CAN_MB0_MID ((AT91_REG *) 0xFFFD0208) // (CAN_MB0) MailBox ID Register -#define AT91C_CAN_MB0_MMR ((AT91_REG *) 0xFFFD0200) // (CAN_MB0) MailBox Mode Register -// ========== Register definition for CAN_MB1 peripheral ========== -#define AT91C_CAN_MB1_MCR ((AT91_REG *) 0xFFFD023C) // (CAN_MB1) MailBox Control Register -#define AT91C_CAN_MB1_MDL ((AT91_REG *) 0xFFFD0234) // (CAN_MB1) MailBox Data Low Register -#define AT91C_CAN_MB1_MFID ((AT91_REG *) 0xFFFD022C) // (CAN_MB1) MailBox Family ID Register -#define AT91C_CAN_MB1_MAM ((AT91_REG *) 0xFFFD0224) // (CAN_MB1) MailBox Acceptance Mask Register -#define AT91C_CAN_MB1_MDH ((AT91_REG *) 0xFFFD0238) // (CAN_MB1) MailBox Data High Register -#define AT91C_CAN_MB1_MSR ((AT91_REG *) 0xFFFD0230) // (CAN_MB1) MailBox Status Register -#define AT91C_CAN_MB1_MID ((AT91_REG *) 0xFFFD0228) // (CAN_MB1) MailBox ID Register -#define AT91C_CAN_MB1_MMR ((AT91_REG *) 0xFFFD0220) // (CAN_MB1) MailBox Mode Register -// ========== Register definition for CAN_MB2 peripheral ========== -#define AT91C_CAN_MB2_MCR ((AT91_REG *) 0xFFFD025C) // (CAN_MB2) MailBox Control Register -#define AT91C_CAN_MB2_MDL ((AT91_REG *) 0xFFFD0254) // (CAN_MB2) MailBox Data Low Register -#define AT91C_CAN_MB2_MFID ((AT91_REG *) 0xFFFD024C) // (CAN_MB2) MailBox Family ID Register -#define AT91C_CAN_MB2_MAM ((AT91_REG *) 0xFFFD0244) // (CAN_MB2) MailBox Acceptance Mask Register -#define AT91C_CAN_MB2_MDH ((AT91_REG *) 0xFFFD0258) // (CAN_MB2) MailBox Data High Register -#define AT91C_CAN_MB2_MSR ((AT91_REG *) 0xFFFD0250) // (CAN_MB2) MailBox Status Register -#define AT91C_CAN_MB2_MID ((AT91_REG *) 0xFFFD0248) // (CAN_MB2) MailBox ID Register -#define AT91C_CAN_MB2_MMR ((AT91_REG *) 0xFFFD0240) // (CAN_MB2) MailBox Mode Register -// ========== Register definition for CAN_MB3 peripheral ========== -#define AT91C_CAN_MB3_MCR ((AT91_REG *) 0xFFFD027C) // (CAN_MB3) MailBox Control Register -#define AT91C_CAN_MB3_MDL ((AT91_REG *) 0xFFFD0274) // (CAN_MB3) MailBox Data Low Register -#define AT91C_CAN_MB3_MFID ((AT91_REG *) 0xFFFD026C) // (CAN_MB3) MailBox Family ID Register -#define AT91C_CAN_MB3_MAM ((AT91_REG *) 0xFFFD0264) // (CAN_MB3) MailBox Acceptance Mask Register -#define AT91C_CAN_MB3_MDH ((AT91_REG *) 0xFFFD0278) // (CAN_MB3) MailBox Data High Register -#define AT91C_CAN_MB3_MSR ((AT91_REG *) 0xFFFD0270) // (CAN_MB3) MailBox Status Register -#define AT91C_CAN_MB3_MID ((AT91_REG *) 0xFFFD0268) // (CAN_MB3) MailBox ID Register -#define AT91C_CAN_MB3_MMR ((AT91_REG *) 0xFFFD0260) // (CAN_MB3) MailBox Mode Register -// ========== Register definition for CAN_MB4 peripheral ========== -#define AT91C_CAN_MB4_MCR ((AT91_REG *) 0xFFFD029C) // (CAN_MB4) MailBox Control Register -#define AT91C_CAN_MB4_MDL ((AT91_REG *) 0xFFFD0294) // (CAN_MB4) MailBox Data Low Register -#define AT91C_CAN_MB4_MFID ((AT91_REG *) 0xFFFD028C) // (CAN_MB4) MailBox Family ID Register -#define AT91C_CAN_MB4_MAM ((AT91_REG *) 0xFFFD0284) // (CAN_MB4) MailBox Acceptance Mask Register -#define AT91C_CAN_MB4_MDH ((AT91_REG *) 0xFFFD0298) // (CAN_MB4) MailBox Data High Register -#define AT91C_CAN_MB4_MSR ((AT91_REG *) 0xFFFD0290) // (CAN_MB4) MailBox Status Register -#define AT91C_CAN_MB4_MID ((AT91_REG *) 0xFFFD0288) // (CAN_MB4) MailBox ID Register -#define AT91C_CAN_MB4_MMR ((AT91_REG *) 0xFFFD0280) // (CAN_MB4) MailBox Mode Register -// ========== Register definition for CAN_MB5 peripheral ========== -#define AT91C_CAN_MB5_MCR ((AT91_REG *) 0xFFFD02BC) // (CAN_MB5) MailBox Control Register -#define AT91C_CAN_MB5_MDL ((AT91_REG *) 0xFFFD02B4) // (CAN_MB5) MailBox Data Low Register -#define AT91C_CAN_MB5_MFID ((AT91_REG *) 0xFFFD02AC) // (CAN_MB5) MailBox Family ID Register -#define AT91C_CAN_MB5_MAM ((AT91_REG *) 0xFFFD02A4) // (CAN_MB5) MailBox Acceptance Mask Register -#define AT91C_CAN_MB5_MDH ((AT91_REG *) 0xFFFD02B8) // (CAN_MB5) MailBox Data High Register -#define AT91C_CAN_MB5_MSR ((AT91_REG *) 0xFFFD02B0) // (CAN_MB5) MailBox Status Register -#define AT91C_CAN_MB5_MID ((AT91_REG *) 0xFFFD02A8) // (CAN_MB5) MailBox ID Register -#define AT91C_CAN_MB5_MMR ((AT91_REG *) 0xFFFD02A0) // (CAN_MB5) MailBox Mode Register -// ========== Register definition for CAN_MB6 peripheral ========== -#define AT91C_CAN_MB6_MAM ((AT91_REG *) 0xFFFD02C4) // (CAN_MB6) MailBox Acceptance Mask Register -#define AT91C_CAN_MB6_MDH ((AT91_REG *) 0xFFFD02D8) // (CAN_MB6) MailBox Data High Register -#define AT91C_CAN_MB6_MSR ((AT91_REG *) 0xFFFD02D0) // (CAN_MB6) MailBox Status Register -#define AT91C_CAN_MB6_MID ((AT91_REG *) 0xFFFD02C8) // (CAN_MB6) MailBox ID Register -#define AT91C_CAN_MB6_MMR ((AT91_REG *) 0xFFFD02C0) // (CAN_MB6) MailBox Mode Register -#define AT91C_CAN_MB6_MCR ((AT91_REG *) 0xFFFD02DC) // (CAN_MB6) MailBox Control Register -#define AT91C_CAN_MB6_MDL ((AT91_REG *) 0xFFFD02D4) // (CAN_MB6) MailBox Data Low Register -#define AT91C_CAN_MB6_MFID ((AT91_REG *) 0xFFFD02CC) // (CAN_MB6) MailBox Family ID Register -// ========== Register definition for CAN_MB7 peripheral ========== -#define AT91C_CAN_MB7_MDH ((AT91_REG *) 0xFFFD02F8) // (CAN_MB7) MailBox Data High Register -#define AT91C_CAN_MB7_MSR ((AT91_REG *) 0xFFFD02F0) // (CAN_MB7) MailBox Status Register -#define AT91C_CAN_MB7_MID ((AT91_REG *) 0xFFFD02E8) // (CAN_MB7) MailBox ID Register -#define AT91C_CAN_MB7_MMR ((AT91_REG *) 0xFFFD02E0) // (CAN_MB7) MailBox Mode Register -#define AT91C_CAN_MB7_MCR ((AT91_REG *) 0xFFFD02FC) // (CAN_MB7) MailBox Control Register -#define AT91C_CAN_MB7_MDL ((AT91_REG *) 0xFFFD02F4) // (CAN_MB7) MailBox Data Low Register -#define AT91C_CAN_MB7_MFID ((AT91_REG *) 0xFFFD02EC) // (CAN_MB7) MailBox Family ID Register -#define AT91C_CAN_MB7_MAM ((AT91_REG *) 0xFFFD02E4) // (CAN_MB7) MailBox Acceptance Mask Register -// ========== Register definition for CAN peripheral ========== -#define AT91C_CAN_IMR ((AT91_REG *) 0xFFFD000C) // (CAN) Interrupt Mask Register -#define AT91C_CAN_IER ((AT91_REG *) 0xFFFD0004) // (CAN) Interrupt Enable Register -#define AT91C_CAN_ECR ((AT91_REG *) 0xFFFD0020) // (CAN) Error Counter Register -#define AT91C_CAN_TIM ((AT91_REG *) 0xFFFD0018) // (CAN) Timer Register -#define AT91C_CAN_SR ((AT91_REG *) 0xFFFD0010) // (CAN) Status Register -#define AT91C_CAN_IDR ((AT91_REG *) 0xFFFD0008) // (CAN) Interrupt Disable Register -#define AT91C_CAN_MR ((AT91_REG *) 0xFFFD0000) // (CAN) Mode Register -#define AT91C_CAN_BR ((AT91_REG *) 0xFFFD0014) // (CAN) Baudrate Register -#define AT91C_CAN_TIMESTP ((AT91_REG *) 0xFFFD001C) // (CAN) Time Stamp Register -#define AT91C_CAN_TCR ((AT91_REG *) 0xFFFD0024) // (CAN) Transfer Command Register -#define AT91C_CAN_ACR ((AT91_REG *) 0xFFFD0028) // (CAN) Abort Command Register -#define AT91C_CAN_VR ((AT91_REG *) 0xFFFD00FC) // (CAN) Version Register -// ========== Register definition for EMAC peripheral ========== -#define AT91C_EMAC_TID ((AT91_REG *) 0xFFFDC0B8) // (EMAC) Type ID Checking Register -#define AT91C_EMAC_SA3L ((AT91_REG *) 0xFFFDC0A8) // (EMAC) Specific Address 3 Bottom, First 4 bytes -#define AT91C_EMAC_STE ((AT91_REG *) 0xFFFDC084) // (EMAC) SQE Test Error Register -#define AT91C_EMAC_RSE ((AT91_REG *) 0xFFFDC074) // (EMAC) Receive Symbol Errors Register -#define AT91C_EMAC_IDR ((AT91_REG *) 0xFFFDC02C) // (EMAC) Interrupt Disable Register -#define AT91C_EMAC_TBQP ((AT91_REG *) 0xFFFDC01C) // (EMAC) Transmit Buffer Queue Pointer -#define AT91C_EMAC_TPQ ((AT91_REG *) 0xFFFDC0BC) // (EMAC) Transmit Pause Quantum Register -#define AT91C_EMAC_SA1L ((AT91_REG *) 0xFFFDC098) // (EMAC) Specific Address 1 Bottom, First 4 bytes -#define AT91C_EMAC_RLE ((AT91_REG *) 0xFFFDC088) // (EMAC) Receive Length Field Mismatch Register -#define AT91C_EMAC_IMR ((AT91_REG *) 0xFFFDC030) // (EMAC) Interrupt Mask Register -#define AT91C_EMAC_SA1H ((AT91_REG *) 0xFFFDC09C) // (EMAC) Specific Address 1 Top, Last 2 bytes -#define AT91C_EMAC_PFR ((AT91_REG *) 0xFFFDC03C) // (EMAC) Pause Frames received Register -#define AT91C_EMAC_FCSE ((AT91_REG *) 0xFFFDC050) // (EMAC) Frame Check Sequence Error Register -#define AT91C_EMAC_FTO ((AT91_REG *) 0xFFFDC040) // (EMAC) Frames Transmitted OK Register -#define AT91C_EMAC_TUND ((AT91_REG *) 0xFFFDC064) // (EMAC) Transmit Underrun Error Register -#define AT91C_EMAC_ALE ((AT91_REG *) 0xFFFDC054) // (EMAC) Alignment Error Register -#define AT91C_EMAC_SCF ((AT91_REG *) 0xFFFDC044) // (EMAC) Single Collision Frame Register -#define AT91C_EMAC_SA3H ((AT91_REG *) 0xFFFDC0AC) // (EMAC) Specific Address 3 Top, Last 2 bytes -#define AT91C_EMAC_ELE ((AT91_REG *) 0xFFFDC078) // (EMAC) Excessive Length Errors Register -#define AT91C_EMAC_CSE ((AT91_REG *) 0xFFFDC068) // (EMAC) Carrier Sense Error Register -#define AT91C_EMAC_DTF ((AT91_REG *) 0xFFFDC058) // (EMAC) Deferred Transmission Frame Register -#define AT91C_EMAC_RSR ((AT91_REG *) 0xFFFDC020) // (EMAC) Receive Status Register -#define AT91C_EMAC_USRIO ((AT91_REG *) 0xFFFDC0C0) // (EMAC) USER Input/Output Register -#define AT91C_EMAC_SA4L ((AT91_REG *) 0xFFFDC0B0) // (EMAC) Specific Address 4 Bottom, First 4 bytes -#define AT91C_EMAC_RRE ((AT91_REG *) 0xFFFDC06C) // (EMAC) Receive Ressource Error Register -#define AT91C_EMAC_RJA ((AT91_REG *) 0xFFFDC07C) // (EMAC) Receive Jabbers Register -#define AT91C_EMAC_TPF ((AT91_REG *) 0xFFFDC08C) // (EMAC) Transmitted Pause Frames Register -#define AT91C_EMAC_ISR ((AT91_REG *) 0xFFFDC024) // (EMAC) Interrupt Status Register -#define AT91C_EMAC_MAN ((AT91_REG *) 0xFFFDC034) // (EMAC) PHY Maintenance Register -#define AT91C_EMAC_WOL ((AT91_REG *) 0xFFFDC0C4) // (EMAC) Wake On LAN Register -#define AT91C_EMAC_USF ((AT91_REG *) 0xFFFDC080) // (EMAC) Undersize Frames Register -#define AT91C_EMAC_HRB ((AT91_REG *) 0xFFFDC090) // (EMAC) Hash Address Bottom[31:0] -#define AT91C_EMAC_PTR ((AT91_REG *) 0xFFFDC038) // (EMAC) Pause Time Register -#define AT91C_EMAC_HRT ((AT91_REG *) 0xFFFDC094) // (EMAC) Hash Address Top[63:32] -#define AT91C_EMAC_REV ((AT91_REG *) 0xFFFDC0FC) // (EMAC) Revision Register -#define AT91C_EMAC_MCF ((AT91_REG *) 0xFFFDC048) // (EMAC) Multiple Collision Frame Register -#define AT91C_EMAC_SA2L ((AT91_REG *) 0xFFFDC0A0) // (EMAC) Specific Address 2 Bottom, First 4 bytes -#define AT91C_EMAC_NCR ((AT91_REG *) 0xFFFDC000) // (EMAC) Network Control Register -#define AT91C_EMAC_FRO ((AT91_REG *) 0xFFFDC04C) // (EMAC) Frames Received OK Register -#define AT91C_EMAC_LCOL ((AT91_REG *) 0xFFFDC05C) // (EMAC) Late Collision Register -#define AT91C_EMAC_SA4H ((AT91_REG *) 0xFFFDC0B4) // (EMAC) Specific Address 4 Top, Last 2 bytes -#define AT91C_EMAC_NCFGR ((AT91_REG *) 0xFFFDC004) // (EMAC) Network Configuration Register -#define AT91C_EMAC_TSR ((AT91_REG *) 0xFFFDC014) // (EMAC) Transmit Status Register -#define AT91C_EMAC_SA2H ((AT91_REG *) 0xFFFDC0A4) // (EMAC) Specific Address 2 Top, Last 2 bytes -#define AT91C_EMAC_ECOL ((AT91_REG *) 0xFFFDC060) // (EMAC) Excessive Collision Register -#define AT91C_EMAC_ROV ((AT91_REG *) 0xFFFDC070) // (EMAC) Receive Overrun Errors Register -#define AT91C_EMAC_NSR ((AT91_REG *) 0xFFFDC008) // (EMAC) Network Status Register -#define AT91C_EMAC_RBQP ((AT91_REG *) 0xFFFDC018) // (EMAC) Receive Buffer Queue Pointer -#define AT91C_EMAC_IER ((AT91_REG *) 0xFFFDC028) // (EMAC) Interrupt Enable Register -// ========== Register definition for PDC_ADC peripheral ========== -#define AT91C_ADC_PTCR ((AT91_REG *) 0xFFFD8120) // (PDC_ADC) PDC Transfer Control Register -#define AT91C_ADC_TNPR ((AT91_REG *) 0xFFFD8118) // (PDC_ADC) Transmit Next Pointer Register -#define AT91C_ADC_RNPR ((AT91_REG *) 0xFFFD8110) // (PDC_ADC) Receive Next Pointer Register -#define AT91C_ADC_TPR ((AT91_REG *) 0xFFFD8108) // (PDC_ADC) Transmit Pointer Register -#define AT91C_ADC_RPR ((AT91_REG *) 0xFFFD8100) // (PDC_ADC) Receive Pointer Register -#define AT91C_ADC_PTSR ((AT91_REG *) 0xFFFD8124) // (PDC_ADC) PDC Transfer Status Register -#define AT91C_ADC_TNCR ((AT91_REG *) 0xFFFD811C) // (PDC_ADC) Transmit Next Counter Register -#define AT91C_ADC_RNCR ((AT91_REG *) 0xFFFD8114) // (PDC_ADC) Receive Next Counter Register -#define AT91C_ADC_TCR ((AT91_REG *) 0xFFFD810C) // (PDC_ADC) Transmit Counter Register -#define AT91C_ADC_RCR ((AT91_REG *) 0xFFFD8104) // (PDC_ADC) Receive Counter Register -// ========== Register definition for ADC peripheral ========== -#define AT91C_ADC_IMR ((AT91_REG *) 0xFFFD802C) // (ADC) ADC Interrupt Mask Register -#define AT91C_ADC_CDR4 ((AT91_REG *) 0xFFFD8040) // (ADC) ADC Channel Data Register 4 -#define AT91C_ADC_CDR2 ((AT91_REG *) 0xFFFD8038) // (ADC) ADC Channel Data Register 2 -#define AT91C_ADC_CDR0 ((AT91_REG *) 0xFFFD8030) // (ADC) ADC Channel Data Register 0 -#define AT91C_ADC_CDR7 ((AT91_REG *) 0xFFFD804C) // (ADC) ADC Channel Data Register 7 -#define AT91C_ADC_CDR1 ((AT91_REG *) 0xFFFD8034) // (ADC) ADC Channel Data Register 1 -#define AT91C_ADC_CDR3 ((AT91_REG *) 0xFFFD803C) // (ADC) ADC Channel Data Register 3 -#define AT91C_ADC_CDR5 ((AT91_REG *) 0xFFFD8044) // (ADC) ADC Channel Data Register 5 -#define AT91C_ADC_MR ((AT91_REG *) 0xFFFD8004) // (ADC) ADC Mode Register -#define AT91C_ADC_CDR6 ((AT91_REG *) 0xFFFD8048) // (ADC) ADC Channel Data Register 6 -#define AT91C_ADC_CR ((AT91_REG *) 0xFFFD8000) // (ADC) ADC Control Register -#define AT91C_ADC_CHER ((AT91_REG *) 0xFFFD8010) // (ADC) ADC Channel Enable Register -#define AT91C_ADC_CHSR ((AT91_REG *) 0xFFFD8018) // (ADC) ADC Channel Status Register -#define AT91C_ADC_IER ((AT91_REG *) 0xFFFD8024) // (ADC) ADC Interrupt Enable Register -#define AT91C_ADC_SR ((AT91_REG *) 0xFFFD801C) // (ADC) ADC Status Register -#define AT91C_ADC_CHDR ((AT91_REG *) 0xFFFD8014) // (ADC) ADC Channel Disable Register -#define AT91C_ADC_IDR ((AT91_REG *) 0xFFFD8028) // (ADC) ADC Interrupt Disable Register -#define AT91C_ADC_LCDR ((AT91_REG *) 0xFFFD8020) // (ADC) ADC Last Converted Data Register - -// ***************************************************************************** -// PIO DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_PIO_PA0 ((unsigned int) 1 << 0) // Pin Controlled by PA0 -#define AT91C_PA0_RXD0 ((unsigned int) AT91C_PIO_PA0) // USART 0 Receive Data -#define AT91C_PIO_PA1 ((unsigned int) 1 << 1) // Pin Controlled by PA1 -#define AT91C_PA1_TXD0 ((unsigned int) AT91C_PIO_PA1) // USART 0 Transmit Data -#define AT91C_PIO_PA10 ((unsigned int) 1 << 10) // Pin Controlled by PA10 -#define AT91C_PA10_TWD ((unsigned int) AT91C_PIO_PA10) // TWI Two-wire Serial Data -#define AT91C_PIO_PA11 ((unsigned int) 1 << 11) // Pin Controlled by PA11 -#define AT91C_PA11_TWCK ((unsigned int) AT91C_PIO_PA11) // TWI Two-wire Serial Clock -#define AT91C_PIO_PA12 ((unsigned int) 1 << 12) // Pin Controlled by PA12 -#define AT91C_PA12_SPI0_NPCS0 ((unsigned int) AT91C_PIO_PA12) // SPI 0 Peripheral Chip Select 0 -#define AT91C_PIO_PA13 ((unsigned int) 1 << 13) // Pin Controlled by PA13 -#define AT91C_PA13_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PA13) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PA13_PCK1 ((unsigned int) AT91C_PIO_PA13) // PMC Programmable Clock Output 1 -#define AT91C_PIO_PA14 ((unsigned int) 1 << 14) // Pin Controlled by PA14 -#define AT91C_PA14_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PA14) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PA14_IRQ1 ((unsigned int) AT91C_PIO_PA14) // External Interrupt 1 -#define AT91C_PIO_PA15 ((unsigned int) 1 << 15) // Pin Controlled by PA15 -#define AT91C_PA15_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PA15) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PA15_TCLK2 ((unsigned int) AT91C_PIO_PA15) // Timer Counter 2 external clock input -#define AT91C_PIO_PA16 ((unsigned int) 1 << 16) // Pin Controlled by PA16 -#define AT91C_PA16_SPI0_MISO ((unsigned int) AT91C_PIO_PA16) // SPI 0 Master In Slave -#define AT91C_PIO_PA17 ((unsigned int) 1 << 17) // Pin Controlled by PA17 -#define AT91C_PA17_SPI0_MOSI ((unsigned int) AT91C_PIO_PA17) // SPI 0 Master Out Slave -#define AT91C_PIO_PA18 ((unsigned int) 1 << 18) // Pin Controlled by PA18 -#define AT91C_PA18_SPI0_SPCK ((unsigned int) AT91C_PIO_PA18) // SPI 0 Serial Clock -#define AT91C_PIO_PA19 ((unsigned int) 1 << 19) // Pin Controlled by PA19 -#define AT91C_PA19_CANRX ((unsigned int) AT91C_PIO_PA19) // CAN Receive -#define AT91C_PIO_PA2 ((unsigned int) 1 << 2) // Pin Controlled by PA2 -#define AT91C_PA2_SCK0 ((unsigned int) AT91C_PIO_PA2) // USART 0 Serial Clock -#define AT91C_PA2_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PA2) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PA20 ((unsigned int) 1 << 20) // Pin Controlled by PA20 -#define AT91C_PA20_CANTX ((unsigned int) AT91C_PIO_PA20) // CAN Transmit -#define AT91C_PIO_PA21 ((unsigned int) 1 << 21) // Pin Controlled by PA21 -#define AT91C_PA21_TF ((unsigned int) AT91C_PIO_PA21) // SSC Transmit Frame Sync -#define AT91C_PA21_SPI1_NPCS0 ((unsigned int) AT91C_PIO_PA21) // SPI 1 Peripheral Chip Select 0 -#define AT91C_PIO_PA22 ((unsigned int) 1 << 22) // Pin Controlled by PA22 -#define AT91C_PA22_TK ((unsigned int) AT91C_PIO_PA22) // SSC Transmit Clock -#define AT91C_PA22_SPI1_SPCK ((unsigned int) AT91C_PIO_PA22) // SPI 1 Serial Clock -#define AT91C_PIO_PA23 ((unsigned int) 1 << 23) // Pin Controlled by PA23 -#define AT91C_PA23_TD ((unsigned int) AT91C_PIO_PA23) // SSC Transmit data -#define AT91C_PA23_SPI1_MOSI ((unsigned int) AT91C_PIO_PA23) // SPI 1 Master Out Slave -#define AT91C_PIO_PA24 ((unsigned int) 1 << 24) // Pin Controlled by PA24 -#define AT91C_PA24_RD ((unsigned int) AT91C_PIO_PA24) // SSC Receive Data -#define AT91C_PA24_SPI1_MISO ((unsigned int) AT91C_PIO_PA24) // SPI 1 Master In Slave -#define AT91C_PIO_PA25 ((unsigned int) 1 << 25) // Pin Controlled by PA25 -#define AT91C_PA25_RK ((unsigned int) AT91C_PIO_PA25) // SSC Receive Clock -#define AT91C_PA25_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PA25) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PA26 ((unsigned int) 1 << 26) // Pin Controlled by PA26 -#define AT91C_PA26_RF ((unsigned int) AT91C_PIO_PA26) // SSC Receive Frame Sync -#define AT91C_PA26_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PA26) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PA27 ((unsigned int) 1 << 27) // Pin Controlled by PA27 -#define AT91C_PA27_DRXD ((unsigned int) AT91C_PIO_PA27) // DBGU Debug Receive Data -#define AT91C_PA27_PCK3 ((unsigned int) AT91C_PIO_PA27) // PMC Programmable Clock Output 3 -#define AT91C_PIO_PA28 ((unsigned int) 1 << 28) // Pin Controlled by PA28 -#define AT91C_PA28_DTXD ((unsigned int) AT91C_PIO_PA28) // DBGU Debug Transmit Data -#define AT91C_PIO_PA29 ((unsigned int) 1 << 29) // Pin Controlled by PA29 -#define AT91C_PA29_FIQ ((unsigned int) AT91C_PIO_PA29) // AIC Fast Interrupt Input -#define AT91C_PA29_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PA29) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PA3 ((unsigned int) 1 << 3) // Pin Controlled by PA3 -#define AT91C_PA3_RTS0 ((unsigned int) AT91C_PIO_PA3) // USART 0 Ready To Send -#define AT91C_PA3_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PA3) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PA30 ((unsigned int) 1 << 30) // Pin Controlled by PA30 -#define AT91C_PA30_IRQ0 ((unsigned int) AT91C_PIO_PA30) // External Interrupt 0 -#define AT91C_PA30_PCK2 ((unsigned int) AT91C_PIO_PA30) // PMC Programmable Clock Output 2 -#define AT91C_PIO_PA4 ((unsigned int) 1 << 4) // Pin Controlled by PA4 -#define AT91C_PA4_CTS0 ((unsigned int) AT91C_PIO_PA4) // USART 0 Clear To Send -#define AT91C_PA4_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PA4) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PA5 ((unsigned int) 1 << 5) // Pin Controlled by PA5 -#define AT91C_PA5_RXD1 ((unsigned int) AT91C_PIO_PA5) // USART 1 Receive Data -#define AT91C_PIO_PA6 ((unsigned int) 1 << 6) // Pin Controlled by PA6 -#define AT91C_PA6_TXD1 ((unsigned int) AT91C_PIO_PA6) // USART 1 Transmit Data -#define AT91C_PIO_PA7 ((unsigned int) 1 << 7) // Pin Controlled by PA7 -#define AT91C_PA7_SCK1 ((unsigned int) AT91C_PIO_PA7) // USART 1 Serial Clock -#define AT91C_PA7_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PA7) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PIO_PA8 ((unsigned int) 1 << 8) // Pin Controlled by PA8 -#define AT91C_PA8_RTS1 ((unsigned int) AT91C_PIO_PA8) // USART 1 Ready To Send -#define AT91C_PA8_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PA8) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PIO_PA9 ((unsigned int) 1 << 9) // Pin Controlled by PA9 -#define AT91C_PA9_CTS1 ((unsigned int) AT91C_PIO_PA9) // USART 1 Clear To Send -#define AT91C_PA9_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PA9) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PIO_PB0 ((unsigned int) 1 << 0) // Pin Controlled by PB0 -#define AT91C_PB0_ETXCK_EREFCK ((unsigned int) AT91C_PIO_PB0) // Ethernet MAC Transmit Clock/Reference Clock -#define AT91C_PB0_PCK0 ((unsigned int) AT91C_PIO_PB0) // PMC Programmable Clock Output 0 -#define AT91C_PIO_PB1 ((unsigned int) 1 << 1) // Pin Controlled by PB1 -#define AT91C_PB1_ETXEN ((unsigned int) AT91C_PIO_PB1) // Ethernet MAC Transmit Enable -#define AT91C_PIO_PB10 ((unsigned int) 1 << 10) // Pin Controlled by PB10 -#define AT91C_PB10_ETX2 ((unsigned int) AT91C_PIO_PB10) // Ethernet MAC Transmit Data 2 -#define AT91C_PB10_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PB10) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PB11 ((unsigned int) 1 << 11) // Pin Controlled by PB11 -#define AT91C_PB11_ETX3 ((unsigned int) AT91C_PIO_PB11) // Ethernet MAC Transmit Data 3 -#define AT91C_PB11_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PB11) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PB12 ((unsigned int) 1 << 12) // Pin Controlled by PB12 -#define AT91C_PB12_ETXER ((unsigned int) AT91C_PIO_PB12) // Ethernet MAC Transmikt Coding Error -#define AT91C_PB12_TCLK0 ((unsigned int) AT91C_PIO_PB12) // Timer Counter 0 external clock input -#define AT91C_PIO_PB13 ((unsigned int) 1 << 13) // Pin Controlled by PB13 -#define AT91C_PB13_ERX2 ((unsigned int) AT91C_PIO_PB13) // Ethernet MAC Receive Data 2 -#define AT91C_PB13_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PB13) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PIO_PB14 ((unsigned int) 1 << 14) // Pin Controlled by PB14 -#define AT91C_PB14_ERX3 ((unsigned int) AT91C_PIO_PB14) // Ethernet MAC Receive Data 3 -#define AT91C_PB14_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PB14) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PIO_PB15 ((unsigned int) 1 << 15) // Pin Controlled by PB15 -#define AT91C_PB15_ERXDV_ECRSDV ((unsigned int) AT91C_PIO_PB15) // Ethernet MAC Receive Data Valid -#define AT91C_PIO_PB16 ((unsigned int) 1 << 16) // Pin Controlled by PB16 -#define AT91C_PB16_ECOL ((unsigned int) AT91C_PIO_PB16) // Ethernet MAC Collision Detected -#define AT91C_PB16_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PB16) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PB17 ((unsigned int) 1 << 17) // Pin Controlled by PB17 -#define AT91C_PB17_ERXCK ((unsigned int) AT91C_PIO_PB17) // Ethernet MAC Receive Clock -#define AT91C_PB17_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PB17) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PIO_PB18 ((unsigned int) 1 << 18) // Pin Controlled by PB18 -#define AT91C_PB18_EF100 ((unsigned int) AT91C_PIO_PB18) // Ethernet MAC Force 100 Mbits/sec -#define AT91C_PB18_ADTRG ((unsigned int) AT91C_PIO_PB18) // ADC External Trigger -#define AT91C_PIO_PB19 ((unsigned int) 1 << 19) // Pin Controlled by PB19 -#define AT91C_PB19_PWM0 ((unsigned int) AT91C_PIO_PB19) // PWM Channel 0 -#define AT91C_PB19_TCLK1 ((unsigned int) AT91C_PIO_PB19) // Timer Counter 1 external clock input -#define AT91C_PIO_PB2 ((unsigned int) 1 << 2) // Pin Controlled by PB2 -#define AT91C_PB2_ETX0 ((unsigned int) AT91C_PIO_PB2) // Ethernet MAC Transmit Data 0 -#define AT91C_PIO_PB20 ((unsigned int) 1 << 20) // Pin Controlled by PB20 -#define AT91C_PB20_PWM1 ((unsigned int) AT91C_PIO_PB20) // PWM Channel 1 -#define AT91C_PB20_PCK0 ((unsigned int) AT91C_PIO_PB20) // PMC Programmable Clock Output 0 -#define AT91C_PIO_PB21 ((unsigned int) 1 << 21) // Pin Controlled by PB21 -#define AT91C_PB21_PWM2 ((unsigned int) AT91C_PIO_PB21) // PWM Channel 2 -#define AT91C_PB21_PCK1 ((unsigned int) AT91C_PIO_PB21) // PMC Programmable Clock Output 1 -#define AT91C_PIO_PB22 ((unsigned int) 1 << 22) // Pin Controlled by PB22 -#define AT91C_PB22_PWM3 ((unsigned int) AT91C_PIO_PB22) // PWM Channel 3 -#define AT91C_PB22_PCK2 ((unsigned int) AT91C_PIO_PB22) // PMC Programmable Clock Output 2 -#define AT91C_PIO_PB23 ((unsigned int) 1 << 23) // Pin Controlled by PB23 -#define AT91C_PB23_TIOA0 ((unsigned int) AT91C_PIO_PB23) // Timer Counter 0 Multipurpose Timer I/O Pin A -#define AT91C_PB23_DCD1 ((unsigned int) AT91C_PIO_PB23) // USART 1 Data Carrier Detect -#define AT91C_PIO_PB24 ((unsigned int) 1 << 24) // Pin Controlled by PB24 -#define AT91C_PB24_TIOB0 ((unsigned int) AT91C_PIO_PB24) // Timer Counter 0 Multipurpose Timer I/O Pin B -#define AT91C_PB24_DSR1 ((unsigned int) AT91C_PIO_PB24) // USART 1 Data Set ready -#define AT91C_PIO_PB25 ((unsigned int) 1 << 25) // Pin Controlled by PB25 -#define AT91C_PB25_TIOA1 ((unsigned int) AT91C_PIO_PB25) // Timer Counter 1 Multipurpose Timer I/O Pin A -#define AT91C_PB25_DTR1 ((unsigned int) AT91C_PIO_PB25) // USART 1 Data Terminal ready -#define AT91C_PIO_PB26 ((unsigned int) 1 << 26) // Pin Controlled by PB26 -#define AT91C_PB26_TIOB1 ((unsigned int) AT91C_PIO_PB26) // Timer Counter 1 Multipurpose Timer I/O Pin B -#define AT91C_PB26_RI1 ((unsigned int) AT91C_PIO_PB26) // USART 1 Ring Indicator -#define AT91C_PIO_PB27 ((unsigned int) 1 << 27) // Pin Controlled by PB27 -#define AT91C_PB27_TIOA2 ((unsigned int) AT91C_PIO_PB27) // Timer Counter 2 Multipurpose Timer I/O Pin A -#define AT91C_PB27_PWM0 ((unsigned int) AT91C_PIO_PB27) // PWM Channel 0 -#define AT91C_PIO_PB28 ((unsigned int) 1 << 28) // Pin Controlled by PB28 -#define AT91C_PB28_TIOB2 ((unsigned int) AT91C_PIO_PB28) // Timer Counter 2 Multipurpose Timer I/O Pin B -#define AT91C_PB28_PWM1 ((unsigned int) AT91C_PIO_PB28) // PWM Channel 1 -#define AT91C_PIO_PB29 ((unsigned int) 1 << 29) // Pin Controlled by PB29 -#define AT91C_PB29_PCK1 ((unsigned int) AT91C_PIO_PB29) // PMC Programmable Clock Output 1 -#define AT91C_PB29_PWM2 ((unsigned int) AT91C_PIO_PB29) // PWM Channel 2 -#define AT91C_PIO_PB3 ((unsigned int) 1 << 3) // Pin Controlled by PB3 -#define AT91C_PB3_ETX1 ((unsigned int) AT91C_PIO_PB3) // Ethernet MAC Transmit Data 1 -#define AT91C_PIO_PB30 ((unsigned int) 1 << 30) // Pin Controlled by PB30 -#define AT91C_PB30_PCK2 ((unsigned int) AT91C_PIO_PB30) // PMC Programmable Clock Output 2 -#define AT91C_PB30_PWM3 ((unsigned int) AT91C_PIO_PB30) // PWM Channel 3 -#define AT91C_PIO_PB4 ((unsigned int) 1 << 4) // Pin Controlled by PB4 -#define AT91C_PB4_ECRS ((unsigned int) AT91C_PIO_PB4) // Ethernet MAC Carrier Sense/Carrier Sense and Data Valid -#define AT91C_PIO_PB5 ((unsigned int) 1 << 5) // Pin Controlled by PB5 -#define AT91C_PB5_ERX0 ((unsigned int) AT91C_PIO_PB5) // Ethernet MAC Receive Data 0 -#define AT91C_PIO_PB6 ((unsigned int) 1 << 6) // Pin Controlled by PB6 -#define AT91C_PB6_ERX1 ((unsigned int) AT91C_PIO_PB6) // Ethernet MAC Receive Data 1 -#define AT91C_PIO_PB7 ((unsigned int) 1 << 7) // Pin Controlled by PB7 -#define AT91C_PB7_ERXER ((unsigned int) AT91C_PIO_PB7) // Ethernet MAC Receive Error -#define AT91C_PIO_PB8 ((unsigned int) 1 << 8) // Pin Controlled by PB8 -#define AT91C_PB8_EMDC ((unsigned int) AT91C_PIO_PB8) // Ethernet MAC Management Data Clock -#define AT91C_PIO_PB9 ((unsigned int) 1 << 9) // Pin Controlled by PB9 -#define AT91C_PB9_EMDIO ((unsigned int) AT91C_PIO_PB9) // Ethernet MAC Management Data Input/Output - -// ***************************************************************************** -// PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_ID_FIQ ((unsigned int) 0) // Advanced Interrupt Controller (FIQ) -#define AT91C_ID_SYS ((unsigned int) 1) // System Peripheral -#define AT91C_ID_PIOA ((unsigned int) 2) // Parallel IO Controller A -#define AT91C_ID_PIOB ((unsigned int) 3) // Parallel IO Controller B -#define AT91C_ID_SPI0 ((unsigned int) 4) // Serial Peripheral Interface 0 -#define AT91C_ID_SPI1 ((unsigned int) 5) // Serial Peripheral Interface 1 -#define AT91C_ID_US0 ((unsigned int) 6) // USART 0 -#define AT91C_ID_US1 ((unsigned int) 7) // USART 1 -#define AT91C_ID_SSC ((unsigned int) 8) // Serial Synchronous Controller -#define AT91C_ID_TWI ((unsigned int) 9) // Two-Wire Interface -#define AT91C_ID_PWMC ((unsigned int) 10) // PWM Controller -#define AT91C_ID_UDP ((unsigned int) 11) // USB Device Port -#define AT91C_ID_TC0 ((unsigned int) 12) // Timer Counter 0 -#define AT91C_ID_TC1 ((unsigned int) 13) // Timer Counter 1 -#define AT91C_ID_TC2 ((unsigned int) 14) // Timer Counter 2 -#define AT91C_ID_CAN ((unsigned int) 15) // Control Area Network Controller -#define AT91C_ID_EMAC ((unsigned int) 16) // Ethernet MAC -#define AT91C_ID_ADC ((unsigned int) 17) // Analog-to-Digital Converter -#define AT91C_ID_18_Reserved ((unsigned int) 18) // Reserved -#define AT91C_ID_19_Reserved ((unsigned int) 19) // Reserved -#define AT91C_ID_20_Reserved ((unsigned int) 20) // Reserved -#define AT91C_ID_21_Reserved ((unsigned int) 21) // Reserved -#define AT91C_ID_22_Reserved ((unsigned int) 22) // Reserved -#define AT91C_ID_23_Reserved ((unsigned int) 23) // Reserved -#define AT91C_ID_24_Reserved ((unsigned int) 24) // Reserved -#define AT91C_ID_25_Reserved ((unsigned int) 25) // Reserved -#define AT91C_ID_26_Reserved ((unsigned int) 26) // Reserved -#define AT91C_ID_27_Reserved ((unsigned int) 27) // Reserved -#define AT91C_ID_28_Reserved ((unsigned int) 28) // Reserved -#define AT91C_ID_29_Reserved ((unsigned int) 29) // Reserved -#define AT91C_ID_IRQ0 ((unsigned int) 30) // Advanced Interrupt Controller (IRQ0) -#define AT91C_ID_IRQ1 ((unsigned int) 31) // Advanced Interrupt Controller (IRQ1) -#define AT91C_ALL_INT ((unsigned int) 0xC003FFFF) // ALL VALID INTERRUPTS - -// ***************************************************************************** -// BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** - -#ifdef TEST - -extern AT91S_AIC AicPeripheral; -extern AT91S_PIO PioAPeripheral; -extern AT91S_PIO PioBPeripheral; -extern AT91S_PMC PmcPeripheral; -extern AT91S_USART Usart0Peripheral; -extern AT91S_TC TimerCounter0Peripheral; -extern AT91S_ADC AdcPeripheral; - -#define AIC_ADDR &AicPeripheral -#define PIOA_ADDR &PioAPeripheral -#define PIOB_ADDR &PioBPeripheral -#define PMC_ADDR &PmcPeripheral -#define US0_ADDR &Usart0Peripheral -#define TC0_ADDR &TimerCounter0Peripheral -#define ADC_ADDR &AdcPeripheral - -#else - -#define AIC_ADDR 0xFFFFF000 -#define PIOA_ADDR 0xFFFFF400 -#define PIOB_ADDR 0xFFFFF600 -#define PMC_ADDR 0xFFFFFC00 -#define US0_ADDR 0xFFFC0000 -#define TC0_ADDR 0xFFFA0000 -#define ADC_ADDR 0xFFFD8000 - -#endif // TEST - -#define AT91C_BASE_SYS ((AT91PS_SYS) 0xFFFFF000) // (SYS) Base Address -#define AT91C_BASE_AIC ((AT91PS_AIC) AIC_ADDR) // (AIC) Base Address -#define AT91C_BASE_PDC_DBGU ((AT91PS_PDC) 0xFFFFF300) // (PDC_DBGU) Base Address -#define AT91C_BASE_DBGU ((AT91PS_DBGU) 0xFFFFF200) // (DBGU) Base Address -#define AT91C_BASE_PIOA ((AT91PS_PIO) PIOA_ADDR) // (PIOA) Base Address -#define AT91C_BASE_PIOB ((AT91PS_PIO) PIOB_ADDR) // (PIOB) Base Address -#define AT91C_BASE_PMC ((AT91PS_PMC) PMC_ADDR) // (PMC) Base Address -#define AT91C_BASE_CKGR ((AT91PS_CKGR) 0xFFFFFC20) // (CKGR) Base Address -#define AT91C_BASE_RSTC ((AT91PS_RSTC) 0xFFFFFD00) // (RSTC) Base Address -#define AT91C_BASE_RTTC ((AT91PS_RTTC) 0xFFFFFD20) // (RTTC) Base Address -#define AT91C_BASE_PITC ((AT91PS_PITC) 0xFFFFFD30) // (PITC) Base Address -#define AT91C_BASE_WDTC ((AT91PS_WDTC) 0xFFFFFD40) // (WDTC) Base Address -#define AT91C_BASE_VREG ((AT91PS_VREG) 0xFFFFFD60) // (VREG) Base Address -#define AT91C_BASE_MC ((AT91PS_MC) 0xFFFFFF00) // (MC) Base Address -#define AT91C_BASE_PDC_SPI1 ((AT91PS_PDC) 0xFFFE4100) // (PDC_SPI1) Base Address -#define AT91C_BASE_SPI1 ((AT91PS_SPI) 0xFFFE4000) // (SPI1) Base Address -#define AT91C_BASE_PDC_SPI0 ((AT91PS_PDC) 0xFFFE0100) // (PDC_SPI0) Base Address -#define AT91C_BASE_SPI0 ((AT91PS_SPI) 0xFFFE0000) // (SPI0) Base Address -#define AT91C_BASE_PDC_US1 ((AT91PS_PDC) 0xFFFC4100) // (PDC_US1) Base Address -#define AT91C_BASE_US1 ((AT91PS_USART) 0xFFFC4000) // (US1) Base Address -#define AT91C_BASE_PDC_US0 ((AT91PS_PDC) 0xFFFC0100) // (PDC_US0) Base Address -#define AT91C_BASE_US0 ((AT91PS_USART) US0_ADDR) // (US0) Base Address -#define AT91C_BASE_PDC_SSC ((AT91PS_PDC) 0xFFFD4100) // (PDC_SSC) Base Address -#define AT91C_BASE_SSC ((AT91PS_SSC) 0xFFFD4000) // (SSC) Base Address -#define AT91C_BASE_TWI ((AT91PS_TWI) 0xFFFB8000) // (TWI) Base Address -#define AT91C_BASE_PWMC_CH3 ((AT91PS_PWMC_CH) 0xFFFCC260) // (PWMC_CH3) Base Address -#define AT91C_BASE_PWMC_CH2 ((AT91PS_PWMC_CH) 0xFFFCC240) // (PWMC_CH2) Base Address -#define AT91C_BASE_PWMC_CH1 ((AT91PS_PWMC_CH) 0xFFFCC220) // (PWMC_CH1) Base Address -#define AT91C_BASE_PWMC_CH0 ((AT91PS_PWMC_CH) 0xFFFCC200) // (PWMC_CH0) Base Address -#define AT91C_BASE_PWMC ((AT91PS_PWMC) 0xFFFCC000) // (PWMC) Base Address -#define AT91C_BASE_UDP ((AT91PS_UDP) 0xFFFB0000) // (UDP) Base Address -#define AT91C_BASE_TC0 ((AT91PS_TC) TC0_ADDR) // (TC0) Base Address -#define AT91C_BASE_TC1 ((AT91PS_TC) 0xFFFA0040) // (TC1) Base Address -#define AT91C_BASE_TC2 ((AT91PS_TC) 0xFFFA0080) // (TC2) Base Address -#define AT91C_BASE_TCB ((AT91PS_TCB) 0xFFFA0000) // (TCB) Base Address -#define AT91C_BASE_CAN_MB0 ((AT91PS_CAN_MB) 0xFFFD0200) // (CAN_MB0) Base Address -#define AT91C_BASE_CAN_MB1 ((AT91PS_CAN_MB) 0xFFFD0220) // (CAN_MB1) Base Address -#define AT91C_BASE_CAN_MB2 ((AT91PS_CAN_MB) 0xFFFD0240) // (CAN_MB2) Base Address -#define AT91C_BASE_CAN_MB3 ((AT91PS_CAN_MB) 0xFFFD0260) // (CAN_MB3) Base Address -#define AT91C_BASE_CAN_MB4 ((AT91PS_CAN_MB) 0xFFFD0280) // (CAN_MB4) Base Address -#define AT91C_BASE_CAN_MB5 ((AT91PS_CAN_MB) 0xFFFD02A0) // (CAN_MB5) Base Address -#define AT91C_BASE_CAN_MB6 ((AT91PS_CAN_MB) 0xFFFD02C0) // (CAN_MB6) Base Address -#define AT91C_BASE_CAN_MB7 ((AT91PS_CAN_MB) 0xFFFD02E0) // (CAN_MB7) Base Address -#define AT91C_BASE_CAN ((AT91PS_CAN) 0xFFFD0000) // (CAN) Base Address -#define AT91C_BASE_ADC ((AT91PS_ADC) ADC_ADDR) // (ADC) Base Address -#define AT91C_BASE_EMAC ((AT91PS_EMAC) 0xFFFDC000) // (EMAC) Base Address -#define AT91C_BASE_PDC_ADC ((AT91PS_PDC) 0xFFFD8100) // (PDC_ADC) Base Address - -// ***************************************************************************** -// MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -// ISRAM -#define AT91C_ISRAM ((char *) 0x00200000) // Internal SRAM base address -#define AT91C_ISRAM_SIZE ((unsigned int) 0x00010000) // Internal SRAM size in byte (64 Kbytes) -// IFLASH -#define AT91C_IFLASH ((char *) 0x00100000) // Internal FLASH base address -#define AT91C_IFLASH_SIZE ((unsigned int) 0x00040000) // Internal FLASH size in byte (256 Kbytes) -#define AT91C_IFLASH_PAGE_SIZE ((unsigned int) 256) // Internal FLASH Page Size: 256 bytes -#define AT91C_IFLASH_LOCK_REGION_SIZE ((unsigned int) 16384) // Internal FLASH Lock Region Size: 16 Kbytes -#define AT91C_IFLASH_NB_OF_PAGES ((unsigned int) 1024) // Internal FLASH Number of Pages: 1024 bytes -#define AT91C_IFLASH_NB_OF_LOCK_BITS ((unsigned int) 16) // Internal FLASH Number of Lock Bits: 16 bytes - -#endif diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.c deleted file mode 100644 index 28d9d20cf..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "Types.h" -#include "AdcConductor.h" -#include "AdcModel.h" -#include "AdcHardware.h" - -void AdcConductor_Init(void) -{ - AdcHardware_Init(); -} - -void AdcConductor_Run(void) -{ - if (AdcModel_DoGetSample() && AdcHardware_GetSampleComplete()) - { - AdcModel_ProcessInput(AdcHardware_GetSample()); - AdcHardware_StartConversion(); - } -} - -bool AdcConductor_JustHereToTest(void) -{ - EXAMPLE_STRUCT_T ExampleStruct; - ExampleStruct.x = 5; - ExampleStruct.y = 7; - - return AdcModel_DoNothingExceptTestASpecialType(ExampleStruct); -} - -bool AdcConductor_AlsoHereToTest(void) -{ - EXAMPLE_STRUCT_T example = AdcModel_DoNothingExceptReturnASpecialType(); - - return ((example.x == 99) && (example.y == 1)); -} - -bool AdcConductor_YetAnotherTest(void) -{ - uint32 example = 3; - - return AdModel_DoNothingExceptTestPointers(&example); -} - diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.h deleted file mode 100644 index 4280da3cf..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _ADCCONDUCTOR_H -#define _ADCCONDUCTOR_H - -void AdcConductor_Init(void); -void AdcConductor_Run(void); - -bool AdcConductor_JustHereToTest(void); -bool AdcConductor_AlsoHereToTest(void); -bool AdcConductor_YetAnotherTest(void); - -#endif // _ADCCONDUCTOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.c deleted file mode 100644 index 980764117..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "Types.h" -#include "AdcHardware.h" -#include "AdcHardwareConfigurator.h" -#include "AdcTemperatureSensor.h" - -void AdcHardware_Init(void) -{ - Adc_Reset(); - Adc_ConfigureMode(); - Adc_EnableTemperatureChannel(); - Adc_StartTemperatureSensorConversion(); -} - -void AdcHardware_StartConversion(void) -{ - Adc_StartTemperatureSensorConversion(); -} - -bool AdcHardware_GetSampleComplete(void) -{ - return Adc_TemperatureSensorSampleReady(); -} - -uint16 AdcHardware_GetSample(void) -{ - return Adc_ReadTemperatureSensor(); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.h deleted file mode 100644 index 3209a4c2a..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _ADCHARDWARE_H -#define _ADCHARDWARE_H - -void AdcHardware_Init(void); -void AdcHardware_StartConversion(void); -bool AdcHardware_GetSampleComplete(void); -uint16 AdcHardware_GetSample(void); - -#endif // _ADCHARDWARE_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.c deleted file mode 100644 index f7e08a239..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "Types.h" -#include "AdcHardwareConfigurator.h" -#include "ModelConfig.h" - -void Adc_Reset(void) -{ - AT91C_BASE_ADC->ADC_CR = AT91C_ADC_SWRST; -} - -void Adc_ConfigureMode(void) -{ - AT91C_BASE_ADC->ADC_MR = (((uint32)11) << 8) | (((uint32)4) << 16); -} - -void Adc_EnableTemperatureChannel(void) -{ - AT91C_BASE_ADC->ADC_CHER = 0x10; -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.h deleted file mode 100644 index 78b9e9fcf..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _ADCHARDWARECONFIGURATOR_H -#define _ADCHARDWARECONFIGURATOR_H - -#include "Types.h" - -void Adc_Reset(void); -void Adc_ConfigureMode(void); -void Adc_EnableTemperatureChannel(void); - -#endif // _ADCHARDWARECONFIGURATOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.c b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.c deleted file mode 100644 index ad9111d2c..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "AdcModel.h" -#include "TaskScheduler.h" -#include "TemperatureCalculator.h" -#include "TemperatureFilter.h" - -bool AdcModel_DoGetSample(void) -{ - return TaskScheduler_DoAdc(); -} - -void AdcModel_ProcessInput(uint16 millivolts) -{ - TemperatureFilter_ProcessInput(TemperatureCalculator_Calculate(millivolts)); -} - -bool AdcModel_DoNothingExceptTestASpecialType(EXAMPLE_STRUCT_T ExampleStruct) -{ - //This doesn't really do anything. it's only here to make sure I can compare a struct. - return FALSE; -} -bool AdModel_DoNothingExceptTestPointers(uint32* pExample) -{ - //This doesn't really do anything. it's only here to make sure I can compare a pointer value. - return FALSE; -} - -EXAMPLE_STRUCT_T AdcModel_DoNothingExceptReturnASpecialType(void) -{ - EXAMPLE_STRUCT_T example; //again, this just is here to test that I can return a struct - example.x = 99; - example.y = 1; - return example; -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.h deleted file mode 100644 index 6b871fdbf..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _ADCMODEL_H -#define _ADCMODEL_H - -#include "Types.h" - -bool AdcModel_DoGetSample(void); -void AdcModel_ProcessInput(uint16 millivolts); - -bool AdcModel_DoNothingExceptTestASpecialType(EXAMPLE_STRUCT_T ExampleStruct); -bool AdModel_DoNothingExceptTestPointers(uint32* pExample); -EXAMPLE_STRUCT_T AdcModel_DoNothingExceptReturnASpecialType(void); - -#endif // _ADCMODEL_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.c b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.c deleted file mode 100644 index b2a3f2c13..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "Types.h" -#include "AdcTemperatureSensor.h" - -static inline uint32 ConvertAdcCountsToPicovolts(uint32 counts); -static inline uint16 ConvertPicovoltsToMillivolts(uint32 picovolts); - -// -// PUBLIC METHODS -// - -void Adc_StartTemperatureSensorConversion(void) -{ - AT91C_BASE_ADC->ADC_CR = AT91C_ADC_START; -} - -bool Adc_TemperatureSensorSampleReady(void) -{ - return ((AT91C_BASE_ADC->ADC_SR & AT91C_ADC_EOC4) == AT91C_ADC_EOC4); -} - -uint16 Adc_ReadTemperatureSensor(void) -{ - uint32 picovolts = ConvertAdcCountsToPicovolts(AT91C_BASE_ADC->ADC_CDR4); - return ConvertPicovoltsToMillivolts(picovolts); -} - -// -// PRIVATE HELPERS -// - -static inline uint32 ConvertAdcCountsToPicovolts(uint32 counts) -{ - // ADC bit weight at 10-bit resolution with 3.0V reference = 2.9296875 mV/LSB - uint32 picovoltsPerAdcCount = 2929688; - - // Shift decimal point by 6 places to preserve accuracy in fixed-point math - return counts * picovoltsPerAdcCount; -} - -static inline uint16 ConvertPicovoltsToMillivolts(uint32 picovolts) -{ - const uint32 halfMillivoltInPicovolts = 500000; - const uint32 picovoltsPerMillivolt = 1000000; - - // Add 0.5 mV to result so that truncation yields properly rounded result - picovolts += halfMillivoltInPicovolts; - - // Divide appropriately to convert to millivolts - return (uint16)(picovolts / picovoltsPerMillivolt); -} - diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.h deleted file mode 100644 index bf2cc5b0d..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _ADCTEMPERATURESENSOR_H -#define _ADCTEMPERATURESENSOR_H - -#include "Types.h" - -void Adc_StartTemperatureSensorConversion(void); -bool Adc_TemperatureSensorSampleReady(void); -uint16 Adc_ReadTemperatureSensor(void); - -#endif // _ADCTEMPERATURESENSOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.c b/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.c deleted file mode 100644 index 7e45c3e57..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "Types.h" -#include "Executor.h" -#include "Model.h" -#include "UsartConductor.h" -#include "TimerConductor.h" -#include "AdcConductor.h" -#include "IntrinsicsWrapper.h" - - -void Executor_Init(void) -{ - Model_Init(); - UsartConductor_Init(); - AdcConductor_Init(); - TimerConductor_Init(); - Interrupt_Enable(); -} - -bool Executor_Run(void) -{ - UsartConductor_Run(); - TimerConductor_Run(); - AdcConductor_Run(); - return TRUE; -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.h b/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.h deleted file mode 100644 index 51a61a97e..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _EXECUTOR_H -#define _EXECUTOR_H - -#include "Types.h" - -void Executor_Init(void); -bool Executor_Run(void); - -#endif // _EXECUTOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.c b/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.c deleted file mode 100644 index 8b082aef4..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "IntrinsicsWrapper.h" -#ifdef __ICCARM__ -#include -#endif - -void Interrupt_Enable(void) -{ -#ifdef __ICCARM__ - __enable_interrupt(); -#endif -} - -void Interrupt_Disable(void) -{ -#ifdef __ICCARM__ - __disable_interrupt(); -#endif -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.h b/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.h deleted file mode 100644 index 9273317cd..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _INTRINSICS_WRAPPER_H -#define _INTRINSICS_WRAPPER_H - -void Interrupt_Enable(void); -void Interrupt_Disable(void); - -#endif // _INTRINSICS_WRAPPER_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Main.c b/components/testframework/libs/cmock/examples/temp_sensor/src/Main.c deleted file mode 100644 index a784f4759..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/Main.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "Types.h" - -#include "IntrinsicsWrapper.h" -#include "Executor.h" - -#include "Model.h" -#include "TaskScheduler.h" -#include "TemperatureCalculator.h" -#include "TemperatureFilter.h" - -#include "UsartConductor.h" -#include "UsartHardware.h" -#include "UsartConfigurator.h" -#include "UsartPutChar.h" -#include "UsartModel.h" -#include "UsartBaudRateRegisterCalculator.h" -#include "UsartTransmitBufferStatus.h" - -#include "TimerConductor.h" -#include "TimerHardware.h" -#include "TimerConfigurator.h" -#include "TimerInterruptConfigurator.h" -#include "TimerInterruptHandler.h" -#include "TimerModel.h" - -#include "AdcConductor.h" -#include "AdcHardware.h" -#include "AdcHardwareConfigurator.h" -#include "AdcTemperatureSensor.h" -#include "AdcModel.h" - -int AppMain(void) -{ - Executor_Init(); - - while(Executor_Run()); - - return 0; -} - -#ifndef TEST -int main(void) -{ - return AppMain(); -} -#endif // TEST diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Main.h b/components/testframework/libs/cmock/examples/temp_sensor/src/Main.h deleted file mode 100644 index 6cbe5f43a..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/Main.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _MAIN_H_ -#define _MAIN_H_ - -int AppMain(void); -int main(void); - -#endif // _MAIN_H_ diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Model.c b/components/testframework/libs/cmock/examples/temp_sensor/src/Model.c deleted file mode 100644 index 5b34c40cd..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/Model.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "Model.h" -#include "TaskScheduler.h" -#include "TemperatureFilter.h" - -void Model_Init(void) -{ - TaskScheduler_Init(); - TemperatureFilter_Init(); -} - diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Model.h b/components/testframework/libs/cmock/examples/temp_sensor/src/Model.h deleted file mode 100644 index d1309387d..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/Model.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _MODEL_H -#define _MODEL_H - -#include "Types.h" - -void Model_Init(void); - -#endif // _MODEL_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/ModelConfig.h b/components/testframework/libs/cmock/examples/temp_sensor/src/ModelConfig.h deleted file mode 100644 index edc8e8d4b..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/ModelConfig.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _MODELCONFIG_H -#define _MODELCONFIG_H - -#define MASTER_CLOCK 48054857 // Master Clock -#define USART0_BAUDRATE 115200 // USART Baudrate - -#endif // _MODELCONFIG_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.c deleted file mode 100644 index bcc0e6436..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.c +++ /dev/null @@ -1,72 +0,0 @@ -#include "Types.h" -#include "TaskScheduler.h" - -typedef struct _Task -{ - bool doIt; - uint32 period; - uint32 startTime; -} Task; - -typedef struct _TaskSchedulerInstance -{ - Task usart; - Task adc; -} TaskSchedulerInstance; - -static TaskSchedulerInstance this; - -void TaskScheduler_Init(void) -{ - this.usart.doIt = FALSE; - this.usart.startTime = 0; - - //The correct period - this.usart.period = 1000; - - this.adc.doIt = FALSE; - this.adc.startTime = 0; - this.adc.period = 100; -} - -void TaskScheduler_Update(uint32 time) -{ - if ((time - this.usart.startTime) >= this.usart.period) - { - this.usart.doIt = TRUE; - this.usart.startTime = time - (time % this.usart.period); - } - - if ((time - this.adc.startTime) >= this.adc.period) - { - this.adc.doIt = TRUE; - this.adc.startTime = time - (time % this.adc.period); - } -} - -bool TaskScheduler_DoUsart(void) -{ - bool doIt = FALSE; - - if (this.usart.doIt) - { - doIt = TRUE; - this.usart.doIt = FALSE; - } - - return doIt; -} - -bool TaskScheduler_DoAdc(void) -{ - bool doIt = FALSE; - - if (this.adc.doIt) - { - doIt = TRUE; - this.adc.doIt = FALSE; - } - - return doIt; -} - diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.h deleted file mode 100644 index cc58342c5..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _TASKSCHEDULER_H -#define _TASKSCHEDULER_H - -#include "Types.h" - -void TaskScheduler_Init(void); -void TaskScheduler_Update(uint32 time); -bool TaskScheduler_DoUsart(void); -bool TaskScheduler_DoAdc(void); - -#endif // _TASKSCHEDULER_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.c deleted file mode 100644 index 04cec59d4..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "Types.h" -#include "TemperatureCalculator.h" -#include - -#ifndef logl -#define logl log -#endif - -float TemperatureCalculator_Calculate(uint16 millivolts) -{ - const double supply_voltage = 3.0; - const double series_resistance = 5000; - const double coefficient_A = 316589.698; - const double coefficient_B = -0.1382009; - double sensor_voltage = ((double)millivolts / 1000); - double resistance; - - if (millivolts == 0) - { - return -INFINITY; - } - - // Series resistor is 5k Ohms; Reference voltage is 3.0V - // R(t) = A * e^(B*t); R is resistance of thermisor; t is temperature in C - resistance = ((supply_voltage * series_resistance) / sensor_voltage) - series_resistance; - return (float)(logl(resistance / coefficient_A) / coefficient_B); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.h deleted file mode 100644 index b606c2d40..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _TEMPERATURECALCULATOR_H -#define _TEMPERATURECALCULATOR_H - -float TemperatureCalculator_Calculate(uint16 millivolts); - -#endif // _TEMPERATURECALCULATOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.c deleted file mode 100644 index 02fc04506..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "Types.h" -#include "TemperatureFilter.h" -#include - -static bool initialized; -static float temperatureInCelcius; - -void TemperatureFilter_Init(void) -{ - initialized = FALSE; - temperatureInCelcius = -INFINITY; -} - -float TemperatureFilter_GetTemperatureInCelcius(void) -{ - return temperatureInCelcius; -} - -void TemperatureFilter_ProcessInput(float temperature) -{ - if (!initialized) - { - temperatureInCelcius = temperature; - initialized = TRUE; - } - else - { - if (temperature == +INFINITY || - temperature == -INFINITY || - temperature == +NAN || - temperature == -NAN) - { - initialized = FALSE; - temperature = -INFINITY; - } - - temperatureInCelcius = (temperatureInCelcius * 0.75f) + (temperature * 0.25); - } -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.h deleted file mode 100644 index 31413f491..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _TEMPERATUREFILTER_H -#define _TEMPERATUREFILTER_H - -#include "Types.h" - -void TemperatureFilter_Init(void); -float TemperatureFilter_GetTemperatureInCelcius(void); -void TemperatureFilter_ProcessInput(float temperature); - -#endif // _TEMPERATUREFILTER_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.c deleted file mode 100644 index 569b489a0..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "Types.h" -#include "TimerConductor.h" -#include "TimerModel.h" -#include "TimerHardware.h" -#include "TimerInterruptHandler.h" - -void TimerConductor_Init(void) -{ - TimerHardware_Init(); -} - -void TimerConductor_Run(void) -{ - TimerModel_UpdateTime(Timer_GetSystemTime()); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.h deleted file mode 100644 index 7cd410970..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _TIMERCONDUCTOR_H -#define _TIMERCONDUCTOR_H - -#include "Types.h" - -void TimerConductor_Init(void); -void TimerConductor_Run(void); - -#endif // _TIMERCONDUCTOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.c deleted file mode 100644 index 996cedefb..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "Types.h" -#include "TimerConfigurator.h" -#include "TimerInterruptConfigurator.h" - -void Timer_EnablePeripheralClocks(void) -{ - AT91C_BASE_PMC->PMC_PCER = TIMER0_CLOCK_ENABLE | PIOB_CLOCK_ENABLE; -} - -void Timer_Reset(void) -{ - uint32 dummy; - AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKDIS; - AT91C_BASE_TC0->TC_IDR = 0xffffffff; - dummy = AT91C_BASE_TC0->TC_SR; - dummy = dummy; -} - -void Timer_ConfigureMode(void) -{ - AT91C_BASE_TC0->TC_CMR = 0x000CC004; // ACPC=toggle TIOA on RC compare; mode=WAVE; WAVE_SEL=UP w/auto-trigger on RC compare; clock=MCK/1024 -} - -void Timer_ConfigurePeriod(void) -{ - AT91C_BASE_TC0->TC_RC = 469; // 10ms period for timer clock source of MCK/1024 with MCK=48054857 -} - -void Timer_EnableOutputPin(void) -{ - AT91C_BASE_PIOB->PIO_PDR = TIOA0_PIN_MASK; -} - -void Timer_Enable(void) -{ - AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKEN; -} - -void Timer_ConfigureInterruptHandler(void) -{ - Timer_DisableInterrupt(); - Timer_ResetSystemTime(); - Timer_ConfigureInterrupt(); - Timer_EnableInterrupt(); -} - -void Timer_Start(void) -{ - AT91C_BASE_TC0->TC_CCR = AT91C_TC_SWTRG; -} - diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.h deleted file mode 100644 index d078c54e6..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _TIMERCONFIGURATOR_H -#define _TIMERCONFIGURATOR_H - -#include "Types.h" - -void Timer_EnablePeripheralClocks(void); -void Timer_Reset(void); -void Timer_ConfigureMode(void); -void Timer_ConfigurePeriod(void); -void Timer_EnableOutputPin(void); -void Timer_Enable(void); -void Timer_ConfigureInterruptHandler(void); -void Timer_Start(void); - -#endif // _TIMERCONFIGURATOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.c deleted file mode 100644 index d5e983ff5..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "Types.h" -#include "TimerHardware.h" -#include "TimerConfigurator.h" - -void TimerHardware_Init(void) -{ - Timer_EnablePeripheralClocks(); - Timer_Reset(); - Timer_ConfigureMode(); - Timer_ConfigurePeriod(); - Timer_EnableOutputPin(); - Timer_Enable(); - Timer_ConfigureInterruptHandler(); - Timer_Start(); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.h deleted file mode 100644 index 92fa28710..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _TIMERHARDWARE_H -#define _TIMERHARDWARE_H - -#include "Types.h" - -void TimerHardware_Init(void); - -#endif // _TIMERHARDWARE_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c deleted file mode 100644 index fe603ef32..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c +++ /dev/null @@ -1,55 +0,0 @@ -#include "Types.h" -#include "TimerInterruptConfigurator.h" -#include "TimerInterruptHandler.h" - -static inline void SetInterruptHandler(void); -static inline void ConfigureInterruptSourceModeRegister(void); -static inline void ClearInterrupt(void); -static inline void EnableCompareInterruptForRegisterC(void); - -void Timer_DisableInterrupt(void) -{ - AT91C_BASE_AIC->AIC_IDCR = TIMER0_ID_MASK; -} - -void Timer_ResetSystemTime(void) -{ - Timer_SetSystemTime(0); -} - -void Timer_ConfigureInterrupt(void) -{ - SetInterruptHandler(); - ConfigureInterruptSourceModeRegister(); - ClearInterrupt(); - EnableCompareInterruptForRegisterC(); -} - -void Timer_EnableInterrupt(void) -{ - AT91C_BASE_AIC->AIC_IECR = TIMER0_ID_MASK; -} - -// -// Helpers -// - -static inline void SetInterruptHandler(void) -{ - AT91C_BASE_AIC->AIC_SVR[AT91C_ID_TC0] = (uint32)Timer_InterruptHandler; -} - -static inline void ConfigureInterruptSourceModeRegister(void) -{ - AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] = 1; -} - -static inline void ClearInterrupt(void) -{ - AT91C_BASE_AIC->AIC_ICCR = TIMER0_ID_MASK; -} - -static inline void EnableCompareInterruptForRegisterC(void) -{ - AT91C_BASE_TC0->TC_IER = AT91C_TC_CPCS; -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.h deleted file mode 100644 index bdf64718d..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _TIMERINTERRUPTCONFIGURATOR_H -#define _TIMERINTERRUPTCONFIGURATOR_H - -#include "Types.h" - -#define TIMER0_ID_MASK (((uint32)0x1) << AT91C_ID_TC0) - -void Timer_DisableInterrupt(void); -void Timer_ResetSystemTime(void); -void Timer_ConfigureInterrupt(void); -void Timer_EnableInterrupt(void); - -#endif // _TIMERINTERRUPTCONFIGURATOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.c deleted file mode 100644 index ebb543d44..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "Types.h" -#include "TimerInterruptHandler.h" -#include "TimerInterruptConfigurator.h" - -static uint32 systemTime; - -void Timer_SetSystemTime(uint32 time) -{ - systemTime = time; -} - -uint32 Timer_GetSystemTime(void) -{ - return systemTime; -} - -void Timer_InterruptHandler(void) -{ - uint32 status = AT91C_BASE_TC0->TC_SR; - if (status & AT91C_TC_CPCS) - { - systemTime += 10; - } -} - diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.h deleted file mode 100644 index 29c0413bb..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _TIMERINTERRUPTHANDLER_H -#define _TIMERINTERRUPTHANDLER_H - -#include "Types.h" - -void Timer_SetSystemTime(uint32 time); -uint32 Timer_GetSystemTime(void); -void Timer_InterruptHandler(void); - -#endif // _TIMERINTERRUPTHANDLER_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.c deleted file mode 100644 index fcc9db9bd..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "Types.h" -#include "TimerModel.h" -#include "TaskScheduler.h" - -void TimerModel_UpdateTime(uint32 systemTime) -{ - TaskScheduler_Update(systemTime); -} - diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.h deleted file mode 100644 index 54be21a47..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _TIMERMODEL_H -#define _TIMERMODEL_H - -#include "Types.h" - -void TimerModel_UpdateTime(uint32 systemTime); - -#endif // _TIMERMODEL_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Types.h b/components/testframework/libs/cmock/examples/temp_sensor/src/Types.h deleted file mode 100644 index 6a0f8247f..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/Types.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef _MYTYPES_H_ -#define _MYTYPES_H_ - -#include "AT91SAM7X256.h" -#include - -#ifndef __monitor -#define __monitor -#endif - -// Peripheral Helper Definitions -#define USART0_CLOCK_ENABLE (AT91C_ID_US0) -#define USART0_TX_PIN (AT91C_PA1_TXD0) -#define TIMER0_CLOCK_ENABLE (((uint32)0x1) << AT91C_ID_TC0) -#define PIOA_CLOCK_ENABLE (((uint32)0x1) << AT91C_ID_PIOA) -#define PIOB_CLOCK_ENABLE (((uint32)0x1) << AT91C_ID_PIOB) -#define TIOA0_PIN_MASK (((uint32)0x1) << 23) // Timer/Counter Output Pin - -// Application Type Definitions -typedef unsigned int uint32; -typedef int int32; -typedef unsigned short uint16; -typedef short int16; -typedef unsigned char uint8; -typedef char int8; -typedef char bool; - -// Application Special Value Definitions -#ifndef TRUE -#define TRUE (1) -#endif -#ifndef FALSE -#define FALSE (0) -#endif -#ifndef NULL -#define NULL (0) -#endif // NULL -#define DONT_CARE (0) - -#ifndef INFINITY -#define INFINITY (1.0 / 0.0) -#endif - -#ifndef NAN -#define NAN (0.0 / 0.0) -#endif - -// MIN/MAX Definitions for Standard Types -#ifndef INT8_MAX -#define INT8_MAX 127 -#endif - -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif - -#ifndef UINT8_MAX -#define UINT8_MAX 0xFFU -#endif - -#ifndef UINT8_MIN -#define UINT8_MIN 0x00U -#endif - -#ifndef INT16_MAX -#define INT16_MAX 32767 -#endif - -#ifndef INT16_MIN -#define INT16_MIN (-32768) -#endif - -#ifndef UINT16_MAX -#define UINT16_MAX 0xFFFFU -#endif - -#ifndef UINT16_MIN -#define UINT16_MIN 0x0000U -#endif - -#ifndef INT32_MAX -#define INT32_MAX 0x7FFFFFFF -#endif - -#ifndef INT32_MIN -#define INT32_MIN (-INT32_MAX - 1) -#endif - -#ifndef UINT32_MAX -#define UINT32_MAX 0xFFFFFFFFU -#endif - -#ifndef UINT32_MIN -#define UINT32_MIN 0x00000000U -#endif - -typedef struct _EXAMPLE_STRUCT_T -{ - int x; - int y; -} EXAMPLE_STRUCT_T; - -#endif // _MYTYPES_H_ diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c deleted file mode 100644 index f4ad1470f..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "Types.h" -#include "UsartBaudRateRegisterCalculator.h" - -uint8 UsartModel_CalculateBaudRateRegisterSetting(uint32 masterClock, uint32 baudRate) -{ - uint32 registerSetting = ((masterClock * 10) / (baudRate * 16)); - - if ((registerSetting % 10) >= 5) - { - registerSetting = (registerSetting / 10) + 1; - } - else - { - registerSetting /= 10; - } - - return (uint8)registerSetting; -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h deleted file mode 100644 index 50e904875..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _USARTBAUDRATEREGISTERCALCULATOR_H -#define _USARTBAUDRATEREGISTERCALCULATOR_H - -uint8 UsartModel_CalculateBaudRateRegisterSetting(uint32 masterClock, uint32 baudRate); - -#endif // _USARTBAUDRATEREGISTERCALCULATOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.c deleted file mode 100644 index 3eeec3c1b..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "Types.h" -#include "UsartConductor.h" -#include "UsartHardware.h" -#include "UsartModel.h" -#include "TaskScheduler.h" - -void UsartConductor_Init(void) -{ - UsartHardware_Init(UsartModel_GetBaudRateRegisterSetting()); - UsartHardware_TransmitString(UsartModel_GetWakeupMessage()); -} - -void UsartConductor_Run(void) -{ - char* temp; - if (TaskScheduler_DoUsart()) - { - temp = UsartModel_GetFormattedTemperature(); - UsartHardware_TransmitString(temp); - } -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.h deleted file mode 100644 index f4207365f..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _USARTCONDUCTOR_H -#define _USARTCONDUCTOR_H - -void UsartConductor_Init(void); -void UsartConductor_Run(void); - -#endif // _USARTCONDUCTOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.c deleted file mode 100644 index b8c2cdc73..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "Types.h" -#include "UsartConfigurator.h" - -void Usart_ConfigureUsartIO(void) -{ - AT91C_BASE_PIOA->PIO_ASR = USART0_TX_PIN; - AT91C_BASE_PIOA->PIO_BSR = 0; - AT91C_BASE_PIOA->PIO_PDR = USART0_TX_PIN; -} - -void Usart_EnablePeripheralClock(void) -{ - AT91C_BASE_PMC->PMC_PCER = ((uint32)1) << USART0_CLOCK_ENABLE; -} - -void Usart_Reset(void) -{ - AT91C_BASE_US0->US_IDR = 0xffffffff; - AT91C_BASE_US0->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS; -} - -void Usart_ConfigureMode(void) -{ - AT91C_BASE_US0->US_MR = AT91C_US_USMODE_NORMAL | - AT91C_US_NBSTOP_1_BIT | - AT91C_US_PAR_NONE | - AT91C_US_CHRL_8_BITS | - AT91C_US_CLKS_CLOCK; -} - -void Usart_SetBaudRateRegister(uint8 baudRateRegisterSetting) -{ - AT91C_BASE_US0->US_BRGR = baudRateRegisterSetting; -} - -void Usart_Enable(void) -{ - AT91C_BASE_US0->US_CR = AT91C_US_TXEN; -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.h deleted file mode 100644 index 02bede2ab..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _USARTCONFIGURATOR_H -#define _USARTCONFIGURATOR_H - -#include "Types.h" - -void Usart_ConfigureUsartIO(void); -void Usart_EnablePeripheralClock(void); -void Usart_Reset(void); -void Usart_ConfigureMode(void); -void Usart_SetBaudRateRegister(uint8 baudRateRegisterSetting); -void Usart_Enable(void); - -#endif // _USARTCONFIGURATOR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.c deleted file mode 100644 index e37c2c606..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "Types.h" -#include "UsartHardware.h" -#include "UsartConfigurator.h" -#include "UsartPutChar.h" - -void UsartHardware_Init(uint8 baudRateRegisterSetting) -{ - Usart_ConfigureUsartIO(); - Usart_EnablePeripheralClock(); - Usart_Reset(); - Usart_ConfigureMode(); - Usart_SetBaudRateRegister(baudRateRegisterSetting); - Usart_Enable(); -} - -void UsartHardware_TransmitString(char* data) -{ - while(*data != NULL) - { - Usart_PutChar(*data++); - } -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.h deleted file mode 100644 index 041e28086..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _USARTHARDWARE_H -#define _USARTHARDWARE_H - -#include "Types.h" - -void UsartHardware_Init(uint8 baudRateRegisterSetting); -void UsartHardware_TransmitString(char* data); - -#endif // _USARTHARDWARE_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.c deleted file mode 100644 index d722a2f3e..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "Types.h" -#include "UsartModel.h" -#include "ModelConfig.h" -#include "UsartBaudRateRegisterCalculator.h" -#include "TemperatureFilter.h" -#include -#include - -char formattedTemperature[32]; -char* wakeup = "It's Awesome Time!\n"; - -uint8 UsartModel_GetBaudRateRegisterSetting(void) -{ - return UsartModel_CalculateBaudRateRegisterSetting(MASTER_CLOCK, USART0_BAUDRATE); -} - -char* UsartModel_GetFormattedTemperature(void) -{ - float temperature = TemperatureFilter_GetTemperatureInCelcius(); - if (temperature == -INFINITY) - { - sprintf(formattedTemperature, "%s", "Temperature sensor failure!\n"); - } - else - { - sprintf(formattedTemperature, "%.1f C\n", temperature); - } - return formattedTemperature; -} - -char* UsartModel_GetWakeupMessage(void) -{ - return wakeup; -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.h deleted file mode 100644 index 7d9485440..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _USARTMODEL_H -#define _USARTMODEL_H - -#include "Types.h" - -uint8 UsartModel_GetBaudRateRegisterSetting(void); -char* UsartModel_GetFormattedTemperature(void); -char* UsartModel_GetWakeupMessage(void); - -#endif // _USARTMODEL_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.c deleted file mode 100644 index 9e3ce2c8b..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "Types.h" -#include "UsartPutChar.h" -#include "UsartTransmitBufferStatus.h" -#ifdef SIMULATE -#include -#endif - -void Usart_PutChar(char data) -{ - while(!Usart_ReadyToTransmit()); -#ifdef SIMULATE - printf("%c", data); -#else - AT91C_BASE_US0->US_THR = data; -#endif -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.h deleted file mode 100644 index 924446ab9..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _USARTPUT_HAR_H -#define _USARTPUT_HAR_H - -#include "Types.h" - -void Usart_PutChar(char data); - -#endif // _USARTPUT_HAR_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.c deleted file mode 100644 index 914b2e147..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "Types.h" -#include "UsartTransmitBufferStatus.h" - -bool Usart_ReadyToTransmit(void) -{ - return (AT91C_BASE_US0->US_CSR & AT91C_US_TXRDY) > 0; -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.h deleted file mode 100644 index b5925ba21..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _USARTTRANSMITBUFFERSTATUS_H -#define _USARTTRANSMITBUFFERSTATUS_H - -#include "Types.h" - -bool Usart_ReadyToTransmit(void); - -#endif // _USARTTRANSMITBUFFERSTATUS_H diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcConductor.c deleted file mode 100644 index a15d7d1b4..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcConductor.c +++ /dev/null @@ -1,121 +0,0 @@ -#include "unity.h" -#include "UnityHelper.h" -#include "Types.h" -#include "Types.h" -#include "AdcConductor.h" -#include "MockAdcModel.h" -#include "MockAdcHardware.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testInitShouldCallHardwareInit(void) -{ - AdcHardware_Init_Expect(); - AdcConductor_Init(); -} - -void testRunShouldNotDoAnythingIfItIsNotTime(void) -{ - AdcModel_DoGetSample_ExpectAndReturn(FALSE); - - AdcConductor_Run(); -} - -void testRunShouldNotPassAdcResultToModelIfSampleIsNotComplete(void) -{ - AdcModel_DoGetSample_ExpectAndReturn(TRUE); - AdcHardware_GetSampleComplete_ExpectAndReturn(FALSE); - - AdcConductor_Run(); -} - -void testRunShouldGetLatestSampleFromAdcAndPassItToModelAndStartNewConversionWhenItIsTime(void) -{ - AdcModel_DoGetSample_ExpectAndReturn(TRUE); - AdcHardware_GetSampleComplete_ExpectAndReturn(TRUE); - AdcHardware_GetSample_ExpectAndReturn(293U); - AdcModel_ProcessInput_Expect(293U); - AdcHardware_StartConversion_Expect(); - - AdcConductor_Run(); -} - -void testJustHereToTest_Should_ProperlyPassAStructAndVerifyIt(void) -{ - EXAMPLE_STRUCT_T TestStruct; - TestStruct.x = 5; - TestStruct.y = 7; - - AdcModel_DoNothingExceptTestASpecialType_ExpectAndReturn(TestStruct, TRUE); - - TEST_ASSERT_TRUE(AdcConductor_JustHereToTest()); -} - -//void testJustHereToTest_Should_FailThisTestIfYouUncommentXIsBecauseItsWrong(void) -//{ -// EXAMPLE_STRUCT_T TestStruct; -// TestStruct.x = 6; -// TestStruct.y = 7; -// -// AdcModel_DoNothingExceptTestASpecialType_ExpectAndReturn(TestStruct, TRUE); -// -// TEST_ASSERT_TRUE(AdcConductor_JustHereToTest()); -//} -// -//void testJustHereToTest_Should_FailThisTestIfYouUncommentYIsBecauseItsWrong(void) -//{ -// EXAMPLE_STRUCT_T TestStruct; -// TestStruct.x = 5; -// TestStruct.y = 8; -// -// AdcModel_DoNothingExceptTestASpecialType_ExpectAndReturn(TestStruct, TRUE); -// -// TEST_ASSERT_TRUE(AdcConductor_JustHereToTest()); -//} - -void test_AdcConductor_AlsoHereToTest_Should_ProperlyReturnAStructAsExpected1(void) -{ - EXAMPLE_STRUCT_T TestStruct; - TestStruct.x = 99; - TestStruct.y = 1; - - AdcModel_DoNothingExceptReturnASpecialType_ExpectAndReturn(TestStruct); - - TEST_ASSERT_TRUE(AdcConductor_AlsoHereToTest()); -} - -void test_AdcConductor_AlsoHereToTest_Should_ProperlyReturnAStructAsExpected2(void) -{ - EXAMPLE_STRUCT_T TestStruct; - TestStruct.x = 98; - TestStruct.y = 1; - - AdcModel_DoNothingExceptReturnASpecialType_ExpectAndReturn(TestStruct); - - TEST_ASSERT_FALSE(AdcConductor_AlsoHereToTest()); -} - -void test_AdcConductor_YetAnotherTest_Should_VerifyThatPointersToStructsAreTestable(void) -{ - uint32 TestNum = 3; - - AdModel_DoNothingExceptTestPointers_ExpectAndReturn(&TestNum, TRUE); - - TEST_ASSERT_TRUE(AdcConductor_YetAnotherTest()); -} - -//void test_AdcConductor_YetAnotherTest_Should_FailIfYouUncommentThisTestBecauseTheValuePointedToIsWrong(void) -//{ -// uint32 TestNum = 7; -// -// AdModel_DoNothingExceptTestPointers_ExpectAndReturn(&TestNum, FALSE); -// -// TEST_ASSERT_FALSE(AdcConductor_YetAnotherTest()); -//} - diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardware.c deleted file mode 100644 index 7aabaa759..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardware.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "AdcHardware.h" -#include "MockAdcHardwareConfigurator.h" -#include "MockAdcTemperatureSensor.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testInitShouldDelegateToConfiguratorAndTemperatureSensor(void) -{ - Adc_Reset_Expect(); - Adc_ConfigureMode_Expect(); - Adc_EnableTemperatureChannel_Expect(); - Adc_StartTemperatureSensorConversion_Expect(); - - AdcHardware_Init(); -} - -void testGetSampleCompleteShouldReturn_FALSE_WhenTemperatureSensorSampleReadyReturns_FALSE(void) -{ - Adc_TemperatureSensorSampleReady_ExpectAndReturn(FALSE); - TEST_ASSERT(!AdcHardware_GetSampleComplete()); -} - -void testGetSampleCompleteShouldReturn_TRUE_WhenTemperatureSensorSampleReadyReturns_TRUE(void) -{ - Adc_TemperatureSensorSampleReady_ExpectAndReturn(TRUE); - TEST_ASSERT(AdcHardware_GetSampleComplete()); -} - -void testGetSampleShouldDelegateToAdcTemperatureSensor(void) -{ - uint16 sample; - Adc_ReadTemperatureSensor_ExpectAndReturn(847); - - sample = AdcHardware_GetSample(); - TEST_ASSERT_EQUAL(847, sample); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardwareConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardwareConfigurator.c deleted file mode 100644 index c1feceb71..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardwareConfigurator.c +++ /dev/null @@ -1,43 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "AdcHardwareConfigurator.h" -#include "AT91SAM7X256.h" -#include "ModelConfig.h" - -AT91S_ADC AdcPeripheral; - -void setUp(void) -{ - -} - -void tearDown(void) -{ -} - -void testResetShouldResetTheAdcConverterPeripheral(void) -{ - AT91C_BASE_ADC->ADC_CR = 0; - Adc_Reset(); - TEST_ASSERT_EQUAL(AT91C_ADC_SWRST, AT91C_BASE_ADC->ADC_CR); -} - -void testConfigureModeShouldSetAdcModeRegisterAppropriately(void) -{ - uint32 prescaler = (MASTER_CLOCK / (2 * 2000000)) - 1; // 5MHz ADC clock - - AT91C_BASE_ADC->ADC_MR = 0; - - Adc_ConfigureMode(); - - TEST_ASSERT_EQUAL(prescaler, (AT91C_BASE_ADC->ADC_MR & AT91C_ADC_PRESCAL) >> 8); -} - -void testEnableTemperatureChannelShouldEnableTheAppropriateAdcInput(void) -{ - AT91C_BASE_ADC->ADC_CHER = 0; - - Adc_EnableTemperatureChannel(); - - TEST_ASSERT_EQUAL(0x1 << 4, AT91C_BASE_ADC->ADC_CHER); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcModel.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcModel.c deleted file mode 100644 index f1dcb4aae..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcModel.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "AdcModel.h" -#include "MockTaskScheduler.h" -#include "MockTemperatureCalculator.h" -#include "MockTemperatureFilter.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testDoGetSampleShouldReturn_FALSE_WhenTaskSchedulerReturns_FALSE(void) -{ - TaskScheduler_DoAdc_ExpectAndReturn(FALSE); - TEST_ASSERT_EQUAL(FALSE, AdcModel_DoGetSample()); -} - -void testDoGetSampleShouldReturn_TRUE_WhenTaskSchedulerReturns_TRUE(void) -{ - TaskScheduler_DoAdc_ExpectAndReturn(TRUE); - TEST_ASSERT_EQUAL(TRUE, AdcModel_DoGetSample()); -} - -void testProcessInputShouldDelegateToTemperatureCalculatorAndPassResultToFilter(void) -{ - TemperatureCalculator_Calculate_ExpectAndReturn(21473, 23.5f); - TemperatureFilter_ProcessInput_Expect(23.5f); - AdcModel_ProcessInput(21473); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcTemperatureSensor.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcTemperatureSensor.c deleted file mode 100644 index 0be339ff2..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcTemperatureSensor.c +++ /dev/null @@ -1,47 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "AdcTemperatureSensor.h" -#include "AT91SAM7X256.h" - -AT91S_ADC AdcPeripheral; - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testShouldStartTemperatureSensorConversionWhenTriggered(void) -{ - AT91C_BASE_ADC->ADC_CR = 0; - Adc_StartTemperatureSensorConversion(); - TEST_ASSERT_EQUAL(AT91C_ADC_START, AT91C_BASE_ADC->ADC_CR); -} - -void testTemperatureSensorSampleReadyShouldReturnChannelConversionCompletionStatus(void) -{ - AT91C_BASE_ADC->ADC_SR = 0; - TEST_ASSERT_EQUAL(FALSE, Adc_TemperatureSensorSampleReady()); - AT91C_BASE_ADC->ADC_SR = ~AT91C_ADC_EOC4; - TEST_ASSERT_EQUAL(FALSE, Adc_TemperatureSensorSampleReady()); - AT91C_BASE_ADC->ADC_SR = AT91C_ADC_EOC4; - TEST_ASSERT_EQUAL(TRUE, Adc_TemperatureSensorSampleReady()); - AT91C_BASE_ADC->ADC_SR = 0xffffffff; - TEST_ASSERT_EQUAL(TRUE, Adc_TemperatureSensorSampleReady()); -} - -void testReadTemperatureSensorShouldFetchAndTranslateLatestReadingToMillivolts(void) -{ - uint16 result; - - // ADC bit weight at 10-bit resolution with 3.0V reference = 2.9296875 mV/LSB - AT91C_BASE_ADC->ADC_CDR4 = 138; - result = Adc_ReadTemperatureSensor(); - TEST_ASSERT_EQUAL(404, result); - - AT91C_BASE_ADC->ADC_CDR4 = 854; - result = Adc_ReadTemperatureSensor(); - TEST_ASSERT_EQUAL(2502, result); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestExecutor.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestExecutor.c deleted file mode 100644 index 8e4832620..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestExecutor.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "Executor.h" -#include "MockModel.h" -#include "MockUsartConductor.h" -#include "MockAdcConductor.h" -#include "MockTimerConductor.h" -#include "MockIntrinsicsWrapper.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testInitShouldCallInitOfAllConductorsAndTheModel(void) -{ - Model_Init_Expect(); - UsartConductor_Init_Expect(); - AdcConductor_Init_Expect(); - TimerConductor_Init_Expect(); - Interrupt_Enable_Expect(); - - Executor_Init(); -} - -void testRunShouldCallRunForEachConductorAndReturnTrueAlways(void) -{ - UsartConductor_Run_Expect(); - TimerConductor_Run_Expect(); - AdcConductor_Run_Expect(); - - TEST_ASSERT_EQUAL(TRUE, Executor_Run()); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestMain.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestMain.c deleted file mode 100644 index baf338290..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestMain.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "MockExecutor.h" -#include "Main.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testMainShouldCallExecutorInitAndContinueToCallExecutorRunUntilHalted(void) -{ - Executor_Init_Expect(); - Executor_Run_ExpectAndReturn(TRUE); - Executor_Run_ExpectAndReturn(TRUE); - Executor_Run_ExpectAndReturn(TRUE); - Executor_Run_ExpectAndReturn(TRUE); - Executor_Run_ExpectAndReturn(FALSE); - - AppMain(); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestModel.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestModel.c deleted file mode 100644 index 59dda1dc7..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestModel.c +++ /dev/null @@ -1,20 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "Model.h" -#include "MockTaskScheduler.h" -#include "MockTemperatureFilter.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testInitShouldCallSchedulerAndTemperatureFilterInit(void) -{ - TaskScheduler_Init_Expect(); - TemperatureFilter_Init_Expect(); - Model_Init(); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTaskScheduler.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTaskScheduler.c deleted file mode 100644 index 29d1edf1d..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTaskScheduler.c +++ /dev/null @@ -1,104 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "TaskScheduler.h" - -void setUp(void) -{ - TaskScheduler_Init(); -} - -void tearDown(void) -{ -} - -void testShouldScheduleUsartTaskAfter1000ms(void) -{ - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); - - TaskScheduler_Update(999); - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); - - TaskScheduler_Update(1000); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); -} - -void testShouldClearUsartDoFlagAfterReported(void) -{ - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); - TaskScheduler_Update(1000); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); -} - -void testShouldScheduleUsartTaskEvery1000ms(void) -{ - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); - - TaskScheduler_Update(1300); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); - - TaskScheduler_Update(2000); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); - - TaskScheduler_Update(3100); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); -} - -void testShouldScheduleUsartTaskOnlyOncePerPeriod(void) -{ - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); - TaskScheduler_Update(1000); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); - TaskScheduler_Update(1001); - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); - TaskScheduler_Update(1999); - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); - TaskScheduler_Update(2000); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); -} - -void testShouldScheduleAdcTaskAfter100ms(void) -{ - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); - - TaskScheduler_Update(99); - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); - - TaskScheduler_Update(100); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); -} - -void testShouldClearAdcDoFlagAfterReported(void) -{ - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); - TaskScheduler_Update(100); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); -} - -void testShouldScheduleAdcTaskEvery100ms(void) -{ - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); - - TaskScheduler_Update(121); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); - - TaskScheduler_Update(200); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); - - TaskScheduler_Update(356); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); -} - -void testShouldScheduleAdcTaskOnlyOncePerPeriod(void) -{ - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); - TaskScheduler_Update(100); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); - TaskScheduler_Update(101); - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); - TaskScheduler_Update(199); - TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); - TaskScheduler_Update(200); - TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureCalculator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureCalculator.c deleted file mode 100644 index dbb7dea06..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureCalculator.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "TemperatureCalculator.h" -#include - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testTemperatureCalculatorShouldCalculateTemperatureFromMillivolts(void) -{ - float result; - - // Series resistor is 5k Ohms; Reference voltage is 3.0V - // R(t) = A * e^(B*t); R is resistance of thermisor; t is temperature in C - result = TemperatureCalculator_Calculate(1000); - TEST_ASSERT_FLOAT_WITHIN(0.01f, 25.0f, result); - - result = TemperatureCalculator_Calculate(2985); - TEST_ASSERT_FLOAT_WITHIN(0.01f, 68.317f, result); - - result = TemperatureCalculator_Calculate(3); - TEST_ASSERT_FLOAT_WITHIN(0.01f, -19.96f, result); -} - -void testShouldReturnNegativeInfinityWhen_0_millivoltsInput(void) -{ - TEST_ASSERT_FLOAT_WITHIN(0.0000001f, -INFINITY, TemperatureCalculator_Calculate(0)); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureFilter.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureFilter.c deleted file mode 100644 index 58fb178f1..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureFilter.c +++ /dev/null @@ -1,69 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "TemperatureFilter.h" -#include - -void setUp(void) -{ - TemperatureFilter_Init(); -} - -void tearDown(void) -{ -} - -void testShouldInitializeTemeratureToInvalidValue(void) -{ - TemperatureFilter_Init(); - TEST_ASSERT_FLOAT_WITHIN(0.0001f, -INFINITY, TemperatureFilter_GetTemperatureInCelcius()); -} - -void testShouldInitializeTemperatureAfterCallToInit(void) -{ - TemperatureFilter_Init(); - TemperatureFilter_ProcessInput(17.8f); - TEST_ASSERT_FLOAT_WITHIN(0.0001f, 17.8f, TemperatureFilter_GetTemperatureInCelcius()); - - TemperatureFilter_Init(); - TemperatureFilter_ProcessInput(32.6f); - TEST_ASSERT_FLOAT_WITHIN(0.0001f, 32.6f, TemperatureFilter_GetTemperatureInCelcius()); -} - -void setValueAndVerifyResponse(float input, float response) -{ - float actual; - TemperatureFilter_ProcessInput(input); - actual = TemperatureFilter_GetTemperatureInCelcius(); - TEST_ASSERT_FLOAT_WITHIN(0.0001f, response, actual); -} - -void testShouldWeightEachSubsequentValueBy25PercentAfterInitialValue(void) -{ - TemperatureFilter_Init(); - setValueAndVerifyResponse(0.0f, 0.0f); - setValueAndVerifyResponse(10.0f, 2.5f); - setValueAndVerifyResponse(10.0f, 4.375f); - setValueAndVerifyResponse(10.0f, 5.78125f); - - TemperatureFilter_Init(); - setValueAndVerifyResponse(100.0f, 100.0f); - setValueAndVerifyResponse(0.0f, 75.0f); - setValueAndVerifyResponse(0.0f, 56.25f); - setValueAndVerifyResponse(0.0f, 42.1875f); -} - -void setInvalidTemperatureAndVerifyReinitialized(float invalidTemperature) -{ - TemperatureFilter_Init(); - setValueAndVerifyResponse(100.0f, 100.0f); - setValueAndVerifyResponse(invalidTemperature, -INFINITY); - setValueAndVerifyResponse(14.3f, 14.3f); -} - -void testShouldResetAverageIfPassedInfinityOrInvalidValue(void) -{ - setInvalidTemperatureAndVerifyReinitialized(-INFINITY); - setInvalidTemperatureAndVerifyReinitialized(+INFINITY); - setInvalidTemperatureAndVerifyReinitialized(+NAN); - setInvalidTemperatureAndVerifyReinitialized(-NAN); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConductor.c deleted file mode 100644 index 8064a8c51..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConductor.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "TimerConductor.h" -#include "MockTimerHardware.h" -#include "MockTimerModel.h" -#include "MockTimerInterruptHandler.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testInitShouldCallHardwareInit(void) -{ - TimerHardware_Init_Expect(); - - TimerConductor_Init(); -} - -void testRunShouldGetSystemTimeAndPassOnToModelForEventScheduling(void) -{ - Timer_GetSystemTime_ExpectAndReturn(1230); - TimerModel_UpdateTime_Expect(1230); - TimerConductor_Run(); - - Timer_GetSystemTime_ExpectAndReturn(837460); - TimerModel_UpdateTime_Expect(837460); - TimerConductor_Run(); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConfigurator.c deleted file mode 100644 index 5c7d4e044..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConfigurator.c +++ /dev/null @@ -1,112 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "TimerConfigurator.h" -#include "AT91SAM7X256.h" -#include "MockTimerInterruptConfigurator.h" - -AT91S_PMC PmcPeripheral; -AT91S_TC TimerCounter0Peripheral; -AT91S_PIO PioBPeripheral; - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testEnablePeripheralClocksShouldEnableClockToTimer0Peripheral(void) -{ - AT91C_BASE_PMC->PMC_PCER = 0; - Timer_EnablePeripheralClocks(); - TEST_ASSERT_EQUAL( - TIMER0_CLOCK_ENABLE, - AT91C_BASE_PMC->PMC_PCER & TIMER0_CLOCK_ENABLE); -} - -void testEnablePeripheralClocksShouldEnableClockToPIOBPeripheral(void) -{ - AT91C_BASE_PMC->PMC_PCER = 0; - Timer_EnablePeripheralClocks(); - TEST_ASSERT_EQUAL( - PIOB_CLOCK_ENABLE, - AT91C_BASE_PMC->PMC_PCER & PIOB_CLOCK_ENABLE); -} - -void testResetShouldSetTimer0ClockDisableBit_DisableTimer0Interrupts_ClearStatusRegister(void) -{ - AT91C_BASE_TC0->TC_CCR = 0; - AT91C_BASE_TC0->TC_IDR = 0; - AT91C_BASE_TC0->TC_SR = 0xFFFFFFFF; - Timer_Reset(); - TEST_ASSERT_EQUAL(0x00000002, AT91C_BASE_TC0->TC_CCR); - TEST_ASSERT_EQUAL(0xffffffff, AT91C_BASE_TC0->TC_IDR); - // CANNOT BE VERIFIED!! TEST_ASSERT_EQUAL(0X00000000, AT91C_BASE_TC0->TC_SR); -} - -void testEnableOutputPinShouldEnable_TIOA0_DigitalOutput(void) -{ - AT91C_BASE_PIOB->PIO_PDR = 0; - Timer_EnableOutputPin(); - TEST_ASSERT_EQUAL(TIOA0_PIN_MASK, AT91C_BASE_PIOB->PIO_PDR); -} - -void testConfigureModeShouldConfigureTimer0ClockSourceForMasterClockDividedBy1024(void) -{ - AT91C_BASE_TC0->TC_CMR = 0; - Timer_ConfigureMode(); - TEST_ASSERT_EQUAL(0x00000004, AT91C_BASE_TC0->TC_CMR & 0x00000007); -} - -void testConfigureModeShouldConfigureTimer0ForWaveGeneration(void) -{ - AT91C_BASE_TC0->TC_CMR = 0; - Timer_ConfigureMode(); - TEST_ASSERT_EQUAL(0x00008000, AT91C_BASE_TC0->TC_CMR & 0x00008000); -} - -void testConfigureModeShouldConfigureTimer0ForUpModeWithAutomaticTriggerOnRCCompare(void) -{ - AT91C_BASE_TC0->TC_CMR = 0; - Timer_ConfigureMode(); - TEST_ASSERT_EQUAL(0x00004000, AT91C_BASE_TC0->TC_CMR & 0x00006000); -} - -void testConfigureModeShouldConfigureTimer0ToToggleTIOAOnRCCompare(void) -{ - AT91C_BASE_TC0->TC_CMR = 0; - Timer_ConfigureMode(); - TEST_ASSERT_EQUAL(0x000C0000, AT91C_BASE_TC0->TC_CMR & 0x000C0000); -} - -void testConfigurePeriodShouldConfigureRegisterCFor10msInterval(void) -{ - AT91C_BASE_TC0->TC_RC = 0; - Timer_ConfigurePeriod(); - TEST_ASSERT_EQUAL(469, AT91C_BASE_TC0->TC_RC); -} - -void testEnableShouldSetEnableFlagForTimer0(void) -{ - AT91C_BASE_TC0->TC_CCR = 0; - Timer_Enable(); - TEST_ASSERT_EQUAL_INT(1, AT91C_BASE_TC0->TC_CCR); -} - -void testConfigureInterruptHandler(void) -{ - Timer_DisableInterrupt_Expect(); - Timer_ResetSystemTime_Expect(); - Timer_ConfigureInterrupt_Expect(); - Timer_EnableInterrupt_Expect(); - - Timer_ConfigureInterruptHandler(); -} - -void testStartShouldSetSoftwareTriggerFlag(void) -{ - AT91C_BASE_TC0->TC_CCR = 0; - Timer_Start(); - TEST_ASSERT_EQUAL(0x04, AT91C_BASE_TC0->TC_CCR); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerHardware.c deleted file mode 100644 index 16339d0ca..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerHardware.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "TimerHardware.h" -#include "MockTimerConfigurator.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testInitShouldDelegateAppropriatelyToConfigurator(void) -{ - Timer_EnablePeripheralClocks_Expect(); - Timer_Reset_Expect(); - Timer_ConfigureMode_Expect(); - Timer_ConfigurePeriod_Expect(); - Timer_EnableOutputPin_Expect(); - Timer_Enable_Expect(); - Timer_ConfigureInterruptHandler_Expect(); - Timer_Start_Expect(); - - TimerHardware_Init(); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptConfigurator.c deleted file mode 100644 index 13c35f444..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptConfigurator.c +++ /dev/null @@ -1,78 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "TimerInterruptConfigurator.h" -#include "MockTimerInterruptHandler.h" -#include "AT91SAM7X256.h" - -AT91S_AIC AicPeripheral; -AT91S_TC TimerCounter0Peripheral; - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void test_TIMER0_ID_MASK_ShouldBeCorrect(void) -{ - TEST_ASSERT_EQUAL(((uint32)0x1) << AT91C_ID_TC0, TIMER0_ID_MASK); -} - -void testDisableInterruptDisablesTimer0InterruptInTheInterruptController(void) -{ - AT91C_BASE_AIC->AIC_IDCR = 0; - Timer_DisableInterrupt(); - TEST_ASSERT_EQUAL(TIMER0_ID_MASK, AT91C_BASE_AIC->AIC_IDCR); -} - -void testResetSystemTimeDelegatesTo_Timer_SetSystemTime_Appropriately(void) -{ - Timer_SetSystemTime_Expect(0); - Timer_ResetSystemTime(); -} - -void testConfigureInterruptShouldSetInterruptHandlerAppropriately(void) -{ - AT91C_BASE_AIC->AIC_SVR[AT91C_ID_TC0] = (uint32)NULL; - Timer_ConfigureInterrupt(); - TEST_ASSERT_EQUAL((uint32)Timer_InterruptHandler, AT91C_BASE_AIC->AIC_SVR[AT91C_ID_TC0]); -} - -void testConfigureInterruptShouldSetInterruptLevelInSourceModeRegisterAppropriately(void) -{ - AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] = 0; - Timer_ConfigureInterrupt(); - TEST_ASSERT_EQUAL( - AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, - AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] & 0x00000060); -} - -void testConfigureInterruptShouldSetInterruptPriorityInSourceModeRegisterAppropriately(void) -{ - AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] = 0; - Timer_ConfigureInterrupt(); - TEST_ASSERT_EQUAL(1, AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] & 0x00000007); -} - -void testConfigureInterruptShouldClearTimer0InterruptOnTheInterruptController(void) -{ - AT91C_BASE_AIC->AIC_ICCR = 0; - Timer_ConfigureInterrupt(); - TEST_ASSERT_EQUAL(TIMER0_ID_MASK, AT91C_BASE_AIC->AIC_ICCR); -} - -void testConfigureInterruptShouldEnableCompareInterruptForRegisterC(void) -{ - AT91C_BASE_TC0->TC_IER = 0; - Timer_ConfigureInterrupt(); - TEST_ASSERT_EQUAL(AT91C_TC_CPCS, AT91C_BASE_TC0->TC_IER); -} - -void testEnableInterruptShouldEnableTimer0InterruptsInInterruptCotroller(void) -{ - AT91C_BASE_AIC->AIC_IECR = 0; - Timer_EnableInterrupt(); - TEST_ASSERT_EQUAL(TIMER0_ID_MASK, AT91C_BASE_AIC->AIC_IECR); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptHandler.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptHandler.c deleted file mode 100644 index 8e2e64e9d..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptHandler.c +++ /dev/null @@ -1,66 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "TimerInterruptHandler.h" -#include "AT91SAM7X256.h" - -AT91S_TC TimerCounter0Peripheral; - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testSetAndGetSystemTime(void) -{ - Timer_SetSystemTime(0); - TEST_ASSERT_EQUAL(0, Timer_GetSystemTime()); - - Timer_SetSystemTime(129837); - TEST_ASSERT_EQUAL(129837, Timer_GetSystemTime()); - - Timer_SetSystemTime(UINT32_MAX); - TEST_ASSERT_EQUAL(UINT32_MAX, Timer_GetSystemTime()); -} - -void testInterruptHandlerShouldIncrementSystemTimeOnlyIfStatusHasCompareRegisterCOverflowBitSet(void) -{ - Timer_SetSystemTime(0); - AT91C_BASE_TC0->TC_SR = 0; - Timer_InterruptHandler(); - TEST_ASSERT_EQUAL(0, Timer_GetSystemTime()); - - Timer_SetSystemTime(0); - AT91C_BASE_TC0->TC_SR = ~AT91C_TC_CPCS; - Timer_InterruptHandler(); - TEST_ASSERT_EQUAL(0, Timer_GetSystemTime()); - - Timer_SetSystemTime(0); - AT91C_BASE_TC0->TC_SR = AT91C_TC_CPCS; - Timer_InterruptHandler(); - TEST_ASSERT(Timer_GetSystemTime() > 0); - - Timer_SetSystemTime(0); - AT91C_BASE_TC0->TC_SR = 0xffffffff; - Timer_InterruptHandler(); - TEST_ASSERT(Timer_GetSystemTime() > 0); -} - -void testInterruptHandlerShouldIncrementSystemTimerBy_10(void) -{ - Timer_SetSystemTime(0); - AT91C_BASE_TC0->TC_SR = AT91C_TC_CPCS; - Timer_InterruptHandler(); - TEST_ASSERT_EQUAL(10, Timer_GetSystemTime()); - - AT91C_BASE_TC0->TC_SR = AT91C_TC_CPCS; - Timer_InterruptHandler(); - TEST_ASSERT_EQUAL(20, Timer_GetSystemTime()); - - Timer_SetSystemTime(39426857); - AT91C_BASE_TC0->TC_SR = AT91C_TC_CPCS; - Timer_InterruptHandler(); - TEST_ASSERT_EQUAL(39426867, Timer_GetSystemTime()); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerModel.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerModel.c deleted file mode 100644 index e92a96aa8..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerModel.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "TimerModel.h" -#include "MockTaskScheduler.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testUpdateTimeShouldDelegateToTaskScheduler(void) -{ - TaskScheduler_Update_Expect(19387L); - TimerModel_UpdateTime(19387L); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c deleted file mode 100644 index 08dc04591..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "UsartBaudRateRegisterCalculator.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testCalculateBaudRateRegisterSettingShouldCalculateRegisterSettingAppropriately(void) -{ - // BaudRate = MCK / (CD x 16) - per datasheet section 30.6.1.2 "Baud Rate Calculation Example" - TEST_ASSERT_EQUAL(26, UsartModel_CalculateBaudRateRegisterSetting(48000000, 115200)); - TEST_ASSERT_EQUAL(6, UsartModel_CalculateBaudRateRegisterSetting(3686400, 38400)); - TEST_ASSERT_EQUAL(23, UsartModel_CalculateBaudRateRegisterSetting(14318180, 38400)); - TEST_ASSERT_EQUAL(20, UsartModel_CalculateBaudRateRegisterSetting(12000000, 38400)); - TEST_ASSERT_EQUAL(13, UsartModel_CalculateBaudRateRegisterSetting(12000000, 56800)); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConductor.c deleted file mode 100644 index fd6de6eb7..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConductor.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "UsartConductor.h" -#include "MockUsartModel.h" -#include "MockUsartHardware.h" -#include "MockTaskScheduler.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testShouldInitializeHardwareWhenInitCalled(void) -{ - UsartModel_GetBaudRateRegisterSetting_ExpectAndReturn(4); - UsartModel_GetWakeupMessage_ExpectAndReturn("Hey there!"); - UsartHardware_TransmitString_Expect("Hey there!"); - UsartHardware_Init_Expect(4); - - UsartConductor_Init(); -} - -void testRunShouldNotDoAnythingIfSchedulerSaysItIsNotTimeYet(void) -{ - TaskScheduler_DoUsart_ExpectAndReturn(FALSE); - - UsartConductor_Run(); -} - -void testRunShouldGetCurrentTemperatureAndTransmitIfSchedulerSaysItIsTime(void) -{ - TaskScheduler_DoUsart_ExpectAndReturn(TRUE); - UsartModel_GetFormattedTemperature_ExpectAndReturn("hey there"); - UsartHardware_TransmitString_Expect("hey there"); - - UsartConductor_Run(); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConfigurator.c deleted file mode 100644 index b23029e9b..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConfigurator.c +++ /dev/null @@ -1,77 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "UsartConfigurator.h" - -AT91S_PIO PioAPeripheral; -AT91S_PMC PmcPeripheral; -AT91S_USART Usart0Peripheral; - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testConfigureUsartIOShouldConfigureUsartTxPinfForPeripheralIO(void) -{ - AT91C_BASE_PIOA->PIO_ASR = 0; - AT91C_BASE_PIOA->PIO_BSR = 0xffffffff; - AT91C_BASE_PIOA->PIO_PDR = 0; - Usart_ConfigureUsartIO(); - TEST_ASSERT_EQUAL(USART0_TX_PIN, AT91C_BASE_PIOA->PIO_ASR); - TEST_ASSERT_EQUAL(0, AT91C_BASE_PIOA->PIO_BSR); - TEST_ASSERT_EQUAL(USART0_TX_PIN, AT91C_BASE_PIOA->PIO_PDR); -} - -void testEnablePeripheralClockShouldEnableClockToUsartPeripheral(void) -{ - AT91C_BASE_PMC->PMC_PCER = 0; - Usart_EnablePeripheralClock(); - TEST_ASSERT_EQUAL(((uint32)1) << USART0_CLOCK_ENABLE, AT91C_BASE_PMC->PMC_PCER); -} - -void testResetShouldDisableAllUsartInterrupts(void) -{ - AT91C_BASE_US0->US_IDR = 0; - Usart_Reset(); - TEST_ASSERT_EQUAL(0xffffffff, AT91C_BASE_US0->US_IDR); -} - -void testResetShouldResetUsartTransmitterAndReceiver(void) -{ - AT91C_BASE_US0->US_CR = 0; - Usart_Reset(); - TEST_ASSERT_EQUAL(AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS, AT91C_BASE_US0->US_CR); -} - -void testConfigureModeShouldSetUsartModeToAsynchronous(void) -{ - uint32 asyncMode = (AT91C_US_USMODE_NORMAL | - AT91C_US_NBSTOP_1_BIT | - AT91C_US_PAR_NONE | - AT91C_US_CHRL_8_BITS | - AT91C_US_CLKS_CLOCK); - - AT91C_BASE_US0->US_MR = ~asyncMode; - Usart_ConfigureMode(); - TEST_ASSERT_EQUAL(asyncMode, AT91C_BASE_US0->US_MR); -} - -void testSetBaudRateRegisterShouldSetUsartBaudRateRegisterToValuePassedAsParameter(void) -{ - AT91C_BASE_US0->US_BRGR = 0; - Usart_SetBaudRateRegister(3); - TEST_ASSERT_EQUAL(3, AT91C_BASE_US0->US_BRGR); - Usart_SetBaudRateRegister(251); - TEST_ASSERT_EQUAL(251, AT91C_BASE_US0->US_BRGR); -} - - -void testEnableShouldEnableUsart0Transmitter(void) -{ - AT91C_BASE_US0->US_CR = 0; - Usart_Enable(); - TEST_ASSERT_EQUAL(AT91C_US_TXEN, AT91C_BASE_US0->US_CR); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartHardware.c deleted file mode 100644 index b4a0d0ca7..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartHardware.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "UsartHardware.h" -#include "AT91SAM7X256.h" -#include "MockUsartConfigurator.h" -#include "MockUsartPutChar.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testInitShouldConfigureUsartPeripheralByCallingConfiguratorAppropriately(void) -{ - Usart_ConfigureUsartIO_Expect(); - Usart_EnablePeripheralClock_Expect(); - Usart_Reset_Expect(); - Usart_ConfigureMode_Expect(); - Usart_SetBaudRateRegister_Expect(73); - Usart_Enable_Expect(); - - UsartHardware_Init(73); -} - -void testTransmitStringShouldSendDesiredStringOutUsingUsart(void) -{ - Usart_PutChar_Expect('h'); - Usart_PutChar_Expect('e'); - Usart_PutChar_Expect('l'); - Usart_PutChar_Expect('l'); - Usart_PutChar_Expect('o'); - - UsartHardware_TransmitString("hello"); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartModel.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartModel.c deleted file mode 100644 index 6ab23bc0f..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartModel.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "UsartModel.h" -#include "ModelConfig.h" -#include "MockTemperatureFilter.h" -#include "MockUsartBaudRateRegisterCalculator.h" -#include - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testGetBaudRateRegisterSettingShouldReturnAppropriateBaudRateRegisterSetting(void) -{ - uint8 dummyRegisterSetting = 17; - UsartModel_CalculateBaudRateRegisterSetting_ExpectAndReturn(MASTER_CLOCK, USART0_BAUDRATE, dummyRegisterSetting); - - TEST_ASSERT_EQUAL(dummyRegisterSetting, UsartModel_GetBaudRateRegisterSetting()); -} - -void testGetFormattedTemperatureFormatsTemperatureFromCalculatorAppropriately(void) -{ - TemperatureFilter_GetTemperatureInCelcius_ExpectAndReturn(25.0f); - TEST_ASSERT_EQUAL_STRING("25.0 C\n", UsartModel_GetFormattedTemperature()); -} - -void testShouldReturnErrorMessageUponInvalidTemperatureValue(void) -{ - TemperatureFilter_GetTemperatureInCelcius_ExpectAndReturn(-INFINITY); - TEST_ASSERT_EQUAL_STRING("Temperature sensor failure!\n", UsartModel_GetFormattedTemperature()); -} - -void testShouldReturnWakeupMessage(void) -{ - TEST_ASSERT_EQUAL_STRING("It's Awesome Time!\n", UsartModel_GetWakeupMessage()); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartPutChar.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartPutChar.c deleted file mode 100644 index 766a88901..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartPutChar.c +++ /dev/null @@ -1,43 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "UsartPutChar.h" -#include "MockUsartTransmitBufferStatus.h" - -AT91S_USART Usart0Peripheral; - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testPutCharShouldWriteDesiredCharacterToUsartTransmitBuffer(void) -{ - AT91C_BASE_US0->US_THR = 0; - - Usart_ReadyToTransmit_ExpectAndReturn(TRUE); - Usart_PutChar('x'); - TEST_ASSERT_EQUAL('x', AT91C_BASE_US0->US_THR); - - Usart_ReadyToTransmit_ExpectAndReturn(TRUE); - Usart_PutChar('1'); - TEST_ASSERT_EQUAL('1', AT91C_BASE_US0->US_THR); - - Usart_ReadyToTransmit_ExpectAndReturn(TRUE); - Usart_PutChar(':'); - TEST_ASSERT_EQUAL(':', AT91C_BASE_US0->US_THR); -} - -void testPutCharShouldWaitUntilReadyToTransmitBeforeLoadingTransmitBufffer(void) -{ - AT91C_BASE_US0->US_THR = 0; - - Usart_ReadyToTransmit_ExpectAndReturn(FALSE); - Usart_ReadyToTransmit_ExpectAndReturn(FALSE); - Usart_ReadyToTransmit_ExpectAndReturn(FALSE); - Usart_ReadyToTransmit_ExpectAndReturn(TRUE); - Usart_PutChar('x'); - TEST_ASSERT_EQUAL('x', AT91C_BASE_US0->US_THR); -} diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartTransmitBufferStatus.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartTransmitBufferStatus.c deleted file mode 100644 index c06084f32..000000000 --- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartTransmitBufferStatus.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "unity.h" -#include "Types.h" -#include "UsartTransmitBufferStatus.h" - -AT91S_USART Usart0Peripheral; - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void testReadyToTransmitShouldReturnStatusPerTransmitBufferReadyStatus(void) -{ - AT91C_BASE_US0->US_CSR = 0; - TEST_ASSERT(!Usart_ReadyToTransmit()); - - AT91C_BASE_US0->US_CSR = AT91C_US_TXRDY; - TEST_ASSERT(Usart_ReadyToTransmit()); -} diff --git a/components/testframework/libs/cmock/lib/cmock.rb b/components/testframework/libs/cmock/lib/cmock.rb deleted file mode 100644 index b4dbab57d..000000000 --- a/components/testframework/libs/cmock/lib/cmock.rb +++ /dev/null @@ -1,104 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -['../config/production_environment', - 'cmock_header_parser', - 'cmock_generator', - 'cmock_file_writer', - 'cmock_config', - 'cmock_plugin_manager', - 'cmock_generator_utils', - 'cmock_unityhelper_parser'].each { |req| require "#{__dir__}/#{req}" } - -class CMock - def initialize(options = nil) - cm_config = CMockConfig.new(options) - cm_unityhelper = CMockUnityHelperParser.new(cm_config) - cm_writer = CMockFileWriter.new(cm_config) - cm_gen_utils = CMockGeneratorUtils.new(cm_config, :unity_helper => cm_unityhelper) - cm_gen_plugins = CMockPluginManager.new(cm_config, cm_gen_utils) - @cm_parser = CMockHeaderParser.new(cm_config) - @cm_generator = CMockGenerator.new(cm_config, cm_writer, cm_gen_utils, cm_gen_plugins) - @silent = (cm_config.verbosity < 2) - end - - def setup_mocks(files) - [files].flatten.each do |src| - generate_mock src - end - end - - def setup_skeletons(files) - [files].flatten.each do |src| - generate_skeleton src - end - end - - private ############################### - - def generate_mock(src) - name = File.basename(src, '.*') - ext = File.extname(src) - puts "Creating mock for #{name}..." unless @silent - @cm_generator.create_mock(name, @cm_parser.parse(name, File.read(src)), ext) - end - - def generate_skeleton(src) - name = File.basename(src, '.*') - puts "Creating skeleton for #{name}..." unless @silent - @cm_generator.create_skeleton(name, @cm_parser.parse(name, File.read(src))) - end -end - -def option_maker(options, key, val) - options ||= {} - options[key.to_sym] = - if val.chr == ':' - val[1..-1].to_sym - elsif val.include? ';' - val.split(';') - elsif val == 'true' - true - elsif val == 'false' - false - elsif val =~ /^\d+$/ - val.to_i - else - val - end - options -end - -# Command Line Support ############################### - -if $0 == __FILE__ - usage = "usage: ruby #{__FILE__} (-oOptionsFile) File(s)ToMock" - - unless ARGV[0] - puts usage - exit 1 - end - - options = {} - filelist = [] - ARGV.each do |arg| - if arg =~ /^-o\"?([a-zA-Z0-9._\\\/:\s]+)\"?/ - options.merge! CMockConfig.load_config_file_from_yaml(arg.gsub(/^-o/, '')) - elsif arg == '--skeleton' - options[:skeleton] = true - elsif arg =~ /^--([a-zA-Z0-9._\\\/:\s]+)=\"?([a-zA-Z0-9._\-\\\/:\s\;]+)\"?/ - options = option_maker(options, Regexp.last_match(1), Regexp.last_match(2)) - else - filelist << arg - end - end - - if options[:skeleton] - CMock.new(options).setup_skeletons(filelist) - else - CMock.new(options).setup_mocks(filelist) - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_config.rb b/components/testframework/libs/cmock/lib/cmock_config.rb deleted file mode 100644 index 8d4b5c6e1..000000000 --- a/components/testframework/libs/cmock/lib/cmock_config.rb +++ /dev/null @@ -1,174 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockConfig - CMOCK_DEFAULT_OPTIONS = - { - :framework => :unity, - :mock_path => 'mocks', - :mock_prefix => 'Mock', - :mock_suffix => '', - :skeleton_path => '', - :weak => '', - :subdir => nil, - :plugins => [], - :strippables => ['(?:__attribute__\s*\(+.*?\)+)'], - :attributes => %w[__ramfunc __irq __fiq register extern], - :c_calling_conventions => %w[__stdcall __cdecl __fastcall], - :enforce_strict_ordering => false, - :fail_on_unexpected_calls => true, - :unity_helper_path => false, - :treat_as => {}, - :treat_as_array => {}, - :treat_as_void => [], - :memcmp_if_unknown => true, - :when_no_prototypes => :warn, # the options being :ignore, :warn, or :error - :when_ptr => :compare_data, # the options being :compare_ptr, :compare_data, or :smart - :verbosity => 2, # the options being 0 errors only, 1 warnings and errors, 2 normal info, 3 verbose - :treat_externs => :exclude, # the options being :include or :exclude - :treat_inlines => :exclude, # the options being :include or :exclude - :callback_include_count => true, - :callback_after_arg_check => false, - :includes => nil, - :includes_h_pre_orig_header => nil, - :includes_h_post_orig_header => nil, - :includes_c_pre_header => nil, - :includes_c_post_header => nil, - :orig_header_include_fmt => '#include "%s"', - :array_size_type => [], - :array_size_name => 'size|len', - :array_as_byte => false, - :skeleton => false, - - # Format to look for inline functions. - # This is a combination of "static" and "inline" keywords ("static inline", "inline static", "inline", "static") - # There are several possibilities: - # - sometimes they appear together, sometimes individually, - # - The keywords can appear before or after the return type (this is a compiler warning but people do weird stuff), - # so we check for word boundaries when searching for them - # - We first remove "static inline" combinations and boil down to single inline or static statements - :inline_function_patterns => ['(static\s+inline|inline\s+static)\s*', '(\bstatic\b|\binline\b)\s*'] # Last part (\s*) is just to remove whitespaces (only to prettify the output) - }.freeze - - def initialize(options = nil) - case options - when NilClass then options = CMOCK_DEFAULT_OPTIONS.dup - when String then options = CMOCK_DEFAULT_OPTIONS.dup.merge(load_config_file_from_yaml(options)) - when Hash then options = CMOCK_DEFAULT_OPTIONS.dup.merge(options) - else raise 'If you specify arguments, it should be a filename or a hash of options' - end - - # do some quick type verification - %i[plugins attributes treat_as_void].each do |opt| - unless options[opt].class == Array - options[opt] = [] - puts "WARNING: :#{opt} should be an array." unless options[:verbosity] < 1 - end - end - %i[includes includes_h_pre_orig_header includes_h_post_orig_header includes_c_pre_header includes_c_post_header].each do |opt| - unless options[opt].nil? || (options[opt].class == Array) - options[opt] = [] - puts "WARNING: :#{opt} should be an array." unless options[:verbosity] < 1 - end - end - options[:unity_helper_path] ||= options[:unity_helper] - options[:unity_helper_path] = [options[:unity_helper_path]] if options[:unity_helper_path].is_a? String - - if options[:unity_helper_path] - require 'pathname' - includes1 = options[:includes_c_post_header] || [] - includes2 = options[:unity_helper_path].map do |path| - Pathname(path).relative_path_from(Pathname(options[:mock_path])).to_s - end - options[:includes_c_post_header] = (includes1 + includes2).uniq - end - - options[:plugins].compact! - options[:plugins].map!(&:to_sym) - @options = options - - treat_as_map = standard_treat_as_map # .clone - treat_as_map.merge!(@options[:treat_as]) - @options[:treat_as] = treat_as_map - - @options.each_key do |key| - unless methods.include?(key) - eval("def #{key}() return @options[:#{key}] end") - end - end - end - - def load_config_file_from_yaml(yaml_filename) - self.class.load_config_file_from_yaml yaml_filename - end - - def self.load_config_file_from_yaml(yaml_filename) - require 'yaml' - require 'fileutils' - YAML.load_file(yaml_filename)[:cmock] - end - - def path(new_path) - @src_path = new_path - end - - def load_unity_helper - return nil unless @options[:unity_helper_path] - - @options[:unity_helper_path].inject('') do |unity_helper, filename| - unity_helper + "\n" + File.new(filename).read - end - end - - def standard_treat_as_map - { - 'int' => 'INT', - 'char' => 'INT8', - 'short' => 'INT16', - 'long' => 'INT', - 'int8' => 'INT8', - 'int16' => 'INT16', - 'int32' => 'INT', - 'int8_t' => 'INT8', - 'int16_t' => 'INT16', - 'int32_t' => 'INT', - 'INT8_T' => 'INT8', - 'INT16_T' => 'INT16', - 'INT32_T' => 'INT', - 'bool' => 'INT', - 'bool_t' => 'INT', - 'BOOL' => 'INT', - 'BOOL_T' => 'INT', - 'unsigned int' => 'HEX32', - 'unsigned long' => 'HEX32', - 'uint32' => 'HEX32', - 'uint32_t' => 'HEX32', - 'UINT32' => 'HEX32', - 'UINT32_T' => 'HEX32', - 'void*' => 'HEX8_ARRAY', - 'void const*' => 'HEX8_ARRAY', - 'const void*' => 'HEX8_ARRAY', - 'unsigned short' => 'HEX16', - 'uint16' => 'HEX16', - 'uint16_t' => 'HEX16', - 'UINT16' => 'HEX16', - 'UINT16_T' => 'HEX16', - 'unsigned char' => 'HEX8', - 'uint8' => 'HEX8', - 'uint8_t' => 'HEX8', - 'UINT8' => 'HEX8', - 'UINT8_T' => 'HEX8', - 'char*' => 'STRING', - 'char const*' => 'STRING', - 'const char*' => 'STRING', - 'pCHAR' => 'STRING', - 'cstring' => 'STRING', - 'CSTRING' => 'STRING', - 'float' => 'FLOAT', - 'double' => 'FLOAT' - } - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_file_writer.rb b/components/testframework/libs/cmock/lib/cmock_file_writer.rb deleted file mode 100644 index 787d688e1..000000000 --- a/components/testframework/libs/cmock/lib/cmock_file_writer.rb +++ /dev/null @@ -1,48 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockFileWriter - attr_reader :config - - def initialize(config) - @config = config - end - - def create_subdir(subdir) - require 'fileutils' - FileUtils.mkdir_p "#{@config.mock_path}/" unless Dir.exist?("#{@config.mock_path}/") - FileUtils.mkdir_p "#{@config.mock_path}/#{subdir + '/' if subdir}" if subdir && !Dir.exist?("#{@config.mock_path}/#{subdir + '/' if subdir}") - end - - def create_file(filename, subdir) - raise "Where's the block of data to create?" unless block_given? - - full_file_name_temp = "#{@config.mock_path}/#{subdir + '/' if subdir}#{filename}.new" - full_file_name_done = "#{@config.mock_path}/#{subdir + '/' if subdir}#{filename}" - File.open(full_file_name_temp, 'w') do |file| - yield(file, filename) - end - update_file(full_file_name_done, full_file_name_temp) - end - - def append_file(filename, subdir) - raise "Where's the block of data to create?" unless block_given? - - full_file_name = "#{@config.skeleton_path}/#{subdir + '/' if subdir}#{filename}" - File.open(full_file_name, 'a') do |file| - yield(file, filename) - end - end - - private ################################### - - def update_file(dest, src) - require 'fileutils' - FileUtils.rm(dest) if File.exist?(dest) - FileUtils.cp(src, dest) - FileUtils.rm(src) - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_generator.rb b/components/testframework/libs/cmock/lib/cmock_generator.rb deleted file mode 100644 index f08cadd77..000000000 --- a/components/testframework/libs/cmock/lib/cmock_generator.rb +++ /dev/null @@ -1,333 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockGenerator - attr_accessor :config, :file_writer, :module_name, :module_ext, :clean_mock_name, :mock_name, :utils, :plugins, :weak, :ordered - - def initialize(config, file_writer, utils, plugins) - @file_writer = file_writer - @utils = utils - @plugins = plugins - @config = config - @prefix = @config.mock_prefix - @suffix = @config.mock_suffix - @weak = @config.weak - @include_inline = @config.treat_inlines - @ordered = @config.enforce_strict_ordering - @framework = @config.framework.to_s - @fail_on_unexpected_calls = @config.fail_on_unexpected_calls - - @subdir = @config.subdir - - @includes_h_pre_orig_header = (@config.includes || @config.includes_h_pre_orig_header || []).map { |h| h =~ / 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n" - file << "#pragma GCC diagnostic push\n" - file << "#endif\n" - file << "#if !defined(__clang__)\n" - file << "#pragma GCC diagnostic ignored \"-Wpragmas\"\n" - file << "#endif\n" - file << "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n" - file << "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n" - file << "#endif\n" - file << "\n" - end - - def create_typedefs(file, typedefs) - file << "\n" - typedefs.each { |typedef| file << "#{typedef}\n" } - file << "\n\n" - end - - def create_mock_header_service_call_declarations(file) - file << "void #{@clean_mock_name}_Init(void);\n" - file << "void #{@clean_mock_name}_Destroy(void);\n" - file << "void #{@clean_mock_name}_Verify(void);\n\n" - end - - def create_mock_header_footer(header) - header << "\n" - header << "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n" - header << "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n" - header << "#pragma GCC diagnostic pop\n" - header << "#endif\n" - header << "#endif\n" - header << "\n" - header << "#endif\n" - end - - def create_source_header_section(file, filename, functions) - header_file = (@subdir ? @subdir + '/' : '') + filename.gsub('.c', (@module_ext || '.h')) - file << "/* AUTOGENERATED FILE. DO NOT EDIT. */\n" unless functions.empty? - file << "#include \n" - file << "#include \n" - file << "#include \n" - file << "#include \"cmock.h\"\n" - @includes_c_pre_header.each { |inc| file << "#include #{inc}\n" } - file << "#include \"#{header_file}\"\n" - @includes_c_post_header.each { |inc| file << "#include #{inc}\n" } - file << "\n" - strs = [] - functions.each do |func| - strs << func[:name] - func[:args].each { |arg| strs << arg[:name] } - end - strs.uniq.sort.each do |str| - file << "static const char* CMockString_#{str} = \"#{str}\";\n" - end - file << "\n" - end - - def create_instance_structure(file, functions) - functions.each do |function| - file << "typedef struct _CMOCK_#{function[:name]}_CALL_INSTANCE\n{\n" - file << " UNITY_LINE_TYPE LineNumber;\n" - file << @plugins.run(:instance_typedefs, function) - file << "\n} CMOCK_#{function[:name]}_CALL_INSTANCE;\n\n" - end - file << "static struct #{@clean_mock_name}Instance\n{\n" - if functions.empty? - file << " unsigned char placeHolder;\n" - end - functions.each do |function| - file << @plugins.run(:instance_structure, function) - file << " CMOCK_MEM_INDEX_TYPE #{function[:name]}_CallInstance;\n" - end - file << "} Mock;\n\n" - end - - def create_extern_declarations(file) - file << "extern jmp_buf AbortFrame;\n" - if @ordered - file << "extern int GlobalExpectCount;\n" - file << "extern int GlobalVerifyOrder;\n" - end - file << "\n" - end - - def create_mock_verify_function(file, functions) - file << "void #{@clean_mock_name}_Verify(void)\n{\n" - verifications = functions.collect do |function| - v = @plugins.run(:mock_verify, function) - v.empty? ? v : [" call_instance = Mock.#{function[:name]}_CallInstance;\n", v] - end.join - unless verifications.empty? - file << " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n" - file << " CMOCK_MEM_INDEX_TYPE call_instance;\n" - file << verifications - end - file << "}\n\n" - end - - def create_mock_init_function(file) - file << "void #{@clean_mock_name}_Init(void)\n{\n" - file << " #{@clean_mock_name}_Destroy();\n" - file << "}\n\n" - end - - def create_mock_destroy_function(file, functions) - file << "void #{@clean_mock_name}_Destroy(void)\n{\n" - file << " CMock_Guts_MemFreeAll();\n" - file << " memset(&Mock, 0, sizeof(Mock));\n" - file << functions.collect { |function| @plugins.run(:mock_destroy, function) }.join - - unless @fail_on_unexpected_calls - file << functions.collect { |function| @plugins.run(:mock_ignore, function) }.join - end - - if @ordered - file << " GlobalExpectCount = 0;\n" - file << " GlobalVerifyOrder = 0;\n" - end - file << "}\n\n" - end - - def create_mock_implementation(file, function) - # prepare return value and arguments - function_mod_and_rettype = (function[:modifier].empty? ? '' : "#{function[:modifier]} ") + - (function[:return][:type]) + - (function[:c_calling_convention] ? " #{function[:c_calling_convention]}" : '') - args_string = function[:args_string] - args_string += (', ' + function[:var_arg]) unless function[:var_arg].nil? - - # Encapsulate in namespace(s) if applicable - function[:namespace].each do |ns| - file << "namespace #{ns} {\n" - end - - # Determine class prefix (if any) - cls_pre = '' - unless function[:class].nil? - cls_pre = "#{function[:class]}::" - end - - # Create mock function - unless @weak.empty? - file << "#if defined (__IAR_SYSTEMS_ICC__)\n" - file << "#pragma weak #{function[:unscoped_name]}\n" - file << "#else\n" - file << "#{function_mod_and_rettype} #{function[:unscoped_name]}(#{args_string}) #{weak};\n" - file << "#endif\n\n" - end - file << "#{function_mod_and_rettype} #{cls_pre}#{function[:unscoped_name]}(#{args_string})\n" - file << "{\n" - file << " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n" - file << " CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance;\n" - file << " UNITY_SET_DETAIL(CMockString_#{function[:name]});\n" - file << " cmock_call_instance = (CMOCK_#{function[:name]}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.#{function[:name]}_CallInstance);\n" - file << " Mock.#{function[:name]}_CallInstance = CMock_Guts_MemNext(Mock.#{function[:name]}_CallInstance);\n" - file << @plugins.run(:mock_implementation_precheck, function) - file << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n" - file << " cmock_line = cmock_call_instance->LineNumber;\n" - if @ordered - file << " if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)\n" - file << " UNITY_TEST_FAIL(cmock_line, CMockStringCalledEarly);\n" - file << " if (cmock_call_instance->CallOrder < GlobalVerifyOrder)\n" - file << " UNITY_TEST_FAIL(cmock_line, CMockStringCalledLate);\n" - end - file << @plugins.run(:mock_implementation, function) - file << " UNITY_CLR_DETAILS();\n" - file << " return cmock_call_instance->ReturnVal;\n" unless function[:return][:void?] - file << "}\n" - - # Close any namespace(s) opened above - function[:namespace].each do - file << "}\n" - end - - file << "\n" - end - - def create_mock_interfaces(file, function) - file << @utils.code_add_argument_loader(function) - file << @plugins.run(:mock_interfaces, function) - end - - def create_function_skeleton(file, function, existing) - # prepare return value and arguments - function_mod_and_rettype = (function[:modifier].empty? ? '' : "#{function[:modifier]} ") + - (function[:return][:type]) + - (function[:c_calling_convention] ? " #{function[:c_calling_convention]}" : '') - args_string = function[:args_string] - args_string += (', ' + function[:var_arg]) unless function[:var_arg].nil? - - decl = "#{function_mod_and_rettype} #{function[:name]}(#{args_string})" - - return if existing.include?(decl) - - file << "#{decl}\n" - file << "{\n" - file << " /*TODO: Implement Me!*/\n" - function[:args].each { |arg| file << " (void)#{arg[:name]};\n" } - file << " return (#{(function[:return][:type])})0;\n" unless function[:return][:void?] - file << "}\n\n" - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_array.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_array.rb deleted file mode 100644 index a9864ab74..000000000 --- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_array.rb +++ /dev/null @@ -1,63 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockGeneratorPluginArray - attr_reader :priority - attr_accessor :config, :utils, :unity_helper, :ordered - def initialize(config, utils) - @config = config - @ptr_handling = @config.when_ptr - @ordered = @config.enforce_strict_ordering - @utils = utils - @unity_helper = @utils.helpers[:unity_helper] - @priority = 8 - end - - def instance_typedefs(function) - function[:args].inject('') do |all, arg| - arg[:ptr?] ? all + " int Expected_#{arg[:name]}_Depth;\n" : all - end - end - - def mock_function_declarations(function) - return nil unless function[:contains_ptr?] - - args_call = function[:args].map { |m| m[:ptr?] ? "#{m[:name]}, #{m[:name]}_Depth" : (m[:name]).to_s }.join(', ') - args_string = function[:args].map do |m| - type = @utils.arg_type_with_const(m) - m[:ptr?] ? "#{type} #{m[:name]}, int #{m[:name]}_Depth" : "#{type} #{m[:name]}" - end.join(', ') - if function[:return][:void?] - return "#define #{function[:name]}_ExpectWithArray(#{args_call}) #{function[:name]}_CMockExpectWithArray(__LINE__, #{args_call})\n" \ - "void #{function[:name]}_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, #{args_string});\n" - else - return "#define #{function[:name]}_ExpectWithArrayAndReturn(#{args_call}, cmock_retval) #{function[:name]}_CMockExpectWithArrayAndReturn(__LINE__, #{args_call}, cmock_retval)\n" \ - "void #{function[:name]}_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, #{args_string}, #{function[:return][:str]});\n" - end - end - - def mock_interfaces(function) - return nil unless function[:contains_ptr?] - - lines = [] - func_name = function[:name] - args_string = function[:args].map do |m| - type = @utils.arg_type_with_const(m) - m[:ptr?] ? "#{type} #{m[:name]}, int #{m[:name]}_Depth" : "#{type} #{m[:name]}" - end.join(', ') - call_string = function[:args].map { |m| m[:ptr?] ? "#{m[:name]}, #{m[:name]}_Depth" : m[:name] }.join(', ') - lines << if function[:return][:void?] - "void #{func_name}_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, #{args_string})\n" - else - "void #{func_name}_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, #{args_string}, #{function[:return][:str]})\n" - end - lines << "{\n" - lines << @utils.code_add_base_expectation(func_name) - lines << " CMockExpectParameters_#{func_name}(cmock_call_instance, #{call_string});\n" - lines << " cmock_call_instance->ReturnVal = cmock_to_return;\n" unless function[:return][:void?] - lines << "}\n\n" - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_callback.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_callback.rb deleted file mode 100644 index 6ba8e9bd9..000000000 --- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_callback.rb +++ /dev/null @@ -1,88 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockGeneratorPluginCallback - attr_accessor :include_count - attr_reader :priority - attr_reader :config, :utils - - def initialize(config, utils) - @config = config - @utils = utils - @priority = 6 - - @include_count = @config.callback_include_count - end - - def instance_structure(function) - func_name = function[:name] - " char #{func_name}_CallbackBool;\n" \ - " CMOCK_#{func_name}_CALLBACK #{func_name}_CallbackFunctionPointer;\n" \ - " int #{func_name}_CallbackCalls;\n" - end - - def mock_function_declarations(function) - func_name = function[:name] - return_type = function[:return][:type] - action = @config.callback_after_arg_check ? 'AddCallback' : 'Stub' - style = (@include_count ? 1 : 0) | (function[:args].empty? ? 0 : 2) - styles = ['void', 'int cmock_num_calls', function[:args_string], "#{function[:args_string]}, int cmock_num_calls"] - "typedef #{return_type} (* CMOCK_#{func_name}_CALLBACK)(#{styles[style]});\n" \ - "void #{func_name}_AddCallback(CMOCK_#{func_name}_CALLBACK Callback);\n" \ - "void #{func_name}_Stub(CMOCK_#{func_name}_CALLBACK Callback);\n" \ - "#define #{func_name}_StubWithCallback #{func_name}_#{action}\n" - end - - def generate_call(function) - args = function[:args].map { |m| m[:name] } - args << "Mock.#{function[:name]}_CallbackCalls++" if @include_count - "Mock.#{function[:name]}_CallbackFunctionPointer(#{args.join(', ')})" - end - - def mock_implementation(function) - " if (Mock.#{function[:name]}_CallbackFunctionPointer != NULL)\n {\n" + - if function[:return][:void?] - " #{generate_call(function)};\n }\n" - else - " cmock_call_instance->ReturnVal = #{generate_call(function)};\n }\n" - end - end - - def mock_implementation_precheck(function) - " if (!Mock.#{function[:name]}_CallbackBool &&\n" \ - " Mock.#{function[:name]}_CallbackFunctionPointer != NULL)\n {\n" + - if function[:return][:void?] - " #{generate_call(function)};\n" \ - " UNITY_CLR_DETAILS();\n" \ - " return;\n }\n" - else - " #{function[:return][:type]} cmock_cb_ret = #{generate_call(function)};\n" \ - " UNITY_CLR_DETAILS();\n" \ - " return cmock_cb_ret;\n }\n" - end - end - - def mock_interfaces(function) - func_name = function[:name] - has_ignore = @config.plugins.include? :ignore - lines = '' - lines << "void #{func_name}_AddCallback(CMOCK_#{func_name}_CALLBACK Callback)\n{\n" - lines << " Mock.#{func_name}_IgnoreBool = (char)0;\n" if has_ignore - lines << " Mock.#{func_name}_CallbackBool = (char)1;\n" - lines << " Mock.#{func_name}_CallbackFunctionPointer = Callback;\n}\n\n" - lines << "void #{func_name}_Stub(CMOCK_#{func_name}_CALLBACK Callback)\n{\n" - lines << " Mock.#{func_name}_IgnoreBool = (char)0;\n" if has_ignore - lines << " Mock.#{func_name}_CallbackBool = (char)0;\n" - lines << " Mock.#{func_name}_CallbackFunctionPointer = Callback;\n}\n\n" - end - - def mock_verify(function) - func_name = function[:name] - " if (Mock.#{func_name}_CallbackFunctionPointer != NULL)\n {\n" \ - " call_instance = CMOCK_GUTS_NONE;\n" \ - " (void)call_instance;\n }\n" - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_cexception.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_cexception.rb deleted file mode 100644 index a757669e6..000000000 --- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_cexception.rb +++ /dev/null @@ -1,49 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockGeneratorPluginCexception - attr_reader :priority - attr_reader :config, :utils - - def initialize(config, utils) - @config = config - @utils = utils - @priority = 7 - end - - def include_files - "#include \"CException.h\"\n" - end - - def instance_typedefs(_function) - " CEXCEPTION_T ExceptionToThrow;\n" - end - - def mock_function_declarations(function) - if function[:args_string] == 'void' - "#define #{function[:name]}_ExpectAndThrow(cmock_to_throw) #{function[:name]}_CMockExpectAndThrow(__LINE__, cmock_to_throw)\n" \ - "void #{function[:name]}_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, CEXCEPTION_T cmock_to_throw);\n" - else - "#define #{function[:name]}_ExpectAndThrow(#{function[:args_call]}, cmock_to_throw) #{function[:name]}_CMockExpectAndThrow(__LINE__, #{function[:args_call]}, cmock_to_throw)\n" \ - "void #{function[:name]}_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, #{function[:args_string]}, CEXCEPTION_T cmock_to_throw);\n" - end - end - - def mock_implementation(_function) - " if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)\n {\n" \ - " UNITY_CLR_DETAILS();\n" \ - " Throw(cmock_call_instance->ExceptionToThrow);\n }\n" - end - - def mock_interfaces(function) - arg_insert = function[:args_string] == 'void' ? '' : "#{function[:args_string]}, " - ["void #{function[:name]}_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, #{arg_insert}CEXCEPTION_T cmock_to_throw)\n{\n", - @utils.code_add_base_expectation(function[:name]), - @utils.code_call_argument_loader(function), - " cmock_call_instance->ExceptionToThrow = cmock_to_throw;\n", - "}\n\n"].join - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect.rb deleted file mode 100644 index 3a79c1a4d..000000000 --- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect.rb +++ /dev/null @@ -1,100 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockGeneratorPluginExpect - attr_reader :priority - attr_accessor :config, :utils, :unity_helper, :ordered - - def initialize(config, utils) - @config = config - @ptr_handling = @config.when_ptr - @ordered = @config.enforce_strict_ordering - @utils = utils - @unity_helper = @utils.helpers[:unity_helper] - @priority = 5 - - if @config.plugins.include? :expect_any_args - alias :mock_implementation :mock_implementation_might_check_args - else - alias :mock_implementation :mock_implementation_always_check_args - end - end - - def instance_typedefs(function) - lines = '' - lines << " #{function[:return][:type]} ReturnVal;\n" unless function[:return][:void?] - lines << " int CallOrder;\n" if @ordered - function[:args].each do |arg| - lines << " #{arg[:type]} Expected_#{arg[:name]};\n" - end - lines - end - - def mock_function_declarations(function) - if function[:args].empty? - if function[:return][:void?] - "#define #{function[:name]}_Expect() #{function[:name]}_CMockExpect(__LINE__)\n" \ - "void #{function[:name]}_CMockExpect(UNITY_LINE_TYPE cmock_line);\n" - else - "#define #{function[:name]}_ExpectAndReturn(cmock_retval) #{function[:name]}_CMockExpectAndReturn(__LINE__, cmock_retval)\n" \ - "void #{function[:name]}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]});\n" - end - elsif function[:return][:void?] - "#define #{function[:name]}_Expect(#{function[:args_call]}) #{function[:name]}_CMockExpect(__LINE__, #{function[:args_call]})\n" \ - "void #{function[:name]}_CMockExpect(UNITY_LINE_TYPE cmock_line, #{function[:args_string]});\n" - else - "#define #{function[:name]}_ExpectAndReturn(#{function[:args_call]}, cmock_retval) #{function[:name]}_CMockExpectAndReturn(__LINE__, #{function[:args_call]}, cmock_retval)\n" \ - "void #{function[:name]}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:args_string]}, #{function[:return][:str]});\n" - end - end - - def mock_implementation_always_check_args(function) - lines = '' - function[:args].each do |arg| - lines << @utils.code_verify_an_arg_expectation(function, arg) - end - lines - end - - def mock_implementation_might_check_args(function) - return '' if function[:args].empty? - - lines = " if (!cmock_call_instance->ExpectAnyArgsBool)\n {\n" - function[:args].each do |arg| - lines << @utils.code_verify_an_arg_expectation(function, arg) - end - lines << " }\n" - lines - end - - def mock_interfaces(function) - lines = '' - func_name = function[:name] - lines << if function[:return][:void?] - if function[:args_string] == 'void' - "void #{func_name}_CMockExpect(UNITY_LINE_TYPE cmock_line)\n{\n" - else - "void #{func_name}_CMockExpect(UNITY_LINE_TYPE cmock_line, #{function[:args_string]})\n{\n" - end - elsif function[:args_string] == 'void' - "void #{func_name}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]})\n{\n" - else - "void #{func_name}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:args_string]}, #{function[:return][:str]})\n{\n" - end - lines << @utils.code_add_base_expectation(func_name) - lines << @utils.code_call_argument_loader(function) - lines << @utils.code_assign_argument_quickly('cmock_call_instance->ReturnVal', function[:return]) unless function[:return][:void?] - lines << "}\n\n" - end - - def mock_verify(function) - " if (CMOCK_GUTS_NONE != call_instance)\n" \ - " {\n" \ - " UNITY_SET_DETAIL(CMockString_#{function[:name]});\n" \ - " UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess);\n" \ - " }\n" - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect_any_args.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect_any_args.rb deleted file mode 100644 index 0fc88e124..000000000 --- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect_any_args.rb +++ /dev/null @@ -1,50 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockGeneratorPluginExpectAnyArgs - attr_reader :priority - attr_reader :config, :utils - - def initialize(config, utils) - @config = config - @utils = utils - @priority = 3 - end - - def instance_typedefs(_function) - " char ExpectAnyArgsBool;\n" - end - - def mock_function_declarations(function) - if function[:args].empty? - '' - elsif function[:return][:void?] - "#define #{function[:name]}_ExpectAnyArgs() #{function[:name]}_CMockExpectAnyArgs(__LINE__)\n" \ - "void #{function[:name]}_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line);\n" - else - "#define #{function[:name]}_ExpectAnyArgsAndReturn(cmock_retval) #{function[:name]}_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval)\n" \ - "void #{function[:name]}_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]});\n" - end - end - - def mock_interfaces(function) - lines = '' - unless function[:args].empty? - lines << if function[:return][:void?] - "void #{function[:name]}_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line)\n{\n" - else - "void #{function[:name]}_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]})\n{\n" - end - lines << @utils.code_add_base_expectation(function[:name], true) - unless function[:return][:void?] - lines << " cmock_call_instance->ReturnVal = cmock_to_return;\n" - end - lines << " cmock_call_instance->ExpectAnyArgsBool = (char)1;\n" - lines << "}\n\n" - end - lines - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore.rb deleted file mode 100644 index b292f3d4f..000000000 --- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore.rb +++ /dev/null @@ -1,88 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockGeneratorPluginIgnore - attr_reader :priority - attr_reader :config, :utils - - def initialize(config, utils) - @config = config - @utils = utils - @priority = 2 - end - - def instance_structure(function) - if function[:return][:void?] - " char #{function[:name]}_IgnoreBool;\n" - else - " char #{function[:name]}_IgnoreBool;\n #{function[:return][:type]} #{function[:name]}_FinalReturn;\n" - end - end - - def mock_function_declarations(function) - lines = if function[:return][:void?] - "#define #{function[:name]}_Ignore() #{function[:name]}_CMockIgnore()\n" \ - "void #{function[:name]}_CMockIgnore(void);\n" - else - "#define #{function[:name]}_IgnoreAndReturn(cmock_retval) #{function[:name]}_CMockIgnoreAndReturn(__LINE__, cmock_retval)\n" \ - "void #{function[:name]}_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]});\n" - end - - # Add stop ignore function. it does not matter if there are any args - lines << "#define #{function[:name]}_StopIgnore() #{function[:name]}_CMockStopIgnore()\n" \ - "void #{function[:name]}_CMockStopIgnore(void);\n" - lines - end - - def mock_implementation_precheck(function) - lines = " if (Mock.#{function[:name]}_IgnoreBool)\n {\n" - lines << " UNITY_CLR_DETAILS();\n" - if function[:return][:void?] - lines << " return;\n }\n" - else - retval = function[:return].merge(:name => 'cmock_call_instance->ReturnVal') - lines << " if (cmock_call_instance == NULL)\n return Mock.#{function[:name]}_FinalReturn;\n" - lines << ' ' + @utils.code_assign_argument_quickly("Mock.#{function[:name]}_FinalReturn", retval) unless retval[:void?] - lines << " return cmock_call_instance->ReturnVal;\n }\n" - end - lines - end - - def mock_interfaces(function) - lines = '' - lines << if function[:return][:void?] - "void #{function[:name]}_CMockIgnore(void)\n{\n" - else - "void #{function[:name]}_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]})\n{\n" - end - unless function[:return][:void?] - lines << @utils.code_add_base_expectation(function[:name], false) - end - unless function[:return][:void?] - lines << " cmock_call_instance->ReturnVal = cmock_to_return;\n" - end - lines << " Mock.#{function[:name]}_IgnoreBool = (char)1;\n" - lines << "}\n\n" - - # Add stop ignore function. it does not matter if there are any args - lines << "void #{function[:name]}_CMockStopIgnore(void)\n{\n" - unless function[:return][:void?] - lines << " if(Mock.#{function[:name]}_IgnoreBool)\n" - lines << " Mock.#{function[:name]}_CallInstance = CMock_Guts_MemNext(Mock.#{function[:name]}_CallInstance);\n" - end - lines << " Mock.#{function[:name]}_IgnoreBool = (char)0;\n" - lines << "}\n\n" - end - - def mock_ignore(function) - " Mock.#{function[:name]}_IgnoreBool = (char) 1;\n" - end - - def mock_verify(function) - func_name = function[:name] - " if (Mock.#{func_name}_IgnoreBool)\n call_instance = CMOCK_GUTS_NONE;\n" - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore_arg.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore_arg.rb deleted file mode 100644 index d55e84c25..000000000 --- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore_arg.rb +++ /dev/null @@ -1,42 +0,0 @@ -class CMockGeneratorPluginIgnoreArg - attr_reader :priority - attr_accessor :utils - - def initialize(_config, utils) - @utils = utils - @priority = 10 - end - - def instance_typedefs(function) - lines = '' - function[:args].each do |arg| - lines << " char IgnoreArg_#{arg[:name]};\n" - end - lines - end - - def mock_function_declarations(function) - lines = '' - function[:args].each do |arg| - lines << "#define #{function[:name]}_IgnoreArg_#{arg[:name]}()" - lines << " #{function[:name]}_CMockIgnoreArg_#{arg[:name]}(__LINE__)\n" - lines << "void #{function[:name]}_CMockIgnoreArg_#{arg[:name]}(UNITY_LINE_TYPE cmock_line);\n" - end - lines - end - - def mock_interfaces(function) - lines = [] - func_name = function[:name] - function[:args].each do |arg| - lines << "void #{func_name}_CMockIgnoreArg_#{arg[:name]}(UNITY_LINE_TYPE cmock_line)\n" - lines << "{\n" - lines << " CMOCK_#{func_name}_CALL_INSTANCE* cmock_call_instance = " \ - "(CMOCK_#{func_name}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.#{func_name}_CallInstance));\n" - lines << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp);\n" - lines << " cmock_call_instance->IgnoreArg_#{arg[:name]} = 1;\n" - lines << "}\n\n" - end - lines - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb deleted file mode 100644 index 932155936..000000000 --- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +++ /dev/null @@ -1,79 +0,0 @@ -class CMockGeneratorPluginReturnThruPtr - attr_reader :priority - attr_accessor :utils - - def initialize(_config, utils) - @utils = utils - @priority = 9 - end - - def instance_typedefs(function) - lines = '' - function[:args].each do |arg| - next unless @utils.ptr_or_str?(arg[:type]) && !(arg[:const?]) - - lines << " char ReturnThruPtr_#{arg[:name]}_Used;\n" - lines << " #{arg[:type]} ReturnThruPtr_#{arg[:name]}_Val;\n" - lines << " int ReturnThruPtr_#{arg[:name]}_Size;\n" - end - lines - end - - def mock_function_declarations(function) - lines = '' - function[:args].each do |arg| - next unless @utils.ptr_or_str?(arg[:type]) && !(arg[:const?]) - - lines << "#define #{function[:name]}_ReturnThruPtr_#{arg[:name]}(#{arg[:name]})" - # If the pointer type actually contains an asterisk, we can do sizeof the type (super safe), otherwise - # we need to do a sizeof the dereferenced pointer (which could be a problem if give the wrong size - lines << if arg[:type][-1] == '*' - " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, sizeof(#{arg[:type][0..-2]}))\n" - else - " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, sizeof(*#{arg[:name]}))\n" - end - lines << "#define #{function[:name]}_ReturnArrayThruPtr_#{arg[:name]}(#{arg[:name]}, cmock_len)" - lines << " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, (int)(cmock_len * (int)sizeof(*#{arg[:name]})))\n" - lines << "#define #{function[:name]}_ReturnMemThruPtr_#{arg[:name]}(#{arg[:name]}, cmock_size)" - lines << " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, cmock_size)\n" - lines << "void #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(UNITY_LINE_TYPE cmock_line, #{arg[:type]} #{arg[:name]}, int cmock_size);\n" - end - lines - end - - def mock_interfaces(function) - lines = [] - func_name = function[:name] - function[:args].each do |arg| - arg_name = arg[:name] - next unless @utils.ptr_or_str?(arg[:type]) && !(arg[:const?]) - - lines << "void #{func_name}_CMockReturnMemThruPtr_#{arg_name}(UNITY_LINE_TYPE cmock_line, #{arg[:type]} #{arg_name}, int cmock_size)\n" - lines << "{\n" - lines << " CMOCK_#{func_name}_CALL_INSTANCE* cmock_call_instance = " \ - "(CMOCK_#{func_name}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.#{func_name}_CallInstance));\n" - lines << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp);\n" - lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Used = 1;\n" - lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Val = #{arg_name};\n" - lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Size = cmock_size;\n" - lines << "}\n\n" - end - lines - end - - def mock_implementation(function) - lines = [] - function[:args].each do |arg| - arg_name = arg[:name] - next unless @utils.ptr_or_str?(arg[:type]) && !(arg[:const?]) - - lines << " if (cmock_call_instance->ReturnThruPtr_#{arg_name}_Used)\n" - lines << " {\n" - lines << " UNITY_TEST_ASSERT_NOT_NULL(#{arg_name}, cmock_line, CMockStringPtrIsNULL);\n" - lines << " memcpy((void*)#{arg_name}, (void*)cmock_call_instance->ReturnThruPtr_#{arg_name}_Val,\n" - lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Size);\n" - lines << " }\n" - end - lines - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_generator_utils.rb b/components/testframework/libs/cmock/lib/cmock_generator_utils.rb deleted file mode 100644 index 695fcd59c..000000000 --- a/components/testframework/libs/cmock/lib/cmock_generator_utils.rb +++ /dev/null @@ -1,252 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockGeneratorUtils - attr_accessor :config, :helpers, :ordered, :ptr_handling, :arrays, :cexception - - def initialize(config, helpers = {}) - @config = config - @ptr_handling = @config.when_ptr - @ordered = @config.enforce_strict_ordering - @arrays = @config.plugins.include? :array - @cexception = @config.plugins.include? :cexception - @expect_any = @config.plugins.include? :expect_any_args - @return_thru_ptr = @config.plugins.include? :return_thru_ptr - @ignore_arg = @config.plugins.include? :ignore_arg - @ignore = @config.plugins.include? :ignore - @treat_as = @config.treat_as - @helpers = helpers - @array_as_byte = @config.array_as_byte - end - - def self.arg_type_with_const(arg) - # Restore any "const" that was removed in header parsing - if arg[:type].include?('*') - arg[:const_ptr?] ? "#{arg[:type]} const" : arg[:type] - else - arg[:const?] ? "const #{arg[:type]}" : arg[:type] - end - end - - def arg_type_with_const(arg) - self.class.arg_type_with_const(arg) - end - - def code_verify_an_arg_expectation(function, arg) - if @arrays - case @ptr_handling - when :smart then code_verify_an_arg_expectation_with_smart_arrays(function, arg) - when :compare_data then code_verify_an_arg_expectation_with_normal_arrays(function, arg) - when :compare_ptr then raise "ERROR: the array plugin doesn't enjoy working with :compare_ptr only. Disable one option." - end - else - code_verify_an_arg_expectation_with_no_arrays(function, arg) - end - end - - def code_add_base_expectation(func_name, global_ordering_supported = true) - lines = " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_#{func_name}_CALL_INSTANCE));\n" - lines << " CMOCK_#{func_name}_CALL_INSTANCE* cmock_call_instance = (CMOCK_#{func_name}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n" - lines << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);\n" - lines << " memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));\n" - lines << " Mock.#{func_name}_CallInstance = CMock_Guts_MemChain(Mock.#{func_name}_CallInstance, cmock_guts_index);\n" - lines << " Mock.#{func_name}_IgnoreBool = (char)0;\n" if @ignore - lines << " cmock_call_instance->LineNumber = cmock_line;\n" - lines << " cmock_call_instance->CallOrder = ++GlobalExpectCount;\n" if @ordered && global_ordering_supported - lines << " cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;\n" if @cexception - lines << " cmock_call_instance->ExpectAnyArgsBool = (char)0;\n" if @expect_any - lines - end - - def code_add_an_arg_expectation(arg, depth = 1) - lines = code_assign_argument_quickly("cmock_call_instance->Expected_#{arg[:name]}", arg) - lines << " cmock_call_instance->Expected_#{arg[:name]}_Depth = #{arg[:name]}_Depth;\n" if @arrays && (depth.class == String) - lines << " cmock_call_instance->IgnoreArg_#{arg[:name]} = 0;\n" if @ignore_arg - lines << " cmock_call_instance->ReturnThruPtr_#{arg[:name]}_Used = 0;\n" if @return_thru_ptr && ptr_or_str?(arg[:type]) && !(arg[:const?]) - lines - end - - def code_assign_argument_quickly(dest, arg) - if arg[:ptr?] || @treat_as.include?(arg[:type]) - " #{dest} = #{arg[:name]};\n" - else - assert_expr = "sizeof(#{arg[:name]}) == sizeof(#{arg[:type]}) ? 1 : -1" - comment = "/* add #{arg[:type]} to :treat_as_array if this causes an error */" - " memcpy((void*)(&#{dest}), (void*)(&#{arg[:name]}),\n" \ - " sizeof(#{arg[:type]}[#{assert_expr}])); #{comment}\n" - end - end - - def code_add_argument_loader(function) - if function[:args_string] != 'void' - if @arrays - args_string = function[:args].map do |m| - type = arg_type_with_const(m) - m[:ptr?] ? "#{type} #{m[:name]}, int #{m[:name]}_Depth" : "#{type} #{m[:name]}" - end.join(', ') - "void CMockExpectParameters_#{function[:name]}(CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance, #{args_string})\n{\n" + - function[:args].inject('') { |all, arg| all + code_add_an_arg_expectation(arg, (arg[:ptr?] ? "#{arg[:name]}_Depth" : 1)) } + - "}\n\n" - else - "void CMockExpectParameters_#{function[:name]}(CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance, #{function[:args_string]})\n{\n" + - function[:args].inject('') { |all, arg| all + code_add_an_arg_expectation(arg) } + - "}\n\n" - end - else - '' - end - end - - def code_call_argument_loader(function) - if function[:args_string] != 'void' - args = function[:args].map do |m| - if @arrays && m[:ptr?] && !(m[:array_data?]) - "#{m[:name]}, 1" - elsif @arrays && m[:array_size?] - "#{m[:name]}, #{m[:name]}" - else - m[:name] - end - end - " CMockExpectParameters_#{function[:name]}(cmock_call_instance, #{args.join(', ')});\n" - else - '' - end - end - - def ptr_or_str?(arg_type) - (arg_type.include?('*') || - @treat_as.fetch(arg_type, '').include?('*')) - end - - # private ###################### - - def lookup_expect_type(_function, arg) - c_type = arg[:type] - arg_name = arg[:name] - expected = "cmock_call_instance->Expected_#{arg_name}" - ignore = "cmock_call_instance->IgnoreArg_#{arg_name}" - unity_func = if (arg[:ptr?]) && ((c_type =~ /\*\*/) || (@ptr_handling == :compare_ptr)) - ['UNITY_TEST_ASSERT_EQUAL_PTR', ''] - else - @helpers.nil? || @helpers[:unity_helper].nil? ? ['UNITY_TEST_ASSERT_EQUAL', ''] : @helpers[:unity_helper].get_helper(c_type) - end - [c_type, arg_name, expected, ignore, unity_func[0], unity_func[1]] - end - - def code_verify_an_arg_expectation_with_no_arrays(function, arg) - c_type, arg_name, expected, ignore, unity_func, pre = lookup_expect_type(function, arg) - lines = '' - lines << " if (!#{ignore})\n" if @ignore_arg - lines << " {\n" - lines << " UNITY_SET_DETAILS(CMockString_#{function[:name]},CMockString_#{arg_name});\n" - case unity_func - when 'UNITY_TEST_ASSERT_EQUAL_MEMORY' - c_type_local = c_type.gsub(/\*$/, '') - lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type_local}), cmock_line, CMockStringMismatch);\n" - when 'UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY' - if pre == '&' - lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), cmock_line, CMockStringMismatch);\n" - else - lines << " if (#{pre}#{expected} == NULL)\n" - lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n" - lines << " else\n" - lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), cmock_line, CMockStringMismatch); }\n" - end - when /_ARRAY/ - if pre == '&' - lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, 1, cmock_line, CMockStringMismatch);\n" - else - lines << " if (#{pre}#{expected} == NULL)\n" - lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n" - lines << " else\n" - lines << " { #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, 1, cmock_line, CMockStringMismatch); }\n" - end - else - lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch);\n" - end - lines << " }\n" - lines - end - - def code_verify_an_arg_expectation_with_normal_arrays(function, arg) - c_type, arg_name, expected, ignore, unity_func, pre = lookup_expect_type(function, arg) - depth_name = arg[:ptr?] ? "cmock_call_instance->Expected_#{arg_name}_Depth" : 1 - lines = '' - lines << " if (!#{ignore})\n" if @ignore_arg - lines << " {\n" - lines << " UNITY_SET_DETAILS(CMockString_#{function[:name]},CMockString_#{arg_name});\n" - case unity_func - when 'UNITY_TEST_ASSERT_EQUAL_MEMORY' - c_type_local = c_type.gsub(/\*$/, '') - lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type_local}), cmock_line, CMockStringMismatch);\n" - when 'UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY' - if pre == '&' - lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), cmock_line, CMockStringMismatch);\n" - else - lines << " if (#{pre}#{expected} == NULL)\n" - lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n" - lines << " else\n" - lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), #{depth_name}, cmock_line, CMockStringMismatch); }\n" - end - when /_ARRAY/ - if pre == '&' - lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch);\n" - else - lines << " if (#{pre}#{expected} == NULL)\n" - lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n" - lines << " else\n" - lines << " { #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch); }\n" - end - else - lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch);\n" - end - lines << " }\n" - lines - end - - def code_verify_an_arg_expectation_with_smart_arrays(function, arg) - c_type, arg_name, expected, ignore, unity_func, pre = lookup_expect_type(function, arg) - depth_name = arg[:ptr?] ? "cmock_call_instance->Expected_#{arg_name}_Depth" : 1 - lines = '' - lines << " if (!#{ignore})\n" if @ignore_arg - lines << " {\n" - lines << " UNITY_SET_DETAILS(CMockString_#{function[:name]},CMockString_#{arg_name});\n" - case unity_func - when 'UNITY_TEST_ASSERT_EQUAL_MEMORY' - c_type_local = c_type.gsub(/\*$/, '') - lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type_local}), cmock_line, CMockStringMismatch);\n" - when 'UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY' - if pre == '&' - lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), #{depth_name}, cmock_line, CMockStringMismatch);\n" - else - lines << " if (#{pre}#{expected} == NULL)\n" - lines << " { UNITY_TEST_ASSERT_NULL(#{arg_name}, cmock_line, CMockStringExpNULL); }\n" - lines << (depth_name != 1 ? " else if (#{depth_name} == 0)\n { UNITY_TEST_ASSERT_EQUAL_PTR(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch); }\n" : '') - lines << " else\n" - if @array_as_byte - lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), 1, #{depth_name}, cmock_line, CMockStringMismatch); }\n" - else - lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), #{depth_name}, cmock_line, CMockStringMismatch); }\n" - end - end - when /_ARRAY/ - if pre == '&' - lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch);\n" - else - lines << " if (#{pre}#{expected} == NULL)\n" - lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n" - lines << (depth_name != 1 ? " else if (#{depth_name} == 0)\n { UNITY_TEST_ASSERT_EQUAL_PTR(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch); }\n" : '') - lines << " else\n" - lines << " { #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch); }\n" - end - else - lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch);\n" - end - lines << " }\n" - lines - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_header_parser.rb b/components/testframework/libs/cmock/lib/cmock_header_parser.rb deleted file mode 100644 index 8638a04f9..000000000 --- a/components/testframework/libs/cmock/lib/cmock_header_parser.rb +++ /dev/null @@ -1,595 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockHeaderParser - attr_accessor :funcs, :c_attr_noconst, :c_attributes, :treat_as_void, :treat_externs, :treat_inlines, :inline_function_patterns - - def initialize(cfg) - @funcs = [] - @c_strippables = cfg.strippables - @c_attr_noconst = cfg.attributes.uniq - ['const'] - @c_attributes = ['const'] + c_attr_noconst - @c_calling_conventions = cfg.c_calling_conventions.uniq - @treat_as_array = cfg.treat_as_array - @treat_as_void = (['void'] + cfg.treat_as_void).uniq - @function_declaration_parse_base_match = '([\w\s\*\(\),\[\]]+??)\(([\w\s\*\(\),\.\[\]+\-\/]*)\)' - @declaration_parse_matcher = /#{@function_declaration_parse_base_match}$/m - @standards = (%w[int short char long unsigned signed] + cfg.treat_as.keys).uniq - @array_size_name = cfg.array_size_name - @array_size_type = (%w[int size_t] + cfg.array_size_type).uniq - @when_no_prototypes = cfg.when_no_prototypes - @local_as_void = @treat_as_void - @verbosity = cfg.verbosity - @treat_externs = cfg.treat_externs - @treat_inlines = cfg.treat_inlines - @inline_function_patterns = cfg.inline_function_patterns - @c_strippables += ['extern'] if @treat_externs == :include # we'll need to remove the attribute if we're allowing externs - @c_strippables += ['inline'] if @treat_inlines == :include # we'll need to remove the attribute if we're allowing inlines - end - - def parse(name, source) - @module_name = name.gsub(/\W/, '') - @typedefs = [] - @funcs = [] - @normalized_source = nil - function_names = [] - - all_funcs = parse_functions(import_source(source)).map { |item| [item] } - all_funcs += parse_cpp_functions(import_source(source, true)) - all_funcs.map do |decl| - func = parse_declaration(*decl) - unless function_names.include? func[:name] - @funcs << func - function_names << func[:name] - end - end - - @normalized_source = if @treat_inlines == :include - transform_inline_functions(source) - else - '' - end - - { :includes => nil, - :functions => @funcs, - :typedefs => @typedefs, - :normalized_source => @normalized_source } - end - - private if $ThisIsOnlyATest.nil? ################ - - def remove_nested_pairs_of_braces(source) - # remove nested pairs of braces because no function declarations will be inside of them (leave outer pair for function definition detection) - if RUBY_VERSION.split('.')[0].to_i > 1 - # we assign a string first because (no joke) if Ruby 1.9.3 sees this line as a regex, it will crash. - r = '\\{([^\\{\\}]*|\\g<0>)*\\}' - source.gsub!(/#{r}/m, '{ }') - else - while source.gsub!(/\{[^\{\}]*\{[^\{\}]*\}[^\{\}]*\}/m, '{ }') - end - end - - source - end - - # Return the number of pairs of braces/square brackets in the function provided by the user - # +source+:: String containing the function to be processed - def count_number_of_pairs_of_braces_in_function(source) - is_function_start_found = false - curr_level = 0 - total_pairs = 0 - - source.each_char do |c| - if c == '{' - curr_level += 1 - total_pairs += 1 - is_function_start_found = true - elsif c == '}' - curr_level -= 1 - end - - break if is_function_start_found && curr_level == 0 # We reached the end of the inline function body - end - - if curr_level != 0 - total_pairs = 0 # Something is fishy about this source, not enough closing braces? - end - - total_pairs - end - - # Transform inline functions to regular functions in the source by the user - # +source+:: String containing the source to be processed - def transform_inline_functions(source) - inline_function_regex_formats = [] - square_bracket_pair_regex_format = /\{[^\{\}]*\}/ # Regex to match one whole block enclosed by two square brackets - - # Convert user provided string patterns to regex - # Use word bounderies before and after the user regex to limit matching to actual word iso part of a word - @inline_function_patterns.each do |user_format_string| - user_regex = Regexp.new(user_format_string) - word_boundary_before_user_regex = /\b/ - cleanup_spaces_after_user_regex = /[ ]*\b/ - inline_function_regex_formats << Regexp.new(word_boundary_before_user_regex.source + user_regex.source + cleanup_spaces_after_user_regex.source) - end - - # let's clean up the encoding in case they've done anything weird with the characters we might find - source = source.force_encoding('ISO-8859-1').encode('utf-8', :replace => nil) - - # smush multiline macros into single line (checking for continuation character at end of line '\') - # If the user uses a macro to declare an inline function, - # smushing the macros makes it easier to recognize them as a macro and if required, - # remove them later on in this function - source.gsub!(/\s*\\\s*/m, ' ') - - # Just looking for static|inline in the gsub is a bit too aggressive (functions that are named like this, ...), so we try to be a bit smarter - # Instead, look for an inline pattern (f.e. "static inline") and parse it. - # Below is a small explanation on how the general mechanism works: - # - Everything before the match should just be copied, we don't want - # to touch anything but the inline functions. - # - Remove the implementation of the inline function (this is enclosed - # in square brackets) and replace it with ";" to complete the - # transformation to normal/non-inline function. - # To ensure proper removal of the function body, we count the number of square-bracket pairs - # and remove the pairs one-by-one. - # - Copy everything after the inline function implementation and start the parsing of the next inline function - # There are ofcourse some special cases (inline macro declarations, inline function declarations, ...) which are handled and explained below - inline_function_regex_formats.each do |format| - loop do - inline_function_match = source.match(/#{format}/) # Search for inline function declaration - - break if inline_function_match.nil? # No inline functions so nothing to do - - # 1. Determine if we are dealing with a user defined macro to declare inline functions - # If the end of the pre-match string is a macro-declaration-like string, - # we are dealing with a user defined macro to declare inline functions - if /(#define\s*)\z/ =~ inline_function_match.pre_match - # Remove the macro from the source - stripped_pre_match = inline_function_match.pre_match.sub(/(#define\s*)\z/, '') - stripped_post_match = inline_function_match.post_match.sub(/\A(.*[\n]?)/, '') - source = stripped_pre_match + stripped_post_match - next - end - - # 2. Determine if we are dealing with an inline function declaration iso function definition - # If the start of the post-match string is a function-declaration-like string (something ending with semicolon after the function arguments), - # we are dealing with a inline function declaration - if /\A#{@function_declaration_parse_base_match}\s*;/m =~ inline_function_match.post_match - # Only remove the inline part from the function declaration, leaving the function declaration won't do any harm - source = inline_function_match.pre_match + inline_function_match.post_match - next - end - - # 3. If we get here, we found an inline function declaration AND inline function body. - # Remove the function body to transform it into a 'normal' function. - total_pairs_to_remove = count_number_of_pairs_of_braces_in_function(inline_function_match.post_match) - - break if total_pairs_to_remove == 0 # Bad source? - - inline_function_stripped = inline_function_match.post_match - - total_pairs_to_remove.times do - inline_function_stripped.sub!(/\s*#{square_bracket_pair_regex_format}/, ';') # Remove inline implementation (+ some whitespace because it's prettier) - end - - source = inline_function_match.pre_match + inline_function_stripped # Make new source with the inline function removed and move on to the next - end - end - - source - end - - def import_source(source, cpp = false) - # let's clean up the encoding in case they've done anything weird with the characters we might find - source = source.force_encoding('ISO-8859-1').encode('utf-8', :replace => nil) - - # void must be void for cmock _ExpectAndReturn calls to process properly, not some weird typedef which equates to void - # to a certain extent, this action assumes we're chewing on pre-processed header files, otherwise we'll most likely just get stuff from @treat_as_void - @local_as_void = @treat_as_void - void_types = source.scan(/typedef\s+(?:\(\s*)?void(?:\s*\))?\s+([\w]+)\s*;/) - if void_types - @local_as_void += void_types.flatten.uniq.compact - end - - # If user wants to mock inline functions, - # remove the (user specific) inline keywords before removing anything else to avoid missing an inline function - if @treat_inlines == :include - @inline_function_patterns.each do |user_format_string| - source.gsub!(/#{user_format_string}/, '') # remove user defined inline function patterns - end - end - - # smush multiline macros into single line (checking for continuation character at end of line '\') - source.gsub!(/\s*\\\s*/m, ' ') - - # remove comments (block and line, in three steps to ensure correct precedence) - source.gsub!(/(? * , <@array_size_type> <@array_size_name> - args.each_with_index do |val, index| - next_index = index + 1 - next unless args.length > next_index - - if (val[:ptr?] == true) && args[next_index][:name].match(@array_size_name) && @array_size_type.include?(args[next_index][:type]) - val[:array_data?] = true - args[next_index][:array_size?] = true - end - end - - args - end - - def divine_ptr(arg) - return false unless arg.include? '*' - # treat "const char *" and similar as a string, not a pointer - return false if /(^|\s)(const\s+)?char(\s+const)?\s*\*(?!.*\*)/ =~ arg - - true - end - - def divine_const(arg) - # a non-pointer arg containing "const" is a constant - # an arg containing "const" before the last * is a pointer to a constant - if arg.include?('*') ? (/(^|\s|\*)const(\s(\w|\s)*)?\*(?!.*\*)/ =~ arg) : (/(^|\s)const(\s|$)/ =~ arg) - true - else - false - end - end - - def divine_ptr_and_const(arg) - divination = {} - - divination[:ptr?] = divine_ptr(arg) - divination[:const?] = divine_const(arg) - - # an arg containing "const" after the last * is a constant pointer - divination[:const_ptr?] = /\*(?!.*\*)\s*const(\s|$)/ =~ arg ? true : false - - divination - end - - def clean_args(arg_list) - if @local_as_void.include?(arg_list.strip) || arg_list.empty? - 'void' - else - c = 0 - # magically turn brackets into asterisks, also match for parentheses that come from macros - arg_list.gsub!(/(\w+)(?:\s*\[[^\[\]]*\])+/, '*\1') - # remove space to place asterisks with type (where they belong) - arg_list.gsub!(/\s+\*/, '*') - # pull asterisks away from arg to place asterisks with type (where they belong) - arg_list.gsub!(/\*(\w)/, '* \1') - - # scan argument list for function pointers and replace them with custom types - arg_list.gsub!(/([\w\s\*]+)\(+\s*\*[\*\s]*([\w\s]*)\s*\)+\s*\(((?:[\w\s\*]*,?)*)\s*\)*/) do |_m| - functype = "cmock_#{@module_name}_func_ptr#{@typedefs.size + 1}" - funcret = Regexp.last_match(1).strip - funcname = Regexp.last_match(2).strip - funcargs = Regexp.last_match(3).strip - funconst = '' - if funcname.include? 'const' - funcname.gsub!('const', '').strip! - funconst = 'const ' - end - @typedefs << "typedef #{funcret}(*#{functype})(#{funcargs});" - funcname = "cmock_arg#{c += 1}" if funcname.empty? - "#{functype} #{funconst}#{funcname}" - end - - # scan argument list for function pointers with shorthand notation and replace them with custom types - arg_list.gsub!(/([\w\s\*]+)+\s+(\w+)\s*\(((?:[\w\s\*]*,?)*)\s*\)*/) do |_m| - functype = "cmock_#{@module_name}_func_ptr#{@typedefs.size + 1}" - funcret = Regexp.last_match(1).strip - funcname = Regexp.last_match(2).strip - funcargs = Regexp.last_match(3).strip - funconst = '' - if funcname.include? 'const' - funcname.gsub!('const', '').strip! - funconst = 'const ' - end - @typedefs << "typedef #{funcret}(*#{functype})(#{funcargs});" - funcname = "cmock_arg#{c += 1}" if funcname.empty? - "#{functype} #{funconst}#{funcname}" - end - - # automatically name unnamed arguments (those that only had a type) - arg_list.split(/\s*,\s*/).map do |arg| - parts = (arg.split - ['struct', 'union', 'enum', 'const', 'const*']) - if (parts.size < 2) || (parts[-1][-1].chr == '*') || @standards.include?(parts[-1]) - "#{arg} cmock_arg#{c += 1}" - else - arg - end - end.join(', ') - end - end - - def parse_declaration(declaration, namespace = [], classname = nil) - decl = {} - decl[:namespace] = namespace - decl[:class] = classname - - regex_match = @declaration_parse_matcher.match(declaration) - raise "Failed parsing function declaration: '#{declaration}'" if regex_match.nil? - - # grab argument list - args = regex_match[2].strip - - # process function attributes, return type, and name - parsed = parse_type_and_name(regex_match[1]) - - # Record original name without scope prefix - decl[:unscoped_name] = parsed[:name] - - # Prefix name with namespace scope (if any) and then class - decl[:name] = namespace.join('_') - unless classname.nil? - decl[:name] << '_' unless decl[:name].empty? - decl[:name] << classname - end - # Add original name to complete fully scoped name - decl[:name] << '_' unless decl[:name].empty? - decl[:name] << decl[:unscoped_name] - - decl[:modifier] = parsed[:modifier] - unless parsed[:c_calling_convention].nil? - decl[:c_calling_convention] = parsed[:c_calling_convention] - end - - rettype = parsed[:type] - rettype = 'void' if @local_as_void.include?(rettype.strip) - decl[:return] = { :type => rettype, - :name => 'cmock_to_return', - :str => "#{rettype} cmock_to_return", - :void? => (rettype == 'void'), - :ptr? => parsed[:ptr?] || false, - :const? => parsed[:const?] || false, - :const_ptr? => parsed[:const_ptr?] || false } - - # remove default argument statements from mock definitions - args.gsub!(/=\s*[a-zA-Z0-9_\.]+\s*/, ' ') - - # check for var args - if args =~ /\.\.\./ - decl[:var_arg] = args.match(/[\w\s]*\.\.\./).to_s.strip - args = if args =~ /\,[\w\s]*\.\.\./ - args.gsub!(/\,[\w\s]*\.\.\./, '') - else - 'void' - end - else - decl[:var_arg] = nil - end - args = clean_args(args) - decl[:args_string] = args - decl[:args] = parse_args(args) - decl[:args_call] = decl[:args].map { |a| a[:name] }.join(', ') - decl[:contains_ptr?] = decl[:args].inject(false) { |ptr, arg| arg[:ptr?] ? true : ptr } - - if decl[:return][:type].nil? || decl[:name].nil? || decl[:args].nil? || - decl[:return][:type].empty? || decl[:name].empty? - raise "Failed Parsing Declaration Prototype!\n" \ - " declaration: '#{declaration}'\n" \ - " modifier: '#{decl[:modifier]}'\n" \ - " return: #{prototype_inspect_hash(decl[:return])}\n" \ - " function: '#{decl[:name]}'\n" \ - " args: #{prototype_inspect_array_of_hashes(decl[:args])}\n" - end - - decl - end - - def prototype_inspect_hash(hash) - pairs = [] - hash.each_pair { |name, value| pairs << ":#{name} => #{"'" if value.class == String}#{value}#{"'" if value.class == String}" } - "{#{pairs.join(', ')}}" - end - - def prototype_inspect_array_of_hashes(array) - hashes = [] - array.each { |hash| hashes << prototype_inspect_hash(hash) } - case array.size - when 0 - return '[]' - when 1 - return "[#{hashes[0]}]" - else - return "[\n #{hashes.join("\n ")}\n ]\n" - end - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_plugin_manager.rb b/components/testframework/libs/cmock/lib/cmock_plugin_manager.rb deleted file mode 100644 index 342014e22..000000000 --- a/components/testframework/libs/cmock/lib/cmock_plugin_manager.rb +++ /dev/null @@ -1,50 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockPluginManager - attr_accessor :plugins - - def initialize(config, utils) - @plugins = [] - plugins_to_load = [:expect, config.plugins].flatten.uniq.compact - plugins_to_load.each do |plugin| - plugin_name = plugin.to_s - object_name = 'CMockGeneratorPlugin' + camelize(plugin_name) - self.class.mutex.synchronize { load_plugin(plugin_name, object_name, config, utils) } - end - @plugins.sort! { |a, b| a.priority <=> b.priority } - end - - def run(method, args = nil) - if args.nil? - @plugins.collect { |plugin| plugin.send(method) if plugin.respond_to?(method) }.flatten.join - else - @plugins.collect { |plugin| plugin.send(method, args) if plugin.respond_to?(method) }.flatten.join - end - end - - def camelize(lower_case_and_underscored_word) - lower_case_and_underscored_word.gsub(/\/(.?)/) { '::' + Regexp.last_match(1).upcase }.gsub(/(^|_)(.)/) { Regexp.last_match(2).upcase } - end - - def self.mutex - @mutex ||= Mutex.new - end - - private - - def load_plugin(plugin_name, object_name, config, utils) - unless Object.const_defined? object_name - file_name = "#{__dir__}/cmock_generator_plugin_#{plugin_name.downcase}.rb" - require file_name - end - class_name = Object.const_get(object_name) - @plugins << class_name.new(config, utils) - rescue StandardError - file_name = "#{__dir__}/cmock_generator_plugin_#{plugin_name.downcase}.rb" - raise "ERROR: CMock unable to load plugin '#{plugin_name}' '#{object_name}' #{file_name}" - end -end diff --git a/components/testframework/libs/cmock/lib/cmock_unityhelper_parser.rb b/components/testframework/libs/cmock/lib/cmock_unityhelper_parser.rb deleted file mode 100644 index 9f4beb770..000000000 --- a/components/testframework/libs/cmock/lib/cmock_unityhelper_parser.rb +++ /dev/null @@ -1,77 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -class CMockUnityHelperParser - attr_accessor :c_types - - def initialize(config) - @config = config - @fallback = @config.plugins.include?(:array) ? 'UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY' : 'UNITY_TEST_ASSERT_EQUAL_MEMORY' - @c_types = map_c_types.merge(import_source) - end - - def get_helper(ctype) - lookup = ctype.gsub(/(?:^|(\S?)(\s*)|(\W))const(?:$|(\s*)(\S)|(\W))/, '\1\3\5\6').strip.gsub(/\s+/, '_') - return [@c_types[lookup], ''] if @c_types[lookup] - - if lookup =~ /\*$/ - lookup = lookup.gsub(/\*$/, '') - return [@c_types[lookup], '*'] if @c_types[lookup] - else - lookup += '*' - return [@c_types[lookup], '&'] if @c_types[lookup] - end - return ['UNITY_TEST_ASSERT_EQUAL_PTR', ''] if ctype =~ /cmock_\w+_ptr\d+/ - raise("Don't know how to test #{ctype} and memory tests are disabled!") unless @config.memcmp_if_unknown - - lookup =~ /\*$/ ? [@fallback, '&'] : [@fallback, ''] - end - - private ########################### - - def map_c_types - c_types = {} - @config.treat_as.each_pair do |ctype, expecttype| - c_type = ctype.gsub(/\s+/, '_') - if expecttype =~ /\*/ - c_types[c_type] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype.delete('*')}_ARRAY" - else - c_types[c_type] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype}" - c_types[c_type + '*'] ||= "UNITY_TEST_ASSERT_EQUAL_#{expecttype}_ARRAY" - end - end - c_types - end - - def import_source - source = @config.load_unity_helper - return {} if source.nil? - - c_types = {} - source = source.gsub(/\/\/.*$/, '') # remove line comments - source = source.gsub(/\/\*.*?\*\//m, '') # remove block comments - - # scan for comparison helpers - match_regex = Regexp.new('^\s*#define\s+(UNITY_TEST_ASSERT_EQUAL_(\w+))\s*\(' + Array.new(4, '\s*\w+\s*').join(',') + '\)') - pairs = source.scan(match_regex).flatten.compact - (pairs.size / 2).times do |i| - expect = pairs[i * 2] - ctype = pairs[(i * 2) + 1] - c_types[ctype] = expect unless expect.include?('_ARRAY') - end - - # scan for array variants of those helpers - match_regex = Regexp.new('^\s*#define\s+(UNITY_TEST_ASSERT_EQUAL_(\w+_ARRAY))\s*\(' + Array.new(5, '\s*\w+\s*').join(',') + '\)') - pairs = source.scan(match_regex).flatten.compact - (pairs.size / 2).times do |i| - expect = pairs[i * 2] - ctype = pairs[(i * 2) + 1] - c_types[ctype.gsub('_ARRAY', '*')] = expect - end - - c_types - end -end diff --git a/components/testframework/libs/cmock/meson.build b/components/testframework/libs/cmock/meson.build deleted file mode 100755 index e29864f46..000000000 --- a/components/testframework/libs/cmock/meson.build +++ /dev/null @@ -1,53 +0,0 @@ -# -# build script written by : Michael Brockus. -# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. -# -# license: MIT -# -project('cmock', 'c', - license: 'MIT', - meson_version: '>=0.53.0', - subproject_dir : 'vendor', - default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11'] -) -lang = 'c' -cc = meson.get_compiler(lang) - - -# -# Meson: Add compiler flags -# -if cc.get_id() == 'clang' - add_project_arguments(cc.get_supported_arguments( - [ - '-Wexit-time-destructors', - '-Wglobal-constructors', - '-Wmissing-prototypes', - '-Wmissing-noreturn', - '-Wno-missing-braces', - '-Wold-style-cast', '-Wpointer-arith', '-Wweak-vtables', - '-Wcast-align', '-Wconversion', '-Wcast-qual', '-Wshadow' - ] - ), language: lang) -endif - -if cc.get_argument_syntax() == 'gcc' - add_project_arguments(cc.get_supported_arguments( - [ - '-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar', - '-Wpointer-arith' , '-Wwrite-strings' , - '-Wno-parentheses' , '-Wno-type-limits' , - '-Wformat-security' , '-Wunreachable-code' , - '-Waggregate-return' , '-Wformat-nonliteral' , - '-Wmissing-declarations', '-Wmissing-include-dirs' , - '-Wno-unused-parameter' - ] - ), language: lang) -endif - -unity_dep = dependency('unity', fallback: ['unity', 'unity_dep']) - -# -# Sub directory to project source code -subdir('src') -cmock_dep = declare_dependency(link_with: cmock_lib, include_directories: cmock_dir) diff --git a/components/testframework/libs/cmock/scripts/create_makefile.rb b/components/testframework/libs/cmock/scripts/create_makefile.rb deleted file mode 100644 index 56cb78e90..000000000 --- a/components/testframework/libs/cmock/scripts/create_makefile.rb +++ /dev/null @@ -1,203 +0,0 @@ -require 'fileutils' -ABS_ROOT = FileUtils.pwd -CMOCK_DIR = File.expand_path(ENV.fetch('CMOCK_DIR', File.join(ABS_ROOT, '..', '..'))) -require "#{CMOCK_DIR}/lib/cmock" -UNITY_DIR = File.join(CMOCK_DIR, 'vendor', 'unity') -require "#{UNITY_DIR}/auto/generate_test_runner" - -SRC_DIR = ENV.fetch('SRC_DIR', './src') -TEST_DIR = ENV.fetch('TEST_DIR', './test') -UNITY_SRC = File.join(UNITY_DIR, 'src') -CMOCK_SRC = File.join(CMOCK_DIR, 'src') -BUILD_DIR = ENV.fetch('BUILD_DIR', './build') -TEST_BUILD_DIR = ENV.fetch('TEST_BUILD_DIR', File.join(BUILD_DIR, 'test')) -OBJ_DIR = File.join(TEST_BUILD_DIR, 'obj') -UNITY_OBJ = File.join(OBJ_DIR, 'unity.o') -CMOCK_OBJ = File.join(OBJ_DIR, 'cmock.o') -RUNNERS_DIR = File.join(TEST_BUILD_DIR, 'runners') -MOCKS_DIR = File.join(TEST_BUILD_DIR, 'mocks') -TEST_BIN_DIR = TEST_BUILD_DIR -MOCK_PREFIX = ENV.fetch('TEST_MOCK_PREFIX', 'mock_') -MOCK_SUFFIX = ENV.fetch('TEST_MOCK_SUFFIX', '') -TEST_MAKEFILE = ENV.fetch('TEST_MAKEFILE', File.join(TEST_BUILD_DIR, 'MakefileTestSupport')) -MOCK_MATCHER = /#{MOCK_PREFIX}[A-Za-z_][A-Za-z0-9_\-\.]+#{MOCK_SUFFIX}/ - -[TEST_BUILD_DIR, OBJ_DIR, RUNNERS_DIR, MOCKS_DIR, TEST_BIN_DIR].each do |dir| - FileUtils.mkdir_p dir -end - -all_headers_to_mock = [] - -suppress_error = !ARGV.nil? && !ARGV.empty? && (ARGV[0].casecmp('--SILENT') == 0) - -File.open(TEST_MAKEFILE, 'w') do |mkfile| - # Define make variables - mkfile.puts 'CC ?= gcc' - mkfile.puts "BUILD_DIR = #{BUILD_DIR}" - mkfile.puts "SRC_DIR = #{SRC_DIR}" - mkfile.puts "TEST_DIR = #{TEST_DIR}" - mkfile.puts 'TEST_CFLAGS ?= -DTEST' - mkfile.puts "CMOCK_DIR ?= #{CMOCK_DIR}" - mkfile.puts "UNITY_DIR ?= #{UNITY_DIR}" - mkfile.puts 'TEST_BUILD_DIR ?= ${BUILD_DIR}/test' - mkfile.puts 'TEST_MAKEFILE = ${TEST_BUILD_DIR}/MakefileTestSupport' - mkfile.puts 'OBJ ?= ${BUILD_DIR}/obj' - mkfile.puts 'OBJ_DIR = ${OBJ}' - mkfile.puts '' - - # Build Unity - mkfile.puts "#{UNITY_OBJ}: #{UNITY_SRC}/unity.c" - mkfile.puts "\t${CC} -o $@ -c $< -I #{UNITY_SRC}" - mkfile.puts '' - - # Build CMock - mkfile.puts "#{CMOCK_OBJ}: #{CMOCK_SRC}/cmock.c" - mkfile.puts "\t${CC} -o $@ -c $< -I #{UNITY_SRC} -I #{CMOCK_SRC}" - mkfile.puts '' - - test_sources = Dir["#{TEST_DIR}/**/test_*.c"] - test_targets = [] - generator = UnityTestRunnerGenerator.new - - # headers that begin with prefix or end with suffix are not included - all_headers = Dir["#{SRC_DIR}/**/*.h*"] - - def reject_mock_files(file) - extn = File.extname file - filename = File.basename file, extn - if MOCK_SUFFIX.empty? - return filename.start_with? MOCK_PREFIX - end - - (filename.start_with?(MOCK_PREFIX) || filename.end_with?(MOCK_SUFFIX)) - end - - all_headers = all_headers.reject { |f| reject_mock_files(f) } - - makefile_targets = [] - - test_sources.each do |test| - module_name = File.basename(test, '.c') - src_module_name = module_name.sub(/^test_/, '') - test_obj = File.join(OBJ_DIR, "#{module_name}.o") - runner_source = File.join(RUNNERS_DIR, "runner_#{module_name}.c") - runner_obj = File.join(OBJ_DIR, "runner_#{module_name}.o") - test_bin = File.join(TEST_BIN_DIR, module_name) - test_results = File.join(TEST_BIN_DIR, module_name + '.testresult') - - cfg = { - src: test, - includes: generator.find_includes(File.readlines(test).join('')) - } - - # Build main project modules, with TEST defined - module_src = File.join(SRC_DIR, "#{src_module_name}.c") - module_obj = File.join(OBJ_DIR, "#{src_module_name}.o") - unless makefile_targets.include? module_obj - makefile_targets.push(module_obj) - mkfile.puts "#{module_obj}: #{module_src}" - mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I ${SRC_DIR} ${INCLUDE_PATH}" - mkfile.puts '' - end - - # process link-only files - linkonly = cfg[:includes][:linkonly] - linkonly_objs = [] - linkonly.each do |linkonlyfile| - linkonlybase = File.basename(linkonlyfile, '.*') - linkonlymodule_src = File.join(SRC_DIR, linkonlyfile.to_s) - linkonlymodule_obj = File.join(OBJ_DIR, "#{linkonlybase}.o") - linkonly_objs.push(linkonlymodule_obj) - # only create the target if we didn't already - next if makefile_targets.include? linkonlymodule_obj - - makefile_targets.push(linkonlymodule_obj) - mkfile.puts "#{linkonlymodule_obj}: #{linkonlymodule_src}" - mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I ${SRC_DIR} ${INCLUDE_PATH}" - mkfile.puts '' - end - - # Create runners - mkfile.puts "#{runner_source}: #{test}" - mkfile.puts "\t@UNITY_DIR=${UNITY_DIR} ruby ${CMOCK_DIR}/scripts/create_runner.rb #{test} #{runner_source}" - mkfile.puts '' - - # Build runner - mkfile.puts "#{runner_obj}: #{runner_source}" - mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{SRC_DIR} -I #{MOCKS_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC} ${INCLUDE_PATH}" - mkfile.puts '' - - # Collect mocks to generate - system_mocks = cfg[:includes][:system].select { |name| name =~ MOCK_MATCHER } - raise 'Mocking of system headers is not yet supported!' unless system_mocks.empty? - - local_mocks = cfg[:includes][:local].select { |name| name =~ MOCK_MATCHER } - - module_names_to_mock = local_mocks.map { |name| name.sub(/#{MOCK_PREFIX}/, '').to_s } - headers_to_mock = [] - module_names_to_mock.each do |name| - header_to_mock = nil - all_headers.each do |header| - if header =~ /[\/\\]?#{name}$/ - header_to_mock = header - break - end - end - raise "Module header '#{name}' not found to mock!" unless header_to_mock - - headers_to_mock << header_to_mock - end - - all_headers_to_mock += headers_to_mock - mock_objs = headers_to_mock.map do |hdr| - mock_name = MOCK_PREFIX + File.basename(hdr, '.*') - File.join(MOCKS_DIR, mock_name + '.o') - end - all_headers_to_mock.uniq! - - # Build test suite - mkfile.puts "#{test_obj}: #{test} #{module_obj} #{mock_objs.join(' ')}" - mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC} -I #{MOCKS_DIR} ${INCLUDE_PATH}" - mkfile.puts '' - - # Build test suite executable - test_objs = "#{test_obj} #{runner_obj} #{module_obj} #{mock_objs.join(' ')} #{linkonly_objs.join(' ')} #{UNITY_OBJ} #{CMOCK_OBJ}" - mkfile.puts "#{test_bin}: #{test_objs}" - mkfile.puts "\t${CC} -o $@ ${LDFLAGS} #{test_objs}" - mkfile.puts '' - - # Run test suite and generate report - mkfile.puts "#{test_results}: #{test_bin}" - mkfile.puts "\t-#{test_bin} > #{test_results} 2>&1" - mkfile.puts '' - - test_targets << test_bin - end - - # Generate and build mocks - all_headers_to_mock.each do |hdr| - mock_name = MOCK_PREFIX + File.basename(hdr, '.*') - mock_header = File.join(MOCKS_DIR, mock_name + File.extname(hdr)) - mock_src = File.join(MOCKS_DIR, mock_name + '.c') - mock_obj = File.join(MOCKS_DIR, mock_name + '.o') - - mkfile.puts "#{mock_src}: #{hdr}" - mkfile.puts "\t@CMOCK_DIR=${CMOCK_DIR} ruby ${CMOCK_DIR}/scripts/create_mock.rb #{hdr}" - mkfile.puts '' - - mkfile.puts "#{mock_obj}: #{mock_src} #{mock_header}" - mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{MOCKS_DIR} -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC} ${INCLUDE_PATH}" - mkfile.puts '' - end - - # Create test summary task - mkfile.puts 'test_summary:' - mkfile.puts "\t@UNITY_DIR=${UNITY_DIR} ruby ${CMOCK_DIR}/scripts/test_summary.rb #{suppress_error ? '--silent' : ''}" - mkfile.puts '' - mkfile.puts '.PHONY: test_summary' - mkfile.puts '' - - # Create target to run all tests - mkfile.puts "test: #{test_targets.map { |t| t + '.testresult' }.join(' ')} test_summary" - mkfile.puts '' -end diff --git a/components/testframework/libs/cmock/scripts/create_mock.rb b/components/testframework/libs/cmock/scripts/create_mock.rb deleted file mode 100644 index 93107a942..000000000 --- a/components/testframework/libs/cmock/scripts/create_mock.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "#{ENV['CMOCK_DIR']}/lib/cmock" - -raise 'Header file to mock must be specified!' unless ARGV.length >= 1 - -mock_out = ENV.fetch('MOCK_OUT', './build/test/mocks') -mock_prefix = ENV.fetch('MOCK_PREFIX', 'mock_') -cmock = CMock.new(:plugins => %i[ignore return_thru_ptr], :mock_prefix => mock_prefix, :mock_path => mock_out) -cmock.setup_mocks(ARGV[0]) diff --git a/components/testframework/libs/cmock/scripts/create_runner.rb b/components/testframework/libs/cmock/scripts/create_runner.rb deleted file mode 100644 index 621980507..000000000 --- a/components/testframework/libs/cmock/scripts/create_runner.rb +++ /dev/null @@ -1,18 +0,0 @@ -if $0 == __FILE__ - - # make sure there is at least one parameter left (the input file) - if ARGV.length < 2 - puts ["\nusage: ruby #{__FILE__} input_test_file (output)", - '', - ' input_test_file - this is the C file you want to create a runner for', - ' output - this is the name of the runner file to generate', - ' defaults to (input_test_file)_Runner'].join("\n") - exit 1 - end - - require "#{ENV['UNITY_DIR']}/auto/generate_test_runner" - - test = ARGV[0] - runner = ARGV[1] - UnityTestRunnerGenerator.new.run(test, runner) -end diff --git a/components/testframework/libs/cmock/scripts/test_summary.rb b/components/testframework/libs/cmock/scripts/test_summary.rb deleted file mode 100644 index cbcbaf8b1..000000000 --- a/components/testframework/libs/cmock/scripts/test_summary.rb +++ /dev/null @@ -1,18 +0,0 @@ -suppress_error = !ARGV.nil? && !ARGV.empty? && (ARGV[0].casecmp('--SILENT') == 0) - -begin - require "#{ENV['UNITY_DIR']}/auto/unity_test_summary.rb" - - build_dir = ENV.fetch('BUILD_DIR', './build') - test_build_dir = ENV.fetch('TEST_BUILD_DIR', File.join(build_dir, 'test')) - - results = Dir["#{test_build_dir}/*.testresult"] - parser = UnityTestSummary.new - parser.targets = results - parser.run - puts parser.report -rescue StandardError => e - raise e unless suppress_error -end - -exit(parser.failures) unless suppress_error diff --git a/components/testframework/libs/cmock/src/cmock.c b/components/testframework/libs/cmock/src/cmock.c deleted file mode 100644 index 88f2c2b25..000000000 --- a/components/testframework/libs/cmock/src/cmock.c +++ /dev/null @@ -1,216 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#include "cmock.h" - -/* public constants to be used by mocks */ -const char* CMockStringOutOfMemory = "CMock has run out of memory. Please allocate more."; -const char* CMockStringCalledMore = "Called more times than expected."; -const char* CMockStringCalledLess = "Called fewer times than expected."; -const char* CMockStringCalledEarly = "Called earlier than expected."; -const char* CMockStringCalledLate = "Called later than expected."; -const char* CMockStringCallOrder = "Called out of order."; -const char* CMockStringIgnPreExp = "IgnoreArg called before Expect."; -const char* CMockStringPtrPreExp = "ReturnThruPtr called before Expect."; -const char* CMockStringPtrIsNULL = "Pointer is NULL."; -const char* CMockStringExpNULL = "Expected NULL."; -const char* CMockStringMismatch = "Function called with unexpected argument value."; - -/* private variables */ -#ifdef CMOCK_MEM_DYNAMIC -static unsigned char* CMock_Guts_Buffer = NULL; -static CMOCK_MEM_INDEX_TYPE CMock_Guts_BufferSize = CMOCK_MEM_ALIGN_SIZE; -static CMOCK_MEM_INDEX_TYPE CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE; -#else -static unsigned char CMock_Guts_Buffer[CMOCK_MEM_SIZE + CMOCK_MEM_ALIGN_SIZE]; -static CMOCK_MEM_INDEX_TYPE CMock_Guts_BufferSize = CMOCK_MEM_SIZE + CMOCK_MEM_ALIGN_SIZE; -static CMOCK_MEM_INDEX_TYPE CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE; -#endif - -/*------------------------------------------------------- - * CMock_Guts_MemNew - *-------------------------------------------------------*/ -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNew(CMOCK_MEM_INDEX_TYPE size) -{ - CMOCK_MEM_INDEX_TYPE index; - - /* verify arguments valid (we must be allocating space for at least 1 byte, and the existing chain must be in memory somewhere) */ - if (size < 1) - return CMOCK_GUTS_NONE; - - /* verify we have enough room */ - size = size + CMOCK_MEM_INDEX_SIZE; - if (size & CMOCK_MEM_ALIGN_MASK) - size = (size + CMOCK_MEM_ALIGN_MASK) & ~CMOCK_MEM_ALIGN_MASK; - if ((CMock_Guts_BufferSize - CMock_Guts_FreePtr) < size) - { -#ifndef CMOCK_MEM_DYNAMIC - return CMOCK_GUTS_NONE; /* nothing we can do; our static buffer is out of memory */ -#else - /* our dynamic buffer does not have enough room; request more via realloc() */ - CMOCK_MEM_INDEX_TYPE new_buffersize = CMock_Guts_BufferSize + CMOCK_MEM_SIZE + size; - unsigned char* new_buffer = realloc(CMock_Guts_Buffer, (size_t)new_buffersize); - if (new_buffer == NULL) - return CMOCK_GUTS_NONE; /* realloc() failed; out of memory */ - CMock_Guts_Buffer = new_buffer; - CMock_Guts_BufferSize = new_buffersize; -#endif - } - - /* determine where we're putting this new block, and init its pointer to be the end of the line */ - index = CMock_Guts_FreePtr + CMOCK_MEM_INDEX_SIZE; - *(CMOCK_MEM_INDEX_TYPE*)(&CMock_Guts_Buffer[CMock_Guts_FreePtr]) = CMOCK_GUTS_NONE; - CMock_Guts_FreePtr += size; - - return index; -} - -/*------------------------------------------------------- - * CMock_Guts_MemChain - *-------------------------------------------------------*/ -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemChain(CMOCK_MEM_INDEX_TYPE root_index, CMOCK_MEM_INDEX_TYPE obj_index) -{ - CMOCK_MEM_INDEX_TYPE index; - void* root; - void* obj; - void* next; - - if (root_index == CMOCK_GUTS_NONE) - { - /* if there is no root currently, we return this object as the root of the chain */ - return obj_index; - } - else - { - /* reject illegal nodes */ - if ((root_index < CMOCK_MEM_ALIGN_SIZE) || (root_index >= CMock_Guts_FreePtr)) - { - return CMOCK_GUTS_NONE; - } - if ((obj_index < CMOCK_MEM_ALIGN_SIZE) || (obj_index >= CMock_Guts_FreePtr)) - { - return CMOCK_GUTS_NONE; - } - - root = (void*)(&CMock_Guts_Buffer[root_index]); - obj = (void*)(&CMock_Guts_Buffer[obj_index]); - - /* find the end of the existing chain and add us */ - next = root; - do { - index = *(CMOCK_MEM_INDEX_TYPE*)((CMOCK_MEM_PTR_AS_INT)next - CMOCK_MEM_INDEX_SIZE); - if (index >= CMock_Guts_FreePtr) - return CMOCK_GUTS_NONE; - if (index > 0) - next = (void*)(&CMock_Guts_Buffer[index]); - } while (index > 0); - *(CMOCK_MEM_INDEX_TYPE*)((CMOCK_MEM_PTR_AS_INT)next - CMOCK_MEM_INDEX_SIZE) = (CMOCK_MEM_INDEX_TYPE)((CMOCK_MEM_PTR_AS_INT)obj - (CMOCK_MEM_PTR_AS_INT)CMock_Guts_Buffer); - return root_index; - } -} - -/*------------------------------------------------------- - * CMock_Guts_MemNext - *-------------------------------------------------------*/ -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNext(CMOCK_MEM_INDEX_TYPE previous_item_index) -{ - CMOCK_MEM_INDEX_TYPE index; - void* previous_item; - - /* There is nothing "next" if the pointer isn't from our buffer */ - if ((previous_item_index < CMOCK_MEM_ALIGN_SIZE) || (previous_item_index >= CMock_Guts_FreePtr)) - return CMOCK_GUTS_NONE; - previous_item = (void*)(&CMock_Guts_Buffer[previous_item_index]); - - /* if the pointer is good, then use it to look up the next index - * (we know the first element always goes in zero, so NEXT must always be > 1) */ - index = *(CMOCK_MEM_INDEX_TYPE*)((CMOCK_MEM_PTR_AS_INT)previous_item - CMOCK_MEM_INDEX_SIZE); - if ((index > 1) && (index < CMock_Guts_FreePtr)) - return index; - else - return CMOCK_GUTS_NONE; -} - -/*------------------------------------------------------- - * CMock_Guts_MemEndOfChain - *-------------------------------------------------------*/ -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemEndOfChain(CMOCK_MEM_INDEX_TYPE root_index) -{ - CMOCK_MEM_INDEX_TYPE index = root_index; - CMOCK_MEM_INDEX_TYPE next_index; - - for (next_index = root_index; - next_index != CMOCK_GUTS_NONE; - next_index = CMock_Guts_MemNext(index)) - { - index = next_index; - } - - return index; -} - -/*------------------------------------------------------- - * CMock_GetAddressFor - *-------------------------------------------------------*/ -void* CMock_Guts_GetAddressFor(CMOCK_MEM_INDEX_TYPE index) -{ - if ((index >= CMOCK_MEM_ALIGN_SIZE) && (index < CMock_Guts_FreePtr)) - { - return (void*)(&CMock_Guts_Buffer[index]); - } - else - { - return NULL; - } -} - -/*------------------------------------------------------- - * CMock_Guts_MemBytesCapacity - *-------------------------------------------------------*/ -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesCapacity(void) -{ - return (sizeof(CMock_Guts_Buffer) - CMOCK_MEM_ALIGN_SIZE); -} - -/*------------------------------------------------------- - * CMock_Guts_MemBytesFree - *-------------------------------------------------------*/ -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesFree(void) -{ - return CMock_Guts_BufferSize - CMock_Guts_FreePtr; -} - -/*------------------------------------------------------- - * CMock_Guts_MemBytesUsed - *-------------------------------------------------------*/ -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesUsed(void) -{ - return CMock_Guts_FreePtr - CMOCK_MEM_ALIGN_SIZE; -} - -/*------------------------------------------------------- - * CMock_Guts_MemFreeAll - *-------------------------------------------------------*/ -void CMock_Guts_MemFreeAll(void) -{ - CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE; /* skip the very beginning */ -} - -/*------------------------------------------------------- - * CMock_Guts_MemFreeFinal - *-------------------------------------------------------*/ -void CMock_Guts_MemFreeFinal(void) -{ - CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE; -#ifdef CMOCK_MEM_DYNAMIC - if (CMock_Guts_Buffer) - { - free(CMock_Guts_Buffer); - CMock_Guts_Buffer = NULL; - } -#endif -} - diff --git a/components/testframework/libs/cmock/src/cmock.h b/components/testframework/libs/cmock/src/cmock.h deleted file mode 100644 index 21123e925..000000000 --- a/components/testframework/libs/cmock/src/cmock.h +++ /dev/null @@ -1,41 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#ifndef CMOCK_FRAMEWORK_H -#define CMOCK_FRAMEWORK_H - -#include "cmock_internals.h" - -#define CMOCK_VERSION_MAJOR 2 -#define CMOCK_VERSION_MINOR 5 -#define CMOCK_VERSION_BUILD 2 -#define CMOCK_VERSION ((CMOCK_VERSION_MAJOR << 16) | (CMOCK_VERSION_MINOR << 8) | CMOCK_VERSION_BUILD) - -/* should be big enough to index full range of CMOCK_MEM_MAX */ -#ifndef CMOCK_MEM_INDEX_TYPE -#include -#define CMOCK_MEM_INDEX_TYPE size_t -#endif - -#define CMOCK_GUTS_NONE (0) - -/*------------------------------------------------------- - * Memory API - *-------------------------------------------------------*/ -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNew(CMOCK_MEM_INDEX_TYPE size); -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemChain(CMOCK_MEM_INDEX_TYPE root_index, CMOCK_MEM_INDEX_TYPE obj_index); -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNext(CMOCK_MEM_INDEX_TYPE previous_item_index); -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemEndOfChain(CMOCK_MEM_INDEX_TYPE root_index); - -void* CMock_Guts_GetAddressFor(CMOCK_MEM_INDEX_TYPE index); - -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesCapacity(void); -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesFree(void); -CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesUsed(void); -void CMock_Guts_MemFreeAll(void); -void CMock_Guts_MemFreeFinal(void); - -#endif /* end of CMOCK_FRAMEWORK_H */ diff --git a/components/testframework/libs/cmock/src/cmock_internals.h b/components/testframework/libs/cmock/src/cmock_internals.h deleted file mode 100644 index 56fb33b1a..000000000 --- a/components/testframework/libs/cmock/src/cmock_internals.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#ifndef CMOCK_FRAMEWORK_INTERNALS_H -#define CMOCK_FRAMEWORK_INTERNALS_H - -#include "unity.h" - -/* These are constants that the generated mocks have access to */ -extern const char* CMockStringOutOfMemory; -extern const char* CMockStringCalledMore; -extern const char* CMockStringCalledLess; -extern const char* CMockStringCalledEarly; -extern const char* CMockStringCalledLate; -extern const char* CMockStringCallOrder; -extern const char* CMockStringIgnPreExp; -extern const char* CMockStringPtrPreExp; -extern const char* CMockStringPtrIsNULL; -extern const char* CMockStringExpNULL; -extern const char* CMockStringMismatch; - -/* define CMOCK_MEM_DYNAMIC to grab memory as needed with malloc - * when you do that, CMOCK_MEM_SIZE is used for incremental size instead of total */ -#ifdef CMOCK_MEM_STATIC -#undef CMOCK_MEM_DYNAMIC -#endif - -#ifdef CMOCK_MEM_DYNAMIC -#include -#endif - -/* this is used internally during pointer arithmetic. make sure this type is the same size as the target's pointer type */ -#ifndef CMOCK_MEM_PTR_AS_INT -#ifdef UNITY_POINTER_WIDTH -#ifdef UNITY_INT_WIDTH -#if UNITY_POINTER_WIDTH == UNITY_INT_WIDTH -#define CMOCK_MEM_PTR_AS_INT unsigned int -#endif -#endif -#endif -#endif - -#ifndef CMOCK_MEM_PTR_AS_INT -#ifdef UNITY_POINTER_WIDTH -#ifdef UNITY_LONG_WIDTH -#if UNITY_POINTER_WIDTH == UNITY_LONG_WIDTH -#define CMOCK_MEM_PTR_AS_INT unsigned long -#endif -#if UNITY_POINTER_WIDTH > UNITY_LONG_WIDTH -#define CMOCK_MEM_PTR_AS_INT unsigned long long -#endif -#endif -#endif -#endif - -#ifndef CMOCK_MEM_PTR_AS_INT -#define CMOCK_MEM_PTR_AS_INT unsigned long -#endif - -/* 0 for no alignment, 1 for 16-bit, 2 for 32-bit, 3 for 64-bit */ -#ifndef CMOCK_MEM_ALIGN - #ifdef UNITY_LONG_WIDTH - #if (UNITY_LONG_WIDTH == 16) - #define CMOCK_MEM_ALIGN (1) - #elif (UNITY_LONG_WIDTH == 32) - #define CMOCK_MEM_ALIGN (2) - #elif (UNITY_LONG_WIDTH == 64) - #define CMOCK_MEM_ALIGN (3) - #else - #define CMOCK_MEM_ALIGN (2) - #endif - #else - #define CMOCK_MEM_ALIGN (2) - #endif -#endif - -/* amount of memory to allow cmock to use in its internal heap */ -#ifndef CMOCK_MEM_SIZE -#define CMOCK_MEM_SIZE (32768) -#endif - -/* automatically calculated defs for easier reading */ -#define CMOCK_MEM_ALIGN_SIZE (CMOCK_MEM_INDEX_TYPE)(1u << CMOCK_MEM_ALIGN) -#define CMOCK_MEM_ALIGN_MASK (CMOCK_MEM_INDEX_TYPE)(CMOCK_MEM_ALIGN_SIZE - 1) -#define CMOCK_MEM_INDEX_SIZE (CMOCK_MEM_INDEX_TYPE)(CMOCK_MEM_PTR_AS_INT)((sizeof(CMOCK_MEM_INDEX_TYPE) > CMOCK_MEM_ALIGN_SIZE) ? sizeof(CMOCK_MEM_INDEX_TYPE) : CMOCK_MEM_ALIGN_SIZE) - - -#endif /* end of CMOCK_FRAMEWORK_INTERNALS_H */ diff --git a/components/testframework/libs/cmock/src/meson.build b/components/testframework/libs/cmock/src/meson.build deleted file mode 100644 index 0273afece..000000000 --- a/components/testframework/libs/cmock/src/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -# -# build script written by : Michael Brockus. -# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. -# -# license: MIT -# -cmock_dir = include_directories('.') - -cmock_lib = static_library(meson.project_name(), - sources: ['cmock.c'], - dependencies: [unity_dep], - include_directories: cmock_dir) diff --git a/components/testframework/libs/cmock/test/c/TestCMockC.c b/components/testframework/libs/cmock/test/c/TestCMockC.c deleted file mode 100644 index 769a2b31d..000000000 --- a/components/testframework/libs/cmock/test/c/TestCMockC.c +++ /dev/null @@ -1,333 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#include "unity.h" -#include "cmock.h" - -#define TEST_MEM_INDEX_SIZE (sizeof(CMOCK_MEM_INDEX_TYPE)) - -void setUp(void) -{ - CMock_Guts_MemFreeAll(); -} - -void tearDown(void) -{ -} - -void test_MemNewWillReturnNullIfGivenIllegalSizes(void) -{ - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNew(0) ); - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNew(CMOCK_MEM_SIZE - TEST_MEM_INDEX_SIZE + 1) ); - TEST_ASSERT_NULL( CMock_Guts_GetAddressFor(CMOCK_GUTS_NONE) ); - - //verify we're cleared still - TEST_ASSERT_LESS_OR_EQUAL_UINT32(CMOCK_MEM_SIZE, CMock_Guts_MemBytesCapacity()); - TEST_ASSERT_EQUAL_UINT32(0, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_LESS_OR_EQUAL_UINT32(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); -} - -void test_MemShouldProtectAgainstMemoryOverflow(void) -{ - (void)CMock_Guts_MemNew(CMOCK_MEM_SIZE - TEST_MEM_INDEX_SIZE); - - //verify we've used all the memory - TEST_ASSERT_LESS_OR_EQUAL_UINT32(TEST_MEM_INDEX_SIZE, CMock_Guts_MemBytesFree()); - TEST_ASSERT_GREATER_OR_EQUAL_UINT32(CMOCK_MEM_SIZE, CMock_Guts_MemBytesUsed()); -} - -void test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation(void) -{ - CMOCK_MEM_INDEX_TYPE next = CMock_Guts_MemNew(4); - TEST_ASSERT_EQUAL(4 + TEST_MEM_INDEX_SIZE, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 4 - TEST_MEM_INDEX_SIZE, CMock_Guts_MemBytesFree()); - - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemChain(next + CMOCK_MEM_SIZE, next) ); - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemChain(next, next + CMOCK_MEM_SIZE) ); - - //verify we're still the same - TEST_ASSERT_EQUAL(4 + TEST_MEM_INDEX_SIZE, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 4 - TEST_MEM_INDEX_SIZE, CMock_Guts_MemBytesFree()); -} - -void test_MemNextWillReturnNullIfGivenABadRoot(void) -{ - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(0) ); - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(2) ); - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(CMOCK_MEM_SIZE - 4) ); - - //verify we're cleared still - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); -} - -void test_ThatWeCanClaimAndChainAFewElementsTogether(void) -{ - unsigned int i; - CMOCK_MEM_INDEX_TYPE next; - CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; - CMOCK_MEM_INDEX_TYPE element[4]; - - //verify we're cleared first - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); - - //first element - element[0] = CMock_Guts_MemNew(sizeof(unsigned int)); - TEST_ASSERT_MESSAGE(element[0] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - first = CMock_Guts_MemChain(first, element[0]); - TEST_ASSERT_EQUAL(element[0], first); - *((unsigned int*)CMock_Guts_GetAddressFor(element[0])) = 0; - - //verify we're using the right amount of memory - TEST_ASSERT_EQUAL(1 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 1 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesFree()); - - //second element - element[1] = CMock_Guts_MemNew(sizeof(unsigned int)); - TEST_ASSERT_MESSAGE(element[1] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - TEST_ASSERT_NOT_EQUAL(element[0], element[1]); - TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[1])); - *((unsigned int*)CMock_Guts_GetAddressFor(element[1])) = 1; - - //verify we're using the right amount of memory - TEST_ASSERT_EQUAL(2 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 2 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesFree()); - - //third element - element[2] = CMock_Guts_MemNew(sizeof(unsigned int)); - TEST_ASSERT_MESSAGE(element[2] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - TEST_ASSERT_NOT_EQUAL(element[0], element[2]); - TEST_ASSERT_NOT_EQUAL(element[1], element[2]); - TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[2])); - *((unsigned int*)CMock_Guts_GetAddressFor(element[2])) = 2; - - //verify we're using the right amount of memory - TEST_ASSERT_EQUAL(3 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 3 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesFree()); - - //fourth element - element[3] = CMock_Guts_MemNew(sizeof(unsigned int)); - TEST_ASSERT_MESSAGE(element[3] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - TEST_ASSERT_NOT_EQUAL(element[0], element[3]); - TEST_ASSERT_NOT_EQUAL(element[1], element[3]); - TEST_ASSERT_NOT_EQUAL(element[2], element[3]); - TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[3])); - *((unsigned int*)CMock_Guts_GetAddressFor(element[3])) = 3; - - //verify we're using the right amount of memory - TEST_ASSERT_EQUAL(4 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 4 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesFree()); - - //traverse list - next = first; - for (i = 0; i < 4; i++) - { - TEST_ASSERT_EQUAL(element[i], next); - TEST_ASSERT_EQUAL(i, *((unsigned int*)CMock_Guts_GetAddressFor(element[i]))); - next = CMock_Guts_MemNext(next); - } - - //verify we get a null at the end of the list - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, next); - - //verify we're using the right amount of memory - TEST_ASSERT_EQUAL(4 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 4 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesFree()); - - //Free it all - CMock_Guts_MemFreeAll(); - - //verify we're cleared - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); -} - -void test_ThatCMockStopsReturningMoreDataWhenItRunsOutOfMemory(void) -{ - unsigned int i; - CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; - CMOCK_MEM_INDEX_TYPE next; - - //even though we are asking for one byte, we've told it to align to closest CMOCK_MEM_ALIGN_SIZE bytes, therefore it will waste a byte each time - //so each call will use (CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE) bytes (CMOCK_MEM_INDEX_SIZE for the index, 1 for the data, and (CMOCK_MEM_ALIGN_SIZE - 1) wasted). - //therefore we can safely allocated total/(CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE) times. - for (i = 0; i < (CMOCK_MEM_SIZE / (CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE)); i++) - { - TEST_ASSERT_EQUAL(i*(CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - i*(CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE), CMock_Guts_MemBytesFree()); - - next = CMock_Guts_MemNew(1); - TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - - first = CMock_Guts_MemChain(first, next); - TEST_ASSERT_MESSAGE(first != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - } - - //verify we're at top of memory - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesFree()); - - //The very next call will return a NULL, and any after that - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(1)); - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(1)); - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(1)); - - //verify nothing has changed - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesFree()); - - //verify we can still walk through the elements allocated - next = first; - for (i = 0; i < (CMOCK_MEM_SIZE / (CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE)); i++) - { - TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - next = CMock_Guts_MemNext(next); - } - - //there aren't any after that - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, (UNITY_UINT32)next); -} - -void test_ThatCMockStopsReturningMoreDataWhenAskForMoreThanItHasLeftEvenIfNotAtExactEnd(void) -{ - unsigned int i; - CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; - CMOCK_MEM_INDEX_TYPE next; - - //we're asking for (CMOCK_MEM_INDEX_SIZE + 8) bytes each time now (CMOCK_MEM_INDEX_SIZE for index, 8 for data). - //CMOCK_MEM_SIZE/(CMOCK_MEM_INDEX_SIZE + 8) requests will request as much data as possible, while ensuring that there isn't enough - //memory for the next request - for (i = 0; i < CMOCK_MEM_SIZE/(CMOCK_MEM_INDEX_SIZE + 8); i++) - { - TEST_ASSERT_EQUAL(i*(CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - i*(CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesFree()); - - next = CMock_Guts_MemNew(8); - TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - - first = CMock_Guts_MemChain(first, next); - TEST_ASSERT_MESSAGE(first != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - - //verify writing data won't screw us up - *((unsigned int*)CMock_Guts_GetAddressFor(next)) = i; - } - - //verify we're at top of memory - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - CMOCK_MEM_SIZE % (CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE % (CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesFree()); - - //The very next call will return a NONE, and any after that - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(8)); - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(5)); - - //verify nothing has changed - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - CMOCK_MEM_SIZE % (CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE % (CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesFree()); - - //verify we can still walk through the elements allocated - next = first; - for (i = 0; i < CMOCK_MEM_SIZE/(CMOCK_MEM_INDEX_SIZE + 8); i++) - { - TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - TEST_ASSERT_EQUAL(i, *((unsigned int*)CMock_Guts_GetAddressFor(next))); - next = CMock_Guts_MemNext(next); - } - - //there aren't any after that - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, next); -} - -void test_ThatWeCanAskForAllSortsOfSizes(void) -{ -#if CMOCK_MEM_ALIGN != 2 - TEST_IGNORE_MESSAGE("Test relies on a particular environmental setup, which is not present"); -#else - - unsigned int i; - CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; - CMOCK_MEM_INDEX_TYPE next; - CMOCK_MEM_INDEX_TYPE sizes[5] = {3, 1, 80, 5, 4}; - CMOCK_MEM_INDEX_TYPE sizes_buffered[5] = {4, 4, 80, 8, 4}; - CMOCK_MEM_INDEX_TYPE sum = 0; - - for (i = 0; i < 5; i++) - { - next = CMock_Guts_MemNew(sizes[i]); - TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - - first = CMock_Guts_MemChain(first, next); - TEST_ASSERT_MESSAGE(first != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - - sum += sizes_buffered[i] + 4; - TEST_ASSERT_EQUAL(sum, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - sum, CMock_Guts_MemBytesFree()); - } - - //show that we can't ask for too much memory - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(CMOCK_MEM_SIZE - sum + 8)); - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(CMOCK_MEM_SIZE - sum + 1)); - - //but we CAN ask for something that will still fit - next = CMock_Guts_MemNew(CMOCK_MEM_SIZE - sum - 4); - TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - - first = CMock_Guts_MemChain(first, next); - TEST_ASSERT_MESSAGE(first != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - - //verify we're used up now - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesFree()); - - //verify we can still walk through the elements allocated - next = first; - for (i = 0; i < 6; i++) - { - TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - next = CMock_Guts_MemNext(next); - } - - //there aren't any after that - TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, next); -#endif -} - -void test_MemEndOfChain(void) -{ - CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; - CMOCK_MEM_INDEX_TYPE element[4]; - - //verify we're cleared first - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); - - //first element - element[0] = CMock_Guts_MemNew(sizeof(unsigned int)); - first = CMock_Guts_MemChain(first, element[0]); - TEST_ASSERT_MESSAGE(element[0] == CMock_Guts_MemEndOfChain(first), "Should have returned element[0]"); - - //second element - element[1] = CMock_Guts_MemNew(sizeof(unsigned int)); - CMock_Guts_MemChain(first, element[1]); - TEST_ASSERT_MESSAGE(element[1] == CMock_Guts_MemEndOfChain(first), "Should have returned element[1]"); - - //third element - element[2] = CMock_Guts_MemNew(sizeof(unsigned int)); - CMock_Guts_MemChain(first, element[2]); - TEST_ASSERT_MESSAGE(element[2] == CMock_Guts_MemEndOfChain(first), "Should have returned element[2]"); - - //fourth element - element[3] = CMock_Guts_MemNew(sizeof(unsigned int)); - CMock_Guts_MemChain(first, element[3]); - TEST_ASSERT_MESSAGE(element[3] == CMock_Guts_MemEndOfChain(first), "Should have returned element[3]"); - - //Free it all - CMock_Guts_MemFreeAll(); - - //verify we're cleared - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); -} diff --git a/components/testframework/libs/cmock/test/c/TestCMockC.yml b/components/testframework/libs/cmock/test/c/TestCMockC.yml deleted file mode 100644 index 06067b161..000000000 --- a/components/testframework/libs/cmock/test/c/TestCMockC.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -:files: - - '../src/cmock.c' - - './c/TestCMockC.c' - - './c/TestCMockC_Runner.c' - - '../vendor/unity/src/unity.c' -:options: - - 'TEST' - - 'CMOCK_MEM_STATIC' - - 'CMOCK_MEM_SIZE=128' - #- 'CMOCK_MEM_SIZE=40000' - - 'CMOCK_MEM_ALIGN=2' - - 'CMOCK_MEM_INDEX_TYPE=int' - diff --git a/components/testframework/libs/cmock/test/c/TestCMockCDynamic.c b/components/testframework/libs/cmock/test/c/TestCMockCDynamic.c deleted file mode 100644 index b81d9d0b2..000000000 --- a/components/testframework/libs/cmock/test/c/TestCMockCDynamic.c +++ /dev/null @@ -1,186 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#include "unity.h" -#include "cmock.h" - -#define TEST_MEM_INDEX_SIZE (CMOCK_MEM_INDEX_TYPE)(sizeof(CMOCK_MEM_INDEX_TYPE)) -#define TEST_MEM_INDEX_PAD (CMOCK_MEM_INDEX_TYPE)(((CMOCK_MEM_INDEX_TYPE)sizeof(CMOCK_MEM_INDEX_TYPE) + 7) & ~7) //round up to nearest 4 byte boundary - -CMOCK_MEM_INDEX_TYPE StartingSize; - -void setUp(void) -{ - CMock_Guts_MemFreeAll(); - StartingSize = CMock_Guts_MemBytesFree(); - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); -} - -void tearDown(void) -{ -} - -void test_MemNewWillReturnNullIfGivenIllegalSizes(void) -{ - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNew(0) ); - - //verify we're cleared still - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesFree()); -} - -void test_MemNewWillNowSupportSizesGreaterThanTheDefinesCMockSize(void) -{ - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesFree()); - - TEST_ASSERT_MESSAGE(CMock_Guts_MemNew(CMOCK_MEM_SIZE - TEST_MEM_INDEX_SIZE + 1) != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - - TEST_ASSERT_EQUAL(((CMOCK_MEM_INDEX_TYPE)CMOCK_MEM_SIZE + TEST_MEM_INDEX_PAD), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL((CMOCK_MEM_INDEX_TYPE)CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); -} - -void test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation(void) -{ - CMOCK_MEM_INDEX_TYPE next = CMock_Guts_MemNew(8); - TEST_ASSERT_EQUAL(8 + TEST_MEM_INDEX_PAD, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(StartingSize - 8 - TEST_MEM_INDEX_PAD, CMock_Guts_MemBytesFree()); - - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemChain(next + CMOCK_MEM_SIZE, next) ); - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemChain(next, next + CMOCK_MEM_SIZE) ); - - //verify we're still the same - TEST_ASSERT_EQUAL(8 + TEST_MEM_INDEX_PAD, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(StartingSize - 8 - TEST_MEM_INDEX_PAD, CMock_Guts_MemBytesFree()); -} - -void test_MemNextWillReturnNullIfGivenABadRoot(void) -{ - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(0) ); - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(2) ); - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext( CMOCK_MEM_SIZE - 4 ) ); - - //verify we're cleared still - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(StartingSize, CMock_Guts_MemBytesFree()); -} - -void test_ThatWeCanClaimAndChainAFewElementsTogether(void) -{ - unsigned int i; - CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; - CMOCK_MEM_INDEX_TYPE next; - CMOCK_MEM_INDEX_TYPE element[4]; - - //verify we're cleared first - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(StartingSize, CMock_Guts_MemBytesFree()); - - //first element - element[0] = CMock_Guts_MemNew(sizeof(unsigned int)); - TEST_ASSERT_MESSAGE(element[0] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - first = CMock_Guts_MemChain(first, element[0]); - TEST_ASSERT_EQUAL(element[0], first); - *((unsigned int*)CMock_Guts_GetAddressFor(element[0])) = 0; - - //verify we're using the right amount of memory - TEST_ASSERT_EQUAL(1 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(StartingSize - 1 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesFree()); - - //second element - element[1] = CMock_Guts_MemNew(sizeof(unsigned int)); - TEST_ASSERT_MESSAGE(element[1] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - TEST_ASSERT_NOT_EQUAL(element[0], element[1]); - TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[1])); - *((unsigned int*)CMock_Guts_GetAddressFor(element[1])) = 1; - - //verify we're using the right amount of memory - TEST_ASSERT_EQUAL(2 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(StartingSize - 2 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesFree()); - - //third element - element[2] = CMock_Guts_MemNew(sizeof(unsigned int)); - TEST_ASSERT_MESSAGE(element[2] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - TEST_ASSERT_NOT_EQUAL(element[0], element[2]); - TEST_ASSERT_NOT_EQUAL(element[1], element[2]); - TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[2])); - *((unsigned int*)CMock_Guts_GetAddressFor(element[2])) = 2; - - //verify we're using the right amount of memory - TEST_ASSERT_EQUAL(3 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(StartingSize - 3 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesFree()); - - //fourth element - element[3] = CMock_Guts_MemNew(sizeof(unsigned int)); - TEST_ASSERT_MESSAGE(element[3] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - TEST_ASSERT_NOT_EQUAL(element[0], element[3]); - TEST_ASSERT_NOT_EQUAL(element[1], element[3]); - TEST_ASSERT_NOT_EQUAL(element[2], element[3]); - TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[3])); - *((unsigned int*)CMock_Guts_GetAddressFor(element[3])) = 3; - - //verify we're using the right amount of memory - TEST_ASSERT_EQUAL(4 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(StartingSize - 4 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesFree()); - - //traverse list - next = first; - for (i = 0; i < 4; i++) - { - TEST_ASSERT_EQUAL(element[i], next); - TEST_ASSERT_EQUAL(i, *((unsigned int*)CMock_Guts_GetAddressFor(element[i]))); - next = CMock_Guts_MemNext(next); - } - - //verify we get a null at the end of the list - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, next); - - //verify we're using the right amount of memory - TEST_ASSERT_EQUAL(4 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(StartingSize - 4 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesFree()); - - //Free it all - CMock_Guts_MemFreeAll(); - - //verify we're cleared - TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); - TEST_ASSERT_EQUAL(StartingSize, CMock_Guts_MemBytesFree()); -} - -void test_ThatWeCanAskForAllSortsOfSizes(void) -{ - CMOCK_MEM_INDEX_TYPE i; - CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; - CMOCK_MEM_INDEX_TYPE next; - CMOCK_MEM_INDEX_TYPE sizes[10] = {3, 1, 80, 5, 8, 31, 7, 911, 2, 80}; - CMOCK_MEM_INDEX_TYPE sizes_buffered[10] = {16, 16, 88, 16, 16, 40, 16, 920, 16, 88}; //includes counter - CMOCK_MEM_INDEX_TYPE sum = 0; - CMOCK_MEM_INDEX_TYPE cap; - - for (i = 0; i < 10; i++) - { - next = CMock_Guts_MemNew(sizes[i]); - TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - - first = CMock_Guts_MemChain(first, next); - TEST_ASSERT_MESSAGE(first != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - - sum += sizes_buffered[i]; - cap = (StartingSize > (sum + CMOCK_MEM_SIZE)) ? StartingSize : (sum + CMOCK_MEM_SIZE); - TEST_ASSERT_EQUAL(sum, CMock_Guts_MemBytesUsed()); - TEST_ASSERT(cap >= CMock_Guts_MemBytesFree()); - } - - //verify we can still walk through the elements allocated - next = first; - for (i = 0; i < 10; i++) - { - TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); - next = CMock_Guts_MemNext(next); - } - - //there aren't any after that - TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, next); -} diff --git a/components/testframework/libs/cmock/test/c/TestCMockCDynamic.yml b/components/testframework/libs/cmock/test/c/TestCMockCDynamic.yml deleted file mode 100644 index 393d8dd86..000000000 --- a/components/testframework/libs/cmock/test/c/TestCMockCDynamic.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -:files: - - '../src/cmock.c' - - './c/TestCMockCDynamic.c' - - './c/TestCMockCDynamic_Runner.c' - - '../vendor/unity/src/unity.c' -:options: - - 'TEST' - - 'CMOCK_MEM_DYNAMIC' - - 'CMOCK_MEM_SIZE=64' - - 'CMOCK_MEM_ALIGN=3' - - 'CMOCK_MEM_INDEX_TYPE=short' diff --git a/components/testframework/libs/cmock/test/c/TestCMockCDynamic_Runner.c b/components/testframework/libs/cmock/test/c/TestCMockCDynamic_Runner.c deleted file mode 100644 index d68608091..000000000 --- a/components/testframework/libs/cmock/test/c/TestCMockCDynamic_Runner.c +++ /dev/null @@ -1,36 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#include "unity.h" -#include "cmock.h" -#include -#include - -extern void setUp(void); -extern void tearDown(void); - -extern void test_MemNewWillReturnNullIfGivenIllegalSizes(void); -extern void test_MemNewWillNowSupportSizesGreaterThanTheDefinesCMockSize(void); -extern void test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation(void); -extern void test_MemNextWillReturnNullIfGivenABadRoot(void); -extern void test_ThatWeCanClaimAndChainAFewElementsTogether(void); -extern void test_ThatWeCanAskForAllSortsOfSizes(void); - -int main(void) -{ - UnityBegin("TestCMockDynamic.c"); - - RUN_TEST(test_MemNewWillReturnNullIfGivenIllegalSizes, 26); - RUN_TEST(test_MemNewWillNowSupportSizesGreaterThanTheDefinesCMockSize, 35); - RUN_TEST(test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation, 45); - RUN_TEST(test_MemNextWillReturnNullIfGivenABadRoot, 59); - RUN_TEST(test_ThatWeCanClaimAndChainAFewElementsTogether, 70); - RUN_TEST(test_ThatWeCanAskForAllSortsOfSizes, 152); - - UnityEnd(); - CMock_Guts_MemFreeFinal(); - return 0; -} diff --git a/components/testframework/libs/cmock/test/c/TestCMockC_Runner.c b/components/testframework/libs/cmock/test/c/TestCMockC_Runner.c deleted file mode 100644 index af559d8f4..000000000 --- a/components/testframework/libs/cmock/test/c/TestCMockC_Runner.c +++ /dev/null @@ -1,41 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#include "unity.h" -#include -#include - -extern void setUp(void); -extern void tearDown(void); - -extern void test_MemNewWillReturnNullIfGivenIllegalSizes(void); -extern void test_MemShouldProtectAgainstMemoryOverflow(void); -extern void test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation(void); -extern void test_MemNextWillReturnNullIfGivenABadRoot(void); -extern void test_ThatWeCanClaimAndChainAFewElementsTogether(void); -extern void test_MemEndOfChain(void); -extern void test_ThatCMockStopsReturningMoreDataWhenItRunsOutOfMemory(void); -extern void test_ThatCMockStopsReturningMoreDataWhenAskForMoreThanItHasLeftEvenIfNotAtExactEnd(void); -extern void test_ThatWeCanAskForAllSortsOfSizes(void); - -int main(void) -{ - Unity.TestFile = "TestCMock.c"; - UnityBegin(Unity.TestFile); - - RUN_TEST(test_MemNewWillReturnNullIfGivenIllegalSizes, 21); - RUN_TEST(test_MemShouldProtectAgainstMemoryOverflow, 33); - RUN_TEST(test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation, 42); - RUN_TEST(test_MemNextWillReturnNullIfGivenABadRoot, 56); - RUN_TEST(test_ThatWeCanClaimAndChainAFewElementsTogether, 67); - RUN_TEST(test_MemEndOfChain, 149); - RUN_TEST(test_ThatCMockStopsReturningMoreDataWhenItRunsOutOfMemory, 195); - RUN_TEST(test_ThatCMockStopsReturningMoreDataWhenAskForMoreThanItHasLeftEvenIfNotAtExactEnd, 244); - RUN_TEST(test_ThatWeCanAskForAllSortsOfSizes, 298); - - UnityEnd(); - return 0; -} diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_FLASH.mac b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_FLASH.mac deleted file mode 100644 index 7c4021aad..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_FLASH.mac +++ /dev/null @@ -1,71 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : SAM7_FLASH.mac -// Object : Generic Macro File for IAR -// 1.0 17/Aug/05 FBr : Creation -// ---------------------------------------------------------------------------- - -/********************************************************************* -* -* _InitRSTC() -* -* Function description -* Initializes the RSTC (Reset controller). -* This makes sense since the default is to not allow user resets, which makes it impossible to -* apply a second RESET via J-Link -*/ -_InitRSTC() { - __writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset -} - -/********************************************************************* -* -* _InitPLL() -* Function description -* Initializes the PMC. -* 1. Enable the Main Oscillator -* 2. Configure PLL to 96MHz -* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz -*/ - _InitPLL() { - - __message "Enable Main Oscillator"; - __writeMemory32(0x00000601,0xFFFFFc20,"Memory"); // MOSC - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) ); - - __message "Set PLL to 96MHz"; - __writeMemory32(0x10191c05,0xFFFFFc2c,"Memory"); // LOCK - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) ); - - __message "Set Master Clock to 48MHz"; - __writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); - __writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); -} - -/********************************************************************* -* -* execUserReset() : JTAG set initially to Full Speed -*/ -execUserReset() { - __message "execUserReset()"; - __emulatorSpeed(30000); // Set JTAG speed to 30kHz to make a hardware reset - __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz) - _InitPLL(); // Allow to debug at JTAG Full Speed - _InitRSTC(); // Enable User Reset to allow execUserReset() execution - __emulatorSpeed(0); // Set JTAG speed to full speed -} - diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_RAM.mac b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_RAM.mac deleted file mode 100644 index a1bf81dc7..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_RAM.mac +++ /dev/null @@ -1,94 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : SAM7_RAM.mac -// Object : Generic Macro File for IAR -// 1.0 17/Aug/05 FBr : Creation -// ---------------------------------------------------------------------------- - -/********************************************************************* -* -* _MapRAMAt0() -* -* Function description -* Maps RAM at 0. -*/ -_MapRAMAt0(){ - __message "Changing mapping: RAM mapped to 0"; - __writeMemory32(0x00000001,0xFFFFFF00,"Memory"); -} - -/********************************************************************* -* -* _InitRSTC() -* -* Function description -* Initializes the RSTC (Reset controller). -* This makes sense since the default is to not allow user resets, which makes it impossible to -* apply a second RESET via J-Link -*/ -_InitRSTC() { - __writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset -} - -/********************************************************************* -* -* _InitPLL() -* Function description -* Initializes the PMC. -* 1. Enable the Main Oscillator -* 2. Configure PLL to 96MHz -* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz -*/ - _InitPLL() { - - __message "Set Main Oscillator"; - __writeMemory32(0x00004001,0xFFFFFc20,"Memory"); // MOSC - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) ); - - __message "Set PLL to 96MHz"; - __writeMemory32(0x10483f0e,0xFFFFFc2c,"Memory"); // LOCK - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) ); - - __message "Set Master Clock to 48MHz"; - __writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); - __writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); -} - -/********************************************************************* -* -* execUserReset() : JTAG set initially to Full Speed -*/ -execUserReset() { - __message "execUserReset()"; - __emulatorSpeed(30000); // Set JTAG speed to 30kHz to make a hardware reset - __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset - _InitPLL(); // Allow to debug at JTAG Full Speed - _MapRAMAt0(); // Remap RAM to address 0 - __emulatorSpeed(0); // Set JTAG speed to full speed -} - -/********************************************************************* -* -* execUserPreload() : JTAG set initially to 32kHz -*/ -execUserPreload() { - __message "execUserPreload()"; - __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz) - _InitPLL(); // Allow to load Code at JTAG Full Speed - _MapRAMAt0(); // Remap RAM to address 0 - _InitRSTC(); // Enable User Reset to allow execUserReset() execution -} diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_SIM.mac b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_SIM.mac deleted file mode 100644 index 2be1a4c9b..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_SIM.mac +++ /dev/null @@ -1,67 +0,0 @@ -//========================================================= -// Simulation setup file for esc07_demo project -//========================================================= - -__var _timer0_interrupt_ID; - -irqBreak() -{ - __var __AIC_SMR; - __var __AIC_IECR; - __var __AIC_IVR; - - // read AIC_IECR instead, since not fully supported by simulator - __AIC_IECR = __readMemory32(0xFFFFF120, "Memory"); - if(__AIC_IECR & 0x1000) - { - __AIC_SMR = __readMemory32(0xFFFFF060, "Memory"); - __AIC_IVR = __readMemory32(0xFFFFF0B0, "Memory"); //AIC_IVR = AIC_SVR[x] - __writeMemory32(__AIC_IVR, 0xFFFFF100, "Memory"); //AIC_IVR - __writeMemory32(0x1000, 0xFFFFF10C, "Memory"); //AIC_IPR - __writeMemory32(0x2, 0xFFFFF114, "Memory"); //AIC_CISR - } - - return 0; -} - -setupProcessorRegisters() -{ - // Write TC0_SR.CPCS with correct status for ISR (Clock enabled; RC Compare Flag = TRUE) - __writeMemory32(0x00010010, 0xfffa0020, "Memory"); - - // Set TX ready flag in USART0 status register - // USART0_BASE->US_CSR = AT91C_US_TXRDY - __writeMemory32(0x00000002, 0xfffc0014, "Memory"); -} - -configureTimer0Interrupt() -{ - __var _master_clock_frequency; - __var _timer0_period_cycles; - - // Calculate timer0 frequency in master clock cycles - _master_clock_frequency = 48054857; - _timer0_period_cycles = _master_clock_frequency / 100; - if((_master_clock_frequency % 100) >= 50) - { - _timer0_period_cycles++; - } - - __cancelAllInterrupts(); - __enableInterrupts(); - - _timer0_interrupt_ID = __orderInterrupt("IRQ", _timer0_period_cycles, _timer0_period_cycles, 0, 0, 0, 100); - - if(-1 == _timer0_interrupt_ID) - { - __message "ERROR: failed to order timer 0 interrupt"; - } - - __setCodeBreak("0x18", 0, "irqBreak()", "TRUE", ""); -} - -execUserReset() -{ - setupProcessorRegisters(); - configureTimer0Interrupt(); -} diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_FLASH.xcl b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_FLASH.xcl deleted file mode 100644 index 02eaec7dc..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_FLASH.xcl +++ /dev/null @@ -1,185 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : at91SAM7X256_FLASH.xcl -// Object : Generic Linker Command File for IAR -// 1.0 30/Aug/05 FBr : Creation for 4.30A -// ---------------------------------------------------------------------------- - -//************************************************************************* -// XLINK command file template for EWARM/ICCARM -// -// Usage: xlink -f lnkarm -// -s -//************************************************************************* -// -// ------------- -// Code segments - may be placed anywhere in memory. -// ------------- -// -// INTVEC -- Exception vector table. -// SWITAB -- Software interrupt vector table. -// ICODE -- Startup (cstartup) and exception code. -// DIFUNCT -- Dynamic initialization vectors used by C++. -// CODE -- Compiler generated code. -// CODE_I -- Compiler generated code declared __ramfunc (executes in RAM) -// CODE_ID -- Initializer for CODE_I (ROM). -// -// ------------- -// Data segments - may be placed anywhere in memory. -// ------------- -// -// CSTACK -- The stack used by C/C++ programs (system and user mode). -// IRQ_STACK -- The stack used by IRQ service routines. -// SVC_STACK -- The stack used in supervisor mode -// (Define other exception stacks as needed for -// FIQ, ABT, UND). -// HEAP -- The heap used by malloc and free in C and new and -// delete in C++. -// INITTAB -- Table containing addresses and sizes of segments that -// need to be initialized at startup (by cstartup). -// CHECKSUM -- The linker places checksum byte(s) in this segment, -// when the -J linker command line option is used. -// DATA_y -- Data objects. -// -// Where _y can be one of: -// -// _AN -- Holds uninitialized located objects, i.e. objects with -// an absolute location given by the @ operator or the -// #pragma location directive. Since these segments -// contain objects which already have a fixed address, -// they should not be mentioned in this linker command -// file. -// _C -- Constants (ROM). -// _I -- Initialized data (RAM). -// _ID -- The original content of _I (copied to _I by cstartup) (ROM). -// _N -- Uninitialized data (RAM). -// _Z -- Zero initialized data (RAM). -// -// Note: Be sure to use end values for the defined address ranges. -// Otherwise, the linker may allocate space outside the -// intended memory range. -//************************************************************************* - -//************************************************************************* -// Inform the linker about the CPU family used. -// AT91SAM7X256 Memory mapping -// No remap -// ROMSTART -// Start address 0x0000 0000 -// Size 256 Kbo 0x0004 0000 -// RAMSTART -// Start address 0x0020 0000 -// Size 64 Kbo 0x0001 0000 -// Remap done -// RAMSTART -// Start address 0x0000 0000 -// Size 64 Kbo 0x0001 0000 -// ROMSTART -// Start address 0x0010 0000 -// Size 256 Kbo 0x0004 0000 - -//************************************************************************* --carm - -//************************************************************************* -// Internal Ram segments mapped AFTER REMAP 64 K. -//************************************************************************* --Z(CONST)INTRAMSTART_REMAP=00200000 --Z(CONST)INTRAMEND_REMAP=0020FFFF - -//************************************************************************* -// Read-only segments mapped to Flash 256 K. -//************************************************************************* --DROMSTART=00000000 --DROMEND=0003FFFF -//************************************************************************* -// Read/write segments mapped to 64 K RAM. -//************************************************************************* --DRAMSTART=00200000 --DRAMEND=0020FFFF - -//************************************************************************* -// Address range for reset and exception -// vectors (INTVEC). -// The vector area is 32 bytes, -// an additional 32 bytes is allocated for the -// constant table used by ldr PC in cstartup.s79. -//************************************************************************* --Z(CODE)INTVEC=00-3F - -//************************************************************************* -// Startup code and exception routines (ICODE). -//************************************************************************* --Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND --Z(CODE)SWITAB=ROMSTART-ROMEND - -//************************************************************************* -// Code segments may be placed anywhere. -//************************************************************************* --Z(CODE)CODE=ROMSTART-ROMEND - -//************************************************************************* -// Various constants and initializers. -//************************************************************************* --Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND --Z(CONST)CHECKSUM=ROMSTART-ROMEND - -//************************************************************************* -// Data segments. -//************************************************************************* --Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND - -//************************************************************************* -// __ramfunc code copied to and executed from RAM. -//************************************************************************* --Z(DATA)CODE_I=RAMSTART-RAMEND --Z(CONST)CODE_ID=ROMSTART-ROMEND // Initializer for --QCODE_I=CODE_ID - -//************************************************************************* -// ICCARM produces code for __ramfunc functions in -// CODE_I segments. The -Q XLINK command line -// option redirects XLINK to emit the code in the -// debug information associated with the CODE_I -// segment, where the code will execute. -//************************************************************************* - -//************************************************************************* -// Stack and heap segments. -//************************************************************************* --D_CSTACK_SIZE=(100*4) --D_IRQ_STACK_SIZE=(3*8*4) --D_HEAP_SIZE=(1024*1) - --Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND --Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE=RAMSTART-RAMEND --Z(DATA)HEAP+_HEAP_SIZE=RAMSTART-RAMEND - -//************************************************************************* -// ELF/DWARF support. -// -// Uncomment the line "-Felf" below to generate ELF/DWARF output. -// Available format specifiers are: -// -// "-yn": Suppress DWARF debug output -// "-yp": Multiple ELF program sections -// "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag) -// -// "-Felf" and the format specifiers can also be supplied directly as -// command line options, or selected from the Xlink Output tab in the -// IAR Embedded Workbench. -//************************************************************************* - -// -Felf diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_RAM.xcl b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_RAM.xcl deleted file mode 100644 index adcec108e..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_RAM.xcl +++ /dev/null @@ -1,185 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : at91SAM7X256_RAM.xcl -// Object : Generic Linker Command File for IAR -// 1.0 30/Aug/05 FBr : Creation for 4.30A -// ---------------------------------------------------------------------------- - -//************************************************************************* -// XLINK command file template for EWARM/ICCARM -// -// Usage: xlink -f lnkarm -// -s -//************************************************************************* -// -// ------------- -// Code segments - may be placed anywhere in memory. -// ------------- -// -// INTVEC -- Exception vector table. -// SWITAB -- Software interrupt vector table. -// ICODE -- Startup (cstartup) and exception code. -// DIFUNCT -- Dynamic initialization vectors used by C++. -// CODE -- Compiler generated code. -// CODE_I -- Compiler generated code declared __ramfunc (executes in RAM) -// CODE_ID -- Initializer for CODE_I (ROM). -// -// ------------- -// Data segments - may be placed anywhere in memory. -// ------------- -// -// CSTACK -- The stack used by C/C++ programs (system and user mode). -// IRQ_STACK -- The stack used by IRQ service routines. -// SVC_STACK -- The stack used in supervisor mode -// (Define other exception stacks as needed for -// FIQ, ABT, UND). -// HEAP -- The heap used by malloc and free in C and new and -// delete in C++. -// INITTAB -- Table containing addresses and sizes of segments that -// need to be initialized at startup (by cstartup). -// CHECKSUM -- The linker places checksum byte(s) in this segment, -// when the -J linker command line option is used. -// DATA_y -- Data objects. -// -// Where _y can be one of: -// -// _AN -- Holds uninitialized located objects, i.e. objects with -// an absolute location given by the @ operator or the -// #pragma location directive. Since these segments -// contain objects which already have a fixed address, -// they should not be mentioned in this linker command -// file. -// _C -- Constants (ROM). -// _I -- Initialized data (RAM). -// _ID -- The original content of _I (copied to _I by cstartup) (ROM). -// _N -- Uninitialized data (RAM). -// _Z -- Zero initialized data (RAM). -// -// Note: Be sure to use end values for the defined address ranges. -// Otherwise, the linker may allocate space outside the -// intended memory range. -//************************************************************************* - -//************************************************************************* -// Inform the linker about the CPU family used. -// AT91SAM7X256 Memory mapping -// No remap -// ROMSTART -// Start address 0x0000 0000 -// Size 256 Kbo 0x0004 0000 -// RAMSTART -// Start address 0x0020 0000 -// Size 64 Kbo 0x0001 0000 -// Remap done -// RAMSTART -// Start address 0x0000 0000 -// Size 64 Kbo 0x0001 0000 -// ROMSTART -// Start address 0x0010 0000 -// Size 256 Kbo 0x0004 0000 - -//************************************************************************* --carm - -//************************************************************************* -// Internal Ram segments mapped AFTER REMAP 64 K. -//************************************************************************* --Z(CONST)INTRAMSTART_REMAP=00000000 --Z(CONST)INTRAMEND_REMAP=0000FFFF - -//************************************************************************* -// Read-only segments mapped to Flash 256 K. -//************************************************************************* --DROMSTART=00000000 --DROMEND=0003FFFF -//************************************************************************* -// Read/write segments mapped to 64 K RAM. -//************************************************************************* --DRAMSTART=00000000 --DRAMEND=0000FFFF - -//************************************************************************* -// Address range for reset and exception -// vectors (INTVEC). -// The vector area is 32 bytes, -// an additional 32 bytes is allocated for the -// constant table used by ldr PC in cstartup.s79. -//************************************************************************* --Z(CODE)INTVEC=00-3F - -//************************************************************************* -// Startup code and exception routines (ICODE). -//************************************************************************* --Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND --Z(CODE)SWITAB=ROMSTART-ROMEND - -//************************************************************************* -// Code segments may be placed anywhere. -//************************************************************************* --Z(CODE)CODE=ROMSTART-ROMEND - -//************************************************************************* -// Various constants and initializers. -//************************************************************************* --Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND --Z(CONST)CHECKSUM=ROMSTART-ROMEND - -//************************************************************************* -// Data segments. -//************************************************************************* --Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND - -//************************************************************************* -// __ramfunc code copied to and executed from RAM. -//************************************************************************* --Z(DATA)CODE_I=RAMSTART-RAMEND --Z(CONST)CODE_ID=ROMSTART-ROMEND // Initializer for --QCODE_I=CODE_ID - -//************************************************************************* -// ICCARM produces code for __ramfunc functions in -// CODE_I segments. The -Q XLINK command line -// option redirects XLINK to emit the code in the -// debug information associated with the CODE_I -// segment, where the code will execute. -//************************************************************************* - -//************************************************************************* -// Stack and heap segments. -//************************************************************************* --D_CSTACK_SIZE=(100*4) --D_IRQ_STACK_SIZE=(3*8*4) --D_HEAP_SIZE=(1024*2) - --Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND --Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE=RAMSTART-RAMEND --Z(DATA)HEAP+_HEAP_SIZE=RAMSTART-RAMEND - -//************************************************************************* -// ELF/DWARF support. -// -// Uncomment the line "-Felf" below to generate ELF/DWARF output. -// Available format specifiers are: -// -// "-yn": Suppress DWARF debug output -// "-yp": Multiple ELF program sections -// "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag) -// -// "-Felf" and the format specifiers can also be supplied directly as -// command line options, or selected from the Xlink Output tab in the -// IAR Embedded Workbench. -//************************************************************************* - -// -Felf diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/ioat91sam7x256.ddf b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/ioat91sam7x256.ddf deleted file mode 100644 index c9fcf323f..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/ioat91sam7x256.ddf +++ /dev/null @@ -1,2259 +0,0 @@ -; ---------------------------------------------------------------------------- -; ATMEL Microcontroller Software Support - ROUSSET - -; ---------------------------------------------------------------------------- -; DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -; DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.ddf -; Object : AT91SAM7X256 definitions -; Generated : AT91 SW Application Group 11/02/2005 (15:17:30) -; -; CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// -; CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// -; CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// -; CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// -; CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// -; CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// -; CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// -; CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// -; CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// -; CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// -; CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// -; CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// -; CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// -; CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// -; CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// -; CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// -; CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// -; CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// -; CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// -; CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// -; CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// -; CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// -; CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// -; ---------------------------------------------------------------------------- - -[Sfr] - -; ========== Register definition for SYS peripheral ========== -; ========== Register definition for AIC peripheral ========== -sfr = "AIC_SMR", "Memory", 0xfffff000, 4, base=16 -sfr = "AIC_SMR.PRIOR", "Memory", 0xfffff000, 4, base=16, bitRange=0-2 -sfr = "AIC_SMR.SRCTYPE", "Memory", 0xfffff000, 4, base=16, bitRange=5-6 -sfr = "AIC_SVR", "Memory", 0xfffff080, 4, base=16 -sfr = "AIC_IVR", "Memory", 0xfffff100, 4, base=16 -sfr = "AIC_FVR", "Memory", 0xfffff104, 4, base=16 -sfr = "AIC_ISR", "Memory", 0xfffff108, 4, base=16 -sfr = "AIC_IPR", "Memory", 0xfffff10c, 4, base=16 -sfr = "AIC_IMR", "Memory", 0xfffff110, 4, base=16 -sfr = "AIC_CISR", "Memory", 0xfffff114, 4, base=16 -sfr = "AIC_CISR.NFIQ", "Memory", 0xfffff114, 4, base=16, bitRange=0 -sfr = "AIC_CISR.NIRQ", "Memory", 0xfffff114, 4, base=16, bitRange=1 -sfr = "AIC_IECR", "Memory", 0xfffff120, 4, base=16 -sfr = "AIC_IDCR", "Memory", 0xfffff124, 4, base=16 -sfr = "AIC_ICCR", "Memory", 0xfffff128, 4, base=16 -sfr = "AIC_ISCR", "Memory", 0xfffff12c, 4, base=16 -sfr = "AIC_EOICR", "Memory", 0xfffff130, 4, base=16 -sfr = "AIC_SPU", "Memory", 0xfffff134, 4, base=16 -sfr = "AIC_DCR", "Memory", 0xfffff138, 4, base=16 -sfr = "AIC_DCR.PROT", "Memory", 0xfffff138, 4, base=16, bitRange=0 -sfr = "AIC_DCR.GMSK", "Memory", 0xfffff138, 4, base=16, bitRange=1 -sfr = "AIC_FFER", "Memory", 0xfffff140, 4, base=16 -sfr = "AIC_FFDR", "Memory", 0xfffff144, 4, base=16 -sfr = "AIC_FFSR", "Memory", 0xfffff148, 4, base=16 -; ========== Register definition for PDC_DBGU peripheral ========== -sfr = "DBGU_RPR", "Memory", 0xfffff300, 4, base=16 -sfr = "DBGU_RCR", "Memory", 0xfffff304, 4, base=16 -sfr = "DBGU_TPR", "Memory", 0xfffff308, 4, base=16 -sfr = "DBGU_TCR", "Memory", 0xfffff30c, 4, base=16 -sfr = "DBGU_RNPR", "Memory", 0xfffff310, 4, base=16 -sfr = "DBGU_RNCR", "Memory", 0xfffff314, 4, base=16 -sfr = "DBGU_TNPR", "Memory", 0xfffff318, 4, base=16 -sfr = "DBGU_TNCR", "Memory", 0xfffff31c, 4, base=16 -sfr = "DBGU_PTCR", "Memory", 0xfffff320, 4, base=16 -sfr = "DBGU_PTCR.RXTEN", "Memory", 0xfffff320, 4, base=16, bitRange=0 -sfr = "DBGU_PTCR.RXTDIS", "Memory", 0xfffff320, 4, base=16, bitRange=1 -sfr = "DBGU_PTCR.TXTEN", "Memory", 0xfffff320, 4, base=16, bitRange=8 -sfr = "DBGU_PTCR.TXTDIS", "Memory", 0xfffff320, 4, base=16, bitRange=9 -sfr = "DBGU_PTSR", "Memory", 0xfffff324, 4, base=16 -sfr = "DBGU_PTSR.RXTEN", "Memory", 0xfffff324, 4, base=16, bitRange=0 -sfr = "DBGU_PTSR.TXTEN", "Memory", 0xfffff324, 4, base=16, bitRange=8 -; ========== Register definition for DBGU peripheral ========== -sfr = "DBGU_CR", "Memory", 0xfffff200, 4, base=16 -sfr = "DBGU_CR.RSTRX", "Memory", 0xfffff200, 4, base=16, bitRange=2 -sfr = "DBGU_CR.RSTTX", "Memory", 0xfffff200, 4, base=16, bitRange=3 -sfr = "DBGU_CR.RXEN", "Memory", 0xfffff200, 4, base=16, bitRange=4 -sfr = "DBGU_CR.RXDIS", "Memory", 0xfffff200, 4, base=16, bitRange=5 -sfr = "DBGU_CR.TXEN", "Memory", 0xfffff200, 4, base=16, bitRange=6 -sfr = "DBGU_CR.TXDIS", "Memory", 0xfffff200, 4, base=16, bitRange=7 -sfr = "DBGU_CR.RSTSTA", "Memory", 0xfffff200, 4, base=16, bitRange=8 -sfr = "DBGU_MR", "Memory", 0xfffff204, 4, base=16 -sfr = "DBGU_MR.PAR", "Memory", 0xfffff204, 4, base=16, bitRange=9-11 -sfr = "DBGU_MR.CHMODE", "Memory", 0xfffff204, 4, base=16, bitRange=14-15 -sfr = "DBGU_IER", "Memory", 0xfffff208, 4, base=16 -sfr = "DBGU_IER.RXRDY", "Memory", 0xfffff208, 4, base=16, bitRange=0 -sfr = "DBGU_IER.TXRDY", "Memory", 0xfffff208, 4, base=16, bitRange=1 -sfr = "DBGU_IER.ENDRX", "Memory", 0xfffff208, 4, base=16, bitRange=3 -sfr = "DBGU_IER.ENDTX", "Memory", 0xfffff208, 4, base=16, bitRange=4 -sfr = "DBGU_IER.OVRE", "Memory", 0xfffff208, 4, base=16, bitRange=5 -sfr = "DBGU_IER.FRAME", "Memory", 0xfffff208, 4, base=16, bitRange=6 -sfr = "DBGU_IER.PARE", "Memory", 0xfffff208, 4, base=16, bitRange=7 -sfr = "DBGU_IER.TXEMPTY", "Memory", 0xfffff208, 4, base=16, bitRange=9 -sfr = "DBGU_IER.TXBUFE", "Memory", 0xfffff208, 4, base=16, bitRange=11 -sfr = "DBGU_IER.RXBUFF", "Memory", 0xfffff208, 4, base=16, bitRange=12 -sfr = "DBGU_IER.TX", "Memory", 0xfffff208, 4, base=16, bitRange=30 -sfr = "DBGU_IER.RX", "Memory", 0xfffff208, 4, base=16, bitRange=31 -sfr = "DBGU_IDR", "Memory", 0xfffff20c, 4, base=16 -sfr = "DBGU_IDR.RXRDY", "Memory", 0xfffff20c, 4, base=16, bitRange=0 -sfr = "DBGU_IDR.TXRDY", "Memory", 0xfffff20c, 4, base=16, bitRange=1 -sfr = "DBGU_IDR.ENDRX", "Memory", 0xfffff20c, 4, base=16, bitRange=3 -sfr = "DBGU_IDR.ENDTX", "Memory", 0xfffff20c, 4, base=16, bitRange=4 -sfr = "DBGU_IDR.OVRE", "Memory", 0xfffff20c, 4, base=16, bitRange=5 -sfr = "DBGU_IDR.FRAME", "Memory", 0xfffff20c, 4, base=16, bitRange=6 -sfr = "DBGU_IDR.PARE", "Memory", 0xfffff20c, 4, base=16, bitRange=7 -sfr = "DBGU_IDR.TXEMPTY", "Memory", 0xfffff20c, 4, base=16, bitRange=9 -sfr = "DBGU_IDR.TXBUFE", "Memory", 0xfffff20c, 4, base=16, bitRange=11 -sfr = "DBGU_IDR.RXBUFF", "Memory", 0xfffff20c, 4, base=16, bitRange=12 -sfr = "DBGU_IDR.TX", "Memory", 0xfffff20c, 4, base=16, bitRange=30 -sfr = "DBGU_IDR.RX", "Memory", 0xfffff20c, 4, base=16, bitRange=31 -sfr = "DBGU_IMR", "Memory", 0xfffff210, 4, base=16 -sfr = "DBGU_IMR.RXRDY", "Memory", 0xfffff210, 4, base=16, bitRange=0 -sfr = "DBGU_IMR.TXRDY", "Memory", 0xfffff210, 4, base=16, bitRange=1 -sfr = "DBGU_IMR.ENDRX", "Memory", 0xfffff210, 4, base=16, bitRange=3 -sfr = "DBGU_IMR.ENDTX", "Memory", 0xfffff210, 4, base=16, bitRange=4 -sfr = "DBGU_IMR.OVRE", "Memory", 0xfffff210, 4, base=16, bitRange=5 -sfr = "DBGU_IMR.FRAME", "Memory", 0xfffff210, 4, base=16, bitRange=6 -sfr = "DBGU_IMR.PARE", "Memory", 0xfffff210, 4, base=16, bitRange=7 -sfr = "DBGU_IMR.TXEMPTY", "Memory", 0xfffff210, 4, base=16, bitRange=9 -sfr = "DBGU_IMR.TXBUFE", "Memory", 0xfffff210, 4, base=16, bitRange=11 -sfr = "DBGU_IMR.RXBUFF", "Memory", 0xfffff210, 4, base=16, bitRange=12 -sfr = "DBGU_IMR.TX", "Memory", 0xfffff210, 4, base=16, bitRange=30 -sfr = "DBGU_IMR.RX", "Memory", 0xfffff210, 4, base=16, bitRange=31 -sfr = "DBGU_CSR", "Memory", 0xfffff214, 4, base=16 -sfr = "DBGU_CSR.RXRDY", "Memory", 0xfffff214, 4, base=16, bitRange=0 -sfr = "DBGU_CSR.TXRDY", "Memory", 0xfffff214, 4, base=16, bitRange=1 -sfr = "DBGU_CSR.ENDRX", "Memory", 0xfffff214, 4, base=16, bitRange=3 -sfr = "DBGU_CSR.ENDTX", "Memory", 0xfffff214, 4, base=16, bitRange=4 -sfr = "DBGU_CSR.OVRE", "Memory", 0xfffff214, 4, base=16, bitRange=5 -sfr = "DBGU_CSR.FRAME", "Memory", 0xfffff214, 4, base=16, bitRange=6 -sfr = "DBGU_CSR.PARE", "Memory", 0xfffff214, 4, base=16, bitRange=7 -sfr = "DBGU_CSR.TXEMPTY", "Memory", 0xfffff214, 4, base=16, bitRange=9 -sfr = "DBGU_CSR.TXBUFE", "Memory", 0xfffff214, 4, base=16, bitRange=11 -sfr = "DBGU_CSR.RXBUFF", "Memory", 0xfffff214, 4, base=16, bitRange=12 -sfr = "DBGU_CSR.TX", "Memory", 0xfffff214, 4, base=16, bitRange=30 -sfr = "DBGU_CSR.RX", "Memory", 0xfffff214, 4, base=16, bitRange=31 -sfr = "DBGU_RHR", "Memory", 0xfffff218, 4, base=16 -sfr = "DBGU_THR", "Memory", 0xfffff21c, 4, base=16 -sfr = "DBGU_BRGR", "Memory", 0xfffff220, 4, base=16 -sfr = "DBGU_CIDR", "Memory", 0xfffff240, 4, base=16 -sfr = "DBGU_EXID", "Memory", 0xfffff244, 4, base=16 -sfr = "DBGU_FNTR", "Memory", 0xfffff248, 4, base=16 -sfr = "DBGU_FNTR.NTRST", "Memory", 0xfffff248, 4, base=16, bitRange=0 -; ========== Register definition for PIOA peripheral ========== -sfr = "PIOA_PER", "Memory", 0xfffff400, 4, base=16 -sfr = "PIOA_PDR", "Memory", 0xfffff404, 4, base=16 -sfr = "PIOA_PSR", "Memory", 0xfffff408, 4, base=16 -sfr = "PIOA_OER", "Memory", 0xfffff410, 4, base=16 -sfr = "PIOA_ODR", "Memory", 0xfffff414, 4, base=16 -sfr = "PIOA_OSR", "Memory", 0xfffff418, 4, base=16 -sfr = "PIOA_IFER", "Memory", 0xfffff420, 4, base=16 -sfr = "PIOA_IFDR", "Memory", 0xfffff424, 4, base=16 -sfr = "PIOA_IFSR", "Memory", 0xfffff428, 4, base=16 -sfr = "PIOA_SODR", "Memory", 0xfffff430, 4, base=16 -sfr = "PIOA_CODR", "Memory", 0xfffff434, 4, base=16 -sfr = "PIOA_ODSR", "Memory", 0xfffff438, 4, base=16 -sfr = "PIOA_PDSR", "Memory", 0xfffff43c, 4, base=16 -sfr = "PIOA_IER", "Memory", 0xfffff440, 4, base=16 -sfr = "PIOA_IDR", "Memory", 0xfffff444, 4, base=16 -sfr = "PIOA_IMR", "Memory", 0xfffff448, 4, base=16 -sfr = "PIOA_ISR", "Memory", 0xfffff44c, 4, base=16 -sfr = "PIOA_MDER", "Memory", 0xfffff450, 4, base=16 -sfr = "PIOA_MDDR", "Memory", 0xfffff454, 4, base=16 -sfr = "PIOA_MDSR", "Memory", 0xfffff458, 4, base=16 -sfr = "PIOA_PPUDR", "Memory", 0xfffff460, 4, base=16 -sfr = "PIOA_PPUER", "Memory", 0xfffff464, 4, base=16 -sfr = "PIOA_PPUSR", "Memory", 0xfffff468, 4, base=16 -sfr = "PIOA_ASR", "Memory", 0xfffff470, 4, base=16 -sfr = "PIOA_BSR", "Memory", 0xfffff474, 4, base=16 -sfr = "PIOA_ABSR", "Memory", 0xfffff478, 4, base=16 -sfr = "PIOA_OWER", "Memory", 0xfffff4a0, 4, base=16 -sfr = "PIOA_OWDR", "Memory", 0xfffff4a4, 4, base=16 -sfr = "PIOA_OWSR", "Memory", 0xfffff4a8, 4, base=16 -; ========== Register definition for PIOB peripheral ========== -sfr = "PIOB_PER", "Memory", 0xfffff600, 4, base=16 -sfr = "PIOB_PDR", "Memory", 0xfffff604, 4, base=16 -sfr = "PIOB_PSR", "Memory", 0xfffff608, 4, base=16 -sfr = "PIOB_OER", "Memory", 0xfffff610, 4, base=16 -sfr = "PIOB_ODR", "Memory", 0xfffff614, 4, base=16 -sfr = "PIOB_OSR", "Memory", 0xfffff618, 4, base=16 -sfr = "PIOB_IFER", "Memory", 0xfffff620, 4, base=16 -sfr = "PIOB_IFDR", "Memory", 0xfffff624, 4, base=16 -sfr = "PIOB_IFSR", "Memory", 0xfffff628, 4, base=16 -sfr = "PIOB_SODR", "Memory", 0xfffff630, 4, base=16 -sfr = "PIOB_CODR", "Memory", 0xfffff634, 4, base=16 -sfr = "PIOB_ODSR", "Memory", 0xfffff638, 4, base=16 -sfr = "PIOB_PDSR", "Memory", 0xfffff63c, 4, base=16 -sfr = "PIOB_IER", "Memory", 0xfffff640, 4, base=16 -sfr = "PIOB_IDR", "Memory", 0xfffff644, 4, base=16 -sfr = "PIOB_IMR", "Memory", 0xfffff648, 4, base=16 -sfr = "PIOB_ISR", "Memory", 0xfffff64c, 4, base=16 -sfr = "PIOB_MDER", "Memory", 0xfffff650, 4, base=16 -sfr = "PIOB_MDDR", "Memory", 0xfffff654, 4, base=16 -sfr = "PIOB_MDSR", "Memory", 0xfffff658, 4, base=16 -sfr = "PIOB_PPUDR", "Memory", 0xfffff660, 4, base=16 -sfr = "PIOB_PPUER", "Memory", 0xfffff664, 4, base=16 -sfr = "PIOB_PPUSR", "Memory", 0xfffff668, 4, base=16 -sfr = "PIOB_ASR", "Memory", 0xfffff670, 4, base=16 -sfr = "PIOB_BSR", "Memory", 0xfffff674, 4, base=16 -sfr = "PIOB_ABSR", "Memory", 0xfffff678, 4, base=16 -sfr = "PIOB_OWER", "Memory", 0xfffff6a0, 4, base=16 -sfr = "PIOB_OWDR", "Memory", 0xfffff6a4, 4, base=16 -sfr = "PIOB_OWSR", "Memory", 0xfffff6a8, 4, base=16 -; ========== Register definition for CKGR peripheral ========== -sfr = "CKGR_MOR", "Memory", 0xfffffc20, 4, base=16 -sfr = "CKGR_MOR.MOSCEN", "Memory", 0xfffffc20, 4, base=16, bitRange=0 -sfr = "CKGR_MOR.OSCBYPASS", "Memory", 0xfffffc20, 4, base=16, bitRange=1 -sfr = "CKGR_MOR.OSCOUNT", "Memory", 0xfffffc20, 4, base=16, bitRange=8-15 -sfr = "CKGR_MCFR", "Memory", 0xfffffc24, 4, base=16 -sfr = "CKGR_MCFR.MAINF", "Memory", 0xfffffc24, 4, base=16, bitRange=0-15 -sfr = "CKGR_MCFR.MAINRDY", "Memory", 0xfffffc24, 4, base=16, bitRange=16 -sfr = "CKGR_PLLR", "Memory", 0xfffffc2c, 4, base=16 -sfr = "CKGR_PLLR.DIV", "Memory", 0xfffffc2c, 4, base=16, bitRange=0-7 -sfr = "CKGR_PLLR.PLLCOUNT", "Memory", 0xfffffc2c, 4, base=16, bitRange=8-13 -sfr = "CKGR_PLLR.OUT", "Memory", 0xfffffc2c, 4, base=16, bitRange=14-15 -sfr = "CKGR_PLLR.MUL", "Memory", 0xfffffc2c, 4, base=16, bitRange=16-26 -sfr = "CKGR_PLLR.USBDIV", "Memory", 0xfffffc2c, 4, base=16, bitRange=28-29 -; ========== Register definition for PMC peripheral ========== -sfr = "PMC_SCER", "Memory", 0xfffffc00, 4, base=16 -sfr = "PMC_SCER.PCK", "Memory", 0xfffffc00, 4, base=16, bitRange=0 -sfr = "PMC_SCER.UDP", "Memory", 0xfffffc00, 4, base=16, bitRange=7 -sfr = "PMC_SCER.PCK0", "Memory", 0xfffffc00, 4, base=16, bitRange=8 -sfr = "PMC_SCER.PCK1", "Memory", 0xfffffc00, 4, base=16, bitRange=9 -sfr = "PMC_SCER.PCK2", "Memory", 0xfffffc00, 4, base=16, bitRange=10 -sfr = "PMC_SCER.PCK3", "Memory", 0xfffffc00, 4, base=16, bitRange=11 -sfr = "PMC_SCDR", "Memory", 0xfffffc04, 4, base=16 -sfr = "PMC_SCDR.PCK", "Memory", 0xfffffc04, 4, base=16, bitRange=0 -sfr = "PMC_SCDR.UDP", "Memory", 0xfffffc04, 4, base=16, bitRange=7 -sfr = "PMC_SCDR.PCK0", "Memory", 0xfffffc04, 4, base=16, bitRange=8 -sfr = "PMC_SCDR.PCK1", "Memory", 0xfffffc04, 4, base=16, bitRange=9 -sfr = "PMC_SCDR.PCK2", "Memory", 0xfffffc04, 4, base=16, bitRange=10 -sfr = "PMC_SCDR.PCK3", "Memory", 0xfffffc04, 4, base=16, bitRange=11 -sfr = "PMC_SCSR", "Memory", 0xfffffc08, 4, base=16 -sfr = "PMC_SCSR.PCK", "Memory", 0xfffffc08, 4, base=16, bitRange=0 -sfr = "PMC_SCSR.UDP", "Memory", 0xfffffc08, 4, base=16, bitRange=7 -sfr = "PMC_SCSR.PCK0", "Memory", 0xfffffc08, 4, base=16, bitRange=8 -sfr = "PMC_SCSR.PCK1", "Memory", 0xfffffc08, 4, base=16, bitRange=9 -sfr = "PMC_SCSR.PCK2", "Memory", 0xfffffc08, 4, base=16, bitRange=10 -sfr = "PMC_SCSR.PCK3", "Memory", 0xfffffc08, 4, base=16, bitRange=11 -sfr = "PMC_PCER", "Memory", 0xfffffc10, 4, base=16 -sfr = "PMC_PCDR", "Memory", 0xfffffc14, 4, base=16 -sfr = "PMC_PCSR", "Memory", 0xfffffc18, 4, base=16 -sfr = "PMC_MOR", "Memory", 0xfffffc20, 4, base=16 -sfr = "PMC_MOR.MOSCEN", "Memory", 0xfffffc20, 4, base=16, bitRange=0 -sfr = "PMC_MOR.OSCBYPASS", "Memory", 0xfffffc20, 4, base=16, bitRange=1 -sfr = "PMC_MOR.OSCOUNT", "Memory", 0xfffffc20, 4, base=16, bitRange=8-15 -sfr = "PMC_MCFR", "Memory", 0xfffffc24, 4, base=16 -sfr = "PMC_MCFR.MAINF", "Memory", 0xfffffc24, 4, base=16, bitRange=0-15 -sfr = "PMC_MCFR.MAINRDY", "Memory", 0xfffffc24, 4, base=16, bitRange=16 -sfr = "PMC_PLLR", "Memory", 0xfffffc2c, 4, base=16 -sfr = "PMC_PLLR.DIV", "Memory", 0xfffffc2c, 4, base=16, bitRange=0-7 -sfr = "PMC_PLLR.PLLCOUNT", "Memory", 0xfffffc2c, 4, base=16, bitRange=8-13 -sfr = "PMC_PLLR.OUT", "Memory", 0xfffffc2c, 4, base=16, bitRange=14-15 -sfr = "PMC_PLLR.MUL", "Memory", 0xfffffc2c, 4, base=16, bitRange=16-26 -sfr = "PMC_PLLR.USBDIV", "Memory", 0xfffffc2c, 4, base=16, bitRange=28-29 -sfr = "PMC_MCKR", "Memory", 0xfffffc30, 4, base=16 -sfr = "PMC_MCKR.CSS", "Memory", 0xfffffc30, 4, base=16, bitRange=0-1 -sfr = "PMC_MCKR.PRES", "Memory", 0xfffffc30, 4, base=16, bitRange=2-4 -sfr = "PMC_PCKR", "Memory", 0xfffffc40, 4, base=16 -sfr = "PMC_PCKR.CSS", "Memory", 0xfffffc40, 4, base=16, bitRange=0-1 -sfr = "PMC_PCKR.PRES", "Memory", 0xfffffc40, 4, base=16, bitRange=2-4 -sfr = "PMC_IER", "Memory", 0xfffffc60, 4, base=16 -sfr = "PMC_IER.MOSCS", "Memory", 0xfffffc60, 4, base=16, bitRange=0 -sfr = "PMC_IER.LOCK", "Memory", 0xfffffc60, 4, base=16, bitRange=2 -sfr = "PMC_IER.MCKRDY", "Memory", 0xfffffc60, 4, base=16, bitRange=3 -sfr = "PMC_IER.PCK0RDY", "Memory", 0xfffffc60, 4, base=16, bitRange=8 -sfr = "PMC_IER.PCK1RDY", "Memory", 0xfffffc60, 4, base=16, bitRange=9 -sfr = "PMC_IER.PCK2RDY", "Memory", 0xfffffc60, 4, base=16, bitRange=10 -sfr = "PMC_IER.PCK3RDY", "Memory", 0xfffffc60, 4, base=16, bitRange=11 -sfr = "PMC_IDR", "Memory", 0xfffffc64, 4, base=16 -sfr = "PMC_IDR.MOSCS", "Memory", 0xfffffc64, 4, base=16, bitRange=0 -sfr = "PMC_IDR.LOCK", "Memory", 0xfffffc64, 4, base=16, bitRange=2 -sfr = "PMC_IDR.MCKRDY", "Memory", 0xfffffc64, 4, base=16, bitRange=3 -sfr = "PMC_IDR.PCK0RDY", "Memory", 0xfffffc64, 4, base=16, bitRange=8 -sfr = "PMC_IDR.PCK1RDY", "Memory", 0xfffffc64, 4, base=16, bitRange=9 -sfr = "PMC_IDR.PCK2RDY", "Memory", 0xfffffc64, 4, base=16, bitRange=10 -sfr = "PMC_IDR.PCK3RDY", "Memory", 0xfffffc64, 4, base=16, bitRange=11 -sfr = "PMC_SR", "Memory", 0xfffffc68, 4, base=16 -sfr = "PMC_SR.MOSCS", "Memory", 0xfffffc68, 4, base=16, bitRange=0 -sfr = "PMC_SR.LOCK", "Memory", 0xfffffc68, 4, base=16, bitRange=2 -sfr = "PMC_SR.MCKRDY", "Memory", 0xfffffc68, 4, base=16, bitRange=3 -sfr = "PMC_SR.PCK0RDY", "Memory", 0xfffffc68, 4, base=16, bitRange=8 -sfr = "PMC_SR.PCK1RDY", "Memory", 0xfffffc68, 4, base=16, bitRange=9 -sfr = "PMC_SR.PCK2RDY", "Memory", 0xfffffc68, 4, base=16, bitRange=10 -sfr = "PMC_SR.PCK3RDY", "Memory", 0xfffffc68, 4, base=16, bitRange=11 -sfr = "PMC_IMR", "Memory", 0xfffffc6c, 4, base=16 -sfr = "PMC_IMR.MOSCS", "Memory", 0xfffffc6c, 4, base=16, bitRange=0 -sfr = "PMC_IMR.LOCK", "Memory", 0xfffffc6c, 4, base=16, bitRange=2 -sfr = "PMC_IMR.MCKRDY", "Memory", 0xfffffc6c, 4, base=16, bitRange=3 -sfr = "PMC_IMR.PCK0RDY", "Memory", 0xfffffc6c, 4, base=16, bitRange=8 -sfr = "PMC_IMR.PCK1RDY", "Memory", 0xfffffc6c, 4, base=16, bitRange=9 -sfr = "PMC_IMR.PCK2RDY", "Memory", 0xfffffc6c, 4, base=16, bitRange=10 -sfr = "PMC_IMR.PCK3RDY", "Memory", 0xfffffc6c, 4, base=16, bitRange=11 -; ========== Register definition for RSTC peripheral ========== -sfr = "RSTC_RCR", "Memory", 0xfffffd00, 4, base=16 -sfr = "RSTC_RCR.PROCRST", "Memory", 0xfffffd00, 4, base=16, bitRange=0 -sfr = "RSTC_RCR.PERRST", "Memory", 0xfffffd00, 4, base=16, bitRange=2 -sfr = "RSTC_RCR.EXTRST", "Memory", 0xfffffd00, 4, base=16, bitRange=3 -sfr = "RSTC_RCR.KEY", "Memory", 0xfffffd00, 4, base=16, bitRange=24-31 -sfr = "RSTC_RSR", "Memory", 0xfffffd04, 4, base=16 -sfr = "RSTC_RSR.URSTS", "Memory", 0xfffffd04, 4, base=16, bitRange=0 -sfr = "RSTC_RSR.BODSTS", "Memory", 0xfffffd04, 4, base=16, bitRange=1 -sfr = "RSTC_RSR.RSTTYP", "Memory", 0xfffffd04, 4, base=16, bitRange=8-10 -sfr = "RSTC_RSR.NRSTL", "Memory", 0xfffffd04, 4, base=16, bitRange=16 -sfr = "RSTC_RSR.SRCMP", "Memory", 0xfffffd04, 4, base=16, bitRange=17 -sfr = "RSTC_RMR", "Memory", 0xfffffd08, 4, base=16 -sfr = "RSTC_RMR.URSTEN", "Memory", 0xfffffd08, 4, base=16, bitRange=0 -sfr = "RSTC_RMR.URSTIEN", "Memory", 0xfffffd08, 4, base=16, bitRange=4 -sfr = "RSTC_RMR.ERSTL", "Memory", 0xfffffd08, 4, base=16, bitRange=8-11 -sfr = "RSTC_RMR.BODIEN", "Memory", 0xfffffd08, 4, base=16, bitRange=16 -sfr = "RSTC_RMR.KEY", "Memory", 0xfffffd08, 4, base=16, bitRange=24-31 -; ========== Register definition for RTTC peripheral ========== -sfr = "RTTC_RTMR", "Memory", 0xfffffd20, 4, base=16 -sfr = "RTTC_RTMR.RTPRES", "Memory", 0xfffffd20, 4, base=16, bitRange=0-15 -sfr = "RTTC_RTMR.ALMIEN", "Memory", 0xfffffd20, 4, base=16, bitRange=16 -sfr = "RTTC_RTMR.RTTINCIEN", "Memory", 0xfffffd20, 4, base=16, bitRange=17 -sfr = "RTTC_RTMR.RTTRST", "Memory", 0xfffffd20, 4, base=16, bitRange=18 -sfr = "RTTC_RTAR", "Memory", 0xfffffd24, 4, base=16 -sfr = "RTTC_RTAR.ALMV", "Memory", 0xfffffd24, 4, base=16, bitRange=0-31 -sfr = "RTTC_RTVR", "Memory", 0xfffffd28, 4, base=16 -sfr = "RTTC_RTVR.CRTV", "Memory", 0xfffffd28, 4, base=16, bitRange=0-31 -sfr = "RTTC_RTSR", "Memory", 0xfffffd2c, 4, base=16 -sfr = "RTTC_RTSR.ALMS", "Memory", 0xfffffd2c, 4, base=16, bitRange=0 -sfr = "RTTC_RTSR.RTTINC", "Memory", 0xfffffd2c, 4, base=16, bitRange=1 -; ========== Register definition for PITC peripheral ========== -sfr = "PITC_PIMR", "Memory", 0xfffffd30, 4, base=16 -sfr = "PITC_PIMR.PIV", "Memory", 0xfffffd30, 4, base=16, bitRange=0-19 -sfr = "PITC_PIMR.PITEN", "Memory", 0xfffffd30, 4, base=16, bitRange=24 -sfr = "PITC_PIMR.PITIEN", "Memory", 0xfffffd30, 4, base=16, bitRange=25 -sfr = "PITC_PISR", "Memory", 0xfffffd34, 4, base=16 -sfr = "PITC_PISR.PITS", "Memory", 0xfffffd34, 4, base=16, bitRange=0 -sfr = "PITC_PIVR", "Memory", 0xfffffd38, 4, base=16 -sfr = "PITC_PIVR.CPIV", "Memory", 0xfffffd38, 4, base=16, bitRange=0-19 -sfr = "PITC_PIVR.PICNT", "Memory", 0xfffffd38, 4, base=16, bitRange=20-31 -sfr = "PITC_PIIR", "Memory", 0xfffffd3c, 4, base=16 -sfr = "PITC_PIIR.CPIV", "Memory", 0xfffffd3c, 4, base=16, bitRange=0-19 -sfr = "PITC_PIIR.PICNT", "Memory", 0xfffffd3c, 4, base=16, bitRange=20-31 -; ========== Register definition for WDTC peripheral ========== -sfr = "WDTC_WDCR", "Memory", 0xfffffd40, 4, base=16 -sfr = "WDTC_WDCR.WDRSTT", "Memory", 0xfffffd40, 4, base=16, bitRange=0 -sfr = "WDTC_WDCR.KEY", "Memory", 0xfffffd40, 4, base=16, bitRange=24-31 -sfr = "WDTC_WDMR", "Memory", 0xfffffd44, 4, base=16 -sfr = "WDTC_WDMR.WDV", "Memory", 0xfffffd44, 4, base=16, bitRange=0-11 -sfr = "WDTC_WDMR.WDFIEN", "Memory", 0xfffffd44, 4, base=16, bitRange=12 -sfr = "WDTC_WDMR.WDRSTEN", "Memory", 0xfffffd44, 4, base=16, bitRange=13 -sfr = "WDTC_WDMR.WDRPROC", "Memory", 0xfffffd44, 4, base=16, bitRange=14 -sfr = "WDTC_WDMR.WDDIS", "Memory", 0xfffffd44, 4, base=16, bitRange=15 -sfr = "WDTC_WDMR.WDD", "Memory", 0xfffffd44, 4, base=16, bitRange=16-27 -sfr = "WDTC_WDMR.WDDBGHLT", "Memory", 0xfffffd44, 4, base=16, bitRange=28 -sfr = "WDTC_WDMR.WDIDLEHLT", "Memory", 0xfffffd44, 4, base=16, bitRange=29 -sfr = "WDTC_WDSR", "Memory", 0xfffffd48, 4, base=16 -sfr = "WDTC_WDSR.WDUNF", "Memory", 0xfffffd48, 4, base=16, bitRange=0 -sfr = "WDTC_WDSR.WDERR", "Memory", 0xfffffd48, 4, base=16, bitRange=1 -; ========== Register definition for VREG peripheral ========== -sfr = "VREG_MR", "Memory", 0xfffffd60, 4, base=16 -sfr = "VREG_MR.PSTDBY", "Memory", 0xfffffd60, 4, base=16, bitRange=0 -; ========== Register definition for MC peripheral ========== -sfr = "MC_RCR", "Memory", 0xffffff00, 4, base=16 -sfr = "MC_RCR.RCB", "Memory", 0xffffff00, 4, base=16, bitRange=0 -sfr = "MC_ASR", "Memory", 0xffffff04, 4, base=16 -sfr = "MC_ASR.UNDADD", "Memory", 0xffffff04, 4, base=16, bitRange=0 -sfr = "MC_ASR.MISADD", "Memory", 0xffffff04, 4, base=16, bitRange=1 -sfr = "MC_ASR.ABTSZ", "Memory", 0xffffff04, 4, base=16, bitRange=8-9 -sfr = "MC_ASR.ABTTYP", "Memory", 0xffffff04, 4, base=16, bitRange=10-11 -sfr = "MC_ASR.MST0", "Memory", 0xffffff04, 4, base=16, bitRange=16 -sfr = "MC_ASR.MST1", "Memory", 0xffffff04, 4, base=16, bitRange=17 -sfr = "MC_ASR.SVMST0", "Memory", 0xffffff04, 4, base=16, bitRange=24 -sfr = "MC_ASR.SVMST1", "Memory", 0xffffff04, 4, base=16, bitRange=25 -sfr = "MC_AASR", "Memory", 0xffffff08, 4, base=16 -sfr = "MC_FMR", "Memory", 0xffffff60, 4, base=16 -sfr = "MC_FMR.FRDY", "Memory", 0xffffff60, 4, base=16, bitRange=0 -sfr = "MC_FMR.LOCKE", "Memory", 0xffffff60, 4, base=16, bitRange=2 -sfr = "MC_FMR.PROGE", "Memory", 0xffffff60, 4, base=16, bitRange=3 -sfr = "MC_FMR.NEBP", "Memory", 0xffffff60, 4, base=16, bitRange=7 -sfr = "MC_FMR.FWS", "Memory", 0xffffff60, 4, base=16, bitRange=8-9 -sfr = "MC_FMR.FMCN", "Memory", 0xffffff60, 4, base=16, bitRange=16-23 -sfr = "MC_FCR", "Memory", 0xffffff64, 4, base=16 -sfr = "MC_FCR.FCMD", "Memory", 0xffffff64, 4, base=16, bitRange=0-3 -sfr = "MC_FCR.PAGEN", "Memory", 0xffffff64, 4, base=16, bitRange=8-17 -sfr = "MC_FCR.KEY", "Memory", 0xffffff64, 4, base=16, bitRange=24-31 -sfr = "MC_FSR", "Memory", 0xffffff68, 4, base=16 -sfr = "MC_FSR.FRDY", "Memory", 0xffffff68, 4, base=16, bitRange=0 -sfr = "MC_FSR.LOCKE", "Memory", 0xffffff68, 4, base=16, bitRange=2 -sfr = "MC_FSR.PROGE", "Memory", 0xffffff68, 4, base=16, bitRange=3 -sfr = "MC_FSR.SECURITY", "Memory", 0xffffff68, 4, base=16, bitRange=4 -sfr = "MC_FSR.GPNVM0", "Memory", 0xffffff68, 4, base=16, bitRange=8 -sfr = "MC_FSR.GPNVM1", "Memory", 0xffffff68, 4, base=16, bitRange=9 -sfr = "MC_FSR.GPNVM2", "Memory", 0xffffff68, 4, base=16, bitRange=10 -sfr = "MC_FSR.GPNVM3", "Memory", 0xffffff68, 4, base=16, bitRange=11 -sfr = "MC_FSR.GPNVM4", "Memory", 0xffffff68, 4, base=16, bitRange=12 -sfr = "MC_FSR.GPNVM5", "Memory", 0xffffff68, 4, base=16, bitRange=13 -sfr = "MC_FSR.GPNVM6", "Memory", 0xffffff68, 4, base=16, bitRange=14 -sfr = "MC_FSR.GPNVM7", "Memory", 0xffffff68, 4, base=16, bitRange=15 -sfr = "MC_FSR.LOCKS0", "Memory", 0xffffff68, 4, base=16, bitRange=16 -sfr = "MC_FSR.LOCKS1", "Memory", 0xffffff68, 4, base=16, bitRange=17 -sfr = "MC_FSR.LOCKS2", "Memory", 0xffffff68, 4, base=16, bitRange=18 -sfr = "MC_FSR.LOCKS3", "Memory", 0xffffff68, 4, base=16, bitRange=19 -sfr = "MC_FSR.LOCKS4", "Memory", 0xffffff68, 4, base=16, bitRange=20 -sfr = "MC_FSR.LOCKS5", "Memory", 0xffffff68, 4, base=16, bitRange=21 -sfr = "MC_FSR.LOCKS6", "Memory", 0xffffff68, 4, base=16, bitRange=22 -sfr = "MC_FSR.LOCKS7", "Memory", 0xffffff68, 4, base=16, bitRange=23 -sfr = "MC_FSR.LOCKS8", "Memory", 0xffffff68, 4, base=16, bitRange=24 -sfr = "MC_FSR.LOCKS9", "Memory", 0xffffff68, 4, base=16, bitRange=25 -sfr = "MC_FSR.LOCKS10", "Memory", 0xffffff68, 4, base=16, bitRange=26 -sfr = "MC_FSR.LOCKS11", "Memory", 0xffffff68, 4, base=16, bitRange=27 -sfr = "MC_FSR.LOCKS12", "Memory", 0xffffff68, 4, base=16, bitRange=28 -sfr = "MC_FSR.LOCKS13", "Memory", 0xffffff68, 4, base=16, bitRange=29 -sfr = "MC_FSR.LOCKS14", "Memory", 0xffffff68, 4, base=16, bitRange=30 -sfr = "MC_FSR.LOCKS15", "Memory", 0xffffff68, 4, base=16, bitRange=31 -; ========== Register definition for PDC_SPI1 peripheral ========== -sfr = "SPI1_RPR", "Memory", 0xfffe4100, 4, base=16 -sfr = "SPI1_RCR", "Memory", 0xfffe4104, 4, base=16 -sfr = "SPI1_TPR", "Memory", 0xfffe4108, 4, base=16 -sfr = "SPI1_TCR", "Memory", 0xfffe410c, 4, base=16 -sfr = "SPI1_RNPR", "Memory", 0xfffe4110, 4, base=16 -sfr = "SPI1_RNCR", "Memory", 0xfffe4114, 4, base=16 -sfr = "SPI1_TNPR", "Memory", 0xfffe4118, 4, base=16 -sfr = "SPI1_TNCR", "Memory", 0xfffe411c, 4, base=16 -sfr = "SPI1_PTCR", "Memory", 0xfffe4120, 4, base=16 -sfr = "SPI1_PTCR.RXTEN", "Memory", 0xfffe4120, 4, base=16, bitRange=0 -sfr = "SPI1_PTCR.RXTDIS", "Memory", 0xfffe4120, 4, base=16, bitRange=1 -sfr = "SPI1_PTCR.TXTEN", "Memory", 0xfffe4120, 4, base=16, bitRange=8 -sfr = "SPI1_PTCR.TXTDIS", "Memory", 0xfffe4120, 4, base=16, bitRange=9 -sfr = "SPI1_PTSR", "Memory", 0xfffe4124, 4, base=16 -sfr = "SPI1_PTSR.RXTEN", "Memory", 0xfffe4124, 4, base=16, bitRange=0 -sfr = "SPI1_PTSR.TXTEN", "Memory", 0xfffe4124, 4, base=16, bitRange=8 -; ========== Register definition for SPI1 peripheral ========== -sfr = "SPI1_CR", "Memory", 0xfffe4000, 4, base=16 -sfr = "SPI1_CR.SPIEN", "Memory", 0xfffe4000, 4, base=16, bitRange=0 -sfr = "SPI1_CR.SPIDIS", "Memory", 0xfffe4000, 4, base=16, bitRange=1 -sfr = "SPI1_CR.SWRST", "Memory", 0xfffe4000, 4, base=16, bitRange=7 -sfr = "SPI1_CR.LASTXFER", "Memory", 0xfffe4000, 4, base=16, bitRange=24 -sfr = "SPI1_MR", "Memory", 0xfffe4004, 4, base=16 -sfr = "SPI1_MR.MSTR", "Memory", 0xfffe4004, 4, base=16, bitRange=0 -sfr = "SPI1_MR.PS", "Memory", 0xfffe4004, 4, base=16, bitRange=1 -sfr = "SPI1_MR.PCSDEC", "Memory", 0xfffe4004, 4, base=16, bitRange=2 -sfr = "SPI1_MR.FDIV", "Memory", 0xfffe4004, 4, base=16, bitRange=3 -sfr = "SPI1_MR.MODFDIS", "Memory", 0xfffe4004, 4, base=16, bitRange=4 -sfr = "SPI1_MR.LLB", "Memory", 0xfffe4004, 4, base=16, bitRange=7 -sfr = "SPI1_MR.PCS", "Memory", 0xfffe4004, 4, base=16, bitRange=16-19 -sfr = "SPI1_MR.DLYBCS", "Memory", 0xfffe4004, 4, base=16, bitRange=24-31 -sfr = "SPI1_RDR", "Memory", 0xfffe4008, 4, base=16 -sfr = "SPI1_RDR.RD", "Memory", 0xfffe4008, 4, base=16, bitRange=0-15 -sfr = "SPI1_RDR.RPCS", "Memory", 0xfffe4008, 4, base=16, bitRange=16-19 -sfr = "SPI1_TDR", "Memory", 0xfffe400c, 4, base=16 -sfr = "SPI1_TDR.TD", "Memory", 0xfffe400c, 4, base=16, bitRange=0-15 -sfr = "SPI1_TDR.TPCS", "Memory", 0xfffe400c, 4, base=16, bitRange=16-19 -sfr = "SPI1_TDR.LASTXFER", "Memory", 0xfffe400c, 4, base=16, bitRange=24 -sfr = "SPI1_SR", "Memory", 0xfffe4010, 4, base=16 -sfr = "SPI1_SR.RDRF", "Memory", 0xfffe4010, 4, base=16, bitRange=0 -sfr = "SPI1_SR.TDRE", "Memory", 0xfffe4010, 4, base=16, bitRange=1 -sfr = "SPI1_SR.MODF", "Memory", 0xfffe4010, 4, base=16, bitRange=2 -sfr = "SPI1_SR.OVRES", "Memory", 0xfffe4010, 4, base=16, bitRange=3 -sfr = "SPI1_SR.ENDRX", "Memory", 0xfffe4010, 4, base=16, bitRange=4 -sfr = "SPI1_SR.ENDTX", "Memory", 0xfffe4010, 4, base=16, bitRange=5 -sfr = "SPI1_SR.RXBUFF", "Memory", 0xfffe4010, 4, base=16, bitRange=6 -sfr = "SPI1_SR.TXBUFE", "Memory", 0xfffe4010, 4, base=16, bitRange=7 -sfr = "SPI1_SR.NSSR", "Memory", 0xfffe4010, 4, base=16, bitRange=8 -sfr = "SPI1_SR.TXEMPTY", "Memory", 0xfffe4010, 4, base=16, bitRange=9 -sfr = "SPI1_SR.SPIENS", "Memory", 0xfffe4010, 4, base=16, bitRange=16 -sfr = "SPI1_IER", "Memory", 0xfffe4014, 4, base=16 -sfr = "SPI1_IER.RDRF", "Memory", 0xfffe4014, 4, base=16, bitRange=0 -sfr = "SPI1_IER.TDRE", "Memory", 0xfffe4014, 4, base=16, bitRange=1 -sfr = "SPI1_IER.MODF", "Memory", 0xfffe4014, 4, base=16, bitRange=2 -sfr = "SPI1_IER.OVRES", "Memory", 0xfffe4014, 4, base=16, bitRange=3 -sfr = "SPI1_IER.ENDRX", "Memory", 0xfffe4014, 4, base=16, bitRange=4 -sfr = "SPI1_IER.ENDTX", "Memory", 0xfffe4014, 4, base=16, bitRange=5 -sfr = "SPI1_IER.RXBUFF", "Memory", 0xfffe4014, 4, base=16, bitRange=6 -sfr = "SPI1_IER.TXBUFE", "Memory", 0xfffe4014, 4, base=16, bitRange=7 -sfr = "SPI1_IER.NSSR", "Memory", 0xfffe4014, 4, base=16, bitRange=8 -sfr = "SPI1_IER.TXEMPTY", "Memory", 0xfffe4014, 4, base=16, bitRange=9 -sfr = "SPI1_IDR", "Memory", 0xfffe4018, 4, base=16 -sfr = "SPI1_IDR.RDRF", "Memory", 0xfffe4018, 4, base=16, bitRange=0 -sfr = "SPI1_IDR.TDRE", "Memory", 0xfffe4018, 4, base=16, bitRange=1 -sfr = "SPI1_IDR.MODF", "Memory", 0xfffe4018, 4, base=16, bitRange=2 -sfr = "SPI1_IDR.OVRES", "Memory", 0xfffe4018, 4, base=16, bitRange=3 -sfr = "SPI1_IDR.ENDRX", "Memory", 0xfffe4018, 4, base=16, bitRange=4 -sfr = "SPI1_IDR.ENDTX", "Memory", 0xfffe4018, 4, base=16, bitRange=5 -sfr = "SPI1_IDR.RXBUFF", "Memory", 0xfffe4018, 4, base=16, bitRange=6 -sfr = "SPI1_IDR.TXBUFE", "Memory", 0xfffe4018, 4, base=16, bitRange=7 -sfr = "SPI1_IDR.NSSR", "Memory", 0xfffe4018, 4, base=16, bitRange=8 -sfr = "SPI1_IDR.TXEMPTY", "Memory", 0xfffe4018, 4, base=16, bitRange=9 -sfr = "SPI1_IMR", "Memory", 0xfffe401c, 4, base=16 -sfr = "SPI1_IMR.RDRF", "Memory", 0xfffe401c, 4, base=16, bitRange=0 -sfr = "SPI1_IMR.TDRE", "Memory", 0xfffe401c, 4, base=16, bitRange=1 -sfr = "SPI1_IMR.MODF", "Memory", 0xfffe401c, 4, base=16, bitRange=2 -sfr = "SPI1_IMR.OVRES", "Memory", 0xfffe401c, 4, base=16, bitRange=3 -sfr = "SPI1_IMR.ENDRX", "Memory", 0xfffe401c, 4, base=16, bitRange=4 -sfr = "SPI1_IMR.ENDTX", "Memory", 0xfffe401c, 4, base=16, bitRange=5 -sfr = "SPI1_IMR.RXBUFF", "Memory", 0xfffe401c, 4, base=16, bitRange=6 -sfr = "SPI1_IMR.TXBUFE", "Memory", 0xfffe401c, 4, base=16, bitRange=7 -sfr = "SPI1_IMR.NSSR", "Memory", 0xfffe401c, 4, base=16, bitRange=8 -sfr = "SPI1_IMR.TXEMPTY", "Memory", 0xfffe401c, 4, base=16, bitRange=9 -sfr = "SPI1_CSR", "Memory", 0xfffe4030, 4, base=16 -sfr = "SPI1_CSR.CPOL", "Memory", 0xfffe4030, 4, base=16, bitRange=0 -sfr = "SPI1_CSR.NCPHA", "Memory", 0xfffe4030, 4, base=16, bitRange=1 -sfr = "SPI1_CSR.CSAAT", "Memory", 0xfffe4030, 4, base=16, bitRange=3 -sfr = "SPI1_CSR.BITS", "Memory", 0xfffe4030, 4, base=16, bitRange=4-7 -sfr = "SPI1_CSR.SCBR", "Memory", 0xfffe4030, 4, base=16, bitRange=8-15 -sfr = "SPI1_CSR.DLYBS", "Memory", 0xfffe4030, 4, base=16, bitRange=16-23 -sfr = "SPI1_CSR.DLYBCT", "Memory", 0xfffe4030, 4, base=16, bitRange=24-31 -; ========== Register definition for PDC_SPI0 peripheral ========== -sfr = "SPI0_RPR", "Memory", 0xfffe0100, 4, base=16 -sfr = "SPI0_RCR", "Memory", 0xfffe0104, 4, base=16 -sfr = "SPI0_TPR", "Memory", 0xfffe0108, 4, base=16 -sfr = "SPI0_TCR", "Memory", 0xfffe010c, 4, base=16 -sfr = "SPI0_RNPR", "Memory", 0xfffe0110, 4, base=16 -sfr = "SPI0_RNCR", "Memory", 0xfffe0114, 4, base=16 -sfr = "SPI0_TNPR", "Memory", 0xfffe0118, 4, base=16 -sfr = "SPI0_TNCR", "Memory", 0xfffe011c, 4, base=16 -sfr = "SPI0_PTCR", "Memory", 0xfffe0120, 4, base=16 -sfr = "SPI0_PTCR.RXTEN", "Memory", 0xfffe0120, 4, base=16, bitRange=0 -sfr = "SPI0_PTCR.RXTDIS", "Memory", 0xfffe0120, 4, base=16, bitRange=1 -sfr = "SPI0_PTCR.TXTEN", "Memory", 0xfffe0120, 4, base=16, bitRange=8 -sfr = "SPI0_PTCR.TXTDIS", "Memory", 0xfffe0120, 4, base=16, bitRange=9 -sfr = "SPI0_PTSR", "Memory", 0xfffe0124, 4, base=16 -sfr = "SPI0_PTSR.RXTEN", "Memory", 0xfffe0124, 4, base=16, bitRange=0 -sfr = "SPI0_PTSR.TXTEN", "Memory", 0xfffe0124, 4, base=16, bitRange=8 -; ========== Register definition for SPI0 peripheral ========== -sfr = "SPI0_CR", "Memory", 0xfffe0000, 4, base=16 -sfr = "SPI0_CR.SPIEN", "Memory", 0xfffe0000, 4, base=16, bitRange=0 -sfr = "SPI0_CR.SPIDIS", "Memory", 0xfffe0000, 4, base=16, bitRange=1 -sfr = "SPI0_CR.SWRST", "Memory", 0xfffe0000, 4, base=16, bitRange=7 -sfr = "SPI0_CR.LASTXFER", "Memory", 0xfffe0000, 4, base=16, bitRange=24 -sfr = "SPI0_MR", "Memory", 0xfffe0004, 4, base=16 -sfr = "SPI0_MR.MSTR", "Memory", 0xfffe0004, 4, base=16, bitRange=0 -sfr = "SPI0_MR.PS", "Memory", 0xfffe0004, 4, base=16, bitRange=1 -sfr = "SPI0_MR.PCSDEC", "Memory", 0xfffe0004, 4, base=16, bitRange=2 -sfr = "SPI0_MR.FDIV", "Memory", 0xfffe0004, 4, base=16, bitRange=3 -sfr = "SPI0_MR.MODFDIS", "Memory", 0xfffe0004, 4, base=16, bitRange=4 -sfr = "SPI0_MR.LLB", "Memory", 0xfffe0004, 4, base=16, bitRange=7 -sfr = "SPI0_MR.PCS", "Memory", 0xfffe0004, 4, base=16, bitRange=16-19 -sfr = "SPI0_MR.DLYBCS", "Memory", 0xfffe0004, 4, base=16, bitRange=24-31 -sfr = "SPI0_RDR", "Memory", 0xfffe0008, 4, base=16 -sfr = "SPI0_RDR.RD", "Memory", 0xfffe0008, 4, base=16, bitRange=0-15 -sfr = "SPI0_RDR.RPCS", "Memory", 0xfffe0008, 4, base=16, bitRange=16-19 -sfr = "SPI0_TDR", "Memory", 0xfffe000c, 4, base=16 -sfr = "SPI0_TDR.TD", "Memory", 0xfffe000c, 4, base=16, bitRange=0-15 -sfr = "SPI0_TDR.TPCS", "Memory", 0xfffe000c, 4, base=16, bitRange=16-19 -sfr = "SPI0_TDR.LASTXFER", "Memory", 0xfffe000c, 4, base=16, bitRange=24 -sfr = "SPI0_SR", "Memory", 0xfffe0010, 4, base=16 -sfr = "SPI0_SR.RDRF", "Memory", 0xfffe0010, 4, base=16, bitRange=0 -sfr = "SPI0_SR.TDRE", "Memory", 0xfffe0010, 4, base=16, bitRange=1 -sfr = "SPI0_SR.MODF", "Memory", 0xfffe0010, 4, base=16, bitRange=2 -sfr = "SPI0_SR.OVRES", "Memory", 0xfffe0010, 4, base=16, bitRange=3 -sfr = "SPI0_SR.ENDRX", "Memory", 0xfffe0010, 4, base=16, bitRange=4 -sfr = "SPI0_SR.ENDTX", "Memory", 0xfffe0010, 4, base=16, bitRange=5 -sfr = "SPI0_SR.RXBUFF", "Memory", 0xfffe0010, 4, base=16, bitRange=6 -sfr = "SPI0_SR.TXBUFE", "Memory", 0xfffe0010, 4, base=16, bitRange=7 -sfr = "SPI0_SR.NSSR", "Memory", 0xfffe0010, 4, base=16, bitRange=8 -sfr = "SPI0_SR.TXEMPTY", "Memory", 0xfffe0010, 4, base=16, bitRange=9 -sfr = "SPI0_SR.SPIENS", "Memory", 0xfffe0010, 4, base=16, bitRange=16 -sfr = "SPI0_IER", "Memory", 0xfffe0014, 4, base=16 -sfr = "SPI0_IER.RDRF", "Memory", 0xfffe0014, 4, base=16, bitRange=0 -sfr = "SPI0_IER.TDRE", "Memory", 0xfffe0014, 4, base=16, bitRange=1 -sfr = "SPI0_IER.MODF", "Memory", 0xfffe0014, 4, base=16, bitRange=2 -sfr = "SPI0_IER.OVRES", "Memory", 0xfffe0014, 4, base=16, bitRange=3 -sfr = "SPI0_IER.ENDRX", "Memory", 0xfffe0014, 4, base=16, bitRange=4 -sfr = "SPI0_IER.ENDTX", "Memory", 0xfffe0014, 4, base=16, bitRange=5 -sfr = "SPI0_IER.RXBUFF", "Memory", 0xfffe0014, 4, base=16, bitRange=6 -sfr = "SPI0_IER.TXBUFE", "Memory", 0xfffe0014, 4, base=16, bitRange=7 -sfr = "SPI0_IER.NSSR", "Memory", 0xfffe0014, 4, base=16, bitRange=8 -sfr = "SPI0_IER.TXEMPTY", "Memory", 0xfffe0014, 4, base=16, bitRange=9 -sfr = "SPI0_IDR", "Memory", 0xfffe0018, 4, base=16 -sfr = "SPI0_IDR.RDRF", "Memory", 0xfffe0018, 4, base=16, bitRange=0 -sfr = "SPI0_IDR.TDRE", "Memory", 0xfffe0018, 4, base=16, bitRange=1 -sfr = "SPI0_IDR.MODF", "Memory", 0xfffe0018, 4, base=16, bitRange=2 -sfr = "SPI0_IDR.OVRES", "Memory", 0xfffe0018, 4, base=16, bitRange=3 -sfr = "SPI0_IDR.ENDRX", "Memory", 0xfffe0018, 4, base=16, bitRange=4 -sfr = "SPI0_IDR.ENDTX", "Memory", 0xfffe0018, 4, base=16, bitRange=5 -sfr = "SPI0_IDR.RXBUFF", "Memory", 0xfffe0018, 4, base=16, bitRange=6 -sfr = "SPI0_IDR.TXBUFE", "Memory", 0xfffe0018, 4, base=16, bitRange=7 -sfr = "SPI0_IDR.NSSR", "Memory", 0xfffe0018, 4, base=16, bitRange=8 -sfr = "SPI0_IDR.TXEMPTY", "Memory", 0xfffe0018, 4, base=16, bitRange=9 -sfr = "SPI0_IMR", "Memory", 0xfffe001c, 4, base=16 -sfr = "SPI0_IMR.RDRF", "Memory", 0xfffe001c, 4, base=16, bitRange=0 -sfr = "SPI0_IMR.TDRE", "Memory", 0xfffe001c, 4, base=16, bitRange=1 -sfr = "SPI0_IMR.MODF", "Memory", 0xfffe001c, 4, base=16, bitRange=2 -sfr = "SPI0_IMR.OVRES", "Memory", 0xfffe001c, 4, base=16, bitRange=3 -sfr = "SPI0_IMR.ENDRX", "Memory", 0xfffe001c, 4, base=16, bitRange=4 -sfr = "SPI0_IMR.ENDTX", "Memory", 0xfffe001c, 4, base=16, bitRange=5 -sfr = "SPI0_IMR.RXBUFF", "Memory", 0xfffe001c, 4, base=16, bitRange=6 -sfr = "SPI0_IMR.TXBUFE", "Memory", 0xfffe001c, 4, base=16, bitRange=7 -sfr = "SPI0_IMR.NSSR", "Memory", 0xfffe001c, 4, base=16, bitRange=8 -sfr = "SPI0_IMR.TXEMPTY", "Memory", 0xfffe001c, 4, base=16, bitRange=9 -sfr = "SPI0_CSR", "Memory", 0xfffe0030, 4, base=16 -sfr = "SPI0_CSR.CPOL", "Memory", 0xfffe0030, 4, base=16, bitRange=0 -sfr = "SPI0_CSR.NCPHA", "Memory", 0xfffe0030, 4, base=16, bitRange=1 -sfr = "SPI0_CSR.CSAAT", "Memory", 0xfffe0030, 4, base=16, bitRange=3 -sfr = "SPI0_CSR.BITS", "Memory", 0xfffe0030, 4, base=16, bitRange=4-7 -sfr = "SPI0_CSR.SCBR", "Memory", 0xfffe0030, 4, base=16, bitRange=8-15 -sfr = "SPI0_CSR.DLYBS", "Memory", 0xfffe0030, 4, base=16, bitRange=16-23 -sfr = "SPI0_CSR.DLYBCT", "Memory", 0xfffe0030, 4, base=16, bitRange=24-31 -; ========== Register definition for PDC_US1 peripheral ========== -sfr = "US1_RPR", "Memory", 0xfffc4100, 4, base=16 -sfr = "US1_RCR", "Memory", 0xfffc4104, 4, base=16 -sfr = "US1_TPR", "Memory", 0xfffc4108, 4, base=16 -sfr = "US1_TCR", "Memory", 0xfffc410c, 4, base=16 -sfr = "US1_RNPR", "Memory", 0xfffc4110, 4, base=16 -sfr = "US1_RNCR", "Memory", 0xfffc4114, 4, base=16 -sfr = "US1_TNPR", "Memory", 0xfffc4118, 4, base=16 -sfr = "US1_TNCR", "Memory", 0xfffc411c, 4, base=16 -sfr = "US1_PTCR", "Memory", 0xfffc4120, 4, base=16 -sfr = "US1_PTCR.RXTEN", "Memory", 0xfffc4120, 4, base=16, bitRange=0 -sfr = "US1_PTCR.RXTDIS", "Memory", 0xfffc4120, 4, base=16, bitRange=1 -sfr = "US1_PTCR.TXTEN", "Memory", 0xfffc4120, 4, base=16, bitRange=8 -sfr = "US1_PTCR.TXTDIS", "Memory", 0xfffc4120, 4, base=16, bitRange=9 -sfr = "US1_PTSR", "Memory", 0xfffc4124, 4, base=16 -sfr = "US1_PTSR.RXTEN", "Memory", 0xfffc4124, 4, base=16, bitRange=0 -sfr = "US1_PTSR.TXTEN", "Memory", 0xfffc4124, 4, base=16, bitRange=8 -; ========== Register definition for US1 peripheral ========== -sfr = "US1_CR", "Memory", 0xfffc4000, 4, base=16 -sfr = "US1_CR.RSTRX", "Memory", 0xfffc4000, 4, base=16, bitRange=2 -sfr = "US1_CR.RSTTX", "Memory", 0xfffc4000, 4, base=16, bitRange=3 -sfr = "US1_CR.RXEN", "Memory", 0xfffc4000, 4, base=16, bitRange=4 -sfr = "US1_CR.RXDIS", "Memory", 0xfffc4000, 4, base=16, bitRange=5 -sfr = "US1_CR.TXEN", "Memory", 0xfffc4000, 4, base=16, bitRange=6 -sfr = "US1_CR.TXDIS", "Memory", 0xfffc4000, 4, base=16, bitRange=7 -sfr = "US1_CR.RSTSTA", "Memory", 0xfffc4000, 4, base=16, bitRange=8 -sfr = "US1_CR.STTBRK", "Memory", 0xfffc4000, 4, base=16, bitRange=9 -sfr = "US1_CR.STPBRK", "Memory", 0xfffc4000, 4, base=16, bitRange=10 -sfr = "US1_CR.STTTO", "Memory", 0xfffc4000, 4, base=16, bitRange=11 -sfr = "US1_CR.SENDA", "Memory", 0xfffc4000, 4, base=16, bitRange=12 -sfr = "US1_CR.RSTIT", "Memory", 0xfffc4000, 4, base=16, bitRange=13 -sfr = "US1_CR.RSTNACK", "Memory", 0xfffc4000, 4, base=16, bitRange=14 -sfr = "US1_CR.RETTO", "Memory", 0xfffc4000, 4, base=16, bitRange=15 -sfr = "US1_CR.DTREN", "Memory", 0xfffc4000, 4, base=16, bitRange=16 -sfr = "US1_CR.DTRDIS", "Memory", 0xfffc4000, 4, base=16, bitRange=17 -sfr = "US1_CR.RTSEN", "Memory", 0xfffc4000, 4, base=16, bitRange=18 -sfr = "US1_CR.RTSDIS", "Memory", 0xfffc4000, 4, base=16, bitRange=19 -sfr = "US1_MR", "Memory", 0xfffc4004, 4, base=16 -sfr = "US1_MR.USMODE", "Memory", 0xfffc4004, 4, base=16, bitRange=0-3 -sfr = "US1_MR.CLKS", "Memory", 0xfffc4004, 4, base=16, bitRange=4-5 -sfr = "US1_MR.CHRL", "Memory", 0xfffc4004, 4, base=16, bitRange=6-7 -sfr = "US1_MR.SYNC", "Memory", 0xfffc4004, 4, base=16, bitRange=8 -sfr = "US1_MR.PAR", "Memory", 0xfffc4004, 4, base=16, bitRange=9-11 -sfr = "US1_MR.NBSTOP", "Memory", 0xfffc4004, 4, base=16, bitRange=12-13 -sfr = "US1_MR.CHMODE", "Memory", 0xfffc4004, 4, base=16, bitRange=14-15 -sfr = "US1_MR.MSBF", "Memory", 0xfffc4004, 4, base=16, bitRange=16 -sfr = "US1_MR.MODE9", "Memory", 0xfffc4004, 4, base=16, bitRange=17 -sfr = "US1_MR.CKLO", "Memory", 0xfffc4004, 4, base=16, bitRange=18 -sfr = "US1_MR.OVER", "Memory", 0xfffc4004, 4, base=16, bitRange=19 -sfr = "US1_MR.INACK", "Memory", 0xfffc4004, 4, base=16, bitRange=20 -sfr = "US1_MR.DSNACK", "Memory", 0xfffc4004, 4, base=16, bitRange=21 -sfr = "US1_MR.ITER", "Memory", 0xfffc4004, 4, base=16, bitRange=24 -sfr = "US1_MR.FILTER", "Memory", 0xfffc4004, 4, base=16, bitRange=28 -sfr = "US1_IER", "Memory", 0xfffc4008, 4, base=16 -sfr = "US1_IER.RXRDY", "Memory", 0xfffc4008, 4, base=16, bitRange=0 -sfr = "US1_IER.TXRDY", "Memory", 0xfffc4008, 4, base=16, bitRange=1 -sfr = "US1_IER.RXBRK", "Memory", 0xfffc4008, 4, base=16, bitRange=2 -sfr = "US1_IER.ENDRX", "Memory", 0xfffc4008, 4, base=16, bitRange=3 -sfr = "US1_IER.ENDTX", "Memory", 0xfffc4008, 4, base=16, bitRange=4 -sfr = "US1_IER.OVRE", "Memory", 0xfffc4008, 4, base=16, bitRange=5 -sfr = "US1_IER.FRAME", "Memory", 0xfffc4008, 4, base=16, bitRange=6 -sfr = "US1_IER.PARE", "Memory", 0xfffc4008, 4, base=16, bitRange=7 -sfr = "US1_IER.TIMEOUT", "Memory", 0xfffc4008, 4, base=16, bitRange=8 -sfr = "US1_IER.TXEMPTY", "Memory", 0xfffc4008, 4, base=16, bitRange=9 -sfr = "US1_IER.ITERATION", "Memory", 0xfffc4008, 4, base=16, bitRange=10 -sfr = "US1_IER.TXBUFE", "Memory", 0xfffc4008, 4, base=16, bitRange=11 -sfr = "US1_IER.RXBUFF", "Memory", 0xfffc4008, 4, base=16, bitRange=12 -sfr = "US1_IER.NACK", "Memory", 0xfffc4008, 4, base=16, bitRange=13 -sfr = "US1_IER.RIIC", "Memory", 0xfffc4008, 4, base=16, bitRange=16 -sfr = "US1_IER.DSRIC", "Memory", 0xfffc4008, 4, base=16, bitRange=17 -sfr = "US1_IER.DCDIC", "Memory", 0xfffc4008, 4, base=16, bitRange=18 -sfr = "US1_IER.CTSIC", "Memory", 0xfffc4008, 4, base=16, bitRange=19 -sfr = "US1_IDR", "Memory", 0xfffc400c, 4, base=16 -sfr = "US1_IDR.RXRDY", "Memory", 0xfffc400c, 4, base=16, bitRange=0 -sfr = "US1_IDR.TXRDY", "Memory", 0xfffc400c, 4, base=16, bitRange=1 -sfr = "US1_IDR.RXBRK", "Memory", 0xfffc400c, 4, base=16, bitRange=2 -sfr = "US1_IDR.ENDRX", "Memory", 0xfffc400c, 4, base=16, bitRange=3 -sfr = "US1_IDR.ENDTX", "Memory", 0xfffc400c, 4, base=16, bitRange=4 -sfr = "US1_IDR.OVRE", "Memory", 0xfffc400c, 4, base=16, bitRange=5 -sfr = "US1_IDR.FRAME", "Memory", 0xfffc400c, 4, base=16, bitRange=6 -sfr = "US1_IDR.PARE", "Memory", 0xfffc400c, 4, base=16, bitRange=7 -sfr = "US1_IDR.TIMEOUT", "Memory", 0xfffc400c, 4, base=16, bitRange=8 -sfr = "US1_IDR.TXEMPTY", "Memory", 0xfffc400c, 4, base=16, bitRange=9 -sfr = "US1_IDR.ITERATION", "Memory", 0xfffc400c, 4, base=16, bitRange=10 -sfr = "US1_IDR.TXBUFE", "Memory", 0xfffc400c, 4, base=16, bitRange=11 -sfr = "US1_IDR.RXBUFF", "Memory", 0xfffc400c, 4, base=16, bitRange=12 -sfr = "US1_IDR.NACK", "Memory", 0xfffc400c, 4, base=16, bitRange=13 -sfr = "US1_IDR.RIIC", "Memory", 0xfffc400c, 4, base=16, bitRange=16 -sfr = "US1_IDR.DSRIC", "Memory", 0xfffc400c, 4, base=16, bitRange=17 -sfr = "US1_IDR.DCDIC", "Memory", 0xfffc400c, 4, base=16, bitRange=18 -sfr = "US1_IDR.CTSIC", "Memory", 0xfffc400c, 4, base=16, bitRange=19 -sfr = "US1_IMR", "Memory", 0xfffc4010, 4, base=16 -sfr = "US1_IMR.RXRDY", "Memory", 0xfffc4010, 4, base=16, bitRange=0 -sfr = "US1_IMR.TXRDY", "Memory", 0xfffc4010, 4, base=16, bitRange=1 -sfr = "US1_IMR.RXBRK", "Memory", 0xfffc4010, 4, base=16, bitRange=2 -sfr = "US1_IMR.ENDRX", "Memory", 0xfffc4010, 4, base=16, bitRange=3 -sfr = "US1_IMR.ENDTX", "Memory", 0xfffc4010, 4, base=16, bitRange=4 -sfr = "US1_IMR.OVRE", "Memory", 0xfffc4010, 4, base=16, bitRange=5 -sfr = "US1_IMR.FRAME", "Memory", 0xfffc4010, 4, base=16, bitRange=6 -sfr = "US1_IMR.PARE", "Memory", 0xfffc4010, 4, base=16, bitRange=7 -sfr = "US1_IMR.TIMEOUT", "Memory", 0xfffc4010, 4, base=16, bitRange=8 -sfr = "US1_IMR.TXEMPTY", "Memory", 0xfffc4010, 4, base=16, bitRange=9 -sfr = "US1_IMR.ITERATION", "Memory", 0xfffc4010, 4, base=16, bitRange=10 -sfr = "US1_IMR.TXBUFE", "Memory", 0xfffc4010, 4, base=16, bitRange=11 -sfr = "US1_IMR.RXBUFF", "Memory", 0xfffc4010, 4, base=16, bitRange=12 -sfr = "US1_IMR.NACK", "Memory", 0xfffc4010, 4, base=16, bitRange=13 -sfr = "US1_IMR.RIIC", "Memory", 0xfffc4010, 4, base=16, bitRange=16 -sfr = "US1_IMR.DSRIC", "Memory", 0xfffc4010, 4, base=16, bitRange=17 -sfr = "US1_IMR.DCDIC", "Memory", 0xfffc4010, 4, base=16, bitRange=18 -sfr = "US1_IMR.CTSIC", "Memory", 0xfffc4010, 4, base=16, bitRange=19 -sfr = "US1_CSR", "Memory", 0xfffc4014, 4, base=16 -sfr = "US1_CSR.RXRDY", "Memory", 0xfffc4014, 4, base=16, bitRange=0 -sfr = "US1_CSR.TXRDY", "Memory", 0xfffc4014, 4, base=16, bitRange=1 -sfr = "US1_CSR.RXBRK", "Memory", 0xfffc4014, 4, base=16, bitRange=2 -sfr = "US1_CSR.ENDRX", "Memory", 0xfffc4014, 4, base=16, bitRange=3 -sfr = "US1_CSR.ENDTX", "Memory", 0xfffc4014, 4, base=16, bitRange=4 -sfr = "US1_CSR.OVRE", "Memory", 0xfffc4014, 4, base=16, bitRange=5 -sfr = "US1_CSR.FRAME", "Memory", 0xfffc4014, 4, base=16, bitRange=6 -sfr = "US1_CSR.PARE", "Memory", 0xfffc4014, 4, base=16, bitRange=7 -sfr = "US1_CSR.TIMEOUT", "Memory", 0xfffc4014, 4, base=16, bitRange=8 -sfr = "US1_CSR.TXEMPTY", "Memory", 0xfffc4014, 4, base=16, bitRange=9 -sfr = "US1_CSR.ITERATION", "Memory", 0xfffc4014, 4, base=16, bitRange=10 -sfr = "US1_CSR.TXBUFE", "Memory", 0xfffc4014, 4, base=16, bitRange=11 -sfr = "US1_CSR.RXBUFF", "Memory", 0xfffc4014, 4, base=16, bitRange=12 -sfr = "US1_CSR.NACK", "Memory", 0xfffc4014, 4, base=16, bitRange=13 -sfr = "US1_CSR.RIIC", "Memory", 0xfffc4014, 4, base=16, bitRange=16 -sfr = "US1_CSR.DSRIC", "Memory", 0xfffc4014, 4, base=16, bitRange=17 -sfr = "US1_CSR.DCDIC", "Memory", 0xfffc4014, 4, base=16, bitRange=18 -sfr = "US1_CSR.CTSIC", "Memory", 0xfffc4014, 4, base=16, bitRange=19 -sfr = "US1_CSR.RI", "Memory", 0xfffc4014, 4, base=16, bitRange=20 -sfr = "US1_CSR.DSR", "Memory", 0xfffc4014, 4, base=16, bitRange=21 -sfr = "US1_CSR.DCD", "Memory", 0xfffc4014, 4, base=16, bitRange=22 -sfr = "US1_CSR.CTS", "Memory", 0xfffc4014, 4, base=16, bitRange=23 -sfr = "US1_RHR", "Memory", 0xfffc4018, 4, base=16 -sfr = "US1_THR", "Memory", 0xfffc401c, 4, base=16 -sfr = "US1_BRGR", "Memory", 0xfffc4020, 4, base=16 -sfr = "US1_RTOR", "Memory", 0xfffc4024, 4, base=16 -sfr = "US1_TTGR", "Memory", 0xfffc4028, 4, base=16 -sfr = "US1_FIDI", "Memory", 0xfffc4040, 4, base=16 -sfr = "US1_NER", "Memory", 0xfffc4044, 4, base=16 -sfr = "US1_IF", "Memory", 0xfffc404c, 4, base=16 -; ========== Register definition for PDC_US0 peripheral ========== -sfr = "US0_RPR", "Memory", 0xfffc0100, 4, base=16 -sfr = "US0_RCR", "Memory", 0xfffc0104, 4, base=16 -sfr = "US0_TPR", "Memory", 0xfffc0108, 4, base=16 -sfr = "US0_TCR", "Memory", 0xfffc010c, 4, base=16 -sfr = "US0_RNPR", "Memory", 0xfffc0110, 4, base=16 -sfr = "US0_RNCR", "Memory", 0xfffc0114, 4, base=16 -sfr = "US0_TNPR", "Memory", 0xfffc0118, 4, base=16 -sfr = "US0_TNCR", "Memory", 0xfffc011c, 4, base=16 -sfr = "US0_PTCR", "Memory", 0xfffc0120, 4, base=16 -sfr = "US0_PTCR.RXTEN", "Memory", 0xfffc0120, 4, base=16, bitRange=0 -sfr = "US0_PTCR.RXTDIS", "Memory", 0xfffc0120, 4, base=16, bitRange=1 -sfr = "US0_PTCR.TXTEN", "Memory", 0xfffc0120, 4, base=16, bitRange=8 -sfr = "US0_PTCR.TXTDIS", "Memory", 0xfffc0120, 4, base=16, bitRange=9 -sfr = "US0_PTSR", "Memory", 0xfffc0124, 4, base=16 -sfr = "US0_PTSR.RXTEN", "Memory", 0xfffc0124, 4, base=16, bitRange=0 -sfr = "US0_PTSR.TXTEN", "Memory", 0xfffc0124, 4, base=16, bitRange=8 -; ========== Register definition for US0 peripheral ========== -sfr = "US0_CR", "Memory", 0xfffc0000, 4, base=16 -sfr = "US0_CR.RSTRX", "Memory", 0xfffc0000, 4, base=16, bitRange=2 -sfr = "US0_CR.RSTTX", "Memory", 0xfffc0000, 4, base=16, bitRange=3 -sfr = "US0_CR.RXEN", "Memory", 0xfffc0000, 4, base=16, bitRange=4 -sfr = "US0_CR.RXDIS", "Memory", 0xfffc0000, 4, base=16, bitRange=5 -sfr = "US0_CR.TXEN", "Memory", 0xfffc0000, 4, base=16, bitRange=6 -sfr = "US0_CR.TXDIS", "Memory", 0xfffc0000, 4, base=16, bitRange=7 -sfr = "US0_CR.RSTSTA", "Memory", 0xfffc0000, 4, base=16, bitRange=8 -sfr = "US0_CR.STTBRK", "Memory", 0xfffc0000, 4, base=16, bitRange=9 -sfr = "US0_CR.STPBRK", "Memory", 0xfffc0000, 4, base=16, bitRange=10 -sfr = "US0_CR.STTTO", "Memory", 0xfffc0000, 4, base=16, bitRange=11 -sfr = "US0_CR.SENDA", "Memory", 0xfffc0000, 4, base=16, bitRange=12 -sfr = "US0_CR.RSTIT", "Memory", 0xfffc0000, 4, base=16, bitRange=13 -sfr = "US0_CR.RSTNACK", "Memory", 0xfffc0000, 4, base=16, bitRange=14 -sfr = "US0_CR.RETTO", "Memory", 0xfffc0000, 4, base=16, bitRange=15 -sfr = "US0_CR.DTREN", "Memory", 0xfffc0000, 4, base=16, bitRange=16 -sfr = "US0_CR.DTRDIS", "Memory", 0xfffc0000, 4, base=16, bitRange=17 -sfr = "US0_CR.RTSEN", "Memory", 0xfffc0000, 4, base=16, bitRange=18 -sfr = "US0_CR.RTSDIS", "Memory", 0xfffc0000, 4, base=16, bitRange=19 -sfr = "US0_MR", "Memory", 0xfffc0004, 4, base=16 -sfr = "US0_MR.USMODE", "Memory", 0xfffc0004, 4, base=16, bitRange=0-3 -sfr = "US0_MR.CLKS", "Memory", 0xfffc0004, 4, base=16, bitRange=4-5 -sfr = "US0_MR.CHRL", "Memory", 0xfffc0004, 4, base=16, bitRange=6-7 -sfr = "US0_MR.SYNC", "Memory", 0xfffc0004, 4, base=16, bitRange=8 -sfr = "US0_MR.PAR", "Memory", 0xfffc0004, 4, base=16, bitRange=9-11 -sfr = "US0_MR.NBSTOP", "Memory", 0xfffc0004, 4, base=16, bitRange=12-13 -sfr = "US0_MR.CHMODE", "Memory", 0xfffc0004, 4, base=16, bitRange=14-15 -sfr = "US0_MR.MSBF", "Memory", 0xfffc0004, 4, base=16, bitRange=16 -sfr = "US0_MR.MODE9", "Memory", 0xfffc0004, 4, base=16, bitRange=17 -sfr = "US0_MR.CKLO", "Memory", 0xfffc0004, 4, base=16, bitRange=18 -sfr = "US0_MR.OVER", "Memory", 0xfffc0004, 4, base=16, bitRange=19 -sfr = "US0_MR.INACK", "Memory", 0xfffc0004, 4, base=16, bitRange=20 -sfr = "US0_MR.DSNACK", "Memory", 0xfffc0004, 4, base=16, bitRange=21 -sfr = "US0_MR.ITER", "Memory", 0xfffc0004, 4, base=16, bitRange=24 -sfr = "US0_MR.FILTER", "Memory", 0xfffc0004, 4, base=16, bitRange=28 -sfr = "US0_IER", "Memory", 0xfffc0008, 4, base=16 -sfr = "US0_IER.RXRDY", "Memory", 0xfffc0008, 4, base=16, bitRange=0 -sfr = "US0_IER.TXRDY", "Memory", 0xfffc0008, 4, base=16, bitRange=1 -sfr = "US0_IER.RXBRK", "Memory", 0xfffc0008, 4, base=16, bitRange=2 -sfr = "US0_IER.ENDRX", "Memory", 0xfffc0008, 4, base=16, bitRange=3 -sfr = "US0_IER.ENDTX", "Memory", 0xfffc0008, 4, base=16, bitRange=4 -sfr = "US0_IER.OVRE", "Memory", 0xfffc0008, 4, base=16, bitRange=5 -sfr = "US0_IER.FRAME", "Memory", 0xfffc0008, 4, base=16, bitRange=6 -sfr = "US0_IER.PARE", "Memory", 0xfffc0008, 4, base=16, bitRange=7 -sfr = "US0_IER.TIMEOUT", "Memory", 0xfffc0008, 4, base=16, bitRange=8 -sfr = "US0_IER.TXEMPTY", "Memory", 0xfffc0008, 4, base=16, bitRange=9 -sfr = "US0_IER.ITERATION", "Memory", 0xfffc0008, 4, base=16, bitRange=10 -sfr = "US0_IER.TXBUFE", "Memory", 0xfffc0008, 4, base=16, bitRange=11 -sfr = "US0_IER.RXBUFF", "Memory", 0xfffc0008, 4, base=16, bitRange=12 -sfr = "US0_IER.NACK", "Memory", 0xfffc0008, 4, base=16, bitRange=13 -sfr = "US0_IER.RIIC", "Memory", 0xfffc0008, 4, base=16, bitRange=16 -sfr = "US0_IER.DSRIC", "Memory", 0xfffc0008, 4, base=16, bitRange=17 -sfr = "US0_IER.DCDIC", "Memory", 0xfffc0008, 4, base=16, bitRange=18 -sfr = "US0_IER.CTSIC", "Memory", 0xfffc0008, 4, base=16, bitRange=19 -sfr = "US0_IDR", "Memory", 0xfffc000c, 4, base=16 -sfr = "US0_IDR.RXRDY", "Memory", 0xfffc000c, 4, base=16, bitRange=0 -sfr = "US0_IDR.TXRDY", "Memory", 0xfffc000c, 4, base=16, bitRange=1 -sfr = "US0_IDR.RXBRK", "Memory", 0xfffc000c, 4, base=16, bitRange=2 -sfr = "US0_IDR.ENDRX", "Memory", 0xfffc000c, 4, base=16, bitRange=3 -sfr = "US0_IDR.ENDTX", "Memory", 0xfffc000c, 4, base=16, bitRange=4 -sfr = "US0_IDR.OVRE", "Memory", 0xfffc000c, 4, base=16, bitRange=5 -sfr = "US0_IDR.FRAME", "Memory", 0xfffc000c, 4, base=16, bitRange=6 -sfr = "US0_IDR.PARE", "Memory", 0xfffc000c, 4, base=16, bitRange=7 -sfr = "US0_IDR.TIMEOUT", "Memory", 0xfffc000c, 4, base=16, bitRange=8 -sfr = "US0_IDR.TXEMPTY", "Memory", 0xfffc000c, 4, base=16, bitRange=9 -sfr = "US0_IDR.ITERATION", "Memory", 0xfffc000c, 4, base=16, bitRange=10 -sfr = "US0_IDR.TXBUFE", "Memory", 0xfffc000c, 4, base=16, bitRange=11 -sfr = "US0_IDR.RXBUFF", "Memory", 0xfffc000c, 4, base=16, bitRange=12 -sfr = "US0_IDR.NACK", "Memory", 0xfffc000c, 4, base=16, bitRange=13 -sfr = "US0_IDR.RIIC", "Memory", 0xfffc000c, 4, base=16, bitRange=16 -sfr = "US0_IDR.DSRIC", "Memory", 0xfffc000c, 4, base=16, bitRange=17 -sfr = "US0_IDR.DCDIC", "Memory", 0xfffc000c, 4, base=16, bitRange=18 -sfr = "US0_IDR.CTSIC", "Memory", 0xfffc000c, 4, base=16, bitRange=19 -sfr = "US0_IMR", "Memory", 0xfffc0010, 4, base=16 -sfr = "US0_IMR.RXRDY", "Memory", 0xfffc0010, 4, base=16, bitRange=0 -sfr = "US0_IMR.TXRDY", "Memory", 0xfffc0010, 4, base=16, bitRange=1 -sfr = "US0_IMR.RXBRK", "Memory", 0xfffc0010, 4, base=16, bitRange=2 -sfr = "US0_IMR.ENDRX", "Memory", 0xfffc0010, 4, base=16, bitRange=3 -sfr = "US0_IMR.ENDTX", "Memory", 0xfffc0010, 4, base=16, bitRange=4 -sfr = "US0_IMR.OVRE", "Memory", 0xfffc0010, 4, base=16, bitRange=5 -sfr = "US0_IMR.FRAME", "Memory", 0xfffc0010, 4, base=16, bitRange=6 -sfr = "US0_IMR.PARE", "Memory", 0xfffc0010, 4, base=16, bitRange=7 -sfr = "US0_IMR.TIMEOUT", "Memory", 0xfffc0010, 4, base=16, bitRange=8 -sfr = "US0_IMR.TXEMPTY", "Memory", 0xfffc0010, 4, base=16, bitRange=9 -sfr = "US0_IMR.ITERATION", "Memory", 0xfffc0010, 4, base=16, bitRange=10 -sfr = "US0_IMR.TXBUFE", "Memory", 0xfffc0010, 4, base=16, bitRange=11 -sfr = "US0_IMR.RXBUFF", "Memory", 0xfffc0010, 4, base=16, bitRange=12 -sfr = "US0_IMR.NACK", "Memory", 0xfffc0010, 4, base=16, bitRange=13 -sfr = "US0_IMR.RIIC", "Memory", 0xfffc0010, 4, base=16, bitRange=16 -sfr = "US0_IMR.DSRIC", "Memory", 0xfffc0010, 4, base=16, bitRange=17 -sfr = "US0_IMR.DCDIC", "Memory", 0xfffc0010, 4, base=16, bitRange=18 -sfr = "US0_IMR.CTSIC", "Memory", 0xfffc0010, 4, base=16, bitRange=19 -sfr = "US0_CSR", "Memory", 0xfffc0014, 4, base=16 -sfr = "US0_CSR.RXRDY", "Memory", 0xfffc0014, 4, base=16, bitRange=0 -sfr = "US0_CSR.TXRDY", "Memory", 0xfffc0014, 4, base=16, bitRange=1 -sfr = "US0_CSR.RXBRK", "Memory", 0xfffc0014, 4, base=16, bitRange=2 -sfr = "US0_CSR.ENDRX", "Memory", 0xfffc0014, 4, base=16, bitRange=3 -sfr = "US0_CSR.ENDTX", "Memory", 0xfffc0014, 4, base=16, bitRange=4 -sfr = "US0_CSR.OVRE", "Memory", 0xfffc0014, 4, base=16, bitRange=5 -sfr = "US0_CSR.FRAME", "Memory", 0xfffc0014, 4, base=16, bitRange=6 -sfr = "US0_CSR.PARE", "Memory", 0xfffc0014, 4, base=16, bitRange=7 -sfr = "US0_CSR.TIMEOUT", "Memory", 0xfffc0014, 4, base=16, bitRange=8 -sfr = "US0_CSR.TXEMPTY", "Memory", 0xfffc0014, 4, base=16, bitRange=9 -sfr = "US0_CSR.ITERATION", "Memory", 0xfffc0014, 4, base=16, bitRange=10 -sfr = "US0_CSR.TXBUFE", "Memory", 0xfffc0014, 4, base=16, bitRange=11 -sfr = "US0_CSR.RXBUFF", "Memory", 0xfffc0014, 4, base=16, bitRange=12 -sfr = "US0_CSR.NACK", "Memory", 0xfffc0014, 4, base=16, bitRange=13 -sfr = "US0_CSR.RIIC", "Memory", 0xfffc0014, 4, base=16, bitRange=16 -sfr = "US0_CSR.DSRIC", "Memory", 0xfffc0014, 4, base=16, bitRange=17 -sfr = "US0_CSR.DCDIC", "Memory", 0xfffc0014, 4, base=16, bitRange=18 -sfr = "US0_CSR.CTSIC", "Memory", 0xfffc0014, 4, base=16, bitRange=19 -sfr = "US0_CSR.RI", "Memory", 0xfffc0014, 4, base=16, bitRange=20 -sfr = "US0_CSR.DSR", "Memory", 0xfffc0014, 4, base=16, bitRange=21 -sfr = "US0_CSR.DCD", "Memory", 0xfffc0014, 4, base=16, bitRange=22 -sfr = "US0_CSR.CTS", "Memory", 0xfffc0014, 4, base=16, bitRange=23 -sfr = "US0_RHR", "Memory", 0xfffc0018, 4, base=16 -sfr = "US0_THR", "Memory", 0xfffc001c, 4, base=16 -sfr = "US0_BRGR", "Memory", 0xfffc0020, 4, base=16 -sfr = "US0_RTOR", "Memory", 0xfffc0024, 4, base=16 -sfr = "US0_TTGR", "Memory", 0xfffc0028, 4, base=16 -sfr = "US0_FIDI", "Memory", 0xfffc0040, 4, base=16 -sfr = "US0_NER", "Memory", 0xfffc0044, 4, base=16 -sfr = "US0_IF", "Memory", 0xfffc004c, 4, base=16 -; ========== Register definition for PDC_SSC peripheral ========== -sfr = "SSC_RPR", "Memory", 0xfffd4100, 4, base=16 -sfr = "SSC_RCR", "Memory", 0xfffd4104, 4, base=16 -sfr = "SSC_TPR", "Memory", 0xfffd4108, 4, base=16 -sfr = "SSC_TCR", "Memory", 0xfffd410c, 4, base=16 -sfr = "SSC_RNPR", "Memory", 0xfffd4110, 4, base=16 -sfr = "SSC_RNCR", "Memory", 0xfffd4114, 4, base=16 -sfr = "SSC_TNPR", "Memory", 0xfffd4118, 4, base=16 -sfr = "SSC_TNCR", "Memory", 0xfffd411c, 4, base=16 -sfr = "SSC_PTCR", "Memory", 0xfffd4120, 4, base=16 -sfr = "SSC_PTCR.RXTEN", "Memory", 0xfffd4120, 4, base=16, bitRange=0 -sfr = "SSC_PTCR.RXTDIS", "Memory", 0xfffd4120, 4, base=16, bitRange=1 -sfr = "SSC_PTCR.TXTEN", "Memory", 0xfffd4120, 4, base=16, bitRange=8 -sfr = "SSC_PTCR.TXTDIS", "Memory", 0xfffd4120, 4, base=16, bitRange=9 -sfr = "SSC_PTSR", "Memory", 0xfffd4124, 4, base=16 -sfr = "SSC_PTSR.RXTEN", "Memory", 0xfffd4124, 4, base=16, bitRange=0 -sfr = "SSC_PTSR.TXTEN", "Memory", 0xfffd4124, 4, base=16, bitRange=8 -; ========== Register definition for SSC peripheral ========== -sfr = "SSC_CR", "Memory", 0xfffd4000, 4, base=16 -sfr = "SSC_CR.RXEN", "Memory", 0xfffd4000, 4, base=16, bitRange=0 -sfr = "SSC_CR.RXDIS", "Memory", 0xfffd4000, 4, base=16, bitRange=1 -sfr = "SSC_CR.TXEN", "Memory", 0xfffd4000, 4, base=16, bitRange=8 -sfr = "SSC_CR.TXDIS", "Memory", 0xfffd4000, 4, base=16, bitRange=9 -sfr = "SSC_CR.SWRST", "Memory", 0xfffd4000, 4, base=16, bitRange=15 -sfr = "SSC_CMR", "Memory", 0xfffd4004, 4, base=16 -sfr = "SSC_RCMR", "Memory", 0xfffd4010, 4, base=16 -sfr = "SSC_RCMR.CKS", "Memory", 0xfffd4010, 4, base=16, bitRange=0-1 -sfr = "SSC_RCMR.CKO", "Memory", 0xfffd4010, 4, base=16, bitRange=2-4 -sfr = "SSC_RCMR.CKI", "Memory", 0xfffd4010, 4, base=16, bitRange=5 -sfr = "SSC_RCMR.CKG", "Memory", 0xfffd4010, 4, base=16, bitRange=6-7 -sfr = "SSC_RCMR.START", "Memory", 0xfffd4010, 4, base=16, bitRange=8-11 -sfr = "SSC_RCMR.STOP", "Memory", 0xfffd4010, 4, base=16, bitRange=12 -sfr = "SSC_RCMR.STTDLY", "Memory", 0xfffd4010, 4, base=16, bitRange=16-23 -sfr = "SSC_RCMR.PERIOD", "Memory", 0xfffd4010, 4, base=16, bitRange=24-31 -sfr = "SSC_RFMR", "Memory", 0xfffd4014, 4, base=16 -sfr = "SSC_RFMR.DATLEN", "Memory", 0xfffd4014, 4, base=16, bitRange=0-4 -sfr = "SSC_RFMR.LOOP", "Memory", 0xfffd4014, 4, base=16, bitRange=5 -sfr = "SSC_RFMR.MSBF", "Memory", 0xfffd4014, 4, base=16, bitRange=7 -sfr = "SSC_RFMR.DATNB", "Memory", 0xfffd4014, 4, base=16, bitRange=8-11 -sfr = "SSC_RFMR.FSLEN", "Memory", 0xfffd4014, 4, base=16, bitRange=16-19 -sfr = "SSC_RFMR.FSOS", "Memory", 0xfffd4014, 4, base=16, bitRange=20-22 -sfr = "SSC_RFMR.FSEDGE", "Memory", 0xfffd4014, 4, base=16, bitRange=24 -sfr = "SSC_TCMR", "Memory", 0xfffd4018, 4, base=16 -sfr = "SSC_TCMR.CKS", "Memory", 0xfffd4018, 4, base=16, bitRange=0-1 -sfr = "SSC_TCMR.CKO", "Memory", 0xfffd4018, 4, base=16, bitRange=2-4 -sfr = "SSC_TCMR.CKI", "Memory", 0xfffd4018, 4, base=16, bitRange=5 -sfr = "SSC_TCMR.CKG", "Memory", 0xfffd4018, 4, base=16, bitRange=6-7 -sfr = "SSC_TCMR.START", "Memory", 0xfffd4018, 4, base=16, bitRange=8-11 -sfr = "SSC_TCMR.STTDLY", "Memory", 0xfffd4018, 4, base=16, bitRange=16-23 -sfr = "SSC_TCMR.PERIOD", "Memory", 0xfffd4018, 4, base=16, bitRange=24-31 -sfr = "SSC_TFMR", "Memory", 0xfffd401c, 4, base=16 -sfr = "SSC_TFMR.DATLEN", "Memory", 0xfffd401c, 4, base=16, bitRange=0-4 -sfr = "SSC_TFMR.DATDEF", "Memory", 0xfffd401c, 4, base=16, bitRange=5 -sfr = "SSC_TFMR.MSBF", "Memory", 0xfffd401c, 4, base=16, bitRange=7 -sfr = "SSC_TFMR.DATNB", "Memory", 0xfffd401c, 4, base=16, bitRange=8-11 -sfr = "SSC_TFMR.FSLEN", "Memory", 0xfffd401c, 4, base=16, bitRange=16-19 -sfr = "SSC_TFMR.FSOS", "Memory", 0xfffd401c, 4, base=16, bitRange=20-22 -sfr = "SSC_TFMR.FSDEN", "Memory", 0xfffd401c, 4, base=16, bitRange=23 -sfr = "SSC_TFMR.FSEDGE", "Memory", 0xfffd401c, 4, base=16, bitRange=24 -sfr = "SSC_RHR", "Memory", 0xfffd4020, 4, base=16 -sfr = "SSC_THR", "Memory", 0xfffd4024, 4, base=16 -sfr = "SSC_RSHR", "Memory", 0xfffd4030, 4, base=16 -sfr = "SSC_TSHR", "Memory", 0xfffd4034, 4, base=16 -sfr = "SSC_SR", "Memory", 0xfffd4040, 4, base=16 -sfr = "SSC_SR.TXRDY", "Memory", 0xfffd4040, 4, base=16, bitRange=0 -sfr = "SSC_SR.TXEMPTY", "Memory", 0xfffd4040, 4, base=16, bitRange=1 -sfr = "SSC_SR.ENDTX", "Memory", 0xfffd4040, 4, base=16, bitRange=2 -sfr = "SSC_SR.TXBUFE", "Memory", 0xfffd4040, 4, base=16, bitRange=3 -sfr = "SSC_SR.RXRDY", "Memory", 0xfffd4040, 4, base=16, bitRange=4 -sfr = "SSC_SR.OVRUN", "Memory", 0xfffd4040, 4, base=16, bitRange=5 -sfr = "SSC_SR.ENDRX", "Memory", 0xfffd4040, 4, base=16, bitRange=6 -sfr = "SSC_SR.RXBUFF", "Memory", 0xfffd4040, 4, base=16, bitRange=7 -sfr = "SSC_SR.CP0", "Memory", 0xfffd4040, 4, base=16, bitRange=8 -sfr = "SSC_SR.CP1", "Memory", 0xfffd4040, 4, base=16, bitRange=9 -sfr = "SSC_SR.TXSYN", "Memory", 0xfffd4040, 4, base=16, bitRange=10 -sfr = "SSC_SR.RXSYN", "Memory", 0xfffd4040, 4, base=16, bitRange=11 -sfr = "SSC_SR.TXENA", "Memory", 0xfffd4040, 4, base=16, bitRange=16 -sfr = "SSC_SR.RXENA", "Memory", 0xfffd4040, 4, base=16, bitRange=17 -sfr = "SSC_IER", "Memory", 0xfffd4044, 4, base=16 -sfr = "SSC_IER.TXRDY", "Memory", 0xfffd4044, 4, base=16, bitRange=0 -sfr = "SSC_IER.TXEMPTY", "Memory", 0xfffd4044, 4, base=16, bitRange=1 -sfr = "SSC_IER.ENDTX", "Memory", 0xfffd4044, 4, base=16, bitRange=2 -sfr = "SSC_IER.TXBUFE", "Memory", 0xfffd4044, 4, base=16, bitRange=3 -sfr = "SSC_IER.RXRDY", "Memory", 0xfffd4044, 4, base=16, bitRange=4 -sfr = "SSC_IER.OVRUN", "Memory", 0xfffd4044, 4, base=16, bitRange=5 -sfr = "SSC_IER.ENDRX", "Memory", 0xfffd4044, 4, base=16, bitRange=6 -sfr = "SSC_IER.RXBUFF", "Memory", 0xfffd4044, 4, base=16, bitRange=7 -sfr = "SSC_IER.CP0", "Memory", 0xfffd4044, 4, base=16, bitRange=8 -sfr = "SSC_IER.CP1", "Memory", 0xfffd4044, 4, base=16, bitRange=9 -sfr = "SSC_IER.TXSYN", "Memory", 0xfffd4044, 4, base=16, bitRange=10 -sfr = "SSC_IER.RXSYN", "Memory", 0xfffd4044, 4, base=16, bitRange=11 -sfr = "SSC_IDR", "Memory", 0xfffd4048, 4, base=16 -sfr = "SSC_IDR.TXRDY", "Memory", 0xfffd4048, 4, base=16, bitRange=0 -sfr = "SSC_IDR.TXEMPTY", "Memory", 0xfffd4048, 4, base=16, bitRange=1 -sfr = "SSC_IDR.ENDTX", "Memory", 0xfffd4048, 4, base=16, bitRange=2 -sfr = "SSC_IDR.TXBUFE", "Memory", 0xfffd4048, 4, base=16, bitRange=3 -sfr = "SSC_IDR.RXRDY", "Memory", 0xfffd4048, 4, base=16, bitRange=4 -sfr = "SSC_IDR.OVRUN", "Memory", 0xfffd4048, 4, base=16, bitRange=5 -sfr = "SSC_IDR.ENDRX", "Memory", 0xfffd4048, 4, base=16, bitRange=6 -sfr = "SSC_IDR.RXBUFF", "Memory", 0xfffd4048, 4, base=16, bitRange=7 -sfr = "SSC_IDR.CP0", "Memory", 0xfffd4048, 4, base=16, bitRange=8 -sfr = "SSC_IDR.CP1", "Memory", 0xfffd4048, 4, base=16, bitRange=9 -sfr = "SSC_IDR.TXSYN", "Memory", 0xfffd4048, 4, base=16, bitRange=10 -sfr = "SSC_IDR.RXSYN", "Memory", 0xfffd4048, 4, base=16, bitRange=11 -sfr = "SSC_IMR", "Memory", 0xfffd404c, 4, base=16 -sfr = "SSC_IMR.TXRDY", "Memory", 0xfffd404c, 4, base=16, bitRange=0 -sfr = "SSC_IMR.TXEMPTY", "Memory", 0xfffd404c, 4, base=16, bitRange=1 -sfr = "SSC_IMR.ENDTX", "Memory", 0xfffd404c, 4, base=16, bitRange=2 -sfr = "SSC_IMR.TXBUFE", "Memory", 0xfffd404c, 4, base=16, bitRange=3 -sfr = "SSC_IMR.RXRDY", "Memory", 0xfffd404c, 4, base=16, bitRange=4 -sfr = "SSC_IMR.OVRUN", "Memory", 0xfffd404c, 4, base=16, bitRange=5 -sfr = "SSC_IMR.ENDRX", "Memory", 0xfffd404c, 4, base=16, bitRange=6 -sfr = "SSC_IMR.RXBUFF", "Memory", 0xfffd404c, 4, base=16, bitRange=7 -sfr = "SSC_IMR.CP0", "Memory", 0xfffd404c, 4, base=16, bitRange=8 -sfr = "SSC_IMR.CP1", "Memory", 0xfffd404c, 4, base=16, bitRange=9 -sfr = "SSC_IMR.TXSYN", "Memory", 0xfffd404c, 4, base=16, bitRange=10 -sfr = "SSC_IMR.RXSYN", "Memory", 0xfffd404c, 4, base=16, bitRange=11 -; ========== Register definition for TWI peripheral ========== -sfr = "TWI_CR", "Memory", 0xfffb8000, 4, base=16 -sfr = "TWI_CR.START", "Memory", 0xfffb8000, 4, base=16, bitRange=0 -sfr = "TWI_CR.STOP", "Memory", 0xfffb8000, 4, base=16, bitRange=1 -sfr = "TWI_CR.MSEN", "Memory", 0xfffb8000, 4, base=16, bitRange=2 -sfr = "TWI_CR.MSDIS", "Memory", 0xfffb8000, 4, base=16, bitRange=3 -sfr = "TWI_CR.SWRST", "Memory", 0xfffb8000, 4, base=16, bitRange=7 -sfr = "TWI_MMR", "Memory", 0xfffb8004, 4, base=16 -sfr = "TWI_MMR.IADRSZ", "Memory", 0xfffb8004, 4, base=16, bitRange=8-9 -sfr = "TWI_MMR.MREAD", "Memory", 0xfffb8004, 4, base=16, bitRange=12 -sfr = "TWI_MMR.DADR", "Memory", 0xfffb8004, 4, base=16, bitRange=16-22 -sfr = "TWI_IADR", "Memory", 0xfffb800c, 4, base=16 -sfr = "TWI_CWGR", "Memory", 0xfffb8010, 4, base=16 -sfr = "TWI_CWGR.CLDIV", "Memory", 0xfffb8010, 4, base=16, bitRange=0-7 -sfr = "TWI_CWGR.CHDIV", "Memory", 0xfffb8010, 4, base=16, bitRange=8-15 -sfr = "TWI_CWGR.CKDIV", "Memory", 0xfffb8010, 4, base=16, bitRange=16-18 -sfr = "TWI_SR", "Memory", 0xfffb8020, 4, base=16 -sfr = "TWI_SR.TXCOMP", "Memory", 0xfffb8020, 4, base=16, bitRange=0 -sfr = "TWI_SR.RXRDY", "Memory", 0xfffb8020, 4, base=16, bitRange=1 -sfr = "TWI_SR.TXRDY", "Memory", 0xfffb8020, 4, base=16, bitRange=2 -sfr = "TWI_SR.OVRE", "Memory", 0xfffb8020, 4, base=16, bitRange=6 -sfr = "TWI_SR.UNRE", "Memory", 0xfffb8020, 4, base=16, bitRange=7 -sfr = "TWI_SR.NACK", "Memory", 0xfffb8020, 4, base=16, bitRange=8 -sfr = "TWI_IER", "Memory", 0xfffb8024, 4, base=16 -sfr = "TWI_IER.TXCOMP", "Memory", 0xfffb8024, 4, base=16, bitRange=0 -sfr = "TWI_IER.RXRDY", "Memory", 0xfffb8024, 4, base=16, bitRange=1 -sfr = "TWI_IER.TXRDY", "Memory", 0xfffb8024, 4, base=16, bitRange=2 -sfr = "TWI_IER.OVRE", "Memory", 0xfffb8024, 4, base=16, bitRange=6 -sfr = "TWI_IER.UNRE", "Memory", 0xfffb8024, 4, base=16, bitRange=7 -sfr = "TWI_IER.NACK", "Memory", 0xfffb8024, 4, base=16, bitRange=8 -sfr = "TWI_IDR", "Memory", 0xfffb8028, 4, base=16 -sfr = "TWI_IDR.TXCOMP", "Memory", 0xfffb8028, 4, base=16, bitRange=0 -sfr = "TWI_IDR.RXRDY", "Memory", 0xfffb8028, 4, base=16, bitRange=1 -sfr = "TWI_IDR.TXRDY", "Memory", 0xfffb8028, 4, base=16, bitRange=2 -sfr = "TWI_IDR.OVRE", "Memory", 0xfffb8028, 4, base=16, bitRange=6 -sfr = "TWI_IDR.UNRE", "Memory", 0xfffb8028, 4, base=16, bitRange=7 -sfr = "TWI_IDR.NACK", "Memory", 0xfffb8028, 4, base=16, bitRange=8 -sfr = "TWI_IMR", "Memory", 0xfffb802c, 4, base=16 -sfr = "TWI_IMR.TXCOMP", "Memory", 0xfffb802c, 4, base=16, bitRange=0 -sfr = "TWI_IMR.RXRDY", "Memory", 0xfffb802c, 4, base=16, bitRange=1 -sfr = "TWI_IMR.TXRDY", "Memory", 0xfffb802c, 4, base=16, bitRange=2 -sfr = "TWI_IMR.OVRE", "Memory", 0xfffb802c, 4, base=16, bitRange=6 -sfr = "TWI_IMR.UNRE", "Memory", 0xfffb802c, 4, base=16, bitRange=7 -sfr = "TWI_IMR.NACK", "Memory", 0xfffb802c, 4, base=16, bitRange=8 -sfr = "TWI_RHR", "Memory", 0xfffb8030, 4, base=16 -sfr = "TWI_THR", "Memory", 0xfffb8034, 4, base=16 -; ========== Register definition for PWMC_CH3 peripheral ========== -sfr = "PWMC_CH3_CMR", "Memory", 0xfffcc260, 4, base=16 -sfr = "PWMC_CH3_CMR.CPRE", "Memory", 0xfffcc260, 4, base=16, bitRange=0-3 -sfr = "PWMC_CH3_CMR.CALG", "Memory", 0xfffcc260, 4, base=16, bitRange=8 -sfr = "PWMC_CH3_CMR.CPOL", "Memory", 0xfffcc260, 4, base=16, bitRange=9 -sfr = "PWMC_CH3_CMR.CPD", "Memory", 0xfffcc260, 4, base=16, bitRange=10 -sfr = "PWMC_CH3_CDTYR", "Memory", 0xfffcc264, 4, base=16 -sfr = "PWMC_CH3_CDTYR.CDTY", "Memory", 0xfffcc264, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH3_CPRDR", "Memory", 0xfffcc268, 4, base=16 -sfr = "PWMC_CH3_CPRDR.CPRD", "Memory", 0xfffcc268, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH3_CCNTR", "Memory", 0xfffcc26c, 4, base=16 -sfr = "PWMC_CH3_CCNTR.CCNT", "Memory", 0xfffcc26c, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH3_CUPDR", "Memory", 0xfffcc270, 4, base=16 -sfr = "PWMC_CH3_CUPDR.CUPD", "Memory", 0xfffcc270, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH3_Reserved", "Memory", 0xfffcc274, 4, base=16 -; ========== Register definition for PWMC_CH2 peripheral ========== -sfr = "PWMC_CH2_CMR", "Memory", 0xfffcc240, 4, base=16 -sfr = "PWMC_CH2_CMR.CPRE", "Memory", 0xfffcc240, 4, base=16, bitRange=0-3 -sfr = "PWMC_CH2_CMR.CALG", "Memory", 0xfffcc240, 4, base=16, bitRange=8 -sfr = "PWMC_CH2_CMR.CPOL", "Memory", 0xfffcc240, 4, base=16, bitRange=9 -sfr = "PWMC_CH2_CMR.CPD", "Memory", 0xfffcc240, 4, base=16, bitRange=10 -sfr = "PWMC_CH2_CDTYR", "Memory", 0xfffcc244, 4, base=16 -sfr = "PWMC_CH2_CDTYR.CDTY", "Memory", 0xfffcc244, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH2_CPRDR", "Memory", 0xfffcc248, 4, base=16 -sfr = "PWMC_CH2_CPRDR.CPRD", "Memory", 0xfffcc248, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH2_CCNTR", "Memory", 0xfffcc24c, 4, base=16 -sfr = "PWMC_CH2_CCNTR.CCNT", "Memory", 0xfffcc24c, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH2_CUPDR", "Memory", 0xfffcc250, 4, base=16 -sfr = "PWMC_CH2_CUPDR.CUPD", "Memory", 0xfffcc250, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH2_Reserved", "Memory", 0xfffcc254, 4, base=16 -; ========== Register definition for PWMC_CH1 peripheral ========== -sfr = "PWMC_CH1_CMR", "Memory", 0xfffcc220, 4, base=16 -sfr = "PWMC_CH1_CMR.CPRE", "Memory", 0xfffcc220, 4, base=16, bitRange=0-3 -sfr = "PWMC_CH1_CMR.CALG", "Memory", 0xfffcc220, 4, base=16, bitRange=8 -sfr = "PWMC_CH1_CMR.CPOL", "Memory", 0xfffcc220, 4, base=16, bitRange=9 -sfr = "PWMC_CH1_CMR.CPD", "Memory", 0xfffcc220, 4, base=16, bitRange=10 -sfr = "PWMC_CH1_CDTYR", "Memory", 0xfffcc224, 4, base=16 -sfr = "PWMC_CH1_CDTYR.CDTY", "Memory", 0xfffcc224, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH1_CPRDR", "Memory", 0xfffcc228, 4, base=16 -sfr = "PWMC_CH1_CPRDR.CPRD", "Memory", 0xfffcc228, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH1_CCNTR", "Memory", 0xfffcc22c, 4, base=16 -sfr = "PWMC_CH1_CCNTR.CCNT", "Memory", 0xfffcc22c, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH1_CUPDR", "Memory", 0xfffcc230, 4, base=16 -sfr = "PWMC_CH1_CUPDR.CUPD", "Memory", 0xfffcc230, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH1_Reserved", "Memory", 0xfffcc234, 4, base=16 -; ========== Register definition for PWMC_CH0 peripheral ========== -sfr = "PWMC_CH0_CMR", "Memory", 0xfffcc200, 4, base=16 -sfr = "PWMC_CH0_CMR.CPRE", "Memory", 0xfffcc200, 4, base=16, bitRange=0-3 -sfr = "PWMC_CH0_CMR.CALG", "Memory", 0xfffcc200, 4, base=16, bitRange=8 -sfr = "PWMC_CH0_CMR.CPOL", "Memory", 0xfffcc200, 4, base=16, bitRange=9 -sfr = "PWMC_CH0_CMR.CPD", "Memory", 0xfffcc200, 4, base=16, bitRange=10 -sfr = "PWMC_CH0_CDTYR", "Memory", 0xfffcc204, 4, base=16 -sfr = "PWMC_CH0_CDTYR.CDTY", "Memory", 0xfffcc204, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH0_CPRDR", "Memory", 0xfffcc208, 4, base=16 -sfr = "PWMC_CH0_CPRDR.CPRD", "Memory", 0xfffcc208, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH0_CCNTR", "Memory", 0xfffcc20c, 4, base=16 -sfr = "PWMC_CH0_CCNTR.CCNT", "Memory", 0xfffcc20c, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH0_CUPDR", "Memory", 0xfffcc210, 4, base=16 -sfr = "PWMC_CH0_CUPDR.CUPD", "Memory", 0xfffcc210, 4, base=16, bitRange=0-31 -sfr = "PWMC_CH0_Reserved", "Memory", 0xfffcc214, 4, base=16 -; ========== Register definition for PWMC peripheral ========== -sfr = "PWMC_MR", "Memory", 0xfffcc000, 4, base=16 -sfr = "PWMC_MR.DIVA", "Memory", 0xfffcc000, 4, base=16, bitRange=0-7 -sfr = "PWMC_MR.PREA", "Memory", 0xfffcc000, 4, base=16, bitRange=8-11 -sfr = "PWMC_MR.DIVB", "Memory", 0xfffcc000, 4, base=16, bitRange=16-23 -sfr = "PWMC_MR.PREB", "Memory", 0xfffcc000, 4, base=16, bitRange=24-27 -sfr = "PWMC_ENA", "Memory", 0xfffcc004, 4, base=16 -sfr = "PWMC_ENA.CHID0", "Memory", 0xfffcc004, 4, base=16, bitRange=0 -sfr = "PWMC_ENA.CHID1", "Memory", 0xfffcc004, 4, base=16, bitRange=1 -sfr = "PWMC_ENA.CHID2", "Memory", 0xfffcc004, 4, base=16, bitRange=2 -sfr = "PWMC_ENA.CHID3", "Memory", 0xfffcc004, 4, base=16, bitRange=3 -sfr = "PWMC_DIS", "Memory", 0xfffcc008, 4, base=16 -sfr = "PWMC_DIS.CHID0", "Memory", 0xfffcc008, 4, base=16, bitRange=0 -sfr = "PWMC_DIS.CHID1", "Memory", 0xfffcc008, 4, base=16, bitRange=1 -sfr = "PWMC_DIS.CHID2", "Memory", 0xfffcc008, 4, base=16, bitRange=2 -sfr = "PWMC_DIS.CHID3", "Memory", 0xfffcc008, 4, base=16, bitRange=3 -sfr = "PWMC_SR", "Memory", 0xfffcc00c, 4, base=16 -sfr = "PWMC_SR.CHID0", "Memory", 0xfffcc00c, 4, base=16, bitRange=0 -sfr = "PWMC_SR.CHID1", "Memory", 0xfffcc00c, 4, base=16, bitRange=1 -sfr = "PWMC_SR.CHID2", "Memory", 0xfffcc00c, 4, base=16, bitRange=2 -sfr = "PWMC_SR.CHID3", "Memory", 0xfffcc00c, 4, base=16, bitRange=3 -sfr = "PWMC_IER", "Memory", 0xfffcc010, 4, base=16 -sfr = "PWMC_IER.CHID0", "Memory", 0xfffcc010, 4, base=16, bitRange=0 -sfr = "PWMC_IER.CHID1", "Memory", 0xfffcc010, 4, base=16, bitRange=1 -sfr = "PWMC_IER.CHID2", "Memory", 0xfffcc010, 4, base=16, bitRange=2 -sfr = "PWMC_IER.CHID3", "Memory", 0xfffcc010, 4, base=16, bitRange=3 -sfr = "PWMC_IDR", "Memory", 0xfffcc014, 4, base=16 -sfr = "PWMC_IDR.CHID0", "Memory", 0xfffcc014, 4, base=16, bitRange=0 -sfr = "PWMC_IDR.CHID1", "Memory", 0xfffcc014, 4, base=16, bitRange=1 -sfr = "PWMC_IDR.CHID2", "Memory", 0xfffcc014, 4, base=16, bitRange=2 -sfr = "PWMC_IDR.CHID3", "Memory", 0xfffcc014, 4, base=16, bitRange=3 -sfr = "PWMC_IMR", "Memory", 0xfffcc018, 4, base=16 -sfr = "PWMC_IMR.CHID0", "Memory", 0xfffcc018, 4, base=16, bitRange=0 -sfr = "PWMC_IMR.CHID1", "Memory", 0xfffcc018, 4, base=16, bitRange=1 -sfr = "PWMC_IMR.CHID2", "Memory", 0xfffcc018, 4, base=16, bitRange=2 -sfr = "PWMC_IMR.CHID3", "Memory", 0xfffcc018, 4, base=16, bitRange=3 -sfr = "PWMC_ISR", "Memory", 0xfffcc01c, 4, base=16 -sfr = "PWMC_ISR.CHID0", "Memory", 0xfffcc01c, 4, base=16, bitRange=0 -sfr = "PWMC_ISR.CHID1", "Memory", 0xfffcc01c, 4, base=16, bitRange=1 -sfr = "PWMC_ISR.CHID2", "Memory", 0xfffcc01c, 4, base=16, bitRange=2 -sfr = "PWMC_ISR.CHID3", "Memory", 0xfffcc01c, 4, base=16, bitRange=3 -sfr = "PWMC_VR", "Memory", 0xfffcc0fc, 4, base=16 -; ========== Register definition for UDP peripheral ========== -sfr = "UDP_NUM", "Memory", 0xfffb0000, 4, base=16 -sfr = "UDP_NUM.NUM", "Memory", 0xfffb0000, 4, base=16, bitRange=0-10 -sfr = "UDP_NUM.ERR", "Memory", 0xfffb0000, 4, base=16, bitRange=16 -sfr = "UDP_NUM.OK", "Memory", 0xfffb0000, 4, base=16, bitRange=17 -sfr = "UDP_GLBSTATE", "Memory", 0xfffb0004, 4, base=16 -sfr = "UDP_GLBSTATE.FADDEN", "Memory", 0xfffb0004, 4, base=16, bitRange=0 -sfr = "UDP_GLBSTATE.CONFG", "Memory", 0xfffb0004, 4, base=16, bitRange=1 -sfr = "UDP_GLBSTATE.ESR", "Memory", 0xfffb0004, 4, base=16, bitRange=2 -sfr = "UDP_GLBSTATE.RSMINPR", "Memory", 0xfffb0004, 4, base=16, bitRange=3 -sfr = "UDP_GLBSTATE.RMWUPE", "Memory", 0xfffb0004, 4, base=16, bitRange=4 -sfr = "UDP_FADDR", "Memory", 0xfffb0008, 4, base=16 -sfr = "UDP_FADDR.FADD", "Memory", 0xfffb0008, 4, base=16, bitRange=0-7 -sfr = "UDP_FADDR.FEN", "Memory", 0xfffb0008, 4, base=16, bitRange=8 -sfr = "UDP_IER", "Memory", 0xfffb0010, 4, base=16 -sfr = "UDP_IER.EPINT0", "Memory", 0xfffb0010, 4, base=16, bitRange=0 -sfr = "UDP_IER.EPINT1", "Memory", 0xfffb0010, 4, base=16, bitRange=1 -sfr = "UDP_IER.EPINT2", "Memory", 0xfffb0010, 4, base=16, bitRange=2 -sfr = "UDP_IER.EPINT3", "Memory", 0xfffb0010, 4, base=16, bitRange=3 -sfr = "UDP_IER.EPINT4", "Memory", 0xfffb0010, 4, base=16, bitRange=4 -sfr = "UDP_IER.EPINT5", "Memory", 0xfffb0010, 4, base=16, bitRange=5 -sfr = "UDP_IER.RXSUSP", "Memory", 0xfffb0010, 4, base=16, bitRange=8 -sfr = "UDP_IER.RXRSM", "Memory", 0xfffb0010, 4, base=16, bitRange=9 -sfr = "UDP_IER.EXTRSM", "Memory", 0xfffb0010, 4, base=16, bitRange=10 -sfr = "UDP_IER.SOFINT", "Memory", 0xfffb0010, 4, base=16, bitRange=11 -sfr = "UDP_IER.WAKEUP", "Memory", 0xfffb0010, 4, base=16, bitRange=13 -sfr = "UDP_IDR", "Memory", 0xfffb0014, 4, base=16 -sfr = "UDP_IDR.EPINT0", "Memory", 0xfffb0014, 4, base=16, bitRange=0 -sfr = "UDP_IDR.EPINT1", "Memory", 0xfffb0014, 4, base=16, bitRange=1 -sfr = "UDP_IDR.EPINT2", "Memory", 0xfffb0014, 4, base=16, bitRange=2 -sfr = "UDP_IDR.EPINT3", "Memory", 0xfffb0014, 4, base=16, bitRange=3 -sfr = "UDP_IDR.EPINT4", "Memory", 0xfffb0014, 4, base=16, bitRange=4 -sfr = "UDP_IDR.EPINT5", "Memory", 0xfffb0014, 4, base=16, bitRange=5 -sfr = "UDP_IDR.RXSUSP", "Memory", 0xfffb0014, 4, base=16, bitRange=8 -sfr = "UDP_IDR.RXRSM", "Memory", 0xfffb0014, 4, base=16, bitRange=9 -sfr = "UDP_IDR.EXTRSM", "Memory", 0xfffb0014, 4, base=16, bitRange=10 -sfr = "UDP_IDR.SOFINT", "Memory", 0xfffb0014, 4, base=16, bitRange=11 -sfr = "UDP_IDR.WAKEUP", "Memory", 0xfffb0014, 4, base=16, bitRange=13 -sfr = "UDP_IMR", "Memory", 0xfffb0018, 4, base=16 -sfr = "UDP_IMR.EPINT0", "Memory", 0xfffb0018, 4, base=16, bitRange=0 -sfr = "UDP_IMR.EPINT1", "Memory", 0xfffb0018, 4, base=16, bitRange=1 -sfr = "UDP_IMR.EPINT2", "Memory", 0xfffb0018, 4, base=16, bitRange=2 -sfr = "UDP_IMR.EPINT3", "Memory", 0xfffb0018, 4, base=16, bitRange=3 -sfr = "UDP_IMR.EPINT4", "Memory", 0xfffb0018, 4, base=16, bitRange=4 -sfr = "UDP_IMR.EPINT5", "Memory", 0xfffb0018, 4, base=16, bitRange=5 -sfr = "UDP_IMR.RXSUSP", "Memory", 0xfffb0018, 4, base=16, bitRange=8 -sfr = "UDP_IMR.RXRSM", "Memory", 0xfffb0018, 4, base=16, bitRange=9 -sfr = "UDP_IMR.EXTRSM", "Memory", 0xfffb0018, 4, base=16, bitRange=10 -sfr = "UDP_IMR.SOFINT", "Memory", 0xfffb0018, 4, base=16, bitRange=11 -sfr = "UDP_IMR.WAKEUP", "Memory", 0xfffb0018, 4, base=16, bitRange=13 -sfr = "UDP_ISR", "Memory", 0xfffb001c, 4, base=16 -sfr = "UDP_ISR.EPINT0", "Memory", 0xfffb001c, 4, base=16, bitRange=0 -sfr = "UDP_ISR.EPINT1", "Memory", 0xfffb001c, 4, base=16, bitRange=1 -sfr = "UDP_ISR.EPINT2", "Memory", 0xfffb001c, 4, base=16, bitRange=2 -sfr = "UDP_ISR.EPINT3", "Memory", 0xfffb001c, 4, base=16, bitRange=3 -sfr = "UDP_ISR.EPINT4", "Memory", 0xfffb001c, 4, base=16, bitRange=4 -sfr = "UDP_ISR.EPINT5", "Memory", 0xfffb001c, 4, base=16, bitRange=5 -sfr = "UDP_ISR.RXSUSP", "Memory", 0xfffb001c, 4, base=16, bitRange=8 -sfr = "UDP_ISR.RXRSM", "Memory", 0xfffb001c, 4, base=16, bitRange=9 -sfr = "UDP_ISR.EXTRSM", "Memory", 0xfffb001c, 4, base=16, bitRange=10 -sfr = "UDP_ISR.SOFINT", "Memory", 0xfffb001c, 4, base=16, bitRange=11 -sfr = "UDP_ISR.ENDBUSRES", "Memory", 0xfffb001c, 4, base=16, bitRange=12 -sfr = "UDP_ISR.WAKEUP", "Memory", 0xfffb001c, 4, base=16, bitRange=13 -sfr = "UDP_ICR", "Memory", 0xfffb0020, 4, base=16 -sfr = "UDP_ICR.EPINT0", "Memory", 0xfffb0020, 4, base=16, bitRange=0 -sfr = "UDP_ICR.EPINT1", "Memory", 0xfffb0020, 4, base=16, bitRange=1 -sfr = "UDP_ICR.EPINT2", "Memory", 0xfffb0020, 4, base=16, bitRange=2 -sfr = "UDP_ICR.EPINT3", "Memory", 0xfffb0020, 4, base=16, bitRange=3 -sfr = "UDP_ICR.EPINT4", "Memory", 0xfffb0020, 4, base=16, bitRange=4 -sfr = "UDP_ICR.EPINT5", "Memory", 0xfffb0020, 4, base=16, bitRange=5 -sfr = "UDP_ICR.RXSUSP", "Memory", 0xfffb0020, 4, base=16, bitRange=8 -sfr = "UDP_ICR.RXRSM", "Memory", 0xfffb0020, 4, base=16, bitRange=9 -sfr = "UDP_ICR.EXTRSM", "Memory", 0xfffb0020, 4, base=16, bitRange=10 -sfr = "UDP_ICR.SOFINT", "Memory", 0xfffb0020, 4, base=16, bitRange=11 -sfr = "UDP_ICR.WAKEUP", "Memory", 0xfffb0020, 4, base=16, bitRange=13 -sfr = "UDP_RSTEP", "Memory", 0xfffb0028, 4, base=16 -sfr = "UDP_RSTEP.EP0", "Memory", 0xfffb0028, 4, base=16, bitRange=0 -sfr = "UDP_RSTEP.EP1", "Memory", 0xfffb0028, 4, base=16, bitRange=1 -sfr = "UDP_RSTEP.EP2", "Memory", 0xfffb0028, 4, base=16, bitRange=2 -sfr = "UDP_RSTEP.EP3", "Memory", 0xfffb0028, 4, base=16, bitRange=3 -sfr = "UDP_RSTEP.EP4", "Memory", 0xfffb0028, 4, base=16, bitRange=4 -sfr = "UDP_RSTEP.EP5", "Memory", 0xfffb0028, 4, base=16, bitRange=5 -sfr = "UDP_CSR", "Memory", 0xfffb0030, 4, base=16 -sfr = "UDP_CSR.TXCOMP", "Memory", 0xfffb0030, 4, base=16, bitRange=0 -sfr = "UDP_CSR.BK0", "Memory", 0xfffb0030, 4, base=16, bitRange=1 -sfr = "UDP_CSR.RXSETUP", "Memory", 0xfffb0030, 4, base=16, bitRange=2 -sfr = "UDP_CSR.ISOERROR", "Memory", 0xfffb0030, 4, base=16, bitRange=3 -sfr = "UDP_CSR.TXPKTRDY", "Memory", 0xfffb0030, 4, base=16, bitRange=4 -sfr = "UDP_CSR.FORCESTALL", "Memory", 0xfffb0030, 4, base=16, bitRange=5 -sfr = "UDP_CSR.BK1", "Memory", 0xfffb0030, 4, base=16, bitRange=6 -sfr = "UDP_CSR.DIR", "Memory", 0xfffb0030, 4, base=16, bitRange=7 -sfr = "UDP_CSR.EPTYPE", "Memory", 0xfffb0030, 4, base=16, bitRange=8-10 -sfr = "UDP_CSR.DTGLE", "Memory", 0xfffb0030, 4, base=16, bitRange=11 -sfr = "UDP_CSR.EPEDS", "Memory", 0xfffb0030, 4, base=16, bitRange=15 -sfr = "UDP_CSR.RXBYTECNT", "Memory", 0xfffb0030, 4, base=16, bitRange=16-26 -sfr = "UDP_FDR", "Memory", 0xfffb0050, 4, base=16 -sfr = "UDP_TXVC", "Memory", 0xfffb0074, 4, base=16 -sfr = "UDP_TXVC.TXVDIS", "Memory", 0xfffb0074, 4, base=16, bitRange=8 -sfr = "UDP_TXVC.PUON", "Memory", 0xfffb0074, 4, base=16, bitRange=9 -; ========== Register definition for TC0 peripheral ========== -sfr = "TC0_CCR", "Memory", 0xfffa0000, 4, base=16 -sfr = "TC0_CCR.CLKEN", "Memory", 0xfffa0000, 4, base=16, bitRange=0 -sfr = "TC0_CCR.CLKDIS", "Memory", 0xfffa0000, 4, base=16, bitRange=1 -sfr = "TC0_CCR.SWTRG", "Memory", 0xfffa0000, 4, base=16, bitRange=2 -sfr = "TC0_CMR", "Memory", 0xfffa0004, 4, base=16 -sfr = "TC0_CMR.CLKS", "Memory", 0xfffa0004, 4, base=16, bitRange=0-2 -sfr = "TC0_CMR.CLKI", "Memory", 0xfffa0004, 4, base=16, bitRange=3 -sfr = "TC0_CMR.BURST", "Memory", 0xfffa0004, 4, base=16, bitRange=4-5 -sfr = "TC0_CMR.CPCSTOP", "Memory", 0xfffa0004, 4, base=16, bitRange=6 -sfr = "TC0_CMR.LDBSTOP", "Memory", 0xfffa0004, 4, base=16, bitRange=6 -sfr = "TC0_CMR.CPCDIS", "Memory", 0xfffa0004, 4, base=16, bitRange=7 -sfr = "TC0_CMR.LDBDIS", "Memory", 0xfffa0004, 4, base=16, bitRange=7 -sfr = "TC0_CMR.ETRGEDG", "Memory", 0xfffa0004, 4, base=16, bitRange=8-9 -sfr = "TC0_CMR.EEVTEDG", "Memory", 0xfffa0004, 4, base=16, bitRange=8-9 -sfr = "TC0_CMR.EEVT", "Memory", 0xfffa0004, 4, base=16, bitRange=10-11 -sfr = "TC0_CMR.ABETRG", "Memory", 0xfffa0004, 4, base=16, bitRange=10 -sfr = "TC0_CMR.ENETRG", "Memory", 0xfffa0004, 4, base=16, bitRange=12 -sfr = "TC0_CMR.WAVESEL", "Memory", 0xfffa0004, 4, base=16, bitRange=13-14 -sfr = "TC0_CMR.CPCTRG", "Memory", 0xfffa0004, 4, base=16, bitRange=14 -sfr = "TC0_CMR.WAVE", "Memory", 0xfffa0004, 4, base=16, bitRange=15 -sfr = "TC0_CMR.ACPA", "Memory", 0xfffa0004, 4, base=16, bitRange=16-17 -sfr = "TC0_CMR.LDRA", "Memory", 0xfffa0004, 4, base=16, bitRange=16-17 -sfr = "TC0_CMR.ACPC", "Memory", 0xfffa0004, 4, base=16, bitRange=18-19 -sfr = "TC0_CMR.LDRB", "Memory", 0xfffa0004, 4, base=16, bitRange=18-19 -sfr = "TC0_CMR.AEEVT", "Memory", 0xfffa0004, 4, base=16, bitRange=20-21 -sfr = "TC0_CMR.ASWTRG", "Memory", 0xfffa0004, 4, base=16, bitRange=22-23 -sfr = "TC0_CMR.BCPB", "Memory", 0xfffa0004, 4, base=16, bitRange=24-25 -sfr = "TC0_CMR.BCPC", "Memory", 0xfffa0004, 4, base=16, bitRange=26-27 -sfr = "TC0_CMR.BEEVT", "Memory", 0xfffa0004, 4, base=16, bitRange=28-29 -sfr = "TC0_CMR.BSWTRG", "Memory", 0xfffa0004, 4, base=16, bitRange=30-31 -sfr = "TC0_CV", "Memory", 0xfffa0010, 4, base=16 -sfr = "TC0_RA", "Memory", 0xfffa0014, 4, base=16 -sfr = "TC0_RB", "Memory", 0xfffa0018, 4, base=16 -sfr = "TC0_RC", "Memory", 0xfffa001c, 4, base=16 -sfr = "TC0_SR", "Memory", 0xfffa0020, 4, base=16 -sfr = "TC0_SR.COVFS", "Memory", 0xfffa0020, 4, base=16, bitRange=0 -sfr = "TC0_SR.LOVRS", "Memory", 0xfffa0020, 4, base=16, bitRange=1 -sfr = "TC0_SR.CPAS", "Memory", 0xfffa0020, 4, base=16, bitRange=2 -sfr = "TC0_SR.CPBS", "Memory", 0xfffa0020, 4, base=16, bitRange=3 -sfr = "TC0_SR.CPCS", "Memory", 0xfffa0020, 4, base=16, bitRange=4 -sfr = "TC0_SR.LDRAS", "Memory", 0xfffa0020, 4, base=16, bitRange=5 -sfr = "TC0_SR.LDRBS", "Memory", 0xfffa0020, 4, base=16, bitRange=6 -sfr = "TC0_SR.ETRGS", "Memory", 0xfffa0020, 4, base=16, bitRange=7 -sfr = "TC0_SR.CLKSTA", "Memory", 0xfffa0020, 4, base=16, bitRange=16 -sfr = "TC0_SR.MTIOA", "Memory", 0xfffa0020, 4, base=16, bitRange=17 -sfr = "TC0_SR.MTIOB", "Memory", 0xfffa0020, 4, base=16, bitRange=18 -sfr = "TC0_IER", "Memory", 0xfffa0024, 4, base=16 -sfr = "TC0_IER.COVFS", "Memory", 0xfffa0024, 4, base=16, bitRange=0 -sfr = "TC0_IER.LOVRS", "Memory", 0xfffa0024, 4, base=16, bitRange=1 -sfr = "TC0_IER.CPAS", "Memory", 0xfffa0024, 4, base=16, bitRange=2 -sfr = "TC0_IER.CPBS", "Memory", 0xfffa0024, 4, base=16, bitRange=3 -sfr = "TC0_IER.CPCS", "Memory", 0xfffa0024, 4, base=16, bitRange=4 -sfr = "TC0_IER.LDRAS", "Memory", 0xfffa0024, 4, base=16, bitRange=5 -sfr = "TC0_IER.LDRBS", "Memory", 0xfffa0024, 4, base=16, bitRange=6 -sfr = "TC0_IER.ETRGS", "Memory", 0xfffa0024, 4, base=16, bitRange=7 -sfr = "TC0_IDR", "Memory", 0xfffa0028, 4, base=16 -sfr = "TC0_IDR.COVFS", "Memory", 0xfffa0028, 4, base=16, bitRange=0 -sfr = "TC0_IDR.LOVRS", "Memory", 0xfffa0028, 4, base=16, bitRange=1 -sfr = "TC0_IDR.CPAS", "Memory", 0xfffa0028, 4, base=16, bitRange=2 -sfr = "TC0_IDR.CPBS", "Memory", 0xfffa0028, 4, base=16, bitRange=3 -sfr = "TC0_IDR.CPCS", "Memory", 0xfffa0028, 4, base=16, bitRange=4 -sfr = "TC0_IDR.LDRAS", "Memory", 0xfffa0028, 4, base=16, bitRange=5 -sfr = "TC0_IDR.LDRBS", "Memory", 0xfffa0028, 4, base=16, bitRange=6 -sfr = "TC0_IDR.ETRGS", "Memory", 0xfffa0028, 4, base=16, bitRange=7 -sfr = "TC0_IMR", "Memory", 0xfffa002c, 4, base=16 -sfr = "TC0_IMR.COVFS", "Memory", 0xfffa002c, 4, base=16, bitRange=0 -sfr = "TC0_IMR.LOVRS", "Memory", 0xfffa002c, 4, base=16, bitRange=1 -sfr = "TC0_IMR.CPAS", "Memory", 0xfffa002c, 4, base=16, bitRange=2 -sfr = "TC0_IMR.CPBS", "Memory", 0xfffa002c, 4, base=16, bitRange=3 -sfr = "TC0_IMR.CPCS", "Memory", 0xfffa002c, 4, base=16, bitRange=4 -sfr = "TC0_IMR.LDRAS", "Memory", 0xfffa002c, 4, base=16, bitRange=5 -sfr = "TC0_IMR.LDRBS", "Memory", 0xfffa002c, 4, base=16, bitRange=6 -sfr = "TC0_IMR.ETRGS", "Memory", 0xfffa002c, 4, base=16, bitRange=7 -; ========== Register definition for TC1 peripheral ========== -sfr = "TC1_CCR", "Memory", 0xfffa0040, 4, base=16 -sfr = "TC1_CCR.CLKEN", "Memory", 0xfffa0040, 4, base=16, bitRange=0 -sfr = "TC1_CCR.CLKDIS", "Memory", 0xfffa0040, 4, base=16, bitRange=1 -sfr = "TC1_CCR.SWTRG", "Memory", 0xfffa0040, 4, base=16, bitRange=2 -sfr = "TC1_CMR", "Memory", 0xfffa0044, 4, base=16 -sfr = "TC1_CMR.CLKS", "Memory", 0xfffa0044, 4, base=16, bitRange=0-2 -sfr = "TC1_CMR.CLKI", "Memory", 0xfffa0044, 4, base=16, bitRange=3 -sfr = "TC1_CMR.BURST", "Memory", 0xfffa0044, 4, base=16, bitRange=4-5 -sfr = "TC1_CMR.CPCSTOP", "Memory", 0xfffa0044, 4, base=16, bitRange=6 -sfr = "TC1_CMR.LDBSTOP", "Memory", 0xfffa0044, 4, base=16, bitRange=6 -sfr = "TC1_CMR.CPCDIS", "Memory", 0xfffa0044, 4, base=16, bitRange=7 -sfr = "TC1_CMR.LDBDIS", "Memory", 0xfffa0044, 4, base=16, bitRange=7 -sfr = "TC1_CMR.ETRGEDG", "Memory", 0xfffa0044, 4, base=16, bitRange=8-9 -sfr = "TC1_CMR.EEVTEDG", "Memory", 0xfffa0044, 4, base=16, bitRange=8-9 -sfr = "TC1_CMR.EEVT", "Memory", 0xfffa0044, 4, base=16, bitRange=10-11 -sfr = "TC1_CMR.ABETRG", "Memory", 0xfffa0044, 4, base=16, bitRange=10 -sfr = "TC1_CMR.ENETRG", "Memory", 0xfffa0044, 4, base=16, bitRange=12 -sfr = "TC1_CMR.WAVESEL", "Memory", 0xfffa0044, 4, base=16, bitRange=13-14 -sfr = "TC1_CMR.CPCTRG", "Memory", 0xfffa0044, 4, base=16, bitRange=14 -sfr = "TC1_CMR.WAVE", "Memory", 0xfffa0044, 4, base=16, bitRange=15 -sfr = "TC1_CMR.ACPA", "Memory", 0xfffa0044, 4, base=16, bitRange=16-17 -sfr = "TC1_CMR.LDRA", "Memory", 0xfffa0044, 4, base=16, bitRange=16-17 -sfr = "TC1_CMR.ACPC", "Memory", 0xfffa0044, 4, base=16, bitRange=18-19 -sfr = "TC1_CMR.LDRB", "Memory", 0xfffa0044, 4, base=16, bitRange=18-19 -sfr = "TC1_CMR.AEEVT", "Memory", 0xfffa0044, 4, base=16, bitRange=20-21 -sfr = "TC1_CMR.ASWTRG", "Memory", 0xfffa0044, 4, base=16, bitRange=22-23 -sfr = "TC1_CMR.BCPB", "Memory", 0xfffa0044, 4, base=16, bitRange=24-25 -sfr = "TC1_CMR.BCPC", "Memory", 0xfffa0044, 4, base=16, bitRange=26-27 -sfr = "TC1_CMR.BEEVT", "Memory", 0xfffa0044, 4, base=16, bitRange=28-29 -sfr = "TC1_CMR.BSWTRG", "Memory", 0xfffa0044, 4, base=16, bitRange=30-31 -sfr = "TC1_CV", "Memory", 0xfffa0050, 4, base=16 -sfr = "TC1_RA", "Memory", 0xfffa0054, 4, base=16 -sfr = "TC1_RB", "Memory", 0xfffa0058, 4, base=16 -sfr = "TC1_RC", "Memory", 0xfffa005c, 4, base=16 -sfr = "TC1_SR", "Memory", 0xfffa0060, 4, base=16 -sfr = "TC1_SR.COVFS", "Memory", 0xfffa0060, 4, base=16, bitRange=0 -sfr = "TC1_SR.LOVRS", "Memory", 0xfffa0060, 4, base=16, bitRange=1 -sfr = "TC1_SR.CPAS", "Memory", 0xfffa0060, 4, base=16, bitRange=2 -sfr = "TC1_SR.CPBS", "Memory", 0xfffa0060, 4, base=16, bitRange=3 -sfr = "TC1_SR.CPCS", "Memory", 0xfffa0060, 4, base=16, bitRange=4 -sfr = "TC1_SR.LDRAS", "Memory", 0xfffa0060, 4, base=16, bitRange=5 -sfr = "TC1_SR.LDRBS", "Memory", 0xfffa0060, 4, base=16, bitRange=6 -sfr = "TC1_SR.ETRGS", "Memory", 0xfffa0060, 4, base=16, bitRange=7 -sfr = "TC1_SR.CLKSTA", "Memory", 0xfffa0060, 4, base=16, bitRange=16 -sfr = "TC1_SR.MTIOA", "Memory", 0xfffa0060, 4, base=16, bitRange=17 -sfr = "TC1_SR.MTIOB", "Memory", 0xfffa0060, 4, base=16, bitRange=18 -sfr = "TC1_IER", "Memory", 0xfffa0064, 4, base=16 -sfr = "TC1_IER.COVFS", "Memory", 0xfffa0064, 4, base=16, bitRange=0 -sfr = "TC1_IER.LOVRS", "Memory", 0xfffa0064, 4, base=16, bitRange=1 -sfr = "TC1_IER.CPAS", "Memory", 0xfffa0064, 4, base=16, bitRange=2 -sfr = "TC1_IER.CPBS", "Memory", 0xfffa0064, 4, base=16, bitRange=3 -sfr = "TC1_IER.CPCS", "Memory", 0xfffa0064, 4, base=16, bitRange=4 -sfr = "TC1_IER.LDRAS", "Memory", 0xfffa0064, 4, base=16, bitRange=5 -sfr = "TC1_IER.LDRBS", "Memory", 0xfffa0064, 4, base=16, bitRange=6 -sfr = "TC1_IER.ETRGS", "Memory", 0xfffa0064, 4, base=16, bitRange=7 -sfr = "TC1_IDR", "Memory", 0xfffa0068, 4, base=16 -sfr = "TC1_IDR.COVFS", "Memory", 0xfffa0068, 4, base=16, bitRange=0 -sfr = "TC1_IDR.LOVRS", "Memory", 0xfffa0068, 4, base=16, bitRange=1 -sfr = "TC1_IDR.CPAS", "Memory", 0xfffa0068, 4, base=16, bitRange=2 -sfr = "TC1_IDR.CPBS", "Memory", 0xfffa0068, 4, base=16, bitRange=3 -sfr = "TC1_IDR.CPCS", "Memory", 0xfffa0068, 4, base=16, bitRange=4 -sfr = "TC1_IDR.LDRAS", "Memory", 0xfffa0068, 4, base=16, bitRange=5 -sfr = "TC1_IDR.LDRBS", "Memory", 0xfffa0068, 4, base=16, bitRange=6 -sfr = "TC1_IDR.ETRGS", "Memory", 0xfffa0068, 4, base=16, bitRange=7 -sfr = "TC1_IMR", "Memory", 0xfffa006c, 4, base=16 -sfr = "TC1_IMR.COVFS", "Memory", 0xfffa006c, 4, base=16, bitRange=0 -sfr = "TC1_IMR.LOVRS", "Memory", 0xfffa006c, 4, base=16, bitRange=1 -sfr = "TC1_IMR.CPAS", "Memory", 0xfffa006c, 4, base=16, bitRange=2 -sfr = "TC1_IMR.CPBS", "Memory", 0xfffa006c, 4, base=16, bitRange=3 -sfr = "TC1_IMR.CPCS", "Memory", 0xfffa006c, 4, base=16, bitRange=4 -sfr = "TC1_IMR.LDRAS", "Memory", 0xfffa006c, 4, base=16, bitRange=5 -sfr = "TC1_IMR.LDRBS", "Memory", 0xfffa006c, 4, base=16, bitRange=6 -sfr = "TC1_IMR.ETRGS", "Memory", 0xfffa006c, 4, base=16, bitRange=7 -; ========== Register definition for TC2 peripheral ========== -sfr = "TC2_CCR", "Memory", 0xfffa0080, 4, base=16 -sfr = "TC2_CCR.CLKEN", "Memory", 0xfffa0080, 4, base=16, bitRange=0 -sfr = "TC2_CCR.CLKDIS", "Memory", 0xfffa0080, 4, base=16, bitRange=1 -sfr = "TC2_CCR.SWTRG", "Memory", 0xfffa0080, 4, base=16, bitRange=2 -sfr = "TC2_CMR", "Memory", 0xfffa0084, 4, base=16 -sfr = "TC2_CMR.CLKS", "Memory", 0xfffa0084, 4, base=16, bitRange=0-2 -sfr = "TC2_CMR.CLKI", "Memory", 0xfffa0084, 4, base=16, bitRange=3 -sfr = "TC2_CMR.BURST", "Memory", 0xfffa0084, 4, base=16, bitRange=4-5 -sfr = "TC2_CMR.CPCSTOP", "Memory", 0xfffa0084, 4, base=16, bitRange=6 -sfr = "TC2_CMR.LDBSTOP", "Memory", 0xfffa0084, 4, base=16, bitRange=6 -sfr = "TC2_CMR.CPCDIS", "Memory", 0xfffa0084, 4, base=16, bitRange=7 -sfr = "TC2_CMR.LDBDIS", "Memory", 0xfffa0084, 4, base=16, bitRange=7 -sfr = "TC2_CMR.ETRGEDG", "Memory", 0xfffa0084, 4, base=16, bitRange=8-9 -sfr = "TC2_CMR.EEVTEDG", "Memory", 0xfffa0084, 4, base=16, bitRange=8-9 -sfr = "TC2_CMR.EEVT", "Memory", 0xfffa0084, 4, base=16, bitRange=10-11 -sfr = "TC2_CMR.ABETRG", "Memory", 0xfffa0084, 4, base=16, bitRange=10 -sfr = "TC2_CMR.ENETRG", "Memory", 0xfffa0084, 4, base=16, bitRange=12 -sfr = "TC2_CMR.WAVESEL", "Memory", 0xfffa0084, 4, base=16, bitRange=13-14 -sfr = "TC2_CMR.CPCTRG", "Memory", 0xfffa0084, 4, base=16, bitRange=14 -sfr = "TC2_CMR.WAVE", "Memory", 0xfffa0084, 4, base=16, bitRange=15 -sfr = "TC2_CMR.ACPA", "Memory", 0xfffa0084, 4, base=16, bitRange=16-17 -sfr = "TC2_CMR.LDRA", "Memory", 0xfffa0084, 4, base=16, bitRange=16-17 -sfr = "TC2_CMR.ACPC", "Memory", 0xfffa0084, 4, base=16, bitRange=18-19 -sfr = "TC2_CMR.LDRB", "Memory", 0xfffa0084, 4, base=16, bitRange=18-19 -sfr = "TC2_CMR.AEEVT", "Memory", 0xfffa0084, 4, base=16, bitRange=20-21 -sfr = "TC2_CMR.ASWTRG", "Memory", 0xfffa0084, 4, base=16, bitRange=22-23 -sfr = "TC2_CMR.BCPB", "Memory", 0xfffa0084, 4, base=16, bitRange=24-25 -sfr = "TC2_CMR.BCPC", "Memory", 0xfffa0084, 4, base=16, bitRange=26-27 -sfr = "TC2_CMR.BEEVT", "Memory", 0xfffa0084, 4, base=16, bitRange=28-29 -sfr = "TC2_CMR.BSWTRG", "Memory", 0xfffa0084, 4, base=16, bitRange=30-31 -sfr = "TC2_CV", "Memory", 0xfffa0090, 4, base=16 -sfr = "TC2_RA", "Memory", 0xfffa0094, 4, base=16 -sfr = "TC2_RB", "Memory", 0xfffa0098, 4, base=16 -sfr = "TC2_RC", "Memory", 0xfffa009c, 4, base=16 -sfr = "TC2_SR", "Memory", 0xfffa00a0, 4, base=16 -sfr = "TC2_SR.COVFS", "Memory", 0xfffa00a0, 4, base=16, bitRange=0 -sfr = "TC2_SR.LOVRS", "Memory", 0xfffa00a0, 4, base=16, bitRange=1 -sfr = "TC2_SR.CPAS", "Memory", 0xfffa00a0, 4, base=16, bitRange=2 -sfr = "TC2_SR.CPBS", "Memory", 0xfffa00a0, 4, base=16, bitRange=3 -sfr = "TC2_SR.CPCS", "Memory", 0xfffa00a0, 4, base=16, bitRange=4 -sfr = "TC2_SR.LDRAS", "Memory", 0xfffa00a0, 4, base=16, bitRange=5 -sfr = "TC2_SR.LDRBS", "Memory", 0xfffa00a0, 4, base=16, bitRange=6 -sfr = "TC2_SR.ETRGS", "Memory", 0xfffa00a0, 4, base=16, bitRange=7 -sfr = "TC2_SR.CLKSTA", "Memory", 0xfffa00a0, 4, base=16, bitRange=16 -sfr = "TC2_SR.MTIOA", "Memory", 0xfffa00a0, 4, base=16, bitRange=17 -sfr = "TC2_SR.MTIOB", "Memory", 0xfffa00a0, 4, base=16, bitRange=18 -sfr = "TC2_IER", "Memory", 0xfffa00a4, 4, base=16 -sfr = "TC2_IER.COVFS", "Memory", 0xfffa00a4, 4, base=16, bitRange=0 -sfr = "TC2_IER.LOVRS", "Memory", 0xfffa00a4, 4, base=16, bitRange=1 -sfr = "TC2_IER.CPAS", "Memory", 0xfffa00a4, 4, base=16, bitRange=2 -sfr = "TC2_IER.CPBS", "Memory", 0xfffa00a4, 4, base=16, bitRange=3 -sfr = "TC2_IER.CPCS", "Memory", 0xfffa00a4, 4, base=16, bitRange=4 -sfr = "TC2_IER.LDRAS", "Memory", 0xfffa00a4, 4, base=16, bitRange=5 -sfr = "TC2_IER.LDRBS", "Memory", 0xfffa00a4, 4, base=16, bitRange=6 -sfr = "TC2_IER.ETRGS", "Memory", 0xfffa00a4, 4, base=16, bitRange=7 -sfr = "TC2_IDR", "Memory", 0xfffa00a8, 4, base=16 -sfr = "TC2_IDR.COVFS", "Memory", 0xfffa00a8, 4, base=16, bitRange=0 -sfr = "TC2_IDR.LOVRS", "Memory", 0xfffa00a8, 4, base=16, bitRange=1 -sfr = "TC2_IDR.CPAS", "Memory", 0xfffa00a8, 4, base=16, bitRange=2 -sfr = "TC2_IDR.CPBS", "Memory", 0xfffa00a8, 4, base=16, bitRange=3 -sfr = "TC2_IDR.CPCS", "Memory", 0xfffa00a8, 4, base=16, bitRange=4 -sfr = "TC2_IDR.LDRAS", "Memory", 0xfffa00a8, 4, base=16, bitRange=5 -sfr = "TC2_IDR.LDRBS", "Memory", 0xfffa00a8, 4, base=16, bitRange=6 -sfr = "TC2_IDR.ETRGS", "Memory", 0xfffa00a8, 4, base=16, bitRange=7 -sfr = "TC2_IMR", "Memory", 0xfffa00ac, 4, base=16 -sfr = "TC2_IMR.COVFS", "Memory", 0xfffa00ac, 4, base=16, bitRange=0 -sfr = "TC2_IMR.LOVRS", "Memory", 0xfffa00ac, 4, base=16, bitRange=1 -sfr = "TC2_IMR.CPAS", "Memory", 0xfffa00ac, 4, base=16, bitRange=2 -sfr = "TC2_IMR.CPBS", "Memory", 0xfffa00ac, 4, base=16, bitRange=3 -sfr = "TC2_IMR.CPCS", "Memory", 0xfffa00ac, 4, base=16, bitRange=4 -sfr = "TC2_IMR.LDRAS", "Memory", 0xfffa00ac, 4, base=16, bitRange=5 -sfr = "TC2_IMR.LDRBS", "Memory", 0xfffa00ac, 4, base=16, bitRange=6 -sfr = "TC2_IMR.ETRGS", "Memory", 0xfffa00ac, 4, base=16, bitRange=7 -; ========== Register definition for TCB peripheral ========== -sfr = "TCB_BCR", "Memory", 0xfffa00c0, 4, base=16 -sfr = "TCB_BCR.SYNC", "Memory", 0xfffa00c0, 4, base=16, bitRange=0 -sfr = "TCB_BMR", "Memory", 0xfffa00c4, 4, base=16 -sfr = "TCB_BMR.TC0XC0S", "Memory", 0xfffa00c4, 4, base=16, bitRange=0-1 -sfr = "TCB_BMR.TC1XC1S", "Memory", 0xfffa00c4, 4, base=16, bitRange=2-3 -sfr = "TCB_BMR.TC2XC2S", "Memory", 0xfffa00c4, 4, base=16, bitRange=4-5 -; ========== Register definition for CAN_MB0 peripheral ========== -sfr = "CAN_MB0_MMR", "Memory", 0xfffd0200, 4, base=16 -sfr = "CAN_MB0_MMR.MTIMEMARK", "Memory", 0xfffd0200, 4, base=16, bitRange=0-15 -sfr = "CAN_MB0_MMR.PRIOR", "Memory", 0xfffd0200, 4, base=16, bitRange=16-19 -sfr = "CAN_MB0_MMR.MOT", "Memory", 0xfffd0200, 4, base=16, bitRange=24-26 -sfr = "CAN_MB0_MAM", "Memory", 0xfffd0204, 4, base=16 -sfr = "CAN_MB0_MAM.MIDvB", "Memory", 0xfffd0204, 4, base=16, bitRange=0-17 -sfr = "CAN_MB0_MAM.MIDvA", "Memory", 0xfffd0204, 4, base=16, bitRange=18-28 -sfr = "CAN_MB0_MAM.MIDE", "Memory", 0xfffd0204, 4, base=16, bitRange=29 -sfr = "CAN_MB0_MID", "Memory", 0xfffd0208, 4, base=16 -sfr = "CAN_MB0_MID.MIDvB", "Memory", 0xfffd0208, 4, base=16, bitRange=0-17 -sfr = "CAN_MB0_MID.MIDvA", "Memory", 0xfffd0208, 4, base=16, bitRange=18-28 -sfr = "CAN_MB0_MID.MIDE", "Memory", 0xfffd0208, 4, base=16, bitRange=29 -sfr = "CAN_MB0_MFID", "Memory", 0xfffd020c, 4, base=16 -sfr = "CAN_MB0_MSR", "Memory", 0xfffd0210, 4, base=16 -sfr = "CAN_MB0_MSR.MTIMESTAMP", "Memory", 0xfffd0210, 4, base=16, bitRange=0-15 -sfr = "CAN_MB0_MSR.MDLC", "Memory", 0xfffd0210, 4, base=16, bitRange=16-19 -sfr = "CAN_MB0_MSR.MRTR", "Memory", 0xfffd0210, 4, base=16, bitRange=20 -sfr = "CAN_MB0_MSR.MABT", "Memory", 0xfffd0210, 4, base=16, bitRange=22 -sfr = "CAN_MB0_MSR.MRDY", "Memory", 0xfffd0210, 4, base=16, bitRange=23 -sfr = "CAN_MB0_MSR.MMI", "Memory", 0xfffd0210, 4, base=16, bitRange=24 -sfr = "CAN_MB0_MDL", "Memory", 0xfffd0214, 4, base=16 -sfr = "CAN_MB0_MDH", "Memory", 0xfffd0218, 4, base=16 -sfr = "CAN_MB0_MCR", "Memory", 0xfffd021c, 4, base=16 -sfr = "CAN_MB0_MCR.MDLC", "Memory", 0xfffd021c, 4, base=16, bitRange=16-19 -sfr = "CAN_MB0_MCR.MRTR", "Memory", 0xfffd021c, 4, base=16, bitRange=20 -sfr = "CAN_MB0_MCR.MACR", "Memory", 0xfffd021c, 4, base=16, bitRange=22 -sfr = "CAN_MB0_MCR.MTCR", "Memory", 0xfffd021c, 4, base=16, bitRange=23 -; ========== Register definition for CAN_MB1 peripheral ========== -sfr = "CAN_MB1_MMR", "Memory", 0xfffd0220, 4, base=16 -sfr = "CAN_MB1_MMR.MTIMEMARK", "Memory", 0xfffd0220, 4, base=16, bitRange=0-15 -sfr = "CAN_MB1_MMR.PRIOR", "Memory", 0xfffd0220, 4, base=16, bitRange=16-19 -sfr = "CAN_MB1_MMR.MOT", "Memory", 0xfffd0220, 4, base=16, bitRange=24-26 -sfr = "CAN_MB1_MAM", "Memory", 0xfffd0224, 4, base=16 -sfr = "CAN_MB1_MAM.MIDvB", "Memory", 0xfffd0224, 4, base=16, bitRange=0-17 -sfr = "CAN_MB1_MAM.MIDvA", "Memory", 0xfffd0224, 4, base=16, bitRange=18-28 -sfr = "CAN_MB1_MAM.MIDE", "Memory", 0xfffd0224, 4, base=16, bitRange=29 -sfr = "CAN_MB1_MID", "Memory", 0xfffd0228, 4, base=16 -sfr = "CAN_MB1_MID.MIDvB", "Memory", 0xfffd0228, 4, base=16, bitRange=0-17 -sfr = "CAN_MB1_MID.MIDvA", "Memory", 0xfffd0228, 4, base=16, bitRange=18-28 -sfr = "CAN_MB1_MID.MIDE", "Memory", 0xfffd0228, 4, base=16, bitRange=29 -sfr = "CAN_MB1_MFID", "Memory", 0xfffd022c, 4, base=16 -sfr = "CAN_MB1_MSR", "Memory", 0xfffd0230, 4, base=16 -sfr = "CAN_MB1_MSR.MTIMESTAMP", "Memory", 0xfffd0230, 4, base=16, bitRange=0-15 -sfr = "CAN_MB1_MSR.MDLC", "Memory", 0xfffd0230, 4, base=16, bitRange=16-19 -sfr = "CAN_MB1_MSR.MRTR", "Memory", 0xfffd0230, 4, base=16, bitRange=20 -sfr = "CAN_MB1_MSR.MABT", "Memory", 0xfffd0230, 4, base=16, bitRange=22 -sfr = "CAN_MB1_MSR.MRDY", "Memory", 0xfffd0230, 4, base=16, bitRange=23 -sfr = "CAN_MB1_MSR.MMI", "Memory", 0xfffd0230, 4, base=16, bitRange=24 -sfr = "CAN_MB1_MDL", "Memory", 0xfffd0234, 4, base=16 -sfr = "CAN_MB1_MDH", "Memory", 0xfffd0238, 4, base=16 -sfr = "CAN_MB1_MCR", "Memory", 0xfffd023c, 4, base=16 -sfr = "CAN_MB1_MCR.MDLC", "Memory", 0xfffd023c, 4, base=16, bitRange=16-19 -sfr = "CAN_MB1_MCR.MRTR", "Memory", 0xfffd023c, 4, base=16, bitRange=20 -sfr = "CAN_MB1_MCR.MACR", "Memory", 0xfffd023c, 4, base=16, bitRange=22 -sfr = "CAN_MB1_MCR.MTCR", "Memory", 0xfffd023c, 4, base=16, bitRange=23 -; ========== Register definition for CAN_MB2 peripheral ========== -sfr = "CAN_MB2_MMR", "Memory", 0xfffd0240, 4, base=16 -sfr = "CAN_MB2_MMR.MTIMEMARK", "Memory", 0xfffd0240, 4, base=16, bitRange=0-15 -sfr = "CAN_MB2_MMR.PRIOR", "Memory", 0xfffd0240, 4, base=16, bitRange=16-19 -sfr = "CAN_MB2_MMR.MOT", "Memory", 0xfffd0240, 4, base=16, bitRange=24-26 -sfr = "CAN_MB2_MAM", "Memory", 0xfffd0244, 4, base=16 -sfr = "CAN_MB2_MAM.MIDvB", "Memory", 0xfffd0244, 4, base=16, bitRange=0-17 -sfr = "CAN_MB2_MAM.MIDvA", "Memory", 0xfffd0244, 4, base=16, bitRange=18-28 -sfr = "CAN_MB2_MAM.MIDE", "Memory", 0xfffd0244, 4, base=16, bitRange=29 -sfr = "CAN_MB2_MID", "Memory", 0xfffd0248, 4, base=16 -sfr = "CAN_MB2_MID.MIDvB", "Memory", 0xfffd0248, 4, base=16, bitRange=0-17 -sfr = "CAN_MB2_MID.MIDvA", "Memory", 0xfffd0248, 4, base=16, bitRange=18-28 -sfr = "CAN_MB2_MID.MIDE", "Memory", 0xfffd0248, 4, base=16, bitRange=29 -sfr = "CAN_MB2_MFID", "Memory", 0xfffd024c, 4, base=16 -sfr = "CAN_MB2_MSR", "Memory", 0xfffd0250, 4, base=16 -sfr = "CAN_MB2_MSR.MTIMESTAMP", "Memory", 0xfffd0250, 4, base=16, bitRange=0-15 -sfr = "CAN_MB2_MSR.MDLC", "Memory", 0xfffd0250, 4, base=16, bitRange=16-19 -sfr = "CAN_MB2_MSR.MRTR", "Memory", 0xfffd0250, 4, base=16, bitRange=20 -sfr = "CAN_MB2_MSR.MABT", "Memory", 0xfffd0250, 4, base=16, bitRange=22 -sfr = "CAN_MB2_MSR.MRDY", "Memory", 0xfffd0250, 4, base=16, bitRange=23 -sfr = "CAN_MB2_MSR.MMI", "Memory", 0xfffd0250, 4, base=16, bitRange=24 -sfr = "CAN_MB2_MDL", "Memory", 0xfffd0254, 4, base=16 -sfr = "CAN_MB2_MDH", "Memory", 0xfffd0258, 4, base=16 -sfr = "CAN_MB2_MCR", "Memory", 0xfffd025c, 4, base=16 -sfr = "CAN_MB2_MCR.MDLC", "Memory", 0xfffd025c, 4, base=16, bitRange=16-19 -sfr = "CAN_MB2_MCR.MRTR", "Memory", 0xfffd025c, 4, base=16, bitRange=20 -sfr = "CAN_MB2_MCR.MACR", "Memory", 0xfffd025c, 4, base=16, bitRange=22 -sfr = "CAN_MB2_MCR.MTCR", "Memory", 0xfffd025c, 4, base=16, bitRange=23 -; ========== Register definition for CAN_MB3 peripheral ========== -sfr = "CAN_MB3_MMR", "Memory", 0xfffd0260, 4, base=16 -sfr = "CAN_MB3_MMR.MTIMEMARK", "Memory", 0xfffd0260, 4, base=16, bitRange=0-15 -sfr = "CAN_MB3_MMR.PRIOR", "Memory", 0xfffd0260, 4, base=16, bitRange=16-19 -sfr = "CAN_MB3_MMR.MOT", "Memory", 0xfffd0260, 4, base=16, bitRange=24-26 -sfr = "CAN_MB3_MAM", "Memory", 0xfffd0264, 4, base=16 -sfr = "CAN_MB3_MAM.MIDvB", "Memory", 0xfffd0264, 4, base=16, bitRange=0-17 -sfr = "CAN_MB3_MAM.MIDvA", "Memory", 0xfffd0264, 4, base=16, bitRange=18-28 -sfr = "CAN_MB3_MAM.MIDE", "Memory", 0xfffd0264, 4, base=16, bitRange=29 -sfr = "CAN_MB3_MID", "Memory", 0xfffd0268, 4, base=16 -sfr = "CAN_MB3_MID.MIDvB", "Memory", 0xfffd0268, 4, base=16, bitRange=0-17 -sfr = "CAN_MB3_MID.MIDvA", "Memory", 0xfffd0268, 4, base=16, bitRange=18-28 -sfr = "CAN_MB3_MID.MIDE", "Memory", 0xfffd0268, 4, base=16, bitRange=29 -sfr = "CAN_MB3_MFID", "Memory", 0xfffd026c, 4, base=16 -sfr = "CAN_MB3_MSR", "Memory", 0xfffd0270, 4, base=16 -sfr = "CAN_MB3_MSR.MTIMESTAMP", "Memory", 0xfffd0270, 4, base=16, bitRange=0-15 -sfr = "CAN_MB3_MSR.MDLC", "Memory", 0xfffd0270, 4, base=16, bitRange=16-19 -sfr = "CAN_MB3_MSR.MRTR", "Memory", 0xfffd0270, 4, base=16, bitRange=20 -sfr = "CAN_MB3_MSR.MABT", "Memory", 0xfffd0270, 4, base=16, bitRange=22 -sfr = "CAN_MB3_MSR.MRDY", "Memory", 0xfffd0270, 4, base=16, bitRange=23 -sfr = "CAN_MB3_MSR.MMI", "Memory", 0xfffd0270, 4, base=16, bitRange=24 -sfr = "CAN_MB3_MDL", "Memory", 0xfffd0274, 4, base=16 -sfr = "CAN_MB3_MDH", "Memory", 0xfffd0278, 4, base=16 -sfr = "CAN_MB3_MCR", "Memory", 0xfffd027c, 4, base=16 -sfr = "CAN_MB3_MCR.MDLC", "Memory", 0xfffd027c, 4, base=16, bitRange=16-19 -sfr = "CAN_MB3_MCR.MRTR", "Memory", 0xfffd027c, 4, base=16, bitRange=20 -sfr = "CAN_MB3_MCR.MACR", "Memory", 0xfffd027c, 4, base=16, bitRange=22 -sfr = "CAN_MB3_MCR.MTCR", "Memory", 0xfffd027c, 4, base=16, bitRange=23 -; ========== Register definition for CAN_MB4 peripheral ========== -sfr = "CAN_MB4_MMR", "Memory", 0xfffd0280, 4, base=16 -sfr = "CAN_MB4_MMR.MTIMEMARK", "Memory", 0xfffd0280, 4, base=16, bitRange=0-15 -sfr = "CAN_MB4_MMR.PRIOR", "Memory", 0xfffd0280, 4, base=16, bitRange=16-19 -sfr = "CAN_MB4_MMR.MOT", "Memory", 0xfffd0280, 4, base=16, bitRange=24-26 -sfr = "CAN_MB4_MAM", "Memory", 0xfffd0284, 4, base=16 -sfr = "CAN_MB4_MAM.MIDvB", "Memory", 0xfffd0284, 4, base=16, bitRange=0-17 -sfr = "CAN_MB4_MAM.MIDvA", "Memory", 0xfffd0284, 4, base=16, bitRange=18-28 -sfr = "CAN_MB4_MAM.MIDE", "Memory", 0xfffd0284, 4, base=16, bitRange=29 -sfr = "CAN_MB4_MID", "Memory", 0xfffd0288, 4, base=16 -sfr = "CAN_MB4_MID.MIDvB", "Memory", 0xfffd0288, 4, base=16, bitRange=0-17 -sfr = "CAN_MB4_MID.MIDvA", "Memory", 0xfffd0288, 4, base=16, bitRange=18-28 -sfr = "CAN_MB4_MID.MIDE", "Memory", 0xfffd0288, 4, base=16, bitRange=29 -sfr = "CAN_MB4_MFID", "Memory", 0xfffd028c, 4, base=16 -sfr = "CAN_MB4_MSR", "Memory", 0xfffd0290, 4, base=16 -sfr = "CAN_MB4_MSR.MTIMESTAMP", "Memory", 0xfffd0290, 4, base=16, bitRange=0-15 -sfr = "CAN_MB4_MSR.MDLC", "Memory", 0xfffd0290, 4, base=16, bitRange=16-19 -sfr = "CAN_MB4_MSR.MRTR", "Memory", 0xfffd0290, 4, base=16, bitRange=20 -sfr = "CAN_MB4_MSR.MABT", "Memory", 0xfffd0290, 4, base=16, bitRange=22 -sfr = "CAN_MB4_MSR.MRDY", "Memory", 0xfffd0290, 4, base=16, bitRange=23 -sfr = "CAN_MB4_MSR.MMI", "Memory", 0xfffd0290, 4, base=16, bitRange=24 -sfr = "CAN_MB4_MDL", "Memory", 0xfffd0294, 4, base=16 -sfr = "CAN_MB4_MDH", "Memory", 0xfffd0298, 4, base=16 -sfr = "CAN_MB4_MCR", "Memory", 0xfffd029c, 4, base=16 -sfr = "CAN_MB4_MCR.MDLC", "Memory", 0xfffd029c, 4, base=16, bitRange=16-19 -sfr = "CAN_MB4_MCR.MRTR", "Memory", 0xfffd029c, 4, base=16, bitRange=20 -sfr = "CAN_MB4_MCR.MACR", "Memory", 0xfffd029c, 4, base=16, bitRange=22 -sfr = "CAN_MB4_MCR.MTCR", "Memory", 0xfffd029c, 4, base=16, bitRange=23 -; ========== Register definition for CAN_MB5 peripheral ========== -sfr = "CAN_MB5_MMR", "Memory", 0xfffd02a0, 4, base=16 -sfr = "CAN_MB5_MMR.MTIMEMARK", "Memory", 0xfffd02a0, 4, base=16, bitRange=0-15 -sfr = "CAN_MB5_MMR.PRIOR", "Memory", 0xfffd02a0, 4, base=16, bitRange=16-19 -sfr = "CAN_MB5_MMR.MOT", "Memory", 0xfffd02a0, 4, base=16, bitRange=24-26 -sfr = "CAN_MB5_MAM", "Memory", 0xfffd02a4, 4, base=16 -sfr = "CAN_MB5_MAM.MIDvB", "Memory", 0xfffd02a4, 4, base=16, bitRange=0-17 -sfr = "CAN_MB5_MAM.MIDvA", "Memory", 0xfffd02a4, 4, base=16, bitRange=18-28 -sfr = "CAN_MB5_MAM.MIDE", "Memory", 0xfffd02a4, 4, base=16, bitRange=29 -sfr = "CAN_MB5_MID", "Memory", 0xfffd02a8, 4, base=16 -sfr = "CAN_MB5_MID.MIDvB", "Memory", 0xfffd02a8, 4, base=16, bitRange=0-17 -sfr = "CAN_MB5_MID.MIDvA", "Memory", 0xfffd02a8, 4, base=16, bitRange=18-28 -sfr = "CAN_MB5_MID.MIDE", "Memory", 0xfffd02a8, 4, base=16, bitRange=29 -sfr = "CAN_MB5_MFID", "Memory", 0xfffd02ac, 4, base=16 -sfr = "CAN_MB5_MSR", "Memory", 0xfffd02b0, 4, base=16 -sfr = "CAN_MB5_MSR.MTIMESTAMP", "Memory", 0xfffd02b0, 4, base=16, bitRange=0-15 -sfr = "CAN_MB5_MSR.MDLC", "Memory", 0xfffd02b0, 4, base=16, bitRange=16-19 -sfr = "CAN_MB5_MSR.MRTR", "Memory", 0xfffd02b0, 4, base=16, bitRange=20 -sfr = "CAN_MB5_MSR.MABT", "Memory", 0xfffd02b0, 4, base=16, bitRange=22 -sfr = "CAN_MB5_MSR.MRDY", "Memory", 0xfffd02b0, 4, base=16, bitRange=23 -sfr = "CAN_MB5_MSR.MMI", "Memory", 0xfffd02b0, 4, base=16, bitRange=24 -sfr = "CAN_MB5_MDL", "Memory", 0xfffd02b4, 4, base=16 -sfr = "CAN_MB5_MDH", "Memory", 0xfffd02b8, 4, base=16 -sfr = "CAN_MB5_MCR", "Memory", 0xfffd02bc, 4, base=16 -sfr = "CAN_MB5_MCR.MDLC", "Memory", 0xfffd02bc, 4, base=16, bitRange=16-19 -sfr = "CAN_MB5_MCR.MRTR", "Memory", 0xfffd02bc, 4, base=16, bitRange=20 -sfr = "CAN_MB5_MCR.MACR", "Memory", 0xfffd02bc, 4, base=16, bitRange=22 -sfr = "CAN_MB5_MCR.MTCR", "Memory", 0xfffd02bc, 4, base=16, bitRange=23 -; ========== Register definition for CAN_MB6 peripheral ========== -sfr = "CAN_MB6_MMR", "Memory", 0xfffd02c0, 4, base=16 -sfr = "CAN_MB6_MMR.MTIMEMARK", "Memory", 0xfffd02c0, 4, base=16, bitRange=0-15 -sfr = "CAN_MB6_MMR.PRIOR", "Memory", 0xfffd02c0, 4, base=16, bitRange=16-19 -sfr = "CAN_MB6_MMR.MOT", "Memory", 0xfffd02c0, 4, base=16, bitRange=24-26 -sfr = "CAN_MB6_MAM", "Memory", 0xfffd02c4, 4, base=16 -sfr = "CAN_MB6_MAM.MIDvB", "Memory", 0xfffd02c4, 4, base=16, bitRange=0-17 -sfr = "CAN_MB6_MAM.MIDvA", "Memory", 0xfffd02c4, 4, base=16, bitRange=18-28 -sfr = "CAN_MB6_MAM.MIDE", "Memory", 0xfffd02c4, 4, base=16, bitRange=29 -sfr = "CAN_MB6_MID", "Memory", 0xfffd02c8, 4, base=16 -sfr = "CAN_MB6_MID.MIDvB", "Memory", 0xfffd02c8, 4, base=16, bitRange=0-17 -sfr = "CAN_MB6_MID.MIDvA", "Memory", 0xfffd02c8, 4, base=16, bitRange=18-28 -sfr = "CAN_MB6_MID.MIDE", "Memory", 0xfffd02c8, 4, base=16, bitRange=29 -sfr = "CAN_MB6_MFID", "Memory", 0xfffd02cc, 4, base=16 -sfr = "CAN_MB6_MSR", "Memory", 0xfffd02d0, 4, base=16 -sfr = "CAN_MB6_MSR.MTIMESTAMP", "Memory", 0xfffd02d0, 4, base=16, bitRange=0-15 -sfr = "CAN_MB6_MSR.MDLC", "Memory", 0xfffd02d0, 4, base=16, bitRange=16-19 -sfr = "CAN_MB6_MSR.MRTR", "Memory", 0xfffd02d0, 4, base=16, bitRange=20 -sfr = "CAN_MB6_MSR.MABT", "Memory", 0xfffd02d0, 4, base=16, bitRange=22 -sfr = "CAN_MB6_MSR.MRDY", "Memory", 0xfffd02d0, 4, base=16, bitRange=23 -sfr = "CAN_MB6_MSR.MMI", "Memory", 0xfffd02d0, 4, base=16, bitRange=24 -sfr = "CAN_MB6_MDL", "Memory", 0xfffd02d4, 4, base=16 -sfr = "CAN_MB6_MDH", "Memory", 0xfffd02d8, 4, base=16 -sfr = "CAN_MB6_MCR", "Memory", 0xfffd02dc, 4, base=16 -sfr = "CAN_MB6_MCR.MDLC", "Memory", 0xfffd02dc, 4, base=16, bitRange=16-19 -sfr = "CAN_MB6_MCR.MRTR", "Memory", 0xfffd02dc, 4, base=16, bitRange=20 -sfr = "CAN_MB6_MCR.MACR", "Memory", 0xfffd02dc, 4, base=16, bitRange=22 -sfr = "CAN_MB6_MCR.MTCR", "Memory", 0xfffd02dc, 4, base=16, bitRange=23 -; ========== Register definition for CAN_MB7 peripheral ========== -sfr = "CAN_MB7_MMR", "Memory", 0xfffd02e0, 4, base=16 -sfr = "CAN_MB7_MMR.MTIMEMARK", "Memory", 0xfffd02e0, 4, base=16, bitRange=0-15 -sfr = "CAN_MB7_MMR.PRIOR", "Memory", 0xfffd02e0, 4, base=16, bitRange=16-19 -sfr = "CAN_MB7_MMR.MOT", "Memory", 0xfffd02e0, 4, base=16, bitRange=24-26 -sfr = "CAN_MB7_MAM", "Memory", 0xfffd02e4, 4, base=16 -sfr = "CAN_MB7_MAM.MIDvB", "Memory", 0xfffd02e4, 4, base=16, bitRange=0-17 -sfr = "CAN_MB7_MAM.MIDvA", "Memory", 0xfffd02e4, 4, base=16, bitRange=18-28 -sfr = "CAN_MB7_MAM.MIDE", "Memory", 0xfffd02e4, 4, base=16, bitRange=29 -sfr = "CAN_MB7_MID", "Memory", 0xfffd02e8, 4, base=16 -sfr = "CAN_MB7_MID.MIDvB", "Memory", 0xfffd02e8, 4, base=16, bitRange=0-17 -sfr = "CAN_MB7_MID.MIDvA", "Memory", 0xfffd02e8, 4, base=16, bitRange=18-28 -sfr = "CAN_MB7_MID.MIDE", "Memory", 0xfffd02e8, 4, base=16, bitRange=29 -sfr = "CAN_MB7_MFID", "Memory", 0xfffd02ec, 4, base=16 -sfr = "CAN_MB7_MSR", "Memory", 0xfffd02f0, 4, base=16 -sfr = "CAN_MB7_MSR.MTIMESTAMP", "Memory", 0xfffd02f0, 4, base=16, bitRange=0-15 -sfr = "CAN_MB7_MSR.MDLC", "Memory", 0xfffd02f0, 4, base=16, bitRange=16-19 -sfr = "CAN_MB7_MSR.MRTR", "Memory", 0xfffd02f0, 4, base=16, bitRange=20 -sfr = "CAN_MB7_MSR.MABT", "Memory", 0xfffd02f0, 4, base=16, bitRange=22 -sfr = "CAN_MB7_MSR.MRDY", "Memory", 0xfffd02f0, 4, base=16, bitRange=23 -sfr = "CAN_MB7_MSR.MMI", "Memory", 0xfffd02f0, 4, base=16, bitRange=24 -sfr = "CAN_MB7_MDL", "Memory", 0xfffd02f4, 4, base=16 -sfr = "CAN_MB7_MDH", "Memory", 0xfffd02f8, 4, base=16 -sfr = "CAN_MB7_MCR", "Memory", 0xfffd02fc, 4, base=16 -sfr = "CAN_MB7_MCR.MDLC", "Memory", 0xfffd02fc, 4, base=16, bitRange=16-19 -sfr = "CAN_MB7_MCR.MRTR", "Memory", 0xfffd02fc, 4, base=16, bitRange=20 -sfr = "CAN_MB7_MCR.MACR", "Memory", 0xfffd02fc, 4, base=16, bitRange=22 -sfr = "CAN_MB7_MCR.MTCR", "Memory", 0xfffd02fc, 4, base=16, bitRange=23 -; ========== Register definition for CAN peripheral ========== -sfr = "CAN_MR", "Memory", 0xfffd0000, 4, base=16 -sfr = "CAN_MR.CANEN", "Memory", 0xfffd0000, 4, base=16, bitRange=0 -sfr = "CAN_MR.LPM", "Memory", 0xfffd0000, 4, base=16, bitRange=1 -sfr = "CAN_MR.ABM", "Memory", 0xfffd0000, 4, base=16, bitRange=2 -sfr = "CAN_MR.OVL", "Memory", 0xfffd0000, 4, base=16, bitRange=3 -sfr = "CAN_MR.TEOF", "Memory", 0xfffd0000, 4, base=16, bitRange=4 -sfr = "CAN_MR.TTM", "Memory", 0xfffd0000, 4, base=16, bitRange=5 -sfr = "CAN_MR.TIMFRZ", "Memory", 0xfffd0000, 4, base=16, bitRange=6 -sfr = "CAN_MR.DRPT", "Memory", 0xfffd0000, 4, base=16, bitRange=7 -sfr = "CAN_IER", "Memory", 0xfffd0004, 4, base=16 -sfr = "CAN_IER.MB0", "Memory", 0xfffd0004, 4, base=16, bitRange=0 -sfr = "CAN_IER.MB1", "Memory", 0xfffd0004, 4, base=16, bitRange=1 -sfr = "CAN_IER.MB2", "Memory", 0xfffd0004, 4, base=16, bitRange=2 -sfr = "CAN_IER.MB3", "Memory", 0xfffd0004, 4, base=16, bitRange=3 -sfr = "CAN_IER.MB4", "Memory", 0xfffd0004, 4, base=16, bitRange=4 -sfr = "CAN_IER.MB5", "Memory", 0xfffd0004, 4, base=16, bitRange=5 -sfr = "CAN_IER.MB6", "Memory", 0xfffd0004, 4, base=16, bitRange=6 -sfr = "CAN_IER.MB7", "Memory", 0xfffd0004, 4, base=16, bitRange=7 -sfr = "CAN_IER.MB8", "Memory", 0xfffd0004, 4, base=16, bitRange=8 -sfr = "CAN_IER.MB9", "Memory", 0xfffd0004, 4, base=16, bitRange=9 -sfr = "CAN_IER.MB10", "Memory", 0xfffd0004, 4, base=16, bitRange=10 -sfr = "CAN_IER.MB11", "Memory", 0xfffd0004, 4, base=16, bitRange=11 -sfr = "CAN_IER.MB12", "Memory", 0xfffd0004, 4, base=16, bitRange=12 -sfr = "CAN_IER.MB13", "Memory", 0xfffd0004, 4, base=16, bitRange=13 -sfr = "CAN_IER.MB14", "Memory", 0xfffd0004, 4, base=16, bitRange=14 -sfr = "CAN_IER.MB15", "Memory", 0xfffd0004, 4, base=16, bitRange=15 -sfr = "CAN_IER.ERRA", "Memory", 0xfffd0004, 4, base=16, bitRange=16 -sfr = "CAN_IER.WARN", "Memory", 0xfffd0004, 4, base=16, bitRange=17 -sfr = "CAN_IER.ERRP", "Memory", 0xfffd0004, 4, base=16, bitRange=18 -sfr = "CAN_IER.BOFF", "Memory", 0xfffd0004, 4, base=16, bitRange=19 -sfr = "CAN_IER.SLEEP", "Memory", 0xfffd0004, 4, base=16, bitRange=20 -sfr = "CAN_IER.WAKEUP", "Memory", 0xfffd0004, 4, base=16, bitRange=21 -sfr = "CAN_IER.TOVF", "Memory", 0xfffd0004, 4, base=16, bitRange=22 -sfr = "CAN_IER.TSTP", "Memory", 0xfffd0004, 4, base=16, bitRange=23 -sfr = "CAN_IER.CERR", "Memory", 0xfffd0004, 4, base=16, bitRange=24 -sfr = "CAN_IER.SERR", "Memory", 0xfffd0004, 4, base=16, bitRange=25 -sfr = "CAN_IER.AERR", "Memory", 0xfffd0004, 4, base=16, bitRange=26 -sfr = "CAN_IER.FERR", "Memory", 0xfffd0004, 4, base=16, bitRange=27 -sfr = "CAN_IER.BERR", "Memory", 0xfffd0004, 4, base=16, bitRange=28 -sfr = "CAN_IDR", "Memory", 0xfffd0008, 4, base=16 -sfr = "CAN_IDR.MB0", "Memory", 0xfffd0008, 4, base=16, bitRange=0 -sfr = "CAN_IDR.MB1", "Memory", 0xfffd0008, 4, base=16, bitRange=1 -sfr = "CAN_IDR.MB2", "Memory", 0xfffd0008, 4, base=16, bitRange=2 -sfr = "CAN_IDR.MB3", "Memory", 0xfffd0008, 4, base=16, bitRange=3 -sfr = "CAN_IDR.MB4", "Memory", 0xfffd0008, 4, base=16, bitRange=4 -sfr = "CAN_IDR.MB5", "Memory", 0xfffd0008, 4, base=16, bitRange=5 -sfr = "CAN_IDR.MB6", "Memory", 0xfffd0008, 4, base=16, bitRange=6 -sfr = "CAN_IDR.MB7", "Memory", 0xfffd0008, 4, base=16, bitRange=7 -sfr = "CAN_IDR.MB8", "Memory", 0xfffd0008, 4, base=16, bitRange=8 -sfr = "CAN_IDR.MB9", "Memory", 0xfffd0008, 4, base=16, bitRange=9 -sfr = "CAN_IDR.MB10", "Memory", 0xfffd0008, 4, base=16, bitRange=10 -sfr = "CAN_IDR.MB11", "Memory", 0xfffd0008, 4, base=16, bitRange=11 -sfr = "CAN_IDR.MB12", "Memory", 0xfffd0008, 4, base=16, bitRange=12 -sfr = "CAN_IDR.MB13", "Memory", 0xfffd0008, 4, base=16, bitRange=13 -sfr = "CAN_IDR.MB14", "Memory", 0xfffd0008, 4, base=16, bitRange=14 -sfr = "CAN_IDR.MB15", "Memory", 0xfffd0008, 4, base=16, bitRange=15 -sfr = "CAN_IDR.ERRA", "Memory", 0xfffd0008, 4, base=16, bitRange=16 -sfr = "CAN_IDR.WARN", "Memory", 0xfffd0008, 4, base=16, bitRange=17 -sfr = "CAN_IDR.ERRP", "Memory", 0xfffd0008, 4, base=16, bitRange=18 -sfr = "CAN_IDR.BOFF", "Memory", 0xfffd0008, 4, base=16, bitRange=19 -sfr = "CAN_IDR.SLEEP", "Memory", 0xfffd0008, 4, base=16, bitRange=20 -sfr = "CAN_IDR.WAKEUP", "Memory", 0xfffd0008, 4, base=16, bitRange=21 -sfr = "CAN_IDR.TOVF", "Memory", 0xfffd0008, 4, base=16, bitRange=22 -sfr = "CAN_IDR.TSTP", "Memory", 0xfffd0008, 4, base=16, bitRange=23 -sfr = "CAN_IDR.CERR", "Memory", 0xfffd0008, 4, base=16, bitRange=24 -sfr = "CAN_IDR.SERR", "Memory", 0xfffd0008, 4, base=16, bitRange=25 -sfr = "CAN_IDR.AERR", "Memory", 0xfffd0008, 4, base=16, bitRange=26 -sfr = "CAN_IDR.FERR", "Memory", 0xfffd0008, 4, base=16, bitRange=27 -sfr = "CAN_IDR.BERR", "Memory", 0xfffd0008, 4, base=16, bitRange=28 -sfr = "CAN_IMR", "Memory", 0xfffd000c, 4, base=16 -sfr = "CAN_IMR.MB0", "Memory", 0xfffd000c, 4, base=16, bitRange=0 -sfr = "CAN_IMR.MB1", "Memory", 0xfffd000c, 4, base=16, bitRange=1 -sfr = "CAN_IMR.MB2", "Memory", 0xfffd000c, 4, base=16, bitRange=2 -sfr = "CAN_IMR.MB3", "Memory", 0xfffd000c, 4, base=16, bitRange=3 -sfr = "CAN_IMR.MB4", "Memory", 0xfffd000c, 4, base=16, bitRange=4 -sfr = "CAN_IMR.MB5", "Memory", 0xfffd000c, 4, base=16, bitRange=5 -sfr = "CAN_IMR.MB6", "Memory", 0xfffd000c, 4, base=16, bitRange=6 -sfr = "CAN_IMR.MB7", "Memory", 0xfffd000c, 4, base=16, bitRange=7 -sfr = "CAN_IMR.MB8", "Memory", 0xfffd000c, 4, base=16, bitRange=8 -sfr = "CAN_IMR.MB9", "Memory", 0xfffd000c, 4, base=16, bitRange=9 -sfr = "CAN_IMR.MB10", "Memory", 0xfffd000c, 4, base=16, bitRange=10 -sfr = "CAN_IMR.MB11", "Memory", 0xfffd000c, 4, base=16, bitRange=11 -sfr = "CAN_IMR.MB12", "Memory", 0xfffd000c, 4, base=16, bitRange=12 -sfr = "CAN_IMR.MB13", "Memory", 0xfffd000c, 4, base=16, bitRange=13 -sfr = "CAN_IMR.MB14", "Memory", 0xfffd000c, 4, base=16, bitRange=14 -sfr = "CAN_IMR.MB15", "Memory", 0xfffd000c, 4, base=16, bitRange=15 -sfr = "CAN_IMR.ERRA", "Memory", 0xfffd000c, 4, base=16, bitRange=16 -sfr = "CAN_IMR.WARN", "Memory", 0xfffd000c, 4, base=16, bitRange=17 -sfr = "CAN_IMR.ERRP", "Memory", 0xfffd000c, 4, base=16, bitRange=18 -sfr = "CAN_IMR.BOFF", "Memory", 0xfffd000c, 4, base=16, bitRange=19 -sfr = "CAN_IMR.SLEEP", "Memory", 0xfffd000c, 4, base=16, bitRange=20 -sfr = "CAN_IMR.WAKEUP", "Memory", 0xfffd000c, 4, base=16, bitRange=21 -sfr = "CAN_IMR.TOVF", "Memory", 0xfffd000c, 4, base=16, bitRange=22 -sfr = "CAN_IMR.TSTP", "Memory", 0xfffd000c, 4, base=16, bitRange=23 -sfr = "CAN_IMR.CERR", "Memory", 0xfffd000c, 4, base=16, bitRange=24 -sfr = "CAN_IMR.SERR", "Memory", 0xfffd000c, 4, base=16, bitRange=25 -sfr = "CAN_IMR.AERR", "Memory", 0xfffd000c, 4, base=16, bitRange=26 -sfr = "CAN_IMR.FERR", "Memory", 0xfffd000c, 4, base=16, bitRange=27 -sfr = "CAN_IMR.BERR", "Memory", 0xfffd000c, 4, base=16, bitRange=28 -sfr = "CAN_SR", "Memory", 0xfffd0010, 4, base=16 -sfr = "CAN_SR.MB0", "Memory", 0xfffd0010, 4, base=16, bitRange=0 -sfr = "CAN_SR.MB1", "Memory", 0xfffd0010, 4, base=16, bitRange=1 -sfr = "CAN_SR.MB2", "Memory", 0xfffd0010, 4, base=16, bitRange=2 -sfr = "CAN_SR.MB3", "Memory", 0xfffd0010, 4, base=16, bitRange=3 -sfr = "CAN_SR.MB4", "Memory", 0xfffd0010, 4, base=16, bitRange=4 -sfr = "CAN_SR.MB5", "Memory", 0xfffd0010, 4, base=16, bitRange=5 -sfr = "CAN_SR.MB6", "Memory", 0xfffd0010, 4, base=16, bitRange=6 -sfr = "CAN_SR.MB7", "Memory", 0xfffd0010, 4, base=16, bitRange=7 -sfr = "CAN_SR.MB8", "Memory", 0xfffd0010, 4, base=16, bitRange=8 -sfr = "CAN_SR.MB9", "Memory", 0xfffd0010, 4, base=16, bitRange=9 -sfr = "CAN_SR.MB10", "Memory", 0xfffd0010, 4, base=16, bitRange=10 -sfr = "CAN_SR.MB11", "Memory", 0xfffd0010, 4, base=16, bitRange=11 -sfr = "CAN_SR.MB12", "Memory", 0xfffd0010, 4, base=16, bitRange=12 -sfr = "CAN_SR.MB13", "Memory", 0xfffd0010, 4, base=16, bitRange=13 -sfr = "CAN_SR.MB14", "Memory", 0xfffd0010, 4, base=16, bitRange=14 -sfr = "CAN_SR.MB15", "Memory", 0xfffd0010, 4, base=16, bitRange=15 -sfr = "CAN_SR.ERRA", "Memory", 0xfffd0010, 4, base=16, bitRange=16 -sfr = "CAN_SR.WARN", "Memory", 0xfffd0010, 4, base=16, bitRange=17 -sfr = "CAN_SR.ERRP", "Memory", 0xfffd0010, 4, base=16, bitRange=18 -sfr = "CAN_SR.BOFF", "Memory", 0xfffd0010, 4, base=16, bitRange=19 -sfr = "CAN_SR.SLEEP", "Memory", 0xfffd0010, 4, base=16, bitRange=20 -sfr = "CAN_SR.WAKEUP", "Memory", 0xfffd0010, 4, base=16, bitRange=21 -sfr = "CAN_SR.TOVF", "Memory", 0xfffd0010, 4, base=16, bitRange=22 -sfr = "CAN_SR.TSTP", "Memory", 0xfffd0010, 4, base=16, bitRange=23 -sfr = "CAN_SR.CERR", "Memory", 0xfffd0010, 4, base=16, bitRange=24 -sfr = "CAN_SR.SERR", "Memory", 0xfffd0010, 4, base=16, bitRange=25 -sfr = "CAN_SR.AERR", "Memory", 0xfffd0010, 4, base=16, bitRange=26 -sfr = "CAN_SR.FERR", "Memory", 0xfffd0010, 4, base=16, bitRange=27 -sfr = "CAN_SR.BERR", "Memory", 0xfffd0010, 4, base=16, bitRange=28 -sfr = "CAN_SR.RBSY", "Memory", 0xfffd0010, 4, base=16, bitRange=29 -sfr = "CAN_SR.TBSY", "Memory", 0xfffd0010, 4, base=16, bitRange=30 -sfr = "CAN_SR.OVLY", "Memory", 0xfffd0010, 4, base=16, bitRange=31 -sfr = "CAN_BR", "Memory", 0xfffd0014, 4, base=16 -sfr = "CAN_BR.PHASE2", "Memory", 0xfffd0014, 4, base=16, bitRange=0-2 -sfr = "CAN_BR.PHASE1", "Memory", 0xfffd0014, 4, base=16, bitRange=4-6 -sfr = "CAN_BR.PROPAG", "Memory", 0xfffd0014, 4, base=16, bitRange=8-10 -sfr = "CAN_BR.SYNC", "Memory", 0xfffd0014, 4, base=16, bitRange=12-13 -sfr = "CAN_BR.BRP", "Memory", 0xfffd0014, 4, base=16, bitRange=16-22 -sfr = "CAN_BR.SMP", "Memory", 0xfffd0014, 4, base=16, bitRange=24 -sfr = "CAN_TIM", "Memory", 0xfffd0018, 4, base=16 -sfr = "CAN_TIM.TIMER", "Memory", 0xfffd0018, 4, base=16, bitRange=0-15 -sfr = "CAN_TIMESTP", "Memory", 0xfffd001c, 4, base=16 -sfr = "CAN_TIMESTP.MTIMESTAMP", "Memory", 0xfffd001c, 4, base=16, bitRange=0-15 -sfr = "CAN_ECR", "Memory", 0xfffd0020, 4, base=16 -sfr = "CAN_ECR.REC", "Memory", 0xfffd0020, 4, base=16, bitRange=0-7 -sfr = "CAN_ECR.TEC", "Memory", 0xfffd0020, 4, base=16, bitRange=16-23 -sfr = "CAN_TCR", "Memory", 0xfffd0024, 4, base=16 -sfr = "CAN_TCR.MB0", "Memory", 0xfffd0024, 4, base=16, bitRange=0 -sfr = "CAN_TCR.MB1", "Memory", 0xfffd0024, 4, base=16, bitRange=1 -sfr = "CAN_TCR.MB2", "Memory", 0xfffd0024, 4, base=16, bitRange=2 -sfr = "CAN_TCR.MB3", "Memory", 0xfffd0024, 4, base=16, bitRange=3 -sfr = "CAN_TCR.MB4", "Memory", 0xfffd0024, 4, base=16, bitRange=4 -sfr = "CAN_TCR.MB5", "Memory", 0xfffd0024, 4, base=16, bitRange=5 -sfr = "CAN_TCR.MB6", "Memory", 0xfffd0024, 4, base=16, bitRange=6 -sfr = "CAN_TCR.MB7", "Memory", 0xfffd0024, 4, base=16, bitRange=7 -sfr = "CAN_TCR.MB8", "Memory", 0xfffd0024, 4, base=16, bitRange=8 -sfr = "CAN_TCR.MB9", "Memory", 0xfffd0024, 4, base=16, bitRange=9 -sfr = "CAN_TCR.MB10", "Memory", 0xfffd0024, 4, base=16, bitRange=10 -sfr = "CAN_TCR.MB11", "Memory", 0xfffd0024, 4, base=16, bitRange=11 -sfr = "CAN_TCR.MB12", "Memory", 0xfffd0024, 4, base=16, bitRange=12 -sfr = "CAN_TCR.MB13", "Memory", 0xfffd0024, 4, base=16, bitRange=13 -sfr = "CAN_TCR.MB14", "Memory", 0xfffd0024, 4, base=16, bitRange=14 -sfr = "CAN_TCR.MB15", "Memory", 0xfffd0024, 4, base=16, bitRange=15 -sfr = "CAN_TCR.TIMRST", "Memory", 0xfffd0024, 4, base=16, bitRange=31 -sfr = "CAN_ACR", "Memory", 0xfffd0028, 4, base=16 -sfr = "CAN_ACR.MB0", "Memory", 0xfffd0028, 4, base=16, bitRange=0 -sfr = "CAN_ACR.MB1", "Memory", 0xfffd0028, 4, base=16, bitRange=1 -sfr = "CAN_ACR.MB2", "Memory", 0xfffd0028, 4, base=16, bitRange=2 -sfr = "CAN_ACR.MB3", "Memory", 0xfffd0028, 4, base=16, bitRange=3 -sfr = "CAN_ACR.MB4", "Memory", 0xfffd0028, 4, base=16, bitRange=4 -sfr = "CAN_ACR.MB5", "Memory", 0xfffd0028, 4, base=16, bitRange=5 -sfr = "CAN_ACR.MB6", "Memory", 0xfffd0028, 4, base=16, bitRange=6 -sfr = "CAN_ACR.MB7", "Memory", 0xfffd0028, 4, base=16, bitRange=7 -sfr = "CAN_ACR.MB8", "Memory", 0xfffd0028, 4, base=16, bitRange=8 -sfr = "CAN_ACR.MB9", "Memory", 0xfffd0028, 4, base=16, bitRange=9 -sfr = "CAN_ACR.MB10", "Memory", 0xfffd0028, 4, base=16, bitRange=10 -sfr = "CAN_ACR.MB11", "Memory", 0xfffd0028, 4, base=16, bitRange=11 -sfr = "CAN_ACR.MB12", "Memory", 0xfffd0028, 4, base=16, bitRange=12 -sfr = "CAN_ACR.MB13", "Memory", 0xfffd0028, 4, base=16, bitRange=13 -sfr = "CAN_ACR.MB14", "Memory", 0xfffd0028, 4, base=16, bitRange=14 -sfr = "CAN_ACR.MB15", "Memory", 0xfffd0028, 4, base=16, bitRange=15 -sfr = "CAN_VR", "Memory", 0xfffd00fc, 4, base=16 -; ========== Register definition for EMAC peripheral ========== -sfr = "EMAC_NCR", "Memory", 0xfffdc000, 4, base=16 -sfr = "EMAC_NCR.LB", "Memory", 0xfffdc000, 4, base=16, bitRange=0 -sfr = "EMAC_NCR.LLB", "Memory", 0xfffdc000, 4, base=16, bitRange=1 -sfr = "EMAC_NCR.RE", "Memory", 0xfffdc000, 4, base=16, bitRange=2 -sfr = "EMAC_NCR.TE", "Memory", 0xfffdc000, 4, base=16, bitRange=3 -sfr = "EMAC_NCR.MPE", "Memory", 0xfffdc000, 4, base=16, bitRange=4 -sfr = "EMAC_NCR.CLRSTAT", "Memory", 0xfffdc000, 4, base=16, bitRange=5 -sfr = "EMAC_NCR.INCSTAT", "Memory", 0xfffdc000, 4, base=16, bitRange=6 -sfr = "EMAC_NCR.WESTAT", "Memory", 0xfffdc000, 4, base=16, bitRange=7 -sfr = "EMAC_NCR.BP", "Memory", 0xfffdc000, 4, base=16, bitRange=8 -sfr = "EMAC_NCR.TSTART", "Memory", 0xfffdc000, 4, base=16, bitRange=9 -sfr = "EMAC_NCR.THALT", "Memory", 0xfffdc000, 4, base=16, bitRange=10 -sfr = "EMAC_NCR.TPFR", "Memory", 0xfffdc000, 4, base=16, bitRange=11 -sfr = "EMAC_NCR.TZQ", "Memory", 0xfffdc000, 4, base=16, bitRange=12 -sfr = "EMAC_NCFGR", "Memory", 0xfffdc004, 4, base=16 -sfr = "EMAC_NCFGR.SPD", "Memory", 0xfffdc004, 4, base=16, bitRange=0 -sfr = "EMAC_NCFGR.FD", "Memory", 0xfffdc004, 4, base=16, bitRange=1 -sfr = "EMAC_NCFGR.JFRAME", "Memory", 0xfffdc004, 4, base=16, bitRange=3 -sfr = "EMAC_NCFGR.CAF", "Memory", 0xfffdc004, 4, base=16, bitRange=4 -sfr = "EMAC_NCFGR.NBC", "Memory", 0xfffdc004, 4, base=16, bitRange=5 -sfr = "EMAC_NCFGR.MTI", "Memory", 0xfffdc004, 4, base=16, bitRange=6 -sfr = "EMAC_NCFGR.UNI", "Memory", 0xfffdc004, 4, base=16, bitRange=7 -sfr = "EMAC_NCFGR.BIG", "Memory", 0xfffdc004, 4, base=16, bitRange=8 -sfr = "EMAC_NCFGR.EAE", "Memory", 0xfffdc004, 4, base=16, bitRange=9 -sfr = "EMAC_NCFGR.CLK", "Memory", 0xfffdc004, 4, base=16, bitRange=10-11 -sfr = "EMAC_NCFGR.RTY", "Memory", 0xfffdc004, 4, base=16, bitRange=12 -sfr = "EMAC_NCFGR.PAE", "Memory", 0xfffdc004, 4, base=16, bitRange=13 -sfr = "EMAC_NCFGR.RBOF", "Memory", 0xfffdc004, 4, base=16, bitRange=14-15 -sfr = "EMAC_NCFGR.RLCE", "Memory", 0xfffdc004, 4, base=16, bitRange=16 -sfr = "EMAC_NCFGR.DRFCS", "Memory", 0xfffdc004, 4, base=16, bitRange=17 -sfr = "EMAC_NCFGR.EFRHD", "Memory", 0xfffdc004, 4, base=16, bitRange=18 -sfr = "EMAC_NCFGR.IRXFCS", "Memory", 0xfffdc004, 4, base=16, bitRange=19 -sfr = "EMAC_NSR", "Memory", 0xfffdc008, 4, base=16 -sfr = "EMAC_NSR.LINKR", "Memory", 0xfffdc008, 4, base=16, bitRange=0 -sfr = "EMAC_NSR.MDIO", "Memory", 0xfffdc008, 4, base=16, bitRange=1 -sfr = "EMAC_NSR.IDLE", "Memory", 0xfffdc008, 4, base=16, bitRange=2 -sfr = "EMAC_TSR", "Memory", 0xfffdc014, 4, base=16 -sfr = "EMAC_TSR.UBR", "Memory", 0xfffdc014, 4, base=16, bitRange=0 -sfr = "EMAC_TSR.COL", "Memory", 0xfffdc014, 4, base=16, bitRange=1 -sfr = "EMAC_TSR.RLES", "Memory", 0xfffdc014, 4, base=16, bitRange=2 -sfr = "EMAC_TSR.TGO", "Memory", 0xfffdc014, 4, base=16, bitRange=3 -sfr = "EMAC_TSR.BEX", "Memory", 0xfffdc014, 4, base=16, bitRange=4 -sfr = "EMAC_TSR.COMP", "Memory", 0xfffdc014, 4, base=16, bitRange=5 -sfr = "EMAC_TSR.UND", "Memory", 0xfffdc014, 4, base=16, bitRange=6 -sfr = "EMAC_RBQP", "Memory", 0xfffdc018, 4, base=16 -sfr = "EMAC_TBQP", "Memory", 0xfffdc01c, 4, base=16 -sfr = "EMAC_RSR", "Memory", 0xfffdc020, 4, base=16 -sfr = "EMAC_RSR.BNA", "Memory", 0xfffdc020, 4, base=16, bitRange=0 -sfr = "EMAC_RSR.REC", "Memory", 0xfffdc020, 4, base=16, bitRange=1 -sfr = "EMAC_RSR.OVR", "Memory", 0xfffdc020, 4, base=16, bitRange=2 -sfr = "EMAC_ISR", "Memory", 0xfffdc024, 4, base=16 -sfr = "EMAC_ISR.MFD", "Memory", 0xfffdc024, 4, base=16, bitRange=0 -sfr = "EMAC_ISR.RCOMP", "Memory", 0xfffdc024, 4, base=16, bitRange=1 -sfr = "EMAC_ISR.RXUBR", "Memory", 0xfffdc024, 4, base=16, bitRange=2 -sfr = "EMAC_ISR.TXUBR", "Memory", 0xfffdc024, 4, base=16, bitRange=3 -sfr = "EMAC_ISR.TUNDR", "Memory", 0xfffdc024, 4, base=16, bitRange=4 -sfr = "EMAC_ISR.RLEX", "Memory", 0xfffdc024, 4, base=16, bitRange=5 -sfr = "EMAC_ISR.TXERR", "Memory", 0xfffdc024, 4, base=16, bitRange=6 -sfr = "EMAC_ISR.TCOMP", "Memory", 0xfffdc024, 4, base=16, bitRange=7 -sfr = "EMAC_ISR.LINK", "Memory", 0xfffdc024, 4, base=16, bitRange=9 -sfr = "EMAC_ISR.ROVR", "Memory", 0xfffdc024, 4, base=16, bitRange=10 -sfr = "EMAC_ISR.HRESP", "Memory", 0xfffdc024, 4, base=16, bitRange=11 -sfr = "EMAC_ISR.PFRE", "Memory", 0xfffdc024, 4, base=16, bitRange=12 -sfr = "EMAC_ISR.PTZ", "Memory", 0xfffdc024, 4, base=16, bitRange=13 -sfr = "EMAC_IER", "Memory", 0xfffdc028, 4, base=16 -sfr = "EMAC_IER.MFD", "Memory", 0xfffdc028, 4, base=16, bitRange=0 -sfr = "EMAC_IER.RCOMP", "Memory", 0xfffdc028, 4, base=16, bitRange=1 -sfr = "EMAC_IER.RXUBR", "Memory", 0xfffdc028, 4, base=16, bitRange=2 -sfr = "EMAC_IER.TXUBR", "Memory", 0xfffdc028, 4, base=16, bitRange=3 -sfr = "EMAC_IER.TUNDR", "Memory", 0xfffdc028, 4, base=16, bitRange=4 -sfr = "EMAC_IER.RLEX", "Memory", 0xfffdc028, 4, base=16, bitRange=5 -sfr = "EMAC_IER.TXERR", "Memory", 0xfffdc028, 4, base=16, bitRange=6 -sfr = "EMAC_IER.TCOMP", "Memory", 0xfffdc028, 4, base=16, bitRange=7 -sfr = "EMAC_IER.LINK", "Memory", 0xfffdc028, 4, base=16, bitRange=9 -sfr = "EMAC_IER.ROVR", "Memory", 0xfffdc028, 4, base=16, bitRange=10 -sfr = "EMAC_IER.HRESP", "Memory", 0xfffdc028, 4, base=16, bitRange=11 -sfr = "EMAC_IER.PFRE", "Memory", 0xfffdc028, 4, base=16, bitRange=12 -sfr = "EMAC_IER.PTZ", "Memory", 0xfffdc028, 4, base=16, bitRange=13 -sfr = "EMAC_IDR", "Memory", 0xfffdc02c, 4, base=16 -sfr = "EMAC_IDR.MFD", "Memory", 0xfffdc02c, 4, base=16, bitRange=0 -sfr = "EMAC_IDR.RCOMP", "Memory", 0xfffdc02c, 4, base=16, bitRange=1 -sfr = "EMAC_IDR.RXUBR", "Memory", 0xfffdc02c, 4, base=16, bitRange=2 -sfr = "EMAC_IDR.TXUBR", "Memory", 0xfffdc02c, 4, base=16, bitRange=3 -sfr = "EMAC_IDR.TUNDR", "Memory", 0xfffdc02c, 4, base=16, bitRange=4 -sfr = "EMAC_IDR.RLEX", "Memory", 0xfffdc02c, 4, base=16, bitRange=5 -sfr = "EMAC_IDR.TXERR", "Memory", 0xfffdc02c, 4, base=16, bitRange=6 -sfr = "EMAC_IDR.TCOMP", "Memory", 0xfffdc02c, 4, base=16, bitRange=7 -sfr = "EMAC_IDR.LINK", "Memory", 0xfffdc02c, 4, base=16, bitRange=9 -sfr = "EMAC_IDR.ROVR", "Memory", 0xfffdc02c, 4, base=16, bitRange=10 -sfr = "EMAC_IDR.HRESP", "Memory", 0xfffdc02c, 4, base=16, bitRange=11 -sfr = "EMAC_IDR.PFRE", "Memory", 0xfffdc02c, 4, base=16, bitRange=12 -sfr = "EMAC_IDR.PTZ", "Memory", 0xfffdc02c, 4, base=16, bitRange=13 -sfr = "EMAC_IMR", "Memory", 0xfffdc030, 4, base=16 -sfr = "EMAC_IMR.MFD", "Memory", 0xfffdc030, 4, base=16, bitRange=0 -sfr = "EMAC_IMR.RCOMP", "Memory", 0xfffdc030, 4, base=16, bitRange=1 -sfr = "EMAC_IMR.RXUBR", "Memory", 0xfffdc030, 4, base=16, bitRange=2 -sfr = "EMAC_IMR.TXUBR", "Memory", 0xfffdc030, 4, base=16, bitRange=3 -sfr = "EMAC_IMR.TUNDR", "Memory", 0xfffdc030, 4, base=16, bitRange=4 -sfr = "EMAC_IMR.RLEX", "Memory", 0xfffdc030, 4, base=16, bitRange=5 -sfr = "EMAC_IMR.TXERR", "Memory", 0xfffdc030, 4, base=16, bitRange=6 -sfr = "EMAC_IMR.TCOMP", "Memory", 0xfffdc030, 4, base=16, bitRange=7 -sfr = "EMAC_IMR.LINK", "Memory", 0xfffdc030, 4, base=16, bitRange=9 -sfr = "EMAC_IMR.ROVR", "Memory", 0xfffdc030, 4, base=16, bitRange=10 -sfr = "EMAC_IMR.HRESP", "Memory", 0xfffdc030, 4, base=16, bitRange=11 -sfr = "EMAC_IMR.PFRE", "Memory", 0xfffdc030, 4, base=16, bitRange=12 -sfr = "EMAC_IMR.PTZ", "Memory", 0xfffdc030, 4, base=16, bitRange=13 -sfr = "EMAC_MAN", "Memory", 0xfffdc034, 4, base=16 -sfr = "EMAC_MAN.DATA", "Memory", 0xfffdc034, 4, base=16, bitRange=0-15 -sfr = "EMAC_MAN.CODE", "Memory", 0xfffdc034, 4, base=16, bitRange=16-17 -sfr = "EMAC_MAN.REGA", "Memory", 0xfffdc034, 4, base=16, bitRange=18-22 -sfr = "EMAC_MAN.PHYA", "Memory", 0xfffdc034, 4, base=16, bitRange=23-27 -sfr = "EMAC_MAN.RW", "Memory", 0xfffdc034, 4, base=16, bitRange=28-29 -sfr = "EMAC_MAN.SOF", "Memory", 0xfffdc034, 4, base=16, bitRange=30-31 -sfr = "EMAC_PTR", "Memory", 0xfffdc038, 4, base=16 -sfr = "EMAC_PFR", "Memory", 0xfffdc03c, 4, base=16 -sfr = "EMAC_FTO", "Memory", 0xfffdc040, 4, base=16 -sfr = "EMAC_SCF", "Memory", 0xfffdc044, 4, base=16 -sfr = "EMAC_MCF", "Memory", 0xfffdc048, 4, base=16 -sfr = "EMAC_FRO", "Memory", 0xfffdc04c, 4, base=16 -sfr = "EMAC_FCSE", "Memory", 0xfffdc050, 4, base=16 -sfr = "EMAC_ALE", "Memory", 0xfffdc054, 4, base=16 -sfr = "EMAC_DTF", "Memory", 0xfffdc058, 4, base=16 -sfr = "EMAC_LCOL", "Memory", 0xfffdc05c, 4, base=16 -sfr = "EMAC_ECOL", "Memory", 0xfffdc060, 4, base=16 -sfr = "EMAC_TUND", "Memory", 0xfffdc064, 4, base=16 -sfr = "EMAC_CSE", "Memory", 0xfffdc068, 4, base=16 -sfr = "EMAC_RRE", "Memory", 0xfffdc06c, 4, base=16 -sfr = "EMAC_ROV", "Memory", 0xfffdc070, 4, base=16 -sfr = "EMAC_RSE", "Memory", 0xfffdc074, 4, base=16 -sfr = "EMAC_ELE", "Memory", 0xfffdc078, 4, base=16 -sfr = "EMAC_RJA", "Memory", 0xfffdc07c, 4, base=16 -sfr = "EMAC_USF", "Memory", 0xfffdc080, 4, base=16 -sfr = "EMAC_STE", "Memory", 0xfffdc084, 4, base=16 -sfr = "EMAC_RLE", "Memory", 0xfffdc088, 4, base=16 -sfr = "EMAC_TPF", "Memory", 0xfffdc08c, 4, base=16 -sfr = "EMAC_HRB", "Memory", 0xfffdc090, 4, base=16 -sfr = "EMAC_HRT", "Memory", 0xfffdc094, 4, base=16 -sfr = "EMAC_SA1L", "Memory", 0xfffdc098, 4, base=16 -sfr = "EMAC_SA1H", "Memory", 0xfffdc09c, 4, base=16 -sfr = "EMAC_SA2L", "Memory", 0xfffdc0a0, 4, base=16 -sfr = "EMAC_SA2H", "Memory", 0xfffdc0a4, 4, base=16 -sfr = "EMAC_SA3L", "Memory", 0xfffdc0a8, 4, base=16 -sfr = "EMAC_SA3H", "Memory", 0xfffdc0ac, 4, base=16 -sfr = "EMAC_SA4L", "Memory", 0xfffdc0b0, 4, base=16 -sfr = "EMAC_SA4H", "Memory", 0xfffdc0b4, 4, base=16 -sfr = "EMAC_TID", "Memory", 0xfffdc0b8, 4, base=16 -sfr = "EMAC_TPQ", "Memory", 0xfffdc0bc, 4, base=16 -sfr = "EMAC_USRIO", "Memory", 0xfffdc0c0, 4, base=16 -sfr = "EMAC_USRIO.RMII", "Memory", 0xfffdc0c0, 4, base=16, bitRange=0 -sfr = "EMAC_USRIO.CLKEN", "Memory", 0xfffdc0c0, 4, base=16, bitRange=1 -sfr = "EMAC_WOL", "Memory", 0xfffdc0c4, 4, base=16 -sfr = "EMAC_WOL.IP", "Memory", 0xfffdc0c4, 4, base=16, bitRange=0-15 -sfr = "EMAC_WOL.MAG", "Memory", 0xfffdc0c4, 4, base=16, bitRange=16 -sfr = "EMAC_WOL.ARP", "Memory", 0xfffdc0c4, 4, base=16, bitRange=17 -sfr = "EMAC_WOL.SA1", "Memory", 0xfffdc0c4, 4, base=16, bitRange=18 -sfr = "EMAC_WOL.MTI", "Memory", 0xfffdc0c4, 4, base=16, bitRange=19 -sfr = "EMAC_REV", "Memory", 0xfffdc0fc, 4, base=16 -sfr = "EMAC_REV.REVREF", "Memory", 0xfffdc0fc, 4, base=16, bitRange=0-15 -sfr = "EMAC_REV.PARTREF", "Memory", 0xfffdc0fc, 4, base=16, bitRange=16-31 -; ========== Register definition for PDC_ADC peripheral ========== -sfr = "ADC_RPR", "Memory", 0xfffd8100, 4, base=16 -sfr = "ADC_RCR", "Memory", 0xfffd8104, 4, base=16 -sfr = "ADC_TPR", "Memory", 0xfffd8108, 4, base=16 -sfr = "ADC_TCR", "Memory", 0xfffd810c, 4, base=16 -sfr = "ADC_RNPR", "Memory", 0xfffd8110, 4, base=16 -sfr = "ADC_RNCR", "Memory", 0xfffd8114, 4, base=16 -sfr = "ADC_TNPR", "Memory", 0xfffd8118, 4, base=16 -sfr = "ADC_TNCR", "Memory", 0xfffd811c, 4, base=16 -sfr = "ADC_PTCR", "Memory", 0xfffd8120, 4, base=16 -sfr = "ADC_PTCR.RXTEN", "Memory", 0xfffd8120, 4, base=16, bitRange=0 -sfr = "ADC_PTCR.RXTDIS", "Memory", 0xfffd8120, 4, base=16, bitRange=1 -sfr = "ADC_PTCR.TXTEN", "Memory", 0xfffd8120, 4, base=16, bitRange=8 -sfr = "ADC_PTCR.TXTDIS", "Memory", 0xfffd8120, 4, base=16, bitRange=9 -sfr = "ADC_PTSR", "Memory", 0xfffd8124, 4, base=16 -sfr = "ADC_PTSR.RXTEN", "Memory", 0xfffd8124, 4, base=16, bitRange=0 -sfr = "ADC_PTSR.TXTEN", "Memory", 0xfffd8124, 4, base=16, bitRange=8 -; ========== Register definition for ADC peripheral ========== -sfr = "ADC_CR", "Memory", 0xfffd8000, 4, base=16 -sfr = "ADC_CR.SWRST", "Memory", 0xfffd8000, 4, base=16, bitRange=0 -sfr = "ADC_CR.START", "Memory", 0xfffd8000, 4, base=16, bitRange=1 -sfr = "ADC_MR", "Memory", 0xfffd8004, 4, base=16 -sfr = "ADC_MR.TRGEN", "Memory", 0xfffd8004, 4, base=16, bitRange=0 -sfr = "ADC_MR.TRGSEL", "Memory", 0xfffd8004, 4, base=16, bitRange=1-3 -sfr = "ADC_MR.LOWRES", "Memory", 0xfffd8004, 4, base=16, bitRange=4 -sfr = "ADC_MR.SLEEP", "Memory", 0xfffd8004, 4, base=16, bitRange=5 -sfr = "ADC_MR.PRESCAL", "Memory", 0xfffd8004, 4, base=16, bitRange=8-13 -sfr = "ADC_MR.STARTUP", "Memory", 0xfffd8004, 4, base=16, bitRange=16-20 -sfr = "ADC_MR.SHTIM", "Memory", 0xfffd8004, 4, base=16, bitRange=24-27 -sfr = "ADC_CHER", "Memory", 0xfffd8010, 4, base=16 -sfr = "ADC_CHER.CH0", "Memory", 0xfffd8010, 4, base=16, bitRange=0 -sfr = "ADC_CHER.CH1", "Memory", 0xfffd8010, 4, base=16, bitRange=1 -sfr = "ADC_CHER.CH2", "Memory", 0xfffd8010, 4, base=16, bitRange=2 -sfr = "ADC_CHER.CH3", "Memory", 0xfffd8010, 4, base=16, bitRange=3 -sfr = "ADC_CHER.CH4", "Memory", 0xfffd8010, 4, base=16, bitRange=4 -sfr = "ADC_CHER.CH5", "Memory", 0xfffd8010, 4, base=16, bitRange=5 -sfr = "ADC_CHER.CH6", "Memory", 0xfffd8010, 4, base=16, bitRange=6 -sfr = "ADC_CHER.CH7", "Memory", 0xfffd8010, 4, base=16, bitRange=7 -sfr = "ADC_CHDR", "Memory", 0xfffd8014, 4, base=16 -sfr = "ADC_CHDR.CH0", "Memory", 0xfffd8014, 4, base=16, bitRange=0 -sfr = "ADC_CHDR.CH1", "Memory", 0xfffd8014, 4, base=16, bitRange=1 -sfr = "ADC_CHDR.CH2", "Memory", 0xfffd8014, 4, base=16, bitRange=2 -sfr = "ADC_CHDR.CH3", "Memory", 0xfffd8014, 4, base=16, bitRange=3 -sfr = "ADC_CHDR.CH4", "Memory", 0xfffd8014, 4, base=16, bitRange=4 -sfr = "ADC_CHDR.CH5", "Memory", 0xfffd8014, 4, base=16, bitRange=5 -sfr = "ADC_CHDR.CH6", "Memory", 0xfffd8014, 4, base=16, bitRange=6 -sfr = "ADC_CHDR.CH7", "Memory", 0xfffd8014, 4, base=16, bitRange=7 -sfr = "ADC_CHSR", "Memory", 0xfffd8018, 4, base=16 -sfr = "ADC_CHSR.CH0", "Memory", 0xfffd8018, 4, base=16, bitRange=0 -sfr = "ADC_CHSR.CH1", "Memory", 0xfffd8018, 4, base=16, bitRange=1 -sfr = "ADC_CHSR.CH2", "Memory", 0xfffd8018, 4, base=16, bitRange=2 -sfr = "ADC_CHSR.CH3", "Memory", 0xfffd8018, 4, base=16, bitRange=3 -sfr = "ADC_CHSR.CH4", "Memory", 0xfffd8018, 4, base=16, bitRange=4 -sfr = "ADC_CHSR.CH5", "Memory", 0xfffd8018, 4, base=16, bitRange=5 -sfr = "ADC_CHSR.CH6", "Memory", 0xfffd8018, 4, base=16, bitRange=6 -sfr = "ADC_CHSR.CH7", "Memory", 0xfffd8018, 4, base=16, bitRange=7 -sfr = "ADC_SR", "Memory", 0xfffd801c, 4, base=16 -sfr = "ADC_SR.EOC0", "Memory", 0xfffd801c, 4, base=16, bitRange=0 -sfr = "ADC_SR.EOC1", "Memory", 0xfffd801c, 4, base=16, bitRange=1 -sfr = "ADC_SR.EOC2", "Memory", 0xfffd801c, 4, base=16, bitRange=2 -sfr = "ADC_SR.EOC3", "Memory", 0xfffd801c, 4, base=16, bitRange=3 -sfr = "ADC_SR.EOC4", "Memory", 0xfffd801c, 4, base=16, bitRange=4 -sfr = "ADC_SR.EOC5", "Memory", 0xfffd801c, 4, base=16, bitRange=5 -sfr = "ADC_SR.EOC6", "Memory", 0xfffd801c, 4, base=16, bitRange=6 -sfr = "ADC_SR.EOC7", "Memory", 0xfffd801c, 4, base=16, bitRange=7 -sfr = "ADC_SR.OVRE0", "Memory", 0xfffd801c, 4, base=16, bitRange=8 -sfr = "ADC_SR.OVRE1", "Memory", 0xfffd801c, 4, base=16, bitRange=9 -sfr = "ADC_SR.OVRE2", "Memory", 0xfffd801c, 4, base=16, bitRange=10 -sfr = "ADC_SR.OVRE3", "Memory", 0xfffd801c, 4, base=16, bitRange=11 -sfr = "ADC_SR.OVRE4", "Memory", 0xfffd801c, 4, base=16, bitRange=12 -sfr = "ADC_SR.OVRE5", "Memory", 0xfffd801c, 4, base=16, bitRange=13 -sfr = "ADC_SR.OVRE6", "Memory", 0xfffd801c, 4, base=16, bitRange=14 -sfr = "ADC_SR.OVRE7", "Memory", 0xfffd801c, 4, base=16, bitRange=15 -sfr = "ADC_SR.DRDY", "Memory", 0xfffd801c, 4, base=16, bitRange=16 -sfr = "ADC_SR.GOVRE", "Memory", 0xfffd801c, 4, base=16, bitRange=17 -sfr = "ADC_SR.ENDRX", "Memory", 0xfffd801c, 4, base=16, bitRange=18 -sfr = "ADC_SR.RXBUFF", "Memory", 0xfffd801c, 4, base=16, bitRange=19 -sfr = "ADC_LCDR", "Memory", 0xfffd8020, 4, base=16 -sfr = "ADC_LCDR.LDATA", "Memory", 0xfffd8020, 4, base=16, bitRange=0-9 -sfr = "ADC_IER", "Memory", 0xfffd8024, 4, base=16 -sfr = "ADC_IER.EOC0", "Memory", 0xfffd8024, 4, base=16, bitRange=0 -sfr = "ADC_IER.EOC1", "Memory", 0xfffd8024, 4, base=16, bitRange=1 -sfr = "ADC_IER.EOC2", "Memory", 0xfffd8024, 4, base=16, bitRange=2 -sfr = "ADC_IER.EOC3", "Memory", 0xfffd8024, 4, base=16, bitRange=3 -sfr = "ADC_IER.EOC4", "Memory", 0xfffd8024, 4, base=16, bitRange=4 -sfr = "ADC_IER.EOC5", "Memory", 0xfffd8024, 4, base=16, bitRange=5 -sfr = "ADC_IER.EOC6", "Memory", 0xfffd8024, 4, base=16, bitRange=6 -sfr = "ADC_IER.EOC7", "Memory", 0xfffd8024, 4, base=16, bitRange=7 -sfr = "ADC_IER.OVRE0", "Memory", 0xfffd8024, 4, base=16, bitRange=8 -sfr = "ADC_IER.OVRE1", "Memory", 0xfffd8024, 4, base=16, bitRange=9 -sfr = "ADC_IER.OVRE2", "Memory", 0xfffd8024, 4, base=16, bitRange=10 -sfr = "ADC_IER.OVRE3", "Memory", 0xfffd8024, 4, base=16, bitRange=11 -sfr = "ADC_IER.OVRE4", "Memory", 0xfffd8024, 4, base=16, bitRange=12 -sfr = "ADC_IER.OVRE5", "Memory", 0xfffd8024, 4, base=16, bitRange=13 -sfr = "ADC_IER.OVRE6", "Memory", 0xfffd8024, 4, base=16, bitRange=14 -sfr = "ADC_IER.OVRE7", "Memory", 0xfffd8024, 4, base=16, bitRange=15 -sfr = "ADC_IER.DRDY", "Memory", 0xfffd8024, 4, base=16, bitRange=16 -sfr = "ADC_IER.GOVRE", "Memory", 0xfffd8024, 4, base=16, bitRange=17 -sfr = "ADC_IER.ENDRX", "Memory", 0xfffd8024, 4, base=16, bitRange=18 -sfr = "ADC_IER.RXBUFF", "Memory", 0xfffd8024, 4, base=16, bitRange=19 -sfr = "ADC_IDR", "Memory", 0xfffd8028, 4, base=16 -sfr = "ADC_IDR.EOC0", "Memory", 0xfffd8028, 4, base=16, bitRange=0 -sfr = "ADC_IDR.EOC1", "Memory", 0xfffd8028, 4, base=16, bitRange=1 -sfr = "ADC_IDR.EOC2", "Memory", 0xfffd8028, 4, base=16, bitRange=2 -sfr = "ADC_IDR.EOC3", "Memory", 0xfffd8028, 4, base=16, bitRange=3 -sfr = "ADC_IDR.EOC4", "Memory", 0xfffd8028, 4, base=16, bitRange=4 -sfr = "ADC_IDR.EOC5", "Memory", 0xfffd8028, 4, base=16, bitRange=5 -sfr = "ADC_IDR.EOC6", "Memory", 0xfffd8028, 4, base=16, bitRange=6 -sfr = "ADC_IDR.EOC7", "Memory", 0xfffd8028, 4, base=16, bitRange=7 -sfr = "ADC_IDR.OVRE0", "Memory", 0xfffd8028, 4, base=16, bitRange=8 -sfr = "ADC_IDR.OVRE1", "Memory", 0xfffd8028, 4, base=16, bitRange=9 -sfr = "ADC_IDR.OVRE2", "Memory", 0xfffd8028, 4, base=16, bitRange=10 -sfr = "ADC_IDR.OVRE3", "Memory", 0xfffd8028, 4, base=16, bitRange=11 -sfr = "ADC_IDR.OVRE4", "Memory", 0xfffd8028, 4, base=16, bitRange=12 -sfr = "ADC_IDR.OVRE5", "Memory", 0xfffd8028, 4, base=16, bitRange=13 -sfr = "ADC_IDR.OVRE6", "Memory", 0xfffd8028, 4, base=16, bitRange=14 -sfr = "ADC_IDR.OVRE7", "Memory", 0xfffd8028, 4, base=16, bitRange=15 -sfr = "ADC_IDR.DRDY", "Memory", 0xfffd8028, 4, base=16, bitRange=16 -sfr = "ADC_IDR.GOVRE", "Memory", 0xfffd8028, 4, base=16, bitRange=17 -sfr = "ADC_IDR.ENDRX", "Memory", 0xfffd8028, 4, base=16, bitRange=18 -sfr = "ADC_IDR.RXBUFF", "Memory", 0xfffd8028, 4, base=16, bitRange=19 -sfr = "ADC_IMR", "Memory", 0xfffd802c, 4, base=16 -sfr = "ADC_IMR.EOC0", "Memory", 0xfffd802c, 4, base=16, bitRange=0 -sfr = "ADC_IMR.EOC1", "Memory", 0xfffd802c, 4, base=16, bitRange=1 -sfr = "ADC_IMR.EOC2", "Memory", 0xfffd802c, 4, base=16, bitRange=2 -sfr = "ADC_IMR.EOC3", "Memory", 0xfffd802c, 4, base=16, bitRange=3 -sfr = "ADC_IMR.EOC4", "Memory", 0xfffd802c, 4, base=16, bitRange=4 -sfr = "ADC_IMR.EOC5", "Memory", 0xfffd802c, 4, base=16, bitRange=5 -sfr = "ADC_IMR.EOC6", "Memory", 0xfffd802c, 4, base=16, bitRange=6 -sfr = "ADC_IMR.EOC7", "Memory", 0xfffd802c, 4, base=16, bitRange=7 -sfr = "ADC_IMR.OVRE0", "Memory", 0xfffd802c, 4, base=16, bitRange=8 -sfr = "ADC_IMR.OVRE1", "Memory", 0xfffd802c, 4, base=16, bitRange=9 -sfr = "ADC_IMR.OVRE2", "Memory", 0xfffd802c, 4, base=16, bitRange=10 -sfr = "ADC_IMR.OVRE3", "Memory", 0xfffd802c, 4, base=16, bitRange=11 -sfr = "ADC_IMR.OVRE4", "Memory", 0xfffd802c, 4, base=16, bitRange=12 -sfr = "ADC_IMR.OVRE5", "Memory", 0xfffd802c, 4, base=16, bitRange=13 -sfr = "ADC_IMR.OVRE6", "Memory", 0xfffd802c, 4, base=16, bitRange=14 -sfr = "ADC_IMR.OVRE7", "Memory", 0xfffd802c, 4, base=16, bitRange=15 -sfr = "ADC_IMR.DRDY", "Memory", 0xfffd802c, 4, base=16, bitRange=16 -sfr = "ADC_IMR.GOVRE", "Memory", 0xfffd802c, 4, base=16, bitRange=17 -sfr = "ADC_IMR.ENDRX", "Memory", 0xfffd802c, 4, base=16, bitRange=18 -sfr = "ADC_IMR.RXBUFF", "Memory", 0xfffd802c, 4, base=16, bitRange=19 -sfr = "ADC_CDR0", "Memory", 0xfffd8030, 4, base=16 -sfr = "ADC_CDR0.DATA", "Memory", 0xfffd8030, 4, base=16, bitRange=0-9 -sfr = "ADC_CDR1", "Memory", 0xfffd8034, 4, base=16 -sfr = "ADC_CDR1.DATA", "Memory", 0xfffd8034, 4, base=16, bitRange=0-9 -sfr = "ADC_CDR2", "Memory", 0xfffd8038, 4, base=16 -sfr = "ADC_CDR2.DATA", "Memory", 0xfffd8038, 4, base=16, bitRange=0-9 -sfr = "ADC_CDR3", "Memory", 0xfffd803c, 4, base=16 -sfr = "ADC_CDR3.DATA", "Memory", 0xfffd803c, 4, base=16, bitRange=0-9 -sfr = "ADC_CDR4", "Memory", 0xfffd8040, 4, base=16 -sfr = "ADC_CDR4.DATA", "Memory", 0xfffd8040, 4, base=16, bitRange=0-9 -sfr = "ADC_CDR5", "Memory", 0xfffd8044, 4, base=16 -sfr = "ADC_CDR5.DATA", "Memory", 0xfffd8044, 4, base=16, bitRange=0-9 -sfr = "ADC_CDR6", "Memory", 0xfffd8048, 4, base=16 -sfr = "ADC_CDR6.DATA", "Memory", 0xfffd8048, 4, base=16, bitRange=0-9 -sfr = "ADC_CDR7", "Memory", 0xfffd804c, 4, base=16 -sfr = "ADC_CDR7.DATA", "Memory", 0xfffd804c, 4, base=16, bitRange=0-9 - - -[SfrGroupInfo] -group = "TC0", "TC0_CCR", "TC0_CMR", "TC0_CV", "TC0_RA", "TC0_RB", "TC0_RC", "TC0_SR", "TC0_IER", "TC0_IDR", "TC0_IMR" -group = "TCB", "TCB_BCR", "TCB_BMR" -group = "TC1", "TC1_CCR", "TC1_CMR", "TC1_CV", "TC1_RA", "TC1_RB", "TC1_RC", "TC1_SR", "TC1_IER", "TC1_IDR", "TC1_IMR" -group = "TC2", "TC2_CCR", "TC2_CMR", "TC2_CV", "TC2_RA", "TC2_RB", "TC2_RC", "TC2_SR", "TC2_IER", "TC2_IDR", "TC2_IMR" -group = "UDP", "UDP_NUM", "UDP_GLBSTATE", "UDP_FADDR", "UDP_IER", "UDP_IDR", "UDP_IMR", "UDP_ISR", "UDP_ICR", "UDP_RSTEP", "UDP_CSR", "UDP_FDR", "UDP_TXVC" -group = "TWI", "TWI_CR", "TWI_MMR", "TWI_IADR", "TWI_CWGR", "TWI_SR", "TWI_IER", "TWI_IDR", "TWI_IMR", "TWI_RHR", "TWI_THR" -group = "US0", "US0_CR", "US0_MR", "US0_IER", "US0_IDR", "US0_IMR", "US0_CSR", "US0_RHR", "US0_THR", "US0_BRGR", "US0_RTOR", "US0_TTGR", "US0_FIDI", "US0_NER", "US0_IF" -group = "PDC_US0", "US0_RPR", "US0_RCR", "US0_TPR", "US0_TCR", "US0_RNPR", "US0_RNCR", "US0_TNPR", "US0_TNCR", "US0_PTCR", "US0_PTSR" -group = "US1", "US1_CR", "US1_MR", "US1_IER", "US1_IDR", "US1_IMR", "US1_CSR", "US1_RHR", "US1_THR", "US1_BRGR", "US1_RTOR", "US1_TTGR", "US1_FIDI", "US1_NER", "US1_IF" -group = "PDC_US1", "US1_RPR", "US1_RCR", "US1_TPR", "US1_TCR", "US1_RNPR", "US1_RNCR", "US1_TNPR", "US1_TNCR", "US1_PTCR", "US1_PTSR" -group = "PWMC", "PWMC_MR", "PWMC_ENA", "PWMC_DIS", "PWMC_SR", "PWMC_IER", "PWMC_IDR", "PWMC_IMR", "PWMC_ISR", "PWMC_VR" -group = "PWMC_CH0", "PWMC_CH0_CMR", "PWMC_CH0_CDTYR", "PWMC_CH0_CPRDR", "PWMC_CH0_CCNTR", "PWMC_CH0_CUPDR", "PWMC_CH0_Reserved" -group = "PWMC_CH1", "PWMC_CH1_CMR", "PWMC_CH1_CDTYR", "PWMC_CH1_CPRDR", "PWMC_CH1_CCNTR", "PWMC_CH1_CUPDR", "PWMC_CH1_Reserved" -group = "PWMC_CH2", "PWMC_CH2_CMR", "PWMC_CH2_CDTYR", "PWMC_CH2_CPRDR", "PWMC_CH2_CCNTR", "PWMC_CH2_CUPDR", "PWMC_CH2_Reserved" -group = "PWMC_CH3", "PWMC_CH3_CMR", "PWMC_CH3_CDTYR", "PWMC_CH3_CPRDR", "PWMC_CH3_CCNTR", "PWMC_CH3_CUPDR", "PWMC_CH3_Reserved" -group = "CAN", "CAN_MR", "CAN_IER", "CAN_IDR", "CAN_IMR", "CAN_SR", "CAN_BR", "CAN_TIM", "CAN_TIMESTP", "CAN_ECR", "CAN_TCR", "CAN_ACR", "CAN_VR" -group = "CAN_MB0", "CAN_MB0_MMR", "CAN_MB0_MAM", "CAN_MB0_MID", "CAN_MB0_MFID", "CAN_MB0_MSR", "CAN_MB0_MDL", "CAN_MB0_MDH", "CAN_MB0_MCR" -group = "CAN_MB1", "CAN_MB1_MMR", "CAN_MB1_MAM", "CAN_MB1_MID", "CAN_MB1_MFID", "CAN_MB1_MSR", "CAN_MB1_MDL", "CAN_MB1_MDH", "CAN_MB1_MCR" -group = "CAN_MB2", "CAN_MB2_MMR", "CAN_MB2_MAM", "CAN_MB2_MID", "CAN_MB2_MFID", "CAN_MB2_MSR", "CAN_MB2_MDL", "CAN_MB2_MDH", "CAN_MB2_MCR" -group = "CAN_MB3", "CAN_MB3_MMR", "CAN_MB3_MAM", "CAN_MB3_MID", "CAN_MB3_MFID", "CAN_MB3_MSR", "CAN_MB3_MDL", "CAN_MB3_MDH", "CAN_MB3_MCR" -group = "CAN_MB4", "CAN_MB4_MMR", "CAN_MB4_MAM", "CAN_MB4_MID", "CAN_MB4_MFID", "CAN_MB4_MSR", "CAN_MB4_MDL", "CAN_MB4_MDH", "CAN_MB4_MCR" -group = "CAN_MB5", "CAN_MB5_MMR", "CAN_MB5_MAM", "CAN_MB5_MID", "CAN_MB5_MFID", "CAN_MB5_MSR", "CAN_MB5_MDL", "CAN_MB5_MDH", "CAN_MB5_MCR" -group = "CAN_MB6", "CAN_MB6_MMR", "CAN_MB6_MAM", "CAN_MB6_MID", "CAN_MB6_MFID", "CAN_MB6_MSR", "CAN_MB6_MDL", "CAN_MB6_MDH", "CAN_MB6_MCR" -group = "CAN_MB7", "CAN_MB7_MMR", "CAN_MB7_MAM", "CAN_MB7_MID", "CAN_MB7_MFID", "CAN_MB7_MSR", "CAN_MB7_MDL", "CAN_MB7_MDH", "CAN_MB7_MCR" -group = "SSC", "SSC_CR", "SSC_CMR", "SSC_RCMR", "SSC_RFMR", "SSC_TCMR", "SSC_TFMR", "SSC_RHR", "SSC_THR", "SSC_RSHR", "SSC_TSHR", "SSC_SR", "SSC_IER", "SSC_IDR", "SSC_IMR" -group = "PDC_SSC", "SSC_RPR", "SSC_RCR", "SSC_TPR", "SSC_TCR", "SSC_RNPR", "SSC_RNCR", "SSC_TNPR", "SSC_TNCR", "SSC_PTCR", "SSC_PTSR" -group = "ADC", "ADC_CR", "ADC_MR", "ADC_CHER", "ADC_CHDR", "ADC_CHSR", "ADC_SR", "ADC_LCDR", "ADC_IER", "ADC_IDR", "ADC_IMR", "ADC_CDR0", "ADC_CDR1", "ADC_CDR2", "ADC_CDR3", "ADC_CDR4", "ADC_CDR5", "ADC_CDR6", "ADC_CDR7" -group = "PDC_ADC", "ADC_RPR", "ADC_RCR", "ADC_TPR", "ADC_TCR", "ADC_RNPR", "ADC_RNCR", "ADC_TNPR", "ADC_TNCR", "ADC_PTCR", "ADC_PTSR" -group = "EMAC", "EMAC_NCR", "EMAC_NCFGR", "EMAC_NSR", "EMAC_TSR", "EMAC_RBQP", "EMAC_TBQP", "EMAC_RSR", "EMAC_ISR", "EMAC_IER", "EMAC_IDR", "EMAC_IMR", "EMAC_MAN", "EMAC_PTR", "EMAC_PFR", "EMAC_FTO", "EMAC_SCF", "EMAC_MCF", "EMAC_FRO", "EMAC_FCSE", "EMAC_ALE", "EMAC_DTF", "EMAC_LCOL", "EMAC_ECOL", "EMAC_TUND", "EMAC_CSE", "EMAC_RRE", "EMAC_ROV", "EMAC_RSE", "EMAC_ELE", "EMAC_RJA", "EMAC_USF", "EMAC_STE", "EMAC_RLE", "EMAC_TPF", "EMAC_HRB", "EMAC_HRT", "EMAC_SA1L", "EMAC_SA1H", "EMAC_SA2L", "EMAC_SA2H", "EMAC_SA3L", "EMAC_SA3H", "EMAC_SA4L", "EMAC_SA4H", "EMAC_TID", "EMAC_TPQ", "EMAC_USRIO", "EMAC_WOL", "EMAC_REV" -group = "SPI0", "SPI0_CR", "SPI0_MR", "SPI0_RDR", "SPI0_TDR", "SPI0_SR", "SPI0_IER", "SPI0_IDR", "SPI0_IMR", "SPI0_CSR" -group = "PDC_SPI0", "SPI0_RPR", "SPI0_RCR", "SPI0_TPR", "SPI0_TCR", "SPI0_RNPR", "SPI0_RNCR", "SPI0_TNPR", "SPI0_TNCR", "SPI0_PTCR", "SPI0_PTSR" -group = "SPI1", "SPI1_CR", "SPI1_MR", "SPI1_RDR", "SPI1_TDR", "SPI1_SR", "SPI1_IER", "SPI1_IDR", "SPI1_IMR", "SPI1_CSR" -group = "PDC_SPI1", "SPI1_RPR", "SPI1_RCR", "SPI1_TPR", "SPI1_TCR", "SPI1_RNPR", "SPI1_RNCR", "SPI1_TNPR", "SPI1_TNCR", "SPI1_PTCR", "SPI1_PTSR" -group = "SYS" -group = "AIC", "AIC_SMR", "AIC_SVR", "AIC_IVR", "AIC_FVR", "AIC_ISR", "AIC_IPR", "AIC_IMR", "AIC_CISR", "AIC_IECR", "AIC_IDCR", "AIC_ICCR", "AIC_ISCR", "AIC_EOICR", "AIC_SPU", "AIC_DCR", "AIC_FFER", "AIC_FFDR", "AIC_FFSR" -group = "DBGU", "DBGU_CR", "DBGU_MR", "DBGU_IER", "DBGU_IDR", "DBGU_IMR", "DBGU_CSR", "DBGU_RHR", "DBGU_THR", "DBGU_BRGR", "DBGU_CIDR", "DBGU_EXID", "DBGU_FNTR" -group = "PDC_DBGU", "DBGU_RPR", "DBGU_RCR", "DBGU_TPR", "DBGU_TCR", "DBGU_RNPR", "DBGU_RNCR", "DBGU_TNPR", "DBGU_TNCR", "DBGU_PTCR", "DBGU_PTSR" -group = "PIOA", "PIOA_PER", "PIOA_PDR", "PIOA_PSR", "PIOA_OER", "PIOA_ODR", "PIOA_OSR", "PIOA_IFER", "PIOA_IFDR", "PIOA_IFSR", "PIOA_SODR", "PIOA_CODR", "PIOA_ODSR", "PIOA_PDSR", "PIOA_IER", "PIOA_IDR", "PIOA_IMR", "PIOA_ISR", "PIOA_MDER", "PIOA_MDDR", "PIOA_MDSR", "PIOA_PPUDR", "PIOA_PPUER", "PIOA_PPUSR", "PIOA_ASR", "PIOA_BSR", "PIOA_ABSR", "PIOA_OWER", "PIOA_OWDR", "PIOA_OWSR" -group = "PIOB", "PIOB_PER", "PIOB_PDR", "PIOB_PSR", "PIOB_OER", "PIOB_ODR", "PIOB_OSR", "PIOB_IFER", "PIOB_IFDR", "PIOB_IFSR", "PIOB_SODR", "PIOB_CODR", "PIOB_ODSR", "PIOB_PDSR", "PIOB_IER", "PIOB_IDR", "PIOB_IMR", "PIOB_ISR", "PIOB_MDER", "PIOB_MDDR", "PIOB_MDSR", "PIOB_PPUDR", "PIOB_PPUER", "PIOB_PPUSR", "PIOB_ASR", "PIOB_BSR", "PIOB_ABSR", "PIOB_OWER", "PIOB_OWDR", "PIOB_OWSR" -group = "PMC", "PMC_SCER", "PMC_SCDR", "PMC_SCSR", "PMC_PCER", "PMC_PCDR", "PMC_PCSR", "PMC_MOR", "PMC_MCFR", "PMC_PLLR", "PMC_MCKR", "PMC_PCKR", "PMC_IER", "PMC_IDR", "PMC_SR", "PMC_IMR" -group = "CKGR", "CKGR_MOR", "CKGR_MCFR", "CKGR_PLLR" -group = "RSTC", "RSTC_RCR", "RSTC_RSR", "RSTC_RMR" -group = "RTTC", "RTTC_RTMR", "RTTC_RTAR", "RTTC_RTVR", "RTTC_RTSR" -group = "PITC", "PITC_PIMR", "PITC_PISR", "PITC_PIVR", "PITC_PIIR" -group = "WDTC", "WDTC_WDCR", "WDTC_WDMR", "WDTC_WDSR" -group = "VREG", "VREG_MR" -group = "MC", "MC_RCR", "MC_ASR", "MC_AASR", "MC_FMR", "MC_FCR", "MC_FSR" diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.dep b/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.dep deleted file mode 100644 index ed687695d..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.dep +++ /dev/null @@ -1,3691 +0,0 @@ - - - - 2 - - Debug - - $PROJ_DIR$\Debug\Obj\Main.r79 - $PROJ_DIR$\Debug\Obj\IntrinsicsWrapper.r79 - $PROJ_DIR$\Debug\Obj\cmock_demo.pbd - $PROJ_DIR$\Debug\Obj\TimerInterruptConfigurator.r79 - $PROJ_DIR$\Debug\Obj\AdcConductor.r79 - $PROJ_DIR$\Debug\Obj\AdcModel.pbi - $PROJ_DIR$\Debug\Obj\Model.pbi - $PROJ_DIR$\Debug\Obj\AdcModel.r79 - $PROJ_DIR$\Debug\Obj\UsartModel.r79 - $PROJ_DIR$\Debug\Obj\TemperatureFilter.pbi - $PROJ_DIR$\Debug\List\AdcHardwareConfigurator.lst - $PROJ_DIR$\Debug\Obj\UsartConductor.pbi - $PROJ_DIR$\..\..\examples\src\Types.h - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h - $TOOLKIT_DIR$\inc\DLib_Defaults.h - $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h - $PROJ_DIR$\..\..\examples\src\AdcConductor.h - $PROJ_DIR$\Debug\List\TimerInterruptHandler.lst - $PROJ_DIR$\..\..\examples\src\TaskScheduler.h - $PROJ_DIR$\..\..\examples\src\UsartConductor.h - $PROJ_DIR$\..\..\examples\src\Model.h - $TOOLKIT_DIR$\inc\intrinsics.h - $PROJ_DIR$\Debug\Obj\UsartHardware.pbi - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h - $PROJ_DIR$\Debug\Exe\cmock_demo.d79 - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h - $PROJ_DIR$\..\..\examples\src\AdcHardware.h - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h - $PROJ_DIR$\..\..\examples\src\TimerConductor.h - $PROJ_DIR$\..\..\examples\src\UsartPutChar.h - $PROJ_DIR$\Debug\Obj\Executor.pbi - $PROJ_DIR$\..\..\examples\src\UsartModel.h - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h - $PROJ_DIR$\Debug\List\UsartBaudRateRegisterCalculator.lst - $PROJ_DIR$\..\..\examples\src\UsartHardware.h - $PROJ_DIR$\Debug\List\UsartModel.lst - $PROJ_DIR$\Debug\List\Executor.lst - $PROJ_DIR$\Debug\List\UsartTransmitBufferStatus.lst - $PROJ_DIR$\Debug\Exe\cmock_demo.sim - $PROJ_DIR$\Debug\List\TimerModel.lst - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h - $PROJ_DIR$\Debug\List\TimerHardware.lst - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h - $PROJ_DIR$\Debug\Obj\UsartTransmitBufferStatus.r79 - $PROJ_DIR$\..\..\examples\src\TimerModel.h - $PROJ_DIR$\Debug\List\IntrinsicsWrapper.lst - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h - $PROJ_DIR$\..\..\examples\src\TimerHardware.h - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h - $PROJ_DIR$\Debug\List\Cstartup_SAM7.lst - $TOOLKIT_DIR$\inc\DLib_Product.h - $PROJ_DIR$\Debug\Obj\UsartModel.pbi - $TOOLKIT_DIR$\inc\math.h - $PROJ_DIR$\Debug\Obj\AdcHardware.r79 - $PROJ_DIR$\Debug\Obj\TimerModel.r79 - $TOOLKIT_DIR$\inc\stdio.h - $PROJ_DIR$\Debug\Obj\UsartConfigurator.pbi - $PROJ_DIR$\Debug\List\AdcModel.lst - $PROJ_DIR$\Debug\List\AdcConductor.lst - $PROJ_DIR$\Debug\List\UsartConductor.lst - $PROJ_DIR$\Debug\List\Model.lst - $PROJ_DIR$\Debug\List\TaskScheduler.lst - $PROJ_DIR$\Debug\List\UsartHardware.lst - $PROJ_DIR$\Debug\List\AdcHardware.lst - $PROJ_DIR$\Debug\List\Main.lst - $PROJ_DIR$\Debug\Obj\UsartBaudRateRegisterCalculator.r79 - $PROJ_DIR$\Debug\Obj\AdcConductor.pbi - $PROJ_DIR$\Debug\Obj\TaskScheduler.pbi - $PROJ_DIR$\Debug\List\UsartConfigurator.lst - $PROJ_DIR$\Debug\Obj\TaskScheduler.r79 - $TOOLKIT_DIR$\inc\ymath.h - $PROJ_DIR$\Debug\Obj\TemperatureFilter.r79 - $TOOLKIT_DIR$\inc\ysizet.h - $PROJ_DIR$\Debug\Obj\TimerHardware.pbi - $PROJ_DIR$\Debug\Obj\TemperatureCalculator.r79 - $PROJ_DIR$\Debug\Obj\AdcTemperatureSensor.pbi - $PROJ_DIR$\Debug\List\TemperatureCalculator.lst - $PROJ_DIR$\Debug\List\AdcTemperatureSensor.lst - $TOOLKIT_DIR$\lib\dl4tptinl8n.h - $PROJ_DIR$\Debug\Obj\AdcHardware.pbi - $PROJ_DIR$\Debug\Obj\UsartConfigurator.r79 - $TOOLKIT_DIR$\inc\xencoding_limits.h - $PROJ_DIR$\Debug\Obj\TimerConfigurator.r79 - $PROJ_DIR$\Debug\Obj\AdcTemperatureSensor.r79 - $PROJ_DIR$\Debug\Obj\Main.pbi - $TOOLKIT_DIR$\lib\dl4tptinl8n.r79 - $PROJ_DIR$\Debug\Obj\TimerInterruptHandler.r79 - $PROJ_DIR$\Debug\Obj\UsartHardware.r79 - $PROJ_DIR$\Debug\Obj\UsartPutChar.pbi - $PROJ_DIR$\Debug\Obj\TimerInterruptConfigurator.pbi - $TOOLKIT_DIR$\inc\yvals.h - $PROJ_DIR$\Debug\Obj\UsartTransmitBufferStatus.pbi - $PROJ_DIR$\Debug\Obj\IntrinsicsWrapper.pbi - $PROJ_DIR$\Debug\Obj\AdcHardwareConfigurator.r79 - $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h - $TOOLKIT_DIR$\inc\DLib_Threads.h - $PROJ_DIR$\Debug\Obj\TimerConfigurator.pbi - $PROJ_DIR$\Debug\Obj\TimerConductor.pbi - $PROJ_DIR$\Debug\Obj\TimerInterruptHandler.pbi - $PROJ_DIR$\Debug\Obj\UsartPutChar.r79 - $PROJ_DIR$\Debug\Obj\UsartConductor.r79 - $PROJ_DIR$\Debug\Obj\TimerHardware.r79 - $PROJ_DIR$\Debug\Obj\Cstartup_SAM7.r79 - $PROJ_DIR$\Debug\List\cmock_demo.map - $PROJ_DIR$\Debug\List\TimerInterruptConfigurator.lst - $PROJ_DIR$\Debug\Obj\TimerConductor.r79 - $PROJ_DIR$\Debug\Obj\Model.r79 - $PROJ_DIR$\Debug\Obj\UsartBaudRateRegisterCalculator.pbi - $PROJ_DIR$\Debug\Obj\AdcHardwareConfigurator.pbi - $PROJ_DIR$\Debug\Obj\TemperatureCalculator.pbi - $PROJ_DIR$\Debug\Obj\Cstartup_SAM7.pbi - $PROJ_DIR$\Resource\at91SAM7X256_FLASH.xcl - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - $PROJ_DIR$\..\..\examples\src\TimerModel.c - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\..\examples\src\UsartModel.c - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - $PROJ_DIR$\Cstartup.s79 - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\Cstartup_SAM7.c - $PROJ_DIR$\..\..\examples\src\AdcModel.c - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\..\examples\src\Executor.c - $PROJ_DIR$\..\..\examples\src\Main.c - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - $PROJ_DIR$\..\..\examples\src\Model.c - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - $PROJ_DIR$\Debug\Obj\Cstartup.r79 - $PROJ_DIR$\Debug\List\TimerConfigurator.lst - $PROJ_DIR$\..\..\examples\src\Executor.h - $PROJ_DIR$\Debug\List\TimerConductor.lst - $PROJ_DIR$\..\..\examples\src\AdcModel.h - $PROJ_DIR$\..\..\examples\src\ModelConfig.h - $PROJ_DIR$\Debug\Obj\Executor.r79 - $PROJ_DIR$\Debug\List\UsartPutChar.lst - $PROJ_DIR$\Debug\List\TemperatureFilter.lst - $PROJ_DIR$\Debug\Obj\TimerModel.pbi - $PROJ_DIR$\srcIAR\Cstartup.s79 - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - [ROOT_NODE] - - - XLINK - 25 105 39 - - - - - $PROJ_DIR$\Debug\Obj\cmock_demo.pbd - - - BILINK - 68 81 110 5 77 112 31 94 86 6 69 111 9 99 98 75 91 100 150 109 11 58 22 53 90 93 - - - - - $PROJ_DIR$\Debug\Exe\cmock_demo.d79 - - - XLINK - 105 39 - - - - - XLINK - 113 4 55 95 7 85 141 104 147 1 0 108 71 76 73 107 84 103 3 88 56 67 102 82 89 8 101 45 87 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - - - ICCARM - 107 144 - - - BICOMP - 99 - - - - - ICCARM - 12 15 29 46 49 44 - - - BICOMP - 12 15 29 46 49 44 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - - - ICCARM - 84 142 - - - BICOMP - 98 - - - - - ICCARM - 12 15 48 42 - - - BICOMP - 12 15 48 42 - - - - - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - - - ICCARM - 103 43 - - - BICOMP - 75 - - - - - ICCARM - 12 15 49 48 - - - BICOMP - 12 15 49 48 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - - - ICCARM - 3 106 - - - BICOMP - 91 - - - - - ICCARM - 12 15 42 44 - - - BICOMP - 12 15 42 44 - - - - - $PROJ_DIR$\..\..\examples\src\TimerModel.c - - - ICCARM - 56 40 - - - BICOMP - 150 - - - - - ICCARM - 12 15 46 18 - - - BICOMP - 12 15 46 18 - - - - - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - - - ICCARM - 67 34 - - - BICOMP - 109 - - - - - ICCARM - 12 15 50 - - - BICOMP - 12 15 50 - - - - - $PROJ_DIR$\..\..\examples\src\UsartModel.c - - - ICCARM - 8 36 - - - BICOMP - 53 - - - - - ICCARM - 12 15 32 146 50 28 57 92 14 80 52 83 97 74 54 72 - - - BICOMP - 12 15 32 146 50 28 57 92 14 52 83 97 74 54 72 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - - - ICCARM - 102 61 - - - BICOMP - 11 - - - - - ICCARM - 12 15 19 35 32 18 - - - BICOMP - 12 15 19 35 32 18 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - - - ICCARM - 82 70 - - - BICOMP - 58 - - - - - ICCARM - 12 15 26 - - - BICOMP - 12 15 26 - - - - - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - - - ICCARM - 89 64 - - - BICOMP - 22 - - - - - ICCARM - 12 15 35 26 30 - - - BICOMP - 12 15 35 26 30 - - - - - $PROJ_DIR$\Cstartup.s79 - - - AARM - 141 - - - - - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - - - ICCARM - 101 148 - - - BICOMP - 90 - - - - - ICCARM - 12 15 30 41 - - - BICOMP - 12 15 30 41 - - - - - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - - - ICCARM - 45 38 - - - BICOMP - 93 - - - - - ICCARM - 12 15 41 - - - BICOMP - 12 15 41 - - - - - $PROJ_DIR$\Cstartup_SAM7.c - - - ICCARM - 104 51 - - - BICOMP - 112 - - - - - ICCARM - 15 - - - - - $PROJ_DIR$\..\..\examples\src\AdcModel.c - - - ICCARM - 7 59 - - - BICOMP - 5 - - - - - ICCARM - 12 15 145 18 23 28 - - - BICOMP - 12 15 145 18 23 28 - - - - - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - - - ICCARM - 85 79 - - - BICOMP - 77 - - - - - ICCARM - 12 15 24 - - - BICOMP - 12 15 24 - - - - - $PROJ_DIR$\..\..\examples\src\Executor.c - - - ICCARM - 147 37 - - - BICOMP - 31 - - - - - ICCARM - 12 15 143 20 19 29 16 33 - - - BICOMP - 12 15 143 20 19 29 16 33 - - - - - $PROJ_DIR$\..\..\examples\src\Main.c - - - ICCARM - 0 66 - - - BICOMP - 86 - - - - - ICCARM - 12 15 33 143 20 18 23 28 19 35 26 30 32 50 41 29 49 48 42 44 46 16 27 13 24 145 - - - BICOMP - 12 15 33 143 20 18 23 28 19 35 26 30 32 50 41 29 49 48 42 44 46 16 27 13 24 145 - - - - - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - - - ICCARM - 1 47 - - - BICOMP - 94 - - - - - ICCARM - 33 21 - - - BICOMP - 33 21 - - - - - $PROJ_DIR$\..\..\examples\src\Model.c - - - ICCARM - 108 62 - - - BICOMP - 6 - - - - - ICCARM - 20 12 15 18 28 - - - BICOMP - 20 12 15 18 28 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - - - ICCARM - 76 78 - - - BICOMP - 111 - - - - - ICCARM - 12 15 23 54 72 92 14 80 52 83 97 - - - BICOMP - 12 15 23 54 72 92 14 52 83 97 - - - - - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - - - ICCARM - 71 63 - - - BICOMP - 69 - - - - - ICCARM - 12 15 18 - - - BICOMP - 12 15 18 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - - - ICCARM - 88 17 - - - BICOMP - 100 - - - - - ICCARM - 12 15 44 42 - - - BICOMP - 12 15 44 42 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - - - ICCARM - 73 149 - - - BICOMP - 9 - - - - - ICCARM - 12 15 28 54 72 92 14 80 52 83 97 - - - BICOMP - 12 15 28 54 72 92 14 52 83 97 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - - - ICCARM - 95 10 - - - BICOMP - 110 - - - - - ICCARM - 12 15 13 146 - - - BICOMP - 12 15 13 146 - - - - - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - - - ICCARM - 4 60 - - - BICOMP - 68 - - - - - ICCARM - 12 15 16 145 27 - - - BICOMP - 12 15 16 145 27 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - - - ICCARM - 55 65 - - - BICOMP - 81 - - - - - ICCARM - 12 15 27 13 24 - - - BICOMP - 12 15 27 13 24 - - - - - $PROJ_DIR$\srcIAR\Cstartup.s79 - - - AARM - 141 - - - - - AARM - 96 - - - - - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - ICCARM - 104 51 - - - BICOMP - 112 - - - - - ICCARM - 15 - - - - - - Release - - $PROJ_DIR$\..\test\system\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\examples\src\Types.h - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h - $TOOLKIT_DIR$\inc\DLib_Defaults.h - $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h - $PROJ_DIR$\..\..\examples\src\AdcConductor.h - $PROJ_DIR$\..\..\examples\src\TaskScheduler.h - $PROJ_DIR$\..\..\examples\src\UsartConductor.h - $PROJ_DIR$\..\..\examples\src\Model.h - $TOOLKIT_DIR$\inc\intrinsics.h - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h - $PROJ_DIR$\..\..\examples\src\AdcHardware.h - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h - $PROJ_DIR$\..\..\examples\src\TimerConductor.h - $PROJ_DIR$\..\..\examples\src\UsartPutChar.h - $PROJ_DIR$\..\..\examples\src\UsartModel.h - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h - $PROJ_DIR$\..\..\examples\src\UsartHardware.h - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h - $PROJ_DIR$\..\..\examples\src\TimerModel.h - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h - $PROJ_DIR$\..\..\examples\src\TimerHardware.h - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h - $TOOLKIT_DIR$\inc\DLib_Product.h - $TOOLKIT_DIR$\inc\math.h - $TOOLKIT_DIR$\inc\stdio.h - $TOOLKIT_DIR$\inc\ymath.h - $TOOLKIT_DIR$\inc\ysizet.h - $TOOLKIT_DIR$\lib\dl4tptinl8n.h - $PROJ_DIR$\..\test\system\src\UsartPutChar.h - $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.h - $PROJ_DIR$\..\test\system\src\TaskScheduler.h - $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\..\test\system\src\UsartConfigurator.h - $PROJ_DIR$\..\test\system\src\TimerConfigurator.h - $PROJ_DIR$\..\test\system\src\AT91SAM7X256.h - $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.h - $PROJ_DIR$\..\test\system\src\Executor.h - $PROJ_DIR$\..\test\system\src\ModelConfig.h - $PROJ_DIR$\..\test\system\src\TimerModel.h - $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.h - $PROJ_DIR$\..\test\system\src\Main.c - $PROJ_DIR$\..\test\system\src\Model.c - $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\test\system\src\TimerModel.c - $PROJ_DIR$\..\test\system\src\UsartModel.c - $PROJ_DIR$\..\test\system\src\UsartHardware.c - $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\..\test\system\src\UsartPutChar.c - $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.c - $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\test\system\src\TaskScheduler.c - $PROJ_DIR$\..\test\system\src\AdcConductor.h - $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.h - $PROJ_DIR$\..\test\system\src\Model.h - $PROJ_DIR$\..\test\system\src\TemperatureFilter.h - $PROJ_DIR$\..\test\system\src\AdcModel.c - $PROJ_DIR$\..\test\system\src\TimerHardware.h - $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\test\system\src\AdcConductor.c - $PROJ_DIR$\..\test\system\src\AdcHardware.c - $PROJ_DIR$\..\test\system\src\AdcHardware.h - $PROJ_DIR$\..\test\system\src\Executor.c - $TOOLKIT_DIR$\inc\xencoding_limits.h - $TOOLKIT_DIR$\lib\dl4tptinl8n.r79 - $PROJ_DIR$\..\test\system\src\TemperatureCalculator.c - $PROJ_DIR$\..\test\system\src\Types.h - $PROJ_DIR$\..\test\system\src\TemperatureFilter.c - $PROJ_DIR$\..\test\system\src\TimerConductor.c - $PROJ_DIR$\..\test\system\src\TimerConfigurator.c - $PROJ_DIR$\..\test\system\src\TimerHardware.c - $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.c - $PROJ_DIR$\..\test\system\src\UsartConductor.c - $PROJ_DIR$\..\test\system\src\UsartConfigurator.c - $PROJ_DIR$\..\test\system\src\UsartHardware.h - $PROJ_DIR$\..\test\system\src\TimerConductor.h - $PROJ_DIR$\..\test\system\src\AdcModel.h - $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.h - $PROJ_DIR$\..\test\system\src\UsartConductor.h - $PROJ_DIR$\Release\Obj\Executor.pbi - $PROJ_DIR$\..\test\system\src\UsartModel.h - $PROJ_DIR$\Release\Obj\Model.pbi - $PROJ_DIR$\Release\Obj\Cstartup_SAM7.pbi - $PROJ_DIR$\Release\Obj\UsartConductor.pbi - $PROJ_DIR$\Release\Obj\AdcConductor.r79 - $PROJ_DIR$\Release\Obj\AdcHardware.r79 - $PROJ_DIR$\Release\Obj\TimerModel.pbi - $PROJ_DIR$\Release\Obj\AdcTemperatureSensor.pbi - $PROJ_DIR$\Release\Obj\UsartHardware.r79 - $PROJ_DIR$\Release\Obj\TemperatureFilter.pbi - $PROJ_DIR$\Release\Obj\UsartPutChar.pbi - $PROJ_DIR$\Release\Obj\TemperatureCalculator.r79 - $PROJ_DIR$\Release\Obj\AdcHardwareConfigurator.r79 - $PROJ_DIR$\Release\Obj\cmock_demo.pbd - $PROJ_DIR$\Release\Obj\UsartModel.r79 - $PROJ_DIR$\Release\Obj\UsartBaudRateRegisterCalculator.r79 - $PROJ_DIR$\Release\Obj\Model.r79 - $PROJ_DIR$\Release\Obj\AdcModel.r79 - $PROJ_DIR$\Release\Obj\AdcHardware.pbi - $PROJ_DIR$\Release\Obj\TimerModel.r79 - $PROJ_DIR$\Release\Obj\TimerHardware.r79 - $PROJ_DIR$\Release\Obj\UsartPutChar.r79 - $PROJ_DIR$\Release\Obj\AdcHardwareConfigurator.pbi - $PROJ_DIR$\Release\Obj\TimerInterruptConfigurator.r79 - $PROJ_DIR$\Release\Obj\TaskScheduler.pbi - $PROJ_DIR$\Release\List\cmock_demo.map - $PROJ_DIR$\Release\Obj\UsartTransmitBufferStatus.pbi - $PROJ_DIR$\Release\Exe\cmock_demo.d79 - $PROJ_DIR$\Release\Obj\AdcTemperatureSensor.r79 - $PROJ_DIR$\Release\Obj\TimerConductor.r79 - $PROJ_DIR$\Release\Obj\TimerConfigurator.r79 - $PROJ_DIR$\Release\Obj\Main.pbi - $PROJ_DIR$\Release\Obj\TimerInterruptConfigurator.pbi - $PROJ_DIR$\Release\Obj\UsartTransmitBufferStatus.r79 - $PROJ_DIR$\Release\Obj\AdcModel.pbi - $PROJ_DIR$\Release\Obj\TemperatureFilter.r79 - $PROJ_DIR$\Release\Obj\UsartHardware.pbi - $PROJ_DIR$\Release\Obj\Cstartup.r79 - $PROJ_DIR$\Release\Obj\UsartConductor.r79 - $PROJ_DIR$\Release\Obj\TimerInterruptHandler.pbi - $PROJ_DIR$\Release\Obj\TimerConductor.pbi - $PROJ_DIR$\Release\Obj\Main.r79 - $PROJ_DIR$\Release\Obj\UsartConfigurator.pbi - $PROJ_DIR$\Release\Obj\Executor.r79 - $PROJ_DIR$\Release\Obj\Cstartup_SAM7.r79 - $PROJ_DIR$\Release\Obj\TemperatureCalculator.pbi - $PROJ_DIR$\Release\Obj\TimerHardware.pbi - $PROJ_DIR$\Release\Exe\cmock_demo.sim - $PROJ_DIR$\Release\Obj\TimerConfigurator.pbi - $PROJ_DIR$\Release\Obj\UsartModel.pbi - $PROJ_DIR$\Release\Obj\TaskScheduler.r79 - $PROJ_DIR$\Release\Obj\UsartBaudRateRegisterCalculator.pbi - $PROJ_DIR$\Release\Obj\AdcConductor.pbi - $PROJ_DIR$\Release\Obj\TimerInterruptHandler.r79 - $PROJ_DIR$\Release\Obj\UsartConfigurator.r79 - $PROJ_DIR$\Release\Obj\IntrinsicsWrapper.pbi - $PROJ_DIR$\Release\Obj\IntrinsicsWrapper.r79 - $TOOLKIT_DIR$\inc\yvals.h - $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h - $TOOLKIT_DIR$\inc\DLib_Threads.h - $PROJ_DIR$\Resource\at91SAM7X256_FLASH.xcl - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - $PROJ_DIR$\..\..\examples\src\TimerModel.c - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\..\examples\src\UsartModel.c - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - $PROJ_DIR$\Cstartup.s79 - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\Cstartup_SAM7.c - $PROJ_DIR$\..\..\examples\src\AdcModel.c - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\..\examples\src\Executor.c - $PROJ_DIR$\..\..\examples\src\Main.c - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - $PROJ_DIR$\..\..\examples\src\Model.c - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - $PROJ_DIR$\..\..\examples\src\Executor.h - $PROJ_DIR$\..\..\examples\src\AdcModel.h - $PROJ_DIR$\..\..\examples\src\ModelConfig.h - $PROJ_DIR$\srcIAR\Cstartup.s79 - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - [ROOT_NODE] - - - XLINK - 111 109 131 - - - - - $PROJ_DIR$\..\test\system\src\Main.c - - - ICCARM - 125 - - - BICOMP - 115 - - - - - ICCARM - 70 39 41 58 35 0 59 82 78 37 33 84 40 36 79 61 38 57 44 43 56 65 81 34 80 - - - - - $PROJ_DIR$\..\test\system\src\Model.c - - - ICCARM - 100 - - - BICOMP - 85 - - - - - ICCARM - 58 70 39 35 59 - - - - - $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.c - - - ICCARM - 96 - - - BICOMP - 106 - - - - - ICCARM - 70 39 81 42 - - - - - $PROJ_DIR$\..\test\system\src\TimerModel.c - - - ICCARM - 103 - - - BICOMP - 90 - - - - - ICCARM - 70 39 43 35 - - - - - $PROJ_DIR$\..\test\system\src\UsartModel.c - - - ICCARM - 98 - - - BICOMP - 133 - - - - - ICCARM - 70 39 84 42 40 59 29 141 3 32 27 67 143 31 28 30 - - - - - $PROJ_DIR$\..\test\system\src\UsartHardware.c - - - ICCARM - 92 - - - BICOMP - 120 - - - - - ICCARM - 70 39 78 37 33 - - - - - $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.c - - - ICCARM - 117 - - - BICOMP - 110 - - - - - ICCARM - 70 39 36 - - - - - $PROJ_DIR$\..\test\system\src\UsartPutChar.c - - - ICCARM - 105 - - - BICOMP - 94 - - - - - ICCARM - 70 39 33 36 - - - - - $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.c - - - ICCARM - 107 - - - BICOMP - 116 - - - - - ICCARM - 70 39 57 44 - - - - - $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.c - - - ICCARM - 99 - - - BICOMP - 135 - - - - - ICCARM - 70 39 40 - - - - - $PROJ_DIR$\..\test\system\src\TaskScheduler.c - - - ICCARM - 134 - - - BICOMP - 108 - - - - - ICCARM - 70 39 35 - - - - - $PROJ_DIR$\..\test\system\src\AdcModel.c - - - ICCARM - 101 - - - BICOMP - 118 - - - - - ICCARM - 70 39 80 35 0 59 - - - - - $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.c - - - ICCARM - 112 - - - BICOMP - 91 - - - - - ICCARM - 70 39 34 - - - - - $PROJ_DIR$\..\test\system\src\AdcConductor.c - - - ICCARM - 88 - - - BICOMP - 136 - - - - - $PROJ_DIR$\..\test\system\src\AdcHardware.c - - - ICCARM - 89 - - - BICOMP - 102 - - - - - ICCARM - 70 39 65 81 34 - - - - - $PROJ_DIR$\..\test\system\src\Executor.c - - - ICCARM - 127 - - - BICOMP - 83 - - - - - ICCARM - 70 39 41 58 82 79 56 - - - - - $PROJ_DIR$\..\test\system\src\TemperatureCalculator.c - - - ICCARM - 95 - - - BICOMP - 129 - - - - - ICCARM - 70 39 0 28 30 141 3 32 27 67 143 - - - - - $PROJ_DIR$\..\test\system\src\TemperatureFilter.c - - - ICCARM - 119 - - - BICOMP - 93 - - - - - ICCARM - 70 39 59 28 30 141 3 32 27 67 143 - - - - - $PROJ_DIR$\..\test\system\src\TimerConductor.c - - - ICCARM - 113 - - - BICOMP - 124 - - - - - ICCARM - 70 39 79 43 61 44 - - - - - $PROJ_DIR$\..\test\system\src\TimerConfigurator.c - - - ICCARM - 114 - - - BICOMP - 132 - - - - - ICCARM - 70 39 38 57 - - - - - $PROJ_DIR$\..\test\system\src\TimerHardware.c - - - ICCARM - 104 - - - BICOMP - 130 - - - - - ICCARM - 70 39 61 38 - - - - - $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.c - - - ICCARM - 137 - - - BICOMP - 123 - - - - - ICCARM - 70 39 44 57 - - - - - $PROJ_DIR$\..\test\system\src\UsartConductor.c - - - ICCARM - 122 - - - BICOMP - 87 - - - - - ICCARM - 70 39 82 78 84 35 - - - - - $PROJ_DIR$\..\test\system\src\UsartConfigurator.c - - - ICCARM - 138 - - - BICOMP - 126 - - - - - ICCARM - 70 39 37 - - - - - $PROJ_DIR$\Release\Obj\cmock_demo.pbd - - - BILINK - 136 102 106 118 91 86 83 139 115 85 108 129 93 124 132 130 116 123 90 135 87 126 120 133 94 110 - - - - - $PROJ_DIR$\Release\Exe\cmock_demo.d79 - - - XLINK - 109 131 - - - - - XLINK - 144 88 89 96 101 112 121 128 127 140 125 100 134 95 119 113 114 104 107 137 103 99 122 138 92 98 105 117 68 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - - - ICCARM - 113 - - - BICOMP - 124 - - - - - ICCARM - 1 4 15 23 25 22 - - - BICOMP - 1 4 15 23 25 22 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - - - ICCARM - 114 - - - BICOMP - 132 - - - - - ICCARM - 1 4 24 21 - - - BICOMP - 1 4 24 21 - - - - - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - - - ICCARM - 104 - - - BICOMP - 130 - - - - - ICCARM - 1 4 25 24 - - - BICOMP - 1 4 25 24 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - - - ICCARM - 107 - - - BICOMP - 116 - - - - - ICCARM - 1 4 21 22 - - - BICOMP - 1 4 21 22 - - - - - $PROJ_DIR$\..\..\examples\src\TimerModel.c - - - ICCARM - 103 - - - BICOMP - 90 - - - - - ICCARM - 1 4 23 6 - - - BICOMP - 1 4 23 6 - - - - - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - - - ICCARM - 99 - - - BICOMP - 135 - - - - - ICCARM - 1 4 26 - - - BICOMP - 1 4 26 - - - - - $PROJ_DIR$\..\..\examples\src\UsartModel.c - - - ICCARM - 98 - - - BICOMP - 133 - - - - - ICCARM - 1 4 17 174 26 14 29 141 3 32 27 67 143 31 28 30 - - - BICOMP - 1 4 17 174 26 14 29 141 3 27 67 143 31 28 30 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - - - ICCARM - 122 - - - BICOMP - 87 - - - - - ICCARM - 1 4 7 19 17 6 - - - BICOMP - 1 4 7 19 17 6 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - - - ICCARM - 138 - - - BICOMP - 126 - - - - - ICCARM - 1 4 12 - - - BICOMP - 1 4 12 - - - - - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - - - ICCARM - 92 - - - BICOMP - 120 - - - - - ICCARM - 1 4 19 12 16 - - - BICOMP - 1 4 19 12 16 - - - - - $PROJ_DIR$\Cstartup.s79 - - - AARM - 121 - - - - - AARM - 142 - - - - - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - - - ICCARM - 105 - - - BICOMP - 94 - - - - - ICCARM - 1 4 16 20 - - - BICOMP - 1 4 16 20 - - - - - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - - - ICCARM - 117 - - - BICOMP - 110 - - - - - ICCARM - 1 4 20 - - - BICOMP - 1 4 20 - - - - - $PROJ_DIR$\Cstartup_SAM7.c - - - ICCARM - 128 - - - BICOMP - 86 - - - - - ICCARM - 4 - - - BICOMP - 4 - - - - - $PROJ_DIR$\..\..\examples\src\AdcModel.c - - - ICCARM - 101 - - - BICOMP - 118 - - - - - ICCARM - 1 4 173 6 10 14 - - - BICOMP - 1 4 173 6 10 14 - - - - - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - - - ICCARM - 112 - - - BICOMP - 91 - - - - - ICCARM - 1 4 11 - - - BICOMP - 1 4 11 - - - - - $PROJ_DIR$\..\..\examples\src\Executor.c - - - ICCARM - 127 - - - BICOMP - 83 - - - - - ICCARM - 1 4 172 8 7 15 5 18 - - - BICOMP - 1 4 172 8 7 15 5 18 - - - - - $PROJ_DIR$\..\..\examples\src\Main.c - - - ICCARM - 125 - - - BICOMP - 115 - - - - - ICCARM - 1 4 18 172 8 6 10 14 7 19 12 16 17 26 20 15 25 24 21 22 23 5 13 2 11 173 - - - BICOMP - 1 4 18 172 8 6 10 14 7 19 12 16 17 26 20 15 25 24 21 22 23 5 13 2 11 173 - - - - - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - - - ICCARM - 140 - - - BICOMP - 139 - - - - - ICCARM - 18 9 - - - BICOMP - 18 9 - - - - - $PROJ_DIR$\..\..\examples\src\Model.c - - - ICCARM - 100 - - - BICOMP - 85 - - - - - ICCARM - 8 1 4 6 14 - - - BICOMP - 8 1 4 6 14 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - - - ICCARM - 95 - - - BICOMP - 129 - - - - - ICCARM - 1 4 10 28 30 141 3 32 27 67 143 - - - BICOMP - 1 4 10 28 30 141 3 27 67 143 - - - - - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - - - ICCARM - 134 - - - BICOMP - 108 - - - - - ICCARM - 1 4 6 - - - BICOMP - 1 4 6 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - - - ICCARM - 137 - - - BICOMP - 123 - - - - - ICCARM - 1 4 22 21 - - - BICOMP - 1 4 22 21 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - - - ICCARM - 119 - - - BICOMP - 93 - - - - - ICCARM - 1 4 14 28 30 141 3 32 27 67 143 - - - BICOMP - 1 4 14 28 30 141 3 27 67 143 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - - - ICCARM - 96 - - - BICOMP - 106 - - - - - ICCARM - 1 4 2 174 - - - BICOMP - 1 4 2 174 - - - - - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - - - ICCARM - 88 - - - BICOMP - 136 - - - - - ICCARM - 1 4 5 173 13 - - - BICOMP - 1 4 5 173 13 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - - - ICCARM - 89 - - - BICOMP - 102 - - - - - ICCARM - 1 4 13 2 11 - - - BICOMP - 1 4 13 2 11 - - - - - $PROJ_DIR$\srcIAR\Cstartup.s79 - - - AARM - 121 - - - - - AARM - 142 - - - - - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - ICCARM - 128 - - - BICOMP - 86 - - - - - ICCARM - 4 - - - BICOMP - 4 - - - - - $PROJ_DIR$\..\test\system\src\Main.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\Model.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\TimerModel.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\UsartModel.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\UsartHardware.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\UsartPutChar.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\TaskScheduler.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\AdcModel.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\AdcConductor.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\AdcHardware.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\Executor.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\TemperatureCalculator.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\TemperatureFilter.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\TimerConductor.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\TimerConfigurator.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\TimerHardware.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\UsartConductor.c - ICCARM - - - $PROJ_DIR$\..\test\system\src\UsartConfigurator.c - ICCARM - - - - Simulate - - $PROJ_DIR$\..\test\system\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\examples\src\Types.h - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h - $TOOLKIT_DIR$\inc\DLib_Defaults.h - $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h - $PROJ_DIR$\..\..\examples\src\AdcConductor.h - $PROJ_DIR$\..\..\examples\src\TaskScheduler.h - $PROJ_DIR$\..\..\examples\src\UsartConductor.h - $PROJ_DIR$\..\..\examples\src\Model.h - $TOOLKIT_DIR$\inc\intrinsics.h - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h - $PROJ_DIR$\..\..\examples\src\AdcHardware.h - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h - $PROJ_DIR$\..\..\examples\src\TimerConductor.h - $PROJ_DIR$\..\..\examples\src\UsartPutChar.h - $PROJ_DIR$\..\..\examples\src\UsartModel.h - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h - $PROJ_DIR$\..\..\examples\src\UsartHardware.h - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h - $PROJ_DIR$\..\..\examples\src\TimerModel.h - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h - $PROJ_DIR$\..\..\examples\src\TimerHardware.h - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h - $TOOLKIT_DIR$\inc\DLib_Product.h - $TOOLKIT_DIR$\inc\math.h - $TOOLKIT_DIR$\inc\stdio.h - $TOOLKIT_DIR$\inc\ymath.h - $TOOLKIT_DIR$\inc\ysizet.h - $TOOLKIT_DIR$\lib\dl4tptinl8n.h - $PROJ_DIR$\..\test\system\src\UsartPutChar.h - $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.h - $PROJ_DIR$\Simulate\Obj\cmock_demo.pbd - $PROJ_DIR$\..\test\system\src\TaskScheduler.h - $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\..\test\system\src\UsartConfigurator.h - $PROJ_DIR$\..\test\system\src\TimerConfigurator.h - $PROJ_DIR$\..\test\system\src\AT91SAM7X256.h - $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.h - $PROJ_DIR$\..\test\system\src\Executor.h - $PROJ_DIR$\..\test\system\src\ModelConfig.h - $PROJ_DIR$\..\test\system\src\TimerModel.h - $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.h - $PROJ_DIR$\..\test\system\src\Main.c - $PROJ_DIR$\..\test\system\src\Model.c - $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\test\system\src\TimerModel.c - $PROJ_DIR$\..\test\system\src\UsartModel.c - $PROJ_DIR$\..\test\system\src\UsartHardware.c - $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\..\test\system\src\UsartPutChar.c - $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.c - $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\test\system\src\TaskScheduler.c - $PROJ_DIR$\..\test\system\src\AdcConductor.h - $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.h - $PROJ_DIR$\..\test\system\src\Model.h - $PROJ_DIR$\..\test\system\src\TemperatureFilter.h - $PROJ_DIR$\..\test\system\src\AdcModel.c - $PROJ_DIR$\..\test\system\src\TimerHardware.h - $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\test\system\src\AdcConductor.c - $PROJ_DIR$\..\test\system\src\AdcHardware.c - $PROJ_DIR$\..\test\system\src\AdcHardware.h - $PROJ_DIR$\..\test\system\src\Executor.c - $TOOLKIT_DIR$\inc\xencoding_limits.h - $TOOLKIT_DIR$\lib\dl4tptinl8n.r79 - $PROJ_DIR$\..\test\system\src\TemperatureCalculator.c - $PROJ_DIR$\..\test\system\src\Types.h - $PROJ_DIR$\..\test\system\src\TemperatureFilter.c - $PROJ_DIR$\..\test\system\src\TimerConductor.c - $PROJ_DIR$\..\test\system\src\TimerConfigurator.c - $PROJ_DIR$\..\test\system\src\TimerHardware.c - $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.c - $PROJ_DIR$\..\test\system\src\UsartConductor.c - $PROJ_DIR$\..\test\system\src\UsartConfigurator.c - $PROJ_DIR$\..\test\system\src\UsartHardware.h - $PROJ_DIR$\..\test\system\src\TimerConductor.h - $PROJ_DIR$\..\test\system\src\AdcModel.h - $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.h - $PROJ_DIR$\..\test\system\src\UsartConductor.h - $PROJ_DIR$\..\test\system\src\UsartModel.h - $PROJ_DIR$\Simulate\Obj\AdcConductor.r79 - $PROJ_DIR$\Simulate\Obj\Cstartup_SAM7.pbi - $PROJ_DIR$\Simulate\Obj\UsartHardware.r79 - $TOOLKIT_DIR$\inc\yvals.h - $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h - $PROJ_DIR$\Simulate\List\TimerModel.lst - $PROJ_DIR$\Simulate\Obj\Executor.r79 - $PROJ_DIR$\Simulate\Obj\TimerHardware.pbi - $PROJ_DIR$\Simulate\Obj\UsartModel.pbi - $PROJ_DIR$\Simulate\Obj\IntrinsicsWrapper.r79 - $PROJ_DIR$\Simulate\Obj\TimerConductor.pbi - $PROJ_DIR$\Simulate\List\UsartConductor.lst - $PROJ_DIR$\Simulate\Obj\Main.pbi - $TOOLKIT_DIR$\inc\DLib_Threads.h - $PROJ_DIR$\Simulate\Obj\AdcHardwareConfigurator.pbi - $PROJ_DIR$\Simulate\Obj\TimerConfigurator.pbi - $PROJ_DIR$\Simulate\Exe\cmock_demo.sim - $PROJ_DIR$\Simulate\Obj\UsartTransmitBufferStatus.pbi - $PROJ_DIR$\Simulate\Obj\AdcHardware.r79 - $PROJ_DIR$\Simulate\Obj\Main.r79 - $PROJ_DIR$\Simulate\Obj\AdcTemperatureSensor.pbi - $PROJ_DIR$\Simulate\Obj\UsartPutChar.r79 - $PROJ_DIR$\Simulate\Obj\AdcHardwareConfigurator.r79 - $PROJ_DIR$\Simulate\Obj\UsartConductor.r79 - $PROJ_DIR$\Simulate\Obj\TimerHardware.r79 - $PROJ_DIR$\Simulate\Obj\TemperatureFilter.r79 - $PROJ_DIR$\Simulate\Obj\TemperatureCalculator.pbi - $PROJ_DIR$\Simulate\Obj\TimerInterruptConfigurator.r79 - $PROJ_DIR$\Simulate\Obj\UsartTransmitBufferStatus.r79 - $PROJ_DIR$\Simulate\Obj\TimerConductor.r79 - $PROJ_DIR$\Simulate\Obj\Executor.pbi - $PROJ_DIR$\Simulate\Obj\UsartConductor.pbi - $PROJ_DIR$\Simulate\Obj\TimerModel.pbi - $PROJ_DIR$\Simulate\Obj\AdcModel.pbi - $PROJ_DIR$\Simulate\List\TaskScheduler.lst - $PROJ_DIR$\Simulate\Obj\TimerModel.r79 - $PROJ_DIR$\Simulate\Obj\TemperatureFilter.pbi - $PROJ_DIR$\Simulate\Obj\UsartBaudRateRegisterCalculator.pbi - $PROJ_DIR$\Simulate\Obj\UsartHardware.pbi - $PROJ_DIR$\Simulate\Obj\TaskScheduler.pbi - $PROJ_DIR$\Simulate\Obj\AdcConductor.pbi - $PROJ_DIR$\Simulate\Obj\TimerConfigurator.r79 - $PROJ_DIR$\Simulate\Obj\Cstartup.r79 - $PROJ_DIR$\Simulate\Obj\TimerInterruptHandler.pbi - $PROJ_DIR$\Simulate\Obj\AdcModel.r79 - $PROJ_DIR$\Simulate\Obj\IntrinsicsWrapper.pbi - $PROJ_DIR$\Simulate\List\cmock_demo.map - $PROJ_DIR$\Simulate\Obj\TimerInterruptConfigurator.pbi - $PROJ_DIR$\Simulate\Exe\cmock_demo.d79 - $PROJ_DIR$\Simulate\Obj\TaskScheduler.r79 - $PROJ_DIR$\Simulate\Obj\Model.r79 - $PROJ_DIR$\Simulate\Obj\UsartConfigurator.pbi - $PROJ_DIR$\Simulate\Obj\UsartModel.r79 - $PROJ_DIR$\Simulate\Obj\Cstartup_SAM7.r79 - $PROJ_DIR$\Simulate\Obj\TemperatureCalculator.r79 - $PROJ_DIR$\Simulate\Obj\UsartPutChar.pbi - $PROJ_DIR$\Simulate\Obj\UsartConfigurator.r79 - $PROJ_DIR$\Simulate\Obj\AdcHardware.pbi - $PROJ_DIR$\Simulate\Obj\AdcTemperatureSensor.r79 - $PROJ_DIR$\Simulate\Obj\Model.pbi - $PROJ_DIR$\Simulate\Obj\UsartBaudRateRegisterCalculator.r79 - $PROJ_DIR$\Simulate\List\UsartBaudRateRegisterCalculator.lst - $PROJ_DIR$\Simulate\List\UsartTransmitBufferStatus.lst - $PROJ_DIR$\Simulate\List\AdcHardware.lst - $PROJ_DIR$\Simulate\List\TimerInterruptConfigurator.lst - $PROJ_DIR$\Simulate\List\Model.lst - $PROJ_DIR$\Simulate\Obj\TimerInterruptHandler.r79 - $PROJ_DIR$\Simulate\List\UsartPutChar.lst - $PROJ_DIR$\Simulate\List\UsartHardware.lst - $PROJ_DIR$\Simulate\List\Executor.lst - $PROJ_DIR$\Simulate\List\TimerConfigurator.lst - $PROJ_DIR$\Simulate\List\AdcTemperatureSensor.lst - $PROJ_DIR$\Simulate\List\Cstartup_SAM7.lst - $PROJ_DIR$\Simulate\List\AdcHardwareConfigurator.lst - $PROJ_DIR$\Simulate\List\AdcModel.lst - $PROJ_DIR$\Simulate\List\TemperatureFilter.lst - $PROJ_DIR$\Simulate\List\AdcConductor.lst - $PROJ_DIR$\Simulate\List\UsartConfigurator.lst - $PROJ_DIR$\Simulate\List\IntrinsicsWrapper.lst - $PROJ_DIR$\Simulate\List\TimerHardware.lst - $PROJ_DIR$\Simulate\List\TemperatureCalculator.lst - $PROJ_DIR$\Simulate\List\TimerInterruptHandler.lst - $PROJ_DIR$\Simulate\List\UsartModel.lst - $PROJ_DIR$\Simulate\List\Main.lst - $PROJ_DIR$\Simulate\List\TimerConductor.lst - $PROJ_DIR$\Resource\at91SAM7X256_FLASH.xcl - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - $PROJ_DIR$\..\..\examples\src\TimerModel.c - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\..\examples\src\UsartModel.c - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - $PROJ_DIR$\Cstartup.s79 - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\Cstartup_SAM7.c - $PROJ_DIR$\..\..\examples\src\AdcModel.c - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\..\examples\src\Executor.c - $PROJ_DIR$\..\..\examples\src\Main.c - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - $PROJ_DIR$\..\..\examples\src\Model.c - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - $PROJ_DIR$\..\..\examples\src\Executor.h - $PROJ_DIR$\..\..\examples\src\AdcModel.h - $PROJ_DIR$\..\..\examples\src\ModelConfig.h - $PROJ_DIR$\srcIAR\Cstartup.s79 - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - [ROOT_NODE] - - - XLINK - 133 131 101 - - - - - $PROJ_DIR$\Simulate\Obj\cmock_demo.pbd - - - BILINK - 125 142 99 118 105 86 115 130 97 144 124 111 121 95 100 92 132 128 117 122 116 136 123 93 140 102 - - - - - $PROJ_DIR$\..\test\system\src\Main.c - - - ICCARM - 104 - - - BICOMP - 97 - - - - - ICCARM - 71 40 42 59 36 0 60 83 79 38 33 84 41 37 80 62 39 58 45 44 57 66 82 34 81 - - - BICOMP - 71 40 42 59 36 0 60 83 79 38 33 84 41 37 80 62 39 58 45 44 57 66 82 34 81 - - - - - $PROJ_DIR$\..\test\system\src\Model.c - - - ICCARM - 135 - - - BICOMP - 144 - - - - - ICCARM - 59 71 40 36 60 - - - BICOMP - 59 71 40 36 60 - - - - - $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.c - - - ICCARM - 107 - - - BICOMP - 99 - - - - - ICCARM - 71 40 82 43 - - - BICOMP - 71 40 82 43 - - - - - $PROJ_DIR$\..\test\system\src\TimerModel.c - - - ICCARM - 120 - - - BICOMP - 117 - - - - - ICCARM - 71 40 44 36 - - - BICOMP - 71 40 44 36 - - - - - $PROJ_DIR$\..\test\system\src\UsartModel.c - - - ICCARM - 137 - - - BICOMP - 93 - - - - - ICCARM - 71 40 84 43 41 60 29 88 3 32 27 68 98 31 28 30 - - - BICOMP - 71 40 84 43 41 60 29 88 3 27 68 98 31 28 30 - - - - - $PROJ_DIR$\..\test\system\src\UsartHardware.c - - - ICCARM - 87 - - - BICOMP - 123 - - - - - ICCARM - 71 40 79 38 33 - - - BICOMP - 71 40 79 38 33 - - - - - $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.c - - - ICCARM - 113 - - - BICOMP - 102 - - - - - ICCARM - 71 40 37 - - - BICOMP - 71 40 37 - - - - - $PROJ_DIR$\..\test\system\src\UsartPutChar.c - - - ICCARM - 106 - - - BICOMP - 140 - - - - - ICCARM - 71 40 33 37 29 88 3 32 27 68 98 31 - - - BICOMP - 71 40 33 37 29 88 3 27 68 98 31 - - - - - $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.c - - - ICCARM - 112 - - - BICOMP - 132 - - - - - ICCARM - 71 40 58 45 - - - BICOMP - 71 40 58 45 - - - - - $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.c - - - ICCARM - 145 - - - BICOMP - 122 - - - - - ICCARM - 71 40 41 - - - BICOMP - 71 40 41 - - - - - $PROJ_DIR$\..\test\system\src\TaskScheduler.c - - - ICCARM - 134 - - - BICOMP - 124 - - - - - ICCARM - 71 40 36 - - - BICOMP - 71 40 36 - - - - - $PROJ_DIR$\..\test\system\src\AdcModel.c - - - ICCARM - 129 - - - BICOMP - 118 - - - - - ICCARM - 71 40 81 36 0 60 - - - BICOMP - 71 40 81 36 0 60 - - - - - $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.c - - - ICCARM - 143 - - - BICOMP - 105 - - - - - ICCARM - 71 40 34 - - - BICOMP - 71 40 34 - - - - - $PROJ_DIR$\..\test\system\src\AdcConductor.c - - - ICCARM - 85 - - - BICOMP - 125 - - - - - ICCARM - 71 40 57 81 66 - - - BICOMP - 71 40 57 81 66 - - - - - $PROJ_DIR$\..\test\system\src\AdcHardware.c - - - ICCARM - 103 - - - BICOMP - 142 - - - - - ICCARM - 71 40 66 82 34 - - - BICOMP - 71 40 66 82 34 - - - - - $PROJ_DIR$\..\test\system\src\Executor.c - - - ICCARM - 91 - - - BICOMP - 115 - - - - - ICCARM - 71 40 42 59 83 80 57 - - - BICOMP - 71 40 42 59 83 80 57 - - - - - $PROJ_DIR$\..\test\system\src\TemperatureCalculator.c - - - ICCARM - 139 - - - BICOMP - 111 - - - - - ICCARM - 71 40 0 28 30 88 3 32 27 68 98 - - - BICOMP - 71 40 0 28 30 88 3 27 68 98 - - - - - $PROJ_DIR$\..\test\system\src\TemperatureFilter.c - - - ICCARM - 110 - - - BICOMP - 121 - - - - - ICCARM - 71 40 60 28 30 88 3 32 27 68 98 - - - BICOMP - 71 40 60 28 30 88 3 27 68 98 - - - - - $PROJ_DIR$\..\test\system\src\TimerConductor.c - - - ICCARM - 114 - - - BICOMP - 95 - - - - - ICCARM - 71 40 80 44 62 45 - - - BICOMP - 71 40 80 44 62 45 - - - - - $PROJ_DIR$\..\test\system\src\TimerConfigurator.c - - - ICCARM - 126 - - - BICOMP - 100 - - - - - ICCARM - 71 40 39 58 - - - BICOMP - 71 40 39 58 - - - - - $PROJ_DIR$\..\test\system\src\TimerHardware.c - - - ICCARM - 109 - - - BICOMP - 92 - - - - - ICCARM - 71 40 62 39 - - - BICOMP - 71 40 62 39 - - - - - $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.c - - - ICCARM - 151 - - - BICOMP - 128 - - - - - ICCARM - 71 40 45 58 - - - BICOMP - 71 40 45 58 - - - - - $PROJ_DIR$\..\test\system\src\UsartConductor.c - - - ICCARM - 108 - - - BICOMP - 116 - - - - - ICCARM - 71 40 83 79 84 36 - - - BICOMP - 71 40 83 79 84 36 - - - - - $PROJ_DIR$\..\test\system\src\UsartConfigurator.c - - - ICCARM - 141 - - - BICOMP - 136 - - - - - ICCARM - 71 40 38 - - - BICOMP - 71 40 38 - - - - - $PROJ_DIR$\Simulate\Exe\cmock_demo.d79 - - - XLINK - 131 101 - - - - - XLINK - 170 85 103 107 129 143 127 138 91 94 104 135 134 139 110 114 126 109 112 151 120 145 108 141 87 137 106 113 69 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - - - ICCARM - 114 169 - - - BICOMP - 95 - - - - - ICCARM - 1 4 15 23 25 22 - - - BICOMP - 1 4 15 23 25 22 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - - - ICCARM - 126 155 - - - BICOMP - 100 - - - - - ICCARM - 1 4 24 21 - - - BICOMP - 1 4 24 21 - - - - - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - - - ICCARM - 109 164 - - - BICOMP - 92 - - - - - ICCARM - 1 4 25 24 - - - BICOMP - 1 4 25 24 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - - - ICCARM - 112 149 - - - BICOMP - 132 - - - - - ICCARM - 1 4 21 22 - - - BICOMP - 1 4 21 22 - - - - - $PROJ_DIR$\..\..\examples\src\TimerModel.c - - - ICCARM - 120 90 - - - BICOMP - 117 - - - - - ICCARM - 1 4 23 6 - - - BICOMP - 1 4 23 6 - - - - - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - - - ICCARM - 145 146 - - - BICOMP - 122 - - - - - ICCARM - 1 4 26 - - - BICOMP - 1 4 26 - - - - - $PROJ_DIR$\..\..\examples\src\UsartModel.c - - - ICCARM - 137 167 - - - BICOMP - 93 - - - - - ICCARM - 1 4 17 200 26 14 29 88 3 32 27 68 98 31 28 30 - - - BICOMP - 1 4 17 200 26 14 29 88 3 27 68 98 31 28 30 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - - - ICCARM - 108 96 - - - BICOMP - 116 - - - - - ICCARM - 1 4 7 19 17 6 - - - BICOMP - 1 4 7 19 17 6 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - - - ICCARM - 141 162 - - - BICOMP - 136 - - - - - ICCARM - 1 4 12 - - - BICOMP - 1 4 12 - - - - - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - - - ICCARM - 87 153 - - - BICOMP - 123 - - - - - ICCARM - 1 4 19 12 16 - - - BICOMP - 1 4 19 12 16 - - - - - $PROJ_DIR$\Cstartup.s79 - - - AARM - 127 - - - - - AARM - 89 - - - - - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - - - ICCARM - 106 152 - - - BICOMP - 140 - - - - - ICCARM - 1 4 16 20 29 88 3 32 27 68 98 31 - - - BICOMP - 1 4 16 20 29 88 3 27 68 98 31 - - - - - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - - - ICCARM - 113 147 - - - BICOMP - 102 - - - - - ICCARM - 1 4 20 - - - BICOMP - 1 4 20 - - - - - $PROJ_DIR$\Cstartup_SAM7.c - - - ICCARM - 138 157 - - - BICOMP - 86 - - - - - ICCARM - 4 - - - BICOMP - 4 - - - - - $PROJ_DIR$\..\..\examples\src\AdcModel.c - - - ICCARM - 129 159 - - - BICOMP - 118 - - - - - ICCARM - 1 4 199 6 10 14 - - - BICOMP - 1 4 199 6 10 14 - - - - - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - - - ICCARM - 143 156 - - - BICOMP - 105 - - - - - ICCARM - 1 4 11 - - - BICOMP - 1 4 11 - - - - - $PROJ_DIR$\..\..\examples\src\Executor.c - - - ICCARM - 91 154 - - - BICOMP - 115 - - - - - ICCARM - 1 4 198 8 7 15 5 18 - - - BICOMP - 1 4 198 8 7 15 5 18 - - - - - $PROJ_DIR$\..\..\examples\src\Main.c - - - ICCARM - 104 168 - - - BICOMP - 97 - - - - - ICCARM - 1 4 18 198 8 6 10 14 7 19 12 16 17 26 20 15 25 24 21 22 23 5 13 2 11 199 - - - BICOMP - 1 4 18 198 8 6 10 14 7 19 12 16 17 26 20 15 25 24 21 22 23 5 13 2 11 199 - - - - - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - - - ICCARM - 94 163 - - - BICOMP - 130 - - - - - ICCARM - 18 9 - - - BICOMP - 18 9 - - - - - $PROJ_DIR$\..\..\examples\src\Model.c - - - ICCARM - 135 150 - - - BICOMP - 144 - - - - - ICCARM - 8 1 4 6 14 - - - BICOMP - 8 1 4 6 14 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - - - ICCARM - 139 165 - - - BICOMP - 111 - - - - - ICCARM - 1 4 10 28 30 88 3 32 27 68 98 - - - BICOMP - 1 4 10 28 30 88 3 27 68 98 - - - - - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - - - ICCARM - 134 119 - - - BICOMP - 124 - - - - - ICCARM - 1 4 6 - - - BICOMP - 1 4 6 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - - - ICCARM - 151 166 - - - BICOMP - 128 - - - - - ICCARM - 1 4 22 21 - - - BICOMP - 1 4 22 21 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - - - ICCARM - 110 160 - - - BICOMP - 121 - - - - - ICCARM - 1 4 14 28 30 88 3 32 27 68 98 - - - BICOMP - 1 4 14 28 30 88 3 27 68 98 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - - - ICCARM - 107 158 - - - BICOMP - 99 - - - - - ICCARM - 1 4 2 200 - - - BICOMP - 1 4 2 200 - - - - - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - - - ICCARM - 85 161 - - - BICOMP - 125 - - - - - ICCARM - 1 4 5 199 13 - - - BICOMP - 1 4 5 199 13 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - - - ICCARM - 103 148 - - - BICOMP - 142 - - - - - ICCARM - 1 4 13 2 11 - - - BICOMP - 1 4 13 2 11 - - - - - $PROJ_DIR$\srcIAR\Cstartup.s79 - - - AARM - 127 - - - - - AARM - 89 - - - - - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - ICCARM - 138 157 - - - BICOMP - 86 - - - - - ICCARM - 4 - - - BICOMP - 4 - - - - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewd b/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewd deleted file mode 100644 index 1632636e6..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewd +++ /dev/null @@ -1,1696 +0,0 @@ - - - - 1 - - Debug - - ARM - - 1 - - C-SPY - 2 - - 13 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - ARMSIM_ID - 2 - - 0 - 1 - 1 - - - - - ANGEL_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - - IARROM_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - JLINK_ID - 2 - - 6 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LMIFTDI_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - - MACRAIGOR_ID - 2 - - 2 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - RDI_ID - 2 - - 1 - 1 - 1 - - - - - - - - - - - - - - - - - THIRDPARTY_ID - 2 - - 0 - 1 - 1 - - - - - - - - - $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ewplugin - 1 - - - $EW_DIR$\common\plugins\Orti\Orti.ewplugin - 0 - - - $EW_DIR$\common\plugins\Profiling\Profiling.ewplugin - 1 - - - $EW_DIR$\common\plugins\Stack\Stack.ewplugin - 1 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CMXArmPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CMXTinyArmPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin - 0 - - - - - Simulate - - ARM - - 1 - - C-SPY - 2 - - 13 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - ARMSIM_ID - 2 - - 0 - 1 - 1 - - - - - ANGEL_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - - IARROM_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - JLINK_ID - 2 - - 6 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LMIFTDI_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - - MACRAIGOR_ID - 2 - - 2 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - RDI_ID - 2 - - 1 - 1 - 1 - - - - - - - - - - - - - - - - - THIRDPARTY_ID - 2 - - 0 - 1 - 1 - - - - - - - - - $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ewplugin - 1 - - - $EW_DIR$\common\plugins\Orti\Orti.ewplugin - 0 - - - $EW_DIR$\common\plugins\Profiling\Profiling.ewplugin - 1 - - - $EW_DIR$\common\plugins\Stack\Stack.ewplugin - 1 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CMXArmPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CMXTinyArmPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin - 0 - - - - - Release - - ARM - - 0 - - C-SPY - 2 - - 13 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - ARMSIM_ID - 2 - - 0 - 1 - 0 - - - - - ANGEL_ID - 2 - - 0 - 1 - 0 - - - - - - - - - - - - IARROM_ID - 2 - - 0 - 1 - 0 - - - - - - - - - - JLINK_ID - 2 - - 6 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LMIFTDI_ID - 2 - - 0 - 1 - 0 - - - - - - - - - - - - MACRAIGOR_ID - 2 - - 2 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - RDI_ID - 2 - - 1 - 1 - 0 - - - - - - - - - - - - - - - - - THIRDPARTY_ID - 2 - - 0 - 1 - 0 - - - - - - - - - $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ewplugin - 1 - - - $EW_DIR$\common\plugins\Orti\Orti.ewplugin - 0 - - - $EW_DIR$\common\plugins\Profiling\Profiling.ewplugin - 1 - - - $EW_DIR$\common\plugins\Stack\Stack.ewplugin - 1 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CMXArmPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CMXTinyArmPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin - 0 - - - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewp b/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewp deleted file mode 100644 index ec55fbe54..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewp +++ /dev/null @@ -1,2581 +0,0 @@ - - - - 1 - - Debug - - ARM - - 1 - - General - 2 - - 9 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 14 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 7 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CUSTOM - 3 - - - - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - XLINK - 2 - - 18 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - XAR - 2 - - 0 - 1 - 1 - - - - - - - BILINK - 0 - - - - - Simulate - - ARM - - 1 - - General - 2 - - 9 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 14 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 7 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CUSTOM - 3 - - - - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - XLINK - 2 - - 18 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - XAR - 2 - - 0 - 1 - 1 - - - - - - - BILINK - 0 - - - - - Release - - ARM - - 0 - - General - 2 - - 9 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 14 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 7 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CUSTOM - 3 - - - - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - XLINK - 2 - - 18 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - XAR - 2 - - 0 - 1 - 0 - - - - - - - BILINK - 0 - - - - - Resource - - $PROJ_DIR$\Resource\at91SAM7X256_FLASH.xcl - - - $PROJ_DIR$\Resource\at91SAM7X256_RAM.xcl - - - $PROJ_DIR$\Resource\SAM7_FLASH.mac - - - $PROJ_DIR$\Resource\SAM7_RAM.mac - - - $PROJ_DIR$\Resource\SAM7_SIM.mac - - - - Source - - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - - - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - - - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - - - $PROJ_DIR$\..\..\examples\src\AdcModel.c - - - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - - - $PROJ_DIR$\..\..\examples\src\Executor.c - - - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - - - $PROJ_DIR$\..\..\examples\src\Main.c - - - $PROJ_DIR$\..\..\examples\src\Model.c - - - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - - - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - - - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - - - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - - - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - - - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - - - $PROJ_DIR$\..\..\examples\src\TimerModel.c - - - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - - - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - - - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - - - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - - - $PROJ_DIR$\..\..\examples\src\UsartModel.c - - - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - - - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - - - - Startup - - $PROJ_DIR$\srcIAR\Cstartup.s79 - - - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.eww b/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.eww deleted file mode 100644 index dabdf551e..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.eww +++ /dev/null @@ -1,10 +0,0 @@ - - - - - $WS_DIR$\cmock_demo.ewp - - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X-EK.h b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X-EK.h deleted file mode 100644 index 98346759b..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X-EK.h +++ /dev/null @@ -1,61 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X-EK.h -// Object : AT91SAM7X-EK Evaluation Board Features Definition File -// -// ---------------------------------------------------------------------------- - -#ifndef AT91SAM7X_EK_H -#define AT91SAM7X_EK_H - -/*-----------------*/ -/* LEDs Definition */ -/*-----------------*/ -#define AT91B_LED1 (1<<19) // AT91C_PIO_PB19 AT91C_PB19_PWM0 AT91C_PB19_TCLK1 -#define AT91B_LED2 (1<<20) // AT91C_PIO_PB20 AT91C_PB20_PWM1 AT91C_PB20_PWM1 -#define AT91B_LED3 (AT91C_PIO_PB21) // AT91C_PIO_PB21 AT91C_PB21_PWM2 AT91C_PB21_PCK1 -#define AT91B_LED4 (AT91C_PIO_PB22) // AT91C_PIO_PB22 AT91C_PB22_PWM3 AT91C_PB22_PCK2 -#define AT91B_NB_LEB 4 -#define AT91B_LED_MASK (AT91B_LED1|AT91B_LED2|AT91B_LED3|AT91B_LED4) -#define AT91D_BASE_PIO_LED (AT91C_BASE_PIOB) - -#define AT91B_POWERLED (1<<25) // PB25 - - -/*-------------------------------*/ -/* JOYSTICK Position Definition */ -/*-------------------------------*/ -#define AT91B_SW1 (1<<21) // PA21 Up Button AT91C_PA21_TF AT91C_PA21_NPCS10 -#define AT91B_SW2 (1<<22) // PA22 Down Button AT91C_PA22_TK AT91C_PA22_SPCK1 -#define AT91B_SW3 (1<<23) // PA23 Left Button AT91C_PA23_TD AT91C_PA23_MOSI1 -#define AT91B_SW4 (1<<24) // PA24 Right Button AT91C_PA24_RD AT91C_PA24_MISO1 -#define AT91B_SW5 (1<<25) // PA25 Push Button AT91C_PA25_RK AT91C_PA25_NPCS11 -#define AT91B_SW_MASK (AT91B_SW1|AT91B_SW2|AT91B_SW3|AT91B_SW4|AT91B_SW5) - - -#define AT91D_BASE_PIO_SW (AT91C_BASE_PIOA) - -/*------------------*/ -/* CAN Definition */ -/*------------------*/ -#define AT91B_CAN_TRANSCEIVER_RS (1<<2) // PA2 - -/*--------------*/ -/* Clocks */ -/*--------------*/ -#define AT91B_MAIN_OSC 18432000 // Main Oscillator MAINCK -#define AT91B_MCK ((18432000*73/14)/2) // Output PLL Clock - -#endif /* AT91SAM7X-EK_H */ diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.inc b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.inc deleted file mode 100644 index da339852f..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.inc +++ /dev/null @@ -1,2314 +0,0 @@ -;- ---------------------------------------------------------------------------- -;- ATMEL Microcontroller Software Support - ROUSSET - -;- ---------------------------------------------------------------------------- -;- DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -;- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -;- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -;- DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h -;- Object : AT91SAM7X256 definitions -;- Generated : AT91 SW Application Group 11/02/2005 (15:17:24) -;- -;- CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// -;- CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// -;- CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// -;- CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// -;- CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// -;- CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// -;- CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// -;- CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// -;- CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// -;- CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// -;- CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// -;- CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// -;- CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// -;- CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// -;- CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// -;- CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// -;- CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// -;- CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// -;- CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// -;- CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// -;- CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// -;- CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// -;- CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// -;- ---------------------------------------------------------------------------- - -;- Hardware register definition - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR System Peripherals -;- ***************************************************************************** - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Advanced Interrupt Controller -;- ***************************************************************************** - ^ 0 ;- AT91S_AIC -AIC_SMR # 128 ;- Source Mode Register -AIC_SVR # 128 ;- Source Vector Register -AIC_IVR # 4 ;- IRQ Vector Register -AIC_FVR # 4 ;- FIQ Vector Register -AIC_ISR # 4 ;- Interrupt Status Register -AIC_IPR # 4 ;- Interrupt Pending Register -AIC_IMR # 4 ;- Interrupt Mask Register -AIC_CISR # 4 ;- Core Interrupt Status Register - # 8 ;- Reserved -AIC_IECR # 4 ;- Interrupt Enable Command Register -AIC_IDCR # 4 ;- Interrupt Disable Command Register -AIC_ICCR # 4 ;- Interrupt Clear Command Register -AIC_ISCR # 4 ;- Interrupt Set Command Register -AIC_EOICR # 4 ;- End of Interrupt Command Register -AIC_SPU # 4 ;- Spurious Vector Register -AIC_DCR # 4 ;- Debug Control Register (Protect) - # 4 ;- Reserved -AIC_FFER # 4 ;- Fast Forcing Enable Register -AIC_FFDR # 4 ;- Fast Forcing Disable Register -AIC_FFSR # 4 ;- Fast Forcing Status Register -;- -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- -AT91C_AIC_PRIOR EQU (0x7:SHL:0) ;- (AIC) Priority Level -AT91C_AIC_PRIOR_LOWEST EQU (0x0) ;- (AIC) Lowest priority level -AT91C_AIC_PRIOR_HIGHEST EQU (0x7) ;- (AIC) Highest priority level -AT91C_AIC_SRCTYPE EQU (0x3:SHL:5) ;- (AIC) Interrupt Source Type -AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL EQU (0x0:SHL:5) ;- (AIC) Internal Sources Code Label High-level Sensitive -AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL EQU (0x0:SHL:5) ;- (AIC) External Sources Code Label Low-level Sensitive -AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE EQU (0x1:SHL:5) ;- (AIC) Internal Sources Code Label Positive Edge triggered -AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE EQU (0x1:SHL:5) ;- (AIC) External Sources Code Label Negative Edge triggered -AT91C_AIC_SRCTYPE_HIGH_LEVEL EQU (0x2:SHL:5) ;- (AIC) Internal Or External Sources Code Label High-level Sensitive -AT91C_AIC_SRCTYPE_POSITIVE_EDGE EQU (0x3:SHL:5) ;- (AIC) Internal Or External Sources Code Label Positive Edge triggered -;- -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- -AT91C_AIC_NFIQ EQU (0x1:SHL:0) ;- (AIC) NFIQ Status -AT91C_AIC_NIRQ EQU (0x1:SHL:1) ;- (AIC) NIRQ Status -;- -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- -AT91C_AIC_DCR_PROT EQU (0x1:SHL:0) ;- (AIC) Protection Mode -AT91C_AIC_DCR_GMSK EQU (0x1:SHL:1) ;- (AIC) General Mask - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Peripheral DMA Controller -;- ***************************************************************************** - ^ 0 ;- AT91S_PDC -PDC_RPR # 4 ;- Receive Pointer Register -PDC_RCR # 4 ;- Receive Counter Register -PDC_TPR # 4 ;- Transmit Pointer Register -PDC_TCR # 4 ;- Transmit Counter Register -PDC_RNPR # 4 ;- Receive Next Pointer Register -PDC_RNCR # 4 ;- Receive Next Counter Register -PDC_TNPR # 4 ;- Transmit Next Pointer Register -PDC_TNCR # 4 ;- Transmit Next Counter Register -PDC_PTCR # 4 ;- PDC Transfer Control Register -PDC_PTSR # 4 ;- PDC Transfer Status Register -;- -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- -AT91C_PDC_RXTEN EQU (0x1:SHL:0) ;- (PDC) Receiver Transfer Enable -AT91C_PDC_RXTDIS EQU (0x1:SHL:1) ;- (PDC) Receiver Transfer Disable -AT91C_PDC_TXTEN EQU (0x1:SHL:8) ;- (PDC) Transmitter Transfer Enable -AT91C_PDC_TXTDIS EQU (0x1:SHL:9) ;- (PDC) Transmitter Transfer Disable -;- -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Debug Unit -;- ***************************************************************************** - ^ 0 ;- AT91S_DBGU -DBGU_CR # 4 ;- Control Register -DBGU_MR # 4 ;- Mode Register -DBGU_IER # 4 ;- Interrupt Enable Register -DBGU_IDR # 4 ;- Interrupt Disable Register -DBGU_IMR # 4 ;- Interrupt Mask Register -DBGU_CSR # 4 ;- Channel Status Register -DBGU_RHR # 4 ;- Receiver Holding Register -DBGU_THR # 4 ;- Transmitter Holding Register -DBGU_BRGR # 4 ;- Baud Rate Generator Register - # 28 ;- Reserved -DBGU_CIDR # 4 ;- Chip ID Register -DBGU_EXID # 4 ;- Chip ID Extension Register -DBGU_FNTR # 4 ;- Force NTRST Register - # 180 ;- Reserved -DBGU_RPR # 4 ;- Receive Pointer Register -DBGU_RCR # 4 ;- Receive Counter Register -DBGU_TPR # 4 ;- Transmit Pointer Register -DBGU_TCR # 4 ;- Transmit Counter Register -DBGU_RNPR # 4 ;- Receive Next Pointer Register -DBGU_RNCR # 4 ;- Receive Next Counter Register -DBGU_TNPR # 4 ;- Transmit Next Pointer Register -DBGU_TNCR # 4 ;- Transmit Next Counter Register -DBGU_PTCR # 4 ;- PDC Transfer Control Register -DBGU_PTSR # 4 ;- PDC Transfer Status Register -;- -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- -AT91C_US_RSTRX EQU (0x1:SHL:2) ;- (DBGU) Reset Receiver -AT91C_US_RSTTX EQU (0x1:SHL:3) ;- (DBGU) Reset Transmitter -AT91C_US_RXEN EQU (0x1:SHL:4) ;- (DBGU) Receiver Enable -AT91C_US_RXDIS EQU (0x1:SHL:5) ;- (DBGU) Receiver Disable -AT91C_US_TXEN EQU (0x1:SHL:6) ;- (DBGU) Transmitter Enable -AT91C_US_TXDIS EQU (0x1:SHL:7) ;- (DBGU) Transmitter Disable -AT91C_US_RSTSTA EQU (0x1:SHL:8) ;- (DBGU) Reset Status Bits -;- -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- -AT91C_US_PAR EQU (0x7:SHL:9) ;- (DBGU) Parity type -AT91C_US_PAR_EVEN EQU (0x0:SHL:9) ;- (DBGU) Even Parity -AT91C_US_PAR_ODD EQU (0x1:SHL:9) ;- (DBGU) Odd Parity -AT91C_US_PAR_SPACE EQU (0x2:SHL:9) ;- (DBGU) Parity forced to 0 (Space) -AT91C_US_PAR_MARK EQU (0x3:SHL:9) ;- (DBGU) Parity forced to 1 (Mark) -AT91C_US_PAR_NONE EQU (0x4:SHL:9) ;- (DBGU) No Parity -AT91C_US_PAR_MULTI_DROP EQU (0x6:SHL:9) ;- (DBGU) Multi-drop mode -AT91C_US_CHMODE EQU (0x3:SHL:14) ;- (DBGU) Channel Mode -AT91C_US_CHMODE_NORMAL EQU (0x0:SHL:14) ;- (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. -AT91C_US_CHMODE_AUTO EQU (0x1:SHL:14) ;- (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. -AT91C_US_CHMODE_LOCAL EQU (0x2:SHL:14) ;- (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. -AT91C_US_CHMODE_REMOTE EQU (0x3:SHL:14) ;- (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. -;- -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- -AT91C_US_RXRDY EQU (0x1:SHL:0) ;- (DBGU) RXRDY Interrupt -AT91C_US_TXRDY EQU (0x1:SHL:1) ;- (DBGU) TXRDY Interrupt -AT91C_US_ENDRX EQU (0x1:SHL:3) ;- (DBGU) End of Receive Transfer Interrupt -AT91C_US_ENDTX EQU (0x1:SHL:4) ;- (DBGU) End of Transmit Interrupt -AT91C_US_OVRE EQU (0x1:SHL:5) ;- (DBGU) Overrun Interrupt -AT91C_US_FRAME EQU (0x1:SHL:6) ;- (DBGU) Framing Error Interrupt -AT91C_US_PARE EQU (0x1:SHL:7) ;- (DBGU) Parity Error Interrupt -AT91C_US_TXEMPTY EQU (0x1:SHL:9) ;- (DBGU) TXEMPTY Interrupt -AT91C_US_TXBUFE EQU (0x1:SHL:11) ;- (DBGU) TXBUFE Interrupt -AT91C_US_RXBUFF EQU (0x1:SHL:12) ;- (DBGU) RXBUFF Interrupt -AT91C_US_COMM_TX EQU (0x1:SHL:30) ;- (DBGU) COMM_TX Interrupt -AT91C_US_COMM_RX EQU (0x1:SHL:31) ;- (DBGU) COMM_RX Interrupt -;- -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- -;- -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- -;- -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- -;- -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- -AT91C_US_FORCE_NTRST EQU (0x1:SHL:0) ;- (DBGU) Force NTRST in JTAG - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Parallel Input Output Controler -;- ***************************************************************************** - ^ 0 ;- AT91S_PIO -PIO_PER # 4 ;- PIO Enable Register -PIO_PDR # 4 ;- PIO Disable Register -PIO_PSR # 4 ;- PIO Status Register - # 4 ;- Reserved -PIO_OER # 4 ;- Output Enable Register -PIO_ODR # 4 ;- Output Disable Registerr -PIO_OSR # 4 ;- Output Status Register - # 4 ;- Reserved -PIO_IFER # 4 ;- Input Filter Enable Register -PIO_IFDR # 4 ;- Input Filter Disable Register -PIO_IFSR # 4 ;- Input Filter Status Register - # 4 ;- Reserved -PIO_SODR # 4 ;- Set Output Data Register -PIO_CODR # 4 ;- Clear Output Data Register -PIO_ODSR # 4 ;- Output Data Status Register -PIO_PDSR # 4 ;- Pin Data Status Register -PIO_IER # 4 ;- Interrupt Enable Register -PIO_IDR # 4 ;- Interrupt Disable Register -PIO_IMR # 4 ;- Interrupt Mask Register -PIO_ISR # 4 ;- Interrupt Status Register -PIO_MDER # 4 ;- Multi-driver Enable Register -PIO_MDDR # 4 ;- Multi-driver Disable Register -PIO_MDSR # 4 ;- Multi-driver Status Register - # 4 ;- Reserved -PIO_PPUDR # 4 ;- Pull-up Disable Register -PIO_PPUER # 4 ;- Pull-up Enable Register -PIO_PPUSR # 4 ;- Pull-up Status Register - # 4 ;- Reserved -PIO_ASR # 4 ;- Select A Register -PIO_BSR # 4 ;- Select B Register -PIO_ABSR # 4 ;- AB Select Status Register - # 36 ;- Reserved -PIO_OWER # 4 ;- Output Write Enable Register -PIO_OWDR # 4 ;- Output Write Disable Register -PIO_OWSR # 4 ;- Output Write Status Register - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Clock Generator Controler -;- ***************************************************************************** - ^ 0 ;- AT91S_CKGR -CKGR_MOR # 4 ;- Main Oscillator Register -CKGR_MCFR # 4 ;- Main Clock Frequency Register - # 4 ;- Reserved -CKGR_PLLR # 4 ;- PLL Register -;- -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- -AT91C_CKGR_MOSCEN EQU (0x1:SHL:0) ;- (CKGR) Main Oscillator Enable -AT91C_CKGR_OSCBYPASS EQU (0x1:SHL:1) ;- (CKGR) Main Oscillator Bypass -AT91C_CKGR_OSCOUNT EQU (0xFF:SHL:8) ;- (CKGR) Main Oscillator Start-up Time -;- -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- -AT91C_CKGR_MAINF EQU (0xFFFF:SHL:0) ;- (CKGR) Main Clock Frequency -AT91C_CKGR_MAINRDY EQU (0x1:SHL:16) ;- (CKGR) Main Clock Ready -;- -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- -AT91C_CKGR_DIV EQU (0xFF:SHL:0) ;- (CKGR) Divider Selected -AT91C_CKGR_DIV_0 EQU (0x0) ;- (CKGR) Divider output is 0 -AT91C_CKGR_DIV_BYPASS EQU (0x1) ;- (CKGR) Divider is bypassed -AT91C_CKGR_PLLCOUNT EQU (0x3F:SHL:8) ;- (CKGR) PLL Counter -AT91C_CKGR_OUT EQU (0x3:SHL:14) ;- (CKGR) PLL Output Frequency Range -AT91C_CKGR_OUT_0 EQU (0x0:SHL:14) ;- (CKGR) Please refer to the PLL datasheet -AT91C_CKGR_OUT_1 EQU (0x1:SHL:14) ;- (CKGR) Please refer to the PLL datasheet -AT91C_CKGR_OUT_2 EQU (0x2:SHL:14) ;- (CKGR) Please refer to the PLL datasheet -AT91C_CKGR_OUT_3 EQU (0x3:SHL:14) ;- (CKGR) Please refer to the PLL datasheet -AT91C_CKGR_MUL EQU (0x7FF:SHL:16) ;- (CKGR) PLL Multiplier -AT91C_CKGR_USBDIV EQU (0x3:SHL:28) ;- (CKGR) Divider for USB Clocks -AT91C_CKGR_USBDIV_0 EQU (0x0:SHL:28) ;- (CKGR) Divider output is PLL clock output -AT91C_CKGR_USBDIV_1 EQU (0x1:SHL:28) ;- (CKGR) Divider output is PLL clock output divided by 2 -AT91C_CKGR_USBDIV_2 EQU (0x2:SHL:28) ;- (CKGR) Divider output is PLL clock output divided by 4 - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Power Management Controler -;- ***************************************************************************** - ^ 0 ;- AT91S_PMC -PMC_SCER # 4 ;- System Clock Enable Register -PMC_SCDR # 4 ;- System Clock Disable Register -PMC_SCSR # 4 ;- System Clock Status Register - # 4 ;- Reserved -PMC_PCER # 4 ;- Peripheral Clock Enable Register -PMC_PCDR # 4 ;- Peripheral Clock Disable Register -PMC_PCSR # 4 ;- Peripheral Clock Status Register - # 4 ;- Reserved -PMC_MOR # 4 ;- Main Oscillator Register -PMC_MCFR # 4 ;- Main Clock Frequency Register - # 4 ;- Reserved -PMC_PLLR # 4 ;- PLL Register -PMC_MCKR # 4 ;- Master Clock Register - # 12 ;- Reserved -PMC_PCKR # 16 ;- Programmable Clock Register - # 16 ;- Reserved -PMC_IER # 4 ;- Interrupt Enable Register -PMC_IDR # 4 ;- Interrupt Disable Register -PMC_SR # 4 ;- Status Register -PMC_IMR # 4 ;- Interrupt Mask Register -;- -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- -AT91C_PMC_PCK EQU (0x1:SHL:0) ;- (PMC) Processor Clock -AT91C_PMC_UDP EQU (0x1:SHL:7) ;- (PMC) USB Device Port Clock -AT91C_PMC_PCK0 EQU (0x1:SHL:8) ;- (PMC) Programmable Clock Output -AT91C_PMC_PCK1 EQU (0x1:SHL:9) ;- (PMC) Programmable Clock Output -AT91C_PMC_PCK2 EQU (0x1:SHL:10) ;- (PMC) Programmable Clock Output -AT91C_PMC_PCK3 EQU (0x1:SHL:11) ;- (PMC) Programmable Clock Output -;- -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- -;- -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- -;- -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- -;- -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- -;- -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- -;- -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- -AT91C_PMC_CSS EQU (0x3:SHL:0) ;- (PMC) Programmable Clock Selection -AT91C_PMC_CSS_SLOW_CLK EQU (0x0) ;- (PMC) Slow Clock is selected -AT91C_PMC_CSS_MAIN_CLK EQU (0x1) ;- (PMC) Main Clock is selected -AT91C_PMC_CSS_PLL_CLK EQU (0x3) ;- (PMC) Clock from PLL is selected -AT91C_PMC_PRES EQU (0x7:SHL:2) ;- (PMC) Programmable Clock Prescaler -AT91C_PMC_PRES_CLK EQU (0x0:SHL:2) ;- (PMC) Selected clock -AT91C_PMC_PRES_CLK_2 EQU (0x1:SHL:2) ;- (PMC) Selected clock divided by 2 -AT91C_PMC_PRES_CLK_4 EQU (0x2:SHL:2) ;- (PMC) Selected clock divided by 4 -AT91C_PMC_PRES_CLK_8 EQU (0x3:SHL:2) ;- (PMC) Selected clock divided by 8 -AT91C_PMC_PRES_CLK_16 EQU (0x4:SHL:2) ;- (PMC) Selected clock divided by 16 -AT91C_PMC_PRES_CLK_32 EQU (0x5:SHL:2) ;- (PMC) Selected clock divided by 32 -AT91C_PMC_PRES_CLK_64 EQU (0x6:SHL:2) ;- (PMC) Selected clock divided by 64 -;- -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- -;- -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- -AT91C_PMC_MOSCS EQU (0x1:SHL:0) ;- (PMC) MOSC Status/Enable/Disable/Mask -AT91C_PMC_LOCK EQU (0x1:SHL:2) ;- (PMC) PLL Status/Enable/Disable/Mask -AT91C_PMC_MCKRDY EQU (0x1:SHL:3) ;- (PMC) MCK_RDY Status/Enable/Disable/Mask -AT91C_PMC_PCK0RDY EQU (0x1:SHL:8) ;- (PMC) PCK0_RDY Status/Enable/Disable/Mask -AT91C_PMC_PCK1RDY EQU (0x1:SHL:9) ;- (PMC) PCK1_RDY Status/Enable/Disable/Mask -AT91C_PMC_PCK2RDY EQU (0x1:SHL:10) ;- (PMC) PCK2_RDY Status/Enable/Disable/Mask -AT91C_PMC_PCK3RDY EQU (0x1:SHL:11) ;- (PMC) PCK3_RDY Status/Enable/Disable/Mask -;- -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- -;- -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- -;- -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Reset Controller Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_RSTC -RSTC_RCR # 4 ;- Reset Control Register -RSTC_RSR # 4 ;- Reset Status Register -RSTC_RMR # 4 ;- Reset Mode Register -;- -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- -AT91C_RSTC_PROCRST EQU (0x1:SHL:0) ;- (RSTC) Processor Reset -AT91C_RSTC_PERRST EQU (0x1:SHL:2) ;- (RSTC) Peripheral Reset -AT91C_RSTC_EXTRST EQU (0x1:SHL:3) ;- (RSTC) External Reset -AT91C_RSTC_KEY EQU (0xFF:SHL:24) ;- (RSTC) Password -;- -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- -AT91C_RSTC_URSTS EQU (0x1:SHL:0) ;- (RSTC) User Reset Status -AT91C_RSTC_BODSTS EQU (0x1:SHL:1) ;- (RSTC) Brownout Detection Status -AT91C_RSTC_RSTTYP EQU (0x7:SHL:8) ;- (RSTC) Reset Type -AT91C_RSTC_RSTTYP_POWERUP EQU (0x0:SHL:8) ;- (RSTC) Power-up Reset. VDDCORE rising. -AT91C_RSTC_RSTTYP_WAKEUP EQU (0x1:SHL:8) ;- (RSTC) WakeUp Reset. VDDCORE rising. -AT91C_RSTC_RSTTYP_WATCHDOG EQU (0x2:SHL:8) ;- (RSTC) Watchdog Reset. Watchdog overflow occured. -AT91C_RSTC_RSTTYP_SOFTWARE EQU (0x3:SHL:8) ;- (RSTC) Software Reset. Processor reset required by the software. -AT91C_RSTC_RSTTYP_USER EQU (0x4:SHL:8) ;- (RSTC) User Reset. NRST pin detected low. -AT91C_RSTC_RSTTYP_BROWNOUT EQU (0x5:SHL:8) ;- (RSTC) Brownout Reset occured. -AT91C_RSTC_NRSTL EQU (0x1:SHL:16) ;- (RSTC) NRST pin level -AT91C_RSTC_SRCMP EQU (0x1:SHL:17) ;- (RSTC) Software Reset Command in Progress. -;- -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- -AT91C_RSTC_URSTEN EQU (0x1:SHL:0) ;- (RSTC) User Reset Enable -AT91C_RSTC_URSTIEN EQU (0x1:SHL:4) ;- (RSTC) User Reset Interrupt Enable -AT91C_RSTC_ERSTL EQU (0xF:SHL:8) ;- (RSTC) User Reset Length -AT91C_RSTC_BODIEN EQU (0x1:SHL:16) ;- (RSTC) Brownout Detection Interrupt Enable - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_RTTC -RTTC_RTMR # 4 ;- Real-time Mode Register -RTTC_RTAR # 4 ;- Real-time Alarm Register -RTTC_RTVR # 4 ;- Real-time Value Register -RTTC_RTSR # 4 ;- Real-time Status Register -;- -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- -AT91C_RTTC_RTPRES EQU (0xFFFF:SHL:0) ;- (RTTC) Real-time Timer Prescaler Value -AT91C_RTTC_ALMIEN EQU (0x1:SHL:16) ;- (RTTC) Alarm Interrupt Enable -AT91C_RTTC_RTTINCIEN EQU (0x1:SHL:17) ;- (RTTC) Real Time Timer Increment Interrupt Enable -AT91C_RTTC_RTTRST EQU (0x1:SHL:18) ;- (RTTC) Real Time Timer Restart -;- -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- -AT91C_RTTC_ALMV EQU (0x0:SHL:0) ;- (RTTC) Alarm Value -;- -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- -AT91C_RTTC_CRTV EQU (0x0:SHL:0) ;- (RTTC) Current Real-time Value -;- -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- -AT91C_RTTC_ALMS EQU (0x1:SHL:0) ;- (RTTC) Real-time Alarm Status -AT91C_RTTC_RTTINC EQU (0x1:SHL:1) ;- (RTTC) Real-time Timer Increment - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_PITC -PITC_PIMR # 4 ;- Period Interval Mode Register -PITC_PISR # 4 ;- Period Interval Status Register -PITC_PIVR # 4 ;- Period Interval Value Register -PITC_PIIR # 4 ;- Period Interval Image Register -;- -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- -AT91C_PITC_PIV EQU (0xFFFFF:SHL:0) ;- (PITC) Periodic Interval Value -AT91C_PITC_PITEN EQU (0x1:SHL:24) ;- (PITC) Periodic Interval Timer Enabled -AT91C_PITC_PITIEN EQU (0x1:SHL:25) ;- (PITC) Periodic Interval Timer Interrupt Enable -;- -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- -AT91C_PITC_PITS EQU (0x1:SHL:0) ;- (PITC) Periodic Interval Timer Status -;- -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- -AT91C_PITC_CPIV EQU (0xFFFFF:SHL:0) ;- (PITC) Current Periodic Interval Value -AT91C_PITC_PICNT EQU (0xFFF:SHL:20) ;- (PITC) Periodic Interval Counter -;- -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_WDTC -WDTC_WDCR # 4 ;- Watchdog Control Register -WDTC_WDMR # 4 ;- Watchdog Mode Register -WDTC_WDSR # 4 ;- Watchdog Status Register -;- -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- -AT91C_WDTC_WDRSTT EQU (0x1:SHL:0) ;- (WDTC) Watchdog Restart -AT91C_WDTC_KEY EQU (0xFF:SHL:24) ;- (WDTC) Watchdog KEY Password -;- -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- -AT91C_WDTC_WDV EQU (0xFFF:SHL:0) ;- (WDTC) Watchdog Timer Restart -AT91C_WDTC_WDFIEN EQU (0x1:SHL:12) ;- (WDTC) Watchdog Fault Interrupt Enable -AT91C_WDTC_WDRSTEN EQU (0x1:SHL:13) ;- (WDTC) Watchdog Reset Enable -AT91C_WDTC_WDRPROC EQU (0x1:SHL:14) ;- (WDTC) Watchdog Timer Restart -AT91C_WDTC_WDDIS EQU (0x1:SHL:15) ;- (WDTC) Watchdog Disable -AT91C_WDTC_WDD EQU (0xFFF:SHL:16) ;- (WDTC) Watchdog Delta Value -AT91C_WDTC_WDDBGHLT EQU (0x1:SHL:28) ;- (WDTC) Watchdog Debug Halt -AT91C_WDTC_WDIDLEHLT EQU (0x1:SHL:29) ;- (WDTC) Watchdog Idle Halt -;- -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- -AT91C_WDTC_WDUNF EQU (0x1:SHL:0) ;- (WDTC) Watchdog Underflow -AT91C_WDTC_WDERR EQU (0x1:SHL:1) ;- (WDTC) Watchdog Error - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_VREG -VREG_MR # 4 ;- Voltage Regulator Mode Register -;- -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- -AT91C_VREG_PSTDBY EQU (0x1:SHL:0) ;- (VREG) Voltage Regulator Power Standby Mode - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Memory Controller Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_MC -MC_RCR # 4 ;- MC Remap Control Register -MC_ASR # 4 ;- MC Abort Status Register -MC_AASR # 4 ;- MC Abort Address Status Register - # 84 ;- Reserved -MC_FMR # 4 ;- MC Flash Mode Register -MC_FCR # 4 ;- MC Flash Command Register -MC_FSR # 4 ;- MC Flash Status Register -;- -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- -AT91C_MC_RCB EQU (0x1:SHL:0) ;- (MC) Remap Command Bit -;- -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- -AT91C_MC_UNDADD EQU (0x1:SHL:0) ;- (MC) Undefined Addess Abort Status -AT91C_MC_MISADD EQU (0x1:SHL:1) ;- (MC) Misaligned Addess Abort Status -AT91C_MC_ABTSZ EQU (0x3:SHL:8) ;- (MC) Abort Size Status -AT91C_MC_ABTSZ_BYTE EQU (0x0:SHL:8) ;- (MC) Byte -AT91C_MC_ABTSZ_HWORD EQU (0x1:SHL:8) ;- (MC) Half-word -AT91C_MC_ABTSZ_WORD EQU (0x2:SHL:8) ;- (MC) Word -AT91C_MC_ABTTYP EQU (0x3:SHL:10) ;- (MC) Abort Type Status -AT91C_MC_ABTTYP_DATAR EQU (0x0:SHL:10) ;- (MC) Data Read -AT91C_MC_ABTTYP_DATAW EQU (0x1:SHL:10) ;- (MC) Data Write -AT91C_MC_ABTTYP_FETCH EQU (0x2:SHL:10) ;- (MC) Code Fetch -AT91C_MC_MST0 EQU (0x1:SHL:16) ;- (MC) Master 0 Abort Source -AT91C_MC_MST1 EQU (0x1:SHL:17) ;- (MC) Master 1 Abort Source -AT91C_MC_SVMST0 EQU (0x1:SHL:24) ;- (MC) Saved Master 0 Abort Source -AT91C_MC_SVMST1 EQU (0x1:SHL:25) ;- (MC) Saved Master 1 Abort Source -;- -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- -AT91C_MC_FRDY EQU (0x1:SHL:0) ;- (MC) Flash Ready -AT91C_MC_LOCKE EQU (0x1:SHL:2) ;- (MC) Lock Error -AT91C_MC_PROGE EQU (0x1:SHL:3) ;- (MC) Programming Error -AT91C_MC_NEBP EQU (0x1:SHL:7) ;- (MC) No Erase Before Programming -AT91C_MC_FWS EQU (0x3:SHL:8) ;- (MC) Flash Wait State -AT91C_MC_FWS_0FWS EQU (0x0:SHL:8) ;- (MC) 1 cycle for Read, 2 for Write operations -AT91C_MC_FWS_1FWS EQU (0x1:SHL:8) ;- (MC) 2 cycles for Read, 3 for Write operations -AT91C_MC_FWS_2FWS EQU (0x2:SHL:8) ;- (MC) 3 cycles for Read, 4 for Write operations -AT91C_MC_FWS_3FWS EQU (0x3:SHL:8) ;- (MC) 4 cycles for Read, 4 for Write operations -AT91C_MC_FMCN EQU (0xFF:SHL:16) ;- (MC) Flash Microsecond Cycle Number -;- -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- -AT91C_MC_FCMD EQU (0xF:SHL:0) ;- (MC) Flash Command -AT91C_MC_FCMD_START_PROG EQU (0x1) ;- (MC) Starts the programming of th epage specified by PAGEN. -AT91C_MC_FCMD_LOCK EQU (0x2) ;- (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -AT91C_MC_FCMD_PROG_AND_LOCK EQU (0x3) ;- (MC) The lock sequence automatically happens after the programming sequence is completed. -AT91C_MC_FCMD_UNLOCK EQU (0x4) ;- (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -AT91C_MC_FCMD_ERASE_ALL EQU (0x8) ;- (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. -AT91C_MC_FCMD_SET_GP_NVM EQU (0xB) ;- (MC) Set General Purpose NVM bits. -AT91C_MC_FCMD_CLR_GP_NVM EQU (0xD) ;- (MC) Clear General Purpose NVM bits. -AT91C_MC_FCMD_SET_SECURITY EQU (0xF) ;- (MC) Set Security Bit. -AT91C_MC_PAGEN EQU (0x3FF:SHL:8) ;- (MC) Page Number -AT91C_MC_KEY EQU (0xFF:SHL:24) ;- (MC) Writing Protect Key -;- -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- -AT91C_MC_SECURITY EQU (0x1:SHL:4) ;- (MC) Security Bit Status -AT91C_MC_GPNVM0 EQU (0x1:SHL:8) ;- (MC) Sector 0 Lock Status -AT91C_MC_GPNVM1 EQU (0x1:SHL:9) ;- (MC) Sector 1 Lock Status -AT91C_MC_GPNVM2 EQU (0x1:SHL:10) ;- (MC) Sector 2 Lock Status -AT91C_MC_GPNVM3 EQU (0x1:SHL:11) ;- (MC) Sector 3 Lock Status -AT91C_MC_GPNVM4 EQU (0x1:SHL:12) ;- (MC) Sector 4 Lock Status -AT91C_MC_GPNVM5 EQU (0x1:SHL:13) ;- (MC) Sector 5 Lock Status -AT91C_MC_GPNVM6 EQU (0x1:SHL:14) ;- (MC) Sector 6 Lock Status -AT91C_MC_GPNVM7 EQU (0x1:SHL:15) ;- (MC) Sector 7 Lock Status -AT91C_MC_LOCKS0 EQU (0x1:SHL:16) ;- (MC) Sector 0 Lock Status -AT91C_MC_LOCKS1 EQU (0x1:SHL:17) ;- (MC) Sector 1 Lock Status -AT91C_MC_LOCKS2 EQU (0x1:SHL:18) ;- (MC) Sector 2 Lock Status -AT91C_MC_LOCKS3 EQU (0x1:SHL:19) ;- (MC) Sector 3 Lock Status -AT91C_MC_LOCKS4 EQU (0x1:SHL:20) ;- (MC) Sector 4 Lock Status -AT91C_MC_LOCKS5 EQU (0x1:SHL:21) ;- (MC) Sector 5 Lock Status -AT91C_MC_LOCKS6 EQU (0x1:SHL:22) ;- (MC) Sector 6 Lock Status -AT91C_MC_LOCKS7 EQU (0x1:SHL:23) ;- (MC) Sector 7 Lock Status -AT91C_MC_LOCKS8 EQU (0x1:SHL:24) ;- (MC) Sector 8 Lock Status -AT91C_MC_LOCKS9 EQU (0x1:SHL:25) ;- (MC) Sector 9 Lock Status -AT91C_MC_LOCKS10 EQU (0x1:SHL:26) ;- (MC) Sector 10 Lock Status -AT91C_MC_LOCKS11 EQU (0x1:SHL:27) ;- (MC) Sector 11 Lock Status -AT91C_MC_LOCKS12 EQU (0x1:SHL:28) ;- (MC) Sector 12 Lock Status -AT91C_MC_LOCKS13 EQU (0x1:SHL:29) ;- (MC) Sector 13 Lock Status -AT91C_MC_LOCKS14 EQU (0x1:SHL:30) ;- (MC) Sector 14 Lock Status -AT91C_MC_LOCKS15 EQU (0x1:SHL:31) ;- (MC) Sector 15 Lock Status - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Serial Parallel Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_SPI -SPI_CR # 4 ;- Control Register -SPI_MR # 4 ;- Mode Register -SPI_RDR # 4 ;- Receive Data Register -SPI_TDR # 4 ;- Transmit Data Register -SPI_SR # 4 ;- Status Register -SPI_IER # 4 ;- Interrupt Enable Register -SPI_IDR # 4 ;- Interrupt Disable Register -SPI_IMR # 4 ;- Interrupt Mask Register - # 16 ;- Reserved -SPI_CSR # 16 ;- Chip Select Register - # 192 ;- Reserved -SPI_RPR # 4 ;- Receive Pointer Register -SPI_RCR # 4 ;- Receive Counter Register -SPI_TPR # 4 ;- Transmit Pointer Register -SPI_TCR # 4 ;- Transmit Counter Register -SPI_RNPR # 4 ;- Receive Next Pointer Register -SPI_RNCR # 4 ;- Receive Next Counter Register -SPI_TNPR # 4 ;- Transmit Next Pointer Register -SPI_TNCR # 4 ;- Transmit Next Counter Register -SPI_PTCR # 4 ;- PDC Transfer Control Register -SPI_PTSR # 4 ;- PDC Transfer Status Register -;- -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- -AT91C_SPI_SPIEN EQU (0x1:SHL:0) ;- (SPI) SPI Enable -AT91C_SPI_SPIDIS EQU (0x1:SHL:1) ;- (SPI) SPI Disable -AT91C_SPI_SWRST EQU (0x1:SHL:7) ;- (SPI) SPI Software reset -AT91C_SPI_LASTXFER EQU (0x1:SHL:24) ;- (SPI) SPI Last Transfer -;- -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- -AT91C_SPI_MSTR EQU (0x1:SHL:0) ;- (SPI) Master/Slave Mode -AT91C_SPI_PS EQU (0x1:SHL:1) ;- (SPI) Peripheral Select -AT91C_SPI_PS_FIXED EQU (0x0:SHL:1) ;- (SPI) Fixed Peripheral Select -AT91C_SPI_PS_VARIABLE EQU (0x1:SHL:1) ;- (SPI) Variable Peripheral Select -AT91C_SPI_PCSDEC EQU (0x1:SHL:2) ;- (SPI) Chip Select Decode -AT91C_SPI_FDIV EQU (0x1:SHL:3) ;- (SPI) Clock Selection -AT91C_SPI_MODFDIS EQU (0x1:SHL:4) ;- (SPI) Mode Fault Detection -AT91C_SPI_LLB EQU (0x1:SHL:7) ;- (SPI) Clock Selection -AT91C_SPI_PCS EQU (0xF:SHL:16) ;- (SPI) Peripheral Chip Select -AT91C_SPI_DLYBCS EQU (0xFF:SHL:24) ;- (SPI) Delay Between Chip Selects -;- -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- -AT91C_SPI_RD EQU (0xFFFF:SHL:0) ;- (SPI) Receive Data -AT91C_SPI_RPCS EQU (0xF:SHL:16) ;- (SPI) Peripheral Chip Select Status -;- -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- -AT91C_SPI_TD EQU (0xFFFF:SHL:0) ;- (SPI) Transmit Data -AT91C_SPI_TPCS EQU (0xF:SHL:16) ;- (SPI) Peripheral Chip Select Status -;- -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- -AT91C_SPI_RDRF EQU (0x1:SHL:0) ;- (SPI) Receive Data Register Full -AT91C_SPI_TDRE EQU (0x1:SHL:1) ;- (SPI) Transmit Data Register Empty -AT91C_SPI_MODF EQU (0x1:SHL:2) ;- (SPI) Mode Fault Error -AT91C_SPI_OVRES EQU (0x1:SHL:3) ;- (SPI) Overrun Error Status -AT91C_SPI_ENDRX EQU (0x1:SHL:4) ;- (SPI) End of Receiver Transfer -AT91C_SPI_ENDTX EQU (0x1:SHL:5) ;- (SPI) End of Receiver Transfer -AT91C_SPI_RXBUFF EQU (0x1:SHL:6) ;- (SPI) RXBUFF Interrupt -AT91C_SPI_TXBUFE EQU (0x1:SHL:7) ;- (SPI) TXBUFE Interrupt -AT91C_SPI_NSSR EQU (0x1:SHL:8) ;- (SPI) NSSR Interrupt -AT91C_SPI_TXEMPTY EQU (0x1:SHL:9) ;- (SPI) TXEMPTY Interrupt -AT91C_SPI_SPIENS EQU (0x1:SHL:16) ;- (SPI) Enable Status -;- -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- -;- -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- -;- -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- -;- -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- -AT91C_SPI_CPOL EQU (0x1:SHL:0) ;- (SPI) Clock Polarity -AT91C_SPI_NCPHA EQU (0x1:SHL:1) ;- (SPI) Clock Phase -AT91C_SPI_CSAAT EQU (0x1:SHL:3) ;- (SPI) Chip Select Active After Transfer -AT91C_SPI_BITS EQU (0xF:SHL:4) ;- (SPI) Bits Per Transfer -AT91C_SPI_BITS_8 EQU (0x0:SHL:4) ;- (SPI) 8 Bits Per transfer -AT91C_SPI_BITS_9 EQU (0x1:SHL:4) ;- (SPI) 9 Bits Per transfer -AT91C_SPI_BITS_10 EQU (0x2:SHL:4) ;- (SPI) 10 Bits Per transfer -AT91C_SPI_BITS_11 EQU (0x3:SHL:4) ;- (SPI) 11 Bits Per transfer -AT91C_SPI_BITS_12 EQU (0x4:SHL:4) ;- (SPI) 12 Bits Per transfer -AT91C_SPI_BITS_13 EQU (0x5:SHL:4) ;- (SPI) 13 Bits Per transfer -AT91C_SPI_BITS_14 EQU (0x6:SHL:4) ;- (SPI) 14 Bits Per transfer -AT91C_SPI_BITS_15 EQU (0x7:SHL:4) ;- (SPI) 15 Bits Per transfer -AT91C_SPI_BITS_16 EQU (0x8:SHL:4) ;- (SPI) 16 Bits Per transfer -AT91C_SPI_SCBR EQU (0xFF:SHL:8) ;- (SPI) Serial Clock Baud Rate -AT91C_SPI_DLYBS EQU (0xFF:SHL:16) ;- (SPI) Delay Before SPCK -AT91C_SPI_DLYBCT EQU (0xFF:SHL:24) ;- (SPI) Delay Between Consecutive Transfers - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Usart -;- ***************************************************************************** - ^ 0 ;- AT91S_USART -US_CR # 4 ;- Control Register -US_MR # 4 ;- Mode Register -US_IER # 4 ;- Interrupt Enable Register -US_IDR # 4 ;- Interrupt Disable Register -US_IMR # 4 ;- Interrupt Mask Register -US_CSR # 4 ;- Channel Status Register -US_RHR # 4 ;- Receiver Holding Register -US_THR # 4 ;- Transmitter Holding Register -US_BRGR # 4 ;- Baud Rate Generator Register -US_RTOR # 4 ;- Receiver Time-out Register -US_TTGR # 4 ;- Transmitter Time-guard Register - # 20 ;- Reserved -US_FIDI # 4 ;- FI_DI_Ratio Register -US_NER # 4 ;- Nb Errors Register - # 4 ;- Reserved -US_IF # 4 ;- IRDA_FILTER Register - # 176 ;- Reserved -US_RPR # 4 ;- Receive Pointer Register -US_RCR # 4 ;- Receive Counter Register -US_TPR # 4 ;- Transmit Pointer Register -US_TCR # 4 ;- Transmit Counter Register -US_RNPR # 4 ;- Receive Next Pointer Register -US_RNCR # 4 ;- Receive Next Counter Register -US_TNPR # 4 ;- Transmit Next Pointer Register -US_TNCR # 4 ;- Transmit Next Counter Register -US_PTCR # 4 ;- PDC Transfer Control Register -US_PTSR # 4 ;- PDC Transfer Status Register -;- -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- -AT91C_US_STTBRK EQU (0x1:SHL:9) ;- (USART) Start Break -AT91C_US_STPBRK EQU (0x1:SHL:10) ;- (USART) Stop Break -AT91C_US_STTTO EQU (0x1:SHL:11) ;- (USART) Start Time-out -AT91C_US_SENDA EQU (0x1:SHL:12) ;- (USART) Send Address -AT91C_US_RSTIT EQU (0x1:SHL:13) ;- (USART) Reset Iterations -AT91C_US_RSTNACK EQU (0x1:SHL:14) ;- (USART) Reset Non Acknowledge -AT91C_US_RETTO EQU (0x1:SHL:15) ;- (USART) Rearm Time-out -AT91C_US_DTREN EQU (0x1:SHL:16) ;- (USART) Data Terminal ready Enable -AT91C_US_DTRDIS EQU (0x1:SHL:17) ;- (USART) Data Terminal ready Disable -AT91C_US_RTSEN EQU (0x1:SHL:18) ;- (USART) Request to Send enable -AT91C_US_RTSDIS EQU (0x1:SHL:19) ;- (USART) Request to Send Disable -;- -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- -AT91C_US_USMODE EQU (0xF:SHL:0) ;- (USART) Usart mode -AT91C_US_USMODE_NORMAL EQU (0x0) ;- (USART) Normal -AT91C_US_USMODE_RS485 EQU (0x1) ;- (USART) RS485 -AT91C_US_USMODE_HWHSH EQU (0x2) ;- (USART) Hardware Handshaking -AT91C_US_USMODE_MODEM EQU (0x3) ;- (USART) Modem -AT91C_US_USMODE_ISO7816_0 EQU (0x4) ;- (USART) ISO7816 protocol: T = 0 -AT91C_US_USMODE_ISO7816_1 EQU (0x6) ;- (USART) ISO7816 protocol: T = 1 -AT91C_US_USMODE_IRDA EQU (0x8) ;- (USART) IrDA -AT91C_US_USMODE_SWHSH EQU (0xC) ;- (USART) Software Handshaking -AT91C_US_CLKS EQU (0x3:SHL:4) ;- (USART) Clock Selection (Baud Rate generator Input Clock -AT91C_US_CLKS_CLOCK EQU (0x0:SHL:4) ;- (USART) Clock -AT91C_US_CLKS_FDIV1 EQU (0x1:SHL:4) ;- (USART) fdiv1 -AT91C_US_CLKS_SLOW EQU (0x2:SHL:4) ;- (USART) slow_clock (ARM) -AT91C_US_CLKS_EXT EQU (0x3:SHL:4) ;- (USART) External (SCK) -AT91C_US_CHRL EQU (0x3:SHL:6) ;- (USART) Clock Selection (Baud Rate generator Input Clock -AT91C_US_CHRL_5_BITS EQU (0x0:SHL:6) ;- (USART) Character Length: 5 bits -AT91C_US_CHRL_6_BITS EQU (0x1:SHL:6) ;- (USART) Character Length: 6 bits -AT91C_US_CHRL_7_BITS EQU (0x2:SHL:6) ;- (USART) Character Length: 7 bits -AT91C_US_CHRL_8_BITS EQU (0x3:SHL:6) ;- (USART) Character Length: 8 bits -AT91C_US_SYNC EQU (0x1:SHL:8) ;- (USART) Synchronous Mode Select -AT91C_US_NBSTOP EQU (0x3:SHL:12) ;- (USART) Number of Stop bits -AT91C_US_NBSTOP_1_BIT EQU (0x0:SHL:12) ;- (USART) 1 stop bit -AT91C_US_NBSTOP_15_BIT EQU (0x1:SHL:12) ;- (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits -AT91C_US_NBSTOP_2_BIT EQU (0x2:SHL:12) ;- (USART) 2 stop bits -AT91C_US_MSBF EQU (0x1:SHL:16) ;- (USART) Bit Order -AT91C_US_MODE9 EQU (0x1:SHL:17) ;- (USART) 9-bit Character length -AT91C_US_CKLO EQU (0x1:SHL:18) ;- (USART) Clock Output Select -AT91C_US_OVER EQU (0x1:SHL:19) ;- (USART) Over Sampling Mode -AT91C_US_INACK EQU (0x1:SHL:20) ;- (USART) Inhibit Non Acknowledge -AT91C_US_DSNACK EQU (0x1:SHL:21) ;- (USART) Disable Successive NACK -AT91C_US_MAX_ITER EQU (0x1:SHL:24) ;- (USART) Number of Repetitions -AT91C_US_FILTER EQU (0x1:SHL:28) ;- (USART) Receive Line Filter -;- -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- -AT91C_US_RXBRK EQU (0x1:SHL:2) ;- (USART) Break Received/End of Break -AT91C_US_TIMEOUT EQU (0x1:SHL:8) ;- (USART) Receiver Time-out -AT91C_US_ITERATION EQU (0x1:SHL:10) ;- (USART) Max number of Repetitions Reached -AT91C_US_NACK EQU (0x1:SHL:13) ;- (USART) Non Acknowledge -AT91C_US_RIIC EQU (0x1:SHL:16) ;- (USART) Ring INdicator Input Change Flag -AT91C_US_DSRIC EQU (0x1:SHL:17) ;- (USART) Data Set Ready Input Change Flag -AT91C_US_DCDIC EQU (0x1:SHL:18) ;- (USART) Data Carrier Flag -AT91C_US_CTSIC EQU (0x1:SHL:19) ;- (USART) Clear To Send Input Change Flag -;- -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- -;- -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- -;- -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- -AT91C_US_RI EQU (0x1:SHL:20) ;- (USART) Image of RI Input -AT91C_US_DSR EQU (0x1:SHL:21) ;- (USART) Image of DSR Input -AT91C_US_DCD EQU (0x1:SHL:22) ;- (USART) Image of DCD Input -AT91C_US_CTS EQU (0x1:SHL:23) ;- (USART) Image of CTS Input - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_SSC -SSC_CR # 4 ;- Control Register -SSC_CMR # 4 ;- Clock Mode Register - # 8 ;- Reserved -SSC_RCMR # 4 ;- Receive Clock ModeRegister -SSC_RFMR # 4 ;- Receive Frame Mode Register -SSC_TCMR # 4 ;- Transmit Clock Mode Register -SSC_TFMR # 4 ;- Transmit Frame Mode Register -SSC_RHR # 4 ;- Receive Holding Register -SSC_THR # 4 ;- Transmit Holding Register - # 8 ;- Reserved -SSC_RSHR # 4 ;- Receive Sync Holding Register -SSC_TSHR # 4 ;- Transmit Sync Holding Register - # 8 ;- Reserved -SSC_SR # 4 ;- Status Register -SSC_IER # 4 ;- Interrupt Enable Register -SSC_IDR # 4 ;- Interrupt Disable Register -SSC_IMR # 4 ;- Interrupt Mask Register - # 176 ;- Reserved -SSC_RPR # 4 ;- Receive Pointer Register -SSC_RCR # 4 ;- Receive Counter Register -SSC_TPR # 4 ;- Transmit Pointer Register -SSC_TCR # 4 ;- Transmit Counter Register -SSC_RNPR # 4 ;- Receive Next Pointer Register -SSC_RNCR # 4 ;- Receive Next Counter Register -SSC_TNPR # 4 ;- Transmit Next Pointer Register -SSC_TNCR # 4 ;- Transmit Next Counter Register -SSC_PTCR # 4 ;- PDC Transfer Control Register -SSC_PTSR # 4 ;- PDC Transfer Status Register -;- -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- -AT91C_SSC_RXEN EQU (0x1:SHL:0) ;- (SSC) Receive Enable -AT91C_SSC_RXDIS EQU (0x1:SHL:1) ;- (SSC) Receive Disable -AT91C_SSC_TXEN EQU (0x1:SHL:8) ;- (SSC) Transmit Enable -AT91C_SSC_TXDIS EQU (0x1:SHL:9) ;- (SSC) Transmit Disable -AT91C_SSC_SWRST EQU (0x1:SHL:15) ;- (SSC) Software Reset -;- -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- -AT91C_SSC_CKS EQU (0x3:SHL:0) ;- (SSC) Receive/Transmit Clock Selection -AT91C_SSC_CKS_DIV EQU (0x0) ;- (SSC) Divided Clock -AT91C_SSC_CKS_TK EQU (0x1) ;- (SSC) TK Clock signal -AT91C_SSC_CKS_RK EQU (0x2) ;- (SSC) RK pin -AT91C_SSC_CKO EQU (0x7:SHL:2) ;- (SSC) Receive/Transmit Clock Output Mode Selection -AT91C_SSC_CKO_NONE EQU (0x0:SHL:2) ;- (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only -AT91C_SSC_CKO_CONTINOUS EQU (0x1:SHL:2) ;- (SSC) Continuous Receive/Transmit Clock RK pin: Output -AT91C_SSC_CKO_DATA_TX EQU (0x2:SHL:2) ;- (SSC) Receive/Transmit Clock only during data transfers RK pin: Output -AT91C_SSC_CKI EQU (0x1:SHL:5) ;- (SSC) Receive/Transmit Clock Inversion -AT91C_SSC_CKG EQU (0x3:SHL:6) ;- (SSC) Receive/Transmit Clock Gating Selection -AT91C_SSC_CKG_NONE EQU (0x0:SHL:6) ;- (SSC) Receive/Transmit Clock Gating: None, continuous clock -AT91C_SSC_CKG_LOW EQU (0x1:SHL:6) ;- (SSC) Receive/Transmit Clock enabled only if RF Low -AT91C_SSC_CKG_HIGH EQU (0x2:SHL:6) ;- (SSC) Receive/Transmit Clock enabled only if RF High -AT91C_SSC_START EQU (0xF:SHL:8) ;- (SSC) Receive/Transmit Start Selection -AT91C_SSC_START_CONTINOUS EQU (0x0:SHL:8) ;- (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. -AT91C_SSC_START_TX EQU (0x1:SHL:8) ;- (SSC) Transmit/Receive start -AT91C_SSC_START_LOW_RF EQU (0x2:SHL:8) ;- (SSC) Detection of a low level on RF input -AT91C_SSC_START_HIGH_RF EQU (0x3:SHL:8) ;- (SSC) Detection of a high level on RF input -AT91C_SSC_START_FALL_RF EQU (0x4:SHL:8) ;- (SSC) Detection of a falling edge on RF input -AT91C_SSC_START_RISE_RF EQU (0x5:SHL:8) ;- (SSC) Detection of a rising edge on RF input -AT91C_SSC_START_LEVEL_RF EQU (0x6:SHL:8) ;- (SSC) Detection of any level change on RF input -AT91C_SSC_START_EDGE_RF EQU (0x7:SHL:8) ;- (SSC) Detection of any edge on RF input -AT91C_SSC_START_0 EQU (0x8:SHL:8) ;- (SSC) Compare 0 -AT91C_SSC_STOP EQU (0x1:SHL:12) ;- (SSC) Receive Stop Selection -AT91C_SSC_STTDLY EQU (0xFF:SHL:16) ;- (SSC) Receive/Transmit Start Delay -AT91C_SSC_PERIOD EQU (0xFF:SHL:24) ;- (SSC) Receive/Transmit Period Divider Selection -;- -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- -AT91C_SSC_DATLEN EQU (0x1F:SHL:0) ;- (SSC) Data Length -AT91C_SSC_LOOP EQU (0x1:SHL:5) ;- (SSC) Loop Mode -AT91C_SSC_MSBF EQU (0x1:SHL:7) ;- (SSC) Most Significant Bit First -AT91C_SSC_DATNB EQU (0xF:SHL:8) ;- (SSC) Data Number per Frame -AT91C_SSC_FSLEN EQU (0xF:SHL:16) ;- (SSC) Receive/Transmit Frame Sync length -AT91C_SSC_FSOS EQU (0x7:SHL:20) ;- (SSC) Receive/Transmit Frame Sync Output Selection -AT91C_SSC_FSOS_NONE EQU (0x0:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only -AT91C_SSC_FSOS_NEGATIVE EQU (0x1:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse -AT91C_SSC_FSOS_POSITIVE EQU (0x2:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse -AT91C_SSC_FSOS_LOW EQU (0x3:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer -AT91C_SSC_FSOS_HIGH EQU (0x4:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer -AT91C_SSC_FSOS_TOGGLE EQU (0x5:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer -AT91C_SSC_FSEDGE EQU (0x1:SHL:24) ;- (SSC) Frame Sync Edge Detection -;- -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- -;- -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- -AT91C_SSC_DATDEF EQU (0x1:SHL:5) ;- (SSC) Data Default Value -AT91C_SSC_FSDEN EQU (0x1:SHL:23) ;- (SSC) Frame Sync Data Enable -;- -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- -AT91C_SSC_TXRDY EQU (0x1:SHL:0) ;- (SSC) Transmit Ready -AT91C_SSC_TXEMPTY EQU (0x1:SHL:1) ;- (SSC) Transmit Empty -AT91C_SSC_ENDTX EQU (0x1:SHL:2) ;- (SSC) End Of Transmission -AT91C_SSC_TXBUFE EQU (0x1:SHL:3) ;- (SSC) Transmit Buffer Empty -AT91C_SSC_RXRDY EQU (0x1:SHL:4) ;- (SSC) Receive Ready -AT91C_SSC_OVRUN EQU (0x1:SHL:5) ;- (SSC) Receive Overrun -AT91C_SSC_ENDRX EQU (0x1:SHL:6) ;- (SSC) End of Reception -AT91C_SSC_RXBUFF EQU (0x1:SHL:7) ;- (SSC) Receive Buffer Full -AT91C_SSC_CP0 EQU (0x1:SHL:8) ;- (SSC) Compare 0 -AT91C_SSC_CP1 EQU (0x1:SHL:9) ;- (SSC) Compare 1 -AT91C_SSC_TXSYN EQU (0x1:SHL:10) ;- (SSC) Transmit Sync -AT91C_SSC_RXSYN EQU (0x1:SHL:11) ;- (SSC) Receive Sync -AT91C_SSC_TXENA EQU (0x1:SHL:16) ;- (SSC) Transmit Enable -AT91C_SSC_RXENA EQU (0x1:SHL:17) ;- (SSC) Receive Enable -;- -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- -;- -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- -;- -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Two-wire Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_TWI -TWI_CR # 4 ;- Control Register -TWI_MMR # 4 ;- Master Mode Register - # 4 ;- Reserved -TWI_IADR # 4 ;- Internal Address Register -TWI_CWGR # 4 ;- Clock Waveform Generator Register - # 12 ;- Reserved -TWI_SR # 4 ;- Status Register -TWI_IER # 4 ;- Interrupt Enable Register -TWI_IDR # 4 ;- Interrupt Disable Register -TWI_IMR # 4 ;- Interrupt Mask Register -TWI_RHR # 4 ;- Receive Holding Register -TWI_THR # 4 ;- Transmit Holding Register -;- -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- -AT91C_TWI_START EQU (0x1:SHL:0) ;- (TWI) Send a START Condition -AT91C_TWI_STOP EQU (0x1:SHL:1) ;- (TWI) Send a STOP Condition -AT91C_TWI_MSEN EQU (0x1:SHL:2) ;- (TWI) TWI Master Transfer Enabled -AT91C_TWI_MSDIS EQU (0x1:SHL:3) ;- (TWI) TWI Master Transfer Disabled -AT91C_TWI_SWRST EQU (0x1:SHL:7) ;- (TWI) Software Reset -;- -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- -AT91C_TWI_IADRSZ EQU (0x3:SHL:8) ;- (TWI) Internal Device Address Size -AT91C_TWI_IADRSZ_NO EQU (0x0:SHL:8) ;- (TWI) No internal device address -AT91C_TWI_IADRSZ_1_BYTE EQU (0x1:SHL:8) ;- (TWI) One-byte internal device address -AT91C_TWI_IADRSZ_2_BYTE EQU (0x2:SHL:8) ;- (TWI) Two-byte internal device address -AT91C_TWI_IADRSZ_3_BYTE EQU (0x3:SHL:8) ;- (TWI) Three-byte internal device address -AT91C_TWI_MREAD EQU (0x1:SHL:12) ;- (TWI) Master Read Direction -AT91C_TWI_DADR EQU (0x7F:SHL:16) ;- (TWI) Device Address -;- -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- -AT91C_TWI_CLDIV EQU (0xFF:SHL:0) ;- (TWI) Clock Low Divider -AT91C_TWI_CHDIV EQU (0xFF:SHL:8) ;- (TWI) Clock High Divider -AT91C_TWI_CKDIV EQU (0x7:SHL:16) ;- (TWI) Clock Divider -;- -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- -AT91C_TWI_TXCOMP EQU (0x1:SHL:0) ;- (TWI) Transmission Completed -AT91C_TWI_RXRDY EQU (0x1:SHL:1) ;- (TWI) Receive holding register ReaDY -AT91C_TWI_TXRDY EQU (0x1:SHL:2) ;- (TWI) Transmit holding register ReaDY -AT91C_TWI_OVRE EQU (0x1:SHL:6) ;- (TWI) Overrun Error -AT91C_TWI_UNRE EQU (0x1:SHL:7) ;- (TWI) Underrun Error -AT91C_TWI_NACK EQU (0x1:SHL:8) ;- (TWI) Not Acknowledged -;- -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- -;- -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- -;- -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR PWMC Channel Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_PWMC_CH -PWMC_CMR # 4 ;- Channel Mode Register -PWMC_CDTYR # 4 ;- Channel Duty Cycle Register -PWMC_CPRDR # 4 ;- Channel Period Register -PWMC_CCNTR # 4 ;- Channel Counter Register -PWMC_CUPDR # 4 ;- Channel Update Register -PWMC_Reserved # 12 ;- Reserved -;- -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- -AT91C_PWMC_CPRE EQU (0xF:SHL:0) ;- (PWMC_CH) Channel Pre-scaler : PWMC_CLKx -AT91C_PWMC_CPRE_MCK EQU (0x0) ;- (PWMC_CH) -AT91C_PWMC_CPRE_MCKA EQU (0xB) ;- (PWMC_CH) -AT91C_PWMC_CPRE_MCKB EQU (0xC) ;- (PWMC_CH) -AT91C_PWMC_CALG EQU (0x1:SHL:8) ;- (PWMC_CH) Channel Alignment -AT91C_PWMC_CPOL EQU (0x1:SHL:9) ;- (PWMC_CH) Channel Polarity -AT91C_PWMC_CPD EQU (0x1:SHL:10) ;- (PWMC_CH) Channel Update Period -;- -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- -AT91C_PWMC_CDTY EQU (0x0:SHL:0) ;- (PWMC_CH) Channel Duty Cycle -;- -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- -AT91C_PWMC_CPRD EQU (0x0:SHL:0) ;- (PWMC_CH) Channel Period -;- -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- -AT91C_PWMC_CCNT EQU (0x0:SHL:0) ;- (PWMC_CH) Channel Counter -;- -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- -AT91C_PWMC_CUPD EQU (0x0:SHL:0) ;- (PWMC_CH) Channel Update - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_PWMC -PWMC_MR # 4 ;- PWMC Mode Register -PWMC_ENA # 4 ;- PWMC Enable Register -PWMC_DIS # 4 ;- PWMC Disable Register -PWMC_SR # 4 ;- PWMC Status Register -PWMC_IER # 4 ;- PWMC Interrupt Enable Register -PWMC_IDR # 4 ;- PWMC Interrupt Disable Register -PWMC_IMR # 4 ;- PWMC Interrupt Mask Register -PWMC_ISR # 4 ;- PWMC Interrupt Status Register - # 220 ;- Reserved -PWMC_VR # 4 ;- PWMC Version Register - # 256 ;- Reserved -PWMC_CH # 96 ;- PWMC Channel -;- -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- -AT91C_PWMC_DIVA EQU (0xFF:SHL:0) ;- (PWMC) CLKA divide factor. -AT91C_PWMC_PREA EQU (0xF:SHL:8) ;- (PWMC) Divider Input Clock Prescaler A -AT91C_PWMC_PREA_MCK EQU (0x0:SHL:8) ;- (PWMC) -AT91C_PWMC_DIVB EQU (0xFF:SHL:16) ;- (PWMC) CLKB divide factor. -AT91C_PWMC_PREB EQU (0xF:SHL:24) ;- (PWMC) Divider Input Clock Prescaler B -AT91C_PWMC_PREB_MCK EQU (0x0:SHL:24) ;- (PWMC) -;- -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- -AT91C_PWMC_CHID0 EQU (0x1:SHL:0) ;- (PWMC) Channel ID 0 -AT91C_PWMC_CHID1 EQU (0x1:SHL:1) ;- (PWMC) Channel ID 1 -AT91C_PWMC_CHID2 EQU (0x1:SHL:2) ;- (PWMC) Channel ID 2 -AT91C_PWMC_CHID3 EQU (0x1:SHL:3) ;- (PWMC) Channel ID 3 -;- -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- -;- -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- -;- -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- -;- -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- -;- -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- -;- -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR USB Device Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_UDP -UDP_NUM # 4 ;- Frame Number Register -UDP_GLBSTATE # 4 ;- Global State Register -UDP_FADDR # 4 ;- Function Address Register - # 4 ;- Reserved -UDP_IER # 4 ;- Interrupt Enable Register -UDP_IDR # 4 ;- Interrupt Disable Register -UDP_IMR # 4 ;- Interrupt Mask Register -UDP_ISR # 4 ;- Interrupt Status Register -UDP_ICR # 4 ;- Interrupt Clear Register - # 4 ;- Reserved -UDP_RSTEP # 4 ;- Reset Endpoint Register - # 4 ;- Reserved -UDP_CSR # 24 ;- Endpoint Control and Status Register - # 8 ;- Reserved -UDP_FDR # 24 ;- Endpoint FIFO Data Register - # 12 ;- Reserved -UDP_TXVC # 4 ;- Transceiver Control Register -;- -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- -AT91C_UDP_FRM_NUM EQU (0x7FF:SHL:0) ;- (UDP) Frame Number as Defined in the Packet Field Formats -AT91C_UDP_FRM_ERR EQU (0x1:SHL:16) ;- (UDP) Frame Error -AT91C_UDP_FRM_OK EQU (0x1:SHL:17) ;- (UDP) Frame OK -;- -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- -AT91C_UDP_FADDEN EQU (0x1:SHL:0) ;- (UDP) Function Address Enable -AT91C_UDP_CONFG EQU (0x1:SHL:1) ;- (UDP) Configured -AT91C_UDP_ESR EQU (0x1:SHL:2) ;- (UDP) Enable Send Resume -AT91C_UDP_RSMINPR EQU (0x1:SHL:3) ;- (UDP) A Resume Has Been Sent to the Host -AT91C_UDP_RMWUPE EQU (0x1:SHL:4) ;- (UDP) Remote Wake Up Enable -;- -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- -AT91C_UDP_FADD EQU (0xFF:SHL:0) ;- (UDP) Function Address Value -AT91C_UDP_FEN EQU (0x1:SHL:8) ;- (UDP) Function Enable -;- -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- -AT91C_UDP_EPINT0 EQU (0x1:SHL:0) ;- (UDP) Endpoint 0 Interrupt -AT91C_UDP_EPINT1 EQU (0x1:SHL:1) ;- (UDP) Endpoint 0 Interrupt -AT91C_UDP_EPINT2 EQU (0x1:SHL:2) ;- (UDP) Endpoint 2 Interrupt -AT91C_UDP_EPINT3 EQU (0x1:SHL:3) ;- (UDP) Endpoint 3 Interrupt -AT91C_UDP_EPINT4 EQU (0x1:SHL:4) ;- (UDP) Endpoint 4 Interrupt -AT91C_UDP_EPINT5 EQU (0x1:SHL:5) ;- (UDP) Endpoint 5 Interrupt -AT91C_UDP_RXSUSP EQU (0x1:SHL:8) ;- (UDP) USB Suspend Interrupt -AT91C_UDP_RXRSM EQU (0x1:SHL:9) ;- (UDP) USB Resume Interrupt -AT91C_UDP_EXTRSM EQU (0x1:SHL:10) ;- (UDP) USB External Resume Interrupt -AT91C_UDP_SOFINT EQU (0x1:SHL:11) ;- (UDP) USB Start Of frame Interrupt -AT91C_UDP_WAKEUP EQU (0x1:SHL:13) ;- (UDP) USB Resume Interrupt -;- -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- -;- -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- -;- -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- -AT91C_UDP_ENDBUSRES EQU (0x1:SHL:12) ;- (UDP) USB End Of Bus Reset Interrupt -;- -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- -;- -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- -AT91C_UDP_EP0 EQU (0x1:SHL:0) ;- (UDP) Reset Endpoint 0 -AT91C_UDP_EP1 EQU (0x1:SHL:1) ;- (UDP) Reset Endpoint 1 -AT91C_UDP_EP2 EQU (0x1:SHL:2) ;- (UDP) Reset Endpoint 2 -AT91C_UDP_EP3 EQU (0x1:SHL:3) ;- (UDP) Reset Endpoint 3 -AT91C_UDP_EP4 EQU (0x1:SHL:4) ;- (UDP) Reset Endpoint 4 -AT91C_UDP_EP5 EQU (0x1:SHL:5) ;- (UDP) Reset Endpoint 5 -;- -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- -AT91C_UDP_TXCOMP EQU (0x1:SHL:0) ;- (UDP) Generates an IN packet with data previously written in the DPR -AT91C_UDP_RX_DATA_BK0 EQU (0x1:SHL:1) ;- (UDP) Receive Data Bank 0 -AT91C_UDP_RXSETUP EQU (0x1:SHL:2) ;- (UDP) Sends STALL to the Host (Control endpoints) -AT91C_UDP_ISOERROR EQU (0x1:SHL:3) ;- (UDP) Isochronous error (Isochronous endpoints) -AT91C_UDP_TXPKTRDY EQU (0x1:SHL:4) ;- (UDP) Transmit Packet Ready -AT91C_UDP_FORCESTALL EQU (0x1:SHL:5) ;- (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). -AT91C_UDP_RX_DATA_BK1 EQU (0x1:SHL:6) ;- (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). -AT91C_UDP_DIR EQU (0x1:SHL:7) ;- (UDP) Transfer Direction -AT91C_UDP_EPTYPE EQU (0x7:SHL:8) ;- (UDP) Endpoint type -AT91C_UDP_EPTYPE_CTRL EQU (0x0:SHL:8) ;- (UDP) Control -AT91C_UDP_EPTYPE_ISO_OUT EQU (0x1:SHL:8) ;- (UDP) Isochronous OUT -AT91C_UDP_EPTYPE_BULK_OUT EQU (0x2:SHL:8) ;- (UDP) Bulk OUT -AT91C_UDP_EPTYPE_INT_OUT EQU (0x3:SHL:8) ;- (UDP) Interrupt OUT -AT91C_UDP_EPTYPE_ISO_IN EQU (0x5:SHL:8) ;- (UDP) Isochronous IN -AT91C_UDP_EPTYPE_BULK_IN EQU (0x6:SHL:8) ;- (UDP) Bulk IN -AT91C_UDP_EPTYPE_INT_IN EQU (0x7:SHL:8) ;- (UDP) Interrupt IN -AT91C_UDP_DTGLE EQU (0x1:SHL:11) ;- (UDP) Data Toggle -AT91C_UDP_EPEDS EQU (0x1:SHL:15) ;- (UDP) Endpoint Enable Disable -AT91C_UDP_RXBYTECNT EQU (0x7FF:SHL:16) ;- (UDP) Number Of Bytes Available in the FIFO -;- -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- -AT91C_UDP_TXVDIS EQU (0x1:SHL:8) ;- (UDP) -AT91C_UDP_PUON EQU (0x1:SHL:9) ;- (UDP) Pull-up ON - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Timer Counter Channel Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_TC -TC_CCR # 4 ;- Channel Control Register -TC_CMR # 4 ;- Channel Mode Register (Capture Mode / Waveform Mode) - # 8 ;- Reserved -TC_CV # 4 ;- Counter Value -TC_RA # 4 ;- Register A -TC_RB # 4 ;- Register B -TC_RC # 4 ;- Register C -TC_SR # 4 ;- Status Register -TC_IER # 4 ;- Interrupt Enable Register -TC_IDR # 4 ;- Interrupt Disable Register -TC_IMR # 4 ;- Interrupt Mask Register -;- -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- -AT91C_TC_CLKEN EQU (0x1:SHL:0) ;- (TC) Counter Clock Enable Command -AT91C_TC_CLKDIS EQU (0x1:SHL:1) ;- (TC) Counter Clock Disable Command -AT91C_TC_SWTRG EQU (0x1:SHL:2) ;- (TC) Software Trigger Command -;- -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- -AT91C_TC_CLKS EQU (0x7:SHL:0) ;- (TC) Clock Selection -AT91C_TC_CLKS_TIMER_DIV1_CLOCK EQU (0x0) ;- (TC) Clock selected: TIMER_DIV1_CLOCK -AT91C_TC_CLKS_TIMER_DIV2_CLOCK EQU (0x1) ;- (TC) Clock selected: TIMER_DIV2_CLOCK -AT91C_TC_CLKS_TIMER_DIV3_CLOCK EQU (0x2) ;- (TC) Clock selected: TIMER_DIV3_CLOCK -AT91C_TC_CLKS_TIMER_DIV4_CLOCK EQU (0x3) ;- (TC) Clock selected: TIMER_DIV4_CLOCK -AT91C_TC_CLKS_TIMER_DIV5_CLOCK EQU (0x4) ;- (TC) Clock selected: TIMER_DIV5_CLOCK -AT91C_TC_CLKS_XC0 EQU (0x5) ;- (TC) Clock selected: XC0 -AT91C_TC_CLKS_XC1 EQU (0x6) ;- (TC) Clock selected: XC1 -AT91C_TC_CLKS_XC2 EQU (0x7) ;- (TC) Clock selected: XC2 -AT91C_TC_CLKI EQU (0x1:SHL:3) ;- (TC) Clock Invert -AT91C_TC_BURST EQU (0x3:SHL:4) ;- (TC) Burst Signal Selection -AT91C_TC_BURST_NONE EQU (0x0:SHL:4) ;- (TC) The clock is not gated by an external signal -AT91C_TC_BURST_XC0 EQU (0x1:SHL:4) ;- (TC) XC0 is ANDed with the selected clock -AT91C_TC_BURST_XC1 EQU (0x2:SHL:4) ;- (TC) XC1 is ANDed with the selected clock -AT91C_TC_BURST_XC2 EQU (0x3:SHL:4) ;- (TC) XC2 is ANDed with the selected clock -AT91C_TC_CPCSTOP EQU (0x1:SHL:6) ;- (TC) Counter Clock Stopped with RC Compare -AT91C_TC_LDBSTOP EQU (0x1:SHL:6) ;- (TC) Counter Clock Stopped with RB Loading -AT91C_TC_CPCDIS EQU (0x1:SHL:7) ;- (TC) Counter Clock Disable with RC Compare -AT91C_TC_LDBDIS EQU (0x1:SHL:7) ;- (TC) Counter Clock Disabled with RB Loading -AT91C_TC_ETRGEDG EQU (0x3:SHL:8) ;- (TC) External Trigger Edge Selection -AT91C_TC_ETRGEDG_NONE EQU (0x0:SHL:8) ;- (TC) Edge: None -AT91C_TC_ETRGEDG_RISING EQU (0x1:SHL:8) ;- (TC) Edge: rising edge -AT91C_TC_ETRGEDG_FALLING EQU (0x2:SHL:8) ;- (TC) Edge: falling edge -AT91C_TC_ETRGEDG_BOTH EQU (0x3:SHL:8) ;- (TC) Edge: each edge -AT91C_TC_EEVTEDG EQU (0x3:SHL:8) ;- (TC) External Event Edge Selection -AT91C_TC_EEVTEDG_NONE EQU (0x0:SHL:8) ;- (TC) Edge: None -AT91C_TC_EEVTEDG_RISING EQU (0x1:SHL:8) ;- (TC) Edge: rising edge -AT91C_TC_EEVTEDG_FALLING EQU (0x2:SHL:8) ;- (TC) Edge: falling edge -AT91C_TC_EEVTEDG_BOTH EQU (0x3:SHL:8) ;- (TC) Edge: each edge -AT91C_TC_EEVT EQU (0x3:SHL:10) ;- (TC) External Event Selection -AT91C_TC_EEVT_TIOB EQU (0x0:SHL:10) ;- (TC) Signal selected as external event: TIOB TIOB direction: input -AT91C_TC_EEVT_XC0 EQU (0x1:SHL:10) ;- (TC) Signal selected as external event: XC0 TIOB direction: output -AT91C_TC_EEVT_XC1 EQU (0x2:SHL:10) ;- (TC) Signal selected as external event: XC1 TIOB direction: output -AT91C_TC_EEVT_XC2 EQU (0x3:SHL:10) ;- (TC) Signal selected as external event: XC2 TIOB direction: output -AT91C_TC_ABETRG EQU (0x1:SHL:10) ;- (TC) TIOA or TIOB External Trigger Selection -AT91C_TC_ENETRG EQU (0x1:SHL:12) ;- (TC) External Event Trigger enable -AT91C_TC_WAVESEL EQU (0x3:SHL:13) ;- (TC) Waveform Selection -AT91C_TC_WAVESEL_UP EQU (0x0:SHL:13) ;- (TC) UP mode without atomatic trigger on RC Compare -AT91C_TC_WAVESEL_UPDOWN EQU (0x1:SHL:13) ;- (TC) UPDOWN mode without automatic trigger on RC Compare -AT91C_TC_WAVESEL_UP_AUTO EQU (0x2:SHL:13) ;- (TC) UP mode with automatic trigger on RC Compare -AT91C_TC_WAVESEL_UPDOWN_AUTO EQU (0x3:SHL:13) ;- (TC) UPDOWN mode with automatic trigger on RC Compare -AT91C_TC_CPCTRG EQU (0x1:SHL:14) ;- (TC) RC Compare Trigger Enable -AT91C_TC_WAVE EQU (0x1:SHL:15) ;- (TC) -AT91C_TC_ACPA EQU (0x3:SHL:16) ;- (TC) RA Compare Effect on TIOA -AT91C_TC_ACPA_NONE EQU (0x0:SHL:16) ;- (TC) Effect: none -AT91C_TC_ACPA_SET EQU (0x1:SHL:16) ;- (TC) Effect: set -AT91C_TC_ACPA_CLEAR EQU (0x2:SHL:16) ;- (TC) Effect: clear -AT91C_TC_ACPA_TOGGLE EQU (0x3:SHL:16) ;- (TC) Effect: toggle -AT91C_TC_LDRA EQU (0x3:SHL:16) ;- (TC) RA Loading Selection -AT91C_TC_LDRA_NONE EQU (0x0:SHL:16) ;- (TC) Edge: None -AT91C_TC_LDRA_RISING EQU (0x1:SHL:16) ;- (TC) Edge: rising edge of TIOA -AT91C_TC_LDRA_FALLING EQU (0x2:SHL:16) ;- (TC) Edge: falling edge of TIOA -AT91C_TC_LDRA_BOTH EQU (0x3:SHL:16) ;- (TC) Edge: each edge of TIOA -AT91C_TC_ACPC EQU (0x3:SHL:18) ;- (TC) RC Compare Effect on TIOA -AT91C_TC_ACPC_NONE EQU (0x0:SHL:18) ;- (TC) Effect: none -AT91C_TC_ACPC_SET EQU (0x1:SHL:18) ;- (TC) Effect: set -AT91C_TC_ACPC_CLEAR EQU (0x2:SHL:18) ;- (TC) Effect: clear -AT91C_TC_ACPC_TOGGLE EQU (0x3:SHL:18) ;- (TC) Effect: toggle -AT91C_TC_LDRB EQU (0x3:SHL:18) ;- (TC) RB Loading Selection -AT91C_TC_LDRB_NONE EQU (0x0:SHL:18) ;- (TC) Edge: None -AT91C_TC_LDRB_RISING EQU (0x1:SHL:18) ;- (TC) Edge: rising edge of TIOA -AT91C_TC_LDRB_FALLING EQU (0x2:SHL:18) ;- (TC) Edge: falling edge of TIOA -AT91C_TC_LDRB_BOTH EQU (0x3:SHL:18) ;- (TC) Edge: each edge of TIOA -AT91C_TC_AEEVT EQU (0x3:SHL:20) ;- (TC) External Event Effect on TIOA -AT91C_TC_AEEVT_NONE EQU (0x0:SHL:20) ;- (TC) Effect: none -AT91C_TC_AEEVT_SET EQU (0x1:SHL:20) ;- (TC) Effect: set -AT91C_TC_AEEVT_CLEAR EQU (0x2:SHL:20) ;- (TC) Effect: clear -AT91C_TC_AEEVT_TOGGLE EQU (0x3:SHL:20) ;- (TC) Effect: toggle -AT91C_TC_ASWTRG EQU (0x3:SHL:22) ;- (TC) Software Trigger Effect on TIOA -AT91C_TC_ASWTRG_NONE EQU (0x0:SHL:22) ;- (TC) Effect: none -AT91C_TC_ASWTRG_SET EQU (0x1:SHL:22) ;- (TC) Effect: set -AT91C_TC_ASWTRG_CLEAR EQU (0x2:SHL:22) ;- (TC) Effect: clear -AT91C_TC_ASWTRG_TOGGLE EQU (0x3:SHL:22) ;- (TC) Effect: toggle -AT91C_TC_BCPB EQU (0x3:SHL:24) ;- (TC) RB Compare Effect on TIOB -AT91C_TC_BCPB_NONE EQU (0x0:SHL:24) ;- (TC) Effect: none -AT91C_TC_BCPB_SET EQU (0x1:SHL:24) ;- (TC) Effect: set -AT91C_TC_BCPB_CLEAR EQU (0x2:SHL:24) ;- (TC) Effect: clear -AT91C_TC_BCPB_TOGGLE EQU (0x3:SHL:24) ;- (TC) Effect: toggle -AT91C_TC_BCPC EQU (0x3:SHL:26) ;- (TC) RC Compare Effect on TIOB -AT91C_TC_BCPC_NONE EQU (0x0:SHL:26) ;- (TC) Effect: none -AT91C_TC_BCPC_SET EQU (0x1:SHL:26) ;- (TC) Effect: set -AT91C_TC_BCPC_CLEAR EQU (0x2:SHL:26) ;- (TC) Effect: clear -AT91C_TC_BCPC_TOGGLE EQU (0x3:SHL:26) ;- (TC) Effect: toggle -AT91C_TC_BEEVT EQU (0x3:SHL:28) ;- (TC) External Event Effect on TIOB -AT91C_TC_BEEVT_NONE EQU (0x0:SHL:28) ;- (TC) Effect: none -AT91C_TC_BEEVT_SET EQU (0x1:SHL:28) ;- (TC) Effect: set -AT91C_TC_BEEVT_CLEAR EQU (0x2:SHL:28) ;- (TC) Effect: clear -AT91C_TC_BEEVT_TOGGLE EQU (0x3:SHL:28) ;- (TC) Effect: toggle -AT91C_TC_BSWTRG EQU (0x3:SHL:30) ;- (TC) Software Trigger Effect on TIOB -AT91C_TC_BSWTRG_NONE EQU (0x0:SHL:30) ;- (TC) Effect: none -AT91C_TC_BSWTRG_SET EQU (0x1:SHL:30) ;- (TC) Effect: set -AT91C_TC_BSWTRG_CLEAR EQU (0x2:SHL:30) ;- (TC) Effect: clear -AT91C_TC_BSWTRG_TOGGLE EQU (0x3:SHL:30) ;- (TC) Effect: toggle -;- -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- -AT91C_TC_COVFS EQU (0x1:SHL:0) ;- (TC) Counter Overflow -AT91C_TC_LOVRS EQU (0x1:SHL:1) ;- (TC) Load Overrun -AT91C_TC_CPAS EQU (0x1:SHL:2) ;- (TC) RA Compare -AT91C_TC_CPBS EQU (0x1:SHL:3) ;- (TC) RB Compare -AT91C_TC_CPCS EQU (0x1:SHL:4) ;- (TC) RC Compare -AT91C_TC_LDRAS EQU (0x1:SHL:5) ;- (TC) RA Loading -AT91C_TC_LDRBS EQU (0x1:SHL:6) ;- (TC) RB Loading -AT91C_TC_ETRGS EQU (0x1:SHL:7) ;- (TC) External Trigger -AT91C_TC_CLKSTA EQU (0x1:SHL:16) ;- (TC) Clock Enabling -AT91C_TC_MTIOA EQU (0x1:SHL:17) ;- (TC) TIOA Mirror -AT91C_TC_MTIOB EQU (0x1:SHL:18) ;- (TC) TIOA Mirror -;- -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- -;- -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- -;- -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Timer Counter Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_TCB -TCB_TC0 # 48 ;- TC Channel 0 - # 16 ;- Reserved -TCB_TC1 # 48 ;- TC Channel 1 - # 16 ;- Reserved -TCB_TC2 # 48 ;- TC Channel 2 - # 16 ;- Reserved -TCB_BCR # 4 ;- TC Block Control Register -TCB_BMR # 4 ;- TC Block Mode Register -;- -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- -AT91C_TCB_SYNC EQU (0x1:SHL:0) ;- (TCB) Synchro Command -;- -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- -AT91C_TCB_TC0XC0S EQU (0x3:SHL:0) ;- (TCB) External Clock Signal 0 Selection -AT91C_TCB_TC0XC0S_TCLK0 EQU (0x0) ;- (TCB) TCLK0 connected to XC0 -AT91C_TCB_TC0XC0S_NONE EQU (0x1) ;- (TCB) None signal connected to XC0 -AT91C_TCB_TC0XC0S_TIOA1 EQU (0x2) ;- (TCB) TIOA1 connected to XC0 -AT91C_TCB_TC0XC0S_TIOA2 EQU (0x3) ;- (TCB) TIOA2 connected to XC0 -AT91C_TCB_TC1XC1S EQU (0x3:SHL:2) ;- (TCB) External Clock Signal 1 Selection -AT91C_TCB_TC1XC1S_TCLK1 EQU (0x0:SHL:2) ;- (TCB) TCLK1 connected to XC1 -AT91C_TCB_TC1XC1S_NONE EQU (0x1:SHL:2) ;- (TCB) None signal connected to XC1 -AT91C_TCB_TC1XC1S_TIOA0 EQU (0x2:SHL:2) ;- (TCB) TIOA0 connected to XC1 -AT91C_TCB_TC1XC1S_TIOA2 EQU (0x3:SHL:2) ;- (TCB) TIOA2 connected to XC1 -AT91C_TCB_TC2XC2S EQU (0x3:SHL:4) ;- (TCB) External Clock Signal 2 Selection -AT91C_TCB_TC2XC2S_TCLK2 EQU (0x0:SHL:4) ;- (TCB) TCLK2 connected to XC2 -AT91C_TCB_TC2XC2S_NONE EQU (0x1:SHL:4) ;- (TCB) None signal connected to XC2 -AT91C_TCB_TC2XC2S_TIOA0 EQU (0x2:SHL:4) ;- (TCB) TIOA0 connected to XC2 -AT91C_TCB_TC2XC2S_TIOA1 EQU (0x3:SHL:4) ;- (TCB) TIOA2 connected to XC2 - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_CAN_MB -CAN_MB_MMR # 4 ;- MailBox Mode Register -CAN_MB_MAM # 4 ;- MailBox Acceptance Mask Register -CAN_MB_MID # 4 ;- MailBox ID Register -CAN_MB_MFID # 4 ;- MailBox Family ID Register -CAN_MB_MSR # 4 ;- MailBox Status Register -CAN_MB_MDL # 4 ;- MailBox Data Low Register -CAN_MB_MDH # 4 ;- MailBox Data High Register -CAN_MB_MCR # 4 ;- MailBox Control Register -;- -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- -AT91C_CAN_MTIMEMARK EQU (0xFFFF:SHL:0) ;- (CAN_MB) Mailbox Timemark -AT91C_CAN_PRIOR EQU (0xF:SHL:16) ;- (CAN_MB) Mailbox Priority -AT91C_CAN_MOT EQU (0x7:SHL:24) ;- (CAN_MB) Mailbox Object Type -AT91C_CAN_MOT_DIS EQU (0x0:SHL:24) ;- (CAN_MB) -AT91C_CAN_MOT_RX EQU (0x1:SHL:24) ;- (CAN_MB) -AT91C_CAN_MOT_RXOVERWRITE EQU (0x2:SHL:24) ;- (CAN_MB) -AT91C_CAN_MOT_TX EQU (0x3:SHL:24) ;- (CAN_MB) -AT91C_CAN_MOT_CONSUMER EQU (0x4:SHL:24) ;- (CAN_MB) -AT91C_CAN_MOT_PRODUCER EQU (0x5:SHL:24) ;- (CAN_MB) -;- -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- -AT91C_CAN_MIDvB EQU (0x3FFFF:SHL:0) ;- (CAN_MB) Complementary bits for identifier in extended mode -AT91C_CAN_MIDvA EQU (0x7FF:SHL:18) ;- (CAN_MB) Identifier for standard frame mode -AT91C_CAN_MIDE EQU (0x1:SHL:29) ;- (CAN_MB) Identifier Version -;- -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- -;- -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- -;- -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- -AT91C_CAN_MTIMESTAMP EQU (0xFFFF:SHL:0) ;- (CAN_MB) Timer Value -AT91C_CAN_MDLC EQU (0xF:SHL:16) ;- (CAN_MB) Mailbox Data Length Code -AT91C_CAN_MRTR EQU (0x1:SHL:20) ;- (CAN_MB) Mailbox Remote Transmission Request -AT91C_CAN_MABT EQU (0x1:SHL:22) ;- (CAN_MB) Mailbox Message Abort -AT91C_CAN_MRDY EQU (0x1:SHL:23) ;- (CAN_MB) Mailbox Ready -AT91C_CAN_MMI EQU (0x1:SHL:24) ;- (CAN_MB) Mailbox Message Ignored -;- -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- -;- -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- -;- -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- -AT91C_CAN_MACR EQU (0x1:SHL:22) ;- (CAN_MB) Abort Request for Mailbox -AT91C_CAN_MTCR EQU (0x1:SHL:23) ;- (CAN_MB) Mailbox Transfer Command - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Control Area Network Interface -;- ***************************************************************************** - ^ 0 ;- AT91S_CAN -CAN_MR # 4 ;- Mode Register -CAN_IER # 4 ;- Interrupt Enable Register -CAN_IDR # 4 ;- Interrupt Disable Register -CAN_IMR # 4 ;- Interrupt Mask Register -CAN_SR # 4 ;- Status Register -CAN_BR # 4 ;- Baudrate Register -CAN_TIM # 4 ;- Timer Register -CAN_TIMESTP # 4 ;- Time Stamp Register -CAN_ECR # 4 ;- Error Counter Register -CAN_TCR # 4 ;- Transfer Command Register -CAN_ACR # 4 ;- Abort Command Register - # 208 ;- Reserved -CAN_VR # 4 ;- Version Register - # 256 ;- Reserved -CAN_MB0 # 32 ;- CAN Mailbox 0 -CAN_MB1 # 32 ;- CAN Mailbox 1 -CAN_MB2 # 32 ;- CAN Mailbox 2 -CAN_MB3 # 32 ;- CAN Mailbox 3 -CAN_MB4 # 32 ;- CAN Mailbox 4 -CAN_MB5 # 32 ;- CAN Mailbox 5 -CAN_MB6 # 32 ;- CAN Mailbox 6 -CAN_MB7 # 32 ;- CAN Mailbox 7 -CAN_MB8 # 32 ;- CAN Mailbox 8 -CAN_MB9 # 32 ;- CAN Mailbox 9 -CAN_MB10 # 32 ;- CAN Mailbox 10 -CAN_MB11 # 32 ;- CAN Mailbox 11 -CAN_MB12 # 32 ;- CAN Mailbox 12 -CAN_MB13 # 32 ;- CAN Mailbox 13 -CAN_MB14 # 32 ;- CAN Mailbox 14 -CAN_MB15 # 32 ;- CAN Mailbox 15 -;- -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- -AT91C_CAN_CANEN EQU (0x1:SHL:0) ;- (CAN) CAN Controller Enable -AT91C_CAN_LPM EQU (0x1:SHL:1) ;- (CAN) Disable/Enable Low Power Mode -AT91C_CAN_ABM EQU (0x1:SHL:2) ;- (CAN) Disable/Enable Autobaud/Listen Mode -AT91C_CAN_OVL EQU (0x1:SHL:3) ;- (CAN) Disable/Enable Overload Frame -AT91C_CAN_TEOF EQU (0x1:SHL:4) ;- (CAN) Time Stamp messages at each end of Frame -AT91C_CAN_TTM EQU (0x1:SHL:5) ;- (CAN) Disable/Enable Time Trigger Mode -AT91C_CAN_TIMFRZ EQU (0x1:SHL:6) ;- (CAN) Enable Timer Freeze -AT91C_CAN_DRPT EQU (0x1:SHL:7) ;- (CAN) Disable Repeat -;- -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- -AT91C_CAN_MB0 EQU (0x1:SHL:0) ;- (CAN) Mailbox 0 Flag -AT91C_CAN_MB1 EQU (0x1:SHL:1) ;- (CAN) Mailbox 1 Flag -AT91C_CAN_MB2 EQU (0x1:SHL:2) ;- (CAN) Mailbox 2 Flag -AT91C_CAN_MB3 EQU (0x1:SHL:3) ;- (CAN) Mailbox 3 Flag -AT91C_CAN_MB4 EQU (0x1:SHL:4) ;- (CAN) Mailbox 4 Flag -AT91C_CAN_MB5 EQU (0x1:SHL:5) ;- (CAN) Mailbox 5 Flag -AT91C_CAN_MB6 EQU (0x1:SHL:6) ;- (CAN) Mailbox 6 Flag -AT91C_CAN_MB7 EQU (0x1:SHL:7) ;- (CAN) Mailbox 7 Flag -AT91C_CAN_MB8 EQU (0x1:SHL:8) ;- (CAN) Mailbox 8 Flag -AT91C_CAN_MB9 EQU (0x1:SHL:9) ;- (CAN) Mailbox 9 Flag -AT91C_CAN_MB10 EQU (0x1:SHL:10) ;- (CAN) Mailbox 10 Flag -AT91C_CAN_MB11 EQU (0x1:SHL:11) ;- (CAN) Mailbox 11 Flag -AT91C_CAN_MB12 EQU (0x1:SHL:12) ;- (CAN) Mailbox 12 Flag -AT91C_CAN_MB13 EQU (0x1:SHL:13) ;- (CAN) Mailbox 13 Flag -AT91C_CAN_MB14 EQU (0x1:SHL:14) ;- (CAN) Mailbox 14 Flag -AT91C_CAN_MB15 EQU (0x1:SHL:15) ;- (CAN) Mailbox 15 Flag -AT91C_CAN_ERRA EQU (0x1:SHL:16) ;- (CAN) Error Active Mode Flag -AT91C_CAN_WARN EQU (0x1:SHL:17) ;- (CAN) Warning Limit Flag -AT91C_CAN_ERRP EQU (0x1:SHL:18) ;- (CAN) Error Passive Mode Flag -AT91C_CAN_BOFF EQU (0x1:SHL:19) ;- (CAN) Bus Off Mode Flag -AT91C_CAN_SLEEP EQU (0x1:SHL:20) ;- (CAN) Sleep Flag -AT91C_CAN_WAKEUP EQU (0x1:SHL:21) ;- (CAN) Wakeup Flag -AT91C_CAN_TOVF EQU (0x1:SHL:22) ;- (CAN) Timer Overflow Flag -AT91C_CAN_TSTP EQU (0x1:SHL:23) ;- (CAN) Timestamp Flag -AT91C_CAN_CERR EQU (0x1:SHL:24) ;- (CAN) CRC Error -AT91C_CAN_SERR EQU (0x1:SHL:25) ;- (CAN) Stuffing Error -AT91C_CAN_AERR EQU (0x1:SHL:26) ;- (CAN) Acknowledgment Error -AT91C_CAN_FERR EQU (0x1:SHL:27) ;- (CAN) Form Error -AT91C_CAN_BERR EQU (0x1:SHL:28) ;- (CAN) Bit Error -;- -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- -;- -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- -;- -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- -AT91C_CAN_RBSY EQU (0x1:SHL:29) ;- (CAN) Receiver Busy -AT91C_CAN_TBSY EQU (0x1:SHL:30) ;- (CAN) Transmitter Busy -AT91C_CAN_OVLY EQU (0x1:SHL:31) ;- (CAN) Overload Busy -;- -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- -AT91C_CAN_PHASE2 EQU (0x7:SHL:0) ;- (CAN) Phase 2 segment -AT91C_CAN_PHASE1 EQU (0x7:SHL:4) ;- (CAN) Phase 1 segment -AT91C_CAN_PROPAG EQU (0x7:SHL:8) ;- (CAN) Programmation time segment -AT91C_CAN_SYNC EQU (0x3:SHL:12) ;- (CAN) Re-synchronization jump width segment -AT91C_CAN_BRP EQU (0x7F:SHL:16) ;- (CAN) Baudrate Prescaler -AT91C_CAN_SMP EQU (0x1:SHL:24) ;- (CAN) Sampling mode -;- -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- -AT91C_CAN_TIMER EQU (0xFFFF:SHL:0) ;- (CAN) Timer field -;- -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- -;- -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- -AT91C_CAN_REC EQU (0xFF:SHL:0) ;- (CAN) Receive Error Counter -AT91C_CAN_TEC EQU (0xFF:SHL:16) ;- (CAN) Transmit Error Counter -;- -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- -AT91C_CAN_TIMRST EQU (0x1:SHL:31) ;- (CAN) Timer Reset Field -;- -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 -;- ***************************************************************************** - ^ 0 ;- AT91S_EMAC -EMAC_NCR # 4 ;- Network Control Register -EMAC_NCFGR # 4 ;- Network Configuration Register -EMAC_NSR # 4 ;- Network Status Register - # 8 ;- Reserved -EMAC_TSR # 4 ;- Transmit Status Register -EMAC_RBQP # 4 ;- Receive Buffer Queue Pointer -EMAC_TBQP # 4 ;- Transmit Buffer Queue Pointer -EMAC_RSR # 4 ;- Receive Status Register -EMAC_ISR # 4 ;- Interrupt Status Register -EMAC_IER # 4 ;- Interrupt Enable Register -EMAC_IDR # 4 ;- Interrupt Disable Register -EMAC_IMR # 4 ;- Interrupt Mask Register -EMAC_MAN # 4 ;- PHY Maintenance Register -EMAC_PTR # 4 ;- Pause Time Register -EMAC_PFR # 4 ;- Pause Frames received Register -EMAC_FTO # 4 ;- Frames Transmitted OK Register -EMAC_SCF # 4 ;- Single Collision Frame Register -EMAC_MCF # 4 ;- Multiple Collision Frame Register -EMAC_FRO # 4 ;- Frames Received OK Register -EMAC_FCSE # 4 ;- Frame Check Sequence Error Register -EMAC_ALE # 4 ;- Alignment Error Register -EMAC_DTF # 4 ;- Deferred Transmission Frame Register -EMAC_LCOL # 4 ;- Late Collision Register -EMAC_ECOL # 4 ;- Excessive Collision Register -EMAC_TUND # 4 ;- Transmit Underrun Error Register -EMAC_CSE # 4 ;- Carrier Sense Error Register -EMAC_RRE # 4 ;- Receive Ressource Error Register -EMAC_ROV # 4 ;- Receive Overrun Errors Register -EMAC_RSE # 4 ;- Receive Symbol Errors Register -EMAC_ELE # 4 ;- Excessive Length Errors Register -EMAC_RJA # 4 ;- Receive Jabbers Register -EMAC_USF # 4 ;- Undersize Frames Register -EMAC_STE # 4 ;- SQE Test Error Register -EMAC_RLE # 4 ;- Receive Length Field Mismatch Register -EMAC_TPF # 4 ;- Transmitted Pause Frames Register -EMAC_HRB # 4 ;- Hash Address Bottom[31:0] -EMAC_HRT # 4 ;- Hash Address Top[63:32] -EMAC_SA1L # 4 ;- Specific Address 1 Bottom, First 4 bytes -EMAC_SA1H # 4 ;- Specific Address 1 Top, Last 2 bytes -EMAC_SA2L # 4 ;- Specific Address 2 Bottom, First 4 bytes -EMAC_SA2H # 4 ;- Specific Address 2 Top, Last 2 bytes -EMAC_SA3L # 4 ;- Specific Address 3 Bottom, First 4 bytes -EMAC_SA3H # 4 ;- Specific Address 3 Top, Last 2 bytes -EMAC_SA4L # 4 ;- Specific Address 4 Bottom, First 4 bytes -EMAC_SA4H # 4 ;- Specific Address 4 Top, Last 2 bytes -EMAC_TID # 4 ;- Type ID Checking Register -EMAC_TPQ # 4 ;- Transmit Pause Quantum Register -EMAC_USRIO # 4 ;- USER Input/Output Register -EMAC_WOL # 4 ;- Wake On LAN Register - # 52 ;- Reserved -EMAC_REV # 4 ;- Revision Register -;- -------- EMAC_NCR : (EMAC Offset: 0x0) -------- -AT91C_EMAC_LB EQU (0x1:SHL:0) ;- (EMAC) Loopback. Optional. When set, loopback signal is at high level. -AT91C_EMAC_LLB EQU (0x1:SHL:1) ;- (EMAC) Loopback local. -AT91C_EMAC_RE EQU (0x1:SHL:2) ;- (EMAC) Receive enable. -AT91C_EMAC_TE EQU (0x1:SHL:3) ;- (EMAC) Transmit enable. -AT91C_EMAC_MPE EQU (0x1:SHL:4) ;- (EMAC) Management port enable. -AT91C_EMAC_CLRSTAT EQU (0x1:SHL:5) ;- (EMAC) Clear statistics registers. -AT91C_EMAC_INCSTAT EQU (0x1:SHL:6) ;- (EMAC) Increment statistics registers. -AT91C_EMAC_WESTAT EQU (0x1:SHL:7) ;- (EMAC) Write enable for statistics registers. -AT91C_EMAC_BP EQU (0x1:SHL:8) ;- (EMAC) Back pressure. -AT91C_EMAC_TSTART EQU (0x1:SHL:9) ;- (EMAC) Start Transmission. -AT91C_EMAC_THALT EQU (0x1:SHL:10) ;- (EMAC) Transmission Halt. -AT91C_EMAC_TPFR EQU (0x1:SHL:11) ;- (EMAC) Transmit pause frame -AT91C_EMAC_TZQ EQU (0x1:SHL:12) ;- (EMAC) Transmit zero quantum pause frame -;- -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- -AT91C_EMAC_SPD EQU (0x1:SHL:0) ;- (EMAC) Speed. -AT91C_EMAC_FD EQU (0x1:SHL:1) ;- (EMAC) Full duplex. -AT91C_EMAC_JFRAME EQU (0x1:SHL:3) ;- (EMAC) Jumbo Frames. -AT91C_EMAC_CAF EQU (0x1:SHL:4) ;- (EMAC) Copy all frames. -AT91C_EMAC_NBC EQU (0x1:SHL:5) ;- (EMAC) No broadcast. -AT91C_EMAC_MTI EQU (0x1:SHL:6) ;- (EMAC) Multicast hash event enable -AT91C_EMAC_UNI EQU (0x1:SHL:7) ;- (EMAC) Unicast hash enable. -AT91C_EMAC_BIG EQU (0x1:SHL:8) ;- (EMAC) Receive 1522 bytes. -AT91C_EMAC_EAE EQU (0x1:SHL:9) ;- (EMAC) External address match enable. -AT91C_EMAC_CLK EQU (0x3:SHL:10) ;- (EMAC) -AT91C_EMAC_CLK_HCLK_8 EQU (0x0:SHL:10) ;- (EMAC) HCLK divided by 8 -AT91C_EMAC_CLK_HCLK_16 EQU (0x1:SHL:10) ;- (EMAC) HCLK divided by 16 -AT91C_EMAC_CLK_HCLK_32 EQU (0x2:SHL:10) ;- (EMAC) HCLK divided by 32 -AT91C_EMAC_CLK_HCLK_64 EQU (0x3:SHL:10) ;- (EMAC) HCLK divided by 64 -AT91C_EMAC_RTY EQU (0x1:SHL:12) ;- (EMAC) -AT91C_EMAC_PAE EQU (0x1:SHL:13) ;- (EMAC) -AT91C_EMAC_RBOF EQU (0x3:SHL:14) ;- (EMAC) -AT91C_EMAC_RBOF_OFFSET_0 EQU (0x0:SHL:14) ;- (EMAC) no offset from start of receive buffer -AT91C_EMAC_RBOF_OFFSET_1 EQU (0x1:SHL:14) ;- (EMAC) one byte offset from start of receive buffer -AT91C_EMAC_RBOF_OFFSET_2 EQU (0x2:SHL:14) ;- (EMAC) two bytes offset from start of receive buffer -AT91C_EMAC_RBOF_OFFSET_3 EQU (0x3:SHL:14) ;- (EMAC) three bytes offset from start of receive buffer -AT91C_EMAC_RLCE EQU (0x1:SHL:16) ;- (EMAC) Receive Length field Checking Enable -AT91C_EMAC_DRFCS EQU (0x1:SHL:17) ;- (EMAC) Discard Receive FCS -AT91C_EMAC_EFRHD EQU (0x1:SHL:18) ;- (EMAC) -AT91C_EMAC_IRXFCS EQU (0x1:SHL:19) ;- (EMAC) Ignore RX FCS -;- -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- -AT91C_EMAC_LINKR EQU (0x1:SHL:0) ;- (EMAC) -AT91C_EMAC_MDIO EQU (0x1:SHL:1) ;- (EMAC) -AT91C_EMAC_IDLE EQU (0x1:SHL:2) ;- (EMAC) -;- -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- -AT91C_EMAC_UBR EQU (0x1:SHL:0) ;- (EMAC) -AT91C_EMAC_COL EQU (0x1:SHL:1) ;- (EMAC) -AT91C_EMAC_RLES EQU (0x1:SHL:2) ;- (EMAC) -AT91C_EMAC_TGO EQU (0x1:SHL:3) ;- (EMAC) Transmit Go -AT91C_EMAC_BEX EQU (0x1:SHL:4) ;- (EMAC) Buffers exhausted mid frame -AT91C_EMAC_COMP EQU (0x1:SHL:5) ;- (EMAC) -AT91C_EMAC_UND EQU (0x1:SHL:6) ;- (EMAC) -;- -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- -AT91C_EMAC_BNA EQU (0x1:SHL:0) ;- (EMAC) -AT91C_EMAC_REC EQU (0x1:SHL:1) ;- (EMAC) -AT91C_EMAC_OVR EQU (0x1:SHL:2) ;- (EMAC) -;- -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- -AT91C_EMAC_MFD EQU (0x1:SHL:0) ;- (EMAC) -AT91C_EMAC_RCOMP EQU (0x1:SHL:1) ;- (EMAC) -AT91C_EMAC_RXUBR EQU (0x1:SHL:2) ;- (EMAC) -AT91C_EMAC_TXUBR EQU (0x1:SHL:3) ;- (EMAC) -AT91C_EMAC_TUNDR EQU (0x1:SHL:4) ;- (EMAC) -AT91C_EMAC_RLEX EQU (0x1:SHL:5) ;- (EMAC) -AT91C_EMAC_TXERR EQU (0x1:SHL:6) ;- (EMAC) -AT91C_EMAC_TCOMP EQU (0x1:SHL:7) ;- (EMAC) -AT91C_EMAC_LINK EQU (0x1:SHL:9) ;- (EMAC) -AT91C_EMAC_ROVR EQU (0x1:SHL:10) ;- (EMAC) -AT91C_EMAC_HRESP EQU (0x1:SHL:11) ;- (EMAC) -AT91C_EMAC_PFRE EQU (0x1:SHL:12) ;- (EMAC) -AT91C_EMAC_PTZ EQU (0x1:SHL:13) ;- (EMAC) -;- -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- -;- -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- -;- -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- -;- -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- -AT91C_EMAC_DATA EQU (0xFFFF:SHL:0) ;- (EMAC) -AT91C_EMAC_CODE EQU (0x3:SHL:16) ;- (EMAC) -AT91C_EMAC_REGA EQU (0x1F:SHL:18) ;- (EMAC) -AT91C_EMAC_PHYA EQU (0x1F:SHL:23) ;- (EMAC) -AT91C_EMAC_RW EQU (0x3:SHL:28) ;- (EMAC) -AT91C_EMAC_SOF EQU (0x3:SHL:30) ;- (EMAC) -;- -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- -AT91C_EMAC_RMII EQU (0x1:SHL:0) ;- (EMAC) Reduce MII -AT91C_EMAC_CLKEN EQU (0x1:SHL:1) ;- (EMAC) Clock Enable -;- -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- -AT91C_EMAC_IP EQU (0xFFFF:SHL:0) ;- (EMAC) ARP request IP address -AT91C_EMAC_MAG EQU (0x1:SHL:16) ;- (EMAC) Magic packet event enable -AT91C_EMAC_ARP EQU (0x1:SHL:17) ;- (EMAC) ARP request event enable -AT91C_EMAC_SA1 EQU (0x1:SHL:18) ;- (EMAC) Specific address register 1 event enable -;- -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- -AT91C_EMAC_REVREF EQU (0xFFFF:SHL:0) ;- (EMAC) -AT91C_EMAC_PARTREF EQU (0xFFFF:SHL:16) ;- (EMAC) - -;- ***************************************************************************** -;- SOFTWARE API DEFINITION FOR Analog to Digital Convertor -;- ***************************************************************************** - ^ 0 ;- AT91S_ADC -ADC_CR # 4 ;- ADC Control Register -ADC_MR # 4 ;- ADC Mode Register - # 8 ;- Reserved -ADC_CHER # 4 ;- ADC Channel Enable Register -ADC_CHDR # 4 ;- ADC Channel Disable Register -ADC_CHSR # 4 ;- ADC Channel Status Register -ADC_SR # 4 ;- ADC Status Register -ADC_LCDR # 4 ;- ADC Last Converted Data Register -ADC_IER # 4 ;- ADC Interrupt Enable Register -ADC_IDR # 4 ;- ADC Interrupt Disable Register -ADC_IMR # 4 ;- ADC Interrupt Mask Register -ADC_CDR0 # 4 ;- ADC Channel Data Register 0 -ADC_CDR1 # 4 ;- ADC Channel Data Register 1 -ADC_CDR2 # 4 ;- ADC Channel Data Register 2 -ADC_CDR3 # 4 ;- ADC Channel Data Register 3 -ADC_CDR4 # 4 ;- ADC Channel Data Register 4 -ADC_CDR5 # 4 ;- ADC Channel Data Register 5 -ADC_CDR6 # 4 ;- ADC Channel Data Register 6 -ADC_CDR7 # 4 ;- ADC Channel Data Register 7 - # 176 ;- Reserved -ADC_RPR # 4 ;- Receive Pointer Register -ADC_RCR # 4 ;- Receive Counter Register -ADC_TPR # 4 ;- Transmit Pointer Register -ADC_TCR # 4 ;- Transmit Counter Register -ADC_RNPR # 4 ;- Receive Next Pointer Register -ADC_RNCR # 4 ;- Receive Next Counter Register -ADC_TNPR # 4 ;- Transmit Next Pointer Register -ADC_TNCR # 4 ;- Transmit Next Counter Register -ADC_PTCR # 4 ;- PDC Transfer Control Register -ADC_PTSR # 4 ;- PDC Transfer Status Register -;- -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- -AT91C_ADC_SWRST EQU (0x1:SHL:0) ;- (ADC) Software Reset -AT91C_ADC_START EQU (0x1:SHL:1) ;- (ADC) Start Conversion -;- -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- -AT91C_ADC_TRGEN EQU (0x1:SHL:0) ;- (ADC) Trigger Enable -AT91C_ADC_TRGEN_DIS EQU (0x0) ;- (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software -AT91C_ADC_TRGEN_EN EQU (0x1) ;- (ADC) Hardware trigger selected by TRGSEL field is enabled. -AT91C_ADC_TRGSEL EQU (0x7:SHL:1) ;- (ADC) Trigger Selection -AT91C_ADC_TRGSEL_TIOA0 EQU (0x0:SHL:1) ;- (ADC) Selected TRGSEL = TIAO0 -AT91C_ADC_TRGSEL_TIOA1 EQU (0x1:SHL:1) ;- (ADC) Selected TRGSEL = TIAO1 -AT91C_ADC_TRGSEL_TIOA2 EQU (0x2:SHL:1) ;- (ADC) Selected TRGSEL = TIAO2 -AT91C_ADC_TRGSEL_TIOA3 EQU (0x3:SHL:1) ;- (ADC) Selected TRGSEL = TIAO3 -AT91C_ADC_TRGSEL_TIOA4 EQU (0x4:SHL:1) ;- (ADC) Selected TRGSEL = TIAO4 -AT91C_ADC_TRGSEL_TIOA5 EQU (0x5:SHL:1) ;- (ADC) Selected TRGSEL = TIAO5 -AT91C_ADC_TRGSEL_EXT EQU (0x6:SHL:1) ;- (ADC) Selected TRGSEL = External Trigger -AT91C_ADC_LOWRES EQU (0x1:SHL:4) ;- (ADC) Resolution. -AT91C_ADC_LOWRES_10_BIT EQU (0x0:SHL:4) ;- (ADC) 10-bit resolution -AT91C_ADC_LOWRES_8_BIT EQU (0x1:SHL:4) ;- (ADC) 8-bit resolution -AT91C_ADC_SLEEP EQU (0x1:SHL:5) ;- (ADC) Sleep Mode -AT91C_ADC_SLEEP_NORMAL_MODE EQU (0x0:SHL:5) ;- (ADC) Normal Mode -AT91C_ADC_SLEEP_MODE EQU (0x1:SHL:5) ;- (ADC) Sleep Mode -AT91C_ADC_PRESCAL EQU (0x3F:SHL:8) ;- (ADC) Prescaler rate selection -AT91C_ADC_STARTUP EQU (0x1F:SHL:16) ;- (ADC) Startup Time -AT91C_ADC_SHTIM EQU (0xF:SHL:24) ;- (ADC) Sample & Hold Time -;- -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- -AT91C_ADC_CH0 EQU (0x1:SHL:0) ;- (ADC) Channel 0 -AT91C_ADC_CH1 EQU (0x1:SHL:1) ;- (ADC) Channel 1 -AT91C_ADC_CH2 EQU (0x1:SHL:2) ;- (ADC) Channel 2 -AT91C_ADC_CH3 EQU (0x1:SHL:3) ;- (ADC) Channel 3 -AT91C_ADC_CH4 EQU (0x1:SHL:4) ;- (ADC) Channel 4 -AT91C_ADC_CH5 EQU (0x1:SHL:5) ;- (ADC) Channel 5 -AT91C_ADC_CH6 EQU (0x1:SHL:6) ;- (ADC) Channel 6 -AT91C_ADC_CH7 EQU (0x1:SHL:7) ;- (ADC) Channel 7 -;- -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- -;- -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- -;- -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- -AT91C_ADC_EOC0 EQU (0x1:SHL:0) ;- (ADC) End of Conversion -AT91C_ADC_EOC1 EQU (0x1:SHL:1) ;- (ADC) End of Conversion -AT91C_ADC_EOC2 EQU (0x1:SHL:2) ;- (ADC) End of Conversion -AT91C_ADC_EOC3 EQU (0x1:SHL:3) ;- (ADC) End of Conversion -AT91C_ADC_EOC4 EQU (0x1:SHL:4) ;- (ADC) End of Conversion -AT91C_ADC_EOC5 EQU (0x1:SHL:5) ;- (ADC) End of Conversion -AT91C_ADC_EOC6 EQU (0x1:SHL:6) ;- (ADC) End of Conversion -AT91C_ADC_EOC7 EQU (0x1:SHL:7) ;- (ADC) End of Conversion -AT91C_ADC_OVRE0 EQU (0x1:SHL:8) ;- (ADC) Overrun Error -AT91C_ADC_OVRE1 EQU (0x1:SHL:9) ;- (ADC) Overrun Error -AT91C_ADC_OVRE2 EQU (0x1:SHL:10) ;- (ADC) Overrun Error -AT91C_ADC_OVRE3 EQU (0x1:SHL:11) ;- (ADC) Overrun Error -AT91C_ADC_OVRE4 EQU (0x1:SHL:12) ;- (ADC) Overrun Error -AT91C_ADC_OVRE5 EQU (0x1:SHL:13) ;- (ADC) Overrun Error -AT91C_ADC_OVRE6 EQU (0x1:SHL:14) ;- (ADC) Overrun Error -AT91C_ADC_OVRE7 EQU (0x1:SHL:15) ;- (ADC) Overrun Error -AT91C_ADC_DRDY EQU (0x1:SHL:16) ;- (ADC) Data Ready -AT91C_ADC_GOVRE EQU (0x1:SHL:17) ;- (ADC) General Overrun -AT91C_ADC_ENDRX EQU (0x1:SHL:18) ;- (ADC) End of Receiver Transfer -AT91C_ADC_RXBUFF EQU (0x1:SHL:19) ;- (ADC) RXBUFF Interrupt -;- -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- -AT91C_ADC_LDATA EQU (0x3FF:SHL:0) ;- (ADC) Last Data Converted -;- -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- -;- -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- -;- -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- -;- -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- -AT91C_ADC_DATA EQU (0x3FF:SHL:0) ;- (ADC) Converted Data -;- -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- -;- -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- -;- -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- -;- -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- -;- -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- -;- -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- -;- -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- - -;- ***************************************************************************** -;- REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 -;- ***************************************************************************** -;- ========== Register definition for SYS peripheral ========== -;- ========== Register definition for AIC peripheral ========== -AT91C_AIC_IVR EQU (0xFFFFF100) ;- (AIC) IRQ Vector Register -AT91C_AIC_SMR EQU (0xFFFFF000) ;- (AIC) Source Mode Register -AT91C_AIC_FVR EQU (0xFFFFF104) ;- (AIC) FIQ Vector Register -AT91C_AIC_DCR EQU (0xFFFFF138) ;- (AIC) Debug Control Register (Protect) -AT91C_AIC_EOICR EQU (0xFFFFF130) ;- (AIC) End of Interrupt Command Register -AT91C_AIC_SVR EQU (0xFFFFF080) ;- (AIC) Source Vector Register -AT91C_AIC_FFSR EQU (0xFFFFF148) ;- (AIC) Fast Forcing Status Register -AT91C_AIC_ICCR EQU (0xFFFFF128) ;- (AIC) Interrupt Clear Command Register -AT91C_AIC_ISR EQU (0xFFFFF108) ;- (AIC) Interrupt Status Register -AT91C_AIC_IMR EQU (0xFFFFF110) ;- (AIC) Interrupt Mask Register -AT91C_AIC_IPR EQU (0xFFFFF10C) ;- (AIC) Interrupt Pending Register -AT91C_AIC_FFER EQU (0xFFFFF140) ;- (AIC) Fast Forcing Enable Register -AT91C_AIC_IECR EQU (0xFFFFF120) ;- (AIC) Interrupt Enable Command Register -AT91C_AIC_ISCR EQU (0xFFFFF12C) ;- (AIC) Interrupt Set Command Register -AT91C_AIC_FFDR EQU (0xFFFFF144) ;- (AIC) Fast Forcing Disable Register -AT91C_AIC_CISR EQU (0xFFFFF114) ;- (AIC) Core Interrupt Status Register -AT91C_AIC_IDCR EQU (0xFFFFF124) ;- (AIC) Interrupt Disable Command Register -AT91C_AIC_SPU EQU (0xFFFFF134) ;- (AIC) Spurious Vector Register -;- ========== Register definition for PDC_DBGU peripheral ========== -AT91C_DBGU_TCR EQU (0xFFFFF30C) ;- (PDC_DBGU) Transmit Counter Register -AT91C_DBGU_RNPR EQU (0xFFFFF310) ;- (PDC_DBGU) Receive Next Pointer Register -AT91C_DBGU_TNPR EQU (0xFFFFF318) ;- (PDC_DBGU) Transmit Next Pointer Register -AT91C_DBGU_TPR EQU (0xFFFFF308) ;- (PDC_DBGU) Transmit Pointer Register -AT91C_DBGU_RPR EQU (0xFFFFF300) ;- (PDC_DBGU) Receive Pointer Register -AT91C_DBGU_RCR EQU (0xFFFFF304) ;- (PDC_DBGU) Receive Counter Register -AT91C_DBGU_RNCR EQU (0xFFFFF314) ;- (PDC_DBGU) Receive Next Counter Register -AT91C_DBGU_PTCR EQU (0xFFFFF320) ;- (PDC_DBGU) PDC Transfer Control Register -AT91C_DBGU_PTSR EQU (0xFFFFF324) ;- (PDC_DBGU) PDC Transfer Status Register -AT91C_DBGU_TNCR EQU (0xFFFFF31C) ;- (PDC_DBGU) Transmit Next Counter Register -;- ========== Register definition for DBGU peripheral ========== -AT91C_DBGU_EXID EQU (0xFFFFF244) ;- (DBGU) Chip ID Extension Register -AT91C_DBGU_BRGR EQU (0xFFFFF220) ;- (DBGU) Baud Rate Generator Register -AT91C_DBGU_IDR EQU (0xFFFFF20C) ;- (DBGU) Interrupt Disable Register -AT91C_DBGU_CSR EQU (0xFFFFF214) ;- (DBGU) Channel Status Register -AT91C_DBGU_CIDR EQU (0xFFFFF240) ;- (DBGU) Chip ID Register -AT91C_DBGU_MR EQU (0xFFFFF204) ;- (DBGU) Mode Register -AT91C_DBGU_IMR EQU (0xFFFFF210) ;- (DBGU) Interrupt Mask Register -AT91C_DBGU_CR EQU (0xFFFFF200) ;- (DBGU) Control Register -AT91C_DBGU_FNTR EQU (0xFFFFF248) ;- (DBGU) Force NTRST Register -AT91C_DBGU_THR EQU (0xFFFFF21C) ;- (DBGU) Transmitter Holding Register -AT91C_DBGU_RHR EQU (0xFFFFF218) ;- (DBGU) Receiver Holding Register -AT91C_DBGU_IER EQU (0xFFFFF208) ;- (DBGU) Interrupt Enable Register -;- ========== Register definition for PIOA peripheral ========== -AT91C_PIOA_ODR EQU (0xFFFFF414) ;- (PIOA) Output Disable Registerr -AT91C_PIOA_SODR EQU (0xFFFFF430) ;- (PIOA) Set Output Data Register -AT91C_PIOA_ISR EQU (0xFFFFF44C) ;- (PIOA) Interrupt Status Register -AT91C_PIOA_ABSR EQU (0xFFFFF478) ;- (PIOA) AB Select Status Register -AT91C_PIOA_IER EQU (0xFFFFF440) ;- (PIOA) Interrupt Enable Register -AT91C_PIOA_PPUDR EQU (0xFFFFF460) ;- (PIOA) Pull-up Disable Register -AT91C_PIOA_IMR EQU (0xFFFFF448) ;- (PIOA) Interrupt Mask Register -AT91C_PIOA_PER EQU (0xFFFFF400) ;- (PIOA) PIO Enable Register -AT91C_PIOA_IFDR EQU (0xFFFFF424) ;- (PIOA) Input Filter Disable Register -AT91C_PIOA_OWDR EQU (0xFFFFF4A4) ;- (PIOA) Output Write Disable Register -AT91C_PIOA_MDSR EQU (0xFFFFF458) ;- (PIOA) Multi-driver Status Register -AT91C_PIOA_IDR EQU (0xFFFFF444) ;- (PIOA) Interrupt Disable Register -AT91C_PIOA_ODSR EQU (0xFFFFF438) ;- (PIOA) Output Data Status Register -AT91C_PIOA_PPUSR EQU (0xFFFFF468) ;- (PIOA) Pull-up Status Register -AT91C_PIOA_OWSR EQU (0xFFFFF4A8) ;- (PIOA) Output Write Status Register -AT91C_PIOA_BSR EQU (0xFFFFF474) ;- (PIOA) Select B Register -AT91C_PIOA_OWER EQU (0xFFFFF4A0) ;- (PIOA) Output Write Enable Register -AT91C_PIOA_IFER EQU (0xFFFFF420) ;- (PIOA) Input Filter Enable Register -AT91C_PIOA_PDSR EQU (0xFFFFF43C) ;- (PIOA) Pin Data Status Register -AT91C_PIOA_PPUER EQU (0xFFFFF464) ;- (PIOA) Pull-up Enable Register -AT91C_PIOA_OSR EQU (0xFFFFF418) ;- (PIOA) Output Status Register -AT91C_PIOA_ASR EQU (0xFFFFF470) ;- (PIOA) Select A Register -AT91C_PIOA_MDDR EQU (0xFFFFF454) ;- (PIOA) Multi-driver Disable Register -AT91C_PIOA_CODR EQU (0xFFFFF434) ;- (PIOA) Clear Output Data Register -AT91C_PIOA_MDER EQU (0xFFFFF450) ;- (PIOA) Multi-driver Enable Register -AT91C_PIOA_PDR EQU (0xFFFFF404) ;- (PIOA) PIO Disable Register -AT91C_PIOA_IFSR EQU (0xFFFFF428) ;- (PIOA) Input Filter Status Register -AT91C_PIOA_OER EQU (0xFFFFF410) ;- (PIOA) Output Enable Register -AT91C_PIOA_PSR EQU (0xFFFFF408) ;- (PIOA) PIO Status Register -;- ========== Register definition for PIOB peripheral ========== -AT91C_PIOB_OWDR EQU (0xFFFFF6A4) ;- (PIOB) Output Write Disable Register -AT91C_PIOB_MDER EQU (0xFFFFF650) ;- (PIOB) Multi-driver Enable Register -AT91C_PIOB_PPUSR EQU (0xFFFFF668) ;- (PIOB) Pull-up Status Register -AT91C_PIOB_IMR EQU (0xFFFFF648) ;- (PIOB) Interrupt Mask Register -AT91C_PIOB_ASR EQU (0xFFFFF670) ;- (PIOB) Select A Register -AT91C_PIOB_PPUDR EQU (0xFFFFF660) ;- (PIOB) Pull-up Disable Register -AT91C_PIOB_PSR EQU (0xFFFFF608) ;- (PIOB) PIO Status Register -AT91C_PIOB_IER EQU (0xFFFFF640) ;- (PIOB) Interrupt Enable Register -AT91C_PIOB_CODR EQU (0xFFFFF634) ;- (PIOB) Clear Output Data Register -AT91C_PIOB_OWER EQU (0xFFFFF6A0) ;- (PIOB) Output Write Enable Register -AT91C_PIOB_ABSR EQU (0xFFFFF678) ;- (PIOB) AB Select Status Register -AT91C_PIOB_IFDR EQU (0xFFFFF624) ;- (PIOB) Input Filter Disable Register -AT91C_PIOB_PDSR EQU (0xFFFFF63C) ;- (PIOB) Pin Data Status Register -AT91C_PIOB_IDR EQU (0xFFFFF644) ;- (PIOB) Interrupt Disable Register -AT91C_PIOB_OWSR EQU (0xFFFFF6A8) ;- (PIOB) Output Write Status Register -AT91C_PIOB_PDR EQU (0xFFFFF604) ;- (PIOB) PIO Disable Register -AT91C_PIOB_ODR EQU (0xFFFFF614) ;- (PIOB) Output Disable Registerr -AT91C_PIOB_IFSR EQU (0xFFFFF628) ;- (PIOB) Input Filter Status Register -AT91C_PIOB_PPUER EQU (0xFFFFF664) ;- (PIOB) Pull-up Enable Register -AT91C_PIOB_SODR EQU (0xFFFFF630) ;- (PIOB) Set Output Data Register -AT91C_PIOB_ISR EQU (0xFFFFF64C) ;- (PIOB) Interrupt Status Register -AT91C_PIOB_ODSR EQU (0xFFFFF638) ;- (PIOB) Output Data Status Register -AT91C_PIOB_OSR EQU (0xFFFFF618) ;- (PIOB) Output Status Register -AT91C_PIOB_MDSR EQU (0xFFFFF658) ;- (PIOB) Multi-driver Status Register -AT91C_PIOB_IFER EQU (0xFFFFF620) ;- (PIOB) Input Filter Enable Register -AT91C_PIOB_BSR EQU (0xFFFFF674) ;- (PIOB) Select B Register -AT91C_PIOB_MDDR EQU (0xFFFFF654) ;- (PIOB) Multi-driver Disable Register -AT91C_PIOB_OER EQU (0xFFFFF610) ;- (PIOB) Output Enable Register -AT91C_PIOB_PER EQU (0xFFFFF600) ;- (PIOB) PIO Enable Register -;- ========== Register definition for CKGR peripheral ========== -AT91C_CKGR_MOR EQU (0xFFFFFC20) ;- (CKGR) Main Oscillator Register -AT91C_CKGR_PLLR EQU (0xFFFFFC2C) ;- (CKGR) PLL Register -AT91C_CKGR_MCFR EQU (0xFFFFFC24) ;- (CKGR) Main Clock Frequency Register -;- ========== Register definition for PMC peripheral ========== -AT91C_PMC_IDR EQU (0xFFFFFC64) ;- (PMC) Interrupt Disable Register -AT91C_PMC_MOR EQU (0xFFFFFC20) ;- (PMC) Main Oscillator Register -AT91C_PMC_PLLR EQU (0xFFFFFC2C) ;- (PMC) PLL Register -AT91C_PMC_PCER EQU (0xFFFFFC10) ;- (PMC) Peripheral Clock Enable Register -AT91C_PMC_PCKR EQU (0xFFFFFC40) ;- (PMC) Programmable Clock Register -AT91C_PMC_MCKR EQU (0xFFFFFC30) ;- (PMC) Master Clock Register -AT91C_PMC_SCDR EQU (0xFFFFFC04) ;- (PMC) System Clock Disable Register -AT91C_PMC_PCDR EQU (0xFFFFFC14) ;- (PMC) Peripheral Clock Disable Register -AT91C_PMC_SCSR EQU (0xFFFFFC08) ;- (PMC) System Clock Status Register -AT91C_PMC_PCSR EQU (0xFFFFFC18) ;- (PMC) Peripheral Clock Status Register -AT91C_PMC_MCFR EQU (0xFFFFFC24) ;- (PMC) Main Clock Frequency Register -AT91C_PMC_SCER EQU (0xFFFFFC00) ;- (PMC) System Clock Enable Register -AT91C_PMC_IMR EQU (0xFFFFFC6C) ;- (PMC) Interrupt Mask Register -AT91C_PMC_IER EQU (0xFFFFFC60) ;- (PMC) Interrupt Enable Register -AT91C_PMC_SR EQU (0xFFFFFC68) ;- (PMC) Status Register -;- ========== Register definition for RSTC peripheral ========== -AT91C_RSTC_RCR EQU (0xFFFFFD00) ;- (RSTC) Reset Control Register -AT91C_RSTC_RMR EQU (0xFFFFFD08) ;- (RSTC) Reset Mode Register -AT91C_RSTC_RSR EQU (0xFFFFFD04) ;- (RSTC) Reset Status Register -;- ========== Register definition for RTTC peripheral ========== -AT91C_RTTC_RTSR EQU (0xFFFFFD2C) ;- (RTTC) Real-time Status Register -AT91C_RTTC_RTMR EQU (0xFFFFFD20) ;- (RTTC) Real-time Mode Register -AT91C_RTTC_RTVR EQU (0xFFFFFD28) ;- (RTTC) Real-time Value Register -AT91C_RTTC_RTAR EQU (0xFFFFFD24) ;- (RTTC) Real-time Alarm Register -;- ========== Register definition for PITC peripheral ========== -AT91C_PITC_PIVR EQU (0xFFFFFD38) ;- (PITC) Period Interval Value Register -AT91C_PITC_PISR EQU (0xFFFFFD34) ;- (PITC) Period Interval Status Register -AT91C_PITC_PIIR EQU (0xFFFFFD3C) ;- (PITC) Period Interval Image Register -AT91C_PITC_PIMR EQU (0xFFFFFD30) ;- (PITC) Period Interval Mode Register -;- ========== Register definition for WDTC peripheral ========== -AT91C_WDTC_WDCR EQU (0xFFFFFD40) ;- (WDTC) Watchdog Control Register -AT91C_WDTC_WDSR EQU (0xFFFFFD48) ;- (WDTC) Watchdog Status Register -AT91C_WDTC_WDMR EQU (0xFFFFFD44) ;- (WDTC) Watchdog Mode Register -;- ========== Register definition for VREG peripheral ========== -AT91C_VREG_MR EQU (0xFFFFFD60) ;- (VREG) Voltage Regulator Mode Register -;- ========== Register definition for MC peripheral ========== -AT91C_MC_ASR EQU (0xFFFFFF04) ;- (MC) MC Abort Status Register -AT91C_MC_RCR EQU (0xFFFFFF00) ;- (MC) MC Remap Control Register -AT91C_MC_FCR EQU (0xFFFFFF64) ;- (MC) MC Flash Command Register -AT91C_MC_AASR EQU (0xFFFFFF08) ;- (MC) MC Abort Address Status Register -AT91C_MC_FSR EQU (0xFFFFFF68) ;- (MC) MC Flash Status Register -AT91C_MC_FMR EQU (0xFFFFFF60) ;- (MC) MC Flash Mode Register -;- ========== Register definition for PDC_SPI1 peripheral ========== -AT91C_SPI1_PTCR EQU (0xFFFE4120) ;- (PDC_SPI1) PDC Transfer Control Register -AT91C_SPI1_RPR EQU (0xFFFE4100) ;- (PDC_SPI1) Receive Pointer Register -AT91C_SPI1_TNCR EQU (0xFFFE411C) ;- (PDC_SPI1) Transmit Next Counter Register -AT91C_SPI1_TPR EQU (0xFFFE4108) ;- (PDC_SPI1) Transmit Pointer Register -AT91C_SPI1_TNPR EQU (0xFFFE4118) ;- (PDC_SPI1) Transmit Next Pointer Register -AT91C_SPI1_TCR EQU (0xFFFE410C) ;- (PDC_SPI1) Transmit Counter Register -AT91C_SPI1_RCR EQU (0xFFFE4104) ;- (PDC_SPI1) Receive Counter Register -AT91C_SPI1_RNPR EQU (0xFFFE4110) ;- (PDC_SPI1) Receive Next Pointer Register -AT91C_SPI1_RNCR EQU (0xFFFE4114) ;- (PDC_SPI1) Receive Next Counter Register -AT91C_SPI1_PTSR EQU (0xFFFE4124) ;- (PDC_SPI1) PDC Transfer Status Register -;- ========== Register definition for SPI1 peripheral ========== -AT91C_SPI1_IMR EQU (0xFFFE401C) ;- (SPI1) Interrupt Mask Register -AT91C_SPI1_IER EQU (0xFFFE4014) ;- (SPI1) Interrupt Enable Register -AT91C_SPI1_MR EQU (0xFFFE4004) ;- (SPI1) Mode Register -AT91C_SPI1_RDR EQU (0xFFFE4008) ;- (SPI1) Receive Data Register -AT91C_SPI1_IDR EQU (0xFFFE4018) ;- (SPI1) Interrupt Disable Register -AT91C_SPI1_SR EQU (0xFFFE4010) ;- (SPI1) Status Register -AT91C_SPI1_TDR EQU (0xFFFE400C) ;- (SPI1) Transmit Data Register -AT91C_SPI1_CR EQU (0xFFFE4000) ;- (SPI1) Control Register -AT91C_SPI1_CSR EQU (0xFFFE4030) ;- (SPI1) Chip Select Register -;- ========== Register definition for PDC_SPI0 peripheral ========== -AT91C_SPI0_PTCR EQU (0xFFFE0120) ;- (PDC_SPI0) PDC Transfer Control Register -AT91C_SPI0_TPR EQU (0xFFFE0108) ;- (PDC_SPI0) Transmit Pointer Register -AT91C_SPI0_TCR EQU (0xFFFE010C) ;- (PDC_SPI0) Transmit Counter Register -AT91C_SPI0_RCR EQU (0xFFFE0104) ;- (PDC_SPI0) Receive Counter Register -AT91C_SPI0_PTSR EQU (0xFFFE0124) ;- (PDC_SPI0) PDC Transfer Status Register -AT91C_SPI0_RNPR EQU (0xFFFE0110) ;- (PDC_SPI0) Receive Next Pointer Register -AT91C_SPI0_RPR EQU (0xFFFE0100) ;- (PDC_SPI0) Receive Pointer Register -AT91C_SPI0_TNCR EQU (0xFFFE011C) ;- (PDC_SPI0) Transmit Next Counter Register -AT91C_SPI0_RNCR EQU (0xFFFE0114) ;- (PDC_SPI0) Receive Next Counter Register -AT91C_SPI0_TNPR EQU (0xFFFE0118) ;- (PDC_SPI0) Transmit Next Pointer Register -;- ========== Register definition for SPI0 peripheral ========== -AT91C_SPI0_IER EQU (0xFFFE0014) ;- (SPI0) Interrupt Enable Register -AT91C_SPI0_SR EQU (0xFFFE0010) ;- (SPI0) Status Register -AT91C_SPI0_IDR EQU (0xFFFE0018) ;- (SPI0) Interrupt Disable Register -AT91C_SPI0_CR EQU (0xFFFE0000) ;- (SPI0) Control Register -AT91C_SPI0_MR EQU (0xFFFE0004) ;- (SPI0) Mode Register -AT91C_SPI0_IMR EQU (0xFFFE001C) ;- (SPI0) Interrupt Mask Register -AT91C_SPI0_TDR EQU (0xFFFE000C) ;- (SPI0) Transmit Data Register -AT91C_SPI0_RDR EQU (0xFFFE0008) ;- (SPI0) Receive Data Register -AT91C_SPI0_CSR EQU (0xFFFE0030) ;- (SPI0) Chip Select Register -;- ========== Register definition for PDC_US1 peripheral ========== -AT91C_US1_RNCR EQU (0xFFFC4114) ;- (PDC_US1) Receive Next Counter Register -AT91C_US1_PTCR EQU (0xFFFC4120) ;- (PDC_US1) PDC Transfer Control Register -AT91C_US1_TCR EQU (0xFFFC410C) ;- (PDC_US1) Transmit Counter Register -AT91C_US1_PTSR EQU (0xFFFC4124) ;- (PDC_US1) PDC Transfer Status Register -AT91C_US1_TNPR EQU (0xFFFC4118) ;- (PDC_US1) Transmit Next Pointer Register -AT91C_US1_RCR EQU (0xFFFC4104) ;- (PDC_US1) Receive Counter Register -AT91C_US1_RNPR EQU (0xFFFC4110) ;- (PDC_US1) Receive Next Pointer Register -AT91C_US1_RPR EQU (0xFFFC4100) ;- (PDC_US1) Receive Pointer Register -AT91C_US1_TNCR EQU (0xFFFC411C) ;- (PDC_US1) Transmit Next Counter Register -AT91C_US1_TPR EQU (0xFFFC4108) ;- (PDC_US1) Transmit Pointer Register -;- ========== Register definition for US1 peripheral ========== -AT91C_US1_IF EQU (0xFFFC404C) ;- (US1) IRDA_FILTER Register -AT91C_US1_NER EQU (0xFFFC4044) ;- (US1) Nb Errors Register -AT91C_US1_RTOR EQU (0xFFFC4024) ;- (US1) Receiver Time-out Register -AT91C_US1_CSR EQU (0xFFFC4014) ;- (US1) Channel Status Register -AT91C_US1_IDR EQU (0xFFFC400C) ;- (US1) Interrupt Disable Register -AT91C_US1_IER EQU (0xFFFC4008) ;- (US1) Interrupt Enable Register -AT91C_US1_THR EQU (0xFFFC401C) ;- (US1) Transmitter Holding Register -AT91C_US1_TTGR EQU (0xFFFC4028) ;- (US1) Transmitter Time-guard Register -AT91C_US1_RHR EQU (0xFFFC4018) ;- (US1) Receiver Holding Register -AT91C_US1_BRGR EQU (0xFFFC4020) ;- (US1) Baud Rate Generator Register -AT91C_US1_IMR EQU (0xFFFC4010) ;- (US1) Interrupt Mask Register -AT91C_US1_FIDI EQU (0xFFFC4040) ;- (US1) FI_DI_Ratio Register -AT91C_US1_CR EQU (0xFFFC4000) ;- (US1) Control Register -AT91C_US1_MR EQU (0xFFFC4004) ;- (US1) Mode Register -;- ========== Register definition for PDC_US0 peripheral ========== -AT91C_US0_TNPR EQU (0xFFFC0118) ;- (PDC_US0) Transmit Next Pointer Register -AT91C_US0_RNPR EQU (0xFFFC0110) ;- (PDC_US0) Receive Next Pointer Register -AT91C_US0_TCR EQU (0xFFFC010C) ;- (PDC_US0) Transmit Counter Register -AT91C_US0_PTCR EQU (0xFFFC0120) ;- (PDC_US0) PDC Transfer Control Register -AT91C_US0_PTSR EQU (0xFFFC0124) ;- (PDC_US0) PDC Transfer Status Register -AT91C_US0_TNCR EQU (0xFFFC011C) ;- (PDC_US0) Transmit Next Counter Register -AT91C_US0_TPR EQU (0xFFFC0108) ;- (PDC_US0) Transmit Pointer Register -AT91C_US0_RCR EQU (0xFFFC0104) ;- (PDC_US0) Receive Counter Register -AT91C_US0_RPR EQU (0xFFFC0100) ;- (PDC_US0) Receive Pointer Register -AT91C_US0_RNCR EQU (0xFFFC0114) ;- (PDC_US0) Receive Next Counter Register -;- ========== Register definition for US0 peripheral ========== -AT91C_US0_BRGR EQU (0xFFFC0020) ;- (US0) Baud Rate Generator Register -AT91C_US0_NER EQU (0xFFFC0044) ;- (US0) Nb Errors Register -AT91C_US0_CR EQU (0xFFFC0000) ;- (US0) Control Register -AT91C_US0_IMR EQU (0xFFFC0010) ;- (US0) Interrupt Mask Register -AT91C_US0_FIDI EQU (0xFFFC0040) ;- (US0) FI_DI_Ratio Register -AT91C_US0_TTGR EQU (0xFFFC0028) ;- (US0) Transmitter Time-guard Register -AT91C_US0_MR EQU (0xFFFC0004) ;- (US0) Mode Register -AT91C_US0_RTOR EQU (0xFFFC0024) ;- (US0) Receiver Time-out Register -AT91C_US0_CSR EQU (0xFFFC0014) ;- (US0) Channel Status Register -AT91C_US0_RHR EQU (0xFFFC0018) ;- (US0) Receiver Holding Register -AT91C_US0_IDR EQU (0xFFFC000C) ;- (US0) Interrupt Disable Register -AT91C_US0_THR EQU (0xFFFC001C) ;- (US0) Transmitter Holding Register -AT91C_US0_IF EQU (0xFFFC004C) ;- (US0) IRDA_FILTER Register -AT91C_US0_IER EQU (0xFFFC0008) ;- (US0) Interrupt Enable Register -;- ========== Register definition for PDC_SSC peripheral ========== -AT91C_SSC_TNCR EQU (0xFFFD411C) ;- (PDC_SSC) Transmit Next Counter Register -AT91C_SSC_RPR EQU (0xFFFD4100) ;- (PDC_SSC) Receive Pointer Register -AT91C_SSC_RNCR EQU (0xFFFD4114) ;- (PDC_SSC) Receive Next Counter Register -AT91C_SSC_TPR EQU (0xFFFD4108) ;- (PDC_SSC) Transmit Pointer Register -AT91C_SSC_PTCR EQU (0xFFFD4120) ;- (PDC_SSC) PDC Transfer Control Register -AT91C_SSC_TCR EQU (0xFFFD410C) ;- (PDC_SSC) Transmit Counter Register -AT91C_SSC_RCR EQU (0xFFFD4104) ;- (PDC_SSC) Receive Counter Register -AT91C_SSC_RNPR EQU (0xFFFD4110) ;- (PDC_SSC) Receive Next Pointer Register -AT91C_SSC_TNPR EQU (0xFFFD4118) ;- (PDC_SSC) Transmit Next Pointer Register -AT91C_SSC_PTSR EQU (0xFFFD4124) ;- (PDC_SSC) PDC Transfer Status Register -;- ========== Register definition for SSC peripheral ========== -AT91C_SSC_RHR EQU (0xFFFD4020) ;- (SSC) Receive Holding Register -AT91C_SSC_RSHR EQU (0xFFFD4030) ;- (SSC) Receive Sync Holding Register -AT91C_SSC_TFMR EQU (0xFFFD401C) ;- (SSC) Transmit Frame Mode Register -AT91C_SSC_IDR EQU (0xFFFD4048) ;- (SSC) Interrupt Disable Register -AT91C_SSC_THR EQU (0xFFFD4024) ;- (SSC) Transmit Holding Register -AT91C_SSC_RCMR EQU (0xFFFD4010) ;- (SSC) Receive Clock ModeRegister -AT91C_SSC_IER EQU (0xFFFD4044) ;- (SSC) Interrupt Enable Register -AT91C_SSC_TSHR EQU (0xFFFD4034) ;- (SSC) Transmit Sync Holding Register -AT91C_SSC_SR EQU (0xFFFD4040) ;- (SSC) Status Register -AT91C_SSC_CMR EQU (0xFFFD4004) ;- (SSC) Clock Mode Register -AT91C_SSC_TCMR EQU (0xFFFD4018) ;- (SSC) Transmit Clock Mode Register -AT91C_SSC_CR EQU (0xFFFD4000) ;- (SSC) Control Register -AT91C_SSC_IMR EQU (0xFFFD404C) ;- (SSC) Interrupt Mask Register -AT91C_SSC_RFMR EQU (0xFFFD4014) ;- (SSC) Receive Frame Mode Register -;- ========== Register definition for TWI peripheral ========== -AT91C_TWI_IER EQU (0xFFFB8024) ;- (TWI) Interrupt Enable Register -AT91C_TWI_CR EQU (0xFFFB8000) ;- (TWI) Control Register -AT91C_TWI_SR EQU (0xFFFB8020) ;- (TWI) Status Register -AT91C_TWI_IMR EQU (0xFFFB802C) ;- (TWI) Interrupt Mask Register -AT91C_TWI_THR EQU (0xFFFB8034) ;- (TWI) Transmit Holding Register -AT91C_TWI_IDR EQU (0xFFFB8028) ;- (TWI) Interrupt Disable Register -AT91C_TWI_IADR EQU (0xFFFB800C) ;- (TWI) Internal Address Register -AT91C_TWI_MMR EQU (0xFFFB8004) ;- (TWI) Master Mode Register -AT91C_TWI_CWGR EQU (0xFFFB8010) ;- (TWI) Clock Waveform Generator Register -AT91C_TWI_RHR EQU (0xFFFB8030) ;- (TWI) Receive Holding Register -;- ========== Register definition for PWMC_CH3 peripheral ========== -AT91C_PWMC_CH3_CUPDR EQU (0xFFFCC270) ;- (PWMC_CH3) Channel Update Register -AT91C_PWMC_CH3_Reserved EQU (0xFFFCC274) ;- (PWMC_CH3) Reserved -AT91C_PWMC_CH3_CPRDR EQU (0xFFFCC268) ;- (PWMC_CH3) Channel Period Register -AT91C_PWMC_CH3_CDTYR EQU (0xFFFCC264) ;- (PWMC_CH3) Channel Duty Cycle Register -AT91C_PWMC_CH3_CCNTR EQU (0xFFFCC26C) ;- (PWMC_CH3) Channel Counter Register -AT91C_PWMC_CH3_CMR EQU (0xFFFCC260) ;- (PWMC_CH3) Channel Mode Register -;- ========== Register definition for PWMC_CH2 peripheral ========== -AT91C_PWMC_CH2_Reserved EQU (0xFFFCC254) ;- (PWMC_CH2) Reserved -AT91C_PWMC_CH2_CMR EQU (0xFFFCC240) ;- (PWMC_CH2) Channel Mode Register -AT91C_PWMC_CH2_CCNTR EQU (0xFFFCC24C) ;- (PWMC_CH2) Channel Counter Register -AT91C_PWMC_CH2_CPRDR EQU (0xFFFCC248) ;- (PWMC_CH2) Channel Period Register -AT91C_PWMC_CH2_CUPDR EQU (0xFFFCC250) ;- (PWMC_CH2) Channel Update Register -AT91C_PWMC_CH2_CDTYR EQU (0xFFFCC244) ;- (PWMC_CH2) Channel Duty Cycle Register -;- ========== Register definition for PWMC_CH1 peripheral ========== -AT91C_PWMC_CH1_Reserved EQU (0xFFFCC234) ;- (PWMC_CH1) Reserved -AT91C_PWMC_CH1_CUPDR EQU (0xFFFCC230) ;- (PWMC_CH1) Channel Update Register -AT91C_PWMC_CH1_CPRDR EQU (0xFFFCC228) ;- (PWMC_CH1) Channel Period Register -AT91C_PWMC_CH1_CCNTR EQU (0xFFFCC22C) ;- (PWMC_CH1) Channel Counter Register -AT91C_PWMC_CH1_CDTYR EQU (0xFFFCC224) ;- (PWMC_CH1) Channel Duty Cycle Register -AT91C_PWMC_CH1_CMR EQU (0xFFFCC220) ;- (PWMC_CH1) Channel Mode Register -;- ========== Register definition for PWMC_CH0 peripheral ========== -AT91C_PWMC_CH0_Reserved EQU (0xFFFCC214) ;- (PWMC_CH0) Reserved -AT91C_PWMC_CH0_CPRDR EQU (0xFFFCC208) ;- (PWMC_CH0) Channel Period Register -AT91C_PWMC_CH0_CDTYR EQU (0xFFFCC204) ;- (PWMC_CH0) Channel Duty Cycle Register -AT91C_PWMC_CH0_CMR EQU (0xFFFCC200) ;- (PWMC_CH0) Channel Mode Register -AT91C_PWMC_CH0_CUPDR EQU (0xFFFCC210) ;- (PWMC_CH0) Channel Update Register -AT91C_PWMC_CH0_CCNTR EQU (0xFFFCC20C) ;- (PWMC_CH0) Channel Counter Register -;- ========== Register definition for PWMC peripheral ========== -AT91C_PWMC_IDR EQU (0xFFFCC014) ;- (PWMC) PWMC Interrupt Disable Register -AT91C_PWMC_DIS EQU (0xFFFCC008) ;- (PWMC) PWMC Disable Register -AT91C_PWMC_IER EQU (0xFFFCC010) ;- (PWMC) PWMC Interrupt Enable Register -AT91C_PWMC_VR EQU (0xFFFCC0FC) ;- (PWMC) PWMC Version Register -AT91C_PWMC_ISR EQU (0xFFFCC01C) ;- (PWMC) PWMC Interrupt Status Register -AT91C_PWMC_SR EQU (0xFFFCC00C) ;- (PWMC) PWMC Status Register -AT91C_PWMC_IMR EQU (0xFFFCC018) ;- (PWMC) PWMC Interrupt Mask Register -AT91C_PWMC_MR EQU (0xFFFCC000) ;- (PWMC) PWMC Mode Register -AT91C_PWMC_ENA EQU (0xFFFCC004) ;- (PWMC) PWMC Enable Register -;- ========== Register definition for UDP peripheral ========== -AT91C_UDP_IMR EQU (0xFFFB0018) ;- (UDP) Interrupt Mask Register -AT91C_UDP_FADDR EQU (0xFFFB0008) ;- (UDP) Function Address Register -AT91C_UDP_NUM EQU (0xFFFB0000) ;- (UDP) Frame Number Register -AT91C_UDP_FDR EQU (0xFFFB0050) ;- (UDP) Endpoint FIFO Data Register -AT91C_UDP_ISR EQU (0xFFFB001C) ;- (UDP) Interrupt Status Register -AT91C_UDP_CSR EQU (0xFFFB0030) ;- (UDP) Endpoint Control and Status Register -AT91C_UDP_IDR EQU (0xFFFB0014) ;- (UDP) Interrupt Disable Register -AT91C_UDP_ICR EQU (0xFFFB0020) ;- (UDP) Interrupt Clear Register -AT91C_UDP_RSTEP EQU (0xFFFB0028) ;- (UDP) Reset Endpoint Register -AT91C_UDP_TXVC EQU (0xFFFB0074) ;- (UDP) Transceiver Control Register -AT91C_UDP_GLBSTATE EQU (0xFFFB0004) ;- (UDP) Global State Register -AT91C_UDP_IER EQU (0xFFFB0010) ;- (UDP) Interrupt Enable Register -;- ========== Register definition for TC0 peripheral ========== -AT91C_TC0_SR EQU (0xFFFA0020) ;- (TC0) Status Register -AT91C_TC0_RC EQU (0xFFFA001C) ;- (TC0) Register C -AT91C_TC0_RB EQU (0xFFFA0018) ;- (TC0) Register B -AT91C_TC0_CCR EQU (0xFFFA0000) ;- (TC0) Channel Control Register -AT91C_TC0_CMR EQU (0xFFFA0004) ;- (TC0) Channel Mode Register (Capture Mode / Waveform Mode) -AT91C_TC0_IER EQU (0xFFFA0024) ;- (TC0) Interrupt Enable Register -AT91C_TC0_RA EQU (0xFFFA0014) ;- (TC0) Register A -AT91C_TC0_IDR EQU (0xFFFA0028) ;- (TC0) Interrupt Disable Register -AT91C_TC0_CV EQU (0xFFFA0010) ;- (TC0) Counter Value -AT91C_TC0_IMR EQU (0xFFFA002C) ;- (TC0) Interrupt Mask Register -;- ========== Register definition for TC1 peripheral ========== -AT91C_TC1_RB EQU (0xFFFA0058) ;- (TC1) Register B -AT91C_TC1_CCR EQU (0xFFFA0040) ;- (TC1) Channel Control Register -AT91C_TC1_IER EQU (0xFFFA0064) ;- (TC1) Interrupt Enable Register -AT91C_TC1_IDR EQU (0xFFFA0068) ;- (TC1) Interrupt Disable Register -AT91C_TC1_SR EQU (0xFFFA0060) ;- (TC1) Status Register -AT91C_TC1_CMR EQU (0xFFFA0044) ;- (TC1) Channel Mode Register (Capture Mode / Waveform Mode) -AT91C_TC1_RA EQU (0xFFFA0054) ;- (TC1) Register A -AT91C_TC1_RC EQU (0xFFFA005C) ;- (TC1) Register C -AT91C_TC1_IMR EQU (0xFFFA006C) ;- (TC1) Interrupt Mask Register -AT91C_TC1_CV EQU (0xFFFA0050) ;- (TC1) Counter Value -;- ========== Register definition for TC2 peripheral ========== -AT91C_TC2_CMR EQU (0xFFFA0084) ;- (TC2) Channel Mode Register (Capture Mode / Waveform Mode) -AT91C_TC2_CCR EQU (0xFFFA0080) ;- (TC2) Channel Control Register -AT91C_TC2_CV EQU (0xFFFA0090) ;- (TC2) Counter Value -AT91C_TC2_RA EQU (0xFFFA0094) ;- (TC2) Register A -AT91C_TC2_RB EQU (0xFFFA0098) ;- (TC2) Register B -AT91C_TC2_IDR EQU (0xFFFA00A8) ;- (TC2) Interrupt Disable Register -AT91C_TC2_IMR EQU (0xFFFA00AC) ;- (TC2) Interrupt Mask Register -AT91C_TC2_RC EQU (0xFFFA009C) ;- (TC2) Register C -AT91C_TC2_IER EQU (0xFFFA00A4) ;- (TC2) Interrupt Enable Register -AT91C_TC2_SR EQU (0xFFFA00A0) ;- (TC2) Status Register -;- ========== Register definition for TCB peripheral ========== -AT91C_TCB_BMR EQU (0xFFFA00C4) ;- (TCB) TC Block Mode Register -AT91C_TCB_BCR EQU (0xFFFA00C0) ;- (TCB) TC Block Control Register -;- ========== Register definition for CAN_MB0 peripheral ========== -AT91C_CAN_MB0_MDL EQU (0xFFFD0214) ;- (CAN_MB0) MailBox Data Low Register -AT91C_CAN_MB0_MAM EQU (0xFFFD0204) ;- (CAN_MB0) MailBox Acceptance Mask Register -AT91C_CAN_MB0_MCR EQU (0xFFFD021C) ;- (CAN_MB0) MailBox Control Register -AT91C_CAN_MB0_MID EQU (0xFFFD0208) ;- (CAN_MB0) MailBox ID Register -AT91C_CAN_MB0_MSR EQU (0xFFFD0210) ;- (CAN_MB0) MailBox Status Register -AT91C_CAN_MB0_MFID EQU (0xFFFD020C) ;- (CAN_MB0) MailBox Family ID Register -AT91C_CAN_MB0_MDH EQU (0xFFFD0218) ;- (CAN_MB0) MailBox Data High Register -AT91C_CAN_MB0_MMR EQU (0xFFFD0200) ;- (CAN_MB0) MailBox Mode Register -;- ========== Register definition for CAN_MB1 peripheral ========== -AT91C_CAN_MB1_MDL EQU (0xFFFD0234) ;- (CAN_MB1) MailBox Data Low Register -AT91C_CAN_MB1_MID EQU (0xFFFD0228) ;- (CAN_MB1) MailBox ID Register -AT91C_CAN_MB1_MMR EQU (0xFFFD0220) ;- (CAN_MB1) MailBox Mode Register -AT91C_CAN_MB1_MSR EQU (0xFFFD0230) ;- (CAN_MB1) MailBox Status Register -AT91C_CAN_MB1_MAM EQU (0xFFFD0224) ;- (CAN_MB1) MailBox Acceptance Mask Register -AT91C_CAN_MB1_MDH EQU (0xFFFD0238) ;- (CAN_MB1) MailBox Data High Register -AT91C_CAN_MB1_MCR EQU (0xFFFD023C) ;- (CAN_MB1) MailBox Control Register -AT91C_CAN_MB1_MFID EQU (0xFFFD022C) ;- (CAN_MB1) MailBox Family ID Register -;- ========== Register definition for CAN_MB2 peripheral ========== -AT91C_CAN_MB2_MCR EQU (0xFFFD025C) ;- (CAN_MB2) MailBox Control Register -AT91C_CAN_MB2_MDH EQU (0xFFFD0258) ;- (CAN_MB2) MailBox Data High Register -AT91C_CAN_MB2_MID EQU (0xFFFD0248) ;- (CAN_MB2) MailBox ID Register -AT91C_CAN_MB2_MDL EQU (0xFFFD0254) ;- (CAN_MB2) MailBox Data Low Register -AT91C_CAN_MB2_MMR EQU (0xFFFD0240) ;- (CAN_MB2) MailBox Mode Register -AT91C_CAN_MB2_MAM EQU (0xFFFD0244) ;- (CAN_MB2) MailBox Acceptance Mask Register -AT91C_CAN_MB2_MFID EQU (0xFFFD024C) ;- (CAN_MB2) MailBox Family ID Register -AT91C_CAN_MB2_MSR EQU (0xFFFD0250) ;- (CAN_MB2) MailBox Status Register -;- ========== Register definition for CAN_MB3 peripheral ========== -AT91C_CAN_MB3_MFID EQU (0xFFFD026C) ;- (CAN_MB3) MailBox Family ID Register -AT91C_CAN_MB3_MAM EQU (0xFFFD0264) ;- (CAN_MB3) MailBox Acceptance Mask Register -AT91C_CAN_MB3_MID EQU (0xFFFD0268) ;- (CAN_MB3) MailBox ID Register -AT91C_CAN_MB3_MCR EQU (0xFFFD027C) ;- (CAN_MB3) MailBox Control Register -AT91C_CAN_MB3_MMR EQU (0xFFFD0260) ;- (CAN_MB3) MailBox Mode Register -AT91C_CAN_MB3_MSR EQU (0xFFFD0270) ;- (CAN_MB3) MailBox Status Register -AT91C_CAN_MB3_MDL EQU (0xFFFD0274) ;- (CAN_MB3) MailBox Data Low Register -AT91C_CAN_MB3_MDH EQU (0xFFFD0278) ;- (CAN_MB3) MailBox Data High Register -;- ========== Register definition for CAN_MB4 peripheral ========== -AT91C_CAN_MB4_MID EQU (0xFFFD0288) ;- (CAN_MB4) MailBox ID Register -AT91C_CAN_MB4_MMR EQU (0xFFFD0280) ;- (CAN_MB4) MailBox Mode Register -AT91C_CAN_MB4_MDH EQU (0xFFFD0298) ;- (CAN_MB4) MailBox Data High Register -AT91C_CAN_MB4_MFID EQU (0xFFFD028C) ;- (CAN_MB4) MailBox Family ID Register -AT91C_CAN_MB4_MSR EQU (0xFFFD0290) ;- (CAN_MB4) MailBox Status Register -AT91C_CAN_MB4_MCR EQU (0xFFFD029C) ;- (CAN_MB4) MailBox Control Register -AT91C_CAN_MB4_MDL EQU (0xFFFD0294) ;- (CAN_MB4) MailBox Data Low Register -AT91C_CAN_MB4_MAM EQU (0xFFFD0284) ;- (CAN_MB4) MailBox Acceptance Mask Register -;- ========== Register definition for CAN_MB5 peripheral ========== -AT91C_CAN_MB5_MSR EQU (0xFFFD02B0) ;- (CAN_MB5) MailBox Status Register -AT91C_CAN_MB5_MCR EQU (0xFFFD02BC) ;- (CAN_MB5) MailBox Control Register -AT91C_CAN_MB5_MFID EQU (0xFFFD02AC) ;- (CAN_MB5) MailBox Family ID Register -AT91C_CAN_MB5_MDH EQU (0xFFFD02B8) ;- (CAN_MB5) MailBox Data High Register -AT91C_CAN_MB5_MID EQU (0xFFFD02A8) ;- (CAN_MB5) MailBox ID Register -AT91C_CAN_MB5_MMR EQU (0xFFFD02A0) ;- (CAN_MB5) MailBox Mode Register -AT91C_CAN_MB5_MDL EQU (0xFFFD02B4) ;- (CAN_MB5) MailBox Data Low Register -AT91C_CAN_MB5_MAM EQU (0xFFFD02A4) ;- (CAN_MB5) MailBox Acceptance Mask Register -;- ========== Register definition for CAN_MB6 peripheral ========== -AT91C_CAN_MB6_MFID EQU (0xFFFD02CC) ;- (CAN_MB6) MailBox Family ID Register -AT91C_CAN_MB6_MID EQU (0xFFFD02C8) ;- (CAN_MB6) MailBox ID Register -AT91C_CAN_MB6_MAM EQU (0xFFFD02C4) ;- (CAN_MB6) MailBox Acceptance Mask Register -AT91C_CAN_MB6_MSR EQU (0xFFFD02D0) ;- (CAN_MB6) MailBox Status Register -AT91C_CAN_MB6_MDL EQU (0xFFFD02D4) ;- (CAN_MB6) MailBox Data Low Register -AT91C_CAN_MB6_MCR EQU (0xFFFD02DC) ;- (CAN_MB6) MailBox Control Register -AT91C_CAN_MB6_MDH EQU (0xFFFD02D8) ;- (CAN_MB6) MailBox Data High Register -AT91C_CAN_MB6_MMR EQU (0xFFFD02C0) ;- (CAN_MB6) MailBox Mode Register -;- ========== Register definition for CAN_MB7 peripheral ========== -AT91C_CAN_MB7_MCR EQU (0xFFFD02FC) ;- (CAN_MB7) MailBox Control Register -AT91C_CAN_MB7_MDH EQU (0xFFFD02F8) ;- (CAN_MB7) MailBox Data High Register -AT91C_CAN_MB7_MFID EQU (0xFFFD02EC) ;- (CAN_MB7) MailBox Family ID Register -AT91C_CAN_MB7_MDL EQU (0xFFFD02F4) ;- (CAN_MB7) MailBox Data Low Register -AT91C_CAN_MB7_MID EQU (0xFFFD02E8) ;- (CAN_MB7) MailBox ID Register -AT91C_CAN_MB7_MMR EQU (0xFFFD02E0) ;- (CAN_MB7) MailBox Mode Register -AT91C_CAN_MB7_MAM EQU (0xFFFD02E4) ;- (CAN_MB7) MailBox Acceptance Mask Register -AT91C_CAN_MB7_MSR EQU (0xFFFD02F0) ;- (CAN_MB7) MailBox Status Register -;- ========== Register definition for CAN peripheral ========== -AT91C_CAN_TCR EQU (0xFFFD0024) ;- (CAN) Transfer Command Register -AT91C_CAN_IMR EQU (0xFFFD000C) ;- (CAN) Interrupt Mask Register -AT91C_CAN_IER EQU (0xFFFD0004) ;- (CAN) Interrupt Enable Register -AT91C_CAN_ECR EQU (0xFFFD0020) ;- (CAN) Error Counter Register -AT91C_CAN_TIMESTP EQU (0xFFFD001C) ;- (CAN) Time Stamp Register -AT91C_CAN_MR EQU (0xFFFD0000) ;- (CAN) Mode Register -AT91C_CAN_IDR EQU (0xFFFD0008) ;- (CAN) Interrupt Disable Register -AT91C_CAN_ACR EQU (0xFFFD0028) ;- (CAN) Abort Command Register -AT91C_CAN_TIM EQU (0xFFFD0018) ;- (CAN) Timer Register -AT91C_CAN_SR EQU (0xFFFD0010) ;- (CAN) Status Register -AT91C_CAN_BR EQU (0xFFFD0014) ;- (CAN) Baudrate Register -AT91C_CAN_VR EQU (0xFFFD00FC) ;- (CAN) Version Register -;- ========== Register definition for EMAC peripheral ========== -AT91C_EMAC_ISR EQU (0xFFFDC024) ;- (EMAC) Interrupt Status Register -AT91C_EMAC_SA4H EQU (0xFFFDC0B4) ;- (EMAC) Specific Address 4 Top, Last 2 bytes -AT91C_EMAC_SA1L EQU (0xFFFDC098) ;- (EMAC) Specific Address 1 Bottom, First 4 bytes -AT91C_EMAC_ELE EQU (0xFFFDC078) ;- (EMAC) Excessive Length Errors Register -AT91C_EMAC_LCOL EQU (0xFFFDC05C) ;- (EMAC) Late Collision Register -AT91C_EMAC_RLE EQU (0xFFFDC088) ;- (EMAC) Receive Length Field Mismatch Register -AT91C_EMAC_WOL EQU (0xFFFDC0C4) ;- (EMAC) Wake On LAN Register -AT91C_EMAC_DTF EQU (0xFFFDC058) ;- (EMAC) Deferred Transmission Frame Register -AT91C_EMAC_TUND EQU (0xFFFDC064) ;- (EMAC) Transmit Underrun Error Register -AT91C_EMAC_NCR EQU (0xFFFDC000) ;- (EMAC) Network Control Register -AT91C_EMAC_SA4L EQU (0xFFFDC0B0) ;- (EMAC) Specific Address 4 Bottom, First 4 bytes -AT91C_EMAC_RSR EQU (0xFFFDC020) ;- (EMAC) Receive Status Register -AT91C_EMAC_SA3L EQU (0xFFFDC0A8) ;- (EMAC) Specific Address 3 Bottom, First 4 bytes -AT91C_EMAC_TSR EQU (0xFFFDC014) ;- (EMAC) Transmit Status Register -AT91C_EMAC_IDR EQU (0xFFFDC02C) ;- (EMAC) Interrupt Disable Register -AT91C_EMAC_RSE EQU (0xFFFDC074) ;- (EMAC) Receive Symbol Errors Register -AT91C_EMAC_ECOL EQU (0xFFFDC060) ;- (EMAC) Excessive Collision Register -AT91C_EMAC_TID EQU (0xFFFDC0B8) ;- (EMAC) Type ID Checking Register -AT91C_EMAC_HRB EQU (0xFFFDC090) ;- (EMAC) Hash Address Bottom[31:0] -AT91C_EMAC_TBQP EQU (0xFFFDC01C) ;- (EMAC) Transmit Buffer Queue Pointer -AT91C_EMAC_USRIO EQU (0xFFFDC0C0) ;- (EMAC) USER Input/Output Register -AT91C_EMAC_PTR EQU (0xFFFDC038) ;- (EMAC) Pause Time Register -AT91C_EMAC_SA2H EQU (0xFFFDC0A4) ;- (EMAC) Specific Address 2 Top, Last 2 bytes -AT91C_EMAC_ROV EQU (0xFFFDC070) ;- (EMAC) Receive Overrun Errors Register -AT91C_EMAC_ALE EQU (0xFFFDC054) ;- (EMAC) Alignment Error Register -AT91C_EMAC_RJA EQU (0xFFFDC07C) ;- (EMAC) Receive Jabbers Register -AT91C_EMAC_RBQP EQU (0xFFFDC018) ;- (EMAC) Receive Buffer Queue Pointer -AT91C_EMAC_TPF EQU (0xFFFDC08C) ;- (EMAC) Transmitted Pause Frames Register -AT91C_EMAC_NCFGR EQU (0xFFFDC004) ;- (EMAC) Network Configuration Register -AT91C_EMAC_HRT EQU (0xFFFDC094) ;- (EMAC) Hash Address Top[63:32] -AT91C_EMAC_USF EQU (0xFFFDC080) ;- (EMAC) Undersize Frames Register -AT91C_EMAC_FCSE EQU (0xFFFDC050) ;- (EMAC) Frame Check Sequence Error Register -AT91C_EMAC_TPQ EQU (0xFFFDC0BC) ;- (EMAC) Transmit Pause Quantum Register -AT91C_EMAC_MAN EQU (0xFFFDC034) ;- (EMAC) PHY Maintenance Register -AT91C_EMAC_FTO EQU (0xFFFDC040) ;- (EMAC) Frames Transmitted OK Register -AT91C_EMAC_REV EQU (0xFFFDC0FC) ;- (EMAC) Revision Register -AT91C_EMAC_IMR EQU (0xFFFDC030) ;- (EMAC) Interrupt Mask Register -AT91C_EMAC_SCF EQU (0xFFFDC044) ;- (EMAC) Single Collision Frame Register -AT91C_EMAC_PFR EQU (0xFFFDC03C) ;- (EMAC) Pause Frames received Register -AT91C_EMAC_MCF EQU (0xFFFDC048) ;- (EMAC) Multiple Collision Frame Register -AT91C_EMAC_NSR EQU (0xFFFDC008) ;- (EMAC) Network Status Register -AT91C_EMAC_SA2L EQU (0xFFFDC0A0) ;- (EMAC) Specific Address 2 Bottom, First 4 bytes -AT91C_EMAC_FRO EQU (0xFFFDC04C) ;- (EMAC) Frames Received OK Register -AT91C_EMAC_IER EQU (0xFFFDC028) ;- (EMAC) Interrupt Enable Register -AT91C_EMAC_SA1H EQU (0xFFFDC09C) ;- (EMAC) Specific Address 1 Top, Last 2 bytes -AT91C_EMAC_CSE EQU (0xFFFDC068) ;- (EMAC) Carrier Sense Error Register -AT91C_EMAC_SA3H EQU (0xFFFDC0AC) ;- (EMAC) Specific Address 3 Top, Last 2 bytes -AT91C_EMAC_RRE EQU (0xFFFDC06C) ;- (EMAC) Receive Ressource Error Register -AT91C_EMAC_STE EQU (0xFFFDC084) ;- (EMAC) SQE Test Error Register -;- ========== Register definition for PDC_ADC peripheral ========== -AT91C_ADC_PTSR EQU (0xFFFD8124) ;- (PDC_ADC) PDC Transfer Status Register -AT91C_ADC_PTCR EQU (0xFFFD8120) ;- (PDC_ADC) PDC Transfer Control Register -AT91C_ADC_TNPR EQU (0xFFFD8118) ;- (PDC_ADC) Transmit Next Pointer Register -AT91C_ADC_TNCR EQU (0xFFFD811C) ;- (PDC_ADC) Transmit Next Counter Register -AT91C_ADC_RNPR EQU (0xFFFD8110) ;- (PDC_ADC) Receive Next Pointer Register -AT91C_ADC_RNCR EQU (0xFFFD8114) ;- (PDC_ADC) Receive Next Counter Register -AT91C_ADC_RPR EQU (0xFFFD8100) ;- (PDC_ADC) Receive Pointer Register -AT91C_ADC_TCR EQU (0xFFFD810C) ;- (PDC_ADC) Transmit Counter Register -AT91C_ADC_TPR EQU (0xFFFD8108) ;- (PDC_ADC) Transmit Pointer Register -AT91C_ADC_RCR EQU (0xFFFD8104) ;- (PDC_ADC) Receive Counter Register -;- ========== Register definition for ADC peripheral ========== -AT91C_ADC_CDR2 EQU (0xFFFD8038) ;- (ADC) ADC Channel Data Register 2 -AT91C_ADC_CDR3 EQU (0xFFFD803C) ;- (ADC) ADC Channel Data Register 3 -AT91C_ADC_CDR0 EQU (0xFFFD8030) ;- (ADC) ADC Channel Data Register 0 -AT91C_ADC_CDR5 EQU (0xFFFD8044) ;- (ADC) ADC Channel Data Register 5 -AT91C_ADC_CHDR EQU (0xFFFD8014) ;- (ADC) ADC Channel Disable Register -AT91C_ADC_SR EQU (0xFFFD801C) ;- (ADC) ADC Status Register -AT91C_ADC_CDR4 EQU (0xFFFD8040) ;- (ADC) ADC Channel Data Register 4 -AT91C_ADC_CDR1 EQU (0xFFFD8034) ;- (ADC) ADC Channel Data Register 1 -AT91C_ADC_LCDR EQU (0xFFFD8020) ;- (ADC) ADC Last Converted Data Register -AT91C_ADC_IDR EQU (0xFFFD8028) ;- (ADC) ADC Interrupt Disable Register -AT91C_ADC_CR EQU (0xFFFD8000) ;- (ADC) ADC Control Register -AT91C_ADC_CDR7 EQU (0xFFFD804C) ;- (ADC) ADC Channel Data Register 7 -AT91C_ADC_CDR6 EQU (0xFFFD8048) ;- (ADC) ADC Channel Data Register 6 -AT91C_ADC_IER EQU (0xFFFD8024) ;- (ADC) ADC Interrupt Enable Register -AT91C_ADC_CHER EQU (0xFFFD8010) ;- (ADC) ADC Channel Enable Register -AT91C_ADC_CHSR EQU (0xFFFD8018) ;- (ADC) ADC Channel Status Register -AT91C_ADC_MR EQU (0xFFFD8004) ;- (ADC) ADC Mode Register -AT91C_ADC_IMR EQU (0xFFFD802C) ;- (ADC) ADC Interrupt Mask Register - -;- ***************************************************************************** -;- PIO DEFINITIONS FOR AT91SAM7X256 -;- ***************************************************************************** -AT91C_PIO_PA0 EQU (1:SHL:0) ;- Pin Controlled by PA0 -AT91C_PA0_RXD0 EQU (AT91C_PIO_PA0) ;- USART 0 Receive Data -AT91C_PIO_PA1 EQU (1:SHL:1) ;- Pin Controlled by PA1 -AT91C_PA1_TXD0 EQU (AT91C_PIO_PA1) ;- USART 0 Transmit Data -AT91C_PIO_PA10 EQU (1:SHL:10) ;- Pin Controlled by PA10 -AT91C_PA10_TWD EQU (AT91C_PIO_PA10) ;- TWI Two-wire Serial Data -AT91C_PIO_PA11 EQU (1:SHL:11) ;- Pin Controlled by PA11 -AT91C_PA11_TWCK EQU (AT91C_PIO_PA11) ;- TWI Two-wire Serial Clock -AT91C_PIO_PA12 EQU (1:SHL:12) ;- Pin Controlled by PA12 -AT91C_PA12_SPI0_NPCS0 EQU (AT91C_PIO_PA12) ;- SPI 0 Peripheral Chip Select 0 -AT91C_PIO_PA13 EQU (1:SHL:13) ;- Pin Controlled by PA13 -AT91C_PA13_SPI0_NPCS1 EQU (AT91C_PIO_PA13) ;- SPI 0 Peripheral Chip Select 1 -AT91C_PA13_PCK1 EQU (AT91C_PIO_PA13) ;- PMC Programmable Clock Output 1 -AT91C_PIO_PA14 EQU (1:SHL:14) ;- Pin Controlled by PA14 -AT91C_PA14_SPI0_NPCS2 EQU (AT91C_PIO_PA14) ;- SPI 0 Peripheral Chip Select 2 -AT91C_PA14_IRQ1 EQU (AT91C_PIO_PA14) ;- External Interrupt 1 -AT91C_PIO_PA15 EQU (1:SHL:15) ;- Pin Controlled by PA15 -AT91C_PA15_SPI0_NPCS3 EQU (AT91C_PIO_PA15) ;- SPI 0 Peripheral Chip Select 3 -AT91C_PA15_TCLK2 EQU (AT91C_PIO_PA15) ;- Timer Counter 2 external clock input -AT91C_PIO_PA16 EQU (1:SHL:16) ;- Pin Controlled by PA16 -AT91C_PA16_SPI0_MISO EQU (AT91C_PIO_PA16) ;- SPI 0 Master In Slave -AT91C_PIO_PA17 EQU (1:SHL:17) ;- Pin Controlled by PA17 -AT91C_PA17_SPI0_MOSI EQU (AT91C_PIO_PA17) ;- SPI 0 Master Out Slave -AT91C_PIO_PA18 EQU (1:SHL:18) ;- Pin Controlled by PA18 -AT91C_PA18_SPI0_SPCK EQU (AT91C_PIO_PA18) ;- SPI 0 Serial Clock -AT91C_PIO_PA19 EQU (1:SHL:19) ;- Pin Controlled by PA19 -AT91C_PA19_CANRX EQU (AT91C_PIO_PA19) ;- CAN Receive -AT91C_PIO_PA2 EQU (1:SHL:2) ;- Pin Controlled by PA2 -AT91C_PA2_SCK0 EQU (AT91C_PIO_PA2) ;- USART 0 Serial Clock -AT91C_PA2_SPI1_NPCS1 EQU (AT91C_PIO_PA2) ;- SPI 1 Peripheral Chip Select 1 -AT91C_PIO_PA20 EQU (1:SHL:20) ;- Pin Controlled by PA20 -AT91C_PA20_CANTX EQU (AT91C_PIO_PA20) ;- CAN Transmit -AT91C_PIO_PA21 EQU (1:SHL:21) ;- Pin Controlled by PA21 -AT91C_PA21_TF EQU (AT91C_PIO_PA21) ;- SSC Transmit Frame Sync -AT91C_PA21_SPI1_NPCS0 EQU (AT91C_PIO_PA21) ;- SPI 1 Peripheral Chip Select 0 -AT91C_PIO_PA22 EQU (1:SHL:22) ;- Pin Controlled by PA22 -AT91C_PA22_TK EQU (AT91C_PIO_PA22) ;- SSC Transmit Clock -AT91C_PA22_SPI1_SPCK EQU (AT91C_PIO_PA22) ;- SPI 1 Serial Clock -AT91C_PIO_PA23 EQU (1:SHL:23) ;- Pin Controlled by PA23 -AT91C_PA23_TD EQU (AT91C_PIO_PA23) ;- SSC Transmit data -AT91C_PA23_SPI1_MOSI EQU (AT91C_PIO_PA23) ;- SPI 1 Master Out Slave -AT91C_PIO_PA24 EQU (1:SHL:24) ;- Pin Controlled by PA24 -AT91C_PA24_RD EQU (AT91C_PIO_PA24) ;- SSC Receive Data -AT91C_PA24_SPI1_MISO EQU (AT91C_PIO_PA24) ;- SPI 1 Master In Slave -AT91C_PIO_PA25 EQU (1:SHL:25) ;- Pin Controlled by PA25 -AT91C_PA25_RK EQU (AT91C_PIO_PA25) ;- SSC Receive Clock -AT91C_PA25_SPI1_NPCS1 EQU (AT91C_PIO_PA25) ;- SPI 1 Peripheral Chip Select 1 -AT91C_PIO_PA26 EQU (1:SHL:26) ;- Pin Controlled by PA26 -AT91C_PA26_RF EQU (AT91C_PIO_PA26) ;- SSC Receive Frame Sync -AT91C_PA26_SPI1_NPCS2 EQU (AT91C_PIO_PA26) ;- SPI 1 Peripheral Chip Select 2 -AT91C_PIO_PA27 EQU (1:SHL:27) ;- Pin Controlled by PA27 -AT91C_PA27_DRXD EQU (AT91C_PIO_PA27) ;- DBGU Debug Receive Data -AT91C_PA27_PCK3 EQU (AT91C_PIO_PA27) ;- PMC Programmable Clock Output 3 -AT91C_PIO_PA28 EQU (1:SHL:28) ;- Pin Controlled by PA28 -AT91C_PA28_DTXD EQU (AT91C_PIO_PA28) ;- DBGU Debug Transmit Data -AT91C_PIO_PA29 EQU (1:SHL:29) ;- Pin Controlled by PA29 -AT91C_PA29_FIQ EQU (AT91C_PIO_PA29) ;- AIC Fast Interrupt Input -AT91C_PA29_SPI1_NPCS3 EQU (AT91C_PIO_PA29) ;- SPI 1 Peripheral Chip Select 3 -AT91C_PIO_PA3 EQU (1:SHL:3) ;- Pin Controlled by PA3 -AT91C_PA3_RTS0 EQU (AT91C_PIO_PA3) ;- USART 0 Ready To Send -AT91C_PA3_SPI1_NPCS2 EQU (AT91C_PIO_PA3) ;- SPI 1 Peripheral Chip Select 2 -AT91C_PIO_PA30 EQU (1:SHL:30) ;- Pin Controlled by PA30 -AT91C_PA30_IRQ0 EQU (AT91C_PIO_PA30) ;- External Interrupt 0 -AT91C_PA30_PCK2 EQU (AT91C_PIO_PA30) ;- PMC Programmable Clock Output 2 -AT91C_PIO_PA4 EQU (1:SHL:4) ;- Pin Controlled by PA4 -AT91C_PA4_CTS0 EQU (AT91C_PIO_PA4) ;- USART 0 Clear To Send -AT91C_PA4_SPI1_NPCS3 EQU (AT91C_PIO_PA4) ;- SPI 1 Peripheral Chip Select 3 -AT91C_PIO_PA5 EQU (1:SHL:5) ;- Pin Controlled by PA5 -AT91C_PA5_RXD1 EQU (AT91C_PIO_PA5) ;- USART 1 Receive Data -AT91C_PIO_PA6 EQU (1:SHL:6) ;- Pin Controlled by PA6 -AT91C_PA6_TXD1 EQU (AT91C_PIO_PA6) ;- USART 1 Transmit Data -AT91C_PIO_PA7 EQU (1:SHL:7) ;- Pin Controlled by PA7 -AT91C_PA7_SCK1 EQU (AT91C_PIO_PA7) ;- USART 1 Serial Clock -AT91C_PA7_SPI0_NPCS1 EQU (AT91C_PIO_PA7) ;- SPI 0 Peripheral Chip Select 1 -AT91C_PIO_PA8 EQU (1:SHL:8) ;- Pin Controlled by PA8 -AT91C_PA8_RTS1 EQU (AT91C_PIO_PA8) ;- USART 1 Ready To Send -AT91C_PA8_SPI0_NPCS2 EQU (AT91C_PIO_PA8) ;- SPI 0 Peripheral Chip Select 2 -AT91C_PIO_PA9 EQU (1:SHL:9) ;- Pin Controlled by PA9 -AT91C_PA9_CTS1 EQU (AT91C_PIO_PA9) ;- USART 1 Clear To Send -AT91C_PA9_SPI0_NPCS3 EQU (AT91C_PIO_PA9) ;- SPI 0 Peripheral Chip Select 3 -AT91C_PIO_PB0 EQU (1:SHL:0) ;- Pin Controlled by PB0 -AT91C_PB0_ETXCK_EREFCK EQU (AT91C_PIO_PB0) ;- Ethernet MAC Transmit Clock/Reference Clock -AT91C_PB0_PCK0 EQU (AT91C_PIO_PB0) ;- PMC Programmable Clock Output 0 -AT91C_PIO_PB1 EQU (1:SHL:1) ;- Pin Controlled by PB1 -AT91C_PB1_ETXEN EQU (AT91C_PIO_PB1) ;- Ethernet MAC Transmit Enable -AT91C_PIO_PB10 EQU (1:SHL:10) ;- Pin Controlled by PB10 -AT91C_PB10_ETX2 EQU (AT91C_PIO_PB10) ;- Ethernet MAC Transmit Data 2 -AT91C_PB10_SPI1_NPCS1 EQU (AT91C_PIO_PB10) ;- SPI 1 Peripheral Chip Select 1 -AT91C_PIO_PB11 EQU (1:SHL:11) ;- Pin Controlled by PB11 -AT91C_PB11_ETX3 EQU (AT91C_PIO_PB11) ;- Ethernet MAC Transmit Data 3 -AT91C_PB11_SPI1_NPCS2 EQU (AT91C_PIO_PB11) ;- SPI 1 Peripheral Chip Select 2 -AT91C_PIO_PB12 EQU (1:SHL:12) ;- Pin Controlled by PB12 -AT91C_PB12_ETXER EQU (AT91C_PIO_PB12) ;- Ethernet MAC Transmikt Coding Error -AT91C_PB12_TCLK0 EQU (AT91C_PIO_PB12) ;- Timer Counter 0 external clock input -AT91C_PIO_PB13 EQU (1:SHL:13) ;- Pin Controlled by PB13 -AT91C_PB13_ERX2 EQU (AT91C_PIO_PB13) ;- Ethernet MAC Receive Data 2 -AT91C_PB13_SPI0_NPCS1 EQU (AT91C_PIO_PB13) ;- SPI 0 Peripheral Chip Select 1 -AT91C_PIO_PB14 EQU (1:SHL:14) ;- Pin Controlled by PB14 -AT91C_PB14_ERX3 EQU (AT91C_PIO_PB14) ;- Ethernet MAC Receive Data 3 -AT91C_PB14_SPI0_NPCS2 EQU (AT91C_PIO_PB14) ;- SPI 0 Peripheral Chip Select 2 -AT91C_PIO_PB15 EQU (1:SHL:15) ;- Pin Controlled by PB15 -AT91C_PB15_ERXDV_ECRSDV EQU (AT91C_PIO_PB15) ;- Ethernet MAC Receive Data Valid -AT91C_PIO_PB16 EQU (1:SHL:16) ;- Pin Controlled by PB16 -AT91C_PB16_ECOL EQU (AT91C_PIO_PB16) ;- Ethernet MAC Collision Detected -AT91C_PB16_SPI1_NPCS3 EQU (AT91C_PIO_PB16) ;- SPI 1 Peripheral Chip Select 3 -AT91C_PIO_PB17 EQU (1:SHL:17) ;- Pin Controlled by PB17 -AT91C_PB17_ERXCK EQU (AT91C_PIO_PB17) ;- Ethernet MAC Receive Clock -AT91C_PB17_SPI0_NPCS3 EQU (AT91C_PIO_PB17) ;- SPI 0 Peripheral Chip Select 3 -AT91C_PIO_PB18 EQU (1:SHL:18) ;- Pin Controlled by PB18 -AT91C_PB18_EF100 EQU (AT91C_PIO_PB18) ;- Ethernet MAC Force 100 Mbits/sec -AT91C_PB18_ADTRG EQU (AT91C_PIO_PB18) ;- ADC External Trigger -AT91C_PIO_PB19 EQU (1:SHL:19) ;- Pin Controlled by PB19 -AT91C_PB19_PWM0 EQU (AT91C_PIO_PB19) ;- PWM Channel 0 -AT91C_PB19_TCLK1 EQU (AT91C_PIO_PB19) ;- Timer Counter 1 external clock input -AT91C_PIO_PB2 EQU (1:SHL:2) ;- Pin Controlled by PB2 -AT91C_PB2_ETX0 EQU (AT91C_PIO_PB2) ;- Ethernet MAC Transmit Data 0 -AT91C_PIO_PB20 EQU (1:SHL:20) ;- Pin Controlled by PB20 -AT91C_PB20_PWM1 EQU (AT91C_PIO_PB20) ;- PWM Channel 1 -AT91C_PB20_PCK0 EQU (AT91C_PIO_PB20) ;- PMC Programmable Clock Output 0 -AT91C_PIO_PB21 EQU (1:SHL:21) ;- Pin Controlled by PB21 -AT91C_PB21_PWM2 EQU (AT91C_PIO_PB21) ;- PWM Channel 2 -AT91C_PB21_PCK1 EQU (AT91C_PIO_PB21) ;- PMC Programmable Clock Output 1 -AT91C_PIO_PB22 EQU (1:SHL:22) ;- Pin Controlled by PB22 -AT91C_PB22_PWM3 EQU (AT91C_PIO_PB22) ;- PWM Channel 3 -AT91C_PB22_PCK2 EQU (AT91C_PIO_PB22) ;- PMC Programmable Clock Output 2 -AT91C_PIO_PB23 EQU (1:SHL:23) ;- Pin Controlled by PB23 -AT91C_PB23_TIOA0 EQU (AT91C_PIO_PB23) ;- Timer Counter 0 Multipurpose Timer I/O Pin A -AT91C_PB23_DCD1 EQU (AT91C_PIO_PB23) ;- USART 1 Data Carrier Detect -AT91C_PIO_PB24 EQU (1:SHL:24) ;- Pin Controlled by PB24 -AT91C_PB24_TIOB0 EQU (AT91C_PIO_PB24) ;- Timer Counter 0 Multipurpose Timer I/O Pin B -AT91C_PB24_DSR1 EQU (AT91C_PIO_PB24) ;- USART 1 Data Set ready -AT91C_PIO_PB25 EQU (1:SHL:25) ;- Pin Controlled by PB25 -AT91C_PB25_TIOA1 EQU (AT91C_PIO_PB25) ;- Timer Counter 1 Multipurpose Timer I/O Pin A -AT91C_PB25_DTR1 EQU (AT91C_PIO_PB25) ;- USART 1 Data Terminal ready -AT91C_PIO_PB26 EQU (1:SHL:26) ;- Pin Controlled by PB26 -AT91C_PB26_TIOB1 EQU (AT91C_PIO_PB26) ;- Timer Counter 1 Multipurpose Timer I/O Pin B -AT91C_PB26_RI1 EQU (AT91C_PIO_PB26) ;- USART 1 Ring Indicator -AT91C_PIO_PB27 EQU (1:SHL:27) ;- Pin Controlled by PB27 -AT91C_PB27_TIOA2 EQU (AT91C_PIO_PB27) ;- Timer Counter 2 Multipurpose Timer I/O Pin A -AT91C_PB27_PWM0 EQU (AT91C_PIO_PB27) ;- PWM Channel 0 -AT91C_PIO_PB28 EQU (1:SHL:28) ;- Pin Controlled by PB28 -AT91C_PB28_TIOB2 EQU (AT91C_PIO_PB28) ;- Timer Counter 2 Multipurpose Timer I/O Pin B -AT91C_PB28_PWM1 EQU (AT91C_PIO_PB28) ;- PWM Channel 1 -AT91C_PIO_PB29 EQU (1:SHL:29) ;- Pin Controlled by PB29 -AT91C_PB29_PCK1 EQU (AT91C_PIO_PB29) ;- PMC Programmable Clock Output 1 -AT91C_PB29_PWM2 EQU (AT91C_PIO_PB29) ;- PWM Channel 2 -AT91C_PIO_PB3 EQU (1:SHL:3) ;- Pin Controlled by PB3 -AT91C_PB3_ETX1 EQU (AT91C_PIO_PB3) ;- Ethernet MAC Transmit Data 1 -AT91C_PIO_PB30 EQU (1:SHL:30) ;- Pin Controlled by PB30 -AT91C_PB30_PCK2 EQU (AT91C_PIO_PB30) ;- PMC Programmable Clock Output 2 -AT91C_PB30_PWM3 EQU (AT91C_PIO_PB30) ;- PWM Channel 3 -AT91C_PIO_PB4 EQU (1:SHL:4) ;- Pin Controlled by PB4 -AT91C_PB4_ECRS EQU (AT91C_PIO_PB4) ;- Ethernet MAC Carrier Sense/Carrier Sense and Data Valid -AT91C_PIO_PB5 EQU (1:SHL:5) ;- Pin Controlled by PB5 -AT91C_PB5_ERX0 EQU (AT91C_PIO_PB5) ;- Ethernet MAC Receive Data 0 -AT91C_PIO_PB6 EQU (1:SHL:6) ;- Pin Controlled by PB6 -AT91C_PB6_ERX1 EQU (AT91C_PIO_PB6) ;- Ethernet MAC Receive Data 1 -AT91C_PIO_PB7 EQU (1:SHL:7) ;- Pin Controlled by PB7 -AT91C_PB7_ERXER EQU (AT91C_PIO_PB7) ;- Ethernet MAC Receive Error -AT91C_PIO_PB8 EQU (1:SHL:8) ;- Pin Controlled by PB8 -AT91C_PB8_EMDC EQU (AT91C_PIO_PB8) ;- Ethernet MAC Management Data Clock -AT91C_PIO_PB9 EQU (1:SHL:9) ;- Pin Controlled by PB9 -AT91C_PB9_EMDIO EQU (AT91C_PIO_PB9) ;- Ethernet MAC Management Data Input/Output - -;- ***************************************************************************** -;- PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 -;- ***************************************************************************** -AT91C_ID_FIQ EQU ( 0) ;- Advanced Interrupt Controller (FIQ) -AT91C_ID_SYS EQU ( 1) ;- System Peripheral -AT91C_ID_PIOA EQU ( 2) ;- Parallel IO Controller A -AT91C_ID_PIOB EQU ( 3) ;- Parallel IO Controller B -AT91C_ID_SPI0 EQU ( 4) ;- Serial Peripheral Interface 0 -AT91C_ID_SPI1 EQU ( 5) ;- Serial Peripheral Interface 1 -AT91C_ID_US0 EQU ( 6) ;- USART 0 -AT91C_ID_US1 EQU ( 7) ;- USART 1 -AT91C_ID_SSC EQU ( 8) ;- Serial Synchronous Controller -AT91C_ID_TWI EQU ( 9) ;- Two-Wire Interface -AT91C_ID_PWMC EQU (10) ;- PWM Controller -AT91C_ID_UDP EQU (11) ;- USB Device Port -AT91C_ID_TC0 EQU (12) ;- Timer Counter 0 -AT91C_ID_TC1 EQU (13) ;- Timer Counter 1 -AT91C_ID_TC2 EQU (14) ;- Timer Counter 2 -AT91C_ID_CAN EQU (15) ;- Control Area Network Controller -AT91C_ID_EMAC EQU (16) ;- Ethernet MAC -AT91C_ID_ADC EQU (17) ;- Analog-to-Digital Converter -AT91C_ID_18_Reserved EQU (18) ;- Reserved -AT91C_ID_19_Reserved EQU (19) ;- Reserved -AT91C_ID_20_Reserved EQU (20) ;- Reserved -AT91C_ID_21_Reserved EQU (21) ;- Reserved -AT91C_ID_22_Reserved EQU (22) ;- Reserved -AT91C_ID_23_Reserved EQU (23) ;- Reserved -AT91C_ID_24_Reserved EQU (24) ;- Reserved -AT91C_ID_25_Reserved EQU (25) ;- Reserved -AT91C_ID_26_Reserved EQU (26) ;- Reserved -AT91C_ID_27_Reserved EQU (27) ;- Reserved -AT91C_ID_28_Reserved EQU (28) ;- Reserved -AT91C_ID_29_Reserved EQU (29) ;- Reserved -AT91C_ID_IRQ0 EQU (30) ;- Advanced Interrupt Controller (IRQ0) -AT91C_ID_IRQ1 EQU (31) ;- Advanced Interrupt Controller (IRQ1) -AT91C_ALL_INT EQU (0xC003FFFF) ;- ALL VALID INTERRUPTS - -;- ***************************************************************************** -;- BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 -;- ***************************************************************************** -AT91C_BASE_SYS EQU (0xFFFFF000) ;- (SYS) Base Address -AT91C_BASE_AIC EQU (0xFFFFF000) ;- (AIC) Base Address -AT91C_BASE_PDC_DBGU EQU (0xFFFFF300) ;- (PDC_DBGU) Base Address -AT91C_BASE_DBGU EQU (0xFFFFF200) ;- (DBGU) Base Address -AT91C_BASE_PIOA EQU (0xFFFFF400) ;- (PIOA) Base Address -AT91C_BASE_PIOB EQU (0xFFFFF600) ;- (PIOB) Base Address -AT91C_BASE_CKGR EQU (0xFFFFFC20) ;- (CKGR) Base Address -AT91C_BASE_PMC EQU (0xFFFFFC00) ;- (PMC) Base Address -AT91C_BASE_RSTC EQU (0xFFFFFD00) ;- (RSTC) Base Address -AT91C_BASE_RTTC EQU (0xFFFFFD20) ;- (RTTC) Base Address -AT91C_BASE_PITC EQU (0xFFFFFD30) ;- (PITC) Base Address -AT91C_BASE_WDTC EQU (0xFFFFFD40) ;- (WDTC) Base Address -AT91C_BASE_VREG EQU (0xFFFFFD60) ;- (VREG) Base Address -AT91C_BASE_MC EQU (0xFFFFFF00) ;- (MC) Base Address -AT91C_BASE_PDC_SPI1 EQU (0xFFFE4100) ;- (PDC_SPI1) Base Address -AT91C_BASE_SPI1 EQU (0xFFFE4000) ;- (SPI1) Base Address -AT91C_BASE_PDC_SPI0 EQU (0xFFFE0100) ;- (PDC_SPI0) Base Address -AT91C_BASE_SPI0 EQU (0xFFFE0000) ;- (SPI0) Base Address -AT91C_BASE_PDC_US1 EQU (0xFFFC4100) ;- (PDC_US1) Base Address -AT91C_BASE_US1 EQU (0xFFFC4000) ;- (US1) Base Address -AT91C_BASE_PDC_US0 EQU (0xFFFC0100) ;- (PDC_US0) Base Address -AT91C_BASE_US0 EQU (0xFFFC0000) ;- (US0) Base Address -AT91C_BASE_PDC_SSC EQU (0xFFFD4100) ;- (PDC_SSC) Base Address -AT91C_BASE_SSC EQU (0xFFFD4000) ;- (SSC) Base Address -AT91C_BASE_TWI EQU (0xFFFB8000) ;- (TWI) Base Address -AT91C_BASE_PWMC_CH3 EQU (0xFFFCC260) ;- (PWMC_CH3) Base Address -AT91C_BASE_PWMC_CH2 EQU (0xFFFCC240) ;- (PWMC_CH2) Base Address -AT91C_BASE_PWMC_CH1 EQU (0xFFFCC220) ;- (PWMC_CH1) Base Address -AT91C_BASE_PWMC_CH0 EQU (0xFFFCC200) ;- (PWMC_CH0) Base Address -AT91C_BASE_PWMC EQU (0xFFFCC000) ;- (PWMC) Base Address -AT91C_BASE_UDP EQU (0xFFFB0000) ;- (UDP) Base Address -AT91C_BASE_TC0 EQU (0xFFFA0000) ;- (TC0) Base Address -AT91C_BASE_TC1 EQU (0xFFFA0040) ;- (TC1) Base Address -AT91C_BASE_TC2 EQU (0xFFFA0080) ;- (TC2) Base Address -AT91C_BASE_TCB EQU (0xFFFA0000) ;- (TCB) Base Address -AT91C_BASE_CAN_MB0 EQU (0xFFFD0200) ;- (CAN_MB0) Base Address -AT91C_BASE_CAN_MB1 EQU (0xFFFD0220) ;- (CAN_MB1) Base Address -AT91C_BASE_CAN_MB2 EQU (0xFFFD0240) ;- (CAN_MB2) Base Address -AT91C_BASE_CAN_MB3 EQU (0xFFFD0260) ;- (CAN_MB3) Base Address -AT91C_BASE_CAN_MB4 EQU (0xFFFD0280) ;- (CAN_MB4) Base Address -AT91C_BASE_CAN_MB5 EQU (0xFFFD02A0) ;- (CAN_MB5) Base Address -AT91C_BASE_CAN_MB6 EQU (0xFFFD02C0) ;- (CAN_MB6) Base Address -AT91C_BASE_CAN_MB7 EQU (0xFFFD02E0) ;- (CAN_MB7) Base Address -AT91C_BASE_CAN EQU (0xFFFD0000) ;- (CAN) Base Address -AT91C_BASE_EMAC EQU (0xFFFDC000) ;- (EMAC) Base Address -AT91C_BASE_PDC_ADC EQU (0xFFFD8100) ;- (PDC_ADC) Base Address -AT91C_BASE_ADC EQU (0xFFFD8000) ;- (ADC) Base Address - -;- ***************************************************************************** -;- MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 -;- ***************************************************************************** -;- ISRAM -AT91C_ISRAM EQU (0x00200000) ;- Internal SRAM base address -AT91C_ISRAM_SIZE EQU (0x00010000) ;- Internal SRAM size in byte (64 Kbytes) -;- IFLASH -AT91C_IFLASH EQU (0x00100000) ;- Internal FLASH base address -AT91C_IFLASH_SIZE EQU (0x00040000) ;- Internal FLASH size in byte (256 Kbytes) -AT91C_IFLASH_PAGE_SIZE EQU (256) ;- Internal FLASH Page Size: 256 bytes -AT91C_IFLASH_LOCK_REGION_SIZE EQU (16384) ;- Internal FLASH Lock Region Size: 16 Kbytes -AT91C_IFLASH_NB_OF_PAGES EQU (1024) ;- Internal FLASH Number of Pages: 1024 bytes -AT91C_IFLASH_NB_OF_LOCK_BITS EQU (16) ;- Internal FLASH Number of Lock Bits: 16 bytes - - - END diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.rdf b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.rdf deleted file mode 100644 index 7668f5b4f..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.rdf +++ /dev/null @@ -1,4704 +0,0 @@ -# ---------------------------------------------------------------------------- -# ATMEL Microcontroller Software Support - ROUSSET - -# ---------------------------------------------------------------------------- -# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -# DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h -# Object : AT91SAM7X256 definitions -# Generated : AT91 SW Application Group 11/02/2005 (15:17:24) -# -# CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// -# CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// -# CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// -# CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// -# CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// -# CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// -# CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// -# CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// -# CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// -# CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// -# CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// -# CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// -# CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// -# CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// -# CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// -# CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// -# CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// -# CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// -# CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// -# CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// -# CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// -# CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// -# CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// -# ---------------------------------------------------------------------------- - -rdf.version=1 - -~sysinclude=arm_default.rdf -~sysinclude=arm_status.rdf -# ========== Register definition for SYS peripheral ========== -# ========== Register definition for AIC peripheral ========== -AT91C_AIC_IVR.name="AT91C_AIC_IVR" -AT91C_AIC_IVR.description="IRQ Vector Register" -AT91C_AIC_IVR.helpkey="IRQ Vector Register" -AT91C_AIC_IVR.access=memorymapped -AT91C_AIC_IVR.address=0xFFFFF100 -AT91C_AIC_IVR.width=32 -AT91C_AIC_IVR.byteEndian=little -AT91C_AIC_IVR.permission.write=none -AT91C_AIC_SMR.name="AT91C_AIC_SMR" -AT91C_AIC_SMR.description="Source Mode Register" -AT91C_AIC_SMR.helpkey="Source Mode Register" -AT91C_AIC_SMR.access=memorymapped -AT91C_AIC_SMR.address=0xFFFFF000 -AT91C_AIC_SMR.width=32 -AT91C_AIC_SMR.byteEndian=little -AT91C_AIC_FVR.name="AT91C_AIC_FVR" -AT91C_AIC_FVR.description="FIQ Vector Register" -AT91C_AIC_FVR.helpkey="FIQ Vector Register" -AT91C_AIC_FVR.access=memorymapped -AT91C_AIC_FVR.address=0xFFFFF104 -AT91C_AIC_FVR.width=32 -AT91C_AIC_FVR.byteEndian=little -AT91C_AIC_FVR.permission.write=none -AT91C_AIC_DCR.name="AT91C_AIC_DCR" -AT91C_AIC_DCR.description="Debug Control Register (Protect)" -AT91C_AIC_DCR.helpkey="Debug Control Register (Protect)" -AT91C_AIC_DCR.access=memorymapped -AT91C_AIC_DCR.address=0xFFFFF138 -AT91C_AIC_DCR.width=32 -AT91C_AIC_DCR.byteEndian=little -AT91C_AIC_EOICR.name="AT91C_AIC_EOICR" -AT91C_AIC_EOICR.description="End of Interrupt Command Register" -AT91C_AIC_EOICR.helpkey="End of Interrupt Command Register" -AT91C_AIC_EOICR.access=memorymapped -AT91C_AIC_EOICR.address=0xFFFFF130 -AT91C_AIC_EOICR.width=32 -AT91C_AIC_EOICR.byteEndian=little -AT91C_AIC_EOICR.type=enum -AT91C_AIC_EOICR.enum.0.name=*** Write only *** -AT91C_AIC_EOICR.enum.1.name=Error -AT91C_AIC_SVR.name="AT91C_AIC_SVR" -AT91C_AIC_SVR.description="Source Vector Register" -AT91C_AIC_SVR.helpkey="Source Vector Register" -AT91C_AIC_SVR.access=memorymapped -AT91C_AIC_SVR.address=0xFFFFF080 -AT91C_AIC_SVR.width=32 -AT91C_AIC_SVR.byteEndian=little -AT91C_AIC_FFSR.name="AT91C_AIC_FFSR" -AT91C_AIC_FFSR.description="Fast Forcing Status Register" -AT91C_AIC_FFSR.helpkey="Fast Forcing Status Register" -AT91C_AIC_FFSR.access=memorymapped -AT91C_AIC_FFSR.address=0xFFFFF148 -AT91C_AIC_FFSR.width=32 -AT91C_AIC_FFSR.byteEndian=little -AT91C_AIC_FFSR.permission.write=none -AT91C_AIC_ICCR.name="AT91C_AIC_ICCR" -AT91C_AIC_ICCR.description="Interrupt Clear Command Register" -AT91C_AIC_ICCR.helpkey="Interrupt Clear Command Register" -AT91C_AIC_ICCR.access=memorymapped -AT91C_AIC_ICCR.address=0xFFFFF128 -AT91C_AIC_ICCR.width=32 -AT91C_AIC_ICCR.byteEndian=little -AT91C_AIC_ICCR.type=enum -AT91C_AIC_ICCR.enum.0.name=*** Write only *** -AT91C_AIC_ICCR.enum.1.name=Error -AT91C_AIC_ISR.name="AT91C_AIC_ISR" -AT91C_AIC_ISR.description="Interrupt Status Register" -AT91C_AIC_ISR.helpkey="Interrupt Status Register" -AT91C_AIC_ISR.access=memorymapped -AT91C_AIC_ISR.address=0xFFFFF108 -AT91C_AIC_ISR.width=32 -AT91C_AIC_ISR.byteEndian=little -AT91C_AIC_ISR.permission.write=none -AT91C_AIC_IMR.name="AT91C_AIC_IMR" -AT91C_AIC_IMR.description="Interrupt Mask Register" -AT91C_AIC_IMR.helpkey="Interrupt Mask Register" -AT91C_AIC_IMR.access=memorymapped -AT91C_AIC_IMR.address=0xFFFFF110 -AT91C_AIC_IMR.width=32 -AT91C_AIC_IMR.byteEndian=little -AT91C_AIC_IMR.permission.write=none -AT91C_AIC_IPR.name="AT91C_AIC_IPR" -AT91C_AIC_IPR.description="Interrupt Pending Register" -AT91C_AIC_IPR.helpkey="Interrupt Pending Register" -AT91C_AIC_IPR.access=memorymapped -AT91C_AIC_IPR.address=0xFFFFF10C -AT91C_AIC_IPR.width=32 -AT91C_AIC_IPR.byteEndian=little -AT91C_AIC_IPR.permission.write=none -AT91C_AIC_FFER.name="AT91C_AIC_FFER" -AT91C_AIC_FFER.description="Fast Forcing Enable Register" -AT91C_AIC_FFER.helpkey="Fast Forcing Enable Register" -AT91C_AIC_FFER.access=memorymapped -AT91C_AIC_FFER.address=0xFFFFF140 -AT91C_AIC_FFER.width=32 -AT91C_AIC_FFER.byteEndian=little -AT91C_AIC_FFER.type=enum -AT91C_AIC_FFER.enum.0.name=*** Write only *** -AT91C_AIC_FFER.enum.1.name=Error -AT91C_AIC_IECR.name="AT91C_AIC_IECR" -AT91C_AIC_IECR.description="Interrupt Enable Command Register" -AT91C_AIC_IECR.helpkey="Interrupt Enable Command Register" -AT91C_AIC_IECR.access=memorymapped -AT91C_AIC_IECR.address=0xFFFFF120 -AT91C_AIC_IECR.width=32 -AT91C_AIC_IECR.byteEndian=little -AT91C_AIC_IECR.type=enum -AT91C_AIC_IECR.enum.0.name=*** Write only *** -AT91C_AIC_IECR.enum.1.name=Error -AT91C_AIC_ISCR.name="AT91C_AIC_ISCR" -AT91C_AIC_ISCR.description="Interrupt Set Command Register" -AT91C_AIC_ISCR.helpkey="Interrupt Set Command Register" -AT91C_AIC_ISCR.access=memorymapped -AT91C_AIC_ISCR.address=0xFFFFF12C -AT91C_AIC_ISCR.width=32 -AT91C_AIC_ISCR.byteEndian=little -AT91C_AIC_ISCR.type=enum -AT91C_AIC_ISCR.enum.0.name=*** Write only *** -AT91C_AIC_ISCR.enum.1.name=Error -AT91C_AIC_FFDR.name="AT91C_AIC_FFDR" -AT91C_AIC_FFDR.description="Fast Forcing Disable Register" -AT91C_AIC_FFDR.helpkey="Fast Forcing Disable Register" -AT91C_AIC_FFDR.access=memorymapped -AT91C_AIC_FFDR.address=0xFFFFF144 -AT91C_AIC_FFDR.width=32 -AT91C_AIC_FFDR.byteEndian=little -AT91C_AIC_FFDR.type=enum -AT91C_AIC_FFDR.enum.0.name=*** Write only *** -AT91C_AIC_FFDR.enum.1.name=Error -AT91C_AIC_CISR.name="AT91C_AIC_CISR" -AT91C_AIC_CISR.description="Core Interrupt Status Register" -AT91C_AIC_CISR.helpkey="Core Interrupt Status Register" -AT91C_AIC_CISR.access=memorymapped -AT91C_AIC_CISR.address=0xFFFFF114 -AT91C_AIC_CISR.width=32 -AT91C_AIC_CISR.byteEndian=little -AT91C_AIC_CISR.permission.write=none -AT91C_AIC_IDCR.name="AT91C_AIC_IDCR" -AT91C_AIC_IDCR.description="Interrupt Disable Command Register" -AT91C_AIC_IDCR.helpkey="Interrupt Disable Command Register" -AT91C_AIC_IDCR.access=memorymapped -AT91C_AIC_IDCR.address=0xFFFFF124 -AT91C_AIC_IDCR.width=32 -AT91C_AIC_IDCR.byteEndian=little -AT91C_AIC_IDCR.type=enum -AT91C_AIC_IDCR.enum.0.name=*** Write only *** -AT91C_AIC_IDCR.enum.1.name=Error -AT91C_AIC_SPU.name="AT91C_AIC_SPU" -AT91C_AIC_SPU.description="Spurious Vector Register" -AT91C_AIC_SPU.helpkey="Spurious Vector Register" -AT91C_AIC_SPU.access=memorymapped -AT91C_AIC_SPU.address=0xFFFFF134 -AT91C_AIC_SPU.width=32 -AT91C_AIC_SPU.byteEndian=little -# ========== Register definition for PDC_DBGU peripheral ========== -AT91C_DBGU_TCR.name="AT91C_DBGU_TCR" -AT91C_DBGU_TCR.description="Transmit Counter Register" -AT91C_DBGU_TCR.helpkey="Transmit Counter Register" -AT91C_DBGU_TCR.access=memorymapped -AT91C_DBGU_TCR.address=0xFFFFF30C -AT91C_DBGU_TCR.width=32 -AT91C_DBGU_TCR.byteEndian=little -AT91C_DBGU_RNPR.name="AT91C_DBGU_RNPR" -AT91C_DBGU_RNPR.description="Receive Next Pointer Register" -AT91C_DBGU_RNPR.helpkey="Receive Next Pointer Register" -AT91C_DBGU_RNPR.access=memorymapped -AT91C_DBGU_RNPR.address=0xFFFFF310 -AT91C_DBGU_RNPR.width=32 -AT91C_DBGU_RNPR.byteEndian=little -AT91C_DBGU_TNPR.name="AT91C_DBGU_TNPR" -AT91C_DBGU_TNPR.description="Transmit Next Pointer Register" -AT91C_DBGU_TNPR.helpkey="Transmit Next Pointer Register" -AT91C_DBGU_TNPR.access=memorymapped -AT91C_DBGU_TNPR.address=0xFFFFF318 -AT91C_DBGU_TNPR.width=32 -AT91C_DBGU_TNPR.byteEndian=little -AT91C_DBGU_TPR.name="AT91C_DBGU_TPR" -AT91C_DBGU_TPR.description="Transmit Pointer Register" -AT91C_DBGU_TPR.helpkey="Transmit Pointer Register" -AT91C_DBGU_TPR.access=memorymapped -AT91C_DBGU_TPR.address=0xFFFFF308 -AT91C_DBGU_TPR.width=32 -AT91C_DBGU_TPR.byteEndian=little -AT91C_DBGU_RPR.name="AT91C_DBGU_RPR" -AT91C_DBGU_RPR.description="Receive Pointer Register" -AT91C_DBGU_RPR.helpkey="Receive Pointer Register" -AT91C_DBGU_RPR.access=memorymapped -AT91C_DBGU_RPR.address=0xFFFFF300 -AT91C_DBGU_RPR.width=32 -AT91C_DBGU_RPR.byteEndian=little -AT91C_DBGU_RCR.name="AT91C_DBGU_RCR" -AT91C_DBGU_RCR.description="Receive Counter Register" -AT91C_DBGU_RCR.helpkey="Receive Counter Register" -AT91C_DBGU_RCR.access=memorymapped -AT91C_DBGU_RCR.address=0xFFFFF304 -AT91C_DBGU_RCR.width=32 -AT91C_DBGU_RCR.byteEndian=little -AT91C_DBGU_RNCR.name="AT91C_DBGU_RNCR" -AT91C_DBGU_RNCR.description="Receive Next Counter Register" -AT91C_DBGU_RNCR.helpkey="Receive Next Counter Register" -AT91C_DBGU_RNCR.access=memorymapped -AT91C_DBGU_RNCR.address=0xFFFFF314 -AT91C_DBGU_RNCR.width=32 -AT91C_DBGU_RNCR.byteEndian=little -AT91C_DBGU_PTCR.name="AT91C_DBGU_PTCR" -AT91C_DBGU_PTCR.description="PDC Transfer Control Register" -AT91C_DBGU_PTCR.helpkey="PDC Transfer Control Register" -AT91C_DBGU_PTCR.access=memorymapped -AT91C_DBGU_PTCR.address=0xFFFFF320 -AT91C_DBGU_PTCR.width=32 -AT91C_DBGU_PTCR.byteEndian=little -AT91C_DBGU_PTCR.type=enum -AT91C_DBGU_PTCR.enum.0.name=*** Write only *** -AT91C_DBGU_PTCR.enum.1.name=Error -AT91C_DBGU_PTSR.name="AT91C_DBGU_PTSR" -AT91C_DBGU_PTSR.description="PDC Transfer Status Register" -AT91C_DBGU_PTSR.helpkey="PDC Transfer Status Register" -AT91C_DBGU_PTSR.access=memorymapped -AT91C_DBGU_PTSR.address=0xFFFFF324 -AT91C_DBGU_PTSR.width=32 -AT91C_DBGU_PTSR.byteEndian=little -AT91C_DBGU_PTSR.permission.write=none -AT91C_DBGU_TNCR.name="AT91C_DBGU_TNCR" -AT91C_DBGU_TNCR.description="Transmit Next Counter Register" -AT91C_DBGU_TNCR.helpkey="Transmit Next Counter Register" -AT91C_DBGU_TNCR.access=memorymapped -AT91C_DBGU_TNCR.address=0xFFFFF31C -AT91C_DBGU_TNCR.width=32 -AT91C_DBGU_TNCR.byteEndian=little -# ========== Register definition for DBGU peripheral ========== -AT91C_DBGU_EXID.name="AT91C_DBGU_EXID" -AT91C_DBGU_EXID.description="Chip ID Extension Register" -AT91C_DBGU_EXID.helpkey="Chip ID Extension Register" -AT91C_DBGU_EXID.access=memorymapped -AT91C_DBGU_EXID.address=0xFFFFF244 -AT91C_DBGU_EXID.width=32 -AT91C_DBGU_EXID.byteEndian=little -AT91C_DBGU_EXID.permission.write=none -AT91C_DBGU_BRGR.name="AT91C_DBGU_BRGR" -AT91C_DBGU_BRGR.description="Baud Rate Generator Register" -AT91C_DBGU_BRGR.helpkey="Baud Rate Generator Register" -AT91C_DBGU_BRGR.access=memorymapped -AT91C_DBGU_BRGR.address=0xFFFFF220 -AT91C_DBGU_BRGR.width=32 -AT91C_DBGU_BRGR.byteEndian=little -AT91C_DBGU_IDR.name="AT91C_DBGU_IDR" -AT91C_DBGU_IDR.description="Interrupt Disable Register" -AT91C_DBGU_IDR.helpkey="Interrupt Disable Register" -AT91C_DBGU_IDR.access=memorymapped -AT91C_DBGU_IDR.address=0xFFFFF20C -AT91C_DBGU_IDR.width=32 -AT91C_DBGU_IDR.byteEndian=little -AT91C_DBGU_IDR.type=enum -AT91C_DBGU_IDR.enum.0.name=*** Write only *** -AT91C_DBGU_IDR.enum.1.name=Error -AT91C_DBGU_CSR.name="AT91C_DBGU_CSR" -AT91C_DBGU_CSR.description="Channel Status Register" -AT91C_DBGU_CSR.helpkey="Channel Status Register" -AT91C_DBGU_CSR.access=memorymapped -AT91C_DBGU_CSR.address=0xFFFFF214 -AT91C_DBGU_CSR.width=32 -AT91C_DBGU_CSR.byteEndian=little -AT91C_DBGU_CSR.permission.write=none -AT91C_DBGU_CIDR.name="AT91C_DBGU_CIDR" -AT91C_DBGU_CIDR.description="Chip ID Register" -AT91C_DBGU_CIDR.helpkey="Chip ID Register" -AT91C_DBGU_CIDR.access=memorymapped -AT91C_DBGU_CIDR.address=0xFFFFF240 -AT91C_DBGU_CIDR.width=32 -AT91C_DBGU_CIDR.byteEndian=little -AT91C_DBGU_CIDR.permission.write=none -AT91C_DBGU_MR.name="AT91C_DBGU_MR" -AT91C_DBGU_MR.description="Mode Register" -AT91C_DBGU_MR.helpkey="Mode Register" -AT91C_DBGU_MR.access=memorymapped -AT91C_DBGU_MR.address=0xFFFFF204 -AT91C_DBGU_MR.width=32 -AT91C_DBGU_MR.byteEndian=little -AT91C_DBGU_IMR.name="AT91C_DBGU_IMR" -AT91C_DBGU_IMR.description="Interrupt Mask Register" -AT91C_DBGU_IMR.helpkey="Interrupt Mask Register" -AT91C_DBGU_IMR.access=memorymapped -AT91C_DBGU_IMR.address=0xFFFFF210 -AT91C_DBGU_IMR.width=32 -AT91C_DBGU_IMR.byteEndian=little -AT91C_DBGU_IMR.permission.write=none -AT91C_DBGU_CR.name="AT91C_DBGU_CR" -AT91C_DBGU_CR.description="Control Register" -AT91C_DBGU_CR.helpkey="Control Register" -AT91C_DBGU_CR.access=memorymapped -AT91C_DBGU_CR.address=0xFFFFF200 -AT91C_DBGU_CR.width=32 -AT91C_DBGU_CR.byteEndian=little -AT91C_DBGU_CR.type=enum -AT91C_DBGU_CR.enum.0.name=*** Write only *** -AT91C_DBGU_CR.enum.1.name=Error -AT91C_DBGU_FNTR.name="AT91C_DBGU_FNTR" -AT91C_DBGU_FNTR.description="Force NTRST Register" -AT91C_DBGU_FNTR.helpkey="Force NTRST Register" -AT91C_DBGU_FNTR.access=memorymapped -AT91C_DBGU_FNTR.address=0xFFFFF248 -AT91C_DBGU_FNTR.width=32 -AT91C_DBGU_FNTR.byteEndian=little -AT91C_DBGU_THR.name="AT91C_DBGU_THR" -AT91C_DBGU_THR.description="Transmitter Holding Register" -AT91C_DBGU_THR.helpkey="Transmitter Holding Register" -AT91C_DBGU_THR.access=memorymapped -AT91C_DBGU_THR.address=0xFFFFF21C -AT91C_DBGU_THR.width=32 -AT91C_DBGU_THR.byteEndian=little -AT91C_DBGU_THR.type=enum -AT91C_DBGU_THR.enum.0.name=*** Write only *** -AT91C_DBGU_THR.enum.1.name=Error -AT91C_DBGU_RHR.name="AT91C_DBGU_RHR" -AT91C_DBGU_RHR.description="Receiver Holding Register" -AT91C_DBGU_RHR.helpkey="Receiver Holding Register" -AT91C_DBGU_RHR.access=memorymapped -AT91C_DBGU_RHR.address=0xFFFFF218 -AT91C_DBGU_RHR.width=32 -AT91C_DBGU_RHR.byteEndian=little -AT91C_DBGU_RHR.permission.write=none -AT91C_DBGU_IER.name="AT91C_DBGU_IER" -AT91C_DBGU_IER.description="Interrupt Enable Register" -AT91C_DBGU_IER.helpkey="Interrupt Enable Register" -AT91C_DBGU_IER.access=memorymapped -AT91C_DBGU_IER.address=0xFFFFF208 -AT91C_DBGU_IER.width=32 -AT91C_DBGU_IER.byteEndian=little -AT91C_DBGU_IER.type=enum -AT91C_DBGU_IER.enum.0.name=*** Write only *** -AT91C_DBGU_IER.enum.1.name=Error -# ========== Register definition for PIOA peripheral ========== -AT91C_PIOA_ODR.name="AT91C_PIOA_ODR" -AT91C_PIOA_ODR.description="Output Disable Registerr" -AT91C_PIOA_ODR.helpkey="Output Disable Registerr" -AT91C_PIOA_ODR.access=memorymapped -AT91C_PIOA_ODR.address=0xFFFFF414 -AT91C_PIOA_ODR.width=32 -AT91C_PIOA_ODR.byteEndian=little -AT91C_PIOA_ODR.type=enum -AT91C_PIOA_ODR.enum.0.name=*** Write only *** -AT91C_PIOA_ODR.enum.1.name=Error -AT91C_PIOA_SODR.name="AT91C_PIOA_SODR" -AT91C_PIOA_SODR.description="Set Output Data Register" -AT91C_PIOA_SODR.helpkey="Set Output Data Register" -AT91C_PIOA_SODR.access=memorymapped -AT91C_PIOA_SODR.address=0xFFFFF430 -AT91C_PIOA_SODR.width=32 -AT91C_PIOA_SODR.byteEndian=little -AT91C_PIOA_SODR.type=enum -AT91C_PIOA_SODR.enum.0.name=*** Write only *** -AT91C_PIOA_SODR.enum.1.name=Error -AT91C_PIOA_ISR.name="AT91C_PIOA_ISR" -AT91C_PIOA_ISR.description="Interrupt Status Register" -AT91C_PIOA_ISR.helpkey="Interrupt Status Register" -AT91C_PIOA_ISR.access=memorymapped -AT91C_PIOA_ISR.address=0xFFFFF44C -AT91C_PIOA_ISR.width=32 -AT91C_PIOA_ISR.byteEndian=little -AT91C_PIOA_ISR.permission.write=none -AT91C_PIOA_ABSR.name="AT91C_PIOA_ABSR" -AT91C_PIOA_ABSR.description="AB Select Status Register" -AT91C_PIOA_ABSR.helpkey="AB Select Status Register" -AT91C_PIOA_ABSR.access=memorymapped -AT91C_PIOA_ABSR.address=0xFFFFF478 -AT91C_PIOA_ABSR.width=32 -AT91C_PIOA_ABSR.byteEndian=little -AT91C_PIOA_ABSR.permission.write=none -AT91C_PIOA_IER.name="AT91C_PIOA_IER" -AT91C_PIOA_IER.description="Interrupt Enable Register" -AT91C_PIOA_IER.helpkey="Interrupt Enable Register" -AT91C_PIOA_IER.access=memorymapped -AT91C_PIOA_IER.address=0xFFFFF440 -AT91C_PIOA_IER.width=32 -AT91C_PIOA_IER.byteEndian=little -AT91C_PIOA_IER.type=enum -AT91C_PIOA_IER.enum.0.name=*** Write only *** -AT91C_PIOA_IER.enum.1.name=Error -AT91C_PIOA_PPUDR.name="AT91C_PIOA_PPUDR" -AT91C_PIOA_PPUDR.description="Pull-up Disable Register" -AT91C_PIOA_PPUDR.helpkey="Pull-up Disable Register" -AT91C_PIOA_PPUDR.access=memorymapped -AT91C_PIOA_PPUDR.address=0xFFFFF460 -AT91C_PIOA_PPUDR.width=32 -AT91C_PIOA_PPUDR.byteEndian=little -AT91C_PIOA_PPUDR.type=enum -AT91C_PIOA_PPUDR.enum.0.name=*** Write only *** -AT91C_PIOA_PPUDR.enum.1.name=Error -AT91C_PIOA_IMR.name="AT91C_PIOA_IMR" -AT91C_PIOA_IMR.description="Interrupt Mask Register" -AT91C_PIOA_IMR.helpkey="Interrupt Mask Register" -AT91C_PIOA_IMR.access=memorymapped -AT91C_PIOA_IMR.address=0xFFFFF448 -AT91C_PIOA_IMR.width=32 -AT91C_PIOA_IMR.byteEndian=little -AT91C_PIOA_IMR.permission.write=none -AT91C_PIOA_PER.name="AT91C_PIOA_PER" -AT91C_PIOA_PER.description="PIO Enable Register" -AT91C_PIOA_PER.helpkey="PIO Enable Register" -AT91C_PIOA_PER.access=memorymapped -AT91C_PIOA_PER.address=0xFFFFF400 -AT91C_PIOA_PER.width=32 -AT91C_PIOA_PER.byteEndian=little -AT91C_PIOA_PER.type=enum -AT91C_PIOA_PER.enum.0.name=*** Write only *** -AT91C_PIOA_PER.enum.1.name=Error -AT91C_PIOA_IFDR.name="AT91C_PIOA_IFDR" -AT91C_PIOA_IFDR.description="Input Filter Disable Register" -AT91C_PIOA_IFDR.helpkey="Input Filter Disable Register" -AT91C_PIOA_IFDR.access=memorymapped -AT91C_PIOA_IFDR.address=0xFFFFF424 -AT91C_PIOA_IFDR.width=32 -AT91C_PIOA_IFDR.byteEndian=little -AT91C_PIOA_IFDR.type=enum -AT91C_PIOA_IFDR.enum.0.name=*** Write only *** -AT91C_PIOA_IFDR.enum.1.name=Error -AT91C_PIOA_OWDR.name="AT91C_PIOA_OWDR" -AT91C_PIOA_OWDR.description="Output Write Disable Register" -AT91C_PIOA_OWDR.helpkey="Output Write Disable Register" -AT91C_PIOA_OWDR.access=memorymapped -AT91C_PIOA_OWDR.address=0xFFFFF4A4 -AT91C_PIOA_OWDR.width=32 -AT91C_PIOA_OWDR.byteEndian=little -AT91C_PIOA_OWDR.type=enum -AT91C_PIOA_OWDR.enum.0.name=*** Write only *** -AT91C_PIOA_OWDR.enum.1.name=Error -AT91C_PIOA_MDSR.name="AT91C_PIOA_MDSR" -AT91C_PIOA_MDSR.description="Multi-driver Status Register" -AT91C_PIOA_MDSR.helpkey="Multi-driver Status Register" -AT91C_PIOA_MDSR.access=memorymapped -AT91C_PIOA_MDSR.address=0xFFFFF458 -AT91C_PIOA_MDSR.width=32 -AT91C_PIOA_MDSR.byteEndian=little -AT91C_PIOA_MDSR.permission.write=none -AT91C_PIOA_IDR.name="AT91C_PIOA_IDR" -AT91C_PIOA_IDR.description="Interrupt Disable Register" -AT91C_PIOA_IDR.helpkey="Interrupt Disable Register" -AT91C_PIOA_IDR.access=memorymapped -AT91C_PIOA_IDR.address=0xFFFFF444 -AT91C_PIOA_IDR.width=32 -AT91C_PIOA_IDR.byteEndian=little -AT91C_PIOA_IDR.type=enum -AT91C_PIOA_IDR.enum.0.name=*** Write only *** -AT91C_PIOA_IDR.enum.1.name=Error -AT91C_PIOA_ODSR.name="AT91C_PIOA_ODSR" -AT91C_PIOA_ODSR.description="Output Data Status Register" -AT91C_PIOA_ODSR.helpkey="Output Data Status Register" -AT91C_PIOA_ODSR.access=memorymapped -AT91C_PIOA_ODSR.address=0xFFFFF438 -AT91C_PIOA_ODSR.width=32 -AT91C_PIOA_ODSR.byteEndian=little -AT91C_PIOA_ODSR.permission.write=none -AT91C_PIOA_PPUSR.name="AT91C_PIOA_PPUSR" -AT91C_PIOA_PPUSR.description="Pull-up Status Register" -AT91C_PIOA_PPUSR.helpkey="Pull-up Status Register" -AT91C_PIOA_PPUSR.access=memorymapped -AT91C_PIOA_PPUSR.address=0xFFFFF468 -AT91C_PIOA_PPUSR.width=32 -AT91C_PIOA_PPUSR.byteEndian=little -AT91C_PIOA_PPUSR.permission.write=none -AT91C_PIOA_OWSR.name="AT91C_PIOA_OWSR" -AT91C_PIOA_OWSR.description="Output Write Status Register" -AT91C_PIOA_OWSR.helpkey="Output Write Status Register" -AT91C_PIOA_OWSR.access=memorymapped -AT91C_PIOA_OWSR.address=0xFFFFF4A8 -AT91C_PIOA_OWSR.width=32 -AT91C_PIOA_OWSR.byteEndian=little -AT91C_PIOA_OWSR.permission.write=none -AT91C_PIOA_BSR.name="AT91C_PIOA_BSR" -AT91C_PIOA_BSR.description="Select B Register" -AT91C_PIOA_BSR.helpkey="Select B Register" -AT91C_PIOA_BSR.access=memorymapped -AT91C_PIOA_BSR.address=0xFFFFF474 -AT91C_PIOA_BSR.width=32 -AT91C_PIOA_BSR.byteEndian=little -AT91C_PIOA_BSR.type=enum -AT91C_PIOA_BSR.enum.0.name=*** Write only *** -AT91C_PIOA_BSR.enum.1.name=Error -AT91C_PIOA_OWER.name="AT91C_PIOA_OWER" -AT91C_PIOA_OWER.description="Output Write Enable Register" -AT91C_PIOA_OWER.helpkey="Output Write Enable Register" -AT91C_PIOA_OWER.access=memorymapped -AT91C_PIOA_OWER.address=0xFFFFF4A0 -AT91C_PIOA_OWER.width=32 -AT91C_PIOA_OWER.byteEndian=little -AT91C_PIOA_OWER.type=enum -AT91C_PIOA_OWER.enum.0.name=*** Write only *** -AT91C_PIOA_OWER.enum.1.name=Error -AT91C_PIOA_IFER.name="AT91C_PIOA_IFER" -AT91C_PIOA_IFER.description="Input Filter Enable Register" -AT91C_PIOA_IFER.helpkey="Input Filter Enable Register" -AT91C_PIOA_IFER.access=memorymapped -AT91C_PIOA_IFER.address=0xFFFFF420 -AT91C_PIOA_IFER.width=32 -AT91C_PIOA_IFER.byteEndian=little -AT91C_PIOA_IFER.type=enum -AT91C_PIOA_IFER.enum.0.name=*** Write only *** -AT91C_PIOA_IFER.enum.1.name=Error -AT91C_PIOA_PDSR.name="AT91C_PIOA_PDSR" -AT91C_PIOA_PDSR.description="Pin Data Status Register" -AT91C_PIOA_PDSR.helpkey="Pin Data Status Register" -AT91C_PIOA_PDSR.access=memorymapped -AT91C_PIOA_PDSR.address=0xFFFFF43C -AT91C_PIOA_PDSR.width=32 -AT91C_PIOA_PDSR.byteEndian=little -AT91C_PIOA_PDSR.permission.write=none -AT91C_PIOA_PPUER.name="AT91C_PIOA_PPUER" -AT91C_PIOA_PPUER.description="Pull-up Enable Register" -AT91C_PIOA_PPUER.helpkey="Pull-up Enable Register" -AT91C_PIOA_PPUER.access=memorymapped -AT91C_PIOA_PPUER.address=0xFFFFF464 -AT91C_PIOA_PPUER.width=32 -AT91C_PIOA_PPUER.byteEndian=little -AT91C_PIOA_PPUER.type=enum -AT91C_PIOA_PPUER.enum.0.name=*** Write only *** -AT91C_PIOA_PPUER.enum.1.name=Error -AT91C_PIOA_OSR.name="AT91C_PIOA_OSR" -AT91C_PIOA_OSR.description="Output Status Register" -AT91C_PIOA_OSR.helpkey="Output Status Register" -AT91C_PIOA_OSR.access=memorymapped -AT91C_PIOA_OSR.address=0xFFFFF418 -AT91C_PIOA_OSR.width=32 -AT91C_PIOA_OSR.byteEndian=little -AT91C_PIOA_OSR.permission.write=none -AT91C_PIOA_ASR.name="AT91C_PIOA_ASR" -AT91C_PIOA_ASR.description="Select A Register" -AT91C_PIOA_ASR.helpkey="Select A Register" -AT91C_PIOA_ASR.access=memorymapped -AT91C_PIOA_ASR.address=0xFFFFF470 -AT91C_PIOA_ASR.width=32 -AT91C_PIOA_ASR.byteEndian=little -AT91C_PIOA_ASR.type=enum -AT91C_PIOA_ASR.enum.0.name=*** Write only *** -AT91C_PIOA_ASR.enum.1.name=Error -AT91C_PIOA_MDDR.name="AT91C_PIOA_MDDR" -AT91C_PIOA_MDDR.description="Multi-driver Disable Register" -AT91C_PIOA_MDDR.helpkey="Multi-driver Disable Register" -AT91C_PIOA_MDDR.access=memorymapped -AT91C_PIOA_MDDR.address=0xFFFFF454 -AT91C_PIOA_MDDR.width=32 -AT91C_PIOA_MDDR.byteEndian=little -AT91C_PIOA_MDDR.type=enum -AT91C_PIOA_MDDR.enum.0.name=*** Write only *** -AT91C_PIOA_MDDR.enum.1.name=Error -AT91C_PIOA_CODR.name="AT91C_PIOA_CODR" -AT91C_PIOA_CODR.description="Clear Output Data Register" -AT91C_PIOA_CODR.helpkey="Clear Output Data Register" -AT91C_PIOA_CODR.access=memorymapped -AT91C_PIOA_CODR.address=0xFFFFF434 -AT91C_PIOA_CODR.width=32 -AT91C_PIOA_CODR.byteEndian=little -AT91C_PIOA_CODR.type=enum -AT91C_PIOA_CODR.enum.0.name=*** Write only *** -AT91C_PIOA_CODR.enum.1.name=Error -AT91C_PIOA_MDER.name="AT91C_PIOA_MDER" -AT91C_PIOA_MDER.description="Multi-driver Enable Register" -AT91C_PIOA_MDER.helpkey="Multi-driver Enable Register" -AT91C_PIOA_MDER.access=memorymapped -AT91C_PIOA_MDER.address=0xFFFFF450 -AT91C_PIOA_MDER.width=32 -AT91C_PIOA_MDER.byteEndian=little -AT91C_PIOA_MDER.type=enum -AT91C_PIOA_MDER.enum.0.name=*** Write only *** -AT91C_PIOA_MDER.enum.1.name=Error -AT91C_PIOA_PDR.name="AT91C_PIOA_PDR" -AT91C_PIOA_PDR.description="PIO Disable Register" -AT91C_PIOA_PDR.helpkey="PIO Disable Register" -AT91C_PIOA_PDR.access=memorymapped -AT91C_PIOA_PDR.address=0xFFFFF404 -AT91C_PIOA_PDR.width=32 -AT91C_PIOA_PDR.byteEndian=little -AT91C_PIOA_PDR.type=enum -AT91C_PIOA_PDR.enum.0.name=*** Write only *** -AT91C_PIOA_PDR.enum.1.name=Error -AT91C_PIOA_IFSR.name="AT91C_PIOA_IFSR" -AT91C_PIOA_IFSR.description="Input Filter Status Register" -AT91C_PIOA_IFSR.helpkey="Input Filter Status Register" -AT91C_PIOA_IFSR.access=memorymapped -AT91C_PIOA_IFSR.address=0xFFFFF428 -AT91C_PIOA_IFSR.width=32 -AT91C_PIOA_IFSR.byteEndian=little -AT91C_PIOA_IFSR.permission.write=none -AT91C_PIOA_OER.name="AT91C_PIOA_OER" -AT91C_PIOA_OER.description="Output Enable Register" -AT91C_PIOA_OER.helpkey="Output Enable Register" -AT91C_PIOA_OER.access=memorymapped -AT91C_PIOA_OER.address=0xFFFFF410 -AT91C_PIOA_OER.width=32 -AT91C_PIOA_OER.byteEndian=little -AT91C_PIOA_OER.type=enum -AT91C_PIOA_OER.enum.0.name=*** Write only *** -AT91C_PIOA_OER.enum.1.name=Error -AT91C_PIOA_PSR.name="AT91C_PIOA_PSR" -AT91C_PIOA_PSR.description="PIO Status Register" -AT91C_PIOA_PSR.helpkey="PIO Status Register" -AT91C_PIOA_PSR.access=memorymapped -AT91C_PIOA_PSR.address=0xFFFFF408 -AT91C_PIOA_PSR.width=32 -AT91C_PIOA_PSR.byteEndian=little -AT91C_PIOA_PSR.permission.write=none -# ========== Register definition for PIOB peripheral ========== -AT91C_PIOB_OWDR.name="AT91C_PIOB_OWDR" -AT91C_PIOB_OWDR.description="Output Write Disable Register" -AT91C_PIOB_OWDR.helpkey="Output Write Disable Register" -AT91C_PIOB_OWDR.access=memorymapped -AT91C_PIOB_OWDR.address=0xFFFFF6A4 -AT91C_PIOB_OWDR.width=32 -AT91C_PIOB_OWDR.byteEndian=little -AT91C_PIOB_OWDR.type=enum -AT91C_PIOB_OWDR.enum.0.name=*** Write only *** -AT91C_PIOB_OWDR.enum.1.name=Error -AT91C_PIOB_MDER.name="AT91C_PIOB_MDER" -AT91C_PIOB_MDER.description="Multi-driver Enable Register" -AT91C_PIOB_MDER.helpkey="Multi-driver Enable Register" -AT91C_PIOB_MDER.access=memorymapped -AT91C_PIOB_MDER.address=0xFFFFF650 -AT91C_PIOB_MDER.width=32 -AT91C_PIOB_MDER.byteEndian=little -AT91C_PIOB_MDER.type=enum -AT91C_PIOB_MDER.enum.0.name=*** Write only *** -AT91C_PIOB_MDER.enum.1.name=Error -AT91C_PIOB_PPUSR.name="AT91C_PIOB_PPUSR" -AT91C_PIOB_PPUSR.description="Pull-up Status Register" -AT91C_PIOB_PPUSR.helpkey="Pull-up Status Register" -AT91C_PIOB_PPUSR.access=memorymapped -AT91C_PIOB_PPUSR.address=0xFFFFF668 -AT91C_PIOB_PPUSR.width=32 -AT91C_PIOB_PPUSR.byteEndian=little -AT91C_PIOB_PPUSR.permission.write=none -AT91C_PIOB_IMR.name="AT91C_PIOB_IMR" -AT91C_PIOB_IMR.description="Interrupt Mask Register" -AT91C_PIOB_IMR.helpkey="Interrupt Mask Register" -AT91C_PIOB_IMR.access=memorymapped -AT91C_PIOB_IMR.address=0xFFFFF648 -AT91C_PIOB_IMR.width=32 -AT91C_PIOB_IMR.byteEndian=little -AT91C_PIOB_IMR.permission.write=none -AT91C_PIOB_ASR.name="AT91C_PIOB_ASR" -AT91C_PIOB_ASR.description="Select A Register" -AT91C_PIOB_ASR.helpkey="Select A Register" -AT91C_PIOB_ASR.access=memorymapped -AT91C_PIOB_ASR.address=0xFFFFF670 -AT91C_PIOB_ASR.width=32 -AT91C_PIOB_ASR.byteEndian=little -AT91C_PIOB_ASR.type=enum -AT91C_PIOB_ASR.enum.0.name=*** Write only *** -AT91C_PIOB_ASR.enum.1.name=Error -AT91C_PIOB_PPUDR.name="AT91C_PIOB_PPUDR" -AT91C_PIOB_PPUDR.description="Pull-up Disable Register" -AT91C_PIOB_PPUDR.helpkey="Pull-up Disable Register" -AT91C_PIOB_PPUDR.access=memorymapped -AT91C_PIOB_PPUDR.address=0xFFFFF660 -AT91C_PIOB_PPUDR.width=32 -AT91C_PIOB_PPUDR.byteEndian=little -AT91C_PIOB_PPUDR.type=enum -AT91C_PIOB_PPUDR.enum.0.name=*** Write only *** -AT91C_PIOB_PPUDR.enum.1.name=Error -AT91C_PIOB_PSR.name="AT91C_PIOB_PSR" -AT91C_PIOB_PSR.description="PIO Status Register" -AT91C_PIOB_PSR.helpkey="PIO Status Register" -AT91C_PIOB_PSR.access=memorymapped -AT91C_PIOB_PSR.address=0xFFFFF608 -AT91C_PIOB_PSR.width=32 -AT91C_PIOB_PSR.byteEndian=little -AT91C_PIOB_PSR.permission.write=none -AT91C_PIOB_IER.name="AT91C_PIOB_IER" -AT91C_PIOB_IER.description="Interrupt Enable Register" -AT91C_PIOB_IER.helpkey="Interrupt Enable Register" -AT91C_PIOB_IER.access=memorymapped -AT91C_PIOB_IER.address=0xFFFFF640 -AT91C_PIOB_IER.width=32 -AT91C_PIOB_IER.byteEndian=little -AT91C_PIOB_IER.type=enum -AT91C_PIOB_IER.enum.0.name=*** Write only *** -AT91C_PIOB_IER.enum.1.name=Error -AT91C_PIOB_CODR.name="AT91C_PIOB_CODR" -AT91C_PIOB_CODR.description="Clear Output Data Register" -AT91C_PIOB_CODR.helpkey="Clear Output Data Register" -AT91C_PIOB_CODR.access=memorymapped -AT91C_PIOB_CODR.address=0xFFFFF634 -AT91C_PIOB_CODR.width=32 -AT91C_PIOB_CODR.byteEndian=little -AT91C_PIOB_CODR.type=enum -AT91C_PIOB_CODR.enum.0.name=*** Write only *** -AT91C_PIOB_CODR.enum.1.name=Error -AT91C_PIOB_OWER.name="AT91C_PIOB_OWER" -AT91C_PIOB_OWER.description="Output Write Enable Register" -AT91C_PIOB_OWER.helpkey="Output Write Enable Register" -AT91C_PIOB_OWER.access=memorymapped -AT91C_PIOB_OWER.address=0xFFFFF6A0 -AT91C_PIOB_OWER.width=32 -AT91C_PIOB_OWER.byteEndian=little -AT91C_PIOB_OWER.type=enum -AT91C_PIOB_OWER.enum.0.name=*** Write only *** -AT91C_PIOB_OWER.enum.1.name=Error -AT91C_PIOB_ABSR.name="AT91C_PIOB_ABSR" -AT91C_PIOB_ABSR.description="AB Select Status Register" -AT91C_PIOB_ABSR.helpkey="AB Select Status Register" -AT91C_PIOB_ABSR.access=memorymapped -AT91C_PIOB_ABSR.address=0xFFFFF678 -AT91C_PIOB_ABSR.width=32 -AT91C_PIOB_ABSR.byteEndian=little -AT91C_PIOB_ABSR.permission.write=none -AT91C_PIOB_IFDR.name="AT91C_PIOB_IFDR" -AT91C_PIOB_IFDR.description="Input Filter Disable Register" -AT91C_PIOB_IFDR.helpkey="Input Filter Disable Register" -AT91C_PIOB_IFDR.access=memorymapped -AT91C_PIOB_IFDR.address=0xFFFFF624 -AT91C_PIOB_IFDR.width=32 -AT91C_PIOB_IFDR.byteEndian=little -AT91C_PIOB_IFDR.type=enum -AT91C_PIOB_IFDR.enum.0.name=*** Write only *** -AT91C_PIOB_IFDR.enum.1.name=Error -AT91C_PIOB_PDSR.name="AT91C_PIOB_PDSR" -AT91C_PIOB_PDSR.description="Pin Data Status Register" -AT91C_PIOB_PDSR.helpkey="Pin Data Status Register" -AT91C_PIOB_PDSR.access=memorymapped -AT91C_PIOB_PDSR.address=0xFFFFF63C -AT91C_PIOB_PDSR.width=32 -AT91C_PIOB_PDSR.byteEndian=little -AT91C_PIOB_PDSR.permission.write=none -AT91C_PIOB_IDR.name="AT91C_PIOB_IDR" -AT91C_PIOB_IDR.description="Interrupt Disable Register" -AT91C_PIOB_IDR.helpkey="Interrupt Disable Register" -AT91C_PIOB_IDR.access=memorymapped -AT91C_PIOB_IDR.address=0xFFFFF644 -AT91C_PIOB_IDR.width=32 -AT91C_PIOB_IDR.byteEndian=little -AT91C_PIOB_IDR.type=enum -AT91C_PIOB_IDR.enum.0.name=*** Write only *** -AT91C_PIOB_IDR.enum.1.name=Error -AT91C_PIOB_OWSR.name="AT91C_PIOB_OWSR" -AT91C_PIOB_OWSR.description="Output Write Status Register" -AT91C_PIOB_OWSR.helpkey="Output Write Status Register" -AT91C_PIOB_OWSR.access=memorymapped -AT91C_PIOB_OWSR.address=0xFFFFF6A8 -AT91C_PIOB_OWSR.width=32 -AT91C_PIOB_OWSR.byteEndian=little -AT91C_PIOB_OWSR.permission.write=none -AT91C_PIOB_PDR.name="AT91C_PIOB_PDR" -AT91C_PIOB_PDR.description="PIO Disable Register" -AT91C_PIOB_PDR.helpkey="PIO Disable Register" -AT91C_PIOB_PDR.access=memorymapped -AT91C_PIOB_PDR.address=0xFFFFF604 -AT91C_PIOB_PDR.width=32 -AT91C_PIOB_PDR.byteEndian=little -AT91C_PIOB_PDR.type=enum -AT91C_PIOB_PDR.enum.0.name=*** Write only *** -AT91C_PIOB_PDR.enum.1.name=Error -AT91C_PIOB_ODR.name="AT91C_PIOB_ODR" -AT91C_PIOB_ODR.description="Output Disable Registerr" -AT91C_PIOB_ODR.helpkey="Output Disable Registerr" -AT91C_PIOB_ODR.access=memorymapped -AT91C_PIOB_ODR.address=0xFFFFF614 -AT91C_PIOB_ODR.width=32 -AT91C_PIOB_ODR.byteEndian=little -AT91C_PIOB_ODR.type=enum -AT91C_PIOB_ODR.enum.0.name=*** Write only *** -AT91C_PIOB_ODR.enum.1.name=Error -AT91C_PIOB_IFSR.name="AT91C_PIOB_IFSR" -AT91C_PIOB_IFSR.description="Input Filter Status Register" -AT91C_PIOB_IFSR.helpkey="Input Filter Status Register" -AT91C_PIOB_IFSR.access=memorymapped -AT91C_PIOB_IFSR.address=0xFFFFF628 -AT91C_PIOB_IFSR.width=32 -AT91C_PIOB_IFSR.byteEndian=little -AT91C_PIOB_IFSR.permission.write=none -AT91C_PIOB_PPUER.name="AT91C_PIOB_PPUER" -AT91C_PIOB_PPUER.description="Pull-up Enable Register" -AT91C_PIOB_PPUER.helpkey="Pull-up Enable Register" -AT91C_PIOB_PPUER.access=memorymapped -AT91C_PIOB_PPUER.address=0xFFFFF664 -AT91C_PIOB_PPUER.width=32 -AT91C_PIOB_PPUER.byteEndian=little -AT91C_PIOB_PPUER.type=enum -AT91C_PIOB_PPUER.enum.0.name=*** Write only *** -AT91C_PIOB_PPUER.enum.1.name=Error -AT91C_PIOB_SODR.name="AT91C_PIOB_SODR" -AT91C_PIOB_SODR.description="Set Output Data Register" -AT91C_PIOB_SODR.helpkey="Set Output Data Register" -AT91C_PIOB_SODR.access=memorymapped -AT91C_PIOB_SODR.address=0xFFFFF630 -AT91C_PIOB_SODR.width=32 -AT91C_PIOB_SODR.byteEndian=little -AT91C_PIOB_SODR.type=enum -AT91C_PIOB_SODR.enum.0.name=*** Write only *** -AT91C_PIOB_SODR.enum.1.name=Error -AT91C_PIOB_ISR.name="AT91C_PIOB_ISR" -AT91C_PIOB_ISR.description="Interrupt Status Register" -AT91C_PIOB_ISR.helpkey="Interrupt Status Register" -AT91C_PIOB_ISR.access=memorymapped -AT91C_PIOB_ISR.address=0xFFFFF64C -AT91C_PIOB_ISR.width=32 -AT91C_PIOB_ISR.byteEndian=little -AT91C_PIOB_ISR.permission.write=none -AT91C_PIOB_ODSR.name="AT91C_PIOB_ODSR" -AT91C_PIOB_ODSR.description="Output Data Status Register" -AT91C_PIOB_ODSR.helpkey="Output Data Status Register" -AT91C_PIOB_ODSR.access=memorymapped -AT91C_PIOB_ODSR.address=0xFFFFF638 -AT91C_PIOB_ODSR.width=32 -AT91C_PIOB_ODSR.byteEndian=little -AT91C_PIOB_ODSR.permission.write=none -AT91C_PIOB_OSR.name="AT91C_PIOB_OSR" -AT91C_PIOB_OSR.description="Output Status Register" -AT91C_PIOB_OSR.helpkey="Output Status Register" -AT91C_PIOB_OSR.access=memorymapped -AT91C_PIOB_OSR.address=0xFFFFF618 -AT91C_PIOB_OSR.width=32 -AT91C_PIOB_OSR.byteEndian=little -AT91C_PIOB_OSR.permission.write=none -AT91C_PIOB_MDSR.name="AT91C_PIOB_MDSR" -AT91C_PIOB_MDSR.description="Multi-driver Status Register" -AT91C_PIOB_MDSR.helpkey="Multi-driver Status Register" -AT91C_PIOB_MDSR.access=memorymapped -AT91C_PIOB_MDSR.address=0xFFFFF658 -AT91C_PIOB_MDSR.width=32 -AT91C_PIOB_MDSR.byteEndian=little -AT91C_PIOB_MDSR.permission.write=none -AT91C_PIOB_IFER.name="AT91C_PIOB_IFER" -AT91C_PIOB_IFER.description="Input Filter Enable Register" -AT91C_PIOB_IFER.helpkey="Input Filter Enable Register" -AT91C_PIOB_IFER.access=memorymapped -AT91C_PIOB_IFER.address=0xFFFFF620 -AT91C_PIOB_IFER.width=32 -AT91C_PIOB_IFER.byteEndian=little -AT91C_PIOB_IFER.type=enum -AT91C_PIOB_IFER.enum.0.name=*** Write only *** -AT91C_PIOB_IFER.enum.1.name=Error -AT91C_PIOB_BSR.name="AT91C_PIOB_BSR" -AT91C_PIOB_BSR.description="Select B Register" -AT91C_PIOB_BSR.helpkey="Select B Register" -AT91C_PIOB_BSR.access=memorymapped -AT91C_PIOB_BSR.address=0xFFFFF674 -AT91C_PIOB_BSR.width=32 -AT91C_PIOB_BSR.byteEndian=little -AT91C_PIOB_BSR.type=enum -AT91C_PIOB_BSR.enum.0.name=*** Write only *** -AT91C_PIOB_BSR.enum.1.name=Error -AT91C_PIOB_MDDR.name="AT91C_PIOB_MDDR" -AT91C_PIOB_MDDR.description="Multi-driver Disable Register" -AT91C_PIOB_MDDR.helpkey="Multi-driver Disable Register" -AT91C_PIOB_MDDR.access=memorymapped -AT91C_PIOB_MDDR.address=0xFFFFF654 -AT91C_PIOB_MDDR.width=32 -AT91C_PIOB_MDDR.byteEndian=little -AT91C_PIOB_MDDR.type=enum -AT91C_PIOB_MDDR.enum.0.name=*** Write only *** -AT91C_PIOB_MDDR.enum.1.name=Error -AT91C_PIOB_OER.name="AT91C_PIOB_OER" -AT91C_PIOB_OER.description="Output Enable Register" -AT91C_PIOB_OER.helpkey="Output Enable Register" -AT91C_PIOB_OER.access=memorymapped -AT91C_PIOB_OER.address=0xFFFFF610 -AT91C_PIOB_OER.width=32 -AT91C_PIOB_OER.byteEndian=little -AT91C_PIOB_OER.type=enum -AT91C_PIOB_OER.enum.0.name=*** Write only *** -AT91C_PIOB_OER.enum.1.name=Error -AT91C_PIOB_PER.name="AT91C_PIOB_PER" -AT91C_PIOB_PER.description="PIO Enable Register" -AT91C_PIOB_PER.helpkey="PIO Enable Register" -AT91C_PIOB_PER.access=memorymapped -AT91C_PIOB_PER.address=0xFFFFF600 -AT91C_PIOB_PER.width=32 -AT91C_PIOB_PER.byteEndian=little -AT91C_PIOB_PER.type=enum -AT91C_PIOB_PER.enum.0.name=*** Write only *** -AT91C_PIOB_PER.enum.1.name=Error -# ========== Register definition for CKGR peripheral ========== -AT91C_CKGR_MOR.name="AT91C_CKGR_MOR" -AT91C_CKGR_MOR.description="Main Oscillator Register" -AT91C_CKGR_MOR.helpkey="Main Oscillator Register" -AT91C_CKGR_MOR.access=memorymapped -AT91C_CKGR_MOR.address=0xFFFFFC20 -AT91C_CKGR_MOR.width=32 -AT91C_CKGR_MOR.byteEndian=little -AT91C_CKGR_PLLR.name="AT91C_CKGR_PLLR" -AT91C_CKGR_PLLR.description="PLL Register" -AT91C_CKGR_PLLR.helpkey="PLL Register" -AT91C_CKGR_PLLR.access=memorymapped -AT91C_CKGR_PLLR.address=0xFFFFFC2C -AT91C_CKGR_PLLR.width=32 -AT91C_CKGR_PLLR.byteEndian=little -AT91C_CKGR_MCFR.name="AT91C_CKGR_MCFR" -AT91C_CKGR_MCFR.description="Main Clock Frequency Register" -AT91C_CKGR_MCFR.helpkey="Main Clock Frequency Register" -AT91C_CKGR_MCFR.access=memorymapped -AT91C_CKGR_MCFR.address=0xFFFFFC24 -AT91C_CKGR_MCFR.width=32 -AT91C_CKGR_MCFR.byteEndian=little -AT91C_CKGR_MCFR.permission.write=none -# ========== Register definition for PMC peripheral ========== -AT91C_PMC_IDR.name="AT91C_PMC_IDR" -AT91C_PMC_IDR.description="Interrupt Disable Register" -AT91C_PMC_IDR.helpkey="Interrupt Disable Register" -AT91C_PMC_IDR.access=memorymapped -AT91C_PMC_IDR.address=0xFFFFFC64 -AT91C_PMC_IDR.width=32 -AT91C_PMC_IDR.byteEndian=little -AT91C_PMC_IDR.type=enum -AT91C_PMC_IDR.enum.0.name=*** Write only *** -AT91C_PMC_IDR.enum.1.name=Error -AT91C_PMC_MOR.name="AT91C_PMC_MOR" -AT91C_PMC_MOR.description="Main Oscillator Register" -AT91C_PMC_MOR.helpkey="Main Oscillator Register" -AT91C_PMC_MOR.access=memorymapped -AT91C_PMC_MOR.address=0xFFFFFC20 -AT91C_PMC_MOR.width=32 -AT91C_PMC_MOR.byteEndian=little -AT91C_PMC_PLLR.name="AT91C_PMC_PLLR" -AT91C_PMC_PLLR.description="PLL Register" -AT91C_PMC_PLLR.helpkey="PLL Register" -AT91C_PMC_PLLR.access=memorymapped -AT91C_PMC_PLLR.address=0xFFFFFC2C -AT91C_PMC_PLLR.width=32 -AT91C_PMC_PLLR.byteEndian=little -AT91C_PMC_PCER.name="AT91C_PMC_PCER" -AT91C_PMC_PCER.description="Peripheral Clock Enable Register" -AT91C_PMC_PCER.helpkey="Peripheral Clock Enable Register" -AT91C_PMC_PCER.access=memorymapped -AT91C_PMC_PCER.address=0xFFFFFC10 -AT91C_PMC_PCER.width=32 -AT91C_PMC_PCER.byteEndian=little -AT91C_PMC_PCER.type=enum -AT91C_PMC_PCER.enum.0.name=*** Write only *** -AT91C_PMC_PCER.enum.1.name=Error -AT91C_PMC_PCKR.name="AT91C_PMC_PCKR" -AT91C_PMC_PCKR.description="Programmable Clock Register" -AT91C_PMC_PCKR.helpkey="Programmable Clock Register" -AT91C_PMC_PCKR.access=memorymapped -AT91C_PMC_PCKR.address=0xFFFFFC40 -AT91C_PMC_PCKR.width=32 -AT91C_PMC_PCKR.byteEndian=little -AT91C_PMC_MCKR.name="AT91C_PMC_MCKR" -AT91C_PMC_MCKR.description="Master Clock Register" -AT91C_PMC_MCKR.helpkey="Master Clock Register" -AT91C_PMC_MCKR.access=memorymapped -AT91C_PMC_MCKR.address=0xFFFFFC30 -AT91C_PMC_MCKR.width=32 -AT91C_PMC_MCKR.byteEndian=little -AT91C_PMC_SCDR.name="AT91C_PMC_SCDR" -AT91C_PMC_SCDR.description="System Clock Disable Register" -AT91C_PMC_SCDR.helpkey="System Clock Disable Register" -AT91C_PMC_SCDR.access=memorymapped -AT91C_PMC_SCDR.address=0xFFFFFC04 -AT91C_PMC_SCDR.width=32 -AT91C_PMC_SCDR.byteEndian=little -AT91C_PMC_SCDR.type=enum -AT91C_PMC_SCDR.enum.0.name=*** Write only *** -AT91C_PMC_SCDR.enum.1.name=Error -AT91C_PMC_PCDR.name="AT91C_PMC_PCDR" -AT91C_PMC_PCDR.description="Peripheral Clock Disable Register" -AT91C_PMC_PCDR.helpkey="Peripheral Clock Disable Register" -AT91C_PMC_PCDR.access=memorymapped -AT91C_PMC_PCDR.address=0xFFFFFC14 -AT91C_PMC_PCDR.width=32 -AT91C_PMC_PCDR.byteEndian=little -AT91C_PMC_PCDR.type=enum -AT91C_PMC_PCDR.enum.0.name=*** Write only *** -AT91C_PMC_PCDR.enum.1.name=Error -AT91C_PMC_SCSR.name="AT91C_PMC_SCSR" -AT91C_PMC_SCSR.description="System Clock Status Register" -AT91C_PMC_SCSR.helpkey="System Clock Status Register" -AT91C_PMC_SCSR.access=memorymapped -AT91C_PMC_SCSR.address=0xFFFFFC08 -AT91C_PMC_SCSR.width=32 -AT91C_PMC_SCSR.byteEndian=little -AT91C_PMC_SCSR.permission.write=none -AT91C_PMC_PCSR.name="AT91C_PMC_PCSR" -AT91C_PMC_PCSR.description="Peripheral Clock Status Register" -AT91C_PMC_PCSR.helpkey="Peripheral Clock Status Register" -AT91C_PMC_PCSR.access=memorymapped -AT91C_PMC_PCSR.address=0xFFFFFC18 -AT91C_PMC_PCSR.width=32 -AT91C_PMC_PCSR.byteEndian=little -AT91C_PMC_PCSR.permission.write=none -AT91C_PMC_MCFR.name="AT91C_PMC_MCFR" -AT91C_PMC_MCFR.description="Main Clock Frequency Register" -AT91C_PMC_MCFR.helpkey="Main Clock Frequency Register" -AT91C_PMC_MCFR.access=memorymapped -AT91C_PMC_MCFR.address=0xFFFFFC24 -AT91C_PMC_MCFR.width=32 -AT91C_PMC_MCFR.byteEndian=little -AT91C_PMC_MCFR.permission.write=none -AT91C_PMC_SCER.name="AT91C_PMC_SCER" -AT91C_PMC_SCER.description="System Clock Enable Register" -AT91C_PMC_SCER.helpkey="System Clock Enable Register" -AT91C_PMC_SCER.access=memorymapped -AT91C_PMC_SCER.address=0xFFFFFC00 -AT91C_PMC_SCER.width=32 -AT91C_PMC_SCER.byteEndian=little -AT91C_PMC_SCER.type=enum -AT91C_PMC_SCER.enum.0.name=*** Write only *** -AT91C_PMC_SCER.enum.1.name=Error -AT91C_PMC_IMR.name="AT91C_PMC_IMR" -AT91C_PMC_IMR.description="Interrupt Mask Register" -AT91C_PMC_IMR.helpkey="Interrupt Mask Register" -AT91C_PMC_IMR.access=memorymapped -AT91C_PMC_IMR.address=0xFFFFFC6C -AT91C_PMC_IMR.width=32 -AT91C_PMC_IMR.byteEndian=little -AT91C_PMC_IMR.permission.write=none -AT91C_PMC_IER.name="AT91C_PMC_IER" -AT91C_PMC_IER.description="Interrupt Enable Register" -AT91C_PMC_IER.helpkey="Interrupt Enable Register" -AT91C_PMC_IER.access=memorymapped -AT91C_PMC_IER.address=0xFFFFFC60 -AT91C_PMC_IER.width=32 -AT91C_PMC_IER.byteEndian=little -AT91C_PMC_IER.type=enum -AT91C_PMC_IER.enum.0.name=*** Write only *** -AT91C_PMC_IER.enum.1.name=Error -AT91C_PMC_SR.name="AT91C_PMC_SR" -AT91C_PMC_SR.description="Status Register" -AT91C_PMC_SR.helpkey="Status Register" -AT91C_PMC_SR.access=memorymapped -AT91C_PMC_SR.address=0xFFFFFC68 -AT91C_PMC_SR.width=32 -AT91C_PMC_SR.byteEndian=little -AT91C_PMC_SR.permission.write=none -# ========== Register definition for RSTC peripheral ========== -AT91C_RSTC_RCR.name="AT91C_RSTC_RCR" -AT91C_RSTC_RCR.description="Reset Control Register" -AT91C_RSTC_RCR.helpkey="Reset Control Register" -AT91C_RSTC_RCR.access=memorymapped -AT91C_RSTC_RCR.address=0xFFFFFD00 -AT91C_RSTC_RCR.width=32 -AT91C_RSTC_RCR.byteEndian=little -AT91C_RSTC_RCR.type=enum -AT91C_RSTC_RCR.enum.0.name=*** Write only *** -AT91C_RSTC_RCR.enum.1.name=Error -AT91C_RSTC_RMR.name="AT91C_RSTC_RMR" -AT91C_RSTC_RMR.description="Reset Mode Register" -AT91C_RSTC_RMR.helpkey="Reset Mode Register" -AT91C_RSTC_RMR.access=memorymapped -AT91C_RSTC_RMR.address=0xFFFFFD08 -AT91C_RSTC_RMR.width=32 -AT91C_RSTC_RMR.byteEndian=little -AT91C_RSTC_RSR.name="AT91C_RSTC_RSR" -AT91C_RSTC_RSR.description="Reset Status Register" -AT91C_RSTC_RSR.helpkey="Reset Status Register" -AT91C_RSTC_RSR.access=memorymapped -AT91C_RSTC_RSR.address=0xFFFFFD04 -AT91C_RSTC_RSR.width=32 -AT91C_RSTC_RSR.byteEndian=little -AT91C_RSTC_RSR.permission.write=none -# ========== Register definition for RTTC peripheral ========== -AT91C_RTTC_RTSR.name="AT91C_RTTC_RTSR" -AT91C_RTTC_RTSR.description="Real-time Status Register" -AT91C_RTTC_RTSR.helpkey="Real-time Status Register" -AT91C_RTTC_RTSR.access=memorymapped -AT91C_RTTC_RTSR.address=0xFFFFFD2C -AT91C_RTTC_RTSR.width=32 -AT91C_RTTC_RTSR.byteEndian=little -AT91C_RTTC_RTSR.permission.write=none -AT91C_RTTC_RTMR.name="AT91C_RTTC_RTMR" -AT91C_RTTC_RTMR.description="Real-time Mode Register" -AT91C_RTTC_RTMR.helpkey="Real-time Mode Register" -AT91C_RTTC_RTMR.access=memorymapped -AT91C_RTTC_RTMR.address=0xFFFFFD20 -AT91C_RTTC_RTMR.width=32 -AT91C_RTTC_RTMR.byteEndian=little -AT91C_RTTC_RTVR.name="AT91C_RTTC_RTVR" -AT91C_RTTC_RTVR.description="Real-time Value Register" -AT91C_RTTC_RTVR.helpkey="Real-time Value Register" -AT91C_RTTC_RTVR.access=memorymapped -AT91C_RTTC_RTVR.address=0xFFFFFD28 -AT91C_RTTC_RTVR.width=32 -AT91C_RTTC_RTVR.byteEndian=little -AT91C_RTTC_RTVR.permission.write=none -AT91C_RTTC_RTAR.name="AT91C_RTTC_RTAR" -AT91C_RTTC_RTAR.description="Real-time Alarm Register" -AT91C_RTTC_RTAR.helpkey="Real-time Alarm Register" -AT91C_RTTC_RTAR.access=memorymapped -AT91C_RTTC_RTAR.address=0xFFFFFD24 -AT91C_RTTC_RTAR.width=32 -AT91C_RTTC_RTAR.byteEndian=little -# ========== Register definition for PITC peripheral ========== -AT91C_PITC_PIVR.name="AT91C_PITC_PIVR" -AT91C_PITC_PIVR.description="Period Interval Value Register" -AT91C_PITC_PIVR.helpkey="Period Interval Value Register" -AT91C_PITC_PIVR.access=memorymapped -AT91C_PITC_PIVR.address=0xFFFFFD38 -AT91C_PITC_PIVR.width=32 -AT91C_PITC_PIVR.byteEndian=little -AT91C_PITC_PIVR.permission.write=none -AT91C_PITC_PISR.name="AT91C_PITC_PISR" -AT91C_PITC_PISR.description="Period Interval Status Register" -AT91C_PITC_PISR.helpkey="Period Interval Status Register" -AT91C_PITC_PISR.access=memorymapped -AT91C_PITC_PISR.address=0xFFFFFD34 -AT91C_PITC_PISR.width=32 -AT91C_PITC_PISR.byteEndian=little -AT91C_PITC_PISR.permission.write=none -AT91C_PITC_PIIR.name="AT91C_PITC_PIIR" -AT91C_PITC_PIIR.description="Period Interval Image Register" -AT91C_PITC_PIIR.helpkey="Period Interval Image Register" -AT91C_PITC_PIIR.access=memorymapped -AT91C_PITC_PIIR.address=0xFFFFFD3C -AT91C_PITC_PIIR.width=32 -AT91C_PITC_PIIR.byteEndian=little -AT91C_PITC_PIIR.permission.write=none -AT91C_PITC_PIMR.name="AT91C_PITC_PIMR" -AT91C_PITC_PIMR.description="Period Interval Mode Register" -AT91C_PITC_PIMR.helpkey="Period Interval Mode Register" -AT91C_PITC_PIMR.access=memorymapped -AT91C_PITC_PIMR.address=0xFFFFFD30 -AT91C_PITC_PIMR.width=32 -AT91C_PITC_PIMR.byteEndian=little -# ========== Register definition for WDTC peripheral ========== -AT91C_WDTC_WDCR.name="AT91C_WDTC_WDCR" -AT91C_WDTC_WDCR.description="Watchdog Control Register" -AT91C_WDTC_WDCR.helpkey="Watchdog Control Register" -AT91C_WDTC_WDCR.access=memorymapped -AT91C_WDTC_WDCR.address=0xFFFFFD40 -AT91C_WDTC_WDCR.width=32 -AT91C_WDTC_WDCR.byteEndian=little -AT91C_WDTC_WDCR.type=enum -AT91C_WDTC_WDCR.enum.0.name=*** Write only *** -AT91C_WDTC_WDCR.enum.1.name=Error -AT91C_WDTC_WDSR.name="AT91C_WDTC_WDSR" -AT91C_WDTC_WDSR.description="Watchdog Status Register" -AT91C_WDTC_WDSR.helpkey="Watchdog Status Register" -AT91C_WDTC_WDSR.access=memorymapped -AT91C_WDTC_WDSR.address=0xFFFFFD48 -AT91C_WDTC_WDSR.width=32 -AT91C_WDTC_WDSR.byteEndian=little -AT91C_WDTC_WDSR.permission.write=none -AT91C_WDTC_WDMR.name="AT91C_WDTC_WDMR" -AT91C_WDTC_WDMR.description="Watchdog Mode Register" -AT91C_WDTC_WDMR.helpkey="Watchdog Mode Register" -AT91C_WDTC_WDMR.access=memorymapped -AT91C_WDTC_WDMR.address=0xFFFFFD44 -AT91C_WDTC_WDMR.width=32 -AT91C_WDTC_WDMR.byteEndian=little -# ========== Register definition for VREG peripheral ========== -AT91C_VREG_MR.name="AT91C_VREG_MR" -AT91C_VREG_MR.description="Voltage Regulator Mode Register" -AT91C_VREG_MR.helpkey="Voltage Regulator Mode Register" -AT91C_VREG_MR.access=memorymapped -AT91C_VREG_MR.address=0xFFFFFD60 -AT91C_VREG_MR.width=32 -AT91C_VREG_MR.byteEndian=little -# ========== Register definition for MC peripheral ========== -AT91C_MC_ASR.name="AT91C_MC_ASR" -AT91C_MC_ASR.description="MC Abort Status Register" -AT91C_MC_ASR.helpkey="MC Abort Status Register" -AT91C_MC_ASR.access=memorymapped -AT91C_MC_ASR.address=0xFFFFFF04 -AT91C_MC_ASR.width=32 -AT91C_MC_ASR.byteEndian=little -AT91C_MC_ASR.permission.write=none -AT91C_MC_RCR.name="AT91C_MC_RCR" -AT91C_MC_RCR.description="MC Remap Control Register" -AT91C_MC_RCR.helpkey="MC Remap Control Register" -AT91C_MC_RCR.access=memorymapped -AT91C_MC_RCR.address=0xFFFFFF00 -AT91C_MC_RCR.width=32 -AT91C_MC_RCR.byteEndian=little -AT91C_MC_RCR.type=enum -AT91C_MC_RCR.enum.0.name=*** Write only *** -AT91C_MC_RCR.enum.1.name=Error -AT91C_MC_FCR.name="AT91C_MC_FCR" -AT91C_MC_FCR.description="MC Flash Command Register" -AT91C_MC_FCR.helpkey="MC Flash Command Register" -AT91C_MC_FCR.access=memorymapped -AT91C_MC_FCR.address=0xFFFFFF64 -AT91C_MC_FCR.width=32 -AT91C_MC_FCR.byteEndian=little -AT91C_MC_FCR.type=enum -AT91C_MC_FCR.enum.0.name=*** Write only *** -AT91C_MC_FCR.enum.1.name=Error -AT91C_MC_AASR.name="AT91C_MC_AASR" -AT91C_MC_AASR.description="MC Abort Address Status Register" -AT91C_MC_AASR.helpkey="MC Abort Address Status Register" -AT91C_MC_AASR.access=memorymapped -AT91C_MC_AASR.address=0xFFFFFF08 -AT91C_MC_AASR.width=32 -AT91C_MC_AASR.byteEndian=little -AT91C_MC_AASR.permission.write=none -AT91C_MC_FSR.name="AT91C_MC_FSR" -AT91C_MC_FSR.description="MC Flash Status Register" -AT91C_MC_FSR.helpkey="MC Flash Status Register" -AT91C_MC_FSR.access=memorymapped -AT91C_MC_FSR.address=0xFFFFFF68 -AT91C_MC_FSR.width=32 -AT91C_MC_FSR.byteEndian=little -AT91C_MC_FSR.permission.write=none -AT91C_MC_FMR.name="AT91C_MC_FMR" -AT91C_MC_FMR.description="MC Flash Mode Register" -AT91C_MC_FMR.helpkey="MC Flash Mode Register" -AT91C_MC_FMR.access=memorymapped -AT91C_MC_FMR.address=0xFFFFFF60 -AT91C_MC_FMR.width=32 -AT91C_MC_FMR.byteEndian=little -# ========== Register definition for PDC_SPI1 peripheral ========== -AT91C_SPI1_PTCR.name="AT91C_SPI1_PTCR" -AT91C_SPI1_PTCR.description="PDC Transfer Control Register" -AT91C_SPI1_PTCR.helpkey="PDC Transfer Control Register" -AT91C_SPI1_PTCR.access=memorymapped -AT91C_SPI1_PTCR.address=0xFFFE4120 -AT91C_SPI1_PTCR.width=32 -AT91C_SPI1_PTCR.byteEndian=little -AT91C_SPI1_PTCR.type=enum -AT91C_SPI1_PTCR.enum.0.name=*** Write only *** -AT91C_SPI1_PTCR.enum.1.name=Error -AT91C_SPI1_RPR.name="AT91C_SPI1_RPR" -AT91C_SPI1_RPR.description="Receive Pointer Register" -AT91C_SPI1_RPR.helpkey="Receive Pointer Register" -AT91C_SPI1_RPR.access=memorymapped -AT91C_SPI1_RPR.address=0xFFFE4100 -AT91C_SPI1_RPR.width=32 -AT91C_SPI1_RPR.byteEndian=little -AT91C_SPI1_TNCR.name="AT91C_SPI1_TNCR" -AT91C_SPI1_TNCR.description="Transmit Next Counter Register" -AT91C_SPI1_TNCR.helpkey="Transmit Next Counter Register" -AT91C_SPI1_TNCR.access=memorymapped -AT91C_SPI1_TNCR.address=0xFFFE411C -AT91C_SPI1_TNCR.width=32 -AT91C_SPI1_TNCR.byteEndian=little -AT91C_SPI1_TPR.name="AT91C_SPI1_TPR" -AT91C_SPI1_TPR.description="Transmit Pointer Register" -AT91C_SPI1_TPR.helpkey="Transmit Pointer Register" -AT91C_SPI1_TPR.access=memorymapped -AT91C_SPI1_TPR.address=0xFFFE4108 -AT91C_SPI1_TPR.width=32 -AT91C_SPI1_TPR.byteEndian=little -AT91C_SPI1_TNPR.name="AT91C_SPI1_TNPR" -AT91C_SPI1_TNPR.description="Transmit Next Pointer Register" -AT91C_SPI1_TNPR.helpkey="Transmit Next Pointer Register" -AT91C_SPI1_TNPR.access=memorymapped -AT91C_SPI1_TNPR.address=0xFFFE4118 -AT91C_SPI1_TNPR.width=32 -AT91C_SPI1_TNPR.byteEndian=little -AT91C_SPI1_TCR.name="AT91C_SPI1_TCR" -AT91C_SPI1_TCR.description="Transmit Counter Register" -AT91C_SPI1_TCR.helpkey="Transmit Counter Register" -AT91C_SPI1_TCR.access=memorymapped -AT91C_SPI1_TCR.address=0xFFFE410C -AT91C_SPI1_TCR.width=32 -AT91C_SPI1_TCR.byteEndian=little -AT91C_SPI1_RCR.name="AT91C_SPI1_RCR" -AT91C_SPI1_RCR.description="Receive Counter Register" -AT91C_SPI1_RCR.helpkey="Receive Counter Register" -AT91C_SPI1_RCR.access=memorymapped -AT91C_SPI1_RCR.address=0xFFFE4104 -AT91C_SPI1_RCR.width=32 -AT91C_SPI1_RCR.byteEndian=little -AT91C_SPI1_RNPR.name="AT91C_SPI1_RNPR" -AT91C_SPI1_RNPR.description="Receive Next Pointer Register" -AT91C_SPI1_RNPR.helpkey="Receive Next Pointer Register" -AT91C_SPI1_RNPR.access=memorymapped -AT91C_SPI1_RNPR.address=0xFFFE4110 -AT91C_SPI1_RNPR.width=32 -AT91C_SPI1_RNPR.byteEndian=little -AT91C_SPI1_RNCR.name="AT91C_SPI1_RNCR" -AT91C_SPI1_RNCR.description="Receive Next Counter Register" -AT91C_SPI1_RNCR.helpkey="Receive Next Counter Register" -AT91C_SPI1_RNCR.access=memorymapped -AT91C_SPI1_RNCR.address=0xFFFE4114 -AT91C_SPI1_RNCR.width=32 -AT91C_SPI1_RNCR.byteEndian=little -AT91C_SPI1_PTSR.name="AT91C_SPI1_PTSR" -AT91C_SPI1_PTSR.description="PDC Transfer Status Register" -AT91C_SPI1_PTSR.helpkey="PDC Transfer Status Register" -AT91C_SPI1_PTSR.access=memorymapped -AT91C_SPI1_PTSR.address=0xFFFE4124 -AT91C_SPI1_PTSR.width=32 -AT91C_SPI1_PTSR.byteEndian=little -AT91C_SPI1_PTSR.permission.write=none -# ========== Register definition for SPI1 peripheral ========== -AT91C_SPI1_IMR.name="AT91C_SPI1_IMR" -AT91C_SPI1_IMR.description="Interrupt Mask Register" -AT91C_SPI1_IMR.helpkey="Interrupt Mask Register" -AT91C_SPI1_IMR.access=memorymapped -AT91C_SPI1_IMR.address=0xFFFE401C -AT91C_SPI1_IMR.width=32 -AT91C_SPI1_IMR.byteEndian=little -AT91C_SPI1_IMR.permission.write=none -AT91C_SPI1_IER.name="AT91C_SPI1_IER" -AT91C_SPI1_IER.description="Interrupt Enable Register" -AT91C_SPI1_IER.helpkey="Interrupt Enable Register" -AT91C_SPI1_IER.access=memorymapped -AT91C_SPI1_IER.address=0xFFFE4014 -AT91C_SPI1_IER.width=32 -AT91C_SPI1_IER.byteEndian=little -AT91C_SPI1_IER.type=enum -AT91C_SPI1_IER.enum.0.name=*** Write only *** -AT91C_SPI1_IER.enum.1.name=Error -AT91C_SPI1_MR.name="AT91C_SPI1_MR" -AT91C_SPI1_MR.description="Mode Register" -AT91C_SPI1_MR.helpkey="Mode Register" -AT91C_SPI1_MR.access=memorymapped -AT91C_SPI1_MR.address=0xFFFE4004 -AT91C_SPI1_MR.width=32 -AT91C_SPI1_MR.byteEndian=little -AT91C_SPI1_RDR.name="AT91C_SPI1_RDR" -AT91C_SPI1_RDR.description="Receive Data Register" -AT91C_SPI1_RDR.helpkey="Receive Data Register" -AT91C_SPI1_RDR.access=memorymapped -AT91C_SPI1_RDR.address=0xFFFE4008 -AT91C_SPI1_RDR.width=32 -AT91C_SPI1_RDR.byteEndian=little -AT91C_SPI1_RDR.permission.write=none -AT91C_SPI1_IDR.name="AT91C_SPI1_IDR" -AT91C_SPI1_IDR.description="Interrupt Disable Register" -AT91C_SPI1_IDR.helpkey="Interrupt Disable Register" -AT91C_SPI1_IDR.access=memorymapped -AT91C_SPI1_IDR.address=0xFFFE4018 -AT91C_SPI1_IDR.width=32 -AT91C_SPI1_IDR.byteEndian=little -AT91C_SPI1_IDR.type=enum -AT91C_SPI1_IDR.enum.0.name=*** Write only *** -AT91C_SPI1_IDR.enum.1.name=Error -AT91C_SPI1_SR.name="AT91C_SPI1_SR" -AT91C_SPI1_SR.description="Status Register" -AT91C_SPI1_SR.helpkey="Status Register" -AT91C_SPI1_SR.access=memorymapped -AT91C_SPI1_SR.address=0xFFFE4010 -AT91C_SPI1_SR.width=32 -AT91C_SPI1_SR.byteEndian=little -AT91C_SPI1_SR.permission.write=none -AT91C_SPI1_TDR.name="AT91C_SPI1_TDR" -AT91C_SPI1_TDR.description="Transmit Data Register" -AT91C_SPI1_TDR.helpkey="Transmit Data Register" -AT91C_SPI1_TDR.access=memorymapped -AT91C_SPI1_TDR.address=0xFFFE400C -AT91C_SPI1_TDR.width=32 -AT91C_SPI1_TDR.byteEndian=little -AT91C_SPI1_TDR.type=enum -AT91C_SPI1_TDR.enum.0.name=*** Write only *** -AT91C_SPI1_TDR.enum.1.name=Error -AT91C_SPI1_CR.name="AT91C_SPI1_CR" -AT91C_SPI1_CR.description="Control Register" -AT91C_SPI1_CR.helpkey="Control Register" -AT91C_SPI1_CR.access=memorymapped -AT91C_SPI1_CR.address=0xFFFE4000 -AT91C_SPI1_CR.width=32 -AT91C_SPI1_CR.byteEndian=little -AT91C_SPI1_CR.permission.write=none -AT91C_SPI1_CSR.name="AT91C_SPI1_CSR" -AT91C_SPI1_CSR.description="Chip Select Register" -AT91C_SPI1_CSR.helpkey="Chip Select Register" -AT91C_SPI1_CSR.access=memorymapped -AT91C_SPI1_CSR.address=0xFFFE4030 -AT91C_SPI1_CSR.width=32 -AT91C_SPI1_CSR.byteEndian=little -# ========== Register definition for PDC_SPI0 peripheral ========== -AT91C_SPI0_PTCR.name="AT91C_SPI0_PTCR" -AT91C_SPI0_PTCR.description="PDC Transfer Control Register" -AT91C_SPI0_PTCR.helpkey="PDC Transfer Control Register" -AT91C_SPI0_PTCR.access=memorymapped -AT91C_SPI0_PTCR.address=0xFFFE0120 -AT91C_SPI0_PTCR.width=32 -AT91C_SPI0_PTCR.byteEndian=little -AT91C_SPI0_PTCR.type=enum -AT91C_SPI0_PTCR.enum.0.name=*** Write only *** -AT91C_SPI0_PTCR.enum.1.name=Error -AT91C_SPI0_TPR.name="AT91C_SPI0_TPR" -AT91C_SPI0_TPR.description="Transmit Pointer Register" -AT91C_SPI0_TPR.helpkey="Transmit Pointer Register" -AT91C_SPI0_TPR.access=memorymapped -AT91C_SPI0_TPR.address=0xFFFE0108 -AT91C_SPI0_TPR.width=32 -AT91C_SPI0_TPR.byteEndian=little -AT91C_SPI0_TCR.name="AT91C_SPI0_TCR" -AT91C_SPI0_TCR.description="Transmit Counter Register" -AT91C_SPI0_TCR.helpkey="Transmit Counter Register" -AT91C_SPI0_TCR.access=memorymapped -AT91C_SPI0_TCR.address=0xFFFE010C -AT91C_SPI0_TCR.width=32 -AT91C_SPI0_TCR.byteEndian=little -AT91C_SPI0_RCR.name="AT91C_SPI0_RCR" -AT91C_SPI0_RCR.description="Receive Counter Register" -AT91C_SPI0_RCR.helpkey="Receive Counter Register" -AT91C_SPI0_RCR.access=memorymapped -AT91C_SPI0_RCR.address=0xFFFE0104 -AT91C_SPI0_RCR.width=32 -AT91C_SPI0_RCR.byteEndian=little -AT91C_SPI0_PTSR.name="AT91C_SPI0_PTSR" -AT91C_SPI0_PTSR.description="PDC Transfer Status Register" -AT91C_SPI0_PTSR.helpkey="PDC Transfer Status Register" -AT91C_SPI0_PTSR.access=memorymapped -AT91C_SPI0_PTSR.address=0xFFFE0124 -AT91C_SPI0_PTSR.width=32 -AT91C_SPI0_PTSR.byteEndian=little -AT91C_SPI0_PTSR.permission.write=none -AT91C_SPI0_RNPR.name="AT91C_SPI0_RNPR" -AT91C_SPI0_RNPR.description="Receive Next Pointer Register" -AT91C_SPI0_RNPR.helpkey="Receive Next Pointer Register" -AT91C_SPI0_RNPR.access=memorymapped -AT91C_SPI0_RNPR.address=0xFFFE0110 -AT91C_SPI0_RNPR.width=32 -AT91C_SPI0_RNPR.byteEndian=little -AT91C_SPI0_RPR.name="AT91C_SPI0_RPR" -AT91C_SPI0_RPR.description="Receive Pointer Register" -AT91C_SPI0_RPR.helpkey="Receive Pointer Register" -AT91C_SPI0_RPR.access=memorymapped -AT91C_SPI0_RPR.address=0xFFFE0100 -AT91C_SPI0_RPR.width=32 -AT91C_SPI0_RPR.byteEndian=little -AT91C_SPI0_TNCR.name="AT91C_SPI0_TNCR" -AT91C_SPI0_TNCR.description="Transmit Next Counter Register" -AT91C_SPI0_TNCR.helpkey="Transmit Next Counter Register" -AT91C_SPI0_TNCR.access=memorymapped -AT91C_SPI0_TNCR.address=0xFFFE011C -AT91C_SPI0_TNCR.width=32 -AT91C_SPI0_TNCR.byteEndian=little -AT91C_SPI0_RNCR.name="AT91C_SPI0_RNCR" -AT91C_SPI0_RNCR.description="Receive Next Counter Register" -AT91C_SPI0_RNCR.helpkey="Receive Next Counter Register" -AT91C_SPI0_RNCR.access=memorymapped -AT91C_SPI0_RNCR.address=0xFFFE0114 -AT91C_SPI0_RNCR.width=32 -AT91C_SPI0_RNCR.byteEndian=little -AT91C_SPI0_TNPR.name="AT91C_SPI0_TNPR" -AT91C_SPI0_TNPR.description="Transmit Next Pointer Register" -AT91C_SPI0_TNPR.helpkey="Transmit Next Pointer Register" -AT91C_SPI0_TNPR.access=memorymapped -AT91C_SPI0_TNPR.address=0xFFFE0118 -AT91C_SPI0_TNPR.width=32 -AT91C_SPI0_TNPR.byteEndian=little -# ========== Register definition for SPI0 peripheral ========== -AT91C_SPI0_IER.name="AT91C_SPI0_IER" -AT91C_SPI0_IER.description="Interrupt Enable Register" -AT91C_SPI0_IER.helpkey="Interrupt Enable Register" -AT91C_SPI0_IER.access=memorymapped -AT91C_SPI0_IER.address=0xFFFE0014 -AT91C_SPI0_IER.width=32 -AT91C_SPI0_IER.byteEndian=little -AT91C_SPI0_IER.type=enum -AT91C_SPI0_IER.enum.0.name=*** Write only *** -AT91C_SPI0_IER.enum.1.name=Error -AT91C_SPI0_SR.name="AT91C_SPI0_SR" -AT91C_SPI0_SR.description="Status Register" -AT91C_SPI0_SR.helpkey="Status Register" -AT91C_SPI0_SR.access=memorymapped -AT91C_SPI0_SR.address=0xFFFE0010 -AT91C_SPI0_SR.width=32 -AT91C_SPI0_SR.byteEndian=little -AT91C_SPI0_SR.permission.write=none -AT91C_SPI0_IDR.name="AT91C_SPI0_IDR" -AT91C_SPI0_IDR.description="Interrupt Disable Register" -AT91C_SPI0_IDR.helpkey="Interrupt Disable Register" -AT91C_SPI0_IDR.access=memorymapped -AT91C_SPI0_IDR.address=0xFFFE0018 -AT91C_SPI0_IDR.width=32 -AT91C_SPI0_IDR.byteEndian=little -AT91C_SPI0_IDR.type=enum -AT91C_SPI0_IDR.enum.0.name=*** Write only *** -AT91C_SPI0_IDR.enum.1.name=Error -AT91C_SPI0_CR.name="AT91C_SPI0_CR" -AT91C_SPI0_CR.description="Control Register" -AT91C_SPI0_CR.helpkey="Control Register" -AT91C_SPI0_CR.access=memorymapped -AT91C_SPI0_CR.address=0xFFFE0000 -AT91C_SPI0_CR.width=32 -AT91C_SPI0_CR.byteEndian=little -AT91C_SPI0_CR.permission.write=none -AT91C_SPI0_MR.name="AT91C_SPI0_MR" -AT91C_SPI0_MR.description="Mode Register" -AT91C_SPI0_MR.helpkey="Mode Register" -AT91C_SPI0_MR.access=memorymapped -AT91C_SPI0_MR.address=0xFFFE0004 -AT91C_SPI0_MR.width=32 -AT91C_SPI0_MR.byteEndian=little -AT91C_SPI0_IMR.name="AT91C_SPI0_IMR" -AT91C_SPI0_IMR.description="Interrupt Mask Register" -AT91C_SPI0_IMR.helpkey="Interrupt Mask Register" -AT91C_SPI0_IMR.access=memorymapped -AT91C_SPI0_IMR.address=0xFFFE001C -AT91C_SPI0_IMR.width=32 -AT91C_SPI0_IMR.byteEndian=little -AT91C_SPI0_IMR.permission.write=none -AT91C_SPI0_TDR.name="AT91C_SPI0_TDR" -AT91C_SPI0_TDR.description="Transmit Data Register" -AT91C_SPI0_TDR.helpkey="Transmit Data Register" -AT91C_SPI0_TDR.access=memorymapped -AT91C_SPI0_TDR.address=0xFFFE000C -AT91C_SPI0_TDR.width=32 -AT91C_SPI0_TDR.byteEndian=little -AT91C_SPI0_TDR.type=enum -AT91C_SPI0_TDR.enum.0.name=*** Write only *** -AT91C_SPI0_TDR.enum.1.name=Error -AT91C_SPI0_RDR.name="AT91C_SPI0_RDR" -AT91C_SPI0_RDR.description="Receive Data Register" -AT91C_SPI0_RDR.helpkey="Receive Data Register" -AT91C_SPI0_RDR.access=memorymapped -AT91C_SPI0_RDR.address=0xFFFE0008 -AT91C_SPI0_RDR.width=32 -AT91C_SPI0_RDR.byteEndian=little -AT91C_SPI0_RDR.permission.write=none -AT91C_SPI0_CSR.name="AT91C_SPI0_CSR" -AT91C_SPI0_CSR.description="Chip Select Register" -AT91C_SPI0_CSR.helpkey="Chip Select Register" -AT91C_SPI0_CSR.access=memorymapped -AT91C_SPI0_CSR.address=0xFFFE0030 -AT91C_SPI0_CSR.width=32 -AT91C_SPI0_CSR.byteEndian=little -# ========== Register definition for PDC_US1 peripheral ========== -AT91C_US1_RNCR.name="AT91C_US1_RNCR" -AT91C_US1_RNCR.description="Receive Next Counter Register" -AT91C_US1_RNCR.helpkey="Receive Next Counter Register" -AT91C_US1_RNCR.access=memorymapped -AT91C_US1_RNCR.address=0xFFFC4114 -AT91C_US1_RNCR.width=32 -AT91C_US1_RNCR.byteEndian=little -AT91C_US1_PTCR.name="AT91C_US1_PTCR" -AT91C_US1_PTCR.description="PDC Transfer Control Register" -AT91C_US1_PTCR.helpkey="PDC Transfer Control Register" -AT91C_US1_PTCR.access=memorymapped -AT91C_US1_PTCR.address=0xFFFC4120 -AT91C_US1_PTCR.width=32 -AT91C_US1_PTCR.byteEndian=little -AT91C_US1_PTCR.type=enum -AT91C_US1_PTCR.enum.0.name=*** Write only *** -AT91C_US1_PTCR.enum.1.name=Error -AT91C_US1_TCR.name="AT91C_US1_TCR" -AT91C_US1_TCR.description="Transmit Counter Register" -AT91C_US1_TCR.helpkey="Transmit Counter Register" -AT91C_US1_TCR.access=memorymapped -AT91C_US1_TCR.address=0xFFFC410C -AT91C_US1_TCR.width=32 -AT91C_US1_TCR.byteEndian=little -AT91C_US1_PTSR.name="AT91C_US1_PTSR" -AT91C_US1_PTSR.description="PDC Transfer Status Register" -AT91C_US1_PTSR.helpkey="PDC Transfer Status Register" -AT91C_US1_PTSR.access=memorymapped -AT91C_US1_PTSR.address=0xFFFC4124 -AT91C_US1_PTSR.width=32 -AT91C_US1_PTSR.byteEndian=little -AT91C_US1_PTSR.permission.write=none -AT91C_US1_TNPR.name="AT91C_US1_TNPR" -AT91C_US1_TNPR.description="Transmit Next Pointer Register" -AT91C_US1_TNPR.helpkey="Transmit Next Pointer Register" -AT91C_US1_TNPR.access=memorymapped -AT91C_US1_TNPR.address=0xFFFC4118 -AT91C_US1_TNPR.width=32 -AT91C_US1_TNPR.byteEndian=little -AT91C_US1_RCR.name="AT91C_US1_RCR" -AT91C_US1_RCR.description="Receive Counter Register" -AT91C_US1_RCR.helpkey="Receive Counter Register" -AT91C_US1_RCR.access=memorymapped -AT91C_US1_RCR.address=0xFFFC4104 -AT91C_US1_RCR.width=32 -AT91C_US1_RCR.byteEndian=little -AT91C_US1_RNPR.name="AT91C_US1_RNPR" -AT91C_US1_RNPR.description="Receive Next Pointer Register" -AT91C_US1_RNPR.helpkey="Receive Next Pointer Register" -AT91C_US1_RNPR.access=memorymapped -AT91C_US1_RNPR.address=0xFFFC4110 -AT91C_US1_RNPR.width=32 -AT91C_US1_RNPR.byteEndian=little -AT91C_US1_RPR.name="AT91C_US1_RPR" -AT91C_US1_RPR.description="Receive Pointer Register" -AT91C_US1_RPR.helpkey="Receive Pointer Register" -AT91C_US1_RPR.access=memorymapped -AT91C_US1_RPR.address=0xFFFC4100 -AT91C_US1_RPR.width=32 -AT91C_US1_RPR.byteEndian=little -AT91C_US1_TNCR.name="AT91C_US1_TNCR" -AT91C_US1_TNCR.description="Transmit Next Counter Register" -AT91C_US1_TNCR.helpkey="Transmit Next Counter Register" -AT91C_US1_TNCR.access=memorymapped -AT91C_US1_TNCR.address=0xFFFC411C -AT91C_US1_TNCR.width=32 -AT91C_US1_TNCR.byteEndian=little -AT91C_US1_TPR.name="AT91C_US1_TPR" -AT91C_US1_TPR.description="Transmit Pointer Register" -AT91C_US1_TPR.helpkey="Transmit Pointer Register" -AT91C_US1_TPR.access=memorymapped -AT91C_US1_TPR.address=0xFFFC4108 -AT91C_US1_TPR.width=32 -AT91C_US1_TPR.byteEndian=little -# ========== Register definition for US1 peripheral ========== -AT91C_US1_IF.name="AT91C_US1_IF" -AT91C_US1_IF.description="IRDA_FILTER Register" -AT91C_US1_IF.helpkey="IRDA_FILTER Register" -AT91C_US1_IF.access=memorymapped -AT91C_US1_IF.address=0xFFFC404C -AT91C_US1_IF.width=32 -AT91C_US1_IF.byteEndian=little -AT91C_US1_NER.name="AT91C_US1_NER" -AT91C_US1_NER.description="Nb Errors Register" -AT91C_US1_NER.helpkey="Nb Errors Register" -AT91C_US1_NER.access=memorymapped -AT91C_US1_NER.address=0xFFFC4044 -AT91C_US1_NER.width=32 -AT91C_US1_NER.byteEndian=little -AT91C_US1_NER.permission.write=none -AT91C_US1_RTOR.name="AT91C_US1_RTOR" -AT91C_US1_RTOR.description="Receiver Time-out Register" -AT91C_US1_RTOR.helpkey="Receiver Time-out Register" -AT91C_US1_RTOR.access=memorymapped -AT91C_US1_RTOR.address=0xFFFC4024 -AT91C_US1_RTOR.width=32 -AT91C_US1_RTOR.byteEndian=little -AT91C_US1_CSR.name="AT91C_US1_CSR" -AT91C_US1_CSR.description="Channel Status Register" -AT91C_US1_CSR.helpkey="Channel Status Register" -AT91C_US1_CSR.access=memorymapped -AT91C_US1_CSR.address=0xFFFC4014 -AT91C_US1_CSR.width=32 -AT91C_US1_CSR.byteEndian=little -AT91C_US1_CSR.permission.write=none -AT91C_US1_IDR.name="AT91C_US1_IDR" -AT91C_US1_IDR.description="Interrupt Disable Register" -AT91C_US1_IDR.helpkey="Interrupt Disable Register" -AT91C_US1_IDR.access=memorymapped -AT91C_US1_IDR.address=0xFFFC400C -AT91C_US1_IDR.width=32 -AT91C_US1_IDR.byteEndian=little -AT91C_US1_IDR.type=enum -AT91C_US1_IDR.enum.0.name=*** Write only *** -AT91C_US1_IDR.enum.1.name=Error -AT91C_US1_IER.name="AT91C_US1_IER" -AT91C_US1_IER.description="Interrupt Enable Register" -AT91C_US1_IER.helpkey="Interrupt Enable Register" -AT91C_US1_IER.access=memorymapped -AT91C_US1_IER.address=0xFFFC4008 -AT91C_US1_IER.width=32 -AT91C_US1_IER.byteEndian=little -AT91C_US1_IER.type=enum -AT91C_US1_IER.enum.0.name=*** Write only *** -AT91C_US1_IER.enum.1.name=Error -AT91C_US1_THR.name="AT91C_US1_THR" -AT91C_US1_THR.description="Transmitter Holding Register" -AT91C_US1_THR.helpkey="Transmitter Holding Register" -AT91C_US1_THR.access=memorymapped -AT91C_US1_THR.address=0xFFFC401C -AT91C_US1_THR.width=32 -AT91C_US1_THR.byteEndian=little -AT91C_US1_THR.type=enum -AT91C_US1_THR.enum.0.name=*** Write only *** -AT91C_US1_THR.enum.1.name=Error -AT91C_US1_TTGR.name="AT91C_US1_TTGR" -AT91C_US1_TTGR.description="Transmitter Time-guard Register" -AT91C_US1_TTGR.helpkey="Transmitter Time-guard Register" -AT91C_US1_TTGR.access=memorymapped -AT91C_US1_TTGR.address=0xFFFC4028 -AT91C_US1_TTGR.width=32 -AT91C_US1_TTGR.byteEndian=little -AT91C_US1_RHR.name="AT91C_US1_RHR" -AT91C_US1_RHR.description="Receiver Holding Register" -AT91C_US1_RHR.helpkey="Receiver Holding Register" -AT91C_US1_RHR.access=memorymapped -AT91C_US1_RHR.address=0xFFFC4018 -AT91C_US1_RHR.width=32 -AT91C_US1_RHR.byteEndian=little -AT91C_US1_RHR.permission.write=none -AT91C_US1_BRGR.name="AT91C_US1_BRGR" -AT91C_US1_BRGR.description="Baud Rate Generator Register" -AT91C_US1_BRGR.helpkey="Baud Rate Generator Register" -AT91C_US1_BRGR.access=memorymapped -AT91C_US1_BRGR.address=0xFFFC4020 -AT91C_US1_BRGR.width=32 -AT91C_US1_BRGR.byteEndian=little -AT91C_US1_IMR.name="AT91C_US1_IMR" -AT91C_US1_IMR.description="Interrupt Mask Register" -AT91C_US1_IMR.helpkey="Interrupt Mask Register" -AT91C_US1_IMR.access=memorymapped -AT91C_US1_IMR.address=0xFFFC4010 -AT91C_US1_IMR.width=32 -AT91C_US1_IMR.byteEndian=little -AT91C_US1_IMR.permission.write=none -AT91C_US1_FIDI.name="AT91C_US1_FIDI" -AT91C_US1_FIDI.description="FI_DI_Ratio Register" -AT91C_US1_FIDI.helpkey="FI_DI_Ratio Register" -AT91C_US1_FIDI.access=memorymapped -AT91C_US1_FIDI.address=0xFFFC4040 -AT91C_US1_FIDI.width=32 -AT91C_US1_FIDI.byteEndian=little -AT91C_US1_CR.name="AT91C_US1_CR" -AT91C_US1_CR.description="Control Register" -AT91C_US1_CR.helpkey="Control Register" -AT91C_US1_CR.access=memorymapped -AT91C_US1_CR.address=0xFFFC4000 -AT91C_US1_CR.width=32 -AT91C_US1_CR.byteEndian=little -AT91C_US1_CR.type=enum -AT91C_US1_CR.enum.0.name=*** Write only *** -AT91C_US1_CR.enum.1.name=Error -AT91C_US1_MR.name="AT91C_US1_MR" -AT91C_US1_MR.description="Mode Register" -AT91C_US1_MR.helpkey="Mode Register" -AT91C_US1_MR.access=memorymapped -AT91C_US1_MR.address=0xFFFC4004 -AT91C_US1_MR.width=32 -AT91C_US1_MR.byteEndian=little -# ========== Register definition for PDC_US0 peripheral ========== -AT91C_US0_TNPR.name="AT91C_US0_TNPR" -AT91C_US0_TNPR.description="Transmit Next Pointer Register" -AT91C_US0_TNPR.helpkey="Transmit Next Pointer Register" -AT91C_US0_TNPR.access=memorymapped -AT91C_US0_TNPR.address=0xFFFC0118 -AT91C_US0_TNPR.width=32 -AT91C_US0_TNPR.byteEndian=little -AT91C_US0_RNPR.name="AT91C_US0_RNPR" -AT91C_US0_RNPR.description="Receive Next Pointer Register" -AT91C_US0_RNPR.helpkey="Receive Next Pointer Register" -AT91C_US0_RNPR.access=memorymapped -AT91C_US0_RNPR.address=0xFFFC0110 -AT91C_US0_RNPR.width=32 -AT91C_US0_RNPR.byteEndian=little -AT91C_US0_TCR.name="AT91C_US0_TCR" -AT91C_US0_TCR.description="Transmit Counter Register" -AT91C_US0_TCR.helpkey="Transmit Counter Register" -AT91C_US0_TCR.access=memorymapped -AT91C_US0_TCR.address=0xFFFC010C -AT91C_US0_TCR.width=32 -AT91C_US0_TCR.byteEndian=little -AT91C_US0_PTCR.name="AT91C_US0_PTCR" -AT91C_US0_PTCR.description="PDC Transfer Control Register" -AT91C_US0_PTCR.helpkey="PDC Transfer Control Register" -AT91C_US0_PTCR.access=memorymapped -AT91C_US0_PTCR.address=0xFFFC0120 -AT91C_US0_PTCR.width=32 -AT91C_US0_PTCR.byteEndian=little -AT91C_US0_PTCR.type=enum -AT91C_US0_PTCR.enum.0.name=*** Write only *** -AT91C_US0_PTCR.enum.1.name=Error -AT91C_US0_PTSR.name="AT91C_US0_PTSR" -AT91C_US0_PTSR.description="PDC Transfer Status Register" -AT91C_US0_PTSR.helpkey="PDC Transfer Status Register" -AT91C_US0_PTSR.access=memorymapped -AT91C_US0_PTSR.address=0xFFFC0124 -AT91C_US0_PTSR.width=32 -AT91C_US0_PTSR.byteEndian=little -AT91C_US0_PTSR.permission.write=none -AT91C_US0_TNCR.name="AT91C_US0_TNCR" -AT91C_US0_TNCR.description="Transmit Next Counter Register" -AT91C_US0_TNCR.helpkey="Transmit Next Counter Register" -AT91C_US0_TNCR.access=memorymapped -AT91C_US0_TNCR.address=0xFFFC011C -AT91C_US0_TNCR.width=32 -AT91C_US0_TNCR.byteEndian=little -AT91C_US0_TPR.name="AT91C_US0_TPR" -AT91C_US0_TPR.description="Transmit Pointer Register" -AT91C_US0_TPR.helpkey="Transmit Pointer Register" -AT91C_US0_TPR.access=memorymapped -AT91C_US0_TPR.address=0xFFFC0108 -AT91C_US0_TPR.width=32 -AT91C_US0_TPR.byteEndian=little -AT91C_US0_RCR.name="AT91C_US0_RCR" -AT91C_US0_RCR.description="Receive Counter Register" -AT91C_US0_RCR.helpkey="Receive Counter Register" -AT91C_US0_RCR.access=memorymapped -AT91C_US0_RCR.address=0xFFFC0104 -AT91C_US0_RCR.width=32 -AT91C_US0_RCR.byteEndian=little -AT91C_US0_RPR.name="AT91C_US0_RPR" -AT91C_US0_RPR.description="Receive Pointer Register" -AT91C_US0_RPR.helpkey="Receive Pointer Register" -AT91C_US0_RPR.access=memorymapped -AT91C_US0_RPR.address=0xFFFC0100 -AT91C_US0_RPR.width=32 -AT91C_US0_RPR.byteEndian=little -AT91C_US0_RNCR.name="AT91C_US0_RNCR" -AT91C_US0_RNCR.description="Receive Next Counter Register" -AT91C_US0_RNCR.helpkey="Receive Next Counter Register" -AT91C_US0_RNCR.access=memorymapped -AT91C_US0_RNCR.address=0xFFFC0114 -AT91C_US0_RNCR.width=32 -AT91C_US0_RNCR.byteEndian=little -# ========== Register definition for US0 peripheral ========== -AT91C_US0_BRGR.name="AT91C_US0_BRGR" -AT91C_US0_BRGR.description="Baud Rate Generator Register" -AT91C_US0_BRGR.helpkey="Baud Rate Generator Register" -AT91C_US0_BRGR.access=memorymapped -AT91C_US0_BRGR.address=0xFFFC0020 -AT91C_US0_BRGR.width=32 -AT91C_US0_BRGR.byteEndian=little -AT91C_US0_NER.name="AT91C_US0_NER" -AT91C_US0_NER.description="Nb Errors Register" -AT91C_US0_NER.helpkey="Nb Errors Register" -AT91C_US0_NER.access=memorymapped -AT91C_US0_NER.address=0xFFFC0044 -AT91C_US0_NER.width=32 -AT91C_US0_NER.byteEndian=little -AT91C_US0_NER.permission.write=none -AT91C_US0_CR.name="AT91C_US0_CR" -AT91C_US0_CR.description="Control Register" -AT91C_US0_CR.helpkey="Control Register" -AT91C_US0_CR.access=memorymapped -AT91C_US0_CR.address=0xFFFC0000 -AT91C_US0_CR.width=32 -AT91C_US0_CR.byteEndian=little -AT91C_US0_CR.type=enum -AT91C_US0_CR.enum.0.name=*** Write only *** -AT91C_US0_CR.enum.1.name=Error -AT91C_US0_IMR.name="AT91C_US0_IMR" -AT91C_US0_IMR.description="Interrupt Mask Register" -AT91C_US0_IMR.helpkey="Interrupt Mask Register" -AT91C_US0_IMR.access=memorymapped -AT91C_US0_IMR.address=0xFFFC0010 -AT91C_US0_IMR.width=32 -AT91C_US0_IMR.byteEndian=little -AT91C_US0_IMR.permission.write=none -AT91C_US0_FIDI.name="AT91C_US0_FIDI" -AT91C_US0_FIDI.description="FI_DI_Ratio Register" -AT91C_US0_FIDI.helpkey="FI_DI_Ratio Register" -AT91C_US0_FIDI.access=memorymapped -AT91C_US0_FIDI.address=0xFFFC0040 -AT91C_US0_FIDI.width=32 -AT91C_US0_FIDI.byteEndian=little -AT91C_US0_TTGR.name="AT91C_US0_TTGR" -AT91C_US0_TTGR.description="Transmitter Time-guard Register" -AT91C_US0_TTGR.helpkey="Transmitter Time-guard Register" -AT91C_US0_TTGR.access=memorymapped -AT91C_US0_TTGR.address=0xFFFC0028 -AT91C_US0_TTGR.width=32 -AT91C_US0_TTGR.byteEndian=little -AT91C_US0_MR.name="AT91C_US0_MR" -AT91C_US0_MR.description="Mode Register" -AT91C_US0_MR.helpkey="Mode Register" -AT91C_US0_MR.access=memorymapped -AT91C_US0_MR.address=0xFFFC0004 -AT91C_US0_MR.width=32 -AT91C_US0_MR.byteEndian=little -AT91C_US0_RTOR.name="AT91C_US0_RTOR" -AT91C_US0_RTOR.description="Receiver Time-out Register" -AT91C_US0_RTOR.helpkey="Receiver Time-out Register" -AT91C_US0_RTOR.access=memorymapped -AT91C_US0_RTOR.address=0xFFFC0024 -AT91C_US0_RTOR.width=32 -AT91C_US0_RTOR.byteEndian=little -AT91C_US0_CSR.name="AT91C_US0_CSR" -AT91C_US0_CSR.description="Channel Status Register" -AT91C_US0_CSR.helpkey="Channel Status Register" -AT91C_US0_CSR.access=memorymapped -AT91C_US0_CSR.address=0xFFFC0014 -AT91C_US0_CSR.width=32 -AT91C_US0_CSR.byteEndian=little -AT91C_US0_CSR.permission.write=none -AT91C_US0_RHR.name="AT91C_US0_RHR" -AT91C_US0_RHR.description="Receiver Holding Register" -AT91C_US0_RHR.helpkey="Receiver Holding Register" -AT91C_US0_RHR.access=memorymapped -AT91C_US0_RHR.address=0xFFFC0018 -AT91C_US0_RHR.width=32 -AT91C_US0_RHR.byteEndian=little -AT91C_US0_RHR.permission.write=none -AT91C_US0_IDR.name="AT91C_US0_IDR" -AT91C_US0_IDR.description="Interrupt Disable Register" -AT91C_US0_IDR.helpkey="Interrupt Disable Register" -AT91C_US0_IDR.access=memorymapped -AT91C_US0_IDR.address=0xFFFC000C -AT91C_US0_IDR.width=32 -AT91C_US0_IDR.byteEndian=little -AT91C_US0_IDR.type=enum -AT91C_US0_IDR.enum.0.name=*** Write only *** -AT91C_US0_IDR.enum.1.name=Error -AT91C_US0_THR.name="AT91C_US0_THR" -AT91C_US0_THR.description="Transmitter Holding Register" -AT91C_US0_THR.helpkey="Transmitter Holding Register" -AT91C_US0_THR.access=memorymapped -AT91C_US0_THR.address=0xFFFC001C -AT91C_US0_THR.width=32 -AT91C_US0_THR.byteEndian=little -AT91C_US0_THR.type=enum -AT91C_US0_THR.enum.0.name=*** Write only *** -AT91C_US0_THR.enum.1.name=Error -AT91C_US0_IF.name="AT91C_US0_IF" -AT91C_US0_IF.description="IRDA_FILTER Register" -AT91C_US0_IF.helpkey="IRDA_FILTER Register" -AT91C_US0_IF.access=memorymapped -AT91C_US0_IF.address=0xFFFC004C -AT91C_US0_IF.width=32 -AT91C_US0_IF.byteEndian=little -AT91C_US0_IER.name="AT91C_US0_IER" -AT91C_US0_IER.description="Interrupt Enable Register" -AT91C_US0_IER.helpkey="Interrupt Enable Register" -AT91C_US0_IER.access=memorymapped -AT91C_US0_IER.address=0xFFFC0008 -AT91C_US0_IER.width=32 -AT91C_US0_IER.byteEndian=little -AT91C_US0_IER.type=enum -AT91C_US0_IER.enum.0.name=*** Write only *** -AT91C_US0_IER.enum.1.name=Error -# ========== Register definition for PDC_SSC peripheral ========== -AT91C_SSC_TNCR.name="AT91C_SSC_TNCR" -AT91C_SSC_TNCR.description="Transmit Next Counter Register" -AT91C_SSC_TNCR.helpkey="Transmit Next Counter Register" -AT91C_SSC_TNCR.access=memorymapped -AT91C_SSC_TNCR.address=0xFFFD411C -AT91C_SSC_TNCR.width=32 -AT91C_SSC_TNCR.byteEndian=little -AT91C_SSC_RPR.name="AT91C_SSC_RPR" -AT91C_SSC_RPR.description="Receive Pointer Register" -AT91C_SSC_RPR.helpkey="Receive Pointer Register" -AT91C_SSC_RPR.access=memorymapped -AT91C_SSC_RPR.address=0xFFFD4100 -AT91C_SSC_RPR.width=32 -AT91C_SSC_RPR.byteEndian=little -AT91C_SSC_RNCR.name="AT91C_SSC_RNCR" -AT91C_SSC_RNCR.description="Receive Next Counter Register" -AT91C_SSC_RNCR.helpkey="Receive Next Counter Register" -AT91C_SSC_RNCR.access=memorymapped -AT91C_SSC_RNCR.address=0xFFFD4114 -AT91C_SSC_RNCR.width=32 -AT91C_SSC_RNCR.byteEndian=little -AT91C_SSC_TPR.name="AT91C_SSC_TPR" -AT91C_SSC_TPR.description="Transmit Pointer Register" -AT91C_SSC_TPR.helpkey="Transmit Pointer Register" -AT91C_SSC_TPR.access=memorymapped -AT91C_SSC_TPR.address=0xFFFD4108 -AT91C_SSC_TPR.width=32 -AT91C_SSC_TPR.byteEndian=little -AT91C_SSC_PTCR.name="AT91C_SSC_PTCR" -AT91C_SSC_PTCR.description="PDC Transfer Control Register" -AT91C_SSC_PTCR.helpkey="PDC Transfer Control Register" -AT91C_SSC_PTCR.access=memorymapped -AT91C_SSC_PTCR.address=0xFFFD4120 -AT91C_SSC_PTCR.width=32 -AT91C_SSC_PTCR.byteEndian=little -AT91C_SSC_PTCR.type=enum -AT91C_SSC_PTCR.enum.0.name=*** Write only *** -AT91C_SSC_PTCR.enum.1.name=Error -AT91C_SSC_TCR.name="AT91C_SSC_TCR" -AT91C_SSC_TCR.description="Transmit Counter Register" -AT91C_SSC_TCR.helpkey="Transmit Counter Register" -AT91C_SSC_TCR.access=memorymapped -AT91C_SSC_TCR.address=0xFFFD410C -AT91C_SSC_TCR.width=32 -AT91C_SSC_TCR.byteEndian=little -AT91C_SSC_RCR.name="AT91C_SSC_RCR" -AT91C_SSC_RCR.description="Receive Counter Register" -AT91C_SSC_RCR.helpkey="Receive Counter Register" -AT91C_SSC_RCR.access=memorymapped -AT91C_SSC_RCR.address=0xFFFD4104 -AT91C_SSC_RCR.width=32 -AT91C_SSC_RCR.byteEndian=little -AT91C_SSC_RNPR.name="AT91C_SSC_RNPR" -AT91C_SSC_RNPR.description="Receive Next Pointer Register" -AT91C_SSC_RNPR.helpkey="Receive Next Pointer Register" -AT91C_SSC_RNPR.access=memorymapped -AT91C_SSC_RNPR.address=0xFFFD4110 -AT91C_SSC_RNPR.width=32 -AT91C_SSC_RNPR.byteEndian=little -AT91C_SSC_TNPR.name="AT91C_SSC_TNPR" -AT91C_SSC_TNPR.description="Transmit Next Pointer Register" -AT91C_SSC_TNPR.helpkey="Transmit Next Pointer Register" -AT91C_SSC_TNPR.access=memorymapped -AT91C_SSC_TNPR.address=0xFFFD4118 -AT91C_SSC_TNPR.width=32 -AT91C_SSC_TNPR.byteEndian=little -AT91C_SSC_PTSR.name="AT91C_SSC_PTSR" -AT91C_SSC_PTSR.description="PDC Transfer Status Register" -AT91C_SSC_PTSR.helpkey="PDC Transfer Status Register" -AT91C_SSC_PTSR.access=memorymapped -AT91C_SSC_PTSR.address=0xFFFD4124 -AT91C_SSC_PTSR.width=32 -AT91C_SSC_PTSR.byteEndian=little -AT91C_SSC_PTSR.permission.write=none -# ========== Register definition for SSC peripheral ========== -AT91C_SSC_RHR.name="AT91C_SSC_RHR" -AT91C_SSC_RHR.description="Receive Holding Register" -AT91C_SSC_RHR.helpkey="Receive Holding Register" -AT91C_SSC_RHR.access=memorymapped -AT91C_SSC_RHR.address=0xFFFD4020 -AT91C_SSC_RHR.width=32 -AT91C_SSC_RHR.byteEndian=little -AT91C_SSC_RHR.permission.write=none -AT91C_SSC_RSHR.name="AT91C_SSC_RSHR" -AT91C_SSC_RSHR.description="Receive Sync Holding Register" -AT91C_SSC_RSHR.helpkey="Receive Sync Holding Register" -AT91C_SSC_RSHR.access=memorymapped -AT91C_SSC_RSHR.address=0xFFFD4030 -AT91C_SSC_RSHR.width=32 -AT91C_SSC_RSHR.byteEndian=little -AT91C_SSC_RSHR.permission.write=none -AT91C_SSC_TFMR.name="AT91C_SSC_TFMR" -AT91C_SSC_TFMR.description="Transmit Frame Mode Register" -AT91C_SSC_TFMR.helpkey="Transmit Frame Mode Register" -AT91C_SSC_TFMR.access=memorymapped -AT91C_SSC_TFMR.address=0xFFFD401C -AT91C_SSC_TFMR.width=32 -AT91C_SSC_TFMR.byteEndian=little -AT91C_SSC_IDR.name="AT91C_SSC_IDR" -AT91C_SSC_IDR.description="Interrupt Disable Register" -AT91C_SSC_IDR.helpkey="Interrupt Disable Register" -AT91C_SSC_IDR.access=memorymapped -AT91C_SSC_IDR.address=0xFFFD4048 -AT91C_SSC_IDR.width=32 -AT91C_SSC_IDR.byteEndian=little -AT91C_SSC_IDR.type=enum -AT91C_SSC_IDR.enum.0.name=*** Write only *** -AT91C_SSC_IDR.enum.1.name=Error -AT91C_SSC_THR.name="AT91C_SSC_THR" -AT91C_SSC_THR.description="Transmit Holding Register" -AT91C_SSC_THR.helpkey="Transmit Holding Register" -AT91C_SSC_THR.access=memorymapped -AT91C_SSC_THR.address=0xFFFD4024 -AT91C_SSC_THR.width=32 -AT91C_SSC_THR.byteEndian=little -AT91C_SSC_THR.type=enum -AT91C_SSC_THR.enum.0.name=*** Write only *** -AT91C_SSC_THR.enum.1.name=Error -AT91C_SSC_RCMR.name="AT91C_SSC_RCMR" -AT91C_SSC_RCMR.description="Receive Clock ModeRegister" -AT91C_SSC_RCMR.helpkey="Receive Clock ModeRegister" -AT91C_SSC_RCMR.access=memorymapped -AT91C_SSC_RCMR.address=0xFFFD4010 -AT91C_SSC_RCMR.width=32 -AT91C_SSC_RCMR.byteEndian=little -AT91C_SSC_IER.name="AT91C_SSC_IER" -AT91C_SSC_IER.description="Interrupt Enable Register" -AT91C_SSC_IER.helpkey="Interrupt Enable Register" -AT91C_SSC_IER.access=memorymapped -AT91C_SSC_IER.address=0xFFFD4044 -AT91C_SSC_IER.width=32 -AT91C_SSC_IER.byteEndian=little -AT91C_SSC_IER.type=enum -AT91C_SSC_IER.enum.0.name=*** Write only *** -AT91C_SSC_IER.enum.1.name=Error -AT91C_SSC_TSHR.name="AT91C_SSC_TSHR" -AT91C_SSC_TSHR.description="Transmit Sync Holding Register" -AT91C_SSC_TSHR.helpkey="Transmit Sync Holding Register" -AT91C_SSC_TSHR.access=memorymapped -AT91C_SSC_TSHR.address=0xFFFD4034 -AT91C_SSC_TSHR.width=32 -AT91C_SSC_TSHR.byteEndian=little -AT91C_SSC_SR.name="AT91C_SSC_SR" -AT91C_SSC_SR.description="Status Register" -AT91C_SSC_SR.helpkey="Status Register" -AT91C_SSC_SR.access=memorymapped -AT91C_SSC_SR.address=0xFFFD4040 -AT91C_SSC_SR.width=32 -AT91C_SSC_SR.byteEndian=little -AT91C_SSC_SR.permission.write=none -AT91C_SSC_CMR.name="AT91C_SSC_CMR" -AT91C_SSC_CMR.description="Clock Mode Register" -AT91C_SSC_CMR.helpkey="Clock Mode Register" -AT91C_SSC_CMR.access=memorymapped -AT91C_SSC_CMR.address=0xFFFD4004 -AT91C_SSC_CMR.width=32 -AT91C_SSC_CMR.byteEndian=little -AT91C_SSC_TCMR.name="AT91C_SSC_TCMR" -AT91C_SSC_TCMR.description="Transmit Clock Mode Register" -AT91C_SSC_TCMR.helpkey="Transmit Clock Mode Register" -AT91C_SSC_TCMR.access=memorymapped -AT91C_SSC_TCMR.address=0xFFFD4018 -AT91C_SSC_TCMR.width=32 -AT91C_SSC_TCMR.byteEndian=little -AT91C_SSC_CR.name="AT91C_SSC_CR" -AT91C_SSC_CR.description="Control Register" -AT91C_SSC_CR.helpkey="Control Register" -AT91C_SSC_CR.access=memorymapped -AT91C_SSC_CR.address=0xFFFD4000 -AT91C_SSC_CR.width=32 -AT91C_SSC_CR.byteEndian=little -AT91C_SSC_CR.type=enum -AT91C_SSC_CR.enum.0.name=*** Write only *** -AT91C_SSC_CR.enum.1.name=Error -AT91C_SSC_IMR.name="AT91C_SSC_IMR" -AT91C_SSC_IMR.description="Interrupt Mask Register" -AT91C_SSC_IMR.helpkey="Interrupt Mask Register" -AT91C_SSC_IMR.access=memorymapped -AT91C_SSC_IMR.address=0xFFFD404C -AT91C_SSC_IMR.width=32 -AT91C_SSC_IMR.byteEndian=little -AT91C_SSC_IMR.permission.write=none -AT91C_SSC_RFMR.name="AT91C_SSC_RFMR" -AT91C_SSC_RFMR.description="Receive Frame Mode Register" -AT91C_SSC_RFMR.helpkey="Receive Frame Mode Register" -AT91C_SSC_RFMR.access=memorymapped -AT91C_SSC_RFMR.address=0xFFFD4014 -AT91C_SSC_RFMR.width=32 -AT91C_SSC_RFMR.byteEndian=little -# ========== Register definition for TWI peripheral ========== -AT91C_TWI_IER.name="AT91C_TWI_IER" -AT91C_TWI_IER.description="Interrupt Enable Register" -AT91C_TWI_IER.helpkey="Interrupt Enable Register" -AT91C_TWI_IER.access=memorymapped -AT91C_TWI_IER.address=0xFFFB8024 -AT91C_TWI_IER.width=32 -AT91C_TWI_IER.byteEndian=little -AT91C_TWI_IER.type=enum -AT91C_TWI_IER.enum.0.name=*** Write only *** -AT91C_TWI_IER.enum.1.name=Error -AT91C_TWI_CR.name="AT91C_TWI_CR" -AT91C_TWI_CR.description="Control Register" -AT91C_TWI_CR.helpkey="Control Register" -AT91C_TWI_CR.access=memorymapped -AT91C_TWI_CR.address=0xFFFB8000 -AT91C_TWI_CR.width=32 -AT91C_TWI_CR.byteEndian=little -AT91C_TWI_CR.type=enum -AT91C_TWI_CR.enum.0.name=*** Write only *** -AT91C_TWI_CR.enum.1.name=Error -AT91C_TWI_SR.name="AT91C_TWI_SR" -AT91C_TWI_SR.description="Status Register" -AT91C_TWI_SR.helpkey="Status Register" -AT91C_TWI_SR.access=memorymapped -AT91C_TWI_SR.address=0xFFFB8020 -AT91C_TWI_SR.width=32 -AT91C_TWI_SR.byteEndian=little -AT91C_TWI_SR.permission.write=none -AT91C_TWI_IMR.name="AT91C_TWI_IMR" -AT91C_TWI_IMR.description="Interrupt Mask Register" -AT91C_TWI_IMR.helpkey="Interrupt Mask Register" -AT91C_TWI_IMR.access=memorymapped -AT91C_TWI_IMR.address=0xFFFB802C -AT91C_TWI_IMR.width=32 -AT91C_TWI_IMR.byteEndian=little -AT91C_TWI_IMR.permission.write=none -AT91C_TWI_THR.name="AT91C_TWI_THR" -AT91C_TWI_THR.description="Transmit Holding Register" -AT91C_TWI_THR.helpkey="Transmit Holding Register" -AT91C_TWI_THR.access=memorymapped -AT91C_TWI_THR.address=0xFFFB8034 -AT91C_TWI_THR.width=32 -AT91C_TWI_THR.byteEndian=little -AT91C_TWI_THR.type=enum -AT91C_TWI_THR.enum.0.name=*** Write only *** -AT91C_TWI_THR.enum.1.name=Error -AT91C_TWI_IDR.name="AT91C_TWI_IDR" -AT91C_TWI_IDR.description="Interrupt Disable Register" -AT91C_TWI_IDR.helpkey="Interrupt Disable Register" -AT91C_TWI_IDR.access=memorymapped -AT91C_TWI_IDR.address=0xFFFB8028 -AT91C_TWI_IDR.width=32 -AT91C_TWI_IDR.byteEndian=little -AT91C_TWI_IDR.type=enum -AT91C_TWI_IDR.enum.0.name=*** Write only *** -AT91C_TWI_IDR.enum.1.name=Error -AT91C_TWI_IADR.name="AT91C_TWI_IADR" -AT91C_TWI_IADR.description="Internal Address Register" -AT91C_TWI_IADR.helpkey="Internal Address Register" -AT91C_TWI_IADR.access=memorymapped -AT91C_TWI_IADR.address=0xFFFB800C -AT91C_TWI_IADR.width=32 -AT91C_TWI_IADR.byteEndian=little -AT91C_TWI_MMR.name="AT91C_TWI_MMR" -AT91C_TWI_MMR.description="Master Mode Register" -AT91C_TWI_MMR.helpkey="Master Mode Register" -AT91C_TWI_MMR.access=memorymapped -AT91C_TWI_MMR.address=0xFFFB8004 -AT91C_TWI_MMR.width=32 -AT91C_TWI_MMR.byteEndian=little -AT91C_TWI_CWGR.name="AT91C_TWI_CWGR" -AT91C_TWI_CWGR.description="Clock Waveform Generator Register" -AT91C_TWI_CWGR.helpkey="Clock Waveform Generator Register" -AT91C_TWI_CWGR.access=memorymapped -AT91C_TWI_CWGR.address=0xFFFB8010 -AT91C_TWI_CWGR.width=32 -AT91C_TWI_CWGR.byteEndian=little -AT91C_TWI_RHR.name="AT91C_TWI_RHR" -AT91C_TWI_RHR.description="Receive Holding Register" -AT91C_TWI_RHR.helpkey="Receive Holding Register" -AT91C_TWI_RHR.access=memorymapped -AT91C_TWI_RHR.address=0xFFFB8030 -AT91C_TWI_RHR.width=32 -AT91C_TWI_RHR.byteEndian=little -AT91C_TWI_RHR.permission.write=none -# ========== Register definition for PWMC_CH3 peripheral ========== -AT91C_PWMC_CH3_CUPDR.name="AT91C_PWMC_CH3_CUPDR" -AT91C_PWMC_CH3_CUPDR.description="Channel Update Register" -AT91C_PWMC_CH3_CUPDR.helpkey="Channel Update Register" -AT91C_PWMC_CH3_CUPDR.access=memorymapped -AT91C_PWMC_CH3_CUPDR.address=0xFFFCC270 -AT91C_PWMC_CH3_CUPDR.width=32 -AT91C_PWMC_CH3_CUPDR.byteEndian=little -AT91C_PWMC_CH3_CUPDR.type=enum -AT91C_PWMC_CH3_CUPDR.enum.0.name=*** Write only *** -AT91C_PWMC_CH3_CUPDR.enum.1.name=Error -AT91C_PWMC_CH3_Reserved.name="AT91C_PWMC_CH3_Reserved" -AT91C_PWMC_CH3_Reserved.description="Reserved" -AT91C_PWMC_CH3_Reserved.helpkey="Reserved" -AT91C_PWMC_CH3_Reserved.access=memorymapped -AT91C_PWMC_CH3_Reserved.address=0xFFFCC274 -AT91C_PWMC_CH3_Reserved.width=32 -AT91C_PWMC_CH3_Reserved.byteEndian=little -AT91C_PWMC_CH3_Reserved.type=enum -AT91C_PWMC_CH3_Reserved.enum.0.name=*** Write only *** -AT91C_PWMC_CH3_Reserved.enum.1.name=Error -AT91C_PWMC_CH3_CPRDR.name="AT91C_PWMC_CH3_CPRDR" -AT91C_PWMC_CH3_CPRDR.description="Channel Period Register" -AT91C_PWMC_CH3_CPRDR.helpkey="Channel Period Register" -AT91C_PWMC_CH3_CPRDR.access=memorymapped -AT91C_PWMC_CH3_CPRDR.address=0xFFFCC268 -AT91C_PWMC_CH3_CPRDR.width=32 -AT91C_PWMC_CH3_CPRDR.byteEndian=little -AT91C_PWMC_CH3_CDTYR.name="AT91C_PWMC_CH3_CDTYR" -AT91C_PWMC_CH3_CDTYR.description="Channel Duty Cycle Register" -AT91C_PWMC_CH3_CDTYR.helpkey="Channel Duty Cycle Register" -AT91C_PWMC_CH3_CDTYR.access=memorymapped -AT91C_PWMC_CH3_CDTYR.address=0xFFFCC264 -AT91C_PWMC_CH3_CDTYR.width=32 -AT91C_PWMC_CH3_CDTYR.byteEndian=little -AT91C_PWMC_CH3_CCNTR.name="AT91C_PWMC_CH3_CCNTR" -AT91C_PWMC_CH3_CCNTR.description="Channel Counter Register" -AT91C_PWMC_CH3_CCNTR.helpkey="Channel Counter Register" -AT91C_PWMC_CH3_CCNTR.access=memorymapped -AT91C_PWMC_CH3_CCNTR.address=0xFFFCC26C -AT91C_PWMC_CH3_CCNTR.width=32 -AT91C_PWMC_CH3_CCNTR.byteEndian=little -AT91C_PWMC_CH3_CCNTR.permission.write=none -AT91C_PWMC_CH3_CMR.name="AT91C_PWMC_CH3_CMR" -AT91C_PWMC_CH3_CMR.description="Channel Mode Register" -AT91C_PWMC_CH3_CMR.helpkey="Channel Mode Register" -AT91C_PWMC_CH3_CMR.access=memorymapped -AT91C_PWMC_CH3_CMR.address=0xFFFCC260 -AT91C_PWMC_CH3_CMR.width=32 -AT91C_PWMC_CH3_CMR.byteEndian=little -# ========== Register definition for PWMC_CH2 peripheral ========== -AT91C_PWMC_CH2_Reserved.name="AT91C_PWMC_CH2_Reserved" -AT91C_PWMC_CH2_Reserved.description="Reserved" -AT91C_PWMC_CH2_Reserved.helpkey="Reserved" -AT91C_PWMC_CH2_Reserved.access=memorymapped -AT91C_PWMC_CH2_Reserved.address=0xFFFCC254 -AT91C_PWMC_CH2_Reserved.width=32 -AT91C_PWMC_CH2_Reserved.byteEndian=little -AT91C_PWMC_CH2_Reserved.type=enum -AT91C_PWMC_CH2_Reserved.enum.0.name=*** Write only *** -AT91C_PWMC_CH2_Reserved.enum.1.name=Error -AT91C_PWMC_CH2_CMR.name="AT91C_PWMC_CH2_CMR" -AT91C_PWMC_CH2_CMR.description="Channel Mode Register" -AT91C_PWMC_CH2_CMR.helpkey="Channel Mode Register" -AT91C_PWMC_CH2_CMR.access=memorymapped -AT91C_PWMC_CH2_CMR.address=0xFFFCC240 -AT91C_PWMC_CH2_CMR.width=32 -AT91C_PWMC_CH2_CMR.byteEndian=little -AT91C_PWMC_CH2_CCNTR.name="AT91C_PWMC_CH2_CCNTR" -AT91C_PWMC_CH2_CCNTR.description="Channel Counter Register" -AT91C_PWMC_CH2_CCNTR.helpkey="Channel Counter Register" -AT91C_PWMC_CH2_CCNTR.access=memorymapped -AT91C_PWMC_CH2_CCNTR.address=0xFFFCC24C -AT91C_PWMC_CH2_CCNTR.width=32 -AT91C_PWMC_CH2_CCNTR.byteEndian=little -AT91C_PWMC_CH2_CCNTR.permission.write=none -AT91C_PWMC_CH2_CPRDR.name="AT91C_PWMC_CH2_CPRDR" -AT91C_PWMC_CH2_CPRDR.description="Channel Period Register" -AT91C_PWMC_CH2_CPRDR.helpkey="Channel Period Register" -AT91C_PWMC_CH2_CPRDR.access=memorymapped -AT91C_PWMC_CH2_CPRDR.address=0xFFFCC248 -AT91C_PWMC_CH2_CPRDR.width=32 -AT91C_PWMC_CH2_CPRDR.byteEndian=little -AT91C_PWMC_CH2_CUPDR.name="AT91C_PWMC_CH2_CUPDR" -AT91C_PWMC_CH2_CUPDR.description="Channel Update Register" -AT91C_PWMC_CH2_CUPDR.helpkey="Channel Update Register" -AT91C_PWMC_CH2_CUPDR.access=memorymapped -AT91C_PWMC_CH2_CUPDR.address=0xFFFCC250 -AT91C_PWMC_CH2_CUPDR.width=32 -AT91C_PWMC_CH2_CUPDR.byteEndian=little -AT91C_PWMC_CH2_CUPDR.type=enum -AT91C_PWMC_CH2_CUPDR.enum.0.name=*** Write only *** -AT91C_PWMC_CH2_CUPDR.enum.1.name=Error -AT91C_PWMC_CH2_CDTYR.name="AT91C_PWMC_CH2_CDTYR" -AT91C_PWMC_CH2_CDTYR.description="Channel Duty Cycle Register" -AT91C_PWMC_CH2_CDTYR.helpkey="Channel Duty Cycle Register" -AT91C_PWMC_CH2_CDTYR.access=memorymapped -AT91C_PWMC_CH2_CDTYR.address=0xFFFCC244 -AT91C_PWMC_CH2_CDTYR.width=32 -AT91C_PWMC_CH2_CDTYR.byteEndian=little -# ========== Register definition for PWMC_CH1 peripheral ========== -AT91C_PWMC_CH1_Reserved.name="AT91C_PWMC_CH1_Reserved" -AT91C_PWMC_CH1_Reserved.description="Reserved" -AT91C_PWMC_CH1_Reserved.helpkey="Reserved" -AT91C_PWMC_CH1_Reserved.access=memorymapped -AT91C_PWMC_CH1_Reserved.address=0xFFFCC234 -AT91C_PWMC_CH1_Reserved.width=32 -AT91C_PWMC_CH1_Reserved.byteEndian=little -AT91C_PWMC_CH1_Reserved.type=enum -AT91C_PWMC_CH1_Reserved.enum.0.name=*** Write only *** -AT91C_PWMC_CH1_Reserved.enum.1.name=Error -AT91C_PWMC_CH1_CUPDR.name="AT91C_PWMC_CH1_CUPDR" -AT91C_PWMC_CH1_CUPDR.description="Channel Update Register" -AT91C_PWMC_CH1_CUPDR.helpkey="Channel Update Register" -AT91C_PWMC_CH1_CUPDR.access=memorymapped -AT91C_PWMC_CH1_CUPDR.address=0xFFFCC230 -AT91C_PWMC_CH1_CUPDR.width=32 -AT91C_PWMC_CH1_CUPDR.byteEndian=little -AT91C_PWMC_CH1_CUPDR.type=enum -AT91C_PWMC_CH1_CUPDR.enum.0.name=*** Write only *** -AT91C_PWMC_CH1_CUPDR.enum.1.name=Error -AT91C_PWMC_CH1_CPRDR.name="AT91C_PWMC_CH1_CPRDR" -AT91C_PWMC_CH1_CPRDR.description="Channel Period Register" -AT91C_PWMC_CH1_CPRDR.helpkey="Channel Period Register" -AT91C_PWMC_CH1_CPRDR.access=memorymapped -AT91C_PWMC_CH1_CPRDR.address=0xFFFCC228 -AT91C_PWMC_CH1_CPRDR.width=32 -AT91C_PWMC_CH1_CPRDR.byteEndian=little -AT91C_PWMC_CH1_CCNTR.name="AT91C_PWMC_CH1_CCNTR" -AT91C_PWMC_CH1_CCNTR.description="Channel Counter Register" -AT91C_PWMC_CH1_CCNTR.helpkey="Channel Counter Register" -AT91C_PWMC_CH1_CCNTR.access=memorymapped -AT91C_PWMC_CH1_CCNTR.address=0xFFFCC22C -AT91C_PWMC_CH1_CCNTR.width=32 -AT91C_PWMC_CH1_CCNTR.byteEndian=little -AT91C_PWMC_CH1_CCNTR.permission.write=none -AT91C_PWMC_CH1_CDTYR.name="AT91C_PWMC_CH1_CDTYR" -AT91C_PWMC_CH1_CDTYR.description="Channel Duty Cycle Register" -AT91C_PWMC_CH1_CDTYR.helpkey="Channel Duty Cycle Register" -AT91C_PWMC_CH1_CDTYR.access=memorymapped -AT91C_PWMC_CH1_CDTYR.address=0xFFFCC224 -AT91C_PWMC_CH1_CDTYR.width=32 -AT91C_PWMC_CH1_CDTYR.byteEndian=little -AT91C_PWMC_CH1_CMR.name="AT91C_PWMC_CH1_CMR" -AT91C_PWMC_CH1_CMR.description="Channel Mode Register" -AT91C_PWMC_CH1_CMR.helpkey="Channel Mode Register" -AT91C_PWMC_CH1_CMR.access=memorymapped -AT91C_PWMC_CH1_CMR.address=0xFFFCC220 -AT91C_PWMC_CH1_CMR.width=32 -AT91C_PWMC_CH1_CMR.byteEndian=little -# ========== Register definition for PWMC_CH0 peripheral ========== -AT91C_PWMC_CH0_Reserved.name="AT91C_PWMC_CH0_Reserved" -AT91C_PWMC_CH0_Reserved.description="Reserved" -AT91C_PWMC_CH0_Reserved.helpkey="Reserved" -AT91C_PWMC_CH0_Reserved.access=memorymapped -AT91C_PWMC_CH0_Reserved.address=0xFFFCC214 -AT91C_PWMC_CH0_Reserved.width=32 -AT91C_PWMC_CH0_Reserved.byteEndian=little -AT91C_PWMC_CH0_Reserved.type=enum -AT91C_PWMC_CH0_Reserved.enum.0.name=*** Write only *** -AT91C_PWMC_CH0_Reserved.enum.1.name=Error -AT91C_PWMC_CH0_CPRDR.name="AT91C_PWMC_CH0_CPRDR" -AT91C_PWMC_CH0_CPRDR.description="Channel Period Register" -AT91C_PWMC_CH0_CPRDR.helpkey="Channel Period Register" -AT91C_PWMC_CH0_CPRDR.access=memorymapped -AT91C_PWMC_CH0_CPRDR.address=0xFFFCC208 -AT91C_PWMC_CH0_CPRDR.width=32 -AT91C_PWMC_CH0_CPRDR.byteEndian=little -AT91C_PWMC_CH0_CDTYR.name="AT91C_PWMC_CH0_CDTYR" -AT91C_PWMC_CH0_CDTYR.description="Channel Duty Cycle Register" -AT91C_PWMC_CH0_CDTYR.helpkey="Channel Duty Cycle Register" -AT91C_PWMC_CH0_CDTYR.access=memorymapped -AT91C_PWMC_CH0_CDTYR.address=0xFFFCC204 -AT91C_PWMC_CH0_CDTYR.width=32 -AT91C_PWMC_CH0_CDTYR.byteEndian=little -AT91C_PWMC_CH0_CMR.name="AT91C_PWMC_CH0_CMR" -AT91C_PWMC_CH0_CMR.description="Channel Mode Register" -AT91C_PWMC_CH0_CMR.helpkey="Channel Mode Register" -AT91C_PWMC_CH0_CMR.access=memorymapped -AT91C_PWMC_CH0_CMR.address=0xFFFCC200 -AT91C_PWMC_CH0_CMR.width=32 -AT91C_PWMC_CH0_CMR.byteEndian=little -AT91C_PWMC_CH0_CUPDR.name="AT91C_PWMC_CH0_CUPDR" -AT91C_PWMC_CH0_CUPDR.description="Channel Update Register" -AT91C_PWMC_CH0_CUPDR.helpkey="Channel Update Register" -AT91C_PWMC_CH0_CUPDR.access=memorymapped -AT91C_PWMC_CH0_CUPDR.address=0xFFFCC210 -AT91C_PWMC_CH0_CUPDR.width=32 -AT91C_PWMC_CH0_CUPDR.byteEndian=little -AT91C_PWMC_CH0_CUPDR.type=enum -AT91C_PWMC_CH0_CUPDR.enum.0.name=*** Write only *** -AT91C_PWMC_CH0_CUPDR.enum.1.name=Error -AT91C_PWMC_CH0_CCNTR.name="AT91C_PWMC_CH0_CCNTR" -AT91C_PWMC_CH0_CCNTR.description="Channel Counter Register" -AT91C_PWMC_CH0_CCNTR.helpkey="Channel Counter Register" -AT91C_PWMC_CH0_CCNTR.access=memorymapped -AT91C_PWMC_CH0_CCNTR.address=0xFFFCC20C -AT91C_PWMC_CH0_CCNTR.width=32 -AT91C_PWMC_CH0_CCNTR.byteEndian=little -AT91C_PWMC_CH0_CCNTR.permission.write=none -# ========== Register definition for PWMC peripheral ========== -AT91C_PWMC_IDR.name="AT91C_PWMC_IDR" -AT91C_PWMC_IDR.description="PWMC Interrupt Disable Register" -AT91C_PWMC_IDR.helpkey="PWMC Interrupt Disable Register" -AT91C_PWMC_IDR.access=memorymapped -AT91C_PWMC_IDR.address=0xFFFCC014 -AT91C_PWMC_IDR.width=32 -AT91C_PWMC_IDR.byteEndian=little -AT91C_PWMC_IDR.type=enum -AT91C_PWMC_IDR.enum.0.name=*** Write only *** -AT91C_PWMC_IDR.enum.1.name=Error -AT91C_PWMC_DIS.name="AT91C_PWMC_DIS" -AT91C_PWMC_DIS.description="PWMC Disable Register" -AT91C_PWMC_DIS.helpkey="PWMC Disable Register" -AT91C_PWMC_DIS.access=memorymapped -AT91C_PWMC_DIS.address=0xFFFCC008 -AT91C_PWMC_DIS.width=32 -AT91C_PWMC_DIS.byteEndian=little -AT91C_PWMC_DIS.type=enum -AT91C_PWMC_DIS.enum.0.name=*** Write only *** -AT91C_PWMC_DIS.enum.1.name=Error -AT91C_PWMC_IER.name="AT91C_PWMC_IER" -AT91C_PWMC_IER.description="PWMC Interrupt Enable Register" -AT91C_PWMC_IER.helpkey="PWMC Interrupt Enable Register" -AT91C_PWMC_IER.access=memorymapped -AT91C_PWMC_IER.address=0xFFFCC010 -AT91C_PWMC_IER.width=32 -AT91C_PWMC_IER.byteEndian=little -AT91C_PWMC_IER.type=enum -AT91C_PWMC_IER.enum.0.name=*** Write only *** -AT91C_PWMC_IER.enum.1.name=Error -AT91C_PWMC_VR.name="AT91C_PWMC_VR" -AT91C_PWMC_VR.description="PWMC Version Register" -AT91C_PWMC_VR.helpkey="PWMC Version Register" -AT91C_PWMC_VR.access=memorymapped -AT91C_PWMC_VR.address=0xFFFCC0FC -AT91C_PWMC_VR.width=32 -AT91C_PWMC_VR.byteEndian=little -AT91C_PWMC_VR.permission.write=none -AT91C_PWMC_ISR.name="AT91C_PWMC_ISR" -AT91C_PWMC_ISR.description="PWMC Interrupt Status Register" -AT91C_PWMC_ISR.helpkey="PWMC Interrupt Status Register" -AT91C_PWMC_ISR.access=memorymapped -AT91C_PWMC_ISR.address=0xFFFCC01C -AT91C_PWMC_ISR.width=32 -AT91C_PWMC_ISR.byteEndian=little -AT91C_PWMC_ISR.permission.write=none -AT91C_PWMC_SR.name="AT91C_PWMC_SR" -AT91C_PWMC_SR.description="PWMC Status Register" -AT91C_PWMC_SR.helpkey="PWMC Status Register" -AT91C_PWMC_SR.access=memorymapped -AT91C_PWMC_SR.address=0xFFFCC00C -AT91C_PWMC_SR.width=32 -AT91C_PWMC_SR.byteEndian=little -AT91C_PWMC_SR.permission.write=none -AT91C_PWMC_IMR.name="AT91C_PWMC_IMR" -AT91C_PWMC_IMR.description="PWMC Interrupt Mask Register" -AT91C_PWMC_IMR.helpkey="PWMC Interrupt Mask Register" -AT91C_PWMC_IMR.access=memorymapped -AT91C_PWMC_IMR.address=0xFFFCC018 -AT91C_PWMC_IMR.width=32 -AT91C_PWMC_IMR.byteEndian=little -AT91C_PWMC_IMR.permission.write=none -AT91C_PWMC_MR.name="AT91C_PWMC_MR" -AT91C_PWMC_MR.description="PWMC Mode Register" -AT91C_PWMC_MR.helpkey="PWMC Mode Register" -AT91C_PWMC_MR.access=memorymapped -AT91C_PWMC_MR.address=0xFFFCC000 -AT91C_PWMC_MR.width=32 -AT91C_PWMC_MR.byteEndian=little -AT91C_PWMC_ENA.name="AT91C_PWMC_ENA" -AT91C_PWMC_ENA.description="PWMC Enable Register" -AT91C_PWMC_ENA.helpkey="PWMC Enable Register" -AT91C_PWMC_ENA.access=memorymapped -AT91C_PWMC_ENA.address=0xFFFCC004 -AT91C_PWMC_ENA.width=32 -AT91C_PWMC_ENA.byteEndian=little -AT91C_PWMC_ENA.type=enum -AT91C_PWMC_ENA.enum.0.name=*** Write only *** -AT91C_PWMC_ENA.enum.1.name=Error -# ========== Register definition for UDP peripheral ========== -AT91C_UDP_IMR.name="AT91C_UDP_IMR" -AT91C_UDP_IMR.description="Interrupt Mask Register" -AT91C_UDP_IMR.helpkey="Interrupt Mask Register" -AT91C_UDP_IMR.access=memorymapped -AT91C_UDP_IMR.address=0xFFFB0018 -AT91C_UDP_IMR.width=32 -AT91C_UDP_IMR.byteEndian=little -AT91C_UDP_IMR.permission.write=none -AT91C_UDP_FADDR.name="AT91C_UDP_FADDR" -AT91C_UDP_FADDR.description="Function Address Register" -AT91C_UDP_FADDR.helpkey="Function Address Register" -AT91C_UDP_FADDR.access=memorymapped -AT91C_UDP_FADDR.address=0xFFFB0008 -AT91C_UDP_FADDR.width=32 -AT91C_UDP_FADDR.byteEndian=little -AT91C_UDP_NUM.name="AT91C_UDP_NUM" -AT91C_UDP_NUM.description="Frame Number Register" -AT91C_UDP_NUM.helpkey="Frame Number Register" -AT91C_UDP_NUM.access=memorymapped -AT91C_UDP_NUM.address=0xFFFB0000 -AT91C_UDP_NUM.width=32 -AT91C_UDP_NUM.byteEndian=little -AT91C_UDP_NUM.permission.write=none -AT91C_UDP_FDR.name="AT91C_UDP_FDR" -AT91C_UDP_FDR.description="Endpoint FIFO Data Register" -AT91C_UDP_FDR.helpkey="Endpoint FIFO Data Register" -AT91C_UDP_FDR.access=memorymapped -AT91C_UDP_FDR.address=0xFFFB0050 -AT91C_UDP_FDR.width=32 -AT91C_UDP_FDR.byteEndian=little -AT91C_UDP_ISR.name="AT91C_UDP_ISR" -AT91C_UDP_ISR.description="Interrupt Status Register" -AT91C_UDP_ISR.helpkey="Interrupt Status Register" -AT91C_UDP_ISR.access=memorymapped -AT91C_UDP_ISR.address=0xFFFB001C -AT91C_UDP_ISR.width=32 -AT91C_UDP_ISR.byteEndian=little -AT91C_UDP_ISR.permission.write=none -AT91C_UDP_CSR.name="AT91C_UDP_CSR" -AT91C_UDP_CSR.description="Endpoint Control and Status Register" -AT91C_UDP_CSR.helpkey="Endpoint Control and Status Register" -AT91C_UDP_CSR.access=memorymapped -AT91C_UDP_CSR.address=0xFFFB0030 -AT91C_UDP_CSR.width=32 -AT91C_UDP_CSR.byteEndian=little -AT91C_UDP_IDR.name="AT91C_UDP_IDR" -AT91C_UDP_IDR.description="Interrupt Disable Register" -AT91C_UDP_IDR.helpkey="Interrupt Disable Register" -AT91C_UDP_IDR.access=memorymapped -AT91C_UDP_IDR.address=0xFFFB0014 -AT91C_UDP_IDR.width=32 -AT91C_UDP_IDR.byteEndian=little -AT91C_UDP_IDR.type=enum -AT91C_UDP_IDR.enum.0.name=*** Write only *** -AT91C_UDP_IDR.enum.1.name=Error -AT91C_UDP_ICR.name="AT91C_UDP_ICR" -AT91C_UDP_ICR.description="Interrupt Clear Register" -AT91C_UDP_ICR.helpkey="Interrupt Clear Register" -AT91C_UDP_ICR.access=memorymapped -AT91C_UDP_ICR.address=0xFFFB0020 -AT91C_UDP_ICR.width=32 -AT91C_UDP_ICR.byteEndian=little -AT91C_UDP_ICR.permission.write=none -AT91C_UDP_RSTEP.name="AT91C_UDP_RSTEP" -AT91C_UDP_RSTEP.description="Reset Endpoint Register" -AT91C_UDP_RSTEP.helpkey="Reset Endpoint Register" -AT91C_UDP_RSTEP.access=memorymapped -AT91C_UDP_RSTEP.address=0xFFFB0028 -AT91C_UDP_RSTEP.width=32 -AT91C_UDP_RSTEP.byteEndian=little -AT91C_UDP_RSTEP.permission.write=none -AT91C_UDP_TXVC.name="AT91C_UDP_TXVC" -AT91C_UDP_TXVC.description="Transceiver Control Register" -AT91C_UDP_TXVC.helpkey="Transceiver Control Register" -AT91C_UDP_TXVC.access=memorymapped -AT91C_UDP_TXVC.address=0xFFFB0074 -AT91C_UDP_TXVC.width=32 -AT91C_UDP_TXVC.byteEndian=little -AT91C_UDP_GLBSTATE.name="AT91C_UDP_GLBSTATE" -AT91C_UDP_GLBSTATE.description="Global State Register" -AT91C_UDP_GLBSTATE.helpkey="Global State Register" -AT91C_UDP_GLBSTATE.access=memorymapped -AT91C_UDP_GLBSTATE.address=0xFFFB0004 -AT91C_UDP_GLBSTATE.width=32 -AT91C_UDP_GLBSTATE.byteEndian=little -AT91C_UDP_IER.name="AT91C_UDP_IER" -AT91C_UDP_IER.description="Interrupt Enable Register" -AT91C_UDP_IER.helpkey="Interrupt Enable Register" -AT91C_UDP_IER.access=memorymapped -AT91C_UDP_IER.address=0xFFFB0010 -AT91C_UDP_IER.width=32 -AT91C_UDP_IER.byteEndian=little -AT91C_UDP_IER.type=enum -AT91C_UDP_IER.enum.0.name=*** Write only *** -AT91C_UDP_IER.enum.1.name=Error -# ========== Register definition for TC0 peripheral ========== -AT91C_TC0_SR.name="AT91C_TC0_SR" -AT91C_TC0_SR.description="Status Register" -AT91C_TC0_SR.helpkey="Status Register" -AT91C_TC0_SR.access=memorymapped -AT91C_TC0_SR.address=0xFFFA0020 -AT91C_TC0_SR.width=32 -AT91C_TC0_SR.byteEndian=little -AT91C_TC0_SR.permission.write=none -AT91C_TC0_RC.name="AT91C_TC0_RC" -AT91C_TC0_RC.description="Register C" -AT91C_TC0_RC.helpkey="Register C" -AT91C_TC0_RC.access=memorymapped -AT91C_TC0_RC.address=0xFFFA001C -AT91C_TC0_RC.width=32 -AT91C_TC0_RC.byteEndian=little -AT91C_TC0_RB.name="AT91C_TC0_RB" -AT91C_TC0_RB.description="Register B" -AT91C_TC0_RB.helpkey="Register B" -AT91C_TC0_RB.access=memorymapped -AT91C_TC0_RB.address=0xFFFA0018 -AT91C_TC0_RB.width=32 -AT91C_TC0_RB.byteEndian=little -AT91C_TC0_CCR.name="AT91C_TC0_CCR" -AT91C_TC0_CCR.description="Channel Control Register" -AT91C_TC0_CCR.helpkey="Channel Control Register" -AT91C_TC0_CCR.access=memorymapped -AT91C_TC0_CCR.address=0xFFFA0000 -AT91C_TC0_CCR.width=32 -AT91C_TC0_CCR.byteEndian=little -AT91C_TC0_CCR.type=enum -AT91C_TC0_CCR.enum.0.name=*** Write only *** -AT91C_TC0_CCR.enum.1.name=Error -AT91C_TC0_CMR.name="AT91C_TC0_CMR" -AT91C_TC0_CMR.description="Channel Mode Register (Capture Mode / Waveform Mode)" -AT91C_TC0_CMR.helpkey="Channel Mode Register (Capture Mode / Waveform Mode)" -AT91C_TC0_CMR.access=memorymapped -AT91C_TC0_CMR.address=0xFFFA0004 -AT91C_TC0_CMR.width=32 -AT91C_TC0_CMR.byteEndian=little -AT91C_TC0_IER.name="AT91C_TC0_IER" -AT91C_TC0_IER.description="Interrupt Enable Register" -AT91C_TC0_IER.helpkey="Interrupt Enable Register" -AT91C_TC0_IER.access=memorymapped -AT91C_TC0_IER.address=0xFFFA0024 -AT91C_TC0_IER.width=32 -AT91C_TC0_IER.byteEndian=little -AT91C_TC0_IER.type=enum -AT91C_TC0_IER.enum.0.name=*** Write only *** -AT91C_TC0_IER.enum.1.name=Error -AT91C_TC0_RA.name="AT91C_TC0_RA" -AT91C_TC0_RA.description="Register A" -AT91C_TC0_RA.helpkey="Register A" -AT91C_TC0_RA.access=memorymapped -AT91C_TC0_RA.address=0xFFFA0014 -AT91C_TC0_RA.width=32 -AT91C_TC0_RA.byteEndian=little -AT91C_TC0_IDR.name="AT91C_TC0_IDR" -AT91C_TC0_IDR.description="Interrupt Disable Register" -AT91C_TC0_IDR.helpkey="Interrupt Disable Register" -AT91C_TC0_IDR.access=memorymapped -AT91C_TC0_IDR.address=0xFFFA0028 -AT91C_TC0_IDR.width=32 -AT91C_TC0_IDR.byteEndian=little -AT91C_TC0_IDR.type=enum -AT91C_TC0_IDR.enum.0.name=*** Write only *** -AT91C_TC0_IDR.enum.1.name=Error -AT91C_TC0_CV.name="AT91C_TC0_CV" -AT91C_TC0_CV.description="Counter Value" -AT91C_TC0_CV.helpkey="Counter Value" -AT91C_TC0_CV.access=memorymapped -AT91C_TC0_CV.address=0xFFFA0010 -AT91C_TC0_CV.width=32 -AT91C_TC0_CV.byteEndian=little -AT91C_TC0_IMR.name="AT91C_TC0_IMR" -AT91C_TC0_IMR.description="Interrupt Mask Register" -AT91C_TC0_IMR.helpkey="Interrupt Mask Register" -AT91C_TC0_IMR.access=memorymapped -AT91C_TC0_IMR.address=0xFFFA002C -AT91C_TC0_IMR.width=32 -AT91C_TC0_IMR.byteEndian=little -AT91C_TC0_IMR.permission.write=none -# ========== Register definition for TC1 peripheral ========== -AT91C_TC1_RB.name="AT91C_TC1_RB" -AT91C_TC1_RB.description="Register B" -AT91C_TC1_RB.helpkey="Register B" -AT91C_TC1_RB.access=memorymapped -AT91C_TC1_RB.address=0xFFFA0058 -AT91C_TC1_RB.width=32 -AT91C_TC1_RB.byteEndian=little -AT91C_TC1_CCR.name="AT91C_TC1_CCR" -AT91C_TC1_CCR.description="Channel Control Register" -AT91C_TC1_CCR.helpkey="Channel Control Register" -AT91C_TC1_CCR.access=memorymapped -AT91C_TC1_CCR.address=0xFFFA0040 -AT91C_TC1_CCR.width=32 -AT91C_TC1_CCR.byteEndian=little -AT91C_TC1_CCR.type=enum -AT91C_TC1_CCR.enum.0.name=*** Write only *** -AT91C_TC1_CCR.enum.1.name=Error -AT91C_TC1_IER.name="AT91C_TC1_IER" -AT91C_TC1_IER.description="Interrupt Enable Register" -AT91C_TC1_IER.helpkey="Interrupt Enable Register" -AT91C_TC1_IER.access=memorymapped -AT91C_TC1_IER.address=0xFFFA0064 -AT91C_TC1_IER.width=32 -AT91C_TC1_IER.byteEndian=little -AT91C_TC1_IER.type=enum -AT91C_TC1_IER.enum.0.name=*** Write only *** -AT91C_TC1_IER.enum.1.name=Error -AT91C_TC1_IDR.name="AT91C_TC1_IDR" -AT91C_TC1_IDR.description="Interrupt Disable Register" -AT91C_TC1_IDR.helpkey="Interrupt Disable Register" -AT91C_TC1_IDR.access=memorymapped -AT91C_TC1_IDR.address=0xFFFA0068 -AT91C_TC1_IDR.width=32 -AT91C_TC1_IDR.byteEndian=little -AT91C_TC1_IDR.type=enum -AT91C_TC1_IDR.enum.0.name=*** Write only *** -AT91C_TC1_IDR.enum.1.name=Error -AT91C_TC1_SR.name="AT91C_TC1_SR" -AT91C_TC1_SR.description="Status Register" -AT91C_TC1_SR.helpkey="Status Register" -AT91C_TC1_SR.access=memorymapped -AT91C_TC1_SR.address=0xFFFA0060 -AT91C_TC1_SR.width=32 -AT91C_TC1_SR.byteEndian=little -AT91C_TC1_SR.permission.write=none -AT91C_TC1_CMR.name="AT91C_TC1_CMR" -AT91C_TC1_CMR.description="Channel Mode Register (Capture Mode / Waveform Mode)" -AT91C_TC1_CMR.helpkey="Channel Mode Register (Capture Mode / Waveform Mode)" -AT91C_TC1_CMR.access=memorymapped -AT91C_TC1_CMR.address=0xFFFA0044 -AT91C_TC1_CMR.width=32 -AT91C_TC1_CMR.byteEndian=little -AT91C_TC1_RA.name="AT91C_TC1_RA" -AT91C_TC1_RA.description="Register A" -AT91C_TC1_RA.helpkey="Register A" -AT91C_TC1_RA.access=memorymapped -AT91C_TC1_RA.address=0xFFFA0054 -AT91C_TC1_RA.width=32 -AT91C_TC1_RA.byteEndian=little -AT91C_TC1_RC.name="AT91C_TC1_RC" -AT91C_TC1_RC.description="Register C" -AT91C_TC1_RC.helpkey="Register C" -AT91C_TC1_RC.access=memorymapped -AT91C_TC1_RC.address=0xFFFA005C -AT91C_TC1_RC.width=32 -AT91C_TC1_RC.byteEndian=little -AT91C_TC1_IMR.name="AT91C_TC1_IMR" -AT91C_TC1_IMR.description="Interrupt Mask Register" -AT91C_TC1_IMR.helpkey="Interrupt Mask Register" -AT91C_TC1_IMR.access=memorymapped -AT91C_TC1_IMR.address=0xFFFA006C -AT91C_TC1_IMR.width=32 -AT91C_TC1_IMR.byteEndian=little -AT91C_TC1_IMR.permission.write=none -AT91C_TC1_CV.name="AT91C_TC1_CV" -AT91C_TC1_CV.description="Counter Value" -AT91C_TC1_CV.helpkey="Counter Value" -AT91C_TC1_CV.access=memorymapped -AT91C_TC1_CV.address=0xFFFA0050 -AT91C_TC1_CV.width=32 -AT91C_TC1_CV.byteEndian=little -# ========== Register definition for TC2 peripheral ========== -AT91C_TC2_CMR.name="AT91C_TC2_CMR" -AT91C_TC2_CMR.description="Channel Mode Register (Capture Mode / Waveform Mode)" -AT91C_TC2_CMR.helpkey="Channel Mode Register (Capture Mode / Waveform Mode)" -AT91C_TC2_CMR.access=memorymapped -AT91C_TC2_CMR.address=0xFFFA0084 -AT91C_TC2_CMR.width=32 -AT91C_TC2_CMR.byteEndian=little -AT91C_TC2_CCR.name="AT91C_TC2_CCR" -AT91C_TC2_CCR.description="Channel Control Register" -AT91C_TC2_CCR.helpkey="Channel Control Register" -AT91C_TC2_CCR.access=memorymapped -AT91C_TC2_CCR.address=0xFFFA0080 -AT91C_TC2_CCR.width=32 -AT91C_TC2_CCR.byteEndian=little -AT91C_TC2_CCR.type=enum -AT91C_TC2_CCR.enum.0.name=*** Write only *** -AT91C_TC2_CCR.enum.1.name=Error -AT91C_TC2_CV.name="AT91C_TC2_CV" -AT91C_TC2_CV.description="Counter Value" -AT91C_TC2_CV.helpkey="Counter Value" -AT91C_TC2_CV.access=memorymapped -AT91C_TC2_CV.address=0xFFFA0090 -AT91C_TC2_CV.width=32 -AT91C_TC2_CV.byteEndian=little -AT91C_TC2_RA.name="AT91C_TC2_RA" -AT91C_TC2_RA.description="Register A" -AT91C_TC2_RA.helpkey="Register A" -AT91C_TC2_RA.access=memorymapped -AT91C_TC2_RA.address=0xFFFA0094 -AT91C_TC2_RA.width=32 -AT91C_TC2_RA.byteEndian=little -AT91C_TC2_RB.name="AT91C_TC2_RB" -AT91C_TC2_RB.description="Register B" -AT91C_TC2_RB.helpkey="Register B" -AT91C_TC2_RB.access=memorymapped -AT91C_TC2_RB.address=0xFFFA0098 -AT91C_TC2_RB.width=32 -AT91C_TC2_RB.byteEndian=little -AT91C_TC2_IDR.name="AT91C_TC2_IDR" -AT91C_TC2_IDR.description="Interrupt Disable Register" -AT91C_TC2_IDR.helpkey="Interrupt Disable Register" -AT91C_TC2_IDR.access=memorymapped -AT91C_TC2_IDR.address=0xFFFA00A8 -AT91C_TC2_IDR.width=32 -AT91C_TC2_IDR.byteEndian=little -AT91C_TC2_IDR.type=enum -AT91C_TC2_IDR.enum.0.name=*** Write only *** -AT91C_TC2_IDR.enum.1.name=Error -AT91C_TC2_IMR.name="AT91C_TC2_IMR" -AT91C_TC2_IMR.description="Interrupt Mask Register" -AT91C_TC2_IMR.helpkey="Interrupt Mask Register" -AT91C_TC2_IMR.access=memorymapped -AT91C_TC2_IMR.address=0xFFFA00AC -AT91C_TC2_IMR.width=32 -AT91C_TC2_IMR.byteEndian=little -AT91C_TC2_IMR.permission.write=none -AT91C_TC2_RC.name="AT91C_TC2_RC" -AT91C_TC2_RC.description="Register C" -AT91C_TC2_RC.helpkey="Register C" -AT91C_TC2_RC.access=memorymapped -AT91C_TC2_RC.address=0xFFFA009C -AT91C_TC2_RC.width=32 -AT91C_TC2_RC.byteEndian=little -AT91C_TC2_IER.name="AT91C_TC2_IER" -AT91C_TC2_IER.description="Interrupt Enable Register" -AT91C_TC2_IER.helpkey="Interrupt Enable Register" -AT91C_TC2_IER.access=memorymapped -AT91C_TC2_IER.address=0xFFFA00A4 -AT91C_TC2_IER.width=32 -AT91C_TC2_IER.byteEndian=little -AT91C_TC2_IER.type=enum -AT91C_TC2_IER.enum.0.name=*** Write only *** -AT91C_TC2_IER.enum.1.name=Error -AT91C_TC2_SR.name="AT91C_TC2_SR" -AT91C_TC2_SR.description="Status Register" -AT91C_TC2_SR.helpkey="Status Register" -AT91C_TC2_SR.access=memorymapped -AT91C_TC2_SR.address=0xFFFA00A0 -AT91C_TC2_SR.width=32 -AT91C_TC2_SR.byteEndian=little -AT91C_TC2_SR.permission.write=none -# ========== Register definition for TCB peripheral ========== -AT91C_TCB_BMR.name="AT91C_TCB_BMR" -AT91C_TCB_BMR.description="TC Block Mode Register" -AT91C_TCB_BMR.helpkey="TC Block Mode Register" -AT91C_TCB_BMR.access=memorymapped -AT91C_TCB_BMR.address=0xFFFA00C4 -AT91C_TCB_BMR.width=32 -AT91C_TCB_BMR.byteEndian=little -AT91C_TCB_BCR.name="AT91C_TCB_BCR" -AT91C_TCB_BCR.description="TC Block Control Register" -AT91C_TCB_BCR.helpkey="TC Block Control Register" -AT91C_TCB_BCR.access=memorymapped -AT91C_TCB_BCR.address=0xFFFA00C0 -AT91C_TCB_BCR.width=32 -AT91C_TCB_BCR.byteEndian=little -AT91C_TCB_BCR.type=enum -AT91C_TCB_BCR.enum.0.name=*** Write only *** -AT91C_TCB_BCR.enum.1.name=Error -# ========== Register definition for CAN_MB0 peripheral ========== -AT91C_CAN_MB0_MDL.name="AT91C_CAN_MB0_MDL" -AT91C_CAN_MB0_MDL.description="MailBox Data Low Register" -AT91C_CAN_MB0_MDL.helpkey="MailBox Data Low Register" -AT91C_CAN_MB0_MDL.access=memorymapped -AT91C_CAN_MB0_MDL.address=0xFFFD0214 -AT91C_CAN_MB0_MDL.width=32 -AT91C_CAN_MB0_MDL.byteEndian=little -AT91C_CAN_MB0_MAM.name="AT91C_CAN_MB0_MAM" -AT91C_CAN_MB0_MAM.description="MailBox Acceptance Mask Register" -AT91C_CAN_MB0_MAM.helpkey="MailBox Acceptance Mask Register" -AT91C_CAN_MB0_MAM.access=memorymapped -AT91C_CAN_MB0_MAM.address=0xFFFD0204 -AT91C_CAN_MB0_MAM.width=32 -AT91C_CAN_MB0_MAM.byteEndian=little -AT91C_CAN_MB0_MCR.name="AT91C_CAN_MB0_MCR" -AT91C_CAN_MB0_MCR.description="MailBox Control Register" -AT91C_CAN_MB0_MCR.helpkey="MailBox Control Register" -AT91C_CAN_MB0_MCR.access=memorymapped -AT91C_CAN_MB0_MCR.address=0xFFFD021C -AT91C_CAN_MB0_MCR.width=32 -AT91C_CAN_MB0_MCR.byteEndian=little -AT91C_CAN_MB0_MCR.type=enum -AT91C_CAN_MB0_MCR.enum.0.name=*** Write only *** -AT91C_CAN_MB0_MCR.enum.1.name=Error -AT91C_CAN_MB0_MID.name="AT91C_CAN_MB0_MID" -AT91C_CAN_MB0_MID.description="MailBox ID Register" -AT91C_CAN_MB0_MID.helpkey="MailBox ID Register" -AT91C_CAN_MB0_MID.access=memorymapped -AT91C_CAN_MB0_MID.address=0xFFFD0208 -AT91C_CAN_MB0_MID.width=32 -AT91C_CAN_MB0_MID.byteEndian=little -AT91C_CAN_MB0_MSR.name="AT91C_CAN_MB0_MSR" -AT91C_CAN_MB0_MSR.description="MailBox Status Register" -AT91C_CAN_MB0_MSR.helpkey="MailBox Status Register" -AT91C_CAN_MB0_MSR.access=memorymapped -AT91C_CAN_MB0_MSR.address=0xFFFD0210 -AT91C_CAN_MB0_MSR.width=32 -AT91C_CAN_MB0_MSR.byteEndian=little -AT91C_CAN_MB0_MSR.permission.write=none -AT91C_CAN_MB0_MFID.name="AT91C_CAN_MB0_MFID" -AT91C_CAN_MB0_MFID.description="MailBox Family ID Register" -AT91C_CAN_MB0_MFID.helpkey="MailBox Family ID Register" -AT91C_CAN_MB0_MFID.access=memorymapped -AT91C_CAN_MB0_MFID.address=0xFFFD020C -AT91C_CAN_MB0_MFID.width=32 -AT91C_CAN_MB0_MFID.byteEndian=little -AT91C_CAN_MB0_MFID.permission.write=none -AT91C_CAN_MB0_MDH.name="AT91C_CAN_MB0_MDH" -AT91C_CAN_MB0_MDH.description="MailBox Data High Register" -AT91C_CAN_MB0_MDH.helpkey="MailBox Data High Register" -AT91C_CAN_MB0_MDH.access=memorymapped -AT91C_CAN_MB0_MDH.address=0xFFFD0218 -AT91C_CAN_MB0_MDH.width=32 -AT91C_CAN_MB0_MDH.byteEndian=little -AT91C_CAN_MB0_MMR.name="AT91C_CAN_MB0_MMR" -AT91C_CAN_MB0_MMR.description="MailBox Mode Register" -AT91C_CAN_MB0_MMR.helpkey="MailBox Mode Register" -AT91C_CAN_MB0_MMR.access=memorymapped -AT91C_CAN_MB0_MMR.address=0xFFFD0200 -AT91C_CAN_MB0_MMR.width=32 -AT91C_CAN_MB0_MMR.byteEndian=little -# ========== Register definition for CAN_MB1 peripheral ========== -AT91C_CAN_MB1_MDL.name="AT91C_CAN_MB1_MDL" -AT91C_CAN_MB1_MDL.description="MailBox Data Low Register" -AT91C_CAN_MB1_MDL.helpkey="MailBox Data Low Register" -AT91C_CAN_MB1_MDL.access=memorymapped -AT91C_CAN_MB1_MDL.address=0xFFFD0234 -AT91C_CAN_MB1_MDL.width=32 -AT91C_CAN_MB1_MDL.byteEndian=little -AT91C_CAN_MB1_MID.name="AT91C_CAN_MB1_MID" -AT91C_CAN_MB1_MID.description="MailBox ID Register" -AT91C_CAN_MB1_MID.helpkey="MailBox ID Register" -AT91C_CAN_MB1_MID.access=memorymapped -AT91C_CAN_MB1_MID.address=0xFFFD0228 -AT91C_CAN_MB1_MID.width=32 -AT91C_CAN_MB1_MID.byteEndian=little -AT91C_CAN_MB1_MMR.name="AT91C_CAN_MB1_MMR" -AT91C_CAN_MB1_MMR.description="MailBox Mode Register" -AT91C_CAN_MB1_MMR.helpkey="MailBox Mode Register" -AT91C_CAN_MB1_MMR.access=memorymapped -AT91C_CAN_MB1_MMR.address=0xFFFD0220 -AT91C_CAN_MB1_MMR.width=32 -AT91C_CAN_MB1_MMR.byteEndian=little -AT91C_CAN_MB1_MSR.name="AT91C_CAN_MB1_MSR" -AT91C_CAN_MB1_MSR.description="MailBox Status Register" -AT91C_CAN_MB1_MSR.helpkey="MailBox Status Register" -AT91C_CAN_MB1_MSR.access=memorymapped -AT91C_CAN_MB1_MSR.address=0xFFFD0230 -AT91C_CAN_MB1_MSR.width=32 -AT91C_CAN_MB1_MSR.byteEndian=little -AT91C_CAN_MB1_MSR.permission.write=none -AT91C_CAN_MB1_MAM.name="AT91C_CAN_MB1_MAM" -AT91C_CAN_MB1_MAM.description="MailBox Acceptance Mask Register" -AT91C_CAN_MB1_MAM.helpkey="MailBox Acceptance Mask Register" -AT91C_CAN_MB1_MAM.access=memorymapped -AT91C_CAN_MB1_MAM.address=0xFFFD0224 -AT91C_CAN_MB1_MAM.width=32 -AT91C_CAN_MB1_MAM.byteEndian=little -AT91C_CAN_MB1_MDH.name="AT91C_CAN_MB1_MDH" -AT91C_CAN_MB1_MDH.description="MailBox Data High Register" -AT91C_CAN_MB1_MDH.helpkey="MailBox Data High Register" -AT91C_CAN_MB1_MDH.access=memorymapped -AT91C_CAN_MB1_MDH.address=0xFFFD0238 -AT91C_CAN_MB1_MDH.width=32 -AT91C_CAN_MB1_MDH.byteEndian=little -AT91C_CAN_MB1_MCR.name="AT91C_CAN_MB1_MCR" -AT91C_CAN_MB1_MCR.description="MailBox Control Register" -AT91C_CAN_MB1_MCR.helpkey="MailBox Control Register" -AT91C_CAN_MB1_MCR.access=memorymapped -AT91C_CAN_MB1_MCR.address=0xFFFD023C -AT91C_CAN_MB1_MCR.width=32 -AT91C_CAN_MB1_MCR.byteEndian=little -AT91C_CAN_MB1_MCR.type=enum -AT91C_CAN_MB1_MCR.enum.0.name=*** Write only *** -AT91C_CAN_MB1_MCR.enum.1.name=Error -AT91C_CAN_MB1_MFID.name="AT91C_CAN_MB1_MFID" -AT91C_CAN_MB1_MFID.description="MailBox Family ID Register" -AT91C_CAN_MB1_MFID.helpkey="MailBox Family ID Register" -AT91C_CAN_MB1_MFID.access=memorymapped -AT91C_CAN_MB1_MFID.address=0xFFFD022C -AT91C_CAN_MB1_MFID.width=32 -AT91C_CAN_MB1_MFID.byteEndian=little -AT91C_CAN_MB1_MFID.permission.write=none -# ========== Register definition for CAN_MB2 peripheral ========== -AT91C_CAN_MB2_MCR.name="AT91C_CAN_MB2_MCR" -AT91C_CAN_MB2_MCR.description="MailBox Control Register" -AT91C_CAN_MB2_MCR.helpkey="MailBox Control Register" -AT91C_CAN_MB2_MCR.access=memorymapped -AT91C_CAN_MB2_MCR.address=0xFFFD025C -AT91C_CAN_MB2_MCR.width=32 -AT91C_CAN_MB2_MCR.byteEndian=little -AT91C_CAN_MB2_MCR.type=enum -AT91C_CAN_MB2_MCR.enum.0.name=*** Write only *** -AT91C_CAN_MB2_MCR.enum.1.name=Error -AT91C_CAN_MB2_MDH.name="AT91C_CAN_MB2_MDH" -AT91C_CAN_MB2_MDH.description="MailBox Data High Register" -AT91C_CAN_MB2_MDH.helpkey="MailBox Data High Register" -AT91C_CAN_MB2_MDH.access=memorymapped -AT91C_CAN_MB2_MDH.address=0xFFFD0258 -AT91C_CAN_MB2_MDH.width=32 -AT91C_CAN_MB2_MDH.byteEndian=little -AT91C_CAN_MB2_MID.name="AT91C_CAN_MB2_MID" -AT91C_CAN_MB2_MID.description="MailBox ID Register" -AT91C_CAN_MB2_MID.helpkey="MailBox ID Register" -AT91C_CAN_MB2_MID.access=memorymapped -AT91C_CAN_MB2_MID.address=0xFFFD0248 -AT91C_CAN_MB2_MID.width=32 -AT91C_CAN_MB2_MID.byteEndian=little -AT91C_CAN_MB2_MDL.name="AT91C_CAN_MB2_MDL" -AT91C_CAN_MB2_MDL.description="MailBox Data Low Register" -AT91C_CAN_MB2_MDL.helpkey="MailBox Data Low Register" -AT91C_CAN_MB2_MDL.access=memorymapped -AT91C_CAN_MB2_MDL.address=0xFFFD0254 -AT91C_CAN_MB2_MDL.width=32 -AT91C_CAN_MB2_MDL.byteEndian=little -AT91C_CAN_MB2_MMR.name="AT91C_CAN_MB2_MMR" -AT91C_CAN_MB2_MMR.description="MailBox Mode Register" -AT91C_CAN_MB2_MMR.helpkey="MailBox Mode Register" -AT91C_CAN_MB2_MMR.access=memorymapped -AT91C_CAN_MB2_MMR.address=0xFFFD0240 -AT91C_CAN_MB2_MMR.width=32 -AT91C_CAN_MB2_MMR.byteEndian=little -AT91C_CAN_MB2_MAM.name="AT91C_CAN_MB2_MAM" -AT91C_CAN_MB2_MAM.description="MailBox Acceptance Mask Register" -AT91C_CAN_MB2_MAM.helpkey="MailBox Acceptance Mask Register" -AT91C_CAN_MB2_MAM.access=memorymapped -AT91C_CAN_MB2_MAM.address=0xFFFD0244 -AT91C_CAN_MB2_MAM.width=32 -AT91C_CAN_MB2_MAM.byteEndian=little -AT91C_CAN_MB2_MFID.name="AT91C_CAN_MB2_MFID" -AT91C_CAN_MB2_MFID.description="MailBox Family ID Register" -AT91C_CAN_MB2_MFID.helpkey="MailBox Family ID Register" -AT91C_CAN_MB2_MFID.access=memorymapped -AT91C_CAN_MB2_MFID.address=0xFFFD024C -AT91C_CAN_MB2_MFID.width=32 -AT91C_CAN_MB2_MFID.byteEndian=little -AT91C_CAN_MB2_MFID.permission.write=none -AT91C_CAN_MB2_MSR.name="AT91C_CAN_MB2_MSR" -AT91C_CAN_MB2_MSR.description="MailBox Status Register" -AT91C_CAN_MB2_MSR.helpkey="MailBox Status Register" -AT91C_CAN_MB2_MSR.access=memorymapped -AT91C_CAN_MB2_MSR.address=0xFFFD0250 -AT91C_CAN_MB2_MSR.width=32 -AT91C_CAN_MB2_MSR.byteEndian=little -AT91C_CAN_MB2_MSR.permission.write=none -# ========== Register definition for CAN_MB3 peripheral ========== -AT91C_CAN_MB3_MFID.name="AT91C_CAN_MB3_MFID" -AT91C_CAN_MB3_MFID.description="MailBox Family ID Register" -AT91C_CAN_MB3_MFID.helpkey="MailBox Family ID Register" -AT91C_CAN_MB3_MFID.access=memorymapped -AT91C_CAN_MB3_MFID.address=0xFFFD026C -AT91C_CAN_MB3_MFID.width=32 -AT91C_CAN_MB3_MFID.byteEndian=little -AT91C_CAN_MB3_MFID.permission.write=none -AT91C_CAN_MB3_MAM.name="AT91C_CAN_MB3_MAM" -AT91C_CAN_MB3_MAM.description="MailBox Acceptance Mask Register" -AT91C_CAN_MB3_MAM.helpkey="MailBox Acceptance Mask Register" -AT91C_CAN_MB3_MAM.access=memorymapped -AT91C_CAN_MB3_MAM.address=0xFFFD0264 -AT91C_CAN_MB3_MAM.width=32 -AT91C_CAN_MB3_MAM.byteEndian=little -AT91C_CAN_MB3_MID.name="AT91C_CAN_MB3_MID" -AT91C_CAN_MB3_MID.description="MailBox ID Register" -AT91C_CAN_MB3_MID.helpkey="MailBox ID Register" -AT91C_CAN_MB3_MID.access=memorymapped -AT91C_CAN_MB3_MID.address=0xFFFD0268 -AT91C_CAN_MB3_MID.width=32 -AT91C_CAN_MB3_MID.byteEndian=little -AT91C_CAN_MB3_MCR.name="AT91C_CAN_MB3_MCR" -AT91C_CAN_MB3_MCR.description="MailBox Control Register" -AT91C_CAN_MB3_MCR.helpkey="MailBox Control Register" -AT91C_CAN_MB3_MCR.access=memorymapped -AT91C_CAN_MB3_MCR.address=0xFFFD027C -AT91C_CAN_MB3_MCR.width=32 -AT91C_CAN_MB3_MCR.byteEndian=little -AT91C_CAN_MB3_MCR.type=enum -AT91C_CAN_MB3_MCR.enum.0.name=*** Write only *** -AT91C_CAN_MB3_MCR.enum.1.name=Error -AT91C_CAN_MB3_MMR.name="AT91C_CAN_MB3_MMR" -AT91C_CAN_MB3_MMR.description="MailBox Mode Register" -AT91C_CAN_MB3_MMR.helpkey="MailBox Mode Register" -AT91C_CAN_MB3_MMR.access=memorymapped -AT91C_CAN_MB3_MMR.address=0xFFFD0260 -AT91C_CAN_MB3_MMR.width=32 -AT91C_CAN_MB3_MMR.byteEndian=little -AT91C_CAN_MB3_MSR.name="AT91C_CAN_MB3_MSR" -AT91C_CAN_MB3_MSR.description="MailBox Status Register" -AT91C_CAN_MB3_MSR.helpkey="MailBox Status Register" -AT91C_CAN_MB3_MSR.access=memorymapped -AT91C_CAN_MB3_MSR.address=0xFFFD0270 -AT91C_CAN_MB3_MSR.width=32 -AT91C_CAN_MB3_MSR.byteEndian=little -AT91C_CAN_MB3_MSR.permission.write=none -AT91C_CAN_MB3_MDL.name="AT91C_CAN_MB3_MDL" -AT91C_CAN_MB3_MDL.description="MailBox Data Low Register" -AT91C_CAN_MB3_MDL.helpkey="MailBox Data Low Register" -AT91C_CAN_MB3_MDL.access=memorymapped -AT91C_CAN_MB3_MDL.address=0xFFFD0274 -AT91C_CAN_MB3_MDL.width=32 -AT91C_CAN_MB3_MDL.byteEndian=little -AT91C_CAN_MB3_MDH.name="AT91C_CAN_MB3_MDH" -AT91C_CAN_MB3_MDH.description="MailBox Data High Register" -AT91C_CAN_MB3_MDH.helpkey="MailBox Data High Register" -AT91C_CAN_MB3_MDH.access=memorymapped -AT91C_CAN_MB3_MDH.address=0xFFFD0278 -AT91C_CAN_MB3_MDH.width=32 -AT91C_CAN_MB3_MDH.byteEndian=little -# ========== Register definition for CAN_MB4 peripheral ========== -AT91C_CAN_MB4_MID.name="AT91C_CAN_MB4_MID" -AT91C_CAN_MB4_MID.description="MailBox ID Register" -AT91C_CAN_MB4_MID.helpkey="MailBox ID Register" -AT91C_CAN_MB4_MID.access=memorymapped -AT91C_CAN_MB4_MID.address=0xFFFD0288 -AT91C_CAN_MB4_MID.width=32 -AT91C_CAN_MB4_MID.byteEndian=little -AT91C_CAN_MB4_MMR.name="AT91C_CAN_MB4_MMR" -AT91C_CAN_MB4_MMR.description="MailBox Mode Register" -AT91C_CAN_MB4_MMR.helpkey="MailBox Mode Register" -AT91C_CAN_MB4_MMR.access=memorymapped -AT91C_CAN_MB4_MMR.address=0xFFFD0280 -AT91C_CAN_MB4_MMR.width=32 -AT91C_CAN_MB4_MMR.byteEndian=little -AT91C_CAN_MB4_MDH.name="AT91C_CAN_MB4_MDH" -AT91C_CAN_MB4_MDH.description="MailBox Data High Register" -AT91C_CAN_MB4_MDH.helpkey="MailBox Data High Register" -AT91C_CAN_MB4_MDH.access=memorymapped -AT91C_CAN_MB4_MDH.address=0xFFFD0298 -AT91C_CAN_MB4_MDH.width=32 -AT91C_CAN_MB4_MDH.byteEndian=little -AT91C_CAN_MB4_MFID.name="AT91C_CAN_MB4_MFID" -AT91C_CAN_MB4_MFID.description="MailBox Family ID Register" -AT91C_CAN_MB4_MFID.helpkey="MailBox Family ID Register" -AT91C_CAN_MB4_MFID.access=memorymapped -AT91C_CAN_MB4_MFID.address=0xFFFD028C -AT91C_CAN_MB4_MFID.width=32 -AT91C_CAN_MB4_MFID.byteEndian=little -AT91C_CAN_MB4_MFID.permission.write=none -AT91C_CAN_MB4_MSR.name="AT91C_CAN_MB4_MSR" -AT91C_CAN_MB4_MSR.description="MailBox Status Register" -AT91C_CAN_MB4_MSR.helpkey="MailBox Status Register" -AT91C_CAN_MB4_MSR.access=memorymapped -AT91C_CAN_MB4_MSR.address=0xFFFD0290 -AT91C_CAN_MB4_MSR.width=32 -AT91C_CAN_MB4_MSR.byteEndian=little -AT91C_CAN_MB4_MSR.permission.write=none -AT91C_CAN_MB4_MCR.name="AT91C_CAN_MB4_MCR" -AT91C_CAN_MB4_MCR.description="MailBox Control Register" -AT91C_CAN_MB4_MCR.helpkey="MailBox Control Register" -AT91C_CAN_MB4_MCR.access=memorymapped -AT91C_CAN_MB4_MCR.address=0xFFFD029C -AT91C_CAN_MB4_MCR.width=32 -AT91C_CAN_MB4_MCR.byteEndian=little -AT91C_CAN_MB4_MCR.type=enum -AT91C_CAN_MB4_MCR.enum.0.name=*** Write only *** -AT91C_CAN_MB4_MCR.enum.1.name=Error -AT91C_CAN_MB4_MDL.name="AT91C_CAN_MB4_MDL" -AT91C_CAN_MB4_MDL.description="MailBox Data Low Register" -AT91C_CAN_MB4_MDL.helpkey="MailBox Data Low Register" -AT91C_CAN_MB4_MDL.access=memorymapped -AT91C_CAN_MB4_MDL.address=0xFFFD0294 -AT91C_CAN_MB4_MDL.width=32 -AT91C_CAN_MB4_MDL.byteEndian=little -AT91C_CAN_MB4_MAM.name="AT91C_CAN_MB4_MAM" -AT91C_CAN_MB4_MAM.description="MailBox Acceptance Mask Register" -AT91C_CAN_MB4_MAM.helpkey="MailBox Acceptance Mask Register" -AT91C_CAN_MB4_MAM.access=memorymapped -AT91C_CAN_MB4_MAM.address=0xFFFD0284 -AT91C_CAN_MB4_MAM.width=32 -AT91C_CAN_MB4_MAM.byteEndian=little -# ========== Register definition for CAN_MB5 peripheral ========== -AT91C_CAN_MB5_MSR.name="AT91C_CAN_MB5_MSR" -AT91C_CAN_MB5_MSR.description="MailBox Status Register" -AT91C_CAN_MB5_MSR.helpkey="MailBox Status Register" -AT91C_CAN_MB5_MSR.access=memorymapped -AT91C_CAN_MB5_MSR.address=0xFFFD02B0 -AT91C_CAN_MB5_MSR.width=32 -AT91C_CAN_MB5_MSR.byteEndian=little -AT91C_CAN_MB5_MSR.permission.write=none -AT91C_CAN_MB5_MCR.name="AT91C_CAN_MB5_MCR" -AT91C_CAN_MB5_MCR.description="MailBox Control Register" -AT91C_CAN_MB5_MCR.helpkey="MailBox Control Register" -AT91C_CAN_MB5_MCR.access=memorymapped -AT91C_CAN_MB5_MCR.address=0xFFFD02BC -AT91C_CAN_MB5_MCR.width=32 -AT91C_CAN_MB5_MCR.byteEndian=little -AT91C_CAN_MB5_MCR.type=enum -AT91C_CAN_MB5_MCR.enum.0.name=*** Write only *** -AT91C_CAN_MB5_MCR.enum.1.name=Error -AT91C_CAN_MB5_MFID.name="AT91C_CAN_MB5_MFID" -AT91C_CAN_MB5_MFID.description="MailBox Family ID Register" -AT91C_CAN_MB5_MFID.helpkey="MailBox Family ID Register" -AT91C_CAN_MB5_MFID.access=memorymapped -AT91C_CAN_MB5_MFID.address=0xFFFD02AC -AT91C_CAN_MB5_MFID.width=32 -AT91C_CAN_MB5_MFID.byteEndian=little -AT91C_CAN_MB5_MFID.permission.write=none -AT91C_CAN_MB5_MDH.name="AT91C_CAN_MB5_MDH" -AT91C_CAN_MB5_MDH.description="MailBox Data High Register" -AT91C_CAN_MB5_MDH.helpkey="MailBox Data High Register" -AT91C_CAN_MB5_MDH.access=memorymapped -AT91C_CAN_MB5_MDH.address=0xFFFD02B8 -AT91C_CAN_MB5_MDH.width=32 -AT91C_CAN_MB5_MDH.byteEndian=little -AT91C_CAN_MB5_MID.name="AT91C_CAN_MB5_MID" -AT91C_CAN_MB5_MID.description="MailBox ID Register" -AT91C_CAN_MB5_MID.helpkey="MailBox ID Register" -AT91C_CAN_MB5_MID.access=memorymapped -AT91C_CAN_MB5_MID.address=0xFFFD02A8 -AT91C_CAN_MB5_MID.width=32 -AT91C_CAN_MB5_MID.byteEndian=little -AT91C_CAN_MB5_MMR.name="AT91C_CAN_MB5_MMR" -AT91C_CAN_MB5_MMR.description="MailBox Mode Register" -AT91C_CAN_MB5_MMR.helpkey="MailBox Mode Register" -AT91C_CAN_MB5_MMR.access=memorymapped -AT91C_CAN_MB5_MMR.address=0xFFFD02A0 -AT91C_CAN_MB5_MMR.width=32 -AT91C_CAN_MB5_MMR.byteEndian=little -AT91C_CAN_MB5_MDL.name="AT91C_CAN_MB5_MDL" -AT91C_CAN_MB5_MDL.description="MailBox Data Low Register" -AT91C_CAN_MB5_MDL.helpkey="MailBox Data Low Register" -AT91C_CAN_MB5_MDL.access=memorymapped -AT91C_CAN_MB5_MDL.address=0xFFFD02B4 -AT91C_CAN_MB5_MDL.width=32 -AT91C_CAN_MB5_MDL.byteEndian=little -AT91C_CAN_MB5_MAM.name="AT91C_CAN_MB5_MAM" -AT91C_CAN_MB5_MAM.description="MailBox Acceptance Mask Register" -AT91C_CAN_MB5_MAM.helpkey="MailBox Acceptance Mask Register" -AT91C_CAN_MB5_MAM.access=memorymapped -AT91C_CAN_MB5_MAM.address=0xFFFD02A4 -AT91C_CAN_MB5_MAM.width=32 -AT91C_CAN_MB5_MAM.byteEndian=little -# ========== Register definition for CAN_MB6 peripheral ========== -AT91C_CAN_MB6_MFID.name="AT91C_CAN_MB6_MFID" -AT91C_CAN_MB6_MFID.description="MailBox Family ID Register" -AT91C_CAN_MB6_MFID.helpkey="MailBox Family ID Register" -AT91C_CAN_MB6_MFID.access=memorymapped -AT91C_CAN_MB6_MFID.address=0xFFFD02CC -AT91C_CAN_MB6_MFID.width=32 -AT91C_CAN_MB6_MFID.byteEndian=little -AT91C_CAN_MB6_MFID.permission.write=none -AT91C_CAN_MB6_MID.name="AT91C_CAN_MB6_MID" -AT91C_CAN_MB6_MID.description="MailBox ID Register" -AT91C_CAN_MB6_MID.helpkey="MailBox ID Register" -AT91C_CAN_MB6_MID.access=memorymapped -AT91C_CAN_MB6_MID.address=0xFFFD02C8 -AT91C_CAN_MB6_MID.width=32 -AT91C_CAN_MB6_MID.byteEndian=little -AT91C_CAN_MB6_MAM.name="AT91C_CAN_MB6_MAM" -AT91C_CAN_MB6_MAM.description="MailBox Acceptance Mask Register" -AT91C_CAN_MB6_MAM.helpkey="MailBox Acceptance Mask Register" -AT91C_CAN_MB6_MAM.access=memorymapped -AT91C_CAN_MB6_MAM.address=0xFFFD02C4 -AT91C_CAN_MB6_MAM.width=32 -AT91C_CAN_MB6_MAM.byteEndian=little -AT91C_CAN_MB6_MSR.name="AT91C_CAN_MB6_MSR" -AT91C_CAN_MB6_MSR.description="MailBox Status Register" -AT91C_CAN_MB6_MSR.helpkey="MailBox Status Register" -AT91C_CAN_MB6_MSR.access=memorymapped -AT91C_CAN_MB6_MSR.address=0xFFFD02D0 -AT91C_CAN_MB6_MSR.width=32 -AT91C_CAN_MB6_MSR.byteEndian=little -AT91C_CAN_MB6_MSR.permission.write=none -AT91C_CAN_MB6_MDL.name="AT91C_CAN_MB6_MDL" -AT91C_CAN_MB6_MDL.description="MailBox Data Low Register" -AT91C_CAN_MB6_MDL.helpkey="MailBox Data Low Register" -AT91C_CAN_MB6_MDL.access=memorymapped -AT91C_CAN_MB6_MDL.address=0xFFFD02D4 -AT91C_CAN_MB6_MDL.width=32 -AT91C_CAN_MB6_MDL.byteEndian=little -AT91C_CAN_MB6_MCR.name="AT91C_CAN_MB6_MCR" -AT91C_CAN_MB6_MCR.description="MailBox Control Register" -AT91C_CAN_MB6_MCR.helpkey="MailBox Control Register" -AT91C_CAN_MB6_MCR.access=memorymapped -AT91C_CAN_MB6_MCR.address=0xFFFD02DC -AT91C_CAN_MB6_MCR.width=32 -AT91C_CAN_MB6_MCR.byteEndian=little -AT91C_CAN_MB6_MCR.type=enum -AT91C_CAN_MB6_MCR.enum.0.name=*** Write only *** -AT91C_CAN_MB6_MCR.enum.1.name=Error -AT91C_CAN_MB6_MDH.name="AT91C_CAN_MB6_MDH" -AT91C_CAN_MB6_MDH.description="MailBox Data High Register" -AT91C_CAN_MB6_MDH.helpkey="MailBox Data High Register" -AT91C_CAN_MB6_MDH.access=memorymapped -AT91C_CAN_MB6_MDH.address=0xFFFD02D8 -AT91C_CAN_MB6_MDH.width=32 -AT91C_CAN_MB6_MDH.byteEndian=little -AT91C_CAN_MB6_MMR.name="AT91C_CAN_MB6_MMR" -AT91C_CAN_MB6_MMR.description="MailBox Mode Register" -AT91C_CAN_MB6_MMR.helpkey="MailBox Mode Register" -AT91C_CAN_MB6_MMR.access=memorymapped -AT91C_CAN_MB6_MMR.address=0xFFFD02C0 -AT91C_CAN_MB6_MMR.width=32 -AT91C_CAN_MB6_MMR.byteEndian=little -# ========== Register definition for CAN_MB7 peripheral ========== -AT91C_CAN_MB7_MCR.name="AT91C_CAN_MB7_MCR" -AT91C_CAN_MB7_MCR.description="MailBox Control Register" -AT91C_CAN_MB7_MCR.helpkey="MailBox Control Register" -AT91C_CAN_MB7_MCR.access=memorymapped -AT91C_CAN_MB7_MCR.address=0xFFFD02FC -AT91C_CAN_MB7_MCR.width=32 -AT91C_CAN_MB7_MCR.byteEndian=little -AT91C_CAN_MB7_MCR.type=enum -AT91C_CAN_MB7_MCR.enum.0.name=*** Write only *** -AT91C_CAN_MB7_MCR.enum.1.name=Error -AT91C_CAN_MB7_MDH.name="AT91C_CAN_MB7_MDH" -AT91C_CAN_MB7_MDH.description="MailBox Data High Register" -AT91C_CAN_MB7_MDH.helpkey="MailBox Data High Register" -AT91C_CAN_MB7_MDH.access=memorymapped -AT91C_CAN_MB7_MDH.address=0xFFFD02F8 -AT91C_CAN_MB7_MDH.width=32 -AT91C_CAN_MB7_MDH.byteEndian=little -AT91C_CAN_MB7_MFID.name="AT91C_CAN_MB7_MFID" -AT91C_CAN_MB7_MFID.description="MailBox Family ID Register" -AT91C_CAN_MB7_MFID.helpkey="MailBox Family ID Register" -AT91C_CAN_MB7_MFID.access=memorymapped -AT91C_CAN_MB7_MFID.address=0xFFFD02EC -AT91C_CAN_MB7_MFID.width=32 -AT91C_CAN_MB7_MFID.byteEndian=little -AT91C_CAN_MB7_MFID.permission.write=none -AT91C_CAN_MB7_MDL.name="AT91C_CAN_MB7_MDL" -AT91C_CAN_MB7_MDL.description="MailBox Data Low Register" -AT91C_CAN_MB7_MDL.helpkey="MailBox Data Low Register" -AT91C_CAN_MB7_MDL.access=memorymapped -AT91C_CAN_MB7_MDL.address=0xFFFD02F4 -AT91C_CAN_MB7_MDL.width=32 -AT91C_CAN_MB7_MDL.byteEndian=little -AT91C_CAN_MB7_MID.name="AT91C_CAN_MB7_MID" -AT91C_CAN_MB7_MID.description="MailBox ID Register" -AT91C_CAN_MB7_MID.helpkey="MailBox ID Register" -AT91C_CAN_MB7_MID.access=memorymapped -AT91C_CAN_MB7_MID.address=0xFFFD02E8 -AT91C_CAN_MB7_MID.width=32 -AT91C_CAN_MB7_MID.byteEndian=little -AT91C_CAN_MB7_MMR.name="AT91C_CAN_MB7_MMR" -AT91C_CAN_MB7_MMR.description="MailBox Mode Register" -AT91C_CAN_MB7_MMR.helpkey="MailBox Mode Register" -AT91C_CAN_MB7_MMR.access=memorymapped -AT91C_CAN_MB7_MMR.address=0xFFFD02E0 -AT91C_CAN_MB7_MMR.width=32 -AT91C_CAN_MB7_MMR.byteEndian=little -AT91C_CAN_MB7_MAM.name="AT91C_CAN_MB7_MAM" -AT91C_CAN_MB7_MAM.description="MailBox Acceptance Mask Register" -AT91C_CAN_MB7_MAM.helpkey="MailBox Acceptance Mask Register" -AT91C_CAN_MB7_MAM.access=memorymapped -AT91C_CAN_MB7_MAM.address=0xFFFD02E4 -AT91C_CAN_MB7_MAM.width=32 -AT91C_CAN_MB7_MAM.byteEndian=little -AT91C_CAN_MB7_MSR.name="AT91C_CAN_MB7_MSR" -AT91C_CAN_MB7_MSR.description="MailBox Status Register" -AT91C_CAN_MB7_MSR.helpkey="MailBox Status Register" -AT91C_CAN_MB7_MSR.access=memorymapped -AT91C_CAN_MB7_MSR.address=0xFFFD02F0 -AT91C_CAN_MB7_MSR.width=32 -AT91C_CAN_MB7_MSR.byteEndian=little -AT91C_CAN_MB7_MSR.permission.write=none -# ========== Register definition for CAN peripheral ========== -AT91C_CAN_TCR.name="AT91C_CAN_TCR" -AT91C_CAN_TCR.description="Transfer Command Register" -AT91C_CAN_TCR.helpkey="Transfer Command Register" -AT91C_CAN_TCR.access=memorymapped -AT91C_CAN_TCR.address=0xFFFD0024 -AT91C_CAN_TCR.width=32 -AT91C_CAN_TCR.byteEndian=little -AT91C_CAN_TCR.type=enum -AT91C_CAN_TCR.enum.0.name=*** Write only *** -AT91C_CAN_TCR.enum.1.name=Error -AT91C_CAN_IMR.name="AT91C_CAN_IMR" -AT91C_CAN_IMR.description="Interrupt Mask Register" -AT91C_CAN_IMR.helpkey="Interrupt Mask Register" -AT91C_CAN_IMR.access=memorymapped -AT91C_CAN_IMR.address=0xFFFD000C -AT91C_CAN_IMR.width=32 -AT91C_CAN_IMR.byteEndian=little -AT91C_CAN_IMR.permission.write=none -AT91C_CAN_IER.name="AT91C_CAN_IER" -AT91C_CAN_IER.description="Interrupt Enable Register" -AT91C_CAN_IER.helpkey="Interrupt Enable Register" -AT91C_CAN_IER.access=memorymapped -AT91C_CAN_IER.address=0xFFFD0004 -AT91C_CAN_IER.width=32 -AT91C_CAN_IER.byteEndian=little -AT91C_CAN_IER.type=enum -AT91C_CAN_IER.enum.0.name=*** Write only *** -AT91C_CAN_IER.enum.1.name=Error -AT91C_CAN_ECR.name="AT91C_CAN_ECR" -AT91C_CAN_ECR.description="Error Counter Register" -AT91C_CAN_ECR.helpkey="Error Counter Register" -AT91C_CAN_ECR.access=memorymapped -AT91C_CAN_ECR.address=0xFFFD0020 -AT91C_CAN_ECR.width=32 -AT91C_CAN_ECR.byteEndian=little -AT91C_CAN_ECR.permission.write=none -AT91C_CAN_TIMESTP.name="AT91C_CAN_TIMESTP" -AT91C_CAN_TIMESTP.description="Time Stamp Register" -AT91C_CAN_TIMESTP.helpkey="Time Stamp Register" -AT91C_CAN_TIMESTP.access=memorymapped -AT91C_CAN_TIMESTP.address=0xFFFD001C -AT91C_CAN_TIMESTP.width=32 -AT91C_CAN_TIMESTP.byteEndian=little -AT91C_CAN_TIMESTP.permission.write=none -AT91C_CAN_MR.name="AT91C_CAN_MR" -AT91C_CAN_MR.description="Mode Register" -AT91C_CAN_MR.helpkey="Mode Register" -AT91C_CAN_MR.access=memorymapped -AT91C_CAN_MR.address=0xFFFD0000 -AT91C_CAN_MR.width=32 -AT91C_CAN_MR.byteEndian=little -AT91C_CAN_IDR.name="AT91C_CAN_IDR" -AT91C_CAN_IDR.description="Interrupt Disable Register" -AT91C_CAN_IDR.helpkey="Interrupt Disable Register" -AT91C_CAN_IDR.access=memorymapped -AT91C_CAN_IDR.address=0xFFFD0008 -AT91C_CAN_IDR.width=32 -AT91C_CAN_IDR.byteEndian=little -AT91C_CAN_IDR.type=enum -AT91C_CAN_IDR.enum.0.name=*** Write only *** -AT91C_CAN_IDR.enum.1.name=Error -AT91C_CAN_ACR.name="AT91C_CAN_ACR" -AT91C_CAN_ACR.description="Abort Command Register" -AT91C_CAN_ACR.helpkey="Abort Command Register" -AT91C_CAN_ACR.access=memorymapped -AT91C_CAN_ACR.address=0xFFFD0028 -AT91C_CAN_ACR.width=32 -AT91C_CAN_ACR.byteEndian=little -AT91C_CAN_ACR.type=enum -AT91C_CAN_ACR.enum.0.name=*** Write only *** -AT91C_CAN_ACR.enum.1.name=Error -AT91C_CAN_TIM.name="AT91C_CAN_TIM" -AT91C_CAN_TIM.description="Timer Register" -AT91C_CAN_TIM.helpkey="Timer Register" -AT91C_CAN_TIM.access=memorymapped -AT91C_CAN_TIM.address=0xFFFD0018 -AT91C_CAN_TIM.width=32 -AT91C_CAN_TIM.byteEndian=little -AT91C_CAN_TIM.permission.write=none -AT91C_CAN_SR.name="AT91C_CAN_SR" -AT91C_CAN_SR.description="Status Register" -AT91C_CAN_SR.helpkey="Status Register" -AT91C_CAN_SR.access=memorymapped -AT91C_CAN_SR.address=0xFFFD0010 -AT91C_CAN_SR.width=32 -AT91C_CAN_SR.byteEndian=little -AT91C_CAN_SR.permission.write=none -AT91C_CAN_BR.name="AT91C_CAN_BR" -AT91C_CAN_BR.description="Baudrate Register" -AT91C_CAN_BR.helpkey="Baudrate Register" -AT91C_CAN_BR.access=memorymapped -AT91C_CAN_BR.address=0xFFFD0014 -AT91C_CAN_BR.width=32 -AT91C_CAN_BR.byteEndian=little -AT91C_CAN_VR.name="AT91C_CAN_VR" -AT91C_CAN_VR.description="Version Register" -AT91C_CAN_VR.helpkey="Version Register" -AT91C_CAN_VR.access=memorymapped -AT91C_CAN_VR.address=0xFFFD00FC -AT91C_CAN_VR.width=32 -AT91C_CAN_VR.byteEndian=little -AT91C_CAN_VR.permission.write=none -# ========== Register definition for EMAC peripheral ========== -AT91C_EMAC_ISR.name="AT91C_EMAC_ISR" -AT91C_EMAC_ISR.description="Interrupt Status Register" -AT91C_EMAC_ISR.helpkey="Interrupt Status Register" -AT91C_EMAC_ISR.access=memorymapped -AT91C_EMAC_ISR.address=0xFFFDC024 -AT91C_EMAC_ISR.width=32 -AT91C_EMAC_ISR.byteEndian=little -AT91C_EMAC_SA4H.name="AT91C_EMAC_SA4H" -AT91C_EMAC_SA4H.description="Specific Address 4 Top, Last 2 bytes" -AT91C_EMAC_SA4H.helpkey="Specific Address 4 Top, Last 2 bytes" -AT91C_EMAC_SA4H.access=memorymapped -AT91C_EMAC_SA4H.address=0xFFFDC0B4 -AT91C_EMAC_SA4H.width=32 -AT91C_EMAC_SA4H.byteEndian=little -AT91C_EMAC_SA1L.name="AT91C_EMAC_SA1L" -AT91C_EMAC_SA1L.description="Specific Address 1 Bottom, First 4 bytes" -AT91C_EMAC_SA1L.helpkey="Specific Address 1 Bottom, First 4 bytes" -AT91C_EMAC_SA1L.access=memorymapped -AT91C_EMAC_SA1L.address=0xFFFDC098 -AT91C_EMAC_SA1L.width=32 -AT91C_EMAC_SA1L.byteEndian=little -AT91C_EMAC_ELE.name="AT91C_EMAC_ELE" -AT91C_EMAC_ELE.description="Excessive Length Errors Register" -AT91C_EMAC_ELE.helpkey="Excessive Length Errors Register" -AT91C_EMAC_ELE.access=memorymapped -AT91C_EMAC_ELE.address=0xFFFDC078 -AT91C_EMAC_ELE.width=32 -AT91C_EMAC_ELE.byteEndian=little -AT91C_EMAC_LCOL.name="AT91C_EMAC_LCOL" -AT91C_EMAC_LCOL.description="Late Collision Register" -AT91C_EMAC_LCOL.helpkey="Late Collision Register" -AT91C_EMAC_LCOL.access=memorymapped -AT91C_EMAC_LCOL.address=0xFFFDC05C -AT91C_EMAC_LCOL.width=32 -AT91C_EMAC_LCOL.byteEndian=little -AT91C_EMAC_RLE.name="AT91C_EMAC_RLE" -AT91C_EMAC_RLE.description="Receive Length Field Mismatch Register" -AT91C_EMAC_RLE.helpkey="Receive Length Field Mismatch Register" -AT91C_EMAC_RLE.access=memorymapped -AT91C_EMAC_RLE.address=0xFFFDC088 -AT91C_EMAC_RLE.width=32 -AT91C_EMAC_RLE.byteEndian=little -AT91C_EMAC_WOL.name="AT91C_EMAC_WOL" -AT91C_EMAC_WOL.description="Wake On LAN Register" -AT91C_EMAC_WOL.helpkey="Wake On LAN Register" -AT91C_EMAC_WOL.access=memorymapped -AT91C_EMAC_WOL.address=0xFFFDC0C4 -AT91C_EMAC_WOL.width=32 -AT91C_EMAC_WOL.byteEndian=little -AT91C_EMAC_DTF.name="AT91C_EMAC_DTF" -AT91C_EMAC_DTF.description="Deferred Transmission Frame Register" -AT91C_EMAC_DTF.helpkey="Deferred Transmission Frame Register" -AT91C_EMAC_DTF.access=memorymapped -AT91C_EMAC_DTF.address=0xFFFDC058 -AT91C_EMAC_DTF.width=32 -AT91C_EMAC_DTF.byteEndian=little -AT91C_EMAC_TUND.name="AT91C_EMAC_TUND" -AT91C_EMAC_TUND.description="Transmit Underrun Error Register" -AT91C_EMAC_TUND.helpkey="Transmit Underrun Error Register" -AT91C_EMAC_TUND.access=memorymapped -AT91C_EMAC_TUND.address=0xFFFDC064 -AT91C_EMAC_TUND.width=32 -AT91C_EMAC_TUND.byteEndian=little -AT91C_EMAC_NCR.name="AT91C_EMAC_NCR" -AT91C_EMAC_NCR.description="Network Control Register" -AT91C_EMAC_NCR.helpkey="Network Control Register" -AT91C_EMAC_NCR.access=memorymapped -AT91C_EMAC_NCR.address=0xFFFDC000 -AT91C_EMAC_NCR.width=32 -AT91C_EMAC_NCR.byteEndian=little -AT91C_EMAC_SA4L.name="AT91C_EMAC_SA4L" -AT91C_EMAC_SA4L.description="Specific Address 4 Bottom, First 4 bytes" -AT91C_EMAC_SA4L.helpkey="Specific Address 4 Bottom, First 4 bytes" -AT91C_EMAC_SA4L.access=memorymapped -AT91C_EMAC_SA4L.address=0xFFFDC0B0 -AT91C_EMAC_SA4L.width=32 -AT91C_EMAC_SA4L.byteEndian=little -AT91C_EMAC_RSR.name="AT91C_EMAC_RSR" -AT91C_EMAC_RSR.description="Receive Status Register" -AT91C_EMAC_RSR.helpkey="Receive Status Register" -AT91C_EMAC_RSR.access=memorymapped -AT91C_EMAC_RSR.address=0xFFFDC020 -AT91C_EMAC_RSR.width=32 -AT91C_EMAC_RSR.byteEndian=little -AT91C_EMAC_SA3L.name="AT91C_EMAC_SA3L" -AT91C_EMAC_SA3L.description="Specific Address 3 Bottom, First 4 bytes" -AT91C_EMAC_SA3L.helpkey="Specific Address 3 Bottom, First 4 bytes" -AT91C_EMAC_SA3L.access=memorymapped -AT91C_EMAC_SA3L.address=0xFFFDC0A8 -AT91C_EMAC_SA3L.width=32 -AT91C_EMAC_SA3L.byteEndian=little -AT91C_EMAC_TSR.name="AT91C_EMAC_TSR" -AT91C_EMAC_TSR.description="Transmit Status Register" -AT91C_EMAC_TSR.helpkey="Transmit Status Register" -AT91C_EMAC_TSR.access=memorymapped -AT91C_EMAC_TSR.address=0xFFFDC014 -AT91C_EMAC_TSR.width=32 -AT91C_EMAC_TSR.byteEndian=little -AT91C_EMAC_IDR.name="AT91C_EMAC_IDR" -AT91C_EMAC_IDR.description="Interrupt Disable Register" -AT91C_EMAC_IDR.helpkey="Interrupt Disable Register" -AT91C_EMAC_IDR.access=memorymapped -AT91C_EMAC_IDR.address=0xFFFDC02C -AT91C_EMAC_IDR.width=32 -AT91C_EMAC_IDR.byteEndian=little -AT91C_EMAC_IDR.type=enum -AT91C_EMAC_IDR.enum.0.name=*** Write only *** -AT91C_EMAC_IDR.enum.1.name=Error -AT91C_EMAC_RSE.name="AT91C_EMAC_RSE" -AT91C_EMAC_RSE.description="Receive Symbol Errors Register" -AT91C_EMAC_RSE.helpkey="Receive Symbol Errors Register" -AT91C_EMAC_RSE.access=memorymapped -AT91C_EMAC_RSE.address=0xFFFDC074 -AT91C_EMAC_RSE.width=32 -AT91C_EMAC_RSE.byteEndian=little -AT91C_EMAC_ECOL.name="AT91C_EMAC_ECOL" -AT91C_EMAC_ECOL.description="Excessive Collision Register" -AT91C_EMAC_ECOL.helpkey="Excessive Collision Register" -AT91C_EMAC_ECOL.access=memorymapped -AT91C_EMAC_ECOL.address=0xFFFDC060 -AT91C_EMAC_ECOL.width=32 -AT91C_EMAC_ECOL.byteEndian=little -AT91C_EMAC_TID.name="AT91C_EMAC_TID" -AT91C_EMAC_TID.description="Type ID Checking Register" -AT91C_EMAC_TID.helpkey="Type ID Checking Register" -AT91C_EMAC_TID.access=memorymapped -AT91C_EMAC_TID.address=0xFFFDC0B8 -AT91C_EMAC_TID.width=32 -AT91C_EMAC_TID.byteEndian=little -AT91C_EMAC_HRB.name="AT91C_EMAC_HRB" -AT91C_EMAC_HRB.description="Hash Address Bottom[31:0]" -AT91C_EMAC_HRB.helpkey="Hash Address Bottom[31:0]" -AT91C_EMAC_HRB.access=memorymapped -AT91C_EMAC_HRB.address=0xFFFDC090 -AT91C_EMAC_HRB.width=32 -AT91C_EMAC_HRB.byteEndian=little -AT91C_EMAC_TBQP.name="AT91C_EMAC_TBQP" -AT91C_EMAC_TBQP.description="Transmit Buffer Queue Pointer" -AT91C_EMAC_TBQP.helpkey="Transmit Buffer Queue Pointer" -AT91C_EMAC_TBQP.access=memorymapped -AT91C_EMAC_TBQP.address=0xFFFDC01C -AT91C_EMAC_TBQP.width=32 -AT91C_EMAC_TBQP.byteEndian=little -AT91C_EMAC_USRIO.name="AT91C_EMAC_USRIO" -AT91C_EMAC_USRIO.description="USER Input/Output Register" -AT91C_EMAC_USRIO.helpkey="USER Input/Output Register" -AT91C_EMAC_USRIO.access=memorymapped -AT91C_EMAC_USRIO.address=0xFFFDC0C0 -AT91C_EMAC_USRIO.width=32 -AT91C_EMAC_USRIO.byteEndian=little -AT91C_EMAC_PTR.name="AT91C_EMAC_PTR" -AT91C_EMAC_PTR.description="Pause Time Register" -AT91C_EMAC_PTR.helpkey="Pause Time Register" -AT91C_EMAC_PTR.access=memorymapped -AT91C_EMAC_PTR.address=0xFFFDC038 -AT91C_EMAC_PTR.width=32 -AT91C_EMAC_PTR.byteEndian=little -AT91C_EMAC_SA2H.name="AT91C_EMAC_SA2H" -AT91C_EMAC_SA2H.description="Specific Address 2 Top, Last 2 bytes" -AT91C_EMAC_SA2H.helpkey="Specific Address 2 Top, Last 2 bytes" -AT91C_EMAC_SA2H.access=memorymapped -AT91C_EMAC_SA2H.address=0xFFFDC0A4 -AT91C_EMAC_SA2H.width=32 -AT91C_EMAC_SA2H.byteEndian=little -AT91C_EMAC_ROV.name="AT91C_EMAC_ROV" -AT91C_EMAC_ROV.description="Receive Overrun Errors Register" -AT91C_EMAC_ROV.helpkey="Receive Overrun Errors Register" -AT91C_EMAC_ROV.access=memorymapped -AT91C_EMAC_ROV.address=0xFFFDC070 -AT91C_EMAC_ROV.width=32 -AT91C_EMAC_ROV.byteEndian=little -AT91C_EMAC_ALE.name="AT91C_EMAC_ALE" -AT91C_EMAC_ALE.description="Alignment Error Register" -AT91C_EMAC_ALE.helpkey="Alignment Error Register" -AT91C_EMAC_ALE.access=memorymapped -AT91C_EMAC_ALE.address=0xFFFDC054 -AT91C_EMAC_ALE.width=32 -AT91C_EMAC_ALE.byteEndian=little -AT91C_EMAC_RJA.name="AT91C_EMAC_RJA" -AT91C_EMAC_RJA.description="Receive Jabbers Register" -AT91C_EMAC_RJA.helpkey="Receive Jabbers Register" -AT91C_EMAC_RJA.access=memorymapped -AT91C_EMAC_RJA.address=0xFFFDC07C -AT91C_EMAC_RJA.width=32 -AT91C_EMAC_RJA.byteEndian=little -AT91C_EMAC_RBQP.name="AT91C_EMAC_RBQP" -AT91C_EMAC_RBQP.description="Receive Buffer Queue Pointer" -AT91C_EMAC_RBQP.helpkey="Receive Buffer Queue Pointer" -AT91C_EMAC_RBQP.access=memorymapped -AT91C_EMAC_RBQP.address=0xFFFDC018 -AT91C_EMAC_RBQP.width=32 -AT91C_EMAC_RBQP.byteEndian=little -AT91C_EMAC_TPF.name="AT91C_EMAC_TPF" -AT91C_EMAC_TPF.description="Transmitted Pause Frames Register" -AT91C_EMAC_TPF.helpkey="Transmitted Pause Frames Register" -AT91C_EMAC_TPF.access=memorymapped -AT91C_EMAC_TPF.address=0xFFFDC08C -AT91C_EMAC_TPF.width=32 -AT91C_EMAC_TPF.byteEndian=little -AT91C_EMAC_NCFGR.name="AT91C_EMAC_NCFGR" -AT91C_EMAC_NCFGR.description="Network Configuration Register" -AT91C_EMAC_NCFGR.helpkey="Network Configuration Register" -AT91C_EMAC_NCFGR.access=memorymapped -AT91C_EMAC_NCFGR.address=0xFFFDC004 -AT91C_EMAC_NCFGR.width=32 -AT91C_EMAC_NCFGR.byteEndian=little -AT91C_EMAC_HRT.name="AT91C_EMAC_HRT" -AT91C_EMAC_HRT.description="Hash Address Top[63:32]" -AT91C_EMAC_HRT.helpkey="Hash Address Top[63:32]" -AT91C_EMAC_HRT.access=memorymapped -AT91C_EMAC_HRT.address=0xFFFDC094 -AT91C_EMAC_HRT.width=32 -AT91C_EMAC_HRT.byteEndian=little -AT91C_EMAC_USF.name="AT91C_EMAC_USF" -AT91C_EMAC_USF.description="Undersize Frames Register" -AT91C_EMAC_USF.helpkey="Undersize Frames Register" -AT91C_EMAC_USF.access=memorymapped -AT91C_EMAC_USF.address=0xFFFDC080 -AT91C_EMAC_USF.width=32 -AT91C_EMAC_USF.byteEndian=little -AT91C_EMAC_FCSE.name="AT91C_EMAC_FCSE" -AT91C_EMAC_FCSE.description="Frame Check Sequence Error Register" -AT91C_EMAC_FCSE.helpkey="Frame Check Sequence Error Register" -AT91C_EMAC_FCSE.access=memorymapped -AT91C_EMAC_FCSE.address=0xFFFDC050 -AT91C_EMAC_FCSE.width=32 -AT91C_EMAC_FCSE.byteEndian=little -AT91C_EMAC_TPQ.name="AT91C_EMAC_TPQ" -AT91C_EMAC_TPQ.description="Transmit Pause Quantum Register" -AT91C_EMAC_TPQ.helpkey="Transmit Pause Quantum Register" -AT91C_EMAC_TPQ.access=memorymapped -AT91C_EMAC_TPQ.address=0xFFFDC0BC -AT91C_EMAC_TPQ.width=32 -AT91C_EMAC_TPQ.byteEndian=little -AT91C_EMAC_MAN.name="AT91C_EMAC_MAN" -AT91C_EMAC_MAN.description="PHY Maintenance Register" -AT91C_EMAC_MAN.helpkey="PHY Maintenance Register" -AT91C_EMAC_MAN.access=memorymapped -AT91C_EMAC_MAN.address=0xFFFDC034 -AT91C_EMAC_MAN.width=32 -AT91C_EMAC_MAN.byteEndian=little -AT91C_EMAC_FTO.name="AT91C_EMAC_FTO" -AT91C_EMAC_FTO.description="Frames Transmitted OK Register" -AT91C_EMAC_FTO.helpkey="Frames Transmitted OK Register" -AT91C_EMAC_FTO.access=memorymapped -AT91C_EMAC_FTO.address=0xFFFDC040 -AT91C_EMAC_FTO.width=32 -AT91C_EMAC_FTO.byteEndian=little -AT91C_EMAC_REV.name="AT91C_EMAC_REV" -AT91C_EMAC_REV.description="Revision Register" -AT91C_EMAC_REV.helpkey="Revision Register" -AT91C_EMAC_REV.access=memorymapped -AT91C_EMAC_REV.address=0xFFFDC0FC -AT91C_EMAC_REV.width=32 -AT91C_EMAC_REV.byteEndian=little -AT91C_EMAC_REV.permission.write=none -AT91C_EMAC_IMR.name="AT91C_EMAC_IMR" -AT91C_EMAC_IMR.description="Interrupt Mask Register" -AT91C_EMAC_IMR.helpkey="Interrupt Mask Register" -AT91C_EMAC_IMR.access=memorymapped -AT91C_EMAC_IMR.address=0xFFFDC030 -AT91C_EMAC_IMR.width=32 -AT91C_EMAC_IMR.byteEndian=little -AT91C_EMAC_IMR.permission.write=none -AT91C_EMAC_SCF.name="AT91C_EMAC_SCF" -AT91C_EMAC_SCF.description="Single Collision Frame Register" -AT91C_EMAC_SCF.helpkey="Single Collision Frame Register" -AT91C_EMAC_SCF.access=memorymapped -AT91C_EMAC_SCF.address=0xFFFDC044 -AT91C_EMAC_SCF.width=32 -AT91C_EMAC_SCF.byteEndian=little -AT91C_EMAC_PFR.name="AT91C_EMAC_PFR" -AT91C_EMAC_PFR.description="Pause Frames received Register" -AT91C_EMAC_PFR.helpkey="Pause Frames received Register" -AT91C_EMAC_PFR.access=memorymapped -AT91C_EMAC_PFR.address=0xFFFDC03C -AT91C_EMAC_PFR.width=32 -AT91C_EMAC_PFR.byteEndian=little -AT91C_EMAC_MCF.name="AT91C_EMAC_MCF" -AT91C_EMAC_MCF.description="Multiple Collision Frame Register" -AT91C_EMAC_MCF.helpkey="Multiple Collision Frame Register" -AT91C_EMAC_MCF.access=memorymapped -AT91C_EMAC_MCF.address=0xFFFDC048 -AT91C_EMAC_MCF.width=32 -AT91C_EMAC_MCF.byteEndian=little -AT91C_EMAC_NSR.name="AT91C_EMAC_NSR" -AT91C_EMAC_NSR.description="Network Status Register" -AT91C_EMAC_NSR.helpkey="Network Status Register" -AT91C_EMAC_NSR.access=memorymapped -AT91C_EMAC_NSR.address=0xFFFDC008 -AT91C_EMAC_NSR.width=32 -AT91C_EMAC_NSR.byteEndian=little -AT91C_EMAC_NSR.permission.write=none -AT91C_EMAC_SA2L.name="AT91C_EMAC_SA2L" -AT91C_EMAC_SA2L.description="Specific Address 2 Bottom, First 4 bytes" -AT91C_EMAC_SA2L.helpkey="Specific Address 2 Bottom, First 4 bytes" -AT91C_EMAC_SA2L.access=memorymapped -AT91C_EMAC_SA2L.address=0xFFFDC0A0 -AT91C_EMAC_SA2L.width=32 -AT91C_EMAC_SA2L.byteEndian=little -AT91C_EMAC_FRO.name="AT91C_EMAC_FRO" -AT91C_EMAC_FRO.description="Frames Received OK Register" -AT91C_EMAC_FRO.helpkey="Frames Received OK Register" -AT91C_EMAC_FRO.access=memorymapped -AT91C_EMAC_FRO.address=0xFFFDC04C -AT91C_EMAC_FRO.width=32 -AT91C_EMAC_FRO.byteEndian=little -AT91C_EMAC_IER.name="AT91C_EMAC_IER" -AT91C_EMAC_IER.description="Interrupt Enable Register" -AT91C_EMAC_IER.helpkey="Interrupt Enable Register" -AT91C_EMAC_IER.access=memorymapped -AT91C_EMAC_IER.address=0xFFFDC028 -AT91C_EMAC_IER.width=32 -AT91C_EMAC_IER.byteEndian=little -AT91C_EMAC_IER.type=enum -AT91C_EMAC_IER.enum.0.name=*** Write only *** -AT91C_EMAC_IER.enum.1.name=Error -AT91C_EMAC_SA1H.name="AT91C_EMAC_SA1H" -AT91C_EMAC_SA1H.description="Specific Address 1 Top, Last 2 bytes" -AT91C_EMAC_SA1H.helpkey="Specific Address 1 Top, Last 2 bytes" -AT91C_EMAC_SA1H.access=memorymapped -AT91C_EMAC_SA1H.address=0xFFFDC09C -AT91C_EMAC_SA1H.width=32 -AT91C_EMAC_SA1H.byteEndian=little -AT91C_EMAC_CSE.name="AT91C_EMAC_CSE" -AT91C_EMAC_CSE.description="Carrier Sense Error Register" -AT91C_EMAC_CSE.helpkey="Carrier Sense Error Register" -AT91C_EMAC_CSE.access=memorymapped -AT91C_EMAC_CSE.address=0xFFFDC068 -AT91C_EMAC_CSE.width=32 -AT91C_EMAC_CSE.byteEndian=little -AT91C_EMAC_SA3H.name="AT91C_EMAC_SA3H" -AT91C_EMAC_SA3H.description="Specific Address 3 Top, Last 2 bytes" -AT91C_EMAC_SA3H.helpkey="Specific Address 3 Top, Last 2 bytes" -AT91C_EMAC_SA3H.access=memorymapped -AT91C_EMAC_SA3H.address=0xFFFDC0AC -AT91C_EMAC_SA3H.width=32 -AT91C_EMAC_SA3H.byteEndian=little -AT91C_EMAC_RRE.name="AT91C_EMAC_RRE" -AT91C_EMAC_RRE.description="Receive Ressource Error Register" -AT91C_EMAC_RRE.helpkey="Receive Ressource Error Register" -AT91C_EMAC_RRE.access=memorymapped -AT91C_EMAC_RRE.address=0xFFFDC06C -AT91C_EMAC_RRE.width=32 -AT91C_EMAC_RRE.byteEndian=little -AT91C_EMAC_STE.name="AT91C_EMAC_STE" -AT91C_EMAC_STE.description="SQE Test Error Register" -AT91C_EMAC_STE.helpkey="SQE Test Error Register" -AT91C_EMAC_STE.access=memorymapped -AT91C_EMAC_STE.address=0xFFFDC084 -AT91C_EMAC_STE.width=32 -AT91C_EMAC_STE.byteEndian=little -# ========== Register definition for PDC_ADC peripheral ========== -AT91C_ADC_PTSR.name="AT91C_ADC_PTSR" -AT91C_ADC_PTSR.description="PDC Transfer Status Register" -AT91C_ADC_PTSR.helpkey="PDC Transfer Status Register" -AT91C_ADC_PTSR.access=memorymapped -AT91C_ADC_PTSR.address=0xFFFD8124 -AT91C_ADC_PTSR.width=32 -AT91C_ADC_PTSR.byteEndian=little -AT91C_ADC_PTSR.permission.write=none -AT91C_ADC_PTCR.name="AT91C_ADC_PTCR" -AT91C_ADC_PTCR.description="PDC Transfer Control Register" -AT91C_ADC_PTCR.helpkey="PDC Transfer Control Register" -AT91C_ADC_PTCR.access=memorymapped -AT91C_ADC_PTCR.address=0xFFFD8120 -AT91C_ADC_PTCR.width=32 -AT91C_ADC_PTCR.byteEndian=little -AT91C_ADC_PTCR.type=enum -AT91C_ADC_PTCR.enum.0.name=*** Write only *** -AT91C_ADC_PTCR.enum.1.name=Error -AT91C_ADC_TNPR.name="AT91C_ADC_TNPR" -AT91C_ADC_TNPR.description="Transmit Next Pointer Register" -AT91C_ADC_TNPR.helpkey="Transmit Next Pointer Register" -AT91C_ADC_TNPR.access=memorymapped -AT91C_ADC_TNPR.address=0xFFFD8118 -AT91C_ADC_TNPR.width=32 -AT91C_ADC_TNPR.byteEndian=little -AT91C_ADC_TNCR.name="AT91C_ADC_TNCR" -AT91C_ADC_TNCR.description="Transmit Next Counter Register" -AT91C_ADC_TNCR.helpkey="Transmit Next Counter Register" -AT91C_ADC_TNCR.access=memorymapped -AT91C_ADC_TNCR.address=0xFFFD811C -AT91C_ADC_TNCR.width=32 -AT91C_ADC_TNCR.byteEndian=little -AT91C_ADC_RNPR.name="AT91C_ADC_RNPR" -AT91C_ADC_RNPR.description="Receive Next Pointer Register" -AT91C_ADC_RNPR.helpkey="Receive Next Pointer Register" -AT91C_ADC_RNPR.access=memorymapped -AT91C_ADC_RNPR.address=0xFFFD8110 -AT91C_ADC_RNPR.width=32 -AT91C_ADC_RNPR.byteEndian=little -AT91C_ADC_RNCR.name="AT91C_ADC_RNCR" -AT91C_ADC_RNCR.description="Receive Next Counter Register" -AT91C_ADC_RNCR.helpkey="Receive Next Counter Register" -AT91C_ADC_RNCR.access=memorymapped -AT91C_ADC_RNCR.address=0xFFFD8114 -AT91C_ADC_RNCR.width=32 -AT91C_ADC_RNCR.byteEndian=little -AT91C_ADC_RPR.name="AT91C_ADC_RPR" -AT91C_ADC_RPR.description="Receive Pointer Register" -AT91C_ADC_RPR.helpkey="Receive Pointer Register" -AT91C_ADC_RPR.access=memorymapped -AT91C_ADC_RPR.address=0xFFFD8100 -AT91C_ADC_RPR.width=32 -AT91C_ADC_RPR.byteEndian=little -AT91C_ADC_TCR.name="AT91C_ADC_TCR" -AT91C_ADC_TCR.description="Transmit Counter Register" -AT91C_ADC_TCR.helpkey="Transmit Counter Register" -AT91C_ADC_TCR.access=memorymapped -AT91C_ADC_TCR.address=0xFFFD810C -AT91C_ADC_TCR.width=32 -AT91C_ADC_TCR.byteEndian=little -AT91C_ADC_TPR.name="AT91C_ADC_TPR" -AT91C_ADC_TPR.description="Transmit Pointer Register" -AT91C_ADC_TPR.helpkey="Transmit Pointer Register" -AT91C_ADC_TPR.access=memorymapped -AT91C_ADC_TPR.address=0xFFFD8108 -AT91C_ADC_TPR.width=32 -AT91C_ADC_TPR.byteEndian=little -AT91C_ADC_RCR.name="AT91C_ADC_RCR" -AT91C_ADC_RCR.description="Receive Counter Register" -AT91C_ADC_RCR.helpkey="Receive Counter Register" -AT91C_ADC_RCR.access=memorymapped -AT91C_ADC_RCR.address=0xFFFD8104 -AT91C_ADC_RCR.width=32 -AT91C_ADC_RCR.byteEndian=little -# ========== Register definition for ADC peripheral ========== -AT91C_ADC_CDR2.name="AT91C_ADC_CDR2" -AT91C_ADC_CDR2.description="ADC Channel Data Register 2" -AT91C_ADC_CDR2.helpkey="ADC Channel Data Register 2" -AT91C_ADC_CDR2.access=memorymapped -AT91C_ADC_CDR2.address=0xFFFD8038 -AT91C_ADC_CDR2.width=32 -AT91C_ADC_CDR2.byteEndian=little -AT91C_ADC_CDR2.permission.write=none -AT91C_ADC_CDR3.name="AT91C_ADC_CDR3" -AT91C_ADC_CDR3.description="ADC Channel Data Register 3" -AT91C_ADC_CDR3.helpkey="ADC Channel Data Register 3" -AT91C_ADC_CDR3.access=memorymapped -AT91C_ADC_CDR3.address=0xFFFD803C -AT91C_ADC_CDR3.width=32 -AT91C_ADC_CDR3.byteEndian=little -AT91C_ADC_CDR3.permission.write=none -AT91C_ADC_CDR0.name="AT91C_ADC_CDR0" -AT91C_ADC_CDR0.description="ADC Channel Data Register 0" -AT91C_ADC_CDR0.helpkey="ADC Channel Data Register 0" -AT91C_ADC_CDR0.access=memorymapped -AT91C_ADC_CDR0.address=0xFFFD8030 -AT91C_ADC_CDR0.width=32 -AT91C_ADC_CDR0.byteEndian=little -AT91C_ADC_CDR0.permission.write=none -AT91C_ADC_CDR5.name="AT91C_ADC_CDR5" -AT91C_ADC_CDR5.description="ADC Channel Data Register 5" -AT91C_ADC_CDR5.helpkey="ADC Channel Data Register 5" -AT91C_ADC_CDR5.access=memorymapped -AT91C_ADC_CDR5.address=0xFFFD8044 -AT91C_ADC_CDR5.width=32 -AT91C_ADC_CDR5.byteEndian=little -AT91C_ADC_CDR5.permission.write=none -AT91C_ADC_CHDR.name="AT91C_ADC_CHDR" -AT91C_ADC_CHDR.description="ADC Channel Disable Register" -AT91C_ADC_CHDR.helpkey="ADC Channel Disable Register" -AT91C_ADC_CHDR.access=memorymapped -AT91C_ADC_CHDR.address=0xFFFD8014 -AT91C_ADC_CHDR.width=32 -AT91C_ADC_CHDR.byteEndian=little -AT91C_ADC_CHDR.type=enum -AT91C_ADC_CHDR.enum.0.name=*** Write only *** -AT91C_ADC_CHDR.enum.1.name=Error -AT91C_ADC_SR.name="AT91C_ADC_SR" -AT91C_ADC_SR.description="ADC Status Register" -AT91C_ADC_SR.helpkey="ADC Status Register" -AT91C_ADC_SR.access=memorymapped -AT91C_ADC_SR.address=0xFFFD801C -AT91C_ADC_SR.width=32 -AT91C_ADC_SR.byteEndian=little -AT91C_ADC_SR.permission.write=none -AT91C_ADC_CDR4.name="AT91C_ADC_CDR4" -AT91C_ADC_CDR4.description="ADC Channel Data Register 4" -AT91C_ADC_CDR4.helpkey="ADC Channel Data Register 4" -AT91C_ADC_CDR4.access=memorymapped -AT91C_ADC_CDR4.address=0xFFFD8040 -AT91C_ADC_CDR4.width=32 -AT91C_ADC_CDR4.byteEndian=little -AT91C_ADC_CDR4.permission.write=none -AT91C_ADC_CDR1.name="AT91C_ADC_CDR1" -AT91C_ADC_CDR1.description="ADC Channel Data Register 1" -AT91C_ADC_CDR1.helpkey="ADC Channel Data Register 1" -AT91C_ADC_CDR1.access=memorymapped -AT91C_ADC_CDR1.address=0xFFFD8034 -AT91C_ADC_CDR1.width=32 -AT91C_ADC_CDR1.byteEndian=little -AT91C_ADC_CDR1.permission.write=none -AT91C_ADC_LCDR.name="AT91C_ADC_LCDR" -AT91C_ADC_LCDR.description="ADC Last Converted Data Register" -AT91C_ADC_LCDR.helpkey="ADC Last Converted Data Register" -AT91C_ADC_LCDR.access=memorymapped -AT91C_ADC_LCDR.address=0xFFFD8020 -AT91C_ADC_LCDR.width=32 -AT91C_ADC_LCDR.byteEndian=little -AT91C_ADC_LCDR.permission.write=none -AT91C_ADC_IDR.name="AT91C_ADC_IDR" -AT91C_ADC_IDR.description="ADC Interrupt Disable Register" -AT91C_ADC_IDR.helpkey="ADC Interrupt Disable Register" -AT91C_ADC_IDR.access=memorymapped -AT91C_ADC_IDR.address=0xFFFD8028 -AT91C_ADC_IDR.width=32 -AT91C_ADC_IDR.byteEndian=little -AT91C_ADC_IDR.type=enum -AT91C_ADC_IDR.enum.0.name=*** Write only *** -AT91C_ADC_IDR.enum.1.name=Error -AT91C_ADC_CR.name="AT91C_ADC_CR" -AT91C_ADC_CR.description="ADC Control Register" -AT91C_ADC_CR.helpkey="ADC Control Register" -AT91C_ADC_CR.access=memorymapped -AT91C_ADC_CR.address=0xFFFD8000 -AT91C_ADC_CR.width=32 -AT91C_ADC_CR.byteEndian=little -AT91C_ADC_CR.type=enum -AT91C_ADC_CR.enum.0.name=*** Write only *** -AT91C_ADC_CR.enum.1.name=Error -AT91C_ADC_CDR7.name="AT91C_ADC_CDR7" -AT91C_ADC_CDR7.description="ADC Channel Data Register 7" -AT91C_ADC_CDR7.helpkey="ADC Channel Data Register 7" -AT91C_ADC_CDR7.access=memorymapped -AT91C_ADC_CDR7.address=0xFFFD804C -AT91C_ADC_CDR7.width=32 -AT91C_ADC_CDR7.byteEndian=little -AT91C_ADC_CDR7.permission.write=none -AT91C_ADC_CDR6.name="AT91C_ADC_CDR6" -AT91C_ADC_CDR6.description="ADC Channel Data Register 6" -AT91C_ADC_CDR6.helpkey="ADC Channel Data Register 6" -AT91C_ADC_CDR6.access=memorymapped -AT91C_ADC_CDR6.address=0xFFFD8048 -AT91C_ADC_CDR6.width=32 -AT91C_ADC_CDR6.byteEndian=little -AT91C_ADC_CDR6.permission.write=none -AT91C_ADC_IER.name="AT91C_ADC_IER" -AT91C_ADC_IER.description="ADC Interrupt Enable Register" -AT91C_ADC_IER.helpkey="ADC Interrupt Enable Register" -AT91C_ADC_IER.access=memorymapped -AT91C_ADC_IER.address=0xFFFD8024 -AT91C_ADC_IER.width=32 -AT91C_ADC_IER.byteEndian=little -AT91C_ADC_IER.type=enum -AT91C_ADC_IER.enum.0.name=*** Write only *** -AT91C_ADC_IER.enum.1.name=Error -AT91C_ADC_CHER.name="AT91C_ADC_CHER" -AT91C_ADC_CHER.description="ADC Channel Enable Register" -AT91C_ADC_CHER.helpkey="ADC Channel Enable Register" -AT91C_ADC_CHER.access=memorymapped -AT91C_ADC_CHER.address=0xFFFD8010 -AT91C_ADC_CHER.width=32 -AT91C_ADC_CHER.byteEndian=little -AT91C_ADC_CHER.type=enum -AT91C_ADC_CHER.enum.0.name=*** Write only *** -AT91C_ADC_CHER.enum.1.name=Error -AT91C_ADC_CHSR.name="AT91C_ADC_CHSR" -AT91C_ADC_CHSR.description="ADC Channel Status Register" -AT91C_ADC_CHSR.helpkey="ADC Channel Status Register" -AT91C_ADC_CHSR.access=memorymapped -AT91C_ADC_CHSR.address=0xFFFD8018 -AT91C_ADC_CHSR.width=32 -AT91C_ADC_CHSR.byteEndian=little -AT91C_ADC_CHSR.permission.write=none -AT91C_ADC_MR.name="AT91C_ADC_MR" -AT91C_ADC_MR.description="ADC Mode Register" -AT91C_ADC_MR.helpkey="ADC Mode Register" -AT91C_ADC_MR.access=memorymapped -AT91C_ADC_MR.address=0xFFFD8004 -AT91C_ADC_MR.width=32 -AT91C_ADC_MR.byteEndian=little -AT91C_ADC_IMR.name="AT91C_ADC_IMR" -AT91C_ADC_IMR.description="ADC Interrupt Mask Register" -AT91C_ADC_IMR.helpkey="ADC Interrupt Mask Register" -AT91C_ADC_IMR.access=memorymapped -AT91C_ADC_IMR.address=0xFFFD802C -AT91C_ADC_IMR.width=32 -AT91C_ADC_IMR.byteEndian=little -AT91C_ADC_IMR.permission.write=none -# ========== Group definition for SYS peripheral ========== -group.SYS.description="ATMEL SYS Registers" -group.SYS.helpkey="ATMEL SYS Registers" -# ========== Group definition for AIC peripheral ========== -group.AIC.description="ATMEL AIC Registers" -group.AIC.helpkey="ATMEL AIC Registers" -group.AIC.register.0=AT91C_AIC_IVR -group.AIC.register.1=AT91C_AIC_SMR -group.AIC.register.2=AT91C_AIC_FVR -group.AIC.register.3=AT91C_AIC_DCR -group.AIC.register.4=AT91C_AIC_EOICR -group.AIC.register.5=AT91C_AIC_SVR -group.AIC.register.6=AT91C_AIC_FFSR -group.AIC.register.7=AT91C_AIC_ICCR -group.AIC.register.8=AT91C_AIC_ISR -group.AIC.register.9=AT91C_AIC_IMR -group.AIC.register.10=AT91C_AIC_IPR -group.AIC.register.11=AT91C_AIC_FFER -group.AIC.register.12=AT91C_AIC_IECR -group.AIC.register.13=AT91C_AIC_ISCR -group.AIC.register.14=AT91C_AIC_FFDR -group.AIC.register.15=AT91C_AIC_CISR -group.AIC.register.16=AT91C_AIC_IDCR -group.AIC.register.17=AT91C_AIC_SPU -# ========== Group definition for PDC_DBGU peripheral ========== -group.PDC_DBGU.description="ATMEL PDC_DBGU Registers" -group.PDC_DBGU.helpkey="ATMEL PDC_DBGU Registers" -group.PDC_DBGU.register.0=AT91C_DBGU_TCR -group.PDC_DBGU.register.1=AT91C_DBGU_RNPR -group.PDC_DBGU.register.2=AT91C_DBGU_TNPR -group.PDC_DBGU.register.3=AT91C_DBGU_TPR -group.PDC_DBGU.register.4=AT91C_DBGU_RPR -group.PDC_DBGU.register.5=AT91C_DBGU_RCR -group.PDC_DBGU.register.6=AT91C_DBGU_RNCR -group.PDC_DBGU.register.7=AT91C_DBGU_PTCR -group.PDC_DBGU.register.8=AT91C_DBGU_PTSR -group.PDC_DBGU.register.9=AT91C_DBGU_TNCR -# ========== Group definition for DBGU peripheral ========== -group.DBGU.description="ATMEL DBGU Registers" -group.DBGU.helpkey="ATMEL DBGU Registers" -group.DBGU.register.0=AT91C_DBGU_EXID -group.DBGU.register.1=AT91C_DBGU_BRGR -group.DBGU.register.2=AT91C_DBGU_IDR -group.DBGU.register.3=AT91C_DBGU_CSR -group.DBGU.register.4=AT91C_DBGU_CIDR -group.DBGU.register.5=AT91C_DBGU_MR -group.DBGU.register.6=AT91C_DBGU_IMR -group.DBGU.register.7=AT91C_DBGU_CR -group.DBGU.register.8=AT91C_DBGU_FNTR -group.DBGU.register.9=AT91C_DBGU_THR -group.DBGU.register.10=AT91C_DBGU_RHR -group.DBGU.register.11=AT91C_DBGU_IER -# ========== Group definition for PIOA peripheral ========== -group.PIOA.description="ATMEL PIOA Registers" -group.PIOA.helpkey="ATMEL PIOA Registers" -group.PIOA.register.0=AT91C_PIOA_ODR -group.PIOA.register.1=AT91C_PIOA_SODR -group.PIOA.register.2=AT91C_PIOA_ISR -group.PIOA.register.3=AT91C_PIOA_ABSR -group.PIOA.register.4=AT91C_PIOA_IER -group.PIOA.register.5=AT91C_PIOA_PPUDR -group.PIOA.register.6=AT91C_PIOA_IMR -group.PIOA.register.7=AT91C_PIOA_PER -group.PIOA.register.8=AT91C_PIOA_IFDR -group.PIOA.register.9=AT91C_PIOA_OWDR -group.PIOA.register.10=AT91C_PIOA_MDSR -group.PIOA.register.11=AT91C_PIOA_IDR -group.PIOA.register.12=AT91C_PIOA_ODSR -group.PIOA.register.13=AT91C_PIOA_PPUSR -group.PIOA.register.14=AT91C_PIOA_OWSR -group.PIOA.register.15=AT91C_PIOA_BSR -group.PIOA.register.16=AT91C_PIOA_OWER -group.PIOA.register.17=AT91C_PIOA_IFER -group.PIOA.register.18=AT91C_PIOA_PDSR -group.PIOA.register.19=AT91C_PIOA_PPUER -group.PIOA.register.20=AT91C_PIOA_OSR -group.PIOA.register.21=AT91C_PIOA_ASR -group.PIOA.register.22=AT91C_PIOA_MDDR -group.PIOA.register.23=AT91C_PIOA_CODR -group.PIOA.register.24=AT91C_PIOA_MDER -group.PIOA.register.25=AT91C_PIOA_PDR -group.PIOA.register.26=AT91C_PIOA_IFSR -group.PIOA.register.27=AT91C_PIOA_OER -group.PIOA.register.28=AT91C_PIOA_PSR -# ========== Group definition for PIOB peripheral ========== -group.PIOB.description="ATMEL PIOB Registers" -group.PIOB.helpkey="ATMEL PIOB Registers" -group.PIOB.register.0=AT91C_PIOB_OWDR -group.PIOB.register.1=AT91C_PIOB_MDER -group.PIOB.register.2=AT91C_PIOB_PPUSR -group.PIOB.register.3=AT91C_PIOB_IMR -group.PIOB.register.4=AT91C_PIOB_ASR -group.PIOB.register.5=AT91C_PIOB_PPUDR -group.PIOB.register.6=AT91C_PIOB_PSR -group.PIOB.register.7=AT91C_PIOB_IER -group.PIOB.register.8=AT91C_PIOB_CODR -group.PIOB.register.9=AT91C_PIOB_OWER -group.PIOB.register.10=AT91C_PIOB_ABSR -group.PIOB.register.11=AT91C_PIOB_IFDR -group.PIOB.register.12=AT91C_PIOB_PDSR -group.PIOB.register.13=AT91C_PIOB_IDR -group.PIOB.register.14=AT91C_PIOB_OWSR -group.PIOB.register.15=AT91C_PIOB_PDR -group.PIOB.register.16=AT91C_PIOB_ODR -group.PIOB.register.17=AT91C_PIOB_IFSR -group.PIOB.register.18=AT91C_PIOB_PPUER -group.PIOB.register.19=AT91C_PIOB_SODR -group.PIOB.register.20=AT91C_PIOB_ISR -group.PIOB.register.21=AT91C_PIOB_ODSR -group.PIOB.register.22=AT91C_PIOB_OSR -group.PIOB.register.23=AT91C_PIOB_MDSR -group.PIOB.register.24=AT91C_PIOB_IFER -group.PIOB.register.25=AT91C_PIOB_BSR -group.PIOB.register.26=AT91C_PIOB_MDDR -group.PIOB.register.27=AT91C_PIOB_OER -group.PIOB.register.28=AT91C_PIOB_PER -# ========== Group definition for CKGR peripheral ========== -group.CKGR.description="ATMEL CKGR Registers" -group.CKGR.helpkey="ATMEL CKGR Registers" -group.CKGR.register.0=AT91C_CKGR_MOR -group.CKGR.register.1=AT91C_CKGR_PLLR -group.CKGR.register.2=AT91C_CKGR_MCFR -# ========== Group definition for PMC peripheral ========== -group.PMC.description="ATMEL PMC Registers" -group.PMC.helpkey="ATMEL PMC Registers" -group.PMC.register.0=AT91C_PMC_IDR -group.PMC.register.1=AT91C_PMC_MOR -group.PMC.register.2=AT91C_PMC_PLLR -group.PMC.register.3=AT91C_PMC_PCER -group.PMC.register.4=AT91C_PMC_PCKR -group.PMC.register.5=AT91C_PMC_MCKR -group.PMC.register.6=AT91C_PMC_SCDR -group.PMC.register.7=AT91C_PMC_PCDR -group.PMC.register.8=AT91C_PMC_SCSR -group.PMC.register.9=AT91C_PMC_PCSR -group.PMC.register.10=AT91C_PMC_MCFR -group.PMC.register.11=AT91C_PMC_SCER -group.PMC.register.12=AT91C_PMC_IMR -group.PMC.register.13=AT91C_PMC_IER -group.PMC.register.14=AT91C_PMC_SR -# ========== Group definition for RSTC peripheral ========== -group.RSTC.description="ATMEL RSTC Registers" -group.RSTC.helpkey="ATMEL RSTC Registers" -group.RSTC.register.0=AT91C_RSTC_RCR -group.RSTC.register.1=AT91C_RSTC_RMR -group.RSTC.register.2=AT91C_RSTC_RSR -# ========== Group definition for RTTC peripheral ========== -group.RTTC.description="ATMEL RTTC Registers" -group.RTTC.helpkey="ATMEL RTTC Registers" -group.RTTC.register.0=AT91C_RTTC_RTSR -group.RTTC.register.1=AT91C_RTTC_RTMR -group.RTTC.register.2=AT91C_RTTC_RTVR -group.RTTC.register.3=AT91C_RTTC_RTAR -# ========== Group definition for PITC peripheral ========== -group.PITC.description="ATMEL PITC Registers" -group.PITC.helpkey="ATMEL PITC Registers" -group.PITC.register.0=AT91C_PITC_PIVR -group.PITC.register.1=AT91C_PITC_PISR -group.PITC.register.2=AT91C_PITC_PIIR -group.PITC.register.3=AT91C_PITC_PIMR -# ========== Group definition for WDTC peripheral ========== -group.WDTC.description="ATMEL WDTC Registers" -group.WDTC.helpkey="ATMEL WDTC Registers" -group.WDTC.register.0=AT91C_WDTC_WDCR -group.WDTC.register.1=AT91C_WDTC_WDSR -group.WDTC.register.2=AT91C_WDTC_WDMR -# ========== Group definition for VREG peripheral ========== -group.VREG.description="ATMEL VREG Registers" -group.VREG.helpkey="ATMEL VREG Registers" -group.VREG.register.0=AT91C_VREG_MR -# ========== Group definition for MC peripheral ========== -group.MC.description="ATMEL MC Registers" -group.MC.helpkey="ATMEL MC Registers" -group.MC.register.0=AT91C_MC_ASR -group.MC.register.1=AT91C_MC_RCR -group.MC.register.2=AT91C_MC_FCR -group.MC.register.3=AT91C_MC_AASR -group.MC.register.4=AT91C_MC_FSR -group.MC.register.5=AT91C_MC_FMR -# ========== Group definition for PDC_SPI1 peripheral ========== -group.PDC_SPI1.description="ATMEL PDC_SPI1 Registers" -group.PDC_SPI1.helpkey="ATMEL PDC_SPI1 Registers" -group.PDC_SPI1.register.0=AT91C_SPI1_PTCR -group.PDC_SPI1.register.1=AT91C_SPI1_RPR -group.PDC_SPI1.register.2=AT91C_SPI1_TNCR -group.PDC_SPI1.register.3=AT91C_SPI1_TPR -group.PDC_SPI1.register.4=AT91C_SPI1_TNPR -group.PDC_SPI1.register.5=AT91C_SPI1_TCR -group.PDC_SPI1.register.6=AT91C_SPI1_RCR -group.PDC_SPI1.register.7=AT91C_SPI1_RNPR -group.PDC_SPI1.register.8=AT91C_SPI1_RNCR -group.PDC_SPI1.register.9=AT91C_SPI1_PTSR -# ========== Group definition for SPI1 peripheral ========== -group.SPI1.description="ATMEL SPI1 Registers" -group.SPI1.helpkey="ATMEL SPI1 Registers" -group.SPI1.register.0=AT91C_SPI1_IMR -group.SPI1.register.1=AT91C_SPI1_IER -group.SPI1.register.2=AT91C_SPI1_MR -group.SPI1.register.3=AT91C_SPI1_RDR -group.SPI1.register.4=AT91C_SPI1_IDR -group.SPI1.register.5=AT91C_SPI1_SR -group.SPI1.register.6=AT91C_SPI1_TDR -group.SPI1.register.7=AT91C_SPI1_CR -group.SPI1.register.8=AT91C_SPI1_CSR -# ========== Group definition for PDC_SPI0 peripheral ========== -group.PDC_SPI0.description="ATMEL PDC_SPI0 Registers" -group.PDC_SPI0.helpkey="ATMEL PDC_SPI0 Registers" -group.PDC_SPI0.register.0=AT91C_SPI0_PTCR -group.PDC_SPI0.register.1=AT91C_SPI0_TPR -group.PDC_SPI0.register.2=AT91C_SPI0_TCR -group.PDC_SPI0.register.3=AT91C_SPI0_RCR -group.PDC_SPI0.register.4=AT91C_SPI0_PTSR -group.PDC_SPI0.register.5=AT91C_SPI0_RNPR -group.PDC_SPI0.register.6=AT91C_SPI0_RPR -group.PDC_SPI0.register.7=AT91C_SPI0_TNCR -group.PDC_SPI0.register.8=AT91C_SPI0_RNCR -group.PDC_SPI0.register.9=AT91C_SPI0_TNPR -# ========== Group definition for SPI0 peripheral ========== -group.SPI0.description="ATMEL SPI0 Registers" -group.SPI0.helpkey="ATMEL SPI0 Registers" -group.SPI0.register.0=AT91C_SPI0_IER -group.SPI0.register.1=AT91C_SPI0_SR -group.SPI0.register.2=AT91C_SPI0_IDR -group.SPI0.register.3=AT91C_SPI0_CR -group.SPI0.register.4=AT91C_SPI0_MR -group.SPI0.register.5=AT91C_SPI0_IMR -group.SPI0.register.6=AT91C_SPI0_TDR -group.SPI0.register.7=AT91C_SPI0_RDR -group.SPI0.register.8=AT91C_SPI0_CSR -# ========== Group definition for PDC_US1 peripheral ========== -group.PDC_US1.description="ATMEL PDC_US1 Registers" -group.PDC_US1.helpkey="ATMEL PDC_US1 Registers" -group.PDC_US1.register.0=AT91C_US1_RNCR -group.PDC_US1.register.1=AT91C_US1_PTCR -group.PDC_US1.register.2=AT91C_US1_TCR -group.PDC_US1.register.3=AT91C_US1_PTSR -group.PDC_US1.register.4=AT91C_US1_TNPR -group.PDC_US1.register.5=AT91C_US1_RCR -group.PDC_US1.register.6=AT91C_US1_RNPR -group.PDC_US1.register.7=AT91C_US1_RPR -group.PDC_US1.register.8=AT91C_US1_TNCR -group.PDC_US1.register.9=AT91C_US1_TPR -# ========== Group definition for US1 peripheral ========== -group.US1.description="ATMEL US1 Registers" -group.US1.helpkey="ATMEL US1 Registers" -group.US1.register.0=AT91C_US1_IF -group.US1.register.1=AT91C_US1_NER -group.US1.register.2=AT91C_US1_RTOR -group.US1.register.3=AT91C_US1_CSR -group.US1.register.4=AT91C_US1_IDR -group.US1.register.5=AT91C_US1_IER -group.US1.register.6=AT91C_US1_THR -group.US1.register.7=AT91C_US1_TTGR -group.US1.register.8=AT91C_US1_RHR -group.US1.register.9=AT91C_US1_BRGR -group.US1.register.10=AT91C_US1_IMR -group.US1.register.11=AT91C_US1_FIDI -group.US1.register.12=AT91C_US1_CR -group.US1.register.13=AT91C_US1_MR -# ========== Group definition for PDC_US0 peripheral ========== -group.PDC_US0.description="ATMEL PDC_US0 Registers" -group.PDC_US0.helpkey="ATMEL PDC_US0 Registers" -group.PDC_US0.register.0=AT91C_US0_TNPR -group.PDC_US0.register.1=AT91C_US0_RNPR -group.PDC_US0.register.2=AT91C_US0_TCR -group.PDC_US0.register.3=AT91C_US0_PTCR -group.PDC_US0.register.4=AT91C_US0_PTSR -group.PDC_US0.register.5=AT91C_US0_TNCR -group.PDC_US0.register.6=AT91C_US0_TPR -group.PDC_US0.register.7=AT91C_US0_RCR -group.PDC_US0.register.8=AT91C_US0_RPR -group.PDC_US0.register.9=AT91C_US0_RNCR -# ========== Group definition for US0 peripheral ========== -group.US0.description="ATMEL US0 Registers" -group.US0.helpkey="ATMEL US0 Registers" -group.US0.register.0=AT91C_US0_BRGR -group.US0.register.1=AT91C_US0_NER -group.US0.register.2=AT91C_US0_CR -group.US0.register.3=AT91C_US0_IMR -group.US0.register.4=AT91C_US0_FIDI -group.US0.register.5=AT91C_US0_TTGR -group.US0.register.6=AT91C_US0_MR -group.US0.register.7=AT91C_US0_RTOR -group.US0.register.8=AT91C_US0_CSR -group.US0.register.9=AT91C_US0_RHR -group.US0.register.10=AT91C_US0_IDR -group.US0.register.11=AT91C_US0_THR -group.US0.register.12=AT91C_US0_IF -group.US0.register.13=AT91C_US0_IER -# ========== Group definition for PDC_SSC peripheral ========== -group.PDC_SSC.description="ATMEL PDC_SSC Registers" -group.PDC_SSC.helpkey="ATMEL PDC_SSC Registers" -group.PDC_SSC.register.0=AT91C_SSC_TNCR -group.PDC_SSC.register.1=AT91C_SSC_RPR -group.PDC_SSC.register.2=AT91C_SSC_RNCR -group.PDC_SSC.register.3=AT91C_SSC_TPR -group.PDC_SSC.register.4=AT91C_SSC_PTCR -group.PDC_SSC.register.5=AT91C_SSC_TCR -group.PDC_SSC.register.6=AT91C_SSC_RCR -group.PDC_SSC.register.7=AT91C_SSC_RNPR -group.PDC_SSC.register.8=AT91C_SSC_TNPR -group.PDC_SSC.register.9=AT91C_SSC_PTSR -# ========== Group definition for SSC peripheral ========== -group.SSC.description="ATMEL SSC Registers" -group.SSC.helpkey="ATMEL SSC Registers" -group.SSC.register.0=AT91C_SSC_RHR -group.SSC.register.1=AT91C_SSC_RSHR -group.SSC.register.2=AT91C_SSC_TFMR -group.SSC.register.3=AT91C_SSC_IDR -group.SSC.register.4=AT91C_SSC_THR -group.SSC.register.5=AT91C_SSC_RCMR -group.SSC.register.6=AT91C_SSC_IER -group.SSC.register.7=AT91C_SSC_TSHR -group.SSC.register.8=AT91C_SSC_SR -group.SSC.register.9=AT91C_SSC_CMR -group.SSC.register.10=AT91C_SSC_TCMR -group.SSC.register.11=AT91C_SSC_CR -group.SSC.register.12=AT91C_SSC_IMR -group.SSC.register.13=AT91C_SSC_RFMR -# ========== Group definition for TWI peripheral ========== -group.TWI.description="ATMEL TWI Registers" -group.TWI.helpkey="ATMEL TWI Registers" -group.TWI.register.0=AT91C_TWI_IER -group.TWI.register.1=AT91C_TWI_CR -group.TWI.register.2=AT91C_TWI_SR -group.TWI.register.3=AT91C_TWI_IMR -group.TWI.register.4=AT91C_TWI_THR -group.TWI.register.5=AT91C_TWI_IDR -group.TWI.register.6=AT91C_TWI_IADR -group.TWI.register.7=AT91C_TWI_MMR -group.TWI.register.8=AT91C_TWI_CWGR -group.TWI.register.9=AT91C_TWI_RHR -# ========== Group definition for PWMC_CH3 peripheral ========== -group.PWMC_CH3.description="ATMEL PWMC_CH3 Registers" -group.PWMC_CH3.helpkey="ATMEL PWMC_CH3 Registers" -group.PWMC_CH3.register.0=AT91C_PWMC_CH3_CUPDR -group.PWMC_CH3.register.1=AT91C_PWMC_CH3_Reserved -group.PWMC_CH3.register.2=AT91C_PWMC_CH3_CPRDR -group.PWMC_CH3.register.3=AT91C_PWMC_CH3_CDTYR -group.PWMC_CH3.register.4=AT91C_PWMC_CH3_CCNTR -group.PWMC_CH3.register.5=AT91C_PWMC_CH3_CMR -# ========== Group definition for PWMC_CH2 peripheral ========== -group.PWMC_CH2.description="ATMEL PWMC_CH2 Registers" -group.PWMC_CH2.helpkey="ATMEL PWMC_CH2 Registers" -group.PWMC_CH2.register.0=AT91C_PWMC_CH2_Reserved -group.PWMC_CH2.register.1=AT91C_PWMC_CH2_CMR -group.PWMC_CH2.register.2=AT91C_PWMC_CH2_CCNTR -group.PWMC_CH2.register.3=AT91C_PWMC_CH2_CPRDR -group.PWMC_CH2.register.4=AT91C_PWMC_CH2_CUPDR -group.PWMC_CH2.register.5=AT91C_PWMC_CH2_CDTYR -# ========== Group definition for PWMC_CH1 peripheral ========== -group.PWMC_CH1.description="ATMEL PWMC_CH1 Registers" -group.PWMC_CH1.helpkey="ATMEL PWMC_CH1 Registers" -group.PWMC_CH1.register.0=AT91C_PWMC_CH1_Reserved -group.PWMC_CH1.register.1=AT91C_PWMC_CH1_CUPDR -group.PWMC_CH1.register.2=AT91C_PWMC_CH1_CPRDR -group.PWMC_CH1.register.3=AT91C_PWMC_CH1_CCNTR -group.PWMC_CH1.register.4=AT91C_PWMC_CH1_CDTYR -group.PWMC_CH1.register.5=AT91C_PWMC_CH1_CMR -# ========== Group definition for PWMC_CH0 peripheral ========== -group.PWMC_CH0.description="ATMEL PWMC_CH0 Registers" -group.PWMC_CH0.helpkey="ATMEL PWMC_CH0 Registers" -group.PWMC_CH0.register.0=AT91C_PWMC_CH0_Reserved -group.PWMC_CH0.register.1=AT91C_PWMC_CH0_CPRDR -group.PWMC_CH0.register.2=AT91C_PWMC_CH0_CDTYR -group.PWMC_CH0.register.3=AT91C_PWMC_CH0_CMR -group.PWMC_CH0.register.4=AT91C_PWMC_CH0_CUPDR -group.PWMC_CH0.register.5=AT91C_PWMC_CH0_CCNTR -# ========== Group definition for PWMC peripheral ========== -group.PWMC.description="ATMEL PWMC Registers" -group.PWMC.helpkey="ATMEL PWMC Registers" -group.PWMC.register.0=AT91C_PWMC_IDR -group.PWMC.register.1=AT91C_PWMC_DIS -group.PWMC.register.2=AT91C_PWMC_IER -group.PWMC.register.3=AT91C_PWMC_VR -group.PWMC.register.4=AT91C_PWMC_ISR -group.PWMC.register.5=AT91C_PWMC_SR -group.PWMC.register.6=AT91C_PWMC_IMR -group.PWMC.register.7=AT91C_PWMC_MR -group.PWMC.register.8=AT91C_PWMC_ENA -# ========== Group definition for UDP peripheral ========== -group.UDP.description="ATMEL UDP Registers" -group.UDP.helpkey="ATMEL UDP Registers" -group.UDP.register.0=AT91C_UDP_IMR -group.UDP.register.1=AT91C_UDP_FADDR -group.UDP.register.2=AT91C_UDP_NUM -group.UDP.register.3=AT91C_UDP_FDR -group.UDP.register.4=AT91C_UDP_ISR -group.UDP.register.5=AT91C_UDP_CSR -group.UDP.register.6=AT91C_UDP_IDR -group.UDP.register.7=AT91C_UDP_ICR -group.UDP.register.8=AT91C_UDP_RSTEP -group.UDP.register.9=AT91C_UDP_TXVC -group.UDP.register.10=AT91C_UDP_GLBSTATE -group.UDP.register.11=AT91C_UDP_IER -# ========== Group definition for TC0 peripheral ========== -group.TC0.description="ATMEL TC0 Registers" -group.TC0.helpkey="ATMEL TC0 Registers" -group.TC0.register.0=AT91C_TC0_SR -group.TC0.register.1=AT91C_TC0_RC -group.TC0.register.2=AT91C_TC0_RB -group.TC0.register.3=AT91C_TC0_CCR -group.TC0.register.4=AT91C_TC0_CMR -group.TC0.register.5=AT91C_TC0_IER -group.TC0.register.6=AT91C_TC0_RA -group.TC0.register.7=AT91C_TC0_IDR -group.TC0.register.8=AT91C_TC0_CV -group.TC0.register.9=AT91C_TC0_IMR -# ========== Group definition for TC1 peripheral ========== -group.TC1.description="ATMEL TC1 Registers" -group.TC1.helpkey="ATMEL TC1 Registers" -group.TC1.register.0=AT91C_TC1_RB -group.TC1.register.1=AT91C_TC1_CCR -group.TC1.register.2=AT91C_TC1_IER -group.TC1.register.3=AT91C_TC1_IDR -group.TC1.register.4=AT91C_TC1_SR -group.TC1.register.5=AT91C_TC1_CMR -group.TC1.register.6=AT91C_TC1_RA -group.TC1.register.7=AT91C_TC1_RC -group.TC1.register.8=AT91C_TC1_IMR -group.TC1.register.9=AT91C_TC1_CV -# ========== Group definition for TC2 peripheral ========== -group.TC2.description="ATMEL TC2 Registers" -group.TC2.helpkey="ATMEL TC2 Registers" -group.TC2.register.0=AT91C_TC2_CMR -group.TC2.register.1=AT91C_TC2_CCR -group.TC2.register.2=AT91C_TC2_CV -group.TC2.register.3=AT91C_TC2_RA -group.TC2.register.4=AT91C_TC2_RB -group.TC2.register.5=AT91C_TC2_IDR -group.TC2.register.6=AT91C_TC2_IMR -group.TC2.register.7=AT91C_TC2_RC -group.TC2.register.8=AT91C_TC2_IER -group.TC2.register.9=AT91C_TC2_SR -# ========== Group definition for TCB peripheral ========== -group.TCB.description="ATMEL TCB Registers" -group.TCB.helpkey="ATMEL TCB Registers" -group.TCB.register.0=AT91C_TCB_BMR -group.TCB.register.1=AT91C_TCB_BCR -# ========== Group definition for CAN_MB0 peripheral ========== -group.CAN_MB0.description="ATMEL CAN_MB0 Registers" -group.CAN_MB0.helpkey="ATMEL CAN_MB0 Registers" -group.CAN_MB0.register.0=AT91C_CAN_MB0_MDL -group.CAN_MB0.register.1=AT91C_CAN_MB0_MAM -group.CAN_MB0.register.2=AT91C_CAN_MB0_MCR -group.CAN_MB0.register.3=AT91C_CAN_MB0_MID -group.CAN_MB0.register.4=AT91C_CAN_MB0_MSR -group.CAN_MB0.register.5=AT91C_CAN_MB0_MFID -group.CAN_MB0.register.6=AT91C_CAN_MB0_MDH -group.CAN_MB0.register.7=AT91C_CAN_MB0_MMR -# ========== Group definition for CAN_MB1 peripheral ========== -group.CAN_MB1.description="ATMEL CAN_MB1 Registers" -group.CAN_MB1.helpkey="ATMEL CAN_MB1 Registers" -group.CAN_MB1.register.0=AT91C_CAN_MB1_MDL -group.CAN_MB1.register.1=AT91C_CAN_MB1_MID -group.CAN_MB1.register.2=AT91C_CAN_MB1_MMR -group.CAN_MB1.register.3=AT91C_CAN_MB1_MSR -group.CAN_MB1.register.4=AT91C_CAN_MB1_MAM -group.CAN_MB1.register.5=AT91C_CAN_MB1_MDH -group.CAN_MB1.register.6=AT91C_CAN_MB1_MCR -group.CAN_MB1.register.7=AT91C_CAN_MB1_MFID -# ========== Group definition for CAN_MB2 peripheral ========== -group.CAN_MB2.description="ATMEL CAN_MB2 Registers" -group.CAN_MB2.helpkey="ATMEL CAN_MB2 Registers" -group.CAN_MB2.register.0=AT91C_CAN_MB2_MCR -group.CAN_MB2.register.1=AT91C_CAN_MB2_MDH -group.CAN_MB2.register.2=AT91C_CAN_MB2_MID -group.CAN_MB2.register.3=AT91C_CAN_MB2_MDL -group.CAN_MB2.register.4=AT91C_CAN_MB2_MMR -group.CAN_MB2.register.5=AT91C_CAN_MB2_MAM -group.CAN_MB2.register.6=AT91C_CAN_MB2_MFID -group.CAN_MB2.register.7=AT91C_CAN_MB2_MSR -# ========== Group definition for CAN_MB3 peripheral ========== -group.CAN_MB3.description="ATMEL CAN_MB3 Registers" -group.CAN_MB3.helpkey="ATMEL CAN_MB3 Registers" -group.CAN_MB3.register.0=AT91C_CAN_MB3_MFID -group.CAN_MB3.register.1=AT91C_CAN_MB3_MAM -group.CAN_MB3.register.2=AT91C_CAN_MB3_MID -group.CAN_MB3.register.3=AT91C_CAN_MB3_MCR -group.CAN_MB3.register.4=AT91C_CAN_MB3_MMR -group.CAN_MB3.register.5=AT91C_CAN_MB3_MSR -group.CAN_MB3.register.6=AT91C_CAN_MB3_MDL -group.CAN_MB3.register.7=AT91C_CAN_MB3_MDH -# ========== Group definition for CAN_MB4 peripheral ========== -group.CAN_MB4.description="ATMEL CAN_MB4 Registers" -group.CAN_MB4.helpkey="ATMEL CAN_MB4 Registers" -group.CAN_MB4.register.0=AT91C_CAN_MB4_MID -group.CAN_MB4.register.1=AT91C_CAN_MB4_MMR -group.CAN_MB4.register.2=AT91C_CAN_MB4_MDH -group.CAN_MB4.register.3=AT91C_CAN_MB4_MFID -group.CAN_MB4.register.4=AT91C_CAN_MB4_MSR -group.CAN_MB4.register.5=AT91C_CAN_MB4_MCR -group.CAN_MB4.register.6=AT91C_CAN_MB4_MDL -group.CAN_MB4.register.7=AT91C_CAN_MB4_MAM -# ========== Group definition for CAN_MB5 peripheral ========== -group.CAN_MB5.description="ATMEL CAN_MB5 Registers" -group.CAN_MB5.helpkey="ATMEL CAN_MB5 Registers" -group.CAN_MB5.register.0=AT91C_CAN_MB5_MSR -group.CAN_MB5.register.1=AT91C_CAN_MB5_MCR -group.CAN_MB5.register.2=AT91C_CAN_MB5_MFID -group.CAN_MB5.register.3=AT91C_CAN_MB5_MDH -group.CAN_MB5.register.4=AT91C_CAN_MB5_MID -group.CAN_MB5.register.5=AT91C_CAN_MB5_MMR -group.CAN_MB5.register.6=AT91C_CAN_MB5_MDL -group.CAN_MB5.register.7=AT91C_CAN_MB5_MAM -# ========== Group definition for CAN_MB6 peripheral ========== -group.CAN_MB6.description="ATMEL CAN_MB6 Registers" -group.CAN_MB6.helpkey="ATMEL CAN_MB6 Registers" -group.CAN_MB6.register.0=AT91C_CAN_MB6_MFID -group.CAN_MB6.register.1=AT91C_CAN_MB6_MID -group.CAN_MB6.register.2=AT91C_CAN_MB6_MAM -group.CAN_MB6.register.3=AT91C_CAN_MB6_MSR -group.CAN_MB6.register.4=AT91C_CAN_MB6_MDL -group.CAN_MB6.register.5=AT91C_CAN_MB6_MCR -group.CAN_MB6.register.6=AT91C_CAN_MB6_MDH -group.CAN_MB6.register.7=AT91C_CAN_MB6_MMR -# ========== Group definition for CAN_MB7 peripheral ========== -group.CAN_MB7.description="ATMEL CAN_MB7 Registers" -group.CAN_MB7.helpkey="ATMEL CAN_MB7 Registers" -group.CAN_MB7.register.0=AT91C_CAN_MB7_MCR -group.CAN_MB7.register.1=AT91C_CAN_MB7_MDH -group.CAN_MB7.register.2=AT91C_CAN_MB7_MFID -group.CAN_MB7.register.3=AT91C_CAN_MB7_MDL -group.CAN_MB7.register.4=AT91C_CAN_MB7_MID -group.CAN_MB7.register.5=AT91C_CAN_MB7_MMR -group.CAN_MB7.register.6=AT91C_CAN_MB7_MAM -group.CAN_MB7.register.7=AT91C_CAN_MB7_MSR -# ========== Group definition for CAN peripheral ========== -group.CAN.description="ATMEL CAN Registers" -group.CAN.helpkey="ATMEL CAN Registers" -group.CAN.register.0=AT91C_CAN_TCR -group.CAN.register.1=AT91C_CAN_IMR -group.CAN.register.2=AT91C_CAN_IER -group.CAN.register.3=AT91C_CAN_ECR -group.CAN.register.4=AT91C_CAN_TIMESTP -group.CAN.register.5=AT91C_CAN_MR -group.CAN.register.6=AT91C_CAN_IDR -group.CAN.register.7=AT91C_CAN_ACR -group.CAN.register.8=AT91C_CAN_TIM -group.CAN.register.9=AT91C_CAN_SR -group.CAN.register.10=AT91C_CAN_BR -group.CAN.register.11=AT91C_CAN_VR -# ========== Group definition for EMAC peripheral ========== -group.EMAC.description="ATMEL EMAC Registers" -group.EMAC.helpkey="ATMEL EMAC Registers" -group.EMAC.register.0=AT91C_EMAC_ISR -group.EMAC.register.1=AT91C_EMAC_SA4H -group.EMAC.register.2=AT91C_EMAC_SA1L -group.EMAC.register.3=AT91C_EMAC_ELE -group.EMAC.register.4=AT91C_EMAC_LCOL -group.EMAC.register.5=AT91C_EMAC_RLE -group.EMAC.register.6=AT91C_EMAC_WOL -group.EMAC.register.7=AT91C_EMAC_DTF -group.EMAC.register.8=AT91C_EMAC_TUND -group.EMAC.register.9=AT91C_EMAC_NCR -group.EMAC.register.10=AT91C_EMAC_SA4L -group.EMAC.register.11=AT91C_EMAC_RSR -group.EMAC.register.12=AT91C_EMAC_SA3L -group.EMAC.register.13=AT91C_EMAC_TSR -group.EMAC.register.14=AT91C_EMAC_IDR -group.EMAC.register.15=AT91C_EMAC_RSE -group.EMAC.register.16=AT91C_EMAC_ECOL -group.EMAC.register.17=AT91C_EMAC_TID -group.EMAC.register.18=AT91C_EMAC_HRB -group.EMAC.register.19=AT91C_EMAC_TBQP -group.EMAC.register.20=AT91C_EMAC_USRIO -group.EMAC.register.21=AT91C_EMAC_PTR -group.EMAC.register.22=AT91C_EMAC_SA2H -group.EMAC.register.23=AT91C_EMAC_ROV -group.EMAC.register.24=AT91C_EMAC_ALE -group.EMAC.register.25=AT91C_EMAC_RJA -group.EMAC.register.26=AT91C_EMAC_RBQP -group.EMAC.register.27=AT91C_EMAC_TPF -group.EMAC.register.28=AT91C_EMAC_NCFGR -group.EMAC.register.29=AT91C_EMAC_HRT -group.EMAC.register.30=AT91C_EMAC_USF -group.EMAC.register.31=AT91C_EMAC_FCSE -group.EMAC.register.32=AT91C_EMAC_TPQ -group.EMAC.register.33=AT91C_EMAC_MAN -group.EMAC.register.34=AT91C_EMAC_FTO -group.EMAC.register.35=AT91C_EMAC_REV -group.EMAC.register.36=AT91C_EMAC_IMR -group.EMAC.register.37=AT91C_EMAC_SCF -group.EMAC.register.38=AT91C_EMAC_PFR -group.EMAC.register.39=AT91C_EMAC_MCF -group.EMAC.register.40=AT91C_EMAC_NSR -group.EMAC.register.41=AT91C_EMAC_SA2L -group.EMAC.register.42=AT91C_EMAC_FRO -group.EMAC.register.43=AT91C_EMAC_IER -group.EMAC.register.44=AT91C_EMAC_SA1H -group.EMAC.register.45=AT91C_EMAC_CSE -group.EMAC.register.46=AT91C_EMAC_SA3H -group.EMAC.register.47=AT91C_EMAC_RRE -group.EMAC.register.48=AT91C_EMAC_STE -# ========== Group definition for PDC_ADC peripheral ========== -group.PDC_ADC.description="ATMEL PDC_ADC Registers" -group.PDC_ADC.helpkey="ATMEL PDC_ADC Registers" -group.PDC_ADC.register.0=AT91C_ADC_PTSR -group.PDC_ADC.register.1=AT91C_ADC_PTCR -group.PDC_ADC.register.2=AT91C_ADC_TNPR -group.PDC_ADC.register.3=AT91C_ADC_TNCR -group.PDC_ADC.register.4=AT91C_ADC_RNPR -group.PDC_ADC.register.5=AT91C_ADC_RNCR -group.PDC_ADC.register.6=AT91C_ADC_RPR -group.PDC_ADC.register.7=AT91C_ADC_TCR -group.PDC_ADC.register.8=AT91C_ADC_TPR -group.PDC_ADC.register.9=AT91C_ADC_RCR -# ========== Group definition for ADC peripheral ========== -group.ADC.description="ATMEL ADC Registers" -group.ADC.helpkey="ATMEL ADC Registers" -group.ADC.register.0=AT91C_ADC_CDR2 -group.ADC.register.1=AT91C_ADC_CDR3 -group.ADC.register.2=AT91C_ADC_CDR0 -group.ADC.register.3=AT91C_ADC_CDR5 -group.ADC.register.4=AT91C_ADC_CHDR -group.ADC.register.5=AT91C_ADC_SR -group.ADC.register.6=AT91C_ADC_CDR4 -group.ADC.register.7=AT91C_ADC_CDR1 -group.ADC.register.8=AT91C_ADC_LCDR -group.ADC.register.9=AT91C_ADC_IDR -group.ADC.register.10=AT91C_ADC_CR -group.ADC.register.11=AT91C_ADC_CDR7 -group.ADC.register.12=AT91C_ADC_CDR6 -group.ADC.register.13=AT91C_ADC_IER -group.ADC.register.14=AT91C_ADC_CHER -group.ADC.register.15=AT91C_ADC_CHSR -group.ADC.register.16=AT91C_ADC_MR -group.ADC.register.17=AT91C_ADC_IMR -group.AT91SAM7X256.description="ATMEL AT91SAM7X256 Registers" -group.AT91SAM7X256.helpkey="ATMEL AT91SAM7X256 Registers" -group.AT91SAM7X256.topLevelIndex=100 -group.AT91SAM7X256.group.0=SYS -group.AT91SAM7X256.group.1=AIC -group.AT91SAM7X256.group.2=PDC_DBGU -group.AT91SAM7X256.group.3=DBGU -group.AT91SAM7X256.group.4=PIOA -group.AT91SAM7X256.group.5=PIOB -group.AT91SAM7X256.group.6=CKGR -group.AT91SAM7X256.group.7=PMC -group.AT91SAM7X256.group.8=RSTC -group.AT91SAM7X256.group.9=RTTC -group.AT91SAM7X256.group.10=PITC -group.AT91SAM7X256.group.11=WDTC -group.AT91SAM7X256.group.12=VREG -group.AT91SAM7X256.group.13=MC -group.AT91SAM7X256.group.14=PDC_SPI1 -group.AT91SAM7X256.group.15=SPI1 -group.AT91SAM7X256.group.16=PDC_SPI0 -group.AT91SAM7X256.group.17=SPI0 -group.AT91SAM7X256.group.18=PDC_US1 -group.AT91SAM7X256.group.19=US1 -group.AT91SAM7X256.group.20=PDC_US0 -group.AT91SAM7X256.group.21=US0 -group.AT91SAM7X256.group.22=PDC_SSC -group.AT91SAM7X256.group.23=SSC -group.AT91SAM7X256.group.24=TWI -group.AT91SAM7X256.group.25=PWMC_CH3 -group.AT91SAM7X256.group.26=PWMC_CH2 -group.AT91SAM7X256.group.27=PWMC_CH1 -group.AT91SAM7X256.group.28=PWMC_CH0 -group.AT91SAM7X256.group.29=PWMC -group.AT91SAM7X256.group.30=UDP -group.AT91SAM7X256.group.31=TC0 -group.AT91SAM7X256.group.32=TC1 -group.AT91SAM7X256.group.33=TC2 -group.AT91SAM7X256.group.34=TCB -group.AT91SAM7X256.group.35=CAN_MB0 -group.AT91SAM7X256.group.36=CAN_MB1 -group.AT91SAM7X256.group.37=CAN_MB2 -group.AT91SAM7X256.group.38=CAN_MB3 -group.AT91SAM7X256.group.39=CAN_MB4 -group.AT91SAM7X256.group.40=CAN_MB5 -group.AT91SAM7X256.group.41=CAN_MB6 -group.AT91SAM7X256.group.42=CAN_MB7 -group.AT91SAM7X256.group.43=CAN -group.AT91SAM7X256.group.44=EMAC -group.AT91SAM7X256.group.45=PDC_ADC -group.AT91SAM7X256.group.46=ADC diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.tcl b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.tcl deleted file mode 100644 index 5d3a66223..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.tcl +++ /dev/null @@ -1,3407 +0,0 @@ -# ---------------------------------------------------------------------------- -# ATMEL Microcontroller Software Support - ROUSSET - -# ---------------------------------------------------------------------------- -# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -# DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.tcl -# Object : AT91SAM7X256 definitions -# Generated : AT91 SW Application Group 11/02/2005 (15:17:30) -# -# CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// -# CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// -# CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// -# CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// -# CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// -# CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// -# CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// -# CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// -# CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// -# CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// -# CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// -# CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// -# CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// -# CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// -# CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// -# CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// -# CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// -# CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// -# CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// -# CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// -# CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// -# CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// -# CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// -# ---------------------------------------------------------------------------- - - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR System Peripherals -# ***************************************************************************** - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Advanced Interrupt Controller -# ***************************************************************************** -# -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- -set AT91C_AIC_PRIOR [expr 0x7 << 0 ] -set AT91C_AIC_PRIOR_LOWEST 0x0 -set AT91C_AIC_PRIOR_HIGHEST 0x7 -set AT91C_AIC_SRCTYPE [expr 0x3 << 5 ] -set AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL [expr 0x0 << 5 ] -set AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL [expr 0x0 << 5 ] -set AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE [expr 0x1 << 5 ] -set AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE [expr 0x1 << 5 ] -set AT91C_AIC_SRCTYPE_HIGH_LEVEL [expr 0x2 << 5 ] -set AT91C_AIC_SRCTYPE_POSITIVE_EDGE [expr 0x3 << 5 ] -# -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- -set AT91C_AIC_NFIQ [expr 0x1 << 0 ] -set AT91C_AIC_NIRQ [expr 0x1 << 1 ] -# -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- -set AT91C_AIC_DCR_PROT [expr 0x1 << 0 ] -set AT91C_AIC_DCR_GMSK [expr 0x1 << 1 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Peripheral DMA Controller -# ***************************************************************************** -# -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- -set AT91C_PDC_RXTEN [expr 0x1 << 0 ] -set AT91C_PDC_RXTDIS [expr 0x1 << 1 ] -set AT91C_PDC_TXTEN [expr 0x1 << 8 ] -set AT91C_PDC_TXTDIS [expr 0x1 << 9 ] -# -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- -set AT91C_PDC_RXTEN [expr 0x1 << 0 ] -set AT91C_PDC_TXTEN [expr 0x1 << 8 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Debug Unit -# ***************************************************************************** -# -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- -set AT91C_US_RSTRX [expr 0x1 << 2 ] -set AT91C_US_RSTTX [expr 0x1 << 3 ] -set AT91C_US_RXEN [expr 0x1 << 4 ] -set AT91C_US_RXDIS [expr 0x1 << 5 ] -set AT91C_US_TXEN [expr 0x1 << 6 ] -set AT91C_US_TXDIS [expr 0x1 << 7 ] -set AT91C_US_RSTSTA [expr 0x1 << 8 ] -# -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- -set AT91C_US_PAR [expr 0x7 << 9 ] -set AT91C_US_PAR_EVEN [expr 0x0 << 9 ] -set AT91C_US_PAR_ODD [expr 0x1 << 9 ] -set AT91C_US_PAR_SPACE [expr 0x2 << 9 ] -set AT91C_US_PAR_MARK [expr 0x3 << 9 ] -set AT91C_US_PAR_NONE [expr 0x4 << 9 ] -set AT91C_US_PAR_MULTI_DROP [expr 0x6 << 9 ] -set AT91C_US_CHMODE [expr 0x3 << 14 ] -set AT91C_US_CHMODE_NORMAL [expr 0x0 << 14 ] -set AT91C_US_CHMODE_AUTO [expr 0x1 << 14 ] -set AT91C_US_CHMODE_LOCAL [expr 0x2 << 14 ] -set AT91C_US_CHMODE_REMOTE [expr 0x3 << 14 ] -# -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- -set AT91C_US_RXRDY [expr 0x1 << 0 ] -set AT91C_US_TXRDY [expr 0x1 << 1 ] -set AT91C_US_ENDRX [expr 0x1 << 3 ] -set AT91C_US_ENDTX [expr 0x1 << 4 ] -set AT91C_US_OVRE [expr 0x1 << 5 ] -set AT91C_US_FRAME [expr 0x1 << 6 ] -set AT91C_US_PARE [expr 0x1 << 7 ] -set AT91C_US_TXEMPTY [expr 0x1 << 9 ] -set AT91C_US_TXBUFE [expr 0x1 << 11 ] -set AT91C_US_RXBUFF [expr 0x1 << 12 ] -set AT91C_US_COMM_TX [expr 0x1 << 30 ] -set AT91C_US_COMM_RX [expr 0x1 << 31 ] -# -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- -set AT91C_US_RXRDY [expr 0x1 << 0 ] -set AT91C_US_TXRDY [expr 0x1 << 1 ] -set AT91C_US_ENDRX [expr 0x1 << 3 ] -set AT91C_US_ENDTX [expr 0x1 << 4 ] -set AT91C_US_OVRE [expr 0x1 << 5 ] -set AT91C_US_FRAME [expr 0x1 << 6 ] -set AT91C_US_PARE [expr 0x1 << 7 ] -set AT91C_US_TXEMPTY [expr 0x1 << 9 ] -set AT91C_US_TXBUFE [expr 0x1 << 11 ] -set AT91C_US_RXBUFF [expr 0x1 << 12 ] -set AT91C_US_COMM_TX [expr 0x1 << 30 ] -set AT91C_US_COMM_RX [expr 0x1 << 31 ] -# -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- -set AT91C_US_RXRDY [expr 0x1 << 0 ] -set AT91C_US_TXRDY [expr 0x1 << 1 ] -set AT91C_US_ENDRX [expr 0x1 << 3 ] -set AT91C_US_ENDTX [expr 0x1 << 4 ] -set AT91C_US_OVRE [expr 0x1 << 5 ] -set AT91C_US_FRAME [expr 0x1 << 6 ] -set AT91C_US_PARE [expr 0x1 << 7 ] -set AT91C_US_TXEMPTY [expr 0x1 << 9 ] -set AT91C_US_TXBUFE [expr 0x1 << 11 ] -set AT91C_US_RXBUFF [expr 0x1 << 12 ] -set AT91C_US_COMM_TX [expr 0x1 << 30 ] -set AT91C_US_COMM_RX [expr 0x1 << 31 ] -# -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- -set AT91C_US_RXRDY [expr 0x1 << 0 ] -set AT91C_US_TXRDY [expr 0x1 << 1 ] -set AT91C_US_ENDRX [expr 0x1 << 3 ] -set AT91C_US_ENDTX [expr 0x1 << 4 ] -set AT91C_US_OVRE [expr 0x1 << 5 ] -set AT91C_US_FRAME [expr 0x1 << 6 ] -set AT91C_US_PARE [expr 0x1 << 7 ] -set AT91C_US_TXEMPTY [expr 0x1 << 9 ] -set AT91C_US_TXBUFE [expr 0x1 << 11 ] -set AT91C_US_RXBUFF [expr 0x1 << 12 ] -set AT91C_US_COMM_TX [expr 0x1 << 30 ] -set AT91C_US_COMM_RX [expr 0x1 << 31 ] -# -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- -set AT91C_US_FORCE_NTRST [expr 0x1 << 0 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Parallel Input Output Controler -# ***************************************************************************** - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Clock Generator Controler -# ***************************************************************************** -# -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- -set AT91C_CKGR_MOSCEN [expr 0x1 << 0 ] -set AT91C_CKGR_OSCBYPASS [expr 0x1 << 1 ] -set AT91C_CKGR_OSCOUNT [expr 0xFF << 8 ] -# -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- -set AT91C_CKGR_MAINF [expr 0xFFFF << 0 ] -set AT91C_CKGR_MAINRDY [expr 0x1 << 16 ] -# -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- -set AT91C_CKGR_DIV [expr 0xFF << 0 ] -set AT91C_CKGR_DIV_0 0x0 -set AT91C_CKGR_DIV_BYPASS 0x1 -set AT91C_CKGR_PLLCOUNT [expr 0x3F << 8 ] -set AT91C_CKGR_OUT [expr 0x3 << 14 ] -set AT91C_CKGR_OUT_0 [expr 0x0 << 14 ] -set AT91C_CKGR_OUT_1 [expr 0x1 << 14 ] -set AT91C_CKGR_OUT_2 [expr 0x2 << 14 ] -set AT91C_CKGR_OUT_3 [expr 0x3 << 14 ] -set AT91C_CKGR_MUL [expr 0x7FF << 16 ] -set AT91C_CKGR_USBDIV [expr 0x3 << 28 ] -set AT91C_CKGR_USBDIV_0 [expr 0x0 << 28 ] -set AT91C_CKGR_USBDIV_1 [expr 0x1 << 28 ] -set AT91C_CKGR_USBDIV_2 [expr 0x2 << 28 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Power Management Controler -# ***************************************************************************** -# -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- -set AT91C_PMC_PCK [expr 0x1 << 0 ] -set AT91C_PMC_UDP [expr 0x1 << 7 ] -set AT91C_PMC_PCK0 [expr 0x1 << 8 ] -set AT91C_PMC_PCK1 [expr 0x1 << 9 ] -set AT91C_PMC_PCK2 [expr 0x1 << 10 ] -set AT91C_PMC_PCK3 [expr 0x1 << 11 ] -# -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- -set AT91C_PMC_PCK [expr 0x1 << 0 ] -set AT91C_PMC_UDP [expr 0x1 << 7 ] -set AT91C_PMC_PCK0 [expr 0x1 << 8 ] -set AT91C_PMC_PCK1 [expr 0x1 << 9 ] -set AT91C_PMC_PCK2 [expr 0x1 << 10 ] -set AT91C_PMC_PCK3 [expr 0x1 << 11 ] -# -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- -set AT91C_PMC_PCK [expr 0x1 << 0 ] -set AT91C_PMC_UDP [expr 0x1 << 7 ] -set AT91C_PMC_PCK0 [expr 0x1 << 8 ] -set AT91C_PMC_PCK1 [expr 0x1 << 9 ] -set AT91C_PMC_PCK2 [expr 0x1 << 10 ] -set AT91C_PMC_PCK3 [expr 0x1 << 11 ] -# -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- -set AT91C_CKGR_MOSCEN [expr 0x1 << 0 ] -set AT91C_CKGR_OSCBYPASS [expr 0x1 << 1 ] -set AT91C_CKGR_OSCOUNT [expr 0xFF << 8 ] -# -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- -set AT91C_CKGR_MAINF [expr 0xFFFF << 0 ] -set AT91C_CKGR_MAINRDY [expr 0x1 << 16 ] -# -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- -set AT91C_CKGR_DIV [expr 0xFF << 0 ] -set AT91C_CKGR_DIV_0 0x0 -set AT91C_CKGR_DIV_BYPASS 0x1 -set AT91C_CKGR_PLLCOUNT [expr 0x3F << 8 ] -set AT91C_CKGR_OUT [expr 0x3 << 14 ] -set AT91C_CKGR_OUT_0 [expr 0x0 << 14 ] -set AT91C_CKGR_OUT_1 [expr 0x1 << 14 ] -set AT91C_CKGR_OUT_2 [expr 0x2 << 14 ] -set AT91C_CKGR_OUT_3 [expr 0x3 << 14 ] -set AT91C_CKGR_MUL [expr 0x7FF << 16 ] -set AT91C_CKGR_USBDIV [expr 0x3 << 28 ] -set AT91C_CKGR_USBDIV_0 [expr 0x0 << 28 ] -set AT91C_CKGR_USBDIV_1 [expr 0x1 << 28 ] -set AT91C_CKGR_USBDIV_2 [expr 0x2 << 28 ] -# -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- -set AT91C_PMC_CSS [expr 0x3 << 0 ] -set AT91C_PMC_CSS_SLOW_CLK 0x0 -set AT91C_PMC_CSS_MAIN_CLK 0x1 -set AT91C_PMC_CSS_PLL_CLK 0x3 -set AT91C_PMC_PRES [expr 0x7 << 2 ] -set AT91C_PMC_PRES_CLK [expr 0x0 << 2 ] -set AT91C_PMC_PRES_CLK_2 [expr 0x1 << 2 ] -set AT91C_PMC_PRES_CLK_4 [expr 0x2 << 2 ] -set AT91C_PMC_PRES_CLK_8 [expr 0x3 << 2 ] -set AT91C_PMC_PRES_CLK_16 [expr 0x4 << 2 ] -set AT91C_PMC_PRES_CLK_32 [expr 0x5 << 2 ] -set AT91C_PMC_PRES_CLK_64 [expr 0x6 << 2 ] -# -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- -set AT91C_PMC_CSS [expr 0x3 << 0 ] -set AT91C_PMC_CSS_SLOW_CLK 0x0 -set AT91C_PMC_CSS_MAIN_CLK 0x1 -set AT91C_PMC_CSS_PLL_CLK 0x3 -set AT91C_PMC_PRES [expr 0x7 << 2 ] -set AT91C_PMC_PRES_CLK [expr 0x0 << 2 ] -set AT91C_PMC_PRES_CLK_2 [expr 0x1 << 2 ] -set AT91C_PMC_PRES_CLK_4 [expr 0x2 << 2 ] -set AT91C_PMC_PRES_CLK_8 [expr 0x3 << 2 ] -set AT91C_PMC_PRES_CLK_16 [expr 0x4 << 2 ] -set AT91C_PMC_PRES_CLK_32 [expr 0x5 << 2 ] -set AT91C_PMC_PRES_CLK_64 [expr 0x6 << 2 ] -# -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- -set AT91C_PMC_MOSCS [expr 0x1 << 0 ] -set AT91C_PMC_LOCK [expr 0x1 << 2 ] -set AT91C_PMC_MCKRDY [expr 0x1 << 3 ] -set AT91C_PMC_PCK0RDY [expr 0x1 << 8 ] -set AT91C_PMC_PCK1RDY [expr 0x1 << 9 ] -set AT91C_PMC_PCK2RDY [expr 0x1 << 10 ] -set AT91C_PMC_PCK3RDY [expr 0x1 << 11 ] -# -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- -set AT91C_PMC_MOSCS [expr 0x1 << 0 ] -set AT91C_PMC_LOCK [expr 0x1 << 2 ] -set AT91C_PMC_MCKRDY [expr 0x1 << 3 ] -set AT91C_PMC_PCK0RDY [expr 0x1 << 8 ] -set AT91C_PMC_PCK1RDY [expr 0x1 << 9 ] -set AT91C_PMC_PCK2RDY [expr 0x1 << 10 ] -set AT91C_PMC_PCK3RDY [expr 0x1 << 11 ] -# -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- -set AT91C_PMC_MOSCS [expr 0x1 << 0 ] -set AT91C_PMC_LOCK [expr 0x1 << 2 ] -set AT91C_PMC_MCKRDY [expr 0x1 << 3 ] -set AT91C_PMC_PCK0RDY [expr 0x1 << 8 ] -set AT91C_PMC_PCK1RDY [expr 0x1 << 9 ] -set AT91C_PMC_PCK2RDY [expr 0x1 << 10 ] -set AT91C_PMC_PCK3RDY [expr 0x1 << 11 ] -# -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- -set AT91C_PMC_MOSCS [expr 0x1 << 0 ] -set AT91C_PMC_LOCK [expr 0x1 << 2 ] -set AT91C_PMC_MCKRDY [expr 0x1 << 3 ] -set AT91C_PMC_PCK0RDY [expr 0x1 << 8 ] -set AT91C_PMC_PCK1RDY [expr 0x1 << 9 ] -set AT91C_PMC_PCK2RDY [expr 0x1 << 10 ] -set AT91C_PMC_PCK3RDY [expr 0x1 << 11 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Reset Controller Interface -# ***************************************************************************** -# -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- -set AT91C_RSTC_PROCRST [expr 0x1 << 0 ] -set AT91C_RSTC_PERRST [expr 0x1 << 2 ] -set AT91C_RSTC_EXTRST [expr 0x1 << 3 ] -set AT91C_RSTC_KEY [expr 0xFF << 24 ] -# -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- -set AT91C_RSTC_URSTS [expr 0x1 << 0 ] -set AT91C_RSTC_BODSTS [expr 0x1 << 1 ] -set AT91C_RSTC_RSTTYP [expr 0x7 << 8 ] -set AT91C_RSTC_RSTTYP_POWERUP [expr 0x0 << 8 ] -set AT91C_RSTC_RSTTYP_WAKEUP [expr 0x1 << 8 ] -set AT91C_RSTC_RSTTYP_WATCHDOG [expr 0x2 << 8 ] -set AT91C_RSTC_RSTTYP_SOFTWARE [expr 0x3 << 8 ] -set AT91C_RSTC_RSTTYP_USER [expr 0x4 << 8 ] -set AT91C_RSTC_RSTTYP_BROWNOUT [expr 0x5 << 8 ] -set AT91C_RSTC_NRSTL [expr 0x1 << 16 ] -set AT91C_RSTC_SRCMP [expr 0x1 << 17 ] -# -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- -set AT91C_RSTC_URSTEN [expr 0x1 << 0 ] -set AT91C_RSTC_URSTIEN [expr 0x1 << 4 ] -set AT91C_RSTC_ERSTL [expr 0xF << 8 ] -set AT91C_RSTC_BODIEN [expr 0x1 << 16 ] -set AT91C_RSTC_KEY [expr 0xFF << 24 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface -# ***************************************************************************** -# -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- -set AT91C_RTTC_RTPRES [expr 0xFFFF << 0 ] -set AT91C_RTTC_ALMIEN [expr 0x1 << 16 ] -set AT91C_RTTC_RTTINCIEN [expr 0x1 << 17 ] -set AT91C_RTTC_RTTRST [expr 0x1 << 18 ] -# -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- -set AT91C_RTTC_ALMV [expr 0x0 << 0 ] -# -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- -set AT91C_RTTC_CRTV [expr 0x0 << 0 ] -# -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- -set AT91C_RTTC_ALMS [expr 0x1 << 0 ] -set AT91C_RTTC_RTTINC [expr 0x1 << 1 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface -# ***************************************************************************** -# -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- -set AT91C_PITC_PIV [expr 0xFFFFF << 0 ] -set AT91C_PITC_PITEN [expr 0x1 << 24 ] -set AT91C_PITC_PITIEN [expr 0x1 << 25 ] -# -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- -set AT91C_PITC_PITS [expr 0x1 << 0 ] -# -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- -set AT91C_PITC_CPIV [expr 0xFFFFF << 0 ] -set AT91C_PITC_PICNT [expr 0xFFF << 20 ] -# -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- -set AT91C_PITC_CPIV [expr 0xFFFFF << 0 ] -set AT91C_PITC_PICNT [expr 0xFFF << 20 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface -# ***************************************************************************** -# -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- -set AT91C_WDTC_WDRSTT [expr 0x1 << 0 ] -set AT91C_WDTC_KEY [expr 0xFF << 24 ] -# -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- -set AT91C_WDTC_WDV [expr 0xFFF << 0 ] -set AT91C_WDTC_WDFIEN [expr 0x1 << 12 ] -set AT91C_WDTC_WDRSTEN [expr 0x1 << 13 ] -set AT91C_WDTC_WDRPROC [expr 0x1 << 14 ] -set AT91C_WDTC_WDDIS [expr 0x1 << 15 ] -set AT91C_WDTC_WDD [expr 0xFFF << 16 ] -set AT91C_WDTC_WDDBGHLT [expr 0x1 << 28 ] -set AT91C_WDTC_WDIDLEHLT [expr 0x1 << 29 ] -# -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- -set AT91C_WDTC_WDUNF [expr 0x1 << 0 ] -set AT91C_WDTC_WDERR [expr 0x1 << 1 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface -# ***************************************************************************** -# -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- -set AT91C_VREG_PSTDBY [expr 0x1 << 0 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Memory Controller Interface -# ***************************************************************************** -# -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- -set AT91C_MC_RCB [expr 0x1 << 0 ] -# -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- -set AT91C_MC_UNDADD [expr 0x1 << 0 ] -set AT91C_MC_MISADD [expr 0x1 << 1 ] -set AT91C_MC_ABTSZ [expr 0x3 << 8 ] -set AT91C_MC_ABTSZ_BYTE [expr 0x0 << 8 ] -set AT91C_MC_ABTSZ_HWORD [expr 0x1 << 8 ] -set AT91C_MC_ABTSZ_WORD [expr 0x2 << 8 ] -set AT91C_MC_ABTTYP [expr 0x3 << 10 ] -set AT91C_MC_ABTTYP_DATAR [expr 0x0 << 10 ] -set AT91C_MC_ABTTYP_DATAW [expr 0x1 << 10 ] -set AT91C_MC_ABTTYP_FETCH [expr 0x2 << 10 ] -set AT91C_MC_MST0 [expr 0x1 << 16 ] -set AT91C_MC_MST1 [expr 0x1 << 17 ] -set AT91C_MC_SVMST0 [expr 0x1 << 24 ] -set AT91C_MC_SVMST1 [expr 0x1 << 25 ] -# -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- -set AT91C_MC_FRDY [expr 0x1 << 0 ] -set AT91C_MC_LOCKE [expr 0x1 << 2 ] -set AT91C_MC_PROGE [expr 0x1 << 3 ] -set AT91C_MC_NEBP [expr 0x1 << 7 ] -set AT91C_MC_FWS [expr 0x3 << 8 ] -set AT91C_MC_FWS_0FWS [expr 0x0 << 8 ] -set AT91C_MC_FWS_1FWS [expr 0x1 << 8 ] -set AT91C_MC_FWS_2FWS [expr 0x2 << 8 ] -set AT91C_MC_FWS_3FWS [expr 0x3 << 8 ] -set AT91C_MC_FMCN [expr 0xFF << 16 ] -# -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- -set AT91C_MC_FCMD [expr 0xF << 0 ] -set AT91C_MC_FCMD_START_PROG 0x1 -set AT91C_MC_FCMD_LOCK 0x2 -set AT91C_MC_FCMD_PROG_AND_LOCK 0x3 -set AT91C_MC_FCMD_UNLOCK 0x4 -set AT91C_MC_FCMD_ERASE_ALL 0x8 -set AT91C_MC_FCMD_SET_GP_NVM 0xB -set AT91C_MC_FCMD_CLR_GP_NVM 0xD -set AT91C_MC_FCMD_SET_SECURITY 0xF -set AT91C_MC_PAGEN [expr 0x3FF << 8 ] -set AT91C_MC_KEY [expr 0xFF << 24 ] -# -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- -set AT91C_MC_FRDY [expr 0x1 << 0 ] -set AT91C_MC_LOCKE [expr 0x1 << 2 ] -set AT91C_MC_PROGE [expr 0x1 << 3 ] -set AT91C_MC_SECURITY [expr 0x1 << 4 ] -set AT91C_MC_GPNVM0 [expr 0x1 << 8 ] -set AT91C_MC_GPNVM1 [expr 0x1 << 9 ] -set AT91C_MC_GPNVM2 [expr 0x1 << 10 ] -set AT91C_MC_GPNVM3 [expr 0x1 << 11 ] -set AT91C_MC_GPNVM4 [expr 0x1 << 12 ] -set AT91C_MC_GPNVM5 [expr 0x1 << 13 ] -set AT91C_MC_GPNVM6 [expr 0x1 << 14 ] -set AT91C_MC_GPNVM7 [expr 0x1 << 15 ] -set AT91C_MC_LOCKS0 [expr 0x1 << 16 ] -set AT91C_MC_LOCKS1 [expr 0x1 << 17 ] -set AT91C_MC_LOCKS2 [expr 0x1 << 18 ] -set AT91C_MC_LOCKS3 [expr 0x1 << 19 ] -set AT91C_MC_LOCKS4 [expr 0x1 << 20 ] -set AT91C_MC_LOCKS5 [expr 0x1 << 21 ] -set AT91C_MC_LOCKS6 [expr 0x1 << 22 ] -set AT91C_MC_LOCKS7 [expr 0x1 << 23 ] -set AT91C_MC_LOCKS8 [expr 0x1 << 24 ] -set AT91C_MC_LOCKS9 [expr 0x1 << 25 ] -set AT91C_MC_LOCKS10 [expr 0x1 << 26 ] -set AT91C_MC_LOCKS11 [expr 0x1 << 27 ] -set AT91C_MC_LOCKS12 [expr 0x1 << 28 ] -set AT91C_MC_LOCKS13 [expr 0x1 << 29 ] -set AT91C_MC_LOCKS14 [expr 0x1 << 30 ] -set AT91C_MC_LOCKS15 [expr 0x1 << 31 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Serial Parallel Interface -# ***************************************************************************** -# -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- -set AT91C_SPI_SPIEN [expr 0x1 << 0 ] -set AT91C_SPI_SPIDIS [expr 0x1 << 1 ] -set AT91C_SPI_SWRST [expr 0x1 << 7 ] -set AT91C_SPI_LASTXFER [expr 0x1 << 24 ] -# -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- -set AT91C_SPI_MSTR [expr 0x1 << 0 ] -set AT91C_SPI_PS [expr 0x1 << 1 ] -set AT91C_SPI_PS_FIXED [expr 0x0 << 1 ] -set AT91C_SPI_PS_VARIABLE [expr 0x1 << 1 ] -set AT91C_SPI_PCSDEC [expr 0x1 << 2 ] -set AT91C_SPI_FDIV [expr 0x1 << 3 ] -set AT91C_SPI_MODFDIS [expr 0x1 << 4 ] -set AT91C_SPI_LLB [expr 0x1 << 7 ] -set AT91C_SPI_PCS [expr 0xF << 16 ] -set AT91C_SPI_DLYBCS [expr 0xFF << 24 ] -# -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- -set AT91C_SPI_RD [expr 0xFFFF << 0 ] -set AT91C_SPI_RPCS [expr 0xF << 16 ] -# -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- -set AT91C_SPI_TD [expr 0xFFFF << 0 ] -set AT91C_SPI_TPCS [expr 0xF << 16 ] -set AT91C_SPI_LASTXFER [expr 0x1 << 24 ] -# -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- -set AT91C_SPI_RDRF [expr 0x1 << 0 ] -set AT91C_SPI_TDRE [expr 0x1 << 1 ] -set AT91C_SPI_MODF [expr 0x1 << 2 ] -set AT91C_SPI_OVRES [expr 0x1 << 3 ] -set AT91C_SPI_ENDRX [expr 0x1 << 4 ] -set AT91C_SPI_ENDTX [expr 0x1 << 5 ] -set AT91C_SPI_RXBUFF [expr 0x1 << 6 ] -set AT91C_SPI_TXBUFE [expr 0x1 << 7 ] -set AT91C_SPI_NSSR [expr 0x1 << 8 ] -set AT91C_SPI_TXEMPTY [expr 0x1 << 9 ] -set AT91C_SPI_SPIENS [expr 0x1 << 16 ] -# -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- -set AT91C_SPI_RDRF [expr 0x1 << 0 ] -set AT91C_SPI_TDRE [expr 0x1 << 1 ] -set AT91C_SPI_MODF [expr 0x1 << 2 ] -set AT91C_SPI_OVRES [expr 0x1 << 3 ] -set AT91C_SPI_ENDRX [expr 0x1 << 4 ] -set AT91C_SPI_ENDTX [expr 0x1 << 5 ] -set AT91C_SPI_RXBUFF [expr 0x1 << 6 ] -set AT91C_SPI_TXBUFE [expr 0x1 << 7 ] -set AT91C_SPI_NSSR [expr 0x1 << 8 ] -set AT91C_SPI_TXEMPTY [expr 0x1 << 9 ] -# -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- -set AT91C_SPI_RDRF [expr 0x1 << 0 ] -set AT91C_SPI_TDRE [expr 0x1 << 1 ] -set AT91C_SPI_MODF [expr 0x1 << 2 ] -set AT91C_SPI_OVRES [expr 0x1 << 3 ] -set AT91C_SPI_ENDRX [expr 0x1 << 4 ] -set AT91C_SPI_ENDTX [expr 0x1 << 5 ] -set AT91C_SPI_RXBUFF [expr 0x1 << 6 ] -set AT91C_SPI_TXBUFE [expr 0x1 << 7 ] -set AT91C_SPI_NSSR [expr 0x1 << 8 ] -set AT91C_SPI_TXEMPTY [expr 0x1 << 9 ] -# -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- -set AT91C_SPI_RDRF [expr 0x1 << 0 ] -set AT91C_SPI_TDRE [expr 0x1 << 1 ] -set AT91C_SPI_MODF [expr 0x1 << 2 ] -set AT91C_SPI_OVRES [expr 0x1 << 3 ] -set AT91C_SPI_ENDRX [expr 0x1 << 4 ] -set AT91C_SPI_ENDTX [expr 0x1 << 5 ] -set AT91C_SPI_RXBUFF [expr 0x1 << 6 ] -set AT91C_SPI_TXBUFE [expr 0x1 << 7 ] -set AT91C_SPI_NSSR [expr 0x1 << 8 ] -set AT91C_SPI_TXEMPTY [expr 0x1 << 9 ] -# -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- -set AT91C_SPI_CPOL [expr 0x1 << 0 ] -set AT91C_SPI_NCPHA [expr 0x1 << 1 ] -set AT91C_SPI_CSAAT [expr 0x1 << 3 ] -set AT91C_SPI_BITS [expr 0xF << 4 ] -set AT91C_SPI_BITS_8 [expr 0x0 << 4 ] -set AT91C_SPI_BITS_9 [expr 0x1 << 4 ] -set AT91C_SPI_BITS_10 [expr 0x2 << 4 ] -set AT91C_SPI_BITS_11 [expr 0x3 << 4 ] -set AT91C_SPI_BITS_12 [expr 0x4 << 4 ] -set AT91C_SPI_BITS_13 [expr 0x5 << 4 ] -set AT91C_SPI_BITS_14 [expr 0x6 << 4 ] -set AT91C_SPI_BITS_15 [expr 0x7 << 4 ] -set AT91C_SPI_BITS_16 [expr 0x8 << 4 ] -set AT91C_SPI_SCBR [expr 0xFF << 8 ] -set AT91C_SPI_DLYBS [expr 0xFF << 16 ] -set AT91C_SPI_DLYBCT [expr 0xFF << 24 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Usart -# ***************************************************************************** -# -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- -set AT91C_US_RSTRX [expr 0x1 << 2 ] -set AT91C_US_RSTTX [expr 0x1 << 3 ] -set AT91C_US_RXEN [expr 0x1 << 4 ] -set AT91C_US_RXDIS [expr 0x1 << 5 ] -set AT91C_US_TXEN [expr 0x1 << 6 ] -set AT91C_US_TXDIS [expr 0x1 << 7 ] -set AT91C_US_RSTSTA [expr 0x1 << 8 ] -set AT91C_US_STTBRK [expr 0x1 << 9 ] -set AT91C_US_STPBRK [expr 0x1 << 10 ] -set AT91C_US_STTTO [expr 0x1 << 11 ] -set AT91C_US_SENDA [expr 0x1 << 12 ] -set AT91C_US_RSTIT [expr 0x1 << 13 ] -set AT91C_US_RSTNACK [expr 0x1 << 14 ] -set AT91C_US_RETTO [expr 0x1 << 15 ] -set AT91C_US_DTREN [expr 0x1 << 16 ] -set AT91C_US_DTRDIS [expr 0x1 << 17 ] -set AT91C_US_RTSEN [expr 0x1 << 18 ] -set AT91C_US_RTSDIS [expr 0x1 << 19 ] -# -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- -set AT91C_US_USMODE [expr 0xF << 0 ] -set AT91C_US_USMODE_NORMAL 0x0 -set AT91C_US_USMODE_RS485 0x1 -set AT91C_US_USMODE_HWHSH 0x2 -set AT91C_US_USMODE_MODEM 0x3 -set AT91C_US_USMODE_ISO7816_0 0x4 -set AT91C_US_USMODE_ISO7816_1 0x6 -set AT91C_US_USMODE_IRDA 0x8 -set AT91C_US_USMODE_SWHSH 0xC -set AT91C_US_CLKS [expr 0x3 << 4 ] -set AT91C_US_CLKS_CLOCK [expr 0x0 << 4 ] -set AT91C_US_CLKS_FDIV1 [expr 0x1 << 4 ] -set AT91C_US_CLKS_SLOW [expr 0x2 << 4 ] -set AT91C_US_CLKS_EXT [expr 0x3 << 4 ] -set AT91C_US_CHRL [expr 0x3 << 6 ] -set AT91C_US_CHRL_5_BITS [expr 0x0 << 6 ] -set AT91C_US_CHRL_6_BITS [expr 0x1 << 6 ] -set AT91C_US_CHRL_7_BITS [expr 0x2 << 6 ] -set AT91C_US_CHRL_8_BITS [expr 0x3 << 6 ] -set AT91C_US_SYNC [expr 0x1 << 8 ] -set AT91C_US_PAR [expr 0x7 << 9 ] -set AT91C_US_PAR_EVEN [expr 0x0 << 9 ] -set AT91C_US_PAR_ODD [expr 0x1 << 9 ] -set AT91C_US_PAR_SPACE [expr 0x2 << 9 ] -set AT91C_US_PAR_MARK [expr 0x3 << 9 ] -set AT91C_US_PAR_NONE [expr 0x4 << 9 ] -set AT91C_US_PAR_MULTI_DROP [expr 0x6 << 9 ] -set AT91C_US_NBSTOP [expr 0x3 << 12 ] -set AT91C_US_NBSTOP_1_BIT [expr 0x0 << 12 ] -set AT91C_US_NBSTOP_15_BIT [expr 0x1 << 12 ] -set AT91C_US_NBSTOP_2_BIT [expr 0x2 << 12 ] -set AT91C_US_CHMODE [expr 0x3 << 14 ] -set AT91C_US_CHMODE_NORMAL [expr 0x0 << 14 ] -set AT91C_US_CHMODE_AUTO [expr 0x1 << 14 ] -set AT91C_US_CHMODE_LOCAL [expr 0x2 << 14 ] -set AT91C_US_CHMODE_REMOTE [expr 0x3 << 14 ] -set AT91C_US_MSBF [expr 0x1 << 16 ] -set AT91C_US_MODE9 [expr 0x1 << 17 ] -set AT91C_US_CKLO [expr 0x1 << 18 ] -set AT91C_US_OVER [expr 0x1 << 19 ] -set AT91C_US_INACK [expr 0x1 << 20 ] -set AT91C_US_DSNACK [expr 0x1 << 21 ] -set AT91C_US_MAX_ITER [expr 0x1 << 24 ] -set AT91C_US_FILTER [expr 0x1 << 28 ] -# -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- -set AT91C_US_RXRDY [expr 0x1 << 0 ] -set AT91C_US_TXRDY [expr 0x1 << 1 ] -set AT91C_US_RXBRK [expr 0x1 << 2 ] -set AT91C_US_ENDRX [expr 0x1 << 3 ] -set AT91C_US_ENDTX [expr 0x1 << 4 ] -set AT91C_US_OVRE [expr 0x1 << 5 ] -set AT91C_US_FRAME [expr 0x1 << 6 ] -set AT91C_US_PARE [expr 0x1 << 7 ] -set AT91C_US_TIMEOUT [expr 0x1 << 8 ] -set AT91C_US_TXEMPTY [expr 0x1 << 9 ] -set AT91C_US_ITERATION [expr 0x1 << 10 ] -set AT91C_US_TXBUFE [expr 0x1 << 11 ] -set AT91C_US_RXBUFF [expr 0x1 << 12 ] -set AT91C_US_NACK [expr 0x1 << 13 ] -set AT91C_US_RIIC [expr 0x1 << 16 ] -set AT91C_US_DSRIC [expr 0x1 << 17 ] -set AT91C_US_DCDIC [expr 0x1 << 18 ] -set AT91C_US_CTSIC [expr 0x1 << 19 ] -# -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- -set AT91C_US_RXRDY [expr 0x1 << 0 ] -set AT91C_US_TXRDY [expr 0x1 << 1 ] -set AT91C_US_RXBRK [expr 0x1 << 2 ] -set AT91C_US_ENDRX [expr 0x1 << 3 ] -set AT91C_US_ENDTX [expr 0x1 << 4 ] -set AT91C_US_OVRE [expr 0x1 << 5 ] -set AT91C_US_FRAME [expr 0x1 << 6 ] -set AT91C_US_PARE [expr 0x1 << 7 ] -set AT91C_US_TIMEOUT [expr 0x1 << 8 ] -set AT91C_US_TXEMPTY [expr 0x1 << 9 ] -set AT91C_US_ITERATION [expr 0x1 << 10 ] -set AT91C_US_TXBUFE [expr 0x1 << 11 ] -set AT91C_US_RXBUFF [expr 0x1 << 12 ] -set AT91C_US_NACK [expr 0x1 << 13 ] -set AT91C_US_RIIC [expr 0x1 << 16 ] -set AT91C_US_DSRIC [expr 0x1 << 17 ] -set AT91C_US_DCDIC [expr 0x1 << 18 ] -set AT91C_US_CTSIC [expr 0x1 << 19 ] -# -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- -set AT91C_US_RXRDY [expr 0x1 << 0 ] -set AT91C_US_TXRDY [expr 0x1 << 1 ] -set AT91C_US_RXBRK [expr 0x1 << 2 ] -set AT91C_US_ENDRX [expr 0x1 << 3 ] -set AT91C_US_ENDTX [expr 0x1 << 4 ] -set AT91C_US_OVRE [expr 0x1 << 5 ] -set AT91C_US_FRAME [expr 0x1 << 6 ] -set AT91C_US_PARE [expr 0x1 << 7 ] -set AT91C_US_TIMEOUT [expr 0x1 << 8 ] -set AT91C_US_TXEMPTY [expr 0x1 << 9 ] -set AT91C_US_ITERATION [expr 0x1 << 10 ] -set AT91C_US_TXBUFE [expr 0x1 << 11 ] -set AT91C_US_RXBUFF [expr 0x1 << 12 ] -set AT91C_US_NACK [expr 0x1 << 13 ] -set AT91C_US_RIIC [expr 0x1 << 16 ] -set AT91C_US_DSRIC [expr 0x1 << 17 ] -set AT91C_US_DCDIC [expr 0x1 << 18 ] -set AT91C_US_CTSIC [expr 0x1 << 19 ] -# -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- -set AT91C_US_RXRDY [expr 0x1 << 0 ] -set AT91C_US_TXRDY [expr 0x1 << 1 ] -set AT91C_US_RXBRK [expr 0x1 << 2 ] -set AT91C_US_ENDRX [expr 0x1 << 3 ] -set AT91C_US_ENDTX [expr 0x1 << 4 ] -set AT91C_US_OVRE [expr 0x1 << 5 ] -set AT91C_US_FRAME [expr 0x1 << 6 ] -set AT91C_US_PARE [expr 0x1 << 7 ] -set AT91C_US_TIMEOUT [expr 0x1 << 8 ] -set AT91C_US_TXEMPTY [expr 0x1 << 9 ] -set AT91C_US_ITERATION [expr 0x1 << 10 ] -set AT91C_US_TXBUFE [expr 0x1 << 11 ] -set AT91C_US_RXBUFF [expr 0x1 << 12 ] -set AT91C_US_NACK [expr 0x1 << 13 ] -set AT91C_US_RIIC [expr 0x1 << 16 ] -set AT91C_US_DSRIC [expr 0x1 << 17 ] -set AT91C_US_DCDIC [expr 0x1 << 18 ] -set AT91C_US_CTSIC [expr 0x1 << 19 ] -set AT91C_US_RI [expr 0x1 << 20 ] -set AT91C_US_DSR [expr 0x1 << 21 ] -set AT91C_US_DCD [expr 0x1 << 22 ] -set AT91C_US_CTS [expr 0x1 << 23 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface -# ***************************************************************************** -# -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- -set AT91C_SSC_RXEN [expr 0x1 << 0 ] -set AT91C_SSC_RXDIS [expr 0x1 << 1 ] -set AT91C_SSC_TXEN [expr 0x1 << 8 ] -set AT91C_SSC_TXDIS [expr 0x1 << 9 ] -set AT91C_SSC_SWRST [expr 0x1 << 15 ] -# -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- -set AT91C_SSC_CKS [expr 0x3 << 0 ] -set AT91C_SSC_CKS_DIV 0x0 -set AT91C_SSC_CKS_TK 0x1 -set AT91C_SSC_CKS_RK 0x2 -set AT91C_SSC_CKO [expr 0x7 << 2 ] -set AT91C_SSC_CKO_NONE [expr 0x0 << 2 ] -set AT91C_SSC_CKO_CONTINOUS [expr 0x1 << 2 ] -set AT91C_SSC_CKO_DATA_TX [expr 0x2 << 2 ] -set AT91C_SSC_CKI [expr 0x1 << 5 ] -set AT91C_SSC_CKG [expr 0x3 << 6 ] -set AT91C_SSC_CKG_NONE [expr 0x0 << 6 ] -set AT91C_SSC_CKG_LOW [expr 0x1 << 6 ] -set AT91C_SSC_CKG_HIGH [expr 0x2 << 6 ] -set AT91C_SSC_START [expr 0xF << 8 ] -set AT91C_SSC_START_CONTINOUS [expr 0x0 << 8 ] -set AT91C_SSC_START_TX [expr 0x1 << 8 ] -set AT91C_SSC_START_LOW_RF [expr 0x2 << 8 ] -set AT91C_SSC_START_HIGH_RF [expr 0x3 << 8 ] -set AT91C_SSC_START_FALL_RF [expr 0x4 << 8 ] -set AT91C_SSC_START_RISE_RF [expr 0x5 << 8 ] -set AT91C_SSC_START_LEVEL_RF [expr 0x6 << 8 ] -set AT91C_SSC_START_EDGE_RF [expr 0x7 << 8 ] -set AT91C_SSC_START_0 [expr 0x8 << 8 ] -set AT91C_SSC_STOP [expr 0x1 << 12 ] -set AT91C_SSC_STTDLY [expr 0xFF << 16 ] -set AT91C_SSC_PERIOD [expr 0xFF << 24 ] -# -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- -set AT91C_SSC_DATLEN [expr 0x1F << 0 ] -set AT91C_SSC_LOOP [expr 0x1 << 5 ] -set AT91C_SSC_MSBF [expr 0x1 << 7 ] -set AT91C_SSC_DATNB [expr 0xF << 8 ] -set AT91C_SSC_FSLEN [expr 0xF << 16 ] -set AT91C_SSC_FSOS [expr 0x7 << 20 ] -set AT91C_SSC_FSOS_NONE [expr 0x0 << 20 ] -set AT91C_SSC_FSOS_NEGATIVE [expr 0x1 << 20 ] -set AT91C_SSC_FSOS_POSITIVE [expr 0x2 << 20 ] -set AT91C_SSC_FSOS_LOW [expr 0x3 << 20 ] -set AT91C_SSC_FSOS_HIGH [expr 0x4 << 20 ] -set AT91C_SSC_FSOS_TOGGLE [expr 0x5 << 20 ] -set AT91C_SSC_FSEDGE [expr 0x1 << 24 ] -# -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- -set AT91C_SSC_CKS [expr 0x3 << 0 ] -set AT91C_SSC_CKS_DIV 0x0 -set AT91C_SSC_CKS_TK 0x1 -set AT91C_SSC_CKS_RK 0x2 -set AT91C_SSC_CKO [expr 0x7 << 2 ] -set AT91C_SSC_CKO_NONE [expr 0x0 << 2 ] -set AT91C_SSC_CKO_CONTINOUS [expr 0x1 << 2 ] -set AT91C_SSC_CKO_DATA_TX [expr 0x2 << 2 ] -set AT91C_SSC_CKI [expr 0x1 << 5 ] -set AT91C_SSC_CKG [expr 0x3 << 6 ] -set AT91C_SSC_CKG_NONE [expr 0x0 << 6 ] -set AT91C_SSC_CKG_LOW [expr 0x1 << 6 ] -set AT91C_SSC_CKG_HIGH [expr 0x2 << 6 ] -set AT91C_SSC_START [expr 0xF << 8 ] -set AT91C_SSC_START_CONTINOUS [expr 0x0 << 8 ] -set AT91C_SSC_START_TX [expr 0x1 << 8 ] -set AT91C_SSC_START_LOW_RF [expr 0x2 << 8 ] -set AT91C_SSC_START_HIGH_RF [expr 0x3 << 8 ] -set AT91C_SSC_START_FALL_RF [expr 0x4 << 8 ] -set AT91C_SSC_START_RISE_RF [expr 0x5 << 8 ] -set AT91C_SSC_START_LEVEL_RF [expr 0x6 << 8 ] -set AT91C_SSC_START_EDGE_RF [expr 0x7 << 8 ] -set AT91C_SSC_START_0 [expr 0x8 << 8 ] -set AT91C_SSC_STTDLY [expr 0xFF << 16 ] -set AT91C_SSC_PERIOD [expr 0xFF << 24 ] -# -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- -set AT91C_SSC_DATLEN [expr 0x1F << 0 ] -set AT91C_SSC_DATDEF [expr 0x1 << 5 ] -set AT91C_SSC_MSBF [expr 0x1 << 7 ] -set AT91C_SSC_DATNB [expr 0xF << 8 ] -set AT91C_SSC_FSLEN [expr 0xF << 16 ] -set AT91C_SSC_FSOS [expr 0x7 << 20 ] -set AT91C_SSC_FSOS_NONE [expr 0x0 << 20 ] -set AT91C_SSC_FSOS_NEGATIVE [expr 0x1 << 20 ] -set AT91C_SSC_FSOS_POSITIVE [expr 0x2 << 20 ] -set AT91C_SSC_FSOS_LOW [expr 0x3 << 20 ] -set AT91C_SSC_FSOS_HIGH [expr 0x4 << 20 ] -set AT91C_SSC_FSOS_TOGGLE [expr 0x5 << 20 ] -set AT91C_SSC_FSDEN [expr 0x1 << 23 ] -set AT91C_SSC_FSEDGE [expr 0x1 << 24 ] -# -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- -set AT91C_SSC_TXRDY [expr 0x1 << 0 ] -set AT91C_SSC_TXEMPTY [expr 0x1 << 1 ] -set AT91C_SSC_ENDTX [expr 0x1 << 2 ] -set AT91C_SSC_TXBUFE [expr 0x1 << 3 ] -set AT91C_SSC_RXRDY [expr 0x1 << 4 ] -set AT91C_SSC_OVRUN [expr 0x1 << 5 ] -set AT91C_SSC_ENDRX [expr 0x1 << 6 ] -set AT91C_SSC_RXBUFF [expr 0x1 << 7 ] -set AT91C_SSC_CP0 [expr 0x1 << 8 ] -set AT91C_SSC_CP1 [expr 0x1 << 9 ] -set AT91C_SSC_TXSYN [expr 0x1 << 10 ] -set AT91C_SSC_RXSYN [expr 0x1 << 11 ] -set AT91C_SSC_TXENA [expr 0x1 << 16 ] -set AT91C_SSC_RXENA [expr 0x1 << 17 ] -# -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- -set AT91C_SSC_TXRDY [expr 0x1 << 0 ] -set AT91C_SSC_TXEMPTY [expr 0x1 << 1 ] -set AT91C_SSC_ENDTX [expr 0x1 << 2 ] -set AT91C_SSC_TXBUFE [expr 0x1 << 3 ] -set AT91C_SSC_RXRDY [expr 0x1 << 4 ] -set AT91C_SSC_OVRUN [expr 0x1 << 5 ] -set AT91C_SSC_ENDRX [expr 0x1 << 6 ] -set AT91C_SSC_RXBUFF [expr 0x1 << 7 ] -set AT91C_SSC_CP0 [expr 0x1 << 8 ] -set AT91C_SSC_CP1 [expr 0x1 << 9 ] -set AT91C_SSC_TXSYN [expr 0x1 << 10 ] -set AT91C_SSC_RXSYN [expr 0x1 << 11 ] -# -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- -set AT91C_SSC_TXRDY [expr 0x1 << 0 ] -set AT91C_SSC_TXEMPTY [expr 0x1 << 1 ] -set AT91C_SSC_ENDTX [expr 0x1 << 2 ] -set AT91C_SSC_TXBUFE [expr 0x1 << 3 ] -set AT91C_SSC_RXRDY [expr 0x1 << 4 ] -set AT91C_SSC_OVRUN [expr 0x1 << 5 ] -set AT91C_SSC_ENDRX [expr 0x1 << 6 ] -set AT91C_SSC_RXBUFF [expr 0x1 << 7 ] -set AT91C_SSC_CP0 [expr 0x1 << 8 ] -set AT91C_SSC_CP1 [expr 0x1 << 9 ] -set AT91C_SSC_TXSYN [expr 0x1 << 10 ] -set AT91C_SSC_RXSYN [expr 0x1 << 11 ] -# -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- -set AT91C_SSC_TXRDY [expr 0x1 << 0 ] -set AT91C_SSC_TXEMPTY [expr 0x1 << 1 ] -set AT91C_SSC_ENDTX [expr 0x1 << 2 ] -set AT91C_SSC_TXBUFE [expr 0x1 << 3 ] -set AT91C_SSC_RXRDY [expr 0x1 << 4 ] -set AT91C_SSC_OVRUN [expr 0x1 << 5 ] -set AT91C_SSC_ENDRX [expr 0x1 << 6 ] -set AT91C_SSC_RXBUFF [expr 0x1 << 7 ] -set AT91C_SSC_CP0 [expr 0x1 << 8 ] -set AT91C_SSC_CP1 [expr 0x1 << 9 ] -set AT91C_SSC_TXSYN [expr 0x1 << 10 ] -set AT91C_SSC_RXSYN [expr 0x1 << 11 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Two-wire Interface -# ***************************************************************************** -# -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- -set AT91C_TWI_START [expr 0x1 << 0 ] -set AT91C_TWI_STOP [expr 0x1 << 1 ] -set AT91C_TWI_MSEN [expr 0x1 << 2 ] -set AT91C_TWI_MSDIS [expr 0x1 << 3 ] -set AT91C_TWI_SWRST [expr 0x1 << 7 ] -# -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- -set AT91C_TWI_IADRSZ [expr 0x3 << 8 ] -set AT91C_TWI_IADRSZ_NO [expr 0x0 << 8 ] -set AT91C_TWI_IADRSZ_1_BYTE [expr 0x1 << 8 ] -set AT91C_TWI_IADRSZ_2_BYTE [expr 0x2 << 8 ] -set AT91C_TWI_IADRSZ_3_BYTE [expr 0x3 << 8 ] -set AT91C_TWI_MREAD [expr 0x1 << 12 ] -set AT91C_TWI_DADR [expr 0x7F << 16 ] -# -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- -set AT91C_TWI_CLDIV [expr 0xFF << 0 ] -set AT91C_TWI_CHDIV [expr 0xFF << 8 ] -set AT91C_TWI_CKDIV [expr 0x7 << 16 ] -# -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- -set AT91C_TWI_TXCOMP [expr 0x1 << 0 ] -set AT91C_TWI_RXRDY [expr 0x1 << 1 ] -set AT91C_TWI_TXRDY [expr 0x1 << 2 ] -set AT91C_TWI_OVRE [expr 0x1 << 6 ] -set AT91C_TWI_UNRE [expr 0x1 << 7 ] -set AT91C_TWI_NACK [expr 0x1 << 8 ] -# -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- -set AT91C_TWI_TXCOMP [expr 0x1 << 0 ] -set AT91C_TWI_RXRDY [expr 0x1 << 1 ] -set AT91C_TWI_TXRDY [expr 0x1 << 2 ] -set AT91C_TWI_OVRE [expr 0x1 << 6 ] -set AT91C_TWI_UNRE [expr 0x1 << 7 ] -set AT91C_TWI_NACK [expr 0x1 << 8 ] -# -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- -set AT91C_TWI_TXCOMP [expr 0x1 << 0 ] -set AT91C_TWI_RXRDY [expr 0x1 << 1 ] -set AT91C_TWI_TXRDY [expr 0x1 << 2 ] -set AT91C_TWI_OVRE [expr 0x1 << 6 ] -set AT91C_TWI_UNRE [expr 0x1 << 7 ] -set AT91C_TWI_NACK [expr 0x1 << 8 ] -# -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- -set AT91C_TWI_TXCOMP [expr 0x1 << 0 ] -set AT91C_TWI_RXRDY [expr 0x1 << 1 ] -set AT91C_TWI_TXRDY [expr 0x1 << 2 ] -set AT91C_TWI_OVRE [expr 0x1 << 6 ] -set AT91C_TWI_UNRE [expr 0x1 << 7 ] -set AT91C_TWI_NACK [expr 0x1 << 8 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR PWMC Channel Interface -# ***************************************************************************** -# -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- -set AT91C_PWMC_CPRE [expr 0xF << 0 ] -set AT91C_PWMC_CPRE_MCK 0x0 -set AT91C_PWMC_CPRE_MCK/2 0x1 -set AT91C_PWMC_CPRE_MCK/4 0x2 -set AT91C_PWMC_CPRE_MCK/8 0x3 -set AT91C_PWMC_CPRE_MCK/16 0x4 -set AT91C_PWMC_CPRE_MCK/32 0x5 -set AT91C_PWMC_CPRE_MCK/64 0x6 -set AT91C_PWMC_CPRE_MCK/128 0x7 -set AT91C_PWMC_CPRE_MCK/256 0x8 -set AT91C_PWMC_CPRE_MCK/512 0x9 -set AT91C_PWMC_CPRE_MCK/1024 0xA -set AT91C_PWMC_CPRE_MCKA 0xB -set AT91C_PWMC_CPRE_MCKB 0xC -set AT91C_PWMC_CALG [expr 0x1 << 8 ] -set AT91C_PWMC_CPOL [expr 0x1 << 9 ] -set AT91C_PWMC_CPD [expr 0x1 << 10 ] -# -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- -set AT91C_PWMC_CDTY [expr 0x0 << 0 ] -# -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- -set AT91C_PWMC_CPRD [expr 0x0 << 0 ] -# -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- -set AT91C_PWMC_CCNT [expr 0x0 << 0 ] -# -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- -set AT91C_PWMC_CUPD [expr 0x0 << 0 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface -# ***************************************************************************** -# -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- -set AT91C_PWMC_DIVA [expr 0xFF << 0 ] -set AT91C_PWMC_PREA [expr 0xF << 8 ] -set AT91C_PWMC_PREA_MCK [expr 0x0 << 8 ] -set AT91C_PWMC_PREA_MCK/2 [expr 0x1 << 8 ] -set AT91C_PWMC_PREA_MCK/4 [expr 0x2 << 8 ] -set AT91C_PWMC_PREA_MCK/8 [expr 0x3 << 8 ] -set AT91C_PWMC_PREA_MCK/16 [expr 0x4 << 8 ] -set AT91C_PWMC_PREA_MCK/32 [expr 0x5 << 8 ] -set AT91C_PWMC_PREA_MCK/64 [expr 0x6 << 8 ] -set AT91C_PWMC_PREA_MCK/128 [expr 0x7 << 8 ] -set AT91C_PWMC_PREA_MCK/256 [expr 0x8 << 8 ] -set AT91C_PWMC_DIVB [expr 0xFF << 16 ] -set AT91C_PWMC_PREB [expr 0xF << 24 ] -set AT91C_PWMC_PREB_MCK [expr 0x0 << 24 ] -set AT91C_PWMC_PREB_MCK/2 [expr 0x1 << 24 ] -set AT91C_PWMC_PREB_MCK/4 [expr 0x2 << 24 ] -set AT91C_PWMC_PREB_MCK/8 [expr 0x3 << 24 ] -set AT91C_PWMC_PREB_MCK/16 [expr 0x4 << 24 ] -set AT91C_PWMC_PREB_MCK/32 [expr 0x5 << 24 ] -set AT91C_PWMC_PREB_MCK/64 [expr 0x6 << 24 ] -set AT91C_PWMC_PREB_MCK/128 [expr 0x7 << 24 ] -set AT91C_PWMC_PREB_MCK/256 [expr 0x8 << 24 ] -# -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- -set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] -set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] -set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] -set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] -# -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- -set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] -set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] -set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] -set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] -# -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- -set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] -set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] -set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] -set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] -# -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- -set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] -set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] -set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] -set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] -# -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- -set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] -set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] -set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] -set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] -# -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- -set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] -set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] -set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] -set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] -# -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- -set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] -set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] -set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] -set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR USB Device Interface -# ***************************************************************************** -# -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- -set AT91C_UDP_FRM_NUM [expr 0x7FF << 0 ] -set AT91C_UDP_FRM_ERR [expr 0x1 << 16 ] -set AT91C_UDP_FRM_OK [expr 0x1 << 17 ] -# -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- -set AT91C_UDP_FADDEN [expr 0x1 << 0 ] -set AT91C_UDP_CONFG [expr 0x1 << 1 ] -set AT91C_UDP_ESR [expr 0x1 << 2 ] -set AT91C_UDP_RSMINPR [expr 0x1 << 3 ] -set AT91C_UDP_RMWUPE [expr 0x1 << 4 ] -# -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- -set AT91C_UDP_FADD [expr 0xFF << 0 ] -set AT91C_UDP_FEN [expr 0x1 << 8 ] -# -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- -set AT91C_UDP_EPINT0 [expr 0x1 << 0 ] -set AT91C_UDP_EPINT1 [expr 0x1 << 1 ] -set AT91C_UDP_EPINT2 [expr 0x1 << 2 ] -set AT91C_UDP_EPINT3 [expr 0x1 << 3 ] -set AT91C_UDP_EPINT4 [expr 0x1 << 4 ] -set AT91C_UDP_EPINT5 [expr 0x1 << 5 ] -set AT91C_UDP_RXSUSP [expr 0x1 << 8 ] -set AT91C_UDP_RXRSM [expr 0x1 << 9 ] -set AT91C_UDP_EXTRSM [expr 0x1 << 10 ] -set AT91C_UDP_SOFINT [expr 0x1 << 11 ] -set AT91C_UDP_WAKEUP [expr 0x1 << 13 ] -# -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- -set AT91C_UDP_EPINT0 [expr 0x1 << 0 ] -set AT91C_UDP_EPINT1 [expr 0x1 << 1 ] -set AT91C_UDP_EPINT2 [expr 0x1 << 2 ] -set AT91C_UDP_EPINT3 [expr 0x1 << 3 ] -set AT91C_UDP_EPINT4 [expr 0x1 << 4 ] -set AT91C_UDP_EPINT5 [expr 0x1 << 5 ] -set AT91C_UDP_RXSUSP [expr 0x1 << 8 ] -set AT91C_UDP_RXRSM [expr 0x1 << 9 ] -set AT91C_UDP_EXTRSM [expr 0x1 << 10 ] -set AT91C_UDP_SOFINT [expr 0x1 << 11 ] -set AT91C_UDP_WAKEUP [expr 0x1 << 13 ] -# -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- -set AT91C_UDP_EPINT0 [expr 0x1 << 0 ] -set AT91C_UDP_EPINT1 [expr 0x1 << 1 ] -set AT91C_UDP_EPINT2 [expr 0x1 << 2 ] -set AT91C_UDP_EPINT3 [expr 0x1 << 3 ] -set AT91C_UDP_EPINT4 [expr 0x1 << 4 ] -set AT91C_UDP_EPINT5 [expr 0x1 << 5 ] -set AT91C_UDP_RXSUSP [expr 0x1 << 8 ] -set AT91C_UDP_RXRSM [expr 0x1 << 9 ] -set AT91C_UDP_EXTRSM [expr 0x1 << 10 ] -set AT91C_UDP_SOFINT [expr 0x1 << 11 ] -set AT91C_UDP_WAKEUP [expr 0x1 << 13 ] -# -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- -set AT91C_UDP_EPINT0 [expr 0x1 << 0 ] -set AT91C_UDP_EPINT1 [expr 0x1 << 1 ] -set AT91C_UDP_EPINT2 [expr 0x1 << 2 ] -set AT91C_UDP_EPINT3 [expr 0x1 << 3 ] -set AT91C_UDP_EPINT4 [expr 0x1 << 4 ] -set AT91C_UDP_EPINT5 [expr 0x1 << 5 ] -set AT91C_UDP_RXSUSP [expr 0x1 << 8 ] -set AT91C_UDP_RXRSM [expr 0x1 << 9 ] -set AT91C_UDP_EXTRSM [expr 0x1 << 10 ] -set AT91C_UDP_SOFINT [expr 0x1 << 11 ] -set AT91C_UDP_ENDBUSRES [expr 0x1 << 12 ] -set AT91C_UDP_WAKEUP [expr 0x1 << 13 ] -# -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- -set AT91C_UDP_EPINT0 [expr 0x1 << 0 ] -set AT91C_UDP_EPINT1 [expr 0x1 << 1 ] -set AT91C_UDP_EPINT2 [expr 0x1 << 2 ] -set AT91C_UDP_EPINT3 [expr 0x1 << 3 ] -set AT91C_UDP_EPINT4 [expr 0x1 << 4 ] -set AT91C_UDP_EPINT5 [expr 0x1 << 5 ] -set AT91C_UDP_RXSUSP [expr 0x1 << 8 ] -set AT91C_UDP_RXRSM [expr 0x1 << 9 ] -set AT91C_UDP_EXTRSM [expr 0x1 << 10 ] -set AT91C_UDP_SOFINT [expr 0x1 << 11 ] -set AT91C_UDP_WAKEUP [expr 0x1 << 13 ] -# -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- -set AT91C_UDP_EP0 [expr 0x1 << 0 ] -set AT91C_UDP_EP1 [expr 0x1 << 1 ] -set AT91C_UDP_EP2 [expr 0x1 << 2 ] -set AT91C_UDP_EP3 [expr 0x1 << 3 ] -set AT91C_UDP_EP4 [expr 0x1 << 4 ] -set AT91C_UDP_EP5 [expr 0x1 << 5 ] -# -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- -set AT91C_UDP_TXCOMP [expr 0x1 << 0 ] -set AT91C_UDP_RX_DATA_BK0 [expr 0x1 << 1 ] -set AT91C_UDP_RXSETUP [expr 0x1 << 2 ] -set AT91C_UDP_ISOERROR [expr 0x1 << 3 ] -set AT91C_UDP_TXPKTRDY [expr 0x1 << 4 ] -set AT91C_UDP_FORCESTALL [expr 0x1 << 5 ] -set AT91C_UDP_RX_DATA_BK1 [expr 0x1 << 6 ] -set AT91C_UDP_DIR [expr 0x1 << 7 ] -set AT91C_UDP_EPTYPE [expr 0x7 << 8 ] -set AT91C_UDP_EPTYPE_CTRL [expr 0x0 << 8 ] -set AT91C_UDP_EPTYPE_ISO_OUT [expr 0x1 << 8 ] -set AT91C_UDP_EPTYPE_BULK_OUT [expr 0x2 << 8 ] -set AT91C_UDP_EPTYPE_INT_OUT [expr 0x3 << 8 ] -set AT91C_UDP_EPTYPE_ISO_IN [expr 0x5 << 8 ] -set AT91C_UDP_EPTYPE_BULK_IN [expr 0x6 << 8 ] -set AT91C_UDP_EPTYPE_INT_IN [expr 0x7 << 8 ] -set AT91C_UDP_DTGLE [expr 0x1 << 11 ] -set AT91C_UDP_EPEDS [expr 0x1 << 15 ] -set AT91C_UDP_RXBYTECNT [expr 0x7FF << 16 ] -# -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- -set AT91C_UDP_TXVDIS [expr 0x1 << 8 ] -set AT91C_UDP_PUON [expr 0x1 << 9 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Timer Counter Channel Interface -# ***************************************************************************** -# -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- -set AT91C_TC_CLKEN [expr 0x1 << 0 ] -set AT91C_TC_CLKDIS [expr 0x1 << 1 ] -set AT91C_TC_SWTRG [expr 0x1 << 2 ] -# -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- -set AT91C_TC_CLKS [expr 0x7 << 0 ] -set AT91C_TC_CLKS_TIMER_DIV1_CLOCK 0x0 -set AT91C_TC_CLKS_TIMER_DIV2_CLOCK 0x1 -set AT91C_TC_CLKS_TIMER_DIV3_CLOCK 0x2 -set AT91C_TC_CLKS_TIMER_DIV4_CLOCK 0x3 -set AT91C_TC_CLKS_TIMER_DIV5_CLOCK 0x4 -set AT91C_TC_CLKS_XC0 0x5 -set AT91C_TC_CLKS_XC1 0x6 -set AT91C_TC_CLKS_XC2 0x7 -set AT91C_TC_CLKS [expr 0x7 << 0 ] -set AT91C_TC_CLKS_TIMER_DIV1_CLOCK 0x0 -set AT91C_TC_CLKS_TIMER_DIV2_CLOCK 0x1 -set AT91C_TC_CLKS_TIMER_DIV3_CLOCK 0x2 -set AT91C_TC_CLKS_TIMER_DIV4_CLOCK 0x3 -set AT91C_TC_CLKS_TIMER_DIV5_CLOCK 0x4 -set AT91C_TC_CLKS_XC0 0x5 -set AT91C_TC_CLKS_XC1 0x6 -set AT91C_TC_CLKS_XC2 0x7 -set AT91C_TC_CLKI [expr 0x1 << 3 ] -set AT91C_TC_CLKI [expr 0x1 << 3 ] -set AT91C_TC_BURST [expr 0x3 << 4 ] -set AT91C_TC_BURST_NONE [expr 0x0 << 4 ] -set AT91C_TC_BURST_XC0 [expr 0x1 << 4 ] -set AT91C_TC_BURST_XC1 [expr 0x2 << 4 ] -set AT91C_TC_BURST_XC2 [expr 0x3 << 4 ] -set AT91C_TC_BURST [expr 0x3 << 4 ] -set AT91C_TC_BURST_NONE [expr 0x0 << 4 ] -set AT91C_TC_BURST_XC0 [expr 0x1 << 4 ] -set AT91C_TC_BURST_XC1 [expr 0x2 << 4 ] -set AT91C_TC_BURST_XC2 [expr 0x3 << 4 ] -set AT91C_TC_CPCSTOP [expr 0x1 << 6 ] -set AT91C_TC_LDBSTOP [expr 0x1 << 6 ] -set AT91C_TC_CPCDIS [expr 0x1 << 7 ] -set AT91C_TC_LDBDIS [expr 0x1 << 7 ] -set AT91C_TC_ETRGEDG [expr 0x3 << 8 ] -set AT91C_TC_ETRGEDG_NONE [expr 0x0 << 8 ] -set AT91C_TC_ETRGEDG_RISING [expr 0x1 << 8 ] -set AT91C_TC_ETRGEDG_FALLING [expr 0x2 << 8 ] -set AT91C_TC_ETRGEDG_BOTH [expr 0x3 << 8 ] -set AT91C_TC_EEVTEDG [expr 0x3 << 8 ] -set AT91C_TC_EEVTEDG_NONE [expr 0x0 << 8 ] -set AT91C_TC_EEVTEDG_RISING [expr 0x1 << 8 ] -set AT91C_TC_EEVTEDG_FALLING [expr 0x2 << 8 ] -set AT91C_TC_EEVTEDG_BOTH [expr 0x3 << 8 ] -set AT91C_TC_EEVT [expr 0x3 << 10 ] -set AT91C_TC_EEVT_TIOB [expr 0x0 << 10 ] -set AT91C_TC_EEVT_XC0 [expr 0x1 << 10 ] -set AT91C_TC_EEVT_XC1 [expr 0x2 << 10 ] -set AT91C_TC_EEVT_XC2 [expr 0x3 << 10 ] -set AT91C_TC_ABETRG [expr 0x1 << 10 ] -set AT91C_TC_ENETRG [expr 0x1 << 12 ] -set AT91C_TC_WAVESEL [expr 0x3 << 13 ] -set AT91C_TC_WAVESEL_UP [expr 0x0 << 13 ] -set AT91C_TC_WAVESEL_UPDOWN [expr 0x1 << 13 ] -set AT91C_TC_WAVESEL_UP_AUTO [expr 0x2 << 13 ] -set AT91C_TC_WAVESEL_UPDOWN_AUTO [expr 0x3 << 13 ] -set AT91C_TC_CPCTRG [expr 0x1 << 14 ] -set AT91C_TC_WAVE [expr 0x1 << 15 ] -set AT91C_TC_WAVE [expr 0x1 << 15 ] -set AT91C_TC_ACPA [expr 0x3 << 16 ] -set AT91C_TC_ACPA_NONE [expr 0x0 << 16 ] -set AT91C_TC_ACPA_SET [expr 0x1 << 16 ] -set AT91C_TC_ACPA_CLEAR [expr 0x2 << 16 ] -set AT91C_TC_ACPA_TOGGLE [expr 0x3 << 16 ] -set AT91C_TC_LDRA [expr 0x3 << 16 ] -set AT91C_TC_LDRA_NONE [expr 0x0 << 16 ] -set AT91C_TC_LDRA_RISING [expr 0x1 << 16 ] -set AT91C_TC_LDRA_FALLING [expr 0x2 << 16 ] -set AT91C_TC_LDRA_BOTH [expr 0x3 << 16 ] -set AT91C_TC_ACPC [expr 0x3 << 18 ] -set AT91C_TC_ACPC_NONE [expr 0x0 << 18 ] -set AT91C_TC_ACPC_SET [expr 0x1 << 18 ] -set AT91C_TC_ACPC_CLEAR [expr 0x2 << 18 ] -set AT91C_TC_ACPC_TOGGLE [expr 0x3 << 18 ] -set AT91C_TC_LDRB [expr 0x3 << 18 ] -set AT91C_TC_LDRB_NONE [expr 0x0 << 18 ] -set AT91C_TC_LDRB_RISING [expr 0x1 << 18 ] -set AT91C_TC_LDRB_FALLING [expr 0x2 << 18 ] -set AT91C_TC_LDRB_BOTH [expr 0x3 << 18 ] -set AT91C_TC_AEEVT [expr 0x3 << 20 ] -set AT91C_TC_AEEVT_NONE [expr 0x0 << 20 ] -set AT91C_TC_AEEVT_SET [expr 0x1 << 20 ] -set AT91C_TC_AEEVT_CLEAR [expr 0x2 << 20 ] -set AT91C_TC_AEEVT_TOGGLE [expr 0x3 << 20 ] -set AT91C_TC_ASWTRG [expr 0x3 << 22 ] -set AT91C_TC_ASWTRG_NONE [expr 0x0 << 22 ] -set AT91C_TC_ASWTRG_SET [expr 0x1 << 22 ] -set AT91C_TC_ASWTRG_CLEAR [expr 0x2 << 22 ] -set AT91C_TC_ASWTRG_TOGGLE [expr 0x3 << 22 ] -set AT91C_TC_BCPB [expr 0x3 << 24 ] -set AT91C_TC_BCPB_NONE [expr 0x0 << 24 ] -set AT91C_TC_BCPB_SET [expr 0x1 << 24 ] -set AT91C_TC_BCPB_CLEAR [expr 0x2 << 24 ] -set AT91C_TC_BCPB_TOGGLE [expr 0x3 << 24 ] -set AT91C_TC_BCPC [expr 0x3 << 26 ] -set AT91C_TC_BCPC_NONE [expr 0x0 << 26 ] -set AT91C_TC_BCPC_SET [expr 0x1 << 26 ] -set AT91C_TC_BCPC_CLEAR [expr 0x2 << 26 ] -set AT91C_TC_BCPC_TOGGLE [expr 0x3 << 26 ] -set AT91C_TC_BEEVT [expr 0x3 << 28 ] -set AT91C_TC_BEEVT_NONE [expr 0x0 << 28 ] -set AT91C_TC_BEEVT_SET [expr 0x1 << 28 ] -set AT91C_TC_BEEVT_CLEAR [expr 0x2 << 28 ] -set AT91C_TC_BEEVT_TOGGLE [expr 0x3 << 28 ] -set AT91C_TC_BSWTRG [expr 0x3 << 30 ] -set AT91C_TC_BSWTRG_NONE [expr 0x0 << 30 ] -set AT91C_TC_BSWTRG_SET [expr 0x1 << 30 ] -set AT91C_TC_BSWTRG_CLEAR [expr 0x2 << 30 ] -set AT91C_TC_BSWTRG_TOGGLE [expr 0x3 << 30 ] -# -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- -set AT91C_TC_COVFS [expr 0x1 << 0 ] -set AT91C_TC_LOVRS [expr 0x1 << 1 ] -set AT91C_TC_CPAS [expr 0x1 << 2 ] -set AT91C_TC_CPBS [expr 0x1 << 3 ] -set AT91C_TC_CPCS [expr 0x1 << 4 ] -set AT91C_TC_LDRAS [expr 0x1 << 5 ] -set AT91C_TC_LDRBS [expr 0x1 << 6 ] -set AT91C_TC_ETRGS [expr 0x1 << 7 ] -set AT91C_TC_CLKSTA [expr 0x1 << 16 ] -set AT91C_TC_MTIOA [expr 0x1 << 17 ] -set AT91C_TC_MTIOB [expr 0x1 << 18 ] -# -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- -set AT91C_TC_COVFS [expr 0x1 << 0 ] -set AT91C_TC_LOVRS [expr 0x1 << 1 ] -set AT91C_TC_CPAS [expr 0x1 << 2 ] -set AT91C_TC_CPBS [expr 0x1 << 3 ] -set AT91C_TC_CPCS [expr 0x1 << 4 ] -set AT91C_TC_LDRAS [expr 0x1 << 5 ] -set AT91C_TC_LDRBS [expr 0x1 << 6 ] -set AT91C_TC_ETRGS [expr 0x1 << 7 ] -# -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- -set AT91C_TC_COVFS [expr 0x1 << 0 ] -set AT91C_TC_LOVRS [expr 0x1 << 1 ] -set AT91C_TC_CPAS [expr 0x1 << 2 ] -set AT91C_TC_CPBS [expr 0x1 << 3 ] -set AT91C_TC_CPCS [expr 0x1 << 4 ] -set AT91C_TC_LDRAS [expr 0x1 << 5 ] -set AT91C_TC_LDRBS [expr 0x1 << 6 ] -set AT91C_TC_ETRGS [expr 0x1 << 7 ] -# -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- -set AT91C_TC_COVFS [expr 0x1 << 0 ] -set AT91C_TC_LOVRS [expr 0x1 << 1 ] -set AT91C_TC_CPAS [expr 0x1 << 2 ] -set AT91C_TC_CPBS [expr 0x1 << 3 ] -set AT91C_TC_CPCS [expr 0x1 << 4 ] -set AT91C_TC_LDRAS [expr 0x1 << 5 ] -set AT91C_TC_LDRBS [expr 0x1 << 6 ] -set AT91C_TC_ETRGS [expr 0x1 << 7 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Timer Counter Interface -# ***************************************************************************** -# -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- -set AT91C_TCB_SYNC [expr 0x1 << 0 ] -# -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- -set AT91C_TCB_TC0XC0S [expr 0x3 << 0 ] -set AT91C_TCB_TC0XC0S_TCLK0 0x0 -set AT91C_TCB_TC0XC0S_NONE 0x1 -set AT91C_TCB_TC0XC0S_TIOA1 0x2 -set AT91C_TCB_TC0XC0S_TIOA2 0x3 -set AT91C_TCB_TC1XC1S [expr 0x3 << 2 ] -set AT91C_TCB_TC1XC1S_TCLK1 [expr 0x0 << 2 ] -set AT91C_TCB_TC1XC1S_NONE [expr 0x1 << 2 ] -set AT91C_TCB_TC1XC1S_TIOA0 [expr 0x2 << 2 ] -set AT91C_TCB_TC1XC1S_TIOA2 [expr 0x3 << 2 ] -set AT91C_TCB_TC2XC2S [expr 0x3 << 4 ] -set AT91C_TCB_TC2XC2S_TCLK2 [expr 0x0 << 4 ] -set AT91C_TCB_TC2XC2S_NONE [expr 0x1 << 4 ] -set AT91C_TCB_TC2XC2S_TIOA0 [expr 0x2 << 4 ] -set AT91C_TCB_TC2XC2S_TIOA1 [expr 0x3 << 4 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface -# ***************************************************************************** -# -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- -set AT91C_CAN_MTIMEMARK [expr 0xFFFF << 0 ] -set AT91C_CAN_PRIOR [expr 0xF << 16 ] -set AT91C_CAN_MOT [expr 0x7 << 24 ] -set AT91C_CAN_MOT_DIS [expr 0x0 << 24 ] -set AT91C_CAN_MOT_RX [expr 0x1 << 24 ] -set AT91C_CAN_MOT_RXOVERWRITE [expr 0x2 << 24 ] -set AT91C_CAN_MOT_TX [expr 0x3 << 24 ] -set AT91C_CAN_MOT_CONSUMER [expr 0x4 << 24 ] -set AT91C_CAN_MOT_PRODUCER [expr 0x5 << 24 ] -# -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- -set AT91C_CAN_MIDvB [expr 0x3FFFF << 0 ] -set AT91C_CAN_MIDvA [expr 0x7FF << 18 ] -set AT91C_CAN_MIDE [expr 0x1 << 29 ] -# -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- -set AT91C_CAN_MIDvB [expr 0x3FFFF << 0 ] -set AT91C_CAN_MIDvA [expr 0x7FF << 18 ] -set AT91C_CAN_MIDE [expr 0x1 << 29 ] -# -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- -# -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- -set AT91C_CAN_MTIMESTAMP [expr 0xFFFF << 0 ] -set AT91C_CAN_MDLC [expr 0xF << 16 ] -set AT91C_CAN_MRTR [expr 0x1 << 20 ] -set AT91C_CAN_MABT [expr 0x1 << 22 ] -set AT91C_CAN_MRDY [expr 0x1 << 23 ] -set AT91C_CAN_MMI [expr 0x1 << 24 ] -# -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- -# -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- -# -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- -set AT91C_CAN_MDLC [expr 0xF << 16 ] -set AT91C_CAN_MRTR [expr 0x1 << 20 ] -set AT91C_CAN_MACR [expr 0x1 << 22 ] -set AT91C_CAN_MTCR [expr 0x1 << 23 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Control Area Network Interface -# ***************************************************************************** -# -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- -set AT91C_CAN_CANEN [expr 0x1 << 0 ] -set AT91C_CAN_LPM [expr 0x1 << 1 ] -set AT91C_CAN_ABM [expr 0x1 << 2 ] -set AT91C_CAN_OVL [expr 0x1 << 3 ] -set AT91C_CAN_TEOF [expr 0x1 << 4 ] -set AT91C_CAN_TTM [expr 0x1 << 5 ] -set AT91C_CAN_TIMFRZ [expr 0x1 << 6 ] -set AT91C_CAN_DRPT [expr 0x1 << 7 ] -# -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- -set AT91C_CAN_MB0 [expr 0x1 << 0 ] -set AT91C_CAN_MB1 [expr 0x1 << 1 ] -set AT91C_CAN_MB2 [expr 0x1 << 2 ] -set AT91C_CAN_MB3 [expr 0x1 << 3 ] -set AT91C_CAN_MB4 [expr 0x1 << 4 ] -set AT91C_CAN_MB5 [expr 0x1 << 5 ] -set AT91C_CAN_MB6 [expr 0x1 << 6 ] -set AT91C_CAN_MB7 [expr 0x1 << 7 ] -set AT91C_CAN_MB8 [expr 0x1 << 8 ] -set AT91C_CAN_MB9 [expr 0x1 << 9 ] -set AT91C_CAN_MB10 [expr 0x1 << 10 ] -set AT91C_CAN_MB11 [expr 0x1 << 11 ] -set AT91C_CAN_MB12 [expr 0x1 << 12 ] -set AT91C_CAN_MB13 [expr 0x1 << 13 ] -set AT91C_CAN_MB14 [expr 0x1 << 14 ] -set AT91C_CAN_MB15 [expr 0x1 << 15 ] -set AT91C_CAN_ERRA [expr 0x1 << 16 ] -set AT91C_CAN_WARN [expr 0x1 << 17 ] -set AT91C_CAN_ERRP [expr 0x1 << 18 ] -set AT91C_CAN_BOFF [expr 0x1 << 19 ] -set AT91C_CAN_SLEEP [expr 0x1 << 20 ] -set AT91C_CAN_WAKEUP [expr 0x1 << 21 ] -set AT91C_CAN_TOVF [expr 0x1 << 22 ] -set AT91C_CAN_TSTP [expr 0x1 << 23 ] -set AT91C_CAN_CERR [expr 0x1 << 24 ] -set AT91C_CAN_SERR [expr 0x1 << 25 ] -set AT91C_CAN_AERR [expr 0x1 << 26 ] -set AT91C_CAN_FERR [expr 0x1 << 27 ] -set AT91C_CAN_BERR [expr 0x1 << 28 ] -# -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- -set AT91C_CAN_MB0 [expr 0x1 << 0 ] -set AT91C_CAN_MB1 [expr 0x1 << 1 ] -set AT91C_CAN_MB2 [expr 0x1 << 2 ] -set AT91C_CAN_MB3 [expr 0x1 << 3 ] -set AT91C_CAN_MB4 [expr 0x1 << 4 ] -set AT91C_CAN_MB5 [expr 0x1 << 5 ] -set AT91C_CAN_MB6 [expr 0x1 << 6 ] -set AT91C_CAN_MB7 [expr 0x1 << 7 ] -set AT91C_CAN_MB8 [expr 0x1 << 8 ] -set AT91C_CAN_MB9 [expr 0x1 << 9 ] -set AT91C_CAN_MB10 [expr 0x1 << 10 ] -set AT91C_CAN_MB11 [expr 0x1 << 11 ] -set AT91C_CAN_MB12 [expr 0x1 << 12 ] -set AT91C_CAN_MB13 [expr 0x1 << 13 ] -set AT91C_CAN_MB14 [expr 0x1 << 14 ] -set AT91C_CAN_MB15 [expr 0x1 << 15 ] -set AT91C_CAN_ERRA [expr 0x1 << 16 ] -set AT91C_CAN_WARN [expr 0x1 << 17 ] -set AT91C_CAN_ERRP [expr 0x1 << 18 ] -set AT91C_CAN_BOFF [expr 0x1 << 19 ] -set AT91C_CAN_SLEEP [expr 0x1 << 20 ] -set AT91C_CAN_WAKEUP [expr 0x1 << 21 ] -set AT91C_CAN_TOVF [expr 0x1 << 22 ] -set AT91C_CAN_TSTP [expr 0x1 << 23 ] -set AT91C_CAN_CERR [expr 0x1 << 24 ] -set AT91C_CAN_SERR [expr 0x1 << 25 ] -set AT91C_CAN_AERR [expr 0x1 << 26 ] -set AT91C_CAN_FERR [expr 0x1 << 27 ] -set AT91C_CAN_BERR [expr 0x1 << 28 ] -# -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- -set AT91C_CAN_MB0 [expr 0x1 << 0 ] -set AT91C_CAN_MB1 [expr 0x1 << 1 ] -set AT91C_CAN_MB2 [expr 0x1 << 2 ] -set AT91C_CAN_MB3 [expr 0x1 << 3 ] -set AT91C_CAN_MB4 [expr 0x1 << 4 ] -set AT91C_CAN_MB5 [expr 0x1 << 5 ] -set AT91C_CAN_MB6 [expr 0x1 << 6 ] -set AT91C_CAN_MB7 [expr 0x1 << 7 ] -set AT91C_CAN_MB8 [expr 0x1 << 8 ] -set AT91C_CAN_MB9 [expr 0x1 << 9 ] -set AT91C_CAN_MB10 [expr 0x1 << 10 ] -set AT91C_CAN_MB11 [expr 0x1 << 11 ] -set AT91C_CAN_MB12 [expr 0x1 << 12 ] -set AT91C_CAN_MB13 [expr 0x1 << 13 ] -set AT91C_CAN_MB14 [expr 0x1 << 14 ] -set AT91C_CAN_MB15 [expr 0x1 << 15 ] -set AT91C_CAN_ERRA [expr 0x1 << 16 ] -set AT91C_CAN_WARN [expr 0x1 << 17 ] -set AT91C_CAN_ERRP [expr 0x1 << 18 ] -set AT91C_CAN_BOFF [expr 0x1 << 19 ] -set AT91C_CAN_SLEEP [expr 0x1 << 20 ] -set AT91C_CAN_WAKEUP [expr 0x1 << 21 ] -set AT91C_CAN_TOVF [expr 0x1 << 22 ] -set AT91C_CAN_TSTP [expr 0x1 << 23 ] -set AT91C_CAN_CERR [expr 0x1 << 24 ] -set AT91C_CAN_SERR [expr 0x1 << 25 ] -set AT91C_CAN_AERR [expr 0x1 << 26 ] -set AT91C_CAN_FERR [expr 0x1 << 27 ] -set AT91C_CAN_BERR [expr 0x1 << 28 ] -# -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- -set AT91C_CAN_MB0 [expr 0x1 << 0 ] -set AT91C_CAN_MB1 [expr 0x1 << 1 ] -set AT91C_CAN_MB2 [expr 0x1 << 2 ] -set AT91C_CAN_MB3 [expr 0x1 << 3 ] -set AT91C_CAN_MB4 [expr 0x1 << 4 ] -set AT91C_CAN_MB5 [expr 0x1 << 5 ] -set AT91C_CAN_MB6 [expr 0x1 << 6 ] -set AT91C_CAN_MB7 [expr 0x1 << 7 ] -set AT91C_CAN_MB8 [expr 0x1 << 8 ] -set AT91C_CAN_MB9 [expr 0x1 << 9 ] -set AT91C_CAN_MB10 [expr 0x1 << 10 ] -set AT91C_CAN_MB11 [expr 0x1 << 11 ] -set AT91C_CAN_MB12 [expr 0x1 << 12 ] -set AT91C_CAN_MB13 [expr 0x1 << 13 ] -set AT91C_CAN_MB14 [expr 0x1 << 14 ] -set AT91C_CAN_MB15 [expr 0x1 << 15 ] -set AT91C_CAN_ERRA [expr 0x1 << 16 ] -set AT91C_CAN_WARN [expr 0x1 << 17 ] -set AT91C_CAN_ERRP [expr 0x1 << 18 ] -set AT91C_CAN_BOFF [expr 0x1 << 19 ] -set AT91C_CAN_SLEEP [expr 0x1 << 20 ] -set AT91C_CAN_WAKEUP [expr 0x1 << 21 ] -set AT91C_CAN_TOVF [expr 0x1 << 22 ] -set AT91C_CAN_TSTP [expr 0x1 << 23 ] -set AT91C_CAN_CERR [expr 0x1 << 24 ] -set AT91C_CAN_SERR [expr 0x1 << 25 ] -set AT91C_CAN_AERR [expr 0x1 << 26 ] -set AT91C_CAN_FERR [expr 0x1 << 27 ] -set AT91C_CAN_BERR [expr 0x1 << 28 ] -set AT91C_CAN_RBSY [expr 0x1 << 29 ] -set AT91C_CAN_TBSY [expr 0x1 << 30 ] -set AT91C_CAN_OVLY [expr 0x1 << 31 ] -# -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- -set AT91C_CAN_PHASE2 [expr 0x7 << 0 ] -set AT91C_CAN_PHASE1 [expr 0x7 << 4 ] -set AT91C_CAN_PROPAG [expr 0x7 << 8 ] -set AT91C_CAN_SYNC [expr 0x3 << 12 ] -set AT91C_CAN_BRP [expr 0x7F << 16 ] -set AT91C_CAN_SMP [expr 0x1 << 24 ] -# -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- -set AT91C_CAN_TIMER [expr 0xFFFF << 0 ] -# -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- -set AT91C_CAN_MTIMESTAMP [expr 0xFFFF << 0 ] -# -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- -set AT91C_CAN_REC [expr 0xFF << 0 ] -set AT91C_CAN_TEC [expr 0xFF << 16 ] -# -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- -set AT91C_CAN_MB0 [expr 0x1 << 0 ] -set AT91C_CAN_MB1 [expr 0x1 << 1 ] -set AT91C_CAN_MB2 [expr 0x1 << 2 ] -set AT91C_CAN_MB3 [expr 0x1 << 3 ] -set AT91C_CAN_MB4 [expr 0x1 << 4 ] -set AT91C_CAN_MB5 [expr 0x1 << 5 ] -set AT91C_CAN_MB6 [expr 0x1 << 6 ] -set AT91C_CAN_MB7 [expr 0x1 << 7 ] -set AT91C_CAN_MB8 [expr 0x1 << 8 ] -set AT91C_CAN_MB9 [expr 0x1 << 9 ] -set AT91C_CAN_MB10 [expr 0x1 << 10 ] -set AT91C_CAN_MB11 [expr 0x1 << 11 ] -set AT91C_CAN_MB12 [expr 0x1 << 12 ] -set AT91C_CAN_MB13 [expr 0x1 << 13 ] -set AT91C_CAN_MB14 [expr 0x1 << 14 ] -set AT91C_CAN_MB15 [expr 0x1 << 15 ] -set AT91C_CAN_TIMRST [expr 0x1 << 31 ] -# -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- -set AT91C_CAN_MB0 [expr 0x1 << 0 ] -set AT91C_CAN_MB1 [expr 0x1 << 1 ] -set AT91C_CAN_MB2 [expr 0x1 << 2 ] -set AT91C_CAN_MB3 [expr 0x1 << 3 ] -set AT91C_CAN_MB4 [expr 0x1 << 4 ] -set AT91C_CAN_MB5 [expr 0x1 << 5 ] -set AT91C_CAN_MB6 [expr 0x1 << 6 ] -set AT91C_CAN_MB7 [expr 0x1 << 7 ] -set AT91C_CAN_MB8 [expr 0x1 << 8 ] -set AT91C_CAN_MB9 [expr 0x1 << 9 ] -set AT91C_CAN_MB10 [expr 0x1 << 10 ] -set AT91C_CAN_MB11 [expr 0x1 << 11 ] -set AT91C_CAN_MB12 [expr 0x1 << 12 ] -set AT91C_CAN_MB13 [expr 0x1 << 13 ] -set AT91C_CAN_MB14 [expr 0x1 << 14 ] -set AT91C_CAN_MB15 [expr 0x1 << 15 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 -# ***************************************************************************** -# -------- EMAC_NCR : (EMAC Offset: 0x0) -------- -set AT91C_EMAC_LB [expr 0x1 << 0 ] -set AT91C_EMAC_LLB [expr 0x1 << 1 ] -set AT91C_EMAC_RE [expr 0x1 << 2 ] -set AT91C_EMAC_TE [expr 0x1 << 3 ] -set AT91C_EMAC_MPE [expr 0x1 << 4 ] -set AT91C_EMAC_CLRSTAT [expr 0x1 << 5 ] -set AT91C_EMAC_INCSTAT [expr 0x1 << 6 ] -set AT91C_EMAC_WESTAT [expr 0x1 << 7 ] -set AT91C_EMAC_BP [expr 0x1 << 8 ] -set AT91C_EMAC_TSTART [expr 0x1 << 9 ] -set AT91C_EMAC_THALT [expr 0x1 << 10 ] -set AT91C_EMAC_TPFR [expr 0x1 << 11 ] -set AT91C_EMAC_TZQ [expr 0x1 << 12 ] -# -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- -set AT91C_EMAC_SPD [expr 0x1 << 0 ] -set AT91C_EMAC_FD [expr 0x1 << 1 ] -set AT91C_EMAC_JFRAME [expr 0x1 << 3 ] -set AT91C_EMAC_CAF [expr 0x1 << 4 ] -set AT91C_EMAC_NBC [expr 0x1 << 5 ] -set AT91C_EMAC_MTI [expr 0x1 << 6 ] -set AT91C_EMAC_UNI [expr 0x1 << 7 ] -set AT91C_EMAC_BIG [expr 0x1 << 8 ] -set AT91C_EMAC_EAE [expr 0x1 << 9 ] -set AT91C_EMAC_CLK [expr 0x3 << 10 ] -set AT91C_EMAC_CLK_HCLK_8 [expr 0x0 << 10 ] -set AT91C_EMAC_CLK_HCLK_16 [expr 0x1 << 10 ] -set AT91C_EMAC_CLK_HCLK_32 [expr 0x2 << 10 ] -set AT91C_EMAC_CLK_HCLK_64 [expr 0x3 << 10 ] -set AT91C_EMAC_RTY [expr 0x1 << 12 ] -set AT91C_EMAC_PAE [expr 0x1 << 13 ] -set AT91C_EMAC_RBOF [expr 0x3 << 14 ] -set AT91C_EMAC_RBOF_OFFSET_0 [expr 0x0 << 14 ] -set AT91C_EMAC_RBOF_OFFSET_1 [expr 0x1 << 14 ] -set AT91C_EMAC_RBOF_OFFSET_2 [expr 0x2 << 14 ] -set AT91C_EMAC_RBOF_OFFSET_3 [expr 0x3 << 14 ] -set AT91C_EMAC_RLCE [expr 0x1 << 16 ] -set AT91C_EMAC_DRFCS [expr 0x1 << 17 ] -set AT91C_EMAC_EFRHD [expr 0x1 << 18 ] -set AT91C_EMAC_IRXFCS [expr 0x1 << 19 ] -# -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- -set AT91C_EMAC_LINKR [expr 0x1 << 0 ] -set AT91C_EMAC_MDIO [expr 0x1 << 1 ] -set AT91C_EMAC_IDLE [expr 0x1 << 2 ] -# -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- -set AT91C_EMAC_UBR [expr 0x1 << 0 ] -set AT91C_EMAC_COL [expr 0x1 << 1 ] -set AT91C_EMAC_RLES [expr 0x1 << 2 ] -set AT91C_EMAC_TGO [expr 0x1 << 3 ] -set AT91C_EMAC_BEX [expr 0x1 << 4 ] -set AT91C_EMAC_COMP [expr 0x1 << 5 ] -set AT91C_EMAC_UND [expr 0x1 << 6 ] -# -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- -set AT91C_EMAC_BNA [expr 0x1 << 0 ] -set AT91C_EMAC_REC [expr 0x1 << 1 ] -set AT91C_EMAC_OVR [expr 0x1 << 2 ] -# -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- -set AT91C_EMAC_MFD [expr 0x1 << 0 ] -set AT91C_EMAC_RCOMP [expr 0x1 << 1 ] -set AT91C_EMAC_RXUBR [expr 0x1 << 2 ] -set AT91C_EMAC_TXUBR [expr 0x1 << 3 ] -set AT91C_EMAC_TUNDR [expr 0x1 << 4 ] -set AT91C_EMAC_RLEX [expr 0x1 << 5 ] -set AT91C_EMAC_TXERR [expr 0x1 << 6 ] -set AT91C_EMAC_TCOMP [expr 0x1 << 7 ] -set AT91C_EMAC_LINK [expr 0x1 << 9 ] -set AT91C_EMAC_ROVR [expr 0x1 << 10 ] -set AT91C_EMAC_HRESP [expr 0x1 << 11 ] -set AT91C_EMAC_PFRE [expr 0x1 << 12 ] -set AT91C_EMAC_PTZ [expr 0x1 << 13 ] -# -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- -set AT91C_EMAC_MFD [expr 0x1 << 0 ] -set AT91C_EMAC_RCOMP [expr 0x1 << 1 ] -set AT91C_EMAC_RXUBR [expr 0x1 << 2 ] -set AT91C_EMAC_TXUBR [expr 0x1 << 3 ] -set AT91C_EMAC_TUNDR [expr 0x1 << 4 ] -set AT91C_EMAC_RLEX [expr 0x1 << 5 ] -set AT91C_EMAC_TXERR [expr 0x1 << 6 ] -set AT91C_EMAC_TCOMP [expr 0x1 << 7 ] -set AT91C_EMAC_LINK [expr 0x1 << 9 ] -set AT91C_EMAC_ROVR [expr 0x1 << 10 ] -set AT91C_EMAC_HRESP [expr 0x1 << 11 ] -set AT91C_EMAC_PFRE [expr 0x1 << 12 ] -set AT91C_EMAC_PTZ [expr 0x1 << 13 ] -# -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- -set AT91C_EMAC_MFD [expr 0x1 << 0 ] -set AT91C_EMAC_RCOMP [expr 0x1 << 1 ] -set AT91C_EMAC_RXUBR [expr 0x1 << 2 ] -set AT91C_EMAC_TXUBR [expr 0x1 << 3 ] -set AT91C_EMAC_TUNDR [expr 0x1 << 4 ] -set AT91C_EMAC_RLEX [expr 0x1 << 5 ] -set AT91C_EMAC_TXERR [expr 0x1 << 6 ] -set AT91C_EMAC_TCOMP [expr 0x1 << 7 ] -set AT91C_EMAC_LINK [expr 0x1 << 9 ] -set AT91C_EMAC_ROVR [expr 0x1 << 10 ] -set AT91C_EMAC_HRESP [expr 0x1 << 11 ] -set AT91C_EMAC_PFRE [expr 0x1 << 12 ] -set AT91C_EMAC_PTZ [expr 0x1 << 13 ] -# -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- -set AT91C_EMAC_MFD [expr 0x1 << 0 ] -set AT91C_EMAC_RCOMP [expr 0x1 << 1 ] -set AT91C_EMAC_RXUBR [expr 0x1 << 2 ] -set AT91C_EMAC_TXUBR [expr 0x1 << 3 ] -set AT91C_EMAC_TUNDR [expr 0x1 << 4 ] -set AT91C_EMAC_RLEX [expr 0x1 << 5 ] -set AT91C_EMAC_TXERR [expr 0x1 << 6 ] -set AT91C_EMAC_TCOMP [expr 0x1 << 7 ] -set AT91C_EMAC_LINK [expr 0x1 << 9 ] -set AT91C_EMAC_ROVR [expr 0x1 << 10 ] -set AT91C_EMAC_HRESP [expr 0x1 << 11 ] -set AT91C_EMAC_PFRE [expr 0x1 << 12 ] -set AT91C_EMAC_PTZ [expr 0x1 << 13 ] -# -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- -set AT91C_EMAC_DATA [expr 0xFFFF << 0 ] -set AT91C_EMAC_CODE [expr 0x3 << 16 ] -set AT91C_EMAC_REGA [expr 0x1F << 18 ] -set AT91C_EMAC_PHYA [expr 0x1F << 23 ] -set AT91C_EMAC_RW [expr 0x3 << 28 ] -set AT91C_EMAC_SOF [expr 0x3 << 30 ] -# -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- -set AT91C_EMAC_RMII [expr 0x1 << 0 ] -set AT91C_EMAC_CLKEN [expr 0x1 << 1 ] -# -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- -set AT91C_EMAC_IP [expr 0xFFFF << 0 ] -set AT91C_EMAC_MAG [expr 0x1 << 16 ] -set AT91C_EMAC_ARP [expr 0x1 << 17 ] -set AT91C_EMAC_SA1 [expr 0x1 << 18 ] -set AT91C_EMAC_MTI [expr 0x1 << 19 ] -# -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- -set AT91C_EMAC_REVREF [expr 0xFFFF << 0 ] -set AT91C_EMAC_PARTREF [expr 0xFFFF << 16 ] - -# ***************************************************************************** -# SOFTWARE API DEFINITION FOR Analog to Digital Convertor -# ***************************************************************************** -# -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- -set AT91C_ADC_SWRST [expr 0x1 << 0 ] -set AT91C_ADC_START [expr 0x1 << 1 ] -# -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- -set AT91C_ADC_TRGEN [expr 0x1 << 0 ] -set AT91C_ADC_TRGEN_DIS 0x0 -set AT91C_ADC_TRGEN_EN 0x1 -set AT91C_ADC_TRGSEL [expr 0x7 << 1 ] -set AT91C_ADC_TRGSEL_TIOA0 [expr 0x0 << 1 ] -set AT91C_ADC_TRGSEL_TIOA1 [expr 0x1 << 1 ] -set AT91C_ADC_TRGSEL_TIOA2 [expr 0x2 << 1 ] -set AT91C_ADC_TRGSEL_TIOA3 [expr 0x3 << 1 ] -set AT91C_ADC_TRGSEL_TIOA4 [expr 0x4 << 1 ] -set AT91C_ADC_TRGSEL_TIOA5 [expr 0x5 << 1 ] -set AT91C_ADC_TRGSEL_EXT [expr 0x6 << 1 ] -set AT91C_ADC_LOWRES [expr 0x1 << 4 ] -set AT91C_ADC_LOWRES_10_BIT [expr 0x0 << 4 ] -set AT91C_ADC_LOWRES_8_BIT [expr 0x1 << 4 ] -set AT91C_ADC_SLEEP [expr 0x1 << 5 ] -set AT91C_ADC_SLEEP_NORMAL_MODE [expr 0x0 << 5 ] -set AT91C_ADC_SLEEP_MODE [expr 0x1 << 5 ] -set AT91C_ADC_PRESCAL [expr 0x3F << 8 ] -set AT91C_ADC_STARTUP [expr 0x1F << 16 ] -set AT91C_ADC_SHTIM [expr 0xF << 24 ] -# -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- -set AT91C_ADC_CH0 [expr 0x1 << 0 ] -set AT91C_ADC_CH1 [expr 0x1 << 1 ] -set AT91C_ADC_CH2 [expr 0x1 << 2 ] -set AT91C_ADC_CH3 [expr 0x1 << 3 ] -set AT91C_ADC_CH4 [expr 0x1 << 4 ] -set AT91C_ADC_CH5 [expr 0x1 << 5 ] -set AT91C_ADC_CH6 [expr 0x1 << 6 ] -set AT91C_ADC_CH7 [expr 0x1 << 7 ] -# -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- -set AT91C_ADC_CH0 [expr 0x1 << 0 ] -set AT91C_ADC_CH1 [expr 0x1 << 1 ] -set AT91C_ADC_CH2 [expr 0x1 << 2 ] -set AT91C_ADC_CH3 [expr 0x1 << 3 ] -set AT91C_ADC_CH4 [expr 0x1 << 4 ] -set AT91C_ADC_CH5 [expr 0x1 << 5 ] -set AT91C_ADC_CH6 [expr 0x1 << 6 ] -set AT91C_ADC_CH7 [expr 0x1 << 7 ] -# -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- -set AT91C_ADC_CH0 [expr 0x1 << 0 ] -set AT91C_ADC_CH1 [expr 0x1 << 1 ] -set AT91C_ADC_CH2 [expr 0x1 << 2 ] -set AT91C_ADC_CH3 [expr 0x1 << 3 ] -set AT91C_ADC_CH4 [expr 0x1 << 4 ] -set AT91C_ADC_CH5 [expr 0x1 << 5 ] -set AT91C_ADC_CH6 [expr 0x1 << 6 ] -set AT91C_ADC_CH7 [expr 0x1 << 7 ] -# -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- -set AT91C_ADC_EOC0 [expr 0x1 << 0 ] -set AT91C_ADC_EOC1 [expr 0x1 << 1 ] -set AT91C_ADC_EOC2 [expr 0x1 << 2 ] -set AT91C_ADC_EOC3 [expr 0x1 << 3 ] -set AT91C_ADC_EOC4 [expr 0x1 << 4 ] -set AT91C_ADC_EOC5 [expr 0x1 << 5 ] -set AT91C_ADC_EOC6 [expr 0x1 << 6 ] -set AT91C_ADC_EOC7 [expr 0x1 << 7 ] -set AT91C_ADC_OVRE0 [expr 0x1 << 8 ] -set AT91C_ADC_OVRE1 [expr 0x1 << 9 ] -set AT91C_ADC_OVRE2 [expr 0x1 << 10 ] -set AT91C_ADC_OVRE3 [expr 0x1 << 11 ] -set AT91C_ADC_OVRE4 [expr 0x1 << 12 ] -set AT91C_ADC_OVRE5 [expr 0x1 << 13 ] -set AT91C_ADC_OVRE6 [expr 0x1 << 14 ] -set AT91C_ADC_OVRE7 [expr 0x1 << 15 ] -set AT91C_ADC_DRDY [expr 0x1 << 16 ] -set AT91C_ADC_GOVRE [expr 0x1 << 17 ] -set AT91C_ADC_ENDRX [expr 0x1 << 18 ] -set AT91C_ADC_RXBUFF [expr 0x1 << 19 ] -# -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- -set AT91C_ADC_LDATA [expr 0x3FF << 0 ] -# -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- -set AT91C_ADC_EOC0 [expr 0x1 << 0 ] -set AT91C_ADC_EOC1 [expr 0x1 << 1 ] -set AT91C_ADC_EOC2 [expr 0x1 << 2 ] -set AT91C_ADC_EOC3 [expr 0x1 << 3 ] -set AT91C_ADC_EOC4 [expr 0x1 << 4 ] -set AT91C_ADC_EOC5 [expr 0x1 << 5 ] -set AT91C_ADC_EOC6 [expr 0x1 << 6 ] -set AT91C_ADC_EOC7 [expr 0x1 << 7 ] -set AT91C_ADC_OVRE0 [expr 0x1 << 8 ] -set AT91C_ADC_OVRE1 [expr 0x1 << 9 ] -set AT91C_ADC_OVRE2 [expr 0x1 << 10 ] -set AT91C_ADC_OVRE3 [expr 0x1 << 11 ] -set AT91C_ADC_OVRE4 [expr 0x1 << 12 ] -set AT91C_ADC_OVRE5 [expr 0x1 << 13 ] -set AT91C_ADC_OVRE6 [expr 0x1 << 14 ] -set AT91C_ADC_OVRE7 [expr 0x1 << 15 ] -set AT91C_ADC_DRDY [expr 0x1 << 16 ] -set AT91C_ADC_GOVRE [expr 0x1 << 17 ] -set AT91C_ADC_ENDRX [expr 0x1 << 18 ] -set AT91C_ADC_RXBUFF [expr 0x1 << 19 ] -# -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- -set AT91C_ADC_EOC0 [expr 0x1 << 0 ] -set AT91C_ADC_EOC1 [expr 0x1 << 1 ] -set AT91C_ADC_EOC2 [expr 0x1 << 2 ] -set AT91C_ADC_EOC3 [expr 0x1 << 3 ] -set AT91C_ADC_EOC4 [expr 0x1 << 4 ] -set AT91C_ADC_EOC5 [expr 0x1 << 5 ] -set AT91C_ADC_EOC6 [expr 0x1 << 6 ] -set AT91C_ADC_EOC7 [expr 0x1 << 7 ] -set AT91C_ADC_OVRE0 [expr 0x1 << 8 ] -set AT91C_ADC_OVRE1 [expr 0x1 << 9 ] -set AT91C_ADC_OVRE2 [expr 0x1 << 10 ] -set AT91C_ADC_OVRE3 [expr 0x1 << 11 ] -set AT91C_ADC_OVRE4 [expr 0x1 << 12 ] -set AT91C_ADC_OVRE5 [expr 0x1 << 13 ] -set AT91C_ADC_OVRE6 [expr 0x1 << 14 ] -set AT91C_ADC_OVRE7 [expr 0x1 << 15 ] -set AT91C_ADC_DRDY [expr 0x1 << 16 ] -set AT91C_ADC_GOVRE [expr 0x1 << 17 ] -set AT91C_ADC_ENDRX [expr 0x1 << 18 ] -set AT91C_ADC_RXBUFF [expr 0x1 << 19 ] -# -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- -set AT91C_ADC_EOC0 [expr 0x1 << 0 ] -set AT91C_ADC_EOC1 [expr 0x1 << 1 ] -set AT91C_ADC_EOC2 [expr 0x1 << 2 ] -set AT91C_ADC_EOC3 [expr 0x1 << 3 ] -set AT91C_ADC_EOC4 [expr 0x1 << 4 ] -set AT91C_ADC_EOC5 [expr 0x1 << 5 ] -set AT91C_ADC_EOC6 [expr 0x1 << 6 ] -set AT91C_ADC_EOC7 [expr 0x1 << 7 ] -set AT91C_ADC_OVRE0 [expr 0x1 << 8 ] -set AT91C_ADC_OVRE1 [expr 0x1 << 9 ] -set AT91C_ADC_OVRE2 [expr 0x1 << 10 ] -set AT91C_ADC_OVRE3 [expr 0x1 << 11 ] -set AT91C_ADC_OVRE4 [expr 0x1 << 12 ] -set AT91C_ADC_OVRE5 [expr 0x1 << 13 ] -set AT91C_ADC_OVRE6 [expr 0x1 << 14 ] -set AT91C_ADC_OVRE7 [expr 0x1 << 15 ] -set AT91C_ADC_DRDY [expr 0x1 << 16 ] -set AT91C_ADC_GOVRE [expr 0x1 << 17 ] -set AT91C_ADC_ENDRX [expr 0x1 << 18 ] -set AT91C_ADC_RXBUFF [expr 0x1 << 19 ] -# -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- -set AT91C_ADC_DATA [expr 0x3FF << 0 ] -# -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- -set AT91C_ADC_DATA [expr 0x3FF << 0 ] -# -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- -set AT91C_ADC_DATA [expr 0x3FF << 0 ] -# -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- -set AT91C_ADC_DATA [expr 0x3FF << 0 ] -# -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- -set AT91C_ADC_DATA [expr 0x3FF << 0 ] -# -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- -set AT91C_ADC_DATA [expr 0x3FF << 0 ] -# -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- -set AT91C_ADC_DATA [expr 0x3FF << 0 ] -# -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- -set AT91C_ADC_DATA [expr 0x3FF << 0 ] - -# ***************************************************************************** -# REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 -# ***************************************************************************** -# ========== Register definition for SYS peripheral ========== -# ========== Register definition for AIC peripheral ========== -set AT91C_AIC_IVR 0xFFFFF100 -set AT91C_AIC_SMR 0xFFFFF000 -set AT91C_AIC_FVR 0xFFFFF104 -set AT91C_AIC_DCR 0xFFFFF138 -set AT91C_AIC_EOICR 0xFFFFF130 -set AT91C_AIC_SVR 0xFFFFF080 -set AT91C_AIC_FFSR 0xFFFFF148 -set AT91C_AIC_ICCR 0xFFFFF128 -set AT91C_AIC_ISR 0xFFFFF108 -set AT91C_AIC_IMR 0xFFFFF110 -set AT91C_AIC_IPR 0xFFFFF10C -set AT91C_AIC_FFER 0xFFFFF140 -set AT91C_AIC_IECR 0xFFFFF120 -set AT91C_AIC_ISCR 0xFFFFF12C -set AT91C_AIC_FFDR 0xFFFFF144 -set AT91C_AIC_CISR 0xFFFFF114 -set AT91C_AIC_IDCR 0xFFFFF124 -set AT91C_AIC_SPU 0xFFFFF134 -# ========== Register definition for PDC_DBGU peripheral ========== -set AT91C_DBGU_TCR 0xFFFFF30C -set AT91C_DBGU_RNPR 0xFFFFF310 -set AT91C_DBGU_TNPR 0xFFFFF318 -set AT91C_DBGU_TPR 0xFFFFF308 -set AT91C_DBGU_RPR 0xFFFFF300 -set AT91C_DBGU_RCR 0xFFFFF304 -set AT91C_DBGU_RNCR 0xFFFFF314 -set AT91C_DBGU_PTCR 0xFFFFF320 -set AT91C_DBGU_PTSR 0xFFFFF324 -set AT91C_DBGU_TNCR 0xFFFFF31C -# ========== Register definition for DBGU peripheral ========== -set AT91C_DBGU_EXID 0xFFFFF244 -set AT91C_DBGU_BRGR 0xFFFFF220 -set AT91C_DBGU_IDR 0xFFFFF20C -set AT91C_DBGU_CSR 0xFFFFF214 -set AT91C_DBGU_CIDR 0xFFFFF240 -set AT91C_DBGU_MR 0xFFFFF204 -set AT91C_DBGU_IMR 0xFFFFF210 -set AT91C_DBGU_CR 0xFFFFF200 -set AT91C_DBGU_FNTR 0xFFFFF248 -set AT91C_DBGU_THR 0xFFFFF21C -set AT91C_DBGU_RHR 0xFFFFF218 -set AT91C_DBGU_IER 0xFFFFF208 -# ========== Register definition for PIOA peripheral ========== -set AT91C_PIOA_ODR 0xFFFFF414 -set AT91C_PIOA_SODR 0xFFFFF430 -set AT91C_PIOA_ISR 0xFFFFF44C -set AT91C_PIOA_ABSR 0xFFFFF478 -set AT91C_PIOA_IER 0xFFFFF440 -set AT91C_PIOA_PPUDR 0xFFFFF460 -set AT91C_PIOA_IMR 0xFFFFF448 -set AT91C_PIOA_PER 0xFFFFF400 -set AT91C_PIOA_IFDR 0xFFFFF424 -set AT91C_PIOA_OWDR 0xFFFFF4A4 -set AT91C_PIOA_MDSR 0xFFFFF458 -set AT91C_PIOA_IDR 0xFFFFF444 -set AT91C_PIOA_ODSR 0xFFFFF438 -set AT91C_PIOA_PPUSR 0xFFFFF468 -set AT91C_PIOA_OWSR 0xFFFFF4A8 -set AT91C_PIOA_BSR 0xFFFFF474 -set AT91C_PIOA_OWER 0xFFFFF4A0 -set AT91C_PIOA_IFER 0xFFFFF420 -set AT91C_PIOA_PDSR 0xFFFFF43C -set AT91C_PIOA_PPUER 0xFFFFF464 -set AT91C_PIOA_OSR 0xFFFFF418 -set AT91C_PIOA_ASR 0xFFFFF470 -set AT91C_PIOA_MDDR 0xFFFFF454 -set AT91C_PIOA_CODR 0xFFFFF434 -set AT91C_PIOA_MDER 0xFFFFF450 -set AT91C_PIOA_PDR 0xFFFFF404 -set AT91C_PIOA_IFSR 0xFFFFF428 -set AT91C_PIOA_OER 0xFFFFF410 -set AT91C_PIOA_PSR 0xFFFFF408 -# ========== Register definition for PIOB peripheral ========== -set AT91C_PIOB_OWDR 0xFFFFF6A4 -set AT91C_PIOB_MDER 0xFFFFF650 -set AT91C_PIOB_PPUSR 0xFFFFF668 -set AT91C_PIOB_IMR 0xFFFFF648 -set AT91C_PIOB_ASR 0xFFFFF670 -set AT91C_PIOB_PPUDR 0xFFFFF660 -set AT91C_PIOB_PSR 0xFFFFF608 -set AT91C_PIOB_IER 0xFFFFF640 -set AT91C_PIOB_CODR 0xFFFFF634 -set AT91C_PIOB_OWER 0xFFFFF6A0 -set AT91C_PIOB_ABSR 0xFFFFF678 -set AT91C_PIOB_IFDR 0xFFFFF624 -set AT91C_PIOB_PDSR 0xFFFFF63C -set AT91C_PIOB_IDR 0xFFFFF644 -set AT91C_PIOB_OWSR 0xFFFFF6A8 -set AT91C_PIOB_PDR 0xFFFFF604 -set AT91C_PIOB_ODR 0xFFFFF614 -set AT91C_PIOB_IFSR 0xFFFFF628 -set AT91C_PIOB_PPUER 0xFFFFF664 -set AT91C_PIOB_SODR 0xFFFFF630 -set AT91C_PIOB_ISR 0xFFFFF64C -set AT91C_PIOB_ODSR 0xFFFFF638 -set AT91C_PIOB_OSR 0xFFFFF618 -set AT91C_PIOB_MDSR 0xFFFFF658 -set AT91C_PIOB_IFER 0xFFFFF620 -set AT91C_PIOB_BSR 0xFFFFF674 -set AT91C_PIOB_MDDR 0xFFFFF654 -set AT91C_PIOB_OER 0xFFFFF610 -set AT91C_PIOB_PER 0xFFFFF600 -# ========== Register definition for CKGR peripheral ========== -set AT91C_CKGR_MOR 0xFFFFFC20 -set AT91C_CKGR_PLLR 0xFFFFFC2C -set AT91C_CKGR_MCFR 0xFFFFFC24 -# ========== Register definition for PMC peripheral ========== -set AT91C_PMC_IDR 0xFFFFFC64 -set AT91C_PMC_MOR 0xFFFFFC20 -set AT91C_PMC_PLLR 0xFFFFFC2C -set AT91C_PMC_PCER 0xFFFFFC10 -set AT91C_PMC_PCKR 0xFFFFFC40 -set AT91C_PMC_MCKR 0xFFFFFC30 -set AT91C_PMC_SCDR 0xFFFFFC04 -set AT91C_PMC_PCDR 0xFFFFFC14 -set AT91C_PMC_SCSR 0xFFFFFC08 -set AT91C_PMC_PCSR 0xFFFFFC18 -set AT91C_PMC_MCFR 0xFFFFFC24 -set AT91C_PMC_SCER 0xFFFFFC00 -set AT91C_PMC_IMR 0xFFFFFC6C -set AT91C_PMC_IER 0xFFFFFC60 -set AT91C_PMC_SR 0xFFFFFC68 -# ========== Register definition for RSTC peripheral ========== -set AT91C_RSTC_RCR 0xFFFFFD00 -set AT91C_RSTC_RMR 0xFFFFFD08 -set AT91C_RSTC_RSR 0xFFFFFD04 -# ========== Register definition for RTTC peripheral ========== -set AT91C_RTTC_RTSR 0xFFFFFD2C -set AT91C_RTTC_RTMR 0xFFFFFD20 -set AT91C_RTTC_RTVR 0xFFFFFD28 -set AT91C_RTTC_RTAR 0xFFFFFD24 -# ========== Register definition for PITC peripheral ========== -set AT91C_PITC_PIVR 0xFFFFFD38 -set AT91C_PITC_PISR 0xFFFFFD34 -set AT91C_PITC_PIIR 0xFFFFFD3C -set AT91C_PITC_PIMR 0xFFFFFD30 -# ========== Register definition for WDTC peripheral ========== -set AT91C_WDTC_WDCR 0xFFFFFD40 -set AT91C_WDTC_WDSR 0xFFFFFD48 -set AT91C_WDTC_WDMR 0xFFFFFD44 -# ========== Register definition for VREG peripheral ========== -set AT91C_VREG_MR 0xFFFFFD60 -# ========== Register definition for MC peripheral ========== -set AT91C_MC_ASR 0xFFFFFF04 -set AT91C_MC_RCR 0xFFFFFF00 -set AT91C_MC_FCR 0xFFFFFF64 -set AT91C_MC_AASR 0xFFFFFF08 -set AT91C_MC_FSR 0xFFFFFF68 -set AT91C_MC_FMR 0xFFFFFF60 -# ========== Register definition for PDC_SPI1 peripheral ========== -set AT91C_SPI1_PTCR 0xFFFE4120 -set AT91C_SPI1_RPR 0xFFFE4100 -set AT91C_SPI1_TNCR 0xFFFE411C -set AT91C_SPI1_TPR 0xFFFE4108 -set AT91C_SPI1_TNPR 0xFFFE4118 -set AT91C_SPI1_TCR 0xFFFE410C -set AT91C_SPI1_RCR 0xFFFE4104 -set AT91C_SPI1_RNPR 0xFFFE4110 -set AT91C_SPI1_RNCR 0xFFFE4114 -set AT91C_SPI1_PTSR 0xFFFE4124 -# ========== Register definition for SPI1 peripheral ========== -set AT91C_SPI1_IMR 0xFFFE401C -set AT91C_SPI1_IER 0xFFFE4014 -set AT91C_SPI1_MR 0xFFFE4004 -set AT91C_SPI1_RDR 0xFFFE4008 -set AT91C_SPI1_IDR 0xFFFE4018 -set AT91C_SPI1_SR 0xFFFE4010 -set AT91C_SPI1_TDR 0xFFFE400C -set AT91C_SPI1_CR 0xFFFE4000 -set AT91C_SPI1_CSR 0xFFFE4030 -# ========== Register definition for PDC_SPI0 peripheral ========== -set AT91C_SPI0_PTCR 0xFFFE0120 -set AT91C_SPI0_TPR 0xFFFE0108 -set AT91C_SPI0_TCR 0xFFFE010C -set AT91C_SPI0_RCR 0xFFFE0104 -set AT91C_SPI0_PTSR 0xFFFE0124 -set AT91C_SPI0_RNPR 0xFFFE0110 -set AT91C_SPI0_RPR 0xFFFE0100 -set AT91C_SPI0_TNCR 0xFFFE011C -set AT91C_SPI0_RNCR 0xFFFE0114 -set AT91C_SPI0_TNPR 0xFFFE0118 -# ========== Register definition for SPI0 peripheral ========== -set AT91C_SPI0_IER 0xFFFE0014 -set AT91C_SPI0_SR 0xFFFE0010 -set AT91C_SPI0_IDR 0xFFFE0018 -set AT91C_SPI0_CR 0xFFFE0000 -set AT91C_SPI0_MR 0xFFFE0004 -set AT91C_SPI0_IMR 0xFFFE001C -set AT91C_SPI0_TDR 0xFFFE000C -set AT91C_SPI0_RDR 0xFFFE0008 -set AT91C_SPI0_CSR 0xFFFE0030 -# ========== Register definition for PDC_US1 peripheral ========== -set AT91C_US1_RNCR 0xFFFC4114 -set AT91C_US1_PTCR 0xFFFC4120 -set AT91C_US1_TCR 0xFFFC410C -set AT91C_US1_PTSR 0xFFFC4124 -set AT91C_US1_TNPR 0xFFFC4118 -set AT91C_US1_RCR 0xFFFC4104 -set AT91C_US1_RNPR 0xFFFC4110 -set AT91C_US1_RPR 0xFFFC4100 -set AT91C_US1_TNCR 0xFFFC411C -set AT91C_US1_TPR 0xFFFC4108 -# ========== Register definition for US1 peripheral ========== -set AT91C_US1_IF 0xFFFC404C -set AT91C_US1_NER 0xFFFC4044 -set AT91C_US1_RTOR 0xFFFC4024 -set AT91C_US1_CSR 0xFFFC4014 -set AT91C_US1_IDR 0xFFFC400C -set AT91C_US1_IER 0xFFFC4008 -set AT91C_US1_THR 0xFFFC401C -set AT91C_US1_TTGR 0xFFFC4028 -set AT91C_US1_RHR 0xFFFC4018 -set AT91C_US1_BRGR 0xFFFC4020 -set AT91C_US1_IMR 0xFFFC4010 -set AT91C_US1_FIDI 0xFFFC4040 -set AT91C_US1_CR 0xFFFC4000 -set AT91C_US1_MR 0xFFFC4004 -# ========== Register definition for PDC_US0 peripheral ========== -set AT91C_US0_TNPR 0xFFFC0118 -set AT91C_US0_RNPR 0xFFFC0110 -set AT91C_US0_TCR 0xFFFC010C -set AT91C_US0_PTCR 0xFFFC0120 -set AT91C_US0_PTSR 0xFFFC0124 -set AT91C_US0_TNCR 0xFFFC011C -set AT91C_US0_TPR 0xFFFC0108 -set AT91C_US0_RCR 0xFFFC0104 -set AT91C_US0_RPR 0xFFFC0100 -set AT91C_US0_RNCR 0xFFFC0114 -# ========== Register definition for US0 peripheral ========== -set AT91C_US0_BRGR 0xFFFC0020 -set AT91C_US0_NER 0xFFFC0044 -set AT91C_US0_CR 0xFFFC0000 -set AT91C_US0_IMR 0xFFFC0010 -set AT91C_US0_FIDI 0xFFFC0040 -set AT91C_US0_TTGR 0xFFFC0028 -set AT91C_US0_MR 0xFFFC0004 -set AT91C_US0_RTOR 0xFFFC0024 -set AT91C_US0_CSR 0xFFFC0014 -set AT91C_US0_RHR 0xFFFC0018 -set AT91C_US0_IDR 0xFFFC000C -set AT91C_US0_THR 0xFFFC001C -set AT91C_US0_IF 0xFFFC004C -set AT91C_US0_IER 0xFFFC0008 -# ========== Register definition for PDC_SSC peripheral ========== -set AT91C_SSC_TNCR 0xFFFD411C -set AT91C_SSC_RPR 0xFFFD4100 -set AT91C_SSC_RNCR 0xFFFD4114 -set AT91C_SSC_TPR 0xFFFD4108 -set AT91C_SSC_PTCR 0xFFFD4120 -set AT91C_SSC_TCR 0xFFFD410C -set AT91C_SSC_RCR 0xFFFD4104 -set AT91C_SSC_RNPR 0xFFFD4110 -set AT91C_SSC_TNPR 0xFFFD4118 -set AT91C_SSC_PTSR 0xFFFD4124 -# ========== Register definition for SSC peripheral ========== -set AT91C_SSC_RHR 0xFFFD4020 -set AT91C_SSC_RSHR 0xFFFD4030 -set AT91C_SSC_TFMR 0xFFFD401C -set AT91C_SSC_IDR 0xFFFD4048 -set AT91C_SSC_THR 0xFFFD4024 -set AT91C_SSC_RCMR 0xFFFD4010 -set AT91C_SSC_IER 0xFFFD4044 -set AT91C_SSC_TSHR 0xFFFD4034 -set AT91C_SSC_SR 0xFFFD4040 -set AT91C_SSC_CMR 0xFFFD4004 -set AT91C_SSC_TCMR 0xFFFD4018 -set AT91C_SSC_CR 0xFFFD4000 -set AT91C_SSC_IMR 0xFFFD404C -set AT91C_SSC_RFMR 0xFFFD4014 -# ========== Register definition for TWI peripheral ========== -set AT91C_TWI_IER 0xFFFB8024 -set AT91C_TWI_CR 0xFFFB8000 -set AT91C_TWI_SR 0xFFFB8020 -set AT91C_TWI_IMR 0xFFFB802C -set AT91C_TWI_THR 0xFFFB8034 -set AT91C_TWI_IDR 0xFFFB8028 -set AT91C_TWI_IADR 0xFFFB800C -set AT91C_TWI_MMR 0xFFFB8004 -set AT91C_TWI_CWGR 0xFFFB8010 -set AT91C_TWI_RHR 0xFFFB8030 -# ========== Register definition for PWMC_CH3 peripheral ========== -set AT91C_PWMC_CH3_CUPDR 0xFFFCC270 -set AT91C_PWMC_CH3_Reserved 0xFFFCC274 -set AT91C_PWMC_CH3_CPRDR 0xFFFCC268 -set AT91C_PWMC_CH3_CDTYR 0xFFFCC264 -set AT91C_PWMC_CH3_CCNTR 0xFFFCC26C -set AT91C_PWMC_CH3_CMR 0xFFFCC260 -# ========== Register definition for PWMC_CH2 peripheral ========== -set AT91C_PWMC_CH2_Reserved 0xFFFCC254 -set AT91C_PWMC_CH2_CMR 0xFFFCC240 -set AT91C_PWMC_CH2_CCNTR 0xFFFCC24C -set AT91C_PWMC_CH2_CPRDR 0xFFFCC248 -set AT91C_PWMC_CH2_CUPDR 0xFFFCC250 -set AT91C_PWMC_CH2_CDTYR 0xFFFCC244 -# ========== Register definition for PWMC_CH1 peripheral ========== -set AT91C_PWMC_CH1_Reserved 0xFFFCC234 -set AT91C_PWMC_CH1_CUPDR 0xFFFCC230 -set AT91C_PWMC_CH1_CPRDR 0xFFFCC228 -set AT91C_PWMC_CH1_CCNTR 0xFFFCC22C -set AT91C_PWMC_CH1_CDTYR 0xFFFCC224 -set AT91C_PWMC_CH1_CMR 0xFFFCC220 -# ========== Register definition for PWMC_CH0 peripheral ========== -set AT91C_PWMC_CH0_Reserved 0xFFFCC214 -set AT91C_PWMC_CH0_CPRDR 0xFFFCC208 -set AT91C_PWMC_CH0_CDTYR 0xFFFCC204 -set AT91C_PWMC_CH0_CMR 0xFFFCC200 -set AT91C_PWMC_CH0_CUPDR 0xFFFCC210 -set AT91C_PWMC_CH0_CCNTR 0xFFFCC20C -# ========== Register definition for PWMC peripheral ========== -set AT91C_PWMC_IDR 0xFFFCC014 -set AT91C_PWMC_DIS 0xFFFCC008 -set AT91C_PWMC_IER 0xFFFCC010 -set AT91C_PWMC_VR 0xFFFCC0FC -set AT91C_PWMC_ISR 0xFFFCC01C -set AT91C_PWMC_SR 0xFFFCC00C -set AT91C_PWMC_IMR 0xFFFCC018 -set AT91C_PWMC_MR 0xFFFCC000 -set AT91C_PWMC_ENA 0xFFFCC004 -# ========== Register definition for UDP peripheral ========== -set AT91C_UDP_IMR 0xFFFB0018 -set AT91C_UDP_FADDR 0xFFFB0008 -set AT91C_UDP_NUM 0xFFFB0000 -set AT91C_UDP_FDR 0xFFFB0050 -set AT91C_UDP_ISR 0xFFFB001C -set AT91C_UDP_CSR 0xFFFB0030 -set AT91C_UDP_IDR 0xFFFB0014 -set AT91C_UDP_ICR 0xFFFB0020 -set AT91C_UDP_RSTEP 0xFFFB0028 -set AT91C_UDP_TXVC 0xFFFB0074 -set AT91C_UDP_GLBSTATE 0xFFFB0004 -set AT91C_UDP_IER 0xFFFB0010 -# ========== Register definition for TC0 peripheral ========== -set AT91C_TC0_SR 0xFFFA0020 -set AT91C_TC0_RC 0xFFFA001C -set AT91C_TC0_RB 0xFFFA0018 -set AT91C_TC0_CCR 0xFFFA0000 -set AT91C_TC0_CMR 0xFFFA0004 -set AT91C_TC0_IER 0xFFFA0024 -set AT91C_TC0_RA 0xFFFA0014 -set AT91C_TC0_IDR 0xFFFA0028 -set AT91C_TC0_CV 0xFFFA0010 -set AT91C_TC0_IMR 0xFFFA002C -# ========== Register definition for TC1 peripheral ========== -set AT91C_TC1_RB 0xFFFA0058 -set AT91C_TC1_CCR 0xFFFA0040 -set AT91C_TC1_IER 0xFFFA0064 -set AT91C_TC1_IDR 0xFFFA0068 -set AT91C_TC1_SR 0xFFFA0060 -set AT91C_TC1_CMR 0xFFFA0044 -set AT91C_TC1_RA 0xFFFA0054 -set AT91C_TC1_RC 0xFFFA005C -set AT91C_TC1_IMR 0xFFFA006C -set AT91C_TC1_CV 0xFFFA0050 -# ========== Register definition for TC2 peripheral ========== -set AT91C_TC2_CMR 0xFFFA0084 -set AT91C_TC2_CCR 0xFFFA0080 -set AT91C_TC2_CV 0xFFFA0090 -set AT91C_TC2_RA 0xFFFA0094 -set AT91C_TC2_RB 0xFFFA0098 -set AT91C_TC2_IDR 0xFFFA00A8 -set AT91C_TC2_IMR 0xFFFA00AC -set AT91C_TC2_RC 0xFFFA009C -set AT91C_TC2_IER 0xFFFA00A4 -set AT91C_TC2_SR 0xFFFA00A0 -# ========== Register definition for TCB peripheral ========== -set AT91C_TCB_BMR 0xFFFA00C4 -set AT91C_TCB_BCR 0xFFFA00C0 -# ========== Register definition for CAN_MB0 peripheral ========== -set AT91C_CAN_MB0_MDL 0xFFFD0214 -set AT91C_CAN_MB0_MAM 0xFFFD0204 -set AT91C_CAN_MB0_MCR 0xFFFD021C -set AT91C_CAN_MB0_MID 0xFFFD0208 -set AT91C_CAN_MB0_MSR 0xFFFD0210 -set AT91C_CAN_MB0_MFID 0xFFFD020C -set AT91C_CAN_MB0_MDH 0xFFFD0218 -set AT91C_CAN_MB0_MMR 0xFFFD0200 -# ========== Register definition for CAN_MB1 peripheral ========== -set AT91C_CAN_MB1_MDL 0xFFFD0234 -set AT91C_CAN_MB1_MID 0xFFFD0228 -set AT91C_CAN_MB1_MMR 0xFFFD0220 -set AT91C_CAN_MB1_MSR 0xFFFD0230 -set AT91C_CAN_MB1_MAM 0xFFFD0224 -set AT91C_CAN_MB1_MDH 0xFFFD0238 -set AT91C_CAN_MB1_MCR 0xFFFD023C -set AT91C_CAN_MB1_MFID 0xFFFD022C -# ========== Register definition for CAN_MB2 peripheral ========== -set AT91C_CAN_MB2_MCR 0xFFFD025C -set AT91C_CAN_MB2_MDH 0xFFFD0258 -set AT91C_CAN_MB2_MID 0xFFFD0248 -set AT91C_CAN_MB2_MDL 0xFFFD0254 -set AT91C_CAN_MB2_MMR 0xFFFD0240 -set AT91C_CAN_MB2_MAM 0xFFFD0244 -set AT91C_CAN_MB2_MFID 0xFFFD024C -set AT91C_CAN_MB2_MSR 0xFFFD0250 -# ========== Register definition for CAN_MB3 peripheral ========== -set AT91C_CAN_MB3_MFID 0xFFFD026C -set AT91C_CAN_MB3_MAM 0xFFFD0264 -set AT91C_CAN_MB3_MID 0xFFFD0268 -set AT91C_CAN_MB3_MCR 0xFFFD027C -set AT91C_CAN_MB3_MMR 0xFFFD0260 -set AT91C_CAN_MB3_MSR 0xFFFD0270 -set AT91C_CAN_MB3_MDL 0xFFFD0274 -set AT91C_CAN_MB3_MDH 0xFFFD0278 -# ========== Register definition for CAN_MB4 peripheral ========== -set AT91C_CAN_MB4_MID 0xFFFD0288 -set AT91C_CAN_MB4_MMR 0xFFFD0280 -set AT91C_CAN_MB4_MDH 0xFFFD0298 -set AT91C_CAN_MB4_MFID 0xFFFD028C -set AT91C_CAN_MB4_MSR 0xFFFD0290 -set AT91C_CAN_MB4_MCR 0xFFFD029C -set AT91C_CAN_MB4_MDL 0xFFFD0294 -set AT91C_CAN_MB4_MAM 0xFFFD0284 -# ========== Register definition for CAN_MB5 peripheral ========== -set AT91C_CAN_MB5_MSR 0xFFFD02B0 -set AT91C_CAN_MB5_MCR 0xFFFD02BC -set AT91C_CAN_MB5_MFID 0xFFFD02AC -set AT91C_CAN_MB5_MDH 0xFFFD02B8 -set AT91C_CAN_MB5_MID 0xFFFD02A8 -set AT91C_CAN_MB5_MMR 0xFFFD02A0 -set AT91C_CAN_MB5_MDL 0xFFFD02B4 -set AT91C_CAN_MB5_MAM 0xFFFD02A4 -# ========== Register definition for CAN_MB6 peripheral ========== -set AT91C_CAN_MB6_MFID 0xFFFD02CC -set AT91C_CAN_MB6_MID 0xFFFD02C8 -set AT91C_CAN_MB6_MAM 0xFFFD02C4 -set AT91C_CAN_MB6_MSR 0xFFFD02D0 -set AT91C_CAN_MB6_MDL 0xFFFD02D4 -set AT91C_CAN_MB6_MCR 0xFFFD02DC -set AT91C_CAN_MB6_MDH 0xFFFD02D8 -set AT91C_CAN_MB6_MMR 0xFFFD02C0 -# ========== Register definition for CAN_MB7 peripheral ========== -set AT91C_CAN_MB7_MCR 0xFFFD02FC -set AT91C_CAN_MB7_MDH 0xFFFD02F8 -set AT91C_CAN_MB7_MFID 0xFFFD02EC -set AT91C_CAN_MB7_MDL 0xFFFD02F4 -set AT91C_CAN_MB7_MID 0xFFFD02E8 -set AT91C_CAN_MB7_MMR 0xFFFD02E0 -set AT91C_CAN_MB7_MAM 0xFFFD02E4 -set AT91C_CAN_MB7_MSR 0xFFFD02F0 -# ========== Register definition for CAN peripheral ========== -set AT91C_CAN_TCR 0xFFFD0024 -set AT91C_CAN_IMR 0xFFFD000C -set AT91C_CAN_IER 0xFFFD0004 -set AT91C_CAN_ECR 0xFFFD0020 -set AT91C_CAN_TIMESTP 0xFFFD001C -set AT91C_CAN_MR 0xFFFD0000 -set AT91C_CAN_IDR 0xFFFD0008 -set AT91C_CAN_ACR 0xFFFD0028 -set AT91C_CAN_TIM 0xFFFD0018 -set AT91C_CAN_SR 0xFFFD0010 -set AT91C_CAN_BR 0xFFFD0014 -set AT91C_CAN_VR 0xFFFD00FC -# ========== Register definition for EMAC peripheral ========== -set AT91C_EMAC_ISR 0xFFFDC024 -set AT91C_EMAC_SA4H 0xFFFDC0B4 -set AT91C_EMAC_SA1L 0xFFFDC098 -set AT91C_EMAC_ELE 0xFFFDC078 -set AT91C_EMAC_LCOL 0xFFFDC05C -set AT91C_EMAC_RLE 0xFFFDC088 -set AT91C_EMAC_WOL 0xFFFDC0C4 -set AT91C_EMAC_DTF 0xFFFDC058 -set AT91C_EMAC_TUND 0xFFFDC064 -set AT91C_EMAC_NCR 0xFFFDC000 -set AT91C_EMAC_SA4L 0xFFFDC0B0 -set AT91C_EMAC_RSR 0xFFFDC020 -set AT91C_EMAC_SA3L 0xFFFDC0A8 -set AT91C_EMAC_TSR 0xFFFDC014 -set AT91C_EMAC_IDR 0xFFFDC02C -set AT91C_EMAC_RSE 0xFFFDC074 -set AT91C_EMAC_ECOL 0xFFFDC060 -set AT91C_EMAC_TID 0xFFFDC0B8 -set AT91C_EMAC_HRB 0xFFFDC090 -set AT91C_EMAC_TBQP 0xFFFDC01C -set AT91C_EMAC_USRIO 0xFFFDC0C0 -set AT91C_EMAC_PTR 0xFFFDC038 -set AT91C_EMAC_SA2H 0xFFFDC0A4 -set AT91C_EMAC_ROV 0xFFFDC070 -set AT91C_EMAC_ALE 0xFFFDC054 -set AT91C_EMAC_RJA 0xFFFDC07C -set AT91C_EMAC_RBQP 0xFFFDC018 -set AT91C_EMAC_TPF 0xFFFDC08C -set AT91C_EMAC_NCFGR 0xFFFDC004 -set AT91C_EMAC_HRT 0xFFFDC094 -set AT91C_EMAC_USF 0xFFFDC080 -set AT91C_EMAC_FCSE 0xFFFDC050 -set AT91C_EMAC_TPQ 0xFFFDC0BC -set AT91C_EMAC_MAN 0xFFFDC034 -set AT91C_EMAC_FTO 0xFFFDC040 -set AT91C_EMAC_REV 0xFFFDC0FC -set AT91C_EMAC_IMR 0xFFFDC030 -set AT91C_EMAC_SCF 0xFFFDC044 -set AT91C_EMAC_PFR 0xFFFDC03C -set AT91C_EMAC_MCF 0xFFFDC048 -set AT91C_EMAC_NSR 0xFFFDC008 -set AT91C_EMAC_SA2L 0xFFFDC0A0 -set AT91C_EMAC_FRO 0xFFFDC04C -set AT91C_EMAC_IER 0xFFFDC028 -set AT91C_EMAC_SA1H 0xFFFDC09C -set AT91C_EMAC_CSE 0xFFFDC068 -set AT91C_EMAC_SA3H 0xFFFDC0AC -set AT91C_EMAC_RRE 0xFFFDC06C -set AT91C_EMAC_STE 0xFFFDC084 -# ========== Register definition for PDC_ADC peripheral ========== -set AT91C_ADC_PTSR 0xFFFD8124 -set AT91C_ADC_PTCR 0xFFFD8120 -set AT91C_ADC_TNPR 0xFFFD8118 -set AT91C_ADC_TNCR 0xFFFD811C -set AT91C_ADC_RNPR 0xFFFD8110 -set AT91C_ADC_RNCR 0xFFFD8114 -set AT91C_ADC_RPR 0xFFFD8100 -set AT91C_ADC_TCR 0xFFFD810C -set AT91C_ADC_TPR 0xFFFD8108 -set AT91C_ADC_RCR 0xFFFD8104 -# ========== Register definition for ADC peripheral ========== -set AT91C_ADC_CDR2 0xFFFD8038 -set AT91C_ADC_CDR3 0xFFFD803C -set AT91C_ADC_CDR0 0xFFFD8030 -set AT91C_ADC_CDR5 0xFFFD8044 -set AT91C_ADC_CHDR 0xFFFD8014 -set AT91C_ADC_SR 0xFFFD801C -set AT91C_ADC_CDR4 0xFFFD8040 -set AT91C_ADC_CDR1 0xFFFD8034 -set AT91C_ADC_LCDR 0xFFFD8020 -set AT91C_ADC_IDR 0xFFFD8028 -set AT91C_ADC_CR 0xFFFD8000 -set AT91C_ADC_CDR7 0xFFFD804C -set AT91C_ADC_CDR6 0xFFFD8048 -set AT91C_ADC_IER 0xFFFD8024 -set AT91C_ADC_CHER 0xFFFD8010 -set AT91C_ADC_CHSR 0xFFFD8018 -set AT91C_ADC_MR 0xFFFD8004 -set AT91C_ADC_IMR 0xFFFD802C - -# ***************************************************************************** -# BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 -# ***************************************************************************** -set AT91C_BASE_SYS 0xFFFFF000 -set AT91C_BASE_AIC 0xFFFFF000 -set AT91C_BASE_PDC_DBGU 0xFFFFF300 -set AT91C_BASE_DBGU 0xFFFFF200 -set AT91C_BASE_PIOA 0xFFFFF400 -set AT91C_BASE_PIOB 0xFFFFF600 -set AT91C_BASE_CKGR 0xFFFFFC20 -set AT91C_BASE_PMC 0xFFFFFC00 -set AT91C_BASE_RSTC 0xFFFFFD00 -set AT91C_BASE_RTTC 0xFFFFFD20 -set AT91C_BASE_PITC 0xFFFFFD30 -set AT91C_BASE_WDTC 0xFFFFFD40 -set AT91C_BASE_VREG 0xFFFFFD60 -set AT91C_BASE_MC 0xFFFFFF00 -set AT91C_BASE_PDC_SPI1 0xFFFE4100 -set AT91C_BASE_SPI1 0xFFFE4000 -set AT91C_BASE_PDC_SPI0 0xFFFE0100 -set AT91C_BASE_SPI0 0xFFFE0000 -set AT91C_BASE_PDC_US1 0xFFFC4100 -set AT91C_BASE_US1 0xFFFC4000 -set AT91C_BASE_PDC_US0 0xFFFC0100 -set AT91C_BASE_US0 0xFFFC0000 -set AT91C_BASE_PDC_SSC 0xFFFD4100 -set AT91C_BASE_SSC 0xFFFD4000 -set AT91C_BASE_TWI 0xFFFB8000 -set AT91C_BASE_PWMC_CH3 0xFFFCC260 -set AT91C_BASE_PWMC_CH2 0xFFFCC240 -set AT91C_BASE_PWMC_CH1 0xFFFCC220 -set AT91C_BASE_PWMC_CH0 0xFFFCC200 -set AT91C_BASE_PWMC 0xFFFCC000 -set AT91C_BASE_UDP 0xFFFB0000 -set AT91C_BASE_TC0 0xFFFA0000 -set AT91C_BASE_TC1 0xFFFA0040 -set AT91C_BASE_TC2 0xFFFA0080 -set AT91C_BASE_TCB 0xFFFA0000 -set AT91C_BASE_CAN_MB0 0xFFFD0200 -set AT91C_BASE_CAN_MB1 0xFFFD0220 -set AT91C_BASE_CAN_MB2 0xFFFD0240 -set AT91C_BASE_CAN_MB3 0xFFFD0260 -set AT91C_BASE_CAN_MB4 0xFFFD0280 -set AT91C_BASE_CAN_MB5 0xFFFD02A0 -set AT91C_BASE_CAN_MB6 0xFFFD02C0 -set AT91C_BASE_CAN_MB7 0xFFFD02E0 -set AT91C_BASE_CAN 0xFFFD0000 -set AT91C_BASE_EMAC 0xFFFDC000 -set AT91C_BASE_PDC_ADC 0xFFFD8100 -set AT91C_BASE_ADC 0xFFFD8000 - -# ***************************************************************************** -# PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 -# ***************************************************************************** -set AT91C_ID_FIQ 0 -set AT91C_ID_SYS 1 -set AT91C_ID_PIOA 2 -set AT91C_ID_PIOB 3 -set AT91C_ID_SPI0 4 -set AT91C_ID_SPI1 5 -set AT91C_ID_US0 6 -set AT91C_ID_US1 7 -set AT91C_ID_SSC 8 -set AT91C_ID_TWI 9 -set AT91C_ID_PWMC 10 -set AT91C_ID_UDP 11 -set AT91C_ID_TC0 12 -set AT91C_ID_TC1 13 -set AT91C_ID_TC2 14 -set AT91C_ID_CAN 15 -set AT91C_ID_EMAC 16 -set AT91C_ID_ADC 17 -set AT91C_ID_18_Reserved 18 -set AT91C_ID_19_Reserved 19 -set AT91C_ID_20_Reserved 20 -set AT91C_ID_21_Reserved 21 -set AT91C_ID_22_Reserved 22 -set AT91C_ID_23_Reserved 23 -set AT91C_ID_24_Reserved 24 -set AT91C_ID_25_Reserved 25 -set AT91C_ID_26_Reserved 26 -set AT91C_ID_27_Reserved 27 -set AT91C_ID_28_Reserved 28 -set AT91C_ID_29_Reserved 29 -set AT91C_ID_IRQ0 30 -set AT91C_ID_IRQ1 31 - -# ***************************************************************************** -# PIO DEFINITIONS FOR AT91SAM7X256 -# ***************************************************************************** -set AT91C_PIO_PA0 [expr 1 << 0 ] -set AT91C_PA0_RXD0 $AT91C_PIO_PA0 -set AT91C_PIO_PA1 [expr 1 << 1 ] -set AT91C_PA1_TXD0 $AT91C_PIO_PA1 -set AT91C_PIO_PA10 [expr 1 << 10 ] -set AT91C_PA10_TWD $AT91C_PIO_PA10 -set AT91C_PIO_PA11 [expr 1 << 11 ] -set AT91C_PA11_TWCK $AT91C_PIO_PA11 -set AT91C_PIO_PA12 [expr 1 << 12 ] -set AT91C_PA12_SPI0_NPCS0 $AT91C_PIO_PA12 -set AT91C_PIO_PA13 [expr 1 << 13 ] -set AT91C_PA13_SPI0_NPCS1 $AT91C_PIO_PA13 -set AT91C_PA13_PCK1 $AT91C_PIO_PA13 -set AT91C_PIO_PA14 [expr 1 << 14 ] -set AT91C_PA14_SPI0_NPCS2 $AT91C_PIO_PA14 -set AT91C_PA14_IRQ1 $AT91C_PIO_PA14 -set AT91C_PIO_PA15 [expr 1 << 15 ] -set AT91C_PA15_SPI0_NPCS3 $AT91C_PIO_PA15 -set AT91C_PA15_TCLK2 $AT91C_PIO_PA15 -set AT91C_PIO_PA16 [expr 1 << 16 ] -set AT91C_PA16_SPI0_MISO $AT91C_PIO_PA16 -set AT91C_PIO_PA17 [expr 1 << 17 ] -set AT91C_PA17_SPI0_MOSI $AT91C_PIO_PA17 -set AT91C_PIO_PA18 [expr 1 << 18 ] -set AT91C_PA18_SPI0_SPCK $AT91C_PIO_PA18 -set AT91C_PIO_PA19 [expr 1 << 19 ] -set AT91C_PA19_CANRX $AT91C_PIO_PA19 -set AT91C_PIO_PA2 [expr 1 << 2 ] -set AT91C_PA2_SCK0 $AT91C_PIO_PA2 -set AT91C_PA2_SPI1_NPCS1 $AT91C_PIO_PA2 -set AT91C_PIO_PA20 [expr 1 << 20 ] -set AT91C_PA20_CANTX $AT91C_PIO_PA20 -set AT91C_PIO_PA21 [expr 1 << 21 ] -set AT91C_PA21_TF $AT91C_PIO_PA21 -set AT91C_PA21_SPI1_NPCS0 $AT91C_PIO_PA21 -set AT91C_PIO_PA22 [expr 1 << 22 ] -set AT91C_PA22_TK $AT91C_PIO_PA22 -set AT91C_PA22_SPI1_SPCK $AT91C_PIO_PA22 -set AT91C_PIO_PA23 [expr 1 << 23 ] -set AT91C_PA23_TD $AT91C_PIO_PA23 -set AT91C_PA23_SPI1_MOSI $AT91C_PIO_PA23 -set AT91C_PIO_PA24 [expr 1 << 24 ] -set AT91C_PA24_RD $AT91C_PIO_PA24 -set AT91C_PA24_SPI1_MISO $AT91C_PIO_PA24 -set AT91C_PIO_PA25 [expr 1 << 25 ] -set AT91C_PA25_RK $AT91C_PIO_PA25 -set AT91C_PA25_SPI1_NPCS1 $AT91C_PIO_PA25 -set AT91C_PIO_PA26 [expr 1 << 26 ] -set AT91C_PA26_RF $AT91C_PIO_PA26 -set AT91C_PA26_SPI1_NPCS2 $AT91C_PIO_PA26 -set AT91C_PIO_PA27 [expr 1 << 27 ] -set AT91C_PA27_DRXD $AT91C_PIO_PA27 -set AT91C_PA27_PCK3 $AT91C_PIO_PA27 -set AT91C_PIO_PA28 [expr 1 << 28 ] -set AT91C_PA28_DTXD $AT91C_PIO_PA28 -set AT91C_PIO_PA29 [expr 1 << 29 ] -set AT91C_PA29_FIQ $AT91C_PIO_PA29 -set AT91C_PA29_SPI1_NPCS3 $AT91C_PIO_PA29 -set AT91C_PIO_PA3 [expr 1 << 3 ] -set AT91C_PA3_RTS0 $AT91C_PIO_PA3 -set AT91C_PA3_SPI1_NPCS2 $AT91C_PIO_PA3 -set AT91C_PIO_PA30 [expr 1 << 30 ] -set AT91C_PA30_IRQ0 $AT91C_PIO_PA30 -set AT91C_PA30_PCK2 $AT91C_PIO_PA30 -set AT91C_PIO_PA4 [expr 1 << 4 ] -set AT91C_PA4_CTS0 $AT91C_PIO_PA4 -set AT91C_PA4_SPI1_NPCS3 $AT91C_PIO_PA4 -set AT91C_PIO_PA5 [expr 1 << 5 ] -set AT91C_PA5_RXD1 $AT91C_PIO_PA5 -set AT91C_PIO_PA6 [expr 1 << 6 ] -set AT91C_PA6_TXD1 $AT91C_PIO_PA6 -set AT91C_PIO_PA7 [expr 1 << 7 ] -set AT91C_PA7_SCK1 $AT91C_PIO_PA7 -set AT91C_PA7_SPI0_NPCS1 $AT91C_PIO_PA7 -set AT91C_PIO_PA8 [expr 1 << 8 ] -set AT91C_PA8_RTS1 $AT91C_PIO_PA8 -set AT91C_PA8_SPI0_NPCS2 $AT91C_PIO_PA8 -set AT91C_PIO_PA9 [expr 1 << 9 ] -set AT91C_PA9_CTS1 $AT91C_PIO_PA9 -set AT91C_PA9_SPI0_NPCS3 $AT91C_PIO_PA9 -set AT91C_PIO_PB0 [expr 1 << 0 ] -set AT91C_PB0_ETXCK_EREFCK $AT91C_PIO_PB0 -set AT91C_PB0_PCK0 $AT91C_PIO_PB0 -set AT91C_PIO_PB1 [expr 1 << 1 ] -set AT91C_PB1_ETXEN $AT91C_PIO_PB1 -set AT91C_PIO_PB10 [expr 1 << 10 ] -set AT91C_PB10_ETX2 $AT91C_PIO_PB10 -set AT91C_PB10_SPI1_NPCS1 $AT91C_PIO_PB10 -set AT91C_PIO_PB11 [expr 1 << 11 ] -set AT91C_PB11_ETX3 $AT91C_PIO_PB11 -set AT91C_PB11_SPI1_NPCS2 $AT91C_PIO_PB11 -set AT91C_PIO_PB12 [expr 1 << 12 ] -set AT91C_PB12_ETXER $AT91C_PIO_PB12 -set AT91C_PB12_TCLK0 $AT91C_PIO_PB12 -set AT91C_PIO_PB13 [expr 1 << 13 ] -set AT91C_PB13_ERX2 $AT91C_PIO_PB13 -set AT91C_PB13_SPI0_NPCS1 $AT91C_PIO_PB13 -set AT91C_PIO_PB14 [expr 1 << 14 ] -set AT91C_PB14_ERX3 $AT91C_PIO_PB14 -set AT91C_PB14_SPI0_NPCS2 $AT91C_PIO_PB14 -set AT91C_PIO_PB15 [expr 1 << 15 ] -set AT91C_PB15_ERXDV_ECRSDV $AT91C_PIO_PB15 -set AT91C_PIO_PB16 [expr 1 << 16 ] -set AT91C_PB16_ECOL $AT91C_PIO_PB16 -set AT91C_PB16_SPI1_NPCS3 $AT91C_PIO_PB16 -set AT91C_PIO_PB17 [expr 1 << 17 ] -set AT91C_PB17_ERXCK $AT91C_PIO_PB17 -set AT91C_PB17_SPI0_NPCS3 $AT91C_PIO_PB17 -set AT91C_PIO_PB18 [expr 1 << 18 ] -set AT91C_PB18_EF100 $AT91C_PIO_PB18 -set AT91C_PB18_ADTRG $AT91C_PIO_PB18 -set AT91C_PIO_PB19 [expr 1 << 19 ] -set AT91C_PB19_PWM0 $AT91C_PIO_PB19 -set AT91C_PB19_TCLK1 $AT91C_PIO_PB19 -set AT91C_PIO_PB2 [expr 1 << 2 ] -set AT91C_PB2_ETX0 $AT91C_PIO_PB2 -set AT91C_PIO_PB20 [expr 1 << 20 ] -set AT91C_PB20_PWM1 $AT91C_PIO_PB20 -set AT91C_PB20_PCK0 $AT91C_PIO_PB20 -set AT91C_PIO_PB21 [expr 1 << 21 ] -set AT91C_PB21_PWM2 $AT91C_PIO_PB21 -set AT91C_PB21_PCK1 $AT91C_PIO_PB21 -set AT91C_PIO_PB22 [expr 1 << 22 ] -set AT91C_PB22_PWM3 $AT91C_PIO_PB22 -set AT91C_PB22_PCK2 $AT91C_PIO_PB22 -set AT91C_PIO_PB23 [expr 1 << 23 ] -set AT91C_PB23_TIOA0 $AT91C_PIO_PB23 -set AT91C_PB23_DCD1 $AT91C_PIO_PB23 -set AT91C_PIO_PB24 [expr 1 << 24 ] -set AT91C_PB24_TIOB0 $AT91C_PIO_PB24 -set AT91C_PB24_DSR1 $AT91C_PIO_PB24 -set AT91C_PIO_PB25 [expr 1 << 25 ] -set AT91C_PB25_TIOA1 $AT91C_PIO_PB25 -set AT91C_PB25_DTR1 $AT91C_PIO_PB25 -set AT91C_PIO_PB26 [expr 1 << 26 ] -set AT91C_PB26_TIOB1 $AT91C_PIO_PB26 -set AT91C_PB26_RI1 $AT91C_PIO_PB26 -set AT91C_PIO_PB27 [expr 1 << 27 ] -set AT91C_PB27_TIOA2 $AT91C_PIO_PB27 -set AT91C_PB27_PWM0 $AT91C_PIO_PB27 -set AT91C_PIO_PB28 [expr 1 << 28 ] -set AT91C_PB28_TIOB2 $AT91C_PIO_PB28 -set AT91C_PB28_PWM1 $AT91C_PIO_PB28 -set AT91C_PIO_PB29 [expr 1 << 29 ] -set AT91C_PB29_PCK1 $AT91C_PIO_PB29 -set AT91C_PB29_PWM2 $AT91C_PIO_PB29 -set AT91C_PIO_PB3 [expr 1 << 3 ] -set AT91C_PB3_ETX1 $AT91C_PIO_PB3 -set AT91C_PIO_PB30 [expr 1 << 30 ] -set AT91C_PB30_PCK2 $AT91C_PIO_PB30 -set AT91C_PB30_PWM3 $AT91C_PIO_PB30 -set AT91C_PIO_PB4 [expr 1 << 4 ] -set AT91C_PB4_ECRS $AT91C_PIO_PB4 -set AT91C_PIO_PB5 [expr 1 << 5 ] -set AT91C_PB5_ERX0 $AT91C_PIO_PB5 -set AT91C_PIO_PB6 [expr 1 << 6 ] -set AT91C_PB6_ERX1 $AT91C_PIO_PB6 -set AT91C_PIO_PB7 [expr 1 << 7 ] -set AT91C_PB7_ERXER $AT91C_PIO_PB7 -set AT91C_PIO_PB8 [expr 1 << 8 ] -set AT91C_PB8_EMDC $AT91C_PIO_PB8 -set AT91C_PIO_PB9 [expr 1 << 9 ] -set AT91C_PB9_EMDIO $AT91C_PIO_PB9 - -# ***************************************************************************** -# MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 -# ***************************************************************************** -set AT91C_ISRAM 0x00200000 -set AT91C_ISRAM_SIZE 0x00010000 -set AT91C_IFLASH 0x00100000 -set AT91C_IFLASH_SIZE 0x00040000 - - -# ***************************************************************************** -# ATTRIBUTES DEFINITIONS FOR AT91SAM7X256 -# ***************************************************************************** -array set AT91SAM7X256_att { - DBGU { LP DBGU_att } - PMC { LP PMC_att } - VREG { LP VREG_att } - RSTC { LP RSTC_att } - SSC { LP SSC_att } - WDTC { LP WDTC_att } - USART { LP US1_att US0_att } - SPI { LP SPI1_att SPI0_att } - PITC { LP PITC_att } - TCB { LP TCB_att } - CKGR { LP CKGR_att } - AIC { LP AIC_att } - TWI { LP TWI_att } - ADC { LP ADC_att } - PWMC_CH { LP PWMC_CH3_att PWMC_CH2_att PWMC_CH1_att PWMC_CH0_att } - RTTC { LP RTTC_att } - UDP { LP UDP_att } - EMAC { LP EMAC_att } - CAN_MB { LP CAN_MB0_att CAN_MB1_att CAN_MB2_att CAN_MB3_att CAN_MB4_att CAN_MB5_att CAN_MB6_att CAN_MB7_att } - TC { LP TC0_att TC1_att TC2_att } - SYS { LP SYS_att } - MC { LP MC_att } - PIO { LP PIOA_att PIOB_att } - CAN { LP CAN_att } - PWMC { LP PWMC_att } - PDC { LP PDC_DBGU_att PDC_SPI1_att PDC_SPI0_att PDC_US1_att PDC_US0_att PDC_SSC_att PDC_ADC_att } - -} -# ========== Peripheral attributes for DBGU peripheral ========== -array set DBGU_att { - EXID { R AT91C_DBGU_EXID RO } - BRGR { R AT91C_DBGU_BRGR RW } - IDR { R AT91C_DBGU_IDR WO } - CSR { R AT91C_DBGU_CSR RO } - CIDR { R AT91C_DBGU_CIDR RO } - MR { R AT91C_DBGU_MR RW } - IMR { R AT91C_DBGU_IMR RO } - CR { R AT91C_DBGU_CR WO } - FNTR { R AT91C_DBGU_FNTR RW } - THR { R AT91C_DBGU_THR WO } - RHR { R AT91C_DBGU_RHR RO } - IER { R AT91C_DBGU_IER WO } - listeReg { EXID BRGR IDR CSR CIDR MR IMR CR FNTR THR RHR IER } - -} - -# ========== Peripheral attributes for PMC peripheral ========== -array set PMC_att { - IDR { R AT91C_PMC_IDR WO } - MOR { R AT91C_PMC_MOR RW } - PLLR { R AT91C_PMC_PLLR RW } - PCER { R AT91C_PMC_PCER WO } - PCKR { R AT91C_PMC_PCKR RW } - MCKR { R AT91C_PMC_MCKR RW } - SCDR { R AT91C_PMC_SCDR WO } - PCDR { R AT91C_PMC_PCDR WO } - SCSR { R AT91C_PMC_SCSR RO } - PCSR { R AT91C_PMC_PCSR RO } - MCFR { R AT91C_PMC_MCFR RO } - SCER { R AT91C_PMC_SCER WO } - IMR { R AT91C_PMC_IMR RO } - IER { R AT91C_PMC_IER WO } - SR { R AT91C_PMC_SR RO } - listeReg { IDR MOR PLLR PCER PCKR MCKR SCDR PCDR SCSR PCSR MCFR SCER IMR IER SR } - -} - -# ========== Peripheral attributes for VREG peripheral ========== -array set VREG_att { - MR { R AT91C_VREG_MR RW } - listeReg { MR } - -} - -# ========== Peripheral attributes for RSTC peripheral ========== -array set RSTC_att { - RCR { R AT91C_RSTC_RCR WO } - RMR { R AT91C_RSTC_RMR RW } - RSR { R AT91C_RSTC_RSR RO } - listeReg { RCR RMR RSR } - -} - -# ========== Peripheral attributes for SSC peripheral ========== -array set SSC_att { - RHR { R AT91C_SSC_RHR RO } - RSHR { R AT91C_SSC_RSHR RO } - TFMR { R AT91C_SSC_TFMR RW } - IDR { R AT91C_SSC_IDR WO } - THR { R AT91C_SSC_THR WO } - RCMR { R AT91C_SSC_RCMR RW } - IER { R AT91C_SSC_IER WO } - TSHR { R AT91C_SSC_TSHR RW } - SR { R AT91C_SSC_SR RO } - CMR { R AT91C_SSC_CMR RW } - TCMR { R AT91C_SSC_TCMR RW } - CR { R AT91C_SSC_CR WO } - IMR { R AT91C_SSC_IMR RO } - RFMR { R AT91C_SSC_RFMR RW } - listeReg { RHR RSHR TFMR IDR THR RCMR IER TSHR SR CMR TCMR CR IMR RFMR } - -} - -# ========== Peripheral attributes for WDTC peripheral ========== -array set WDTC_att { - WDCR { R AT91C_WDTC_WDCR WO } - WDSR { R AT91C_WDTC_WDSR RO } - WDMR { R AT91C_WDTC_WDMR RW } - listeReg { WDCR WDSR WDMR } - -} - -# ========== Peripheral attributes for USART peripheral ========== -array set US1_att { - IF { R AT91C_US1_IF RW } - NER { R AT91C_US1_NER RO } - RTOR { R AT91C_US1_RTOR RW } - CSR { R AT91C_US1_CSR RO } - IDR { R AT91C_US1_IDR WO } - IER { R AT91C_US1_IER WO } - THR { R AT91C_US1_THR WO } - TTGR { R AT91C_US1_TTGR RW } - RHR { R AT91C_US1_RHR RO } - BRGR { R AT91C_US1_BRGR RW } - IMR { R AT91C_US1_IMR RO } - FIDI { R AT91C_US1_FIDI RW } - CR { R AT91C_US1_CR WO } - MR { R AT91C_US1_MR RW } - listeReg { IF NER RTOR CSR IDR IER THR TTGR RHR BRGR IMR FIDI CR MR } - -} -array set US0_att { - BRGR { R AT91C_US0_BRGR RW } - NER { R AT91C_US0_NER RO } - CR { R AT91C_US0_CR WO } - IMR { R AT91C_US0_IMR RO } - FIDI { R AT91C_US0_FIDI RW } - TTGR { R AT91C_US0_TTGR RW } - MR { R AT91C_US0_MR RW } - RTOR { R AT91C_US0_RTOR RW } - CSR { R AT91C_US0_CSR RO } - RHR { R AT91C_US0_RHR RO } - IDR { R AT91C_US0_IDR WO } - THR { R AT91C_US0_THR WO } - IF { R AT91C_US0_IF RW } - IER { R AT91C_US0_IER WO } - listeReg { BRGR NER CR IMR FIDI TTGR MR RTOR CSR RHR IDR THR IF IER } - -} - -# ========== Peripheral attributes for SPI peripheral ========== -array set SPI1_att { - IMR { R AT91C_SPI1_IMR RO } - IER { R AT91C_SPI1_IER WO } - MR { R AT91C_SPI1_MR RW } - RDR { R AT91C_SPI1_RDR RO } - IDR { R AT91C_SPI1_IDR WO } - SR { R AT91C_SPI1_SR RO } - TDR { R AT91C_SPI1_TDR WO } - CR { R AT91C_SPI1_CR RO } - CSR { R AT91C_SPI1_CSR RW } - listeReg { IMR IER MR RDR IDR SR TDR CR CSR } - -} -array set SPI0_att { - IER { R AT91C_SPI0_IER WO } - SR { R AT91C_SPI0_SR RO } - IDR { R AT91C_SPI0_IDR WO } - CR { R AT91C_SPI0_CR RO } - MR { R AT91C_SPI0_MR RW } - IMR { R AT91C_SPI0_IMR RO } - TDR { R AT91C_SPI0_TDR WO } - RDR { R AT91C_SPI0_RDR RO } - CSR { R AT91C_SPI0_CSR RW } - listeReg { IER SR IDR CR MR IMR TDR RDR CSR } - -} - -# ========== Peripheral attributes for PITC peripheral ========== -array set PITC_att { - PIVR { R AT91C_PITC_PIVR RO } - PISR { R AT91C_PITC_PISR RO } - PIIR { R AT91C_PITC_PIIR RO } - PIMR { R AT91C_PITC_PIMR RW } - listeReg { PIVR PISR PIIR PIMR } - -} - -# ========== Peripheral attributes for TCB peripheral ========== -array set TCB_att { - BMR { R AT91C_TCB_BMR RW } - BCR { R AT91C_TCB_BCR WO } - listeReg { BMR BCR } - -} - -# ========== Peripheral attributes for CKGR peripheral ========== -array set CKGR_att { - MOR { R AT91C_CKGR_MOR RW } - PLLR { R AT91C_CKGR_PLLR RW } - MCFR { R AT91C_CKGR_MCFR RO } - listeReg { MOR PLLR MCFR } - -} - -# ========== Peripheral attributes for AIC peripheral ========== -array set AIC_att { - IVR { R AT91C_AIC_IVR RO } - SMR { R AT91C_AIC_SMR RW } - FVR { R AT91C_AIC_FVR RO } - DCR { R AT91C_AIC_DCR RW } - EOICR { R AT91C_AIC_EOICR WO } - SVR { R AT91C_AIC_SVR RW } - FFSR { R AT91C_AIC_FFSR RO } - ICCR { R AT91C_AIC_ICCR WO } - ISR { R AT91C_AIC_ISR RO } - IMR { R AT91C_AIC_IMR RO } - IPR { R AT91C_AIC_IPR RO } - FFER { R AT91C_AIC_FFER WO } - IECR { R AT91C_AIC_IECR WO } - ISCR { R AT91C_AIC_ISCR WO } - FFDR { R AT91C_AIC_FFDR WO } - CISR { R AT91C_AIC_CISR RO } - IDCR { R AT91C_AIC_IDCR WO } - SPU { R AT91C_AIC_SPU RW } - listeReg { IVR SMR FVR DCR EOICR SVR FFSR ICCR ISR IMR IPR FFER IECR ISCR FFDR CISR IDCR SPU } - -} - -# ========== Peripheral attributes for TWI peripheral ========== -array set TWI_att { - IER { R AT91C_TWI_IER WO } - CR { R AT91C_TWI_CR WO } - SR { R AT91C_TWI_SR RO } - IMR { R AT91C_TWI_IMR RO } - THR { R AT91C_TWI_THR WO } - IDR { R AT91C_TWI_IDR WO } - IADR { R AT91C_TWI_IADR RW } - MMR { R AT91C_TWI_MMR RW } - CWGR { R AT91C_TWI_CWGR RW } - RHR { R AT91C_TWI_RHR RO } - listeReg { IER CR SR IMR THR IDR IADR MMR CWGR RHR } - -} - -# ========== Peripheral attributes for ADC peripheral ========== -array set ADC_att { - CDR2 { R AT91C_ADC_CDR2 RO } - CDR3 { R AT91C_ADC_CDR3 RO } - CDR0 { R AT91C_ADC_CDR0 RO } - CDR5 { R AT91C_ADC_CDR5 RO } - CHDR { R AT91C_ADC_CHDR WO } - SR { R AT91C_ADC_SR RO } - CDR4 { R AT91C_ADC_CDR4 RO } - CDR1 { R AT91C_ADC_CDR1 RO } - LCDR { R AT91C_ADC_LCDR RO } - IDR { R AT91C_ADC_IDR WO } - CR { R AT91C_ADC_CR WO } - CDR7 { R AT91C_ADC_CDR7 RO } - CDR6 { R AT91C_ADC_CDR6 RO } - IER { R AT91C_ADC_IER WO } - CHER { R AT91C_ADC_CHER WO } - CHSR { R AT91C_ADC_CHSR RO } - MR { R AT91C_ADC_MR RW } - IMR { R AT91C_ADC_IMR RO } - listeReg { CDR2 CDR3 CDR0 CDR5 CHDR SR CDR4 CDR1 LCDR IDR CR CDR7 CDR6 IER CHER CHSR MR IMR } - -} - -# ========== Peripheral attributes for PWMC_CH peripheral ========== -array set PWMC_CH3_att { - CUPDR { R AT91C_PWMC_CH3_CUPDR WO } - Reserved { R AT91C_PWMC_CH3_Reserved WO } - CPRDR { R AT91C_PWMC_CH3_CPRDR RW } - CDTYR { R AT91C_PWMC_CH3_CDTYR RW } - CCNTR { R AT91C_PWMC_CH3_CCNTR RO } - CMR { R AT91C_PWMC_CH3_CMR RW } - listeReg { CUPDR Reserved CPRDR CDTYR CCNTR CMR } - -} -array set PWMC_CH2_att { - Reserved { R AT91C_PWMC_CH2_Reserved WO } - CMR { R AT91C_PWMC_CH2_CMR RW } - CCNTR { R AT91C_PWMC_CH2_CCNTR RO } - CPRDR { R AT91C_PWMC_CH2_CPRDR RW } - CUPDR { R AT91C_PWMC_CH2_CUPDR WO } - CDTYR { R AT91C_PWMC_CH2_CDTYR RW } - listeReg { Reserved CMR CCNTR CPRDR CUPDR CDTYR } - -} -array set PWMC_CH1_att { - Reserved { R AT91C_PWMC_CH1_Reserved WO } - CUPDR { R AT91C_PWMC_CH1_CUPDR WO } - CPRDR { R AT91C_PWMC_CH1_CPRDR RW } - CCNTR { R AT91C_PWMC_CH1_CCNTR RO } - CDTYR { R AT91C_PWMC_CH1_CDTYR RW } - CMR { R AT91C_PWMC_CH1_CMR RW } - listeReg { Reserved CUPDR CPRDR CCNTR CDTYR CMR } - -} -array set PWMC_CH0_att { - Reserved { R AT91C_PWMC_CH0_Reserved WO } - CPRDR { R AT91C_PWMC_CH0_CPRDR RW } - CDTYR { R AT91C_PWMC_CH0_CDTYR RW } - CMR { R AT91C_PWMC_CH0_CMR RW } - CUPDR { R AT91C_PWMC_CH0_CUPDR WO } - CCNTR { R AT91C_PWMC_CH0_CCNTR RO } - listeReg { Reserved CPRDR CDTYR CMR CUPDR CCNTR } - -} - -# ========== Peripheral attributes for RTTC peripheral ========== -array set RTTC_att { - RTSR { R AT91C_RTTC_RTSR RO } - RTMR { R AT91C_RTTC_RTMR RW } - RTVR { R AT91C_RTTC_RTVR RO } - RTAR { R AT91C_RTTC_RTAR RW } - listeReg { RTSR RTMR RTVR RTAR } - -} - -# ========== Peripheral attributes for UDP peripheral ========== -array set UDP_att { - IMR { R AT91C_UDP_IMR RO } - FADDR { R AT91C_UDP_FADDR RW } - NUM { R AT91C_UDP_NUM RO } - FDR { R AT91C_UDP_FDR RW } - ISR { R AT91C_UDP_ISR RO } - CSR { R AT91C_UDP_CSR RW } - IDR { R AT91C_UDP_IDR WO } - ICR { R AT91C_UDP_ICR RO } - RSTEP { R AT91C_UDP_RSTEP RO } - TXVC { R AT91C_UDP_TXVC RW } - GLBSTATE { R AT91C_UDP_GLBSTATE RW } - IER { R AT91C_UDP_IER WO } - listeReg { IMR FADDR NUM FDR ISR CSR IDR ICR RSTEP TXVC GLBSTATE IER } - -} - -# ========== Peripheral attributes for EMAC peripheral ========== -array set EMAC_att { - ISR { R AT91C_EMAC_ISR RW } - SA4H { R AT91C_EMAC_SA4H RW } - SA1L { R AT91C_EMAC_SA1L RW } - ELE { R AT91C_EMAC_ELE RW } - LCOL { R AT91C_EMAC_LCOL RW } - RLE { R AT91C_EMAC_RLE RW } - WOL { R AT91C_EMAC_WOL RW } - DTF { R AT91C_EMAC_DTF RW } - TUND { R AT91C_EMAC_TUND RW } - NCR { R AT91C_EMAC_NCR RW } - SA4L { R AT91C_EMAC_SA4L RW } - RSR { R AT91C_EMAC_RSR RW } - SA3L { R AT91C_EMAC_SA3L RW } - TSR { R AT91C_EMAC_TSR RW } - IDR { R AT91C_EMAC_IDR WO } - RSE { R AT91C_EMAC_RSE RW } - ECOL { R AT91C_EMAC_ECOL RW } - TID { R AT91C_EMAC_TID RW } - HRB { R AT91C_EMAC_HRB RW } - TBQP { R AT91C_EMAC_TBQP RW } - USRIO { R AT91C_EMAC_USRIO RW } - PTR { R AT91C_EMAC_PTR RW } - SA2H { R AT91C_EMAC_SA2H RW } - ROV { R AT91C_EMAC_ROV RW } - ALE { R AT91C_EMAC_ALE RW } - RJA { R AT91C_EMAC_RJA RW } - RBQP { R AT91C_EMAC_RBQP RW } - TPF { R AT91C_EMAC_TPF RW } - NCFGR { R AT91C_EMAC_NCFGR RW } - HRT { R AT91C_EMAC_HRT RW } - USF { R AT91C_EMAC_USF RW } - FCSE { R AT91C_EMAC_FCSE RW } - TPQ { R AT91C_EMAC_TPQ RW } - MAN { R AT91C_EMAC_MAN RW } - FTO { R AT91C_EMAC_FTO RW } - REV { R AT91C_EMAC_REV RO } - IMR { R AT91C_EMAC_IMR RO } - SCF { R AT91C_EMAC_SCF RW } - PFR { R AT91C_EMAC_PFR RW } - MCF { R AT91C_EMAC_MCF RW } - NSR { R AT91C_EMAC_NSR RO } - SA2L { R AT91C_EMAC_SA2L RW } - FRO { R AT91C_EMAC_FRO RW } - IER { R AT91C_EMAC_IER WO } - SA1H { R AT91C_EMAC_SA1H RW } - CSE { R AT91C_EMAC_CSE RW } - SA3H { R AT91C_EMAC_SA3H RW } - RRE { R AT91C_EMAC_RRE RW } - STE { R AT91C_EMAC_STE RW } - listeReg { ISR SA4H SA1L ELE LCOL RLE WOL DTF TUND NCR SA4L RSR SA3L TSR IDR RSE ECOL TID HRB TBQP USRIO PTR SA2H ROV ALE RJA RBQP TPF NCFGR HRT USF FCSE TPQ MAN FTO REV IMR SCF PFR MCF NSR SA2L FRO IER SA1H CSE SA3H RRE STE } - -} - -# ========== Peripheral attributes for CAN_MB peripheral ========== -array set CAN_MB0_att { - MDL { R AT91C_CAN_MB0_MDL RW } - MAM { R AT91C_CAN_MB0_MAM RW } - MCR { R AT91C_CAN_MB0_MCR WO } - MID { R AT91C_CAN_MB0_MID RW } - MSR { R AT91C_CAN_MB0_MSR RO } - MFID { R AT91C_CAN_MB0_MFID RO } - MDH { R AT91C_CAN_MB0_MDH RW } - MMR { R AT91C_CAN_MB0_MMR RW } - listeReg { MDL MAM MCR MID MSR MFID MDH MMR } - -} -array set CAN_MB1_att { - MDL { R AT91C_CAN_MB1_MDL RW } - MID { R AT91C_CAN_MB1_MID RW } - MMR { R AT91C_CAN_MB1_MMR RW } - MSR { R AT91C_CAN_MB1_MSR RO } - MAM { R AT91C_CAN_MB1_MAM RW } - MDH { R AT91C_CAN_MB1_MDH RW } - MCR { R AT91C_CAN_MB1_MCR WO } - MFID { R AT91C_CAN_MB1_MFID RO } - listeReg { MDL MID MMR MSR MAM MDH MCR MFID } - -} -array set CAN_MB2_att { - MCR { R AT91C_CAN_MB2_MCR WO } - MDH { R AT91C_CAN_MB2_MDH RW } - MID { R AT91C_CAN_MB2_MID RW } - MDL { R AT91C_CAN_MB2_MDL RW } - MMR { R AT91C_CAN_MB2_MMR RW } - MAM { R AT91C_CAN_MB2_MAM RW } - MFID { R AT91C_CAN_MB2_MFID RO } - MSR { R AT91C_CAN_MB2_MSR RO } - listeReg { MCR MDH MID MDL MMR MAM MFID MSR } - -} -array set CAN_MB3_att { - MFID { R AT91C_CAN_MB3_MFID RO } - MAM { R AT91C_CAN_MB3_MAM RW } - MID { R AT91C_CAN_MB3_MID RW } - MCR { R AT91C_CAN_MB3_MCR WO } - MMR { R AT91C_CAN_MB3_MMR RW } - MSR { R AT91C_CAN_MB3_MSR RO } - MDL { R AT91C_CAN_MB3_MDL RW } - MDH { R AT91C_CAN_MB3_MDH RW } - listeReg { MFID MAM MID MCR MMR MSR MDL MDH } - -} -array set CAN_MB4_att { - MID { R AT91C_CAN_MB4_MID RW } - MMR { R AT91C_CAN_MB4_MMR RW } - MDH { R AT91C_CAN_MB4_MDH RW } - MFID { R AT91C_CAN_MB4_MFID RO } - MSR { R AT91C_CAN_MB4_MSR RO } - MCR { R AT91C_CAN_MB4_MCR WO } - MDL { R AT91C_CAN_MB4_MDL RW } - MAM { R AT91C_CAN_MB4_MAM RW } - listeReg { MID MMR MDH MFID MSR MCR MDL MAM } - -} -array set CAN_MB5_att { - MSR { R AT91C_CAN_MB5_MSR RO } - MCR { R AT91C_CAN_MB5_MCR WO } - MFID { R AT91C_CAN_MB5_MFID RO } - MDH { R AT91C_CAN_MB5_MDH RW } - MID { R AT91C_CAN_MB5_MID RW } - MMR { R AT91C_CAN_MB5_MMR RW } - MDL { R AT91C_CAN_MB5_MDL RW } - MAM { R AT91C_CAN_MB5_MAM RW } - listeReg { MSR MCR MFID MDH MID MMR MDL MAM } - -} -array set CAN_MB6_att { - MFID { R AT91C_CAN_MB6_MFID RO } - MID { R AT91C_CAN_MB6_MID RW } - MAM { R AT91C_CAN_MB6_MAM RW } - MSR { R AT91C_CAN_MB6_MSR RO } - MDL { R AT91C_CAN_MB6_MDL RW } - MCR { R AT91C_CAN_MB6_MCR WO } - MDH { R AT91C_CAN_MB6_MDH RW } - MMR { R AT91C_CAN_MB6_MMR RW } - listeReg { MFID MID MAM MSR MDL MCR MDH MMR } - -} -array set CAN_MB7_att { - MCR { R AT91C_CAN_MB7_MCR WO } - MDH { R AT91C_CAN_MB7_MDH RW } - MFID { R AT91C_CAN_MB7_MFID RO } - MDL { R AT91C_CAN_MB7_MDL RW } - MID { R AT91C_CAN_MB7_MID RW } - MMR { R AT91C_CAN_MB7_MMR RW } - MAM { R AT91C_CAN_MB7_MAM RW } - MSR { R AT91C_CAN_MB7_MSR RO } - listeReg { MCR MDH MFID MDL MID MMR MAM MSR } - -} - -# ========== Peripheral attributes for TC peripheral ========== -array set TC0_att { - SR { R AT91C_TC0_SR RO } - RC { R AT91C_TC0_RC RW } - RB { R AT91C_TC0_RB RW } - CCR { R AT91C_TC0_CCR WO } - CMR { R AT91C_TC0_CMR RW } - IER { R AT91C_TC0_IER WO } - RA { R AT91C_TC0_RA RW } - IDR { R AT91C_TC0_IDR WO } - CV { R AT91C_TC0_CV RW } - IMR { R AT91C_TC0_IMR RO } - listeReg { SR RC RB CCR CMR IER RA IDR CV IMR } - -} -array set TC1_att { - RB { R AT91C_TC1_RB RW } - CCR { R AT91C_TC1_CCR WO } - IER { R AT91C_TC1_IER WO } - IDR { R AT91C_TC1_IDR WO } - SR { R AT91C_TC1_SR RO } - CMR { R AT91C_TC1_CMR RW } - RA { R AT91C_TC1_RA RW } - RC { R AT91C_TC1_RC RW } - IMR { R AT91C_TC1_IMR RO } - CV { R AT91C_TC1_CV RW } - listeReg { RB CCR IER IDR SR CMR RA RC IMR CV } - -} -array set TC2_att { - CMR { R AT91C_TC2_CMR RW } - CCR { R AT91C_TC2_CCR WO } - CV { R AT91C_TC2_CV RW } - RA { R AT91C_TC2_RA RW } - RB { R AT91C_TC2_RB RW } - IDR { R AT91C_TC2_IDR WO } - IMR { R AT91C_TC2_IMR RO } - RC { R AT91C_TC2_RC RW } - IER { R AT91C_TC2_IER WO } - SR { R AT91C_TC2_SR RO } - listeReg { CMR CCR CV RA RB IDR IMR RC IER SR } - -} - -# ========== Peripheral attributes for SYS peripheral ========== -array set SYS_att { - listeReg { } - -} - -# ========== Peripheral attributes for MC peripheral ========== -array set MC_att { - ASR { R AT91C_MC_ASR RO } - RCR { R AT91C_MC_RCR WO } - FCR { R AT91C_MC_FCR WO } - AASR { R AT91C_MC_AASR RO } - FSR { R AT91C_MC_FSR RO } - FMR { R AT91C_MC_FMR RW } - listeReg { ASR RCR FCR AASR FSR FMR } - -} - -# ========== Peripheral attributes for PIO peripheral ========== -array set PIOA_att { - ODR { R AT91C_PIOA_ODR WO } - SODR { R AT91C_PIOA_SODR WO } - ISR { R AT91C_PIOA_ISR RO } - ABSR { R AT91C_PIOA_ABSR RO } - IER { R AT91C_PIOA_IER WO } - PPUDR { R AT91C_PIOA_PPUDR WO } - IMR { R AT91C_PIOA_IMR RO } - PER { R AT91C_PIOA_PER WO } - IFDR { R AT91C_PIOA_IFDR WO } - OWDR { R AT91C_PIOA_OWDR WO } - MDSR { R AT91C_PIOA_MDSR RO } - IDR { R AT91C_PIOA_IDR WO } - ODSR { R AT91C_PIOA_ODSR RO } - PPUSR { R AT91C_PIOA_PPUSR RO } - OWSR { R AT91C_PIOA_OWSR RO } - BSR { R AT91C_PIOA_BSR WO } - OWER { R AT91C_PIOA_OWER WO } - IFER { R AT91C_PIOA_IFER WO } - PDSR { R AT91C_PIOA_PDSR RO } - PPUER { R AT91C_PIOA_PPUER WO } - OSR { R AT91C_PIOA_OSR RO } - ASR { R AT91C_PIOA_ASR WO } - MDDR { R AT91C_PIOA_MDDR WO } - CODR { R AT91C_PIOA_CODR WO } - MDER { R AT91C_PIOA_MDER WO } - PDR { R AT91C_PIOA_PDR WO } - IFSR { R AT91C_PIOA_IFSR RO } - OER { R AT91C_PIOA_OER WO } - PSR { R AT91C_PIOA_PSR RO } - listeReg { ODR SODR ISR ABSR IER PPUDR IMR PER IFDR OWDR MDSR IDR ODSR PPUSR OWSR BSR OWER IFER PDSR PPUER OSR ASR MDDR CODR MDER PDR IFSR OER PSR } - -} -array set PIOB_att { - OWDR { R AT91C_PIOB_OWDR WO } - MDER { R AT91C_PIOB_MDER WO } - PPUSR { R AT91C_PIOB_PPUSR RO } - IMR { R AT91C_PIOB_IMR RO } - ASR { R AT91C_PIOB_ASR WO } - PPUDR { R AT91C_PIOB_PPUDR WO } - PSR { R AT91C_PIOB_PSR RO } - IER { R AT91C_PIOB_IER WO } - CODR { R AT91C_PIOB_CODR WO } - OWER { R AT91C_PIOB_OWER WO } - ABSR { R AT91C_PIOB_ABSR RO } - IFDR { R AT91C_PIOB_IFDR WO } - PDSR { R AT91C_PIOB_PDSR RO } - IDR { R AT91C_PIOB_IDR WO } - OWSR { R AT91C_PIOB_OWSR RO } - PDR { R AT91C_PIOB_PDR WO } - ODR { R AT91C_PIOB_ODR WO } - IFSR { R AT91C_PIOB_IFSR RO } - PPUER { R AT91C_PIOB_PPUER WO } - SODR { R AT91C_PIOB_SODR WO } - ISR { R AT91C_PIOB_ISR RO } - ODSR { R AT91C_PIOB_ODSR RO } - OSR { R AT91C_PIOB_OSR RO } - MDSR { R AT91C_PIOB_MDSR RO } - IFER { R AT91C_PIOB_IFER WO } - BSR { R AT91C_PIOB_BSR WO } - MDDR { R AT91C_PIOB_MDDR WO } - OER { R AT91C_PIOB_OER WO } - PER { R AT91C_PIOB_PER WO } - listeReg { OWDR MDER PPUSR IMR ASR PPUDR PSR IER CODR OWER ABSR IFDR PDSR IDR OWSR PDR ODR IFSR PPUER SODR ISR ODSR OSR MDSR IFER BSR MDDR OER PER } - -} - -# ========== Peripheral attributes for CAN peripheral ========== -array set CAN_att { - TCR { R AT91C_CAN_TCR WO } - IMR { R AT91C_CAN_IMR RO } - IER { R AT91C_CAN_IER WO } - ECR { R AT91C_CAN_ECR RO } - TIMESTP { R AT91C_CAN_TIMESTP RO } - MR { R AT91C_CAN_MR RW } - IDR { R AT91C_CAN_IDR WO } - ACR { R AT91C_CAN_ACR WO } - TIM { R AT91C_CAN_TIM RO } - SR { R AT91C_CAN_SR RO } - BR { R AT91C_CAN_BR RW } - VR { R AT91C_CAN_VR RO } - listeReg { TCR IMR IER ECR TIMESTP MR IDR ACR TIM SR BR VR } - -} - -# ========== Peripheral attributes for PWMC peripheral ========== -array set PWMC_att { - IDR { R AT91C_PWMC_IDR WO } - DIS { R AT91C_PWMC_DIS WO } - IER { R AT91C_PWMC_IER WO } - VR { R AT91C_PWMC_VR RO } - ISR { R AT91C_PWMC_ISR RO } - SR { R AT91C_PWMC_SR RO } - IMR { R AT91C_PWMC_IMR RO } - MR { R AT91C_PWMC_MR RW } - ENA { R AT91C_PWMC_ENA WO } - listeReg { IDR DIS IER VR ISR SR IMR MR ENA } - -} - -# ========== Peripheral attributes for PDC peripheral ========== -array set PDC_DBGU_att { - TCR { R AT91C_DBGU_TCR RW } - RNPR { R AT91C_DBGU_RNPR RW } - TNPR { R AT91C_DBGU_TNPR RW } - TPR { R AT91C_DBGU_TPR RW } - RPR { R AT91C_DBGU_RPR RW } - RCR { R AT91C_DBGU_RCR RW } - RNCR { R AT91C_DBGU_RNCR RW } - PTCR { R AT91C_DBGU_PTCR WO } - PTSR { R AT91C_DBGU_PTSR RO } - TNCR { R AT91C_DBGU_TNCR RW } - listeReg { TCR RNPR TNPR TPR RPR RCR RNCR PTCR PTSR TNCR } - -} -array set PDC_SPI1_att { - PTCR { R AT91C_SPI1_PTCR WO } - RPR { R AT91C_SPI1_RPR RW } - TNCR { R AT91C_SPI1_TNCR RW } - TPR { R AT91C_SPI1_TPR RW } - TNPR { R AT91C_SPI1_TNPR RW } - TCR { R AT91C_SPI1_TCR RW } - RCR { R AT91C_SPI1_RCR RW } - RNPR { R AT91C_SPI1_RNPR RW } - RNCR { R AT91C_SPI1_RNCR RW } - PTSR { R AT91C_SPI1_PTSR RO } - listeReg { PTCR RPR TNCR TPR TNPR TCR RCR RNPR RNCR PTSR } - -} -array set PDC_SPI0_att { - PTCR { R AT91C_SPI0_PTCR WO } - TPR { R AT91C_SPI0_TPR RW } - TCR { R AT91C_SPI0_TCR RW } - RCR { R AT91C_SPI0_RCR RW } - PTSR { R AT91C_SPI0_PTSR RO } - RNPR { R AT91C_SPI0_RNPR RW } - RPR { R AT91C_SPI0_RPR RW } - TNCR { R AT91C_SPI0_TNCR RW } - RNCR { R AT91C_SPI0_RNCR RW } - TNPR { R AT91C_SPI0_TNPR RW } - listeReg { PTCR TPR TCR RCR PTSR RNPR RPR TNCR RNCR TNPR } - -} -array set PDC_US1_att { - RNCR { R AT91C_US1_RNCR RW } - PTCR { R AT91C_US1_PTCR WO } - TCR { R AT91C_US1_TCR RW } - PTSR { R AT91C_US1_PTSR RO } - TNPR { R AT91C_US1_TNPR RW } - RCR { R AT91C_US1_RCR RW } - RNPR { R AT91C_US1_RNPR RW } - RPR { R AT91C_US1_RPR RW } - TNCR { R AT91C_US1_TNCR RW } - TPR { R AT91C_US1_TPR RW } - listeReg { RNCR PTCR TCR PTSR TNPR RCR RNPR RPR TNCR TPR } - -} -array set PDC_US0_att { - TNPR { R AT91C_US0_TNPR RW } - RNPR { R AT91C_US0_RNPR RW } - TCR { R AT91C_US0_TCR RW } - PTCR { R AT91C_US0_PTCR WO } - PTSR { R AT91C_US0_PTSR RO } - TNCR { R AT91C_US0_TNCR RW } - TPR { R AT91C_US0_TPR RW } - RCR { R AT91C_US0_RCR RW } - RPR { R AT91C_US0_RPR RW } - RNCR { R AT91C_US0_RNCR RW } - listeReg { TNPR RNPR TCR PTCR PTSR TNCR TPR RCR RPR RNCR } - -} -array set PDC_SSC_att { - TNCR { R AT91C_SSC_TNCR RW } - RPR { R AT91C_SSC_RPR RW } - RNCR { R AT91C_SSC_RNCR RW } - TPR { R AT91C_SSC_TPR RW } - PTCR { R AT91C_SSC_PTCR WO } - TCR { R AT91C_SSC_TCR RW } - RCR { R AT91C_SSC_RCR RW } - RNPR { R AT91C_SSC_RNPR RW } - TNPR { R AT91C_SSC_TNPR RW } - PTSR { R AT91C_SSC_PTSR RO } - listeReg { TNCR RPR RNCR TPR PTCR TCR RCR RNPR TNPR PTSR } - -} -array set PDC_ADC_att { - PTSR { R AT91C_ADC_PTSR RO } - PTCR { R AT91C_ADC_PTCR WO } - TNPR { R AT91C_ADC_TNPR RW } - TNCR { R AT91C_ADC_TNCR RW } - RNPR { R AT91C_ADC_RNPR RW } - RNCR { R AT91C_ADC_RNCR RW } - RPR { R AT91C_ADC_RPR RW } - TCR { R AT91C_ADC_TCR RW } - TPR { R AT91C_ADC_TPR RW } - RCR { R AT91C_ADC_RCR RW } - listeReg { PTSR PTCR TNPR TNCR RNPR RNCR RPR TCR TPR RCR } - -} - -# ========== PIO information ========== - -array set def_PIOA_att { - PA0 { RXD0 } - PA1 { TXD0 } - PA10 { TWD } - PA11 { TWCK } - PA12 { SPI0_NPCS0 } - PA13 { SPI0_NPCS1 PCK1 } - PA14 { SPI0_NPCS2 IRQ1 } - PA15 { SPI0_NPCS3 TCLK2 } - PA16 { SPI0_MISO } - PA17 { SPI0_MOSI } - PA18 { SPI0_SPCK } - PA19 { CANRX } - PA2 { SCK0 SPI1_NPCS1 } - PA20 { CANTX } - PA21 { TF SPI1_NPCS0 } - PA22 { TK SPI1_SPCK } - PA23 { TD SPI1_MOSI } - PA24 { RD SPI1_MISO } - PA25 { RK SPI1_NPCS1 } - PA26 { RF SPI1_NPCS2 } - PA27 { DRXD PCK3 } - PA28 { DTXD } - PA29 { FIQ SPI1_NPCS3 } - PA3 { RTS0 SPI1_NPCS2 } - PA30 { IRQ0 PCK2 } - PA4 { CTS0 SPI1_NPCS3 } - PA5 { RXD1 } - PA6 { TXD1 } - PA7 { SCK1 SPI0_NPCS1 } - PA8 { RTS1 SPI0_NPCS2 } - PA9 { CTS1 SPI0_NPCS3 } - } - -array set def_PIOB_att { - PB0 { ETXCK_EREFCK PCK0 } - PB1 { ETXEN } - PB10 { ETX2 SPI1_NPCS1 } - PB11 { ETX3 SPI1_NPCS2 } - PB12 { ETXER TCLK0 } - PB13 { ERX2 SPI0_NPCS1 } - PB14 { ERX3 SPI0_NPCS2 } - PB15 { ERXDV_ECRSDV } - PB16 { ECOL SPI1_NPCS3 } - PB17 { ERXCK SPI0_NPCS3 } - PB18 { EF100 ADTRG } - PB19 { PWM0 TCLK1 } - PB2 { ETX0 } - PB20 { PWM1 PCK0 } - PB21 { PWM2 PCK1 } - PB22 { PWM3 PCK2 } - PB23 { TIOA0 DCD1 } - PB24 { TIOB0 DSR1 } - PB25 { TIOA1 DTR1 } - PB26 { TIOB1 RI1 } - PB27 { TIOA2 PWM0 } - PB28 { TIOB2 PWM1 } - PB29 { PCK1 PWM2 } - PB3 { ETX1 } - PB30 { PCK2 PWM3 } - PB4 { ECRS } - PB5 { ERX0 } - PB6 { ERX1 } - PB7 { ERXER } - PB8 { EMDC } - PB9 { EMDIO } - } diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256_inc.h b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256_inc.h deleted file mode 100644 index b393d05a3..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256_inc.h +++ /dev/null @@ -1,2268 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h -// Object : AT91SAM7X256 definitions -// Generated : AT91 SW Application Group 11/02/2005 (15:17:24) -// -// CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// -// CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// -// CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// -// CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// -// CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// -// CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// -// CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// -// CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// -// CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// -// CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// -// CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// -// CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// -// CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// -// CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// -// CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// -// CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// -// CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// -// CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// -// CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// -// CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// -// CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// -// CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// -// CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// -// ---------------------------------------------------------------------------- - -// Hardware register definition - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR System Peripherals -// ***************************************************************************** - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Advanced Interrupt Controller -// ***************************************************************************** -// *** Register offset in AT91S_AIC structure *** -#define AIC_SMR ( 0) // Source Mode Register -#define AIC_SVR (128) // Source Vector Register -#define AIC_IVR (256) // IRQ Vector Register -#define AIC_FVR (260) // FIQ Vector Register -#define AIC_ISR (264) // Interrupt Status Register -#define AIC_IPR (268) // Interrupt Pending Register -#define AIC_IMR (272) // Interrupt Mask Register -#define AIC_CISR (276) // Core Interrupt Status Register -#define AIC_IECR (288) // Interrupt Enable Command Register -#define AIC_IDCR (292) // Interrupt Disable Command Register -#define AIC_ICCR (296) // Interrupt Clear Command Register -#define AIC_ISCR (300) // Interrupt Set Command Register -#define AIC_EOICR (304) // End of Interrupt Command Register -#define AIC_SPU (308) // Spurious Vector Register -#define AIC_DCR (312) // Debug Control Register (Protect) -#define AIC_FFER (320) // Fast Forcing Enable Register -#define AIC_FFDR (324) // Fast Forcing Disable Register -#define AIC_FFSR (328) // Fast Forcing Status Register -// -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- -#define AT91C_AIC_PRIOR (0x7 << 0) // (AIC) Priority Level -#define AT91C_AIC_PRIOR_LOWEST (0x0) // (AIC) Lowest priority level -#define AT91C_AIC_PRIOR_HIGHEST (0x7) // (AIC) Highest priority level -#define AT91C_AIC_SRCTYPE (0x3 << 5) // (AIC) Interrupt Source Type -#define AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL (0x0 << 5) // (AIC) Internal Sources Code Label High-level Sensitive -#define AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL (0x0 << 5) // (AIC) External Sources Code Label Low-level Sensitive -#define AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE (0x1 << 5) // (AIC) Internal Sources Code Label Positive Edge triggered -#define AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE (0x1 << 5) // (AIC) External Sources Code Label Negative Edge triggered -#define AT91C_AIC_SRCTYPE_HIGH_LEVEL (0x2 << 5) // (AIC) Internal Or External Sources Code Label High-level Sensitive -#define AT91C_AIC_SRCTYPE_POSITIVE_EDGE (0x3 << 5) // (AIC) Internal Or External Sources Code Label Positive Edge triggered -// -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- -#define AT91C_AIC_NFIQ (0x1 << 0) // (AIC) NFIQ Status -#define AT91C_AIC_NIRQ (0x1 << 1) // (AIC) NIRQ Status -// -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- -#define AT91C_AIC_DCR_PROT (0x1 << 0) // (AIC) Protection Mode -#define AT91C_AIC_DCR_GMSK (0x1 << 1) // (AIC) General Mask - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Peripheral DMA Controller -// ***************************************************************************** -// *** Register offset in AT91S_PDC structure *** -#define PDC_RPR ( 0) // Receive Pointer Register -#define PDC_RCR ( 4) // Receive Counter Register -#define PDC_TPR ( 8) // Transmit Pointer Register -#define PDC_TCR (12) // Transmit Counter Register -#define PDC_RNPR (16) // Receive Next Pointer Register -#define PDC_RNCR (20) // Receive Next Counter Register -#define PDC_TNPR (24) // Transmit Next Pointer Register -#define PDC_TNCR (28) // Transmit Next Counter Register -#define PDC_PTCR (32) // PDC Transfer Control Register -#define PDC_PTSR (36) // PDC Transfer Status Register -// -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- -#define AT91C_PDC_RXTEN (0x1 << 0) // (PDC) Receiver Transfer Enable -#define AT91C_PDC_RXTDIS (0x1 << 1) // (PDC) Receiver Transfer Disable -#define AT91C_PDC_TXTEN (0x1 << 8) // (PDC) Transmitter Transfer Enable -#define AT91C_PDC_TXTDIS (0x1 << 9) // (PDC) Transmitter Transfer Disable -// -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Debug Unit -// ***************************************************************************** -// *** Register offset in AT91S_DBGU structure *** -#define DBGU_CR ( 0) // Control Register -#define DBGU_MR ( 4) // Mode Register -#define DBGU_IER ( 8) // Interrupt Enable Register -#define DBGU_IDR (12) // Interrupt Disable Register -#define DBGU_IMR (16) // Interrupt Mask Register -#define DBGU_CSR (20) // Channel Status Register -#define DBGU_RHR (24) // Receiver Holding Register -#define DBGU_THR (28) // Transmitter Holding Register -#define DBGU_BRGR (32) // Baud Rate Generator Register -#define DBGU_CIDR (64) // Chip ID Register -#define DBGU_EXID (68) // Chip ID Extension Register -#define DBGU_FNTR (72) // Force NTRST Register -#define DBGU_RPR (256) // Receive Pointer Register -#define DBGU_RCR (260) // Receive Counter Register -#define DBGU_TPR (264) // Transmit Pointer Register -#define DBGU_TCR (268) // Transmit Counter Register -#define DBGU_RNPR (272) // Receive Next Pointer Register -#define DBGU_RNCR (276) // Receive Next Counter Register -#define DBGU_TNPR (280) // Transmit Next Pointer Register -#define DBGU_TNCR (284) // Transmit Next Counter Register -#define DBGU_PTCR (288) // PDC Transfer Control Register -#define DBGU_PTSR (292) // PDC Transfer Status Register -// -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- -#define AT91C_US_RSTRX (0x1 << 2) // (DBGU) Reset Receiver -#define AT91C_US_RSTTX (0x1 << 3) // (DBGU) Reset Transmitter -#define AT91C_US_RXEN (0x1 << 4) // (DBGU) Receiver Enable -#define AT91C_US_RXDIS (0x1 << 5) // (DBGU) Receiver Disable -#define AT91C_US_TXEN (0x1 << 6) // (DBGU) Transmitter Enable -#define AT91C_US_TXDIS (0x1 << 7) // (DBGU) Transmitter Disable -#define AT91C_US_RSTSTA (0x1 << 8) // (DBGU) Reset Status Bits -// -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- -#define AT91C_US_PAR (0x7 << 9) // (DBGU) Parity type -#define AT91C_US_PAR_EVEN (0x0 << 9) // (DBGU) Even Parity -#define AT91C_US_PAR_ODD (0x1 << 9) // (DBGU) Odd Parity -#define AT91C_US_PAR_SPACE (0x2 << 9) // (DBGU) Parity forced to 0 (Space) -#define AT91C_US_PAR_MARK (0x3 << 9) // (DBGU) Parity forced to 1 (Mark) -#define AT91C_US_PAR_NONE (0x4 << 9) // (DBGU) No Parity -#define AT91C_US_PAR_MULTI_DROP (0x6 << 9) // (DBGU) Multi-drop mode -#define AT91C_US_CHMODE (0x3 << 14) // (DBGU) Channel Mode -#define AT91C_US_CHMODE_NORMAL (0x0 << 14) // (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. -#define AT91C_US_CHMODE_AUTO (0x1 << 14) // (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. -#define AT91C_US_CHMODE_LOCAL (0x2 << 14) // (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. -#define AT91C_US_CHMODE_REMOTE (0x3 << 14) // (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. -// -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- -#define AT91C_US_RXRDY (0x1 << 0) // (DBGU) RXRDY Interrupt -#define AT91C_US_TXRDY (0x1 << 1) // (DBGU) TXRDY Interrupt -#define AT91C_US_ENDRX (0x1 << 3) // (DBGU) End of Receive Transfer Interrupt -#define AT91C_US_ENDTX (0x1 << 4) // (DBGU) End of Transmit Interrupt -#define AT91C_US_OVRE (0x1 << 5) // (DBGU) Overrun Interrupt -#define AT91C_US_FRAME (0x1 << 6) // (DBGU) Framing Error Interrupt -#define AT91C_US_PARE (0x1 << 7) // (DBGU) Parity Error Interrupt -#define AT91C_US_TXEMPTY (0x1 << 9) // (DBGU) TXEMPTY Interrupt -#define AT91C_US_TXBUFE (0x1 << 11) // (DBGU) TXBUFE Interrupt -#define AT91C_US_RXBUFF (0x1 << 12) // (DBGU) RXBUFF Interrupt -#define AT91C_US_COMM_TX (0x1 << 30) // (DBGU) COMM_TX Interrupt -#define AT91C_US_COMM_RX (0x1 << 31) // (DBGU) COMM_RX Interrupt -// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- -// -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- -#define AT91C_US_FORCE_NTRST (0x1 << 0) // (DBGU) Force NTRST in JTAG - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Parallel Input Output Controler -// ***************************************************************************** -// *** Register offset in AT91S_PIO structure *** -#define PIO_PER ( 0) // PIO Enable Register -#define PIO_PDR ( 4) // PIO Disable Register -#define PIO_PSR ( 8) // PIO Status Register -#define PIO_OER (16) // Output Enable Register -#define PIO_ODR (20) // Output Disable Registerr -#define PIO_OSR (24) // Output Status Register -#define PIO_IFER (32) // Input Filter Enable Register -#define PIO_IFDR (36) // Input Filter Disable Register -#define PIO_IFSR (40) // Input Filter Status Register -#define PIO_SODR (48) // Set Output Data Register -#define PIO_CODR (52) // Clear Output Data Register -#define PIO_ODSR (56) // Output Data Status Register -#define PIO_PDSR (60) // Pin Data Status Register -#define PIO_IER (64) // Interrupt Enable Register -#define PIO_IDR (68) // Interrupt Disable Register -#define PIO_IMR (72) // Interrupt Mask Register -#define PIO_ISR (76) // Interrupt Status Register -#define PIO_MDER (80) // Multi-driver Enable Register -#define PIO_MDDR (84) // Multi-driver Disable Register -#define PIO_MDSR (88) // Multi-driver Status Register -#define PIO_PPUDR (96) // Pull-up Disable Register -#define PIO_PPUER (100) // Pull-up Enable Register -#define PIO_PPUSR (104) // Pull-up Status Register -#define PIO_ASR (112) // Select A Register -#define PIO_BSR (116) // Select B Register -#define PIO_ABSR (120) // AB Select Status Register -#define PIO_OWER (160) // Output Write Enable Register -#define PIO_OWDR (164) // Output Write Disable Register -#define PIO_OWSR (168) // Output Write Status Register - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Clock Generator Controler -// ***************************************************************************** -// *** Register offset in AT91S_CKGR structure *** -#define CKGR_MOR ( 0) // Main Oscillator Register -#define CKGR_MCFR ( 4) // Main Clock Frequency Register -#define CKGR_PLLR (12) // PLL Register -// -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- -#define AT91C_CKGR_MOSCEN (0x1 << 0) // (CKGR) Main Oscillator Enable -#define AT91C_CKGR_OSCBYPASS (0x1 << 1) // (CKGR) Main Oscillator Bypass -#define AT91C_CKGR_OSCOUNT (0xFF << 8) // (CKGR) Main Oscillator Start-up Time -// -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- -#define AT91C_CKGR_MAINF (0xFFFF << 0) // (CKGR) Main Clock Frequency -#define AT91C_CKGR_MAINRDY (0x1 << 16) // (CKGR) Main Clock Ready -// -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- -#define AT91C_CKGR_DIV (0xFF << 0) // (CKGR) Divider Selected -#define AT91C_CKGR_DIV_0 (0x0) // (CKGR) Divider output is 0 -#define AT91C_CKGR_DIV_BYPASS (0x1) // (CKGR) Divider is bypassed -#define AT91C_CKGR_PLLCOUNT (0x3F << 8) // (CKGR) PLL Counter -#define AT91C_CKGR_OUT (0x3 << 14) // (CKGR) PLL Output Frequency Range -#define AT91C_CKGR_OUT_0 (0x0 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_1 (0x1 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_2 (0x2 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_3 (0x3 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_MUL (0x7FF << 16) // (CKGR) PLL Multiplier -#define AT91C_CKGR_USBDIV (0x3 << 28) // (CKGR) Divider for USB Clocks -#define AT91C_CKGR_USBDIV_0 (0x0 << 28) // (CKGR) Divider output is PLL clock output -#define AT91C_CKGR_USBDIV_1 (0x1 << 28) // (CKGR) Divider output is PLL clock output divided by 2 -#define AT91C_CKGR_USBDIV_2 (0x2 << 28) // (CKGR) Divider output is PLL clock output divided by 4 - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Power Management Controler -// ***************************************************************************** -// *** Register offset in AT91S_PMC structure *** -#define PMC_SCER ( 0) // System Clock Enable Register -#define PMC_SCDR ( 4) // System Clock Disable Register -#define PMC_SCSR ( 8) // System Clock Status Register -#define PMC_PCER (16) // Peripheral Clock Enable Register -#define PMC_PCDR (20) // Peripheral Clock Disable Register -#define PMC_PCSR (24) // Peripheral Clock Status Register -#define PMC_MOR (32) // Main Oscillator Register -#define PMC_MCFR (36) // Main Clock Frequency Register -#define PMC_PLLR (44) // PLL Register -#define PMC_MCKR (48) // Master Clock Register -#define PMC_PCKR (64) // Programmable Clock Register -#define PMC_IER (96) // Interrupt Enable Register -#define PMC_IDR (100) // Interrupt Disable Register -#define PMC_SR (104) // Status Register -#define PMC_IMR (108) // Interrupt Mask Register -// -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- -#define AT91C_PMC_PCK (0x1 << 0) // (PMC) Processor Clock -#define AT91C_PMC_UDP (0x1 << 7) // (PMC) USB Device Port Clock -#define AT91C_PMC_PCK0 (0x1 << 8) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK1 (0x1 << 9) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK2 (0x1 << 10) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK3 (0x1 << 11) // (PMC) Programmable Clock Output -// -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- -// -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- -// -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- -// -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- -// -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- -// -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- -#define AT91C_PMC_CSS (0x3 << 0) // (PMC) Programmable Clock Selection -#define AT91C_PMC_CSS_SLOW_CLK (0x0) // (PMC) Slow Clock is selected -#define AT91C_PMC_CSS_MAIN_CLK (0x1) // (PMC) Main Clock is selected -#define AT91C_PMC_CSS_PLL_CLK (0x3) // (PMC) Clock from PLL is selected -#define AT91C_PMC_PRES (0x7 << 2) // (PMC) Programmable Clock Prescaler -#define AT91C_PMC_PRES_CLK (0x0 << 2) // (PMC) Selected clock -#define AT91C_PMC_PRES_CLK_2 (0x1 << 2) // (PMC) Selected clock divided by 2 -#define AT91C_PMC_PRES_CLK_4 (0x2 << 2) // (PMC) Selected clock divided by 4 -#define AT91C_PMC_PRES_CLK_8 (0x3 << 2) // (PMC) Selected clock divided by 8 -#define AT91C_PMC_PRES_CLK_16 (0x4 << 2) // (PMC) Selected clock divided by 16 -#define AT91C_PMC_PRES_CLK_32 (0x5 << 2) // (PMC) Selected clock divided by 32 -#define AT91C_PMC_PRES_CLK_64 (0x6 << 2) // (PMC) Selected clock divided by 64 -// -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- -// -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- -#define AT91C_PMC_MOSCS (0x1 << 0) // (PMC) MOSC Status/Enable/Disable/Mask -#define AT91C_PMC_LOCK (0x1 << 2) // (PMC) PLL Status/Enable/Disable/Mask -#define AT91C_PMC_MCKRDY (0x1 << 3) // (PMC) MCK_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK0RDY (0x1 << 8) // (PMC) PCK0_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK1RDY (0x1 << 9) // (PMC) PCK1_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK2RDY (0x1 << 10) // (PMC) PCK2_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK3RDY (0x1 << 11) // (PMC) PCK3_RDY Status/Enable/Disable/Mask -// -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- -// -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- -// -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Reset Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_RSTC structure *** -#define RSTC_RCR ( 0) // Reset Control Register -#define RSTC_RSR ( 4) // Reset Status Register -#define RSTC_RMR ( 8) // Reset Mode Register -// -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- -#define AT91C_RSTC_PROCRST (0x1 << 0) // (RSTC) Processor Reset -#define AT91C_RSTC_PERRST (0x1 << 2) // (RSTC) Peripheral Reset -#define AT91C_RSTC_EXTRST (0x1 << 3) // (RSTC) External Reset -#define AT91C_RSTC_KEY (0xFF << 24) // (RSTC) Password -// -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- -#define AT91C_RSTC_URSTS (0x1 << 0) // (RSTC) User Reset Status -#define AT91C_RSTC_BODSTS (0x1 << 1) // (RSTC) Brownout Detection Status -#define AT91C_RSTC_RSTTYP (0x7 << 8) // (RSTC) Reset Type -#define AT91C_RSTC_RSTTYP_POWERUP (0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising. -#define AT91C_RSTC_RSTTYP_WAKEUP (0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising. -#define AT91C_RSTC_RSTTYP_WATCHDOG (0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occured. -#define AT91C_RSTC_RSTTYP_SOFTWARE (0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software. -#define AT91C_RSTC_RSTTYP_USER (0x4 << 8) // (RSTC) User Reset. NRST pin detected low. -#define AT91C_RSTC_RSTTYP_BROWNOUT (0x5 << 8) // (RSTC) Brownout Reset occured. -#define AT91C_RSTC_NRSTL (0x1 << 16) // (RSTC) NRST pin level -#define AT91C_RSTC_SRCMP (0x1 << 17) // (RSTC) Software Reset Command in Progress. -// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- -#define AT91C_RSTC_URSTEN (0x1 << 0) // (RSTC) User Reset Enable -#define AT91C_RSTC_URSTIEN (0x1 << 4) // (RSTC) User Reset Interrupt Enable -#define AT91C_RSTC_ERSTL (0xF << 8) // (RSTC) User Reset Length -#define AT91C_RSTC_BODIEN (0x1 << 16) // (RSTC) Brownout Detection Interrupt Enable - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_RTTC structure *** -#define RTTC_RTMR ( 0) // Real-time Mode Register -#define RTTC_RTAR ( 4) // Real-time Alarm Register -#define RTTC_RTVR ( 8) // Real-time Value Register -#define RTTC_RTSR (12) // Real-time Status Register -// -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- -#define AT91C_RTTC_RTPRES (0xFFFF << 0) // (RTTC) Real-time Timer Prescaler Value -#define AT91C_RTTC_ALMIEN (0x1 << 16) // (RTTC) Alarm Interrupt Enable -#define AT91C_RTTC_RTTINCIEN (0x1 << 17) // (RTTC) Real Time Timer Increment Interrupt Enable -#define AT91C_RTTC_RTTRST (0x1 << 18) // (RTTC) Real Time Timer Restart -// -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- -#define AT91C_RTTC_ALMV (0x0 << 0) // (RTTC) Alarm Value -// -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- -#define AT91C_RTTC_CRTV (0x0 << 0) // (RTTC) Current Real-time Value -// -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- -#define AT91C_RTTC_ALMS (0x1 << 0) // (RTTC) Real-time Alarm Status -#define AT91C_RTTC_RTTINC (0x1 << 1) // (RTTC) Real-time Timer Increment - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_PITC structure *** -#define PITC_PIMR ( 0) // Period Interval Mode Register -#define PITC_PISR ( 4) // Period Interval Status Register -#define PITC_PIVR ( 8) // Period Interval Value Register -#define PITC_PIIR (12) // Period Interval Image Register -// -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- -#define AT91C_PITC_PIV (0xFFFFF << 0) // (PITC) Periodic Interval Value -#define AT91C_PITC_PITEN (0x1 << 24) // (PITC) Periodic Interval Timer Enabled -#define AT91C_PITC_PITIEN (0x1 << 25) // (PITC) Periodic Interval Timer Interrupt Enable -// -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- -#define AT91C_PITC_PITS (0x1 << 0) // (PITC) Periodic Interval Timer Status -// -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- -#define AT91C_PITC_CPIV (0xFFFFF << 0) // (PITC) Current Periodic Interval Value -#define AT91C_PITC_PICNT (0xFFF << 20) // (PITC) Periodic Interval Counter -// -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_WDTC structure *** -#define WDTC_WDCR ( 0) // Watchdog Control Register -#define WDTC_WDMR ( 4) // Watchdog Mode Register -#define WDTC_WDSR ( 8) // Watchdog Status Register -// -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- -#define AT91C_WDTC_WDRSTT (0x1 << 0) // (WDTC) Watchdog Restart -#define AT91C_WDTC_KEY (0xFF << 24) // (WDTC) Watchdog KEY Password -// -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- -#define AT91C_WDTC_WDV (0xFFF << 0) // (WDTC) Watchdog Timer Restart -#define AT91C_WDTC_WDFIEN (0x1 << 12) // (WDTC) Watchdog Fault Interrupt Enable -#define AT91C_WDTC_WDRSTEN (0x1 << 13) // (WDTC) Watchdog Reset Enable -#define AT91C_WDTC_WDRPROC (0x1 << 14) // (WDTC) Watchdog Timer Restart -#define AT91C_WDTC_WDDIS (0x1 << 15) // (WDTC) Watchdog Disable -#define AT91C_WDTC_WDD (0xFFF << 16) // (WDTC) Watchdog Delta Value -#define AT91C_WDTC_WDDBGHLT (0x1 << 28) // (WDTC) Watchdog Debug Halt -#define AT91C_WDTC_WDIDLEHLT (0x1 << 29) // (WDTC) Watchdog Idle Halt -// -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- -#define AT91C_WDTC_WDUNF (0x1 << 0) // (WDTC) Watchdog Underflow -#define AT91C_WDTC_WDERR (0x1 << 1) // (WDTC) Watchdog Error - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_VREG structure *** -#define VREG_MR ( 0) // Voltage Regulator Mode Register -// -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- -#define AT91C_VREG_PSTDBY (0x1 << 0) // (VREG) Voltage Regulator Power Standby Mode - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Memory Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_MC structure *** -#define MC_RCR ( 0) // MC Remap Control Register -#define MC_ASR ( 4) // MC Abort Status Register -#define MC_AASR ( 8) // MC Abort Address Status Register -#define MC_FMR (96) // MC Flash Mode Register -#define MC_FCR (100) // MC Flash Command Register -#define MC_FSR (104) // MC Flash Status Register -// -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- -#define AT91C_MC_RCB (0x1 << 0) // (MC) Remap Command Bit -// -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- -#define AT91C_MC_UNDADD (0x1 << 0) // (MC) Undefined Addess Abort Status -#define AT91C_MC_MISADD (0x1 << 1) // (MC) Misaligned Addess Abort Status -#define AT91C_MC_ABTSZ (0x3 << 8) // (MC) Abort Size Status -#define AT91C_MC_ABTSZ_BYTE (0x0 << 8) // (MC) Byte -#define AT91C_MC_ABTSZ_HWORD (0x1 << 8) // (MC) Half-word -#define AT91C_MC_ABTSZ_WORD (0x2 << 8) // (MC) Word -#define AT91C_MC_ABTTYP (0x3 << 10) // (MC) Abort Type Status -#define AT91C_MC_ABTTYP_DATAR (0x0 << 10) // (MC) Data Read -#define AT91C_MC_ABTTYP_DATAW (0x1 << 10) // (MC) Data Write -#define AT91C_MC_ABTTYP_FETCH (0x2 << 10) // (MC) Code Fetch -#define AT91C_MC_MST0 (0x1 << 16) // (MC) Master 0 Abort Source -#define AT91C_MC_MST1 (0x1 << 17) // (MC) Master 1 Abort Source -#define AT91C_MC_SVMST0 (0x1 << 24) // (MC) Saved Master 0 Abort Source -#define AT91C_MC_SVMST1 (0x1 << 25) // (MC) Saved Master 1 Abort Source -// -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- -#define AT91C_MC_FRDY (0x1 << 0) // (MC) Flash Ready -#define AT91C_MC_LOCKE (0x1 << 2) // (MC) Lock Error -#define AT91C_MC_PROGE (0x1 << 3) // (MC) Programming Error -#define AT91C_MC_NEBP (0x1 << 7) // (MC) No Erase Before Programming -#define AT91C_MC_FWS (0x3 << 8) // (MC) Flash Wait State -#define AT91C_MC_FWS_0FWS (0x0 << 8) // (MC) 1 cycle for Read, 2 for Write operations -#define AT91C_MC_FWS_1FWS (0x1 << 8) // (MC) 2 cycles for Read, 3 for Write operations -#define AT91C_MC_FWS_2FWS (0x2 << 8) // (MC) 3 cycles for Read, 4 for Write operations -#define AT91C_MC_FWS_3FWS (0x3 << 8) // (MC) 4 cycles for Read, 4 for Write operations -#define AT91C_MC_FMCN (0xFF << 16) // (MC) Flash Microsecond Cycle Number -// -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- -#define AT91C_MC_FCMD (0xF << 0) // (MC) Flash Command -#define AT91C_MC_FCMD_START_PROG (0x1) // (MC) Starts the programming of th epage specified by PAGEN. -#define AT91C_MC_FCMD_LOCK (0x2) // (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -#define AT91C_MC_FCMD_PROG_AND_LOCK (0x3) // (MC) The lock sequence automatically happens after the programming sequence is completed. -#define AT91C_MC_FCMD_UNLOCK (0x4) // (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -#define AT91C_MC_FCMD_ERASE_ALL (0x8) // (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. -#define AT91C_MC_FCMD_SET_GP_NVM (0xB) // (MC) Set General Purpose NVM bits. -#define AT91C_MC_FCMD_CLR_GP_NVM (0xD) // (MC) Clear General Purpose NVM bits. -#define AT91C_MC_FCMD_SET_SECURITY (0xF) // (MC) Set Security Bit. -#define AT91C_MC_PAGEN (0x3FF << 8) // (MC) Page Number -#define AT91C_MC_KEY (0xFF << 24) // (MC) Writing Protect Key -// -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- -#define AT91C_MC_SECURITY (0x1 << 4) // (MC) Security Bit Status -#define AT91C_MC_GPNVM0 (0x1 << 8) // (MC) Sector 0 Lock Status -#define AT91C_MC_GPNVM1 (0x1 << 9) // (MC) Sector 1 Lock Status -#define AT91C_MC_GPNVM2 (0x1 << 10) // (MC) Sector 2 Lock Status -#define AT91C_MC_GPNVM3 (0x1 << 11) // (MC) Sector 3 Lock Status -#define AT91C_MC_GPNVM4 (0x1 << 12) // (MC) Sector 4 Lock Status -#define AT91C_MC_GPNVM5 (0x1 << 13) // (MC) Sector 5 Lock Status -#define AT91C_MC_GPNVM6 (0x1 << 14) // (MC) Sector 6 Lock Status -#define AT91C_MC_GPNVM7 (0x1 << 15) // (MC) Sector 7 Lock Status -#define AT91C_MC_LOCKS0 (0x1 << 16) // (MC) Sector 0 Lock Status -#define AT91C_MC_LOCKS1 (0x1 << 17) // (MC) Sector 1 Lock Status -#define AT91C_MC_LOCKS2 (0x1 << 18) // (MC) Sector 2 Lock Status -#define AT91C_MC_LOCKS3 (0x1 << 19) // (MC) Sector 3 Lock Status -#define AT91C_MC_LOCKS4 (0x1 << 20) // (MC) Sector 4 Lock Status -#define AT91C_MC_LOCKS5 (0x1 << 21) // (MC) Sector 5 Lock Status -#define AT91C_MC_LOCKS6 (0x1 << 22) // (MC) Sector 6 Lock Status -#define AT91C_MC_LOCKS7 (0x1 << 23) // (MC) Sector 7 Lock Status -#define AT91C_MC_LOCKS8 (0x1 << 24) // (MC) Sector 8 Lock Status -#define AT91C_MC_LOCKS9 (0x1 << 25) // (MC) Sector 9 Lock Status -#define AT91C_MC_LOCKS10 (0x1 << 26) // (MC) Sector 10 Lock Status -#define AT91C_MC_LOCKS11 (0x1 << 27) // (MC) Sector 11 Lock Status -#define AT91C_MC_LOCKS12 (0x1 << 28) // (MC) Sector 12 Lock Status -#define AT91C_MC_LOCKS13 (0x1 << 29) // (MC) Sector 13 Lock Status -#define AT91C_MC_LOCKS14 (0x1 << 30) // (MC) Sector 14 Lock Status -#define AT91C_MC_LOCKS15 (0x1 << 31) // (MC) Sector 15 Lock Status - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Serial Parallel Interface -// ***************************************************************************** -// *** Register offset in AT91S_SPI structure *** -#define SPI_CR ( 0) // Control Register -#define SPI_MR ( 4) // Mode Register -#define SPI_RDR ( 8) // Receive Data Register -#define SPI_TDR (12) // Transmit Data Register -#define SPI_SR (16) // Status Register -#define SPI_IER (20) // Interrupt Enable Register -#define SPI_IDR (24) // Interrupt Disable Register -#define SPI_IMR (28) // Interrupt Mask Register -#define SPI_CSR (48) // Chip Select Register -#define SPI_RPR (256) // Receive Pointer Register -#define SPI_RCR (260) // Receive Counter Register -#define SPI_TPR (264) // Transmit Pointer Register -#define SPI_TCR (268) // Transmit Counter Register -#define SPI_RNPR (272) // Receive Next Pointer Register -#define SPI_RNCR (276) // Receive Next Counter Register -#define SPI_TNPR (280) // Transmit Next Pointer Register -#define SPI_TNCR (284) // Transmit Next Counter Register -#define SPI_PTCR (288) // PDC Transfer Control Register -#define SPI_PTSR (292) // PDC Transfer Status Register -// -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- -#define AT91C_SPI_SPIEN (0x1 << 0) // (SPI) SPI Enable -#define AT91C_SPI_SPIDIS (0x1 << 1) // (SPI) SPI Disable -#define AT91C_SPI_SWRST (0x1 << 7) // (SPI) SPI Software reset -#define AT91C_SPI_LASTXFER (0x1 << 24) // (SPI) SPI Last Transfer -// -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- -#define AT91C_SPI_MSTR (0x1 << 0) // (SPI) Master/Slave Mode -#define AT91C_SPI_PS (0x1 << 1) // (SPI) Peripheral Select -#define AT91C_SPI_PS_FIXED (0x0 << 1) // (SPI) Fixed Peripheral Select -#define AT91C_SPI_PS_VARIABLE (0x1 << 1) // (SPI) Variable Peripheral Select -#define AT91C_SPI_PCSDEC (0x1 << 2) // (SPI) Chip Select Decode -#define AT91C_SPI_FDIV (0x1 << 3) // (SPI) Clock Selection -#define AT91C_SPI_MODFDIS (0x1 << 4) // (SPI) Mode Fault Detection -#define AT91C_SPI_LLB (0x1 << 7) // (SPI) Clock Selection -#define AT91C_SPI_PCS (0xF << 16) // (SPI) Peripheral Chip Select -#define AT91C_SPI_DLYBCS (0xFF << 24) // (SPI) Delay Between Chip Selects -// -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- -#define AT91C_SPI_RD (0xFFFF << 0) // (SPI) Receive Data -#define AT91C_SPI_RPCS (0xF << 16) // (SPI) Peripheral Chip Select Status -// -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- -#define AT91C_SPI_TD (0xFFFF << 0) // (SPI) Transmit Data -#define AT91C_SPI_TPCS (0xF << 16) // (SPI) Peripheral Chip Select Status -// -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- -#define AT91C_SPI_RDRF (0x1 << 0) // (SPI) Receive Data Register Full -#define AT91C_SPI_TDRE (0x1 << 1) // (SPI) Transmit Data Register Empty -#define AT91C_SPI_MODF (0x1 << 2) // (SPI) Mode Fault Error -#define AT91C_SPI_OVRES (0x1 << 3) // (SPI) Overrun Error Status -#define AT91C_SPI_ENDRX (0x1 << 4) // (SPI) End of Receiver Transfer -#define AT91C_SPI_ENDTX (0x1 << 5) // (SPI) End of Receiver Transfer -#define AT91C_SPI_RXBUFF (0x1 << 6) // (SPI) RXBUFF Interrupt -#define AT91C_SPI_TXBUFE (0x1 << 7) // (SPI) TXBUFE Interrupt -#define AT91C_SPI_NSSR (0x1 << 8) // (SPI) NSSR Interrupt -#define AT91C_SPI_TXEMPTY (0x1 << 9) // (SPI) TXEMPTY Interrupt -#define AT91C_SPI_SPIENS (0x1 << 16) // (SPI) Enable Status -// -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- -// -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- -// -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- -// -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- -#define AT91C_SPI_CPOL (0x1 << 0) // (SPI) Clock Polarity -#define AT91C_SPI_NCPHA (0x1 << 1) // (SPI) Clock Phase -#define AT91C_SPI_CSAAT (0x1 << 3) // (SPI) Chip Select Active After Transfer -#define AT91C_SPI_BITS (0xF << 4) // (SPI) Bits Per Transfer -#define AT91C_SPI_BITS_8 (0x0 << 4) // (SPI) 8 Bits Per transfer -#define AT91C_SPI_BITS_9 (0x1 << 4) // (SPI) 9 Bits Per transfer -#define AT91C_SPI_BITS_10 (0x2 << 4) // (SPI) 10 Bits Per transfer -#define AT91C_SPI_BITS_11 (0x3 << 4) // (SPI) 11 Bits Per transfer -#define AT91C_SPI_BITS_12 (0x4 << 4) // (SPI) 12 Bits Per transfer -#define AT91C_SPI_BITS_13 (0x5 << 4) // (SPI) 13 Bits Per transfer -#define AT91C_SPI_BITS_14 (0x6 << 4) // (SPI) 14 Bits Per transfer -#define AT91C_SPI_BITS_15 (0x7 << 4) // (SPI) 15 Bits Per transfer -#define AT91C_SPI_BITS_16 (0x8 << 4) // (SPI) 16 Bits Per transfer -#define AT91C_SPI_SCBR (0xFF << 8) // (SPI) Serial Clock Baud Rate -#define AT91C_SPI_DLYBS (0xFF << 16) // (SPI) Delay Before SPCK -#define AT91C_SPI_DLYBCT (0xFF << 24) // (SPI) Delay Between Consecutive Transfers - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Usart -// ***************************************************************************** -// *** Register offset in AT91S_USART structure *** -#define US_CR ( 0) // Control Register -#define US_MR ( 4) // Mode Register -#define US_IER ( 8) // Interrupt Enable Register -#define US_IDR (12) // Interrupt Disable Register -#define US_IMR (16) // Interrupt Mask Register -#define US_CSR (20) // Channel Status Register -#define US_RHR (24) // Receiver Holding Register -#define US_THR (28) // Transmitter Holding Register -#define US_BRGR (32) // Baud Rate Generator Register -#define US_RTOR (36) // Receiver Time-out Register -#define US_TTGR (40) // Transmitter Time-guard Register -#define US_FIDI (64) // FI_DI_Ratio Register -#define US_NER (68) // Nb Errors Register -#define US_IF (76) // IRDA_FILTER Register -#define US_RPR (256) // Receive Pointer Register -#define US_RCR (260) // Receive Counter Register -#define US_TPR (264) // Transmit Pointer Register -#define US_TCR (268) // Transmit Counter Register -#define US_RNPR (272) // Receive Next Pointer Register -#define US_RNCR (276) // Receive Next Counter Register -#define US_TNPR (280) // Transmit Next Pointer Register -#define US_TNCR (284) // Transmit Next Counter Register -#define US_PTCR (288) // PDC Transfer Control Register -#define US_PTSR (292) // PDC Transfer Status Register -// -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- -#define AT91C_US_STTBRK (0x1 << 9) // (USART) Start Break -#define AT91C_US_STPBRK (0x1 << 10) // (USART) Stop Break -#define AT91C_US_STTTO (0x1 << 11) // (USART) Start Time-out -#define AT91C_US_SENDA (0x1 << 12) // (USART) Send Address -#define AT91C_US_RSTIT (0x1 << 13) // (USART) Reset Iterations -#define AT91C_US_RSTNACK (0x1 << 14) // (USART) Reset Non Acknowledge -#define AT91C_US_RETTO (0x1 << 15) // (USART) Rearm Time-out -#define AT91C_US_DTREN (0x1 << 16) // (USART) Data Terminal ready Enable -#define AT91C_US_DTRDIS (0x1 << 17) // (USART) Data Terminal ready Disable -#define AT91C_US_RTSEN (0x1 << 18) // (USART) Request to Send enable -#define AT91C_US_RTSDIS (0x1 << 19) // (USART) Request to Send Disable -// -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- -#define AT91C_US_USMODE (0xF << 0) // (USART) Usart mode -#define AT91C_US_USMODE_NORMAL (0x0) // (USART) Normal -#define AT91C_US_USMODE_RS485 (0x1) // (USART) RS485 -#define AT91C_US_USMODE_HWHSH (0x2) // (USART) Hardware Handshaking -#define AT91C_US_USMODE_MODEM (0x3) // (USART) Modem -#define AT91C_US_USMODE_ISO7816_0 (0x4) // (USART) ISO7816 protocol: T = 0 -#define AT91C_US_USMODE_ISO7816_1 (0x6) // (USART) ISO7816 protocol: T = 1 -#define AT91C_US_USMODE_IRDA (0x8) // (USART) IrDA -#define AT91C_US_USMODE_SWHSH (0xC) // (USART) Software Handshaking -#define AT91C_US_CLKS (0x3 << 4) // (USART) Clock Selection (Baud Rate generator Input Clock -#define AT91C_US_CLKS_CLOCK (0x0 << 4) // (USART) Clock -#define AT91C_US_CLKS_FDIV1 (0x1 << 4) // (USART) fdiv1 -#define AT91C_US_CLKS_SLOW (0x2 << 4) // (USART) slow_clock (ARM) -#define AT91C_US_CLKS_EXT (0x3 << 4) // (USART) External (SCK) -#define AT91C_US_CHRL (0x3 << 6) // (USART) Clock Selection (Baud Rate generator Input Clock -#define AT91C_US_CHRL_5_BITS (0x0 << 6) // (USART) Character Length: 5 bits -#define AT91C_US_CHRL_6_BITS (0x1 << 6) // (USART) Character Length: 6 bits -#define AT91C_US_CHRL_7_BITS (0x2 << 6) // (USART) Character Length: 7 bits -#define AT91C_US_CHRL_8_BITS (0x3 << 6) // (USART) Character Length: 8 bits -#define AT91C_US_SYNC (0x1 << 8) // (USART) Synchronous Mode Select -#define AT91C_US_NBSTOP (0x3 << 12) // (USART) Number of Stop bits -#define AT91C_US_NBSTOP_1_BIT (0x0 << 12) // (USART) 1 stop bit -#define AT91C_US_NBSTOP_15_BIT (0x1 << 12) // (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits -#define AT91C_US_NBSTOP_2_BIT (0x2 << 12) // (USART) 2 stop bits -#define AT91C_US_MSBF (0x1 << 16) // (USART) Bit Order -#define AT91C_US_MODE9 (0x1 << 17) // (USART) 9-bit Character length -#define AT91C_US_CKLO (0x1 << 18) // (USART) Clock Output Select -#define AT91C_US_OVER (0x1 << 19) // (USART) Over Sampling Mode -#define AT91C_US_INACK (0x1 << 20) // (USART) Inhibit Non Acknowledge -#define AT91C_US_DSNACK (0x1 << 21) // (USART) Disable Successive NACK -#define AT91C_US_MAX_ITER (0x1 << 24) // (USART) Number of Repetitions -#define AT91C_US_FILTER (0x1 << 28) // (USART) Receive Line Filter -// -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- -#define AT91C_US_RXBRK (0x1 << 2) // (USART) Break Received/End of Break -#define AT91C_US_TIMEOUT (0x1 << 8) // (USART) Receiver Time-out -#define AT91C_US_ITERATION (0x1 << 10) // (USART) Max number of Repetitions Reached -#define AT91C_US_NACK (0x1 << 13) // (USART) Non Acknowledge -#define AT91C_US_RIIC (0x1 << 16) // (USART) Ring INdicator Input Change Flag -#define AT91C_US_DSRIC (0x1 << 17) // (USART) Data Set Ready Input Change Flag -#define AT91C_US_DCDIC (0x1 << 18) // (USART) Data Carrier Flag -#define AT91C_US_CTSIC (0x1 << 19) // (USART) Clear To Send Input Change Flag -// -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- -#define AT91C_US_RI (0x1 << 20) // (USART) Image of RI Input -#define AT91C_US_DSR (0x1 << 21) // (USART) Image of DSR Input -#define AT91C_US_DCD (0x1 << 22) // (USART) Image of DCD Input -#define AT91C_US_CTS (0x1 << 23) // (USART) Image of CTS Input - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_SSC structure *** -#define SSC_CR ( 0) // Control Register -#define SSC_CMR ( 4) // Clock Mode Register -#define SSC_RCMR (16) // Receive Clock ModeRegister -#define SSC_RFMR (20) // Receive Frame Mode Register -#define SSC_TCMR (24) // Transmit Clock Mode Register -#define SSC_TFMR (28) // Transmit Frame Mode Register -#define SSC_RHR (32) // Receive Holding Register -#define SSC_THR (36) // Transmit Holding Register -#define SSC_RSHR (48) // Receive Sync Holding Register -#define SSC_TSHR (52) // Transmit Sync Holding Register -#define SSC_SR (64) // Status Register -#define SSC_IER (68) // Interrupt Enable Register -#define SSC_IDR (72) // Interrupt Disable Register -#define SSC_IMR (76) // Interrupt Mask Register -#define SSC_RPR (256) // Receive Pointer Register -#define SSC_RCR (260) // Receive Counter Register -#define SSC_TPR (264) // Transmit Pointer Register -#define SSC_TCR (268) // Transmit Counter Register -#define SSC_RNPR (272) // Receive Next Pointer Register -#define SSC_RNCR (276) // Receive Next Counter Register -#define SSC_TNPR (280) // Transmit Next Pointer Register -#define SSC_TNCR (284) // Transmit Next Counter Register -#define SSC_PTCR (288) // PDC Transfer Control Register -#define SSC_PTSR (292) // PDC Transfer Status Register -// -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- -#define AT91C_SSC_RXEN (0x1 << 0) // (SSC) Receive Enable -#define AT91C_SSC_RXDIS (0x1 << 1) // (SSC) Receive Disable -#define AT91C_SSC_TXEN (0x1 << 8) // (SSC) Transmit Enable -#define AT91C_SSC_TXDIS (0x1 << 9) // (SSC) Transmit Disable -#define AT91C_SSC_SWRST (0x1 << 15) // (SSC) Software Reset -// -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- -#define AT91C_SSC_CKS (0x3 << 0) // (SSC) Receive/Transmit Clock Selection -#define AT91C_SSC_CKS_DIV (0x0) // (SSC) Divided Clock -#define AT91C_SSC_CKS_TK (0x1) // (SSC) TK Clock signal -#define AT91C_SSC_CKS_RK (0x2) // (SSC) RK pin -#define AT91C_SSC_CKO (0x7 << 2) // (SSC) Receive/Transmit Clock Output Mode Selection -#define AT91C_SSC_CKO_NONE (0x0 << 2) // (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only -#define AT91C_SSC_CKO_CONTINOUS (0x1 << 2) // (SSC) Continuous Receive/Transmit Clock RK pin: Output -#define AT91C_SSC_CKO_DATA_TX (0x2 << 2) // (SSC) Receive/Transmit Clock only during data transfers RK pin: Output -#define AT91C_SSC_CKI (0x1 << 5) // (SSC) Receive/Transmit Clock Inversion -#define AT91C_SSC_CKG (0x3 << 6) // (SSC) Receive/Transmit Clock Gating Selection -#define AT91C_SSC_CKG_NONE (0x0 << 6) // (SSC) Receive/Transmit Clock Gating: None, continuous clock -#define AT91C_SSC_CKG_LOW (0x1 << 6) // (SSC) Receive/Transmit Clock enabled only if RF Low -#define AT91C_SSC_CKG_HIGH (0x2 << 6) // (SSC) Receive/Transmit Clock enabled only if RF High -#define AT91C_SSC_START (0xF << 8) // (SSC) Receive/Transmit Start Selection -#define AT91C_SSC_START_CONTINOUS (0x0 << 8) // (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. -#define AT91C_SSC_START_TX (0x1 << 8) // (SSC) Transmit/Receive start -#define AT91C_SSC_START_LOW_RF (0x2 << 8) // (SSC) Detection of a low level on RF input -#define AT91C_SSC_START_HIGH_RF (0x3 << 8) // (SSC) Detection of a high level on RF input -#define AT91C_SSC_START_FALL_RF (0x4 << 8) // (SSC) Detection of a falling edge on RF input -#define AT91C_SSC_START_RISE_RF (0x5 << 8) // (SSC) Detection of a rising edge on RF input -#define AT91C_SSC_START_LEVEL_RF (0x6 << 8) // (SSC) Detection of any level change on RF input -#define AT91C_SSC_START_EDGE_RF (0x7 << 8) // (SSC) Detection of any edge on RF input -#define AT91C_SSC_START_0 (0x8 << 8) // (SSC) Compare 0 -#define AT91C_SSC_STOP (0x1 << 12) // (SSC) Receive Stop Selection -#define AT91C_SSC_STTDLY (0xFF << 16) // (SSC) Receive/Transmit Start Delay -#define AT91C_SSC_PERIOD (0xFF << 24) // (SSC) Receive/Transmit Period Divider Selection -// -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- -#define AT91C_SSC_DATLEN (0x1F << 0) // (SSC) Data Length -#define AT91C_SSC_LOOP (0x1 << 5) // (SSC) Loop Mode -#define AT91C_SSC_MSBF (0x1 << 7) // (SSC) Most Significant Bit First -#define AT91C_SSC_DATNB (0xF << 8) // (SSC) Data Number per Frame -#define AT91C_SSC_FSLEN (0xF << 16) // (SSC) Receive/Transmit Frame Sync length -#define AT91C_SSC_FSOS (0x7 << 20) // (SSC) Receive/Transmit Frame Sync Output Selection -#define AT91C_SSC_FSOS_NONE (0x0 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only -#define AT91C_SSC_FSOS_NEGATIVE (0x1 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse -#define AT91C_SSC_FSOS_POSITIVE (0x2 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse -#define AT91C_SSC_FSOS_LOW (0x3 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer -#define AT91C_SSC_FSOS_HIGH (0x4 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer -#define AT91C_SSC_FSOS_TOGGLE (0x5 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer -#define AT91C_SSC_FSEDGE (0x1 << 24) // (SSC) Frame Sync Edge Detection -// -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- -// -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- -#define AT91C_SSC_DATDEF (0x1 << 5) // (SSC) Data Default Value -#define AT91C_SSC_FSDEN (0x1 << 23) // (SSC) Frame Sync Data Enable -// -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- -#define AT91C_SSC_TXRDY (0x1 << 0) // (SSC) Transmit Ready -#define AT91C_SSC_TXEMPTY (0x1 << 1) // (SSC) Transmit Empty -#define AT91C_SSC_ENDTX (0x1 << 2) // (SSC) End Of Transmission -#define AT91C_SSC_TXBUFE (0x1 << 3) // (SSC) Transmit Buffer Empty -#define AT91C_SSC_RXRDY (0x1 << 4) // (SSC) Receive Ready -#define AT91C_SSC_OVRUN (0x1 << 5) // (SSC) Receive Overrun -#define AT91C_SSC_ENDRX (0x1 << 6) // (SSC) End of Reception -#define AT91C_SSC_RXBUFF (0x1 << 7) // (SSC) Receive Buffer Full -#define AT91C_SSC_CP0 (0x1 << 8) // (SSC) Compare 0 -#define AT91C_SSC_CP1 (0x1 << 9) // (SSC) Compare 1 -#define AT91C_SSC_TXSYN (0x1 << 10) // (SSC) Transmit Sync -#define AT91C_SSC_RXSYN (0x1 << 11) // (SSC) Receive Sync -#define AT91C_SSC_TXENA (0x1 << 16) // (SSC) Transmit Enable -#define AT91C_SSC_RXENA (0x1 << 17) // (SSC) Receive Enable -// -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- -// -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- -// -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Two-wire Interface -// ***************************************************************************** -// *** Register offset in AT91S_TWI structure *** -#define TWI_CR ( 0) // Control Register -#define TWI_MMR ( 4) // Master Mode Register -#define TWI_IADR (12) // Internal Address Register -#define TWI_CWGR (16) // Clock Waveform Generator Register -#define TWI_SR (32) // Status Register -#define TWI_IER (36) // Interrupt Enable Register -#define TWI_IDR (40) // Interrupt Disable Register -#define TWI_IMR (44) // Interrupt Mask Register -#define TWI_RHR (48) // Receive Holding Register -#define TWI_THR (52) // Transmit Holding Register -// -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- -#define AT91C_TWI_START (0x1 << 0) // (TWI) Send a START Condition -#define AT91C_TWI_STOP (0x1 << 1) // (TWI) Send a STOP Condition -#define AT91C_TWI_MSEN (0x1 << 2) // (TWI) TWI Master Transfer Enabled -#define AT91C_TWI_MSDIS (0x1 << 3) // (TWI) TWI Master Transfer Disabled -#define AT91C_TWI_SWRST (0x1 << 7) // (TWI) Software Reset -// -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- -#define AT91C_TWI_IADRSZ (0x3 << 8) // (TWI) Internal Device Address Size -#define AT91C_TWI_IADRSZ_NO (0x0 << 8) // (TWI) No internal device address -#define AT91C_TWI_IADRSZ_1_BYTE (0x1 << 8) // (TWI) One-byte internal device address -#define AT91C_TWI_IADRSZ_2_BYTE (0x2 << 8) // (TWI) Two-byte internal device address -#define AT91C_TWI_IADRSZ_3_BYTE (0x3 << 8) // (TWI) Three-byte internal device address -#define AT91C_TWI_MREAD (0x1 << 12) // (TWI) Master Read Direction -#define AT91C_TWI_DADR (0x7F << 16) // (TWI) Device Address -// -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- -#define AT91C_TWI_CLDIV (0xFF << 0) // (TWI) Clock Low Divider -#define AT91C_TWI_CHDIV (0xFF << 8) // (TWI) Clock High Divider -#define AT91C_TWI_CKDIV (0x7 << 16) // (TWI) Clock Divider -// -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- -#define AT91C_TWI_TXCOMP (0x1 << 0) // (TWI) Transmission Completed -#define AT91C_TWI_RXRDY (0x1 << 1) // (TWI) Receive holding register ReaDY -#define AT91C_TWI_TXRDY (0x1 << 2) // (TWI) Transmit holding register ReaDY -#define AT91C_TWI_OVRE (0x1 << 6) // (TWI) Overrun Error -#define AT91C_TWI_UNRE (0x1 << 7) // (TWI) Underrun Error -#define AT91C_TWI_NACK (0x1 << 8) // (TWI) Not Acknowledged -// -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- -// -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- -// -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR PWMC Channel Interface -// ***************************************************************************** -// *** Register offset in AT91S_PWMC_CH structure *** -#define PWMC_CMR ( 0) // Channel Mode Register -#define PWMC_CDTYR ( 4) // Channel Duty Cycle Register -#define PWMC_CPRDR ( 8) // Channel Period Register -#define PWMC_CCNTR (12) // Channel Counter Register -#define PWMC_CUPDR (16) // Channel Update Register -#define PWMC_Reserved (20) // Reserved -// -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- -#define AT91C_PWMC_CPRE (0xF << 0) // (PWMC_CH) Channel Pre-scaler : PWMC_CLKx -#define AT91C_PWMC_CPRE_MCK (0x0) // (PWMC_CH) -#define AT91C_PWMC_CPRE_MCKA (0xB) // (PWMC_CH) -#define AT91C_PWMC_CPRE_MCKB (0xC) // (PWMC_CH) -#define AT91C_PWMC_CALG (0x1 << 8) // (PWMC_CH) Channel Alignment -#define AT91C_PWMC_CPOL (0x1 << 9) // (PWMC_CH) Channel Polarity -#define AT91C_PWMC_CPD (0x1 << 10) // (PWMC_CH) Channel Update Period -// -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- -#define AT91C_PWMC_CDTY (0x0 << 0) // (PWMC_CH) Channel Duty Cycle -// -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- -#define AT91C_PWMC_CPRD (0x0 << 0) // (PWMC_CH) Channel Period -// -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- -#define AT91C_PWMC_CCNT (0x0 << 0) // (PWMC_CH) Channel Counter -// -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- -#define AT91C_PWMC_CUPD (0x0 << 0) // (PWMC_CH) Channel Update - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_PWMC structure *** -#define PWMC_MR ( 0) // PWMC Mode Register -#define PWMC_ENA ( 4) // PWMC Enable Register -#define PWMC_DIS ( 8) // PWMC Disable Register -#define PWMC_SR (12) // PWMC Status Register -#define PWMC_IER (16) // PWMC Interrupt Enable Register -#define PWMC_IDR (20) // PWMC Interrupt Disable Register -#define PWMC_IMR (24) // PWMC Interrupt Mask Register -#define PWMC_ISR (28) // PWMC Interrupt Status Register -#define PWMC_VR (252) // PWMC Version Register -#define PWMC_CH (512) // PWMC Channel -// -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- -#define AT91C_PWMC_DIVA (0xFF << 0) // (PWMC) CLKA divide factor. -#define AT91C_PWMC_PREA (0xF << 8) // (PWMC) Divider Input Clock Prescaler A -#define AT91C_PWMC_PREA_MCK (0x0 << 8) // (PWMC) -#define AT91C_PWMC_DIVB (0xFF << 16) // (PWMC) CLKB divide factor. -#define AT91C_PWMC_PREB (0xF << 24) // (PWMC) Divider Input Clock Prescaler B -#define AT91C_PWMC_PREB_MCK (0x0 << 24) // (PWMC) -// -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- -#define AT91C_PWMC_CHID0 (0x1 << 0) // (PWMC) Channel ID 0 -#define AT91C_PWMC_CHID1 (0x1 << 1) // (PWMC) Channel ID 1 -#define AT91C_PWMC_CHID2 (0x1 << 2) // (PWMC) Channel ID 2 -#define AT91C_PWMC_CHID3 (0x1 << 3) // (PWMC) Channel ID 3 -// -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- -// -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- -// -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- -// -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- -// -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- -// -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR USB Device Interface -// ***************************************************************************** -// *** Register offset in AT91S_UDP structure *** -#define UDP_NUM ( 0) // Frame Number Register -#define UDP_GLBSTATE ( 4) // Global State Register -#define UDP_FADDR ( 8) // Function Address Register -#define UDP_IER (16) // Interrupt Enable Register -#define UDP_IDR (20) // Interrupt Disable Register -#define UDP_IMR (24) // Interrupt Mask Register -#define UDP_ISR (28) // Interrupt Status Register -#define UDP_ICR (32) // Interrupt Clear Register -#define UDP_RSTEP (40) // Reset Endpoint Register -#define UDP_CSR (48) // Endpoint Control and Status Register -#define UDP_FDR (80) // Endpoint FIFO Data Register -#define UDP_TXVC (116) // Transceiver Control Register -// -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- -#define AT91C_UDP_FRM_NUM (0x7FF << 0) // (UDP) Frame Number as Defined in the Packet Field Formats -#define AT91C_UDP_FRM_ERR (0x1 << 16) // (UDP) Frame Error -#define AT91C_UDP_FRM_OK (0x1 << 17) // (UDP) Frame OK -// -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- -#define AT91C_UDP_FADDEN (0x1 << 0) // (UDP) Function Address Enable -#define AT91C_UDP_CONFG (0x1 << 1) // (UDP) Configured -#define AT91C_UDP_ESR (0x1 << 2) // (UDP) Enable Send Resume -#define AT91C_UDP_RSMINPR (0x1 << 3) // (UDP) A Resume Has Been Sent to the Host -#define AT91C_UDP_RMWUPE (0x1 << 4) // (UDP) Remote Wake Up Enable -// -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- -#define AT91C_UDP_FADD (0xFF << 0) // (UDP) Function Address Value -#define AT91C_UDP_FEN (0x1 << 8) // (UDP) Function Enable -// -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- -#define AT91C_UDP_EPINT0 (0x1 << 0) // (UDP) Endpoint 0 Interrupt -#define AT91C_UDP_EPINT1 (0x1 << 1) // (UDP) Endpoint 0 Interrupt -#define AT91C_UDP_EPINT2 (0x1 << 2) // (UDP) Endpoint 2 Interrupt -#define AT91C_UDP_EPINT3 (0x1 << 3) // (UDP) Endpoint 3 Interrupt -#define AT91C_UDP_EPINT4 (0x1 << 4) // (UDP) Endpoint 4 Interrupt -#define AT91C_UDP_EPINT5 (0x1 << 5) // (UDP) Endpoint 5 Interrupt -#define AT91C_UDP_RXSUSP (0x1 << 8) // (UDP) USB Suspend Interrupt -#define AT91C_UDP_RXRSM (0x1 << 9) // (UDP) USB Resume Interrupt -#define AT91C_UDP_EXTRSM (0x1 << 10) // (UDP) USB External Resume Interrupt -#define AT91C_UDP_SOFINT (0x1 << 11) // (UDP) USB Start Of frame Interrupt -#define AT91C_UDP_WAKEUP (0x1 << 13) // (UDP) USB Resume Interrupt -// -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- -// -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- -// -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- -#define AT91C_UDP_ENDBUSRES (0x1 << 12) // (UDP) USB End Of Bus Reset Interrupt -// -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- -// -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- -#define AT91C_UDP_EP0 (0x1 << 0) // (UDP) Reset Endpoint 0 -#define AT91C_UDP_EP1 (0x1 << 1) // (UDP) Reset Endpoint 1 -#define AT91C_UDP_EP2 (0x1 << 2) // (UDP) Reset Endpoint 2 -#define AT91C_UDP_EP3 (0x1 << 3) // (UDP) Reset Endpoint 3 -#define AT91C_UDP_EP4 (0x1 << 4) // (UDP) Reset Endpoint 4 -#define AT91C_UDP_EP5 (0x1 << 5) // (UDP) Reset Endpoint 5 -// -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- -#define AT91C_UDP_TXCOMP (0x1 << 0) // (UDP) Generates an IN packet with data previously written in the DPR -#define AT91C_UDP_RX_DATA_BK0 (0x1 << 1) // (UDP) Receive Data Bank 0 -#define AT91C_UDP_RXSETUP (0x1 << 2) // (UDP) Sends STALL to the Host (Control endpoints) -#define AT91C_UDP_ISOERROR (0x1 << 3) // (UDP) Isochronous error (Isochronous endpoints) -#define AT91C_UDP_TXPKTRDY (0x1 << 4) // (UDP) Transmit Packet Ready -#define AT91C_UDP_FORCESTALL (0x1 << 5) // (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). -#define AT91C_UDP_RX_DATA_BK1 (0x1 << 6) // (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). -#define AT91C_UDP_DIR (0x1 << 7) // (UDP) Transfer Direction -#define AT91C_UDP_EPTYPE (0x7 << 8) // (UDP) Endpoint type -#define AT91C_UDP_EPTYPE_CTRL (0x0 << 8) // (UDP) Control -#define AT91C_UDP_EPTYPE_ISO_OUT (0x1 << 8) // (UDP) Isochronous OUT -#define AT91C_UDP_EPTYPE_BULK_OUT (0x2 << 8) // (UDP) Bulk OUT -#define AT91C_UDP_EPTYPE_INT_OUT (0x3 << 8) // (UDP) Interrupt OUT -#define AT91C_UDP_EPTYPE_ISO_IN (0x5 << 8) // (UDP) Isochronous IN -#define AT91C_UDP_EPTYPE_BULK_IN (0x6 << 8) // (UDP) Bulk IN -#define AT91C_UDP_EPTYPE_INT_IN (0x7 << 8) // (UDP) Interrupt IN -#define AT91C_UDP_DTGLE (0x1 << 11) // (UDP) Data Toggle -#define AT91C_UDP_EPEDS (0x1 << 15) // (UDP) Endpoint Enable Disable -#define AT91C_UDP_RXBYTECNT (0x7FF << 16) // (UDP) Number Of Bytes Available in the FIFO -// -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- -#define AT91C_UDP_TXVDIS (0x1 << 8) // (UDP) -#define AT91C_UDP_PUON (0x1 << 9) // (UDP) Pull-up ON - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Timer Counter Channel Interface -// ***************************************************************************** -// *** Register offset in AT91S_TC structure *** -#define TC_CCR ( 0) // Channel Control Register -#define TC_CMR ( 4) // Channel Mode Register (Capture Mode / Waveform Mode) -#define TC_CV (16) // Counter Value -#define TC_RA (20) // Register A -#define TC_RB (24) // Register B -#define TC_RC (28) // Register C -#define TC_SR (32) // Status Register -#define TC_IER (36) // Interrupt Enable Register -#define TC_IDR (40) // Interrupt Disable Register -#define TC_IMR (44) // Interrupt Mask Register -// -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- -#define AT91C_TC_CLKEN (0x1 << 0) // (TC) Counter Clock Enable Command -#define AT91C_TC_CLKDIS (0x1 << 1) // (TC) Counter Clock Disable Command -#define AT91C_TC_SWTRG (0x1 << 2) // (TC) Software Trigger Command -// -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- -#define AT91C_TC_CLKS (0x7 << 0) // (TC) Clock Selection -#define AT91C_TC_CLKS_TIMER_DIV1_CLOCK (0x0) // (TC) Clock selected: TIMER_DIV1_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV2_CLOCK (0x1) // (TC) Clock selected: TIMER_DIV2_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV3_CLOCK (0x2) // (TC) Clock selected: TIMER_DIV3_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV4_CLOCK (0x3) // (TC) Clock selected: TIMER_DIV4_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV5_CLOCK (0x4) // (TC) Clock selected: TIMER_DIV5_CLOCK -#define AT91C_TC_CLKS_XC0 (0x5) // (TC) Clock selected: XC0 -#define AT91C_TC_CLKS_XC1 (0x6) // (TC) Clock selected: XC1 -#define AT91C_TC_CLKS_XC2 (0x7) // (TC) Clock selected: XC2 -#define AT91C_TC_CLKI (0x1 << 3) // (TC) Clock Invert -#define AT91C_TC_BURST (0x3 << 4) // (TC) Burst Signal Selection -#define AT91C_TC_BURST_NONE (0x0 << 4) // (TC) The clock is not gated by an external signal -#define AT91C_TC_BURST_XC0 (0x1 << 4) // (TC) XC0 is ANDed with the selected clock -#define AT91C_TC_BURST_XC1 (0x2 << 4) // (TC) XC1 is ANDed with the selected clock -#define AT91C_TC_BURST_XC2 (0x3 << 4) // (TC) XC2 is ANDed with the selected clock -#define AT91C_TC_CPCSTOP (0x1 << 6) // (TC) Counter Clock Stopped with RC Compare -#define AT91C_TC_LDBSTOP (0x1 << 6) // (TC) Counter Clock Stopped with RB Loading -#define AT91C_TC_CPCDIS (0x1 << 7) // (TC) Counter Clock Disable with RC Compare -#define AT91C_TC_LDBDIS (0x1 << 7) // (TC) Counter Clock Disabled with RB Loading -#define AT91C_TC_ETRGEDG (0x3 << 8) // (TC) External Trigger Edge Selection -#define AT91C_TC_ETRGEDG_NONE (0x0 << 8) // (TC) Edge: None -#define AT91C_TC_ETRGEDG_RISING (0x1 << 8) // (TC) Edge: rising edge -#define AT91C_TC_ETRGEDG_FALLING (0x2 << 8) // (TC) Edge: falling edge -#define AT91C_TC_ETRGEDG_BOTH (0x3 << 8) // (TC) Edge: each edge -#define AT91C_TC_EEVTEDG (0x3 << 8) // (TC) External Event Edge Selection -#define AT91C_TC_EEVTEDG_NONE (0x0 << 8) // (TC) Edge: None -#define AT91C_TC_EEVTEDG_RISING (0x1 << 8) // (TC) Edge: rising edge -#define AT91C_TC_EEVTEDG_FALLING (0x2 << 8) // (TC) Edge: falling edge -#define AT91C_TC_EEVTEDG_BOTH (0x3 << 8) // (TC) Edge: each edge -#define AT91C_TC_EEVT (0x3 << 10) // (TC) External Event Selection -#define AT91C_TC_EEVT_TIOB (0x0 << 10) // (TC) Signal selected as external event: TIOB TIOB direction: input -#define AT91C_TC_EEVT_XC0 (0x1 << 10) // (TC) Signal selected as external event: XC0 TIOB direction: output -#define AT91C_TC_EEVT_XC1 (0x2 << 10) // (TC) Signal selected as external event: XC1 TIOB direction: output -#define AT91C_TC_EEVT_XC2 (0x3 << 10) // (TC) Signal selected as external event: XC2 TIOB direction: output -#define AT91C_TC_ABETRG (0x1 << 10) // (TC) TIOA or TIOB External Trigger Selection -#define AT91C_TC_ENETRG (0x1 << 12) // (TC) External Event Trigger enable -#define AT91C_TC_WAVESEL (0x3 << 13) // (TC) Waveform Selection -#define AT91C_TC_WAVESEL_UP (0x0 << 13) // (TC) UP mode without atomatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UPDOWN (0x1 << 13) // (TC) UPDOWN mode without automatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UP_AUTO (0x2 << 13) // (TC) UP mode with automatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UPDOWN_AUTO (0x3 << 13) // (TC) UPDOWN mode with automatic trigger on RC Compare -#define AT91C_TC_CPCTRG (0x1 << 14) // (TC) RC Compare Trigger Enable -#define AT91C_TC_WAVE (0x1 << 15) // (TC) -#define AT91C_TC_ACPA (0x3 << 16) // (TC) RA Compare Effect on TIOA -#define AT91C_TC_ACPA_NONE (0x0 << 16) // (TC) Effect: none -#define AT91C_TC_ACPA_SET (0x1 << 16) // (TC) Effect: set -#define AT91C_TC_ACPA_CLEAR (0x2 << 16) // (TC) Effect: clear -#define AT91C_TC_ACPA_TOGGLE (0x3 << 16) // (TC) Effect: toggle -#define AT91C_TC_LDRA (0x3 << 16) // (TC) RA Loading Selection -#define AT91C_TC_LDRA_NONE (0x0 << 16) // (TC) Edge: None -#define AT91C_TC_LDRA_RISING (0x1 << 16) // (TC) Edge: rising edge of TIOA -#define AT91C_TC_LDRA_FALLING (0x2 << 16) // (TC) Edge: falling edge of TIOA -#define AT91C_TC_LDRA_BOTH (0x3 << 16) // (TC) Edge: each edge of TIOA -#define AT91C_TC_ACPC (0x3 << 18) // (TC) RC Compare Effect on TIOA -#define AT91C_TC_ACPC_NONE (0x0 << 18) // (TC) Effect: none -#define AT91C_TC_ACPC_SET (0x1 << 18) // (TC) Effect: set -#define AT91C_TC_ACPC_CLEAR (0x2 << 18) // (TC) Effect: clear -#define AT91C_TC_ACPC_TOGGLE (0x3 << 18) // (TC) Effect: toggle -#define AT91C_TC_LDRB (0x3 << 18) // (TC) RB Loading Selection -#define AT91C_TC_LDRB_NONE (0x0 << 18) // (TC) Edge: None -#define AT91C_TC_LDRB_RISING (0x1 << 18) // (TC) Edge: rising edge of TIOA -#define AT91C_TC_LDRB_FALLING (0x2 << 18) // (TC) Edge: falling edge of TIOA -#define AT91C_TC_LDRB_BOTH (0x3 << 18) // (TC) Edge: each edge of TIOA -#define AT91C_TC_AEEVT (0x3 << 20) // (TC) External Event Effect on TIOA -#define AT91C_TC_AEEVT_NONE (0x0 << 20) // (TC) Effect: none -#define AT91C_TC_AEEVT_SET (0x1 << 20) // (TC) Effect: set -#define AT91C_TC_AEEVT_CLEAR (0x2 << 20) // (TC) Effect: clear -#define AT91C_TC_AEEVT_TOGGLE (0x3 << 20) // (TC) Effect: toggle -#define AT91C_TC_ASWTRG (0x3 << 22) // (TC) Software Trigger Effect on TIOA -#define AT91C_TC_ASWTRG_NONE (0x0 << 22) // (TC) Effect: none -#define AT91C_TC_ASWTRG_SET (0x1 << 22) // (TC) Effect: set -#define AT91C_TC_ASWTRG_CLEAR (0x2 << 22) // (TC) Effect: clear -#define AT91C_TC_ASWTRG_TOGGLE (0x3 << 22) // (TC) Effect: toggle -#define AT91C_TC_BCPB (0x3 << 24) // (TC) RB Compare Effect on TIOB -#define AT91C_TC_BCPB_NONE (0x0 << 24) // (TC) Effect: none -#define AT91C_TC_BCPB_SET (0x1 << 24) // (TC) Effect: set -#define AT91C_TC_BCPB_CLEAR (0x2 << 24) // (TC) Effect: clear -#define AT91C_TC_BCPB_TOGGLE (0x3 << 24) // (TC) Effect: toggle -#define AT91C_TC_BCPC (0x3 << 26) // (TC) RC Compare Effect on TIOB -#define AT91C_TC_BCPC_NONE (0x0 << 26) // (TC) Effect: none -#define AT91C_TC_BCPC_SET (0x1 << 26) // (TC) Effect: set -#define AT91C_TC_BCPC_CLEAR (0x2 << 26) // (TC) Effect: clear -#define AT91C_TC_BCPC_TOGGLE (0x3 << 26) // (TC) Effect: toggle -#define AT91C_TC_BEEVT (0x3 << 28) // (TC) External Event Effect on TIOB -#define AT91C_TC_BEEVT_NONE (0x0 << 28) // (TC) Effect: none -#define AT91C_TC_BEEVT_SET (0x1 << 28) // (TC) Effect: set -#define AT91C_TC_BEEVT_CLEAR (0x2 << 28) // (TC) Effect: clear -#define AT91C_TC_BEEVT_TOGGLE (0x3 << 28) // (TC) Effect: toggle -#define AT91C_TC_BSWTRG (0x3 << 30) // (TC) Software Trigger Effect on TIOB -#define AT91C_TC_BSWTRG_NONE (0x0 << 30) // (TC) Effect: none -#define AT91C_TC_BSWTRG_SET (0x1 << 30) // (TC) Effect: set -#define AT91C_TC_BSWTRG_CLEAR (0x2 << 30) // (TC) Effect: clear -#define AT91C_TC_BSWTRG_TOGGLE (0x3 << 30) // (TC) Effect: toggle -// -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- -#define AT91C_TC_COVFS (0x1 << 0) // (TC) Counter Overflow -#define AT91C_TC_LOVRS (0x1 << 1) // (TC) Load Overrun -#define AT91C_TC_CPAS (0x1 << 2) // (TC) RA Compare -#define AT91C_TC_CPBS (0x1 << 3) // (TC) RB Compare -#define AT91C_TC_CPCS (0x1 << 4) // (TC) RC Compare -#define AT91C_TC_LDRAS (0x1 << 5) // (TC) RA Loading -#define AT91C_TC_LDRBS (0x1 << 6) // (TC) RB Loading -#define AT91C_TC_ETRGS (0x1 << 7) // (TC) External Trigger -#define AT91C_TC_CLKSTA (0x1 << 16) // (TC) Clock Enabling -#define AT91C_TC_MTIOA (0x1 << 17) // (TC) TIOA Mirror -#define AT91C_TC_MTIOB (0x1 << 18) // (TC) TIOA Mirror -// -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- -// -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- -// -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Timer Counter Interface -// ***************************************************************************** -// *** Register offset in AT91S_TCB structure *** -#define TCB_TC0 ( 0) // TC Channel 0 -#define TCB_TC1 (64) // TC Channel 1 -#define TCB_TC2 (128) // TC Channel 2 -#define TCB_BCR (192) // TC Block Control Register -#define TCB_BMR (196) // TC Block Mode Register -// -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- -#define AT91C_TCB_SYNC (0x1 << 0) // (TCB) Synchro Command -// -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- -#define AT91C_TCB_TC0XC0S (0x3 << 0) // (TCB) External Clock Signal 0 Selection -#define AT91C_TCB_TC0XC0S_TCLK0 (0x0) // (TCB) TCLK0 connected to XC0 -#define AT91C_TCB_TC0XC0S_NONE (0x1) // (TCB) None signal connected to XC0 -#define AT91C_TCB_TC0XC0S_TIOA1 (0x2) // (TCB) TIOA1 connected to XC0 -#define AT91C_TCB_TC0XC0S_TIOA2 (0x3) // (TCB) TIOA2 connected to XC0 -#define AT91C_TCB_TC1XC1S (0x3 << 2) // (TCB) External Clock Signal 1 Selection -#define AT91C_TCB_TC1XC1S_TCLK1 (0x0 << 2) // (TCB) TCLK1 connected to XC1 -#define AT91C_TCB_TC1XC1S_NONE (0x1 << 2) // (TCB) None signal connected to XC1 -#define AT91C_TCB_TC1XC1S_TIOA0 (0x2 << 2) // (TCB) TIOA0 connected to XC1 -#define AT91C_TCB_TC1XC1S_TIOA2 (0x3 << 2) // (TCB) TIOA2 connected to XC1 -#define AT91C_TCB_TC2XC2S (0x3 << 4) // (TCB) External Clock Signal 2 Selection -#define AT91C_TCB_TC2XC2S_TCLK2 (0x0 << 4) // (TCB) TCLK2 connected to XC2 -#define AT91C_TCB_TC2XC2S_NONE (0x1 << 4) // (TCB) None signal connected to XC2 -#define AT91C_TCB_TC2XC2S_TIOA0 (0x2 << 4) // (TCB) TIOA0 connected to XC2 -#define AT91C_TCB_TC2XC2S_TIOA1 (0x3 << 4) // (TCB) TIOA2 connected to XC2 - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface -// ***************************************************************************** -// *** Register offset in AT91S_CAN_MB structure *** -#define CAN_MB_MMR ( 0) // MailBox Mode Register -#define CAN_MB_MAM ( 4) // MailBox Acceptance Mask Register -#define CAN_MB_MID ( 8) // MailBox ID Register -#define CAN_MB_MFID (12) // MailBox Family ID Register -#define CAN_MB_MSR (16) // MailBox Status Register -#define CAN_MB_MDL (20) // MailBox Data Low Register -#define CAN_MB_MDH (24) // MailBox Data High Register -#define CAN_MB_MCR (28) // MailBox Control Register -// -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- -#define AT91C_CAN_MTIMEMARK (0xFFFF << 0) // (CAN_MB) Mailbox Timemark -#define AT91C_CAN_PRIOR (0xF << 16) // (CAN_MB) Mailbox Priority -#define AT91C_CAN_MOT (0x7 << 24) // (CAN_MB) Mailbox Object Type -#define AT91C_CAN_MOT_DIS (0x0 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_RX (0x1 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_RXOVERWRITE (0x2 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_TX (0x3 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_CONSUMER (0x4 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_PRODUCER (0x5 << 24) // (CAN_MB) -// -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- -#define AT91C_CAN_MIDvB (0x3FFFF << 0) // (CAN_MB) Complementary bits for identifier in extended mode -#define AT91C_CAN_MIDvA (0x7FF << 18) // (CAN_MB) Identifier for standard frame mode -#define AT91C_CAN_MIDE (0x1 << 29) // (CAN_MB) Identifier Version -// -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- -// -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- -// -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- -#define AT91C_CAN_MTIMESTAMP (0xFFFF << 0) // (CAN_MB) Timer Value -#define AT91C_CAN_MDLC (0xF << 16) // (CAN_MB) Mailbox Data Length Code -#define AT91C_CAN_MRTR (0x1 << 20) // (CAN_MB) Mailbox Remote Transmission Request -#define AT91C_CAN_MABT (0x1 << 22) // (CAN_MB) Mailbox Message Abort -#define AT91C_CAN_MRDY (0x1 << 23) // (CAN_MB) Mailbox Ready -#define AT91C_CAN_MMI (0x1 << 24) // (CAN_MB) Mailbox Message Ignored -// -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- -// -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- -// -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- -#define AT91C_CAN_MACR (0x1 << 22) // (CAN_MB) Abort Request for Mailbox -#define AT91C_CAN_MTCR (0x1 << 23) // (CAN_MB) Mailbox Transfer Command - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Control Area Network Interface -// ***************************************************************************** -// *** Register offset in AT91S_CAN structure *** -#define CAN_MR ( 0) // Mode Register -#define CAN_IER ( 4) // Interrupt Enable Register -#define CAN_IDR ( 8) // Interrupt Disable Register -#define CAN_IMR (12) // Interrupt Mask Register -#define CAN_SR (16) // Status Register -#define CAN_BR (20) // Baudrate Register -#define CAN_TIM (24) // Timer Register -#define CAN_TIMESTP (28) // Time Stamp Register -#define CAN_ECR (32) // Error Counter Register -#define CAN_TCR (36) // Transfer Command Register -#define CAN_ACR (40) // Abort Command Register -#define CAN_VR (252) // Version Register -#define CAN_MB0 (512) // CAN Mailbox 0 -#define CAN_MB1 (544) // CAN Mailbox 1 -#define CAN_MB2 (576) // CAN Mailbox 2 -#define CAN_MB3 (608) // CAN Mailbox 3 -#define CAN_MB4 (640) // CAN Mailbox 4 -#define CAN_MB5 (672) // CAN Mailbox 5 -#define CAN_MB6 (704) // CAN Mailbox 6 -#define CAN_MB7 (736) // CAN Mailbox 7 -#define CAN_MB8 (768) // CAN Mailbox 8 -#define CAN_MB9 (800) // CAN Mailbox 9 -#define CAN_MB10 (832) // CAN Mailbox 10 -#define CAN_MB11 (864) // CAN Mailbox 11 -#define CAN_MB12 (896) // CAN Mailbox 12 -#define CAN_MB13 (928) // CAN Mailbox 13 -#define CAN_MB14 (960) // CAN Mailbox 14 -#define CAN_MB15 (992) // CAN Mailbox 15 -// -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- -#define AT91C_CAN_CANEN (0x1 << 0) // (CAN) CAN Controller Enable -#define AT91C_CAN_LPM (0x1 << 1) // (CAN) Disable/Enable Low Power Mode -#define AT91C_CAN_ABM (0x1 << 2) // (CAN) Disable/Enable Autobaud/Listen Mode -#define AT91C_CAN_OVL (0x1 << 3) // (CAN) Disable/Enable Overload Frame -#define AT91C_CAN_TEOF (0x1 << 4) // (CAN) Time Stamp messages at each end of Frame -#define AT91C_CAN_TTM (0x1 << 5) // (CAN) Disable/Enable Time Trigger Mode -#define AT91C_CAN_TIMFRZ (0x1 << 6) // (CAN) Enable Timer Freeze -#define AT91C_CAN_DRPT (0x1 << 7) // (CAN) Disable Repeat -// -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- -#define AT91C_CAN_MB0 (0x1 << 0) // (CAN) Mailbox 0 Flag -#define AT91C_CAN_MB1 (0x1 << 1) // (CAN) Mailbox 1 Flag -#define AT91C_CAN_MB2 (0x1 << 2) // (CAN) Mailbox 2 Flag -#define AT91C_CAN_MB3 (0x1 << 3) // (CAN) Mailbox 3 Flag -#define AT91C_CAN_MB4 (0x1 << 4) // (CAN) Mailbox 4 Flag -#define AT91C_CAN_MB5 (0x1 << 5) // (CAN) Mailbox 5 Flag -#define AT91C_CAN_MB6 (0x1 << 6) // (CAN) Mailbox 6 Flag -#define AT91C_CAN_MB7 (0x1 << 7) // (CAN) Mailbox 7 Flag -#define AT91C_CAN_MB8 (0x1 << 8) // (CAN) Mailbox 8 Flag -#define AT91C_CAN_MB9 (0x1 << 9) // (CAN) Mailbox 9 Flag -#define AT91C_CAN_MB10 (0x1 << 10) // (CAN) Mailbox 10 Flag -#define AT91C_CAN_MB11 (0x1 << 11) // (CAN) Mailbox 11 Flag -#define AT91C_CAN_MB12 (0x1 << 12) // (CAN) Mailbox 12 Flag -#define AT91C_CAN_MB13 (0x1 << 13) // (CAN) Mailbox 13 Flag -#define AT91C_CAN_MB14 (0x1 << 14) // (CAN) Mailbox 14 Flag -#define AT91C_CAN_MB15 (0x1 << 15) // (CAN) Mailbox 15 Flag -#define AT91C_CAN_ERRA (0x1 << 16) // (CAN) Error Active Mode Flag -#define AT91C_CAN_WARN (0x1 << 17) // (CAN) Warning Limit Flag -#define AT91C_CAN_ERRP (0x1 << 18) // (CAN) Error Passive Mode Flag -#define AT91C_CAN_BOFF (0x1 << 19) // (CAN) Bus Off Mode Flag -#define AT91C_CAN_SLEEP (0x1 << 20) // (CAN) Sleep Flag -#define AT91C_CAN_WAKEUP (0x1 << 21) // (CAN) Wakeup Flag -#define AT91C_CAN_TOVF (0x1 << 22) // (CAN) Timer Overflow Flag -#define AT91C_CAN_TSTP (0x1 << 23) // (CAN) Timestamp Flag -#define AT91C_CAN_CERR (0x1 << 24) // (CAN) CRC Error -#define AT91C_CAN_SERR (0x1 << 25) // (CAN) Stuffing Error -#define AT91C_CAN_AERR (0x1 << 26) // (CAN) Acknowledgment Error -#define AT91C_CAN_FERR (0x1 << 27) // (CAN) Form Error -#define AT91C_CAN_BERR (0x1 << 28) // (CAN) Bit Error -// -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- -// -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- -// -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- -#define AT91C_CAN_RBSY (0x1 << 29) // (CAN) Receiver Busy -#define AT91C_CAN_TBSY (0x1 << 30) // (CAN) Transmitter Busy -#define AT91C_CAN_OVLY (0x1 << 31) // (CAN) Overload Busy -// -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- -#define AT91C_CAN_PHASE2 (0x7 << 0) // (CAN) Phase 2 segment -#define AT91C_CAN_PHASE1 (0x7 << 4) // (CAN) Phase 1 segment -#define AT91C_CAN_PROPAG (0x7 << 8) // (CAN) Programmation time segment -#define AT91C_CAN_SYNC (0x3 << 12) // (CAN) Re-synchronization jump width segment -#define AT91C_CAN_BRP (0x7F << 16) // (CAN) Baudrate Prescaler -#define AT91C_CAN_SMP (0x1 << 24) // (CAN) Sampling mode -// -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- -#define AT91C_CAN_TIMER (0xFFFF << 0) // (CAN) Timer field -// -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- -// -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- -#define AT91C_CAN_REC (0xFF << 0) // (CAN) Receive Error Counter -#define AT91C_CAN_TEC (0xFF << 16) // (CAN) Transmit Error Counter -// -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- -#define AT91C_CAN_TIMRST (0x1 << 31) // (CAN) Timer Reset Field -// -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 -// ***************************************************************************** -// *** Register offset in AT91S_EMAC structure *** -#define EMAC_NCR ( 0) // Network Control Register -#define EMAC_NCFGR ( 4) // Network Configuration Register -#define EMAC_NSR ( 8) // Network Status Register -#define EMAC_TSR (20) // Transmit Status Register -#define EMAC_RBQP (24) // Receive Buffer Queue Pointer -#define EMAC_TBQP (28) // Transmit Buffer Queue Pointer -#define EMAC_RSR (32) // Receive Status Register -#define EMAC_ISR (36) // Interrupt Status Register -#define EMAC_IER (40) // Interrupt Enable Register -#define EMAC_IDR (44) // Interrupt Disable Register -#define EMAC_IMR (48) // Interrupt Mask Register -#define EMAC_MAN (52) // PHY Maintenance Register -#define EMAC_PTR (56) // Pause Time Register -#define EMAC_PFR (60) // Pause Frames received Register -#define EMAC_FTO (64) // Frames Transmitted OK Register -#define EMAC_SCF (68) // Single Collision Frame Register -#define EMAC_MCF (72) // Multiple Collision Frame Register -#define EMAC_FRO (76) // Frames Received OK Register -#define EMAC_FCSE (80) // Frame Check Sequence Error Register -#define EMAC_ALE (84) // Alignment Error Register -#define EMAC_DTF (88) // Deferred Transmission Frame Register -#define EMAC_LCOL (92) // Late Collision Register -#define EMAC_ECOL (96) // Excessive Collision Register -#define EMAC_TUND (100) // Transmit Underrun Error Register -#define EMAC_CSE (104) // Carrier Sense Error Register -#define EMAC_RRE (108) // Receive Ressource Error Register -#define EMAC_ROV (112) // Receive Overrun Errors Register -#define EMAC_RSE (116) // Receive Symbol Errors Register -#define EMAC_ELE (120) // Excessive Length Errors Register -#define EMAC_RJA (124) // Receive Jabbers Register -#define EMAC_USF (128) // Undersize Frames Register -#define EMAC_STE (132) // SQE Test Error Register -#define EMAC_RLE (136) // Receive Length Field Mismatch Register -#define EMAC_TPF (140) // Transmitted Pause Frames Register -#define EMAC_HRB (144) // Hash Address Bottom[31:0] -#define EMAC_HRT (148) // Hash Address Top[63:32] -#define EMAC_SA1L (152) // Specific Address 1 Bottom, First 4 bytes -#define EMAC_SA1H (156) // Specific Address 1 Top, Last 2 bytes -#define EMAC_SA2L (160) // Specific Address 2 Bottom, First 4 bytes -#define EMAC_SA2H (164) // Specific Address 2 Top, Last 2 bytes -#define EMAC_SA3L (168) // Specific Address 3 Bottom, First 4 bytes -#define EMAC_SA3H (172) // Specific Address 3 Top, Last 2 bytes -#define EMAC_SA4L (176) // Specific Address 4 Bottom, First 4 bytes -#define EMAC_SA4H (180) // Specific Address 4 Top, Last 2 bytes -#define EMAC_TID (184) // Type ID Checking Register -#define EMAC_TPQ (188) // Transmit Pause Quantum Register -#define EMAC_USRIO (192) // USER Input/Output Register -#define EMAC_WOL (196) // Wake On LAN Register -#define EMAC_REV (252) // Revision Register -// -------- EMAC_NCR : (EMAC Offset: 0x0) -------- -#define AT91C_EMAC_LB (0x1 << 0) // (EMAC) Loopback. Optional. When set, loopback signal is at high level. -#define AT91C_EMAC_LLB (0x1 << 1) // (EMAC) Loopback local. -#define AT91C_EMAC_RE (0x1 << 2) // (EMAC) Receive enable. -#define AT91C_EMAC_TE (0x1 << 3) // (EMAC) Transmit enable. -#define AT91C_EMAC_MPE (0x1 << 4) // (EMAC) Management port enable. -#define AT91C_EMAC_CLRSTAT (0x1 << 5) // (EMAC) Clear statistics registers. -#define AT91C_EMAC_INCSTAT (0x1 << 6) // (EMAC) Increment statistics registers. -#define AT91C_EMAC_WESTAT (0x1 << 7) // (EMAC) Write enable for statistics registers. -#define AT91C_EMAC_BP (0x1 << 8) // (EMAC) Back pressure. -#define AT91C_EMAC_TSTART (0x1 << 9) // (EMAC) Start Transmission. -#define AT91C_EMAC_THALT (0x1 << 10) // (EMAC) Transmission Halt. -#define AT91C_EMAC_TPFR (0x1 << 11) // (EMAC) Transmit pause frame -#define AT91C_EMAC_TZQ (0x1 << 12) // (EMAC) Transmit zero quantum pause frame -// -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- -#define AT91C_EMAC_SPD (0x1 << 0) // (EMAC) Speed. -#define AT91C_EMAC_FD (0x1 << 1) // (EMAC) Full duplex. -#define AT91C_EMAC_JFRAME (0x1 << 3) // (EMAC) Jumbo Frames. -#define AT91C_EMAC_CAF (0x1 << 4) // (EMAC) Copy all frames. -#define AT91C_EMAC_NBC (0x1 << 5) // (EMAC) No broadcast. -#define AT91C_EMAC_MTI (0x1 << 6) // (EMAC) Multicast hash event enable -#define AT91C_EMAC_UNI (0x1 << 7) // (EMAC) Unicast hash enable. -#define AT91C_EMAC_BIG (0x1 << 8) // (EMAC) Receive 1522 bytes. -#define AT91C_EMAC_EAE (0x1 << 9) // (EMAC) External address match enable. -#define AT91C_EMAC_CLK (0x3 << 10) // (EMAC) -#define AT91C_EMAC_CLK_HCLK_8 (0x0 << 10) // (EMAC) HCLK divided by 8 -#define AT91C_EMAC_CLK_HCLK_16 (0x1 << 10) // (EMAC) HCLK divided by 16 -#define AT91C_EMAC_CLK_HCLK_32 (0x2 << 10) // (EMAC) HCLK divided by 32 -#define AT91C_EMAC_CLK_HCLK_64 (0x3 << 10) // (EMAC) HCLK divided by 64 -#define AT91C_EMAC_RTY (0x1 << 12) // (EMAC) -#define AT91C_EMAC_PAE (0x1 << 13) // (EMAC) -#define AT91C_EMAC_RBOF (0x3 << 14) // (EMAC) -#define AT91C_EMAC_RBOF_OFFSET_0 (0x0 << 14) // (EMAC) no offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_1 (0x1 << 14) // (EMAC) one byte offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_2 (0x2 << 14) // (EMAC) two bytes offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_3 (0x3 << 14) // (EMAC) three bytes offset from start of receive buffer -#define AT91C_EMAC_RLCE (0x1 << 16) // (EMAC) Receive Length field Checking Enable -#define AT91C_EMAC_DRFCS (0x1 << 17) // (EMAC) Discard Receive FCS -#define AT91C_EMAC_EFRHD (0x1 << 18) // (EMAC) -#define AT91C_EMAC_IRXFCS (0x1 << 19) // (EMAC) Ignore RX FCS -// -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- -#define AT91C_EMAC_LINKR (0x1 << 0) // (EMAC) -#define AT91C_EMAC_MDIO (0x1 << 1) // (EMAC) -#define AT91C_EMAC_IDLE (0x1 << 2) // (EMAC) -// -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- -#define AT91C_EMAC_UBR (0x1 << 0) // (EMAC) -#define AT91C_EMAC_COL (0x1 << 1) // (EMAC) -#define AT91C_EMAC_RLES (0x1 << 2) // (EMAC) -#define AT91C_EMAC_TGO (0x1 << 3) // (EMAC) Transmit Go -#define AT91C_EMAC_BEX (0x1 << 4) // (EMAC) Buffers exhausted mid frame -#define AT91C_EMAC_COMP (0x1 << 5) // (EMAC) -#define AT91C_EMAC_UND (0x1 << 6) // (EMAC) -// -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- -#define AT91C_EMAC_BNA (0x1 << 0) // (EMAC) -#define AT91C_EMAC_REC (0x1 << 1) // (EMAC) -#define AT91C_EMAC_OVR (0x1 << 2) // (EMAC) -// -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- -#define AT91C_EMAC_MFD (0x1 << 0) // (EMAC) -#define AT91C_EMAC_RCOMP (0x1 << 1) // (EMAC) -#define AT91C_EMAC_RXUBR (0x1 << 2) // (EMAC) -#define AT91C_EMAC_TXUBR (0x1 << 3) // (EMAC) -#define AT91C_EMAC_TUNDR (0x1 << 4) // (EMAC) -#define AT91C_EMAC_RLEX (0x1 << 5) // (EMAC) -#define AT91C_EMAC_TXERR (0x1 << 6) // (EMAC) -#define AT91C_EMAC_TCOMP (0x1 << 7) // (EMAC) -#define AT91C_EMAC_LINK (0x1 << 9) // (EMAC) -#define AT91C_EMAC_ROVR (0x1 << 10) // (EMAC) -#define AT91C_EMAC_HRESP (0x1 << 11) // (EMAC) -#define AT91C_EMAC_PFRE (0x1 << 12) // (EMAC) -#define AT91C_EMAC_PTZ (0x1 << 13) // (EMAC) -// -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- -// -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- -// -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- -// -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- -#define AT91C_EMAC_DATA (0xFFFF << 0) // (EMAC) -#define AT91C_EMAC_CODE (0x3 << 16) // (EMAC) -#define AT91C_EMAC_REGA (0x1F << 18) // (EMAC) -#define AT91C_EMAC_PHYA (0x1F << 23) // (EMAC) -#define AT91C_EMAC_RW (0x3 << 28) // (EMAC) -#define AT91C_EMAC_SOF (0x3 << 30) // (EMAC) -// -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- -#define AT91C_EMAC_RMII (0x1 << 0) // (EMAC) Reduce MII -#define AT91C_EMAC_CLKEN (0x1 << 1) // (EMAC) Clock Enable -// -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- -#define AT91C_EMAC_IP (0xFFFF << 0) // (EMAC) ARP request IP address -#define AT91C_EMAC_MAG (0x1 << 16) // (EMAC) Magic packet event enable -#define AT91C_EMAC_ARP (0x1 << 17) // (EMAC) ARP request event enable -#define AT91C_EMAC_SA1 (0x1 << 18) // (EMAC) Specific address register 1 event enable -// -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- -#define AT91C_EMAC_REVREF (0xFFFF << 0) // (EMAC) -#define AT91C_EMAC_PARTREF (0xFFFF << 16) // (EMAC) - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Analog to Digital Convertor -// ***************************************************************************** -// *** Register offset in AT91S_ADC structure *** -#define ADC_CR ( 0) // ADC Control Register -#define ADC_MR ( 4) // ADC Mode Register -#define ADC_CHER (16) // ADC Channel Enable Register -#define ADC_CHDR (20) // ADC Channel Disable Register -#define ADC_CHSR (24) // ADC Channel Status Register -#define ADC_SR (28) // ADC Status Register -#define ADC_LCDR (32) // ADC Last Converted Data Register -#define ADC_IER (36) // ADC Interrupt Enable Register -#define ADC_IDR (40) // ADC Interrupt Disable Register -#define ADC_IMR (44) // ADC Interrupt Mask Register -#define ADC_CDR0 (48) // ADC Channel Data Register 0 -#define ADC_CDR1 (52) // ADC Channel Data Register 1 -#define ADC_CDR2 (56) // ADC Channel Data Register 2 -#define ADC_CDR3 (60) // ADC Channel Data Register 3 -#define ADC_CDR4 (64) // ADC Channel Data Register 4 -#define ADC_CDR5 (68) // ADC Channel Data Register 5 -#define ADC_CDR6 (72) // ADC Channel Data Register 6 -#define ADC_CDR7 (76) // ADC Channel Data Register 7 -#define ADC_RPR (256) // Receive Pointer Register -#define ADC_RCR (260) // Receive Counter Register -#define ADC_TPR (264) // Transmit Pointer Register -#define ADC_TCR (268) // Transmit Counter Register -#define ADC_RNPR (272) // Receive Next Pointer Register -#define ADC_RNCR (276) // Receive Next Counter Register -#define ADC_TNPR (280) // Transmit Next Pointer Register -#define ADC_TNCR (284) // Transmit Next Counter Register -#define ADC_PTCR (288) // PDC Transfer Control Register -#define ADC_PTSR (292) // PDC Transfer Status Register -// -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- -#define AT91C_ADC_SWRST (0x1 << 0) // (ADC) Software Reset -#define AT91C_ADC_START (0x1 << 1) // (ADC) Start Conversion -// -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- -#define AT91C_ADC_TRGEN (0x1 << 0) // (ADC) Trigger Enable -#define AT91C_ADC_TRGEN_DIS (0x0) // (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software -#define AT91C_ADC_TRGEN_EN (0x1) // (ADC) Hardware trigger selected by TRGSEL field is enabled. -#define AT91C_ADC_TRGSEL (0x7 << 1) // (ADC) Trigger Selection -#define AT91C_ADC_TRGSEL_TIOA0 (0x0 << 1) // (ADC) Selected TRGSEL = TIAO0 -#define AT91C_ADC_TRGSEL_TIOA1 (0x1 << 1) // (ADC) Selected TRGSEL = TIAO1 -#define AT91C_ADC_TRGSEL_TIOA2 (0x2 << 1) // (ADC) Selected TRGSEL = TIAO2 -#define AT91C_ADC_TRGSEL_TIOA3 (0x3 << 1) // (ADC) Selected TRGSEL = TIAO3 -#define AT91C_ADC_TRGSEL_TIOA4 (0x4 << 1) // (ADC) Selected TRGSEL = TIAO4 -#define AT91C_ADC_TRGSEL_TIOA5 (0x5 << 1) // (ADC) Selected TRGSEL = TIAO5 -#define AT91C_ADC_TRGSEL_EXT (0x6 << 1) // (ADC) Selected TRGSEL = External Trigger -#define AT91C_ADC_LOWRES (0x1 << 4) // (ADC) Resolution. -#define AT91C_ADC_LOWRES_10_BIT (0x0 << 4) // (ADC) 10-bit resolution -#define AT91C_ADC_LOWRES_8_BIT (0x1 << 4) // (ADC) 8-bit resolution -#define AT91C_ADC_SLEEP (0x1 << 5) // (ADC) Sleep Mode -#define AT91C_ADC_SLEEP_NORMAL_MODE (0x0 << 5) // (ADC) Normal Mode -#define AT91C_ADC_SLEEP_MODE (0x1 << 5) // (ADC) Sleep Mode -#define AT91C_ADC_PRESCAL (0x3F << 8) // (ADC) Prescaler rate selection -#define AT91C_ADC_STARTUP (0x1F << 16) // (ADC) Startup Time -#define AT91C_ADC_SHTIM (0xF << 24) // (ADC) Sample & Hold Time -// -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- -#define AT91C_ADC_CH0 (0x1 << 0) // (ADC) Channel 0 -#define AT91C_ADC_CH1 (0x1 << 1) // (ADC) Channel 1 -#define AT91C_ADC_CH2 (0x1 << 2) // (ADC) Channel 2 -#define AT91C_ADC_CH3 (0x1 << 3) // (ADC) Channel 3 -#define AT91C_ADC_CH4 (0x1 << 4) // (ADC) Channel 4 -#define AT91C_ADC_CH5 (0x1 << 5) // (ADC) Channel 5 -#define AT91C_ADC_CH6 (0x1 << 6) // (ADC) Channel 6 -#define AT91C_ADC_CH7 (0x1 << 7) // (ADC) Channel 7 -// -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- -// -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- -// -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- -#define AT91C_ADC_EOC0 (0x1 << 0) // (ADC) End of Conversion -#define AT91C_ADC_EOC1 (0x1 << 1) // (ADC) End of Conversion -#define AT91C_ADC_EOC2 (0x1 << 2) // (ADC) End of Conversion -#define AT91C_ADC_EOC3 (0x1 << 3) // (ADC) End of Conversion -#define AT91C_ADC_EOC4 (0x1 << 4) // (ADC) End of Conversion -#define AT91C_ADC_EOC5 (0x1 << 5) // (ADC) End of Conversion -#define AT91C_ADC_EOC6 (0x1 << 6) // (ADC) End of Conversion -#define AT91C_ADC_EOC7 (0x1 << 7) // (ADC) End of Conversion -#define AT91C_ADC_OVRE0 (0x1 << 8) // (ADC) Overrun Error -#define AT91C_ADC_OVRE1 (0x1 << 9) // (ADC) Overrun Error -#define AT91C_ADC_OVRE2 (0x1 << 10) // (ADC) Overrun Error -#define AT91C_ADC_OVRE3 (0x1 << 11) // (ADC) Overrun Error -#define AT91C_ADC_OVRE4 (0x1 << 12) // (ADC) Overrun Error -#define AT91C_ADC_OVRE5 (0x1 << 13) // (ADC) Overrun Error -#define AT91C_ADC_OVRE6 (0x1 << 14) // (ADC) Overrun Error -#define AT91C_ADC_OVRE7 (0x1 << 15) // (ADC) Overrun Error -#define AT91C_ADC_DRDY (0x1 << 16) // (ADC) Data Ready -#define AT91C_ADC_GOVRE (0x1 << 17) // (ADC) General Overrun -#define AT91C_ADC_ENDRX (0x1 << 18) // (ADC) End of Receiver Transfer -#define AT91C_ADC_RXBUFF (0x1 << 19) // (ADC) RXBUFF Interrupt -// -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- -#define AT91C_ADC_LDATA (0x3FF << 0) // (ADC) Last Data Converted -// -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- -// -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- -// -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- -// -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- -#define AT91C_ADC_DATA (0x3FF << 0) // (ADC) Converted Data -// -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- -// -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- -// -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- -// -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- -// -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- -// -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- -// -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- - -// ***************************************************************************** -// REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 -// ***************************************************************************** -// ========== Register definition for SYS peripheral ========== -// ========== Register definition for AIC peripheral ========== -#define AT91C_AIC_IVR (0xFFFFF100) // (AIC) IRQ Vector Register -#define AT91C_AIC_SMR (0xFFFFF000) // (AIC) Source Mode Register -#define AT91C_AIC_FVR (0xFFFFF104) // (AIC) FIQ Vector Register -#define AT91C_AIC_DCR (0xFFFFF138) // (AIC) Debug Control Register (Protect) -#define AT91C_AIC_EOICR (0xFFFFF130) // (AIC) End of Interrupt Command Register -#define AT91C_AIC_SVR (0xFFFFF080) // (AIC) Source Vector Register -#define AT91C_AIC_FFSR (0xFFFFF148) // (AIC) Fast Forcing Status Register -#define AT91C_AIC_ICCR (0xFFFFF128) // (AIC) Interrupt Clear Command Register -#define AT91C_AIC_ISR (0xFFFFF108) // (AIC) Interrupt Status Register -#define AT91C_AIC_IMR (0xFFFFF110) // (AIC) Interrupt Mask Register -#define AT91C_AIC_IPR (0xFFFFF10C) // (AIC) Interrupt Pending Register -#define AT91C_AIC_FFER (0xFFFFF140) // (AIC) Fast Forcing Enable Register -#define AT91C_AIC_IECR (0xFFFFF120) // (AIC) Interrupt Enable Command Register -#define AT91C_AIC_ISCR (0xFFFFF12C) // (AIC) Interrupt Set Command Register -#define AT91C_AIC_FFDR (0xFFFFF144) // (AIC) Fast Forcing Disable Register -#define AT91C_AIC_CISR (0xFFFFF114) // (AIC) Core Interrupt Status Register -#define AT91C_AIC_IDCR (0xFFFFF124) // (AIC) Interrupt Disable Command Register -#define AT91C_AIC_SPU (0xFFFFF134) // (AIC) Spurious Vector Register -// ========== Register definition for PDC_DBGU peripheral ========== -#define AT91C_DBGU_TCR (0xFFFFF30C) // (PDC_DBGU) Transmit Counter Register -#define AT91C_DBGU_RNPR (0xFFFFF310) // (PDC_DBGU) Receive Next Pointer Register -#define AT91C_DBGU_TNPR (0xFFFFF318) // (PDC_DBGU) Transmit Next Pointer Register -#define AT91C_DBGU_TPR (0xFFFFF308) // (PDC_DBGU) Transmit Pointer Register -#define AT91C_DBGU_RPR (0xFFFFF300) // (PDC_DBGU) Receive Pointer Register -#define AT91C_DBGU_RCR (0xFFFFF304) // (PDC_DBGU) Receive Counter Register -#define AT91C_DBGU_RNCR (0xFFFFF314) // (PDC_DBGU) Receive Next Counter Register -#define AT91C_DBGU_PTCR (0xFFFFF320) // (PDC_DBGU) PDC Transfer Control Register -#define AT91C_DBGU_PTSR (0xFFFFF324) // (PDC_DBGU) PDC Transfer Status Register -#define AT91C_DBGU_TNCR (0xFFFFF31C) // (PDC_DBGU) Transmit Next Counter Register -// ========== Register definition for DBGU peripheral ========== -#define AT91C_DBGU_EXID (0xFFFFF244) // (DBGU) Chip ID Extension Register -#define AT91C_DBGU_BRGR (0xFFFFF220) // (DBGU) Baud Rate Generator Register -#define AT91C_DBGU_IDR (0xFFFFF20C) // (DBGU) Interrupt Disable Register -#define AT91C_DBGU_CSR (0xFFFFF214) // (DBGU) Channel Status Register -#define AT91C_DBGU_CIDR (0xFFFFF240) // (DBGU) Chip ID Register -#define AT91C_DBGU_MR (0xFFFFF204) // (DBGU) Mode Register -#define AT91C_DBGU_IMR (0xFFFFF210) // (DBGU) Interrupt Mask Register -#define AT91C_DBGU_CR (0xFFFFF200) // (DBGU) Control Register -#define AT91C_DBGU_FNTR (0xFFFFF248) // (DBGU) Force NTRST Register -#define AT91C_DBGU_THR (0xFFFFF21C) // (DBGU) Transmitter Holding Register -#define AT91C_DBGU_RHR (0xFFFFF218) // (DBGU) Receiver Holding Register -#define AT91C_DBGU_IER (0xFFFFF208) // (DBGU) Interrupt Enable Register -// ========== Register definition for PIOA peripheral ========== -#define AT91C_PIOA_ODR (0xFFFFF414) // (PIOA) Output Disable Registerr -#define AT91C_PIOA_SODR (0xFFFFF430) // (PIOA) Set Output Data Register -#define AT91C_PIOA_ISR (0xFFFFF44C) // (PIOA) Interrupt Status Register -#define AT91C_PIOA_ABSR (0xFFFFF478) // (PIOA) AB Select Status Register -#define AT91C_PIOA_IER (0xFFFFF440) // (PIOA) Interrupt Enable Register -#define AT91C_PIOA_PPUDR (0xFFFFF460) // (PIOA) Pull-up Disable Register -#define AT91C_PIOA_IMR (0xFFFFF448) // (PIOA) Interrupt Mask Register -#define AT91C_PIOA_PER (0xFFFFF400) // (PIOA) PIO Enable Register -#define AT91C_PIOA_IFDR (0xFFFFF424) // (PIOA) Input Filter Disable Register -#define AT91C_PIOA_OWDR (0xFFFFF4A4) // (PIOA) Output Write Disable Register -#define AT91C_PIOA_MDSR (0xFFFFF458) // (PIOA) Multi-driver Status Register -#define AT91C_PIOA_IDR (0xFFFFF444) // (PIOA) Interrupt Disable Register -#define AT91C_PIOA_ODSR (0xFFFFF438) // (PIOA) Output Data Status Register -#define AT91C_PIOA_PPUSR (0xFFFFF468) // (PIOA) Pull-up Status Register -#define AT91C_PIOA_OWSR (0xFFFFF4A8) // (PIOA) Output Write Status Register -#define AT91C_PIOA_BSR (0xFFFFF474) // (PIOA) Select B Register -#define AT91C_PIOA_OWER (0xFFFFF4A0) // (PIOA) Output Write Enable Register -#define AT91C_PIOA_IFER (0xFFFFF420) // (PIOA) Input Filter Enable Register -#define AT91C_PIOA_PDSR (0xFFFFF43C) // (PIOA) Pin Data Status Register -#define AT91C_PIOA_PPUER (0xFFFFF464) // (PIOA) Pull-up Enable Register -#define AT91C_PIOA_OSR (0xFFFFF418) // (PIOA) Output Status Register -#define AT91C_PIOA_ASR (0xFFFFF470) // (PIOA) Select A Register -#define AT91C_PIOA_MDDR (0xFFFFF454) // (PIOA) Multi-driver Disable Register -#define AT91C_PIOA_CODR (0xFFFFF434) // (PIOA) Clear Output Data Register -#define AT91C_PIOA_MDER (0xFFFFF450) // (PIOA) Multi-driver Enable Register -#define AT91C_PIOA_PDR (0xFFFFF404) // (PIOA) PIO Disable Register -#define AT91C_PIOA_IFSR (0xFFFFF428) // (PIOA) Input Filter Status Register -#define AT91C_PIOA_OER (0xFFFFF410) // (PIOA) Output Enable Register -#define AT91C_PIOA_PSR (0xFFFFF408) // (PIOA) PIO Status Register -// ========== Register definition for PIOB peripheral ========== -#define AT91C_PIOB_OWDR (0xFFFFF6A4) // (PIOB) Output Write Disable Register -#define AT91C_PIOB_MDER (0xFFFFF650) // (PIOB) Multi-driver Enable Register -#define AT91C_PIOB_PPUSR (0xFFFFF668) // (PIOB) Pull-up Status Register -#define AT91C_PIOB_IMR (0xFFFFF648) // (PIOB) Interrupt Mask Register -#define AT91C_PIOB_ASR (0xFFFFF670) // (PIOB) Select A Register -#define AT91C_PIOB_PPUDR (0xFFFFF660) // (PIOB) Pull-up Disable Register -#define AT91C_PIOB_PSR (0xFFFFF608) // (PIOB) PIO Status Register -#define AT91C_PIOB_IER (0xFFFFF640) // (PIOB) Interrupt Enable Register -#define AT91C_PIOB_CODR (0xFFFFF634) // (PIOB) Clear Output Data Register -#define AT91C_PIOB_OWER (0xFFFFF6A0) // (PIOB) Output Write Enable Register -#define AT91C_PIOB_ABSR (0xFFFFF678) // (PIOB) AB Select Status Register -#define AT91C_PIOB_IFDR (0xFFFFF624) // (PIOB) Input Filter Disable Register -#define AT91C_PIOB_PDSR (0xFFFFF63C) // (PIOB) Pin Data Status Register -#define AT91C_PIOB_IDR (0xFFFFF644) // (PIOB) Interrupt Disable Register -#define AT91C_PIOB_OWSR (0xFFFFF6A8) // (PIOB) Output Write Status Register -#define AT91C_PIOB_PDR (0xFFFFF604) // (PIOB) PIO Disable Register -#define AT91C_PIOB_ODR (0xFFFFF614) // (PIOB) Output Disable Registerr -#define AT91C_PIOB_IFSR (0xFFFFF628) // (PIOB) Input Filter Status Register -#define AT91C_PIOB_PPUER (0xFFFFF664) // (PIOB) Pull-up Enable Register -#define AT91C_PIOB_SODR (0xFFFFF630) // (PIOB) Set Output Data Register -#define AT91C_PIOB_ISR (0xFFFFF64C) // (PIOB) Interrupt Status Register -#define AT91C_PIOB_ODSR (0xFFFFF638) // (PIOB) Output Data Status Register -#define AT91C_PIOB_OSR (0xFFFFF618) // (PIOB) Output Status Register -#define AT91C_PIOB_MDSR (0xFFFFF658) // (PIOB) Multi-driver Status Register -#define AT91C_PIOB_IFER (0xFFFFF620) // (PIOB) Input Filter Enable Register -#define AT91C_PIOB_BSR (0xFFFFF674) // (PIOB) Select B Register -#define AT91C_PIOB_MDDR (0xFFFFF654) // (PIOB) Multi-driver Disable Register -#define AT91C_PIOB_OER (0xFFFFF610) // (PIOB) Output Enable Register -#define AT91C_PIOB_PER (0xFFFFF600) // (PIOB) PIO Enable Register -// ========== Register definition for CKGR peripheral ========== -#define AT91C_CKGR_MOR (0xFFFFFC20) // (CKGR) Main Oscillator Register -#define AT91C_CKGR_PLLR (0xFFFFFC2C) // (CKGR) PLL Register -#define AT91C_CKGR_MCFR (0xFFFFFC24) // (CKGR) Main Clock Frequency Register -// ========== Register definition for PMC peripheral ========== -#define AT91C_PMC_IDR (0xFFFFFC64) // (PMC) Interrupt Disable Register -#define AT91C_PMC_MOR (0xFFFFFC20) // (PMC) Main Oscillator Register -#define AT91C_PMC_PLLR (0xFFFFFC2C) // (PMC) PLL Register -#define AT91C_PMC_PCER (0xFFFFFC10) // (PMC) Peripheral Clock Enable Register -#define AT91C_PMC_PCKR (0xFFFFFC40) // (PMC) Programmable Clock Register -#define AT91C_PMC_MCKR (0xFFFFFC30) // (PMC) Master Clock Register -#define AT91C_PMC_SCDR (0xFFFFFC04) // (PMC) System Clock Disable Register -#define AT91C_PMC_PCDR (0xFFFFFC14) // (PMC) Peripheral Clock Disable Register -#define AT91C_PMC_SCSR (0xFFFFFC08) // (PMC) System Clock Status Register -#define AT91C_PMC_PCSR (0xFFFFFC18) // (PMC) Peripheral Clock Status Register -#define AT91C_PMC_MCFR (0xFFFFFC24) // (PMC) Main Clock Frequency Register -#define AT91C_PMC_SCER (0xFFFFFC00) // (PMC) System Clock Enable Register -#define AT91C_PMC_IMR (0xFFFFFC6C) // (PMC) Interrupt Mask Register -#define AT91C_PMC_IER (0xFFFFFC60) // (PMC) Interrupt Enable Register -#define AT91C_PMC_SR (0xFFFFFC68) // (PMC) Status Register -// ========== Register definition for RSTC peripheral ========== -#define AT91C_RSTC_RCR (0xFFFFFD00) // (RSTC) Reset Control Register -#define AT91C_RSTC_RMR (0xFFFFFD08) // (RSTC) Reset Mode Register -#define AT91C_RSTC_RSR (0xFFFFFD04) // (RSTC) Reset Status Register -// ========== Register definition for RTTC peripheral ========== -#define AT91C_RTTC_RTSR (0xFFFFFD2C) // (RTTC) Real-time Status Register -#define AT91C_RTTC_RTMR (0xFFFFFD20) // (RTTC) Real-time Mode Register -#define AT91C_RTTC_RTVR (0xFFFFFD28) // (RTTC) Real-time Value Register -#define AT91C_RTTC_RTAR (0xFFFFFD24) // (RTTC) Real-time Alarm Register -// ========== Register definition for PITC peripheral ========== -#define AT91C_PITC_PIVR (0xFFFFFD38) // (PITC) Period Interval Value Register -#define AT91C_PITC_PISR (0xFFFFFD34) // (PITC) Period Interval Status Register -#define AT91C_PITC_PIIR (0xFFFFFD3C) // (PITC) Period Interval Image Register -#define AT91C_PITC_PIMR (0xFFFFFD30) // (PITC) Period Interval Mode Register -// ========== Register definition for WDTC peripheral ========== -#define AT91C_WDTC_WDCR (0xFFFFFD40) // (WDTC) Watchdog Control Register -#define AT91C_WDTC_WDSR (0xFFFFFD48) // (WDTC) Watchdog Status Register -#define AT91C_WDTC_WDMR (0xFFFFFD44) // (WDTC) Watchdog Mode Register -// ========== Register definition for VREG peripheral ========== -#define AT91C_VREG_MR (0xFFFFFD60) // (VREG) Voltage Regulator Mode Register -// ========== Register definition for MC peripheral ========== -#define AT91C_MC_ASR (0xFFFFFF04) // (MC) MC Abort Status Register -#define AT91C_MC_RCR (0xFFFFFF00) // (MC) MC Remap Control Register -#define AT91C_MC_FCR (0xFFFFFF64) // (MC) MC Flash Command Register -#define AT91C_MC_AASR (0xFFFFFF08) // (MC) MC Abort Address Status Register -#define AT91C_MC_FSR (0xFFFFFF68) // (MC) MC Flash Status Register -#define AT91C_MC_FMR (0xFFFFFF60) // (MC) MC Flash Mode Register -// ========== Register definition for PDC_SPI1 peripheral ========== -#define AT91C_SPI1_PTCR (0xFFFE4120) // (PDC_SPI1) PDC Transfer Control Register -#define AT91C_SPI1_RPR (0xFFFE4100) // (PDC_SPI1) Receive Pointer Register -#define AT91C_SPI1_TNCR (0xFFFE411C) // (PDC_SPI1) Transmit Next Counter Register -#define AT91C_SPI1_TPR (0xFFFE4108) // (PDC_SPI1) Transmit Pointer Register -#define AT91C_SPI1_TNPR (0xFFFE4118) // (PDC_SPI1) Transmit Next Pointer Register -#define AT91C_SPI1_TCR (0xFFFE410C) // (PDC_SPI1) Transmit Counter Register -#define AT91C_SPI1_RCR (0xFFFE4104) // (PDC_SPI1) Receive Counter Register -#define AT91C_SPI1_RNPR (0xFFFE4110) // (PDC_SPI1) Receive Next Pointer Register -#define AT91C_SPI1_RNCR (0xFFFE4114) // (PDC_SPI1) Receive Next Counter Register -#define AT91C_SPI1_PTSR (0xFFFE4124) // (PDC_SPI1) PDC Transfer Status Register -// ========== Register definition for SPI1 peripheral ========== -#define AT91C_SPI1_IMR (0xFFFE401C) // (SPI1) Interrupt Mask Register -#define AT91C_SPI1_IER (0xFFFE4014) // (SPI1) Interrupt Enable Register -#define AT91C_SPI1_MR (0xFFFE4004) // (SPI1) Mode Register -#define AT91C_SPI1_RDR (0xFFFE4008) // (SPI1) Receive Data Register -#define AT91C_SPI1_IDR (0xFFFE4018) // (SPI1) Interrupt Disable Register -#define AT91C_SPI1_SR (0xFFFE4010) // (SPI1) Status Register -#define AT91C_SPI1_TDR (0xFFFE400C) // (SPI1) Transmit Data Register -#define AT91C_SPI1_CR (0xFFFE4000) // (SPI1) Control Register -#define AT91C_SPI1_CSR (0xFFFE4030) // (SPI1) Chip Select Register -// ========== Register definition for PDC_SPI0 peripheral ========== -#define AT91C_SPI0_PTCR (0xFFFE0120) // (PDC_SPI0) PDC Transfer Control Register -#define AT91C_SPI0_TPR (0xFFFE0108) // (PDC_SPI0) Transmit Pointer Register -#define AT91C_SPI0_TCR (0xFFFE010C) // (PDC_SPI0) Transmit Counter Register -#define AT91C_SPI0_RCR (0xFFFE0104) // (PDC_SPI0) Receive Counter Register -#define AT91C_SPI0_PTSR (0xFFFE0124) // (PDC_SPI0) PDC Transfer Status Register -#define AT91C_SPI0_RNPR (0xFFFE0110) // (PDC_SPI0) Receive Next Pointer Register -#define AT91C_SPI0_RPR (0xFFFE0100) // (PDC_SPI0) Receive Pointer Register -#define AT91C_SPI0_TNCR (0xFFFE011C) // (PDC_SPI0) Transmit Next Counter Register -#define AT91C_SPI0_RNCR (0xFFFE0114) // (PDC_SPI0) Receive Next Counter Register -#define AT91C_SPI0_TNPR (0xFFFE0118) // (PDC_SPI0) Transmit Next Pointer Register -// ========== Register definition for SPI0 peripheral ========== -#define AT91C_SPI0_IER (0xFFFE0014) // (SPI0) Interrupt Enable Register -#define AT91C_SPI0_SR (0xFFFE0010) // (SPI0) Status Register -#define AT91C_SPI0_IDR (0xFFFE0018) // (SPI0) Interrupt Disable Register -#define AT91C_SPI0_CR (0xFFFE0000) // (SPI0) Control Register -#define AT91C_SPI0_MR (0xFFFE0004) // (SPI0) Mode Register -#define AT91C_SPI0_IMR (0xFFFE001C) // (SPI0) Interrupt Mask Register -#define AT91C_SPI0_TDR (0xFFFE000C) // (SPI0) Transmit Data Register -#define AT91C_SPI0_RDR (0xFFFE0008) // (SPI0) Receive Data Register -#define AT91C_SPI0_CSR (0xFFFE0030) // (SPI0) Chip Select Register -// ========== Register definition for PDC_US1 peripheral ========== -#define AT91C_US1_RNCR (0xFFFC4114) // (PDC_US1) Receive Next Counter Register -#define AT91C_US1_PTCR (0xFFFC4120) // (PDC_US1) PDC Transfer Control Register -#define AT91C_US1_TCR (0xFFFC410C) // (PDC_US1) Transmit Counter Register -#define AT91C_US1_PTSR (0xFFFC4124) // (PDC_US1) PDC Transfer Status Register -#define AT91C_US1_TNPR (0xFFFC4118) // (PDC_US1) Transmit Next Pointer Register -#define AT91C_US1_RCR (0xFFFC4104) // (PDC_US1) Receive Counter Register -#define AT91C_US1_RNPR (0xFFFC4110) // (PDC_US1) Receive Next Pointer Register -#define AT91C_US1_RPR (0xFFFC4100) // (PDC_US1) Receive Pointer Register -#define AT91C_US1_TNCR (0xFFFC411C) // (PDC_US1) Transmit Next Counter Register -#define AT91C_US1_TPR (0xFFFC4108) // (PDC_US1) Transmit Pointer Register -// ========== Register definition for US1 peripheral ========== -#define AT91C_US1_IF (0xFFFC404C) // (US1) IRDA_FILTER Register -#define AT91C_US1_NER (0xFFFC4044) // (US1) Nb Errors Register -#define AT91C_US1_RTOR (0xFFFC4024) // (US1) Receiver Time-out Register -#define AT91C_US1_CSR (0xFFFC4014) // (US1) Channel Status Register -#define AT91C_US1_IDR (0xFFFC400C) // (US1) Interrupt Disable Register -#define AT91C_US1_IER (0xFFFC4008) // (US1) Interrupt Enable Register -#define AT91C_US1_THR (0xFFFC401C) // (US1) Transmitter Holding Register -#define AT91C_US1_TTGR (0xFFFC4028) // (US1) Transmitter Time-guard Register -#define AT91C_US1_RHR (0xFFFC4018) // (US1) Receiver Holding Register -#define AT91C_US1_BRGR (0xFFFC4020) // (US1) Baud Rate Generator Register -#define AT91C_US1_IMR (0xFFFC4010) // (US1) Interrupt Mask Register -#define AT91C_US1_FIDI (0xFFFC4040) // (US1) FI_DI_Ratio Register -#define AT91C_US1_CR (0xFFFC4000) // (US1) Control Register -#define AT91C_US1_MR (0xFFFC4004) // (US1) Mode Register -// ========== Register definition for PDC_US0 peripheral ========== -#define AT91C_US0_TNPR (0xFFFC0118) // (PDC_US0) Transmit Next Pointer Register -#define AT91C_US0_RNPR (0xFFFC0110) // (PDC_US0) Receive Next Pointer Register -#define AT91C_US0_TCR (0xFFFC010C) // (PDC_US0) Transmit Counter Register -#define AT91C_US0_PTCR (0xFFFC0120) // (PDC_US0) PDC Transfer Control Register -#define AT91C_US0_PTSR (0xFFFC0124) // (PDC_US0) PDC Transfer Status Register -#define AT91C_US0_TNCR (0xFFFC011C) // (PDC_US0) Transmit Next Counter Register -#define AT91C_US0_TPR (0xFFFC0108) // (PDC_US0) Transmit Pointer Register -#define AT91C_US0_RCR (0xFFFC0104) // (PDC_US0) Receive Counter Register -#define AT91C_US0_RPR (0xFFFC0100) // (PDC_US0) Receive Pointer Register -#define AT91C_US0_RNCR (0xFFFC0114) // (PDC_US0) Receive Next Counter Register -// ========== Register definition for US0 peripheral ========== -#define AT91C_US0_BRGR (0xFFFC0020) // (US0) Baud Rate Generator Register -#define AT91C_US0_NER (0xFFFC0044) // (US0) Nb Errors Register -#define AT91C_US0_CR (0xFFFC0000) // (US0) Control Register -#define AT91C_US0_IMR (0xFFFC0010) // (US0) Interrupt Mask Register -#define AT91C_US0_FIDI (0xFFFC0040) // (US0) FI_DI_Ratio Register -#define AT91C_US0_TTGR (0xFFFC0028) // (US0) Transmitter Time-guard Register -#define AT91C_US0_MR (0xFFFC0004) // (US0) Mode Register -#define AT91C_US0_RTOR (0xFFFC0024) // (US0) Receiver Time-out Register -#define AT91C_US0_CSR (0xFFFC0014) // (US0) Channel Status Register -#define AT91C_US0_RHR (0xFFFC0018) // (US0) Receiver Holding Register -#define AT91C_US0_IDR (0xFFFC000C) // (US0) Interrupt Disable Register -#define AT91C_US0_THR (0xFFFC001C) // (US0) Transmitter Holding Register -#define AT91C_US0_IF (0xFFFC004C) // (US0) IRDA_FILTER Register -#define AT91C_US0_IER (0xFFFC0008) // (US0) Interrupt Enable Register -// ========== Register definition for PDC_SSC peripheral ========== -#define AT91C_SSC_TNCR (0xFFFD411C) // (PDC_SSC) Transmit Next Counter Register -#define AT91C_SSC_RPR (0xFFFD4100) // (PDC_SSC) Receive Pointer Register -#define AT91C_SSC_RNCR (0xFFFD4114) // (PDC_SSC) Receive Next Counter Register -#define AT91C_SSC_TPR (0xFFFD4108) // (PDC_SSC) Transmit Pointer Register -#define AT91C_SSC_PTCR (0xFFFD4120) // (PDC_SSC) PDC Transfer Control Register -#define AT91C_SSC_TCR (0xFFFD410C) // (PDC_SSC) Transmit Counter Register -#define AT91C_SSC_RCR (0xFFFD4104) // (PDC_SSC) Receive Counter Register -#define AT91C_SSC_RNPR (0xFFFD4110) // (PDC_SSC) Receive Next Pointer Register -#define AT91C_SSC_TNPR (0xFFFD4118) // (PDC_SSC) Transmit Next Pointer Register -#define AT91C_SSC_PTSR (0xFFFD4124) // (PDC_SSC) PDC Transfer Status Register -// ========== Register definition for SSC peripheral ========== -#define AT91C_SSC_RHR (0xFFFD4020) // (SSC) Receive Holding Register -#define AT91C_SSC_RSHR (0xFFFD4030) // (SSC) Receive Sync Holding Register -#define AT91C_SSC_TFMR (0xFFFD401C) // (SSC) Transmit Frame Mode Register -#define AT91C_SSC_IDR (0xFFFD4048) // (SSC) Interrupt Disable Register -#define AT91C_SSC_THR (0xFFFD4024) // (SSC) Transmit Holding Register -#define AT91C_SSC_RCMR (0xFFFD4010) // (SSC) Receive Clock ModeRegister -#define AT91C_SSC_IER (0xFFFD4044) // (SSC) Interrupt Enable Register -#define AT91C_SSC_TSHR (0xFFFD4034) // (SSC) Transmit Sync Holding Register -#define AT91C_SSC_SR (0xFFFD4040) // (SSC) Status Register -#define AT91C_SSC_CMR (0xFFFD4004) // (SSC) Clock Mode Register -#define AT91C_SSC_TCMR (0xFFFD4018) // (SSC) Transmit Clock Mode Register -#define AT91C_SSC_CR (0xFFFD4000) // (SSC) Control Register -#define AT91C_SSC_IMR (0xFFFD404C) // (SSC) Interrupt Mask Register -#define AT91C_SSC_RFMR (0xFFFD4014) // (SSC) Receive Frame Mode Register -// ========== Register definition for TWI peripheral ========== -#define AT91C_TWI_IER (0xFFFB8024) // (TWI) Interrupt Enable Register -#define AT91C_TWI_CR (0xFFFB8000) // (TWI) Control Register -#define AT91C_TWI_SR (0xFFFB8020) // (TWI) Status Register -#define AT91C_TWI_IMR (0xFFFB802C) // (TWI) Interrupt Mask Register -#define AT91C_TWI_THR (0xFFFB8034) // (TWI) Transmit Holding Register -#define AT91C_TWI_IDR (0xFFFB8028) // (TWI) Interrupt Disable Register -#define AT91C_TWI_IADR (0xFFFB800C) // (TWI) Internal Address Register -#define AT91C_TWI_MMR (0xFFFB8004) // (TWI) Master Mode Register -#define AT91C_TWI_CWGR (0xFFFB8010) // (TWI) Clock Waveform Generator Register -#define AT91C_TWI_RHR (0xFFFB8030) // (TWI) Receive Holding Register -// ========== Register definition for PWMC_CH3 peripheral ========== -#define AT91C_PWMC_CH3_CUPDR (0xFFFCC270) // (PWMC_CH3) Channel Update Register -#define AT91C_PWMC_CH3_Reserved (0xFFFCC274) // (PWMC_CH3) Reserved -#define AT91C_PWMC_CH3_CPRDR (0xFFFCC268) // (PWMC_CH3) Channel Period Register -#define AT91C_PWMC_CH3_CDTYR (0xFFFCC264) // (PWMC_CH3) Channel Duty Cycle Register -#define AT91C_PWMC_CH3_CCNTR (0xFFFCC26C) // (PWMC_CH3) Channel Counter Register -#define AT91C_PWMC_CH3_CMR (0xFFFCC260) // (PWMC_CH3) Channel Mode Register -// ========== Register definition for PWMC_CH2 peripheral ========== -#define AT91C_PWMC_CH2_Reserved (0xFFFCC254) // (PWMC_CH2) Reserved -#define AT91C_PWMC_CH2_CMR (0xFFFCC240) // (PWMC_CH2) Channel Mode Register -#define AT91C_PWMC_CH2_CCNTR (0xFFFCC24C) // (PWMC_CH2) Channel Counter Register -#define AT91C_PWMC_CH2_CPRDR (0xFFFCC248) // (PWMC_CH2) Channel Period Register -#define AT91C_PWMC_CH2_CUPDR (0xFFFCC250) // (PWMC_CH2) Channel Update Register -#define AT91C_PWMC_CH2_CDTYR (0xFFFCC244) // (PWMC_CH2) Channel Duty Cycle Register -// ========== Register definition for PWMC_CH1 peripheral ========== -#define AT91C_PWMC_CH1_Reserved (0xFFFCC234) // (PWMC_CH1) Reserved -#define AT91C_PWMC_CH1_CUPDR (0xFFFCC230) // (PWMC_CH1) Channel Update Register -#define AT91C_PWMC_CH1_CPRDR (0xFFFCC228) // (PWMC_CH1) Channel Period Register -#define AT91C_PWMC_CH1_CCNTR (0xFFFCC22C) // (PWMC_CH1) Channel Counter Register -#define AT91C_PWMC_CH1_CDTYR (0xFFFCC224) // (PWMC_CH1) Channel Duty Cycle Register -#define AT91C_PWMC_CH1_CMR (0xFFFCC220) // (PWMC_CH1) Channel Mode Register -// ========== Register definition for PWMC_CH0 peripheral ========== -#define AT91C_PWMC_CH0_Reserved (0xFFFCC214) // (PWMC_CH0) Reserved -#define AT91C_PWMC_CH0_CPRDR (0xFFFCC208) // (PWMC_CH0) Channel Period Register -#define AT91C_PWMC_CH0_CDTYR (0xFFFCC204) // (PWMC_CH0) Channel Duty Cycle Register -#define AT91C_PWMC_CH0_CMR (0xFFFCC200) // (PWMC_CH0) Channel Mode Register -#define AT91C_PWMC_CH0_CUPDR (0xFFFCC210) // (PWMC_CH0) Channel Update Register -#define AT91C_PWMC_CH0_CCNTR (0xFFFCC20C) // (PWMC_CH0) Channel Counter Register -// ========== Register definition for PWMC peripheral ========== -#define AT91C_PWMC_IDR (0xFFFCC014) // (PWMC) PWMC Interrupt Disable Register -#define AT91C_PWMC_DIS (0xFFFCC008) // (PWMC) PWMC Disable Register -#define AT91C_PWMC_IER (0xFFFCC010) // (PWMC) PWMC Interrupt Enable Register -#define AT91C_PWMC_VR (0xFFFCC0FC) // (PWMC) PWMC Version Register -#define AT91C_PWMC_ISR (0xFFFCC01C) // (PWMC) PWMC Interrupt Status Register -#define AT91C_PWMC_SR (0xFFFCC00C) // (PWMC) PWMC Status Register -#define AT91C_PWMC_IMR (0xFFFCC018) // (PWMC) PWMC Interrupt Mask Register -#define AT91C_PWMC_MR (0xFFFCC000) // (PWMC) PWMC Mode Register -#define AT91C_PWMC_ENA (0xFFFCC004) // (PWMC) PWMC Enable Register -// ========== Register definition for UDP peripheral ========== -#define AT91C_UDP_IMR (0xFFFB0018) // (UDP) Interrupt Mask Register -#define AT91C_UDP_FADDR (0xFFFB0008) // (UDP) Function Address Register -#define AT91C_UDP_NUM (0xFFFB0000) // (UDP) Frame Number Register -#define AT91C_UDP_FDR (0xFFFB0050) // (UDP) Endpoint FIFO Data Register -#define AT91C_UDP_ISR (0xFFFB001C) // (UDP) Interrupt Status Register -#define AT91C_UDP_CSR (0xFFFB0030) // (UDP) Endpoint Control and Status Register -#define AT91C_UDP_IDR (0xFFFB0014) // (UDP) Interrupt Disable Register -#define AT91C_UDP_ICR (0xFFFB0020) // (UDP) Interrupt Clear Register -#define AT91C_UDP_RSTEP (0xFFFB0028) // (UDP) Reset Endpoint Register -#define AT91C_UDP_TXVC (0xFFFB0074) // (UDP) Transceiver Control Register -#define AT91C_UDP_GLBSTATE (0xFFFB0004) // (UDP) Global State Register -#define AT91C_UDP_IER (0xFFFB0010) // (UDP) Interrupt Enable Register -// ========== Register definition for TC0 peripheral ========== -#define AT91C_TC0_SR (0xFFFA0020) // (TC0) Status Register -#define AT91C_TC0_RC (0xFFFA001C) // (TC0) Register C -#define AT91C_TC0_RB (0xFFFA0018) // (TC0) Register B -#define AT91C_TC0_CCR (0xFFFA0000) // (TC0) Channel Control Register -#define AT91C_TC0_CMR (0xFFFA0004) // (TC0) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC0_IER (0xFFFA0024) // (TC0) Interrupt Enable Register -#define AT91C_TC0_RA (0xFFFA0014) // (TC0) Register A -#define AT91C_TC0_IDR (0xFFFA0028) // (TC0) Interrupt Disable Register -#define AT91C_TC0_CV (0xFFFA0010) // (TC0) Counter Value -#define AT91C_TC0_IMR (0xFFFA002C) // (TC0) Interrupt Mask Register -// ========== Register definition for TC1 peripheral ========== -#define AT91C_TC1_RB (0xFFFA0058) // (TC1) Register B -#define AT91C_TC1_CCR (0xFFFA0040) // (TC1) Channel Control Register -#define AT91C_TC1_IER (0xFFFA0064) // (TC1) Interrupt Enable Register -#define AT91C_TC1_IDR (0xFFFA0068) // (TC1) Interrupt Disable Register -#define AT91C_TC1_SR (0xFFFA0060) // (TC1) Status Register -#define AT91C_TC1_CMR (0xFFFA0044) // (TC1) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC1_RA (0xFFFA0054) // (TC1) Register A -#define AT91C_TC1_RC (0xFFFA005C) // (TC1) Register C -#define AT91C_TC1_IMR (0xFFFA006C) // (TC1) Interrupt Mask Register -#define AT91C_TC1_CV (0xFFFA0050) // (TC1) Counter Value -// ========== Register definition for TC2 peripheral ========== -#define AT91C_TC2_CMR (0xFFFA0084) // (TC2) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC2_CCR (0xFFFA0080) // (TC2) Channel Control Register -#define AT91C_TC2_CV (0xFFFA0090) // (TC2) Counter Value -#define AT91C_TC2_RA (0xFFFA0094) // (TC2) Register A -#define AT91C_TC2_RB (0xFFFA0098) // (TC2) Register B -#define AT91C_TC2_IDR (0xFFFA00A8) // (TC2) Interrupt Disable Register -#define AT91C_TC2_IMR (0xFFFA00AC) // (TC2) Interrupt Mask Register -#define AT91C_TC2_RC (0xFFFA009C) // (TC2) Register C -#define AT91C_TC2_IER (0xFFFA00A4) // (TC2) Interrupt Enable Register -#define AT91C_TC2_SR (0xFFFA00A0) // (TC2) Status Register -// ========== Register definition for TCB peripheral ========== -#define AT91C_TCB_BMR (0xFFFA00C4) // (TCB) TC Block Mode Register -#define AT91C_TCB_BCR (0xFFFA00C0) // (TCB) TC Block Control Register -// ========== Register definition for CAN_MB0 peripheral ========== -#define AT91C_CAN_MB0_MDL (0xFFFD0214) // (CAN_MB0) MailBox Data Low Register -#define AT91C_CAN_MB0_MAM (0xFFFD0204) // (CAN_MB0) MailBox Acceptance Mask Register -#define AT91C_CAN_MB0_MCR (0xFFFD021C) // (CAN_MB0) MailBox Control Register -#define AT91C_CAN_MB0_MID (0xFFFD0208) // (CAN_MB0) MailBox ID Register -#define AT91C_CAN_MB0_MSR (0xFFFD0210) // (CAN_MB0) MailBox Status Register -#define AT91C_CAN_MB0_MFID (0xFFFD020C) // (CAN_MB0) MailBox Family ID Register -#define AT91C_CAN_MB0_MDH (0xFFFD0218) // (CAN_MB0) MailBox Data High Register -#define AT91C_CAN_MB0_MMR (0xFFFD0200) // (CAN_MB0) MailBox Mode Register -// ========== Register definition for CAN_MB1 peripheral ========== -#define AT91C_CAN_MB1_MDL (0xFFFD0234) // (CAN_MB1) MailBox Data Low Register -#define AT91C_CAN_MB1_MID (0xFFFD0228) // (CAN_MB1) MailBox ID Register -#define AT91C_CAN_MB1_MMR (0xFFFD0220) // (CAN_MB1) MailBox Mode Register -#define AT91C_CAN_MB1_MSR (0xFFFD0230) // (CAN_MB1) MailBox Status Register -#define AT91C_CAN_MB1_MAM (0xFFFD0224) // (CAN_MB1) MailBox Acceptance Mask Register -#define AT91C_CAN_MB1_MDH (0xFFFD0238) // (CAN_MB1) MailBox Data High Register -#define AT91C_CAN_MB1_MCR (0xFFFD023C) // (CAN_MB1) MailBox Control Register -#define AT91C_CAN_MB1_MFID (0xFFFD022C) // (CAN_MB1) MailBox Family ID Register -// ========== Register definition for CAN_MB2 peripheral ========== -#define AT91C_CAN_MB2_MCR (0xFFFD025C) // (CAN_MB2) MailBox Control Register -#define AT91C_CAN_MB2_MDH (0xFFFD0258) // (CAN_MB2) MailBox Data High Register -#define AT91C_CAN_MB2_MID (0xFFFD0248) // (CAN_MB2) MailBox ID Register -#define AT91C_CAN_MB2_MDL (0xFFFD0254) // (CAN_MB2) MailBox Data Low Register -#define AT91C_CAN_MB2_MMR (0xFFFD0240) // (CAN_MB2) MailBox Mode Register -#define AT91C_CAN_MB2_MAM (0xFFFD0244) // (CAN_MB2) MailBox Acceptance Mask Register -#define AT91C_CAN_MB2_MFID (0xFFFD024C) // (CAN_MB2) MailBox Family ID Register -#define AT91C_CAN_MB2_MSR (0xFFFD0250) // (CAN_MB2) MailBox Status Register -// ========== Register definition for CAN_MB3 peripheral ========== -#define AT91C_CAN_MB3_MFID (0xFFFD026C) // (CAN_MB3) MailBox Family ID Register -#define AT91C_CAN_MB3_MAM (0xFFFD0264) // (CAN_MB3) MailBox Acceptance Mask Register -#define AT91C_CAN_MB3_MID (0xFFFD0268) // (CAN_MB3) MailBox ID Register -#define AT91C_CAN_MB3_MCR (0xFFFD027C) // (CAN_MB3) MailBox Control Register -#define AT91C_CAN_MB3_MMR (0xFFFD0260) // (CAN_MB3) MailBox Mode Register -#define AT91C_CAN_MB3_MSR (0xFFFD0270) // (CAN_MB3) MailBox Status Register -#define AT91C_CAN_MB3_MDL (0xFFFD0274) // (CAN_MB3) MailBox Data Low Register -#define AT91C_CAN_MB3_MDH (0xFFFD0278) // (CAN_MB3) MailBox Data High Register -// ========== Register definition for CAN_MB4 peripheral ========== -#define AT91C_CAN_MB4_MID (0xFFFD0288) // (CAN_MB4) MailBox ID Register -#define AT91C_CAN_MB4_MMR (0xFFFD0280) // (CAN_MB4) MailBox Mode Register -#define AT91C_CAN_MB4_MDH (0xFFFD0298) // (CAN_MB4) MailBox Data High Register -#define AT91C_CAN_MB4_MFID (0xFFFD028C) // (CAN_MB4) MailBox Family ID Register -#define AT91C_CAN_MB4_MSR (0xFFFD0290) // (CAN_MB4) MailBox Status Register -#define AT91C_CAN_MB4_MCR (0xFFFD029C) // (CAN_MB4) MailBox Control Register -#define AT91C_CAN_MB4_MDL (0xFFFD0294) // (CAN_MB4) MailBox Data Low Register -#define AT91C_CAN_MB4_MAM (0xFFFD0284) // (CAN_MB4) MailBox Acceptance Mask Register -// ========== Register definition for CAN_MB5 peripheral ========== -#define AT91C_CAN_MB5_MSR (0xFFFD02B0) // (CAN_MB5) MailBox Status Register -#define AT91C_CAN_MB5_MCR (0xFFFD02BC) // (CAN_MB5) MailBox Control Register -#define AT91C_CAN_MB5_MFID (0xFFFD02AC) // (CAN_MB5) MailBox Family ID Register -#define AT91C_CAN_MB5_MDH (0xFFFD02B8) // (CAN_MB5) MailBox Data High Register -#define AT91C_CAN_MB5_MID (0xFFFD02A8) // (CAN_MB5) MailBox ID Register -#define AT91C_CAN_MB5_MMR (0xFFFD02A0) // (CAN_MB5) MailBox Mode Register -#define AT91C_CAN_MB5_MDL (0xFFFD02B4) // (CAN_MB5) MailBox Data Low Register -#define AT91C_CAN_MB5_MAM (0xFFFD02A4) // (CAN_MB5) MailBox Acceptance Mask Register -// ========== Register definition for CAN_MB6 peripheral ========== -#define AT91C_CAN_MB6_MFID (0xFFFD02CC) // (CAN_MB6) MailBox Family ID Register -#define AT91C_CAN_MB6_MID (0xFFFD02C8) // (CAN_MB6) MailBox ID Register -#define AT91C_CAN_MB6_MAM (0xFFFD02C4) // (CAN_MB6) MailBox Acceptance Mask Register -#define AT91C_CAN_MB6_MSR (0xFFFD02D0) // (CAN_MB6) MailBox Status Register -#define AT91C_CAN_MB6_MDL (0xFFFD02D4) // (CAN_MB6) MailBox Data Low Register -#define AT91C_CAN_MB6_MCR (0xFFFD02DC) // (CAN_MB6) MailBox Control Register -#define AT91C_CAN_MB6_MDH (0xFFFD02D8) // (CAN_MB6) MailBox Data High Register -#define AT91C_CAN_MB6_MMR (0xFFFD02C0) // (CAN_MB6) MailBox Mode Register -// ========== Register definition for CAN_MB7 peripheral ========== -#define AT91C_CAN_MB7_MCR (0xFFFD02FC) // (CAN_MB7) MailBox Control Register -#define AT91C_CAN_MB7_MDH (0xFFFD02F8) // (CAN_MB7) MailBox Data High Register -#define AT91C_CAN_MB7_MFID (0xFFFD02EC) // (CAN_MB7) MailBox Family ID Register -#define AT91C_CAN_MB7_MDL (0xFFFD02F4) // (CAN_MB7) MailBox Data Low Register -#define AT91C_CAN_MB7_MID (0xFFFD02E8) // (CAN_MB7) MailBox ID Register -#define AT91C_CAN_MB7_MMR (0xFFFD02E0) // (CAN_MB7) MailBox Mode Register -#define AT91C_CAN_MB7_MAM (0xFFFD02E4) // (CAN_MB7) MailBox Acceptance Mask Register -#define AT91C_CAN_MB7_MSR (0xFFFD02F0) // (CAN_MB7) MailBox Status Register -// ========== Register definition for CAN peripheral ========== -#define AT91C_CAN_TCR (0xFFFD0024) // (CAN) Transfer Command Register -#define AT91C_CAN_IMR (0xFFFD000C) // (CAN) Interrupt Mask Register -#define AT91C_CAN_IER (0xFFFD0004) // (CAN) Interrupt Enable Register -#define AT91C_CAN_ECR (0xFFFD0020) // (CAN) Error Counter Register -#define AT91C_CAN_TIMESTP (0xFFFD001C) // (CAN) Time Stamp Register -#define AT91C_CAN_MR (0xFFFD0000) // (CAN) Mode Register -#define AT91C_CAN_IDR (0xFFFD0008) // (CAN) Interrupt Disable Register -#define AT91C_CAN_ACR (0xFFFD0028) // (CAN) Abort Command Register -#define AT91C_CAN_TIM (0xFFFD0018) // (CAN) Timer Register -#define AT91C_CAN_SR (0xFFFD0010) // (CAN) Status Register -#define AT91C_CAN_BR (0xFFFD0014) // (CAN) Baudrate Register -#define AT91C_CAN_VR (0xFFFD00FC) // (CAN) Version Register -// ========== Register definition for EMAC peripheral ========== -#define AT91C_EMAC_ISR (0xFFFDC024) // (EMAC) Interrupt Status Register -#define AT91C_EMAC_SA4H (0xFFFDC0B4) // (EMAC) Specific Address 4 Top, Last 2 bytes -#define AT91C_EMAC_SA1L (0xFFFDC098) // (EMAC) Specific Address 1 Bottom, First 4 bytes -#define AT91C_EMAC_ELE (0xFFFDC078) // (EMAC) Excessive Length Errors Register -#define AT91C_EMAC_LCOL (0xFFFDC05C) // (EMAC) Late Collision Register -#define AT91C_EMAC_RLE (0xFFFDC088) // (EMAC) Receive Length Field Mismatch Register -#define AT91C_EMAC_WOL (0xFFFDC0C4) // (EMAC) Wake On LAN Register -#define AT91C_EMAC_DTF (0xFFFDC058) // (EMAC) Deferred Transmission Frame Register -#define AT91C_EMAC_TUND (0xFFFDC064) // (EMAC) Transmit Underrun Error Register -#define AT91C_EMAC_NCR (0xFFFDC000) // (EMAC) Network Control Register -#define AT91C_EMAC_SA4L (0xFFFDC0B0) // (EMAC) Specific Address 4 Bottom, First 4 bytes -#define AT91C_EMAC_RSR (0xFFFDC020) // (EMAC) Receive Status Register -#define AT91C_EMAC_SA3L (0xFFFDC0A8) // (EMAC) Specific Address 3 Bottom, First 4 bytes -#define AT91C_EMAC_TSR (0xFFFDC014) // (EMAC) Transmit Status Register -#define AT91C_EMAC_IDR (0xFFFDC02C) // (EMAC) Interrupt Disable Register -#define AT91C_EMAC_RSE (0xFFFDC074) // (EMAC) Receive Symbol Errors Register -#define AT91C_EMAC_ECOL (0xFFFDC060) // (EMAC) Excessive Collision Register -#define AT91C_EMAC_TID (0xFFFDC0B8) // (EMAC) Type ID Checking Register -#define AT91C_EMAC_HRB (0xFFFDC090) // (EMAC) Hash Address Bottom[31:0] -#define AT91C_EMAC_TBQP (0xFFFDC01C) // (EMAC) Transmit Buffer Queue Pointer -#define AT91C_EMAC_USRIO (0xFFFDC0C0) // (EMAC) USER Input/Output Register -#define AT91C_EMAC_PTR (0xFFFDC038) // (EMAC) Pause Time Register -#define AT91C_EMAC_SA2H (0xFFFDC0A4) // (EMAC) Specific Address 2 Top, Last 2 bytes -#define AT91C_EMAC_ROV (0xFFFDC070) // (EMAC) Receive Overrun Errors Register -#define AT91C_EMAC_ALE (0xFFFDC054) // (EMAC) Alignment Error Register -#define AT91C_EMAC_RJA (0xFFFDC07C) // (EMAC) Receive Jabbers Register -#define AT91C_EMAC_RBQP (0xFFFDC018) // (EMAC) Receive Buffer Queue Pointer -#define AT91C_EMAC_TPF (0xFFFDC08C) // (EMAC) Transmitted Pause Frames Register -#define AT91C_EMAC_NCFGR (0xFFFDC004) // (EMAC) Network Configuration Register -#define AT91C_EMAC_HRT (0xFFFDC094) // (EMAC) Hash Address Top[63:32] -#define AT91C_EMAC_USF (0xFFFDC080) // (EMAC) Undersize Frames Register -#define AT91C_EMAC_FCSE (0xFFFDC050) // (EMAC) Frame Check Sequence Error Register -#define AT91C_EMAC_TPQ (0xFFFDC0BC) // (EMAC) Transmit Pause Quantum Register -#define AT91C_EMAC_MAN (0xFFFDC034) // (EMAC) PHY Maintenance Register -#define AT91C_EMAC_FTO (0xFFFDC040) // (EMAC) Frames Transmitted OK Register -#define AT91C_EMAC_REV (0xFFFDC0FC) // (EMAC) Revision Register -#define AT91C_EMAC_IMR (0xFFFDC030) // (EMAC) Interrupt Mask Register -#define AT91C_EMAC_SCF (0xFFFDC044) // (EMAC) Single Collision Frame Register -#define AT91C_EMAC_PFR (0xFFFDC03C) // (EMAC) Pause Frames received Register -#define AT91C_EMAC_MCF (0xFFFDC048) // (EMAC) Multiple Collision Frame Register -#define AT91C_EMAC_NSR (0xFFFDC008) // (EMAC) Network Status Register -#define AT91C_EMAC_SA2L (0xFFFDC0A0) // (EMAC) Specific Address 2 Bottom, First 4 bytes -#define AT91C_EMAC_FRO (0xFFFDC04C) // (EMAC) Frames Received OK Register -#define AT91C_EMAC_IER (0xFFFDC028) // (EMAC) Interrupt Enable Register -#define AT91C_EMAC_SA1H (0xFFFDC09C) // (EMAC) Specific Address 1 Top, Last 2 bytes -#define AT91C_EMAC_CSE (0xFFFDC068) // (EMAC) Carrier Sense Error Register -#define AT91C_EMAC_SA3H (0xFFFDC0AC) // (EMAC) Specific Address 3 Top, Last 2 bytes -#define AT91C_EMAC_RRE (0xFFFDC06C) // (EMAC) Receive Ressource Error Register -#define AT91C_EMAC_STE (0xFFFDC084) // (EMAC) SQE Test Error Register -// ========== Register definition for PDC_ADC peripheral ========== -#define AT91C_ADC_PTSR (0xFFFD8124) // (PDC_ADC) PDC Transfer Status Register -#define AT91C_ADC_PTCR (0xFFFD8120) // (PDC_ADC) PDC Transfer Control Register -#define AT91C_ADC_TNPR (0xFFFD8118) // (PDC_ADC) Transmit Next Pointer Register -#define AT91C_ADC_TNCR (0xFFFD811C) // (PDC_ADC) Transmit Next Counter Register -#define AT91C_ADC_RNPR (0xFFFD8110) // (PDC_ADC) Receive Next Pointer Register -#define AT91C_ADC_RNCR (0xFFFD8114) // (PDC_ADC) Receive Next Counter Register -#define AT91C_ADC_RPR (0xFFFD8100) // (PDC_ADC) Receive Pointer Register -#define AT91C_ADC_TCR (0xFFFD810C) // (PDC_ADC) Transmit Counter Register -#define AT91C_ADC_TPR (0xFFFD8108) // (PDC_ADC) Transmit Pointer Register -#define AT91C_ADC_RCR (0xFFFD8104) // (PDC_ADC) Receive Counter Register -// ========== Register definition for ADC peripheral ========== -#define AT91C_ADC_CDR2 (0xFFFD8038) // (ADC) ADC Channel Data Register 2 -#define AT91C_ADC_CDR3 (0xFFFD803C) // (ADC) ADC Channel Data Register 3 -#define AT91C_ADC_CDR0 (0xFFFD8030) // (ADC) ADC Channel Data Register 0 -#define AT91C_ADC_CDR5 (0xFFFD8044) // (ADC) ADC Channel Data Register 5 -#define AT91C_ADC_CHDR (0xFFFD8014) // (ADC) ADC Channel Disable Register -#define AT91C_ADC_SR (0xFFFD801C) // (ADC) ADC Status Register -#define AT91C_ADC_CDR4 (0xFFFD8040) // (ADC) ADC Channel Data Register 4 -#define AT91C_ADC_CDR1 (0xFFFD8034) // (ADC) ADC Channel Data Register 1 -#define AT91C_ADC_LCDR (0xFFFD8020) // (ADC) ADC Last Converted Data Register -#define AT91C_ADC_IDR (0xFFFD8028) // (ADC) ADC Interrupt Disable Register -#define AT91C_ADC_CR (0xFFFD8000) // (ADC) ADC Control Register -#define AT91C_ADC_CDR7 (0xFFFD804C) // (ADC) ADC Channel Data Register 7 -#define AT91C_ADC_CDR6 (0xFFFD8048) // (ADC) ADC Channel Data Register 6 -#define AT91C_ADC_IER (0xFFFD8024) // (ADC) ADC Interrupt Enable Register -#define AT91C_ADC_CHER (0xFFFD8010) // (ADC) ADC Channel Enable Register -#define AT91C_ADC_CHSR (0xFFFD8018) // (ADC) ADC Channel Status Register -#define AT91C_ADC_MR (0xFFFD8004) // (ADC) ADC Mode Register -#define AT91C_ADC_IMR (0xFFFD802C) // (ADC) ADC Interrupt Mask Register - -// ***************************************************************************** -// PIO DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_PIO_PA0 (1 << 0) // Pin Controlled by PA0 -#define AT91C_PA0_RXD0 (AT91C_PIO_PA0) // USART 0 Receive Data -#define AT91C_PIO_PA1 (1 << 1) // Pin Controlled by PA1 -#define AT91C_PA1_TXD0 (AT91C_PIO_PA1) // USART 0 Transmit Data -#define AT91C_PIO_PA10 (1 << 10) // Pin Controlled by PA10 -#define AT91C_PA10_TWD (AT91C_PIO_PA10) // TWI Two-wire Serial Data -#define AT91C_PIO_PA11 (1 << 11) // Pin Controlled by PA11 -#define AT91C_PA11_TWCK (AT91C_PIO_PA11) // TWI Two-wire Serial Clock -#define AT91C_PIO_PA12 (1 << 12) // Pin Controlled by PA12 -#define AT91C_PA12_SPI0_NPCS0 (AT91C_PIO_PA12) // SPI 0 Peripheral Chip Select 0 -#define AT91C_PIO_PA13 (1 << 13) // Pin Controlled by PA13 -#define AT91C_PA13_SPI0_NPCS1 (AT91C_PIO_PA13) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PA13_PCK1 (AT91C_PIO_PA13) // PMC Programmable Clock Output 1 -#define AT91C_PIO_PA14 (1 << 14) // Pin Controlled by PA14 -#define AT91C_PA14_SPI0_NPCS2 (AT91C_PIO_PA14) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PA14_IRQ1 (AT91C_PIO_PA14) // External Interrupt 1 -#define AT91C_PIO_PA15 (1 << 15) // Pin Controlled by PA15 -#define AT91C_PA15_SPI0_NPCS3 (AT91C_PIO_PA15) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PA15_TCLK2 (AT91C_PIO_PA15) // Timer Counter 2 external clock input -#define AT91C_PIO_PA16 (1 << 16) // Pin Controlled by PA16 -#define AT91C_PA16_SPI0_MISO (AT91C_PIO_PA16) // SPI 0 Master In Slave -#define AT91C_PIO_PA17 (1 << 17) // Pin Controlled by PA17 -#define AT91C_PA17_SPI0_MOSI (AT91C_PIO_PA17) // SPI 0 Master Out Slave -#define AT91C_PIO_PA18 (1 << 18) // Pin Controlled by PA18 -#define AT91C_PA18_SPI0_SPCK (AT91C_PIO_PA18) // SPI 0 Serial Clock -#define AT91C_PIO_PA19 (1 << 19) // Pin Controlled by PA19 -#define AT91C_PA19_CANRX (AT91C_PIO_PA19) // CAN Receive -#define AT91C_PIO_PA2 (1 << 2) // Pin Controlled by PA2 -#define AT91C_PA2_SCK0 (AT91C_PIO_PA2) // USART 0 Serial Clock -#define AT91C_PA2_SPI1_NPCS1 (AT91C_PIO_PA2) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PA20 (1 << 20) // Pin Controlled by PA20 -#define AT91C_PA20_CANTX (AT91C_PIO_PA20) // CAN Transmit -#define AT91C_PIO_PA21 (1 << 21) // Pin Controlled by PA21 -#define AT91C_PA21_TF (AT91C_PIO_PA21) // SSC Transmit Frame Sync -#define AT91C_PA21_SPI1_NPCS0 (AT91C_PIO_PA21) // SPI 1 Peripheral Chip Select 0 -#define AT91C_PIO_PA22 (1 << 22) // Pin Controlled by PA22 -#define AT91C_PA22_TK (AT91C_PIO_PA22) // SSC Transmit Clock -#define AT91C_PA22_SPI1_SPCK (AT91C_PIO_PA22) // SPI 1 Serial Clock -#define AT91C_PIO_PA23 (1 << 23) // Pin Controlled by PA23 -#define AT91C_PA23_TD (AT91C_PIO_PA23) // SSC Transmit data -#define AT91C_PA23_SPI1_MOSI (AT91C_PIO_PA23) // SPI 1 Master Out Slave -#define AT91C_PIO_PA24 (1 << 24) // Pin Controlled by PA24 -#define AT91C_PA24_RD (AT91C_PIO_PA24) // SSC Receive Data -#define AT91C_PA24_SPI1_MISO (AT91C_PIO_PA24) // SPI 1 Master In Slave -#define AT91C_PIO_PA25 (1 << 25) // Pin Controlled by PA25 -#define AT91C_PA25_RK (AT91C_PIO_PA25) // SSC Receive Clock -#define AT91C_PA25_SPI1_NPCS1 (AT91C_PIO_PA25) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PA26 (1 << 26) // Pin Controlled by PA26 -#define AT91C_PA26_RF (AT91C_PIO_PA26) // SSC Receive Frame Sync -#define AT91C_PA26_SPI1_NPCS2 (AT91C_PIO_PA26) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PA27 (1 << 27) // Pin Controlled by PA27 -#define AT91C_PA27_DRXD (AT91C_PIO_PA27) // DBGU Debug Receive Data -#define AT91C_PA27_PCK3 (AT91C_PIO_PA27) // PMC Programmable Clock Output 3 -#define AT91C_PIO_PA28 (1 << 28) // Pin Controlled by PA28 -#define AT91C_PA28_DTXD (AT91C_PIO_PA28) // DBGU Debug Transmit Data -#define AT91C_PIO_PA29 (1 << 29) // Pin Controlled by PA29 -#define AT91C_PA29_FIQ (AT91C_PIO_PA29) // AIC Fast Interrupt Input -#define AT91C_PA29_SPI1_NPCS3 (AT91C_PIO_PA29) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PA3 (1 << 3) // Pin Controlled by PA3 -#define AT91C_PA3_RTS0 (AT91C_PIO_PA3) // USART 0 Ready To Send -#define AT91C_PA3_SPI1_NPCS2 (AT91C_PIO_PA3) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PA30 (1 << 30) // Pin Controlled by PA30 -#define AT91C_PA30_IRQ0 (AT91C_PIO_PA30) // External Interrupt 0 -#define AT91C_PA30_PCK2 (AT91C_PIO_PA30) // PMC Programmable Clock Output 2 -#define AT91C_PIO_PA4 (1 << 4) // Pin Controlled by PA4 -#define AT91C_PA4_CTS0 (AT91C_PIO_PA4) // USART 0 Clear To Send -#define AT91C_PA4_SPI1_NPCS3 (AT91C_PIO_PA4) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PA5 (1 << 5) // Pin Controlled by PA5 -#define AT91C_PA5_RXD1 (AT91C_PIO_PA5) // USART 1 Receive Data -#define AT91C_PIO_PA6 (1 << 6) // Pin Controlled by PA6 -#define AT91C_PA6_TXD1 (AT91C_PIO_PA6) // USART 1 Transmit Data -#define AT91C_PIO_PA7 (1 << 7) // Pin Controlled by PA7 -#define AT91C_PA7_SCK1 (AT91C_PIO_PA7) // USART 1 Serial Clock -#define AT91C_PA7_SPI0_NPCS1 (AT91C_PIO_PA7) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PIO_PA8 (1 << 8) // Pin Controlled by PA8 -#define AT91C_PA8_RTS1 (AT91C_PIO_PA8) // USART 1 Ready To Send -#define AT91C_PA8_SPI0_NPCS2 (AT91C_PIO_PA8) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PIO_PA9 (1 << 9) // Pin Controlled by PA9 -#define AT91C_PA9_CTS1 (AT91C_PIO_PA9) // USART 1 Clear To Send -#define AT91C_PA9_SPI0_NPCS3 (AT91C_PIO_PA9) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PIO_PB0 (1 << 0) // Pin Controlled by PB0 -#define AT91C_PB0_ETXCK_EREFCK (AT91C_PIO_PB0) // Ethernet MAC Transmit Clock/Reference Clock -#define AT91C_PB0_PCK0 (AT91C_PIO_PB0) // PMC Programmable Clock Output 0 -#define AT91C_PIO_PB1 (1 << 1) // Pin Controlled by PB1 -#define AT91C_PB1_ETXEN (AT91C_PIO_PB1) // Ethernet MAC Transmit Enable -#define AT91C_PIO_PB10 (1 << 10) // Pin Controlled by PB10 -#define AT91C_PB10_ETX2 (AT91C_PIO_PB10) // Ethernet MAC Transmit Data 2 -#define AT91C_PB10_SPI1_NPCS1 (AT91C_PIO_PB10) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PB11 (1 << 11) // Pin Controlled by PB11 -#define AT91C_PB11_ETX3 (AT91C_PIO_PB11) // Ethernet MAC Transmit Data 3 -#define AT91C_PB11_SPI1_NPCS2 (AT91C_PIO_PB11) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PB12 (1 << 12) // Pin Controlled by PB12 -#define AT91C_PB12_ETXER (AT91C_PIO_PB12) // Ethernet MAC Transmikt Coding Error -#define AT91C_PB12_TCLK0 (AT91C_PIO_PB12) // Timer Counter 0 external clock input -#define AT91C_PIO_PB13 (1 << 13) // Pin Controlled by PB13 -#define AT91C_PB13_ERX2 (AT91C_PIO_PB13) // Ethernet MAC Receive Data 2 -#define AT91C_PB13_SPI0_NPCS1 (AT91C_PIO_PB13) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PIO_PB14 (1 << 14) // Pin Controlled by PB14 -#define AT91C_PB14_ERX3 (AT91C_PIO_PB14) // Ethernet MAC Receive Data 3 -#define AT91C_PB14_SPI0_NPCS2 (AT91C_PIO_PB14) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PIO_PB15 (1 << 15) // Pin Controlled by PB15 -#define AT91C_PB15_ERXDV_ECRSDV (AT91C_PIO_PB15) // Ethernet MAC Receive Data Valid -#define AT91C_PIO_PB16 (1 << 16) // Pin Controlled by PB16 -#define AT91C_PB16_ECOL (AT91C_PIO_PB16) // Ethernet MAC Collision Detected -#define AT91C_PB16_SPI1_NPCS3 (AT91C_PIO_PB16) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PB17 (1 << 17) // Pin Controlled by PB17 -#define AT91C_PB17_ERXCK (AT91C_PIO_PB17) // Ethernet MAC Receive Clock -#define AT91C_PB17_SPI0_NPCS3 (AT91C_PIO_PB17) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PIO_PB18 (1 << 18) // Pin Controlled by PB18 -#define AT91C_PB18_EF100 (AT91C_PIO_PB18) // Ethernet MAC Force 100 Mbits/sec -#define AT91C_PB18_ADTRG (AT91C_PIO_PB18) // ADC External Trigger -#define AT91C_PIO_PB19 (1 << 19) // Pin Controlled by PB19 -#define AT91C_PB19_PWM0 (AT91C_PIO_PB19) // PWM Channel 0 -#define AT91C_PB19_TCLK1 (AT91C_PIO_PB19) // Timer Counter 1 external clock input -#define AT91C_PIO_PB2 (1 << 2) // Pin Controlled by PB2 -#define AT91C_PB2_ETX0 (AT91C_PIO_PB2) // Ethernet MAC Transmit Data 0 -#define AT91C_PIO_PB20 (1 << 20) // Pin Controlled by PB20 -#define AT91C_PB20_PWM1 (AT91C_PIO_PB20) // PWM Channel 1 -#define AT91C_PB20_PCK0 (AT91C_PIO_PB20) // PMC Programmable Clock Output 0 -#define AT91C_PIO_PB21 (1 << 21) // Pin Controlled by PB21 -#define AT91C_PB21_PWM2 (AT91C_PIO_PB21) // PWM Channel 2 -#define AT91C_PB21_PCK1 (AT91C_PIO_PB21) // PMC Programmable Clock Output 1 -#define AT91C_PIO_PB22 (1 << 22) // Pin Controlled by PB22 -#define AT91C_PB22_PWM3 (AT91C_PIO_PB22) // PWM Channel 3 -#define AT91C_PB22_PCK2 (AT91C_PIO_PB22) // PMC Programmable Clock Output 2 -#define AT91C_PIO_PB23 (1 << 23) // Pin Controlled by PB23 -#define AT91C_PB23_TIOA0 (AT91C_PIO_PB23) // Timer Counter 0 Multipurpose Timer I/O Pin A -#define AT91C_PB23_DCD1 (AT91C_PIO_PB23) // USART 1 Data Carrier Detect -#define AT91C_PIO_PB24 (1 << 24) // Pin Controlled by PB24 -#define AT91C_PB24_TIOB0 (AT91C_PIO_PB24) // Timer Counter 0 Multipurpose Timer I/O Pin B -#define AT91C_PB24_DSR1 (AT91C_PIO_PB24) // USART 1 Data Set ready -#define AT91C_PIO_PB25 (1 << 25) // Pin Controlled by PB25 -#define AT91C_PB25_TIOA1 (AT91C_PIO_PB25) // Timer Counter 1 Multipurpose Timer I/O Pin A -#define AT91C_PB25_DTR1 (AT91C_PIO_PB25) // USART 1 Data Terminal ready -#define AT91C_PIO_PB26 (1 << 26) // Pin Controlled by PB26 -#define AT91C_PB26_TIOB1 (AT91C_PIO_PB26) // Timer Counter 1 Multipurpose Timer I/O Pin B -#define AT91C_PB26_RI1 (AT91C_PIO_PB26) // USART 1 Ring Indicator -#define AT91C_PIO_PB27 (1 << 27) // Pin Controlled by PB27 -#define AT91C_PB27_TIOA2 (AT91C_PIO_PB27) // Timer Counter 2 Multipurpose Timer I/O Pin A -#define AT91C_PB27_PWM0 (AT91C_PIO_PB27) // PWM Channel 0 -#define AT91C_PIO_PB28 (1 << 28) // Pin Controlled by PB28 -#define AT91C_PB28_TIOB2 (AT91C_PIO_PB28) // Timer Counter 2 Multipurpose Timer I/O Pin B -#define AT91C_PB28_PWM1 (AT91C_PIO_PB28) // PWM Channel 1 -#define AT91C_PIO_PB29 (1 << 29) // Pin Controlled by PB29 -#define AT91C_PB29_PCK1 (AT91C_PIO_PB29) // PMC Programmable Clock Output 1 -#define AT91C_PB29_PWM2 (AT91C_PIO_PB29) // PWM Channel 2 -#define AT91C_PIO_PB3 (1 << 3) // Pin Controlled by PB3 -#define AT91C_PB3_ETX1 (AT91C_PIO_PB3) // Ethernet MAC Transmit Data 1 -#define AT91C_PIO_PB30 (1 << 30) // Pin Controlled by PB30 -#define AT91C_PB30_PCK2 (AT91C_PIO_PB30) // PMC Programmable Clock Output 2 -#define AT91C_PB30_PWM3 (AT91C_PIO_PB30) // PWM Channel 3 -#define AT91C_PIO_PB4 (1 << 4) // Pin Controlled by PB4 -#define AT91C_PB4_ECRS (AT91C_PIO_PB4) // Ethernet MAC Carrier Sense/Carrier Sense and Data Valid -#define AT91C_PIO_PB5 (1 << 5) // Pin Controlled by PB5 -#define AT91C_PB5_ERX0 (AT91C_PIO_PB5) // Ethernet MAC Receive Data 0 -#define AT91C_PIO_PB6 (1 << 6) // Pin Controlled by PB6 -#define AT91C_PB6_ERX1 (AT91C_PIO_PB6) // Ethernet MAC Receive Data 1 -#define AT91C_PIO_PB7 (1 << 7) // Pin Controlled by PB7 -#define AT91C_PB7_ERXER (AT91C_PIO_PB7) // Ethernet MAC Receive Error -#define AT91C_PIO_PB8 (1 << 8) // Pin Controlled by PB8 -#define AT91C_PB8_EMDC (AT91C_PIO_PB8) // Ethernet MAC Management Data Clock -#define AT91C_PIO_PB9 (1 << 9) // Pin Controlled by PB9 -#define AT91C_PB9_EMDIO (AT91C_PIO_PB9) // Ethernet MAC Management Data Input/Output - -// ***************************************************************************** -// PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_ID_FIQ ( 0) // Advanced Interrupt Controller (FIQ) -#define AT91C_ID_SYS ( 1) // System Peripheral -#define AT91C_ID_PIOA ( 2) // Parallel IO Controller A -#define AT91C_ID_PIOB ( 3) // Parallel IO Controller B -#define AT91C_ID_SPI0 ( 4) // Serial Peripheral Interface 0 -#define AT91C_ID_SPI1 ( 5) // Serial Peripheral Interface 1 -#define AT91C_ID_US0 ( 6) // USART 0 -#define AT91C_ID_US1 ( 7) // USART 1 -#define AT91C_ID_SSC ( 8) // Serial Synchronous Controller -#define AT91C_ID_TWI ( 9) // Two-Wire Interface -#define AT91C_ID_PWMC (10) // PWM Controller -#define AT91C_ID_UDP (11) // USB Device Port -#define AT91C_ID_TC0 (12) // Timer Counter 0 -#define AT91C_ID_TC1 (13) // Timer Counter 1 -#define AT91C_ID_TC2 (14) // Timer Counter 2 -#define AT91C_ID_CAN (15) // Control Area Network Controller -#define AT91C_ID_EMAC (16) // Ethernet MAC -#define AT91C_ID_ADC (17) // Analog-to-Digital Converter -#define AT91C_ID_18_Reserved (18) // Reserved -#define AT91C_ID_19_Reserved (19) // Reserved -#define AT91C_ID_20_Reserved (20) // Reserved -#define AT91C_ID_21_Reserved (21) // Reserved -#define AT91C_ID_22_Reserved (22) // Reserved -#define AT91C_ID_23_Reserved (23) // Reserved -#define AT91C_ID_24_Reserved (24) // Reserved -#define AT91C_ID_25_Reserved (25) // Reserved -#define AT91C_ID_26_Reserved (26) // Reserved -#define AT91C_ID_27_Reserved (27) // Reserved -#define AT91C_ID_28_Reserved (28) // Reserved -#define AT91C_ID_29_Reserved (29) // Reserved -#define AT91C_ID_IRQ0 (30) // Advanced Interrupt Controller (IRQ0) -#define AT91C_ID_IRQ1 (31) // Advanced Interrupt Controller (IRQ1) -#define AT91C_ALL_INT (0xC003FFFF) // ALL VALID INTERRUPTS - -// ***************************************************************************** -// BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_BASE_SYS (0xFFFFF000) // (SYS) Base Address -#define AT91C_BASE_AIC (0xFFFFF000) // (AIC) Base Address -#define AT91C_BASE_PDC_DBGU (0xFFFFF300) // (PDC_DBGU) Base Address -#define AT91C_BASE_DBGU (0xFFFFF200) // (DBGU) Base Address -#define AT91C_BASE_PIOA (0xFFFFF400) // (PIOA) Base Address -#define AT91C_BASE_PIOB (0xFFFFF600) // (PIOB) Base Address -#define AT91C_BASE_CKGR (0xFFFFFC20) // (CKGR) Base Address -#define AT91C_BASE_PMC (0xFFFFFC00) // (PMC) Base Address -#define AT91C_BASE_RSTC (0xFFFFFD00) // (RSTC) Base Address -#define AT91C_BASE_RTTC (0xFFFFFD20) // (RTTC) Base Address -#define AT91C_BASE_PITC (0xFFFFFD30) // (PITC) Base Address -#define AT91C_BASE_WDTC (0xFFFFFD40) // (WDTC) Base Address -#define AT91C_BASE_VREG (0xFFFFFD60) // (VREG) Base Address -#define AT91C_BASE_MC (0xFFFFFF00) // (MC) Base Address -#define AT91C_BASE_PDC_SPI1 (0xFFFE4100) // (PDC_SPI1) Base Address -#define AT91C_BASE_SPI1 (0xFFFE4000) // (SPI1) Base Address -#define AT91C_BASE_PDC_SPI0 (0xFFFE0100) // (PDC_SPI0) Base Address -#define AT91C_BASE_SPI0 (0xFFFE0000) // (SPI0) Base Address -#define AT91C_BASE_PDC_US1 (0xFFFC4100) // (PDC_US1) Base Address -#define AT91C_BASE_US1 (0xFFFC4000) // (US1) Base Address -#define AT91C_BASE_PDC_US0 (0xFFFC0100) // (PDC_US0) Base Address -#define AT91C_BASE_US0 (0xFFFC0000) // (US0) Base Address -#define AT91C_BASE_PDC_SSC (0xFFFD4100) // (PDC_SSC) Base Address -#define AT91C_BASE_SSC (0xFFFD4000) // (SSC) Base Address -#define AT91C_BASE_TWI (0xFFFB8000) // (TWI) Base Address -#define AT91C_BASE_PWMC_CH3 (0xFFFCC260) // (PWMC_CH3) Base Address -#define AT91C_BASE_PWMC_CH2 (0xFFFCC240) // (PWMC_CH2) Base Address -#define AT91C_BASE_PWMC_CH1 (0xFFFCC220) // (PWMC_CH1) Base Address -#define AT91C_BASE_PWMC_CH0 (0xFFFCC200) // (PWMC_CH0) Base Address -#define AT91C_BASE_PWMC (0xFFFCC000) // (PWMC) Base Address -#define AT91C_BASE_UDP (0xFFFB0000) // (UDP) Base Address -#define AT91C_BASE_TC0 (0xFFFA0000) // (TC0) Base Address -#define AT91C_BASE_TC1 (0xFFFA0040) // (TC1) Base Address -#define AT91C_BASE_TC2 (0xFFFA0080) // (TC2) Base Address -#define AT91C_BASE_TCB (0xFFFA0000) // (TCB) Base Address -#define AT91C_BASE_CAN_MB0 (0xFFFD0200) // (CAN_MB0) Base Address -#define AT91C_BASE_CAN_MB1 (0xFFFD0220) // (CAN_MB1) Base Address -#define AT91C_BASE_CAN_MB2 (0xFFFD0240) // (CAN_MB2) Base Address -#define AT91C_BASE_CAN_MB3 (0xFFFD0260) // (CAN_MB3) Base Address -#define AT91C_BASE_CAN_MB4 (0xFFFD0280) // (CAN_MB4) Base Address -#define AT91C_BASE_CAN_MB5 (0xFFFD02A0) // (CAN_MB5) Base Address -#define AT91C_BASE_CAN_MB6 (0xFFFD02C0) // (CAN_MB6) Base Address -#define AT91C_BASE_CAN_MB7 (0xFFFD02E0) // (CAN_MB7) Base Address -#define AT91C_BASE_CAN (0xFFFD0000) // (CAN) Base Address -#define AT91C_BASE_EMAC (0xFFFDC000) // (EMAC) Base Address -#define AT91C_BASE_PDC_ADC (0xFFFD8100) // (PDC_ADC) Base Address -#define AT91C_BASE_ADC (0xFFFD8000) // (ADC) Base Address - -// ***************************************************************************** -// MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -// ISRAM -#define AT91C_ISRAM (0x00200000) // Internal SRAM base address -#define AT91C_ISRAM_SIZE (0x00010000) // Internal SRAM size in byte (64 Kbytes) -// IFLASH -#define AT91C_IFLASH (0x00100000) // Internal FLASH base address -#define AT91C_IFLASH_SIZE (0x00040000) // Internal FLASH size in byte (256 Kbytes) -#define AT91C_IFLASH_PAGE_SIZE (256) // Internal FLASH Page Size: 256 bytes -#define AT91C_IFLASH_LOCK_REGION_SIZE (16384) // Internal FLASH Lock Region Size: 16 Kbytes -#define AT91C_IFLASH_NB_OF_PAGES (1024) // Internal FLASH Number of Pages: 1024 bytes -#define AT91C_IFLASH_NB_OF_LOCK_BITS (16) // Internal FLASH Number of Lock Bits: 16 bytes - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/ioat91sam7x256.h b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/ioat91sam7x256.h deleted file mode 100644 index ab71b9332..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/ioat91sam7x256.h +++ /dev/null @@ -1,4380 +0,0 @@ -// - ---------------------------------------------------------------------------- -// - ATMEL Microcontroller Software Support - ROUSSET - -// - ---------------------------------------------------------------------------- -// - DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// - DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h -// - Object : AT91SAM7X256 definitions -// - Generated : AT91 SW Application Group 11/02/2005 (15:17:24) -// - -// - CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// -// - CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// -// - CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// -// - CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// -// - CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// -// - CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// -// - CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// -// - CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// -// - CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// -// - CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// -// - CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// -// - CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// -// - CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// -// - CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// -// - CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// -// - CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// -// - CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// -// - CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// -// - CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// -// - CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// -// - CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// -// - CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// -// - CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// -// - ---------------------------------------------------------------------------- - -#ifndef AT91SAM7X256_H -#define AT91SAM7X256_H - -#ifdef __IAR_SYSTEMS_ICC__ - -typedef volatile unsigned int AT91_REG;// Hardware register definition - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR System Peripherals -// ***************************************************************************** -typedef struct _AT91S_SYS { - AT91_REG AIC_SMR[32]; // Source Mode Register - AT91_REG AIC_SVR[32]; // Source Vector Register - AT91_REG AIC_IVR; // IRQ Vector Register - AT91_REG AIC_FVR; // FIQ Vector Register - AT91_REG AIC_ISR; // Interrupt Status Register - AT91_REG AIC_IPR; // Interrupt Pending Register - AT91_REG AIC_IMR; // Interrupt Mask Register - AT91_REG AIC_CISR; // Core Interrupt Status Register - AT91_REG Reserved0[2]; // - AT91_REG AIC_IECR; // Interrupt Enable Command Register - AT91_REG AIC_IDCR; // Interrupt Disable Command Register - AT91_REG AIC_ICCR; // Interrupt Clear Command Register - AT91_REG AIC_ISCR; // Interrupt Set Command Register - AT91_REG AIC_EOICR; // End of Interrupt Command Register - AT91_REG AIC_SPU; // Spurious Vector Register - AT91_REG AIC_DCR; // Debug Control Register (Protect) - AT91_REG Reserved1[1]; // - AT91_REG AIC_FFER; // Fast Forcing Enable Register - AT91_REG AIC_FFDR; // Fast Forcing Disable Register - AT91_REG AIC_FFSR; // Fast Forcing Status Register - AT91_REG Reserved2[45]; // - AT91_REG DBGU_CR; // Control Register - AT91_REG DBGU_MR; // Mode Register - AT91_REG DBGU_IER; // Interrupt Enable Register - AT91_REG DBGU_IDR; // Interrupt Disable Register - AT91_REG DBGU_IMR; // Interrupt Mask Register - AT91_REG DBGU_CSR; // Channel Status Register - AT91_REG DBGU_RHR; // Receiver Holding Register - AT91_REG DBGU_THR; // Transmitter Holding Register - AT91_REG DBGU_BRGR; // Baud Rate Generator Register - AT91_REG Reserved3[7]; // - AT91_REG DBGU_CIDR; // Chip ID Register - AT91_REG DBGU_EXID; // Chip ID Extension Register - AT91_REG DBGU_FNTR; // Force NTRST Register - AT91_REG Reserved4[45]; // - AT91_REG DBGU_RPR; // Receive Pointer Register - AT91_REG DBGU_RCR; // Receive Counter Register - AT91_REG DBGU_TPR; // Transmit Pointer Register - AT91_REG DBGU_TCR; // Transmit Counter Register - AT91_REG DBGU_RNPR; // Receive Next Pointer Register - AT91_REG DBGU_RNCR; // Receive Next Counter Register - AT91_REG DBGU_TNPR; // Transmit Next Pointer Register - AT91_REG DBGU_TNCR; // Transmit Next Counter Register - AT91_REG DBGU_PTCR; // PDC Transfer Control Register - AT91_REG DBGU_PTSR; // PDC Transfer Status Register - AT91_REG Reserved5[54]; // - AT91_REG PIOA_PER; // PIO Enable Register - AT91_REG PIOA_PDR; // PIO Disable Register - AT91_REG PIOA_PSR; // PIO Status Register - AT91_REG Reserved6[1]; // - AT91_REG PIOA_OER; // Output Enable Register - AT91_REG PIOA_ODR; // Output Disable Registerr - AT91_REG PIOA_OSR; // Output Status Register - AT91_REG Reserved7[1]; // - AT91_REG PIOA_IFER; // Input Filter Enable Register - AT91_REG PIOA_IFDR; // Input Filter Disable Register - AT91_REG PIOA_IFSR; // Input Filter Status Register - AT91_REG Reserved8[1]; // - AT91_REG PIOA_SODR; // Set Output Data Register - AT91_REG PIOA_CODR; // Clear Output Data Register - AT91_REG PIOA_ODSR; // Output Data Status Register - AT91_REG PIOA_PDSR; // Pin Data Status Register - AT91_REG PIOA_IER; // Interrupt Enable Register - AT91_REG PIOA_IDR; // Interrupt Disable Register - AT91_REG PIOA_IMR; // Interrupt Mask Register - AT91_REG PIOA_ISR; // Interrupt Status Register - AT91_REG PIOA_MDER; // Multi-driver Enable Register - AT91_REG PIOA_MDDR; // Multi-driver Disable Register - AT91_REG PIOA_MDSR; // Multi-driver Status Register - AT91_REG Reserved9[1]; // - AT91_REG PIOA_PPUDR; // Pull-up Disable Register - AT91_REG PIOA_PPUER; // Pull-up Enable Register - AT91_REG PIOA_PPUSR; // Pull-up Status Register - AT91_REG Reserved10[1]; // - AT91_REG PIOA_ASR; // Select A Register - AT91_REG PIOA_BSR; // Select B Register - AT91_REG PIOA_ABSR; // AB Select Status Register - AT91_REG Reserved11[9]; // - AT91_REG PIOA_OWER; // Output Write Enable Register - AT91_REG PIOA_OWDR; // Output Write Disable Register - AT91_REG PIOA_OWSR; // Output Write Status Register - AT91_REG Reserved12[85]; // - AT91_REG PIOB_PER; // PIO Enable Register - AT91_REG PIOB_PDR; // PIO Disable Register - AT91_REG PIOB_PSR; // PIO Status Register - AT91_REG Reserved13[1]; // - AT91_REG PIOB_OER; // Output Enable Register - AT91_REG PIOB_ODR; // Output Disable Registerr - AT91_REG PIOB_OSR; // Output Status Register - AT91_REG Reserved14[1]; // - AT91_REG PIOB_IFER; // Input Filter Enable Register - AT91_REG PIOB_IFDR; // Input Filter Disable Register - AT91_REG PIOB_IFSR; // Input Filter Status Register - AT91_REG Reserved15[1]; // - AT91_REG PIOB_SODR; // Set Output Data Register - AT91_REG PIOB_CODR; // Clear Output Data Register - AT91_REG PIOB_ODSR; // Output Data Status Register - AT91_REG PIOB_PDSR; // Pin Data Status Register - AT91_REG PIOB_IER; // Interrupt Enable Register - AT91_REG PIOB_IDR; // Interrupt Disable Register - AT91_REG PIOB_IMR; // Interrupt Mask Register - AT91_REG PIOB_ISR; // Interrupt Status Register - AT91_REG PIOB_MDER; // Multi-driver Enable Register - AT91_REG PIOB_MDDR; // Multi-driver Disable Register - AT91_REG PIOB_MDSR; // Multi-driver Status Register - AT91_REG Reserved16[1]; // - AT91_REG PIOB_PPUDR; // Pull-up Disable Register - AT91_REG PIOB_PPUER; // Pull-up Enable Register - AT91_REG PIOB_PPUSR; // Pull-up Status Register - AT91_REG Reserved17[1]; // - AT91_REG PIOB_ASR; // Select A Register - AT91_REG PIOB_BSR; // Select B Register - AT91_REG PIOB_ABSR; // AB Select Status Register - AT91_REG Reserved18[9]; // - AT91_REG PIOB_OWER; // Output Write Enable Register - AT91_REG PIOB_OWDR; // Output Write Disable Register - AT91_REG PIOB_OWSR; // Output Write Status Register - AT91_REG Reserved19[341]; // - AT91_REG PMC_SCER; // System Clock Enable Register - AT91_REG PMC_SCDR; // System Clock Disable Register - AT91_REG PMC_SCSR; // System Clock Status Register - AT91_REG Reserved20[1]; // - AT91_REG PMC_PCER; // Peripheral Clock Enable Register - AT91_REG PMC_PCDR; // Peripheral Clock Disable Register - AT91_REG PMC_PCSR; // Peripheral Clock Status Register - AT91_REG Reserved21[1]; // - AT91_REG PMC_MOR; // Main Oscillator Register - AT91_REG PMC_MCFR; // Main Clock Frequency Register - AT91_REG Reserved22[1]; // - AT91_REG PMC_PLLR; // PLL Register - AT91_REG PMC_MCKR; // Master Clock Register - AT91_REG Reserved23[3]; // - AT91_REG PMC_PCKR[4]; // Programmable Clock Register - AT91_REG Reserved24[4]; // - AT91_REG PMC_IER; // Interrupt Enable Register - AT91_REG PMC_IDR; // Interrupt Disable Register - AT91_REG PMC_SR; // Status Register - AT91_REG PMC_IMR; // Interrupt Mask Register - AT91_REG Reserved25[36]; // - AT91_REG RSTC_RCR; // Reset Control Register - AT91_REG RSTC_RSR; // Reset Status Register - AT91_REG RSTC_RMR; // Reset Mode Register - AT91_REG Reserved26[5]; // - AT91_REG RTTC_RTMR; // Real-time Mode Register - AT91_REG RTTC_RTAR; // Real-time Alarm Register - AT91_REG RTTC_RTVR; // Real-time Value Register - AT91_REG RTTC_RTSR; // Real-time Status Register - AT91_REG PITC_PIMR; // Period Interval Mode Register - AT91_REG PITC_PISR; // Period Interval Status Register - AT91_REG PITC_PIVR; // Period Interval Value Register - AT91_REG PITC_PIIR; // Period Interval Image Register - AT91_REG WDTC_WDCR; // Watchdog Control Register - AT91_REG WDTC_WDMR; // Watchdog Mode Register - AT91_REG WDTC_WDSR; // Watchdog Status Register - AT91_REG Reserved27[5]; // - AT91_REG VREG_MR; // Voltage Regulator Mode Register -} AT91S_SYS, *AT91PS_SYS; - - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Advanced Interrupt Controller -// ***************************************************************************** -typedef struct _AT91S_AIC { - AT91_REG AIC_SMR[32]; // Source Mode Register - AT91_REG AIC_SVR[32]; // Source Vector Register - AT91_REG AIC_IVR; // IRQ Vector Register - AT91_REG AIC_FVR; // FIQ Vector Register - AT91_REG AIC_ISR; // Interrupt Status Register - AT91_REG AIC_IPR; // Interrupt Pending Register - AT91_REG AIC_IMR; // Interrupt Mask Register - AT91_REG AIC_CISR; // Core Interrupt Status Register - AT91_REG Reserved0[2]; // - AT91_REG AIC_IECR; // Interrupt Enable Command Register - AT91_REG AIC_IDCR; // Interrupt Disable Command Register - AT91_REG AIC_ICCR; // Interrupt Clear Command Register - AT91_REG AIC_ISCR; // Interrupt Set Command Register - AT91_REG AIC_EOICR; // End of Interrupt Command Register - AT91_REG AIC_SPU; // Spurious Vector Register - AT91_REG AIC_DCR; // Debug Control Register (Protect) - AT91_REG Reserved1[1]; // - AT91_REG AIC_FFER; // Fast Forcing Enable Register - AT91_REG AIC_FFDR; // Fast Forcing Disable Register - AT91_REG AIC_FFSR; // Fast Forcing Status Register -} AT91S_AIC, *AT91PS_AIC; - -// -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- -#define AT91C_AIC_PRIOR ((unsigned int) 0x7 << 0) // (AIC) Priority Level -#define AT91C_AIC_PRIOR_LOWEST ((unsigned int) 0x0) // (AIC) Lowest priority level -#define AT91C_AIC_PRIOR_HIGHEST ((unsigned int) 0x7) // (AIC) Highest priority level -#define AT91C_AIC_SRCTYPE ((unsigned int) 0x3 << 5) // (AIC) Interrupt Source Type -#define AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL ((unsigned int) 0x0 << 5) // (AIC) Internal Sources Code Label High-level Sensitive -#define AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL ((unsigned int) 0x0 << 5) // (AIC) External Sources Code Label Low-level Sensitive -#define AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE ((unsigned int) 0x1 << 5) // (AIC) Internal Sources Code Label Positive Edge triggered -#define AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE ((unsigned int) 0x1 << 5) // (AIC) External Sources Code Label Negative Edge triggered -#define AT91C_AIC_SRCTYPE_HIGH_LEVEL ((unsigned int) 0x2 << 5) // (AIC) Internal Or External Sources Code Label High-level Sensitive -#define AT91C_AIC_SRCTYPE_POSITIVE_EDGE ((unsigned int) 0x3 << 5) // (AIC) Internal Or External Sources Code Label Positive Edge triggered -// -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- -#define AT91C_AIC_NFIQ ((unsigned int) 0x1 << 0) // (AIC) NFIQ Status -#define AT91C_AIC_NIRQ ((unsigned int) 0x1 << 1) // (AIC) NIRQ Status -// -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- -#define AT91C_AIC_DCR_PROT ((unsigned int) 0x1 << 0) // (AIC) Protection Mode -#define AT91C_AIC_DCR_GMSK ((unsigned int) 0x1 << 1) // (AIC) General Mask - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Peripheral DMA Controller -// ***************************************************************************** -typedef struct _AT91S_PDC { - AT91_REG PDC_RPR; // Receive Pointer Register - AT91_REG PDC_RCR; // Receive Counter Register - AT91_REG PDC_TPR; // Transmit Pointer Register - AT91_REG PDC_TCR; // Transmit Counter Register - AT91_REG PDC_RNPR; // Receive Next Pointer Register - AT91_REG PDC_RNCR; // Receive Next Counter Register - AT91_REG PDC_TNPR; // Transmit Next Pointer Register - AT91_REG PDC_TNCR; // Transmit Next Counter Register - AT91_REG PDC_PTCR; // PDC Transfer Control Register - AT91_REG PDC_PTSR; // PDC Transfer Status Register -} AT91S_PDC, *AT91PS_PDC; - -// -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- -#define AT91C_PDC_RXTEN ((unsigned int) 0x1 << 0) // (PDC) Receiver Transfer Enable -#define AT91C_PDC_RXTDIS ((unsigned int) 0x1 << 1) // (PDC) Receiver Transfer Disable -#define AT91C_PDC_TXTEN ((unsigned int) 0x1 << 8) // (PDC) Transmitter Transfer Enable -#define AT91C_PDC_TXTDIS ((unsigned int) 0x1 << 9) // (PDC) Transmitter Transfer Disable -// -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Debug Unit -// ***************************************************************************** -typedef struct _AT91S_DBGU { - AT91_REG DBGU_CR; // Control Register - AT91_REG DBGU_MR; // Mode Register - AT91_REG DBGU_IER; // Interrupt Enable Register - AT91_REG DBGU_IDR; // Interrupt Disable Register - AT91_REG DBGU_IMR; // Interrupt Mask Register - AT91_REG DBGU_CSR; // Channel Status Register - AT91_REG DBGU_RHR; // Receiver Holding Register - AT91_REG DBGU_THR; // Transmitter Holding Register - AT91_REG DBGU_BRGR; // Baud Rate Generator Register - AT91_REG Reserved0[7]; // - AT91_REG DBGU_CIDR; // Chip ID Register - AT91_REG DBGU_EXID; // Chip ID Extension Register - AT91_REG DBGU_FNTR; // Force NTRST Register - AT91_REG Reserved1[45]; // - AT91_REG DBGU_RPR; // Receive Pointer Register - AT91_REG DBGU_RCR; // Receive Counter Register - AT91_REG DBGU_TPR; // Transmit Pointer Register - AT91_REG DBGU_TCR; // Transmit Counter Register - AT91_REG DBGU_RNPR; // Receive Next Pointer Register - AT91_REG DBGU_RNCR; // Receive Next Counter Register - AT91_REG DBGU_TNPR; // Transmit Next Pointer Register - AT91_REG DBGU_TNCR; // Transmit Next Counter Register - AT91_REG DBGU_PTCR; // PDC Transfer Control Register - AT91_REG DBGU_PTSR; // PDC Transfer Status Register -} AT91S_DBGU, *AT91PS_DBGU; - -// -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- -#define AT91C_US_RSTRX ((unsigned int) 0x1 << 2) // (DBGU) Reset Receiver -#define AT91C_US_RSTTX ((unsigned int) 0x1 << 3) // (DBGU) Reset Transmitter -#define AT91C_US_RXEN ((unsigned int) 0x1 << 4) // (DBGU) Receiver Enable -#define AT91C_US_RXDIS ((unsigned int) 0x1 << 5) // (DBGU) Receiver Disable -#define AT91C_US_TXEN ((unsigned int) 0x1 << 6) // (DBGU) Transmitter Enable -#define AT91C_US_TXDIS ((unsigned int) 0x1 << 7) // (DBGU) Transmitter Disable -#define AT91C_US_RSTSTA ((unsigned int) 0x1 << 8) // (DBGU) Reset Status Bits -// -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- -#define AT91C_US_PAR ((unsigned int) 0x7 << 9) // (DBGU) Parity type -#define AT91C_US_PAR_EVEN ((unsigned int) 0x0 << 9) // (DBGU) Even Parity -#define AT91C_US_PAR_ODD ((unsigned int) 0x1 << 9) // (DBGU) Odd Parity -#define AT91C_US_PAR_SPACE ((unsigned int) 0x2 << 9) // (DBGU) Parity forced to 0 (Space) -#define AT91C_US_PAR_MARK ((unsigned int) 0x3 << 9) // (DBGU) Parity forced to 1 (Mark) -#define AT91C_US_PAR_NONE ((unsigned int) 0x4 << 9) // (DBGU) No Parity -#define AT91C_US_PAR_MULTI_DROP ((unsigned int) 0x6 << 9) // (DBGU) Multi-drop mode -#define AT91C_US_CHMODE ((unsigned int) 0x3 << 14) // (DBGU) Channel Mode -#define AT91C_US_CHMODE_NORMAL ((unsigned int) 0x0 << 14) // (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. -#define AT91C_US_CHMODE_AUTO ((unsigned int) 0x1 << 14) // (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. -#define AT91C_US_CHMODE_LOCAL ((unsigned int) 0x2 << 14) // (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. -#define AT91C_US_CHMODE_REMOTE ((unsigned int) 0x3 << 14) // (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. -// -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- -#define AT91C_US_RXRDY ((unsigned int) 0x1 << 0) // (DBGU) RXRDY Interrupt -#define AT91C_US_TXRDY ((unsigned int) 0x1 << 1) // (DBGU) TXRDY Interrupt -#define AT91C_US_ENDRX ((unsigned int) 0x1 << 3) // (DBGU) End of Receive Transfer Interrupt -#define AT91C_US_ENDTX ((unsigned int) 0x1 << 4) // (DBGU) End of Transmit Interrupt -#define AT91C_US_OVRE ((unsigned int) 0x1 << 5) // (DBGU) Overrun Interrupt -#define AT91C_US_FRAME ((unsigned int) 0x1 << 6) // (DBGU) Framing Error Interrupt -#define AT91C_US_PARE ((unsigned int) 0x1 << 7) // (DBGU) Parity Error Interrupt -#define AT91C_US_TXEMPTY ((unsigned int) 0x1 << 9) // (DBGU) TXEMPTY Interrupt -#define AT91C_US_TXBUFE ((unsigned int) 0x1 << 11) // (DBGU) TXBUFE Interrupt -#define AT91C_US_RXBUFF ((unsigned int) 0x1 << 12) // (DBGU) RXBUFF Interrupt -#define AT91C_US_COMM_TX ((unsigned int) 0x1 << 30) // (DBGU) COMM_TX Interrupt -#define AT91C_US_COMM_RX ((unsigned int) 0x1 << 31) // (DBGU) COMM_RX Interrupt -// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- -// -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- -#define AT91C_US_FORCE_NTRST ((unsigned int) 0x1 << 0) // (DBGU) Force NTRST in JTAG - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Parallel Input Output Controler -// ***************************************************************************** -typedef struct _AT91S_PIO { - AT91_REG PIO_PER; // PIO Enable Register - AT91_REG PIO_PDR; // PIO Disable Register - AT91_REG PIO_PSR; // PIO Status Register - AT91_REG Reserved0[1]; // - AT91_REG PIO_OER; // Output Enable Register - AT91_REG PIO_ODR; // Output Disable Registerr - AT91_REG PIO_OSR; // Output Status Register - AT91_REG Reserved1[1]; // - AT91_REG PIO_IFER; // Input Filter Enable Register - AT91_REG PIO_IFDR; // Input Filter Disable Register - AT91_REG PIO_IFSR; // Input Filter Status Register - AT91_REG Reserved2[1]; // - AT91_REG PIO_SODR; // Set Output Data Register - AT91_REG PIO_CODR; // Clear Output Data Register - AT91_REG PIO_ODSR; // Output Data Status Register - AT91_REG PIO_PDSR; // Pin Data Status Register - AT91_REG PIO_IER; // Interrupt Enable Register - AT91_REG PIO_IDR; // Interrupt Disable Register - AT91_REG PIO_IMR; // Interrupt Mask Register - AT91_REG PIO_ISR; // Interrupt Status Register - AT91_REG PIO_MDER; // Multi-driver Enable Register - AT91_REG PIO_MDDR; // Multi-driver Disable Register - AT91_REG PIO_MDSR; // Multi-driver Status Register - AT91_REG Reserved3[1]; // - AT91_REG PIO_PPUDR; // Pull-up Disable Register - AT91_REG PIO_PPUER; // Pull-up Enable Register - AT91_REG PIO_PPUSR; // Pull-up Status Register - AT91_REG Reserved4[1]; // - AT91_REG PIO_ASR; // Select A Register - AT91_REG PIO_BSR; // Select B Register - AT91_REG PIO_ABSR; // AB Select Status Register - AT91_REG Reserved5[9]; // - AT91_REG PIO_OWER; // Output Write Enable Register - AT91_REG PIO_OWDR; // Output Write Disable Register - AT91_REG PIO_OWSR; // Output Write Status Register -} AT91S_PIO, *AT91PS_PIO; - - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Clock Generator Controler -// ***************************************************************************** -typedef struct _AT91S_CKGR { - AT91_REG CKGR_MOR; // Main Oscillator Register - AT91_REG CKGR_MCFR; // Main Clock Frequency Register - AT91_REG Reserved0[1]; // - AT91_REG CKGR_PLLR; // PLL Register -} AT91S_CKGR, *AT91PS_CKGR; - -// -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- -#define AT91C_CKGR_MOSCEN ((unsigned int) 0x1 << 0) // (CKGR) Main Oscillator Enable -#define AT91C_CKGR_OSCBYPASS ((unsigned int) 0x1 << 1) // (CKGR) Main Oscillator Bypass -#define AT91C_CKGR_OSCOUNT ((unsigned int) 0xFF << 8) // (CKGR) Main Oscillator Start-up Time -// -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- -#define AT91C_CKGR_MAINF ((unsigned int) 0xFFFF << 0) // (CKGR) Main Clock Frequency -#define AT91C_CKGR_MAINRDY ((unsigned int) 0x1 << 16) // (CKGR) Main Clock Ready -// -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- -#define AT91C_CKGR_DIV ((unsigned int) 0xFF << 0) // (CKGR) Divider Selected -#define AT91C_CKGR_DIV_0 ((unsigned int) 0x0) // (CKGR) Divider output is 0 -#define AT91C_CKGR_DIV_BYPASS ((unsigned int) 0x1) // (CKGR) Divider is bypassed -#define AT91C_CKGR_PLLCOUNT ((unsigned int) 0x3F << 8) // (CKGR) PLL Counter -#define AT91C_CKGR_OUT ((unsigned int) 0x3 << 14) // (CKGR) PLL Output Frequency Range -#define AT91C_CKGR_OUT_0 ((unsigned int) 0x0 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_1 ((unsigned int) 0x1 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_2 ((unsigned int) 0x2 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_3 ((unsigned int) 0x3 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_MUL ((unsigned int) 0x7FF << 16) // (CKGR) PLL Multiplier -#define AT91C_CKGR_USBDIV ((unsigned int) 0x3 << 28) // (CKGR) Divider for USB Clocks -#define AT91C_CKGR_USBDIV_0 ((unsigned int) 0x0 << 28) // (CKGR) Divider output is PLL clock output -#define AT91C_CKGR_USBDIV_1 ((unsigned int) 0x1 << 28) // (CKGR) Divider output is PLL clock output divided by 2 -#define AT91C_CKGR_USBDIV_2 ((unsigned int) 0x2 << 28) // (CKGR) Divider output is PLL clock output divided by 4 - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Power Management Controler -// ***************************************************************************** -typedef struct _AT91S_PMC { - AT91_REG PMC_SCER; // System Clock Enable Register - AT91_REG PMC_SCDR; // System Clock Disable Register - AT91_REG PMC_SCSR; // System Clock Status Register - AT91_REG Reserved0[1]; // - AT91_REG PMC_PCER; // Peripheral Clock Enable Register - AT91_REG PMC_PCDR; // Peripheral Clock Disable Register - AT91_REG PMC_PCSR; // Peripheral Clock Status Register - AT91_REG Reserved1[1]; // - AT91_REG PMC_MOR; // Main Oscillator Register - AT91_REG PMC_MCFR; // Main Clock Frequency Register - AT91_REG Reserved2[1]; // - AT91_REG PMC_PLLR; // PLL Register - AT91_REG PMC_MCKR; // Master Clock Register - AT91_REG Reserved3[3]; // - AT91_REG PMC_PCKR[4]; // Programmable Clock Register - AT91_REG Reserved4[4]; // - AT91_REG PMC_IER; // Interrupt Enable Register - AT91_REG PMC_IDR; // Interrupt Disable Register - AT91_REG PMC_SR; // Status Register - AT91_REG PMC_IMR; // Interrupt Mask Register -} AT91S_PMC, *AT91PS_PMC; - -// -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- -#define AT91C_PMC_PCK ((unsigned int) 0x1 << 0) // (PMC) Processor Clock -#define AT91C_PMC_UDP ((unsigned int) 0x1 << 7) // (PMC) USB Device Port Clock -#define AT91C_PMC_PCK0 ((unsigned int) 0x1 << 8) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK1 ((unsigned int) 0x1 << 9) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK2 ((unsigned int) 0x1 << 10) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK3 ((unsigned int) 0x1 << 11) // (PMC) Programmable Clock Output -// -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- -// -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- -// -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- -// -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- -// -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- -// -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- -#define AT91C_PMC_CSS ((unsigned int) 0x3 << 0) // (PMC) Programmable Clock Selection -#define AT91C_PMC_CSS_SLOW_CLK ((unsigned int) 0x0) // (PMC) Slow Clock is selected -#define AT91C_PMC_CSS_MAIN_CLK ((unsigned int) 0x1) // (PMC) Main Clock is selected -#define AT91C_PMC_CSS_PLL_CLK ((unsigned int) 0x3) // (PMC) Clock from PLL is selected -#define AT91C_PMC_PRES ((unsigned int) 0x7 << 2) // (PMC) Programmable Clock Prescaler -#define AT91C_PMC_PRES_CLK ((unsigned int) 0x0 << 2) // (PMC) Selected clock -#define AT91C_PMC_PRES_CLK_2 ((unsigned int) 0x1 << 2) // (PMC) Selected clock divided by 2 -#define AT91C_PMC_PRES_CLK_4 ((unsigned int) 0x2 << 2) // (PMC) Selected clock divided by 4 -#define AT91C_PMC_PRES_CLK_8 ((unsigned int) 0x3 << 2) // (PMC) Selected clock divided by 8 -#define AT91C_PMC_PRES_CLK_16 ((unsigned int) 0x4 << 2) // (PMC) Selected clock divided by 16 -#define AT91C_PMC_PRES_CLK_32 ((unsigned int) 0x5 << 2) // (PMC) Selected clock divided by 32 -#define AT91C_PMC_PRES_CLK_64 ((unsigned int) 0x6 << 2) // (PMC) Selected clock divided by 64 -// -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- -// -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- -#define AT91C_PMC_MOSCS ((unsigned int) 0x1 << 0) // (PMC) MOSC Status/Enable/Disable/Mask -#define AT91C_PMC_LOCK ((unsigned int) 0x1 << 2) // (PMC) PLL Status/Enable/Disable/Mask -#define AT91C_PMC_MCKRDY ((unsigned int) 0x1 << 3) // (PMC) MCK_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK0RDY ((unsigned int) 0x1 << 8) // (PMC) PCK0_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK1RDY ((unsigned int) 0x1 << 9) // (PMC) PCK1_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK2RDY ((unsigned int) 0x1 << 10) // (PMC) PCK2_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK3RDY ((unsigned int) 0x1 << 11) // (PMC) PCK3_RDY Status/Enable/Disable/Mask -// -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- -// -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- -// -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Reset Controller Interface -// ***************************************************************************** -typedef struct _AT91S_RSTC { - AT91_REG RSTC_RCR; // Reset Control Register - AT91_REG RSTC_RSR; // Reset Status Register - AT91_REG RSTC_RMR; // Reset Mode Register -} AT91S_RSTC, *AT91PS_RSTC; - -// -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- -#define AT91C_RSTC_PROCRST ((unsigned int) 0x1 << 0) // (RSTC) Processor Reset -#define AT91C_RSTC_PERRST ((unsigned int) 0x1 << 2) // (RSTC) Peripheral Reset -#define AT91C_RSTC_EXTRST ((unsigned int) 0x1 << 3) // (RSTC) External Reset -#define AT91C_RSTC_KEY ((unsigned int) 0xFF << 24) // (RSTC) Password -// -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- -#define AT91C_RSTC_URSTS ((unsigned int) 0x1 << 0) // (RSTC) User Reset Status -#define AT91C_RSTC_BODSTS ((unsigned int) 0x1 << 1) // (RSTC) Brownout Detection Status -#define AT91C_RSTC_RSTTYP ((unsigned int) 0x7 << 8) // (RSTC) Reset Type -#define AT91C_RSTC_RSTTYP_POWERUP ((unsigned int) 0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising. -#define AT91C_RSTC_RSTTYP_WAKEUP ((unsigned int) 0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising. -#define AT91C_RSTC_RSTTYP_WATCHDOG ((unsigned int) 0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occured. -#define AT91C_RSTC_RSTTYP_SOFTWARE ((unsigned int) 0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software. -#define AT91C_RSTC_RSTTYP_USER ((unsigned int) 0x4 << 8) // (RSTC) User Reset. NRST pin detected low. -#define AT91C_RSTC_RSTTYP_BROWNOUT ((unsigned int) 0x5 << 8) // (RSTC) Brownout Reset occured. -#define AT91C_RSTC_NRSTL ((unsigned int) 0x1 << 16) // (RSTC) NRST pin level -#define AT91C_RSTC_SRCMP ((unsigned int) 0x1 << 17) // (RSTC) Software Reset Command in Progress. -// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- -#define AT91C_RSTC_URSTEN ((unsigned int) 0x1 << 0) // (RSTC) User Reset Enable -#define AT91C_RSTC_URSTIEN ((unsigned int) 0x1 << 4) // (RSTC) User Reset Interrupt Enable -#define AT91C_RSTC_ERSTL ((unsigned int) 0xF << 8) // (RSTC) User Reset Length -#define AT91C_RSTC_BODIEN ((unsigned int) 0x1 << 16) // (RSTC) Brownout Detection Interrupt Enable - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface -// ***************************************************************************** -typedef struct _AT91S_RTTC { - AT91_REG RTTC_RTMR; // Real-time Mode Register - AT91_REG RTTC_RTAR; // Real-time Alarm Register - AT91_REG RTTC_RTVR; // Real-time Value Register - AT91_REG RTTC_RTSR; // Real-time Status Register -} AT91S_RTTC, *AT91PS_RTTC; - -// -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- -#define AT91C_RTTC_RTPRES ((unsigned int) 0xFFFF << 0) // (RTTC) Real-time Timer Prescaler Value -#define AT91C_RTTC_ALMIEN ((unsigned int) 0x1 << 16) // (RTTC) Alarm Interrupt Enable -#define AT91C_RTTC_RTTINCIEN ((unsigned int) 0x1 << 17) // (RTTC) Real Time Timer Increment Interrupt Enable -#define AT91C_RTTC_RTTRST ((unsigned int) 0x1 << 18) // (RTTC) Real Time Timer Restart -// -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- -#define AT91C_RTTC_ALMV ((unsigned int) 0x0 << 0) // (RTTC) Alarm Value -// -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- -#define AT91C_RTTC_CRTV ((unsigned int) 0x0 << 0) // (RTTC) Current Real-time Value -// -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- -#define AT91C_RTTC_ALMS ((unsigned int) 0x1 << 0) // (RTTC) Real-time Alarm Status -#define AT91C_RTTC_RTTINC ((unsigned int) 0x1 << 1) // (RTTC) Real-time Timer Increment - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface -// ***************************************************************************** -typedef struct _AT91S_PITC { - AT91_REG PITC_PIMR; // Period Interval Mode Register - AT91_REG PITC_PISR; // Period Interval Status Register - AT91_REG PITC_PIVR; // Period Interval Value Register - AT91_REG PITC_PIIR; // Period Interval Image Register -} AT91S_PITC, *AT91PS_PITC; - -// -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- -#define AT91C_PITC_PIV ((unsigned int) 0xFFFFF << 0) // (PITC) Periodic Interval Value -#define AT91C_PITC_PITEN ((unsigned int) 0x1 << 24) // (PITC) Periodic Interval Timer Enabled -#define AT91C_PITC_PITIEN ((unsigned int) 0x1 << 25) // (PITC) Periodic Interval Timer Interrupt Enable -// -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- -#define AT91C_PITC_PITS ((unsigned int) 0x1 << 0) // (PITC) Periodic Interval Timer Status -// -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- -#define AT91C_PITC_CPIV ((unsigned int) 0xFFFFF << 0) // (PITC) Current Periodic Interval Value -#define AT91C_PITC_PICNT ((unsigned int) 0xFFF << 20) // (PITC) Periodic Interval Counter -// -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface -// ***************************************************************************** -typedef struct _AT91S_WDTC { - AT91_REG WDTC_WDCR; // Watchdog Control Register - AT91_REG WDTC_WDMR; // Watchdog Mode Register - AT91_REG WDTC_WDSR; // Watchdog Status Register -} AT91S_WDTC, *AT91PS_WDTC; - -// -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- -#define AT91C_WDTC_WDRSTT ((unsigned int) 0x1 << 0) // (WDTC) Watchdog Restart -#define AT91C_WDTC_KEY ((unsigned int) 0xFF << 24) // (WDTC) Watchdog KEY Password -// -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- -#define AT91C_WDTC_WDV ((unsigned int) 0xFFF << 0) // (WDTC) Watchdog Timer Restart -#define AT91C_WDTC_WDFIEN ((unsigned int) 0x1 << 12) // (WDTC) Watchdog Fault Interrupt Enable -#define AT91C_WDTC_WDRSTEN ((unsigned int) 0x1 << 13) // (WDTC) Watchdog Reset Enable -#define AT91C_WDTC_WDRPROC ((unsigned int) 0x1 << 14) // (WDTC) Watchdog Timer Restart -#define AT91C_WDTC_WDDIS ((unsigned int) 0x1 << 15) // (WDTC) Watchdog Disable -#define AT91C_WDTC_WDD ((unsigned int) 0xFFF << 16) // (WDTC) Watchdog Delta Value -#define AT91C_WDTC_WDDBGHLT ((unsigned int) 0x1 << 28) // (WDTC) Watchdog Debug Halt -#define AT91C_WDTC_WDIDLEHLT ((unsigned int) 0x1 << 29) // (WDTC) Watchdog Idle Halt -// -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- -#define AT91C_WDTC_WDUNF ((unsigned int) 0x1 << 0) // (WDTC) Watchdog Underflow -#define AT91C_WDTC_WDERR ((unsigned int) 0x1 << 1) // (WDTC) Watchdog Error - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface -// ***************************************************************************** -typedef struct _AT91S_VREG { - AT91_REG VREG_MR; // Voltage Regulator Mode Register -} AT91S_VREG, *AT91PS_VREG; - -// -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- -#define AT91C_VREG_PSTDBY ((unsigned int) 0x1 << 0) // (VREG) Voltage Regulator Power Standby Mode - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Memory Controller Interface -// ***************************************************************************** -typedef struct _AT91S_MC { - AT91_REG MC_RCR; // MC Remap Control Register - AT91_REG MC_ASR; // MC Abort Status Register - AT91_REG MC_AASR; // MC Abort Address Status Register - AT91_REG Reserved0[21]; // - AT91_REG MC_FMR; // MC Flash Mode Register - AT91_REG MC_FCR; // MC Flash Command Register - AT91_REG MC_FSR; // MC Flash Status Register -} AT91S_MC, *AT91PS_MC; - -// -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- -#define AT91C_MC_RCB ((unsigned int) 0x1 << 0) // (MC) Remap Command Bit -// -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- -#define AT91C_MC_UNDADD ((unsigned int) 0x1 << 0) // (MC) Undefined Addess Abort Status -#define AT91C_MC_MISADD ((unsigned int) 0x1 << 1) // (MC) Misaligned Addess Abort Status -#define AT91C_MC_ABTSZ ((unsigned int) 0x3 << 8) // (MC) Abort Size Status -#define AT91C_MC_ABTSZ_BYTE ((unsigned int) 0x0 << 8) // (MC) Byte -#define AT91C_MC_ABTSZ_HWORD ((unsigned int) 0x1 << 8) // (MC) Half-word -#define AT91C_MC_ABTSZ_WORD ((unsigned int) 0x2 << 8) // (MC) Word -#define AT91C_MC_ABTTYP ((unsigned int) 0x3 << 10) // (MC) Abort Type Status -#define AT91C_MC_ABTTYP_DATAR ((unsigned int) 0x0 << 10) // (MC) Data Read -#define AT91C_MC_ABTTYP_DATAW ((unsigned int) 0x1 << 10) // (MC) Data Write -#define AT91C_MC_ABTTYP_FETCH ((unsigned int) 0x2 << 10) // (MC) Code Fetch -#define AT91C_MC_MST0 ((unsigned int) 0x1 << 16) // (MC) Master 0 Abort Source -#define AT91C_MC_MST1 ((unsigned int) 0x1 << 17) // (MC) Master 1 Abort Source -#define AT91C_MC_SVMST0 ((unsigned int) 0x1 << 24) // (MC) Saved Master 0 Abort Source -#define AT91C_MC_SVMST1 ((unsigned int) 0x1 << 25) // (MC) Saved Master 1 Abort Source -// -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- -#define AT91C_MC_FRDY ((unsigned int) 0x1 << 0) // (MC) Flash Ready -#define AT91C_MC_LOCKE ((unsigned int) 0x1 << 2) // (MC) Lock Error -#define AT91C_MC_PROGE ((unsigned int) 0x1 << 3) // (MC) Programming Error -#define AT91C_MC_NEBP ((unsigned int) 0x1 << 7) // (MC) No Erase Before Programming -#define AT91C_MC_FWS ((unsigned int) 0x3 << 8) // (MC) Flash Wait State -#define AT91C_MC_FWS_0FWS ((unsigned int) 0x0 << 8) // (MC) 1 cycle for Read, 2 for Write operations -#define AT91C_MC_FWS_1FWS ((unsigned int) 0x1 << 8) // (MC) 2 cycles for Read, 3 for Write operations -#define AT91C_MC_FWS_2FWS ((unsigned int) 0x2 << 8) // (MC) 3 cycles for Read, 4 for Write operations -#define AT91C_MC_FWS_3FWS ((unsigned int) 0x3 << 8) // (MC) 4 cycles for Read, 4 for Write operations -#define AT91C_MC_FMCN ((unsigned int) 0xFF << 16) // (MC) Flash Microsecond Cycle Number -// -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- -#define AT91C_MC_FCMD ((unsigned int) 0xF << 0) // (MC) Flash Command -#define AT91C_MC_FCMD_START_PROG ((unsigned int) 0x1) // (MC) Starts the programming of th epage specified by PAGEN. -#define AT91C_MC_FCMD_LOCK ((unsigned int) 0x2) // (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -#define AT91C_MC_FCMD_PROG_AND_LOCK ((unsigned int) 0x3) // (MC) The lock sequence automatically happens after the programming sequence is completed. -#define AT91C_MC_FCMD_UNLOCK ((unsigned int) 0x4) // (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -#define AT91C_MC_FCMD_ERASE_ALL ((unsigned int) 0x8) // (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. -#define AT91C_MC_FCMD_SET_GP_NVM ((unsigned int) 0xB) // (MC) Set General Purpose NVM bits. -#define AT91C_MC_FCMD_CLR_GP_NVM ((unsigned int) 0xD) // (MC) Clear General Purpose NVM bits. -#define AT91C_MC_FCMD_SET_SECURITY ((unsigned int) 0xF) // (MC) Set Security Bit. -#define AT91C_MC_PAGEN ((unsigned int) 0x3FF << 8) // (MC) Page Number -#define AT91C_MC_KEY ((unsigned int) 0xFF << 24) // (MC) Writing Protect Key -// -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- -#define AT91C_MC_SECURITY ((unsigned int) 0x1 << 4) // (MC) Security Bit Status -#define AT91C_MC_GPNVM0 ((unsigned int) 0x1 << 8) // (MC) Sector 0 Lock Status -#define AT91C_MC_GPNVM1 ((unsigned int) 0x1 << 9) // (MC) Sector 1 Lock Status -#define AT91C_MC_GPNVM2 ((unsigned int) 0x1 << 10) // (MC) Sector 2 Lock Status -#define AT91C_MC_GPNVM3 ((unsigned int) 0x1 << 11) // (MC) Sector 3 Lock Status -#define AT91C_MC_GPNVM4 ((unsigned int) 0x1 << 12) // (MC) Sector 4 Lock Status -#define AT91C_MC_GPNVM5 ((unsigned int) 0x1 << 13) // (MC) Sector 5 Lock Status -#define AT91C_MC_GPNVM6 ((unsigned int) 0x1 << 14) // (MC) Sector 6 Lock Status -#define AT91C_MC_GPNVM7 ((unsigned int) 0x1 << 15) // (MC) Sector 7 Lock Status -#define AT91C_MC_LOCKS0 ((unsigned int) 0x1 << 16) // (MC) Sector 0 Lock Status -#define AT91C_MC_LOCKS1 ((unsigned int) 0x1 << 17) // (MC) Sector 1 Lock Status -#define AT91C_MC_LOCKS2 ((unsigned int) 0x1 << 18) // (MC) Sector 2 Lock Status -#define AT91C_MC_LOCKS3 ((unsigned int) 0x1 << 19) // (MC) Sector 3 Lock Status -#define AT91C_MC_LOCKS4 ((unsigned int) 0x1 << 20) // (MC) Sector 4 Lock Status -#define AT91C_MC_LOCKS5 ((unsigned int) 0x1 << 21) // (MC) Sector 5 Lock Status -#define AT91C_MC_LOCKS6 ((unsigned int) 0x1 << 22) // (MC) Sector 6 Lock Status -#define AT91C_MC_LOCKS7 ((unsigned int) 0x1 << 23) // (MC) Sector 7 Lock Status -#define AT91C_MC_LOCKS8 ((unsigned int) 0x1 << 24) // (MC) Sector 8 Lock Status -#define AT91C_MC_LOCKS9 ((unsigned int) 0x1 << 25) // (MC) Sector 9 Lock Status -#define AT91C_MC_LOCKS10 ((unsigned int) 0x1 << 26) // (MC) Sector 10 Lock Status -#define AT91C_MC_LOCKS11 ((unsigned int) 0x1 << 27) // (MC) Sector 11 Lock Status -#define AT91C_MC_LOCKS12 ((unsigned int) 0x1 << 28) // (MC) Sector 12 Lock Status -#define AT91C_MC_LOCKS13 ((unsigned int) 0x1 << 29) // (MC) Sector 13 Lock Status -#define AT91C_MC_LOCKS14 ((unsigned int) 0x1 << 30) // (MC) Sector 14 Lock Status -#define AT91C_MC_LOCKS15 ((unsigned int) 0x1 << 31) // (MC) Sector 15 Lock Status - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Serial Parallel Interface -// ***************************************************************************** -typedef struct _AT91S_SPI { - AT91_REG SPI_CR; // Control Register - AT91_REG SPI_MR; // Mode Register - AT91_REG SPI_RDR; // Receive Data Register - AT91_REG SPI_TDR; // Transmit Data Register - AT91_REG SPI_SR; // Status Register - AT91_REG SPI_IER; // Interrupt Enable Register - AT91_REG SPI_IDR; // Interrupt Disable Register - AT91_REG SPI_IMR; // Interrupt Mask Register - AT91_REG Reserved0[4]; // - AT91_REG SPI_CSR[4]; // Chip Select Register - AT91_REG Reserved1[48]; // - AT91_REG SPI_RPR; // Receive Pointer Register - AT91_REG SPI_RCR; // Receive Counter Register - AT91_REG SPI_TPR; // Transmit Pointer Register - AT91_REG SPI_TCR; // Transmit Counter Register - AT91_REG SPI_RNPR; // Receive Next Pointer Register - AT91_REG SPI_RNCR; // Receive Next Counter Register - AT91_REG SPI_TNPR; // Transmit Next Pointer Register - AT91_REG SPI_TNCR; // Transmit Next Counter Register - AT91_REG SPI_PTCR; // PDC Transfer Control Register - AT91_REG SPI_PTSR; // PDC Transfer Status Register -} AT91S_SPI, *AT91PS_SPI; - -// -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- -#define AT91C_SPI_SPIEN ((unsigned int) 0x1 << 0) // (SPI) SPI Enable -#define AT91C_SPI_SPIDIS ((unsigned int) 0x1 << 1) // (SPI) SPI Disable -#define AT91C_SPI_SWRST ((unsigned int) 0x1 << 7) // (SPI) SPI Software reset -#define AT91C_SPI_LASTXFER ((unsigned int) 0x1 << 24) // (SPI) SPI Last Transfer -// -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- -#define AT91C_SPI_MSTR ((unsigned int) 0x1 << 0) // (SPI) Master/Slave Mode -#define AT91C_SPI_PS ((unsigned int) 0x1 << 1) // (SPI) Peripheral Select -#define AT91C_SPI_PS_FIXED ((unsigned int) 0x0 << 1) // (SPI) Fixed Peripheral Select -#define AT91C_SPI_PS_VARIABLE ((unsigned int) 0x1 << 1) // (SPI) Variable Peripheral Select -#define AT91C_SPI_PCSDEC ((unsigned int) 0x1 << 2) // (SPI) Chip Select Decode -#define AT91C_SPI_FDIV ((unsigned int) 0x1 << 3) // (SPI) Clock Selection -#define AT91C_SPI_MODFDIS ((unsigned int) 0x1 << 4) // (SPI) Mode Fault Detection -#define AT91C_SPI_LLB ((unsigned int) 0x1 << 7) // (SPI) Clock Selection -#define AT91C_SPI_PCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select -#define AT91C_SPI_DLYBCS ((unsigned int) 0xFF << 24) // (SPI) Delay Between Chip Selects -// -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- -#define AT91C_SPI_RD ((unsigned int) 0xFFFF << 0) // (SPI) Receive Data -#define AT91C_SPI_RPCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select Status -// -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- -#define AT91C_SPI_TD ((unsigned int) 0xFFFF << 0) // (SPI) Transmit Data -#define AT91C_SPI_TPCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select Status -// -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- -#define AT91C_SPI_RDRF ((unsigned int) 0x1 << 0) // (SPI) Receive Data Register Full -#define AT91C_SPI_TDRE ((unsigned int) 0x1 << 1) // (SPI) Transmit Data Register Empty -#define AT91C_SPI_MODF ((unsigned int) 0x1 << 2) // (SPI) Mode Fault Error -#define AT91C_SPI_OVRES ((unsigned int) 0x1 << 3) // (SPI) Overrun Error Status -#define AT91C_SPI_ENDRX ((unsigned int) 0x1 << 4) // (SPI) End of Receiver Transfer -#define AT91C_SPI_ENDTX ((unsigned int) 0x1 << 5) // (SPI) End of Receiver Transfer -#define AT91C_SPI_RXBUFF ((unsigned int) 0x1 << 6) // (SPI) RXBUFF Interrupt -#define AT91C_SPI_TXBUFE ((unsigned int) 0x1 << 7) // (SPI) TXBUFE Interrupt -#define AT91C_SPI_NSSR ((unsigned int) 0x1 << 8) // (SPI) NSSR Interrupt -#define AT91C_SPI_TXEMPTY ((unsigned int) 0x1 << 9) // (SPI) TXEMPTY Interrupt -#define AT91C_SPI_SPIENS ((unsigned int) 0x1 << 16) // (SPI) Enable Status -// -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- -// -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- -// -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- -// -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- -#define AT91C_SPI_CPOL ((unsigned int) 0x1 << 0) // (SPI) Clock Polarity -#define AT91C_SPI_NCPHA ((unsigned int) 0x1 << 1) // (SPI) Clock Phase -#define AT91C_SPI_CSAAT ((unsigned int) 0x1 << 3) // (SPI) Chip Select Active After Transfer -#define AT91C_SPI_BITS ((unsigned int) 0xF << 4) // (SPI) Bits Per Transfer -#define AT91C_SPI_BITS_8 ((unsigned int) 0x0 << 4) // (SPI) 8 Bits Per transfer -#define AT91C_SPI_BITS_9 ((unsigned int) 0x1 << 4) // (SPI) 9 Bits Per transfer -#define AT91C_SPI_BITS_10 ((unsigned int) 0x2 << 4) // (SPI) 10 Bits Per transfer -#define AT91C_SPI_BITS_11 ((unsigned int) 0x3 << 4) // (SPI) 11 Bits Per transfer -#define AT91C_SPI_BITS_12 ((unsigned int) 0x4 << 4) // (SPI) 12 Bits Per transfer -#define AT91C_SPI_BITS_13 ((unsigned int) 0x5 << 4) // (SPI) 13 Bits Per transfer -#define AT91C_SPI_BITS_14 ((unsigned int) 0x6 << 4) // (SPI) 14 Bits Per transfer -#define AT91C_SPI_BITS_15 ((unsigned int) 0x7 << 4) // (SPI) 15 Bits Per transfer -#define AT91C_SPI_BITS_16 ((unsigned int) 0x8 << 4) // (SPI) 16 Bits Per transfer -#define AT91C_SPI_SCBR ((unsigned int) 0xFF << 8) // (SPI) Serial Clock Baud Rate -#define AT91C_SPI_DLYBS ((unsigned int) 0xFF << 16) // (SPI) Delay Before SPCK -#define AT91C_SPI_DLYBCT ((unsigned int) 0xFF << 24) // (SPI) Delay Between Consecutive Transfers - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Usart -// ***************************************************************************** -typedef struct _AT91S_USART { - AT91_REG US_CR; // Control Register - AT91_REG US_MR; // Mode Register - AT91_REG US_IER; // Interrupt Enable Register - AT91_REG US_IDR; // Interrupt Disable Register - AT91_REG US_IMR; // Interrupt Mask Register - AT91_REG US_CSR; // Channel Status Register - AT91_REG US_RHR; // Receiver Holding Register - AT91_REG US_THR; // Transmitter Holding Register - AT91_REG US_BRGR; // Baud Rate Generator Register - AT91_REG US_RTOR; // Receiver Time-out Register - AT91_REG US_TTGR; // Transmitter Time-guard Register - AT91_REG Reserved0[5]; // - AT91_REG US_FIDI; // FI_DI_Ratio Register - AT91_REG US_NER; // Nb Errors Register - AT91_REG Reserved1[1]; // - AT91_REG US_IF; // IRDA_FILTER Register - AT91_REG Reserved2[44]; // - AT91_REG US_RPR; // Receive Pointer Register - AT91_REG US_RCR; // Receive Counter Register - AT91_REG US_TPR; // Transmit Pointer Register - AT91_REG US_TCR; // Transmit Counter Register - AT91_REG US_RNPR; // Receive Next Pointer Register - AT91_REG US_RNCR; // Receive Next Counter Register - AT91_REG US_TNPR; // Transmit Next Pointer Register - AT91_REG US_TNCR; // Transmit Next Counter Register - AT91_REG US_PTCR; // PDC Transfer Control Register - AT91_REG US_PTSR; // PDC Transfer Status Register -} AT91S_USART, *AT91PS_USART; - -// -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- -#define AT91C_US_STTBRK ((unsigned int) 0x1 << 9) // (USART) Start Break -#define AT91C_US_STPBRK ((unsigned int) 0x1 << 10) // (USART) Stop Break -#define AT91C_US_STTTO ((unsigned int) 0x1 << 11) // (USART) Start Time-out -#define AT91C_US_SENDA ((unsigned int) 0x1 << 12) // (USART) Send Address -#define AT91C_US_RSTIT ((unsigned int) 0x1 << 13) // (USART) Reset Iterations -#define AT91C_US_RSTNACK ((unsigned int) 0x1 << 14) // (USART) Reset Non Acknowledge -#define AT91C_US_RETTO ((unsigned int) 0x1 << 15) // (USART) Rearm Time-out -#define AT91C_US_DTREN ((unsigned int) 0x1 << 16) // (USART) Data Terminal ready Enable -#define AT91C_US_DTRDIS ((unsigned int) 0x1 << 17) // (USART) Data Terminal ready Disable -#define AT91C_US_RTSEN ((unsigned int) 0x1 << 18) // (USART) Request to Send enable -#define AT91C_US_RTSDIS ((unsigned int) 0x1 << 19) // (USART) Request to Send Disable -// -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- -#define AT91C_US_USMODE ((unsigned int) 0xF << 0) // (USART) Usart mode -#define AT91C_US_USMODE_NORMAL ((unsigned int) 0x0) // (USART) Normal -#define AT91C_US_USMODE_RS485 ((unsigned int) 0x1) // (USART) RS485 -#define AT91C_US_USMODE_HWHSH ((unsigned int) 0x2) // (USART) Hardware Handshaking -#define AT91C_US_USMODE_MODEM ((unsigned int) 0x3) // (USART) Modem -#define AT91C_US_USMODE_ISO7816_0 ((unsigned int) 0x4) // (USART) ISO7816 protocol: T = 0 -#define AT91C_US_USMODE_ISO7816_1 ((unsigned int) 0x6) // (USART) ISO7816 protocol: T = 1 -#define AT91C_US_USMODE_IRDA ((unsigned int) 0x8) // (USART) IrDA -#define AT91C_US_USMODE_SWHSH ((unsigned int) 0xC) // (USART) Software Handshaking -#define AT91C_US_CLKS ((unsigned int) 0x3 << 4) // (USART) Clock Selection (Baud Rate generator Input Clock -#define AT91C_US_CLKS_CLOCK ((unsigned int) 0x0 << 4) // (USART) Clock -#define AT91C_US_CLKS_FDIV1 ((unsigned int) 0x1 << 4) // (USART) fdiv1 -#define AT91C_US_CLKS_SLOW ((unsigned int) 0x2 << 4) // (USART) slow_clock (ARM) -#define AT91C_US_CLKS_EXT ((unsigned int) 0x3 << 4) // (USART) External (SCK) -#define AT91C_US_CHRL ((unsigned int) 0x3 << 6) // (USART) Clock Selection (Baud Rate generator Input Clock -#define AT91C_US_CHRL_5_BITS ((unsigned int) 0x0 << 6) // (USART) Character Length: 5 bits -#define AT91C_US_CHRL_6_BITS ((unsigned int) 0x1 << 6) // (USART) Character Length: 6 bits -#define AT91C_US_CHRL_7_BITS ((unsigned int) 0x2 << 6) // (USART) Character Length: 7 bits -#define AT91C_US_CHRL_8_BITS ((unsigned int) 0x3 << 6) // (USART) Character Length: 8 bits -#define AT91C_US_SYNC ((unsigned int) 0x1 << 8) // (USART) Synchronous Mode Select -#define AT91C_US_NBSTOP ((unsigned int) 0x3 << 12) // (USART) Number of Stop bits -#define AT91C_US_NBSTOP_1_BIT ((unsigned int) 0x0 << 12) // (USART) 1 stop bit -#define AT91C_US_NBSTOP_15_BIT ((unsigned int) 0x1 << 12) // (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits -#define AT91C_US_NBSTOP_2_BIT ((unsigned int) 0x2 << 12) // (USART) 2 stop bits -#define AT91C_US_MSBF ((unsigned int) 0x1 << 16) // (USART) Bit Order -#define AT91C_US_MODE9 ((unsigned int) 0x1 << 17) // (USART) 9-bit Character length -#define AT91C_US_CKLO ((unsigned int) 0x1 << 18) // (USART) Clock Output Select -#define AT91C_US_OVER ((unsigned int) 0x1 << 19) // (USART) Over Sampling Mode -#define AT91C_US_INACK ((unsigned int) 0x1 << 20) // (USART) Inhibit Non Acknowledge -#define AT91C_US_DSNACK ((unsigned int) 0x1 << 21) // (USART) Disable Successive NACK -#define AT91C_US_MAX_ITER ((unsigned int) 0x1 << 24) // (USART) Number of Repetitions -#define AT91C_US_FILTER ((unsigned int) 0x1 << 28) // (USART) Receive Line Filter -// -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- -#define AT91C_US_RXBRK ((unsigned int) 0x1 << 2) // (USART) Break Received/End of Break -#define AT91C_US_TIMEOUT ((unsigned int) 0x1 << 8) // (USART) Receiver Time-out -#define AT91C_US_ITERATION ((unsigned int) 0x1 << 10) // (USART) Max number of Repetitions Reached -#define AT91C_US_NACK ((unsigned int) 0x1 << 13) // (USART) Non Acknowledge -#define AT91C_US_RIIC ((unsigned int) 0x1 << 16) // (USART) Ring INdicator Input Change Flag -#define AT91C_US_DSRIC ((unsigned int) 0x1 << 17) // (USART) Data Set Ready Input Change Flag -#define AT91C_US_DCDIC ((unsigned int) 0x1 << 18) // (USART) Data Carrier Flag -#define AT91C_US_CTSIC ((unsigned int) 0x1 << 19) // (USART) Clear To Send Input Change Flag -// -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- -#define AT91C_US_RI ((unsigned int) 0x1 << 20) // (USART) Image of RI Input -#define AT91C_US_DSR ((unsigned int) 0x1 << 21) // (USART) Image of DSR Input -#define AT91C_US_DCD ((unsigned int) 0x1 << 22) // (USART) Image of DCD Input -#define AT91C_US_CTS ((unsigned int) 0x1 << 23) // (USART) Image of CTS Input - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface -// ***************************************************************************** -typedef struct _AT91S_SSC { - AT91_REG SSC_CR; // Control Register - AT91_REG SSC_CMR; // Clock Mode Register - AT91_REG Reserved0[2]; // - AT91_REG SSC_RCMR; // Receive Clock ModeRegister - AT91_REG SSC_RFMR; // Receive Frame Mode Register - AT91_REG SSC_TCMR; // Transmit Clock Mode Register - AT91_REG SSC_TFMR; // Transmit Frame Mode Register - AT91_REG SSC_RHR; // Receive Holding Register - AT91_REG SSC_THR; // Transmit Holding Register - AT91_REG Reserved1[2]; // - AT91_REG SSC_RSHR; // Receive Sync Holding Register - AT91_REG SSC_TSHR; // Transmit Sync Holding Register - AT91_REG Reserved2[2]; // - AT91_REG SSC_SR; // Status Register - AT91_REG SSC_IER; // Interrupt Enable Register - AT91_REG SSC_IDR; // Interrupt Disable Register - AT91_REG SSC_IMR; // Interrupt Mask Register - AT91_REG Reserved3[44]; // - AT91_REG SSC_RPR; // Receive Pointer Register - AT91_REG SSC_RCR; // Receive Counter Register - AT91_REG SSC_TPR; // Transmit Pointer Register - AT91_REG SSC_TCR; // Transmit Counter Register - AT91_REG SSC_RNPR; // Receive Next Pointer Register - AT91_REG SSC_RNCR; // Receive Next Counter Register - AT91_REG SSC_TNPR; // Transmit Next Pointer Register - AT91_REG SSC_TNCR; // Transmit Next Counter Register - AT91_REG SSC_PTCR; // PDC Transfer Control Register - AT91_REG SSC_PTSR; // PDC Transfer Status Register -} AT91S_SSC, *AT91PS_SSC; - -// -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- -#define AT91C_SSC_RXEN ((unsigned int) 0x1 << 0) // (SSC) Receive Enable -#define AT91C_SSC_RXDIS ((unsigned int) 0x1 << 1) // (SSC) Receive Disable -#define AT91C_SSC_TXEN ((unsigned int) 0x1 << 8) // (SSC) Transmit Enable -#define AT91C_SSC_TXDIS ((unsigned int) 0x1 << 9) // (SSC) Transmit Disable -#define AT91C_SSC_SWRST ((unsigned int) 0x1 << 15) // (SSC) Software Reset -// -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- -#define AT91C_SSC_CKS ((unsigned int) 0x3 << 0) // (SSC) Receive/Transmit Clock Selection -#define AT91C_SSC_CKS_DIV ((unsigned int) 0x0) // (SSC) Divided Clock -#define AT91C_SSC_CKS_TK ((unsigned int) 0x1) // (SSC) TK Clock signal -#define AT91C_SSC_CKS_RK ((unsigned int) 0x2) // (SSC) RK pin -#define AT91C_SSC_CKO ((unsigned int) 0x7 << 2) // (SSC) Receive/Transmit Clock Output Mode Selection -#define AT91C_SSC_CKO_NONE ((unsigned int) 0x0 << 2) // (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only -#define AT91C_SSC_CKO_CONTINOUS ((unsigned int) 0x1 << 2) // (SSC) Continuous Receive/Transmit Clock RK pin: Output -#define AT91C_SSC_CKO_DATA_TX ((unsigned int) 0x2 << 2) // (SSC) Receive/Transmit Clock only during data transfers RK pin: Output -#define AT91C_SSC_CKI ((unsigned int) 0x1 << 5) // (SSC) Receive/Transmit Clock Inversion -#define AT91C_SSC_CKG ((unsigned int) 0x3 << 6) // (SSC) Receive/Transmit Clock Gating Selection -#define AT91C_SSC_CKG_NONE ((unsigned int) 0x0 << 6) // (SSC) Receive/Transmit Clock Gating: None, continuous clock -#define AT91C_SSC_CKG_LOW ((unsigned int) 0x1 << 6) // (SSC) Receive/Transmit Clock enabled only if RF Low -#define AT91C_SSC_CKG_HIGH ((unsigned int) 0x2 << 6) // (SSC) Receive/Transmit Clock enabled only if RF High -#define AT91C_SSC_START ((unsigned int) 0xF << 8) // (SSC) Receive/Transmit Start Selection -#define AT91C_SSC_START_CONTINOUS ((unsigned int) 0x0 << 8) // (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. -#define AT91C_SSC_START_TX ((unsigned int) 0x1 << 8) // (SSC) Transmit/Receive start -#define AT91C_SSC_START_LOW_RF ((unsigned int) 0x2 << 8) // (SSC) Detection of a low level on RF input -#define AT91C_SSC_START_HIGH_RF ((unsigned int) 0x3 << 8) // (SSC) Detection of a high level on RF input -#define AT91C_SSC_START_FALL_RF ((unsigned int) 0x4 << 8) // (SSC) Detection of a falling edge on RF input -#define AT91C_SSC_START_RISE_RF ((unsigned int) 0x5 << 8) // (SSC) Detection of a rising edge on RF input -#define AT91C_SSC_START_LEVEL_RF ((unsigned int) 0x6 << 8) // (SSC) Detection of any level change on RF input -#define AT91C_SSC_START_EDGE_RF ((unsigned int) 0x7 << 8) // (SSC) Detection of any edge on RF input -#define AT91C_SSC_START_0 ((unsigned int) 0x8 << 8) // (SSC) Compare 0 -#define AT91C_SSC_STOP ((unsigned int) 0x1 << 12) // (SSC) Receive Stop Selection -#define AT91C_SSC_STTDLY ((unsigned int) 0xFF << 16) // (SSC) Receive/Transmit Start Delay -#define AT91C_SSC_PERIOD ((unsigned int) 0xFF << 24) // (SSC) Receive/Transmit Period Divider Selection -// -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- -#define AT91C_SSC_DATLEN ((unsigned int) 0x1F << 0) // (SSC) Data Length -#define AT91C_SSC_LOOP ((unsigned int) 0x1 << 5) // (SSC) Loop Mode -#define AT91C_SSC_MSBF ((unsigned int) 0x1 << 7) // (SSC) Most Significant Bit First -#define AT91C_SSC_DATNB ((unsigned int) 0xF << 8) // (SSC) Data Number per Frame -#define AT91C_SSC_FSLEN ((unsigned int) 0xF << 16) // (SSC) Receive/Transmit Frame Sync length -#define AT91C_SSC_FSOS ((unsigned int) 0x7 << 20) // (SSC) Receive/Transmit Frame Sync Output Selection -#define AT91C_SSC_FSOS_NONE ((unsigned int) 0x0 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only -#define AT91C_SSC_FSOS_NEGATIVE ((unsigned int) 0x1 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse -#define AT91C_SSC_FSOS_POSITIVE ((unsigned int) 0x2 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse -#define AT91C_SSC_FSOS_LOW ((unsigned int) 0x3 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer -#define AT91C_SSC_FSOS_HIGH ((unsigned int) 0x4 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer -#define AT91C_SSC_FSOS_TOGGLE ((unsigned int) 0x5 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer -#define AT91C_SSC_FSEDGE ((unsigned int) 0x1 << 24) // (SSC) Frame Sync Edge Detection -// -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- -// -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- -#define AT91C_SSC_DATDEF ((unsigned int) 0x1 << 5) // (SSC) Data Default Value -#define AT91C_SSC_FSDEN ((unsigned int) 0x1 << 23) // (SSC) Frame Sync Data Enable -// -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- -#define AT91C_SSC_TXRDY ((unsigned int) 0x1 << 0) // (SSC) Transmit Ready -#define AT91C_SSC_TXEMPTY ((unsigned int) 0x1 << 1) // (SSC) Transmit Empty -#define AT91C_SSC_ENDTX ((unsigned int) 0x1 << 2) // (SSC) End Of Transmission -#define AT91C_SSC_TXBUFE ((unsigned int) 0x1 << 3) // (SSC) Transmit Buffer Empty -#define AT91C_SSC_RXRDY ((unsigned int) 0x1 << 4) // (SSC) Receive Ready -#define AT91C_SSC_OVRUN ((unsigned int) 0x1 << 5) // (SSC) Receive Overrun -#define AT91C_SSC_ENDRX ((unsigned int) 0x1 << 6) // (SSC) End of Reception -#define AT91C_SSC_RXBUFF ((unsigned int) 0x1 << 7) // (SSC) Receive Buffer Full -#define AT91C_SSC_CP0 ((unsigned int) 0x1 << 8) // (SSC) Compare 0 -#define AT91C_SSC_CP1 ((unsigned int) 0x1 << 9) // (SSC) Compare 1 -#define AT91C_SSC_TXSYN ((unsigned int) 0x1 << 10) // (SSC) Transmit Sync -#define AT91C_SSC_RXSYN ((unsigned int) 0x1 << 11) // (SSC) Receive Sync -#define AT91C_SSC_TXENA ((unsigned int) 0x1 << 16) // (SSC) Transmit Enable -#define AT91C_SSC_RXENA ((unsigned int) 0x1 << 17) // (SSC) Receive Enable -// -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- -// -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- -// -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Two-wire Interface -// ***************************************************************************** -typedef struct _AT91S_TWI { - AT91_REG TWI_CR; // Control Register - AT91_REG TWI_MMR; // Master Mode Register - AT91_REG Reserved0[1]; // - AT91_REG TWI_IADR; // Internal Address Register - AT91_REG TWI_CWGR; // Clock Waveform Generator Register - AT91_REG Reserved1[3]; // - AT91_REG TWI_SR; // Status Register - AT91_REG TWI_IER; // Interrupt Enable Register - AT91_REG TWI_IDR; // Interrupt Disable Register - AT91_REG TWI_IMR; // Interrupt Mask Register - AT91_REG TWI_RHR; // Receive Holding Register - AT91_REG TWI_THR; // Transmit Holding Register -} AT91S_TWI, *AT91PS_TWI; - -// -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- -#define AT91C_TWI_START ((unsigned int) 0x1 << 0) // (TWI) Send a START Condition -#define AT91C_TWI_STOP ((unsigned int) 0x1 << 1) // (TWI) Send a STOP Condition -#define AT91C_TWI_MSEN ((unsigned int) 0x1 << 2) // (TWI) TWI Master Transfer Enabled -#define AT91C_TWI_MSDIS ((unsigned int) 0x1 << 3) // (TWI) TWI Master Transfer Disabled -#define AT91C_TWI_SWRST ((unsigned int) 0x1 << 7) // (TWI) Software Reset -// -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- -#define AT91C_TWI_IADRSZ ((unsigned int) 0x3 << 8) // (TWI) Internal Device Address Size -#define AT91C_TWI_IADRSZ_NO ((unsigned int) 0x0 << 8) // (TWI) No internal device address -#define AT91C_TWI_IADRSZ_1_BYTE ((unsigned int) 0x1 << 8) // (TWI) One-byte internal device address -#define AT91C_TWI_IADRSZ_2_BYTE ((unsigned int) 0x2 << 8) // (TWI) Two-byte internal device address -#define AT91C_TWI_IADRSZ_3_BYTE ((unsigned int) 0x3 << 8) // (TWI) Three-byte internal device address -#define AT91C_TWI_MREAD ((unsigned int) 0x1 << 12) // (TWI) Master Read Direction -#define AT91C_TWI_DADR ((unsigned int) 0x7F << 16) // (TWI) Device Address -// -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- -#define AT91C_TWI_CLDIV ((unsigned int) 0xFF << 0) // (TWI) Clock Low Divider -#define AT91C_TWI_CHDIV ((unsigned int) 0xFF << 8) // (TWI) Clock High Divider -#define AT91C_TWI_CKDIV ((unsigned int) 0x7 << 16) // (TWI) Clock Divider -// -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- -#define AT91C_TWI_TXCOMP ((unsigned int) 0x1 << 0) // (TWI) Transmission Completed -#define AT91C_TWI_RXRDY ((unsigned int) 0x1 << 1) // (TWI) Receive holding register ReaDY -#define AT91C_TWI_TXRDY ((unsigned int) 0x1 << 2) // (TWI) Transmit holding register ReaDY -#define AT91C_TWI_OVRE ((unsigned int) 0x1 << 6) // (TWI) Overrun Error -#define AT91C_TWI_UNRE ((unsigned int) 0x1 << 7) // (TWI) Underrun Error -#define AT91C_TWI_NACK ((unsigned int) 0x1 << 8) // (TWI) Not Acknowledged -// -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- -// -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- -// -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR PWMC Channel Interface -// ***************************************************************************** -typedef struct _AT91S_PWMC_CH { - AT91_REG PWMC_CMR; // Channel Mode Register - AT91_REG PWMC_CDTYR; // Channel Duty Cycle Register - AT91_REG PWMC_CPRDR; // Channel Period Register - AT91_REG PWMC_CCNTR; // Channel Counter Register - AT91_REG PWMC_CUPDR; // Channel Update Register - AT91_REG PWMC_Reserved[3]; // Reserved -} AT91S_PWMC_CH, *AT91PS_PWMC_CH; - -// -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- -#define AT91C_PWMC_CPRE ((unsigned int) 0xF << 0) // (PWMC_CH) Channel Pre-scaler : PWMC_CLKx -#define AT91C_PWMC_CPRE_MCK ((unsigned int) 0x0) // (PWMC_CH) -#define AT91C_PWMC_CPRE_MCKA ((unsigned int) 0xB) // (PWMC_CH) -#define AT91C_PWMC_CPRE_MCKB ((unsigned int) 0xC) // (PWMC_CH) -#define AT91C_PWMC_CALG ((unsigned int) 0x1 << 8) // (PWMC_CH) Channel Alignment -#define AT91C_PWMC_CPOL ((unsigned int) 0x1 << 9) // (PWMC_CH) Channel Polarity -#define AT91C_PWMC_CPD ((unsigned int) 0x1 << 10) // (PWMC_CH) Channel Update Period -// -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- -#define AT91C_PWMC_CDTY ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Duty Cycle -// -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- -#define AT91C_PWMC_CPRD ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Period -// -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- -#define AT91C_PWMC_CCNT ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Counter -// -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- -#define AT91C_PWMC_CUPD ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Update - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface -// ***************************************************************************** -typedef struct _AT91S_PWMC { - AT91_REG PWMC_MR; // PWMC Mode Register - AT91_REG PWMC_ENA; // PWMC Enable Register - AT91_REG PWMC_DIS; // PWMC Disable Register - AT91_REG PWMC_SR; // PWMC Status Register - AT91_REG PWMC_IER; // PWMC Interrupt Enable Register - AT91_REG PWMC_IDR; // PWMC Interrupt Disable Register - AT91_REG PWMC_IMR; // PWMC Interrupt Mask Register - AT91_REG PWMC_ISR; // PWMC Interrupt Status Register - AT91_REG Reserved0[55]; // - AT91_REG PWMC_VR; // PWMC Version Register - AT91_REG Reserved1[64]; // - AT91S_PWMC_CH PWMC_CH[4]; // PWMC Channel -} AT91S_PWMC, *AT91PS_PWMC; - -// -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- -#define AT91C_PWMC_DIVA ((unsigned int) 0xFF << 0) // (PWMC) CLKA divide factor. -#define AT91C_PWMC_PREA ((unsigned int) 0xF << 8) // (PWMC) Divider Input Clock Prescaler A -#define AT91C_PWMC_PREA_MCK ((unsigned int) 0x0 << 8) // (PWMC) -#define AT91C_PWMC_DIVB ((unsigned int) 0xFF << 16) // (PWMC) CLKB divide factor. -#define AT91C_PWMC_PREB ((unsigned int) 0xF << 24) // (PWMC) Divider Input Clock Prescaler B -#define AT91C_PWMC_PREB_MCK ((unsigned int) 0x0 << 24) // (PWMC) -// -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- -#define AT91C_PWMC_CHID0 ((unsigned int) 0x1 << 0) // (PWMC) Channel ID 0 -#define AT91C_PWMC_CHID1 ((unsigned int) 0x1 << 1) // (PWMC) Channel ID 1 -#define AT91C_PWMC_CHID2 ((unsigned int) 0x1 << 2) // (PWMC) Channel ID 2 -#define AT91C_PWMC_CHID3 ((unsigned int) 0x1 << 3) // (PWMC) Channel ID 3 -// -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- -// -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- -// -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- -// -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- -// -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- -// -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR USB Device Interface -// ***************************************************************************** -typedef struct _AT91S_UDP { - AT91_REG UDP_NUM; // Frame Number Register - AT91_REG UDP_GLBSTATE; // Global State Register - AT91_REG UDP_FADDR; // Function Address Register - AT91_REG Reserved0[1]; // - AT91_REG UDP_IER; // Interrupt Enable Register - AT91_REG UDP_IDR; // Interrupt Disable Register - AT91_REG UDP_IMR; // Interrupt Mask Register - AT91_REG UDP_ISR; // Interrupt Status Register - AT91_REG UDP_ICR; // Interrupt Clear Register - AT91_REG Reserved1[1]; // - AT91_REG UDP_RSTEP; // Reset Endpoint Register - AT91_REG Reserved2[1]; // - AT91_REG UDP_CSR[6]; // Endpoint Control and Status Register - AT91_REG Reserved3[2]; // - AT91_REG UDP_FDR[6]; // Endpoint FIFO Data Register - AT91_REG Reserved4[3]; // - AT91_REG UDP_TXVC; // Transceiver Control Register -} AT91S_UDP, *AT91PS_UDP; - -// -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- -#define AT91C_UDP_FRM_NUM ((unsigned int) 0x7FF << 0) // (UDP) Frame Number as Defined in the Packet Field Formats -#define AT91C_UDP_FRM_ERR ((unsigned int) 0x1 << 16) // (UDP) Frame Error -#define AT91C_UDP_FRM_OK ((unsigned int) 0x1 << 17) // (UDP) Frame OK -// -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- -#define AT91C_UDP_FADDEN ((unsigned int) 0x1 << 0) // (UDP) Function Address Enable -#define AT91C_UDP_CONFG ((unsigned int) 0x1 << 1) // (UDP) Configured -#define AT91C_UDP_ESR ((unsigned int) 0x1 << 2) // (UDP) Enable Send Resume -#define AT91C_UDP_RSMINPR ((unsigned int) 0x1 << 3) // (UDP) A Resume Has Been Sent to the Host -#define AT91C_UDP_RMWUPE ((unsigned int) 0x1 << 4) // (UDP) Remote Wake Up Enable -// -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- -#define AT91C_UDP_FADD ((unsigned int) 0xFF << 0) // (UDP) Function Address Value -#define AT91C_UDP_FEN ((unsigned int) 0x1 << 8) // (UDP) Function Enable -// -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- -#define AT91C_UDP_EPINT0 ((unsigned int) 0x1 << 0) // (UDP) Endpoint 0 Interrupt -#define AT91C_UDP_EPINT1 ((unsigned int) 0x1 << 1) // (UDP) Endpoint 0 Interrupt -#define AT91C_UDP_EPINT2 ((unsigned int) 0x1 << 2) // (UDP) Endpoint 2 Interrupt -#define AT91C_UDP_EPINT3 ((unsigned int) 0x1 << 3) // (UDP) Endpoint 3 Interrupt -#define AT91C_UDP_EPINT4 ((unsigned int) 0x1 << 4) // (UDP) Endpoint 4 Interrupt -#define AT91C_UDP_EPINT5 ((unsigned int) 0x1 << 5) // (UDP) Endpoint 5 Interrupt -#define AT91C_UDP_RXSUSP ((unsigned int) 0x1 << 8) // (UDP) USB Suspend Interrupt -#define AT91C_UDP_RXRSM ((unsigned int) 0x1 << 9) // (UDP) USB Resume Interrupt -#define AT91C_UDP_EXTRSM ((unsigned int) 0x1 << 10) // (UDP) USB External Resume Interrupt -#define AT91C_UDP_SOFINT ((unsigned int) 0x1 << 11) // (UDP) USB Start Of frame Interrupt -#define AT91C_UDP_WAKEUP ((unsigned int) 0x1 << 13) // (UDP) USB Resume Interrupt -// -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- -// -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- -// -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- -#define AT91C_UDP_ENDBUSRES ((unsigned int) 0x1 << 12) // (UDP) USB End Of Bus Reset Interrupt -// -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- -// -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- -#define AT91C_UDP_EP0 ((unsigned int) 0x1 << 0) // (UDP) Reset Endpoint 0 -#define AT91C_UDP_EP1 ((unsigned int) 0x1 << 1) // (UDP) Reset Endpoint 1 -#define AT91C_UDP_EP2 ((unsigned int) 0x1 << 2) // (UDP) Reset Endpoint 2 -#define AT91C_UDP_EP3 ((unsigned int) 0x1 << 3) // (UDP) Reset Endpoint 3 -#define AT91C_UDP_EP4 ((unsigned int) 0x1 << 4) // (UDP) Reset Endpoint 4 -#define AT91C_UDP_EP5 ((unsigned int) 0x1 << 5) // (UDP) Reset Endpoint 5 -// -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- -#define AT91C_UDP_TXCOMP ((unsigned int) 0x1 << 0) // (UDP) Generates an IN packet with data previously written in the DPR -#define AT91C_UDP_RX_DATA_BK0 ((unsigned int) 0x1 << 1) // (UDP) Receive Data Bank 0 -#define AT91C_UDP_RXSETUP ((unsigned int) 0x1 << 2) // (UDP) Sends STALL to the Host (Control endpoints) -#define AT91C_UDP_ISOERROR ((unsigned int) 0x1 << 3) // (UDP) Isochronous error (Isochronous endpoints) -#define AT91C_UDP_TXPKTRDY ((unsigned int) 0x1 << 4) // (UDP) Transmit Packet Ready -#define AT91C_UDP_FORCESTALL ((unsigned int) 0x1 << 5) // (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). -#define AT91C_UDP_RX_DATA_BK1 ((unsigned int) 0x1 << 6) // (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). -#define AT91C_UDP_DIR ((unsigned int) 0x1 << 7) // (UDP) Transfer Direction -#define AT91C_UDP_EPTYPE ((unsigned int) 0x7 << 8) // (UDP) Endpoint type -#define AT91C_UDP_EPTYPE_CTRL ((unsigned int) 0x0 << 8) // (UDP) Control -#define AT91C_UDP_EPTYPE_ISO_OUT ((unsigned int) 0x1 << 8) // (UDP) Isochronous OUT -#define AT91C_UDP_EPTYPE_BULK_OUT ((unsigned int) 0x2 << 8) // (UDP) Bulk OUT -#define AT91C_UDP_EPTYPE_INT_OUT ((unsigned int) 0x3 << 8) // (UDP) Interrupt OUT -#define AT91C_UDP_EPTYPE_ISO_IN ((unsigned int) 0x5 << 8) // (UDP) Isochronous IN -#define AT91C_UDP_EPTYPE_BULK_IN ((unsigned int) 0x6 << 8) // (UDP) Bulk IN -#define AT91C_UDP_EPTYPE_INT_IN ((unsigned int) 0x7 << 8) // (UDP) Interrupt IN -#define AT91C_UDP_DTGLE ((unsigned int) 0x1 << 11) // (UDP) Data Toggle -#define AT91C_UDP_EPEDS ((unsigned int) 0x1 << 15) // (UDP) Endpoint Enable Disable -#define AT91C_UDP_RXBYTECNT ((unsigned int) 0x7FF << 16) // (UDP) Number Of Bytes Available in the FIFO -// -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- -#define AT91C_UDP_TXVDIS ((unsigned int) 0x1 << 8) // (UDP) -#define AT91C_UDP_PUON ((unsigned int) 0x1 << 9) // (UDP) Pull-up ON - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Timer Counter Channel Interface -// ***************************************************************************** -typedef struct _AT91S_TC { - AT91_REG TC_CCR; // Channel Control Register - AT91_REG TC_CMR; // Channel Mode Register (Capture Mode / Waveform Mode) - AT91_REG Reserved0[2]; // - AT91_REG TC_CV; // Counter Value - AT91_REG TC_RA; // Register A - AT91_REG TC_RB; // Register B - AT91_REG TC_RC; // Register C - AT91_REG TC_SR; // Status Register - AT91_REG TC_IER; // Interrupt Enable Register - AT91_REG TC_IDR; // Interrupt Disable Register - AT91_REG TC_IMR; // Interrupt Mask Register -} AT91S_TC, *AT91PS_TC; - -// -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- -#define AT91C_TC_CLKEN ((unsigned int) 0x1 << 0) // (TC) Counter Clock Enable Command -#define AT91C_TC_CLKDIS ((unsigned int) 0x1 << 1) // (TC) Counter Clock Disable Command -#define AT91C_TC_SWTRG ((unsigned int) 0x1 << 2) // (TC) Software Trigger Command -// -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- -#define AT91C_TC_CLKS ((unsigned int) 0x7 << 0) // (TC) Clock Selection -#define AT91C_TC_CLKS_TIMER_DIV1_CLOCK ((unsigned int) 0x0) // (TC) Clock selected: TIMER_DIV1_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV2_CLOCK ((unsigned int) 0x1) // (TC) Clock selected: TIMER_DIV2_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV3_CLOCK ((unsigned int) 0x2) // (TC) Clock selected: TIMER_DIV3_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV4_CLOCK ((unsigned int) 0x3) // (TC) Clock selected: TIMER_DIV4_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV5_CLOCK ((unsigned int) 0x4) // (TC) Clock selected: TIMER_DIV5_CLOCK -#define AT91C_TC_CLKS_XC0 ((unsigned int) 0x5) // (TC) Clock selected: XC0 -#define AT91C_TC_CLKS_XC1 ((unsigned int) 0x6) // (TC) Clock selected: XC1 -#define AT91C_TC_CLKS_XC2 ((unsigned int) 0x7) // (TC) Clock selected: XC2 -#define AT91C_TC_CLKI ((unsigned int) 0x1 << 3) // (TC) Clock Invert -#define AT91C_TC_BURST ((unsigned int) 0x3 << 4) // (TC) Burst Signal Selection -#define AT91C_TC_BURST_NONE ((unsigned int) 0x0 << 4) // (TC) The clock is not gated by an external signal -#define AT91C_TC_BURST_XC0 ((unsigned int) 0x1 << 4) // (TC) XC0 is ANDed with the selected clock -#define AT91C_TC_BURST_XC1 ((unsigned int) 0x2 << 4) // (TC) XC1 is ANDed with the selected clock -#define AT91C_TC_BURST_XC2 ((unsigned int) 0x3 << 4) // (TC) XC2 is ANDed with the selected clock -#define AT91C_TC_CPCSTOP ((unsigned int) 0x1 << 6) // (TC) Counter Clock Stopped with RC Compare -#define AT91C_TC_LDBSTOP ((unsigned int) 0x1 << 6) // (TC) Counter Clock Stopped with RB Loading -#define AT91C_TC_CPCDIS ((unsigned int) 0x1 << 7) // (TC) Counter Clock Disable with RC Compare -#define AT91C_TC_LDBDIS ((unsigned int) 0x1 << 7) // (TC) Counter Clock Disabled with RB Loading -#define AT91C_TC_ETRGEDG ((unsigned int) 0x3 << 8) // (TC) External Trigger Edge Selection -#define AT91C_TC_ETRGEDG_NONE ((unsigned int) 0x0 << 8) // (TC) Edge: None -#define AT91C_TC_ETRGEDG_RISING ((unsigned int) 0x1 << 8) // (TC) Edge: rising edge -#define AT91C_TC_ETRGEDG_FALLING ((unsigned int) 0x2 << 8) // (TC) Edge: falling edge -#define AT91C_TC_ETRGEDG_BOTH ((unsigned int) 0x3 << 8) // (TC) Edge: each edge -#define AT91C_TC_EEVTEDG ((unsigned int) 0x3 << 8) // (TC) External Event Edge Selection -#define AT91C_TC_EEVTEDG_NONE ((unsigned int) 0x0 << 8) // (TC) Edge: None -#define AT91C_TC_EEVTEDG_RISING ((unsigned int) 0x1 << 8) // (TC) Edge: rising edge -#define AT91C_TC_EEVTEDG_FALLING ((unsigned int) 0x2 << 8) // (TC) Edge: falling edge -#define AT91C_TC_EEVTEDG_BOTH ((unsigned int) 0x3 << 8) // (TC) Edge: each edge -#define AT91C_TC_EEVT ((unsigned int) 0x3 << 10) // (TC) External Event Selection -#define AT91C_TC_EEVT_TIOB ((unsigned int) 0x0 << 10) // (TC) Signal selected as external event: TIOB TIOB direction: input -#define AT91C_TC_EEVT_XC0 ((unsigned int) 0x1 << 10) // (TC) Signal selected as external event: XC0 TIOB direction: output -#define AT91C_TC_EEVT_XC1 ((unsigned int) 0x2 << 10) // (TC) Signal selected as external event: XC1 TIOB direction: output -#define AT91C_TC_EEVT_XC2 ((unsigned int) 0x3 << 10) // (TC) Signal selected as external event: XC2 TIOB direction: output -#define AT91C_TC_ABETRG ((unsigned int) 0x1 << 10) // (TC) TIOA or TIOB External Trigger Selection -#define AT91C_TC_ENETRG ((unsigned int) 0x1 << 12) // (TC) External Event Trigger enable -#define AT91C_TC_WAVESEL ((unsigned int) 0x3 << 13) // (TC) Waveform Selection -#define AT91C_TC_WAVESEL_UP ((unsigned int) 0x0 << 13) // (TC) UP mode without atomatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UPDOWN ((unsigned int) 0x1 << 13) // (TC) UPDOWN mode without automatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UP_AUTO ((unsigned int) 0x2 << 13) // (TC) UP mode with automatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UPDOWN_AUTO ((unsigned int) 0x3 << 13) // (TC) UPDOWN mode with automatic trigger on RC Compare -#define AT91C_TC_CPCTRG ((unsigned int) 0x1 << 14) // (TC) RC Compare Trigger Enable -#define AT91C_TC_WAVE ((unsigned int) 0x1 << 15) // (TC) -#define AT91C_TC_ACPA ((unsigned int) 0x3 << 16) // (TC) RA Compare Effect on TIOA -#define AT91C_TC_ACPA_NONE ((unsigned int) 0x0 << 16) // (TC) Effect: none -#define AT91C_TC_ACPA_SET ((unsigned int) 0x1 << 16) // (TC) Effect: set -#define AT91C_TC_ACPA_CLEAR ((unsigned int) 0x2 << 16) // (TC) Effect: clear -#define AT91C_TC_ACPA_TOGGLE ((unsigned int) 0x3 << 16) // (TC) Effect: toggle -#define AT91C_TC_LDRA ((unsigned int) 0x3 << 16) // (TC) RA Loading Selection -#define AT91C_TC_LDRA_NONE ((unsigned int) 0x0 << 16) // (TC) Edge: None -#define AT91C_TC_LDRA_RISING ((unsigned int) 0x1 << 16) // (TC) Edge: rising edge of TIOA -#define AT91C_TC_LDRA_FALLING ((unsigned int) 0x2 << 16) // (TC) Edge: falling edge of TIOA -#define AT91C_TC_LDRA_BOTH ((unsigned int) 0x3 << 16) // (TC) Edge: each edge of TIOA -#define AT91C_TC_ACPC ((unsigned int) 0x3 << 18) // (TC) RC Compare Effect on TIOA -#define AT91C_TC_ACPC_NONE ((unsigned int) 0x0 << 18) // (TC) Effect: none -#define AT91C_TC_ACPC_SET ((unsigned int) 0x1 << 18) // (TC) Effect: set -#define AT91C_TC_ACPC_CLEAR ((unsigned int) 0x2 << 18) // (TC) Effect: clear -#define AT91C_TC_ACPC_TOGGLE ((unsigned int) 0x3 << 18) // (TC) Effect: toggle -#define AT91C_TC_LDRB ((unsigned int) 0x3 << 18) // (TC) RB Loading Selection -#define AT91C_TC_LDRB_NONE ((unsigned int) 0x0 << 18) // (TC) Edge: None -#define AT91C_TC_LDRB_RISING ((unsigned int) 0x1 << 18) // (TC) Edge: rising edge of TIOA -#define AT91C_TC_LDRB_FALLING ((unsigned int) 0x2 << 18) // (TC) Edge: falling edge of TIOA -#define AT91C_TC_LDRB_BOTH ((unsigned int) 0x3 << 18) // (TC) Edge: each edge of TIOA -#define AT91C_TC_AEEVT ((unsigned int) 0x3 << 20) // (TC) External Event Effect on TIOA -#define AT91C_TC_AEEVT_NONE ((unsigned int) 0x0 << 20) // (TC) Effect: none -#define AT91C_TC_AEEVT_SET ((unsigned int) 0x1 << 20) // (TC) Effect: set -#define AT91C_TC_AEEVT_CLEAR ((unsigned int) 0x2 << 20) // (TC) Effect: clear -#define AT91C_TC_AEEVT_TOGGLE ((unsigned int) 0x3 << 20) // (TC) Effect: toggle -#define AT91C_TC_ASWTRG ((unsigned int) 0x3 << 22) // (TC) Software Trigger Effect on TIOA -#define AT91C_TC_ASWTRG_NONE ((unsigned int) 0x0 << 22) // (TC) Effect: none -#define AT91C_TC_ASWTRG_SET ((unsigned int) 0x1 << 22) // (TC) Effect: set -#define AT91C_TC_ASWTRG_CLEAR ((unsigned int) 0x2 << 22) // (TC) Effect: clear -#define AT91C_TC_ASWTRG_TOGGLE ((unsigned int) 0x3 << 22) // (TC) Effect: toggle -#define AT91C_TC_BCPB ((unsigned int) 0x3 << 24) // (TC) RB Compare Effect on TIOB -#define AT91C_TC_BCPB_NONE ((unsigned int) 0x0 << 24) // (TC) Effect: none -#define AT91C_TC_BCPB_SET ((unsigned int) 0x1 << 24) // (TC) Effect: set -#define AT91C_TC_BCPB_CLEAR ((unsigned int) 0x2 << 24) // (TC) Effect: clear -#define AT91C_TC_BCPB_TOGGLE ((unsigned int) 0x3 << 24) // (TC) Effect: toggle -#define AT91C_TC_BCPC ((unsigned int) 0x3 << 26) // (TC) RC Compare Effect on TIOB -#define AT91C_TC_BCPC_NONE ((unsigned int) 0x0 << 26) // (TC) Effect: none -#define AT91C_TC_BCPC_SET ((unsigned int) 0x1 << 26) // (TC) Effect: set -#define AT91C_TC_BCPC_CLEAR ((unsigned int) 0x2 << 26) // (TC) Effect: clear -#define AT91C_TC_BCPC_TOGGLE ((unsigned int) 0x3 << 26) // (TC) Effect: toggle -#define AT91C_TC_BEEVT ((unsigned int) 0x3 << 28) // (TC) External Event Effect on TIOB -#define AT91C_TC_BEEVT_NONE ((unsigned int) 0x0 << 28) // (TC) Effect: none -#define AT91C_TC_BEEVT_SET ((unsigned int) 0x1 << 28) // (TC) Effect: set -#define AT91C_TC_BEEVT_CLEAR ((unsigned int) 0x2 << 28) // (TC) Effect: clear -#define AT91C_TC_BEEVT_TOGGLE ((unsigned int) 0x3 << 28) // (TC) Effect: toggle -#define AT91C_TC_BSWTRG ((unsigned int) 0x3 << 30) // (TC) Software Trigger Effect on TIOB -#define AT91C_TC_BSWTRG_NONE ((unsigned int) 0x0 << 30) // (TC) Effect: none -#define AT91C_TC_BSWTRG_SET ((unsigned int) 0x1 << 30) // (TC) Effect: set -#define AT91C_TC_BSWTRG_CLEAR ((unsigned int) 0x2 << 30) // (TC) Effect: clear -#define AT91C_TC_BSWTRG_TOGGLE ((unsigned int) 0x3 << 30) // (TC) Effect: toggle -// -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- -#define AT91C_TC_COVFS ((unsigned int) 0x1 << 0) // (TC) Counter Overflow -#define AT91C_TC_LOVRS ((unsigned int) 0x1 << 1) // (TC) Load Overrun -#define AT91C_TC_CPAS ((unsigned int) 0x1 << 2) // (TC) RA Compare -#define AT91C_TC_CPBS ((unsigned int) 0x1 << 3) // (TC) RB Compare -#define AT91C_TC_CPCS ((unsigned int) 0x1 << 4) // (TC) RC Compare -#define AT91C_TC_LDRAS ((unsigned int) 0x1 << 5) // (TC) RA Loading -#define AT91C_TC_LDRBS ((unsigned int) 0x1 << 6) // (TC) RB Loading -#define AT91C_TC_ETRGS ((unsigned int) 0x1 << 7) // (TC) External Trigger -#define AT91C_TC_CLKSTA ((unsigned int) 0x1 << 16) // (TC) Clock Enabling -#define AT91C_TC_MTIOA ((unsigned int) 0x1 << 17) // (TC) TIOA Mirror -#define AT91C_TC_MTIOB ((unsigned int) 0x1 << 18) // (TC) TIOA Mirror -// -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- -// -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- -// -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Timer Counter Interface -// ***************************************************************************** -typedef struct _AT91S_TCB { - AT91S_TC TCB_TC0; // TC Channel 0 - AT91_REG Reserved0[4]; // - AT91S_TC TCB_TC1; // TC Channel 1 - AT91_REG Reserved1[4]; // - AT91S_TC TCB_TC2; // TC Channel 2 - AT91_REG Reserved2[4]; // - AT91_REG TCB_BCR; // TC Block Control Register - AT91_REG TCB_BMR; // TC Block Mode Register -} AT91S_TCB, *AT91PS_TCB; - -// -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- -#define AT91C_TCB_SYNC ((unsigned int) 0x1 << 0) // (TCB) Synchro Command -// -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- -#define AT91C_TCB_TC0XC0S ((unsigned int) 0x3 << 0) // (TCB) External Clock Signal 0 Selection -#define AT91C_TCB_TC0XC0S_TCLK0 ((unsigned int) 0x0) // (TCB) TCLK0 connected to XC0 -#define AT91C_TCB_TC0XC0S_NONE ((unsigned int) 0x1) // (TCB) None signal connected to XC0 -#define AT91C_TCB_TC0XC0S_TIOA1 ((unsigned int) 0x2) // (TCB) TIOA1 connected to XC0 -#define AT91C_TCB_TC0XC0S_TIOA2 ((unsigned int) 0x3) // (TCB) TIOA2 connected to XC0 -#define AT91C_TCB_TC1XC1S ((unsigned int) 0x3 << 2) // (TCB) External Clock Signal 1 Selection -#define AT91C_TCB_TC1XC1S_TCLK1 ((unsigned int) 0x0 << 2) // (TCB) TCLK1 connected to XC1 -#define AT91C_TCB_TC1XC1S_NONE ((unsigned int) 0x1 << 2) // (TCB) None signal connected to XC1 -#define AT91C_TCB_TC1XC1S_TIOA0 ((unsigned int) 0x2 << 2) // (TCB) TIOA0 connected to XC1 -#define AT91C_TCB_TC1XC1S_TIOA2 ((unsigned int) 0x3 << 2) // (TCB) TIOA2 connected to XC1 -#define AT91C_TCB_TC2XC2S ((unsigned int) 0x3 << 4) // (TCB) External Clock Signal 2 Selection -#define AT91C_TCB_TC2XC2S_TCLK2 ((unsigned int) 0x0 << 4) // (TCB) TCLK2 connected to XC2 -#define AT91C_TCB_TC2XC2S_NONE ((unsigned int) 0x1 << 4) // (TCB) None signal connected to XC2 -#define AT91C_TCB_TC2XC2S_TIOA0 ((unsigned int) 0x2 << 4) // (TCB) TIOA0 connected to XC2 -#define AT91C_TCB_TC2XC2S_TIOA1 ((unsigned int) 0x3 << 4) // (TCB) TIOA2 connected to XC2 - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface -// ***************************************************************************** -typedef struct _AT91S_CAN_MB { - AT91_REG CAN_MB_MMR; // MailBox Mode Register - AT91_REG CAN_MB_MAM; // MailBox Acceptance Mask Register - AT91_REG CAN_MB_MID; // MailBox ID Register - AT91_REG CAN_MB_MFID; // MailBox Family ID Register - AT91_REG CAN_MB_MSR; // MailBox Status Register - AT91_REG CAN_MB_MDL; // MailBox Data Low Register - AT91_REG CAN_MB_MDH; // MailBox Data High Register - AT91_REG CAN_MB_MCR; // MailBox Control Register -} AT91S_CAN_MB, *AT91PS_CAN_MB; - -// -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- -#define AT91C_CAN_MTIMEMARK ((unsigned int) 0xFFFF << 0) // (CAN_MB) Mailbox Timemark -#define AT91C_CAN_PRIOR ((unsigned int) 0xF << 16) // (CAN_MB) Mailbox Priority -#define AT91C_CAN_MOT ((unsigned int) 0x7 << 24) // (CAN_MB) Mailbox Object Type -#define AT91C_CAN_MOT_DIS ((unsigned int) 0x0 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_RX ((unsigned int) 0x1 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_RXOVERWRITE ((unsigned int) 0x2 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_TX ((unsigned int) 0x3 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_CONSUMER ((unsigned int) 0x4 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_PRODUCER ((unsigned int) 0x5 << 24) // (CAN_MB) -// -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- -#define AT91C_CAN_MIDvB ((unsigned int) 0x3FFFF << 0) // (CAN_MB) Complementary bits for identifier in extended mode -#define AT91C_CAN_MIDvA ((unsigned int) 0x7FF << 18) // (CAN_MB) Identifier for standard frame mode -#define AT91C_CAN_MIDE ((unsigned int) 0x1 << 29) // (CAN_MB) Identifier Version -// -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- -// -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- -// -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- -#define AT91C_CAN_MTIMESTAMP ((unsigned int) 0xFFFF << 0) // (CAN_MB) Timer Value -#define AT91C_CAN_MDLC ((unsigned int) 0xF << 16) // (CAN_MB) Mailbox Data Length Code -#define AT91C_CAN_MRTR ((unsigned int) 0x1 << 20) // (CAN_MB) Mailbox Remote Transmission Request -#define AT91C_CAN_MABT ((unsigned int) 0x1 << 22) // (CAN_MB) Mailbox Message Abort -#define AT91C_CAN_MRDY ((unsigned int) 0x1 << 23) // (CAN_MB) Mailbox Ready -#define AT91C_CAN_MMI ((unsigned int) 0x1 << 24) // (CAN_MB) Mailbox Message Ignored -// -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- -// -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- -// -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- -#define AT91C_CAN_MACR ((unsigned int) 0x1 << 22) // (CAN_MB) Abort Request for Mailbox -#define AT91C_CAN_MTCR ((unsigned int) 0x1 << 23) // (CAN_MB) Mailbox Transfer Command - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Control Area Network Interface -// ***************************************************************************** -typedef struct _AT91S_CAN { - AT91_REG CAN_MR; // Mode Register - AT91_REG CAN_IER; // Interrupt Enable Register - AT91_REG CAN_IDR; // Interrupt Disable Register - AT91_REG CAN_IMR; // Interrupt Mask Register - AT91_REG CAN_SR; // Status Register - AT91_REG CAN_BR; // Baudrate Register - AT91_REG CAN_TIM; // Timer Register - AT91_REG CAN_TIMESTP; // Time Stamp Register - AT91_REG CAN_ECR; // Error Counter Register - AT91_REG CAN_TCR; // Transfer Command Register - AT91_REG CAN_ACR; // Abort Command Register - AT91_REG Reserved0[52]; // - AT91_REG CAN_VR; // Version Register - AT91_REG Reserved1[64]; // - AT91S_CAN_MB CAN_MB0; // CAN Mailbox 0 - AT91S_CAN_MB CAN_MB1; // CAN Mailbox 1 - AT91S_CAN_MB CAN_MB2; // CAN Mailbox 2 - AT91S_CAN_MB CAN_MB3; // CAN Mailbox 3 - AT91S_CAN_MB CAN_MB4; // CAN Mailbox 4 - AT91S_CAN_MB CAN_MB5; // CAN Mailbox 5 - AT91S_CAN_MB CAN_MB6; // CAN Mailbox 6 - AT91S_CAN_MB CAN_MB7; // CAN Mailbox 7 - AT91S_CAN_MB CAN_MB8; // CAN Mailbox 8 - AT91S_CAN_MB CAN_MB9; // CAN Mailbox 9 - AT91S_CAN_MB CAN_MB10; // CAN Mailbox 10 - AT91S_CAN_MB CAN_MB11; // CAN Mailbox 11 - AT91S_CAN_MB CAN_MB12; // CAN Mailbox 12 - AT91S_CAN_MB CAN_MB13; // CAN Mailbox 13 - AT91S_CAN_MB CAN_MB14; // CAN Mailbox 14 - AT91S_CAN_MB CAN_MB15; // CAN Mailbox 15 -} AT91S_CAN, *AT91PS_CAN; - -// -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- -#define AT91C_CAN_CANEN ((unsigned int) 0x1 << 0) // (CAN) CAN Controller Enable -#define AT91C_CAN_LPM ((unsigned int) 0x1 << 1) // (CAN) Disable/Enable Low Power Mode -#define AT91C_CAN_ABM ((unsigned int) 0x1 << 2) // (CAN) Disable/Enable Autobaud/Listen Mode -#define AT91C_CAN_OVL ((unsigned int) 0x1 << 3) // (CAN) Disable/Enable Overload Frame -#define AT91C_CAN_TEOF ((unsigned int) 0x1 << 4) // (CAN) Time Stamp messages at each end of Frame -#define AT91C_CAN_TTM ((unsigned int) 0x1 << 5) // (CAN) Disable/Enable Time Trigger Mode -#define AT91C_CAN_TIMFRZ ((unsigned int) 0x1 << 6) // (CAN) Enable Timer Freeze -#define AT91C_CAN_DRPT ((unsigned int) 0x1 << 7) // (CAN) Disable Repeat -// -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- -#define AT91C_CAN_MB0 ((unsigned int) 0x1 << 0) // (CAN) Mailbox 0 Flag -#define AT91C_CAN_MB1 ((unsigned int) 0x1 << 1) // (CAN) Mailbox 1 Flag -#define AT91C_CAN_MB2 ((unsigned int) 0x1 << 2) // (CAN) Mailbox 2 Flag -#define AT91C_CAN_MB3 ((unsigned int) 0x1 << 3) // (CAN) Mailbox 3 Flag -#define AT91C_CAN_MB4 ((unsigned int) 0x1 << 4) // (CAN) Mailbox 4 Flag -#define AT91C_CAN_MB5 ((unsigned int) 0x1 << 5) // (CAN) Mailbox 5 Flag -#define AT91C_CAN_MB6 ((unsigned int) 0x1 << 6) // (CAN) Mailbox 6 Flag -#define AT91C_CAN_MB7 ((unsigned int) 0x1 << 7) // (CAN) Mailbox 7 Flag -#define AT91C_CAN_MB8 ((unsigned int) 0x1 << 8) // (CAN) Mailbox 8 Flag -#define AT91C_CAN_MB9 ((unsigned int) 0x1 << 9) // (CAN) Mailbox 9 Flag -#define AT91C_CAN_MB10 ((unsigned int) 0x1 << 10) // (CAN) Mailbox 10 Flag -#define AT91C_CAN_MB11 ((unsigned int) 0x1 << 11) // (CAN) Mailbox 11 Flag -#define AT91C_CAN_MB12 ((unsigned int) 0x1 << 12) // (CAN) Mailbox 12 Flag -#define AT91C_CAN_MB13 ((unsigned int) 0x1 << 13) // (CAN) Mailbox 13 Flag -#define AT91C_CAN_MB14 ((unsigned int) 0x1 << 14) // (CAN) Mailbox 14 Flag -#define AT91C_CAN_MB15 ((unsigned int) 0x1 << 15) // (CAN) Mailbox 15 Flag -#define AT91C_CAN_ERRA ((unsigned int) 0x1 << 16) // (CAN) Error Active Mode Flag -#define AT91C_CAN_WARN ((unsigned int) 0x1 << 17) // (CAN) Warning Limit Flag -#define AT91C_CAN_ERRP ((unsigned int) 0x1 << 18) // (CAN) Error Passive Mode Flag -#define AT91C_CAN_BOFF ((unsigned int) 0x1 << 19) // (CAN) Bus Off Mode Flag -#define AT91C_CAN_SLEEP ((unsigned int) 0x1 << 20) // (CAN) Sleep Flag -#define AT91C_CAN_WAKEUP ((unsigned int) 0x1 << 21) // (CAN) Wakeup Flag -#define AT91C_CAN_TOVF ((unsigned int) 0x1 << 22) // (CAN) Timer Overflow Flag -#define AT91C_CAN_TSTP ((unsigned int) 0x1 << 23) // (CAN) Timestamp Flag -#define AT91C_CAN_CERR ((unsigned int) 0x1 << 24) // (CAN) CRC Error -#define AT91C_CAN_SERR ((unsigned int) 0x1 << 25) // (CAN) Stuffing Error -#define AT91C_CAN_AERR ((unsigned int) 0x1 << 26) // (CAN) Acknowledgment Error -#define AT91C_CAN_FERR ((unsigned int) 0x1 << 27) // (CAN) Form Error -#define AT91C_CAN_BERR ((unsigned int) 0x1 << 28) // (CAN) Bit Error -// -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- -// -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- -// -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- -#define AT91C_CAN_RBSY ((unsigned int) 0x1 << 29) // (CAN) Receiver Busy -#define AT91C_CAN_TBSY ((unsigned int) 0x1 << 30) // (CAN) Transmitter Busy -#define AT91C_CAN_OVLY ((unsigned int) 0x1 << 31) // (CAN) Overload Busy -// -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- -#define AT91C_CAN_PHASE2 ((unsigned int) 0x7 << 0) // (CAN) Phase 2 segment -#define AT91C_CAN_PHASE1 ((unsigned int) 0x7 << 4) // (CAN) Phase 1 segment -#define AT91C_CAN_PROPAG ((unsigned int) 0x7 << 8) // (CAN) Programmation time segment -#define AT91C_CAN_SYNC ((unsigned int) 0x3 << 12) // (CAN) Re-synchronization jump width segment -#define AT91C_CAN_BRP ((unsigned int) 0x7F << 16) // (CAN) Baudrate Prescaler -#define AT91C_CAN_SMP ((unsigned int) 0x1 << 24) // (CAN) Sampling mode -// -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- -#define AT91C_CAN_TIMER ((unsigned int) 0xFFFF << 0) // (CAN) Timer field -// -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- -// -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- -#define AT91C_CAN_REC ((unsigned int) 0xFF << 0) // (CAN) Receive Error Counter -#define AT91C_CAN_TEC ((unsigned int) 0xFF << 16) // (CAN) Transmit Error Counter -// -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- -#define AT91C_CAN_TIMRST ((unsigned int) 0x1 << 31) // (CAN) Timer Reset Field -// -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 -// ***************************************************************************** -typedef struct _AT91S_EMAC { - AT91_REG EMAC_NCR; // Network Control Register - AT91_REG EMAC_NCFGR; // Network Configuration Register - AT91_REG EMAC_NSR; // Network Status Register - AT91_REG Reserved0[2]; // - AT91_REG EMAC_TSR; // Transmit Status Register - AT91_REG EMAC_RBQP; // Receive Buffer Queue Pointer - AT91_REG EMAC_TBQP; // Transmit Buffer Queue Pointer - AT91_REG EMAC_RSR; // Receive Status Register - AT91_REG EMAC_ISR; // Interrupt Status Register - AT91_REG EMAC_IER; // Interrupt Enable Register - AT91_REG EMAC_IDR; // Interrupt Disable Register - AT91_REG EMAC_IMR; // Interrupt Mask Register - AT91_REG EMAC_MAN; // PHY Maintenance Register - AT91_REG EMAC_PTR; // Pause Time Register - AT91_REG EMAC_PFR; // Pause Frames received Register - AT91_REG EMAC_FTO; // Frames Transmitted OK Register - AT91_REG EMAC_SCF; // Single Collision Frame Register - AT91_REG EMAC_MCF; // Multiple Collision Frame Register - AT91_REG EMAC_FRO; // Frames Received OK Register - AT91_REG EMAC_FCSE; // Frame Check Sequence Error Register - AT91_REG EMAC_ALE; // Alignment Error Register - AT91_REG EMAC_DTF; // Deferred Transmission Frame Register - AT91_REG EMAC_LCOL; // Late Collision Register - AT91_REG EMAC_ECOL; // Excessive Collision Register - AT91_REG EMAC_TUND; // Transmit Underrun Error Register - AT91_REG EMAC_CSE; // Carrier Sense Error Register - AT91_REG EMAC_RRE; // Receive Ressource Error Register - AT91_REG EMAC_ROV; // Receive Overrun Errors Register - AT91_REG EMAC_RSE; // Receive Symbol Errors Register - AT91_REG EMAC_ELE; // Excessive Length Errors Register - AT91_REG EMAC_RJA; // Receive Jabbers Register - AT91_REG EMAC_USF; // Undersize Frames Register - AT91_REG EMAC_STE; // SQE Test Error Register - AT91_REG EMAC_RLE; // Receive Length Field Mismatch Register - AT91_REG EMAC_TPF; // Transmitted Pause Frames Register - AT91_REG EMAC_HRB; // Hash Address Bottom[31:0] - AT91_REG EMAC_HRT; // Hash Address Top[63:32] - AT91_REG EMAC_SA1L; // Specific Address 1 Bottom, First 4 bytes - AT91_REG EMAC_SA1H; // Specific Address 1 Top, Last 2 bytes - AT91_REG EMAC_SA2L; // Specific Address 2 Bottom, First 4 bytes - AT91_REG EMAC_SA2H; // Specific Address 2 Top, Last 2 bytes - AT91_REG EMAC_SA3L; // Specific Address 3 Bottom, First 4 bytes - AT91_REG EMAC_SA3H; // Specific Address 3 Top, Last 2 bytes - AT91_REG EMAC_SA4L; // Specific Address 4 Bottom, First 4 bytes - AT91_REG EMAC_SA4H; // Specific Address 4 Top, Last 2 bytes - AT91_REG EMAC_TID; // Type ID Checking Register - AT91_REG EMAC_TPQ; // Transmit Pause Quantum Register - AT91_REG EMAC_USRIO; // USER Input/Output Register - AT91_REG EMAC_WOL; // Wake On LAN Register - AT91_REG Reserved1[13]; // - AT91_REG EMAC_REV; // Revision Register -} AT91S_EMAC, *AT91PS_EMAC; - -// -------- EMAC_NCR : (EMAC Offset: 0x0) -------- -#define AT91C_EMAC_LB ((unsigned int) 0x1 << 0) // (EMAC) Loopback. Optional. When set, loopback signal is at high level. -#define AT91C_EMAC_LLB ((unsigned int) 0x1 << 1) // (EMAC) Loopback local. -#define AT91C_EMAC_RE ((unsigned int) 0x1 << 2) // (EMAC) Receive enable. -#define AT91C_EMAC_TE ((unsigned int) 0x1 << 3) // (EMAC) Transmit enable. -#define AT91C_EMAC_MPE ((unsigned int) 0x1 << 4) // (EMAC) Management port enable. -#define AT91C_EMAC_CLRSTAT ((unsigned int) 0x1 << 5) // (EMAC) Clear statistics registers. -#define AT91C_EMAC_INCSTAT ((unsigned int) 0x1 << 6) // (EMAC) Increment statistics registers. -#define AT91C_EMAC_WESTAT ((unsigned int) 0x1 << 7) // (EMAC) Write enable for statistics registers. -#define AT91C_EMAC_BP ((unsigned int) 0x1 << 8) // (EMAC) Back pressure. -#define AT91C_EMAC_TSTART ((unsigned int) 0x1 << 9) // (EMAC) Start Transmission. -#define AT91C_EMAC_THALT ((unsigned int) 0x1 << 10) // (EMAC) Transmission Halt. -#define AT91C_EMAC_TPFR ((unsigned int) 0x1 << 11) // (EMAC) Transmit pause frame -#define AT91C_EMAC_TZQ ((unsigned int) 0x1 << 12) // (EMAC) Transmit zero quantum pause frame -// -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- -#define AT91C_EMAC_SPD ((unsigned int) 0x1 << 0) // (EMAC) Speed. -#define AT91C_EMAC_FD ((unsigned int) 0x1 << 1) // (EMAC) Full duplex. -#define AT91C_EMAC_JFRAME ((unsigned int) 0x1 << 3) // (EMAC) Jumbo Frames. -#define AT91C_EMAC_CAF ((unsigned int) 0x1 << 4) // (EMAC) Copy all frames. -#define AT91C_EMAC_NBC ((unsigned int) 0x1 << 5) // (EMAC) No broadcast. -#define AT91C_EMAC_MTI ((unsigned int) 0x1 << 6) // (EMAC) Multicast hash event enable -#define AT91C_EMAC_UNI ((unsigned int) 0x1 << 7) // (EMAC) Unicast hash enable. -#define AT91C_EMAC_BIG ((unsigned int) 0x1 << 8) // (EMAC) Receive 1522 bytes. -#define AT91C_EMAC_EAE ((unsigned int) 0x1 << 9) // (EMAC) External address match enable. -#define AT91C_EMAC_CLK ((unsigned int) 0x3 << 10) // (EMAC) -#define AT91C_EMAC_CLK_HCLK_8 ((unsigned int) 0x0 << 10) // (EMAC) HCLK divided by 8 -#define AT91C_EMAC_CLK_HCLK_16 ((unsigned int) 0x1 << 10) // (EMAC) HCLK divided by 16 -#define AT91C_EMAC_CLK_HCLK_32 ((unsigned int) 0x2 << 10) // (EMAC) HCLK divided by 32 -#define AT91C_EMAC_CLK_HCLK_64 ((unsigned int) 0x3 << 10) // (EMAC) HCLK divided by 64 -#define AT91C_EMAC_RTY ((unsigned int) 0x1 << 12) // (EMAC) -#define AT91C_EMAC_PAE ((unsigned int) 0x1 << 13) // (EMAC) -#define AT91C_EMAC_RBOF ((unsigned int) 0x3 << 14) // (EMAC) -#define AT91C_EMAC_RBOF_OFFSET_0 ((unsigned int) 0x0 << 14) // (EMAC) no offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_1 ((unsigned int) 0x1 << 14) // (EMAC) one byte offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_2 ((unsigned int) 0x2 << 14) // (EMAC) two bytes offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_3 ((unsigned int) 0x3 << 14) // (EMAC) three bytes offset from start of receive buffer -#define AT91C_EMAC_RLCE ((unsigned int) 0x1 << 16) // (EMAC) Receive Length field Checking Enable -#define AT91C_EMAC_DRFCS ((unsigned int) 0x1 << 17) // (EMAC) Discard Receive FCS -#define AT91C_EMAC_EFRHD ((unsigned int) 0x1 << 18) // (EMAC) -#define AT91C_EMAC_IRXFCS ((unsigned int) 0x1 << 19) // (EMAC) Ignore RX FCS -// -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- -#define AT91C_EMAC_LINKR ((unsigned int) 0x1 << 0) // (EMAC) -#define AT91C_EMAC_MDIO ((unsigned int) 0x1 << 1) // (EMAC) -#define AT91C_EMAC_IDLE ((unsigned int) 0x1 << 2) // (EMAC) -// -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- -#define AT91C_EMAC_UBR ((unsigned int) 0x1 << 0) // (EMAC) -#define AT91C_EMAC_COL ((unsigned int) 0x1 << 1) // (EMAC) -#define AT91C_EMAC_RLES ((unsigned int) 0x1 << 2) // (EMAC) -#define AT91C_EMAC_TGO ((unsigned int) 0x1 << 3) // (EMAC) Transmit Go -#define AT91C_EMAC_BEX ((unsigned int) 0x1 << 4) // (EMAC) Buffers exhausted mid frame -#define AT91C_EMAC_COMP ((unsigned int) 0x1 << 5) // (EMAC) -#define AT91C_EMAC_UND ((unsigned int) 0x1 << 6) // (EMAC) -// -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- -#define AT91C_EMAC_BNA ((unsigned int) 0x1 << 0) // (EMAC) -#define AT91C_EMAC_REC ((unsigned int) 0x1 << 1) // (EMAC) -#define AT91C_EMAC_OVR ((unsigned int) 0x1 << 2) // (EMAC) -// -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- -#define AT91C_EMAC_MFD ((unsigned int) 0x1 << 0) // (EMAC) -#define AT91C_EMAC_RCOMP ((unsigned int) 0x1 << 1) // (EMAC) -#define AT91C_EMAC_RXUBR ((unsigned int) 0x1 << 2) // (EMAC) -#define AT91C_EMAC_TXUBR ((unsigned int) 0x1 << 3) // (EMAC) -#define AT91C_EMAC_TUNDR ((unsigned int) 0x1 << 4) // (EMAC) -#define AT91C_EMAC_RLEX ((unsigned int) 0x1 << 5) // (EMAC) -#define AT91C_EMAC_TXERR ((unsigned int) 0x1 << 6) // (EMAC) -#define AT91C_EMAC_TCOMP ((unsigned int) 0x1 << 7) // (EMAC) -#define AT91C_EMAC_LINK ((unsigned int) 0x1 << 9) // (EMAC) -#define AT91C_EMAC_ROVR ((unsigned int) 0x1 << 10) // (EMAC) -#define AT91C_EMAC_HRESP ((unsigned int) 0x1 << 11) // (EMAC) -#define AT91C_EMAC_PFRE ((unsigned int) 0x1 << 12) // (EMAC) -#define AT91C_EMAC_PTZ ((unsigned int) 0x1 << 13) // (EMAC) -// -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- -// -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- -// -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- -// -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- -#define AT91C_EMAC_DATA ((unsigned int) 0xFFFF << 0) // (EMAC) -#define AT91C_EMAC_CODE ((unsigned int) 0x3 << 16) // (EMAC) -#define AT91C_EMAC_REGA ((unsigned int) 0x1F << 18) // (EMAC) -#define AT91C_EMAC_PHYA ((unsigned int) 0x1F << 23) // (EMAC) -#define AT91C_EMAC_RW ((unsigned int) 0x3 << 28) // (EMAC) -#define AT91C_EMAC_SOF ((unsigned int) 0x3 << 30) // (EMAC) -// -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- -#define AT91C_EMAC_RMII ((unsigned int) 0x1 << 0) // (EMAC) Reduce MII -#define AT91C_EMAC_CLKEN ((unsigned int) 0x1 << 1) // (EMAC) Clock Enable -// -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- -#define AT91C_EMAC_IP ((unsigned int) 0xFFFF << 0) // (EMAC) ARP request IP address -#define AT91C_EMAC_MAG ((unsigned int) 0x1 << 16) // (EMAC) Magic packet event enable -#define AT91C_EMAC_ARP ((unsigned int) 0x1 << 17) // (EMAC) ARP request event enable -#define AT91C_EMAC_SA1 ((unsigned int) 0x1 << 18) // (EMAC) Specific address register 1 event enable -// -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- -#define AT91C_EMAC_REVREF ((unsigned int) 0xFFFF << 0) // (EMAC) -#define AT91C_EMAC_PARTREF ((unsigned int) 0xFFFF << 16) // (EMAC) - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Analog to Digital Convertor -// ***************************************************************************** -typedef struct _AT91S_ADC { - AT91_REG ADC_CR; // ADC Control Register - AT91_REG ADC_MR; // ADC Mode Register - AT91_REG Reserved0[2]; // - AT91_REG ADC_CHER; // ADC Channel Enable Register - AT91_REG ADC_CHDR; // ADC Channel Disable Register - AT91_REG ADC_CHSR; // ADC Channel Status Register - AT91_REG ADC_SR; // ADC Status Register - AT91_REG ADC_LCDR; // ADC Last Converted Data Register - AT91_REG ADC_IER; // ADC Interrupt Enable Register - AT91_REG ADC_IDR; // ADC Interrupt Disable Register - AT91_REG ADC_IMR; // ADC Interrupt Mask Register - AT91_REG ADC_CDR0; // ADC Channel Data Register 0 - AT91_REG ADC_CDR1; // ADC Channel Data Register 1 - AT91_REG ADC_CDR2; // ADC Channel Data Register 2 - AT91_REG ADC_CDR3; // ADC Channel Data Register 3 - AT91_REG ADC_CDR4; // ADC Channel Data Register 4 - AT91_REG ADC_CDR5; // ADC Channel Data Register 5 - AT91_REG ADC_CDR6; // ADC Channel Data Register 6 - AT91_REG ADC_CDR7; // ADC Channel Data Register 7 - AT91_REG Reserved1[44]; // - AT91_REG ADC_RPR; // Receive Pointer Register - AT91_REG ADC_RCR; // Receive Counter Register - AT91_REG ADC_TPR; // Transmit Pointer Register - AT91_REG ADC_TCR; // Transmit Counter Register - AT91_REG ADC_RNPR; // Receive Next Pointer Register - AT91_REG ADC_RNCR; // Receive Next Counter Register - AT91_REG ADC_TNPR; // Transmit Next Pointer Register - AT91_REG ADC_TNCR; // Transmit Next Counter Register - AT91_REG ADC_PTCR; // PDC Transfer Control Register - AT91_REG ADC_PTSR; // PDC Transfer Status Register -} AT91S_ADC, *AT91PS_ADC; - -// -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- -#define AT91C_ADC_SWRST ((unsigned int) 0x1 << 0) // (ADC) Software Reset -#define AT91C_ADC_START ((unsigned int) 0x1 << 1) // (ADC) Start Conversion -// -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- -#define AT91C_ADC_TRGEN ((unsigned int) 0x1 << 0) // (ADC) Trigger Enable -#define AT91C_ADC_TRGEN_DIS ((unsigned int) 0x0) // (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software -#define AT91C_ADC_TRGEN_EN ((unsigned int) 0x1) // (ADC) Hardware trigger selected by TRGSEL field is enabled. -#define AT91C_ADC_TRGSEL ((unsigned int) 0x7 << 1) // (ADC) Trigger Selection -#define AT91C_ADC_TRGSEL_TIOA0 ((unsigned int) 0x0 << 1) // (ADC) Selected TRGSEL = TIAO0 -#define AT91C_ADC_TRGSEL_TIOA1 ((unsigned int) 0x1 << 1) // (ADC) Selected TRGSEL = TIAO1 -#define AT91C_ADC_TRGSEL_TIOA2 ((unsigned int) 0x2 << 1) // (ADC) Selected TRGSEL = TIAO2 -#define AT91C_ADC_TRGSEL_TIOA3 ((unsigned int) 0x3 << 1) // (ADC) Selected TRGSEL = TIAO3 -#define AT91C_ADC_TRGSEL_TIOA4 ((unsigned int) 0x4 << 1) // (ADC) Selected TRGSEL = TIAO4 -#define AT91C_ADC_TRGSEL_TIOA5 ((unsigned int) 0x5 << 1) // (ADC) Selected TRGSEL = TIAO5 -#define AT91C_ADC_TRGSEL_EXT ((unsigned int) 0x6 << 1) // (ADC) Selected TRGSEL = External Trigger -#define AT91C_ADC_LOWRES ((unsigned int) 0x1 << 4) // (ADC) Resolution. -#define AT91C_ADC_LOWRES_10_BIT ((unsigned int) 0x0 << 4) // (ADC) 10-bit resolution -#define AT91C_ADC_LOWRES_8_BIT ((unsigned int) 0x1 << 4) // (ADC) 8-bit resolution -#define AT91C_ADC_SLEEP ((unsigned int) 0x1 << 5) // (ADC) Sleep Mode -#define AT91C_ADC_SLEEP_NORMAL_MODE ((unsigned int) 0x0 << 5) // (ADC) Normal Mode -#define AT91C_ADC_SLEEP_MODE ((unsigned int) 0x1 << 5) // (ADC) Sleep Mode -#define AT91C_ADC_PRESCAL ((unsigned int) 0x3F << 8) // (ADC) Prescaler rate selection -#define AT91C_ADC_STARTUP ((unsigned int) 0x1F << 16) // (ADC) Startup Time -#define AT91C_ADC_SHTIM ((unsigned int) 0xF << 24) // (ADC) Sample & Hold Time -// -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- -#define AT91C_ADC_CH0 ((unsigned int) 0x1 << 0) // (ADC) Channel 0 -#define AT91C_ADC_CH1 ((unsigned int) 0x1 << 1) // (ADC) Channel 1 -#define AT91C_ADC_CH2 ((unsigned int) 0x1 << 2) // (ADC) Channel 2 -#define AT91C_ADC_CH3 ((unsigned int) 0x1 << 3) // (ADC) Channel 3 -#define AT91C_ADC_CH4 ((unsigned int) 0x1 << 4) // (ADC) Channel 4 -#define AT91C_ADC_CH5 ((unsigned int) 0x1 << 5) // (ADC) Channel 5 -#define AT91C_ADC_CH6 ((unsigned int) 0x1 << 6) // (ADC) Channel 6 -#define AT91C_ADC_CH7 ((unsigned int) 0x1 << 7) // (ADC) Channel 7 -// -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- -// -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- -// -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- -#define AT91C_ADC_EOC0 ((unsigned int) 0x1 << 0) // (ADC) End of Conversion -#define AT91C_ADC_EOC1 ((unsigned int) 0x1 << 1) // (ADC) End of Conversion -#define AT91C_ADC_EOC2 ((unsigned int) 0x1 << 2) // (ADC) End of Conversion -#define AT91C_ADC_EOC3 ((unsigned int) 0x1 << 3) // (ADC) End of Conversion -#define AT91C_ADC_EOC4 ((unsigned int) 0x1 << 4) // (ADC) End of Conversion -#define AT91C_ADC_EOC5 ((unsigned int) 0x1 << 5) // (ADC) End of Conversion -#define AT91C_ADC_EOC6 ((unsigned int) 0x1 << 6) // (ADC) End of Conversion -#define AT91C_ADC_EOC7 ((unsigned int) 0x1 << 7) // (ADC) End of Conversion -#define AT91C_ADC_OVRE0 ((unsigned int) 0x1 << 8) // (ADC) Overrun Error -#define AT91C_ADC_OVRE1 ((unsigned int) 0x1 << 9) // (ADC) Overrun Error -#define AT91C_ADC_OVRE2 ((unsigned int) 0x1 << 10) // (ADC) Overrun Error -#define AT91C_ADC_OVRE3 ((unsigned int) 0x1 << 11) // (ADC) Overrun Error -#define AT91C_ADC_OVRE4 ((unsigned int) 0x1 << 12) // (ADC) Overrun Error -#define AT91C_ADC_OVRE5 ((unsigned int) 0x1 << 13) // (ADC) Overrun Error -#define AT91C_ADC_OVRE6 ((unsigned int) 0x1 << 14) // (ADC) Overrun Error -#define AT91C_ADC_OVRE7 ((unsigned int) 0x1 << 15) // (ADC) Overrun Error -#define AT91C_ADC_DRDY ((unsigned int) 0x1 << 16) // (ADC) Data Ready -#define AT91C_ADC_GOVRE ((unsigned int) 0x1 << 17) // (ADC) General Overrun -#define AT91C_ADC_ENDRX ((unsigned int) 0x1 << 18) // (ADC) End of Receiver Transfer -#define AT91C_ADC_RXBUFF ((unsigned int) 0x1 << 19) // (ADC) RXBUFF Interrupt -// -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- -#define AT91C_ADC_LDATA ((unsigned int) 0x3FF << 0) // (ADC) Last Data Converted -// -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- -// -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- -// -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- -// -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- -#define AT91C_ADC_DATA ((unsigned int) 0x3FF << 0) // (ADC) Converted Data -// -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- -// -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- -// -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- -// -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- -// -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- -// -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- -// -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- - -// ***************************************************************************** -// REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 -// ***************************************************************************** -// ========== Register definition for SYS peripheral ========== -// ========== Register definition for AIC peripheral ========== -#define AT91C_AIC_IVR ((AT91_REG *) 0xFFFFF100) // (AIC) IRQ Vector Register -#define AT91C_AIC_SMR ((AT91_REG *) 0xFFFFF000) // (AIC) Source Mode Register -#define AT91C_AIC_FVR ((AT91_REG *) 0xFFFFF104) // (AIC) FIQ Vector Register -#define AT91C_AIC_DCR ((AT91_REG *) 0xFFFFF138) // (AIC) Debug Control Register (Protect) -#define AT91C_AIC_EOICR ((AT91_REG *) 0xFFFFF130) // (AIC) End of Interrupt Command Register -#define AT91C_AIC_SVR ((AT91_REG *) 0xFFFFF080) // (AIC) Source Vector Register -#define AT91C_AIC_FFSR ((AT91_REG *) 0xFFFFF148) // (AIC) Fast Forcing Status Register -#define AT91C_AIC_ICCR ((AT91_REG *) 0xFFFFF128) // (AIC) Interrupt Clear Command Register -#define AT91C_AIC_ISR ((AT91_REG *) 0xFFFFF108) // (AIC) Interrupt Status Register -#define AT91C_AIC_IMR ((AT91_REG *) 0xFFFFF110) // (AIC) Interrupt Mask Register -#define AT91C_AIC_IPR ((AT91_REG *) 0xFFFFF10C) // (AIC) Interrupt Pending Register -#define AT91C_AIC_FFER ((AT91_REG *) 0xFFFFF140) // (AIC) Fast Forcing Enable Register -#define AT91C_AIC_IECR ((AT91_REG *) 0xFFFFF120) // (AIC) Interrupt Enable Command Register -#define AT91C_AIC_ISCR ((AT91_REG *) 0xFFFFF12C) // (AIC) Interrupt Set Command Register -#define AT91C_AIC_FFDR ((AT91_REG *) 0xFFFFF144) // (AIC) Fast Forcing Disable Register -#define AT91C_AIC_CISR ((AT91_REG *) 0xFFFFF114) // (AIC) Core Interrupt Status Register -#define AT91C_AIC_IDCR ((AT91_REG *) 0xFFFFF124) // (AIC) Interrupt Disable Command Register -#define AT91C_AIC_SPU ((AT91_REG *) 0xFFFFF134) // (AIC) Spurious Vector Register -// ========== Register definition for PDC_DBGU peripheral ========== -#define AT91C_DBGU_TCR ((AT91_REG *) 0xFFFFF30C) // (PDC_DBGU) Transmit Counter Register -#define AT91C_DBGU_RNPR ((AT91_REG *) 0xFFFFF310) // (PDC_DBGU) Receive Next Pointer Register -#define AT91C_DBGU_TNPR ((AT91_REG *) 0xFFFFF318) // (PDC_DBGU) Transmit Next Pointer Register -#define AT91C_DBGU_TPR ((AT91_REG *) 0xFFFFF308) // (PDC_DBGU) Transmit Pointer Register -#define AT91C_DBGU_RPR ((AT91_REG *) 0xFFFFF300) // (PDC_DBGU) Receive Pointer Register -#define AT91C_DBGU_RCR ((AT91_REG *) 0xFFFFF304) // (PDC_DBGU) Receive Counter Register -#define AT91C_DBGU_RNCR ((AT91_REG *) 0xFFFFF314) // (PDC_DBGU) Receive Next Counter Register -#define AT91C_DBGU_PTCR ((AT91_REG *) 0xFFFFF320) // (PDC_DBGU) PDC Transfer Control Register -#define AT91C_DBGU_PTSR ((AT91_REG *) 0xFFFFF324) // (PDC_DBGU) PDC Transfer Status Register -#define AT91C_DBGU_TNCR ((AT91_REG *) 0xFFFFF31C) // (PDC_DBGU) Transmit Next Counter Register -// ========== Register definition for DBGU peripheral ========== -#define AT91C_DBGU_EXID ((AT91_REG *) 0xFFFFF244) // (DBGU) Chip ID Extension Register -#define AT91C_DBGU_BRGR ((AT91_REG *) 0xFFFFF220) // (DBGU) Baud Rate Generator Register -#define AT91C_DBGU_IDR ((AT91_REG *) 0xFFFFF20C) // (DBGU) Interrupt Disable Register -#define AT91C_DBGU_CSR ((AT91_REG *) 0xFFFFF214) // (DBGU) Channel Status Register -#define AT91C_DBGU_CIDR ((AT91_REG *) 0xFFFFF240) // (DBGU) Chip ID Register -#define AT91C_DBGU_MR ((AT91_REG *) 0xFFFFF204) // (DBGU) Mode Register -#define AT91C_DBGU_IMR ((AT91_REG *) 0xFFFFF210) // (DBGU) Interrupt Mask Register -#define AT91C_DBGU_CR ((AT91_REG *) 0xFFFFF200) // (DBGU) Control Register -#define AT91C_DBGU_FNTR ((AT91_REG *) 0xFFFFF248) // (DBGU) Force NTRST Register -#define AT91C_DBGU_THR ((AT91_REG *) 0xFFFFF21C) // (DBGU) Transmitter Holding Register -#define AT91C_DBGU_RHR ((AT91_REG *) 0xFFFFF218) // (DBGU) Receiver Holding Register -#define AT91C_DBGU_IER ((AT91_REG *) 0xFFFFF208) // (DBGU) Interrupt Enable Register -// ========== Register definition for PIOA peripheral ========== -#define AT91C_PIOA_ODR ((AT91_REG *) 0xFFFFF414) // (PIOA) Output Disable Registerr -#define AT91C_PIOA_SODR ((AT91_REG *) 0xFFFFF430) // (PIOA) Set Output Data Register -#define AT91C_PIOA_ISR ((AT91_REG *) 0xFFFFF44C) // (PIOA) Interrupt Status Register -#define AT91C_PIOA_ABSR ((AT91_REG *) 0xFFFFF478) // (PIOA) AB Select Status Register -#define AT91C_PIOA_IER ((AT91_REG *) 0xFFFFF440) // (PIOA) Interrupt Enable Register -#define AT91C_PIOA_PPUDR ((AT91_REG *) 0xFFFFF460) // (PIOA) Pull-up Disable Register -#define AT91C_PIOA_IMR ((AT91_REG *) 0xFFFFF448) // (PIOA) Interrupt Mask Register -#define AT91C_PIOA_PER ((AT91_REG *) 0xFFFFF400) // (PIOA) PIO Enable Register -#define AT91C_PIOA_IFDR ((AT91_REG *) 0xFFFFF424) // (PIOA) Input Filter Disable Register -#define AT91C_PIOA_OWDR ((AT91_REG *) 0xFFFFF4A4) // (PIOA) Output Write Disable Register -#define AT91C_PIOA_MDSR ((AT91_REG *) 0xFFFFF458) // (PIOA) Multi-driver Status Register -#define AT91C_PIOA_IDR ((AT91_REG *) 0xFFFFF444) // (PIOA) Interrupt Disable Register -#define AT91C_PIOA_ODSR ((AT91_REG *) 0xFFFFF438) // (PIOA) Output Data Status Register -#define AT91C_PIOA_PPUSR ((AT91_REG *) 0xFFFFF468) // (PIOA) Pull-up Status Register -#define AT91C_PIOA_OWSR ((AT91_REG *) 0xFFFFF4A8) // (PIOA) Output Write Status Register -#define AT91C_PIOA_BSR ((AT91_REG *) 0xFFFFF474) // (PIOA) Select B Register -#define AT91C_PIOA_OWER ((AT91_REG *) 0xFFFFF4A0) // (PIOA) Output Write Enable Register -#define AT91C_PIOA_IFER ((AT91_REG *) 0xFFFFF420) // (PIOA) Input Filter Enable Register -#define AT91C_PIOA_PDSR ((AT91_REG *) 0xFFFFF43C) // (PIOA) Pin Data Status Register -#define AT91C_PIOA_PPUER ((AT91_REG *) 0xFFFFF464) // (PIOA) Pull-up Enable Register -#define AT91C_PIOA_OSR ((AT91_REG *) 0xFFFFF418) // (PIOA) Output Status Register -#define AT91C_PIOA_ASR ((AT91_REG *) 0xFFFFF470) // (PIOA) Select A Register -#define AT91C_PIOA_MDDR ((AT91_REG *) 0xFFFFF454) // (PIOA) Multi-driver Disable Register -#define AT91C_PIOA_CODR ((AT91_REG *) 0xFFFFF434) // (PIOA) Clear Output Data Register -#define AT91C_PIOA_MDER ((AT91_REG *) 0xFFFFF450) // (PIOA) Multi-driver Enable Register -#define AT91C_PIOA_PDR ((AT91_REG *) 0xFFFFF404) // (PIOA) PIO Disable Register -#define AT91C_PIOA_IFSR ((AT91_REG *) 0xFFFFF428) // (PIOA) Input Filter Status Register -#define AT91C_PIOA_OER ((AT91_REG *) 0xFFFFF410) // (PIOA) Output Enable Register -#define AT91C_PIOA_PSR ((AT91_REG *) 0xFFFFF408) // (PIOA) PIO Status Register -// ========== Register definition for PIOB peripheral ========== -#define AT91C_PIOB_OWDR ((AT91_REG *) 0xFFFFF6A4) // (PIOB) Output Write Disable Register -#define AT91C_PIOB_MDER ((AT91_REG *) 0xFFFFF650) // (PIOB) Multi-driver Enable Register -#define AT91C_PIOB_PPUSR ((AT91_REG *) 0xFFFFF668) // (PIOB) Pull-up Status Register -#define AT91C_PIOB_IMR ((AT91_REG *) 0xFFFFF648) // (PIOB) Interrupt Mask Register -#define AT91C_PIOB_ASR ((AT91_REG *) 0xFFFFF670) // (PIOB) Select A Register -#define AT91C_PIOB_PPUDR ((AT91_REG *) 0xFFFFF660) // (PIOB) Pull-up Disable Register -#define AT91C_PIOB_PSR ((AT91_REG *) 0xFFFFF608) // (PIOB) PIO Status Register -#define AT91C_PIOB_IER ((AT91_REG *) 0xFFFFF640) // (PIOB) Interrupt Enable Register -#define AT91C_PIOB_CODR ((AT91_REG *) 0xFFFFF634) // (PIOB) Clear Output Data Register -#define AT91C_PIOB_OWER ((AT91_REG *) 0xFFFFF6A0) // (PIOB) Output Write Enable Register -#define AT91C_PIOB_ABSR ((AT91_REG *) 0xFFFFF678) // (PIOB) AB Select Status Register -#define AT91C_PIOB_IFDR ((AT91_REG *) 0xFFFFF624) // (PIOB) Input Filter Disable Register -#define AT91C_PIOB_PDSR ((AT91_REG *) 0xFFFFF63C) // (PIOB) Pin Data Status Register -#define AT91C_PIOB_IDR ((AT91_REG *) 0xFFFFF644) // (PIOB) Interrupt Disable Register -#define AT91C_PIOB_OWSR ((AT91_REG *) 0xFFFFF6A8) // (PIOB) Output Write Status Register -#define AT91C_PIOB_PDR ((AT91_REG *) 0xFFFFF604) // (PIOB) PIO Disable Register -#define AT91C_PIOB_ODR ((AT91_REG *) 0xFFFFF614) // (PIOB) Output Disable Registerr -#define AT91C_PIOB_IFSR ((AT91_REG *) 0xFFFFF628) // (PIOB) Input Filter Status Register -#define AT91C_PIOB_PPUER ((AT91_REG *) 0xFFFFF664) // (PIOB) Pull-up Enable Register -#define AT91C_PIOB_SODR ((AT91_REG *) 0xFFFFF630) // (PIOB) Set Output Data Register -#define AT91C_PIOB_ISR ((AT91_REG *) 0xFFFFF64C) // (PIOB) Interrupt Status Register -#define AT91C_PIOB_ODSR ((AT91_REG *) 0xFFFFF638) // (PIOB) Output Data Status Register -#define AT91C_PIOB_OSR ((AT91_REG *) 0xFFFFF618) // (PIOB) Output Status Register -#define AT91C_PIOB_MDSR ((AT91_REG *) 0xFFFFF658) // (PIOB) Multi-driver Status Register -#define AT91C_PIOB_IFER ((AT91_REG *) 0xFFFFF620) // (PIOB) Input Filter Enable Register -#define AT91C_PIOB_BSR ((AT91_REG *) 0xFFFFF674) // (PIOB) Select B Register -#define AT91C_PIOB_MDDR ((AT91_REG *) 0xFFFFF654) // (PIOB) Multi-driver Disable Register -#define AT91C_PIOB_OER ((AT91_REG *) 0xFFFFF610) // (PIOB) Output Enable Register -#define AT91C_PIOB_PER ((AT91_REG *) 0xFFFFF600) // (PIOB) PIO Enable Register -// ========== Register definition for CKGR peripheral ========== -#define AT91C_CKGR_MOR ((AT91_REG *) 0xFFFFFC20) // (CKGR) Main Oscillator Register -#define AT91C_CKGR_PLLR ((AT91_REG *) 0xFFFFFC2C) // (CKGR) PLL Register -#define AT91C_CKGR_MCFR ((AT91_REG *) 0xFFFFFC24) // (CKGR) Main Clock Frequency Register -// ========== Register definition for PMC peripheral ========== -#define AT91C_PMC_IDR ((AT91_REG *) 0xFFFFFC64) // (PMC) Interrupt Disable Register -#define AT91C_PMC_MOR ((AT91_REG *) 0xFFFFFC20) // (PMC) Main Oscillator Register -#define AT91C_PMC_PLLR ((AT91_REG *) 0xFFFFFC2C) // (PMC) PLL Register -#define AT91C_PMC_PCER ((AT91_REG *) 0xFFFFFC10) // (PMC) Peripheral Clock Enable Register -#define AT91C_PMC_PCKR ((AT91_REG *) 0xFFFFFC40) // (PMC) Programmable Clock Register -#define AT91C_PMC_MCKR ((AT91_REG *) 0xFFFFFC30) // (PMC) Master Clock Register -#define AT91C_PMC_SCDR ((AT91_REG *) 0xFFFFFC04) // (PMC) System Clock Disable Register -#define AT91C_PMC_PCDR ((AT91_REG *) 0xFFFFFC14) // (PMC) Peripheral Clock Disable Register -#define AT91C_PMC_SCSR ((AT91_REG *) 0xFFFFFC08) // (PMC) System Clock Status Register -#define AT91C_PMC_PCSR ((AT91_REG *) 0xFFFFFC18) // (PMC) Peripheral Clock Status Register -#define AT91C_PMC_MCFR ((AT91_REG *) 0xFFFFFC24) // (PMC) Main Clock Frequency Register -#define AT91C_PMC_SCER ((AT91_REG *) 0xFFFFFC00) // (PMC) System Clock Enable Register -#define AT91C_PMC_IMR ((AT91_REG *) 0xFFFFFC6C) // (PMC) Interrupt Mask Register -#define AT91C_PMC_IER ((AT91_REG *) 0xFFFFFC60) // (PMC) Interrupt Enable Register -#define AT91C_PMC_SR ((AT91_REG *) 0xFFFFFC68) // (PMC) Status Register -// ========== Register definition for RSTC peripheral ========== -#define AT91C_RSTC_RCR ((AT91_REG *) 0xFFFFFD00) // (RSTC) Reset Control Register -#define AT91C_RSTC_RMR ((AT91_REG *) 0xFFFFFD08) // (RSTC) Reset Mode Register -#define AT91C_RSTC_RSR ((AT91_REG *) 0xFFFFFD04) // (RSTC) Reset Status Register -// ========== Register definition for RTTC peripheral ========== -#define AT91C_RTTC_RTSR ((AT91_REG *) 0xFFFFFD2C) // (RTTC) Real-time Status Register -#define AT91C_RTTC_RTMR ((AT91_REG *) 0xFFFFFD20) // (RTTC) Real-time Mode Register -#define AT91C_RTTC_RTVR ((AT91_REG *) 0xFFFFFD28) // (RTTC) Real-time Value Register -#define AT91C_RTTC_RTAR ((AT91_REG *) 0xFFFFFD24) // (RTTC) Real-time Alarm Register -// ========== Register definition for PITC peripheral ========== -#define AT91C_PITC_PIVR ((AT91_REG *) 0xFFFFFD38) // (PITC) Period Interval Value Register -#define AT91C_PITC_PISR ((AT91_REG *) 0xFFFFFD34) // (PITC) Period Interval Status Register -#define AT91C_PITC_PIIR ((AT91_REG *) 0xFFFFFD3C) // (PITC) Period Interval Image Register -#define AT91C_PITC_PIMR ((AT91_REG *) 0xFFFFFD30) // (PITC) Period Interval Mode Register -// ========== Register definition for WDTC peripheral ========== -#define AT91C_WDTC_WDCR ((AT91_REG *) 0xFFFFFD40) // (WDTC) Watchdog Control Register -#define AT91C_WDTC_WDSR ((AT91_REG *) 0xFFFFFD48) // (WDTC) Watchdog Status Register -#define AT91C_WDTC_WDMR ((AT91_REG *) 0xFFFFFD44) // (WDTC) Watchdog Mode Register -// ========== Register definition for VREG peripheral ========== -#define AT91C_VREG_MR ((AT91_REG *) 0xFFFFFD60) // (VREG) Voltage Regulator Mode Register -// ========== Register definition for MC peripheral ========== -#define AT91C_MC_ASR ((AT91_REG *) 0xFFFFFF04) // (MC) MC Abort Status Register -#define AT91C_MC_RCR ((AT91_REG *) 0xFFFFFF00) // (MC) MC Remap Control Register -#define AT91C_MC_FCR ((AT91_REG *) 0xFFFFFF64) // (MC) MC Flash Command Register -#define AT91C_MC_AASR ((AT91_REG *) 0xFFFFFF08) // (MC) MC Abort Address Status Register -#define AT91C_MC_FSR ((AT91_REG *) 0xFFFFFF68) // (MC) MC Flash Status Register -#define AT91C_MC_FMR ((AT91_REG *) 0xFFFFFF60) // (MC) MC Flash Mode Register -// ========== Register definition for PDC_SPI1 peripheral ========== -#define AT91C_SPI1_PTCR ((AT91_REG *) 0xFFFE4120) // (PDC_SPI1) PDC Transfer Control Register -#define AT91C_SPI1_RPR ((AT91_REG *) 0xFFFE4100) // (PDC_SPI1) Receive Pointer Register -#define AT91C_SPI1_TNCR ((AT91_REG *) 0xFFFE411C) // (PDC_SPI1) Transmit Next Counter Register -#define AT91C_SPI1_TPR ((AT91_REG *) 0xFFFE4108) // (PDC_SPI1) Transmit Pointer Register -#define AT91C_SPI1_TNPR ((AT91_REG *) 0xFFFE4118) // (PDC_SPI1) Transmit Next Pointer Register -#define AT91C_SPI1_TCR ((AT91_REG *) 0xFFFE410C) // (PDC_SPI1) Transmit Counter Register -#define AT91C_SPI1_RCR ((AT91_REG *) 0xFFFE4104) // (PDC_SPI1) Receive Counter Register -#define AT91C_SPI1_RNPR ((AT91_REG *) 0xFFFE4110) // (PDC_SPI1) Receive Next Pointer Register -#define AT91C_SPI1_RNCR ((AT91_REG *) 0xFFFE4114) // (PDC_SPI1) Receive Next Counter Register -#define AT91C_SPI1_PTSR ((AT91_REG *) 0xFFFE4124) // (PDC_SPI1) PDC Transfer Status Register -// ========== Register definition for SPI1 peripheral ========== -#define AT91C_SPI1_IMR ((AT91_REG *) 0xFFFE401C) // (SPI1) Interrupt Mask Register -#define AT91C_SPI1_IER ((AT91_REG *) 0xFFFE4014) // (SPI1) Interrupt Enable Register -#define AT91C_SPI1_MR ((AT91_REG *) 0xFFFE4004) // (SPI1) Mode Register -#define AT91C_SPI1_RDR ((AT91_REG *) 0xFFFE4008) // (SPI1) Receive Data Register -#define AT91C_SPI1_IDR ((AT91_REG *) 0xFFFE4018) // (SPI1) Interrupt Disable Register -#define AT91C_SPI1_SR ((AT91_REG *) 0xFFFE4010) // (SPI1) Status Register -#define AT91C_SPI1_TDR ((AT91_REG *) 0xFFFE400C) // (SPI1) Transmit Data Register -#define AT91C_SPI1_CR ((AT91_REG *) 0xFFFE4000) // (SPI1) Control Register -#define AT91C_SPI1_CSR ((AT91_REG *) 0xFFFE4030) // (SPI1) Chip Select Register -// ========== Register definition for PDC_SPI0 peripheral ========== -#define AT91C_SPI0_PTCR ((AT91_REG *) 0xFFFE0120) // (PDC_SPI0) PDC Transfer Control Register -#define AT91C_SPI0_TPR ((AT91_REG *) 0xFFFE0108) // (PDC_SPI0) Transmit Pointer Register -#define AT91C_SPI0_TCR ((AT91_REG *) 0xFFFE010C) // (PDC_SPI0) Transmit Counter Register -#define AT91C_SPI0_RCR ((AT91_REG *) 0xFFFE0104) // (PDC_SPI0) Receive Counter Register -#define AT91C_SPI0_PTSR ((AT91_REG *) 0xFFFE0124) // (PDC_SPI0) PDC Transfer Status Register -#define AT91C_SPI0_RNPR ((AT91_REG *) 0xFFFE0110) // (PDC_SPI0) Receive Next Pointer Register -#define AT91C_SPI0_RPR ((AT91_REG *) 0xFFFE0100) // (PDC_SPI0) Receive Pointer Register -#define AT91C_SPI0_TNCR ((AT91_REG *) 0xFFFE011C) // (PDC_SPI0) Transmit Next Counter Register -#define AT91C_SPI0_RNCR ((AT91_REG *) 0xFFFE0114) // (PDC_SPI0) Receive Next Counter Register -#define AT91C_SPI0_TNPR ((AT91_REG *) 0xFFFE0118) // (PDC_SPI0) Transmit Next Pointer Register -// ========== Register definition for SPI0 peripheral ========== -#define AT91C_SPI0_IER ((AT91_REG *) 0xFFFE0014) // (SPI0) Interrupt Enable Register -#define AT91C_SPI0_SR ((AT91_REG *) 0xFFFE0010) // (SPI0) Status Register -#define AT91C_SPI0_IDR ((AT91_REG *) 0xFFFE0018) // (SPI0) Interrupt Disable Register -#define AT91C_SPI0_CR ((AT91_REG *) 0xFFFE0000) // (SPI0) Control Register -#define AT91C_SPI0_MR ((AT91_REG *) 0xFFFE0004) // (SPI0) Mode Register -#define AT91C_SPI0_IMR ((AT91_REG *) 0xFFFE001C) // (SPI0) Interrupt Mask Register -#define AT91C_SPI0_TDR ((AT91_REG *) 0xFFFE000C) // (SPI0) Transmit Data Register -#define AT91C_SPI0_RDR ((AT91_REG *) 0xFFFE0008) // (SPI0) Receive Data Register -#define AT91C_SPI0_CSR ((AT91_REG *) 0xFFFE0030) // (SPI0) Chip Select Register -// ========== Register definition for PDC_US1 peripheral ========== -#define AT91C_US1_RNCR ((AT91_REG *) 0xFFFC4114) // (PDC_US1) Receive Next Counter Register -#define AT91C_US1_PTCR ((AT91_REG *) 0xFFFC4120) // (PDC_US1) PDC Transfer Control Register -#define AT91C_US1_TCR ((AT91_REG *) 0xFFFC410C) // (PDC_US1) Transmit Counter Register -#define AT91C_US1_PTSR ((AT91_REG *) 0xFFFC4124) // (PDC_US1) PDC Transfer Status Register -#define AT91C_US1_TNPR ((AT91_REG *) 0xFFFC4118) // (PDC_US1) Transmit Next Pointer Register -#define AT91C_US1_RCR ((AT91_REG *) 0xFFFC4104) // (PDC_US1) Receive Counter Register -#define AT91C_US1_RNPR ((AT91_REG *) 0xFFFC4110) // (PDC_US1) Receive Next Pointer Register -#define AT91C_US1_RPR ((AT91_REG *) 0xFFFC4100) // (PDC_US1) Receive Pointer Register -#define AT91C_US1_TNCR ((AT91_REG *) 0xFFFC411C) // (PDC_US1) Transmit Next Counter Register -#define AT91C_US1_TPR ((AT91_REG *) 0xFFFC4108) // (PDC_US1) Transmit Pointer Register -// ========== Register definition for US1 peripheral ========== -#define AT91C_US1_IF ((AT91_REG *) 0xFFFC404C) // (US1) IRDA_FILTER Register -#define AT91C_US1_NER ((AT91_REG *) 0xFFFC4044) // (US1) Nb Errors Register -#define AT91C_US1_RTOR ((AT91_REG *) 0xFFFC4024) // (US1) Receiver Time-out Register -#define AT91C_US1_CSR ((AT91_REG *) 0xFFFC4014) // (US1) Channel Status Register -#define AT91C_US1_IDR ((AT91_REG *) 0xFFFC400C) // (US1) Interrupt Disable Register -#define AT91C_US1_IER ((AT91_REG *) 0xFFFC4008) // (US1) Interrupt Enable Register -#define AT91C_US1_THR ((AT91_REG *) 0xFFFC401C) // (US1) Transmitter Holding Register -#define AT91C_US1_TTGR ((AT91_REG *) 0xFFFC4028) // (US1) Transmitter Time-guard Register -#define AT91C_US1_RHR ((AT91_REG *) 0xFFFC4018) // (US1) Receiver Holding Register -#define AT91C_US1_BRGR ((AT91_REG *) 0xFFFC4020) // (US1) Baud Rate Generator Register -#define AT91C_US1_IMR ((AT91_REG *) 0xFFFC4010) // (US1) Interrupt Mask Register -#define AT91C_US1_FIDI ((AT91_REG *) 0xFFFC4040) // (US1) FI_DI_Ratio Register -#define AT91C_US1_CR ((AT91_REG *) 0xFFFC4000) // (US1) Control Register -#define AT91C_US1_MR ((AT91_REG *) 0xFFFC4004) // (US1) Mode Register -// ========== Register definition for PDC_US0 peripheral ========== -#define AT91C_US0_TNPR ((AT91_REG *) 0xFFFC0118) // (PDC_US0) Transmit Next Pointer Register -#define AT91C_US0_RNPR ((AT91_REG *) 0xFFFC0110) // (PDC_US0) Receive Next Pointer Register -#define AT91C_US0_TCR ((AT91_REG *) 0xFFFC010C) // (PDC_US0) Transmit Counter Register -#define AT91C_US0_PTCR ((AT91_REG *) 0xFFFC0120) // (PDC_US0) PDC Transfer Control Register -#define AT91C_US0_PTSR ((AT91_REG *) 0xFFFC0124) // (PDC_US0) PDC Transfer Status Register -#define AT91C_US0_TNCR ((AT91_REG *) 0xFFFC011C) // (PDC_US0) Transmit Next Counter Register -#define AT91C_US0_TPR ((AT91_REG *) 0xFFFC0108) // (PDC_US0) Transmit Pointer Register -#define AT91C_US0_RCR ((AT91_REG *) 0xFFFC0104) // (PDC_US0) Receive Counter Register -#define AT91C_US0_RPR ((AT91_REG *) 0xFFFC0100) // (PDC_US0) Receive Pointer Register -#define AT91C_US0_RNCR ((AT91_REG *) 0xFFFC0114) // (PDC_US0) Receive Next Counter Register -// ========== Register definition for US0 peripheral ========== -#define AT91C_US0_BRGR ((AT91_REG *) 0xFFFC0020) // (US0) Baud Rate Generator Register -#define AT91C_US0_NER ((AT91_REG *) 0xFFFC0044) // (US0) Nb Errors Register -#define AT91C_US0_CR ((AT91_REG *) 0xFFFC0000) // (US0) Control Register -#define AT91C_US0_IMR ((AT91_REG *) 0xFFFC0010) // (US0) Interrupt Mask Register -#define AT91C_US0_FIDI ((AT91_REG *) 0xFFFC0040) // (US0) FI_DI_Ratio Register -#define AT91C_US0_TTGR ((AT91_REG *) 0xFFFC0028) // (US0) Transmitter Time-guard Register -#define AT91C_US0_MR ((AT91_REG *) 0xFFFC0004) // (US0) Mode Register -#define AT91C_US0_RTOR ((AT91_REG *) 0xFFFC0024) // (US0) Receiver Time-out Register -#define AT91C_US0_CSR ((AT91_REG *) 0xFFFC0014) // (US0) Channel Status Register -#define AT91C_US0_RHR ((AT91_REG *) 0xFFFC0018) // (US0) Receiver Holding Register -#define AT91C_US0_IDR ((AT91_REG *) 0xFFFC000C) // (US0) Interrupt Disable Register -#define AT91C_US0_THR ((AT91_REG *) 0xFFFC001C) // (US0) Transmitter Holding Register -#define AT91C_US0_IF ((AT91_REG *) 0xFFFC004C) // (US0) IRDA_FILTER Register -#define AT91C_US0_IER ((AT91_REG *) 0xFFFC0008) // (US0) Interrupt Enable Register -// ========== Register definition for PDC_SSC peripheral ========== -#define AT91C_SSC_TNCR ((AT91_REG *) 0xFFFD411C) // (PDC_SSC) Transmit Next Counter Register -#define AT91C_SSC_RPR ((AT91_REG *) 0xFFFD4100) // (PDC_SSC) Receive Pointer Register -#define AT91C_SSC_RNCR ((AT91_REG *) 0xFFFD4114) // (PDC_SSC) Receive Next Counter Register -#define AT91C_SSC_TPR ((AT91_REG *) 0xFFFD4108) // (PDC_SSC) Transmit Pointer Register -#define AT91C_SSC_PTCR ((AT91_REG *) 0xFFFD4120) // (PDC_SSC) PDC Transfer Control Register -#define AT91C_SSC_TCR ((AT91_REG *) 0xFFFD410C) // (PDC_SSC) Transmit Counter Register -#define AT91C_SSC_RCR ((AT91_REG *) 0xFFFD4104) // (PDC_SSC) Receive Counter Register -#define AT91C_SSC_RNPR ((AT91_REG *) 0xFFFD4110) // (PDC_SSC) Receive Next Pointer Register -#define AT91C_SSC_TNPR ((AT91_REG *) 0xFFFD4118) // (PDC_SSC) Transmit Next Pointer Register -#define AT91C_SSC_PTSR ((AT91_REG *) 0xFFFD4124) // (PDC_SSC) PDC Transfer Status Register -// ========== Register definition for SSC peripheral ========== -#define AT91C_SSC_RHR ((AT91_REG *) 0xFFFD4020) // (SSC) Receive Holding Register -#define AT91C_SSC_RSHR ((AT91_REG *) 0xFFFD4030) // (SSC) Receive Sync Holding Register -#define AT91C_SSC_TFMR ((AT91_REG *) 0xFFFD401C) // (SSC) Transmit Frame Mode Register -#define AT91C_SSC_IDR ((AT91_REG *) 0xFFFD4048) // (SSC) Interrupt Disable Register -#define AT91C_SSC_THR ((AT91_REG *) 0xFFFD4024) // (SSC) Transmit Holding Register -#define AT91C_SSC_RCMR ((AT91_REG *) 0xFFFD4010) // (SSC) Receive Clock ModeRegister -#define AT91C_SSC_IER ((AT91_REG *) 0xFFFD4044) // (SSC) Interrupt Enable Register -#define AT91C_SSC_TSHR ((AT91_REG *) 0xFFFD4034) // (SSC) Transmit Sync Holding Register -#define AT91C_SSC_SR ((AT91_REG *) 0xFFFD4040) // (SSC) Status Register -#define AT91C_SSC_CMR ((AT91_REG *) 0xFFFD4004) // (SSC) Clock Mode Register -#define AT91C_SSC_TCMR ((AT91_REG *) 0xFFFD4018) // (SSC) Transmit Clock Mode Register -#define AT91C_SSC_CR ((AT91_REG *) 0xFFFD4000) // (SSC) Control Register -#define AT91C_SSC_IMR ((AT91_REG *) 0xFFFD404C) // (SSC) Interrupt Mask Register -#define AT91C_SSC_RFMR ((AT91_REG *) 0xFFFD4014) // (SSC) Receive Frame Mode Register -// ========== Register definition for TWI peripheral ========== -#define AT91C_TWI_IER ((AT91_REG *) 0xFFFB8024) // (TWI) Interrupt Enable Register -#define AT91C_TWI_CR ((AT91_REG *) 0xFFFB8000) // (TWI) Control Register -#define AT91C_TWI_SR ((AT91_REG *) 0xFFFB8020) // (TWI) Status Register -#define AT91C_TWI_IMR ((AT91_REG *) 0xFFFB802C) // (TWI) Interrupt Mask Register -#define AT91C_TWI_THR ((AT91_REG *) 0xFFFB8034) // (TWI) Transmit Holding Register -#define AT91C_TWI_IDR ((AT91_REG *) 0xFFFB8028) // (TWI) Interrupt Disable Register -#define AT91C_TWI_IADR ((AT91_REG *) 0xFFFB800C) // (TWI) Internal Address Register -#define AT91C_TWI_MMR ((AT91_REG *) 0xFFFB8004) // (TWI) Master Mode Register -#define AT91C_TWI_CWGR ((AT91_REG *) 0xFFFB8010) // (TWI) Clock Waveform Generator Register -#define AT91C_TWI_RHR ((AT91_REG *) 0xFFFB8030) // (TWI) Receive Holding Register -// ========== Register definition for PWMC_CH3 peripheral ========== -#define AT91C_PWMC_CH3_CUPDR ((AT91_REG *) 0xFFFCC270) // (PWMC_CH3) Channel Update Register -#define AT91C_PWMC_CH3_Reserved ((AT91_REG *) 0xFFFCC274) // (PWMC_CH3) Reserved -#define AT91C_PWMC_CH3_CPRDR ((AT91_REG *) 0xFFFCC268) // (PWMC_CH3) Channel Period Register -#define AT91C_PWMC_CH3_CDTYR ((AT91_REG *) 0xFFFCC264) // (PWMC_CH3) Channel Duty Cycle Register -#define AT91C_PWMC_CH3_CCNTR ((AT91_REG *) 0xFFFCC26C) // (PWMC_CH3) Channel Counter Register -#define AT91C_PWMC_CH3_CMR ((AT91_REG *) 0xFFFCC260) // (PWMC_CH3) Channel Mode Register -// ========== Register definition for PWMC_CH2 peripheral ========== -#define AT91C_PWMC_CH2_Reserved ((AT91_REG *) 0xFFFCC254) // (PWMC_CH2) Reserved -#define AT91C_PWMC_CH2_CMR ((AT91_REG *) 0xFFFCC240) // (PWMC_CH2) Channel Mode Register -#define AT91C_PWMC_CH2_CCNTR ((AT91_REG *) 0xFFFCC24C) // (PWMC_CH2) Channel Counter Register -#define AT91C_PWMC_CH2_CPRDR ((AT91_REG *) 0xFFFCC248) // (PWMC_CH2) Channel Period Register -#define AT91C_PWMC_CH2_CUPDR ((AT91_REG *) 0xFFFCC250) // (PWMC_CH2) Channel Update Register -#define AT91C_PWMC_CH2_CDTYR ((AT91_REG *) 0xFFFCC244) // (PWMC_CH2) Channel Duty Cycle Register -// ========== Register definition for PWMC_CH1 peripheral ========== -#define AT91C_PWMC_CH1_Reserved ((AT91_REG *) 0xFFFCC234) // (PWMC_CH1) Reserved -#define AT91C_PWMC_CH1_CUPDR ((AT91_REG *) 0xFFFCC230) // (PWMC_CH1) Channel Update Register -#define AT91C_PWMC_CH1_CPRDR ((AT91_REG *) 0xFFFCC228) // (PWMC_CH1) Channel Period Register -#define AT91C_PWMC_CH1_CCNTR ((AT91_REG *) 0xFFFCC22C) // (PWMC_CH1) Channel Counter Register -#define AT91C_PWMC_CH1_CDTYR ((AT91_REG *) 0xFFFCC224) // (PWMC_CH1) Channel Duty Cycle Register -#define AT91C_PWMC_CH1_CMR ((AT91_REG *) 0xFFFCC220) // (PWMC_CH1) Channel Mode Register -// ========== Register definition for PWMC_CH0 peripheral ========== -#define AT91C_PWMC_CH0_Reserved ((AT91_REG *) 0xFFFCC214) // (PWMC_CH0) Reserved -#define AT91C_PWMC_CH0_CPRDR ((AT91_REG *) 0xFFFCC208) // (PWMC_CH0) Channel Period Register -#define AT91C_PWMC_CH0_CDTYR ((AT91_REG *) 0xFFFCC204) // (PWMC_CH0) Channel Duty Cycle Register -#define AT91C_PWMC_CH0_CMR ((AT91_REG *) 0xFFFCC200) // (PWMC_CH0) Channel Mode Register -#define AT91C_PWMC_CH0_CUPDR ((AT91_REG *) 0xFFFCC210) // (PWMC_CH0) Channel Update Register -#define AT91C_PWMC_CH0_CCNTR ((AT91_REG *) 0xFFFCC20C) // (PWMC_CH0) Channel Counter Register -// ========== Register definition for PWMC peripheral ========== -#define AT91C_PWMC_IDR ((AT91_REG *) 0xFFFCC014) // (PWMC) PWMC Interrupt Disable Register -#define AT91C_PWMC_DIS ((AT91_REG *) 0xFFFCC008) // (PWMC) PWMC Disable Register -#define AT91C_PWMC_IER ((AT91_REG *) 0xFFFCC010) // (PWMC) PWMC Interrupt Enable Register -#define AT91C_PWMC_VR ((AT91_REG *) 0xFFFCC0FC) // (PWMC) PWMC Version Register -#define AT91C_PWMC_ISR ((AT91_REG *) 0xFFFCC01C) // (PWMC) PWMC Interrupt Status Register -#define AT91C_PWMC_SR ((AT91_REG *) 0xFFFCC00C) // (PWMC) PWMC Status Register -#define AT91C_PWMC_IMR ((AT91_REG *) 0xFFFCC018) // (PWMC) PWMC Interrupt Mask Register -#define AT91C_PWMC_MR ((AT91_REG *) 0xFFFCC000) // (PWMC) PWMC Mode Register -#define AT91C_PWMC_ENA ((AT91_REG *) 0xFFFCC004) // (PWMC) PWMC Enable Register -// ========== Register definition for UDP peripheral ========== -#define AT91C_UDP_IMR ((AT91_REG *) 0xFFFB0018) // (UDP) Interrupt Mask Register -#define AT91C_UDP_FADDR ((AT91_REG *) 0xFFFB0008) // (UDP) Function Address Register -#define AT91C_UDP_NUM ((AT91_REG *) 0xFFFB0000) // (UDP) Frame Number Register -#define AT91C_UDP_FDR ((AT91_REG *) 0xFFFB0050) // (UDP) Endpoint FIFO Data Register -#define AT91C_UDP_ISR ((AT91_REG *) 0xFFFB001C) // (UDP) Interrupt Status Register -#define AT91C_UDP_CSR ((AT91_REG *) 0xFFFB0030) // (UDP) Endpoint Control and Status Register -#define AT91C_UDP_IDR ((AT91_REG *) 0xFFFB0014) // (UDP) Interrupt Disable Register -#define AT91C_UDP_ICR ((AT91_REG *) 0xFFFB0020) // (UDP) Interrupt Clear Register -#define AT91C_UDP_RSTEP ((AT91_REG *) 0xFFFB0028) // (UDP) Reset Endpoint Register -#define AT91C_UDP_TXVC ((AT91_REG *) 0xFFFB0074) // (UDP) Transceiver Control Register -#define AT91C_UDP_GLBSTATE ((AT91_REG *) 0xFFFB0004) // (UDP) Global State Register -#define AT91C_UDP_IER ((AT91_REG *) 0xFFFB0010) // (UDP) Interrupt Enable Register -// ========== Register definition for TC0 peripheral ========== -#define AT91C_TC0_SR ((AT91_REG *) 0xFFFA0020) // (TC0) Status Register -#define AT91C_TC0_RC ((AT91_REG *) 0xFFFA001C) // (TC0) Register C -#define AT91C_TC0_RB ((AT91_REG *) 0xFFFA0018) // (TC0) Register B -#define AT91C_TC0_CCR ((AT91_REG *) 0xFFFA0000) // (TC0) Channel Control Register -#define AT91C_TC0_CMR ((AT91_REG *) 0xFFFA0004) // (TC0) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC0_IER ((AT91_REG *) 0xFFFA0024) // (TC0) Interrupt Enable Register -#define AT91C_TC0_RA ((AT91_REG *) 0xFFFA0014) // (TC0) Register A -#define AT91C_TC0_IDR ((AT91_REG *) 0xFFFA0028) // (TC0) Interrupt Disable Register -#define AT91C_TC0_CV ((AT91_REG *) 0xFFFA0010) // (TC0) Counter Value -#define AT91C_TC0_IMR ((AT91_REG *) 0xFFFA002C) // (TC0) Interrupt Mask Register -// ========== Register definition for TC1 peripheral ========== -#define AT91C_TC1_RB ((AT91_REG *) 0xFFFA0058) // (TC1) Register B -#define AT91C_TC1_CCR ((AT91_REG *) 0xFFFA0040) // (TC1) Channel Control Register -#define AT91C_TC1_IER ((AT91_REG *) 0xFFFA0064) // (TC1) Interrupt Enable Register -#define AT91C_TC1_IDR ((AT91_REG *) 0xFFFA0068) // (TC1) Interrupt Disable Register -#define AT91C_TC1_SR ((AT91_REG *) 0xFFFA0060) // (TC1) Status Register -#define AT91C_TC1_CMR ((AT91_REG *) 0xFFFA0044) // (TC1) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC1_RA ((AT91_REG *) 0xFFFA0054) // (TC1) Register A -#define AT91C_TC1_RC ((AT91_REG *) 0xFFFA005C) // (TC1) Register C -#define AT91C_TC1_IMR ((AT91_REG *) 0xFFFA006C) // (TC1) Interrupt Mask Register -#define AT91C_TC1_CV ((AT91_REG *) 0xFFFA0050) // (TC1) Counter Value -// ========== Register definition for TC2 peripheral ========== -#define AT91C_TC2_CMR ((AT91_REG *) 0xFFFA0084) // (TC2) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC2_CCR ((AT91_REG *) 0xFFFA0080) // (TC2) Channel Control Register -#define AT91C_TC2_CV ((AT91_REG *) 0xFFFA0090) // (TC2) Counter Value -#define AT91C_TC2_RA ((AT91_REG *) 0xFFFA0094) // (TC2) Register A -#define AT91C_TC2_RB ((AT91_REG *) 0xFFFA0098) // (TC2) Register B -#define AT91C_TC2_IDR ((AT91_REG *) 0xFFFA00A8) // (TC2) Interrupt Disable Register -#define AT91C_TC2_IMR ((AT91_REG *) 0xFFFA00AC) // (TC2) Interrupt Mask Register -#define AT91C_TC2_RC ((AT91_REG *) 0xFFFA009C) // (TC2) Register C -#define AT91C_TC2_IER ((AT91_REG *) 0xFFFA00A4) // (TC2) Interrupt Enable Register -#define AT91C_TC2_SR ((AT91_REG *) 0xFFFA00A0) // (TC2) Status Register -// ========== Register definition for TCB peripheral ========== -#define AT91C_TCB_BMR ((AT91_REG *) 0xFFFA00C4) // (TCB) TC Block Mode Register -#define AT91C_TCB_BCR ((AT91_REG *) 0xFFFA00C0) // (TCB) TC Block Control Register -// ========== Register definition for CAN_MB0 peripheral ========== -#define AT91C_CAN_MB0_MDL ((AT91_REG *) 0xFFFD0214) // (CAN_MB0) MailBox Data Low Register -#define AT91C_CAN_MB0_MAM ((AT91_REG *) 0xFFFD0204) // (CAN_MB0) MailBox Acceptance Mask Register -#define AT91C_CAN_MB0_MCR ((AT91_REG *) 0xFFFD021C) // (CAN_MB0) MailBox Control Register -#define AT91C_CAN_MB0_MID ((AT91_REG *) 0xFFFD0208) // (CAN_MB0) MailBox ID Register -#define AT91C_CAN_MB0_MSR ((AT91_REG *) 0xFFFD0210) // (CAN_MB0) MailBox Status Register -#define AT91C_CAN_MB0_MFID ((AT91_REG *) 0xFFFD020C) // (CAN_MB0) MailBox Family ID Register -#define AT91C_CAN_MB0_MDH ((AT91_REG *) 0xFFFD0218) // (CAN_MB0) MailBox Data High Register -#define AT91C_CAN_MB0_MMR ((AT91_REG *) 0xFFFD0200) // (CAN_MB0) MailBox Mode Register -// ========== Register definition for CAN_MB1 peripheral ========== -#define AT91C_CAN_MB1_MDL ((AT91_REG *) 0xFFFD0234) // (CAN_MB1) MailBox Data Low Register -#define AT91C_CAN_MB1_MID ((AT91_REG *) 0xFFFD0228) // (CAN_MB1) MailBox ID Register -#define AT91C_CAN_MB1_MMR ((AT91_REG *) 0xFFFD0220) // (CAN_MB1) MailBox Mode Register -#define AT91C_CAN_MB1_MSR ((AT91_REG *) 0xFFFD0230) // (CAN_MB1) MailBox Status Register -#define AT91C_CAN_MB1_MAM ((AT91_REG *) 0xFFFD0224) // (CAN_MB1) MailBox Acceptance Mask Register -#define AT91C_CAN_MB1_MDH ((AT91_REG *) 0xFFFD0238) // (CAN_MB1) MailBox Data High Register -#define AT91C_CAN_MB1_MCR ((AT91_REG *) 0xFFFD023C) // (CAN_MB1) MailBox Control Register -#define AT91C_CAN_MB1_MFID ((AT91_REG *) 0xFFFD022C) // (CAN_MB1) MailBox Family ID Register -// ========== Register definition for CAN_MB2 peripheral ========== -#define AT91C_CAN_MB2_MCR ((AT91_REG *) 0xFFFD025C) // (CAN_MB2) MailBox Control Register -#define AT91C_CAN_MB2_MDH ((AT91_REG *) 0xFFFD0258) // (CAN_MB2) MailBox Data High Register -#define AT91C_CAN_MB2_MID ((AT91_REG *) 0xFFFD0248) // (CAN_MB2) MailBox ID Register -#define AT91C_CAN_MB2_MDL ((AT91_REG *) 0xFFFD0254) // (CAN_MB2) MailBox Data Low Register -#define AT91C_CAN_MB2_MMR ((AT91_REG *) 0xFFFD0240) // (CAN_MB2) MailBox Mode Register -#define AT91C_CAN_MB2_MAM ((AT91_REG *) 0xFFFD0244) // (CAN_MB2) MailBox Acceptance Mask Register -#define AT91C_CAN_MB2_MFID ((AT91_REG *) 0xFFFD024C) // (CAN_MB2) MailBox Family ID Register -#define AT91C_CAN_MB2_MSR ((AT91_REG *) 0xFFFD0250) // (CAN_MB2) MailBox Status Register -// ========== Register definition for CAN_MB3 peripheral ========== -#define AT91C_CAN_MB3_MFID ((AT91_REG *) 0xFFFD026C) // (CAN_MB3) MailBox Family ID Register -#define AT91C_CAN_MB3_MAM ((AT91_REG *) 0xFFFD0264) // (CAN_MB3) MailBox Acceptance Mask Register -#define AT91C_CAN_MB3_MID ((AT91_REG *) 0xFFFD0268) // (CAN_MB3) MailBox ID Register -#define AT91C_CAN_MB3_MCR ((AT91_REG *) 0xFFFD027C) // (CAN_MB3) MailBox Control Register -#define AT91C_CAN_MB3_MMR ((AT91_REG *) 0xFFFD0260) // (CAN_MB3) MailBox Mode Register -#define AT91C_CAN_MB3_MSR ((AT91_REG *) 0xFFFD0270) // (CAN_MB3) MailBox Status Register -#define AT91C_CAN_MB3_MDL ((AT91_REG *) 0xFFFD0274) // (CAN_MB3) MailBox Data Low Register -#define AT91C_CAN_MB3_MDH ((AT91_REG *) 0xFFFD0278) // (CAN_MB3) MailBox Data High Register -// ========== Register definition for CAN_MB4 peripheral ========== -#define AT91C_CAN_MB4_MID ((AT91_REG *) 0xFFFD0288) // (CAN_MB4) MailBox ID Register -#define AT91C_CAN_MB4_MMR ((AT91_REG *) 0xFFFD0280) // (CAN_MB4) MailBox Mode Register -#define AT91C_CAN_MB4_MDH ((AT91_REG *) 0xFFFD0298) // (CAN_MB4) MailBox Data High Register -#define AT91C_CAN_MB4_MFID ((AT91_REG *) 0xFFFD028C) // (CAN_MB4) MailBox Family ID Register -#define AT91C_CAN_MB4_MSR ((AT91_REG *) 0xFFFD0290) // (CAN_MB4) MailBox Status Register -#define AT91C_CAN_MB4_MCR ((AT91_REG *) 0xFFFD029C) // (CAN_MB4) MailBox Control Register -#define AT91C_CAN_MB4_MDL ((AT91_REG *) 0xFFFD0294) // (CAN_MB4) MailBox Data Low Register -#define AT91C_CAN_MB4_MAM ((AT91_REG *) 0xFFFD0284) // (CAN_MB4) MailBox Acceptance Mask Register -// ========== Register definition for CAN_MB5 peripheral ========== -#define AT91C_CAN_MB5_MSR ((AT91_REG *) 0xFFFD02B0) // (CAN_MB5) MailBox Status Register -#define AT91C_CAN_MB5_MCR ((AT91_REG *) 0xFFFD02BC) // (CAN_MB5) MailBox Control Register -#define AT91C_CAN_MB5_MFID ((AT91_REG *) 0xFFFD02AC) // (CAN_MB5) MailBox Family ID Register -#define AT91C_CAN_MB5_MDH ((AT91_REG *) 0xFFFD02B8) // (CAN_MB5) MailBox Data High Register -#define AT91C_CAN_MB5_MID ((AT91_REG *) 0xFFFD02A8) // (CAN_MB5) MailBox ID Register -#define AT91C_CAN_MB5_MMR ((AT91_REG *) 0xFFFD02A0) // (CAN_MB5) MailBox Mode Register -#define AT91C_CAN_MB5_MDL ((AT91_REG *) 0xFFFD02B4) // (CAN_MB5) MailBox Data Low Register -#define AT91C_CAN_MB5_MAM ((AT91_REG *) 0xFFFD02A4) // (CAN_MB5) MailBox Acceptance Mask Register -// ========== Register definition for CAN_MB6 peripheral ========== -#define AT91C_CAN_MB6_MFID ((AT91_REG *) 0xFFFD02CC) // (CAN_MB6) MailBox Family ID Register -#define AT91C_CAN_MB6_MID ((AT91_REG *) 0xFFFD02C8) // (CAN_MB6) MailBox ID Register -#define AT91C_CAN_MB6_MAM ((AT91_REG *) 0xFFFD02C4) // (CAN_MB6) MailBox Acceptance Mask Register -#define AT91C_CAN_MB6_MSR ((AT91_REG *) 0xFFFD02D0) // (CAN_MB6) MailBox Status Register -#define AT91C_CAN_MB6_MDL ((AT91_REG *) 0xFFFD02D4) // (CAN_MB6) MailBox Data Low Register -#define AT91C_CAN_MB6_MCR ((AT91_REG *) 0xFFFD02DC) // (CAN_MB6) MailBox Control Register -#define AT91C_CAN_MB6_MDH ((AT91_REG *) 0xFFFD02D8) // (CAN_MB6) MailBox Data High Register -#define AT91C_CAN_MB6_MMR ((AT91_REG *) 0xFFFD02C0) // (CAN_MB6) MailBox Mode Register -// ========== Register definition for CAN_MB7 peripheral ========== -#define AT91C_CAN_MB7_MCR ((AT91_REG *) 0xFFFD02FC) // (CAN_MB7) MailBox Control Register -#define AT91C_CAN_MB7_MDH ((AT91_REG *) 0xFFFD02F8) // (CAN_MB7) MailBox Data High Register -#define AT91C_CAN_MB7_MFID ((AT91_REG *) 0xFFFD02EC) // (CAN_MB7) MailBox Family ID Register -#define AT91C_CAN_MB7_MDL ((AT91_REG *) 0xFFFD02F4) // (CAN_MB7) MailBox Data Low Register -#define AT91C_CAN_MB7_MID ((AT91_REG *) 0xFFFD02E8) // (CAN_MB7) MailBox ID Register -#define AT91C_CAN_MB7_MMR ((AT91_REG *) 0xFFFD02E0) // (CAN_MB7) MailBox Mode Register -#define AT91C_CAN_MB7_MAM ((AT91_REG *) 0xFFFD02E4) // (CAN_MB7) MailBox Acceptance Mask Register -#define AT91C_CAN_MB7_MSR ((AT91_REG *) 0xFFFD02F0) // (CAN_MB7) MailBox Status Register -// ========== Register definition for CAN peripheral ========== -#define AT91C_CAN_TCR ((AT91_REG *) 0xFFFD0024) // (CAN) Transfer Command Register -#define AT91C_CAN_IMR ((AT91_REG *) 0xFFFD000C) // (CAN) Interrupt Mask Register -#define AT91C_CAN_IER ((AT91_REG *) 0xFFFD0004) // (CAN) Interrupt Enable Register -#define AT91C_CAN_ECR ((AT91_REG *) 0xFFFD0020) // (CAN) Error Counter Register -#define AT91C_CAN_TIMESTP ((AT91_REG *) 0xFFFD001C) // (CAN) Time Stamp Register -#define AT91C_CAN_MR ((AT91_REG *) 0xFFFD0000) // (CAN) Mode Register -#define AT91C_CAN_IDR ((AT91_REG *) 0xFFFD0008) // (CAN) Interrupt Disable Register -#define AT91C_CAN_ACR ((AT91_REG *) 0xFFFD0028) // (CAN) Abort Command Register -#define AT91C_CAN_TIM ((AT91_REG *) 0xFFFD0018) // (CAN) Timer Register -#define AT91C_CAN_SR ((AT91_REG *) 0xFFFD0010) // (CAN) Status Register -#define AT91C_CAN_BR ((AT91_REG *) 0xFFFD0014) // (CAN) Baudrate Register -#define AT91C_CAN_VR ((AT91_REG *) 0xFFFD00FC) // (CAN) Version Register -// ========== Register definition for EMAC peripheral ========== -#define AT91C_EMAC_ISR ((AT91_REG *) 0xFFFDC024) // (EMAC) Interrupt Status Register -#define AT91C_EMAC_SA4H ((AT91_REG *) 0xFFFDC0B4) // (EMAC) Specific Address 4 Top, Last 2 bytes -#define AT91C_EMAC_SA1L ((AT91_REG *) 0xFFFDC098) // (EMAC) Specific Address 1 Bottom, First 4 bytes -#define AT91C_EMAC_ELE ((AT91_REG *) 0xFFFDC078) // (EMAC) Excessive Length Errors Register -#define AT91C_EMAC_LCOL ((AT91_REG *) 0xFFFDC05C) // (EMAC) Late Collision Register -#define AT91C_EMAC_RLE ((AT91_REG *) 0xFFFDC088) // (EMAC) Receive Length Field Mismatch Register -#define AT91C_EMAC_WOL ((AT91_REG *) 0xFFFDC0C4) // (EMAC) Wake On LAN Register -#define AT91C_EMAC_DTF ((AT91_REG *) 0xFFFDC058) // (EMAC) Deferred Transmission Frame Register -#define AT91C_EMAC_TUND ((AT91_REG *) 0xFFFDC064) // (EMAC) Transmit Underrun Error Register -#define AT91C_EMAC_NCR ((AT91_REG *) 0xFFFDC000) // (EMAC) Network Control Register -#define AT91C_EMAC_SA4L ((AT91_REG *) 0xFFFDC0B0) // (EMAC) Specific Address 4 Bottom, First 4 bytes -#define AT91C_EMAC_RSR ((AT91_REG *) 0xFFFDC020) // (EMAC) Receive Status Register -#define AT91C_EMAC_SA3L ((AT91_REG *) 0xFFFDC0A8) // (EMAC) Specific Address 3 Bottom, First 4 bytes -#define AT91C_EMAC_TSR ((AT91_REG *) 0xFFFDC014) // (EMAC) Transmit Status Register -#define AT91C_EMAC_IDR ((AT91_REG *) 0xFFFDC02C) // (EMAC) Interrupt Disable Register -#define AT91C_EMAC_RSE ((AT91_REG *) 0xFFFDC074) // (EMAC) Receive Symbol Errors Register -#define AT91C_EMAC_ECOL ((AT91_REG *) 0xFFFDC060) // (EMAC) Excessive Collision Register -#define AT91C_EMAC_TID ((AT91_REG *) 0xFFFDC0B8) // (EMAC) Type ID Checking Register -#define AT91C_EMAC_HRB ((AT91_REG *) 0xFFFDC090) // (EMAC) Hash Address Bottom[31:0] -#define AT91C_EMAC_TBQP ((AT91_REG *) 0xFFFDC01C) // (EMAC) Transmit Buffer Queue Pointer -#define AT91C_EMAC_USRIO ((AT91_REG *) 0xFFFDC0C0) // (EMAC) USER Input/Output Register -#define AT91C_EMAC_PTR ((AT91_REG *) 0xFFFDC038) // (EMAC) Pause Time Register -#define AT91C_EMAC_SA2H ((AT91_REG *) 0xFFFDC0A4) // (EMAC) Specific Address 2 Top, Last 2 bytes -#define AT91C_EMAC_ROV ((AT91_REG *) 0xFFFDC070) // (EMAC) Receive Overrun Errors Register -#define AT91C_EMAC_ALE ((AT91_REG *) 0xFFFDC054) // (EMAC) Alignment Error Register -#define AT91C_EMAC_RJA ((AT91_REG *) 0xFFFDC07C) // (EMAC) Receive Jabbers Register -#define AT91C_EMAC_RBQP ((AT91_REG *) 0xFFFDC018) // (EMAC) Receive Buffer Queue Pointer -#define AT91C_EMAC_TPF ((AT91_REG *) 0xFFFDC08C) // (EMAC) Transmitted Pause Frames Register -#define AT91C_EMAC_NCFGR ((AT91_REG *) 0xFFFDC004) // (EMAC) Network Configuration Register -#define AT91C_EMAC_HRT ((AT91_REG *) 0xFFFDC094) // (EMAC) Hash Address Top[63:32] -#define AT91C_EMAC_USF ((AT91_REG *) 0xFFFDC080) // (EMAC) Undersize Frames Register -#define AT91C_EMAC_FCSE ((AT91_REG *) 0xFFFDC050) // (EMAC) Frame Check Sequence Error Register -#define AT91C_EMAC_TPQ ((AT91_REG *) 0xFFFDC0BC) // (EMAC) Transmit Pause Quantum Register -#define AT91C_EMAC_MAN ((AT91_REG *) 0xFFFDC034) // (EMAC) PHY Maintenance Register -#define AT91C_EMAC_FTO ((AT91_REG *) 0xFFFDC040) // (EMAC) Frames Transmitted OK Register -#define AT91C_EMAC_REV ((AT91_REG *) 0xFFFDC0FC) // (EMAC) Revision Register -#define AT91C_EMAC_IMR ((AT91_REG *) 0xFFFDC030) // (EMAC) Interrupt Mask Register -#define AT91C_EMAC_SCF ((AT91_REG *) 0xFFFDC044) // (EMAC) Single Collision Frame Register -#define AT91C_EMAC_PFR ((AT91_REG *) 0xFFFDC03C) // (EMAC) Pause Frames received Register -#define AT91C_EMAC_MCF ((AT91_REG *) 0xFFFDC048) // (EMAC) Multiple Collision Frame Register -#define AT91C_EMAC_NSR ((AT91_REG *) 0xFFFDC008) // (EMAC) Network Status Register -#define AT91C_EMAC_SA2L ((AT91_REG *) 0xFFFDC0A0) // (EMAC) Specific Address 2 Bottom, First 4 bytes -#define AT91C_EMAC_FRO ((AT91_REG *) 0xFFFDC04C) // (EMAC) Frames Received OK Register -#define AT91C_EMAC_IER ((AT91_REG *) 0xFFFDC028) // (EMAC) Interrupt Enable Register -#define AT91C_EMAC_SA1H ((AT91_REG *) 0xFFFDC09C) // (EMAC) Specific Address 1 Top, Last 2 bytes -#define AT91C_EMAC_CSE ((AT91_REG *) 0xFFFDC068) // (EMAC) Carrier Sense Error Register -#define AT91C_EMAC_SA3H ((AT91_REG *) 0xFFFDC0AC) // (EMAC) Specific Address 3 Top, Last 2 bytes -#define AT91C_EMAC_RRE ((AT91_REG *) 0xFFFDC06C) // (EMAC) Receive Ressource Error Register -#define AT91C_EMAC_STE ((AT91_REG *) 0xFFFDC084) // (EMAC) SQE Test Error Register -// ========== Register definition for PDC_ADC peripheral ========== -#define AT91C_ADC_PTSR ((AT91_REG *) 0xFFFD8124) // (PDC_ADC) PDC Transfer Status Register -#define AT91C_ADC_PTCR ((AT91_REG *) 0xFFFD8120) // (PDC_ADC) PDC Transfer Control Register -#define AT91C_ADC_TNPR ((AT91_REG *) 0xFFFD8118) // (PDC_ADC) Transmit Next Pointer Register -#define AT91C_ADC_TNCR ((AT91_REG *) 0xFFFD811C) // (PDC_ADC) Transmit Next Counter Register -#define AT91C_ADC_RNPR ((AT91_REG *) 0xFFFD8110) // (PDC_ADC) Receive Next Pointer Register -#define AT91C_ADC_RNCR ((AT91_REG *) 0xFFFD8114) // (PDC_ADC) Receive Next Counter Register -#define AT91C_ADC_RPR ((AT91_REG *) 0xFFFD8100) // (PDC_ADC) Receive Pointer Register -#define AT91C_ADC_TCR ((AT91_REG *) 0xFFFD810C) // (PDC_ADC) Transmit Counter Register -#define AT91C_ADC_TPR ((AT91_REG *) 0xFFFD8108) // (PDC_ADC) Transmit Pointer Register -#define AT91C_ADC_RCR ((AT91_REG *) 0xFFFD8104) // (PDC_ADC) Receive Counter Register -// ========== Register definition for ADC peripheral ========== -#define AT91C_ADC_CDR2 ((AT91_REG *) 0xFFFD8038) // (ADC) ADC Channel Data Register 2 -#define AT91C_ADC_CDR3 ((AT91_REG *) 0xFFFD803C) // (ADC) ADC Channel Data Register 3 -#define AT91C_ADC_CDR0 ((AT91_REG *) 0xFFFD8030) // (ADC) ADC Channel Data Register 0 -#define AT91C_ADC_CDR5 ((AT91_REG *) 0xFFFD8044) // (ADC) ADC Channel Data Register 5 -#define AT91C_ADC_CHDR ((AT91_REG *) 0xFFFD8014) // (ADC) ADC Channel Disable Register -#define AT91C_ADC_SR ((AT91_REG *) 0xFFFD801C) // (ADC) ADC Status Register -#define AT91C_ADC_CDR4 ((AT91_REG *) 0xFFFD8040) // (ADC) ADC Channel Data Register 4 -#define AT91C_ADC_CDR1 ((AT91_REG *) 0xFFFD8034) // (ADC) ADC Channel Data Register 1 -#define AT91C_ADC_LCDR ((AT91_REG *) 0xFFFD8020) // (ADC) ADC Last Converted Data Register -#define AT91C_ADC_IDR ((AT91_REG *) 0xFFFD8028) // (ADC) ADC Interrupt Disable Register -#define AT91C_ADC_CR ((AT91_REG *) 0xFFFD8000) // (ADC) ADC Control Register -#define AT91C_ADC_CDR7 ((AT91_REG *) 0xFFFD804C) // (ADC) ADC Channel Data Register 7 -#define AT91C_ADC_CDR6 ((AT91_REG *) 0xFFFD8048) // (ADC) ADC Channel Data Register 6 -#define AT91C_ADC_IER ((AT91_REG *) 0xFFFD8024) // (ADC) ADC Interrupt Enable Register -#define AT91C_ADC_CHER ((AT91_REG *) 0xFFFD8010) // (ADC) ADC Channel Enable Register -#define AT91C_ADC_CHSR ((AT91_REG *) 0xFFFD8018) // (ADC) ADC Channel Status Register -#define AT91C_ADC_MR ((AT91_REG *) 0xFFFD8004) // (ADC) ADC Mode Register -#define AT91C_ADC_IMR ((AT91_REG *) 0xFFFD802C) // (ADC) ADC Interrupt Mask Register - -// ***************************************************************************** -// PIO DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_PIO_PA0 ((unsigned int) 1 << 0) // Pin Controlled by PA0 -#define AT91C_PA0_RXD0 ((unsigned int) AT91C_PIO_PA0) // USART 0 Receive Data -#define AT91C_PIO_PA1 ((unsigned int) 1 << 1) // Pin Controlled by PA1 -#define AT91C_PA1_TXD0 ((unsigned int) AT91C_PIO_PA1) // USART 0 Transmit Data -#define AT91C_PIO_PA10 ((unsigned int) 1 << 10) // Pin Controlled by PA10 -#define AT91C_PA10_TWD ((unsigned int) AT91C_PIO_PA10) // TWI Two-wire Serial Data -#define AT91C_PIO_PA11 ((unsigned int) 1 << 11) // Pin Controlled by PA11 -#define AT91C_PA11_TWCK ((unsigned int) AT91C_PIO_PA11) // TWI Two-wire Serial Clock -#define AT91C_PIO_PA12 ((unsigned int) 1 << 12) // Pin Controlled by PA12 -#define AT91C_PA12_SPI0_NPCS0 ((unsigned int) AT91C_PIO_PA12) // SPI 0 Peripheral Chip Select 0 -#define AT91C_PIO_PA13 ((unsigned int) 1 << 13) // Pin Controlled by PA13 -#define AT91C_PA13_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PA13) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PA13_PCK1 ((unsigned int) AT91C_PIO_PA13) // PMC Programmable Clock Output 1 -#define AT91C_PIO_PA14 ((unsigned int) 1 << 14) // Pin Controlled by PA14 -#define AT91C_PA14_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PA14) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PA14_IRQ1 ((unsigned int) AT91C_PIO_PA14) // External Interrupt 1 -#define AT91C_PIO_PA15 ((unsigned int) 1 << 15) // Pin Controlled by PA15 -#define AT91C_PA15_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PA15) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PA15_TCLK2 ((unsigned int) AT91C_PIO_PA15) // Timer Counter 2 external clock input -#define AT91C_PIO_PA16 ((unsigned int) 1 << 16) // Pin Controlled by PA16 -#define AT91C_PA16_SPI0_MISO ((unsigned int) AT91C_PIO_PA16) // SPI 0 Master In Slave -#define AT91C_PIO_PA17 ((unsigned int) 1 << 17) // Pin Controlled by PA17 -#define AT91C_PA17_SPI0_MOSI ((unsigned int) AT91C_PIO_PA17) // SPI 0 Master Out Slave -#define AT91C_PIO_PA18 ((unsigned int) 1 << 18) // Pin Controlled by PA18 -#define AT91C_PA18_SPI0_SPCK ((unsigned int) AT91C_PIO_PA18) // SPI 0 Serial Clock -#define AT91C_PIO_PA19 ((unsigned int) 1 << 19) // Pin Controlled by PA19 -#define AT91C_PA19_CANRX ((unsigned int) AT91C_PIO_PA19) // CAN Receive -#define AT91C_PIO_PA2 ((unsigned int) 1 << 2) // Pin Controlled by PA2 -#define AT91C_PA2_SCK0 ((unsigned int) AT91C_PIO_PA2) // USART 0 Serial Clock -#define AT91C_PA2_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PA2) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PA20 ((unsigned int) 1 << 20) // Pin Controlled by PA20 -#define AT91C_PA20_CANTX ((unsigned int) AT91C_PIO_PA20) // CAN Transmit -#define AT91C_PIO_PA21 ((unsigned int) 1 << 21) // Pin Controlled by PA21 -#define AT91C_PA21_TF ((unsigned int) AT91C_PIO_PA21) // SSC Transmit Frame Sync -#define AT91C_PA21_SPI1_NPCS0 ((unsigned int) AT91C_PIO_PA21) // SPI 1 Peripheral Chip Select 0 -#define AT91C_PIO_PA22 ((unsigned int) 1 << 22) // Pin Controlled by PA22 -#define AT91C_PA22_TK ((unsigned int) AT91C_PIO_PA22) // SSC Transmit Clock -#define AT91C_PA22_SPI1_SPCK ((unsigned int) AT91C_PIO_PA22) // SPI 1 Serial Clock -#define AT91C_PIO_PA23 ((unsigned int) 1 << 23) // Pin Controlled by PA23 -#define AT91C_PA23_TD ((unsigned int) AT91C_PIO_PA23) // SSC Transmit data -#define AT91C_PA23_SPI1_MOSI ((unsigned int) AT91C_PIO_PA23) // SPI 1 Master Out Slave -#define AT91C_PIO_PA24 ((unsigned int) 1 << 24) // Pin Controlled by PA24 -#define AT91C_PA24_RD ((unsigned int) AT91C_PIO_PA24) // SSC Receive Data -#define AT91C_PA24_SPI1_MISO ((unsigned int) AT91C_PIO_PA24) // SPI 1 Master In Slave -#define AT91C_PIO_PA25 ((unsigned int) 1 << 25) // Pin Controlled by PA25 -#define AT91C_PA25_RK ((unsigned int) AT91C_PIO_PA25) // SSC Receive Clock -#define AT91C_PA25_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PA25) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PA26 ((unsigned int) 1 << 26) // Pin Controlled by PA26 -#define AT91C_PA26_RF ((unsigned int) AT91C_PIO_PA26) // SSC Receive Frame Sync -#define AT91C_PA26_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PA26) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PA27 ((unsigned int) 1 << 27) // Pin Controlled by PA27 -#define AT91C_PA27_DRXD ((unsigned int) AT91C_PIO_PA27) // DBGU Debug Receive Data -#define AT91C_PA27_PCK3 ((unsigned int) AT91C_PIO_PA27) // PMC Programmable Clock Output 3 -#define AT91C_PIO_PA28 ((unsigned int) 1 << 28) // Pin Controlled by PA28 -#define AT91C_PA28_DTXD ((unsigned int) AT91C_PIO_PA28) // DBGU Debug Transmit Data -#define AT91C_PIO_PA29 ((unsigned int) 1 << 29) // Pin Controlled by PA29 -#define AT91C_PA29_FIQ ((unsigned int) AT91C_PIO_PA29) // AIC Fast Interrupt Input -#define AT91C_PA29_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PA29) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PA3 ((unsigned int) 1 << 3) // Pin Controlled by PA3 -#define AT91C_PA3_RTS0 ((unsigned int) AT91C_PIO_PA3) // USART 0 Ready To Send -#define AT91C_PA3_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PA3) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PA30 ((unsigned int) 1 << 30) // Pin Controlled by PA30 -#define AT91C_PA30_IRQ0 ((unsigned int) AT91C_PIO_PA30) // External Interrupt 0 -#define AT91C_PA30_PCK2 ((unsigned int) AT91C_PIO_PA30) // PMC Programmable Clock Output 2 -#define AT91C_PIO_PA4 ((unsigned int) 1 << 4) // Pin Controlled by PA4 -#define AT91C_PA4_CTS0 ((unsigned int) AT91C_PIO_PA4) // USART 0 Clear To Send -#define AT91C_PA4_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PA4) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PA5 ((unsigned int) 1 << 5) // Pin Controlled by PA5 -#define AT91C_PA5_RXD1 ((unsigned int) AT91C_PIO_PA5) // USART 1 Receive Data -#define AT91C_PIO_PA6 ((unsigned int) 1 << 6) // Pin Controlled by PA6 -#define AT91C_PA6_TXD1 ((unsigned int) AT91C_PIO_PA6) // USART 1 Transmit Data -#define AT91C_PIO_PA7 ((unsigned int) 1 << 7) // Pin Controlled by PA7 -#define AT91C_PA7_SCK1 ((unsigned int) AT91C_PIO_PA7) // USART 1 Serial Clock -#define AT91C_PA7_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PA7) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PIO_PA8 ((unsigned int) 1 << 8) // Pin Controlled by PA8 -#define AT91C_PA8_RTS1 ((unsigned int) AT91C_PIO_PA8) // USART 1 Ready To Send -#define AT91C_PA8_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PA8) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PIO_PA9 ((unsigned int) 1 << 9) // Pin Controlled by PA9 -#define AT91C_PA9_CTS1 ((unsigned int) AT91C_PIO_PA9) // USART 1 Clear To Send -#define AT91C_PA9_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PA9) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PIO_PB0 ((unsigned int) 1 << 0) // Pin Controlled by PB0 -#define AT91C_PB0_ETXCK_EREFCK ((unsigned int) AT91C_PIO_PB0) // Ethernet MAC Transmit Clock/Reference Clock -#define AT91C_PB0_PCK0 ((unsigned int) AT91C_PIO_PB0) // PMC Programmable Clock Output 0 -#define AT91C_PIO_PB1 ((unsigned int) 1 << 1) // Pin Controlled by PB1 -#define AT91C_PB1_ETXEN ((unsigned int) AT91C_PIO_PB1) // Ethernet MAC Transmit Enable -#define AT91C_PIO_PB10 ((unsigned int) 1 << 10) // Pin Controlled by PB10 -#define AT91C_PB10_ETX2 ((unsigned int) AT91C_PIO_PB10) // Ethernet MAC Transmit Data 2 -#define AT91C_PB10_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PB10) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PB11 ((unsigned int) 1 << 11) // Pin Controlled by PB11 -#define AT91C_PB11_ETX3 ((unsigned int) AT91C_PIO_PB11) // Ethernet MAC Transmit Data 3 -#define AT91C_PB11_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PB11) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PB12 ((unsigned int) 1 << 12) // Pin Controlled by PB12 -#define AT91C_PB12_ETXER ((unsigned int) AT91C_PIO_PB12) // Ethernet MAC Transmikt Coding Error -#define AT91C_PB12_TCLK0 ((unsigned int) AT91C_PIO_PB12) // Timer Counter 0 external clock input -#define AT91C_PIO_PB13 ((unsigned int) 1 << 13) // Pin Controlled by PB13 -#define AT91C_PB13_ERX2 ((unsigned int) AT91C_PIO_PB13) // Ethernet MAC Receive Data 2 -#define AT91C_PB13_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PB13) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PIO_PB14 ((unsigned int) 1 << 14) // Pin Controlled by PB14 -#define AT91C_PB14_ERX3 ((unsigned int) AT91C_PIO_PB14) // Ethernet MAC Receive Data 3 -#define AT91C_PB14_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PB14) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PIO_PB15 ((unsigned int) 1 << 15) // Pin Controlled by PB15 -#define AT91C_PB15_ERXDV_ECRSDV ((unsigned int) AT91C_PIO_PB15) // Ethernet MAC Receive Data Valid -#define AT91C_PIO_PB16 ((unsigned int) 1 << 16) // Pin Controlled by PB16 -#define AT91C_PB16_ECOL ((unsigned int) AT91C_PIO_PB16) // Ethernet MAC Collision Detected -#define AT91C_PB16_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PB16) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PB17 ((unsigned int) 1 << 17) // Pin Controlled by PB17 -#define AT91C_PB17_ERXCK ((unsigned int) AT91C_PIO_PB17) // Ethernet MAC Receive Clock -#define AT91C_PB17_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PB17) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PIO_PB18 ((unsigned int) 1 << 18) // Pin Controlled by PB18 -#define AT91C_PB18_EF100 ((unsigned int) AT91C_PIO_PB18) // Ethernet MAC Force 100 Mbits/sec -#define AT91C_PB18_ADTRG ((unsigned int) AT91C_PIO_PB18) // ADC External Trigger -#define AT91C_PIO_PB19 ((unsigned int) 1 << 19) // Pin Controlled by PB19 -#define AT91C_PB19_PWM0 ((unsigned int) AT91C_PIO_PB19) // PWM Channel 0 -#define AT91C_PB19_TCLK1 ((unsigned int) AT91C_PIO_PB19) // Timer Counter 1 external clock input -#define AT91C_PIO_PB2 ((unsigned int) 1 << 2) // Pin Controlled by PB2 -#define AT91C_PB2_ETX0 ((unsigned int) AT91C_PIO_PB2) // Ethernet MAC Transmit Data 0 -#define AT91C_PIO_PB20 ((unsigned int) 1 << 20) // Pin Controlled by PB20 -#define AT91C_PB20_PWM1 ((unsigned int) AT91C_PIO_PB20) // PWM Channel 1 -#define AT91C_PB20_PCK0 ((unsigned int) AT91C_PIO_PB20) // PMC Programmable Clock Output 0 -#define AT91C_PIO_PB21 ((unsigned int) 1 << 21) // Pin Controlled by PB21 -#define AT91C_PB21_PWM2 ((unsigned int) AT91C_PIO_PB21) // PWM Channel 2 -#define AT91C_PB21_PCK1 ((unsigned int) AT91C_PIO_PB21) // PMC Programmable Clock Output 1 -#define AT91C_PIO_PB22 ((unsigned int) 1 << 22) // Pin Controlled by PB22 -#define AT91C_PB22_PWM3 ((unsigned int) AT91C_PIO_PB22) // PWM Channel 3 -#define AT91C_PB22_PCK2 ((unsigned int) AT91C_PIO_PB22) // PMC Programmable Clock Output 2 -#define AT91C_PIO_PB23 ((unsigned int) 1 << 23) // Pin Controlled by PB23 -#define AT91C_PB23_TIOA0 ((unsigned int) AT91C_PIO_PB23) // Timer Counter 0 Multipurpose Timer I/O Pin A -#define AT91C_PB23_DCD1 ((unsigned int) AT91C_PIO_PB23) // USART 1 Data Carrier Detect -#define AT91C_PIO_PB24 ((unsigned int) 1 << 24) // Pin Controlled by PB24 -#define AT91C_PB24_TIOB0 ((unsigned int) AT91C_PIO_PB24) // Timer Counter 0 Multipurpose Timer I/O Pin B -#define AT91C_PB24_DSR1 ((unsigned int) AT91C_PIO_PB24) // USART 1 Data Set ready -#define AT91C_PIO_PB25 ((unsigned int) 1 << 25) // Pin Controlled by PB25 -#define AT91C_PB25_TIOA1 ((unsigned int) AT91C_PIO_PB25) // Timer Counter 1 Multipurpose Timer I/O Pin A -#define AT91C_PB25_DTR1 ((unsigned int) AT91C_PIO_PB25) // USART 1 Data Terminal ready -#define AT91C_PIO_PB26 ((unsigned int) 1 << 26) // Pin Controlled by PB26 -#define AT91C_PB26_TIOB1 ((unsigned int) AT91C_PIO_PB26) // Timer Counter 1 Multipurpose Timer I/O Pin B -#define AT91C_PB26_RI1 ((unsigned int) AT91C_PIO_PB26) // USART 1 Ring Indicator -#define AT91C_PIO_PB27 ((unsigned int) 1 << 27) // Pin Controlled by PB27 -#define AT91C_PB27_TIOA2 ((unsigned int) AT91C_PIO_PB27) // Timer Counter 2 Multipurpose Timer I/O Pin A -#define AT91C_PB27_PWM0 ((unsigned int) AT91C_PIO_PB27) // PWM Channel 0 -#define AT91C_PIO_PB28 ((unsigned int) 1 << 28) // Pin Controlled by PB28 -#define AT91C_PB28_TIOB2 ((unsigned int) AT91C_PIO_PB28) // Timer Counter 2 Multipurpose Timer I/O Pin B -#define AT91C_PB28_PWM1 ((unsigned int) AT91C_PIO_PB28) // PWM Channel 1 -#define AT91C_PIO_PB29 ((unsigned int) 1 << 29) // Pin Controlled by PB29 -#define AT91C_PB29_PCK1 ((unsigned int) AT91C_PIO_PB29) // PMC Programmable Clock Output 1 -#define AT91C_PB29_PWM2 ((unsigned int) AT91C_PIO_PB29) // PWM Channel 2 -#define AT91C_PIO_PB3 ((unsigned int) 1 << 3) // Pin Controlled by PB3 -#define AT91C_PB3_ETX1 ((unsigned int) AT91C_PIO_PB3) // Ethernet MAC Transmit Data 1 -#define AT91C_PIO_PB30 ((unsigned int) 1 << 30) // Pin Controlled by PB30 -#define AT91C_PB30_PCK2 ((unsigned int) AT91C_PIO_PB30) // PMC Programmable Clock Output 2 -#define AT91C_PB30_PWM3 ((unsigned int) AT91C_PIO_PB30) // PWM Channel 3 -#define AT91C_PIO_PB4 ((unsigned int) 1 << 4) // Pin Controlled by PB4 -#define AT91C_PB4_ECRS ((unsigned int) AT91C_PIO_PB4) // Ethernet MAC Carrier Sense/Carrier Sense and Data Valid -#define AT91C_PIO_PB5 ((unsigned int) 1 << 5) // Pin Controlled by PB5 -#define AT91C_PB5_ERX0 ((unsigned int) AT91C_PIO_PB5) // Ethernet MAC Receive Data 0 -#define AT91C_PIO_PB6 ((unsigned int) 1 << 6) // Pin Controlled by PB6 -#define AT91C_PB6_ERX1 ((unsigned int) AT91C_PIO_PB6) // Ethernet MAC Receive Data 1 -#define AT91C_PIO_PB7 ((unsigned int) 1 << 7) // Pin Controlled by PB7 -#define AT91C_PB7_ERXER ((unsigned int) AT91C_PIO_PB7) // Ethernet MAC Receive Error -#define AT91C_PIO_PB8 ((unsigned int) 1 << 8) // Pin Controlled by PB8 -#define AT91C_PB8_EMDC ((unsigned int) AT91C_PIO_PB8) // Ethernet MAC Management Data Clock -#define AT91C_PIO_PB9 ((unsigned int) 1 << 9) // Pin Controlled by PB9 -#define AT91C_PB9_EMDIO ((unsigned int) AT91C_PIO_PB9) // Ethernet MAC Management Data Input/Output - -// ***************************************************************************** -// PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_ID_FIQ ((unsigned int) 0) // Advanced Interrupt Controller (FIQ) -#define AT91C_ID_SYS ((unsigned int) 1) // System Peripheral -#define AT91C_ID_PIOA ((unsigned int) 2) // Parallel IO Controller A -#define AT91C_ID_PIOB ((unsigned int) 3) // Parallel IO Controller B -#define AT91C_ID_SPI0 ((unsigned int) 4) // Serial Peripheral Interface 0 -#define AT91C_ID_SPI1 ((unsigned int) 5) // Serial Peripheral Interface 1 -#define AT91C_ID_US0 ((unsigned int) 6) // USART 0 -#define AT91C_ID_US1 ((unsigned int) 7) // USART 1 -#define AT91C_ID_SSC ((unsigned int) 8) // Serial Synchronous Controller -#define AT91C_ID_TWI ((unsigned int) 9) // Two-Wire Interface -#define AT91C_ID_PWMC ((unsigned int) 10) // PWM Controller -#define AT91C_ID_UDP ((unsigned int) 11) // USB Device Port -#define AT91C_ID_TC0 ((unsigned int) 12) // Timer Counter 0 -#define AT91C_ID_TC1 ((unsigned int) 13) // Timer Counter 1 -#define AT91C_ID_TC2 ((unsigned int) 14) // Timer Counter 2 -#define AT91C_ID_CAN ((unsigned int) 15) // Control Area Network Controller -#define AT91C_ID_EMAC ((unsigned int) 16) // Ethernet MAC -#define AT91C_ID_ADC ((unsigned int) 17) // Analog-to-Digital Converter -#define AT91C_ID_18_Reserved ((unsigned int) 18) // Reserved -#define AT91C_ID_19_Reserved ((unsigned int) 19) // Reserved -#define AT91C_ID_20_Reserved ((unsigned int) 20) // Reserved -#define AT91C_ID_21_Reserved ((unsigned int) 21) // Reserved -#define AT91C_ID_22_Reserved ((unsigned int) 22) // Reserved -#define AT91C_ID_23_Reserved ((unsigned int) 23) // Reserved -#define AT91C_ID_24_Reserved ((unsigned int) 24) // Reserved -#define AT91C_ID_25_Reserved ((unsigned int) 25) // Reserved -#define AT91C_ID_26_Reserved ((unsigned int) 26) // Reserved -#define AT91C_ID_27_Reserved ((unsigned int) 27) // Reserved -#define AT91C_ID_28_Reserved ((unsigned int) 28) // Reserved -#define AT91C_ID_29_Reserved ((unsigned int) 29) // Reserved -#define AT91C_ID_IRQ0 ((unsigned int) 30) // Advanced Interrupt Controller (IRQ0) -#define AT91C_ID_IRQ1 ((unsigned int) 31) // Advanced Interrupt Controller (IRQ1) -#define AT91C_ALL_INT ((unsigned int) 0xC003FFFF) // ALL VALID INTERRUPTS - -// ***************************************************************************** -// BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_BASE_SYS ((AT91PS_SYS) 0xFFFFF000) // (SYS) Base Address -#define AT91C_BASE_AIC ((AT91PS_AIC) 0xFFFFF000) // (AIC) Base Address -#define AT91C_BASE_PDC_DBGU ((AT91PS_PDC) 0xFFFFF300) // (PDC_DBGU) Base Address -#define AT91C_BASE_DBGU ((AT91PS_DBGU) 0xFFFFF200) // (DBGU) Base Address -#define AT91C_BASE_PIOA ((AT91PS_PIO) 0xFFFFF400) // (PIOA) Base Address -#define AT91C_BASE_PIOB ((AT91PS_PIO) 0xFFFFF600) // (PIOB) Base Address -#define AT91C_BASE_CKGR ((AT91PS_CKGR) 0xFFFFFC20) // (CKGR) Base Address -#define AT91C_BASE_PMC ((AT91PS_PMC) 0xFFFFFC00) // (PMC) Base Address -#define AT91C_BASE_RSTC ((AT91PS_RSTC) 0xFFFFFD00) // (RSTC) Base Address -#define AT91C_BASE_RTTC ((AT91PS_RTTC) 0xFFFFFD20) // (RTTC) Base Address -#define AT91C_BASE_PITC ((AT91PS_PITC) 0xFFFFFD30) // (PITC) Base Address -#define AT91C_BASE_WDTC ((AT91PS_WDTC) 0xFFFFFD40) // (WDTC) Base Address -#define AT91C_BASE_VREG ((AT91PS_VREG) 0xFFFFFD60) // (VREG) Base Address -#define AT91C_BASE_MC ((AT91PS_MC) 0xFFFFFF00) // (MC) Base Address -#define AT91C_BASE_PDC_SPI1 ((AT91PS_PDC) 0xFFFE4100) // (PDC_SPI1) Base Address -#define AT91C_BASE_SPI1 ((AT91PS_SPI) 0xFFFE4000) // (SPI1) Base Address -#define AT91C_BASE_PDC_SPI0 ((AT91PS_PDC) 0xFFFE0100) // (PDC_SPI0) Base Address -#define AT91C_BASE_SPI0 ((AT91PS_SPI) 0xFFFE0000) // (SPI0) Base Address -#define AT91C_BASE_PDC_US1 ((AT91PS_PDC) 0xFFFC4100) // (PDC_US1) Base Address -#define AT91C_BASE_US1 ((AT91PS_USART) 0xFFFC4000) // (US1) Base Address -#define AT91C_BASE_PDC_US0 ((AT91PS_PDC) 0xFFFC0100) // (PDC_US0) Base Address -#define AT91C_BASE_US0 ((AT91PS_USART) 0xFFFC0000) // (US0) Base Address -#define AT91C_BASE_PDC_SSC ((AT91PS_PDC) 0xFFFD4100) // (PDC_SSC) Base Address -#define AT91C_BASE_SSC ((AT91PS_SSC) 0xFFFD4000) // (SSC) Base Address -#define AT91C_BASE_TWI ((AT91PS_TWI) 0xFFFB8000) // (TWI) Base Address -#define AT91C_BASE_PWMC_CH3 ((AT91PS_PWMC_CH) 0xFFFCC260) // (PWMC_CH3) Base Address -#define AT91C_BASE_PWMC_CH2 ((AT91PS_PWMC_CH) 0xFFFCC240) // (PWMC_CH2) Base Address -#define AT91C_BASE_PWMC_CH1 ((AT91PS_PWMC_CH) 0xFFFCC220) // (PWMC_CH1) Base Address -#define AT91C_BASE_PWMC_CH0 ((AT91PS_PWMC_CH) 0xFFFCC200) // (PWMC_CH0) Base Address -#define AT91C_BASE_PWMC ((AT91PS_PWMC) 0xFFFCC000) // (PWMC) Base Address -#define AT91C_BASE_UDP ((AT91PS_UDP) 0xFFFB0000) // (UDP) Base Address -#define AT91C_BASE_TC0 ((AT91PS_TC) 0xFFFA0000) // (TC0) Base Address -#define AT91C_BASE_TC1 ((AT91PS_TC) 0xFFFA0040) // (TC1) Base Address -#define AT91C_BASE_TC2 ((AT91PS_TC) 0xFFFA0080) // (TC2) Base Address -#define AT91C_BASE_TCB ((AT91PS_TCB) 0xFFFA0000) // (TCB) Base Address -#define AT91C_BASE_CAN_MB0 ((AT91PS_CAN_MB) 0xFFFD0200) // (CAN_MB0) Base Address -#define AT91C_BASE_CAN_MB1 ((AT91PS_CAN_MB) 0xFFFD0220) // (CAN_MB1) Base Address -#define AT91C_BASE_CAN_MB2 ((AT91PS_CAN_MB) 0xFFFD0240) // (CAN_MB2) Base Address -#define AT91C_BASE_CAN_MB3 ((AT91PS_CAN_MB) 0xFFFD0260) // (CAN_MB3) Base Address -#define AT91C_BASE_CAN_MB4 ((AT91PS_CAN_MB) 0xFFFD0280) // (CAN_MB4) Base Address -#define AT91C_BASE_CAN_MB5 ((AT91PS_CAN_MB) 0xFFFD02A0) // (CAN_MB5) Base Address -#define AT91C_BASE_CAN_MB6 ((AT91PS_CAN_MB) 0xFFFD02C0) // (CAN_MB6) Base Address -#define AT91C_BASE_CAN_MB7 ((AT91PS_CAN_MB) 0xFFFD02E0) // (CAN_MB7) Base Address -#define AT91C_BASE_CAN ((AT91PS_CAN) 0xFFFD0000) // (CAN) Base Address -#define AT91C_BASE_EMAC ((AT91PS_EMAC) 0xFFFDC000) // (EMAC) Base Address -#define AT91C_BASE_PDC_ADC ((AT91PS_PDC) 0xFFFD8100) // (PDC_ADC) Base Address -#define AT91C_BASE_ADC ((AT91PS_ADC) 0xFFFD8000) // (ADC) Base Address - -// ***************************************************************************** -// MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -// ISRAM -#define AT91C_ISRAM ((char *) 0x00200000) // Internal SRAM base address -#define AT91C_ISRAM_SIZE ((unsigned int) 0x00010000) // Internal SRAM size in byte (64 Kbytes) -// IFLASH -#define AT91C_IFLASH ((char *) 0x00100000) // Internal FLASH base address -#define AT91C_IFLASH_SIZE ((unsigned int) 0x00040000) // Internal FLASH size in byte (256 Kbytes) -#define AT91C_IFLASH_PAGE_SIZE ((unsigned int) 256) // Internal FLASH Page Size: 256 bytes -#define AT91C_IFLASH_LOCK_REGION_SIZE ((unsigned int) 16384) // Internal FLASH Lock Region Size: 16 Kbytes -#define AT91C_IFLASH_NB_OF_PAGES ((unsigned int) 1024) // Internal FLASH Number of Pages: 1024 bytes -#define AT91C_IFLASH_NB_OF_LOCK_BITS ((unsigned int) 16) // Internal FLASH Number of Lock Bits: 16 bytes -#endif /* __IAR_SYSTEMS_ICC__ */ - -#ifdef __IAR_SYSTEMS_ASM__ - -// - Hardware register definition - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR System Peripherals -// - ***************************************************************************** - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Advanced Interrupt Controller -// - ***************************************************************************** -// - -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- -AT91C_AIC_PRIOR EQU (0x7 << 0) ;- (AIC) Priority Level -AT91C_AIC_PRIOR_LOWEST EQU (0x0) ;- (AIC) Lowest priority level -AT91C_AIC_PRIOR_HIGHEST EQU (0x7) ;- (AIC) Highest priority level -AT91C_AIC_SRCTYPE EQU (0x3 << 5) ;- (AIC) Interrupt Source Type -AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL EQU (0x0 << 5) ;- (AIC) Internal Sources Code Label High-level Sensitive -AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL EQU (0x0 << 5) ;- (AIC) External Sources Code Label Low-level Sensitive -AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE EQU (0x1 << 5) ;- (AIC) Internal Sources Code Label Positive Edge triggered -AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE EQU (0x1 << 5) ;- (AIC) External Sources Code Label Negative Edge triggered -AT91C_AIC_SRCTYPE_HIGH_LEVEL EQU (0x2 << 5) ;- (AIC) Internal Or External Sources Code Label High-level Sensitive -AT91C_AIC_SRCTYPE_POSITIVE_EDGE EQU (0x3 << 5) ;- (AIC) Internal Or External Sources Code Label Positive Edge triggered -// - -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- -AT91C_AIC_NFIQ EQU (0x1 << 0) ;- (AIC) NFIQ Status -AT91C_AIC_NIRQ EQU (0x1 << 1) ;- (AIC) NIRQ Status -// - -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- -AT91C_AIC_DCR_PROT EQU (0x1 << 0) ;- (AIC) Protection Mode -AT91C_AIC_DCR_GMSK EQU (0x1 << 1) ;- (AIC) General Mask - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Peripheral DMA Controller -// - ***************************************************************************** -// - -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- -AT91C_PDC_RXTEN EQU (0x1 << 0) ;- (PDC) Receiver Transfer Enable -AT91C_PDC_RXTDIS EQU (0x1 << 1) ;- (PDC) Receiver Transfer Disable -AT91C_PDC_TXTEN EQU (0x1 << 8) ;- (PDC) Transmitter Transfer Enable -AT91C_PDC_TXTDIS EQU (0x1 << 9) ;- (PDC) Transmitter Transfer Disable -// - -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Debug Unit -// - ***************************************************************************** -// - -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- -AT91C_US_RSTRX EQU (0x1 << 2) ;- (DBGU) Reset Receiver -AT91C_US_RSTTX EQU (0x1 << 3) ;- (DBGU) Reset Transmitter -AT91C_US_RXEN EQU (0x1 << 4) ;- (DBGU) Receiver Enable -AT91C_US_RXDIS EQU (0x1 << 5) ;- (DBGU) Receiver Disable -AT91C_US_TXEN EQU (0x1 << 6) ;- (DBGU) Transmitter Enable -AT91C_US_TXDIS EQU (0x1 << 7) ;- (DBGU) Transmitter Disable -AT91C_US_RSTSTA EQU (0x1 << 8) ;- (DBGU) Reset Status Bits -// - -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- -AT91C_US_PAR EQU (0x7 << 9) ;- (DBGU) Parity type -AT91C_US_PAR_EVEN EQU (0x0 << 9) ;- (DBGU) Even Parity -AT91C_US_PAR_ODD EQU (0x1 << 9) ;- (DBGU) Odd Parity -AT91C_US_PAR_SPACE EQU (0x2 << 9) ;- (DBGU) Parity forced to 0 (Space) -AT91C_US_PAR_MARK EQU (0x3 << 9) ;- (DBGU) Parity forced to 1 (Mark) -AT91C_US_PAR_NONE EQU (0x4 << 9) ;- (DBGU) No Parity -AT91C_US_PAR_MULTI_DROP EQU (0x6 << 9) ;- (DBGU) Multi-drop mode -AT91C_US_CHMODE EQU (0x3 << 14) ;- (DBGU) Channel Mode -AT91C_US_CHMODE_NORMAL EQU (0x0 << 14) ;- (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. -AT91C_US_CHMODE_AUTO EQU (0x1 << 14) ;- (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. -AT91C_US_CHMODE_LOCAL EQU (0x2 << 14) ;- (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. -AT91C_US_CHMODE_REMOTE EQU (0x3 << 14) ;- (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. -// - -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- -AT91C_US_RXRDY EQU (0x1 << 0) ;- (DBGU) RXRDY Interrupt -AT91C_US_TXRDY EQU (0x1 << 1) ;- (DBGU) TXRDY Interrupt -AT91C_US_ENDRX EQU (0x1 << 3) ;- (DBGU) End of Receive Transfer Interrupt -AT91C_US_ENDTX EQU (0x1 << 4) ;- (DBGU) End of Transmit Interrupt -AT91C_US_OVRE EQU (0x1 << 5) ;- (DBGU) Overrun Interrupt -AT91C_US_FRAME EQU (0x1 << 6) ;- (DBGU) Framing Error Interrupt -AT91C_US_PARE EQU (0x1 << 7) ;- (DBGU) Parity Error Interrupt -AT91C_US_TXEMPTY EQU (0x1 << 9) ;- (DBGU) TXEMPTY Interrupt -AT91C_US_TXBUFE EQU (0x1 << 11) ;- (DBGU) TXBUFE Interrupt -AT91C_US_RXBUFF EQU (0x1 << 12) ;- (DBGU) RXBUFF Interrupt -AT91C_US_COMM_TX EQU (0x1 << 30) ;- (DBGU) COMM_TX Interrupt -AT91C_US_COMM_RX EQU (0x1 << 31) ;- (DBGU) COMM_RX Interrupt -// - -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// - -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// - -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- -// - -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- -AT91C_US_FORCE_NTRST EQU (0x1 << 0) ;- (DBGU) Force NTRST in JTAG - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Parallel Input Output Controler -// - ***************************************************************************** - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Clock Generator Controler -// - ***************************************************************************** -// - -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- -AT91C_CKGR_MOSCEN EQU (0x1 << 0) ;- (CKGR) Main Oscillator Enable -AT91C_CKGR_OSCBYPASS EQU (0x1 << 1) ;- (CKGR) Main Oscillator Bypass -AT91C_CKGR_OSCOUNT EQU (0xFF << 8) ;- (CKGR) Main Oscillator Start-up Time -// - -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- -AT91C_CKGR_MAINF EQU (0xFFFF << 0) ;- (CKGR) Main Clock Frequency -AT91C_CKGR_MAINRDY EQU (0x1 << 16) ;- (CKGR) Main Clock Ready -// - -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- -AT91C_CKGR_DIV EQU (0xFF << 0) ;- (CKGR) Divider Selected -AT91C_CKGR_DIV_0 EQU (0x0) ;- (CKGR) Divider output is 0 -AT91C_CKGR_DIV_BYPASS EQU (0x1) ;- (CKGR) Divider is bypassed -AT91C_CKGR_PLLCOUNT EQU (0x3F << 8) ;- (CKGR) PLL Counter -AT91C_CKGR_OUT EQU (0x3 << 14) ;- (CKGR) PLL Output Frequency Range -AT91C_CKGR_OUT_0 EQU (0x0 << 14) ;- (CKGR) Please refer to the PLL datasheet -AT91C_CKGR_OUT_1 EQU (0x1 << 14) ;- (CKGR) Please refer to the PLL datasheet -AT91C_CKGR_OUT_2 EQU (0x2 << 14) ;- (CKGR) Please refer to the PLL datasheet -AT91C_CKGR_OUT_3 EQU (0x3 << 14) ;- (CKGR) Please refer to the PLL datasheet -AT91C_CKGR_MUL EQU (0x7FF << 16) ;- (CKGR) PLL Multiplier -AT91C_CKGR_USBDIV EQU (0x3 << 28) ;- (CKGR) Divider for USB Clocks -AT91C_CKGR_USBDIV_0 EQU (0x0 << 28) ;- (CKGR) Divider output is PLL clock output -AT91C_CKGR_USBDIV_1 EQU (0x1 << 28) ;- (CKGR) Divider output is PLL clock output divided by 2 -AT91C_CKGR_USBDIV_2 EQU (0x2 << 28) ;- (CKGR) Divider output is PLL clock output divided by 4 - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Power Management Controler -// - ***************************************************************************** -// - -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- -AT91C_PMC_PCK EQU (0x1 << 0) ;- (PMC) Processor Clock -AT91C_PMC_UDP EQU (0x1 << 7) ;- (PMC) USB Device Port Clock -AT91C_PMC_PCK0 EQU (0x1 << 8) ;- (PMC) Programmable Clock Output -AT91C_PMC_PCK1 EQU (0x1 << 9) ;- (PMC) Programmable Clock Output -AT91C_PMC_PCK2 EQU (0x1 << 10) ;- (PMC) Programmable Clock Output -AT91C_PMC_PCK3 EQU (0x1 << 11) ;- (PMC) Programmable Clock Output -// - -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- -// - -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- -// - -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- -// - -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- -// - -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- -// - -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- -AT91C_PMC_CSS EQU (0x3 << 0) ;- (PMC) Programmable Clock Selection -AT91C_PMC_CSS_SLOW_CLK EQU (0x0) ;- (PMC) Slow Clock is selected -AT91C_PMC_CSS_MAIN_CLK EQU (0x1) ;- (PMC) Main Clock is selected -AT91C_PMC_CSS_PLL_CLK EQU (0x3) ;- (PMC) Clock from PLL is selected -AT91C_PMC_PRES EQU (0x7 << 2) ;- (PMC) Programmable Clock Prescaler -AT91C_PMC_PRES_CLK EQU (0x0 << 2) ;- (PMC) Selected clock -AT91C_PMC_PRES_CLK_2 EQU (0x1 << 2) ;- (PMC) Selected clock divided by 2 -AT91C_PMC_PRES_CLK_4 EQU (0x2 << 2) ;- (PMC) Selected clock divided by 4 -AT91C_PMC_PRES_CLK_8 EQU (0x3 << 2) ;- (PMC) Selected clock divided by 8 -AT91C_PMC_PRES_CLK_16 EQU (0x4 << 2) ;- (PMC) Selected clock divided by 16 -AT91C_PMC_PRES_CLK_32 EQU (0x5 << 2) ;- (PMC) Selected clock divided by 32 -AT91C_PMC_PRES_CLK_64 EQU (0x6 << 2) ;- (PMC) Selected clock divided by 64 -// - -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- -// - -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- -AT91C_PMC_MOSCS EQU (0x1 << 0) ;- (PMC) MOSC Status/Enable/Disable/Mask -AT91C_PMC_LOCK EQU (0x1 << 2) ;- (PMC) PLL Status/Enable/Disable/Mask -AT91C_PMC_MCKRDY EQU (0x1 << 3) ;- (PMC) MCK_RDY Status/Enable/Disable/Mask -AT91C_PMC_PCK0RDY EQU (0x1 << 8) ;- (PMC) PCK0_RDY Status/Enable/Disable/Mask -AT91C_PMC_PCK1RDY EQU (0x1 << 9) ;- (PMC) PCK1_RDY Status/Enable/Disable/Mask -AT91C_PMC_PCK2RDY EQU (0x1 << 10) ;- (PMC) PCK2_RDY Status/Enable/Disable/Mask -AT91C_PMC_PCK3RDY EQU (0x1 << 11) ;- (PMC) PCK3_RDY Status/Enable/Disable/Mask -// - -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- -// - -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- -// - -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Reset Controller Interface -// - ***************************************************************************** -// - -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- -AT91C_RSTC_PROCRST EQU (0x1 << 0) ;- (RSTC) Processor Reset -AT91C_RSTC_PERRST EQU (0x1 << 2) ;- (RSTC) Peripheral Reset -AT91C_RSTC_EXTRST EQU (0x1 << 3) ;- (RSTC) External Reset -AT91C_RSTC_KEY EQU (0xFF << 24) ;- (RSTC) Password -// - -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- -AT91C_RSTC_URSTS EQU (0x1 << 0) ;- (RSTC) User Reset Status -AT91C_RSTC_BODSTS EQU (0x1 << 1) ;- (RSTC) Brownout Detection Status -AT91C_RSTC_RSTTYP EQU (0x7 << 8) ;- (RSTC) Reset Type -AT91C_RSTC_RSTTYP_POWERUP EQU (0x0 << 8) ;- (RSTC) Power-up Reset. VDDCORE rising. -AT91C_RSTC_RSTTYP_WAKEUP EQU (0x1 << 8) ;- (RSTC) WakeUp Reset. VDDCORE rising. -AT91C_RSTC_RSTTYP_WATCHDOG EQU (0x2 << 8) ;- (RSTC) Watchdog Reset. Watchdog overflow occured. -AT91C_RSTC_RSTTYP_SOFTWARE EQU (0x3 << 8) ;- (RSTC) Software Reset. Processor reset required by the software. -AT91C_RSTC_RSTTYP_USER EQU (0x4 << 8) ;- (RSTC) User Reset. NRST pin detected low. -AT91C_RSTC_RSTTYP_BROWNOUT EQU (0x5 << 8) ;- (RSTC) Brownout Reset occured. -AT91C_RSTC_NRSTL EQU (0x1 << 16) ;- (RSTC) NRST pin level -AT91C_RSTC_SRCMP EQU (0x1 << 17) ;- (RSTC) Software Reset Command in Progress. -// - -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- -AT91C_RSTC_URSTEN EQU (0x1 << 0) ;- (RSTC) User Reset Enable -AT91C_RSTC_URSTIEN EQU (0x1 << 4) ;- (RSTC) User Reset Interrupt Enable -AT91C_RSTC_ERSTL EQU (0xF << 8) ;- (RSTC) User Reset Length -AT91C_RSTC_BODIEN EQU (0x1 << 16) ;- (RSTC) Brownout Detection Interrupt Enable - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface -// - ***************************************************************************** -// - -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- -AT91C_RTTC_RTPRES EQU (0xFFFF << 0) ;- (RTTC) Real-time Timer Prescaler Value -AT91C_RTTC_ALMIEN EQU (0x1 << 16) ;- (RTTC) Alarm Interrupt Enable -AT91C_RTTC_RTTINCIEN EQU (0x1 << 17) ;- (RTTC) Real Time Timer Increment Interrupt Enable -AT91C_RTTC_RTTRST EQU (0x1 << 18) ;- (RTTC) Real Time Timer Restart -// - -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- -AT91C_RTTC_ALMV EQU (0x0 << 0) ;- (RTTC) Alarm Value -// - -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- -AT91C_RTTC_CRTV EQU (0x0 << 0) ;- (RTTC) Current Real-time Value -// - -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- -AT91C_RTTC_ALMS EQU (0x1 << 0) ;- (RTTC) Real-time Alarm Status -AT91C_RTTC_RTTINC EQU (0x1 << 1) ;- (RTTC) Real-time Timer Increment - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface -// - ***************************************************************************** -// - -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- -AT91C_PITC_PIV EQU (0xFFFFF << 0) ;- (PITC) Periodic Interval Value -AT91C_PITC_PITEN EQU (0x1 << 24) ;- (PITC) Periodic Interval Timer Enabled -AT91C_PITC_PITIEN EQU (0x1 << 25) ;- (PITC) Periodic Interval Timer Interrupt Enable -// - -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- -AT91C_PITC_PITS EQU (0x1 << 0) ;- (PITC) Periodic Interval Timer Status -// - -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- -AT91C_PITC_CPIV EQU (0xFFFFF << 0) ;- (PITC) Current Periodic Interval Value -AT91C_PITC_PICNT EQU (0xFFF << 20) ;- (PITC) Periodic Interval Counter -// - -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface -// - ***************************************************************************** -// - -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- -AT91C_WDTC_WDRSTT EQU (0x1 << 0) ;- (WDTC) Watchdog Restart -AT91C_WDTC_KEY EQU (0xFF << 24) ;- (WDTC) Watchdog KEY Password -// - -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- -AT91C_WDTC_WDV EQU (0xFFF << 0) ;- (WDTC) Watchdog Timer Restart -AT91C_WDTC_WDFIEN EQU (0x1 << 12) ;- (WDTC) Watchdog Fault Interrupt Enable -AT91C_WDTC_WDRSTEN EQU (0x1 << 13) ;- (WDTC) Watchdog Reset Enable -AT91C_WDTC_WDRPROC EQU (0x1 << 14) ;- (WDTC) Watchdog Timer Restart -AT91C_WDTC_WDDIS EQU (0x1 << 15) ;- (WDTC) Watchdog Disable -AT91C_WDTC_WDD EQU (0xFFF << 16) ;- (WDTC) Watchdog Delta Value -AT91C_WDTC_WDDBGHLT EQU (0x1 << 28) ;- (WDTC) Watchdog Debug Halt -AT91C_WDTC_WDIDLEHLT EQU (0x1 << 29) ;- (WDTC) Watchdog Idle Halt -// - -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- -AT91C_WDTC_WDUNF EQU (0x1 << 0) ;- (WDTC) Watchdog Underflow -AT91C_WDTC_WDERR EQU (0x1 << 1) ;- (WDTC) Watchdog Error - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface -// - ***************************************************************************** -// - -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- -AT91C_VREG_PSTDBY EQU (0x1 << 0) ;- (VREG) Voltage Regulator Power Standby Mode - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Memory Controller Interface -// - ***************************************************************************** -// - -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- -AT91C_MC_RCB EQU (0x1 << 0) ;- (MC) Remap Command Bit -// - -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- -AT91C_MC_UNDADD EQU (0x1 << 0) ;- (MC) Undefined Addess Abort Status -AT91C_MC_MISADD EQU (0x1 << 1) ;- (MC) Misaligned Addess Abort Status -AT91C_MC_ABTSZ EQU (0x3 << 8) ;- (MC) Abort Size Status -AT91C_MC_ABTSZ_BYTE EQU (0x0 << 8) ;- (MC) Byte -AT91C_MC_ABTSZ_HWORD EQU (0x1 << 8) ;- (MC) Half-word -AT91C_MC_ABTSZ_WORD EQU (0x2 << 8) ;- (MC) Word -AT91C_MC_ABTTYP EQU (0x3 << 10) ;- (MC) Abort Type Status -AT91C_MC_ABTTYP_DATAR EQU (0x0 << 10) ;- (MC) Data Read -AT91C_MC_ABTTYP_DATAW EQU (0x1 << 10) ;- (MC) Data Write -AT91C_MC_ABTTYP_FETCH EQU (0x2 << 10) ;- (MC) Code Fetch -AT91C_MC_MST0 EQU (0x1 << 16) ;- (MC) Master 0 Abort Source -AT91C_MC_MST1 EQU (0x1 << 17) ;- (MC) Master 1 Abort Source -AT91C_MC_SVMST0 EQU (0x1 << 24) ;- (MC) Saved Master 0 Abort Source -AT91C_MC_SVMST1 EQU (0x1 << 25) ;- (MC) Saved Master 1 Abort Source -// - -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- -AT91C_MC_FRDY EQU (0x1 << 0) ;- (MC) Flash Ready -AT91C_MC_LOCKE EQU (0x1 << 2) ;- (MC) Lock Error -AT91C_MC_PROGE EQU (0x1 << 3) ;- (MC) Programming Error -AT91C_MC_NEBP EQU (0x1 << 7) ;- (MC) No Erase Before Programming -AT91C_MC_FWS EQU (0x3 << 8) ;- (MC) Flash Wait State -AT91C_MC_FWS_0FWS EQU (0x0 << 8) ;- (MC) 1 cycle for Read, 2 for Write operations -AT91C_MC_FWS_1FWS EQU (0x1 << 8) ;- (MC) 2 cycles for Read, 3 for Write operations -AT91C_MC_FWS_2FWS EQU (0x2 << 8) ;- (MC) 3 cycles for Read, 4 for Write operations -AT91C_MC_FWS_3FWS EQU (0x3 << 8) ;- (MC) 4 cycles for Read, 4 for Write operations -AT91C_MC_FMCN EQU (0xFF << 16) ;- (MC) Flash Microsecond Cycle Number -// - -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- -AT91C_MC_FCMD EQU (0xF << 0) ;- (MC) Flash Command -AT91C_MC_FCMD_START_PROG EQU (0x1) ;- (MC) Starts the programming of th epage specified by PAGEN. -AT91C_MC_FCMD_LOCK EQU (0x2) ;- (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -AT91C_MC_FCMD_PROG_AND_LOCK EQU (0x3) ;- (MC) The lock sequence automatically happens after the programming sequence is completed. -AT91C_MC_FCMD_UNLOCK EQU (0x4) ;- (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -AT91C_MC_FCMD_ERASE_ALL EQU (0x8) ;- (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. -AT91C_MC_FCMD_SET_GP_NVM EQU (0xB) ;- (MC) Set General Purpose NVM bits. -AT91C_MC_FCMD_CLR_GP_NVM EQU (0xD) ;- (MC) Clear General Purpose NVM bits. -AT91C_MC_FCMD_SET_SECURITY EQU (0xF) ;- (MC) Set Security Bit. -AT91C_MC_PAGEN EQU (0x3FF << 8) ;- (MC) Page Number -AT91C_MC_KEY EQU (0xFF << 24) ;- (MC) Writing Protect Key -// - -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- -AT91C_MC_SECURITY EQU (0x1 << 4) ;- (MC) Security Bit Status -AT91C_MC_GPNVM0 EQU (0x1 << 8) ;- (MC) Sector 0 Lock Status -AT91C_MC_GPNVM1 EQU (0x1 << 9) ;- (MC) Sector 1 Lock Status -AT91C_MC_GPNVM2 EQU (0x1 << 10) ;- (MC) Sector 2 Lock Status -AT91C_MC_GPNVM3 EQU (0x1 << 11) ;- (MC) Sector 3 Lock Status -AT91C_MC_GPNVM4 EQU (0x1 << 12) ;- (MC) Sector 4 Lock Status -AT91C_MC_GPNVM5 EQU (0x1 << 13) ;- (MC) Sector 5 Lock Status -AT91C_MC_GPNVM6 EQU (0x1 << 14) ;- (MC) Sector 6 Lock Status -AT91C_MC_GPNVM7 EQU (0x1 << 15) ;- (MC) Sector 7 Lock Status -AT91C_MC_LOCKS0 EQU (0x1 << 16) ;- (MC) Sector 0 Lock Status -AT91C_MC_LOCKS1 EQU (0x1 << 17) ;- (MC) Sector 1 Lock Status -AT91C_MC_LOCKS2 EQU (0x1 << 18) ;- (MC) Sector 2 Lock Status -AT91C_MC_LOCKS3 EQU (0x1 << 19) ;- (MC) Sector 3 Lock Status -AT91C_MC_LOCKS4 EQU (0x1 << 20) ;- (MC) Sector 4 Lock Status -AT91C_MC_LOCKS5 EQU (0x1 << 21) ;- (MC) Sector 5 Lock Status -AT91C_MC_LOCKS6 EQU (0x1 << 22) ;- (MC) Sector 6 Lock Status -AT91C_MC_LOCKS7 EQU (0x1 << 23) ;- (MC) Sector 7 Lock Status -AT91C_MC_LOCKS8 EQU (0x1 << 24) ;- (MC) Sector 8 Lock Status -AT91C_MC_LOCKS9 EQU (0x1 << 25) ;- (MC) Sector 9 Lock Status -AT91C_MC_LOCKS10 EQU (0x1 << 26) ;- (MC) Sector 10 Lock Status -AT91C_MC_LOCKS11 EQU (0x1 << 27) ;- (MC) Sector 11 Lock Status -AT91C_MC_LOCKS12 EQU (0x1 << 28) ;- (MC) Sector 12 Lock Status -AT91C_MC_LOCKS13 EQU (0x1 << 29) ;- (MC) Sector 13 Lock Status -AT91C_MC_LOCKS14 EQU (0x1 << 30) ;- (MC) Sector 14 Lock Status -AT91C_MC_LOCKS15 EQU (0x1 << 31) ;- (MC) Sector 15 Lock Status - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Serial Parallel Interface -// - ***************************************************************************** -// - -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- -AT91C_SPI_SPIEN EQU (0x1 << 0) ;- (SPI) SPI Enable -AT91C_SPI_SPIDIS EQU (0x1 << 1) ;- (SPI) SPI Disable -AT91C_SPI_SWRST EQU (0x1 << 7) ;- (SPI) SPI Software reset -AT91C_SPI_LASTXFER EQU (0x1 << 24) ;- (SPI) SPI Last Transfer -// - -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- -AT91C_SPI_MSTR EQU (0x1 << 0) ;- (SPI) Master/Slave Mode -AT91C_SPI_PS EQU (0x1 << 1) ;- (SPI) Peripheral Select -AT91C_SPI_PS_FIXED EQU (0x0 << 1) ;- (SPI) Fixed Peripheral Select -AT91C_SPI_PS_VARIABLE EQU (0x1 << 1) ;- (SPI) Variable Peripheral Select -AT91C_SPI_PCSDEC EQU (0x1 << 2) ;- (SPI) Chip Select Decode -AT91C_SPI_FDIV EQU (0x1 << 3) ;- (SPI) Clock Selection -AT91C_SPI_MODFDIS EQU (0x1 << 4) ;- (SPI) Mode Fault Detection -AT91C_SPI_LLB EQU (0x1 << 7) ;- (SPI) Clock Selection -AT91C_SPI_PCS EQU (0xF << 16) ;- (SPI) Peripheral Chip Select -AT91C_SPI_DLYBCS EQU (0xFF << 24) ;- (SPI) Delay Between Chip Selects -// - -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- -AT91C_SPI_RD EQU (0xFFFF << 0) ;- (SPI) Receive Data -AT91C_SPI_RPCS EQU (0xF << 16) ;- (SPI) Peripheral Chip Select Status -// - -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- -AT91C_SPI_TD EQU (0xFFFF << 0) ;- (SPI) Transmit Data -AT91C_SPI_TPCS EQU (0xF << 16) ;- (SPI) Peripheral Chip Select Status -// - -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- -AT91C_SPI_RDRF EQU (0x1 << 0) ;- (SPI) Receive Data Register Full -AT91C_SPI_TDRE EQU (0x1 << 1) ;- (SPI) Transmit Data Register Empty -AT91C_SPI_MODF EQU (0x1 << 2) ;- (SPI) Mode Fault Error -AT91C_SPI_OVRES EQU (0x1 << 3) ;- (SPI) Overrun Error Status -AT91C_SPI_ENDRX EQU (0x1 << 4) ;- (SPI) End of Receiver Transfer -AT91C_SPI_ENDTX EQU (0x1 << 5) ;- (SPI) End of Receiver Transfer -AT91C_SPI_RXBUFF EQU (0x1 << 6) ;- (SPI) RXBUFF Interrupt -AT91C_SPI_TXBUFE EQU (0x1 << 7) ;- (SPI) TXBUFE Interrupt -AT91C_SPI_NSSR EQU (0x1 << 8) ;- (SPI) NSSR Interrupt -AT91C_SPI_TXEMPTY EQU (0x1 << 9) ;- (SPI) TXEMPTY Interrupt -AT91C_SPI_SPIENS EQU (0x1 << 16) ;- (SPI) Enable Status -// - -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- -// - -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- -// - -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- -// - -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- -AT91C_SPI_CPOL EQU (0x1 << 0) ;- (SPI) Clock Polarity -AT91C_SPI_NCPHA EQU (0x1 << 1) ;- (SPI) Clock Phase -AT91C_SPI_CSAAT EQU (0x1 << 3) ;- (SPI) Chip Select Active After Transfer -AT91C_SPI_BITS EQU (0xF << 4) ;- (SPI) Bits Per Transfer -AT91C_SPI_BITS_8 EQU (0x0 << 4) ;- (SPI) 8 Bits Per transfer -AT91C_SPI_BITS_9 EQU (0x1 << 4) ;- (SPI) 9 Bits Per transfer -AT91C_SPI_BITS_10 EQU (0x2 << 4) ;- (SPI) 10 Bits Per transfer -AT91C_SPI_BITS_11 EQU (0x3 << 4) ;- (SPI) 11 Bits Per transfer -AT91C_SPI_BITS_12 EQU (0x4 << 4) ;- (SPI) 12 Bits Per transfer -AT91C_SPI_BITS_13 EQU (0x5 << 4) ;- (SPI) 13 Bits Per transfer -AT91C_SPI_BITS_14 EQU (0x6 << 4) ;- (SPI) 14 Bits Per transfer -AT91C_SPI_BITS_15 EQU (0x7 << 4) ;- (SPI) 15 Bits Per transfer -AT91C_SPI_BITS_16 EQU (0x8 << 4) ;- (SPI) 16 Bits Per transfer -AT91C_SPI_SCBR EQU (0xFF << 8) ;- (SPI) Serial Clock Baud Rate -AT91C_SPI_DLYBS EQU (0xFF << 16) ;- (SPI) Delay Before SPCK -AT91C_SPI_DLYBCT EQU (0xFF << 24) ;- (SPI) Delay Between Consecutive Transfers - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Usart -// - ***************************************************************************** -// - -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- -AT91C_US_STTBRK EQU (0x1 << 9) ;- (USART) Start Break -AT91C_US_STPBRK EQU (0x1 << 10) ;- (USART) Stop Break -AT91C_US_STTTO EQU (0x1 << 11) ;- (USART) Start Time-out -AT91C_US_SENDA EQU (0x1 << 12) ;- (USART) Send Address -AT91C_US_RSTIT EQU (0x1 << 13) ;- (USART) Reset Iterations -AT91C_US_RSTNACK EQU (0x1 << 14) ;- (USART) Reset Non Acknowledge -AT91C_US_RETTO EQU (0x1 << 15) ;- (USART) Rearm Time-out -AT91C_US_DTREN EQU (0x1 << 16) ;- (USART) Data Terminal ready Enable -AT91C_US_DTRDIS EQU (0x1 << 17) ;- (USART) Data Terminal ready Disable -AT91C_US_RTSEN EQU (0x1 << 18) ;- (USART) Request to Send enable -AT91C_US_RTSDIS EQU (0x1 << 19) ;- (USART) Request to Send Disable -// - -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- -AT91C_US_USMODE EQU (0xF << 0) ;- (USART) Usart mode -AT91C_US_USMODE_NORMAL EQU (0x0) ;- (USART) Normal -AT91C_US_USMODE_RS485 EQU (0x1) ;- (USART) RS485 -AT91C_US_USMODE_HWHSH EQU (0x2) ;- (USART) Hardware Handshaking -AT91C_US_USMODE_MODEM EQU (0x3) ;- (USART) Modem -AT91C_US_USMODE_ISO7816_0 EQU (0x4) ;- (USART) ISO7816 protocol: T = 0 -AT91C_US_USMODE_ISO7816_1 EQU (0x6) ;- (USART) ISO7816 protocol: T = 1 -AT91C_US_USMODE_IRDA EQU (0x8) ;- (USART) IrDA -AT91C_US_USMODE_SWHSH EQU (0xC) ;- (USART) Software Handshaking -AT91C_US_CLKS EQU (0x3 << 4) ;- (USART) Clock Selection (Baud Rate generator Input Clock -AT91C_US_CLKS_CLOCK EQU (0x0 << 4) ;- (USART) Clock -AT91C_US_CLKS_FDIV1 EQU (0x1 << 4) ;- (USART) fdiv1 -AT91C_US_CLKS_SLOW EQU (0x2 << 4) ;- (USART) slow_clock (ARM) -AT91C_US_CLKS_EXT EQU (0x3 << 4) ;- (USART) External (SCK) -AT91C_US_CHRL EQU (0x3 << 6) ;- (USART) Clock Selection (Baud Rate generator Input Clock -AT91C_US_CHRL_5_BITS EQU (0x0 << 6) ;- (USART) Character Length: 5 bits -AT91C_US_CHRL_6_BITS EQU (0x1 << 6) ;- (USART) Character Length: 6 bits -AT91C_US_CHRL_7_BITS EQU (0x2 << 6) ;- (USART) Character Length: 7 bits -AT91C_US_CHRL_8_BITS EQU (0x3 << 6) ;- (USART) Character Length: 8 bits -AT91C_US_SYNC EQU (0x1 << 8) ;- (USART) Synchronous Mode Select -AT91C_US_NBSTOP EQU (0x3 << 12) ;- (USART) Number of Stop bits -AT91C_US_NBSTOP_1_BIT EQU (0x0 << 12) ;- (USART) 1 stop bit -AT91C_US_NBSTOP_15_BIT EQU (0x1 << 12) ;- (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits -AT91C_US_NBSTOP_2_BIT EQU (0x2 << 12) ;- (USART) 2 stop bits -AT91C_US_MSBF EQU (0x1 << 16) ;- (USART) Bit Order -AT91C_US_MODE9 EQU (0x1 << 17) ;- (USART) 9-bit Character length -AT91C_US_CKLO EQU (0x1 << 18) ;- (USART) Clock Output Select -AT91C_US_OVER EQU (0x1 << 19) ;- (USART) Over Sampling Mode -AT91C_US_INACK EQU (0x1 << 20) ;- (USART) Inhibit Non Acknowledge -AT91C_US_DSNACK EQU (0x1 << 21) ;- (USART) Disable Successive NACK -AT91C_US_MAX_ITER EQU (0x1 << 24) ;- (USART) Number of Repetitions -AT91C_US_FILTER EQU (0x1 << 28) ;- (USART) Receive Line Filter -// - -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- -AT91C_US_RXBRK EQU (0x1 << 2) ;- (USART) Break Received/End of Break -AT91C_US_TIMEOUT EQU (0x1 << 8) ;- (USART) Receiver Time-out -AT91C_US_ITERATION EQU (0x1 << 10) ;- (USART) Max number of Repetitions Reached -AT91C_US_NACK EQU (0x1 << 13) ;- (USART) Non Acknowledge -AT91C_US_RIIC EQU (0x1 << 16) ;- (USART) Ring INdicator Input Change Flag -AT91C_US_DSRIC EQU (0x1 << 17) ;- (USART) Data Set Ready Input Change Flag -AT91C_US_DCDIC EQU (0x1 << 18) ;- (USART) Data Carrier Flag -AT91C_US_CTSIC EQU (0x1 << 19) ;- (USART) Clear To Send Input Change Flag -// - -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// - -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// - -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- -AT91C_US_RI EQU (0x1 << 20) ;- (USART) Image of RI Input -AT91C_US_DSR EQU (0x1 << 21) ;- (USART) Image of DSR Input -AT91C_US_DCD EQU (0x1 << 22) ;- (USART) Image of DCD Input -AT91C_US_CTS EQU (0x1 << 23) ;- (USART) Image of CTS Input - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface -// - ***************************************************************************** -// - -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- -AT91C_SSC_RXEN EQU (0x1 << 0) ;- (SSC) Receive Enable -AT91C_SSC_RXDIS EQU (0x1 << 1) ;- (SSC) Receive Disable -AT91C_SSC_TXEN EQU (0x1 << 8) ;- (SSC) Transmit Enable -AT91C_SSC_TXDIS EQU (0x1 << 9) ;- (SSC) Transmit Disable -AT91C_SSC_SWRST EQU (0x1 << 15) ;- (SSC) Software Reset -// - -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- -AT91C_SSC_CKS EQU (0x3 << 0) ;- (SSC) Receive/Transmit Clock Selection -AT91C_SSC_CKS_DIV EQU (0x0) ;- (SSC) Divided Clock -AT91C_SSC_CKS_TK EQU (0x1) ;- (SSC) TK Clock signal -AT91C_SSC_CKS_RK EQU (0x2) ;- (SSC) RK pin -AT91C_SSC_CKO EQU (0x7 << 2) ;- (SSC) Receive/Transmit Clock Output Mode Selection -AT91C_SSC_CKO_NONE EQU (0x0 << 2) ;- (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only -AT91C_SSC_CKO_CONTINOUS EQU (0x1 << 2) ;- (SSC) Continuous Receive/Transmit Clock RK pin: Output -AT91C_SSC_CKO_DATA_TX EQU (0x2 << 2) ;- (SSC) Receive/Transmit Clock only during data transfers RK pin: Output -AT91C_SSC_CKI EQU (0x1 << 5) ;- (SSC) Receive/Transmit Clock Inversion -AT91C_SSC_CKG EQU (0x3 << 6) ;- (SSC) Receive/Transmit Clock Gating Selection -AT91C_SSC_CKG_NONE EQU (0x0 << 6) ;- (SSC) Receive/Transmit Clock Gating: None, continuous clock -AT91C_SSC_CKG_LOW EQU (0x1 << 6) ;- (SSC) Receive/Transmit Clock enabled only if RF Low -AT91C_SSC_CKG_HIGH EQU (0x2 << 6) ;- (SSC) Receive/Transmit Clock enabled only if RF High -AT91C_SSC_START EQU (0xF << 8) ;- (SSC) Receive/Transmit Start Selection -AT91C_SSC_START_CONTINOUS EQU (0x0 << 8) ;- (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. -AT91C_SSC_START_TX EQU (0x1 << 8) ;- (SSC) Transmit/Receive start -AT91C_SSC_START_LOW_RF EQU (0x2 << 8) ;- (SSC) Detection of a low level on RF input -AT91C_SSC_START_HIGH_RF EQU (0x3 << 8) ;- (SSC) Detection of a high level on RF input -AT91C_SSC_START_FALL_RF EQU (0x4 << 8) ;- (SSC) Detection of a falling edge on RF input -AT91C_SSC_START_RISE_RF EQU (0x5 << 8) ;- (SSC) Detection of a rising edge on RF input -AT91C_SSC_START_LEVEL_RF EQU (0x6 << 8) ;- (SSC) Detection of any level change on RF input -AT91C_SSC_START_EDGE_RF EQU (0x7 << 8) ;- (SSC) Detection of any edge on RF input -AT91C_SSC_START_0 EQU (0x8 << 8) ;- (SSC) Compare 0 -AT91C_SSC_STOP EQU (0x1 << 12) ;- (SSC) Receive Stop Selection -AT91C_SSC_STTDLY EQU (0xFF << 16) ;- (SSC) Receive/Transmit Start Delay -AT91C_SSC_PERIOD EQU (0xFF << 24) ;- (SSC) Receive/Transmit Period Divider Selection -// - -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- -AT91C_SSC_DATLEN EQU (0x1F << 0) ;- (SSC) Data Length -AT91C_SSC_LOOP EQU (0x1 << 5) ;- (SSC) Loop Mode -AT91C_SSC_MSBF EQU (0x1 << 7) ;- (SSC) Most Significant Bit First -AT91C_SSC_DATNB EQU (0xF << 8) ;- (SSC) Data Number per Frame -AT91C_SSC_FSLEN EQU (0xF << 16) ;- (SSC) Receive/Transmit Frame Sync length -AT91C_SSC_FSOS EQU (0x7 << 20) ;- (SSC) Receive/Transmit Frame Sync Output Selection -AT91C_SSC_FSOS_NONE EQU (0x0 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only -AT91C_SSC_FSOS_NEGATIVE EQU (0x1 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse -AT91C_SSC_FSOS_POSITIVE EQU (0x2 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse -AT91C_SSC_FSOS_LOW EQU (0x3 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer -AT91C_SSC_FSOS_HIGH EQU (0x4 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer -AT91C_SSC_FSOS_TOGGLE EQU (0x5 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer -AT91C_SSC_FSEDGE EQU (0x1 << 24) ;- (SSC) Frame Sync Edge Detection -// - -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- -// - -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- -AT91C_SSC_DATDEF EQU (0x1 << 5) ;- (SSC) Data Default Value -AT91C_SSC_FSDEN EQU (0x1 << 23) ;- (SSC) Frame Sync Data Enable -// - -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- -AT91C_SSC_TXRDY EQU (0x1 << 0) ;- (SSC) Transmit Ready -AT91C_SSC_TXEMPTY EQU (0x1 << 1) ;- (SSC) Transmit Empty -AT91C_SSC_ENDTX EQU (0x1 << 2) ;- (SSC) End Of Transmission -AT91C_SSC_TXBUFE EQU (0x1 << 3) ;- (SSC) Transmit Buffer Empty -AT91C_SSC_RXRDY EQU (0x1 << 4) ;- (SSC) Receive Ready -AT91C_SSC_OVRUN EQU (0x1 << 5) ;- (SSC) Receive Overrun -AT91C_SSC_ENDRX EQU (0x1 << 6) ;- (SSC) End of Reception -AT91C_SSC_RXBUFF EQU (0x1 << 7) ;- (SSC) Receive Buffer Full -AT91C_SSC_CP0 EQU (0x1 << 8) ;- (SSC) Compare 0 -AT91C_SSC_CP1 EQU (0x1 << 9) ;- (SSC) Compare 1 -AT91C_SSC_TXSYN EQU (0x1 << 10) ;- (SSC) Transmit Sync -AT91C_SSC_RXSYN EQU (0x1 << 11) ;- (SSC) Receive Sync -AT91C_SSC_TXENA EQU (0x1 << 16) ;- (SSC) Transmit Enable -AT91C_SSC_RXENA EQU (0x1 << 17) ;- (SSC) Receive Enable -// - -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- -// - -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- -// - -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Two-wire Interface -// - ***************************************************************************** -// - -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- -AT91C_TWI_START EQU (0x1 << 0) ;- (TWI) Send a START Condition -AT91C_TWI_STOP EQU (0x1 << 1) ;- (TWI) Send a STOP Condition -AT91C_TWI_MSEN EQU (0x1 << 2) ;- (TWI) TWI Master Transfer Enabled -AT91C_TWI_MSDIS EQU (0x1 << 3) ;- (TWI) TWI Master Transfer Disabled -AT91C_TWI_SWRST EQU (0x1 << 7) ;- (TWI) Software Reset -// - -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- -AT91C_TWI_IADRSZ EQU (0x3 << 8) ;- (TWI) Internal Device Address Size -AT91C_TWI_IADRSZ_NO EQU (0x0 << 8) ;- (TWI) No internal device address -AT91C_TWI_IADRSZ_1_BYTE EQU (0x1 << 8) ;- (TWI) One-byte internal device address -AT91C_TWI_IADRSZ_2_BYTE EQU (0x2 << 8) ;- (TWI) Two-byte internal device address -AT91C_TWI_IADRSZ_3_BYTE EQU (0x3 << 8) ;- (TWI) Three-byte internal device address -AT91C_TWI_MREAD EQU (0x1 << 12) ;- (TWI) Master Read Direction -AT91C_TWI_DADR EQU (0x7F << 16) ;- (TWI) Device Address -// - -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- -AT91C_TWI_CLDIV EQU (0xFF << 0) ;- (TWI) Clock Low Divider -AT91C_TWI_CHDIV EQU (0xFF << 8) ;- (TWI) Clock High Divider -AT91C_TWI_CKDIV EQU (0x7 << 16) ;- (TWI) Clock Divider -// - -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- -AT91C_TWI_TXCOMP EQU (0x1 << 0) ;- (TWI) Transmission Completed -AT91C_TWI_RXRDY EQU (0x1 << 1) ;- (TWI) Receive holding register ReaDY -AT91C_TWI_TXRDY EQU (0x1 << 2) ;- (TWI) Transmit holding register ReaDY -AT91C_TWI_OVRE EQU (0x1 << 6) ;- (TWI) Overrun Error -AT91C_TWI_UNRE EQU (0x1 << 7) ;- (TWI) Underrun Error -AT91C_TWI_NACK EQU (0x1 << 8) ;- (TWI) Not Acknowledged -// - -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- -// - -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- -// - -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR PWMC Channel Interface -// - ***************************************************************************** -// - -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- -AT91C_PWMC_CPRE EQU (0xF << 0) ;- (PWMC_CH) Channel Pre-scaler : PWMC_CLKx -AT91C_PWMC_CPRE_MCK EQU (0x0) ;- (PWMC_CH) -AT91C_PWMC_CPRE_MCKA EQU (0xB) ;- (PWMC_CH) -AT91C_PWMC_CPRE_MCKB EQU (0xC) ;- (PWMC_CH) -AT91C_PWMC_CALG EQU (0x1 << 8) ;- (PWMC_CH) Channel Alignment -AT91C_PWMC_CPOL EQU (0x1 << 9) ;- (PWMC_CH) Channel Polarity -AT91C_PWMC_CPD EQU (0x1 << 10) ;- (PWMC_CH) Channel Update Period -// - -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- -AT91C_PWMC_CDTY EQU (0x0 << 0) ;- (PWMC_CH) Channel Duty Cycle -// - -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- -AT91C_PWMC_CPRD EQU (0x0 << 0) ;- (PWMC_CH) Channel Period -// - -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- -AT91C_PWMC_CCNT EQU (0x0 << 0) ;- (PWMC_CH) Channel Counter -// - -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- -AT91C_PWMC_CUPD EQU (0x0 << 0) ;- (PWMC_CH) Channel Update - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface -// - ***************************************************************************** -// - -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- -AT91C_PWMC_DIVA EQU (0xFF << 0) ;- (PWMC) CLKA divide factor. -AT91C_PWMC_PREA EQU (0xF << 8) ;- (PWMC) Divider Input Clock Prescaler A -AT91C_PWMC_PREA_MCK EQU (0x0 << 8) ;- (PWMC) -AT91C_PWMC_DIVB EQU (0xFF << 16) ;- (PWMC) CLKB divide factor. -AT91C_PWMC_PREB EQU (0xF << 24) ;- (PWMC) Divider Input Clock Prescaler B -AT91C_PWMC_PREB_MCK EQU (0x0 << 24) ;- (PWMC) -// - -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- -AT91C_PWMC_CHID0 EQU (0x1 << 0) ;- (PWMC) Channel ID 0 -AT91C_PWMC_CHID1 EQU (0x1 << 1) ;- (PWMC) Channel ID 1 -AT91C_PWMC_CHID2 EQU (0x1 << 2) ;- (PWMC) Channel ID 2 -AT91C_PWMC_CHID3 EQU (0x1 << 3) ;- (PWMC) Channel ID 3 -// - -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- -// - -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- -// - -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- -// - -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- -// - -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- -// - -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR USB Device Interface -// - ***************************************************************************** -// - -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- -AT91C_UDP_FRM_NUM EQU (0x7FF << 0) ;- (UDP) Frame Number as Defined in the Packet Field Formats -AT91C_UDP_FRM_ERR EQU (0x1 << 16) ;- (UDP) Frame Error -AT91C_UDP_FRM_OK EQU (0x1 << 17) ;- (UDP) Frame OK -// - -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- -AT91C_UDP_FADDEN EQU (0x1 << 0) ;- (UDP) Function Address Enable -AT91C_UDP_CONFG EQU (0x1 << 1) ;- (UDP) Configured -AT91C_UDP_ESR EQU (0x1 << 2) ;- (UDP) Enable Send Resume -AT91C_UDP_RSMINPR EQU (0x1 << 3) ;- (UDP) A Resume Has Been Sent to the Host -AT91C_UDP_RMWUPE EQU (0x1 << 4) ;- (UDP) Remote Wake Up Enable -// - -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- -AT91C_UDP_FADD EQU (0xFF << 0) ;- (UDP) Function Address Value -AT91C_UDP_FEN EQU (0x1 << 8) ;- (UDP) Function Enable -// - -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- -AT91C_UDP_EPINT0 EQU (0x1 << 0) ;- (UDP) Endpoint 0 Interrupt -AT91C_UDP_EPINT1 EQU (0x1 << 1) ;- (UDP) Endpoint 0 Interrupt -AT91C_UDP_EPINT2 EQU (0x1 << 2) ;- (UDP) Endpoint 2 Interrupt -AT91C_UDP_EPINT3 EQU (0x1 << 3) ;- (UDP) Endpoint 3 Interrupt -AT91C_UDP_EPINT4 EQU (0x1 << 4) ;- (UDP) Endpoint 4 Interrupt -AT91C_UDP_EPINT5 EQU (0x1 << 5) ;- (UDP) Endpoint 5 Interrupt -AT91C_UDP_RXSUSP EQU (0x1 << 8) ;- (UDP) USB Suspend Interrupt -AT91C_UDP_RXRSM EQU (0x1 << 9) ;- (UDP) USB Resume Interrupt -AT91C_UDP_EXTRSM EQU (0x1 << 10) ;- (UDP) USB External Resume Interrupt -AT91C_UDP_SOFINT EQU (0x1 << 11) ;- (UDP) USB Start Of frame Interrupt -AT91C_UDP_WAKEUP EQU (0x1 << 13) ;- (UDP) USB Resume Interrupt -// - -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- -// - -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- -// - -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- -AT91C_UDP_ENDBUSRES EQU (0x1 << 12) ;- (UDP) USB End Of Bus Reset Interrupt -// - -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- -// - -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- -AT91C_UDP_EP0 EQU (0x1 << 0) ;- (UDP) Reset Endpoint 0 -AT91C_UDP_EP1 EQU (0x1 << 1) ;- (UDP) Reset Endpoint 1 -AT91C_UDP_EP2 EQU (0x1 << 2) ;- (UDP) Reset Endpoint 2 -AT91C_UDP_EP3 EQU (0x1 << 3) ;- (UDP) Reset Endpoint 3 -AT91C_UDP_EP4 EQU (0x1 << 4) ;- (UDP) Reset Endpoint 4 -AT91C_UDP_EP5 EQU (0x1 << 5) ;- (UDP) Reset Endpoint 5 -// - -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- -AT91C_UDP_TXCOMP EQU (0x1 << 0) ;- (UDP) Generates an IN packet with data previously written in the DPR -AT91C_UDP_RX_DATA_BK0 EQU (0x1 << 1) ;- (UDP) Receive Data Bank 0 -AT91C_UDP_RXSETUP EQU (0x1 << 2) ;- (UDP) Sends STALL to the Host (Control endpoints) -AT91C_UDP_ISOERROR EQU (0x1 << 3) ;- (UDP) Isochronous error (Isochronous endpoints) -AT91C_UDP_TXPKTRDY EQU (0x1 << 4) ;- (UDP) Transmit Packet Ready -AT91C_UDP_FORCESTALL EQU (0x1 << 5) ;- (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). -AT91C_UDP_RX_DATA_BK1 EQU (0x1 << 6) ;- (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). -AT91C_UDP_DIR EQU (0x1 << 7) ;- (UDP) Transfer Direction -AT91C_UDP_EPTYPE EQU (0x7 << 8) ;- (UDP) Endpoint type -AT91C_UDP_EPTYPE_CTRL EQU (0x0 << 8) ;- (UDP) Control -AT91C_UDP_EPTYPE_ISO_OUT EQU (0x1 << 8) ;- (UDP) Isochronous OUT -AT91C_UDP_EPTYPE_BULK_OUT EQU (0x2 << 8) ;- (UDP) Bulk OUT -AT91C_UDP_EPTYPE_INT_OUT EQU (0x3 << 8) ;- (UDP) Interrupt OUT -AT91C_UDP_EPTYPE_ISO_IN EQU (0x5 << 8) ;- (UDP) Isochronous IN -AT91C_UDP_EPTYPE_BULK_IN EQU (0x6 << 8) ;- (UDP) Bulk IN -AT91C_UDP_EPTYPE_INT_IN EQU (0x7 << 8) ;- (UDP) Interrupt IN -AT91C_UDP_DTGLE EQU (0x1 << 11) ;- (UDP) Data Toggle -AT91C_UDP_EPEDS EQU (0x1 << 15) ;- (UDP) Endpoint Enable Disable -AT91C_UDP_RXBYTECNT EQU (0x7FF << 16) ;- (UDP) Number Of Bytes Available in the FIFO -// - -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- -AT91C_UDP_TXVDIS EQU (0x1 << 8) ;- (UDP) -AT91C_UDP_PUON EQU (0x1 << 9) ;- (UDP) Pull-up ON - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Timer Counter Channel Interface -// - ***************************************************************************** -// - -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- -AT91C_TC_CLKEN EQU (0x1 << 0) ;- (TC) Counter Clock Enable Command -AT91C_TC_CLKDIS EQU (0x1 << 1) ;- (TC) Counter Clock Disable Command -AT91C_TC_SWTRG EQU (0x1 << 2) ;- (TC) Software Trigger Command -// - -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- -AT91C_TC_CLKS EQU (0x7 << 0) ;- (TC) Clock Selection -AT91C_TC_CLKS_TIMER_DIV1_CLOCK EQU (0x0) ;- (TC) Clock selected: TIMER_DIV1_CLOCK -AT91C_TC_CLKS_TIMER_DIV2_CLOCK EQU (0x1) ;- (TC) Clock selected: TIMER_DIV2_CLOCK -AT91C_TC_CLKS_TIMER_DIV3_CLOCK EQU (0x2) ;- (TC) Clock selected: TIMER_DIV3_CLOCK -AT91C_TC_CLKS_TIMER_DIV4_CLOCK EQU (0x3) ;- (TC) Clock selected: TIMER_DIV4_CLOCK -AT91C_TC_CLKS_TIMER_DIV5_CLOCK EQU (0x4) ;- (TC) Clock selected: TIMER_DIV5_CLOCK -AT91C_TC_CLKS_XC0 EQU (0x5) ;- (TC) Clock selected: XC0 -AT91C_TC_CLKS_XC1 EQU (0x6) ;- (TC) Clock selected: XC1 -AT91C_TC_CLKS_XC2 EQU (0x7) ;- (TC) Clock selected: XC2 -AT91C_TC_CLKI EQU (0x1 << 3) ;- (TC) Clock Invert -AT91C_TC_BURST EQU (0x3 << 4) ;- (TC) Burst Signal Selection -AT91C_TC_BURST_NONE EQU (0x0 << 4) ;- (TC) The clock is not gated by an external signal -AT91C_TC_BURST_XC0 EQU (0x1 << 4) ;- (TC) XC0 is ANDed with the selected clock -AT91C_TC_BURST_XC1 EQU (0x2 << 4) ;- (TC) XC1 is ANDed with the selected clock -AT91C_TC_BURST_XC2 EQU (0x3 << 4) ;- (TC) XC2 is ANDed with the selected clock -AT91C_TC_CPCSTOP EQU (0x1 << 6) ;- (TC) Counter Clock Stopped with RC Compare -AT91C_TC_LDBSTOP EQU (0x1 << 6) ;- (TC) Counter Clock Stopped with RB Loading -AT91C_TC_CPCDIS EQU (0x1 << 7) ;- (TC) Counter Clock Disable with RC Compare -AT91C_TC_LDBDIS EQU (0x1 << 7) ;- (TC) Counter Clock Disabled with RB Loading -AT91C_TC_ETRGEDG EQU (0x3 << 8) ;- (TC) External Trigger Edge Selection -AT91C_TC_ETRGEDG_NONE EQU (0x0 << 8) ;- (TC) Edge: None -AT91C_TC_ETRGEDG_RISING EQU (0x1 << 8) ;- (TC) Edge: rising edge -AT91C_TC_ETRGEDG_FALLING EQU (0x2 << 8) ;- (TC) Edge: falling edge -AT91C_TC_ETRGEDG_BOTH EQU (0x3 << 8) ;- (TC) Edge: each edge -AT91C_TC_EEVTEDG EQU (0x3 << 8) ;- (TC) External Event Edge Selection -AT91C_TC_EEVTEDG_NONE EQU (0x0 << 8) ;- (TC) Edge: None -AT91C_TC_EEVTEDG_RISING EQU (0x1 << 8) ;- (TC) Edge: rising edge -AT91C_TC_EEVTEDG_FALLING EQU (0x2 << 8) ;- (TC) Edge: falling edge -AT91C_TC_EEVTEDG_BOTH EQU (0x3 << 8) ;- (TC) Edge: each edge -AT91C_TC_EEVT EQU (0x3 << 10) ;- (TC) External Event Selection -AT91C_TC_EEVT_TIOB EQU (0x0 << 10) ;- (TC) Signal selected as external event: TIOB TIOB direction: input -AT91C_TC_EEVT_XC0 EQU (0x1 << 10) ;- (TC) Signal selected as external event: XC0 TIOB direction: output -AT91C_TC_EEVT_XC1 EQU (0x2 << 10) ;- (TC) Signal selected as external event: XC1 TIOB direction: output -AT91C_TC_EEVT_XC2 EQU (0x3 << 10) ;- (TC) Signal selected as external event: XC2 TIOB direction: output -AT91C_TC_ABETRG EQU (0x1 << 10) ;- (TC) TIOA or TIOB External Trigger Selection -AT91C_TC_ENETRG EQU (0x1 << 12) ;- (TC) External Event Trigger enable -AT91C_TC_WAVESEL EQU (0x3 << 13) ;- (TC) Waveform Selection -AT91C_TC_WAVESEL_UP EQU (0x0 << 13) ;- (TC) UP mode without atomatic trigger on RC Compare -AT91C_TC_WAVESEL_UPDOWN EQU (0x1 << 13) ;- (TC) UPDOWN mode without automatic trigger on RC Compare -AT91C_TC_WAVESEL_UP_AUTO EQU (0x2 << 13) ;- (TC) UP mode with automatic trigger on RC Compare -AT91C_TC_WAVESEL_UPDOWN_AUTO EQU (0x3 << 13) ;- (TC) UPDOWN mode with automatic trigger on RC Compare -AT91C_TC_CPCTRG EQU (0x1 << 14) ;- (TC) RC Compare Trigger Enable -AT91C_TC_WAVE EQU (0x1 << 15) ;- (TC) -AT91C_TC_ACPA EQU (0x3 << 16) ;- (TC) RA Compare Effect on TIOA -AT91C_TC_ACPA_NONE EQU (0x0 << 16) ;- (TC) Effect: none -AT91C_TC_ACPA_SET EQU (0x1 << 16) ;- (TC) Effect: set -AT91C_TC_ACPA_CLEAR EQU (0x2 << 16) ;- (TC) Effect: clear -AT91C_TC_ACPA_TOGGLE EQU (0x3 << 16) ;- (TC) Effect: toggle -AT91C_TC_LDRA EQU (0x3 << 16) ;- (TC) RA Loading Selection -AT91C_TC_LDRA_NONE EQU (0x0 << 16) ;- (TC) Edge: None -AT91C_TC_LDRA_RISING EQU (0x1 << 16) ;- (TC) Edge: rising edge of TIOA -AT91C_TC_LDRA_FALLING EQU (0x2 << 16) ;- (TC) Edge: falling edge of TIOA -AT91C_TC_LDRA_BOTH EQU (0x3 << 16) ;- (TC) Edge: each edge of TIOA -AT91C_TC_ACPC EQU (0x3 << 18) ;- (TC) RC Compare Effect on TIOA -AT91C_TC_ACPC_NONE EQU (0x0 << 18) ;- (TC) Effect: none -AT91C_TC_ACPC_SET EQU (0x1 << 18) ;- (TC) Effect: set -AT91C_TC_ACPC_CLEAR EQU (0x2 << 18) ;- (TC) Effect: clear -AT91C_TC_ACPC_TOGGLE EQU (0x3 << 18) ;- (TC) Effect: toggle -AT91C_TC_LDRB EQU (0x3 << 18) ;- (TC) RB Loading Selection -AT91C_TC_LDRB_NONE EQU (0x0 << 18) ;- (TC) Edge: None -AT91C_TC_LDRB_RISING EQU (0x1 << 18) ;- (TC) Edge: rising edge of TIOA -AT91C_TC_LDRB_FALLING EQU (0x2 << 18) ;- (TC) Edge: falling edge of TIOA -AT91C_TC_LDRB_BOTH EQU (0x3 << 18) ;- (TC) Edge: each edge of TIOA -AT91C_TC_AEEVT EQU (0x3 << 20) ;- (TC) External Event Effect on TIOA -AT91C_TC_AEEVT_NONE EQU (0x0 << 20) ;- (TC) Effect: none -AT91C_TC_AEEVT_SET EQU (0x1 << 20) ;- (TC) Effect: set -AT91C_TC_AEEVT_CLEAR EQU (0x2 << 20) ;- (TC) Effect: clear -AT91C_TC_AEEVT_TOGGLE EQU (0x3 << 20) ;- (TC) Effect: toggle -AT91C_TC_ASWTRG EQU (0x3 << 22) ;- (TC) Software Trigger Effect on TIOA -AT91C_TC_ASWTRG_NONE EQU (0x0 << 22) ;- (TC) Effect: none -AT91C_TC_ASWTRG_SET EQU (0x1 << 22) ;- (TC) Effect: set -AT91C_TC_ASWTRG_CLEAR EQU (0x2 << 22) ;- (TC) Effect: clear -AT91C_TC_ASWTRG_TOGGLE EQU (0x3 << 22) ;- (TC) Effect: toggle -AT91C_TC_BCPB EQU (0x3 << 24) ;- (TC) RB Compare Effect on TIOB -AT91C_TC_BCPB_NONE EQU (0x0 << 24) ;- (TC) Effect: none -AT91C_TC_BCPB_SET EQU (0x1 << 24) ;- (TC) Effect: set -AT91C_TC_BCPB_CLEAR EQU (0x2 << 24) ;- (TC) Effect: clear -AT91C_TC_BCPB_TOGGLE EQU (0x3 << 24) ;- (TC) Effect: toggle -AT91C_TC_BCPC EQU (0x3 << 26) ;- (TC) RC Compare Effect on TIOB -AT91C_TC_BCPC_NONE EQU (0x0 << 26) ;- (TC) Effect: none -AT91C_TC_BCPC_SET EQU (0x1 << 26) ;- (TC) Effect: set -AT91C_TC_BCPC_CLEAR EQU (0x2 << 26) ;- (TC) Effect: clear -AT91C_TC_BCPC_TOGGLE EQU (0x3 << 26) ;- (TC) Effect: toggle -AT91C_TC_BEEVT EQU (0x3 << 28) ;- (TC) External Event Effect on TIOB -AT91C_TC_BEEVT_NONE EQU (0x0 << 28) ;- (TC) Effect: none -AT91C_TC_BEEVT_SET EQU (0x1 << 28) ;- (TC) Effect: set -AT91C_TC_BEEVT_CLEAR EQU (0x2 << 28) ;- (TC) Effect: clear -AT91C_TC_BEEVT_TOGGLE EQU (0x3 << 28) ;- (TC) Effect: toggle -AT91C_TC_BSWTRG EQU (0x3 << 30) ;- (TC) Software Trigger Effect on TIOB -AT91C_TC_BSWTRG_NONE EQU (0x0 << 30) ;- (TC) Effect: none -AT91C_TC_BSWTRG_SET EQU (0x1 << 30) ;- (TC) Effect: set -AT91C_TC_BSWTRG_CLEAR EQU (0x2 << 30) ;- (TC) Effect: clear -AT91C_TC_BSWTRG_TOGGLE EQU (0x3 << 30) ;- (TC) Effect: toggle -// - -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- -AT91C_TC_COVFS EQU (0x1 << 0) ;- (TC) Counter Overflow -AT91C_TC_LOVRS EQU (0x1 << 1) ;- (TC) Load Overrun -AT91C_TC_CPAS EQU (0x1 << 2) ;- (TC) RA Compare -AT91C_TC_CPBS EQU (0x1 << 3) ;- (TC) RB Compare -AT91C_TC_CPCS EQU (0x1 << 4) ;- (TC) RC Compare -AT91C_TC_LDRAS EQU (0x1 << 5) ;- (TC) RA Loading -AT91C_TC_LDRBS EQU (0x1 << 6) ;- (TC) RB Loading -AT91C_TC_ETRGS EQU (0x1 << 7) ;- (TC) External Trigger -AT91C_TC_CLKSTA EQU (0x1 << 16) ;- (TC) Clock Enabling -AT91C_TC_MTIOA EQU (0x1 << 17) ;- (TC) TIOA Mirror -AT91C_TC_MTIOB EQU (0x1 << 18) ;- (TC) TIOA Mirror -// - -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- -// - -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- -// - -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Timer Counter Interface -// - ***************************************************************************** -// - -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- -AT91C_TCB_SYNC EQU (0x1 << 0) ;- (TCB) Synchro Command -// - -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- -AT91C_TCB_TC0XC0S EQU (0x3 << 0) ;- (TCB) External Clock Signal 0 Selection -AT91C_TCB_TC0XC0S_TCLK0 EQU (0x0) ;- (TCB) TCLK0 connected to XC0 -AT91C_TCB_TC0XC0S_NONE EQU (0x1) ;- (TCB) None signal connected to XC0 -AT91C_TCB_TC0XC0S_TIOA1 EQU (0x2) ;- (TCB) TIOA1 connected to XC0 -AT91C_TCB_TC0XC0S_TIOA2 EQU (0x3) ;- (TCB) TIOA2 connected to XC0 -AT91C_TCB_TC1XC1S EQU (0x3 << 2) ;- (TCB) External Clock Signal 1 Selection -AT91C_TCB_TC1XC1S_TCLK1 EQU (0x0 << 2) ;- (TCB) TCLK1 connected to XC1 -AT91C_TCB_TC1XC1S_NONE EQU (0x1 << 2) ;- (TCB) None signal connected to XC1 -AT91C_TCB_TC1XC1S_TIOA0 EQU (0x2 << 2) ;- (TCB) TIOA0 connected to XC1 -AT91C_TCB_TC1XC1S_TIOA2 EQU (0x3 << 2) ;- (TCB) TIOA2 connected to XC1 -AT91C_TCB_TC2XC2S EQU (0x3 << 4) ;- (TCB) External Clock Signal 2 Selection -AT91C_TCB_TC2XC2S_TCLK2 EQU (0x0 << 4) ;- (TCB) TCLK2 connected to XC2 -AT91C_TCB_TC2XC2S_NONE EQU (0x1 << 4) ;- (TCB) None signal connected to XC2 -AT91C_TCB_TC2XC2S_TIOA0 EQU (0x2 << 4) ;- (TCB) TIOA0 connected to XC2 -AT91C_TCB_TC2XC2S_TIOA1 EQU (0x3 << 4) ;- (TCB) TIOA2 connected to XC2 - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface -// - ***************************************************************************** -// - -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- -AT91C_CAN_MTIMEMARK EQU (0xFFFF << 0) ;- (CAN_MB) Mailbox Timemark -AT91C_CAN_PRIOR EQU (0xF << 16) ;- (CAN_MB) Mailbox Priority -AT91C_CAN_MOT EQU (0x7 << 24) ;- (CAN_MB) Mailbox Object Type -AT91C_CAN_MOT_DIS EQU (0x0 << 24) ;- (CAN_MB) -AT91C_CAN_MOT_RX EQU (0x1 << 24) ;- (CAN_MB) -AT91C_CAN_MOT_RXOVERWRITE EQU (0x2 << 24) ;- (CAN_MB) -AT91C_CAN_MOT_TX EQU (0x3 << 24) ;- (CAN_MB) -AT91C_CAN_MOT_CONSUMER EQU (0x4 << 24) ;- (CAN_MB) -AT91C_CAN_MOT_PRODUCER EQU (0x5 << 24) ;- (CAN_MB) -// - -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- -AT91C_CAN_MIDvB EQU (0x3FFFF << 0) ;- (CAN_MB) Complementary bits for identifier in extended mode -AT91C_CAN_MIDvA EQU (0x7FF << 18) ;- (CAN_MB) Identifier for standard frame mode -AT91C_CAN_MIDE EQU (0x1 << 29) ;- (CAN_MB) Identifier Version -// - -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- -// - -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- -// - -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- -AT91C_CAN_MTIMESTAMP EQU (0xFFFF << 0) ;- (CAN_MB) Timer Value -AT91C_CAN_MDLC EQU (0xF << 16) ;- (CAN_MB) Mailbox Data Length Code -AT91C_CAN_MRTR EQU (0x1 << 20) ;- (CAN_MB) Mailbox Remote Transmission Request -AT91C_CAN_MABT EQU (0x1 << 22) ;- (CAN_MB) Mailbox Message Abort -AT91C_CAN_MRDY EQU (0x1 << 23) ;- (CAN_MB) Mailbox Ready -AT91C_CAN_MMI EQU (0x1 << 24) ;- (CAN_MB) Mailbox Message Ignored -// - -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- -// - -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- -// - -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- -AT91C_CAN_MACR EQU (0x1 << 22) ;- (CAN_MB) Abort Request for Mailbox -AT91C_CAN_MTCR EQU (0x1 << 23) ;- (CAN_MB) Mailbox Transfer Command - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Control Area Network Interface -// - ***************************************************************************** -// - -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- -AT91C_CAN_CANEN EQU (0x1 << 0) ;- (CAN) CAN Controller Enable -AT91C_CAN_LPM EQU (0x1 << 1) ;- (CAN) Disable/Enable Low Power Mode -AT91C_CAN_ABM EQU (0x1 << 2) ;- (CAN) Disable/Enable Autobaud/Listen Mode -AT91C_CAN_OVL EQU (0x1 << 3) ;- (CAN) Disable/Enable Overload Frame -AT91C_CAN_TEOF EQU (0x1 << 4) ;- (CAN) Time Stamp messages at each end of Frame -AT91C_CAN_TTM EQU (0x1 << 5) ;- (CAN) Disable/Enable Time Trigger Mode -AT91C_CAN_TIMFRZ EQU (0x1 << 6) ;- (CAN) Enable Timer Freeze -AT91C_CAN_DRPT EQU (0x1 << 7) ;- (CAN) Disable Repeat -// - -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- -AT91C_CAN_MB0 EQU (0x1 << 0) ;- (CAN) Mailbox 0 Flag -AT91C_CAN_MB1 EQU (0x1 << 1) ;- (CAN) Mailbox 1 Flag -AT91C_CAN_MB2 EQU (0x1 << 2) ;- (CAN) Mailbox 2 Flag -AT91C_CAN_MB3 EQU (0x1 << 3) ;- (CAN) Mailbox 3 Flag -AT91C_CAN_MB4 EQU (0x1 << 4) ;- (CAN) Mailbox 4 Flag -AT91C_CAN_MB5 EQU (0x1 << 5) ;- (CAN) Mailbox 5 Flag -AT91C_CAN_MB6 EQU (0x1 << 6) ;- (CAN) Mailbox 6 Flag -AT91C_CAN_MB7 EQU (0x1 << 7) ;- (CAN) Mailbox 7 Flag -AT91C_CAN_MB8 EQU (0x1 << 8) ;- (CAN) Mailbox 8 Flag -AT91C_CAN_MB9 EQU (0x1 << 9) ;- (CAN) Mailbox 9 Flag -AT91C_CAN_MB10 EQU (0x1 << 10) ;- (CAN) Mailbox 10 Flag -AT91C_CAN_MB11 EQU (0x1 << 11) ;- (CAN) Mailbox 11 Flag -AT91C_CAN_MB12 EQU (0x1 << 12) ;- (CAN) Mailbox 12 Flag -AT91C_CAN_MB13 EQU (0x1 << 13) ;- (CAN) Mailbox 13 Flag -AT91C_CAN_MB14 EQU (0x1 << 14) ;- (CAN) Mailbox 14 Flag -AT91C_CAN_MB15 EQU (0x1 << 15) ;- (CAN) Mailbox 15 Flag -AT91C_CAN_ERRA EQU (0x1 << 16) ;- (CAN) Error Active Mode Flag -AT91C_CAN_WARN EQU (0x1 << 17) ;- (CAN) Warning Limit Flag -AT91C_CAN_ERRP EQU (0x1 << 18) ;- (CAN) Error Passive Mode Flag -AT91C_CAN_BOFF EQU (0x1 << 19) ;- (CAN) Bus Off Mode Flag -AT91C_CAN_SLEEP EQU (0x1 << 20) ;- (CAN) Sleep Flag -AT91C_CAN_WAKEUP EQU (0x1 << 21) ;- (CAN) Wakeup Flag -AT91C_CAN_TOVF EQU (0x1 << 22) ;- (CAN) Timer Overflow Flag -AT91C_CAN_TSTP EQU (0x1 << 23) ;- (CAN) Timestamp Flag -AT91C_CAN_CERR EQU (0x1 << 24) ;- (CAN) CRC Error -AT91C_CAN_SERR EQU (0x1 << 25) ;- (CAN) Stuffing Error -AT91C_CAN_AERR EQU (0x1 << 26) ;- (CAN) Acknowledgment Error -AT91C_CAN_FERR EQU (0x1 << 27) ;- (CAN) Form Error -AT91C_CAN_BERR EQU (0x1 << 28) ;- (CAN) Bit Error -// - -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- -// - -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- -// - -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- -AT91C_CAN_RBSY EQU (0x1 << 29) ;- (CAN) Receiver Busy -AT91C_CAN_TBSY EQU (0x1 << 30) ;- (CAN) Transmitter Busy -AT91C_CAN_OVLY EQU (0x1 << 31) ;- (CAN) Overload Busy -// - -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- -AT91C_CAN_PHASE2 EQU (0x7 << 0) ;- (CAN) Phase 2 segment -AT91C_CAN_PHASE1 EQU (0x7 << 4) ;- (CAN) Phase 1 segment -AT91C_CAN_PROPAG EQU (0x7 << 8) ;- (CAN) Programmation time segment -AT91C_CAN_SYNC EQU (0x3 << 12) ;- (CAN) Re-synchronization jump width segment -AT91C_CAN_BRP EQU (0x7F << 16) ;- (CAN) Baudrate Prescaler -AT91C_CAN_SMP EQU (0x1 << 24) ;- (CAN) Sampling mode -// - -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- -AT91C_CAN_TIMER EQU (0xFFFF << 0) ;- (CAN) Timer field -// - -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- -// - -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- -AT91C_CAN_REC EQU (0xFF << 0) ;- (CAN) Receive Error Counter -AT91C_CAN_TEC EQU (0xFF << 16) ;- (CAN) Transmit Error Counter -// - -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- -AT91C_CAN_TIMRST EQU (0x1 << 31) ;- (CAN) Timer Reset Field -// - -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 -// - ***************************************************************************** -// - -------- EMAC_NCR : (EMAC Offset: 0x0) -------- -AT91C_EMAC_LB EQU (0x1 << 0) ;- (EMAC) Loopback. Optional. When set, loopback signal is at high level. -AT91C_EMAC_LLB EQU (0x1 << 1) ;- (EMAC) Loopback local. -AT91C_EMAC_RE EQU (0x1 << 2) ;- (EMAC) Receive enable. -AT91C_EMAC_TE EQU (0x1 << 3) ;- (EMAC) Transmit enable. -AT91C_EMAC_MPE EQU (0x1 << 4) ;- (EMAC) Management port enable. -AT91C_EMAC_CLRSTAT EQU (0x1 << 5) ;- (EMAC) Clear statistics registers. -AT91C_EMAC_INCSTAT EQU (0x1 << 6) ;- (EMAC) Increment statistics registers. -AT91C_EMAC_WESTAT EQU (0x1 << 7) ;- (EMAC) Write enable for statistics registers. -AT91C_EMAC_BP EQU (0x1 << 8) ;- (EMAC) Back pressure. -AT91C_EMAC_TSTART EQU (0x1 << 9) ;- (EMAC) Start Transmission. -AT91C_EMAC_THALT EQU (0x1 << 10) ;- (EMAC) Transmission Halt. -AT91C_EMAC_TPFR EQU (0x1 << 11) ;- (EMAC) Transmit pause frame -AT91C_EMAC_TZQ EQU (0x1 << 12) ;- (EMAC) Transmit zero quantum pause frame -// - -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- -AT91C_EMAC_SPD EQU (0x1 << 0) ;- (EMAC) Speed. -AT91C_EMAC_FD EQU (0x1 << 1) ;- (EMAC) Full duplex. -AT91C_EMAC_JFRAME EQU (0x1 << 3) ;- (EMAC) Jumbo Frames. -AT91C_EMAC_CAF EQU (0x1 << 4) ;- (EMAC) Copy all frames. -AT91C_EMAC_NBC EQU (0x1 << 5) ;- (EMAC) No broadcast. -AT91C_EMAC_MTI EQU (0x1 << 6) ;- (EMAC) Multicast hash event enable -AT91C_EMAC_UNI EQU (0x1 << 7) ;- (EMAC) Unicast hash enable. -AT91C_EMAC_BIG EQU (0x1 << 8) ;- (EMAC) Receive 1522 bytes. -AT91C_EMAC_EAE EQU (0x1 << 9) ;- (EMAC) External address match enable. -AT91C_EMAC_CLK EQU (0x3 << 10) ;- (EMAC) -AT91C_EMAC_CLK_HCLK_8 EQU (0x0 << 10) ;- (EMAC) HCLK divided by 8 -AT91C_EMAC_CLK_HCLK_16 EQU (0x1 << 10) ;- (EMAC) HCLK divided by 16 -AT91C_EMAC_CLK_HCLK_32 EQU (0x2 << 10) ;- (EMAC) HCLK divided by 32 -AT91C_EMAC_CLK_HCLK_64 EQU (0x3 << 10) ;- (EMAC) HCLK divided by 64 -AT91C_EMAC_RTY EQU (0x1 << 12) ;- (EMAC) -AT91C_EMAC_PAE EQU (0x1 << 13) ;- (EMAC) -AT91C_EMAC_RBOF EQU (0x3 << 14) ;- (EMAC) -AT91C_EMAC_RBOF_OFFSET_0 EQU (0x0 << 14) ;- (EMAC) no offset from start of receive buffer -AT91C_EMAC_RBOF_OFFSET_1 EQU (0x1 << 14) ;- (EMAC) one byte offset from start of receive buffer -AT91C_EMAC_RBOF_OFFSET_2 EQU (0x2 << 14) ;- (EMAC) two bytes offset from start of receive buffer -AT91C_EMAC_RBOF_OFFSET_3 EQU (0x3 << 14) ;- (EMAC) three bytes offset from start of receive buffer -AT91C_EMAC_RLCE EQU (0x1 << 16) ;- (EMAC) Receive Length field Checking Enable -AT91C_EMAC_DRFCS EQU (0x1 << 17) ;- (EMAC) Discard Receive FCS -AT91C_EMAC_EFRHD EQU (0x1 << 18) ;- (EMAC) -AT91C_EMAC_IRXFCS EQU (0x1 << 19) ;- (EMAC) Ignore RX FCS -// - -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- -AT91C_EMAC_LINKR EQU (0x1 << 0) ;- (EMAC) -AT91C_EMAC_MDIO EQU (0x1 << 1) ;- (EMAC) -AT91C_EMAC_IDLE EQU (0x1 << 2) ;- (EMAC) -// - -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- -AT91C_EMAC_UBR EQU (0x1 << 0) ;- (EMAC) -AT91C_EMAC_COL EQU (0x1 << 1) ;- (EMAC) -AT91C_EMAC_RLES EQU (0x1 << 2) ;- (EMAC) -AT91C_EMAC_TGO EQU (0x1 << 3) ;- (EMAC) Transmit Go -AT91C_EMAC_BEX EQU (0x1 << 4) ;- (EMAC) Buffers exhausted mid frame -AT91C_EMAC_COMP EQU (0x1 << 5) ;- (EMAC) -AT91C_EMAC_UND EQU (0x1 << 6) ;- (EMAC) -// - -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- -AT91C_EMAC_BNA EQU (0x1 << 0) ;- (EMAC) -AT91C_EMAC_REC EQU (0x1 << 1) ;- (EMAC) -AT91C_EMAC_OVR EQU (0x1 << 2) ;- (EMAC) -// - -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- -AT91C_EMAC_MFD EQU (0x1 << 0) ;- (EMAC) -AT91C_EMAC_RCOMP EQU (0x1 << 1) ;- (EMAC) -AT91C_EMAC_RXUBR EQU (0x1 << 2) ;- (EMAC) -AT91C_EMAC_TXUBR EQU (0x1 << 3) ;- (EMAC) -AT91C_EMAC_TUNDR EQU (0x1 << 4) ;- (EMAC) -AT91C_EMAC_RLEX EQU (0x1 << 5) ;- (EMAC) -AT91C_EMAC_TXERR EQU (0x1 << 6) ;- (EMAC) -AT91C_EMAC_TCOMP EQU (0x1 << 7) ;- (EMAC) -AT91C_EMAC_LINK EQU (0x1 << 9) ;- (EMAC) -AT91C_EMAC_ROVR EQU (0x1 << 10) ;- (EMAC) -AT91C_EMAC_HRESP EQU (0x1 << 11) ;- (EMAC) -AT91C_EMAC_PFRE EQU (0x1 << 12) ;- (EMAC) -AT91C_EMAC_PTZ EQU (0x1 << 13) ;- (EMAC) -// - -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- -// - -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- -// - -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- -// - -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- -AT91C_EMAC_DATA EQU (0xFFFF << 0) ;- (EMAC) -AT91C_EMAC_CODE EQU (0x3 << 16) ;- (EMAC) -AT91C_EMAC_REGA EQU (0x1F << 18) ;- (EMAC) -AT91C_EMAC_PHYA EQU (0x1F << 23) ;- (EMAC) -AT91C_EMAC_RW EQU (0x3 << 28) ;- (EMAC) -AT91C_EMAC_SOF EQU (0x3 << 30) ;- (EMAC) -// - -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- -AT91C_EMAC_RMII EQU (0x1 << 0) ;- (EMAC) Reduce MII -AT91C_EMAC_CLKEN EQU (0x1 << 1) ;- (EMAC) Clock Enable -// - -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- -AT91C_EMAC_IP EQU (0xFFFF << 0) ;- (EMAC) ARP request IP address -AT91C_EMAC_MAG EQU (0x1 << 16) ;- (EMAC) Magic packet event enable -AT91C_EMAC_ARP EQU (0x1 << 17) ;- (EMAC) ARP request event enable -AT91C_EMAC_SA1 EQU (0x1 << 18) ;- (EMAC) Specific address register 1 event enable -// - -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- -AT91C_EMAC_REVREF EQU (0xFFFF << 0) ;- (EMAC) -AT91C_EMAC_PARTREF EQU (0xFFFF << 16) ;- (EMAC) - -// - ***************************************************************************** -// - SOFTWARE API DEFINITION FOR Analog to Digital Convertor -// - ***************************************************************************** -// - -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- -AT91C_ADC_SWRST EQU (0x1 << 0) ;- (ADC) Software Reset -AT91C_ADC_START EQU (0x1 << 1) ;- (ADC) Start Conversion -// - -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- -AT91C_ADC_TRGEN EQU (0x1 << 0) ;- (ADC) Trigger Enable -AT91C_ADC_TRGEN_DIS EQU (0x0) ;- (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software -AT91C_ADC_TRGEN_EN EQU (0x1) ;- (ADC) Hardware trigger selected by TRGSEL field is enabled. -AT91C_ADC_TRGSEL EQU (0x7 << 1) ;- (ADC) Trigger Selection -AT91C_ADC_TRGSEL_TIOA0 EQU (0x0 << 1) ;- (ADC) Selected TRGSEL = TIAO0 -AT91C_ADC_TRGSEL_TIOA1 EQU (0x1 << 1) ;- (ADC) Selected TRGSEL = TIAO1 -AT91C_ADC_TRGSEL_TIOA2 EQU (0x2 << 1) ;- (ADC) Selected TRGSEL = TIAO2 -AT91C_ADC_TRGSEL_TIOA3 EQU (0x3 << 1) ;- (ADC) Selected TRGSEL = TIAO3 -AT91C_ADC_TRGSEL_TIOA4 EQU (0x4 << 1) ;- (ADC) Selected TRGSEL = TIAO4 -AT91C_ADC_TRGSEL_TIOA5 EQU (0x5 << 1) ;- (ADC) Selected TRGSEL = TIAO5 -AT91C_ADC_TRGSEL_EXT EQU (0x6 << 1) ;- (ADC) Selected TRGSEL = External Trigger -AT91C_ADC_LOWRES EQU (0x1 << 4) ;- (ADC) Resolution. -AT91C_ADC_LOWRES_10_BIT EQU (0x0 << 4) ;- (ADC) 10-bit resolution -AT91C_ADC_LOWRES_8_BIT EQU (0x1 << 4) ;- (ADC) 8-bit resolution -AT91C_ADC_SLEEP EQU (0x1 << 5) ;- (ADC) Sleep Mode -AT91C_ADC_SLEEP_NORMAL_MODE EQU (0x0 << 5) ;- (ADC) Normal Mode -AT91C_ADC_SLEEP_MODE EQU (0x1 << 5) ;- (ADC) Sleep Mode -AT91C_ADC_PRESCAL EQU (0x3F << 8) ;- (ADC) Prescaler rate selection -AT91C_ADC_STARTUP EQU (0x1F << 16) ;- (ADC) Startup Time -AT91C_ADC_SHTIM EQU (0xF << 24) ;- (ADC) Sample & Hold Time -// - -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- -AT91C_ADC_CH0 EQU (0x1 << 0) ;- (ADC) Channel 0 -AT91C_ADC_CH1 EQU (0x1 << 1) ;- (ADC) Channel 1 -AT91C_ADC_CH2 EQU (0x1 << 2) ;- (ADC) Channel 2 -AT91C_ADC_CH3 EQU (0x1 << 3) ;- (ADC) Channel 3 -AT91C_ADC_CH4 EQU (0x1 << 4) ;- (ADC) Channel 4 -AT91C_ADC_CH5 EQU (0x1 << 5) ;- (ADC) Channel 5 -AT91C_ADC_CH6 EQU (0x1 << 6) ;- (ADC) Channel 6 -AT91C_ADC_CH7 EQU (0x1 << 7) ;- (ADC) Channel 7 -// - -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- -// - -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- -// - -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- -AT91C_ADC_EOC0 EQU (0x1 << 0) ;- (ADC) End of Conversion -AT91C_ADC_EOC1 EQU (0x1 << 1) ;- (ADC) End of Conversion -AT91C_ADC_EOC2 EQU (0x1 << 2) ;- (ADC) End of Conversion -AT91C_ADC_EOC3 EQU (0x1 << 3) ;- (ADC) End of Conversion -AT91C_ADC_EOC4 EQU (0x1 << 4) ;- (ADC) End of Conversion -AT91C_ADC_EOC5 EQU (0x1 << 5) ;- (ADC) End of Conversion -AT91C_ADC_EOC6 EQU (0x1 << 6) ;- (ADC) End of Conversion -AT91C_ADC_EOC7 EQU (0x1 << 7) ;- (ADC) End of Conversion -AT91C_ADC_OVRE0 EQU (0x1 << 8) ;- (ADC) Overrun Error -AT91C_ADC_OVRE1 EQU (0x1 << 9) ;- (ADC) Overrun Error -AT91C_ADC_OVRE2 EQU (0x1 << 10) ;- (ADC) Overrun Error -AT91C_ADC_OVRE3 EQU (0x1 << 11) ;- (ADC) Overrun Error -AT91C_ADC_OVRE4 EQU (0x1 << 12) ;- (ADC) Overrun Error -AT91C_ADC_OVRE5 EQU (0x1 << 13) ;- (ADC) Overrun Error -AT91C_ADC_OVRE6 EQU (0x1 << 14) ;- (ADC) Overrun Error -AT91C_ADC_OVRE7 EQU (0x1 << 15) ;- (ADC) Overrun Error -AT91C_ADC_DRDY EQU (0x1 << 16) ;- (ADC) Data Ready -AT91C_ADC_GOVRE EQU (0x1 << 17) ;- (ADC) General Overrun -AT91C_ADC_ENDRX EQU (0x1 << 18) ;- (ADC) End of Receiver Transfer -AT91C_ADC_RXBUFF EQU (0x1 << 19) ;- (ADC) RXBUFF Interrupt -// - -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- -AT91C_ADC_LDATA EQU (0x3FF << 0) ;- (ADC) Last Data Converted -// - -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- -// - -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- -// - -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- -// - -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- -AT91C_ADC_DATA EQU (0x3FF << 0) ;- (ADC) Converted Data -// - -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- -// - -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- -// - -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- -// - -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- -// - -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- -// - -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- -// - -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- - -// - ***************************************************************************** -// - REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 -// - ***************************************************************************** -// - ========== Register definition for SYS peripheral ========== -// - ========== Register definition for AIC peripheral ========== -AT91C_AIC_IVR EQU (0xFFFFF100) ;- (AIC) IRQ Vector Register -AT91C_AIC_SMR EQU (0xFFFFF000) ;- (AIC) Source Mode Register -AT91C_AIC_FVR EQU (0xFFFFF104) ;- (AIC) FIQ Vector Register -AT91C_AIC_DCR EQU (0xFFFFF138) ;- (AIC) Debug Control Register (Protect) -AT91C_AIC_EOICR EQU (0xFFFFF130) ;- (AIC) End of Interrupt Command Register -AT91C_AIC_SVR EQU (0xFFFFF080) ;- (AIC) Source Vector Register -AT91C_AIC_FFSR EQU (0xFFFFF148) ;- (AIC) Fast Forcing Status Register -AT91C_AIC_ICCR EQU (0xFFFFF128) ;- (AIC) Interrupt Clear Command Register -AT91C_AIC_ISR EQU (0xFFFFF108) ;- (AIC) Interrupt Status Register -AT91C_AIC_IMR EQU (0xFFFFF110) ;- (AIC) Interrupt Mask Register -AT91C_AIC_IPR EQU (0xFFFFF10C) ;- (AIC) Interrupt Pending Register -AT91C_AIC_FFER EQU (0xFFFFF140) ;- (AIC) Fast Forcing Enable Register -AT91C_AIC_IECR EQU (0xFFFFF120) ;- (AIC) Interrupt Enable Command Register -AT91C_AIC_ISCR EQU (0xFFFFF12C) ;- (AIC) Interrupt Set Command Register -AT91C_AIC_FFDR EQU (0xFFFFF144) ;- (AIC) Fast Forcing Disable Register -AT91C_AIC_CISR EQU (0xFFFFF114) ;- (AIC) Core Interrupt Status Register -AT91C_AIC_IDCR EQU (0xFFFFF124) ;- (AIC) Interrupt Disable Command Register -AT91C_AIC_SPU EQU (0xFFFFF134) ;- (AIC) Spurious Vector Register -// - ========== Register definition for PDC_DBGU peripheral ========== -AT91C_DBGU_TCR EQU (0xFFFFF30C) ;- (PDC_DBGU) Transmit Counter Register -AT91C_DBGU_RNPR EQU (0xFFFFF310) ;- (PDC_DBGU) Receive Next Pointer Register -AT91C_DBGU_TNPR EQU (0xFFFFF318) ;- (PDC_DBGU) Transmit Next Pointer Register -AT91C_DBGU_TPR EQU (0xFFFFF308) ;- (PDC_DBGU) Transmit Pointer Register -AT91C_DBGU_RPR EQU (0xFFFFF300) ;- (PDC_DBGU) Receive Pointer Register -AT91C_DBGU_RCR EQU (0xFFFFF304) ;- (PDC_DBGU) Receive Counter Register -AT91C_DBGU_RNCR EQU (0xFFFFF314) ;- (PDC_DBGU) Receive Next Counter Register -AT91C_DBGU_PTCR EQU (0xFFFFF320) ;- (PDC_DBGU) PDC Transfer Control Register -AT91C_DBGU_PTSR EQU (0xFFFFF324) ;- (PDC_DBGU) PDC Transfer Status Register -AT91C_DBGU_TNCR EQU (0xFFFFF31C) ;- (PDC_DBGU) Transmit Next Counter Register -// - ========== Register definition for DBGU peripheral ========== -AT91C_DBGU_EXID EQU (0xFFFFF244) ;- (DBGU) Chip ID Extension Register -AT91C_DBGU_BRGR EQU (0xFFFFF220) ;- (DBGU) Baud Rate Generator Register -AT91C_DBGU_IDR EQU (0xFFFFF20C) ;- (DBGU) Interrupt Disable Register -AT91C_DBGU_CSR EQU (0xFFFFF214) ;- (DBGU) Channel Status Register -AT91C_DBGU_CIDR EQU (0xFFFFF240) ;- (DBGU) Chip ID Register -AT91C_DBGU_MR EQU (0xFFFFF204) ;- (DBGU) Mode Register -AT91C_DBGU_IMR EQU (0xFFFFF210) ;- (DBGU) Interrupt Mask Register -AT91C_DBGU_CR EQU (0xFFFFF200) ;- (DBGU) Control Register -AT91C_DBGU_FNTR EQU (0xFFFFF248) ;- (DBGU) Force NTRST Register -AT91C_DBGU_THR EQU (0xFFFFF21C) ;- (DBGU) Transmitter Holding Register -AT91C_DBGU_RHR EQU (0xFFFFF218) ;- (DBGU) Receiver Holding Register -AT91C_DBGU_IER EQU (0xFFFFF208) ;- (DBGU) Interrupt Enable Register -// - ========== Register definition for PIOA peripheral ========== -AT91C_PIOA_ODR EQU (0xFFFFF414) ;- (PIOA) Output Disable Registerr -AT91C_PIOA_SODR EQU (0xFFFFF430) ;- (PIOA) Set Output Data Register -AT91C_PIOA_ISR EQU (0xFFFFF44C) ;- (PIOA) Interrupt Status Register -AT91C_PIOA_ABSR EQU (0xFFFFF478) ;- (PIOA) AB Select Status Register -AT91C_PIOA_IER EQU (0xFFFFF440) ;- (PIOA) Interrupt Enable Register -AT91C_PIOA_PPUDR EQU (0xFFFFF460) ;- (PIOA) Pull-up Disable Register -AT91C_PIOA_IMR EQU (0xFFFFF448) ;- (PIOA) Interrupt Mask Register -AT91C_PIOA_PER EQU (0xFFFFF400) ;- (PIOA) PIO Enable Register -AT91C_PIOA_IFDR EQU (0xFFFFF424) ;- (PIOA) Input Filter Disable Register -AT91C_PIOA_OWDR EQU (0xFFFFF4A4) ;- (PIOA) Output Write Disable Register -AT91C_PIOA_MDSR EQU (0xFFFFF458) ;- (PIOA) Multi-driver Status Register -AT91C_PIOA_IDR EQU (0xFFFFF444) ;- (PIOA) Interrupt Disable Register -AT91C_PIOA_ODSR EQU (0xFFFFF438) ;- (PIOA) Output Data Status Register -AT91C_PIOA_PPUSR EQU (0xFFFFF468) ;- (PIOA) Pull-up Status Register -AT91C_PIOA_OWSR EQU (0xFFFFF4A8) ;- (PIOA) Output Write Status Register -AT91C_PIOA_BSR EQU (0xFFFFF474) ;- (PIOA) Select B Register -AT91C_PIOA_OWER EQU (0xFFFFF4A0) ;- (PIOA) Output Write Enable Register -AT91C_PIOA_IFER EQU (0xFFFFF420) ;- (PIOA) Input Filter Enable Register -AT91C_PIOA_PDSR EQU (0xFFFFF43C) ;- (PIOA) Pin Data Status Register -AT91C_PIOA_PPUER EQU (0xFFFFF464) ;- (PIOA) Pull-up Enable Register -AT91C_PIOA_OSR EQU (0xFFFFF418) ;- (PIOA) Output Status Register -AT91C_PIOA_ASR EQU (0xFFFFF470) ;- (PIOA) Select A Register -AT91C_PIOA_MDDR EQU (0xFFFFF454) ;- (PIOA) Multi-driver Disable Register -AT91C_PIOA_CODR EQU (0xFFFFF434) ;- (PIOA) Clear Output Data Register -AT91C_PIOA_MDER EQU (0xFFFFF450) ;- (PIOA) Multi-driver Enable Register -AT91C_PIOA_PDR EQU (0xFFFFF404) ;- (PIOA) PIO Disable Register -AT91C_PIOA_IFSR EQU (0xFFFFF428) ;- (PIOA) Input Filter Status Register -AT91C_PIOA_OER EQU (0xFFFFF410) ;- (PIOA) Output Enable Register -AT91C_PIOA_PSR EQU (0xFFFFF408) ;- (PIOA) PIO Status Register -// - ========== Register definition for PIOB peripheral ========== -AT91C_PIOB_OWDR EQU (0xFFFFF6A4) ;- (PIOB) Output Write Disable Register -AT91C_PIOB_MDER EQU (0xFFFFF650) ;- (PIOB) Multi-driver Enable Register -AT91C_PIOB_PPUSR EQU (0xFFFFF668) ;- (PIOB) Pull-up Status Register -AT91C_PIOB_IMR EQU (0xFFFFF648) ;- (PIOB) Interrupt Mask Register -AT91C_PIOB_ASR EQU (0xFFFFF670) ;- (PIOB) Select A Register -AT91C_PIOB_PPUDR EQU (0xFFFFF660) ;- (PIOB) Pull-up Disable Register -AT91C_PIOB_PSR EQU (0xFFFFF608) ;- (PIOB) PIO Status Register -AT91C_PIOB_IER EQU (0xFFFFF640) ;- (PIOB) Interrupt Enable Register -AT91C_PIOB_CODR EQU (0xFFFFF634) ;- (PIOB) Clear Output Data Register -AT91C_PIOB_OWER EQU (0xFFFFF6A0) ;- (PIOB) Output Write Enable Register -AT91C_PIOB_ABSR EQU (0xFFFFF678) ;- (PIOB) AB Select Status Register -AT91C_PIOB_IFDR EQU (0xFFFFF624) ;- (PIOB) Input Filter Disable Register -AT91C_PIOB_PDSR EQU (0xFFFFF63C) ;- (PIOB) Pin Data Status Register -AT91C_PIOB_IDR EQU (0xFFFFF644) ;- (PIOB) Interrupt Disable Register -AT91C_PIOB_OWSR EQU (0xFFFFF6A8) ;- (PIOB) Output Write Status Register -AT91C_PIOB_PDR EQU (0xFFFFF604) ;- (PIOB) PIO Disable Register -AT91C_PIOB_ODR EQU (0xFFFFF614) ;- (PIOB) Output Disable Registerr -AT91C_PIOB_IFSR EQU (0xFFFFF628) ;- (PIOB) Input Filter Status Register -AT91C_PIOB_PPUER EQU (0xFFFFF664) ;- (PIOB) Pull-up Enable Register -AT91C_PIOB_SODR EQU (0xFFFFF630) ;- (PIOB) Set Output Data Register -AT91C_PIOB_ISR EQU (0xFFFFF64C) ;- (PIOB) Interrupt Status Register -AT91C_PIOB_ODSR EQU (0xFFFFF638) ;- (PIOB) Output Data Status Register -AT91C_PIOB_OSR EQU (0xFFFFF618) ;- (PIOB) Output Status Register -AT91C_PIOB_MDSR EQU (0xFFFFF658) ;- (PIOB) Multi-driver Status Register -AT91C_PIOB_IFER EQU (0xFFFFF620) ;- (PIOB) Input Filter Enable Register -AT91C_PIOB_BSR EQU (0xFFFFF674) ;- (PIOB) Select B Register -AT91C_PIOB_MDDR EQU (0xFFFFF654) ;- (PIOB) Multi-driver Disable Register -AT91C_PIOB_OER EQU (0xFFFFF610) ;- (PIOB) Output Enable Register -AT91C_PIOB_PER EQU (0xFFFFF600) ;- (PIOB) PIO Enable Register -// - ========== Register definition for CKGR peripheral ========== -AT91C_CKGR_MOR EQU (0xFFFFFC20) ;- (CKGR) Main Oscillator Register -AT91C_CKGR_PLLR EQU (0xFFFFFC2C) ;- (CKGR) PLL Register -AT91C_CKGR_MCFR EQU (0xFFFFFC24) ;- (CKGR) Main Clock Frequency Register -// - ========== Register definition for PMC peripheral ========== -AT91C_PMC_IDR EQU (0xFFFFFC64) ;- (PMC) Interrupt Disable Register -AT91C_PMC_MOR EQU (0xFFFFFC20) ;- (PMC) Main Oscillator Register -AT91C_PMC_PLLR EQU (0xFFFFFC2C) ;- (PMC) PLL Register -AT91C_PMC_PCER EQU (0xFFFFFC10) ;- (PMC) Peripheral Clock Enable Register -AT91C_PMC_PCKR EQU (0xFFFFFC40) ;- (PMC) Programmable Clock Register -AT91C_PMC_MCKR EQU (0xFFFFFC30) ;- (PMC) Master Clock Register -AT91C_PMC_SCDR EQU (0xFFFFFC04) ;- (PMC) System Clock Disable Register -AT91C_PMC_PCDR EQU (0xFFFFFC14) ;- (PMC) Peripheral Clock Disable Register -AT91C_PMC_SCSR EQU (0xFFFFFC08) ;- (PMC) System Clock Status Register -AT91C_PMC_PCSR EQU (0xFFFFFC18) ;- (PMC) Peripheral Clock Status Register -AT91C_PMC_MCFR EQU (0xFFFFFC24) ;- (PMC) Main Clock Frequency Register -AT91C_PMC_SCER EQU (0xFFFFFC00) ;- (PMC) System Clock Enable Register -AT91C_PMC_IMR EQU (0xFFFFFC6C) ;- (PMC) Interrupt Mask Register -AT91C_PMC_IER EQU (0xFFFFFC60) ;- (PMC) Interrupt Enable Register -AT91C_PMC_SR EQU (0xFFFFFC68) ;- (PMC) Status Register -// - ========== Register definition for RSTC peripheral ========== -AT91C_RSTC_RCR EQU (0xFFFFFD00) ;- (RSTC) Reset Control Register -AT91C_RSTC_RMR EQU (0xFFFFFD08) ;- (RSTC) Reset Mode Register -AT91C_RSTC_RSR EQU (0xFFFFFD04) ;- (RSTC) Reset Status Register -// - ========== Register definition for RTTC peripheral ========== -AT91C_RTTC_RTSR EQU (0xFFFFFD2C) ;- (RTTC) Real-time Status Register -AT91C_RTTC_RTMR EQU (0xFFFFFD20) ;- (RTTC) Real-time Mode Register -AT91C_RTTC_RTVR EQU (0xFFFFFD28) ;- (RTTC) Real-time Value Register -AT91C_RTTC_RTAR EQU (0xFFFFFD24) ;- (RTTC) Real-time Alarm Register -// - ========== Register definition for PITC peripheral ========== -AT91C_PITC_PIVR EQU (0xFFFFFD38) ;- (PITC) Period Interval Value Register -AT91C_PITC_PISR EQU (0xFFFFFD34) ;- (PITC) Period Interval Status Register -AT91C_PITC_PIIR EQU (0xFFFFFD3C) ;- (PITC) Period Interval Image Register -AT91C_PITC_PIMR EQU (0xFFFFFD30) ;- (PITC) Period Interval Mode Register -// - ========== Register definition for WDTC peripheral ========== -AT91C_WDTC_WDCR EQU (0xFFFFFD40) ;- (WDTC) Watchdog Control Register -AT91C_WDTC_WDSR EQU (0xFFFFFD48) ;- (WDTC) Watchdog Status Register -AT91C_WDTC_WDMR EQU (0xFFFFFD44) ;- (WDTC) Watchdog Mode Register -// - ========== Register definition for VREG peripheral ========== -AT91C_VREG_MR EQU (0xFFFFFD60) ;- (VREG) Voltage Regulator Mode Register -// - ========== Register definition for MC peripheral ========== -AT91C_MC_ASR EQU (0xFFFFFF04) ;- (MC) MC Abort Status Register -AT91C_MC_RCR EQU (0xFFFFFF00) ;- (MC) MC Remap Control Register -AT91C_MC_FCR EQU (0xFFFFFF64) ;- (MC) MC Flash Command Register -AT91C_MC_AASR EQU (0xFFFFFF08) ;- (MC) MC Abort Address Status Register -AT91C_MC_FSR EQU (0xFFFFFF68) ;- (MC) MC Flash Status Register -AT91C_MC_FMR EQU (0xFFFFFF60) ;- (MC) MC Flash Mode Register -// - ========== Register definition for PDC_SPI1 peripheral ========== -AT91C_SPI1_PTCR EQU (0xFFFE4120) ;- (PDC_SPI1) PDC Transfer Control Register -AT91C_SPI1_RPR EQU (0xFFFE4100) ;- (PDC_SPI1) Receive Pointer Register -AT91C_SPI1_TNCR EQU (0xFFFE411C) ;- (PDC_SPI1) Transmit Next Counter Register -AT91C_SPI1_TPR EQU (0xFFFE4108) ;- (PDC_SPI1) Transmit Pointer Register -AT91C_SPI1_TNPR EQU (0xFFFE4118) ;- (PDC_SPI1) Transmit Next Pointer Register -AT91C_SPI1_TCR EQU (0xFFFE410C) ;- (PDC_SPI1) Transmit Counter Register -AT91C_SPI1_RCR EQU (0xFFFE4104) ;- (PDC_SPI1) Receive Counter Register -AT91C_SPI1_RNPR EQU (0xFFFE4110) ;- (PDC_SPI1) Receive Next Pointer Register -AT91C_SPI1_RNCR EQU (0xFFFE4114) ;- (PDC_SPI1) Receive Next Counter Register -AT91C_SPI1_PTSR EQU (0xFFFE4124) ;- (PDC_SPI1) PDC Transfer Status Register -// - ========== Register definition for SPI1 peripheral ========== -AT91C_SPI1_IMR EQU (0xFFFE401C) ;- (SPI1) Interrupt Mask Register -AT91C_SPI1_IER EQU (0xFFFE4014) ;- (SPI1) Interrupt Enable Register -AT91C_SPI1_MR EQU (0xFFFE4004) ;- (SPI1) Mode Register -AT91C_SPI1_RDR EQU (0xFFFE4008) ;- (SPI1) Receive Data Register -AT91C_SPI1_IDR EQU (0xFFFE4018) ;- (SPI1) Interrupt Disable Register -AT91C_SPI1_SR EQU (0xFFFE4010) ;- (SPI1) Status Register -AT91C_SPI1_TDR EQU (0xFFFE400C) ;- (SPI1) Transmit Data Register -AT91C_SPI1_CR EQU (0xFFFE4000) ;- (SPI1) Control Register -AT91C_SPI1_CSR EQU (0xFFFE4030) ;- (SPI1) Chip Select Register -// - ========== Register definition for PDC_SPI0 peripheral ========== -AT91C_SPI0_PTCR EQU (0xFFFE0120) ;- (PDC_SPI0) PDC Transfer Control Register -AT91C_SPI0_TPR EQU (0xFFFE0108) ;- (PDC_SPI0) Transmit Pointer Register -AT91C_SPI0_TCR EQU (0xFFFE010C) ;- (PDC_SPI0) Transmit Counter Register -AT91C_SPI0_RCR EQU (0xFFFE0104) ;- (PDC_SPI0) Receive Counter Register -AT91C_SPI0_PTSR EQU (0xFFFE0124) ;- (PDC_SPI0) PDC Transfer Status Register -AT91C_SPI0_RNPR EQU (0xFFFE0110) ;- (PDC_SPI0) Receive Next Pointer Register -AT91C_SPI0_RPR EQU (0xFFFE0100) ;- (PDC_SPI0) Receive Pointer Register -AT91C_SPI0_TNCR EQU (0xFFFE011C) ;- (PDC_SPI0) Transmit Next Counter Register -AT91C_SPI0_RNCR EQU (0xFFFE0114) ;- (PDC_SPI0) Receive Next Counter Register -AT91C_SPI0_TNPR EQU (0xFFFE0118) ;- (PDC_SPI0) Transmit Next Pointer Register -// - ========== Register definition for SPI0 peripheral ========== -AT91C_SPI0_IER EQU (0xFFFE0014) ;- (SPI0) Interrupt Enable Register -AT91C_SPI0_SR EQU (0xFFFE0010) ;- (SPI0) Status Register -AT91C_SPI0_IDR EQU (0xFFFE0018) ;- (SPI0) Interrupt Disable Register -AT91C_SPI0_CR EQU (0xFFFE0000) ;- (SPI0) Control Register -AT91C_SPI0_MR EQU (0xFFFE0004) ;- (SPI0) Mode Register -AT91C_SPI0_IMR EQU (0xFFFE001C) ;- (SPI0) Interrupt Mask Register -AT91C_SPI0_TDR EQU (0xFFFE000C) ;- (SPI0) Transmit Data Register -AT91C_SPI0_RDR EQU (0xFFFE0008) ;- (SPI0) Receive Data Register -AT91C_SPI0_CSR EQU (0xFFFE0030) ;- (SPI0) Chip Select Register -// - ========== Register definition for PDC_US1 peripheral ========== -AT91C_US1_RNCR EQU (0xFFFC4114) ;- (PDC_US1) Receive Next Counter Register -AT91C_US1_PTCR EQU (0xFFFC4120) ;- (PDC_US1) PDC Transfer Control Register -AT91C_US1_TCR EQU (0xFFFC410C) ;- (PDC_US1) Transmit Counter Register -AT91C_US1_PTSR EQU (0xFFFC4124) ;- (PDC_US1) PDC Transfer Status Register -AT91C_US1_TNPR EQU (0xFFFC4118) ;- (PDC_US1) Transmit Next Pointer Register -AT91C_US1_RCR EQU (0xFFFC4104) ;- (PDC_US1) Receive Counter Register -AT91C_US1_RNPR EQU (0xFFFC4110) ;- (PDC_US1) Receive Next Pointer Register -AT91C_US1_RPR EQU (0xFFFC4100) ;- (PDC_US1) Receive Pointer Register -AT91C_US1_TNCR EQU (0xFFFC411C) ;- (PDC_US1) Transmit Next Counter Register -AT91C_US1_TPR EQU (0xFFFC4108) ;- (PDC_US1) Transmit Pointer Register -// - ========== Register definition for US1 peripheral ========== -AT91C_US1_IF EQU (0xFFFC404C) ;- (US1) IRDA_FILTER Register -AT91C_US1_NER EQU (0xFFFC4044) ;- (US1) Nb Errors Register -AT91C_US1_RTOR EQU (0xFFFC4024) ;- (US1) Receiver Time-out Register -AT91C_US1_CSR EQU (0xFFFC4014) ;- (US1) Channel Status Register -AT91C_US1_IDR EQU (0xFFFC400C) ;- (US1) Interrupt Disable Register -AT91C_US1_IER EQU (0xFFFC4008) ;- (US1) Interrupt Enable Register -AT91C_US1_THR EQU (0xFFFC401C) ;- (US1) Transmitter Holding Register -AT91C_US1_TTGR EQU (0xFFFC4028) ;- (US1) Transmitter Time-guard Register -AT91C_US1_RHR EQU (0xFFFC4018) ;- (US1) Receiver Holding Register -AT91C_US1_BRGR EQU (0xFFFC4020) ;- (US1) Baud Rate Generator Register -AT91C_US1_IMR EQU (0xFFFC4010) ;- (US1) Interrupt Mask Register -AT91C_US1_FIDI EQU (0xFFFC4040) ;- (US1) FI_DI_Ratio Register -AT91C_US1_CR EQU (0xFFFC4000) ;- (US1) Control Register -AT91C_US1_MR EQU (0xFFFC4004) ;- (US1) Mode Register -// - ========== Register definition for PDC_US0 peripheral ========== -AT91C_US0_TNPR EQU (0xFFFC0118) ;- (PDC_US0) Transmit Next Pointer Register -AT91C_US0_RNPR EQU (0xFFFC0110) ;- (PDC_US0) Receive Next Pointer Register -AT91C_US0_TCR EQU (0xFFFC010C) ;- (PDC_US0) Transmit Counter Register -AT91C_US0_PTCR EQU (0xFFFC0120) ;- (PDC_US0) PDC Transfer Control Register -AT91C_US0_PTSR EQU (0xFFFC0124) ;- (PDC_US0) PDC Transfer Status Register -AT91C_US0_TNCR EQU (0xFFFC011C) ;- (PDC_US0) Transmit Next Counter Register -AT91C_US0_TPR EQU (0xFFFC0108) ;- (PDC_US0) Transmit Pointer Register -AT91C_US0_RCR EQU (0xFFFC0104) ;- (PDC_US0) Receive Counter Register -AT91C_US0_RPR EQU (0xFFFC0100) ;- (PDC_US0) Receive Pointer Register -AT91C_US0_RNCR EQU (0xFFFC0114) ;- (PDC_US0) Receive Next Counter Register -// - ========== Register definition for US0 peripheral ========== -AT91C_US0_BRGR EQU (0xFFFC0020) ;- (US0) Baud Rate Generator Register -AT91C_US0_NER EQU (0xFFFC0044) ;- (US0) Nb Errors Register -AT91C_US0_CR EQU (0xFFFC0000) ;- (US0) Control Register -AT91C_US0_IMR EQU (0xFFFC0010) ;- (US0) Interrupt Mask Register -AT91C_US0_FIDI EQU (0xFFFC0040) ;- (US0) FI_DI_Ratio Register -AT91C_US0_TTGR EQU (0xFFFC0028) ;- (US0) Transmitter Time-guard Register -AT91C_US0_MR EQU (0xFFFC0004) ;- (US0) Mode Register -AT91C_US0_RTOR EQU (0xFFFC0024) ;- (US0) Receiver Time-out Register -AT91C_US0_CSR EQU (0xFFFC0014) ;- (US0) Channel Status Register -AT91C_US0_RHR EQU (0xFFFC0018) ;- (US0) Receiver Holding Register -AT91C_US0_IDR EQU (0xFFFC000C) ;- (US0) Interrupt Disable Register -AT91C_US0_THR EQU (0xFFFC001C) ;- (US0) Transmitter Holding Register -AT91C_US0_IF EQU (0xFFFC004C) ;- (US0) IRDA_FILTER Register -AT91C_US0_IER EQU (0xFFFC0008) ;- (US0) Interrupt Enable Register -// - ========== Register definition for PDC_SSC peripheral ========== -AT91C_SSC_TNCR EQU (0xFFFD411C) ;- (PDC_SSC) Transmit Next Counter Register -AT91C_SSC_RPR EQU (0xFFFD4100) ;- (PDC_SSC) Receive Pointer Register -AT91C_SSC_RNCR EQU (0xFFFD4114) ;- (PDC_SSC) Receive Next Counter Register -AT91C_SSC_TPR EQU (0xFFFD4108) ;- (PDC_SSC) Transmit Pointer Register -AT91C_SSC_PTCR EQU (0xFFFD4120) ;- (PDC_SSC) PDC Transfer Control Register -AT91C_SSC_TCR EQU (0xFFFD410C) ;- (PDC_SSC) Transmit Counter Register -AT91C_SSC_RCR EQU (0xFFFD4104) ;- (PDC_SSC) Receive Counter Register -AT91C_SSC_RNPR EQU (0xFFFD4110) ;- (PDC_SSC) Receive Next Pointer Register -AT91C_SSC_TNPR EQU (0xFFFD4118) ;- (PDC_SSC) Transmit Next Pointer Register -AT91C_SSC_PTSR EQU (0xFFFD4124) ;- (PDC_SSC) PDC Transfer Status Register -// - ========== Register definition for SSC peripheral ========== -AT91C_SSC_RHR EQU (0xFFFD4020) ;- (SSC) Receive Holding Register -AT91C_SSC_RSHR EQU (0xFFFD4030) ;- (SSC) Receive Sync Holding Register -AT91C_SSC_TFMR EQU (0xFFFD401C) ;- (SSC) Transmit Frame Mode Register -AT91C_SSC_IDR EQU (0xFFFD4048) ;- (SSC) Interrupt Disable Register -AT91C_SSC_THR EQU (0xFFFD4024) ;- (SSC) Transmit Holding Register -AT91C_SSC_RCMR EQU (0xFFFD4010) ;- (SSC) Receive Clock ModeRegister -AT91C_SSC_IER EQU (0xFFFD4044) ;- (SSC) Interrupt Enable Register -AT91C_SSC_TSHR EQU (0xFFFD4034) ;- (SSC) Transmit Sync Holding Register -AT91C_SSC_SR EQU (0xFFFD4040) ;- (SSC) Status Register -AT91C_SSC_CMR EQU (0xFFFD4004) ;- (SSC) Clock Mode Register -AT91C_SSC_TCMR EQU (0xFFFD4018) ;- (SSC) Transmit Clock Mode Register -AT91C_SSC_CR EQU (0xFFFD4000) ;- (SSC) Control Register -AT91C_SSC_IMR EQU (0xFFFD404C) ;- (SSC) Interrupt Mask Register -AT91C_SSC_RFMR EQU (0xFFFD4014) ;- (SSC) Receive Frame Mode Register -// - ========== Register definition for TWI peripheral ========== -AT91C_TWI_IER EQU (0xFFFB8024) ;- (TWI) Interrupt Enable Register -AT91C_TWI_CR EQU (0xFFFB8000) ;- (TWI) Control Register -AT91C_TWI_SR EQU (0xFFFB8020) ;- (TWI) Status Register -AT91C_TWI_IMR EQU (0xFFFB802C) ;- (TWI) Interrupt Mask Register -AT91C_TWI_THR EQU (0xFFFB8034) ;- (TWI) Transmit Holding Register -AT91C_TWI_IDR EQU (0xFFFB8028) ;- (TWI) Interrupt Disable Register -AT91C_TWI_IADR EQU (0xFFFB800C) ;- (TWI) Internal Address Register -AT91C_TWI_MMR EQU (0xFFFB8004) ;- (TWI) Master Mode Register -AT91C_TWI_CWGR EQU (0xFFFB8010) ;- (TWI) Clock Waveform Generator Register -AT91C_TWI_RHR EQU (0xFFFB8030) ;- (TWI) Receive Holding Register -// - ========== Register definition for PWMC_CH3 peripheral ========== -AT91C_PWMC_CH3_CUPDR EQU (0xFFFCC270) ;- (PWMC_CH3) Channel Update Register -AT91C_PWMC_CH3_Reserved EQU (0xFFFCC274) ;- (PWMC_CH3) Reserved -AT91C_PWMC_CH3_CPRDR EQU (0xFFFCC268) ;- (PWMC_CH3) Channel Period Register -AT91C_PWMC_CH3_CDTYR EQU (0xFFFCC264) ;- (PWMC_CH3) Channel Duty Cycle Register -AT91C_PWMC_CH3_CCNTR EQU (0xFFFCC26C) ;- (PWMC_CH3) Channel Counter Register -AT91C_PWMC_CH3_CMR EQU (0xFFFCC260) ;- (PWMC_CH3) Channel Mode Register -// - ========== Register definition for PWMC_CH2 peripheral ========== -AT91C_PWMC_CH2_Reserved EQU (0xFFFCC254) ;- (PWMC_CH2) Reserved -AT91C_PWMC_CH2_CMR EQU (0xFFFCC240) ;- (PWMC_CH2) Channel Mode Register -AT91C_PWMC_CH2_CCNTR EQU (0xFFFCC24C) ;- (PWMC_CH2) Channel Counter Register -AT91C_PWMC_CH2_CPRDR EQU (0xFFFCC248) ;- (PWMC_CH2) Channel Period Register -AT91C_PWMC_CH2_CUPDR EQU (0xFFFCC250) ;- (PWMC_CH2) Channel Update Register -AT91C_PWMC_CH2_CDTYR EQU (0xFFFCC244) ;- (PWMC_CH2) Channel Duty Cycle Register -// - ========== Register definition for PWMC_CH1 peripheral ========== -AT91C_PWMC_CH1_Reserved EQU (0xFFFCC234) ;- (PWMC_CH1) Reserved -AT91C_PWMC_CH1_CUPDR EQU (0xFFFCC230) ;- (PWMC_CH1) Channel Update Register -AT91C_PWMC_CH1_CPRDR EQU (0xFFFCC228) ;- (PWMC_CH1) Channel Period Register -AT91C_PWMC_CH1_CCNTR EQU (0xFFFCC22C) ;- (PWMC_CH1) Channel Counter Register -AT91C_PWMC_CH1_CDTYR EQU (0xFFFCC224) ;- (PWMC_CH1) Channel Duty Cycle Register -AT91C_PWMC_CH1_CMR EQU (0xFFFCC220) ;- (PWMC_CH1) Channel Mode Register -// - ========== Register definition for PWMC_CH0 peripheral ========== -AT91C_PWMC_CH0_Reserved EQU (0xFFFCC214) ;- (PWMC_CH0) Reserved -AT91C_PWMC_CH0_CPRDR EQU (0xFFFCC208) ;- (PWMC_CH0) Channel Period Register -AT91C_PWMC_CH0_CDTYR EQU (0xFFFCC204) ;- (PWMC_CH0) Channel Duty Cycle Register -AT91C_PWMC_CH0_CMR EQU (0xFFFCC200) ;- (PWMC_CH0) Channel Mode Register -AT91C_PWMC_CH0_CUPDR EQU (0xFFFCC210) ;- (PWMC_CH0) Channel Update Register -AT91C_PWMC_CH0_CCNTR EQU (0xFFFCC20C) ;- (PWMC_CH0) Channel Counter Register -// - ========== Register definition for PWMC peripheral ========== -AT91C_PWMC_IDR EQU (0xFFFCC014) ;- (PWMC) PWMC Interrupt Disable Register -AT91C_PWMC_DIS EQU (0xFFFCC008) ;- (PWMC) PWMC Disable Register -AT91C_PWMC_IER EQU (0xFFFCC010) ;- (PWMC) PWMC Interrupt Enable Register -AT91C_PWMC_VR EQU (0xFFFCC0FC) ;- (PWMC) PWMC Version Register -AT91C_PWMC_ISR EQU (0xFFFCC01C) ;- (PWMC) PWMC Interrupt Status Register -AT91C_PWMC_SR EQU (0xFFFCC00C) ;- (PWMC) PWMC Status Register -AT91C_PWMC_IMR EQU (0xFFFCC018) ;- (PWMC) PWMC Interrupt Mask Register -AT91C_PWMC_MR EQU (0xFFFCC000) ;- (PWMC) PWMC Mode Register -AT91C_PWMC_ENA EQU (0xFFFCC004) ;- (PWMC) PWMC Enable Register -// - ========== Register definition for UDP peripheral ========== -AT91C_UDP_IMR EQU (0xFFFB0018) ;- (UDP) Interrupt Mask Register -AT91C_UDP_FADDR EQU (0xFFFB0008) ;- (UDP) Function Address Register -AT91C_UDP_NUM EQU (0xFFFB0000) ;- (UDP) Frame Number Register -AT91C_UDP_FDR EQU (0xFFFB0050) ;- (UDP) Endpoint FIFO Data Register -AT91C_UDP_ISR EQU (0xFFFB001C) ;- (UDP) Interrupt Status Register -AT91C_UDP_CSR EQU (0xFFFB0030) ;- (UDP) Endpoint Control and Status Register -AT91C_UDP_IDR EQU (0xFFFB0014) ;- (UDP) Interrupt Disable Register -AT91C_UDP_ICR EQU (0xFFFB0020) ;- (UDP) Interrupt Clear Register -AT91C_UDP_RSTEP EQU (0xFFFB0028) ;- (UDP) Reset Endpoint Register -AT91C_UDP_TXVC EQU (0xFFFB0074) ;- (UDP) Transceiver Control Register -AT91C_UDP_GLBSTATE EQU (0xFFFB0004) ;- (UDP) Global State Register -AT91C_UDP_IER EQU (0xFFFB0010) ;- (UDP) Interrupt Enable Register -// - ========== Register definition for TC0 peripheral ========== -AT91C_TC0_SR EQU (0xFFFA0020) ;- (TC0) Status Register -AT91C_TC0_RC EQU (0xFFFA001C) ;- (TC0) Register C -AT91C_TC0_RB EQU (0xFFFA0018) ;- (TC0) Register B -AT91C_TC0_CCR EQU (0xFFFA0000) ;- (TC0) Channel Control Register -AT91C_TC0_CMR EQU (0xFFFA0004) ;- (TC0) Channel Mode Register (Capture Mode / Waveform Mode) -AT91C_TC0_IER EQU (0xFFFA0024) ;- (TC0) Interrupt Enable Register -AT91C_TC0_RA EQU (0xFFFA0014) ;- (TC0) Register A -AT91C_TC0_IDR EQU (0xFFFA0028) ;- (TC0) Interrupt Disable Register -AT91C_TC0_CV EQU (0xFFFA0010) ;- (TC0) Counter Value -AT91C_TC0_IMR EQU (0xFFFA002C) ;- (TC0) Interrupt Mask Register -// - ========== Register definition for TC1 peripheral ========== -AT91C_TC1_RB EQU (0xFFFA0058) ;- (TC1) Register B -AT91C_TC1_CCR EQU (0xFFFA0040) ;- (TC1) Channel Control Register -AT91C_TC1_IER EQU (0xFFFA0064) ;- (TC1) Interrupt Enable Register -AT91C_TC1_IDR EQU (0xFFFA0068) ;- (TC1) Interrupt Disable Register -AT91C_TC1_SR EQU (0xFFFA0060) ;- (TC1) Status Register -AT91C_TC1_CMR EQU (0xFFFA0044) ;- (TC1) Channel Mode Register (Capture Mode / Waveform Mode) -AT91C_TC1_RA EQU (0xFFFA0054) ;- (TC1) Register A -AT91C_TC1_RC EQU (0xFFFA005C) ;- (TC1) Register C -AT91C_TC1_IMR EQU (0xFFFA006C) ;- (TC1) Interrupt Mask Register -AT91C_TC1_CV EQU (0xFFFA0050) ;- (TC1) Counter Value -// - ========== Register definition for TC2 peripheral ========== -AT91C_TC2_CMR EQU (0xFFFA0084) ;- (TC2) Channel Mode Register (Capture Mode / Waveform Mode) -AT91C_TC2_CCR EQU (0xFFFA0080) ;- (TC2) Channel Control Register -AT91C_TC2_CV EQU (0xFFFA0090) ;- (TC2) Counter Value -AT91C_TC2_RA EQU (0xFFFA0094) ;- (TC2) Register A -AT91C_TC2_RB EQU (0xFFFA0098) ;- (TC2) Register B -AT91C_TC2_IDR EQU (0xFFFA00A8) ;- (TC2) Interrupt Disable Register -AT91C_TC2_IMR EQU (0xFFFA00AC) ;- (TC2) Interrupt Mask Register -AT91C_TC2_RC EQU (0xFFFA009C) ;- (TC2) Register C -AT91C_TC2_IER EQU (0xFFFA00A4) ;- (TC2) Interrupt Enable Register -AT91C_TC2_SR EQU (0xFFFA00A0) ;- (TC2) Status Register -// - ========== Register definition for TCB peripheral ========== -AT91C_TCB_BMR EQU (0xFFFA00C4) ;- (TCB) TC Block Mode Register -AT91C_TCB_BCR EQU (0xFFFA00C0) ;- (TCB) TC Block Control Register -// - ========== Register definition for CAN_MB0 peripheral ========== -AT91C_CAN_MB0_MDL EQU (0xFFFD0214) ;- (CAN_MB0) MailBox Data Low Register -AT91C_CAN_MB0_MAM EQU (0xFFFD0204) ;- (CAN_MB0) MailBox Acceptance Mask Register -AT91C_CAN_MB0_MCR EQU (0xFFFD021C) ;- (CAN_MB0) MailBox Control Register -AT91C_CAN_MB0_MID EQU (0xFFFD0208) ;- (CAN_MB0) MailBox ID Register -AT91C_CAN_MB0_MSR EQU (0xFFFD0210) ;- (CAN_MB0) MailBox Status Register -AT91C_CAN_MB0_MFID EQU (0xFFFD020C) ;- (CAN_MB0) MailBox Family ID Register -AT91C_CAN_MB0_MDH EQU (0xFFFD0218) ;- (CAN_MB0) MailBox Data High Register -AT91C_CAN_MB0_MMR EQU (0xFFFD0200) ;- (CAN_MB0) MailBox Mode Register -// - ========== Register definition for CAN_MB1 peripheral ========== -AT91C_CAN_MB1_MDL EQU (0xFFFD0234) ;- (CAN_MB1) MailBox Data Low Register -AT91C_CAN_MB1_MID EQU (0xFFFD0228) ;- (CAN_MB1) MailBox ID Register -AT91C_CAN_MB1_MMR EQU (0xFFFD0220) ;- (CAN_MB1) MailBox Mode Register -AT91C_CAN_MB1_MSR EQU (0xFFFD0230) ;- (CAN_MB1) MailBox Status Register -AT91C_CAN_MB1_MAM EQU (0xFFFD0224) ;- (CAN_MB1) MailBox Acceptance Mask Register -AT91C_CAN_MB1_MDH EQU (0xFFFD0238) ;- (CAN_MB1) MailBox Data High Register -AT91C_CAN_MB1_MCR EQU (0xFFFD023C) ;- (CAN_MB1) MailBox Control Register -AT91C_CAN_MB1_MFID EQU (0xFFFD022C) ;- (CAN_MB1) MailBox Family ID Register -// - ========== Register definition for CAN_MB2 peripheral ========== -AT91C_CAN_MB2_MCR EQU (0xFFFD025C) ;- (CAN_MB2) MailBox Control Register -AT91C_CAN_MB2_MDH EQU (0xFFFD0258) ;- (CAN_MB2) MailBox Data High Register -AT91C_CAN_MB2_MID EQU (0xFFFD0248) ;- (CAN_MB2) MailBox ID Register -AT91C_CAN_MB2_MDL EQU (0xFFFD0254) ;- (CAN_MB2) MailBox Data Low Register -AT91C_CAN_MB2_MMR EQU (0xFFFD0240) ;- (CAN_MB2) MailBox Mode Register -AT91C_CAN_MB2_MAM EQU (0xFFFD0244) ;- (CAN_MB2) MailBox Acceptance Mask Register -AT91C_CAN_MB2_MFID EQU (0xFFFD024C) ;- (CAN_MB2) MailBox Family ID Register -AT91C_CAN_MB2_MSR EQU (0xFFFD0250) ;- (CAN_MB2) MailBox Status Register -// - ========== Register definition for CAN_MB3 peripheral ========== -AT91C_CAN_MB3_MFID EQU (0xFFFD026C) ;- (CAN_MB3) MailBox Family ID Register -AT91C_CAN_MB3_MAM EQU (0xFFFD0264) ;- (CAN_MB3) MailBox Acceptance Mask Register -AT91C_CAN_MB3_MID EQU (0xFFFD0268) ;- (CAN_MB3) MailBox ID Register -AT91C_CAN_MB3_MCR EQU (0xFFFD027C) ;- (CAN_MB3) MailBox Control Register -AT91C_CAN_MB3_MMR EQU (0xFFFD0260) ;- (CAN_MB3) MailBox Mode Register -AT91C_CAN_MB3_MSR EQU (0xFFFD0270) ;- (CAN_MB3) MailBox Status Register -AT91C_CAN_MB3_MDL EQU (0xFFFD0274) ;- (CAN_MB3) MailBox Data Low Register -AT91C_CAN_MB3_MDH EQU (0xFFFD0278) ;- (CAN_MB3) MailBox Data High Register -// - ========== Register definition for CAN_MB4 peripheral ========== -AT91C_CAN_MB4_MID EQU (0xFFFD0288) ;- (CAN_MB4) MailBox ID Register -AT91C_CAN_MB4_MMR EQU (0xFFFD0280) ;- (CAN_MB4) MailBox Mode Register -AT91C_CAN_MB4_MDH EQU (0xFFFD0298) ;- (CAN_MB4) MailBox Data High Register -AT91C_CAN_MB4_MFID EQU (0xFFFD028C) ;- (CAN_MB4) MailBox Family ID Register -AT91C_CAN_MB4_MSR EQU (0xFFFD0290) ;- (CAN_MB4) MailBox Status Register -AT91C_CAN_MB4_MCR EQU (0xFFFD029C) ;- (CAN_MB4) MailBox Control Register -AT91C_CAN_MB4_MDL EQU (0xFFFD0294) ;- (CAN_MB4) MailBox Data Low Register -AT91C_CAN_MB4_MAM EQU (0xFFFD0284) ;- (CAN_MB4) MailBox Acceptance Mask Register -// - ========== Register definition for CAN_MB5 peripheral ========== -AT91C_CAN_MB5_MSR EQU (0xFFFD02B0) ;- (CAN_MB5) MailBox Status Register -AT91C_CAN_MB5_MCR EQU (0xFFFD02BC) ;- (CAN_MB5) MailBox Control Register -AT91C_CAN_MB5_MFID EQU (0xFFFD02AC) ;- (CAN_MB5) MailBox Family ID Register -AT91C_CAN_MB5_MDH EQU (0xFFFD02B8) ;- (CAN_MB5) MailBox Data High Register -AT91C_CAN_MB5_MID EQU (0xFFFD02A8) ;- (CAN_MB5) MailBox ID Register -AT91C_CAN_MB5_MMR EQU (0xFFFD02A0) ;- (CAN_MB5) MailBox Mode Register -AT91C_CAN_MB5_MDL EQU (0xFFFD02B4) ;- (CAN_MB5) MailBox Data Low Register -AT91C_CAN_MB5_MAM EQU (0xFFFD02A4) ;- (CAN_MB5) MailBox Acceptance Mask Register -// - ========== Register definition for CAN_MB6 peripheral ========== -AT91C_CAN_MB6_MFID EQU (0xFFFD02CC) ;- (CAN_MB6) MailBox Family ID Register -AT91C_CAN_MB6_MID EQU (0xFFFD02C8) ;- (CAN_MB6) MailBox ID Register -AT91C_CAN_MB6_MAM EQU (0xFFFD02C4) ;- (CAN_MB6) MailBox Acceptance Mask Register -AT91C_CAN_MB6_MSR EQU (0xFFFD02D0) ;- (CAN_MB6) MailBox Status Register -AT91C_CAN_MB6_MDL EQU (0xFFFD02D4) ;- (CAN_MB6) MailBox Data Low Register -AT91C_CAN_MB6_MCR EQU (0xFFFD02DC) ;- (CAN_MB6) MailBox Control Register -AT91C_CAN_MB6_MDH EQU (0xFFFD02D8) ;- (CAN_MB6) MailBox Data High Register -AT91C_CAN_MB6_MMR EQU (0xFFFD02C0) ;- (CAN_MB6) MailBox Mode Register -// - ========== Register definition for CAN_MB7 peripheral ========== -AT91C_CAN_MB7_MCR EQU (0xFFFD02FC) ;- (CAN_MB7) MailBox Control Register -AT91C_CAN_MB7_MDH EQU (0xFFFD02F8) ;- (CAN_MB7) MailBox Data High Register -AT91C_CAN_MB7_MFID EQU (0xFFFD02EC) ;- (CAN_MB7) MailBox Family ID Register -AT91C_CAN_MB7_MDL EQU (0xFFFD02F4) ;- (CAN_MB7) MailBox Data Low Register -AT91C_CAN_MB7_MID EQU (0xFFFD02E8) ;- (CAN_MB7) MailBox ID Register -AT91C_CAN_MB7_MMR EQU (0xFFFD02E0) ;- (CAN_MB7) MailBox Mode Register -AT91C_CAN_MB7_MAM EQU (0xFFFD02E4) ;- (CAN_MB7) MailBox Acceptance Mask Register -AT91C_CAN_MB7_MSR EQU (0xFFFD02F0) ;- (CAN_MB7) MailBox Status Register -// - ========== Register definition for CAN peripheral ========== -AT91C_CAN_TCR EQU (0xFFFD0024) ;- (CAN) Transfer Command Register -AT91C_CAN_IMR EQU (0xFFFD000C) ;- (CAN) Interrupt Mask Register -AT91C_CAN_IER EQU (0xFFFD0004) ;- (CAN) Interrupt Enable Register -AT91C_CAN_ECR EQU (0xFFFD0020) ;- (CAN) Error Counter Register -AT91C_CAN_TIMESTP EQU (0xFFFD001C) ;- (CAN) Time Stamp Register -AT91C_CAN_MR EQU (0xFFFD0000) ;- (CAN) Mode Register -AT91C_CAN_IDR EQU (0xFFFD0008) ;- (CAN) Interrupt Disable Register -AT91C_CAN_ACR EQU (0xFFFD0028) ;- (CAN) Abort Command Register -AT91C_CAN_TIM EQU (0xFFFD0018) ;- (CAN) Timer Register -AT91C_CAN_SR EQU (0xFFFD0010) ;- (CAN) Status Register -AT91C_CAN_BR EQU (0xFFFD0014) ;- (CAN) Baudrate Register -AT91C_CAN_VR EQU (0xFFFD00FC) ;- (CAN) Version Register -// - ========== Register definition for EMAC peripheral ========== -AT91C_EMAC_ISR EQU (0xFFFDC024) ;- (EMAC) Interrupt Status Register -AT91C_EMAC_SA4H EQU (0xFFFDC0B4) ;- (EMAC) Specific Address 4 Top, Last 2 bytes -AT91C_EMAC_SA1L EQU (0xFFFDC098) ;- (EMAC) Specific Address 1 Bottom, First 4 bytes -AT91C_EMAC_ELE EQU (0xFFFDC078) ;- (EMAC) Excessive Length Errors Register -AT91C_EMAC_LCOL EQU (0xFFFDC05C) ;- (EMAC) Late Collision Register -AT91C_EMAC_RLE EQU (0xFFFDC088) ;- (EMAC) Receive Length Field Mismatch Register -AT91C_EMAC_WOL EQU (0xFFFDC0C4) ;- (EMAC) Wake On LAN Register -AT91C_EMAC_DTF EQU (0xFFFDC058) ;- (EMAC) Deferred Transmission Frame Register -AT91C_EMAC_TUND EQU (0xFFFDC064) ;- (EMAC) Transmit Underrun Error Register -AT91C_EMAC_NCR EQU (0xFFFDC000) ;- (EMAC) Network Control Register -AT91C_EMAC_SA4L EQU (0xFFFDC0B0) ;- (EMAC) Specific Address 4 Bottom, First 4 bytes -AT91C_EMAC_RSR EQU (0xFFFDC020) ;- (EMAC) Receive Status Register -AT91C_EMAC_SA3L EQU (0xFFFDC0A8) ;- (EMAC) Specific Address 3 Bottom, First 4 bytes -AT91C_EMAC_TSR EQU (0xFFFDC014) ;- (EMAC) Transmit Status Register -AT91C_EMAC_IDR EQU (0xFFFDC02C) ;- (EMAC) Interrupt Disable Register -AT91C_EMAC_RSE EQU (0xFFFDC074) ;- (EMAC) Receive Symbol Errors Register -AT91C_EMAC_ECOL EQU (0xFFFDC060) ;- (EMAC) Excessive Collision Register -AT91C_EMAC_TID EQU (0xFFFDC0B8) ;- (EMAC) Type ID Checking Register -AT91C_EMAC_HRB EQU (0xFFFDC090) ;- (EMAC) Hash Address Bottom[31:0] -AT91C_EMAC_TBQP EQU (0xFFFDC01C) ;- (EMAC) Transmit Buffer Queue Pointer -AT91C_EMAC_USRIO EQU (0xFFFDC0C0) ;- (EMAC) USER Input/Output Register -AT91C_EMAC_PTR EQU (0xFFFDC038) ;- (EMAC) Pause Time Register -AT91C_EMAC_SA2H EQU (0xFFFDC0A4) ;- (EMAC) Specific Address 2 Top, Last 2 bytes -AT91C_EMAC_ROV EQU (0xFFFDC070) ;- (EMAC) Receive Overrun Errors Register -AT91C_EMAC_ALE EQU (0xFFFDC054) ;- (EMAC) Alignment Error Register -AT91C_EMAC_RJA EQU (0xFFFDC07C) ;- (EMAC) Receive Jabbers Register -AT91C_EMAC_RBQP EQU (0xFFFDC018) ;- (EMAC) Receive Buffer Queue Pointer -AT91C_EMAC_TPF EQU (0xFFFDC08C) ;- (EMAC) Transmitted Pause Frames Register -AT91C_EMAC_NCFGR EQU (0xFFFDC004) ;- (EMAC) Network Configuration Register -AT91C_EMAC_HRT EQU (0xFFFDC094) ;- (EMAC) Hash Address Top[63:32] -AT91C_EMAC_USF EQU (0xFFFDC080) ;- (EMAC) Undersize Frames Register -AT91C_EMAC_FCSE EQU (0xFFFDC050) ;- (EMAC) Frame Check Sequence Error Register -AT91C_EMAC_TPQ EQU (0xFFFDC0BC) ;- (EMAC) Transmit Pause Quantum Register -AT91C_EMAC_MAN EQU (0xFFFDC034) ;- (EMAC) PHY Maintenance Register -AT91C_EMAC_FTO EQU (0xFFFDC040) ;- (EMAC) Frames Transmitted OK Register -AT91C_EMAC_REV EQU (0xFFFDC0FC) ;- (EMAC) Revision Register -AT91C_EMAC_IMR EQU (0xFFFDC030) ;- (EMAC) Interrupt Mask Register -AT91C_EMAC_SCF EQU (0xFFFDC044) ;- (EMAC) Single Collision Frame Register -AT91C_EMAC_PFR EQU (0xFFFDC03C) ;- (EMAC) Pause Frames received Register -AT91C_EMAC_MCF EQU (0xFFFDC048) ;- (EMAC) Multiple Collision Frame Register -AT91C_EMAC_NSR EQU (0xFFFDC008) ;- (EMAC) Network Status Register -AT91C_EMAC_SA2L EQU (0xFFFDC0A0) ;- (EMAC) Specific Address 2 Bottom, First 4 bytes -AT91C_EMAC_FRO EQU (0xFFFDC04C) ;- (EMAC) Frames Received OK Register -AT91C_EMAC_IER EQU (0xFFFDC028) ;- (EMAC) Interrupt Enable Register -AT91C_EMAC_SA1H EQU (0xFFFDC09C) ;- (EMAC) Specific Address 1 Top, Last 2 bytes -AT91C_EMAC_CSE EQU (0xFFFDC068) ;- (EMAC) Carrier Sense Error Register -AT91C_EMAC_SA3H EQU (0xFFFDC0AC) ;- (EMAC) Specific Address 3 Top, Last 2 bytes -AT91C_EMAC_RRE EQU (0xFFFDC06C) ;- (EMAC) Receive Ressource Error Register -AT91C_EMAC_STE EQU (0xFFFDC084) ;- (EMAC) SQE Test Error Register -// - ========== Register definition for PDC_ADC peripheral ========== -AT91C_ADC_PTSR EQU (0xFFFD8124) ;- (PDC_ADC) PDC Transfer Status Register -AT91C_ADC_PTCR EQU (0xFFFD8120) ;- (PDC_ADC) PDC Transfer Control Register -AT91C_ADC_TNPR EQU (0xFFFD8118) ;- (PDC_ADC) Transmit Next Pointer Register -AT91C_ADC_TNCR EQU (0xFFFD811C) ;- (PDC_ADC) Transmit Next Counter Register -AT91C_ADC_RNPR EQU (0xFFFD8110) ;- (PDC_ADC) Receive Next Pointer Register -AT91C_ADC_RNCR EQU (0xFFFD8114) ;- (PDC_ADC) Receive Next Counter Register -AT91C_ADC_RPR EQU (0xFFFD8100) ;- (PDC_ADC) Receive Pointer Register -AT91C_ADC_TCR EQU (0xFFFD810C) ;- (PDC_ADC) Transmit Counter Register -AT91C_ADC_TPR EQU (0xFFFD8108) ;- (PDC_ADC) Transmit Pointer Register -AT91C_ADC_RCR EQU (0xFFFD8104) ;- (PDC_ADC) Receive Counter Register -// - ========== Register definition for ADC peripheral ========== -AT91C_ADC_CDR2 EQU (0xFFFD8038) ;- (ADC) ADC Channel Data Register 2 -AT91C_ADC_CDR3 EQU (0xFFFD803C) ;- (ADC) ADC Channel Data Register 3 -AT91C_ADC_CDR0 EQU (0xFFFD8030) ;- (ADC) ADC Channel Data Register 0 -AT91C_ADC_CDR5 EQU (0xFFFD8044) ;- (ADC) ADC Channel Data Register 5 -AT91C_ADC_CHDR EQU (0xFFFD8014) ;- (ADC) ADC Channel Disable Register -AT91C_ADC_SR EQU (0xFFFD801C) ;- (ADC) ADC Status Register -AT91C_ADC_CDR4 EQU (0xFFFD8040) ;- (ADC) ADC Channel Data Register 4 -AT91C_ADC_CDR1 EQU (0xFFFD8034) ;- (ADC) ADC Channel Data Register 1 -AT91C_ADC_LCDR EQU (0xFFFD8020) ;- (ADC) ADC Last Converted Data Register -AT91C_ADC_IDR EQU (0xFFFD8028) ;- (ADC) ADC Interrupt Disable Register -AT91C_ADC_CR EQU (0xFFFD8000) ;- (ADC) ADC Control Register -AT91C_ADC_CDR7 EQU (0xFFFD804C) ;- (ADC) ADC Channel Data Register 7 -AT91C_ADC_CDR6 EQU (0xFFFD8048) ;- (ADC) ADC Channel Data Register 6 -AT91C_ADC_IER EQU (0xFFFD8024) ;- (ADC) ADC Interrupt Enable Register -AT91C_ADC_CHER EQU (0xFFFD8010) ;- (ADC) ADC Channel Enable Register -AT91C_ADC_CHSR EQU (0xFFFD8018) ;- (ADC) ADC Channel Status Register -AT91C_ADC_MR EQU (0xFFFD8004) ;- (ADC) ADC Mode Register -AT91C_ADC_IMR EQU (0xFFFD802C) ;- (ADC) ADC Interrupt Mask Register - -// - ***************************************************************************** -// - PIO DEFINITIONS FOR AT91SAM7X256 -// - ***************************************************************************** -AT91C_PIO_PA0 EQU (1 << 0) ;- Pin Controlled by PA0 -AT91C_PA0_RXD0 EQU (AT91C_PIO_PA0) ;- USART 0 Receive Data -AT91C_PIO_PA1 EQU (1 << 1) ;- Pin Controlled by PA1 -AT91C_PA1_TXD0 EQU (AT91C_PIO_PA1) ;- USART 0 Transmit Data -AT91C_PIO_PA10 EQU (1 << 10) ;- Pin Controlled by PA10 -AT91C_PA10_TWD EQU (AT91C_PIO_PA10) ;- TWI Two-wire Serial Data -AT91C_PIO_PA11 EQU (1 << 11) ;- Pin Controlled by PA11 -AT91C_PA11_TWCK EQU (AT91C_PIO_PA11) ;- TWI Two-wire Serial Clock -AT91C_PIO_PA12 EQU (1 << 12) ;- Pin Controlled by PA12 -AT91C_PA12_SPI0_NPCS0 EQU (AT91C_PIO_PA12) ;- SPI 0 Peripheral Chip Select 0 -AT91C_PIO_PA13 EQU (1 << 13) ;- Pin Controlled by PA13 -AT91C_PA13_SPI0_NPCS1 EQU (AT91C_PIO_PA13) ;- SPI 0 Peripheral Chip Select 1 -AT91C_PA13_PCK1 EQU (AT91C_PIO_PA13) ;- PMC Programmable Clock Output 1 -AT91C_PIO_PA14 EQU (1 << 14) ;- Pin Controlled by PA14 -AT91C_PA14_SPI0_NPCS2 EQU (AT91C_PIO_PA14) ;- SPI 0 Peripheral Chip Select 2 -AT91C_PA14_IRQ1 EQU (AT91C_PIO_PA14) ;- External Interrupt 1 -AT91C_PIO_PA15 EQU (1 << 15) ;- Pin Controlled by PA15 -AT91C_PA15_SPI0_NPCS3 EQU (AT91C_PIO_PA15) ;- SPI 0 Peripheral Chip Select 3 -AT91C_PA15_TCLK2 EQU (AT91C_PIO_PA15) ;- Timer Counter 2 external clock input -AT91C_PIO_PA16 EQU (1 << 16) ;- Pin Controlled by PA16 -AT91C_PA16_SPI0_MISO EQU (AT91C_PIO_PA16) ;- SPI 0 Master In Slave -AT91C_PIO_PA17 EQU (1 << 17) ;- Pin Controlled by PA17 -AT91C_PA17_SPI0_MOSI EQU (AT91C_PIO_PA17) ;- SPI 0 Master Out Slave -AT91C_PIO_PA18 EQU (1 << 18) ;- Pin Controlled by PA18 -AT91C_PA18_SPI0_SPCK EQU (AT91C_PIO_PA18) ;- SPI 0 Serial Clock -AT91C_PIO_PA19 EQU (1 << 19) ;- Pin Controlled by PA19 -AT91C_PA19_CANRX EQU (AT91C_PIO_PA19) ;- CAN Receive -AT91C_PIO_PA2 EQU (1 << 2) ;- Pin Controlled by PA2 -AT91C_PA2_SCK0 EQU (AT91C_PIO_PA2) ;- USART 0 Serial Clock -AT91C_PA2_SPI1_NPCS1 EQU (AT91C_PIO_PA2) ;- SPI 1 Peripheral Chip Select 1 -AT91C_PIO_PA20 EQU (1 << 20) ;- Pin Controlled by PA20 -AT91C_PA20_CANTX EQU (AT91C_PIO_PA20) ;- CAN Transmit -AT91C_PIO_PA21 EQU (1 << 21) ;- Pin Controlled by PA21 -AT91C_PA21_TF EQU (AT91C_PIO_PA21) ;- SSC Transmit Frame Sync -AT91C_PA21_SPI1_NPCS0 EQU (AT91C_PIO_PA21) ;- SPI 1 Peripheral Chip Select 0 -AT91C_PIO_PA22 EQU (1 << 22) ;- Pin Controlled by PA22 -AT91C_PA22_TK EQU (AT91C_PIO_PA22) ;- SSC Transmit Clock -AT91C_PA22_SPI1_SPCK EQU (AT91C_PIO_PA22) ;- SPI 1 Serial Clock -AT91C_PIO_PA23 EQU (1 << 23) ;- Pin Controlled by PA23 -AT91C_PA23_TD EQU (AT91C_PIO_PA23) ;- SSC Transmit data -AT91C_PA23_SPI1_MOSI EQU (AT91C_PIO_PA23) ;- SPI 1 Master Out Slave -AT91C_PIO_PA24 EQU (1 << 24) ;- Pin Controlled by PA24 -AT91C_PA24_RD EQU (AT91C_PIO_PA24) ;- SSC Receive Data -AT91C_PA24_SPI1_MISO EQU (AT91C_PIO_PA24) ;- SPI 1 Master In Slave -AT91C_PIO_PA25 EQU (1 << 25) ;- Pin Controlled by PA25 -AT91C_PA25_RK EQU (AT91C_PIO_PA25) ;- SSC Receive Clock -AT91C_PA25_SPI1_NPCS1 EQU (AT91C_PIO_PA25) ;- SPI 1 Peripheral Chip Select 1 -AT91C_PIO_PA26 EQU (1 << 26) ;- Pin Controlled by PA26 -AT91C_PA26_RF EQU (AT91C_PIO_PA26) ;- SSC Receive Frame Sync -AT91C_PA26_SPI1_NPCS2 EQU (AT91C_PIO_PA26) ;- SPI 1 Peripheral Chip Select 2 -AT91C_PIO_PA27 EQU (1 << 27) ;- Pin Controlled by PA27 -AT91C_PA27_DRXD EQU (AT91C_PIO_PA27) ;- DBGU Debug Receive Data -AT91C_PA27_PCK3 EQU (AT91C_PIO_PA27) ;- PMC Programmable Clock Output 3 -AT91C_PIO_PA28 EQU (1 << 28) ;- Pin Controlled by PA28 -AT91C_PA28_DTXD EQU (AT91C_PIO_PA28) ;- DBGU Debug Transmit Data -AT91C_PIO_PA29 EQU (1 << 29) ;- Pin Controlled by PA29 -AT91C_PA29_FIQ EQU (AT91C_PIO_PA29) ;- AIC Fast Interrupt Input -AT91C_PA29_SPI1_NPCS3 EQU (AT91C_PIO_PA29) ;- SPI 1 Peripheral Chip Select 3 -AT91C_PIO_PA3 EQU (1 << 3) ;- Pin Controlled by PA3 -AT91C_PA3_RTS0 EQU (AT91C_PIO_PA3) ;- USART 0 Ready To Send -AT91C_PA3_SPI1_NPCS2 EQU (AT91C_PIO_PA3) ;- SPI 1 Peripheral Chip Select 2 -AT91C_PIO_PA30 EQU (1 << 30) ;- Pin Controlled by PA30 -AT91C_PA30_IRQ0 EQU (AT91C_PIO_PA30) ;- External Interrupt 0 -AT91C_PA30_PCK2 EQU (AT91C_PIO_PA30) ;- PMC Programmable Clock Output 2 -AT91C_PIO_PA4 EQU (1 << 4) ;- Pin Controlled by PA4 -AT91C_PA4_CTS0 EQU (AT91C_PIO_PA4) ;- USART 0 Clear To Send -AT91C_PA4_SPI1_NPCS3 EQU (AT91C_PIO_PA4) ;- SPI 1 Peripheral Chip Select 3 -AT91C_PIO_PA5 EQU (1 << 5) ;- Pin Controlled by PA5 -AT91C_PA5_RXD1 EQU (AT91C_PIO_PA5) ;- USART 1 Receive Data -AT91C_PIO_PA6 EQU (1 << 6) ;- Pin Controlled by PA6 -AT91C_PA6_TXD1 EQU (AT91C_PIO_PA6) ;- USART 1 Transmit Data -AT91C_PIO_PA7 EQU (1 << 7) ;- Pin Controlled by PA7 -AT91C_PA7_SCK1 EQU (AT91C_PIO_PA7) ;- USART 1 Serial Clock -AT91C_PA7_SPI0_NPCS1 EQU (AT91C_PIO_PA7) ;- SPI 0 Peripheral Chip Select 1 -AT91C_PIO_PA8 EQU (1 << 8) ;- Pin Controlled by PA8 -AT91C_PA8_RTS1 EQU (AT91C_PIO_PA8) ;- USART 1 Ready To Send -AT91C_PA8_SPI0_NPCS2 EQU (AT91C_PIO_PA8) ;- SPI 0 Peripheral Chip Select 2 -AT91C_PIO_PA9 EQU (1 << 9) ;- Pin Controlled by PA9 -AT91C_PA9_CTS1 EQU (AT91C_PIO_PA9) ;- USART 1 Clear To Send -AT91C_PA9_SPI0_NPCS3 EQU (AT91C_PIO_PA9) ;- SPI 0 Peripheral Chip Select 3 -AT91C_PIO_PB0 EQU (1 << 0) ;- Pin Controlled by PB0 -AT91C_PB0_ETXCK_EREFCK EQU (AT91C_PIO_PB0) ;- Ethernet MAC Transmit Clock/Reference Clock -AT91C_PB0_PCK0 EQU (AT91C_PIO_PB0) ;- PMC Programmable Clock Output 0 -AT91C_PIO_PB1 EQU (1 << 1) ;- Pin Controlled by PB1 -AT91C_PB1_ETXEN EQU (AT91C_PIO_PB1) ;- Ethernet MAC Transmit Enable -AT91C_PIO_PB10 EQU (1 << 10) ;- Pin Controlled by PB10 -AT91C_PB10_ETX2 EQU (AT91C_PIO_PB10) ;- Ethernet MAC Transmit Data 2 -AT91C_PB10_SPI1_NPCS1 EQU (AT91C_PIO_PB10) ;- SPI 1 Peripheral Chip Select 1 -AT91C_PIO_PB11 EQU (1 << 11) ;- Pin Controlled by PB11 -AT91C_PB11_ETX3 EQU (AT91C_PIO_PB11) ;- Ethernet MAC Transmit Data 3 -AT91C_PB11_SPI1_NPCS2 EQU (AT91C_PIO_PB11) ;- SPI 1 Peripheral Chip Select 2 -AT91C_PIO_PB12 EQU (1 << 12) ;- Pin Controlled by PB12 -AT91C_PB12_ETXER EQU (AT91C_PIO_PB12) ;- Ethernet MAC Transmikt Coding Error -AT91C_PB12_TCLK0 EQU (AT91C_PIO_PB12) ;- Timer Counter 0 external clock input -AT91C_PIO_PB13 EQU (1 << 13) ;- Pin Controlled by PB13 -AT91C_PB13_ERX2 EQU (AT91C_PIO_PB13) ;- Ethernet MAC Receive Data 2 -AT91C_PB13_SPI0_NPCS1 EQU (AT91C_PIO_PB13) ;- SPI 0 Peripheral Chip Select 1 -AT91C_PIO_PB14 EQU (1 << 14) ;- Pin Controlled by PB14 -AT91C_PB14_ERX3 EQU (AT91C_PIO_PB14) ;- Ethernet MAC Receive Data 3 -AT91C_PB14_SPI0_NPCS2 EQU (AT91C_PIO_PB14) ;- SPI 0 Peripheral Chip Select 2 -AT91C_PIO_PB15 EQU (1 << 15) ;- Pin Controlled by PB15 -AT91C_PB15_ERXDV_ECRSDV EQU (AT91C_PIO_PB15) ;- Ethernet MAC Receive Data Valid -AT91C_PIO_PB16 EQU (1 << 16) ;- Pin Controlled by PB16 -AT91C_PB16_ECOL EQU (AT91C_PIO_PB16) ;- Ethernet MAC Collision Detected -AT91C_PB16_SPI1_NPCS3 EQU (AT91C_PIO_PB16) ;- SPI 1 Peripheral Chip Select 3 -AT91C_PIO_PB17 EQU (1 << 17) ;- Pin Controlled by PB17 -AT91C_PB17_ERXCK EQU (AT91C_PIO_PB17) ;- Ethernet MAC Receive Clock -AT91C_PB17_SPI0_NPCS3 EQU (AT91C_PIO_PB17) ;- SPI 0 Peripheral Chip Select 3 -AT91C_PIO_PB18 EQU (1 << 18) ;- Pin Controlled by PB18 -AT91C_PB18_EF100 EQU (AT91C_PIO_PB18) ;- Ethernet MAC Force 100 Mbits/sec -AT91C_PB18_ADTRG EQU (AT91C_PIO_PB18) ;- ADC External Trigger -AT91C_PIO_PB19 EQU (1 << 19) ;- Pin Controlled by PB19 -AT91C_PB19_PWM0 EQU (AT91C_PIO_PB19) ;- PWM Channel 0 -AT91C_PB19_TCLK1 EQU (AT91C_PIO_PB19) ;- Timer Counter 1 external clock input -AT91C_PIO_PB2 EQU (1 << 2) ;- Pin Controlled by PB2 -AT91C_PB2_ETX0 EQU (AT91C_PIO_PB2) ;- Ethernet MAC Transmit Data 0 -AT91C_PIO_PB20 EQU (1 << 20) ;- Pin Controlled by PB20 -AT91C_PB20_PWM1 EQU (AT91C_PIO_PB20) ;- PWM Channel 1 -AT91C_PB20_PCK0 EQU (AT91C_PIO_PB20) ;- PMC Programmable Clock Output 0 -AT91C_PIO_PB21 EQU (1 << 21) ;- Pin Controlled by PB21 -AT91C_PB21_PWM2 EQU (AT91C_PIO_PB21) ;- PWM Channel 2 -AT91C_PB21_PCK1 EQU (AT91C_PIO_PB21) ;- PMC Programmable Clock Output 1 -AT91C_PIO_PB22 EQU (1 << 22) ;- Pin Controlled by PB22 -AT91C_PB22_PWM3 EQU (AT91C_PIO_PB22) ;- PWM Channel 3 -AT91C_PB22_PCK2 EQU (AT91C_PIO_PB22) ;- PMC Programmable Clock Output 2 -AT91C_PIO_PB23 EQU (1 << 23) ;- Pin Controlled by PB23 -AT91C_PB23_TIOA0 EQU (AT91C_PIO_PB23) ;- Timer Counter 0 Multipurpose Timer I/O Pin A -AT91C_PB23_DCD1 EQU (AT91C_PIO_PB23) ;- USART 1 Data Carrier Detect -AT91C_PIO_PB24 EQU (1 << 24) ;- Pin Controlled by PB24 -AT91C_PB24_TIOB0 EQU (AT91C_PIO_PB24) ;- Timer Counter 0 Multipurpose Timer I/O Pin B -AT91C_PB24_DSR1 EQU (AT91C_PIO_PB24) ;- USART 1 Data Set ready -AT91C_PIO_PB25 EQU (1 << 25) ;- Pin Controlled by PB25 -AT91C_PB25_TIOA1 EQU (AT91C_PIO_PB25) ;- Timer Counter 1 Multipurpose Timer I/O Pin A -AT91C_PB25_DTR1 EQU (AT91C_PIO_PB25) ;- USART 1 Data Terminal ready -AT91C_PIO_PB26 EQU (1 << 26) ;- Pin Controlled by PB26 -AT91C_PB26_TIOB1 EQU (AT91C_PIO_PB26) ;- Timer Counter 1 Multipurpose Timer I/O Pin B -AT91C_PB26_RI1 EQU (AT91C_PIO_PB26) ;- USART 1 Ring Indicator -AT91C_PIO_PB27 EQU (1 << 27) ;- Pin Controlled by PB27 -AT91C_PB27_TIOA2 EQU (AT91C_PIO_PB27) ;- Timer Counter 2 Multipurpose Timer I/O Pin A -AT91C_PB27_PWM0 EQU (AT91C_PIO_PB27) ;- PWM Channel 0 -AT91C_PIO_PB28 EQU (1 << 28) ;- Pin Controlled by PB28 -AT91C_PB28_TIOB2 EQU (AT91C_PIO_PB28) ;- Timer Counter 2 Multipurpose Timer I/O Pin B -AT91C_PB28_PWM1 EQU (AT91C_PIO_PB28) ;- PWM Channel 1 -AT91C_PIO_PB29 EQU (1 << 29) ;- Pin Controlled by PB29 -AT91C_PB29_PCK1 EQU (AT91C_PIO_PB29) ;- PMC Programmable Clock Output 1 -AT91C_PB29_PWM2 EQU (AT91C_PIO_PB29) ;- PWM Channel 2 -AT91C_PIO_PB3 EQU (1 << 3) ;- Pin Controlled by PB3 -AT91C_PB3_ETX1 EQU (AT91C_PIO_PB3) ;- Ethernet MAC Transmit Data 1 -AT91C_PIO_PB30 EQU (1 << 30) ;- Pin Controlled by PB30 -AT91C_PB30_PCK2 EQU (AT91C_PIO_PB30) ;- PMC Programmable Clock Output 2 -AT91C_PB30_PWM3 EQU (AT91C_PIO_PB30) ;- PWM Channel 3 -AT91C_PIO_PB4 EQU (1 << 4) ;- Pin Controlled by PB4 -AT91C_PB4_ECRS EQU (AT91C_PIO_PB4) ;- Ethernet MAC Carrier Sense/Carrier Sense and Data Valid -AT91C_PIO_PB5 EQU (1 << 5) ;- Pin Controlled by PB5 -AT91C_PB5_ERX0 EQU (AT91C_PIO_PB5) ;- Ethernet MAC Receive Data 0 -AT91C_PIO_PB6 EQU (1 << 6) ;- Pin Controlled by PB6 -AT91C_PB6_ERX1 EQU (AT91C_PIO_PB6) ;- Ethernet MAC Receive Data 1 -AT91C_PIO_PB7 EQU (1 << 7) ;- Pin Controlled by PB7 -AT91C_PB7_ERXER EQU (AT91C_PIO_PB7) ;- Ethernet MAC Receive Error -AT91C_PIO_PB8 EQU (1 << 8) ;- Pin Controlled by PB8 -AT91C_PB8_EMDC EQU (AT91C_PIO_PB8) ;- Ethernet MAC Management Data Clock -AT91C_PIO_PB9 EQU (1 << 9) ;- Pin Controlled by PB9 -AT91C_PB9_EMDIO EQU (AT91C_PIO_PB9) ;- Ethernet MAC Management Data Input/Output - -// - ***************************************************************************** -// - PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 -// - ***************************************************************************** -AT91C_ID_FIQ EQU ( 0) ;- Advanced Interrupt Controller (FIQ) -AT91C_ID_SYS EQU ( 1) ;- System Peripheral -AT91C_ID_PIOA EQU ( 2) ;- Parallel IO Controller A -AT91C_ID_PIOB EQU ( 3) ;- Parallel IO Controller B -AT91C_ID_SPI0 EQU ( 4) ;- Serial Peripheral Interface 0 -AT91C_ID_SPI1 EQU ( 5) ;- Serial Peripheral Interface 1 -AT91C_ID_US0 EQU ( 6) ;- USART 0 -AT91C_ID_US1 EQU ( 7) ;- USART 1 -AT91C_ID_SSC EQU ( 8) ;- Serial Synchronous Controller -AT91C_ID_TWI EQU ( 9) ;- Two-Wire Interface -AT91C_ID_PWMC EQU (10) ;- PWM Controller -AT91C_ID_UDP EQU (11) ;- USB Device Port -AT91C_ID_TC0 EQU (12) ;- Timer Counter 0 -AT91C_ID_TC1 EQU (13) ;- Timer Counter 1 -AT91C_ID_TC2 EQU (14) ;- Timer Counter 2 -AT91C_ID_CAN EQU (15) ;- Control Area Network Controller -AT91C_ID_EMAC EQU (16) ;- Ethernet MAC -AT91C_ID_ADC EQU (17) ;- Analog-to-Digital Converter -AT91C_ID_18_Reserved EQU (18) ;- Reserved -AT91C_ID_19_Reserved EQU (19) ;- Reserved -AT91C_ID_20_Reserved EQU (20) ;- Reserved -AT91C_ID_21_Reserved EQU (21) ;- Reserved -AT91C_ID_22_Reserved EQU (22) ;- Reserved -AT91C_ID_23_Reserved EQU (23) ;- Reserved -AT91C_ID_24_Reserved EQU (24) ;- Reserved -AT91C_ID_25_Reserved EQU (25) ;- Reserved -AT91C_ID_26_Reserved EQU (26) ;- Reserved -AT91C_ID_27_Reserved EQU (27) ;- Reserved -AT91C_ID_28_Reserved EQU (28) ;- Reserved -AT91C_ID_29_Reserved EQU (29) ;- Reserved -AT91C_ID_IRQ0 EQU (30) ;- Advanced Interrupt Controller (IRQ0) -AT91C_ID_IRQ1 EQU (31) ;- Advanced Interrupt Controller (IRQ1) -AT91C_ALL_INT EQU (0xC003FFFF) ;- ALL VALID INTERRUPTS - -// - ***************************************************************************** -// - BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 -// - ***************************************************************************** -AT91C_BASE_SYS EQU (0xFFFFF000) ;- (SYS) Base Address -AT91C_BASE_AIC EQU (0xFFFFF000) ;- (AIC) Base Address -AT91C_BASE_PDC_DBGU EQU (0xFFFFF300) ;- (PDC_DBGU) Base Address -AT91C_BASE_DBGU EQU (0xFFFFF200) ;- (DBGU) Base Address -AT91C_BASE_PIOA EQU (0xFFFFF400) ;- (PIOA) Base Address -AT91C_BASE_PIOB EQU (0xFFFFF600) ;- (PIOB) Base Address -AT91C_BASE_CKGR EQU (0xFFFFFC20) ;- (CKGR) Base Address -AT91C_BASE_PMC EQU (0xFFFFFC00) ;- (PMC) Base Address -AT91C_BASE_RSTC EQU (0xFFFFFD00) ;- (RSTC) Base Address -AT91C_BASE_RTTC EQU (0xFFFFFD20) ;- (RTTC) Base Address -AT91C_BASE_PITC EQU (0xFFFFFD30) ;- (PITC) Base Address -AT91C_BASE_WDTC EQU (0xFFFFFD40) ;- (WDTC) Base Address -AT91C_BASE_VREG EQU (0xFFFFFD60) ;- (VREG) Base Address -AT91C_BASE_MC EQU (0xFFFFFF00) ;- (MC) Base Address -AT91C_BASE_PDC_SPI1 EQU (0xFFFE4100) ;- (PDC_SPI1) Base Address -AT91C_BASE_SPI1 EQU (0xFFFE4000) ;- (SPI1) Base Address -AT91C_BASE_PDC_SPI0 EQU (0xFFFE0100) ;- (PDC_SPI0) Base Address -AT91C_BASE_SPI0 EQU (0xFFFE0000) ;- (SPI0) Base Address -AT91C_BASE_PDC_US1 EQU (0xFFFC4100) ;- (PDC_US1) Base Address -AT91C_BASE_US1 EQU (0xFFFC4000) ;- (US1) Base Address -AT91C_BASE_PDC_US0 EQU (0xFFFC0100) ;- (PDC_US0) Base Address -AT91C_BASE_US0 EQU (0xFFFC0000) ;- (US0) Base Address -AT91C_BASE_PDC_SSC EQU (0xFFFD4100) ;- (PDC_SSC) Base Address -AT91C_BASE_SSC EQU (0xFFFD4000) ;- (SSC) Base Address -AT91C_BASE_TWI EQU (0xFFFB8000) ;- (TWI) Base Address -AT91C_BASE_PWMC_CH3 EQU (0xFFFCC260) ;- (PWMC_CH3) Base Address -AT91C_BASE_PWMC_CH2 EQU (0xFFFCC240) ;- (PWMC_CH2) Base Address -AT91C_BASE_PWMC_CH1 EQU (0xFFFCC220) ;- (PWMC_CH1) Base Address -AT91C_BASE_PWMC_CH0 EQU (0xFFFCC200) ;- (PWMC_CH0) Base Address -AT91C_BASE_PWMC EQU (0xFFFCC000) ;- (PWMC) Base Address -AT91C_BASE_UDP EQU (0xFFFB0000) ;- (UDP) Base Address -AT91C_BASE_TC0 EQU (0xFFFA0000) ;- (TC0) Base Address -AT91C_BASE_TC1 EQU (0xFFFA0040) ;- (TC1) Base Address -AT91C_BASE_TC2 EQU (0xFFFA0080) ;- (TC2) Base Address -AT91C_BASE_TCB EQU (0xFFFA0000) ;- (TCB) Base Address -AT91C_BASE_CAN_MB0 EQU (0xFFFD0200) ;- (CAN_MB0) Base Address -AT91C_BASE_CAN_MB1 EQU (0xFFFD0220) ;- (CAN_MB1) Base Address -AT91C_BASE_CAN_MB2 EQU (0xFFFD0240) ;- (CAN_MB2) Base Address -AT91C_BASE_CAN_MB3 EQU (0xFFFD0260) ;- (CAN_MB3) Base Address -AT91C_BASE_CAN_MB4 EQU (0xFFFD0280) ;- (CAN_MB4) Base Address -AT91C_BASE_CAN_MB5 EQU (0xFFFD02A0) ;- (CAN_MB5) Base Address -AT91C_BASE_CAN_MB6 EQU (0xFFFD02C0) ;- (CAN_MB6) Base Address -AT91C_BASE_CAN_MB7 EQU (0xFFFD02E0) ;- (CAN_MB7) Base Address -AT91C_BASE_CAN EQU (0xFFFD0000) ;- (CAN) Base Address -AT91C_BASE_EMAC EQU (0xFFFDC000) ;- (EMAC) Base Address -AT91C_BASE_PDC_ADC EQU (0xFFFD8100) ;- (PDC_ADC) Base Address -AT91C_BASE_ADC EQU (0xFFFD8000) ;- (ADC) Base Address - -// - ***************************************************************************** -// - MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 -// - ***************************************************************************** -// - ISRAM -AT91C_ISRAM EQU (0x00200000) ;- Internal SRAM base address -AT91C_ISRAM_SIZE EQU (0x00010000) ;- Internal SRAM size in byte (64 Kbytes) -// - IFLASH -AT91C_IFLASH EQU (0x00100000) ;- Internal FLASH base address -AT91C_IFLASH_SIZE EQU (0x00040000) ;- Internal FLASH size in byte (256 Kbytes) -AT91C_IFLASH_PAGE_SIZE EQU (256) ;- Internal FLASH Page Size: 256 bytes -AT91C_IFLASH_LOCK_REGION_SIZE EQU (16384) ;- Internal FLASH Lock Region Size: 16 Kbytes -AT91C_IFLASH_NB_OF_PAGES EQU (1024) ;- Internal FLASH Number of Pages: 1024 bytes -AT91C_IFLASH_NB_OF_LOCK_BITS EQU (16) ;- Internal FLASH Number of Lock Bits: 16 bytes -#endif /* __IAR_SYSTEMS_ASM__ */ - - -#endif /* AT91SAM7X256_H */ diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/lib_AT91SAM7X256.h b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/lib_AT91SAM7X256.h deleted file mode 100644 index 95492d0c3..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/lib_AT91SAM7X256.h +++ /dev/null @@ -1,4211 +0,0 @@ -//* ---------------------------------------------------------------------------- -//* ATMEL Microcontroller Software Support - ROUSSET - -//* ---------------------------------------------------------------------------- -//* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -//* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -//* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -//* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : lib_AT91SAM7X256.h -//* Object : AT91SAM7X256 inlined functions -//* Generated : AT91 SW Application Group 11/02/2005 (15:17:24) -//* -//* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// -//* CVS Reference : /lib_pmc_SAM7X.h/1.4/Tue Aug 30 13:00:36 2005// -//* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// -//* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// -//* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// -//* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// -//* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// -//* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// -//* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// -//* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// -//* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// -//* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// -//* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// -//* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// -//* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// -//* CVS Reference : /lib_MC_SAM7X.h/1.1/Thu Mar 25 15:19:14 2004// -//* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// -//* CVS Reference : /lib_can_AT91.h/1.5/Tue Aug 23 15:37:07 2005// -//* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// -//* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// -//* ---------------------------------------------------------------------------- - -#ifndef lib_AT91SAM7X256_H -#define lib_AT91SAM7X256_H - -/* ***************************************************************************** - SOFTWARE API FOR AIC - ***************************************************************************** */ -#define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_ConfigureIt -//* \brief Interrupt Handler Initialization -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_AIC_ConfigureIt ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id, // \arg interrupt number to initialize - unsigned int priority, // \arg priority to give to the interrupt - unsigned int src_type, // \arg activation and sense of activation - void (*newHandler) () ) // \arg address of the interrupt handler -{ - unsigned int oldHandler; - unsigned int mask ; - - oldHandler = pAic->AIC_SVR[irq_id]; - - mask = 0x1 << irq_id ; - //* Disable the interrupt on the interrupt controller - pAic->AIC_IDCR = mask ; - //* Save the interrupt handler routine pointer and the interrupt priority - pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; - //* Store the Source Mode Register - pAic->AIC_SMR[irq_id] = src_type | priority ; - //* Clear the interrupt on the interrupt controller - pAic->AIC_ICCR = mask ; - - return oldHandler; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_EnableIt -//* \brief Enable corresponding IT number -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_EnableIt ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id ) // \arg interrupt number to initialize -{ - //* Enable the interrupt on the interrupt controller - pAic->AIC_IECR = 0x1 << irq_id ; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_DisableIt -//* \brief Disable corresponding IT number -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_DisableIt ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id ) // \arg interrupt number to initialize -{ - unsigned int mask = 0x1 << irq_id; - //* Disable the interrupt on the interrupt controller - pAic->AIC_IDCR = mask ; - //* Clear the interrupt on the Interrupt Controller ( if one is pending ) - pAic->AIC_ICCR = mask ; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_ClearIt -//* \brief Clear corresponding IT number -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_ClearIt ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id) // \arg interrupt number to initialize -{ - //* Clear the interrupt on the Interrupt Controller ( if one is pending ) - pAic->AIC_ICCR = (0x1 << irq_id); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_AcknowledgeIt -//* \brief Acknowledge corresponding IT number -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_AcknowledgeIt ( - AT91PS_AIC pAic) // \arg pointer to the AIC registers -{ - pAic->AIC_EOICR = pAic->AIC_EOICR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_SetExceptionVector -//* \brief Configure vector handler -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_AIC_SetExceptionVector ( - unsigned int *pVector, // \arg pointer to the AIC registers - void (*Handler) () ) // \arg Interrupt Handler -{ - unsigned int oldVector = *pVector; - - if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) - *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; - else - *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; - - return oldVector; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_Trig -//* \brief Trig an IT -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_Trig ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id) // \arg interrupt number -{ - pAic->AIC_ISCR = (0x1 << irq_id) ; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_IsActive -//* \brief Test if an IT is active -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_AIC_IsActive ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id) // \arg Interrupt Number -{ - return (pAic->AIC_ISR & (0x1 << irq_id)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_IsPending -//* \brief Test if an IT is pending -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_AIC_IsPending ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id) // \arg Interrupt Number -{ - return (pAic->AIC_IPR & (0x1 << irq_id)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_Open -//* \brief Set exception vectors and AIC registers to default values -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_Open( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - void (*IrqHandler) (), // \arg Default IRQ vector exception - void (*FiqHandler) (), // \arg Default FIQ vector exception - void (*DefaultHandler) (), // \arg Default Handler set in ISR - void (*SpuriousHandler) (), // \arg Default Spurious Handler - unsigned int protectMode) // \arg Debug Control Register -{ - int i; - - // Disable all interrupts and set IVR to the default handler - for (i = 0; i < 32; ++i) { - AT91F_AIC_DisableIt(pAic, i); - AT91F_AIC_ConfigureIt(pAic, i, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_HIGH_LEVEL, DefaultHandler); - } - - // Set the IRQ exception vector - AT91F_AIC_SetExceptionVector((unsigned int *) 0x18, IrqHandler); - // Set the Fast Interrupt exception vector - AT91F_AIC_SetExceptionVector((unsigned int *) 0x1C, FiqHandler); - - pAic->AIC_SPU = (unsigned int) SpuriousHandler; - pAic->AIC_DCR = protectMode; -} -/* ***************************************************************************** - SOFTWARE API FOR PDC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetNextRx -//* \brief Set the next receive transfer descriptor -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_SetNextRx ( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be received - unsigned int bytes) // \arg number of bytes to be received -{ - pPDC->PDC_RNPR = (unsigned int) address; - pPDC->PDC_RNCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetNextTx -//* \brief Set the next transmit transfer descriptor -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_SetNextTx ( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be transmitted - unsigned int bytes) // \arg number of bytes to be transmitted -{ - pPDC->PDC_TNPR = (unsigned int) address; - pPDC->PDC_TNCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetRx -//* \brief Set the receive transfer descriptor -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_SetRx ( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be received - unsigned int bytes) // \arg number of bytes to be received -{ - pPDC->PDC_RPR = (unsigned int) address; - pPDC->PDC_RCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetTx -//* \brief Set the transmit transfer descriptor -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_SetTx ( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be transmitted - unsigned int bytes) // \arg number of bytes to be transmitted -{ - pPDC->PDC_TPR = (unsigned int) address; - pPDC->PDC_TCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_EnableTx -//* \brief Enable transmit -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_EnableTx ( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_TXTEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_EnableRx -//* \brief Enable receive -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_EnableRx ( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_RXTEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_DisableTx -//* \brief Disable transmit -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_DisableTx ( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_DisableRx -//* \brief Disable receive -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_DisableRx ( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_IsTxEmpty -//* \brief Test if the current transfer descriptor has been sent -//*---------------------------------------------------------------------------- -__inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - return !(pPDC->PDC_TCR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_IsNextTxEmpty -//* \brief Test if the next transfer descriptor has been moved to the current td -//*---------------------------------------------------------------------------- -__inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - return !(pPDC->PDC_TNCR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_IsRxEmpty -//* \brief Test if the current transfer descriptor has been filled -//*---------------------------------------------------------------------------- -__inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - return !(pPDC->PDC_RCR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_IsNextRxEmpty -//* \brief Test if the next transfer descriptor has been moved to the current td -//*---------------------------------------------------------------------------- -__inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - return !(pPDC->PDC_RNCR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_Open -//* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_Open ( - AT91PS_PDC pPDC) // \arg pointer to a PDC controller -{ - //* Disable the RX and TX PDC transfer requests - AT91F_PDC_DisableRx(pPDC); - AT91F_PDC_DisableTx(pPDC); - - //* Reset all Counter register Next buffer first - AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); - AT91F_PDC_SetTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetRx(pPDC, (char *) 0, 0); - - //* Enable the RX and TX PDC transfer requests - AT91F_PDC_EnableRx(pPDC); - AT91F_PDC_EnableTx(pPDC); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_Close -//* \brief Close PDC: disable TX and RX reset transfer descriptors -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_Close ( - AT91PS_PDC pPDC) // \arg pointer to a PDC controller -{ - //* Disable the RX and TX PDC transfer requests - AT91F_PDC_DisableRx(pPDC); - AT91F_PDC_DisableTx(pPDC); - - //* Reset all Counter register Next buffer first - AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); - AT91F_PDC_SetTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetRx(pPDC, (char *) 0, 0); - -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SendFrame -//* \brief Close PDC: disable TX and RX reset transfer descriptors -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PDC_SendFrame( - AT91PS_PDC pPDC, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - if (AT91F_PDC_IsTxEmpty(pPDC)) { - //* Buffer and next buffer can be initialized - AT91F_PDC_SetTx(pPDC, pBuffer, szBuffer); - AT91F_PDC_SetNextTx(pPDC, pNextBuffer, szNextBuffer); - return 2; - } - else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { - //* Only one buffer can be initialized - AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); - return 1; - } - else { - //* All buffer are in use... - return 0; - } -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_ReceiveFrame -//* \brief Close PDC: disable TX and RX reset transfer descriptors -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PDC_ReceiveFrame ( - AT91PS_PDC pPDC, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - if (AT91F_PDC_IsRxEmpty(pPDC)) { - //* Buffer and next buffer can be initialized - AT91F_PDC_SetRx(pPDC, pBuffer, szBuffer); - AT91F_PDC_SetNextRx(pPDC, pNextBuffer, szNextBuffer); - return 2; - } - else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { - //* Only one buffer can be initialized - AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); - return 1; - } - else { - //* All buffer are in use... - return 0; - } -} -/* ***************************************************************************** - SOFTWARE API FOR DBGU - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_InterruptEnable -//* \brief Enable DBGU Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_DBGU_InterruptEnable( - AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller - unsigned int flag) // \arg dbgu interrupt to be enabled -{ - pDbgu->DBGU_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_InterruptDisable -//* \brief Disable DBGU Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_DBGU_InterruptDisable( - AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller - unsigned int flag) // \arg dbgu interrupt to be disabled -{ - pDbgu->DBGU_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_GetInterruptMaskStatus -//* \brief Return DBGU Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status - AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller -{ - return pDbgu->DBGU_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_IsInterruptMasked -//* \brief Test if DBGU Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_DBGU_IsInterruptMasked( - AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR PIO - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgPeriph -//* \brief Enable pins to be drived by peripheral -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgPeriph( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int periphAEnable, // \arg PERIPH A to enable - unsigned int periphBEnable) // \arg PERIPH B to enable - -{ - pPio->PIO_ASR = periphAEnable; - pPio->PIO_BSR = periphBEnable; - pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgOutput -//* \brief Enable PIO in output mode -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgOutput( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int pioEnable) // \arg PIO to be enabled -{ - pPio->PIO_PER = pioEnable; // Set in PIO mode - pPio->PIO_OER = pioEnable; // Configure in Output -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgInput -//* \brief Enable PIO in input mode -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgInput( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int inputEnable) // \arg PIO to be enabled -{ - // Disable output - pPio->PIO_ODR = inputEnable; - pPio->PIO_PER = inputEnable; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgOpendrain -//* \brief Configure PIO in open drain -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgOpendrain( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int multiDrvEnable) // \arg pio to be configured in open drain -{ - // Configure the multi-drive option - pPio->PIO_MDDR = ~multiDrvEnable; - pPio->PIO_MDER = multiDrvEnable; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgPullup -//* \brief Enable pullup on PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgPullup( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int pullupEnable) // \arg enable pullup on PIO -{ - // Connect or not Pullup - pPio->PIO_PPUDR = ~pullupEnable; - pPio->PIO_PPUER = pullupEnable; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgDirectDrive -//* \brief Enable direct drive on PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgDirectDrive( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int directDrive) // \arg PIO to be configured with direct drive - -{ - // Configure the Direct Drive - pPio->PIO_OWDR = ~directDrive; - pPio->PIO_OWER = directDrive; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgInputFilter -//* \brief Enable input filter on input PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgInputFilter( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int inputFilter) // \arg PIO to be configured with input filter - -{ - // Configure the Direct Drive - pPio->PIO_IFDR = ~inputFilter; - pPio->PIO_IFER = inputFilter; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetInput -//* \brief Return PIO input value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetInput( // \return PIO input - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_PDSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsInputSet -//* \brief Test if PIO is input flag is active -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsInputSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetInput(pPio) & flag); -} - - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_SetOutput -//* \brief Set to 1 output PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_SetOutput( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg output to be set -{ - pPio->PIO_SODR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_ClearOutput -//* \brief Set to 0 output PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_ClearOutput( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg output to be cleared -{ - pPio->PIO_CODR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_ForceOutput -//* \brief Force output when Direct drive option is enabled -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_ForceOutput( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg output to be forced -{ - pPio->PIO_ODSR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_Enable -//* \brief Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_Enable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio to be enabled -{ - pPio->PIO_PER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_Disable -//* \brief Disable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_Disable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio to be disabled -{ - pPio->PIO_PDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetStatus -//* \brief Return PIO Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_PSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsSet -//* \brief Test if PIO is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_OutputEnable -//* \brief Output Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_OutputEnable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio output to be enabled -{ - pPio->PIO_OER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_OutputDisable -//* \brief Output Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_OutputDisable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio output to be disabled -{ - pPio->PIO_ODR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetOutputStatus -//* \brief Return PIO Output Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_OSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsOuputSet -//* \brief Test if PIO Output is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsOutputSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetOutputStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_InputFilterEnable -//* \brief Input Filter Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_InputFilterEnable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio input filter to be enabled -{ - pPio->PIO_IFER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_InputFilterDisable -//* \brief Input Filter Disable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_InputFilterDisable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio input filter to be disabled -{ - pPio->PIO_IFDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetInputFilterStatus -//* \brief Return PIO Input Filter Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_IFSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsInputFilterSet -//* \brief Test if PIO Input filter is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsInputFilterSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetOutputDataStatus -//* \brief Return PIO Output Data Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_ODSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_InterruptEnable -//* \brief Enable PIO Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_InterruptEnable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio interrupt to be enabled -{ - pPio->PIO_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_InterruptDisable -//* \brief Disable PIO Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_InterruptDisable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio interrupt to be disabled -{ - pPio->PIO_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetInterruptMaskStatus -//* \brief Return PIO Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetInterruptStatus -//* \brief Return PIO Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_ISR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsInterruptMasked -//* \brief Test if PIO Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsInterruptMasked( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsInterruptSet -//* \brief Test if PIO Interrupt is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsInterruptSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetInterruptStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_MultiDriverEnable -//* \brief Multi Driver Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_MultiDriverEnable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio to be enabled -{ - pPio->PIO_MDER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_MultiDriverDisable -//* \brief Multi Driver Disable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_MultiDriverDisable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio to be disabled -{ - pPio->PIO_MDDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetMultiDriverStatus -//* \brief Return PIO Multi Driver Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_MDSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsMultiDriverSet -//* \brief Test if PIO MultiDriver is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsMultiDriverSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_A_RegisterSelection -//* \brief PIO A Register Selection -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_A_RegisterSelection( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio A register selection -{ - pPio->PIO_ASR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_B_RegisterSelection -//* \brief PIO B Register Selection -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_B_RegisterSelection( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio B register selection -{ - pPio->PIO_BSR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_Get_AB_RegisterStatus -//* \brief Return PIO Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_ABSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsAB_RegisterSet -//* \brief Test if PIO AB Register is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsAB_RegisterSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_OutputWriteEnable -//* \brief Output Write Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_OutputWriteEnable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio output write to be enabled -{ - pPio->PIO_OWER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_OutputWriteDisable -//* \brief Output Write Disable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_OutputWriteDisable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio output write to be disabled -{ - pPio->PIO_OWDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetOutputWriteStatus -//* \brief Return PIO Output Write Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_OWSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsOutputWriteSet -//* \brief Test if PIO OutputWrite is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsOutputWriteSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetCfgPullup -//* \brief Return PIO Configuration Pullup -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_PPUSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsOutputDataStatusSet -//* \brief Test if PIO Output Data Status is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsOutputDataStatusSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsCfgPullupStatusSet -//* \brief Test if PIO Configuration Pullup Status is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsCfgPullupStatusSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (~AT91F_PIO_GetCfgPullup(pPio) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR PMC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_CfgSysClkEnableReg -//* \brief Configure the System Clock Enable Register of the PMC controller -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_CfgSysClkEnableReg ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int mode) -{ - //* Write to the SCER register - pPMC->PMC_SCER = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_CfgSysClkDisableReg -//* \brief Configure the System Clock Disable Register of the PMC controller -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_CfgSysClkDisableReg ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int mode) -{ - //* Write to the SCDR register - pPMC->PMC_SCDR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_GetSysClkStatusReg -//* \brief Return the System Clock Status Register of the PMC controller -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_GetSysClkStatusReg ( - AT91PS_PMC pPMC // pointer to a CAN controller - ) -{ - return pPMC->PMC_SCSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_EnablePeriphClock -//* \brief Enable peripheral clock -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_EnablePeriphClock ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int periphIds) // \arg IDs of peripherals to enable -{ - pPMC->PMC_PCER = periphIds; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_DisablePeriphClock -//* \brief Disable peripheral clock -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_DisablePeriphClock ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int periphIds) // \arg IDs of peripherals to enable -{ - pPMC->PMC_PCDR = periphIds; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_GetPeriphClock -//* \brief Get peripheral clock status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_GetPeriphClock ( - AT91PS_PMC pPMC) // \arg pointer to PMC controller -{ - return pPMC->PMC_PCSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_CfgMainOscillatorReg -//* \brief Cfg the main oscillator -//*---------------------------------------------------------------------------- -__inline void AT91F_CKGR_CfgMainOscillatorReg ( - AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller - unsigned int mode) -{ - pCKGR->CKGR_MOR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_GetMainOscillatorReg -//* \brief Cfg the main oscillator -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( - AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller -{ - return pCKGR->CKGR_MOR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_EnableMainOscillator -//* \brief Enable the main oscillator -//*---------------------------------------------------------------------------- -__inline void AT91F_CKGR_EnableMainOscillator( - AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller -{ - pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_DisableMainOscillator -//* \brief Disable the main oscillator -//*---------------------------------------------------------------------------- -__inline void AT91F_CKGR_DisableMainOscillator ( - AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller -{ - pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_CfgMainOscStartUpTime -//* \brief Cfg MOR Register according to the main osc startup time -//*---------------------------------------------------------------------------- -__inline void AT91F_CKGR_CfgMainOscStartUpTime ( - AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller - unsigned int startup_time, // \arg main osc startup time in microsecond (us) - unsigned int slowClock) // \arg slowClock in Hz -{ - pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; - pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_GetMainClockFreqReg -//* \brief Cfg the main oscillator -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( - AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller -{ - return pCKGR->CKGR_MCFR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_GetMainClock -//* \brief Return Main clock in Hz -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CKGR_GetMainClock ( - AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller - unsigned int slowClock) // \arg slowClock in Hz -{ - return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_CfgMCKReg -//* \brief Cfg Master Clock Register -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_CfgMCKReg ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int mode) -{ - pPMC->PMC_MCKR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_GetMCKReg -//* \brief Return Master Clock Register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_GetMCKReg( - AT91PS_PMC pPMC) // \arg pointer to PMC controller -{ - return pPMC->PMC_MCKR; -} - -//*------------------------------------------------------------------------------ -//* \fn AT91F_PMC_GetMasterClock -//* \brief Return master clock in Hz which correponds to processor clock for ARM7 -//*------------------------------------------------------------------------------ -__inline unsigned int AT91F_PMC_GetMasterClock ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller - unsigned int slowClock) // \arg slowClock in Hz -{ - unsigned int reg = pPMC->PMC_MCKR; - unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); - unsigned int pllDivider, pllMultiplier; - - switch (reg & AT91C_PMC_CSS) { - case AT91C_PMC_CSS_SLOW_CLK: // Slow clock selected - return slowClock / prescaler; - case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected - return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; - case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected - reg = pCKGR->CKGR_PLLR; - pllDivider = (reg & AT91C_CKGR_DIV); - pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; - return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; - } - return 0; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_EnablePCK -//* \brief Enable peripheral clock -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_EnablePCK ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 - unsigned int mode) -{ - pPMC->PMC_PCKR[pck] = mode; - pPMC->PMC_SCER = (1 << pck) << 8; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_DisablePCK -//* \brief Enable peripheral clock -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_DisablePCK ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 -{ - pPMC->PMC_SCDR = (1 << pck) << 8; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_EnableIt -//* \brief Enable PMC interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_EnableIt ( - AT91PS_PMC pPMC, // pointer to a PMC controller - unsigned int flag) // IT to be enabled -{ - //* Write to the IER register - pPMC->PMC_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_DisableIt -//* \brief Disable PMC interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_DisableIt ( - AT91PS_PMC pPMC, // pointer to a PMC controller - unsigned int flag) // IT to be disabled -{ - //* Write to the IDR register - pPMC->PMC_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_GetStatus -//* \brief Return PMC Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status - AT91PS_PMC pPMC) // pointer to a PMC controller -{ - return pPMC->PMC_SR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_GetInterruptMaskStatus -//* \brief Return PMC Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status - AT91PS_PMC pPMC) // pointer to a PMC controller -{ - return pPMC->PMC_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_IsInterruptMasked -//* \brief Test if PMC Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_IsInterruptMasked( - AT91PS_PMC pPMC, // \arg pointer to a PMC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_IsStatusSet -//* \brief Test if PMC Status is Set -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_IsStatusSet( - AT91PS_PMC pPMC, // \arg pointer to a PMC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PMC_GetStatus(pPMC) & flag); -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_CKGR_CfgPLLReg -// \brief Cfg the PLL Register -// ---------------------------------------------------------------------------- -__inline void AT91F_CKGR_CfgPLLReg ( - AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller - unsigned int mode) -{ - pCKGR->CKGR_PLLR = mode; -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_CKGR_GetPLLReg -// \brief Get the PLL Register -// ---------------------------------------------------------------------------- -__inline unsigned int AT91F_CKGR_GetPLLReg ( - AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller -{ - return pCKGR->CKGR_PLLR; -} - - -/* ***************************************************************************** - SOFTWARE API FOR RSTC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTSoftReset -//* \brief Start Software Reset -//*---------------------------------------------------------------------------- -__inline void AT91F_RSTSoftReset( - AT91PS_RSTC pRSTC, - unsigned int reset) -{ - pRSTC->RSTC_RCR = (0xA5000000 | reset); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTSetMode -//* \brief Set Reset Mode -//*---------------------------------------------------------------------------- -__inline void AT91F_RSTSetMode( - AT91PS_RSTC pRSTC, - unsigned int mode) -{ - pRSTC->RSTC_RMR = (0xA5000000 | mode); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTGetMode -//* \brief Get Reset Mode -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_RSTGetMode( - AT91PS_RSTC pRSTC) -{ - return (pRSTC->RSTC_RMR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTGetStatus -//* \brief Get Reset Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_RSTGetStatus( - AT91PS_RSTC pRSTC) -{ - return (pRSTC->RSTC_RSR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTIsSoftRstActive -//* \brief Return !=0 if software reset is still not completed -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_RSTIsSoftRstActive( - AT91PS_RSTC pRSTC) -{ - return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); -} -/* ***************************************************************************** - SOFTWARE API FOR RTTC - ***************************************************************************** */ -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_SetRTT_TimeBase() -//* \brief Set the RTT prescaler according to the TimeBase in ms -//*-------------------------------------------------------------------------------------- -__inline unsigned int AT91F_RTTSetTimeBase( - AT91PS_RTTC pRTTC, - unsigned int ms) -{ - if (ms > 2000) - return 1; // AT91C_TIME_OUT_OF_RANGE - pRTTC->RTTC_RTMR &= ~0xFFFF; - pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); - return 0; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTTSetPrescaler() -//* \brief Set the new prescaler value -//*-------------------------------------------------------------------------------------- -__inline unsigned int AT91F_RTTSetPrescaler( - AT91PS_RTTC pRTTC, - unsigned int rtpres) -{ - pRTTC->RTTC_RTMR &= ~0xFFFF; - pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); - return (pRTTC->RTTC_RTMR); -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTTRestart() -//* \brief Restart the RTT prescaler -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTRestart( - AT91PS_RTTC pRTTC) -{ - pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; -} - - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_SetAlarmINT() -//* \brief Enable RTT Alarm Interrupt -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTSetAlarmINT( - AT91PS_RTTC pRTTC) -{ - pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_ClearAlarmINT() -//* \brief Disable RTT Alarm Interrupt -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTClearAlarmINT( - AT91PS_RTTC pRTTC) -{ - pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_SetRttIncINT() -//* \brief Enable RTT INC Interrupt -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTSetRttIncINT( - AT91PS_RTTC pRTTC) -{ - pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_ClearRttIncINT() -//* \brief Disable RTT INC Interrupt -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTClearRttIncINT( - AT91PS_RTTC pRTTC) -{ - pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_SetAlarmValue() -//* \brief Set RTT Alarm Value -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTSetAlarmValue( - AT91PS_RTTC pRTTC, unsigned int alarm) -{ - pRTTC->RTTC_RTAR = alarm; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_GetAlarmValue() -//* \brief Get RTT Alarm Value -//*-------------------------------------------------------------------------------------- -__inline unsigned int AT91F_RTTGetAlarmValue( - AT91PS_RTTC pRTTC) -{ - return(pRTTC->RTTC_RTAR); -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTTGetStatus() -//* \brief Read the RTT status -//*-------------------------------------------------------------------------------------- -__inline unsigned int AT91F_RTTGetStatus( - AT91PS_RTTC pRTTC) -{ - return(pRTTC->RTTC_RTSR); -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_ReadValue() -//* \brief Read the RTT value -//*-------------------------------------------------------------------------------------- -__inline unsigned int AT91F_RTTReadValue( - AT91PS_RTTC pRTTC) -{ - register volatile unsigned int val1,val2; - do - { - val1 = pRTTC->RTTC_RTVR; - val2 = pRTTC->RTTC_RTVR; - } - while(val1 != val2); - return(val1); -} -/* ***************************************************************************** - SOFTWARE API FOR PITC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITInit -//* \brief System timer init : period in second, system clock freq in MHz -//*---------------------------------------------------------------------------- -__inline void AT91F_PITInit( - AT91PS_PITC pPITC, - unsigned int period, - unsigned int pit_frequency) -{ - pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 - pPITC->PITC_PIMR |= AT91C_PITC_PITEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITSetPIV -//* \brief Set the PIT Periodic Interval Value -//*---------------------------------------------------------------------------- -__inline void AT91F_PITSetPIV( - AT91PS_PITC pPITC, - unsigned int piv) -{ - pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITEnableInt -//* \brief Enable PIT periodic interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PITEnableInt( - AT91PS_PITC pPITC) -{ - pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITDisableInt -//* \brief Disable PIT periodic interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PITDisableInt( - AT91PS_PITC pPITC) -{ - pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITGetMode -//* \brief Read PIT mode register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PITGetMode( - AT91PS_PITC pPITC) -{ - return(pPITC->PITC_PIMR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITGetStatus -//* \brief Read PIT status register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PITGetStatus( - AT91PS_PITC pPITC) -{ - return(pPITC->PITC_PISR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITGetPIIR -//* \brief Read PIT CPIV and PICNT without ressetting the counters -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PITGetPIIR( - AT91PS_PITC pPITC) -{ - return(pPITC->PITC_PIIR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITGetPIVR -//* \brief Read System timer CPIV and PICNT without ressetting the counters -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PITGetPIVR( - AT91PS_PITC pPITC) -{ - return(pPITC->PITC_PIVR); -} -/* ***************************************************************************** - SOFTWARE API FOR WDTC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_WDTSetMode -//* \brief Set Watchdog Mode Register -//*---------------------------------------------------------------------------- -__inline void AT91F_WDTSetMode( - AT91PS_WDTC pWDTC, - unsigned int Mode) -{ - pWDTC->WDTC_WDMR = Mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_WDTRestart -//* \brief Restart Watchdog -//*---------------------------------------------------------------------------- -__inline void AT91F_WDTRestart( - AT91PS_WDTC pWDTC) -{ - pWDTC->WDTC_WDCR = 0xA5000001; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_WDTSGettatus -//* \brief Get Watchdog Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_WDTSGettatus( - AT91PS_WDTC pWDTC) -{ - return(pWDTC->WDTC_WDSR & 0x3); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_WDTGetPeriod -//* \brief Translate ms into Watchdog Compatible value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) -{ - if ((ms < 4) || (ms > 16000)) - return 0; - return((ms << 8) / 1000); -} -/* ***************************************************************************** - SOFTWARE API FOR VREG - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_VREG_Enable_LowPowerMode -//* \brief Enable VREG Low Power Mode -//*---------------------------------------------------------------------------- -__inline void AT91F_VREG_Enable_LowPowerMode( - AT91PS_VREG pVREG) -{ - pVREG->VREG_MR |= AT91C_VREG_PSTDBY; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_VREG_Disable_LowPowerMode -//* \brief Disable VREG Low Power Mode -//*---------------------------------------------------------------------------- -__inline void AT91F_VREG_Disable_LowPowerMode( - AT91PS_VREG pVREG) -{ - pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; -}/* ***************************************************************************** - SOFTWARE API FOR MC - ***************************************************************************** */ - -#define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_Remap -//* \brief Make Remap -//*---------------------------------------------------------------------------- -__inline void AT91F_MC_Remap (void) // -{ - AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; - - pMC->MC_RCR = AT91C_MC_RCB; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_CfgModeReg -//* \brief Configure the EFC Mode Register of the MC controller -//*---------------------------------------------------------------------------- -__inline void AT91F_MC_EFC_CfgModeReg ( - AT91PS_MC pMC, // pointer to a MC controller - unsigned int mode) // mode register -{ - // Write to the FMR register - pMC->MC_FMR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_GetModeReg -//* \brief Return MC EFC Mode Regsiter -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_MC_EFC_GetModeReg( - AT91PS_MC pMC) // pointer to a MC controller -{ - return pMC->MC_FMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_ComputeFMCN -//* \brief Return MC EFC Mode Regsiter -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_MC_EFC_ComputeFMCN( - int master_clock) // master clock in Hz -{ - return (master_clock/1000000 +2); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_PerformCmd -//* \brief Perform EFC Command -//*---------------------------------------------------------------------------- -__inline void AT91F_MC_EFC_PerformCmd ( - AT91PS_MC pMC, // pointer to a MC controller - unsigned int transfer_cmd) -{ - pMC->MC_FCR = transfer_cmd; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_GetStatus -//* \brief Return MC EFC Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_MC_EFC_GetStatus( - AT91PS_MC pMC) // pointer to a MC controller -{ - return pMC->MC_FSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_IsInterruptMasked -//* \brief Test if EFC MC Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_MC_EFC_IsInterruptMasked( - AT91PS_MC pMC, // \arg pointer to a MC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_MC_EFC_GetModeReg(pMC) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_IsInterruptSet -//* \brief Test if EFC MC Interrupt is Set -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_MC_EFC_IsInterruptSet( - AT91PS_MC pMC, // \arg pointer to a MC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_MC_EFC_GetStatus(pMC) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR SPI - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_CfgCs -//* \brief Configure SPI chip select register -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_CfgCs ( - AT91PS_SPI pSPI, // pointer to a SPI controller - int cs, // SPI cs number (0 to 3) - int val) // chip select register -{ - //* Write to the CSR register - *(pSPI->SPI_CSR + cs) = val; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_EnableIt -//* \brief Enable SPI interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_EnableIt ( - AT91PS_SPI pSPI, // pointer to a SPI controller - unsigned int flag) // IT to be enabled -{ - //* Write to the IER register - pSPI->SPI_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_DisableIt -//* \brief Disable SPI interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_DisableIt ( - AT91PS_SPI pSPI, // pointer to a SPI controller - unsigned int flag) // IT to be disabled -{ - //* Write to the IDR register - pSPI->SPI_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_Reset -//* \brief Reset the SPI controller -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_Reset ( - AT91PS_SPI pSPI // pointer to a SPI controller - ) -{ - //* Write to the CR register - pSPI->SPI_CR = AT91C_SPI_SWRST; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_Enable -//* \brief Enable the SPI controller -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_Enable ( - AT91PS_SPI pSPI // pointer to a SPI controller - ) -{ - //* Write to the CR register - pSPI->SPI_CR = AT91C_SPI_SPIEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_Disable -//* \brief Disable the SPI controller -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_Disable ( - AT91PS_SPI pSPI // pointer to a SPI controller - ) -{ - //* Write to the CR register - pSPI->SPI_CR = AT91C_SPI_SPIDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_CfgMode -//* \brief Enable the SPI controller -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_CfgMode ( - AT91PS_SPI pSPI, // pointer to a SPI controller - int mode) // mode register -{ - //* Write to the MR register - pSPI->SPI_MR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_CfgPCS -//* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_CfgPCS ( - AT91PS_SPI pSPI, // pointer to a SPI controller - char PCS_Device) // PCS of the Device -{ - //* Write to the MR register - pSPI->SPI_MR &= 0xFFF0FFFF; - pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_ReceiveFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SPI_ReceiveFrame ( - AT91PS_SPI pSPI, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_ReceiveFrame( - (AT91PS_PDC) &(pSPI->SPI_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_SendFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is bSPIy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SPI_SendFrame( - AT91PS_SPI pSPI, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_SendFrame( - (AT91PS_PDC) &(pSPI->SPI_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_Close -//* \brief Close SPI: disable IT disable transfert, close PDC -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_Close ( - AT91PS_SPI pSPI) // \arg pointer to a SPI controller -{ - //* Reset all the Chip Select register - pSPI->SPI_CSR[0] = 0 ; - pSPI->SPI_CSR[1] = 0 ; - pSPI->SPI_CSR[2] = 0 ; - pSPI->SPI_CSR[3] = 0 ; - - //* Reset the SPI mode - pSPI->SPI_MR = 0 ; - - //* Disable all interrupts - pSPI->SPI_IDR = 0xFFFFFFFF ; - - //* Abort the Peripheral Data Transfers - AT91F_PDC_Close((AT91PS_PDC) &(pSPI->SPI_RPR)); - - //* Disable receiver and transmitter and stop any activity immediately - pSPI->SPI_CR = AT91C_SPI_SPIDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_PutChar -//* \brief Send a character,does not check if ready to send -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_PutChar ( - AT91PS_SPI pSPI, - unsigned int character, - unsigned int cs_number ) -{ - unsigned int value_for_cs; - value_for_cs = (~(1 << cs_number)) & 0xF; //Place a zero among a 4 ONEs number - pSPI->SPI_TDR = (character & 0xFFFF) | (value_for_cs << 16); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_GetChar -//* \brief Receive a character,does not check if a character is available -//*---------------------------------------------------------------------------- -__inline int AT91F_SPI_GetChar ( - const AT91PS_SPI pSPI) -{ - return((pSPI->SPI_RDR) & 0xFFFF); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_GetInterruptMaskStatus -//* \brief Return SPI Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Interrupt Mask Status - AT91PS_SPI pSpi) // \arg pointer to a SPI controller -{ - return pSpi->SPI_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_IsInterruptMasked -//* \brief Test if SPI Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_SPI_IsInterruptMasked( - AT91PS_SPI pSpi, // \arg pointer to a SPI controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_SPI_GetInterruptMaskStatus(pSpi) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR USART - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_Baudrate -//* \brief Calculate the baudrate -//* Standard Asynchronous Mode : 8 bits , 1 stop , no parity -#define AT91C_US_ASYNC_MODE ( AT91C_US_USMODE_NORMAL + \ - AT91C_US_NBSTOP_1_BIT + \ - AT91C_US_PAR_NONE + \ - AT91C_US_CHRL_8_BITS + \ - AT91C_US_CLKS_CLOCK ) - -//* Standard External Asynchronous Mode : 8 bits , 1 stop , no parity -#define AT91C_US_ASYNC_SCK_MODE ( AT91C_US_USMODE_NORMAL + \ - AT91C_US_NBSTOP_1_BIT + \ - AT91C_US_PAR_NONE + \ - AT91C_US_CHRL_8_BITS + \ - AT91C_US_CLKS_EXT ) - -//* Standard Synchronous Mode : 8 bits , 1 stop , no parity -#define AT91C_US_SYNC_MODE ( AT91C_US_SYNC + \ - AT91C_US_USMODE_NORMAL + \ - AT91C_US_NBSTOP_1_BIT + \ - AT91C_US_PAR_NONE + \ - AT91C_US_CHRL_8_BITS + \ - AT91C_US_CLKS_CLOCK ) - -//* SCK used Label -#define AT91C_US_SCK_USED (AT91C_US_CKLO | AT91C_US_CLKS_EXT) - -//* Standard ISO T=0 Mode : 8 bits , 1 stop , parity -#define AT91C_US_ISO_READER_MODE ( AT91C_US_USMODE_ISO7816_0 + \ - AT91C_US_CLKS_CLOCK +\ - AT91C_US_NBSTOP_1_BIT + \ - AT91C_US_PAR_EVEN + \ - AT91C_US_CHRL_8_BITS + \ - AT91C_US_CKLO +\ - AT91C_US_OVER) - -//* Standard IRDA mode -#define AT91C_US_ASYNC_IRDA_MODE ( AT91C_US_USMODE_IRDA + \ - AT91C_US_NBSTOP_1_BIT + \ - AT91C_US_PAR_NONE + \ - AT91C_US_CHRL_8_BITS + \ - AT91C_US_CLKS_CLOCK ) - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_Baudrate -//* \brief Caluculate baud_value according to the main clock and the baud rate -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_Baudrate ( - const unsigned int main_clock, // \arg peripheral clock - const unsigned int baud_rate) // \arg UART baudrate -{ - unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); - if ((baud_value % 10) >= 5) - baud_value = (baud_value / 10) + 1; - else - baud_value /= 10; - return baud_value; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_SetBaudrate -//* \brief Set the baudrate according to the CPU clock -//*---------------------------------------------------------------------------- -__inline void AT91F_US_SetBaudrate ( - AT91PS_USART pUSART, // \arg pointer to a USART controller - unsigned int mainClock, // \arg peripheral clock - unsigned int speed) // \arg UART baudrate -{ - //* Define the baud rate divisor register - pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_SetTimeguard -//* \brief Set USART timeguard -//*---------------------------------------------------------------------------- -__inline void AT91F_US_SetTimeguard ( - AT91PS_USART pUSART, // \arg pointer to a USART controller - unsigned int timeguard) // \arg timeguard value -{ - //* Write the Timeguard Register - pUSART->US_TTGR = timeguard ; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_EnableIt -//* \brief Enable USART IT -//*---------------------------------------------------------------------------- -__inline void AT91F_US_EnableIt ( - AT91PS_USART pUSART, // \arg pointer to a USART controller - unsigned int flag) // \arg IT to be enabled -{ - //* Write to the IER register - pUSART->US_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_DisableIt -//* \brief Disable USART IT -//*---------------------------------------------------------------------------- -__inline void AT91F_US_DisableIt ( - AT91PS_USART pUSART, // \arg pointer to a USART controller - unsigned int flag) // \arg IT to be disabled -{ - //* Write to the IER register - pUSART->US_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_Configure -//* \brief Configure USART -//*---------------------------------------------------------------------------- -__inline void AT91F_US_Configure ( - AT91PS_USART pUSART, // \arg pointer to a USART controller - unsigned int mainClock, // \arg peripheral clock - unsigned int mode , // \arg mode Register to be programmed - unsigned int baudRate , // \arg baudrate to be programmed - unsigned int timeguard ) // \arg timeguard to be programmed -{ - //* Disable interrupts - pUSART->US_IDR = (unsigned int) -1; - - //* Reset receiver and transmitter - pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS ; - - //* Define the baud rate divisor register - AT91F_US_SetBaudrate(pUSART, mainClock, baudRate); - - //* Write the Timeguard Register - AT91F_US_SetTimeguard(pUSART, timeguard); - - //* Clear Transmit and Receive Counters - AT91F_PDC_Open((AT91PS_PDC) &(pUSART->US_RPR)); - - //* Define the USART mode - pUSART->US_MR = mode ; - -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_EnableRx -//* \brief Enable receiving characters -//*---------------------------------------------------------------------------- -__inline void AT91F_US_EnableRx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Enable receiver - pUSART->US_CR = AT91C_US_RXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_EnableTx -//* \brief Enable sending characters -//*---------------------------------------------------------------------------- -__inline void AT91F_US_EnableTx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Enable transmitter - pUSART->US_CR = AT91C_US_TXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_ResetRx -//* \brief Reset Receiver and re-enable it -//*---------------------------------------------------------------------------- -__inline void AT91F_US_ResetRx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Reset receiver - pUSART->US_CR = AT91C_US_RSTRX; - //* Re-Enable receiver - pUSART->US_CR = AT91C_US_RXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_ResetTx -//* \brief Reset Transmitter and re-enable it -//*---------------------------------------------------------------------------- -__inline void AT91F_US_ResetTx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Reset transmitter - pUSART->US_CR = AT91C_US_RSTTX; - //* Enable transmitter - pUSART->US_CR = AT91C_US_TXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_DisableRx -//* \brief Disable Receiver -//*---------------------------------------------------------------------------- -__inline void AT91F_US_DisableRx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Disable receiver - pUSART->US_CR = AT91C_US_RXDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_DisableTx -//* \brief Disable Transmitter -//*---------------------------------------------------------------------------- -__inline void AT91F_US_DisableTx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Disable transmitter - pUSART->US_CR = AT91C_US_TXDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_Close -//* \brief Close USART: disable IT disable receiver and transmitter, close PDC -//*---------------------------------------------------------------------------- -__inline void AT91F_US_Close ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Reset the baud rate divisor register - pUSART->US_BRGR = 0 ; - - //* Reset the USART mode - pUSART->US_MR = 0 ; - - //* Reset the Timeguard Register - pUSART->US_TTGR = 0; - - //* Disable all interrupts - pUSART->US_IDR = 0xFFFFFFFF ; - - //* Abort the Peripheral Data Transfers - AT91F_PDC_Close((AT91PS_PDC) &(pUSART->US_RPR)); - - //* Disable receiver and transmitter and stop any activity immediately - pUSART->US_CR = AT91C_US_TXDIS | AT91C_US_RXDIS | AT91C_US_RSTTX | AT91C_US_RSTRX ; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_TxReady -//* \brief Return 1 if a character can be written in US_THR -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_TxReady ( - AT91PS_USART pUSART ) // \arg pointer to a USART controller -{ - return (pUSART->US_CSR & AT91C_US_TXRDY); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_RxReady -//* \brief Return 1 if a character can be read in US_RHR -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_RxReady ( - AT91PS_USART pUSART ) // \arg pointer to a USART controller -{ - return (pUSART->US_CSR & AT91C_US_RXRDY); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_Error -//* \brief Return the error flag -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_Error ( - AT91PS_USART pUSART ) // \arg pointer to a USART controller -{ - return (pUSART->US_CSR & - (AT91C_US_OVRE | // Overrun error - AT91C_US_FRAME | // Framing error - AT91C_US_PARE)); // Parity error -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_PutChar -//* \brief Send a character,does not check if ready to send -//*---------------------------------------------------------------------------- -__inline void AT91F_US_PutChar ( - AT91PS_USART pUSART, - int character ) -{ - pUSART->US_THR = (character & 0x1FF); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_GetChar -//* \brief Receive a character,does not check if a character is available -//*---------------------------------------------------------------------------- -__inline int AT91F_US_GetChar ( - const AT91PS_USART pUSART) -{ - return((pUSART->US_RHR) & 0x1FF); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_SendFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_SendFrame( - AT91PS_USART pUSART, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_SendFrame( - (AT91PS_PDC) &(pUSART->US_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_ReceiveFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_ReceiveFrame ( - AT91PS_USART pUSART, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_ReceiveFrame( - (AT91PS_PDC) &(pUSART->US_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_SetIrdaFilter -//* \brief Set the value of IrDa filter tregister -//*---------------------------------------------------------------------------- -__inline void AT91F_US_SetIrdaFilter ( - AT91PS_USART pUSART, - unsigned char value -) -{ - pUSART->US_IF = value; -} - -/* ***************************************************************************** - SOFTWARE API FOR SSC - ***************************************************************************** */ -//* Define the standard I2S mode configuration - -//* Configuration to set in the SSC Transmit Clock Mode Register -//* Parameters : nb_bit_by_slot : 8, 16 or 32 bits -//* nb_slot_by_frame : number of channels -#define AT91C_I2S_ASY_MASTER_TX_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ - AT91C_SSC_CKS_DIV +\ - AT91C_SSC_CKO_CONTINOUS +\ - AT91C_SSC_CKG_NONE +\ - AT91C_SSC_START_FALL_RF +\ - AT91C_SSC_STTOUT +\ - ((1<<16) & AT91C_SSC_STTDLY) +\ - ((((nb_bit_by_slot*nb_slot_by_frame)/2)-1) <<24)) - - -//* Configuration to set in the SSC Transmit Frame Mode Register -//* Parameters : nb_bit_by_slot : 8, 16 or 32 bits -//* nb_slot_by_frame : number of channels -#define AT91C_I2S_ASY_TX_FRAME_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ - (nb_bit_by_slot-1) +\ - AT91C_SSC_MSBF +\ - (((nb_slot_by_frame-1)<<8) & AT91C_SSC_DATNB) +\ - (((nb_bit_by_slot-1)<<16) & AT91C_SSC_FSLEN) +\ - AT91C_SSC_FSOS_NEGATIVE) - - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_SetBaudrate -//* \brief Set the baudrate according to the CPU clock -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_SetBaudrate ( - AT91PS_SSC pSSC, // \arg pointer to a SSC controller - unsigned int mainClock, // \arg peripheral clock - unsigned int speed) // \arg SSC baudrate -{ - unsigned int baud_value; - //* Define the baud rate divisor register - if (speed == 0) - baud_value = 0; - else - { - baud_value = (unsigned int) (mainClock * 10)/(2*speed); - if ((baud_value % 10) >= 5) - baud_value = (baud_value / 10) + 1; - else - baud_value /= 10; - } - - pSSC->SSC_CMR = baud_value; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_Configure -//* \brief Configure SSC -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_Configure ( - AT91PS_SSC pSSC, // \arg pointer to a SSC controller - unsigned int syst_clock, // \arg System Clock Frequency - unsigned int baud_rate, // \arg Expected Baud Rate Frequency - unsigned int clock_rx, // \arg Receiver Clock Parameters - unsigned int mode_rx, // \arg mode Register to be programmed - unsigned int clock_tx, // \arg Transmitter Clock Parameters - unsigned int mode_tx) // \arg mode Register to be programmed -{ - //* Disable interrupts - pSSC->SSC_IDR = (unsigned int) -1; - - //* Reset receiver and transmitter - pSSC->SSC_CR = AT91C_SSC_SWRST | AT91C_SSC_RXDIS | AT91C_SSC_TXDIS ; - - //* Define the Clock Mode Register - AT91F_SSC_SetBaudrate(pSSC, syst_clock, baud_rate); - - //* Write the Receive Clock Mode Register - pSSC->SSC_RCMR = clock_rx; - - //* Write the Transmit Clock Mode Register - pSSC->SSC_TCMR = clock_tx; - - //* Write the Receive Frame Mode Register - pSSC->SSC_RFMR = mode_rx; - - //* Write the Transmit Frame Mode Register - pSSC->SSC_TFMR = mode_tx; - - //* Clear Transmit and Receive Counters - AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); - - -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_EnableRx -//* \brief Enable receiving datas -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_EnableRx ( - AT91PS_SSC pSSC) // \arg pointer to a SSC controller -{ - //* Enable receiver - pSSC->SSC_CR = AT91C_SSC_RXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_DisableRx -//* \brief Disable receiving datas -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_DisableRx ( - AT91PS_SSC pSSC) // \arg pointer to a SSC controller -{ - //* Disable receiver - pSSC->SSC_CR = AT91C_SSC_RXDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_EnableTx -//* \brief Enable sending datas -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_EnableTx ( - AT91PS_SSC pSSC) // \arg pointer to a SSC controller -{ - //* Enable transmitter - pSSC->SSC_CR = AT91C_SSC_TXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_DisableTx -//* \brief Disable sending datas -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_DisableTx ( - AT91PS_SSC pSSC) // \arg pointer to a SSC controller -{ - //* Disable transmitter - pSSC->SSC_CR = AT91C_SSC_TXDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_EnableIt -//* \brief Enable SSC IT -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_EnableIt ( - AT91PS_SSC pSSC, // \arg pointer to a SSC controller - unsigned int flag) // \arg IT to be enabled -{ - //* Write to the IER register - pSSC->SSC_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_DisableIt -//* \brief Disable SSC IT -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_DisableIt ( - AT91PS_SSC pSSC, // \arg pointer to a SSC controller - unsigned int flag) // \arg IT to be disabled -{ - //* Write to the IDR register - pSSC->SSC_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_ReceiveFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initialized with Next Buffer, 0 if PDC is busy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SSC_ReceiveFrame ( - AT91PS_SSC pSSC, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_ReceiveFrame( - (AT91PS_PDC) &(pSSC->SSC_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_SendFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initialized with Next Buffer, 0 if PDC is busy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SSC_SendFrame( - AT91PS_SSC pSSC, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_SendFrame( - (AT91PS_PDC) &(pSSC->SSC_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_GetInterruptMaskStatus -//* \brief Return SSC Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Interrupt Mask Status - AT91PS_SSC pSsc) // \arg pointer to a SSC controller -{ - return pSsc->SSC_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_IsInterruptMasked -//* \brief Test if SSC Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_SSC_IsInterruptMasked( - AT91PS_SSC pSsc, // \arg pointer to a SSC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_SSC_GetInterruptMaskStatus(pSsc) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR TWI - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_EnableIt -//* \brief Enable TWI IT -//*---------------------------------------------------------------------------- -__inline void AT91F_TWI_EnableIt ( - AT91PS_TWI pTWI, // \arg pointer to a TWI controller - unsigned int flag) // \arg IT to be enabled -{ - //* Write to the IER register - pTWI->TWI_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_DisableIt -//* \brief Disable TWI IT -//*---------------------------------------------------------------------------- -__inline void AT91F_TWI_DisableIt ( - AT91PS_TWI pTWI, // \arg pointer to a TWI controller - unsigned int flag) // \arg IT to be disabled -{ - //* Write to the IDR register - pTWI->TWI_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_Configure -//* \brief Configure TWI in master mode -//*---------------------------------------------------------------------------- -__inline void AT91F_TWI_Configure ( AT91PS_TWI pTWI ) // \arg pointer to a TWI controller -{ - //* Disable interrupts - pTWI->TWI_IDR = (unsigned int) -1; - - //* Reset peripheral - pTWI->TWI_CR = AT91C_TWI_SWRST; - - //* Set Master mode - pTWI->TWI_CR = AT91C_TWI_MSEN; - -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_GetInterruptMaskStatus -//* \brief Return TWI Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_TWI_GetInterruptMaskStatus( // \return TWI Interrupt Mask Status - AT91PS_TWI pTwi) // \arg pointer to a TWI controller -{ - return pTwi->TWI_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_IsInterruptMasked -//* \brief Test if TWI Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_TWI_IsInterruptMasked( - AT91PS_TWI pTwi, // \arg pointer to a TWI controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_TWI_GetInterruptMaskStatus(pTwi) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR PWMC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_GetStatus -//* \brief Return PWM Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PWMC_GetStatus( // \return PWM Interrupt Status - AT91PS_PWMC pPWM) // pointer to a PWM controller -{ - return pPWM->PWMC_SR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_InterruptEnable -//* \brief Enable PWM Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_InterruptEnable( - AT91PS_PWMC pPwm, // \arg pointer to a PWM controller - unsigned int flag) // \arg PWM interrupt to be enabled -{ - pPwm->PWMC_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_InterruptDisable -//* \brief Disable PWM Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_InterruptDisable( - AT91PS_PWMC pPwm, // \arg pointer to a PWM controller - unsigned int flag) // \arg PWM interrupt to be disabled -{ - pPwm->PWMC_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_GetInterruptMaskStatus -//* \brief Return PWM Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PWMC_GetInterruptMaskStatus( // \return PWM Interrupt Mask Status - AT91PS_PWMC pPwm) // \arg pointer to a PWM controller -{ - return pPwm->PWMC_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_IsInterruptMasked -//* \brief Test if PWM Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PWMC_IsInterruptMasked( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PWMC_GetInterruptMaskStatus(pPWM) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_IsStatusSet -//* \brief Test if PWM Interrupt is Set -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PWMC_IsStatusSet( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PWMC_GetStatus(pPWM) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_CfgChannel -//* \brief Test if PWM Interrupt is Set -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CfgChannel( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int channelId, // \arg PWM channel ID - unsigned int mode, // \arg PWM mode - unsigned int period, // \arg PWM period - unsigned int duty) // \arg PWM duty cycle -{ - pPWM->PWMC_CH[channelId].PWMC_CMR = mode; - pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; - pPWM->PWMC_CH[channelId].PWMC_CPRDR = period; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_StartChannel -//* \brief Enable channel -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_StartChannel( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int flag) // \arg Channels IDs to be enabled -{ - pPWM->PWMC_ENA = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_StopChannel -//* \brief Disable channel -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_StopChannel( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int flag) // \arg Channels IDs to be enabled -{ - pPWM->PWMC_DIS = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_UpdateChannel -//* \brief Update Period or Duty Cycle -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_UpdateChannel( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int channelId, // \arg PWM channel ID - unsigned int update) // \arg Channels IDs to be enabled -{ - pPWM->PWMC_CH[channelId].PWMC_CUPDR = update; -} - -/* ***************************************************************************** - SOFTWARE API FOR UDP - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EnableIt -//* \brief Enable UDP IT -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EnableIt ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned int flag) // \arg IT to be enabled -{ - //* Write to the IER register - pUDP->UDP_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_DisableIt -//* \brief Disable UDP IT -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_DisableIt ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned int flag) // \arg IT to be disabled -{ - //* Write to the IDR register - pUDP->UDP_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_SetAddress -//* \brief Set UDP functional address -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_SetAddress ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char address) // \arg new UDP address -{ - pUDP->UDP_FADDR = (AT91C_UDP_FEN | address); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EnableEp -//* \brief Enable Endpoint -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EnableEp ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - pUDP->UDP_CSR[endpoint] |= AT91C_UDP_EPEDS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_DisableEp -//* \brief Enable Endpoint -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_DisableEp ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - pUDP->UDP_CSR[endpoint] &= ~AT91C_UDP_EPEDS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_SetState -//* \brief Set UDP Device state -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_SetState ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned int flag) // \arg new UDP address -{ - pUDP->UDP_GLBSTATE &= ~(AT91C_UDP_FADDEN | AT91C_UDP_CONFG); - pUDP->UDP_GLBSTATE |= flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_GetState -//* \brief return UDP Device state -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_UDP_GetState ( // \return the UDP device state - AT91PS_UDP pUDP) // \arg pointer to a UDP controller -{ - return (pUDP->UDP_GLBSTATE & (AT91C_UDP_FADDEN | AT91C_UDP_CONFG)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_ResetEp -//* \brief Reset UDP endpoint -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_ResetEp ( // \return the UDP device state - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned int flag) // \arg Endpoints to be reset -{ - pUDP->UDP_RSTEP = flag; - pUDP->UDP_RSTEP = 0; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpStall -//* \brief Endpoint will STALL requests -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EpStall( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - pUDP->UDP_CSR[endpoint] |= AT91C_UDP_FORCESTALL; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpWrite -//* \brief Write value in the DPR -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EpWrite( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint, // \arg endpoint number - unsigned char value) // \arg value to be written in the DPR -{ - pUDP->UDP_FDR[endpoint] = value; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpRead -//* \brief Return value from the DPR -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_UDP_EpRead( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - return pUDP->UDP_FDR[endpoint]; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpEndOfWr -//* \brief Notify the UDP that values in DPR are ready to be sent -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EpEndOfWr( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - pUDP->UDP_CSR[endpoint] |= AT91C_UDP_TXPKTRDY; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpClear -//* \brief Clear flag in the endpoint CSR register -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EpClear( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint, // \arg endpoint number - unsigned int flag) // \arg flag to be cleared -{ - pUDP->UDP_CSR[endpoint] &= ~(flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpSet -//* \brief Set flag in the endpoint CSR register -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EpSet( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint, // \arg endpoint number - unsigned int flag) // \arg flag to be cleared -{ - pUDP->UDP_CSR[endpoint] |= flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpStatus -//* \brief Return the endpoint CSR register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_UDP_EpStatus( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - return pUDP->UDP_CSR[endpoint]; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_GetInterruptMaskStatus -//* \brief Return UDP Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_UDP_GetInterruptMaskStatus( - AT91PS_UDP pUdp) // \arg pointer to a UDP controller -{ - return pUdp->UDP_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_IsInterruptMasked -//* \brief Test if UDP Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_UDP_IsInterruptMasked( - AT91PS_UDP pUdp, // \arg pointer to a UDP controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_UDP_GetInterruptMaskStatus(pUdp) & flag); -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_UDP_InterruptStatusRegister -// \brief Return the Interrupt Status Register -// ---------------------------------------------------------------------------- -__inline unsigned int AT91F_UDP_InterruptStatusRegister( - AT91PS_UDP pUDP ) // \arg pointer to a UDP controller -{ - return pUDP->UDP_ISR; -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_UDP_InterruptClearRegister -// \brief Clear Interrupt Register -// ---------------------------------------------------------------------------- -__inline void AT91F_UDP_InterruptClearRegister ( - AT91PS_UDP pUDP, // \arg pointer to UDP controller - unsigned int flag) // \arg IT to be cleat -{ - pUDP->UDP_ICR = flag; -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_UDP_EnableTransceiver -// \brief Enable transceiver -// ---------------------------------------------------------------------------- -__inline void AT91F_UDP_EnableTransceiver( - AT91PS_UDP pUDP ) // \arg pointer to a UDP controller -{ - pUDP->UDP_TXVC &= ~AT91C_UDP_TXVDIS; -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_UDP_DisableTransceiver -// \brief Disable transceiver -// ---------------------------------------------------------------------------- -__inline void AT91F_UDP_DisableTransceiver( - AT91PS_UDP pUDP ) // \arg pointer to a UDP controller -{ - pUDP->UDP_TXVC = AT91C_UDP_TXVDIS; -} - -/* ***************************************************************************** - SOFTWARE API FOR TC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC_InterruptEnable -//* \brief Enable TC Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_TC_InterruptEnable( - AT91PS_TC pTc, // \arg pointer to a TC controller - unsigned int flag) // \arg TC interrupt to be enabled -{ - pTc->TC_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC_InterruptDisable -//* \brief Disable TC Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_TC_InterruptDisable( - AT91PS_TC pTc, // \arg pointer to a TC controller - unsigned int flag) // \arg TC interrupt to be disabled -{ - pTc->TC_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC_GetInterruptMaskStatus -//* \brief Return TC Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_TC_GetInterruptMaskStatus( // \return TC Interrupt Mask Status - AT91PS_TC pTc) // \arg pointer to a TC controller -{ - return pTc->TC_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC_IsInterruptMasked -//* \brief Test if TC Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_TC_IsInterruptMasked( - AT91PS_TC pTc, // \arg pointer to a TC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_TC_GetInterruptMaskStatus(pTc) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR CAN - ***************************************************************************** */ -#define STANDARD_FORMAT 0 -#define EXTENDED_FORMAT 1 - -//*---------------------------------------------------------------------------- -//* \fn AT91F_InitMailboxRegisters() -//* \brief Configure the corresponding mailbox -//*---------------------------------------------------------------------------- -__inline void AT91F_InitMailboxRegisters(AT91PS_CAN_MB CAN_Mailbox, - int mode_reg, - int acceptance_mask_reg, - int id_reg, - int data_low_reg, - int data_high_reg, - int control_reg) -{ - CAN_Mailbox->CAN_MB_MCR = 0x0; - CAN_Mailbox->CAN_MB_MMR = mode_reg; - CAN_Mailbox->CAN_MB_MAM = acceptance_mask_reg; - CAN_Mailbox->CAN_MB_MID = id_reg; - CAN_Mailbox->CAN_MB_MDL = data_low_reg; - CAN_Mailbox->CAN_MB_MDH = data_high_reg; - CAN_Mailbox->CAN_MB_MCR = control_reg; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_EnableCAN() -//* \brief -//*---------------------------------------------------------------------------- -__inline void AT91F_EnableCAN( - AT91PS_CAN pCAN) // pointer to a CAN controller -{ - pCAN->CAN_MR |= AT91C_CAN_CANEN; - - // Wait for WAKEUP flag raising <=> 11-recessive-bit were scanned by the transceiver - while( (pCAN->CAN_SR & AT91C_CAN_WAKEUP) != AT91C_CAN_WAKEUP ); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DisableCAN() -//* \brief -//*---------------------------------------------------------------------------- -__inline void AT91F_DisableCAN( - AT91PS_CAN pCAN) // pointer to a CAN controller -{ - pCAN->CAN_MR &= ~AT91C_CAN_CANEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_EnableIt -//* \brief Enable CAN interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_EnableIt ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int flag) // IT to be enabled -{ - //* Write to the IER register - pCAN->CAN_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_DisableIt -//* \brief Disable CAN interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_DisableIt ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int flag) // IT to be disabled -{ - //* Write to the IDR register - pCAN->CAN_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetStatus -//* \brief Return CAN Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetStatus( // \return CAN Interrupt Status - AT91PS_CAN pCAN) // pointer to a CAN controller -{ - return pCAN->CAN_SR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetInterruptMaskStatus -//* \brief Return CAN Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetInterruptMaskStatus( // \return CAN Interrupt Mask Status - AT91PS_CAN pCAN) // pointer to a CAN controller -{ - return pCAN->CAN_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_IsInterruptMasked -//* \brief Test if CAN Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_IsInterruptMasked( - AT91PS_CAN pCAN, // \arg pointer to a CAN controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_CAN_GetInterruptMaskStatus(pCAN) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_IsStatusSet -//* \brief Test if CAN Interrupt is Set -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_IsStatusSet( - AT91PS_CAN pCAN, // \arg pointer to a CAN controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_CAN_GetStatus(pCAN) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgModeReg -//* \brief Configure the Mode Register of the CAN controller -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgModeReg ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int mode) // mode register -{ - //* Write to the MR register - pCAN->CAN_MR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetModeReg -//* \brief Return the Mode Register of the CAN controller value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetModeReg ( - AT91PS_CAN pCAN // pointer to a CAN controller - ) -{ - return pCAN->CAN_MR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgBaudrateReg -//* \brief Configure the Baudrate of the CAN controller for the network -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgBaudrateReg ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int baudrate_cfg) -{ - //* Write to the BR register - pCAN->CAN_BR = baudrate_cfg; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetBaudrate -//* \brief Return the Baudrate of the CAN controller for the network value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetBaudrate ( - AT91PS_CAN pCAN // pointer to a CAN controller - ) -{ - return pCAN->CAN_BR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetInternalCounter -//* \brief Return CAN Timer Regsiter Value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetInternalCounter ( - AT91PS_CAN pCAN // pointer to a CAN controller - ) -{ - return pCAN->CAN_TIM; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetTimestamp -//* \brief Return CAN Timestamp Register Value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetTimestamp ( - AT91PS_CAN pCAN // pointer to a CAN controller - ) -{ - return pCAN->CAN_TIMESTP; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetErrorCounter -//* \brief Return CAN Error Counter Register Value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetErrorCounter ( - AT91PS_CAN pCAN // pointer to a CAN controller - ) -{ - return pCAN->CAN_ECR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_InitTransferRequest -//* \brief Request for a transfer on the corresponding mailboxes -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_InitTransferRequest ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int transfer_cmd) -{ - pCAN->CAN_TCR = transfer_cmd; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_InitAbortRequest -//* \brief Abort the corresponding mailboxes -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_InitAbortRequest ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int abort_cmd) -{ - pCAN->CAN_ACR = abort_cmd; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageModeReg -//* \brief Program the Message Mode Register -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageModeReg ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int mode) -{ - CAN_Mailbox->CAN_MB_MMR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageModeReg -//* \brief Return the Message Mode Register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageModeReg ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageIDReg -//* \brief Program the Message ID Register -//* \brief Version == 0 for Standard messsage, Version == 1 for Extended -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageIDReg ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int id, - unsigned char version) -{ - if(version==0) // IDvA Standard Format - CAN_Mailbox->CAN_MB_MID = id<<18; - else // IDvB Extended Format - CAN_Mailbox->CAN_MB_MID = id | (1<<29); // set MIDE bit -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageIDReg -//* \brief Return the Message ID Register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageIDReg ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MID; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageAcceptanceMaskReg -//* \brief Program the Message Acceptance Mask Register -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageAcceptanceMaskReg ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int mask) -{ - CAN_Mailbox->CAN_MB_MAM = mask; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageAcceptanceMaskReg -//* \brief Return the Message Acceptance Mask Register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageAcceptanceMaskReg ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MAM; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetFamilyID -//* \brief Return the Message ID Register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetFamilyID ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MFID; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageCtrl -//* \brief Request and config for a transfer on the corresponding mailbox -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageCtrlReg ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int message_ctrl_cmd) -{ - CAN_Mailbox->CAN_MB_MCR = message_ctrl_cmd; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageStatus -//* \brief Return CAN Mailbox Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageStatus ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageDataLow -//* \brief Program data low value -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageDataLow ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int data) -{ - CAN_Mailbox->CAN_MB_MDL = data; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageDataLow -//* \brief Return data low value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageDataLow ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MDL; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageDataHigh -//* \brief Program data high value -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageDataHigh ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int data) -{ - CAN_Mailbox->CAN_MB_MDH = data; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageDataHigh -//* \brief Return data high value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageDataHigh ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MDH; -} - -/* ***************************************************************************** - SOFTWARE API FOR ADC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_EnableIt -//* \brief Enable ADC interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_EnableIt ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int flag) // IT to be enabled -{ - //* Write to the IER register - pADC->ADC_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_DisableIt -//* \brief Disable ADC interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_DisableIt ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int flag) // IT to be disabled -{ - //* Write to the IDR register - pADC->ADC_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetStatus -//* \brief Return ADC Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetStatus( // \return ADC Interrupt Status - AT91PS_ADC pADC) // pointer to a ADC controller -{ - return pADC->ADC_SR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetInterruptMaskStatus -//* \brief Return ADC Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetInterruptMaskStatus( // \return ADC Interrupt Mask Status - AT91PS_ADC pADC) // pointer to a ADC controller -{ - return pADC->ADC_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_IsInterruptMasked -//* \brief Test if ADC Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_IsInterruptMasked( - AT91PS_ADC pADC, // \arg pointer to a ADC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_ADC_GetInterruptMaskStatus(pADC) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_IsStatusSet -//* \brief Test if ADC Status is Set -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_IsStatusSet( - AT91PS_ADC pADC, // \arg pointer to a ADC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_ADC_GetStatus(pADC) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_CfgModeReg -//* \brief Configure the Mode Register of the ADC controller -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_CfgModeReg ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int mode) // mode register -{ - //* Write to the MR register - pADC->ADC_MR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetModeReg -//* \brief Return the Mode Register of the ADC controller value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetModeReg ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_MR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_CfgTimings -//* \brief Configure the different necessary timings of the ADC controller -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_CfgTimings ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int mck_clock, // in MHz - unsigned int adc_clock, // in MHz - unsigned int startup_time, // in us - unsigned int sample_and_hold_time) // in ns -{ - unsigned int prescal,startup,shtim; - - prescal = mck_clock/(2*adc_clock) - 1; - startup = adc_clock*startup_time/8 - 1; - shtim = adc_clock*sample_and_hold_time/1000 - 1; - - //* Write to the MR register - pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_EnableChannel -//* \brief Return ADC Timer Register Value -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_EnableChannel ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int channel) // mode register -{ - //* Write to the CHER register - pADC->ADC_CHER = channel; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_DisableChannel -//* \brief Return ADC Timer Register Value -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_DisableChannel ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int channel) // mode register -{ - //* Write to the CHDR register - pADC->ADC_CHDR = channel; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetChannelStatus -//* \brief Return ADC Timer Register Value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetChannelStatus ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CHSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_StartConversion -//* \brief Software request for a analog to digital conversion -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_StartConversion ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - pADC->ADC_CR = AT91C_ADC_START; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_SoftReset -//* \brief Software reset -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_SoftReset ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - pADC->ADC_CR = AT91C_ADC_SWRST; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetLastConvertedData -//* \brief Return the Last Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetLastConvertedData ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_LCDR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH0 -//* \brief Return the Channel 0 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH0 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR0; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH1 -//* \brief Return the Channel 1 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH1 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR1; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH2 -//* \brief Return the Channel 2 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH2 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR2; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH3 -//* \brief Return the Channel 3 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH3 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR3; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH4 -//* \brief Return the Channel 4 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH4 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR4; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH5 -//* \brief Return the Channel 5 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH5 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR5; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH6 -//* \brief Return the Channel 6 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH6 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR6; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH7 -//* \brief Return the Channel 7 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH7 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR7; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_CfgPMC -//* \brief Enable Peripheral clock in PMC for DBGU -//*---------------------------------------------------------------------------- -__inline void AT91F_DBGU_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_CfgPIO -//* \brief Configure PIO controllers to drive DBGU signals -//*---------------------------------------------------------------------------- -__inline void AT91F_DBGU_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA27_DRXD ) | - ((unsigned int) AT91C_PA28_DTXD ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_CfgPMC -//* \brief Enable Peripheral clock in PMC for PMC -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_CfgPIO -//* \brief Configure PIO controllers to drive PMC signals -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB30_PCK2 ) | - ((unsigned int) AT91C_PB29_PCK1 ), // Peripheral A - ((unsigned int) AT91C_PB20_PCK0 ) | - ((unsigned int) AT91C_PB0_PCK0 ) | - ((unsigned int) AT91C_PB22_PCK2 ) | - ((unsigned int) AT91C_PB21_PCK1 )); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PA30_PCK2 ) | - ((unsigned int) AT91C_PA13_PCK1 ) | - ((unsigned int) AT91C_PA27_PCK3 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_VREG_CfgPMC -//* \brief Enable Peripheral clock in PMC for VREG -//*---------------------------------------------------------------------------- -__inline void AT91F_VREG_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTC_CfgPMC -//* \brief Enable Peripheral clock in PMC for RSTC -//*---------------------------------------------------------------------------- -__inline void AT91F_RSTC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_CfgPMC -//* \brief Enable Peripheral clock in PMC for SSC -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SSC)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_CfgPIO -//* \brief Configure PIO controllers to drive SSC signals -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA25_RK ) | - ((unsigned int) AT91C_PA22_TK ) | - ((unsigned int) AT91C_PA21_TF ) | - ((unsigned int) AT91C_PA24_RD ) | - ((unsigned int) AT91C_PA26_RF ) | - ((unsigned int) AT91C_PA23_TD ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_WDTC_CfgPMC -//* \brief Enable Peripheral clock in PMC for WDTC -//*---------------------------------------------------------------------------- -__inline void AT91F_WDTC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US1_CfgPMC -//* \brief Enable Peripheral clock in PMC for US1 -//*---------------------------------------------------------------------------- -__inline void AT91F_US1_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_US1)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US1_CfgPIO -//* \brief Configure PIO controllers to drive US1 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_US1_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PB26_RI1 ) | - ((unsigned int) AT91C_PB24_DSR1 ) | - ((unsigned int) AT91C_PB23_DCD1 ) | - ((unsigned int) AT91C_PB25_DTR1 )); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA7_SCK1 ) | - ((unsigned int) AT91C_PA8_RTS1 ) | - ((unsigned int) AT91C_PA6_TXD1 ) | - ((unsigned int) AT91C_PA5_RXD1 ) | - ((unsigned int) AT91C_PA9_CTS1 ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US0_CfgPMC -//* \brief Enable Peripheral clock in PMC for US0 -//*---------------------------------------------------------------------------- -__inline void AT91F_US0_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_US0)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US0_CfgPIO -//* \brief Configure PIO controllers to drive US0 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_US0_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA0_RXD0 ) | - ((unsigned int) AT91C_PA4_CTS0 ) | - ((unsigned int) AT91C_PA3_RTS0 ) | - ((unsigned int) AT91C_PA2_SCK0 ) | - ((unsigned int) AT91C_PA1_TXD0 ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI1_CfgPMC -//* \brief Enable Peripheral clock in PMC for SPI1 -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI1_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SPI1)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI1_CfgPIO -//* \brief Configure PIO controllers to drive SPI1 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI1_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PB11_SPI1_NPCS2) | - ((unsigned int) AT91C_PB10_SPI1_NPCS1) | - ((unsigned int) AT91C_PB16_SPI1_NPCS3)); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PA22_SPI1_SPCK) | - ((unsigned int) AT91C_PA3_SPI1_NPCS2) | - ((unsigned int) AT91C_PA26_SPI1_NPCS2) | - ((unsigned int) AT91C_PA25_SPI1_NPCS1) | - ((unsigned int) AT91C_PA2_SPI1_NPCS1) | - ((unsigned int) AT91C_PA24_SPI1_MISO) | - ((unsigned int) AT91C_PA4_SPI1_NPCS3) | - ((unsigned int) AT91C_PA29_SPI1_NPCS3) | - ((unsigned int) AT91C_PA21_SPI1_NPCS0) | - ((unsigned int) AT91C_PA23_SPI1_MOSI)); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI0_CfgPMC -//* \brief Enable Peripheral clock in PMC for SPI0 -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI0_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SPI0)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI0_CfgPIO -//* \brief Configure PIO controllers to drive SPI0 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI0_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PB13_SPI0_NPCS1) | - ((unsigned int) AT91C_PB14_SPI0_NPCS2) | - ((unsigned int) AT91C_PB17_SPI0_NPCS3)); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA16_SPI0_MISO) | - ((unsigned int) AT91C_PA13_SPI0_NPCS1) | - ((unsigned int) AT91C_PA14_SPI0_NPCS2) | - ((unsigned int) AT91C_PA12_SPI0_NPCS0) | - ((unsigned int) AT91C_PA17_SPI0_MOSI) | - ((unsigned int) AT91C_PA15_SPI0_NPCS3) | - ((unsigned int) AT91C_PA18_SPI0_SPCK), // Peripheral A - ((unsigned int) AT91C_PA7_SPI0_NPCS1) | - ((unsigned int) AT91C_PA8_SPI0_NPCS2) | - ((unsigned int) AT91C_PA9_SPI0_NPCS3)); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITC_CfgPMC -//* \brief Enable Peripheral clock in PMC for PITC -//*---------------------------------------------------------------------------- -__inline void AT91F_PITC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_CfgPMC -//* \brief Enable Peripheral clock in PMC for AIC -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_FIQ) | - ((unsigned int) 1 << AT91C_ID_IRQ0) | - ((unsigned int) 1 << AT91C_ID_IRQ1)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_CfgPIO -//* \brief Configure PIO controllers to drive AIC signals -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA30_IRQ0 ) | - ((unsigned int) AT91C_PA29_FIQ ), // Peripheral A - ((unsigned int) AT91C_PA14_IRQ1 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_CfgPMC -//* \brief Enable Peripheral clock in PMC for TWI -//*---------------------------------------------------------------------------- -__inline void AT91F_TWI_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_TWI)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_CfgPIO -//* \brief Configure PIO controllers to drive TWI signals -//*---------------------------------------------------------------------------- -__inline void AT91F_TWI_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA11_TWCK ) | - ((unsigned int) AT91C_PA10_TWD ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_CfgPMC -//* \brief Enable Peripheral clock in PMC for ADC -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_ADC)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_CfgPIO -//* \brief Configure PIO controllers to drive ADC signals -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PB18_ADTRG )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWMC_CH3_CfgPIO -//* \brief Configure PIO controllers to drive PWMC_CH3 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CH3_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB22_PWM3 ), // Peripheral A - ((unsigned int) AT91C_PB30_PWM3 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWMC_CH2_CfgPIO -//* \brief Configure PIO controllers to drive PWMC_CH2 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CH2_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB21_PWM2 ), // Peripheral A - ((unsigned int) AT91C_PB29_PWM2 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWMC_CH1_CfgPIO -//* \brief Configure PIO controllers to drive PWMC_CH1 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CH1_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB20_PWM1 ), // Peripheral A - ((unsigned int) AT91C_PB28_PWM1 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWMC_CH0_CfgPIO -//* \brief Configure PIO controllers to drive PWMC_CH0 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CH0_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB19_PWM0 ), // Peripheral A - ((unsigned int) AT91C_PB27_PWM0 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RTTC_CfgPMC -//* \brief Enable Peripheral clock in PMC for RTTC -//*---------------------------------------------------------------------------- -__inline void AT91F_RTTC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_CfgPMC -//* \brief Enable Peripheral clock in PMC for UDP -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_UDP)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_EMAC_CfgPMC -//* \brief Enable Peripheral clock in PMC for EMAC -//*---------------------------------------------------------------------------- -__inline void AT91F_EMAC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_EMAC)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_EMAC_CfgPIO -//* \brief Configure PIO controllers to drive EMAC signals -//*---------------------------------------------------------------------------- -__inline void AT91F_EMAC_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB2_ETX0 ) | - ((unsigned int) AT91C_PB12_ETXER ) | - ((unsigned int) AT91C_PB16_ECOL ) | - ((unsigned int) AT91C_PB15_ERXDV_ECRSDV) | - ((unsigned int) AT91C_PB11_ETX3 ) | - ((unsigned int) AT91C_PB6_ERX1 ) | - ((unsigned int) AT91C_PB13_ERX2 ) | - ((unsigned int) AT91C_PB3_ETX1 ) | - ((unsigned int) AT91C_PB4_ECRS ) | - ((unsigned int) AT91C_PB8_EMDC ) | - ((unsigned int) AT91C_PB5_ERX0 ) | - ((unsigned int) AT91C_PB18_EF100 ) | - ((unsigned int) AT91C_PB14_ERX3 ) | - ((unsigned int) AT91C_PB1_ETXEN ) | - ((unsigned int) AT91C_PB10_ETX2 ) | - ((unsigned int) AT91C_PB0_ETXCK_EREFCK) | - ((unsigned int) AT91C_PB9_EMDIO ) | - ((unsigned int) AT91C_PB7_ERXER ) | - ((unsigned int) AT91C_PB17_ERXCK ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC0_CfgPMC -//* \brief Enable Peripheral clock in PMC for TC0 -//*---------------------------------------------------------------------------- -__inline void AT91F_TC0_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_TC0)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC0_CfgPIO -//* \brief Configure PIO controllers to drive TC0 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_TC0_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB23_TIOA0 ) | - ((unsigned int) AT91C_PB24_TIOB0 ), // Peripheral A - ((unsigned int) AT91C_PB12_TCLK0 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC1_CfgPMC -//* \brief Enable Peripheral clock in PMC for TC1 -//*---------------------------------------------------------------------------- -__inline void AT91F_TC1_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_TC1)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC1_CfgPIO -//* \brief Configure PIO controllers to drive TC1 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_TC1_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB25_TIOA1 ) | - ((unsigned int) AT91C_PB26_TIOB1 ), // Peripheral A - ((unsigned int) AT91C_PB19_TCLK1 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC2_CfgPMC -//* \brief Enable Peripheral clock in PMC for TC2 -//*---------------------------------------------------------------------------- -__inline void AT91F_TC2_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_TC2)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC2_CfgPIO -//* \brief Configure PIO controllers to drive TC2 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_TC2_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB28_TIOB2 ) | - ((unsigned int) AT91C_PB27_TIOA2 ), // Peripheral A - 0); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PA15_TCLK2 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_CfgPMC -//* \brief Enable Peripheral clock in PMC for MC -//*---------------------------------------------------------------------------- -__inline void AT91F_MC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIOA_CfgPMC -//* \brief Enable Peripheral clock in PMC for PIOA -//*---------------------------------------------------------------------------- -__inline void AT91F_PIOA_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_PIOA)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIOB_CfgPMC -//* \brief Enable Peripheral clock in PMC for PIOB -//*---------------------------------------------------------------------------- -__inline void AT91F_PIOB_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_PIOB)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgPMC -//* \brief Enable Peripheral clock in PMC for CAN -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_CAN)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgPIO -//* \brief Configure PIO controllers to drive CAN signals -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA20_CANTX ) | - ((unsigned int) AT91C_PA19_CANRX ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWMC_CfgPMC -//* \brief Enable Peripheral clock in PMC for PWMC -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_PWMC)); -} - -#endif // lib_AT91SAM7X256_H diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.cspy.bat b/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.cspy.bat deleted file mode 100644 index 46433e0a5..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.cspy.bat +++ /dev/null @@ -1,32 +0,0 @@ -@REM This bat file has been generated by the IAR Embeddded Workbench -@REM C-SPY interactive debugger,as an aid to preparing a command -@REM line for running the cspybat command line utility with the -@REM appropriate settings. -@REM -@REM After making some adjustments to this file, you can launch cspybat -@REM by typing the name of this file followed by the name of the debug -@REM file (usually an ubrof file). Note that this file is generated -@REM every time a new debug session is initialized, so you may want to -@REM move or rename the file before making changes. -@REM -@REM Note: some command line arguments cannot be properly generated -@REM by this process. Specifically, the plugin which is responsible -@REM for the Terminal I/O window (and other C runtime functionality) -@REM comes in a special version for cspybat, and the name of that -@REM plugin dll is not known when generating this file. It resides in -@REM the $TOOLKIT_DIR$\bin folder and is usually called XXXbat.dll or -@REM XXXlibsupportbat.dll, where XXX is the name of the corresponding -@REM tool chain. Replace the '' parameter -@REM below with the appropriate file name. Other plugins loaded by -@REM C-SPY are usually not needed by, or will not work in, cspybat -@REM but they are listed at the end of this file for reference. - - -"C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\bin\armproc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\bin\armjlink.dll" %1 --plugin "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\bin\" --macro "C:\svn\cmock\iar\iar_v4\Resource\SAM7_FLASH.mac" --backend -B "--endian" "little" "--cpu" "ARM7TDMI" "--fpu" "None" "--proc_device_desc_file" "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\CONFIG\ioAT91SAM7X256.ddf" "--drv_verify_download" "all" "--proc_driver" "jlink" "--jlink_connection" "USB:0" "--jlink_initial_speed" "32" - - -@REM loaded plugins: -@REM armlibsupport.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\plugins\CodeCoverage\CodeCoverage.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\plugins\Profiling\Profiling.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\plugins\stack\stack.dll diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dbgdt b/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dbgdt deleted file mode 100644 index 7243596cc..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dbgdt +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - 185272727 - - - - - - 100 - - 20 - 1115 - 297 - 74 - - 110$PROJ_DIR$\TermIOInput.txt10 - - - - - - - - TabID-23656-3537 - Debug Log - Debug-Log - - - - TabID-22088-3567 - Build - Build - - - TabID-16970-5692Terminal I/OTerminalIO - - 0 - - - TabID-1637-3541 - Workspace - Workspace - - - cmock_democmock_demo/source - - - - 0 - - - TabID-12385-3544 - Disassembly - Disassembly - - - - - 0 - - - - - - TextEditorC:\svn\cmock\examples\src\Main.c02780680600100000010000001 - - - - - - - iaridepm1debuggergui1-2-2509276-2-2179148129149173302200577598361-2-2509177-2-2179148129149173302129149598361-2-22771388-2-213902791002886326698129149173302 - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dni b/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dni deleted file mode 100644 index 149ec3d7d..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dni +++ /dev/null @@ -1,42 +0,0 @@ -[JLinkDriver] -WatchCond=_ 0 -Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 -Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 -[DisAssemblyWindow] -NumStates=_ 1 -State 1=_ 1 -[StackPlugin] -Enabled=1 -OverflowWarningsEnabled=1 -WarningThreshold=90 -SpWarningsEnabled=1 -WarnHow=0 -UseTrigger=1 -TriggerName=main -LimitSize=0 -ByteLimit=50 -[Log file] -LoggingEnabled=_ 0 -LogFile=_ "" -Category=_ 0 -[TermIOLog] -LoggingEnabled=_ 0 -LogFile=_ "" -[Interrupts] -Enabled=1 -Irq0=_ 0 480549 0 480549 0 0 0 100 0 1 "IRQ 1 0x18 CPSR.I" -Count=1 -[MemoryMap] -Enabled=0 -Base=0 -UseAuto=0 -TypeViolation=1 -UnspecRange=1 -ActionState=1 -[Disassemble mode] -mode=0 -[Breakpoints] -Count=0 -[TraceHelper] -Enabled=0 -ShowSource=1 diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.wsdt b/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.wsdt deleted file mode 100644 index 5b92806fe..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.wsdt +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - cmock_demo/Debug - - - - - - - - - 237272727 - - - - - - - 20111529774 - - - - - 100 - - - - - - - TabID-20770-112 - Workspace - Workspace - - - cmock_democmock_demo/Sourcecmock_demo/source - - - - 0 - - - TabID-10733-1323 - Build - Build - - - - TabID-27316-3469 - Debug Log - Debug-Log - - - - - 0 - - - - - - TextEditorC:\svn\cmock\examples\src\Main.c0056856800100000010000001 - - - - - - - iaridepm1-2-2554328-2-2179148129149173302238095651054-2-22561388-2-213902581002886302108129149173302 - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup.s79 b/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup.s79 deleted file mode 100644 index 73a53fca5..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup.s79 +++ /dev/null @@ -1,266 +0,0 @@ -;- ---------------------------------------------------------------------------- -;- ATMEL Microcontroller Software Support - ROUSSET - -;- ---------------------------------------------------------------------------- -;- DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -;- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -;- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -;- DISCLAIMED. IN NO EVENT SHALL ATMEL 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 source : Cstartup.s79 -;- Object : Generic CStartup -;- 1.0 01/Sep/05 FBr : Creation -;- 1.1 09/Sep/05 JPP : Change Interrupt management -;------------------------------------------------------------------------------ - -;------------------------------------------------------------------------------ -; Include your AT91 Library files -;------------------------------------------------------------------------------ -#include "AT91SAM7X256_inc.h" -;------------------------------------------------------------------------------ - -;------------------------------------------------------------------------------ -; ?RESET -; Reset Vector. -; Normally, segment INTVEC is linked at address 0. -; For debugging purposes, INTVEC may be placed at other addresses. -; A debugger that honors the entry point will start the -; program in a normal way even if INTVEC is not at address 0. -;------------------------------------------------------------------------------ - - PROGRAM ?RESET ;- Begins a program module - RSEG INTRAMEND_REMAP ;- Begins a relocatable segment - RSEG ICODE:CODE (2) ;- Begins a relocatable segment : corresponding address is 32-bit aligned - CODE32 ;- Always ARM mode after reset - ORG 0 ;- Sets the location counter: corresponds to the RESET vector address - -;------------------------------------------------------------------------------ -;- Exception vectors -;------------------------------------------------------------------------------ -;- These vectors can be read at address 0 or at RAM address -;- They ABSOLUTELY requires to be in relative addresssing mode in order to -;- guarantee a valid jump. For the moment, all are just looping. -;- If an exception occurs before remap, this would result in an infinite loop. -;- To ensure if a exeption occurs before start application to infinite loop. -;------------------------------------------------------------------------------ - -reset - B InitReset ; 0x00 Reset handler -undefvec: - B undefvec ; 0x04 Undefined Instruction -swivec: - B swivec ; 0x08 Software Interrupt -pabtvec: - B pabtvec ; 0x0C Prefetch Abort -dabtvec: - B dabtvec ; 0x10 Data Abort -rsvdvec: - B rsvdvec ; 0x14 reserved -irqvec: - B IRQ_Handler_Entry ; 0x18 IRQ - -fiqvec: ; 0x1c FIQ -;------------------------------------------------------------------------------ -;- Function : FIQ_Handler_Entry -;- Treatments : FIQ Controller Interrupt Handler. -;- Called Functions : AIC_FVR[interrupt] -;------------------------------------------------------------------------------ - -FIQ_Handler_Entry: - -;- Switch in SVC/User Mode to allow User Stack access for C code -; because the FIQ is not yet acknowledged - -;- Save and r0 in FIQ_Register - mov r9,r0 - ldr r0 , [r8, #AIC_FVR] - msr CPSR_c,#I_BIT | F_BIT | ARM_MODE_SVC -;- Save scratch/used registers and LR in User Stack - stmfd sp!, { r1-r3, r12, lr} - -;- Branch to the routine pointed by the AIC_FVR - mov r14, pc - bx r0 - -;- Restore scratch/used registers and LR from User Stack - ldmia sp!, { r1-r3, r12, lr} - -;- Leave Interrupts disabled and switch back in FIQ mode - msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ - -;- Restore the R0 ARM_MODE_SVC register - mov r0,r9 - -;- Restore the Program Counter using the LR_fiq directly in the PC - subs pc,lr,#4 - -;------------------------------------------------------------------------------ -;- Manage exception: The exception must be ensure in ARM mode -;------------------------------------------------------------------------------ -;------------------------------------------------------------------------------ -;- Function : IRQ_Handler_Entry -;- Treatments : IRQ Controller Interrupt Handler. -;- Called Functions : AIC_IVR[interrupt] -;------------------------------------------------------------------------------ -IRQ_Handler_Entry: - -;------------------------- -;- Manage Exception Entry -;------------------------- -;- Adjust and save LR_irq in IRQ stack - sub lr, lr, #4 - stmfd sp!, {lr} - -;- Save r0 and SPSR (need to be saved for nested interrupt) - mrs r14, SPSR - stmfd sp!, {r0,r14} - -;- Write in the IVR to support Protect Mode -;- No effect in Normal Mode -;- De-assert the NIRQ and clear the source in Protect Mode - ldr r14, =AT91C_BASE_AIC - ldr r0 , [r14, #AIC_IVR] - str r14, [r14, #AIC_IVR] - -;- Enable Interrupt and Switch in Supervisor Mode - msr CPSR_c, #ARM_MODE_SVC - -;- Save scratch/used registers and LR in User Stack - stmfd sp!, { r1-r3, r12, r14} - -;---------------------------------------------- -;- Branch to the routine pointed by the AIC_IVR -;---------------------------------------------- - mov r14, pc - bx r0 - -;---------------------------------------------- -;- Manage Exception Exit -;---------------------------------------------- -;- Restore scratch/used registers and LR from User Stack - ldmia sp!, { r1-r3, r12, r14} - -;- Disable Interrupt and switch back in IRQ mode - msr CPSR_c, #I_BIT | ARM_MODE_IRQ - -;- Mark the End of Interrupt on the AIC - ldr r14, =AT91C_BASE_AIC - str r14, [r14, #AIC_EOICR] - -;- Restore SPSR_irq and r0 from IRQ stack - ldmia sp!, {r0,r14} - msr SPSR_cxsf, r14 - -;- Restore adjusted LR_irq from IRQ stack directly in the PC - ldmia sp!, {pc}^ - - - -InitReset: - -;------------------------------------------------------------------------------ -;- Low level Init is performed in a C function: AT91F_LowLevelInit -;- Init Stack Pointer to a valid memory area before calling AT91F_LowLevelInit -;------------------------------------------------------------------------------ - -;- Retrieve end of RAM address -__iramend EQU SFB(INTRAMEND_REMAP) ;- Segment begin - - EXTERN AT91F_LowLevelInit - ldr r13,=__iramend ;- Temporary stack in internal RAM for Low Level Init execution - ldr r0,=AT91F_LowLevelInit - mov lr, pc - bx r0 ;- Branch on C function (with interworking) - -;------------------------------------------------------------------------------ -;- Top of Stack Definition -;------------------------------------------------------------------------------ -;- Interrupt and Supervisor Stack are located at the top of internal memory in -;- order to speed the exception handling context saving and restoring. -;- ARM_MODE_SVC (Application, C) Stack is located at the top of the external memory. -;------------------------------------------------------------------------------ - -IRQ_STACK_SIZE EQU (3*8*4) ; 3 words to be saved per interrupt priority level -ARM_MODE_FIQ EQU 0x11 -ARM_MODE_IRQ EQU 0x12 -ARM_MODE_SVC EQU 0x13 -I_BIT EQU 0x80 -F_BIT EQU 0x40 - -;------------------------------------------------------------------------------ -;- Setup the stack for each mode -;------------------------------------------------------------------------------ - ldr r0, =__iramend - -;- Set up Fast Interrupt Mode and set FIQ Mode Stack - msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT -;- Init the FIQ register - ldr r8, =AT91C_BASE_AIC - -;- Set up Interrupt Mode and set IRQ Mode Stack - msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT - mov r13, r0 ; Init stack IRQ - sub r0, r0, #IRQ_STACK_SIZE - -;- Enable interrupt & Set up Supervisor Mode and set Supervisor Mode Stack - msr CPSR_c, #ARM_MODE_SVC - mov r13, r0 - -;------------------------------------------------------------------------------ -; Initialize segments. -;------------------------------------------------------------------------------ -; __segment_init is assumed to use -; instruction set and to be reachable by BL from the ICODE segment -; (it is safest to link them in segment ICODE). -;------------------------------------------------------------------------------ - EXTERN __segment_init - ldr r0,=__segment_init - mov lr, pc - bx r0 - -;------------------------------------------------------------------------------ -;- Branch on C code Main function (with interworking) -;------------------------------------------------------------------------------ - EXTERN main - PUBLIC __main -?jump_to_main: - ldr lr,=?call_exit - ldr r0,=main -__main: - bx r0 - -;------------------------------------------------------------------------------ -;- Loop for ever -;------------------------------------------------------------------------------ -;- End of application. Normally, never occur. -;- Could jump on Software Reset ( B 0x0 ). -;------------------------------------------------------------------------------ -?call_exit: -End - b End - -;------------------------------------------------------------------------------ -;- Exception Vectors -;------------------------------------------------------------------------------ - PUBLIC AT91F_Default_FIQ_handler - PUBLIC AT91F_Default_IRQ_handler - PUBLIC AT91F_Spurious_handler - - CODE32 ; Always ARM mode after exeption - -AT91F_Default_FIQ_handler - b AT91F_Default_FIQ_handler - -AT91F_Default_IRQ_handler - b AT91F_Default_IRQ_handler - -AT91F_Spurious_handler - b AT91F_Spurious_handler - - ENDMOD ;- Terminates the assembly of the current module - END ;- Terminates the assembly of the last module in a file \ No newline at end of file diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup_SAM7.c b/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup_SAM7.c deleted file mode 100644 index 0913da3dd..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup_SAM7.c +++ /dev/null @@ -1,98 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : Cstartup_SAM7.c -// Object : Low level initialisations written in C for IAR Tools -// Creation : FBr 01-Sep-2005 -// 1.0 08-Sep-2005 JPP : Suppress Reset -// ---------------------------------------------------------------------------- - -#include "AT91SAM7X256.h" - -// The following functions must be write in ARM mode this function called directly by exception vector -extern void AT91F_Spurious_handler(void); -extern void AT91F_Default_IRQ_handler(void); -extern void AT91F_Default_FIQ_handler(void); - -//*---------------------------------------------------------------------------- -//* \fn AT91F_LowLevelInit -//* \brief This function performs very low level HW initialization -//* this function can use a Stack, depending the compilation -//* optimization mode -//*---------------------------------------------------------------------------- -void AT91F_LowLevelInit(void) -{ - unsigned char i; - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // EFC Init - ///////////////////////////////////////////////////////////////////////////////////////////////////// - AT91C_BASE_MC->MC_FMR = AT91C_MC_FWS_1FWS; // 1 Wait State necessary to work at 48MHz - - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // Init PMC Step 1. Enable Main Oscillator - // Main Oscillator startup time is board specific: - // Main Oscillator Startup Time worst case (3MHz) corresponds to 15ms (0x40 for AT91C_CKGR_OSCOUNT field) - ///////////////////////////////////////////////////////////////////////////////////////////////////// - AT91C_BASE_PMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (0x40 <<8) | AT91C_CKGR_MOSCEN )); -#ifndef SIMULATE - // Wait Main Oscillator stabilization - while(!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MOSCS)); -#endif - - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // Init PMC Step 2. - // Set PLL to 96MHz (96,109MHz) and UDP Clock to 48MHz - // PLL Startup time depends on PLL RC filter: worst case is choosen - // UDP Clock (48,058MHz) is compliant with the Universal Serial Bus Specification (+/- 0.25% for full speed) - ///////////////////////////////////////////////////////////////////////////////////////////////////// - AT91C_BASE_PMC->PMC_PLLR = AT91C_CKGR_USBDIV_1 | AT91C_CKGR_OUT_0 | AT91C_CKGR_PLLCOUNT | - (AT91C_CKGR_MUL & (72 << 16)) | (AT91C_CKGR_DIV & 14); -#ifndef SIMULATE - // Wait for PLL stabilization - while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_LOCK) ); - // Wait until the master clock is established for the case we already turn on the PLL - while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); -#endif - - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // Init PMC Step 3. - // Selection of Master Clock MCK (equal to Processor Clock PCK) equal to PLL/2 = 48MHz - // The PMC_MCKR register must not be programmed in a single write operation (see. Product Errata Sheet) - ///////////////////////////////////////////////////////////////////////////////////////////////////// - AT91C_BASE_PMC->PMC_MCKR = AT91C_PMC_PRES_CLK_2; -#ifndef SIMULATE - // Wait until the master clock is established - while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); -#endif - - AT91C_BASE_PMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK; -#ifndef SIMULATE - // Wait until the master clock is established - while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); -#endif - - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // Disable Watchdog (write once register) - ///////////////////////////////////////////////////////////////////////////////////////////////////// - AT91C_BASE_WDTC->WDTC_WDMR = AT91C_WDTC_WDDIS; - - //////////////////////////////////////////////////////////////////////////////////////////////////// - // Init AIC: assign corresponding handler for each interrupt source - ///////////////////////////////////////////////////////////////////////////////////////////////////// - AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler ; - for (i = 1; i < 31; i++) { - AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler ; - } - AT91C_BASE_AIC->AIC_SPU = (unsigned int) AT91F_Spurious_handler; -} diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_FLASH.mac b/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_FLASH.mac deleted file mode 100644 index 7c4021aad..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_FLASH.mac +++ /dev/null @@ -1,71 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : SAM7_FLASH.mac -// Object : Generic Macro File for IAR -// 1.0 17/Aug/05 FBr : Creation -// ---------------------------------------------------------------------------- - -/********************************************************************* -* -* _InitRSTC() -* -* Function description -* Initializes the RSTC (Reset controller). -* This makes sense since the default is to not allow user resets, which makes it impossible to -* apply a second RESET via J-Link -*/ -_InitRSTC() { - __writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset -} - -/********************************************************************* -* -* _InitPLL() -* Function description -* Initializes the PMC. -* 1. Enable the Main Oscillator -* 2. Configure PLL to 96MHz -* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz -*/ - _InitPLL() { - - __message "Enable Main Oscillator"; - __writeMemory32(0x00000601,0xFFFFFc20,"Memory"); // MOSC - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) ); - - __message "Set PLL to 96MHz"; - __writeMemory32(0x10191c05,0xFFFFFc2c,"Memory"); // LOCK - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) ); - - __message "Set Master Clock to 48MHz"; - __writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); - __writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); -} - -/********************************************************************* -* -* execUserReset() : JTAG set initially to Full Speed -*/ -execUserReset() { - __message "execUserReset()"; - __emulatorSpeed(30000); // Set JTAG speed to 30kHz to make a hardware reset - __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz) - _InitPLL(); // Allow to debug at JTAG Full Speed - _InitRSTC(); // Enable User Reset to allow execUserReset() execution - __emulatorSpeed(0); // Set JTAG speed to full speed -} - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_RAM.mac b/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_RAM.mac deleted file mode 100644 index a1bf81dc7..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_RAM.mac +++ /dev/null @@ -1,94 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : SAM7_RAM.mac -// Object : Generic Macro File for IAR -// 1.0 17/Aug/05 FBr : Creation -// ---------------------------------------------------------------------------- - -/********************************************************************* -* -* _MapRAMAt0() -* -* Function description -* Maps RAM at 0. -*/ -_MapRAMAt0(){ - __message "Changing mapping: RAM mapped to 0"; - __writeMemory32(0x00000001,0xFFFFFF00,"Memory"); -} - -/********************************************************************* -* -* _InitRSTC() -* -* Function description -* Initializes the RSTC (Reset controller). -* This makes sense since the default is to not allow user resets, which makes it impossible to -* apply a second RESET via J-Link -*/ -_InitRSTC() { - __writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset -} - -/********************************************************************* -* -* _InitPLL() -* Function description -* Initializes the PMC. -* 1. Enable the Main Oscillator -* 2. Configure PLL to 96MHz -* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz -*/ - _InitPLL() { - - __message "Set Main Oscillator"; - __writeMemory32(0x00004001,0xFFFFFc20,"Memory"); // MOSC - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) ); - - __message "Set PLL to 96MHz"; - __writeMemory32(0x10483f0e,0xFFFFFc2c,"Memory"); // LOCK - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) ); - - __message "Set Master Clock to 48MHz"; - __writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); - __writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY - while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); -} - -/********************************************************************* -* -* execUserReset() : JTAG set initially to Full Speed -*/ -execUserReset() { - __message "execUserReset()"; - __emulatorSpeed(30000); // Set JTAG speed to 30kHz to make a hardware reset - __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset - _InitPLL(); // Allow to debug at JTAG Full Speed - _MapRAMAt0(); // Remap RAM to address 0 - __emulatorSpeed(0); // Set JTAG speed to full speed -} - -/********************************************************************* -* -* execUserPreload() : JTAG set initially to 32kHz -*/ -execUserPreload() { - __message "execUserPreload()"; - __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz) - _InitPLL(); // Allow to load Code at JTAG Full Speed - _MapRAMAt0(); // Remap RAM to address 0 - _InitRSTC(); // Enable User Reset to allow execUserReset() execution -} diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_SIM.mac b/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_SIM.mac deleted file mode 100644 index 2be1a4c9b..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_SIM.mac +++ /dev/null @@ -1,67 +0,0 @@ -//========================================================= -// Simulation setup file for esc07_demo project -//========================================================= - -__var _timer0_interrupt_ID; - -irqBreak() -{ - __var __AIC_SMR; - __var __AIC_IECR; - __var __AIC_IVR; - - // read AIC_IECR instead, since not fully supported by simulator - __AIC_IECR = __readMemory32(0xFFFFF120, "Memory"); - if(__AIC_IECR & 0x1000) - { - __AIC_SMR = __readMemory32(0xFFFFF060, "Memory"); - __AIC_IVR = __readMemory32(0xFFFFF0B0, "Memory"); //AIC_IVR = AIC_SVR[x] - __writeMemory32(__AIC_IVR, 0xFFFFF100, "Memory"); //AIC_IVR - __writeMemory32(0x1000, 0xFFFFF10C, "Memory"); //AIC_IPR - __writeMemory32(0x2, 0xFFFFF114, "Memory"); //AIC_CISR - } - - return 0; -} - -setupProcessorRegisters() -{ - // Write TC0_SR.CPCS with correct status for ISR (Clock enabled; RC Compare Flag = TRUE) - __writeMemory32(0x00010010, 0xfffa0020, "Memory"); - - // Set TX ready flag in USART0 status register - // USART0_BASE->US_CSR = AT91C_US_TXRDY - __writeMemory32(0x00000002, 0xfffc0014, "Memory"); -} - -configureTimer0Interrupt() -{ - __var _master_clock_frequency; - __var _timer0_period_cycles; - - // Calculate timer0 frequency in master clock cycles - _master_clock_frequency = 48054857; - _timer0_period_cycles = _master_clock_frequency / 100; - if((_master_clock_frequency % 100) >= 50) - { - _timer0_period_cycles++; - } - - __cancelAllInterrupts(); - __enableInterrupts(); - - _timer0_interrupt_ID = __orderInterrupt("IRQ", _timer0_period_cycles, _timer0_period_cycles, 0, 0, 0, 100); - - if(-1 == _timer0_interrupt_ID) - { - __message "ERROR: failed to order timer 0 interrupt"; - } - - __setCodeBreak("0x18", 0, "irqBreak()", "TRUE", ""); -} - -execUserReset() -{ - setupProcessorRegisters(); - configureTimer0Interrupt(); -} diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_FLASH.icf b/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_FLASH.icf deleted file mode 100644 index ab842a2f5..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_FLASH.icf +++ /dev/null @@ -1,43 +0,0 @@ -/*###ICF### Section handled by ICF editor, don't touch! ****/ -/*-Editor annotation file-*/ -/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ -/*-Specials-*/ -define symbol __ICFEDIT_intvec_start__ = 0x00000000; -/*-Memory Regions-*/ -define symbol __ICFEDIT_region_ROM_start__ = 0x00000100; -define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF; -define symbol __ICFEDIT_region_RAM_start__ = 0x00200000; -define symbol __ICFEDIT_region_RAM_end__ = 0x0020FFFF; -/*-Sizes-*/ -define symbol __ICFEDIT_size_cstack__ = 0x400; -define symbol __ICFEDIT_size_svcstack__ = 0x100; -define symbol __ICFEDIT_size_irqstack__ = 0x100; -define symbol __ICFEDIT_size_fiqstack__ = 0x40; -define symbol __ICFEDIT_size_undstack__ = 0x40; -define symbol __ICFEDIT_size_abtstack__ = 0x40; -define symbol __ICFEDIT_size_heap__ = 0x400; -/**** End of ICF editor section. ###ICF###*/ - - -define memory mem with size = 4G; -define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; -define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; - -define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; -define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; -define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; -define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; -define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; -define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; -define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; - -initialize by copy { readwrite }; -do not initialize { section .noinit }; - -place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; - -place in ROM_region { readonly }; -place in RAM_region { readwrite, - block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, - block UND_STACK, block ABT_STACK, block HEAP }; - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_RAM.icf b/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_RAM.icf deleted file mode 100644 index cc79cda29..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_RAM.icf +++ /dev/null @@ -1,42 +0,0 @@ -/*###ICF### Section handled by ICF editor, don't touch! ****/ -/*-Editor annotation file-*/ -/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ -/*-Specials-*/ -define symbol __ICFEDIT_intvec_start__ = 0x00000000; -/*-Memory Regions-*/ -define symbol __ICFEDIT_region_ROM_start__ = 0x00; -define symbol __ICFEDIT_region_ROM_end__ = 0x00; -define symbol __ICFEDIT_region_RAM_start__ = 0x00000100; -define symbol __ICFEDIT_region_RAM_end__ = 0x0000FFFF; -/*-Sizes-*/ -define symbol __ICFEDIT_size_cstack__ = 0x400; -define symbol __ICFEDIT_size_svcstack__ = 0x100; -define symbol __ICFEDIT_size_irqstack__ = 0x100; -define symbol __ICFEDIT_size_fiqstack__ = 0x40; -define symbol __ICFEDIT_size_undstack__ = 0x40; -define symbol __ICFEDIT_size_abtstack__ = 0x40; -define symbol __ICFEDIT_size_heap__ = 0x800; -/**** End of ICF editor section. ###ICF###*/ - - -define memory mem with size = 4G; -define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; - -define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; -define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; -define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; -define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; -define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; -define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; -define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; - -initialize by copy { readwrite }; -do not initialize { section .noinit }; - -place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; - -place in RAM_region { readonly }; -place in RAM_region { readwrite, - block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, - block UND_STACK, block ABT_STACK, block HEAP }; - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.dep b/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.dep deleted file mode 100644 index 456f4dbae..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.dep +++ /dev/null @@ -1,4204 +0,0 @@ - - - - 2 - 3270150602 - - Binary - - $PROJ_DIR$\Binary\Obj\TimerConductor.o - $TOOLKIT_DIR$\inc\DLib_Defaults.h - $TOOLKIT_DIR$\inc\DLib_Threads.h - $PROJ_DIR$\Binary\Obj\TimerConductor.pbi - $PROJ_DIR$\Binary\List\TimerInterruptConfigurator.lst - $PROJ_DIR$\Binary\Obj\AdcTemperatureSensor.o - $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.h - $PROJ_DIR$\..\..\test\system\src\TimerModel.h - $TOOLKIT_DIR$\inc\ymath.h - $PROJ_DIR$\Binary\Obj\Cstartup_SAM7.o - $TOOLKIT_DIR$\inc\DLib_Product.h - $TOOLKIT_DIR$\inc\math.h - $PROJ_DIR$\Binary\Exe\cmock_demo.hex - $PROJ_DIR$\Binary\Obj\UsartPutChar.pbi - $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.h - $PROJ_DIR$\Binary\Obj\AdcConductor.pbi - $PROJ_DIR$\Binary\List\TimerConfigurator.lst - $PROJ_DIR$\Binary\List\TaskScheduler.lst - $PROJ_DIR$\Binary\List\TemperatureCalculator.lst - $PROJ_DIR$\Binary\List\UsartConductor.lst - $PROJ_DIR$\Binary\Obj\UsartConductor.o - $PROJ_DIR$\Binary\Obj\TimerModel.o - $PROJ_DIR$\Binary\Obj\UsartConfigurator.pbi - $PROJ_DIR$\Binary\Obj\TimerInterruptConfigurator.o - $PROJ_DIR$\Binary\List\Cstartup.lst - $PROJ_DIR$\..\..\test\system\src\Executor.h - $PROJ_DIR$\incIAR\project.h - $PROJ_DIR$\Binary\Obj\Executor.pbi - $PROJ_DIR$\Binary\List\TimerConductor.lst - $PROJ_DIR$\Binary\Obj\TimerModel.pbi - $TOOLKIT_DIR$\inc\intrinsics.h - $PROJ_DIR$\Binary\Obj\Model.pbi - $PROJ_DIR$\Binary\Obj\UsartBaudRateRegisterCalculator.o - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h - $PROJ_DIR$\..\..\examples\src\UsartModel.h - $PROJ_DIR$\Binary\Obj\TaskScheduler.pbi - $PROJ_DIR$\Binary\Obj\Executor.o - $PROJ_DIR$\Binary\Obj\TemperatureCalculator.o - $PROJ_DIR$\Binary\Obj\Cstartup_SAM7.pbi - $PROJ_DIR$\..\..\test\system\src\AT91SAM7X256.h - $PROJ_DIR$\Binary\Obj\IntrinsicsWrapper.pbi - $PROJ_DIR$\..\..\examples\src\UsartHardware.h - $PROJ_DIR$\Binary\List\Main.lst - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\Binary\List\TimerHardware.lst - $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.h - $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\test\system\src\UsartPutChar.h - $PROJ_DIR$\..\..\test\system\src\TaskScheduler.h - $PROJ_DIR$\Binary\List\UsartTransmitBufferStatus.lst - $PROJ_DIR$\Binary\Obj\AdcTemperatureSensor.pbi - $PROJ_DIR$\Binary\Obj\Main.pbi - $PROJ_DIR$\Binary\List\UsartModel.lst - $PROJ_DIR$\Binary\Obj\TemperatureFilter.pbi - $PROJ_DIR$\Binary\List\AdcHardware.lst - $PROJ_DIR$\Binary\List\AdcTemperatureSensor.lst - $PROJ_DIR$\Binary\Obj\UsartTransmitBufferStatus.pbi - $PROJ_DIR$\Binary\Obj\AdcHardware.pbi - $PROJ_DIR$\Binary\Obj\TemperatureCalculator.pbi - $TOOLKIT_DIR$\lib\dl4t_tl_in.a - $TOOLKIT_DIR$\inc\ycheck.h - $PROJ_DIR$\..\..\test\system\src\ModelConfig.h - $PROJ_DIR$\Binary\List\AdcConductor.lst - $PROJ_DIR$\Binary\List\AdcHardwareConfigurator.lst - $PROJ_DIR$\Binary\Obj\TimerHardware.o - $PROJ_DIR$\Binary\Obj\TimerInterruptHandler.o - $TOOLKIT_DIR$\inc\stdio.h - $PROJ_DIR$\Binary\Obj\UsartHardware.o - $PROJ_DIR$\Binary\Obj\TimerInterruptHandler.pbi - $PROJ_DIR$\Binary\Obj\UsartModel.o - $TOOLKIT_DIR$\inc\DLib_Config_Normal.h - $PROJ_DIR$\Binary\List\TemperatureFilter.lst - $PROJ_DIR$\Binary\List\UsartPutChar.lst - $PROJ_DIR$\Binary\Obj\UsartConfigurator.o - $PROJ_DIR$\..\..\test\system\src\UsartConductor.h - $PROJ_DIR$\Binary\List\AdcModel.lst - $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.h - $PROJ_DIR$\..\..\test\system\src\Types.h - $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.h - $TOOLKIT_DIR$\inc\yvals.h - $PROJ_DIR$\..\..\test\system\src\UsartModel.h - $PROJ_DIR$\Binary\Obj\UsartTransmitBufferStatus.o - $TOOLKIT_DIR$\lib\rt4t_al.a - $PROJ_DIR$\Binary\List\UsartHardware.lst - $TOOLKIT_DIR$\inc\ysizet.h - $PROJ_DIR$\Binary\Obj\AdcModel.o - $PROJ_DIR$\Binary\Obj\AdcConductor.o - $PROJ_DIR$\Binary\Exe\cmock_demo.out - $PROJ_DIR$\..\..\test\system\src\AdcConductor.h - $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.h - $PROJ_DIR$\Binary\Obj\UsartModel.pbi - $PROJ_DIR$\..\..\test\system\src\TimerHardware.h - $PROJ_DIR$\..\..\test\system\src\AdcModel.h - $PROJ_DIR$\..\..\test\system\src\AdcHardware.h - $PROJ_DIR$\Binary\List\UsartBaudRateRegisterCalculator.lst - $PROJ_DIR$\..\..\test\system\src\Model.h - $TOOLKIT_DIR$\lib\shs_l.a - $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.h - $PROJ_DIR$\Binary\Obj\TimerInterruptConfigurator.pbi - $PROJ_DIR$\Binary\List\UsartConfigurator.lst - $PROJ_DIR$\Binary\List\TimerModel.lst - $PROJ_DIR$\..\..\examples\src\Executor.h - $PROJ_DIR$\Binary\Obj\IntrinsicsWrapper.o - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h - $PROJ_DIR$\..\..\examples\src\UsartConductor.h - $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\..\examples\src\TimerConductor.h - $PROJ_DIR$\Binary\Obj\AdcHardwareConfigurator.o - $TOOLKIT_DIR$\inc\xencoding_limits.h - $PROJ_DIR$\..\..\test\system\src\Main.c - $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\..\test\system\src\AdcConductor.c - $PROJ_DIR$\..\..\test\system\src\AdcHardware.c - $PROJ_DIR$\..\..\examples\src\TimerModel.h - $PROJ_DIR$\..\..\test\system\src\AdcModel.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h - $PROJ_DIR$\..\..\test\system\src\Executor.c - $PROJ_DIR$\..\..\examples\src\Model.h - $PROJ_DIR$\..\..\test\system\src\Model.c - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h - $PROJ_DIR$\..\..\examples\src\UsartPutChar.h - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h - $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c - $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c - $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c - $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c - $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c - $PROJ_DIR$\Binary\Obj\AdcModel.pbi - $PROJ_DIR$\..\..\test\system\src\TimerConductor.c - $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c - $PROJ_DIR$\Binary\Obj\AdcHardware.o - $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c - $PROJ_DIR$\..\..\test\system\src\TimerHardware.c - $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\..\..\examples\src\AdcModel.h - $PROJ_DIR$\..\..\test\system\src\TimerModel.c - $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\..\test\system\src\UsartConductor.c - $PROJ_DIR$\..\..\examples\src\AdcHardware.h - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h - $PROJ_DIR$\..\..\test\system\src\UsartHardware.c - $PROJ_DIR$\..\..\test\system\src\UsartModel.c - $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h - $PROJ_DIR$\..\..\examples\src\ModelConfig.h - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h - $PROJ_DIR$\..\..\examples\src\Types.h - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\examples\src\AdcConductor.h - $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h - $PROJ_DIR$\..\..\examples\src\TaskScheduler.h - $PROJ_DIR$\..\..\examples\src\TimerHardware.h - $PROJ_DIR$\Binary\Obj\TimerHardware.pbi - $PROJ_DIR$\Binary\Obj\TimerConfigurator.o - $PROJ_DIR$\Binary\List\Model.lst - $PROJ_DIR$\Binary\Obj\Cstartup.o - $PROJ_DIR$\Binary\Obj\TaskScheduler.o - $PROJ_DIR$\Binary\Obj\TemperatureFilter.o - $PROJ_DIR$\..\..\test\system\src\TimerConductor.h - $PROJ_DIR$\Binary\Obj\Model.o - $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\Binary\Obj\UsartHardware.pbi - $PROJ_DIR$\Binary\List\TimerInterruptHandler.lst - $PROJ_DIR$\Binary\Obj\cmock_demo.pbd - $PROJ_DIR$\..\..\test\system\src\UsartHardware.h - $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.h - $PROJ_DIR$\Binary\Obj\UsartConductor.pbi - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - $PROJ_DIR$\..\..\examples\src\AdcModel.c - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\..\examples\src\Executor.c - $PROJ_DIR$\..\..\examples\src\Main.c - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - $PROJ_DIR$\..\..\examples\src\Model.c - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - $PROJ_DIR$\Resource\at91SAM7X256_FLASH.icf - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - $PROJ_DIR$\..\..\examples\src\TimerModel.c - $PROJ_DIR$\..\..\examples\src\UsartModel.c - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - $PROJ_DIR$\srcIAR\Cstartup.s - $PROJ_DIR$\Binary\Obj\UsartPutChar.o - $PROJ_DIR$\Binary\Obj\TimerConfigurator.pbi - $PROJ_DIR$\Binary\Obj\Main.o - $PROJ_DIR$\Binary\List\Executor.lst - $PROJ_DIR$\incIAR\AT91SAM7X-EK.h - $PROJ_DIR$\incIAR\lib_AT91SAM7X256.h - $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h - $PROJ_DIR$\Binary\Obj\AdcHardwareConfigurator.pbi - $PROJ_DIR$\Binary\Obj\UsartBaudRateRegisterCalculator.pbi - - - [ROOT_NODE] - - - ILINK - 88 - - - - - $PROJ_DIR$\Binary\Exe\cmock_demo.out - - - OBJCOPY - 12 - - - - - ILINK - 179 87 131 108 86 5 156 9 36 103 198 160 157 37 158 0 154 65 23 66 21 32 20 74 68 70 196 82 97 83 60 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c - - - BICOMP - 51 - - - ICCARM - 56 5 - - - - - BICOMP - 78 39 90 - - - ICCARM - 78 39 90 - - - - - $PROJ_DIR$\..\..\test\system\src\Main.c - - - BICOMP - 52 - - - ICCARM - 42 198 - - - - - BICOMP - 78 39 25 96 49 47 77 75 165 98 48 81 46 161 159 92 79 6 14 7 89 94 166 90 93 - - - ICCARM - 78 39 25 96 49 47 77 75 165 98 48 81 46 161 159 92 79 6 14 7 89 94 166 90 93 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c - - - BICOMP - 203 - - - ICCARM - 64 108 - - - - - BICOMP - 78 39 166 62 - - - ICCARM - 78 39 166 62 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcConductor.c - - - BICOMP - 15 - - - ICCARM - 63 87 - - - - - BICOMP - 78 39 89 93 94 - - - ICCARM - 78 39 89 93 94 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcHardware.c - - - BICOMP - 58 - - - ICCARM - 55 131 - - - - - BICOMP - 78 39 94 166 90 - - - ICCARM - 78 39 94 166 90 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcModel.c - - - BICOMP - 128 - - - ICCARM - 76 86 - - - - - BICOMP - 78 39 93 49 47 77 - - - ICCARM - 78 39 93 49 47 77 - - - - - $PROJ_DIR$\..\..\test\system\src\Executor.c - - - BICOMP - 27 - - - ICCARM - 199 36 - - - - - BICOMP - 78 39 25 96 75 159 89 30 61 - - - ICCARM - 78 39 25 96 75 159 89 30 61 - - - - - $PROJ_DIR$\..\..\test\system\src\Model.c - - - BICOMP - 31 - - - ICCARM - 155 160 - - - - - BICOMP - 96 78 39 49 77 - - - ICCARM - 96 78 39 49 77 - - - - - $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c - - - BICOMP - 54 - - - ICCARM - 72 158 - - - - - BICOMP - 78 39 77 11 61 8 80 1 10 109 2 - - - ICCARM - 78 39 77 11 61 8 80 1 71 10 109 2 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c - - - BICOMP - 197 - - - ICCARM - 16 154 - - - - - BICOMP - 78 39 79 6 - - - ICCARM - 78 39 79 6 - - - - - $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c - - - BICOMP - 59 - - - ICCARM - 18 37 - - - - - BICOMP - 78 39 47 11 61 8 80 1 10 109 2 - - - ICCARM - 78 39 47 11 61 8 80 1 71 10 109 2 - - - - - $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c - - - BICOMP - 35 - - - ICCARM - 17 157 - - - - - BICOMP - 78 39 49 - - - ICCARM - 78 39 49 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c - - - BICOMP - 99 - - - ICCARM - 4 23 - - - - - BICOMP - 78 39 6 14 - - - ICCARM - 78 39 6 14 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerConductor.c - - - BICOMP - 3 - - - ICCARM - 28 0 - - - - - BICOMP - 78 39 159 7 92 14 - - - ICCARM - 78 39 159 7 92 14 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c - - - BICOMP - 69 - - - ICCARM - 163 66 - - - - - BICOMP - 78 39 14 6 - - - ICCARM - 78 39 14 6 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c - - - BICOMP - 22 - - - ICCARM - 100 74 - - - - - BICOMP - 78 39 98 - - - ICCARM - 78 39 98 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerHardware.c - - - BICOMP - 153 - - - ICCARM - 45 65 - - - - - BICOMP - 78 39 92 79 - - - ICCARM - 78 39 92 79 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c - - - BICOMP - 57 - - - ICCARM - 50 82 - - - - - BICOMP - 78 39 161 - - - ICCARM - 78 39 161 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerModel.c - - - BICOMP - 29 - - - ICCARM - 101 21 - - - - - BICOMP - 78 39 7 49 - - - ICCARM - 78 39 7 49 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c - - - BICOMP - 204 - - - ICCARM - 95 32 - - - - - BICOMP - 78 39 46 - - - ICCARM - 78 39 46 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartConductor.c - - - BICOMP - 167 - - - ICCARM - 19 20 - - - - - BICOMP - 78 39 75 165 81 49 - - - ICCARM - 78 39 75 165 81 49 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartHardware.c - - - BICOMP - 162 - - - ICCARM - 84 68 - - - - - BICOMP - 78 39 165 98 48 - - - ICCARM - 78 39 165 98 48 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartModel.c - - - BICOMP - 91 - - - ICCARM - 53 70 - - - - - BICOMP - 78 39 81 62 46 77 67 61 80 1 10 109 2 85 11 8 - - - ICCARM - 78 39 81 62 46 77 67 61 80 1 71 10 109 2 85 11 8 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c - - - BICOMP - 13 - - - ICCARM - 73 196 - - - - - BICOMP - 78 39 48 161 - - - ICCARM - 78 39 48 161 - - - - - $PROJ_DIR$\Binary\Obj\cmock_demo.pbd - - - BILINK - 15 58 203 128 51 38 27 40 52 31 35 59 54 3 197 153 99 69 29 204 167 22 162 91 13 57 - - - - - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - BICOMP - 38 - - - - - BICOMP - 26 30 61 200 150 201 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - - - BICOMP - 203 - - - - - BICOMP - 147 150 146 145 - - - - - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - - - BICOMP - 15 - - - ICCARM - 63 87 131 108 86 5 36 103 198 160 157 37 158 0 154 65 23 66 21 32 20 74 68 70 196 82 9 - - - - - BICOMP - 147 150 149 135 139 - - - ICCARM - 147 150 149 135 139 146 144 145 151 148 140 102 118 105 107 120 30 61 41 43 121 34 33 44 152 104 122 116 114 11 8 80 1 71 10 109 2 67 85 26 200 201 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - - - BICOMP - 58 - - - - - BICOMP - 147 150 139 146 144 - - - - - $PROJ_DIR$\..\..\examples\src\AdcModel.c - - - BICOMP - 128 - - - - - BICOMP - 147 150 135 151 148 140 - - - - - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - - - BICOMP - 51 - - - - - BICOMP - 147 150 144 - - - - - $PROJ_DIR$\..\..\examples\src\Executor.c - - - BICOMP - 27 - - - - - BICOMP - 147 150 102 118 105 107 149 120 - - - - - $PROJ_DIR$\..\..\examples\src\Main.c - - - BICOMP - 52 - - - - - BICOMP - 147 150 120 102 118 151 148 140 105 41 43 121 34 33 44 107 152 104 122 116 114 149 139 146 144 135 - - - - - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - - - BICOMP - 40 - - - - - BICOMP - 120 30 61 - - - - - $PROJ_DIR$\..\..\examples\src\Model.c - - - BICOMP - 31 - - - - - BICOMP - 118 147 150 151 140 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - - - BICOMP - 59 - - - - - BICOMP - 147 150 148 11 61 8 80 1 10 109 2 - - - - - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - - - BICOMP - 35 - - - - - BICOMP - 147 150 151 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - - - BICOMP - 99 - - - - - BICOMP - 147 150 122 116 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - - - BICOMP - 54 - - - - - BICOMP - 147 150 140 11 61 8 80 1 10 109 2 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - - - BICOMP - 3 - - - - - BICOMP - 147 150 107 114 152 116 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - - - BICOMP - 197 - - - - - BICOMP - 147 150 104 122 - - - - - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - - - BICOMP - 153 - - - - - BICOMP - 147 150 152 104 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - - - BICOMP - 69 - - - - - BICOMP - 147 150 116 122 - - - - - $PROJ_DIR$\..\..\examples\src\TimerModel.c - - - BICOMP - 29 - - - - - BICOMP - 147 150 114 151 - - - - - $PROJ_DIR$\..\..\examples\src\UsartModel.c - - - BICOMP - 91 - - - - - BICOMP - 147 150 34 145 33 140 67 61 80 1 10 109 2 85 11 8 - - - - - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - - - BICOMP - 204 - - - - - BICOMP - 147 150 33 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - - - BICOMP - 167 - - - - - BICOMP - 147 150 105 41 34 151 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - - - BICOMP - 22 - - - - - BICOMP - 147 150 43 - - - - - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - - - BICOMP - 162 - - - - - BICOMP - 147 150 41 43 121 - - - - - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - - - BICOMP - 57 - - - - - BICOMP - 147 150 44 - - - - - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - - - BICOMP - 13 - - - - - BICOMP - 147 150 121 44 - - - - - $PROJ_DIR$\srcIAR\Cstartup.s - - - AARM - 156 24 - - - - - AARM - 202 - - - - - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\AdcModel.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\Executor.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\Main.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\Model.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\TimerModel.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\UsartModel.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - ICCARM - - - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - ICCARM - - - - FLASH_Debug - - $TOOLKIT_DIR$\inc\DLib_Defaults.h - $TOOLKIT_DIR$\inc\DLib_Threads.h - $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.h - $PROJ_DIR$\..\..\test\system\src\TimerModel.h - $TOOLKIT_DIR$\inc\ymath.h - $TOOLKIT_DIR$\inc\DLib_Product.h - $TOOLKIT_DIR$\inc\math.h - $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.h - $PROJ_DIR$\..\..\test\system\src\Executor.h - $PROJ_DIR$\incIAR\project.h - $TOOLKIT_DIR$\inc\intrinsics.h - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h - $PROJ_DIR$\..\..\examples\src\UsartModel.h - $PROJ_DIR$\..\..\test\system\src\AT91SAM7X256.h - $PROJ_DIR$\..\..\examples\src\UsartHardware.h - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.h - $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\test\system\src\UsartPutChar.h - $PROJ_DIR$\..\..\test\system\src\TaskScheduler.h - $TOOLKIT_DIR$\lib\dl4t_tl_in.a - $TOOLKIT_DIR$\inc\ycheck.h - $PROJ_DIR$\..\..\test\system\src\ModelConfig.h - $TOOLKIT_DIR$\inc\stdio.h - $TOOLKIT_DIR$\inc\DLib_Config_Normal.h - $PROJ_DIR$\..\..\test\system\src\UsartConductor.h - $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.h - $PROJ_DIR$\..\..\test\system\src\Types.h - $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.h - $TOOLKIT_DIR$\inc\yvals.h - $PROJ_DIR$\..\..\test\system\src\UsartModel.h - $TOOLKIT_DIR$\lib\rt4t_al.a - $TOOLKIT_DIR$\inc\ysizet.h - $PROJ_DIR$\..\..\test\system\src\AdcConductor.h - $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.h - $PROJ_DIR$\..\..\test\system\src\TimerHardware.h - $PROJ_DIR$\..\..\test\system\src\AdcModel.h - $PROJ_DIR$\..\..\test\system\src\AdcHardware.h - $PROJ_DIR$\..\..\test\system\src\Model.h - $TOOLKIT_DIR$\lib\shs_l.a - $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.h - $PROJ_DIR$\..\..\examples\src\Executor.h - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h - $PROJ_DIR$\..\..\examples\src\UsartConductor.h - $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\..\examples\src\TimerConductor.h - $TOOLKIT_DIR$\inc\xencoding_limits.h - $PROJ_DIR$\FLASH_Debug\Obj\cmock_demo.pbd - $PROJ_DIR$\..\..\test\system\src\Main.c - $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\..\test\system\src\AdcConductor.c - $PROJ_DIR$\..\..\test\system\src\AdcHardware.c - $PROJ_DIR$\..\..\examples\src\TimerModel.h - $PROJ_DIR$\..\..\test\system\src\AdcModel.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h - $PROJ_DIR$\..\..\test\system\src\Executor.c - $PROJ_DIR$\..\..\examples\src\Model.h - $PROJ_DIR$\..\..\test\system\src\Model.c - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h - $PROJ_DIR$\..\..\examples\src\UsartPutChar.h - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h - $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c - $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c - $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c - $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c - $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c - $PROJ_DIR$\..\..\test\system\src\TimerConductor.c - $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c - $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c - $PROJ_DIR$\..\..\test\system\src\TimerHardware.c - $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\..\..\examples\src\AdcModel.h - $PROJ_DIR$\..\..\test\system\src\TimerModel.c - $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\..\test\system\src\UsartConductor.c - $PROJ_DIR$\..\..\examples\src\AdcHardware.h - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h - $PROJ_DIR$\..\..\test\system\src\UsartHardware.c - $PROJ_DIR$\..\..\test\system\src\UsartModel.c - $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h - $PROJ_DIR$\..\..\examples\src\ModelConfig.h - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h - $PROJ_DIR$\..\..\examples\src\Types.h - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\examples\src\AdcConductor.h - $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h - $PROJ_DIR$\..\..\examples\src\TaskScheduler.h - $PROJ_DIR$\..\..\examples\src\TimerHardware.h - $PROJ_DIR$\..\..\test\system\src\TimerConductor.h - $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\..\..\test\system\src\UsartHardware.h - $PROJ_DIR$\FLASH_Debug\Obj\Main.o - $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.h - $PROJ_DIR$\FLASH_Debug\List\TimerHardware.lst - $PROJ_DIR$\FLASH_Debug\List\ext_irq.lst - $PROJ_DIR$\FLASH_Debug\Obj\Cstartup.o - $PROJ_DIR$\FLASH_Debug\Obj\TimerConfigurator.pbi - $PROJ_DIR$\FLASH_Debug\List\UsartHardware.lst - $PROJ_DIR$\..\src\ext_irq.c - $PROJ_DIR$\FLASH_Debug\Obj\interrupt_Usart.o - $PROJ_DIR$\FLASH_Debug\Obj\interrupt_Usart.pbi - $PROJ_DIR$\FLASH_Debug\Obj\TimerModel.o - $PROJ_DIR$\FLASH_Debug\Obj\main.pbi - $PROJ_DIR$\FLASH_Debug\List\Model.lst - $PROJ_DIR$\FLASH_Debug\Obj\AdcModel.o - $PROJ_DIR$\FLASH_Debug\Obj\UsartHardware.o - $PROJ_DIR$\FLASH_Debug\Obj\UsartPutChar.o - $PROJ_DIR$\FLASH_Debug\Obj\TemperatureCalculator.pbi - $PROJ_DIR$\FLASH_Debug\List\AdcConductor.lst - $PROJ_DIR$\FLASH_Debug\Obj\UsartTransmitBufferStatus.pbi - $PROJ_DIR$\FLASH_Debug\Obj\AdcConductor.pbi - $PROJ_DIR$\FLASH_Debug\Obj\Model.pbi - $PROJ_DIR$\FLASH_Debug\Obj\Cstartup_SAM7.o - $PROJ_DIR$\FLASH_Debug\Obj\IntrinsicsWrapper.o - $PROJ_DIR$\FLASH_Debug\Obj\IntrinsicsWrapper.pbi - $PROJ_DIR$\FLASH_Debug\Obj\AdcHardware.o - $PROJ_DIR$\FLASH_Debug\Obj\UsartPutChar.pbi - $PROJ_DIR$\FLASH_Debug\Obj\UsartBaudRateRegisterCalculator.pbi - $PROJ_DIR$\FLASH_Debug\List\interrupt_timer.lst - $PROJ_DIR$\FLASH_Debug\List\Cstartup_SAM7.lst - $PROJ_DIR$\FLASH_Debug\Obj\AdcHardwareConfigurator.o - $PROJ_DIR$\FLASH_Debug\List\AdcHardwareConfigurator.lst - $PROJ_DIR$\FLASH_Debug\Obj\TemperatureFilter.pbi - $PROJ_DIR$\FLASH_Debug\Obj\TimerConductor.pbi - $PROJ_DIR$\..\..\include\lib_AT91SAM7X256.h - $PROJ_DIR$\FLASH_Debug\Obj\TaskScheduler.o - $PROJ_DIR$\FLASH_Debug\Obj\TemperatureFilter.o - $PROJ_DIR$\FLASH_Debug\Obj\ext_irq.pbi - $PROJ_DIR$\..\..\include\AT91SAM7X256.h - $PROJ_DIR$\FLASH_Debug\Obj\AdcModel.pbi - $PROJ_DIR$\FLASH_Debug\Obj\TimerInterruptConfigurator.o - $PROJ_DIR$\FLASH_Debug\List\AdcModel.lst - $PROJ_DIR$\FLASH_Debug\List\interrupt_Usart.lst - $PROJ_DIR$\FLASH_Debug\List\Cstartup.lst - $PROJ_DIR$\FLASH_Debug\Obj\UsartHardware.pbi - $PROJ_DIR$\FLASH_Debug\List\TimerModel.lst - $PROJ_DIR$\FLASH_Debug\Obj\UsartConductor.o - $PROJ_DIR$\FLASH_Debug\Obj\UsartConfigurator.o - $PROJ_DIR$\FLASH_Debug\List\UsartPutChar.lst - $PROJ_DIR$\FLASH_Debug\List\TemperatureFilter.lst - $PROJ_DIR$\FLASH_Debug\Obj\TimerInterruptHandler.pbi - $PROJ_DIR$\FLASH_Debug\List\TemperatureCalculator.lst - $PROJ_DIR$\FLASH_Debug\List\UsartTransmitBufferStatus.lst - $PROJ_DIR$\FLASH_Debug\Obj\UsartModel.pbi - $PROJ_DIR$\FLASH_Debug\List\UsartConductor.lst - $PROJ_DIR$\FLASH_Debug\List\TimerConfigurator.lst - $PROJ_DIR$\FLASH_Debug\Obj\Model.o - $PROJ_DIR$\FLASH_Debug\List\Executor.lst - $PROJ_DIR$\FLASH_Debug\List\UsartModel.lst - $PROJ_DIR$\FLASH_Debug\List\TimerInterruptHandler.lst - $PROJ_DIR$\FLASH_Debug\List\Main.lst - $PROJ_DIR$\FLASH_Debug\List\TimerInterruptConfigurator.lst - $PROJ_DIR$\FLASH_Debug\Exe\cmock_demo.out - $PROJ_DIR$\FLASH_Debug\Obj\TimerHardware.pbi - $PROJ_DIR$\FLASH_Debug\Obj\TaskScheduler.pbi - $PROJ_DIR$\FLASH_Debug\Obj\TimerModel.pbi - $PROJ_DIR$\FLASH_Debug\Obj\AdcConductor.o - $PROJ_DIR$\FLASH_Debug\Obj\AdcTemperatureSensor.o - $PROJ_DIR$\..\src\AT91SAM7X-EK.h - $PROJ_DIR$\FLASH_Debug\Obj\UsartTransmitBufferStatus.o - $PROJ_DIR$\FLASH_Debug\Obj\AdcHardware.pbi - $PROJ_DIR$\FLASH_Debug\Obj\UsartBaudRateRegisterCalculator.o - $PROJ_DIR$\FLASH_Debug\Obj\ext_irq.o - $PROJ_DIR$\FLASH_Debug\Obj\AdcTemperatureSensor.pbi - $PROJ_DIR$\FLASH_Debug\Obj\TemperatureCalculator.o - $PROJ_DIR$\FLASH_Debug\Obj\TimerHardware.o - $PROJ_DIR$\FLASH_Debug\Obj\UsartModel.o - $PROJ_DIR$\FLASH_Debug\List\UsartConfigurator.lst - $PROJ_DIR$\FLASH_Debug\Obj\TimerConductor.o - $PROJ_DIR$\srcIAR\project.h - $PROJ_DIR$\FLASH_Debug\List\UsartBaudRateRegisterCalculator.lst - $PROJ_DIR$\FLASH_Debug\Obj\AdcHardwareConfigurator.pbi - $PROJ_DIR$\FLASH_Debug\Obj\TimerInterruptHandler.o - $PROJ_DIR$\FLASH_Debug\List\TimerConductor.lst - $PROJ_DIR$\FLASH_Debug\Obj\Cstartup_SAM7.pbi - $PROJ_DIR$\FLASH_Debug\Obj\UsartConductor.pbi - $PROJ_DIR$\FLASH_Debug\Obj\UsartConfigurator.pbi - $PROJ_DIR$\FLASH_Debug\Obj\Executor.o - $PROJ_DIR$\FLASH_Debug\List\AdcHardware.lst - $PROJ_DIR$\FLASH_Debug\Obj\Executor.pbi - $PROJ_DIR$\..\src\interrupt_timer.c - $PROJ_DIR$\..\src\interrupt_Usart.c - $PROJ_DIR$\FLASH_Debug\Obj\TimerInterruptConfigurator.pbi - $PROJ_DIR$\..\src\main.c - $PROJ_DIR$\FLASH_Debug\Obj\TimerConfigurator.o - $PROJ_DIR$\FLASH_Debug\List\AdcTemperatureSensor.lst - $PROJ_DIR$\FLASH_Debug\List\TaskScheduler.lst - $PROJ_DIR$\FLASH_Debug\Obj\interrupt_timer.o - $PROJ_DIR$\FLASH_Debug\List\IntrinsicsWrapper.lst - $PROJ_DIR$\FLASH_Debug\Obj\interrupt_timer.pbi - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - $PROJ_DIR$\..\..\examples\src\AdcModel.c - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\..\examples\src\Executor.c - $PROJ_DIR$\..\..\examples\src\Main.c - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - $PROJ_DIR$\..\..\examples\src\Model.c - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - $PROJ_DIR$\Resource\at91SAM7X256_FLASH.icf - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - $PROJ_DIR$\..\..\examples\src\TimerModel.c - $PROJ_DIR$\..\..\examples\src\UsartModel.c - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - $PROJ_DIR$\srcIAR\Cstartup.s - $PROJ_DIR$\incIAR\AT91SAM7X-EK.h - $PROJ_DIR$\incIAR\lib_AT91SAM7X256.h - $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h - - - [ROOT_NODE] - - - ILINK - 154 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c - - - BICOMP - 165 - - - ICCARM - 187 159 - - - - - ICCARM - 28 13 35 - - - - - $PROJ_DIR$\FLASH_Debug\Obj\cmock_demo.pbd - - - BILINK - 112 162 173 131 165 176 181 116 113 156 109 124 125 98 155 184 142 157 119 177 178 136 145 118 111 104 - - - - - $PROJ_DIR$\..\..\test\system\src\Main.c - - - BICOMP - 104 - - - ICCARM - 152 93 - - - - - ICCARM - 28 13 8 39 20 18 27 26 92 41 19 31 17 91 90 36 29 2 7 3 34 38 94 35 37 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c - - - BICOMP - 173 - - - ICCARM - 123 122 - - - - - ICCARM - 28 13 94 23 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcConductor.c - - - BICOMP - 112 - - - ICCARM - 110 158 - - - - - ICCARM - 28 13 34 37 38 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcHardware.c - - - BICOMP - 162 - - - ICCARM - 180 117 - - - - - ICCARM - 28 13 38 94 35 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcModel.c - - - BICOMP - 131 - - - ICCARM - 133 106 - - - - - ICCARM - 28 13 37 20 18 27 - - - - - $PROJ_DIR$\..\..\test\system\src\Executor.c - - - BICOMP - 181 - - - ICCARM - 149 179 - - - - - ICCARM - 28 13 8 39 26 90 34 10 22 - - - - - $PROJ_DIR$\..\..\test\system\src\Model.c - - - BICOMP - 113 - - - ICCARM - 105 148 - - - - - ICCARM - 39 28 13 20 27 - - - - - $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c - - - BICOMP - 124 - - - ICCARM - 141 128 - - - - - ICCARM - 28 13 27 6 22 4 30 0 25 5 47 1 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c - - - BICOMP - 98 - - - ICCARM - 147 186 - - - - - ICCARM - 28 13 29 2 - - - - - $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c - - - BICOMP - 109 - - - ICCARM - 143 166 - - - - - ICCARM - 28 13 18 6 22 4 30 0 25 5 47 1 - - - - - $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c - - - BICOMP - 156 - - - ICCARM - 188 127 - - - - - ICCARM - 28 13 20 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c - - - BICOMP - 184 - - - ICCARM - 153 132 - - - - - ICCARM - 28 13 2 7 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerConductor.c - - - BICOMP - 125 - - - ICCARM - 175 170 - - - - - ICCARM - 28 13 90 3 36 7 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c - - - BICOMP - 142 - - - ICCARM - 151 174 - - - - - ICCARM - 28 13 7 2 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c - - - BICOMP - 178 - - - ICCARM - 169 139 - - - - - ICCARM - 28 13 41 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerHardware.c - - - BICOMP - 155 - - - ICCARM - 95 167 - - - - - ICCARM - 28 13 36 29 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c - - - BICOMP - 111 - - - ICCARM - 144 161 - - - - - ICCARM - 28 13 91 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerModel.c - - - BICOMP - 157 - - - ICCARM - 137 103 - - - - - ICCARM - 28 13 3 20 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c - - - BICOMP - 119 - - - ICCARM - 172 163 - - - - - ICCARM - 28 13 17 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartConductor.c - - - BICOMP - 177 - - - ICCARM - 146 138 - - - - - ICCARM - 28 13 26 92 31 20 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartHardware.c - - - BICOMP - 136 - - - ICCARM - 99 107 - - - - - ICCARM - 28 13 92 41 19 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartModel.c - - - BICOMP - 145 - - - ICCARM - 150 168 - - - - - ICCARM - 28 13 31 23 17 27 24 22 30 0 25 5 47 1 33 6 4 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c - - - BICOMP - 118 - - - ICCARM - 140 108 - - - - - ICCARM - 28 13 19 91 - - - - - $PROJ_DIR$\..\src\ext_irq.c - - - BICOMP - 129 - - - ICCARM - 96 164 - - - - - BICOMP - 171 10 22 160 130 126 - - - ICCARM - 171 10 22 160 130 126 - - - - - $PROJ_DIR$\FLASH_Debug\Exe\cmock_demo.out - - - ILINK - 203 158 117 122 106 159 97 114 179 115 93 148 127 166 128 170 186 167 132 174 103 163 138 139 107 168 108 161 40 32 21 - - - - - $PROJ_DIR$\..\src\interrupt_timer.c - - - BICOMP - 191 - - - ICCARM - 120 189 - - - - - BICOMP - 171 10 22 160 130 126 - - - ICCARM - 171 10 22 160 130 126 - - - - - $PROJ_DIR$\..\src\interrupt_Usart.c - - - BICOMP - 102 - - - ICCARM - 134 101 - - - - - BICOMP - 171 10 22 160 130 126 - - - ICCARM - 171 10 22 160 130 126 - - - - - $PROJ_DIR$\..\src\main.c - - - BICOMP - 104 - - - ICCARM - 152 93 - - - - - BICOMP - 171 10 22 160 130 126 - - - ICCARM - 171 10 22 160 130 126 - - - - - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - BICOMP - 176 - - - ICCARM - 121 114 - - - - - BICOMP - 9 10 22 220 221 - - - ICCARM - 9 10 22 220 87 221 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - - - BICOMP - 173 - - - ICCARM - 123 122 - - - - - BICOMP - 84 87 83 82 - - - ICCARM - 84 87 83 82 - - - - - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - - - BICOMP - 112 - - - ICCARM - 110 158 - - - - - BICOMP - 84 87 86 72 76 - - - ICCARM - 84 87 86 72 76 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - - - BICOMP - 162 - - - ICCARM - 180 117 - - - - - BICOMP - 84 87 76 83 81 - - - ICCARM - 84 87 76 83 81 - - - - - $PROJ_DIR$\..\..\examples\src\AdcModel.c - - - BICOMP - 131 - - - ICCARM - 133 106 - - - - - BICOMP - 84 87 72 88 85 77 - - - ICCARM - 84 87 72 88 85 77 - - - - - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - - - BICOMP - 165 - - - ICCARM - 187 159 - - - - - BICOMP - 84 87 81 - - - ICCARM - 84 87 81 - - - - - $PROJ_DIR$\..\..\examples\src\Executor.c - - - BICOMP - 181 - - - ICCARM - 149 179 - - - - - BICOMP - 84 87 42 57 44 46 86 59 - - - ICCARM - 84 87 42 57 44 46 86 59 - - - - - $PROJ_DIR$\..\..\examples\src\Main.c - - - BICOMP - 104 - - - ICCARM - 152 93 - - - - - BICOMP - 84 87 59 42 57 88 85 77 44 14 15 60 12 11 16 46 89 43 61 55 53 86 76 83 81 72 - - - ICCARM - 84 87 59 42 57 88 85 77 44 14 15 60 12 11 16 46 89 43 61 55 53 86 76 83 81 72 - - - - - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - - - BICOMP - 116 - - - ICCARM - 190 115 - - - - - BICOMP - 59 10 22 - - - ICCARM - 59 10 22 - - - - - $PROJ_DIR$\..\..\examples\src\Model.c - - - BICOMP - 113 - - - ICCARM - 105 148 - - - - - BICOMP - 57 84 87 88 77 - - - ICCARM - 57 84 87 88 77 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - - - BICOMP - 109 - - - ICCARM - 143 166 - - - - - BICOMP - 84 87 85 6 22 4 30 0 5 47 1 - - - ICCARM - 84 87 85 6 22 4 30 0 25 5 47 1 - - - - - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - - - BICOMP - 156 - - - ICCARM - 188 127 - - - - - BICOMP - 84 87 88 - - - ICCARM - 84 87 88 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - - - BICOMP - 184 - - - ICCARM - 153 132 - - - - - BICOMP - 84 87 61 55 - - - ICCARM - 84 87 61 55 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - - - BICOMP - 124 - - - ICCARM - 141 128 - - - - - BICOMP - 84 87 77 6 22 4 30 0 5 47 1 - - - ICCARM - 84 87 77 6 22 4 30 0 25 5 47 1 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - - - BICOMP - 125 - - - ICCARM - 175 170 - - - - - BICOMP - 84 87 46 53 89 55 - - - ICCARM - 84 87 46 53 89 55 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - - - BICOMP - 98 - - - ICCARM - 147 186 - - - - - BICOMP - 84 87 43 61 - - - ICCARM - 84 87 43 61 - - - - - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - - - BICOMP - 155 - - - ICCARM - 95 167 - - - - - BICOMP - 84 87 89 43 - - - ICCARM - 84 87 89 43 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - - - BICOMP - 142 - - - ICCARM - 151 174 - - - - - BICOMP - 84 87 55 61 - - - ICCARM - 84 87 55 61 - - - - - $PROJ_DIR$\..\..\examples\src\TimerModel.c - - - BICOMP - 157 - - - ICCARM - 137 103 - - - - - BICOMP - 84 87 53 88 - - - ICCARM - 84 87 53 88 - - - - - $PROJ_DIR$\..\..\examples\src\UsartModel.c - - - BICOMP - 145 - - - ICCARM - 150 168 - - - - - ICCARM - 84 87 12 82 11 77 24 22 30 0 25 5 47 1 33 6 4 - - - - - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - - - BICOMP - 119 - - - ICCARM - 172 163 - - - - - BICOMP - 84 87 11 - - - ICCARM - 84 87 11 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - - - BICOMP - 177 - - - ICCARM - 146 138 - - - - - BICOMP - 84 87 44 14 12 88 - - - ICCARM - 84 87 44 14 12 88 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - - - BICOMP - 178 - - - ICCARM - 169 139 - - - - - BICOMP - 84 87 15 - - - ICCARM - 84 87 15 - - - - - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - - - BICOMP - 136 - - - ICCARM - 99 107 - - - - - BICOMP - 84 87 14 15 60 - - - ICCARM - 84 87 14 15 60 - - - - - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - - - BICOMP - 111 - - - ICCARM - 144 161 - - - - - ICCARM - 84 87 16 - - - - - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - - - BICOMP - 118 - - - ICCARM - 140 108 - - - - - ICCARM - 84 87 60 16 - - - - - $PROJ_DIR$\srcIAR\Cstartup.s - - - AARM - 97 135 - - - - - AARM - 222 - - - - - - RAM_Debug - - $PROJ_DIR$\Resource\SAM7_FLASH.mac - $TOOLKIT_DIR$\inc\DLib_Defaults.h - $TOOLKIT_DIR$\inc\DLib_Threads.h - $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.h - $PROJ_DIR$\..\..\test\system\src\TimerModel.h - $TOOLKIT_DIR$\inc\ymath.h - $TOOLKIT_DIR$\inc\DLib_Product.h - $TOOLKIT_DIR$\inc\math.h - $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.h - $PROJ_DIR$\..\..\test\system\src\Executor.h - $PROJ_DIR$\incIAR\project.h - $TOOLKIT_DIR$\inc\intrinsics.h - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h - $PROJ_DIR$\..\..\examples\src\UsartModel.h - $PROJ_DIR$\..\..\test\system\src\AT91SAM7X256.h - $PROJ_DIR$\..\..\examples\src\UsartHardware.h - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.h - $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\test\system\src\UsartPutChar.h - $PROJ_DIR$\..\..\test\system\src\TaskScheduler.h - $TOOLKIT_DIR$\lib\dl4t_tl_in.a - $TOOLKIT_DIR$\inc\ycheck.h - $PROJ_DIR$\..\..\test\system\src\ModelConfig.h - $TOOLKIT_DIR$\inc\stdio.h - $TOOLKIT_DIR$\inc\DLib_Config_Normal.h - $PROJ_DIR$\..\..\test\system\src\UsartConductor.h - $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.h - $PROJ_DIR$\..\..\test\system\src\Types.h - $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.h - $TOOLKIT_DIR$\inc\yvals.h - $PROJ_DIR$\..\..\test\system\src\UsartModel.h - $TOOLKIT_DIR$\lib\rt4t_al.a - $TOOLKIT_DIR$\inc\ysizet.h - $PROJ_DIR$\..\..\test\system\src\AdcConductor.h - $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.h - $PROJ_DIR$\..\..\test\system\src\TimerHardware.h - $PROJ_DIR$\..\..\test\system\src\AdcModel.h - $PROJ_DIR$\..\..\test\system\src\AdcHardware.h - $PROJ_DIR$\..\..\test\system\src\Model.h - $TOOLKIT_DIR$\lib\shs_l.a - $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.h - $PROJ_DIR$\..\..\examples\src\Executor.h - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h - $PROJ_DIR$\..\..\examples\src\UsartConductor.h - $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\..\examples\src\TimerConductor.h - $TOOLKIT_DIR$\inc\xencoding_limits.h - $PROJ_DIR$\..\..\test\system\src\Main.c - $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\..\test\system\src\AdcConductor.c - $PROJ_DIR$\..\..\test\system\src\AdcHardware.c - $PROJ_DIR$\..\..\examples\src\TimerModel.h - $PROJ_DIR$\..\..\test\system\src\AdcModel.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h - $PROJ_DIR$\..\..\test\system\src\Executor.c - $PROJ_DIR$\..\..\examples\src\Model.h - $PROJ_DIR$\..\..\test\system\src\Model.c - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h - $PROJ_DIR$\..\..\examples\src\UsartPutChar.h - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h - $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c - $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c - $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c - $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c - $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c - $PROJ_DIR$\..\..\test\system\src\TimerConductor.c - $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c - $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c - $PROJ_DIR$\..\..\test\system\src\TimerHardware.c - $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\..\..\examples\src\AdcModel.h - $PROJ_DIR$\..\..\test\system\src\TimerModel.c - $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\..\test\system\src\UsartConductor.c - $PROJ_DIR$\..\..\examples\src\AdcHardware.h - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h - $PROJ_DIR$\..\..\test\system\src\UsartHardware.c - $PROJ_DIR$\..\..\test\system\src\UsartModel.c - $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h - $PROJ_DIR$\..\..\examples\src\ModelConfig.h - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h - $PROJ_DIR$\..\..\examples\src\Types.h - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h - $PROJ_DIR$\..\..\examples\src\AdcConductor.h - $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h - $PROJ_DIR$\..\..\examples\src\TaskScheduler.h - $PROJ_DIR$\..\..\examples\src\TimerHardware.h - $PROJ_DIR$\..\..\test\system\src\TimerConductor.h - $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.h - $PROJ_DIR$\..\..\test\system\src\UsartHardware.h - $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.h - $PROJ_DIR$\..\src\ext_irq.c - $PROJ_DIR$\..\src\interrupt_timer.c - $PROJ_DIR$\..\src\interrupt_Usart.c - $PROJ_DIR$\..\src\main.c - $PROJ_DIR$\RAM_Debug\Obj\UsartConductor.o - $PROJ_DIR$\RAM_Debug\List\AdcConductor.lst - $PROJ_DIR$\RAM_Debug\List\TimerInterruptHandler.lst - $PROJ_DIR$\RAM_Debug\List\AdcHardwareConfigurator.lst - $PROJ_DIR$\RAM_Debug\Obj\TimerHardware.pbi - $PROJ_DIR$\RAM_Debug\Obj\UsartHardware.pbi - $PROJ_DIR$\RAM_Debug\Obj\UsartConductor.pbi - $PROJ_DIR$\RAM_Debug\List\TimerConfigurator.lst - $PROJ_DIR$\RAM_Debug\List\UsartPutChar.lst - $PROJ_DIR$\RAM_Debug\Obj\TimerConductor.o - $PROJ_DIR$\RAM_Debug\Obj\TimerConfigurator.o - $PROJ_DIR$\RAM_Debug\Obj\UsartBaudRateRegisterCalculator.pbi - $PROJ_DIR$\RAM_Debug\Obj\AdcHardwareConfigurator.o - $PROJ_DIR$\RAM_Debug\List\AdcModel.lst - $PROJ_DIR$\RAM_Debug\List\TimerConductor.lst - $PROJ_DIR$\RAM_Debug\List\TimerHardware.lst - $PROJ_DIR$\RAM_Debug\Obj\AdcHardware.o - $PROJ_DIR$\RAM_Debug\List\TemperatureFilter.lst - $PROJ_DIR$\RAM_Debug\Obj\AdcModel.pbi - $PROJ_DIR$\RAM_Debug\List\IntrinsicsWrapper.lst - $PROJ_DIR$\RAM_Debug\Obj\Cstartup.o - $PROJ_DIR$\RAM_Debug\Obj\interrupt_Usart.o - $PROJ_DIR$\RAM_Debug\Obj\AdcHardwareConfigurator.pbi - $PROJ_DIR$\RAM_Debug\Obj\main.pbi - $PROJ_DIR$\RAM_Debug\List\AdcTemperatureSensor.lst - $PROJ_DIR$\RAM_Debug\Obj\TimerInterruptHandler.pbi - $PROJ_DIR$\RAM_Debug\List\Model.lst - $PROJ_DIR$\RAM_Debug\Obj\Model.pbi - $PROJ_DIR$\RAM_Debug\Obj\AdcHardware.pbi - $PROJ_DIR$\RAM_Debug\List\UsartBaudRateRegisterCalculator.lst - $PROJ_DIR$\RAM_Debug\Obj\ext_irq.o - $PROJ_DIR$\RAM_Debug\Obj\TimerInterruptHandler.o - $PROJ_DIR$\RAM_Debug\List\Cstartup.lst - $PROJ_DIR$\RAM_Debug\Obj\TimerConfigurator.pbi - $PROJ_DIR$\RAM_Debug\Obj\Cstartup_SAM7.o - $PROJ_DIR$\RAM_Debug\Obj\AdcTemperatureSensor.pbi - $PROJ_DIR$\RAM_Debug\List\UsartConfigurator.lst - $PROJ_DIR$\RAM_Debug\List\UsartTransmitBufferStatus.lst - $PROJ_DIR$\RAM_Debug\Obj\UsartPutChar.pbi - $PROJ_DIR$\RAM_Debug\List\TaskScheduler.lst - $PROJ_DIR$\RAM_Debug\Obj\interrupt_timer.pbi - $PROJ_DIR$\RAM_Debug\List\UsartHardware.lst - $PROJ_DIR$\RAM_Debug\Obj\TaskScheduler.pbi - $PROJ_DIR$\RAM_Debug\Obj\Cstartup_SAM7.pbi - $PROJ_DIR$\RAM_Debug\List\Cstartup_SAM7.lst - $PROJ_DIR$\RAM_Debug\Obj\UsartTransmitBufferStatus.o - $PROJ_DIR$\RAM_Debug\Obj\TimerModel.pbi - $PROJ_DIR$\RAM_Debug\List\UsartConductor.lst - $PROJ_DIR$\RAM_Debug\Obj\UsartPutChar.o - $PROJ_DIR$\RAM_Debug\Obj\TimerInterruptConfigurator.pbi - $PROJ_DIR$\RAM_Debug\Obj\TimerHardware.o - $PROJ_DIR$\RAM_Debug\Obj\AdcTemperatureSensor.o - $PROJ_DIR$\RAM_Debug\Obj\AdcModel.o - $PROJ_DIR$\RAM_Debug\Obj\Executor.pbi - $PROJ_DIR$\RAM_Debug\Obj\TemperatureFilter.o - $PROJ_DIR$\RAM_Debug\Obj\AdcConductor.pbi - $PROJ_DIR$\RAM_Debug\List\TimerInterruptConfigurator.lst - $PROJ_DIR$\RAM_Debug\List\UsartModel.lst - $PROJ_DIR$\RAM_Debug\Obj\UsartConfigurator.o - $PROJ_DIR$\RAM_Debug\Obj\cmock_demo.pbd - $PROJ_DIR$\RAM_Debug\Exe\cmock_demo.out - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - $PROJ_DIR$\RAM_Debug\List\TemperatureCalculator.lst - $PROJ_DIR$\RAM_Debug\List\AdcHardware.lst - $PROJ_DIR$\RAM_Debug\List\Executor.lst - $PROJ_DIR$\RAM_Debug\Obj\UsartModel.pbi - $PROJ_DIR$\RAM_Debug\Obj\TimerConductor.pbi - $PROJ_DIR$\RAM_Debug\Obj\UsartConfigurator.pbi - $PROJ_DIR$\RAM_Debug\Obj\UsartHardware.o - $PROJ_DIR$\RAM_Debug\Obj\TemperatureCalculator.o - $PROJ_DIR$\RAM_Debug\Obj\AdcConductor.o - $PROJ_DIR$\RAM_Debug\Obj\IntrinsicsWrapper.o - $PROJ_DIR$\RAM_Debug\Obj\Model.o - $PROJ_DIR$\RAM_Debug\Obj\UsartTransmitBufferStatus.pbi - $PROJ_DIR$\RAM_Debug\Obj\TimerModel.o - $PROJ_DIR$\RAM_Debug\Obj\Executor.o - $PROJ_DIR$\RAM_Debug\Obj\TemperatureCalculator.pbi - $PROJ_DIR$\RAM_Debug\Obj\UsartBaudRateRegisterCalculator.o - $PROJ_DIR$\RAM_Debug\Obj\TimerInterruptConfigurator.o - $PROJ_DIR$\RAM_Debug\Obj\interrupt_Usart.pbi - $PROJ_DIR$\RAM_Debug\Obj\TaskScheduler.o - $PROJ_DIR$\RAM_Debug\Obj\Main.o - $PROJ_DIR$\RAM_Debug\Obj\ext_irq.pbi - $PROJ_DIR$\RAM_Debug\List\Main.lst - $PROJ_DIR$\RAM_Debug\List\TimerModel.lst - $PROJ_DIR$\RAM_Debug\Obj\interrupt_timer.o - $PROJ_DIR$\RAM_Debug\Obj\UsartModel.o - $PROJ_DIR$\RAM_Debug\Obj\TemperatureFilter.pbi - $PROJ_DIR$\RAM_Debug\Obj\IntrinsicsWrapper.pbi - $PROJ_DIR$\Resource\at91SAM7X256_RAM.icf - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - $PROJ_DIR$\..\..\examples\src\AdcModel.c - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - $PROJ_DIR$\..\..\examples\src\Executor.c - $PROJ_DIR$\..\..\examples\src\Main.c - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - $PROJ_DIR$\..\..\examples\src\Model.c - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - $PROJ_DIR$\Resource\SAM7_RAM.mac - $PROJ_DIR$\Resource\at91SAM7X256_FLASH.icf - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - $PROJ_DIR$\..\..\examples\src\TimerModel.c - $PROJ_DIR$\..\..\examples\src\UsartModel.c - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - $PROJ_DIR$\srcIAR\Cstartup.s - $PROJ_DIR$\incIAR\AT91SAM7X-EK.h - $PROJ_DIR$\incIAR\lib_AT91SAM7X256.h - $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h - - - [ROOT_NODE] - - - ILINK - 158 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c - - - BICOMP - 133 - - - ICCARM - 122 149 - - - - - BICOMP - 29 14 36 - - - ICCARM - 29 14 36 - - - - - $PROJ_DIR$\..\..\test\system\src\Main.c - - - BICOMP - 121 - - - ICCARM - 181 179 - - - - - BICOMP - 29 14 9 40 21 19 28 27 92 42 20 32 18 91 90 37 30 3 8 4 35 39 93 36 38 - - - ICCARM - 29 14 9 40 21 19 28 27 92 42 20 32 18 91 90 37 30 3 8 4 35 39 93 36 38 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c - - - BICOMP - 120 - - - ICCARM - 101 110 - - - - - BICOMP - 29 14 93 24 - - - ICCARM - 29 14 93 24 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcConductor.c - - - BICOMP - 153 - - - ICCARM - 99 168 - - - - - BICOMP - 29 14 35 38 39 - - - ICCARM - 29 14 35 38 39 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcHardware.c - - - BICOMP - 126 - - - ICCARM - 161 114 - - - - - BICOMP - 29 14 39 93 36 - - - ICCARM - 29 14 39 93 36 - - - - - $PROJ_DIR$\..\..\test\system\src\AdcModel.c - - - BICOMP - 116 - - - ICCARM - 111 150 - - - - - BICOMP - 29 14 38 21 19 28 - - - ICCARM - 29 14 38 21 19 28 - - - - - $PROJ_DIR$\..\..\test\system\src\Executor.c - - - BICOMP - 151 - - - ICCARM - 162 173 - - - - - BICOMP - 29 14 9 40 27 90 35 11 23 - - - ICCARM - 29 14 9 40 27 90 35 11 23 - - - - - $PROJ_DIR$\..\..\test\system\src\Model.c - - - BICOMP - 125 - - - ICCARM - 124 170 - - - - - BICOMP - 40 29 14 21 28 - - - ICCARM - 40 29 14 21 28 - - - - - $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c - - - BICOMP - 185 - - - ICCARM - 115 152 - - - - - BICOMP - 29 14 28 7 23 5 31 1 6 48 2 - - - ICCARM - 29 14 28 7 23 5 31 1 26 6 48 2 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c - - - BICOMP - 131 - - - ICCARM - 105 108 - - - - - BICOMP - 29 14 30 3 - - - ICCARM - 29 14 30 3 - - - - - $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c - - - BICOMP - 174 - - - ICCARM - 160 167 - - - - - BICOMP - 29 14 19 7 23 5 31 1 6 48 2 - - - ICCARM - 29 14 19 7 23 5 31 1 26 6 48 2 - - - - - $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c - - - BICOMP - 140 - - - ICCARM - 137 178 - - - - - BICOMP - 29 14 21 - - - ICCARM - 29 14 21 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c - - - BICOMP - 147 - - - ICCARM - 154 176 - - - - - BICOMP - 29 14 3 8 - - - ICCARM - 29 14 3 8 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerConductor.c - - - BICOMP - 164 - - - ICCARM - 112 107 - - - - - BICOMP - 29 14 90 4 37 8 - - - ICCARM - 29 14 90 4 37 8 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c - - - BICOMP - 123 - - - ICCARM - 100 129 - - - - - BICOMP - 29 14 8 3 - - - ICCARM - 29 14 8 3 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c - - - BICOMP - 165 - - - ICCARM - 134 156 - - - - - BICOMP - 29 14 42 - - - ICCARM - 29 14 42 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerHardware.c - - - BICOMP - 102 - - - ICCARM - 113 148 - - - - - BICOMP - 29 14 37 30 - - - ICCARM - 29 14 37 30 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c - - - BICOMP - 171 - - - ICCARM - 135 143 - - - - - BICOMP - 29 14 91 - - - ICCARM - 29 14 91 - - - - - $PROJ_DIR$\..\..\test\system\src\TimerModel.c - - - BICOMP - 144 - - - ICCARM - 182 172 - - - - - BICOMP - 29 14 4 21 - - - ICCARM - 29 14 4 21 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c - - - BICOMP - 109 - - - ICCARM - 127 175 - - - - - BICOMP - 29 14 18 - - - ICCARM - 29 14 18 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartConductor.c - - - BICOMP - 104 - - - ICCARM - 145 98 - - - - - BICOMP - 29 14 27 92 32 21 - - - ICCARM - 29 14 27 92 32 21 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartHardware.c - - - BICOMP - 103 - - - ICCARM - 139 166 - - - - - BICOMP - 29 14 92 42 20 - - - ICCARM - 29 14 92 42 20 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartModel.c - - - BICOMP - 163 - - - ICCARM - 155 184 - - - - - BICOMP - 29 14 32 24 18 28 25 23 31 1 6 48 2 34 7 5 - - - ICCARM - 29 14 32 24 18 28 25 23 31 1 26 6 48 2 34 7 5 - - - - - $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c - - - BICOMP - 136 - - - ICCARM - 106 146 - - - - - BICOMP - 29 14 20 91 - - - ICCARM - 29 14 20 91 - - - - - $PROJ_DIR$\..\src\ext_irq.c - - - BICOMP - 180 - - - ICCARM - 128 - - - - - $PROJ_DIR$\..\src\interrupt_timer.c - - - BICOMP - 138 - - - ICCARM - 183 - - - - - $PROJ_DIR$\..\src\interrupt_Usart.c - - - BICOMP - 177 - - - ICCARM - 119 - - - - - $PROJ_DIR$\..\src\main.c - - - BICOMP - 121 - - - ICCARM - 179 - - - - - $PROJ_DIR$\RAM_Debug\Obj\cmock_demo.pbd - - - BILINK - 153 126 120 116 133 141 151 186 125 140 174 185 164 131 102 147 123 144 109 104 165 103 163 136 171 121 - - - - - $PROJ_DIR$\RAM_Debug\Exe\cmock_demo.out - - - ILINK - 187 168 114 110 150 149 118 132 173 169 179 170 178 167 152 107 108 148 176 129 172 175 98 156 166 184 146 143 41 33 22 - - - - - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - BICOMP - 141 - - - ICCARM - 142 132 - - - - - BICOMP - 10 11 23 216 87 217 - - - ICCARM - 10 11 23 216 87 217 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - - - BICOMP - 120 - - - ICCARM - 101 110 - - - - - BICOMP - 84 87 83 82 - - - ICCARM - 84 87 83 82 - - - - - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - - - BICOMP - 153 - - - ICCARM - 99 168 - - - - - BICOMP - 84 87 86 72 76 - - - ICCARM - 84 87 86 72 76 - - - - - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - - - BICOMP - 126 - - - ICCARM - 161 114 - - - - - BICOMP - 84 87 76 83 81 - - - ICCARM - 84 87 76 83 81 - - - - - $PROJ_DIR$\..\..\examples\src\AdcModel.c - - - BICOMP - 116 - - - ICCARM - 111 150 - - - - - BICOMP - 84 87 72 88 85 77 - - - ICCARM - 84 87 72 88 85 77 - - - - - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - - - BICOMP - 133 - - - ICCARM - 122 149 - - - - - BICOMP - 84 87 81 - - - ICCARM - 84 87 81 - - - - - $PROJ_DIR$\..\..\examples\src\Executor.c - - - BICOMP - 151 - - - ICCARM - 162 173 - - - - - BICOMP - 84 87 43 57 45 47 86 59 - - - ICCARM - 84 87 43 57 45 47 86 59 - - - - - $PROJ_DIR$\..\..\examples\src\Main.c - - - BICOMP - 121 - - - ICCARM - 181 179 - - - - - BICOMP - 84 87 59 43 57 88 85 77 45 15 16 60 13 12 17 47 89 44 61 55 53 86 76 83 81 72 - - - ICCARM - 84 87 59 43 57 88 85 77 45 15 16 60 13 12 17 47 89 44 61 55 53 86 76 83 81 72 - - - - - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - - - BICOMP - 186 - - - ICCARM - 117 169 - - - - - BICOMP - 59 11 23 - - - ICCARM - 59 11 23 - - - - - $PROJ_DIR$\..\..\examples\src\Model.c - - - BICOMP - 125 - - - ICCARM - 124 170 - - - - - BICOMP - 57 84 87 88 77 - - - ICCARM - 57 84 87 88 77 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - - - BICOMP - 174 - - - ICCARM - 160 167 - - - - - BICOMP - 84 87 85 7 23 5 31 1 6 48 2 - - - ICCARM - 84 87 85 7 23 5 31 1 26 6 48 2 - - - - - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - - - BICOMP - 140 - - - ICCARM - 137 178 - - - - - BICOMP - 84 87 88 - - - ICCARM - 84 87 88 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - - - BICOMP - 147 - - - ICCARM - 154 176 - - - - - BICOMP - 84 87 61 55 - - - ICCARM - 84 87 61 55 - - - - - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - - - BICOMP - 185 - - - ICCARM - 115 152 - - - - - BICOMP - 84 87 77 7 23 5 31 1 6 48 2 - - - ICCARM - 84 87 77 7 23 5 31 1 26 6 48 2 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - - - BICOMP - 164 - - - ICCARM - 112 107 - - - - - BICOMP - 84 87 47 53 89 55 - - - ICCARM - 84 87 47 53 89 55 - - - - - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - - - BICOMP - 131 - - - ICCARM - 105 108 - - - - - BICOMP - 84 87 44 61 - - - ICCARM - 84 87 44 61 - - - - - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - - - BICOMP - 102 - - - ICCARM - 113 148 - - - - - BICOMP - 84 87 89 44 - - - ICCARM - 84 87 89 44 - - - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - - - BICOMP - 123 - - - ICCARM - 100 129 - - - - - BICOMP - 84 87 55 61 - - - ICCARM - 84 87 55 61 - - - - - $PROJ_DIR$\..\..\examples\src\TimerModel.c - - - BICOMP - 144 - - - ICCARM - 182 172 - - - - - BICOMP - 84 87 53 88 - - - ICCARM - 84 87 53 88 - - - - - $PROJ_DIR$\..\..\examples\src\UsartModel.c - - - BICOMP - 163 - - - ICCARM - 155 184 - - - - - BICOMP - 84 87 13 82 12 77 25 23 31 1 6 48 2 34 7 5 - - - ICCARM - 84 87 13 82 12 77 25 23 31 1 26 6 48 2 34 7 5 - - - - - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - - - BICOMP - 109 - - - ICCARM - 127 175 - - - - - BICOMP - 84 87 12 - - - ICCARM - 84 87 12 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - - - BICOMP - 104 - - - ICCARM - 145 98 - - - - - BICOMP - 84 87 45 15 13 88 - - - ICCARM - 84 87 45 15 13 88 - - - - - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - - - BICOMP - 165 - - - ICCARM - 134 156 - - - - - BICOMP - 84 87 16 - - - ICCARM - 84 87 16 - - - - - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - - - BICOMP - 103 - - - ICCARM - 139 166 - - - - - BICOMP - 84 87 15 16 60 - - - ICCARM - 84 87 15 16 60 - - - - - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - - - BICOMP - 171 - - - ICCARM - 135 143 - - - - - BICOMP - 84 87 17 - - - ICCARM - 84 87 17 - - - - - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - - - BICOMP - 136 - - - ICCARM - 106 146 - - - - - BICOMP - 84 87 60 17 - - - ICCARM - 84 87 60 17 - - - - - $PROJ_DIR$\srcIAR\Cstartup.s - - - AARM - 118 130 - - - - - AARM - 218 - - - - - $PROJ_DIR$\..\src\ext_irq.c - ICCARM - - - $PROJ_DIR$\..\src\interrupt_timer.c - ICCARM - - - $PROJ_DIR$\..\src\interrupt_Usart.c - ICCARM - - - $PROJ_DIR$\..\src\main.c - ICCARM - - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewd b/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewd deleted file mode 100644 index 2d881366b..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewd +++ /dev/null @@ -1,1906 +0,0 @@ - - - - 2 - - RAM_Debug - - ARM - - 1 - - C-SPY - 2 - - 18 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ARMSIM_ID - 2 - - 1 - 1 - 1 - - - - - - - - ANGEL_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - - GDBSERVER_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - IARROM_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - JLINK_ID - 2 - - 10 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LMIFTDI_ID - 2 - - 1 - 1 - 1 - - - - - - - - MACRAIGOR_ID - 2 - - 3 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - RDI_ID - 2 - - 1 - 1 - 1 - - - - - - - - - - - - - - - - - THIRDPARTY_ID - 2 - - 0 - 1 - 1 - - - - - - - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin - 0 - - - $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin - 0 - - - $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin - 1 - - - - - FLASH_Debug - - ARM - - 1 - - C-SPY - 2 - - 18 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ARMSIM_ID - 2 - - 1 - 1 - 1 - - - - - - - - ANGEL_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - - GDBSERVER_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - IARROM_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - JLINK_ID - 2 - - 10 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LMIFTDI_ID - 2 - - 1 - 1 - 1 - - - - - - - - MACRAIGOR_ID - 2 - - 3 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - RDI_ID - 2 - - 1 - 1 - 1 - - - - - - - - - - - - - - - - - THIRDPARTY_ID - 2 - - 0 - 1 - 1 - - - - - - - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin - 0 - - - $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin - 0 - - - $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin - 1 - - - - - Binary - - ARM - - 1 - - C-SPY - 2 - - 18 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ARMSIM_ID - 2 - - 1 - 1 - 1 - - - - - - - - ANGEL_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - - GDBSERVER_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - - IARROM_ID - 2 - - 0 - 1 - 1 - - - - - - - - - - JLINK_ID - 2 - - 10 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LMIFTDI_ID - 2 - - 1 - 1 - 1 - - - - - - - - MACRAIGOR_ID - 2 - - 3 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - RDI_ID - 2 - - 1 - 1 - 1 - - - - - - - - - - - - - - - - - THIRDPARTY_ID - 2 - - 0 - 1 - 1 - - - - - - - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin - 0 - - - $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin - 0 - - - $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin - 1 - - - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewp b/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewp deleted file mode 100644 index 4524d9107..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewp +++ /dev/null @@ -1,2426 +0,0 @@ - - - - 2 - - RAM_Debug - - ARM - - 1 - - General - 3 - - 16 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 20 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 7 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OBJCOPY - 0 - - 1 - 1 - 1 - - - - - - - - - CUSTOM - 3 - - - - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - ILINK - 0 - - 6 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IARCHIVE - 0 - - 0 - 1 - 1 - - - - - - - BILINK - 0 - - - - - FLASH_Debug - - ARM - - 1 - - General - 3 - - 16 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 20 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 7 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OBJCOPY - 0 - - 1 - 1 - 1 - - - - - - - - - CUSTOM - 3 - - - - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - ILINK - 0 - - 6 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IARCHIVE - 0 - - 0 - 1 - 1 - - - - - - - BILINK - 0 - - - - - Binary - - ARM - - 1 - - General - 3 - - 16 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICCARM - 2 - - 20 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AARM - 2 - - 7 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OBJCOPY - 0 - - 1 - 1 - 1 - - - - - - - - - CUSTOM - 3 - - - - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - ILINK - 0 - - 6 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IARCHIVE - 0 - - 0 - 1 - 1 - - - - - - - BILINK - 0 - - - - - Binary - - - Resource - - $PROJ_DIR$\Resource\at91SAM7X256_FLASH.icf - - - $PROJ_DIR$\Resource\at91SAM7X256_RAM.icf - - - $PROJ_DIR$\Resource\SAM7_FLASH.mac - - - $PROJ_DIR$\Resource\SAM7_RAM.mac - - - - Source - - $PROJ_DIR$\..\..\examples\src\AdcConductor.c - - - $PROJ_DIR$\..\..\examples\src\AdcHardware.c - - - $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c - - - $PROJ_DIR$\..\..\examples\src\AdcModel.c - - - $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c - - - $PROJ_DIR$\..\..\examples\src\Executor.c - - - $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c - - - $PROJ_DIR$\..\..\examples\src\Main.c - - - $PROJ_DIR$\..\..\examples\src\Model.c - - - $PROJ_DIR$\..\..\examples\src\TaskScheduler.c - - - $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c - - - $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c - - - $PROJ_DIR$\..\..\examples\src\TimerConductor.c - - - $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c - - - $PROJ_DIR$\..\..\examples\src\TimerHardware.c - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c - - - $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c - - - $PROJ_DIR$\..\..\examples\src\TimerModel.c - - - $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c - - - $PROJ_DIR$\..\..\examples\src\UsartConductor.c - - - $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c - - - $PROJ_DIR$\..\..\examples\src\UsartHardware.c - - - $PROJ_DIR$\..\..\examples\src\UsartModel.c - - - $PROJ_DIR$\..\..\examples\src\UsartPutChar.c - - - $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c - - - - Startup - - $PROJ_DIR$\srcIAR\Cstartup.s - - - $PROJ_DIR$\srcIAR\Cstartup_SAM7.c - - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.eww b/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.eww deleted file mode 100644 index cbf8dd8de..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.eww +++ /dev/null @@ -1,26 +0,0 @@ - - - - - $WS_DIR$\cmock_demo.ewp - - - - All - - cmock_demo - Binary - - - cmock_demo - FLASH_Debug - - - cmock_demo - RAM_Debug - - - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X-EK.h b/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X-EK.h deleted file mode 100644 index 98346759b..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X-EK.h +++ /dev/null @@ -1,61 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X-EK.h -// Object : AT91SAM7X-EK Evaluation Board Features Definition File -// -// ---------------------------------------------------------------------------- - -#ifndef AT91SAM7X_EK_H -#define AT91SAM7X_EK_H - -/*-----------------*/ -/* LEDs Definition */ -/*-----------------*/ -#define AT91B_LED1 (1<<19) // AT91C_PIO_PB19 AT91C_PB19_PWM0 AT91C_PB19_TCLK1 -#define AT91B_LED2 (1<<20) // AT91C_PIO_PB20 AT91C_PB20_PWM1 AT91C_PB20_PWM1 -#define AT91B_LED3 (AT91C_PIO_PB21) // AT91C_PIO_PB21 AT91C_PB21_PWM2 AT91C_PB21_PCK1 -#define AT91B_LED4 (AT91C_PIO_PB22) // AT91C_PIO_PB22 AT91C_PB22_PWM3 AT91C_PB22_PCK2 -#define AT91B_NB_LEB 4 -#define AT91B_LED_MASK (AT91B_LED1|AT91B_LED2|AT91B_LED3|AT91B_LED4) -#define AT91D_BASE_PIO_LED (AT91C_BASE_PIOB) - -#define AT91B_POWERLED (1<<25) // PB25 - - -/*-------------------------------*/ -/* JOYSTICK Position Definition */ -/*-------------------------------*/ -#define AT91B_SW1 (1<<21) // PA21 Up Button AT91C_PA21_TF AT91C_PA21_NPCS10 -#define AT91B_SW2 (1<<22) // PA22 Down Button AT91C_PA22_TK AT91C_PA22_SPCK1 -#define AT91B_SW3 (1<<23) // PA23 Left Button AT91C_PA23_TD AT91C_PA23_MOSI1 -#define AT91B_SW4 (1<<24) // PA24 Right Button AT91C_PA24_RD AT91C_PA24_MISO1 -#define AT91B_SW5 (1<<25) // PA25 Push Button AT91C_PA25_RK AT91C_PA25_NPCS11 -#define AT91B_SW_MASK (AT91B_SW1|AT91B_SW2|AT91B_SW3|AT91B_SW4|AT91B_SW5) - - -#define AT91D_BASE_PIO_SW (AT91C_BASE_PIOA) - -/*------------------*/ -/* CAN Definition */ -/*------------------*/ -#define AT91B_CAN_TRANSCEIVER_RS (1<<2) // PA2 - -/*--------------*/ -/* Clocks */ -/*--------------*/ -#define AT91B_MAIN_OSC 18432000 // Main Oscillator MAINCK -#define AT91B_MCK ((18432000*73/14)/2) // Output PLL Clock - -#endif /* AT91SAM7X-EK_H */ diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X256_inc.h b/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X256_inc.h deleted file mode 100644 index 18e58d41e..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X256_inc.h +++ /dev/null @@ -1,2268 +0,0 @@ -// ---------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -// ---------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h -// Object : AT91SAM7X256 definitions -// Generated : AT91 SW Application Group 01/16/2006 (16:36:22) -// -// CVS Reference : /AT91SAM7X256.pl/1.15/Wed Nov 2 13:56:49 2005// -// CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// -// CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// -// CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// -// CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// -// CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// -// CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// -// CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// -// CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// -// CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// -// CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// -// CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// -// CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// -// CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// -// CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// -// CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// -// CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// -// CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// -// CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// -// CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// -// CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// -// CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// -// CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// -// ---------------------------------------------------------------------------- - -// Hardware register definition - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR System Peripherals -// ***************************************************************************** - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Advanced Interrupt Controller -// ***************************************************************************** -// *** Register offset in AT91S_AIC structure *** -#define AIC_SMR ( 0) // Source Mode Register -#define AIC_SVR (128) // Source Vector Register -#define AIC_IVR (256) // IRQ Vector Register -#define AIC_FVR (260) // FIQ Vector Register -#define AIC_ISR (264) // Interrupt Status Register -#define AIC_IPR (268) // Interrupt Pending Register -#define AIC_IMR (272) // Interrupt Mask Register -#define AIC_CISR (276) // Core Interrupt Status Register -#define AIC_IECR (288) // Interrupt Enable Command Register -#define AIC_IDCR (292) // Interrupt Disable Command Register -#define AIC_ICCR (296) // Interrupt Clear Command Register -#define AIC_ISCR (300) // Interrupt Set Command Register -#define AIC_EOICR (304) // End of Interrupt Command Register -#define AIC_SPU (308) // Spurious Vector Register -#define AIC_DCR (312) // Debug Control Register (Protect) -#define AIC_FFER (320) // Fast Forcing Enable Register -#define AIC_FFDR (324) // Fast Forcing Disable Register -#define AIC_FFSR (328) // Fast Forcing Status Register -// -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- -#define AT91C_AIC_PRIOR (0x7 << 0) // (AIC) Priority Level -#define AT91C_AIC_PRIOR_LOWEST (0x0) // (AIC) Lowest priority level -#define AT91C_AIC_PRIOR_HIGHEST (0x7) // (AIC) Highest priority level -#define AT91C_AIC_SRCTYPE (0x3 << 5) // (AIC) Interrupt Source Type -#define AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL (0x0 << 5) // (AIC) External Sources Code Label Low-level Sensitive -#define AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL (0x0 << 5) // (AIC) Internal Sources Code Label High-level Sensitive -#define AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE (0x1 << 5) // (AIC) Internal Sources Code Label Positive Edge triggered -#define AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE (0x1 << 5) // (AIC) External Sources Code Label Negative Edge triggered -#define AT91C_AIC_SRCTYPE_HIGH_LEVEL (0x2 << 5) // (AIC) Internal Or External Sources Code Label High-level Sensitive -#define AT91C_AIC_SRCTYPE_POSITIVE_EDGE (0x3 << 5) // (AIC) Internal Or External Sources Code Label Positive Edge triggered -// -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- -#define AT91C_AIC_NFIQ (0x1 << 0) // (AIC) NFIQ Status -#define AT91C_AIC_NIRQ (0x1 << 1) // (AIC) NIRQ Status -// -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- -#define AT91C_AIC_DCR_PROT (0x1 << 0) // (AIC) Protection Mode -#define AT91C_AIC_DCR_GMSK (0x1 << 1) // (AIC) General Mask - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Peripheral DMA Controller -// ***************************************************************************** -// *** Register offset in AT91S_PDC structure *** -#define PDC_RPR ( 0) // Receive Pointer Register -#define PDC_RCR ( 4) // Receive Counter Register -#define PDC_TPR ( 8) // Transmit Pointer Register -#define PDC_TCR (12) // Transmit Counter Register -#define PDC_RNPR (16) // Receive Next Pointer Register -#define PDC_RNCR (20) // Receive Next Counter Register -#define PDC_TNPR (24) // Transmit Next Pointer Register -#define PDC_TNCR (28) // Transmit Next Counter Register -#define PDC_PTCR (32) // PDC Transfer Control Register -#define PDC_PTSR (36) // PDC Transfer Status Register -// -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- -#define AT91C_PDC_RXTEN (0x1 << 0) // (PDC) Receiver Transfer Enable -#define AT91C_PDC_RXTDIS (0x1 << 1) // (PDC) Receiver Transfer Disable -#define AT91C_PDC_TXTEN (0x1 << 8) // (PDC) Transmitter Transfer Enable -#define AT91C_PDC_TXTDIS (0x1 << 9) // (PDC) Transmitter Transfer Disable -// -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Debug Unit -// ***************************************************************************** -// *** Register offset in AT91S_DBGU structure *** -#define DBGU_CR ( 0) // Control Register -#define DBGU_MR ( 4) // Mode Register -#define DBGU_IER ( 8) // Interrupt Enable Register -#define DBGU_IDR (12) // Interrupt Disable Register -#define DBGU_IMR (16) // Interrupt Mask Register -#define DBGU_CSR (20) // Channel Status Register -#define DBGU_RHR (24) // Receiver Holding Register -#define DBGU_THR (28) // Transmitter Holding Register -#define DBGU_BRGR (32) // Baud Rate Generator Register -#define DBGU_CIDR (64) // Chip ID Register -#define DBGU_EXID (68) // Chip ID Extension Register -#define DBGU_FNTR (72) // Force NTRST Register -#define DBGU_RPR (256) // Receive Pointer Register -#define DBGU_RCR (260) // Receive Counter Register -#define DBGU_TPR (264) // Transmit Pointer Register -#define DBGU_TCR (268) // Transmit Counter Register -#define DBGU_RNPR (272) // Receive Next Pointer Register -#define DBGU_RNCR (276) // Receive Next Counter Register -#define DBGU_TNPR (280) // Transmit Next Pointer Register -#define DBGU_TNCR (284) // Transmit Next Counter Register -#define DBGU_PTCR (288) // PDC Transfer Control Register -#define DBGU_PTSR (292) // PDC Transfer Status Register -// -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- -#define AT91C_US_RSTRX (0x1 << 2) // (DBGU) Reset Receiver -#define AT91C_US_RSTTX (0x1 << 3) // (DBGU) Reset Transmitter -#define AT91C_US_RXEN (0x1 << 4) // (DBGU) Receiver Enable -#define AT91C_US_RXDIS (0x1 << 5) // (DBGU) Receiver Disable -#define AT91C_US_TXEN (0x1 << 6) // (DBGU) Transmitter Enable -#define AT91C_US_TXDIS (0x1 << 7) // (DBGU) Transmitter Disable -#define AT91C_US_RSTSTA (0x1 << 8) // (DBGU) Reset Status Bits -// -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- -#define AT91C_US_PAR (0x7 << 9) // (DBGU) Parity type -#define AT91C_US_PAR_EVEN (0x0 << 9) // (DBGU) Even Parity -#define AT91C_US_PAR_ODD (0x1 << 9) // (DBGU) Odd Parity -#define AT91C_US_PAR_SPACE (0x2 << 9) // (DBGU) Parity forced to 0 (Space) -#define AT91C_US_PAR_MARK (0x3 << 9) // (DBGU) Parity forced to 1 (Mark) -#define AT91C_US_PAR_NONE (0x4 << 9) // (DBGU) No Parity -#define AT91C_US_PAR_MULTI_DROP (0x6 << 9) // (DBGU) Multi-drop mode -#define AT91C_US_CHMODE (0x3 << 14) // (DBGU) Channel Mode -#define AT91C_US_CHMODE_NORMAL (0x0 << 14) // (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. -#define AT91C_US_CHMODE_AUTO (0x1 << 14) // (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. -#define AT91C_US_CHMODE_LOCAL (0x2 << 14) // (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. -#define AT91C_US_CHMODE_REMOTE (0x3 << 14) // (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. -// -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- -#define AT91C_US_RXRDY (0x1 << 0) // (DBGU) RXRDY Interrupt -#define AT91C_US_TXRDY (0x1 << 1) // (DBGU) TXRDY Interrupt -#define AT91C_US_ENDRX (0x1 << 3) // (DBGU) End of Receive Transfer Interrupt -#define AT91C_US_ENDTX (0x1 << 4) // (DBGU) End of Transmit Interrupt -#define AT91C_US_OVRE (0x1 << 5) // (DBGU) Overrun Interrupt -#define AT91C_US_FRAME (0x1 << 6) // (DBGU) Framing Error Interrupt -#define AT91C_US_PARE (0x1 << 7) // (DBGU) Parity Error Interrupt -#define AT91C_US_TXEMPTY (0x1 << 9) // (DBGU) TXEMPTY Interrupt -#define AT91C_US_TXBUFE (0x1 << 11) // (DBGU) TXBUFE Interrupt -#define AT91C_US_RXBUFF (0x1 << 12) // (DBGU) RXBUFF Interrupt -#define AT91C_US_COMM_TX (0x1 << 30) // (DBGU) COMM_TX Interrupt -#define AT91C_US_COMM_RX (0x1 << 31) // (DBGU) COMM_RX Interrupt -// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- -// -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- -#define AT91C_US_FORCE_NTRST (0x1 << 0) // (DBGU) Force NTRST in JTAG - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Parallel Input Output Controler -// ***************************************************************************** -// *** Register offset in AT91S_PIO structure *** -#define PIO_PER ( 0) // PIO Enable Register -#define PIO_PDR ( 4) // PIO Disable Register -#define PIO_PSR ( 8) // PIO Status Register -#define PIO_OER (16) // Output Enable Register -#define PIO_ODR (20) // Output Disable Registerr -#define PIO_OSR (24) // Output Status Register -#define PIO_IFER (32) // Input Filter Enable Register -#define PIO_IFDR (36) // Input Filter Disable Register -#define PIO_IFSR (40) // Input Filter Status Register -#define PIO_SODR (48) // Set Output Data Register -#define PIO_CODR (52) // Clear Output Data Register -#define PIO_ODSR (56) // Output Data Status Register -#define PIO_PDSR (60) // Pin Data Status Register -#define PIO_IER (64) // Interrupt Enable Register -#define PIO_IDR (68) // Interrupt Disable Register -#define PIO_IMR (72) // Interrupt Mask Register -#define PIO_ISR (76) // Interrupt Status Register -#define PIO_MDER (80) // Multi-driver Enable Register -#define PIO_MDDR (84) // Multi-driver Disable Register -#define PIO_MDSR (88) // Multi-driver Status Register -#define PIO_PPUDR (96) // Pull-up Disable Register -#define PIO_PPUER (100) // Pull-up Enable Register -#define PIO_PPUSR (104) // Pull-up Status Register -#define PIO_ASR (112) // Select A Register -#define PIO_BSR (116) // Select B Register -#define PIO_ABSR (120) // AB Select Status Register -#define PIO_OWER (160) // Output Write Enable Register -#define PIO_OWDR (164) // Output Write Disable Register -#define PIO_OWSR (168) // Output Write Status Register - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Clock Generator Controler -// ***************************************************************************** -// *** Register offset in AT91S_CKGR structure *** -#define CKGR_MOR ( 0) // Main Oscillator Register -#define CKGR_MCFR ( 4) // Main Clock Frequency Register -#define CKGR_PLLR (12) // PLL Register -// -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- -#define AT91C_CKGR_MOSCEN (0x1 << 0) // (CKGR) Main Oscillator Enable -#define AT91C_CKGR_OSCBYPASS (0x1 << 1) // (CKGR) Main Oscillator Bypass -#define AT91C_CKGR_OSCOUNT (0xFF << 8) // (CKGR) Main Oscillator Start-up Time -// -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- -#define AT91C_CKGR_MAINF (0xFFFF << 0) // (CKGR) Main Clock Frequency -#define AT91C_CKGR_MAINRDY (0x1 << 16) // (CKGR) Main Clock Ready -// -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- -#define AT91C_CKGR_DIV (0xFF << 0) // (CKGR) Divider Selected -#define AT91C_CKGR_DIV_0 (0x0) // (CKGR) Divider output is 0 -#define AT91C_CKGR_DIV_BYPASS (0x1) // (CKGR) Divider is bypassed -#define AT91C_CKGR_PLLCOUNT (0x3F << 8) // (CKGR) PLL Counter -#define AT91C_CKGR_OUT (0x3 << 14) // (CKGR) PLL Output Frequency Range -#define AT91C_CKGR_OUT_0 (0x0 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_1 (0x1 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_2 (0x2 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_OUT_3 (0x3 << 14) // (CKGR) Please refer to the PLL datasheet -#define AT91C_CKGR_MUL (0x7FF << 16) // (CKGR) PLL Multiplier -#define AT91C_CKGR_USBDIV (0x3 << 28) // (CKGR) Divider for USB Clocks -#define AT91C_CKGR_USBDIV_0 (0x0 << 28) // (CKGR) Divider output is PLL clock output -#define AT91C_CKGR_USBDIV_1 (0x1 << 28) // (CKGR) Divider output is PLL clock output divided by 2 -#define AT91C_CKGR_USBDIV_2 (0x2 << 28) // (CKGR) Divider output is PLL clock output divided by 4 - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Power Management Controler -// ***************************************************************************** -// *** Register offset in AT91S_PMC structure *** -#define PMC_SCER ( 0) // System Clock Enable Register -#define PMC_SCDR ( 4) // System Clock Disable Register -#define PMC_SCSR ( 8) // System Clock Status Register -#define PMC_PCER (16) // Peripheral Clock Enable Register -#define PMC_PCDR (20) // Peripheral Clock Disable Register -#define PMC_PCSR (24) // Peripheral Clock Status Register -#define PMC_MOR (32) // Main Oscillator Register -#define PMC_MCFR (36) // Main Clock Frequency Register -#define PMC_PLLR (44) // PLL Register -#define PMC_MCKR (48) // Master Clock Register -#define PMC_PCKR (64) // Programmable Clock Register -#define PMC_IER (96) // Interrupt Enable Register -#define PMC_IDR (100) // Interrupt Disable Register -#define PMC_SR (104) // Status Register -#define PMC_IMR (108) // Interrupt Mask Register -// -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- -#define AT91C_PMC_PCK (0x1 << 0) // (PMC) Processor Clock -#define AT91C_PMC_UDP (0x1 << 7) // (PMC) USB Device Port Clock -#define AT91C_PMC_PCK0 (0x1 << 8) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK1 (0x1 << 9) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK2 (0x1 << 10) // (PMC) Programmable Clock Output -#define AT91C_PMC_PCK3 (0x1 << 11) // (PMC) Programmable Clock Output -// -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- -// -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- -// -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- -// -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- -// -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- -// -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- -#define AT91C_PMC_CSS (0x3 << 0) // (PMC) Programmable Clock Selection -#define AT91C_PMC_CSS_SLOW_CLK (0x0) // (PMC) Slow Clock is selected -#define AT91C_PMC_CSS_MAIN_CLK (0x1) // (PMC) Main Clock is selected -#define AT91C_PMC_CSS_PLL_CLK (0x3) // (PMC) Clock from PLL is selected -#define AT91C_PMC_PRES (0x7 << 2) // (PMC) Programmable Clock Prescaler -#define AT91C_PMC_PRES_CLK (0x0 << 2) // (PMC) Selected clock -#define AT91C_PMC_PRES_CLK_2 (0x1 << 2) // (PMC) Selected clock divided by 2 -#define AT91C_PMC_PRES_CLK_4 (0x2 << 2) // (PMC) Selected clock divided by 4 -#define AT91C_PMC_PRES_CLK_8 (0x3 << 2) // (PMC) Selected clock divided by 8 -#define AT91C_PMC_PRES_CLK_16 (0x4 << 2) // (PMC) Selected clock divided by 16 -#define AT91C_PMC_PRES_CLK_32 (0x5 << 2) // (PMC) Selected clock divided by 32 -#define AT91C_PMC_PRES_CLK_64 (0x6 << 2) // (PMC) Selected clock divided by 64 -// -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- -// -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- -#define AT91C_PMC_MOSCS (0x1 << 0) // (PMC) MOSC Status/Enable/Disable/Mask -#define AT91C_PMC_LOCK (0x1 << 2) // (PMC) PLL Status/Enable/Disable/Mask -#define AT91C_PMC_MCKRDY (0x1 << 3) // (PMC) MCK_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK0RDY (0x1 << 8) // (PMC) PCK0_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK1RDY (0x1 << 9) // (PMC) PCK1_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK2RDY (0x1 << 10) // (PMC) PCK2_RDY Status/Enable/Disable/Mask -#define AT91C_PMC_PCK3RDY (0x1 << 11) // (PMC) PCK3_RDY Status/Enable/Disable/Mask -// -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- -// -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- -// -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Reset Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_RSTC structure *** -#define RSTC_RCR ( 0) // Reset Control Register -#define RSTC_RSR ( 4) // Reset Status Register -#define RSTC_RMR ( 8) // Reset Mode Register -// -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- -#define AT91C_RSTC_PROCRST (0x1 << 0) // (RSTC) Processor Reset -#define AT91C_RSTC_PERRST (0x1 << 2) // (RSTC) Peripheral Reset -#define AT91C_RSTC_EXTRST (0x1 << 3) // (RSTC) External Reset -#define AT91C_RSTC_KEY (0xFF << 24) // (RSTC) Password -// -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- -#define AT91C_RSTC_URSTS (0x1 << 0) // (RSTC) User Reset Status -#define AT91C_RSTC_BODSTS (0x1 << 1) // (RSTC) Brownout Detection Status -#define AT91C_RSTC_RSTTYP (0x7 << 8) // (RSTC) Reset Type -#define AT91C_RSTC_RSTTYP_POWERUP (0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising. -#define AT91C_RSTC_RSTTYP_WAKEUP (0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising. -#define AT91C_RSTC_RSTTYP_WATCHDOG (0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occured. -#define AT91C_RSTC_RSTTYP_SOFTWARE (0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software. -#define AT91C_RSTC_RSTTYP_USER (0x4 << 8) // (RSTC) User Reset. NRST pin detected low. -#define AT91C_RSTC_RSTTYP_BROWNOUT (0x5 << 8) // (RSTC) Brownout Reset occured. -#define AT91C_RSTC_NRSTL (0x1 << 16) // (RSTC) NRST pin level -#define AT91C_RSTC_SRCMP (0x1 << 17) // (RSTC) Software Reset Command in Progress. -// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- -#define AT91C_RSTC_URSTEN (0x1 << 0) // (RSTC) User Reset Enable -#define AT91C_RSTC_URSTIEN (0x1 << 4) // (RSTC) User Reset Interrupt Enable -#define AT91C_RSTC_ERSTL (0xF << 8) // (RSTC) User Reset Length -#define AT91C_RSTC_BODIEN (0x1 << 16) // (RSTC) Brownout Detection Interrupt Enable - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_RTTC structure *** -#define RTTC_RTMR ( 0) // Real-time Mode Register -#define RTTC_RTAR ( 4) // Real-time Alarm Register -#define RTTC_RTVR ( 8) // Real-time Value Register -#define RTTC_RTSR (12) // Real-time Status Register -// -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- -#define AT91C_RTTC_RTPRES (0xFFFF << 0) // (RTTC) Real-time Timer Prescaler Value -#define AT91C_RTTC_ALMIEN (0x1 << 16) // (RTTC) Alarm Interrupt Enable -#define AT91C_RTTC_RTTINCIEN (0x1 << 17) // (RTTC) Real Time Timer Increment Interrupt Enable -#define AT91C_RTTC_RTTRST (0x1 << 18) // (RTTC) Real Time Timer Restart -// -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- -#define AT91C_RTTC_ALMV (0x0 << 0) // (RTTC) Alarm Value -// -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- -#define AT91C_RTTC_CRTV (0x0 << 0) // (RTTC) Current Real-time Value -// -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- -#define AT91C_RTTC_ALMS (0x1 << 0) // (RTTC) Real-time Alarm Status -#define AT91C_RTTC_RTTINC (0x1 << 1) // (RTTC) Real-time Timer Increment - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_PITC structure *** -#define PITC_PIMR ( 0) // Period Interval Mode Register -#define PITC_PISR ( 4) // Period Interval Status Register -#define PITC_PIVR ( 8) // Period Interval Value Register -#define PITC_PIIR (12) // Period Interval Image Register -// -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- -#define AT91C_PITC_PIV (0xFFFFF << 0) // (PITC) Periodic Interval Value -#define AT91C_PITC_PITEN (0x1 << 24) // (PITC) Periodic Interval Timer Enabled -#define AT91C_PITC_PITIEN (0x1 << 25) // (PITC) Periodic Interval Timer Interrupt Enable -// -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- -#define AT91C_PITC_PITS (0x1 << 0) // (PITC) Periodic Interval Timer Status -// -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- -#define AT91C_PITC_CPIV (0xFFFFF << 0) // (PITC) Current Periodic Interval Value -#define AT91C_PITC_PICNT (0xFFF << 20) // (PITC) Periodic Interval Counter -// -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_WDTC structure *** -#define WDTC_WDCR ( 0) // Watchdog Control Register -#define WDTC_WDMR ( 4) // Watchdog Mode Register -#define WDTC_WDSR ( 8) // Watchdog Status Register -// -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- -#define AT91C_WDTC_WDRSTT (0x1 << 0) // (WDTC) Watchdog Restart -#define AT91C_WDTC_KEY (0xFF << 24) // (WDTC) Watchdog KEY Password -// -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- -#define AT91C_WDTC_WDV (0xFFF << 0) // (WDTC) Watchdog Timer Restart -#define AT91C_WDTC_WDFIEN (0x1 << 12) // (WDTC) Watchdog Fault Interrupt Enable -#define AT91C_WDTC_WDRSTEN (0x1 << 13) // (WDTC) Watchdog Reset Enable -#define AT91C_WDTC_WDRPROC (0x1 << 14) // (WDTC) Watchdog Timer Restart -#define AT91C_WDTC_WDDIS (0x1 << 15) // (WDTC) Watchdog Disable -#define AT91C_WDTC_WDD (0xFFF << 16) // (WDTC) Watchdog Delta Value -#define AT91C_WDTC_WDDBGHLT (0x1 << 28) // (WDTC) Watchdog Debug Halt -#define AT91C_WDTC_WDIDLEHLT (0x1 << 29) // (WDTC) Watchdog Idle Halt -// -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- -#define AT91C_WDTC_WDUNF (0x1 << 0) // (WDTC) Watchdog Underflow -#define AT91C_WDTC_WDERR (0x1 << 1) // (WDTC) Watchdog Error - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_VREG structure *** -#define VREG_MR ( 0) // Voltage Regulator Mode Register -// -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- -#define AT91C_VREG_PSTDBY (0x1 << 0) // (VREG) Voltage Regulator Power Standby Mode - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Memory Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_MC structure *** -#define MC_RCR ( 0) // MC Remap Control Register -#define MC_ASR ( 4) // MC Abort Status Register -#define MC_AASR ( 8) // MC Abort Address Status Register -#define MC_FMR (96) // MC Flash Mode Register -#define MC_FCR (100) // MC Flash Command Register -#define MC_FSR (104) // MC Flash Status Register -// -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- -#define AT91C_MC_RCB (0x1 << 0) // (MC) Remap Command Bit -// -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- -#define AT91C_MC_UNDADD (0x1 << 0) // (MC) Undefined Addess Abort Status -#define AT91C_MC_MISADD (0x1 << 1) // (MC) Misaligned Addess Abort Status -#define AT91C_MC_ABTSZ (0x3 << 8) // (MC) Abort Size Status -#define AT91C_MC_ABTSZ_BYTE (0x0 << 8) // (MC) Byte -#define AT91C_MC_ABTSZ_HWORD (0x1 << 8) // (MC) Half-word -#define AT91C_MC_ABTSZ_WORD (0x2 << 8) // (MC) Word -#define AT91C_MC_ABTTYP (0x3 << 10) // (MC) Abort Type Status -#define AT91C_MC_ABTTYP_DATAR (0x0 << 10) // (MC) Data Read -#define AT91C_MC_ABTTYP_DATAW (0x1 << 10) // (MC) Data Write -#define AT91C_MC_ABTTYP_FETCH (0x2 << 10) // (MC) Code Fetch -#define AT91C_MC_MST0 (0x1 << 16) // (MC) Master 0 Abort Source -#define AT91C_MC_MST1 (0x1 << 17) // (MC) Master 1 Abort Source -#define AT91C_MC_SVMST0 (0x1 << 24) // (MC) Saved Master 0 Abort Source -#define AT91C_MC_SVMST1 (0x1 << 25) // (MC) Saved Master 1 Abort Source -// -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- -#define AT91C_MC_FRDY (0x1 << 0) // (MC) Flash Ready -#define AT91C_MC_LOCKE (0x1 << 2) // (MC) Lock Error -#define AT91C_MC_PROGE (0x1 << 3) // (MC) Programming Error -#define AT91C_MC_NEBP (0x1 << 7) // (MC) No Erase Before Programming -#define AT91C_MC_FWS (0x3 << 8) // (MC) Flash Wait State -#define AT91C_MC_FWS_0FWS (0x0 << 8) // (MC) 1 cycle for Read, 2 for Write operations -#define AT91C_MC_FWS_1FWS (0x1 << 8) // (MC) 2 cycles for Read, 3 for Write operations -#define AT91C_MC_FWS_2FWS (0x2 << 8) // (MC) 3 cycles for Read, 4 for Write operations -#define AT91C_MC_FWS_3FWS (0x3 << 8) // (MC) 4 cycles for Read, 4 for Write operations -#define AT91C_MC_FMCN (0xFF << 16) // (MC) Flash Microsecond Cycle Number -// -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- -#define AT91C_MC_FCMD (0xF << 0) // (MC) Flash Command -#define AT91C_MC_FCMD_START_PROG (0x1) // (MC) Starts the programming of th epage specified by PAGEN. -#define AT91C_MC_FCMD_LOCK (0x2) // (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -#define AT91C_MC_FCMD_PROG_AND_LOCK (0x3) // (MC) The lock sequence automatically happens after the programming sequence is completed. -#define AT91C_MC_FCMD_UNLOCK (0x4) // (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. -#define AT91C_MC_FCMD_ERASE_ALL (0x8) // (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. -#define AT91C_MC_FCMD_SET_GP_NVM (0xB) // (MC) Set General Purpose NVM bits. -#define AT91C_MC_FCMD_CLR_GP_NVM (0xD) // (MC) Clear General Purpose NVM bits. -#define AT91C_MC_FCMD_SET_SECURITY (0xF) // (MC) Set Security Bit. -#define AT91C_MC_PAGEN (0x3FF << 8) // (MC) Page Number -#define AT91C_MC_KEY (0xFF << 24) // (MC) Writing Protect Key -// -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- -#define AT91C_MC_SECURITY (0x1 << 4) // (MC) Security Bit Status -#define AT91C_MC_GPNVM0 (0x1 << 8) // (MC) Sector 0 Lock Status -#define AT91C_MC_GPNVM1 (0x1 << 9) // (MC) Sector 1 Lock Status -#define AT91C_MC_GPNVM2 (0x1 << 10) // (MC) Sector 2 Lock Status -#define AT91C_MC_GPNVM3 (0x1 << 11) // (MC) Sector 3 Lock Status -#define AT91C_MC_GPNVM4 (0x1 << 12) // (MC) Sector 4 Lock Status -#define AT91C_MC_GPNVM5 (0x1 << 13) // (MC) Sector 5 Lock Status -#define AT91C_MC_GPNVM6 (0x1 << 14) // (MC) Sector 6 Lock Status -#define AT91C_MC_GPNVM7 (0x1 << 15) // (MC) Sector 7 Lock Status -#define AT91C_MC_LOCKS0 (0x1 << 16) // (MC) Sector 0 Lock Status -#define AT91C_MC_LOCKS1 (0x1 << 17) // (MC) Sector 1 Lock Status -#define AT91C_MC_LOCKS2 (0x1 << 18) // (MC) Sector 2 Lock Status -#define AT91C_MC_LOCKS3 (0x1 << 19) // (MC) Sector 3 Lock Status -#define AT91C_MC_LOCKS4 (0x1 << 20) // (MC) Sector 4 Lock Status -#define AT91C_MC_LOCKS5 (0x1 << 21) // (MC) Sector 5 Lock Status -#define AT91C_MC_LOCKS6 (0x1 << 22) // (MC) Sector 6 Lock Status -#define AT91C_MC_LOCKS7 (0x1 << 23) // (MC) Sector 7 Lock Status -#define AT91C_MC_LOCKS8 (0x1 << 24) // (MC) Sector 8 Lock Status -#define AT91C_MC_LOCKS9 (0x1 << 25) // (MC) Sector 9 Lock Status -#define AT91C_MC_LOCKS10 (0x1 << 26) // (MC) Sector 10 Lock Status -#define AT91C_MC_LOCKS11 (0x1 << 27) // (MC) Sector 11 Lock Status -#define AT91C_MC_LOCKS12 (0x1 << 28) // (MC) Sector 12 Lock Status -#define AT91C_MC_LOCKS13 (0x1 << 29) // (MC) Sector 13 Lock Status -#define AT91C_MC_LOCKS14 (0x1 << 30) // (MC) Sector 14 Lock Status -#define AT91C_MC_LOCKS15 (0x1 << 31) // (MC) Sector 15 Lock Status - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Serial Parallel Interface -// ***************************************************************************** -// *** Register offset in AT91S_SPI structure *** -#define SPI_CR ( 0) // Control Register -#define SPI_MR ( 4) // Mode Register -#define SPI_RDR ( 8) // Receive Data Register -#define SPI_TDR (12) // Transmit Data Register -#define SPI_SR (16) // Status Register -#define SPI_IER (20) // Interrupt Enable Register -#define SPI_IDR (24) // Interrupt Disable Register -#define SPI_IMR (28) // Interrupt Mask Register -#define SPI_CSR (48) // Chip Select Register -#define SPI_RPR (256) // Receive Pointer Register -#define SPI_RCR (260) // Receive Counter Register -#define SPI_TPR (264) // Transmit Pointer Register -#define SPI_TCR (268) // Transmit Counter Register -#define SPI_RNPR (272) // Receive Next Pointer Register -#define SPI_RNCR (276) // Receive Next Counter Register -#define SPI_TNPR (280) // Transmit Next Pointer Register -#define SPI_TNCR (284) // Transmit Next Counter Register -#define SPI_PTCR (288) // PDC Transfer Control Register -#define SPI_PTSR (292) // PDC Transfer Status Register -// -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- -#define AT91C_SPI_SPIEN (0x1 << 0) // (SPI) SPI Enable -#define AT91C_SPI_SPIDIS (0x1 << 1) // (SPI) SPI Disable -#define AT91C_SPI_SWRST (0x1 << 7) // (SPI) SPI Software reset -#define AT91C_SPI_LASTXFER (0x1 << 24) // (SPI) SPI Last Transfer -// -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- -#define AT91C_SPI_MSTR (0x1 << 0) // (SPI) Master/Slave Mode -#define AT91C_SPI_PS (0x1 << 1) // (SPI) Peripheral Select -#define AT91C_SPI_PS_FIXED (0x0 << 1) // (SPI) Fixed Peripheral Select -#define AT91C_SPI_PS_VARIABLE (0x1 << 1) // (SPI) Variable Peripheral Select -#define AT91C_SPI_PCSDEC (0x1 << 2) // (SPI) Chip Select Decode -#define AT91C_SPI_FDIV (0x1 << 3) // (SPI) Clock Selection -#define AT91C_SPI_MODFDIS (0x1 << 4) // (SPI) Mode Fault Detection -#define AT91C_SPI_LLB (0x1 << 7) // (SPI) Clock Selection -#define AT91C_SPI_PCS (0xF << 16) // (SPI) Peripheral Chip Select -#define AT91C_SPI_DLYBCS (0xFF << 24) // (SPI) Delay Between Chip Selects -// -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- -#define AT91C_SPI_RD (0xFFFF << 0) // (SPI) Receive Data -#define AT91C_SPI_RPCS (0xF << 16) // (SPI) Peripheral Chip Select Status -// -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- -#define AT91C_SPI_TD (0xFFFF << 0) // (SPI) Transmit Data -#define AT91C_SPI_TPCS (0xF << 16) // (SPI) Peripheral Chip Select Status -// -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- -#define AT91C_SPI_RDRF (0x1 << 0) // (SPI) Receive Data Register Full -#define AT91C_SPI_TDRE (0x1 << 1) // (SPI) Transmit Data Register Empty -#define AT91C_SPI_MODF (0x1 << 2) // (SPI) Mode Fault Error -#define AT91C_SPI_OVRES (0x1 << 3) // (SPI) Overrun Error Status -#define AT91C_SPI_ENDRX (0x1 << 4) // (SPI) End of Receiver Transfer -#define AT91C_SPI_ENDTX (0x1 << 5) // (SPI) End of Receiver Transfer -#define AT91C_SPI_RXBUFF (0x1 << 6) // (SPI) RXBUFF Interrupt -#define AT91C_SPI_TXBUFE (0x1 << 7) // (SPI) TXBUFE Interrupt -#define AT91C_SPI_NSSR (0x1 << 8) // (SPI) NSSR Interrupt -#define AT91C_SPI_TXEMPTY (0x1 << 9) // (SPI) TXEMPTY Interrupt -#define AT91C_SPI_SPIENS (0x1 << 16) // (SPI) Enable Status -// -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- -// -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- -// -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- -// -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- -#define AT91C_SPI_CPOL (0x1 << 0) // (SPI) Clock Polarity -#define AT91C_SPI_NCPHA (0x1 << 1) // (SPI) Clock Phase -#define AT91C_SPI_CSAAT (0x1 << 3) // (SPI) Chip Select Active After Transfer -#define AT91C_SPI_BITS (0xF << 4) // (SPI) Bits Per Transfer -#define AT91C_SPI_BITS_8 (0x0 << 4) // (SPI) 8 Bits Per transfer -#define AT91C_SPI_BITS_9 (0x1 << 4) // (SPI) 9 Bits Per transfer -#define AT91C_SPI_BITS_10 (0x2 << 4) // (SPI) 10 Bits Per transfer -#define AT91C_SPI_BITS_11 (0x3 << 4) // (SPI) 11 Bits Per transfer -#define AT91C_SPI_BITS_12 (0x4 << 4) // (SPI) 12 Bits Per transfer -#define AT91C_SPI_BITS_13 (0x5 << 4) // (SPI) 13 Bits Per transfer -#define AT91C_SPI_BITS_14 (0x6 << 4) // (SPI) 14 Bits Per transfer -#define AT91C_SPI_BITS_15 (0x7 << 4) // (SPI) 15 Bits Per transfer -#define AT91C_SPI_BITS_16 (0x8 << 4) // (SPI) 16 Bits Per transfer -#define AT91C_SPI_SCBR (0xFF << 8) // (SPI) Serial Clock Baud Rate -#define AT91C_SPI_DLYBS (0xFF << 16) // (SPI) Delay Before SPCK -#define AT91C_SPI_DLYBCT (0xFF << 24) // (SPI) Delay Between Consecutive Transfers - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Usart -// ***************************************************************************** -// *** Register offset in AT91S_USART structure *** -#define US_CR ( 0) // Control Register -#define US_MR ( 4) // Mode Register -#define US_IER ( 8) // Interrupt Enable Register -#define US_IDR (12) // Interrupt Disable Register -#define US_IMR (16) // Interrupt Mask Register -#define US_CSR (20) // Channel Status Register -#define US_RHR (24) // Receiver Holding Register -#define US_THR (28) // Transmitter Holding Register -#define US_BRGR (32) // Baud Rate Generator Register -#define US_RTOR (36) // Receiver Time-out Register -#define US_TTGR (40) // Transmitter Time-guard Register -#define US_FIDI (64) // FI_DI_Ratio Register -#define US_NER (68) // Nb Errors Register -#define US_IF (76) // IRDA_FILTER Register -#define US_RPR (256) // Receive Pointer Register -#define US_RCR (260) // Receive Counter Register -#define US_TPR (264) // Transmit Pointer Register -#define US_TCR (268) // Transmit Counter Register -#define US_RNPR (272) // Receive Next Pointer Register -#define US_RNCR (276) // Receive Next Counter Register -#define US_TNPR (280) // Transmit Next Pointer Register -#define US_TNCR (284) // Transmit Next Counter Register -#define US_PTCR (288) // PDC Transfer Control Register -#define US_PTSR (292) // PDC Transfer Status Register -// -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- -#define AT91C_US_STTBRK (0x1 << 9) // (USART) Start Break -#define AT91C_US_STPBRK (0x1 << 10) // (USART) Stop Break -#define AT91C_US_STTTO (0x1 << 11) // (USART) Start Time-out -#define AT91C_US_SENDA (0x1 << 12) // (USART) Send Address -#define AT91C_US_RSTIT (0x1 << 13) // (USART) Reset Iterations -#define AT91C_US_RSTNACK (0x1 << 14) // (USART) Reset Non Acknowledge -#define AT91C_US_RETTO (0x1 << 15) // (USART) Rearm Time-out -#define AT91C_US_DTREN (0x1 << 16) // (USART) Data Terminal ready Enable -#define AT91C_US_DTRDIS (0x1 << 17) // (USART) Data Terminal ready Disable -#define AT91C_US_RTSEN (0x1 << 18) // (USART) Request to Send enable -#define AT91C_US_RTSDIS (0x1 << 19) // (USART) Request to Send Disable -// -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- -#define AT91C_US_USMODE (0xF << 0) // (USART) Usart mode -#define AT91C_US_USMODE_NORMAL (0x0) // (USART) Normal -#define AT91C_US_USMODE_RS485 (0x1) // (USART) RS485 -#define AT91C_US_USMODE_HWHSH (0x2) // (USART) Hardware Handshaking -#define AT91C_US_USMODE_MODEM (0x3) // (USART) Modem -#define AT91C_US_USMODE_ISO7816_0 (0x4) // (USART) ISO7816 protocol: T = 0 -#define AT91C_US_USMODE_ISO7816_1 (0x6) // (USART) ISO7816 protocol: T = 1 -#define AT91C_US_USMODE_IRDA (0x8) // (USART) IrDA -#define AT91C_US_USMODE_SWHSH (0xC) // (USART) Software Handshaking -#define AT91C_US_CLKS (0x3 << 4) // (USART) Clock Selection (Baud Rate generator Input Clock -#define AT91C_US_CLKS_CLOCK (0x0 << 4) // (USART) Clock -#define AT91C_US_CLKS_FDIV1 (0x1 << 4) // (USART) fdiv1 -#define AT91C_US_CLKS_SLOW (0x2 << 4) // (USART) slow_clock (ARM) -#define AT91C_US_CLKS_EXT (0x3 << 4) // (USART) External (SCK) -#define AT91C_US_CHRL (0x3 << 6) // (USART) Clock Selection (Baud Rate generator Input Clock -#define AT91C_US_CHRL_5_BITS (0x0 << 6) // (USART) Character Length: 5 bits -#define AT91C_US_CHRL_6_BITS (0x1 << 6) // (USART) Character Length: 6 bits -#define AT91C_US_CHRL_7_BITS (0x2 << 6) // (USART) Character Length: 7 bits -#define AT91C_US_CHRL_8_BITS (0x3 << 6) // (USART) Character Length: 8 bits -#define AT91C_US_SYNC (0x1 << 8) // (USART) Synchronous Mode Select -#define AT91C_US_NBSTOP (0x3 << 12) // (USART) Number of Stop bits -#define AT91C_US_NBSTOP_1_BIT (0x0 << 12) // (USART) 1 stop bit -#define AT91C_US_NBSTOP_15_BIT (0x1 << 12) // (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits -#define AT91C_US_NBSTOP_2_BIT (0x2 << 12) // (USART) 2 stop bits -#define AT91C_US_MSBF (0x1 << 16) // (USART) Bit Order -#define AT91C_US_MODE9 (0x1 << 17) // (USART) 9-bit Character length -#define AT91C_US_CKLO (0x1 << 18) // (USART) Clock Output Select -#define AT91C_US_OVER (0x1 << 19) // (USART) Over Sampling Mode -#define AT91C_US_INACK (0x1 << 20) // (USART) Inhibit Non Acknowledge -#define AT91C_US_DSNACK (0x1 << 21) // (USART) Disable Successive NACK -#define AT91C_US_MAX_ITER (0x1 << 24) // (USART) Number of Repetitions -#define AT91C_US_FILTER (0x1 << 28) // (USART) Receive Line Filter -// -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- -#define AT91C_US_RXBRK (0x1 << 2) // (USART) Break Received/End of Break -#define AT91C_US_TIMEOUT (0x1 << 8) // (USART) Receiver Time-out -#define AT91C_US_ITERATION (0x1 << 10) // (USART) Max number of Repetitions Reached -#define AT91C_US_NACK (0x1 << 13) // (USART) Non Acknowledge -#define AT91C_US_RIIC (0x1 << 16) // (USART) Ring INdicator Input Change Flag -#define AT91C_US_DSRIC (0x1 << 17) // (USART) Data Set Ready Input Change Flag -#define AT91C_US_DCDIC (0x1 << 18) // (USART) Data Carrier Flag -#define AT91C_US_CTSIC (0x1 << 19) // (USART) Clear To Send Input Change Flag -// -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- -// -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- -// -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- -#define AT91C_US_RI (0x1 << 20) // (USART) Image of RI Input -#define AT91C_US_DSR (0x1 << 21) // (USART) Image of DSR Input -#define AT91C_US_DCD (0x1 << 22) // (USART) Image of DCD Input -#define AT91C_US_CTS (0x1 << 23) // (USART) Image of CTS Input - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_SSC structure *** -#define SSC_CR ( 0) // Control Register -#define SSC_CMR ( 4) // Clock Mode Register -#define SSC_RCMR (16) // Receive Clock ModeRegister -#define SSC_RFMR (20) // Receive Frame Mode Register -#define SSC_TCMR (24) // Transmit Clock Mode Register -#define SSC_TFMR (28) // Transmit Frame Mode Register -#define SSC_RHR (32) // Receive Holding Register -#define SSC_THR (36) // Transmit Holding Register -#define SSC_RSHR (48) // Receive Sync Holding Register -#define SSC_TSHR (52) // Transmit Sync Holding Register -#define SSC_SR (64) // Status Register -#define SSC_IER (68) // Interrupt Enable Register -#define SSC_IDR (72) // Interrupt Disable Register -#define SSC_IMR (76) // Interrupt Mask Register -#define SSC_RPR (256) // Receive Pointer Register -#define SSC_RCR (260) // Receive Counter Register -#define SSC_TPR (264) // Transmit Pointer Register -#define SSC_TCR (268) // Transmit Counter Register -#define SSC_RNPR (272) // Receive Next Pointer Register -#define SSC_RNCR (276) // Receive Next Counter Register -#define SSC_TNPR (280) // Transmit Next Pointer Register -#define SSC_TNCR (284) // Transmit Next Counter Register -#define SSC_PTCR (288) // PDC Transfer Control Register -#define SSC_PTSR (292) // PDC Transfer Status Register -// -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- -#define AT91C_SSC_RXEN (0x1 << 0) // (SSC) Receive Enable -#define AT91C_SSC_RXDIS (0x1 << 1) // (SSC) Receive Disable -#define AT91C_SSC_TXEN (0x1 << 8) // (SSC) Transmit Enable -#define AT91C_SSC_TXDIS (0x1 << 9) // (SSC) Transmit Disable -#define AT91C_SSC_SWRST (0x1 << 15) // (SSC) Software Reset -// -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- -#define AT91C_SSC_CKS (0x3 << 0) // (SSC) Receive/Transmit Clock Selection -#define AT91C_SSC_CKS_DIV (0x0) // (SSC) Divided Clock -#define AT91C_SSC_CKS_TK (0x1) // (SSC) TK Clock signal -#define AT91C_SSC_CKS_RK (0x2) // (SSC) RK pin -#define AT91C_SSC_CKO (0x7 << 2) // (SSC) Receive/Transmit Clock Output Mode Selection -#define AT91C_SSC_CKO_NONE (0x0 << 2) // (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only -#define AT91C_SSC_CKO_CONTINOUS (0x1 << 2) // (SSC) Continuous Receive/Transmit Clock RK pin: Output -#define AT91C_SSC_CKO_DATA_TX (0x2 << 2) // (SSC) Receive/Transmit Clock only during data transfers RK pin: Output -#define AT91C_SSC_CKI (0x1 << 5) // (SSC) Receive/Transmit Clock Inversion -#define AT91C_SSC_CKG (0x3 << 6) // (SSC) Receive/Transmit Clock Gating Selection -#define AT91C_SSC_CKG_NONE (0x0 << 6) // (SSC) Receive/Transmit Clock Gating: None, continuous clock -#define AT91C_SSC_CKG_LOW (0x1 << 6) // (SSC) Receive/Transmit Clock enabled only if RF Low -#define AT91C_SSC_CKG_HIGH (0x2 << 6) // (SSC) Receive/Transmit Clock enabled only if RF High -#define AT91C_SSC_START (0xF << 8) // (SSC) Receive/Transmit Start Selection -#define AT91C_SSC_START_CONTINOUS (0x0 << 8) // (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. -#define AT91C_SSC_START_TX (0x1 << 8) // (SSC) Transmit/Receive start -#define AT91C_SSC_START_LOW_RF (0x2 << 8) // (SSC) Detection of a low level on RF input -#define AT91C_SSC_START_HIGH_RF (0x3 << 8) // (SSC) Detection of a high level on RF input -#define AT91C_SSC_START_FALL_RF (0x4 << 8) // (SSC) Detection of a falling edge on RF input -#define AT91C_SSC_START_RISE_RF (0x5 << 8) // (SSC) Detection of a rising edge on RF input -#define AT91C_SSC_START_LEVEL_RF (0x6 << 8) // (SSC) Detection of any level change on RF input -#define AT91C_SSC_START_EDGE_RF (0x7 << 8) // (SSC) Detection of any edge on RF input -#define AT91C_SSC_START_0 (0x8 << 8) // (SSC) Compare 0 -#define AT91C_SSC_STOP (0x1 << 12) // (SSC) Receive Stop Selection -#define AT91C_SSC_STTDLY (0xFF << 16) // (SSC) Receive/Transmit Start Delay -#define AT91C_SSC_PERIOD (0xFF << 24) // (SSC) Receive/Transmit Period Divider Selection -// -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- -#define AT91C_SSC_DATLEN (0x1F << 0) // (SSC) Data Length -#define AT91C_SSC_LOOP (0x1 << 5) // (SSC) Loop Mode -#define AT91C_SSC_MSBF (0x1 << 7) // (SSC) Most Significant Bit First -#define AT91C_SSC_DATNB (0xF << 8) // (SSC) Data Number per Frame -#define AT91C_SSC_FSLEN (0xF << 16) // (SSC) Receive/Transmit Frame Sync length -#define AT91C_SSC_FSOS (0x7 << 20) // (SSC) Receive/Transmit Frame Sync Output Selection -#define AT91C_SSC_FSOS_NONE (0x0 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only -#define AT91C_SSC_FSOS_NEGATIVE (0x1 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse -#define AT91C_SSC_FSOS_POSITIVE (0x2 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse -#define AT91C_SSC_FSOS_LOW (0x3 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer -#define AT91C_SSC_FSOS_HIGH (0x4 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer -#define AT91C_SSC_FSOS_TOGGLE (0x5 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer -#define AT91C_SSC_FSEDGE (0x1 << 24) // (SSC) Frame Sync Edge Detection -// -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- -// -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- -#define AT91C_SSC_DATDEF (0x1 << 5) // (SSC) Data Default Value -#define AT91C_SSC_FSDEN (0x1 << 23) // (SSC) Frame Sync Data Enable -// -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- -#define AT91C_SSC_TXRDY (0x1 << 0) // (SSC) Transmit Ready -#define AT91C_SSC_TXEMPTY (0x1 << 1) // (SSC) Transmit Empty -#define AT91C_SSC_ENDTX (0x1 << 2) // (SSC) End Of Transmission -#define AT91C_SSC_TXBUFE (0x1 << 3) // (SSC) Transmit Buffer Empty -#define AT91C_SSC_RXRDY (0x1 << 4) // (SSC) Receive Ready -#define AT91C_SSC_OVRUN (0x1 << 5) // (SSC) Receive Overrun -#define AT91C_SSC_ENDRX (0x1 << 6) // (SSC) End of Reception -#define AT91C_SSC_RXBUFF (0x1 << 7) // (SSC) Receive Buffer Full -#define AT91C_SSC_CP0 (0x1 << 8) // (SSC) Compare 0 -#define AT91C_SSC_CP1 (0x1 << 9) // (SSC) Compare 1 -#define AT91C_SSC_TXSYN (0x1 << 10) // (SSC) Transmit Sync -#define AT91C_SSC_RXSYN (0x1 << 11) // (SSC) Receive Sync -#define AT91C_SSC_TXENA (0x1 << 16) // (SSC) Transmit Enable -#define AT91C_SSC_RXENA (0x1 << 17) // (SSC) Receive Enable -// -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- -// -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- -// -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Two-wire Interface -// ***************************************************************************** -// *** Register offset in AT91S_TWI structure *** -#define TWI_CR ( 0) // Control Register -#define TWI_MMR ( 4) // Master Mode Register -#define TWI_IADR (12) // Internal Address Register -#define TWI_CWGR (16) // Clock Waveform Generator Register -#define TWI_SR (32) // Status Register -#define TWI_IER (36) // Interrupt Enable Register -#define TWI_IDR (40) // Interrupt Disable Register -#define TWI_IMR (44) // Interrupt Mask Register -#define TWI_RHR (48) // Receive Holding Register -#define TWI_THR (52) // Transmit Holding Register -// -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- -#define AT91C_TWI_START (0x1 << 0) // (TWI) Send a START Condition -#define AT91C_TWI_STOP (0x1 << 1) // (TWI) Send a STOP Condition -#define AT91C_TWI_MSEN (0x1 << 2) // (TWI) TWI Master Transfer Enabled -#define AT91C_TWI_MSDIS (0x1 << 3) // (TWI) TWI Master Transfer Disabled -#define AT91C_TWI_SWRST (0x1 << 7) // (TWI) Software Reset -// -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- -#define AT91C_TWI_IADRSZ (0x3 << 8) // (TWI) Internal Device Address Size -#define AT91C_TWI_IADRSZ_NO (0x0 << 8) // (TWI) No internal device address -#define AT91C_TWI_IADRSZ_1_BYTE (0x1 << 8) // (TWI) One-byte internal device address -#define AT91C_TWI_IADRSZ_2_BYTE (0x2 << 8) // (TWI) Two-byte internal device address -#define AT91C_TWI_IADRSZ_3_BYTE (0x3 << 8) // (TWI) Three-byte internal device address -#define AT91C_TWI_MREAD (0x1 << 12) // (TWI) Master Read Direction -#define AT91C_TWI_DADR (0x7F << 16) // (TWI) Device Address -// -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- -#define AT91C_TWI_CLDIV (0xFF << 0) // (TWI) Clock Low Divider -#define AT91C_TWI_CHDIV (0xFF << 8) // (TWI) Clock High Divider -#define AT91C_TWI_CKDIV (0x7 << 16) // (TWI) Clock Divider -// -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- -#define AT91C_TWI_TXCOMP (0x1 << 0) // (TWI) Transmission Completed -#define AT91C_TWI_RXRDY (0x1 << 1) // (TWI) Receive holding register ReaDY -#define AT91C_TWI_TXRDY (0x1 << 2) // (TWI) Transmit holding register ReaDY -#define AT91C_TWI_OVRE (0x1 << 6) // (TWI) Overrun Error -#define AT91C_TWI_UNRE (0x1 << 7) // (TWI) Underrun Error -#define AT91C_TWI_NACK (0x1 << 8) // (TWI) Not Acknowledged -// -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- -// -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- -// -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR PWMC Channel Interface -// ***************************************************************************** -// *** Register offset in AT91S_PWMC_CH structure *** -#define PWMC_CMR ( 0) // Channel Mode Register -#define PWMC_CDTYR ( 4) // Channel Duty Cycle Register -#define PWMC_CPRDR ( 8) // Channel Period Register -#define PWMC_CCNTR (12) // Channel Counter Register -#define PWMC_CUPDR (16) // Channel Update Register -#define PWMC_Reserved (20) // Reserved -// -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- -#define AT91C_PWMC_CPRE (0xF << 0) // (PWMC_CH) Channel Pre-scaler : PWMC_CLKx -#define AT91C_PWMC_CPRE_MCK (0x0) // (PWMC_CH) -#define AT91C_PWMC_CPRE_MCKA (0xB) // (PWMC_CH) -#define AT91C_PWMC_CPRE_MCKB (0xC) // (PWMC_CH) -#define AT91C_PWMC_CALG (0x1 << 8) // (PWMC_CH) Channel Alignment -#define AT91C_PWMC_CPOL (0x1 << 9) // (PWMC_CH) Channel Polarity -#define AT91C_PWMC_CPD (0x1 << 10) // (PWMC_CH) Channel Update Period -// -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- -#define AT91C_PWMC_CDTY (0x0 << 0) // (PWMC_CH) Channel Duty Cycle -// -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- -#define AT91C_PWMC_CPRD (0x0 << 0) // (PWMC_CH) Channel Period -// -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- -#define AT91C_PWMC_CCNT (0x0 << 0) // (PWMC_CH) Channel Counter -// -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- -#define AT91C_PWMC_CUPD (0x0 << 0) // (PWMC_CH) Channel Update - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface -// ***************************************************************************** -// *** Register offset in AT91S_PWMC structure *** -#define PWMC_MR ( 0) // PWMC Mode Register -#define PWMC_ENA ( 4) // PWMC Enable Register -#define PWMC_DIS ( 8) // PWMC Disable Register -#define PWMC_SR (12) // PWMC Status Register -#define PWMC_IER (16) // PWMC Interrupt Enable Register -#define PWMC_IDR (20) // PWMC Interrupt Disable Register -#define PWMC_IMR (24) // PWMC Interrupt Mask Register -#define PWMC_ISR (28) // PWMC Interrupt Status Register -#define PWMC_VR (252) // PWMC Version Register -#define PWMC_CH (512) // PWMC Channel -// -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- -#define AT91C_PWMC_DIVA (0xFF << 0) // (PWMC) CLKA divide factor. -#define AT91C_PWMC_PREA (0xF << 8) // (PWMC) Divider Input Clock Prescaler A -#define AT91C_PWMC_PREA_MCK (0x0 << 8) // (PWMC) -#define AT91C_PWMC_DIVB (0xFF << 16) // (PWMC) CLKB divide factor. -#define AT91C_PWMC_PREB (0xF << 24) // (PWMC) Divider Input Clock Prescaler B -#define AT91C_PWMC_PREB_MCK (0x0 << 24) // (PWMC) -// -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- -#define AT91C_PWMC_CHID0 (0x1 << 0) // (PWMC) Channel ID 0 -#define AT91C_PWMC_CHID1 (0x1 << 1) // (PWMC) Channel ID 1 -#define AT91C_PWMC_CHID2 (0x1 << 2) // (PWMC) Channel ID 2 -#define AT91C_PWMC_CHID3 (0x1 << 3) // (PWMC) Channel ID 3 -// -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- -// -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- -// -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- -// -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- -// -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- -// -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR USB Device Interface -// ***************************************************************************** -// *** Register offset in AT91S_UDP structure *** -#define UDP_NUM ( 0) // Frame Number Register -#define UDP_GLBSTATE ( 4) // Global State Register -#define UDP_FADDR ( 8) // Function Address Register -#define UDP_IER (16) // Interrupt Enable Register -#define UDP_IDR (20) // Interrupt Disable Register -#define UDP_IMR (24) // Interrupt Mask Register -#define UDP_ISR (28) // Interrupt Status Register -#define UDP_ICR (32) // Interrupt Clear Register -#define UDP_RSTEP (40) // Reset Endpoint Register -#define UDP_CSR (48) // Endpoint Control and Status Register -#define UDP_FDR (80) // Endpoint FIFO Data Register -#define UDP_TXVC (116) // Transceiver Control Register -// -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- -#define AT91C_UDP_FRM_NUM (0x7FF << 0) // (UDP) Frame Number as Defined in the Packet Field Formats -#define AT91C_UDP_FRM_ERR (0x1 << 16) // (UDP) Frame Error -#define AT91C_UDP_FRM_OK (0x1 << 17) // (UDP) Frame OK -// -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- -#define AT91C_UDP_FADDEN (0x1 << 0) // (UDP) Function Address Enable -#define AT91C_UDP_CONFG (0x1 << 1) // (UDP) Configured -#define AT91C_UDP_ESR (0x1 << 2) // (UDP) Enable Send Resume -#define AT91C_UDP_RSMINPR (0x1 << 3) // (UDP) A Resume Has Been Sent to the Host -#define AT91C_UDP_RMWUPE (0x1 << 4) // (UDP) Remote Wake Up Enable -// -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- -#define AT91C_UDP_FADD (0xFF << 0) // (UDP) Function Address Value -#define AT91C_UDP_FEN (0x1 << 8) // (UDP) Function Enable -// -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- -#define AT91C_UDP_EPINT0 (0x1 << 0) // (UDP) Endpoint 0 Interrupt -#define AT91C_UDP_EPINT1 (0x1 << 1) // (UDP) Endpoint 0 Interrupt -#define AT91C_UDP_EPINT2 (0x1 << 2) // (UDP) Endpoint 2 Interrupt -#define AT91C_UDP_EPINT3 (0x1 << 3) // (UDP) Endpoint 3 Interrupt -#define AT91C_UDP_EPINT4 (0x1 << 4) // (UDP) Endpoint 4 Interrupt -#define AT91C_UDP_EPINT5 (0x1 << 5) // (UDP) Endpoint 5 Interrupt -#define AT91C_UDP_RXSUSP (0x1 << 8) // (UDP) USB Suspend Interrupt -#define AT91C_UDP_RXRSM (0x1 << 9) // (UDP) USB Resume Interrupt -#define AT91C_UDP_EXTRSM (0x1 << 10) // (UDP) USB External Resume Interrupt -#define AT91C_UDP_SOFINT (0x1 << 11) // (UDP) USB Start Of frame Interrupt -#define AT91C_UDP_WAKEUP (0x1 << 13) // (UDP) USB Resume Interrupt -// -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- -// -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- -// -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- -#define AT91C_UDP_ENDBUSRES (0x1 << 12) // (UDP) USB End Of Bus Reset Interrupt -// -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- -// -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- -#define AT91C_UDP_EP0 (0x1 << 0) // (UDP) Reset Endpoint 0 -#define AT91C_UDP_EP1 (0x1 << 1) // (UDP) Reset Endpoint 1 -#define AT91C_UDP_EP2 (0x1 << 2) // (UDP) Reset Endpoint 2 -#define AT91C_UDP_EP3 (0x1 << 3) // (UDP) Reset Endpoint 3 -#define AT91C_UDP_EP4 (0x1 << 4) // (UDP) Reset Endpoint 4 -#define AT91C_UDP_EP5 (0x1 << 5) // (UDP) Reset Endpoint 5 -// -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- -#define AT91C_UDP_TXCOMP (0x1 << 0) // (UDP) Generates an IN packet with data previously written in the DPR -#define AT91C_UDP_RX_DATA_BK0 (0x1 << 1) // (UDP) Receive Data Bank 0 -#define AT91C_UDP_RXSETUP (0x1 << 2) // (UDP) Sends STALL to the Host (Control endpoints) -#define AT91C_UDP_ISOERROR (0x1 << 3) // (UDP) Isochronous error (Isochronous endpoints) -#define AT91C_UDP_TXPKTRDY (0x1 << 4) // (UDP) Transmit Packet Ready -#define AT91C_UDP_FORCESTALL (0x1 << 5) // (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). -#define AT91C_UDP_RX_DATA_BK1 (0x1 << 6) // (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). -#define AT91C_UDP_DIR (0x1 << 7) // (UDP) Transfer Direction -#define AT91C_UDP_EPTYPE (0x7 << 8) // (UDP) Endpoint type -#define AT91C_UDP_EPTYPE_CTRL (0x0 << 8) // (UDP) Control -#define AT91C_UDP_EPTYPE_ISO_OUT (0x1 << 8) // (UDP) Isochronous OUT -#define AT91C_UDP_EPTYPE_BULK_OUT (0x2 << 8) // (UDP) Bulk OUT -#define AT91C_UDP_EPTYPE_INT_OUT (0x3 << 8) // (UDP) Interrupt OUT -#define AT91C_UDP_EPTYPE_ISO_IN (0x5 << 8) // (UDP) Isochronous IN -#define AT91C_UDP_EPTYPE_BULK_IN (0x6 << 8) // (UDP) Bulk IN -#define AT91C_UDP_EPTYPE_INT_IN (0x7 << 8) // (UDP) Interrupt IN -#define AT91C_UDP_DTGLE (0x1 << 11) // (UDP) Data Toggle -#define AT91C_UDP_EPEDS (0x1 << 15) // (UDP) Endpoint Enable Disable -#define AT91C_UDP_RXBYTECNT (0x7FF << 16) // (UDP) Number Of Bytes Available in the FIFO -// -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- -#define AT91C_UDP_TXVDIS (0x1 << 8) // (UDP) -#define AT91C_UDP_PUON (0x1 << 9) // (UDP) Pull-up ON - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Timer Counter Channel Interface -// ***************************************************************************** -// *** Register offset in AT91S_TC structure *** -#define TC_CCR ( 0) // Channel Control Register -#define TC_CMR ( 4) // Channel Mode Register (Capture Mode / Waveform Mode) -#define TC_CV (16) // Counter Value -#define TC_RA (20) // Register A -#define TC_RB (24) // Register B -#define TC_RC (28) // Register C -#define TC_SR (32) // Status Register -#define TC_IER (36) // Interrupt Enable Register -#define TC_IDR (40) // Interrupt Disable Register -#define TC_IMR (44) // Interrupt Mask Register -// -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- -#define AT91C_TC_CLKEN (0x1 << 0) // (TC) Counter Clock Enable Command -#define AT91C_TC_CLKDIS (0x1 << 1) // (TC) Counter Clock Disable Command -#define AT91C_TC_SWTRG (0x1 << 2) // (TC) Software Trigger Command -// -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- -#define AT91C_TC_CLKS (0x7 << 0) // (TC) Clock Selection -#define AT91C_TC_CLKS_TIMER_DIV1_CLOCK (0x0) // (TC) Clock selected: TIMER_DIV1_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV2_CLOCK (0x1) // (TC) Clock selected: TIMER_DIV2_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV3_CLOCK (0x2) // (TC) Clock selected: TIMER_DIV3_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV4_CLOCK (0x3) // (TC) Clock selected: TIMER_DIV4_CLOCK -#define AT91C_TC_CLKS_TIMER_DIV5_CLOCK (0x4) // (TC) Clock selected: TIMER_DIV5_CLOCK -#define AT91C_TC_CLKS_XC0 (0x5) // (TC) Clock selected: XC0 -#define AT91C_TC_CLKS_XC1 (0x6) // (TC) Clock selected: XC1 -#define AT91C_TC_CLKS_XC2 (0x7) // (TC) Clock selected: XC2 -#define AT91C_TC_CLKI (0x1 << 3) // (TC) Clock Invert -#define AT91C_TC_BURST (0x3 << 4) // (TC) Burst Signal Selection -#define AT91C_TC_BURST_NONE (0x0 << 4) // (TC) The clock is not gated by an external signal -#define AT91C_TC_BURST_XC0 (0x1 << 4) // (TC) XC0 is ANDed with the selected clock -#define AT91C_TC_BURST_XC1 (0x2 << 4) // (TC) XC1 is ANDed with the selected clock -#define AT91C_TC_BURST_XC2 (0x3 << 4) // (TC) XC2 is ANDed with the selected clock -#define AT91C_TC_CPCSTOP (0x1 << 6) // (TC) Counter Clock Stopped with RC Compare -#define AT91C_TC_LDBSTOP (0x1 << 6) // (TC) Counter Clock Stopped with RB Loading -#define AT91C_TC_LDBDIS (0x1 << 7) // (TC) Counter Clock Disabled with RB Loading -#define AT91C_TC_CPCDIS (0x1 << 7) // (TC) Counter Clock Disable with RC Compare -#define AT91C_TC_ETRGEDG (0x3 << 8) // (TC) External Trigger Edge Selection -#define AT91C_TC_ETRGEDG_NONE (0x0 << 8) // (TC) Edge: None -#define AT91C_TC_ETRGEDG_RISING (0x1 << 8) // (TC) Edge: rising edge -#define AT91C_TC_ETRGEDG_FALLING (0x2 << 8) // (TC) Edge: falling edge -#define AT91C_TC_ETRGEDG_BOTH (0x3 << 8) // (TC) Edge: each edge -#define AT91C_TC_EEVTEDG (0x3 << 8) // (TC) External Event Edge Selection -#define AT91C_TC_EEVTEDG_NONE (0x0 << 8) // (TC) Edge: None -#define AT91C_TC_EEVTEDG_RISING (0x1 << 8) // (TC) Edge: rising edge -#define AT91C_TC_EEVTEDG_FALLING (0x2 << 8) // (TC) Edge: falling edge -#define AT91C_TC_EEVTEDG_BOTH (0x3 << 8) // (TC) Edge: each edge -#define AT91C_TC_ABETRG (0x1 << 10) // (TC) TIOA or TIOB External Trigger Selection -#define AT91C_TC_EEVT (0x3 << 10) // (TC) External Event Selection -#define AT91C_TC_EEVT_TIOB (0x0 << 10) // (TC) Signal selected as external event: TIOB TIOB direction: input -#define AT91C_TC_EEVT_XC0 (0x1 << 10) // (TC) Signal selected as external event: XC0 TIOB direction: output -#define AT91C_TC_EEVT_XC1 (0x2 << 10) // (TC) Signal selected as external event: XC1 TIOB direction: output -#define AT91C_TC_EEVT_XC2 (0x3 << 10) // (TC) Signal selected as external event: XC2 TIOB direction: output -#define AT91C_TC_ENETRG (0x1 << 12) // (TC) External Event Trigger enable -#define AT91C_TC_WAVESEL (0x3 << 13) // (TC) Waveform Selection -#define AT91C_TC_WAVESEL_UP (0x0 << 13) // (TC) UP mode without atomatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UPDOWN (0x1 << 13) // (TC) UPDOWN mode without automatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UP_AUTO (0x2 << 13) // (TC) UP mode with automatic trigger on RC Compare -#define AT91C_TC_WAVESEL_UPDOWN_AUTO (0x3 << 13) // (TC) UPDOWN mode with automatic trigger on RC Compare -#define AT91C_TC_CPCTRG (0x1 << 14) // (TC) RC Compare Trigger Enable -#define AT91C_TC_WAVE (0x1 << 15) // (TC) -#define AT91C_TC_LDRA (0x3 << 16) // (TC) RA Loading Selection -#define AT91C_TC_LDRA_NONE (0x0 << 16) // (TC) Edge: None -#define AT91C_TC_LDRA_RISING (0x1 << 16) // (TC) Edge: rising edge of TIOA -#define AT91C_TC_LDRA_FALLING (0x2 << 16) // (TC) Edge: falling edge of TIOA -#define AT91C_TC_LDRA_BOTH (0x3 << 16) // (TC) Edge: each edge of TIOA -#define AT91C_TC_ACPA (0x3 << 16) // (TC) RA Compare Effect on TIOA -#define AT91C_TC_ACPA_NONE (0x0 << 16) // (TC) Effect: none -#define AT91C_TC_ACPA_SET (0x1 << 16) // (TC) Effect: set -#define AT91C_TC_ACPA_CLEAR (0x2 << 16) // (TC) Effect: clear -#define AT91C_TC_ACPA_TOGGLE (0x3 << 16) // (TC) Effect: toggle -#define AT91C_TC_LDRB (0x3 << 18) // (TC) RB Loading Selection -#define AT91C_TC_LDRB_NONE (0x0 << 18) // (TC) Edge: None -#define AT91C_TC_LDRB_RISING (0x1 << 18) // (TC) Edge: rising edge of TIOA -#define AT91C_TC_LDRB_FALLING (0x2 << 18) // (TC) Edge: falling edge of TIOA -#define AT91C_TC_LDRB_BOTH (0x3 << 18) // (TC) Edge: each edge of TIOA -#define AT91C_TC_ACPC (0x3 << 18) // (TC) RC Compare Effect on TIOA -#define AT91C_TC_ACPC_NONE (0x0 << 18) // (TC) Effect: none -#define AT91C_TC_ACPC_SET (0x1 << 18) // (TC) Effect: set -#define AT91C_TC_ACPC_CLEAR (0x2 << 18) // (TC) Effect: clear -#define AT91C_TC_ACPC_TOGGLE (0x3 << 18) // (TC) Effect: toggle -#define AT91C_TC_AEEVT (0x3 << 20) // (TC) External Event Effect on TIOA -#define AT91C_TC_AEEVT_NONE (0x0 << 20) // (TC) Effect: none -#define AT91C_TC_AEEVT_SET (0x1 << 20) // (TC) Effect: set -#define AT91C_TC_AEEVT_CLEAR (0x2 << 20) // (TC) Effect: clear -#define AT91C_TC_AEEVT_TOGGLE (0x3 << 20) // (TC) Effect: toggle -#define AT91C_TC_ASWTRG (0x3 << 22) // (TC) Software Trigger Effect on TIOA -#define AT91C_TC_ASWTRG_NONE (0x0 << 22) // (TC) Effect: none -#define AT91C_TC_ASWTRG_SET (0x1 << 22) // (TC) Effect: set -#define AT91C_TC_ASWTRG_CLEAR (0x2 << 22) // (TC) Effect: clear -#define AT91C_TC_ASWTRG_TOGGLE (0x3 << 22) // (TC) Effect: toggle -#define AT91C_TC_BCPB (0x3 << 24) // (TC) RB Compare Effect on TIOB -#define AT91C_TC_BCPB_NONE (0x0 << 24) // (TC) Effect: none -#define AT91C_TC_BCPB_SET (0x1 << 24) // (TC) Effect: set -#define AT91C_TC_BCPB_CLEAR (0x2 << 24) // (TC) Effect: clear -#define AT91C_TC_BCPB_TOGGLE (0x3 << 24) // (TC) Effect: toggle -#define AT91C_TC_BCPC (0x3 << 26) // (TC) RC Compare Effect on TIOB -#define AT91C_TC_BCPC_NONE (0x0 << 26) // (TC) Effect: none -#define AT91C_TC_BCPC_SET (0x1 << 26) // (TC) Effect: set -#define AT91C_TC_BCPC_CLEAR (0x2 << 26) // (TC) Effect: clear -#define AT91C_TC_BCPC_TOGGLE (0x3 << 26) // (TC) Effect: toggle -#define AT91C_TC_BEEVT (0x3 << 28) // (TC) External Event Effect on TIOB -#define AT91C_TC_BEEVT_NONE (0x0 << 28) // (TC) Effect: none -#define AT91C_TC_BEEVT_SET (0x1 << 28) // (TC) Effect: set -#define AT91C_TC_BEEVT_CLEAR (0x2 << 28) // (TC) Effect: clear -#define AT91C_TC_BEEVT_TOGGLE (0x3 << 28) // (TC) Effect: toggle -#define AT91C_TC_BSWTRG (0x3 << 30) // (TC) Software Trigger Effect on TIOB -#define AT91C_TC_BSWTRG_NONE (0x0 << 30) // (TC) Effect: none -#define AT91C_TC_BSWTRG_SET (0x1 << 30) // (TC) Effect: set -#define AT91C_TC_BSWTRG_CLEAR (0x2 << 30) // (TC) Effect: clear -#define AT91C_TC_BSWTRG_TOGGLE (0x3 << 30) // (TC) Effect: toggle -// -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- -#define AT91C_TC_COVFS (0x1 << 0) // (TC) Counter Overflow -#define AT91C_TC_LOVRS (0x1 << 1) // (TC) Load Overrun -#define AT91C_TC_CPAS (0x1 << 2) // (TC) RA Compare -#define AT91C_TC_CPBS (0x1 << 3) // (TC) RB Compare -#define AT91C_TC_CPCS (0x1 << 4) // (TC) RC Compare -#define AT91C_TC_LDRAS (0x1 << 5) // (TC) RA Loading -#define AT91C_TC_LDRBS (0x1 << 6) // (TC) RB Loading -#define AT91C_TC_ETRGS (0x1 << 7) // (TC) External Trigger -#define AT91C_TC_CLKSTA (0x1 << 16) // (TC) Clock Enabling -#define AT91C_TC_MTIOA (0x1 << 17) // (TC) TIOA Mirror -#define AT91C_TC_MTIOB (0x1 << 18) // (TC) TIOA Mirror -// -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- -// -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- -// -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Timer Counter Interface -// ***************************************************************************** -// *** Register offset in AT91S_TCB structure *** -#define TCB_TC0 ( 0) // TC Channel 0 -#define TCB_TC1 (64) // TC Channel 1 -#define TCB_TC2 (128) // TC Channel 2 -#define TCB_BCR (192) // TC Block Control Register -#define TCB_BMR (196) // TC Block Mode Register -// -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- -#define AT91C_TCB_SYNC (0x1 << 0) // (TCB) Synchro Command -// -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- -#define AT91C_TCB_TC0XC0S (0x3 << 0) // (TCB) External Clock Signal 0 Selection -#define AT91C_TCB_TC0XC0S_TCLK0 (0x0) // (TCB) TCLK0 connected to XC0 -#define AT91C_TCB_TC0XC0S_NONE (0x1) // (TCB) None signal connected to XC0 -#define AT91C_TCB_TC0XC0S_TIOA1 (0x2) // (TCB) TIOA1 connected to XC0 -#define AT91C_TCB_TC0XC0S_TIOA2 (0x3) // (TCB) TIOA2 connected to XC0 -#define AT91C_TCB_TC1XC1S (0x3 << 2) // (TCB) External Clock Signal 1 Selection -#define AT91C_TCB_TC1XC1S_TCLK1 (0x0 << 2) // (TCB) TCLK1 connected to XC1 -#define AT91C_TCB_TC1XC1S_NONE (0x1 << 2) // (TCB) None signal connected to XC1 -#define AT91C_TCB_TC1XC1S_TIOA0 (0x2 << 2) // (TCB) TIOA0 connected to XC1 -#define AT91C_TCB_TC1XC1S_TIOA2 (0x3 << 2) // (TCB) TIOA2 connected to XC1 -#define AT91C_TCB_TC2XC2S (0x3 << 4) // (TCB) External Clock Signal 2 Selection -#define AT91C_TCB_TC2XC2S_TCLK2 (0x0 << 4) // (TCB) TCLK2 connected to XC2 -#define AT91C_TCB_TC2XC2S_NONE (0x1 << 4) // (TCB) None signal connected to XC2 -#define AT91C_TCB_TC2XC2S_TIOA0 (0x2 << 4) // (TCB) TIOA0 connected to XC2 -#define AT91C_TCB_TC2XC2S_TIOA1 (0x3 << 4) // (TCB) TIOA2 connected to XC2 - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface -// ***************************************************************************** -// *** Register offset in AT91S_CAN_MB structure *** -#define CAN_MB_MMR ( 0) // MailBox Mode Register -#define CAN_MB_MAM ( 4) // MailBox Acceptance Mask Register -#define CAN_MB_MID ( 8) // MailBox ID Register -#define CAN_MB_MFID (12) // MailBox Family ID Register -#define CAN_MB_MSR (16) // MailBox Status Register -#define CAN_MB_MDL (20) // MailBox Data Low Register -#define CAN_MB_MDH (24) // MailBox Data High Register -#define CAN_MB_MCR (28) // MailBox Control Register -// -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- -#define AT91C_CAN_MTIMEMARK (0xFFFF << 0) // (CAN_MB) Mailbox Timemark -#define AT91C_CAN_PRIOR (0xF << 16) // (CAN_MB) Mailbox Priority -#define AT91C_CAN_MOT (0x7 << 24) // (CAN_MB) Mailbox Object Type -#define AT91C_CAN_MOT_DIS (0x0 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_RX (0x1 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_RXOVERWRITE (0x2 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_TX (0x3 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_CONSUMER (0x4 << 24) // (CAN_MB) -#define AT91C_CAN_MOT_PRODUCER (0x5 << 24) // (CAN_MB) -// -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- -#define AT91C_CAN_MIDvB (0x3FFFF << 0) // (CAN_MB) Complementary bits for identifier in extended mode -#define AT91C_CAN_MIDvA (0x7FF << 18) // (CAN_MB) Identifier for standard frame mode -#define AT91C_CAN_MIDE (0x1 << 29) // (CAN_MB) Identifier Version -// -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- -// -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- -// -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- -#define AT91C_CAN_MTIMESTAMP (0xFFFF << 0) // (CAN_MB) Timer Value -#define AT91C_CAN_MDLC (0xF << 16) // (CAN_MB) Mailbox Data Length Code -#define AT91C_CAN_MRTR (0x1 << 20) // (CAN_MB) Mailbox Remote Transmission Request -#define AT91C_CAN_MABT (0x1 << 22) // (CAN_MB) Mailbox Message Abort -#define AT91C_CAN_MRDY (0x1 << 23) // (CAN_MB) Mailbox Ready -#define AT91C_CAN_MMI (0x1 << 24) // (CAN_MB) Mailbox Message Ignored -// -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- -// -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- -// -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- -#define AT91C_CAN_MACR (0x1 << 22) // (CAN_MB) Abort Request for Mailbox -#define AT91C_CAN_MTCR (0x1 << 23) // (CAN_MB) Mailbox Transfer Command - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Control Area Network Interface -// ***************************************************************************** -// *** Register offset in AT91S_CAN structure *** -#define CAN_MR ( 0) // Mode Register -#define CAN_IER ( 4) // Interrupt Enable Register -#define CAN_IDR ( 8) // Interrupt Disable Register -#define CAN_IMR (12) // Interrupt Mask Register -#define CAN_SR (16) // Status Register -#define CAN_BR (20) // Baudrate Register -#define CAN_TIM (24) // Timer Register -#define CAN_TIMESTP (28) // Time Stamp Register -#define CAN_ECR (32) // Error Counter Register -#define CAN_TCR (36) // Transfer Command Register -#define CAN_ACR (40) // Abort Command Register -#define CAN_VR (252) // Version Register -#define CAN_MB0 (512) // CAN Mailbox 0 -#define CAN_MB1 (544) // CAN Mailbox 1 -#define CAN_MB2 (576) // CAN Mailbox 2 -#define CAN_MB3 (608) // CAN Mailbox 3 -#define CAN_MB4 (640) // CAN Mailbox 4 -#define CAN_MB5 (672) // CAN Mailbox 5 -#define CAN_MB6 (704) // CAN Mailbox 6 -#define CAN_MB7 (736) // CAN Mailbox 7 -#define CAN_MB8 (768) // CAN Mailbox 8 -#define CAN_MB9 (800) // CAN Mailbox 9 -#define CAN_MB10 (832) // CAN Mailbox 10 -#define CAN_MB11 (864) // CAN Mailbox 11 -#define CAN_MB12 (896) // CAN Mailbox 12 -#define CAN_MB13 (928) // CAN Mailbox 13 -#define CAN_MB14 (960) // CAN Mailbox 14 -#define CAN_MB15 (992) // CAN Mailbox 15 -// -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- -#define AT91C_CAN_CANEN (0x1 << 0) // (CAN) CAN Controller Enable -#define AT91C_CAN_LPM (0x1 << 1) // (CAN) Disable/Enable Low Power Mode -#define AT91C_CAN_ABM (0x1 << 2) // (CAN) Disable/Enable Autobaud/Listen Mode -#define AT91C_CAN_OVL (0x1 << 3) // (CAN) Disable/Enable Overload Frame -#define AT91C_CAN_TEOF (0x1 << 4) // (CAN) Time Stamp messages at each end of Frame -#define AT91C_CAN_TTM (0x1 << 5) // (CAN) Disable/Enable Time Trigger Mode -#define AT91C_CAN_TIMFRZ (0x1 << 6) // (CAN) Enable Timer Freeze -#define AT91C_CAN_DRPT (0x1 << 7) // (CAN) Disable Repeat -// -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- -#define AT91C_CAN_MB0 (0x1 << 0) // (CAN) Mailbox 0 Flag -#define AT91C_CAN_MB1 (0x1 << 1) // (CAN) Mailbox 1 Flag -#define AT91C_CAN_MB2 (0x1 << 2) // (CAN) Mailbox 2 Flag -#define AT91C_CAN_MB3 (0x1 << 3) // (CAN) Mailbox 3 Flag -#define AT91C_CAN_MB4 (0x1 << 4) // (CAN) Mailbox 4 Flag -#define AT91C_CAN_MB5 (0x1 << 5) // (CAN) Mailbox 5 Flag -#define AT91C_CAN_MB6 (0x1 << 6) // (CAN) Mailbox 6 Flag -#define AT91C_CAN_MB7 (0x1 << 7) // (CAN) Mailbox 7 Flag -#define AT91C_CAN_MB8 (0x1 << 8) // (CAN) Mailbox 8 Flag -#define AT91C_CAN_MB9 (0x1 << 9) // (CAN) Mailbox 9 Flag -#define AT91C_CAN_MB10 (0x1 << 10) // (CAN) Mailbox 10 Flag -#define AT91C_CAN_MB11 (0x1 << 11) // (CAN) Mailbox 11 Flag -#define AT91C_CAN_MB12 (0x1 << 12) // (CAN) Mailbox 12 Flag -#define AT91C_CAN_MB13 (0x1 << 13) // (CAN) Mailbox 13 Flag -#define AT91C_CAN_MB14 (0x1 << 14) // (CAN) Mailbox 14 Flag -#define AT91C_CAN_MB15 (0x1 << 15) // (CAN) Mailbox 15 Flag -#define AT91C_CAN_ERRA (0x1 << 16) // (CAN) Error Active Mode Flag -#define AT91C_CAN_WARN (0x1 << 17) // (CAN) Warning Limit Flag -#define AT91C_CAN_ERRP (0x1 << 18) // (CAN) Error Passive Mode Flag -#define AT91C_CAN_BOFF (0x1 << 19) // (CAN) Bus Off Mode Flag -#define AT91C_CAN_SLEEP (0x1 << 20) // (CAN) Sleep Flag -#define AT91C_CAN_WAKEUP (0x1 << 21) // (CAN) Wakeup Flag -#define AT91C_CAN_TOVF (0x1 << 22) // (CAN) Timer Overflow Flag -#define AT91C_CAN_TSTP (0x1 << 23) // (CAN) Timestamp Flag -#define AT91C_CAN_CERR (0x1 << 24) // (CAN) CRC Error -#define AT91C_CAN_SERR (0x1 << 25) // (CAN) Stuffing Error -#define AT91C_CAN_AERR (0x1 << 26) // (CAN) Acknowledgment Error -#define AT91C_CAN_FERR (0x1 << 27) // (CAN) Form Error -#define AT91C_CAN_BERR (0x1 << 28) // (CAN) Bit Error -// -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- -// -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- -// -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- -#define AT91C_CAN_RBSY (0x1 << 29) // (CAN) Receiver Busy -#define AT91C_CAN_TBSY (0x1 << 30) // (CAN) Transmitter Busy -#define AT91C_CAN_OVLY (0x1 << 31) // (CAN) Overload Busy -// -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- -#define AT91C_CAN_PHASE2 (0x7 << 0) // (CAN) Phase 2 segment -#define AT91C_CAN_PHASE1 (0x7 << 4) // (CAN) Phase 1 segment -#define AT91C_CAN_PROPAG (0x7 << 8) // (CAN) Programmation time segment -#define AT91C_CAN_SYNC (0x3 << 12) // (CAN) Re-synchronization jump width segment -#define AT91C_CAN_BRP (0x7F << 16) // (CAN) Baudrate Prescaler -#define AT91C_CAN_SMP (0x1 << 24) // (CAN) Sampling mode -// -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- -#define AT91C_CAN_TIMER (0xFFFF << 0) // (CAN) Timer field -// -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- -// -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- -#define AT91C_CAN_REC (0xFF << 0) // (CAN) Receive Error Counter -#define AT91C_CAN_TEC (0xFF << 16) // (CAN) Transmit Error Counter -// -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- -#define AT91C_CAN_TIMRST (0x1 << 31) // (CAN) Timer Reset Field -// -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 -// ***************************************************************************** -// *** Register offset in AT91S_EMAC structure *** -#define EMAC_NCR ( 0) // Network Control Register -#define EMAC_NCFGR ( 4) // Network Configuration Register -#define EMAC_NSR ( 8) // Network Status Register -#define EMAC_TSR (20) // Transmit Status Register -#define EMAC_RBQP (24) // Receive Buffer Queue Pointer -#define EMAC_TBQP (28) // Transmit Buffer Queue Pointer -#define EMAC_RSR (32) // Receive Status Register -#define EMAC_ISR (36) // Interrupt Status Register -#define EMAC_IER (40) // Interrupt Enable Register -#define EMAC_IDR (44) // Interrupt Disable Register -#define EMAC_IMR (48) // Interrupt Mask Register -#define EMAC_MAN (52) // PHY Maintenance Register -#define EMAC_PTR (56) // Pause Time Register -#define EMAC_PFR (60) // Pause Frames received Register -#define EMAC_FTO (64) // Frames Transmitted OK Register -#define EMAC_SCF (68) // Single Collision Frame Register -#define EMAC_MCF (72) // Multiple Collision Frame Register -#define EMAC_FRO (76) // Frames Received OK Register -#define EMAC_FCSE (80) // Frame Check Sequence Error Register -#define EMAC_ALE (84) // Alignment Error Register -#define EMAC_DTF (88) // Deferred Transmission Frame Register -#define EMAC_LCOL (92) // Late Collision Register -#define EMAC_ECOL (96) // Excessive Collision Register -#define EMAC_TUND (100) // Transmit Underrun Error Register -#define EMAC_CSE (104) // Carrier Sense Error Register -#define EMAC_RRE (108) // Receive Ressource Error Register -#define EMAC_ROV (112) // Receive Overrun Errors Register -#define EMAC_RSE (116) // Receive Symbol Errors Register -#define EMAC_ELE (120) // Excessive Length Errors Register -#define EMAC_RJA (124) // Receive Jabbers Register -#define EMAC_USF (128) // Undersize Frames Register -#define EMAC_STE (132) // SQE Test Error Register -#define EMAC_RLE (136) // Receive Length Field Mismatch Register -#define EMAC_TPF (140) // Transmitted Pause Frames Register -#define EMAC_HRB (144) // Hash Address Bottom[31:0] -#define EMAC_HRT (148) // Hash Address Top[63:32] -#define EMAC_SA1L (152) // Specific Address 1 Bottom, First 4 bytes -#define EMAC_SA1H (156) // Specific Address 1 Top, Last 2 bytes -#define EMAC_SA2L (160) // Specific Address 2 Bottom, First 4 bytes -#define EMAC_SA2H (164) // Specific Address 2 Top, Last 2 bytes -#define EMAC_SA3L (168) // Specific Address 3 Bottom, First 4 bytes -#define EMAC_SA3H (172) // Specific Address 3 Top, Last 2 bytes -#define EMAC_SA4L (176) // Specific Address 4 Bottom, First 4 bytes -#define EMAC_SA4H (180) // Specific Address 4 Top, Last 2 bytes -#define EMAC_TID (184) // Type ID Checking Register -#define EMAC_TPQ (188) // Transmit Pause Quantum Register -#define EMAC_USRIO (192) // USER Input/Output Register -#define EMAC_WOL (196) // Wake On LAN Register -#define EMAC_REV (252) // Revision Register -// -------- EMAC_NCR : (EMAC Offset: 0x0) -------- -#define AT91C_EMAC_LB (0x1 << 0) // (EMAC) Loopback. Optional. When set, loopback signal is at high level. -#define AT91C_EMAC_LLB (0x1 << 1) // (EMAC) Loopback local. -#define AT91C_EMAC_RE (0x1 << 2) // (EMAC) Receive enable. -#define AT91C_EMAC_TE (0x1 << 3) // (EMAC) Transmit enable. -#define AT91C_EMAC_MPE (0x1 << 4) // (EMAC) Management port enable. -#define AT91C_EMAC_CLRSTAT (0x1 << 5) // (EMAC) Clear statistics registers. -#define AT91C_EMAC_INCSTAT (0x1 << 6) // (EMAC) Increment statistics registers. -#define AT91C_EMAC_WESTAT (0x1 << 7) // (EMAC) Write enable for statistics registers. -#define AT91C_EMAC_BP (0x1 << 8) // (EMAC) Back pressure. -#define AT91C_EMAC_TSTART (0x1 << 9) // (EMAC) Start Transmission. -#define AT91C_EMAC_THALT (0x1 << 10) // (EMAC) Transmission Halt. -#define AT91C_EMAC_TPFR (0x1 << 11) // (EMAC) Transmit pause frame -#define AT91C_EMAC_TZQ (0x1 << 12) // (EMAC) Transmit zero quantum pause frame -// -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- -#define AT91C_EMAC_SPD (0x1 << 0) // (EMAC) Speed. -#define AT91C_EMAC_FD (0x1 << 1) // (EMAC) Full duplex. -#define AT91C_EMAC_JFRAME (0x1 << 3) // (EMAC) Jumbo Frames. -#define AT91C_EMAC_CAF (0x1 << 4) // (EMAC) Copy all frames. -#define AT91C_EMAC_NBC (0x1 << 5) // (EMAC) No broadcast. -#define AT91C_EMAC_MTI (0x1 << 6) // (EMAC) Multicast hash event enable -#define AT91C_EMAC_UNI (0x1 << 7) // (EMAC) Unicast hash enable. -#define AT91C_EMAC_BIG (0x1 << 8) // (EMAC) Receive 1522 bytes. -#define AT91C_EMAC_EAE (0x1 << 9) // (EMAC) External address match enable. -#define AT91C_EMAC_CLK (0x3 << 10) // (EMAC) -#define AT91C_EMAC_CLK_HCLK_8 (0x0 << 10) // (EMAC) HCLK divided by 8 -#define AT91C_EMAC_CLK_HCLK_16 (0x1 << 10) // (EMAC) HCLK divided by 16 -#define AT91C_EMAC_CLK_HCLK_32 (0x2 << 10) // (EMAC) HCLK divided by 32 -#define AT91C_EMAC_CLK_HCLK_64 (0x3 << 10) // (EMAC) HCLK divided by 64 -#define AT91C_EMAC_RTY (0x1 << 12) // (EMAC) -#define AT91C_EMAC_PAE (0x1 << 13) // (EMAC) -#define AT91C_EMAC_RBOF (0x3 << 14) // (EMAC) -#define AT91C_EMAC_RBOF_OFFSET_0 (0x0 << 14) // (EMAC) no offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_1 (0x1 << 14) // (EMAC) one byte offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_2 (0x2 << 14) // (EMAC) two bytes offset from start of receive buffer -#define AT91C_EMAC_RBOF_OFFSET_3 (0x3 << 14) // (EMAC) three bytes offset from start of receive buffer -#define AT91C_EMAC_RLCE (0x1 << 16) // (EMAC) Receive Length field Checking Enable -#define AT91C_EMAC_DRFCS (0x1 << 17) // (EMAC) Discard Receive FCS -#define AT91C_EMAC_EFRHD (0x1 << 18) // (EMAC) -#define AT91C_EMAC_IRXFCS (0x1 << 19) // (EMAC) Ignore RX FCS -// -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- -#define AT91C_EMAC_LINKR (0x1 << 0) // (EMAC) -#define AT91C_EMAC_MDIO (0x1 << 1) // (EMAC) -#define AT91C_EMAC_IDLE (0x1 << 2) // (EMAC) -// -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- -#define AT91C_EMAC_UBR (0x1 << 0) // (EMAC) -#define AT91C_EMAC_COL (0x1 << 1) // (EMAC) -#define AT91C_EMAC_RLES (0x1 << 2) // (EMAC) -#define AT91C_EMAC_TGO (0x1 << 3) // (EMAC) Transmit Go -#define AT91C_EMAC_BEX (0x1 << 4) // (EMAC) Buffers exhausted mid frame -#define AT91C_EMAC_COMP (0x1 << 5) // (EMAC) -#define AT91C_EMAC_UND (0x1 << 6) // (EMAC) -// -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- -#define AT91C_EMAC_BNA (0x1 << 0) // (EMAC) -#define AT91C_EMAC_REC (0x1 << 1) // (EMAC) -#define AT91C_EMAC_OVR (0x1 << 2) // (EMAC) -// -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- -#define AT91C_EMAC_MFD (0x1 << 0) // (EMAC) -#define AT91C_EMAC_RCOMP (0x1 << 1) // (EMAC) -#define AT91C_EMAC_RXUBR (0x1 << 2) // (EMAC) -#define AT91C_EMAC_TXUBR (0x1 << 3) // (EMAC) -#define AT91C_EMAC_TUNDR (0x1 << 4) // (EMAC) -#define AT91C_EMAC_RLEX (0x1 << 5) // (EMAC) -#define AT91C_EMAC_TXERR (0x1 << 6) // (EMAC) -#define AT91C_EMAC_TCOMP (0x1 << 7) // (EMAC) -#define AT91C_EMAC_LINK (0x1 << 9) // (EMAC) -#define AT91C_EMAC_ROVR (0x1 << 10) // (EMAC) -#define AT91C_EMAC_HRESP (0x1 << 11) // (EMAC) -#define AT91C_EMAC_PFRE (0x1 << 12) // (EMAC) -#define AT91C_EMAC_PTZ (0x1 << 13) // (EMAC) -// -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- -// -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- -// -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- -// -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- -#define AT91C_EMAC_DATA (0xFFFF << 0) // (EMAC) -#define AT91C_EMAC_CODE (0x3 << 16) // (EMAC) -#define AT91C_EMAC_REGA (0x1F << 18) // (EMAC) -#define AT91C_EMAC_PHYA (0x1F << 23) // (EMAC) -#define AT91C_EMAC_RW (0x3 << 28) // (EMAC) -#define AT91C_EMAC_SOF (0x3 << 30) // (EMAC) -// -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- -#define AT91C_EMAC_RMII (0x1 << 0) // (EMAC) Reduce MII -#define AT91C_EMAC_CLKEN (0x1 << 1) // (EMAC) Clock Enable -// -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- -#define AT91C_EMAC_IP (0xFFFF << 0) // (EMAC) ARP request IP address -#define AT91C_EMAC_MAG (0x1 << 16) // (EMAC) Magic packet event enable -#define AT91C_EMAC_ARP (0x1 << 17) // (EMAC) ARP request event enable -#define AT91C_EMAC_SA1 (0x1 << 18) // (EMAC) Specific address register 1 event enable -// -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- -#define AT91C_EMAC_REVREF (0xFFFF << 0) // (EMAC) -#define AT91C_EMAC_PARTREF (0xFFFF << 16) // (EMAC) - -// ***************************************************************************** -// SOFTWARE API DEFINITION FOR Analog to Digital Convertor -// ***************************************************************************** -// *** Register offset in AT91S_ADC structure *** -#define ADC_CR ( 0) // ADC Control Register -#define ADC_MR ( 4) // ADC Mode Register -#define ADC_CHER (16) // ADC Channel Enable Register -#define ADC_CHDR (20) // ADC Channel Disable Register -#define ADC_CHSR (24) // ADC Channel Status Register -#define ADC_SR (28) // ADC Status Register -#define ADC_LCDR (32) // ADC Last Converted Data Register -#define ADC_IER (36) // ADC Interrupt Enable Register -#define ADC_IDR (40) // ADC Interrupt Disable Register -#define ADC_IMR (44) // ADC Interrupt Mask Register -#define ADC_CDR0 (48) // ADC Channel Data Register 0 -#define ADC_CDR1 (52) // ADC Channel Data Register 1 -#define ADC_CDR2 (56) // ADC Channel Data Register 2 -#define ADC_CDR3 (60) // ADC Channel Data Register 3 -#define ADC_CDR4 (64) // ADC Channel Data Register 4 -#define ADC_CDR5 (68) // ADC Channel Data Register 5 -#define ADC_CDR6 (72) // ADC Channel Data Register 6 -#define ADC_CDR7 (76) // ADC Channel Data Register 7 -#define ADC_RPR (256) // Receive Pointer Register -#define ADC_RCR (260) // Receive Counter Register -#define ADC_TPR (264) // Transmit Pointer Register -#define ADC_TCR (268) // Transmit Counter Register -#define ADC_RNPR (272) // Receive Next Pointer Register -#define ADC_RNCR (276) // Receive Next Counter Register -#define ADC_TNPR (280) // Transmit Next Pointer Register -#define ADC_TNCR (284) // Transmit Next Counter Register -#define ADC_PTCR (288) // PDC Transfer Control Register -#define ADC_PTSR (292) // PDC Transfer Status Register -// -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- -#define AT91C_ADC_SWRST (0x1 << 0) // (ADC) Software Reset -#define AT91C_ADC_START (0x1 << 1) // (ADC) Start Conversion -// -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- -#define AT91C_ADC_TRGEN (0x1 << 0) // (ADC) Trigger Enable -#define AT91C_ADC_TRGEN_DIS (0x0) // (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software -#define AT91C_ADC_TRGEN_EN (0x1) // (ADC) Hardware trigger selected by TRGSEL field is enabled. -#define AT91C_ADC_TRGSEL (0x7 << 1) // (ADC) Trigger Selection -#define AT91C_ADC_TRGSEL_TIOA0 (0x0 << 1) // (ADC) Selected TRGSEL = TIAO0 -#define AT91C_ADC_TRGSEL_TIOA1 (0x1 << 1) // (ADC) Selected TRGSEL = TIAO1 -#define AT91C_ADC_TRGSEL_TIOA2 (0x2 << 1) // (ADC) Selected TRGSEL = TIAO2 -#define AT91C_ADC_TRGSEL_TIOA3 (0x3 << 1) // (ADC) Selected TRGSEL = TIAO3 -#define AT91C_ADC_TRGSEL_TIOA4 (0x4 << 1) // (ADC) Selected TRGSEL = TIAO4 -#define AT91C_ADC_TRGSEL_TIOA5 (0x5 << 1) // (ADC) Selected TRGSEL = TIAO5 -#define AT91C_ADC_TRGSEL_EXT (0x6 << 1) // (ADC) Selected TRGSEL = External Trigger -#define AT91C_ADC_LOWRES (0x1 << 4) // (ADC) Resolution. -#define AT91C_ADC_LOWRES_10_BIT (0x0 << 4) // (ADC) 10-bit resolution -#define AT91C_ADC_LOWRES_8_BIT (0x1 << 4) // (ADC) 8-bit resolution -#define AT91C_ADC_SLEEP (0x1 << 5) // (ADC) Sleep Mode -#define AT91C_ADC_SLEEP_NORMAL_MODE (0x0 << 5) // (ADC) Normal Mode -#define AT91C_ADC_SLEEP_MODE (0x1 << 5) // (ADC) Sleep Mode -#define AT91C_ADC_PRESCAL (0x3F << 8) // (ADC) Prescaler rate selection -#define AT91C_ADC_STARTUP (0x1F << 16) // (ADC) Startup Time -#define AT91C_ADC_SHTIM (0xF << 24) // (ADC) Sample & Hold Time -// -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- -#define AT91C_ADC_CH0 (0x1 << 0) // (ADC) Channel 0 -#define AT91C_ADC_CH1 (0x1 << 1) // (ADC) Channel 1 -#define AT91C_ADC_CH2 (0x1 << 2) // (ADC) Channel 2 -#define AT91C_ADC_CH3 (0x1 << 3) // (ADC) Channel 3 -#define AT91C_ADC_CH4 (0x1 << 4) // (ADC) Channel 4 -#define AT91C_ADC_CH5 (0x1 << 5) // (ADC) Channel 5 -#define AT91C_ADC_CH6 (0x1 << 6) // (ADC) Channel 6 -#define AT91C_ADC_CH7 (0x1 << 7) // (ADC) Channel 7 -// -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- -// -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- -// -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- -#define AT91C_ADC_EOC0 (0x1 << 0) // (ADC) End of Conversion -#define AT91C_ADC_EOC1 (0x1 << 1) // (ADC) End of Conversion -#define AT91C_ADC_EOC2 (0x1 << 2) // (ADC) End of Conversion -#define AT91C_ADC_EOC3 (0x1 << 3) // (ADC) End of Conversion -#define AT91C_ADC_EOC4 (0x1 << 4) // (ADC) End of Conversion -#define AT91C_ADC_EOC5 (0x1 << 5) // (ADC) End of Conversion -#define AT91C_ADC_EOC6 (0x1 << 6) // (ADC) End of Conversion -#define AT91C_ADC_EOC7 (0x1 << 7) // (ADC) End of Conversion -#define AT91C_ADC_OVRE0 (0x1 << 8) // (ADC) Overrun Error -#define AT91C_ADC_OVRE1 (0x1 << 9) // (ADC) Overrun Error -#define AT91C_ADC_OVRE2 (0x1 << 10) // (ADC) Overrun Error -#define AT91C_ADC_OVRE3 (0x1 << 11) // (ADC) Overrun Error -#define AT91C_ADC_OVRE4 (0x1 << 12) // (ADC) Overrun Error -#define AT91C_ADC_OVRE5 (0x1 << 13) // (ADC) Overrun Error -#define AT91C_ADC_OVRE6 (0x1 << 14) // (ADC) Overrun Error -#define AT91C_ADC_OVRE7 (0x1 << 15) // (ADC) Overrun Error -#define AT91C_ADC_DRDY (0x1 << 16) // (ADC) Data Ready -#define AT91C_ADC_GOVRE (0x1 << 17) // (ADC) General Overrun -#define AT91C_ADC_ENDRX (0x1 << 18) // (ADC) End of Receiver Transfer -#define AT91C_ADC_RXBUFF (0x1 << 19) // (ADC) RXBUFF Interrupt -// -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- -#define AT91C_ADC_LDATA (0x3FF << 0) // (ADC) Last Data Converted -// -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- -// -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- -// -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- -// -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- -#define AT91C_ADC_DATA (0x3FF << 0) // (ADC) Converted Data -// -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- -// -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- -// -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- -// -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- -// -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- -// -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- -// -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- - -// ***************************************************************************** -// REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 -// ***************************************************************************** -// ========== Register definition for SYS peripheral ========== -// ========== Register definition for AIC peripheral ========== -#define AT91C_AIC_ICCR (0xFFFFF128) // (AIC) Interrupt Clear Command Register -#define AT91C_AIC_IECR (0xFFFFF120) // (AIC) Interrupt Enable Command Register -#define AT91C_AIC_SMR (0xFFFFF000) // (AIC) Source Mode Register -#define AT91C_AIC_ISCR (0xFFFFF12C) // (AIC) Interrupt Set Command Register -#define AT91C_AIC_EOICR (0xFFFFF130) // (AIC) End of Interrupt Command Register -#define AT91C_AIC_DCR (0xFFFFF138) // (AIC) Debug Control Register (Protect) -#define AT91C_AIC_FFER (0xFFFFF140) // (AIC) Fast Forcing Enable Register -#define AT91C_AIC_SVR (0xFFFFF080) // (AIC) Source Vector Register -#define AT91C_AIC_SPU (0xFFFFF134) // (AIC) Spurious Vector Register -#define AT91C_AIC_FFDR (0xFFFFF144) // (AIC) Fast Forcing Disable Register -#define AT91C_AIC_FVR (0xFFFFF104) // (AIC) FIQ Vector Register -#define AT91C_AIC_FFSR (0xFFFFF148) // (AIC) Fast Forcing Status Register -#define AT91C_AIC_IMR (0xFFFFF110) // (AIC) Interrupt Mask Register -#define AT91C_AIC_ISR (0xFFFFF108) // (AIC) Interrupt Status Register -#define AT91C_AIC_IVR (0xFFFFF100) // (AIC) IRQ Vector Register -#define AT91C_AIC_IDCR (0xFFFFF124) // (AIC) Interrupt Disable Command Register -#define AT91C_AIC_CISR (0xFFFFF114) // (AIC) Core Interrupt Status Register -#define AT91C_AIC_IPR (0xFFFFF10C) // (AIC) Interrupt Pending Register -// ========== Register definition for PDC_DBGU peripheral ========== -#define AT91C_DBGU_TNCR (0xFFFFF31C) // (PDC_DBGU) Transmit Next Counter Register -#define AT91C_DBGU_RNCR (0xFFFFF314) // (PDC_DBGU) Receive Next Counter Register -#define AT91C_DBGU_PTCR (0xFFFFF320) // (PDC_DBGU) PDC Transfer Control Register -#define AT91C_DBGU_PTSR (0xFFFFF324) // (PDC_DBGU) PDC Transfer Status Register -#define AT91C_DBGU_RCR (0xFFFFF304) // (PDC_DBGU) Receive Counter Register -#define AT91C_DBGU_TCR (0xFFFFF30C) // (PDC_DBGU) Transmit Counter Register -#define AT91C_DBGU_RPR (0xFFFFF300) // (PDC_DBGU) Receive Pointer Register -#define AT91C_DBGU_TPR (0xFFFFF308) // (PDC_DBGU) Transmit Pointer Register -#define AT91C_DBGU_RNPR (0xFFFFF310) // (PDC_DBGU) Receive Next Pointer Register -#define AT91C_DBGU_TNPR (0xFFFFF318) // (PDC_DBGU) Transmit Next Pointer Register -// ========== Register definition for DBGU peripheral ========== -#define AT91C_DBGU_EXID (0xFFFFF244) // (DBGU) Chip ID Extension Register -#define AT91C_DBGU_THR (0xFFFFF21C) // (DBGU) Transmitter Holding Register -#define AT91C_DBGU_CSR (0xFFFFF214) // (DBGU) Channel Status Register -#define AT91C_DBGU_IDR (0xFFFFF20C) // (DBGU) Interrupt Disable Register -#define AT91C_DBGU_MR (0xFFFFF204) // (DBGU) Mode Register -#define AT91C_DBGU_FNTR (0xFFFFF248) // (DBGU) Force NTRST Register -#define AT91C_DBGU_CIDR (0xFFFFF240) // (DBGU) Chip ID Register -#define AT91C_DBGU_BRGR (0xFFFFF220) // (DBGU) Baud Rate Generator Register -#define AT91C_DBGU_RHR (0xFFFFF218) // (DBGU) Receiver Holding Register -#define AT91C_DBGU_IMR (0xFFFFF210) // (DBGU) Interrupt Mask Register -#define AT91C_DBGU_IER (0xFFFFF208) // (DBGU) Interrupt Enable Register -#define AT91C_DBGU_CR (0xFFFFF200) // (DBGU) Control Register -// ========== Register definition for PIOA peripheral ========== -#define AT91C_PIOA_IMR (0xFFFFF448) // (PIOA) Interrupt Mask Register -#define AT91C_PIOA_IER (0xFFFFF440) // (PIOA) Interrupt Enable Register -#define AT91C_PIOA_OWDR (0xFFFFF4A4) // (PIOA) Output Write Disable Register -#define AT91C_PIOA_ISR (0xFFFFF44C) // (PIOA) Interrupt Status Register -#define AT91C_PIOA_PPUDR (0xFFFFF460) // (PIOA) Pull-up Disable Register -#define AT91C_PIOA_MDSR (0xFFFFF458) // (PIOA) Multi-driver Status Register -#define AT91C_PIOA_MDER (0xFFFFF450) // (PIOA) Multi-driver Enable Register -#define AT91C_PIOA_PER (0xFFFFF400) // (PIOA) PIO Enable Register -#define AT91C_PIOA_PSR (0xFFFFF408) // (PIOA) PIO Status Register -#define AT91C_PIOA_OER (0xFFFFF410) // (PIOA) Output Enable Register -#define AT91C_PIOA_BSR (0xFFFFF474) // (PIOA) Select B Register -#define AT91C_PIOA_PPUER (0xFFFFF464) // (PIOA) Pull-up Enable Register -#define AT91C_PIOA_MDDR (0xFFFFF454) // (PIOA) Multi-driver Disable Register -#define AT91C_PIOA_PDR (0xFFFFF404) // (PIOA) PIO Disable Register -#define AT91C_PIOA_ODR (0xFFFFF414) // (PIOA) Output Disable Registerr -#define AT91C_PIOA_IFDR (0xFFFFF424) // (PIOA) Input Filter Disable Register -#define AT91C_PIOA_ABSR (0xFFFFF478) // (PIOA) AB Select Status Register -#define AT91C_PIOA_ASR (0xFFFFF470) // (PIOA) Select A Register -#define AT91C_PIOA_PPUSR (0xFFFFF468) // (PIOA) Pull-up Status Register -#define AT91C_PIOA_ODSR (0xFFFFF438) // (PIOA) Output Data Status Register -#define AT91C_PIOA_SODR (0xFFFFF430) // (PIOA) Set Output Data Register -#define AT91C_PIOA_IFSR (0xFFFFF428) // (PIOA) Input Filter Status Register -#define AT91C_PIOA_IFER (0xFFFFF420) // (PIOA) Input Filter Enable Register -#define AT91C_PIOA_OSR (0xFFFFF418) // (PIOA) Output Status Register -#define AT91C_PIOA_IDR (0xFFFFF444) // (PIOA) Interrupt Disable Register -#define AT91C_PIOA_PDSR (0xFFFFF43C) // (PIOA) Pin Data Status Register -#define AT91C_PIOA_CODR (0xFFFFF434) // (PIOA) Clear Output Data Register -#define AT91C_PIOA_OWSR (0xFFFFF4A8) // (PIOA) Output Write Status Register -#define AT91C_PIOA_OWER (0xFFFFF4A0) // (PIOA) Output Write Enable Register -// ========== Register definition for PIOB peripheral ========== -#define AT91C_PIOB_OWSR (0xFFFFF6A8) // (PIOB) Output Write Status Register -#define AT91C_PIOB_PPUSR (0xFFFFF668) // (PIOB) Pull-up Status Register -#define AT91C_PIOB_PPUDR (0xFFFFF660) // (PIOB) Pull-up Disable Register -#define AT91C_PIOB_MDSR (0xFFFFF658) // (PIOB) Multi-driver Status Register -#define AT91C_PIOB_MDER (0xFFFFF650) // (PIOB) Multi-driver Enable Register -#define AT91C_PIOB_IMR (0xFFFFF648) // (PIOB) Interrupt Mask Register -#define AT91C_PIOB_OSR (0xFFFFF618) // (PIOB) Output Status Register -#define AT91C_PIOB_OER (0xFFFFF610) // (PIOB) Output Enable Register -#define AT91C_PIOB_PSR (0xFFFFF608) // (PIOB) PIO Status Register -#define AT91C_PIOB_PER (0xFFFFF600) // (PIOB) PIO Enable Register -#define AT91C_PIOB_BSR (0xFFFFF674) // (PIOB) Select B Register -#define AT91C_PIOB_PPUER (0xFFFFF664) // (PIOB) Pull-up Enable Register -#define AT91C_PIOB_IFDR (0xFFFFF624) // (PIOB) Input Filter Disable Register -#define AT91C_PIOB_ODR (0xFFFFF614) // (PIOB) Output Disable Registerr -#define AT91C_PIOB_ABSR (0xFFFFF678) // (PIOB) AB Select Status Register -#define AT91C_PIOB_ASR (0xFFFFF670) // (PIOB) Select A Register -#define AT91C_PIOB_IFER (0xFFFFF620) // (PIOB) Input Filter Enable Register -#define AT91C_PIOB_IFSR (0xFFFFF628) // (PIOB) Input Filter Status Register -#define AT91C_PIOB_SODR (0xFFFFF630) // (PIOB) Set Output Data Register -#define AT91C_PIOB_ODSR (0xFFFFF638) // (PIOB) Output Data Status Register -#define AT91C_PIOB_CODR (0xFFFFF634) // (PIOB) Clear Output Data Register -#define AT91C_PIOB_PDSR (0xFFFFF63C) // (PIOB) Pin Data Status Register -#define AT91C_PIOB_OWER (0xFFFFF6A0) // (PIOB) Output Write Enable Register -#define AT91C_PIOB_IER (0xFFFFF640) // (PIOB) Interrupt Enable Register -#define AT91C_PIOB_OWDR (0xFFFFF6A4) // (PIOB) Output Write Disable Register -#define AT91C_PIOB_MDDR (0xFFFFF654) // (PIOB) Multi-driver Disable Register -#define AT91C_PIOB_ISR (0xFFFFF64C) // (PIOB) Interrupt Status Register -#define AT91C_PIOB_IDR (0xFFFFF644) // (PIOB) Interrupt Disable Register -#define AT91C_PIOB_PDR (0xFFFFF604) // (PIOB) PIO Disable Register -// ========== Register definition for CKGR peripheral ========== -#define AT91C_CKGR_PLLR (0xFFFFFC2C) // (CKGR) PLL Register -#define AT91C_CKGR_MCFR (0xFFFFFC24) // (CKGR) Main Clock Frequency Register -#define AT91C_CKGR_MOR (0xFFFFFC20) // (CKGR) Main Oscillator Register -// ========== Register definition for PMC peripheral ========== -#define AT91C_PMC_SCSR (0xFFFFFC08) // (PMC) System Clock Status Register -#define AT91C_PMC_SCER (0xFFFFFC00) // (PMC) System Clock Enable Register -#define AT91C_PMC_IMR (0xFFFFFC6C) // (PMC) Interrupt Mask Register -#define AT91C_PMC_IDR (0xFFFFFC64) // (PMC) Interrupt Disable Register -#define AT91C_PMC_PCDR (0xFFFFFC14) // (PMC) Peripheral Clock Disable Register -#define AT91C_PMC_SCDR (0xFFFFFC04) // (PMC) System Clock Disable Register -#define AT91C_PMC_SR (0xFFFFFC68) // (PMC) Status Register -#define AT91C_PMC_IER (0xFFFFFC60) // (PMC) Interrupt Enable Register -#define AT91C_PMC_MCKR (0xFFFFFC30) // (PMC) Master Clock Register -#define AT91C_PMC_MOR (0xFFFFFC20) // (PMC) Main Oscillator Register -#define AT91C_PMC_PCER (0xFFFFFC10) // (PMC) Peripheral Clock Enable Register -#define AT91C_PMC_PCSR (0xFFFFFC18) // (PMC) Peripheral Clock Status Register -#define AT91C_PMC_PLLR (0xFFFFFC2C) // (PMC) PLL Register -#define AT91C_PMC_MCFR (0xFFFFFC24) // (PMC) Main Clock Frequency Register -#define AT91C_PMC_PCKR (0xFFFFFC40) // (PMC) Programmable Clock Register -// ========== Register definition for RSTC peripheral ========== -#define AT91C_RSTC_RSR (0xFFFFFD04) // (RSTC) Reset Status Register -#define AT91C_RSTC_RMR (0xFFFFFD08) // (RSTC) Reset Mode Register -#define AT91C_RSTC_RCR (0xFFFFFD00) // (RSTC) Reset Control Register -// ========== Register definition for RTTC peripheral ========== -#define AT91C_RTTC_RTSR (0xFFFFFD2C) // (RTTC) Real-time Status Register -#define AT91C_RTTC_RTAR (0xFFFFFD24) // (RTTC) Real-time Alarm Register -#define AT91C_RTTC_RTVR (0xFFFFFD28) // (RTTC) Real-time Value Register -#define AT91C_RTTC_RTMR (0xFFFFFD20) // (RTTC) Real-time Mode Register -// ========== Register definition for PITC peripheral ========== -#define AT91C_PITC_PIIR (0xFFFFFD3C) // (PITC) Period Interval Image Register -#define AT91C_PITC_PISR (0xFFFFFD34) // (PITC) Period Interval Status Register -#define AT91C_PITC_PIVR (0xFFFFFD38) // (PITC) Period Interval Value Register -#define AT91C_PITC_PIMR (0xFFFFFD30) // (PITC) Period Interval Mode Register -// ========== Register definition for WDTC peripheral ========== -#define AT91C_WDTC_WDMR (0xFFFFFD44) // (WDTC) Watchdog Mode Register -#define AT91C_WDTC_WDSR (0xFFFFFD48) // (WDTC) Watchdog Status Register -#define AT91C_WDTC_WDCR (0xFFFFFD40) // (WDTC) Watchdog Control Register -// ========== Register definition for VREG peripheral ========== -#define AT91C_VREG_MR (0xFFFFFD60) // (VREG) Voltage Regulator Mode Register -// ========== Register definition for MC peripheral ========== -#define AT91C_MC_FCR (0xFFFFFF64) // (MC) MC Flash Command Register -#define AT91C_MC_ASR (0xFFFFFF04) // (MC) MC Abort Status Register -#define AT91C_MC_FSR (0xFFFFFF68) // (MC) MC Flash Status Register -#define AT91C_MC_FMR (0xFFFFFF60) // (MC) MC Flash Mode Register -#define AT91C_MC_AASR (0xFFFFFF08) // (MC) MC Abort Address Status Register -#define AT91C_MC_RCR (0xFFFFFF00) // (MC) MC Remap Control Register -// ========== Register definition for PDC_SPI1 peripheral ========== -#define AT91C_SPI1_RNPR (0xFFFE4110) // (PDC_SPI1) Receive Next Pointer Register -#define AT91C_SPI1_TPR (0xFFFE4108) // (PDC_SPI1) Transmit Pointer Register -#define AT91C_SPI1_RPR (0xFFFE4100) // (PDC_SPI1) Receive Pointer Register -#define AT91C_SPI1_PTSR (0xFFFE4124) // (PDC_SPI1) PDC Transfer Status Register -#define AT91C_SPI1_RCR (0xFFFE4104) // (PDC_SPI1) Receive Counter Register -#define AT91C_SPI1_TCR (0xFFFE410C) // (PDC_SPI1) Transmit Counter Register -#define AT91C_SPI1_RNCR (0xFFFE4114) // (PDC_SPI1) Receive Next Counter Register -#define AT91C_SPI1_TNCR (0xFFFE411C) // (PDC_SPI1) Transmit Next Counter Register -#define AT91C_SPI1_TNPR (0xFFFE4118) // (PDC_SPI1) Transmit Next Pointer Register -#define AT91C_SPI1_PTCR (0xFFFE4120) // (PDC_SPI1) PDC Transfer Control Register -// ========== Register definition for SPI1 peripheral ========== -#define AT91C_SPI1_CSR (0xFFFE4030) // (SPI1) Chip Select Register -#define AT91C_SPI1_IDR (0xFFFE4018) // (SPI1) Interrupt Disable Register -#define AT91C_SPI1_SR (0xFFFE4010) // (SPI1) Status Register -#define AT91C_SPI1_RDR (0xFFFE4008) // (SPI1) Receive Data Register -#define AT91C_SPI1_CR (0xFFFE4000) // (SPI1) Control Register -#define AT91C_SPI1_IMR (0xFFFE401C) // (SPI1) Interrupt Mask Register -#define AT91C_SPI1_IER (0xFFFE4014) // (SPI1) Interrupt Enable Register -#define AT91C_SPI1_TDR (0xFFFE400C) // (SPI1) Transmit Data Register -#define AT91C_SPI1_MR (0xFFFE4004) // (SPI1) Mode Register -// ========== Register definition for PDC_SPI0 peripheral ========== -#define AT91C_SPI0_PTCR (0xFFFE0120) // (PDC_SPI0) PDC Transfer Control Register -#define AT91C_SPI0_TNPR (0xFFFE0118) // (PDC_SPI0) Transmit Next Pointer Register -#define AT91C_SPI0_RNPR (0xFFFE0110) // (PDC_SPI0) Receive Next Pointer Register -#define AT91C_SPI0_TPR (0xFFFE0108) // (PDC_SPI0) Transmit Pointer Register -#define AT91C_SPI0_RPR (0xFFFE0100) // (PDC_SPI0) Receive Pointer Register -#define AT91C_SPI0_PTSR (0xFFFE0124) // (PDC_SPI0) PDC Transfer Status Register -#define AT91C_SPI0_TNCR (0xFFFE011C) // (PDC_SPI0) Transmit Next Counter Register -#define AT91C_SPI0_RNCR (0xFFFE0114) // (PDC_SPI0) Receive Next Counter Register -#define AT91C_SPI0_TCR (0xFFFE010C) // (PDC_SPI0) Transmit Counter Register -#define AT91C_SPI0_RCR (0xFFFE0104) // (PDC_SPI0) Receive Counter Register -// ========== Register definition for SPI0 peripheral ========== -#define AT91C_SPI0_CSR (0xFFFE0030) // (SPI0) Chip Select Register -#define AT91C_SPI0_IDR (0xFFFE0018) // (SPI0) Interrupt Disable Register -#define AT91C_SPI0_SR (0xFFFE0010) // (SPI0) Status Register -#define AT91C_SPI0_RDR (0xFFFE0008) // (SPI0) Receive Data Register -#define AT91C_SPI0_CR (0xFFFE0000) // (SPI0) Control Register -#define AT91C_SPI0_IMR (0xFFFE001C) // (SPI0) Interrupt Mask Register -#define AT91C_SPI0_IER (0xFFFE0014) // (SPI0) Interrupt Enable Register -#define AT91C_SPI0_TDR (0xFFFE000C) // (SPI0) Transmit Data Register -#define AT91C_SPI0_MR (0xFFFE0004) // (SPI0) Mode Register -// ========== Register definition for PDC_US1 peripheral ========== -#define AT91C_US1_PTSR (0xFFFC4124) // (PDC_US1) PDC Transfer Status Register -#define AT91C_US1_TNCR (0xFFFC411C) // (PDC_US1) Transmit Next Counter Register -#define AT91C_US1_RNCR (0xFFFC4114) // (PDC_US1) Receive Next Counter Register -#define AT91C_US1_TCR (0xFFFC410C) // (PDC_US1) Transmit Counter Register -#define AT91C_US1_RCR (0xFFFC4104) // (PDC_US1) Receive Counter Register -#define AT91C_US1_PTCR (0xFFFC4120) // (PDC_US1) PDC Transfer Control Register -#define AT91C_US1_TNPR (0xFFFC4118) // (PDC_US1) Transmit Next Pointer Register -#define AT91C_US1_RNPR (0xFFFC4110) // (PDC_US1) Receive Next Pointer Register -#define AT91C_US1_TPR (0xFFFC4108) // (PDC_US1) Transmit Pointer Register -#define AT91C_US1_RPR (0xFFFC4100) // (PDC_US1) Receive Pointer Register -// ========== Register definition for US1 peripheral ========== -#define AT91C_US1_RHR (0xFFFC4018) // (US1) Receiver Holding Register -#define AT91C_US1_IMR (0xFFFC4010) // (US1) Interrupt Mask Register -#define AT91C_US1_IER (0xFFFC4008) // (US1) Interrupt Enable Register -#define AT91C_US1_CR (0xFFFC4000) // (US1) Control Register -#define AT91C_US1_RTOR (0xFFFC4024) // (US1) Receiver Time-out Register -#define AT91C_US1_THR (0xFFFC401C) // (US1) Transmitter Holding Register -#define AT91C_US1_CSR (0xFFFC4014) // (US1) Channel Status Register -#define AT91C_US1_IDR (0xFFFC400C) // (US1) Interrupt Disable Register -#define AT91C_US1_FIDI (0xFFFC4040) // (US1) FI_DI_Ratio Register -#define AT91C_US1_BRGR (0xFFFC4020) // (US1) Baud Rate Generator Register -#define AT91C_US1_TTGR (0xFFFC4028) // (US1) Transmitter Time-guard Register -#define AT91C_US1_IF (0xFFFC404C) // (US1) IRDA_FILTER Register -#define AT91C_US1_NER (0xFFFC4044) // (US1) Nb Errors Register -#define AT91C_US1_MR (0xFFFC4004) // (US1) Mode Register -// ========== Register definition for PDC_US0 peripheral ========== -#define AT91C_US0_PTCR (0xFFFC0120) // (PDC_US0) PDC Transfer Control Register -#define AT91C_US0_TNPR (0xFFFC0118) // (PDC_US0) Transmit Next Pointer Register -#define AT91C_US0_RNPR (0xFFFC0110) // (PDC_US0) Receive Next Pointer Register -#define AT91C_US0_TPR (0xFFFC0108) // (PDC_US0) Transmit Pointer Register -#define AT91C_US0_RPR (0xFFFC0100) // (PDC_US0) Receive Pointer Register -#define AT91C_US0_PTSR (0xFFFC0124) // (PDC_US0) PDC Transfer Status Register -#define AT91C_US0_TNCR (0xFFFC011C) // (PDC_US0) Transmit Next Counter Register -#define AT91C_US0_RNCR (0xFFFC0114) // (PDC_US0) Receive Next Counter Register -#define AT91C_US0_TCR (0xFFFC010C) // (PDC_US0) Transmit Counter Register -#define AT91C_US0_RCR (0xFFFC0104) // (PDC_US0) Receive Counter Register -// ========== Register definition for US0 peripheral ========== -#define AT91C_US0_TTGR (0xFFFC0028) // (US0) Transmitter Time-guard Register -#define AT91C_US0_BRGR (0xFFFC0020) // (US0) Baud Rate Generator Register -#define AT91C_US0_RHR (0xFFFC0018) // (US0) Receiver Holding Register -#define AT91C_US0_IMR (0xFFFC0010) // (US0) Interrupt Mask Register -#define AT91C_US0_NER (0xFFFC0044) // (US0) Nb Errors Register -#define AT91C_US0_RTOR (0xFFFC0024) // (US0) Receiver Time-out Register -#define AT91C_US0_FIDI (0xFFFC0040) // (US0) FI_DI_Ratio Register -#define AT91C_US0_CR (0xFFFC0000) // (US0) Control Register -#define AT91C_US0_IER (0xFFFC0008) // (US0) Interrupt Enable Register -#define AT91C_US0_IF (0xFFFC004C) // (US0) IRDA_FILTER Register -#define AT91C_US0_MR (0xFFFC0004) // (US0) Mode Register -#define AT91C_US0_IDR (0xFFFC000C) // (US0) Interrupt Disable Register -#define AT91C_US0_CSR (0xFFFC0014) // (US0) Channel Status Register -#define AT91C_US0_THR (0xFFFC001C) // (US0) Transmitter Holding Register -// ========== Register definition for PDC_SSC peripheral ========== -#define AT91C_SSC_PTCR (0xFFFD4120) // (PDC_SSC) PDC Transfer Control Register -#define AT91C_SSC_TNPR (0xFFFD4118) // (PDC_SSC) Transmit Next Pointer Register -#define AT91C_SSC_RNPR (0xFFFD4110) // (PDC_SSC) Receive Next Pointer Register -#define AT91C_SSC_TPR (0xFFFD4108) // (PDC_SSC) Transmit Pointer Register -#define AT91C_SSC_RPR (0xFFFD4100) // (PDC_SSC) Receive Pointer Register -#define AT91C_SSC_PTSR (0xFFFD4124) // (PDC_SSC) PDC Transfer Status Register -#define AT91C_SSC_TNCR (0xFFFD411C) // (PDC_SSC) Transmit Next Counter Register -#define AT91C_SSC_RNCR (0xFFFD4114) // (PDC_SSC) Receive Next Counter Register -#define AT91C_SSC_TCR (0xFFFD410C) // (PDC_SSC) Transmit Counter Register -#define AT91C_SSC_RCR (0xFFFD4104) // (PDC_SSC) Receive Counter Register -// ========== Register definition for SSC peripheral ========== -#define AT91C_SSC_RFMR (0xFFFD4014) // (SSC) Receive Frame Mode Register -#define AT91C_SSC_CMR (0xFFFD4004) // (SSC) Clock Mode Register -#define AT91C_SSC_IDR (0xFFFD4048) // (SSC) Interrupt Disable Register -#define AT91C_SSC_SR (0xFFFD4040) // (SSC) Status Register -#define AT91C_SSC_RSHR (0xFFFD4030) // (SSC) Receive Sync Holding Register -#define AT91C_SSC_RHR (0xFFFD4020) // (SSC) Receive Holding Register -#define AT91C_SSC_TCMR (0xFFFD4018) // (SSC) Transmit Clock Mode Register -#define AT91C_SSC_RCMR (0xFFFD4010) // (SSC) Receive Clock ModeRegister -#define AT91C_SSC_CR (0xFFFD4000) // (SSC) Control Register -#define AT91C_SSC_IMR (0xFFFD404C) // (SSC) Interrupt Mask Register -#define AT91C_SSC_IER (0xFFFD4044) // (SSC) Interrupt Enable Register -#define AT91C_SSC_TSHR (0xFFFD4034) // (SSC) Transmit Sync Holding Register -#define AT91C_SSC_THR (0xFFFD4024) // (SSC) Transmit Holding Register -#define AT91C_SSC_TFMR (0xFFFD401C) // (SSC) Transmit Frame Mode Register -// ========== Register definition for TWI peripheral ========== -#define AT91C_TWI_RHR (0xFFFB8030) // (TWI) Receive Holding Register -#define AT91C_TWI_IDR (0xFFFB8028) // (TWI) Interrupt Disable Register -#define AT91C_TWI_SR (0xFFFB8020) // (TWI) Status Register -#define AT91C_TWI_CWGR (0xFFFB8010) // (TWI) Clock Waveform Generator Register -#define AT91C_TWI_CR (0xFFFB8000) // (TWI) Control Register -#define AT91C_TWI_THR (0xFFFB8034) // (TWI) Transmit Holding Register -#define AT91C_TWI_IMR (0xFFFB802C) // (TWI) Interrupt Mask Register -#define AT91C_TWI_IER (0xFFFB8024) // (TWI) Interrupt Enable Register -#define AT91C_TWI_IADR (0xFFFB800C) // (TWI) Internal Address Register -#define AT91C_TWI_MMR (0xFFFB8004) // (TWI) Master Mode Register -// ========== Register definition for PWMC_CH3 peripheral ========== -#define AT91C_PWMC_CH3_CUPDR (0xFFFCC270) // (PWMC_CH3) Channel Update Register -#define AT91C_PWMC_CH3_CPRDR (0xFFFCC268) // (PWMC_CH3) Channel Period Register -#define AT91C_PWMC_CH3_CMR (0xFFFCC260) // (PWMC_CH3) Channel Mode Register -#define AT91C_PWMC_CH3_Reserved (0xFFFCC274) // (PWMC_CH3) Reserved -#define AT91C_PWMC_CH3_CCNTR (0xFFFCC26C) // (PWMC_CH3) Channel Counter Register -#define AT91C_PWMC_CH3_CDTYR (0xFFFCC264) // (PWMC_CH3) Channel Duty Cycle Register -// ========== Register definition for PWMC_CH2 peripheral ========== -#define AT91C_PWMC_CH2_CUPDR (0xFFFCC250) // (PWMC_CH2) Channel Update Register -#define AT91C_PWMC_CH2_CPRDR (0xFFFCC248) // (PWMC_CH2) Channel Period Register -#define AT91C_PWMC_CH2_CMR (0xFFFCC240) // (PWMC_CH2) Channel Mode Register -#define AT91C_PWMC_CH2_Reserved (0xFFFCC254) // (PWMC_CH2) Reserved -#define AT91C_PWMC_CH2_CCNTR (0xFFFCC24C) // (PWMC_CH2) Channel Counter Register -#define AT91C_PWMC_CH2_CDTYR (0xFFFCC244) // (PWMC_CH2) Channel Duty Cycle Register -// ========== Register definition for PWMC_CH1 peripheral ========== -#define AT91C_PWMC_CH1_CUPDR (0xFFFCC230) // (PWMC_CH1) Channel Update Register -#define AT91C_PWMC_CH1_CPRDR (0xFFFCC228) // (PWMC_CH1) Channel Period Register -#define AT91C_PWMC_CH1_CMR (0xFFFCC220) // (PWMC_CH1) Channel Mode Register -#define AT91C_PWMC_CH1_Reserved (0xFFFCC234) // (PWMC_CH1) Reserved -#define AT91C_PWMC_CH1_CCNTR (0xFFFCC22C) // (PWMC_CH1) Channel Counter Register -#define AT91C_PWMC_CH1_CDTYR (0xFFFCC224) // (PWMC_CH1) Channel Duty Cycle Register -// ========== Register definition for PWMC_CH0 peripheral ========== -#define AT91C_PWMC_CH0_CUPDR (0xFFFCC210) // (PWMC_CH0) Channel Update Register -#define AT91C_PWMC_CH0_CPRDR (0xFFFCC208) // (PWMC_CH0) Channel Period Register -#define AT91C_PWMC_CH0_CMR (0xFFFCC200) // (PWMC_CH0) Channel Mode Register -#define AT91C_PWMC_CH0_Reserved (0xFFFCC214) // (PWMC_CH0) Reserved -#define AT91C_PWMC_CH0_CCNTR (0xFFFCC20C) // (PWMC_CH0) Channel Counter Register -#define AT91C_PWMC_CH0_CDTYR (0xFFFCC204) // (PWMC_CH0) Channel Duty Cycle Register -// ========== Register definition for PWMC peripheral ========== -#define AT91C_PWMC_VR (0xFFFCC0FC) // (PWMC) PWMC Version Register -#define AT91C_PWMC_ISR (0xFFFCC01C) // (PWMC) PWMC Interrupt Status Register -#define AT91C_PWMC_IDR (0xFFFCC014) // (PWMC) PWMC Interrupt Disable Register -#define AT91C_PWMC_SR (0xFFFCC00C) // (PWMC) PWMC Status Register -#define AT91C_PWMC_ENA (0xFFFCC004) // (PWMC) PWMC Enable Register -#define AT91C_PWMC_IMR (0xFFFCC018) // (PWMC) PWMC Interrupt Mask Register -#define AT91C_PWMC_MR (0xFFFCC000) // (PWMC) PWMC Mode Register -#define AT91C_PWMC_DIS (0xFFFCC008) // (PWMC) PWMC Disable Register -#define AT91C_PWMC_IER (0xFFFCC010) // (PWMC) PWMC Interrupt Enable Register -// ========== Register definition for UDP peripheral ========== -#define AT91C_UDP_TXVC (0xFFFB0074) // (UDP) Transceiver Control Register -#define AT91C_UDP_ISR (0xFFFB001C) // (UDP) Interrupt Status Register -#define AT91C_UDP_IDR (0xFFFB0014) // (UDP) Interrupt Disable Register -#define AT91C_UDP_CSR (0xFFFB0030) // (UDP) Endpoint Control and Status Register -#define AT91C_UDP_RSTEP (0xFFFB0028) // (UDP) Reset Endpoint Register -#define AT91C_UDP_ICR (0xFFFB0020) // (UDP) Interrupt Clear Register -#define AT91C_UDP_GLBSTATE (0xFFFB0004) // (UDP) Global State Register -#define AT91C_UDP_NUM (0xFFFB0000) // (UDP) Frame Number Register -#define AT91C_UDP_FADDR (0xFFFB0008) // (UDP) Function Address Register -#define AT91C_UDP_IER (0xFFFB0010) // (UDP) Interrupt Enable Register -#define AT91C_UDP_IMR (0xFFFB0018) // (UDP) Interrupt Mask Register -#define AT91C_UDP_FDR (0xFFFB0050) // (UDP) Endpoint FIFO Data Register -// ========== Register definition for TC0 peripheral ========== -#define AT91C_TC0_IMR (0xFFFA002C) // (TC0) Interrupt Mask Register -#define AT91C_TC0_IER (0xFFFA0024) // (TC0) Interrupt Enable Register -#define AT91C_TC0_RC (0xFFFA001C) // (TC0) Register C -#define AT91C_TC0_RA (0xFFFA0014) // (TC0) Register A -#define AT91C_TC0_CMR (0xFFFA0004) // (TC0) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC0_IDR (0xFFFA0028) // (TC0) Interrupt Disable Register -#define AT91C_TC0_SR (0xFFFA0020) // (TC0) Status Register -#define AT91C_TC0_RB (0xFFFA0018) // (TC0) Register B -#define AT91C_TC0_CV (0xFFFA0010) // (TC0) Counter Value -#define AT91C_TC0_CCR (0xFFFA0000) // (TC0) Channel Control Register -// ========== Register definition for TC1 peripheral ========== -#define AT91C_TC1_IMR (0xFFFA006C) // (TC1) Interrupt Mask Register -#define AT91C_TC1_IER (0xFFFA0064) // (TC1) Interrupt Enable Register -#define AT91C_TC1_RC (0xFFFA005C) // (TC1) Register C -#define AT91C_TC1_RA (0xFFFA0054) // (TC1) Register A -#define AT91C_TC1_CMR (0xFFFA0044) // (TC1) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC1_IDR (0xFFFA0068) // (TC1) Interrupt Disable Register -#define AT91C_TC1_SR (0xFFFA0060) // (TC1) Status Register -#define AT91C_TC1_RB (0xFFFA0058) // (TC1) Register B -#define AT91C_TC1_CV (0xFFFA0050) // (TC1) Counter Value -#define AT91C_TC1_CCR (0xFFFA0040) // (TC1) Channel Control Register -// ========== Register definition for TC2 peripheral ========== -#define AT91C_TC2_IMR (0xFFFA00AC) // (TC2) Interrupt Mask Register -#define AT91C_TC2_IER (0xFFFA00A4) // (TC2) Interrupt Enable Register -#define AT91C_TC2_RC (0xFFFA009C) // (TC2) Register C -#define AT91C_TC2_RA (0xFFFA0094) // (TC2) Register A -#define AT91C_TC2_CMR (0xFFFA0084) // (TC2) Channel Mode Register (Capture Mode / Waveform Mode) -#define AT91C_TC2_IDR (0xFFFA00A8) // (TC2) Interrupt Disable Register -#define AT91C_TC2_SR (0xFFFA00A0) // (TC2) Status Register -#define AT91C_TC2_RB (0xFFFA0098) // (TC2) Register B -#define AT91C_TC2_CV (0xFFFA0090) // (TC2) Counter Value -#define AT91C_TC2_CCR (0xFFFA0080) // (TC2) Channel Control Register -// ========== Register definition for TCB peripheral ========== -#define AT91C_TCB_BMR (0xFFFA00C4) // (TCB) TC Block Mode Register -#define AT91C_TCB_BCR (0xFFFA00C0) // (TCB) TC Block Control Register -// ========== Register definition for CAN_MB0 peripheral ========== -#define AT91C_CAN_MB0_MCR (0xFFFD021C) // (CAN_MB0) MailBox Control Register -#define AT91C_CAN_MB0_MDL (0xFFFD0214) // (CAN_MB0) MailBox Data Low Register -#define AT91C_CAN_MB0_MFID (0xFFFD020C) // (CAN_MB0) MailBox Family ID Register -#define AT91C_CAN_MB0_MAM (0xFFFD0204) // (CAN_MB0) MailBox Acceptance Mask Register -#define AT91C_CAN_MB0_MDH (0xFFFD0218) // (CAN_MB0) MailBox Data High Register -#define AT91C_CAN_MB0_MSR (0xFFFD0210) // (CAN_MB0) MailBox Status Register -#define AT91C_CAN_MB0_MID (0xFFFD0208) // (CAN_MB0) MailBox ID Register -#define AT91C_CAN_MB0_MMR (0xFFFD0200) // (CAN_MB0) MailBox Mode Register -// ========== Register definition for CAN_MB1 peripheral ========== -#define AT91C_CAN_MB1_MCR (0xFFFD023C) // (CAN_MB1) MailBox Control Register -#define AT91C_CAN_MB1_MDL (0xFFFD0234) // (CAN_MB1) MailBox Data Low Register -#define AT91C_CAN_MB1_MFID (0xFFFD022C) // (CAN_MB1) MailBox Family ID Register -#define AT91C_CAN_MB1_MAM (0xFFFD0224) // (CAN_MB1) MailBox Acceptance Mask Register -#define AT91C_CAN_MB1_MDH (0xFFFD0238) // (CAN_MB1) MailBox Data High Register -#define AT91C_CAN_MB1_MSR (0xFFFD0230) // (CAN_MB1) MailBox Status Register -#define AT91C_CAN_MB1_MID (0xFFFD0228) // (CAN_MB1) MailBox ID Register -#define AT91C_CAN_MB1_MMR (0xFFFD0220) // (CAN_MB1) MailBox Mode Register -// ========== Register definition for CAN_MB2 peripheral ========== -#define AT91C_CAN_MB2_MCR (0xFFFD025C) // (CAN_MB2) MailBox Control Register -#define AT91C_CAN_MB2_MDL (0xFFFD0254) // (CAN_MB2) MailBox Data Low Register -#define AT91C_CAN_MB2_MFID (0xFFFD024C) // (CAN_MB2) MailBox Family ID Register -#define AT91C_CAN_MB2_MAM (0xFFFD0244) // (CAN_MB2) MailBox Acceptance Mask Register -#define AT91C_CAN_MB2_MDH (0xFFFD0258) // (CAN_MB2) MailBox Data High Register -#define AT91C_CAN_MB2_MSR (0xFFFD0250) // (CAN_MB2) MailBox Status Register -#define AT91C_CAN_MB2_MID (0xFFFD0248) // (CAN_MB2) MailBox ID Register -#define AT91C_CAN_MB2_MMR (0xFFFD0240) // (CAN_MB2) MailBox Mode Register -// ========== Register definition for CAN_MB3 peripheral ========== -#define AT91C_CAN_MB3_MCR (0xFFFD027C) // (CAN_MB3) MailBox Control Register -#define AT91C_CAN_MB3_MDL (0xFFFD0274) // (CAN_MB3) MailBox Data Low Register -#define AT91C_CAN_MB3_MFID (0xFFFD026C) // (CAN_MB3) MailBox Family ID Register -#define AT91C_CAN_MB3_MAM (0xFFFD0264) // (CAN_MB3) MailBox Acceptance Mask Register -#define AT91C_CAN_MB3_MDH (0xFFFD0278) // (CAN_MB3) MailBox Data High Register -#define AT91C_CAN_MB3_MSR (0xFFFD0270) // (CAN_MB3) MailBox Status Register -#define AT91C_CAN_MB3_MID (0xFFFD0268) // (CAN_MB3) MailBox ID Register -#define AT91C_CAN_MB3_MMR (0xFFFD0260) // (CAN_MB3) MailBox Mode Register -// ========== Register definition for CAN_MB4 peripheral ========== -#define AT91C_CAN_MB4_MCR (0xFFFD029C) // (CAN_MB4) MailBox Control Register -#define AT91C_CAN_MB4_MDL (0xFFFD0294) // (CAN_MB4) MailBox Data Low Register -#define AT91C_CAN_MB4_MFID (0xFFFD028C) // (CAN_MB4) MailBox Family ID Register -#define AT91C_CAN_MB4_MAM (0xFFFD0284) // (CAN_MB4) MailBox Acceptance Mask Register -#define AT91C_CAN_MB4_MDH (0xFFFD0298) // (CAN_MB4) MailBox Data High Register -#define AT91C_CAN_MB4_MSR (0xFFFD0290) // (CAN_MB4) MailBox Status Register -#define AT91C_CAN_MB4_MID (0xFFFD0288) // (CAN_MB4) MailBox ID Register -#define AT91C_CAN_MB4_MMR (0xFFFD0280) // (CAN_MB4) MailBox Mode Register -// ========== Register definition for CAN_MB5 peripheral ========== -#define AT91C_CAN_MB5_MCR (0xFFFD02BC) // (CAN_MB5) MailBox Control Register -#define AT91C_CAN_MB5_MDL (0xFFFD02B4) // (CAN_MB5) MailBox Data Low Register -#define AT91C_CAN_MB5_MFID (0xFFFD02AC) // (CAN_MB5) MailBox Family ID Register -#define AT91C_CAN_MB5_MAM (0xFFFD02A4) // (CAN_MB5) MailBox Acceptance Mask Register -#define AT91C_CAN_MB5_MDH (0xFFFD02B8) // (CAN_MB5) MailBox Data High Register -#define AT91C_CAN_MB5_MSR (0xFFFD02B0) // (CAN_MB5) MailBox Status Register -#define AT91C_CAN_MB5_MID (0xFFFD02A8) // (CAN_MB5) MailBox ID Register -#define AT91C_CAN_MB5_MMR (0xFFFD02A0) // (CAN_MB5) MailBox Mode Register -// ========== Register definition for CAN_MB6 peripheral ========== -#define AT91C_CAN_MB6_MAM (0xFFFD02C4) // (CAN_MB6) MailBox Acceptance Mask Register -#define AT91C_CAN_MB6_MDH (0xFFFD02D8) // (CAN_MB6) MailBox Data High Register -#define AT91C_CAN_MB6_MSR (0xFFFD02D0) // (CAN_MB6) MailBox Status Register -#define AT91C_CAN_MB6_MID (0xFFFD02C8) // (CAN_MB6) MailBox ID Register -#define AT91C_CAN_MB6_MMR (0xFFFD02C0) // (CAN_MB6) MailBox Mode Register -#define AT91C_CAN_MB6_MCR (0xFFFD02DC) // (CAN_MB6) MailBox Control Register -#define AT91C_CAN_MB6_MDL (0xFFFD02D4) // (CAN_MB6) MailBox Data Low Register -#define AT91C_CAN_MB6_MFID (0xFFFD02CC) // (CAN_MB6) MailBox Family ID Register -// ========== Register definition for CAN_MB7 peripheral ========== -#define AT91C_CAN_MB7_MDH (0xFFFD02F8) // (CAN_MB7) MailBox Data High Register -#define AT91C_CAN_MB7_MSR (0xFFFD02F0) // (CAN_MB7) MailBox Status Register -#define AT91C_CAN_MB7_MID (0xFFFD02E8) // (CAN_MB7) MailBox ID Register -#define AT91C_CAN_MB7_MMR (0xFFFD02E0) // (CAN_MB7) MailBox Mode Register -#define AT91C_CAN_MB7_MCR (0xFFFD02FC) // (CAN_MB7) MailBox Control Register -#define AT91C_CAN_MB7_MDL (0xFFFD02F4) // (CAN_MB7) MailBox Data Low Register -#define AT91C_CAN_MB7_MFID (0xFFFD02EC) // (CAN_MB7) MailBox Family ID Register -#define AT91C_CAN_MB7_MAM (0xFFFD02E4) // (CAN_MB7) MailBox Acceptance Mask Register -// ========== Register definition for CAN peripheral ========== -#define AT91C_CAN_IMR (0xFFFD000C) // (CAN) Interrupt Mask Register -#define AT91C_CAN_IER (0xFFFD0004) // (CAN) Interrupt Enable Register -#define AT91C_CAN_ECR (0xFFFD0020) // (CAN) Error Counter Register -#define AT91C_CAN_TIM (0xFFFD0018) // (CAN) Timer Register -#define AT91C_CAN_SR (0xFFFD0010) // (CAN) Status Register -#define AT91C_CAN_IDR (0xFFFD0008) // (CAN) Interrupt Disable Register -#define AT91C_CAN_MR (0xFFFD0000) // (CAN) Mode Register -#define AT91C_CAN_BR (0xFFFD0014) // (CAN) Baudrate Register -#define AT91C_CAN_TIMESTP (0xFFFD001C) // (CAN) Time Stamp Register -#define AT91C_CAN_TCR (0xFFFD0024) // (CAN) Transfer Command Register -#define AT91C_CAN_ACR (0xFFFD0028) // (CAN) Abort Command Register -#define AT91C_CAN_VR (0xFFFD00FC) // (CAN) Version Register -// ========== Register definition for EMAC peripheral ========== -#define AT91C_EMAC_TID (0xFFFDC0B8) // (EMAC) Type ID Checking Register -#define AT91C_EMAC_SA3L (0xFFFDC0A8) // (EMAC) Specific Address 3 Bottom, First 4 bytes -#define AT91C_EMAC_STE (0xFFFDC084) // (EMAC) SQE Test Error Register -#define AT91C_EMAC_RSE (0xFFFDC074) // (EMAC) Receive Symbol Errors Register -#define AT91C_EMAC_IDR (0xFFFDC02C) // (EMAC) Interrupt Disable Register -#define AT91C_EMAC_TBQP (0xFFFDC01C) // (EMAC) Transmit Buffer Queue Pointer -#define AT91C_EMAC_TPQ (0xFFFDC0BC) // (EMAC) Transmit Pause Quantum Register -#define AT91C_EMAC_SA1L (0xFFFDC098) // (EMAC) Specific Address 1 Bottom, First 4 bytes -#define AT91C_EMAC_RLE (0xFFFDC088) // (EMAC) Receive Length Field Mismatch Register -#define AT91C_EMAC_IMR (0xFFFDC030) // (EMAC) Interrupt Mask Register -#define AT91C_EMAC_SA1H (0xFFFDC09C) // (EMAC) Specific Address 1 Top, Last 2 bytes -#define AT91C_EMAC_PFR (0xFFFDC03C) // (EMAC) Pause Frames received Register -#define AT91C_EMAC_FCSE (0xFFFDC050) // (EMAC) Frame Check Sequence Error Register -#define AT91C_EMAC_FTO (0xFFFDC040) // (EMAC) Frames Transmitted OK Register -#define AT91C_EMAC_TUND (0xFFFDC064) // (EMAC) Transmit Underrun Error Register -#define AT91C_EMAC_ALE (0xFFFDC054) // (EMAC) Alignment Error Register -#define AT91C_EMAC_SCF (0xFFFDC044) // (EMAC) Single Collision Frame Register -#define AT91C_EMAC_SA3H (0xFFFDC0AC) // (EMAC) Specific Address 3 Top, Last 2 bytes -#define AT91C_EMAC_ELE (0xFFFDC078) // (EMAC) Excessive Length Errors Register -#define AT91C_EMAC_CSE (0xFFFDC068) // (EMAC) Carrier Sense Error Register -#define AT91C_EMAC_DTF (0xFFFDC058) // (EMAC) Deferred Transmission Frame Register -#define AT91C_EMAC_RSR (0xFFFDC020) // (EMAC) Receive Status Register -#define AT91C_EMAC_USRIO (0xFFFDC0C0) // (EMAC) USER Input/Output Register -#define AT91C_EMAC_SA4L (0xFFFDC0B0) // (EMAC) Specific Address 4 Bottom, First 4 bytes -#define AT91C_EMAC_RRE (0xFFFDC06C) // (EMAC) Receive Ressource Error Register -#define AT91C_EMAC_RJA (0xFFFDC07C) // (EMAC) Receive Jabbers Register -#define AT91C_EMAC_TPF (0xFFFDC08C) // (EMAC) Transmitted Pause Frames Register -#define AT91C_EMAC_ISR (0xFFFDC024) // (EMAC) Interrupt Status Register -#define AT91C_EMAC_MAN (0xFFFDC034) // (EMAC) PHY Maintenance Register -#define AT91C_EMAC_WOL (0xFFFDC0C4) // (EMAC) Wake On LAN Register -#define AT91C_EMAC_USF (0xFFFDC080) // (EMAC) Undersize Frames Register -#define AT91C_EMAC_HRB (0xFFFDC090) // (EMAC) Hash Address Bottom[31:0] -#define AT91C_EMAC_PTR (0xFFFDC038) // (EMAC) Pause Time Register -#define AT91C_EMAC_HRT (0xFFFDC094) // (EMAC) Hash Address Top[63:32] -#define AT91C_EMAC_REV (0xFFFDC0FC) // (EMAC) Revision Register -#define AT91C_EMAC_MCF (0xFFFDC048) // (EMAC) Multiple Collision Frame Register -#define AT91C_EMAC_SA2L (0xFFFDC0A0) // (EMAC) Specific Address 2 Bottom, First 4 bytes -#define AT91C_EMAC_NCR (0xFFFDC000) // (EMAC) Network Control Register -#define AT91C_EMAC_FRO (0xFFFDC04C) // (EMAC) Frames Received OK Register -#define AT91C_EMAC_LCOL (0xFFFDC05C) // (EMAC) Late Collision Register -#define AT91C_EMAC_SA4H (0xFFFDC0B4) // (EMAC) Specific Address 4 Top, Last 2 bytes -#define AT91C_EMAC_NCFGR (0xFFFDC004) // (EMAC) Network Configuration Register -#define AT91C_EMAC_TSR (0xFFFDC014) // (EMAC) Transmit Status Register -#define AT91C_EMAC_SA2H (0xFFFDC0A4) // (EMAC) Specific Address 2 Top, Last 2 bytes -#define AT91C_EMAC_ECOL (0xFFFDC060) // (EMAC) Excessive Collision Register -#define AT91C_EMAC_ROV (0xFFFDC070) // (EMAC) Receive Overrun Errors Register -#define AT91C_EMAC_NSR (0xFFFDC008) // (EMAC) Network Status Register -#define AT91C_EMAC_RBQP (0xFFFDC018) // (EMAC) Receive Buffer Queue Pointer -#define AT91C_EMAC_IER (0xFFFDC028) // (EMAC) Interrupt Enable Register -// ========== Register definition for PDC_ADC peripheral ========== -#define AT91C_ADC_PTCR (0xFFFD8120) // (PDC_ADC) PDC Transfer Control Register -#define AT91C_ADC_TNPR (0xFFFD8118) // (PDC_ADC) Transmit Next Pointer Register -#define AT91C_ADC_RNPR (0xFFFD8110) // (PDC_ADC) Receive Next Pointer Register -#define AT91C_ADC_TPR (0xFFFD8108) // (PDC_ADC) Transmit Pointer Register -#define AT91C_ADC_RPR (0xFFFD8100) // (PDC_ADC) Receive Pointer Register -#define AT91C_ADC_PTSR (0xFFFD8124) // (PDC_ADC) PDC Transfer Status Register -#define AT91C_ADC_TNCR (0xFFFD811C) // (PDC_ADC) Transmit Next Counter Register -#define AT91C_ADC_RNCR (0xFFFD8114) // (PDC_ADC) Receive Next Counter Register -#define AT91C_ADC_TCR (0xFFFD810C) // (PDC_ADC) Transmit Counter Register -#define AT91C_ADC_RCR (0xFFFD8104) // (PDC_ADC) Receive Counter Register -// ========== Register definition for ADC peripheral ========== -#define AT91C_ADC_IMR (0xFFFD802C) // (ADC) ADC Interrupt Mask Register -#define AT91C_ADC_CDR4 (0xFFFD8040) // (ADC) ADC Channel Data Register 4 -#define AT91C_ADC_CDR2 (0xFFFD8038) // (ADC) ADC Channel Data Register 2 -#define AT91C_ADC_CDR0 (0xFFFD8030) // (ADC) ADC Channel Data Register 0 -#define AT91C_ADC_CDR7 (0xFFFD804C) // (ADC) ADC Channel Data Register 7 -#define AT91C_ADC_CDR1 (0xFFFD8034) // (ADC) ADC Channel Data Register 1 -#define AT91C_ADC_CDR3 (0xFFFD803C) // (ADC) ADC Channel Data Register 3 -#define AT91C_ADC_CDR5 (0xFFFD8044) // (ADC) ADC Channel Data Register 5 -#define AT91C_ADC_MR (0xFFFD8004) // (ADC) ADC Mode Register -#define AT91C_ADC_CDR6 (0xFFFD8048) // (ADC) ADC Channel Data Register 6 -#define AT91C_ADC_CR (0xFFFD8000) // (ADC) ADC Control Register -#define AT91C_ADC_CHER (0xFFFD8010) // (ADC) ADC Channel Enable Register -#define AT91C_ADC_CHSR (0xFFFD8018) // (ADC) ADC Channel Status Register -#define AT91C_ADC_IER (0xFFFD8024) // (ADC) ADC Interrupt Enable Register -#define AT91C_ADC_SR (0xFFFD801C) // (ADC) ADC Status Register -#define AT91C_ADC_CHDR (0xFFFD8014) // (ADC) ADC Channel Disable Register -#define AT91C_ADC_IDR (0xFFFD8028) // (ADC) ADC Interrupt Disable Register -#define AT91C_ADC_LCDR (0xFFFD8020) // (ADC) ADC Last Converted Data Register - -// ***************************************************************************** -// PIO DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_PIO_PA0 (1 << 0) // Pin Controlled by PA0 -#define AT91C_PA0_RXD0 (AT91C_PIO_PA0) // USART 0 Receive Data -#define AT91C_PIO_PA1 (1 << 1) // Pin Controlled by PA1 -#define AT91C_PA1_TXD0 (AT91C_PIO_PA1) // USART 0 Transmit Data -#define AT91C_PIO_PA10 (1 << 10) // Pin Controlled by PA10 -#define AT91C_PA10_TWD (AT91C_PIO_PA10) // TWI Two-wire Serial Data -#define AT91C_PIO_PA11 (1 << 11) // Pin Controlled by PA11 -#define AT91C_PA11_TWCK (AT91C_PIO_PA11) // TWI Two-wire Serial Clock -#define AT91C_PIO_PA12 (1 << 12) // Pin Controlled by PA12 -#define AT91C_PA12_SPI0_NPCS0 (AT91C_PIO_PA12) // SPI 0 Peripheral Chip Select 0 -#define AT91C_PIO_PA13 (1 << 13) // Pin Controlled by PA13 -#define AT91C_PA13_SPI0_NPCS1 (AT91C_PIO_PA13) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PA13_PCK1 (AT91C_PIO_PA13) // PMC Programmable Clock Output 1 -#define AT91C_PIO_PA14 (1 << 14) // Pin Controlled by PA14 -#define AT91C_PA14_SPI0_NPCS2 (AT91C_PIO_PA14) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PA14_IRQ1 (AT91C_PIO_PA14) // External Interrupt 1 -#define AT91C_PIO_PA15 (1 << 15) // Pin Controlled by PA15 -#define AT91C_PA15_SPI0_NPCS3 (AT91C_PIO_PA15) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PA15_TCLK2 (AT91C_PIO_PA15) // Timer Counter 2 external clock input -#define AT91C_PIO_PA16 (1 << 16) // Pin Controlled by PA16 -#define AT91C_PA16_SPI0_MISO (AT91C_PIO_PA16) // SPI 0 Master In Slave -#define AT91C_PIO_PA17 (1 << 17) // Pin Controlled by PA17 -#define AT91C_PA17_SPI0_MOSI (AT91C_PIO_PA17) // SPI 0 Master Out Slave -#define AT91C_PIO_PA18 (1 << 18) // Pin Controlled by PA18 -#define AT91C_PA18_SPI0_SPCK (AT91C_PIO_PA18) // SPI 0 Serial Clock -#define AT91C_PIO_PA19 (1 << 19) // Pin Controlled by PA19 -#define AT91C_PA19_CANRX (AT91C_PIO_PA19) // CAN Receive -#define AT91C_PIO_PA2 (1 << 2) // Pin Controlled by PA2 -#define AT91C_PA2_SCK0 (AT91C_PIO_PA2) // USART 0 Serial Clock -#define AT91C_PA2_SPI1_NPCS1 (AT91C_PIO_PA2) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PA20 (1 << 20) // Pin Controlled by PA20 -#define AT91C_PA20_CANTX (AT91C_PIO_PA20) // CAN Transmit -#define AT91C_PIO_PA21 (1 << 21) // Pin Controlled by PA21 -#define AT91C_PA21_TF (AT91C_PIO_PA21) // SSC Transmit Frame Sync -#define AT91C_PA21_SPI1_NPCS0 (AT91C_PIO_PA21) // SPI 1 Peripheral Chip Select 0 -#define AT91C_PIO_PA22 (1 << 22) // Pin Controlled by PA22 -#define AT91C_PA22_TK (AT91C_PIO_PA22) // SSC Transmit Clock -#define AT91C_PA22_SPI1_SPCK (AT91C_PIO_PA22) // SPI 1 Serial Clock -#define AT91C_PIO_PA23 (1 << 23) // Pin Controlled by PA23 -#define AT91C_PA23_TD (AT91C_PIO_PA23) // SSC Transmit data -#define AT91C_PA23_SPI1_MOSI (AT91C_PIO_PA23) // SPI 1 Master Out Slave -#define AT91C_PIO_PA24 (1 << 24) // Pin Controlled by PA24 -#define AT91C_PA24_RD (AT91C_PIO_PA24) // SSC Receive Data -#define AT91C_PA24_SPI1_MISO (AT91C_PIO_PA24) // SPI 1 Master In Slave -#define AT91C_PIO_PA25 (1 << 25) // Pin Controlled by PA25 -#define AT91C_PA25_RK (AT91C_PIO_PA25) // SSC Receive Clock -#define AT91C_PA25_SPI1_NPCS1 (AT91C_PIO_PA25) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PA26 (1 << 26) // Pin Controlled by PA26 -#define AT91C_PA26_RF (AT91C_PIO_PA26) // SSC Receive Frame Sync -#define AT91C_PA26_SPI1_NPCS2 (AT91C_PIO_PA26) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PA27 (1 << 27) // Pin Controlled by PA27 -#define AT91C_PA27_DRXD (AT91C_PIO_PA27) // DBGU Debug Receive Data -#define AT91C_PA27_PCK3 (AT91C_PIO_PA27) // PMC Programmable Clock Output 3 -#define AT91C_PIO_PA28 (1 << 28) // Pin Controlled by PA28 -#define AT91C_PA28_DTXD (AT91C_PIO_PA28) // DBGU Debug Transmit Data -#define AT91C_PIO_PA29 (1 << 29) // Pin Controlled by PA29 -#define AT91C_PA29_FIQ (AT91C_PIO_PA29) // AIC Fast Interrupt Input -#define AT91C_PA29_SPI1_NPCS3 (AT91C_PIO_PA29) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PA3 (1 << 3) // Pin Controlled by PA3 -#define AT91C_PA3_RTS0 (AT91C_PIO_PA3) // USART 0 Ready To Send -#define AT91C_PA3_SPI1_NPCS2 (AT91C_PIO_PA3) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PA30 (1 << 30) // Pin Controlled by PA30 -#define AT91C_PA30_IRQ0 (AT91C_PIO_PA30) // External Interrupt 0 -#define AT91C_PA30_PCK2 (AT91C_PIO_PA30) // PMC Programmable Clock Output 2 -#define AT91C_PIO_PA4 (1 << 4) // Pin Controlled by PA4 -#define AT91C_PA4_CTS0 (AT91C_PIO_PA4) // USART 0 Clear To Send -#define AT91C_PA4_SPI1_NPCS3 (AT91C_PIO_PA4) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PA5 (1 << 5) // Pin Controlled by PA5 -#define AT91C_PA5_RXD1 (AT91C_PIO_PA5) // USART 1 Receive Data -#define AT91C_PIO_PA6 (1 << 6) // Pin Controlled by PA6 -#define AT91C_PA6_TXD1 (AT91C_PIO_PA6) // USART 1 Transmit Data -#define AT91C_PIO_PA7 (1 << 7) // Pin Controlled by PA7 -#define AT91C_PA7_SCK1 (AT91C_PIO_PA7) // USART 1 Serial Clock -#define AT91C_PA7_SPI0_NPCS1 (AT91C_PIO_PA7) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PIO_PA8 (1 << 8) // Pin Controlled by PA8 -#define AT91C_PA8_RTS1 (AT91C_PIO_PA8) // USART 1 Ready To Send -#define AT91C_PA8_SPI0_NPCS2 (AT91C_PIO_PA8) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PIO_PA9 (1 << 9) // Pin Controlled by PA9 -#define AT91C_PA9_CTS1 (AT91C_PIO_PA9) // USART 1 Clear To Send -#define AT91C_PA9_SPI0_NPCS3 (AT91C_PIO_PA9) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PIO_PB0 (1 << 0) // Pin Controlled by PB0 -#define AT91C_PB0_ETXCK_EREFCK (AT91C_PIO_PB0) // Ethernet MAC Transmit Clock/Reference Clock -#define AT91C_PB0_PCK0 (AT91C_PIO_PB0) // PMC Programmable Clock Output 0 -#define AT91C_PIO_PB1 (1 << 1) // Pin Controlled by PB1 -#define AT91C_PB1_ETXEN (AT91C_PIO_PB1) // Ethernet MAC Transmit Enable -#define AT91C_PIO_PB10 (1 << 10) // Pin Controlled by PB10 -#define AT91C_PB10_ETX2 (AT91C_PIO_PB10) // Ethernet MAC Transmit Data 2 -#define AT91C_PB10_SPI1_NPCS1 (AT91C_PIO_PB10) // SPI 1 Peripheral Chip Select 1 -#define AT91C_PIO_PB11 (1 << 11) // Pin Controlled by PB11 -#define AT91C_PB11_ETX3 (AT91C_PIO_PB11) // Ethernet MAC Transmit Data 3 -#define AT91C_PB11_SPI1_NPCS2 (AT91C_PIO_PB11) // SPI 1 Peripheral Chip Select 2 -#define AT91C_PIO_PB12 (1 << 12) // Pin Controlled by PB12 -#define AT91C_PB12_ETXER (AT91C_PIO_PB12) // Ethernet MAC Transmikt Coding Error -#define AT91C_PB12_TCLK0 (AT91C_PIO_PB12) // Timer Counter 0 external clock input -#define AT91C_PIO_PB13 (1 << 13) // Pin Controlled by PB13 -#define AT91C_PB13_ERX2 (AT91C_PIO_PB13) // Ethernet MAC Receive Data 2 -#define AT91C_PB13_SPI0_NPCS1 (AT91C_PIO_PB13) // SPI 0 Peripheral Chip Select 1 -#define AT91C_PIO_PB14 (1 << 14) // Pin Controlled by PB14 -#define AT91C_PB14_ERX3 (AT91C_PIO_PB14) // Ethernet MAC Receive Data 3 -#define AT91C_PB14_SPI0_NPCS2 (AT91C_PIO_PB14) // SPI 0 Peripheral Chip Select 2 -#define AT91C_PIO_PB15 (1 << 15) // Pin Controlled by PB15 -#define AT91C_PB15_ERXDV_ECRSDV (AT91C_PIO_PB15) // Ethernet MAC Receive Data Valid -#define AT91C_PIO_PB16 (1 << 16) // Pin Controlled by PB16 -#define AT91C_PB16_ECOL (AT91C_PIO_PB16) // Ethernet MAC Collision Detected -#define AT91C_PB16_SPI1_NPCS3 (AT91C_PIO_PB16) // SPI 1 Peripheral Chip Select 3 -#define AT91C_PIO_PB17 (1 << 17) // Pin Controlled by PB17 -#define AT91C_PB17_ERXCK (AT91C_PIO_PB17) // Ethernet MAC Receive Clock -#define AT91C_PB17_SPI0_NPCS3 (AT91C_PIO_PB17) // SPI 0 Peripheral Chip Select 3 -#define AT91C_PIO_PB18 (1 << 18) // Pin Controlled by PB18 -#define AT91C_PB18_EF100 (AT91C_PIO_PB18) // Ethernet MAC Force 100 Mbits/sec -#define AT91C_PB18_ADTRG (AT91C_PIO_PB18) // ADC External Trigger -#define AT91C_PIO_PB19 (1 << 19) // Pin Controlled by PB19 -#define AT91C_PB19_PWM0 (AT91C_PIO_PB19) // PWM Channel 0 -#define AT91C_PB19_TCLK1 (AT91C_PIO_PB19) // Timer Counter 1 external clock input -#define AT91C_PIO_PB2 (1 << 2) // Pin Controlled by PB2 -#define AT91C_PB2_ETX0 (AT91C_PIO_PB2) // Ethernet MAC Transmit Data 0 -#define AT91C_PIO_PB20 (1 << 20) // Pin Controlled by PB20 -#define AT91C_PB20_PWM1 (AT91C_PIO_PB20) // PWM Channel 1 -#define AT91C_PB20_PCK0 (AT91C_PIO_PB20) // PMC Programmable Clock Output 0 -#define AT91C_PIO_PB21 (1 << 21) // Pin Controlled by PB21 -#define AT91C_PB21_PWM2 (AT91C_PIO_PB21) // PWM Channel 2 -#define AT91C_PB21_PCK1 (AT91C_PIO_PB21) // PMC Programmable Clock Output 1 -#define AT91C_PIO_PB22 (1 << 22) // Pin Controlled by PB22 -#define AT91C_PB22_PWM3 (AT91C_PIO_PB22) // PWM Channel 3 -#define AT91C_PB22_PCK2 (AT91C_PIO_PB22) // PMC Programmable Clock Output 2 -#define AT91C_PIO_PB23 (1 << 23) // Pin Controlled by PB23 -#define AT91C_PB23_TIOA0 (AT91C_PIO_PB23) // Timer Counter 0 Multipurpose Timer I/O Pin A -#define AT91C_PB23_DCD1 (AT91C_PIO_PB23) // USART 1 Data Carrier Detect -#define AT91C_PIO_PB24 (1 << 24) // Pin Controlled by PB24 -#define AT91C_PB24_TIOB0 (AT91C_PIO_PB24) // Timer Counter 0 Multipurpose Timer I/O Pin B -#define AT91C_PB24_DSR1 (AT91C_PIO_PB24) // USART 1 Data Set ready -#define AT91C_PIO_PB25 (1 << 25) // Pin Controlled by PB25 -#define AT91C_PB25_TIOA1 (AT91C_PIO_PB25) // Timer Counter 1 Multipurpose Timer I/O Pin A -#define AT91C_PB25_DTR1 (AT91C_PIO_PB25) // USART 1 Data Terminal ready -#define AT91C_PIO_PB26 (1 << 26) // Pin Controlled by PB26 -#define AT91C_PB26_TIOB1 (AT91C_PIO_PB26) // Timer Counter 1 Multipurpose Timer I/O Pin B -#define AT91C_PB26_RI1 (AT91C_PIO_PB26) // USART 1 Ring Indicator -#define AT91C_PIO_PB27 (1 << 27) // Pin Controlled by PB27 -#define AT91C_PB27_TIOA2 (AT91C_PIO_PB27) // Timer Counter 2 Multipurpose Timer I/O Pin A -#define AT91C_PB27_PWM0 (AT91C_PIO_PB27) // PWM Channel 0 -#define AT91C_PIO_PB28 (1 << 28) // Pin Controlled by PB28 -#define AT91C_PB28_TIOB2 (AT91C_PIO_PB28) // Timer Counter 2 Multipurpose Timer I/O Pin B -#define AT91C_PB28_PWM1 (AT91C_PIO_PB28) // PWM Channel 1 -#define AT91C_PIO_PB29 (1 << 29) // Pin Controlled by PB29 -#define AT91C_PB29_PCK1 (AT91C_PIO_PB29) // PMC Programmable Clock Output 1 -#define AT91C_PB29_PWM2 (AT91C_PIO_PB29) // PWM Channel 2 -#define AT91C_PIO_PB3 (1 << 3) // Pin Controlled by PB3 -#define AT91C_PB3_ETX1 (AT91C_PIO_PB3) // Ethernet MAC Transmit Data 1 -#define AT91C_PIO_PB30 (1 << 30) // Pin Controlled by PB30 -#define AT91C_PB30_PCK2 (AT91C_PIO_PB30) // PMC Programmable Clock Output 2 -#define AT91C_PB30_PWM3 (AT91C_PIO_PB30) // PWM Channel 3 -#define AT91C_PIO_PB4 (1 << 4) // Pin Controlled by PB4 -#define AT91C_PB4_ECRS (AT91C_PIO_PB4) // Ethernet MAC Carrier Sense/Carrier Sense and Data Valid -#define AT91C_PIO_PB5 (1 << 5) // Pin Controlled by PB5 -#define AT91C_PB5_ERX0 (AT91C_PIO_PB5) // Ethernet MAC Receive Data 0 -#define AT91C_PIO_PB6 (1 << 6) // Pin Controlled by PB6 -#define AT91C_PB6_ERX1 (AT91C_PIO_PB6) // Ethernet MAC Receive Data 1 -#define AT91C_PIO_PB7 (1 << 7) // Pin Controlled by PB7 -#define AT91C_PB7_ERXER (AT91C_PIO_PB7) // Ethernet MAC Receive Error -#define AT91C_PIO_PB8 (1 << 8) // Pin Controlled by PB8 -#define AT91C_PB8_EMDC (AT91C_PIO_PB8) // Ethernet MAC Management Data Clock -#define AT91C_PIO_PB9 (1 << 9) // Pin Controlled by PB9 -#define AT91C_PB9_EMDIO (AT91C_PIO_PB9) // Ethernet MAC Management Data Input/Output - -// ***************************************************************************** -// PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_ID_FIQ ( 0) // Advanced Interrupt Controller (FIQ) -#define AT91C_ID_SYS ( 1) // System Peripheral -#define AT91C_ID_PIOA ( 2) // Parallel IO Controller A -#define AT91C_ID_PIOB ( 3) // Parallel IO Controller B -#define AT91C_ID_SPI0 ( 4) // Serial Peripheral Interface 0 -#define AT91C_ID_SPI1 ( 5) // Serial Peripheral Interface 1 -#define AT91C_ID_US0 ( 6) // USART 0 -#define AT91C_ID_US1 ( 7) // USART 1 -#define AT91C_ID_SSC ( 8) // Serial Synchronous Controller -#define AT91C_ID_TWI ( 9) // Two-Wire Interface -#define AT91C_ID_PWMC (10) // PWM Controller -#define AT91C_ID_UDP (11) // USB Device Port -#define AT91C_ID_TC0 (12) // Timer Counter 0 -#define AT91C_ID_TC1 (13) // Timer Counter 1 -#define AT91C_ID_TC2 (14) // Timer Counter 2 -#define AT91C_ID_CAN (15) // Control Area Network Controller -#define AT91C_ID_EMAC (16) // Ethernet MAC -#define AT91C_ID_ADC (17) // Analog-to-Digital Converter -#define AT91C_ID_18_Reserved (18) // Reserved -#define AT91C_ID_19_Reserved (19) // Reserved -#define AT91C_ID_20_Reserved (20) // Reserved -#define AT91C_ID_21_Reserved (21) // Reserved -#define AT91C_ID_22_Reserved (22) // Reserved -#define AT91C_ID_23_Reserved (23) // Reserved -#define AT91C_ID_24_Reserved (24) // Reserved -#define AT91C_ID_25_Reserved (25) // Reserved -#define AT91C_ID_26_Reserved (26) // Reserved -#define AT91C_ID_27_Reserved (27) // Reserved -#define AT91C_ID_28_Reserved (28) // Reserved -#define AT91C_ID_29_Reserved (29) // Reserved -#define AT91C_ID_IRQ0 (30) // Advanced Interrupt Controller (IRQ0) -#define AT91C_ID_IRQ1 (31) // Advanced Interrupt Controller (IRQ1) -#define AT91C_ALL_INT (0xC003FFFF) // ALL VALID INTERRUPTS - -// ***************************************************************************** -// BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -#define AT91C_BASE_SYS (0xFFFFF000) // (SYS) Base Address -#define AT91C_BASE_AIC (0xFFFFF000) // (AIC) Base Address -#define AT91C_BASE_PDC_DBGU (0xFFFFF300) // (PDC_DBGU) Base Address -#define AT91C_BASE_DBGU (0xFFFFF200) // (DBGU) Base Address -#define AT91C_BASE_PIOA (0xFFFFF400) // (PIOA) Base Address -#define AT91C_BASE_PIOB (0xFFFFF600) // (PIOB) Base Address -#define AT91C_BASE_CKGR (0xFFFFFC20) // (CKGR) Base Address -#define AT91C_BASE_PMC (0xFFFFFC00) // (PMC) Base Address -#define AT91C_BASE_RSTC (0xFFFFFD00) // (RSTC) Base Address -#define AT91C_BASE_RTTC (0xFFFFFD20) // (RTTC) Base Address -#define AT91C_BASE_PITC (0xFFFFFD30) // (PITC) Base Address -#define AT91C_BASE_WDTC (0xFFFFFD40) // (WDTC) Base Address -#define AT91C_BASE_VREG (0xFFFFFD60) // (VREG) Base Address -#define AT91C_BASE_MC (0xFFFFFF00) // (MC) Base Address -#define AT91C_BASE_PDC_SPI1 (0xFFFE4100) // (PDC_SPI1) Base Address -#define AT91C_BASE_SPI1 (0xFFFE4000) // (SPI1) Base Address -#define AT91C_BASE_PDC_SPI0 (0xFFFE0100) // (PDC_SPI0) Base Address -#define AT91C_BASE_SPI0 (0xFFFE0000) // (SPI0) Base Address -#define AT91C_BASE_PDC_US1 (0xFFFC4100) // (PDC_US1) Base Address -#define AT91C_BASE_US1 (0xFFFC4000) // (US1) Base Address -#define AT91C_BASE_PDC_US0 (0xFFFC0100) // (PDC_US0) Base Address -#define AT91C_BASE_US0 (0xFFFC0000) // (US0) Base Address -#define AT91C_BASE_PDC_SSC (0xFFFD4100) // (PDC_SSC) Base Address -#define AT91C_BASE_SSC (0xFFFD4000) // (SSC) Base Address -#define AT91C_BASE_TWI (0xFFFB8000) // (TWI) Base Address -#define AT91C_BASE_PWMC_CH3 (0xFFFCC260) // (PWMC_CH3) Base Address -#define AT91C_BASE_PWMC_CH2 (0xFFFCC240) // (PWMC_CH2) Base Address -#define AT91C_BASE_PWMC_CH1 (0xFFFCC220) // (PWMC_CH1) Base Address -#define AT91C_BASE_PWMC_CH0 (0xFFFCC200) // (PWMC_CH0) Base Address -#define AT91C_BASE_PWMC (0xFFFCC000) // (PWMC) Base Address -#define AT91C_BASE_UDP (0xFFFB0000) // (UDP) Base Address -#define AT91C_BASE_TC0 (0xFFFA0000) // (TC0) Base Address -#define AT91C_BASE_TC1 (0xFFFA0040) // (TC1) Base Address -#define AT91C_BASE_TC2 (0xFFFA0080) // (TC2) Base Address -#define AT91C_BASE_TCB (0xFFFA0000) // (TCB) Base Address -#define AT91C_BASE_CAN_MB0 (0xFFFD0200) // (CAN_MB0) Base Address -#define AT91C_BASE_CAN_MB1 (0xFFFD0220) // (CAN_MB1) Base Address -#define AT91C_BASE_CAN_MB2 (0xFFFD0240) // (CAN_MB2) Base Address -#define AT91C_BASE_CAN_MB3 (0xFFFD0260) // (CAN_MB3) Base Address -#define AT91C_BASE_CAN_MB4 (0xFFFD0280) // (CAN_MB4) Base Address -#define AT91C_BASE_CAN_MB5 (0xFFFD02A0) // (CAN_MB5) Base Address -#define AT91C_BASE_CAN_MB6 (0xFFFD02C0) // (CAN_MB6) Base Address -#define AT91C_BASE_CAN_MB7 (0xFFFD02E0) // (CAN_MB7) Base Address -#define AT91C_BASE_CAN (0xFFFD0000) // (CAN) Base Address -#define AT91C_BASE_EMAC (0xFFFDC000) // (EMAC) Base Address -#define AT91C_BASE_PDC_ADC (0xFFFD8100) // (PDC_ADC) Base Address -#define AT91C_BASE_ADC (0xFFFD8000) // (ADC) Base Address - -// ***************************************************************************** -// MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 -// ***************************************************************************** -// ISRAM -#define AT91C_ISRAM (0x00200000) // Internal SRAM base address -#define AT91C_ISRAM_SIZE (0x00010000) // Internal SRAM size in byte (64 Kbytes) -// IFLASH -#define AT91C_IFLASH (0x00100000) // Internal FLASH base address -#define AT91C_IFLASH_SIZE (0x00040000) // Internal FLASH size in byte (256 Kbytes) -#define AT91C_IFLASH_PAGE_SIZE (256) // Internal FLASH Page Size: 256 bytes -#define AT91C_IFLASH_LOCK_REGION_SIZE (16384) // Internal FLASH Lock Region Size: 16 Kbytes -#define AT91C_IFLASH_NB_OF_PAGES (1024) // Internal FLASH Number of Pages: 1024 bytes -#define AT91C_IFLASH_NB_OF_LOCK_BITS (16) // Internal FLASH Number of Lock Bits: 16 bytes - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/lib_AT91SAM7X256.h b/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/lib_AT91SAM7X256.h deleted file mode 100644 index 8bd8f04d2..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/lib_AT91SAM7X256.h +++ /dev/null @@ -1,4211 +0,0 @@ -//* ---------------------------------------------------------------------------- -//* ATMEL Microcontroller Software Support - ROUSSET - -//* ---------------------------------------------------------------------------- -//* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -//* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -//* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -//* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : lib_AT91SAM7X256.h -//* Object : AT91SAM7X256 inlined functions -//* Generated : AT91 SW Application Group 01/16/2006 (16:36:21) -//* -//* CVS Reference : /lib_MC_SAM7X.h/1.1/Thu Mar 25 15:19:14 2004// -//* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// -//* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// -//* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// -//* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// -//* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// -//* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// -//* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// -//* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// -//* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// -//* CVS Reference : /lib_pmc_SAM7X.h/1.5/Fri Nov 4 09:41:32 2005// -//* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// -//* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// -//* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// -//* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// -//* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// -//* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// -//* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// -//* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// -//* CVS Reference : /lib_can_AT91.h/1.5/Tue Aug 23 15:37:07 2005// -//* ---------------------------------------------------------------------------- - -#ifndef lib_AT91SAM7X256_H -#define lib_AT91SAM7X256_H - -/* ***************************************************************************** - SOFTWARE API FOR AIC - ***************************************************************************** */ -#define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_ConfigureIt -//* \brief Interrupt Handler Initialization -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_AIC_ConfigureIt ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id, // \arg interrupt number to initialize - unsigned int priority, // \arg priority to give to the interrupt - unsigned int src_type, // \arg activation and sense of activation - void (*newHandler) () ) // \arg address of the interrupt handler -{ - unsigned int oldHandler; - unsigned int mask ; - - oldHandler = pAic->AIC_SVR[irq_id]; - - mask = 0x1 << irq_id ; - //* Disable the interrupt on the interrupt controller - pAic->AIC_IDCR = mask ; - //* Save the interrupt handler routine pointer and the interrupt priority - pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; - //* Store the Source Mode Register - pAic->AIC_SMR[irq_id] = src_type | priority ; - //* Clear the interrupt on the interrupt controller - pAic->AIC_ICCR = mask ; - - return oldHandler; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_EnableIt -//* \brief Enable corresponding IT number -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_EnableIt ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id ) // \arg interrupt number to initialize -{ - //* Enable the interrupt on the interrupt controller - pAic->AIC_IECR = 0x1 << irq_id ; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_DisableIt -//* \brief Disable corresponding IT number -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_DisableIt ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id ) // \arg interrupt number to initialize -{ - unsigned int mask = 0x1 << irq_id; - //* Disable the interrupt on the interrupt controller - pAic->AIC_IDCR = mask ; - //* Clear the interrupt on the Interrupt Controller ( if one is pending ) - pAic->AIC_ICCR = mask ; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_ClearIt -//* \brief Clear corresponding IT number -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_ClearIt ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id) // \arg interrupt number to initialize -{ - //* Clear the interrupt on the Interrupt Controller ( if one is pending ) - pAic->AIC_ICCR = (0x1 << irq_id); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_AcknowledgeIt -//* \brief Acknowledge corresponding IT number -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_AcknowledgeIt ( - AT91PS_AIC pAic) // \arg pointer to the AIC registers -{ - pAic->AIC_EOICR = pAic->AIC_EOICR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_SetExceptionVector -//* \brief Configure vector handler -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_AIC_SetExceptionVector ( - unsigned int *pVector, // \arg pointer to the AIC registers - void (*Handler) () ) // \arg Interrupt Handler -{ - unsigned int oldVector = *pVector; - - if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) - *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; - else - *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; - - return oldVector; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_Trig -//* \brief Trig an IT -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_Trig ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id) // \arg interrupt number -{ - pAic->AIC_ISCR = (0x1 << irq_id) ; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_IsActive -//* \brief Test if an IT is active -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_AIC_IsActive ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id) // \arg Interrupt Number -{ - return (pAic->AIC_ISR & (0x1 << irq_id)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_IsPending -//* \brief Test if an IT is pending -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_AIC_IsPending ( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - unsigned int irq_id) // \arg Interrupt Number -{ - return (pAic->AIC_IPR & (0x1 << irq_id)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_Open -//* \brief Set exception vectors and AIC registers to default values -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_Open( - AT91PS_AIC pAic, // \arg pointer to the AIC registers - void (*IrqHandler) (), // \arg Default IRQ vector exception - void (*FiqHandler) (), // \arg Default FIQ vector exception - void (*DefaultHandler) (), // \arg Default Handler set in ISR - void (*SpuriousHandler) (), // \arg Default Spurious Handler - unsigned int protectMode) // \arg Debug Control Register -{ - int i; - - // Disable all interrupts and set IVR to the default handler - for (i = 0; i < 32; ++i) { - AT91F_AIC_DisableIt(pAic, i); - AT91F_AIC_ConfigureIt(pAic, i, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_HIGH_LEVEL, DefaultHandler); - } - - // Set the IRQ exception vector - AT91F_AIC_SetExceptionVector((unsigned int *) 0x18, IrqHandler); - // Set the Fast Interrupt exception vector - AT91F_AIC_SetExceptionVector((unsigned int *) 0x1C, FiqHandler); - - pAic->AIC_SPU = (unsigned int) SpuriousHandler; - pAic->AIC_DCR = protectMode; -} -/* ***************************************************************************** - SOFTWARE API FOR PDC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetNextRx -//* \brief Set the next receive transfer descriptor -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_SetNextRx ( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be received - unsigned int bytes) // \arg number of bytes to be received -{ - pPDC->PDC_RNPR = (unsigned int) address; - pPDC->PDC_RNCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetNextTx -//* \brief Set the next transmit transfer descriptor -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_SetNextTx ( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be transmitted - unsigned int bytes) // \arg number of bytes to be transmitted -{ - pPDC->PDC_TNPR = (unsigned int) address; - pPDC->PDC_TNCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetRx -//* \brief Set the receive transfer descriptor -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_SetRx ( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be received - unsigned int bytes) // \arg number of bytes to be received -{ - pPDC->PDC_RPR = (unsigned int) address; - pPDC->PDC_RCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SetTx -//* \brief Set the transmit transfer descriptor -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_SetTx ( - AT91PS_PDC pPDC, // \arg pointer to a PDC controller - char *address, // \arg address to the next bloc to be transmitted - unsigned int bytes) // \arg number of bytes to be transmitted -{ - pPDC->PDC_TPR = (unsigned int) address; - pPDC->PDC_TCR = bytes; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_EnableTx -//* \brief Enable transmit -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_EnableTx ( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_TXTEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_EnableRx -//* \brief Enable receive -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_EnableRx ( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_RXTEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_DisableTx -//* \brief Disable transmit -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_DisableTx ( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_DisableRx -//* \brief Disable receive -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_DisableRx ( - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_IsTxEmpty -//* \brief Test if the current transfer descriptor has been sent -//*---------------------------------------------------------------------------- -__inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - return !(pPDC->PDC_TCR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_IsNextTxEmpty -//* \brief Test if the next transfer descriptor has been moved to the current td -//*---------------------------------------------------------------------------- -__inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - return !(pPDC->PDC_TNCR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_IsRxEmpty -//* \brief Test if the current transfer descriptor has been filled -//*---------------------------------------------------------------------------- -__inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - return !(pPDC->PDC_RCR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_IsNextRxEmpty -//* \brief Test if the next transfer descriptor has been moved to the current td -//*---------------------------------------------------------------------------- -__inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete - AT91PS_PDC pPDC ) // \arg pointer to a PDC controller -{ - return !(pPDC->PDC_RNCR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_Open -//* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_Open ( - AT91PS_PDC pPDC) // \arg pointer to a PDC controller -{ - //* Disable the RX and TX PDC transfer requests - AT91F_PDC_DisableRx(pPDC); - AT91F_PDC_DisableTx(pPDC); - - //* Reset all Counter register Next buffer first - AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); - AT91F_PDC_SetTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetRx(pPDC, (char *) 0, 0); - - //* Enable the RX and TX PDC transfer requests - AT91F_PDC_EnableRx(pPDC); - AT91F_PDC_EnableTx(pPDC); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_Close -//* \brief Close PDC: disable TX and RX reset transfer descriptors -//*---------------------------------------------------------------------------- -__inline void AT91F_PDC_Close ( - AT91PS_PDC pPDC) // \arg pointer to a PDC controller -{ - //* Disable the RX and TX PDC transfer requests - AT91F_PDC_DisableRx(pPDC); - AT91F_PDC_DisableTx(pPDC); - - //* Reset all Counter register Next buffer first - AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); - AT91F_PDC_SetTx(pPDC, (char *) 0, 0); - AT91F_PDC_SetRx(pPDC, (char *) 0, 0); - -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_SendFrame -//* \brief Close PDC: disable TX and RX reset transfer descriptors -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PDC_SendFrame( - AT91PS_PDC pPDC, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - if (AT91F_PDC_IsTxEmpty(pPDC)) { - //* Buffer and next buffer can be initialized - AT91F_PDC_SetTx(pPDC, pBuffer, szBuffer); - AT91F_PDC_SetNextTx(pPDC, pNextBuffer, szNextBuffer); - return 2; - } - else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { - //* Only one buffer can be initialized - AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); - return 1; - } - else { - //* All buffer are in use... - return 0; - } -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PDC_ReceiveFrame -//* \brief Close PDC: disable TX and RX reset transfer descriptors -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PDC_ReceiveFrame ( - AT91PS_PDC pPDC, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - if (AT91F_PDC_IsRxEmpty(pPDC)) { - //* Buffer and next buffer can be initialized - AT91F_PDC_SetRx(pPDC, pBuffer, szBuffer); - AT91F_PDC_SetNextRx(pPDC, pNextBuffer, szNextBuffer); - return 2; - } - else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { - //* Only one buffer can be initialized - AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); - return 1; - } - else { - //* All buffer are in use... - return 0; - } -} -/* ***************************************************************************** - SOFTWARE API FOR DBGU - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_InterruptEnable -//* \brief Enable DBGU Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_DBGU_InterruptEnable( - AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller - unsigned int flag) // \arg dbgu interrupt to be enabled -{ - pDbgu->DBGU_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_InterruptDisable -//* \brief Disable DBGU Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_DBGU_InterruptDisable( - AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller - unsigned int flag) // \arg dbgu interrupt to be disabled -{ - pDbgu->DBGU_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_GetInterruptMaskStatus -//* \brief Return DBGU Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status - AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller -{ - return pDbgu->DBGU_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_IsInterruptMasked -//* \brief Test if DBGU Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_DBGU_IsInterruptMasked( - AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR PIO - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgPeriph -//* \brief Enable pins to be drived by peripheral -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgPeriph( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int periphAEnable, // \arg PERIPH A to enable - unsigned int periphBEnable) // \arg PERIPH B to enable - -{ - pPio->PIO_ASR = periphAEnable; - pPio->PIO_BSR = periphBEnable; - pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgOutput -//* \brief Enable PIO in output mode -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgOutput( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int pioEnable) // \arg PIO to be enabled -{ - pPio->PIO_PER = pioEnable; // Set in PIO mode - pPio->PIO_OER = pioEnable; // Configure in Output -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgInput -//* \brief Enable PIO in input mode -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgInput( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int inputEnable) // \arg PIO to be enabled -{ - // Disable output - pPio->PIO_ODR = inputEnable; - pPio->PIO_PER = inputEnable; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgOpendrain -//* \brief Configure PIO in open drain -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgOpendrain( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int multiDrvEnable) // \arg pio to be configured in open drain -{ - // Configure the multi-drive option - pPio->PIO_MDDR = ~multiDrvEnable; - pPio->PIO_MDER = multiDrvEnable; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgPullup -//* \brief Enable pullup on PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgPullup( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int pullupEnable) // \arg enable pullup on PIO -{ - // Connect or not Pullup - pPio->PIO_PPUDR = ~pullupEnable; - pPio->PIO_PPUER = pullupEnable; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgDirectDrive -//* \brief Enable direct drive on PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgDirectDrive( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int directDrive) // \arg PIO to be configured with direct drive - -{ - // Configure the Direct Drive - pPio->PIO_OWDR = ~directDrive; - pPio->PIO_OWER = directDrive; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_CfgInputFilter -//* \brief Enable input filter on input PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_CfgInputFilter( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int inputFilter) // \arg PIO to be configured with input filter - -{ - // Configure the Direct Drive - pPio->PIO_IFDR = ~inputFilter; - pPio->PIO_IFER = inputFilter; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetInput -//* \brief Return PIO input value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetInput( // \return PIO input - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_PDSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsInputSet -//* \brief Test if PIO is input flag is active -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsInputSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetInput(pPio) & flag); -} - - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_SetOutput -//* \brief Set to 1 output PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_SetOutput( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg output to be set -{ - pPio->PIO_SODR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_ClearOutput -//* \brief Set to 0 output PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_ClearOutput( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg output to be cleared -{ - pPio->PIO_CODR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_ForceOutput -//* \brief Force output when Direct drive option is enabled -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_ForceOutput( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg output to be forced -{ - pPio->PIO_ODSR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_Enable -//* \brief Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_Enable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio to be enabled -{ - pPio->PIO_PER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_Disable -//* \brief Disable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_Disable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio to be disabled -{ - pPio->PIO_PDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetStatus -//* \brief Return PIO Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_PSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsSet -//* \brief Test if PIO is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_OutputEnable -//* \brief Output Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_OutputEnable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio output to be enabled -{ - pPio->PIO_OER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_OutputDisable -//* \brief Output Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_OutputDisable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio output to be disabled -{ - pPio->PIO_ODR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetOutputStatus -//* \brief Return PIO Output Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_OSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsOuputSet -//* \brief Test if PIO Output is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsOutputSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetOutputStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_InputFilterEnable -//* \brief Input Filter Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_InputFilterEnable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio input filter to be enabled -{ - pPio->PIO_IFER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_InputFilterDisable -//* \brief Input Filter Disable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_InputFilterDisable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio input filter to be disabled -{ - pPio->PIO_IFDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetInputFilterStatus -//* \brief Return PIO Input Filter Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_IFSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsInputFilterSet -//* \brief Test if PIO Input filter is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsInputFilterSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetOutputDataStatus -//* \brief Return PIO Output Data Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_ODSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_InterruptEnable -//* \brief Enable PIO Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_InterruptEnable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio interrupt to be enabled -{ - pPio->PIO_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_InterruptDisable -//* \brief Disable PIO Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_InterruptDisable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio interrupt to be disabled -{ - pPio->PIO_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetInterruptMaskStatus -//* \brief Return PIO Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetInterruptStatus -//* \brief Return PIO Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_ISR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsInterruptMasked -//* \brief Test if PIO Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsInterruptMasked( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsInterruptSet -//* \brief Test if PIO Interrupt is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsInterruptSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetInterruptStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_MultiDriverEnable -//* \brief Multi Driver Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_MultiDriverEnable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio to be enabled -{ - pPio->PIO_MDER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_MultiDriverDisable -//* \brief Multi Driver Disable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_MultiDriverDisable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio to be disabled -{ - pPio->PIO_MDDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetMultiDriverStatus -//* \brief Return PIO Multi Driver Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_MDSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsMultiDriverSet -//* \brief Test if PIO MultiDriver is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsMultiDriverSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_A_RegisterSelection -//* \brief PIO A Register Selection -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_A_RegisterSelection( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio A register selection -{ - pPio->PIO_ASR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_B_RegisterSelection -//* \brief PIO B Register Selection -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_B_RegisterSelection( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio B register selection -{ - pPio->PIO_BSR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_Get_AB_RegisterStatus -//* \brief Return PIO Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_ABSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsAB_RegisterSet -//* \brief Test if PIO AB Register is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsAB_RegisterSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_OutputWriteEnable -//* \brief Output Write Enable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_OutputWriteEnable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio output write to be enabled -{ - pPio->PIO_OWER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_OutputWriteDisable -//* \brief Output Write Disable PIO -//*---------------------------------------------------------------------------- -__inline void AT91F_PIO_OutputWriteDisable( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg pio output write to be disabled -{ - pPio->PIO_OWDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetOutputWriteStatus -//* \brief Return PIO Output Write Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_OWSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsOutputWriteSet -//* \brief Test if PIO OutputWrite is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsOutputWriteSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_GetCfgPullup -//* \brief Return PIO Configuration Pullup -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup - AT91PS_PIO pPio) // \arg pointer to a PIO controller -{ - return pPio->PIO_PPUSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsOutputDataStatusSet -//* \brief Test if PIO Output Data Status is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsOutputDataStatusSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIO_IsCfgPullupStatusSet -//* \brief Test if PIO Configuration Pullup Status is Set -//*---------------------------------------------------------------------------- -__inline int AT91F_PIO_IsCfgPullupStatusSet( - AT91PS_PIO pPio, // \arg pointer to a PIO controller - unsigned int flag) // \arg flag to be tested -{ - return (~AT91F_PIO_GetCfgPullup(pPio) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR PMC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_CfgSysClkEnableReg -//* \brief Configure the System Clock Enable Register of the PMC controller -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_CfgSysClkEnableReg ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int mode) -{ - //* Write to the SCER register - pPMC->PMC_SCER = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_CfgSysClkDisableReg -//* \brief Configure the System Clock Disable Register of the PMC controller -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_CfgSysClkDisableReg ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int mode) -{ - //* Write to the SCDR register - pPMC->PMC_SCDR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_GetSysClkStatusReg -//* \brief Return the System Clock Status Register of the PMC controller -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_GetSysClkStatusReg ( - AT91PS_PMC pPMC // pointer to a CAN controller - ) -{ - return pPMC->PMC_SCSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_EnablePeriphClock -//* \brief Enable peripheral clock -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_EnablePeriphClock ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int periphIds) // \arg IDs of peripherals -{ - pPMC->PMC_PCER = periphIds; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_DisablePeriphClock -//* \brief Disable peripheral clock -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_DisablePeriphClock ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int periphIds) // \arg IDs of peripherals -{ - pPMC->PMC_PCDR = periphIds; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_GetPeriphClock -//* \brief Get peripheral clock status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_GetPeriphClock ( - AT91PS_PMC pPMC) // \arg pointer to PMC controller -{ - return pPMC->PMC_PCSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_CfgMainOscillatorReg -//* \brief Cfg the main oscillator -//*---------------------------------------------------------------------------- -__inline void AT91F_CKGR_CfgMainOscillatorReg ( - AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller - unsigned int mode) -{ - pCKGR->CKGR_MOR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_GetMainOscillatorReg -//* \brief Cfg the main oscillator -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( - AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller -{ - return pCKGR->CKGR_MOR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_EnableMainOscillator -//* \brief Enable the main oscillator -//*---------------------------------------------------------------------------- -__inline void AT91F_CKGR_EnableMainOscillator( - AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller -{ - pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_DisableMainOscillator -//* \brief Disable the main oscillator -//*---------------------------------------------------------------------------- -__inline void AT91F_CKGR_DisableMainOscillator ( - AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller -{ - pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_CfgMainOscStartUpTime -//* \brief Cfg MOR Register according to the main osc startup time -//*---------------------------------------------------------------------------- -__inline void AT91F_CKGR_CfgMainOscStartUpTime ( - AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller - unsigned int startup_time, // \arg main osc startup time in microsecond (us) - unsigned int slowClock) // \arg slowClock in Hz -{ - pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; - pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_GetMainClockFreqReg -//* \brief Cfg the main oscillator -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( - AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller -{ - return pCKGR->CKGR_MCFR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CKGR_GetMainClock -//* \brief Return Main clock in Hz -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CKGR_GetMainClock ( - AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller - unsigned int slowClock) // \arg slowClock in Hz -{ - return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_CfgMCKReg -//* \brief Cfg Master Clock Register -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_CfgMCKReg ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int mode) -{ - pPMC->PMC_MCKR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_GetMCKReg -//* \brief Return Master Clock Register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_GetMCKReg( - AT91PS_PMC pPMC) // \arg pointer to PMC controller -{ - return pPMC->PMC_MCKR; -} - -//*------------------------------------------------------------------------------ -//* \fn AT91F_PMC_GetMasterClock -//* \brief Return master clock in Hz which correponds to processor clock for ARM7 -//*------------------------------------------------------------------------------ -__inline unsigned int AT91F_PMC_GetMasterClock ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller - unsigned int slowClock) // \arg slowClock in Hz -{ - unsigned int reg = pPMC->PMC_MCKR; - unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); - unsigned int pllDivider, pllMultiplier; - - switch (reg & AT91C_PMC_CSS) { - case AT91C_PMC_CSS_SLOW_CLK: // Slow clock selected - return slowClock / prescaler; - case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected - return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; - case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected - reg = pCKGR->CKGR_PLLR; - pllDivider = (reg & AT91C_CKGR_DIV); - pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; - return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; - } - return 0; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_EnablePCK -//* \brief Enable Programmable Clock x Output -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_EnablePCK ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int pck, // \arg Programmable Clock x Output - unsigned int mode) -{ - pPMC->PMC_PCKR[pck] = mode; - pPMC->PMC_SCER = (1 << pck) << 8; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_DisablePCK -//* \brief Disable Programmable Clock x Output -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_DisablePCK ( - AT91PS_PMC pPMC, // \arg pointer to PMC controller - unsigned int pck) // \arg Programmable Clock x Output -{ - pPMC->PMC_SCDR = (1 << pck) << 8; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_EnableIt -//* \brief Enable PMC interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_EnableIt ( - AT91PS_PMC pPMC, // pointer to a PMC controller - unsigned int flag) // IT to be enabled -{ - //* Write to the IER register - pPMC->PMC_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_DisableIt -//* \brief Disable PMC interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_DisableIt ( - AT91PS_PMC pPMC, // pointer to a PMC controller - unsigned int flag) // IT to be disabled -{ - //* Write to the IDR register - pPMC->PMC_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_GetStatus -//* \brief Return PMC Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status - AT91PS_PMC pPMC) // pointer to a PMC controller -{ - return pPMC->PMC_SR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_GetInterruptMaskStatus -//* \brief Return PMC Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status - AT91PS_PMC pPMC) // pointer to a PMC controller -{ - return pPMC->PMC_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_IsInterruptMasked -//* \brief Test if PMC Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_IsInterruptMasked( - AT91PS_PMC pPMC, // \arg pointer to a PMC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_IsStatusSet -//* \brief Test if PMC Status is Set -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PMC_IsStatusSet( - AT91PS_PMC pPMC, // \arg pointer to a PMC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PMC_GetStatus(pPMC) & flag); -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_CKGR_CfgPLLReg -// \brief Cfg the PLL Register -// ---------------------------------------------------------------------------- -__inline void AT91F_CKGR_CfgPLLReg ( - AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller - unsigned int mode) -{ - pCKGR->CKGR_PLLR = mode; -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_CKGR_GetPLLReg -// \brief Get the PLL Register -// ---------------------------------------------------------------------------- -__inline unsigned int AT91F_CKGR_GetPLLReg ( - AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller -{ - return pCKGR->CKGR_PLLR; -} - - -/* ***************************************************************************** - SOFTWARE API FOR RSTC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTSoftReset -//* \brief Start Software Reset -//*---------------------------------------------------------------------------- -__inline void AT91F_RSTSoftReset( - AT91PS_RSTC pRSTC, - unsigned int reset) -{ - pRSTC->RSTC_RCR = (0xA5000000 | reset); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTSetMode -//* \brief Set Reset Mode -//*---------------------------------------------------------------------------- -__inline void AT91F_RSTSetMode( - AT91PS_RSTC pRSTC, - unsigned int mode) -{ - pRSTC->RSTC_RMR = (0xA5000000 | mode); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTGetMode -//* \brief Get Reset Mode -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_RSTGetMode( - AT91PS_RSTC pRSTC) -{ - return (pRSTC->RSTC_RMR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTGetStatus -//* \brief Get Reset Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_RSTGetStatus( - AT91PS_RSTC pRSTC) -{ - return (pRSTC->RSTC_RSR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTIsSoftRstActive -//* \brief Return !=0 if software reset is still not completed -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_RSTIsSoftRstActive( - AT91PS_RSTC pRSTC) -{ - return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); -} -/* ***************************************************************************** - SOFTWARE API FOR RTTC - ***************************************************************************** */ -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_SetRTT_TimeBase() -//* \brief Set the RTT prescaler according to the TimeBase in ms -//*-------------------------------------------------------------------------------------- -__inline unsigned int AT91F_RTTSetTimeBase( - AT91PS_RTTC pRTTC, - unsigned int ms) -{ - if (ms > 2000) - return 1; // AT91C_TIME_OUT_OF_RANGE - pRTTC->RTTC_RTMR &= ~0xFFFF; - pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); - return 0; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTTSetPrescaler() -//* \brief Set the new prescaler value -//*-------------------------------------------------------------------------------------- -__inline unsigned int AT91F_RTTSetPrescaler( - AT91PS_RTTC pRTTC, - unsigned int rtpres) -{ - pRTTC->RTTC_RTMR &= ~0xFFFF; - pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); - return (pRTTC->RTTC_RTMR); -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTTRestart() -//* \brief Restart the RTT prescaler -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTRestart( - AT91PS_RTTC pRTTC) -{ - pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; -} - - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_SetAlarmINT() -//* \brief Enable RTT Alarm Interrupt -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTSetAlarmINT( - AT91PS_RTTC pRTTC) -{ - pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_ClearAlarmINT() -//* \brief Disable RTT Alarm Interrupt -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTClearAlarmINT( - AT91PS_RTTC pRTTC) -{ - pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_SetRttIncINT() -//* \brief Enable RTT INC Interrupt -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTSetRttIncINT( - AT91PS_RTTC pRTTC) -{ - pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_ClearRttIncINT() -//* \brief Disable RTT INC Interrupt -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTClearRttIncINT( - AT91PS_RTTC pRTTC) -{ - pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_SetAlarmValue() -//* \brief Set RTT Alarm Value -//*-------------------------------------------------------------------------------------- -__inline void AT91F_RTTSetAlarmValue( - AT91PS_RTTC pRTTC, unsigned int alarm) -{ - pRTTC->RTTC_RTAR = alarm; -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_GetAlarmValue() -//* \brief Get RTT Alarm Value -//*-------------------------------------------------------------------------------------- -__inline unsigned int AT91F_RTTGetAlarmValue( - AT91PS_RTTC pRTTC) -{ - return(pRTTC->RTTC_RTAR); -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTTGetStatus() -//* \brief Read the RTT status -//*-------------------------------------------------------------------------------------- -__inline unsigned int AT91F_RTTGetStatus( - AT91PS_RTTC pRTTC) -{ - return(pRTTC->RTTC_RTSR); -} - -//*-------------------------------------------------------------------------------------- -//* \fn AT91F_RTT_ReadValue() -//* \brief Read the RTT value -//*-------------------------------------------------------------------------------------- -__inline unsigned int AT91F_RTTReadValue( - AT91PS_RTTC pRTTC) -{ - register volatile unsigned int val1,val2; - do - { - val1 = pRTTC->RTTC_RTVR; - val2 = pRTTC->RTTC_RTVR; - } - while(val1 != val2); - return(val1); -} -/* ***************************************************************************** - SOFTWARE API FOR PITC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITInit -//* \brief System timer init : period in second, system clock freq in MHz -//*---------------------------------------------------------------------------- -__inline void AT91F_PITInit( - AT91PS_PITC pPITC, - unsigned int period, - unsigned int pit_frequency) -{ - pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 - pPITC->PITC_PIMR |= AT91C_PITC_PITEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITSetPIV -//* \brief Set the PIT Periodic Interval Value -//*---------------------------------------------------------------------------- -__inline void AT91F_PITSetPIV( - AT91PS_PITC pPITC, - unsigned int piv) -{ - pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITEnableInt -//* \brief Enable PIT periodic interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PITEnableInt( - AT91PS_PITC pPITC) -{ - pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITDisableInt -//* \brief Disable PIT periodic interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PITDisableInt( - AT91PS_PITC pPITC) -{ - pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITGetMode -//* \brief Read PIT mode register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PITGetMode( - AT91PS_PITC pPITC) -{ - return(pPITC->PITC_PIMR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITGetStatus -//* \brief Read PIT status register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PITGetStatus( - AT91PS_PITC pPITC) -{ - return(pPITC->PITC_PISR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITGetPIIR -//* \brief Read PIT CPIV and PICNT without ressetting the counters -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PITGetPIIR( - AT91PS_PITC pPITC) -{ - return(pPITC->PITC_PIIR); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITGetPIVR -//* \brief Read System timer CPIV and PICNT without ressetting the counters -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PITGetPIVR( - AT91PS_PITC pPITC) -{ - return(pPITC->PITC_PIVR); -} -/* ***************************************************************************** - SOFTWARE API FOR WDTC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_WDTSetMode -//* \brief Set Watchdog Mode Register -//*---------------------------------------------------------------------------- -__inline void AT91F_WDTSetMode( - AT91PS_WDTC pWDTC, - unsigned int Mode) -{ - pWDTC->WDTC_WDMR = Mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_WDTRestart -//* \brief Restart Watchdog -//*---------------------------------------------------------------------------- -__inline void AT91F_WDTRestart( - AT91PS_WDTC pWDTC) -{ - pWDTC->WDTC_WDCR = 0xA5000001; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_WDTSGettatus -//* \brief Get Watchdog Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_WDTSGettatus( - AT91PS_WDTC pWDTC) -{ - return(pWDTC->WDTC_WDSR & 0x3); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_WDTGetPeriod -//* \brief Translate ms into Watchdog Compatible value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) -{ - if ((ms < 4) || (ms > 16000)) - return 0; - return((ms << 8) / 1000); -} -/* ***************************************************************************** - SOFTWARE API FOR VREG - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_VREG_Enable_LowPowerMode -//* \brief Enable VREG Low Power Mode -//*---------------------------------------------------------------------------- -__inline void AT91F_VREG_Enable_LowPowerMode( - AT91PS_VREG pVREG) -{ - pVREG->VREG_MR |= AT91C_VREG_PSTDBY; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_VREG_Disable_LowPowerMode -//* \brief Disable VREG Low Power Mode -//*---------------------------------------------------------------------------- -__inline void AT91F_VREG_Disable_LowPowerMode( - AT91PS_VREG pVREG) -{ - pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; -}/* ***************************************************************************** - SOFTWARE API FOR MC - ***************************************************************************** */ - -#define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_Remap -//* \brief Make Remap -//*---------------------------------------------------------------------------- -__inline void AT91F_MC_Remap (void) // -{ - AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; - - pMC->MC_RCR = AT91C_MC_RCB; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_CfgModeReg -//* \brief Configure the EFC Mode Register of the MC controller -//*---------------------------------------------------------------------------- -__inline void AT91F_MC_EFC_CfgModeReg ( - AT91PS_MC pMC, // pointer to a MC controller - unsigned int mode) // mode register -{ - // Write to the FMR register - pMC->MC_FMR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_GetModeReg -//* \brief Return MC EFC Mode Regsiter -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_MC_EFC_GetModeReg( - AT91PS_MC pMC) // pointer to a MC controller -{ - return pMC->MC_FMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_ComputeFMCN -//* \brief Return MC EFC Mode Regsiter -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_MC_EFC_ComputeFMCN( - int master_clock) // master clock in Hz -{ - return (master_clock/1000000 +2); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_PerformCmd -//* \brief Perform EFC Command -//*---------------------------------------------------------------------------- -__inline void AT91F_MC_EFC_PerformCmd ( - AT91PS_MC pMC, // pointer to a MC controller - unsigned int transfer_cmd) -{ - pMC->MC_FCR = transfer_cmd; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_GetStatus -//* \brief Return MC EFC Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_MC_EFC_GetStatus( - AT91PS_MC pMC) // pointer to a MC controller -{ - return pMC->MC_FSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_IsInterruptMasked -//* \brief Test if EFC MC Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_MC_EFC_IsInterruptMasked( - AT91PS_MC pMC, // \arg pointer to a MC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_MC_EFC_GetModeReg(pMC) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_EFC_IsInterruptSet -//* \brief Test if EFC MC Interrupt is Set -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_MC_EFC_IsInterruptSet( - AT91PS_MC pMC, // \arg pointer to a MC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_MC_EFC_GetStatus(pMC) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR SPI - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_CfgCs -//* \brief Configure SPI chip select register -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_CfgCs ( - AT91PS_SPI pSPI, // pointer to a SPI controller - int cs, // SPI cs number (0 to 3) - int val) // chip select register -{ - //* Write to the CSR register - *(pSPI->SPI_CSR + cs) = val; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_EnableIt -//* \brief Enable SPI interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_EnableIt ( - AT91PS_SPI pSPI, // pointer to a SPI controller - unsigned int flag) // IT to be enabled -{ - //* Write to the IER register - pSPI->SPI_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_DisableIt -//* \brief Disable SPI interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_DisableIt ( - AT91PS_SPI pSPI, // pointer to a SPI controller - unsigned int flag) // IT to be disabled -{ - //* Write to the IDR register - pSPI->SPI_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_Reset -//* \brief Reset the SPI controller -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_Reset ( - AT91PS_SPI pSPI // pointer to a SPI controller - ) -{ - //* Write to the CR register - pSPI->SPI_CR = AT91C_SPI_SWRST; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_Enable -//* \brief Enable the SPI controller -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_Enable ( - AT91PS_SPI pSPI // pointer to a SPI controller - ) -{ - //* Write to the CR register - pSPI->SPI_CR = AT91C_SPI_SPIEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_Disable -//* \brief Disable the SPI controller -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_Disable ( - AT91PS_SPI pSPI // pointer to a SPI controller - ) -{ - //* Write to the CR register - pSPI->SPI_CR = AT91C_SPI_SPIDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_CfgMode -//* \brief Enable the SPI controller -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_CfgMode ( - AT91PS_SPI pSPI, // pointer to a SPI controller - int mode) // mode register -{ - //* Write to the MR register - pSPI->SPI_MR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_CfgPCS -//* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_CfgPCS ( - AT91PS_SPI pSPI, // pointer to a SPI controller - char PCS_Device) // PCS of the Device -{ - //* Write to the MR register - pSPI->SPI_MR &= 0xFFF0FFFF; - pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_ReceiveFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SPI_ReceiveFrame ( - AT91PS_SPI pSPI, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_ReceiveFrame( - (AT91PS_PDC) &(pSPI->SPI_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_SendFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is bSPIy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SPI_SendFrame( - AT91PS_SPI pSPI, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_SendFrame( - (AT91PS_PDC) &(pSPI->SPI_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_Close -//* \brief Close SPI: disable IT disable transfert, close PDC -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_Close ( - AT91PS_SPI pSPI) // \arg pointer to a SPI controller -{ - //* Reset all the Chip Select register - pSPI->SPI_CSR[0] = 0 ; - pSPI->SPI_CSR[1] = 0 ; - pSPI->SPI_CSR[2] = 0 ; - pSPI->SPI_CSR[3] = 0 ; - - //* Reset the SPI mode - pSPI->SPI_MR = 0 ; - - //* Disable all interrupts - pSPI->SPI_IDR = 0xFFFFFFFF ; - - //* Abort the Peripheral Data Transfers - AT91F_PDC_Close((AT91PS_PDC) &(pSPI->SPI_RPR)); - - //* Disable receiver and transmitter and stop any activity immediately - pSPI->SPI_CR = AT91C_SPI_SPIDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_PutChar -//* \brief Send a character,does not check if ready to send -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI_PutChar ( - AT91PS_SPI pSPI, - unsigned int character, - unsigned int cs_number ) -{ - unsigned int value_for_cs; - value_for_cs = (~(1 << cs_number)) & 0xF; //Place a zero among a 4 ONEs number - pSPI->SPI_TDR = (character & 0xFFFF) | (value_for_cs << 16); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_GetChar -//* \brief Receive a character,does not check if a character is available -//*---------------------------------------------------------------------------- -__inline int AT91F_SPI_GetChar ( - const AT91PS_SPI pSPI) -{ - return((pSPI->SPI_RDR) & 0xFFFF); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_GetInterruptMaskStatus -//* \brief Return SPI Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Interrupt Mask Status - AT91PS_SPI pSpi) // \arg pointer to a SPI controller -{ - return pSpi->SPI_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI_IsInterruptMasked -//* \brief Test if SPI Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_SPI_IsInterruptMasked( - AT91PS_SPI pSpi, // \arg pointer to a SPI controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_SPI_GetInterruptMaskStatus(pSpi) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR USART - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_Baudrate -//* \brief Calculate the baudrate -//* Standard Asynchronous Mode : 8 bits , 1 stop , no parity -#define AT91C_US_ASYNC_MODE ( AT91C_US_USMODE_NORMAL + \ - AT91C_US_NBSTOP_1_BIT + \ - AT91C_US_PAR_NONE + \ - AT91C_US_CHRL_8_BITS + \ - AT91C_US_CLKS_CLOCK ) - -//* Standard External Asynchronous Mode : 8 bits , 1 stop , no parity -#define AT91C_US_ASYNC_SCK_MODE ( AT91C_US_USMODE_NORMAL + \ - AT91C_US_NBSTOP_1_BIT + \ - AT91C_US_PAR_NONE + \ - AT91C_US_CHRL_8_BITS + \ - AT91C_US_CLKS_EXT ) - -//* Standard Synchronous Mode : 8 bits , 1 stop , no parity -#define AT91C_US_SYNC_MODE ( AT91C_US_SYNC + \ - AT91C_US_USMODE_NORMAL + \ - AT91C_US_NBSTOP_1_BIT + \ - AT91C_US_PAR_NONE + \ - AT91C_US_CHRL_8_BITS + \ - AT91C_US_CLKS_CLOCK ) - -//* SCK used Label -#define AT91C_US_SCK_USED (AT91C_US_CKLO | AT91C_US_CLKS_EXT) - -//* Standard ISO T=0 Mode : 8 bits , 1 stop , parity -#define AT91C_US_ISO_READER_MODE ( AT91C_US_USMODE_ISO7816_0 + \ - AT91C_US_CLKS_CLOCK +\ - AT91C_US_NBSTOP_1_BIT + \ - AT91C_US_PAR_EVEN + \ - AT91C_US_CHRL_8_BITS + \ - AT91C_US_CKLO +\ - AT91C_US_OVER) - -//* Standard IRDA mode -#define AT91C_US_ASYNC_IRDA_MODE ( AT91C_US_USMODE_IRDA + \ - AT91C_US_NBSTOP_1_BIT + \ - AT91C_US_PAR_NONE + \ - AT91C_US_CHRL_8_BITS + \ - AT91C_US_CLKS_CLOCK ) - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_Baudrate -//* \brief Caluculate baud_value according to the main clock and the baud rate -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_Baudrate ( - const unsigned int main_clock, // \arg peripheral clock - const unsigned int baud_rate) // \arg UART baudrate -{ - unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); - if ((baud_value % 10) >= 5) - baud_value = (baud_value / 10) + 1; - else - baud_value /= 10; - return baud_value; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_SetBaudrate -//* \brief Set the baudrate according to the CPU clock -//*---------------------------------------------------------------------------- -__inline void AT91F_US_SetBaudrate ( - AT91PS_USART pUSART, // \arg pointer to a USART controller - unsigned int mainClock, // \arg peripheral clock - unsigned int speed) // \arg UART baudrate -{ - //* Define the baud rate divisor register - pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_SetTimeguard -//* \brief Set USART timeguard -//*---------------------------------------------------------------------------- -__inline void AT91F_US_SetTimeguard ( - AT91PS_USART pUSART, // \arg pointer to a USART controller - unsigned int timeguard) // \arg timeguard value -{ - //* Write the Timeguard Register - pUSART->US_TTGR = timeguard ; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_EnableIt -//* \brief Enable USART IT -//*---------------------------------------------------------------------------- -__inline void AT91F_US_EnableIt ( - AT91PS_USART pUSART, // \arg pointer to a USART controller - unsigned int flag) // \arg IT to be enabled -{ - //* Write to the IER register - pUSART->US_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_DisableIt -//* \brief Disable USART IT -//*---------------------------------------------------------------------------- -__inline void AT91F_US_DisableIt ( - AT91PS_USART pUSART, // \arg pointer to a USART controller - unsigned int flag) // \arg IT to be disabled -{ - //* Write to the IER register - pUSART->US_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_Configure -//* \brief Configure USART -//*---------------------------------------------------------------------------- -__inline void AT91F_US_Configure ( - AT91PS_USART pUSART, // \arg pointer to a USART controller - unsigned int mainClock, // \arg peripheral clock - unsigned int mode , // \arg mode Register to be programmed - unsigned int baudRate , // \arg baudrate to be programmed - unsigned int timeguard ) // \arg timeguard to be programmed -{ - //* Disable interrupts - pUSART->US_IDR = (unsigned int) -1; - - //* Reset receiver and transmitter - pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS ; - - //* Define the baud rate divisor register - AT91F_US_SetBaudrate(pUSART, mainClock, baudRate); - - //* Write the Timeguard Register - AT91F_US_SetTimeguard(pUSART, timeguard); - - //* Clear Transmit and Receive Counters - AT91F_PDC_Open((AT91PS_PDC) &(pUSART->US_RPR)); - - //* Define the USART mode - pUSART->US_MR = mode ; - -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_EnableRx -//* \brief Enable receiving characters -//*---------------------------------------------------------------------------- -__inline void AT91F_US_EnableRx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Enable receiver - pUSART->US_CR = AT91C_US_RXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_EnableTx -//* \brief Enable sending characters -//*---------------------------------------------------------------------------- -__inline void AT91F_US_EnableTx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Enable transmitter - pUSART->US_CR = AT91C_US_TXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_ResetRx -//* \brief Reset Receiver and re-enable it -//*---------------------------------------------------------------------------- -__inline void AT91F_US_ResetRx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Reset receiver - pUSART->US_CR = AT91C_US_RSTRX; - //* Re-Enable receiver - pUSART->US_CR = AT91C_US_RXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_ResetTx -//* \brief Reset Transmitter and re-enable it -//*---------------------------------------------------------------------------- -__inline void AT91F_US_ResetTx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Reset transmitter - pUSART->US_CR = AT91C_US_RSTTX; - //* Enable transmitter - pUSART->US_CR = AT91C_US_TXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_DisableRx -//* \brief Disable Receiver -//*---------------------------------------------------------------------------- -__inline void AT91F_US_DisableRx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Disable receiver - pUSART->US_CR = AT91C_US_RXDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_DisableTx -//* \brief Disable Transmitter -//*---------------------------------------------------------------------------- -__inline void AT91F_US_DisableTx ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Disable transmitter - pUSART->US_CR = AT91C_US_TXDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_Close -//* \brief Close USART: disable IT disable receiver and transmitter, close PDC -//*---------------------------------------------------------------------------- -__inline void AT91F_US_Close ( - AT91PS_USART pUSART) // \arg pointer to a USART controller -{ - //* Reset the baud rate divisor register - pUSART->US_BRGR = 0 ; - - //* Reset the USART mode - pUSART->US_MR = 0 ; - - //* Reset the Timeguard Register - pUSART->US_TTGR = 0; - - //* Disable all interrupts - pUSART->US_IDR = 0xFFFFFFFF ; - - //* Abort the Peripheral Data Transfers - AT91F_PDC_Close((AT91PS_PDC) &(pUSART->US_RPR)); - - //* Disable receiver and transmitter and stop any activity immediately - pUSART->US_CR = AT91C_US_TXDIS | AT91C_US_RXDIS | AT91C_US_RSTTX | AT91C_US_RSTRX ; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_TxReady -//* \brief Return 1 if a character can be written in US_THR -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_TxReady ( - AT91PS_USART pUSART ) // \arg pointer to a USART controller -{ - return (pUSART->US_CSR & AT91C_US_TXRDY); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_RxReady -//* \brief Return 1 if a character can be read in US_RHR -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_RxReady ( - AT91PS_USART pUSART ) // \arg pointer to a USART controller -{ - return (pUSART->US_CSR & AT91C_US_RXRDY); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_Error -//* \brief Return the error flag -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_Error ( - AT91PS_USART pUSART ) // \arg pointer to a USART controller -{ - return (pUSART->US_CSR & - (AT91C_US_OVRE | // Overrun error - AT91C_US_FRAME | // Framing error - AT91C_US_PARE)); // Parity error -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_PutChar -//* \brief Send a character,does not check if ready to send -//*---------------------------------------------------------------------------- -__inline void AT91F_US_PutChar ( - AT91PS_USART pUSART, - int character ) -{ - pUSART->US_THR = (character & 0x1FF); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_GetChar -//* \brief Receive a character,does not check if a character is available -//*---------------------------------------------------------------------------- -__inline int AT91F_US_GetChar ( - const AT91PS_USART pUSART) -{ - return((pUSART->US_RHR) & 0x1FF); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_SendFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_SendFrame( - AT91PS_USART pUSART, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_SendFrame( - (AT91PS_PDC) &(pUSART->US_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_ReceiveFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_US_ReceiveFrame ( - AT91PS_USART pUSART, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_ReceiveFrame( - (AT91PS_PDC) &(pUSART->US_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US_SetIrdaFilter -//* \brief Set the value of IrDa filter tregister -//*---------------------------------------------------------------------------- -__inline void AT91F_US_SetIrdaFilter ( - AT91PS_USART pUSART, - unsigned char value -) -{ - pUSART->US_IF = value; -} - -/* ***************************************************************************** - SOFTWARE API FOR SSC - ***************************************************************************** */ -//* Define the standard I2S mode configuration - -//* Configuration to set in the SSC Transmit Clock Mode Register -//* Parameters : nb_bit_by_slot : 8, 16 or 32 bits -//* nb_slot_by_frame : number of channels -#define AT91C_I2S_ASY_MASTER_TX_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ - AT91C_SSC_CKS_DIV +\ - AT91C_SSC_CKO_CONTINOUS +\ - AT91C_SSC_CKG_NONE +\ - AT91C_SSC_START_FALL_RF +\ - AT91C_SSC_STTOUT +\ - ((1<<16) & AT91C_SSC_STTDLY) +\ - ((((nb_bit_by_slot*nb_slot_by_frame)/2)-1) <<24)) - - -//* Configuration to set in the SSC Transmit Frame Mode Register -//* Parameters : nb_bit_by_slot : 8, 16 or 32 bits -//* nb_slot_by_frame : number of channels -#define AT91C_I2S_ASY_TX_FRAME_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ - (nb_bit_by_slot-1) +\ - AT91C_SSC_MSBF +\ - (((nb_slot_by_frame-1)<<8) & AT91C_SSC_DATNB) +\ - (((nb_bit_by_slot-1)<<16) & AT91C_SSC_FSLEN) +\ - AT91C_SSC_FSOS_NEGATIVE) - - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_SetBaudrate -//* \brief Set the baudrate according to the CPU clock -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_SetBaudrate ( - AT91PS_SSC pSSC, // \arg pointer to a SSC controller - unsigned int mainClock, // \arg peripheral clock - unsigned int speed) // \arg SSC baudrate -{ - unsigned int baud_value; - //* Define the baud rate divisor register - if (speed == 0) - baud_value = 0; - else - { - baud_value = (unsigned int) (mainClock * 10)/(2*speed); - if ((baud_value % 10) >= 5) - baud_value = (baud_value / 10) + 1; - else - baud_value /= 10; - } - - pSSC->SSC_CMR = baud_value; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_Configure -//* \brief Configure SSC -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_Configure ( - AT91PS_SSC pSSC, // \arg pointer to a SSC controller - unsigned int syst_clock, // \arg System Clock Frequency - unsigned int baud_rate, // \arg Expected Baud Rate Frequency - unsigned int clock_rx, // \arg Receiver Clock Parameters - unsigned int mode_rx, // \arg mode Register to be programmed - unsigned int clock_tx, // \arg Transmitter Clock Parameters - unsigned int mode_tx) // \arg mode Register to be programmed -{ - //* Disable interrupts - pSSC->SSC_IDR = (unsigned int) -1; - - //* Reset receiver and transmitter - pSSC->SSC_CR = AT91C_SSC_SWRST | AT91C_SSC_RXDIS | AT91C_SSC_TXDIS ; - - //* Define the Clock Mode Register - AT91F_SSC_SetBaudrate(pSSC, syst_clock, baud_rate); - - //* Write the Receive Clock Mode Register - pSSC->SSC_RCMR = clock_rx; - - //* Write the Transmit Clock Mode Register - pSSC->SSC_TCMR = clock_tx; - - //* Write the Receive Frame Mode Register - pSSC->SSC_RFMR = mode_rx; - - //* Write the Transmit Frame Mode Register - pSSC->SSC_TFMR = mode_tx; - - //* Clear Transmit and Receive Counters - AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); - - -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_EnableRx -//* \brief Enable receiving datas -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_EnableRx ( - AT91PS_SSC pSSC) // \arg pointer to a SSC controller -{ - //* Enable receiver - pSSC->SSC_CR = AT91C_SSC_RXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_DisableRx -//* \brief Disable receiving datas -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_DisableRx ( - AT91PS_SSC pSSC) // \arg pointer to a SSC controller -{ - //* Disable receiver - pSSC->SSC_CR = AT91C_SSC_RXDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_EnableTx -//* \brief Enable sending datas -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_EnableTx ( - AT91PS_SSC pSSC) // \arg pointer to a SSC controller -{ - //* Enable transmitter - pSSC->SSC_CR = AT91C_SSC_TXEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_DisableTx -//* \brief Disable sending datas -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_DisableTx ( - AT91PS_SSC pSSC) // \arg pointer to a SSC controller -{ - //* Disable transmitter - pSSC->SSC_CR = AT91C_SSC_TXDIS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_EnableIt -//* \brief Enable SSC IT -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_EnableIt ( - AT91PS_SSC pSSC, // \arg pointer to a SSC controller - unsigned int flag) // \arg IT to be enabled -{ - //* Write to the IER register - pSSC->SSC_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_DisableIt -//* \brief Disable SSC IT -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_DisableIt ( - AT91PS_SSC pSSC, // \arg pointer to a SSC controller - unsigned int flag) // \arg IT to be disabled -{ - //* Write to the IDR register - pSSC->SSC_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_ReceiveFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initialized with Next Buffer, 0 if PDC is busy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SSC_ReceiveFrame ( - AT91PS_SSC pSSC, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_ReceiveFrame( - (AT91PS_PDC) &(pSSC->SSC_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_SendFrame -//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initialized with Next Buffer, 0 if PDC is busy -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SSC_SendFrame( - AT91PS_SSC pSSC, - char *pBuffer, - unsigned int szBuffer, - char *pNextBuffer, - unsigned int szNextBuffer ) -{ - return AT91F_PDC_SendFrame( - (AT91PS_PDC) &(pSSC->SSC_RPR), - pBuffer, - szBuffer, - pNextBuffer, - szNextBuffer); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_GetInterruptMaskStatus -//* \brief Return SSC Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Interrupt Mask Status - AT91PS_SSC pSsc) // \arg pointer to a SSC controller -{ - return pSsc->SSC_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_IsInterruptMasked -//* \brief Test if SSC Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_SSC_IsInterruptMasked( - AT91PS_SSC pSsc, // \arg pointer to a SSC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_SSC_GetInterruptMaskStatus(pSsc) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR TWI - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_EnableIt -//* \brief Enable TWI IT -//*---------------------------------------------------------------------------- -__inline void AT91F_TWI_EnableIt ( - AT91PS_TWI pTWI, // \arg pointer to a TWI controller - unsigned int flag) // \arg IT to be enabled -{ - //* Write to the IER register - pTWI->TWI_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_DisableIt -//* \brief Disable TWI IT -//*---------------------------------------------------------------------------- -__inline void AT91F_TWI_DisableIt ( - AT91PS_TWI pTWI, // \arg pointer to a TWI controller - unsigned int flag) // \arg IT to be disabled -{ - //* Write to the IDR register - pTWI->TWI_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_Configure -//* \brief Configure TWI in master mode -//*---------------------------------------------------------------------------- -__inline void AT91F_TWI_Configure ( AT91PS_TWI pTWI ) // \arg pointer to a TWI controller -{ - //* Disable interrupts - pTWI->TWI_IDR = (unsigned int) -1; - - //* Reset peripheral - pTWI->TWI_CR = AT91C_TWI_SWRST; - - //* Set Master mode - pTWI->TWI_CR = AT91C_TWI_MSEN; - -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_GetInterruptMaskStatus -//* \brief Return TWI Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_TWI_GetInterruptMaskStatus( // \return TWI Interrupt Mask Status - AT91PS_TWI pTwi) // \arg pointer to a TWI controller -{ - return pTwi->TWI_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_IsInterruptMasked -//* \brief Test if TWI Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_TWI_IsInterruptMasked( - AT91PS_TWI pTwi, // \arg pointer to a TWI controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_TWI_GetInterruptMaskStatus(pTwi) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR PWMC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_GetStatus -//* \brief Return PWM Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PWMC_GetStatus( // \return PWM Interrupt Status - AT91PS_PWMC pPWM) // pointer to a PWM controller -{ - return pPWM->PWMC_SR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_InterruptEnable -//* \brief Enable PWM Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_InterruptEnable( - AT91PS_PWMC pPwm, // \arg pointer to a PWM controller - unsigned int flag) // \arg PWM interrupt to be enabled -{ - pPwm->PWMC_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_InterruptDisable -//* \brief Disable PWM Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_InterruptDisable( - AT91PS_PWMC pPwm, // \arg pointer to a PWM controller - unsigned int flag) // \arg PWM interrupt to be disabled -{ - pPwm->PWMC_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_GetInterruptMaskStatus -//* \brief Return PWM Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PWMC_GetInterruptMaskStatus( // \return PWM Interrupt Mask Status - AT91PS_PWMC pPwm) // \arg pointer to a PWM controller -{ - return pPwm->PWMC_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_IsInterruptMasked -//* \brief Test if PWM Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PWMC_IsInterruptMasked( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PWMC_GetInterruptMaskStatus(pPWM) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_IsStatusSet -//* \brief Test if PWM Interrupt is Set -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_PWMC_IsStatusSet( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_PWMC_GetStatus(pPWM) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_CfgChannel -//* \brief Test if PWM Interrupt is Set -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CfgChannel( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int channelId, // \arg PWM channel ID - unsigned int mode, // \arg PWM mode - unsigned int period, // \arg PWM period - unsigned int duty) // \arg PWM duty cycle -{ - pPWM->PWMC_CH[channelId].PWMC_CMR = mode; - pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; - pPWM->PWMC_CH[channelId].PWMC_CPRDR = period; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_StartChannel -//* \brief Enable channel -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_StartChannel( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int flag) // \arg Channels IDs to be enabled -{ - pPWM->PWMC_ENA = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_StopChannel -//* \brief Disable channel -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_StopChannel( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int flag) // \arg Channels IDs to be enabled -{ - pPWM->PWMC_DIS = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWM_UpdateChannel -//* \brief Update Period or Duty Cycle -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_UpdateChannel( - AT91PS_PWMC pPWM, // \arg pointer to a PWM controller - unsigned int channelId, // \arg PWM channel ID - unsigned int update) // \arg Channels IDs to be enabled -{ - pPWM->PWMC_CH[channelId].PWMC_CUPDR = update; -} - -/* ***************************************************************************** - SOFTWARE API FOR UDP - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EnableIt -//* \brief Enable UDP IT -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EnableIt ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned int flag) // \arg IT to be enabled -{ - //* Write to the IER register - pUDP->UDP_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_DisableIt -//* \brief Disable UDP IT -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_DisableIt ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned int flag) // \arg IT to be disabled -{ - //* Write to the IDR register - pUDP->UDP_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_SetAddress -//* \brief Set UDP functional address -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_SetAddress ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char address) // \arg new UDP address -{ - pUDP->UDP_FADDR = (AT91C_UDP_FEN | address); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EnableEp -//* \brief Enable Endpoint -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EnableEp ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - pUDP->UDP_CSR[endpoint] |= AT91C_UDP_EPEDS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_DisableEp -//* \brief Enable Endpoint -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_DisableEp ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - pUDP->UDP_CSR[endpoint] &= ~AT91C_UDP_EPEDS; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_SetState -//* \brief Set UDP Device state -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_SetState ( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned int flag) // \arg new UDP address -{ - pUDP->UDP_GLBSTATE &= ~(AT91C_UDP_FADDEN | AT91C_UDP_CONFG); - pUDP->UDP_GLBSTATE |= flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_GetState -//* \brief return UDP Device state -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_UDP_GetState ( // \return the UDP device state - AT91PS_UDP pUDP) // \arg pointer to a UDP controller -{ - return (pUDP->UDP_GLBSTATE & (AT91C_UDP_FADDEN | AT91C_UDP_CONFG)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_ResetEp -//* \brief Reset UDP endpoint -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_ResetEp ( // \return the UDP device state - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned int flag) // \arg Endpoints to be reset -{ - pUDP->UDP_RSTEP = flag; - pUDP->UDP_RSTEP = 0; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpStall -//* \brief Endpoint will STALL requests -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EpStall( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - pUDP->UDP_CSR[endpoint] |= AT91C_UDP_FORCESTALL; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpWrite -//* \brief Write value in the DPR -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EpWrite( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint, // \arg endpoint number - unsigned char value) // \arg value to be written in the DPR -{ - pUDP->UDP_FDR[endpoint] = value; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpRead -//* \brief Return value from the DPR -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_UDP_EpRead( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - return pUDP->UDP_FDR[endpoint]; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpEndOfWr -//* \brief Notify the UDP that values in DPR are ready to be sent -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EpEndOfWr( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - pUDP->UDP_CSR[endpoint] |= AT91C_UDP_TXPKTRDY; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpClear -//* \brief Clear flag in the endpoint CSR register -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EpClear( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint, // \arg endpoint number - unsigned int flag) // \arg flag to be cleared -{ - pUDP->UDP_CSR[endpoint] &= ~(flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpSet -//* \brief Set flag in the endpoint CSR register -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_EpSet( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint, // \arg endpoint number - unsigned int flag) // \arg flag to be cleared -{ - pUDP->UDP_CSR[endpoint] |= flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_EpStatus -//* \brief Return the endpoint CSR register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_UDP_EpStatus( - AT91PS_UDP pUDP, // \arg pointer to a UDP controller - unsigned char endpoint) // \arg endpoint number -{ - return pUDP->UDP_CSR[endpoint]; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_GetInterruptMaskStatus -//* \brief Return UDP Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_UDP_GetInterruptMaskStatus( - AT91PS_UDP pUdp) // \arg pointer to a UDP controller -{ - return pUdp->UDP_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_IsInterruptMasked -//* \brief Test if UDP Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_UDP_IsInterruptMasked( - AT91PS_UDP pUdp, // \arg pointer to a UDP controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_UDP_GetInterruptMaskStatus(pUdp) & flag); -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_UDP_InterruptStatusRegister -// \brief Return the Interrupt Status Register -// ---------------------------------------------------------------------------- -__inline unsigned int AT91F_UDP_InterruptStatusRegister( - AT91PS_UDP pUDP ) // \arg pointer to a UDP controller -{ - return pUDP->UDP_ISR; -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_UDP_InterruptClearRegister -// \brief Clear Interrupt Register -// ---------------------------------------------------------------------------- -__inline void AT91F_UDP_InterruptClearRegister ( - AT91PS_UDP pUDP, // \arg pointer to UDP controller - unsigned int flag) // \arg IT to be cleat -{ - pUDP->UDP_ICR = flag; -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_UDP_EnableTransceiver -// \brief Enable transceiver -// ---------------------------------------------------------------------------- -__inline void AT91F_UDP_EnableTransceiver( - AT91PS_UDP pUDP ) // \arg pointer to a UDP controller -{ - pUDP->UDP_TXVC &= ~AT91C_UDP_TXVDIS; -} - -// ---------------------------------------------------------------------------- -// \fn AT91F_UDP_DisableTransceiver -// \brief Disable transceiver -// ---------------------------------------------------------------------------- -__inline void AT91F_UDP_DisableTransceiver( - AT91PS_UDP pUDP ) // \arg pointer to a UDP controller -{ - pUDP->UDP_TXVC = AT91C_UDP_TXVDIS; -} - -/* ***************************************************************************** - SOFTWARE API FOR TC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC_InterruptEnable -//* \brief Enable TC Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_TC_InterruptEnable( - AT91PS_TC pTc, // \arg pointer to a TC controller - unsigned int flag) // \arg TC interrupt to be enabled -{ - pTc->TC_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC_InterruptDisable -//* \brief Disable TC Interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_TC_InterruptDisable( - AT91PS_TC pTc, // \arg pointer to a TC controller - unsigned int flag) // \arg TC interrupt to be disabled -{ - pTc->TC_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC_GetInterruptMaskStatus -//* \brief Return TC Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_TC_GetInterruptMaskStatus( // \return TC Interrupt Mask Status - AT91PS_TC pTc) // \arg pointer to a TC controller -{ - return pTc->TC_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC_IsInterruptMasked -//* \brief Test if TC Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline int AT91F_TC_IsInterruptMasked( - AT91PS_TC pTc, // \arg pointer to a TC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_TC_GetInterruptMaskStatus(pTc) & flag); -} - -/* ***************************************************************************** - SOFTWARE API FOR CAN - ***************************************************************************** */ -#define STANDARD_FORMAT 0 -#define EXTENDED_FORMAT 1 - -//*---------------------------------------------------------------------------- -//* \fn AT91F_InitMailboxRegisters() -//* \brief Configure the corresponding mailbox -//*---------------------------------------------------------------------------- -__inline void AT91F_InitMailboxRegisters(AT91PS_CAN_MB CAN_Mailbox, - int mode_reg, - int acceptance_mask_reg, - int id_reg, - int data_low_reg, - int data_high_reg, - int control_reg) -{ - CAN_Mailbox->CAN_MB_MCR = 0x0; - CAN_Mailbox->CAN_MB_MMR = mode_reg; - CAN_Mailbox->CAN_MB_MAM = acceptance_mask_reg; - CAN_Mailbox->CAN_MB_MID = id_reg; - CAN_Mailbox->CAN_MB_MDL = data_low_reg; - CAN_Mailbox->CAN_MB_MDH = data_high_reg; - CAN_Mailbox->CAN_MB_MCR = control_reg; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_EnableCAN() -//* \brief -//*---------------------------------------------------------------------------- -__inline void AT91F_EnableCAN( - AT91PS_CAN pCAN) // pointer to a CAN controller -{ - pCAN->CAN_MR |= AT91C_CAN_CANEN; - - // Wait for WAKEUP flag raising <=> 11-recessive-bit were scanned by the transceiver - while( (pCAN->CAN_SR & AT91C_CAN_WAKEUP) != AT91C_CAN_WAKEUP ); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DisableCAN() -//* \brief -//*---------------------------------------------------------------------------- -__inline void AT91F_DisableCAN( - AT91PS_CAN pCAN) // pointer to a CAN controller -{ - pCAN->CAN_MR &= ~AT91C_CAN_CANEN; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_EnableIt -//* \brief Enable CAN interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_EnableIt ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int flag) // IT to be enabled -{ - //* Write to the IER register - pCAN->CAN_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_DisableIt -//* \brief Disable CAN interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_DisableIt ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int flag) // IT to be disabled -{ - //* Write to the IDR register - pCAN->CAN_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetStatus -//* \brief Return CAN Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetStatus( // \return CAN Interrupt Status - AT91PS_CAN pCAN) // pointer to a CAN controller -{ - return pCAN->CAN_SR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetInterruptMaskStatus -//* \brief Return CAN Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetInterruptMaskStatus( // \return CAN Interrupt Mask Status - AT91PS_CAN pCAN) // pointer to a CAN controller -{ - return pCAN->CAN_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_IsInterruptMasked -//* \brief Test if CAN Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_IsInterruptMasked( - AT91PS_CAN pCAN, // \arg pointer to a CAN controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_CAN_GetInterruptMaskStatus(pCAN) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_IsStatusSet -//* \brief Test if CAN Interrupt is Set -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_IsStatusSet( - AT91PS_CAN pCAN, // \arg pointer to a CAN controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_CAN_GetStatus(pCAN) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgModeReg -//* \brief Configure the Mode Register of the CAN controller -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgModeReg ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int mode) // mode register -{ - //* Write to the MR register - pCAN->CAN_MR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetModeReg -//* \brief Return the Mode Register of the CAN controller value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetModeReg ( - AT91PS_CAN pCAN // pointer to a CAN controller - ) -{ - return pCAN->CAN_MR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgBaudrateReg -//* \brief Configure the Baudrate of the CAN controller for the network -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgBaudrateReg ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int baudrate_cfg) -{ - //* Write to the BR register - pCAN->CAN_BR = baudrate_cfg; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetBaudrate -//* \brief Return the Baudrate of the CAN controller for the network value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetBaudrate ( - AT91PS_CAN pCAN // pointer to a CAN controller - ) -{ - return pCAN->CAN_BR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetInternalCounter -//* \brief Return CAN Timer Regsiter Value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetInternalCounter ( - AT91PS_CAN pCAN // pointer to a CAN controller - ) -{ - return pCAN->CAN_TIM; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetTimestamp -//* \brief Return CAN Timestamp Register Value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetTimestamp ( - AT91PS_CAN pCAN // pointer to a CAN controller - ) -{ - return pCAN->CAN_TIMESTP; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetErrorCounter -//* \brief Return CAN Error Counter Register Value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetErrorCounter ( - AT91PS_CAN pCAN // pointer to a CAN controller - ) -{ - return pCAN->CAN_ECR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_InitTransferRequest -//* \brief Request for a transfer on the corresponding mailboxes -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_InitTransferRequest ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int transfer_cmd) -{ - pCAN->CAN_TCR = transfer_cmd; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_InitAbortRequest -//* \brief Abort the corresponding mailboxes -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_InitAbortRequest ( - AT91PS_CAN pCAN, // pointer to a CAN controller - unsigned int abort_cmd) -{ - pCAN->CAN_ACR = abort_cmd; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageModeReg -//* \brief Program the Message Mode Register -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageModeReg ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int mode) -{ - CAN_Mailbox->CAN_MB_MMR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageModeReg -//* \brief Return the Message Mode Register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageModeReg ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageIDReg -//* \brief Program the Message ID Register -//* \brief Version == 0 for Standard messsage, Version == 1 for Extended -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageIDReg ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int id, - unsigned char version) -{ - if(version==0) // IDvA Standard Format - CAN_Mailbox->CAN_MB_MID = id<<18; - else // IDvB Extended Format - CAN_Mailbox->CAN_MB_MID = id | (1<<29); // set MIDE bit -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageIDReg -//* \brief Return the Message ID Register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageIDReg ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MID; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageAcceptanceMaskReg -//* \brief Program the Message Acceptance Mask Register -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageAcceptanceMaskReg ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int mask) -{ - CAN_Mailbox->CAN_MB_MAM = mask; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageAcceptanceMaskReg -//* \brief Return the Message Acceptance Mask Register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageAcceptanceMaskReg ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MAM; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetFamilyID -//* \brief Return the Message ID Register -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetFamilyID ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MFID; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageCtrl -//* \brief Request and config for a transfer on the corresponding mailbox -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageCtrlReg ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int message_ctrl_cmd) -{ - CAN_Mailbox->CAN_MB_MCR = message_ctrl_cmd; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageStatus -//* \brief Return CAN Mailbox Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageStatus ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageDataLow -//* \brief Program data low value -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageDataLow ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int data) -{ - CAN_Mailbox->CAN_MB_MDL = data; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageDataLow -//* \brief Return data low value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageDataLow ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MDL; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgMessageDataHigh -//* \brief Program data high value -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgMessageDataHigh ( - AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox - unsigned int data) -{ - CAN_Mailbox->CAN_MB_MDH = data; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_GetMessageDataHigh -//* \brief Return data high value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_CAN_GetMessageDataHigh ( - AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox -{ - return CAN_Mailbox->CAN_MB_MDH; -} - -/* ***************************************************************************** - SOFTWARE API FOR ADC - ***************************************************************************** */ -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_EnableIt -//* \brief Enable ADC interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_EnableIt ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int flag) // IT to be enabled -{ - //* Write to the IER register - pADC->ADC_IER = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_DisableIt -//* \brief Disable ADC interrupt -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_DisableIt ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int flag) // IT to be disabled -{ - //* Write to the IDR register - pADC->ADC_IDR = flag; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetStatus -//* \brief Return ADC Interrupt Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetStatus( // \return ADC Interrupt Status - AT91PS_ADC pADC) // pointer to a ADC controller -{ - return pADC->ADC_SR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetInterruptMaskStatus -//* \brief Return ADC Interrupt Mask Status -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetInterruptMaskStatus( // \return ADC Interrupt Mask Status - AT91PS_ADC pADC) // pointer to a ADC controller -{ - return pADC->ADC_IMR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_IsInterruptMasked -//* \brief Test if ADC Interrupt is Masked -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_IsInterruptMasked( - AT91PS_ADC pADC, // \arg pointer to a ADC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_ADC_GetInterruptMaskStatus(pADC) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_IsStatusSet -//* \brief Test if ADC Status is Set -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_IsStatusSet( - AT91PS_ADC pADC, // \arg pointer to a ADC controller - unsigned int flag) // \arg flag to be tested -{ - return (AT91F_ADC_GetStatus(pADC) & flag); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_CfgModeReg -//* \brief Configure the Mode Register of the ADC controller -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_CfgModeReg ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int mode) // mode register -{ - //* Write to the MR register - pADC->ADC_MR = mode; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetModeReg -//* \brief Return the Mode Register of the ADC controller value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetModeReg ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_MR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_CfgTimings -//* \brief Configure the different necessary timings of the ADC controller -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_CfgTimings ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int mck_clock, // in MHz - unsigned int adc_clock, // in MHz - unsigned int startup_time, // in us - unsigned int sample_and_hold_time) // in ns -{ - unsigned int prescal,startup,shtim; - - prescal = mck_clock/(2*adc_clock) - 1; - startup = adc_clock*startup_time/8 - 1; - shtim = adc_clock*sample_and_hold_time/1000 - 1; - - //* Write to the MR register - pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_EnableChannel -//* \brief Return ADC Timer Register Value -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_EnableChannel ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int channel) // mode register -{ - //* Write to the CHER register - pADC->ADC_CHER = channel; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_DisableChannel -//* \brief Return ADC Timer Register Value -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_DisableChannel ( - AT91PS_ADC pADC, // pointer to a ADC controller - unsigned int channel) // mode register -{ - //* Write to the CHDR register - pADC->ADC_CHDR = channel; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetChannelStatus -//* \brief Return ADC Timer Register Value -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetChannelStatus ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CHSR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_StartConversion -//* \brief Software request for a analog to digital conversion -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_StartConversion ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - pADC->ADC_CR = AT91C_ADC_START; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_SoftReset -//* \brief Software reset -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_SoftReset ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - pADC->ADC_CR = AT91C_ADC_SWRST; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetLastConvertedData -//* \brief Return the Last Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetLastConvertedData ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_LCDR; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH0 -//* \brief Return the Channel 0 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH0 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR0; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH1 -//* \brief Return the Channel 1 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH1 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR1; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH2 -//* \brief Return the Channel 2 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH2 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR2; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH3 -//* \brief Return the Channel 3 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH3 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR3; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH4 -//* \brief Return the Channel 4 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH4 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR4; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH5 -//* \brief Return the Channel 5 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH5 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR5; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH6 -//* \brief Return the Channel 6 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH6 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR6; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_GetConvertedDataCH7 -//* \brief Return the Channel 7 Converted Data -//*---------------------------------------------------------------------------- -__inline unsigned int AT91F_ADC_GetConvertedDataCH7 ( - AT91PS_ADC pADC // pointer to a ADC controller - ) -{ - return pADC->ADC_CDR7; -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_MC_CfgPMC -//* \brief Enable Peripheral clock in PMC for MC -//*---------------------------------------------------------------------------- -__inline void AT91F_MC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_CfgPMC -//* \brief Enable Peripheral clock in PMC for DBGU -//*---------------------------------------------------------------------------- -__inline void AT91F_DBGU_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_DBGU_CfgPIO -//* \brief Configure PIO controllers to drive DBGU signals -//*---------------------------------------------------------------------------- -__inline void AT91F_DBGU_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA28_DTXD ) | - ((unsigned int) AT91C_PA27_DRXD ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWMC_CH3_CfgPIO -//* \brief Configure PIO controllers to drive PWMC_CH3 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CH3_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB22_PWM3 ), // Peripheral A - ((unsigned int) AT91C_PB30_PWM3 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWMC_CH2_CfgPIO -//* \brief Configure PIO controllers to drive PWMC_CH2 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CH2_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB21_PWM2 ), // Peripheral A - ((unsigned int) AT91C_PB29_PWM2 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWMC_CH1_CfgPIO -//* \brief Configure PIO controllers to drive PWMC_CH1 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CH1_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB20_PWM1 ), // Peripheral A - ((unsigned int) AT91C_PB28_PWM1 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWMC_CH0_CfgPIO -//* \brief Configure PIO controllers to drive PWMC_CH0 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CH0_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB19_PWM0 ), // Peripheral A - ((unsigned int) AT91C_PB27_PWM0 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_EMAC_CfgPMC -//* \brief Enable Peripheral clock in PMC for EMAC -//*---------------------------------------------------------------------------- -__inline void AT91F_EMAC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_EMAC)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_EMAC_CfgPIO -//* \brief Configure PIO controllers to drive EMAC signals -//*---------------------------------------------------------------------------- -__inline void AT91F_EMAC_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB9_EMDIO ) | - ((unsigned int) AT91C_PB17_ERXCK ) | - ((unsigned int) AT91C_PB15_ERXDV_ECRSDV) | - ((unsigned int) AT91C_PB8_EMDC ) | - ((unsigned int) AT91C_PB16_ECOL ) | - ((unsigned int) AT91C_PB7_ERXER ) | - ((unsigned int) AT91C_PB5_ERX0 ) | - ((unsigned int) AT91C_PB6_ERX1 ) | - ((unsigned int) AT91C_PB13_ERX2 ) | - ((unsigned int) AT91C_PB1_ETXEN ) | - ((unsigned int) AT91C_PB14_ERX3 ) | - ((unsigned int) AT91C_PB12_ETXER ) | - ((unsigned int) AT91C_PB2_ETX0 ) | - ((unsigned int) AT91C_PB3_ETX1 ) | - ((unsigned int) AT91C_PB10_ETX2 ) | - ((unsigned int) AT91C_PB18_EF100 ) | - ((unsigned int) AT91C_PB11_ETX3 ) | - ((unsigned int) AT91C_PB4_ECRS ) | - ((unsigned int) AT91C_PB0_ETXCK_EREFCK), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_VREG_CfgPMC -//* \brief Enable Peripheral clock in PMC for VREG -//*---------------------------------------------------------------------------- -__inline void AT91F_VREG_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_CfgPMC -//* \brief Enable Peripheral clock in PMC for SSC -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SSC)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SSC_CfgPIO -//* \brief Configure PIO controllers to drive SSC signals -//*---------------------------------------------------------------------------- -__inline void AT91F_SSC_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA23_TD ) | - ((unsigned int) AT91C_PA21_TF ) | - ((unsigned int) AT91C_PA25_RK ) | - ((unsigned int) AT91C_PA24_RD ) | - ((unsigned int) AT91C_PA26_RF ) | - ((unsigned int) AT91C_PA22_TK ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI1_CfgPMC -//* \brief Enable Peripheral clock in PMC for SPI1 -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI1_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SPI1)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI1_CfgPIO -//* \brief Configure PIO controllers to drive SPI1 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI1_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PA23_SPI1_MOSI) | - ((unsigned int) AT91C_PA21_SPI1_NPCS0) | - ((unsigned int) AT91C_PA25_SPI1_NPCS1) | - ((unsigned int) AT91C_PA2_SPI1_NPCS1) | - ((unsigned int) AT91C_PA24_SPI1_MISO) | - ((unsigned int) AT91C_PA22_SPI1_SPCK) | - ((unsigned int) AT91C_PA26_SPI1_NPCS2) | - ((unsigned int) AT91C_PA3_SPI1_NPCS2) | - ((unsigned int) AT91C_PA29_SPI1_NPCS3) | - ((unsigned int) AT91C_PA4_SPI1_NPCS3)); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PB10_SPI1_NPCS1) | - ((unsigned int) AT91C_PB11_SPI1_NPCS2) | - ((unsigned int) AT91C_PB16_SPI1_NPCS3)); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI0_CfgPMC -//* \brief Enable Peripheral clock in PMC for SPI0 -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI0_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SPI0)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_SPI0_CfgPIO -//* \brief Configure PIO controllers to drive SPI0 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_SPI0_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA17_SPI0_MOSI) | - ((unsigned int) AT91C_PA12_SPI0_NPCS0) | - ((unsigned int) AT91C_PA13_SPI0_NPCS1) | - ((unsigned int) AT91C_PA16_SPI0_MISO) | - ((unsigned int) AT91C_PA14_SPI0_NPCS2) | - ((unsigned int) AT91C_PA18_SPI0_SPCK) | - ((unsigned int) AT91C_PA15_SPI0_NPCS3), // Peripheral A - ((unsigned int) AT91C_PA7_SPI0_NPCS1) | - ((unsigned int) AT91C_PA8_SPI0_NPCS2) | - ((unsigned int) AT91C_PA9_SPI0_NPCS3)); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PB13_SPI0_NPCS1) | - ((unsigned int) AT91C_PB14_SPI0_NPCS2) | - ((unsigned int) AT91C_PB17_SPI0_NPCS3)); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PWMC_CfgPMC -//* \brief Enable Peripheral clock in PMC for PWMC -//*---------------------------------------------------------------------------- -__inline void AT91F_PWMC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_PWMC)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC0_CfgPMC -//* \brief Enable Peripheral clock in PMC for TC0 -//*---------------------------------------------------------------------------- -__inline void AT91F_TC0_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_TC0)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC0_CfgPIO -//* \brief Configure PIO controllers to drive TC0 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_TC0_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB23_TIOA0 ) | - ((unsigned int) AT91C_PB24_TIOB0 ), // Peripheral A - ((unsigned int) AT91C_PB12_TCLK0 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC1_CfgPMC -//* \brief Enable Peripheral clock in PMC for TC1 -//*---------------------------------------------------------------------------- -__inline void AT91F_TC1_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_TC1)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC1_CfgPIO -//* \brief Configure PIO controllers to drive TC1 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_TC1_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB25_TIOA1 ) | - ((unsigned int) AT91C_PB26_TIOB1 ), // Peripheral A - ((unsigned int) AT91C_PB19_TCLK1 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC2_CfgPMC -//* \brief Enable Peripheral clock in PMC for TC2 -//*---------------------------------------------------------------------------- -__inline void AT91F_TC2_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_TC2)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TC2_CfgPIO -//* \brief Configure PIO controllers to drive TC2 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_TC2_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PA15_TCLK2 )); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB27_TIOA2 ) | - ((unsigned int) AT91C_PB28_TIOB2 ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PITC_CfgPMC -//* \brief Enable Peripheral clock in PMC for PITC -//*---------------------------------------------------------------------------- -__inline void AT91F_PITC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_CfgPMC -//* \brief Enable Peripheral clock in PMC for ADC -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_ADC)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_ADC_CfgPIO -//* \brief Configure PIO controllers to drive ADC signals -//*---------------------------------------------------------------------------- -__inline void AT91F_ADC_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PB18_ADTRG )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_CfgPMC -//* \brief Enable Peripheral clock in PMC for PMC -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PMC_CfgPIO -//* \brief Configure PIO controllers to drive PMC signals -//*---------------------------------------------------------------------------- -__inline void AT91F_PMC_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PA13_PCK1 ) | - ((unsigned int) AT91C_PA30_PCK2 ) | - ((unsigned int) AT91C_PA27_PCK3 )); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - ((unsigned int) AT91C_PB29_PCK1 ) | - ((unsigned int) AT91C_PB30_PCK2 ), // Peripheral A - ((unsigned int) AT91C_PB21_PCK1 ) | - ((unsigned int) AT91C_PB22_PCK2 ) | - ((unsigned int) AT91C_PB20_PCK0 ) | - ((unsigned int) AT91C_PB0_PCK0 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RSTC_CfgPMC -//* \brief Enable Peripheral clock in PMC for RSTC -//*---------------------------------------------------------------------------- -__inline void AT91F_RSTC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_RTTC_CfgPMC -//* \brief Enable Peripheral clock in PMC for RTTC -//*---------------------------------------------------------------------------- -__inline void AT91F_RTTC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIOA_CfgPMC -//* \brief Enable Peripheral clock in PMC for PIOA -//*---------------------------------------------------------------------------- -__inline void AT91F_PIOA_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_PIOA)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_PIOB_CfgPMC -//* \brief Enable Peripheral clock in PMC for PIOB -//*---------------------------------------------------------------------------- -__inline void AT91F_PIOB_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_PIOB)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_CfgPMC -//* \brief Enable Peripheral clock in PMC for TWI -//*---------------------------------------------------------------------------- -__inline void AT91F_TWI_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_TWI)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_TWI_CfgPIO -//* \brief Configure PIO controllers to drive TWI signals -//*---------------------------------------------------------------------------- -__inline void AT91F_TWI_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA10_TWD ) | - ((unsigned int) AT91C_PA11_TWCK ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_WDTC_CfgPMC -//* \brief Enable Peripheral clock in PMC for WDTC -//*---------------------------------------------------------------------------- -__inline void AT91F_WDTC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_SYS)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US1_CfgPMC -//* \brief Enable Peripheral clock in PMC for US1 -//*---------------------------------------------------------------------------- -__inline void AT91F_US1_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_US1)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US1_CfgPIO -//* \brief Configure PIO controllers to drive US1 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_US1_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA5_RXD1 ) | - ((unsigned int) AT91C_PA6_TXD1 ) | - ((unsigned int) AT91C_PA8_RTS1 ) | - ((unsigned int) AT91C_PA7_SCK1 ) | - ((unsigned int) AT91C_PA9_CTS1 ), // Peripheral A - 0); // Peripheral B - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOB, // PIO controller base address - 0, // Peripheral A - ((unsigned int) AT91C_PB25_DTR1 ) | - ((unsigned int) AT91C_PB23_DCD1 ) | - ((unsigned int) AT91C_PB24_DSR1 ) | - ((unsigned int) AT91C_PB26_RI1 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US0_CfgPMC -//* \brief Enable Peripheral clock in PMC for US0 -//*---------------------------------------------------------------------------- -__inline void AT91F_US0_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_US0)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_US0_CfgPIO -//* \brief Configure PIO controllers to drive US0 signals -//*---------------------------------------------------------------------------- -__inline void AT91F_US0_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA0_RXD0 ) | - ((unsigned int) AT91C_PA1_TXD0 ) | - ((unsigned int) AT91C_PA3_RTS0 ) | - ((unsigned int) AT91C_PA2_SCK0 ) | - ((unsigned int) AT91C_PA4_CTS0 ), // Peripheral A - 0); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_UDP_CfgPMC -//* \brief Enable Peripheral clock in PMC for UDP -//*---------------------------------------------------------------------------- -__inline void AT91F_UDP_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_UDP)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_CfgPMC -//* \brief Enable Peripheral clock in PMC for AIC -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_IRQ0) | - ((unsigned int) 1 << AT91C_ID_FIQ) | - ((unsigned int) 1 << AT91C_ID_IRQ1)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_AIC_CfgPIO -//* \brief Configure PIO controllers to drive AIC signals -//*---------------------------------------------------------------------------- -__inline void AT91F_AIC_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA30_IRQ0 ) | - ((unsigned int) AT91C_PA29_FIQ ), // Peripheral A - ((unsigned int) AT91C_PA14_IRQ1 )); // Peripheral B -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgPMC -//* \brief Enable Peripheral clock in PMC for CAN -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgPMC (void) -{ - AT91F_PMC_EnablePeriphClock( - AT91C_BASE_PMC, // PIO controller base address - ((unsigned int) 1 << AT91C_ID_CAN)); -} - -//*---------------------------------------------------------------------------- -//* \fn AT91F_CAN_CfgPIO -//* \brief Configure PIO controllers to drive CAN signals -//*---------------------------------------------------------------------------- -__inline void AT91F_CAN_CfgPIO (void) -{ - // Configure PIO controllers to periph mode - AT91F_PIO_CfgPeriph( - AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA20_CANTX ) | - ((unsigned int) AT91C_PA19_CANRX ), // Peripheral A - 0); // Peripheral B -} - -#endif // lib_AT91SAM7X256_H diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/project.h b/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/project.h deleted file mode 100644 index 24fb698d3..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/project.h +++ /dev/null @@ -1,30 +0,0 @@ -//----------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -//----------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : project.h -// Object : project specific include file to AT91SAM7X256 -// Creation : JPP 14-Sep-2006 -//----------------------------------------------------------------------------- -#ifndef _PROJECT_H -#define _PROJECT_H - -/// Include your AT91 Library files and specific compiler definitions - -#include -#include "AT91SAM7X-EK.h" -#include "AT91SAM7X256.h" -#define __inline inline -#include "lib_AT91SAM7X256.h" - -#endif // _PROJECT_H diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat b/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat deleted file mode 100644 index aa07e50c6..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat +++ /dev/null @@ -1,33 +0,0 @@ -@REM This bat file has been generated by the IAR Embeddded Workbench -@REM C-SPY interactive debugger,as an aid to preparing a command -@REM line for running the cspybat command line utility with the -@REM appropriate settings. -@REM -@REM After making some adjustments to this file, you can launch cspybat -@REM by typing the name of this file followed by the name of the debug -@REM file (usually an ubrof file). Note that this file is generated -@REM every time a new debug session is initialized, so you may want to -@REM move or rename the file before making changes. -@REM -@REM Note: some command line arguments cannot be properly generated -@REM by this process. Specifically, the plugin which is responsible -@REM for the Terminal I/O window (and other C runtime functionality) -@REM comes in a special version for cspybat, and the name of that -@REM plugin dll is not known when generating this file. It resides in -@REM the $TOOLKIT_DIR$\bin folder and is usually called XXXbat.dll or -@REM XXXlibsupportbat.dll, where XXX is the name of the corresponding -@REM tool chain. Replace the '' parameter -@REM below with the appropriate file name. Other plugins loaded by -@REM C-SPY are usually not needed by, or will not work in, cspybat -@REM but they are listed at the end of this file for reference. - - -"C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armproc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armjlink.dll" %1 --plugin "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\" --macro "C:\Documents and Settings\Greg\Desktop\SAM7X256\AT91SAM7X-Interrupt_SAM7X\Compil\resource\SAM7_FLASH.mac" --backend -B "--endian=little" "--cpu=ARM7TDMI" "--fpu=None" "-p" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\CONFIG\debugger\Atmel\ioAT91SAM7X256.ddf" "--drv_verify_download" "--semihosting" "--device=AT91SAM7X256" "-d" "jlink" "--drv_communication=USB0" "--jlink_speed=adaptive" - - -@REM Loaded plugins: -@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armlibsupport.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\CodeCoverage\CodeCoverage.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\Profiling\Profiling.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\stack\stack.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\SymList\SymList.dll diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt b/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt deleted file mode 100644 index 33f4649c2..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dni b/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dni deleted file mode 100644 index bc8e3f96d..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dni +++ /dev/null @@ -1,18 +0,0 @@ -[JLinkDriver] -WatchCond=_ 0 -Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 -Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 -[TermIOLog] -LoggingEnabled=_ 0 -LogFile=_ "" -[Log file] -LoggingEnabled=_ 0 -LogFile=_ "" -Category=_ 0 -[Disassemble mode] -mode=0 -[Breakpoints] -Count=0 -[TraceHelper] -Enabled=0 -ShowSource=1 diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.wsdt b/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.wsdt deleted file mode 100644 index 39488f056..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.wsdt +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - BasicInterrupt_SAM7X/FLASH_Debug - - - - - - - - - 271272727 - - - 20 - 995 - 265 - 66 - - - - - - - - - - - TabID-26686-579 - Workspace - Workspace - - - BasicInterrupt_SAM7X - - - - 0 - - - TabID-13847-615 - Build - Build - - - - TabID-20936-687 - Debug Log - Debug-Log - - - - - 1 - - - - - - 0100000010000001 - - - - - - - iaridepm.enu1-2-2612345-2-2200200144300234192250361718970-2-21981388-2-213902001002886234192144300234192 - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink b/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink deleted file mode 100644 index ecbb0a811..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink +++ /dev/null @@ -1,12 +0,0 @@ -[FLASH] -SkipProgOnCRCMatch = 1 -VerifyDownload = 1 -AllowCaching = 1 -EnableFlashDL = 2 -Override = 0 -Device="ADUC7020X62" -[BREAKPOINTS] -ShowInfoWin = 1 -EnableFlashBP = 2 -[CPU] -AllowSimulation = 1 diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.cspy.bat b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.cspy.bat deleted file mode 100644 index 0e4d17756..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.cspy.bat +++ /dev/null @@ -1,33 +0,0 @@ -@REM This bat file has been generated by the IAR Embeddded Workbench -@REM C-SPY interactive debugger,as an aid to preparing a command -@REM line for running the cspybat command line utility with the -@REM appropriate settings. -@REM -@REM After making some adjustments to this file, you can launch cspybat -@REM by typing the name of this file followed by the name of the debug -@REM file (usually an ubrof file). Note that this file is generated -@REM every time a new debug session is initialized, so you may want to -@REM move or rename the file before making changes. -@REM -@REM Note: some command line arguments cannot be properly generated -@REM by this process. Specifically, the plugin which is responsible -@REM for the Terminal I/O window (and other C runtime functionality) -@REM comes in a special version for cspybat, and the name of that -@REM plugin dll is not known when generating this file. It resides in -@REM the $TOOLKIT_DIR$\bin folder and is usually called XXXbat.dll or -@REM XXXlibsupportbat.dll, where XXX is the name of the corresponding -@REM tool chain. Replace the '' parameter -@REM below with the appropriate file name. Other plugins loaded by -@REM C-SPY are usually not needed by, or will not work in, cspybat -@REM but they are listed at the end of this file for reference. - - -"C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armproc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armjlink.dll" %1 --plugin "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\" --macro "C:\svn\cmock\iar\iar_v5\Resource\SAM7_RAM.mac" --backend -B "--endian=little" "--cpu=ARM7TDMI" "--fpu=None" "-p" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\CONFIG\debugger\Atmel\ioAT91SAM7X256.ddf" "--drv_verify_download" "--semihosting" "--device=AT91SAM7X256" "-d" "jlink" "--drv_communication=USB0" "--jlink_speed=adaptive" - - -@REM Loaded plugins: -@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armlibsupport.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\CodeCoverage\CodeCoverage.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\Profiling\Profiling.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\stack\stack.dll -@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\SymList\SymList.dll diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dbgdt b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dbgdt deleted file mode 100644 index 75a616f19..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dbgdt +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - 20 - 995 - 265 - 66 - - - - - - - - 124272727 - - - - - 10 - - - - - - - - - TabID-27249-27051 - Debug Log - Debug-Log - - - - TabID-4707-27064 - Build - Build - - - - - 0 - - - TabID-5230-27054 - Workspace - Workspace - - - cmock_demo - - - - 0 - - - TabID-15978-27058 - Disassembly - Disassembly - - - - - 0 - - - - - - TextEditorC:\svn\cmock\examples\src\Main.c0258358350TextEditorC:\svn\cmock\examples\src\TaskScheduler.c0439819810100000010000001 - - - - - - - iaridepm.enu1debuggergui.enu1-2-2588198-2-2200200144300234192144300690867-2-2588198-2-2200200144300234192144300690867-2-21981388-2-213902001002886234192144300234192 - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dni b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dni deleted file mode 100644 index 4ec3ceeab..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dni +++ /dev/null @@ -1,44 +0,0 @@ -[JLinkDriver] -WatchCond=_ 0 -Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 -Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 -[DisAssemblyWindow] -NumStates=_ 1 -State 1=_ 1 -[CodeCoverage] -Enabled=_ 0 -[Profiling] -Enabled=0 -[StackPlugin] -Enabled=1 -OverflowWarningsEnabled=1 -WarningThreshold=90 -SpWarningsEnabled=1 -WarnHow=0 -UseTrigger=1 -TriggerName=main -LimitSize=0 -ByteLimit=50 -[Interrupts] -Enabled=1 -[MemoryMap] -Enabled=0 -Base=0 -UseAuto=0 -TypeViolation=1 -UnspecRange=1 -ActionState=1 -[Log file] -LoggingEnabled=_ 0 -LogFile=_ "" -Category=_ 0 -[TermIOLog] -LoggingEnabled=_ 0 -LogFile=_ "" -[Disassemble mode] -mode=0 -[Breakpoints] -Count=0 -[TraceHelper] -Enabled=0 -ShowSource=1 diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.wsdt b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.wsdt deleted file mode 100644 index 3bfdc76bf..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.wsdt +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - cmock_demo/RAM_Debug - - - - - - - - 2099526566 - - - - - - - 216272727 - - - - - - - - - - TabID-7530-24964 - Build - Build - - - - TabID-25388-26881 - Debug Log - Debug-Log - - - - - 0 - - - TabID-18278-24968 - Workspace - Workspace - - - cmock_democmock_demo/Sourcecmock_demo/srccmock_demo/srcIAR - - - - 0 - - - - - - TextEditorC:\svn\cmock\examples\src\Main.c02582082000100000010000001 - - - - - - - iaridepm.enu1-2-2513307-2-2200200144300234192222944603044-2-22971388-2-213902991002886350117144300234192 - - - - diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_Binary.jlink b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_Binary.jlink deleted file mode 100644 index ecbb0a811..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_Binary.jlink +++ /dev/null @@ -1,12 +0,0 @@ -[FLASH] -SkipProgOnCRCMatch = 1 -VerifyDownload = 1 -AllowCaching = 1 -EnableFlashDL = 2 -Override = 0 -Device="ADUC7020X62" -[BREAKPOINTS] -ShowInfoWin = 1 -EnableFlashBP = 2 -[CPU] -AllowSimulation = 1 diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_FLASH_Debug.jlink b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_FLASH_Debug.jlink deleted file mode 100644 index ecbb0a811..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_FLASH_Debug.jlink +++ /dev/null @@ -1,12 +0,0 @@ -[FLASH] -SkipProgOnCRCMatch = 1 -VerifyDownload = 1 -AllowCaching = 1 -EnableFlashDL = 2 -Override = 0 -Device="ADUC7020X62" -[BREAKPOINTS] -ShowInfoWin = 1 -EnableFlashBP = 2 -[CPU] -AllowSimulation = 1 diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_RAM_Debug.jlink b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_RAM_Debug.jlink deleted file mode 100644 index ecbb0a811..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_RAM_Debug.jlink +++ /dev/null @@ -1,12 +0,0 @@ -[FLASH] -SkipProgOnCRCMatch = 1 -VerifyDownload = 1 -AllowCaching = 1 -EnableFlashDL = 2 -Override = 0 -Device="ADUC7020X62" -[BREAKPOINTS] -ShowInfoWin = 1 -EnableFlashBP = 2 -[CPU] -AllowSimulation = 1 diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup.s b/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup.s deleted file mode 100644 index 7113c8035..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup.s +++ /dev/null @@ -1,299 +0,0 @@ -;* ---------------------------------------------------------------------------- -;* ATMEL Microcontroller Software Support - ROUSSET - -;* ---------------------------------------------------------------------------- -;* Copyright (c) 2006, Atmel Corporation -; -;* 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 disclaimer below. -;* -;* - Redistributions in binary form must reproduce the above copyright notice, -;* this list of conditions and the disclaimer below in the documentation and/or -;* other materials provided with the distribution. -;* -;* Atmel's name may not be used to endorse or promote products derived from -;* this software without specific prior written permission. -;* -;* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -;* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -;* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 your AT91 Library files -;------------------------------------------------------------------------------ -#include "AT91SAM7X256_inc.h" -;------------------------------------------------------------------------------ - -#define TOP_OF_MEMORY (AT91C_ISRAM + AT91C_ISRAM_SIZE) -#define IRQ_STACK_SIZE (3*8*4) - ; 3 words to be saved per interrupt priority level - -; Mode, correspords to bits 0-5 in CPSR -MODE_BITS DEFINE 0x1F ; Bit mask for mode bits in CPSR -USR_MODE DEFINE 0x10 ; User mode -FIQ_MODE DEFINE 0x11 ; Fast Interrupt Request mode -IRQ_MODE DEFINE 0x12 ; Interrupt Request mode -SVC_MODE DEFINE 0x13 ; Supervisor mode -ABT_MODE DEFINE 0x17 ; Abort mode -UND_MODE DEFINE 0x1B ; Undefined Instruction mode -SYS_MODE DEFINE 0x1F ; System mode - -I_BIT DEFINE 0x80 -F_BIT DEFINE 0x40 - -;------------------------------------------------------------------------------ -; ?RESET -; Reset Vector. -; Normally, segment INTVEC is linked at address 0. -; For debugging purposes, INTVEC may be placed at other addresses. -; A debugger that honors the entry point will start the -; program in a normal way even if INTVEC is not at address 0. -;------------------------------------------------------------------------------ - SECTION .intvec:CODE:NOROOT(2) - PUBLIC __vector - PUBLIC __iar_program_start - - ARM -__vector: - ldr pc,[pc,#+24] ;; Reset -__und_handler: - ldr pc,[pc,#+24] ;; Undefined instructions -__swi_handler: - ldr pc,[pc,#+24] ;; Software interrupt (SWI/SVC) -__prefetch_handler: - ldr pc,[pc,#+24] ;; Prefetch abort -__data_handler: - ldr pc,[pc,#+24] ;; Data abort - DC32 0xFFFFFFFF ;; RESERVED -__irq_handler: - ldr pc,[pc,#+24] ;; IRQ -__fiq_handler: - ldr pc,[pc,#+24] ;; FIQ - - DC32 __iar_program_start - DC32 __und_handler - DC32 __swi_handler - DC32 __prefetch_handler - DC32 __data_handler - B . - DC32 IRQ_Handler_Entry - DC32 FIQ_Handler_Entry - -;------------------------------------------------------------------------------ -;- Manage exception: The exception must be ensure in ARM mode -;------------------------------------------------------------------------------ - SECTION text:CODE:NOROOT(2) - ARM -;------------------------------------------------------------------------------ -;- Function : FIQ_Handler_Entry -;- Treatments : FIQ Controller Interrupt Handler. -;- R8 is initialize in Cstartup -;- Called Functions : None only by FIQ -;------------------------------------------------------------------------------ -FIQ_Handler_Entry: - -;- Switch in SVC/User Mode to allow User Stack access for C code -; because the FIQ is not yet acknowledged - -;- Save and r0 in FIQ_Register - mov r9,r0 - ldr r0 , [r8, #AIC_FVR] - msr CPSR_c,#I_BIT | F_BIT | SVC_MODE -;- Save scratch/used registers and LR in User Stack - stmfd sp!, { r1-r3, r12, lr} - -;- Branch to the routine pointed by the AIC_FVR - mov r14, pc - bx r0 - -;- Restore scratch/used registers and LR from User Stack - ldmia sp!, { r1-r3, r12, lr} - -;- Leave Interrupts disabled and switch back in FIQ mode - msr CPSR_c, #I_BIT | F_BIT | FIQ_MODE - -;- Restore the R0 ARM_MODE_SVC register - mov r0,r9 - -;- Restore the Program Counter using the LR_fiq directly in the PC - subs pc,lr,#4 -;------------------------------------------------------------------------------ -;- Function : IRQ_Handler_Entry -;- Treatments : IRQ Controller Interrupt Handler. -;- Called Functions : AIC_IVR[interrupt] -;------------------------------------------------------------------------------ -IRQ_Handler_Entry: -;------------------------- -;- Manage Exception Entry -;------------------------- -;- Adjust and save LR_irq in IRQ stack - sub lr, lr, #4 - stmfd sp!, {lr} - -;- Save r0 and SPSR (need to be saved for nested interrupt) - mrs r14, SPSR - stmfd sp!, {r0,r14} - -;- Write in the IVR to support Protect Mode -;- No effect in Normal Mode -;- De-assert the NIRQ and clear the source in Protect Mode - ldr r14, =AT91C_BASE_AIC - ldr r0 , [r14, #AIC_IVR] - str r14, [r14, #AIC_IVR] - -;- Enable Interrupt and Switch in Supervisor Mode - msr CPSR_c, #SVC_MODE - -;- Save scratch/used registers and LR in User Stack - stmfd sp!, { r1-r3, r12, r14} - -;---------------------------------------------- -;- Branch to the routine pointed by the AIC_IVR -;---------------------------------------------- - mov r14, pc - bx r0 - -;---------------------------------------------- -;- Manage Exception Exit -;---------------------------------------------- -;- Restore scratch/used registers and LR from User Stack - ldmia sp!, { r1-r3, r12, r14} - -;- Disable Interrupt and switch back in IRQ mode - msr CPSR_c, #I_BIT | IRQ_MODE - -;- Mark the End of Interrupt on the AIC - ldr r14, =AT91C_BASE_AIC - str r14, [r14, #AIC_EOICR] - -;- Restore SPSR_irq and r0 from IRQ stack - ldmia sp!, {r0,r14} - msr SPSR_cxsf, r14 - -;- Restore adjusted LR_irq from IRQ stack directly in the PC - ldmia sp!, {pc}^ - -;------------------------------------------------------------------------------ -;- Exception Vectors -;------------------------------------------------------------------------------ - PUBLIC AT91F_Default_FIQ_handler - PUBLIC AT91F_Default_IRQ_handler - PUBLIC AT91F_Spurious_handler - - ARM ; Always ARM mode after exeption - -AT91F_Default_FIQ_handler - b AT91F_Default_FIQ_handler - -AT91F_Default_IRQ_handler - b AT91F_Default_IRQ_handler - -AT91F_Spurious_handler - b AT91F_Spurious_handler - - -;------------------------------------------------------------------------------ -; ?INIT -; Program entry. -;------------------------------------------------------------------------------ - - SECTION FIQ_STACK:DATA:NOROOT(3) - SECTION IRQ_STACK:DATA:NOROOT(3) - SECTION SVC_STACK:DATA:NOROOT(3) - SECTION ABT_STACK:DATA:NOROOT(3) - SECTION UND_STACK:DATA:NOROOT(3) - SECTION CSTACK:DATA:NOROOT(3) - SECTION text:CODE:NOROOT(2) - REQUIRE __vector - EXTERN ?main - PUBLIC __iar_program_start - EXTERN AT91F_LowLevelInit - - -__iar_program_start: - -;------------------------------------------------------------------------------ -;- Low level Init is performed in a C function: AT91F_LowLevelInit -;- Init Stack Pointer to a valid memory area before calling AT91F_LowLevelInit -;------------------------------------------------------------------------------ - -;- Retrieve end of RAM address - - ldr r13,=TOP_OF_MEMORY ;- Temporary stack in internal RAM for Low Level Init execution - ldr r0,=AT91F_LowLevelInit - mov lr, pc - bx r0 ;- Branch on C function (with interworking) - -; Initialize the stack pointers. -; The pattern below can be used for any of the exception stacks: -; FIQ, IRQ, SVC, ABT, UND, SYS. -; The USR mode uses the same stack as SYS. -; The stack segments must be defined in the linker command file, -; and be declared above. - - mrs r0,cpsr ; Original PSR value - bic r0,r0,#MODE_BITS ; Clear the mode bits - orr r0,r0,#SVC_MODE ; Set SVC mode bits - msr cpsr_c,r0 ; Change the mode - ldr sp,=SFE(SVC_STACK) ; End of SVC_STACK - - bic r0,r0,#MODE_BITS ; Clear the mode bits - orr r0,r0,#UND_MODE ; Set UND mode bits - msr cpsr_c,r0 ; Change the mode - ldr sp,=SFE(UND_STACK) ; End of UND_STACK - - bic r0,r0,#MODE_BITS ; Clear the mode bits - orr r0,r0,#ABT_MODE ; Set ABT mode bits - msr cpsr_c,r0 ; Change the mode - ldr sp,=SFE(ABT_STACK) ; End of ABT_STACK - - bic r0,r0,#MODE_BITS ; Clear the mode bits - orr r0,r0,#FIQ_MODE ; Set FIQ mode bits - msr cpsr_c,r0 ; Change the mode - ldr sp,=SFE(FIQ_STACK) ; End of FIQ_STACK - ;- Init the FIQ register - ldr r8, =AT91C_BASE_AIC - - bic r0,r0,#MODE_BITS ; Clear the mode bits - orr r0,r0,#IRQ_MODE ; Set IRQ mode bits - msr cpsr_c,r0 ; Change the mode - ldr sp,=SFE(IRQ_STACK) ; End of IRQ_STACK - - bic r0,r0,#MODE_BITS ; Clear the mode bits - orr r0,r0,#SYS_MODE ; Set System mode bits - msr cpsr_c,r0 ; Change the mode - ldr sp,=SFE(CSTACK) ; End of CSTACK - -#ifdef __ARMVFP__ -; Enable the VFP coprocessor. - mov r0, #0x40000000 ; Set EN bit in VFP - fmxr fpexc, r0 ; FPEXC, clear others. - -; Disable underflow exceptions by setting flush to zero mode. -; For full IEEE 754 underflow compliance this code should be removed -; and the appropriate exception handler installed. - mov r0, #0x01000000 ; Set FZ bit in VFP - fmxr fpscr, r0 ; FPSCR, clear others. -#endif - -; Add more initialization here - - -; Continue to ?main for more IAR specific system startup - - ldr r0,=?main - bx r0 - - END ;- Terminates the assembly of the last module in a file diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup_SAM7.c b/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup_SAM7.c deleted file mode 100644 index a7c72b9a3..000000000 --- a/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup_SAM7.c +++ /dev/null @@ -1,98 +0,0 @@ -//----------------------------------------------------------------------------- -// ATMEL Microcontroller Software Support - ROUSSET - -//----------------------------------------------------------------------------- -// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE -// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : Cstartup_SAM7.c -// Object : Low level initialisations written in C for Tools -// For AT91SAM7X256 with 2 flash plane -// Creation : JPP 14-Sep-2006 -//----------------------------------------------------------------------------- - -#include "project.h" - - -// The following functions must be write in ARM mode this function called -// directly by exception vector -extern void AT91F_Spurious_handler(void); -extern void AT91F_Default_IRQ_handler(void); -extern void AT91F_Default_FIQ_handler(void); - -//*---------------------------------------------------------------------------- -//* \fn AT91F_LowLevelInit -//* \brief This function performs very low level HW initialization -//* this function can use a Stack, depending the compilation -//* optimization mode -//*---------------------------------------------------------------------------- -void AT91F_LowLevelInit(void) @ "ICODE" -{ - unsigned char i; - /////////////////////////////////////////////////////////////////////////// - // EFC Init - /////////////////////////////////////////////////////////////////////////// - AT91C_BASE_MC->MC_FMR = AT91C_MC_FWS_1FWS ; - - /////////////////////////////////////////////////////////////////////////// - // Init PMC Step 1. Enable Main Oscillator - // Main Oscillator startup time is board specific: - // Main Oscillator Startup Time worst case (3MHz) corresponds to 15ms - // (0x40 for AT91C_CKGR_OSCOUNT field) - /////////////////////////////////////////////////////////////////////////// - AT91C_BASE_PMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (0x40 <<8) | AT91C_CKGR_MOSCEN )); - // Wait Main Oscillator stabilization - while(!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MOSCS)); - - /////////////////////////////////////////////////////////////////////////// - // Init PMC Step 2. - // Set PLL to 96MHz (96,109MHz) and UDP Clock to 48MHz - // PLL Startup time depends on PLL RC filter: worst case is choosen - // UDP Clock (48,058MHz) is compliant with the Universal Serial Bus - // Specification (+/- 0.25% for full speed) - /////////////////////////////////////////////////////////////////////////// - AT91C_BASE_PMC->PMC_PLLR = AT91C_CKGR_USBDIV_1 | - (16 << 8) | - (AT91C_CKGR_MUL & (72 << 16)) | - (AT91C_CKGR_DIV & 14); - // Wait for PLL stabilization - while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_LOCK) ); - // Wait until the master clock is established for the case we already - // turn on the PLL - while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); - - /////////////////////////////////////////////////////////////////////////// - // Init PMC Step 3. - // Selection of Master Clock MCK equal to (Processor Clock PCK) PLL/2=48MHz - // The PMC_MCKR register must not be programmed in a single write operation - // (see. Product Errata Sheet) - /////////////////////////////////////////////////////////////////////////// - AT91C_BASE_PMC->PMC_MCKR = AT91C_PMC_PRES_CLK_2; - // Wait until the master clock is established - while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); - - AT91C_BASE_PMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK; - // Wait until the master clock is established - while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); - - /////////////////////////////////////////////////////////////////////////// - // Disable Watchdog (write once register) - /////////////////////////////////////////////////////////////////////////// - AT91C_BASE_WDTC->WDTC_WDMR = AT91C_WDTC_WDDIS; - - /////////////////////////////////////////////////////////////////////////// - // Init AIC: assign corresponding handler for each interrupt source - /////////////////////////////////////////////////////////////////////////// - AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler ; - for (i = 1; i < 31; i++) { - AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler ; - } - AT91C_BASE_AIC->AIC_SPU = (unsigned int) AT91F_Spurious_handler; -} diff --git a/components/testframework/libs/cmock/test/rakefile b/components/testframework/libs/cmock/test/rakefile deleted file mode 100644 index c57c71539..000000000 --- a/components/testframework/libs/cmock/test/rakefile +++ /dev/null @@ -1,147 +0,0 @@ -# ============================================================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007-2014 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ============================================================================== - -require '../config/test_environment' -require 'rake' -require 'rake/clean' -require 'rake/testtask' -require './rakefile_helper' - -include RakefileHelpers - -DEFAULT_CONFIG_FILE = 'gcc.yml' -CMOCK_TEST_ROOT = File.expand_path(File.dirname(__FILE__)) - -SYSTEM_TEST_SUPPORT_DIRS = [ - File.join(CMOCK_TEST_ROOT, 'system/generated'), - File.join(CMOCK_TEST_ROOT, 'system/build') -] - -SYSTEM_TEST_SUPPORT_DIRS.each do |dir| - directory(dir) - CLOBBER.include(dir) -end - - -task :prep_system_tests => SYSTEM_TEST_SUPPORT_DIRS - -configure_clean -configure_toolchain(DEFAULT_CONFIG_FILE) - -task :default => [:test] -task :ci => [:no_color, :default, 'test:examples', 'style:check'] -task :cruise => :ci - -desc "Load configuration" -task :config, :config_file do |t, args| - args = {:config_file => DEFAULT_CONFIG_FILE} if args[:config_file].nil? - args = {:config_file => args[:config_file] + '.yml'} unless args[:config_file] =~ /\.yml$/i - configure_toolchain(args[:config_file]) -end - -# Still support testing everything with just 'test' but switch default to ceedling-like test:all -task :test => ['test:all'] - -namespace :test do - desc "Run all unit, c, and system tests" - task :all => [:clobber, :prep_system_tests, 'test:units', 'test:c', 'test:system'] - - desc "Run Unit Tests" - Rake::TestTask.new('units') do |t| - t.pattern = 'unit/*_test.rb' - t.verbose = true - end - - #individual unit tests - FileList['unit/*_test.rb'].each do |test| - Rake::TestTask.new(File.basename(test,'.*').sub('_test','')) do |t| - t.pattern = test - t.verbose = true - end - end - - desc "Run C Unit Tests" - task :c => [:prep_system_tests] do - unless ($cfg['unsupported'].include? "C") - build_and_test_c_files - end - end - - desc "Run System Tests" - task :system => [:clobber, :prep_system_tests] do - #get a list of all system tests, removing unsupported tests for this compiler - sys_unsupported = $cfg['unsupported'].map {|a| 'system/test_interactions/'+a+'.yml'} - sys_tests_to_run = FileList['system/test_interactions/*.yml'] - sys_unsupported - compile_unsupported = $cfg['unsupported'].map {|a| SYSTEST_COMPILE_MOCKABLES_PATH+a+'.h'} - compile_tests_to_run = FileList[SYSTEST_COMPILE_MOCKABLES_PATH + '*.h'] - compile_unsupported - unless (sys_unsupported.empty? and compile_unsupported.empty?) - report "\nIgnoring these system tests..." - sys_unsupported.each {|a| report a} - compile_unsupported.each {|a| report a} - end - report "\nRunning system tests..." - tests_failed = run_system_test_interactions(sys_tests_to_run) - raise "System tests failed." if (tests_failed > 0) - - run_system_test_compilations(compile_tests_to_run) - end - - desc "Test cmock examples" - task :examples => [:prep_system_tests] do - run_examples() - end - - #individual system tests - FileList['system/test_interactions/*.yml'].each do |test| - basename = File.basename(test,'.*') - #desc "Run system test #{basename}" - task basename do - run_system_test_interactions([test]) - end - end - - desc "Profile Mock Generation" - task :profile => [:clobber, :prep_system_tests] do - run_system_test_profiles(FileList[SYSTEST_COMPILE_MOCKABLES_PATH + '*.h']) - end -end - -task :no_color do - $colour_output = false -end - -################### CODING STYLE VALIDATION -namespace :style do - desc "Check style" - task :check do - report "\nVERIFYING RUBY STYLE" - report execute("rubocop ../lib ../examples ../config ../scripts --config ../vendor/unity/test/.rubocop.yml", true) - report "Styling Ruby:PASS" - end - - desc "Fix Style of all C Code" - task :c do - run_astyle("../src/*.* ../extras/fixture/src/*.*") - end - - desc "Attempt to Autocorrect style" - task :auto => ['style:clean'] do - report execute("rubocop ../lib ../examples ../config ../scripts --auto-correct --config ../vendor/unity/test/.rubocop.yml", true) - report "Autocorrected What We Could." - end - - desc "Update style todo list" - task :todo => ['style:clean'] do - report execute("rubocop ../lib ../examples ../config ../scripts --auto-gen-config --config ../vendor/unity/test/.rubocop.yml", true) - report "Updated Style TODO List." - end - - task :clean do - File.delete(".rubocop_todo.yml") if File.exists?(".rubocop_todo.yml") - end -end - -task :style => ['style:check'] \ No newline at end of file diff --git a/components/testframework/libs/cmock/test/rakefile_helper.rb b/components/testframework/libs/cmock/test/rakefile_helper.rb deleted file mode 100644 index 3d898905e..000000000 --- a/components/testframework/libs/cmock/test/rakefile_helper.rb +++ /dev/null @@ -1,403 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require 'yaml' -require 'fileutils' -require '../vendor/unity/auto/generate_test_runner' -require '../vendor/unity/auto/unity_test_summary' -require '../vendor/unity/auto/colour_reporter.rb' -require './system/systest_generator' - -module RakefileHelpers - - SYSTEST_GENERATED_FILES_PATH = './system/generated/' - SYSTEST_BUILD_FILES_PATH = './system/build/' - SYSTEST_COMPILE_MOCKABLES_PATH = './system/test_compilation/' - C_EXTENSION = '.c' - RESULT_EXTENSION = '.result' - - def load_configuration(config_file) - $cfg_file = config_file - $cfg = YAML.load(File.read('./targets/' + $cfg_file)) - $colour_output = false unless $cfg['colour'] - end - - def configure_clean - CLEAN.include(SYSTEST_GENERATED_FILES_PATH + '*.*') - CLEAN.include(SYSTEST_BUILD_FILES_PATH + '*.*') - end - - def configure_toolchain(config_file) - load_configuration(config_file) - configure_clean - end - - def get_local_include_dirs - include_dirs = $cfg['compiler']['includes']['items'].dup - include_dirs.delete_if {|dir| dir.is_a?(Array)} - return include_dirs - end - - def extract_headers(filename) - includes = [] - lines = File.readlines(filename) - lines.each do |line| - m = line.match(/^\s*#include\s+\"\s*(.+\.[hH])\s*\"/) - if not m.nil? - includes << m[1] - end - end - includes << File.basename(filename,".c").slice(5,256) + "_unity_helper.h" - return includes - end - - def find_source_file(header, paths) - paths.each do |dir| - src_file = dir + header.ext(C_EXTENSION) - if (File.exists?(src_file)) - return src_file - end - end - return nil - end - - def squash(prefix, items) - result = '' - items.each { |item| result += " #{prefix}#{tackit(item)}" } - return result - end - - def build_compiler_fields - command = tackit($cfg['compiler']['path']) - if $cfg['compiler']['defines']['items'].nil? - defines = '' - else - defines = squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items']) - end - options = squash('', $cfg['compiler']['options']) - includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items']) - includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) - return {:command => command, :defines => defines, :options => options, :includes => includes} - end - - def compile(file, defines=[]) - compiler = build_compiler_fields - cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{defines.inject(''){|all, a| ' -D'+a+all }}#{compiler[:options]}#{compiler[:includes]} #{file} " + - "#{$cfg['compiler']['object_files']['prefix']}#{$cfg['compiler']['object_files']['destination']}" - obj_file = "#{File.basename(file, C_EXTENSION)}#{$cfg['compiler']['object_files']['extension']}" - execute(cmd_str + obj_file) - return obj_file - end - - def build_linker_fields - command = tackit($cfg['linker']['path']) - if $cfg['linker']['options'].nil? - options = '' - else - options = squash('', $cfg['linker']['options']) - end - if ($cfg['linker']['includes'].nil? || $cfg['linker']['includes']['items'].nil?) - includes = '' - else - includes = squash($cfg['linker']['includes']['prefix'], $cfg['linker']['includes']['items']) - end - includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) - return {:command => command, :options => options, :includes => includes} - end - - def link_it(exe_name, obj_list) - linker = build_linker_fields - cmd_str = "#{linker[:command]}#{linker[:options]}#{linker[:includes]} " + - (obj_list.map{|obj|"#{$cfg['linker']['object_files']['path']}#{obj} "}).uniq.join + - $cfg['linker']['bin_files']['prefix'] + ' ' + - $cfg['linker']['bin_files']['destination'] + - exe_name + $cfg['linker']['bin_files']['extension'] - execute(cmd_str) - end - - def build_simulator_fields - return nil if $cfg['simulator'].nil? - if $cfg['simulator']['path'].nil? - command = '' - else - command = (tackit($cfg['simulator']['path']) + ' ') - end - if $cfg['simulator']['pre_support'].nil? - pre_support = '' - else - pre_support = squash('', $cfg['simulator']['pre_support']) - end - if $cfg['simulator']['post_support'].nil? - post_support = '' - else - post_support = squash('', $cfg['simulator']['post_support']) - end - return {:command => command, :pre_support => pre_support, :post_support => post_support} - end - - def execute(command_string, verbose=true, raise_on_failure=true) - #report command_string - output = `#{command_string}`.chomp - report(output) if (verbose && !output.nil? && (output.length > 0)) - if ($?.exitstatus != 0) and (raise_on_failure) - raise "#{command_string} failed. (Returned #{$?.exitstatus})" - end - return output - end - - def tackit(strings) - case(strings) - when Array - "\"#{strings.join}\"" - when /^-/ - strings - when /\s/ - "\"#{strings}\"" - else - strings - end - end - - def run_astyle(style_what) - report "Styling C Code..." - command = "AStyle " \ - "--style=allman --indent=spaces=4 --indent-switches --indent-preproc-define --indent-preproc-block " \ - "--pad-oper --pad-comma --unpad-paren --pad-header " \ - "--align-pointer=type --align-reference=name " \ - "--add-brackets --mode=c --suffix=none " \ - "#{style_what}" - execute(command, false) - report "Styling C:PASS" - end - - def report_summary - summary = UnityTestSummary.new - summary.root = File.expand_path(File.dirname(__FILE__)) + '/' - results_glob = "#{$cfg['compiler']['build_path']}*.test*" - results_glob.gsub!(/\\/, '/') - results = Dir[results_glob] - summary.targets = results - summary.run - fail_out "FAIL: There were failures" if (summary.failures > 0) - end - - def run_system_test_interactions(test_case_files) - load '../lib/cmock.rb' - - SystemTestGenerator.new.generate_files(test_case_files) - test_files = FileList.new(SYSTEST_GENERATED_FILES_PATH + 'test*.c') - - load_configuration($cfg_file) - $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? - - include_dirs = get_local_include_dirs - - # Build and execute each unit test - test_files.each do |test| - - obj_list = [] - - test_base = File.basename(test, C_EXTENSION) - cmock_config = test_base.gsub(/test_/, '') + '_cmock.yml' - - report "Executing system tests in #{File.basename(test)}..." - - # Detect dependencies and build required required modules - extract_headers(test).each do |header| - - # Generate any needed mocks - if header =~ /^mock_(.*)\.h/i - module_name = $1 - cmock = CMock.new(SYSTEST_GENERATED_FILES_PATH + cmock_config) - cmock.setup_mocks("#{$cfg['compiler']['source_path']}#{module_name}.h") - end - # Compile corresponding source file if it exists - src_file = find_source_file(header, include_dirs) - if !src_file.nil? - obj_list << compile(src_file) - end - end - - # Generate and build the test suite runner - runner_name = test_base + '_runner.c' - runner_path = $cfg['compiler']['source_path'] + runner_name - UnityTestRunnerGenerator.new(SYSTEST_GENERATED_FILES_PATH + cmock_config).run(test, runner_path) - obj_list << compile(runner_path) - - # Build the test module - obj_list << compile(test) - - # Link the test executable - link_it(test_base, obj_list) - - # Execute unit test and generate results file - simulator = build_simulator_fields - executable = $cfg['linker']['bin_files']['destination'] + test_base + $cfg['linker']['bin_files']['extension'] - if simulator.nil? - cmd_str = executable - else - cmd_str = "#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}" - end - output = execute(cmd_str, false, false) - test_results = $cfg['compiler']['build_path'] + test_base + RESULT_EXTENSION - File.open(test_results, 'w') { |f| f.print output } - end - - # Parse and report test results - total_tests = 0 - total_failures = 0 - failure_messages = [] - - test_case_files.each do |test_case| - tests = (YAML.load_file(test_case))[:systest][:tests][:units] - total_tests += tests.size - - test_file = 'test_' + File.basename(test_case).ext(C_EXTENSION) - result_file = test_file.ext(RESULT_EXTENSION) - test_results = File.readlines(SYSTEST_BUILD_FILES_PATH + result_file).reject {|line| line.size < 10 } # we're rejecting lines that are too short to be realistic, which handles line ending problems - tests.each_with_index do |test, index| - # compare test's intended pass/fail state with pass/fail state in actual results; - # if they don't match, the system test has failed - this_failed = case(test[:pass]) - when :ignore - (test_results[index] =~ /:IGNORE/).nil? - when true - (test_results[index] =~ /:PASS/).nil? - when false - (test_results[index] =~ /:FAIL/).nil? - end - if (this_failed) - total_failures += 1 - test_results[index] =~ /test#{index+1}:(.+)/ - failure_messages << "#{test_file}:test#{index+1}:should #{test[:should]}:#{$1}" - end - # some tests have additional requirements to check for (checking the actual output message) - if (test[:verify_error]) and not (test_results[index] =~ /test#{index+1}:.*#{test[:verify_error]}/) - total_failures += 1 - failure_messages << "#{test_file}:test#{index+1}:should #{test[:should]}:should have output matching '#{test[:verify_error]}' but was '#{test_results[index]}'" - end - end - end - - report "\n" - report "------------------------------------\n" - report "SYSTEM TEST MOCK INTERACTION SUMMARY\n" - report "------------------------------------\n" - report "#{total_tests} Tests #{total_failures} Failures 0 Ignored\n" - report "\n" - - if (failure_messages.size > 0) - report 'System test failures:' - failure_messages.each do |failure| - report failure - end - end - - report '' - - return total_failures - end - - def profile_this(filename) - profile = true - begin - require 'ruby-prof' - RubyProf.start - rescue - profile = false - end - - yield - - if (profile) - profile_result = RubyProf.stop - File.open("Profile_#{filename}.html", 'w') do |f| - RubyProf::GraphHtmlPrinter.new(profile_result).print(f) - end - end - end - - def run_system_test_compilations(mockables) - load '../lib/cmock.rb' - - load_configuration($cfg_file) - $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? - - report "\n" - report "------------------------------------\n" - report "SYSTEM TEST MOCK COMPILATION SUMMARY\n" - report "------------------------------------\n" - mockables.each do |header| - mock_filename = 'mock_' + File.basename(header).ext('.c') - CMock.new(SYSTEST_COMPILE_MOCKABLES_PATH + 'config.yml').setup_mocks(header) - report "Compiling #{mock_filename}..." - compile(SYSTEST_GENERATED_FILES_PATH + mock_filename) - end - end - - def run_system_test_profiles(mockables) - load '../lib/cmock.rb' - - load_configuration($cfg_file) - $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? - - report "\n" - report "--------------------------\n" - report "SYSTEM TEST MOCK PROFILING\n" - report "--------------------------\n" - mockables.each do |header| - mock_filename = 'mock_' + File.basename(header).ext('.c') - profile_this(mock_filename.gsub('.c','')) do - 10.times do - CMock.new(SYSTEST_COMPILE_MOCKABLES_PATH + 'config.yml').setup_mocks(header) - end - end - report "Compiling #{mock_filename}..." - compile(SYSTEST_GENERATED_FILES_PATH + mock_filename) - end - end - - def build_and_test_c_files - report "\n" - report "----------------\n" - report "UNIT TEST C CODE\n" - report "----------------\n" - errors = false - FileList.new("c/*.yml").each do |yaml_file| - test = YAML.load(File.read(yaml_file)) - report "\nTesting #{yaml_file.sub('.yml','')}" - report "(#{test[:options].join(', ')})" - test[:files].each { |f| compile(f, test[:options]) } - obj_files = test[:files].map { |f| f.gsub!(/.*\//,'').gsub!(C_EXTENSION, $cfg['compiler']['object_files']['extension']) } - link_it('TestCMockC', obj_files) - if $cfg['simulator'].nil? - execute($cfg['linker']['bin_files']['destination'] + 'TestCMockC' + $cfg['linker']['bin_files']['extension']) - else - execute(tackit($cfg['simulator']['path'].join) + ' ' + - $cfg['simulator']['pre_support'].map{|o| tackit(o)}.join(' ') + ' ' + - $cfg['linker']['bin_files']['destination'] + - 'TestCMockC' + - $cfg['linker']['bin_files']['extension'] + ' ' + - $cfg['simulator']['post_support'].map{|o| tackit(o)}.join(' ') ) - end - end - end - - def run_examples() - [ "cd #{File.join("..","examples","make_example")} && make clean && make setup && make test", - "cd #{File.join("..","examples","temp_sensor")} && rake ci" - ].each do |cmd| - report "Testing '#{cmd}'" - execute(cmd, false) - end - end - - def fail_out(msg) - puts msg - exit(-1) - end -end - diff --git a/components/testframework/libs/cmock/test/system/systest_generator.rb b/components/testframework/libs/cmock/test/system/systest_generator.rb deleted file mode 100644 index 490a56eb1..000000000 --- a/components/testframework/libs/cmock/test/system/systest_generator.rb +++ /dev/null @@ -1,205 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require 'yaml' - -SYS_TEST_GEN_ROOT = File.expand_path( File.dirname( __FILE__ ) ) + '/' -GENERATED_PATH = SYS_TEST_GEN_ROOT + 'generated/' -BUILD_PATH = SYS_TEST_GEN_ROOT + 'build/' -CASES_PATH = SYS_TEST_GEN_ROOT + 'cases/' - -TYPES_H = 'types.h' -UNITY_H = 'unity.h' -CMOCK_H = 'cmock.h' -UNITY_HELPER_H = 'unity_helper.h' -UNITY_HELPER_C = 'unity_helper.c' -MOCKABLE_H = 'mockable.h' - -YAML_EXTENSION = '.yml' -TEST_PREFIX = 'test_' -MOCK_PREFIX = 'mock_' -H_EXTENSION = '.h' -C_EXTENSION = '.c' - - -class SystemTestGenerator - - def generate_files(test_cases) - test_cases.each do |filename| - yaml_hash = YAML.load_file(filename) - - name = File.basename(filename, YAML_EXTENSION) - namix = "#{name}_" - - generate_cmock_config(yaml_hash, namix) - generate_code(yaml_hash, namix, name) - end - end - - private - - def generate_cmock_config(yaml_hash, namix) - cmock_yaml = yaml_hash.clone - cmock_yaml.delete(:systest) - cmock = cmock_yaml[:cmock] - - cmock[:mock_path] = GENERATED_PATH - cmock[:includes] = (cmock[:includes] || []) + [namix + TYPES_H] - cmock[:mock_prefix] = MOCK_PREFIX - if not yaml_hash[:systest][:unity_helper].nil? - cmock[:includes] << namix + UNITY_HELPER_H - cmock[:unity_helper_path] = GENERATED_PATH + namix + UNITY_HELPER_H - end - - File.open(GENERATED_PATH + namix + 'cmock' + YAML_EXTENSION, 'w') do |out| - YAML.dump(cmock_yaml, out) - end - end - - def generate_code(yaml_hash, namix, name) - generate_types_file(yaml_hash, namix) - generate_mockable_file(yaml_hash, namix) - generate_unity_helper_files(yaml_hash, namix) - - generate_test_file(yaml_hash, namix, name) - generate_source_file(yaml_hash, namix, name) - generate_skeleton_file(yaml_hash, namix, name) - end - - def generate_types_file(yaml_hash, namix) - types = yaml_hash[:systest][:types] - return if types.nil? - - write_header_file(GENERATED_PATH + namix + TYPES_H, namix.upcase + 'TYPES_H') do |out| - out.puts(types) - end - end - - def generate_mockable_file(yaml_hash, namix) - mockable = yaml_hash[:systest][:mockable] - return if mockable.nil? - - write_header_file(GENERATED_PATH + namix + MOCKABLE_H, namix.upcase + 'MOCKABLE_H', [namix + TYPES_H]) do |out| - out.puts(mockable) - end - end - - def generate_unity_helper_files(yaml_hash, namix) - unity_helper = yaml_hash[:systest][:unity_helper] - return if unity_helper.nil? - - write_header_file(GENERATED_PATH + namix + UNITY_HELPER_H, namix.upcase + 'UNITY_HELPER_H', [namix + TYPES_H]) do |out| - out.puts(unity_helper[:header]) - end - - write_source_file(GENERATED_PATH + namix + UNITY_HELPER_C, ["unity.h", namix + UNITY_HELPER_H]) do |out| - out.puts(unity_helper[:code]) - end - end - - def generate_test_file(yaml_hash, namix, name) - tests = yaml_hash[:systest][:tests] - return if tests.nil? - - includes = [UNITY_H, CMOCK_H] - includes << [MOCK_PREFIX + namix + MOCKABLE_H] - includes << [name + H_EXTENSION] - - write_source_file(GENERATED_PATH + TEST_PREFIX + name + C_EXTENSION, includes.flatten) do |out| - out.puts(tests[:common]) - out.puts('') - - tests[:units].each_with_index do |test, index| - out.puts('// should ' + test[:should]) - out.puts(test[:code].gsub!(/test\(\)/, "void test#{index+1}(void)")) - out.puts('') - end - end - end - - def generate_source_file(yaml_hash, namix, name) - source = yaml_hash[:systest][:source] - return if source.nil? - - header_file = name + H_EXTENSION - - includes = yaml_hash[:systest][:types].nil? ? [] : [(namix + TYPES_H)] - - write_header_file(GENERATED_PATH + header_file, name.upcase, includes) do |out| - out.puts(source[:header]) - end - - includes = [] - includes << (namix + TYPES_H) if not yaml_hash[:systest][:types].nil? - includes << (namix + MOCKABLE_H) if not yaml_hash[:systest][:mockable].nil? - includes << header_file - - unless (source[:code].nil?) - write_source_file(GENERATED_PATH + name + C_EXTENSION, includes.flatten) do |out| - out.puts(source[:code]) - end - end - end - - def generate_skeleton_file(yaml_hash, namix, name) - source = yaml_hash[:systest][:skeleton] - return if source.nil? - - require 'cmock.rb' - cmock = CMock.new(GENERATED_PATH + namix + 'cmock' + YAML_EXTENSION) - cmock.setup_skeletons("#{$cfg['compiler']['source_path']}#{name}.h") - end - - def write_header_file(filename, upcase_name, include_list=[]) - File.open(filename, 'w') do |out| - out.puts("#ifndef _#{upcase_name}") - out.puts("#define _#{upcase_name}") - out.puts('') - include_list.each do |include| - out.puts("#include \"#{include}\"") - end - out.puts('') - out.puts("#if defined(__GNUC__) && !defined(__ICC)") - out.puts("#if !defined(__clang__)") - out.puts("#pragma GCC diagnostic ignored \"-Wpragmas\"") - out.puts("#endif") - out.puts('#pragma GCC diagnostic ignored "-Wunknown-pragmas"') - out.puts('#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier"') - out.puts("#endif") - out.puts('') - yield(out) - out.puts('') - out.puts("#endif // _#{upcase_name}") - out.puts('') - end - end - - def write_source_file(filename, include_list=[]) - File.open(filename, 'w') do |out| - include_list.each do |include| - out.puts("#include \"#{include}\"") - end - out.puts('') - out.puts("#if defined(__GNUC__) && !defined(__ICC)") - out.puts("#if !defined(__clang__)") - out.puts("#pragma GCC diagnostic ignored \"-Wpragmas\"") - out.puts("#endif") - out.puts('#pragma GCC diagnostic ignored "-Wunknown-pragmas"') - out.puts('#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier"') - out.puts("#endif") - out.puts('') - yield(out) - out.puts('') - end - end - -end - - -if ($0 == __FILE__) - SystemTestGenerator.new.generate_files(Dir[CASES_PATH + "*#{YAML_EXTENSION}"]) -end - diff --git a/components/testframework/libs/cmock/test/system/test_compilation/callingconv.h b/components/testframework/libs/cmock/test/system/test_compilation/callingconv.h deleted file mode 100644 index beae0619f..000000000 --- a/components/testframework/libs/cmock/test/system/test_compilation/callingconv.h +++ /dev/null @@ -1,11 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#ifndef __stdcall -#define __stdcall -#endif - -int __stdcall this_uses_calling_conventions(int b); diff --git a/components/testframework/libs/cmock/test/system/test_compilation/config.yml b/components/testframework/libs/cmock/test/system/test_compilation/config.yml deleted file mode 100644 index 787e2e1f6..000000000 --- a/components/testframework/libs/cmock/test/system/test_compilation/config.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -:cmock: - :plugins: [] - :includes: [] - :mock_path: ./system/generated/ - :mock_prefix: mock_ - :treat_inlines: :include - :treat_as_void: - - OSEK_TASK - - VOID_TYPE_CRAZINESS diff --git a/components/testframework/libs/cmock/test/system/test_compilation/const.h b/components/testframework/libs/cmock/test/system/test_compilation/const.h deleted file mode 100644 index 71426bc3b..000000000 --- a/components/testframework/libs/cmock/test/system/test_compilation/const.h +++ /dev/null @@ -1,37 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -#if defined(__GNUC__) && !defined(__ICC) -#if !defined(__clang__) -#pragma GCC diagnostic ignored "-Wpragmas" -#endif -#pragma GCC diagnostic ignored "-Wunknown-pragmas" -#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier" -#endif - -struct _DUMMY_T { unsigned int a; float b; }; - -void const_variants1( const char* a, int const, unsigned short const * c ); - -void const_variants2( - struct _DUMMY_T const * const param1, - const unsigned long int const * const param2, - const struct _DUMMY_T const * param3 ); - -const int * const_retval1(void); /* nicety version for pointer to constant int */ -int const * const_retval2(void); /* formal version for pointer to constant int */ -//int * const const_retval3(void); /* formal version for constant pointer to int */ -//int const * const const_retval4(void); /* formal version for constant pointer to constant int */ - -const int* const_retval5(void); /* sticky-left nicety version for pointer to constant int */ -int const* const_retval6(void); /* sticky-left formal version for pointer to constant int */ -//int* const const_retval7(void); /* sticky-left formal version for constant pointer to int */ -//int const* const const_retval8(void); /* sticky-left formal version for constant pointer to constant int */ - -const int *const_retval9(void); /* sticky-right nicety version for pointer to constant int */ -int const *const_retvalA(void); /* sticky-right formal version for pointer to constant int */ -//int *const const_retvalB(void); /* sticky-right formal version for constant pointer to int */ -//int const *const const_retvalC(void); /* sticky-right formal version for constant pointer to constant int */ diff --git a/components/testframework/libs/cmock/test/system/test_compilation/inline.h b/components/testframework/libs/cmock/test/system/test_compilation/inline.h deleted file mode 100644 index 06e33c184..000000000 --- a/components/testframework/libs/cmock/test/system/test_compilation/inline.h +++ /dev/null @@ -1,23 +0,0 @@ - -static inline int dummy_func_0(void) { - return 5; -} - -inline static int dummy_func_1(int a) { - int a = dummy_func_0(); - int b = 10; - - return a + b; -} - -int inline static dummy_func_2(int a, char b, float c) { - c += 3.14; - b -= 32; - return a + (int)(b) + (int)c; -} - -void dummy_normal_func(int a); - -inline void dummy_func_3(void) { - //NOP -} diff --git a/components/testframework/libs/cmock/test/system/test_compilation/osek.h b/components/testframework/libs/cmock/test/system/test_compilation/osek.h deleted file mode 100644 index f3abe7b57..000000000 --- a/components/testframework/libs/cmock/test/system/test_compilation/osek.h +++ /dev/null @@ -1,275 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -typedef unsigned char OSServiceIdType; -typedef void (*OSEKOS_VOIDFUNCPTR)(void); - -typedef unsigned char StatusType; -typedef unsigned char OSEK_U8; -typedef unsigned short OSEK_U16; -typedef unsigned long OSEK_U32; - -void OSEKOSDisableAll(void); -void OSEKOSEnableAll(void); - -typedef unsigned long * OSEKOSSaveType; -typedef void OSEK_TASK; -typedef OSEK_U8 OSEKOSPrioType; - -enum { -Task_DbgCAN -, -Task_ALS -, -CalibrateMagTask -, -Task_IAQ -, -SmartBeam -, -Task_QbertTestImage -, -Task_TestQbertMem -, -Task_Cyclic1000 -, -ProcessMagForCompass -, -ReadMag -, -Task_Cyclic10 -, -Task_Wdm -, -BackgroundTask -, -Task_Cyclic20 -, -Task_Cyclic2 -}; - -OSEK_TASK OSEKOS_T_Task_DbgCAN(void); -OSEK_TASK OSEKOS_T_Task_ALS(void); -OSEK_TASK OSEKOS_T_CalibrateMagTask(void); -OSEK_TASK OSEKOS_T_Task_IAQ(void); -OSEK_TASK OSEKOS_T_SmartBeam(void); -OSEK_TASK OSEKOS_T_Task_QbertTestImage(void); -OSEK_TASK OSEKOS_T_Task_TestQbertMem(void); -OSEK_TASK OSEKOS_T_Task_Cyclic1000(void); -OSEK_TASK OSEKOS_T_ProcessMagForCompass(void); -OSEK_TASK OSEKOS_T_ReadMag(void); -OSEK_TASK OSEKOS_T_Task_Cyclic10(void); -OSEK_TASK OSEKOS_T_Task_Wdm(void); -OSEK_TASK OSEKOS_T_BackgroundTask(void); -OSEK_TASK OSEKOS_T_Task_Cyclic20(void); -OSEK_TASK OSEKOS_T_Task_Cyclic2(void); -OSEK_TASK OSEKOS_Twrap_Task_DbgCAN(void); -OSEK_TASK OSEKOS_Twrap_Task_ALS(void); -OSEK_TASK OSEKOS_Twrap_CalibrateMagTask(void); -OSEK_TASK OSEKOS_Twrap_Task_IAQ(void); -OSEK_TASK OSEKOS_Twrap_SmartBeam(void); -OSEK_TASK OSEKOS_Twrap_Task_QbertTestImage(void); -OSEK_TASK OSEKOS_Twrap_Task_TestQbertMem(void); -OSEK_TASK OSEKOS_Twrap_Task_Cyclic1000(void); -OSEK_TASK OSEKOS_Twrap_ProcessMagForCompass(void); -OSEK_TASK OSEKOS_Twrap_ReadMag(void); -OSEK_TASK OSEKOS_Twrap_Task_Cyclic10(void); -OSEK_TASK OSEKOS_Twrap_Task_Wdm(void); -OSEK_TASK OSEKOS_Twrap_BackgroundTask(void); -OSEK_TASK OSEKOS_Twrap_Task_Cyclic20(void); -OSEK_TASK OSEKOS_Twrap_Task_Cyclic2(void); - -typedef OSEK_U8 TaskType; -typedef OSEK_U8 TaskStateType; -typedef OSEK_U16 EventMaskType; -typedef OSEK_U8 ResourceType; - -void OSEKOSEnableSystemTimers(void); - -typedef OSEK_U8 CounterType; -typedef OSEK_U32 TickType; -typedef OSEK_U8 AlarmType; - -void OSEKOS_ISR_CanTxInterrupt(void); -void OSEKOS_ISR_CanRxInterrupt(void); -void OSEKOS_ISR_CanErrInterrupt(void); -void OSEKOS_ISR_SCIRxInterrupt(void); -void OSEKOS_ISR_SCITxInterrupt(void); -void OSEKOS_ISR_UP_DMA_Interrupt_0(void); -void OSEKOS_ISR_UP_DMA_Interrupt_1(void); -void OSEKOS_ISR_UP_DMA_Interrupt_2(void); -void OSEKOS_ISR_UP_DMA_Interrupt_3(void); -void OSEKOS_ISR_CompFreqHandler(void); -void OSEKOS_ISR_AmbientReturnInt(void); -void OSEKOS_ISR_GlareReturnInt(void); -void OSEKOS_ISR_ALSTimeoutInt(void); -void OSEKOS_ISR_LINTimerInt(void); -void OSEKOS_ISR_LINDelayInt(void); -void OSEKOS_ISR_TimerMExpire(void); -void OSEKOS_ISR_LINRxTx_SCI1(void); -void OSEKOS_ISR_CanRxInterrupt_1(void); -void OSEKOS_ISR_LINError_SCI1(void); -void OSEKOS_ISR_SysCounter(void); - - -// defined multiple times (slightly different forms) These should be ignored because they are externed -extern void OSEKOS_ISR_CanTxInterrupt( void ); -extern void OSEKOS_ISR_CanRxInterrupt( void ); - - -unsigned long OSEKOSrtcGetSeconds ( void ); -void OSEKOSrtcIncrement ( unsigned long nsec ); - -enum -{ - E_OS_ACCESS = 1, - E_OS_CALLEVEL = 2, - E_OS_ID = 3, - E_OS_LIMIT = 4, - E_OS_NOFUNC = 5, - E_OS_RESOURCE = 6, - E_OS_STATE = 7, - E_OS_VALUE = 8, - E_OS_SYS_StackOverflow = 20, - E_OS_SYS_StackUnderflow = 21, - E_OS_SYS_INIT = 22, - E_OS_SYS_CONFIG = 23, - E_OS_SYS_CODE = 24, - E_OS_SYS_TOOL = 25, - E_OS_SYS_TimerRange = 26 -}; - -enum -{ - SUSPENDED = 0x00, - READY = 0x01, - RUNNING = 0x02, - WAITING = 0x03, - INTSTART = 0x08, - SETSTART = 0x10, - NPRTASK = 0x20, - USEFP = 0x40 -}; - -typedef struct -{ - TickType maxallowedvalue; - TickType ticksperbase; -} AlarmBaseType; - -typedef TaskType *TaskRefType; -typedef TaskStateType *TaskStateRefType; -typedef EventMaskType *EventMaskRefType; -typedef TickType *TickRefType; -typedef AlarmBaseType *AlarmBaseRefType; -typedef OSEK_U8 AppModeType; -typedef OSEK_U8 OSEKOSTaskActCntType; - -TaskType OSEKOStidact; -OSEKOSPrioType OSEKOSrunprio; - -StatusType OSEKOSError ( register StatusType ); -void ErrorHook ( StatusType ); -void StartupHook ( void ); -void ShutdownHook ( StatusType ); - -int getUsedTaskStack ( TaskType ); -int getUnusedTaskStack ( TaskType ); -int getUsedIsrStack ( void ); -int getUnusedIsrStack ( void ); -void OSEKOStaskStackCheckInit ( void ); -signed char OSEKOStaskStackCheck ( OSEK_U8 * ); -signed char OSEKOSisrStackCheck ( OSEK_U8 * ); -void OSEKOStaskStackCheckFatal ( OSEK_U8 * ); -void OSEKOSisrStackCheckFatal ( OSEK_U8 * ); -OSEK_U8 * OSEKOSgetStackPointer ( void ); -void OSEKOSTaskSwitch ( void ); -StatusType OSEKOSReturn ( StatusType ); -StatusType OSEKOSActivateTask ( register TaskType ); -void OSEKOSTerminateTask ( TaskType, TaskType ); - - extern void OSEKOSGetResource ( ResourceType ); - extern void OSEKOSReleaseResource ( ResourceType ); - -int OSEKOSSetEvent ( TaskType, EventMaskType ); -int OSEKOSWaitEvent ( EventMaskType ); -TickType OSEKOSGetAlarm(register AlarmType); -void OSEKOSSetAlarm ( AlarmType, TickType, TickType ); -StatusType OSEKOSSetAbsAlarm ( AlarmType a, TickType b, TickType c ); - -StatusType OSEKOSCancelAlarm ( register AlarmType ); -void OSEKOSAdvCntr ( void ); -AppModeType GetActiveApplicationMode ( void ); - -void StartOS ( AppModeType ); - -void OSEKOSShutdownOS ( StatusType ); - -StatusType ActivateTask ( TaskType A ); -StatusType TerminateTask ( void ); -StatusType ChainTask ( TaskType A ); -StatusType GetTaskState ( TaskType A, TaskStateRefType B ); -StatusType GetTaskID ( TaskRefType A ); -StatusType Schedule ( void ); -StatusType GetResource ( ResourceType A ); -StatusType ReleaseResource ( ResourceType A ); -StatusType SetEvent ( TaskType A, EventMaskType B ); -StatusType ClearEvent ( EventMaskType A ); -StatusType WaitEvent ( EventMaskType A ); -StatusType GetEvent ( TaskType A, EventMaskRefType B ); -StatusType GetAlarm ( AlarmType A, TickRefType B ); -StatusType GetAlarmBase ( AlarmType A, AlarmBaseRefType B ); -StatusType SetRelAlarm ( AlarmType A, TickType B, TickType C ); -StatusType SetAbsAlarm ( AlarmType A, TickType B, TickType C ); -StatusType CancelAlarm ( AlarmType A ); -StatusType AdvCntr ( CounterType A ); -StatusType IAdvCntr ( CounterType A ); -void SuspendOSInterrupts ( void ); -void ResumeOSInterrupts ( void ); -void SuspendAllInterrupts ( void ); -void ResumeAllInterrupts ( void ); -void DisableAllInterrupts ( void ); -void EnableAllInterrupts ( void ); - -void OSEKOSDisable(void); -void OSEKOSEnable(void); -void OSEKOSAsmIDispatch(unsigned long *); -void OSEKOSAsmDispatch(OSEKOSPrioType p); -void OSEKOSStartupEnable(void); -void OSEKOSNop(void); -unsigned int OSEKOSV850CheckIsrSwitch(void); -void OSEKOSV850InitInterrupts(void); -void OSEKOSV850SetupInterrupts(); -void OSEKOSV850SyncContextLoad(OSEKOSSaveType); -void OSEKOSV850SyncContextLoadFromIRQ(OSEKOSSaveType); -void OSEKOSV850ASyncContextLoad(OSEKOSSaveType); -void OSEKOSV850ASyncContextLoadFromIRQ(OSEKOSSaveType); - -// arrays of function pointers - they look like function prototypes -void ( ( * const OSEKOStaskStartAddress [10] ) ( void ) ); -StatusType (* OSEKOStaskStatuses [10][5]) ( void ); - -void OSEKOSV850StartContext -( - OSEK_TASK (( * const ) ( void )), - OSEK_U8 * const -); -void OSEKOSV850StartContextFromIRQ -( - OSEK_TASK (( * const ) ( void )), - OSEK_U8 * const -); - -void OSEKOSSuspendOSInterrupts(void); -void OSEKOSResumeOSInterrupts(void); -void OSEKOSSuspendAllInterrupts(void); -void OSEKOSResumeAllInterrupts(void); -void OSEKOScheckSuspendResumeNesting(void); - - -void OSEKOSgetSR(void); -void OSEKOSEnableInterrupt_intern(int nr); -void OSEKOSDisableInterrupt_intern(int nr); diff --git a/components/testframework/libs/cmock/test/system/test_compilation/parsing.h b/components/testframework/libs/cmock/test/system/test_compilation/parsing.h deleted file mode 100644 index d4734f448..000000000 --- a/components/testframework/libs/cmock/test/system/test_compilation/parsing.h +++ /dev/null @@ -1,89 +0,0 @@ -/* ========================================== - CMock Project - Automatic Mock Generation for C - Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -========================================== */ - -typedef unsigned short U16; -typedef signed int int32_t; - -/* CMock should handle UTF-8 characters in comments. The world is an awesomely diverse place! */ -/* my µC Rocks! Open Source, not ©! My language has no Ümlauts! ǺƜǝƧǾɱɛ! */ /**! Illegal: åäö */ - -typedef struct _POINT_T -{ - int x; - int y; -} POINT_T; - -// typedef edge case; -// not ANSI C but it has been done and will break cmock if not handled -typedef void VOID_TYPE_CRAZINESS; - -/* fun parsing & mock generation cases */ - -void var_args1(int a, ...); -void var_args2(int a, int b, ...); - -VOID_TYPE_CRAZINESS void_type_craziness1(int, float, double, char, short, long, long int, long long, void*); -int void_type_craziness2( VOID_TYPE_CRAZINESS ); - - void crazy_whitespace ( int lint, double shot , short stack ) ; - -char - crazy_multiline -( - int a, - unsigned int b); - -U16 *ptr_return1(int a); -U16* ptr_return2(int a); -U16 * ptr_return3(int a); - -unsigned int** ptr_ptr_return1(unsigned int** a); -unsigned int* *ptr_ptr_return2(unsigned int* *a); -unsigned int **ptr_ptr_return3(unsigned int **a); -unsigned int ** ptr_ptr_return4(unsigned int ** a); - -extern unsigned long int incredible_descriptors(register const unsigned short a); - -int32_t example_c99_type(int32_t param1); - -void I2CIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)); - -/* these are function pointers, not function declarations USING a function pointer, and so should NOT get mocked */ -int (* func_pointer)(void); -extern int (*another_func_pointer)(unsigned int argument); -struct struct_to_be_ignored { - union { - int i32; - void *p; - } variant; - void (*a_function_pointer_in_a_struct)(void *); -}; - -typedef struct -{ - uint32_t a; - struct - { - uint32_t bb; - float bc; - float bd; - } b; - int (*another_function_pointer_in_a_struct) (void); -} another_thing_that_should_get_ignored; - -inline int stuff(int num) -{ - int reg = 0x12; - if (num > 0) - { - reg |= (0x0Eu); - } - else - { - reg |= (0x07u); - } - return reg; -} diff --git a/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml b/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml deleted file mode 100644 index 9349c00f6..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml +++ /dev/null @@ -1,375 +0,0 @@ ---- -#this test is different than all_plugins_coexist primarily because of these options -:cmock: - :enforce_strict_ordering: 1 - :treat_externs: :include - :plugins: - - :array - - :cexception - - :ignore - - :callback - - :return_thru_ptr - - :ignore_arg - - :expect_any_args - -:systest: - :types: | - typedef struct _POINT_T { - int x; - int y; - } POINT_T; - - :mockable: | - #include "CException.h" - void foo(POINT_T* a); - POINT_T* bar(void); - void fooa(POINT_T a[]); - void foos(const char * a); - extern const char* bars(void); - void no_pointers(int a, const char* b); - int mixed(int a, int* b, int c); - void no_args(void); - - :source: - :header: | - #include "CException.h" - void function_a(void); - void function_b(void); - void function_c(void); - int function_d(void); - void function_e(void); - - :code: | - void function_a(void) - { - foo(bar()); - } - - void function_b(void) { - fooa(bar()); - } - - void function_c(void) { - CEXCEPTION_T e; - Try { - foos(bars()); - } Catch(e) { foos("err"); } - } - - int function_d(void) { - int test_list[] = { 1, 2, 3, 4, 5 }; - no_pointers(1, "silly"); - return mixed(6, test_list, 7); - } - - void function_e(void) { - foos("Hello"); - foos("Tuna"); - foos("Oranges"); - } - - :tests: - :common: | - #include "CException.h" - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'handle the situation where we pass nulls to pointers' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we expected nulls to pointers but did not get that' - :code: | - test() - { - POINT_T pt = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_Expect(NULL); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we did not expect nulls to pointers but got null' - :code: | - test() - { - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(NULL); - foo_Expect(&ex); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass single object with expect and it is wrong' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 3}; - bar_ExpectAndReturn(&pt); - foo_Expect(&ex); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass single object with expect and use array handler' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_ExpectWithArray(&ex, 1); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass single object with expect and use array handler and it is wrong' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 3}; - bar_ExpectAndReturn(&pt); - foo_ExpectWithArray(&ex, 1); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass multiple objects with expect and use array handler' - :code: | - test() - { - POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; - POINT_T ex[] = {{1, 2}, {3, 4}, {5, 6}}; - bar_ExpectAndReturn(pt); - foo_ExpectWithArray(ex, 3); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass multiple objects with expect and use array handler and it is wrong at end' - :code: | - test() - { - POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; - POINT_T ex[] = {{1, 2}, {3, 4}, {5, 9}}; - bar_ExpectAndReturn(pt); - foo_ExpectWithArray(ex, 3); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass single array element with expect' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(&pt); - fooa_Expect(&ex); - - function_b(); - } - - - :pass: TRUE - :should: 'handle standard c string as null terminated and not do crappy memory compares of a byte, passing' - :code: | - test() - { - const char* constretval = "This is a\0 silly string"; - char* retval = (char*)constretval; - bars_ExpectAndReturn(retval); - foos_Expect("This is a\0 wacky string"); - - function_c(); - } - - - :pass: FALSE - :should: 'handle standard c string as null terminated and not do crappy memory compares of a byte, finding failures' - :code: | - test() - { - const char* constretval = "This is a silly string"; - char* retval = (char*)constretval; - bars_ExpectAndReturn(retval); - foos_Expect("This is a wacky string"); - - function_c(); - } - - - :pass: TRUE - :should: 'handle creating array expects when we have mixed arguments for single object' - :code: | - test() - { - int expect_list[] = { 1, 9 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectAndReturn(6, expect_list, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: FALSE - :should: 'handle creating array expects when we have mixed arguments and handle failures for single object' - :code: | - test() - { - int expect_list[] = { 9, 1 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectAndReturn(6, expect_list, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'handle creating array expects when we have mixed arguments for multiple objects' - :code: | - test() - { - int expect_list[] = { 1, 2, 3, 4, 6 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: FALSE - :should: 'handle creating array expects when we have mixed arguments and handle failures for multiple objects' - :code: | - test() - { - int expect_list[] = { 1, 2, 3, 4, 6 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectWithArrayAndReturn(6, expect_list, 5, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'handle an exception being caught' - :code: | - test() - { - const char* constretval = "This is a\0 silly string"; - char* retval = (char*)constretval; - bars_ExpectAndReturn(retval); - foos_ExpectAndThrow("This is a\0 wacky string", 55); - foos_Expect("err"); - - function_c(); - } - - - :pass: FALSE - :should: 'handle an exception being caught but still catch following errors' - :code: | - test() - { - const char* constretval = "This is a\0 silly string"; - char* retval = (char*)constretval; - bars_ExpectAndReturn(retval); - foos_ExpectAndThrow("This is a\0 wacky string", 55); - foos_Expect("wrong error"); - - function_c(); - } - - - :pass: FALSE - :should: 'fail strict ordering problems even though we would otherwise have passed' - :code: | - test() - { - int expect_list[] = { 1, 2, 3, 4, 6 }; - mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); - no_pointers_Expect(1, "silly"); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'properly ExpectAnyArgs first function but the other will work properly' - :code: | - test() - { - int expect_list[] = { 1, 2, 3, 4, 6 }; - no_pointers_ExpectAnyArgs(); - mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'properly ExpectAnyArgs last function but the other will work properly' - :code: | - test() - { - no_pointers_Expect(1, "silly"); - mixed_ExpectAnyArgsAndReturn(13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'be ok if we ExpectAnyArgs a call each because we are counting calls' - :code: | - test() - { - foos_ExpectAnyArgs(); - foos_ExpectAnyArgs(); - foos_ExpectAnyArgs(); - - function_e(); - } - - - :pass: TRUE - :should: 'be ok if we ExpectAnyArgs and Expect intermixed because we are counting calls' - :code: | - test() - { - foos_Expect("Hello"); - foos_ExpectAnyArgs(); - foos_ExpectAnyArgs(); - - function_e(); - } - - - :pass: FALSE - :should: 'be able to detect Expect problem if we ExpectAnyArgs and Expect intermixed' - :code: | - test() - { - foos_Expect("Hello"); - foos_ExpectAnyArgs(); - foos_Expect("Wrong"); - - function_e(); - } - - - :pass: FALSE - :should: 'fail if we do not ExpectAnyArgs a call once because we are counting calls' - :code: | - test() - { - foos_ExpectAnyArgs(); - foos_ExpectAnyArgs(); - - function_e(); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_coexist.yml b/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_coexist.yml deleted file mode 100644 index f1c4e38a4..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_coexist.yml +++ /dev/null @@ -1,460 +0,0 @@ ---- -:cmock: - :enforce_strict_ordering: 1 - :plugins: - - :array - - :cexception - - :ignore - - :callback - - :return_thru_ptr - - :ignore_arg - - :expect_any_args - :callback_after_arg_check: true - :callback_include_count: false - :treat_externs: :include - :treat_inlines: :include - -:systest: - :types: | - typedef struct _POINT_T { - int x; - int y; - } POINT_T; - - :mockable: | - #include "CException.h" - extern void foo(POINT_T* a); - POINT_T* bar(void); - void fooa(POINT_T a[]); - void foos(const char * a); - const char * bars(void); - void no_pointers(int a, const char* b); - int mixed(int a, int* b, int c); - void no_args(void); - - :source: - :header: | - #include "CException.h" - void function_a(void); - void function_b(void); - void function_c(void); - int function_d(void); - void function_e(void); - int function_f(void); - - :code: | - void function_a(void) - { - foo(bar()); - } - - void function_b(void) { - fooa(bar()); - } - - void function_c(void) { - CEXCEPTION_T e; - Try { - foos(bars()); - } Catch(e) { foos("err"); } - } - - int function_d(void) { - int test_list[] = { 1, 2, 3, 4, 5 }; - no_pointers(1, "silly"); - return mixed(6, test_list, 7); - } - - void function_e(void) { - foos("Hello"); - foos("Tuna"); - foos("Oranges"); - } - - int function_f(void) { - int a = 1; - int b = 2; - int c; - POINT_T* pt = bar(); - c = pt->x; - c = mixed(a, &b, c); - return b + c; - } - - :tests: - :common: | - #include "CException.h" - void setUp(void) {} - void tearDown(void) {} - void my_foo_callback(POINT_T* a) { TEST_ASSERT_EQUAL_INT(2, a->x); } - int my_mixed_callback(int a, int* b, int c) { return a + *b + c; } - - :units: - - :pass: TRUE - :should: 'handle the situation where we pass nulls to pointers' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we expected nulls to pointers but did not get that' - :code: | - test() - { - POINT_T pt = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_Expect(NULL); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we did not expect nulls to pointers but got null' - :code: | - test() - { - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(NULL); - foo_Expect(&ex); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass single object with expect and it is wrong' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 3}; - bar_ExpectAndReturn(&pt); - foo_Expect(&ex); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass single object with expect and use array handler' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_ExpectWithArray(&ex, 1); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass single object with expect and use array handler and it is wrong' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 3}; - bar_ExpectAndReturn(&pt); - foo_ExpectWithArray(&ex, 1); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass multiple objects with expect and use array handler' - :code: | - test() - { - POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; - POINT_T ex[] = {{1, 2}, {3, 4}, {5, 6}}; - bar_ExpectAndReturn(pt); - foo_ExpectWithArray(ex, 3); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass multiple objects with expect and use array handler and it is wrong at end' - :code: | - test() - { - POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; - POINT_T ex[] = {{1, 2}, {3, 4}, {5, 9}}; - bar_ExpectAndReturn(pt); - foo_ExpectWithArray(ex, 3); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass single array element with expect' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(&pt); - fooa_Expect(&ex); - - function_b(); - } - - - :pass: TRUE - :should: 'handle standard c string as null terminated and not do crappy memory compares of a byte, passing' - :code: | - test() - { - const char* retval = "This is a\0 silly string"; - bars_ExpectAndReturn((char*)retval); - foos_Expect("This is a\0 wacky string"); - - function_c(); - } - - - :pass: FALSE - :should: 'handle standard c string as null terminated and not do crappy memory compares of a byte, finding failures' - :code: | - test() - { - const char* retval = "This is a silly string"; - bars_ExpectAndReturn((char*)retval); - foos_Expect("This is a wacky string"); - - function_c(); - } - - - :pass: TRUE - :should: 'handle creating array expects when we have mixed arguments for single object' - :code: | - test() - { - int expect_list[] = { 1, 9 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectAndReturn(6, expect_list, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: FALSE - :should: 'handle creating array expects when we have mixed arguments and handle failures for single object' - :code: | - test() - { - int expect_list[] = { 9, 1 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectAndReturn(6, expect_list, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'handle creating array expects when we have mixed arguments for multiple objects' - :code: | - test() - { - int expect_list[] = { 1, 2, 3, 4, 6 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: FALSE - :should: 'handle creating array expects when we have mixed arguments and handle failures for multiple objects' - :code: | - test() - { - int expect_list[] = { 1, 2, 3, 4, 6 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectWithArrayAndReturn(6, expect_list, 5, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'handle an exception being caught' - :code: | - test() - { - const char* retval = "This is a\0 silly string"; - bars_ExpectAndReturn((char*)retval); - foos_ExpectAndThrow("This is a\0 wacky string", 55); - foos_Expect("err"); - - function_c(); - } - - - :pass: FALSE - :should: 'handle an exception being caught but still catch following errors' - :code: | - test() - { - const char* retval = "This is a\0 silly string"; - bars_ExpectAndReturn((char*)retval); - foos_ExpectAndThrow("This is a\0 wacky string", 55); - foos_Expect("wrong error"); - - function_c(); - } - - - :pass: FALSE - :should: 'fail strict ordering problems even though we would otherwise have passed' - :code: | - test() - { - int expect_list[] = { 1, 2, 3, 4, 6 }; - mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); - no_pointers_Expect(1, "silly"); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'that we can properly ignore last function but the other will work properly' - :code: | - test() - { - int expect_list[] = { 1, 2, 3, 4, 6 }; - mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); - no_pointers_Ignore(); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'that we can properly ignore first function but the other will work properly' - :code: | - test() - { - mixed_IgnoreAndReturn(13); - no_pointers_Expect(1, "silly"); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'that we just have to ignore a call once because we are not counting calls' - :code: | - test() - { - foos_Ignore(); - - function_e(); - } - - - :pass: TRUE - :should: 'that we can use a callback and an expect' - :code: | - test() - { - POINT_T pt1 = {2, 3}; - POINT_T pt2 = {2, 3}; - bar_ExpectAndReturn(&pt1); - foo_Expect(&pt2); - foo_StubWithCallback((CMOCK_foo_CALLBACK)my_foo_callback); - - function_a(); - } - - - :pass: FALSE - :should: 'that we can fail even when using a callback if we want to expect call but did not and we are checking that' - :code: | - test() - { - POINT_T pt = {2, 3}; - bar_ExpectAndReturn(&pt); - foo_StubWithCallback((CMOCK_foo_CALLBACK)my_foo_callback); - - function_a(); - } - - - :pass: FALSE - :should: 'that we can fail even when using a callback if args are wrong and we are checking those' - :code: | - test() - { - POINT_T pt1 = {2, 3}; - POINT_T pt2 = {1, 3}; - bar_ExpectAndReturn(&pt1); - foo_Expect(&pt2); - foo_StubWithCallback((CMOCK_foo_CALLBACK)my_foo_callback); - - function_a(); - } - - - :pass: FALSE - :should: 'that we can fail from the callback itself' - :code: | - test() - { - POINT_T pt = {3, 3}; - bar_ExpectAndReturn(&pt); - foo_Expect(&pt); - foo_StubWithCallback((CMOCK_foo_CALLBACK)my_foo_callback); - - function_a(); - } - - - :pass: TRUE - :should: 'that a callback return value overrides the one from ExpectAndReturn' - :code: | - test() - { - int b = 2; - POINT_T pt1 = {3, 4}; - bar_ExpectAndReturn(&pt1); - mixed_StubWithCallback((CMOCK_mixed_CALLBACK)my_mixed_callback); - mixed_ExpectAndReturn(1,&b,3,100); - - TEST_ASSERT_EQUAL(8, function_f()); - } - - - :pass: TRUE - :should: 'that a callback return value overrides the one from ExpectAndReturn AND ReturnThruPtr still works' - :code: | - test() - { - int b_in = 2; - int b_out = 3; - POINT_T pt1 = {3, 4}; - bar_ExpectAndReturn(&pt1); - mixed_StubWithCallback((CMOCK_mixed_CALLBACK)my_mixed_callback); - mixed_ExpectAndReturn(1,&b_in,3,100); - mixed_ReturnThruPtr_b(&b_out); - - TEST_ASSERT_EQUAL(9, function_f()); // (a=1, bin=2, c=pt.x=3, bout=3, sum=9) - } - - - :pass: TRUE - :should: 'that a callback return value overrides the one from ExpectAnyArgs' - :code: | - test() - { - POINT_T pt1 = {5, 4}; - bar_ExpectAndReturn(&pt1); - mixed_StubWithCallback((CMOCK_mixed_CALLBACK)my_mixed_callback); - mixed_ExpectAnyArgsAndReturn(100); - - TEST_ASSERT_EQUAL(10, function_f()); // (a=1, bin=2, c=pt.x=5, bout=2, sum=10) - } - - - :pass: TRUE - :should: 'that a callback return value overrides the one from ExpectAnyArgs AND ReturnThruPtr still works' - :code: | - test() - { - int b_out = 3; - POINT_T pt1 = {5, 4}; - bar_ExpectAndReturn(&pt1); - mixed_StubWithCallback((CMOCK_mixed_CALLBACK)my_mixed_callback); - mixed_ExpectAnyArgsAndReturn(100); - mixed_ReturnThruPtr_b(&b_out); - - TEST_ASSERT_EQUAL(11, function_f()); // (a=1, bin=2, c=pt.x=5, bout=3, sum=11) - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/array_and_pointer_handling.yml b/components/testframework/libs/cmock/test/system/test_interactions/array_and_pointer_handling.yml deleted file mode 100644 index ce8928741..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/array_and_pointer_handling.yml +++ /dev/null @@ -1,446 +0,0 @@ ---- -:cmock: - :when_ptr: :smart - :plugins: - - :array - -:systest: - :types: | - typedef struct _POINT_T { - int x; - int y; - } POINT_T; - #define ARRAY_A_SIZE (5) - - :mockable: | - void foo(POINT_T* a); - POINT_T* bar(void); - void fooa(POINT_T a[ARRAY_A_SIZE+1-1]); - void foos(const char * a); - const char * bars(void); - void no_pointers(int a, const char* b); - int mixed(int a, int* b, int c); - void potential_packing_problem(short *a); - void voidpointerfunc(void* a); - - :source: - :header: | - void function_a(void); - void function_b(void); - void function_c(void); - int function_d(void); - void function_e(void); - void function_f(void); - - :code: | - void function_a(void) - { - foo(bar()); - } - - void function_b(void) { - fooa(bar()); - } - - void function_c(void) { - foos(bars()); - } - - int function_d(void) { - int test_list[] = { 1, 2, 3, 4, 5 }; - no_pointers(1, "silly"); - return mixed(6, test_list, 7); - } - - void function_e(void) { - short test_list[] = {-1, -2, -3, -4}; - potential_packing_problem(&test_list[1]); - } - - void function_f(void) { - char arg[6] = "hello"; - voidpointerfunc(arg); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'handle the situation where we pass nulls to pointers' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we expected nulls to pointers but did not get that' - :code: | - test() - { - POINT_T pt = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_Expect(NULL); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we did not expect nulls to pointers but got null' - :code: | - test() - { - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(NULL); - foo_Expect(&ex); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where it falls back to pointers because you asked it to compare 0 elements' - :code: | - test() - { - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(&ex); - foo_ExpectWithArray(&ex, 0); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where it fails because you asked it to compare zero elements and the pointers do not match' - :code: | - test() - { - POINT_T ex = {1, 2}; - POINT_T pt = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_ExpectWithArray(&ex, 0); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass single object with expect' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_Expect(&ex); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass single object with expect and it is wrong' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 3}; - bar_ExpectAndReturn(&pt); - foo_Expect(&ex); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass single object with expect and use array handler' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_ExpectWithArray(&ex, 1); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass single object with expect and use array handler and it is wrong' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 3}; - bar_ExpectAndReturn(&pt); - foo_ExpectWithArray(&ex, 1); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass multiple objects with expect and use array handler' - :code: | - test() - { - POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; - POINT_T ex[] = {{1, 2}, {3, 4}, {5, 6}}; - bar_ExpectAndReturn(pt); - foo_ExpectWithArray(ex, 3); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass multiple objects with expect and use array handler and it is wrong at start' - :code: | - test() - { - POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; - POINT_T ex[] = {{9, 2}, {3, 4}, {5, 6}}; - bar_ExpectAndReturn(pt); - foo_ExpectWithArray(ex, 3); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass multiple objects with expect and use array handler and it is wrong at end' - :code: | - test() - { - POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; - POINT_T ex[] = {{1, 2}, {3, 4}, {5, 9}}; - bar_ExpectAndReturn(pt); - foo_ExpectWithArray(ex, 3); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass multiple objects with expect and use array handler and it is wrong in middle' - :code: | - test() - { - POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; - POINT_T ex[] = {{1, 2}, {3, 9}, {5, 6}}; - bar_ExpectAndReturn(pt); - foo_ExpectWithArray(ex, 3); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass nulls to pointers and fail' - :code: | - test() - { - POINT_T pt = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_Expect(NULL); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass nulls to arrays' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - fooa_Expect(NULL); - - function_b(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass single array element with expect' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(&pt); - fooa_Expect(&ex); - - function_b(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass single array element with expect and it is wrong' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 3}; - bar_ExpectAndReturn(&pt); - fooa_Expect(&ex); - - function_b(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass nulls to arrays and fail' - :code: | - test() - { - POINT_T pt = {1, 2}; - bar_ExpectAndReturn(&pt); - fooa_Expect(NULL); - - function_b(); - } - - - :pass: TRUE - :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, passing' - :code: | - test() - { - const char* retval = "This is a\0 silly string"; - bars_ExpectAndReturn((char*)retval); - foos_Expect("This is a\0 wacky string"); - - function_c(); - } - - - :pass: FALSE - :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, finding failures' - :code: | - test() - { - const char* retval = "This is a silly string"; - bars_ExpectAndReturn((char*)retval); - foos_Expect("This is a wacky string"); - - function_c(); - } - - - :pass: TRUE - :should: 'handle creating array expects when we have mixed arguments for single object' - :code: | - test() - { - int expect_list[] = { 1, 9 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectAndReturn(6, expect_list, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: FALSE - :should: 'handle creating array expects when we have mixed arguments and handle failures for single object' - :code: | - test() - { - int expect_list[] = { 9, 1 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectAndReturn(6, expect_list, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'handle creating array expects when we have mixed arguments for multiple objects' - :code: | - test() - { - int expect_list[] = { 1, 2, 3, 4, 6 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: FALSE - :should: 'handle creating array expects when we have mixed arguments and handle failures for multiple objects' - :code: | - test() - { - int expect_list[] = { 1, 2, 3, 4, 6 }; - no_pointers_Expect(1, "silly"); - mixed_ExpectWithArrayAndReturn(6, expect_list, 5, 7, 13); - - TEST_ASSERT_EQUAL(13, function_d()); - } - - - :pass: TRUE - :should: 'handle a passing version of a potential packing problem (particularly try with ARM simulators)' - :code: | - test() - { - short expect_list[] = { -2, -3, -4 }; - potential_packing_problem_ExpectWithArray(expect_list, 3); - - function_e(); - } - - - :pass: FALSE - :should: 'handle a failing version of a potential packing problem (particularly try with ARM simulators)' - :code: | - test() - { - short expect_list[] = { -2, -3, 4 }; - potential_packing_problem_ExpectWithArray(expect_list, 3); - - function_e(); - } - - - :pass: TRUE - :should: 'handle a void pointers as arguments and still be able to use the array plugin' - :code: | - test() - { - char expect_list[6] = "hello"; - voidpointerfunc_ExpectWithArray(expect_list, 5); - - function_f(); - } - - - :pass: TRUE - :should: 'handle a void pointers as arguments and still be able to use the array plugin (short)' - :code: | - test() - { - char expect_list[6] = "help!"; - voidpointerfunc_ExpectWithArray(expect_list, 3); - - function_f(); - } - - - :pass: FALSE - :should: 'handle a void pointers as arguments and still be able to use the array plugin (fail)' - :code: | - test() - { - char expect_list[6] = "help!"; - voidpointerfunc_ExpectWithArray(expect_list, 4); - - function_f(); - } - - - :pass: TRUE - :should: 'handle a void pointer with a standard expectation (pass)' - :code: | - test() - { - char expect_list[2] = "h"; - voidpointerfunc_Expect(expect_list); - - function_f(); - } - - - :pass: FALSE - :should: 'handle a void pointer with a standard expectation (fail)' - :code: | - test() - { - char expect_list[2] = "g"; - voidpointerfunc_Expect(expect_list); - - function_f(); - } - - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/basic_expect_and_return.yml b/components/testframework/libs/cmock/test/system/test_interactions/basic_expect_and_return.yml deleted file mode 100644 index 38d4edff4..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/basic_expect_and_return.yml +++ /dev/null @@ -1,124 +0,0 @@ ---- -:cmock: - :plugins: - - # none - -:systest: - :types: | - #define UINT32 unsigned int - - typedef signed int custom_type; - - :mockable: | - UINT32 foo(custom_type a); - UINT32 bar(custom_type b); - UINT32 foo_varargs(custom_type a, ...); - const char* foo_char_strings(const char a[], const char* b); - - :source: - :header: | - UINT32 function_a(int a, int b); - void function_b(void); - UINT32 function_c(int a); - const char* function_d(const char a[], const char* b); - - :code: | - UINT32 function_a(int a, int b) - { - return foo((custom_type)a) + bar((custom_type)b); - } - - void function_b(void) { } - - UINT32 function_c(int a) - { - return foo_varargs((custom_type)a, "ignored", 5); - } - - const char* function_d(const char a[], const char* b) - { - return foo_char_strings(a, b); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'successfully exercise two simple ExpectAndReturn mock calls' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - bar_ExpectAndReturn((custom_type)2, 20); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - } - - - :pass: FALSE - :should: 'fail because bar() is not called but is expected' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - } - - - :pass: FALSE - :should: 'fail because bar() is called but is not expected' - :code: | - test() - { - bar_ExpectAndReturn((custom_type)1, 10); - function_b(); - } - - - :pass: TRUE - :should: 'consume var args passed to mocked function' - :code: | - test() - { - foo_varargs_ExpectAndReturn((custom_type)3, 10); - TEST_ASSERT_EQUAL(10, function_c(3)); - } - - - :pass: TRUE - :should: 'handle char strings' - :code: | - test() - { - const char* retval = "moe"; - foo_char_strings_ExpectAndReturn("larry", "curly", (char*)retval); - TEST_ASSERT_EQUAL_STRING("moe", function_d("larry", "curly")); - } - - - :pass: TRUE - :should: 'successfully exercise multiple cycles of expecting and mocking and pass' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - bar_ExpectAndReturn((custom_type)2, 20); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - - foo_ExpectAndReturn((custom_type)3, 30); - bar_ExpectAndReturn((custom_type)4, 40); - TEST_ASSERT_EQUAL(70, function_a(3, 4)); - } - - - :pass: FALSE - :should: 'successfully exercise multiple cycles of expecting and mocking and fail' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - bar_ExpectAndReturn((custom_type)2, 20); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - - foo_ExpectAndReturn((custom_type)3, 30); - bar_ExpectAndReturn((custom_type)4, 40); - TEST_ASSERT_EQUAL(70, function_a(3, 5)); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/const_primitives_handling.yml b/components/testframework/libs/cmock/test/system/test_interactions/const_primitives_handling.yml deleted file mode 100644 index 2fc1b2132..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/const_primitives_handling.yml +++ /dev/null @@ -1,87 +0,0 @@ ---- -:cmock: - :plugins: - - # none - -:systest: - :types: | - - :mockable: | - // no argument names - void foo(char const*, char* const, const char*); - - // argument names - void bar(char const* param1, char* const param2, const char* param3); - - :source: - :header: | - void exercise_const1(char const* param1, char* const param2, const char* param3); - void exercise_const2(char const* param1, char* const param2, const char* param3); - - :code: | - char value1 = '1'; - char value2 = '2'; - - const char* A = &value1; - char* const B = &value2; - const char* C = "C"; - const char* D = "D"; - - void exercise_const1(char const* param1, char* const param2, const char* param3) - { - foo(param1, param2, param3); - } - - void exercise_const2(char const* param1, char* const param2, const char* param3) - { - bar(param1, param2, param3); - } - - :tests: - :common: | - extern const char* A; - extern char* const B; - extern const char* C; - extern const char* D; - - void setUp(void) {} - void tearDown(void) {} - :units: - - :pass: TRUE - :should: 'successfully pass several const parameters' - :code: | - test() - { - foo_Expect( A, B, C ); - exercise_const1( A, B, C ); - } - - - :pass: FALSE - :should: 'should fail upon wrong const arguments passed' - :code: | - test() - { - foo_Expect( A, B, C ); - exercise_const1( (const char*)B, (char * const)A, C ); - } - - - :pass: FALSE - :should: 'should fail upon wrong const arguments passed' - :code: | - test() - { - foo_Expect( A, B, C ); - exercise_const1( A, B, D ); - } - - - :pass: FALSE - :should: 'should fail upon wrong const arguments passed' - :code: | - test() - { - bar_Expect( A, B, C ); - exercise_const2( A, (char * const)C, (const char *)B ); - } - - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/doesnt_leave_details_behind.yml b/components/testframework/libs/cmock/test/system/test_interactions/doesnt_leave_details_behind.yml deleted file mode 100644 index a077839e1..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/doesnt_leave_details_behind.yml +++ /dev/null @@ -1,308 +0,0 @@ ---- -:cmock: - :enforce_strict_ordering: 1 - :plugins: - - :array - - :cexception - - :ignore - - :callback - - :return_thru_ptr - - :ignore_arg - - :expect_any_args - :callback_after_arg_check: false - :callback_include_count: false - :treat_externs: :include - -:systest: - :types: | - typedef struct _POINT_T { - int x; - int y; - } POINT_T; - - :mockable: | - #include "CException.h" - extern void foo(POINT_T* a); - POINT_T* bar(void); - void no_args(void); - - :source: - :header: | - #include "CException.h" - void function_a(void); - int function_b(void); - - :code: | - void function_a(void) - { - foo(bar()); - no_args(); - } - - int function_b(void) - { - POINT_T pt = { 1, 2 }; - foo(&pt); - return (pt.x + pt.y); - } - - :tests: - :common: | - #include "CException.h" - void setUp(void) {} - void tearDown(void) {} - void my_foo_callback(POINT_T* a) { TEST_ASSERT_EQUAL_INT(2, a->x); } - - :units: - - :pass: TRUE - :should: 'just pass if we do not insert anything ugly into it' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - no_args_Expect(); - - function_a(); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after an expect and return' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - foo_Expect(NULL); - no_args_Expect(); - - function_a(); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after an expect' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - no_args_Expect(); - - function_a(); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after throw expectation' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - CEXCEPTION_T e; - - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - no_args_ExpectAndThrow(5); - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - - Try { function_a(); } Catch(e) {} - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after a mock call' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - no_args_Expect(); - - function_a(); - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after throw' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - CEXCEPTION_T e; - - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - no_args_ExpectAndThrow(5); - - Try { function_a(); } Catch(e) {} - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after ignore' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - no_args_Ignore(); - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - - function_a(); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after ignored mock' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - no_args_Ignore(); - - function_a(); - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after callback setup' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - POINT_T pt = { 2, 2 }; - bar_ExpectAndReturn(&pt); - foo_StubWithCallback(my_foo_callback); - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - - no_args_Expect(); - - function_a(); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after mock with callback' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - POINT_T pt = { 2, 2 }; - bar_ExpectAndReturn(&pt); - foo_StubWithCallback(my_foo_callback); - no_args_Expect(); - - function_a(); - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after expect any args' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - POINT_T pt = { 2, 2 }; - bar_ExpectAndReturn(&pt); - foo_ExpectAnyArgs(); - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - - no_args_Expect(); - - function_a(); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after mock which expected any args' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - POINT_T pt = { 2, 2 }; - bar_ExpectAndReturn(&pt); - foo_ExpectAnyArgs(); - no_args_Expect(); - - function_a(); - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after ignored arg' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - POINT_T pt = { 2, 2 }; - bar_ExpectAndReturn(&pt); - foo_Expect(NULL); - foo_IgnoreArg_a(); - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - - no_args_Expect(); - - function_a(); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after mock which ignored an arg' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - POINT_T pt = { 2, 2 }; - bar_ExpectAndReturn(&pt); - foo_Expect(NULL); - foo_IgnoreArg_a(); - no_args_Expect(); - - function_a(); - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after mock which threw a CException' - :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' - :code: | - test() - { - CEXCEPTION_T e; - bar_ExpectAndThrow(0x12); - - Try { - function_a(); - } - Catch(e) {} - - TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); - } - - - :pass: FALSE - :should: 'not contain mock details in failed assertion after mock which used a return thru ptr' - :verify_error: 'FAIL: Expected 3 Was 7. CustomFail' - :code: | - test() - { - POINT_T pt1 = { 1, 2 }; - POINT_T pt2 = { 3, 4 }; - - foo_Expect(&pt1); - foo_ReturnThruPtr_a(&pt2); - - TEST_ASSERT_EQUAL_INT_MESSAGE(3, function_b(), "CustomFail"); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/enforce_strict_ordering.yml b/components/testframework/libs/cmock/test/system/test_interactions/enforce_strict_ordering.yml deleted file mode 100644 index 7d777a4ec..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/enforce_strict_ordering.yml +++ /dev/null @@ -1,247 +0,0 @@ ---- -:cmock: - :enforce_strict_ordering: 1 - :plugins: - - :ignore - - :cexception - -:systest: - :types: | - #define UINT32 unsigned int - - typedef signed int custom_type; - - :mockable: | - #include "CException.h" - UINT32 foo(custom_type a); - UINT32 bar(custom_type b); - void baz(custom_type c); - - :source: - :header: | - #include "CException.h" - UINT32 function_a(int a, int b); - void function_b(void); - void function_c(void); - void function_d(void); - - :code: | - UINT32 function_a(int a, int b) - { - return foo((custom_type)a) + bar((custom_type)b); - } - - void function_b(void) - { - baz((custom_type)1); - foo((custom_type)2); - bar((custom_type)3); - baz((custom_type)4); - foo((custom_type)5); - bar((custom_type)6); - baz((custom_type)7); - } - - void function_c(void) - { - foo((custom_type)1); - foo((custom_type)2); - bar((custom_type)3); - bar((custom_type)4); - foo((custom_type)5); - } - - void function_d(void) - { - CEXCEPTION_T e; - Try - { - foo((custom_type)1); - } - Catch(e) {} - Try - { - bar((custom_type)2); - } - Catch(e) {} - Try - { - foo((custom_type)3); - } - Catch(e) {} - } - - :tests: - :common: | - #include "CException.h" - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'successfully exercise two simple ExpectAndReturn mock calls' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - bar_ExpectAndReturn((custom_type)2, 20); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - } - - - :pass: FALSE - :should: 'fail because bar() is called but is not expected' - :verify_error: 'Called more times than expected' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - } - - - :pass: FALSE - :should: 'fail because bar() is called twice but is expected once' - :verify_error: 'Called fewer times than expected' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - bar_ExpectAndReturn((custom_type)2, 20); - bar_ExpectAndReturn((custom_type)3, 30); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - } - - - :pass: FALSE - :should: 'fail because bar and foo called in reverse order' - :verify_error: 'Called earlier than expected' - :code: | - test() - { - bar_ExpectAndReturn((custom_type)2, 20); - foo_ExpectAndReturn((custom_type)1, 10); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - } - - - :pass: TRUE - :should: 'pass because bar and foo called in order with multiple params' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - foo_ExpectAndReturn((custom_type)2, 10); - bar_ExpectAndReturn((custom_type)3, 20); - bar_ExpectAndReturn((custom_type)4, 10); - foo_ExpectAndReturn((custom_type)5, 10); - function_c(); - } - - - :pass: FALSE - :should: 'fail because bar and foo called out of order at end' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - foo_ExpectAndReturn((custom_type)2, 10); - bar_ExpectAndReturn((custom_type)3, 20); - foo_ExpectAndReturn((custom_type)5, 10); - bar_ExpectAndReturn((custom_type)4, 10); - function_c(); - } - - - :pass: FALSE - :should: 'fail because bar and foo called out of order at start' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)2, 10); - foo_ExpectAndReturn((custom_type)1, 10); - bar_ExpectAndReturn((custom_type)3, 20); - bar_ExpectAndReturn((custom_type)4, 10); - foo_ExpectAndReturn((custom_type)5, 10); - function_c(); - } - - - :pass: TRUE - :should: 'pass because we are properly ignoring baz' - :code: | - test() - { - baz_Ignore(); - foo_ExpectAndReturn((custom_type)2, 10); - bar_ExpectAndReturn((custom_type)3, 20); - foo_ExpectAndReturn((custom_type)5, 10); - bar_ExpectAndReturn((custom_type)6, 10); - function_b(); - } - - - :pass: FALSE - :should: 'fail because bar and foo out of order, even though baz is ignored' - :code: | - test() - { - baz_Ignore(); - foo_ExpectAndReturn((custom_type)2, 10); - foo_ExpectAndReturn((custom_type)5, 10); - bar_ExpectAndReturn((custom_type)3, 20); - bar_ExpectAndReturn((custom_type)6, 10); - function_b(); - } - - - :pass: TRUE - :should: 'pass when using cexception, as long as the order is right' - :code: | - test() - { - foo_ExpectAndThrow((custom_type)1, 10); - bar_ExpectAndReturn((custom_type)2, 20); - foo_ExpectAndReturn((custom_type)3, 10); - function_d(); - } - - - :pass: FALSE - :should: 'fail when an throw call is made out of order' - :code: | - test() - { - bar_ExpectAndReturn((custom_type)2, 20); - foo_ExpectAndThrow((custom_type)1, 10); - foo_ExpectAndReturn((custom_type)3, 10); - function_d(); - } - - - :pass: TRUE - :should: 'successfully handle back to back ExpectAndReturn setup and mock calls' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - bar_ExpectAndReturn((custom_type)2, 20); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - - foo_ExpectAndReturn((custom_type)3, 30); - bar_ExpectAndReturn((custom_type)4, 40); - TEST_ASSERT_EQUAL(70, function_a(3, 4)); - - foo_ExpectAndReturn((custom_type)1, 50); - bar_ExpectAndReturn((custom_type)9, 60); - TEST_ASSERT_EQUAL(110, function_a(1, 9)); - } - - - :pass: FALSE - :should: 'successfully catch errors during back to back ExpectAndReturn setup and mock calls' - :verify_error: 'Called earlier than expected' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - bar_ExpectAndReturn((custom_type)2, 20); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - - foo_ExpectAndReturn((custom_type)3, 30); - bar_ExpectAndReturn((custom_type)4, 40); - TEST_ASSERT_EQUAL(70, function_a(3, 4)); - - bar_ExpectAndReturn((custom_type)9, 60); - foo_ExpectAndReturn((custom_type)1, 50); - TEST_ASSERT_EQUAL(110, function_a(1, 9)); - } -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_custom_types.yml b/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_custom_types.yml deleted file mode 100644 index 5d9d44678..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_custom_types.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- -:cmock: - :plugins: - - # none - :memcmp_if_unknown: false - :unity_helper_path: expect_and_return_custom_types_unity_helper.h - -:systest: - :types: | - typedef struct _EXAMPLE_STRUCT_T { int x; int y; } EXAMPLE_STRUCT_T; - - :mockable: | - EXAMPLE_STRUCT_T foo(EXAMPLE_STRUCT_T a); - - :source: - :header: | - EXAMPLE_STRUCT_T function_a(EXAMPLE_STRUCT_T a, EXAMPLE_STRUCT_T b); - EXAMPLE_STRUCT_T function_b(EXAMPLE_STRUCT_T a, EXAMPLE_STRUCT_T b); - - :code: | - EXAMPLE_STRUCT_T function_a(EXAMPLE_STRUCT_T a, EXAMPLE_STRUCT_T b) - { - EXAMPLE_STRUCT_T retval = foo(a); - retval.x += b.x; - retval.y += b.y; - return retval; - } - - EXAMPLE_STRUCT_T function_b(EXAMPLE_STRUCT_T a, EXAMPLE_STRUCT_T b) - { - EXAMPLE_STRUCT_T retval = foo(b); - retval.x *= a.x; - retval.y *= a.y; - return retval; - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'successfully exercise simple ExpectAndReturn mock calls' - :code: | - test() - { - EXAMPLE_STRUCT_T c = {1,2}; - EXAMPLE_STRUCT_T d = {3,4}; - EXAMPLE_STRUCT_T e = {2,4}; - EXAMPLE_STRUCT_T f = {5,8}; - foo_ExpectAndReturn(c, e); - TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(f, function_a(c,d)); - } - - - :pass: FALSE - :should: 'fail because it is expecting to call foo with c not d' - :code: | - test() - { - EXAMPLE_STRUCT_T c = {1,2}; - EXAMPLE_STRUCT_T d = {3,4}; - EXAMPLE_STRUCT_T e = {2,4}; - EXAMPLE_STRUCT_T f = {5,8}; - foo_ExpectAndReturn(d, e); - TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(f, function_a(c,d)); - } - - - :pass: TRUE - :should: 'successfully exercise simple ExpectAndReturn mock calls on other function' - :code: | - test() - { - EXAMPLE_STRUCT_T c = {1,2}; - EXAMPLE_STRUCT_T d = {3,4}; - EXAMPLE_STRUCT_T e = {2,4}; - EXAMPLE_STRUCT_T f = {2,8}; - foo_ExpectAndReturn(d, e); - TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(f, function_b(c,d)); - } - - - :pass: FALSE - :should: 'fail because it is expecting to call foo with d not c' - :code: | - test() - { - EXAMPLE_STRUCT_T c = {1,2}; - EXAMPLE_STRUCT_T d = {3,4}; - EXAMPLE_STRUCT_T e = {2,4}; - EXAMPLE_STRUCT_T f = {2,8}; - foo_ExpectAndReturn(c, e); - TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(f, function_b(c,d)); - } - - :unity_helper: - :header: | - void AssertEqualExampleStruct(EXAMPLE_STRUCT_T expected, EXAMPLE_STRUCT_T actual, unsigned short line); - #define UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, line, message) {AssertEqualExampleStruct(expected, actual, (unsigned short)line);} - #define TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual) UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, __LINE__, NULL); - - :code: | - void AssertEqualExampleStruct(EXAMPLE_STRUCT_T expected, EXAMPLE_STRUCT_T actual, unsigned short line) - { - UNITY_TEST_ASSERT_EQUAL_INT(expected.x, actual.x, line, "Example Struct Failed For Field x"); - UNITY_TEST_ASSERT_EQUAL_INT(expected.y, actual.y, line, "Example Struct Failed For Field y"); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_treat_as.yml b/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_treat_as.yml deleted file mode 100644 index 2c24f35d8..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_treat_as.yml +++ /dev/null @@ -1,173 +0,0 @@ ---- -:cmock: - :plugins: - - # none - :treat_as: - MY_STRING: STRING - MY_INT: INT - PTR_INT: INT* - MY_HEX: HEX32 - -:systest: - :types: | - typedef const char* MY_STRING; - typedef int MY_INT; - typedef unsigned int MY_HEX; - typedef int* PTR_INT; - - :mockable: | - MY_INT foo(MY_HEX a); - MY_INT bar(MY_HEX b); - MY_STRING foo_char_strings(MY_STRING a, MY_STRING b); - float float_adder(float a, float b); - MY_INT* pointer_foo(MY_HEX* a); - void pointer_bar(PTR_INT a); - - :source: - :header: | - MY_INT function_a(MY_INT a, MY_INT b); - MY_STRING function_b(MY_STRING a, MY_STRING b); - float function_c(float a, float b); - MY_INT function_d(MY_HEX a); - void function_e(PTR_INT a); - - :code: | - MY_INT function_a(MY_INT a, MY_INT b) - { - return foo((MY_HEX)a) + bar((MY_HEX)b); - } - - MY_STRING function_b(MY_STRING a, MY_STRING b) - { - return foo_char_strings(a, b); - } - - float function_c(float a, float b) - { - return float_adder(b, a); - } - - MY_INT function_d(MY_HEX a) - { - MY_HEX b = a; - MY_INT* c = pointer_foo(&b); - return *c; - } - - void function_e(PTR_INT a) - { - pointer_bar(a); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'successfully exercise two simple ExpectAndReturn mock calls' - :code: | - test() - { - foo_ExpectAndReturn((MY_HEX)1, 10); - bar_ExpectAndReturn((MY_HEX)2, 20); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - } - - - :pass: FALSE - :should: 'fail because bar() is expected but not called' - :code: | - test() - { - foo_ExpectAndReturn((MY_HEX)1, 10); - TEST_ASSERT_EQUAL(30, function_a(1, 2)); - } - - - :pass: FALSE - :should: 'fail because foo_char_strings() is called but is not expected' - :code: | - test() - { - foo_char_strings_ExpectAndReturn((MY_STRING)"jello", (MY_STRING)"jiggle", (MY_STRING)"boing!"); - function_a(1,2); - } - - - :pass: TRUE - :should: 'handle char strings' - :code: | - test() - { - foo_char_strings_ExpectAndReturn((MY_STRING)"jello", (MY_STRING)"jiggle", (MY_STRING)"boing!"); - TEST_ASSERT_EQUAL_STRING("boing!", function_b((MY_STRING)"jello", (MY_STRING)"jiggle")); - } - - - :pass: TRUE - :should: 'handle floating point numbers with Unity support: pass' - :code: | - test() - { - float_adder_ExpectAndReturn(1.2345f, 6.7890f, 8.0235f); - TEST_ASSERT_EQUAL_FLOAT(8.0235f, function_c(6.7890f, 1.2345f)); - } - - - :pass: FALSE - :should: 'handle floating point numbers with Unity support: fail' - :code: | - test() - { - float_adder_ExpectAndReturn(1.2345f, 6.7892f, 8.0235f); - TEST_ASSERT_EQUAL_FLOAT(8.0235f, function_c(6.7890f, 1.2345f)); - } - - - :pass: TRUE - :should: 'handle pointers to treat_as values just as cleanly as the treat_as itself for passes' - :code: | - test() - { - MY_HEX TestHex = (MY_HEX)45; - MY_INT TestInt = (MY_INT)33; - pointer_foo_ExpectAndReturn(&TestHex, &TestInt); - TEST_ASSERT_EQUAL_INT(33, function_d(45)); - } - - - :pass: FALSE - :should: 'handle pointers to treat_as values just as cleanly as the treat_as itself for failures' - :verify_error: 'Element 0 Expected 0x0000002D Was 0x0000002B' - :code: | - test() - { - MY_HEX TestHex = (MY_HEX)45; - MY_INT TestInt = (MY_INT)33; - pointer_foo_ExpectAndReturn(&TestHex, &TestInt); - TEST_ASSERT_EQUAL_INT(33, function_d(43)); - } - - - :pass: TRUE - :should: 'handle treat_as values containing pointers for passes' - :code: | - test() - { - MY_INT ExpInt = (MY_INT)33; - PTR_INT ExpPtr = (PTR_INT)(&ExpInt); - MY_INT ActInt = (MY_INT)33; - PTR_INT ActPtr = (PTR_INT)(&ActInt); - pointer_bar_Expect(ExpPtr); - function_e(ActPtr); - } - - - :pass: FALSE - :should: 'handle treat_as values containing pointers for failures' - :verify_error: 'Element 0 Expected 33 Was 45' - :code: | - test() - { - MY_INT ExpInt = (MY_INT)33; - PTR_INT ExpPtr = (PTR_INT)(&ExpInt); - MY_INT ActInt = (MY_INT)45; - PTR_INT ActPtr = (PTR_INT)(&ActInt); - pointer_bar_Expect(ExpPtr); - function_e(ActPtr); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_throw.yml b/components/testframework/libs/cmock/test/system/test_interactions/expect_and_throw.yml deleted file mode 100644 index c22524c64..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_throw.yml +++ /dev/null @@ -1,170 +0,0 @@ ---- -:cmock: - :plugins: - - :cexception - -:systest: - :types: | - #define UINT32 unsigned int - typedef signed int custom_type; - - :mockable: | - #include "CException.h" - UINT32 foo(custom_type a); - UINT32 bar(custom_type b); - UINT32 foo_varargs(custom_type a, ...); - - :source: - :header: | - #include "CException.h" - UINT32 function_a(int a); - void function_b(char a); - - :code: | - UINT32 function_a(int a) - { - UINT32 r = 0; - CEXCEPTION_T e; - - Try - { - r = (UINT32)foo((custom_type)a); - } - Catch(e) - { - r = (UINT32)e*2; - } - return r; - } - - void function_b(char a) - { - if (a) - { - Throw((CEXCEPTION_T)a); - } - } - - :tests: - :common: | - #include "CException.h" - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'successfully exercise a simple ExpectAndReturn mock calls' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - TEST_ASSERT_EQUAL(10, function_a(1)); - } - - - :pass: TRUE - :should: 'successfully throw an error on first call' - :code: | - test() - { - foo_ExpectAndThrow((custom_type)1, 55); - TEST_ASSERT_EQUAL(110, function_a(1)); - } - - - :pass: TRUE - :should: 'successfully throw an error on later calls' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - foo_ExpectAndReturn((custom_type)2, 20); - foo_ExpectAndThrow((custom_type)3, 15); - foo_ExpectAndReturn((custom_type)4, 40); - TEST_ASSERT_EQUAL(10, function_a(1)); - TEST_ASSERT_EQUAL(20, function_a(2)); - TEST_ASSERT_EQUAL(30, function_a(3)); - TEST_ASSERT_EQUAL(40, function_a(4)); - } - - - :pass: TRUE - :should: 'pass because we nothing happens' - :code: | - test() - { - function_b(0); - } - - - :pass: FALSE - :should: 'fail because we did not expect function B to throw' - :code: | - test() - { - function_b(1); - } - - - :pass: TRUE - :should: 'fail because we expect function B to throw' - :code: | - test() - { - CEXCEPTION_T e; - Try - { - function_b(3); - TEST_FAIL_MESSAGE("Should Have Thrown"); - } - Catch(e) - { - TEST_ASSERT_EQUAL(3, e); - } - } - - - :pass: TRUE - :should: 'successfully throw an error on consecutive calls' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - foo_ExpectAndReturn((custom_type)1, 20); - foo_ExpectAndThrow((custom_type)1, 15); - foo_ExpectAndThrow((custom_type)3, 40); - TEST_ASSERT_EQUAL(10, function_a(1)); - TEST_ASSERT_EQUAL(20, function_a(1)); - TEST_ASSERT_EQUAL(30, function_a(1)); - TEST_ASSERT_EQUAL(80, function_a(3)); - } - - - :pass: TRUE - :should: 'successfully throw an error on later calls and after a previous mock call' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - foo_ExpectAndReturn((custom_type)1, 20); - foo_ExpectAndThrow((custom_type)1, 15); - TEST_ASSERT_EQUAL(10, function_a(1)); - TEST_ASSERT_EQUAL(20, function_a(1)); - TEST_ASSERT_EQUAL(30, function_a(1)); - - foo_ExpectAndReturn((custom_type)2, 20); - foo_ExpectAndThrow((custom_type)3, 40); - TEST_ASSERT_EQUAL(20, function_a(2)); - TEST_ASSERT_EQUAL(80, function_a(3)); - } - - - :pass: TRUE - :should: 'successfully throw an error if expects and mocks called before it' - :code: | - test() - { - foo_ExpectAndReturn((custom_type)1, 10); - foo_ExpectAndReturn((custom_type)1, 20); - TEST_ASSERT_EQUAL(10, function_a(1)); - TEST_ASSERT_EQUAL(20, function_a(1)); - - foo_ExpectAndReturn((custom_type)2, 20); - foo_ExpectAndThrow((custom_type)3, 40); - TEST_ASSERT_EQUAL(20, function_a(2)); - TEST_ASSERT_EQUAL(80, function_a(3)); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/expect_any_args.yml b/components/testframework/libs/cmock/test/system/test_interactions/expect_any_args.yml deleted file mode 100644 index 06eb6bb27..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/expect_any_args.yml +++ /dev/null @@ -1,238 +0,0 @@ ---- -:cmock: - :plugins: - - 'expect_any_args' - -:systest: - :types: | - - :mockable: | - int foo(int a); - void bar(int b); - - :source: - :header: | - int function(int a, int b, int c); - void func_b(int a); - :code: | - int function(int a, int b, int c) - { - bar(b); - return foo(a) + foo(b) + foo(c); - } - void func_b(int a) - { - bar(a); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - :units: - - :pass: TRUE - :should: 'successfully exercise simple ExpectAndReturn mock calls' - :code: | - test() - { - bar_Expect(2); - foo_ExpectAndReturn(1, 10); - foo_ExpectAndReturn(2, 20); - foo_ExpectAndReturn(3, 30); - TEST_ASSERT_EQUAL(60, function(1, 2, 3)); - } - - - :pass: TRUE - :should: 'ignore foo() call details' - :code: | - test() - { - bar_Expect(4); - foo_ExpectAnyArgsAndReturn(10); - foo_ExpectAnyArgsAndReturn(40); - foo_ExpectAnyArgsAndReturn(80); - TEST_ASSERT_EQUAL(130, function(3, 4, 3)); - } - - - :pass: FALSE - :should: 'ignore foo() call details and notice if we called foo() more times than expected' - :code: | - test() - { - bar_Expect(4); - foo_ExpectAnyArgsAndReturn(20); - foo_ExpectAnyArgsAndReturn(30); - TEST_ASSERT_EQUAL(50, function(3, 4, 9)); - } - - - :pass: FALSE - :should: 'ignore foo() call details and notice if we called foo() fewer times than expected' - :code: | - test() - { - bar_Expect(4); - foo_ExpectAnyArgsAndReturn(20); - foo_ExpectAnyArgsAndReturn(10); - foo_ExpectAnyArgsAndReturn(50); - foo_ExpectAnyArgsAndReturn(60); - TEST_ASSERT_EQUAL(70, function(3, 4, 9)); - } - - - :pass: TRUE - :should: 'ignore bar() and foo() call details' - :code: | - test() - { - bar_ExpectAnyArgs(); - foo_ExpectAnyArgsAndReturn(50); - foo_ExpectAnyArgsAndReturn(50); - foo_ExpectAnyArgsAndReturn(50); - TEST_ASSERT_EQUAL(150, function(0, 0, 0)); - } - - - :pass: TRUE - :should: 'be able to handle an expect after ignore calls since we are ignoring args only' - :code: | - test() - { - bar_ExpectAnyArgs(); - foo_ExpectAnyArgsAndReturn(50); - foo_ExpectAnyArgsAndReturn(50); - foo_ExpectAndReturn(3, 50); - TEST_ASSERT_EQUAL(150, function(1, 2, 3)); - } - - - :pass: TRUE - :should: 'be able to handle an ignore after an expect call since we are ignoring args only' - :code: | - test() - { - bar_ExpectAnyArgs(); - foo_ExpectAndReturn(1, 50); - foo_ExpectAnyArgsAndReturn(50); - foo_ExpectAnyArgsAndReturn(50); - TEST_ASSERT_EQUAL(150, function(1, 2, 3)); - } - - - :pass: TRUE - :should: 'be able to handle an ignore within expect calls since we are ignoring args only' - :code: | - test() - { - bar_ExpectAnyArgs(); - foo_ExpectAndReturn(1, 50); - foo_ExpectAnyArgsAndReturn(50); - foo_ExpectAndReturn(3, 50); - TEST_ASSERT_EQUAL(150, function(1, 2, 3)); - } - - - :pass: FALSE - :should: 'be able to detect problems with an expect even when using ignores' - :code: | - test() - { - bar_ExpectAnyArgs(); - foo_ExpectAndReturn(1, 50); - foo_ExpectAnyArgsAndReturn(50); - foo_ExpectAndReturn(4, 50); - TEST_ASSERT_EQUAL(150, function(1, 2, 3)); - } - - - :pass: TRUE - :should: 'be able to handle a lone ExpectAnyArg call' - :code: | - test() - { - bar_ExpectAnyArgs(); - func_b(1); - } - - - :pass: FALSE - :should: 'be able to handle a lone ExpectAnyArg call that does not get called' - :code: | - test() - { - bar_ExpectAnyArgs(); - } - - - :pass: FALSE - :should: 'be able to handle a missing ExpectAnyArg call' - :code: | - test() - { - func_b(1); - } - - - :pass: TRUE - :should: 'ignore foo() calls over multiple mock calls' - :code: | - test() - { - bar_ExpectAnyArgs(); - foo_ExpectAnyArgsAndReturn(50); - foo_ExpectAnyArgsAndReturn(60); - foo_ExpectAnyArgsAndReturn(70); - TEST_ASSERT_EQUAL(180, function(0, 0, 0)); - - bar_ExpectAnyArgs(); - foo_ExpectAnyArgsAndReturn(30); - foo_ExpectAnyArgsAndReturn(80); - foo_ExpectAnyArgsAndReturn(10); - TEST_ASSERT_EQUAL(120, function(0, 0, 0)); - - bar_ExpectAnyArgs(); - foo_ExpectAnyArgsAndReturn(70); - foo_ExpectAnyArgsAndReturn(20); - foo_ExpectAnyArgsAndReturn(20); - TEST_ASSERT_EQUAL(110, function(0, 0, 0)); - } - - - :pass: TRUE - :should: 'have multiple cycles of expects still pass when this plugin enabled' - :code: | - test() - { - bar_Expect(2); - foo_ExpectAndReturn(1, 50); - foo_ExpectAndReturn(2, 60); - foo_ExpectAndReturn(3, 70); - TEST_ASSERT_EQUAL(180, function(1, 2, 3)); - - bar_Expect(5); - foo_ExpectAndReturn(4, 30); - foo_ExpectAndReturn(5, 80); - foo_ExpectAndReturn(6, 10); - TEST_ASSERT_EQUAL(120, function(4, 5, 6)); - - bar_Expect(8); - foo_ExpectAndReturn(7, 70); - foo_ExpectAndReturn(8, 20); - foo_ExpectAndReturn(9, 20); - TEST_ASSERT_EQUAL(110, function(7, 8, 9)); - } - - - :pass: FALSE - :should: 'have multiple cycles of expects still fail when this plugin enabled' - :code: | - test() - { - bar_Expect(2); - foo_ExpectAndReturn(1, 50); - foo_ExpectAndReturn(2, 60); - foo_ExpectAndReturn(3, 70); - TEST_ASSERT_EQUAL(180, function(1, 2, 3)); - - bar_Expect(5); - foo_ExpectAndReturn(4, 30); - foo_ExpectAndReturn(5, 80); - foo_ExpectAndReturn(6, 10); - TEST_ASSERT_EQUAL(120, function(4, 5, 6)); - - bar_Expect(8); - foo_ExpectAndReturn(7, 70); - foo_ExpectAndReturn(8, 20); - foo_ExpectAndReturn(9, 20); - TEST_ASSERT_EQUAL(110, function(0, 8, 9)); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/fancy_pointer_handling.yml b/components/testframework/libs/cmock/test/system/test_interactions/fancy_pointer_handling.yml deleted file mode 100644 index 2a47d23f7..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/fancy_pointer_handling.yml +++ /dev/null @@ -1,210 +0,0 @@ ---- -:cmock: - :plugins: - - # none - :treat_as: - INT_PTR: INT* - -:systest: - :types: | - typedef struct _POINT_T { - int x; - int y; - } POINT_T; - typedef int* INT_PTR; - - :mockable: | - void foo(POINT_T* a); - POINT_T* bar(void); - void fooa(POINT_T a[]); - void foos(const char *a); - const char* bars(void); - INT_PTR zoink(INT_PTR a); - - :source: - :header: | - void function_a(void); - void function_b(void); - void function_c(void); - int function_d(void); - - :code: | - void function_a(void) - { - foo(bar()); - } - - void function_b(void) { - fooa(bar()); - } - - void function_c(void) { - foos(bars()); - } - - int function_d(void) { - int i = 456; - INT_PTR ptr = (INT_PTR)(&i); - return (int)(*(zoink(ptr))); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'handle the situation where we pass nulls to pointers' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - foo_Expect(NULL); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass single object with expect' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_Expect(&ex); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass single object with expect and it is wrong' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 3}; - bar_ExpectAndReturn(&pt); - foo_Expect(&ex); - - function_a(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass nulls to pointers and fail' - :code: | - test() - { - POINT_T pt = {1, 2}; - bar_ExpectAndReturn(&pt); - foo_Expect(NULL); - - function_a(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass nulls to arrays' - :code: | - test() - { - bar_ExpectAndReturn(NULL); - fooa_Expect(NULL); - - function_b(); - } - - - :pass: TRUE - :should: 'handle the situation where we pass single array element with expect' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 2}; - bar_ExpectAndReturn(&pt); - fooa_Expect(&ex); - - function_b(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass single array element with expect and it is wrong' - :code: | - test() - { - POINT_T pt = {1, 2}; - POINT_T ex = {1, 3}; - bar_ExpectAndReturn(&pt); - fooa_Expect(&ex); - - function_b(); - } - - - :pass: FALSE - :should: 'handle the situation where we pass nulls to arrays and fail' - :code: | - test() - { - POINT_T pt = {1, 2}; - bar_ExpectAndReturn(&pt); - fooa_Expect(NULL); - - function_b(); - } - - - :pass: TRUE - :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, passing' - :code: | - test() - { - const char* retval = "This is a\0 silly string"; - bars_ExpectAndReturn((char*)retval); - foos_Expect("This is a\0 wacky string"); - - function_c(); - } - - - :pass: FALSE - :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, finding failures' - :code: | - test() - { - const char* retval = "This is a silly string"; - bars_ExpectAndReturn((char*)retval); - foos_Expect("This is a wacky string"); - - function_c(); - } - - - :pass: TRUE - :should: 'handle handle typedefs that ARE pointers by using treat_as' - :code: | - test() - { - int e = 456; - int r = 789; - INT_PTR ptr_e = (INT_PTR)(&e); - INT_PTR ptr_r = (INT_PTR)(&r); - - zoink_ExpectAndReturn(ptr_e, ptr_r); - - TEST_ASSERT_EQUAL(r, function_d()); - } - - - :pass: FALSE - :should: 'handle handle typedefs that ARE pointers by using treat_as and catch failures' - :code: | - test() - { - int e = 457; - int r = 789; - INT_PTR ptr_e = (INT_PTR)(&e); - INT_PTR ptr_r = (INT_PTR)(&r); - - zoink_ExpectAndReturn(ptr_e, ptr_r); - - TEST_ASSERT_EQUAL(r, function_d()); - } - - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/function_pointer_handling.yml b/components/testframework/libs/cmock/test/system/test_interactions/function_pointer_handling.yml deleted file mode 100644 index d286bdb25..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/function_pointer_handling.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -:cmock: - :plugins: - - # none - :treat_as: - FUNCTION_T: PTR - -:systest: - :types: | - typedef void (*FUNCTION_T)(void); - - :mockable: | - void takes_function_type( FUNCTION_T myfunc ); - void takes_function_ptr( unsigned int (*func_ptr)(int, char) ); - void takes_function_ptr_shorthand( unsigned int func_ptr(int, char*) ); - void takes_const_function_ptr( unsigned int (* const)(int, char) ); - unsigned short (*returns_function_ptr( const char op_code ))( int, long int ); - - :source: - :header: | - void exercise_function_pointer_param(void); - unsigned short (*exercise_function_pointer_return( const char op_code ))( int, long int ); - - // functions for function pointer tests - unsigned int dummy_function1(int a, char b); - unsigned short dummy_function2(int a, long int b); - - :code: | - /* - * functions used in tests - */ - - unsigned int dummy_function1(int a, char b) - { - // prevent compiler warnings by using everything - return (unsigned int)a + (unsigned int)b; - } - - unsigned short dummy_function2(int a, long int b) - { - // prevent compiler warnings by using everything - return (unsigned short)a + (unsigned short)b; - } - - /* - * functions executed by tests - */ - - void exercise_function_pointer_param(void) - { - takes_function_ptr(dummy_function1); - } - - unsigned short (*exercise_function_pointer_return( const char op_code ))( int, long int ) - { - return returns_function_ptr(op_code); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - :units: - - :pass: TRUE - :should: 'expect a function pointer param' - :code: | - test() - { - takes_function_ptr_Expect(dummy_function1); - exercise_function_pointer_param(); - } - - - :pass: TRUE - :should: 'return a function pointer' - :code: | - test() - { - returns_function_ptr_ExpectAndReturn('z', dummy_function2); - TEST_ASSERT_EQUAL_PTR(dummy_function2, exercise_function_pointer_return('z')); - } - - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/ignore_and_return.yml b/components/testframework/libs/cmock/test/system/test_interactions/ignore_and_return.yml deleted file mode 100644 index 17f95beef..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/ignore_and_return.yml +++ /dev/null @@ -1,329 +0,0 @@ ---- -:cmock: - :plugins: - - 'ignore' - -:systest: - :types: | - - :mockable: | - int foo(int a); - void bar(int b); - - :source: - :header: | - int function(int a, int b, int c); - :code: | - int function(int a, int b, int c) - { - bar(b); - return foo(a) + foo(b) + foo(c); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - :units: - - :pass: TRUE - :should: 'successfully exercise simple ExpectAndReturn mock calls' - :code: | - test() - { - bar_Expect(2); - foo_ExpectAndReturn(1, 10); - foo_ExpectAndReturn(2, 20); - foo_ExpectAndReturn(3, 30); - TEST_ASSERT_EQUAL(60, function(1, 2, 3)); - } - - - :pass: TRUE - :should: 'ignore foo() calls' - :code: | - test() - { - bar_Expect(4); - foo_IgnoreAndReturn(10); - foo_IgnoreAndReturn(40); - foo_IgnoreAndReturn(80); - TEST_ASSERT_EQUAL(130, function(3, 4, 3)); - } - - - :pass: TRUE - :should: 'ignore the situation where foo() is not called even though we explicitly ignored it' - :code: | - test() - { - foo_IgnoreAndReturn(20); - //notice we do not call foo - } - - - :pass: TRUE - :should: 'ignore foo() calls and always return last item if we run out' - :code: | - test() - { - bar_Expect(4); - foo_IgnoreAndReturn(20); - foo_IgnoreAndReturn(30); - TEST_ASSERT_EQUAL(80, function(3, 4, 9)); - } - - - :pass: TRUE - :should: 'ignore foo() calls and always return only item if only one specified' - :code: | - test() - { - bar_Expect(4); - foo_IgnoreAndReturn(20); - TEST_ASSERT_EQUAL(60, function(3, 4, 9)); - } - - - :pass: TRUE - :should: 'ignore bar() and foo() calls' - :code: | - test() - { - bar_Ignore(); - foo_IgnoreAndReturn(50); - TEST_ASSERT_EQUAL(150, function(0, 0, 0)); - } - - - :pass: TRUE - :should: 'ignore foo() calls over multiple mock calls' - :code: | - test() - { - bar_Ignore(); - foo_IgnoreAndReturn(50); - foo_IgnoreAndReturn(60); - foo_IgnoreAndReturn(70); - TEST_ASSERT_EQUAL(180, function(0, 0, 0)); - - bar_Ignore(); - foo_IgnoreAndReturn(30); - foo_IgnoreAndReturn(80); - foo_IgnoreAndReturn(10); - TEST_ASSERT_EQUAL(120, function(0, 0, 0)); - - foo_IgnoreAndReturn(70); - foo_IgnoreAndReturn(20); - TEST_ASSERT_EQUAL(110, function(0, 0, 0)); - } - - - :pass: TRUE - :should: 'multiple cycles of expects still pass when ignores enabled' - :code: | - test() - { - bar_Expect(2); - foo_ExpectAndReturn(1, 50); - foo_ExpectAndReturn(2, 60); - foo_ExpectAndReturn(3, 70); - TEST_ASSERT_EQUAL(180, function(1, 2, 3)); - - bar_Expect(5); - foo_ExpectAndReturn(4, 30); - foo_ExpectAndReturn(5, 80); - foo_ExpectAndReturn(6, 10); - TEST_ASSERT_EQUAL(120, function(4, 5, 6)); - - bar_Expect(8); - foo_ExpectAndReturn(7, 70); - foo_ExpectAndReturn(8, 20); - foo_ExpectAndReturn(9, 20); - TEST_ASSERT_EQUAL(110, function(7, 8, 9)); - } - - - :pass: FALSE - :should: 'multiple cycles of expects still fail when ignores enabled' - :code: | - test() - { - bar_Expect(2); - foo_ExpectAndReturn(1, 50); - foo_ExpectAndReturn(2, 60); - foo_ExpectAndReturn(3, 70); - TEST_ASSERT_EQUAL(180, function(1, 2, 3)); - - bar_Expect(5); - foo_ExpectAndReturn(4, 30); - foo_ExpectAndReturn(5, 80); - foo_ExpectAndReturn(6, 10); - TEST_ASSERT_EQUAL(120, function(4, 5, 6)); - - bar_Expect(8); - foo_ExpectAndReturn(7, 70); - foo_ExpectAndReturn(8, 20); - foo_ExpectAndReturn(9, 20); - TEST_ASSERT_EQUAL(110, function(0, 8, 9)); - } - - - :pass: FALSE - :should: 'With "fail_on_unexpected_calls" enabled, Expect/Ignore/... of bar is required and test fails.' - :code: | - test() - { - function(1, 2, 3); - } - - - :pass: TRUE - :should: 'we can override an ignore with an expect and pass' - :code: | - test() - { - bar_Ignore(); - - bar_Expect(2); - foo_ExpectAndReturn(1, 50); - foo_ExpectAndReturn(2, 60); - foo_ExpectAndReturn(3, 70); - TEST_ASSERT_EQUAL(180, function(1, 2, 3)); - - bar_Expect(5); - foo_ExpectAndReturn(4, 30); - foo_ExpectAndReturn(5, 80); - foo_ExpectAndReturn(6, 10); - TEST_ASSERT_EQUAL(120, function(4, 5, 6)); - - bar_Expect(8); - foo_ExpectAndReturn(7, 70); - foo_ExpectAndReturn(8, 20); - foo_ExpectAndReturn(9, 20); - TEST_ASSERT_EQUAL(110, function(7, 8, 9)); - } - - - :pass: FALSE - :should: 'we can override an ignore with an expect and fail' - :code: | - test() - { - bar_Ignore(); - - bar_Expect(2); - foo_ExpectAndReturn(1, 50); - foo_ExpectAndReturn(2, 60); - foo_ExpectAndReturn(3, 70); - TEST_ASSERT_EQUAL(180, function(1, 2, 3)); - - bar_Expect(5); - foo_ExpectAndReturn(4, 30); - foo_ExpectAndReturn(5, 80); - foo_ExpectAndReturn(6, 10); - TEST_ASSERT_EQUAL(120, function(4, 5, 6)); - - bar_Expect(9); - foo_ExpectAndReturn(7, 70); - foo_ExpectAndReturn(8, 20); - foo_ExpectAndReturn(9, 20); - TEST_ASSERT_EQUAL(110, function(7, 8, 9)); - } - - - :pass: TRUE - :should: 'we can override an ignore and return with an expect and pass' - :code: | - test() - { - bar_Ignore(); - foo_IgnoreAndReturn(30); - TEST_ASSERT_EQUAL(90, function(1, 2, 3)); - - bar_Expect(5); - foo_ExpectAndReturn(4, 30); - foo_ExpectAndReturn(5, 80); - foo_ExpectAndReturn(6, 10); - TEST_ASSERT_EQUAL(120, function(4, 5, 6)); - - bar_Expect(8); - foo_ExpectAndReturn(7, 70); - foo_ExpectAndReturn(8, 20); - foo_ExpectAndReturn(9, 20); - TEST_ASSERT_EQUAL(110, function(7, 8, 9)); - } - - - :pass: FALSE - :should: 'we can override an ignore and return with an expect and fail' - :code: | - test() - { - bar_Ignore(); - foo_IgnoreAndReturn(0); - TEST_ASSERT_EQUAL(0, function(1, 2, 3)); - - bar_Expect(5); - foo_ExpectAndReturn(4, 30); - foo_ExpectAndReturn(5, 80); - foo_ExpectAndReturn(6, 10); - TEST_ASSERT_EQUAL(120, function(4, 5, 6)); - - bar_Expect(9); - foo_ExpectAndReturn(7, 70); - foo_ExpectAndReturn(8, 20); - foo_ExpectAndReturn(9, 20); - TEST_ASSERT_EQUAL(110, function(7, 8, 9)); - } - - - :pass: TRUE - :should: 'we can override an an expect with an ignore' - :code: | - test() - { - bar_Expect(5); - bar_Ignore(); - foo_ExpectAndReturn(1, 50); - foo_ExpectAndReturn(2, 60); - foo_ExpectAndReturn(3, 70); - TEST_ASSERT_EQUAL(180, function(1, 2, 3)); - } - - - :pass: TRUE - :should: 'we can override an expect with an ignore and return and pass' - :code: | - test() - { - bar_Ignore(); - foo_IgnoreAndReturn(0); - TEST_ASSERT_EQUAL(0, function(1, 2, 3)); - - bar_Expect(5); - foo_ExpectAndReturn(4, 30); - foo_ExpectAndReturn(5, 80); - foo_IgnoreAndReturn(10); - TEST_ASSERT_EQUAL(120, function(4, 5, 6)); - - bar_Ignore(); - foo_IgnoreAndReturn(60); - TEST_ASSERT_EQUAL(180, function(7, 8, 9)); - } - - - :pass: FALSE - :should: 'we can override an expect with an ignore and return and fail after' - :code: | - test() - { - bar_Expect(5); - foo_ExpectAndReturn(4, 30); - foo_ExpectAndReturn(5, 50); - foo_IgnoreAndReturn(20); - TEST_ASSERT_EQUAL(100, function(4, 5, 6)); - - bar_Expect(5); - foo_ExpectAndReturn(9, 30); //THIS ONE WILL FAIL - foo_ExpectAndReturn(2, 80); - foo_ExpectAndReturn(3, 60); - TEST_ASSERT_EQUAL(170, function(1, 2, 3)); - } - - - :pass: TRUE - :should: 'we can override an expect with an ignore and return and the expected values are ignored' - :code: | - test() - { - bar_Expect(5); - foo_ExpectAndReturn(2, 30); //NOTE THIS WOULD NORMALLY FAIL - foo_ExpectAndReturn(5, 50); - foo_IgnoreAndReturn(20); //BUT WE SAID WE NO LONGER CARE - TEST_ASSERT_EQUAL(100, function(4, 5, 6)); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/ignore_strict_mock_calling.yml b/components/testframework/libs/cmock/test/system/test_interactions/ignore_strict_mock_calling.yml deleted file mode 100644 index bcfe04c5e..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/ignore_strict_mock_calling.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -:cmock: - :plugins: - - 'ignore' - :fail_on_unexpected_calls: FALSE - -:systest: - :types: | - - :mockable: | - int foo(int a); - void bar(int b); - - :source: - :header: | - int function(int a, int b, int c); - :code: | - int function(int a, int b, int c) - { - bar(b); - return foo(a) + foo(b) + foo(c); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - :units: - - :pass: TRUE - :should: 'With "fail_on_unexpected_calls" disabled, Expect/Ignore/... of bar is NOT required.' - :code: | - test() - { - function(1, 2, 3); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/newer_standards_stuff1.yml b/components/testframework/libs/cmock/test/system/test_interactions/newer_standards_stuff1.yml deleted file mode 100644 index 6843eae60..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/newer_standards_stuff1.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -#The purpose of this test is to pull in some standard library stuff from C99 -:cmock: - :includes: - - "" - - "" - -:systest: - :types: | - #include - #include - - - :mockable: | - int32_t foo(int32_t a); - - :source: - :header: | - int8_t function_a(void); - - :code: | - int8_t function_a(void) { - return (int8_t)(INT_MIN == foo(INT_MAX)); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'handle handle a simple comparison of C99 types which pass' - :code: | - test() - { - foo_ExpectAndReturn(INT_MAX, INT_MIN); - - TEST_ASSERT_TRUE(function_a()); - } - - - :pass: FALSE - :should: 'handle handle a simple comparison of C99 types which fail' - :code: | - test() - { - foo_ExpectAndReturn(INT_MIN, INT_MIN); - - TEST_ASSERT_TRUE(function_a()); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_1.yml b/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_1.yml deleted file mode 100644 index 01538ea32..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_1.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- -#The purpose of this test is to play with things like "const char const *" which isn't supported by some compilers -:cmock: - :enforce_strict_ordering: 1 - :plugins: - - :array - - :cexception - - :ignore - -:systest: - :types: | - typedef struct _POINT_T { - int x; - int y; - } POINT_T; - - :mockable: | - #include "CException.h" - void foos(const char const * a); - const char const * bars(void); - - :source: - :header: | - #include "CException.h" - void function_a(void); - void function_b(void); - void function_c(void); - int function_d(void); - - :code: | - void function_c(void) { - CEXCEPTION_T e; - Try { - foos(bars()); - } Catch(e) { foos("err"); } - } - - :tests: - :common: | - #include "CException.h" - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, passing' - :code: | - test() - { - bars_ExpectAndReturn("This is a\0 silly string"); - foos_Expect("This is a\0 wacky string"); - - function_c(); - } - - - :pass: FALSE - :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, finding failures' - :code: | - test() - { - bars_ExpectAndReturn("This is a silly string"); - foos_Expect("This is a wacky string"); - - function_c(); - } - - - :pass: TRUE - :should: 'handle an exception being caught' - :code: | - test() - { - bars_ExpectAndReturn("This is a\0 silly string"); - foos_ExpectAndThrow("This is a\0 wacky string", 55); - foos_Expect("err"); - - function_c(); - } - - - :pass: FALSE - :should: 'handle an exception being caught but still catch following errors' - :code: | - test() - { - bars_ExpectAndReturn("This is a\0 silly string"); - foos_ExpectAndThrow("This is a\0 wacky string", 55); - foos_Expect("wrong error"); - - function_c(); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml b/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml deleted file mode 100644 index 506e7ee8a..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -#The purpose of this test is to play with our really rough multidimensional array support, which involves an implicit cast not supported everywhere -:cmock: - :plugins: - - :array - -:systest: - :types: | - - - :mockable: | - void foo(unsigned char** a); - unsigned char** bar(void); - - :source: - :header: | - void function_a(void); - - :code: | - void function_a(void) { - foo(bar()); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'handle two dimensional array of unsigned characters just like we would handle a single dimensional array in expect (where we really only care about first element)' - :code: | - test() - { - unsigned char a[] = { 1, 2, 3, 4, 5, 6 }; - unsigned char** pa = (unsigned char**)(&a); - - bar_ExpectAndReturn(pa); - foo_Expect(pa); - - function_a(); - } - - - :pass: FALSE - :should: 'handle two dimensional array of unsigned characters just like we would handle a single dimensional array in expect as failures (where we really only care about first element)' - :code: | - test() - { - unsigned char a[] = { 1, 2, 3, 4, 5, 6 }; - unsigned char b[] = { 5, 6, 7, 8, 9, 0 }; - unsigned char** pa = (unsigned char**)(&a); - unsigned char** pb = (unsigned char**)(&b); - - bar_ExpectAndReturn(pa); - foo_Expect(pb); - - function_a(); - } -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/out_of_memory.yml b/components/testframework/libs/cmock/test/system/test_interactions/out_of_memory.yml deleted file mode 100644 index ed7bed5c1..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/out_of_memory.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -:cmock: - :plugins: [] - :treat_as: - custom_type: INT - -:systest: - :types: | - typedef struct _BIG_FAT_STRUCT_T - { - char bytes[512]; - } BIG_FAT_STRUCT_T; - - :mockable: | - void foo(BIG_FAT_STRUCT_T a); - - :source: - :header: | - void function_a(void); - void function_b(void); - - :code: | - void function_a(void) - { - BIG_FAT_STRUCT_T stuff = { { 8, 0 } }; - foo(stuff); - } - - void function_b(void) - { - BIG_FAT_STRUCT_T stuff1 = { { 9, 1, 0 } }; - BIG_FAT_STRUCT_T stuff2 = { { 9, 2, 0 } }; - foo(stuff1); - foo(stuff2); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'successfully should be able to run function a because it only takes half the memory' - :code: | - test() - { - BIG_FAT_STRUCT_T expected = { { 8, 0 } }; - foo_Expect(expected); - function_a(); - } - - - :pass: FALSE - :should: 'should error out because we do not have eough memory to handle two of these structures' - :code: | - test() - { - BIG_FAT_STRUCT_T expected1 = { { 9, 1, 0 } }; - BIG_FAT_STRUCT_T expected2 = { { 9, 2, 0 } }; - foo_Expect(expected1); - foo_Expect(expected2); - function_b(); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/parsing_challenges.yml b/components/testframework/libs/cmock/test/system/test_interactions/parsing_challenges.yml deleted file mode 100644 index 77e857d86..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/parsing_challenges.yml +++ /dev/null @@ -1,242 +0,0 @@ ---- -:cmock: - :plugins: - - # no plugins - :treat_as_void: - - VOID_TYPE_CRAZINESS_CFG - :treat_as: - TypeDefInt: HEX8 - VOID_TYPE_CRAZINESS_CFG*: PTR - -:systest: - :types: | - typedef unsigned short U16; - typedef struct _POINT_T - { - int x; - int y; - } POINT_T; - typedef void VOID_TYPE_CRAZINESS_CFG; - typedef int TypeDefInt; - - :mockable: | - /* Make sure we ignore the following - #include "NonExistantFile.h - */ - //#include "AndIgnoreThisToo.h" - #ifdef __cplusplus - extern "C" { - #endif - #define SHOULD_IGNORE_NEXT_FUNC_DEF_AS_PART_OF_MACRO \ - void IgnoredFunction(NotAValidType ToMakeItFailIfWeActuallyMockedThis); - - // typedef edge case; must be in mockable.h for test to compile - // not ANSI C but it has been done and will break cmock if not handled - typedef void VOID_TYPE_CRAZINESS_LCL; - - VOID_TYPE_CRAZINESS_LCL void_type_craziness1(int * a, int *b, int* c); - void void_type_craziness2(VOID_TYPE_CRAZINESS_CFG); - void void_type_craziness3(VOID_TYPE_CRAZINESS_CFG* a); - - // pointer parsing exercise - U16 *ptr_return1(int a); - U16* ptr_return2(int a); - U16 * ptr_return3(int a); - - unsigned int** ptr_ptr_return1(unsigned int** a); - unsigned int* *ptr_ptr_return2(unsigned int* *a); - unsigned int **ptr_ptr_return3(unsigned int **a); - unsigned int ** ptr_ptr_return4(unsigned int ** a); - - // variable argument lists - void var_args1(int a, ...); - void var_args2(int a, int b, ...); - - // parsing "stress tests" - char - crazy_multiline( - int a, - unsigned int b); - - unsigned long int incredible_descriptors(register const unsigned short a); - - TypeDefInt uses_typedef_like_names(TypeDefInt typedefvar); - - void oh_brackets1(int fudge[5]); - void oh_brackets2(int caramel[]); - void oh_brackets3(int toffee[(32)]); - void oh_brackets4(int taffy[ (64) ]); - #ifdef __cplusplus - } - #endif - - :source: - :header: | - U16* exercise_return_pointers(int a); - void exercise_var_args(int a, int b); - void exercise_arglist_pointers(void); - char exercise_multiline_declarations(int a, unsigned int b); - void exercise_double_pointers(unsigned int** a); - int exercise_many_descriptors(int a); - void exercise_type_craziness3(VOID_TYPE_CRAZINESS_CFG* a); - TypeDefInt exercise_typedef_like_names(TypeDefInt a); - - :code: | - int A, B, C; - unsigned int *pA, *pB, *pC; - - U16* exercise_return_pointers(int a) - { - ptr_return1(a); - ptr_return2(a); - return ptr_return3(a); - } - - void exercise_var_args(int a, int b) - { - var_args1(a, 3); - var_args2(a, b, 'c'); - } - - void exercise_arglist_pointers(void) - { - void_type_craziness1(&A, &B, &C); - void_type_craziness2(); - } - - char exercise_multiline_declarations(int a, unsigned int b) - { - return crazy_multiline(a, b); - } - - void exercise_double_pointers(unsigned int** a) - { - ptr_ptr_return1((unsigned int**)a); - ptr_ptr_return2((unsigned int**)a); - ptr_ptr_return3((unsigned int**)a); - ptr_ptr_return4((unsigned int**)a); - } - - int exercise_many_descriptors(int a) - { - return (int)incredible_descriptors((unsigned short)a); - } - - void exercise_type_craziness3(VOID_TYPE_CRAZINESS_CFG* a) - { - void_type_craziness3(a); - } - - TypeDefInt exercise_typedef_like_names(TypeDefInt a) - { - return uses_typedef_like_names(a); - } - - :tests: - :common: | - extern int A, B, C; - extern unsigned int *pA, *pB, *pC; - - void setUp(void) - { - A = 100; - B = 200; - C = 300; - pA = (unsigned int*)(&A); - pB = (unsigned int*)(&B); - pC = (unsigned int*)(&C); - } - void tearDown(void) {} - :units: - - :pass: TRUE - :should: 'execute simple pointer return value check' - :code: | - test() - { - U16 retval; - ptr_return1_ExpectAndReturn(2, NULL); - ptr_return2_ExpectAndReturn(2, NULL); - ptr_return3_ExpectAndReturn(2, &retval); - TEST_ASSERT_EQUAL_PTR(&retval, exercise_return_pointers(2)); - } - - - :pass: TRUE - :should: 'ignore var args in expect prototype generation' - :code: | - test() - { - var_args1_Expect(2); - var_args2_Expect(2, 3); - exercise_var_args(2, 3); - } - - - :pass: TRUE - :should: "not process a typedef'd void as anything other than void" - :code: | - test() - { - void_type_craziness1_Expect(&A, &B, &C); - void_type_craziness2_Expect(); - exercise_arglist_pointers(); - } - - - :pass: TRUE - :should: 'successfully mock crazy multline function prototypes' - :code: | - test() - { - crazy_multiline_ExpectAndReturn(-10, 11, 'z'); - TEST_ASSERT_EQUAL('z', exercise_multiline_declarations(-10, 11)); - } - - - :pass: TRUE - :should: 'mock double pointers just fine' - :code: | - test() - { - ptr_ptr_return1_ExpectAndReturn(&pA, &pB); - ptr_ptr_return2_ExpectAndReturn(&pA, &pB); - ptr_ptr_return3_ExpectAndReturn(&pA, &pB); - ptr_ptr_return4_ExpectAndReturn(&pA, &pB); - exercise_double_pointers((unsigned int**)(&pA)); - } - - - :pass: TRUE - :should: 'mock prototypes with long lists of return and parameter type descriptors' - :code: | - test() - { - incredible_descriptors_ExpectAndReturn(888, 777); - TEST_ASSERT_EQUAL(777, exercise_many_descriptors(888)); - } - - - :pass: TRUE - :should: 'handle words like typdef as PART of a variable or type' - :code: | - test() - { - uses_typedef_like_names_ExpectAndReturn((TypeDefInt)54, (TypeDefInt)53); - TEST_ASSERT_EQUAL(53, exercise_typedef_like_names((TypeDefInt)54)); - } - - - :pass: FALSE - :should: 'handle words like typdef as PART of a variable or type during failing tests' - :code: | - test() - { - uses_typedef_like_names_ExpectAndReturn((TypeDefInt)52, (TypeDefInt)53); - TEST_ASSERT_EQUAL(53, exercise_typedef_like_names((TypeDefInt)54)); - } - - - :pass: TRUE - :should: 'handle typedef of void used as a void pointer' - :code: | - test() - { - char blah[5] = "blah"; - void_type_craziness3_Expect(blah); - exercise_type_craziness3(blah); - } - - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml b/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml deleted file mode 100644 index 40e0e7f62..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml +++ /dev/null @@ -1,235 +0,0 @@ ---- -:cmock: - :mock_path: test/mocks - :mock_prefix: mock_ - :treat_as: - abs_struct: PTR - intptr: INT* - :when_ptr: :smart - :plugins: - - :array - - :ignore_arg - - :return_thru_ptr - -:systest: - :types: | - typedef int *intptr; - - struct a_struct - { - int i1; - int i2; - int i3; - }; - - struct _abs_struct - { - int abs_i1; - int abs_i2; - }; - - typedef struct _abs_struct abs_struct; - - :mockable: | - void ptr_ret_int(int *r); - void ptr_ret_ints(int *r, int *s); - void ptr_ret_array(char r[], int len); - void ptr_ret_typedef(intptr r); - void ptr_ret_struct(struct a_struct *r); - void ptr_ret_abstract(abs_struct *r); - void ptr_ret_abstract_array(abs_struct *r, int len); - void ptr_ret_const_int(int *r, const int *s); - void ptr_ret_string(char *s); - - :source: - :header: | - #include - #define lengthof(x) (sizeof(x)/sizeof((x)[0])) - - :code: | - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: "handle a single int* argument" - :code: | - test() - { - int r = 1; - int res = 4; - - ptr_ret_int_Expect(&r); - ptr_ret_int_ReturnThruPtr_r(&res); - ptr_ret_int(&r); - TEST_ASSERT_EQUAL(4, r); - } - - - :pass: TRUE - :should: "handle multiple calls" - :code: | - test() - { - int r = 1; - int res1 = 4; - int res2 = 8; - int res3 = 16; - - ptr_ret_int_Expect(&r); - ptr_ret_int_ReturnThruPtr_r(&res1); - ptr_ret_int_Expect(&r); - ptr_ret_int_ReturnThruPtr_r(&res2); - ptr_ret_int_Expect(&r); - ptr_ret_int_ReturnThruPtr_r(&res3); - - ptr_ret_int(&r); - TEST_ASSERT_EQUAL(4, r); - ptr_ret_int(&r); - TEST_ASSERT_EQUAL(8, r); - ptr_ret_int(&r); - TEST_ASSERT_EQUAL(16, r); - - } - - - :pass: TRUE - :should: "ignore an argument" - :code: | - test() - { - int r = 1, s = 2; - int res = 4; - - ptr_ret_int_Expect(&r); - ptr_ret_int_IgnoreArg_r(); - ptr_ret_int_ReturnThruPtr_r(&res); - ptr_ret_int(&s); - TEST_ASSERT_EQUAL(4, s); - } - - - :pass: TRUE - :should: "ignore a null pointer argument" - :code: | - test() - { - int r = 1; - int res = 4; - - ptr_ret_int_Expect(NULL); - ptr_ret_int_IgnoreArg_r(); - ptr_ret_int_ReturnThruPtr_r(&res); - ptr_ret_int(&r); - TEST_ASSERT_EQUAL(4, r); - } - - - :pass: TRUE - :should: "handle multiple int* arguments" - :code: | - test() - { - int r, s = 0x0880AA55; - int r_res = 4; - int s_res = 6; - - ptr_ret_ints_Expect(&r, &s); - ptr_ret_ints_ReturnThruPtr_r(&r_res); - ptr_ret_ints_ReturnThruPtr_s(&s_res); - ptr_ret_ints(&r, &s); - TEST_ASSERT_EQUAL(4, r); - TEST_ASSERT_EQUAL(6, s); - } - - - :pass: TRUE - :should: "only return through pointer when asked to" - :code: | - test() - { - int r = 0x0880AA55; - int s = 0xAA55; - int r_res = 4; - - ptr_ret_ints_Expect(&r, &s); - ptr_ret_ints_ReturnThruPtr_r(&r_res); - ptr_ret_ints(&r, &s); - TEST_ASSERT_EQUAL(4, r); - TEST_ASSERT_EQUAL(0xAA55, s); - } - - - :pass: TRUE - :should: "return an array through a pointer correctly" - :code: | - test() - { - char r_a[] = "booboorooboo"; - char r_a_ret[] = "FEEFI"; - - ptr_ret_array_Expect(r_a, lengthof(r_a)); - ptr_ret_array_ReturnArrayThruPtr_r(r_a_ret, (int)strlen(r_a_ret)); - ptr_ret_array(r_a, lengthof(r_a)); - TEST_ASSERT_EQUAL_STRING("FEEFIorooboo", r_a); - } - - - :pass: TRUE - :should: "handle structs" - :code: | - test() - { - struct a_struct r_s = { .i1 = 2, .i2 = 3, .i3 = 4, }; - struct a_struct r_s_ret = { .i1 = 8, .i2 = 16, .i3 = 32, }; - - ptr_ret_struct_Expect(&r_s); - ptr_ret_struct_ReturnThruPtr_r(&r_s_ret); - ptr_ret_struct(&r_s); - TEST_ASSERT_EQUAL_MEMORY(&r_s_ret, &r_s, sizeof(struct a_struct)); - } - - - :pass: TRUE - :should: "handle typedefs" - :code: | - test() - { - abs_struct r_as = {.abs_i1 = 0x1234, .abs_i2 = 0x4567}; - abs_struct r_as_ret = {.abs_i1 = 0xFFAA55, .abs_i2 = 0xAAFFAA}; - ptr_ret_abstract_Expect(&r_as); - ptr_ret_abstract_ReturnMemThruPtr_r(&r_as_ret, sizeof(abs_struct)); - ptr_ret_abstract(&r_as); - TEST_ASSERT_EQUAL_MEMORY(&r_as_ret, &r_as, sizeof(abs_struct)); - } - - - :pass: TRUE - :should: "only generate ReturnThruPtr definitions for non-const arguments" - :code: | - test() - { - #if !defined(ptr_ret_const_int_ReturnThruPtr_r) - TEST_FAIL_MESSAGE("ReturnThruPtr not defined for a pointer argument."); - #endif - - #if defined(ptr_ret_const_int_ReturnThruPtr_s) - TEST_FAIL_MESSAGE("ReturnThruPtr defined for a const pointer argument."); - #endif - } - - - :pass: TRUE - :should: "generate ReturnThruPtr definitions for string arguments" - :code: | - test() - { - #if !defined(ptr_ret_string_ReturnThruPtr_s) - TEST_FAIL_MESSAGE("ReturnThruPtr not defined for a string argument."); - #endif - } - - - :pass: TRUE - :should: "generate IgnoreArg definitions" - :code: | - test() - { - #if !defined(ptr_ret_array_IgnoreArg_r) \ - || !defined(ptr_ret_array_IgnoreArg_len) \ - || !defined(ptr_ret_const_int_IgnoreArg_s) - TEST_FAIL_MESSAGE("IgnoreArg not defined for an argument."); - #endif - } diff --git a/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml b/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml deleted file mode 100644 index 8b07be997..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml +++ /dev/null @@ -1,231 +0,0 @@ ---- -:cmock: - :mock_path: test/mocks - :mock_prefix: mock_ - :treat_as: - abs_struct: PTR - intptr: INT* - :when_ptr: :smart - :plugins: - - :array - - :expect_any_args - - :return_thru_ptr - -:systest: - :types: | - typedef int *intptr; - - struct a_struct - { - int i1; - int i2; - int i3; - }; - - struct _abs_struct - { - int abs_i1; - int abs_i2; - }; - - typedef struct _abs_struct abs_struct; - - :mockable: | - void ptr_ret_int(int *r); - void ptr_ret_ints(int *r, int *s); - void ptr_ret_array(char r[], int len); - void ptr_ret_typedef(intptr r); - void ptr_ret_struct(struct a_struct *r); - void ptr_ret_abstract(abs_struct *r); - void ptr_ret_abstract_array(abs_struct *r, int len); - void ptr_ret_const_int(int *r, const int *s); - void ptr_ret_string(char *s); - - :source: - :header: | - #include - #define lengthof(x) (sizeof(x)/sizeof((x)[0])) - - :code: | - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: "handle a single int* argument" - :code: | - test() - { - int r = 1; - int res = 4; - - ptr_ret_int_Expect(&r); - ptr_ret_int_ReturnThruPtr_r(&res); - ptr_ret_int(&r); - TEST_ASSERT_EQUAL(4, r); - } - - - :pass: TRUE - :should: "handle multiple calls" - :code: | - test() - { - int r = 1; - int res1 = 4; - int res2 = 8; - int res3 = 16; - - ptr_ret_int_Expect(&r); - ptr_ret_int_ReturnThruPtr_r(&res1); - ptr_ret_int_Expect(&r); - ptr_ret_int_ReturnThruPtr_r(&res2); - ptr_ret_int_Expect(&r); - ptr_ret_int_ReturnThruPtr_r(&res3); - - ptr_ret_int(&r); - TEST_ASSERT_EQUAL(4, r); - ptr_ret_int(&r); - TEST_ASSERT_EQUAL(8, r); - ptr_ret_int(&r); - TEST_ASSERT_EQUAL(16, r); - - } - - - :pass: TRUE - :should: "ignore an argument" - :code: | - test() - { - int s = 2; - int res = 4; - - ptr_ret_int_ExpectAnyArgs(); - ptr_ret_int_ReturnThruPtr_r(&res); - ptr_ret_int(&s); - TEST_ASSERT_EQUAL(4, s); - } - - - :pass: TRUE - :should: "ignore a null pointer argument" - :code: | - test() - { - int r = 1; - int res = 4; - - ptr_ret_int_ExpectAnyArgs(); - ptr_ret_int_ReturnThruPtr_r(&res); - ptr_ret_int(&r); - TEST_ASSERT_EQUAL(4, r); - } - - - :pass: TRUE - :should: "handle multiple int* arguments" - :code: | - test() - { - int r, s = 0x0880AA55; - int r_res = 4; - int s_res = 6; - - ptr_ret_ints_Expect(&r, &s); - ptr_ret_ints_ReturnThruPtr_r(&r_res); - ptr_ret_ints_ReturnThruPtr_s(&s_res); - ptr_ret_ints(&r, &s); - TEST_ASSERT_EQUAL(4, r); - TEST_ASSERT_EQUAL(6, s); - } - - - :pass: TRUE - :should: "only return through pointer when asked to" - :code: | - test() - { - int r = 0x0880AA55; - int s = 0xAA55; - int r_res = 4; - - ptr_ret_ints_Expect(&r, &s); - ptr_ret_ints_ReturnThruPtr_r(&r_res); - ptr_ret_ints(&r, &s); - TEST_ASSERT_EQUAL(4, r); - TEST_ASSERT_EQUAL(0xAA55, s); - } - - - :pass: TRUE - :should: "return an array through a pointer correctly" - :code: | - test() - { - char r_a[] = "booboorooboo"; - char r_a_ret[] = "FEEFI"; - - ptr_ret_array_Expect(r_a, lengthof(r_a)); - ptr_ret_array_ReturnArrayThruPtr_r(r_a_ret, (int)strlen(r_a_ret)); - ptr_ret_array(r_a, lengthof(r_a)); - TEST_ASSERT_EQUAL_STRING("FEEFIorooboo", r_a); - } - - - :pass: TRUE - :should: "handle structs" - :code: | - test() - { - struct a_struct r_s = { .i1 = 2, .i2 = 3, .i3 = 4, }; - struct a_struct r_s_ret = { .i1 = 8, .i2 = 16, .i3 = 32, }; - - ptr_ret_struct_Expect(&r_s); - ptr_ret_struct_ReturnThruPtr_r(&r_s_ret); - ptr_ret_struct(&r_s); - TEST_ASSERT_EQUAL_MEMORY(&r_s_ret, &r_s, sizeof(struct a_struct)); - } - - - :pass: TRUE - :should: "handle typedefs" - :code: | - test() - { - abs_struct r_as = {.abs_i1 = 0x1234, .abs_i2 = 0x4567}; - abs_struct r_as_ret = {.abs_i1 = 0xFFAA55, .abs_i2 = 0xAAFFAA}; - ptr_ret_abstract_Expect(&r_as); - ptr_ret_abstract_ReturnMemThruPtr_r(&r_as_ret, sizeof(abs_struct)); - ptr_ret_abstract(&r_as); - TEST_ASSERT_EQUAL_MEMORY(&r_as_ret, &r_as, sizeof(abs_struct)); - } - - - :pass: TRUE - :should: "only generate ReturnThruPtr definitions for non-const arguments" - :code: | - test() - { - #if !defined(ptr_ret_const_int_ReturnThruPtr_r) - TEST_FAIL_MESSAGE("ReturnThruPtr not defined for a pointer argument."); - #endif - - #if defined(ptr_ret_const_int_ReturnThruPtr_s) - TEST_FAIL_MESSAGE("ReturnThruPtr defined for a const pointer argument."); - #endif - } - - - :pass: TRUE - :should: "generate ReturnThruPtr definitions for string arguments" - :code: | - test() - { - #if !defined(ptr_ret_string_ReturnThruPtr_s) - TEST_FAIL_MESSAGE("ReturnThruPtr not defined for a string argument."); - #endif - } - - - :pass: TRUE - :should: "generate ExpectAnyArgs definitions" - :code: | - test() - { - #if !defined(ptr_ret_array_ExpectAnyArgs) - TEST_FAIL_MESSAGE("ExpectAnyArgs not defined for an argument."); - #endif - } diff --git a/components/testframework/libs/cmock/test/system/test_interactions/skeleton.yml b/components/testframework/libs/cmock/test/system/test_interactions/skeleton.yml deleted file mode 100644 index 772080022..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/skeleton.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -:cmock: - :plugins: - - # none - :skeleton_path: system/generated - -:systest: - :types: | - #define UINT32 unsigned int - - :mockable: | - UINT32 something(int a); - - :skeleton: skeleton.h - - :source: - :header: | - void function_a(void); - int function_b(int a, int b); - const char* function_c(void); - - # we are purposefully not including a :code section because it will be generated with skeleton - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'generate an empty shell for functions with no return values' - :code: | - test() - { - function_a(); - } - - - :pass: TRUE - :should: 'return numerical zero for numerical return values' - :code: | - test() - { - TEST_ASSERT_EQUAL_INT(0, function_b(1, 2)); - } - - - :pass: TRUE - :should: 'return null for pointer return values' - :code: | - test() - { - TEST_ASSERT_NULL(function_c()); - } - - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/skeleton_update.yml b/components/testframework/libs/cmock/test/system/test_interactions/skeleton_update.yml deleted file mode 100644 index 757e8b13d..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/skeleton_update.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -:cmock: - :plugins: - - # none - :skeleton_path: system/generated - -:systest: - :types: | - #define UINT32 unsigned int - - :mockable: | - UINT32 something(int a); - - :skeleton: skeleton_update.h - - :source: - :header: | - void function_a(void); - int function_b(int a, int b); - const char* function_c(void); - - # note that this code section exists and will be updated by the skeleton generator - :code: | - const char* donuts = "donuts"; - const char* function_c(void) - { - return donuts; - } - - int function_d(void) - { - return 77; - } - - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - extern int function_d(); - - :units: - - :pass: TRUE - :should: 'generate an empty shell for functions with no return values' - :code: | - test() - { - function_a(); - } - - - :pass: TRUE - :should: 'return numerical zero for numerical return values' - :code: | - test() - { - TEST_ASSERT_EQUAL_INT(0, function_b(1, 2)); - } - - - :pass: TRUE - :should: 'not overwrite functions that already exist' - :code: | - test() - { - TEST_ASSERT_EQUAL_STRING("donuts", function_c()); - } - - - :pass: TRUE - :should: 'leave functions it has never heard of' - :code: | - test() - { - TEST_ASSERT_EQUAL_INT(77, function_d()); - } - - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return.yml b/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return.yml deleted file mode 100644 index d4cf6af19..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return.yml +++ /dev/null @@ -1,277 +0,0 @@ ---- -:cmock: - :plugins: - - # none - -:systest: - :types: | - struct THING { int a; int b; }; - - union STARS_AND_STRIPES { int a; char b; }; - - enum HOKEY_POKEY { IN, OUT, SHAKE_IT_ALL_ABOUT }; - - :mockable: | - void foo_struct(struct THING*, struct THING); - struct THING foobar_struct(void); - - void foo_union(union STARS_AND_STRIPES*, union STARS_AND_STRIPES); - union STARS_AND_STRIPES foobar_union(void); - - void foo_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b); - enum HOKEY_POKEY foobar_enum(void); - - :source: - :header: | - void exercise_struct(struct THING* a, struct THING b); - struct THING return_struct(void); - - void exercise_union(union STARS_AND_STRIPES* a, union STARS_AND_STRIPES b); - union STARS_AND_STRIPES return_union(void); - - void exercise_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b); - enum HOKEY_POKEY return_enum(void); - - :code: | - void exercise_struct(struct THING* a, struct THING b) - { - foo_struct(a, b); - } - - struct THING return_struct(void) - { - return foobar_struct(); - } - - void exercise_union(union STARS_AND_STRIPES* a, union STARS_AND_STRIPES b) - { - foo_union(a, b); - } - - union STARS_AND_STRIPES return_union(void) - { - return foobar_union(); - } - - void exercise_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b) - { - foo_enum(a, b); - } - - enum HOKEY_POKEY return_enum(void) - { - return foobar_enum(); - } - - - :tests: - :common: | - struct THING struct1; - struct THING struct2; - struct THING struct3; - struct THING struct4; - struct THING struct5; - struct THING struct6; - - union STARS_AND_STRIPES union1; - union STARS_AND_STRIPES union2; - union STARS_AND_STRIPES union3; - union STARS_AND_STRIPES union4; - union STARS_AND_STRIPES union5; - union STARS_AND_STRIPES union6; - - enum HOKEY_POKEY enum1; - enum HOKEY_POKEY enum2; - - void setUp(void) - { - struct1.a = 1; - struct1.b = 2; - - struct2.a = 3; - struct2.b = 4; - - struct3.a = 5; - struct3.b = 6; - - struct4.a = 7; - struct4.b = 8; - - struct5.a = 9; - struct5.b = 10; - - struct6.a = 9; - struct6.b = 10; - - union1.a = 1; - union2.a = 2; - union3.a = 3; - union4.a = 4; - union5.a = 5; - union6.a = 5; - - enum1 = OUT; - enum2 = IN; - } - - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'successfully compare structs' - :code: | - test() - { - foo_struct_Expect(&struct1, struct2); - exercise_struct(&struct1, struct2); - } - - - :pass: FALSE - :should: 'blow up on bad struct pointer comparison' - :code: | - test() - { - foo_struct_Expect(&struct1, struct2); - exercise_struct(&struct3, struct2); - } - - - :pass: FALSE - :should: 'blow up on bad structure comparison' - :code: | - test() - { - foo_struct_Expect(&struct1, struct2); - exercise_struct(&struct1, struct4); - } - - - :pass: TRUE - :should: 'compare returned structs as equal' - :code: | - test() - { - foobar_struct_ExpectAndReturn(struct5); - TEST_ASSERT_EQUAL_THING(struct6, return_struct()); - } - - - :pass: FALSE - :should: 'compare returned structs as unequal' - :code: | - test() - { - foobar_struct_ExpectAndReturn(struct4); - TEST_ASSERT_EQUAL_THING(struct5, return_struct()); - } - - - :pass: TRUE - :should: 'successfully compare unions' - :code: | - test() - { - foo_union_Expect(&union1, union2); - exercise_union(&union1, union2); - } - - - :pass: FALSE - :should: 'blow up on bad union pointer comparison' - :code: | - test() - { - foo_union_Expect(&union1, union2); - exercise_union(&union3, union2); - } - - - :pass: FALSE - :should: 'blow up on bad union comparison' - :code: | - test() - { - foo_union_Expect(&union1, union2); - exercise_union(&union1, union4); - } - - - :pass: TRUE - :should: 'compare returned unions as equal' - :code: | - test() - { - foobar_union_ExpectAndReturn(union5); - TEST_ASSERT_EQUAL_STARS_AND_STRIPES(union6, return_union()); - } - - - :pass: FALSE - :should: 'compare returned unions as unequal' - :code: | - test() - { - foobar_union_ExpectAndReturn(union4); - TEST_ASSERT_EQUAL_STARS_AND_STRIPES(union5, return_union()); - } - - - :pass: TRUE - :should: 'successfully pass enum values' - :code: | - test() - { - foo_enum_Expect(OUT, &enum1); - exercise_enum(OUT, &enum1); - } - - - :pass: FALSE - :should: 'blow up on bad enum pointer comparison' - :code: | - test() - { - foo_enum_Expect(IN, &enum1); - exercise_enum(IN, &enum2); - } - - - :pass: FALSE - :should: 'blow up on bad enum comparison' - :code: | - test() - { - foo_enum_Expect(IN, &enum1); - exercise_enum(SHAKE_IT_ALL_ABOUT, &enum1); - } - - - :pass: TRUE - :should: 'compare returned enums as equal' - :code: | - test() - { - foobar_enum_ExpectAndReturn(OUT); - TEST_ASSERT_EQUAL(OUT, return_enum()); - } - - - :pass: FALSE - :should: 'compare returned unions as unequal' - :code: | - test() - { - foobar_enum_ExpectAndReturn(OUT); - TEST_ASSERT_EQUAL(IN, return_enum()); - } - - - :unity_helper: - :header: | - void AssertEqualTHINGStruct(struct THING expected, struct THING actual); - void AssertEqualSTARS_AND_STRIPESUnion(union STARS_AND_STRIPES expected, union STARS_AND_STRIPES actual); - - #define TEST_ASSERT_EQUAL_THING(expected, actual) {AssertEqualTHINGStruct(expected, actual);} - #define TEST_ASSERT_EQUAL_STARS_AND_STRIPES(expected, actual) {AssertEqualSTARS_AND_STRIPESUnion(expected, actual);} - - :code: | - void AssertEqualTHINGStruct(struct THING expected, struct THING actual) - { - TEST_ASSERT_EQUAL_INT_MESSAGE(expected.a, actual.a, "actual struct member \"a\" does not equal expected"); - TEST_ASSERT_EQUAL_INT_MESSAGE(expected.b, actual.b, "actual struct member \"b\" does not equal expected"); - } - - void AssertEqualSTARS_AND_STRIPESUnion(union STARS_AND_STRIPES expected, union STARS_AND_STRIPES actual) - { - TEST_ASSERT_EQUAL_INT_MESSAGE(expected.a, actual.a, "actual union member \"a\" does not equal expected"); - TEST_ASSERT_EQUAL_MESSAGE(expected.b, actual.b, "actual union member \"b\" does not equal expected"); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return_with_plugins.yml b/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return_with_plugins.yml deleted file mode 100644 index a54826ca4..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return_with_plugins.yml +++ /dev/null @@ -1,280 +0,0 @@ ---- -:cmock: - :plugins: - - :array - - :ignore - - :callback - - :return_thru_ptr - -:systest: - :types: | - struct THING { int a; int b; }; - - union STARS_AND_STRIPES { int a; char b; }; - - enum HOKEY_POKEY { IN, OUT, SHAKE_IT_ALL_ABOUT }; - - :mockable: | - void foo_struct(struct THING*, struct THING); - struct THING foobar_struct(void); - - void foo_union(union STARS_AND_STRIPES*, union STARS_AND_STRIPES); - union STARS_AND_STRIPES foobar_union(void); - - void foo_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b); - enum HOKEY_POKEY foobar_enum(void); - - :source: - :header: | - void exercise_struct(struct THING* a, struct THING b); - struct THING return_struct(void); - - void exercise_union(union STARS_AND_STRIPES* a, union STARS_AND_STRIPES b); - union STARS_AND_STRIPES return_union(void); - - void exercise_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b); - enum HOKEY_POKEY return_enum(void); - - :code: | - void exercise_struct(struct THING* a, struct THING b) - { - foo_struct(a, b); - } - - struct THING return_struct(void) - { - return foobar_struct(); - } - - void exercise_union(union STARS_AND_STRIPES* a, union STARS_AND_STRIPES b) - { - foo_union(a, b); - } - - union STARS_AND_STRIPES return_union(void) - { - return foobar_union(); - } - - void exercise_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b) - { - foo_enum(a, b); - } - - enum HOKEY_POKEY return_enum(void) - { - return foobar_enum(); - } - - - :tests: - :common: | - struct THING struct1; - struct THING struct2; - struct THING struct3; - struct THING struct4; - struct THING struct5; - struct THING struct6; - - union STARS_AND_STRIPES union1; - union STARS_AND_STRIPES union2; - union STARS_AND_STRIPES union3; - union STARS_AND_STRIPES union4; - union STARS_AND_STRIPES union5; - union STARS_AND_STRIPES union6; - - enum HOKEY_POKEY enum1; - enum HOKEY_POKEY enum2; - - void setUp(void) - { - struct1.a = 1; - struct1.b = 2; - - struct2.a = 3; - struct2.b = 4; - - struct3.a = 5; - struct3.b = 6; - - struct4.a = 7; - struct4.b = 8; - - struct5.a = 9; - struct5.b = 10; - - struct6.a = 9; - struct6.b = 10; - - union1.a = 1; - union2.a = 2; - union3.a = 3; - union4.a = 4; - union5.a = 5; - union6.a = 5; - - enum1 = OUT; - enum2 = IN; - } - - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'successfully compare structs' - :code: | - test() - { - foo_struct_Expect(&struct1, struct2); - exercise_struct(&struct1, struct2); - } - - - :pass: FALSE - :should: 'blow up on bad struct pointer comparison' - :code: | - test() - { - foo_struct_Expect(&struct1, struct2); - exercise_struct(&struct3, struct2); - } - - - :pass: FALSE - :should: 'blow up on bad structure comparison' - :code: | - test() - { - foo_struct_Expect(&struct1, struct2); - exercise_struct(&struct1, struct4); - } - - - :pass: TRUE - :should: 'compare returned structs as equal' - :code: | - test() - { - foobar_struct_ExpectAndReturn(struct5); - TEST_ASSERT_EQUAL_THING(struct6, return_struct()); - } - - - :pass: FALSE - :should: 'compare returned structs as unequal' - :code: | - test() - { - foobar_struct_ExpectAndReturn(struct4); - TEST_ASSERT_EQUAL_THING(struct5, return_struct()); - } - - - :pass: TRUE - :should: 'successfully compare unions' - :code: | - test() - { - foo_union_Expect(&union1, union2); - exercise_union(&union1, union2); - } - - - :pass: FALSE - :should: 'blow up on bad union pointer comparison' - :code: | - test() - { - foo_union_Expect(&union1, union2); - exercise_union(&union3, union2); - } - - - :pass: FALSE - :should: 'blow up on bad union comparison' - :code: | - test() - { - foo_union_Expect(&union1, union2); - exercise_union(&union1, union4); - } - - - :pass: TRUE - :should: 'compare returned unions as equal' - :code: | - test() - { - foobar_union_ExpectAndReturn(union5); - TEST_ASSERT_EQUAL_STARS_AND_STRIPES(union6, return_union()); - } - - - :pass: FALSE - :should: 'compare returned unions as unequal' - :code: | - test() - { - foobar_union_ExpectAndReturn(union4); - TEST_ASSERT_EQUAL_STARS_AND_STRIPES(union5, return_union()); - } - - - :pass: TRUE - :should: 'successfully pass enum values' - :code: | - test() - { - foo_enum_Expect(OUT, &enum1); - exercise_enum(OUT, &enum1); - } - - - :pass: FALSE - :should: 'blow up on bad enum pointer comparison' - :code: | - test() - { - foo_enum_Expect(IN, &enum1); - exercise_enum(IN, &enum2); - } - - - :pass: FALSE - :should: 'blow up on bad enum comparison' - :code: | - test() - { - foo_enum_Expect(IN, &enum1); - exercise_enum(SHAKE_IT_ALL_ABOUT, &enum1); - } - - - :pass: TRUE - :should: 'compare returned enums as equal' - :code: | - test() - { - foobar_enum_ExpectAndReturn(OUT); - TEST_ASSERT_EQUAL(OUT, return_enum()); - } - - - :pass: FALSE - :should: 'compare returned unions as unequal' - :code: | - test() - { - foobar_enum_ExpectAndReturn(OUT); - TEST_ASSERT_EQUAL(IN, return_enum()); - } - - - :unity_helper: - :header: | - void AssertEqualTHINGStruct(struct THING expected, struct THING actual); - void AssertEqualSTARS_AND_STRIPESUnion(union STARS_AND_STRIPES expected, union STARS_AND_STRIPES actual); - - #define TEST_ASSERT_EQUAL_THING(expected, actual) {AssertEqualTHINGStruct(expected, actual);} - #define TEST_ASSERT_EQUAL_STARS_AND_STRIPES(expected, actual) {AssertEqualSTARS_AND_STRIPESUnion(expected, actual);} - - :code: | - void AssertEqualTHINGStruct(struct THING expected, struct THING actual) - { - TEST_ASSERT_EQUAL_INT_MESSAGE(expected.a, actual.a, "actual struct member \"a\" does not equal expected"); - TEST_ASSERT_EQUAL_INT_MESSAGE(expected.b, actual.b, "actual struct member \"b\" does not equal expected"); - } - - void AssertEqualSTARS_AND_STRIPESUnion(union STARS_AND_STRIPES expected, union STARS_AND_STRIPES actual) - { - TEST_ASSERT_EQUAL_INT_MESSAGE(expected.a, actual.a, "actual union member \"a\" does not equal expected"); - TEST_ASSERT_EQUAL_MESSAGE(expected.b, actual.b, "actual union member \"b\" does not equal expected"); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/stubs_with_callbacks.yml b/components/testframework/libs/cmock/test/system/test_interactions/stubs_with_callbacks.yml deleted file mode 100644 index 1f2575481..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/stubs_with_callbacks.yml +++ /dev/null @@ -1,221 +0,0 @@ ---- -:cmock: - :plugins: - - :callback - :treat_as: - custom_type: INT - -:systest: - :types: | - #define UINT32 unsigned int - - typedef signed int custom_type; - - :mockable: | - UINT32 foo(custom_type* a); - UINT32 bar(custom_type* b); - int baz(void); - void fuz(int* args, int num); - - :source: - :header: | - void function_a(int a, int b); - UINT32 function_b(void); - int function_c(void); - - :code: | - void function_a(int a, int b) - { - int args[6] = {0, 1, 2, 3, 5, 5}; - args[0] = a; - fuz(args, b); - } - - UINT32 function_b(void) - { - UINT32 sum = 0; - custom_type a = 0; - custom_type b = 0; - sum = foo(&a) + bar(&b); - return (UINT32)((custom_type)sum + a + b); - } - - int function_c(void) - { - return (baz() + baz() + baz()); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - UINT32 FooAndBarHelper(custom_type* data, int num) - { - num++; - *data = (custom_type)(num * 2); - return (UINT32)(*data * 2); - } - - int BazCallbackPointless(int num) - { - return num; - } - - int BazCallbackComplainsIfCalledMoreThanTwice(int num) - { - TEST_ASSERT_MESSAGE(num < 2, "Do Not Call Baz More Than Twice"); - return num; - } - - void FuzVerifier(int* args, int num_args, int num_calls) - { - int i; - TEST_ASSERT_MESSAGE(num_args < 5, "No More Than 5 Args Allowed"); - for (i = 0; i < num_args; i++) - { - TEST_ASSERT_EQUAL(num_calls + i, args[i]); - } - } - - :units: - - :pass: TRUE - :should: 'successfully exercise two simple ExpectAndReturn mock calls the normal way' - :code: | - test() - { - custom_type exp = 0; - foo_ExpectAndReturn(&exp, 10); - bar_ExpectAndReturn(&exp, 20); - TEST_ASSERT_EQUAL(30, function_b()); - } - - - :pass: FALSE - :should: 'successfully exercise two simple ExpectAndReturn mock calls and catch failure the normal way' - :code: | - test() - { - custom_type exp = 1; - foo_ExpectAndReturn(&exp, 10); - bar_ExpectAndReturn(&exp, 20); - TEST_ASSERT_EQUAL(30, function_b()); - } - - - :pass: TRUE - :should: 'successfully exercise using some basic callbacks' - :code: | - test() - { - foo_StubWithCallback((CMOCK_foo_CALLBACK)FooAndBarHelper); - bar_StubWithCallback((CMOCK_bar_CALLBACK)FooAndBarHelper); - TEST_ASSERT_EQUAL(12, function_b()); - } - - - :pass: TRUE - :should: 'successfully exercise using some basic callbacks even if there were expects' - :code: | - test() - { - custom_type exp = 500; - foo_ExpectAndReturn(&exp, 10); - foo_StubWithCallback((CMOCK_foo_CALLBACK)FooAndBarHelper); - bar_StubWithCallback((CMOCK_bar_CALLBACK)FooAndBarHelper); - TEST_ASSERT_EQUAL(12, function_b()); - } - - - :pass: FALSE - :should: 'successfully exercise using some basic callbacks and notice failures' - :code: | - test() - { - foo_StubWithCallback((CMOCK_foo_CALLBACK)FooAndBarHelper); - bar_StubWithCallback((CMOCK_bar_CALLBACK)FooAndBarHelper); - TEST_ASSERT_EQUAL(10, function_b()); - } - - - :pass: TRUE - :should: 'successfully exercise a callback with no arguments' - :code: | - test() - { - baz_StubWithCallback((CMOCK_baz_CALLBACK)BazCallbackPointless); - TEST_ASSERT_EQUAL(3, function_c()); - } - - - :pass: FALSE - :should: 'successfully throw a failure from within a callback function' - :code: | - test() - { - baz_StubWithCallback((CMOCK_baz_CALLBACK)BazCallbackComplainsIfCalledMoreThanTwice); - function_c(); - } - - - :pass: TRUE - :should: 'be usable for things like dynamically sized memory checking for passing conditions' - :code: | - test() - { - fuz_StubWithCallback((CMOCK_fuz_CALLBACK)FuzVerifier); - function_a(0, 4); - } - - - :pass: FALSE - :should: 'be usable for things like dynamically sized memory checking for failing conditions' - :code: | - test() - { - fuz_StubWithCallback((CMOCK_fuz_CALLBACK)FuzVerifier); - function_a(0, 5); - } - - - :pass: FALSE - :should: 'be usable for things like dynamically sized memory checking for failing conditions 2' - :code: | - test() - { - fuz_StubWithCallback((CMOCK_fuz_CALLBACK)FuzVerifier); - function_a(1, 4); - } - - - :pass: TRUE - :should: 'run them interlaced' - :code: | - test() - { - custom_type exp = 0; - foo_ExpectAndReturn(&exp, 10); - foo_ExpectAndReturn(&exp, 15); - bar_ExpectAndReturn(&exp, 20); - bar_ExpectAndReturn(&exp, 40); - fuz_StubWithCallback((CMOCK_fuz_CALLBACK)FuzVerifier); - baz_StubWithCallback((CMOCK_baz_CALLBACK)BazCallbackPointless); - - TEST_ASSERT_EQUAL(30, function_b()); - TEST_ASSERT_EQUAL(55, function_b()); - function_a(0, 4); - TEST_ASSERT_EQUAL(3, function_c()); - } - - - :pass: TRUE - :should: 'run them back to back' - :code: | - test() - { - custom_type exp = 0; - foo_ExpectAndReturn(&exp, 10); - bar_ExpectAndReturn(&exp, 20); - TEST_ASSERT_EQUAL(30, function_b()); - - foo_ExpectAndReturn(&exp, 15); - bar_ExpectAndReturn(&exp, 40); - TEST_ASSERT_EQUAL(55, function_b()); - - fuz_StubWithCallback((CMOCK_fuz_CALLBACK)FuzVerifier); - function_a(0, 4); - - baz_StubWithCallback((CMOCK_baz_CALLBACK)BazCallbackPointless); - TEST_ASSERT_EQUAL(3, function_c()); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/unity_64bit_support.yml b/components/testframework/libs/cmock/test/system/test_interactions/unity_64bit_support.yml deleted file mode 100644 index 861b15148..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/unity_64bit_support.yml +++ /dev/null @@ -1,77 +0,0 @@ ---- -#The purpose of this test is to play with things 64-bit integers, which aren't supported by all compilers -:cmock: - :plugins: - - :array - - :ignore - -:systest: - :types: | - #include "unity_internals.h" - typedef UNITY_UINT64 TEST64; - - :mockable: | - TEST64 foo(TEST64 a); - TEST64* bar(TEST64* b); - - :source: - :header: | - TEST64 function_a(void); - - :code: | - TEST64 function_a(void) { - TEST64 a = 0x1234567890123456; - TEST64 b; - TEST64* c; - - b = foo(a); - c = bar(&b); - return *c; - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'handle a straightforward 64-bit series of calls' - :code: | - test() - { - TEST64 a = 0x0987654321543210; - TEST64 b = 0x5a5a5a5a5a5a5a5a; - foo_ExpectAndReturn(0x1234567890123456, 0x0987654321543210); - bar_ExpectAndReturn(&a, &b); - - TEST_ASSERT_EQUAL_HEX64(b, function_a()); - } - - - :pass: FALSE - :should: 'handle a straightforward 64-bit series of calls with a failure' - :code: | - test() - { - TEST64 a = 0x0987654321543210; - TEST64 b = 0x5a5a5a5a5a5a5a5a; - foo_ExpectAndReturn(0x1234567890123456, 0x0987654321543211); - bar_ExpectAndReturn(&a, &b); - - TEST_ASSERT_EQUAL_HEX64(b, function_a()); - } - - - :pass: FALSE - :should: 'handle a straightforward 64-bit series of calls returning a failure' - :code: | - test() - { - TEST64 a = 0x0987654321543210; - TEST64 b = 0x5a5a5a5a5a5a5a5a; - foo_ExpectAndReturn(0x1234567890123456, 0x0987654321543210); - bar_ExpectAndReturn(&a, &b); - - TEST_ASSERT_EQUAL_HEX64(b+1, function_a()); - } - -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/unity_ignores.yml b/components/testframework/libs/cmock/test/system/test_interactions/unity_ignores.yml deleted file mode 100644 index 8595122b2..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/unity_ignores.yml +++ /dev/null @@ -1,139 +0,0 @@ ---- -:cmock: - :plugins: - - # none - -:systest: - :types: | - #define UINT32 unsigned int - - :mockable: | - UINT32 foo(UINT32 a); - void bar(void); - - :source: - :header: | - UINT32 function_a(int a); - void function_b(void); - - :code: | - UINT32 function_a(int a) - { - bar(); - return foo((UINT32)a); - } - - void function_b(void) - { - bar(); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: :ignore - :should: 'ignore incorrect expects after the TEST_IGNORE call' - :code: | - test() - { - TEST_IGNORE(); - bar_Expect(); - foo_ExpectAndReturn(10, 20); - TEST_ASSERT_EQUAL(40, function_a(30)); - } - - - :pass: :ignore - :should: 'ignore missing expects after the TEST_IGNORE call' - :code: | - test() - { - TEST_IGNORE(); - foo_ExpectAndReturn(10, 20); - TEST_ASSERT_EQUAL(20, function_a(10)); - } - - - :pass: :ignore - :should: 'ignore extra expects after the TEST_IGNORE call' - :code: | - test() - { - TEST_IGNORE(); - bar_Expect(); - bar_Expect(); - foo_ExpectAndReturn(10, 20); - foo_ExpectAndReturn(10, 20); - foo_ExpectAndReturn(10, 20); - TEST_ASSERT_EQUAL(20, function_a(10)); - } - - - :pass: :ignore - :should: 'ignore no expects after the TEST_IGNORE call' - :code: | - test() - { - TEST_IGNORE(); - TEST_ASSERT_EQUAL(20, function_a(10)); - } - - - :pass: :ignore - :should: 'ignore extra expects after the TEST_IGNORE call even if it happens later' - :code: | - test() - { - bar_Expect(); - foo_ExpectAndReturn(10, 20); - function_a(10); - - TEST_IGNORE(); - bar_Expect(); - foo_ExpectAndReturn(10, 20); - TEST_ASSERT_EQUAL(40, function_a(30)); - } - - - :pass: false - :should: 'still fail if there are expect problems before the TEST_IGNORE' - :code: | - test() - { - bar_Expect(); - foo_ExpectAndReturn(10, 20); - function_a(30); - - TEST_IGNORE(); - bar_Expect(); - foo_ExpectAndReturn(10, 20); - TEST_ASSERT_EQUAL(40, function_a(30)); - } - - - :pass: false - :should: 'still fail if there are missing expect problems before the TEST_IGNORE' - :code: | - test() - { - bar_Expect(); - function_a(10); - - TEST_IGNORE(); - bar_Expect(); - foo_ExpectAndReturn(10, 20); - TEST_ASSERT_EQUAL(40, function_a(30)); - } - - - :pass: :ignore - :should: 'ignore if extra expects before the TEST_IGNORE because it ignored the rest of the test that might have made calls to it' - :code: | - test() - { - bar_Expect(); - bar_Expect(); - foo_ExpectAndReturn(10, 20); - function_a(10); - - TEST_IGNORE(); - foo_ExpectAndReturn(10, 20); - TEST_ASSERT_EQUAL(40, function_a(30)); - } -... diff --git a/components/testframework/libs/cmock/test/system/test_interactions/unity_void_pointer_compare.yml b/components/testframework/libs/cmock/test/system/test_interactions/unity_void_pointer_compare.yml deleted file mode 100644 index 1a49b0cd3..000000000 --- a/components/testframework/libs/cmock/test/system/test_interactions/unity_void_pointer_compare.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- -#The purpose of this test is to verify we handle void pointers as memory compares -:cmock: - :plugins: - - :array - :treat_as_array: - VOID_PTR: unsigned char - -:systest: - :types: | - #include "unity_internals.h" - typedef void* VOID_PTR; - - :mockable: | - void* ret_v_ptr(void); - void get_v_ptr(void* ptr); - void get_v_ptr_typedefed(VOID_PTR ptr); - - :source: - :header: | - void function_a(void); - - :code: | - void function_a(void) { - void* stuff = ret_v_ptr(); - get_v_ptr(stuff); - get_v_ptr_typedefed((VOID_PTR)stuff); - } - - :tests: - :common: | - void setUp(void) {} - void tearDown(void) {} - - :units: - - :pass: TRUE - :should: 'handle passing working expects' - :code: | - test() - { - char* a = "Hello"; - char* b = "Hello"; - ret_v_ptr_ExpectAndReturn(a); - get_v_ptr_Expect(b); - get_v_ptr_typedefed_Expect((VOID_PTR)b); - - function_a(); - } - - - :pass: TRUE - :should: 'handle passing array expects' - :code: | - test() - { - char* a = "Hello"; - char* b = "Hello"; - ret_v_ptr_ExpectAndReturn(a); - get_v_ptr_ExpectWithArray(b,5); - get_v_ptr_typedefed_ExpectWithArray((VOID_PTR)b,5); - - function_a(); - } - - - :pass: FALSE - :should: 'handle failing expects' - :code: | - test() - { - char* a = "Hello"; - char* b = "Jello"; - ret_v_ptr_ExpectAndReturn(a); - get_v_ptr_Expect(b); - get_v_ptr_typedefed_Expect((VOID_PTR)b); - - function_a(); - } - - - :pass: FALSE - :should: 'handle failing array expects' - :code: | - test() - { - char* a = "Hello"; - char* b = "Hella"; - ret_v_ptr_ExpectAndReturn(a); - get_v_ptr_ExpectWithArray(b,5); - get_v_ptr_typedefed_ExpectWithArray((VOID_PTR)b,5); - - function_a(); - } -... diff --git a/components/testframework/libs/cmock/test/targets/clang_strict.yml b/components/testframework/libs/cmock/test/targets/clang_strict.yml deleted file mode 100644 index c86f1e126..000000000 --- a/components/testframework/libs/cmock/test/targets/clang_strict.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -compiler: - path: clang - source_path: &systest_generated_path './system/generated/' - unit_tests_path: &unit_tests_path '../examples/test/' - mocks_path: &systest_mocks_path './system/generated/' - build_path: &systest_build_path './system/build/' - options: - - '-c' - - '-Wall' - - '-Wextra' - - '-Werror' - #- '-Wcast-qual' - - '-Wconversion' - - '-Wtautological-compare' - #- '-Wtautological-pointer-compare' - - '-Wdisabled-optimization' - - '-Wformat=2' - - '-Winit-self' - - '-Winline' - - '-Winvalid-pch' - - '-Wmissing-declarations' - - '-Wmissing-include-dirs' - - '-Wmissing-prototypes' - - '-Wnonnull' - - '-Wpacked' - - '-Wpointer-arith' - - '-Wredundant-decls' - - '-Wswitch-default' - - '-Wstrict-aliasing=2' - - '-Wstrict-overflow=5' - - '-Wuninitialized' - - '-Wunused' - - '-Wunreachable-code' - - '-Wreturn-type' - - '-Wshadow' - - '-Wundef' - - '-Wwrite-strings' - - '-Wbad-function-cast' - - '-Wno-missing-prototypes' #we've been lazy about things like setUp and tearDown - - '-Wno-invalid-token-paste' - - '-fms-extensions' - - '-fno-omit-frame-pointer' - #- '-ffloat-store' - - '-fno-common' - - '-fstrict-aliasing' - - '-std=gnu99' - - '-pedantic' - - '-O0' - includes: - prefix: '-I' - items: - - *systest_generated_path - - *unit_tests_path - - *systest_mocks_path - - '../src/' - - '../vendor/unity/src/' - - '../vendor/c_exception/lib/' - - './system/test_compilation/' - - './' - defines: - prefix: '-D' - items: - - CMOCK - - 'UNITY_SUPPORT_64' - - 'UNITY_POINTER_WIDTH=64' - object_files: - prefix: '-o' - extension: '.o' - destination: *systest_build_path - -linker: - path: gcc - options: - - -lm - includes: - prefix: '-I' - object_files: - path: *systest_build_path - extension: '.o' - bin_files: - prefix: '-o' - extension: '.exe' - destination: *systest_build_path - -unsupported: - - out_of_memory - - callingconv - -colour: true diff --git a/components/testframework/libs/cmock/test/targets/gcc.yml b/components/testframework/libs/cmock/test/targets/gcc.yml deleted file mode 100644 index 56ed82fd9..000000000 --- a/components/testframework/libs/cmock/test/targets/gcc.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -compiler: - path: gcc - source_path: &systest_generated_path './system/generated/' - unit_tests_path: &unit_tests_path '../examples/test/' - mocks_path: &systest_mocks_path './system/generated/' - build_path: &systest_build_path './system/build/' - options: - - '-c' - - '-Wall' - - '-Wextra' - - '-Wunused-parameter' - - '-Wno-address' - - '-Wno-invalid-token-paste' - - '-std=c99' - - '-pedantic' - - '-O0' - includes: - prefix: '-I' - items: - - *systest_generated_path - - *unit_tests_path - - *systest_mocks_path - - '../src/' - - '../vendor/unity/src/' - - '../vendor/c_exception/lib/' - - './system/test_compilation/' - - './' - defines: - prefix: '-D' - items: - - CMOCK - - 'UNITY_SUPPORT_64' - object_files: - prefix: '-o' - extension: '.o' - destination: *systest_build_path - -linker: - path: gcc - options: - - -lm - includes: - prefix: '-I' - object_files: - path: *systest_build_path - extension: '.o' - bin_files: - prefix: '-o' - extension: '.exe' - destination: *systest_build_path - -unsupported: - - out_of_memory - - unity_64bit_support - - callingconv - -colour: true diff --git a/components/testframework/libs/cmock/test/targets/gcc_64.yml b/components/testframework/libs/cmock/test/targets/gcc_64.yml deleted file mode 100644 index 2702d5b5a..000000000 --- a/components/testframework/libs/cmock/test/targets/gcc_64.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -compiler: - path: gcc - source_path: &systest_generated_path './system/generated/' - unit_tests_path: &unit_tests_path '../examples/test/' - mocks_path: &systest_mocks_path './system/generated/' - build_path: &systest_build_path './system/build/' - options: - - '-c' - - '-m64' - - '-Wall' - - '-Wunused-parameter' - - '-Wno-address' - - '-Wno-invalid-token-paste' - - '-std=c99' - - '-pedantic' - includes: - prefix: '-I' - items: - - *systest_generated_path - - *unit_tests_path - - *systest_mocks_path - - '../src/' - - '../vendor/unity/src/' - - '../vendor/c_exception/lib/' - - './system/test_compilation/' - - './' - defines: - prefix: '-D' - items: - - CMOCK - - 'UNITY_SUPPORT_64' - - 'UNITY_POINTER_WIDTH=64' - object_files: - prefix: '-o' - extension: '.o' - destination: *systest_build_path - -linker: - path: gcc - options: - - -lm - - '-m64' - includes: - prefix: '-I' - object_files: - path: *systest_build_path - extension: '.o' - bin_files: - prefix: '-o' - extension: '.exe' - destination: *systest_build_path - -unsupported: - - out_of_memory - - callingconv - -colour: true diff --git a/components/testframework/libs/cmock/test/targets/gcc_tiny.yml b/components/testframework/libs/cmock/test/targets/gcc_tiny.yml deleted file mode 100644 index f7ab5e793..000000000 --- a/components/testframework/libs/cmock/test/targets/gcc_tiny.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -compiler: - path: gcc - source_path: &systest_generated_path './system/generated/' - unit_tests_path: &unit_tests_path '../examples/test/' - mocks_path: &systest_mocks_path './system/generated/' - build_path: &systest_build_path './system/build/' - options: - - '-c' - - '-Wall' - - '-Wextra' - - '-Wunused-parameter' - - '-Wno-address' - - '-Wno-invalid-token-paste' - - '-std=c99' - - '-pedantic' - - '-O0' - includes: - prefix: '-I' - items: - - *systest_generated_path - - *unit_tests_path - - *systest_mocks_path - - '../src/' - - '../vendor/unity/src/' - - '../vendor/c_exception/lib/' - - './system/test_compilation/' - - './' - defines: - prefix: '-D' - items: - - CMOCK - - 'CMOCK_MEM_STATIC' - - 'CMOCK_MEM_SIZE=1024' - object_files: - prefix: '-o' - extension: '.o' - destination: *systest_build_path - -linker: - path: gcc - options: - - -lm - includes: - prefix: '-I' - object_files: - path: *systest_build_path - extension: '.o' - bin_files: - prefix: '-o' - extension: '.exe' - destination: *systest_build_path - -unsupported: - - all_plugins_but_other_limits - - all_plugins_coexist - - array_and_pointer_handling - - const_primitives_handling - - enforce_strict_ordering - - expect_and_return_custom_types - - expect_and_return_treat_as - - expect_and_throw - - expect_any_args - - fancy_pointer_handling - - function_pointer_handling - - newer_standards_stuff1 - - nonstandard_pased_stuff_1 - - nonstandard_pased_stuff_2 - - parsing_challenges - - return_thru_ptr_and_expect_any_args - - return_thru_ptr_ignore_arg - - struct_union_enum_expect_and_return - - struct_union_enum_expect_and_return_with_plugins - - stubs_with_callbacks - - unity_64bit_support - - unity_ignores - - callingconv - - C - -colour: true diff --git a/components/testframework/libs/cmock/test/targets/iar_arm_v4.yml b/components/testframework/libs/cmock/test/targets/iar_arm_v4.yml deleted file mode 100644 index 61e0331e9..000000000 --- a/components/testframework/libs/cmock/test/targets/iar_arm_v4.yml +++ /dev/null @@ -1,110 +0,0 @@ -tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 4.0\' -compiler: - path: [*tools_root, 'arm\bin\iccarm.exe'] - source_path: &systest_generated_path './system/generated/' - unit_tests_path: &unit_tests_path '../examples/test/' - mocks_path: &systest_mocks_path './system/generated/' - build_path: &systest_build_path './system/build/' - options: - - --dlib_config - - [*tools_root, 'arm\lib\dl4tptinl8n.h'] - - -z3 - - --no_cse - - --no_unroll - - --no_inline - - --no_code_motion - - --no_tbaa - - --no_clustering - - --no_scheduling - - --debug - - --cpu_mode thumb - - --endian little - - --cpu ARM7TDMI - - --stack_align 4 - - --interwork - - -e - - --silent - - --warnings_are_errors - - --fpu None - #We are supressing some warnings here because we test CMock against some questionable code to make sure it still works - - --diag_suppress Pa050 - - --diag_suppress Pe191 - - --diag_suppress=Pe494 - - --diag_suppress=Pe083 - includes: - prefix: '-I' - items: - - [*tools_root, 'arm\inc\'] - - *systest_generated_path - - *unit_tests_path - - *systest_mocks_path - - '../src/' - - '../vendor/unity/src/' - - '../vendor/c_exception/lib/' - - './system/test_compilation/' - - './' - defines: - prefix: '-D' - items: - - CMOCK - object_files: - prefix: '-o' - extension: '.r79' - destination: *systest_build_path - -linker: - path: [*tools_root, 'common\bin\xlink.exe'] - options: - - -rt - - [*tools_root, 'arm\lib\dl4tptinl8n.r79'] - - -D_L_EXTMEM_START=0 - - -D_L_EXTMEM_SIZE=0 - - -D_L_HEAP_SIZE=120 - - -D_L_STACK_SIZE=32 - - -e_small_write=_formatted_write - - -s - - __program_start - - '-f iar\iar_v4\Resource\at91SAM7X256_FLASH.xcl' - includes: - prefix: '-I' - items: - - *systest_generated_path - - *unit_tests_path - - *systest_mocks_path - - 'vendor/unity/src/' - - [*tools_root, 'arm\config\'] - - [*tools_root, 'arm\lib\'] - object_files: - path: *systest_build_path - extension: '.r79' - bin_files: - prefix: '-o' - extension: '.d79' - destination: *systest_build_path - -simulator: - path: [*tools_root, 'common\bin\CSpyBat.exe'] - pre_support: - - --silent - - [*tools_root, 'arm\bin\armproc.dll'] - - [*tools_root, 'arm\bin\armsim.dll'] - post_support: - - --plugin - - [*tools_root, 'arm\bin\armbat.dll'] - - --macro - - 'iar\iar_v4\Resource\SAM7_SIM.mac' - - --backend - - -B - - -p - - [*tools_root, 'arm\config\ioat91sam7X256.ddf'] - - -d - - sim - -unsupported: - - out_of_memory - - nonstandard_parsed_stuff_1 - - const - - callingconv - - unity_64bit_support - -colour: true diff --git a/components/testframework/libs/cmock/test/targets/iar_arm_v5.yml b/components/testframework/libs/cmock/test/targets/iar_arm_v5.yml deleted file mode 100644 index bac2f7a9d..000000000 --- a/components/testframework/libs/cmock/test/targets/iar_arm_v5.yml +++ /dev/null @@ -1,95 +0,0 @@ -tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 5.3\' -compiler: - path: [*tools_root, 'arm\bin\iccarm.exe'] - source_path: &systest_generated_path './system/generated/' - unit_tests_path: &unit_tests_path '../examples/test/' - mocks_path: &systest_mocks_path './system/generated/' - build_path: &systest_build_path './system/build/' - options: - - --dlib_config - - [*tools_root, 'arm\inc\DLib_Config_Normal.h'] - - --no_cse - - --no_unroll - - --no_inline - - --no_code_motion - - --no_tbaa - - --no_clustering - - --no_scheduling - - --debug - - --cpu_mode thumb - - --endian=little - - --cpu=ARM7TDMI - - --interwork - - --warnings_are_errors - - --fpu=None - - -e - - -On - #We are supressing some warnings here because we test CMock against some questionable code to make sure it still works - - --diag_suppress=Pa050 - - --diag_suppress=Pe191 - - --diag_suppress=Pe494 - - --diag_suppress=Pe083 - includes: - prefix: '-I' - items: - - [*tools_root, 'arm\inc\'] - - *systest_generated_path - - *unit_tests_path - - *systest_mocks_path - - '../src/' - - '../vendor/unity/src/' - - '../vendor/c_exception/lib/' - - './system/test_compilation/' - - './' - - '.\iar\iar_v5\incIAR\' - defines: - prefix: '-D' - items: - - CMOCK - object_files: - prefix: '-o' - extension: '.r79' - destination: *systest_build_path - -linker: - path: [*tools_root, 'arm\bin\ilinkarm.exe'] - options: - - --redirect _Printf=_PrintfLarge - - --redirect _Scanf=_ScanfSmall - - --semihosting - - --entry __iar_program_start - - --config iar\iar_v5\Resource\at91SAM7X256_RAM.icf - object_files: - path: *systest_build_path - extension: '.o' - bin_files: - prefix: '-o' - extension: '.out' - destination: *systest_build_path - -simulator: - path: [*tools_root, 'common\bin\CSpyBat.exe'] - pre_support: - - --silent - - [*tools_root, 'arm\bin\armproc.dll'] - - [*tools_root, 'arm\bin\armsim.dll'] - post_support: - - --plugin - - [*tools_root, 'arm\bin\armbat.dll'] - - --macro - - 'iar\iar_v5\Resource\SAM7_SIM.mac' - - --backend - - -B - - -p - - [*tools_root, 'arm\config\debugger\Atmel\ioat91sam7X256.ddf'] - - -d - - sim - -unsupported: - - out_of_memory - - nonstandard_parsed_stuff_1 - - const - - callingconv - - unity_64bit_support - -colour: true diff --git a/components/testframework/libs/cmock/test/test_helper.rb b/components/testframework/libs/cmock/test/test_helper.rb deleted file mode 100644 index 486196c0f..000000000 --- a/components/testframework/libs/cmock/test/test_helper.rb +++ /dev/null @@ -1,44 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - - -require 'minitest/autorun' - -def create_mocks(*mocks) - mocks.each do |mock| - eval "@#{mock} = Minitest::Mock.new" - end -end - -def create_stub(funcs) - stub = Class.new - blob = "class << stub\n" - funcs.each_pair {|k,v| blob += "def #{k.to_s}(unused=nil)\n #{v.inspect}\nend\n" } - blob += "end" - eval blob - stub -end - -def test_return - { - :int => {:type => "int", :name => 'cmock_to_return', :ptr? => false, :const? => false, :void? => false, :str => 'int cmock_to_return'}, - :int_ptr => {:type => "int*", :name => 'cmock_to_return', :ptr? => true, :const? => false, :void? => false, :str => 'int* cmock_to_return'}, - :void => {:type => "void", :name => 'cmock_to_return', :ptr? => false, :const? => false, :void? => true, :str => 'void cmock_to_return'}, - :string => {:type => "const char*", :name => 'cmock_to_return', :ptr? => false, :const? => true, :void? => false, :str => 'const char* cmock_to_return'}, - } -end - -def test_arg - { - :int => {:type => "int", :name => 'MyInt', :ptr? => false, :const? => false, :const_ptr? => false}, - :int_ptr => {:type => "int*", :name => 'MyIntPtr', :ptr? => true, :const? => false, :const_ptr? => false}, - :const_ptr => {:type => "int*", :name => 'MyConstPtr', :ptr? => true, :const? => false, :const_ptr? => true}, - :double_ptr => {:type => "int const**", :name => 'MyDoublePtr', :ptr? => true, :const? => true, :const_ptr? => false}, - :mytype => {:type => "MY_TYPE", :name => 'MyMyType', :ptr? => false, :const? => true, :const_ptr? => false}, - :mytype_ptr => {:type => "MY_TYPE*", :name => 'MyMyTypePtr', :ptr? => true, :const? => false, :const_ptr? => false}, - :string => {:type => "const char*", :name => 'MyStr', :ptr? => false, :const? => true, :const_ptr? => false}, - } -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_config_test.rb b/components/testframework/libs/cmock/test/unit/cmock_config_test.rb deleted file mode 100644 index 8c5e410a7..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_config_test.rb +++ /dev/null @@ -1,126 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_config' - - -describe CMockConfig, "Verify CMockConfig Module" do - - it "use default settings when no parameters are specified" do - config = CMockConfig.new - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:mock_path], config.mock_path) - assert_nil(CMockConfig::CMOCK_DEFAULT_OPTIONS[:includes]) - assert_nil(config.includes) - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:attributes], config.attributes) - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:plugins], config.plugins) - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:treat_externs], config.treat_externs) - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:treat_inlines], config.treat_inlines) - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:inline_function_patterns], config.inline_function_patterns) - end - - it "replace only options specified in a hash" do - test_includes = ['hello'] - test_attributes = ['blah', 'bleh'] - config = CMockConfig.new(:includes => test_includes, :attributes => test_attributes) - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:mock_path], config.mock_path) - assert_equal(test_includes, config.includes) - assert_equal(test_attributes, config.attributes) - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:plugins], config.plugins) - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:treat_externs], config.treat_externs) - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:treat_inlines], config.treat_inlines) - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:inline_function_patterns], config.inline_function_patterns) - end - - it "replace only options specified in a yaml file" do - test_plugins = [:soda, :pizza] - config = CMockConfig.new("#{File.expand_path(File.dirname(__FILE__))}/cmock_config_test.yml") - assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:mock_path], config.mock_path) - assert_nil(CMockConfig::CMOCK_DEFAULT_OPTIONS[:includes]) - assert_nil(config.includes) - assert_equal(test_plugins, config.plugins) - assert_equal(:include, config.treat_externs) - assert_equal(:include, config.treat_inlines) - assert_equal(['MY_INLINE_FUNCTION_DECLARATION_PATTERN'], config.inline_function_patterns) - end - - it "populate treat_as map with internal standard_treat_as_map defaults, redefine defaults, and add custom values" do - - user_treat_as1 = { - 'BOOL' => 'UINT8', # redefine standard default - 'unsigned long' => 'INT', # redefine standard default - 'U8' => 'UINT8', # custom value - 'U16' => 'UINT16' # custom value - } - user_treat_as2 = { - 'BOOL' => 'INT16', # redefine standard default - 'U16' => 'HEX16' # custom value - } - - config1 = CMockConfig.new({:treat_as => user_treat_as1}) - config2 = CMockConfig.new({:treat_as => user_treat_as2}) - - # ----- USER SET 1 - # standard defaults - assert_equal('INT', config1.treat_as['BOOL_T']) - assert_equal('HEX32', config1.treat_as['unsigned int']) - assert_equal('HEX8_ARRAY',config1.treat_as['void*']) - assert_equal('STRING', config1.treat_as['CSTRING']) - assert_equal('STRING', config1.treat_as['char*']) - assert_equal('HEX8', config1.treat_as['unsigned char']) - assert_equal('INT', config1.treat_as['long']) - assert_equal('INT16', config1.treat_as['short']) - - # overrides - assert_equal('UINT8', config1.treat_as['BOOL']) - assert_equal('INT', config1.treat_as['unsigned long']) - - # added custom values - assert_equal('UINT8', config1.treat_as['U8']) - assert_equal('UINT16', config1.treat_as['U16']) - - # standard_treat_as_map: unchanged - assert_equal('INT', config1.standard_treat_as_map['BOOL']) - assert_equal('HEX32', config1.standard_treat_as_map['unsigned long']) - assert_equal('STRING', config1.standard_treat_as_map['char*']) - - # ----- USER SET 2 - # standard defaults - assert_equal('INT', config2.treat_as['BOOL_T']) - assert_equal('HEX32', config2.treat_as['unsigned int']) - assert_equal('HEX8_ARRAY',config2.treat_as['void*']) - assert_equal('STRING', config2.treat_as['CSTRING']) - assert_equal('STRING', config2.treat_as['char*']) - assert_equal('HEX8', config2.treat_as['unsigned char']) - assert_equal('INT', config2.treat_as['long']) - assert_equal('INT16', config2.treat_as['short']) - assert_equal('HEX32', config2.treat_as['unsigned long']) - - # overrides - assert_equal('INT16', config2.treat_as['BOOL']) - - # added custom values - assert_equal('HEX16', config2.treat_as['U16']) - - # standard_treat_as_map: unchanged - assert_equal('INT', config2.standard_treat_as_map['BOOL']) - assert_equal('HEX32', config2.standard_treat_as_map['unsigned long']) - assert_equal('STRING', config2.standard_treat_as_map['char*']) - end - - it "standard treat_as map should be incorruptable" do - config = CMockConfig.new({}) - - assert_equal('INT', config.standard_treat_as_map['BOOL_T']) - - local = config.standard_treat_as_map - local['BOOL_T'] = "U8" - - assert_equal('INT', config.standard_treat_as_map['BOOL_T']) - end - -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_config_test.yml b/components/testframework/libs/cmock/test/unit/cmock_config_test.yml deleted file mode 100644 index eaee14b77..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_config_test.yml +++ /dev/null @@ -1,7 +0,0 @@ -:cmock: - :plugins: - - 'soda' - - 'pizza' - :treat_externs: :include - :treat_inlines: :include - :inline_function_patterns: ['MY_INLINE_FUNCTION_DECLARATION_PATTERN'] diff --git a/components/testframework/libs/cmock/test/unit/cmock_file_writer_test.rb b/components/testframework/libs/cmock/test/unit/cmock_file_writer_test.rb deleted file mode 100644 index 932e7dcc8..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_file_writer_test.rb +++ /dev/null @@ -1,27 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_file_writer' - -describe CMockFileWriter, "Verify CMockFileWriter Module" do - - before do - create_mocks :config - @cmock_file_writer = CMockFileWriter.new(@config) - end - - after do - end - - it "complain if a block was not specified when calling create" do - begin - @cmock_file_writer.create_file("test.txt") - assert false, "Should Have Thrown An Error When Calling Without A Block" - rescue - end - end -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_main_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_main_test.rb deleted file mode 100644 index 846241250..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_main_test.rb +++ /dev/null @@ -1,686 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -$ThisIsOnlyATest = true - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator' - -class MockedPluginHelper - def initialize return_this - @return_this = return_this - end - - def include_files - return @return_this - end - - def instance_structure( name, args, rettype ) - return " #{@return_this}_#{name}(#{args}, #{rettype})" - end - - def mock_verify( name ) - return " #{@return_this}_#{name}" - end - - def mock_destroy( name, args, rettype ) - return " #{@return_this}_#{name}(#{args}, #{rettype})" - end - - def mock_implementation(name, args) - return " Mock#{name}#{@return_this}(#{args.join(", ")})" - end -end - -describe CMockGenerator, "Verify CMockGenerator Module" do - - before do - create_mocks :config, :file_writer, :utils, :plugins - @module_name = "PoutPoutFish" - - #no strict handling - @config.expect :mock_prefix, "Mock" - @config.expect :mock_suffix, "" - @config.expect :weak, "" - @config.expect :enforce_strict_ordering, nil - @config.expect :framework, :unity - @config.expect :includes, ["ConfigRequiredHeader1.h","ConfigRequiredHeader2.h"] - #@config.expect :includes_h_pre_orig_header, nil #not called because includes called - @config.expect :includes_h_post_orig_header, nil - @config.expect :includes_c_pre_header, nil - @config.expect :includes_c_post_header, nil - @config.expect :subdir, nil - @config.expect :fail_on_unexpected_calls, true - @config.expect :treat_inlines, :exclude - @cmock_generator = CMockGenerator.new(@config, @file_writer, @utils, @plugins) - @cmock_generator.module_name = @module_name - @cmock_generator.module_ext = '.h' - @cmock_generator.mock_name = "Mock#{@module_name}" - @cmock_generator.clean_mock_name = "Mock#{@module_name}" - - #strict handling - @config.expect :mock_prefix, "Mock" - @config.expect :mock_suffix, "" - @config.expect :weak, "" - @config.expect :enforce_strict_ordering, true - @config.expect :framework, :unity - @config.expect :includes, nil - @config.expect :includes_h_pre_orig_header, nil - @config.expect :includes_h_post_orig_header, nil - @config.expect :includes_c_pre_header, nil - @config.expect :includes_c_post_header, nil - @config.expect :subdir, nil - @config.expect :fail_on_unexpected_calls, true - @config.expect :treat_inlines, :exclude - @cmock_generator_strict = CMockGenerator.new(@config, @file_writer, @utils, @plugins) - @cmock_generator_strict.module_name = @module_name - @cmock_generator_strict.module_ext = '.h' - @cmock_generator_strict.mock_name = "Mock#{@module_name}" - @cmock_generator_strict.clean_mock_name = "Mock#{@module_name}" - end - - after do - end - - def helper_create_header_top_with_opt_incldues_form_config_and_plugin(ext) - @config.expect :mock_prefix, "Mock" - @config.expect :mock_suffix, "" - @config.expect :weak, "" - @cmock_generator.module_ext = ext - orig_filename = "PoutPoutFish#{ext}" - define_name = "MOCKPOUTPOUTFISH_H" - output = [] - expected = [ - "/* AUTOGENERATED FILE. DO NOT EDIT. */\n", - "#ifndef _#{define_name}\n", - "#define _#{define_name}\n\n", - "#include \"unity.h\"\n", - "#include \"ConfigRequiredHeader1.h\"\n", - "#include \"ConfigRequiredHeader2.h\"\n", - "#include \"#{orig_filename}\"\n", - "#include \"PluginRequiredHeader.h\"\n", - "\n", - "/* Ignore the following warnings, since we are copying code */\n", - "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n", - "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n", - "#pragma GCC diagnostic push\n", - "#endif\n", - "#if !defined(__clang__)\n", - "#pragma GCC diagnostic ignored \"-Wpragmas\"\n", - "#endif\n", - "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n", - "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n", - "#endif\n", - "\n", - ] - - @config.expect :orig_header_include_fmt, "#include \"%s\"" - @plugins.expect :run, "#include \"PluginRequiredHeader.h\"\n", [:include_files] - - @cmock_generator.create_mock_header_header(output, "Mock#{orig_filename}") - - assert_equal(expected, output) - end - - it "create the top of a header file with optional include files from config and include file from plugin" do - ['.h','.hh','.hpp'].each do |ext| - helper_create_header_top_with_opt_incldues_form_config_and_plugin(ext) - end - end - - it "handle dashes and spaces in the module name" do - #no strict handling - @config.expect :mock_prefix, "Mock" - @config.expect :mock_suffix, "" - @config.expect :weak, "" - @config.expect :enforce_strict_ordering, nil - @config.expect :framework, :unity - @config.expect :includes, ["ConfigRequiredHeader1.h","ConfigRequiredHeader2.h"] - @config.expect :includes_h_post_orig_header, nil - @config.expect :includes_c_pre_header, nil - @config.expect :includes_c_post_header, nil - @config.expect :subdir, nil - @config.expect :fail_on_unexpected_calls, true - @config.expect :treat_inlines, :exclude - @cmock_generator2 = CMockGenerator.new(@config, @file_writer, @utils, @plugins) - @cmock_generator2.module_name = "Pout-Pout Fish" - @cmock_generator2.module_ext = '.h' - @cmock_generator2.mock_name = "MockPout-Pout Fish" - @cmock_generator2.clean_mock_name = "MockPout_Pout_Fish" - - @config.expect :mock_prefix, "Mock" - @config.expect :mock_suffix, "" - @config.expect :weak, "" - orig_filename = "Pout-Pout Fish.h" - define_name = "MOCKPOUT_POUT_FISH_H" - output = [] - expected = [ - "/* AUTOGENERATED FILE. DO NOT EDIT. */\n", - "#ifndef _#{define_name}\n", - "#define _#{define_name}\n\n", - "#include \"unity.h\"\n", - "#include \"ConfigRequiredHeader1.h\"\n", - "#include \"ConfigRequiredHeader2.h\"\n", - "#include \"#{orig_filename}\"\n", - "#include \"PluginRequiredHeader.h\"\n", - "\n", - "/* Ignore the following warnings, since we are copying code */\n", - "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n", - "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n", - "#pragma GCC diagnostic push\n", - "#endif\n", - "#if !defined(__clang__)\n", - "#pragma GCC diagnostic ignored \"-Wpragmas\"\n", - "#endif\n", - "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n", - "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n", - "#endif\n", - "\n", - ] - - @config.expect :orig_header_include_fmt, "#include \"%s\"" - @plugins.expect :run, "#include \"PluginRequiredHeader.h\"\n", [:include_files] - - @cmock_generator2.create_mock_header_header(output, "MockPout-Pout Fish.h") - - assert_equal(expected, output) - end - - it "create the top of a header file with optional include files from config" do - @config.expect :mock_prefix, "Mock" - @config.expect :mock_suffix, "" - @config.expect :weak, "" - orig_filename = "PoutPoutFish.h" - define_name = "MOCKPOUTPOUTFISH_H" - output = [] - expected = [ - "/* AUTOGENERATED FILE. DO NOT EDIT. */\n", - "#ifndef _#{define_name}\n", - "#define _#{define_name}\n\n", - "#include \"unity.h\"\n", - "#include \"ConfigRequiredHeader1.h\"\n", - "#include \"ConfigRequiredHeader2.h\"\n", - "#include \"#{orig_filename}\"\n", - "\n", - "/* Ignore the following warnings, since we are copying code */\n", - "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n", - "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n", - "#pragma GCC diagnostic push\n", - "#endif\n", - "#if !defined(__clang__)\n", - "#pragma GCC diagnostic ignored \"-Wpragmas\"\n", - "#endif\n", - "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n", - "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n", - "#endif\n", - "\n", - ] - - @config.expect :orig_header_include_fmt, "#include \"%s\"" - @plugins.expect :run, '', [:include_files] - - @cmock_generator.create_mock_header_header(output, "MockPoutPoutFish.h") - - assert_equal(expected, output) - end - - it "create the top of a header file with include file from plugin" do - @config.expect :mock_prefix, "Mock" - @config.expect :mock_suffix, "" - @config.expect :weak, "" - orig_filename = "PoutPoutFish.h" - define_name = "MOCKPOUTPOUTFISH_H" - output = [] - expected = [ - "/* AUTOGENERATED FILE. DO NOT EDIT. */\n", - "#ifndef _#{define_name}\n", - "#define _#{define_name}\n\n", - "#include \"unity.h\"\n", - "#include \"ConfigRequiredHeader1.h\"\n", - "#include \"ConfigRequiredHeader2.h\"\n", - "#include \"#{orig_filename}\"\n", - "#include \"PluginRequiredHeader.h\"\n", - "\n", - "/* Ignore the following warnings, since we are copying code */\n", - "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n", - "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n", - "#pragma GCC diagnostic push\n", - "#endif\n", - "#if !defined(__clang__)\n", - "#pragma GCC diagnostic ignored \"-Wpragmas\"\n", - "#endif\n", - "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n", - "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n", - "#endif\n", - "\n", - ] - - @config.expect :orig_header_include_fmt, "#include \"%s\"" - @plugins.expect :run, "#include \"PluginRequiredHeader.h\"\n", [:include_files] - - @cmock_generator.create_mock_header_header(output, "MockPoutPoutFish.h") - - assert_equal(expected, output) - end - - it "write typedefs" do - typedefs = [ 'typedef unsigned char U8;', - 'typedef char S8;', - 'typedef unsigned long U32;' - ] - output = [] - expected = [ "\n", - "typedef unsigned char U8;\n", - "typedef char S8;\n", - "typedef unsigned long U32;\n", - "\n\n" - ] - - @cmock_generator.create_typedefs(output, typedefs) - - assert_equal(expected, output.flatten) - end - - it "create the header file service call declarations" do - mock_name = "MockPoutPoutFish" - - output = [] - expected = [ "void #{mock_name}_Init(void);\n", - "void #{mock_name}_Destroy(void);\n", - "void #{mock_name}_Verify(void);\n\n" - ] - - @cmock_generator.create_mock_header_service_call_declarations(output) - - assert_equal(expected, output) - end - - it "append the proper footer to the header file" do - output = [] - expected = ["\n", - "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n", - "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n", - "#pragma GCC diagnostic pop\n", - "#endif\n", - "#endif\n", - "\n", - "#endif\n" - ] - - @cmock_generator.create_mock_header_footer(output) - - assert_equal(expected, output) - end - - it "create a proper heading for a source file" do - output = [] - functions = [ { :name => "uno", :args => [ { :name => "arg1" }, { :name => "arg2" } ] }, - { :name => "dos", :args => [ { :name => "arg3" }, { :name => "arg2" } ] }, - { :name => "tres", :args => [] } - ] - expected = [ "/* AUTOGENERATED FILE. DO NOT EDIT. */\n", - "#include \n", - "#include \n", - "#include \n", - "#include \"cmock.h\"\n", - "#include \"MockPoutPoutFish.h\"\n", - "\n", - "static const char* CMockString_arg1 = \"arg1\";\n", - "static const char* CMockString_arg2 = \"arg2\";\n", - "static const char* CMockString_arg3 = \"arg3\";\n", - "static const char* CMockString_dos = \"dos\";\n", - "static const char* CMockString_tres = \"tres\";\n", - "static const char* CMockString_uno = \"uno\";\n", - "\n" - ] - - @cmock_generator.create_source_header_section(output, "MockPoutPoutFish.c", functions) - - assert_equal(expected, output) - end - - it "create the instance structure where it is needed when no functions" do - output = [] - functions = [] - expected = [ "static struct MockPoutPoutFishInstance\n", - "{\n", - " unsigned char placeHolder;\n", - "} Mock;\n\n" - ].join - - @cmock_generator.create_instance_structure(output, functions) - - assert_equal(expected, output.join) - end - - it "create the instance structure where it is needed when functions required" do - output = [] - functions = [ { :name => "First", :args => "int Candy", :return => test_return[:int] }, - { :name => "Second", :args => "bool Smarty", :return => test_return[:string] } - ] - expected = [ "typedef struct _CMOCK_First_CALL_INSTANCE\n{\n", - " UNITY_LINE_TYPE LineNumber;\n", - " b1 b2", - "\n} CMOCK_First_CALL_INSTANCE;\n\n", - "typedef struct _CMOCK_Second_CALL_INSTANCE\n{\n", - " UNITY_LINE_TYPE LineNumber;\n", - "\n} CMOCK_Second_CALL_INSTANCE;\n\n", - "static struct MockPoutPoutFishInstance\n{\n", - " d1", - " CMOCK_MEM_INDEX_TYPE First_CallInstance;\n", - " e1 e2 e3", - " CMOCK_MEM_INDEX_TYPE Second_CallInstance;\n", - "} Mock;\n\n" - ].join - @plugins.expect :run, [" b1"," b2"], [:instance_typedefs, functions[0]] - @plugins.expect :run, [], [:instance_typedefs, functions[1]] - - @plugins.expect :run, [" d1"], [:instance_structure, functions[0]] - @plugins.expect :run, [" e1"," e2"," e3"], [:instance_structure, functions[1]] - - @cmock_generator.create_instance_structure(output, functions) - - assert_equal(expected, output.join) - end - - it "create extern declarations for source file" do - output = [] - expected = [ "extern jmp_buf AbortFrame;\n", - "\n" ] - - @cmock_generator.create_extern_declarations(output) - - assert_equal(expected, output.flatten) - end - - it "create extern declarations for source file when using strict ordering" do - output = [] - expected = [ "extern jmp_buf AbortFrame;\n", - "extern int GlobalExpectCount;\n", - "extern int GlobalVerifyOrder;\n", - "\n" ] - - @cmock_generator_strict.create_extern_declarations(output) - - assert_equal(expected, output.flatten) - end - - it "create mock verify functions in source file when no functions specified" do - functions = [] - output = [] - expected = "void MockPoutPoutFish_Verify(void)\n{\n}\n\n" - - @cmock_generator.create_mock_verify_function(output, functions) - - assert_equal(expected, output.join) - end - - it "create mock verify functions in source file when extra functions specified" do - functions = [ { :name => "First", :args => "int Candy", :return => test_return[:int] }, - { :name => "Second", :args => "bool Smarty", :return => test_return[:string] } - ] - output = [] - expected = [ "void MockPoutPoutFish_Verify(void)\n{\n", - " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n", - " CMOCK_MEM_INDEX_TYPE call_instance;\n", - " call_instance = Mock.First_CallInstance;\n" + - " Uno_First" + - " Dos_First" + - " call_instance = Mock.Second_CallInstance;\n" + - " Uno_Second" + - " Dos_Second", - "}\n\n" - ] - @plugins.expect :run, [" Uno_First"," Dos_First"], [:mock_verify, functions[0]] - @plugins.expect :run, [" Uno_Second"," Dos_Second"], [:mock_verify, functions[1]] - - @cmock_generator.ordered = true - @cmock_generator.create_mock_verify_function(output, functions) - - assert_equal(expected, output.flatten) - end - - it "create mock init functions in source file" do - output = [] - expected = [ "void MockPoutPoutFish_Init(void)\n{\n", - " MockPoutPoutFish_Destroy();\n", - "}\n\n" - ] - - @cmock_generator.create_mock_init_function(output) - - assert_equal(expected.join, output.join) - end - - it "create mock destroy functions in source file" do - functions = [] - output = [] - expected = [ "void MockPoutPoutFish_Destroy(void)\n{\n", - " CMock_Guts_MemFreeAll();\n", - " memset(&Mock, 0, sizeof(Mock));\n", - "}\n\n" - ] - - @cmock_generator.create_mock_destroy_function(output, functions) - - assert_equal(expected.join, output.join) - end - - it "create mock destroy functions in source file when specified with strict ordering" do - functions = [ { :name => "First", :args => "int Candy", :return => test_return[:int] }, - { :name => "Second", :args => "bool Smarty", :return => test_return[:string] } - ] - output = [] - expected = [ "void MockPoutPoutFish_Destroy(void)\n{\n", - " CMock_Guts_MemFreeAll();\n", - " memset(&Mock, 0, sizeof(Mock));\n", - " uno", - " GlobalExpectCount = 0;\n", - " GlobalVerifyOrder = 0;\n", - "}\n\n" - ] - @plugins.expect :run, [], [:mock_destroy, functions[0]] - @plugins.expect :run, [" uno"], [:mock_destroy, functions[1]] - - @cmock_generator_strict.create_mock_destroy_function(output, functions) - - assert_equal(expected.join, output.join) - end - - it "create mock implementation functions in source file" do - function = { :modifier => "static", - :return => test_return[:int], - :args_string => "uint32 sandwiches, const char* named", - :args => ["uint32 sandwiches", "const char* named"], - :var_arg => nil, - :name => "SupaFunction", - :unscoped_name => "SupaFunction", - :namespace => [], - :class => nil, - :attributes => "__inline" - } - output = [] - expected = [ "static int SupaFunction(uint32 sandwiches, const char* named)\n", - "{\n", - " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n", - " CMOCK_SupaFunction_CALL_INSTANCE* cmock_call_instance;\n", - " UNITY_SET_DETAIL(CMockString_SupaFunction);\n", - " cmock_call_instance = (CMOCK_SupaFunction_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.SupaFunction_CallInstance);\n", - " Mock.SupaFunction_CallInstance = CMock_Guts_MemNext(Mock.SupaFunction_CallInstance);\n", - " uno", - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n", - " cmock_line = cmock_call_instance->LineNumber;\n", - " dos", - " tres", - " UNITY_CLR_DETAILS();\n", - " return cmock_call_instance->ReturnVal;\n", - "}\n\n" - ] - @plugins.expect :run, [" uno"], [:mock_implementation_precheck, function] - @plugins.expect :run, [" dos"," tres"], [:mock_implementation, function] - - @cmock_generator.create_mock_implementation(output, function) - - assert_equal(expected.join, output.join) - end - - it "create mock implementation functions in source file with different options" do - function = { :modifier => "", - :c_calling_convention => "__stdcall", - :return => test_return[:int], - :args_string => "uint32 sandwiches", - :args => ["uint32 sandwiches"], - :var_arg => "corn ...", - :name => "SupaFunction", - :unscoped_name => "SupaFunction", - :namespace => [], - :class => nil, - :attributes => nil - } - output = [] - expected = [ "int __stdcall SupaFunction(uint32 sandwiches, corn ...)\n", - "{\n", - " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n", - " CMOCK_SupaFunction_CALL_INSTANCE* cmock_call_instance;\n", - " UNITY_SET_DETAIL(CMockString_SupaFunction);\n", - " cmock_call_instance = (CMOCK_SupaFunction_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.SupaFunction_CallInstance);\n", - " Mock.SupaFunction_CallInstance = CMock_Guts_MemNext(Mock.SupaFunction_CallInstance);\n", - " uno", - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n", - " cmock_line = cmock_call_instance->LineNumber;\n", - " dos", - " tres", - " UNITY_CLR_DETAILS();\n", - " return cmock_call_instance->ReturnVal;\n", - "}\n\n" - ] - @plugins.expect :run, [" uno"], [:mock_implementation_precheck, function] - @plugins.expect :run, [" dos"," tres"], [:mock_implementation, function] - - @cmock_generator.create_mock_implementation(output, function) - - assert_equal(expected.join, output.join) - end - - it "create mock implementation function in source file for C++ static member" do - function = { :modifier => "static", - :return => test_return[:int], - :args_string => "uint32 sandwiches, const char* named", - :args => ["uint32 sandwiches", "const char* named"], - :var_arg => nil, - :unscoped_name => "SupaFunction", - :namespace => ["ns1", "ns2"], - :class => "SupaClass", - :name => "ns1_ns2_SupaClass_SupaFunction", - :attributes => nil - } - output = [] - expected = [ "namespace ns1 {\n", - "namespace ns2 {\n", - "static int SupaClass::SupaFunction(uint32 sandwiches, const char* named)\n", - "{\n", - " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n", - " CMOCK_ns1_ns2_SupaClass_SupaFunction_CALL_INSTANCE* cmock_call_instance;\n", - " UNITY_SET_DETAIL(CMockString_ns1_ns2_SupaClass_SupaFunction);\n", - " cmock_call_instance = (CMOCK_ns1_ns2_SupaClass_SupaFunction_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.ns1_ns2_SupaClass_SupaFunction_CallInstance);\n", - " Mock.ns1_ns2_SupaClass_SupaFunction_CallInstance = CMock_Guts_MemNext(Mock.ns1_ns2_SupaClass_SupaFunction_CallInstance);\n", - " uno", - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n", - " cmock_line = cmock_call_instance->LineNumber;\n", - " dos", - " tres", - " UNITY_CLR_DETAILS();\n", - " return cmock_call_instance->ReturnVal;\n", - "}\n", - "}\n", - "}\n\n", - ] - @plugins.expect :run, [" uno"], [:mock_implementation_precheck, function] - @plugins.expect :run, [" dos"," tres"], [:mock_implementation, function] - - @cmock_generator.create_mock_implementation(output, function) - - assert_equal(expected.join, output.join) - end - - it "create mock implementation functions in source file with different options for C++ static member" do - function = { :modifier => "static", - :c_calling_convention => "__stdcall", - :return => test_return[:int], - :args_string => "uint32 sandwiches", - :args => ["uint32 sandwiches"], - :var_arg => "corn ...", - :name => "SupaClass_SupaFunction", - :unscoped_name => "SupaFunction", - :namespace => [], - :class => "SupaClass", - :attributes => nil - } - output = [] - expected = [ "static int __stdcall SupaClass::SupaFunction(uint32 sandwiches, corn ...)\n", - "{\n", - " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n", - " CMOCK_SupaClass_SupaFunction_CALL_INSTANCE* cmock_call_instance;\n", - " UNITY_SET_DETAIL(CMockString_SupaClass_SupaFunction);\n", - " cmock_call_instance = (CMOCK_SupaClass_SupaFunction_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.SupaClass_SupaFunction_CallInstance);\n", - " Mock.SupaClass_SupaFunction_CallInstance = CMock_Guts_MemNext(Mock.SupaClass_SupaFunction_CallInstance);\n", - " uno", - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n", - " cmock_line = cmock_call_instance->LineNumber;\n", - " dos", - " tres", - " UNITY_CLR_DETAILS();\n", - " return cmock_call_instance->ReturnVal;\n", - "}\n\n" - ] - @plugins.expect :run, [" uno"], [:mock_implementation_precheck, function] - @plugins.expect :run, [" dos"," tres"], [:mock_implementation, function] - - @cmock_generator.create_mock_implementation(output, function) - - assert_equal(expected.join, output.join) - end - - it "creates using statements for C++ static member in namespace" do - function = { :modifier => "static", - :return => test_return[:int], - :args_string => "uint32 sandwiches", - :args => ["uint32 sandwiches"], - :var_arg => nil, - :unscoped_name => "SupaFunction", - :namespace => ["ns1"], - :class => "SupaClass", - :name => "ns1_SupaClass_SupaFunction", - :attributes => nil - } - output = [] - expected = "using namespace ns1;\n" - - @cmock_generator.create_using_statement(output, function) - - assert_equal(expected, output.join) - end - - it "creates using statements for C++ static member in nested namespace" do - function = { :modifier => "static", - :return => test_return[:int], - :args_string => "uint32 sandwiches", - :args => ["uint32 sandwiches"], - :var_arg => nil, - :unscoped_name => "SupaFunction", - :namespace => ["ns1", "ns2"], - :class => "SupaClass", - :name => "ns1_ns2_SupaClass_SupaFunction", - :attributes => nil - } - output = [] - expected = "using namespace ns1::ns2;\n" - - @cmock_generator.create_using_statement(output, function) - - assert_equal(expected, output.join) - end -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_array_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_array_test.rb deleted file mode 100644 index 64c0b2838..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_array_test.rb +++ /dev/null @@ -1,141 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_array' -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_utils' - -class UtilsStub - def helpers - {} - end - def arg_type_with_const(arg) - CMockGeneratorUtils.arg_type_with_const(arg) - end - def code_add_base_expectation(func) - "mock_retval_0" - end -end - -describe CMockGeneratorPluginArray, "Verify CMockPGeneratorluginArray Module" do - before do - #no strict ordering - @config = create_stub( - :when_ptr => :compare_data, - :enforce_strict_ordering => false, - :respond_to? => true ) - - @utils = UtilsStub.new - - @cmock_generator_plugin_array = CMockGeneratorPluginArray.new(@config, @utils) - end - - after do - end - - it "have set up internal priority" do - assert_nil(@cmock_generator_plugin_array.unity_helper) - assert_equal(8, @cmock_generator_plugin_array.priority) - end - - it "not include any additional include files" do - assert(!@cmock_generator_plugin_array.respond_to?(:include_files)) - end - - it "not add to typedef structure for functions of style 'int* func(void)'" do - function = {:name => "Oak", :args => [], :return => test_return[:int_ptr]} - returned = @cmock_generator_plugin_array.instance_typedefs(function) - assert_equal("", returned) - end - - it "add to tyepdef structure mock needs of functions of style 'void func(int chicken, int* pork)'" do - function = {:name => "Cedar", :args => [{ :name => "chicken", :type => "int", :ptr? => false}, { :name => "pork", :type => "int*", :ptr? => true}], :return => test_return[:void]} - expected = " int Expected_pork_Depth;\n" - returned = @cmock_generator_plugin_array.instance_typedefs(function) - assert_equal(expected, returned) - end - - it "not add an additional mock interface for functions not containing pointers" do - function = {:name => "Maple", :args_string => "int blah", :return => test_return[:string], :contains_ptr? => false} - returned = @cmock_generator_plugin_array.mock_function_declarations(function) - assert_nil(returned) - end - - it "add another mock function declaration for functions of style 'void func(int* tofu)'" do - function = {:name => "Pine", - :args => [{ :type => "int*", - :name => "tofu", - :ptr? => true, - }], - :return => test_return[:void], - :contains_ptr? => true } - - expected = "#define #{function[:name]}_ExpectWithArray(tofu, tofu_Depth) #{function[:name]}_CMockExpectWithArray(__LINE__, tofu, tofu_Depth)\n" + - "void #{function[:name]}_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, int* tofu, int tofu_Depth);\n" - returned = @cmock_generator_plugin_array.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add another mock function declaration for functions of style 'const char* func(int* tofu)'" do - function = {:name => "Pine", - :args => [{ :type => "int*", - :name => "tofu", - :ptr? => true, - }], - :return => test_return[:string], - :contains_ptr? => true } - - expected = "#define #{function[:name]}_ExpectWithArrayAndReturn(tofu, tofu_Depth, cmock_retval) #{function[:name]}_CMockExpectWithArrayAndReturn(__LINE__, tofu, tofu_Depth, cmock_retval)\n" + - "void #{function[:name]}_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, int* tofu, int tofu_Depth, const char* cmock_to_return);\n" - returned = @cmock_generator_plugin_array.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add another mock function declaration for functions of style 'const char* func(const int* tofu)'" do - function = {:name => "Pine", - :args => [{ :type => "const int*", - :name => "tofu", - :ptr? => true, - :const? => true, - }], - :return => test_return[:string], - :contains_ptr? => true } - - expected = "#define #{function[:name]}_ExpectWithArrayAndReturn(tofu, tofu_Depth, cmock_retval) #{function[:name]}_CMockExpectWithArrayAndReturn(__LINE__, tofu, tofu_Depth, cmock_retval)\n" + - "void #{function[:name]}_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, const int* tofu, int tofu_Depth, const char* cmock_to_return);\n" - returned = @cmock_generator_plugin_array.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "not have a mock function implementation" do - assert(!@cmock_generator_plugin_array.respond_to?(:mock_implementation)) - end - - it "not have a mock interfaces for functions of style 'int* func(void)'" do - function = {:name => "Pear", :args => [], :args_string => "void", :return => test_return[:int_ptr]} - returned = @cmock_generator_plugin_array.mock_interfaces(function) - assert_nil(returned) - end - - it "add mock interfaces for functions of style 'int* func(int* pescado, int pes)'" do - function = {:name => "Lemon", - :args => [{ :type => "int*", :name => "pescado", :ptr? => true}, { :type => "int", :name => "pes", :ptr? => false}], - :args_string => "int* pescado, int pes", - :return => test_return[:int_ptr], - :contains_ptr? => true } - - expected = ["void Lemon_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, int* pescado, int pescado_Depth, int pes, int* cmock_to_return)\n", - "{\n", - "mock_retval_0", - " CMockExpectParameters_Lemon(cmock_call_instance, pescado, pescado_Depth, pes);\n", - " cmock_call_instance->ReturnVal = cmock_to_return;\n", - "}\n\n" - ].join - returned = @cmock_generator_plugin_array.mock_interfaces(function).join - assert_equal(expected, returned) - end - -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_callback_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_callback_test.rb deleted file mode 100644 index 0b5ce1eb8..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_callback_test.rb +++ /dev/null @@ -1,281 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_callback' - -describe CMockGeneratorPluginCallback, "Verify CMockGeneratorPluginCallback Module" do - - before do - create_mocks :config, :utils - - @config.expect :callback_include_count, true - @config.expect :callback_after_arg_check, false - @config.expect :plugins, [:ignore] - - @cmock_generator_plugin_callback = CMockGeneratorPluginCallback.new(@config, @utils) - end - - after do - end - - it "have set up internal priority" do - assert_equal(6, @cmock_generator_plugin_callback.priority) - end - - it "not include any additional include files" do - assert(!@cmock_generator_plugin_callback.respond_to?(:include_files)) - end - - it "add to instance structure" do - function = {:name => "Oak", :args => [:type => "int*", :name => "blah", :ptr? => true], :return => test_return[:int_ptr]} - expected = " char Oak_CallbackBool;\n" + - " CMOCK_Oak_CALLBACK Oak_CallbackFunctionPointer;\n" + - " int Oak_CallbackCalls;\n" - returned = @cmock_generator_plugin_callback.instance_structure(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for function without arguments" do - function = {:name => "Maple", :args_string => "void", :args => [], :return => test_return[:void]} - expected = [ "typedef void (* CMOCK_Maple_CALLBACK)(int cmock_num_calls);\n", - "void Maple_AddCallback(CMOCK_Maple_CALLBACK Callback);\n", - "void Maple_Stub(CMOCK_Maple_CALLBACK Callback);\n", - "#define Maple_StubWithCallback Maple_Stub\n" ].join - returned = @cmock_generator_plugin_callback.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for function without arguments when count is also turned off" do - function = {:name => "Maple", :args_string => "void", :args => [], :return => test_return[:void]} - expected = [ "typedef void (* CMOCK_Maple_CALLBACK)(void);\n", - "void Maple_AddCallback(CMOCK_Maple_CALLBACK Callback);\n", - "void Maple_Stub(CMOCK_Maple_CALLBACK Callback);\n", - "#define Maple_StubWithCallback Maple_Stub\n" ].join - @cmock_generator_plugin_callback.include_count = false - returned = @cmock_generator_plugin_callback.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for function with arguments" do - function = {:name => "Maple", :args_string => "int* tofu", :args => [1], :return => test_return[:void]} - expected = [ "typedef void (* CMOCK_Maple_CALLBACK)(int* tofu, int cmock_num_calls);\n", - "void Maple_AddCallback(CMOCK_Maple_CALLBACK Callback);\n", - "void Maple_Stub(CMOCK_Maple_CALLBACK Callback);\n", - "#define Maple_StubWithCallback Maple_Stub\n" ].join - returned = @cmock_generator_plugin_callback.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for function with return values" do - function = {:name => "Maple", :args_string => "int* tofu", :args => [1], :return => test_return[:string]} - expected = [ "typedef const char* (* CMOCK_Maple_CALLBACK)(int* tofu, int cmock_num_calls);\n", - "void Maple_AddCallback(CMOCK_Maple_CALLBACK Callback);\n", - "void Maple_Stub(CMOCK_Maple_CALLBACK Callback);\n", - "#define Maple_StubWithCallback Maple_Stub\n" ].join - returned = @cmock_generator_plugin_callback.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for function with return values and count is turned off" do - function = {:name => "Maple", :args_string => "int* tofu", :args => [1], :return => test_return[:string]} - expected = [ "typedef const char* (* CMOCK_Maple_CALLBACK)(int* tofu);\n", - "void Maple_AddCallback(CMOCK_Maple_CALLBACK Callback);\n", - "void Maple_Stub(CMOCK_Maple_CALLBACK Callback);\n", - "#define Maple_StubWithCallback Maple_Stub\n" ].join - @cmock_generator_plugin_callback.include_count = false - returned = @cmock_generator_plugin_callback.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions with no arg check and of style 'void func(void)'" do - function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:void]} - expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " Mock.Apple_CallbackFunctionPointer(Mock.Apple_CallbackCalls++);\n", - " }\n" - ].join - returned = @cmock_generator_plugin_callback.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions with no arg check and of style 'void func(void)' when count turned off" do - function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:void]} - expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " Mock.Apple_CallbackFunctionPointer();\n", - " }\n" - ].join - @cmock_generator_plugin_callback.include_count = false - returned = @cmock_generator_plugin_callback.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions with no arg check and of style 'int func(void)'" do - function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:int]} - expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " cmock_call_instance->ReturnVal = Mock.Apple_CallbackFunctionPointer(Mock.Apple_CallbackCalls++);\n", - " }\n" - ].join - returned = @cmock_generator_plugin_callback.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions with no arg check and of style 'void func(int* steak, uint8_t flag)'" do - function = {:name => "Apple", - :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, - { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], - :args_string => "int* steak, uint8_t flag", - :return=> test_return[:void]} - expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n", - " }\n" - ].join - returned = @cmock_generator_plugin_callback.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions with no arg check and of style 'void func(int* steak, uint8_t flag)' when count turned off" do - function = {:name => "Apple", - :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, - { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], - :args_string => "int* steak, uint8_t flag", - :return=> test_return[:void]} - expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " Mock.Apple_CallbackFunctionPointer(steak, flag);\n", - " }\n" - ].join - @cmock_generator_plugin_callback.include_count = false - returned = @cmock_generator_plugin_callback.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions with no arg check and of style 'int16_t func(int* steak, uint8_t flag)'" do - function = {:name => "Apple", - :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, - { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], - :args_string => "int* steak, uint8_t flag", - :return => test_return[:int]} - expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " cmock_call_instance->ReturnVal = Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n", - " }\n" - ].join - returned = @cmock_generator_plugin_callback.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions without arg check and of style 'void func(void)' when count turned off" do - function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:void]} - expected = [" if (!Mock.Apple_CallbackBool &&\n", - " Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " Mock.Apple_CallbackFunctionPointer();\n", - " UNITY_CLR_DETAILS();\n", - " return;\n", - " }\n" - ].join - @cmock_generator_plugin_callback.include_count = false - returned = @cmock_generator_plugin_callback.mock_implementation_precheck(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions without arg check and of style 'int func(void)'" do - function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:int]} - expected = [" if (!Mock.Apple_CallbackBool &&\n", - " Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " int cmock_cb_ret = Mock.Apple_CallbackFunctionPointer(Mock.Apple_CallbackCalls++);\n", - " UNITY_CLR_DETAILS();\n", - " return cmock_cb_ret;\n", - " }\n" - ].join - returned = @cmock_generator_plugin_callback.mock_implementation_precheck(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions without arg check and of style 'void func(int* steak, uint8_t flag)'" do - function = {:name => "Apple", - :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, - { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], - :args_string => "int* steak, uint8_t flag", - :return=> test_return[:void]} - expected = [" if (!Mock.Apple_CallbackBool &&\n", - " Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n", - " UNITY_CLR_DETAILS();\n", - " return;\n", - " }\n" - ].join - returned = @cmock_generator_plugin_callback.mock_implementation_precheck(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions without arg check and of style 'void func(int* steak, uint8_t flag)' when count turned off" do - function = {:name => "Apple", - :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, - { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], - :args_string => "int* steak, uint8_t flag", - :return=> test_return[:void]} - expected = [" if (!Mock.Apple_CallbackBool &&\n", - " Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " Mock.Apple_CallbackFunctionPointer(steak, flag);\n", - " UNITY_CLR_DETAILS();\n", - " return;\n", - " }\n" - ].join - @cmock_generator_plugin_callback.include_count = false - returned = @cmock_generator_plugin_callback.mock_implementation_precheck(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions without arg check and of style 'int16_t func(int* steak, uint8_t flag)'" do - function = {:name => "Apple", - :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, - { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], - :args_string => "int* steak, uint8_t flag", - :return => test_return[:int]} - expected = [" if (!Mock.Apple_CallbackBool &&\n", - " Mock.Apple_CallbackFunctionPointer != NULL)\n", - " {\n", - " int cmock_cb_ret = Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n", - " UNITY_CLR_DETAILS();\n", - " return cmock_cb_ret;\n", - " }\n" - ].join - returned = @cmock_generator_plugin_callback.mock_implementation_precheck(function) - assert_equal(expected, returned) - end - - it "add mock interfaces for functions " do - function = {:name => "Lemon", - :args => [{ :type => "char*", :name => "pescado"}], - :args_string => "char* pescado", - :return => test_return[:int] - } - - expected = ["void Lemon_AddCallback(CMOCK_Lemon_CALLBACK Callback)\n", - "{\n", - " Mock.Lemon_IgnoreBool = (char)0;\n", - " Mock.Lemon_CallbackBool = (char)1;\n", - " Mock.Lemon_CallbackFunctionPointer = Callback;\n", - "}\n\n", - "void Lemon_Stub(CMOCK_Lemon_CALLBACK Callback)\n", - "{\n", - " Mock.Lemon_IgnoreBool = (char)0;\n", - " Mock.Lemon_CallbackBool = (char)0;\n", - " Mock.Lemon_CallbackFunctionPointer = Callback;\n", - "}\n\n" - ].join - returned = @cmock_generator_plugin_callback.mock_interfaces(function) - assert_equal(expected, returned) - end -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_cexception_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_cexception_test.rb deleted file mode 100644 index 19699ea35..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_cexception_test.rb +++ /dev/null @@ -1,96 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_cexception' - -describe CMockGeneratorPluginCexception, "Verify CMockGeneratorPluginCexception Module" do - - before do - create_mocks :config, :utils - @cmock_generator_plugin_cexception = CMockGeneratorPluginCexception.new(@config, @utils) - end - - after do - end - - it "have set up internal priority" do - assert_equal(7, @cmock_generator_plugin_cexception.priority) - end - - it "include the cexception library" do - expected = "#include \"CException.h\"\n" - returned = @cmock_generator_plugin_cexception.include_files - assert_equal(expected, returned) - end - - it "add to typedef structure mock needs" do - function = { :name => "Oak", :args => [], :return => test_return[:void] } - expected = " CEXCEPTION_T ExceptionToThrow;\n" - returned = @cmock_generator_plugin_cexception.instance_typedefs(function) - assert_equal(expected, returned) - end - - it "add mock function declarations for functions without arguments" do - function = { :name => "Spruce", :args_string => "void", :return => test_return[:void] } - expected = "#define Spruce_ExpectAndThrow(cmock_to_throw) Spruce_CMockExpectAndThrow(__LINE__, cmock_to_throw)\n"+ - "void Spruce_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, CEXCEPTION_T cmock_to_throw);\n" - returned = @cmock_generator_plugin_cexception.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function declarations for functions with arguments" do - function = { :name => "Spruce", :args_string => "const char* Petunia, uint32_t Lily", :args_call => "Petunia, Lily", :return => test_return[:void] } - expected = "#define Spruce_ExpectAndThrow(Petunia, Lily, cmock_to_throw) Spruce_CMockExpectAndThrow(__LINE__, Petunia, Lily, cmock_to_throw)\n" + - "void Spruce_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, const char* Petunia, uint32_t Lily, CEXCEPTION_T cmock_to_throw);\n" - returned = @cmock_generator_plugin_cexception.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add a mock implementation" do - function = {:name => "Cherry", :args => [], :return => test_return[:void]} - expected = " if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)\n" + - " {\n" + - " UNITY_CLR_DETAILS();\n" + - " Throw(cmock_call_instance->ExceptionToThrow);\n" + - " }\n" - returned = @cmock_generator_plugin_cexception.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock interfaces for functions without arguments" do - function = {:name => "Pear", :args_string => "void", :args => [], :return => test_return[:void]} - @utils.expect :code_add_base_expectation, "mock_retval_0", ["Pear"] - @utils.expect :code_call_argument_loader, "", [function] - - expected = ["void Pear_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, CEXCEPTION_T cmock_to_throw)\n", - "{\n", - "mock_retval_0", - "", - " cmock_call_instance->ExceptionToThrow = cmock_to_throw;\n", - "}\n\n" - ].join - returned = @cmock_generator_plugin_cexception.mock_interfaces(function) - assert_equal(expected, returned) - end - - it "add a mock interfaces for functions with arguments" do - function = {:name => "Pear", :args_string => "int blah", :args => [{ :type => "int", :name => "blah" }], :return => test_return[:void]} - @utils.expect :code_add_base_expectation, "mock_retval_0", ["Pear"] - @utils.expect :code_call_argument_loader, "mock_return_1", [function] - - expected = ["void Pear_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, int blah, CEXCEPTION_T cmock_to_throw)\n", - "{\n", - "mock_retval_0", - "mock_return_1", - " cmock_call_instance->ExceptionToThrow = cmock_to_throw;\n", - "}\n\n" - ].join - returned = @cmock_generator_plugin_cexception.mock_interfaces(function) - assert_equal(expected, returned) - end - -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb deleted file mode 100644 index dd86689a0..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +++ /dev/null @@ -1,185 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect' - -describe CMockGeneratorPluginExpect, "Verify CMockGeneratorPluginExpect Module Without Global Ordering" do - - before do - create_mocks :config, :utils - - @config = create_stub( - :when_ptr => :compare_data, - :enforce_strict_ordering => false, - :respond_to? => true, - :plugins => [ :expect ] ) - - @utils.expect :helpers, {} - @cmock_generator_plugin_expect = CMockGeneratorPluginExpect.new(@config, @utils) - end - - after do - end - - it "have set up internal priority on init" do - assert_nil(@cmock_generator_plugin_expect.unity_helper) - assert_equal(5, @cmock_generator_plugin_expect.priority) - end - - it "not include any additional include files" do - assert(!@cmock_generator_plugin_expect.respond_to?(:include_files)) - end - - it "add to typedef structure mock needs of functions of style 'void func(void)'" do - function = {:name => "Oak", :args => [], :return => test_return[:void]} - expected = "" - returned = @cmock_generator_plugin_expect.instance_typedefs(function) - assert_equal(expected, returned) - end - - it "add to typedef structure mock needs of functions of style 'int func(void)'" do - function = {:name => "Elm", :args => [], :return => test_return[:int]} - expected = " int ReturnVal;\n" - returned = @cmock_generator_plugin_expect.instance_typedefs(function) - assert_equal(expected, returned) - end - - it "add to typedef structure mock needs of functions of style 'void func(int chicken, char* pork)'" do - function = {:name => "Cedar", :args => [{ :name => "chicken", :type => "int"}, { :name => "pork", :type => "char*"}], :return => test_return[:void]} - expected = " int Expected_chicken;\n char* Expected_pork;\n" - returned = @cmock_generator_plugin_expect.instance_typedefs(function) - assert_equal(expected, returned) - end - - it "add to typedef structure mock needs of functions of style 'int func(float beef)'" do - function = {:name => "Birch", :args => [{ :name => "beef", :type => "float"}], :return => test_return[:int]} - expected = " int ReturnVal;\n float Expected_beef;\n" - returned = @cmock_generator_plugin_expect.instance_typedefs(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for functions of style 'void func(void)'" do - function = {:name => "Maple", :args => [], :return => test_return[:void]} - expected = "#define Maple_Expect() Maple_CMockExpect(__LINE__)\n" + - "void Maple_CMockExpect(UNITY_LINE_TYPE cmock_line);\n" - returned = @cmock_generator_plugin_expect.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for functions of style 'int func(void)'" do - function = {:name => "Spruce", :args => [], :return => test_return[:int]} - expected = "#define Spruce_ExpectAndReturn(cmock_retval) Spruce_CMockExpectAndReturn(__LINE__, cmock_retval)\n" + - "void Spruce_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return);\n" - returned = @cmock_generator_plugin_expect.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for functions of style 'const char* func(int tofu)'" do - function = {:name => "Pine", :args => ["int tofu"], :args_string => "int tofu", :args_call => 'tofu', :return => test_return[:string]} - expected = "#define Pine_ExpectAndReturn(tofu, cmock_retval) Pine_CMockExpectAndReturn(__LINE__, tofu, cmock_retval)\n" + - "void Pine_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int tofu, const char* cmock_to_return);\n" - returned = @cmock_generator_plugin_expect.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions of style 'void func(void)'" do - function = {:name => "Apple", :args => [], :return => test_return[:void]} - expected = "" - returned = @cmock_generator_plugin_expect.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions of style 'int func(int veal, unsigned int sushi)'" do - function = {:name => "Cherry", :args => [ { :type => "int", :name => "veal" }, { :type => "unsigned int", :name => "sushi" } ], :return => test_return[:int]} - - @utils.expect :code_verify_an_arg_expectation, " mocked_retval_1", [function, function[:args][0]] - @utils.expect :code_verify_an_arg_expectation, " mocked_retval_2", [function, function[:args][1]] - expected = " mocked_retval_1 mocked_retval_2" - returned = @cmock_generator_plugin_expect.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation using ordering if needed" do - function = {:name => "Apple", :args => [], :return => test_return[:void]} - expected = "" - @cmock_generator_plugin_expect.ordered = true - returned = @cmock_generator_plugin_expect.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock interfaces for functions of style 'void func(void)'" do - function = {:name => "Pear", :args => [], :args_string => "void", :return => test_return[:void]} - @utils.expect :code_add_base_expectation, "mock_retval_0 ", ["Pear"] - @utils.expect :code_call_argument_loader, "mock_retval_1 ", [function] - expected = ["void Pear_CMockExpect(UNITY_LINE_TYPE cmock_line)\n", - "{\n", - "mock_retval_0 ", - "mock_retval_1 ", - "}\n\n" - ].join - returned = @cmock_generator_plugin_expect.mock_interfaces(function) - assert_equal(expected, returned) - end - - it "add mock interfaces for functions of style 'int func(void)'" do - function = {:name => "Orange", :args => [], :args_string => "void", :return => test_return[:int]} - @utils.expect :code_add_base_expectation, "mock_retval_0 ", ["Orange"] - @utils.expect :code_call_argument_loader, "mock_retval_1 ", [function] - @utils.expect :code_assign_argument_quickly, "mock_retval_2", ["cmock_call_instance->ReturnVal", function[:return]] - expected = ["void Orange_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return)\n", - "{\n", - "mock_retval_0 ", - "mock_retval_1 ", - "mock_retval_2", - "}\n\n" - ].join - returned = @cmock_generator_plugin_expect.mock_interfaces(function) - assert_equal(expected, returned) - end - - it "add mock interfaces for functions of style 'int func(char* pescado)'" do - function = {:name => "Lemon", :args => [{ :type => "char*", :name => "pescado"}], :args_string => "char* pescado", :return => test_return[:int]} - @utils.expect :code_add_base_expectation, "mock_retval_0 ", ["Lemon"] - @utils.expect :code_call_argument_loader, "mock_retval_1 ", [function] - @utils.expect :code_assign_argument_quickly, "mock_retval_2", ["cmock_call_instance->ReturnVal", function[:return]] - expected = ["void Lemon_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, char* pescado, int cmock_to_return)\n", - "{\n", - "mock_retval_0 ", - "mock_retval_1 ", - "mock_retval_2", - "}\n\n" - ].join - returned = @cmock_generator_plugin_expect.mock_interfaces(function) - assert_equal(expected, returned) - end - - it "add mock interfaces for functions when using ordering" do - function = {:name => "Pear", :args => [], :args_string => "void", :return => test_return[:void]} - @utils.expect :code_add_base_expectation, "mock_retval_0 ", ["Pear"] - @utils.expect :code_call_argument_loader, "mock_retval_1 ", [function] - expected = ["void Pear_CMockExpect(UNITY_LINE_TYPE cmock_line)\n", - "{\n", - "mock_retval_0 ", - "mock_retval_1 ", - "}\n\n" - ].join - @cmock_generator_plugin_expect.ordered = true - returned = @cmock_generator_plugin_expect.mock_interfaces(function) - assert_equal(expected, returned) - end - - it "add mock verify lines" do - function = {:name => "Banana" } - expected = " if (CMOCK_GUTS_NONE != call_instance)\n" \ - " {\n" \ - " UNITY_SET_DETAIL(CMockString_Banana);\n" \ - " UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess);\n" \ - " }\n" - returned = @cmock_generator_plugin_expect.mock_verify(function) - assert_equal(expected, returned) - end -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb deleted file mode 100644 index 5a014d6e3..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect_any_args.rb' - -describe CMockGeneratorPluginExpectAnyArgs, "Verify CMockGeneratorPluginExpectAnyArgs Module" do - - before do - create_mocks :config, :utils - @config = create_stub(:respond_to? => true) - @cmock_generator_plugin_expect_any_args = CMockGeneratorPluginExpectAnyArgs.new(@config, @utils) - end - - after do - end - - it "have set up internal priority" do - assert_equal(3, @cmock_generator_plugin_expect_any_args.priority) - end - - it "not have any additional include file requirements" do - assert(!@cmock_generator_plugin_expect_any_args.respond_to?(:include_files)) - end - - it "ignore functions without arguments" do - function = {:name => "Mold", :args_string => "void", :args => [], :return => test_return[:void]} - expected = "" - returned = @cmock_generator_plugin_expect_any_args.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "handle function declarations for functions without return values" do - function = {:name => "Mold", :args_string => "int meh", :args => [ :stuff ], :return => test_return[:void]} - expected = "#define Mold_ExpectAnyArgs() Mold_CMockExpectAnyArgs(__LINE__)\nvoid Mold_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line);\n" - returned = @cmock_generator_plugin_expect_any_args.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "handle function declarations for functions that returns something" do - function = {:name => "Fungus", :args_string => "int meh", :args => [ :stuff ], :return => test_return[:string]} - expected = "#define Fungus_ExpectAnyArgsAndReturn(cmock_retval) Fungus_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval)\n"+ - "void Fungus_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, const char* cmock_to_return);\n" - returned = @cmock_generator_plugin_expect_any_args.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "should not respond to implementation requests" do - assert(!@cmock_generator_plugin_expect_any_args.respond_to?(:mock_implementation)) - end - - it "add a new mock interface for ignoring when function had no return value" do - function = {:name => "Slime", :args_string => "int meh", :args => [ :stuff ], :return => test_return[:void]} - expected = ["void Slime_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line)\n", - "{\n", - "mock_return_1", - " cmock_call_instance->ExpectAnyArgsBool = (char)1;\n", - "}\n\n" - ].join - @utils.expect :code_add_base_expectation, "mock_return_1", ["Slime", true] - returned = @cmock_generator_plugin_expect_any_args.mock_interfaces(function) - assert_equal(expected, returned) - end -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb deleted file mode 100644 index 35d48715c..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +++ /dev/null @@ -1,201 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect' - -describe CMockGeneratorPluginExpect, "Verify CMockGeneratorPluginExpect Module with Global Ordering" do - - before do - create_mocks :config, :utils - - @config = create_stub( - :when_ptr => :compare_data, - :enforce_strict_ordering => true, - :respond_to? => true, - :plugins => [ :expect, :expect_any_args ] ) - - @utils.expect :helpers, {} - @cmock_generator_plugin_expect = CMockGeneratorPluginExpect.new(@config, @utils) - end - - after do - end - - it "have set up internal priority on init" do - assert_nil(@cmock_generator_plugin_expect.unity_helper) - assert_equal(5, @cmock_generator_plugin_expect.priority) - end - - it "not include any additional include files" do - assert(!@cmock_generator_plugin_expect.respond_to?(:include_files)) - end - - it "add to typedef structure mock needs of functions of style 'void func(void)' and global ordering" do - function = {:name => "Oak", :args => [], :return => test_return[:void]} - expected = " int CallOrder;\n" - returned = @cmock_generator_plugin_expect.instance_typedefs(function) - assert_equal(expected, returned) - end - - it "add to typedef structure mock needs of functions of style 'int func(void)'" do - function = {:name => "Elm", :args => [], :return => test_return[:int]} - expected = " int ReturnVal;\n int CallOrder;\n" - returned = @cmock_generator_plugin_expect.instance_typedefs(function) - assert_equal(expected, returned) - end - - it "add to typedef structure mock needs of functions of style 'void func(int chicken, char* pork)'" do - function = {:name => "Cedar", :args => [{ :name => "chicken", :type => "int"}, { :name => "pork", :type => "char*"}], :return => test_return[:void]} - expected = " int CallOrder;\n int Expected_chicken;\n char* Expected_pork;\n" - returned = @cmock_generator_plugin_expect.instance_typedefs(function) - assert_equal(expected, returned) - end - - it "add to typedef structure mock needs of functions of style 'int func(float beef)'" do - function = {:name => "Birch", :args => [{ :name => "beef", :type => "float"}], :return => test_return[:int]} - expected = " int ReturnVal;\n int CallOrder;\n float Expected_beef;\n" - returned = @cmock_generator_plugin_expect.instance_typedefs(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for functions of style 'void func(void)'" do - function = {:name => "Maple", :args => [], :return => test_return[:void]} - expected = "#define Maple_Expect() Maple_CMockExpect(__LINE__)\n" + - "void Maple_CMockExpect(UNITY_LINE_TYPE cmock_line);\n" - returned = @cmock_generator_plugin_expect.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for functions of style 'int func(void)'" do - function = {:name => "Spruce", :args => [], :return => test_return[:int]} - expected = "#define Spruce_ExpectAndReturn(cmock_retval) Spruce_CMockExpectAndReturn(__LINE__, cmock_retval)\n" + - "void Spruce_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return);\n" - returned = @cmock_generator_plugin_expect.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function declaration for functions of style 'const char* func(int tofu)'" do - function = {:name => "Pine", :args => ["int tofu"], :args_string => "int tofu", :args_call => 'tofu', :return => test_return[:string]} - expected = "#define Pine_ExpectAndReturn(tofu, cmock_retval) Pine_CMockExpectAndReturn(__LINE__, tofu, cmock_retval)\n" + - "void Pine_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int tofu, const char* cmock_to_return);\n" - returned = @cmock_generator_plugin_expect.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions of style 'void func(void)'" do - function = {:name => "Apple", :args => [], :return => test_return[:void]} - expected = "" - returned = @cmock_generator_plugin_expect.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions of style 'int func(int veal, unsigned int sushi)'" do - function = {:name => "Cherry", :args => [ { :type => "int", :name => "veal" }, { :type => "unsigned int", :name => "sushi" } ], :return => test_return[:int]} - - @utils.expect :code_verify_an_arg_expectation, "mocked_retval_1\n", [function, function[:args][0]] - @utils.expect :code_verify_an_arg_expectation, "mocked_retval_2\n", [function, function[:args][1]] - expected = " if (!cmock_call_instance->ExpectAnyArgsBool)\n" + - " {\n" + - "mocked_retval_1\n" + - "mocked_retval_2\n" + - " }\n" - returned = @cmock_generator_plugin_expect.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation using ordering if needed" do - function = {:name => "Apple", :args => [], :return => test_return[:void]} - expected = "" - @cmock_generator_plugin_expect.ordered = true - returned = @cmock_generator_plugin_expect.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock function implementation for functions of style 'void func(int worm)' and strict ordering" do - function = {:name => "Apple", :args => [{ :type => "int", :name => "worm" }], :return => test_return[:void]} - @utils.expect :code_verify_an_arg_expectation, "mocked_retval_0\n", [function, function[:args][0]] - expected = " if (!cmock_call_instance->ExpectAnyArgsBool)\n" + - " {\n" + - "mocked_retval_0\n" + - " }\n" - @cmock_generator_plugin_expect.ordered = true - returned = @cmock_generator_plugin_expect.mock_implementation(function) - assert_equal(expected, returned) - end - - it "add mock interfaces for functions of style 'void func(void)'" do - function = {:name => "Pear", :args => [], :args_string => "void", :return => test_return[:void]} - @utils.expect :code_add_base_expectation, "mock_retval_0\n", ["Pear"] - @utils.expect :code_call_argument_loader, "mock_retval_1\n", [function] - expected = ["void Pear_CMockExpect(UNITY_LINE_TYPE cmock_line)\n", - "{\n", - "mock_retval_0\n", - "mock_retval_1\n", - "}\n\n" - ].join - returned = @cmock_generator_plugin_expect.mock_interfaces(function) - assert_equal(expected, returned) - end - - it "add mock interfaces for functions of style 'int func(void)'" do - function = {:name => "Orange", :args => [], :args_string => "void", :return => test_return[:int]} - @utils.expect :code_add_base_expectation, "mock_retval_0\n", ["Orange"] - @utils.expect :code_call_argument_loader, "mock_retval_1\n", [function] - @utils.expect :code_assign_argument_quickly, "mock_retval_2\n", ["cmock_call_instance->ReturnVal", function[:return]] - expected = ["void Orange_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return)\n", - "{\n", - "mock_retval_0\n", - "mock_retval_1\n", - "mock_retval_2\n", - "}\n\n" - ].join - returned = @cmock_generator_plugin_expect.mock_interfaces(function) - assert_equal(expected, returned) - end - - it "add mock interfaces for functions of style 'int func(char* pescado)'" do - function = {:name => "Lemon", :args => [{ :type => "char*", :name => "pescado"}], :args_string => "char* pescado", :return => test_return[:int]} - @utils.expect :code_add_base_expectation, "mock_retval_0\n", ["Lemon"] - @utils.expect :code_call_argument_loader, "mock_retval_1\n", [function] - @utils.expect :code_assign_argument_quickly, "mock_retval_2\n", ["cmock_call_instance->ReturnVal", function[:return]] - expected = ["void Lemon_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, char* pescado, int cmock_to_return)\n", - "{\n", - "mock_retval_0\n", - "mock_retval_1\n", - "mock_retval_2\n", - "}\n\n" - ].join - returned = @cmock_generator_plugin_expect.mock_interfaces(function) - assert_equal(expected, returned) - end - - it "add mock interfaces for functions when using ordering" do - function = {:name => "Pear", :args => [], :args_string => "void", :return => test_return[:void]} - @utils.expect :code_add_base_expectation, "mock_retval_0\n", ["Pear"] - @utils.expect :code_call_argument_loader, "mock_retval_1\n", [function] - expected = ["void Pear_CMockExpect(UNITY_LINE_TYPE cmock_line)\n", - "{\n", - "mock_retval_0\n", - "mock_retval_1\n", - "}\n\n" - ].join - @cmock_generator_plugin_expect.ordered = true - returned = @cmock_generator_plugin_expect.mock_interfaces(function) - assert_equal(expected, returned) - end - - it "add mock verify lines" do - function = {:name => "Banana" } - expected = " if (CMOCK_GUTS_NONE != call_instance)\n" \ - " {\n" \ - " UNITY_SET_DETAIL(CMockString_Banana);\n" \ - " UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess);\n" \ - " }\n" - returned = @cmock_generator_plugin_expect.mock_verify(function) - assert_equal(expected, returned) - end -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb deleted file mode 100644 index 5fa18e8c1..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +++ /dev/null @@ -1,116 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_ignore_arg' - -describe CMockGeneratorPluginIgnoreArg, "Verify CMockGeneratorPluginIgnoreArg Module" do - - before do - create_mocks :config, :utils - - # int *Oak(void)" - @void_func = {:name => "Oak", :args => [], :return => test_return[:int_ptr]} - - # void Pine(int chicken, const int beef, int *tofu) - @complex_func = {:name => "Pine", - :args => [{ :type => "int", - :name => "chicken", - :ptr? => false, - }, - { :type => "const int*", - :name => "beef", - :ptr? => true, - :const? => true, - }, - { :type => "int*", - :name => "tofu", - :ptr? => true, - }], - :return => test_return[:void], - :contains_ptr? => true } - - #no strict ordering - @cmock_generator_plugin_ignore_arg = CMockGeneratorPluginIgnoreArg.new(@config, @utils) - end - - after do - end - - it "have set up internal priority correctly on init" do - assert_equal(10, @cmock_generator_plugin_ignore_arg.priority) - end - - it "not include any additional include files" do - assert(!@cmock_generator_plugin_ignore_arg.respond_to?(:include_files)) - end - - it "not add to typedef structure for functions with no args" do - returned = @cmock_generator_plugin_ignore_arg.instance_typedefs(@void_func) - assert_equal("", returned) - end - - it "add to tyepdef structure mock needs of functions of style 'void func(int chicken, int* pork)'" do - expected = " char IgnoreArg_chicken;\n" + - " char IgnoreArg_beef;\n" + - " char IgnoreArg_tofu;\n" - returned = @cmock_generator_plugin_ignore_arg.instance_typedefs(@complex_func) - assert_equal(expected, returned) - end - - it "add mock function declarations for all arguments" do - expected = - "#define Pine_IgnoreArg_chicken()" + - " Pine_CMockIgnoreArg_chicken(__LINE__)\n" + - "void Pine_CMockIgnoreArg_chicken(UNITY_LINE_TYPE cmock_line);\n" + - - "#define Pine_IgnoreArg_beef()" + - " Pine_CMockIgnoreArg_beef(__LINE__)\n" + - "void Pine_CMockIgnoreArg_beef(UNITY_LINE_TYPE cmock_line);\n" + - - "#define Pine_IgnoreArg_tofu()" + - " Pine_CMockIgnoreArg_tofu(__LINE__)\n" + - "void Pine_CMockIgnoreArg_tofu(UNITY_LINE_TYPE cmock_line);\n" - - returned = @cmock_generator_plugin_ignore_arg.mock_function_declarations(@complex_func) - assert_equal(expected, returned) - end - - it "add mock interfaces for all arguments" do - expected = - "void Pine_CMockIgnoreArg_chicken(UNITY_LINE_TYPE cmock_line)\n" + - "{\n" + - " CMOCK_Pine_CALL_INSTANCE* cmock_call_instance = " + - "(CMOCK_Pine_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.Pine_CallInstance));\n" + - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp);\n" + - " cmock_call_instance->IgnoreArg_chicken = 1;\n" + - "}\n\n" + - - "void Pine_CMockIgnoreArg_beef(UNITY_LINE_TYPE cmock_line)\n" + - "{\n" + - " CMOCK_Pine_CALL_INSTANCE* cmock_call_instance = " + - "(CMOCK_Pine_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.Pine_CallInstance));\n" + - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp);\n" + - " cmock_call_instance->IgnoreArg_beef = 1;\n" + - "}\n\n" + - - "void Pine_CMockIgnoreArg_tofu(UNITY_LINE_TYPE cmock_line)\n" + - "{\n" + - " CMOCK_Pine_CALL_INSTANCE* cmock_call_instance = " + - "(CMOCK_Pine_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.Pine_CallInstance));\n" + - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp);\n" + - " cmock_call_instance->IgnoreArg_tofu = 1;\n" + - "}\n\n" - - returned = @cmock_generator_plugin_ignore_arg.mock_interfaces(@complex_func).join("") - assert_equal(expected, returned) - end - - it "not add a mock implementation" do - assert(!@cmock_generator_plugin_ignore_arg.respond_to?(:mock_implementation)) - end - -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_test.rb deleted file mode 100644 index c0c28b84d..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +++ /dev/null @@ -1,119 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_ignore' - -describe CMockGeneratorPluginIgnore, "Verify CMockGeneratorPluginIgnore Module" do - - before do - create_mocks :config, :utils - @config = create_stub(:respond_to? => true) - @cmock_generator_plugin_ignore = CMockGeneratorPluginIgnore.new(@config, @utils) - end - - after do - end - - it "have set up internal priority" do - assert_equal(2, @cmock_generator_plugin_ignore.priority) - end - - it "not have any additional include file requirements" do - assert(!@cmock_generator_plugin_ignore.respond_to?(:include_files)) - end - - it "add a required variable to the instance structure" do - function = {:name => "Grass", :args => [], :return => test_return[:void]} - expected = " char Grass_IgnoreBool;\n" - returned = @cmock_generator_plugin_ignore.instance_structure(function) - assert_equal(expected, returned) - end - - it "handle function declarations for functions without return values" do - function = {:name => "Mold", :args_string => "void", :return => test_return[:void]} - expected = "#define Mold_Ignore() Mold_CMockIgnore()\nvoid Mold_CMockIgnore(void);\n" + - "#define Mold_StopIgnore() Mold_CMockStopIgnore()\nvoid Mold_CMockStopIgnore(void);\n" - returned = @cmock_generator_plugin_ignore.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "handle function declarations for functions that returns something" do - function = {:name => "Fungus", :args_string => "void", :return => test_return[:string]} - expected = "#define Fungus_IgnoreAndReturn(cmock_retval) Fungus_CMockIgnoreAndReturn(__LINE__, cmock_retval)\n"+ - "void Fungus_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, const char* cmock_to_return);\n" + - "#define Fungus_StopIgnore() Fungus_CMockStopIgnore()\n"+ - "void Fungus_CMockStopIgnore(void);\n" - returned = @cmock_generator_plugin_ignore.mock_function_declarations(function) - assert_equal(expected, returned) - end - - it "add required code to implementation precheck with void function" do - function = {:name => "Mold", :args_string => "void", :return => test_return[:void]} - expected = [" if (Mock.Mold_IgnoreBool)\n", - " {\n", - " UNITY_CLR_DETAILS();\n", - " return;\n", - " }\n" - ].join - returned = @cmock_generator_plugin_ignore.mock_implementation_precheck(function) - assert_equal(expected, returned) - end - - it "add required code to implementation precheck with return functions" do - function = {:name => "Fungus", :args_string => "void", :return => test_return[:int]} - retval = test_return[:int].merge({ :name => "cmock_call_instance->ReturnVal"}) - @utils.expect :code_assign_argument_quickly, ' mock_retval_0', ["Mock.Fungus_FinalReturn", retval] - expected = [" if (Mock.Fungus_IgnoreBool)\n", - " {\n", - " UNITY_CLR_DETAILS();\n", - " if (cmock_call_instance == NULL)\n", - " return Mock.Fungus_FinalReturn;\n", - " mock_retval_0", - " return cmock_call_instance->ReturnVal;\n", - " }\n" - ].join - returned = @cmock_generator_plugin_ignore.mock_implementation_precheck(function) - assert_equal(expected, returned) - end - - it "add a new mock interface for ignoring when function had no return value" do - function = {:name => "Slime", :args => [], :args_string => "void", :return => test_return[:void]} - expected = ["void Slime_CMockIgnore(void)\n", - "{\n", - " Mock.Slime_IgnoreBool = (char)1;\n", - "}\n\n", - - "void Slime_CMockStopIgnore(void)\n", - "{\n", - " Mock.Slime_IgnoreBool = (char)0;\n", - "}\n\n" - ].join - returned = @cmock_generator_plugin_ignore.mock_interfaces(function) - assert_equal(expected, returned) - end - - it "add a new mock interface for ignoring when function has return value" do - function = {:name => "Slime", :args => [], :args_string => "void", :return => test_return[:int]} - @utils.expect :code_add_base_expectation, "mock_return_1", ["Slime", false] - expected = ["void Slime_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return)\n", - "{\n", - "mock_return_1", - " cmock_call_instance->ReturnVal = cmock_to_return;\n", - " Mock.Slime_IgnoreBool = (char)1;\n", - "}\n\n", - - "void Slime_CMockStopIgnore(void)\n{\n", - " if(Mock.Slime_IgnoreBool)\n", - " Mock.Slime_CallInstance = CMock_Guts_MemNext(Mock.Slime_CallInstance);\n", - " Mock.Slime_IgnoreBool = (char)0;\n", - "}\n\n" - ].join - returned = @cmock_generator_plugin_ignore.mock_interfaces(function) - assert_equal(expected, returned) - end - -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb deleted file mode 100644 index 3c8b075da..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +++ /dev/null @@ -1,136 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_return_thru_ptr' - -describe CMockGeneratorPluginReturnThruPtr, "Verify CMockGeneratorPluginReturnThruPtr Module" do - - before do - create_mocks :config, :utils - - # int *Oak(void)" - @void_func = {:name => "Oak", :args => [], :return => test_return[:int_ptr]} - - # char *Maple(int blah) - @simple_func = {:name => "Maple", - :args => [{:name => "blah", :type => "int", :ptr? => false}], - :return => test_return[:string], - :contains_ptr? => false} - - # void Pine(int chicken, const int beef, int *tofu) - @complex_func = {:name => "Pine", - :args => [{ :type => "int", - :name => "chicken", - :ptr? => false, - }, - { :type => "const int*", - :name => "beef", - :ptr? => true, - :const? => true, - }, - { :type => "int*", - :name => "tofu", - :ptr? => true, - }], - :return => test_return[:void], - :contains_ptr? => true } - - #no strict ordering - @cmock_generator_plugin_return_thru_ptr = CMockGeneratorPluginReturnThruPtr.new(@config, @utils) - end - - after do - end - - def simple_func_expect - @utils.expect :ptr_or_str?, false, ['int'] - end - - def complex_func_expect - @utils.expect :ptr_or_str?, false, ['int'] - @utils.expect :ptr_or_str?, true, ['const int*'] - @utils.expect :ptr_or_str?, true, ['int*'] - end - - it "have set up internal priority correctly on init" do - assert_equal(9, @cmock_generator_plugin_return_thru_ptr.priority) - end - - it "not include any additional include files" do - assert(!@cmock_generator_plugin_return_thru_ptr.respond_to?(:include_files)) - end - - it "not add to typedef structure for functions of style 'int* func(void)'" do - returned = @cmock_generator_plugin_return_thru_ptr.instance_typedefs(@void_func) - assert_equal("", returned) - end - - it "add to tyepdef structure mock needs of functions of style 'void func(int chicken, int* pork)'" do - complex_func_expect() - expected = " char ReturnThruPtr_tofu_Used;\n" + - " int* ReturnThruPtr_tofu_Val;\n" + - " int ReturnThruPtr_tofu_Size;\n" - returned = @cmock_generator_plugin_return_thru_ptr.instance_typedefs(@complex_func) - assert_equal(expected, returned) - end - - it "not add an additional mock interface for functions not containing pointers" do - simple_func_expect() - returned = @cmock_generator_plugin_return_thru_ptr.mock_function_declarations(@simple_func) - assert_equal("", returned) - end - - it "add a mock function declaration only for non-const pointer arguments" do - complex_func_expect(); - - expected = - "#define Pine_ReturnThruPtr_tofu(tofu)" + - " Pine_CMockReturnMemThruPtr_tofu(__LINE__, tofu, sizeof(int))\n" + - "#define Pine_ReturnArrayThruPtr_tofu(tofu, cmock_len)" + - " Pine_CMockReturnMemThruPtr_tofu(__LINE__, tofu, (int)(cmock_len * (int)sizeof(*tofu)))\n" + - "#define Pine_ReturnMemThruPtr_tofu(tofu, cmock_size)" + - " Pine_CMockReturnMemThruPtr_tofu(__LINE__, tofu, cmock_size)\n" + - "void Pine_CMockReturnMemThruPtr_tofu(UNITY_LINE_TYPE cmock_line, int* tofu, int cmock_size);\n" - - returned = @cmock_generator_plugin_return_thru_ptr.mock_function_declarations(@complex_func) - assert_equal(expected, returned) - end - - it "add mock interfaces only for non-const pointer arguments" do - complex_func_expect(); - - expected = - "void Pine_CMockReturnMemThruPtr_tofu(UNITY_LINE_TYPE cmock_line, int* tofu, int cmock_size)\n" + - "{\n" + - " CMOCK_Pine_CALL_INSTANCE* cmock_call_instance = " + - "(CMOCK_Pine_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.Pine_CallInstance));\n" + - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp);\n" + - " cmock_call_instance->ReturnThruPtr_tofu_Used = 1;\n" + - " cmock_call_instance->ReturnThruPtr_tofu_Val = tofu;\n" + - " cmock_call_instance->ReturnThruPtr_tofu_Size = cmock_size;\n" + - "}\n\n" - - returned = @cmock_generator_plugin_return_thru_ptr.mock_interfaces(@complex_func).join("") - assert_equal(expected, returned) - end - - it "add mock implementations only for non-const pointer arguments" do - complex_func_expect() - - expected = - " if (cmock_call_instance->ReturnThruPtr_tofu_Used)\n" + - " {\n" + - " UNITY_TEST_ASSERT_NOT_NULL(tofu, cmock_line, CMockStringPtrIsNULL);\n" + - " memcpy((void*)tofu, (void*)cmock_call_instance->ReturnThruPtr_tofu_Val,\n" + - " cmock_call_instance->ReturnThruPtr_tofu_Size);\n" + - " }\n" - - returned = @cmock_generator_plugin_return_thru_ptr.mock_implementation(@complex_func).join("") - assert_equal(expected, returned) - end - -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_utils_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_utils_test.rb deleted file mode 100644 index ab9df2a2c..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_generator_utils_test.rb +++ /dev/null @@ -1,398 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_utils' - -describe CMockGeneratorUtils, "Verify CMockGeneratorUtils Module" do - - before do - create_mocks :config, :unity_helper, :unity_helper - - @config.expect :when_ptr, :compare_ptr - @config.expect :enforce_strict_ordering, false - @config.expect :plugins, [] - @config.expect :plugins, [] - @config.expect :plugins, [] - @config.expect :plugins, [] - @config.expect :plugins, [] - @config.expect :plugins, [] - @config.expect :treat_as, {'int' => 'INT','short' => 'INT16','long' => 'INT','char' => 'INT8','const char*' => 'STRING'} - @cmock_generator_utils_simple = CMockGeneratorUtils.new(@config, {:unity_helper => @unity_helper}) - - @config.expect :when_ptr, :smart - @config.expect :enforce_strict_ordering, true - @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] - @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] - @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] - @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] - @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] - @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] - @config.expect :treat_as, {'int' => 'INT','short' => 'INT16','long' => 'INT','char' => 'INT8','uint32_t' => 'HEX32','const char*' => 'STRING'} - @cmock_generator_utils_complex = CMockGeneratorUtils.new(@config, {:unity_helper => @unity_helper, :A=>1, :B=>2}) - end - - after do - end - - it "have set up internal accessors correctly on init" do - assert_equal(false, @cmock_generator_utils_simple.arrays) - assert_equal(false, @cmock_generator_utils_simple.cexception) - end - - it "have set up internal accessors correctly on init, complete with passed helpers" do - assert_equal(true, @cmock_generator_utils_complex.arrays) - assert_equal(true, @cmock_generator_utils_complex.cexception) - end - - it "detect pointers and strings" do - assert_equal(false, @cmock_generator_utils_simple.ptr_or_str?('int')) - assert_equal(true, @cmock_generator_utils_simple.ptr_or_str?('int*')) - assert_equal(true, @cmock_generator_utils_simple.ptr_or_str?('char*')) - end - - it "add code for a base expectation with no plugins" do - expected = - " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Apple_CALL_INSTANCE));\n" + - " CMOCK_Apple_CALL_INSTANCE* cmock_call_instance = (CMOCK_Apple_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n" + - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);\n" + - " memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));\n" + - " Mock.Apple_CallInstance = CMock_Guts_MemChain(Mock.Apple_CallInstance, cmock_guts_index);\n" + - " cmock_call_instance->LineNumber = cmock_line;\n" - output = @cmock_generator_utils_simple.code_add_base_expectation("Apple") - assert_equal(expected, output) - end - - it "add code for a base expectation with all plugins" do - expected = - " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Apple_CALL_INSTANCE));\n" + - " CMOCK_Apple_CALL_INSTANCE* cmock_call_instance = (CMOCK_Apple_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n" + - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);\n" + - " memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));\n" + - " Mock.Apple_CallInstance = CMock_Guts_MemChain(Mock.Apple_CallInstance, cmock_guts_index);\n" + - " Mock.Apple_IgnoreBool = (char)0;\n" + - " cmock_call_instance->LineNumber = cmock_line;\n" + - " cmock_call_instance->CallOrder = ++GlobalExpectCount;\n" + - " cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;\n" - output = @cmock_generator_utils_complex.code_add_base_expectation("Apple", true) - assert_equal(expected, output) - end - - it "add code for a base expectation with all plugins and ordering not supported" do - expected = - " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Apple_CALL_INSTANCE));\n" + - " CMOCK_Apple_CALL_INSTANCE* cmock_call_instance = (CMOCK_Apple_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n" + - " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);\n" + - " memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));\n" + - " Mock.Apple_CallInstance = CMock_Guts_MemChain(Mock.Apple_CallInstance, cmock_guts_index);\n" + - " Mock.Apple_IgnoreBool = (char)0;\n" + - " cmock_call_instance->LineNumber = cmock_line;\n" + - " cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;\n" - output = @cmock_generator_utils_complex.code_add_base_expectation("Apple", false) - assert_equal(expected, output) - end - - it "add argument expectations for values when no array plugin" do - arg1 = { :name => "Orange", :const? => false, :type => 'int', :ptr? => false } - expected1 = " cmock_call_instance->Expected_Orange = Orange;\n" - - arg2 = { :name => "Lemon", :const? => true, :type => 'const char*', :ptr? => false } - expected2 = " cmock_call_instance->Expected_Lemon = Lemon;\n" - - arg3 = { :name => "Kiwi", :const? => false, :type => 'KIWI_T*', :ptr? => true } - expected3 = " cmock_call_instance->Expected_Kiwi = Kiwi;\n" - - arg4 = { :name => "Lime", :const? => false, :type => 'LIME_T', :ptr? => false } - expected4 = " memcpy((void*)(&cmock_call_instance->Expected_Lime), (void*)(&Lime),\n" + - " sizeof(LIME_T[sizeof(Lime) == sizeof(LIME_T) ? 1 : -1])); /* add LIME_T to :treat_as_array if this causes an error */\n" - - assert_equal(expected1, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg1)) - assert_equal(expected2, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg2)) - assert_equal(expected3, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg3)) - assert_equal(expected4, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg4)) - end - - it "add argument expectations for values when array plugin enabled" do - arg1 = { :name => "Orange", :const? => false, :type => 'int', :ptr? => false } - expected1 = " cmock_call_instance->Expected_Orange = Orange;\n" + - " cmock_call_instance->IgnoreArg_Orange = 0;\n" - - arg2 = { :name => "Lemon", :const? => true, :type => 'const char*', :ptr? => false } - expected2 = " cmock_call_instance->Expected_Lemon = Lemon;\n" + - " cmock_call_instance->Expected_Lemon_Depth = Lemon_Depth;\n" + - " cmock_call_instance->IgnoreArg_Lemon = 0;\n" - - arg3 = { :name => "Kiwi", :const? => false, :type => 'KIWI_T*', :ptr? => true } - expected3 = " cmock_call_instance->Expected_Kiwi = Kiwi;\n" + - " cmock_call_instance->Expected_Kiwi_Depth = Kiwi_Depth;\n" + - " cmock_call_instance->IgnoreArg_Kiwi = 0;\n" + - " cmock_call_instance->ReturnThruPtr_Kiwi_Used = 0;\n" - - arg4 = { :name => "Lime", :const? => false, :type => 'LIME_T', :ptr? => false } - expected4 = " memcpy((void*)(&cmock_call_instance->Expected_Lime), (void*)(&Lime),\n" + - " sizeof(LIME_T[sizeof(Lime) == sizeof(LIME_T) ? 1 : -1])); /* add LIME_T to :treat_as_array if this causes an error */\n" + - " cmock_call_instance->IgnoreArg_Lime = 0;\n" - - assert_equal(expected1, @cmock_generator_utils_complex.code_add_an_arg_expectation(arg1)) - assert_equal(expected2, @cmock_generator_utils_complex.code_add_an_arg_expectation(arg2, 'Lemon_Depth')) - assert_equal(expected3, @cmock_generator_utils_complex.code_add_an_arg_expectation(arg3, 'Lemon_Depth')) - assert_equal(expected4, @cmock_generator_utils_complex.code_add_an_arg_expectation(arg4)) - end - - it 'not have an argument loader when the function has no arguments' do - function = { :name => "Melon", :args_string => "void" } - - assert_equal("", @cmock_generator_utils_complex.code_add_argument_loader(function)) - end - - it 'create an argument loader when the function has arguments' do - function = { :name => "Melon", - :args_string => "stuff", - :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]] - } - expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, stuff)\n{\n" + - " cmock_call_instance->Expected_MyIntPtr = MyIntPtr;\n" + - " memcpy((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType),\n" + - " sizeof(MY_TYPE[sizeof(MyMyType) == sizeof(MY_TYPE) ? 1 : -1])); /* add MY_TYPE to :treat_as_array if this causes an error */\n" + - " cmock_call_instance->Expected_MyStr = MyStr;\n" + - "}\n\n" - assert_equal(expected, @cmock_generator_utils_simple.code_add_argument_loader(function)) - end - - it 'create an argument loader when the function has arguments supporting arrays' do - function = { :name => "Melon", - :args_string => "stuff", - :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]] - } - expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, int* MyIntPtr, int MyIntPtr_Depth, const MY_TYPE MyMyType, const char* MyStr)\n{\n" + - " cmock_call_instance->Expected_MyIntPtr = MyIntPtr;\n" + - " cmock_call_instance->Expected_MyIntPtr_Depth = MyIntPtr_Depth;\n" + - " cmock_call_instance->IgnoreArg_MyIntPtr = 0;\n" + - " cmock_call_instance->ReturnThruPtr_MyIntPtr_Used = 0;\n" + - " memcpy((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType),\n" + - " sizeof(MY_TYPE[sizeof(MyMyType) == sizeof(MY_TYPE) ? 1 : -1])); /* add MY_TYPE to :treat_as_array if this causes an error */\n" + - " cmock_call_instance->IgnoreArg_MyMyType = 0;\n" + - " cmock_call_instance->Expected_MyStr = MyStr;\n" + - " cmock_call_instance->IgnoreArg_MyStr = 0;\n" + - "}\n\n" - assert_equal(expected, @cmock_generator_utils_complex.code_add_argument_loader(function)) - end - - it 'create an argument loader when the function has pointer arguments supporting arrays' do - function = { :name => "Melon", - :args_string => "stuff", - :args => [test_arg[:const_ptr], test_arg[:double_ptr]] - } - expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, int* const MyConstPtr, int MyConstPtr_Depth, int const** MyDoublePtr, int MyDoublePtr_Depth)\n{\n" + - " cmock_call_instance->Expected_MyConstPtr = MyConstPtr;\n" + - " cmock_call_instance->Expected_MyConstPtr_Depth = MyConstPtr_Depth;\n" + - " cmock_call_instance->IgnoreArg_MyConstPtr = 0;\n" + - " cmock_call_instance->ReturnThruPtr_MyConstPtr_Used = 0;\n" + - " cmock_call_instance->Expected_MyDoublePtr = MyDoublePtr;\n" + - " cmock_call_instance->Expected_MyDoublePtr_Depth = MyDoublePtr_Depth;\n" + - " cmock_call_instance->IgnoreArg_MyDoublePtr = 0;\n" + - "}\n\n" - assert_equal(expected, @cmock_generator_utils_complex.code_add_argument_loader(function)) - end - - it "not call argument loader if there are no arguments to actually use for this function" do - function = { :name => "Pineapple", :args_string => "void" } - - assert_equal("", @cmock_generator_utils_complex.code_call_argument_loader(function)) - end - - it 'call an argument loader when the function has arguments' do - function = { :name => "Pineapple", - :args_string => "stuff", - :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]] - } - expected = " CMockExpectParameters_Pineapple(cmock_call_instance, MyIntPtr, MyMyType, MyStr);\n" - assert_equal(expected, @cmock_generator_utils_simple.code_call_argument_loader(function)) - end - - it 'call an argument loader when the function has arguments with arrays' do - function = { :name => "Pineapple", - :args_string => "stuff", - :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]] - } - expected = " CMockExpectParameters_Pineapple(cmock_call_instance, MyIntPtr, 1, MyMyType, MyStr);\n" - assert_equal(expected, @cmock_generator_utils_complex.code_call_argument_loader(function)) - end - - it 'handle a simple assert when requested' do - function = { :name => 'Pear' } - arg = test_arg[:int] - expected = " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyInt);\n" + - " UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_MyInt, MyInt, cmock_line, CMockStringMismatch);\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_INT', ''], ['int'] - assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle a pointer comparison when configured to do so' do - function = { :name => 'Pear' } - arg = test_arg[:int_ptr] - expected = " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyIntPtr);\n" + - " UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_MyIntPtr, MyIntPtr, cmock_line, CMockStringMismatch);\n" + - " }\n" - assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle const char as string compares ' do - function = { :name => 'Pear' } - arg = test_arg[:string] - expected = " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyStr);\n" + - " UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_MyStr, MyStr, cmock_line, CMockStringMismatch);\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_STRING',''], ['const char*'] - assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle custom types as memory compares when we have no better way to do it' do - function = { :name => 'Pear' } - arg = test_arg[:mytype] - expected = " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + - " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType), sizeof(MY_TYPE), cmock_line, CMockStringMismatch);\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MEMORY','&'], ['MY_TYPE'] - assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle custom types with custom handlers when available, even if they do not support the extra message' do - function = { :name => 'Pear' } - arg = test_arg[:mytype] - expected = " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + - " UNITY_TEST_ASSERT_EQUAL_MY_TYPE(cmock_call_instance->Expected_MyMyType, MyMyType, cmock_line, CMockStringMismatch);\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MY_TYPE',''], ['MY_TYPE'] - assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle pointers to custom types with array handlers, even if the array extension is turned off' do - function = { :name => 'Pear' } - arg = test_arg[:mytype] - expected = " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + - " UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY(&cmock_call_instance->Expected_MyMyType, &MyMyType, 1, cmock_line, CMockStringMismatch);\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY','&'], ['MY_TYPE'] - assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle a simple assert when requested with array plugin enabled' do - function = { :name => 'Pear' } - arg = test_arg[:int] - expected = " if (!cmock_call_instance->IgnoreArg_MyInt)\n" + - " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyInt);\n" + - " UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_MyInt, MyInt, cmock_line, CMockStringMismatch);\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_INT',''], ['int'] - assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle an array comparison with array plugin enabled' do - function = { :name => 'Pear' } - arg = test_arg[:int_ptr] - expected = " if (!cmock_call_instance->IgnoreArg_MyIntPtr)\n" + - " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyIntPtr);\n" + - " if (cmock_call_instance->Expected_MyIntPtr == NULL)\n" + - " { UNITY_TEST_ASSERT_NULL(MyIntPtr, cmock_line, CMockStringExpNULL); }\n" + - " else if (cmock_call_instance->Expected_MyIntPtr_Depth == 0)\n" + - " { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_MyIntPtr, MyIntPtr, cmock_line, CMockStringMismatch); }\n" + - " else\n" + - " { UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(cmock_call_instance->Expected_MyIntPtr, MyIntPtr, cmock_call_instance->Expected_MyIntPtr_Depth, cmock_line, CMockStringMismatch); }\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_INT_ARRAY',''], ['int*'] - assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle const char as string compares with array plugin enabled' do - function = { :name => 'Pear' } - arg = test_arg[:string] - expected = " if (!cmock_call_instance->IgnoreArg_MyStr)\n" + - " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyStr);\n" + - " UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_MyStr, MyStr, cmock_line, CMockStringMismatch);\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_STRING',''], ['const char*'] - assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle custom types as memory compares when we have no better way to do it with array plugin enabled' do - function = { :name => 'Pear' } - arg = test_arg[:mytype] - expected = " if (!cmock_call_instance->IgnoreArg_MyMyType)\n" + - " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + - " if (cmock_call_instance->Expected_MyMyType == NULL)\n" + - " { UNITY_TEST_ASSERT_NULL(MyMyType, cmock_line, CMockStringExpNULL); }\n" + - " else\n" + - " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_MyMyType), (void*)(MyMyType), sizeof(MY_TYPE), 1, cmock_line, CMockStringMismatch); }\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY', ''], ['MY_TYPE'] - assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle custom types with custom handlers when available, even if they do not support the extra message with array plugin enabled' do - function = { :name => 'Pear' } - arg = test_arg[:mytype] - expected = " if (!cmock_call_instance->IgnoreArg_MyMyType)\n" + - " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + - " UNITY_TEST_ASSERT_EQUAL_MY_TYPE(cmock_call_instance->Expected_MyMyType, MyMyType, cmock_line, CMockStringMismatch);\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MY_TYPE', ''], ['MY_TYPE'] - assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle custom types with array handlers when array plugin is enabled' do - function = { :name => 'Pear' } - arg = test_arg[:mytype_ptr] - expected = " if (!cmock_call_instance->IgnoreArg_MyMyTypePtr)\n" + - " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyTypePtr);\n" + - " if (cmock_call_instance->Expected_MyMyTypePtr == NULL)\n" + - " { UNITY_TEST_ASSERT_NULL(MyMyTypePtr, cmock_line, CMockStringExpNULL); }\n" + - " else if (cmock_call_instance->Expected_MyMyTypePtr_Depth == 0)\n" + - " { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_MyMyTypePtr, MyMyTypePtr, cmock_line, CMockStringMismatch); }\n" + - " else\n" + - " { UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY(cmock_call_instance->Expected_MyMyTypePtr, MyMyTypePtr, cmock_call_instance->Expected_MyMyTypePtr_Depth, cmock_line, CMockStringMismatch); }\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY', ''], ['MY_TYPE*'] - assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) - end - - it 'handle custom types with array handlers when array plugin is enabled for non-array types' do - function = { :name => 'Pear' } - arg = test_arg[:mytype] - expected = " if (!cmock_call_instance->IgnoreArg_MyMyType)\n" + - " {\n" + - " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + - " UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY(&cmock_call_instance->Expected_MyMyType, &MyMyType, 1, cmock_line, CMockStringMismatch);\n" + - " }\n" - @unity_helper.expect :nil?, false - @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY', '&'], ['MY_TYPE'] - assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) - end -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_header_parser_test.rb b/components/testframework/libs/cmock/test/unit/cmock_header_parser_test.rb deleted file mode 100644 index 5d5d2fcca..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_header_parser_test.rb +++ /dev/null @@ -1,2717 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -$ThisIsOnlyATest = true - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_header_parser' - -describe CMockHeaderParser, "Verify CMockHeaderParser Module" do - - before do - create_mocks :config - @test_name = 'test_file.h' - @config.expect :strippables, ["STRIPPABLE"] - @config.expect :attributes, ['__ramfunc', 'funky_attrib', 'SQLITE_API'] - @config.expect :c_calling_conventions, ['__stdcall'] - @config.expect :treat_as_void, ['MY_FUNKY_VOID'] - @config.expect :treat_as, { "BANJOS" => "INT", "TUBAS" => "HEX16"} - @config.expect :treat_as_array, {"IntArray" => "int", "Book" => "Page"} - @config.expect :when_no_prototypes, :error - @config.expect :verbosity, 1 - @config.expect :treat_externs, :exclude - @config.expect :treat_inlines, :exclude - @config.expect :inline_function_patterns, ['(static\s+inline|inline\s+static)\s*', '(\bstatic\b|\binline\b)\s*'] - @config.expect :array_size_type, ['int', 'size_t'] - @config.expect :array_size_name, 'size|len' - - @parser = CMockHeaderParser.new(@config) - end - - after do - end - - it "create and initialize variables to defaults appropriately" do - assert_equal([], @parser.funcs) - assert_equal(['const', '__ramfunc', 'funky_attrib', 'SQLITE_API'], @parser.c_attributes) - assert_equal(['void','MY_FUNKY_VOID'], @parser.treat_as_void) - end - - it "strip out line comments" do - source = - " abcd;\n" + - "// hello;\n" + - "who // is you\n" - - expected = - [ - "abcd", - "who" - ] - - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - it "remove block comments" do - source = - " no_comments;\n" + - "// basic_line_comment;\n" + - "/* basic_block_comment;*/\n" + - "pre_block; /* start_of_block_comment;\n" + - "// embedded_line_comment_in_block_comment; */\n" + - "// /* commented_out_block_comment_line\n" + - "shown_because_block_comment_invalid_from_line_comment;\n" + - "// */\n" + - "//* shorter_commented_out_block_comment_line; \n" + - "shown_because_block_comment_invalid_from_shorter_line_comment;\n" + - "/*/\n" + - "not_shown_because_line_above_started_comment;\n" + - "//*/\n" + - "/* \n" + - "not_shown_because_block_comment_started_this_time;\n" + - "/*/\n" + - "shown_because_line_above_ended_comment_this_time;\n" + - "//*/\n" - - expected = - [ - "no_comments", - "pre_block", - "shown_because_block_comment_invalid_from_line_comment", - "shown_because_block_comment_invalid_from_shorter_line_comment", - "shown_because_line_above_ended_comment_this_time" - ] - - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - it "remove strippables from the beginning or end of function declarations" do - source = - "void* my_calloc(size_t, size_t) STRIPPABLE;\n" + - "void\n" + - " my_realloc(void*, size_t) STRIPPABLE;\n" + - "extern int\n" + - " my_printf (void *my_object, const char *my_format, ...)\n" + - " STRIPPABLE;\n" + - " void STRIPPABLE universal_handler ();\n" - - expected = - [ - "void* my_calloc(size_t, size_t)", - "void my_realloc(void*, size_t)", - "void universal_handler()" - ] - - assert_equal(expected, @parser.import_source(source)) - end - - it "remove gcc's function __attribute__'s" do - source = - "void* my_calloc(size_t, size_t) __attribute__((alloc_size(1,2)));\n" + - "void\n" + - " my_realloc(void*, size_t) __attribute__((alloc_size(2)));\n" + - "extern int\n" + - " my_printf (void *my_object, const char *my_format, ...)\n" + - " __attribute__ ((format (printf, 2, 3)));\n" + - " void __attribute__ ((interrupt)) universal_handler ();\n" - - expected = - [ - "void* my_calloc(size_t, size_t)", - "void my_realloc(void*, size_t)", - "void universal_handler()" - ] - - assert_equal(expected, @parser.import_source(source)) - end - - it "remove preprocessor directives" do - source = - "#when stuff_happens\n" + - "#ifdef _TEST\n" + - "#pragma stack_switch" - - expected = [] - - assert_equal(expected, @parser.import_source(source)) - end - - - it "remove assembler pragma sections" do - source = - " #pragma\tasm\n" + - " .foo\n" + - " lda %m\n" + - " nop\n" + - "# pragma endasm \n" + - "foo" - - expected = ["foo"] - - assert_equal(expected, @parser.import_source(source)) - end - - - it "smush lines together that contain continuation characters" do - source = - "hoo hah \\\n" + - "when \\ \n" - - expected = - [ - "hoo hah when" - ] - - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - - it "remove C macro definitions" do - source = - "#define this is the first line\\\n" + - "and the second\\\n" + - "and the third that should be removed\n" + - "but I'm here\n" - - expected = ["but I'm here"] - - assert_equal(expected, @parser.import_source(source)) - end - - - it "remove typedef statements" do - source = - "typedef uint32 (unsigned int);\n" + - "const typedef int INT;\n" + - "int notatypedef;\n" + - "int typedef_isnt_me;\n" + - " typedef who cares what really comes here \n" + # exercise multiline typedef - " continuation;\n" + - "this should remain!;\n" + - "typedef blah bleh;\n" + - "typedef struct shell_command_struct {\n" + - " char_ptr COMMAND;\n" + - " int_32 (*SHELL_FUNC)(int_32 argc);\n" + - "} SHELL_COMMAND_STRUCT, * SHELL_COMMAND_PTR;\n" + - "typedef struct shell_command_struct {\n" + - " char_ptr COMMAND;\n" + - " int_32 (*SHELL_FUNC)(int_32 argc, char_ptr argv[]);\n" + - "} SHELL_COMMAND_STRUCT, * SHELL_COMMAND_PTR;\n" + - "typedef struct shell_command_struct {\n" + - " char_ptr COMMAND;\n" + - " int_32 (*SHELL_FUNC)(int_32 argc);\n" + - "};\n" - - expected = - [ - "int notatypedef", - "int typedef_isnt_me", - "this should remain!" - ] - - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - - it "remove enum statements" do - source = - "enum _NamedEnum {\n" + - " THING1 = (0x0001),\n" + - " THING2 = (0x0001 << 5),\n" + - "}ListOValues;\n\n" + - "don't delete me!!\n" + - " modifier_str enum _NamedEnum {THING1 = (0x0001), THING2 = (0x0001 << 5)} ListOValues;\n\n" + - "typedef enum {\n" + - " THING1,\n" + - " THING2,\n" + - "} Thinger;\n" + - "or me!!\n" - - assert_equal(["don't delete me!! or me!!"], @parser.import_source(source).map!{|s|s.strip}) - end - - - it "remove union statements" do - source = - "union _NamedDoohicky {\n" + - " unsigned int a;\n" + - " char b;\n" + - "} Doohicky;\n\n" + - "I want to live!!\n" + - "some_modifier union { unsigned int a; char b;} Whatever;\n" + - "typedef union {\n" + - " unsigned int a;\n" + - " char b;\n" + - "} Whatever;\n" + - "me too!!\n" - - assert_equal(["I want to live!! me too!!"], @parser.import_source(source).map!{|s|s.strip}) - end - - - it "remove struct statements" do - source = - "struct _NamedStruct1 {\n" + - " unsigned int a;\n" + - " signed long int b;\n" + - "} Thing ;\n\n" + - "extern struct ForwardDeclared_t TestDataType1;\n" + - "void foo(void);\n" + - "struct\n"+ - " MultilineForwardDeclared_t\n" + - " TestDataType2;\n" + - "struct THINGER foo(void);\n" + - "typedef struct {\n" + - " unsigned int a;\n" + - " signed char b;\n" + - "}Thinger;\n" + - "I want to live!!\n" - - assert_equal(["void foo(void)", "struct THINGER foo(void)", "I want to live!!"], - @parser.import_source(source).map!{|s|s.strip}) - end - - it "remove externed and inline functions" do - source = - " extern uint32 foobar(unsigned int);\n" + - "uint32 extern_name_func(unsigned int);\n" + - "uint32 funcinline(unsigned int);\n" + - "extern void bar(unsigned int);\n" + - "inline void bar(unsigned int);\n" + - "extern\n" + - "void kinda_ugly_on_the_next_line(unsigned int);\n" - - expected = - [ - "uint32 extern_name_func(unsigned int)", - "uint32 funcinline(unsigned int)" - ] - - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - it "remove function definitions but keep function declarations" do - source = - "uint32 func_with_decl_a(unsigned int);\n" + - "uint32 func_with_decl_a(unsigned int a) { return a; }\n" + - "uint32 func_with_decl_b(unsigned int);\n" + - "uint32 func_with_decl_b(unsigned int a)\n" + - "{\n" + - " bar((unsigned int) a);\n" + - " stripme(a);\n" + - "}\n" - - expected = - [ - "uint32 func_with_decl_a(unsigned int)", - "uint32 func_with_decl_a", #okay. it's not going to be interpretted as another function - "uint32 func_with_decl_b(unsigned int)", - "uint32 func_with_decl_b", #okay. it's not going to be interpretted as another function - ] - - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - it "remove function definitions with nested braces but keep function declarations" do - source = - "uint32 func_with_decl_a(unsigned int);\n" + - "uint32 func_with_decl_a(unsigned int a) {\n" + - " while (stuff) {\n" + - " not_a_definition1(void);\n" + - " }\n" + - " not_a_definition2(blah, bleh);\n" + - " return a;\n" + - "}\n" + - "uint32 func_with_decl_b(unsigned int);\n" + - "uint32 func_with_decl_b(unsigned int a)\n" + - "{\n" + - " bar((unsigned int) a);\n" + - " stripme(a);\n" + - "}\n" + - "uint32 func_with_decl_c(unsigned int);\n" + - "uint32 func_with_decl_c(unsigned int a)\n" + - "{\n" + - " if(a > 0)\n" + - " {\n" + - " return 1;\n" + - " }\n" + - " else\n"+ - " {\n" + - " return 2;\n" + - " }\n" + - "}\n" - - expected = - [ - "uint32 func_with_decl_a(unsigned int)", - "uint32 func_with_decl_a", #okay. it's not going to be interpretted as another function - "uint32 func_with_decl_b(unsigned int)", - "uint32 func_with_decl_b", #okay. it's not going to be interpretted as another function - "uint32 func_with_decl_c(unsigned int)", - "uint32 func_with_decl_c", #okay. it's not going to be interpretted as another function - ] - - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - it "remove a fully defined inline function" do - source = - "inline void foo(unsigned int a) { oranges = a; }\n" + - "inline void bar(unsigned int a) { apples = a; };\n" + - "inline void bar(unsigned int a)\n" + - "{" + - " bananas = a;\n" + - "}" - - # ensure it's expected type of exception - assert_raises RuntimeError do - @parser.parse("module", source) - end - - assert_equal([], @parser.funcs) - - # verify exception message - begin - @parser.parse("module", source) - rescue RuntimeError => e - assert_equal("ERROR: No function prototypes found!", e.message) - end - end - - it "remove a fully defined inline function that is multiple lines" do - source = - "inline void bar(unsigned int a)\n" + - "{" + - " bananas = a;\n" + - " grapes = a;\n" + - " apples(bananas, grapes);\n" + - "}" - - # ensure it's expected type of exception - assert_raises RuntimeError do - @parser.parse("module", source) - end - - assert_equal([], @parser.funcs) - - # verify exception message - begin - @parser.parse("module", source) - rescue RuntimeError => e - assert_equal("ERROR: No function prototypes found!", e.message) - end - end - - it "remove a fully defined inline function that contains nested braces" do - source = - "inline void bar(unsigned int a)\n" + - "{" + - " apples(bananas, grapes);\n" + - " if (bananas == a)\n" + - " {\n" + - " oranges(a);\n" + - " grapes = a;\n" + - " }\n" + - " grapefruit(bananas, grapes);\n" + - "}" - - # ensure it's expected type of exception - assert_raises RuntimeError do - @parser.parse("module", source) - end - - assert_equal([], @parser.funcs) - - # verify exception message - begin - @parser.parse("module", source) - rescue RuntimeError => e - assert_equal("ERROR: No function prototypes found!", e.message) - end - end - - it "remove just inline functions if externs to be included" do - source = - " extern uint32 foobar(unsigned int);\n" + - "uint32 extern_name_func(unsigned int);\n" + - "uint32 funcinline(unsigned int);\n" + - "extern void bar(unsigned int);\n" + - "inline void bar(unsigned int);\n" + - "extern\n" + - "void kinda_ugly_on_the_next_line(unsigned int);\n" - - expected = - [ "extern uint32 foobar(unsigned int)", - "uint32 extern_name_func(unsigned int)", - "uint32 funcinline(unsigned int)", - "extern void bar(unsigned int)", - "extern void kinda_ugly_on_the_next_line(unsigned int)" - ] - - @parser.treat_externs = :include - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - it "leave inline functions if inline to be included" do - source = - "extern uint32 foobar(unsigned int);\n" + - "uint32 extern_name_func(unsigned int);\n" + - "uint32 funcinline(unsigned int);\n" + - "inline void inlineBar(unsigned int);\n" + - "extern int extern_bar(void);\n" + - "static inline void staticinlineBar(unsigned int);\n" + - "static inline void bar(unsigned int);\n" + - "static inline void bar(unsigned int)\n" + - "{\n" + - " // NOP\n" + - "}\n" - - expected = - [ "uint32 extern_name_func(unsigned int)", - "uint32 funcinline(unsigned int)", - "void inlineBar(unsigned int)", - "void staticinlineBar(unsigned int)", - "void bar(unsigned int)" - ] - - @parser.treat_inlines = :include - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - it "leave inline and extern functions if inline and extern to be included" do - source = - "extern uint32 foobar(unsigned int);\n" + - "uint32 extern_name_func(unsigned int);\n" + - "uint32 funcinline(unsigned int);\n" + - "inline void inlineBar(unsigned int);\n" + - "extern int extern_bar(void);\n" + - "static inline void staticinlineBar(unsigned int);\n" + - "static inline void bar(unsigned int);\n" + - "static inline void bar(unsigned int)\n" + - "{\n" + - " // NOP\n" + - "}\n" - - expected = - [ "extern uint32 foobar(unsigned int)", - "uint32 extern_name_func(unsigned int)", - "uint32 funcinline(unsigned int)", - "void inlineBar(unsigned int)", - "extern int extern_bar(void)", - "void staticinlineBar(unsigned int)", - "void bar(unsigned int)" - ] - - @parser.treat_externs = :include - @parser.treat_inlines = :include - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - it "Include inline functions that contain user defined inline function formats" do - source = - "uint32 foo(unsigned int);\n" + - "uint32 bar(unsigned int);\n" + - "inline void inlineBar(void)\n" + - "{\n" + - " return 43;\n" + - "}\n" + - "static __inline__ __attribute__ ((always_inline)) int alwaysinlinefunc(int a)\n" + - "{\n" + - " return a + inlineBar();\n" + - "}\n" + - "static __inline__ void inlinebar(unsigned int)\n" + - "{\n" + - " int a = alwaysinlinefunc()\n" + - "}\n" - - expected = - [ - "uint32 foo(unsigned int)", - "uint32 bar(unsigned int)", - "void inlineBar(void)", - "int alwaysinlinefunc(int a)", - "void inlinebar(unsigned int)" - ] - - @parser.treat_inlines = :include - @parser.inline_function_patterns = ['static __inline__ __attribute__ \(\(always_inline\)\)', 'static __inline__', '\binline\b'] - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - it "remove defines" do - source = - "#define whatever you feel like defining\n" + - "void hello(void);\n" + - "#DEFINE I JUST DON'T CARE\n" + - "#deFINE\n" + - "#define get_foo() \\\n ((Thing)foo.bar)" # exercise multiline define - - expected = - [ - "void hello(void)", - ] - - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - - it "remove keywords that would keep things from going smoothly in the future" do - source = - "const int TheMatrix(register int Trinity, unsigned int *restrict Neo)" - - expected = - [ - "const int TheMatrix(int Trinity, unsigned int * Neo)", - ] - - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - - # some code actually typedef's void even though it's not ANSI C and is, frankly, weird - # since cmock treats void specially, we can't let void be obfuscated - it "handle odd case of typedef'd void returned" do - source = "MY_FUNKY_VOID FunkyVoidReturned(int a)" - expected = { :var_arg=>nil, - :name=>"FunkyVoidReturned", - :unscoped_name=>"FunkyVoidReturned", - :namespace=>[], - :class=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :modifier=>"", - :contains_ptr? => false, - :args=>[{:type=>"int", :name=>"a", :ptr? => false, :const? => false, :const_ptr? => false}], - :args_string=>"int a", - :args_call=>"a"} - assert_equal(expected, @parser.parse_declaration(source)) - end - - it "handle odd case of typedef'd void as arg" do - source = "int FunkyVoidAsArg(MY_FUNKY_VOID)" - expected = { :var_arg=>nil, - :name=>"FunkyVoidAsArg", - :unscoped_name=>"FunkyVoidAsArg", - :namespace=>[], - :class=>nil, - :return=>{ :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :modifier=>"", - :contains_ptr? => false, - :args=>[], - :args_string=>"void", - :args_call=>"" } - assert_equal(expected, @parser.parse_declaration(source)) - end - - it "handle odd case of typedef'd void as arg pointer" do - source = "char FunkyVoidPointer(MY_FUNKY_VOID* bluh)" - expected = { :var_arg=>nil, - :name=>"FunkyVoidPointer", - :unscoped_name=>"FunkyVoidPointer", - :namespace=>[], - :class=>nil, - :return=>{ :type => "char", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "char cmock_to_return", - :void? => false - }, - :modifier=>"", - :contains_ptr? => true, - :args=>[{:type=>"MY_FUNKY_VOID*", :name=>"bluh", :ptr? => true, :const? => false, :const_ptr? => false}], - :args_string=>"MY_FUNKY_VOID* bluh", - :args_call=>"bluh" } - assert_equal(expected, @parser.parse_declaration(source)) - end - - - it "strip default values from function parameter lists" do - source = - "void Foo(int a = 57, float b=37.52, char c= 'd', char* e=\"junk\");\n" - - expected = - [ - "void Foo(int a, float b, char c, char* e)" - ] - - assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) - end - - - it "raise upon empty file" do - source = '' - - # ensure it's expected type of exception - assert_raises RuntimeError do - @parser.parse("module", source) - end - - assert_equal([], @parser.funcs) - - # verify exception message - begin - @parser.parse("module", source) - rescue RuntimeError => e - assert_equal("ERROR: No function prototypes found!", e.message) - end - end - - it "clean up module names that contain spaces, dashes, and such" do - source = 'void meh(int (*func)(int));' - - retval = @parser.parse("C:\Ugly Module-Name", source) - assert (retval[:typedefs][0] =~ /CUglyModuleName/) - end - - it "raise upon no function prototypes found in file" do - source = - "typedef void SILLY_VOID_TYPE1;\n" + - "typedef (void) SILLY_VOID_TYPE2 ;\n" + - "typedef ( void ) (*FUNCPTR)(void);\n\n" + - "#define get_foo() \\\n ((Thing)foo.bar)" - - # ensure it's expected type of exception - assert_raises(RuntimeError) do - @parser.parse("module", source) - end - - assert_equal([], @parser.funcs) - - # verify exception message - begin - @parser.parse("module", source) - rescue RuntimeError => e - assert_equal("ERROR: No function prototypes found!", e.message) - end - end - - - it "raise upon prototype parsing failure" do - source = "void (int, )" - - # ensure it's expected type of exception - assert_raises(RuntimeError) do - @parser.parse("module", source) - end - - # verify exception message - begin - @parser.parse("module", source) - rescue RuntimeError => e - assert(e.message.include?("Failed Parsing Declaration Prototype!")) - end - end - - it "extract and return function declarations with retval and args" do - - source = "int Foo(int a, unsigned int b)" - expected = { :var_arg=>nil, - :name=>"Foo", - :unscoped_name=>"Foo", - :namespace=>[], - :class=>nil, - :return=>{ :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"int", :name=>"a", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"unsigned int", :name=>"b", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"int a, unsigned int b", - :args_call=>"a, b" } - assert_equal(expected, @parser.parse_declaration(source)) - end - - it "extract and return function declarations with no retval" do - - source = "void FunkyChicken( uint la, int de, bool da)" - expected = { :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"FunkyChicken", - :unscoped_name=>"FunkyChicken", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"uint", :name=>"la", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"int", :name=>"de", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"bool", :name=>"da", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"uint la, int de, bool da", - :args_call=>"la, de, da" } - assert_equal(expected, @parser.parse_declaration(source)) - end - - it "extract and return function declarations with implied voids" do - - source = "void tat()" - expected = { :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"tat", - :unscoped_name=>"tat", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ ], - :args_string=>"void", - :args_call=>"" } - assert_equal(expected, @parser.parse_declaration(source)) - end - - it "extract modifiers properly" do - - source = "const int TheMatrix(int Trinity, unsigned int * Neo)" - expected = { :var_arg=>nil, - :return=>{ :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => true, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"TheMatrix", - :unscoped_name=>"TheMatrix", - :namespace=>[], - :class=>nil, - :modifier=>"const", - :contains_ptr? => true, - :args=>[ {:type=>"int", :name=>"Trinity", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"unsigned int*", :name=>"Neo", :ptr? => true, :const? => false, :const_ptr? => false} - ], - :args_string=>"int Trinity, unsigned int* Neo", - :args_call=>"Trinity, Neo" } - assert_equal(expected, @parser.parse_declaration(source)) - end - - it "extract c calling conventions properly" do - - source = "const int __stdcall TheMatrix(int Trinity, unsigned int * Neo)" - expected = { :var_arg=>nil, - :return=>{ :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => true, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"TheMatrix", - :unscoped_name=>"TheMatrix", - :namespace=>[], - :class=>nil, - :modifier=>"const", - :c_calling_convention=>"__stdcall", - :contains_ptr? => true, - :args=>[ {:type=>"int", :name=>"Trinity", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"unsigned int*", :name=>"Neo", :ptr? => true, :const? => false, :const_ptr? => false} - ], - :args_string=>"int Trinity, unsigned int* Neo", - :args_call=>"Trinity, Neo" } - assert_equal(expected, @parser.parse_declaration(source)) - end - - it "extract and return function declarations inside namespace and class" do - source = "int Foo(int a, unsigned int b)" - expected = { :var_arg=>nil, - :name=>"ns1_ns2_Bar_Foo", - :unscoped_name=>"Foo", - :class=>"Bar", - :namespace=>["ns1", "ns2"], - :return=>{ :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"int", :name=>"a", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"unsigned int", :name=>"b", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"int a, unsigned int b", - :args_call=>"a, b" } - assert_equal(expected, @parser.parse_declaration(source, ["ns1", "ns2"], "Bar")) - end - - it "fully parse multiple prototypes" do - - source = "const int TheMatrix(int Trinity, unsigned int * Neo);\n" + - "int Morpheus(int, unsigned int*);\n" - - expected = [{ :var_arg=>nil, - :return=> { :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => true, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"TheMatrix", - :unscoped_name=>"TheMatrix", - :namespace=>[], - :class=>nil, - :modifier=>"const", - :contains_ptr? => true, - :args=>[ {:type=>"int", :name=>"Trinity", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"unsigned int*", :name=>"Neo", :ptr? => true, :const? => false, :const_ptr? => false} - ], - :args_string=>"int Trinity, unsigned int* Neo", - :args_call=>"Trinity, Neo" }, - { :var_arg=>nil, - :return=> { :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"Morpheus", - :unscoped_name=>"Morpheus", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => true, - :args=>[ {:type=>"int", :name=>"cmock_arg1", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"unsigned int*", :name=>"cmock_arg2", :ptr? => true, :const? => false, :const_ptr? => false} - ], - :args_string=>"int cmock_arg1, unsigned int* cmock_arg2", - :args_call=>"cmock_arg1, cmock_arg2" - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "not extract for mocking multiply defined prototypes" do - - source = "const int TheMatrix(int Trinity, unsigned int * Neo);\n" + - "const int TheMatrix(int, unsigned int*);\n" - - expected = [{ :var_arg=>nil, - :name=>"TheMatrix", - :unscoped_name=>"TheMatrix", - :namespace=>[], - :class=>nil, - :return=> { :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => true, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :modifier=>"const", - :contains_ptr? => true, - :args=>[ {:type=>"int", :name=>"Trinity", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"unsigned int*", :name=>"Neo", :ptr? => true, :const? => false, :const_ptr? => false} - ], - :args_string=>"int Trinity, unsigned int* Neo", - :args_call=>"Trinity, Neo" - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "should properly handle const before return type" do - sources = [ - "const int * PorkRoast(void);\n", - "const int* PorkRoast(void);\n", - "const int *PorkRoast(void);\n" - ] - - expected = [{ :var_arg => nil, - :name => "PorkRoast", - :unscoped_name => "PorkRoast", - :namespace=>[], - :class=>nil, - :return => { :type => "const int*", - :name => 'cmock_to_return', - :ptr? => true, - :const? => true, - :const_ptr? => false, - :str => "const int* cmock_to_return", - :void? => false - }, - :modifier => "", - :contains_ptr? => false, - :args => [], - :args_string => "void", - :args_call => "" - }] - - sources.each do |source| - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - end - - it "should properly handle const before return type" do - sources = [ - "int const * PorkRoast(void);\n", - "int const* PorkRoast(void);\n", - "int const *PorkRoast(void);\n" - ] - - expected = [{ :var_arg => nil, - :name => "PorkRoast", - :unscoped_name => "PorkRoast", - :namespace=>[], - :class=>nil, - :return => { :type => "int const*", - :name => 'cmock_to_return', - :ptr? => true, - :const? => true, - :const_ptr? => false, - :str => "int const* cmock_to_return", - :void? => false - }, - :modifier => "", - :contains_ptr? => false, - :args => [], - :args_string => "void", - :args_call => "" - }] - - sources.each do |source| - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - end - - it "should properly handle const applied after asterisk in return type (not legal C, but sometimes used)" do - - source = "int * const PorkRoast(void);\n" - - expected = [{ :var_arg=>nil, - :name=>"PorkRoast", - :unscoped_name=>"PorkRoast", - :namespace=>[], - :class=>nil, - :return=> { :type => "int*", - :name => 'cmock_to_return', - :ptr? => true, - :const? => false, - :const_ptr? => true, - :str => "int* cmock_to_return", - :void? => false - }, - :modifier=>"const", - :contains_ptr? => false, - :args=>[], - :args_string=>"void", - :args_call=>"" - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "properly parse const and pointer argument types with no arg names" do - - source = "void foo(int const*, int*const, const int*, const int*const, int const*const, int*, int, const int);\n" - - expected = [{ :name => "foo", - :unscoped_name => "foo", - :namespace=>[], - :class=>nil, - :modifier => "", - :return => { :type => "void", - :name => "cmock_to_return", - :str => "void cmock_to_return", - :void? => true, - :ptr? => false, - :const? => false, - :const_ptr? => false - }, - :var_arg => nil, - :args_string => "int const* cmock_arg1, int* const cmock_arg2, const int* cmock_arg3, const int* const cmock_arg4, " + - "int const* const cmock_arg5, int* cmock_arg6, int cmock_arg7, const int cmock_arg8", - :args => [{ :type=>"int const*", :name => "cmock_arg1", :ptr? => true, :const? => true, :const_ptr? => false }, - { :type=>"int*", :name => "cmock_arg2", :ptr? => true, :const? => false, :const_ptr? => true }, - { :type=>"const int*", :name => "cmock_arg3", :ptr? => true, :const? => true, :const_ptr? => false }, - { :type=>"const int*", :name => "cmock_arg4", :ptr? => true, :const? => true, :const_ptr? => true }, - { :type=>"int const*", :name => "cmock_arg5", :ptr? => true, :const? => true, :const_ptr? => true }, - { :type=>"int*", :name => "cmock_arg6", :ptr? => true, :const? => false, :const_ptr? => false }, - { :type=>"int", :name => "cmock_arg7", :ptr? => false, :const? => false, :const_ptr? => false }, - { :type=>"int", :name => "cmock_arg8", :ptr? => false, :const? => true, :const_ptr? => false }], - :args_call => "cmock_arg1, cmock_arg2, cmock_arg3, cmock_arg4, cmock_arg5, cmock_arg6, cmock_arg7, cmock_arg8", - :contains_ptr? => true - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "properly parse const and pointer argument types with arg names" do - - source = "void bar(int const* param1, int*const param2, const int* param3, const int*const param4,\n" + - " int const*const param5, int*param6, int param7, const int param8);\n" - - expected = [{ :name => "bar", - :unscoped_name => "bar", - :namespace=>[], - :class=>nil, - :modifier => "", - :return => { :type => "void", - :name => "cmock_to_return", - :str => "void cmock_to_return", - :void? => true, - :ptr? => false, - :const? => false, - :const_ptr? => false - }, - :var_arg => nil, - :args_string => "int const* param1, int* const param2, const int* param3, const int* const param4, " + - "int const* const param5, int* param6, int param7, const int param8", - :args => [{ :type=>"int const*", :name => "param1", :ptr? => true, :const? => true, :const_ptr? => false }, - { :type=>"int*", :name => "param2", :ptr? => true, :const? => false, :const_ptr? => true }, - { :type=>"const int*", :name => "param3", :ptr? => true, :const? => true, :const_ptr? => false }, - { :type=>"const int*", :name => "param4", :ptr? => true, :const? => true, :const_ptr? => true }, - { :type=>"int const*", :name => "param5", :ptr? => true, :const? => true, :const_ptr? => true }, - { :type=>"int*", :name => "param6", :ptr? => true, :const? => false, :const_ptr? => false }, - { :type=>"int", :name => "param7", :ptr? => false, :const? => false, :const_ptr? => false }, - { :type=>"int", :name => "param8", :ptr? => false, :const? => true, :const_ptr? => false }], - :args_call => "param1, param2, param3, param4, param5, param6, param7, param8", - :contains_ptr? => true - }].freeze - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "converts typedef'd array arguments to pointers" do - - source = "Book AddToBook(Book book, const IntArray values);\n" - - expected = [{ :name => "AddToBook", - :unscoped_name => "AddToBook", - :namespace=>[], - :class=>nil, - :modifier=>"", - :return => { :type => "Book", - :name => "cmock_to_return", - :str => "Book cmock_to_return", - :void? => false, - :ptr? => false, - :const? => false, - :const_ptr? => false - }, - :var_arg => nil, - :args => [{ :type => "Page*", :name => "book", :ptr? => true, :const? => false, :const_ptr? => false }, - { :type => "const int*", :name => "values", :ptr? => true, :const? => true, :const_ptr? => false }], - :args_string => "Book book, const IntArray values", - :args_call => "book, values", - :contains_ptr? => true - }] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - - end - - it "properly detect typedef'd variants of void and use those" do - - source = "typedef (void) FUNKY_VOID_T;\n" + - "typedef void CHUNKY_VOID_T;\n" + - "FUNKY_VOID_T DrHorrible(int SingAlong);\n" + - "int CaptainHammer(CHUNKY_VOID_T);\n" - - expected = [{ :var_arg=>nil, - :name=>"DrHorrible", - :unscoped_name=>"DrHorrible", - :namespace=>[], - :class=>nil, - :return => { :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"int", :name=>"SingAlong", :ptr? => false, :const? => false, :const_ptr? => false} ], - :args_string=>"int SingAlong", - :args_call=>"SingAlong" - }, - { :var_arg=>nil, - :return=> { :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"CaptainHammer", - :unscoped_name=>"CaptainHammer", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ ], - :args_string=>"void", - :args_call=>"" - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "be ok with structs inside of function declarations" do - - source = "int DrHorrible(struct SingAlong Blog);\n" + - "void Penny(struct const _KeepYourHeadUp_ * const BillyBuddy);\n" + - "struct TheseArentTheHammer CaptainHammer(void);\n" - - expected = [{ :var_arg=>nil, - :return =>{ :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"DrHorrible", - :unscoped_name=>"DrHorrible", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"struct SingAlong", :name=>"Blog", :ptr? => false, :const? => false, :const_ptr? => false} ], - :args_string=>"struct SingAlong Blog", - :args_call=>"Blog" - }, - { :var_arg=>nil, - :return=> { :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"Penny", - :unscoped_name=>"Penny", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => true, - :args=>[ {:type=>"struct const _KeepYourHeadUp_*", :name=>"BillyBuddy", :ptr? => true, :const? => true, :const_ptr? => true} ], - :args_string=>"struct const _KeepYourHeadUp_* const BillyBuddy", - :args_call=>"BillyBuddy" - }, - { :var_arg=>nil, - :return=> { :type => "struct TheseArentTheHammer", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "struct TheseArentTheHammer cmock_to_return", - :void? => false - }, - :name=>"CaptainHammer", - :unscoped_name=>"CaptainHammer", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ ], - :args_string=>"void", - :args_call=>"" - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "extract functions containing unions with union specifier" do - source = "void OrangePeel(union STARS_AND_STRIPES * a, union AFL_CIO b)" - expected = [{ :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"OrangePeel", - :unscoped_name=>"OrangePeel", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => true, - :args=>[ {:type=>"union STARS_AND_STRIPES*", :name=>"a", :ptr? => true, :const? => false, :const_ptr? => false}, - {:type=>"union AFL_CIO", :name=>"b", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"union STARS_AND_STRIPES* a, union AFL_CIO b", - :args_call=>"a, b" }] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - end - - it "not be thwarted by variables named with primitive types as part of the name" do - source = "void ApplePeel(const unsigned int const_param, int int_param, int integer, char character, int* const constant)" - expected = [{ :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"ApplePeel", - :unscoped_name=>"ApplePeel", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => true, - :args=>[ {:type=> "unsigned int", :name=>"const_param", :ptr? => false, :const? => true, :const_ptr? => false}, - {:type=>"int", :name=>"int_param", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"int", :name=>"integer", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"char", :name=>"character", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"int*", :name=>"constant", :ptr? => true, :const? => false, :const_ptr? => true} - ], - :args_string=>"const unsigned int const_param, int int_param, int integer, char character, int* const constant", - :args_call=>"const_param, int_param, integer, character, constant" }] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - end - - it "not be thwarted by custom types named similarly to primitive types" do - source = "void LemonPeel(integer param, character thing, longint * junk, constant value, int32_t const number)" - expected = [{:var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"LemonPeel", - :unscoped_name=>"LemonPeel", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => true, - :args=>[ {:type=>"integer", :name=>"param", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"character", :name=>"thing", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"longint*", :name=>"junk", :ptr? => true, :const? => false, :const_ptr? => false}, - {:type=>"constant", :name=>"value", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"int32_t", :name=>"number", :ptr? => false, :const? => true, :const_ptr? => false} - ], - :args_string=>"integer param, character thing, longint* junk, constant value, int32_t const number", - :args_call=>"param, thing, junk, value, number" }] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - end - - it "handle some of those chains of C name specifiers naturally" do - source = "void CoinOperated(signed char abc, const unsigned long int xyz_123, unsigned int const abc_123, long long arm_of_the_law)" - expected = [{:var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"CoinOperated", - :unscoped_name=>"CoinOperated", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"signed char", :name=>"abc", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"unsigned long int", :name=>"xyz_123", :ptr? => false, :const? => true, :const_ptr? => false}, - {:type=>"unsigned int", :name=>"abc_123", :ptr? => false, :const? => true, :const_ptr? => false}, - {:type=>"long long", :name=>"arm_of_the_law", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"signed char abc, const unsigned long int xyz_123, unsigned int const abc_123, long long arm_of_the_law", - :args_call=>"abc, xyz_123, abc_123, arm_of_the_law" }] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - end - - it "handle custom types of various formats" do - source = "void CardOperated(CUSTOM_TYPE abc, CUSTOM_TYPE* xyz_123, CUSTOM_TYPE const abcxyz, struct CUSTOM_TYPE const * const abc123)" - expected = [{:var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"CardOperated", - :unscoped_name=>"CardOperated", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => true, - :args=>[ {:type=>"CUSTOM_TYPE", :name=>"abc", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"CUSTOM_TYPE*", :name=>"xyz_123", :ptr? => true, :const? => false, :const_ptr? => false}, - {:type=>"CUSTOM_TYPE", :name=>"abcxyz", :ptr? => false, :const? => true, :const_ptr? => false}, - {:type=>"struct CUSTOM_TYPE const*", :name=>"abc123", :ptr? => true, :const? => true, :const_ptr? => true} - ], - :args_string=>"CUSTOM_TYPE abc, CUSTOM_TYPE* xyz_123, CUSTOM_TYPE const abcxyz, struct CUSTOM_TYPE const* const abc123", - :args_call=>"abc, xyz_123, abcxyz, abc123" }] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - end - - it "handle arrays and treat them as pointers or strings" do - source = 'void KeyOperated(CUSTOM_TYPE thing1[], int thing2 [ ], ' \ - 'char thing3 [][2 ][ 3], int* thing4[4], u8 thing5[((u8)((5 + 5*2)/3))])' - expected_args = [ - { type: 'CUSTOM_TYPE*', name: 'thing1', ptr?: true, const?: false, const_ptr?: false }, - { type: 'int*', name: 'thing2', ptr?: true, const?: false, const_ptr?: false }, - # this one will likely change in the future when we improve multidimensional array support - { type: 'char*', name: 'thing3', ptr?: false, const?: false, const_ptr?: false }, - # this one will likely change in the future when we improve multidimensional array support - { type: 'int**', name: 'thing4', ptr?: true, const?: false, const_ptr?: false }, - { type: 'u8*', name: 'thing5', ptr?: true, const?: false, const_ptr?: false } - ] - expected = [{:var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"KeyOperated", - :unscoped_name=>"KeyOperated", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => true, - :args => expected_args, - :args_string => 'CUSTOM_TYPE* thing1, int* thing2, ' \ - 'char* thing3, int** thing4, u8* thing5', - :args_call => 'thing1, thing2, thing3, thing4, thing5' }] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - end - - it "give a reasonable guess when dealing with weird combinations of custom types and modifiers" do - source = "void Cheese(unsigned CUSTOM_TYPE abc, unsigned xyz, CUSTOM_TYPE1 CUSTOM_TYPE2 pdq)" - expected = [{:var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"Cheese", - :unscoped_name=>"Cheese", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"unsigned CUSTOM_TYPE", :name=>"abc", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"unsigned", :name=>"xyz", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"CUSTOM_TYPE1 CUSTOM_TYPE2", :name=>"pdq", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"unsigned CUSTOM_TYPE abc, unsigned xyz, CUSTOM_TYPE1 CUSTOM_TYPE2 pdq", - :args_call=>"abc, xyz, pdq" }] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - end - - it "extract functions containing a function pointer" do - source = "void FunkyTurkey(unsigned int (*func_ptr)(int, char))" - expected = [{ :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"FunkyTurkey", - :unscoped_name=>"FunkyTurkey", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"cmock_module_func_ptr1 func_ptr", - :args_call=>"func_ptr" }] - typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)(int, char);"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions using a function pointer with shorthand notation" do - source = "void FunkyTurkey(unsigned int func_ptr(int, char))" - expected = [{ :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"FunkyTurkey", - :unscoped_name=>"FunkyTurkey", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"cmock_module_func_ptr1 func_ptr", - :args_call=>"func_ptr" }] - typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)(int, char);"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions containing a function pointer with a void" do - source = "void FunkyTurkey(void (*func_ptr)(void))" - expected = [{ :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"FunkyTurkey", - :unscoped_name=>"FunkyTurkey", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"cmock_module_func_ptr1 func_ptr", - :args_call=>"func_ptr" }] - typedefs = ["typedef void(*cmock_module_func_ptr1)(void);"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions containing a function pointer with an implied void" do - source = "void FunkyTurkey(unsigned int (*func_ptr)())" - expected = [{ :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"FunkyTurkey", - :unscoped_name=>"FunkyTurkey", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"cmock_module_func_ptr1 func_ptr", - :args_call=>"func_ptr" }] - typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)();"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions containing a constant function pointer and a pointer in the nested arg list" do - source = "void FunkyChicken(unsigned int (* const func_ptr)(unsigned long int * , char))" - expected = [{ :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"FunkyChicken", - :unscoped_name=>"FunkyChicken", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => true, :const_ptr? => false} - ], - :args_string=>"cmock_module_func_ptr1 const func_ptr", - :args_call=>"func_ptr" }] - typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)(unsigned long int* , char);"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - # it "extract functions containing a function pointer taking a vararg" do - # source = "void FunkyParrot(unsigned int (*func_ptr)(int, char, ...))" - # expected = [{ :var_arg=>nil, - # :return=>{ :type => "void", - # :name => 'cmock_to_return', - # :ptr? => false, - # :const? => false, - # :const_ptr? => false, - # :str => "void cmock_to_return", - # :void? => true - # }, - # :name=>"FunkyParrot", - # :unscoped_name=>"FunkyParrot", - # :namespace=>[], - # :class=>nil, - # :modifier=>"", - # :contains_ptr? => false, - # :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => false, :const_ptr? => false} - # ], - # :args_string=>"cmock_module_func_ptr1 func_ptr", - # :args_call=>"func_ptr" }] - # typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)(int, char, ...);"] - # result = @parser.parse("module", source) - # assert_equal(expected, result[:functions]) - # assert_equal(typedefs, result[:typedefs]) - # end - - it "extract functions containing a function pointer with extra parenthesis and two sets" do - source = "void FunkyBudgie(int (((* func_ptr1)(int, char))), void (*func_ptr2)(void))" - expected = [{ :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"FunkyBudgie", - :unscoped_name=>"FunkyBudgie", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr1", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"cmock_module_func_ptr2", :name=>"func_ptr2", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"cmock_module_func_ptr1 func_ptr1, cmock_module_func_ptr2 func_ptr2", - :args_call=>"func_ptr1, func_ptr2" }] - typedefs = ["typedef int(*cmock_module_func_ptr1)(int, char);", "typedef void(*cmock_module_func_ptr2)(void);"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions containing a function pointers, structs and other things" do - source = "struct mytype *FunkyRobin(uint16_t num1, uint16_t num2, void (*func_ptr1)(uint16_t num3, struct mytype2 *s));" - expected = [{ :var_arg=>nil, - :return=>{ :type => "struct mytype*", - :name => 'cmock_to_return', - :ptr? => true, - :const? => false, - :const_ptr? => false, - :str => "struct mytype* cmock_to_return", - :void? => false - }, - :name=>"FunkyRobin", - :unscoped_name=>"FunkyRobin", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"uint16_t", :name=>"num1", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"uint16_t", :name=>"num2", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"cmock_module_func_ptr1", :name=>"func_ptr1", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"uint16_t num1, uint16_t num2, cmock_module_func_ptr1 func_ptr1", - :args_call=>"num1, num2, func_ptr1" }] - typedefs = ["typedef void(*cmock_module_func_ptr1)(uint16_t num3, struct mytype2* s);"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions containing an anonymous function pointer" do - source = "void FunkyFowl(unsigned int (* const)(int, char))" - expected = [{ :var_arg=>nil, - :return=>{ :type => "void", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "void cmock_to_return", - :void? => true - }, - :name=>"FunkyFowl", - :unscoped_name=>"FunkyFowl", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"cmock_arg1", :ptr? => false, :const? => true, :const_ptr? => false} - ], - :args_string=>"cmock_module_func_ptr1 const cmock_arg1", - :args_call=>"cmock_arg1" }] - typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)(int, char);"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions returning a function pointer" do - source = "unsigned short (*FunkyPidgeon( const char op_code ))( int, long int )" - expected = [{ :var_arg=>nil, - :return=>{ :type => "cmock_module_func_ptr1", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "cmock_module_func_ptr1 cmock_to_return", - :void? => false - }, - :name=>"FunkyPidgeon", - :unscoped_name=>"FunkyPidgeon", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"char", :name=>"op_code", :ptr? => false, :const? => true, :const_ptr? => false} - ], - :args_string=>"const char op_code", - :args_call=>"op_code" }] - typedefs = ["typedef unsigned short(*cmock_module_func_ptr1)( int, long int );"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions returning a function pointer with implied void" do - source = "unsigned short (*FunkyTweetie())()" - expected = [{ :var_arg=>nil, - :return=>{ :type => "cmock_module_func_ptr1", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "cmock_module_func_ptr1 cmock_to_return", - :void? => false - }, - :name=>"FunkyTweetie", - :unscoped_name=>"FunkyTweetie", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[], - :args_string=>"void", - :args_call=>"" }] - typedefs = ["typedef unsigned short(*cmock_module_func_ptr1)();"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions returning a function pointer where everything is a void" do - source = "void (* FunkySeaGull(void))(void)" - expected = [{ :var_arg=>nil, - :return=>{ :type => "cmock_module_func_ptr1", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "cmock_module_func_ptr1 cmock_to_return", - :void? => false - }, - :name=>"FunkySeaGull", - :unscoped_name=>"FunkySeaGull", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[], - :args_string=>"void", - :args_call=>"" }] - typedefs = ["typedef void(*cmock_module_func_ptr1)(void);"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions returning a function pointer with some pointer nonsense" do - source = "unsigned int * (* FunkyMacaw(double* foo, THING *bar))(unsigned int)" - expected = [{ :var_arg=>nil, - :return=>{ :type => "cmock_module_func_ptr1", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "cmock_module_func_ptr1 cmock_to_return", - :void? => false - }, - :name=>"FunkyMacaw", - :unscoped_name=>"FunkyMacaw", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => true, - :args=>[ {:type=>"double*", :name=>"foo", :ptr? => true, :const? => false, :const_ptr? => false}, - {:type=>"THING*", :name=>"bar", :ptr? => true, :const? => false, :const_ptr? => false} - ], - :args_string=>"double* foo, THING* bar", - :args_call=>"foo, bar" }] - typedefs = ["typedef unsigned int *(*cmock_module_func_ptr1)(unsigned int);"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract this SQLite3 function with an anonymous function pointer arg (regression test)" do - source = "SQLITE_API int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*))" - expected = [{ :var_arg=>nil, - :return=>{ :type => "int", - :name => "cmock_to_return", - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"sqlite3_bind_text", - :unscoped_name=>"sqlite3_bind_text", - :namespace=>[], - :class=>nil, - :modifier=>"SQLITE_API", - :contains_ptr? => true, - :args=>[ {:type=>"sqlite3_stmt*", :name=>"cmock_arg2", :ptr? => true, :const? => false, :const_ptr? => false}, - {:type=>"int", :name=>"cmock_arg3", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"const char*", :name=>"cmock_arg4", :ptr? => false, :const? => true, :const_ptr? => false}, - {:type=>"int", :name=>"n", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"cmock_module_func_ptr1", :name=>"cmock_arg1", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"sqlite3_stmt* cmock_arg2, int cmock_arg3, const char* cmock_arg4, int n, cmock_module_func_ptr1 cmock_arg1", - :args_call=>"cmock_arg2, cmock_arg3, cmock_arg4, n, cmock_arg1" }] - typedefs = ["typedef void(*cmock_module_func_ptr1)(void*);"] - result = @parser.parse("module", source) - assert_equal(expected, result[:functions]) - assert_equal(typedefs, result[:typedefs]) - end - - it "extract functions with varargs" do - source = "int XFiles(int Scully, int Mulder, ...);\n" - expected = [{ :var_arg=>"...", - :return=> { :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"XFiles", - :unscoped_name=>"XFiles", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"int", :name=>"Scully", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"int", :name=>"Mulder", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"int Scully, int Mulder", - :args_call=>"Scully, Mulder" - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "extract functions with void pointers" do - source = "void* MoreSillySongs(void* stuff);\n" - expected = [{ :var_arg=>nil, - :return=> { :type => "void*", - :name => 'cmock_to_return', - :ptr? => true, - :const? => false, - :const_ptr? => false, - :str => "void* cmock_to_return", - :void? => false - }, - :name=>"MoreSillySongs", - :unscoped_name=>"MoreSillySongs", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => true, - :args=>[ {:type=>"void*", :name=>"stuff", :ptr? => true, :const? => false, :const_ptr? => false} - ], - :args_string=>"void* stuff", - :args_call=>"stuff" - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "extract functions with strippable confusing junk like gcc attributes" do - source = "int LaverneAndShirley(int Lenny, int Squiggy) __attribute__((weak)) __attribute__ ((deprecated));\n" - expected = [{ :var_arg=>nil, - :return=> { :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"LaverneAndShirley", - :unscoped_name=>"LaverneAndShirley", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"int", :name=>"Lenny", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"int", :name=>"Squiggy", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"int Lenny, int Squiggy", - :args_call=>"Lenny, Squiggy" - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "extract functions with strippable confusing junk like gcc attributes with parenthesis" do - source = "int TheCosbyShow(int Cliff, int Claire) __attribute__((weak, alias (\"__f\"));\n" - expected = [{ :var_arg=>nil, - :return=> { :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"TheCosbyShow", - :unscoped_name=>"TheCosbyShow", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"int", :name=>"Cliff", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"int", :name=>"Claire", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"int Cliff, int Claire", - :args_call=>"Cliff, Claire" - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "divines all permutations of ptr, const, and const_ptr correctly" do - truth_table = [ - # argument ptr const const_ptr - [ "constNOTconst constNOTconst", false, false, false ], - [ "const constNOTconst constNOTconst", false, true, false ], - [ "constNOTconst const constNOTconst", false, true, false ], - [ "constNOTconst *constNOTconst", true, false, false ], - [ "const constNOTconst *constNOTconst", true, true, false ], - [ "constNOTconst const *constNOTconst", true, true, false ], - [ "constNOTconst *const constNOTconst", true, false, true ], - [ "const constNOTconst *const constNOTconst", true, true, true ], - [ "constNOTconst const *const constNOTconst", true, true, true ], - [ "constNOTconst **constNOTconst", true, false, false ], - [ "const constNOTconst **constNOTconst", true, false, false ], - [ "constNOTconst const **constNOTconst", true, false, false ], - [ "constNOTconst *const *constNOTconst", true, true, false ], - [ "const constNOTconst *const *constNOTconst", true, true, false ], - [ "constNOTconst const *const *constNOTconst", true, true, false ], - [ "constNOTconst **const constNOTconst", true, false, true ], - [ "const constNOTconst **const constNOTconst", true, false, true ], - [ "constNOTconst const **const constNOTconst", true, false, true ], - [ "constNOTconst *const *const constNOTconst", true, true, true ], - [ "const constNOTconst *const *const constNOTconst", true, true, true ], - [ "constNOTconst const *const *const constNOTconst", true, true, true ] - ] - - truth_table.each do |entry| - assert_equal(@parser.divine_ptr(entry[0]), entry[1]) - assert_equal(@parser.divine_const(entry[0]), entry[2]) - assert_equal(@parser.divine_ptr_and_const(entry[0]), - { ptr?: entry[1], const?: entry[2], const_ptr?: entry[3] }) - end - end - - it "divines ptr correctly for string types" do - truth_table = [ - # argument ptr - [ "char s", false ], - [ "const char s", false ], - [ "char const s", false ], - [ "char *s", false ], - [ "const char *s", false ], - [ "char const *s", false ], - [ "char *const s", false ], - [ "const char *const s", false ], - [ "char const *const s", false ], - [ "char **s", true ], - [ "const char **s", true ], - [ "char const **s", true ], - [ "char *const *s", true ], - [ "const char *const *s", true ], - [ "char const *const *s", true ], - [ "char **const s", true ], - [ "const char **const s", true ], - [ "char const **const s", true ], - [ "char *const *const s", true ], - [ "const char *const *const s", true ], - [ "char const *const *const s", true ] - ] - - truth_table.each do |entry| - assert_equal(@parser.divine_ptr(entry[0]), entry[1]) - end - end - - it "Transform inline functions doesn't change a header with no inlines" do - source = - "#ifndef _NOINCLUDES\n" + - "#define _NOINCLUDES\n" + - "#include \"unity.h\"\n" + - "#include \"cmock.h\"\n" + - "#include \"YetAnotherHeader.h\"\n" + - "\n" + - "/* Ignore the following warnings since we are copying code */\n" + - "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n" + - "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n" + - "#pragma GCC diagnostic push\n" + - "#endif\n" + - "#if !defined(__clang__)\n" + - "#pragma GCC diagnostic ignored \"-Wpragmas\"\n" + - "#endif\n" + - "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n" + - "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n" + - "#endif\n" + - "\n" + - "struct my_struct {\n" + - "int a;\n" + - "int b;\n" + - "int b;\n" + - "char c;\n" + - "};\n" + - "int my_function(int a);\n" + - "int my_better_function(struct my_struct *s);\n" + - "\n" + - "#endif _NOINCLUDES\n" - - assert_equal(source, @parser.transform_inline_functions(source)) - end - - it "Transform inline functions changes inline functions to function declarations" do - source = - "#ifndef _NOINCLUDES\n" + - "#define _NOINCLUDES\n" + - "#include \"unity.h\"\n" + - "#include \"cmock.h\"\n" + - "#include \"YetAnotherHeader.h\"\n" + - "\n" + - "/* Ignore the following warnings since we are copying code */\n" + - "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n" + - "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n" + - "#pragma GCC diagnostic push\n" + - "#endif\n" + - "#if !defined(__clang__)\n" + - "#pragma GCC diagnostic ignored \"-Wpragmas\"\n" + - "#endif\n" + - "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n" + - "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n" + - "#endif\n" + - "\n" + - "struct my_struct {\n" + - "int a;\n" + - "int b;\n" + - "int b;\n" + - "char c;\n" + - "};\n" + - "int my_function(int a);\n" + - "int my_better_function(struct my_struct *s);\n" + - "static inline int staticinlinebar(struct my_struct *s)\n" + # This is a function with a lot of indentation levels, we should be able to handle it - "{\n" + - "\t{\n" + - "\t\t{\n" + - "\t\t\treturn s->a;\n" + - "\t\t}\n" + - "\t}\n" + - "}\n" + - "static inline int staticinlinefunc(struct my_struct *s)\n" + - "{\n" + - " return s->a;\n" + - "}\n" + - "int bar(struct my_struct *s);\n" + # A normal function to screw with our parser - "inline static int inlinestaticfunc(int a) {\n" + - " return a + 42;\n" + - "}\n" + - "inline int StaticInlineFunc(struct my_struct *s)\n" + - "{\n" + - " return get_member_a(s) + 42;\n" + - "}\n" + - "int inline StaticInlineBar(struct my_struct *s)\n" + - "{\n" + - " return get_member_a(s) + 42;\n" + - "}\n" + - "struct staticinlinestruct {\n" + # Add a structure declaration between the inline functions, just to make sure we don't touch it! - "int a;\n" + - "};\n" + - "\n" + - "struct staticinlinestruct fubarstruct(struct my_struct *s);\n" + # Another normal function to screw with our parser - "static inline struct staticinlinestruct inlinefubarfunction(struct my_struct *s)\n" + - "{\n" + - " return (struct staticinlinestruct)*s;\n" + - "}\n" + - "int fubar(struct my_struct *s);\n" + # Another normal function to screw with our parser - "inline int stuff(int num)" + - "{" + - " int reg = 0x12;" + - " if (num > 0)" + - " {" + - " reg |= (0x0Eu);" + - " }" + - " else" + - " {" + - " reg |= (0x07u);" + - " }" + - " return reg;" + - "}" + - "\n" + - "int inline static dummy_func_2(int a, char b, float c) {" + # This is a sneaky one, inline static is placed AFTER the return value - " c += 3.14;" + - " b -= 32;" + - " return a + (int)(b) + (int)c;" + - "}" + - "#endif _NOINCLUDES\n" - - expected = - "#ifndef _NOINCLUDES\n" + - "#define _NOINCLUDES\n" + - "#include \"unity.h\"\n" + - "#include \"cmock.h\"\n" + - "#include \"YetAnotherHeader.h\"\n" + - "\n" + - "/* Ignore the following warnings since we are copying code */\n" + - "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n" + - "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n" + - "#pragma GCC diagnostic push\n" + - "#endif\n" + - "#if !defined(__clang__)\n" + - "#pragma GCC diagnostic ignored \"-Wpragmas\"\n" + - "#endif\n" + - "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n" + - "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n" + - "#endif\n" + - "\n" + - "struct my_struct {\n" + - "int a;\n" + - "int b;\n" + - "int b;\n" + - "char c;\n" + - "};\n" + - "int my_function(int a);\n" + - "int my_better_function(struct my_struct *s);\n" + - "int staticinlinebar(struct my_struct *s);\n" + - "int staticinlinefunc(struct my_struct *s);\n" + - "int bar(struct my_struct *s);\n" + - "int inlinestaticfunc(int a);\n" + - "int StaticInlineFunc(struct my_struct *s);\n" + - "int StaticInlineBar(struct my_struct *s);\n" + - "struct staticinlinestruct {\n" + - "int a;\n" + - "};\n" + - "\n" + - "struct staticinlinestruct fubarstruct(struct my_struct *s);\n" + - "struct staticinlinestruct inlinefubarfunction(struct my_struct *s);\n" + - "int fubar(struct my_struct *s);\n" + - "int stuff(int num);\n" + - "int dummy_func_2(int a, char b, float c);" + - "#endif _NOINCLUDES\n" - - assert_equal(expected, @parser.transform_inline_functions(source)) - end - - it "Count number of pairs of braces in function succesfully" do - source = - "int foo(struct my_struct *s)\n" + - "{\n" + - " return get_member_a(s) + 42;\n" + - "}\n" - complex_source = - "int bar(struct my_struct *s)\n" + - "{\n" + - "\tint a = 6;\n" + - "\tint res = foo(&(struct my_struct){.nr = a});\n" + - "\t{\n" + - "\t\tint a = 5;\n" + - "\t\tint res = foo(&(struct my_struct){.nr = a});\n" + - "\t\t{\n" + - "\t\t\tstruct my_struct a = {.nr = 1};\n" + - "\t\t}\n" + - "\t}\n" + - "\treturn 42;\n" + - "}\n" - - assert_equal(1, @parser.count_number_of_pairs_of_braces_in_function(source)) - assert_equal(6, @parser.count_number_of_pairs_of_braces_in_function(complex_source)) - end - - it "Count number of pairs of braces returns 0 if bad source is supplied" do - bad_source_0 = - "int foo(struct my_struct *s)\n" + - "{\n" + - " return get_member_a(s) + 42;\n" + - "\n" # Missing closing brace - bad_source_1 = - "int bar(struct my_struct *s)\n" + - "{\n" + - "\tint a = 6;\n" + - "\tint res = foo(&(struct my_struct){.nr = a});\n" + - "\t{\n" + - "\t\tint a = 5;\n" + - "\t\tint res = foo(&(struct my_struct){.nr = a});\n" + - "\t\t{\n" + - "\t\t\n" + # Missing closing brace - "\t}\n" + - "\treturn 42;\n" + - "}\n" - bad_source_2 = - "int foo(struct my_struct *s)\n" + - "\n" # No braces in source - - assert_equal(0, @parser.count_number_of_pairs_of_braces_in_function(bad_source_0)) - assert_equal(0, @parser.count_number_of_pairs_of_braces_in_function(bad_source_1)) - assert_equal(0, @parser.count_number_of_pairs_of_braces_in_function(bad_source_2)) - end - - it "handles parsing multiline functions" do - source = "int\nLaverneAndShirley(int Lenny,\n int Squiggy);\n" - expected = [{ :var_arg=>nil, - :return=> { :type => "int", - :name => 'cmock_to_return', - :ptr? => false, - :const? => false, - :const_ptr? => false, - :str => "int cmock_to_return", - :void? => false - }, - :name=>"LaverneAndShirley", - :unscoped_name=>"LaverneAndShirley", - :namespace=>[], - :class=>nil, - :modifier=>"", - :contains_ptr? => false, - :args=>[ {:type=>"int", :name=>"Lenny", :ptr? => false, :const? => false, :const_ptr? => false}, - {:type=>"int", :name=>"Squiggy", :ptr? => false, :const? => false, :const_ptr? => false} - ], - :args_string=>"int Lenny, int Squiggy", - :args_call=>"Lenny, Squiggy" - }] - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "imports C++ differently when asked" do - source = - [ - "namespace ns1 {\n", - " namespace ns2 {\n", - "\n", - " class cls1 {\n", - " public:\n", - " int f_header_impl(int a, int b){\n", - " return a + b;\n", - " }\n", - "\n", - " static void f_void();\n", - " static int f_ret_simple();\n", - "\n", - " protected:\n", - " static void protected_f_void();\n", - "\n", - " public:\n", - " private:\n", - " static void private_f_void();\n", - " }; // cls1\n", - " } // ns2\n", - "} // ns1\n" - ].join - - expected = - [ - "namespace ns1 { namespace ns2 { class cls1 { public: int f_header_impl", - "static void f_void()", - "static int f_ret_simple()", - "protected: static void protected_f_void()", - "public: private: static void private_f_void()", - "}", - "} }" - ] - - assert_equal(expected, @parser.import_source(source, cpp=true)) - refute_equal(expected, @parser.import_source(source)) - end - - # only so parse_functions does not raise an error - def dummy_source - "void dummy(void);" - end - - # Expected result of above - def dummy_func - { :name => "dummy", - :unscoped_name => "dummy", - :class => nil, - :namespace => [], - :var_arg => nil, - :args_string => "void", - :args => [], - :args_call => "", - :contains_ptr? => false, - :modifier => "", - :return => { - :type => "void", - :name => "cmock_to_return", - :str => "void cmock_to_return", - :void? => true, - :ptr? => false, - :const? => false, - :const_ptr? => false}} - end - - # Commonly used example function - def voidvoid_func(namespace=[], name="Classic_functional") - { :name => name, - :unscoped_name => "functional", - :class => "Classic", - :namespace => namespace, - :var_arg => nil, - :args_string => "void", - :args => [], - :args_call => "", - :contains_ptr? => false, - :modifier => "", - :return => { - :type=>"void", - :name=>"cmock_to_return", - :str=>"void cmock_to_return", - :void? => true, - :ptr? => false, - :const? => false, - :const_ptr? => false}} - end - - it "parses public C++ functions" do - source = dummy_source + <<~SOURCE - class Classic { - public: - static void functional(void); - }; - SOURCE - - expected = [dummy_func, voidvoid_func] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "handles a namespace" do - source = dummy_source + <<~SOURCE - namespace ns1 { - class Classic { - public: - static void functional(void); - }; - } // ns1 - SOURCE - - expected = [dummy_func, - voidvoid_func(namespace=["ns1"], name="ns1_Classic_functional")] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "handles nested namespaces" do - source = dummy_source + <<~SOURCE - namespace ns1 { - namespace ns2 { - class Classic { - public: - static void functional(void); - }; - } // ns1 - } // ns1 - SOURCE - - expected = [dummy_func, - voidvoid_func(namespace=["ns1", "ns2"], name="ns1_ns2_Classic_functional")] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "ignores non-static C++ functions" do - source = dummy_source + <<~SOURCE - class Classic { - public: - void functional(void); - }; - SOURCE - - expected = [dummy_func] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "ignores private functions" do - source = dummy_source + <<~SOURCE - class Classic { - private: - static void functional(void); - }; - SOURCE - - expected = [dummy_func] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "parses public C++ functions after private functions" do - source = dummy_source + <<~SOURCE - class Classic { - private: - static void ignoreme(void); - public: - static void functional(void); - }; - SOURCE - - expected = [dummy_func, voidvoid_func] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "ignores protected functions" do - source = dummy_source + <<~SOURCE - class Classic { - protected: - static void functional(void); - }; - SOURCE - - expected = [dummy_func] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "parses public C++ functions after protected functions" do - source = dummy_source + <<~SOURCE - class Classic { - protected: - static void ignoreme(void); - public: - static void functional(void); - }; - SOURCE - - expected = [dummy_func, voidvoid_func] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "parses multiple classes in same file with uniquely named functions" do - source = dummy_source + <<~SOURCE - namespace ns1 { - class Classic { - public: - static void functional(void); - }; - - class Classical { - public: - static int functionality(int a); - }; - } // ns1 - - class Classy { - public: - static int* func(int* a); - }; - SOURCE - - expected = [dummy_func, - voidvoid_func(["ns1"], name="ns1_Classic_functional"), - { :name => "ns1_Classical_functionality", - :unscoped_name => "functionality", - :class => "Classical", - :namespace => ["ns1"], - :var_arg => nil, - :args_string => "int a", - :args => [ - { :ptr? => false, - :const? => false, - :const_ptr? => false, - :name => "a", - :type => "int"}], - :args_call => "a", - :contains_ptr? => false, - :modifier => "", - :return => { - :type=>"int", - :name=>"cmock_to_return", - :str=>"int cmock_to_return", - :void? => false, - :ptr? => false, - :const? => false, - :const_ptr? => false}}, - { :name => "Classy_func", - :unscoped_name => "func", - :class => "Classy", - :namespace => [], - :var_arg => nil, - :args_string => "int* a", - :args => [ - { :ptr? => true, - :const? => false, - :const_ptr? => false, - :name => "a", - :type => "int*"}], - :args_call => "a", - :contains_ptr? => true, - :modifier => "", - :return => { - :type=>"int*", - :name=>"cmock_to_return", - :str=>"int* cmock_to_return", - :void? => false, - :ptr? => true, - :const? => false, - :const_ptr? => false}}] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "handles multiple classes in same file with identically named functions" do - source = dummy_source + <<~SOURCE - namespace ns1 { - class Classic { - public: - static void functional(void); - }; - - class Classical { - public: - static int functional(int a); - }; - } // ns1 - - class Classy { - public: - static int* functional(int* a); - }; - SOURCE - - expected = [dummy_func, - voidvoid_func(["ns1"], name="ns1_Classic_functional"), - { :name => "ns1_Classical_functional", - :unscoped_name => "functional", - :class => "Classical", - :namespace => ["ns1"], - :var_arg => nil, - :args_string => "int a", - :args => [ - { :ptr? => false, - :const? => false, - :const_ptr? => false, - :name => "a", - :type => "int"}], - :args_call => "a", - :contains_ptr? => false, - :modifier => "", - :return => { - :type=>"int", - :name=>"cmock_to_return", - :str=>"int cmock_to_return", - :void? => false, - :ptr? => false, - :const? => false, - :const_ptr? => false}}, - { :name => "Classy_functional", - :unscoped_name => "functional", - :class => "Classy", - :namespace => [], - :var_arg => nil, - :args_string => "int* a", - :args => [ - { :ptr? => true, - :const? => false, - :const_ptr? => false, - :name => "a", - :type => "int*"}], - :args_call => "a", - :contains_ptr? => true, - :modifier => "", - :return => { - :type=>"int*", - :name=>"cmock_to_return", - :str=>"int* cmock_to_return", - :void? => false, - :ptr? => true, - :const? => false, - :const_ptr? => false}}] - - assert_equal(expected, @parser.parse("module", source)[:functions]) - end - - it "Transform inline functions can handle inline function declarations" do - source = - "static inline int dummy_func_decl(int a, char b, float c);\n" + # First declaration - "static inline int dummy_func_decl2(int a, char b, float c)\n\n\n\n\n\n;\n" + # Second declaration with a lot of newlines before the semicolon to mess with the parser - "static inline int staticinlinefunc(struct my_struct *s)\n" + # 'normal' inline pattern - "{\n" + - " return dummy_func_decl(1, 1, 1);\n" + - "}\n" + - "struct my_struct_with_inline_in_it\n" + # struct definition in between to mess with the parser - "{\n" + - " int a;\n" + - " char b;\n" + - " float inlineb;\n" + - "};\n" + - "static inline int dummy_func_decl(int a, char b, float c) {\n" + # Second user pattern - " return 42;\n" + - "}\n" + - "\n" - - expected = - "int dummy_func_decl(int a, char b, float c);\n" + - "int dummy_func_decl2(int a, char b, float c)\n\n\n\n\n\n;\n" + # Second declaration with a lot of newlines until the semicolon to mess with the parser - "int staticinlinefunc(struct my_struct *s);\n" + - "struct my_struct_with_inline_in_it\n" + - "{\n" + - " int a;\n" + - " char b;\n" + - " float inlineb;\n" + - "};\n" + - "int dummy_func_decl(int a, char b, float c);\n" + - "\n" - - @parser.treat_inlines = :include - assert_equal(expected, @parser.transform_inline_functions(source)) - end - - it "Transform inline functions can handle header with only inline function declarations" do - source = - "static inline int dummy_func_decl(int a, char b, float c);\n" + - "\n" - - expected = - "int dummy_func_decl(int a, char b, float c);\n" + - "\n" - - @parser.treat_inlines = :include - assert_equal(expected, @parser.transform_inline_functions(source)) - end - - it "Transform inline functions takes user provided patterns into account" do - source = - "static __inline__ __attribute__ ((always_inline)) uint16_t _somefunc (uint32_t a)\n" + - "{\n" + - " return _someotherfunc (a);\n" + - "}\n" + - "static __inline__ uint16_t _somefunc_0 (uint32_t a)\n" + - "{\n" + - " return (uint16_t) a;\n" + - "}\n" + - "\n" - - expected = - "uint16_t _somefunc (uint32_t a);\n" + - "uint16_t _somefunc_0 (uint32_t a);\n" + - "\n" - - @parser.treat_inlines = :include - @parser.inline_function_patterns = ['static __inline__ __attribute__ \(\(always_inline\)\)', 'static __inline__'] - assert_equal(expected, @parser.transform_inline_functions(source)) - end - - it "Transform inline functions limits deleting user macro to actual line/word" do - source = - "#if defined (FORCE_INLINE)\n" + - "#define MY_LIBRARY_INLINE static __inline__ __attribute__ ((always_inline))\n" + - "#else\n" + - "#define MY_LIBRARY_INLINE\n" + - "#endif\n" + - "#define INLINE static __inline__ __attribute__ ((always_inline))\n" + - "#define INLINE_TWO \\\nstatic\\\ninline\n" + - "INLINE uint16_t _somefunc (uint32_t a)\n" + - "{\n" + - " return _someotherfunc (a);\n" + - "}\n" + - "static __inline__ uint16_t _somefunc_0 (uint32_t a)\n" + - "{\n" + - " return (uint16_t) a;\n" + - "}\n" + - "static __inline__ __attribute__ \(\(always_inline\)\) uint16_t _somefunc_1 (uint32_t a)\n" + - "{\n" + - " return (uint16_t) a;\n" + - "}\n" + - "INLINE_TWO uint16_t _somefunc_2(uint32_t a)\n" + - "{\n" + - " return (uint16_t) a;\n" + - "}\n" + - "#define INLINE_THREE \\\nstatic\\\ninline" - - expected = - "#if defined (FORCE_INLINE)\n" + - "#else\n" + - "#endif\n" + - "uint16_t _somefunc (uint32_t a);\n" + - "uint16_t _somefunc_0 (uint32_t a);\n" + - "uint16_t _somefunc_1 (uint32_t a);\n" + - "uint16_t _somefunc_2(uint32_t a);\n" - - @parser.treat_inlines = :include - @parser.inline_function_patterns = ['MY_LIBRARY_INLINE', 'INLINE_THREE', 'INLINE_TWO', 'INLINE', 'static __inline__ __attribute__ \(\(always_inline\)\)', 'static __inline__'] - assert_equal(expected, @parser.transform_inline_functions(source)) - end - -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_plugin_manager_test.rb b/components/testframework/libs/cmock/test/unit/cmock_plugin_manager_test.rb deleted file mode 100644 index f9f0e640c..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_plugin_manager_test.rb +++ /dev/null @@ -1,100 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_plugin_manager' -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect' -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_ignore' -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_cexception' - -describe CMockPluginManager, "Verify CMockPluginManager Module" do - - before do - create_mocks :utils, :pluginA, :pluginB - @config = create_stub( - :respond_to => true, - :when_ptr => :compare_data, - :enforce_strict_ordering => false, - :ignore => :args_and_calls - ) - - def @config.plugins - if instance_variable_defined?(:@plugins) - @plugins || [] - else - [] - end - end - - def @config.plugins=(val) - @plugins = val - end - end - - after do - end - - it "return all plugins by default" do - @config.plugins = ['cexception','ignore'] - @utils.expect :helpers, {} - - @cmock_plugins = CMockPluginManager.new(@config, @utils) - - test_plugins = @cmock_plugins.plugins - contained = { :expect => false, :ignore => false, :cexception => false } - test_plugins.each do |plugin| - contained[:expect] = true if plugin.instance_of?(CMockGeneratorPluginExpect) - contained[:ignore] = true if plugin.instance_of?(CMockGeneratorPluginIgnore) - contained[:cexception] = true if plugin.instance_of?(CMockGeneratorPluginCexception) - end - assert_equal(true, contained[:expect]) - assert_equal(true, contained[:ignore]) - assert_equal(true, contained[:cexception]) - end - - it "return restricted plugins based on config" do - @utils.expect :helpers, {} - - @cmock_plugins = CMockPluginManager.new(@config, @utils) - - test_plugins = @cmock_plugins.plugins - contained = { :expect => false, :ignore => false, :cexception => false } - test_plugins.each do |plugin| - contained[:expect] = true if plugin.instance_of?(CMockGeneratorPluginExpect) - contained[:ignore] = true if plugin.instance_of?(CMockGeneratorPluginIgnore) - contained[:cexception] = true if plugin.instance_of?(CMockGeneratorPluginCexception) - end - assert_equal(true, contained[:expect]) - assert_equal(false,contained[:ignore]) - assert_equal(false,contained[:cexception]) - end - - it "run a desired method over each plugin requested and return the results" do - @utils.expect :helpers, {} - @cmock_plugins = CMockPluginManager.new(@config, @utils) - - @pluginA = create_stub(:test_method => ["This Is An Awesome Test-"]) - @pluginB = create_stub(:test_method => ["And This is Part 2-","Of An Awesome Test"]) - @cmock_plugins.plugins = [@pluginA, @pluginB] - - expected = "This Is An Awesome Test-And This is Part 2-Of An Awesome Test" - output = @cmock_plugins.run(:test_method) - assert_equal(expected, output) - end - - it "run a desired method and arg list over each plugin requested and return the results" do - @utils.expect :helpers, {} - @cmock_plugins = CMockPluginManager.new(@config, @utils) - - @pluginA = create_stub(:test_method => ["This Is An Awesome Test-"]) - @pluginB = create_stub(:test_method => ["And This is Part 2-","Of An Awesome Test"]) - @cmock_plugins.plugins = [@pluginA, @pluginB] - - expected = "This Is An Awesome Test-And This is Part 2-Of An Awesome Test" - output = @cmock_plugins.run(:test_method, "chickenpotpie") - assert_equal(expected, output) - end -end diff --git a/components/testframework/libs/cmock/test/unit/cmock_unityhelper_parser_test.rb b/components/testframework/libs/cmock/test/unit/cmock_unityhelper_parser_test.rb deleted file mode 100644 index 987b0d697..000000000 --- a/components/testframework/libs/cmock/test/unit/cmock_unityhelper_parser_test.rb +++ /dev/null @@ -1,223 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" -require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_unityhelper_parser' - -describe CMockUnityHelperParser, "Verify CMockUnityHelperParser Module" do - - before do - create_mocks :config - end - - after do - end - - it "ignore lines that are commented out" do - source = - " abcd;\n" + - "// #define UNITY_TEST_ASSERT_EQUAL_CHICKENS(a,b,line,msg) {...};\n" + - "or maybe // #define UNITY_TEST_ASSERT_EQUAL_CHICKENS(a,b,line,msg) {...};\n\n" - @config.expect :plugins, [] #not :array - @config.expect :treat_as, {} - @config.expect :load_unity_helper, source - @parser = CMockUnityHelperParser.new(@config) - expected = {} - - assert_equal(expected, @parser.c_types) - end - - it "ignore stuff in block comments" do - source = - " abcd; /*\n" + - "#define UNITY_TEST_ASSERT_EQUAL_CHICKENS(a,b,line,msg) {...};\n" + - "#define UNITY_TEST_ASSERT_EQUAL_CHICKENS(a,b,line,msg) {...};\n */\n" - @config.expect :plugins, [] #not :array - @config.expect :treat_as, {} - @config.expect :load_unity_helper, source - @parser = CMockUnityHelperParser.new(@config) - expected = {} - - assert_equal(expected, @parser.c_types) - end - - it "notice equal helpers in the proper form and ignore others" do - source = - "abcd;\n" + - "#define UNITY_TEST_ASSERT_EQUAL_TURKEYS_T(a,b,line,msg) {...};\n" + - "abcd;\n" + - "#define UNITY_TEST_ASSERT_EQUAL_WRONG_NUM_ARGS(a,b,c,d,e) {...};\n" + - "#define UNITY_TEST_ASSERT_WRONG_NAME_EQUAL(a,b,c,d) {...};\n" + - "#define UNITY_TEST_ASSERT_EQUAL_unsigned_funky_rabbits(a,b,c,d) {...};\n" + - "abcd;\n" - @config.expect :plugins, [] #not :array - @config.expect :treat_as, {} - @config.expect :load_unity_helper, source - @parser = CMockUnityHelperParser.new(@config) - expected = { - 'TURKEYS_T' => "UNITY_TEST_ASSERT_EQUAL_TURKEYS_T", - 'unsigned_funky_rabbits' => "UNITY_TEST_ASSERT_EQUAL_unsigned_funky_rabbits" - } - - assert_equal(expected, @parser.c_types) - end - - it "notice equal helpers that contain arrays" do - source = - "abcd;\n" + - "#define UNITY_TEST_ASSERT_EQUAL_TURKEYS_ARRAY(a,b,c,d,e) {...};\n" + - "abcd;\n" + - "#define UNITY_TEST_ASSERT_EQUAL_WRONG_NUM_ARGS_ARRAY(a,b,c,d,e,f) {...};\n" + - "#define UNITY_TEST_ASSERT_WRONG_NAME_EQUAL_ARRAY(a,b,c,d,e) {...};\n" + - "#define UNITY_TEST_ASSERT_EQUAL_unsigned_funky_rabbits_ARRAY(a,b,c,d,e) {...};\n" + - "abcd;\n" - @config.expect :plugins, [] #not :array - @config.expect :treat_as, {} - @config.expect :load_unity_helper, source - @parser = CMockUnityHelperParser.new(@config) - expected = { - 'TURKEYS*' => "UNITY_TEST_ASSERT_EQUAL_TURKEYS_ARRAY", - 'unsigned_funky_rabbits*' => "UNITY_TEST_ASSERT_EQUAL_unsigned_funky_rabbits_ARRAY" - } - - assert_equal(expected, @parser.c_types) - end - - it "pull in the standard set of helpers and add them to my list" do - pairs = { - "UINT" => "HEX32", - "unsigned long" => "HEX64", - } - expected = { - "UINT" => "UNITY_TEST_ASSERT_EQUAL_HEX32", - "unsigned_long" => "UNITY_TEST_ASSERT_EQUAL_HEX64", - "UINT*" => "UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY", - "unsigned_long*"=> "UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY", - } - @config.expect :plugins, [] #not :array - @config.expect :treat_as, pairs - @config.expect :load_unity_helper, nil - @parser = CMockUnityHelperParser.new(@config) - - assert_equal(expected, @parser.c_types) - end - - it "pull in the user specified set of helpers and add them to my list" do - pairs = { - "char*" => "STRING", - "unsigned int" => "HEX32", - } - expected = { - "char*" => "UNITY_TEST_ASSERT_EQUAL_STRING", - "unsigned_int" => "UNITY_TEST_ASSERT_EQUAL_HEX32", - "char**" => "UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY", - "unsigned_int*" => "UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY", - } - @config.expect :plugins, [] #not :array - @config.expect :treat_as, pairs - @config.expect :load_unity_helper, nil - @parser = CMockUnityHelperParser.new(@config) - - assert_equal(expected, @parser.c_types) - end - - it "be able to fetch helpers on my list" do - @config.expect :plugins, [] #not :array - @config.expect :treat_as, {} - @config.expect :load_unity_helper, "" - @parser = CMockUnityHelperParser.new(@config) - @parser.c_types = { - 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", - 'UINT16*' => "UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY", - 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", - 'LONG_LONG' => "UNITY_TEST_ASSERT_EQUAL_LONG_LONG" - } - - [["UINT8","UINT8"], - ["UINT16*","UINT16_ARRAY"], - ["const SPINACH","SPINACH"], - ["LONG LONG","LONG_LONG"] ].each do |ctype, exptype| - assert_equal(["UNITY_TEST_ASSERT_EQUAL_#{exptype}",''], @parser.get_helper(ctype)) - end - end - - it "return memory comparison when asked to fetch helper of types not on my list" do - @config.expect :plugins, [] #not :array - @config.expect :treat_as, {} - @config.expect :load_unity_helper, "" - @parser = CMockUnityHelperParser.new(@config) - @parser.c_types = { - 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", - 'UINT16*' => "UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY", - 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", - } - - ["UINT32","SPINACH_T","SALAD","PINEAPPLE"].each do |ctype| - @config.expect :memcmp_if_unknown, true - assert_equal(["UNITY_TEST_ASSERT_EQUAL_MEMORY",'&'], @parser.get_helper(ctype)) - end - end - - it "return memory array comparison when asked to fetch helper of types not on my list" do - @config.expect :plugins, [:array] - @config.expect :treat_as, {} - @config.expect :load_unity_helper, "" - @parser = CMockUnityHelperParser.new(@config) - @parser.c_types = { - 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", - 'UINT16*' => "UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY", - 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", - } - - ["UINT32*","SPINACH_T*"].each do |ctype| - @config.expect :memcmp_if_unknown, true - assert_equal(["UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY",''], @parser.get_helper(ctype)) - end - end - - it "return the array handler if we cannot find the normal handler" do - @config.expect :plugins, [] #not :array - @config.expect :treat_as, {} - @config.expect :load_unity_helper, "" - @parser = CMockUnityHelperParser.new(@config) - @parser.c_types = { - 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", - 'UINT16*' => "UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY", - 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", - } - - assert_equal(["UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY",'&'], @parser.get_helper("UINT16")) - end - - it "return the normal handler if we cannot find the array handler" do - @config.expect :plugins, [] #not :array - @config.expect :treat_as, {} - @config.expect :load_unity_helper, "" - @parser = CMockUnityHelperParser.new(@config) - @parser.c_types = { - 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", - 'UINT16' => "UNITY_TEST_ASSERT_EQUAL_UINT16", - 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", - } - - assert_equal(["UNITY_TEST_ASSERT_EQUAL_UINT8",'*'], @parser.get_helper("UINT8*")) - end - - it "raise error when asked to fetch helper of type not on my list and not allowed to mem check" do - @config.expect :plugins, [] #not :array - @config.expect :treat_as, {} - @config.expect :load_unity_helper, "" - @config.expect :memcmp_if_unknown, false - @parser = CMockUnityHelperParser.new(@config) - @parser.c_types = { - 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", - 'UINT32*' => "UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY", - 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", - } - - assert_raises (RuntimeError) { @parser.get_helper("UINT16") } - end -end diff --git a/components/testframework/libs/cmock/vendor/behaviors/Manifest.txt b/components/testframework/libs/cmock/vendor/behaviors/Manifest.txt deleted file mode 100644 index 6c954ecce..000000000 --- a/components/testframework/libs/cmock/vendor/behaviors/Manifest.txt +++ /dev/null @@ -1,9 +0,0 @@ -Manifest.txt -Rakefile -lib/behaviors.rb -lib/behaviors/reporttask.rb -test/behaviors_tasks_test.rb -test/behaviors_test.rb -test/tasks_test/lib/user.rb -test/tasks_test/Rakefile -test/tasks_test/test/user_test.rb diff --git a/components/testframework/libs/cmock/vendor/behaviors/Rakefile b/components/testframework/libs/cmock/vendor/behaviors/Rakefile deleted file mode 100644 index d4d68b995..000000000 --- a/components/testframework/libs/cmock/vendor/behaviors/Rakefile +++ /dev/null @@ -1,19 +0,0 @@ -require 'rake' -require 'rubygems' -require 'hoe' - -Hoe.new('behaviors','1.0.3') do |p| - p.author = "Atomic Object LLC" - p.email = "dev@atomicobject.com" - p.url = "http://behaviors.rubyforge.org" - p.summary = "behavior-driven unit test helper" - p.description = <<-EOS -Behaviors allows for Test::Unit test case methods to be defined as -human-readable descriptions of program behavior. It also provides -Rake tasks to list the behaviors of your project. - EOS - p.test_globs = ['test/*_test.rb'] - - p.changes = <<-EOS - EOS -end diff --git a/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors.rb b/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors.rb deleted file mode 100644 index d8d70f704..000000000 --- a/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin rdoc -= Usage -Behaviors provides a single method: should. - -Instead of naming test methods like: - - def test_something - end - -You declare test methods like: - - should "perform action" do - end - -You may omit the body of a should method to describe unimplemented behavior. - - should "perform other action" - -When you run your unit tests, empty should methods will appear as an 'UNIMPLEMENTED CASE' along with the described behavior. -This is useful for sketching out planned behavior quickly. - -Simply extend Behaviors in your TestCase to start using behaviors. - - require 'test/unit' - require 'behaviors' - require 'user' - - class UserTest < Test::Unit::TestCase - extend Behaviors - ... - end - -= Motivation -Test methods typically focus on the name of the method under test instead of its behavior. -Creating test methods with should statements focuses on the behavior of an object. -This helps you to think about the role of the object under test. - -Using a behavior-driven approach prevents the danger in assuming a one-to-one mapping of method names to -test method names. -As always, you get the most value by writing the tests first. - -For a more complete BDD framework, try RSpec http://rspec.rubyforge.org/ - -= Rake tasks - -You can define a Behaviors::ReportTask in your Rakefile to generate rake tasks that -summarize the behavior of your project. - -These tasks are named behaviors and behaviors_html. They will output to the -console or an html file in the doc directory with a list all of your should tests. - Behaviors::ReportTask.new do |t| - t.pattern = 'test/**/*_test.rb' - end - -You may also initialize the ReportTask with a custom name to associate with a particular suite of tests. - Behaviors::ReportTask.new(:widget_subsystem) do |t| - t.pattern = 'test/widgets/*_test.rb' - end - -The html report will be placed in the doc directory by default. -You can override this default by setting the html_dir in the ReportTask. - Behaviors::ReportTask.new do |t| - t.pattern = 'test/**/*_test.rb' - t.html_dir = 'behaviors_html_reports' - end -=end -module Behaviors - def should(behave,&block) - mname = "test_should_#{behave}" - if block - define_method mname, &block - else - puts ">>> UNIMPLEMENTED CASE: #{name.sub(/Test$/,'')} should #{behave}" - end - end -end diff --git a/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors/reporttask.rb b/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors/reporttask.rb deleted file mode 100644 index 51c0eca09..000000000 --- a/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors/reporttask.rb +++ /dev/null @@ -1,158 +0,0 @@ -require 'rake' -require 'rake/tasklib' - -module Behaviors -include Rake - - class ReportTask < TaskLib - attr_accessor :pattern - attr_accessor :html_dir - - def initialize(name=:behaviors) - @name = name - @html_dir = 'doc' - yield self if block_given? - define - end - - def define - desc "List behavioral definitions for the classes specified (use for= to further limit files included in report)" - task @name do - specifications.each do |spec| - puts "#{spec.name} should:\n" - spec.requirements.each do |req| - puts " - #{req}" - end - end - end - - desc "Generate html report of behavioral definitions for the classes specified (use for= to further limit files included in report)" - task "#{@name}_html" do - require 'erb' - txt =<<-EOS - - - - - -
Specifications
-<% specifications.each do |spec| %> -
-<%= spec.name %> should: -
    -<% spec.requirements.each do |req| %> -
  • <%= req %>
  • -<% end %> -
-
-<% end %> - - - EOS - output_dir = File.expand_path(@html_dir) - mkdir_p output_dir - output_filename = output_dir + "/behaviors.html" - File.open(output_filename,"w") do |f| - f.write ERB.new(txt).result(binding) - end - puts "(Wrote #{output_filename})" - end - end - - private - def test_files - test_list = FileList[@pattern] - if ENV['for'] - test_list = test_list.grep(/#{ENV['for']}/i) - end - test_list - end - - def specifications - test_files.map do |file| - spec = OpenStruct.new - m = %r".*/([^/].*)_test.rb".match(file) - class_name = titleize(m[1]) if m[1] - spec.name = class_name - spec.requirements = [] - File::readlines(file).each do |line| - if line =~ /^\s*should\s+\(?\s*["'](.*)["']/ - spec.requirements << $1 - end - end - spec - end - end - - ############################################################ - # STOLEN FROM inflector.rb - ############################################################ - #-- - # Copyright (c) 2005 David Heinemeier Hansson - # - # 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. - #++ - def titleize(word) - humanize(underscore(word)).gsub(/\b([a-z])/) { $1.capitalize } - end - - def underscore(camel_cased_word) camel_cased_word.to_s.gsub(/::/, '/'). - gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').tr("-", "_").downcase - end - - def humanize(lower_case_and_underscored_word) - lower_case_and_underscored_word.to_s.gsub(/_id$/, "").gsub(/_/, " ").capitalize - end - - end -end diff --git a/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_tasks_test.rb b/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_tasks_test.rb deleted file mode 100644 index 9382e0737..000000000 --- a/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_tasks_test.rb +++ /dev/null @@ -1,73 +0,0 @@ -require 'test/unit' -require 'fileutils' - -class BehaviorsTasksTest < Test::Unit::TestCase - include FileUtils - - def setup - @here = File.expand_path(File.dirname(__FILE__)) - @base_cmd = RUBY_PLATFORM[/mswin/] ? 'rake.cmd ' : 'rake ' - end - - # - # HELPERS - # - def run_behaviors_task - run_cmd "behaviors" - end - - def run_behaviors_html_task - run_cmd "behaviors_html" - end - - def run_cmd(cmd) - cd "#{@here}/tasks_test" do - @report = %x[ #{@base_cmd} #{cmd} ] - end - end - - def see_html_task_output_message - @html_output_filename = "#{@here}/tasks_test/behaviors_doc/behaviors.html" - assert_match(/Wrote #{@html_output_filename}/, @report) - end - - def see_that_html_report_file_exits - assert File.exists?(@html_output_filename), "html output file should exist" - end - - def html_report_file_should_contain(user_behaviors) - file_contents = File.read(@html_output_filename) - user_behaviors.each do |line| - assert_match(/#{line}/, file_contents) - end - rm_rf File.dirname(@html_output_filename) - end - - # - # TESTS - # - def test_that_behaviors_tasks_should_list_behavioral_definitions_for_the_classes_under_test - run_behaviors_task - user_behaviors = [ - "User should:", - " - be able set user name and age during construction", - " - be able to get user name and age", - " - be able to ask if a user is an adult" - ] - assert_match(/#{user_behaviors.join("\n")}/, @report) - end - - def test_that_behaviors_tasks_should_list_behavioral_definitions_for_the_classes_under_test_in_html_output - run_behaviors_html_task - see_html_task_output_message - see_that_html_report_file_exits - user_behaviors = [ - "User should:", - "be able set user name and age during construction", - "be able to get user name and age", - "be able to ask if a user is an adult" - ] - html_report_file_should_contain user_behaviors - end - -end diff --git a/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_test.rb b/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_test.rb deleted file mode 100644 index fd0a77fcb..000000000 --- a/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_test.rb +++ /dev/null @@ -1,50 +0,0 @@ -require 'test/unit' -require File.expand_path(File.dirname(__FILE__)) + '/../lib/behaviors' -require 'stringio' - -loading_developer_test_class_stdout = StringIO.new -saved_stdout = $stdout.dup -$stdout = loading_developer_test_class_stdout - -class DeveloperTest - extend Behaviors - attr_accessor :flunk_msg, :tested_code - - should "test their code" do - @tested_code = true - end - should "go to meetings" -end - -$stdout = saved_stdout -loading_developer_test_class_stdout.rewind -$loading_developer_test_class_output = loading_developer_test_class_stdout.read - -class BehaviorsTest < Test::Unit::TestCase - - - def setup - @target = DeveloperTest.new - assert_nil @target.tested_code, "block called too early" - end - - # - # TESTS - # - def test_should_called_with_a_block_defines_a_test - assert @target.methods.include?("test_should_test their code"), "Missing test method" - - @target.send("test_should_test their code") - - assert @target.tested_code, "block not called" - end - - def test_should_called_without_a_block_does_not_create_a_test_method - assert !@target.methods.include?("test_should_go to meetings"), "Should not have method" - end - - def test_should_called_without_a_block_will_give_unimplemented_output_when_class_loads - unimplemented_output = "UNIMPLEMENTED CASE: Developer should go to meetings" - assert_match(/#{unimplemented_output}/, $loading_developer_test_class_output) - end -end diff --git a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/Rakefile b/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/Rakefile deleted file mode 100644 index ba71f715f..000000000 --- a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/Rakefile +++ /dev/null @@ -1,19 +0,0 @@ -require 'rake' -require 'rake/testtask' - -here = File.expand_path(File.dirname(__FILE__)) -require "#{here}/../../lib/behaviors/reporttask" - -desc 'Default: run unit tests.' -task :default => :test - -Rake::TestTask.new(:test) do |t| - t.libs << "#{here}/../../lib" - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -Behaviors::ReportTask.new(:behaviors) do |t| - t.pattern = 'test/**/*_test.rb' - t.html_dir = 'behaviors_doc' -end diff --git a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/lib/user.rb b/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/lib/user.rb deleted file mode 100644 index 40bc07ce4..000000000 --- a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/lib/user.rb +++ /dev/null @@ -1,2 +0,0 @@ -class User -end diff --git a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/test/user_test.rb b/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/test/user_test.rb deleted file mode 100644 index ad3cd1b33..000000000 --- a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/test/user_test.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'test/unit' -require 'behaviors' - -require 'user' - -class UserTest < Test::Unit::TestCase - extend Behaviors - - def setup - end - - should "be able set user name and age during construction" - should "be able to get user name and age" - should "be able to ask if a user is an adult" - def test_DELETEME - end -end diff --git a/components/testframework/libs/cmock/vendor/c_exception/.travis.yml b/components/testframework/libs/cmock/vendor/c_exception/.travis.yml deleted file mode 100644 index ac313a624..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -sudo: required -language: ruby c - -os: - - linux - -rvm: - - "2.3" - - "2.4" - - "2.6" - -install: - - gem install ceedling - -script: - - ceedling clobber test:all diff --git a/components/testframework/libs/cmock/vendor/c_exception/Gemfile b/components/testframework/libs/cmock/vendor/c_exception/Gemfile deleted file mode 100644 index 0ab41bb5e..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source "http://rubygems.org/" - -gem "rake" -gem "test-unit", "~> 2.4" diff --git a/components/testframework/libs/cmock/vendor/c_exception/Gemfile.lock b/components/testframework/libs/cmock/vendor/c_exception/Gemfile.lock deleted file mode 100644 index 862214260..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/Gemfile.lock +++ /dev/null @@ -1,12 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - rake (12.3.3) - test-unit (2.5.5) - -PLATFORMS - ruby - -DEPENDENCIES - rake - test-unit (~> 2.4) diff --git a/components/testframework/libs/cmock/vendor/c_exception/README.md b/components/testframework/libs/cmock/vendor/c_exception/README.md deleted file mode 100644 index 53e52ea63..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/README.md +++ /dev/null @@ -1,249 +0,0 @@ -CException - Lightweight exception library for C -================================================ - -[![CException Build Status](https://api.travis-ci.org/ThrowTheSwitch/CException.png?branch=master)](https://travis-ci.org/ThrowTheSwitch/CException) - -_This Documentation Is Released Under a Creative Commons 3.0 Attribution Share-Alike License_ - -CException is simple exception handling in C. It is significantly faster than full-blown C++ exception handling -but loses some flexibility. It is portable to any platform supporting `setjmp`/`longjmp`. - -Getting Started -================ - -The simplest way to get started is to just grab the code and pull it into your project: - -``` -git clone https://github.com/throwtheswitch/cexception.git -``` - -If you want to contribute to this project, you'll also need to have Ruby and Ceedling installed to run the unit tests. - -Usage -===== - -### So what's it good for? - -Mostly error handling. Passing errors down a long chain of function calls gets ugly. Sometimes really ugly. -So what if you could just specify certain places where you want to handle errors, and all your errors were -transferred there? Let's try a lame example: - -CException uses C standard library functions setjmp and longjmp to operate. As long as the target system -has these two functions defined, this library should be useable with very little configuration. It even -supports environments where multiple program flows are in use, such as real-time operating systems... -we started this project for use in embedded systems... but it obviously can be used for larger systems too. - -### Error Handling with CException: - -``` -void functionC(void) { - //do some stuff - if (there_was_a_problem) - Throw(ERR_BAD_BREATH); - //this stuff never gets called because of error -} -``` - -There are about a gajillion exception frameworks using a similar setjmp/longjmp method out there... and there -will probably be more in the future. Unfortunately, when we started our last embedded project, all those that -existed either (a) did not support multiple tasks (therefore multiple stacks) or (b) were way more complex -than we really wanted. CException was born. - -Why? -==== - -### It's ANSI C - -...and it beats passing error codes around. - -### You want something simple... - -CException throws a single id. You can define those ID's to be whatever you like. -You might even choose which type that number is for your project. But that's as far as it goes. We weren't interested -in passing objects or structs or strings... just simple error codes. Fast. Easy to Use. Easy to Understand. - -### Performance... - -CException can be configured for single tasking or multitasking. In single tasking, there is -very little overhead past the setjmp/longjmp calls (which are already fast). In multitasking, your only additional -overhead is the time it takes you to determine a unique task id (0 to num_tasks). - -How? -==== - -Code that is to be protected are wrapped in `Try { }` blocks. The code inside the Try block is _protected_, -meaning that if any Throws occur, program control is directly transferred to the start of the Catch block. -The Catch block immediately follows the Try block. It's ignored if no errors have occurred. - -A numerical exception ID is included with Throw, and is passed into the Catch block. This allows you to handle -errors differently or to report which error has occurred... or maybe it just makes debugging easier so you -know where the problem was Thrown. - -Throws can occur from anywhere inside the Try block, directly in the function you're testing or even within -function calls (nested as deeply as you like). There can be as many Throws as you like, just remember that -execution of the guts of your Try block ends as soon as the first Throw is triggered. Once you throw, you're -transferred to the Catch block. A silly example: - -``` -void SillyExampleWhichPrintsZeroThroughFive(void) { - CEXCEPTION_T e; - int i; - while (i = 0; i < 6; i++) { - Try { - Throw(i); - //This spot is never reached - } - Catch(e) { - printf(“%i “, e); - } - } -} -``` - -Limitations -=========== - -This library was made to be as fast as possible, and provide basic exception handling. It is not a full-blown -exception library like C++. Because of this, there are a few limitations that should be observed in order to -successfully utilize this library: - -### Return & Goto - -Do not directly `return` from within a `Try` block, nor `goto` into or out of a `Try` block. -The `Try` macro allocates some local memory and alters a global pointer. These are cleaned up at the -top of the `Catch` macro. Gotos and returns would bypass some of these steps, resulting in memory leaks -or unpredictable behavior. - -### Local Variables - -If (a) you change local (stack) variables within your `Try` block, and (b) wish to make use of the updated -values after an exception is thrown, those variables should be made `volatile`. - -Note that this is ONLY for locals and ONLY when you need access to them after a `Throw`. - -Compilers optimize (and thank goodness they do). There is no way to guarantee that the actual memory -location was updated and not just a register unless the variable is marked volatile. - -### Memory Management - -Memory which is `malloc`'d within a `Try` block is not automatically released when an error is thrown. This -will sometimes be desirable, and othertimes may not. It will be the responsibility of the code you put in -the `Catch` block to perform this kind of cleanup. - -There's just no easy way to track `malloc`'d memory, etc., without replacing or wrapping `malloc` -calls or something like that. This is a lightweight framework, so these options were not desirable. - -CException API -============== - -### `Try { ... }` - -`Try` is a macro which starts a protected block. It MUST be followed by a pair of braces or a single -protected line (similar to an 'if'), enclosing the data that is to be protected. It MUST be followed by -a `Catch` block (don't worry, you'll get compiler errors to let you know if you mess any of that up). - -The `Try` block is your protected block. It contains your main program flow, where you can ignore errors -(other than a quick `Throw` call). You may nest multiple `Try` blocks if you want to handle errors at -multiple levels, and you can even rethrow an error from within a nested `Catch`. - -### `Catch(e) { }` - -`Catch` is a macro which ends the `Try` block and starts the error handling block. The `Catch` block -is executed if and only if an exception was thrown while within the `Try` block. This error was thrown -by a `Throw` call somewhere within `Try` (or within a function called within `Try`, or a function called -by a function called within `Try`... you get the idea.). - -`Catch` receives a single id of type `CEXCEPTION_T` which you can ignore or use to handle the error in -some way. You may throw errors from within Catches, but they will be caught by a `Try` wrapping the `Catch`, -not the one immediately preceeding. - -### `Throw(e)` - -`Throw` is the method used to throw an error. `Throw`s should only occur from within a protected -(`Try`...`Catch`) block, though it may easily be nested many function calls deep without an impact -on performance or functionality. `Throw` takes a single argument, which is an exception id which will be - passed to `Catch` as the reason for the error. If you wish to _re-throw_ an error, this can be done by -calling `Throw(e)` with the error code you just caught. It _IS_ valid to throw from a `Catch` block. - -### `ExitTry()` - -`ExitTry` is a method used to immediately exit your current Try block but NOT treat this as an error. Don't -run the Catch. Just start executing from after the Catch as if nothing had happened. - -Configuration -============= - -CException is a mostly portable library. It has one universal dependency, plus some macros which are required if -working in a multi-tasking environment. - -The standard C library setjmp must be available. Since this is part of the standard library, it's all good. - -If working in a multitasking environment, you need a stack frame for each task. Therefore, you must define -methods for obtaining an index into an array of frames and to get the overall number of id's are required. If -the OS supports a method to retrieve task ID's, and those tasks are number 0, 1, 2... you are in an ideal -situation. Otherwise, a more creative mapping function may be required. Note that this function is likely to -be called twice for each protected block and once during a throw. This is the only added overhead in the system. - -You have options for configuring the library, if the defaults aren't good enough for you. You can add defines -at the command prompt directly. You can always include a configuration file before including `CException.h`. -You can make sure `CEXCEPTION_USE_CONFIG_FILE` is defined, which will force make CException look for -`CExceptionConfig.h`, where you can define whatever you like. However you do it, you can override any or -all of the following: - -### `CEXCEPTION_T` - -Set this to the type you want your exception id's to be. Defaults to an 'unsigned int'. - -### `CEXCEPTION_NONE` - -Set this to a number which will never be an exception id in your system. Defaults to `0x5a5a5a5a`. - -### `CEXCEPTION_GET_ID` - -If in a multi-tasking environment, this should be set to be a call to the function described in #2 above. -It defaults to just return 0 all the time (good for single tasking environments, not so good otherwise). - -### `CEXCEPTION_NUM_ID` - -If in a multi-tasking environment, this should be set to the number of ID's required (usually the number -of tasks in the system). Defaults to 1 (good for single tasking environments or systems where you will only -use this from one task). - -### `CEXCEPTION_NO_CATCH_HANDLER (id)` - -This macro can be optionally specified. It allows you to specify code to be called when a Throw is made -outside of Try...Catch protection. Consider this the emergency fallback plan for when something has gone -terribly wrong. - -### And More! - -You may also want to include any header files which will commonly be needed by the rest of your application -where it uses exception handling here. For example, OS header files or exception codes would be useful. - -Finally, there are some hook macros which you can implement to inject your own target-specific code in -particular places. It is a rare instance where you will need these, but they are here if you need them: - -* `CEXCEPTION_HOOK_START_TRY` - called immediately before the Try block -* `CEXCEPTION_HOOK_HAPPY_TRY` - called immediately after the Try block if no exception was thrown -* `CEXCEPTION_HOOK_AFTER_TRY` - called immediately after the Try block OR before an exception is caught -* `CEXCEPTION_HOOK_START_CATCH` - called immediately before the catch - -Testing -======= - -If you want to validate that CException works with your tools or that it works with your custom -configuration, you may want to run the included test suite. This is the test suite (along with real -projects we've used it on) that we use to make sure that things actually work the way we claim. -The test suite makes use of Ceedling, which uses the Unity Test Framework. It will require a native C compiler. -The example makefile and rakefile both use gcc. - -License -======= - -*This software is licensed under the MIT License: -Copyright (c) 2007-2019 Mark VanderVoord* - -*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._* diff --git a/components/testframework/libs/cmock/vendor/c_exception/docs/CException.md b/components/testframework/libs/cmock/vendor/c_exception/docs/CException.md deleted file mode 100644 index bfda613d6..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/docs/CException.md +++ /dev/null @@ -1,332 +0,0 @@ - -CException -========== - -CException is a basic exception framework for C, suitable for use in -embedded applications. It provides an exception framework similar in -use to C++, but with much less overhead. - - -CException uses C standard library functions `setjmp` and `longjmp` to -operate. As long as the target system has these two functions defined, -this library should be useable with very little configuration. It -even supports environments where multiple program flows are in use, -such as real-time operating systems. - - -There are about a gabillion exception frameworks using a similar -setjmp/longjmp method out there... and there will probably be more -in the future. Unfortunately, when we started our last embedded -project, all those that existed either (a) did not support multiple -tasks (therefore multiple stacks) or (b) were way more complex than -we really wanted. CException was born. - - -*Why use CException?* - - -0. It's ANSI C, and it beats passing error codes around. -1. You want something simple... CException throws a single id. You can - define those ID's to be whatever you like. You might even choose which - type that number is for your project. But that's as far as it goes. - We weren't interested in passing objects or structs or strings... - just simple error codes. -2. Performance... CException can be configured for single tasking or - multitasking. In single tasking, there is very little overhead past - the setjmp/longjmp calls (which are already fast). In multitasking, - your only additional overhead is the time it takes you to determine - a unique task id 0 - num_tasks. - - -For the latest version, go to [ThrowTheSwitch.org](http://throwtheswitch.org) - - -CONTENTS OF THIS DOCUMENT -========================= - -* Usage -* Limitations -* API -* Configuration -* Testing -* License - - -Usage ------ - -Code that is to be protected are wrapped in `Try { } Catch { }` blocks. -The code directly following the Try call is "protected", meaning that -if any Throws occur, program control is directly transferred to the -start of the Catch block. - - -A numerical exception ID is included with Throw, and is made accessible -from the Catch block. - - -Throws can occur from within function calls (nested as deeply as you -like) or directly from within the function itself. - - - -Limitations ------------ - - -This library was made to be as fast as possible, and provide basic -exception handling. It is not a full-blown exception library. Because -of this, there are a few limitations that should be observed in order -to successfully utilize this library: - -1. Do not directly "return" from within a `Try` block, nor `goto` - into or out of a `Try` block. - - *Why?* - - The `Try` macro allocates some local memory and alters a global - pointer. These are cleaned up at the top of the `Catch` macro. - Gotos and returns would bypass some of these steps, resulting in - memory leaks or unpredictable behavior. - - -2. If (a) you change local (stack) variables within your `Try` block, - AND (b) wish to make use of the updated values after an exception - is thrown, those variables should be made `volatile`. Note that this - is ONLY for locals and ONLY when you need access to them after a - `Throw`. - - *Why?* - - Compilers optimize. There is no way to guarantee that the actual - memory location was updated and not just a register unless the - variable is marked volatile. - - As an example, if we had the following code, the value `b` is - very likely at risk. It is assigned to the value `3` inside the - `Try` block, but the compiler may or may not have written that - variable to an actual memory location when the Throw happens. If - it did, the `printf` will have a `3` for the second value. If not, - it will still have a `0`. Changing `b` to `volatile` would - guarantee it is the correct value. - - ``` - void func(int *a) - { - // ... - int b = 0; - Try { - *a += 2; - b = *a; - Throw(MY_EX); - } Catch(e) { - // ... - } - printf("%d ?= %d", a, b); - } - void main() - { - int x = 1; - func(&x); - printf("%d", x); - } - ``` - - With most compilers, the `*a` and `x` values are NOT at risk. - We're dereferencing the pointer, which usually will force - memory interaction. Optimizing compilers DO optimize, though, - and it IS possible that even these values may have been cached - and not written to the final memory location. In those instances, - they would both report `1`. - - If you have a lot of situations like this and a strong optimizing - compiler, it is best to reduce the optimization level when using - CException. - -3. Memory which is `malloc`'d or `new`'d is not automatically released - when an error is thrown. This will sometimes be desirable, and - othertimes may not. It will be the responsibility of the `Catch` - block to perform this kind of cleanup. - - *Why?* - - There's just no easy way to track `malloc`'d memory, etc., without - replacing or wrapping malloc calls or something like that. This - is a light framework, so these options were not desirable. - - - -API ---- - -###Try - -`Try` is a macro which starts a protected block. It MUST be followed by -a pair of braces or a single protected line (similar to an 'if'), -enclosing the data that is to be protected. It **must** be followed by a -`Catch` block (don't worry, you'll get compiler errors to let you know if -you mess any of that up). - - -###Catch(e) - -`Catch` is a macro which ends the `Try` block and starts the error handling -block. The `Catch` block is called if and only if an exception was thrown -while within the `Try` block. This error was thrown by a `Throw` call -somewhere within `Try` (or within a function called within `Try`, or a function -called by a function called within `Try`, etc). - -The single parameter `e` is filled with the error code which was thrown. -This can be used for reporting, conditional cleanup, etc. (or you can just -ignore it if you really want... people ignore return codes all the time, -right?). `e` should be of type `EXCEPTION_T` - - -###Throw(e) - -This is the method of throwing an error. A `Throw` should only occur from within a -protected (`Try` ... `Catch`) block, though it may easily be nested many function -calls deep without an impact on performance or functionality. `Throw` takes -a single argument, which is an exception id which will be passed to `Catch` -as the reason for the error. - -If you wish to rethrow an error, this can be done by calling `Throw(e)` with -the error code you just caught. It **is** valid to throw from a catch block. - - -###ExitTry() - -On rare occasion, you might want to immediately exit your current `Try` block -but **not** treat this as an error. Don't run the `Catch`. Just start executing -from after the `Catch` as if nothing had happened... That's what `ExitTry` is -for. - - -CONFIGURATION -------------- - -CException is a mostly portable library. It has one universal -dependency, and some macros which are required if working in a -multi-tasking environment. - -1. The standard C library setjmp must be available. Since this is part - of the standard library, chances are good that you'll be fine. - -2. If working in a multitasking environment, methods for obtaining an - index into an array of frames and to get the overall number of - id's are required. If the OS supports a method to retrieve Task - ID's, and those Tasks are number 0, 1, 2... you are in an ideal - situation. Otherwise, a more creative mapping function may be - required. Note that this function is likely to be called twice - for each protected block and once during a throw. This is the - only overhead in the system. - - -Exception.h ------------ - -By convention, most projects include `Exception.h` which defines any -further requirements, then calls `CException.h` to do the gruntwork. All -of these are optional. You could directly include `CException.h` if -you wanted and just use the defaults provided. - -* `EXCEPTION_T` - * Set this to the type you want your exception id's to be. Defaults to 'unsigned int'. - -* `EXCEPTION_NONE` - * Set this to a number which will never be an exception id in your system. Defaults to `0x5a5a5a5a`. - -* `EXCEPTION_GET_ID` - * If in a multi-tasking environment, this should be - set to be a call to the function described in #2 above. - Defaults to just return `0` all the time (good for - single tasking environments) - -* `EXCEPTION_NUM_ID` - * If in a multi-tasking environment, this should be set - to the number of ID's required (usually the number of - tasks in the system). Defaults to `1` (for single - tasking environments). - -* `CEXCEPTION_NO_CATCH_HANDLER(id)` - * This macro can be optionally specified. - It allows you to specify code to be called when a Throw - is made outside of `Try` ... `Catch` protection. Consider - this the emergency fallback plan for when something has - gone terribly wrong. - - -You may also want to include any header files which will commonly be -needed by the rest of your application where it uses exception handling -here. For example, OS header files or exception codes would be useful. - - -Finally, there are some hook macros which you can implement to inject -your own target-specific code in particular places. It is a rare instance -where you will need these, but they are here if you need them: - - -* `CEXCEPTION_HOOK_START_TRY` - * called immediately before the Try block - -* `CEXCEPTION_HOOK_HAPPY_TRY` - * called immediately after the Try block if no exception was thrown - -* `CEXCEPTION_HOOK_AFTER_TRY` - * called immediately after the Try block OR before an exception is caught - -* `CEXCEPTION_HOOK_START_CATCH` - * called immediately before the catch - - - -TESTING -------- - - -If you want to validate that CException works with your tools or that -it works with your custom configuration, you may want to run the test -suite. - - -The test suite included makes use of the `Unity` Test Framework. It will -require a native C compiler. The example makefile uses MinGW's gcc. -Modify the makefile to include the proper paths to tools, then run `make` -to compile and run the test application. - -* `C_COMPILER` - * The C compiler to use to perform the tests - -* `C_LIBS` - * The path to the C libraries (including setjmp) - -* `UNITY_DIR` - * The path to the Unity framework (required to run tests) - (get it at [ThrowTheSwitch.org](http://throwtheswitch.org)) - - - -LICENSE -------- - -This software is licensed under the MIT License - -Copyright (c) 2007-2020 Mark VanderVoord - -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. diff --git a/components/testframework/libs/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md b/components/testframework/libs/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md deleted file mode 100644 index a85adef3d..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +++ /dev/null @@ -1,207 +0,0 @@ -# ThrowTheSwitch.org Coding Standard - -Hi. Welcome to the coding standard for ThrowTheSwitch.org. For the most part, -we try to follow these standards to unify our contributors' code into a cohesive -unit (puns intended). You might find places where these standards aren't -followed. We're not perfect. Please be polite where you notice these discrepancies -and we'll try to be polite when we notice yours. - -;) - - -## Why Have A Coding Standard? - -Being consistent makes code easier to understand. We've made an attempt to keep -our standard simple because we also believe that we can only expect someone to -follow something that is understandable. Please do your best. - - -## Our Philosophy - -Before we get into details on syntax, let's take a moment to talk about our -vision for these tools. We're C developers and embedded software developers. -These tools are great to test any C code, but catering to embedded software has -made us more tolerant of compiler quirks. There are a LOT of quirky compilers -out there. By quirky I mean "doesn't follow standards because they feel like -they have a license to do as they wish." - -Our philosophy is "support every compiler we can". Most often, this means that -we aim for writing C code that is standards compliant (often C89... that seems -to be a sweet spot that is almost always compatible). But it also means these -tools are tolerant of things that aren't common. Some that aren't even -compliant. There are configuration options to override the size of standard -types. There are configuration options to force Unity to not use certain -standard library functions. A lot of Unity is configurable and we have worked -hard to make it not TOO ugly in the process. - -Similarly, our tools that parse C do their best. They aren't full C parsers -(yet) and, even if they were, they would still have to accept non-standard -additions like gcc extensions or specifying `@0x1000` to force a variable to -compile to a particular location. It's just what we do, because we like -everything to Just Work™. - -Speaking of having things Just Work™, that's our second philosophy. By that, we -mean that we do our best to have EVERY configuration option have a logical -default. We believe that if you're working with a simple compiler and target, -you shouldn't need to configure very much... we try to make the tools guess as -much as they can, but give the user the power to override it when it's wrong. - - -## Naming Things - -Let's talk about naming things. Programming is all about naming things. We name -files, functions, variables, and so much more. While we're not always going to -find the best name for something, we actually put quite a bit of effort into -finding *What Something WANTS to be Called*™. - -When naming things, we more or less follow this hierarchy, the first being the -most important to us (but we do all four whenever possible): -1. Readable -2. Descriptive -3. Consistent -4. Memorable - - -#### Readable - -We want to read our code. This means we like names and flow that are more -naturally read. We try to avoid double negatives. We try to avoid cryptic -abbreviations (sticking to ones we feel are common). - - -#### Descriptive - -We like descriptive names for things, especially functions and variables. -Finding the right name for something is an important endeavor. You might notice -from poking around our code that this often results in names that are a little -longer than the average. Guilty. We're okay with a tiny bit more typing if it -means our code is easier to understand. - -There are two exceptions to this rule that we also stick to as religiously as -possible: - -First, while we realize hungarian notation (and similar systems for encoding -type information into variable names) is providing a more descriptive name, we -feel that (for the average developer) it takes away from readability and -therefore is to be avoided. - -Second, loop counters and other local throw-away variables often have a purpose -which is obvious. There's no need, therefore, to get carried away with complex -naming. We find i, j, and k are better loop counters than loopCounterVar or -whatnot. We only break this rule when we see that more description could improve -understanding of an algorithm. - - -#### Consistent - -We like consistency, but we're not really obsessed with it. We try to name our -configuration macros in a consistent fashion... you'll notice a repeated use of -UNITY_EXCLUDE_BLAH or UNITY_USES_BLAH macros. This helps users avoid having to -remember each macro's details. - - -#### Memorable - -Where ever it doesn't violate the above principles, we try to apply memorable -names. Sometimes this means using something that is simply descriptive, but -often we strive for descriptive AND unique... we like quirky names that stand -out in our memory and are easier to search for. Take a look through the file -names in Ceedling and you'll get a good idea of what we are talking about here. -Why use preprocess when you can use preprocessinator? Or what better describes a -module in charge of invoking tasks during releases than release_invoker? Don't -get carried away. The names are still descriptive and fulfill the above -requirements, but they don't feel stale. - - -## C and C++ Details - -We don't really want to add to the style battles out there. Tabs or spaces? -How many spaces? Where do the braces go? These are age-old questions that will -never be answered... or at least not answered in a way that will make everyone -happy. - -We've decided on our own style preferences. If you'd like to contribute to these -projects (and we hope that you do), then we ask if you do your best to follow -the same. It will only hurt a little. We promise. - - -#### Whitespace - -Our C-style is to use spaces and to use 4 of them per indent level. It's a nice -power-of-2 number that looks decent on a wide screen. We have no more reason -than that. We break that rule when we have lines that wrap (macros or function -arguments or whatnot). When that happens, we like to indent further to line -things up in nice tidy columns. - -```C - if (stuff_happened) - { - do_something(); - } -``` - - -#### Case - -- Files - all lower case with underscores. -- Variables - all lower case with underscores -- Macros - all caps with underscores. -- Typedefs - all caps with underscores. (also ends with _T). -- Functions - camel cased. Usually named ModuleName_FuncName -- Constants and Globals - camel cased. - - -#### Braces - -The left brace is on the next line after the declaration. The right brace is -directly below that. Everything in between in indented one level. If you're -catching an error and you have a one-line, go ahead and to it on the same line. - -```C - while (blah) - { - //Like so. Even if only one line, we use braces. - } -``` - - -#### Comments - -Do you know what we hate? Old-school C block comments. BUT, we're using them -anyway. As we mentioned, our goal is to support every compiler we can, -especially embedded compilers. There are STILL C compilers out there that only -support old-school block comments. So that is what we're using. We apologize. We -think they are ugly too. - - -## Ruby Details - -Is there really such thing as a Ruby coding standard? Ruby is such a free form -language, it seems almost sacrilegious to suggest that people should comply to -one method! We'll keep it really brief! - - -#### Whitespace - -Our Ruby style is to use spaces and to use 2 of them per indent level. It's a -nice power-of-2 number that really grooves with Ruby's compact style. We have no -more reason than that. We break that rule when we have lines that wrap. When -that happens, we like to indent further to line things up in nice tidy columns. - - -#### Case - -- Files - all lower case with underscores. -- Variables - all lower case with underscores -- Classes, Modules, etc - Camel cased. -- Functions - all lower case with underscores -- Constants - all upper case with underscores - - -## Documentation - -Egad. Really? We use markdown and we like pdf files because they can be made to -look nice while still being portable. Good enough? - - -*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* diff --git a/components/testframework/libs/cmock/vendor/c_exception/lib/CException.c b/components/testframework/libs/cmock/vendor/c_exception/lib/CException.c deleted file mode 100644 index fdff8f475..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/lib/CException.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "CException.h" - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -volatile CEXCEPTION_FRAME_T CExceptionFrames[CEXCEPTION_NUM_ID] = {{ 0 }}; -#pragma GCC diagnostic pop - -//------------------------------------------------------------------------------------------ -// Throw -//------------------------------------------------------------------------------------------ -void Throw(CEXCEPTION_T ExceptionID) -{ - unsigned int MY_ID = CEXCEPTION_GET_ID; - CExceptionFrames[MY_ID].Exception = ExceptionID; - if (CExceptionFrames[MY_ID].pFrame) - { - longjmp(*CExceptionFrames[MY_ID].pFrame, 1); - } - CEXCEPTION_NO_CATCH_HANDLER(ExceptionID); -} - -//------------------------------------------------------------------------------------------ -// Explanation of what it's all for: -//------------------------------------------------------------------------------------------ -/* -#define Try - { <- give us some local scope. most compilers are happy with this - jmp_buf *PrevFrame, NewFrame; <- prev frame points to the last try block's frame. new frame gets created on stack for this Try block - unsigned int MY_ID = CEXCEPTION_GET_ID; <- look up this task's id for use in frame array. always 0 if single-tasking - PrevFrame = CExceptionFrames[CEXCEPTION_GET_ID].pFrame; <- set pointer to point at old frame (which array is currently pointing at) - CExceptionFrames[MY_ID].pFrame = &NewFrame; <- set array to point at my new frame instead, now - CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; <- initialize my exception id to be NONE - if (setjmp(NewFrame) == 0) { <- do setjmp. it returns 1 if longjump called, otherwise 0 - if (&PrevFrame) <- this is here to force proper scoping. it requires braces or a single line to be but after Try, otherwise won't compile. This is always true at this point. - -#define Catch(e) - else { } <- this also forces proper scoping. Without this they could stick their own 'else' in and it would get ugly - CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; <- no errors happened, so just set the exception id to NONE (in case it was corrupted) - } - else <- an exception occurred - { e = CExceptionFrames[MY_ID].Exception; e=e;} <- assign the caught exception id to the variable passed in. - CExceptionFrames[MY_ID].pFrame = PrevFrame; <- make the pointer in the array point at the previous frame again, as if NewFrame never existed. - } <- finish off that local scope we created to have our own variables - if (CExceptionFrames[CEXCEPTION_GET_ID].Exception != CEXCEPTION_NONE) <- start the actual 'catch' processing if we have an exception id saved away - */ - diff --git a/components/testframework/libs/cmock/vendor/c_exception/lib/CException.h b/components/testframework/libs/cmock/vendor/c_exception/lib/CException.h deleted file mode 100644 index 78f2f940c..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/lib/CException.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef _CEXCEPTION_H -#define _CEXCEPTION_H - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - -#define CEXCEPTION_VERSION_MAJOR 1 -#define CEXCEPTION_VERSION_MINOR 3 -#define CEXCEPTION_VERSION_BUILD 2 -#define CEXCEPTION_VERSION ((CEXCEPTION_VERSION_MAJOR << 16) | (CEXCEPTION_VERSION_MINOR << 8) | CEXCEPTION_VERSION_BUILD) - -//To Use CException, you have a number of options: -//1. Just include it and run with the defaults -//2. Define any of the following symbols at the command line to override them -//3. Include a header file before CException.h everywhere which defines any of these -//4. Create an Exception.h in your path, and just define EXCEPTION_USE_CONFIG_FILE first - -#ifdef CEXCEPTION_USE_CONFIG_FILE -#include "CExceptionConfig.h" -#endif - -//This is the value to assign when there isn't an exception -#ifndef CEXCEPTION_NONE -#define CEXCEPTION_NONE (0x5A5A5A5A) -#endif - -//This is number of exception stacks to keep track of (one per task) -#ifndef CEXCEPTION_NUM_ID -#define CEXCEPTION_NUM_ID (1) //there is only the one stack by default -#endif - -//This is the method of getting the current exception stack index (0 if only one stack) -#ifndef CEXCEPTION_GET_ID -#define CEXCEPTION_GET_ID (0) //use the first index always because there is only one anyway -#endif - -//The type to use to store the exception values. -#ifndef CEXCEPTION_T -#define CEXCEPTION_T unsigned int -#endif - -//This is an optional special handler for when there is no global Catch -#ifndef CEXCEPTION_NO_CATCH_HANDLER -#define CEXCEPTION_NO_CATCH_HANDLER(id) -#endif - -//These hooks allow you to inject custom code into places, particularly useful for saving and restoring additional state -#ifndef CEXCEPTION_HOOK_START_TRY -#define CEXCEPTION_HOOK_START_TRY -#endif -#ifndef CEXCEPTION_HOOK_HAPPY_TRY -#define CEXCEPTION_HOOK_HAPPY_TRY -#endif -#ifndef CEXCEPTION_HOOK_AFTER_TRY -#define CEXCEPTION_HOOK_AFTER_TRY -#endif -#ifndef CEXCEPTION_HOOK_START_CATCH -#define CEXCEPTION_HOOK_START_CATCH -#endif - -//exception frame structures -typedef struct { - jmp_buf* pFrame; - CEXCEPTION_T volatile Exception; -} CEXCEPTION_FRAME_T; - -//actual root frame storage (only one if single-tasking) -extern volatile CEXCEPTION_FRAME_T CExceptionFrames[]; - -//Try (see C file for explanation) -#define Try \ - { \ - jmp_buf *PrevFrame, NewFrame; \ - unsigned int MY_ID = CEXCEPTION_GET_ID; \ - PrevFrame = CExceptionFrames[MY_ID].pFrame; \ - CExceptionFrames[MY_ID].pFrame = (jmp_buf*)(&NewFrame); \ - CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; \ - CEXCEPTION_HOOK_START_TRY; \ - if (setjmp(NewFrame) == 0) { \ - if (1) - -//Catch (see C file for explanation) -#define Catch(e) \ - else { } \ - CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; \ - CEXCEPTION_HOOK_HAPPY_TRY; \ - } \ - else \ - { \ - e = CExceptionFrames[MY_ID].Exception; \ - (void)e; \ - CEXCEPTION_HOOK_START_CATCH; \ - } \ - CExceptionFrames[MY_ID].pFrame = PrevFrame; \ - CEXCEPTION_HOOK_AFTER_TRY; \ - } \ - if (CExceptionFrames[CEXCEPTION_GET_ID].Exception != CEXCEPTION_NONE) - -//Throw an Error -void Throw(CEXCEPTION_T ExceptionID); - -//Just exit the Try block and skip the Catch. -#define ExitTry() Throw(CEXCEPTION_NONE) - -#ifdef __cplusplus -} // extern "C" -#endif - - -#endif // _CEXCEPTION_H diff --git a/components/testframework/libs/cmock/vendor/c_exception/lib/meson.build b/components/testframework/libs/cmock/vendor/c_exception/lib/meson.build deleted file mode 100644 index c9afe2048..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/lib/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -# -# build script written by : Michael Brockus. -# github repo author: Mark VanderVoord. -# -# license: MIT -# -cexception_dir = include_directories('.') - -cexception_lib = static_library(meson.project_name(), - sources: ['CException.c'], - include_directories: cexception_dir) diff --git a/components/testframework/libs/cmock/vendor/c_exception/meson.build b/components/testframework/libs/cmock/vendor/c_exception/meson.build deleted file mode 100644 index e44cb906d..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/meson.build +++ /dev/null @@ -1,48 +0,0 @@ -# -# build script written by : Michael Brockus. -# github repo author: Mark VanderVoord. -# -# license: MIT -# -project('CException', 'c', - license: 'MIT', - meson_version: '>=0.53.0', - default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11'] -) -lang = 'c' -cc = meson.get_compiler(lang) - -# -# Meson: Add compiler flags -if cc.get_id() == 'clang' - add_project_arguments(cc.get_supported_arguments( - [ - '-Wexit-time-destructors', - '-Wglobal-constructors', - '-Wmissing-prototypes', - '-Wmissing-noreturn', - '-Wno-missing-braces', - '-Wold-style-cast', '-Wpointer-arith', '-Wweak-vtables', - '-Wcast-align', '-Wconversion', '-Wcast-qual', '-Wshadow' - ] - ), language: lang) -endif - -if cc.get_argument_syntax() == 'gcc' - add_project_arguments(cc.get_supported_arguments( - [ - '-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar', - '-Wpointer-arith' , '-Wwrite-strings' , - '-Wno-parentheses' , '-Wno-type-limits' , - '-Wformat-security' , '-Wunreachable-code' , - '-Waggregate-return' , '-Wformat-nonliteral' , - '-Wmissing-declarations', '-Wmissing-include-dirs' , - '-Wno-unused-parameter' - ] - ), language: lang) -endif - -# -# Sub directory to project source code -subdir('lib') -cexception_dep = declare_dependency(link_with: cexception_lib, include_directories: cexception_dir) diff --git a/components/testframework/libs/cmock/vendor/c_exception/project.yml b/components/testframework/libs/cmock/vendor/c_exception/project.yml deleted file mode 100644 index ab4a290af..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/project.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- - -# This project file is for using Ceedling to run CException's self-tests. The -# only requirement for USING CException is in the lib folder. - -:project: - :use_exceptions: FALSE - :use_test_preprocessor: FALSE - :use_auxiliary_dependencies: FALSE - :build_root: build - :test_file_prefix: Test - :which_ceedling: gem - :ceedling_version: 0.29.1 - :default_tasks: - - clobber test:all - -:extension: - :executable: .out - -:paths: - :test: - - +:test/** - - -:test/support - :source: - - lib/** - :support: - - test/support - -:defines: - :test: - - TEST - - CEXCEPTION_USE_CONFIG_FILE - :test_preprocess: - - TEST - - CEXCEPTION_USE_CONFIG_FILE - -... diff --git a/components/testframework/libs/cmock/vendor/c_exception/test/TestException.c b/components/testframework/libs/cmock/vendor/c_exception/test/TestException.c deleted file mode 100644 index e248cb0f2..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/test/TestException.c +++ /dev/null @@ -1,391 +0,0 @@ -#include "unity.h" -#include "CException.h" - -volatile int TestingTheFallback; -volatile int TestingTheFallbackId; - -void setUp(void) -{ - CExceptionFrames[0].pFrame = NULL; - TestingTheFallback = 0; -} - -void tearDown(void) -{ -} - -void test_BasicTryDoesNothingIfNoThrow(void) -{ - int i = 0; - CEXCEPTION_T e = 0x5a; - - Try - { - i += 1; - } - Catch(e) - { - TEST_FAIL_MESSAGE("Should Not Enter Catch If Not Thrown"); - } - - //verify that e was untouched - TEST_ASSERT_EQUAL(0x5a, e); - - // verify that i was incremented once - TEST_ASSERT_EQUAL(1, i); -} - -void test_BasicThrowAndCatch(void) -{ - CEXCEPTION_T e; - - Try - { - Throw(0xBE); - TEST_FAIL_MESSAGE("Should Have Thrown An Error"); - } - Catch(e) - { - //verify that e has the right data - TEST_ASSERT_EQUAL(0xBE, e); - } - - //verify that e STILL has the right data - TEST_ASSERT_EQUAL(0xBE, e); -} - -void test_BasicThrowAndCatch_WithMiniSyntax(void) -{ - CEXCEPTION_T e; - - //Mini Throw and Catch - Try - Throw(0xEF); - Catch(e) - TEST_ASSERT_EQUAL(0xEF, e); - TEST_ASSERT_EQUAL(0xEF, e); - - //Mini Passthrough - Try - e = 0; - Catch(e) - TEST_FAIL_MESSAGE("I shouldn't be caught because there was no throw"); - - TEST_ASSERT_EQUAL(0, e); -} - -void test_VerifyVolatilesSurviveThrowAndCatch(void) -{ - volatile unsigned int VolVal = 0; - CEXCEPTION_T e; - - Try - { - VolVal = 2; - Throw(0xBF); - TEST_FAIL_MESSAGE("Should Have Thrown An Error"); - } - Catch(e) - { - VolVal += 2; - TEST_ASSERT_EQUAL(0xBF, e); - } - - TEST_ASSERT_EQUAL(4, VolVal); - TEST_ASSERT_EQUAL(0xBF, e); -} - -void HappyExceptionThrower(unsigned int ID) -{ - if (ID != 0) - { - Throw(ID); - } -} - -void test_ThrowFromASubFunctionAndCatchInRootFunc(void) -{ - volatile unsigned int ID = 0; - CEXCEPTION_T e; - - Try - { - - HappyExceptionThrower(0xBA); - TEST_FAIL_MESSAGE("Should Have Thrown An Exception"); - } - Catch(e) - { - ID = e; - } - - //verify that I can pass that value to something else - TEST_ASSERT_EQUAL(0xBA, e); - //verify that ID and e have the same value - TEST_ASSERT_EQUAL(ID, e); -} - -void HappyExceptionRethrower(unsigned int ID) -{ - CEXCEPTION_T e; - - Try - { - Throw(ID); - } - Catch(e) - { - switch (e) - { - case 0xBD: - Throw(0xBF); - break; - default: - break; - } - } -} - -void test_ThrowAndCatchFromASubFunctionAndRethrowToCatchInRootFunc(void) -{ - volatile unsigned int ID = 0; - CEXCEPTION_T e; - - Try - { - HappyExceptionRethrower(0xBD); - TEST_FAIL_MESSAGE("Should Have Rethrown Exception"); - } - Catch(e) - { - ID = 1; - } - - TEST_ASSERT_EQUAL(0xBF, e); - TEST_ASSERT_EQUAL(1, ID); -} - -void test_ThrowAndCatchFromASubFunctionAndNoRethrowToCatchInRootFunc(void) -{ - CEXCEPTION_T e = 3; - - Try - { - HappyExceptionRethrower(0xBF); - } - Catch(e) - { - TEST_FAIL_MESSAGE("Should Not Have Re-thrown Error (it should have already been caught)"); - } - - //verify that THIS e is still untouched, even though subfunction was touched - TEST_ASSERT_EQUAL(3, e); -} - -void test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThisDoesntCorruptExceptionId(void) -{ - CEXCEPTION_T e; - - Try - { - HappyExceptionThrower(0xBF); - TEST_FAIL_MESSAGE("Should Have Thrown Exception"); - } - Catch(e) - { - TEST_ASSERT_EQUAL(0xBF, e); - HappyExceptionRethrower(0x12); - TEST_ASSERT_EQUAL(0xBF, e); - } - TEST_ASSERT_EQUAL(0xBF, e); -} - -void test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThatEachExceptionIdIndependent(void) -{ - CEXCEPTION_T e1, e2; - - Try - { - HappyExceptionThrower(0xBF); - TEST_FAIL_MESSAGE("Should Have Thrown Exception"); - } - Catch(e1) - { - TEST_ASSERT_EQUAL(0xBF, e1); - Try - { - HappyExceptionThrower(0x12); - } - Catch(e2) - { - TEST_ASSERT_EQUAL(0x12, e2); - } - TEST_ASSERT_EQUAL(0x12, e2); - TEST_ASSERT_EQUAL(0xBF, e1); - } - TEST_ASSERT_EQUAL(0x12, e2); - TEST_ASSERT_EQUAL(0xBF, e1); -} - -void test_CanHaveMultipleTryBlocksInASingleFunction(void) -{ - CEXCEPTION_T e; - - Try - { - HappyExceptionThrower(0x01); - TEST_FAIL_MESSAGE("Should Have Thrown Exception"); - } - Catch(e) - { - TEST_ASSERT_EQUAL(0x01, e); - } - - Try - { - HappyExceptionThrower(0xF0); - TEST_FAIL_MESSAGE("Should Have Thrown Exception"); - } - Catch(e) - { - TEST_ASSERT_EQUAL(0xF0, e); - } -} - -void test_CanHaveNestedTryBlocksInASingleFunction_ThrowInside(void) -{ - int i = 0; - CEXCEPTION_T e; - - Try - { - Try - { - HappyExceptionThrower(0x01); - i = 1; - TEST_FAIL_MESSAGE("Should Have Rethrown Exception"); - } - Catch(e) - { - TEST_ASSERT_EQUAL(0x01, e); - } - } - Catch(e) - { - TEST_FAIL_MESSAGE("Should Have Been Caught By Inside Catch"); - } - - // verify that i is still zero - TEST_ASSERT_EQUAL(0, i); -} - -void test_CanHaveNestedTryBlocksInASingleFunction_ThrowOutside(void) -{ - int i = 0; - CEXCEPTION_T e; - - Try - { - Try - { - i = 2; - } - Catch(e) - { - TEST_FAIL_MESSAGE("Should Not Be Caught Here"); - } - HappyExceptionThrower(0x01); - TEST_FAIL_MESSAGE("Should Have Rethrown Exception"); - } - Catch(e) - { - TEST_ASSERT_EQUAL(0x01, e); - } - - // verify that i is 2 - TEST_ASSERT_EQUAL(2, i); -} - -void test_AThrowWithoutATryCatchWillUseDefaultHandlerIfSpecified(void) -{ - //Let the fallback handler know we're expecting it to get called this time, so don't fail - TestingTheFallback = 1; - - Throw(0xBE); - - //We know the fallback was run because it decrements the counter above - TEST_ASSERT_FALSE(TestingTheFallback); - TEST_ASSERT_EQUAL(0xBE, TestingTheFallbackId); -} - -void test_AThrowWithoutOutsideATryCatchWillUseDefaultHandlerEvenAfterTryCatch(void) -{ - CEXCEPTION_T e; - - Try - { - //It's not really important that we do anything here. - } - Catch(e) - { - //The entire purpose here is just to make sure things get set back to using the default handler when done - } - - //Let the fallback handler know we're expecting it to get called this time, so don't fail - TestingTheFallback = 1; - - Throw(0xBE); - - //We know the fallback was run because it decrements the counter above - TEST_ASSERT_FALSE(TestingTheFallback); - TEST_ASSERT_EQUAL(0xBE, TestingTheFallbackId); -} - -void test_AbilityToExitTryWithoutThrowingAnError(void) -{ - int i=0; - CEXCEPTION_T e; - - Try - { - ExitTry(); - i = 1; - TEST_FAIL_MESSAGE("Should Have Exited Try Before This"); - } - Catch(e) - { - i = 2; - TEST_FAIL_MESSAGE("Should Not Have Been Caught"); - } - - // verify that i is still zero - TEST_ASSERT_EQUAL(0, i); -} - -void test_AbilityToExitTryWillOnlyExitOneLevel(void) -{ - int i=0; - CEXCEPTION_T e; - CEXCEPTION_T e2; - - Try - { - Try - { - ExitTry(); - TEST_FAIL_MESSAGE("Should Have Exited Try Before This"); - } - Catch(e) - { - TEST_FAIL_MESSAGE("Should Not Have Been Caught By Inside"); - } - i = 1; - } - Catch(e2) - { - TEST_FAIL_MESSAGE("Should Not Have Been Caught By Outside"); - } - - // verify that we picked up and ran after first Try - TEST_ASSERT_EQUAL(1, i); -} diff --git a/components/testframework/libs/cmock/vendor/c_exception/test/support/CExceptionConfig.h b/components/testframework/libs/cmock/vendor/c_exception/test/support/CExceptionConfig.h deleted file mode 100644 index 66cb87e7b..000000000 --- a/components/testframework/libs/cmock/vendor/c_exception/test/support/CExceptionConfig.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _EXCEPTION_H -#define _EXCEPTION_H - -#include "unity.h" - -extern volatile int TestingTheFallback; -extern volatile int TestingTheFallbackId; - -//Optionally define the exception type (something like an int which can be directly assigned) -#define CEXCEPTION_T int - -// Optionally define the reserved value representing NO EXCEPTION -#define CEXCEPTION_NONE (1234) - -// Optionally define a special handler for unhandled exceptions -#define CEXCEPTION_NO_CATCH_HANDLER(id) \ -{ \ - if (!TestingTheFallback) \ - { \ - TEST_FAIL_MESSAGE("Unexpected Exception!"); \ - } \ - else \ - { \ - TestingTheFallbackId = id; \ - TestingTheFallback--; \ - } \ -} - -// Multi-Tasking environments will need a couple of macros defined to make this library -// properly handle multiple exception stacks. You will need to include and required -// definitions, then define the following macros: -// EXCEPTION_GET_ID - returns the id of the current task indexed 0 to (numtasks - 1) -// EXCEPTION_NUM_ID - returns the number of tasks that might be returned -// -// For example, Quadros might include the following implementation: -#ifndef TEST -#include "OSAPI.h" -#define CEXCEPTION_GET_ID (KS_GetTaskID()) -#define CEXCEPTION_NUM_ID (NTASKS + 1) -#endif - -//This could be a good place to define/include some error ID's: -#define ERROR_ID_EVERYTHING_IS_BROKEN (0x88) -#define ERROR_ID_ONLY_THIS_IS_BROKEN (0x77) - -#endif // _EXCEPTION_H diff --git a/components/testframework/libs/cmock/vendor/unity/.editorconfig b/components/testframework/libs/cmock/vendor/unity/.editorconfig deleted file mode 100644 index 7b7a47a01..000000000 --- a/components/testframework/libs/cmock/vendor/unity/.editorconfig +++ /dev/null @@ -1,27 +0,0 @@ -############################################################################### -# Unity Project - A Test Framework for C -# .editorconfig - F. Zahn 2019 -############################################################################### - -# This is the topmost .editorconfig file -root = true - -# Settings that apply to all languages / files -[*] -charset = utf-8 -indent_size = 4 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -trim_trailing_whitespace = false - -[*.txt] -trim_trailing_whitespace = false - -[*.rb] -indent_size = 2 - -[*.yml] -indent_size = 2 diff --git a/components/testframework/libs/cmock/vendor/unity/.travis.yml b/components/testframework/libs/cmock/vendor/unity/.travis.yml deleted file mode 100644 index d3b9a18e2..000000000 --- a/components/testframework/libs/cmock/vendor/unity/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -sudo: required -language: ruby c - -matrix: - include: - #- os: osx - # compiler: clang - # osx_image: xcode7.3 - - os: linux - dist: trusty - rvm: "2.4" - compiler: gcc - - os: linux - dist: xenial - rvm: "2.7" - compiler: clang - -before_install: - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install --assume-yes --quiet gcc-multilib; fi - -install: - - gem install rspec - - gem install rubocop -v 0.57.2 - -script: - - cd test && rake ci diff --git a/components/testframework/libs/cmock/vendor/unity/CMakeLists.txt b/components/testframework/libs/cmock/vendor/unity/CMakeLists.txt deleted file mode 100644 index 3a9d8a94c..000000000 --- a/components/testframework/libs/cmock/vendor/unity/CMakeLists.txt +++ /dev/null @@ -1,133 +0,0 @@ -################################################################################### -# # -# NAME: CMakeLists.txt # -# # -# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. # -# WRITTEN BY: Michael Brockus. # -# # -# License: MIT # -# # -################################################################################### - -cmake_minimum_required(VERSION 3.12) - -# Read src/unity.h file and get project version from it -set(UNITY_HEADER "src/unity.h") - -file(STRINGS "${UNITY_HEADER}" UNITY_HEADER_CONTENT - REGEX "^#define UNITY_VERSION_(MAJOR|MINOR|BUILD) +[0-9]+$" -) - -set(UNITY_HEADER_VERSION_MAJOR 0) -set(UNITY_HEADER_VERSION_MINOR 0) -set(UNITY_HEADER_VERSION_BUILD 0) - -foreach(VERSION_LINE IN LISTS UNITY_HEADER_CONTENT) - foreach(VERSION_PART MAJOR MINOR BUILD) - string(CONCAT REGEX_STRING "#define UNITY_VERSION_" - "${VERSION_PART}" - " +([0-9]+)" - ) - - if(VERSION_LINE MATCHES "${REGEX_STRING}") - set(UNITY_HEADER_VERSION_${VERSION_PART} "${CMAKE_MATCH_1}") - endif() - endforeach() -endforeach() - -project(unity - VERSION ${UNITY_HEADER_VERSION_MAJOR}.${UNITY_HEADER_VERSION_MINOR}.${UNITY_HEADER_VERSION_BUILD} - LANGUAGES C - DESCRIPTION "C Unit testing framework." -) - -# Main target ------------------------------------------------------------------ -add_library(${PROJECT_NAME} STATIC) -add_library(${PROJECT_NAME}::framework ALIAS ${PROJECT_NAME}) - -# Includes --------------------------------------------------------------------- -include(GNUInstallDirs) -include(CMakePackageConfigHelpers) - -target_sources(${PROJECT_NAME} - PRIVATE - src/unity.c -) - -target_include_directories(${PROJECT_NAME} - PUBLIC - $ - $ - $ -) - -set(${PROJECT_NAME}_PUBLIC_HEADERS src/unity.h - src/unity_internals.h -) - -set_target_properties(${PROJECT_NAME} - PROPERTIES - C_STANDARD 11 - C_STANDARD_REQUIRED ON - C_EXTENSIONS OFF - PUBLIC_HEADER "${${PROJECT_NAME}_PUBLIC_HEADERS}" - EXPORT_NAME framework -) - -target_compile_options(${PROJECT_NAME} - PRIVATE - $<$:-Wcast-align - -Wcast-qual - -Wconversion - -Wexit-time-destructors - -Wglobal-constructors - -Wmissing-noreturn - -Wmissing-prototypes - -Wno-missing-braces - -Wold-style-cast - -Wshadow - -Wweak-vtables> - $<$:-Waddress - -Waggregate-return - -Wformat-nonliteral - -Wformat-security - -Wformat - -Winit-self - -Wmissing-declarations - -Wmissing-include-dirs - -Wno-multichar - -Wno-parentheses - -Wno-type-limits - -Wno-unused-parameter - -Wunreachable-code - -Wwrite-strings - -Wpointer-arith> - -Wall - -Werror -) - -write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake - VERSION ${PROJECT_VERSION} - COMPATIBILITY SameMajorVersion -) - -## Target installation -install(TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} - COMPONENT library -) - -## Target's cmake files: targets export -install(EXPORT ${PROJECT_NAME}Targets - NAMESPACE ${PROJECT_NAME}:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) - -## Target's cmake files: config and version config for find_package() -install(FILES ${PROJECT_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) diff --git a/components/testframework/libs/cmock/vendor/unity/LICENSE.txt b/components/testframework/libs/cmock/vendor/unity/LICENSE.txt deleted file mode 100644 index d66fba53e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams - -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. diff --git a/components/testframework/libs/cmock/vendor/unity/README.md b/components/testframework/libs/cmock/vendor/unity/README.md deleted file mode 100644 index e6e7ea2d0..000000000 --- a/components/testframework/libs/cmock/vendor/unity/README.md +++ /dev/null @@ -1,191 +0,0 @@ -Unity Test API -============== - -[![Unity Build Status](https://api.travis-ci.org/ThrowTheSwitch/Unity.png?branch=master)](https://travis-ci.org/ThrowTheSwitch/Unity) -__Copyright (c) 2007 - 2020 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__ - -Getting Started -=============== -The [docs](docs/) folder contains a [getting started guide](docs/UnityGettingStartedGuide.md) -and much more tips about using Unity. - -Unity Assertion Summary -======================= -For the full list, see [UnityAssertionsReference.md](docs/UnityAssertionsReference.md). - -Basic Validity Tests --------------------- - - TEST_ASSERT_TRUE(condition) - -Evaluates whatever code is in condition and fails if it evaluates to false - - TEST_ASSERT_FALSE(condition) - -Evaluates whatever code is in condition and fails if it evaluates to true - - TEST_ASSERT(condition) - -Another way of calling `TEST_ASSERT_TRUE` - - TEST_ASSERT_UNLESS(condition) - -Another way of calling `TEST_ASSERT_FALSE` - - TEST_FAIL() - TEST_FAIL_MESSAGE(message) - -This test is automatically marked as a failure. The message is output stating why. - -Numerical Assertions: Integers ------------------------------- - - TEST_ASSERT_EQUAL_INT(expected, actual) - TEST_ASSERT_EQUAL_INT8(expected, actual) - TEST_ASSERT_EQUAL_INT16(expected, actual) - TEST_ASSERT_EQUAL_INT32(expected, actual) - TEST_ASSERT_EQUAL_INT64(expected, actual) - -Compare two integers for equality and display errors as signed integers. A cast will be performed -to your natural integer size so often this can just be used. When you need to specify the exact size, -like when comparing arrays, you can use a specific version: - - TEST_ASSERT_EQUAL_UINT(expected, actual) - TEST_ASSERT_EQUAL_UINT8(expected, actual) - TEST_ASSERT_EQUAL_UINT16(expected, actual) - TEST_ASSERT_EQUAL_UINT32(expected, actual) - TEST_ASSERT_EQUAL_UINT64(expected, actual) - -Compare two integers for equality and display errors as unsigned integers. Like INT, there are -variants for different sizes also. - - TEST_ASSERT_EQUAL_HEX(expected, actual) - TEST_ASSERT_EQUAL_HEX8(expected, actual) - TEST_ASSERT_EQUAL_HEX16(expected, actual) - TEST_ASSERT_EQUAL_HEX32(expected, actual) - TEST_ASSERT_EQUAL_HEX64(expected, actual) - -Compares two integers for equality and display errors as hexadecimal. Like the other integer comparisons, -you can specify the size... here the size will also effect how many nibbles are shown (for example, `HEX16` -will show 4 nibbles). - - TEST_ASSERT_EQUAL(expected, actual) - -Another way of calling TEST_ASSERT_EQUAL_INT - - TEST_ASSERT_INT_WITHIN(delta, expected, actual) - -Asserts that the actual value is within plus or minus delta of the expected value. This also comes in -size specific variants. - - - TEST_ASSERT_GREATER_THAN(threshold, actual) - -Asserts that the actual value is greater than the threshold. This also comes in size specific variants. - - - TEST_ASSERT_LESS_THAN(threshold, actual) - -Asserts that the actual value is less than the threshold. This also comes in size specific variants. - - -Arrays ------- - - _ARRAY - -You can append `_ARRAY` to any of these macros to make an array comparison of that type. Here you will -need to care a bit more about the actual size of the value being checked. You will also specify an -additional argument which is the number of elements to compare. For example: - - TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, elements) - - _EACH_EQUAL - -Another array comparison option is to check that EVERY element of an array is equal to a single expected -value. You do this by specifying the EACH_EQUAL macro. For example: - - TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, elements) - -Numerical Assertions: Bitwise ------------------------------ - - TEST_ASSERT_BITS(mask, expected, actual) - -Use an integer mask to specify which bits should be compared between two other integers. High bits in the mask are compared, low bits ignored. - - TEST_ASSERT_BITS_HIGH(mask, actual) - -Use an integer mask to specify which bits should be inspected to determine if they are all set high. High bits in the mask are compared, low bits ignored. - - TEST_ASSERT_BITS_LOW(mask, actual) - -Use an integer mask to specify which bits should be inspected to determine if they are all set low. High bits in the mask are compared, low bits ignored. - - TEST_ASSERT_BIT_HIGH(bit, actual) - -Test a single bit and verify that it is high. The bit is specified 0-31 for a 32-bit integer. - - TEST_ASSERT_BIT_LOW(bit, actual) - -Test a single bit and verify that it is low. The bit is specified 0-31 for a 32-bit integer. - -Numerical Assertions: Floats ----------------------------- - - TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual) - -Asserts that the actual value is within plus or minus delta of the expected value. - - TEST_ASSERT_EQUAL_FLOAT(expected, actual) - TEST_ASSERT_EQUAL_DOUBLE(expected, actual) - -Asserts that two floating point values are "equal" within a small % delta of the expected value. - -String Assertions ------------------ - - TEST_ASSERT_EQUAL_STRING(expected, actual) - -Compare two null-terminate strings. Fail if any character is different or if the lengths are different. - - TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len) - -Compare two strings. Fail if any character is different, stop comparing after len characters. - - TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, actual, message) - -Compare two null-terminate strings. Fail if any character is different or if the lengths are different. Output a custom message on failure. - - TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE(expected, actual, len, message) - -Compare two strings. Fail if any character is different, stop comparing after len characters. Output a custom message on failure. - -Pointer Assertions ------------------- - -Most pointer operations can be performed by simply using the integer comparisons above. However, a couple of special cases are added for clarity. - - TEST_ASSERT_NULL(pointer) - -Fails if the pointer is not equal to NULL - - TEST_ASSERT_NOT_NULL(pointer) - -Fails if the pointer is equal to NULL - -Memory Assertions ------------------ - - TEST_ASSERT_EQUAL_MEMORY(expected, actual, len) - -Compare two blocks of memory. This is a good generic assertion for types that can't be coerced into acting like -standard types... but since it's a memory compare, you have to be careful that your data types are packed. - -\_MESSAGE ---------- - -you can append \_MESSAGE to any of the macros to make them take an additional argument. This argument -is a string that will be printed at the end of the failure strings. This is useful for specifying more -information about the problem. - diff --git a/components/testframework/libs/cmock/vendor/unity/auto/colour_prompt.rb b/components/testframework/libs/cmock/vendor/unity/auto/colour_prompt.rb deleted file mode 100644 index 85cbfd80c..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/colour_prompt.rb +++ /dev/null @@ -1,119 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -if RUBY_PLATFORM =~ /(win|w)32$/ - begin - require 'Win32API' - rescue LoadError - puts 'ERROR! "Win32API" library not found' - puts '"Win32API" is required for colour on a windows machine' - puts ' try => "gem install Win32API" on the command line' - puts - end - # puts - # puts 'Windows Environment Detected...' - # puts 'Win32API Library Found.' - # puts -end - -class ColourCommandLine - def initialize - return unless RUBY_PLATFORM =~ /(win|w)32$/ - - get_std_handle = Win32API.new('kernel32', 'GetStdHandle', ['L'], 'L') - @set_console_txt_attrb = - Win32API.new('kernel32', 'SetConsoleTextAttribute', %w[L N], 'I') - @hout = get_std_handle.call(-11) - end - - def change_to(new_colour) - if RUBY_PLATFORM =~ /(win|w)32$/ - @set_console_txt_attrb.call(@hout, win32_colour(new_colour)) - else - "\033[30;#{posix_colour(new_colour)};22m" - end - end - - def win32_colour(colour) - case colour - when :black then 0 - when :dark_blue then 1 - when :dark_green then 2 - when :dark_cyan then 3 - when :dark_red then 4 - when :dark_purple then 5 - when :dark_yellow, :narrative then 6 - when :default_white, :default, :dark_white then 7 - when :silver then 8 - when :blue then 9 - when :green, :success then 10 - when :cyan, :output then 11 - when :red, :failure then 12 - when :purple then 13 - when :yellow then 14 - when :white then 15 - else - 0 - end - end - - def posix_colour(colour) - # ANSI Escape Codes - Foreground colors - # | Code | Color | - # | 39 | Default foreground color | - # | 30 | Black | - # | 31 | Red | - # | 32 | Green | - # | 33 | Yellow | - # | 34 | Blue | - # | 35 | Magenta | - # | 36 | Cyan | - # | 37 | Light gray | - # | 90 | Dark gray | - # | 91 | Light red | - # | 92 | Light green | - # | 93 | Light yellow | - # | 94 | Light blue | - # | 95 | Light magenta | - # | 96 | Light cyan | - # | 97 | White | - - case colour - when :black then 30 - when :red, :failure then 31 - when :green, :success then 32 - when :yellow then 33 - when :blue, :narrative then 34 - when :purple, :magenta then 35 - when :cyan, :output then 36 - when :white, :default_white then 37 - when :default then 39 - else - 39 - end - end - - def out_c(mode, colour, str) - case RUBY_PLATFORM - when /(win|w)32$/ - change_to(colour) - $stdout.puts str if mode == :puts - $stdout.print str if mode == :print - change_to(:default_white) - else - $stdout.puts("#{change_to(colour)}#{str}\033[0m") if mode == :puts - $stdout.print("#{change_to(colour)}#{str}\033[0m") if mode == :print - end - end -end - -def colour_puts(role, str) - ColourCommandLine.new.out_c(:puts, role, str) -end - -def colour_print(role, str) - ColourCommandLine.new.out_c(:print, role, str) -end diff --git a/components/testframework/libs/cmock/vendor/unity/auto/colour_reporter.rb b/components/testframework/libs/cmock/vendor/unity/auto/colour_reporter.rb deleted file mode 100644 index 1c3bc2162..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/colour_reporter.rb +++ /dev/null @@ -1,39 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -require_relative 'colour_prompt' - -$colour_output = true - -def report(message) - if !$colour_output - $stdout.puts(message) - else - message = message.join('\n') if message.class == Array - message.each_line do |line| - line.chomp! - colour = case line - when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i - Regexp.last_match(1).to_i.zero? ? :green : :red - when /PASS/ - :green - when /^OK$/ - :green - when /(?:FAIL|ERROR)/ - :red - when /IGNORE/ - :yellow - when /^(?:Creating|Compiling|Linking)/ - :white - else - :silver - end - colour_puts(colour, line) - end - end - $stdout.flush - $stderr.flush -end diff --git a/components/testframework/libs/cmock/vendor/unity/auto/generate_config.yml b/components/testframework/libs/cmock/vendor/unity/auto/generate_config.yml deleted file mode 100644 index 4a5e47424..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/generate_config.yml +++ /dev/null @@ -1,36 +0,0 @@ -#this is a sample configuration file for generate_module -#you would use it by calling generate_module with the -ygenerate_config.yml option -#files like this are useful for customizing generate_module to your environment -:generate_module: - :defaults: - #these defaults are used in place of any missing options at the command line - :path_src: ../src/ - :path_inc: ../src/ - :path_tst: ../test/ - :update_svn: true - :includes: - #use [] for no additional includes, otherwise list the includes on separate lines - :src: - - Defs.h - - Board.h - :inc: [] - :tst: - - Defs.h - - Board.h - - Exception.h - :boilerplates: - #these are inserted at the top of generated files. - #just comment out or remove if not desired. - #use %1$s where you would like the file name to appear (path/extension not included) - :src: | - //------------------------------------------- - // %1$s.c - //------------------------------------------- - :inc: | - //------------------------------------------- - // %1$s.h - //------------------------------------------- - :tst: | - //------------------------------------------- - // Test%1$s.c : Units tests for %1$s.c - //------------------------------------------- diff --git a/components/testframework/libs/cmock/vendor/unity/auto/generate_module.rb b/components/testframework/libs/cmock/vendor/unity/auto/generate_module.rb deleted file mode 100644 index 3d9ee8d6d..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/generate_module.rb +++ /dev/null @@ -1,312 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -# This script creates all the files with start code necessary for a new module. -# A simple module only requires a source file, header file, and test file. -# Triad modules require a source, header, and test file for each triad type (like model, conductor, and hardware). - -require 'rubygems' -require 'fileutils' -require 'pathname' - -# TEMPLATE_TST -TEMPLATE_TST ||= '#include "unity.h" - -%2$s#include "%1$s.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void test_%4$s_NeedToImplement(void) -{ - TEST_IGNORE_MESSAGE("Need to Implement %1$s"); -} -'.freeze - -# TEMPLATE_SRC -TEMPLATE_SRC ||= '%2$s#include "%1$s.h" -'.freeze - -# TEMPLATE_INC -TEMPLATE_INC ||= '#ifndef %3$s_H -#define %3$s_H -%2$s - -#endif // %3$s_H -'.freeze - -class UnityModuleGenerator - ############################ - def initialize(options = nil) - @options = UnityModuleGenerator.default_options - case options - when NilClass then @options - when String then @options.merge!(UnityModuleGenerator.grab_config(options)) - when Hash then @options.merge!(options) - else raise 'If you specify arguments, it should be a filename or a hash of options' - end - - # Create default file paths if none were provided - @options[:path_src] = "#{__dir__}/../src/" if @options[:path_src].nil? - @options[:path_inc] = @options[:path_src] if @options[:path_inc].nil? - @options[:path_tst] = "#{__dir__}/../test/" if @options[:path_tst].nil? - @options[:path_src] += '/' unless @options[:path_src][-1] == 47 - @options[:path_inc] += '/' unless @options[:path_inc][-1] == 47 - @options[:path_tst] += '/' unless @options[:path_tst][-1] == 47 - - # Built in patterns - @patterns = { - 'src' => { - '' => { inc: [] } - }, - 'test' => { - '' => { inc: [] } - }, - 'dh' => { - 'Driver' => { inc: [create_filename('%1$s', 'Hardware.h')] }, - 'Hardware' => { inc: [] } - }, - 'dih' => { - 'Driver' => { inc: [create_filename('%1$s', 'Hardware.h'), create_filename('%1$s', 'Interrupt.h')] }, - 'Interrupt' => { inc: [create_filename('%1$s', 'Hardware.h')] }, - 'Hardware' => { inc: [] } - }, - 'mch' => { - 'Model' => { inc: [] }, - 'Conductor' => { inc: [create_filename('%1$s', 'Model.h'), create_filename('%1$s', 'Hardware.h')] }, - 'Hardware' => { inc: [] } - }, - 'mvp' => { - 'Model' => { inc: [] }, - 'Presenter' => { inc: [create_filename('%1$s', 'Model.h'), create_filename('%1$s', 'View.h')] }, - 'View' => { inc: [] } - } - } - end - - ############################ - def self.default_options - { - pattern: 'src', - includes: { - src: [], - inc: [], - tst: [] - }, - update_svn: false, - boilerplates: {}, - test_prefix: 'Test', - mock_prefix: 'Mock' - } - end - - ############################ - def self.grab_config(config_file) - options = default_options - unless config_file.nil? || config_file.empty? - require 'yaml' - yaml_guts = YAML.load_file(config_file) - options.merge!(yaml_guts[:unity] || yaml_guts[:cmock]) - raise "No :unity or :cmock section found in #{config_file}" unless options - end - options - end - - ############################ - def files_to_operate_on(module_name, pattern = nil) - # strip any leading path information from the module name and save for later - subfolder = File.dirname(module_name) - module_name = File.basename(module_name) - - # create triad definition - prefix = @options[:test_prefix] || 'Test' - triad = [{ ext: '.c', path: @options[:path_src], prefix: '', template: TEMPLATE_SRC, inc: :src, boilerplate: @options[:boilerplates][:src] }, - { ext: '.h', path: @options[:path_inc], prefix: '', template: TEMPLATE_INC, inc: :inc, boilerplate: @options[:boilerplates][:inc] }, - { ext: '.c', path: @options[:path_tst], prefix: prefix, template: TEMPLATE_TST, inc: :tst, boilerplate: @options[:boilerplates][:tst] }] - - # prepare the pattern for use - pattern = (pattern || @options[:pattern] || 'src').downcase - patterns = @patterns[pattern] - raise "ERROR: The design pattern '#{pattern}' specified isn't one that I recognize!" if patterns.nil? - - # single file patterns (currently just 'test') can reject the other parts of the triad - triad.select! { |v| v[:inc] == :tst } if pattern == 'test' - - # Assemble the path/names of the files we need to work with. - files = [] - triad.each do |cfg| - patterns.each_pair do |pattern_file, pattern_traits| - submodule_name = create_filename(module_name, pattern_file) - filename = cfg[:prefix] + submodule_name + cfg[:ext] - files << { - path: (Pathname.new("#{cfg[:path]}#{subfolder}") + filename).cleanpath, - name: submodule_name, - template: cfg[:template], - boilerplate: cfg[:boilerplate], - includes: case (cfg[:inc]) - when :src then (@options[:includes][:src] || []) | (pattern_traits[:inc].map { |f| format(f, module_name) }) - when :inc then (@options[:includes][:inc] || []) - when :tst then (@options[:includes][:tst] || []) | (pattern_traits[:inc].map { |f| format("#{@options[:mock_prefix]}#{f}", module_name) }) - end - } - end - end - - files - end - - ############################ - def neutralize_filename(name, start_cap=true) - return name if name.empty? - name = name.split(/(?:\s+|_|(?=[A-Z][a-z]))|(?<=[a-z])(?=[A-Z])/).map{|v|v.capitalize}.join('_') - if start_cap - return name - else - return name[0].downcase + name[1..-1] - end - end - - ############################ - def create_filename(part1, part2 = '') - name = part2.empty? ? part1 : part1 + '_' + part2 - case (@options[:naming]) - when 'bumpy' then neutralize_filename(name,false).gsub('_','') - when 'camel' then neutralize_filename(name).gsub('_','') - when 'snake' then neutralize_filename(name).downcase - when 'caps' then neutralize_filename(name).upcase - else name - end - end - - ############################ - def generate(module_name, pattern = nil) - files = files_to_operate_on(module_name, pattern) - - # Abort if all of the module files already exist - all_files_exist = true - files.each do |file| - all_files_exist = false unless File.exist?(file[:path]) - end - raise "ERROR: File #{files[0][:name]} already exists. Exiting." if all_files_exist - - # Create Source Modules - files.each_with_index do |file, _i| - # If this file already exists, don't overwrite it. - if File.exist?(file[:path]) - puts "File #{file[:path]} already exists!" - next - end - # Create the path first if necessary. - FileUtils.mkdir_p(File.dirname(file[:path]), verbose: false) - File.open(file[:path], 'w') do |f| - f.write("#{file[:boilerplate]}\n" % [file[:name]]) unless file[:boilerplate].nil? - f.write(file[:template] % [file[:name], - file[:includes].map { |ff| "#include \"#{ff}\"\n" }.join, - file[:name].upcase.gsub(/-/, '_'), - file[:name].gsub(/-/, '_')]) - end - if @options[:update_svn] - `svn add \"#{file[:path]}\"` - if $!.exitstatus.zero? - puts "File #{file[:path]} created and added to source control" - else - puts "File #{file[:path]} created but FAILED adding to source control!" - end - else - puts "File #{file[:path]} created" - end - end - puts 'Generate Complete' - end - - ############################ - def destroy(module_name, pattern = nil) - files_to_operate_on(module_name, pattern).each do |filespec| - file = filespec[:path] - if File.exist?(file) - if @options[:update_svn] - `svn delete \"#{file}\" --force` - puts "File #{file} deleted and removed from source control" - else - FileUtils.remove(file) - puts "File #{file} deleted" - end - else - puts "File #{file} does not exist so cannot be removed." - end - end - puts 'Destroy Complete' - end -end - -############################ -# Handle As Command Line If Called That Way -if $0 == __FILE__ - destroy = false - options = {} - module_name = nil - - # Parse the command line parameters. - ARGV.each do |arg| - case arg - when /^-d/ then destroy = true - when /^-u/ then options[:update_svn] = true - when /^-p\"?(\w+)\"?/ then options[:pattern] = Regexp.last_match(1) - when /^-s\"?(.+)\"?/ then options[:path_src] = Regexp.last_match(1) - when /^-i\"?(.+)\"?/ then options[:path_inc] = Regexp.last_match(1) - when /^-t\"?(.+)\"?/ then options[:path_tst] = Regexp.last_match(1) - when /^-n\"?(.+)\"?/ then options[:naming] = Regexp.last_match(1) - when /^-y\"?(.+)\"?/ then options = UnityModuleGenerator.grab_config(Regexp.last_match(1)) - when /^(\w+)/ - raise "ERROR: You can't have more than one Module name specified!" unless module_name.nil? - - module_name = arg - when /^-(h|-help)/ - ARGV = [].freeze - else - raise "ERROR: Unknown option specified '#{arg}'" - end - end - - unless ARGV[0] - puts ["\nGENERATE MODULE\n-------- ------", - "\nUsage: ruby generate_module [options] module_name", - " -i\"include\" sets the path to output headers to 'include' (DEFAULT ../src)", - " -s\"../src\" sets the path to output source to '../src' (DEFAULT ../src)", - " -t\"C:/test\" sets the path to output source to 'C:/test' (DEFAULT ../test)", - ' -p"MCH" sets the output pattern to MCH.', - ' dh - driver hardware.', - ' dih - driver interrupt hardware.', - ' mch - model conductor hardware.', - ' mvp - model view presenter.', - ' src - just a source module, header and test. (DEFAULT)', - ' test - just a test file.', - ' -d destroy module instead of creating it.', - ' -n"camel" sets the file naming convention.', - ' bumpy - BumpyCaseFilenames.', - ' camel - camelCaseFilenames.', - ' snake - snake_case_filenames.', - ' caps - CAPS_CASE_FILENAMES.', - ' -u update subversion too (requires subversion command line)', - ' -y"my.yml" selects a different yaml config file for module generation', - ''].join("\n") - exit - end - - raise 'ERROR: You must have a Module name specified! (use option -h for help)' if module_name.nil? - - if destroy - UnityModuleGenerator.new(options).destroy(module_name) - else - UnityModuleGenerator.new(options).generate(module_name) - end - -end diff --git a/components/testframework/libs/cmock/vendor/unity/auto/generate_test_runner.rb b/components/testframework/libs/cmock/vendor/unity/auto/generate_test_runner.rb deleted file mode 100644 index faa8f0421..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/generate_test_runner.rb +++ /dev/null @@ -1,511 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -class UnityTestRunnerGenerator - def initialize(options = nil) - @options = UnityTestRunnerGenerator.default_options - case options - when NilClass - @options - when String - @options.merge!(UnityTestRunnerGenerator.grab_config(options)) - when Hash - # Check if some of these have been specified - @options[:has_setup] = !options[:setup_name].nil? - @options[:has_teardown] = !options[:teardown_name].nil? - @options[:has_suite_setup] = !options[:suite_setup].nil? - @options[:has_suite_teardown] = !options[:suite_teardown].nil? - @options.merge!(options) - else - raise 'If you specify arguments, it should be a filename or a hash of options' - end - require_relative 'type_sanitizer' - end - - def self.default_options - { - includes: [], - defines: [], - plugins: [], - framework: :unity, - test_prefix: 'test|spec|should', - mock_prefix: 'Mock', - mock_suffix: '', - setup_name: 'setUp', - teardown_name: 'tearDown', - test_reset_name: 'resetTest', - test_verify_name: 'verifyTest', - main_name: 'main', # set to :auto to automatically generate each time - main_export_decl: '', - cmdline_args: false, - omit_begin_end: false, - use_param_tests: false, - include_extensions: '(?:hpp|hh|H|h)', - source_extensions: '(?:cpp|cc|ino|C|c)' - } - end - - def self.grab_config(config_file) - options = default_options - unless config_file.nil? || config_file.empty? - require 'yaml' - yaml_guts = YAML.load_file(config_file) - options.merge!(yaml_guts[:unity] || yaml_guts[:cmock]) - raise "No :unity or :cmock section found in #{config_file}" unless options - end - options - end - - def run(input_file, output_file, options = nil) - @options.merge!(options) unless options.nil? - - # pull required data from source file - source = File.read(input_file) - source = source.force_encoding('ISO-8859-1').encode('utf-8', replace: nil) - tests = find_tests(source) - headers = find_includes(source) - testfile_includes = (headers[:local] + headers[:system]) - used_mocks = find_mocks(testfile_includes) - testfile_includes = (testfile_includes - used_mocks) - testfile_includes.delete_if { |inc| inc =~ /(unity|cmock)/ } - find_setup_and_teardown(source) - - # build runner file - generate(input_file, output_file, tests, used_mocks, testfile_includes) - - # determine which files were used to return them - all_files_used = [input_file, output_file] - all_files_used += testfile_includes.map { |filename| filename + '.c' } unless testfile_includes.empty? - all_files_used += @options[:includes] unless @options[:includes].empty? - all_files_used += headers[:linkonly] unless headers[:linkonly].empty? - all_files_used.uniq - end - - def generate(input_file, output_file, tests, used_mocks, testfile_includes) - File.open(output_file, 'w') do |output| - create_header(output, used_mocks, testfile_includes) - create_externs(output, tests, used_mocks) - create_mock_management(output, used_mocks) - create_setup(output) - create_teardown(output) - create_suite_setup(output) - create_suite_teardown(output) - create_reset(output) - create_run_test(output) unless tests.empty? - create_args_wrappers(output, tests) - create_main(output, input_file, tests, used_mocks) - end - - return unless @options[:header_file] && !@options[:header_file].empty? - - File.open(@options[:header_file], 'w') do |output| - create_h_file(output, @options[:header_file], tests, testfile_includes, used_mocks) - end - end - - def find_tests(source) - tests_and_line_numbers = [] - - # contains characters which will be substituted from within strings, doing - # this prevents these characters from interfering with scrubbers - # @ is not a valid C character, so there should be no clashes with files genuinely containing these markers - substring_subs = { '{' => '@co@', '}' => '@cc@', ';' => '@ss@', '/' => '@fs@' } - substring_re = Regexp.union(substring_subs.keys) - substring_unsubs = substring_subs.invert # the inverse map will be used to fix the strings afterwords - substring_unsubs['@quote@'] = '\\"' - substring_unsubs['@apos@'] = '\\\'' - substring_unre = Regexp.union(substring_unsubs.keys) - source_scrubbed = source.clone - source_scrubbed = source_scrubbed.gsub(/\\"/, '@quote@') # hide escaped quotes to allow capture of the full string/char - source_scrubbed = source_scrubbed.gsub(/\\'/, '@apos@') # hide escaped apostrophes to allow capture of the full string/char - source_scrubbed = source_scrubbed.gsub(/("[^"\n]*")|('[^'\n]*')/) { |s| s.gsub(substring_re, substring_subs) } # temporarily hide problematic characters within strings - source_scrubbed = source_scrubbed.gsub(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks - source_scrubbed = source_scrubbed.gsub(/\/\*.*?\*\//m, '') # remove block comments - source_scrubbed = source_scrubbed.gsub(/\/\/.*$/, '') # remove line comments (all that remain) - lines = source_scrubbed.split(/(^\s*\#.*$) | (;|\{|\}) /x) # Treat preprocessor directives as a logical line. Match ;, {, and } as end of lines - .map { |line| line.gsub(substring_unre, substring_unsubs) } # unhide the problematic characters previously removed - - lines.each_with_index do |line, _index| - # find tests - next unless line =~ /^((?:\s*(?:TEST_CASE|TEST_RANGE)\s*\(.*?\)\s*)*)\s*void\s+((?:#{@options[:test_prefix]}).*)\s*\(\s*(.*)\s*\)/m - - arguments = Regexp.last_match(1) - name = Regexp.last_match(2) - call = Regexp.last_match(3) - params = Regexp.last_match(4) - args = nil - - if @options[:use_param_tests] && !arguments.empty? - args = [] - arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) { |a| args << a[0] } - - arguments.scan(/\s*TEST_RANGE\s*\((.*)\)\s*$/).flatten.each do |range_str| - args += range_str.scan(/\[(-?\d+.?\d*), *(-?\d+.?\d*), *(-?\d+.?\d*)\]/).map do |arg_values_str| - arg_values_str.map do |arg_value_str| - arg_value_str.include?('.') ? arg_value_str.to_f : arg_value_str.to_i - end - end.map do |arg_values| - (arg_values[0]..arg_values[1]).step(arg_values[2]).to_a - end.reduce do |result, arg_range_expanded| - result.product(arg_range_expanded) - end.map do |arg_combinations| - arg_combinations.flatten.join(', ') - end - end - end - - tests_and_line_numbers << { test: name, args: args, call: call, params: params, line_number: 0 } - end - - tests_and_line_numbers.uniq! { |v| v[:test] } - - # determine line numbers and create tests to run - source_lines = source.split("\n") - source_index = 0 - tests_and_line_numbers.size.times do |i| - source_lines[source_index..-1].each_with_index do |line, index| - next unless line =~ /\s+#{tests_and_line_numbers[i][:test]}(?:\s|\()/ - - source_index += index - tests_and_line_numbers[i][:line_number] = source_index + 1 - break - end - end - - tests_and_line_numbers - end - - def find_includes(source) - # remove comments (block and line, in three steps to ensure correct precedence) - source.gsub!(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks - source.gsub!(/\/\*.*?\*\//m, '') # remove block comments - source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain) - - # parse out includes - includes = { - local: source.scan(/^\s*#include\s+\"\s*(.+\.#{@options[:include_extensions]})\s*\"/).flatten, - system: source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" }, - linkonly: source.scan(/^TEST_FILE\(\s*\"\s*(.+\.#{@options[:source_extensions]})\s*\"/).flatten - } - includes - end - - def find_mocks(includes) - mock_headers = [] - includes.each do |include_path| - include_file = File.basename(include_path) - mock_headers << include_path if include_file =~ /^#{@options[:mock_prefix]}.*#{@options[:mock_suffix]}$/i - end - mock_headers - end - - def find_setup_and_teardown(source) - @options[:has_setup] = source =~ /void\s+#{@options[:setup_name]}\s*\(/ - @options[:has_teardown] = source =~ /void\s+#{@options[:teardown_name]}\s*\(/ - @options[:has_suite_setup] ||= (source =~ /void\s+suiteSetUp\s*\(/) - @options[:has_suite_teardown] ||= (source =~ /int\s+suiteTearDown\s*\(int\s+([a-zA-Z0-9_])+\s*\)/) - end - - def create_header(output, mocks, testfile_includes = []) - output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') - output.puts("\n/*=======Automagically Detected Files To Include=====*/") - output.puts("#include \"#{@options[:framework]}.h\"") - output.puts('#include "cmock.h"') unless mocks.empty? - if @options[:defines] && !@options[:defines].empty? - @options[:defines].each { |d| output.puts("#ifndef #{d}\n#define #{d}\n#endif /* #{d} */") } - end - if @options[:header_file] && !@options[:header_file].empty? - output.puts("#include \"#{File.basename(@options[:header_file])}\"") - else - @options[:includes].flatten.uniq.compact.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") - end - testfile_includes.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") - end - end - mocks.each do |mock| - output.puts("#include \"#{mock}\"") - end - output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception) - - return unless @options[:enforce_strict_ordering] - - output.puts('') - output.puts('int GlobalExpectCount;') - output.puts('int GlobalVerifyOrder;') - output.puts('char* GlobalOrderError;') - end - - def create_externs(output, tests, _mocks) - output.puts("\n/*=======External Functions This Runner Calls=====*/") - output.puts("extern void #{@options[:setup_name]}(void);") - output.puts("extern void #{@options[:teardown_name]}(void);") - output.puts("\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif") if @options[:externc] - tests.each do |test| - output.puts("extern void #{test[:test]}(#{test[:call] || 'void'});") - end - output.puts("#ifdef __cplusplus\n}\n#endif") if @options[:externc] - output.puts('') - end - - def create_mock_management(output, mock_headers) - output.puts("\n/*=======Mock Management=====*/") - output.puts('static void CMock_Init(void)') - output.puts('{') - - if @options[:enforce_strict_ordering] - output.puts(' GlobalExpectCount = 0;') - output.puts(' GlobalVerifyOrder = 0;') - output.puts(' GlobalOrderError = NULL;') - end - - mocks = mock_headers.map { |mock| File.basename(mock, '.*') } - mocks.each do |mock| - mock_clean = TypeSanitizer.sanitize_c_identifier(mock) - output.puts(" #{mock_clean}_Init();") - end - output.puts("}\n") - - output.puts('static void CMock_Verify(void)') - output.puts('{') - mocks.each do |mock| - mock_clean = TypeSanitizer.sanitize_c_identifier(mock) - output.puts(" #{mock_clean}_Verify();") - end - output.puts("}\n") - - output.puts('static void CMock_Destroy(void)') - output.puts('{') - mocks.each do |mock| - mock_clean = TypeSanitizer.sanitize_c_identifier(mock) - output.puts(" #{mock_clean}_Destroy();") - end - output.puts("}\n") - end - - def create_setup(output) - return if @options[:has_setup] - - output.puts("\n/*=======Setup (stub)=====*/") - output.puts("void #{@options[:setup_name]}(void) {}") - end - - def create_teardown(output) - return if @options[:has_teardown] - - output.puts("\n/*=======Teardown (stub)=====*/") - output.puts("void #{@options[:teardown_name]}(void) {}") - end - - def create_suite_setup(output) - return if @options[:suite_setup].nil? - - output.puts("\n/*=======Suite Setup=====*/") - output.puts('void suiteSetUp(void)') - output.puts('{') - output.puts(@options[:suite_setup]) - output.puts('}') - end - - def create_suite_teardown(output) - return if @options[:suite_teardown].nil? - - output.puts("\n/*=======Suite Teardown=====*/") - output.puts('int suiteTearDown(int num_failures)') - output.puts('{') - output.puts(@options[:suite_teardown]) - output.puts('}') - end - - def create_reset(output) - output.puts("\n/*=======Test Reset Options=====*/") - output.puts("void #{@options[:test_reset_name]}(void);") - output.puts("void #{@options[:test_reset_name]}(void)") - output.puts('{') - output.puts(" #{@options[:teardown_name]}();") - output.puts(' CMock_Verify();') - output.puts(' CMock_Destroy();') - output.puts(' CMock_Init();') - output.puts(" #{@options[:setup_name]}();") - output.puts('}') - output.puts("void #{@options[:test_verify_name]}(void);") - output.puts("void #{@options[:test_verify_name]}(void)") - output.puts('{') - output.puts(' CMock_Verify();') - output.puts('}') - end - - def create_run_test(output) - require 'erb' - template = ERB.new(File.read(File.join(__dir__, 'run_test.erb')), nil, '<>') - output.puts("\n" + template.result(binding)) - end - - def create_args_wrappers(output, tests) - return unless @options[:use_param_tests] - - output.puts("\n/*=======Parameterized Test Wrappers=====*/") - tests.each do |test| - next if test[:args].nil? || test[:args].empty? - - test[:args].each.with_index(1) do |args, idx| - output.puts("static void runner_args#{idx}_#{test[:test]}(void)") - output.puts('{') - output.puts(" #{test[:test]}(#{args});") - output.puts("}\n") - end - end - end - - def create_main(output, filename, tests, used_mocks) - output.puts("\n/*=======MAIN=====*/") - main_name = @options[:main_name].to_sym == :auto ? "main_#{filename.gsub('.c', '')}" : (@options[:main_name]).to_s - if @options[:cmdline_args] - if main_name != 'main' - output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv);") - end - output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv)") - output.puts('{') - output.puts(' int parse_status = UnityParseOptions(argc, argv);') - output.puts(' if (parse_status != 0)') - output.puts(' {') - output.puts(' if (parse_status < 0)') - output.puts(' {') - output.puts(" UnityPrint(\"#{filename.gsub('.c', '')}.\");") - output.puts(' UNITY_PRINT_EOL();') - tests.each do |test| - if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty? - output.puts(" UnityPrint(\" #{test[:test]}\");") - output.puts(' UNITY_PRINT_EOL();') - else - test[:args].each do |args| - output.puts(" UnityPrint(\" #{test[:test]}(#{args})\");") - output.puts(' UNITY_PRINT_EOL();') - end - end - end - output.puts(' return 0;') - output.puts(' }') - output.puts(' return parse_status;') - output.puts(' }') - else - main_return = @options[:omit_begin_end] ? 'void' : 'int' - if main_name != 'main' - output.puts("#{@options[:main_export_decl]} #{main_return} #{main_name}(void);") - end - output.puts("#{main_return} #{main_name}(void)") - output.puts('{') - end - output.puts(' suiteSetUp();') if @options[:has_suite_setup] - if @options[:omit_begin_end] - output.puts(" UnitySetTestFile(\"#{filename.gsub(/\\/, '\\\\\\')}\");") - else - output.puts(" UnityBegin(\"#{filename.gsub(/\\/, '\\\\\\')}\");") - end - tests.each do |test| - if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty? - output.puts(" run_test(#{test[:test]}, \"#{test[:test]}\", #{test[:line_number]});") - else - test[:args].each.with_index(1) do |args, idx| - wrapper = "runner_args#{idx}_#{test[:test]}" - testname = "#{test[:test]}(#{args})".dump - output.puts(" run_test(#{wrapper}, #{testname}, #{test[:line_number]});") - end - end - end - output.puts - output.puts(' CMock_Guts_MemFreeFinal();') unless used_mocks.empty? - if @options[:has_suite_teardown] - if @options[:omit_begin_end] - output.puts(' (void) suite_teardown(0);') - else - output.puts(' return suiteTearDown(UnityEnd());') - end - else - output.puts(' return UnityEnd();') unless @options[:omit_begin_end] - end - output.puts('}') - end - - def create_h_file(output, filename, tests, testfile_includes, used_mocks) - filename = File.basename(filename).gsub(/[-\/\\\.\,\s]/, '_').upcase - output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') - output.puts("#ifndef _#{filename}") - output.puts("#define _#{filename}\n\n") - output.puts("#include \"#{@options[:framework]}.h\"") - output.puts('#include "cmock.h"') unless used_mocks.empty? - @options[:includes].flatten.uniq.compact.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") - end - testfile_includes.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") - end - output.puts "\n" - tests.each do |test| - if test[:params].nil? || test[:params].empty? - output.puts("void #{test[:test]}(void);") - else - output.puts("void #{test[:test]}(#{test[:params]});") - end - end - output.puts("#endif\n\n") - end -end - -if $0 == __FILE__ - options = { includes: [] } - - # parse out all the options first (these will all be removed as we go) - ARGV.reject! do |arg| - case arg - when '-cexception' - options[:plugins] = [:cexception] - true - when /\.*\.ya?ml$/ - options = UnityTestRunnerGenerator.grab_config(arg) - true - when /--(\w+)=\"?(.*)\"?/ - options[Regexp.last_match(1).to_sym] = Regexp.last_match(2) - true - when /\.*\.(?:hpp|hh|H|h)$/ - options[:includes] << arg - true - else false - end - end - - # make sure there is at least one parameter left (the input file) - unless ARGV[0] - puts ["\nusage: ruby #{__FILE__} (files) (options) input_test_file (output)", - "\n input_test_file - this is the C file you want to create a runner for", - ' output - this is the name of the runner file to generate', - ' defaults to (input_test_file)_Runner', - ' files:', - ' *.yml / *.yaml - loads configuration from here in :unity or :cmock', - ' *.h - header files are added as #includes in runner', - ' options:', - ' -cexception - include cexception support', - ' -externc - add extern "C" for cpp support', - ' --setup_name="" - redefine setUp func name to something else', - ' --teardown_name="" - redefine tearDown func name to something else', - ' --main_name="" - redefine main func name to something else', - ' --test_prefix="" - redefine test prefix from default test|spec|should', - ' --test_reset_name="" - redefine resetTest func name to something else', - ' --test_verify_name="" - redefine verifyTest func name to something else', - ' --suite_setup="" - code to execute for setup of entire suite', - ' --suite_teardown="" - code to execute for teardown of entire suite', - ' --use_param_tests=1 - enable parameterized tests (disabled by default)', - ' --omit_begin_end=1 - omit calls to UnityBegin and UnityEnd (disabled by default)', - ' --header_file="" - path/name of test header file to generate too'].join("\n") - exit 1 - end - - # create the default test runner name if not specified - ARGV[1] = ARGV[0].gsub('.c', '_Runner.c') unless ARGV[1] - - UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1]) -end diff --git a/components/testframework/libs/cmock/vendor/unity/auto/parse_output.rb b/components/testframework/libs/cmock/vendor/unity/auto/parse_output.rb deleted file mode 100644 index d72c6e8b2..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/parse_output.rb +++ /dev/null @@ -1,322 +0,0 @@ -#============================================================ -# Author: John Theofanopoulos -# A simple parser. Takes the output files generated during the -# build process and extracts information relating to the tests. -# -# Notes: -# To capture an output file under VS builds use the following: -# devenv [build instructions] > Output.txt & type Output.txt -# -# To capture an output file under Linux builds use the following: -# make | tee Output.txt -# -# This script can handle the following output formats: -# - normal output (raw unity) -# - fixture output (unity_fixture.h/.c) -# - fixture output with verbose flag set ("-v") -# -# To use this parser use the following command -# ruby parseOutput.rb [options] [file] -# options: -xml : produce a JUnit compatible XML file -# file: file to scan for results -#============================================================ - -# Parser class for handling the input file -class ParseOutput - def initialize - # internal data - @class_name_idx = 0 - @path_delim = nil - - # xml output related - @xml_out = false - @array_list = false - - # current suite name and statistics - @test_suite = nil - @total_tests = 0 - @test_passed = 0 - @test_failed = 0 - @test_ignored = 0 - end - - # Set the flag to indicate if there will be an XML output file or not - def set_xml_output - @xml_out = true - end - - # If write our output to XML - def write_xml_output - output = File.open('report.xml', 'w') - output << "\n" - @array_list.each do |item| - output << item << "\n" - end - end - - # Pushes the suite info as xml to the array list, which will be written later - def push_xml_output_suite_info - # Insert opening tag at front - heading = '' - @array_list.insert(0, heading) - # Push back the closing tag - @array_list.push '' - end - - # Pushes xml output data to the array list, which will be written later - def push_xml_output_passed(test_name) - @array_list.push ' ' - end - - # Pushes xml output data to the array list, which will be written later - def push_xml_output_failed(test_name, reason) - @array_list.push ' ' - @array_list.push ' ' + reason + '' - @array_list.push ' ' - end - - # Pushes xml output data to the array list, which will be written later - def push_xml_output_ignored(test_name, reason) - @array_list.push ' ' - @array_list.push ' ' + reason + '' - @array_list.push ' ' - end - - # This function will try and determine when the suite is changed. This is - # is the name that gets added to the classname parameter. - def test_suite_verify(test_suite_name) - # Split the path name - test_name = test_suite_name.split(@path_delim) - - # Remove the extension and extract the base_name - base_name = test_name[test_name.size - 1].split('.')[0] - - # Return if the test suite hasn't changed - return unless base_name.to_s != @test_suite.to_s - - @test_suite = base_name - printf "New Test: %s\n", @test_suite - end - - # Prepares the line for verbose fixture output ("-v") - def prepare_fixture_line(line) - line = line.sub('IGNORE_TEST(', '') - line = line.sub('TEST(', '') - line = line.sub(')', ',') - line = line.chomp - array = line.split(',') - array.map { |x| x.to_s.lstrip.chomp } - end - - # Test was flagged as having passed so format the output. - # This is using the Unity fixture output and not the original Unity output. - def test_passed_unity_fixture(array) - class_name = array[0] - test_name = array[1] - test_suite_verify(class_name) - printf "%-40s PASS\n", test_name - - push_xml_output_passed(test_name) if @xml_out - end - - # Test was flagged as having failed so format the output. - # This is using the Unity fixture output and not the original Unity output. - def test_failed_unity_fixture(array) - class_name = array[0] - test_name = array[1] - test_suite_verify(class_name) - reason_array = array[2].split(':') - reason = reason_array[-1].lstrip.chomp + ' at line: ' + reason_array[-4] - - printf "%-40s FAILED\n", test_name - - push_xml_output_failed(test_name, reason) if @xml_out - end - - # Test was flagged as being ignored so format the output. - # This is using the Unity fixture output and not the original Unity output. - def test_ignored_unity_fixture(array) - class_name = array[0] - test_name = array[1] - reason = 'No reason given' - if array.size > 2 - reason_array = array[2].split(':') - tmp_reason = reason_array[-1].lstrip.chomp - reason = tmp_reason == 'IGNORE' ? 'No reason given' : tmp_reason - end - test_suite_verify(class_name) - printf "%-40s IGNORED\n", test_name - - push_xml_output_ignored(test_name, reason) if @xml_out - end - - # Test was flagged as having passed so format the output - def test_passed(array) - last_item = array.length - 1 - test_name = array[last_item - 1] - test_suite_verify(array[@class_name_idx]) - printf "%-40s PASS\n", test_name - - return unless @xml_out - - push_xml_output_passed(test_name) if @xml_out - end - - # Test was flagged as having failed so format the line - def test_failed(array) - last_item = array.length - 1 - test_name = array[last_item - 2] - reason = array[last_item].chomp.lstrip + ' at line: ' + array[last_item - 3] - class_name = array[@class_name_idx] - - if test_name.start_with? 'TEST(' - array2 = test_name.split(' ') - - test_suite = array2[0].sub('TEST(', '') - test_suite = test_suite.sub(',', '') - class_name = test_suite - - test_name = array2[1].sub(')', '') - end - - test_suite_verify(class_name) - printf "%-40s FAILED\n", test_name - - push_xml_output_failed(test_name, reason) if @xml_out - end - - # Test was flagged as being ignored so format the output - def test_ignored(array) - last_item = array.length - 1 - test_name = array[last_item - 2] - reason = array[last_item].chomp.lstrip - class_name = array[@class_name_idx] - - if test_name.start_with? 'TEST(' - array2 = test_name.split(' ') - - test_suite = array2[0].sub('TEST(', '') - test_suite = test_suite.sub(',', '') - class_name = test_suite - - test_name = array2[1].sub(')', '') - end - - test_suite_verify(class_name) - printf "%-40s IGNORED\n", test_name - - push_xml_output_ignored(test_name, reason) if @xml_out - end - - # Adjusts the os specific members according to the current path style - # (Windows or Unix based) - def detect_os_specifics(line) - if line.include? '\\' - # Windows X:\Y\Z - @class_name_idx = 1 - @path_delim = '\\' - else - # Unix Based /X/Y/Z - @class_name_idx = 0 - @path_delim = '/' - end - end - - # Main function used to parse the file that was captured. - def process(file_name) - @array_list = [] - - puts 'Parsing file: ' + file_name - - @test_passed = 0 - @test_failed = 0 - @test_ignored = 0 - puts '' - puts '=================== RESULTS =====================' - puts '' - File.open(file_name).each do |line| - # Typical test lines look like these: - # ---------------------------------------------------- - # 1. normal output: - # /.c:36:test_tc1000_opsys:FAIL: Expected 1 Was 0 - # /.c:112:test_tc5004_initCanChannel:IGNORE: Not Yet Implemented - # /.c:115:test_tc5100_initCanVoidPtrs:PASS - # - # 2. fixture output - # /.c:63:TEST(, ):FAIL: Expected 0x00001234 Was 0x00005A5A - # /.c:36:TEST(, ):IGNORE - # Note: "PASS" information won't be generated in this mode - # - # 3. fixture output with verbose information ("-v") - # TEST()/:168::FAIL: Expected 0x8D Was 0x8C - # TEST(, )/:22::IGNORE: This Test Was Ignored On Purpose - # IGNORE_TEST() - # TEST() PASS - # - # Note: Where path is different on Unix vs Windows devices (Windows leads with a drive letter)! - detect_os_specifics(line) - line_array = line.split(':') - - # If we were able to split the line then we can look to see if any of our target words - # were found. Case is important. - next unless (line_array.size >= 4) || (line.start_with? 'TEST(') || (line.start_with? 'IGNORE_TEST(') - - # check if the output is fixture output (with verbose flag "-v") - if (line.start_with? 'TEST(') || (line.start_with? 'IGNORE_TEST(') - line_array = prepare_fixture_line(line) - if line.include? ' PASS' - test_passed_unity_fixture(line_array) - @test_passed += 1 - elsif line.include? 'FAIL' - test_failed_unity_fixture(line_array) - @test_failed += 1 - elsif line.include? 'IGNORE' - test_ignored_unity_fixture(line_array) - @test_ignored += 1 - end - # normal output / fixture output (without verbose "-v") - elsif line.include? ':PASS' - test_passed(line_array) - @test_passed += 1 - elsif line.include? ':FAIL' - test_failed(line_array) - @test_failed += 1 - elsif line.include? ':IGNORE:' - test_ignored(line_array) - @test_ignored += 1 - elsif line.include? ':IGNORE' - line_array.push('No reason given') - test_ignored(line_array) - @test_ignored += 1 - end - @total_tests = @test_passed + @test_failed + @test_ignored - end - puts '' - puts '=================== SUMMARY =====================' - puts '' - puts 'Tests Passed : ' + @test_passed.to_s - puts 'Tests Failed : ' + @test_failed.to_s - puts 'Tests Ignored : ' + @test_ignored.to_s - - return unless @xml_out - - # push information about the suite - push_xml_output_suite_info - # write xml output file - write_xml_output - end -end - -# If the command line has no values in, used a default value of Output.txt -parse_my_file = ParseOutput.new - -if ARGV.size >= 1 - ARGV.each do |arg| - if arg == '-xml' - parse_my_file.set_xml_output - else - parse_my_file.process(arg) - break - end - end -end diff --git a/components/testframework/libs/cmock/vendor/unity/auto/run_test.erb b/components/testframework/libs/cmock/vendor/unity/auto/run_test.erb deleted file mode 100644 index cb7f2b509..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/run_test.erb +++ /dev/null @@ -1,37 +0,0 @@ -/*=======Test Runner Used To Run Each Test=====*/ -static void run_test(UnityTestFunction func, const char* name, int line_num) -{ - Unity.CurrentTestName = name; - Unity.CurrentTestLineNumber = line_num; -#ifdef UNITY_USE_COMMAND_LINE_ARGS - if (!UnityTestMatches()) - return; -#endif - Unity.NumberOfTests++; - UNITY_CLR_DETAILS(); - UNITY_EXEC_TIME_START(); - CMock_Init(); - if (TEST_PROTECT()) - { -<% if @options[:plugins].include?(:cexception) %> - CEXCEPTION_T e; - Try { - <%= @options[:setup_name] %>(); - func(); - } Catch(e) { - TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); - } -<% else %> - <%= @options[:setup_name] %>(); - func(); -<% end %> - } - if (TEST_PROTECT()) - { - <%= @options[:teardown_name] %>(); - CMock_Verify(); - } - CMock_Destroy(); - UNITY_EXEC_TIME_STOP(); - UnityConcludeTest(); -} diff --git a/components/testframework/libs/cmock/vendor/unity/auto/stylize_as_junit.rb b/components/testframework/libs/cmock/vendor/unity/auto/stylize_as_junit.rb deleted file mode 100755 index e01f7912a..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/stylize_as_junit.rb +++ /dev/null @@ -1,251 +0,0 @@ -#!/usr/bin/ruby -# -# unity_to_junit.rb -# -require 'fileutils' -require 'optparse' -require 'ostruct' -require 'set' - -require 'pp' - -VERSION = 1.0 - -class ArgvParser - # - # Return a structure describing the options. - # - def self.parse(args) - # The options specified on the command line will be collected in *options*. - # We set default values here. - options = OpenStruct.new - options.results_dir = '.' - options.root_path = '.' - options.out_file = 'results.xml' - - opts = OptionParser.new do |o| - o.banner = 'Usage: unity_to_junit.rb [options]' - - o.separator '' - o.separator 'Specific options:' - - o.on('-r', '--results ', 'Look for Unity Results files here.') do |results| - # puts "results #{results}" - options.results_dir = results - end - - o.on('-p', '--root_path ', 'Prepend this path to files in results.') do |root_path| - options.root_path = root_path - end - - o.on('-o', '--output ', 'XML file to generate.') do |out_file| - # puts "out_file: #{out_file}" - options.out_file = out_file - end - - o.separator '' - o.separator 'Common options:' - - # No argument, shows at tail. This will print an options summary. - o.on_tail('-h', '--help', 'Show this message') do - puts o - exit - end - - # Another typical switch to print the version. - o.on_tail('--version', 'Show version') do - puts "unity_to_junit.rb version #{VERSION}" - exit - end - end - - opts.parse!(args) - options - end -end - -class UnityToJUnit - include FileUtils::Verbose - attr_reader :report, :total_tests, :failures, :ignored - attr_writer :targets, :root, :out_file - - def initialize - @report = '' - @unit_name = '' - end - - def run - # Clean up result file names - results = @targets.map { |target| target.tr('\\', '/') } - # puts "Output File: #{@out_file}" - f = File.new(@out_file, 'w') - write_xml_header(f) - write_suites_header(f) - results.each do |result_file| - lines = File.readlines(result_file).map(&:chomp) - - raise "Empty test result file: #{result_file}" if lines.empty? - - result_output = get_details(result_file, lines) - tests, failures, ignored = parse_test_summary(lines) - result_output[:counts][:total] = tests - result_output[:counts][:failed] = failures - result_output[:counts][:ignored] = ignored - result_output[:counts][:passed] = (result_output[:counts][:total] - result_output[:counts][:failed] - result_output[:counts][:ignored]) - - # use line[0] from the test output to get the test_file path and name - test_file_str = lines[0].tr('\\', '/') - test_file_str = test_file_str.split(':') - test_file = if test_file_str.length < 2 - result_file - else - test_file_str[0] + ':' + test_file_str[1] - end - result_output[:source][:path] = File.dirname(test_file) - result_output[:source][:file] = File.basename(test_file) - - # save result_output - @unit_name = File.basename(test_file, '.*') - - write_suite_header(result_output[:counts], f) - write_failures(result_output, f) - write_tests(result_output, f) - write_ignored(result_output, f) - write_suite_footer(f) - end - write_suites_footer(f) - f.close - end - - def usage(err_msg = nil) - puts "\nERROR: " - puts err_msg if err_msg - puts 'Usage: unity_to_junit.rb [options]' - puts '' - puts 'Specific options:' - puts ' -r, --results Look for Unity Results files here.' - puts ' -p, --root_path Prepend this path to files in results.' - puts ' -o, --output XML file to generate.' - puts '' - puts 'Common options:' - puts ' -h, --help Show this message' - puts ' --version Show version' - - exit 1 - end - - protected - - def get_details(_result_file, lines) - results = results_structure - lines.each do |line| - line = line.tr('\\', '/') - _src_file, src_line, test_name, status, msg = line.split(/:/) - case status - when 'IGNORE' then results[:ignores] << { test: test_name, line: src_line, message: msg } - when 'FAIL' then results[:failures] << { test: test_name, line: src_line, message: msg } - when 'PASS' then results[:successes] << { test: test_name, line: src_line, message: msg } - end - end - results - end - - def parse_test_summary(summary) - raise "Couldn't parse test results: #{summary}" unless summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ } - - [Regexp.last_match(1).to_i, Regexp.last_match(2).to_i, Regexp.last_match(3).to_i] - end - - private - - def results_structure - { - source: { path: '', file: '' }, - successes: [], - failures: [], - ignores: [], - counts: { total: 0, passed: 0, failed: 0, ignored: 0 }, - stdout: [] - } - end - - def write_xml_header(stream) - stream.puts "" - end - - def write_suites_header(stream) - stream.puts '' - end - - def write_suite_header(counts, stream) - stream.puts "\t" - end - - def write_failures(results, stream) - result = results[:failures] - result.each do |item| - filename = File.join(results[:source][:path], File.basename(results[:source][:file], '.*')) - stream.puts "\t\t" - stream.puts "\t\t\t" - stream.puts "\t\t\t [File] #{filename} [Line] #{item[:line]} " - stream.puts "\t\t" - end - end - - def write_tests(results, stream) - result = results[:successes] - result.each do |item| - stream.puts "\t\t" - end - end - - def write_ignored(results, stream) - result = results[:ignores] - result.each do |item| - filename = File.join(results[:source][:path], File.basename(results[:source][:file], '.*')) - puts "Writing ignored tests for test harness: #{filename}" - stream.puts "\t\t" - stream.puts "\t\t\t" - stream.puts "\t\t\t [File] #{filename} [Line] #{item[:line]} " - stream.puts "\t\t" - end - end - - def write_suite_footer(stream) - stream.puts "\t" - end - - def write_suites_footer(stream) - stream.puts '' - end -end - -if $0 == __FILE__ - # parse out the command options - options = ArgvParser.parse(ARGV) - - # create an instance to work with - utj = UnityToJUnit.new - begin - # look in the specified or current directory for result files - targets = "#{options.results_dir.tr('\\', '/')}**/*.test*" - - results = Dir[targets] - - raise "No *.testpass, *.testfail, or *.testresults files found in '#{targets}'" if results.empty? - - utj.targets = results - - # set the root path - utj.root = options.root_path - - # set the output XML file name - # puts "Output File from options: #{options.out_file}" - utj.out_file = options.out_file - - # run the summarizer - puts utj.run - rescue StandardError => e - utj.usage e.message - end -end diff --git a/components/testframework/libs/cmock/vendor/unity/auto/test_file_filter.rb b/components/testframework/libs/cmock/vendor/unity/auto/test_file_filter.rb deleted file mode 100644 index 5c3a79fc6..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/test_file_filter.rb +++ /dev/null @@ -1,25 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -require'yaml' - -module RakefileHelpers - class TestFileFilter - def initialize(all_files = false) - @all_files = all_files - - return unless @all_files - return unless File.exist?('test_file_filter.yml') - - filters = YAML.load_file('test_file_filter.yml') - @all_files = filters[:all_files] - @only_files = filters[:only_files] - @exclude_files = filters[:exclude_files] - end - - attr_accessor :all_files, :only_files, :exclude_files - end -end diff --git a/components/testframework/libs/cmock/vendor/unity/auto/type_sanitizer.rb b/components/testframework/libs/cmock/vendor/unity/auto/type_sanitizer.rb deleted file mode 100644 index dafb8826e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/type_sanitizer.rb +++ /dev/null @@ -1,6 +0,0 @@ -module TypeSanitizer - def self.sanitize_c_identifier(unsanitized) - # convert filename to valid C identifier by replacing invalid chars with '_' - unsanitized.gsub(/[-\/\\\.\,\s]/, '_') - end -end diff --git a/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.py b/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.py deleted file mode 100644 index 00c0da8cc..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.py +++ /dev/null @@ -1,139 +0,0 @@ -#! python3 -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de -# [Released under MIT License. Please refer to license.txt for details] -# Based on the ruby script by Mike Karlesky, Mark VanderVoord, Greg Williams -# ========================================== -import sys -import os -import re -from glob import glob - -class UnityTestSummary: - def __init__(self): - self.report = '' - self.total_tests = 0 - self.failures = 0 - self.ignored = 0 - - def run(self): - # Clean up result file names - results = [] - for target in self.targets: - results.append(target.replace('\\', '/')) - - # Dig through each result file, looking for details on pass/fail: - failure_output = [] - ignore_output = [] - - for result_file in results: - lines = list(map(lambda line: line.rstrip(), open(result_file, "r").read().split('\n'))) - if len(lines) == 0: - raise Exception("Empty test result file: %s" % result_file) - - details = self.get_details(result_file, lines) - failures = details['failures'] - ignores = details['ignores'] - if len(failures) > 0: failure_output.append('\n'.join(failures)) - if len(ignores) > 0: ignore_output.append('n'.join(ignores)) - tests,failures,ignored = self.parse_test_summary('\n'.join(lines)) - self.total_tests += tests - self.failures += failures - self.ignored += ignored - - if self.ignored > 0: - self.report += "\n" - self.report += "--------------------------\n" - self.report += "UNITY IGNORED TEST SUMMARY\n" - self.report += "--------------------------\n" - self.report += "\n".join(ignore_output) - - if self.failures > 0: - self.report += "\n" - self.report += "--------------------------\n" - self.report += "UNITY FAILED TEST SUMMARY\n" - self.report += "--------------------------\n" - self.report += '\n'.join(failure_output) - - self.report += "\n" - self.report += "--------------------------\n" - self.report += "OVERALL UNITY TEST SUMMARY\n" - self.report += "--------------------------\n" - self.report += "{total_tests} TOTAL TESTS {failures} TOTAL FAILURES {ignored} IGNORED\n".format(total_tests = self.total_tests, failures=self.failures, ignored=self.ignored) - self.report += "\n" - - return self.report - - def set_targets(self, target_array): - self.targets = target_array - - def set_root_path(self, path): - self.root = path - - def usage(self, err_msg=None): - print("\nERROR: ") - if err_msg: - print(err_msg) - print("\nUsage: unity_test_summary.py result_file_directory/ root_path/") - print(" result_file_directory - The location of your results files.") - print(" Defaults to current directory if not specified.") - print(" Should end in / if specified.") - print(" root_path - Helpful for producing more verbose output if using relative paths.") - sys.exit(1) - - def get_details(self, result_file, lines): - results = { 'failures': [], 'ignores': [], 'successes': [] } - for line in lines: - parts = line.split(':') - if len(parts) == 5: - src_file,src_line,test_name,status,msg = parts - elif len(parts) == 4: - src_file,src_line,test_name,status = parts - msg = '' - else: - continue - if len(self.root) > 0: - line_out = "%s%s" % (self.root, line) - else: - line_out = line - if status == 'IGNORE': - results['ignores'].append(line_out) - elif status == 'FAIL': - results['failures'].append(line_out) - elif status == 'PASS': - results['successes'].append(line_out) - return results - - def parse_test_summary(self, summary): - m = re.search(r"([0-9]+) Tests ([0-9]+) Failures ([0-9]+) Ignored", summary) - if not m: - raise Exception("Couldn't parse test results: %s" % summary) - - return int(m.group(1)), int(m.group(2)), int(m.group(3)) - - -if __name__ == '__main__': - uts = UnityTestSummary() - try: - #look in the specified or current directory for result files - if len(sys.argv) > 1: - targets_dir = sys.argv[1] - else: - targets_dir = './' - targets = list(map(lambda x: x.replace('\\', '/'), glob(targets_dir + '**/*.test*', recursive=True))) - if len(targets) == 0: - raise Exception("No *.testpass or *.testfail files found in '%s'" % targets_dir) - uts.set_targets(targets) - - #set the root path - if len(sys.argv) > 2: - root_path = sys.argv[2] - else: - root_path = os.path.split(__file__)[0] - uts.set_root_path(root_path) - - #run the summarizer - print(uts.run()) - except Exception as e: - uts.usage(e) diff --git a/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.rb b/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.rb deleted file mode 100644 index b3fe8a699..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.rb +++ /dev/null @@ -1,135 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -# !/usr/bin/ruby -# -# unity_test_summary.rb -# -require 'fileutils' -require 'set' - -class UnityTestSummary - include FileUtils::Verbose - - attr_reader :report, :total_tests, :failures, :ignored - attr_writer :targets, :root - - def initialize(_opts = {}) - @report = '' - @total_tests = 0 - @failures = 0 - @ignored = 0 - end - - def run - # Clean up result file names - results = @targets.map { |target| target.tr('\\', '/') } - - # Dig through each result file, looking for details on pass/fail: - failure_output = [] - ignore_output = [] - - results.each do |result_file| - lines = File.readlines(result_file).map(&:chomp) - - raise "Empty test result file: #{result_file}" if lines.empty? - - output = get_details(result_file, lines) - failure_output << output[:failures] unless output[:failures].empty? - ignore_output << output[:ignores] unless output[:ignores].empty? - tests, failures, ignored = parse_test_summary(lines) - @total_tests += tests - @failures += failures - @ignored += ignored - end - - if @ignored > 0 - @report += "\n" - @report += "--------------------------\n" - @report += "UNITY IGNORED TEST SUMMARY\n" - @report += "--------------------------\n" - @report += ignore_output.flatten.join("\n") - end - - if @failures > 0 - @report += "\n" - @report += "--------------------------\n" - @report += "UNITY FAILED TEST SUMMARY\n" - @report += "--------------------------\n" - @report += failure_output.flatten.join("\n") - end - - @report += "\n" - @report += "--------------------------\n" - @report += "OVERALL UNITY TEST SUMMARY\n" - @report += "--------------------------\n" - @report += "#{@total_tests} TOTAL TESTS #{@failures} TOTAL FAILURES #{@ignored} IGNORED\n" - @report += "\n" - end - - def usage(err_msg = nil) - puts "\nERROR: " - puts err_msg if err_msg - puts "\nUsage: unity_test_summary.rb result_file_directory/ root_path/" - puts ' result_file_directory - The location of your results files.' - puts ' Defaults to current directory if not specified.' - puts ' Should end in / if specified.' - puts ' root_path - Helpful for producing more verbose output if using relative paths.' - exit 1 - end - - protected - - def get_details(_result_file, lines) - results = { failures: [], ignores: [], successes: [] } - lines.each do |line| - _src_file, _src_line, _test_name, status, _msg = line.split(/:/) - line_out = (@root && (@root != 0) ? "#{@root}#{line}" : line).gsub(/\//, '\\') - case status - when 'IGNORE' then results[:ignores] << line_out - when 'FAIL' then results[:failures] << line_out - when 'PASS' then results[:successes] << line_out - end - end - results - end - - def parse_test_summary(summary) - raise "Couldn't parse test results: #{summary}" unless summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ } - - [Regexp.last_match(1).to_i, Regexp.last_match(2).to_i, Regexp.last_match(3).to_i] - end -end - -if $0 == __FILE__ - - # parse out the command options - opts, args = ARGV.partition { |v| v =~ /^--\w+/ } - opts.map! { |v| v[2..-1].to_sym } - - # create an instance to work with - uts = UnityTestSummary.new(opts) - - begin - # look in the specified or current directory for result files - args[0] ||= './' - targets = "#{ARGV[0].tr('\\', '/')}**/*.test*" - results = Dir[targets] - - raise "No *.testpass, *.testfail, or *.testresults files found in '#{targets}'" if results.empty? - - uts.targets = results - - # set the root path - args[1] ||= Dir.pwd + '/' - uts.root = ARGV[1] - - # run the summarizer - puts uts.run - rescue StandardError => e - uts.usage e.message - end -end diff --git a/components/testframework/libs/cmock/vendor/unity/auto/unity_to_junit.py b/components/testframework/libs/cmock/vendor/unity/auto/unity_to_junit.py deleted file mode 100644 index 71dd56888..000000000 --- a/components/testframework/libs/cmock/vendor/unity/auto/unity_to_junit.py +++ /dev/null @@ -1,146 +0,0 @@ -import sys -import os -from glob import glob - -from pyparsing import * -from junit_xml import TestSuite, TestCase - - -class UnityTestSummary: - def __init__(self): - self.report = '' - self.total_tests = 0 - self.failures = 0 - self.ignored = 0 - self.targets = 0 - self.root = None - self.test_suites = dict() - - def run(self): - # Clean up result file names - results = [] - for target in self.targets: - results.append(target.replace('\\', '/')) - - # Dig through each result file, looking for details on pass/fail: - for result_file in results: - lines = list(map(lambda line: line.rstrip(), open(result_file, "r").read().split('\n'))) - if len(lines) == 0: - raise Exception("Empty test result file: %s" % result_file) - - # define an expression for your file reference - entry_one = Combine( - oneOf(list(alphas)) + ':/' + - Word(alphanums + '_-./')) - - entry_two = Word(printables + ' ', excludeChars=':') - entry = entry_one | entry_two - - delimiter = Literal(':').suppress() - tc_result_line = Group(entry.setResultsName('tc_file_name') + delimiter + entry.setResultsName( - 'tc_line_nr') + delimiter + entry.setResultsName('tc_name') + delimiter + entry.setResultsName( - 'tc_status') + Optional( - delimiter + entry.setResultsName('tc_msg'))).setResultsName("tc_line") - - eol = LineEnd().suppress() - sol = LineStart().suppress() - blank_line = sol + eol - - tc_summary_line = Group(Word(nums).setResultsName("num_of_tests") + "Tests" + Word(nums).setResultsName( - "num_of_fail") + "Failures" + Word(nums).setResultsName("num_of_ignore") + "Ignored").setResultsName( - "tc_summary") - tc_end_line = Or(Literal("FAIL"), Literal('Ok')).setResultsName("tc_result") - - # run it and see... - pp1 = tc_result_line | Optional(tc_summary_line | tc_end_line) - pp1.ignore(blank_line | OneOrMore("-")) - - result = list() - for l in lines: - result.append((pp1.parseString(l)).asDict()) - # delete empty results - result = filter(None, result) - - tc_list = list() - for r in result: - if 'tc_line' in r: - tmp_tc_line = r['tc_line'] - - # get only the file name which will be used as the classname - file_name = tmp_tc_line['tc_file_name'].split('\\').pop().split('/').pop().rsplit('.', 1)[0] - tmp_tc = TestCase(name=tmp_tc_line['tc_name'], classname=file_name) - if 'tc_status' in tmp_tc_line: - if str(tmp_tc_line['tc_status']) == 'IGNORE': - if 'tc_msg' in tmp_tc_line: - tmp_tc.add_skipped_info(message=tmp_tc_line['tc_msg'], - output=r'[File]={0}, [Line]={1}'.format( - tmp_tc_line['tc_file_name'], tmp_tc_line['tc_line_nr'])) - else: - tmp_tc.add_skipped_info(message=" ") - elif str(tmp_tc_line['tc_status']) == 'FAIL': - if 'tc_msg' in tmp_tc_line: - tmp_tc.add_failure_info(message=tmp_tc_line['tc_msg'], - output=r'[File]={0}, [Line]={1}'.format( - tmp_tc_line['tc_file_name'], tmp_tc_line['tc_line_nr'])) - else: - tmp_tc.add_failure_info(message=" ") - - tc_list.append((str(result_file), tmp_tc)) - - for k, v in tc_list: - try: - self.test_suites[k].append(v) - except KeyError: - self.test_suites[k] = [v] - ts = [] - for suite_name in self.test_suites: - ts.append(TestSuite(suite_name, self.test_suites[suite_name])) - - with open('result.xml', 'w') as f: - TestSuite.to_file(f, ts, prettyprint='True', encoding='utf-8') - - return self.report - - def set_targets(self, target_array): - self.targets = target_array - - def set_root_path(self, path): - self.root = path - - @staticmethod - def usage(err_msg=None): - print("\nERROR: ") - if err_msg: - print(err_msg) - print("\nUsage: unity_test_summary.py result_file_directory/ root_path/") - print(" result_file_directory - The location of your results files.") - print(" Defaults to current directory if not specified.") - print(" Should end in / if specified.") - print(" root_path - Helpful for producing more verbose output if using relative paths.") - sys.exit(1) - - -if __name__ == '__main__': - uts = UnityTestSummary() - try: - # look in the specified or current directory for result files - if len(sys.argv) > 1: - targets_dir = sys.argv[1] - else: - targets_dir = './' - targets = list(map(lambda x: x.replace('\\', '/'), glob(targets_dir + '*.test*'))) - if len(targets) == 0: - raise Exception("No *.testpass or *.testfail files found in '%s'" % targets_dir) - uts.set_targets(targets) - - # set the root path - if len(sys.argv) > 2: - root_path = sys.argv[2] - else: - root_path = os.path.split(__file__)[0] - uts.set_root_path(root_path) - - # run the summarizer - print(uts.run()) - except Exception as e: - UnityTestSummary.usage(e) diff --git a/components/testframework/libs/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md b/components/testframework/libs/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md deleted file mode 100644 index bf4c099bb..000000000 --- a/components/testframework/libs/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +++ /dev/null @@ -1,206 +0,0 @@ -# ThrowTheSwitch.org Coding Standard - -Hi. Welcome to the coding standard for ThrowTheSwitch.org. For the most part, -we try to follow these standards to unify our contributors' code into a cohesive -unit (puns intended). You might find places where these standards aren't -followed. We're not perfect. Please be polite where you notice these discrepancies -and we'll try to be polite when we notice yours. - -;) - - -## Why Have A Coding Standard? - -Being consistent makes code easier to understand. We've tried to keep -our standard simple because we also believe that we can only expect someone to -follow something that is understandable. Please do your best. - - -## Our Philosophy - -Before we get into details on syntax, let's take a moment to talk about our -vision for these tools. We're C developers and embedded software developers. -These tools are great to test any C code, but catering to embedded software has -made us more tolerant of compiler quirks. There are a LOT of quirky compilers -out there. By quirky I mean "doesn't follow standards because they feel like -they have a license to do as they wish." - -Our philosophy is "support every compiler we can". Most often, this means that -we aim for writing C code that is standards compliant (often C89... that seems -to be a sweet spot that is almost always compatible). But it also means these -tools are tolerant of things that aren't common. Some that aren't even -compliant. There are configuration options to override the size of standard -types. There are configuration options to force Unity to not use certain -standard library functions. A lot of Unity is configurable and we have worked -hard to make it not TOO ugly in the process. - -Similarly, our tools that parse C do their best. They aren't full C parsers -(yet) and, even if they were, they would still have to accept non-standard -additions like gcc extensions or specifying `@0x1000` to force a variable to -compile to a particular location. It's just what we do, because we like -everything to Just Work™. - -Speaking of having things Just Work™, that's our second philosophy. By that, we -mean that we do our best to have EVERY configuration option have a logical -default. We believe that if you're working with a simple compiler and target, -you shouldn't need to configure very much... we try to make the tools guess as -much as they can, but give the user the power to override it when it's wrong. - - -## Naming Things - -Let's talk about naming things. Programming is all about naming things. We name -files, functions, variables, and so much more. While we're not always going to -find the best name for something, we actually put a bit of effort into -finding *What Something WANTS to be Called*™. - -When naming things, we follow this hierarchy, the first being the -most important to us (but we do all four when possible): -1. Readable -2. Descriptive -3. Consistent -4. Memorable - - -#### Readable - -We want to read our code. This means we like names and flow that are more -naturally read. We try to avoid double negatives. We try to avoid cryptic -abbreviations (sticking to ones we feel are common). - - -#### Descriptive - -We like descriptive names for things, especially functions and variables. -Finding the right name for something is an important endeavor. You might notice -from poking around our code that this often results in names that are a little -longer than the average. Guilty. We're okay with a bit more typing if it -means our code is easier to understand. - -There are two exceptions to this rule that we also stick to as religiously as -possible: - -First, while we realize hungarian notation (and similar systems for encoding -type information into variable names) is providing a more descriptive name, we -feel that (for the average developer) it takes away from readability and is to be avoided. - -Second, loop counters and other local throw-away variables often have a purpose -which is obvious. There's no need, therefore, to get carried away with complex -naming. We find i, j, and k are better loop counters than loopCounterVar or -whatnot. We only break this rule when we see that more description could improve -understanding of an algorithm. - - -#### Consistent - -We like consistency, but we're not really obsessed with it. We try to name our -configuration macros in a consistent fashion... you'll notice a repeated use of -UNITY_EXCLUDE_BLAH or UNITY_USES_BLAH macros. This helps users avoid having to -remember each macro's details. - - -#### Memorable - -Where ever it doesn't violate the above principles, we try to apply memorable -names. Sometimes this means using something that is simply descriptive, but -often we strive for descriptive AND unique... we like quirky names that stand -out in our memory and are easier to search for. Take a look through the file -names in Ceedling and you'll get a good idea of what we are talking about here. -Why use preprocess when you can use preprocessinator? Or what better describes a -module in charge of invoking tasks during releases than release_invoker? Don't -get carried away. The names are still descriptive and fulfill the above -requirements, but they don't feel stale. - - -## C and C++ Details - -We don't really want to add to the style battles out there. Tabs or spaces? -How many spaces? Where do the braces go? These are age-old questions that will -never be answered... or at least not answered in a way that will make everyone -happy. - -We've decided on our own style preferences. If you'd like to contribute to these -projects (and we hope that you do), then we ask if you do your best to follow -the same. It will only hurt a little. We promise. - - -#### Whitespace - -Our C-style is to use spaces and to use 4 of them per indent level. It's a nice -power-of-2 number that looks decent on a wide-screen. We have no more reason -than that. We break that rule when we have lines that wrap (macros or function -arguments or whatnot). When that happens, we like to indent further to line -things up in nice tidy columns. - -```C - if (stuff_happened) - { - do_something(); - } -``` - - -#### Case - -- Files - all lower case with underscores. -- Variables - all lower case with underscores -- Macros - all caps with underscores. -- Typedefs - all caps with underscores. (also ends with _T). -- Functions - camel cased. Usually named ModuleName_FuncName -- Constants and Globals - camel cased. - - -#### Braces - -The left brace is on the next line after the declaration. The right brace is -directly below that. Everything in between in indented one level. If you're -catching an error and you have a one-line, go ahead and to it on the same line. - -```C - while (blah) - { - //Like so. Even if only one line, we use braces. - } -``` - - -#### Comments - -Do you know what we hate? Old-school C block comments. BUT, we're using them -anyway. As we mentioned, our goal is to support every compiler we can, -especially embedded compilers. There are STILL C compilers out there that only -support old-school block comments. So that is what we're using. We apologize. We -think they are ugly too. - - -## Ruby Details - -Is there really such thing as a Ruby coding standard? Ruby is such a free form -language, it seems almost sacrilegious to suggest that people should comply to -one method! We'll keep it really brief! - - -#### Whitespace - -Our Ruby style is to use spaces and to use 2 of them per indent level. It's a -nice power-of-2 number that really grooves with Ruby's compact style. We have no -more reason than that. We break that rule when we have lines that wrap. When -that happens, we like to indent further to line things up in nice tidy columns. - - -#### Case - -- Files - all lower case with underscores. -- Variables - all lower case with underscores -- Classes, Modules, etc - Camel cased. -- Functions - all lower case with underscores -- Constants - all upper case with underscores - - -## Documentation - -Egad. Really? We use mark down and we like pdf files because they can be made to -look nice while still being portable. Good enough? - - -*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* diff --git a/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf b/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf deleted file mode 100644 index 28f0c3214..000000000 Binary files a/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf and /dev/null differ diff --git a/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsReference.md b/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsReference.md deleted file mode 100644 index 0957bcf6b..000000000 --- a/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsReference.md +++ /dev/null @@ -1,831 +0,0 @@ -# Unity Assertions Reference - -## Background and Overview - -### Super Condensed Version - -- An assertion establishes truth (i.e. boolean True) for a single condition. -Upon boolean False, an assertion stops execution and reports the failure. -- Unity is mainly a rich collection of assertions and the support to gather up -and easily execute those assertions. -- The structure of Unity allows you to easily separate test assertions from -source code in, well, test code. -- Unity's assertions: -- Come in many, many flavors to handle different C types and assertion cases. -- Use context to provide detailed and helpful failure messages. -- Document types, expected values, and basic behavior in your source code for -free. - - -### Unity Is Several Things But Mainly It's Assertions - -One way to think of Unity is simply as a rich collection of assertions you can -use to establish whether your source code behaves the way you think it does. -Unity provides a framework to easily organize and execute those assertions in -test code separate from your source code. - - -### What's an Assertion? - -At their core, assertions are an establishment of truth - boolean truth. Was this -thing equal to that thing? Does that code doohickey have such-and-such property -or not? You get the idea. Assertions are executable code (to appreciate the big -picture on this read up on the difference between -[link:Dynamic Verification and Static Analysis]). A failing assertion stops -execution and reports an error through some appropriate I/O channel (e.g. -stdout, GUI, file, blinky light). - -Fundamentally, for dynamic verification all you need is a single assertion -mechanism. In fact, that's what the [assert() macro in C's standard library](http://en.wikipedia.org/en/wiki/Assert.h) -is for. So why not just use it? Well, we can do far better in the reporting -department. C's `assert()` is pretty dumb as-is and is particularly poor for -handling common data types like arrays, structs, etc. And, without some other -support, it's far too tempting to litter source code with C's `assert()`'s. It's -generally much cleaner, manageable, and more useful to separate test and source -code in the way Unity facilitates. - - -### Unity's Assertions: Helpful Messages _and_ Free Source Code Documentation - -Asserting a simple truth condition is valuable, but using the context of the -assertion is even more valuable. For instance, if you know you're comparing bit -flags and not just integers, then why not use that context to give explicit, -readable, bit-level feedback when an assertion fails? - -That's what Unity's collection of assertions do - capture context to give you -helpful, meaningful assertion failure messages. In fact, the assertions -themselves also serve as executable documentation about types and values in your -source code. So long as your tests remain current with your source and all those -tests pass, you have a detailed, up-to-date view of the intent and mechanisms in -your source code. And due to a wondrous mystery, well-tested code usually tends -to be well designed code. - - -## Assertion Conventions and Configurations - -### Naming and Parameter Conventions - -The convention of assertion parameters generally follows this order: - -``` -TEST_ASSERT_X( {modifiers}, {expected}, actual, {size/count} ) -``` - -The very simplest assertion possible uses only a single `actual` parameter (e.g. -a simple null check). - - - `Actual` is the value being tested and unlike the other parameters in an - assertion construction is the only parameter present in all assertion variants. - - `Modifiers` are masks, ranges, bit flag specifiers, floating point deltas. - - `Expected` is your expected value (duh) to compare to an `actual` value; it's - marked as an optional parameter because some assertions only need a single - `actual` parameter (e.g. null check). - - `Size/count` refers to string lengths, number of array elements, etc. - -Many of Unity's assertions are clear duplications in that the same data type -is handled by several assertions. The differences among these are in how failure -messages are presented. For instance, a `_HEX` variant of an assertion prints -the expected and actual values of that assertion formatted as hexadecimal. - - -#### TEST_ASSERT_X_MESSAGE Variants - -_All_ assertions are complemented with a variant that includes a simple string -message as a final parameter. The string you specify is appended to an assertion -failure message in Unity output. - -For brevity, the assertion variants with a message parameter are not listed -below. Just tack on `_MESSAGE` as the final component to any assertion name in -the reference list below and add a string as the final parameter. - -_Example:_ - -``` -TEST_ASSERT_X( {modifiers}, {expected}, actual, {size/count} ) -``` - -becomes messageified like thus... - -``` -TEST_ASSERT_X_MESSAGE( {modifiers}, {expected}, actual, {size/count}, message ) -``` - -Notes: -- The `_MESSAGE` variants intentionally do not support `printf` style formatting - since many embedded projects don't support or avoid `printf` for various reasons. - It is possible to use `sprintf` before the assertion to assemble a complex fail - message, if necessary. -- If you want to output a counter value within an assertion fail message (e.g. from - a loop) , building up an array of results and then using one of the `_ARRAY` - assertions (see below) might be a handy alternative to `sprintf`. - - -#### TEST_ASSERT_X_ARRAY Variants - -Unity provides a collection of assertions for arrays containing a variety of -types. These are documented in the Array section below. These are almost on par -with the `_MESSAGE`variants of Unity's Asserts in that for pretty much any Unity -type assertion you can tack on `_ARRAY` and run assertions on an entire block of -memory. - -``` - TEST_ASSERT_EQUAL_TYPEX_ARRAY( expected, actual, {size/count} ) -``` - - - `Expected` is an array itself. - - `Size/count` is one or two parameters necessary to establish the number of array - elements and perhaps the length of elements within the array. - -Notes: - - - The `_MESSAGE` variant convention still applies here to array assertions. The - `_MESSAGE` variants of the `_ARRAY` assertions have names ending with - `_ARRAY_MESSAGE`. - - Assertions for handling arrays of floating point values are grouped with float - and double assertions (see immediately following section). - - -### TEST_ASSERT_EACH_EQUAL_X Variants - -Unity provides a collection of assertions for arrays containing a variety of -types which can be compared to a single value as well. These are documented in -the Each Equal section below. these are almost on par with the `_MESSAGE` -variants of Unity's Asserts in that for pretty much any Unity type assertion you -can inject `_EACH_EQUAL` and run assertions on an entire block of memory. - -``` -TEST_ASSERT_EACH_EQUAL_TYPEX( expected, actual, {size/count} ) -``` - - - `Expected` is a single value to compare to. - - `Actual` is an array where each element will be compared to the expected value. - - `Size/count` is one of two parameters necessary to establish the number of array - elements and perhaps the length of elements within the array. - -Notes: - - - The `_MESSAGE` variant convention still applies here to Each Equal assertions. - - Assertions for handling Each Equal of floating point values are grouped with - float and double assertions (see immediately following section). - - -### Configuration - -#### Floating Point Support Is Optional - -Support for floating point types is configurable. That is, by defining the -appropriate preprocessor symbols, floats and doubles can be individually enabled -or disabled in Unity code. This is useful for embedded targets with no floating -point math support (i.e. Unity compiles free of errors for fixed point only -platforms). See Unity documentation for specifics. - - -#### Maximum Data Type Width Is Configurable - -Not all targets support 64 bit wide types or even 32 bit wide types. Define the -appropriate preprocessor symbols and Unity will omit all operations from -compilation that exceed the maximum width of your target. See Unity -documentation for specifics. - - -## The Assertions in All Their Blessed Glory - -### Basic Fail, Pass and Ignore - -##### `TEST_FAIL()` - -##### `TEST_FAIL_MESSAGE("message")` - -This fella is most often used in special conditions where your test code is -performing logic beyond a simple assertion. That is, in practice, `TEST_FAIL()` -will always be found inside a conditional code block. - -_Examples:_ - -- Executing a state machine multiple times that increments a counter your test -code then verifies as a final step. -- Triggering an exception and verifying it (as in Try / Catch / Throw - see the -[CException](https://github.com/ThrowTheSwitch/CException) project). - -##### `TEST_PASS()` - -##### `TEST_PASS_MESSAGE("message")` - -This will abort the remainder of the test, but count the test as a pass. Under -normal circumstances, it is not necessary to include this macro in your tests... -a lack of failure will automatically be counted as a `PASS`. It is occasionally -useful for tests with `#ifdef`s and such. - -##### `TEST_IGNORE()` - -##### `TEST_IGNORE_MESSAGE("message")` - -Marks a test case (i.e. function meant to contain test assertions) as ignored. -Usually this is employed as a breadcrumb to come back and implement a test case. -An ignored test case has effects if other assertions are in the enclosing test -case (see Unity documentation for more). - -##### `TEST_MESSAGE(message)` - -This can be useful for outputting `INFO` messages into the Unity output stream -without actually ending the test. Like pass and fail messages, it will be output -with the filename and line number. - -### Boolean - -##### `TEST_ASSERT (condition)` - -##### `TEST_ASSERT_TRUE (condition)` - -##### `TEST_ASSERT_FALSE (condition)` - -##### `TEST_ASSERT_UNLESS (condition)` - -A simple wording variation on `TEST_ASSERT_FALSE`.The semantics of -`TEST_ASSERT_UNLESS` aid readability in certain test constructions or -conditional statements. - -##### `TEST_ASSERT_NULL (pointer)` - -##### `TEST_ASSERT_NOT_NULL (pointer)` - -Verify if a pointer is or is not NULL. - -##### `TEST_ASSERT_EMPTY (pointer)` - -##### `TEST_ASSERT_NOT_EMPTY (pointer)` - -Verify if the first element dereferenced from a pointer is or is not zero. This -is particularly useful for checking for empty (or non-empty) null-terminated -C strings, but can be just as easily used for other null-terminated arrays. - -### Signed and Unsigned Integers (of all sizes) - -Large integer sizes can be disabled for build targets that do not support them. -For example, if your target only supports up to 16 bit types, by defining the -appropriate symbols Unity can be configured to omit 32 and 64 bit operations -that would break compilation (see Unity documentation for more). Refer to -Advanced Asserting later in this document for advice on dealing with other word -sizes. - -##### `TEST_ASSERT_EQUAL_INT (expected, actual)` - -##### `TEST_ASSERT_EQUAL_INT8 (expected, actual)` - -##### `TEST_ASSERT_EQUAL_INT16 (expected, actual)` - -##### `TEST_ASSERT_EQUAL_INT32 (expected, actual)` - -##### `TEST_ASSERT_EQUAL_INT64 (expected, actual)` - -##### `TEST_ASSERT_EQUAL_UINT (expected, actual)` - -##### `TEST_ASSERT_EQUAL_UINT8 (expected, actual)` - -##### `TEST_ASSERT_EQUAL_UINT16 (expected, actual)` - -##### `TEST_ASSERT_EQUAL_UINT32 (expected, actual)` - -##### `TEST_ASSERT_EQUAL_UINT64 (expected, actual)` - - -### Unsigned Integers (of all sizes) in Hexadecimal - -All `_HEX` assertions are identical in function to unsigned integer assertions -but produce failure messages with the `expected` and `actual` values formatted -in hexadecimal. Unity output is big endian. - -##### `TEST_ASSERT_EQUAL_HEX (expected, actual)` - -##### `TEST_ASSERT_EQUAL_HEX8 (expected, actual)` - -##### `TEST_ASSERT_EQUAL_HEX16 (expected, actual)` - -##### `TEST_ASSERT_EQUAL_HEX32 (expected, actual)` - -##### `TEST_ASSERT_EQUAL_HEX64 (expected, actual)` - - -### Characters - -While you can use the 8-bit integer assertions to compare `char`, another option is -to use this specialized assertion which will show printable characters as printables, -otherwise showing the HEX escape code for the characters. - -##### `TEST_ASSERT_EQUAL_CHAR (expected, actual)` - - -### Masked and Bit-level Assertions - -Masked and bit-level assertions produce output formatted in hexadecimal. Unity -output is big endian. - - -##### `TEST_ASSERT_BITS (mask, expected, actual)` - -Only compares the masked (i.e. high) bits of `expected` and `actual` parameters. - - -##### `TEST_ASSERT_BITS_HIGH (mask, actual)` - -Asserts the masked bits of the `actual` parameter are high. - - -##### `TEST_ASSERT_BITS_LOW (mask, actual)` - -Asserts the masked bits of the `actual` parameter are low. - - -##### `TEST_ASSERT_BIT_HIGH (bit, actual)` - -Asserts the specified bit of the `actual` parameter is high. - - -##### `TEST_ASSERT_BIT_LOW (bit, actual)` - -Asserts the specified bit of the `actual` parameter is low. - -### Integer Less Than / Greater Than - -These assertions verify that the `actual` parameter is less than or greater -than `threshold` (exclusive). For example, if the threshold value is 0 for the -greater than assertion will fail if it is 0 or less. There are assertions for -all the various sizes of ints, as for the equality assertions. Some examples: - -##### `TEST_ASSERT_GREATER_THAN_INT8 (threshold, actual)` - -##### `TEST_ASSERT_GREATER_OR_EQUAL_INT16 (threshold, actual)` - -##### `TEST_ASSERT_LESS_THAN_INT32 (threshold, actual)` - -##### `TEST_ASSERT_LESS_OR_EQUAL_UINT (threshold, actual)` - -##### `TEST_ASSERT_NOT_EQUAL_UINT8 (threshold, actual)` - - -### Integer Ranges (of all sizes) - -These assertions verify that the `expected` parameter is within +/- `delta` -(inclusive) of the `actual` parameter. For example, if the expected value is 10 -and the delta is 3 then the assertion will fail for any value outside the range -of 7 - 13. - -##### `TEST_ASSERT_INT_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_INT8_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_INT16_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_INT32_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_INT64_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_UINT_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_UINT8_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_UINT16_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_UINT32_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_UINT64_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_HEX_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_HEX8_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_HEX16_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_HEX32_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_HEX64_WITHIN (delta, expected, actual)` - -##### `TEST_ASSERT_CHAR_WITHIN (delta, expected, actual)` - -### Structs and Strings - -##### `TEST_ASSERT_EQUAL_PTR (expected, actual)` - -Asserts that the pointers point to the same memory location. - - -##### `TEST_ASSERT_EQUAL_STRING (expected, actual)` - -Asserts that the null terminated (`'\0'`)strings are identical. If strings are -of different lengths or any portion of the strings before their terminators -differ, the assertion fails. Two NULL strings (i.e. zero length) are considered -equivalent. - - -##### `TEST_ASSERT_EQUAL_MEMORY (expected, actual, len)` - -Asserts that the contents of the memory specified by the `expected` and `actual` -pointers is identical. The size of the memory blocks in bytes is specified by -the `len` parameter. - - -### Arrays - -`expected` and `actual` parameters are both arrays. `num_elements` specifies the -number of elements in the arrays to compare. - -`_HEX` assertions produce failure messages with expected and actual array -contents formatted in hexadecimal. - -For array of strings comparison behavior, see comments for -`TEST_ASSERT_EQUAL_STRING` in the preceding section. - -Assertions fail upon the first element in the compared arrays found not to -match. Failure messages specify the array index of the failed comparison. - -##### `TEST_ASSERT_EQUAL_INT_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_INT8_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_INT16_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_INT32_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_INT64_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_UINT_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_UINT8_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_UINT16_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_UINT32_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_UINT64_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_HEX_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_HEX8_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_HEX16_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_HEX32_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_HEX64_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_CHAR_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_PTR_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_STRING_ARRAY (expected, actual, num_elements)` - -##### `TEST_ASSERT_EQUAL_MEMORY_ARRAY (expected, actual, len, num_elements)` - -`len` is the memory in bytes to be compared at each array element. - -### Integer Array Ranges (of all sizes) - -These assertions verify that the `expected` array parameter is within +/- `delta` -(inclusive) of the `actual` array parameter. For example, if the expected value is -\[10, 12\] and the delta is 3 then the assertion will fail for any value -outside the range of \[7 - 13, 9 - 15\]. - -##### `TEST_ASSERT_INT_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_INT8_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_INT16_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_INT32_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_INT64_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_UINT_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_UINT8_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_UINT16_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_UINT32_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_UINT64_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_HEX_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_HEX8_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_HEX16_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_HEX32_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_HEX64_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -##### `TEST_ASSERT_CHAR_ARRAY_WITHIN (delta, expected, actual, num_elements)` - -### Each Equal (Arrays to Single Value) - -`expected` are single values and `actual` are arrays. `num_elements` specifies -the number of elements in the arrays to compare. - -`_HEX` assertions produce failure messages with expected and actual array -contents formatted in hexadecimal. - -Assertions fail upon the first element in the compared arrays found not to -match. Failure messages specify the array index of the failed comparison. - -#### `TEST_ASSERT_EACH_EQUAL_INT (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_INT8 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_INT16 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_INT32 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_INT64 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_UINT (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_UINT8 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_UINT16 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_UINT32 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_UINT64 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_HEX (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_HEX8 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_HEX16 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_HEX32 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_HEX64 (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_CHAR (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_PTR (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_STRING (expected, actual, num_elements)` - -#### `TEST_ASSERT_EACH_EQUAL_MEMORY (expected, actual, len, num_elements)` - -`len` is the memory in bytes to be compared at each array element. - - -### Floating Point (If enabled) - -##### `TEST_ASSERT_FLOAT_WITHIN (delta, expected, actual)` - -Asserts that the `actual` value is within +/- `delta` of the `expected` value. -The nature of floating point representation is such that exact evaluations of -equality are not guaranteed. - - -##### `TEST_ASSERT_EQUAL_FLOAT (expected, actual)` - -Asserts that the ?actual?value is "close enough to be considered equal" to the -`expected` value. If you are curious about the details, refer to the Advanced -Asserting section for more details on this. Omitting a user-specified delta in a -floating point assertion is both a shorthand convenience and a requirement of -code generation conventions for CMock. - - -##### `TEST_ASSERT_EQUAL_FLOAT_ARRAY (expected, actual, num_elements)` - -See Array assertion section for details. Note that individual array element -float comparisons are executed using T?EST_ASSERT_EQUAL_FLOAT?.That is, user -specified delta comparison values requires a custom-implemented floating point -array assertion. - - -##### `TEST_ASSERT_FLOAT_IS_INF (actual)` - -Asserts that `actual` parameter is equivalent to positive infinity floating -point representation. - - -##### `TEST_ASSERT_FLOAT_IS_NEG_INF (actual)` - -Asserts that `actual` parameter is equivalent to negative infinity floating -point representation. - - -##### `TEST_ASSERT_FLOAT_IS_NAN (actual)` - -Asserts that `actual` parameter is a Not A Number floating point representation. - - -##### `TEST_ASSERT_FLOAT_IS_DETERMINATE (actual)` - -Asserts that ?actual?parameter is a floating point representation usable for -mathematical operations. That is, the `actual` parameter is neither positive -infinity nor negative infinity nor Not A Number floating point representations. - - -##### `TEST_ASSERT_FLOAT_IS_NOT_INF (actual)` - -Asserts that `actual` parameter is a value other than positive infinity floating -point representation. - - -##### `TEST_ASSERT_FLOAT_IS_NOT_NEG_INF (actual)` - -Asserts that `actual` parameter is a value other than negative infinity floating -point representation. - - -##### `TEST_ASSERT_FLOAT_IS_NOT_NAN (actual)` - -Asserts that `actual` parameter is a value other than Not A Number floating -point representation. - - -##### `TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE (actual)` - -Asserts that `actual` parameter is not usable for mathematical operations. That -is, the `actual` parameter is either positive infinity or negative infinity or -Not A Number floating point representations. - - -### Double (If enabled) - -##### `TEST_ASSERT_DOUBLE_WITHIN (delta, expected, actual)` - -Asserts that the `actual` value is within +/- `delta` of the `expected` value. -The nature of floating point representation is such that exact evaluations of -equality are not guaranteed. - - -##### `TEST_ASSERT_EQUAL_DOUBLE (expected, actual)` - -Asserts that the `actual` value is "close enough to be considered equal" to the -`expected` value. If you are curious about the details, refer to the Advanced -Asserting section for more details. Omitting a user-specified delta in a -floating point assertion is both a shorthand convenience and a requirement of -code generation conventions for CMock. - - -##### `TEST_ASSERT_EQUAL_DOUBLE_ARRAY (expected, actual, num_elements)` - -See Array assertion section for details. Note that individual array element -double comparisons are executed using `TEST_ASSERT_EQUAL_DOUBLE`.That is, user -specified delta comparison values requires a custom implemented double array -assertion. - - -##### `TEST_ASSERT_DOUBLE_IS_INF (actual)` - -Asserts that `actual` parameter is equivalent to positive infinity floating -point representation. - - -##### `TEST_ASSERT_DOUBLE_IS_NEG_INF (actual)` - -Asserts that `actual` parameter is equivalent to negative infinity floating point -representation. - - -##### `TEST_ASSERT_DOUBLE_IS_NAN (actual)` - -Asserts that `actual` parameter is a Not A Number floating point representation. - - -##### `TEST_ASSERT_DOUBLE_IS_DETERMINATE (actual)` - -Asserts that `actual` parameter is a floating point representation usable for -mathematical operations. That is, the ?actual?parameter is neither positive -infinity nor negative infinity nor Not A Number floating point representations. - - -##### `TEST_ASSERT_DOUBLE_IS_NOT_INF (actual)` - -Asserts that `actual` parameter is a value other than positive infinity floating -point representation. - - -##### `TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF (actual)` - -Asserts that `actual` parameter is a value other than negative infinity floating -point representation. - - -##### `TEST_ASSERT_DOUBLE_IS_NOT_NAN (actual)` - -Asserts that `actual` parameter is a value other than Not A Number floating -point representation. - - -##### `TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE (actual)` - -Asserts that `actual` parameter is not usable for mathematical operations. That -is, the `actual` parameter is either positive infinity or negative infinity or -Not A Number floating point representations. - - -## Advanced Asserting: Details On Tricky Assertions - -This section helps you understand how to deal with some of the trickier -assertion situations you may run into. It will give you a glimpse into some of -the under-the-hood details of Unity's assertion mechanisms. If you're one of -those people who likes to know what is going on in the background, read on. If -not, feel free to ignore the rest of this document until you need it. - - -### How do the EQUAL assertions work for FLOAT and DOUBLE? - -As you may know, directly checking for equality between a pair of floats or a -pair of doubles is sloppy at best and an outright no-no at worst. Floating point -values can often be represented in multiple ways, particularly after a series of -operations on a value. Initializing a variable to the value of 2.0 is likely to -result in a floating point representation of 2 x 20,but a series of -mathematical operations might result in a representation of 8 x 2-2 -that also evaluates to a value of 2. At some point repeated operations cause -equality checks to fail. - -So Unity doesn't do direct floating point comparisons for equality. Instead, it -checks if two floating point values are "really close." If you leave Unity -running with defaults, "really close" means "within a significant bit or two." -Under the hood, `TEST_ASSERT_EQUAL_FLOAT` is really `TEST_ASSERT_FLOAT_WITHIN` -with the `delta` parameter calculated on the fly. For single precision, delta is -the expected value multiplied by 0.00001, producing a very small proportional -range around the expected value. - -If you are expecting a value of 20,000.0 the delta is calculated to be 0.2. So -any value between 19,999.8 and 20,000.2 will satisfy the equality check. This -works out to be roughly a single bit of range for a single-precision number, and -that's just about as tight a tolerance as you can reasonably get from a floating -point value. - -So what happens when it's zero? Zero - even more than other floating point -values - can be represented many different ways. It doesn't matter if you have -0 x 20 or 0 x 263.It's still zero, right? Luckily, if you -subtract these values from each other, they will always produce a difference of -zero, which will still fall between 0 plus or minus a delta of 0. So it still -works! - -Double precision floating point numbers use a much smaller multiplier, again -approximating a single bit of error. - -If you don't like these ranges and you want to make your floating point equality -assertions less strict, you can change these multipliers to whatever you like by -defining UNITY_FLOAT_PRECISION and UNITY_DOUBLE_PRECISION. See Unity -documentation for more. - - -### How do we deal with targets with non-standard int sizes? - -It's "fun" that C is a standard where something as fundamental as an integer -varies by target. According to the C standard, an `int` is to be the target's -natural register size, and it should be at least 16-bits and a multiple of a -byte. It also guarantees an order of sizes: - -```C -char <= short <= int <= long <= long long -``` - -Most often, `int` is 32-bits. In many cases in the embedded world, `int` is -16-bits. There are rare microcontrollers out there that have 24-bit integers, -and this remains perfectly standard C. - -To make things even more interesting, there are compilers and targets out there -that have a hard choice to make. What if their natural register size is 10-bits -or 12-bits? Clearly they can't fulfill _both_ the requirement to be at least -16-bits AND the requirement to match the natural register size. In these -situations, they often choose the natural register size, leaving us with -something like this: - -```C -char (8 bit) <= short (12 bit) <= int (12 bit) <= long (16 bit) -``` - -Um... yikes. It's obviously breaking a rule or two... but they had to break SOME -rules, so they made a choice. - -When the C99 standard rolled around, it introduced alternate standard-size types. -It also introduced macros for pulling in MIN/MAX values for your integer types. -It's glorious! Unfortunately, many embedded compilers can't be relied upon to -use the C99 types (Sometimes because they have weird register sizes as described -above. Sometimes because they don't feel like it?). - -A goal of Unity from the beginning was to support every combination of -microcontroller or microprocessor and C compiler. Over time, we've gotten really -close to this. There are a few tricks that you should be aware of, though, if -you're going to do this effectively on some of these more idiosyncratic targets. - -First, when setting up Unity for a new target, you're going to want to pay -special attention to the macros for automatically detecting types -(where available) or manually configuring them yourself. You can get information -on both of these in Unity's documentation. - -What about the times where you suddenly need to deal with something odd, like a -24-bit `int`? The simplest solution is to use the next size up. If you have a -24-bit `int`, configure Unity to use 32-bit integers. If you have a 12-bit -`int`, configure Unity to use 16 bits. There are two ways this is going to -affect you: - -1. When Unity displays errors for you, it's going to pad the upper unused bits -with zeros. -2. You're going to have to be careful of assertions that perform signed -operations, particularly `TEST_ASSERT_INT_WITHIN`.Such assertions might wrap -your `int` in the wrong place, and you could experience false failures. You can -always back down to a simple `TEST_ASSERT` and do the operations yourself. - - -*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* diff --git a/components/testframework/libs/cmock/vendor/unity/docs/UnityConfigurationGuide.md b/components/testframework/libs/cmock/vendor/unity/docs/UnityConfigurationGuide.md deleted file mode 100644 index de691fdf2..000000000 --- a/components/testframework/libs/cmock/vendor/unity/docs/UnityConfigurationGuide.md +++ /dev/null @@ -1,563 +0,0 @@ -# Unity Configuration Guide - -## C Standards, Compilers and Microcontrollers - -The embedded software world contains its challenges. Compilers support different -revisions of the C Standard. They ignore requirements in places, sometimes to -make the language more usable in some special regard. Sometimes it's to simplify -their support. Sometimes it's due to specific quirks of the microcontroller they -are targeting. Simulators add another dimension to this menagerie. - -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 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. - -Unfortunately, it doesn't usually work well to just #define these things in the -test itself. These defines need to take effect where ever unity.h is included. -This would be test test, the test runner (if you're generating one), and from -unity.c when it's compiled. - -## The Options - -### Integer Types - -If you've been a C developer for long, you probably already know that 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. - - -##### `UNITY_EXCLUDE_STDINT_H` - -The first thing that Unity does to guess your types is check `stdint.h`. -This file includes defines like `UINT_MAX` that Unity can use to -learn a lot about your system. It's possible you don't want it to do this -(um. why not?) or (more likely) 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. - -_Example:_ -```C -#define UNITY_EXCLUDE_STDINT_H -``` - - -##### `UNITY_EXCLUDE_LIMITS_H` - -The second attempt to guess your types is to check `limits.h`. Some compilers -that don't support `stdint.h` could include `limits.h` instead. If you don't -want Unity to check this file either, define this to make it skip the inclusion. - -_Example:_ -```C -#define UNITY_EXCLUDE_LIMITS_H -``` - -If you've disabled both of the automatic options above, you're going to have to -do the configuration yourself. Don't worry. Even this isn't too bad... there are -just a handful of defines that you are going to specify if you don't like the -defaults. - - -##### `UNITY_INT_WIDTH` - -Define this to be the number of bits an `int` takes up on your system. The -default, if not autodetected, is 32 bits. - -_Example:_ -```C -#define UNITY_INT_WIDTH 16 -``` - - -##### `UNITY_LONG_WIDTH` - -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:_ -```C -#define UNITY_LONG_WIDTH 16 -``` - - -##### `UNITY_POINTER_WIDTH` - -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. - -_Hint:_ In order to support exotic processors (for example TI C55x with a pointer -width of 23-bit), choose the next power of two (in this case 32-bit). - -_Supported values:_ 16, 32 and 64 - -_Example:_ -```C -// Choose on of these #defines to set your pointer width (if not autodetected) -//#define UNITY_POINTER_WIDTH 16 -//#define UNITY_POINTER_WIDTH 32 -#define UNITY_POINTER_WIDTH 64 // Set UNITY_POINTER_WIDTH to 64-bit -``` - - -##### `UNITY_SUPPORT_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. - -_Example:_ -```C -#define UNITY_SUPPORT_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. - - -##### `UNITY_INCLUDE_FLOAT` - -##### `UNITY_EXCLUDE_FLOAT` - -##### `UNITY_INCLUDE_DOUBLE` - -##### `UNITY_EXCLUDE_DOUBLE` - -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, either, or both, as -suits your needs. For features that are enabled, the following floating point -options also become available. - -_Example:_ -```C -//what manner of strange processor is this? -#define UNITY_EXCLUDE_FLOAT -#define UNITY_INCLUDE_DOUBLE -``` - - -##### `UNITY_EXCLUDE_FLOAT_PRINT` - -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. -Therefore, the display of floating point values during a failure are optional. -By default, Unity will print the actual results of floating point assertion -failure (e.g. ”Expected 4.56 Was 4.68”). To not include this extra support, you -can use this define to instead respond to a failed assertion with a message like -”Values Not Within Delta”. If you would like verbose failure messages for floating -point assertions, use these options to give more explicit failure messages. - -_Example:_ -```C -#define UNITY_EXCLUDE_FLOAT_PRINT -``` - - -##### `UNITY_FLOAT_TYPE` - -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:_ -```C -#define UNITY_FLOAT_TYPE float16_t -``` - - -##### `UNITY_DOUBLE_TYPE` - -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:_ -```C -#define UNITY_DOUBLE_TYPE long double -``` - - -##### `UNITY_FLOAT_PRECISION` - -##### `UNITY_DOUBLE_PRECISION` - -If you look up `UNITY_ASSERT_EQUAL_FLOAT` and `UNITY_ASSERT_EQUAL_DOUBLE` as -documented in the big daddy 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:_ -```C -#define UNITY_FLOAT_PRECISION 0.001f -``` - - -### Miscellaneous - -##### `UNITY_EXCLUDE_STDDEF_H` - -Unity uses the `NULL` macro, which defines the value of a null pointer constant, -defined in `stddef.h` by default. If you want to provide -your own macro for this, you should exclude the `stddef.h` header file by adding this -define to your configuration. - -_Example:_ -```C -#define UNITY_EXCLUDE_STDDEF_H -``` - - -#### `UNITY_INCLUDE_PRINT_FORMATTED` - -Unity provides a simple (and very basic) printf-like string output implementation, -which is able to print a string modified by the following format string modifiers: - -- __%d__ - signed value (decimal) -- __%i__ - same as __%i__ -- __%u__ - unsigned value (decimal) -- __%f__ - float/Double (if float support is activated) -- __%g__ - same as __%f__ -- __%b__ - binary prefixed with "0b" -- __%x__ - hexadecimal (upper case) prefixed with "0x" -- __%X__ - same as __%x__ -- __%p__ - pointer (same as __%x__ or __%X__) -- __%c__ - a single character -- __%s__ - a string (e.g. "string") -- __%%__ - The "%" symbol (escaped) - -_Example:_ -```C -#define UNITY_INCLUDE_PRINT_FORMATTED - -int a = 0xfab1; -TEST_PRINTF("Decimal %d\n", -7); -TEST_PRINTF("Unsigned %u\n", 987); -TEST_PRINTF("Float %f\n", 3.1415926535897932384); -TEST_PRINTF("Binary %b\n", 0xA); -TEST_PRINTF("Hex %X\n", 0xFAB); -TEST_PRINTF("Pointer %p\n", &a); -TEST_PRINTF("Character %c\n", 'F'); -TEST_PRINTF("String %s\n", "My string"); -TEST_PRINTF("Percent %%\n"); -TEST_PRINTF("Color Red \033[41mFAIL\033[00m\n"); -TEST_PRINTF("\n"); -TEST_PRINTF("Multiple (%d) (%i) (%u) (%x)\n", -100, 0, 200, 0x12345); -``` - - -### 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 run properly. These macros will help in those -situations. - - -##### `UNITY_OUTPUT_CHAR(a)` - -##### `UNITY_OUTPUT_FLUSH()` - -##### `UNITY_OUTPUT_START()` - -##### `UNITY_OUTPUT_COMPLETE()` - -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: -```C -#include "RS232_header.h" -... -#define UNITY_OUTPUT_CHAR(a) RS232_putc(a) -#define UNITY_OUTPUT_START() RS232_config(115200,1,8,0) -#define UNITY_OUTPUT_FLUSH() RS232_flush() -#define UNITY_OUTPUT_COMPLETE() RS232_close() -``` - -_Note:_ -`UNITY_OUTPUT_FLUSH()` can be set to the standard out flush function simply by -specifying `UNITY_USE_FLUSH_STDOUT`. No other defines are required. - - -##### `UNITY_OUTPUT_FOR_ECLIPSE` - -##### `UNITY_OUTPUT_FOR_IAR_WORKBENCH` - -##### `UNITY_OUTPUT_FOR_QT_CREATOR` - -When managing your own builds, it is often handy to have messages output in a format which is -recognized by your IDE. These are some standard formats which can be supported. If you're using -Ceedling to manage your builds, it is better to stick with the standard format (leaving these -all undefined) and allow Ceedling to use its own decorators. - - -##### `UNITY_PTR_ATTRIBUTE` - -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:_ -```C -#define UNITY_PTR_ATTRIBUTE __attribute__((far)) -#define UNITY_PTR_ATTRIBUTE near -``` - -##### `UNITY_PRINT_EOL` - -By default, Unity outputs \n at the end of each line of output. This is easy -to parse by the scripts, by Ceedling, etc, but it might not be ideal for YOUR -system. Feel free to override this and to make it whatever you wish. - -_Example:_ -```C -#define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\r'); UNITY_OUTPUT_CHAR('\n') } -``` - - -##### `UNITY_EXCLUDE_DETAILS` - -This is an option for if you absolutely must squeeze every byte of memory out of -your system. Unity stores a set of internal scratchpads which are used to pass -extra detail information around. It's used by systems like CMock in order to -report which function or argument flagged an error. If you're not using CMock and -you're not using these details for other things, then you can exclude them. - -_Example:_ -```C -#define UNITY_EXCLUDE_DETAILS -``` - -##### `UNITY_PRINT_TEST_CONTEXT` - -This option allows you to specify your own function to print additional context -as part of the error message when a test has failed. It can be useful if you -want to output some specific information about the state of the test at the point -of failure, and `UNITY_SET_DETAILS` isn't flexible enough for your needs. - -_Example:_ -```C -#define UNITY_PRINT_TEST_CONTEXT PrintIterationCount - -extern int iteration_count; - -void PrintIterationCount(void) -{ - UnityPrintFormatted("At iteration #%d: ", iteration_count); -} -``` - -##### `UNITY_EXCLUDE_SETJMP` - -If your embedded system doesn't support the standard library setjmp, you can -exclude Unity's reliance on this by using this define. This dropped dependence -comes at a price, though. You will be unable to use custom helper functions for -your tests, and you will be unable to use tools like CMock. Very likely, if your -compiler doesn't support setjmp, you wouldn't have had the memory space for those -things anyway, though... so this option exists for those situations. - -_Example:_ -```C -#define UNITY_EXCLUDE_SETJMP -``` - -##### `UNITY_OUTPUT_COLOR` - -If you want to add color using ANSI escape codes you can use this define. - -_Example:_ -```C -#define UNITY_OUTPUT_COLOR -``` - -##### `UNITY_SHORTHAND_AS_INT` -##### `UNITY_SHORTHAND_AS_MEM` -##### `UNITY_SHORTHAND_AS_RAW` -##### `UNITY_SHORTHAND_AS_NONE` - -These options give you control of the `TEST_ASSERT_EQUAL` and the -`TEST_ASSERT_NOT_EQUAL` shorthand assertions. Historically, Unity treated the -former as an alias for an integer comparison. It treated the latter as a direct -comparison using `!=`. This assymetry was confusing, but there was much -disagreement as to how best to treat this pair of assertions. These four options -will allow you to specify how Unity will treat these assertions. - - - AS INT - the values will be cast to integers and directly compared. Arguments - that don't cast easily to integers will cause compiler errors. - - AS MEM - the address of both values will be taken and the entire object's - memory footprint will be compared byte by byte. Directly placing - constant numbers like `456` as expected values will cause errors. - - AS_RAW - Unity assumes that you can compare the two values using `==` and `!=` - and will do so. No details are given about mismatches, because it - doesn't really know what type it's dealing with. - - AS_NONE - Unity will disallow the use of these shorthand macros altogether, - insisting that developers choose a more descriptive option. - -#### `UNITY_SUPPORT_VARIADIC_MACROS` - -This will force Unity to support variadic macros when using its own built-in -RUN_TEST macro. This will rarely be necessary. Most often, Unity will automatically -detect if the compiler supports variadic macros by checking to see if it's C99+ -compatible. In the event that the compiler supports variadic macros, but is primarily -C89 (ANSI), defining this option will allow you to use them. This option is also not -necessary when using Ceedling or the test runner generator script. - -## Getting Into The Guts - -There will be cases where the options above aren't quite going to get everything -perfect. They are likely sufficient for any situation where you are compiling -and executing your tests with a native toolchain (e.g. clang on Mac). These -options may even get you through the majority of cases encountered in working -with a target simulator run from your local command line. But especially if you -must run your test suite on your target hardware, your Unity configuration will -require special help. This special help will usually reside in one of two -places: the `main()` function or the `RUN_TEST` macro. Let's look at how these -work. - - -##### `main()` - -Each test module is compiled and run on its own, separate from the other test -files in your project. Each test file, therefore, has a `main` function. This -`main` function will need to contain whatever code is necessary to initialize -your system to a workable state. This is particularly true for situations where -you must set up a memory map or initialize a communication channel for the -output of your test results. - -A simple main function looks something like this: - -```C -int main(void) { - UNITY_BEGIN(); - RUN_TEST(test_TheFirst); - RUN_TEST(test_TheSecond); - RUN_TEST(test_TheThird); - return UNITY_END(); -} -``` - -You can see that our main function doesn't bother taking any arguments. For our -most barebones case, we'll never have arguments because we just run all the -tests each time. Instead, we start by calling `UNITY_BEGIN`. We run each test -(in whatever order we wish). Finally, we call `UNITY_END`, returning its return -value (which is the total number of failures). - -It should be easy to see that you can add code before any test cases are run or -after all the test cases have completed. This allows you to do any needed -system-wide setup or teardown that might be required for your special -circumstances. - - -##### `RUN_TEST` - -The `RUN_TEST` macro is called with each test case function. Its job is to -perform whatever setup and teardown is necessary for executing a single test -case function. This includes catching failures, calling the test module's -`setUp()` and `tearDown()` functions, and calling `UnityConcludeTest()`. If -using CMock or test coverage, there will be additional stubs in use here. A -simple minimalist RUN_TEST macro looks something like this: - -```C -#define RUN_TEST(testfunc) \ - UNITY_NEW_TEST(#testfunc) \ - if (TEST_PROTECT()) { \ - setUp(); \ - testfunc(); \ - } \ - if (TEST_PROTECT() && (!TEST_IS_IGNORED)) \ - tearDown(); \ - UnityConcludeTest(); -``` - -So that's quite a macro, huh? It gives you a glimpse of what kind of stuff Unity -has to deal with for every single test case. For each test case, we declare that -it is a new test. Then we run `setUp` and our test function. These are run -within a `TEST_PROTECT` block, the function of which is to handle failures that -occur during the test. Then, assuming our test is still running and hasn't been -ignored, we run `tearDown`. No matter what, our last step is to conclude this -test before moving on to the next. - -Let's say you need to add a call to `fsync` to force all of your output data to -flush to a file after each test. You could easily insert this after your -`UnityConcludeTest` call. Maybe you want to write an xml tag before and after -each result set. Again, you could do this by adding lines to this macro. Updates -to this macro are for the occasions when you need an action before or after -every single test case throughout your entire suite of tests. - - -## Happy Porting - -The defines and macros in this guide should help you port Unity to just about -any C target we can imagine. If you run into a snag or two, don't be afraid of -asking for help on the forums. We love a good challenge! - - -*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* diff --git a/components/testframework/libs/cmock/vendor/unity/docs/UnityGettingStartedGuide.md b/components/testframework/libs/cmock/vendor/unity/docs/UnityGettingStartedGuide.md deleted file mode 100644 index c054b3618..000000000 --- a/components/testframework/libs/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +++ /dev/null @@ -1,251 +0,0 @@ -# Unity - Getting Started - -## Welcome - -Congratulations. You're now the proud owner of your very own pile of bits! What -are you going to do with all these ones and zeros? This document should be able -to help you decide just that. - -Unity is a unit test framework. The goal has been to keep it small and -functional. The core Unity test framework is three files: a single C file and a -couple header files. These team up to provide functions and macros to make -testing easier. - -Unity was designed to be cross-platform. It works hard to stick with C standards -while still providing support for the many embedded C compilers that bend the -rules. Unity has been used with many compilers, including GCC, IAR, Clang, -Green Hills, Microchip, and MS Visual Studio. It's not much work to get it to -work with a new target. - - -### Overview of the Documents - -#### Unity Assertions reference - -This document will guide you through all the assertion options provided by -Unity. This is going to be your unit testing bread and butter. You'll spend more -time with assertions than any other part of Unity. - - -#### Unity Assertions Cheat Sheet - -This document contains an abridged summary of the assertions described in the -previous document. It's perfect for printing and referencing while you -familiarize yourself with Unity's options. - - -#### Unity Configuration Guide - -This document is the one to reference when you are going to use Unity with a new -target or compiler. It'll guide you through the configuration options and will -help you customize your testing experience to meet your needs. - - -#### Unity Helper Scripts - -This document describes the helper scripts that are available for simplifying -your testing workflow. It describes the collection of optional Ruby scripts -included in the auto directory of your Unity installation. Neither Ruby nor -these scripts are necessary for using Unity. They are provided as a convenience -for those who wish to use them. - - -#### Unity License - -What's an open source project without a license file? This brief document -describes the terms you're agreeing to when you use this software. Basically, we -want it to be useful to you in whatever context you want to use it, but please -don't blame us if you run into problems. - - -### Overview of the Folders - -If you have obtained Unity through Github or something similar, you might be -surprised by just how much stuff you suddenly have staring you in the face. -Don't worry, Unity itself is very small. The rest of it is just there to make -your life easier. You can ignore it or use it at your convenience. Here's an -overview of everything in the project. - -- `src` - This is the code you care about! This folder contains a C file and two -header files. These three files _are_ Unity. -- `docs` - You're reading this document, so it's possible you have found your way -into this folder already. This is where all the handy documentation can be -found. -- `examples` - This contains a few examples of using Unity. -- `extras` - These are optional add ons to Unity that are not part of the core -project. If you've reached us through James Grenning's book, you're going to -want to look here. -- `test` - This is how Unity and its scripts are all tested. If you're just using -Unity, you'll likely never need to go in here. If you are the lucky team member -who gets to port Unity to a new toolchain, this is a good place to verify -everything is configured properly. -- `auto` - Here you will find helpful Ruby scripts for simplifying your test -workflow. They are purely optional and are not required to make use of Unity. - - -## How to Create A Test File - -Test files are C files. Most often you will create a single test file for each C -module that you want to test. The test file should include unity.h and the -header for your C module to be tested. - -Next, a test file will include a `setUp()` and `tearDown()` function. The setUp -function can contain anything you would like to run before each test. The -tearDown function can contain anything you would like to run after each test. -Both functions accept no arguments and return nothing. You may leave either or -both of these blank if you have no need for them. - -If you're using Ceedling or the test runner generator script, you may leave these off -completely. Not sure? Give it a try. If you compiler complains that it can't -find setUp or tearDown when it links, you'll know you need to at least include -an empty function for these. - -The majority of the file will be a series of test functions. Test functions -follow the convention of starting with the word "test_" or "spec_". You don't HAVE -to name them this way, but it makes it clear what functions are tests for other -developers. Also, the automated scripts that come with Unity or Ceedling will default -to looking for test functions to be prefixed this way. Test functions take no arguments -and return nothing. All test accounting is handled internally in Unity. - -Finally, at the bottom of your test file, you will write a `main()` function. -This function will call `UNITY_BEGIN()`, then `RUN_TEST` for each test, and -finally `UNITY_END()`.This is what will actually trigger each of those test -functions to run, so it is important that each function gets its own `RUN_TEST` -call. - -Remembering to add each test to the main function can get to be tedious. If you -enjoy using helper scripts in your build process, you might consider making use -of our handy [generate_test_runner.rb](../auto/generate_test_runner.rb) script. -This will create the main function and all the calls for you, assuming that you -have followed the suggested naming conventions. In this case, there is no need -for you to include the main function in your test file at all. - -When you're done, your test file will look something like this: - -```C -#include "unity.h" -#include "file_to_test.h" - -void setUp(void) { - // set stuff up here -} - -void tearDown(void) { - // clean stuff up here -} - -void test_function_should_doBlahAndBlah(void) { - //test stuff -} - -void test_function_should_doAlsoDoBlah(void) { - //more test stuff -} - -// not needed when using generate_test_runner.rb -int main(void) { - UNITY_BEGIN(); - RUN_TEST(test_function_should_doBlahAndBlah); - RUN_TEST(test_function_should_doAlsoDoBlah); - return UNITY_END(); -} -``` - -It's possible that you will need more customization than this, eventually. -For that sort of thing, you're going to want to look at the configuration guide. -This should be enough to get you going, though. - -### Running Test Functions -When writing your own `main()` functions, for a test-runner. There are two ways -to execute the test. - -The classic variant -``` c -RUN_TEST(func, linenum) -``` -or its simpler replacement that starts at the beginning of the function. -``` c -RUN_TEST(func) -``` -These macros perform the necessary setup before the test is called and -handles cleanup and result tabulation afterwards. - -### Ignoring Test Functions -There are times when a test is incomplete or not valid for some reason. -At these times, TEST_IGNORE can be called. Control will immediately be -returned to the caller of the test, and no failures will be returned. -This is useful when your test runners are automatically generated. - -``` c -TEST_IGNORE() -``` - -Ignore this test and return immediately - -``` c -TEST_IGNORE_MESSAGE (message) -``` - -Ignore this test and return immediately. Output a message stating why the test was ignored. - -### Aborting Tests -There are times when a test will contain an infinite loop on error conditions, or there may be reason to escape from the test early without executing the rest of the test. A pair of macros support this functionality in Unity. The first `TEST_PROTECT` sets up the feature, and handles emergency abort cases. `TEST_ABORT` can then be used at any time within the tests to return to the last `TEST_PROTECT` call. - - TEST_PROTECT() - -Setup and Catch macro - - TEST_ABORT() - -Abort Test macro - -Example: - - main() - { - if (TEST_PROTECT()) - { - MyTest(); - } - } - -If MyTest calls `TEST_ABORT`, program control will immediately return to `TEST_PROTECT` with a return value of zero. - - - -## How to Build and Run A Test File - -This is the single biggest challenge to picking up a new unit testing framework, -at least in a language like C or C++. These languages are REALLY good at getting -you "close to the metal" (why is the phrase metal? Wouldn't it be more accurate -to say "close to the silicon"?). While this feature is usually a good thing, it -can make testing more challenging. - -You have two really good options for toolchains. Depending on where you're -coming from, it might surprise you that neither of these options is running the -unit tests on your hardware. -There are many reasons for this, but here's a short version: -- On hardware, you have too many constraints (processing power, memory, etc), -- On hardware, you don't have complete control over all registers, -- On hardware, unit testing is more challenging, -- Unit testing isn't System testing. Keep them separate. - -Instead of running your tests on your actual hardware, most developers choose to -develop them as native applications (using gcc or MSVC for example) or as -applications running on a simulator. Either is a good option. Native apps have -the advantages of being faster and easier to set up. Simulator apps have the -advantage of working with the same compiler as your target application. The -options for configuring these are discussed in the configuration guide. - -To get either to work, you might need to make a few changes to the file -containing your register set (discussed later). - -In either case, a test is built by linking unity, the test file, and the C -file(s) being tested. These files create an executable which can be run as the -test set for that module. Then, this process is repeated for the next test file. -This flexibility of separating tests into individual executables allows us to -much more thoroughly unit test our system and it keeps all the test code out of -our final release! - - -*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* diff --git a/components/testframework/libs/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md b/components/testframework/libs/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md deleted file mode 100644 index 46c9d74df..000000000 --- a/components/testframework/libs/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +++ /dev/null @@ -1,278 +0,0 @@ -# Unity Helper Scripts - -## With a Little Help From Our Friends - -Sometimes what it takes to be a really efficient C programmer is a little non-C. -The Unity project includes a couple of Ruby scripts for making your life just a tad -easier. They are completely optional. If you choose to use them, you'll need a -copy of Ruby, of course. Just install whatever the latest version is, and it is -likely to work. You can find Ruby at [ruby-lang.org](https://ruby-labg.org/). - - -### `generate_test_runner.rb` - -Are you tired of creating your own `main` function in your test file? Do you -keep forgetting to add a `RUN_TEST` call when you add a new test case to your -suite? Do you want to use CMock or other fancy add-ons but don't want to figure -out how to create your own `RUN_TEST` macro? - -Well then we have the perfect script for you! - -The `generate_test_runner` script processes a given test file and automatically -creates a separate test runner file that includes ?main?to execute the test -cases within the scanned test file. All you do then is add the generated runner -to your list of files to be compiled and linked, and presto you're done! - -This script searches your test file for void function signatures having a -function name beginning with "test" or "spec". It treats each of these -functions as a test case and builds up a test suite of them. For example, the -following includes three test cases: - -```C -void testVerifyThatUnityIsAwesomeAndWillMakeYourLifeEasier(void) -{ - ASSERT_TRUE(1); -} -void test_FunctionName_should_WorkProperlyAndReturn8(void) { - ASSERT_EQUAL_INT(8, FunctionName()); -} -void spec_Function_should_DoWhatItIsSupposedToDo(void) { - ASSERT_NOT_NULL(Function(5)); -} -``` - -You can run this script a couple of ways. The first is from the command line: - -```Shell -ruby generate_test_runner.rb TestFile.c NameOfRunner.c -``` - -Alternatively, if you include only the test file parameter, the script will copy -the name of the test file and automatically append `_Runner` to the name of the -generated file. The example immediately below will create TestFile_Runner.c. - -```Shell -ruby generate_test_runner.rb TestFile.c -``` - -You can also add a [YAML](http://www.yaml.org/) file to configure extra options. -Conveniently, this YAML file is of the same format as that used by Unity and -CMock. So if you are using YAML files already, you can simply pass the very same -file into the generator script. - -```Shell -ruby generate_test_runner.rb TestFile.c my_config.yml -``` - -The contents of the YAML file `my_config.yml` could look something like the -example below. If you're wondering what some of these options do, you're going -to love the next section of this document. - -```YAML -:unity: - :includes: - - stdio.h - - microdefs.h - :cexception: 1 - :suit_setup: "blah = malloc(1024);" - :suite_teardown: "free(blah);" -``` - -If you would like to force your generated test runner to include one or more -header files, you can just include those at the command line too. Just make sure -these are _after_ the YAML file, if you are using one: - -```Shell -ruby generate_test_runner.rb TestFile.c my_config.yml extras.h -``` - -Another option, particularly if you are already using Ruby to orchestrate your -builds - or more likely the Ruby-based build tool Rake - is requiring this -script directly. Anything that you would have specified in a YAML file can be -passed to the script as part of a hash. Let's push the exact same requirement -set as we did above but this time through Ruby code directly: - -```Ruby -require "generate_test_runner.rb" -options = { - :includes => ["stdio.h", "microdefs.h"], - :cexception => 1, - :suite_setup => "blah = malloc(1024);", - :suite_teardown => "free(blah);" -} -UnityTestRunnerGenerator.new.run(testfile, runner_name, options) -``` - -If you have multiple files to generate in a build script (such as a Rakefile), -you might want to instantiate a generator object with your options and call it -to generate each runner afterwards. Like thus: - -```Ruby -gen = UnityTestRunnerGenerator.new(options) -test_files.each do |f| - gen.run(f, File.basename(f,'.c')+"Runner.c" -end -``` - -#### Options accepted by generate_test_runner.rb: - -The following options are available when executing `generate_test_runner`. You -may pass these as a Ruby hash directly or specify them in a YAML file, both of -which are described above. In the `examples` directory, Example 3's Rakefile -demonstrates using a Ruby hash. - - -##### `:includes` - -This option specifies an array of file names to be `#include`'d at the top of -your runner C file. You might use it to reference custom types or anything else -universally needed in your generated runners. - - -##### `:suite_setup` - -Define this option with C code to be executed _before any_ test cases are run. - -Alternatively, if your C compiler supports weak symbols, you can leave this -option unset and instead provide a `void suiteSetUp(void)` function in your test -suite. The linker will look for this symbol and fall back to a Unity-provided -stub if it is not found. - - -##### `:suite_teardown` - -Define this option with C code to be executed _after all_ test cases have -finished. An integer variable `num_failures` is available for diagnostics. -The code should end with a `return` statement; the value returned will become -the exit code of `main`. You can normally just return `num_failures`. - -Alternatively, if your C compiler supports weak symbols, you can leave this -option unset and instead provide a `int suiteTearDown(int num_failures)` -function in your test suite. The linker will look for this symbol and fall -back to a Unity-provided stub if it is not found. - - -##### `:enforce_strict_ordering` - -This option should be defined if you have the strict order feature enabled in -CMock (see CMock documentation). This generates extra variables required for -everything to run smoothly. If you provide the same YAML to the generator as -used in CMock's configuration, you've already configured the generator properly. - - -##### `:externc` - -This option should be defined if you are mixing C and CPP and want your test -runners to automatically include extern "C" support when they are generated. - -##### `:mock_prefix` and `:mock_suffix` - -Unity automatically generates calls to Init, Verify and Destroy for every file -included in the main test file that starts with the given mock prefix and ends -with the given mock suffix, file extension not included. By default, Unity -assumes a `Mock` prefix and no suffix. - -##### `:plugins` - -This option specifies an array of plugins to be used (of course, the array can -contain only a single plugin). This is your opportunity to enable support for -CException support, which will add a check for unhandled exceptions in each -test, reporting a failure if one is detected. To enable this feature using Ruby: - -```Ruby -:plugins => [ :cexception ] -``` - -Or as a yaml file: - -```YAML -:plugins: - -:cexception -``` - -If you are using CMock, it is very likely that you are already passing an array -of plugins to CMock. You can just use the same array here. This script will just -ignore the plugins that don't require additional support. - -##### `:include_extensions` - -This option specifies the pattern for matching acceptable header file extensions. -By default it will accept hpp, hh, H, and h files. If you need a different combination -of files to search, update this from the default `'(?:hpp|hh|H|h)'`. - -##### `:source_extensions` - -This option specifies the pattern for matching acceptable source file extensions. -By default it will accept cpp, cc, C, c, and ino files. If you need a different combination -of files to search, update this from the default `'(?:cpp|cc|ino|C|c)'`. - - -### `unity_test_summary.rb` - -A Unity test file contains one or more test case functions. Each test case can -pass, fail, or be ignored. Each test file is run individually producing results -for its collection of test cases. A given project will almost certainly be -composed of multiple test files. Therefore, the suite of tests is comprised of -one or more test cases spread across one or more test files. This script -aggregates individual test file results to generate a summary of all executed -test cases. The output includes how many tests were run, how many were ignored, -and how many failed. In addition, the output includes a listing of which -specific tests were ignored and failed. A good example of the breadth and -details of these results can be found in the `examples` directory. Intentionally -ignored and failing tests in this project generate corresponding entries in the -summary report. - -If you're interested in other (prettier?) output formats, check into the -Ceedling build tool project (ceedling.sourceforge.net) that works with Unity and -CMock and supports xunit-style xml as well as other goodies. - -This script assumes the existence of files ending with the extensions -`.testpass` and `.testfail`.The contents of these files includes the test -results summary corresponding to each test file executed with the extension set -according to the presence or absence of failures for that test file. The script -searches a specified path for these files, opens each one it finds, parses the -results, and aggregates and prints a summary. Calling it from the command line -looks like this: - -```Shell -ruby unity_test_summary.rb build/test/ -``` - -You can optionally specify a root path as well. This is really helpful when you -are using relative paths in your tools' setup, but you want to pull the summary -into an IDE like Eclipse for clickable shortcuts. - -```Shell -ruby unity_test_summary.rb build/test/ ~/projects/myproject/ -``` - -Or, if you're more of a Windows sort of person: - -```Shell -ruby unity_test_summary.rb build\teat\ C:\projects\myproject\ -``` - -When configured correctly, you'll see a final summary, like so: - -```Shell --------------------------- -UNITY IGNORED TEST SUMMARY --------------------------- -blah.c:22:test_sandwiches_should_HaveBreadOnTwoSides:IGNORE - -------------------------- -UNITY FAILED TEST SUMMARY -------------------------- -blah.c:87:test_sandwiches_should_HaveCondiments:FAIL:Expected 1 was 0 -meh.c:38:test_soda_should_BeCalledPop:FAIL:Expected "pop" was "coke" - --------------------------- -OVERALL UNITY TEST SUMMARY --------------------------- -45 TOTAL TESTS 2 TOTAL FAILURES 1 IGNORED -``` - -How convenient is that? - - -*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/makefile b/components/testframework/libs/cmock/vendor/unity/examples/example_1/makefile deleted file mode 100644 index 28409c104..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/makefile +++ /dev/null @@ -1,72 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -#We try to detect the OS we are running on, and adjust commands as needed -ifeq ($(OS),Windows_NT) - ifeq ($(shell uname -s),) # not in a bash-like shell - CLEANUP = del /F /Q - MKDIR = mkdir - else # in a bash-like shell, like msys - CLEANUP = rm -f - MKDIR = mkdir -p - endif - TARGET_EXTENSION=.exe -else - CLEANUP = rm -f - MKDIR = mkdir -p - TARGET_EXTENSION=.out -endif - -C_COMPILER=gcc -ifeq ($(shell uname -s), Darwin) -C_COMPILER=clang -endif - -UNITY_ROOT=../.. - -CFLAGS=-std=c89 -CFLAGS += -Wall -CFLAGS += -Wextra -CFLAGS += -Wpointer-arith -CFLAGS += -Wcast-align -CFLAGS += -Wwrite-strings -CFLAGS += -Wswitch-default -CFLAGS += -Wunreachable-code -CFLAGS += -Winit-self -CFLAGS += -Wmissing-field-initializers -CFLAGS += -Wno-unknown-pragmas -CFLAGS += -Wstrict-prototypes -CFLAGS += -Wundef -CFLAGS += -Wold-style-definition -#CFLAGS += -Wno-misleading-indentation - -TARGET_BASE1=test1 -TARGET_BASE2=test2 -TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION) -TARGET2 = $(TARGET_BASE2)$(TARGET_EXTENSION) -SRC_FILES1=$(UNITY_ROOT)/src/unity.c src/ProductionCode.c test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c -SRC_FILES2=$(UNITY_ROOT)/src/unity.c src/ProductionCode2.c test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c -INC_DIRS=-Isrc -I$(UNITY_ROOT)/src -SYMBOLS= - -all: clean default - -default: $(SRC_FILES1) $(SRC_FILES2) - $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1) - $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES2) -o $(TARGET2) - - ./$(TARGET1) - - ./$(TARGET2) - -test/test_runners/TestProductionCode_Runner.c: test/TestProductionCode.c - ruby $(UNITY_ROOT)/auto/generate_test_runner.rb test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c -test/test_runners/TestProductionCode2_Runner.c: test/TestProductionCode2.c - ruby $(UNITY_ROOT)/auto/generate_test_runner.rb test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c - -clean: - $(CLEANUP) $(TARGET1) $(TARGET2) - -ci: CFLAGS += -Werror -ci: default diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/readme.txt b/components/testframework/libs/cmock/vendor/unity/examples/example_1/readme.txt deleted file mode 100644 index dfed81502..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/readme.txt +++ /dev/null @@ -1,5 +0,0 @@ -Example 1 -========= - -Close to the simplest possible example of Unity, using only basic features. -Run make to build & run the example tests. \ No newline at end of file diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.c deleted file mode 100644 index db128e5bd..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.c +++ /dev/null @@ -1,24 +0,0 @@ - -#include "ProductionCode.h" - -int Counter = 0; -int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; /* some obnoxious array to search that is 1-based indexing instead of 0. */ - -/* This function is supposed to search through NumbersToFind and find a particular number. - * If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since - * NumbersToFind is indexed from 1. Unfortunately it's broken - * (and should therefore be caught by our tests) */ -int FindFunction_WhichIsBroken(int NumberToFind) -{ - int i = 0; - while (i < 8) /* Notice I should have been in braces */ - i++; - if (NumbersToFind[i] == NumberToFind) /* Yikes! I'm getting run after the loop finishes instead of during it! */ - return i; - return 0; -} - -int FunctionWhichReturnsLocalVariable(void) -{ - return Counter; -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.h b/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.h deleted file mode 100644 index 250ca0dc6..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.h +++ /dev/null @@ -1,3 +0,0 @@ - -int FindFunction_WhichIsBroken(int NumberToFind); -int FunctionWhichReturnsLocalVariable(void); diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c deleted file mode 100644 index 98ee7eebc..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c +++ /dev/null @@ -1,11 +0,0 @@ - -#include "ProductionCode2.h" - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) -{ - (void)Poor; - (void)LittleFunction; - /* Since There Are No Tests Yet, This Function Could Be Empty For All We Know. - * Which isn't terribly useful... but at least we put in a TEST_IGNORE so we won't forget */ - return (char*)0; -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h b/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h deleted file mode 100644 index 34ae980d1..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h +++ /dev/null @@ -1,2 +0,0 @@ - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c deleted file mode 100644 index 404c37184..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c +++ /dev/null @@ -1,62 +0,0 @@ - -#include "ProductionCode.h" -#include "unity.h" - -/* sometimes you may want to get at local data in a module. - * for example: If you plan to pass by reference, this could be useful - * however, it should often be avoided */ -extern int Counter; - -void setUp(void) -{ - /* This is run before EACH TEST */ - Counter = 0x5a5a; -} - -void tearDown(void) -{ -} - -void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void) -{ - /* All of these should pass */ - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(78)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(2)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(33)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(999)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(-1)); -} - -void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void) -{ - /* You should see this line fail in your test summary */ - TEST_ASSERT_EQUAL(1, FindFunction_WhichIsBroken(34)); - - /* Notice the rest of these didn't get a chance to run because the line above failed. - * Unit tests abort each test function on the first sign of trouble. - * Then NEXT test function runs as normal. */ - TEST_ASSERT_EQUAL(8, FindFunction_WhichIsBroken(8888)); -} - -void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void) -{ - /* This should be true because setUp set this up for us before this test */ - TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); - - /* This should be true because we can still change our answer */ - Counter = 0x1234; - TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); -} - -void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void) -{ - /* This should be true again because setup was rerun before this test (and after we changed it to 0x1234) */ - TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); -} - -void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void) -{ - /* Sometimes you get the test wrong. When that happens, you get a failure too... and a quick look should tell - * you what actually happened...which in this case was a failure to setup the initial condition. */ - TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c deleted file mode 100644 index 7d940c171..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c +++ /dev/null @@ -1,31 +0,0 @@ - -#include "ProductionCode2.h" -#include "unity.h" - -/* These should be ignored because they are commented out in various ways: -#include "whatever.h" -#include "somethingelse.h" -*/ - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void test_IgnoredTest(void) -{ - TEST_IGNORE_MESSAGE("This Test Was Ignored On Purpose"); -} - -void test_AnotherIgnoredTest(void) -{ - TEST_IGNORE_MESSAGE("These Can Be Useful For Leaving Yourself Notes On What You Need To Do Yet"); -} - -void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void) -{ - TEST_IGNORE(); /* Like This */ -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c deleted file mode 100644 index cf72c219d..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +++ /dev/null @@ -1,53 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT()) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "ProductionCode2.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_IgnoredTest(void); -extern void test_AnotherIgnoredTest(void); -extern void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void); - - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("test/TestProductionCode2.c"); - RUN_TEST(test_IgnoredTest, 18); - RUN_TEST(test_AnotherIgnoredTest, 23); - RUN_TEST(test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented, 28); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c deleted file mode 100644 index 3b49af748..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +++ /dev/null @@ -1,57 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT()) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "ProductionCode.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void); -extern void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void); -extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void); -extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void); -extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void); - - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("test/TestProductionCode.c"); - RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode, 20); - RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken, 30); - RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue, 41); - RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain, 51); - RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed, 57); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/makefile b/components/testframework/libs/cmock/vendor/unity/examples/example_2/makefile deleted file mode 100644 index e2832173b..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/makefile +++ /dev/null @@ -1,71 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -#We try to detect the OS we are running on, and adjust commands as needed -ifeq ($(OS),Windows_NT) - ifeq ($(shell uname -s),) # not in a bash-like shell - CLEANUP = del /F /Q - MKDIR = mkdir - else # in a bash-like shell, like msys - CLEANUP = rm -f - MKDIR = mkdir -p - endif - TARGET_EXTENSION=.exe -else - CLEANUP = rm -f - MKDIR = mkdir -p - TARGET_EXTENSION=.out -endif - -C_COMPILER=gcc -ifeq ($(shell uname -s), Darwin) -C_COMPILER=clang -endif - -UNITY_ROOT=../.. - -CFLAGS=-std=c99 -CFLAGS += -Wall -CFLAGS += -Wextra -CFLAGS += -Wpointer-arith -CFLAGS += -Wcast-align -CFLAGS += -Wwrite-strings -CFLAGS += -Wswitch-default -CFLAGS += -Wunreachable-code -CFLAGS += -Winit-self -CFLAGS += -Wmissing-field-initializers -CFLAGS += -Wno-unknown-pragmas -CFLAGS += -Wstrict-prototypes -CFLAGS += -Wundef -CFLAGS += -Wold-style-definition -#CFLAGS += -Wno-misleading-indentation - -TARGET_BASE1=all_tests -TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION) -SRC_FILES1=\ - $(UNITY_ROOT)/src/unity.c \ - $(UNITY_ROOT)/extras/fixture/src/unity_fixture.c \ - src/ProductionCode.c \ - src/ProductionCode2.c \ - test/TestProductionCode.c \ - test/TestProductionCode2.c \ - test/test_runners/TestProductionCode_Runner.c \ - test/test_runners/TestProductionCode2_Runner.c \ - test/test_runners/all_tests.c -INC_DIRS=-Isrc -I$(UNITY_ROOT)/src -I$(UNITY_ROOT)/extras/fixture/src -SYMBOLS=-DUNITY_FIXTURE_NO_EXTRAS - -all: clean default - -default: - $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1) - - ./$(TARGET1) -v - -clean: - $(CLEANUP) $(TARGET1) - -ci: CFLAGS += -Werror -ci: default diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/readme.txt b/components/testframework/libs/cmock/vendor/unity/examples/example_2/readme.txt deleted file mode 100644 index f0fce657c..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/readme.txt +++ /dev/null @@ -1,5 +0,0 @@ -Example 2 -========= - -Same as the first example, but now using Unity's test fixture to group tests -together. Using the test fixture also makes writing test runners much easier. \ No newline at end of file diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.c deleted file mode 100644 index 3bafe2056..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.c +++ /dev/null @@ -1,24 +0,0 @@ - -#include "ProductionCode.h" - -int Counter = 0; -int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; //some obnoxious array to search that is 1-based indexing instead of 0. - -// This function is supposed to search through NumbersToFind and find a particular number. -// If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since -// NumbersToFind is indexed from 1. Unfortunately it's broken -// (and should therefore be caught by our tests) -int FindFunction_WhichIsBroken(int NumberToFind) -{ - int i = 0; - while (i < 8) //Notice I should have been in braces - i++; - if (NumbersToFind[i] == NumberToFind) //Yikes! I'm getting run after the loop finishes instead of during it! - return i; - return 0; -} - -int FunctionWhichReturnsLocalVariable(void) -{ - return Counter; -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.h b/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.h deleted file mode 100644 index 250ca0dc6..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.h +++ /dev/null @@ -1,3 +0,0 @@ - -int FindFunction_WhichIsBroken(int NumberToFind); -int FunctionWhichReturnsLocalVariable(void); diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c deleted file mode 100644 index 77c969f17..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c +++ /dev/null @@ -1,11 +0,0 @@ - -#include "ProductionCode2.h" - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) -{ - (void)Poor; - (void)LittleFunction; - //Since There Are No Tests Yet, This Function Could Be Empty For All We Know. - // Which isn't terribly useful... but at least we put in a TEST_IGNORE so we won't forget - return (char*)0; -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h b/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h deleted file mode 100644 index 34ae980d1..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h +++ /dev/null @@ -1,2 +0,0 @@ - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c deleted file mode 100644 index b8fb95c08..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "ProductionCode.h" -#include "unity.h" -#include "unity_fixture.h" - -TEST_GROUP(ProductionCode); - -//sometimes you may want to get at local data in a module. -//for example: If you plan to pass by reference, this could be useful -//however, it should often be avoided -extern int Counter; - -TEST_SETUP(ProductionCode) -{ - //This is run before EACH TEST - Counter = 0x5a5a; -} - -TEST_TEAR_DOWN(ProductionCode) -{ -} - -TEST(ProductionCode, FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode) -{ - //All of these should pass - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(78)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(2)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(33)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(999)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(-1)); -} - -TEST(ProductionCode, FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken) -{ - // You should see this line fail in your test summary - TEST_ASSERT_EQUAL(1, FindFunction_WhichIsBroken(34)); - - // Notice the rest of these didn't get a chance to run because the line above failed. - // Unit tests abort each test function on the first sign of trouble. - // Then NEXT test function runs as normal. - TEST_ASSERT_EQUAL(8, FindFunction_WhichIsBroken(8888)); -} - -TEST(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue) -{ - //This should be true because setUp set this up for us before this test - TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); - - //This should be true because we can still change our answer - Counter = 0x1234; - TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); -} - -TEST(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain) -{ - //This should be true again because setup was rerun before this test (and after we changed it to 0x1234) - TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); -} - -TEST(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed) -{ - //Sometimes you get the test wrong. When that happens, you get a failure too... and a quick look should tell - // you what actually happened...which in this case was a failure to setup the initial condition. - TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c deleted file mode 100644 index d9f4efe31..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "ProductionCode2.h" -#include "unity.h" -#include "unity_fixture.h" - -TEST_GROUP(ProductionCode2); - -/* These should be ignored because they are commented out in various ways: -#include "whatever.h" -*/ -//#include "somethingelse.h" - -TEST_SETUP(ProductionCode2) -{ -} - -TEST_TEAR_DOWN(ProductionCode2) -{ -} - -TEST(ProductionCode2, IgnoredTest) -{ - TEST_IGNORE_MESSAGE("This Test Was Ignored On Purpose"); -} - -TEST(ProductionCode2, AnotherIgnoredTest) -{ - TEST_IGNORE_MESSAGE("These Can Be Useful For Leaving Yourself Notes On What You Need To Do Yet"); -} - -TEST(ProductionCode2, ThisFunctionHasNotBeenTested_NeedsToBeImplemented) -{ - TEST_IGNORE(); //Like This -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c deleted file mode 100644 index 6fcc3b120..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "unity.h" -#include "unity_fixture.h" - -TEST_GROUP_RUNNER(ProductionCode2) -{ - RUN_TEST_CASE(ProductionCode2, IgnoredTest); - RUN_TEST_CASE(ProductionCode2, AnotherIgnoredTest); - RUN_TEST_CASE(ProductionCode2, ThisFunctionHasNotBeenTested_NeedsToBeImplemented); -} \ No newline at end of file diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c deleted file mode 100644 index 41a416a6e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "unity.h" -#include "unity_fixture.h" - -TEST_GROUP_RUNNER(ProductionCode) -{ - RUN_TEST_CASE(ProductionCode, FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode); - RUN_TEST_CASE(ProductionCode, FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken); - RUN_TEST_CASE(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue); - RUN_TEST_CASE(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain); - RUN_TEST_CASE(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed); -} \ No newline at end of file diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c deleted file mode 100644 index e706ece7d..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "unity_fixture.h" - -static void RunAllTests(void) -{ - RUN_TEST_GROUP(ProductionCode); - RUN_TEST_GROUP(ProductionCode2); -} - -int main(int argc, const char * argv[]) -{ - return UnityMain(argc, argv, RunAllTests); -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c b/components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c deleted file mode 100644 index 9cf42c678..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "unity.h" -#include "UnityHelper.h" -#include -#include - -void AssertEqualExampleStruct(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line) -{ - UNITY_TEST_ASSERT_EQUAL_INT(expected.x, actual.x, line, "Example Struct Failed For Field x"); - UNITY_TEST_ASSERT_EQUAL_INT(expected.y, actual.y, line, "Example Struct Failed For Field y"); -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h b/components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h deleted file mode 100644 index 151611158..000000000 --- a/components/testframework/libs/cmock/vendor/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/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile.rb b/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile.rb deleted file mode 100644 index c095af38e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile.rb +++ /dev/null @@ -1,38 +0,0 @@ -require 'rake' -require 'rake/clean' -require_relative 'rakefile_helper' - -TEMP_DIRS = [ - File.join(__dir__, 'build') -].freeze - -TEMP_DIRS.each do |dir| - directory(dir) - CLOBBER.include(dir) -end - -task prepare_for_tests: TEMP_DIRS - -# Load default configuration, for now -DEFAULT_CONFIG_FILE = 'target_gcc_32.yml'.freeze -configure_toolchain(DEFAULT_CONFIG_FILE) - -task unit: [:prepare_for_tests] do - run_tests unit_test_files -end - -desc 'Generate test summary' -task :summary do - report_summary -end - -desc 'Build and test Unity' -task all: %i[clean unit summary] -task default: %i[clobber all] -task ci: [:default] -task cruise: [:default] - -desc 'Load configuration' -task :config, :config_file do |_t, args| - configure_toolchain(args[:config_file]) -end diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile_helper.rb b/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile_helper.rb deleted file mode 100644 index 64d20c95f..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +++ /dev/null @@ -1,250 +0,0 @@ -require 'yaml' -require 'fileutils' -require_relative '../../auto/unity_test_summary' -require_relative '../../auto/generate_test_runner' -require_relative '../../auto/colour_reporter' - -C_EXTENSION = '.c'.freeze - -def load_configuration(config_file) - $cfg_file = config_file - $cfg = YAML.load(File.read($cfg_file)) -end - -def configure_clean - CLEAN.include($cfg['compiler']['build_path'] + '*.*') unless $cfg['compiler']['build_path'].nil? -end - -def configure_toolchain(config_file = DEFAULT_CONFIG_FILE) - config_file += '.yml' unless config_file =~ /\.yml$/ - load_configuration(config_file) - configure_clean -end - -def unit_test_files - path = $cfg['compiler']['unit_tests_path'] + 'Test*' + C_EXTENSION - path.tr!('\\', '/') - FileList.new(path) -end - -def local_include_dirs - include_dirs = $cfg['compiler']['includes']['items'].dup - include_dirs.delete_if { |dir| dir.is_a?(Array) } - include_dirs -end - -def extract_headers(filename) - includes = [] - lines = File.readlines(filename) - lines.each do |line| - m = line.match(/^\s*#include\s+\"\s*(.+\.[hH])\s*\"/) - includes << m[1] unless m.nil? - end - includes -end - -def find_source_file(header, paths) - paths.each do |dir| - src_file = dir + header.ext(C_EXTENSION) - return src_file if File.exist?(src_file) - end - nil -end - -def tackit(strings) - result = if strings.is_a?(Array) - "\"#{strings.join}\"" - else - strings - end - result -end - -def squash(prefix, items) - result = '' - items.each { |item| result += " #{prefix}#{tackit(item)}" } - result -end - -def build_compiler_fields - command = tackit($cfg['compiler']['path']) - defines = if $cfg['compiler']['defines']['items'].nil? - '' - else - squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items']) - end - options = squash('', $cfg['compiler']['options']) - includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items']) - includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) - - { command: command, defines: defines, options: options, includes: includes } -end - -def compile(file, _defines = []) - compiler = build_compiler_fields - cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{compiler[:options]}#{compiler[:includes]} #{file} " \ - "#{$cfg['compiler']['object_files']['prefix']}#{$cfg['compiler']['object_files']['destination']}" - obj_file = "#{File.basename(file, C_EXTENSION)}#{$cfg['compiler']['object_files']['extension']}" - execute(cmd_str + obj_file) - obj_file -end - -def build_linker_fields - command = tackit($cfg['linker']['path']) - options = if $cfg['linker']['options'].nil? - '' - else - squash('', $cfg['linker']['options']) - end - includes = if $cfg['linker']['includes'].nil? || $cfg['linker']['includes']['items'].nil? - '' - else - squash($cfg['linker']['includes']['prefix'], $cfg['linker']['includes']['items']) - end.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) - - { command: command, options: options, includes: includes } -end - -def link_it(exe_name, obj_list) - linker = build_linker_fields - cmd_str = "#{linker[:command]}#{linker[:options]}#{linker[:includes]} " + - (obj_list.map { |obj| "#{$cfg['linker']['object_files']['path']}#{obj} " }).join + - $cfg['linker']['bin_files']['prefix'] + ' ' + - $cfg['linker']['bin_files']['destination'] + - exe_name + $cfg['linker']['bin_files']['extension'] - execute(cmd_str) -end - -def build_simulator_fields - return nil if $cfg['simulator'].nil? - - command = if $cfg['simulator']['path'].nil? - '' - else - (tackit($cfg['simulator']['path']) + ' ') - end - pre_support = if $cfg['simulator']['pre_support'].nil? - '' - else - squash('', $cfg['simulator']['pre_support']) - end - post_support = if $cfg['simulator']['post_support'].nil? - '' - else - squash('', $cfg['simulator']['post_support']) - end - - { command: command, pre_support: pre_support, post_support: post_support } -end - -def execute(command_string, verbose = true, raise_on_fail = true) - report command_string - output = `#{command_string}`.chomp - report(output) if verbose && !output.nil? && !output.empty? - - if !$?.nil? && !$?.exitstatus.zero? && raise_on_fail - raise "Command failed. (Returned #{$?.exitstatus})" - end - - output -end - -def report_summary - summary = UnityTestSummary.new - summary.root = __dir__ - results_glob = "#{$cfg['compiler']['build_path']}*.test*" - results_glob.tr!('\\', '/') - results = Dir[results_glob] - summary.targets = results - summary.run - fail_out 'FAIL: There were failures' if summary.failures > 0 -end - -def run_tests(test_files) - report 'Running system tests...' - - # Tack on TEST define for compiling unit tests - load_configuration($cfg_file) - test_defines = ['TEST'] - $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? - $cfg['compiler']['defines']['items'] << 'TEST' - - include_dirs = local_include_dirs - - # Build and execute each unit test - test_files.each do |test| - obj_list = [] - - # Detect dependencies and build required required modules - extract_headers(test).each do |header| - # Compile corresponding source file if it exists - src_file = find_source_file(header, include_dirs) - obj_list << compile(src_file, test_defines) unless src_file.nil? - end - - # Build the test runner (generate if configured to do so) - test_base = File.basename(test, C_EXTENSION) - runner_name = test_base + '_Runner.c' - if $cfg['compiler']['runner_path'].nil? - runner_path = $cfg['compiler']['build_path'] + runner_name - test_gen = UnityTestRunnerGenerator.new($cfg_file) - test_gen.run(test, runner_path) - else - runner_path = $cfg['compiler']['runner_path'] + runner_name - end - - obj_list << compile(runner_path, test_defines) - - # Build the test module - obj_list << compile(test, test_defines) - - # Link the test executable - link_it(test_base, obj_list) - - # Execute unit test and generate results file - simulator = build_simulator_fields - executable = $cfg['linker']['bin_files']['destination'] + test_base + $cfg['linker']['bin_files']['extension'] - cmd_str = if simulator.nil? - executable - else - "#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}" - end - output = execute(cmd_str, true, false) - test_results = $cfg['compiler']['build_path'] + test_base - test_results += if output.match(/OK$/m).nil? - '.testfail' - else - '.testpass' - end - File.open(test_results, 'w') { |f| f.print output } - end -end - -def build_application(main) - report 'Building application...' - - obj_list = [] - load_configuration($cfg_file) - main_path = $cfg['compiler']['source_path'] + main + C_EXTENSION - - # Detect dependencies and build required required modules - include_dirs = get_local_include_dirs - extract_headers(main_path).each do |header| - src_file = find_source_file(header, include_dirs) - obj_list << compile(src_file) unless src_file.nil? - end - - # Build the main source file - main_base = File.basename(main_path, C_EXTENSION) - obj_list << compile(main_path) - - # Create the executable - link_it(main_base, obj_list) -end - -def fail_out(msg) - puts msg - puts 'Not returning exit code so continuous integration can pass' - # exit(-1) # Only removed to pass example_3, which has failing tests on purpose. - # Still fail if the build fails for any other reason. -end diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/readme.txt b/components/testframework/libs/cmock/vendor/unity/examples/example_3/readme.txt deleted file mode 100644 index 7371fea05..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/readme.txt +++ /dev/null @@ -1,13 +0,0 @@ -Example 3 -========= - -This example project gives an example of some passing, ignored, and failing tests. -It's simple and meant for you to look over and get an idea for what all of this stuff does. - -You can build and test using rake. The rake version will let you test with gcc or a couple -versions of IAR. You can tweak the yaml files to get those versions running. - -Ruby is required if you're using the rake version (obviously). This version shows off most of -Unity's advanced features (automatically creating test runners, fancy summaries, etc.) -Without ruby, you have to maintain your own test runners. Do that for a while and you'll learn -why you really want to start using the Ruby tools. diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.c deleted file mode 100644 index 3bafe2056..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.c +++ /dev/null @@ -1,24 +0,0 @@ - -#include "ProductionCode.h" - -int Counter = 0; -int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; //some obnoxious array to search that is 1-based indexing instead of 0. - -// This function is supposed to search through NumbersToFind and find a particular number. -// If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since -// NumbersToFind is indexed from 1. Unfortunately it's broken -// (and should therefore be caught by our tests) -int FindFunction_WhichIsBroken(int NumberToFind) -{ - int i = 0; - while (i < 8) //Notice I should have been in braces - i++; - if (NumbersToFind[i] == NumberToFind) //Yikes! I'm getting run after the loop finishes instead of during it! - return i; - return 0; -} - -int FunctionWhichReturnsLocalVariable(void) -{ - return Counter; -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.h b/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.h deleted file mode 100644 index 250ca0dc6..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.h +++ /dev/null @@ -1,3 +0,0 @@ - -int FindFunction_WhichIsBroken(int NumberToFind); -int FunctionWhichReturnsLocalVariable(void); diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c deleted file mode 100644 index 77c969f17..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c +++ /dev/null @@ -1,11 +0,0 @@ - -#include "ProductionCode2.h" - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) -{ - (void)Poor; - (void)LittleFunction; - //Since There Are No Tests Yet, This Function Could Be Empty For All We Know. - // Which isn't terribly useful... but at least we put in a TEST_IGNORE so we won't forget - return (char*)0; -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h b/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h deleted file mode 100644 index 34ae980d1..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h +++ /dev/null @@ -1,2 +0,0 @@ - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/target_gcc_32.yml b/components/testframework/libs/cmock/vendor/unity/examples/example_3/target_gcc_32.yml deleted file mode 100644 index d7568ab81..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/target_gcc_32.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Copied from ~Unity/targets/gcc_32.yml -unity_root: &unity_root '../..' -unity_source: &unity_source '../../src/' -compiler: - path: gcc - source_path: &source_path 'src/' - unit_tests_path: &unit_tests_path 'test/' - build_path: &build_path 'build/' - options: - - '-c' - - '-m32' - - '-Wall' - - '-Wno-address' - - '-std=c99' - - '-pedantic' - includes: - prefix: '-I' - items: - - *source_path - - *unity_source - - *unit_tests_path - defines: - prefix: '-D' - items: - - UNITY_INCLUDE_DOUBLE - - UNITY_SUPPORT_TEST_CASES - object_files: - prefix: '-o' - extension: '.o' - destination: *build_path -linker: - path: gcc - options: - - -lm - - '-m32' - includes: - prefix: '-I' - object_files: - path: *build_path - extension: '.o' - bin_files: - prefix: '-o' - extension: '.exe' - destination: *build_path -colour: true -:unity: - :plugins: [] diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c deleted file mode 100644 index 28a55812c..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c +++ /dev/null @@ -1,62 +0,0 @@ - -#include "ProductionCode.h" -#include "unity.h" - -//sometimes you may want to get at local data in a module. -//for example: If you plan to pass by reference, this could be useful -//however, it should often be avoided -extern int Counter; - -void setUp(void) -{ - //This is run before EACH TEST - Counter = 0x5a5a; -} - -void tearDown(void) -{ -} - -void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void) -{ - //All of these should pass - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(78)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(1)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(33)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(999)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(-1)); -} - -void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void) -{ - // You should see this line fail in your test summary - TEST_ASSERT_EQUAL(1, FindFunction_WhichIsBroken(34)); - - // Notice the rest of these didn't get a chance to run because the line above failed. - // Unit tests abort each test function on the first sign of trouble. - // Then NEXT test function runs as normal. - TEST_ASSERT_EQUAL(8, FindFunction_WhichIsBroken(8888)); -} - -void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void) -{ - //This should be true because setUp set this up for us before this test - TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); - - //This should be true because we can still change our answer - Counter = 0x1234; - TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); -} - -void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void) -{ - //This should be true again because setup was rerun before this test (and after we changed it to 0x1234) - TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); -} - -void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void) -{ - //Sometimes you get the test wrong. When that happens, you get a failure too... and a quick look should tell - // you what actually happened...which in this case was a failure to setup the initial condition. - TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c deleted file mode 100644 index e2119cc38..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c +++ /dev/null @@ -1,31 +0,0 @@ - -#include "ProductionCode2.h" -#include "unity.h" - -/* These should be ignored because they are commented out in various ways: -#include "whatever.h" -*/ -//#include "somethingelse.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void test_IgnoredTest(void) -{ - TEST_IGNORE_MESSAGE("This Test Was Ignored On Purpose"); -} - -void test_AnotherIgnoredTest(void) -{ - TEST_IGNORE_MESSAGE("These Can Be Useful For Leaving Yourself Notes On What You Need To Do Yet"); -} - -void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void) -{ - TEST_IGNORE(); //Like This -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/meson.build b/components/testframework/libs/cmock/vendor/unity/examples/example_4/meson.build deleted file mode 100644 index f06c3fe3a..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -# -# build script written by : Michael Brockus. -# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. -# -# license: MIT -# -project('example-4', 'c') - -unity_dep = dependency('unity', fallback : ['unity', 'unity_dep']) - -subdir('src') -subdir('test') diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/readme.txt b/components/testframework/libs/cmock/vendor/unity/examples/example_4/readme.txt deleted file mode 100644 index c8f45a817..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/readme.txt +++ /dev/null @@ -1,15 +0,0 @@ -Example 4 -========= - -Close to the simplest possible example of Unity, using only basic features. -to build this example run "meson setup ". - -Meson uses the Ninja build system to actually build the code. To start the -build, simply type the following command. - -"ninja -C " - -Meson provides native support for running tests. The command to do that is simple. - -"meson test -C ". - \ No newline at end of file diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.c deleted file mode 100644 index db128e5bd..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.c +++ /dev/null @@ -1,24 +0,0 @@ - -#include "ProductionCode.h" - -int Counter = 0; -int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; /* some obnoxious array to search that is 1-based indexing instead of 0. */ - -/* This function is supposed to search through NumbersToFind and find a particular number. - * If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since - * NumbersToFind is indexed from 1. Unfortunately it's broken - * (and should therefore be caught by our tests) */ -int FindFunction_WhichIsBroken(int NumberToFind) -{ - int i = 0; - while (i < 8) /* Notice I should have been in braces */ - i++; - if (NumbersToFind[i] == NumberToFind) /* Yikes! I'm getting run after the loop finishes instead of during it! */ - return i; - return 0; -} - -int FunctionWhichReturnsLocalVariable(void) -{ - return Counter; -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.h b/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.h deleted file mode 100644 index 250ca0dc6..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.h +++ /dev/null @@ -1,3 +0,0 @@ - -int FindFunction_WhichIsBroken(int NumberToFind); -int FunctionWhichReturnsLocalVariable(void); diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.c deleted file mode 100644 index 98ee7eebc..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.c +++ /dev/null @@ -1,11 +0,0 @@ - -#include "ProductionCode2.h" - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) -{ - (void)Poor; - (void)LittleFunction; - /* Since There Are No Tests Yet, This Function Could Be Empty For All We Know. - * Which isn't terribly useful... but at least we put in a TEST_IGNORE so we won't forget */ - return (char*)0; -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.h b/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.h deleted file mode 100644 index 34ae980d1..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.h +++ /dev/null @@ -1,2 +0,0 @@ - -char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/meson.build b/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/meson.build deleted file mode 100644 index 10c5735be..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -# -# build script written by : Michael Brockus. -# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. -# -# license: MIT -# -inc_dir = include_directories('.') -lib_list = {'a': ['ProductionCode.c' ], 'b': ['ProductionCode2.c']} - -foreach lib, src : lib_list - set_variable(lib + '_lib', - static_library(lib + '_lib', sources: src, include_directories: inc_dir)) -endforeach - -a_dep = declare_dependency(link_with: a_lib, include_directories: inc_dir) -b_dep = declare_dependency(link_with: b_lib, include_directories: inc_dir) diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/subprojects/unity.wrap b/components/testframework/libs/cmock/vendor/unity/examples/example_4/subprojects/unity.wrap deleted file mode 100755 index f2e54c84d..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/subprojects/unity.wrap +++ /dev/null @@ -1,4 +0,0 @@ -[wrap-git] -directory = unity -url = https://github.com/ThrowTheSwitch/Unity.git -revision = head diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode.c deleted file mode 100644 index 526a84eb9..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode.c +++ /dev/null @@ -1,63 +0,0 @@ - -#include "ProductionCode.h" -#include "unity.h" - -/* sometimes you may want to get at local data in a module. - * for example: If you plan to pass by reference, this could be useful - * however, it should often be avoided */ -extern int Counter; - -void setUp(void) -{ - /* This is run before EACH TEST */ - Counter = 0x5a5a; -} - -void tearDown(void) -{ -} - - -void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void) -{ - /* All of these should pass */ - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(78)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(2)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(33)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(999)); - TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(-1)); -} - -void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void) -{ - /* You should see this line fail in your test summary */ - TEST_ASSERT_EQUAL(1, FindFunction_WhichIsBroken(34)); - - /* Notice the rest of these didn't get a chance to run because the line above failed. - * Unit tests abort each test function on the first sign of trouble. - * Then NEXT test function runs as normal. */ - TEST_ASSERT_EQUAL(8, FindFunction_WhichIsBroken(8888)); -} - -void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void) -{ - /* This should be true because setUp set this up for us before this test */ - TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); - - /* This should be true because we can still change our answer */ - Counter = 0x1234; - TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); -} - -void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void) -{ - /* This should be true again because setup was rerun before this test (and after we changed it to 0x1234) */ - TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); -} - -void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void) -{ - /* Sometimes you get the test wrong. When that happens, you get a failure too... and a quick look should tell - * you what actually happened...which in this case was a failure to setup the initial condition. */ - TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode2.c deleted file mode 100644 index 2578ca94e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode2.c +++ /dev/null @@ -1,35 +0,0 @@ - -#include "ProductionCode2.h" -#include "unity.h" - -/* These should be ignored because they are commented out in various ways: -#include "whatever.h" -#include "somethingelse.h" -*/ - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void test_IgnoredTest(void); -void test_AnotherIgnoredTest(void); -void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void); - -void test_IgnoredTest(void) -{ - TEST_IGNORE_MESSAGE("This Test Was Ignored On Purpose"); -} - -void test_AnotherIgnoredTest(void) -{ - TEST_IGNORE_MESSAGE("These Can Be Useful For Leaving Yourself Notes On What You Need To Do Yet"); -} - -void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void) -{ - TEST_IGNORE(); /* Like This */ -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/meson.build b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/meson.build deleted file mode 100644 index 0e3c72f5c..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -# -# build script written by : Michael Brockus. -# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. -# -# license: MIT -# -subdir('test_runners') diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c deleted file mode 100644 index cf72c219d..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c +++ /dev/null @@ -1,53 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT()) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "ProductionCode2.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_IgnoredTest(void); -extern void test_AnotherIgnoredTest(void); -extern void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void); - - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("test/TestProductionCode2.c"); - RUN_TEST(test_IgnoredTest, 18); - RUN_TEST(test_AnotherIgnoredTest, 23); - RUN_TEST(test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented, 28); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c deleted file mode 100644 index 3b49af748..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c +++ /dev/null @@ -1,57 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT()) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "ProductionCode.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void); -extern void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void); -extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void); -extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void); -extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void); - - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("test/TestProductionCode.c"); - RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode, 20); - RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken, 30); - RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue, 41); - RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain, 51); - RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed, 57); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/meson.build b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/meson.build deleted file mode 100644 index f2a43c1b5..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -# -# build script written by : Michael Brockus. -# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. -# -# license: MIT -# -cases = [ - ['TestProductionCode_Runner.c', join_paths('..' ,'TestProductionCode.c' )], - ['TestProductionCode2_Runner.c', join_paths('..' ,'TestProductionCode2.c')] - ] - -test('Running: 01-test-case', executable('01-test-case', cases[0], dependencies: [ a_dep, unity_dep ])) -test('Running: 02-test-case', executable('02-test-case', cases[1], dependencies: [ b_dep, unity_dep ])) diff --git a/components/testframework/libs/cmock/vendor/unity/examples/unity_config.h b/components/testframework/libs/cmock/vendor/unity/examples/unity_config.h deleted file mode 100644 index fc6cdb05a..000000000 --- a/components/testframework/libs/cmock/vendor/unity/examples/unity_config.h +++ /dev/null @@ -1,244 +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 */ - - -/* *************************** MISCELLANEOUS *********************************** - * Miscellaneous configuration options for Unity - **************************************************************************** */ - -/* Unity uses the stddef.h header included in the C standard library for the - * "NULL" macro. Define this in order to disable the include of stddef.h. If you - * do this, you have to make sure to provide your own "NULL" definition. - */ -/* #define UNITY_EXCLUDE_STDDEF_H */ - -/* Define this to enable the unity formatted print macro: - * "TEST_PRINTF" - */ -/* #define UNITY_INCLUDE_PRINT_FORMATTED */ - - -/* *************************** 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() */ - -/* 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 */ - -/* Print execution time of each test when executed in verbose mode - * - * Example: - * - * TEST - PASS (10 ms) - */ -/* #define UNITY_INCLUDE_EXEC_TIME */ - -#endif /* UNITY_CONFIG_H */ diff --git a/components/testframework/libs/cmock/vendor/unity/extras/eclipse/error_parsers.txt b/components/testframework/libs/cmock/vendor/unity/extras/eclipse/error_parsers.txt deleted file mode 100644 index 94e34ff38..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/eclipse/error_parsers.txt +++ /dev/null @@ -1,26 +0,0 @@ -Eclipse error parsers -===================== - -These are a godsend for extracting & quickly navigating to -warnings & error messages from console output. Unforunately -I don't know how to write an Eclipse plugin so you'll have -to add them manually. - -To add a console parser to Eclipse, go to Window --> Preferences ---> C/C++ --> Build --> Settings. Click on the 'Error Parsers' -tab and then click the 'Add...' button. See the table below for -the parser fields to add. - -Eclipse will only parse the console output during a build, so -running your unit tests must be part of your build process. -Either add this to your make/rakefile, or add it as a post- -build step in your Eclipse project settings. - - -Unity unit test error parsers ------------------------------ -Severity Pattern File Line Description -------------------------------------------------------------------------------- -Error (\.+)(.*?):(\d+):(.*?):FAIL: (.*) $2 $3 $5 -Warning (\.+)(.*?):(\d+):(.*?):IGNORE: (.*) $2 $3 $5 -Warning (\.+)(.*?):(\d+):(.*?):IGNORE\s*$ $2 $3 Ignored test diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/readme.md b/components/testframework/libs/cmock/vendor/unity/extras/fixture/readme.md deleted file mode 100644 index 2e0c2f06b..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -# Unity Fixtures - -This Framework is an optional add-on to Unity. By including unity_framework.h in place of unity.h, -you may now work with Unity in a manner similar to CppUTest. This framework adds the concepts of -test groups and gives finer control of your tests over the command line. - -This framework is primarily supplied for those working through James Grenning's book on Embedded -Test Driven Development, or those coming to Unity from CppUTest. We should note that using this -framework glosses over some of the features of Unity, and makes it more difficult -to integrate with other testing tools like Ceedling and CMock. - -# Dependency Notification - -Fixtures, by default, uses the Memory addon as well. This is to make it simple for those trying to -follow along with James' book. Using them together is completely optional. You may choose to use -Fixtures without Memory handling by defining `UNITY_FIXTURE_NO_EXTRAS`. It will then stop automatically -pulling in extras and leave you to do it as desired. - -# Usage information - -By default the test executables produced by Unity Fixtures run all tests once, but the behavior can -be configured with command-line flags. Run the test executable with the `--help` flag for more -information. - -It's possible to add a custom line at the end of the help message, typically to point to -project-specific or company-specific unit test documentation. Define `UNITY_CUSTOM_HELP_MSG` to -provide a custom message, e.g.: - - #define UNITY_CUSTOM_HELP_MSG "If any test fails see https://example.com/troubleshooting" diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.c b/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.c deleted file mode 100644 index c3dda7963..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +++ /dev/null @@ -1,310 +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] - * ========================================== */ - -#include "unity_fixture.h" -#include "unity_internals.h" -#include - -struct UNITY_FIXTURE_T UnityFixture; - -/* If you decide to use the function pointer approach. - * Build with -D UNITY_OUTPUT_CHAR=outputChar and include - * int (*outputChar)(int) = putchar; */ - -void setUp(void) { /*does nothing*/ } -void tearDown(void) { /*does nothing*/ } - -static void announceTestRun(unsigned int runNumber) -{ - UnityPrint("Unity test run "); - UnityPrintNumberUnsigned(runNumber+1); - UnityPrint(" of "); - UnityPrintNumberUnsigned(UnityFixture.RepeatCount); - UNITY_PRINT_EOL(); -} - -int UnityMain(int argc, const char* argv[], void (*runAllTests)(void)) -{ - int result = UnityGetCommandLineOptions(argc, argv); - unsigned int r; - if (result != 0) - return result; - - for (r = 0; r < UnityFixture.RepeatCount; r++) - { - UnityBegin(argv[0]); - announceTestRun(r); - runAllTests(); - if (!UnityFixture.Verbose) UNITY_PRINT_EOL(); - UnityEnd(); - } - - return (int)Unity.TestFailures; -} - -static int selected(const char* filter, const char* name) -{ - if (filter == 0) - return 1; - return strstr(name, filter) ? 1 : 0; -} - -static int testSelected(const char* test) -{ - return selected(UnityFixture.NameFilter, test); -} - -static int groupSelected(const char* group) -{ - return selected(UnityFixture.GroupFilter, group); -} - -void UnityTestRunner(unityfunction* setup, - unityfunction* testBody, - unityfunction* teardown, - const char* printableName, - const char* group, - const char* name, - const char* file, - unsigned int line) -{ - if (testSelected(name) && groupSelected(group)) - { - Unity.TestFile = file; - Unity.CurrentTestName = printableName; - Unity.CurrentTestLineNumber = line; - if (UnityFixture.Verbose) - { - UnityPrint(printableName); - #ifndef UNITY_REPEAT_TEST_NAME - Unity.CurrentTestName = NULL; - #endif - } - else if (UnityFixture.Silent) - { - /* Do Nothing */ - } - else - { - UNITY_OUTPUT_CHAR('.'); - } - - Unity.NumberOfTests++; - UnityPointer_Init(); - - UNITY_EXEC_TIME_START(); - - if (TEST_PROTECT()) - { - setup(); - testBody(); - } - if (TEST_PROTECT()) - { - teardown(); - } - if (TEST_PROTECT()) - { - UnityPointer_UndoAllSets(); - } - UnityConcludeFixtureTest(); - } -} - -void UnityIgnoreTest(const char* printableName, const char* group, const char* name) -{ - if (testSelected(name) && groupSelected(group)) - { - Unity.NumberOfTests++; - Unity.TestIgnores++; - if (UnityFixture.Verbose) - { - UnityPrint(printableName); - UNITY_PRINT_EOL(); - } - else if (UnityFixture.Silent) - { - /* Do Nothing */ - } - else - { - UNITY_OUTPUT_CHAR('!'); - } - } -} - -/*-------------------------------------------------------- */ -/*Automatic pointer restoration functions */ -struct PointerPair -{ - void** pointer; - void* old_value; -}; - -static struct PointerPair pointer_store[UNITY_MAX_POINTERS]; -static int pointer_index = 0; - -void UnityPointer_Init(void) -{ - pointer_index = 0; -} - -void UnityPointer_Set(void** pointer, void* newValue, UNITY_LINE_TYPE line) -{ - if (pointer_index >= UNITY_MAX_POINTERS) - { - UNITY_TEST_FAIL(line, "Too many pointers set"); - } - else - { - pointer_store[pointer_index].pointer = pointer; - pointer_store[pointer_index].old_value = *pointer; - *pointer = newValue; - pointer_index++; - } -} - -void UnityPointer_UndoAllSets(void) -{ - while (pointer_index > 0) - { - pointer_index--; - *(pointer_store[pointer_index].pointer) = - pointer_store[pointer_index].old_value; - } -} - -int UnityGetCommandLineOptions(int argc, const char* argv[]) -{ - int i; - UnityFixture.Verbose = 0; - UnityFixture.Silent = 0; - UnityFixture.GroupFilter = 0; - UnityFixture.NameFilter = 0; - UnityFixture.RepeatCount = 1; - - if (argc == 1) - return 0; - - for (i = 1; i < argc; ) - { - if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) - { - /* Usage */ - UnityPrint("Runs a series of unit tests."); - UNITY_PRINT_EOL(); - UNITY_PRINT_EOL(); - UnityPrint("When no flag is specified, all tests are run."); - UNITY_PRINT_EOL(); - UNITY_PRINT_EOL(); - UnityPrint("Optional flags:"); - UNITY_PRINT_EOL(); - UnityPrint(" -v Verbose output: show all tests executed even if they pass"); - UNITY_PRINT_EOL(); - UnityPrint(" -s Silent mode: minimal output showing only test failures"); - UNITY_PRINT_EOL(); - UnityPrint(" -g NAME Only run tests in groups that contain the string NAME"); - UNITY_PRINT_EOL(); - UnityPrint(" -n NAME Only run tests whose name contains the string NAME"); - UNITY_PRINT_EOL(); - UnityPrint(" -r NUMBER Repeatedly run all tests NUMBER times"); - UNITY_PRINT_EOL(); - UnityPrint(" -h, --help Display this help message"); - UNITY_PRINT_EOL(); - UNITY_PRINT_EOL(); -#ifdef UNITY_CUSTOM_HELP_MSG - /* User-defined help message, e.g. to point to project-specific documentation */ - UnityPrint(UNITY_CUSTOM_HELP_MSG); - UNITY_PRINT_EOL(); -#else - /* Default help suffix if a custom one is not defined */ - UnityPrint("More information about Unity: https://www.throwtheswitch.org/unity"); - UNITY_PRINT_EOL(); -#endif - return 1; /* Exit without running the tests */ - } - else if (strcmp(argv[i], "-v") == 0) - { - UnityFixture.Verbose = 1; - i++; - } - else if (strcmp(argv[i], "-s") == 0) - { - UnityFixture.Silent = 1; - i++; - } - else if (strcmp(argv[i], "-g") == 0) - { - i++; - if (i >= argc) - return 1; - UnityFixture.GroupFilter = argv[i]; - i++; - } - else if (strcmp(argv[i], "-n") == 0) - { - i++; - if (i >= argc) - return 1; - UnityFixture.NameFilter = argv[i]; - i++; - } - else if (strcmp(argv[i], "-r") == 0) - { - UnityFixture.RepeatCount = 2; - i++; - if (i < argc) - { - if (*(argv[i]) >= '0' && *(argv[i]) <= '9') - { - unsigned int digit = 0; - UnityFixture.RepeatCount = 0; - while (argv[i][digit] >= '0' && argv[i][digit] <= '9') - { - UnityFixture.RepeatCount *= 10; - UnityFixture.RepeatCount += (unsigned int)argv[i][digit++] - '0'; - } - i++; - } - } - } - else - { - /* ignore unknown parameter */ - i++; - } - } - return 0; -} - -void UnityConcludeFixtureTest(void) -{ - if (Unity.CurrentTestIgnored) - { - Unity.TestIgnores++; - UNITY_PRINT_EOL(); - } - else if (!Unity.CurrentTestFailed) - { - if (UnityFixture.Verbose) - { - UnityPrint(" "); - UnityPrint(UnityStrPass); - UNITY_EXEC_TIME_STOP(); - UNITY_PRINT_EXEC_TIME(); - UNITY_PRINT_EOL(); - } - } - else /* Unity.CurrentTestFailed */ - { - Unity.TestFailures++; - UNITY_PRINT_EOL(); - } - - Unity.CurrentTestFailed = 0; - Unity.CurrentTestIgnored = 0; -} diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.h b/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.h deleted file mode 100644 index 4cc403ef0..000000000 --- a/components/testframework/libs/cmock/vendor/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_internals.h" - -#ifndef UNITY_FIXTURE_NO_EXTRAS -#include "unity_memory.h" -#endif - -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 - -#endif /* UNITY_FIXTURE_H_ */ diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h b/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h deleted file mode 100644 index 1c51aa986..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +++ /dev/null @@ -1,50 +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; - int Silent; - unsigned int RepeatCount; - const char* NameFilter; - const char* GroupFilter; -}; -extern struct UNITY_FIXTURE_T UnityFixture; - -typedef void unityfunction(void); -void UnityTestRunner(unityfunction* setup, - unityfunction* testBody, - 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); -int UnityGetCommandLineOptions(int argc, const char* argv[]); -void UnityConcludeFixtureTest(void); - -void UnityPointer_Set(void** pointer, 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/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/Makefile b/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/Makefile deleted file mode 100644 index bbe32410e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -CC = gcc -ifeq ($(shell uname -s), Darwin) -CC = clang -endif -#DEBUG = -O0 -g -CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -DUNITY_FIXTURE_NO_EXTRAS -CFLAGS += $(DEBUG) -SRC = ../src/unity_fixture.c \ - ../../../src/unity.c \ - unity_fixture_Test.c \ - unity_fixture_TestRunner.c \ - main/AllTests.c - -INC_DIR = -I../src -I../../../src/ -BUILD_DIR = ../build -TARGET = ../build/fixture_tests.exe - -all: default noStdlibMalloc 32bits - -default: $(BUILD_DIR) - $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_SUPPORT_64 - @ echo "default build" - ./$(TARGET) - -32bits: $(BUILD_DIR) - $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -m32 - @ echo "32bits build" - ./$(TARGET) - -noStdlibMalloc: $(BUILD_DIR) - $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC - @ echo "build with noStdlibMalloc" - ./$(TARGET) - -C89: CFLAGS += -D UNITY_EXCLUDE_STDINT_H # C89 did not have type 'long long', -C89: $(BUILD_DIR) - $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -std=c89 && ./$(TARGET) - $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC -std=c89 - ./$(TARGET) - -$(BUILD_DIR): - mkdir -p $(BUILD_DIR) - -clean: - rm -f $(TARGET) $(BUILD_DIR)/*.gc* - -cov: $(BUILD_DIR) - cd $(BUILD_DIR) && \ - $(CC) $(DEFINES) $(foreach i, $(SRC), ../test/$(i)) $(INC_DIR) -o $(TARGET) -fprofile-arcs -ftest-coverage - rm -f $(BUILD_DIR)/*.gcda - ./$(TARGET) > /dev/null ; ./$(TARGET) -v > /dev/null - cd $(BUILD_DIR) && \ - gcov unity_fixture.c | head -3 - grep '###' $(BUILD_DIR)/unity_fixture.c.gcov -C2 || true # Show uncovered lines - -# These extended flags DO get included before any target build runs -CFLAGS += -Wbad-function-cast -CFLAGS += -Wcast-qual -CFLAGS += -Wconversion -CFLAGS += -Wformat=2 -CFLAGS += -Wmissing-prototypes -CFLAGS += -Wold-style-definition -CFLAGS += -Wpointer-arith -CFLAGS += -Wshadow -CFLAGS += -Wstrict-overflow=5 -CFLAGS += -Wstrict-prototypes -CFLAGS += -Wswitch-default -CFLAGS += -Wundef -CFLAGS += -Wno-error=undef # Warning only, this should not stop the build -CFLAGS += -Wunreachable-code -CFLAGS += -Wunused -CFLAGS += -fstrict-aliasing diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/main/AllTests.c b/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/main/AllTests.c deleted file mode 100644 index 30242cb30..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +++ /dev/null @@ -1,20 +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] - * ========================================== */ - -#include "unity_fixture.h" - -static void runAllTests(void) -{ - RUN_TEST_GROUP(UnityFixture); - RUN_TEST_GROUP(UnityCommandOptions); -} - -int main(int argc, const char* argv[]) -{ - return UnityMain(argc, argv, runAllTests); -} - diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c b/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c deleted file mode 100644 index 18bbb89e8..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c +++ /dev/null @@ -1,39 +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] - * ========================================== */ - -#include "unity_fixture.h" - -static int data = -1; - -TEST_GROUP(mygroup); - -TEST_SETUP(mygroup) -{ - data = 0; -} - -TEST_TEAR_DOWN(mygroup) -{ - data = -1; -} - -TEST(mygroup, test1) -{ - TEST_ASSERT_EQUAL_INT(0, data); -} - -TEST(mygroup, test2) -{ - TEST_ASSERT_EQUAL_INT(0, data); - data = 5; -} - -TEST(mygroup, test3) -{ - data = 7; - TEST_ASSERT_EQUAL_INT(7, data); -} diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c b/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c deleted file mode 100644 index 1422b4896..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +++ /dev/null @@ -1,245 +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] - * ========================================== */ - -#include "unity_fixture.h" -#include -#include - -TEST_GROUP(UnityFixture); - -TEST_SETUP(UnityFixture) -{ -} - -TEST_TEAR_DOWN(UnityFixture) -{ -} - -static int* pointer1 = 0; -static int* pointer2 = (int*)2; -static int* pointer3 = (int*)3; -static int int1; -static int int2; -static int int3; -static int int4; - -TEST(UnityFixture, PointerSetting) -{ - TEST_ASSERT_POINTERS_EQUAL(pointer1, 0); - UT_PTR_SET(pointer1, &int1); - UT_PTR_SET(pointer2, &int2); - UT_PTR_SET(pointer3, &int3); - TEST_ASSERT_POINTERS_EQUAL(pointer1, &int1); - TEST_ASSERT_POINTERS_EQUAL(pointer2, &int2); - TEST_ASSERT_POINTERS_EQUAL(pointer3, &int3); - UT_PTR_SET(pointer1, &int4); - UnityPointer_UndoAllSets(); - TEST_ASSERT_POINTERS_EQUAL(pointer1, 0); - TEST_ASSERT_POINTERS_EQUAL(pointer2, (int*)2); - TEST_ASSERT_POINTERS_EQUAL(pointer3, (int*)3); -} - -static char *p1; -static char *p2; - -TEST(UnityFixture, PointerSet) -{ - char c1; - char c2; - char newC1; - char newC2; - p1 = &c1; - p2 = &c2; - - UnityPointer_Init(); - UT_PTR_SET(p1, &newC1); - UT_PTR_SET(p2, &newC2); - TEST_ASSERT_POINTERS_EQUAL(&newC1, p1); - TEST_ASSERT_POINTERS_EQUAL(&newC2, p2); - UnityPointer_UndoAllSets(); - TEST_ASSERT_POINTERS_EQUAL(&c1, p1); - TEST_ASSERT_POINTERS_EQUAL(&c2, p2); -} - -TEST(UnityFixture, FreeNULLSafety) -{ - free(NULL); -} - -TEST(UnityFixture, ConcludeTestIncrementsFailCount) -{ - UNITY_UINT savedFails = Unity.TestFailures; - UNITY_UINT savedIgnores = Unity.TestIgnores; - Unity.CurrentTestFailed = 1; - UnityConcludeFixtureTest(); /* Resets TestFailed for this test to pass */ - Unity.CurrentTestIgnored = 1; - UnityConcludeFixtureTest(); /* Resets TestIgnored */ - TEST_ASSERT_EQUAL(savedFails + 1, Unity.TestFailures); - TEST_ASSERT_EQUAL(savedIgnores + 1, Unity.TestIgnores); - Unity.TestFailures = savedFails; - Unity.TestIgnores = savedIgnores; -} - -/*------------------------------------------------------------ */ - -TEST_GROUP(UnityCommandOptions); - -static int savedVerbose; -static unsigned int savedRepeat; -static const char* savedName; -static const char* savedGroup; - -TEST_SETUP(UnityCommandOptions) -{ - savedVerbose = UnityFixture.Verbose; - savedRepeat = UnityFixture.RepeatCount; - savedName = UnityFixture.NameFilter; - savedGroup = UnityFixture.GroupFilter; -} - -TEST_TEAR_DOWN(UnityCommandOptions) -{ - UnityFixture.Verbose = savedVerbose; - UnityFixture.RepeatCount= savedRepeat; - UnityFixture.NameFilter = savedName; - UnityFixture.GroupFilter = savedGroup; -} - - -static const char* noOptions[] = { - "testrunner.exe" -}; - -TEST(UnityCommandOptions, DefaultOptions) -{ - UnityGetCommandLineOptions(1, noOptions); - TEST_ASSERT_EQUAL(0, UnityFixture.Verbose); - TEST_ASSERT_POINTERS_EQUAL(0, UnityFixture.GroupFilter); - TEST_ASSERT_POINTERS_EQUAL(0, UnityFixture.NameFilter); - TEST_ASSERT_EQUAL(1, UnityFixture.RepeatCount); -} - -static const char* verbose[] = { - "testrunner.exe", - "-v" -}; - -TEST(UnityCommandOptions, OptionVerbose) -{ - TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(2, verbose)); - TEST_ASSERT_EQUAL(1, UnityFixture.Verbose); -} - -static const char* group[] = { - "testrunner.exe", - "-g", "groupname" -}; - -TEST(UnityCommandOptions, OptionSelectTestByGroup) -{ - TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(3, group)); - STRCMP_EQUAL("groupname", UnityFixture.GroupFilter); -} - -static const char* name[] = { - "testrunner.exe", - "-n", "testname" -}; - -TEST(UnityCommandOptions, OptionSelectTestByName) -{ - TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(3, name)); - STRCMP_EQUAL("testname", UnityFixture.NameFilter); -} - -static const char* repeat[] = { - "testrunner.exe", - "-r", "99" -}; - -TEST(UnityCommandOptions, OptionSelectRepeatTestsDefaultCount) -{ - TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(2, repeat)); - TEST_ASSERT_EQUAL(2, UnityFixture.RepeatCount); -} - -TEST(UnityCommandOptions, OptionSelectRepeatTestsSpecificCount) -{ - TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(3, repeat)); - TEST_ASSERT_EQUAL(99, UnityFixture.RepeatCount); -} - -static const char* multiple[] = { - "testrunner.exe", - "-v", - "-g", "groupname", - "-n", "testname", - "-r", "98" -}; - -TEST(UnityCommandOptions, MultipleOptions) -{ - TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(8, multiple)); - TEST_ASSERT_EQUAL(1, UnityFixture.Verbose); - STRCMP_EQUAL("groupname", UnityFixture.GroupFilter); - STRCMP_EQUAL("testname", UnityFixture.NameFilter); - TEST_ASSERT_EQUAL(98, UnityFixture.RepeatCount); -} - -static const char* dashRNotLast[] = { - "testrunner.exe", - "-v", - "-g", "gggg", - "-r", - "-n", "tttt", -}; - -TEST(UnityCommandOptions, MultipleOptionsDashRNotLastAndNoValueSpecified) -{ - TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(7, dashRNotLast)); - TEST_ASSERT_EQUAL(1, UnityFixture.Verbose); - STRCMP_EQUAL("gggg", UnityFixture.GroupFilter); - STRCMP_EQUAL("tttt", UnityFixture.NameFilter); - TEST_ASSERT_EQUAL(2, UnityFixture.RepeatCount); -} - -static const char* unknownCommand[] = { - "testrunner.exe", - "-v", - "-g", "groupname", - "-n", "testname", - "-r", "98", - "-z" -}; -TEST(UnityCommandOptions, UnknownCommandIsIgnored) -{ - TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(9, unknownCommand)); - TEST_ASSERT_EQUAL(1, UnityFixture.Verbose); - STRCMP_EQUAL("groupname", UnityFixture.GroupFilter); - STRCMP_EQUAL("testname", UnityFixture.NameFilter); - TEST_ASSERT_EQUAL(98, UnityFixture.RepeatCount); -} - -TEST(UnityCommandOptions, GroupOrNameFilterWithoutStringFails) -{ - TEST_ASSERT_EQUAL(1, UnityGetCommandLineOptions(3, unknownCommand)); - TEST_ASSERT_EQUAL(1, UnityGetCommandLineOptions(5, unknownCommand)); - TEST_ASSERT_EQUAL(1, UnityMain(3, unknownCommand, NULL)); -} - -TEST(UnityCommandOptions, GroupFilterReallyFilters) -{ - UNITY_UINT saved = Unity.NumberOfTests; - TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(4, unknownCommand)); - UnityIgnoreTest(NULL, "non-matching", NULL); - TEST_ASSERT_EQUAL(saved, Unity.NumberOfTests); -} - -IGNORE_TEST(UnityCommandOptions, TestShouldBeIgnored) -{ - TEST_FAIL_MESSAGE("This test should not run!"); -} diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c b/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c deleted file mode 100644 index 7b78c49c0..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +++ /dev/null @@ -1,32 +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] - * ========================================== */ - -#include "unity_fixture.h" - -TEST_GROUP_RUNNER(UnityFixture) -{ - RUN_TEST_CASE(UnityFixture, PointerSetting); - RUN_TEST_CASE(UnityFixture, PointerSet); - RUN_TEST_CASE(UnityFixture, FreeNULLSafety); - RUN_TEST_CASE(UnityFixture, ConcludeTestIncrementsFailCount); -} - -TEST_GROUP_RUNNER(UnityCommandOptions) -{ - RUN_TEST_CASE(UnityCommandOptions, DefaultOptions); - RUN_TEST_CASE(UnityCommandOptions, OptionVerbose); - RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByGroup); - RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByName); - RUN_TEST_CASE(UnityCommandOptions, OptionSelectRepeatTestsDefaultCount); - RUN_TEST_CASE(UnityCommandOptions, OptionSelectRepeatTestsSpecificCount); - RUN_TEST_CASE(UnityCommandOptions, MultipleOptions); - RUN_TEST_CASE(UnityCommandOptions, MultipleOptionsDashRNotLastAndNoValueSpecified); - RUN_TEST_CASE(UnityCommandOptions, UnknownCommandIsIgnored); - RUN_TEST_CASE(UnityCommandOptions, GroupOrNameFilterWithoutStringFails); - RUN_TEST_CASE(UnityCommandOptions, GroupFilterReallyFilters); - RUN_TEST_CASE(UnityCommandOptions, TestShouldBeIgnored); -} diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/readme.md b/components/testframework/libs/cmock/vendor/unity/extras/memory/readme.md deleted file mode 100644 index 37769825c..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/memory/readme.md +++ /dev/null @@ -1,49 +0,0 @@ -# Unity Memory - -This Framework is an optional add-on to Unity. By including unity.h and then -unity_memory.h, you have the added ability to track malloc and free calls. This -addon requires that the stdlib functions be overridden by its own defines. These -defines will still malloc / realloc / free etc, but will also track the calls -in order to ensure that you don't have any memory leaks in your programs. - -Note that this is only useful in situations where a unit is in charge of both -the allocation and deallocation of memory. When it is not symmetric, unit testing -can report a number of false failures. A more advanced runtime tool is required to -track complete system memory handling. - -# Module API - -## `UnityMalloc_StartTest` and `UnityMalloc_EndTest` - -These must be called at the beginning and end of each test. For simplicity, they can -be added to `setUp` and `tearDown` in order to do their job. When using the test -runner generator scripts, these will be automatically added to the runner whenever -unity_memory.h is included. - -## `UnityMalloc_MakeMallocFailAfterCount` - -This can be called from the tests themselves. Passing this function a number will -force the reference counter to start keeping track of malloc calls. During that test, -if the number of malloc calls exceeds the number given, malloc will immediately -start returning `NULL`. This allows you to test error conditions. Think of it as a -simplified mock. - -# Configuration - -## `UNITY_MALLOC` and `UNITY_FREE` - -By default, this module tries to use the real stdlib `malloc` and `free` internally. -If you would prefer it to use something else, like FreeRTOS's `pvPortMalloc` and -`pvPortFree`, then you can use these defines to make it so. - -## `UNITY_EXCLUDE_STDLIB_MALLOC` - -If you would like this library to ignore stdlib or other heap engines completely, and -manage the memory on its own, then define this. All memory will be handled internally -(and at likely lower overhead). Note that this is not a very featureful memory manager, -but is sufficient for most testing purposes. - -## `UNITY_INTERNAL_HEAP_SIZE_BYTES` - -When using the built-in memory manager (see `UNITY_EXCLUDE_STDLIB_MALLOC`) this define -allows you to set the heap size this library will use to manage the memory. diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.c b/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.c deleted file mode 100644 index e4dc6654f..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.c +++ /dev/null @@ -1,202 +0,0 @@ -/* ========================================== - * 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] - * ========================================== */ - -#include "unity.h" -#include "unity_memory.h" -#include - -#define MALLOC_DONT_FAIL -1 -static int malloc_count; -static int malloc_fail_countdown = MALLOC_DONT_FAIL; - -void UnityMalloc_StartTest(void) -{ - malloc_count = 0; - malloc_fail_countdown = MALLOC_DONT_FAIL; -} - -void UnityMalloc_EndTest(void) -{ - malloc_fail_countdown = MALLOC_DONT_FAIL; - if (malloc_count != 0) - { - UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "This test leaks!"); - } -} - -void UnityMalloc_MakeMallocFailAfterCount(int countdown) -{ - malloc_fail_countdown = countdown; -} - -/* These definitions are always included from unity_fixture_malloc_overrides.h */ -/* We undef to use them or avoid conflict with per the C standard */ -#undef malloc -#undef free -#undef calloc -#undef realloc - -#ifdef UNITY_EXCLUDE_STDLIB_MALLOC -static unsigned char unity_heap[UNITY_INTERNAL_HEAP_SIZE_BYTES]; -static size_t heap_index; -#else -#include -#endif - -typedef struct GuardBytes -{ - size_t size; - size_t guard_space; -} Guard; - -#define UNITY_MALLOC_ALIGNMENT (UNITY_POINTER_WIDTH / 8) -static const char end[] = "END"; - -static size_t unity_size_round_up(size_t size) -{ - size_t rounded_size; - - rounded_size = ((size + UNITY_MALLOC_ALIGNMENT - 1) / UNITY_MALLOC_ALIGNMENT) * UNITY_MALLOC_ALIGNMENT; - - return rounded_size; -} - -void* unity_malloc(size_t size) -{ - char* mem; - Guard* guard; - size_t total_size; - - total_size = sizeof(Guard) + unity_size_round_up(size + sizeof(end)); - - if (malloc_fail_countdown != MALLOC_DONT_FAIL) - { - if (malloc_fail_countdown == 0) - return NULL; - malloc_fail_countdown--; - } - - if (size == 0) return NULL; -#ifdef UNITY_EXCLUDE_STDLIB_MALLOC - if (heap_index + total_size > UNITY_INTERNAL_HEAP_SIZE_BYTES) - { - guard = NULL; - } - else - { - /* We know we can get away with this cast because we aligned memory already */ - guard = (Guard*)(void*)(&unity_heap[heap_index]); - heap_index += total_size; - } -#else - guard = (Guard*)UNITY_MALLOC(total_size); -#endif - if (guard == NULL) return NULL; - malloc_count++; - guard->size = size; - guard->guard_space = 0; - mem = (char*)&(guard[1]); - memcpy(&mem[size], end, sizeof(end)); - - return (void*)mem; -} - -static int isOverrun(void* mem) -{ - Guard* guard = (Guard*)mem; - char* memAsChar = (char*)mem; - guard--; - - return guard->guard_space != 0 || strcmp(&memAsChar[guard->size], end) != 0; -} - -static void release_memory(void* mem) -{ - Guard* guard = (Guard*)mem; - guard--; - - malloc_count--; -#ifdef UNITY_EXCLUDE_STDLIB_MALLOC - { - size_t block_size; - - block_size = unity_size_round_up(guard->size + sizeof(end)); - - if (mem == unity_heap + heap_index - block_size) - { - heap_index -= (sizeof(Guard) + block_size); - } - } -#else - UNITY_FREE(guard); -#endif -} - -void unity_free(void* mem) -{ - int overrun; - - if (mem == NULL) - { - return; - } - - overrun = isOverrun(mem); - release_memory(mem); - if (overrun) - { - UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "Buffer overrun detected during free()"); - } -} - -void* unity_calloc(size_t num, size_t size) -{ - void* mem = unity_malloc(num * size); - if (mem == NULL) return NULL; - memset(mem, 0, num * size); - return mem; -} - -void* unity_realloc(void* oldMem, size_t size) -{ - Guard* guard = (Guard*)oldMem; - void* newMem; - - if (oldMem == NULL) return unity_malloc(size); - - guard--; - if (isOverrun(oldMem)) - { - release_memory(oldMem); - UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "Buffer overrun detected during realloc()"); - } - - if (size == 0) - { - release_memory(oldMem); - return NULL; - } - - if (guard->size >= size) return oldMem; - -#ifdef UNITY_EXCLUDE_STDLIB_MALLOC /* Optimization if memory is expandable */ - { - size_t old_total_size = unity_size_round_up(guard->size + sizeof(end)); - - if ((oldMem == unity_heap + heap_index - old_total_size) && - ((heap_index - old_total_size + unity_size_round_up(size + sizeof(end))) <= UNITY_INTERNAL_HEAP_SIZE_BYTES)) - { - release_memory(oldMem); /* Not thread-safe, like unity_heap generally */ - return unity_malloc(size); /* No memcpy since data is in place */ - } - } -#endif - newMem = unity_malloc(size); - if (newMem == NULL) return NULL; /* Do not release old memory */ - memcpy(newMem, oldMem, guard->size); - release_memory(oldMem); - return newMem; -} diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.h b/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.h deleted file mode 100644 index ccdb826fe..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ========================================== - * 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_MEMORY_OVERRIDES_H_ -#define UNITY_MEMORY_OVERRIDES_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#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 Unity to allocate and release memory - * on the heap and can be overridden with platform-specific implementations. - * For example, when using FreeRTOS UNITY_MALLOC becomes pvPortMalloc() - * and UNITY_FREE becomes vPortFree(). */ -#if !defined(UNITY_MALLOC) || !defined(UNITY_FREE) - #include - #define UNITY_MALLOC(size) malloc(size) - #define UNITY_FREE(ptr) free(ptr) -#else - extern void* UNITY_MALLOC(size_t size); - extern void UNITY_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); - -/* You must compile with malloc replacement, as defined in unity_fixture_malloc_overrides.h */ -void UnityMalloc_StartTest(void); -void UnityMalloc_EndTest(void); -void UnityMalloc_MakeMallocFailAfterCount(int countdown); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/Makefile b/components/testframework/libs/cmock/vendor/unity/extras/memory/test/Makefile deleted file mode 100644 index f3f86ce60..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -CC = gcc -ifeq ($(shell uname -s), Darwin) -CC = clang -endif -#DEBUG = -O0 -g -CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -CFLAGS += $(DEBUG) -DEFINES = -D UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar -ifeq ($(OS),Windows_NT) - DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar(int) -else - DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar\(int\) -endif -SRC = ../src/unity_memory.c \ - ../../../src/unity.c \ - unity_memory_Test.c \ - unity_memory_TestRunner.c \ - unity_output_Spy.c \ - -INC_DIR = -I../src -I../../../src/ -BUILD_DIR = ../build -TARGET = ../build/memory_tests.exe - -all: default noStdlibMalloc 32bits - -default: $(BUILD_DIR) - $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_SUPPORT_64 - @ echo "default build" - ./$(TARGET) - -32bits: $(BUILD_DIR) - $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -m32 - @ echo "32bits build" - ./$(TARGET) - -noStdlibMalloc: $(BUILD_DIR) - $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC - @ echo "build with noStdlibMalloc" - ./$(TARGET) - -C89: CFLAGS += -D UNITY_EXCLUDE_STDINT_H # C89 did not have type 'long long', -C89: $(BUILD_DIR) - $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -std=c89 && ./$(TARGET) - $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC -std=c89 - ./$(TARGET) - -$(BUILD_DIR): - mkdir -p $(BUILD_DIR) - -clean: - rm -f $(TARGET) $(BUILD_DIR)/*.gc* - -cov: $(BUILD_DIR) - cd $(BUILD_DIR) && \ - $(CC) $(DEFINES) $(foreach i, $(SRC), ../test/$(i)) $(INC_DIR) -o $(TARGET) -fprofile-arcs -ftest-coverage - rm -f $(BUILD_DIR)/*.gcda - ./$(TARGET) > /dev/null ; ./$(TARGET) -v > /dev/null - cd $(BUILD_DIR) && \ - gcov unity_memory.c | head -3 - grep '###' $(BUILD_DIR)/unity_memory.c.gcov -C2 || true # Show uncovered lines - -# These extended flags DO get included before any target build runs -CFLAGS += -Wbad-function-cast -CFLAGS += -Wcast-qual -CFLAGS += -Wconversion -CFLAGS += -Wformat=2 -CFLAGS += -Wmissing-prototypes -CFLAGS += -Wold-style-definition -CFLAGS += -Wpointer-arith -CFLAGS += -Wshadow -CFLAGS += -Wstrict-overflow=5 -CFLAGS += -Wstrict-prototypes -CFLAGS += -Wswitch-default -CFLAGS += -Wundef -CFLAGS += -Wno-error=undef # Warning only, this should not stop the build -CFLAGS += -Wunreachable-code -CFLAGS += -Wunused -CFLAGS += -fstrict-aliasing diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_Test.c b/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_Test.c deleted file mode 100644 index 6f832e276..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_Test.c +++ /dev/null @@ -1,325 +0,0 @@ -/* ========================================== - * 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] - * ========================================== */ - -#include "unity.h" -#include "unity_memory.h" -#include "unity_output_Spy.h" -#include -#include - -/* This test module includes the following tests: */ - -void test_ForceMallocFail(void); -void test_ReallocSmallerIsUnchanged(void); -void test_ReallocSameIsUnchanged(void); -void test_ReallocLargerNeeded(void); -void test_ReallocNullPointerIsLikeMalloc(void); -void test_ReallocSizeZeroFreesMemAndReturnsNullPointer(void); -void test_CallocFillsWithZero(void); -void test_FreeNULLSafety(void); -void test_DetectsLeak(void); -void test_BufferOverrunFoundDuringFree(void); -void test_BufferOverrunFoundDuringRealloc(void); -void test_BufferGuardWriteFoundDuringFree(void); -void test_BufferGuardWriteFoundDuringRealloc(void); -void test_MallocPastBufferFails(void); -void test_CallocPastBufferFails(void); -void test_MallocThenReallocGrowsMemoryInPlace(void); -void test_ReallocFailDoesNotFreeMem(void); - -/* It makes use of the following features */ -void setUp(void); -void tearDown(void); - -/* Let's Go! */ -void setUp(void) -{ -#ifdef UNITY_EXCLUDE_STDLIB_MALLOC - UnityOutputCharSpy_Create(200); -#else - UnityOutputCharSpy_Create(1000); -#endif - UnityMalloc_StartTest(); -} - -void tearDown(void) -{ - UnityMalloc_EndTest(); - UnityOutputCharSpy_Destroy(); -} - -void test_ForceMallocFail(void) -{ - void* m; - void* mfails; - UnityMalloc_MakeMallocFailAfterCount(1); - m = malloc(10); - TEST_ASSERT_NOT_NULL(m); - mfails = malloc(10); - TEST_ASSERT_EQUAL_PTR(0, mfails); - free(m); -} - -void test_ReallocSmallerIsUnchanged(void) -{ - void* m1 = malloc(10); - void* m2 = realloc(m1, 5); - TEST_ASSERT_NOT_NULL(m1); - TEST_ASSERT_EQUAL_PTR(m1, m2); - free(m2); -} - -void test_ReallocSameIsUnchanged(void) -{ - void* m1 = malloc(10); - void* m2 = realloc(m1, 10); - TEST_ASSERT_NOT_NULL(m1); - TEST_ASSERT_EQUAL_PTR(m1, m2); - free(m2); -} - -void test_ReallocLargerNeeded(void) -{ - void* m2; - void* m1 = malloc(10); - TEST_ASSERT_NOT_NULL(m1); - strcpy((char*)m1, "123456789"); - m2 = realloc(m1, 15); - TEST_ASSERT_EQUAL_STRING("123456789", m2); - free(m2); -} - -void test_ReallocNullPointerIsLikeMalloc(void) -{ - void* m = realloc(0, 15); - TEST_ASSERT_NOT_NULL(m); - free(m); -} - -void test_ReallocSizeZeroFreesMemAndReturnsNullPointer(void) -{ - void* m1 = malloc(10); - void* m2 = realloc(m1, 0); - TEST_ASSERT_EQUAL_PTR(0, m2); -} - -void test_CallocFillsWithZero(void) -{ - void* m = calloc(3, sizeof(char)); - char* s = (char*)m; - TEST_ASSERT_NOT_NULL(m); - TEST_ASSERT_EQUAL_HEX8(0, s[0]); - TEST_ASSERT_EQUAL_HEX8(0, s[1]); - TEST_ASSERT_EQUAL_HEX8(0, s[2]); - free(m); -} - -void test_FreeNULLSafety(void) -{ - free(NULL); -} - -/*------------------------------------------------------------ */ - -#define EXPECT_ABORT_BEGIN \ - { \ - jmp_buf TestAbortFrame; \ - memcpy(TestAbortFrame, Unity.AbortFrame, sizeof(jmp_buf)); \ - if (TEST_PROTECT()) \ - { - -#define EXPECT_ABORT_END \ - } \ - memcpy(Unity.AbortFrame, TestAbortFrame, sizeof(jmp_buf)); \ - } - -/* This tricky set of defines lets us see if we are using the Spy, returns 1 if true */ -#ifdef __STDC_VERSION__ - -#ifdef UNITY_SUPPORT_VARIADIC_MACROS -#define USING_SPY_AS(a) EXPAND_AND_USE_2ND(ASSIGN_VALUE(a), 0) -#define ASSIGN_VALUE(a) VAL_##a -#define VAL_UnityOutputCharSpy_OutputChar 0, 1 -#define EXPAND_AND_USE_2ND(a, b) SECOND_PARAM(a, b, throwaway) -#define SECOND_PARAM(a, b, ...) b -#if USING_SPY_AS(UNITY_OUTPUT_CHAR) - #define USING_OUTPUT_SPY /* UNITY_OUTPUT_CHAR = UnityOutputCharSpy_OutputChar */ -#endif -#endif /* UNITY_SUPPORT_VARIADIC_MACROS */ - -#else /* __STDC_VERSION__ else */ - -#define UnityOutputCharSpy_OutputChar 42 -#if UNITY_OUTPUT_CHAR == UnityOutputCharSpy_OutputChar /* Works if no -Wundef -Werror */ - #define USING_OUTPUT_SPY -#endif -#undef UnityOutputCharSpy_OutputChar - -#endif /* __STDC_VERSION__ */ - -void test_DetectsLeak(void) -{ -#ifdef USING_OUTPUT_SPY - void* m = malloc(10); - TEST_ASSERT_NOT_NULL(m); - UnityOutputCharSpy_Enable(1); - EXPECT_ABORT_BEGIN - UnityMalloc_EndTest(); - EXPECT_ABORT_END - UnityOutputCharSpy_Enable(0); - Unity.CurrentTestFailed = 0; - TEST_ASSERT_NOT_NULL(strstr(UnityOutputCharSpy_Get(), "This test leaks!")); - free(m); -#else - TEST_IGNORE_MESSAGE("Enable USING_OUTPUT_SPY To Run This Test"); -#endif -} - -void test_BufferOverrunFoundDuringFree(void) -{ -#ifdef USING_OUTPUT_SPY - void* m = malloc(10); - char* s = (char*)m; - TEST_ASSERT_NOT_NULL(m); - s[10] = (char)0xFF; - UnityOutputCharSpy_Enable(1); - EXPECT_ABORT_BEGIN - free(m); - EXPECT_ABORT_END - UnityOutputCharSpy_Enable(0); - Unity.CurrentTestFailed = 0; - TEST_ASSERT_NOT_NULL(strstr(UnityOutputCharSpy_Get(), "Buffer overrun detected during free()")); -#else - TEST_IGNORE_MESSAGE("Enable USING_OUTPUT_SPY To Run This Test"); -#endif -} - -void test_BufferOverrunFoundDuringRealloc(void) -{ -#ifdef USING_OUTPUT_SPY - void* m = malloc(10); - char* s = (char*)m; - TEST_ASSERT_NOT_NULL(m); - s[10] = (char)0xFF; - UnityOutputCharSpy_Enable(1); - EXPECT_ABORT_BEGIN - m = realloc(m, 100); - EXPECT_ABORT_END - UnityOutputCharSpy_Enable(0); - Unity.CurrentTestFailed = 0; - TEST_ASSERT_NOT_NULL(strstr(UnityOutputCharSpy_Get(), "Buffer overrun detected during realloc()")); -#else - TEST_IGNORE_MESSAGE("Enable USING_OUTPUT_SPY To Run This Test"); -#endif -} - -void test_BufferGuardWriteFoundDuringFree(void) -{ -#ifdef USING_OUTPUT_SPY - void* m = malloc(10); - char* s = (char*)m; - TEST_ASSERT_NOT_NULL(m); - s[-1] = (char)0x00; /* Will not detect 0 */ - s[-2] = (char)0x01; - UnityOutputCharSpy_Enable(1); - EXPECT_ABORT_BEGIN - free(m); - EXPECT_ABORT_END - UnityOutputCharSpy_Enable(0); - Unity.CurrentTestFailed = 0; - TEST_ASSERT_NOT_NULL(strstr(UnityOutputCharSpy_Get(), "Buffer overrun detected during free()")); -#else - TEST_IGNORE_MESSAGE("Enable USING_OUTPUT_SPY To Run This Test"); -#endif -} - -void test_BufferGuardWriteFoundDuringRealloc(void) -{ -#ifdef USING_OUTPUT_SPY - void* m = malloc(10); - char* s = (char*)m; - TEST_ASSERT_NOT_NULL(m); - s[-1] = (char)0x0A; - UnityOutputCharSpy_Enable(1); - EXPECT_ABORT_BEGIN - m = realloc(m, 100); - EXPECT_ABORT_END - UnityOutputCharSpy_Enable(0); - Unity.CurrentTestFailed = 0; - TEST_ASSERT_NOT_NULL(strstr(UnityOutputCharSpy_Get(), "Buffer overrun detected during realloc()")); -#else - TEST_IGNORE_MESSAGE("Enable USING_OUTPUT_SPY To Run This Test"); -#endif -} - -/*------------------------------------------------------------ */ - -#define TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(first_mem_ptr, ptr) \ - ptr = malloc(10); free(ptr); \ - TEST_ASSERT_EQUAL_PTR_MESSAGE(first_mem_ptr, ptr, "Memory was stranded, free in LIFO order"); - -void test_MallocPastBufferFails(void) -{ -#ifdef UNITY_EXCLUDE_STDLIB_MALLOC - void* m = malloc(UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 1); - void* n = malloc(UNITY_INTERNAL_HEAP_SIZE_BYTES/2); - free(m); - TEST_ASSERT_NOT_NULL(m); - TEST_ASSERT_NULL(n); - TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(m, n); -#else - TEST_IGNORE_MESSAGE("Enable UNITY_EXCLUDE_STDLIB_MALLOC to Run This Test"); -#endif -} - -void test_CallocPastBufferFails(void) -{ -#ifdef UNITY_EXCLUDE_STDLIB_MALLOC - void* m = calloc(1, UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 1); - void* n = calloc(1, UNITY_INTERNAL_HEAP_SIZE_BYTES/2); - free(m); - TEST_ASSERT_NOT_NULL(m); - TEST_ASSERT_NULL(n); - TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(m, n); -#else - TEST_IGNORE_MESSAGE("Enable UNITY_EXCLUDE_STDLIB_MALLOC to Run This Test"); -#endif -} - -void test_MallocThenReallocGrowsMemoryInPlace(void) -{ -#ifdef UNITY_EXCLUDE_STDLIB_MALLOC - void* m = malloc(UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 1); - void* n = realloc(m, UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 9); - free(n); - TEST_ASSERT_NOT_NULL(m); - TEST_ASSERT_EQUAL(m, n); - TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(m, n); -#else - TEST_IGNORE_MESSAGE("Enable UNITY_EXCLUDE_STDLIB_MALLOC to Run This Test"); -#endif -} - -void test_ReallocFailDoesNotFreeMem(void) -{ -#ifdef UNITY_EXCLUDE_STDLIB_MALLOC - void* m = malloc(UNITY_INTERNAL_HEAP_SIZE_BYTES/2); - void* n1 = malloc(10); - void* out_of_mem = realloc(n1, UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 1); - void* n2 = malloc(10); - - free(n2); - if (out_of_mem == NULL) free(n1); - free(m); - - TEST_ASSERT_NOT_NULL(m); /* Got a real memory location */ - TEST_ASSERT_NULL(out_of_mem); /* The realloc should have failed */ - TEST_ASSERT_NOT_EQUAL(n2, n1); /* If n1 != n2 then realloc did not free n1 */ - TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(m, n2); -#else - TEST_IGNORE_MESSAGE("Enable UNITY_EXCLUDE_STDLIB_MALLOC to Run This Test"); -#endif -} diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_TestRunner.c b/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_TestRunner.c deleted file mode 100644 index 4c91a5995..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_TestRunner.c +++ /dev/null @@ -1,49 +0,0 @@ -/* ========================================== - * 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] - * ========================================== */ - -#include "unity.h" -#include "unity_memory.h" - -extern void test_ForceMallocFail(void); -extern void test_ReallocSmallerIsUnchanged(void); -extern void test_ReallocSameIsUnchanged(void); -extern void test_ReallocLargerNeeded(void); -extern void test_ReallocNullPointerIsLikeMalloc(void); -extern void test_ReallocSizeZeroFreesMemAndReturnsNullPointer(void); -extern void test_CallocFillsWithZero(void); -extern void test_FreeNULLSafety(void); -extern void test_DetectsLeak(void); -extern void test_BufferOverrunFoundDuringFree(void); -extern void test_BufferOverrunFoundDuringRealloc(void); -extern void test_BufferGuardWriteFoundDuringFree(void); -extern void test_BufferGuardWriteFoundDuringRealloc(void); -extern void test_MallocPastBufferFails(void); -extern void test_CallocPastBufferFails(void); -extern void test_MallocThenReallocGrowsMemoryInPlace(void); -extern void test_ReallocFailDoesNotFreeMem(void); - -int main(void) -{ - UnityBegin("unity_memory_Test.c"); - RUN_TEST(test_ForceMallocFail); - RUN_TEST(test_ReallocSmallerIsUnchanged); - RUN_TEST(test_ReallocSameIsUnchanged); - RUN_TEST(test_ReallocLargerNeeded); - RUN_TEST(test_ReallocNullPointerIsLikeMalloc); - RUN_TEST(test_ReallocSizeZeroFreesMemAndReturnsNullPointer); - RUN_TEST(test_CallocFillsWithZero); - RUN_TEST(test_FreeNULLSafety); - RUN_TEST(test_DetectsLeak); - RUN_TEST(test_BufferOverrunFoundDuringFree); - RUN_TEST(test_BufferOverrunFoundDuringRealloc); - RUN_TEST(test_BufferGuardWriteFoundDuringFree); - RUN_TEST(test_BufferGuardWriteFoundDuringRealloc); - RUN_TEST(test_MallocPastBufferFails); - RUN_TEST(test_CallocPastBufferFails); - RUN_TEST(test_MallocThenReallocGrowsMemoryInPlace); - RUN_TEST(test_ReallocFailDoesNotFreeMem); - return UnityEnd(); -} diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.c b/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.c deleted file mode 100644 index 772fe0bdf..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.c +++ /dev/null @@ -1,56 +0,0 @@ -/* ========================================== - * 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] - * ========================================== */ - -#include "unity.h" -#include "unity_output_Spy.h" - -#include -#include -#include - -static int size; -static int count; -static char* buffer; -static int spy_enable; - -void UnityOutputCharSpy_Create(int s) -{ - size = (s > 0) ? s : 0; - count = 0; - spy_enable = 0; - buffer = malloc((size_t)size); - TEST_ASSERT_NOT_NULL_MESSAGE(buffer, "Internal malloc failed in Spy Create():" __FILE__); - memset(buffer, 0, (size_t)size); -} - -void UnityOutputCharSpy_Destroy(void) -{ - size = 0; - free(buffer); -} - -void UnityOutputCharSpy_OutputChar(int c) -{ - if (spy_enable) - { - if (count < (size-1)) - buffer[count++] = (char)c; - } - else - { - putchar(c); - } -} - -const char * UnityOutputCharSpy_Get(void) -{ - return buffer; -} - -void UnityOutputCharSpy_Enable(int enable) -{ - spy_enable = enable; -} diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.h b/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.h deleted file mode 100644 index e2e401c48..000000000 --- a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.h +++ /dev/null @@ -1,16 +0,0 @@ -/* ========================================== - * 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_OUTPUT_SPY_H -#define 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/components/testframework/libs/cmock/vendor/unity/meson.build b/components/testframework/libs/cmock/vendor/unity/meson.build deleted file mode 100644 index 968e5b13f..000000000 --- a/components/testframework/libs/cmock/vendor/unity/meson.build +++ /dev/null @@ -1,48 +0,0 @@ -# -# build script written by : Michael Brockus. -# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. -# -# license: MIT -# -project('unity', 'c', - license: 'MIT', - meson_version: '>=0.53.0', - default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11'] -) -lang = 'c' -cc = meson.get_compiler(lang) - -# -# Meson: Add compiler flags -if cc.get_id() == 'clang' - add_project_arguments(cc.get_supported_arguments( - [ - '-Wexit-time-destructors', - '-Wglobal-constructors', - '-Wmissing-prototypes', - '-Wmissing-noreturn', - '-Wno-missing-braces', - '-Wold-style-cast', '-Wpointer-arith', '-Wweak-vtables', - '-Wcast-align', '-Wconversion', '-Wcast-qual', '-Wshadow' - ] - ), language: lang) -endif - -if cc.get_argument_syntax() == 'gcc' - add_project_arguments(cc.get_supported_arguments( - [ - '-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar', - '-Wpointer-arith' , '-Wwrite-strings' , - '-Wno-parentheses' , '-Wno-type-limits' , - '-Wformat-security' , '-Wunreachable-code' , - '-Waggregate-return' , '-Wformat-nonliteral' , - '-Wmissing-declarations', '-Wmissing-include-dirs' , - '-Wno-unused-parameter' - ] - ), language: lang) -endif - -# -# Sub directory to project source code -subdir('src') -unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir) diff --git a/components/testframework/libs/cmock/vendor/unity/src/meson.build b/components/testframework/libs/cmock/vendor/unity/src/meson.build deleted file mode 100644 index 7ede15af6..000000000 --- a/components/testframework/libs/cmock/vendor/unity/src/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -# -# build script written by : Michael Brockus. -# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. -# -# license: MIT -# -unity_dir = include_directories('.') - -unity_lib = static_library(meson.project_name(), - sources: ['unity.c'], - include_directories: unity_dir) diff --git a/components/testframework/libs/cmock/vendor/unity/src/unity.c b/components/testframework/libs/cmock/vendor/unity/src/unity.c deleted file mode 100644 index ffa5cf0d4..000000000 --- a/components/testframework/libs/cmock/vendor/unity/src/unity.c +++ /dev/null @@ -1,2109 +0,0 @@ -/* ========================================================================= - Unity Project - A Test Framework for C - Copyright (c) 2007-19 Mike Karlesky, Mark VanderVoord, Greg Williams - [Released under MIT License. Please refer to license.txt for details] -============================================================================ */ - -#include "unity.h" -#include - -#ifdef AVR -#include -#else -#define PROGMEM -#endif - -/* If omitted from header, declare overrideable prototypes here so they're ready for use */ -#ifdef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION -void UNITY_OUTPUT_CHAR(int); -#endif - -/* Helpful macros for us to use here in Assert functions */ -#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; UNITY_OUTPUT_FLUSH(); TEST_ABORT(); } -#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; UNITY_OUTPUT_FLUSH(); TEST_ABORT(); } -#define RETURN_IF_FAIL_OR_IGNORE if (Unity.CurrentTestFailed || Unity.CurrentTestIgnored) TEST_ABORT() - -struct UNITY_STORAGE_T Unity; - -#ifdef UNITY_OUTPUT_COLOR -const char PROGMEM UnityStrOk[] = "\033[42mOK\033[00m"; -const char PROGMEM UnityStrPass[] = "\033[42mPASS\033[00m"; -const char PROGMEM UnityStrFail[] = "\033[41mFAIL\033[00m"; -const char PROGMEM UnityStrIgnore[] = "\033[43mIGNORE\033[00m"; -#else -const char PROGMEM UnityStrOk[] = "OK"; -const char PROGMEM UnityStrPass[] = "PASS"; -const char PROGMEM UnityStrFail[] = "FAIL"; -const char PROGMEM UnityStrIgnore[] = "IGNORE"; -#endif -static const char PROGMEM UnityStrNull[] = "NULL"; -static const char PROGMEM UnityStrSpacer[] = ". "; -static const char PROGMEM UnityStrExpected[] = " Expected "; -static const char PROGMEM UnityStrWas[] = " Was "; -static const char PROGMEM UnityStrGt[] = " to be greater than "; -static const char PROGMEM UnityStrLt[] = " to be less than "; -static const char PROGMEM UnityStrOrEqual[] = "or equal to "; -static const char PROGMEM UnityStrNotEqual[] = " to be not equal to "; -static const char PROGMEM UnityStrElement[] = " Element "; -static const char PROGMEM UnityStrByte[] = " Byte "; -static const char PROGMEM UnityStrMemory[] = " Memory Mismatch."; -static const char PROGMEM UnityStrDelta[] = " Values Not Within Delta "; -static const char PROGMEM UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless."; -static const char PROGMEM UnityStrNullPointerForExpected[] = " Expected pointer to be NULL"; -static const char PROGMEM UnityStrNullPointerForActual[] = " Actual pointer was NULL"; -#ifndef UNITY_EXCLUDE_FLOAT -static const char PROGMEM UnityStrNot[] = "Not "; -static const char PROGMEM UnityStrInf[] = "Infinity"; -static const char PROGMEM UnityStrNegInf[] = "Negative Infinity"; -static const char PROGMEM UnityStrNaN[] = "NaN"; -static const char PROGMEM UnityStrDet[] = "Determinate"; -static const char PROGMEM UnityStrInvalidFloatTrait[] = "Invalid Float Trait"; -#endif -const char PROGMEM UnityStrErrShorthand[] = "Unity Shorthand Support Disabled"; -const char PROGMEM UnityStrErrFloat[] = "Unity Floating Point Disabled"; -const char PROGMEM UnityStrErrDouble[] = "Unity Double Precision Disabled"; -const char PROGMEM UnityStrErr64[] = "Unity 64-bit Support Disabled"; -static const char PROGMEM UnityStrBreaker[] = "-----------------------"; -static const char PROGMEM UnityStrResultsTests[] = " Tests "; -static const char PROGMEM UnityStrResultsFailures[] = " Failures "; -static const char PROGMEM UnityStrResultsIgnored[] = " Ignored "; -static const char PROGMEM UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " "; -static const char PROGMEM UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " "; - -/*----------------------------------------------- - * Pretty Printers & Test Result Output Handlers - *-----------------------------------------------*/ - -/*-----------------------------------------------*/ -/* Local helper function to print characters. */ -static void UnityPrintChar(const char* pch) -{ - /* printable characters plus CR & LF are printed */ - if ((*pch <= 126) && (*pch >= 32)) - { - UNITY_OUTPUT_CHAR(*pch); - } - /* write escaped carriage returns */ - else if (*pch == 13) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('r'); - } - /* write escaped line feeds */ - else if (*pch == 10) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('n'); - } - /* unprintable characters are shown as codes */ - else - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('x'); - UnityPrintNumberHex((UNITY_UINT)*pch, 2); - } -} - -/*-----------------------------------------------*/ -/* Local helper function to print ANSI escape strings e.g. "\033[42m". */ -#ifdef UNITY_OUTPUT_COLOR -static UNITY_UINT UnityPrintAnsiEscapeString(const char* string) -{ - const char* pch = string; - UNITY_UINT count = 0; - - while (*pch && (*pch != 'm')) - { - UNITY_OUTPUT_CHAR(*pch); - pch++; - count++; - } - UNITY_OUTPUT_CHAR('m'); - count++; - - return count; -} -#endif - -/*-----------------------------------------------*/ -void UnityPrint(const char* string) -{ - const char* pch = string; - - if (pch != NULL) - { - while (*pch) - { -#ifdef UNITY_OUTPUT_COLOR - /* print ANSI escape code */ - if ((*pch == 27) && (*(pch + 1) == '[')) - { - pch += UnityPrintAnsiEscapeString(pch); - continue; - } -#endif - UnityPrintChar(pch); - pch++; - } - } -} -/*-----------------------------------------------*/ -void UnityPrintLen(const char* string, const UNITY_UINT32 length) -{ - const char* pch = string; - - if (pch != NULL) - { - while (*pch && ((UNITY_UINT32)(pch - string) < length)) - { - /* printable characters plus CR & LF are printed */ - if ((*pch <= 126) && (*pch >= 32)) - { - UNITY_OUTPUT_CHAR(*pch); - } - /* write escaped carriage returns */ - else if (*pch == 13) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('r'); - } - /* write escaped line feeds */ - else if (*pch == 10) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('n'); - } - /* unprintable characters are shown as codes */ - else - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('x'); - UnityPrintNumberHex((UNITY_UINT)*pch, 2); - } - pch++; - } - } -} - -/*-----------------------------------------------*/ -void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style) -{ - if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) - { - if (style == UNITY_DISPLAY_STYLE_CHAR) - { - /* printable characters plus CR & LF are printed */ - UNITY_OUTPUT_CHAR('\''); - if ((number <= 126) && (number >= 32)) - { - UNITY_OUTPUT_CHAR((int)number); - } - /* write escaped carriage returns */ - else if (number == 13) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('r'); - } - /* write escaped line feeds */ - else if (number == 10) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('n'); - } - /* unprintable characters are shown as codes */ - else - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('x'); - UnityPrintNumberHex((UNITY_UINT)number, 2); - } - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrintNumber(number); - } - } - else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) - { - UnityPrintNumberUnsigned((UNITY_UINT)number); - } - else - { - UNITY_OUTPUT_CHAR('0'); - UNITY_OUTPUT_CHAR('x'); - UnityPrintNumberHex((UNITY_UINT)number, (char)((style & 0xF) * 2)); - } -} - -/*-----------------------------------------------*/ -void UnityPrintNumber(const UNITY_INT number_to_print) -{ - UNITY_UINT number = (UNITY_UINT)number_to_print; - - if (number_to_print < 0) - { - /* A negative number, including MIN negative */ - UNITY_OUTPUT_CHAR('-'); - number = (~number) + 1; - } - UnityPrintNumberUnsigned(number); -} - -/*----------------------------------------------- - * basically do an itoa using as little ram as possible */ -void UnityPrintNumberUnsigned(const UNITY_UINT number) -{ - UNITY_UINT divisor = 1; - - /* figure out initial divisor */ - while (number / divisor > 9) - { - divisor *= 10; - } - - /* now mod and print, then divide divisor */ - do - { - UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10))); - divisor /= 10; - } while (divisor > 0); -} - -/*-----------------------------------------------*/ -void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print) -{ - int nibble; - char nibbles = nibbles_to_print; - - if ((unsigned)nibbles > UNITY_MAX_NIBBLES) - { - nibbles = UNITY_MAX_NIBBLES; - } - - while (nibbles > 0) - { - nibbles--; - nibble = (int)(number >> (nibbles * 4)) & 0x0F; - if (nibble <= 9) - { - UNITY_OUTPUT_CHAR((char)('0' + nibble)); - } - else - { - UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble)); - } - } -} - -/*-----------------------------------------------*/ -void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number) -{ - UNITY_UINT current_bit = (UNITY_UINT)1 << (UNITY_INT_WIDTH - 1); - UNITY_INT32 i; - - for (i = 0; i < UNITY_INT_WIDTH; i++) - { - if (current_bit & mask) - { - if (current_bit & number) - { - UNITY_OUTPUT_CHAR('1'); - } - else - { - UNITY_OUTPUT_CHAR('0'); - } - } - else - { - UNITY_OUTPUT_CHAR('X'); - } - current_bit = current_bit >> 1; - } -} - -/*-----------------------------------------------*/ -#ifndef UNITY_EXCLUDE_FLOAT_PRINT -/* - * This function prints a floating-point value in a format similar to - * printf("%.7g") on a single-precision machine or printf("%.9g") on a - * double-precision machine. The 7th digit won't always be totally correct - * in single-precision operation (for that level of accuracy, a more - * complicated algorithm would be needed). - */ -void UnityPrintFloat(const UNITY_DOUBLE input_number) -{ -#ifdef UNITY_INCLUDE_DOUBLE - static const int sig_digits = 9; - static const UNITY_INT32 min_scaled = 100000000; - static const UNITY_INT32 max_scaled = 1000000000; -#else - static const int sig_digits = 7; - static const UNITY_INT32 min_scaled = 1000000; - static const UNITY_INT32 max_scaled = 10000000; -#endif - - UNITY_DOUBLE number = input_number; - - /* print minus sign (does not handle negative zero) */ - if (number < 0.0f) - { - UNITY_OUTPUT_CHAR('-'); - number = -number; - } - - /* handle zero, NaN, and +/- infinity */ - if (number == 0.0f) - { - UnityPrint("0"); - } - else if (isnan(number)) - { - UnityPrint("nan"); - } - else if (isinf(number)) - { - UnityPrint("inf"); - } - else - { - UNITY_INT32 n_int = 0, n; - int exponent = 0; - int decimals, digits; - char buf[16] = {0}; - - /* - * Scale up or down by powers of 10. To minimize rounding error, - * start with a factor/divisor of 10^10, which is the largest - * power of 10 that can be represented exactly. Finally, compute - * (exactly) the remaining power of 10 and perform one more - * multiplication or division. - */ - if (number < 1.0f) - { - UNITY_DOUBLE factor = 1.0f; - - while (number < (UNITY_DOUBLE)max_scaled / 1e10f) { number *= 1e10f; exponent -= 10; } - while (number * factor < (UNITY_DOUBLE)min_scaled) { factor *= 10.0f; exponent--; } - - number *= factor; - } - else if (number > (UNITY_DOUBLE)max_scaled) - { - UNITY_DOUBLE divisor = 1.0f; - - while (number > (UNITY_DOUBLE)min_scaled * 1e10f) { number /= 1e10f; exponent += 10; } - while (number / divisor > (UNITY_DOUBLE)max_scaled) { divisor *= 10.0f; exponent++; } - - number /= divisor; - } - else - { - /* - * In this range, we can split off the integer part before - * doing any multiplications. This reduces rounding error by - * freeing up significant bits in the fractional part. - */ - UNITY_DOUBLE factor = 1.0f; - n_int = (UNITY_INT32)number; - number -= (UNITY_DOUBLE)n_int; - - while (n_int < min_scaled) { n_int *= 10; factor *= 10.0f; exponent--; } - - number *= factor; - } - - /* round to nearest integer */ - n = ((UNITY_INT32)(number + number) + 1) / 2; - -#ifndef UNITY_ROUND_TIES_AWAY_FROM_ZERO - /* round to even if exactly between two integers */ - if ((n & 1) && (((UNITY_DOUBLE)n - number) == 0.5f)) - n--; -#endif - - n += n_int; - - if (n >= max_scaled) - { - n = min_scaled; - exponent++; - } - - /* determine where to place decimal point */ - decimals = ((exponent <= 0) && (exponent >= -(sig_digits + 3))) ? (-exponent) : (sig_digits - 1); - exponent += decimals; - - /* truncate trailing zeroes after decimal point */ - while ((decimals > 0) && ((n % 10) == 0)) - { - n /= 10; - decimals--; - } - - /* build up buffer in reverse order */ - digits = 0; - while ((n != 0) || (digits < (decimals + 1))) - { - buf[digits++] = (char)('0' + n % 10); - n /= 10; - } - while (digits > 0) - { - if (digits == decimals) { UNITY_OUTPUT_CHAR('.'); } - UNITY_OUTPUT_CHAR(buf[--digits]); - } - - /* print exponent if needed */ - if (exponent != 0) - { - UNITY_OUTPUT_CHAR('e'); - - if (exponent < 0) - { - UNITY_OUTPUT_CHAR('-'); - exponent = -exponent; - } - else - { - UNITY_OUTPUT_CHAR('+'); - } - - digits = 0; - while ((exponent != 0) || (digits < 2)) - { - buf[digits++] = (char)('0' + exponent % 10); - exponent /= 10; - } - while (digits > 0) - { - UNITY_OUTPUT_CHAR(buf[--digits]); - } - } - } -} -#endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */ - -/*-----------------------------------------------*/ -static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line) -{ -#ifdef UNITY_OUTPUT_FOR_ECLIPSE - UNITY_OUTPUT_CHAR('('); - UnityPrint(file); - UNITY_OUTPUT_CHAR(':'); - UnityPrintNumber((UNITY_INT)line); - UNITY_OUTPUT_CHAR(')'); - UNITY_OUTPUT_CHAR(' '); - UnityPrint(Unity.CurrentTestName); - UNITY_OUTPUT_CHAR(':'); -#else -#ifdef UNITY_OUTPUT_FOR_IAR_WORKBENCH - UnityPrint("'); - UnityPrint(Unity.CurrentTestName); - UnityPrint(" "); -#else -#ifdef UNITY_OUTPUT_FOR_QT_CREATOR - UnityPrint("file://"); - UnityPrint(file); - UNITY_OUTPUT_CHAR(':'); - UnityPrintNumber((UNITY_INT)line); - UNITY_OUTPUT_CHAR(' '); - UnityPrint(Unity.CurrentTestName); - UNITY_OUTPUT_CHAR(':'); -#else - UnityPrint(file); - UNITY_OUTPUT_CHAR(':'); - UnityPrintNumber((UNITY_INT)line); - UNITY_OUTPUT_CHAR(':'); - UnityPrint(Unity.CurrentTestName); - UNITY_OUTPUT_CHAR(':'); -#endif -#endif -#endif -} - -/*-----------------------------------------------*/ -static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line) -{ - UnityTestResultsBegin(Unity.TestFile, line); - UnityPrint(UnityStrFail); - UNITY_OUTPUT_CHAR(':'); -} - -/*-----------------------------------------------*/ -void UnityConcludeTest(void) -{ - if (Unity.CurrentTestIgnored) - { - Unity.TestIgnores++; - } - else if (!Unity.CurrentTestFailed) - { - UnityTestResultsBegin(Unity.TestFile, Unity.CurrentTestLineNumber); - UnityPrint(UnityStrPass); - } - else - { - Unity.TestFailures++; - } - - Unity.CurrentTestFailed = 0; - Unity.CurrentTestIgnored = 0; - UNITY_PRINT_EXEC_TIME(); - UNITY_PRINT_EOL(); - UNITY_FLUSH_CALL(); -} - -/*-----------------------------------------------*/ -static void UnityAddMsgIfSpecified(const char* msg) -{ - if (msg) - { - UnityPrint(UnityStrSpacer); - -#ifdef UNITY_PRINT_TEST_CONTEXT - UNITY_PRINT_TEST_CONTEXT(); -#endif -#ifndef UNITY_EXCLUDE_DETAILS - if (Unity.CurrentDetail1) - { - UnityPrint(UnityStrDetail1Name); - UnityPrint(Unity.CurrentDetail1); - if (Unity.CurrentDetail2) - { - UnityPrint(UnityStrDetail2Name); - UnityPrint(Unity.CurrentDetail2); - } - UnityPrint(UnityStrSpacer); - } -#endif - UnityPrint(msg); - } -} - -/*-----------------------------------------------*/ -static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual) -{ - UnityPrint(UnityStrExpected); - if (expected != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrint(expected); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } - UnityPrint(UnityStrWas); - if (actual != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrint(actual); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } -} - -/*-----------------------------------------------*/ -static void UnityPrintExpectedAndActualStringsLen(const char* expected, - const char* actual, - const UNITY_UINT32 length) -{ - UnityPrint(UnityStrExpected); - if (expected != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrintLen(expected, length); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } - UnityPrint(UnityStrWas); - if (actual != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrintLen(actual, length); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } -} - -/*----------------------------------------------- - * Assertion & Control Helpers - *-----------------------------------------------*/ - -/*-----------------------------------------------*/ -static int UnityIsOneArrayNull(UNITY_INTERNAL_PTR expected, - UNITY_INTERNAL_PTR actual, - const UNITY_LINE_TYPE lineNumber, - const char* msg) -{ - /* Both are NULL or same pointer */ - if (expected == actual) { return 0; } - - /* print and return true if just expected is NULL */ - if (expected == NULL) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrNullPointerForExpected); - UnityAddMsgIfSpecified(msg); - return 1; - } - - /* print and return true if just actual is NULL */ - if (actual == NULL) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrNullPointerForActual); - UnityAddMsgIfSpecified(msg); - return 1; - } - - return 0; /* return false if neither is NULL */ -} - -/*----------------------------------------------- - * Assertion Functions - *-----------------------------------------------*/ - -/*-----------------------------------------------*/ -void UnityAssertBits(const UNITY_INT mask, - const UNITY_INT expected, - const UNITY_INT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - RETURN_IF_FAIL_OR_IGNORE; - - if ((mask & expected) != (mask & actual)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)expected); - UnityPrint(UnityStrWas); - UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)actual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -/*-----------------------------------------------*/ -void UnityAssertEqualNumber(const UNITY_INT expected, - const UNITY_INT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style) -{ - RETURN_IF_FAIL_OR_IGNORE; - - if (expected != actual) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expected, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -/*-----------------------------------------------*/ -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) -{ - int failed = 0; - RETURN_IF_FAIL_OR_IGNORE; - - if ((threshold == actual) && (compare & UNITY_EQUAL_TO)) { return; } - if ((threshold == actual)) { failed = 1; } - - if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) - { - if ((actual > threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } - if ((actual < threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } - } - else /* UINT or HEX */ - { - if (((UNITY_UINT)actual > (UNITY_UINT)threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } - if (((UNITY_UINT)actual < (UNITY_UINT)threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } - } - - if (failed) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(actual, style); - if (compare & UNITY_GREATER_THAN) { UnityPrint(UnityStrGt); } - if (compare & UNITY_SMALLER_THAN) { UnityPrint(UnityStrLt); } - if (compare & UNITY_EQUAL_TO) { UnityPrint(UnityStrOrEqual); } - if (compare == UNITY_NOT_EQUAL) { UnityPrint(UnityStrNotEqual); } - UnityPrintNumberByStyle(threshold, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -#define UnityPrintPointlessAndBail() \ -{ \ - UnityTestResultsFailBegin(lineNumber); \ - UnityPrint(UnityStrPointless); \ - UnityAddMsgIfSpecified(msg); \ - UNITY_FAIL_AND_BAIL; } - -/*-----------------------------------------------*/ -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) -{ - UNITY_UINT32 elements = num_elements; - unsigned int length = style & 0xF; - unsigned int increment = 0; - - RETURN_IF_FAIL_OR_IGNORE; - - if (num_elements == 0) - { - UnityPrintPointlessAndBail(); - } - - if (expected == actual) - { - return; /* Both are NULL or same pointer */ - } - - if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) - { - UNITY_FAIL_AND_BAIL; - } - - while ((elements > 0) && (elements--)) - { - UNITY_INT expect_val; - UNITY_INT actual_val; - - switch (length) - { - case 1: - expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)expected; - actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)actual; - increment = sizeof(UNITY_INT8); - break; - - case 2: - expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)expected; - actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)actual; - increment = sizeof(UNITY_INT16); - break; - -#ifdef UNITY_SUPPORT_64 - case 8: - expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)expected; - actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)actual; - increment = sizeof(UNITY_INT64); - break; -#endif - - default: /* default is length 4 bytes */ - case 4: - expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)expected; - actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)actual; - increment = sizeof(UNITY_INT32); - length = 4; - break; - } - - if (expect_val != actual_val) - { - if ((style & UNITY_DISPLAY_RANGE_UINT) && (length < (UNITY_INT_WIDTH / 8))) - { /* For UINT, remove sign extension (padding 1's) from signed type casts above */ - UNITY_INT mask = 1; - mask = (mask << 8 * length) - 1; - expect_val &= mask; - actual_val &= mask; - } - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberUnsigned(num_elements - elements - 1); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expect_val, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual_val, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - /* Walk through array by incrementing the pointers */ - if (flags == UNITY_ARRAY_TO_ARRAY) - { - expected = (UNITY_INTERNAL_PTR)((const char*)expected + increment); - } - actual = (UNITY_INTERNAL_PTR)((const char*)actual + increment); - } -} - -/*-----------------------------------------------*/ -#ifndef UNITY_EXCLUDE_FLOAT -/* Wrap this define in a function with variable types as float or double */ -#define UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff) \ - if (isinf(expected) && isinf(actual) && (((expected) < 0) == ((actual) < 0))) return 1; \ - if (UNITY_NAN_CHECK) return 1; \ - (diff) = (actual) - (expected); \ - if ((diff) < 0) (diff) = -(diff); \ - if ((delta) < 0) (delta) = -(delta); \ - return !(isnan(diff) || isinf(diff) || ((diff) > (delta))) - /* This first part of this condition will catch any NaN or Infinite values */ -#ifndef UNITY_NAN_NOT_EQUAL_NAN - #define UNITY_NAN_CHECK isnan(expected) && isnan(actual) -#else - #define UNITY_NAN_CHECK 0 -#endif - -#ifndef UNITY_EXCLUDE_FLOAT_PRINT - #define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \ - { \ - UnityPrint(UnityStrExpected); \ - UnityPrintFloat(expected); \ - UnityPrint(UnityStrWas); \ - UnityPrintFloat(actual); } -#else - #define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \ - UnityPrint(UnityStrDelta) -#endif /* UNITY_EXCLUDE_FLOAT_PRINT */ - -/*-----------------------------------------------*/ -static int UnityFloatsWithin(UNITY_FLOAT delta, UNITY_FLOAT expected, UNITY_FLOAT actual) -{ - UNITY_FLOAT diff; - UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff); -} - -/*-----------------------------------------------*/ -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) -{ - UNITY_UINT32 elements = num_elements; - UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_expected = expected; - UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_actual = actual; - - RETURN_IF_FAIL_OR_IGNORE; - - if (elements == 0) - { - UnityPrintPointlessAndBail(); - } - - if (expected == actual) - { - return; /* Both are NULL or same pointer */ - } - - if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) - { - UNITY_FAIL_AND_BAIL; - } - - while (elements--) - { - if (!UnityFloatsWithin(*ptr_expected * UNITY_FLOAT_PRECISION, *ptr_expected, *ptr_actual)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberUnsigned(num_elements - elements - 1); - UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)*ptr_expected, (UNITY_DOUBLE)*ptr_actual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - if (flags == UNITY_ARRAY_TO_ARRAY) - { - ptr_expected++; - } - ptr_actual++; - } -} - -/*-----------------------------------------------*/ -void UnityAssertFloatsWithin(const UNITY_FLOAT delta, - const UNITY_FLOAT expected, - const UNITY_FLOAT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - RETURN_IF_FAIL_OR_IGNORE; - - - if (!UnityFloatsWithin(delta, expected, actual)) - { - UnityTestResultsFailBegin(lineNumber); - UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)expected, (UNITY_DOUBLE)actual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -/*-----------------------------------------------*/ -void UnityAssertFloatSpecial(const UNITY_FLOAT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style) -{ - const char* trait_names[] = {UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet}; - UNITY_INT should_be_trait = ((UNITY_INT)style & 1); - UNITY_INT is_trait = !should_be_trait; - UNITY_INT trait_index = (UNITY_INT)(style >> 1); - - RETURN_IF_FAIL_OR_IGNORE; - - switch (style) - { - case UNITY_FLOAT_IS_INF: - case UNITY_FLOAT_IS_NOT_INF: - is_trait = isinf(actual) && (actual > 0); - break; - case UNITY_FLOAT_IS_NEG_INF: - case UNITY_FLOAT_IS_NOT_NEG_INF: - is_trait = isinf(actual) && (actual < 0); - break; - - case UNITY_FLOAT_IS_NAN: - case UNITY_FLOAT_IS_NOT_NAN: - is_trait = isnan(actual) ? 1 : 0; - break; - - case UNITY_FLOAT_IS_DET: /* A determinate number is non infinite and not NaN. */ - case UNITY_FLOAT_IS_NOT_DET: - is_trait = !isinf(actual) && !isnan(actual); - break; - - default: - trait_index = 0; - trait_names[0] = UnityStrInvalidFloatTrait; - break; - } - - if (is_trait != should_be_trait) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - if (!should_be_trait) - { - UnityPrint(UnityStrNot); - } - UnityPrint(trait_names[trait_index]); - UnityPrint(UnityStrWas); -#ifndef UNITY_EXCLUDE_FLOAT_PRINT - UnityPrintFloat((UNITY_DOUBLE)actual); -#else - if (should_be_trait) - { - UnityPrint(UnityStrNot); - } - UnityPrint(trait_names[trait_index]); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -#endif /* not UNITY_EXCLUDE_FLOAT */ - -/*-----------------------------------------------*/ -#ifndef UNITY_EXCLUDE_DOUBLE -static int UnityDoublesWithin(UNITY_DOUBLE delta, UNITY_DOUBLE expected, UNITY_DOUBLE actual) -{ - UNITY_DOUBLE diff; - UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff); -} - -/*-----------------------------------------------*/ -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) -{ - UNITY_UINT32 elements = num_elements; - UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_expected = expected; - UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_actual = actual; - - RETURN_IF_FAIL_OR_IGNORE; - - if (elements == 0) - { - UnityPrintPointlessAndBail(); - } - - if (expected == actual) - { - return; /* Both are NULL or same pointer */ - } - - if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) - { - UNITY_FAIL_AND_BAIL; - } - - while (elements--) - { - if (!UnityDoublesWithin(*ptr_expected * UNITY_DOUBLE_PRECISION, *ptr_expected, *ptr_actual)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberUnsigned(num_elements - elements - 1); - UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(*ptr_expected, *ptr_actual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - if (flags == UNITY_ARRAY_TO_ARRAY) - { - ptr_expected++; - } - ptr_actual++; - } -} - -/*-----------------------------------------------*/ -void UnityAssertDoublesWithin(const UNITY_DOUBLE delta, - const UNITY_DOUBLE expected, - const UNITY_DOUBLE actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - RETURN_IF_FAIL_OR_IGNORE; - - if (!UnityDoublesWithin(delta, expected, actual)) - { - UnityTestResultsFailBegin(lineNumber); - UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -/*-----------------------------------------------*/ -void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style) -{ - const char* trait_names[] = {UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet}; - UNITY_INT should_be_trait = ((UNITY_INT)style & 1); - UNITY_INT is_trait = !should_be_trait; - UNITY_INT trait_index = (UNITY_INT)(style >> 1); - - RETURN_IF_FAIL_OR_IGNORE; - - switch (style) - { - case UNITY_FLOAT_IS_INF: - case UNITY_FLOAT_IS_NOT_INF: - is_trait = isinf(actual) && (actual > 0); - break; - case UNITY_FLOAT_IS_NEG_INF: - case UNITY_FLOAT_IS_NOT_NEG_INF: - is_trait = isinf(actual) && (actual < 0); - break; - - case UNITY_FLOAT_IS_NAN: - case UNITY_FLOAT_IS_NOT_NAN: - is_trait = isnan(actual) ? 1 : 0; - break; - - case UNITY_FLOAT_IS_DET: /* A determinate number is non infinite and not NaN. */ - case UNITY_FLOAT_IS_NOT_DET: - is_trait = !isinf(actual) && !isnan(actual); - break; - - default: - trait_index = 0; - trait_names[0] = UnityStrInvalidFloatTrait; - break; - } - - if (is_trait != should_be_trait) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - if (!should_be_trait) - { - UnityPrint(UnityStrNot); - } - UnityPrint(trait_names[trait_index]); - UnityPrint(UnityStrWas); -#ifndef UNITY_EXCLUDE_FLOAT_PRINT - UnityPrintFloat(actual); -#else - if (should_be_trait) - { - UnityPrint(UnityStrNot); - } - UnityPrint(trait_names[trait_index]); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -#endif /* not UNITY_EXCLUDE_DOUBLE */ - -/*-----------------------------------------------*/ -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) -{ - RETURN_IF_FAIL_OR_IGNORE; - - if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) - { - if (actual > expected) - { - Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); - } - else - { - Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); - } - } - else - { - if ((UNITY_UINT)actual > (UNITY_UINT)expected) - { - Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); - } - else - { - Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); - } - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrDelta); - UnityPrintNumberByStyle((UNITY_INT)delta, style); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expected, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -/*-----------------------------------------------*/ -void UnityAssertNumbersArrayWithin(const UNITY_UINT delta, - 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) -{ - UNITY_UINT32 elements = num_elements; - unsigned int length = style & 0xF; - unsigned int increment = 0; - - RETURN_IF_FAIL_OR_IGNORE; - - if (num_elements == 0) - { - UnityPrintPointlessAndBail(); - } - - if (expected == actual) - { - return; /* Both are NULL or same pointer */ - } - - if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) - { - UNITY_FAIL_AND_BAIL; - } - - while ((elements > 0) && (elements--)) - { - UNITY_INT expect_val; - UNITY_INT actual_val; - - switch (length) - { - case 1: - expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)expected; - actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)actual; - increment = sizeof(UNITY_INT8); - break; - - case 2: - expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)expected; - actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)actual; - increment = sizeof(UNITY_INT16); - break; - -#ifdef UNITY_SUPPORT_64 - case 8: - expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)expected; - actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)actual; - increment = sizeof(UNITY_INT64); - break; -#endif - - default: /* default is length 4 bytes */ - case 4: - expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)expected; - actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)actual; - increment = sizeof(UNITY_INT32); - length = 4; - break; - } - - if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) - { - if (actual_val > expect_val) - { - Unity.CurrentTestFailed = (((UNITY_UINT)actual_val - (UNITY_UINT)expect_val) > delta); - } - else - { - Unity.CurrentTestFailed = (((UNITY_UINT)expect_val - (UNITY_UINT)actual_val) > delta); - } - } - else - { - if ((UNITY_UINT)actual_val > (UNITY_UINT)expect_val) - { - Unity.CurrentTestFailed = (((UNITY_UINT)actual_val - (UNITY_UINT)expect_val) > delta); - } - else - { - Unity.CurrentTestFailed = (((UNITY_UINT)expect_val - (UNITY_UINT)actual_val) > delta); - } - } - - if (Unity.CurrentTestFailed) - { - if ((style & UNITY_DISPLAY_RANGE_UINT) && (length < (UNITY_INT_WIDTH / 8))) - { /* For UINT, remove sign extension (padding 1's) from signed type casts above */ - UNITY_INT mask = 1; - mask = (mask << 8 * length) - 1; - expect_val &= mask; - actual_val &= mask; - } - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrDelta); - UnityPrintNumberByStyle((UNITY_INT)delta, style); - UnityPrint(UnityStrElement); - UnityPrintNumberUnsigned(num_elements - elements - 1); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expect_val, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual_val, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - /* Walk through array by incrementing the pointers */ - if (flags == UNITY_ARRAY_TO_ARRAY) - { - expected = (UNITY_INTERNAL_PTR)((const char*)expected + increment); - } - actual = (UNITY_INTERNAL_PTR)((const char*)actual + increment); - } -} - -/*-----------------------------------------------*/ -void UnityAssertEqualString(const char* expected, - const char* actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - UNITY_UINT32 i; - - RETURN_IF_FAIL_OR_IGNORE; - - /* if both pointers not null compare the strings */ - if (expected && actual) - { - for (i = 0; expected[i] || actual[i]; i++) - { - if (expected[i] != actual[i]) - { - Unity.CurrentTestFailed = 1; - break; - } - } - } - else - { /* handle case of one pointers being null (if both null, test should pass) */ - if (expected != actual) - { - Unity.CurrentTestFailed = 1; - } - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrintExpectedAndActualStrings(expected, actual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -/*-----------------------------------------------*/ -void UnityAssertEqualStringLen(const char* expected, - const char* actual, - const UNITY_UINT32 length, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - UNITY_UINT32 i; - - RETURN_IF_FAIL_OR_IGNORE; - - /* if both pointers not null compare the strings */ - if (expected && actual) - { - for (i = 0; (i < length) && (expected[i] || actual[i]); i++) - { - if (expected[i] != actual[i]) - { - Unity.CurrentTestFailed = 1; - break; - } - } - } - else - { /* handle case of one pointers being null (if both null, test should pass) */ - if (expected != actual) - { - Unity.CurrentTestFailed = 1; - } - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrintExpectedAndActualStringsLen(expected, actual, length); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -/*-----------------------------------------------*/ -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) -{ - UNITY_UINT32 i = 0; - UNITY_UINT32 j = 0; - const char* expd = NULL; - const char* act = NULL; - - RETURN_IF_FAIL_OR_IGNORE; - - /* if no elements, it's an error */ - if (num_elements == 0) - { - UnityPrintPointlessAndBail(); - } - - if ((const void*)expected == (const void*)actual) - { - return; /* Both are NULL or same pointer */ - } - - if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) - { - UNITY_FAIL_AND_BAIL; - } - - if (flags != UNITY_ARRAY_TO_ARRAY) - { - expd = (const char*)expected; - } - - do - { - act = actual[j]; - if (flags == UNITY_ARRAY_TO_ARRAY) - { - expd = ((const char* const*)expected)[j]; - } - - /* if both pointers not null compare the strings */ - if (expd && act) - { - for (i = 0; expd[i] || act[i]; i++) - { - if (expd[i] != act[i]) - { - Unity.CurrentTestFailed = 1; - break; - } - } - } - else - { /* handle case of one pointers being null (if both null, test should pass) */ - if (expd != act) - { - Unity.CurrentTestFailed = 1; - } - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - if (num_elements > 1) - { - UnityPrint(UnityStrElement); - UnityPrintNumberUnsigned(j); - } - UnityPrintExpectedAndActualStrings(expd, act); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - } while (++j < num_elements); -} - -/*-----------------------------------------------*/ -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) -{ - UNITY_PTR_ATTRIBUTE const unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; - UNITY_PTR_ATTRIBUTE const unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE const unsigned char*)actual; - UNITY_UINT32 elements = num_elements; - UNITY_UINT32 bytes; - - RETURN_IF_FAIL_OR_IGNORE; - - if ((elements == 0) || (length == 0)) - { - UnityPrintPointlessAndBail(); - } - - if (expected == actual) - { - return; /* Both are NULL or same pointer */ - } - - if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) - { - UNITY_FAIL_AND_BAIL; - } - - while (elements--) - { - bytes = length; - while (bytes--) - { - if (*ptr_exp != *ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrMemory); - if (num_elements > 1) - { - UnityPrint(UnityStrElement); - UnityPrintNumberUnsigned(num_elements - elements - 1); - } - UnityPrint(UnityStrByte); - UnityPrintNumberUnsigned(length - bytes - 1); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp++; - ptr_act++; - } - if (flags == UNITY_ARRAY_TO_VAL) - { - ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; - } - } -} - -/*-----------------------------------------------*/ - -static union -{ - UNITY_INT8 i8; - UNITY_INT16 i16; - UNITY_INT32 i32; -#ifdef UNITY_SUPPORT_64 - UNITY_INT64 i64; -#endif -#ifndef UNITY_EXCLUDE_FLOAT - float f; -#endif -#ifndef UNITY_EXCLUDE_DOUBLE - double d; -#endif -} UnityQuickCompare; - -UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size) -{ - switch(size) - { - case 1: - UnityQuickCompare.i8 = (UNITY_INT8)num; - return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i8); - - case 2: - UnityQuickCompare.i16 = (UNITY_INT16)num; - return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i16); - -#ifdef UNITY_SUPPORT_64 - case 8: - UnityQuickCompare.i64 = (UNITY_INT64)num; - return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i64); -#endif - - default: /* 4 bytes */ - UnityQuickCompare.i32 = (UNITY_INT32)num; - return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i32); - } -} - -#ifndef UNITY_EXCLUDE_FLOAT -/*-----------------------------------------------*/ -UNITY_INTERNAL_PTR UnityFloatToPtr(const float num) -{ - UnityQuickCompare.f = num; - return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.f); -} -#endif - -#ifndef UNITY_EXCLUDE_DOUBLE -/*-----------------------------------------------*/ -UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num) -{ - UnityQuickCompare.d = num; - return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.d); -} -#endif - -/*----------------------------------------------- - * printf helper function - *-----------------------------------------------*/ -#ifdef UNITY_INCLUDE_PRINT_FORMATTED -static void UnityPrintFVA(const char* format, va_list va) -{ - const char* pch = format; - if (pch != NULL) - { - while (*pch) - { - /* format identification character */ - if (*pch == '%') - { - pch++; - - if (pch != NULL) - { - switch (*pch) - { - case 'd': - case 'i': - { - const int number = va_arg(va, int); - UnityPrintNumber((UNITY_INT)number); - break; - } -#ifndef UNITY_EXCLUDE_FLOAT_PRINT - case 'f': - case 'g': - { - const double number = va_arg(va, double); - UnityPrintFloat((UNITY_DOUBLE)number); - break; - } -#endif - case 'u': - { - const unsigned int number = va_arg(va, unsigned int); - UnityPrintNumberUnsigned((UNITY_UINT)number); - break; - } - case 'b': - { - const unsigned int number = va_arg(va, unsigned int); - const UNITY_UINT mask = (UNITY_UINT)0 - (UNITY_UINT)1; - UNITY_OUTPUT_CHAR('0'); - UNITY_OUTPUT_CHAR('b'); - UnityPrintMask(mask, (UNITY_UINT)number); - break; - } - case 'x': - case 'X': - case 'p': - { - const unsigned int number = va_arg(va, unsigned int); - UNITY_OUTPUT_CHAR('0'); - UNITY_OUTPUT_CHAR('x'); - UnityPrintNumberHex((UNITY_UINT)number, 8); - break; - } - case 'c': - { - const int ch = va_arg(va, int); - UnityPrintChar((const char *)&ch); - break; - } - case 's': - { - const char * string = va_arg(va, const char *); - UnityPrint(string); - break; - } - case '%': - { - UnityPrintChar(pch); - break; - } - default: - { - /* print the unknown format character */ - UNITY_OUTPUT_CHAR('%'); - UnityPrintChar(pch); - break; - } - } - } - } -#ifdef UNITY_OUTPUT_COLOR - /* print ANSI escape code */ - else if ((*pch == 27) && (*(pch + 1) == '[')) - { - pch += UnityPrintAnsiEscapeString(pch); - continue; - } -#endif - else if (*pch == '\n') - { - UNITY_PRINT_EOL(); - } - else - { - UnityPrintChar(pch); - } - - pch++; - } - } -} - -void UnityPrintF(const UNITY_LINE_TYPE line, const char* format, ...) -{ - UnityTestResultsBegin(Unity.TestFile, line); - UnityPrint("INFO"); - if(format != NULL) - { - UnityPrint(": "); - va_list va; - va_start(va, format); - UnityPrintFVA(format, va); - va_end(va); - } - UNITY_PRINT_EOL(); -} -#endif /* ! UNITY_INCLUDE_PRINT_FORMATTED */ - - -/*----------------------------------------------- - * Control Functions - *-----------------------------------------------*/ - -/*-----------------------------------------------*/ -void UnityFail(const char* msg, const UNITY_LINE_TYPE line) -{ - RETURN_IF_FAIL_OR_IGNORE; - - UnityTestResultsBegin(Unity.TestFile, line); - UnityPrint(UnityStrFail); - if (msg != NULL) - { - UNITY_OUTPUT_CHAR(':'); - -#ifdef UNITY_PRINT_TEST_CONTEXT - UNITY_PRINT_TEST_CONTEXT(); -#endif -#ifndef UNITY_EXCLUDE_DETAILS - if (Unity.CurrentDetail1) - { - UnityPrint(UnityStrDetail1Name); - UnityPrint(Unity.CurrentDetail1); - if (Unity.CurrentDetail2) - { - UnityPrint(UnityStrDetail2Name); - UnityPrint(Unity.CurrentDetail2); - } - UnityPrint(UnityStrSpacer); - } -#endif - if (msg[0] != ' ') - { - UNITY_OUTPUT_CHAR(' '); - } - UnityPrint(msg); - } - - UNITY_FAIL_AND_BAIL; -} - -/*-----------------------------------------------*/ -void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line) -{ - RETURN_IF_FAIL_OR_IGNORE; - - UnityTestResultsBegin(Unity.TestFile, line); - UnityPrint(UnityStrIgnore); - if (msg != NULL) - { - UNITY_OUTPUT_CHAR(':'); - UNITY_OUTPUT_CHAR(' '); - UnityPrint(msg); - } - UNITY_IGNORE_AND_BAIL; -} - -/*-----------------------------------------------*/ -void UnityMessage(const char* msg, const UNITY_LINE_TYPE line) -{ - UnityTestResultsBegin(Unity.TestFile, line); - UnityPrint("INFO"); - if (msg != NULL) - { - UNITY_OUTPUT_CHAR(':'); - UNITY_OUTPUT_CHAR(' '); - UnityPrint(msg); - } - UNITY_PRINT_EOL(); -} - -/*-----------------------------------------------*/ -/* If we have not defined our own test runner, then include our default test runner to make life easier */ -#ifndef UNITY_SKIP_DEFAULT_RUNNER -void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum) -{ - Unity.CurrentTestName = FuncName; - Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum; - Unity.NumberOfTests++; - UNITY_CLR_DETAILS(); - UNITY_EXEC_TIME_START(); - if (TEST_PROTECT()) - { - setUp(); - Func(); - } - if (TEST_PROTECT()) - { - tearDown(); - } - UNITY_EXEC_TIME_STOP(); - UnityConcludeTest(); -} -#endif - -/*-----------------------------------------------*/ -void UnitySetTestFile(const char* filename) -{ - Unity.TestFile = filename; -} - -/*-----------------------------------------------*/ -void UnityBegin(const char* filename) -{ - Unity.TestFile = filename; - Unity.CurrentTestName = NULL; - Unity.CurrentTestLineNumber = 0; - Unity.NumberOfTests = 0; - Unity.TestFailures = 0; - Unity.TestIgnores = 0; - Unity.CurrentTestFailed = 0; - Unity.CurrentTestIgnored = 0; - - UNITY_CLR_DETAILS(); - UNITY_OUTPUT_START(); -} - -/*-----------------------------------------------*/ -int UnityEnd(void) -{ - UNITY_PRINT_EOL(); - UnityPrint(UnityStrBreaker); - UNITY_PRINT_EOL(); - UnityPrintNumber((UNITY_INT)(Unity.NumberOfTests)); - UnityPrint(UnityStrResultsTests); - UnityPrintNumber((UNITY_INT)(Unity.TestFailures)); - UnityPrint(UnityStrResultsFailures); - UnityPrintNumber((UNITY_INT)(Unity.TestIgnores)); - UnityPrint(UnityStrResultsIgnored); - UNITY_PRINT_EOL(); - if (Unity.TestFailures == 0U) - { - UnityPrint(UnityStrOk); - } - else - { - UnityPrint(UnityStrFail); -#ifdef UNITY_DIFFERENTIATE_FINAL_FAIL - UNITY_OUTPUT_CHAR('E'); UNITY_OUTPUT_CHAR('D'); -#endif - } - UNITY_PRINT_EOL(); - UNITY_FLUSH_CALL(); - UNITY_OUTPUT_COMPLETE(); - return (int)(Unity.TestFailures); -} - -/*----------------------------------------------- - * Command Line Argument Support - *-----------------------------------------------*/ -#ifdef UNITY_USE_COMMAND_LINE_ARGS - -char* UnityOptionIncludeNamed = NULL; -char* UnityOptionExcludeNamed = NULL; -int UnityVerbosity = 1; - -/*-----------------------------------------------*/ -int UnityParseOptions(int argc, char** argv) -{ - int i; - UnityOptionIncludeNamed = NULL; - UnityOptionExcludeNamed = NULL; - - for (i = 1; i < argc; i++) - { - if (argv[i][0] == '-') - { - switch (argv[i][1]) - { - case 'l': /* list tests */ - return -1; - case 'n': /* include tests with name including this string */ - case 'f': /* an alias for -n */ - if (argv[i][2] == '=') - { - UnityOptionIncludeNamed = &argv[i][3]; - } - else if (++i < argc) - { - UnityOptionIncludeNamed = argv[i]; - } - else - { - UnityPrint("ERROR: No Test String to Include Matches For"); - UNITY_PRINT_EOL(); - return 1; - } - break; - case 'q': /* quiet */ - UnityVerbosity = 0; - break; - case 'v': /* verbose */ - UnityVerbosity = 2; - break; - case 'x': /* exclude tests with name including this string */ - if (argv[i][2] == '=') - { - UnityOptionExcludeNamed = &argv[i][3]; - } - else if (++i < argc) - { - UnityOptionExcludeNamed = argv[i]; - } - else - { - UnityPrint("ERROR: No Test String to Exclude Matches For"); - UNITY_PRINT_EOL(); - return 1; - } - break; - default: - UnityPrint("ERROR: Unknown Option "); - UNITY_OUTPUT_CHAR(argv[i][1]); - UNITY_PRINT_EOL(); - return 1; - } - } - } - - return 0; -} - -/*-----------------------------------------------*/ -int IsStringInBiggerString(const char* longstring, const char* shortstring) -{ - const char* lptr = longstring; - const char* sptr = shortstring; - const char* lnext = lptr; - - if (*sptr == '*') - { - return 1; - } - - while (*lptr) - { - lnext = lptr + 1; - - /* If they current bytes match, go on to the next bytes */ - while (*lptr && *sptr && (*lptr == *sptr)) - { - lptr++; - sptr++; - - /* We're done if we match the entire string or up to a wildcard */ - if (*sptr == '*') - return 1; - if (*sptr == ',') - return 1; - if (*sptr == '"') - return 1; - if (*sptr == '\'') - return 1; - if (*sptr == ':') - return 2; - if (*sptr == 0) - return 1; - } - - /* Otherwise we start in the long pointer 1 character further and try again */ - lptr = lnext; - sptr = shortstring; - } - - return 0; -} - -/*-----------------------------------------------*/ -int UnityStringArgumentMatches(const char* str) -{ - int retval; - const char* ptr1; - const char* ptr2; - const char* ptrf; - - /* Go through the options and get the substrings for matching one at a time */ - ptr1 = str; - while (ptr1[0] != 0) - { - if ((ptr1[0] == '"') || (ptr1[0] == '\'')) - { - ptr1++; - } - - /* look for the start of the next partial */ - ptr2 = ptr1; - ptrf = 0; - do - { - ptr2++; - if ((ptr2[0] == ':') && (ptr2[1] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ',')) - { - ptrf = &ptr2[1]; - } - } while ((ptr2[0] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ',')); - - while ((ptr2[0] != 0) && ((ptr2[0] == ':') || (ptr2[0] == '\'') || (ptr2[0] == '"') || (ptr2[0] == ','))) - { - ptr2++; - } - - /* done if complete filename match */ - retval = IsStringInBiggerString(Unity.TestFile, ptr1); - if (retval == 1) - { - return retval; - } - - /* done if testname match after filename partial match */ - if ((retval == 2) && (ptrf != 0)) - { - if (IsStringInBiggerString(Unity.CurrentTestName, ptrf)) - { - return 1; - } - } - - /* done if complete testname match */ - if (IsStringInBiggerString(Unity.CurrentTestName, ptr1) == 1) - { - return 1; - } - - ptr1 = ptr2; - } - - /* we couldn't find a match for any substrings */ - return 0; -} - -/*-----------------------------------------------*/ -int UnityTestMatches(void) -{ - /* Check if this test name matches the included test pattern */ - int retval; - if (UnityOptionIncludeNamed) - { - retval = UnityStringArgumentMatches(UnityOptionIncludeNamed); - } - else - { - retval = 1; - } - - /* Check if this test name matches the excluded test pattern */ - if (UnityOptionExcludeNamed) - { - if (UnityStringArgumentMatches(UnityOptionExcludeNamed)) - { - retval = 0; - } - } - - return retval; -} - -#endif /* UNITY_USE_COMMAND_LINE_ARGS */ -/*-----------------------------------------------*/ diff --git a/components/testframework/libs/cmock/vendor/unity/src/unity.h b/components/testframework/libs/cmock/vendor/unity/src/unity.h deleted file mode 100644 index 8caa78529..000000000 --- a/components/testframework/libs/cmock/vendor/unity/src/unity.h +++ /dev/null @@ -1,661 +0,0 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007-19 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 - -#define UNITY_VERSION_MAJOR 2 -#define UNITY_VERSION_MINOR 5 -#define UNITY_VERSION_BUILD 1 -#define UNITY_VERSION ((UNITY_VERSION_MAJOR << 16) | (UNITY_VERSION_MINOR << 8) | UNITY_VERSION_BUILD) - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "unity_internals.h" - -/*------------------------------------------------------- - * Test Setup / Teardown - *-------------------------------------------------------*/ - -/* These functions are intended to be called before and after each test. - * If using unity directly, these will need to be provided for each test - * executable built. If you are using the test runner generator and/or - * Ceedling, these are optional. */ -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(). If using - * Unity directly, you're in charge of calling these if they are desired. - * If using Ceedling or the test runner generator, these will be called - * automatically if they exist. */ -void suiteSetUp(void); -int suiteTearDown(int num_failures); - -/*------------------------------------------------------- - * Test Reset and Verify - *-------------------------------------------------------*/ - -/* These functions are intended to be called before during tests in order - * to support complex test loops, etc. Both are NOT built into Unity. Instead - * the test runner generator will create them. resetTest will run teardown and - * setup again, verifying any end-of-test needs between. verifyTest will only - * run the verification. */ -void resetTest(void); -void verifyTest(void); - -/*------------------------------------------------------- - * 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_MESSAGE(message) UnityMessage((message), __LINE__) -#define TEST_ONLY() -#ifdef UNITY_INCLUDE_PRINT_FORMATTED -#define TEST_PRINTF(message, ...) UnityPrintF(__LINE__, (message), __VA_ARGS__) -#endif - -/* 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() -#define TEST_PASS_MESSAGE(message) do { UnityMessage((message), __LINE__); TEST_ABORT(); } while(0) - -/* 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") -#define TEST_ASSERT_EMPTY(pointer) UNITY_TEST_ASSERT_EMPTY( (pointer), __LINE__, " Expected Empty") -#define TEST_ASSERT_NOT_EMPTY(pointer) UNITY_TEST_ASSERT_NOT_EMPTY((pointer), __LINE__, " Expected Non-Empty") - -/* 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_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_size_t(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT((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_EQUAL_CHAR(expected, actual) UNITY_TEST_ASSERT_EQUAL_CHAR((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 Not Equal To (of all sizes) */ -#define TEST_ASSERT_NOT_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_size_t(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX8((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_CHAR((threshold), (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_size_t(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT((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_GREATER_THAN_CHAR(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_CHAR((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_size_t(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((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_LESS_THAN_CHAR(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_CHAR((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_size_t(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((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_GREATER_OR_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR((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_size_t(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((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) -#define TEST_ASSERT_LESS_OR_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR((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_size_t_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT_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) -#define TEST_ASSERT_CHAR_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_CHAR_WITHIN((delta), (expected), (actual), __LINE__, NULL) - -/* Integer Array Ranges (of all sizes) */ -#define TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_INT8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_INT16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_INT32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_UINT_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_UINT8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_UINT16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_UINT32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_size_t_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_HEX_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) -#define TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __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_size_t_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT_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) -#define TEST_ASSERT_EQUAL_CHAR_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY((expected), (actual), (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_size_t(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((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) -#define TEST_ASSERT_EACH_EQUAL_CHAR(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_CHAR((expected), (actual), (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) - -/* Shorthand */ -#ifdef UNITY_SHORTHAND_AS_OLD -#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") -#endif -#ifdef UNITY_SHORTHAND_AS_INT -#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) -#endif -#ifdef UNITY_SHORTHAND_AS_MEM -#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_MEMORY((&expected), (&actual), sizeof(expected), __LINE__, NULL) -#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) -#endif -#ifdef UNITY_SHORTHAND_AS_RAW -#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) == (actual)), __LINE__, " Expected Equal") -#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, " Expected Not-Equal") -#endif -#ifdef UNITY_SHORTHAND_AS_NONE -#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) -#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) -#endif - -/*------------------------------------------------------- - * 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)) -#define TEST_ASSERT_EMPTY_MESSAGE(pointer, message) UNITY_TEST_ASSERT_EMPTY( (pointer), __LINE__, (message)) -#define TEST_ASSERT_NOT_EMPTY_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NOT_EMPTY((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_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_size_t_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT( (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)) -#define TEST_ASSERT_EQUAL_CHAR_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_CHAR((expected), (actual), __LINE__, (message)) - -/* Integer Not Equal To (of all sizes) */ -#define TEST_ASSERT_NOT_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX8((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_NOT_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_CHAR((threshold), (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_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT((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_GREATER_THAN_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_CHAR((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_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((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_LESS_THAN_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_CHAR((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_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((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_GREATER_OR_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR((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_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((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_OR_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) -#define TEST_ASSERT_LESS_OR_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR((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_size_t_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT_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)) -#define TEST_ASSERT_CHAR_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_CHAR_WITHIN((delta), (expected), (actual), __LINE__, (message)) - -/* Integer Array Ranges (of all sizes) */ -#define TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_INT32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_UINT32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_size_t_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_HEX_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) -#define TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __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_size_t_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT_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)) -#define TEST_ASSERT_EQUAL_CHAR_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY((expected), (actual), (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_size_t_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((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)) -#define TEST_ASSERT_EACH_EQUAL_CHAR_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_CHAR((expected), (actual), (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)) - -/* Shorthand */ -#ifdef UNITY_SHORTHAND_AS_OLD -#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)) -#endif -#ifdef UNITY_SHORTHAND_AS_INT -#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_FAIL(__LINE__, UnityStrErrShorthand) -#endif -#ifdef UNITY_SHORTHAND_AS_MEM -#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_MEMORY((&expected), (&actual), sizeof(expected), __LINE__, message) -#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) -#endif -#ifdef UNITY_SHORTHAND_AS_RAW -#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) == (actual)), __LINE__, message) -#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, message) -#endif -#ifdef UNITY_SHORTHAND_AS_NONE -#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) -#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) -#endif - -/* end of UNITY_FRAMEWORK_H */ -#ifdef __cplusplus -} -#endif -#endif diff --git a/components/testframework/libs/cmock/vendor/unity/src/unity_internals.h b/components/testframework/libs/cmock/vendor/unity/src/unity_internals.h deleted file mode 100644 index 705c6121c..000000000 --- a/components/testframework/libs/cmock/vendor/unity/src/unity_internals.h +++ /dev/null @@ -1,1027 +0,0 @@ -/* ========================================== - Unity Project - A Test Framework for C - Copyright (c) 2007-19 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 - -#ifdef UNITY_INCLUDE_CONFIG_H -#include "unity_config.h" -#endif - -#ifndef UNITY_EXCLUDE_SETJMP_H -#include -#endif - -#ifndef UNITY_EXCLUDE_MATH_H -#include -#endif - -#ifndef UNITY_EXCLUDE_STDDEF_H -#include -#endif - -#ifdef UNITY_INCLUDE_PRINT_FORMATTED -#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. - * Also sizeof(int) does return the size in addressable units on all platforms, - * which may not necessarily be the size in bytes. - * 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 - *-------------------------------------------------------*/ - -/* Auto-detect 64 Bit Support */ -#ifndef UNITY_SUPPORT_64 - #if UNITY_LONG_WIDTH == 64 || UNITY_POINTER_WIDTH == 64 - #define UNITY_SUPPORT_64 - #endif -#endif - -/* 64-Bit Support Dependent Configuration */ -#ifndef UNITY_SUPPORT_64 - /* No 64-bit Support */ - typedef UNITY_UINT32 UNITY_UINT; - typedef UNITY_INT32 UNITY_INT; - #define UNITY_MAX_NIBBLES (8) /* Maximum number of nibbles in a UNITY_(U)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; - #define UNITY_MAX_NIBBLES (16) /* Maximum number of nibbles in a UNITY_(U)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 - /* If defined as something else, make sure we declare it here so it's ready for use */ - #ifdef UNITY_OUTPUT_FLUSH_HEADER_DECLARATION - extern void UNITY_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 - -#ifdef UNITY_INCLUDE_EXEC_TIME - #if !defined(UNITY_EXEC_TIME_START) && \ - !defined(UNITY_EXEC_TIME_STOP) && \ - !defined(UNITY_PRINT_EXEC_TIME) && \ - !defined(UNITY_TIME_TYPE) - /* If none any of these macros are defined then try to provide a default implementation */ - - #if defined(UNITY_CLOCK_MS) - /* This is a simple way to get a default implementation on platforms that support getting a millisecond counter */ - #define UNITY_TIME_TYPE UNITY_UINT - #define UNITY_EXEC_TIME_START() Unity.CurrentTestStartTime = UNITY_CLOCK_MS() - #define UNITY_EXEC_TIME_STOP() Unity.CurrentTestStopTime = UNITY_CLOCK_MS() - #define UNITY_PRINT_EXEC_TIME() { \ - UNITY_UINT execTimeMs = (Unity.CurrentTestStopTime - Unity.CurrentTestStartTime); \ - UnityPrint(" ("); \ - UnityPrintNumberUnsigned(execTimeMs); \ - UnityPrint(" ms)"); \ - } - #elif defined(_WIN32) - #include - #define UNITY_TIME_TYPE clock_t - #define UNITY_GET_TIME(t) t = (clock_t)((clock() * 1000) / CLOCKS_PER_SEC) - #define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime) - #define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime) - #define UNITY_PRINT_EXEC_TIME() { \ - UNITY_UINT execTimeMs = (Unity.CurrentTestStopTime - Unity.CurrentTestStartTime); \ - UnityPrint(" ("); \ - UnityPrintNumberUnsigned(execTimeMs); \ - UnityPrint(" ms)"); \ - } - #elif defined(__unix__) - #include - #define UNITY_TIME_TYPE struct timespec - #define UNITY_GET_TIME(t) clock_gettime(CLOCK_MONOTONIC, &t) - #define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime) - #define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime) - #define UNITY_PRINT_EXEC_TIME() { \ - UNITY_UINT execTimeMs = ((Unity.CurrentTestStopTime.tv_sec - Unity.CurrentTestStartTime.tv_sec) * 1000L); \ - execTimeMs += ((Unity.CurrentTestStopTime.tv_nsec - Unity.CurrentTestStartTime.tv_nsec) / 1000000L); \ - UnityPrint(" ("); \ - UnityPrintNumberUnsigned(execTimeMs); \ - UnityPrint(" ms)"); \ - } - #endif - #endif -#endif - -#ifndef UNITY_EXEC_TIME_START -#define UNITY_EXEC_TIME_START() do{}while(0) -#endif - -#ifndef UNITY_EXEC_TIME_STOP -#define UNITY_EXEC_TIME_STOP() do{}while(0) -#endif - -#ifndef UNITY_TIME_TYPE -#define UNITY_TIME_TYPE UNITY_UINT -#endif - -#ifndef UNITY_PRINT_EXEC_TIME -#define UNITY_PRINT_EXEC_TIME() do{}while(0) -#endif - -/*------------------------------------------------------- - * Footprint - *-------------------------------------------------------*/ - -#ifndef UNITY_LINE_TYPE -#define UNITY_LINE_TYPE UNITY_UINT -#endif - -#ifndef UNITY_COUNTER_TYPE -#define UNITY_COUNTER_TYPE UNITY_UINT -#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) -#define UNITY_DISPLAY_RANGE_CHAR (0x80) - -typedef enum -{ - UNITY_DISPLAY_STYLE_INT = (UNITY_INT_WIDTH / 8) + 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 = (UNITY_INT_WIDTH / 8) + 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_CHAR = 1 + UNITY_DISPLAY_RANGE_CHAR + UNITY_DISPLAY_RANGE_INT, - - UNITY_DISPLAY_STYLE_UNKNOWN -} UNITY_DISPLAY_STYLE_T; - -typedef enum -{ - UNITY_WITHIN = 0x0, - UNITY_EQUAL_TO = 0x1, - UNITY_GREATER_THAN = 0x2, - UNITY_GREATER_OR_EQUAL = 0x2 + UNITY_EQUAL_TO, - UNITY_SMALLER_THAN = 0x4, - UNITY_SMALLER_OR_EQUAL = 0x4 + UNITY_EQUAL_TO, - UNITY_NOT_EQUAL = 0x0, - UNITY_UNKNOWN -} 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_ARRAY_UNKNOWN -} 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; -#ifdef UNITY_INCLUDE_EXEC_TIME - UNITY_TIME_TYPE CurrentTestStartTime; - UNITY_TIME_TYPE CurrentTestStopTime; -#endif -#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 UnitySetTestFile(const char* filename); -void UnityConcludeTest(void); - -#ifndef RUN_TEST -void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum); -#else -#define UNITY_SKIP_DEFAULT_RUNNER -#endif - -/*------------------------------------------------------- - * 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 - -#ifdef UNITY_PRINT_TEST_CONTEXT -void UNITY_PRINT_TEST_CONTEXT(void); -#endif - -/*------------------------------------------------------- - * Test Output - *-------------------------------------------------------*/ - -void UnityPrint(const char* string); - -#ifdef UNITY_INCLUDE_PRINT_FORMATTED -void UnityPrintF(const UNITY_LINE_TYPE line, const char* format, ...); -#endif - -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_to_print); -void UnityPrintNumberUnsigned(const UNITY_UINT number); -void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print); - -#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 UnityAssertNumbersArrayWithin(const UNITY_UINT delta, - 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 UnityFail(const char* message, const UNITY_LINE_TYPE line); -void UnityIgnore(const char* message, const UNITY_LINE_TYPE line); -void UnityMessage(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 UnityStrOk[]; -extern const char UnityStrPass[]; -extern const char UnityStrFail[]; -extern const char UnityStrIgnore[]; - -extern const char UnityStrErrFloat[]; -extern const char UnityStrErrDouble[]; -extern const char UnityStrErr64[]; -extern const char UnityStrErrShorthand[]; - -/*------------------------------------------------------- - * 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 UNITY_SUPPORT_VARIADIC_MACROS -#endif -#endif -#ifdef UNITY_SUPPORT_VARIADIC_MACROS -#define RUN_TEST(...) RUN_TEST_AT_LINE(__VA_ARGS__, __LINE__, throwaway) -#define RUN_TEST_AT_LINE(func, line, ...) UnityDefaultTestRun(func, #func, line) -#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 - -#ifndef UNITY_SHORTHAND_AS_INT -#ifndef UNITY_SHORTHAND_AS_MEM -#ifndef UNITY_SHORTHAND_AS_NONE -#ifndef UNITY_SHORTHAND_AS_RAW -#define UNITY_SHORTHAND_AS_OLD -#endif -#endif -#endif -#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) do {if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), (message));}} while(0) -#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_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) == 0), (UNITY_LINE_TYPE)(line), (message)) -#define UNITY_TEST_ASSERT_NOT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) != 0), (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_EQUAL_CHAR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) -#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_NOT_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_NOT_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_NOT_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_NOT_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_NOT_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) - -#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_GREATER_THAN_CHAR(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_CHAR) - -#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_SMALLER_THAN_CHAR(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_CHAR) - -#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_GREATER_OR_EQUAL_CHAR(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_CHAR) - -#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_SMALLER_OR_EQUAL_CHAR(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_CHAR) - -#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_CHAR_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_CHAR) - -#define UNITY_TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (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_INT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (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_INT16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (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_INT32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (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_UINT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (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_UINT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (UNITY_UINT16)(delta), (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_UINT16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (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_UINT32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (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_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (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_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (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_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (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_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY) - - -#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_EQUAL_CHAR_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_CHAR, UNITY_ARRAY_TO_ARRAY) - -#define UNITY_TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) (expected), (UNITY_INT_WIDTH / 8)), (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), (UNITY_INT_WIDTH / 8)), (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), (UNITY_POINTER_WIDTH / 8)), (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) -#define UNITY_TEST_ASSERT_EACH_EQUAL_CHAR(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_CHAR, 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_NOT_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (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) -#define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (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_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (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_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (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) -#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) -#define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) -#define UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements, 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/components/testframework/libs/cmock/vendor/unity/test/.rubocop.yml b/components/testframework/libs/cmock/vendor/unity/test/.rubocop.yml deleted file mode 100644 index 6c9542f52..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/.rubocop.yml +++ /dev/null @@ -1,76 +0,0 @@ -# This is the configuration used to check the rubocop source code. - -#inherit_from: .rubocop_todo.yml - -AllCops: - TargetRubyVersion: 2.3 - -# These are areas where ThrowTheSwitch's coding style diverges from the Ruby standard -Style/SpecialGlobalVars: - EnforcedStyle: use_perl_names -Style/FormatString: - Enabled: false -Style/GlobalVars: - Enabled: false -Style/FrozenStringLiteralComment: - Enabled: false -Style/RegexpLiteral: - AllowInnerSlashes: true -Style/HashSyntax: - EnforcedStyle: no_mixed_keys -Style/NumericPredicate: - Enabled: false -Style/MultilineBlockChain: - Enabled: false -Style/Alias: - Enabled: false -Style/EvalWithLocation: - Enabled: false -Style/MixinUsage: - Enabled: false - -# These are also places we diverge... but we will likely comply down the road -Style/IfUnlessModifier: - Enabled: false -Style/FormatStringToken: - Enabled: false - -# This is disabled because it seems to get confused over nested hashes -Layout/AlignHash: - Enabled: false - EnforcedHashRocketStyle: table - EnforcedColonStyle: table - -# We purposefully use these insecure features because they're what makes Ruby awesome -Security/Eval: - Enabled: false -Security/YAMLLoad: - Enabled: false - -# At this point, we're not ready to enforce inline documentation requirements -Style/Documentation: - Enabled: false -Style/DocumentationMethod: - Enabled: false - -# At this point, we're not ready to enforce any metrics -Metrics/AbcSize: - Enabled: false -Metrics/BlockLength: - Enabled: false -Metrics/BlockNesting: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/LineLength: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/ParameterLists: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false diff --git a/components/testframework/libs/cmock/vendor/unity/test/Makefile b/components/testframework/libs/cmock/vendor/unity/test/Makefile deleted file mode 100644 index d8d10d22e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/Makefile +++ /dev/null @@ -1,159 +0,0 @@ -CC = gcc -ifeq ($(shell uname -s), Darwin) -CC = clang -endif -ifeq ($(findstring clang, $(CC)), clang) -E = -Weverything -CFLAGS += $E -Wno-unknown-warning-option -Wno-missing-prototypes -CFLAGS += -Wno-unused-macros -Wno-padded -Wno-missing-noreturn -endif -CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -#CFLAGS += -Wconversion #disabled because if falsely complains about the isinf and isnan macros -CFLAGS += -Wno-switch-enum -Wno-double-promotion -CFLAGS += -Wbad-function-cast -Wcast-qual -Wold-style-definition -Wshadow -Wstrict-overflow \ - -Wstrict-prototypes -Wswitch-default -Wundef -#DEBUG = -O0 -g -CFLAGS += $(DEBUG) -UNITY_SUPPORT_64 = -D UNITY_SUPPORT_64 -UNITY_INCLUDE_DOUBLE = -D UNITY_INCLUDE_DOUBLE -DEFINES = -D UNITY_OUTPUT_CHAR=putcharSpy -DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=putcharSpy\(int\) -DEFINES += -D UNITY_OUTPUT_FLUSH=flushSpy -DEFINES += -D UNITY_OUTPUT_FLUSH_HEADER_DECLARATION=flushSpy\(void\) -DEFINES += $(UNITY_SUPPORT_64) $(UNITY_INCLUDE_DOUBLE) -SRC1 = ../src/unity.c tests/test_unity_arrays.c build/test_unity_arraysRunner.c -SRC2 = ../src/unity.c tests/test_unity_core.c build/test_unity_coreRunner.c -SRC3 = ../src/unity.c tests/test_unity_doubles.c build/test_unity_doublesRunner.c -SRC4 = ../src/unity.c tests/test_unity_floats.c build/test_unity_floatsRunner.c -SRC5 = ../src/unity.c tests/test_unity_integers.c build/test_unity_integersRunner.c -SRC6 = ../src/unity.c tests/test_unity_integers_64.c build/test_unity_integers_64Runner.c -SRC7 = ../src/unity.c tests/test_unity_memory.c build/test_unity_memoryRunner.c -SRC8 = ../src/unity.c tests/test_unity_strings.c build/test_unity_stringsRunner.c -INC_DIR = -I ../src -COV_FLAGS = -fprofile-arcs -ftest-coverage -I ../../src -BUILD_DIR = build -TARGET = build/testunity-cov.exe - -# To generate coverage, call 'make -s', the default target runs. -# For verbose output of all the tests, run 'make test'. -default: coverage -.PHONY: default coverage test clean -coverage: $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5) $(SRC6) $(SRC7) $(SRC8) - cd $(BUILD_DIR) && \ - $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC1), ../$i) $(COV_FLAGS) -o ../$(TARGET) - rm -f $(BUILD_DIR)/*.gcda - ./$(TARGET) | grep 'Tests\|]]]' -A1 - cd $(BUILD_DIR) && \ - gcov unity.c | head -3 - grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true - cd $(BUILD_DIR) && \ - $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC2), ../$i) $(COV_FLAGS) -o ../$(TARGET) - rm -f $(BUILD_DIR)/*.gcda - ./$(TARGET) | grep 'Tests\|]]]' -A1 - cd $(BUILD_DIR) && \ - gcov unity.c | head -3 - grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true - cd $(BUILD_DIR) && \ - $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC3), ../$i) $(COV_FLAGS) -o ../$(TARGET) - rm -f $(BUILD_DIR)/*.gcda - ./$(TARGET) | grep 'Tests\|]]]' -A1 - cd $(BUILD_DIR) && \ - gcov unity.c | head -3 - grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true - cd $(BUILD_DIR) && \ - $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC4), ../$i) $(COV_FLAGS) -o ../$(TARGET) - rm -f $(BUILD_DIR)/*.gcda - ./$(TARGET) | grep 'Tests\|]]]' -A1 - cd $(BUILD_DIR) && \ - gcov unity.c | head -3 - grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true - cd $(BUILD_DIR) && \ - $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC5), ../$i) $(COV_FLAGS) -o ../$(TARGET) - rm -f $(BUILD_DIR)/*.gcda - ./$(TARGET) | grep 'Tests\|]]]' -A1 - cd $(BUILD_DIR) && \ - gcov unity.c | head -3 - grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true - cd $(BUILD_DIR) && \ - $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC6), ../$i) $(COV_FLAGS) -o ../$(TARGET) - rm -f $(BUILD_DIR)/*.gcda - ./$(TARGET) | grep 'Tests\|]]]' -A1 - cd $(BUILD_DIR) && \ - gcov unity.c | head -3 - grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true - cd $(BUILD_DIR) && \ - $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC7), ../$i) $(COV_FLAGS) -o ../$(TARGET) - rm -f $(BUILD_DIR)/*.gcda - ./$(TARGET) | grep 'Tests\|]]]' -A1 - cd $(BUILD_DIR) && \ - gcov unity.c | head -3 - grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true - cd $(BUILD_DIR) && \ - $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC8), ../$i) $(COV_FLAGS) -o ../$(TARGET) - rm -f $(BUILD_DIR)/*.gcda - ./$(TARGET) | grep 'Tests\|]]]' -A1 - cd $(BUILD_DIR) && \ - gcov unity.c | head -3 - grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true - -test: $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5) $(SRC6) $(SRC7) $(SRC8) - $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC1) -o $(TARGET) - ./$(TARGET) - $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC2) -o $(TARGET) - ./$(TARGET) - $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC3) -o $(TARGET) - ./$(TARGET) - $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC4) -o $(TARGET) - ./$(TARGET) - $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC5) -o $(TARGET) - ./$(TARGET) - $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC6) -o $(TARGET) - ./$(TARGET) - $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC7) -o $(TARGET) - ./$(TARGET) - $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC8) -o $(TARGET) - ./$(TARGET) - -# Compile only, for testing that preprocessor detection works -UNITY_C_ONLY =-c ../src/unity.c -o $(BUILD_DIR)/unity.o -intDetection: - $(CC) $(CFLAGS) $(INC_DIR) $(UNITY_C_ONLY) -D UNITY_EXCLUDE_STDINT_H - $(CC) $(CFLAGS) $(INC_DIR) $(UNITY_C_ONLY) -D UNITY_EXCLUDE_LIMITS_H - -$(BUILD_DIR)/test_unity_arraysRunner.c: tests/test_unity_arrays.c | $(BUILD_DIR) - awk $(AWK_SCRIPT) tests/test_unity_arrays.c > $@ - -$(BUILD_DIR)/test_unity_coreRunner.c: tests/test_unity_core.c | $(BUILD_DIR) - awk $(AWK_SCRIPT) tests/test_unity_core.c > $@ - -$(BUILD_DIR)/test_unity_doublesRunner.c: tests/test_unity_doubles.c | $(BUILD_DIR) - awk $(AWK_SCRIPT) tests/test_unity_doubles.c > $@ - -$(BUILD_DIR)/test_unity_floatsRunner.c: tests/test_unity_floats.c | $(BUILD_DIR) - awk $(AWK_SCRIPT) tests/test_unity_floats.c > $@ - -$(BUILD_DIR)/test_unity_integersRunner.c: tests/test_unity_integers.c | $(BUILD_DIR) - awk $(AWK_SCRIPT) tests/test_unity_integers.c > $@ - -$(BUILD_DIR)/test_unity_integers_64Runner.c: tests/test_unity_integers_64.c | $(BUILD_DIR) - awk $(AWK_SCRIPT) tests/test_unity_integers_64.c > $@ - -$(BUILD_DIR)/test_unity_memoryRunner.c: tests/test_unity_memory.c | $(BUILD_DIR) - awk $(AWK_SCRIPT) tests/test_unity_memory.c > $@ - -$(BUILD_DIR)/test_unity_stringsRunner.c: tests/test_unity_strings.c | $(BUILD_DIR) - awk $(AWK_SCRIPT) tests/test_unity_strings.c > $@ - -AWK_SCRIPT=\ - '/^void test/{ declarations[d++]=$$0; gsub(/\(?void\)? ?/,""); tests[t++]=$$0; line[u++]=NR } \ - END{ print "\#include \"unity.h\" /* Autogenerated by awk in Makefile */" ; \ - for (i=0; i -#include -#include "CException.h" -#include "funky.h" -#include "stanky.h" -#include - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); -extern void test_TheThirdThingToTest(void); -extern void test_TheFourthThingToTest(void); - - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/testsample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - RUN_TEST(test_TheThirdThingToTest, 53); - RUN_TEST(test_TheFourthThingToTest, 58); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_def.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_def.c deleted file mode 100644 index b8ad559f6..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_def.c +++ /dev/null @@ -1,57 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "funky.h" -#include "stanky.h" -#include - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); -extern void test_TheThirdThingToTest(void); -extern void test_TheFourthThingToTest(void); - - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/testsample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - RUN_TEST(test_TheThirdThingToTest, 53); - RUN_TEST(test_TheFourthThingToTest, 58); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.c deleted file mode 100644 index 1d01551e8..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.c +++ /dev/null @@ -1,55 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "testsample_head1.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); -extern void test_TheThirdThingToTest(void); -extern void test_TheFourthThingToTest(void); - - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/testsample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - RUN_TEST(test_TheThirdThingToTest, 53); - RUN_TEST(test_TheFourthThingToTest, 58); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.h b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.h deleted file mode 100644 index da6b7ab26..000000000 --- a/components/testframework/libs/cmock/vendor/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/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c deleted file mode 100644 index 45a09af22..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +++ /dev/null @@ -1,80 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - CMock_Init(); \ - UNITY_CLR_DETAILS(); \ - if (TEST_PROTECT()) \ - { \ - CEXCEPTION_T e; \ - Try { \ - setUp(); \ - TestFunc(); \ - } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - CMock_Verify(); \ - } \ - CMock_Destroy(); \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include "cmock.h" -#include -#include -#include "CException.h" -#include "funky.h" -#include -#include "Mockstanky.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); - - -/*=======Mock Management=====*/ -static void CMock_Init(void) -{ - Mockstanky_Init(); -} -static void CMock_Verify(void) -{ - Mockstanky_Verify(); -} -static void CMock_Destroy(void) -{ - Mockstanky_Destroy(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - CMock_Verify(); - CMock_Destroy(); - tearDown(); - CMock_Init(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/mocksample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - - CMock_Guts_MemFreeFinal(); - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_def.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_def.c deleted file mode 100644 index a7a26078b..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +++ /dev/null @@ -1,76 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - CMock_Init(); \ - UNITY_CLR_DETAILS(); \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - CMock_Verify(); \ - } \ - CMock_Destroy(); \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include "cmock.h" -#include -#include -#include "funky.h" -#include -#include "Mockstanky.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); - - -/*=======Mock Management=====*/ -static void CMock_Init(void) -{ - Mockstanky_Init(); -} -static void CMock_Verify(void) -{ - Mockstanky_Verify(); -} -static void CMock_Destroy(void) -{ - Mockstanky_Destroy(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - CMock_Verify(); - CMock_Destroy(); - tearDown(); - CMock_Init(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/mocksample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - - CMock_Guts_MemFreeFinal(); - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c deleted file mode 100644 index 45829fe7e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c +++ /dev/null @@ -1,75 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - CMock_Init(); \ - UNITY_CLR_DETAILS(); \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - CMock_Verify(); \ - } \ - CMock_Destroy(); \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include "cmock.h" -#include -#include -#include "testsample_mock_head1.h" -#include "Mockstanky.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); - - -/*=======Mock Management=====*/ -static void CMock_Init(void) -{ - Mockstanky_Init(); -} -static void CMock_Verify(void) -{ - Mockstanky_Verify(); -} -static void CMock_Destroy(void) -{ - Mockstanky_Destroy(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - CMock_Verify(); - CMock_Destroy(); - tearDown(); - CMock_Init(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/mocksample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - - CMock_Guts_MemFreeFinal(); - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h deleted file mode 100644 index 30c509ad0..000000000 --- a/components/testframework/libs/cmock/vendor/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/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c deleted file mode 100644 index 0061822e5..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +++ /dev/null @@ -1,89 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - CMock_Init(); \ - UNITY_CLR_DETAILS(); \ - if (TEST_PROTECT()) \ - { \ - CEXCEPTION_T e; \ - Try { \ - setUp(); \ - TestFunc(); \ - } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - CMock_Verify(); \ - } \ - CMock_Destroy(); \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include "cmock.h" -#include -#include -#include "CException.h" -#include "one.h" -#include "two.h" -#include "funky.h" -#include -#include "Mockstanky.h" - -int GlobalExpectCount; -int GlobalVerifyOrder; -char* GlobalOrderError; - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); - - -/*=======Mock Management=====*/ -static void CMock_Init(void) -{ - GlobalExpectCount = 0; - GlobalVerifyOrder = 0; - GlobalOrderError = NULL; - Mockstanky_Init(); -} -static void CMock_Verify(void) -{ - Mockstanky_Verify(); -} -static void CMock_Destroy(void) -{ - Mockstanky_Destroy(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - CMock_Verify(); - CMock_Destroy(); - tearDown(); - CMock_Init(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/mocksample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - - CMock_Guts_MemFreeFinal(); - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c deleted file mode 100644 index ee63cdc0b..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - CMock_Init(); \ - UNITY_CLR_DETAILS(); \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - CMock_Verify(); \ - } \ - CMock_Destroy(); \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include "cmock.h" -#include -#include -#include "funky.h" -#include -#include "Mockstanky.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); - - -/*=======Mock Management=====*/ -static void CMock_Init(void) -{ - Mockstanky_Init(); -} -static void CMock_Verify(void) -{ - Mockstanky_Verify(); -} -static void CMock_Destroy(void) -{ - Mockstanky_Destroy(); -} - -/*=======Suite Setup=====*/ -static int suite_setup(void) -{ -a_custom_setup(); -} - -/*=======Suite Teardown=====*/ -static int suite_teardown(int num_failures) -{ -a_custom_teardown(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - CMock_Verify(); - CMock_Destroy(); - tearDown(); - CMock_Init(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - suite_setup(); - UnityBegin("testdata/mocksample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - - CMock_Guts_MemFreeFinal(); - return suite_teardown(UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_param.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_param.c deleted file mode 100644 index a42b7deae..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +++ /dev/null @@ -1,77 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST_NO_ARGS -#define RUN_TEST(TestFunc, TestLineNum, ...) \ -{ \ - Unity.CurrentTestName = #TestFunc "(" #__VA_ARGS__ ")"; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - CMock_Init(); \ - UNITY_CLR_DETAILS(); \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(__VA_ARGS__); \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - CMock_Verify(); \ - } \ - CMock_Destroy(); \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include "cmock.h" -#include -#include -#include "funky.h" -#include -#include "Mockstanky.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); - - -/*=======Mock Management=====*/ -static void CMock_Init(void) -{ - Mockstanky_Init(); -} -static void CMock_Verify(void) -{ - Mockstanky_Verify(); -} -static void CMock_Destroy(void) -{ - Mockstanky_Destroy(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - CMock_Verify(); - CMock_Destroy(); - tearDown(); - CMock_Init(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/mocksample.c"); - RUN_TEST(test_TheFirstThingToTest, 21, RUN_TEST_NO_ARGS); - RUN_TEST(test_TheSecondThingToTest, 43, RUN_TEST_NO_ARGS); - - CMock_Guts_MemFreeFinal(); - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c deleted file mode 100644 index 0061822e5..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +++ /dev/null @@ -1,89 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - CMock_Init(); \ - UNITY_CLR_DETAILS(); \ - if (TEST_PROTECT()) \ - { \ - CEXCEPTION_T e; \ - Try { \ - setUp(); \ - TestFunc(); \ - } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - CMock_Verify(); \ - } \ - CMock_Destroy(); \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include "cmock.h" -#include -#include -#include "CException.h" -#include "one.h" -#include "two.h" -#include "funky.h" -#include -#include "Mockstanky.h" - -int GlobalExpectCount; -int GlobalVerifyOrder; -char* GlobalOrderError; - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); - - -/*=======Mock Management=====*/ -static void CMock_Init(void) -{ - GlobalExpectCount = 0; - GlobalVerifyOrder = 0; - GlobalOrderError = NULL; - Mockstanky_Init(); -} -static void CMock_Verify(void) -{ - Mockstanky_Verify(); -} -static void CMock_Destroy(void) -{ - Mockstanky_Destroy(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - CMock_Verify(); - CMock_Destroy(); - tearDown(); - CMock_Init(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/mocksample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - - CMock_Guts_MemFreeFinal(); - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c deleted file mode 100644 index ee63cdc0b..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - CMock_Init(); \ - UNITY_CLR_DETAILS(); \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - CMock_Verify(); \ - } \ - CMock_Destroy(); \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include "cmock.h" -#include -#include -#include "funky.h" -#include -#include "Mockstanky.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); - - -/*=======Mock Management=====*/ -static void CMock_Init(void) -{ - Mockstanky_Init(); -} -static void CMock_Verify(void) -{ - Mockstanky_Verify(); -} -static void CMock_Destroy(void) -{ - Mockstanky_Destroy(); -} - -/*=======Suite Setup=====*/ -static int suite_setup(void) -{ -a_custom_setup(); -} - -/*=======Suite Teardown=====*/ -static int suite_teardown(int num_failures) -{ -a_custom_teardown(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - CMock_Verify(); - CMock_Destroy(); - tearDown(); - CMock_Init(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - suite_setup(); - UnityBegin("testdata/mocksample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - - CMock_Guts_MemFreeFinal(); - return suite_teardown(UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c deleted file mode 100644 index a24bb5a57..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +++ /dev/null @@ -1,90 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - CMock_Init(); \ - UNITY_CLR_DETAILS(); \ - if (TEST_PROTECT()) \ - { \ - CEXCEPTION_T e; \ - Try { \ - setUp(); \ - TestFunc(); \ - } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - CMock_Verify(); \ - } \ - CMock_Destroy(); \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include "cmock.h" -#include -#include -#include "CException.h" -#include "two.h" -#include "three.h" -#include -#include "funky.h" -#include -#include "Mockstanky.h" - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); - - -/*=======Mock Management=====*/ -static void CMock_Init(void) -{ - Mockstanky_Init(); -} -static void CMock_Verify(void) -{ - Mockstanky_Verify(); -} -static void CMock_Destroy(void) -{ - Mockstanky_Destroy(); -} - -/*=======Suite Setup=====*/ -static int suite_setup(void) -{ -a_yaml_setup(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - CMock_Verify(); - CMock_Destroy(); - tearDown(); - CMock_Init(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - suite_setup(); - UnityBegin("testdata/mocksample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - - CMock_Guts_MemFreeFinal(); - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new1.c deleted file mode 100644 index 7dcd3fdfe..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new1.c +++ /dev/null @@ -1,67 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - CEXCEPTION_T e; \ - Try { \ - setUp(); \ - TestFunc(); \ - } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "CException.h" -#include "one.h" -#include "two.h" -#include "funky.h" -#include "stanky.h" -#include - -int GlobalExpectCount; -int GlobalVerifyOrder; -char* GlobalOrderError; - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); -extern void test_TheThirdThingToTest(void); -extern void test_TheFourthThingToTest(void); - - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/testsample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - RUN_TEST(test_TheThirdThingToTest, 53); - RUN_TEST(test_TheFourthThingToTest, 58); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new2.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new2.c deleted file mode 100644 index c98c697f5..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new2.c +++ /dev/null @@ -1,70 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "funky.h" -#include "stanky.h" -#include - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); -extern void test_TheThirdThingToTest(void); -extern void test_TheFourthThingToTest(void); - - -/*=======Suite Setup=====*/ -static int suite_setup(void) -{ -a_custom_setup(); -} - -/*=======Suite Teardown=====*/ -static int suite_teardown(int num_failures) -{ -a_custom_teardown(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - suite_setup(); - UnityBegin("testdata/testsample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - RUN_TEST(test_TheThirdThingToTest, 53); - RUN_TEST(test_TheFourthThingToTest, 58); - - return suite_teardown(UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_param.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_param.c deleted file mode 100644 index adf6c2626..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_param.c +++ /dev/null @@ -1,58 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST_NO_ARGS -#define RUN_TEST(TestFunc, TestLineNum, ...) \ -{ \ - Unity.CurrentTestName = #TestFunc "(" #__VA_ARGS__ ")"; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(__VA_ARGS__); \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "funky.h" -#include "stanky.h" -#include - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); -extern void test_TheThirdThingToTest(void); -extern void test_TheFourthThingToTest(void); - - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/testsample.c"); - RUN_TEST(test_TheFirstThingToTest, 21, RUN_TEST_NO_ARGS); - RUN_TEST(test_TheSecondThingToTest, 43, RUN_TEST_NO_ARGS); - RUN_TEST(test_TheThirdThingToTest, 53, RUN_TEST_NO_ARGS); - RUN_TEST(test_TheFourthThingToTest, 58, RUN_TEST_NO_ARGS); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run1.c deleted file mode 100644 index 7dcd3fdfe..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run1.c +++ /dev/null @@ -1,67 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - CEXCEPTION_T e; \ - Try { \ - setUp(); \ - TestFunc(); \ - } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "CException.h" -#include "one.h" -#include "two.h" -#include "funky.h" -#include "stanky.h" -#include - -int GlobalExpectCount; -int GlobalVerifyOrder; -char* GlobalOrderError; - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); -extern void test_TheThirdThingToTest(void); -extern void test_TheFourthThingToTest(void); - - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("testdata/testsample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - RUN_TEST(test_TheThirdThingToTest, 53); - RUN_TEST(test_TheFourthThingToTest, 58); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run2.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run2.c deleted file mode 100644 index c98c697f5..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run2.c +++ /dev/null @@ -1,70 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - setUp(); \ - TestFunc(); \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "funky.h" -#include "stanky.h" -#include - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); -extern void test_TheThirdThingToTest(void); -extern void test_TheFourthThingToTest(void); - - -/*=======Suite Setup=====*/ -static int suite_setup(void) -{ -a_custom_setup(); -} - -/*=======Suite Teardown=====*/ -static int suite_teardown(int num_failures) -{ -a_custom_teardown(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - suite_setup(); - UnityBegin("testdata/testsample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - RUN_TEST(test_TheThirdThingToTest, 53); - RUN_TEST(test_TheFourthThingToTest, 58); - - return suite_teardown(UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_yaml.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_yaml.c deleted file mode 100644 index 3316024df..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_yaml.c +++ /dev/null @@ -1,71 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Test Runner Used To Run Each Test Below=====*/ -#define RUN_TEST(TestFunc, TestLineNum) \ -{ \ - Unity.CurrentTestName = #TestFunc; \ - Unity.CurrentTestLineNumber = TestLineNum; \ - Unity.NumberOfTests++; \ - if (TEST_PROTECT()) \ - { \ - CEXCEPTION_T e; \ - Try { \ - setUp(); \ - TestFunc(); \ - } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ - } \ - if (TEST_PROTECT() && !TEST_IS_IGNORED) \ - { \ - tearDown(); \ - } \ - UnityConcludeTest(); \ -} - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" -#include -#include -#include "CException.h" -#include "two.h" -#include "three.h" -#include -#include "funky.h" -#include "stanky.h" -#include - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_TheFirstThingToTest(void); -extern void test_TheSecondThingToTest(void); -extern void test_TheThirdThingToTest(void); -extern void test_TheFourthThingToTest(void); - - -/*=======Suite Setup=====*/ -static int suite_setup(void) -{ -a_yaml_setup(); -} - -/*=======Test Reset Option=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - setUp(); -} - - -/*=======MAIN=====*/ -int main(void) -{ - suite_setup(); - UnityBegin("testdata/testsample.c"); - RUN_TEST(test_TheFirstThingToTest, 21); - RUN_TEST(test_TheSecondThingToTest, 43); - RUN_TEST(test_TheThirdThingToTest, 53); - RUN_TEST(test_TheFourthThingToTest, 58); - - return (UnityEnd()); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/rakefile b/components/testframework/libs/cmock/vendor/unity/test/rakefile deleted file mode 100644 index e5f3b748f..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/rakefile +++ /dev/null @@ -1,163 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -$verbose = false -$extra_paths = [] - -require 'rake' -require 'rake/clean' -require_relative 'rakefile_helper' -require 'rspec/core/rake_task' - -TEMP_DIRS = [ - File.join(__dir__, 'build'), - File.join(__dir__, 'sandbox') -] - -TEMP_DIRS.each do |dir| - directory(dir) - CLOBBER.include(dir) -end - -task :prepare_for_tests => TEMP_DIRS - -include RakefileHelpers - -# Load proper GCC as defult configuration -DEFAULT_CONFIG_FILE = 'gcc_auto_stdint.yml' -configure_toolchain(DEFAULT_CONFIG_FILE) - -############# ALL THE SELF-TESTS WE CAN PERFORM -namespace :test do - desc "Build and test Unity" - task :all => [:clean, :prepare_for_tests, 'test:scripts', 'test:unit', :style, 'test:fixture', 'test:memory', 'test:summary'] - task :ci => [:clean, :prepare_for_tests, 'test:scripts', 'test:unit', :style, 'test:make', 'test:fixture', 'test:memory', 'test:summary'] - - desc "Test unity with its own unit tests" - task :unit => [:prepare_for_tests] do - run_tests unit_test_files - end - - namespace :unit do - unit_test_files.each do |f| - desc "test this unit only" - task File.basename(f,'.c').sub('test_unity_','') => [:prepare_for_tests] do - run_tests [f] - end - end - end - - desc "Test unity's helper scripts" - task :scripts => [:prepare_for_tests] do - Dir['tests/test_*.rb'].each do |scriptfile| - require "./"+scriptfile - end - end - - desc "Test unity triggered from make" - task :make => [:prepare_for_tests] do - run_make_tests() - end - - desc "Test unity fixture addon" - task :fixture => [:prepare_for_tests] do - test_fixtures() - end - - desc "Test unity memory addon" - task :memory => [:prepare_for_tests] do - test_memory() - end - - desc "Test unity examples" - task :examples => [:prepare_for_tests] do - execute("cd ../examples/example_1 && make -s ci", false) - execute("cd ../examples/example_2 && make -s ci", false) - execute("cd ../examples/example_3 && rake", false) - end - - desc "Run all rspecs" - RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = 'spec/**/*_spec.rb' - end - - desc "Generate test summary" - task :summary do - report_summary - end -end - -###################### Shorthand for many common tasks -task :ci => ['test:ci'] -task :all => ['test:all'] -task :default => [:clobber, :all] - -desc "Load configuration" -task :config, :config_file do |t, args| - configure_toolchain(args[:config_file]) -end - -task :no_color do - $colour_output = false -end - -task :verbose do - $verbose = true -end - -################### CODING STYLE VALIDATION -namespace :style do - desc "Check style" - task :check do - report "\nVERIFYING RUBY STYLE" - report execute("rubocop ../auto ../examples ../extras --config .rubocop.yml", true) - report "Styling Ruby:PASS" - end - - namespace :check do - Dir['../**/*.rb'].each do |f| - filename = File.basename(f, '.rb') - #desc "Check Style of #{filename}" - task filename.to_sym => ['style:clean'] do - report execute("rubocop #{f} --color --config .rubocop.yml", true) - report "Style Checked for #{f}" - end - end - end - - desc "Fix Style of all C Code" - task :c do - run_astyle("../src/*.* ../extras/fixture/src/*.*") - end - - namespace :c do - Dir['../{src,extras/**}/*.{c,h}'].each do |f| - filename = File.basename(f)[0..-3] - #desc "Check Style of #{filename}" - task filename.to_sym do - run_astyle f - end - end - end - - desc "Attempt to Autocorrect style" - task :auto => ['style:clean'] do - execute("rubocop ../auto ../examples ../extras --auto-correct --config .rubocop.yml") - report "Autocorrected What We Could." - end - - desc "Update style todo list" - task :todo => ['style:clean'] do - execute("rubocop ../auto ../examples ../extras --auto-gen-config --config .rubocop.yml") - report "Updated Style TODO List." - end - - task :clean do - File.delete(".rubocop_todo.yml") if File.exists?(".rubocop_todo.yml") - end -end - -task :style => ['style:check'] diff --git a/components/testframework/libs/cmock/vendor/unity/test/rakefile_helper.rb b/components/testframework/libs/cmock/vendor/unity/test/rakefile_helper.rb deleted file mode 100644 index e205bc67d..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/rakefile_helper.rb +++ /dev/null @@ -1,315 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -require 'yaml' -require 'fileutils' -require_relative '../auto/unity_test_summary' -require_relative '../auto/generate_test_runner' -require_relative '../auto/colour_reporter' - -module RakefileHelpers - C_EXTENSION = '.c'.freeze - def load_configuration(config_file) - return if $configured - - $cfg_file = "targets/#{config_file}" unless config_file =~ /[\\|\/]/ - $cfg = YAML.load(File.read($cfg_file)) - $colour_output = false unless $cfg['colour'] - $configured = true if config_file != DEFAULT_CONFIG_FILE - end - - def configure_clean - CLEAN.include('build/*.*') - end - - def configure_toolchain(config_file = DEFAULT_CONFIG_FILE) - config_file += '.yml' unless config_file =~ /\.yml$/ - config_file = config_file unless config_file =~ /[\\|\/]/ - load_configuration(config_file) - configure_clean - end - - def unit_test_files - path = 'tests/test*' + C_EXTENSION - path.tr!('\\', '/') - FileList.new(path) - end - - def local_include_dirs - include_dirs = $cfg[:paths][:includes] || [] - include_dirs += $cfg[:paths][:source] || [] - include_dirs += $cfg[:paths][:test] || [] - include_dirs += $cfg[:paths][:support] || [] - include_dirs.delete_if { |dir| dir.is_a?(Array) } - include_dirs - end - - def extract_headers(filename) - includes = [] - lines = File.readlines(filename) - lines.each do |line| - m = line.match(/^\s*#include\s+\"\s*(.+\.[hH])\s*\"/) - includes << m[1] unless m.nil? - end - includes - end - - def find_source_file(header, paths) - paths.each do |dir| - src_file = dir + header.ext(C_EXTENSION) - return src_file if File.exist?(src_file) - end - nil - end - - def tackit(strings) - result = if strings.is_a?(Array) - "\"#{strings.join}\"" - else - strings - end - result - end - - def squash(prefix, items) - result = '' - items.each { |item| result += " #{prefix}#{tackit(item)}" } - result - end - - def should(behave, &block) - if block - puts 'Should ' + behave - yield block - else - puts "UNIMPLEMENTED CASE: Should #{behave}" - end - end - - def build_command_string(hash, values, defines = nil) - - # Replace named and numbered slots - args = [] - hash[:arguments].each do |arg| - if arg.include? '$' - if arg.include? ': COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - pattern = arg.gsub(': COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE','') - [ File.join('..','src') ].each do |f| - args << pattern.gsub(/\$/,f) - end - - elsif arg.include? ': COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - pattern = arg.gsub(': COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR','') - [ $extra_paths, 'src', File.join('tests'), File.join('testdata'), $cfg[:paths][:support] ].flatten.uniq.compact.each do |f| - args << pattern.gsub(/\$/,f) - end - - elsif arg.include? ': COLLECTION_DEFINES_TEST_AND_VENDOR' - pattern = arg.gsub(': COLLECTION_DEFINES_TEST_AND_VENDOR','') - [ $cfg[:defines][:test], defines ].flatten.uniq.compact.each do |f| - args << pattern.gsub(/\$/,f) - end - - elsif arg =~ /\$\{(\d+)\}/ - i = $1.to_i - 1 - if (values[i].is_a?(Array)) - values[i].each {|v| args << arg.gsub(/\$\{\d+\}/, v)} - else - args << arg.gsub(/\$\{(\d)+\}/, values[i] || '') - end - - else - args << arg - - end - else - args << arg - end - end - - # Build Command - return tackit(hash[:executable]) + squash('', args) - end - - def compile(file, defines = []) - out_file = File.join('build', File.basename(file, C_EXTENSION)) + $cfg[:extension][:object] - cmd_str = build_command_string( $cfg[:tools][:test_compiler], [ file, out_file ], defines ) - execute(cmd_str) - out_file - end - - def link_it(exe_name, obj_list) - exe_name = File.join('build', File.basename(exe_name)) - cmd_str = build_command_string( $cfg[:tools][:test_linker], [ obj_list, exe_name ] ) - execute(cmd_str) - end - - def runtest(bin_name, ok_to_fail = false, extra_args = nil) - bin_name = File.join('build', File.basename(bin_name)) - extra_args = extra_args.nil? ? "" : " " + extra_args - if $cfg[:tools][:test_fixture] - cmd_str = build_command_string( $cfg[:tools][:test_fixture], [ bin_name, extra_args ] ) - else - cmd_str = bin_name + extra_args - end - execute(cmd_str, ok_to_fail) - end - - def run_astyle(style_what) - report "Styling C Code..." - command = "AStyle " \ - "--style=allman --indent=spaces=4 --indent-switches --indent-preproc-define --indent-preproc-block " \ - "--pad-oper --pad-comma --unpad-paren --pad-header " \ - "--align-pointer=type --align-reference=name " \ - "--add-brackets --mode=c --suffix=none " \ - "#{style_what}" - execute(command, false) - report "Styling C:PASS" - end - - def execute(command_string, ok_to_fail = false) - report command_string if $verbose - output = `#{command_string}`.chomp - report(output) if $verbose && !output.nil? && !output.empty? - raise "Command failed. (Returned #{$?.exitstatus})" if !$?.nil? && !$?.exitstatus.zero? && !ok_to_fail - output - end - - def report_summary - summary = UnityTestSummary.new - summary.root = __dir__ - results_glob = File.join('build','*.test*') - results_glob.tr!('\\', '/') - results = Dir[results_glob] - summary.targets = results - report summary.run - end - - def save_test_results(test_base, output) - test_results = File.join('build',test_base) - if output.match(/OK$/m).nil? - test_results += '.testfail' - else - report output unless $verbose # Verbose already prints this line, as does a failure - test_results += '.testpass' - end - File.open(test_results, 'w') { |f| f.print output } - end - - def test_fixtures() - report "\nRunning Fixture Addon" - - # Get a list of all source files needed - src_files = Dir[File.join('..','extras','fixture','src','*.c')] - src_files += Dir[File.join('..','extras','fixture','test','*.c')] - src_files += Dir[File.join('..','extras','fixture','test','main','*.c')] - src_files += Dir[File.join('..','extras','memory','src','*.c')] - src_files << File.join('..','src','unity.c') - - # Build object files - $extra_paths = [File.join('..','extras','fixture','src'), File.join('..','extras','memory','src')] - obj_list = src_files.map { |f| compile(f, ['UNITY_SKIP_DEFAULT_RUNNER', 'UNITY_FIXTURE_NO_EXTRAS']) } - - # Link the test executable - test_base = File.basename('framework_test', C_EXTENSION) - link_it(test_base, obj_list) - - # Run and collect output - output = runtest(test_base + " -v -r") - save_test_results(test_base, output) - end - - def test_memory() - { 'w_malloc' => [], - 'wo_malloc' => ['UNITY_EXCLUDE_STDLIB_MALLOC'] - }.each_pair do |name, defs| - report "\nRunning Memory Addon #{name}" - - # Get a list of all source files needed - src_files = Dir[File.join('..','extras','memory','src','*.c')] - src_files += Dir[File.join('..','extras','memory','test','*.c')] - src_files += Dir[File.join('..','extras','memory','test','main','*.c')] - src_files << File.join('..','src','unity.c') - - # Build object files - $extra_paths = [File.join('..','extras','memory','src')] - obj_list = src_files.map { |f| compile(f, defs) } - - # Link the test executable - test_base = File.basename("memory_test_#{name}", C_EXTENSION) - link_it(test_base, obj_list) - - # Run and collect output - output = runtest(test_base) - save_test_results(test_base, output) - end - end - - def run_tests(test_files) - report "\nRunning Unity system tests" - - include_dirs = local_include_dirs - - # Build and execute each unit test - test_files.each do |test| - - # Drop Out if we're skipping this type of test - if $cfg[:skip_tests] - if $cfg[:skip_tests].include?(:parameterized) && test.match(/parameterized/) - report("Skipping Parameterized Tests for this Target:IGNORE") - next - end - end - - report "\nRunning Tests in #{test}" - obj_list = [] - test_defines = [] - - # Detect dependencies and build required modules - extract_headers(test).each do |header| - # Compile corresponding source file if it exists - src_file = find_source_file(header, include_dirs) - - obj_list << compile(src_file, test_defines) unless src_file.nil? - end - - # Build the test runner (generate if configured to do so) - test_base = File.basename(test, C_EXTENSION) - runner_name = test_base + '_Runner.c' - runner_path = File.join('build',runner_name) - - options = $cfg[:unity] - options[:use_param_tests] = test =~ /parameterized/ ? true : false - UnityTestRunnerGenerator.new(options).run(test, runner_path) - obj_list << compile(runner_path, test_defines) - - # Build the test module - obj_list << compile(test, test_defines) - - # Link the test executable - link_it(test_base, obj_list) - - # Execute unit test and generate results file - output = runtest(test_base) - save_test_results(test_base, output) - end - end - - def run_make_tests() - [ "make -s", # test with all defaults - "make -s DEBUG=-m32", # test 32-bit architecture with 64-bit support - "make -s DEBUG=-m32 UNITY_SUPPORT_64=", # test 32-bit build without 64-bit types - "make -s UNITY_INCLUDE_DOUBLE= ", # test without double - "cd #{File.join("..","extras","fixture",'test')} && make -s default noStdlibMalloc", - "cd #{File.join("..","extras","fixture",'test')} && make -s C89", - "cd #{File.join("..","extras","memory",'test')} && make -s default noStdlibMalloc", - "cd #{File.join("..","extras","memory",'test')} && make -s C89", - ].each do |cmd| - report "Testing '#{cmd}'" - execute(cmd, false) - end - end -end diff --git a/components/testframework/libs/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb b/components/testframework/libs/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb deleted file mode 100644 index 74e7fc840..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +++ /dev/null @@ -1,158 +0,0 @@ - -require '../auto/generate_module.rb' -require 'fileutils' - -def touch_src(file) - FileUtils.touch "sandbox/src/#{file}" -end - -def touch_test(file) - FileUtils.touch "sandbox/test/#{file}" -end - -def create_src_with_known_content(file) - File.open("sandbox/src/#{file}", "w") {|f| f.write("the original #{file}")} -end - -def create_test_with_known_content(file) - File.open("sandbox/test/#{file}", "w") {|f| f.write("the original #{file}")} -end - -def expect_src_content_didnt_change(file) - expect(File.read("sandbox/src/#{file}")).to eq("the original #{file}") -end - -def expect_test_content_didnt_change(file) - expect(File.read("sandbox/test/#{file}")).to eq("the original #{file}") -end - -def expect_src_file_to_exist(file) - expect(File.exist?("sandbox/src/#{file}")).to be true -end - -def expect_test_file_to_exist(file) - expect(File.exist?("sandbox/test/#{file}")).to be true -end - -describe "UnityModuleGenerator" do - - before do - # clean sandbox and setup our "project" folders - FileUtils.rm_rf "sandbox" - FileUtils.mkdir_p "sandbox" - FileUtils.mkdir_p "sandbox/src" - FileUtils.mkdir_p "sandbox/test" - - @options = { - :path_src => "sandbox/src", - :path_tst => "sandbox/test", - } - end - - context "with src pattern" do - before do - @options[:pattern] = "src" - end - - it "fails when all files already exist" do - # create an existing triad of files - touch_src "meh.c" - touch_src "meh.h" - touch_test "Testmeh.c" - expect { - UnityModuleGenerator.new(@options).generate("meh") - }.to raise_error("ERROR: File meh already exists. Exiting.") - end - - it "creates the test file if the source and header files exist" do - # Create the existing files. - touch_src "meh.c" - touch_src "meh.h" - - UnityModuleGenerator.new(@options).generate("meh") - - expect_test_file_to_exist "Testmeh.c" - end - - it "does not alter existing files" do - # Create some files with known content. - create_src_with_known_content "meh.c" - create_src_with_known_content "meh.h" - - UnityModuleGenerator.new(@options).generate("meh") - - expect_src_content_didnt_change "meh.c" - expect_src_content_didnt_change "meh.c" - end - - it "does not alter existing test files" do - # Create some files with known content. - create_test_with_known_content "Testmeh.c" - - UnityModuleGenerator.new(@options).generate("meh") - - expect_test_content_didnt_change "Testmeh.c" - end - - end - - context "with mch pattern" do - before do - @options[:pattern] = "mch" - end - - it "fails when all files exist" do - touch_src "meh_model.c" - touch_src "meh_conductor.c" - touch_src "meh_hardware.c" - touch_src "meh_model.h" - touch_src "meh_conductor.h" - touch_src "meh_hardware.h" - touch_test "Testmeh_model.c" - touch_test "Testmeh_conductor.c" - touch_test "Testmeh_hardware.c" - expect { - UnityModuleGenerator.new(@options).generate("meh") - }.to raise_error("ERROR: File meh_model already exists. Exiting.") - end - - it "creates files that don't exist" do - touch_src "meh_model.c" - touch_src "meh_conductor.c" - touch_src "meh_hardware.c" - touch_src "meh_model.h" - touch_src "meh_conductor.h" - - UnityModuleGenerator.new(@options).generate("meh") - - expect_src_file_to_exist "meh_hardware.h" - expect_test_file_to_exist "Testmeh_model.c" - expect_test_file_to_exist "Testmeh_conductor.c" - expect_test_file_to_exist "Testmeh_hardware.c" - end - - it "does not alter existing source files" do - create_src_with_known_content "meh_model.c" - create_src_with_known_content "meh_model.c" - create_src_with_known_content "meh_model.c" - create_src_with_known_content "meh_model.h" - create_src_with_known_content "meh_model.c" - - UnityModuleGenerator.new(@options).generate("meh") - - expect_src_content_didnt_change "meh_model.c" - expect_src_content_didnt_change "meh_model.c" - expect_src_content_didnt_change "meh_model.c" - expect_src_content_didnt_change "meh_model.c" - end - - it "does not alter existing test files" do - create_test_with_known_content "Testmeh_model.c" - - UnityModuleGenerator.new(@options).generate("meh") - - expect_test_content_didnt_change "Testmeh_model.c" - end - - end -end diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/ansi.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/ansi.yml deleted file mode 100644 index 81af4c7f5..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/ansi.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -colour: true -:unity: - :plugins: [] -:skip_tests: -- :parameterized -:tools: - :test_compiler: - :name: compiler - :executable: gcc - :arguments: - - "-c" - - "-m64" - - "-Wall" - - "-Wno-address" - - "-ansi" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: gcc - :arguments: - - "${1}" - - "-lm" - - "-m64" - - "-o ${2}" -:extension: - :object: ".o" - :executable: ".exe" -:paths: - :test: - - src/ - - "../src/" - - testdata/ - - tests/ -:defines: - :test: - - UNITY_INCLUDE_DOUBLE - - UNITY_SUPPORT_TEST_CASES - - UNITY_EXCLUDE_TESTING_NEW_COMMENTS - - UNITY_SUPPORT_64 diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/clang_file.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/clang_file.yml deleted file mode 100644 index 964e8145c..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/clang_file.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: clang - :arguments: - - "-c" - - "-Wall" - - "-Wextra" - - "-Werror" - - "-Wcast-qual" - - "-Wconversion" - - "-Wdisabled-optimization" - - "-Wformat=2" - - "-Winit-self" - - "-Winline" - - "-Winvalid-pch" - - "-Wmissing-include-dirs" - - "-Wnonnull" - - "-Wpacked" - - "-Wpointer-arith" - - "-Wswitch-default" - - "-Wstrict-aliasing" - - "-Wstrict-overflow=5" - - "-Wuninitialized" - - "-Wunused" - - "-Wreturn-type" - - "-Wshadow" - - "-Wundef" - - "-Wwrite-strings" - - "-Wno-nested-externs" - - "-Wno-unused-parameter" - - "-Wno-variadic-macros" - - "-Wbad-function-cast" - - "-fms-extensions" - - "-fno-omit-frame-pointer" - - "-ffloat-store" - - "-fno-common" - - "-fstrict-aliasing" - - "-std=gnu99" - - "-pedantic" - - "-O0" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: clang - :arguments: - - "${1}" - - "-lm" - - "-m64" - - "-o ${2}" -:extension: - :object: ".o" - :executable: ".exe" -:paths: - :test: - - src/ - - "../src/" - - testdata/ - - tests/ -:defines: - :test: - - UNITY_INCLUDE_DOUBLE - - UNITY_SUPPORT_64 - - UNITY_OUTPUT_RESULTS_FILE diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/clang_strict.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/clang_strict.yml deleted file mode 100644 index 04d568064..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/clang_strict.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: clang - :arguments: - - "-c" - - "-Wall" - - "-Wextra" - - "-Werror" - - "-Wcast-qual" - - "-Wconversion" - - "-Wdisabled-optimization" - - "-Wformat=2" - - "-Winit-self" - - "-Winline" - - "-Winvalid-pch" - - "-Wmissing-include-dirs" - - "-Wnonnull" - - "-Wpacked" - - "-Wpointer-arith" - - "-Wswitch-default" - - "-Wstrict-aliasing" - - "-Wstrict-overflow=5" - - "-Wuninitialized" - - "-Wunused" - - "-Wreturn-type" - - "-Wshadow" - - "-Wundef" - - "-Wwrite-strings" - - "-Wno-nested-externs" - - "-Wno-unused-parameter" - - "-Wno-variadic-macros" - - "-Wbad-function-cast" - - "-fms-extensions" - - "-fno-omit-frame-pointer" - - "-fno-common" - - "-fstrict-aliasing" - - "-std=gnu99" - - "-pedantic" - - "-O0" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: clang - :arguments: - - "${1}" - - "-lm" - - "-m64" - - "-o ${2}" -:extension: - :object: ".o" - :executable: ".exe" -:paths: - :test: - - src/ - - "../src/" - - testdata/ - - tests/ -:defines: - :test: - - UNITY_INCLUDE_DOUBLE - - UNITY_SUPPORT_TEST_CASES - - UNITY_SUPPORT_64 diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_32.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_32.yml deleted file mode 100644 index ba388cf72..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_32.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: gcc - :arguments: - - "-c" - - "-m32" - - "-Wall" - - "-Wno-address" - - "-std=c99" - - "-pedantic" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: gcc - :arguments: - - "${1}" - - "-lm" - - "-m32" - - "-o ${2}" -:extension: - :object: ".o" - :executable: ".exe" -:paths: - :test: - - src/ - - "../src/" - - testdata/ - - tests/ -:defines: - :test: - - UNITY_EXCLUDE_STDINT_H - - UNITY_EXCLUDE_LIMITS_H - - UNITY_INCLUDE_DOUBLE - - UNITY_SUPPORT_TEST_CASES - - UNITY_INT_WIDTH=32 - - UNITY_LONG_WIDTH=32 diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_64.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_64.yml deleted file mode 100644 index ed9eb4a80..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_64.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: gcc - :arguments: - - "-c" - - "-m64" - - "-Wall" - - "-Wno-address" - - "-std=c99" - - "-pedantic" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: gcc - :arguments: - - "${1}" - - "-lm" - - "-m64" - - "-o ${2}" -:extension: - :object: ".o" - :executable: ".exe" -:paths: - :test: - - src/ - - "../src/" - - testdata/ - - tests/ -:defines: - :test: - - UNITY_EXCLUDE_STDINT_H - - UNITY_EXCLUDE_LIMITS_H - - UNITY_INCLUDE_DOUBLE - - UNITY_SUPPORT_TEST_CASES - - UNITY_SUPPORT_64 - - UNITY_INT_WIDTH=32 - - UNITY_LONG_WIDTH=64 diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_limits.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_limits.yml deleted file mode 100644 index 9cfda8d4a..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: gcc - :arguments: - - "-c" - - "-m64" - - "-Wall" - - "-Wno-address" - - "-std=c99" - - "-pedantic" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: gcc - :arguments: - - "${1}" - - "-lm" - - "-m64" - - "-o ${2}" -:extension: - :object: ".o" - :executable: ".exe" -:paths: - :test: - - src/ - - "../src/" - - testdata/ - - tests/ -:defines: - :test: - - UNITY_EXCLUDE_STDINT_H - - UNITY_INCLUDE_DOUBLE - - UNITY_SUPPORT_TEST_CASES - - UNITY_SUPPORT_64 diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml deleted file mode 100644 index 66602ef71..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: gcc - :arguments: - - "-c" - - "-m64" - - "-Wall" - - "-Wno-address" - - "-std=c99" - - "-pedantic" - - "-Wextra" - - "-Werror" - - "-Wpointer-arith" - - "-Wcast-align" - - "-Wwrite-strings" - - "-Wswitch-default" - - "-Wunreachable-code" - - "-Winit-self" - - "-Wmissing-field-initializers" - - "-Wno-unknown-pragmas" - - "-Wstrict-prototypes" - - "-Wundef" - - "-Wold-style-definition" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: gcc - :arguments: - - "${1}" - - "-lm" - - "-m64" - - "-o ${2}" -:extension: - :object: ".o" - :executable: ".exe" -:paths: - :test: - - src/ - - "../src/" - - testdata/ - - tests/ -:defines: - :test: - - UNITY_INCLUDE_DOUBLE - - UNITY_SUPPORT_TEST_CASES - - UNITY_SUPPORT_64 diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_manual_math.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_manual_math.yml deleted file mode 100644 index b1b5b82e5..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_manual_math.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: gcc - :arguments: - - "-c" - - "-m64" - - "-Wall" - - "-Wno-address" - - "-std=c99" - - "-pedantic" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: gcc - :arguments: - - "${1}" - - "-lm" - - "-m64" - - "-o ${2}" -:extension: - :object: ".o" - :executable: ".exe" -:paths: - :test: - - src/ - - "../src/" - - testdata/ - - tests/ -:defines: - :test: - - UNITY_EXCLUDE_MATH_H - - UNITY_INCLUDE_DOUBLE - - UNITY_SUPPORT_TEST_CASES - - UNITY_SUPPORT_64 diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/hitech_picc18.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/hitech_picc18.yml deleted file mode 100644 index b984edbd8..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/hitech_picc18.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- -:cmock: - :plugins: [] - :includes: - - Types.h - :suite_teardown: | - if (num_failures) - _FAILED_TEST(); - else - _PASSED_TESTS(); - return 0; -colour: true -:tools: - :test_compiler: - :name: compiler - :executable: cd build && picc18 - :arguments: - - "--chip=18F87J10" - - "--ide=hitide" - - "--q" - - "--asmlist" - - "--codeoffset=0" - - "--emi=wordwrite" - - "--warn=0" - - "--errors=10" - - "--char=unsigned" - - "-Bl" - - "-G" - - "--cp=16" - - "--double=24" - - "-N255" - - "--opt=none" - - "-c" - - "-M" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - " ${2}" - :test_linker: - :name: linker - :executable: cd build && picc18 - :arguments: - - "${1}" - - "--chip=18F87J10" - - "--ide=hitide" - - "--cp=24" - - "--double=24" - - "-Lw" - - "--summary=mem,file" - - "--summary=+psect" - - "--summary=+hex" - - "--output=+intel" - - "--output=+mcof" - - "--runtime=+init" - - "--runtime=+clear" - - "--runtime=+clib" - - "--runtime=+keep" - - "-G" - - "-MIWasTheLastToBuild.map" - - "--warn=0" - - "-Bl" - - "-O ${2}" - :test_fixture: - :name: simulator - :executable: 'java -client -jar ' - :arguments: - - - C:\Program Files\HI-TECH Software\HI-TIDE\3.15\lib\ - - simpic18.jar - - 18F87J10 - - "${1}" -:extension: - :object: ".obj" - :executable: ".hex" -:paths: - :test: - - c:/Projects/NexGen/Prototypes/CMockTest/src/ - - c:/Projects/NexGen/Prototypes/CMockTest/mocks/ - - c:/CMock/src/ - - c:/CMock/examples/src/ - - c:/CMock/vendor/unity/src/ - - c:/CMock/vendor/unity/examples/helper/ - - tests\ -:defines: - :test: - - UNITY_INT_WIDTH=16 - - UNITY_POINTER_WIDTH=16 - - CMOCK_MEM_STATIC - - CMOCK_MEM_SIZE=3000 - - UNITY_SUPPORT_TEST_CASES - - _PICC18 diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v4.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v4.yml deleted file mode 100644 index 9a1a2761e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v4.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- -tools_root: C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - arm\bin\iccarm.exe - :arguments: - - "--dlib_config" - - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - arm\lib\dl4tptinl8n.h - - "-z3" - - "--no_cse" - - "--no_unroll" - - "--no_inline" - - "--no_code_motion" - - "--no_tbaa" - - "--no_clustering" - - "--no_scheduling" - - "--debug" - - "--cpu_mode thumb" - - "--endian little" - - "--cpu ARM7TDMI" - - "--stack_align 4" - - "--interwork" - - "-e" - - "--silent" - - "--warnings_are_errors" - - "--fpu None" - - "--diag_suppress Pa050" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - common\bin\xlink.exe - :arguments: - - "${1}" - - "-rt" - - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - arm\lib\dl4tptinl8n.r79 - - "-D_L_EXTMEM_START=0" - - "-D_L_EXTMEM_SIZE=0" - - "-D_L_HEAP_SIZE=120" - - "-D_L_STACK_SIZE=32" - - "-e_small_write=_formatted_write" - - "-s" - - __program_start - - "-f" - - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - "\\arm\\config\\lnkarm.xcl" - - "-o ${2}" - :test_fixture: - :name: simulator - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - common\bin\CSpyBat.exe - :arguments: - - "--silent" - - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - arm\bin\armproc.dll - - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - arm\bin\armsim.dll - - "${1}" - - "--plugin" - - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - arm\bin\armbat.dll - - "--backend" - - "-B" - - "-p" - - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - arm\config\ioat91sam7X256.ddf - - "-d" - - sim -:extension: - :object: ".r79" - :executable: ".d79" -:paths: - :test: - - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ - - arm\inc\ - - src\ - - "..\\src\\" - - testdata/ - - tests\ - - vendor\unity\src\ -:defines: - :test: - - UNITY_SUPPORT_64 - - UNITY_SUPPORT_TEST_CASES diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5.yml deleted file mode 100644 index d4b115f14..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5.yml +++ /dev/null @@ -1,92 +0,0 @@ ---- -tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.3\ -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\bin\iccarm.exe - :arguments: - - "--dlib_config" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\inc\DLib_Config_Normal.h - - "--no_cse" - - "--no_unroll" - - "--no_inline" - - "--no_code_motion" - - "--no_tbaa" - - "--no_clustering" - - "--no_scheduling" - - "--debug" - - "--cpu_mode thumb" - - "--endian=little" - - "--cpu=ARM7TDMI" - - "--interwork" - - "--warnings_are_errors" - - "--fpu=None" - - "--diag_suppress=Pa050" - - "--diag_suppress=Pe111" - - "-e" - - "-On" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\bin\ilinkarm.exe - :arguments: - - "${1}" - - "--redirect _Printf=_PrintfLarge" - - "--redirect _Scanf=_ScanfSmall" - - "--semihosting" - - "--entry __iar_program_start" - - "--config" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\config\generic.icf - - "-o ${2}" - :test_fixture: - :name: simulator - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - common\bin\CSpyBat.exe - :arguments: - - "--silent" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\bin\armproc.dll - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\bin\armsim.dll - - "${1}" - - "--plugin" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\bin\armbat.dll - - "--backend" - - "-B" - - "-p" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\config\debugger\atmel\ioat91sam7X256.ddf - - "-d" - - sim -:extension: - :object: ".r79" - :executable: ".out" -:paths: - :test: - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\inc\ - - src\ - - "..\\src\\" - - testdata/ - - tests\ - - vendor\unity\src\ - - iar\iar_v5\incIAR\ -:defines: - :test: - - UNITY_SUPPORT_64 - - UNITY_SUPPORT_TEST_CASES diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml deleted file mode 100644 index d4b115f14..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml +++ /dev/null @@ -1,92 +0,0 @@ ---- -tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.3\ -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\bin\iccarm.exe - :arguments: - - "--dlib_config" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\inc\DLib_Config_Normal.h - - "--no_cse" - - "--no_unroll" - - "--no_inline" - - "--no_code_motion" - - "--no_tbaa" - - "--no_clustering" - - "--no_scheduling" - - "--debug" - - "--cpu_mode thumb" - - "--endian=little" - - "--cpu=ARM7TDMI" - - "--interwork" - - "--warnings_are_errors" - - "--fpu=None" - - "--diag_suppress=Pa050" - - "--diag_suppress=Pe111" - - "-e" - - "-On" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\bin\ilinkarm.exe - :arguments: - - "${1}" - - "--redirect _Printf=_PrintfLarge" - - "--redirect _Scanf=_ScanfSmall" - - "--semihosting" - - "--entry __iar_program_start" - - "--config" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\config\generic.icf - - "-o ${2}" - :test_fixture: - :name: simulator - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - common\bin\CSpyBat.exe - :arguments: - - "--silent" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\bin\armproc.dll - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\bin\armsim.dll - - "${1}" - - "--plugin" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\bin\armbat.dll - - "--backend" - - "-B" - - "-p" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\config\debugger\atmel\ioat91sam7X256.ddf - - "-d" - - sim -:extension: - :object: ".r79" - :executable: ".out" -:paths: - :test: - - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ - - arm\inc\ - - src\ - - "..\\src\\" - - testdata/ - - tests\ - - vendor\unity\src\ - - iar\iar_v5\incIAR\ -:defines: - :test: - - UNITY_SUPPORT_64 - - UNITY_SUPPORT_TEST_CASES diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml deleted file mode 100644 index 1703fe27c..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -tools_root: C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ - - arm\bin\iccarm.exe - :arguments: - - "--diag_suppress=Pa050" - - "--debug" - - "--endian=little" - - "--cpu=Cortex-M3" - - "--no_path_in_file_macros" - - "-e" - - "--fpu=None" - - "--dlib_config" - - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ - - arm\inc\DLib_Config_Normal.h - - "--interwork" - - "--warnings_are_errors" - - "-Oh" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ - - arm\bin\ilinkarm.exe - :arguments: - - "${1}" - - "--redirect _Printf=_PrintfLarge" - - "--redirect _Scanf=_ScanfSmall" - - "--semihosting" - - "--entry __iar_program_start" - - "--config" - - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ - - arm\config\generic.icf - - "-o ${2}" - :test_fixture: - :name: simulator - :executable: - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ - - common\bin\CSpyBat.exe - :arguments: - - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ - - arm\bin\armproc.dll - - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ - - arm\bin\armsim2.dll - - "${1}" - - "--plugin" - - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ - - arm\bin\armbat.dll - - "--backend" - - "-B" - - "--endian=little" - - "--cpu=Cortex-M3" - - "--fpu=None" - - "-p" - - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ - - arm\config\debugger\TexasInstruments\iolm3sxxxx.ddf - - "--semihosting" - - "--device=LM3SxBxx" -:extension: - :object: ".r79" - :executable: ".out" -:paths: - :test: - - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ - - arm\inc\ - - src\ - - "..\\src\\" - - testdata/ - - tests\ - - vendor\unity\src\ - - iar\iar_v5\incIAR\ -:defines: - :test: - - ewarm - - PART_LM3S9B92 - - TARGET_IS_TEMPEST_RB1 - - USE_ROM_DRIVERS - - UART_BUFFERED - - UNITY_SUPPORT_64 diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml deleted file mode 100644 index 8b0978ffa..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml +++ /dev/null @@ -1,94 +0,0 @@ ---- -tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.4\ -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ - - arm\bin\iccarm.exe - :arguments: - - "--dlib_config" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ - - arm\inc\DLib_Config_Normal.h - - "--no_cse" - - "--no_unroll" - - "--no_inline" - - "--no_code_motion" - - "--no_tbaa" - - "--no_clustering" - - "--no_scheduling" - - "--debug" - - "--cpu_mode thumb" - - "--endian=little" - - "--cpu=Cortex-M3" - - "--interwork" - - "--warnings_are_errors" - - "--fpu=None" - - "--diag_suppress=Pa050" - - "--diag_suppress=Pe111" - - "-e" - - "-On" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ - - arm\bin\ilinkarm.exe - :arguments: - - "${1}" - - "--redirect _Printf=_PrintfLarge" - - "--redirect _Scanf=_ScanfSmall" - - "--semihosting" - - "--entry __iar_program_start" - - "--config" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ - - arm\config\generic_cortex.icf - - "-o ${2}" - :test_fixture: - :name: simulator - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ - - common\bin\CSpyBat.exe - :arguments: - - "--silent" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ - - arm\bin\armproc.dll - - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ - - arm\bin\armsim.dll - - "${1}" - - "--plugin" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ - - arm\bin\armbat.dll - - "--backend" - - "-B" - - "-p" - - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ - - arm\config\debugger\ST\iostm32f107xx.ddf - - "--cpu=Cortex-M3" - - "-d" - - sim -:extension: - :object: ".r79" - :executable: ".out" -:paths: - :test: - - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ - - arm\inc\ - - src\ - - "..\\src\\" - - testdata/ - - tests\ - - vendor\unity\src\ - - iar\iar_v5\incIAR\ -:defines: - :test: - - IAR - - UNITY_SUPPORT_64 - - UNITY_SUPPORT_TEST_CASES diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_msp430.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_msp430.yml deleted file mode 100644 index 65872535f..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_msp430.yml +++ /dev/null @@ -1,112 +0,0 @@ ---- -tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.3 MSP430\ -core_root: &1 -- C:\Program Files\IAR Systems\Embedded Workbench 5.3 MSP430\ -- 430\ -core_bin: &2 -- *1 -- bin\ -core_config: &4 -- *1 -- config\ -core_lib: &3 -- *1 -- lib\ -core_inc: &5 -- *1 -- inc\ -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: - - *2 - - icc430.exe - :arguments: - - "--dlib_config" - - - *3 - - dlib\dl430fn.h - - "--no_cse" - - "--no_unroll" - - "--no_inline" - - "--no_code_motion" - - "--no_tbaa" - - "--debug" - - "-e" - - "-Ol" - - "--multiplier=16" - - "--double=32" - - "--diag_suppress Pa050" - - "--diag_suppress Pe111" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: - - *2 - - xlink.exe - :arguments: - - "${1}" - - "-rt" - - - *3 - - dlib\dl430fn.r43 - - "-e_PrintfTiny=_Printf" - - "-e_ScanfSmall=_Scanf" - - "-s __program_start" - - "-D_STACK_SIZE=50" - - "-D_DATA16_HEAP_SIZE=50" - - "-D_DATA20_HEAP_SIZE=50" - - "-f" - - - *4 - - lnk430f5438.xcl - - "-f" - - - *4 - - multiplier.xcl - - "-o ${2}" - :test_fixture: - :name: simulator - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 5.3 MSP430\ - - common\bin\CSpyBat.exe - :arguments: - - "--silent" - - - *2 - - 430proc.dll - - - *2 - - 430sim.dll - - "${1}" - - "--plugin" - - - *2 - - 430bat.dll - - "--backend -B" - - "--cpu MSP430F5438" - - "-p" - - - *4 - - MSP430F5438.ddf - - "-d sim" -:extension: - :object: ".r43" - :executable: ".d79" -:paths: - :test: - - *5 - - - *5 - - dlib - - - *3 - - dlib - - src\ - - "../src/" - - testdata/ - - tests\ - - vendor\unity\src -:defines: - :test: - - __MSP430F149__ - - INT_WIDTH=16 - - UNITY_EXCLUDE_FLOAT - - UNITY_SUPPORT_TEST_CASES diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml deleted file mode 100644 index b4371cd0a..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml +++ /dev/null @@ -1,99 +0,0 @@ ---- -tools_root: C:\Program Files\IAR Systems\Embedded Workbench 6.0\ -colour: true -:unity: - :plugins: [] -:tools: - :test_compiler: - :name: compiler - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - sh\bin\iccsh.exe - :arguments: - - "-e" - - "--char_is_signed" - - "-Ol" - - "--no_cse" - - "--no_unroll" - - "--no_inline" - - "--no_code_motion" - - "--no_tbaa" - - "--no_scheduling" - - "--no_clustering" - - "--debug" - - "--dlib_config" - - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - sh\inc\DLib_Product.h - - "--double=32" - - "--code_model=huge" - - "--data_model=huge" - - "--core=sh2afpu" - - "--warnings_affect_exit_code" - - "--warnings_are_errors" - - "--mfc" - - "--use_unix_directory_separators" - - "--diag_suppress=Pe161" - - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' - - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' - - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" - - "${1}" - - "-o ${2}" - :test_linker: - :name: linker - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - sh\bin\ilinksh.exe - :arguments: - - "${1}" - - "--redirect __Printf=__PrintfSmall" - - "--redirect __Scanf=__ScanfSmall" - - "--config" - - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - sh\config\generic.icf - - "--config_def _CSTACK_SIZE=0x800" - - "--config_def _HEAP_SIZE=0x800" - - "--config_def _INT_TABLE=0x10" - - "--entry __iar_program_start" - - "--debug_lib" - - "-o ${2}" - :test_fixture: - :name: simulator - :executable: - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - common\bin\CSpyBat.exe - :arguments: - - "--silent" - - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - sh\bin\shproc.dll - - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - sh\bin\shsim.dll - - "${1}" - - "--plugin" - - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - sh\bin\shbat.dll - - "--backend" - - "-B" - - "--core sh2afpu" - - "-p" - - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - sh\config\debugger\io7264.ddf - - "-d" - - sim -:extension: - :object: ".o" - :executable: ".out" -:paths: - :test: - - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - sh\inc\ - - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ - - sh\inc\c - - src\ - - "..\\src\\" - - testdata/ - - tests\ - - vendor\unity\src\ -:defines: - :test: - - UNITY_SUPPORT_64 - - UNITY_SUPPORT_TEST_CASES diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/CException.h b/components/testframework/libs/cmock/vendor/unity/test/testdata/CException.h deleted file mode 100644 index 3872fa75f..000000000 --- a/components/testframework/libs/cmock/vendor/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 diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/Defs.h b/components/testframework/libs/cmock/vendor/unity/test/testdata/Defs.h deleted file mode 100644 index b1dc83e9b..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/testdata/Defs.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef DEF_H -#define DEF_H - -#define EXTERN_DECL - -extern int CounterSuiteSetup; - -#endif diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/cmock.h b/components/testframework/libs/cmock/vendor/unity/test/testdata/cmock.h deleted file mode 100644 index 33ddbfc56..000000000 --- a/components/testframework/libs/cmock/vendor/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 diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/mockMock.h b/components/testframework/libs/cmock/vendor/unity/test/testdata/mockMock.h deleted file mode 100644 index 5c6829d77..000000000 --- a/components/testframework/libs/cmock/vendor/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 diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGenerator.c b/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGenerator.c deleted file mode 100644 index b5dd97f5d..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGenerator.c +++ /dev/null @@ -1,189 +0,0 @@ -/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ - -#include -#include "unity.h" -#include "Defs.h" - -#ifdef USE_CEXCEPTION -#include "CException.h" -#endif - -/* Notes about prefixes: - test - normal default prefix. these are "always run" tests for this procedure - spec - normal default prefix. required to run default setup/teardown calls. - should - normal default prefix. - qwiktest - custom prefix for when tests skip all setup/teardown calls. - custtest - custom prefix for when tests use custom setup/teardown calls. - paratest - custom prefix for when we want to verify parameterized tests. - extest - custom prefix only used during cexception - suitetest- custom prefix for when we want to use custom suite setup/teardown -*/ - -/* Support for Meta Test Rig */ -#define TEST_CASE(a) - -/* Include Passthroughs for Linking Tests */ -void putcharSpy(int c) { (void)putchar(c);} -void flushSpy(void) {} - -/* Global Variables Used During These Tests */ -int CounterSetup = 0; -int CounterTeardown = 0; -int CounterSuiteSetup = 0; - -void setUp(void) -{ - CounterSetup = 1; -} - -void tearDown(void) -{ - CounterTeardown = 1; -} - -void custom_setup(void) -{ - CounterSetup = 2; -} - -void custom_teardown(void) -{ - CounterTeardown = 2; -} - -/* -void test_OldSchoolCommentsShouldBeIgnored(void) -{ - TEST_ASSERT_FAIL("Old-School Comments Should Be Ignored"); -} -*/ - -void test_ThisTestAlwaysPasses(void) -{ - TEST_PASS(); -} - -void test_ThisTestAlwaysFails(void) -{ - TEST_FAIL_MESSAGE("This Test Should Fail"); -} - -void test_ThisTestAlwaysIgnored(void) -{ - TEST_IGNORE_MESSAGE("This Test Should Be Ignored"); -} - -void qwiktest_ThisTestPassesWhenNoSetupRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(0, CounterSetup, "Setup Was Unexpectedly Run"); -} - -void qwiktest_ThisTestPassesWhenNoTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(0, CounterTeardown, "Teardown Was Unexpectedly Run"); -} - -void spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(0, CounterSuiteSetup, "Suite Setup Was Unexpectedly Run"); -} - -void spec_ThisTestPassesWhenNormalSetupRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run"); -} - -void spec_ThisTestPassesWhenNormalTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run"); -} - -void custtest_ThisTestPassesWhenCustomSetupRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(2, CounterSetup, "Custom Setup Wasn't Run"); -} - -void custtest_ThisTestPassesWhenCustomTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(2, CounterTeardown, "Custom Teardown Wasn't Run"); -} - -#ifndef UNITY_EXCLUDE_TESTING_NEW_COMMENTS -//void test_NewStyleCommentsShouldBeIgnored(void) -//{ -// TEST_ASSERT_FAIL("New Style Comments Should Be Ignored"); -//} -#endif - -void test_NotBeConfusedByLongComplicatedStrings(void) -{ - const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n"; - - TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are The Same"); -} - -/* The next test should still appear even though we have this confusing nested comment thing going on http://looks_like_comments.com */ -void test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings(void) -{ - TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True"); - /* still should not break anything */ -} -/* nor should this */ - -void test_StillNotBeConfusedByLongComplicatedStrings(void) -{ - const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n"; - - TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are Still The Same"); -} - -void should_RunTestsStartingWithShouldByDefault(void) -{ - TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True"); -} - -TEST_CASE(25) -TEST_CASE(125) -TEST_CASE(5) -void paratest_ShouldHandleParameterizedTests(int Num) -{ - TEST_ASSERT_EQUAL_MESSAGE(0, (Num % 5), "All The Values Are Divisible By 5"); -} - -TEST_CASE(7) -void paratest_ShouldHandleParameterizedTests2(int Num) -{ - TEST_ASSERT_EQUAL_MESSAGE(7, Num, "The Only Call To This Passes"); -} - -void paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid(void) -{ - TEST_PASS(); -} - -TEST_CASE(17) -void paratest_ShouldHandleParameterizedTestsThatFail(int Num) -{ - TEST_ASSERT_EQUAL_MESSAGE(3, Num, "This call should fail"); -} - -#ifdef USE_CEXCEPTION -void extest_ShouldHandleCExceptionInTest(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(1, CEXCEPTION_BEING_USED, "Should be pulling in CException"); -} -#endif - -#ifdef USE_ANOTHER_MAIN -int custom_main(void); - -int main(void) -{ - return custom_main(); -} -#endif - -void suitetest_ThisTestPassesWhenCustomSuiteSetupAndTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(1, CounterSuiteSetup, "Suite Setup Should Have Run"); -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c b/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c deleted file mode 100644 index c8aaf747e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +++ /dev/null @@ -1,70 +0,0 @@ -/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ - -#include -#include "unity.h" -#include "Defs.h" - -TEST_FILE("some_file.c") - -/* Notes about prefixes: - test - normal default prefix. these are "always run" tests for this procedure - spec - normal default prefix. required to run default setup/teardown calls. -*/ - -/* Support for Meta Test Rig */ -#define TEST_CASE(a) - -/* Include Passthroughs for Linking Tests */ -void putcharSpy(int c) { (void)putchar(c);} -void flushSpy(void) {} - -/* Global Variables Used During These Tests */ -int CounterSetup = 0; -int CounterTeardown = 0; -int CounterSuiteSetup = 0; - -void setUp(void) -{ - CounterSetup = 1; -} - -void tearDown(void) -{ - CounterTeardown = 1; -} - -void custom_setup(void) -{ - CounterSetup = 2; -} - -void custom_teardown(void) -{ - CounterTeardown = 2; -} - -void test_ThisTestAlwaysPasses(void) -{ - TEST_PASS(); -} - -void test_ThisTestAlwaysFails(void) -{ - TEST_FAIL_MESSAGE("This Test Should Fail"); -} - -void test_ThisTestAlwaysIgnored(void) -{ - TEST_IGNORE_MESSAGE("This Test Should Be Ignored"); -} - -void spec_ThisTestPassesWhenNormalSetupRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run"); -} - -void spec_ThisTestPassesWhenNormalTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run"); -} - diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c b/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c deleted file mode 100644 index aaceda446..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +++ /dev/null @@ -1,197 +0,0 @@ -/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ - -#include -#include "unity.h" -#include "Defs.h" -#include "mockMock.h" - -#ifdef USE_CEXCEPTION -#include "CException.h" -#endif - -/* Notes about prefixes: - test - normal default prefix. these are "always run" tests for this procedure - spec - normal default prefix. required to run default setup/teardown calls. - should - normal default prefix. - qwiktest - custom prefix for when tests skip all setup/teardown calls. - custtest - custom prefix for when tests use custom setup/teardown calls. - paratest - custom prefix for when we want to verify parameterized tests. - extest - custom prefix only used during cexception - suitetest- custom prefix for when we want to use custom suite setup/teardown -*/ - -/* Support for Meta Test Rig */ -#define TEST_CASE(a) - -/* Include Passthroughs for Linking Tests */ -void putcharSpy(int c) { (void)putchar(c);} -void flushSpy(void) {} - -/* Global Variables Used During These Tests */ -int CounterSetup = 0; -int CounterTeardown = 0; -int CounterSuiteSetup = 0; - -void setUp(void) -{ - CounterSetup = 1; -} - -void tearDown(void) -{ - CounterTeardown = 1; -} - -void custom_setup(void) -{ - CounterSetup = 2; -} - -void custom_teardown(void) -{ - CounterTeardown = 2; -} - -/* -void test_OldSchoolCommentsShouldBeIgnored(void) -{ - TEST_ASSERT_FAIL("Old-School Comments Should Be Ignored"); -} -*/ - -void test_ThisTestAlwaysPasses(void) -{ - TEST_PASS(); -} - -void test_ThisTestAlwaysFails(void) -{ - TEST_FAIL_MESSAGE("This Test Should Fail"); -} - -void test_ThisTestAlwaysIgnored(void) -{ - TEST_IGNORE_MESSAGE("This Test Should Be Ignored"); -} - -void qwiktest_ThisTestPassesWhenNoSetupRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(0, CounterSetup, "Setup Was Unexpectedly Run"); -} - -void qwiktest_ThisTestPassesWhenNoTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(0, CounterTeardown, "Teardown Was Unexpectedly Run"); -} - -void spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(0, CounterSuiteSetup, "Suite Setup Was Unexpectedly Run"); -} - -void spec_ThisTestPassesWhenNormalSetupRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run"); -} - -void spec_ThisTestPassesWhenNormalTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run"); -} - -void custtest_ThisTestPassesWhenCustomSetupRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(2, CounterSetup, "Custom Setup Wasn't Run"); -} - -void custtest_ThisTestPassesWhenCustomTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(2, CounterTeardown, "Custom Teardown Wasn't Run"); -} - -#ifndef UNITY_EXCLUDE_TESTING_NEW_COMMENTS -//void test_NewStyleCommentsShouldBeIgnored(void) -//{ -// TEST_ASSERT_FAIL("New Style Comments Should Be Ignored"); -//} -#endif - -void test_NotBeConfusedByLongComplicatedStrings(void) -{ - const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n"; - - TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are The Same"); -} - -void test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings(void) -{ - TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True"); -} - -void test_StillNotBeConfusedByLongComplicatedStrings(void) -{ - const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n"; - - TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are Still The Same"); -} - -void should_RunTestsStartingWithShouldByDefault(void) -{ - TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True"); -} - -TEST_CASE(25) -TEST_CASE(125) -TEST_CASE(5) -void paratest_ShouldHandleParameterizedTests(int Num) -{ - TEST_ASSERT_EQUAL_MESSAGE(0, (Num % 5), "All The Values Are Divisible By 5"); -} - -TEST_CASE(7) -void paratest_ShouldHandleParameterizedTests2(int Num) -{ - TEST_ASSERT_EQUAL_MESSAGE(7, Num, "The Only Call To This Passes"); -} - -void paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid(void) -{ - TEST_PASS(); -} - -TEST_CASE(17) -void paratest_ShouldHandleParameterizedTestsThatFail(int Num) -{ - TEST_ASSERT_EQUAL_MESSAGE(3, Num, "This call should fail"); -} - -#ifdef USE_CEXCEPTION -void extest_ShouldHandleCExceptionInTest(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(1, CEXCEPTION_BEING_USED, "Should be pulling in CException"); -} -#endif - -#ifdef USE_ANOTHER_MAIN -int custom_main(void); - -int main(void) -{ - return custom_main(); -} -#endif - -void suitetest_ThisTestPassesWhenCustomSuiteSetupAndTeardownRan(void) -{ - TEST_ASSERT_EQUAL_MESSAGE(1, CounterSuiteSetup, "Suite Setup Should Have Run"); -} - -void test_ShouldCallMockInitAndVerifyFunctionsForEachTest(void) -{ - int passesOrIgnores = (int)(Unity.NumberOfTests - Unity.TestFailures); - TEST_ASSERT_EQUAL_MESSAGE(Unity.NumberOfTests, mockMock_Init_Counter, "Mock Init Should Be Called Once Per Test Started"); - TEST_ASSERT_EQUAL_MESSAGE(passesOrIgnores, mockMock_Verify_Counter, "Mock Verify Should Be Called Once Per Test Passed"); - TEST_ASSERT_EQUAL_MESSAGE(Unity.NumberOfTests - 1, mockMock_Destroy_Counter, "Mock Destroy Should Be Called Once Per Test Completed"); - TEST_ASSERT_EQUAL_MESSAGE(0, CMockMemFreeFinalCounter, "Mock MemFreeFinal Should Not Be Called Until End"); -} - diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/self_assessment_utils.h b/components/testframework/libs/cmock/vendor/unity/test/tests/self_assessment_utils.h deleted file mode 100644 index c8cb595db..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/self_assessment_utils.h +++ /dev/null @@ -1,144 +0,0 @@ -#ifdef TEST_INSTANCES - -#include -#include - -/* Dividing by these constants produces +/- infinity. - * The rationale is given in UnityAssertFloatIsInf's body. - */ -#ifndef UNITY_EXCLUDE_FLOAT -static const UNITY_FLOAT f_zero = 0.0f; -#endif - -#ifndef UNITY_EXCLUDE_DOUBLE -static const UNITY_DOUBLE d_zero = 0.0; -#endif - -/* Macros for Catching An Expected Failure or Ignore */ -#define EXPECT_ABORT_BEGIN \ - startPutcharSpy(); \ - if (TEST_PROTECT()) \ - { - -#define VERIFY_FAILS_END \ - } \ - endPutcharSpy(); /* start/end Spy to suppress output of failure message */ \ - Unity.CurrentTestFailed = (Unity.CurrentTestFailed == 1) ? 0 : 1; \ - if (Unity.CurrentTestFailed == 1) { \ - SetToOneMeanWeAlreadyCheckedThisGuy = 1; \ - UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \ - UNITY_OUTPUT_CHAR(':'); \ - UnityPrint(Unity.CurrentTestName); \ - UnityPrint(":FAIL: [[[[ Test Should Have Failed But Did Not ]]]]"); \ - UNITY_OUTPUT_CHAR('\n'); \ - } - -#define VERIFY_IGNORES_END \ - } \ - endPutcharSpy(); /* start/end Spy to suppress output of ignore message */ \ - Unity.CurrentTestFailed = (Unity.CurrentTestIgnored == 1) ? 0 : 1; \ - Unity.CurrentTestIgnored = 0; \ - if (Unity.CurrentTestFailed == 1) { \ - SetToOneMeanWeAlreadyCheckedThisGuy = 1; \ - UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \ - UNITY_OUTPUT_CHAR(':'); \ - UnityPrint(Unity.CurrentTestName); \ - UnityPrint(":FAIL: [[[[ Test Should Have Ignored But Did Not ]]]]"); \ - UNITY_OUTPUT_CHAR('\n'); \ - } - -/* Tricky series of macros to set USING_OUTPUT_SPY */ -#define USING_SPY_AS(a) EXPAND_AND_USE_2ND(ASSIGN_VALUE(a), 0) -#define ASSIGN_VALUE(a) VAL_##a -#define VAL_putcharSpy 0, 1 -#define EXPAND_AND_USE_2ND(a, b) SECOND_PARAM(a, b, throwaway) -#define SECOND_PARAM(a, b, ...) b -#if USING_SPY_AS(UNITY_OUTPUT_CHAR) - #define USING_OUTPUT_SPY /* true only if UNITY_OUTPUT_CHAR = putcharSpy */ -#endif - -#ifdef USING_OUTPUT_SPY -#include -#define SPY_BUFFER_MAX 40 -static char putcharSpyBuffer[SPY_BUFFER_MAX]; -#endif -static int indexSpyBuffer; -static int putcharSpyEnabled; - -void startPutcharSpy(void) -{ - indexSpyBuffer = 0; - putcharSpyEnabled = 1; -} - -void endPutcharSpy(void) -{ - putcharSpyEnabled = 0; -} - -char* getBufferPutcharSpy(void) -{ -#ifdef USING_OUTPUT_SPY - putcharSpyBuffer[indexSpyBuffer] = '\0'; - return putcharSpyBuffer; -#else - return NULL; -#endif -} - -void putcharSpy(int c) -{ -#ifdef USING_OUTPUT_SPY - if (putcharSpyEnabled) - { - if (indexSpyBuffer < SPY_BUFFER_MAX - 1) - putcharSpyBuffer[indexSpyBuffer++] = (char)c; - } else - putchar((char)c); -#else - (void)c; -#endif -} - -/* This is for counting the calls to the flushSpy */ -static int flushSpyEnabled; -static int flushSpyCalls = 0; - -void startFlushSpy(void) -{ - flushSpyCalls = 0; - flushSpyEnabled = 1; -} - -void endFlushSpy(void) -{ - flushSpyCalls = 0; - flushSpyEnabled = 0; -} - -int getFlushSpyCalls(void) -{ - return flushSpyCalls; -} - -void flushSpy(void) -{ - if (flushSpyEnabled){ flushSpyCalls++; } -} - -#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) { \ - startPutcharSpy(); UnityPrintNumber((actual)); endPutcharSpy(); \ - TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \ - } - -#define TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS(expected, actual) { \ - startPutcharSpy(); UnityPrintNumberUnsigned((actual)); endPutcharSpy(); \ - TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \ - } - -#define TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, actual) { \ - startPutcharSpy(); UnityPrintFloat((actual)); endPutcharSpy(); \ - TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \ - } - -#endif diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_generate_test_runner.rb b/components/testframework/libs/cmock/vendor/unity/test/tests/test_generate_test_runner.rb deleted file mode 100644 index 809b4494c..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +++ /dev/null @@ -1,1260 +0,0 @@ -# ========================================== -# CMock Project - Automatic Mock Generation for C -# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams -# [Released under MIT License. Please refer to license.txt for details] -# ========================================== - -require '../auto/generate_test_runner.rb' - -$generate_test_runner_tests = 0 -$generate_test_runner_failures = 0 - -OUT_FILE = 'build/testsample_' - -RUNNER_TESTS = [ - { :name => 'DefaultsThroughOptions', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :options => nil, #defaults - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'DefaultsThroughCommandLine', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :cmdline => "", #defaults - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'DefaultsThroughYAMLFile', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :cmdline => "", #defaults - :yaml => {}, #defaults - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ShorterFilterOfJustTest', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :options => { - :test_prefix => "test", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ShorterFilterOfJustShould', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :options => { - :test_prefix => "should", - }, - :expected => { - :to_pass => [ 'should_RunTestsStartingWithShouldByDefault' ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'ShorterFilterOfJustSpec', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :options => { - :test_prefix => "spec", - }, - :expected => { - :to_pass => [ 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'InjectIncludes', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :options => { - :includes => ['Defs.h'], - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ParameterizedThroughOptions', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :options => { - :test_prefix => "paratest", - :use_param_tests => true, - }, - :features => [ :parameterized ], - :expected => { - :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', - 'paratest_ShouldHandleParameterizedTests\(125\)', - 'paratest_ShouldHandleParameterizedTests\(5\)', - 'paratest_ShouldHandleParameterizedTests2\(7\)', - 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', - ], - :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], - :to_ignore => [ ], - } - }, - - { :name => 'ParameterizedThroughCommandLine', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :cmdline => " --test_prefix=\"paratest\" --use_param_tests=1", - :features => [ :parameterized ], - :expected => { - :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', - 'paratest_ShouldHandleParameterizedTests\(125\)', - 'paratest_ShouldHandleParameterizedTests\(5\)', - 'paratest_ShouldHandleParameterizedTests2\(7\)', - 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', - ], - :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], - :to_ignore => [ ], - } - }, - - { :name => 'ParameterizedThroughCommandLineAndYaml', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :cmdline => "--use_param_tests=1", - :yaml => { - :test_prefix => "paratest" - }, - :features => [ :parameterized ], - :expected => { - :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', - 'paratest_ShouldHandleParameterizedTests\(125\)', - 'paratest_ShouldHandleParameterizedTests\(5\)', - 'paratest_ShouldHandleParameterizedTests2\(7\)', - 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', - ], - :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], - :to_ignore => [ ], - } - }, - - { :name => 'CException', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'USE_CEXCEPTION'], - :options => { - :test_prefix => "extest", - :plugins => [ :cexception ], - }, - :expected => { - :to_pass => [ 'extest_ShouldHandleCExceptionInTest' ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'CustomSetupAndTeardownThroughOptions', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :options => { - :test_prefix => "custtest|test", - :setup_name => "custom_setup", - :teardown_name => "custom_teardown", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'custtest_ThisTestPassesWhenCustomSetupRan', - 'custtest_ThisTestPassesWhenCustomTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'CustomSetupAndTeardownThroughCommandLine', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :cmdline => " --test_prefix=\"custtest|test\" --setup_name=\"custom_setup\" --teardown_name=\"custom_teardown\"", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'custtest_ThisTestPassesWhenCustomSetupRan', - 'custtest_ThisTestPassesWhenCustomTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'CustomSetupAndTeardownThroughYaml', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :cmdline => " --test_prefix=\"custtest|test\"", - :yaml => { - :setup_name => "custom_setup", - :teardown_name => "custom_teardown", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'custtest_ThisTestPassesWhenCustomSetupRan', - 'custtest_ThisTestPassesWhenCustomTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'CustomMain', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', "USE_ANOTHER_MAIN"], - :options => { - :main_name => "custom_main", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'CustomSuiteSetupAndTeardown', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :includes => ['Defs.h'], - :options => { - :test_prefix => "suitetest|test", - :suite_setup => " CounterSuiteSetup = 1;", - :suite_teardown => " return num_failures;", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'suitetest_ThisTestPassesWhenCustomSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'MainExternDeclaration', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST'], - :includes => ['Defs.h'], - :options => { - :main_export_decl => "EXTERN_DECL", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - - #### WITH MOCKS ########################################## - - { :name => 'DefaultsThroughOptions', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :options => nil, #defaults - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'DefaultsThroughCommandLine', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :cmdline => "", #defaults - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'DefaultsThroughYAMLFile', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :cmdline => "", #defaults - :yaml => {}, #defaults - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ShorterFilterOfJustTest', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :options => { - :test_prefix => "test", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ShorterFilterOfJustShould', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :options => { - :test_prefix => "should", - }, - :expected => { - :to_pass => [ 'should_RunTestsStartingWithShouldByDefault' ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'ShorterFilterOfJustSpec', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :options => { - :test_prefix => "spec", - }, - :expected => { - :to_pass => [ 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'InjectIncludes', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :options => { - :includes => ['Defs.h'], - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ParameterizedThroughOptions', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :options => { - :test_prefix => "paratest", - :use_param_tests => true, - }, - :features => [ :parameterized ], - :expected => { - :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', - 'paratest_ShouldHandleParameterizedTests\(125\)', - 'paratest_ShouldHandleParameterizedTests\(5\)', - 'paratest_ShouldHandleParameterizedTests2\(7\)', - 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', - ], - :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], - :to_ignore => [ ], - } - }, - - { :name => 'ParameterizedThroughCommandLine', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :cmdline => " --test_prefix=\"paratest\" --use_param_tests=1", - :features => [ :parameterized ], - :expected => { - :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', - 'paratest_ShouldHandleParameterizedTests\(125\)', - 'paratest_ShouldHandleParameterizedTests\(5\)', - 'paratest_ShouldHandleParameterizedTests2\(7\)', - 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', - ], - :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], - :to_ignore => [ ], - } - }, - - { :name => 'ParameterizedThroughCommandLineAndYaml', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :cmdline => "--use_param_tests=1", - :yaml => { - :test_prefix => "paratest" - }, - :features => [ :parameterized ], - :expected => { - :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', - 'paratest_ShouldHandleParameterizedTests\(125\)', - 'paratest_ShouldHandleParameterizedTests\(5\)', - 'paratest_ShouldHandleParameterizedTests2\(7\)', - 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', - ], - :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], - :to_ignore => [ ], - } - }, - - { :name => 'CException', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST', 'USE_CEXCEPTION'], - :options => { - :test_prefix => "extest", - :plugins => [ :cexception ], - }, - :expected => { - :to_pass => [ 'extest_ShouldHandleCExceptionInTest' ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'CustomSetupAndTeardownThroughOptions', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :options => { - :test_prefix => "custtest|test", - :setup_name => "custom_setup", - :teardown_name => "custom_teardown", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'custtest_ThisTestPassesWhenCustomSetupRan', - 'custtest_ThisTestPassesWhenCustomTeardownRan', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'CustomSetupAndTeardownThroughCommandLine', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :cmdline => " --test_prefix=\"custtest|test\" --setup_name=\"custom_setup\" --teardown_name=\"custom_teardown\"", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'custtest_ThisTestPassesWhenCustomSetupRan', - 'custtest_ThisTestPassesWhenCustomTeardownRan', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'CustomSetupAndTeardownThroughYaml', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :cmdline => " --test_prefix=\"custtest|test\"", - :yaml => { - :setup_name => "custom_setup", - :teardown_name => "custom_teardown", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'custtest_ThisTestPassesWhenCustomSetupRan', - 'custtest_ThisTestPassesWhenCustomTeardownRan', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'CustomMain', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST', "USE_ANOTHER_MAIN"], - :options => { - :main_name => "custom_main", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'CustomSuiteSetupAndTeardown', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :includes => ['Defs.h'], - :options => { - :test_prefix => "suitetest|test", - :suite_setup => " CounterSuiteSetup = 1;", - :suite_teardown => " return num_failures;", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'suitetest_ThisTestPassesWhenCustomSuiteSetupAndTeardownRan', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'MainExternDeclaration', - :testfile => 'testdata/testRunnerGeneratorWithMocks.c', - :testdefines => ['TEST'], - :includes => ['Defs.h'], - :options => { - :main_export_decl => "EXTERN_DECL", - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - - - #### WITH ARGS ########################################## - - { :name => 'ArgsThroughOptions', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsThroughCommandLine', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :cmdline => "--cmdline_args=1", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsThroughYAMLFile', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :cmdline => "", - :yaml => { - :cmdline_args => true, - }, - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsNameFilterJustTest', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n test_", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsNameFilterJustShould', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n should_", - :expected => { - :to_pass => [ 'should_RunTestsStartingWithShouldByDefault' ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsNameFilterTestAndShould', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n should_,test_", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault' ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsNameFilterWithWildcardOnFile', - :testfile => 'testdata/testRunnerGeneratorSmall.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n=testRunnerGeneratorSma*", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan' ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsNameFilterWithWildcardAsName', - :testfile => 'testdata/testRunnerGeneratorSmall.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n testRunnerGeneratorSmall:*", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan' ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsNameFilterWithWildcardOnName', - :testfile => 'testdata/testRunnerGeneratorSmall.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n testRunnerGeneratorSmall:test_*", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses' ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsNameFilterWithWildcardAndShortName', - :testfile => 'testdata/testRunnerGeneratorSmall.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n testRunnerGeneratorSmall:te*", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses' ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsNameFilterWithWildcardOnBoth', - :testfile => 'testdata/testRunnerGeneratorSmall.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n testRunnerGeneratorSm*:*", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan' ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsExcludeFilterJustTest', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-x test_", - :expected => { - :to_pass => [ 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - 'should_RunTestsStartingWithShouldByDefault', - ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsIncludeAndExcludeFilter', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - :includes => ['Defs.h'], - }, - :cmdline_args => "-n test_ -x Ignored", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsIncludeSingleTest', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n ThisTestAlwaysPasses", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses' ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsIncludeSingleTestInSpecificFile', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n testRunnerGenerator:ThisTestAlwaysPasses", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses' ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsIncludeTestFileWithExtension', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n testRunnerGenerator.c:ThisTestAlwaysPasses", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses' ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsIncludeDoubleQuotes', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n \"testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails\"", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses' ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsIncludeSingleQuotes', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n 'testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails'", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses' ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsIncludeAValidTestForADifferentFile', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n AnotherFile:ThisTestDoesNotExist", - :expected => { - :to_pass => [ ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsIncludeNoTests', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n ThisTestDoesNotExist", - :expected => { - :to_pass => [ ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsExcludeAllTests', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-x _", - :expected => { - :to_pass => [ ], - :to_fail => [ ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsIncludeFullFile', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n testRunnerGenerator", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses', - 'spec_ThisTestPassesWhenNormalSetupRan', - 'spec_ThisTestPassesWhenNormalTeardownRan', - 'test_NotBeConfusedByLongComplicatedStrings', - 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', - 'test_StillNotBeConfusedByLongComplicatedStrings', - 'should_RunTestsStartingWithShouldByDefault', - 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', - ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], - } - }, - - { :name => 'ArgsIncludeWithAlternateFlag', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-f=\"testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails\"", - :expected => { - :to_pass => [ 'test_ThisTestAlwaysPasses' ], - :to_fail => [ 'test_ThisTestAlwaysFails' ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsIncludeWithParameterized', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :cmdline => "--use_param_tests=1", - :yaml => { - :cmdline_args => true, - :test_prefix => "paratest" - }, - :cmdline_args => "-n ShouldHandleParameterizedTests", - :features => [ :parameterized ], - :expected => { - :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', - 'paratest_ShouldHandleParameterizedTests\(125\)', - 'paratest_ShouldHandleParameterizedTests\(5\)', - 'paratest_ShouldHandleParameterizedTests2\(7\)', - ], - :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], - :to_ignore => [ ], - } - }, - - { :name => 'ArgsList', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-l", - :expected => { - :to_pass => [ ], - :to_fail => [ ], - :to_ignore => [ ], - :text => [ "testRunnerGenerator", - "test_ThisTestAlwaysPasses", - "test_ThisTestAlwaysFails", - "test_ThisTestAlwaysIgnored", - "spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan", - "spec_ThisTestPassesWhenNormalSetupRan", - "spec_ThisTestPassesWhenNormalTeardownRan", - "test_NotBeConfusedByLongComplicatedStrings", - "test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings", - "test_StillNotBeConfusedByLongComplicatedStrings", - "should_RunTestsStartingWithShouldByDefault" - ] - } - }, - - { :name => 'ArgsListParameterized', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :test_prefix => "paratest", - :use_param_tests => true, - :cmdline_args => true, - }, - :cmdline_args => "-l", - :features => [ :parameterized ], - :expected => { - :to_pass => [ ], - :to_fail => [ ], - :to_ignore => [ ], - :text => [ "testRunnerGenerator", - 'paratest_ShouldHandleParameterizedTests\(25\)', - 'paratest_ShouldHandleParameterizedTests\(125\)', - 'paratest_ShouldHandleParameterizedTests\(5\)', - 'paratest_ShouldHandleParameterizedTests2\(7\)', - 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', - 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' - ], - } - }, - - { :name => 'ArgsIncompleteIncludeFlags', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-n", - :expected => { - :to_pass => [ ], - :to_fail => [ ], - :to_ignore => [ ], - :text => [ "ERROR: No Test String to Include Matches For" ], - } - }, - - { :name => 'ArgsIncompleteExcludeFlags', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-x", - :expected => { - :to_pass => [ ], - :to_fail => [ ], - :to_ignore => [ ], - :text => [ "ERROR: No Test String to Exclude Matches For" ], - } - }, - - { :name => 'ArgsIllegalFlags', - :testfile => 'testdata/testRunnerGenerator.c', - :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], - :options => { - :cmdline_args => true, - }, - :cmdline_args => "-z", - :expected => { - :to_pass => [ ], - :to_fail => [ ], - :to_ignore => [ ], - :text => [ "ERROR: Unknown Option z" ], - } - }, -] - -def runner_test(test, runner, expected, test_defines, cmdline_args, features) - # Tack on TEST define for compiling unit tests - load_configuration($cfg_file) - - # Drop Out if we're skipping this type of test - if $cfg[:skip_tests] && features - if $cfg[:skip_tests].include?(:parameterized) && features.include?(:parameterized) - report("Skipping Parameterized Tests for this Target:IGNORE") - return true - end - end - - #compile objects - obj_list = [ - compile(runner, test_defines), - compile(test, test_defines), - compile('../src/unity.c', test_defines), - ] - - # Link the test executable - test_base = File.basename(test, C_EXTENSION) - link_it(test_base, obj_list) - - # Execute unit test and generate results file - output = runtest(test_base, true, cmdline_args) - - #compare to the expected pass/fail - allgood = expected[:to_pass].inject(true) {|s,v| s && verify_match(/#{v}:PASS/, output) } - allgood = expected[:to_fail].inject(allgood) {|s,v| s && verify_match(/#{v}:FAIL/, output) } - allgood = expected[:to_ignore].inject(allgood) {|s,v| s && verify_match(/#{v}:IGNORE/, output) } - - #verify there weren't more pass/fail/etc than expected - allgood &&= verify_number( expected[:to_pass], /(:PASS)/, output) - allgood &&= verify_number( expected[:to_fail], /(:FAIL)/, output) - allgood &&= verify_number( expected[:to_ignore], /(:IGNORE)/, output) - - #if we care about any other text, check that too - if (expected[:text]) - allgood = expected[:text].inject(allgood) {|s,v| s && verify_match(/#{v}/, output) } - allgood &&= verify_number( expected[:text], /.+/, output ) - end - - report output if (!allgood && !$verbose) #report failures if not already reporting everything - return allgood -end - -def verify_match(expression, output) - if (expression =~ output) - return true - else - report " FAIL: No Match For /#{expression.to_s}/" - return false - end -end - -def verify_number(expected, expression, output) - exp = expected.length - act = output.scan(expression).length - if (exp == act) - return true - else - report " FAIL: Expected #{exp} Matches For /#{expression.to_s}/. Was #{act}" - return false - end -end - -RUNNER_TESTS.each do |testset| - basename = File.basename(testset[:testfile], C_EXTENSION) - testset_name = "Runner_#{basename}_#{testset[:name]}" - should testset_name do - runner_name = OUT_FILE + testset[:name] + '_runner.c' - - #create a yaml file first if required - yaml_option = "" - if (testset[:yaml]) - File.open("build/runner_options.yml",'w') {|f| f << { :unity => testset[:yaml] }.to_yaml } - yaml_option = "build/runner_options.yml" - end - - #run script via command line or through hash function call, as requested - if (testset[:cmdline]) - cmdstr = "ruby ../auto/generate_test_runner.rb #{yaml_option} #{testset[:cmdline]} \"#{testset[:testfile]}\" \"#{runner_name}\"" - `#{cmdstr}` - else - UnityTestRunnerGenerator.new(testset[:options]).run(testset[:testfile], runner_name) - end - - #test the script against the specified test file and check results - if (runner_test(testset[:testfile], runner_name, testset[:expected], testset[:testdefines], testset[:cmdline_args], testset[:features])) - report "#{testset_name}:PASS" - else - report "#{testset_name}:FAIL" - $generate_test_runner_failures += 1 - end - $generate_test_runner_tests += 1 - end -end - -raise "There were #{$generate_test_runner_failures.to_s} failures while testing generate_test_runner.rb" if ($generate_test_runner_failures > 0) diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_arrays.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_arrays.c deleted file mode 100644 index ff90a6c42..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_arrays.c +++ /dev/null @@ -1,2874 +0,0 @@ -/* ========================================== - 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] -========================================== */ - -#include "unity.h" -#define TEST_INSTANCES -#include "self_assessment_utils.h" - -static int SetToOneToFailInTearDown; -static int SetToOneMeanWeAlreadyCheckedThisGuy; - -void setUp(void) -{ - SetToOneToFailInTearDown = 0; - SetToOneMeanWeAlreadyCheckedThisGuy = 0; -} - -void tearDown(void) -{ - endPutcharSpy(); /* Stop suppressing test output */ - if (SetToOneToFailInTearDown == 1) - { - /* These will be skipped internally if already failed/ignored */ - TEST_FAIL_MESSAGE("<= Failed in tearDown"); - TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); - } - if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) - { - UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); - UNITY_OUTPUT_CHAR('\n'); - } -} - -void testInt64ArrayWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualSmallDelta[] = {12345001, -12344996, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - TEST_ASSERT_INT64_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); -#endif -} - -void testInt64ArrayWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualSmallDelta[] = {12345001, -12344996, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); -#endif -} - -void tesUInt64ArrayNotWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayNotWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaPointless(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaPointlessAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaExpectedNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaExpectedNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaActualNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, NULL, 3); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaActualNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaSamePointer(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, expected, 3); -#endif -} - -void testInt64ArrayWithinDeltaSamePointerAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); -#endif -} - -void testIntArrayWithinDelta(void) -{ - UNITY_INT expected[] = {5000, -4995, 5005}; - UNITY_INT actualSmallDelta[] = {5001, -4996, 5005}; - UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; - - TEST_ASSERT_INT_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, actualBigDelta, 3); -} - -void testIntArrayWithinDeltaAndMessage(void) -{ - UNITY_INT expected[] = {5000, -4995, 5005}; - UNITY_INT actualSmallDelta[] = {5001, -4996, 5005}; - UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; - - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); -} - -void testIntArrayNotWithinDelta(void) -{ - UNITY_INT expected[] = {5000, -4995, 5005}; - UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testIntArrayNotWithinDeltaAndMessage(void) -{ - UNITY_INT expected[] = {5000, -4995, 5005}; - UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testIntArrayWithinDeltaPointless(void) -{ - UNITY_INT expected[] = {5000, -4995, 5005}; - UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, actualBigDelta, 0); - VERIFY_FAILS_END -} - -void testIntArrayWithinDeltaPointlessAndMessage(void) -{ - UNITY_INT expected[] = {5000, -4995, 5005}; - UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testIntArrayWithinDeltaExpectedNull(void) -{ - UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testIntArrayWithinDeltaExpectedNullAndMessage(void) -{ - UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testIntArrayWithinDeltaActualNull(void) -{ - UNITY_INT expected[] = {5000, -4995, 5005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, NULL, 3); - VERIFY_FAILS_END -} - -void testIntArrayWithinDeltaActualNullAndMessage(void) -{ - UNITY_INT expected[] = {5000, -4995, 5005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testIntArrayWithinDeltaSamePointer(void) -{ - UNITY_INT expected[] = {5000, -4995, 5005}; - - TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, expected, 3); -} - -void testIntArrayWithinDeltaSamePointerAndMessage(void) -{ - UNITY_INT expected[] = {5000, -4995, 5005}; - - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); -} - -void testInt16ArrayWithinDelta(void) -{ - UNITY_INT16 expected[] = {5000, -4995, 5005}; - UNITY_INT16 actualSmallDelta[] = {5001, -4996, 5005}; - UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; - - TEST_ASSERT_INT16_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, actualBigDelta, 3); -} - -void testInt16ArrayWithinDeltaAndMessage(void) -{ - UNITY_INT16 expected[] = {5000, -4995, 5005}; - UNITY_INT16 actualSmallDelta[] = {5001, -4996, 5005}; - UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; - - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); -} - -void testInt16ArrayNotWithinDelta(void) -{ - UNITY_INT16 expected[] = {5000, -4995, 5005}; - UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testInt16ArrayNotWithinDeltaAndMessage(void) -{ - UNITY_INT16 expected[] = {5000, -4995, 5005}; - UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testInt16ArrayWithinDeltaPointless(void) -{ - UNITY_INT16 expected[] = {5000, -4995, 5005}; - UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, actualBigDelta, 0); - VERIFY_FAILS_END -} - -void testInt16ArrayWithinDeltaPointlessAndMessage(void) -{ - UNITY_INT16 expected[] = {5000, -4995, 5005}; - UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testInt16ArrayWithinDeltaExpectedNull(void) -{ - UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testInt16ArrayWithinDeltaExpectedNullAndMessage(void) -{ - UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testInt16ArrayWithinDeltaActualNull(void) -{ - UNITY_INT16 expected[] = {5000, -4995, 5005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, NULL, 3); - VERIFY_FAILS_END -} - -void testInt16ArrayWithinDeltaActualNullAndMessage(void) -{ - UNITY_INT16 expected[] = {5000, -4995, 5005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testInt16ArrayWithinDeltaSamePointer(void) -{ - UNITY_INT16 expected[] = {5000, -4995, 5005}; - - TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, expected, 3); -} - -void testInt16ArrayWithinDeltaSamePointerAndMessage(void) -{ - UNITY_INT16 expected[] = {5000, -4995, 5005}; - - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); -} - -void testInt8ArrayWithinDelta(void) -{ - UNITY_INT8 expected[] = {20, -95, 55}; - UNITY_INT8 actualSmallDelta[] = {21, -94, 55}; - UNITY_INT8 actualBigDelta[] = {11, -86, 45}; - - TEST_ASSERT_INT8_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, actualBigDelta, 3); -} - -void testInt8ArrayWithinDeltaAndMessage(void) -{ - UNITY_INT8 expected[] = {20, -95, 55}; - UNITY_INT8 actualSmallDelta[] = {21, -94, 55}; - UNITY_INT8 actualBigDelta[] = {11, -86, 45}; - - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 3, "Custom Message."); -} - -void testInt8ArrayNotWithinDelta(void) -{ - UNITY_INT8 expected[] = {20, -95, 55}; - UNITY_INT8 actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testInt8ArrayNotWithinDeltaAndMessage(void) -{ - UNITY_INT8 expected[] = {20, -95, 55}; - UNITY_INT8 actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testInt8ArrayWithinDeltaPointless(void) -{ - UNITY_INT8 expected[] = {20, -95, 55}; - UNITY_INT8 actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, actualBigDelta, 0); - VERIFY_FAILS_END -} - -void testInt8ArrayWithinDeltaPointlessAndMessage(void) -{ - UNITY_INT8 expected[] = {20, -95, 55}; - UNITY_INT8 actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testInt8ArrayWithinDeltaExpectedNull(void) -{ - UNITY_INT8 actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN(11, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testInt8ArrayWithinDeltaExpectedNullAndMessage(void) -{ - UNITY_INT8 actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testInt8ArrayWithinDeltaActualNull(void) -{ - UNITY_INT8 expected[] = {20, -95, 55}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, NULL, 3); - VERIFY_FAILS_END -} - -void testInt8ArrayWithinDeltaActualNullAndMessage(void) -{ - UNITY_INT8 expected[] = {20, -95, 55}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testInt8ArrayWithinDeltaSamePointer(void) -{ - UNITY_INT8 expected[] = {20, -95, 55}; - - TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, expected, 3); -} - -void testInt8ArrayWithinDeltaSamePointerAndMessage(void) -{ - UNITY_INT8 expected[] = {20, -95, 55}; - - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, expected, 3, "Custom Message."); -} - -void testCHARArrayWithinDelta(void) -{ - char expected[] = {20, -95, 55}; - char actualSmallDelta[] = {21, -94, 55}; - char actualBigDelta[] = {11, -86, 45}; - - TEST_ASSERT_CHAR_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, actualBigDelta, 3); -} - -void testCHARArrayWithinDeltaAndMessage(void) -{ - char expected[] = {20, -95, 55}; - char actualSmallDelta[] = {21, -94, 55}; - char actualBigDelta[] = {11, -86, 45}; - - TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 3, "Custom Message."); -} - -void testCHARArrayNotWithinDelta(void) -{ - char expected[] = {20, -95, 55}; - char actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_CHAR_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testCHARArrayNotWithinDeltaAndMessage(void) -{ - char expected[] = {20, -95, 55}; - char actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testCHARArrayWithinDeltaPointless(void) -{ - char expected[] = {20, -95, 55}; - char actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, actualBigDelta, 0); - VERIFY_FAILS_END -} - -void testCHARArrayWithinDeltaPointlessAndMessage(void) -{ - char expected[] = {20, -95, 55}; - char actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testCHARArrayWithinDeltaExpectedNull(void) -{ - char actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_CHAR_ARRAY_WITHIN(11, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testCHARArrayWithinDeltaExpectedNullAndMessage(void) -{ - char actualBigDelta[] = {11, -86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testCHARArrayWithinDeltaActualNull(void) -{ - char expected[] = {20, -95, 55}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, NULL, 3); - VERIFY_FAILS_END -} - -void testCHARArrayWithinDeltaActualNullAndMessage(void) -{ - char expected[] = {20, -95, 55}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testCHARArrayWithinDeltaSamePointer(void) -{ - char expected[] = {20, -95, 55}; - - TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, expected, 3); -} - -void testCHARArrayWithinDeltaSamePointerAndMessage(void) -{ - char expected[] = {20, -95, 55}; - - TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, expected, 3, "Custom Message."); -} - -void testUInt64ArrayWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualSmallDelta[] = {12345001, 12344996, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); -#endif -} - -void testUInt64ArrayWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualSmallDelta[] = {12345001, 12344996, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); -#endif -} - -void testUInt64ArrayNotWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayNotWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaPointless(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaPointlessAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaExpectedNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaExpectedNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaActualNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, NULL, 3); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaActualNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaSamePointer(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, expected, 3); -#endif -} - -void testUInt64ArrayWithinDeltaSamePointerAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); -#endif -} - -void testUIntArrayWithinDelta(void) -{ - UNITY_UINT expected[] = {125000, 124995, 125005}; - UNITY_UINT actualSmallDelta[] = {125001, 124996, 125005}; - UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; - - TEST_ASSERT_UINT_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, actualBigDelta, 3); -} - -void testUIntArrayWithinDeltaAndMessage(void) -{ - UNITY_UINT expected[] = {125000, 124995, 125005}; - UNITY_UINT actualSmallDelta[] = {125001, 124996, 125005}; - UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; - - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); -} - -void testUIntArrayNotWithinDelta(void) -{ - UNITY_UINT expected[] = {125000, 124995, 125005}; - UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testUIntArrayNotWithinDeltaAndMessage(void) -{ - UNITY_UINT expected[] = {125000, 124995, 125005}; - UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testUIntArrayWithinDeltaPointless(void) -{ - UNITY_UINT expected[] = {125000, 124995, 125005}; - UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, actualBigDelta, 0); - VERIFY_FAILS_END -} - -void testUIntArrayWithinDeltaPointlessAndMessage(void) -{ - UNITY_UINT expected[] = {125000, 124995, 125005}; - UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testUIntArrayWithinDeltaExpectedNull(void) -{ - UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testUIntArrayWithinDeltaExpectedNullAndMessage(void) -{ - UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testUIntArrayWithinDeltaActualNull(void) -{ - UNITY_UINT expected[] = {125000, 124995, 125005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, NULL, 3); - VERIFY_FAILS_END -} - -void testUIntArrayWithinDeltaActualNullAndMessage(void) -{ - UNITY_UINT expected[] = {125000, 124995, 125005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testUIntArrayWithinDeltaSamePointer(void) -{ - UNITY_UINT expected[] = {125000, 124995, 125005}; - - TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, expected, 3); -} - -void testUIntArrayWithinDeltaSamePointerAndMessage(void) -{ - UNITY_UINT expected[] = {125000, 124995, 125005}; - - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); -} - -void testUInt16ArrayWithinDelta(void) -{ - UNITY_UINT16 expected[] = {5000, 4995, 5005}; - UNITY_UINT16 actualSmallDelta[] = {5001, 4996, 5005}; - UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; - - TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, actualBigDelta, 3); -} - -void testUInt16ArrayWithinDeltaAndMessage(void) -{ - UNITY_UINT16 expected[] = {5000, 4995, 5005}; - UNITY_UINT16 actualSmallDelta[] = {5001, 4996, 5005}; - UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; - - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); -} - -void testUInt16ArrayNotWithinDelta(void) -{ - UNITY_UINT16 expected[] = {5000, 4995, 5005}; - UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testUInt16ArrayNotWithinDeltaAndMessage(void) -{ - UNITY_UINT16 expected[] = {5000, 4995, 5005}; - UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testUInt16ArrayWithinDeltaPointless(void) -{ - UNITY_UINT16 expected[] = {5000, 4995, 5005}; - UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, actualBigDelta, 0); - VERIFY_FAILS_END -} - -void testUInt16ArrayWithinDeltaPointlessAndMessage(void) -{ - UNITY_UINT16 expected[] = {5000, 4995, 5005}; - UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testUInt16ArrayWithinDeltaExpectedNull(void) -{ - UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testUInt16ArrayWithinDeltaExpectedNullAndMessage(void) -{ - UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testUInt16ArrayWithinDeltaActualNull(void) -{ - UNITY_UINT16 expected[] = {5000, 4995, 5005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, NULL, 3); - VERIFY_FAILS_END -} - -void testUInt16ArrayWithinDeltaActualNullAndMessage(void) -{ - UNITY_UINT16 expected[] = {5000, 4995, 5005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testUInt16ArrayWithinDeltaSamePointer(void) -{ - UNITY_UINT16 expected[] = {5000, 4995, 5005}; - - TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, expected, 3); -} - -void testUInt16ArrayWithinDeltaSamePointerAndMessage(void) -{ - UNITY_UINT16 expected[] = {5000, 4995, 5005}; - - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); -} - -void testUInt8ArrayWithinDelta(void) -{ - UNITY_UINT8 expected[] = {20, 95, 55}; - UNITY_UINT8 actualSmallDelta[] = {21, 94, 55}; - UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; - - TEST_ASSERT_UINT8_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, actualBigDelta, 3); -} - -void testUInt8ArrayWithinDeltaAndMessage(void) -{ - UNITY_UINT8 expected[] = {20, 95, 55}; - UNITY_UINT8 actualSmallDelta[] = {21, 94, 55}; - UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; - - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 3, "Custom Message."); -} - -void testUInt8ArrayNotWithinDelta(void) -{ - UNITY_UINT8 expected[] = {20, 95, 55}; - UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testUInt8ArrayNotWithinDeltaAndMessage(void) -{ - UNITY_UINT8 expected[] = {20, 95, 55}; - UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testUInt8ArrayWithinDeltaPointless(void) -{ - UNITY_UINT8 expected[] = {20, 95, 55}; - UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, actualBigDelta, 0); - VERIFY_FAILS_END -} - -void testUInt8ArrayWithinDeltaPointlessAndMessage(void) -{ - UNITY_UINT8 expected[] = {20, 95, 55}; - UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testUInt8ArrayWithinDeltaExpectedNull(void) -{ - UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN(11, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testUInt8ArrayWithinDeltaExpectedNullAndMessage(void) -{ - UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testUInt8ArrayWithinDeltaActualNull(void) -{ - UNITY_UINT8 expected[] = {20, 95, 55}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, NULL, 3); - VERIFY_FAILS_END -} - -void testUInt8ArrayWithinDeltaActualNullAndMessage(void) -{ - UNITY_UINT8 expected[] = {20, 95, 55}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testUInt8ArrayWithinDeltaSamePointer(void) -{ - UNITY_UINT8 expected[] = {20, 95, 55}; - - TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, expected, 3); -} - -void testUInt8ArrayWithinDeltaSamePointerAndMessage(void) -{ - UNITY_UINT8 expected[] = {20, 95, 55}; - - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, expected, 3, "Custom Message."); -} - -void testHEX64ArrayWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualSmallDelta[] = {0xABCD123500000000, 0xABCD112100000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x100000000, expected, actualSmallDelta, 3); - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, actualBigDelta, 3); -#endif -} - -void testHEX64ArrayWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualSmallDelta[] = {0xABCD123500000000, 0xABCD112100000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x100000000, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, actualBigDelta, 3, "Custom Message."); -#endif -} - -void testHEX64ArrayNotWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x100000000, expected, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayNotWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x100000000, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaPointless(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, actualBigDelta, 0); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaPointlessAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaExpectedNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaExpectedNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaActualNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, NULL, 3); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaActualNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaSamePointer(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, expected, 3); -#endif -} - -void testHEX64ArrayWithinDeltaSamePointerAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, expected, 3, "Custom Message."); -#endif -} - -void testHEX32ArrayWithinDelta(void) -{ - UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT actualSmallDelta[] = {0xABCD1235, 0xABCD1121, 0xABCD1277}; - UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; - - TEST_ASSERT_HEX32_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, actualBigDelta, 3); -} - -void testHEX32ArrayWithinDeltaAndMessage(void) -{ - UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT actualSmallDelta[] = {0xABCD1235, 0xABCD1121, 0xABCD1277}; - UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; - - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); -} - -void testHEX32ArrayNotWithinDelta(void) -{ - UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testHEX32ArrayNotWithinDeltaAndMessage(void) -{ - UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX32ArrayWithinDeltaPointless(void) -{ - UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, actualBigDelta, 0); - VERIFY_FAILS_END -} - -void testHEX32ArrayWithinDeltaPointlessAndMessage(void) -{ - UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX32ArrayWithinDeltaExpectedNull(void) -{ - UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testHEX32ArrayWithinDeltaExpectedNullAndMessage(void) -{ - UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX32ArrayWithinDeltaActualNull(void) -{ - UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, NULL, 3); - VERIFY_FAILS_END -} - -void testHEX32ArrayWithinDeltaActualNullAndMessage(void) -{ - UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX32ArrayWithinDeltaSamePointer(void) -{ - UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - - TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, expected, 3); -} - -void testHEX32ArrayWithinDeltaSamePointerAndMessage(void) -{ - UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); -} - - -void testHEX16ArrayWithinDelta(void) -{ - UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - UNITY_UINT16 actualSmallDelta[] = {0x1235, 0x1121, 0x1277}; - UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; - - TEST_ASSERT_HEX16_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, actualBigDelta, 3); -} - -void testHEX16ArrayWithinDeltaAndMessage(void) -{ - UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - UNITY_UINT16 actualSmallDelta[] = {0x1235, 0x1121, 0x1277}; - UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; - - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); -} - -void testHEX16ArrayNotWithinDelta(void) -{ - UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testHEX16ArrayNotWithinDeltaAndMessage(void) -{ - UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX16ArrayWithinDeltaPointless(void) -{ - UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, actualBigDelta, 0); - VERIFY_FAILS_END -} - -void testHEX16ArrayWithinDeltaPointlessAndMessage(void) -{ - UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX16ArrayWithinDeltaExpectedNull(void) -{ - UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testHEX16ArrayWithinDeltaExpectedNullAndMessage(void) -{ - UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX16ArrayWithinDeltaActualNull(void) -{ - UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, NULL, 3); - VERIFY_FAILS_END -} - -void testHEX16ArrayWithinDeltaActualNullAndMessage(void) -{ - UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX16ArrayWithinDeltaSamePointer(void) -{ - UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - - TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, expected, 3); -} - -void testHEX16ArrayWithinDeltaSamePointerAndMessage(void) -{ - UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); -} - -void testHEX8ArrayWithinDelta(void) -{ - UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - UNITY_UINT8 actualSmallDelta[] = {0x35, 0x21, 0x77}; - UNITY_UINT8 actualBigDelta[] = {0x47, 0x48, 0x4C}; - - TEST_ASSERT_HEX8_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, actualBigDelta, 3); -} - -void testHEX8ArrayWithinDeltaAndMessage(void) -{ - UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - UNITY_UINT8 actualSmallDelta[] = {0x35, 0x21, 0x77}; - UNITY_UINT8 actualBigDelta[] = {0x47, 0x48, 0x4C}; - - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, actualBigDelta, 3, "Custom Message."); -} - -void testHEX8ArrayNotWithinDelta(void) -{ - UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testHEX8ArrayNotWithinDeltaAndMessage(void) -{ - UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX8ArrayWithinDeltaPointless(void) -{ - UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, actualBigDelta, 0); - VERIFY_FAILS_END -} - -void testHEX8ArrayWithinDeltaPointlessAndMessage(void) -{ - UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX8ArrayWithinDeltaExpectedNull(void) -{ - UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN(60, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -} - -void testHEX8ArrayWithinDeltaExpectedNullAndMessage(void) -{ - UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX8ArrayWithinDeltaActualNull(void) -{ - UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, NULL, 3); - VERIFY_FAILS_END -} - -void testHEX8ArrayWithinDeltaActualNullAndMessage(void) -{ - UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX8ArrayWithinDeltaSamePointer(void) -{ - UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - - TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, expected, 3); -} - -void testHEX8ArrayWithinDeltaSamePointerAndMessage(void) -{ - UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, expected, 3, "Custom Message."); -} - -void testEqualIntArrays(void) -{ - int p0[] = {1, 8, 987, -2}; - int p1[] = {1, 8, 987, -2}; - int p2[] = {1, 8, 987, 2}; - int p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p3, 1); - TEST_ASSERT_EQUAL_INT_ARRAY(NULL, NULL, 1); -} - -void testNotEqualIntArraysNullExpected(void) -{ - int* p0 = NULL; - int p1[] = {1, 8, 987, 2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualIntArraysNullActual(void) -{ - int* p1 = NULL; - int p0[] = {1, 8, 987, 2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualIntArrays1(void) -{ - int p0[] = {1, 8, 987, -2}; - int p1[] = {1, 8, 987, 2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualIntArrays2(void) -{ - int p0[] = {1, 8, 987, -2}; - int p1[] = {2, 8, 987, -2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualIntArrays3(void) -{ - int p0[] = {1, 8, 987, -2}; - int p1[] = {1, 8, 986, -2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualIntArraysLengthZero(void) -{ - UNITY_UINT32 p0[1] = {1}; - UNITY_UINT32 p1[1] = {1}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 0); - VERIFY_FAILS_END -} - -void testEqualIntEachEqual(void) -{ - int p0[] = {1, 1, 1, 1}; - int p1[] = {987, 987, 987, 987}; - int p2[] = {-2, -2, -2, -3}; - int p3[] = {1, 5, 600, 700}; - - TEST_ASSERT_EACH_EQUAL_INT(1, p0, 1); - TEST_ASSERT_EACH_EQUAL_INT(1, p0, 4); - TEST_ASSERT_EACH_EQUAL_INT(987, p1, 4); - TEST_ASSERT_EACH_EQUAL_INT(-2, p2, 3); - TEST_ASSERT_EACH_EQUAL_INT(1, p3, 1); -} - -void testNotEqualIntEachEqualNullActual(void) -{ - int* p1 = NULL; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_INT(1, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualIntEachEqual1(void) -{ - int p0[] = {1, 1, 1, -2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_INT(1, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualIntEachEqual2(void) -{ - int p0[] = {-5, -5, -1, -5}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_INT(-5, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualIntEachEqual3(void) -{ - int p0[] = {1, 88, 88, 88}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_INT(88, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualEachEqualLengthZero(void) -{ - UNITY_UINT32 p0[1] = {1}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_INT(0, p0, 0); - VERIFY_FAILS_END -} - -void testEqualPtrArrays(void) -{ - char A = 1; - char B = 2; - char C = 3; - char* p0[] = {&A, &B, &C}; - char* p1[] = {&A, &B, &C, &A}; - char* p2[] = {&A, &B}; - char* p3[] = {&A}; - - TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p0, 3); - TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p1, 3); - TEST_ASSERT_EQUAL_PTR_ARRAY(p1, p2, 2); - TEST_ASSERT_EQUAL_PTR_ARRAY(p3, p0, 1); -} - -void testNotEqualPtrArraysNullExpected(void) -{ - char A = 1; - char B = 2; - char** p0 = NULL; - char* p1[] = {&A, &B}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p1, 2); - VERIFY_FAILS_END -} - -void testNotEqualPtrArraysNullActual(void) -{ - char A = 1; - char B = 2; - char** p0 = NULL; - char* p1[] = {&A, &B}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_PTR_ARRAY(p1, p0, 2); - VERIFY_FAILS_END -} - -void testNotEqualPtrArrays1(void) -{ - char A = 1; - char B = 2; - char C = 3; - char* p0[] = {&A, &B, &C, &B}; - char* p1[] = {&A, &B, &C, &A}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualPtrArrays2(void) -{ - char A = 1; - char B = 2; - char C = 3; - char* p0[] = {&B, &B, &C, &A}; - char* p1[] = {&A, &B, &C, &A}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualPtrArrays3(void) -{ - char A = 1; - char B = 2; - char C = 3; - char* p0[] = {&A, &B, &B, &A}; - char* p1[] = {&A, &B, &C, &A}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualPtrEachEqual(void) -{ - char A = 1; - char B = 2; - char C = 3; - char* p0[] = {&A, &A, &A}; - char* p1[] = {&A, &B, &C, &A}; - char* p2[] = {&B, &B}; - char* p3[] = {&C}; - - TEST_ASSERT_EACH_EQUAL_PTR(&A, p0, 1); - TEST_ASSERT_EACH_EQUAL_PTR(&A, p0, 3); - TEST_ASSERT_EACH_EQUAL_PTR(&A, p1, 1); - TEST_ASSERT_EACH_EQUAL_PTR(&B, p2, 2); - TEST_ASSERT_EACH_EQUAL_PTR(&C, p3, 1); -} - -void testNotEqualPtrEachEqualNullExpected(void) -{ - char A = 1; - char B = 1; - char* p0[] = {&A, &B}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_PTR(&A, p0, 2); - VERIFY_FAILS_END -} - -void testNotEqualPtrEachEqualNullActual(void) -{ - char A = 1; - char** p0 = NULL; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_PTR(&A, p0, 2); - VERIFY_FAILS_END -} - -void testNotEqualPtrEachEqual1(void) -{ - char A = 1; - char B = 1; - char* p0[] = {&A, &A, &A, &B}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_PTR(&A, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualPtrEachEqual2(void) -{ - char A = 1; - char B = 1; - char* p0[] = {&B, &B, &A, &B}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_PTR(&B, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualPtrEachEqual3(void) -{ - char A = 1; - char B = 1; - char* p0[] = {&A, &B, &B, &B}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_PTR(&B, p0, 4); - VERIFY_FAILS_END -} - -void testEqualInt8Arrays(void) -{ - UNITY_INT8 p0[] = {1, 8, 117, -2}; - UNITY_INT8 p1[] = {1, 8, 117, -2}; - UNITY_INT8 p2[] = {1, 8, 117, 2}; - UNITY_INT8 p3[] = {1, 50, 60, 70}; - - TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p3, 1); -} - -void testNotEqualInt8Arrays(void) -{ - UNITY_INT8 p0[] = {1, 8, 36, -2}; - UNITY_INT8 p1[] = {1, 8, 36, 2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualInt8EachEqual(void) -{ - UNITY_INT8 p0[] = {1, 1, 1, 1}; - UNITY_INT8 p1[] = {117, 117, 117, -2}; - UNITY_INT8 p2[] = {-1, -1, 117, 2}; - UNITY_INT8 p3[] = {1, 50, 60, 70}; - - TEST_ASSERT_EACH_EQUAL_INT8(1, p0, 1); - TEST_ASSERT_EACH_EQUAL_INT8(1, p0, 4); - TEST_ASSERT_EACH_EQUAL_INT8(117, p1, 3); - TEST_ASSERT_EACH_EQUAL_INT8(-1, p2, 2); - TEST_ASSERT_EACH_EQUAL_INT8(1, p3, 1); -} - -void testNotEqualInt8EachEqual(void) -{ - UNITY_INT8 p0[] = {1, 8, 36, -2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_INT8(1, p0, 2); - VERIFY_FAILS_END -} - -void testEqualCHARArrays(void) -{ - char p0[] = {1, 8, 117, -2}; - char p1[] = {1, 8, 117, -2}; - char p2[] = {1, 8, 117, 2}; - char p3[] = {1, 50, 60, 70}; - - TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p3, 1); -} - -void testNotEqualCHARArrays(void) -{ - char p0[] = {1, 8, 36, -2}; - char p1[] = {1, 8, 36, 2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualCHAREachEqual(void) -{ - char p0[] = {1, 1, 1, 1}; - char p1[] = {117, 117, 117, -2}; - char p2[] = {-1, -1, 117, 2}; - char p3[] = {1, 50, 60, 70}; - - TEST_ASSERT_EACH_EQUAL_CHAR(1, p0, 1); - TEST_ASSERT_EACH_EQUAL_CHAR(1, p0, 4); - TEST_ASSERT_EACH_EQUAL_CHAR(117, p1, 3); - TEST_ASSERT_EACH_EQUAL_CHAR(-1, p2, 2); - TEST_ASSERT_EACH_EQUAL_CHAR(1, p3, 1); -} - -void testNotEqualCHAREachEqual(void) -{ - char p0[] = {1, 8, 36, -2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_CHAR(1, p0, 2); - VERIFY_FAILS_END -} - -void testEqualUIntArrays(void) -{ - unsigned int p0[] = {1, 8, 987, 65132u}; - unsigned int p1[] = {1, 8, 987, 65132u}; - unsigned int p2[] = {1, 8, 987, 2}; - unsigned int p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p3, 1); -} - -void testNotEqualUIntArrays1(void) -{ - unsigned int p0[] = {1, 8, 987, 65132u}; - unsigned int p1[] = {1, 8, 987, 65131u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualUIntArrays2(void) -{ - unsigned int p0[] = {1, 8, 987, 65132u}; - unsigned int p1[] = {2, 8, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualUIntArrays3(void) -{ - unsigned int p0[] = {1, 8, 987, 65132u}; - unsigned int p1[] = {1, 8, 986, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualUIntEachEqual(void) -{ - unsigned int p0[] = {1, 1, 1, 1}; - unsigned int p1[] = {65132u, 65132u, 65132u, 65132u}; - unsigned int p2[] = {8, 8, 987, 2}; - unsigned int p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EACH_EQUAL_UINT(1, p0, 1); - TEST_ASSERT_EACH_EQUAL_UINT(1, p0, 4); - TEST_ASSERT_EACH_EQUAL_UINT(65132u, p1, 4); - TEST_ASSERT_EACH_EQUAL_UINT(8, p2, 2); - TEST_ASSERT_EACH_EQUAL_UINT(1, p3, 1); -} - -void testNotEqualUIntEachEqual1(void) -{ - unsigned int p0[] = {1, 65132u, 65132u, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT(65132u, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualUIntEachEqual2(void) -{ - unsigned int p0[] = {987, 8, 987, 987}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT(987, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualUIntEachEqual3(void) -{ - unsigned int p0[] = {1, 1, 1, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT(1, p0, 4); - VERIFY_FAILS_END -} - -void testEqualInt16Arrays(void) -{ - UNITY_INT16 p0[] = {1, 8, 117, 3}; - UNITY_INT16 p1[] = {1, 8, 117, 3}; - UNITY_INT16 p2[] = {1, 8, 117, 2}; - UNITY_INT16 p3[] = {1, 50, 60, 70}; - - TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p3, 1); -} - -void testNotEqualInt16Arrays(void) -{ - UNITY_INT16 p0[] = {1, 8, 127, 3}; - UNITY_INT16 p1[] = {1, 8, 127, 2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualInt16EachEqual(void) -{ - UNITY_INT16 p0[] = {1, 1, 1, 1}; - UNITY_INT16 p1[] = {32111, 32111, 32111, 3}; - UNITY_INT16 p2[] = {-1, -1, -1, 2}; - UNITY_INT16 p3[] = {1, 50, 60, 70}; - - TEST_ASSERT_EACH_EQUAL_INT16(1, p0, 1); - TEST_ASSERT_EACH_EQUAL_INT16(1, p0, 4); - TEST_ASSERT_EACH_EQUAL_INT16(32111, p1, 3); - TEST_ASSERT_EACH_EQUAL_INT16(-1, p2, 3); - TEST_ASSERT_EACH_EQUAL_INT16(1, p3, 1); -} - -void testNotEqualInt16EachEqual(void) -{ - UNITY_INT16 p0[] = {127, 127, 127, 3}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_INT16(127, p0, 4); - VERIFY_FAILS_END -} - -void testEqualInt32Arrays(void) -{ - UNITY_INT32 p0[] = {1, 8, 117, 3}; - UNITY_INT32 p1[] = {1, 8, 117, 3}; - UNITY_INT32 p2[] = {1, 8, 117, 2}; - UNITY_INT32 p3[] = {1, 50, 60, 70}; - - TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p3, 1); -} - -void testNotEqualInt32Arrays(void) -{ - UNITY_INT32 p0[] = {1, 8, 127, 3}; - UNITY_INT32 p1[] = {1, 8, 127, 2}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualInt32EachEqual(void) -{ - UNITY_INT32 p0[] = {8, 8, 8, 8}; - UNITY_INT32 p1[] = {65537, 65537, 65537, 65537}; - UNITY_INT32 p2[] = {-3, -3, -3, 2}; - UNITY_INT32 p3[] = {1, 50, 60, 70}; - - TEST_ASSERT_EACH_EQUAL_INT32(8, p0, 1); - TEST_ASSERT_EACH_EQUAL_INT32(8, p0, 4); - TEST_ASSERT_EACH_EQUAL_INT32(65537, p1, 4); - TEST_ASSERT_EACH_EQUAL_INT32(-3, p2, 3); - TEST_ASSERT_EACH_EQUAL_INT32(1, p3, 1); -} - -void testNotEqualInt32EachEqual(void) -{ - UNITY_INT32 p0[] = {127, 8, 127, 127}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_INT32(127, p0, 4); - VERIFY_FAILS_END -} - -void testEqualUINT8Arrays(void) -{ - UNITY_UINT8 p0[] = {1, 8, 100, 127}; - UNITY_UINT8 p1[] = {1, 8, 100, 127}; - UNITY_UINT8 p2[] = {1, 8, 100, 2}; - UNITY_UINT8 p3[] = {1, 50, 60, 70}; - - TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p3, 1); -} - -void testNotEqualUINT8Arrays1(void) -{ - unsigned char p0[] = {1, 8, 100, 127u}; - unsigned char p1[] = {1, 8, 100, 255u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT8Arrays2(void) -{ - unsigned char p0[] = {1, 8, 100, 127u}; - unsigned char p1[] = {1, 8, 100, 255u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT8Arrays3(void) -{ - unsigned char p0[] = {1, 8, 100, 127u}; - unsigned char p1[] = {1, 8, 100, 255u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - - -void testEqualUINT16Arrays(void) -{ - unsigned short p0[] = {1, 8, 987, 65132u}; - unsigned short p1[] = {1, 8, 987, 65132u}; - unsigned short p2[] = {1, 8, 987, 2}; - unsigned short p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p3, 1); -} - -void testNotEqualUINT16Arrays1(void) -{ - unsigned short p0[] = {1, 8, 987, 65132u}; - unsigned short p1[] = {1, 8, 987, 65131u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT16Arrays2(void) -{ - unsigned short p0[] = {1, 8, 987, 65132u}; - unsigned short p1[] = {2, 8, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT16Arrays3(void) -{ - unsigned short p0[] = {1, 8, 987, 65132u}; - unsigned short p1[] = {1, 8, 986, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualUINT32Arrays(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p2[] = {1, 8, 987, 2}; - UNITY_UINT32 p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p3, 1); -} - -void testNotEqualUINT32Arrays1(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {1, 8, 987, 65131u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT32Arrays2(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {2, 8, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT32Arrays3(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {1, 8, 986, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualHEXArrays(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p2[] = {1, 8, 987, 2}; - UNITY_UINT32 p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p3, 1); -} - -void testNotEqualHEXArrays1(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {1, 8, 987, 65131u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEXArrays2(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {2, 8, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEXArrays3(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {1, 8, 986, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualHEX32Arrays(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p2[] = {1, 8, 987, 2}; - UNITY_UINT32 p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p3, 1); -} - -void testNotEqualHEX32Arrays1(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {1, 8, 987, 65131u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX32Arrays2(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {2, 8, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX32Arrays3(void) -{ - UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT32 p1[] = {1, 8, 986, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualHEX16Arrays(void) -{ - unsigned short p0[] = {1, 8, 987, 65132u}; - unsigned short p1[] = {1, 8, 987, 65132u}; - unsigned short p2[] = {1, 8, 987, 2}; - unsigned short p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p3, 1); -} - -void testNotEqualHEX16Arrays1(void) -{ - unsigned short p0[] = {1, 8, 987, 65132u}; - unsigned short p1[] = {1, 8, 987, 65131u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX16Arrays2(void) -{ - unsigned short p0[] = {1, 8, 987, 65132u}; - unsigned short p1[] = {2, 8, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX16Arrays3(void) -{ - unsigned short p0[] = {1, 8, 987, 65132u}; - unsigned short p1[] = {1, 8, 986, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualHEX8Arrays(void) -{ - unsigned char p0[] = {1, 8, 254u, 123}; - unsigned char p1[] = {1, 8, 254u, 123}; - unsigned char p2[] = {1, 8, 254u, 2}; - unsigned char p3[] = {1, 23, 25, 26}; - - TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p3, 1); -} - -void testNotEqualHEX8Arrays1(void) -{ - unsigned char p0[] = {1, 8, 254u, 253u}; - unsigned char p1[] = {1, 8, 254u, 252u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX8Arrays2(void) -{ - unsigned char p0[] = {1, 8, 254u, 253u}; - unsigned char p1[] = {2, 8, 254u, 253u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX8Arrays3(void) -{ - unsigned char p0[] = {1, 8, 254u, 253u}; - unsigned char p1[] = {1, 8, 255u, 253u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -} - -void testEqualUINT8EachEqual(void) -{ - UNITY_UINT8 p0[] = {127u, 127u, 127u, 127u}; - UNITY_UINT8 p1[] = {1u, 1u, 1u, 1u}; - UNITY_UINT8 p2[] = {128u, 128u, 128u, 2u}; - UNITY_UINT8 p3[] = {1u, 50u, 60u, 70u}; - - TEST_ASSERT_EACH_EQUAL_UINT8(127u, p0, 1); - TEST_ASSERT_EACH_EQUAL_UINT8(127u, p0, 4); - TEST_ASSERT_EACH_EQUAL_UINT8(1u, p1, 4); - TEST_ASSERT_EACH_EQUAL_UINT8(128u, p2, 3); - TEST_ASSERT_EACH_EQUAL_UINT8(1u, p3, 1); -} - -void testNotEqualUINT8EachEqual1(void) -{ - unsigned char p0[] = {127u, 127u, 128u, 127u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT8(127u, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT8EachEqual2(void) -{ - unsigned char p0[] = {1, 1, 1, 127u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT8(1, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT8EachEqual3(void) -{ - unsigned char p0[] = {54u, 55u, 55u, 55u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT8(55u, p0, 4); - VERIFY_FAILS_END -} - -void testEqualUINT16EachEqual(void) -{ - unsigned short p0[] = {65132u, 65132u, 65132u, 65132u}; - unsigned short p1[] = {987, 987, 987, 987}; - unsigned short p2[] = {1, 1, 1, 2}; - unsigned short p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EACH_EQUAL_UINT16(65132u, p0, 1); - TEST_ASSERT_EACH_EQUAL_UINT16(65132u, p0, 4); - TEST_ASSERT_EACH_EQUAL_UINT16(987, p1, 4); - TEST_ASSERT_EACH_EQUAL_UINT16(1, p2, 3); - TEST_ASSERT_EACH_EQUAL_UINT16(1, p3, 1); -} - -void testNotEqualUINT16EachEqual1(void) -{ - unsigned short p0[] = {1, 65132u, 65132u, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT16(65132u, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT16EachEqual2(void) -{ - unsigned short p0[] = {65132u, 65132u, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT16(65132u, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT16EachEqual3(void) -{ - unsigned short p0[] = {65132u, 65132u, 65132u, 65133u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT16(65132u, p0, 4); - VERIFY_FAILS_END -} - -void testEqualUINT32EachEqual(void) -{ - UNITY_UINT32 p0[] = {65132u, 65132u, 65132u, 65132u}; - UNITY_UINT32 p1[] = {987, 987, 987, 987}; - UNITY_UINT32 p2[] = {8, 8, 8, 2}; - UNITY_UINT32 p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EACH_EQUAL_UINT32(65132u, p0, 1); - TEST_ASSERT_EACH_EQUAL_UINT32(65132u, p0, 4); - TEST_ASSERT_EACH_EQUAL_UINT32(987, p1, 4); - TEST_ASSERT_EACH_EQUAL_UINT32(8, p2, 3); - TEST_ASSERT_EACH_EQUAL_UINT32(1, p3, 1); -} - -void testNotEqualUINT32EachEqual1(void) -{ - UNITY_UINT32 p0[] = {65132u, 65132u, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT32(65132u, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT32EachEqual2(void) -{ - UNITY_UINT32 p0[] = {1, 987, 987, 987}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT32(987, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualUINT32EachEqual3(void) -{ - UNITY_UINT32 p0[] = {1, 1, 1, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_UINT32(1, p0, 4); - VERIFY_FAILS_END -} - -void testEqualHEXEachEqual(void) -{ - UNITY_UINT32 p0[] = {65132u, 65132u, 65132u, 65132u}; - UNITY_UINT32 p1[] = {987, 987, 987, 987}; - UNITY_UINT32 p2[] = {8, 8, 8, 2}; - UNITY_UINT32 p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EACH_EQUAL_HEX(65132u, p0, 1); - TEST_ASSERT_EACH_EQUAL_HEX(65132u, p0, 4); - TEST_ASSERT_EACH_EQUAL_HEX(987, p1, 4); - TEST_ASSERT_EACH_EQUAL_HEX(8, p2, 3); - TEST_ASSERT_EACH_EQUAL_HEX(1, p3, 1); -} - -void testNotEqualHEXEachEqual1(void) -{ - UNITY_UINT32 p0[] = {1, 65132u, 65132u, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX32(65132u, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEXEachEqual2(void) -{ - UNITY_UINT32 p0[] = {987, 987, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX32(987, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEXEachEqual3(void) -{ - UNITY_UINT32 p0[] = {8, 8, 987, 8}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX(8, p0, 4); - VERIFY_FAILS_END -} - -void testEqualHEX32EachEqual(void) -{ - UNITY_UINT32 p0[] = {65132u, 65132u, 65132u, 65132u}; - UNITY_UINT32 p1[] = {987, 987, 987, 987}; - UNITY_UINT32 p2[] = {8, 8, 8, 2}; - UNITY_UINT32 p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EACH_EQUAL_HEX32(65132u, p0, 1); - TEST_ASSERT_EACH_EQUAL_HEX32(65132u, p0, 4); - TEST_ASSERT_EACH_EQUAL_HEX32(987, p1, 4); - TEST_ASSERT_EACH_EQUAL_HEX32(8, p2, 3); - TEST_ASSERT_EACH_EQUAL_HEX32(1, p3, 1); -} - -void testNotEqualHEX32EachEqual1(void) -{ - UNITY_UINT32 p0[] = {65132u, 8, 65132u, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX32(65132u, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX32EachEqual2(void) -{ - UNITY_UINT32 p0[] = {1, 987, 987, 987}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX32(987, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX32EachEqual3(void) -{ - UNITY_UINT32 p0[] = {8, 8, 8, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX32(8, p0, 4); - VERIFY_FAILS_END -} - -void testEqualHEX16EachEqual(void) -{ - UNITY_UINT16 p0[] = {65132u, 65132u, 65132u, 65132u}; - UNITY_UINT16 p1[] = {987, 987, 987, 987}; - UNITY_UINT16 p2[] = {8, 8, 8, 2}; - UNITY_UINT16 p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EACH_EQUAL_HEX16(65132u, p0, 1); - TEST_ASSERT_EACH_EQUAL_HEX16(65132u, p0, 4); - TEST_ASSERT_EACH_EQUAL_HEX16(987, p1, 4); - TEST_ASSERT_EACH_EQUAL_HEX16(8, p2, 3); - TEST_ASSERT_EACH_EQUAL_HEX16(1, p3, 1); -} - -void testNotEqualHEX16EachEqual1(void) -{ - unsigned short p0[] = {65132u, 65132u, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX16(65132u, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX16EachEqual2(void) -{ - unsigned short p0[] = {1, 987, 987, 987}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX16(987, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX16EachEqual3(void) -{ - unsigned short p0[] = {8, 8, 8, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX16(8, p0, 4); - VERIFY_FAILS_END -} - -void testEqualHEX8EachEqual(void) -{ - unsigned char p0[] = {254u, 254u, 254u, 254u}; - unsigned char p1[] = {123, 123, 123, 123}; - unsigned char p2[] = {8, 8, 8, 2}; - unsigned char p3[] = {1, 23, 25, 26}; - - TEST_ASSERT_EACH_EQUAL_HEX8(254u, p0, 1); - TEST_ASSERT_EACH_EQUAL_HEX8(254u, p0, 4); - TEST_ASSERT_EACH_EQUAL_HEX8(123, p1, 4); - TEST_ASSERT_EACH_EQUAL_HEX8(8, p2, 3); - TEST_ASSERT_EACH_EQUAL_HEX8(1, p3, 1); -} - -void testNotEqualHEX8EachEqual1(void) -{ - unsigned char p0[] = {253u, 253u, 254u, 253u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX8(253u, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX8EachEqual2(void) -{ - unsigned char p0[] = {254u, 254u, 254u, 253u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX8(254u, p0, 4); - VERIFY_FAILS_END -} - -void testNotEqualHEX8EachEqual3(void) -{ - unsigned char p0[] = {1, 8, 8, 8}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_HEX8(8, p0, 4); - VERIFY_FAILS_END -} - -void testEqualHEX64Arrays(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT64 p1[] = {1, 8, 987, 65132u}; - UNITY_UINT64 p2[] = {1, 8, 987, 2}; - UNITY_UINT64 p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p3, 1); -#endif -} - -void testEqualUint64Arrays(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT64 p1[] = {1, 8, 987, 65132u}; - UNITY_UINT64 p2[] = {1, 8, 987, 2}; - UNITY_UINT64 p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p3, 1); -#endif -} - -void testEqualInt64Arrays(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 p0[] = {1, 8, 987, -65132}; - UNITY_INT64 p1[] = {1, 8, 987, -65132}; - UNITY_INT64 p2[] = {1, 8, 987, -2}; - UNITY_INT64 p3[] = {1, 500, 600, 700}; - - TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p3, 1); -#endif -} - - -void testNotEqualHEX64Arrays1(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT64 p1[] = {1, 8, 987, 65131u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualHEX64Arrays2(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT64 p1[] = {2, 8, 987, 65132u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualUint64Arrays(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 p0[] = {1, 8, 987, 65132u}; - UNITY_UINT64 p1[] = {1, 8, 987, 65131u}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualInt64Arrays(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 p0[] = {1, 8, 987, -65132}; - UNITY_INT64 p1[] = {1, 8, 987, -65131}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_core.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_core.c deleted file mode 100644 index d324e8619..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_core.c +++ /dev/null @@ -1,371 +0,0 @@ -/* ========================================== - 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] -========================================== */ - -#include "unity.h" -#define TEST_INSTANCES -#include "self_assessment_utils.h" - -static int SetToOneToFailInTearDown; -static int SetToOneMeanWeAlreadyCheckedThisGuy; - -void setUp(void) -{ - SetToOneToFailInTearDown = 0; - SetToOneMeanWeAlreadyCheckedThisGuy = 0; -} - -void tearDown(void) -{ - endPutcharSpy(); /* Stop suppressing test output */ - if (SetToOneToFailInTearDown == 1) - { - /* These will be skipped internally if already failed/ignored */ - TEST_FAIL_MESSAGE("<= Failed in tearDown"); - TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); - } - if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) - { - UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); - UNITY_OUTPUT_CHAR('\n'); - } -} - -void testUnitySizeInitializationReminder(void) -{ - /* This test ensures that sizeof(struct UNITY_STORAGE_T) doesn't change. If this - * test breaks, go look at the initialization of the Unity global variable - * in unity.c and make sure we're filling in the proper fields. */ - const char* message = "Unexpected size for UNITY_STORAGE_T struct. Please check that " - "the initialization of the Unity symbol in unity.c is " - "still correct."; - - /* Define a structure with all the same fields as `struct UNITY_STORAGE_T`. */ -#ifdef UNITY_EXCLUDE_DETAILS - struct { - const char* TestFile; - const char* CurrentTestName; - UNITY_LINE_TYPE CurrentTestLineNumber; - UNITY_COUNTER_TYPE NumberOfTests; - UNITY_COUNTER_TYPE TestFailures; - UNITY_COUNTER_TYPE TestIgnores; - UNITY_COUNTER_TYPE CurrentTestFailed; - UNITY_COUNTER_TYPE CurrentTestIgnored; -#ifdef UNITY_INCLUDE_EXEC_TIME - UNITY_TIME_TYPE CurrentTestStartTime; - UNITY_TIME_TYPE CurrentTestStopTime; -#endif -#ifndef UNITY_EXCLUDE_SETJMP_H - jmp_buf AbortFrame; -#endif - } _Expected_Unity; -#else - struct { - const char* TestFile; - const char* CurrentTestName; - const char* CurrentDetails1; - const char* CurrentDetails2; - UNITY_LINE_TYPE CurrentTestLineNumber; - UNITY_COUNTER_TYPE NumberOfTests; - UNITY_COUNTER_TYPE TestFailures; - UNITY_COUNTER_TYPE TestIgnores; - UNITY_COUNTER_TYPE CurrentTestFailed; - UNITY_COUNTER_TYPE CurrentTestIgnored; -#ifdef UNITY_INCLUDE_EXEC_TIME - UNITY_COUNTER_TYPE CurrentTestStartTime; - UNITY_COUNTER_TYPE CurrentTestStopTime; -#endif -#ifndef UNITY_EXCLUDE_SETJMP_H - jmp_buf AbortFrame; -#endif - } _Expected_Unity; -#endif - - /* Compare our fake structure's size to the actual structure's size. They - * should be the same. - * - * This accounts for alignment, padding, and packing issues that might come - * up between different architectures. */ - TEST_ASSERT_EQUAL_MESSAGE(sizeof(_Expected_Unity), sizeof(Unity), message); -} - -void testPassShouldEndImmediatelyWithPass(void) -{ - TEST_PASS(); - TEST_FAIL_MESSAGE("We should have passed already and finished this test"); -} - -void testPassShouldEndImmediatelyWithPassAndMessage(void) -{ - TEST_PASS_MESSAGE("Woohoo! This Automatically Passes!"); - TEST_FAIL_MESSAGE("We should have passed already and finished this test"); -} - -void testMessageShouldDisplayMessageWithoutEndingAndGoOnToPass(void) -{ - TEST_MESSAGE("This is just a message"); - TEST_MESSAGE("This is another message"); - TEST_PASS(); -} - -void testMessageShouldDisplayMessageWithoutEndingAndGoOnToFail(void) -{ - TEST_MESSAGE("This is yet another message"); - - EXPECT_ABORT_BEGIN - TEST_FAIL(); - VERIFY_FAILS_END -} - -void testTrue(void) -{ - TEST_ASSERT(1); - - TEST_ASSERT_TRUE(1); -} - -void testFalse(void) -{ - TEST_ASSERT_FALSE(0); - - TEST_ASSERT_UNLESS(0); -} - -void testSingleStatement(void) -{ - for(int i = 0; i < 2; i++) - { - /* TEST_ASSERT_TRUE should expand to a single C statement, minus - * the semicolon. This if-else will fail to compile otherwise. */ - if(i > 0) - TEST_ASSERT_TRUE(i); - else - TEST_ASSERT_FALSE(i); - } -} - -void testPreviousPass(void) -{ - TEST_ASSERT_EQUAL_INT(0U, Unity.TestFailures); -} - -void testNotVanilla(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT(0); - VERIFY_FAILS_END -} - -void testNotTrue(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_TRUE(0); - VERIFY_FAILS_END -} - -void testNotFalse(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_FALSE(1); - VERIFY_FAILS_END -} - -void testNotUnless(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UNLESS(1); - VERIFY_FAILS_END -} - -void testNotNotEqual(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL(10, 10); - VERIFY_FAILS_END -} - -void testFail(void) -{ - EXPECT_ABORT_BEGIN - TEST_FAIL_MESSAGE("Expected for testing"); - VERIFY_FAILS_END -} - -void testIsNull(void) -{ - char* ptr1 = NULL; - const char* ptr2 = "hello"; - - TEST_ASSERT_NULL(ptr1); - TEST_ASSERT_NOT_NULL(ptr2); -} - -void testIsNullShouldFailIfNot(void) -{ - const char* ptr1 = "hello"; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_NULL(ptr1); - VERIFY_FAILS_END -} - -void testNotNullShouldFailIfNULL(void) -{ - char* ptr1 = NULL; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_NULL(ptr1); - VERIFY_FAILS_END -} - -void testIsEmpty(void) -{ - const char* ptr1 = "\0"; - const char* ptr2 = "hello"; - - TEST_ASSERT_EMPTY(ptr1); - TEST_ASSERT_NOT_EMPTY(ptr2); -} - -void testIsEmptyShouldFailIfNot(void) -{ - const char* ptr1 = "hello"; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EMPTY(ptr1); - VERIFY_FAILS_END -} - -void testNotEmptyShouldFailIfEmpty(void) -{ - const char* ptr1 = "\0"; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EMPTY(ptr1); - VERIFY_FAILS_END -} - -void testIgnore(void) -{ - EXPECT_ABORT_BEGIN - TEST_IGNORE(); - TEST_FAIL_MESSAGE("This should not be reached"); - VERIFY_IGNORES_END -} - -void testIgnoreMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_IGNORE_MESSAGE("This is an expected TEST_IGNORE_MESSAGE string!"); - TEST_FAIL_MESSAGE("This should not be reached"); - VERIFY_IGNORES_END -} - -void testProtection(void) -{ - volatile int mask = 0; - - if (TEST_PROTECT()) - { - mask |= 1; - TEST_ABORT(); - } - else - { - Unity.CurrentTestFailed = 0; - mask |= 2; - } - - TEST_ASSERT_EQUAL(3, mask); -} - -void testIgnoredAndThenFailInTearDown(void) -{ - SetToOneToFailInTearDown = 1; - TEST_IGNORE(); -} - -void testFailureCountIncrementsAndIsReturnedAtEnd(void) -{ -#ifndef USING_OUTPUT_SPY - TEST_IGNORE(); -#else - UNITY_UINT savedFailures = Unity.TestFailures; - Unity.CurrentTestFailed = 1; - startPutcharSpy(); /* Suppress output */ - startFlushSpy(); - TEST_ASSERT_EQUAL(0, getFlushSpyCalls()); - UnityConcludeTest(); - endPutcharSpy(); - TEST_ASSERT_EQUAL(savedFailures + 1, Unity.TestFailures); -#if defined(UNITY_OUTPUT_FLUSH) && defined(UNITY_OUTPUT_FLUSH_HEADER_DECLARATION) - TEST_ASSERT_EQUAL(1, getFlushSpyCalls()); -#else - TEST_ASSERT_EQUAL(0, getFlushSpyCalls()); -#endif - endFlushSpy(); - - startPutcharSpy(); /* Suppress output */ - int failures = UnityEnd(); - Unity.TestFailures--; - endPutcharSpy(); - TEST_ASSERT_EQUAL(savedFailures + 1, failures); -#endif -} - -/* ===================== THESE TEST WILL RUN IF YOUR CONFIG INCLUDES DETAIL SUPPORT ================== */ - -void testThatDetailsCanBeHandleOneDetail(void) -{ -#ifdef UNITY_EXCLUDE_DETAILS - TEST_IGNORE(); -#else - UNITY_SET_DETAIL("Detail1"); - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT_MESSAGE(5, 6, "Should Fail And Say Detail1"); - VERIFY_FAILS_END -#endif -} - -void testThatDetailsCanHandleTestFail(void) -{ -#ifdef UNITY_EXCLUDE_DETAILS - TEST_IGNORE(); -#else - UNITY_SET_DETAILS("Detail1","Detail2"); - - EXPECT_ABORT_BEGIN - TEST_FAIL_MESSAGE("Should Fail And Say Detail1 and Detail2"); - VERIFY_FAILS_END -#endif -} - -void testThatDetailsCanBeHandleTwoDetails(void) -{ -#ifdef UNITY_EXCLUDE_DETAILS - TEST_IGNORE(); -#else - UNITY_SET_DETAILS("Detail1","Detail2"); - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX8_MESSAGE(7, 8, "Should Fail And Say Detail1 and Detail2"); - VERIFY_FAILS_END -#endif -} - -void testThatDetailsCanBeHandleSingleDetailClearingTwoDetails(void) -{ -#ifdef UNITY_EXCLUDE_DETAILS - TEST_IGNORE(); -#else - UNITY_SET_DETAILS("Detail1","Detail2"); - UNITY_SET_DETAIL("DetailNew"); - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_MESSAGE("MEH", "GUH", "Should Fail And Say DetailNew"); - VERIFY_FAILS_END -#endif -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_doubles.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_doubles.c deleted file mode 100644 index 1bdedbc33..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_doubles.c +++ /dev/null @@ -1,773 +0,0 @@ -/* ========================================== - 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] -========================================== */ - -#include "unity.h" -#define TEST_INSTANCES -#include "self_assessment_utils.h" - -static int SetToOneToFailInTearDown; -static int SetToOneMeanWeAlreadyCheckedThisGuy; - -void setUp(void) -{ - SetToOneToFailInTearDown = 0; - SetToOneMeanWeAlreadyCheckedThisGuy = 0; -} - -void tearDown(void) -{ - endPutcharSpy(); /* Stop suppressing test output */ - if (SetToOneToFailInTearDown == 1) - { - /* These will be skipped internally if already failed/ignored */ - TEST_FAIL_MESSAGE("<= Failed in tearDown"); - TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); - } - if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) - { - UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); - UNITY_OUTPUT_CHAR('\n'); - } -} - -void testDoublesWithinDelta(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_DOUBLE_WITHIN(0.00003, 187245.03485, 187245.03488); - TEST_ASSERT_DOUBLE_WITHIN(1.0, 187245.0, 187246.0); - TEST_ASSERT_DOUBLE_WITHIN(0.05, 9273.2549, 9273.2049); - TEST_ASSERT_DOUBLE_WITHIN(0.007, -726.93725, -726.94424); -#endif -} - -void testDoublesNotWithinDelta(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_WITHIN(0.05, 9273.2649, 9273.2049); - VERIFY_FAILS_END -#endif -} - - -void testDoublesEqual(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_DOUBLE(187245123456.0, 187245123456.0); - TEST_ASSERT_EQUAL_DOUBLE(187241234567.5, 187241234567.6); - TEST_ASSERT_EQUAL_DOUBLE(9273.2512345649, 9273.25123455699); - TEST_ASSERT_EQUAL_DOUBLE(-726.12345693724, -726.1234569374); -#endif -} - -void testDoublesNotEqual(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE(9273.9649, 9273.0049); - VERIFY_FAILS_END -#endif -} - -void testDoublesNotEqualNegative1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE(-9273.9649, -9273.0049); - VERIFY_FAILS_END -#endif -} - -void testDoublesNotEqualNegative2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE(-9273.0049, -9273.9649); - VERIFY_FAILS_END -#endif -} - -void testDoublesNotEqualActualNaN(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE(85.963, 0.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoublesNotEqualExpectedNaN(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE(0.0 / d_zero, 85.963); - VERIFY_FAILS_END -#endif -} - -void testDoublesEqualBothNaN(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_DOUBLE(0.0 / d_zero, 0.0 / d_zero); -#endif -} - -void testDoublesNotEqualInfNaN(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE(1.0 / d_zero, 0.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoublesNotEqualNaNInf(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE(0.0 / d_zero, 1.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoublesNotEqualActualInf(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE(321.642, 1.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoublesNotEqualExpectedInf(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE(1.0 / d_zero, 321.642); - VERIFY_FAILS_END -#endif -} - -void testDoublesEqualBothInf(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_DOUBLE(1.0 / d_zero, 1.0 / d_zero); -#endif -} - -void testDoublesNotEqualPlusMinusInf(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE(1.0 / d_zero, -1.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoubleIsPosInf1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_DOUBLE_IS_INF(2.0 / d_zero); -#endif -} - -void testDoubleIsPosInf2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_IS_NOT_INF(2.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoubleIsNegInf1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_DOUBLE_IS_NEG_INF(-3.0 / d_zero); -#endif -} - -void testDoubleIsNegInf2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(-3.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoubleIsNotPosInf1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_IS_INF(2.0); - VERIFY_FAILS_END -#endif -} - -void testDoubleIsNotPosInf2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_DOUBLE_IS_NOT_INF(2.0); -#endif -} - -void testDoubleIsNotNegInf(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_IS_NEG_INF(-999.876); - VERIFY_FAILS_END -#endif -} - -void testDoubleIsNan1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_DOUBLE_IS_NAN(0.0 / d_zero); -#endif -} - -void testDoubleIsNan2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_IS_NOT_NAN(0.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoubleIsNotNan1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_IS_NAN(234.9); - VERIFY_FAILS_END -#endif -} - -void testDoubleIsNotNan2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_DOUBLE_IS_NOT_NAN(234.9); -#endif -} - -void testDoubleInfIsNotNan(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_IS_NAN(1.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoubleNanIsNotInf(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_IS_INF(0.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoubleIsDeterminate1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_DOUBLE_IS_DETERMINATE(0.0); - TEST_ASSERT_DOUBLE_IS_DETERMINATE(123.3); - TEST_ASSERT_DOUBLE_IS_DETERMINATE(-88.3); -#endif -} - -void testDoubleIsDeterminate2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(-88.3); - VERIFY_FAILS_END -#endif -} - -void testDoubleIsNotDeterminate1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(1.0 / d_zero); - TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(-1.0 / d_zero); - TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(0.0 / d_zero); -#endif -} - -void testDoubleIsNotDeterminate2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_DOUBLE_IS_DETERMINATE(-1.0 / d_zero); - VERIFY_FAILS_END -#endif -} - -void testDoubleTraitFailsOnInvalidTrait(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - UnityAssertDoubleSpecial(1.0, NULL, __LINE__, UNITY_FLOAT_INVALID_TRAIT); - VERIFY_FAILS_END -#endif -} - -void testEqualDoubleArrays(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {1.0, -8.0, 25.4, -0.123}; - double p1[] = {1.0, -8.0, 25.4, -0.123}; - double p2[] = {1.0, -8.0, 25.4, -0.2}; - double p3[] = {1.0, -23.0, 25.0, -0.26}; - - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p3, 1); - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(NULL, NULL, 1); -#endif -} - -void testNotEqualDoubleArraysExpectedNull(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double* p0 = NULL; - double p1[] = {1.0, 8.0, 25.4, 0.252}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleArraysActualNull(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {1.0, 8.0, 25.4, 0.253}; - double* p1 = NULL; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleArrays1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {1.0, 8.0, 25.4, 0.25666666667}; - double p1[] = {1.0, 8.0, 25.4, 0.25666666666}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleArrays2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {1.0, 8.0, 25.4, 0.253}; - double p1[] = {2.0, 8.0, 25.4, 0.253}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleArrays3(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {1.0, 8.0, 25.4, 0.253}; - double p1[] = {1.0, 8.0, 25.5, 0.253}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleArraysNegative1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {-1.0, -8.0, -25.4, -0.2566666667}; - double p1[] = {-1.0, -8.0, -25.4, -0.2566666666}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleArraysNegative2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {-1.0, -8.0, -25.4, -0.253}; - double p1[] = {-2.0, -8.0, -25.4, -0.253}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleArraysNegative3(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {-1.0, -8.0, -25.4, -0.253}; - double p1[] = {-1.0, -8.0, -25.5, -0.253}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testEqualDoubleArraysNaN(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {1.0, 0.0 / d_zero, 25.4, 0.253}; - double p1[] = {1.0, 0.0 / d_zero, 25.4, 0.253}; - - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); -#endif -} - -void testEqualDoubleArraysInf(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {1.0, 1.0 / d_zero, 25.4, 0.253}; - double p1[] = {1.0, 1.0 / d_zero, 25.4, 0.253}; - - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); -#endif -} - -void testNotEqualDoubleArraysLengthZero(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[1] = {0.0}; - double p1[1] = {0.0}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 0); - VERIFY_FAILS_END -#endif -} - -void testEqualDoubleEachEqual(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {1.0, 1.0, 1.0, 1.0}; - double p1[] = {-0.123, -0.123, -0.123, -0.123}; - double p2[] = {25.4, 25.4, 25.4, -0.2}; - double p3[] = {1.0, -23.0, 25.0, -0.26}; - - TEST_ASSERT_EACH_EQUAL_DOUBLE(1.0, p0, 1); - TEST_ASSERT_EACH_EQUAL_DOUBLE(1.0, p0, 4); - TEST_ASSERT_EACH_EQUAL_DOUBLE(-0.123, p1, 4); - TEST_ASSERT_EACH_EQUAL_DOUBLE(25.4, p2, 3); - TEST_ASSERT_EACH_EQUAL_DOUBLE(1.0, p3, 1); -#endif -} - -void testNotEqualDoubleEachEqualActualNull(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double* p0 = NULL; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_DOUBLE(5, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleEachEqual1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {0.253, 8.0, 0.253, 0.253}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_DOUBLE(0.253, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleEachEqual2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {8.0, 8.0, 8.0, 0.253}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_DOUBLE(8.0, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleEachEqual3(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {1.0, 1.0, 1.0, 0.253}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_DOUBLE(1.0, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleEachEqualNegative1(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {-1.0, -0.253, -0.253, -0.253}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_DOUBLE(-0.253, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleEachEqualNegative2(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {-25.4, -8.0, -25.4, -25.4}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_DOUBLE(-25.4, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualDoubleEachEqualNegative3(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {-8.0, -8.0, -8.0, -0.253}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_DOUBLE(-8.0, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testEqualDoubleEachEqualNaN(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {0.0 / d_zero, 0.0 / d_zero, 0.0 / d_zero, 0.0 / d_zero}; - - TEST_ASSERT_EACH_EQUAL_DOUBLE(0.0 / d_zero, p0, 4); -#endif -} - -void testEqualDoubleEachEqualInf(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[] = {1.0 / d_zero, 1.0 / d_zero, 25.4, 0.253}; - - TEST_ASSERT_EACH_EQUAL_DOUBLE(1.0 / d_zero, p0, 2); -#endif -} - -void testNotEqualDoubleEachEqualLengthZero(void) -{ -#ifdef UNITY_EXCLUDE_DOUBLE - TEST_IGNORE(); -#else - double p0[1] = {0.0}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_DOUBLE(0.0, p0, 0); - VERIFY_FAILS_END -#endif -} - -void testDoublePrinting(void) -{ -#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_EXCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_PRINT_FLOATING("0", 0.0); - TEST_ASSERT_EQUAL_PRINT_FLOATING("4.99e-07", 0.000000499); - TEST_ASSERT_EQUAL_PRINT_FLOATING("5.0000005e-07", 0.00000050000005); - TEST_ASSERT_EQUAL_PRINT_FLOATING("0.100469499", 0.100469499); - TEST_ASSERT_EQUAL_PRINT_FLOATING("1", 0.9999999995); /*Rounding to int place*/ - TEST_ASSERT_EQUAL_PRINT_FLOATING("1", 1.0); - TEST_ASSERT_EQUAL_PRINT_FLOATING("1.25", 1.25); - TEST_ASSERT_EQUAL_PRINT_FLOATING("7.99999999", 7.99999999); /*Not rounding*/ - TEST_ASSERT_EQUAL_PRINT_FLOATING("16.0000002", 16.0000002); - TEST_ASSERT_EQUAL_PRINT_FLOATING("16.0000004", 16.0000004); - TEST_ASSERT_EQUAL_PRINT_FLOATING("16.0000006", 16.0000006); - TEST_ASSERT_EQUAL_PRINT_FLOATING("999999999", 999999999.0); /*Last full print integer*/ - - TEST_ASSERT_EQUAL_PRINT_FLOATING("0", -0.0); /* -0 no supported on all targets */ - TEST_ASSERT_EQUAL_PRINT_FLOATING("-4.99e-07", -0.000000499); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-5.0000005e-07", -0.00000050000005); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-0.100469499", -0.100469499); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-1", -0.9999999995); /*Rounding to int place*/ - TEST_ASSERT_EQUAL_PRINT_FLOATING("-1", -1.0); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-1.25", -1.25); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-7.99999999", -7.99999999); /*Not rounding*/ - TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.0000002", -16.0000002); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.0000004", -16.0000004); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.0000006", -16.0000006); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-999999999", -999999999.0); /*Last full print integer*/ - - TEST_ASSERT_EQUAL_PRINT_FLOATING("0.1004695", 0.10046949999999999); - TEST_ASSERT_EQUAL_PRINT_FLOATING("4.2949673e+09", 4294967295.9); - TEST_ASSERT_EQUAL_PRINT_FLOATING("4.2949673e+09", 4294967296.0); - TEST_ASSERT_EQUAL_PRINT_FLOATING("1e+10", 9999999995.0); - TEST_ASSERT_EQUAL_PRINT_FLOATING("9.00719925e+15", 9007199254740990.0); - TEST_ASSERT_EQUAL_PRINT_FLOATING("7e+100", 7.0e+100); - TEST_ASSERT_EQUAL_PRINT_FLOATING("3e+200", 3.0e+200); - TEST_ASSERT_EQUAL_PRINT_FLOATING("9.23456789e+300", 9.23456789e+300); - - TEST_ASSERT_EQUAL_PRINT_FLOATING("-0.1004695", -0.10046949999999999); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-4.2949673e+09", -4294967295.9); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-4.2949673e+09", -4294967296.0); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-7e+100", -7.0e+100); -#endif -} - -void testDoublePrintingRoundTiesToEven(void) -{ -#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_EXCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) - TEST_IGNORE(); -#else - #ifdef UNITY_ROUND_TIES_AWAY_FROM_ZERO - TEST_ASSERT_EQUAL_PRINT_FLOATING("1.00000001e+10", 10000000050.0); - TEST_ASSERT_EQUAL_PRINT_FLOATING("9.00719925e+15", 9007199245000000.0); - #else /* Default to Round ties to even */ - TEST_ASSERT_EQUAL_PRINT_FLOATING("1e+10", 10000000050.0); - TEST_ASSERT_EQUAL_PRINT_FLOATING("9.00719924e+15", 9007199245000000.0); - #endif -#endif -} - -void testDoublePrintingInfinityAndNaN(void) -{ -#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_EXCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_PRINT_FLOATING("inf", 1.0 / d_zero); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-inf", -1.0 / d_zero); - - TEST_ASSERT_EQUAL_PRINT_FLOATING("nan", 0.0 / d_zero); -#endif -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_floats.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_floats.c deleted file mode 100644 index e89bec20e..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_floats.c +++ /dev/null @@ -1,884 +0,0 @@ -/* ========================================== - 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] -========================================== */ - -#include "unity.h" -#define TEST_INSTANCES -#include "self_assessment_utils.h" - -static int SetToOneToFailInTearDown; -static int SetToOneMeanWeAlreadyCheckedThisGuy; - -void setUp(void) -{ - SetToOneToFailInTearDown = 0; - SetToOneMeanWeAlreadyCheckedThisGuy = 0; -} - -void tearDown(void) -{ - endPutcharSpy(); /* Stop suppressing test output */ - if (SetToOneToFailInTearDown == 1) - { - /* These will be skipped internally if already failed/ignored */ - TEST_FAIL_MESSAGE("<= Failed in tearDown"); - TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); - } - if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) - { - UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); - UNITY_OUTPUT_CHAR('\n'); - } -} - -void testFloatsWithinDelta(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_FLOAT_WITHIN(0.00003f, 187245.03485f, 187245.03488f); - TEST_ASSERT_FLOAT_WITHIN(1.0f, 187245.0f, 187246.0f); - TEST_ASSERT_FLOAT_WITHIN(0.05f, 9273.2549f, 9273.2049f); - TEST_ASSERT_FLOAT_WITHIN(0.007f, -726.93724f, -726.94424f); -#endif -} - -void testFloatsNotWithinDelta(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_WITHIN(0.05f, 9273.2649f, 9273.2049f); - VERIFY_FAILS_END -#endif -} - -void testFloatsEqual(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_FLOAT(187245.0f, 187246.0f); - TEST_ASSERT_EQUAL_FLOAT(18724.5f, 18724.6f); - TEST_ASSERT_EQUAL_FLOAT(9273.2549f, 9273.2599f); - TEST_ASSERT_EQUAL_FLOAT(-726.93724f, -726.9374f); -#endif -} - -void testFloatsNotEqual(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT(9273.9649f, 9273.0049f); - VERIFY_FAILS_END -#endif -} - -void testFloatsNotEqualNegative1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT(-9273.9649f, -9273.0049f); - VERIFY_FAILS_END -#endif -} - -void testFloatsNotEqualNegative2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT(-9273.0049f, -9273.9649f); - VERIFY_FAILS_END -#endif -} - -void testFloatsNotEqualActualNaN(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT(85.963f, 0.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatsNotEqualExpectedNaN(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT(0.0f / f_zero, 85.963f); - VERIFY_FAILS_END -#endif -} - -void testFloatsEqualBothNaN(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_FLOAT(0.0f / f_zero, 0.0f / f_zero); -#endif -} - -void testFloatsNotEqualInfNaN(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT(1.0f / f_zero, 0.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatsNotEqualNaNInf(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT(0.0f / f_zero, 1.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatsNotEqualActualInf(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT(321.642f, 1.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatsNotEqualExpectedInf(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT(1.0f / f_zero, 321.642f); - VERIFY_FAILS_END -#endif -} - -void testFloatsEqualBothInf(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_FLOAT(1.0f / f_zero, 1.0f / f_zero); -#endif -} - -void testFloatsNotEqualPlusMinusInf(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT(1.0f / f_zero, -1.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatIsPosInf1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_FLOAT_IS_INF(2.0f / f_zero); -#endif -} - -void testFloatIsPosInf2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_IS_NOT_INF(2.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatIsNegInf1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_FLOAT_IS_NEG_INF(-3.0f / f_zero); -#endif -} - -void testFloatIsNegInf2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(-3.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatIsNotPosInf1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_IS_INF(2.0f); - VERIFY_FAILS_END -#endif -} - -void testFloatIsNotPosInf2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_FLOAT_IS_NOT_INF(2.0f); -#endif -} - -void testFloatIsNotNegInf(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_IS_NEG_INF(-999.876f); - VERIFY_FAILS_END -#endif -} - -void testFloatIsNan1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_FLOAT_IS_NAN(0.0f / f_zero); -#endif -} - -void testFloatIsNan2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_IS_NOT_NAN(0.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatIsNotNan1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_IS_NAN(234.9f); - VERIFY_FAILS_END -#endif -} - -void testFloatIsNotNan2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_FLOAT_IS_NOT_NAN(234.9f); -#endif -} - -void testFloatInfIsNotNan(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_IS_NAN(1.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatNanIsNotInf(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_IS_INF(0.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatIsDeterminate1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_FLOAT_IS_DETERMINATE(0.0f); - TEST_ASSERT_FLOAT_IS_DETERMINATE(123.3f); - TEST_ASSERT_FLOAT_IS_DETERMINATE(-88.3f); -#endif -} - -void testFloatIsDeterminate2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(-88.3f); - VERIFY_FAILS_END -#endif -} - -void testFloatIsNotDeterminate1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(1.0f / f_zero); - TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(-1.0f / f_zero); - TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(0.0f / f_zero); -#endif -} - -void testFloatIsNotDeterminate2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_FLOAT_IS_DETERMINATE(-1.0f / f_zero); - VERIFY_FAILS_END -#endif -} - -void testFloatTraitFailsOnInvalidTrait(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - UnityAssertFloatSpecial(1.0f, NULL, __LINE__, UNITY_FLOAT_INVALID_TRAIT); - VERIFY_FAILS_END -#endif -} - -void testEqualFloatArrays(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {1.0f, -8.0f, 25.4f, -0.123f}; - float p1[] = {1.0f, -8.0f, 25.4f, -0.123f}; - float p2[] = {1.0f, -8.0f, 25.4f, -0.2f}; - float p3[] = {1.0f, -23.0f, 25.0f, -0.26f}; - - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p0, 1); - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p0, 4); - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p2, 3); - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p3, 1); - TEST_ASSERT_EQUAL_FLOAT_ARRAY(NULL, NULL, 1); -#endif -} - -void testNotEqualFloatArraysExpectedNull(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float* p0 = NULL; - float p1[] = {1.0f, 8.0f, 25.4f, 0.252f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatArraysActualNull(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {1.0f, 8.0f, 25.4f, 0.253f}; - float* p1 = NULL; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatArrays1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {1.0f, 8.0f, 25.4f, 0.253f}; - float p1[] = {1.0f, 8.0f, 25.4f, 0.252f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatArrays2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {1.0f, 8.0f, 25.4f, 0.253f}; - float p1[] = {2.0f, 8.0f, 25.4f, 0.253f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatArrays3(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {1.0f, 8.0f, 25.4f, 0.253f}; - float p1[] = {1.0f, 8.0f, 25.5f, 0.253f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatArraysNegative1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {-1.0f, -8.0f, -25.4f, -0.253f}; - float p1[] = {-1.0f, -8.0f, -25.4f, -0.252f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatArraysNegative2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {-1.0f, -8.0f, -25.4f, -0.253f}; - float p1[] = {-2.0f, -8.0f, -25.4f, -0.253f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatArraysNegative3(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {-1.0f, -8.0f, -25.4f, -0.253f}; - float p1[] = {-1.0f, -8.0f, -25.5f, -0.253f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); - VERIFY_FAILS_END -#endif -} - -void testEqualFloatArraysNaN(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {1.0f, 0.0f / f_zero, 25.4f, 0.253f}; - float p1[] = {1.0f, 0.0f / f_zero, 25.4f, 0.253f}; - - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); -#endif -} - -void testEqualFloatArraysInf(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {1.0f, 1.0f / f_zero, 25.4f, 0.253f}; - float p1[] = {1.0f, 1.0f / f_zero, 25.4f, 0.253f}; - - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); -#endif -} - -void testNotEqualFloatArraysLengthZero(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[1] = {0.0f}; - float p1[1] = {0.0f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 0); - VERIFY_FAILS_END -#endif -} - -void testEqualFloatEachEqual(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {1.0f, 1.0f, 1.0f, 1.0f}; - float p1[] = {-0.123f, -0.123f, -0.123f, -0.123f}; - float p2[] = {25.4f, 25.4f, 25.4f, -0.2f}; - float p3[] = {1.0f, -23.0f, 25.0f, -0.26f}; - - TEST_ASSERT_EACH_EQUAL_FLOAT(1.0f, p0, 1); - TEST_ASSERT_EACH_EQUAL_FLOAT(1.0f, p0, 4); - TEST_ASSERT_EACH_EQUAL_FLOAT(-0.123f, p1, 4); - TEST_ASSERT_EACH_EQUAL_FLOAT(25.4f, p2, 3); - TEST_ASSERT_EACH_EQUAL_FLOAT(1.0f, p3, 1); -#endif -} - -void testNotEqualFloatEachEqualActualNull(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float* p0 = NULL; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_FLOAT(5, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatEachEqual1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {0.253f, 8.0f, 0.253f, 0.253f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_FLOAT(0.253f, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatEachEqual2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {8.0f, 8.0f, 8.0f, 0.253f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_FLOAT(8.0f, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatEachEqual3(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {1.0f, 1.0f, 1.0f, 0.253f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_FLOAT(1.0f, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatEachEqualNegative1(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {-1.0f, -0.253f, -0.253f, -0.253f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_FLOAT(-0.253f, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatEachEqualNegative2(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {-25.4f, -8.0f, -25.4f, -25.4f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_FLOAT(-25.4f, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testNotEqualFloatEachEqualNegative3(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {-8.0f, -8.0f, -8.0f, -0.253f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_FLOAT(-8.0f, p0, 4); - VERIFY_FAILS_END -#endif -} - -void testEqualFloatEachEqualNaN(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {0.0f / f_zero, 0.0f / f_zero, 0.0f / f_zero, 0.0f / f_zero}; - - TEST_ASSERT_EACH_EQUAL_FLOAT(0.0f / f_zero, p0, 4); -#endif -} - -void testEqualFloatEachEqualInf(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[] = {1.0f / f_zero, 1.0f / f_zero, 25.4f, 0.253f}; - - TEST_ASSERT_EACH_EQUAL_FLOAT(1.0f / f_zero, p0, 2); -#endif -} - -void testNotEqualFloatEachEqualLengthZero(void) -{ -#ifdef UNITY_EXCLUDE_FLOAT - TEST_IGNORE(); -#else - float p0[1] = {0.0f}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_FLOAT(0.0f, p0, 0); - VERIFY_FAILS_END -#endif -} - -void testFloatPrinting(void) -{ -#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_PRINT_FLOATING("0", 0.0f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("4.99e-07", 0.000000499f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("0.1004695", 0.100469499f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("2", 1.9999995f); /*Rounding to int place*/ - TEST_ASSERT_EQUAL_PRINT_FLOATING("1", 1.0f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("1.25", 1.25f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("7.999999", 7.999999f); /*Not rounding*/ - TEST_ASSERT_EQUAL_PRINT_FLOATING("16.00002", 16.00002f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("16.00004", 16.00004f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("16.00006", 16.00006f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("9999999", 9999999.0f); /*Last full print integer*/ - - TEST_ASSERT_EQUAL_PRINT_FLOATING("-0", -0.0f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-4.99e-07", -0.000000499f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-0.1004695", -0.100469499f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-2", -1.9999995f); /*Rounding to int place*/ - TEST_ASSERT_EQUAL_PRINT_FLOATING("-1", -1.0f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-1.25", -1.25f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-7.999999", -7.999999f); /*Not rounding*/ - TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.00002", -16.00002f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.00004", -16.00004f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.00006", -16.00006f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-9999999", -9999999.0f); /*Last full print integer*/ - - /* Fails, prints "4.294968e+09" due to FP math imprecision - * TEST_ASSERT_EQUAL_PRINT_FLOATING("4.294967e+09", 4294967296.0f); */ - TEST_ASSERT_EQUAL_PRINT_FLOATING("5e+09", 5000000000.0f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("8e+09", 8.0e+09f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("8.309999e+09", 8309999104.0f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("1e+10", 1.0e+10f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("1e+10", 10000000000.0f); - /* Some compilers have trouble with inexact float constants, a float cast works generally */ - TEST_ASSERT_EQUAL_PRINT_FLOATING("1.000055e+10", (float)1.000055e+10f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("1.1e+38", (float)1.10000005e+38f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("1.635299e+10", 1.63529943e+10f); - /* Fails, prints "3.402824e+38" due to FP math imprecision - * TEST_ASSERT_EQUAL_PRINT_FLOATING("3.402823e+38", 3.40282346638e38f); */ - - TEST_ASSERT_EQUAL_PRINT_FLOATING("-1e+10", -1.0e+10f); - /* Fails, prints "-3.402824e+38" due to FP math imprecision - * TEST_ASSERT_EQUAL_PRINT_FLOATING("-3.402823e+38", -3.40282346638e38f); */ -#endif -} - -void testFloatPrintingRoundTiesToEven(void) -{ -#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) - TEST_IGNORE(); -#else - #ifdef UNITY_ROUND_TIES_AWAY_FROM_ZERO - TEST_ASSERT_EQUAL_PRINT_FLOATING("0.0004882813", 0.00048828125f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("488281.3", 488281.25f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("5.000001e-07", 0.00000050000005f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-5.000001e-07", -0.00000050000005f); - #else /* Default to Round ties to even */ - TEST_ASSERT_EQUAL_PRINT_FLOATING("0.0004882812", 0.00048828125f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("488281.2", 488281.25f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("5e-07", 0.00000050000005f); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-5e-07", -0.00000050000005f); - #endif -#endif -} - -void testFloatPrintingInfinityAndNaN(void) -{ -#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || !defined(USING_OUTPUT_SPY) - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_PRINT_FLOATING("inf", 1.0f / f_zero); - TEST_ASSERT_EQUAL_PRINT_FLOATING("-inf", -1.0f / f_zero); - - TEST_ASSERT_EQUAL_PRINT_FLOATING("nan", 0.0f / f_zero); -#endif -} - -#if defined(UNITY_TEST_ALL_FLOATS_PRINT_OK) && defined(USING_OUTPUT_SPY) -#ifdef UNITY_INCLUDE_DOUBLE -static void printFloatValue(float f) -{ - char expected[18]; - - startPutcharSpy(); - UnityPrintFloat(f); - - sprintf(expected, "%.9g", f); - /* We print all NaN's as "nan", not "-nan" */ - if (strcmp(expected, "-nan") == 0) strcpy(expected, "nan"); - - if (strcmp(expected, getBufferPutcharSpy())) - { - /* Fail with diagnostic printing */ - TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, f); - } -} -#else -static void printFloatValue(float f) -{ - char expected[18]; - char expected_lower[18]; - char expected_lower2[18]; - char expected_lower3[18]; - char expected_higher[18]; - char expected_higher2[18]; - char expected_higher3[18]; - - startPutcharSpy(); - UnityPrintFloat(f); - - sprintf(expected, "%.7g", f); - /* We print all NaN's as "nan", not "-nan" */ - if (strcmp(expected, "-nan") == 0) strcpy(expected, "nan"); - - strcpy(expected_lower, expected); - strcpy(expected_lower2, expected); - strcpy(expected_lower3, expected); - strcpy(expected_higher, expected); - strcpy(expected_higher2, expected); - strcpy(expected_higher3, expected); - - /* Allow for rounding differences in the last digit */ - double lower = (double)f * 0.99999995; - double higher = (double)f * 1.00000005; - - if(isfinite(lower)) sprintf(expected_lower, "%.7g", lower); - if(isfinite(higher)) sprintf(expected_higher, "%.7g", higher); - - /* Outside [1,10000000] allow for relative error of +/-2.5e-7 */ - if (f < 1.0 || f > 10000000) - { - double lower2 = (double)f * 0.99999985; - double lower3 = (double)f * 0.99999975; - double higher2 = (double)f * 1.00000015; - double higher3 = (double)f * 1.00000025; - - if (isfinite(lower2)) sprintf(expected_lower2, "%.7g", lower2); - if (isfinite(lower3)) sprintf(expected_lower3, "%.7g", lower3); - if (isfinite(higher2)) sprintf(expected_higher2, "%.7g", higher2); - if (isfinite(higher3)) sprintf(expected_higher3, "%.7g", higher3); - } - - if (strcmp(expected, getBufferPutcharSpy()) != 0 && - strcmp(expected_lower, getBufferPutcharSpy()) != 0 && - strcmp(expected_lower2, getBufferPutcharSpy()) != 0 && - strcmp(expected_lower3, getBufferPutcharSpy()) != 0 && - strcmp(expected_higher, getBufferPutcharSpy()) != 0 && - strcmp(expected_higher2, getBufferPutcharSpy()) != 0 && - strcmp(expected_higher3, getBufferPutcharSpy()) != 0) - { - /* Fail with diagnostic printing */ - TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, f); - } -} -#endif -#endif - -void testFloatPrintingRandomSamples(void) -{ -#if !defined(UNITY_TEST_ALL_FLOATS_PRINT_OK) || !defined(USING_OUTPUT_SPY) - TEST_IGNORE(); -#else - union { float f_value; uint32_t int_value; } u; - - /* These values are not covered by the MINSTD generator */ - u.int_value = 0x00000000; printFloatValue(u.f_value); - u.int_value = 0x80000000; printFloatValue(u.f_value); - u.int_value = 0x7fffffff; printFloatValue(u.f_value); - u.int_value = 0xffffffff; printFloatValue(u.f_value); - - uint32_t a = 1; - for(int num_tested = 0; num_tested < 1000000; num_tested++) - { - /* MINSTD pseudo-random number generator */ - a = (uint32_t)(((uint64_t)a * 48271u) % 2147483647u); - - /* MINSTD does not set the highest bit; test both possibilities */ - u.int_value = a; printFloatValue(u.f_value); - u.int_value = a | 0x80000000; printFloatValue(u.f_value); - } -#endif -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers.c deleted file mode 100644 index 7bdfa1442..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers.c +++ /dev/null @@ -1,2847 +0,0 @@ -/* ========================================== - 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] -========================================== */ - -#include "unity.h" -#define TEST_INSTANCES -#include "self_assessment_utils.h" - -static int SetToOneToFailInTearDown; -static int SetToOneMeanWeAlreadyCheckedThisGuy; - -void setUp(void) -{ - SetToOneToFailInTearDown = 0; - SetToOneMeanWeAlreadyCheckedThisGuy = 0; -} - -void tearDown(void) -{ - endPutcharSpy(); /* Stop suppressing test output */ - if (SetToOneToFailInTearDown == 1) - { - /* These will be skipped internally if already failed/ignored */ - TEST_FAIL_MESSAGE("<= Failed in tearDown"); - TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); - } - if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) - { - UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); - UNITY_OUTPUT_CHAR('\n'); - } -} - -void testNotEqualInts(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT(3982, 3983); - VERIFY_FAILS_END -} - -void testNotEqualInt8s(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT8(-127, -126); - VERIFY_FAILS_END -} - -void testNotEqualChars(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_CHAR('A', 'a'); - VERIFY_FAILS_END -} - -void testNotEqualInt16s(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT16(-16383, -16382); - VERIFY_FAILS_END -} - -void testNotEqualInt32s(void) -{ - EXPECT_ABORT_BEGIN - /*use largest 32 bit negative to test printability*/ - /*note: (-2147483647 - 1) is used instead of -2147483648 because of C90 casting rules */ - TEST_ASSERT_EQUAL_INT32(-2147483647, (-2147483647 - 1)); - VERIFY_FAILS_END -} - -void testNotEqualBits(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_BITS(0xFF00, 0x5555, 0x5A55); - VERIFY_FAILS_END -} - -void testNotEqualUInts(void) -{ - UNITY_UINT16 v0, v1; - - v0 = 9000; - v1 = 9001; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT(v0, v1); - VERIFY_FAILS_END -} - -void testNotEqualUInt8s(void) -{ - UNITY_UINT8 v0, v1; - - v0 = 254; - v1 = 255; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT8(v0, v1); - VERIFY_FAILS_END -} - -void testNotEqualUInt16s(void) -{ - UNITY_UINT16 v0, v1; - - v0 = 65535u; - v1 = 65534u; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT16(v0, v1); - VERIFY_FAILS_END -} - -void testNotEqualUInt32s(void) -{ - UNITY_UINT32 v0, v1; - - v0 = 4294967295u; - v1 = 4294967294u; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT32(v0, v1); - VERIFY_FAILS_END -} - -void testNotEqualHex8s(void) -{ - UNITY_UINT8 v0, v1; - - v0 = 0x23; - v1 = 0x22; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX8(v0, v1); - VERIFY_FAILS_END -} - -void testNotEqualHex8sIfSigned(void) -{ - UNITY_INT8 v0, v1; - - v0 = -2; - v1 = 2; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX8(v0, v1); - VERIFY_FAILS_END -} - -void testNotEqualHex16s(void) -{ - UNITY_UINT16 v0, v1; - - v0 = 0x1234; - v1 = 0x1235; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX16(v0, v1); - VERIFY_FAILS_END -} - -void testNotEqualHex16sIfSigned(void) -{ - UNITY_INT16 v0, v1; - - v0 = -1024; - v1 = -1028; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX16(v0, v1); - VERIFY_FAILS_END -} - -void testNotEqualHex32s(void) -{ - UNITY_UINT32 v0, v1; - - v0 = 900000; - v1 = 900001; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX32(v0, v1); - VERIFY_FAILS_END -} - -void testNotEqualHex32sIfSigned(void) -{ - UNITY_INT32 v0, v1; - - v0 = -900000; - v1 = 900001; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX32(v0, v1); - VERIFY_FAILS_END -} - -void testEqualInts(void) -{ - int v0, v1; - int *p0, *p1; - - v0 = 19467; - v1 = 19467; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_INT(1837, 1837); - TEST_ASSERT_EQUAL_INT(-27365, -27365); - TEST_ASSERT_EQUAL_INT(v0, v1); - TEST_ASSERT_EQUAL_INT(19467, v1); - TEST_ASSERT_EQUAL_INT(v0, 19467); - TEST_ASSERT_EQUAL_INT(*p0, v1); - TEST_ASSERT_EQUAL_INT(*p0, *p1); - TEST_ASSERT_EQUAL_INT(*p0, 19467); -} - -void testEqualInt8s(void) -{ - UNITY_INT8 v0, v1; - UNITY_INT8 *p0, *p1; - - v0 = 0x22; - v1 = 0x22; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_INT8(0x22, 0x22); - TEST_ASSERT_EQUAL_INT8(v0, v1); - TEST_ASSERT_EQUAL_INT8(0x22, v1); - TEST_ASSERT_EQUAL_INT8(v0, 0x22); - TEST_ASSERT_EQUAL_INT8(*p0, v1); - TEST_ASSERT_EQUAL_INT8(*p0, *p1); - TEST_ASSERT_EQUAL_INT8(*p0, 0x22); -} - -void testEqualInt8sWhenThereAreDifferencesOutside8Bits(void) -{ - TEST_ASSERT_EQUAL_INT8(0x321,0x421); - TEST_ASSERT_EQUAL_INT8(0xFF21,0x0021); -} - -void testEqualChars(void) -{ - char v0, v1; - char *p0, *p1; - - v0 = 'A'; - v1 = 'A'; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_CHAR('A', 'A'); - TEST_ASSERT_EQUAL_CHAR(v0, v1); - TEST_ASSERT_EQUAL_CHAR('A', v1); - TEST_ASSERT_EQUAL_CHAR(v0, 'A'); - TEST_ASSERT_EQUAL_CHAR(*p0, v1); - TEST_ASSERT_EQUAL_CHAR(*p0, *p1); - TEST_ASSERT_EQUAL_CHAR(*p0, 'A'); -} - -void testEqualCharsWhenThereAreDifferencesOutside8Bits(void) -{ - TEST_ASSERT_EQUAL_CHAR(0x321,0x421); - TEST_ASSERT_EQUAL_CHAR(0xFF21,0x0021); -} - - -void testEqualInt16s(void) -{ - UNITY_INT16 v0, v1; - UNITY_INT16 *p0, *p1; - - v0 = 0x7876; - v1 = 0x7876; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_INT16(0x7876, 0x7876); - TEST_ASSERT_EQUAL_INT16(v0, v1); - TEST_ASSERT_EQUAL_INT16(0x7876, v1); - TEST_ASSERT_EQUAL_INT16(v0, 0x7876); - TEST_ASSERT_EQUAL_INT16(*p0, v1); - TEST_ASSERT_EQUAL_INT16(*p0, *p1); - TEST_ASSERT_EQUAL_INT16(*p0, 0x7876); -} - -void testEqualInt16sNegatives(void) -{ - UNITY_INT16 v0, v1; - UNITY_INT16 *p0, *p1; - - v0 = -7876; - v1 = -7876; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_INT16(-7876, -7876); - TEST_ASSERT_EQUAL_INT16(v0, v1); - TEST_ASSERT_EQUAL_INT16(-7876, v1); - TEST_ASSERT_EQUAL_INT16(v0, -7876); - TEST_ASSERT_EQUAL_INT16(*p0, v1); - TEST_ASSERT_EQUAL_INT16(*p0, *p1); - TEST_ASSERT_EQUAL_INT16(*p0, -7876); -} - -void testEqualInt16sWhenThereAreDifferencesOutside16Bits(void) -{ - TEST_ASSERT_EQUAL_INT16(0x54321,0x64321); - TEST_ASSERT_EQUAL_INT16(0xFFFF4321,0x00004321); -} - -void testEqualInt32s(void) -{ - UNITY_INT32 v0, v1; - UNITY_INT32 *p0, *p1; - - v0 = 0x78760000; - v1 = 0x78760000; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_INT32(0x78760000, 0x78760000); - TEST_ASSERT_EQUAL_INT32(v0, v1); - TEST_ASSERT_EQUAL_INT32(0x78760000, v1); - TEST_ASSERT_EQUAL_INT32(v0, 0x78760000); - TEST_ASSERT_EQUAL_INT32(*p0, v1); - TEST_ASSERT_EQUAL_INT32(*p0, *p1); - TEST_ASSERT_EQUAL_INT32(*p0, 0x78760000); -} - -void testEqualInt32sNegatives(void) -{ - UNITY_INT32 v0, v1; - UNITY_INT32 *p0, *p1; - - v0 = -123456789; - v1 = -123456789; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_INT32(-123456789, -123456789); - TEST_ASSERT_EQUAL_INT32(v0, v1); - TEST_ASSERT_EQUAL_INT32(-123456789, v1); - TEST_ASSERT_EQUAL_INT32(v0, -123456789); - TEST_ASSERT_EQUAL_INT32(*p0, v1); - TEST_ASSERT_EQUAL_INT32(*p0, *p1); - TEST_ASSERT_EQUAL_INT32(*p0, -123456789); -} - - -void testEqualUints(void) -{ - unsigned int v0, v1; - unsigned int *p0, *p1; - - v0 = 19467; - v1 = 19467; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_UINT(1837, 1837); - TEST_ASSERT_EQUAL_UINT(v0, v1); - TEST_ASSERT_EQUAL_UINT(19467, v1); - TEST_ASSERT_EQUAL_UINT(v0, 19467); - TEST_ASSERT_EQUAL_UINT(*p0, v1); - TEST_ASSERT_EQUAL_UINT(*p0, *p1); - TEST_ASSERT_EQUAL_UINT(*p0, 19467); - TEST_ASSERT_EQUAL_UINT(60872u, 60872u); -} - - -void testEqualUint8s(void) -{ - UNITY_UINT8 v0, v1; - UNITY_UINT8 *p0, *p1; - - v0 = 0x22; - v1 = 0x22; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_UINT8(0x22, 0x22); - TEST_ASSERT_EQUAL_UINT8(v0, v1); - TEST_ASSERT_EQUAL_UINT8(0x22, v1); - TEST_ASSERT_EQUAL_UINT8(v0, 0x22); - TEST_ASSERT_EQUAL_UINT8(*p0, v1); - TEST_ASSERT_EQUAL_UINT8(*p0, *p1); - TEST_ASSERT_EQUAL_UINT8(*p0, 0x22); -} - -void testEqualUint8sWhenThereAreDifferencesOutside8Bits(void) -{ - TEST_ASSERT_EQUAL_UINT8(0x321,0x421); - TEST_ASSERT_EQUAL_UINT8(0xFF21,0x0021); -} - -void testEqualUint16s(void) -{ - UNITY_UINT16 v0, v1; - UNITY_UINT16 *p0, *p1; - - v0 = 0x9876; - v1 = 0x9876; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_UINT16(0x9876, 0x9876); - TEST_ASSERT_EQUAL_UINT16(v0, v1); - TEST_ASSERT_EQUAL_UINT16(0x9876, v1); - TEST_ASSERT_EQUAL_UINT16(v0, 0x9876); - TEST_ASSERT_EQUAL_UINT16(*p0, v1); - TEST_ASSERT_EQUAL_UINT16(*p0, *p1); - TEST_ASSERT_EQUAL_UINT16(*p0, 0x9876); -} - -void testEqualUint16sWhenThereAreDifferencesOutside16Bits(void) -{ - TEST_ASSERT_EQUAL_UINT16(0x54321,0x64321); - TEST_ASSERT_EQUAL_UINT16(0xFFFF4321,0x00004321); -} - -void testEqualUint32s(void) -{ - UNITY_UINT32 v0, v1; - UNITY_UINT32 *p0, *p1; - - v0 = 0x98760000; - v1 = 0x98760000; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_UINT32(0x98760000, 0x98760000); - TEST_ASSERT_EQUAL_UINT32(v0, v1); - TEST_ASSERT_EQUAL_UINT32(0x98760000, v1); - TEST_ASSERT_EQUAL_UINT32(v0, 0x98760000); - TEST_ASSERT_EQUAL_UINT32(*p0, v1); - TEST_ASSERT_EQUAL_UINT32(*p0, *p1); - TEST_ASSERT_EQUAL_UINT32(*p0, 0x98760000); -} - -void testNotEqual(void) -{ - TEST_ASSERT_NOT_EQUAL(0, 1); - TEST_ASSERT_NOT_EQUAL(1, 0); - TEST_ASSERT_NOT_EQUAL(100, 101); - TEST_ASSERT_NOT_EQUAL(0, -1); - TEST_ASSERT_NOT_EQUAL(65535, -65535); - TEST_ASSERT_NOT_EQUAL(75, 900); - TEST_ASSERT_NOT_EQUAL(-100, -101); -} - -void testEqualHex8s(void) -{ - UNITY_UINT8 v0, v1; - UNITY_UINT8 *p0, *p1; - - v0 = 0x22; - v1 = 0x22; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_HEX8(0x22, 0x22); - TEST_ASSERT_EQUAL_HEX8(v0, v1); - TEST_ASSERT_EQUAL_HEX8(0x22, v1); - TEST_ASSERT_EQUAL_HEX8(v0, 0x22); - TEST_ASSERT_EQUAL_HEX8(*p0, v1); - TEST_ASSERT_EQUAL_HEX8(*p0, *p1); - TEST_ASSERT_EQUAL_HEX8(*p0, 0x22); -} - -void testEqualHex8sWhenThereAreDifferencesOutside8Bits(void) -{ - TEST_ASSERT_EQUAL_HEX8(0x321,0x421); - TEST_ASSERT_EQUAL_HEX8(0xFF21,0x0021); -} - -void testEqualHex8sNegatives(void) -{ - UNITY_UINT8 v0, v1; - UNITY_UINT8 *p0, *p1; - - v0 = 0xDD; - v1 = 0xDD; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_HEX8(0xDD, 0xDD); - TEST_ASSERT_EQUAL_HEX8(v0, v1); - TEST_ASSERT_EQUAL_HEX8(0xDD, v1); - TEST_ASSERT_EQUAL_HEX8(v0, 0xDD); - TEST_ASSERT_EQUAL_HEX8(*p0, v1); - TEST_ASSERT_EQUAL_HEX8(*p0, *p1); - TEST_ASSERT_EQUAL_HEX8(*p0, 0xDD); -} - -void testEqualHex16s(void) -{ - UNITY_UINT16 v0, v1; - UNITY_UINT16 *p0, *p1; - - v0 = 0x9876; - v1 = 0x9876; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_HEX16(0x9876, 0x9876); - TEST_ASSERT_EQUAL_HEX16(v0, v1); - TEST_ASSERT_EQUAL_HEX16(0x9876, v1); - TEST_ASSERT_EQUAL_HEX16(v0, 0x9876); - TEST_ASSERT_EQUAL_HEX16(*p0, v1); - TEST_ASSERT_EQUAL_HEX16(*p0, *p1); - TEST_ASSERT_EQUAL_HEX16(*p0, 0x9876); -} - -void testEqualHex16sWhenThereAreDifferencesOutside16Bits(void) -{ - TEST_ASSERT_EQUAL_HEX16(0x54321,0x64321); - TEST_ASSERT_EQUAL_HEX16(0xFFFF4321,0x00004321); -} - -void testEqualHex32s(void) -{ - UNITY_UINT32 v0, v1; - UNITY_UINT32 *p0, *p1; - - v0 = 0x98765432ul; - v1 = 0x98765432ul; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_HEX32(0x98765432ul, 0x98765432ul); - TEST_ASSERT_EQUAL_HEX32(v0, v1); - TEST_ASSERT_EQUAL_HEX32(0x98765432ul, v1); - TEST_ASSERT_EQUAL_HEX32(v0, 0x98765432ul); - TEST_ASSERT_EQUAL_HEX32(*p0, v1); - TEST_ASSERT_EQUAL_HEX32(*p0, *p1); - TEST_ASSERT_EQUAL_HEX32(*p0, 0x98765432ul); -} - -void testEqualBits(void) -{ - UNITY_UINT32 v0 = 0xFF55AA00; - UNITY_UINT32 v1 = 0x55550000; - - TEST_ASSERT_BITS(v1, v0, 0x55550000); - TEST_ASSERT_BITS(v1, v0, 0xFF55CC00); - TEST_ASSERT_BITS(0xFFFFFFFF, v0, 0xFF55AA00); - TEST_ASSERT_BITS(0xFFFFFFFF, v0, v0); - TEST_ASSERT_BITS(0xF0F0F0F0, v0, 0xFC5DAE0F); - TEST_ASSERT_BITS_HIGH(v1, v0); - TEST_ASSERT_BITS_LOW(0x000055FF, v0); - TEST_ASSERT_BIT_HIGH(30, v0); - TEST_ASSERT_BIT_LOW(5, v0); -} - -void testNotEqualBitHigh(void) -{ - UNITY_UINT32 v0 = 0x7F55AA00; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_BIT_HIGH(31, v0); - VERIFY_FAILS_END -} - -void testNotEqualBitLow(void) -{ - UNITY_UINT32 v0 = 0xFF55AA00; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_BIT_LOW(30, v0); - VERIFY_FAILS_END -} - -void testNotEqualBitsHigh(void) -{ - UNITY_UINT32 v0 = 0xFF55AA00; - UNITY_UINT32 v1 = 0x55550000; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_BITS_HIGH(v0, v1); - VERIFY_FAILS_END - -} - -void testNotEqualBitsLow(void) -{ - UNITY_UINT32 v0 = 0xFF55AA00; - UNITY_UINT32 v1 = 0x55550000; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_BITS_LOW(v0, v1); - VERIFY_FAILS_END -} - - -void testEqualShorts(void) -{ - short v0, v1; - short *p0, *p1; - - v0 = 19467; - v1 = 19467; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_INT(1837, 1837); - TEST_ASSERT_EQUAL_INT(-2987, -2987); - TEST_ASSERT_EQUAL_INT(v0, v1); - TEST_ASSERT_EQUAL_INT(19467, v1); - TEST_ASSERT_EQUAL_INT(v0, 19467); - TEST_ASSERT_EQUAL_INT(*p0, v1); - TEST_ASSERT_EQUAL_INT(*p0, *p1); - TEST_ASSERT_EQUAL_INT(*p0, 19467); -} - -void testEqualUShorts(void) -{ - unsigned short v0, v1; - unsigned short *p0, *p1; - - v0 = 19467; - v1 = 19467; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_UINT(1837, 1837); - TEST_ASSERT_EQUAL_UINT(2987, 2987); - TEST_ASSERT_EQUAL_UINT(v0, v1); - TEST_ASSERT_EQUAL_UINT(19467, v1); - TEST_ASSERT_EQUAL_UINT(v0, 19467); - TEST_ASSERT_EQUAL_UINT(*p0, v1); - TEST_ASSERT_EQUAL_UINT(*p0, *p1); - TEST_ASSERT_EQUAL_UINT(*p0, 19467); -} - -void testEqualUInts(void) -{ - unsigned char v0, v1; - unsigned char *p0, *p1; - - v0 = 109; - v1 = 109; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_UINT(42, 42); - TEST_ASSERT_EQUAL_UINT(-116, -116); - TEST_ASSERT_EQUAL_UINT(v0, v1); - TEST_ASSERT_EQUAL_UINT(109, v1); - TEST_ASSERT_EQUAL_UINT(v0, 109); - TEST_ASSERT_EQUAL_UINT(*p0, v1); - TEST_ASSERT_EQUAL_UINT(*p0, *p1); - TEST_ASSERT_EQUAL_UINT(*p0, 109); -} - -void testEqualUChars(void) -{ - unsigned char v0, v1; - unsigned char *p0, *p1; - - v0 = 251; - v1 = 251; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_INT(42, 42); - TEST_ASSERT_EQUAL_INT(v0, v1); - TEST_ASSERT_EQUAL_INT(251, v1); - TEST_ASSERT_EQUAL_INT(v0, 251); - TEST_ASSERT_EQUAL_INT(*p0, v1); - TEST_ASSERT_EQUAL_INT(*p0, *p1); - TEST_ASSERT_EQUAL_INT(*p0, 251); -} - -void testEqualPointers(void) -{ - int v0, v1; - int *p0, *p1, *p2; - - v0 = 19467; - v1 = 18271; - p0 = &v0; - p1 = &v1; - p2 = &v1; - - TEST_ASSERT_EQUAL_PTR(p0, &v0); - TEST_ASSERT_EQUAL_PTR(&v1, p1); - TEST_ASSERT_EQUAL_PTR(p2, p1); - TEST_ASSERT_EQUAL_PTR(&v0, &v0); -} - -void testNotEqualPointers(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_PTR(0x12345678, 0x12345677); - VERIFY_FAILS_END -} - -void testIntsWithinDelta(void) -{ - TEST_ASSERT_INT_WITHIN(1, 5000, 5001); - TEST_ASSERT_INT_WITHIN(5, 5000, 4996); - TEST_ASSERT_INT_WITHIN(5, 5000, 5005); - TEST_ASSERT_INT_WITHIN(500, 50, -440); - - TEST_ASSERT_INT_WITHIN(2, -1, -1); - TEST_ASSERT_INT_WITHIN(5, 1, -1); - TEST_ASSERT_INT_WITHIN(5, -1, 1); -} - -void testIntsWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_INT_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); - TEST_ASSERT_INT_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); - TEST_ASSERT_INT_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); - TEST_ASSERT_INT_WITHIN_MESSAGE(500, 50, -440, "Custom Message."); - - TEST_ASSERT_INT_WITHIN_MESSAGE(2, -1, -1, "Custom Message."); - TEST_ASSERT_INT_WITHIN_MESSAGE(5, 1, -1, "Custom Message."); - TEST_ASSERT_INT_WITHIN_MESSAGE(5, -1, 1, "Custom Message."); -} - -void testIntsNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_WITHIN(5, 5000, 5006); - VERIFY_FAILS_END -} - -void testIntsNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_WITHIN_MESSAGE(5, 5000, 5006, "Custom Message."); - VERIFY_FAILS_END -} - -void testUIntsWithinDelta(void) -{ - TEST_ASSERT_UINT_WITHIN(1, 5000, 5001); - TEST_ASSERT_UINT_WITHIN(5, 5000, 4996); - TEST_ASSERT_UINT_WITHIN(5, 5000, 5005); -} - -void testUIntsWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_UINT_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); - TEST_ASSERT_UINT_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); - TEST_ASSERT_UINT_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); -} - -void testUIntsNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_WITHIN(1, 2147483647u, 2147483649u); - VERIFY_FAILS_END -} - -void testUIntsNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_WITHIN_MESSAGE(1, 2147483647u, 2147483649u, "Custom Message."); - VERIFY_FAILS_END -} - -void testUIntsNotWithinDeltaEvenThoughASignedIntWouldPassSmallFirst(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_WITHIN(5, 1, -1); - VERIFY_FAILS_END -} - -void testUIntsNotWithinDeltaEvenThoughASignedIntWouldPassSmallFirstAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_WITHIN_MESSAGE(5, 1, -1, "Custom Message."); - VERIFY_FAILS_END -} - -void testUIntsNotWithinDeltaEvenThoughASignedIntWouldPassBigFirst(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_WITHIN(5, -1, 1); - VERIFY_FAILS_END -} - -void testUIntsNotWithinDeltaEvenThoughASignedIntWouldPassBigFirstAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_WITHIN_MESSAGE(5, -1, 1, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX32sWithinDelta(void) -{ - TEST_ASSERT_HEX32_WITHIN(1, 5000, 5001); - TEST_ASSERT_HEX32_WITHIN(5, 5000, 4996); - TEST_ASSERT_HEX32_WITHIN(5, 5000, 5005); -} - -void testHEX32sWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_HEX32_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); - TEST_ASSERT_HEX32_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); - TEST_ASSERT_HEX32_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); -} - -void testHEX32sNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_WITHIN(1, 2147483647u, 2147483649u); - VERIFY_FAILS_END -} - -void testHEX32sNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_WITHIN_MESSAGE(1, 2147483647u, 2147483649u, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX32sNotWithinDeltaEvenThoughASignedIntWouldPass(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_WITHIN(5, 1, -1); - VERIFY_FAILS_END -} - -void testHEX32sNotWithinDeltaEvenThoughASignedIntWouldPassAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_WITHIN_MESSAGE(5, 1, -1, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX16sWithinDelta(void) -{ - TEST_ASSERT_HEX16_WITHIN(1, 5000, 5001); - TEST_ASSERT_HEX16_WITHIN(5, 5000, 4996); - TEST_ASSERT_HEX16_WITHIN(5, 5000, 5005); -} - -void testHEX16sWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_HEX16_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); - TEST_ASSERT_HEX16_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); - TEST_ASSERT_HEX16_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); -} - -void testHEX16sWithinDeltaWhenThereAreDifferenceOutsideOf16Bits(void) -{ - TEST_ASSERT_HEX16_WITHIN(5, 0x54321, 0x44321); -} - -void testHEX16sWithinDeltaWhenThereAreDifferenceOutsideOf16BitsAndCustomMessage(void) -{ - TEST_ASSERT_HEX16_WITHIN_MESSAGE(5, 0x54321, 0x44321, "Custom Message."); -} - -void testHEX16sNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_WITHIN(2, 65535, 0); - VERIFY_FAILS_END -} - -void testHEX16sNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_WITHIN_MESSAGE(2, 65535, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testHEX8sWithinDelta(void) -{ - TEST_ASSERT_HEX8_WITHIN(1, 254, 255); - TEST_ASSERT_HEX8_WITHIN(5, 251, 255); - TEST_ASSERT_HEX8_WITHIN(5, 1, 4); -} - -void testHEX8sWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_HEX8_WITHIN_MESSAGE(1, 254, 255, "Custom Message."); - TEST_ASSERT_HEX8_WITHIN_MESSAGE(5, 251, 255, "Custom Message."); - TEST_ASSERT_HEX8_WITHIN_MESSAGE(5, 1, 4, "Custom Message."); -} - -void testHEX8sWithinDeltaWhenThereAreDifferenceOutsideOf8Bits(void) -{ - TEST_ASSERT_HEX8_WITHIN(5, 0x123, 0xF23); -} - -void testHEX8sWithinDeltaWhenThereAreDifferenceOutsideOf8BitsAndCustomMessage(void) -{ - TEST_ASSERT_HEX8_WITHIN_MESSAGE(5, 0x123, 0xF23, "Custom Message."); -} - -void testHEX8sNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_WITHIN(2, 255, 0); - VERIFY_FAILS_END -} - -void testHEX8sNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_WITHIN_MESSAGE(2, 255, 0, "Custom Message."); - VERIFY_FAILS_END -} - -/*-----------------*/ - -void testUINT32sWithinDelta(void) -{ - TEST_ASSERT_UINT32_WITHIN(1, 5000, 5001); - TEST_ASSERT_UINT32_WITHIN(5, 5000, 4996); - TEST_ASSERT_UINT32_WITHIN(5, 5000, 5005); -} - -void testUINT32sWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_UINT32_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); - TEST_ASSERT_UINT32_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); - TEST_ASSERT_UINT32_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); -} - -void testUINT32sNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT32_WITHIN(1, 2147483647u, 2147483649u); - VERIFY_FAILS_END -} - -void testUINT32sNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT32_WITHIN_MESSAGE(1, 2147483647u, 2147483649u, "Custom Message."); - VERIFY_FAILS_END -} - -void testUINT32sNotWithinDeltaEvenThoughASignedIntWouldPass(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT32_WITHIN(5, 1, -1); - VERIFY_FAILS_END -} - -void testUINT32sNotWithinDeltaEvenThoughASignedIntWouldPassAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT32_WITHIN_MESSAGE(5, 1, -1, "Custom Message."); - VERIFY_FAILS_END -} - -void testUINT16sWithinDelta(void) -{ - TEST_ASSERT_UINT16_WITHIN(1, 5000, 5001); - TEST_ASSERT_UINT16_WITHIN(5, 5000, 4996); - TEST_ASSERT_UINT16_WITHIN(5, 5000, 5005); -} - -void testUINT16sWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_UINT16_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); - TEST_ASSERT_UINT16_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); - TEST_ASSERT_UINT16_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); -} - -void testUINT16sWithinDeltaWhenThereAreDifferenceOutsideOf16Bits(void) -{ - TEST_ASSERT_UINT16_WITHIN(5, 0x54321, 0x44321); -} - -void testUINT16sWithinDeltaWhenThereAreDifferenceOutsideOf16BitsAndCustomMessage(void) -{ - TEST_ASSERT_UINT16_WITHIN_MESSAGE(5, 0x54321, 0x44321, "Custom Message."); -} - -void testUINT16sNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_WITHIN(2, 65535, 0); - VERIFY_FAILS_END -} - -void testUINT16sNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_WITHIN_MESSAGE(2, 65535, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testUINT8sWithinDelta(void) -{ - TEST_ASSERT_UINT8_WITHIN(1, 254, 255); - TEST_ASSERT_UINT8_WITHIN(5, 251, 255); - TEST_ASSERT_UINT8_WITHIN(5, 1, 4); -} - -void testUINT8sWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_UINT8_WITHIN_MESSAGE(1, 254, 255, "Custom Message."); - TEST_ASSERT_UINT8_WITHIN_MESSAGE(5, 251, 255, "Custom Message."); - TEST_ASSERT_UINT8_WITHIN_MESSAGE(5, 1, 4, "Custom Message."); -} - -void testUINT8sWithinDeltaWhenThereAreDifferenceOutsideOf8Bits(void) -{ - TEST_ASSERT_UINT8_WITHIN(5, 0x123, 0xF23); -} - -void testUINT8sWithinDeltaWhenThereAreDifferenceOutsideOf8BitsAndCustomMessage(void) -{ - TEST_ASSERT_UINT8_WITHIN_MESSAGE(5, 0x123, 0xF23, "Custom Message."); -} - -void testUINT8sNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_WITHIN(2, 255, 0); - VERIFY_FAILS_END -} - -void testUINT8sNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_WITHIN_MESSAGE(2, 255, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testINT32sWithinDelta(void) -{ - TEST_ASSERT_INT32_WITHIN(1, 5000, 5001); - TEST_ASSERT_INT32_WITHIN(5, 1, -2); - TEST_ASSERT_INT32_WITHIN(5, -2, 1); -} - -void testINT32sWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_INT32_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); -} - -void testINT32sNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT32_WITHIN(1, -3, 1); - VERIFY_FAILS_END -} - -void testINT32sNotWithinDeltaAndDifferenceOverflows(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT32_WITHIN(1, -1, 0x7FFFFFFF); - VERIFY_FAILS_END -} -void testINT32sNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT32_WITHIN_MESSAGE(1, -2, 1, "Custom Message."); - VERIFY_FAILS_END -} - -void testINT16sWithinDelta(void) -{ - TEST_ASSERT_INT16_WITHIN(1, 5000, 5001); - TEST_ASSERT_INT16_WITHIN(5, 2, -2); - TEST_ASSERT_INT16_WITHIN(5, -2, 2); -} - -void testINT16sWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_INT16_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); -} - -void testINT16sWithinDeltaWhenThereAreDifferenceOutsideOf16Bits(void) -{ - TEST_ASSERT_INT16_WITHIN(5, 0x54321, 0x44321); -} - -void testINT16sWithinDeltaWhenThereAreDifferenceOutsideOf16BitsAndCustomMessage(void) -{ - TEST_ASSERT_INT16_WITHIN_MESSAGE(5, 0x54321, 0x44321, "Custom Message."); -} - -void testINT16sNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_WITHIN(2, 4, -2); - VERIFY_FAILS_END -} - -void testINT16sNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_WITHIN_MESSAGE(2, 3, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testINT8sWithinDelta(void) -{ - TEST_ASSERT_INT8_WITHIN(1, 127, 126); - TEST_ASSERT_INT8_WITHIN(5, -2, 2); - TEST_ASSERT_INT8_WITHIN(5, 2, -2); -} - -void testINT8sWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_INT8_WITHIN_MESSAGE(5, 1, 4, "Custom Message."); -} - -void testINT8sWithinDeltaWhenThereAreDifferenceOutsideOf8Bits(void) -{ - TEST_ASSERT_INT8_WITHIN(5, 0x123, 0xF23); -} - -void testINT8sWithinDeltaWhenThereAreDifferenceOutsideOf8BitsAndCustomMessage(void) -{ - TEST_ASSERT_INT8_WITHIN_MESSAGE(5, 0x123, 0xF23, "Custom Message."); -} - -void testINT8sNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_WITHIN(2, -3, 0); - VERIFY_FAILS_END -} - -void testINT8sNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_WITHIN_MESSAGE(2, -4, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testCHARsWithinDelta(void) -{ - TEST_ASSERT_CHAR_WITHIN(1, 'M', 'L'); - TEST_ASSERT_CHAR_WITHIN(5, -2, 2); - TEST_ASSERT_CHAR_WITHIN(5, 2, -2); -} - -void testCHARsWithinDeltaAndCustomMessage(void) -{ - TEST_ASSERT_CHAR_WITHIN_MESSAGE(5, 1, 4, "Custom Message."); -} - -void testCHARsWithinDeltaWhenThereAreDifferenceOutsideOf8Bits(void) -{ - TEST_ASSERT_CHAR_WITHIN(5, 0x123, 0xF23); -} - -void testCHARsWithinDeltaWhenThereAreDifferenceOutsideOf8BitsAndCustomMessage(void) -{ - TEST_ASSERT_CHAR_WITHIN_MESSAGE(5, 0x123, 0xF23, "Custom Message."); -} - -void testCHARsNotWithinDelta(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_CHAR_WITHIN(2, -3, 0); - VERIFY_FAILS_END -} - -void testCHARsNotWithinDeltaAndCustomMessage(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_CHAR_WITHIN_MESSAGE(2, -4, 0, "Custom Message."); - VERIFY_FAILS_END -} - -void testNotEqualINT(void) -{ - UNITY_INT v0, v1; - UNITY_INT *p0, *p1; - - v0 = 302; - v1 = 3334; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_INT(v0, v1); - TEST_ASSERT_NOT_EQUAL_INT(*p0, v1); - TEST_ASSERT_NOT_EQUAL_INT(v0, *p1); - TEST_ASSERT_NOT_EQUAL_INT(*p1, *p0); -} - -void testNotNotEqualINT(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_INT(302, 302); - VERIFY_FAILS_END -} - -void testNotEqualINT8(void) -{ - UNITY_INT8 v0, v1; - UNITY_INT8 *p0, *p1; - - v0 = -128; - v1 = 127; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_INT8(v0, v1); - TEST_ASSERT_NOT_EQUAL_INT8(*p0, v1); - TEST_ASSERT_NOT_EQUAL_INT8(v0, *p1); - TEST_ASSERT_NOT_EQUAL_INT8(*p1, *p0); -} - -void testNotNotEqualINT8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_INT8(-128, -128); - VERIFY_FAILS_END -} - -void testNotEqualCHAR(void) -{ - char v0, v1; - char *p0, *p1; - - v0 = -128; - v1 = 127; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_CHAR(v0, v1); - TEST_ASSERT_NOT_EQUAL_CHAR(*p0, v1); - TEST_ASSERT_NOT_EQUAL_CHAR(v0, *p1); - TEST_ASSERT_NOT_EQUAL_CHAR(*p1, *p0); -} - -void testNotNotEqualCHAR(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_CHAR(127, 127); - VERIFY_FAILS_END -} - -void testNotEqualINT16(void) -{ - UNITY_INT16 v0, v1; - UNITY_INT16 *p0, *p1; - - v0 = -32768; - v1 = 32767; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_INT16(v0, v1); - TEST_ASSERT_NOT_EQUAL_INT16(*p0, v1); - TEST_ASSERT_NOT_EQUAL_INT16(v0, *p1); - TEST_ASSERT_NOT_EQUAL_INT16(*p1, *p0); -} - -void testNotNotEqualINT16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_INT16(-32768, -32768); - VERIFY_FAILS_END -} - -void testNotEqualINT32(void) -{ - UNITY_INT32 v0, v1; - UNITY_INT32 *p0, *p1; - - v0 = -214783648; - v1 = 214783647; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_INT32(v0, v1); - TEST_ASSERT_NOT_EQUAL_INT32(*p0, v1); - TEST_ASSERT_NOT_EQUAL_INT32(v0, *p1); - TEST_ASSERT_NOT_EQUAL_INT32(*p1, *p0); -} - -void testNotNotEqualINT32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_INT32(-214783648, -214783648); - VERIFY_FAILS_END -} - -void testNotEqualUINT(void) -{ - UNITY_UINT v0, v1; - UNITY_UINT *p0, *p1; - - v0 = 0; - v1 = 1; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_UINT(v0, v1); - TEST_ASSERT_NOT_EQUAL_UINT(*p0, v1); - TEST_ASSERT_NOT_EQUAL_UINT(v0, *p1); - TEST_ASSERT_NOT_EQUAL_UINT(*p1, *p0); -} - -void testNotNotEqualUINT(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_UINT(1, 1); - VERIFY_FAILS_END -} - -void testNotEqualUINT8(void) -{ - UNITY_UINT8 v0, v1; - UNITY_UINT8 *p0, *p1; - - v0 = 0; - v1 = 255; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_UINT8(v0, v1); - TEST_ASSERT_NOT_EQUAL_UINT8(*p0, v1); - TEST_ASSERT_NOT_EQUAL_UINT8(v0, *p1); - TEST_ASSERT_NOT_EQUAL_UINT8(*p1, *p0); -} - -void testNotNotEqualUINT8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_UINT8(255, 255); - VERIFY_FAILS_END -} - -void testNotEqualUINT16(void) -{ - UNITY_UINT16 v0, v1; - UNITY_UINT16 *p0, *p1; - - v0 = 0; - v1 = 65535; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_UINT16(v0, v1); - TEST_ASSERT_NOT_EQUAL_UINT16(*p0, v1); - TEST_ASSERT_NOT_EQUAL_UINT16(v0, *p1); - TEST_ASSERT_NOT_EQUAL_UINT16(*p1, *p0); -} - -void testNotNotEqualUINT16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_UINT16(65535, 65535); - VERIFY_FAILS_END -} - -void testNotEqualUINT32(void) -{ - UNITY_UINT32 v0, v1; - UNITY_UINT32 *p0, *p1; - - v0 = 0u; - v1 = 4294967295u; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_UINT32(v0, v1); - TEST_ASSERT_NOT_EQUAL_UINT32(*p0, v1); - TEST_ASSERT_NOT_EQUAL_UINT32(v0, *p1); - TEST_ASSERT_NOT_EQUAL_UINT32(*p1, *p0); -} - -void testNotNotEqualUINT32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_UINT32(4294967295u, 4294967295u); - VERIFY_FAILS_END -} - -void testNotEqualHEX8(void) -{ - UNITY_UINT8 v0, v1; - UNITY_UINT8 *p0, *p1; - - v0 = 0x00; - v1 = 0xFF; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_HEX8(v0, v1); - TEST_ASSERT_NOT_EQUAL_HEX8(*p0, v1); - TEST_ASSERT_NOT_EQUAL_HEX8(v0, *p1); - TEST_ASSERT_NOT_EQUAL_HEX8(*p1, *p0); -} - -void testNotNotEqualHEX8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_HEX8(0xFF, 0xFF); - VERIFY_FAILS_END -} - -void testNotEqualHEX16(void) -{ - UNITY_UINT16 v0, v1; - UNITY_UINT16 *p0, *p1; - - v0 = 0x0000; - v1 = 0xFFFF; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_HEX16(v0, v1); - TEST_ASSERT_NOT_EQUAL_HEX16(*p0, v1); - TEST_ASSERT_NOT_EQUAL_HEX16(v0, *p1); - TEST_ASSERT_NOT_EQUAL_HEX16(*p1, *p0); -} - -void testNotNotEqualHEX16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_HEX16(0xFFFF, 0xFFFF); - VERIFY_FAILS_END -} - -void testNotEqualHEX32(void) -{ - UNITY_UINT32 v0, v1; - UNITY_UINT32 *p0, *p1; - - v0 = 0x00000000; - v1 = 0xFFFFFFFF; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_NOT_EQUAL_HEX32(v0, v1); - TEST_ASSERT_NOT_EQUAL_HEX32(*p0, v1); - TEST_ASSERT_NOT_EQUAL_HEX32(v0, *p1); - TEST_ASSERT_NOT_EQUAL_HEX32(*p1, *p0); -} - -void testNotNotEqualHEX32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_NOT_EQUAL_HEX32(0xFFFFFFFF, 0xFFFFFFFF); - VERIFY_FAILS_END -} - -/*-----------------*/ - -void testGreaterThan(void) -{ - UNITY_INT v0, v1; - UNITY_INT *p0, *p1; - - v0 = 0; - v1 = 1; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN(v0, v1); - TEST_ASSERT_GREATER_THAN(*p0, v1); - TEST_ASSERT_GREATER_THAN(v0, *p1); - TEST_ASSERT_GREATER_THAN(*p0, *p1); -} - -void testNotGreaterThan(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN(0, -1); - VERIFY_FAILS_END -} - -void testGreaterThanINT(void) -{ - UNITY_INT v0, v1; - UNITY_INT *p0, *p1; - - v0 = 302; - v1 = 3334; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_INT(v0, v1); - TEST_ASSERT_GREATER_THAN_INT(*p0, v1); - TEST_ASSERT_GREATER_THAN_INT(v0, *p1); - TEST_ASSERT_GREATER_THAN_INT(*p0, *p1); -} - -void testNotGreaterThanINT(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_INT(3334, 302); - VERIFY_FAILS_END -} - -void testGreaterThanINT8(void) -{ - UNITY_INT8 v0, v1; - UNITY_INT8 *p0, *p1; - - v0 = -128; - v1 = 127; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_INT8(v0, v1); - TEST_ASSERT_GREATER_THAN_INT8(*p0, v1); - TEST_ASSERT_GREATER_THAN_INT8(v0, *p1); - TEST_ASSERT_GREATER_THAN_INT8(*p0, *p1); -} - -void testNotGreaterThanINT8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_INT8(127, -128); - VERIFY_FAILS_END -} - -void testGreaterThanCHAR(void) -{ - char v0, v1; - char *p0, *p1; - - v0 = -128; - v1 = 127; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_CHAR(v0, v1); - TEST_ASSERT_GREATER_THAN_CHAR(*p0, v1); - TEST_ASSERT_GREATER_THAN_CHAR(v0, *p1); - TEST_ASSERT_GREATER_THAN_CHAR(*p0, *p1); -} - -void testNotGreaterThanCHAR(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_CHAR(127, -128); - VERIFY_FAILS_END -} - -void testGreaterThanINT16(void) -{ - UNITY_INT16 v0, v1; - UNITY_INT16 *p0, *p1; - - v0 = -32768; - v1 = 32767; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_INT16(v0, v1); - TEST_ASSERT_GREATER_THAN_INT16(*p0, v1); - TEST_ASSERT_GREATER_THAN_INT16(v0, *p1); - TEST_ASSERT_GREATER_THAN_INT16(*p0, *p1); -} - -void testNotGreaterThanINT16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_INT16(32768, -32768); - VERIFY_FAILS_END -} - -void testGreaterThanINT32(void) -{ - UNITY_INT32 v0, v1; - UNITY_INT32 *p0, *p1; - - v0 = -214783648; - v1 = 214783647; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_INT32(v0, v1); - TEST_ASSERT_GREATER_THAN_INT32(*p0, v1); - TEST_ASSERT_GREATER_THAN_INT32(v0, *p1); - TEST_ASSERT_GREATER_THAN_INT32(*p0, *p1); -} - -void testNotGreaterThanINT32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_INT32(214783647, -214783648); - VERIFY_FAILS_END -} - -void testGreaterThanUINT(void) -{ - UNITY_UINT v0, v1; - UNITY_UINT *p0, *p1; - - v0 = 0; - v1 = 1; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_UINT(v0, v1); - TEST_ASSERT_GREATER_THAN_UINT(*p0, v1); - TEST_ASSERT_GREATER_THAN_UINT(v0, *p1); - TEST_ASSERT_GREATER_THAN_UINT(*p0, *p1); -} - -void testNotGreaterThanUINT(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_UINT(1, 0); - VERIFY_FAILS_END -} - -void testGreaterThanUINT8(void) -{ - UNITY_UINT8 v0, v1; - UNITY_UINT8 *p0, *p1; - - v0 = 0; - v1 = 255; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_UINT8(v0, v1); - TEST_ASSERT_GREATER_THAN_UINT8(*p0, v1); - TEST_ASSERT_GREATER_THAN_UINT8(v0, *p1); - TEST_ASSERT_GREATER_THAN_UINT8(*p0, *p1); -} - -void testNotGreaterThanUINT8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_UINT8(255, 0); - VERIFY_FAILS_END -} - -void testGreaterThanUINT16(void) -{ - UNITY_UINT16 v0, v1; - UNITY_UINT16 *p0, *p1; - - v0 = 0; - v1 = 65535; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_UINT16(v0, v1); - TEST_ASSERT_GREATER_THAN_UINT16(*p0, v1); - TEST_ASSERT_GREATER_THAN_UINT16(v0, *p1); - TEST_ASSERT_GREATER_THAN_UINT16(*p0, *p1); -} - -void testNotGreaterThanUINT16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_UINT16(65535, 0); - VERIFY_FAILS_END -} - -void testGreaterThanUINT32(void) -{ - UNITY_UINT32 v0, v1; - UNITY_UINT32 *p0, *p1; - - v0 = 0u; - v1 = 4294967295u; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_UINT32(v0, v1); - TEST_ASSERT_GREATER_THAN_UINT32(*p0, v1); - TEST_ASSERT_GREATER_THAN_UINT32(v0, *p1); - TEST_ASSERT_GREATER_THAN_UINT32(*p0, *p1); -} - -void testNotGreaterThanUINT32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_UINT32(4294967295u, 0); - VERIFY_FAILS_END -} - -void testGreaterThanHEX8(void) -{ - UNITY_UINT8 v0, v1; - UNITY_UINT8 *p0, *p1; - - v0 = 0x00; - v1 = 0xFF; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_HEX8(v0, v1); - TEST_ASSERT_GREATER_THAN_HEX8(*p0, v1); - TEST_ASSERT_GREATER_THAN_HEX8(v0, *p1); - TEST_ASSERT_GREATER_THAN_HEX8(*p0, *p1); -} - -void testNotGreaterThanHEX8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_HEX8(0xFF, 0x00); - VERIFY_FAILS_END -} - -void testGreaterThanHEX16(void) -{ - UNITY_UINT16 v0, v1; - UNITY_UINT16 *p0, *p1; - - v0 = 0x0000; - v1 = 0xFFFF; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_HEX16(v0, v1); - TEST_ASSERT_GREATER_THAN_HEX16(*p0, v1); - TEST_ASSERT_GREATER_THAN_HEX16(v0, *p1); - TEST_ASSERT_GREATER_THAN_HEX16(*p0, *p1); -} - -void testNotGreaterThanHEX16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_HEX16(0xFFFF, 0x00); - VERIFY_FAILS_END -} - -void testGreaterThanHEX32(void) -{ - UNITY_UINT32 v0, v1; - UNITY_UINT32 *p0, *p1; - - v0 = 0x00000000; - v1 = 0xFFFFFFFF; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_GREATER_THAN_HEX32(v0, v1); - TEST_ASSERT_GREATER_THAN_HEX32(*p0, v1); - TEST_ASSERT_GREATER_THAN_HEX32(v0, *p1); - TEST_ASSERT_GREATER_THAN_HEX32(*p0, *p1); -} - -void testNotGreaterThanHEX32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_THAN_HEX32(0xFFFFFFFF, 0x00); - VERIFY_FAILS_END -} - -void testGreaterOrEqual(void) -{ - UNITY_INT v0, v1, v2; - UNITY_INT *p0, *p1, *p2; - - v0 = 0; - v1 = 1; - v2 = 0; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL(*p0, *p2); -} - -void testNotGreaterOrEqual(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL(0, -1); - VERIFY_FAILS_END -} - -void testGreaterOrEqualINT(void) -{ - UNITY_INT v0, v1, v2; - UNITY_INT *p0, *p1, *p2; - - v0 = 302; - v1 = 3334; - v2 = 302; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_INT(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_INT(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_INT(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_INT(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_INT(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_INT(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_INT(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_INT(*p0, *p2); -} - -void testNotGreaterOrEqualINT(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_INT(3334, 302); - VERIFY_FAILS_END -} - -void testGreaterOrEqualINT8(void) -{ - UNITY_INT8 v0, v1, v2; - UNITY_INT8 *p0, *p1, *p2; - - v0 = -128; - v1 = 127; - v2 = -128; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_INT8(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_INT8(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_INT8(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_INT8(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_INT8(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_INT8(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_INT8(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_INT8(*p0, *p2); -} - -void testNotGreaterOrEqualINT8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_INT8(127, -128); - VERIFY_FAILS_END -} - -void testGreaterOrEqualCHAR(void) -{ - char v0, v1, v2; - char *p0, *p1, *p2; - - v0 = -128; - v1 = 127; - v2 = -128; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, *p2); -} - -void testNotGreaterOrEqualCHAR(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_CHAR(127, -128); - VERIFY_FAILS_END -} - -void testGreaterOrEqualINT16(void) -{ - UNITY_INT16 v0, v1, v2; - UNITY_INT16 *p0, *p1, *p2; - - v0 = -32768; - v1 = 32767; - v2 = -32768; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_INT16(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_INT16(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_INT16(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_INT16(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_INT16(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_INT16(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_INT16(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_INT16(*p0, *p2); -} - -void testNotGreaterOrEqualINT16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_INT16(32767, -32768); - VERIFY_FAILS_END -} - -void testGreaterOrEqualINT32(void) -{ - UNITY_INT32 v0, v1, v2; - UNITY_INT32 *p0, *p1, *p2; - - v0 = -214783648; - v1 = 214783647; - v2 = -214783648; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_INT32(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_INT32(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_INT32(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_INT32(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_INT32(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_INT32(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_INT32(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_INT32(*p0, *p2); -} - -void testNotGreaterOrEqualINT32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_INT32(214783647, -214783648); - VERIFY_FAILS_END -} - -void testGreaterOrEqualUINT(void) -{ - UNITY_UINT v0, v1, v2; - UNITY_UINT *p0, *p1, *p2; - - v0 = 0; - v1 = 1; - v2 = 0; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_UINT(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT(*p0, *p2); -} - -void testNotGreaterOrEqualUINT(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_UINT(1, 0); - VERIFY_FAILS_END -} - -void testGreaterOrEqualUINT8(void) -{ - UNITY_UINT8 v0, v1, v2; - UNITY_UINT8 *p0, *p1, *p2; - - v0 = 0; - v1 = 255; - v2 = 0; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_UINT8(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT8(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT8(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT8(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT8(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT8(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT8(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT8(*p0, *p2); -} - -void testNotGreaterOrEqualUINT8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_UINT8(255, 0); - VERIFY_FAILS_END -} - -void testGreaterOrEqualUINT16(void) -{ - UNITY_UINT16 v0, v1, v2; - UNITY_UINT16 *p0, *p1, *p2; - - v0 = 0; - v1 = 65535; - v2 = 0; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_UINT16(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT16(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT16(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT16(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT16(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT16(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT16(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT16(*p0, *p2); -} - -void testNotGreaterOrEqualUINT16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_UINT16(65535, 0); - VERIFY_FAILS_END -} - -void testGreaterOrEqualUINT32(void) -{ - UNITY_UINT32 v0, v1, v2; - UNITY_UINT32 *p0, *p1, *p2; - - v0 = 0; - v1 = 4294967295u; - v2 = 0; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_UINT32(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT32(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT32(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT32(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_UINT32(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT32(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT32(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_UINT32(*p0, *p2); -} - -void testNotGreaterOrEqualUINT32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_UINT32(4294967295u, 0); - VERIFY_FAILS_END -} - -void testGreaterOrEqualHEX8(void) -{ - UNITY_UINT8 v0, v1, v2; - UNITY_UINT8 *p0, *p1, *p2; - - v0 = 0x00; - v1 = 0xFF; - v2 = 0x00; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_HEX8(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX8(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX8(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX8(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX8(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_HEX8(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_HEX8(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_HEX8(*p0, *p2); -} - -void testNotGreaterOrEqualHEX8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_HEX8(0xFF, 0x00); - VERIFY_FAILS_END -} - -void testGreaterOrEqualHEX16(void) -{ - UNITY_UINT16 v0, v1, v2; - UNITY_UINT16 *p0, *p1, *p2; - - v0 = 0x0000; - v1 = 0xFFFF; - v2 = 0x0000; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_HEX16(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX16(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX16(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX16(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX16(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_HEX16(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_HEX16(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_HEX16(*p0, *p2); -} - -void testNotGreaterOrEqualHEX16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_HEX16(0xFFFF, 0x00); - VERIFY_FAILS_END -} - -void testGreaterOrEqualHEX32(void) -{ - UNITY_UINT32 v0, v1, v2; - UNITY_UINT32 *p0, *p1, *p2; - - v0 = 0x00000000; - v1 = 0xFFFFFFFF; - v2 = 0x00000000; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_GREATER_OR_EQUAL_HEX32(v0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX32(*p0, v1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX32(v0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX32(*p0, *p1); - TEST_ASSERT_GREATER_OR_EQUAL_HEX32(v0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_HEX32(*p0, v2); - TEST_ASSERT_GREATER_OR_EQUAL_HEX32(v0, *p2); - TEST_ASSERT_GREATER_OR_EQUAL_HEX32(*p0, *p2); -} - -void testNotGreaterOrEqualHEX32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_GREATER_OR_EQUAL_HEX32(0xFFFFFFFF, 0x00); - VERIFY_FAILS_END -} - -/*-----------------*/ - -void testLessThan(void) -{ - UNITY_INT v0, v1; - UNITY_INT *p0, *p1; - - v0 = 0; - v1 = -1; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN(v0, v1); - TEST_ASSERT_LESS_THAN(*p0, v1); - TEST_ASSERT_LESS_THAN(v0, *p1); - TEST_ASSERT_LESS_THAN(*p0, *p1); -} - -void testNotLessThan(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN(0, 1); - VERIFY_FAILS_END -} - -void testLessThanINT(void) -{ - UNITY_INT v0, v1; - UNITY_INT *p0, *p1; - - v0 = 3334; - v1 = 302; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_INT(v0, v1); - TEST_ASSERT_LESS_THAN_INT(*p0, v1); - TEST_ASSERT_LESS_THAN_INT(v0, *p1); - TEST_ASSERT_LESS_THAN_INT(*p0, *p1); -} - -void testNotLessThanINT(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_INT(302, 3334); - VERIFY_FAILS_END -} - -void testLessThanINT8(void) -{ - UNITY_INT8 v0, v1; - UNITY_INT8 *p0, *p1; - - v0 = 127; - v1 = -128; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_INT8(v0, v1); - TEST_ASSERT_LESS_THAN_INT8(*p0, v1); - TEST_ASSERT_LESS_THAN_INT8(v0, *p1); - TEST_ASSERT_LESS_THAN_INT8(*p0, *p1); -} - -void testNotLessThanINT8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_INT8(-128, 127); - VERIFY_FAILS_END -} - -void testLessThanCHAR(void) -{ - char v0, v1; - char *p0, *p1; - - v0 = 127; - v1 = -128; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_CHAR(v0, v1); - TEST_ASSERT_LESS_THAN_CHAR(*p0, v1); - TEST_ASSERT_LESS_THAN_CHAR(v0, *p1); - TEST_ASSERT_LESS_THAN_CHAR(*p0, *p1); -} - -void testNotLessThanCHAR(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_CHAR(-128, 127); - VERIFY_FAILS_END -} - -void testLessThanINT16(void) -{ - UNITY_INT16 v0, v1; - UNITY_INT16 *p0, *p1; - - v0 = 32767; - v1 = -32768; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_INT16(v0, v1); - TEST_ASSERT_LESS_THAN_INT16(*p0, v1); - TEST_ASSERT_LESS_THAN_INT16(v0, *p1); - TEST_ASSERT_LESS_THAN_INT16(*p0, *p1); -} - -void testNotLessThanINT16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_INT16(-32768, 32767); - VERIFY_FAILS_END -} - -void testLessThanINT32(void) -{ - UNITY_INT32 v0, v1; - UNITY_INT32 *p0, *p1; - - v0 = 214783647; - v1 = -214783648; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_INT32(v0, v1); - TEST_ASSERT_LESS_THAN_INT32(*p0, v1); - TEST_ASSERT_LESS_THAN_INT32(v0, *p1); - TEST_ASSERT_LESS_THAN_INT32(*p0, *p1); -} - -void testNotLessThanINT32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_INT32(-214783648, 214783647); - VERIFY_FAILS_END -} - -void testLessThanUINT(void) -{ - UNITY_UINT v0, v1; - UNITY_UINT *p0, *p1; - - v0 = 1; - v1 = 0; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_UINT(v0, v1); - TEST_ASSERT_LESS_THAN_UINT(*p0, v1); - TEST_ASSERT_LESS_THAN_UINT(v0, *p1); - TEST_ASSERT_LESS_THAN_UINT(*p0, *p1); -} - -void testNotLessThanUINT(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_UINT(0, 1); - VERIFY_FAILS_END -} - -void testLessThanUINT8(void) -{ - UNITY_UINT8 v0, v1; - UNITY_UINT8 *p0, *p1; - - v0 = 255; - v1 = 0; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_UINT8(v0, v1); - TEST_ASSERT_LESS_THAN_UINT8(*p0, v1); - TEST_ASSERT_LESS_THAN_UINT8(v0, *p1); - TEST_ASSERT_LESS_THAN_UINT8(*p0, *p1); -} - -void testNotLessThanUINT8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_UINT8(0, 255); - VERIFY_FAILS_END -} - -void testLessThanUINT16(void) -{ - UNITY_UINT16 v0, v1; - UNITY_UINT16 *p0, *p1; - - v0 = 65535; - v1 = 0; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_UINT16(v0, v1); - TEST_ASSERT_LESS_THAN_UINT16(*p0, v1); - TEST_ASSERT_LESS_THAN_UINT16(v0, *p1); - TEST_ASSERT_LESS_THAN_UINT16(*p0, *p1); -} - -void testNotLessThanUINT16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_UINT16(0, 65535); - VERIFY_FAILS_END -} - -void testLessThanUINT32(void) -{ - UNITY_UINT32 v0, v1; - UNITY_UINT32 *p0, *p1; - - v0 = 4294967295u; - v1 = 0; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_UINT32(v0, v1); - TEST_ASSERT_LESS_THAN_UINT32(*p0, v1); - TEST_ASSERT_LESS_THAN_UINT32(v0, *p1); - TEST_ASSERT_LESS_THAN_UINT32(*p0, *p1); -} - -void testNotLessThanUINT32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_UINT32(0, 4294967295u); - VERIFY_FAILS_END -} - -void testLessThanHEX8(void) -{ - UNITY_UINT8 v0, v1; - UNITY_UINT8 *p0, *p1; - - v0 = 0xFF; - v1 = 0x00; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_HEX8(v0, v1); - TEST_ASSERT_LESS_THAN_HEX8(*p0, v1); - TEST_ASSERT_LESS_THAN_HEX8(v0, *p1); - TEST_ASSERT_LESS_THAN_HEX8(*p0, *p1); -} - -void testNotLessThanHEX8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_HEX8(0x00, 0xFF); - VERIFY_FAILS_END -} - -void testLessThanHEX16(void) -{ - UNITY_UINT16 v0, v1; - UNITY_UINT16 *p0, *p1; - - v0 = 0xFFFF; - v1 = 0x0000; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_HEX16(v0, v1); - TEST_ASSERT_LESS_THAN_HEX16(*p0, v1); - TEST_ASSERT_LESS_THAN_HEX16(v0, *p1); - TEST_ASSERT_LESS_THAN_HEX16(*p0, *p1); -} - -void testNotLessThanHEX16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_HEX16(0x0000, 0xFFFF); - VERIFY_FAILS_END -} - -void testLessThanHEX32(void) -{ - UNITY_UINT32 v0, v1; - UNITY_UINT32 *p0, *p1; - - v0 = 0xFFFFFFFF; - v1 = 0x00000000; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_LESS_THAN_HEX32(v0, v1); - TEST_ASSERT_LESS_THAN_HEX32(*p0, v1); - TEST_ASSERT_LESS_THAN_HEX32(v0, *p1); - TEST_ASSERT_LESS_THAN_HEX32(*p0, *p1); -} - -void testNotLessThanHEX32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_THAN_HEX32(0x00000000, 0xFFFFFFFF); - VERIFY_FAILS_END -} - -void testLessOrEqual(void) -{ - UNITY_INT v0, v1, v2; - UNITY_INT *p0, *p1, *p2; - - v0 = 0; - v1 = -1; - v2 = 0; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL(*p0, *p2); -} - -void testNotLessOrEqual(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL(0, 1); - VERIFY_FAILS_END -} - -void testLessOrEqualINT(void) -{ - UNITY_INT v0, v1, v2; - UNITY_INT *p0, *p1, *p2; - - v0 = 3334; - v1 = 302; - v2 = 3334; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_INT(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_INT(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_INT(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_INT(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_INT(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_INT(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_INT(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_INT(*p0, *p2); -} - -void testNotLessOrEqualINT(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_INT(302, 3334); - VERIFY_FAILS_END -} - -void testLessOrEqualINT8(void) -{ - UNITY_INT8 v0, v1, v2; - UNITY_INT8 *p0, *p1, *p2; - - v0 = 127; - v1 = -128; - v2 = 127; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_INT8(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_INT8(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_INT8(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_INT8(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_INT8(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_INT8(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_INT8(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_INT8(*p0, *p2); -} - -void testNotLessOrEqualINT8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_INT8(-128, 127); - VERIFY_FAILS_END -} - -void testLessOrEqualCHAR(void) -{ - char v0, v1, v2; - char *p0, *p1, *p2; - - v0 = 127; - v1 = -128; - v2 = 127; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, *p2); -} - -void testNotLessOrEqualCHAR(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_CHAR(-128, 127); - VERIFY_FAILS_END -} - -void testLessOrEqualINT16(void) -{ - UNITY_INT16 v0, v1, v2; - UNITY_INT16 *p0, *p1, *p2; - - v0 = 32767; - v1 = -32768; - v2 = 32767; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_INT16(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_INT16(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_INT16(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_INT16(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_INT16(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_INT16(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_INT16(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_INT16(*p0, *p2); -} - -void testNotLessOrEqualINT16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_INT16(-32768, 32767); - VERIFY_FAILS_END -} - -void testLessOrEqualINT32(void) -{ - UNITY_INT32 v0, v1, v2; - UNITY_INT32 *p0, *p1, *p2; - - v0 = 214783647; - v1 = -214783648; - v2 = 214783647; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_INT32(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_INT32(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_INT32(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_INT32(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_INT32(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_INT32(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_INT32(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_INT32(*p0, *p2); -} - -void testNotLessOrEqualINT32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_INT32(-214783648, 214783647); - VERIFY_FAILS_END -} - -void testLessOrEqualUINT(void) -{ - UNITY_UINT v0, v1, v2; - UNITY_UINT *p0, *p1, *p2; - - v0 = 1; - v1 = 0; - v2 = 1; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_UINT(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_UINT(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_UINT(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_UINT(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_UINT(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_UINT(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_UINT(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_UINT(*p0, *p2); -} - -void testNotLessOrEqualUINT(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_UINT(0, 1); - VERIFY_FAILS_END -} - -void testLessOrEqualUINT8(void) -{ - UNITY_UINT8 v0, v1, v2; - UNITY_UINT8 *p0, *p1, *p2; - - v0 = 255; - v1 = 0; - v2 = 255; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_UINT8(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_UINT8(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_UINT8(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_UINT8(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_UINT8(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_UINT8(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_UINT8(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_UINT8(*p0, *p2); -} - -void testNotLessOrEqualUINT8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_UINT8(0, 255); - VERIFY_FAILS_END -} - -void testLessOrEqualUINT16(void) -{ - UNITY_UINT16 v0, v1, v2; - UNITY_UINT16 *p0, *p1, *p2; - - v0 = 65535; - v1 = 0; - v2 = 65535; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_UINT16(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_UINT16(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_UINT16(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_UINT16(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_UINT16(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_UINT16(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_UINT16(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_UINT16(*p0, *p2); -} - -void testNotLessOrEqualUINT16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_UINT16(0, 65535); - VERIFY_FAILS_END -} - -void testLessOrEqualUINT32(void) -{ - UNITY_UINT32 v0, v1, v2; - UNITY_UINT32 *p0, *p1, *p2; - - v0 = 4294967295u; - v1 = 0; - v2 = 4294967295u; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_UINT32(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_UINT32(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_UINT32(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_UINT32(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_UINT32(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_UINT32(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_UINT32(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_UINT32(*p0, *p2); -} - -void testNotLessOrEqualUINT32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_UINT32(0, 4294967295u); - VERIFY_FAILS_END -} - -void testLessOrEqualHEX8(void) -{ - UNITY_UINT8 v0, v1, v2; - UNITY_UINT8 *p0, *p1, *p2; - - v0 = 0xFF; - v1 = 0x00; - v2 = 0xFF; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_HEX8(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_HEX8(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_HEX8(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_HEX8(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_HEX8(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_HEX8(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_HEX8(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_HEX8(*p0, *p2); -} - -void testNotLessOrEqualHEX8(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_HEX8(0x00, 0xFF); - VERIFY_FAILS_END -} - -void testLessOrEqualHEX16(void) -{ - UNITY_UINT16 v0, v1, v2; - UNITY_UINT16 *p0, *p1, *p2; - - v0 = 0xFFFF; - v1 = 0x0000; - v2 = 0xFFFF; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_HEX16(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_HEX16(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_HEX16(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_HEX16(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_HEX16(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_HEX16(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_HEX16(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_HEX16(*p0, *p2); -} - -void testNotLessOrEqualHEX16(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_HEX16(0x0000, 0xFFFF); - VERIFY_FAILS_END -} - -void testLessOrEqualHEX32(void) -{ - UNITY_UINT32 v0, v1, v2; - UNITY_UINT32 *p0, *p1, *p2; - - v0 = 0xFFFFFFFF; - v1 = 0x00000000; - v2 = 0xFFFFFFFF; - p0 = &v0; - p1 = &v1; - p2 = &v2; - - TEST_ASSERT_LESS_OR_EQUAL_HEX32(v0, v1); - TEST_ASSERT_LESS_OR_EQUAL_HEX32(*p0, v1); - TEST_ASSERT_LESS_OR_EQUAL_HEX32(v0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_HEX32(*p0, *p1); - TEST_ASSERT_LESS_OR_EQUAL_HEX32(v0, v2); - TEST_ASSERT_LESS_OR_EQUAL_HEX32(*p0, v2); - TEST_ASSERT_LESS_OR_EQUAL_HEX32(v0, *p2); - TEST_ASSERT_LESS_OR_EQUAL_HEX32(*p0, *p2); -} - -void testNotLessOrEqualHEX32(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_LESS_OR_EQUAL_HEX32(0x00000000, 0xFFFFFFFF); - VERIFY_FAILS_END -} - -void testHexPrintsUpToMaxNumberOfNibbles(void) -{ -#ifndef USING_OUTPUT_SPY - TEST_IGNORE(); -#else - startPutcharSpy(); - UnityPrintNumberHex(0xBEE, 21); - endPutcharSpy(); -#ifdef UNITY_SUPPORT_64 - TEST_ASSERT_EQUAL_INT(16, strlen(getBufferPutcharSpy())); -#else - TEST_ASSERT_EQUAL_INT( 8, strlen(getBufferPutcharSpy())); -#endif -#endif -} - -void testPrintNumbers32(void) -{ -#ifndef USING_OUTPUT_SPY - TEST_IGNORE_MESSAGE("Compile with '-D UNITY_OUTPUT_CHAR=putcharSpy' to enable print testing"); -#else - TEST_ASSERT_EQUAL_PRINT_NUMBERS("0", 0); - TEST_ASSERT_EQUAL_PRINT_NUMBERS("1", 1); - TEST_ASSERT_EQUAL_PRINT_NUMBERS("-1", -1); - TEST_ASSERT_EQUAL_PRINT_NUMBERS("2000000000", 2000000000); - TEST_ASSERT_EQUAL_PRINT_NUMBERS("-2147483648", (UNITY_INT32)0x80000000); - TEST_ASSERT_EQUAL_PRINT_NUMBERS("-1", (UNITY_INT32)0xFFFFFFFF); -#endif -} - -void testPrintNumbersUnsigned32(void) -{ -#ifndef USING_OUTPUT_SPY - TEST_IGNORE(); -#else - TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("0", 0); - TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("1", 1); - TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("1500000000", 1500000000); - TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("2147483648", (UNITY_UINT32)0x80000000); - TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("4294967295", (UNITY_UINT32)0xFFFFFFFF); -#endif -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers_64.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers_64.c deleted file mode 100644 index e12566e83..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers_64.c +++ /dev/null @@ -1,773 +0,0 @@ -/* ========================================== - 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] -========================================== */ - -#include "unity.h" -#define TEST_INSTANCES -#include "self_assessment_utils.h" - -static int SetToOneToFailInTearDown; -static int SetToOneMeanWeAlreadyCheckedThisGuy; - -void setUp(void) -{ - SetToOneToFailInTearDown = 0; - SetToOneMeanWeAlreadyCheckedThisGuy = 0; -} - -void tearDown(void) -{ - endPutcharSpy(); /* Stop suppressing test output */ - if (SetToOneToFailInTearDown == 1) - { - /* These will be skipped internally if already failed/ignored */ - TEST_FAIL_MESSAGE("<= Failed in tearDown"); - TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); - } - if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) - { - UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); - UNITY_OUTPUT_CHAR('\n'); - } -} - -void testInt64ArrayWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualSmallDelta[] = {12345001, -12344996, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - TEST_ASSERT_INT64_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); -#endif -} - -void testInt64ArrayWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualSmallDelta[] = {12345001, -12344996, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); -#endif -} - -void tesUInt64ArrayNotWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayNotWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaPointless(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaPointlessAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaExpectedNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaExpectedNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaActualNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, NULL, 3); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaActualNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testInt64ArrayWithinDeltaSamePointer(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, expected, 3); -#endif -} - -void testInt64ArrayWithinDeltaSamePointerAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); -#endif -} - -void testUInt64ArrayWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualSmallDelta[] = {12345001, 12344996, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); -#endif -} - -void testUInt64ArrayWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualSmallDelta[] = {12345001, 12344996, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); -#endif -} - -void testUInt64ArrayNotWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayNotWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaPointless(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaPointlessAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaExpectedNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaExpectedNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaActualNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, NULL, 3); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaActualNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testUInt64ArrayWithinDeltaSamePointer(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, expected, 3); -#endif -} - -void testUInt64ArrayWithinDeltaSamePointerAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); -#endif -} - -void testHEX64ArrayWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualSmallDelta[] = {0xABCD123500000000, 0xABCD112100000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x100000000, expected, actualSmallDelta, 3); - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, actualBigDelta, 3); -#endif -} - -void testHEX64ArrayWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualSmallDelta[] = {0xABCD123500000000, 0xABCD112100000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x100000000, expected, actualSmallDelta, 3, "Custom Message."); - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, actualBigDelta, 3, "Custom Message."); -#endif -} - -void testHEX64ArrayNotWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x100000000, expected, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayNotWithinDeltaAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x100000000, expected, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaPointless(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, actualBigDelta, 0); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaPointlessAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, actualBigDelta, 0, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaExpectedNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, NULL, actualBigDelta, 3); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaExpectedNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, NULL, actualBigDelta, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaActualNull(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, NULL, 3); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaActualNullAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, NULL, 3, "Custom Message."); - VERIFY_FAILS_END -#endif -} - -void testHEX64ArrayWithinDeltaSamePointer(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - - TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, expected, 3); -#endif -} - -void testHEX64ArrayWithinDeltaSamePointerAndMessage(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; - - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, expected, 3, "Custom Message."); -#endif -} - -void testEqualHex64s(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 v0, v1; - UNITY_UINT64 *p0, *p1; - - v0 = 0x9876543201234567; - v1 = 0x9876543201234567; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_HEX64(0x9876543201234567, 0x9876543201234567); - TEST_ASSERT_EQUAL_HEX64(v0, v1); - TEST_ASSERT_EQUAL_HEX64(0x9876543201234567, v1); - TEST_ASSERT_EQUAL_HEX64(v0, 0x9876543201234567); - TEST_ASSERT_EQUAL_HEX64(*p0, v1); - TEST_ASSERT_EQUAL_HEX64(*p0, *p1); - TEST_ASSERT_EQUAL_HEX64(*p0, 0x9876543201234567); -#endif -} - -void testEqualUint64s(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 v0, v1; - UNITY_UINT64 *p0, *p1; - - v0 = 0x9876543201234567; - v1 = 0x9876543201234567; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_UINT64(0x9876543201234567, 0x9876543201234567); - TEST_ASSERT_EQUAL_UINT64(v0, v1); - TEST_ASSERT_EQUAL_UINT64(0x9876543201234567, v1); - TEST_ASSERT_EQUAL_UINT64(v0, 0x9876543201234567); - TEST_ASSERT_EQUAL_UINT64(*p0, v1); - TEST_ASSERT_EQUAL_UINT64(*p0, *p1); - TEST_ASSERT_EQUAL_UINT64(*p0, 0x9876543201234567); -#endif -} - -void testEqualInt64s(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 v0, v1; - UNITY_INT64 *p0, *p1; - - v0 = (UNITY_INT64)0x9876543201234567; - v1 = (UNITY_INT64)0x9876543201234567; - p0 = &v0; - p1 = &v1; - - TEST_ASSERT_EQUAL_INT64(0x9876543201234567, 0x9876543201234567); - TEST_ASSERT_EQUAL_INT64(v0, v1); - TEST_ASSERT_EQUAL_INT64(0x9876543201234567, v1); - TEST_ASSERT_EQUAL_INT64(v0, 0x9876543201234567); - TEST_ASSERT_EQUAL_INT64(*p0, v1); - TEST_ASSERT_EQUAL_INT64(*p0, *p1); - TEST_ASSERT_EQUAL_INT64(*p0, 0x9876543201234567); -#endif -} - - -void testNotEqualHex64s(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 v0, v1; - - v0 = 9000000000; - v1 = 9100000000; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX64(v0, v1); - VERIFY_FAILS_END -#endif -} - -void testNotEqualUint64s(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_UINT64 v0, v1; - - v0 = 9000000000; - v1 = 9100000000; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_UINT64(v0, v1); - VERIFY_FAILS_END -#endif -} - -void testNotEqualInt64s(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 v0, v1; - - v0 = -9000000000; - v1 = 9100000000; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_INT64(v0, v1); - VERIFY_FAILS_END -#endif -} - -void testNotEqualHex64sIfSigned(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - UNITY_INT64 v0, v1; - - v0 = -9000000000; - v1 = 9000000000; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_HEX64(v0, v1); - VERIFY_FAILS_END -#endif -} - -void testHEX64sWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - TEST_ASSERT_HEX64_WITHIN(1, 0x7FFFFFFFFFFFFFFF,0x7FFFFFFFFFFFFFFE); - TEST_ASSERT_HEX64_WITHIN(5, 5000, 4996); - TEST_ASSERT_HEX64_WITHIN(5, 5000, 5005); -#endif -} - -void testHEX64sNotWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_WITHIN(1, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFC); - VERIFY_FAILS_END -#endif -} - -void testHEX64sNotWithinDeltaEvenThoughASignedIntWouldPass(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_WITHIN(5, 1, -1); - VERIFY_FAILS_END -#endif -} - -void testUINT64sWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - TEST_ASSERT_UINT64_WITHIN(1, 0x7FFFFFFFFFFFFFFF,0x7FFFFFFFFFFFFFFE); - TEST_ASSERT_UINT64_WITHIN(5, 5000, 4996); - TEST_ASSERT_UINT64_WITHIN(5, 5000, 5005); -#endif -} - -void testUINT64sNotWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_WITHIN(1, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFC); - VERIFY_FAILS_END -#endif -} - -void testUINT64sNotWithinDeltaEvenThoughASignedIntWouldPass(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_WITHIN(5, 1, -1); - VERIFY_FAILS_END -#endif -} - -void testINT64sWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - TEST_ASSERT_INT64_WITHIN(1, 0x7FFFFFFFFFFFFFFF,0x7FFFFFFFFFFFFFFE); - TEST_ASSERT_INT64_WITHIN(5, 5000, 4996); - TEST_ASSERT_INT64_WITHIN(5, 5000, 5005); -#endif -} - -void testINT64sNotWithinDelta(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_WITHIN(1, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFC); - VERIFY_FAILS_END -#endif -} - -void testINT64sNotWithinDeltaAndDifferenceOverflows(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_WITHIN(1, 0x8000000000000000, 0x7FFFFFFFFFFFFFFF); - VERIFY_FAILS_END -#endif -} - -void testPrintNumbersInt64(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - #ifndef USING_OUTPUT_SPY - TEST_IGNORE(); - #else - TEST_ASSERT_EQUAL_PRINT_NUMBERS("0", 0); - TEST_ASSERT_EQUAL_PRINT_NUMBERS("10000000000", 10000000000); - TEST_ASSERT_EQUAL_PRINT_NUMBERS("-9223372036854775808", (UNITY_INT)0x8000000000000000); - TEST_ASSERT_EQUAL_PRINT_NUMBERS("-1", (UNITY_INT)0xFFFFFFFFFFFFFFFF); - #endif -#endif -} - -void testPrintNumbersUInt64(void) -{ -#ifndef UNITY_SUPPORT_64 - TEST_IGNORE(); -#else - #ifndef USING_OUTPUT_SPY - TEST_IGNORE(); - #else - TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("0", 0); - TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("70000000000", 70000000000); - TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("9223372036854775808", (UNITY_UINT)0x8000000000000000); - TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("18446744073709551615", (UNITY_UINT)0xFFFFFFFFFFFFFFFF); - #endif -#endif -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_memory.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_memory.c deleted file mode 100644 index b3cff1319..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_memory.c +++ /dev/null @@ -1,81 +0,0 @@ -/* ========================================== - 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] -========================================== */ - -#include "unity.h" -#define TEST_INSTANCES -#include "self_assessment_utils.h" - -static int SetToOneToFailInTearDown; -static int SetToOneMeanWeAlreadyCheckedThisGuy; - -void setUp(void) -{ - SetToOneToFailInTearDown = 0; - SetToOneMeanWeAlreadyCheckedThisGuy = 0; -} - -void tearDown(void) -{ - endPutcharSpy(); /* Stop suppressing test output */ - if (SetToOneToFailInTearDown == 1) - { - /* These will be skipped internally if already failed/ignored */ - TEST_FAIL_MESSAGE("<= Failed in tearDown"); - TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); - } - if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) - { - UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); - UNITY_OUTPUT_CHAR('\n'); - } -} - -void testEqualMemory(void) -{ - const char *testString = "whatever"; - - TEST_ASSERT_EQUAL_MEMORY(testString, testString, 8); - TEST_ASSERT_EQUAL_MEMORY("whatever", "whatever", 8); - TEST_ASSERT_EQUAL_MEMORY("whatever", testString, 8); - TEST_ASSERT_EQUAL_MEMORY(testString, "whatever", 8); - TEST_ASSERT_EQUAL_MEMORY(testString, "whatever", 2); - TEST_ASSERT_EQUAL_MEMORY(NULL, NULL, 1); -} - -void testNotEqualMemory1(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_MEMORY("foo", "bar", 3); - VERIFY_FAILS_END -} - -void testNotEqualMemory2(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_MEMORY("fool", "food", 4); - VERIFY_FAILS_END -} - -void testNotEqualMemory3(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_MEMORY(NULL, "food", 4); - VERIFY_FAILS_END -} - -void testNotEqualMemory4(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_MEMORY("fool", NULL, 4); - VERIFY_FAILS_END -} - -void testNotEqualMemoryLengthZero(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_MEMORY(NULL, NULL, 0); - VERIFY_FAILS_END -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_parameterized.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_parameterized.c deleted file mode 100644 index 3129817e9..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_parameterized.c +++ /dev/null @@ -1,171 +0,0 @@ -/* ========================================== - 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] -========================================== */ - -#include -#include -#include "unity.h" - -/* Support for Meta Test Rig */ -#define TEST_CASE(...) - -/* Include Passthroughs for Linking Tests */ -void putcharSpy(int c) { (void)putchar(c);} -void flushSpy(void) {} - -#define EXPECT_ABORT_BEGIN \ - if (TEST_PROTECT()) \ - { - -#define VERIFY_FAILS_END \ - } \ - Unity.CurrentTestFailed = (Unity.CurrentTestFailed != 0) ? 0 : 1; \ - if (Unity.CurrentTestFailed == 1) { \ - SetToOneMeanWeAlreadyCheckedThisGuy = 1; \ - UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \ - UNITY_OUTPUT_CHAR(':'); \ - UnityPrint(Unity.CurrentTestName); \ - UnityPrint(":FAIL: [[[[ Test Should Have Failed But Did Not ]]]]"); \ - UNITY_OUTPUT_CHAR('\n'); \ - } - -#define VERIFY_IGNORES_END \ - } \ - Unity.CurrentTestFailed = (Unity.CurrentTestIgnored != 0) ? 0 : 1; \ - Unity.CurrentTestIgnored = 0; \ - if (Unity.CurrentTestFailed == 1) { \ - SetToOneMeanWeAlreadyCheckedThisGuy = 1; \ - UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \ - UNITY_OUTPUT_CHAR(':'); \ - UnityPrint(Unity.CurrentTestName); \ - UnityPrint(":FAIL: [[[[ Test Should Have Ignored But Did Not ]]]]"); \ - UNITY_OUTPUT_CHAR('\n'); \ - } - -static int SetToOneToFailInTearDown; -static int SetToOneMeanWeAlreadyCheckedThisGuy; -static unsigned NextExpectedStringIndex; -static unsigned NextExpectedCharIndex; - -void suiteSetUp(void) -{ - NextExpectedStringIndex = 0; - NextExpectedCharIndex = 0; -} - -void setUp(void) -{ - SetToOneToFailInTearDown = 0; - SetToOneMeanWeAlreadyCheckedThisGuy = 0; -} - -void tearDown(void) -{ - if (SetToOneToFailInTearDown == 1) - TEST_FAIL_MESSAGE("<= Failed in tearDown"); - if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) - { - UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); - UNITY_OUTPUT_CHAR('\n'); - } -} - -TEST_CASE(0) -TEST_CASE(44) -TEST_CASE((90)+9) -void test_TheseShouldAllPass(int Num) -{ - TEST_ASSERT_TRUE(Num < 100); -} - -TEST_CASE(3) -TEST_CASE(77) -TEST_CASE( (99) + 1 - (1)) -void test_TheseShouldAllFail(int Num) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_TRUE(Num > 100); - VERIFY_FAILS_END -} - -TEST_CASE(1) -TEST_CASE(44) -TEST_CASE(99) -TEST_CASE(98) -void test_TheseAreEveryOther(int Num) -{ - if (Num & 1) - { - EXPECT_ABORT_BEGIN - TEST_ASSERT_TRUE(Num > 100); - VERIFY_FAILS_END - } - else - { - TEST_ASSERT_TRUE(Num < 100); - } -} - -void test_NormalPassesStillWork(void) -{ - TEST_ASSERT_TRUE(1); -} - -void test_NormalFailsStillWork(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_TRUE(0); - VERIFY_FAILS_END -} - -TEST_CASE(0, "abc") -TEST_CASE(1, "{") -TEST_CASE(2, "}") -TEST_CASE(3, ";") -TEST_CASE(4, "\"quoted\"") -void test_StringsArePreserved(unsigned index, const char * str) -{ - static const char * const expected[] = - { - "abc", - "{", - "}", - ";", - "\"quoted\"" - }; - - /* Ensure that no test cases are skipped by tracking the next expected index */ - TEST_ASSERT_EQUAL_UINT32(NextExpectedStringIndex, index); - TEST_ASSERT_LESS_THAN(sizeof(expected) / sizeof(expected[0]), index); - TEST_ASSERT_EQUAL_STRING(expected[index], str); - - NextExpectedStringIndex++; -} - -TEST_CASE(0, 'x') -TEST_CASE(1, '{') -TEST_CASE(2, '}') -TEST_CASE(3, ';') -TEST_CASE(4, '\'') -TEST_CASE(5, '"') -void test_CharsArePreserved(unsigned index, char c) -{ - static const char expected[] = - { - 'x', - '{', - '}', - ';', - '\'', - '"' - }; - - /* Ensure that no test cases are skipped by tracking the next expected index */ - TEST_ASSERT_EQUAL_UINT32(NextExpectedCharIndex, index); - TEST_ASSERT_LESS_THAN(sizeof(expected) / sizeof(expected[0]), index); - TEST_ASSERT_EQUAL(expected[index], c); - - NextExpectedCharIndex++; -} diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_strings.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_strings.c deleted file mode 100644 index 964c5536d..000000000 --- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_strings.c +++ /dev/null @@ -1,329 +0,0 @@ -/* ========================================== - 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] -========================================== */ - -#include "unity.h" -#define TEST_INSTANCES -#include "self_assessment_utils.h" - -static int SetToOneToFailInTearDown; -static int SetToOneMeanWeAlreadyCheckedThisGuy; - -void setUp(void) -{ - SetToOneToFailInTearDown = 0; - SetToOneMeanWeAlreadyCheckedThisGuy = 0; -} - -void tearDown(void) -{ - endPutcharSpy(); /* Stop suppressing test output */ - if (SetToOneToFailInTearDown == 1) - { - /* These will be skipped internally if already failed/ignored */ - TEST_FAIL_MESSAGE("<= Failed in tearDown"); - TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); - } - if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) - { - UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); - UNITY_OUTPUT_CHAR('\n'); - } -} - -void testEqualStrings(void) -{ - const char *testString = "foo"; - - TEST_ASSERT_EQUAL_STRING(testString, testString); - TEST_ASSERT_EQUAL_STRING_MESSAGE("foo", "foo", "foo isn't foo"); - TEST_ASSERT_EQUAL_STRING("foo", testString); - TEST_ASSERT_EQUAL_STRING(testString, "foo"); - TEST_ASSERT_EQUAL_STRING("", ""); -} - -void testEqualStringsLen(void) -{ - const char *testString = "foobar"; - TEST_ASSERT_EQUAL_STRING_LEN(testString, testString, strlen(testString)); - TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE("foobar", "foobaz", 5, "fooba isn't fooba"); - TEST_ASSERT_EQUAL_STRING_LEN("foo", testString, 3); - TEST_ASSERT_EQUAL_STRING_LEN(testString, "foo", 3); - TEST_ASSERT_EQUAL_STRING_LEN("", "", 3); -} - -void testEqualStringsWithCarriageReturnsAndLineFeeds(void) -{ - const char *testString = "foo\r\nbar"; - - TEST_ASSERT_EQUAL_STRING(testString, testString); - TEST_ASSERT_EQUAL_STRING("foo\r\nbar", "foo\r\nbar"); - TEST_ASSERT_EQUAL_STRING("foo\r\nbar", testString); - TEST_ASSERT_EQUAL_STRING(testString, "foo\r\nbar"); - TEST_ASSERT_EQUAL_STRING("", ""); -} - -void testNotEqualString1(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING("foo", "bar"); - VERIFY_FAILS_END -} - -void testNotEqualStringLen1(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_LEN("foobar", "foobaz", 6); - VERIFY_FAILS_END -} - -void testNotEqualString2(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING("foo", ""); - VERIFY_FAILS_END -} - -void testNotEqualStringLen2(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_LEN("foo", "", 3); - VERIFY_FAILS_END -} - -void testNotEqualString3(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING("", "bar"); - VERIFY_FAILS_END -} - -void testNotEqualStringLen3(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_LEN("", "bar", 3); - VERIFY_FAILS_END -} - -void testNotEqualString4(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING("bar\r", "bar\n"); - VERIFY_FAILS_END -} - -void testNotEqualStringLen4(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_LEN("ba\r\x16", "ba\r\n", 4); - VERIFY_FAILS_END -} - -void testNotEqualString5(void) -{ - const char str1[] = { 0x41, 0x42, 0x03, 0x00 }; - const char str2[] = { 0x41, 0x42, 0x04, 0x00 }; - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING(str1, str2); - VERIFY_FAILS_END -} - -void testNotEqualString_ExpectedStringIsNull(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING(NULL, "bar"); - VERIFY_FAILS_END -} - -void testNotEqualStringLen_ExpectedStringIsNull(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_LEN(NULL, "bar", 1); - VERIFY_FAILS_END -} - -void testNotEqualString_ActualStringIsNull(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING("foo", NULL); - VERIFY_FAILS_END -} - -void testNotEqualStringLen_ActualStringIsNull(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_LEN("foo", NULL, 1); - VERIFY_FAILS_END -} - -void testNotEqualString_ExpectedStringIsLonger(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING("foo2", "foo"); - VERIFY_FAILS_END -} - -void testNotEqualString_ActualStringIsLonger(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING("foo", "foo2"); - VERIFY_FAILS_END -} - -void testEqualStringArrays(void) -{ - const char *testStrings[] = { "foo", "boo", "woo", "moo" }; - const char *expStrings[] = { "foo", "boo", "woo", "zoo" }; - - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, expStrings, 3); - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 3); - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 2); - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 1); -} - -void testNotEqualStringArray1(void) -{ - const char *testStrings[] = { "foo", "boo", "woo", "moo" }; - const char *expStrings[] = { "foo", "boo", "woo", "zoo" }; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); - VERIFY_FAILS_END -} - -void testNotEqualStringArray2(void) -{ - const char *testStrings[] = { "zoo", "boo", "woo", "moo" }; - const char *expStrings[] = { "foo", "boo", "woo", "moo" }; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); - VERIFY_FAILS_END -} - -void testNotEqualStringArray3(void) -{ - const char *testStrings[] = { "foo", "boo", "woo", NULL }; - const char *expStrings[] = { "foo", "boo", "woo", "zoo" }; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); - VERIFY_FAILS_END -} - -void testNotEqualStringArray4(void) -{ - const char *testStrings[] = { "foo", "boo", "woo", "moo" }; - const char *expStrings[] = { "foo", NULL, "woo", "moo" }; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); - VERIFY_FAILS_END -} - -void testNotEqualStringArray5(void) -{ - const char **testStrings = NULL; - const char *expStrings[] = { "foo", "boo", "woo", "zoo" }; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); - VERIFY_FAILS_END -} - -void testNotEqualStringArray6(void) -{ - const char *testStrings[] = { "foo", "boo", "woo", "zoo" }; - const char **expStrings = NULL; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); - VERIFY_FAILS_END -} - -void testEqualStringArrayIfBothNulls(void) -{ - const char **testStrings = NULL; - const char **expStrings = NULL; - - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); -} - -void testNotEqualStringArrayLengthZero(void) -{ - const char *testStrings[] = {NULL}; - const char **expStrings = NULL; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 0); - VERIFY_FAILS_END -} - -void testEqualStringEachEqual(void) -{ - const char *testStrings1[] = { "foo", "foo", "foo", "foo" }; - const char *testStrings2[] = { "boo", "boo", "boo", "zoo" }; - const char *testStrings3[] = { "", "", "", "" }; - - TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings1, 4); - TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings1, 1); - TEST_ASSERT_EACH_EQUAL_STRING("boo", testStrings2, 3); - TEST_ASSERT_EACH_EQUAL_STRING("", testStrings3, 4); -} - -void testNotEqualStringEachEqual1(void) -{ - const char *testStrings[] = { "foo", "foo", "foo", "moo" }; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings, 4); - VERIFY_FAILS_END -} - -void testNotEqualStringEachEqual2(void) -{ - const char *testStrings[] = { "boo", "foo", "foo", "foo" }; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings, 4); - VERIFY_FAILS_END -} - -void testNotEqualStringEachEqual3(void) -{ - const char *testStrings[] = { "foo", "foo", "foo", NULL }; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings, 4); - VERIFY_FAILS_END -} - -void testNotEqualStringEachEqual4(void) -{ - const char *testStrings[] = { "foo", "foo", "woo", "foo" }; - - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings, 4); - VERIFY_FAILS_END -} - -void testNotEqualStringEachEqual5(void) -{ - EXPECT_ABORT_BEGIN - TEST_ASSERT_EACH_EQUAL_STRING("foo", NULL, 1); - VERIFY_FAILS_END -} - -void testCstringsEscapeSequence(void) -{ -#ifndef USING_OUTPUT_SPY - TEST_IGNORE(); -#else - startPutcharSpy(); - UnityPrint("\x16\x10"); - endPutcharSpy(); - TEST_ASSERT_EQUAL_STRING("\\x16\\x10", getBufferPutcharSpy()); -#endif -} diff --git a/components/testframework/libs/cmock/vendor/unity/unityConfig.cmake b/components/testframework/libs/cmock/vendor/unity/unityConfig.cmake deleted file mode 100644 index 55410ccc8..000000000 --- a/components/testframework/libs/cmock/vendor/unity/unityConfig.cmake +++ /dev/null @@ -1 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/unityTargets.cmake) \ No newline at end of file diff --git a/components/testframework/libs/testframework/CMakeFunctions.cmake b/components/testframework/libs/testframework/CMakeFunctions.cmake deleted file mode 100644 index fec92c3f8..000000000 --- a/components/testframework/libs/testframework/CMakeFunctions.cmake +++ /dev/null @@ -1,222 +0,0 @@ - -# © 2018 Silicon Laboratories Inc. -## -# @b Syntax -# -#   @c add_unity_test( \b NAME \ [TEST_BASE \\>] FILES \ LIBRARIES \ [USE_CPP]) -# -# Function for adding a unit test CMake target. -# -# -# @b Example @b 1 -# -# -# from @b Components\\FileSystem\\Test\\CMakeLists.txt file -# @code{.py} -# add_unity_test(NAME TestFileSystem FILES ../FileSystem.c TestFileSystem.cpp LIBRARIES Assert USE_CPP) -# @endcode -# -# -# @b Example @b 2 -# -# -# from @b ZWave\\Protocol\\Test\\CMakeLists.txt file -# @code{.py} -# add_unity_test(NAME TestTransmitSingleCastLinkLayer -# FILES ../ZW_DataLinkLayer.c TestTransmitSingleCastLinkLayer.c -# LIBRARIES mock ZW_RadioPhyMock Assert ) -# @endcode -# -# -# @b Parameters -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -#
   \[in\]NAME \Name of test executeable to build
\[in\]TEST_BASE \\>\[Optional\] Unit test file from which the runner should be generated, if TEST_BASE is not -# provided, the \.\ from first parameter will be used.
\[in\]FILES \List of files used for building the test
\[in\]LIBRARIES \List of libraries to link for the test executable (unity is automatically included)
\[in\]USE_CPP\[Optional\] Set this flag if the test executable must be compiled using C++
-# -if (NOT COMMAND ADD_UNITY_TEST) -function(ADD_UNITY_TEST) - set(OPTIONS "USE_CPP" "DISABLED") - set(SINGLE_VALUE_ARGS "NAME" "TEST_BASE") - set(MULTI_VALUE_ARGS "FILES" "LIBRARIES" "INCLUDES") - cmake_parse_arguments(ADD_UNITY_TEST "${OPTIONS}" "${SINGLE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN} ) - - set(RUNNER_EXTENSION c) - if (ADD_UNITY_TEST_USE_CPP) - set(RUNNER_EXTENSION cpp) - endif (ADD_UNITY_TEST_USE_CPP) - - set(RUNNER_BASE "${ADD_UNITY_TEST_NAME}.${RUNNER_EXTENSION}") - if (NOT ${ADD_UNITY_TEST_TEST_BASE} STREQUAL "") - set(RUNNER_BASE "${ADD_UNITY_TEST_TEST_BASE}") - endif (NOT ${ADD_UNITY_TEST_TEST_BASE} STREQUAL "") - - if ("${ADD_UNITY_TEST_NAME}" STREQUAL "") - list(GET ADD_UNITY_TEST_UNPARSED_ARGUMENTS 0 ADD_UNITY_TEST_NAME) - list(REMOVE_AT ADD_UNITY_TEST_UNPARSED_ARGUMENTS 0}) - set(RUNNER_BASE "${ADD_UNITY_TEST_NAME}.${RUNNER_EXTENSION}") - set(ADD_UNITY_TEST_FILES "${ADD_UNITY_TEST_UNPARSED_ARGUMENTS}") - endif ("${ADD_UNITY_TEST_NAME}" STREQUAL "") - - add_executable(${ADD_UNITY_TEST_NAME} ${ADD_UNITY_TEST_NAME}_runner.${RUNNER_EXTENSION} ${RUNNER_BASE} ${ADD_UNITY_TEST_FILES}) - - add_custom_command(OUTPUT ${ADD_UNITY_TEST_NAME}_runner.${RUNNER_EXTENSION} - COMMAND ${PYTHON_EXECUTABLE} ${TEST_TOOLS_DIR}/gen_test_runner.py ${RUNNER_BASE} > ${CMAKE_CURRENT_BINARY_DIR}/${ADD_UNITY_TEST_NAME}_runner.${RUNNER_EXTENSION} - DEPENDS ${RUNNER_BASE} ${TEST_TOOLS_DIR}/gen_test_runner.py - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - add_test(${ADD_UNITY_TEST_NAME} ${ADD_UNITY_TEST_NAME} ) - target_link_libraries( ${ADD_UNITY_TEST_NAME} unity ${ADD_UNITY_TEST_LIBRARIES}) - target_include_directories(${ADD_UNITY_TEST_NAME} PRIVATE . ${ADD_UNITY_TEST_INCLUDES}) - -if(${ADD_UNITY_TEST_DISABLED}) - set_tests_properties(${TEST_NAME} PROPERTIES DISABLED True) -endif() -endfunction(ADD_UNITY_TEST) -endif (NOT COMMAND ADD_UNITY_TEST) - - -## -# @b Syntax -# -#   @c unity_test( \b TEST [\b RUNNER_EXTENSION] [\b SOURCE_NAME]) -# -# This function calls a python script in order to generate the unity runner for the test. -# The name of the test suite is mandatory and the runner will be named: ${TEST}_runner.c -# The function also takes the following optional arguments: -# Optional arg 0: Extension of runner, e.g. .cpp instead of .c -# Optional argument can be used as: unity_test( my_unity_test cpp ) -# Optional arg 1: Name of source without extension which is hardcoded to be ".c". This can be used -# if several targets with different defines, etc. based on the same source file are desired. -# -# \warning This function is deprecated, use @ref add_unity_test instead -# -if (NOT COMMAND unity_test) -function(unity_test TEST ) - message(WARNING "Use of unity_test function is depricated please use add_unity_test(..)") - set(RUNNER_EXTENSION c) - set(SOURCE_NAME ${TEST}) - set(OPTIONAL_ARGS ${ARGN}) - list(LENGTH OPTIONAL_ARGS OPTIONAL_ARGS_LENGTH) - if (OPTIONAL_ARGS_LENGTH GREATER 0) - list (GET OPTIONAL_ARGS 0 RUNNER_EXTENSION) - endif(OPTIONAL_ARGS_LENGTH GREATER 0) - if (OPTIONAL_ARGS_LENGTH GREATER 1) - list (GET OPTIONAL_ARGS 1 SOURCE_NAME) - endif (OPTIONAL_ARGS_LENGTH GREATER 1) - #message( "RUNNER_EXTENSION = ${RUNNER_EXTENSION}") - #message( "SOURCE_NAME = ${SOURCE_NAME}") - - add_custom_command(OUTPUT ${TEST}_runner.${RUNNER_EXTENSION} - COMMAND ${PYTHON_EXECUTABLE} ${TEST_TOOLS_DIR}/gen_test_runner.py ${SOURCE_NAME}.${RUNNER_EXTENSION} > ${CMAKE_CURRENT_BINARY_DIR}/${TEST}_runner.${RUNNER_EXTENSION} - DEPENDS ${SOURCE_NAME}.${RUNNER_EXTENSION} ${TEST_TOOLS_DIR}/gen_test_runner.py - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - add_test(${TEST} ${TEST}) -endfunction(unity_test) -endif (NOT COMMAND unity_test) - -## -# @b Syntax -# -#   @c cross_system_dir(@b IN_SEARCH_PATH, @b IN_MATCH_PATTERN, @b OUT_CROSS_SYSTEM_DIR ) -# -# Function for searching and returning the correct folder during cross compilation -# Folders are returned according to first match: -# -# -# ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}: If two level folder with .variant - with same name exists. -# -# ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}: If .variant does not exist but two level folder with same name exists. -# -# ${CMAKE_SYSTEM_NAME}/[Gg]eneric: If ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR} does not exists but folder ${CMAKE_SYSTEM_NAME}/${IN_MATCH_PATTERN}/[Gg]eneric exists. -# -# ${CMAKE_SYSTEM_NAME}/: If folder with same name exists. -# -# ${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}: If folder with same name exists. -# -# ${CMAKE_SYSTEM_PROCESSOR}: If .variant does not exist, but folder with same name exists. -# -# [Gg]eneric: If ${CMAKE_SYSTEM_PROCESSOR} does not exists but folder '[Gg]eneric' exists. -# -# ${IN_MATCH_PATTERN}: The folder itself is returned -# -# '': If no matches are found -# -# For all tests above, it applies that if ${IN_MATCH_PATTERN} is set then the folder is only -# returned if a file/folder matching the pattern is found. -# e.g. if ${IN_MATCH_PATTERN} is set to 'include' and ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR} -# does not contain an 'include' file/folder then the tests continues to 2) -# If IN_MATCH_PATTERN is empty string, i.e. "", then the first matched folder is returned. -# -# -# @b Example -# -# Example from @b SubTree/TestFramework/unity/CMakeLists.txt file where \ref cross_system_dir is -# used. -# -# In @c unity cross_system_dir is used to determine platform dependent implementation of the file -# @c unity_print to use for compilation. -# -# - On host system (Windows/Linux on x86), the file @c generic/unity_print.c is used. -# - On cross system, @b CMAKE_SYSTEM_PROCESSOR=asip, the file @c asip/unity_print.c is used. -# - On cross system, @b CMAKE_SYSTEM_PROCESSOR=zw700, the file @c zw700/unity_print.c is used. -# - On cross system, @b CMAKE_SYSTEM_PROCESSOR=c51, the file @c c51/unity_print.c is used. -# -# @code -#CROSS_SYSTEM_DIR("." "" CROSS_SYSTEM_DIR) -# -#SET(SOURCES -# unity.c -# ${CROSS_SYSTEM_DIR}/unity_print.c ) -# @endcode -# -# @param[in] IN_SEARCH_PATH Name of path/folder that should be seached -# @param[in] IN_MATCH_PATTERN Name of subfolder/file in search path that should be found, set to "" / or empty variable if no match folder is needed -# @param[out] OUT_CROSS_SYSTEM_DIR Name of path/folder which matched above rule -IF (NOT COMMAND CROSS_SYSTEM_DIR) - FUNCTION(CROSS_SYSTEM_DIR IN_SEARCH_PATH IN_MATCH_PATTERN OUT_CROSS_SYSTEM_DIR) - IF(NOT (IS_ABSOLUTE ${IN_SEARCH_PATH})) - SET(IN_SEARCH_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${IN_SEARCH_PATH}") - ENDIF(NOT (IS_ABSOLUTE ${IN_SEARCH_PATH})) - - IF((CMAKE_SYSTEM_NAME) AND (CMAKE_SYSTEM_PROCESSOR) AND (CMAKE_SYSTEM_PROCESSOR_VARIANT) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}/${IN_MATCH_PATTERN})) # 1. /SYSTEM_NAME/SYSTEM_PROCESSOR.SYSTEM_PROCESSOR_VARIANT/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_NAME) AND (CMAKE_SYSTEM_PROCESSOR) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}/${IN_MATCH_PATTERN})) # 2. /SYSTEM_NAME/SYSTEM_PROCESSOR/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_NAME) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/Generic/${IN_MATCH_PATTERN})) # 3. /SYSTEM_NAME/Generic/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/Generic" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_NAME) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/generic/${IN_MATCH_PATTERN})) # 3. /SYSTEM_NAME/generic/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/generic" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_NAME) AND (NOT (${CMAKE_SYSTEM_NAME} STREQUAL "Generic")) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}/${IN_MATCH_PATTERN})) # 4. /SYSTEM_NAME/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_NAME}" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_PROCESSOR) AND (CMAKE_SYSTEM_PROCESSOR_VARIANT) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}/${IN_MATCH_PATTERN})) # 5. /SYSTEM_PROCESSOR.SYSTEM_PROCESSOR_VARIANT/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_PROCESSOR}.${CMAKE_SYSTEM_PROCESSOR_VARIANT}" PARENT_SCOPE) - ELSEIF((CMAKE_SYSTEM_PROCESSOR) AND (EXISTS ${IN_SEARCH_PATH}/${CMAKE_SYSTEM_PROCESSOR}/${IN_MATCH_PATTERN})) # 6. /SYSTEM_PROCESSOR/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/${CMAKE_SYSTEM_PROCESSOR}" PARENT_SCOPE) - ELSEIF(EXISTS ${IN_SEARCH_PATH}/Generic/${IN_MATCH_PATTERN}) # 7. /Generic/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/Generic" PARENT_SCOPE) - ELSEIF(EXISTS ${IN_SEARCH_PATH}/generic/${IN_MATCH_PATTERN}) # 7. /generic/IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}/generic" PARENT_SCOPE) - ELSEIF(EXISTS ${IN_SEARCH_PATH}/${IN_MATCH_PATTERN}) # 8. /IN_MATCH_PATTERN - SET(${OUT_CROSS_SYSTEM_DIR} "${IN_SEARCH_PATH}" PARENT_SCOPE) - ELSE() - IF("${IN_MATCH_PATTERN}" STREQUAL "") - MESSAGE(WARNING "CROSS_SYSTEM_DIR failed to find cross platform implementation, returning empty string.\n Fix this warning by creating a cross platform folder for ${CMAKE_SYSTEM_NAME}:${CMAKE_SYSTEM_PROCESSOR} in ${IN_SEARCH_PATH}.") - ELSE("${IN_MATCH_PATTERN}" STREQUAL "") - MESSAGE(WARNING "CROSS_SYSTEM_DIR failed to find cross platform implementation, returning empty string.\n Fix this warning by creating a cross platform folder for ${CMAKE_SYSTEM_NAME}:${CMAKE_SYSTEM_PROCESSOR} in ${IN_SEARCH_PATH} containing ${IN_MATCH_PATTERN}") - ENDIF("${IN_MATCH_PATTERN}" STREQUAL "") - SET(${OUT_CROSS_SYSTEM_DIR} "" PARENT_SCOPE) - ENDIF() - ENDFUNCTION(CROSS_SYSTEM_DIR IN_SEARCH_PATH IN_MATCH_PATTERN OUT_CROSS_SYSTEM_DIR) -ENDIF (NOT COMMAND CROSS_SYSTEM_DIR) diff --git a/components/testframework/libs/testframework/CMakeLists.txt b/components/testframework/libs/testframework/CMakeLists.txt deleted file mode 100644 index 9fb2cbee7..000000000 --- a/components/testframework/libs/testframework/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# Prevent multiple "inclusions" of TestFramework -if (NOT TARGET unity) - message(STATUS "TestFramework from ${CMAKE_CURRENT_SOURCE_DIR} included") - add_definitions( -DUNIT_TEST ) - - set(TEST_TOOLS_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE INTERNAL test_tools_dir) - - find_package(PythonInterp) - - include(CMakeFunctions.cmake) - - add_subdirectory(unity) - # Check whether the building of mock framework is disabled. - # Building of the mock framework can be disabled for the c51 or asip simply by adding the following line to the specific project at higher level: - # e.g.: set(DISABLE_MOCK 1) - # Warning, Do not set DISABLE_MOCK in this file. - if (NOT DEFINED DISABLE_MOCK) - add_subdirectory(mock) - endif (NOT DEFINED DISABLE_MOCK) -else() - message(STATUS "TestFramework from ${CMAKE_CURRENT_SOURCE_DIR} NOT included") -endif() diff --git a/components/testframework/libs/testframework/README.debugging b/components/testframework/libs/testframework/README.debugging deleted file mode 100644 index 432069d4a..000000000 --- a/components/testframework/libs/testframework/README.debugging +++ /dev/null @@ -1,11 +0,0 @@ -# Debugging failed asserts - -In order to debug a failed assertion, it can be helpful to run the unit test in a -debugger and set a breakpoint. The table shows where to place the -breakpoint when troubleshooting different assertion error messages. - -|Test Error Message | Where to put breakpoint | -| --- | --- | -|":38:test_name:FAIL: Expected 3 Was 5" (and similar)|UnityTestResultsFailBegin()| -|"Expected mock call(s) never occurred, see list above for details."|mock_call_expected_did_not_occur()| -|"Unexpected mock call occurred: "|mock_call_did_not_find()| \ No newline at end of file diff --git a/components/testframework/libs/testframework/gen_test_runner.py b/components/testframework/libs/testframework/gen_test_runner.py deleted file mode 100644 index 574490dea..000000000 --- a/components/testframework/libs/testframework/gen_test_runner.py +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2018 Silicon Laboratories Inc. - -import sys -import os -import re -from io import open - -n=0 -regexp = '^void (test_[A-Za-z0-9_]+)\(.*\).*' - -filename, file_type = os.path.splitext(sys.argv[1]) - -funcs = [] - -for l in open(sys.argv[1], encoding='utf-8'): - m = re.search(regexp, l) - if(m): - funcs.append( (m.group(1).strip(),n) ) - n=n+1 - -print(''' -/* AUTOGENERATED FILE. DO NOT EDIT. */ -''') - -if(file_type == '.cpp'): - print(''' -extern "C" { -''') - -print(''' - #include "unity.h" - #include "unity_print.h" - #include "unity_internals.h" -#ifndef __codasip__ - #include "string.h" -#endif /* __codasip__ */ -''') - -if(file_type == '.cpp'): - print(''' -} -''') - -print(''' -int verbose; -''') - -for f in funcs: - print("void {}();".format(f[0])) - -print(''' - -// Inspired by how Unity creates the setUp and tearDown functions -// Purpose is a setup and teardown method called before suite is run, -// and after suite is run. -#if defined(UNITY_WEAK_ATTRIBUTE) - void setUpSuite(void); - void tearDownSuite(void); - UNITY_WEAK_ATTRIBUTE void setUpSuite(void) { } - UNITY_WEAK_ATTRIBUTE void tearDownSuite(void) { } -#elif defined(UNITY_WEAK_PRAGMA) -# pragma weak setUpSuite - void setUpSuite(void); -# pragma weak tearDownSuite - void tearDownSuite(void); -#else - void setUpSuite(void); - void tearDownSuite(void); -#endif -''') - -print(''' - -#ifdef __C51__ -#include "reg51.h" - -void setUp() { -#if 1 -SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */ -TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */ -TH1 = 0xf3; /* TH1: reload value for 2400 baud */ -TR1 = 1; /* TR1: timer 1 run */ -TI = 1; /* TI: set TI to send first char of UART */ -#else - int bBaudRate; - WATCHDOG_DISABLE; - bBaudRate = 1152; - bBaudRate = (80000/bBaudRate ) + (((80000 %bBaudRate ) >= (bBaudRate >> 1)) ? 1:0); - UART0_SET_BAUD_RATE(68); - UART0_TX_ENABLE; - - OPEN_IOS - UART0BUF = '*'; -#endif - -} - -void tearDown() { - -} - -extern int main(void) { - int i; - int ret; - - setUpSuite(); - verbose=0; - unity_print_init(); - UNITY_BEGIN(); - -''') -for f in funcs: - print(' UnityDefaultTestRun(&{}, "{}", {});'.format(f[0], f[0], f[1])) -print(''' - ret = UNITY_END(); - unity_print_close(); - tearDownSuite(); - while(1); -} -#else -int main(int argc, char** argp) { - int ret; - setUpSuite(); - unity_print_init(); - UNITY_BEGIN(); - - - if(argc==2) { - verbose=1; -''') -for f in funcs: - print(' if(strcmp(argp[1],"{}") == 0) UnityDefaultTestRun(&{}, "{}", {});'.format(f[0], f[0], f[0], f[1])) -print(''' - } else { - -''') -for f in funcs: - print(' UnityDefaultTestRun(&{}, "{}", {});'.format(f[0], f[0], f[1])) -print(''' - } - - ret = UNITY_END(); - unity_print_close(); - tearDownSuite(); - return ret; -} -#endif - -''') diff --git a/components/testframework/libs/testframework/mock/CMakeLists.txt b/components/testframework/libs/testframework/mock/CMakeLists.txt deleted file mode 100644 index ef17ace8a..000000000 --- a/components/testframework/libs/testframework/mock/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ - -# mock target may be imported be several projects, e.g. 700 series and libs2 simultaneously. -# This test ensures that the target named 'mock' will only be declared if it is not already declared. -if (NOT TARGET mock) - add_library(mock mock_control.c) - target_link_libraries(mock unity) - target_include_directories(mock PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - add_subdirectory(test) -endif (NOT TARGET mock) diff --git a/components/testframework/libs/testframework/mock/mock_control.c b/components/testframework/libs/testframework/mock/mock_control.c deleted file mode 100644 index 24523d88c..000000000 --- a/components/testframework/libs/testframework/mock/mock_control.c +++ /dev/null @@ -1,171 +0,0 @@ -/* © 2014 Silicon Laboratories Inc. - */ - -/* - * mock_control.c - * - * Created on: Aug 14, 2015 - * Author: trasmussen - */ - -#include "mock_control.h" -#include -#include "unity.h" - -#define MOCK_CALL_DB_SIZE 8192 /**< Size of the mock call database. */ -#define FAKE_CALL_DB_SIZE 255 /**< Size of the fake call database. */ -#define STUB_CALL_DB_SIZE 255 /**< Size of the stub call database. */ -#define MAX_MESSAGE_LENGTH 4096 /**< Size of error message length, increase value if long messages are needed. */ - - -const mock_t default_entry = { - .p_func_name = "default", - .expect_arg = {{0}, {0}, {0}, {0}}, - .actual_arg = {{0}, {0}, {0}, {0}}, - .compare_rule_arg = {COMPARE_STRICT, COMPARE_STRICT, COMPARE_STRICT, COMPARE_STRICT}, - .error_code = {0}, - .return_code = {0}, - .executed = false -}; - -static mock_t mock_call_db[MOCK_CALL_DB_SIZE]; -static uint32_t mock_db_idx; - -static stub_t stub_call_db[STUB_CALL_DB_SIZE]; -static uint32_t stub_db_idx; - -static fake_t fake_call_db[FAKE_CALL_DB_SIZE]; -static uint32_t fake_db_idx; - -uint32_t g_mock_index; - -void mock_call_expect_ex(uint32_t line_number, const char * p_func_name, mock_t ** pp_mock) -{ - // Reset the entry before usage. - mock_call_db[mock_db_idx] = default_entry; - - // Assign entry and increment. - *pp_mock = &mock_call_db[mock_db_idx]; - (*pp_mock)->p_func_name = p_func_name; - (*pp_mock)->executed = false; - (*pp_mock)->line_number = line_number; - (*pp_mock)->mock_id = 0; - mock_db_idx++; -} - -void mock_calls_clear(void) -{ - mock_db_idx = 0; - stub_db_idx = 0; - fake_db_idx = 0; -} - -/** - * This is a separate function so we can place a breakpoint on it to diagnose - * "Expected mock call(s) never occurred" errors easily. - */ -static void mock_call_expected_did_not_occur() -{ - TEST_FAIL_MESSAGE("Expected mock call(s) never occurred, set breakpoint on mock_call_expected_did_not_occur() for details."); -} - -void mock_calls_verify(void) -{ - bool failed = false; - uint16_t i; - for (i = 0; i < mock_db_idx; i++) - { - if (false == mock_call_db[i].executed) - { - char error_msg[MAX_MESSAGE_LENGTH]; - sprintf(error_msg, " - Mock not called: %s(...) @ %s:%lu", mock_call_db[i].p_func_name, Unity.CurrentTestName, (long unsigned)mock_call_db[i].line_number); - UnityPrint(error_msg); - UNITY_OUTPUT_CHAR('\n'); - - failed = true; - } - mock_call_db[i] = default_entry; - } - mock_db_idx = 0; - stub_db_idx = 0; - fake_db_idx = 0; - - if (failed) - { - mock_call_expected_did_not_occur(); - } -} - -/** - * This is a separate function so we can place a breakpoint on it to diagnose Unexpected - * mock call errors easily. - */ -static void mock_call_did_not_find(char const * const p_function_name) -{ - char error_msg[MAX_MESSAGE_LENGTH]; - sprintf(error_msg, "Unexpected mock call occurred: %s(...). Set breakpoint on mock_call_did_not_find() for details.", p_function_name); - UNITY_TEST_FAIL(0, error_msg); -} - -bool mock_call_find(char const * const p_function_name, mock_t ** pp_mock) -{ - uint32_t i; - for (i = 0; i < mock_db_idx; i++) - { - if ((false == mock_call_db[i].executed) && - strcmp(mock_call_db[i].p_func_name, p_function_name) == 0) - { - *pp_mock = &mock_call_db[i]; - g_mock_index = i; - (*pp_mock)->executed = true; - return true; - } - } - mock_db_idx = 0; - stub_db_idx = 0; - fake_db_idx = 0; - - mock_call_did_not_find(p_function_name); - return false; -} - -bool mock_call_used_as_stub(char const * const p_file_name, char const * const p_function_name) -{ - uint32_t i; - for (i = 0; i < stub_db_idx; i++) - { - if ((strcmp(stub_call_db[i].p_name, p_function_name) == 0) || - (strcmp(stub_call_db[i].p_name, p_file_name) == 0)) - { - return true; - } - } - return false; -} - -void mock_call_use_as_stub(const char * const p_name) -{ - // Assign entry and increment. - stub_call_db[stub_db_idx++].p_name = p_name; -} - -bool mock_call_used_as_fake(char const * const p_file_name, char const * const p_function_name) -{ - uint32_t i; - for (i = 0; i < fake_db_idx; i++) - { - if ((strcmp(fake_call_db[i].p_name, p_function_name) == 0) || - (strcmp(fake_call_db[i].p_name, p_file_name) == 0)) - { - return true; - } - } - return false; -} - -void mock_call_use_as_fake(char * const p_name) -{ - // Assign entry and increment. - fake_call_db[fake_db_idx++].p_name = p_name; -} - diff --git a/components/testframework/libs/testframework/mock/mock_control.h b/components/testframework/libs/testframework/mock/mock_control.h deleted file mode 100644 index 0a639fde8..000000000 --- a/components/testframework/libs/testframework/mock/mock_control.h +++ /dev/null @@ -1,706 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ -/* - * mock_control.h - * - * Created on: Aug 14, 2015 - * Author: trasmussen - */ - -#ifndef _MOCK_CONTROL_H_ -#define _MOCK_CONTROL_H_ - -#include -#include -#include -#include "unity.h" - -#define TO_STR(TEXT) #TEXT /**< Macro for converting anything to a string, usefull when expecting a function call. */ -#define TO_STR_MACRO(TEXT) TO_STR(TEXT) - -#define ARG0 0 -#define ARG1 1 -#define ARG2 2 -#define ARG3 3 -#define ARG4 4 -#define ARG5 5 -#define ARG6 6 -#define ARG7 7 -#define ARG8 8 - -#define NUMBER_OF_ARGS 9 - -extern uint32_t g_mock_index; -extern struct _Unity Unity; - -typedef enum -{ - COMPARE_STRICT = 0x00, - COMPARE_NULL, - COMPARE_NOT_NULL, - COMPARE_ANY, - COMPARE_DELTA, -}mock_rules_t; -// Other compare rules to be considered: COMPARE_RANGE, ... - -// The type of "value" should have same size as the "void *", -// if they differ in size test will fail on MIPS32 and other BE platforms, -// thus using uintptr_t which is a unsigned int with same size as a pointer. -typedef union -{ - void * pointer; - uintptr_t value; - // Short versions of above types for macro use. - void * p; - uintptr_t v; -}mock_type_t; - -typedef struct -{ - const char * p_func_name; /**< Pointer to the name of the function that this mock object covers. The function name - is specified when setting up an expected call in the mock framework, as: - mock_call_expect(TO_STR(), &p_mock); */ - mock_type_t expect_arg[NUMBER_OF_ARGS]; /**< Array of expected arguments which will be specified in the unit test, and validated - in the mock, when mocked is called by the tested unit. Setup of an expected argument - on the mock is done as (example is first argument, 0, expected to be 0x11): - p_mock->expect_arg[0].value = 0x11; - p_mock->expect_arg[0].pointer = p_some_pointer; */ - mock_type_t delta_arg[NUMBER_OF_ARGS]; /**< Array of delta values when compare rule is set to COMPARE_DELTA. - Following example would pass on any value between 5 and 15: - p_mock->compare_rule[0] = COMPARE_DELTA; - p_mock->expect_arg[0].value = 10; - p_mock->delta_arg[0].value = 5; */ - mock_type_t actual_arg[NUMBER_OF_ARGS]; /**< Array of the actual args. The actual parameters passed in the call to the function - mocked will be stored in actual_arg. This can be used for implementing additional - post processing checks or validation rules not implemented in the mock itself. - It may also be used for obtaining e.g. function pointers to callback functions. */ - mock_type_t output_arg[NUMBER_OF_ARGS]; /**< Array of output arguments. This array holds data to be copied as output valus in - parameters list when the functoin is called. As example, an array could be returned: - p_mock->output[0].value = length_output_array; - p_mock->output[1].pointer = output_array; */ - mock_type_t error_code; /**< Error code. The error code is useful for verifying the behavior of the unit under - test when a function call returns an error. When the error code is set, the mock - will return the error code imidiately, and not validate parametes. (This is - identical to setting compare_rule_rule to COMPARE_ANY) - Note that not all functions returns errors code, so the API should be examined to - see if this type can be used. - p_mock->error_code.value = ERROR_CODE_TO_TEST; */ - mock_type_t return_code; /**< Return value/code to be returned when mock is called. This is the return value of - the function and not to be mistaken with output values provided thought pointer - parameters of the function. To have the function returning the value 10, simply do: - p_mock->return_code.value = 10; */ - mock_rules_t compare_rule_arg[NUMBER_OF_ARGS]; /**< Compare rule to be used for parameter at index n. - Default compare rule is COMPARE_STRICT. So this value needs only to be set if the - parameter should be checked against a different rule, as example, COMPARE_ANY. - For a full list of vsupported compare rules, refer to @ref mock_rules_t. */ - bool executed; /**< Internal boolean used for identifying executed mocks. */ - uint32_t mock_index; /**< Internal index for identifying the index of the mock. */ - uint32_t line_number; /**< Internal line number to identify the line in the unit test where the mock was created. */ - uint32_t mock_id; /**< A mock id value that can be set by the user to identify the mock in the test-case as the one that is failing. */ -}mock_t; -// If compare range is added, then consider to also add: expect_arg_bound_upper, expect_arg_bound_lower. - -typedef struct -{ - const char * p_name; -}stub_t; - -typedef struct -{ - char * p_name; -}fake_t; - -#define MOCK_CALL_COMPARE_INPUT_UINT8(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, UINT8) - -#define MOCK_CALL_COMPARE_INPUT_UINT16(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, UINT16) - -#define MOCK_CALL_COMPARE_INPUT_UINT32(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, UINT32) - -#define MOCK_CALL_COMPARE_INPUT_INT8(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, INT8) - -#define MOCK_CALL_COMPARE_INPUT_INT32(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, INT32) - -#define MOCK_CALL_COMPARE_INPUT_HEX64(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, HEX64) - -#define MOCK_CALL_COMPARE_INPUT_HEX32(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, HEX32) - -#define MOCK_CALL_COMPARE_INPUT_HEX16(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, HEX16) - -#define MOCK_CALL_COMPARE_INPUT_HEX8(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, HEX8) - -#define MOCK_CALL_COMPARE_INPUT_HEX_ARRAY(P_MOCK, ARGUMENT, RECV_VALUE) \ - MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, HEX_ARRAY) - - -#define MOCK_CALL_COMPARE_INPUT(P_MOCK, ARGUMENT, RECV_VALUE, TYPE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as argument " #ARGUMENT " in %s(...), mock call expect@%s:%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_##TYPE##_MESSAGE(P_MOCK->expect_arg[ARGUMENT].v, RECV_VALUE, __str); \ - break; \ - case COMPARE_DELTA: \ - sprintf(__str, " as argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_##TYPE##_WITHIN_MESSAGE(P_MOCK->delta_arg[ARGUMENT].value, P_MOCK->expect_arg[ARGUMENT].value, RECV_VALUE, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - case COMPARE_NULL: \ - TEST_FAIL_MESSAGE("Comparing as pointer on something not a pointer in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - - -#define MOCK_CALL_COMPARE_INPUT_BOOL(P_MOCK, ARGUMENT, RECV_VALUE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_MESSAGE((P_MOCK->expect_arg[ARGUMENT].v == RECV_VALUE), __str); \ - break; \ - case COMPARE_DELTA: \ - TEST_FAIL_MESSAGE("Comparing as bool in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_NOT_NULL: \ - case COMPARE_NULL: \ - TEST_FAIL_MESSAGE("Comparing as pointer on something not a pointer in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT8(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_MEMBER(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER, UINT8) - -#define MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT16(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_MEMBER(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER, UINT16) - -#define MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT32(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_MEMBER(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER, UINT32) - -#define MOCK_CALL_COMPARE_STRUCT_MEMBER(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, MEMBER, TYPE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as '" TO_STR(MEMBER) "' in argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_##TYPE##_MESSAGE(((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->MEMBER, \ - ((STRUCT_TYPE *)RECV_POINTER)->MEMBER, __str); \ - break; \ - case COMPARE_DELTA: \ - sprintf(__str, " as '" TO_STR(MEMBER) "' in argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_##TYPE##_WITHIN_MESSAGE(P_MOCK->delta_arg[ARGUMENT].value, \ - ((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->MEMBER, \ - ((STRUCT_TYPE *)RECV_POINTER)->MEMBER, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - sprintf(__str, " Expected Non-NULL in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NOT_NULL_MESSAGE(RECV_POINTER, __str); \ - break; \ - case COMPARE_NULL: \ - sprintf(__str, " Expected NULL for argument %u in %s(...), mock call expect@%s::%lu. mock_id:%lu", ARGUMENT, __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NULL_MESSAGE(RECV_POINTER, __str); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_UINT8(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER, UINT8) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_UINT16(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER, UINT16) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_UINT32(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER, UINT32) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH_MEMBER, TYPE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as '" TO_STR(LENGTH_MEMBER) "' in argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_UINT32_MESSAGE(((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->LENGTH_MEMBER, \ - ((STRUCT_TYPE *)RECV_POINTER)->LENGTH_MEMBER, __str); \ - sprintf(__str, " as '" TO_STR(ARRAY_MEMBER) "' in argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_##TYPE##_ARRAY_MESSAGE(((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->ARRAY_MEMBER, \ - ((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER, \ - ((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->LENGTH_MEMBER, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - sprintf(__str, " Expected Non-NULL in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NOT_NULL_MESSAGE(((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER, __str); \ - break; \ - case COMPARE_NULL: \ - sprintf(__str, " Expected NULL for argument %u in %s(...), mock call expect@%s::%lu. mock_id:%lu", ARGUMENT, __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NULL_MESSAGE(((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER, __str); \ - break; \ - case COMPARE_DELTA: \ - TEST_FAIL_MESSAGE("Comparing delta on array is not possible in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH_UINT8(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH, UINT8) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH_UINT16(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH, UINT16) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH_UINT32(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH) \ - MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH, UINT32) - -#define MOCK_CALL_COMPARE_STRUCT_ARRAY_LENGTH(P_MOCK, ARGUMENT, RECV_POINTER, STRUCT_TYPE, ARRAY_MEMBER, LENGTH, TYPE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as '" TO_STR(ARRAY_MEMBER) "' in argument " #ARGUMENT " in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_##TYPE##_ARRAY_MESSAGE(((STRUCT_TYPE *)P_MOCK->expect_arg[ARGUMENT].p)->ARRAY_MEMBER, \ - ((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER, LENGTH, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - TEST_ASSERT_NOT_NULL(((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER); \ - break; \ - case COMPARE_NULL: \ - TEST_ASSERT_NULL(((STRUCT_TYPE *)RECV_POINTER)->ARRAY_MEMBER); \ - break; \ - case COMPARE_DELTA: \ - TEST_FAIL_MESSAGE("Comparing delta on array is not possible in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_COMPARE_INPUT_UINT8_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH) \ - MOCK_CALL_COMPARE_INPUT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH, UINT8) - -#define MOCK_CALL_COMPARE_INPUT_UINT16_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH) \ - MOCK_CALL_COMPARE_INPUT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH, UINT16) - -#define MOCK_CALL_COMPARE_INPUT_UINT32_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH) \ - MOCK_CALL_COMPARE_INPUT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH, UINT32) - -#define MOCK_CALL_COMPARE_INPUT_INT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH) \ - MOCK_CALL_COMPARE_INPUT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH, INT) - -#define MOCK_CALL_COMPARE_INPUT_ARRAY(P_MOCK, ARGUMENT, EXPECT_LENGTH, P_RECV_ARRAY, RECV_LENGTH, TYPE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as length for array in argument " #ARGUMENT " in %s(...), mock call expect@%s:%lu. mock_id:%lu, ", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_UINT32_MESSAGE(EXPECT_LENGTH, RECV_LENGTH, __str); \ - sprintf(__str, " as argument " #ARGUMENT " in %s(...), mock call expect@%s:%lu, mock_id:%lu.", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_EQUAL_##TYPE##_ARRAY_MESSAGE(P_MOCK->expect_arg[ARGUMENT].p, P_RECV_ARRAY, EXPECT_LENGTH, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - sprintf(__str, " Expected Non-NULL in %s(...), mock call expect@%s::%lu. mock_id:%lu", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NOT_NULL_MESSAGE(P_RECV_ARRAY, __str); \ - break; \ - case COMPARE_NULL: \ - sprintf(__str, " Expected NULL for argument %u in %s(...), mock call expect@%s::%lu. mock_id:%lu", ARGUMENT, __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NULL_MESSAGE(P_RECV_ARRAY, __str); \ - break; \ - case COMPARE_DELTA: \ - TEST_FAIL_MESSAGE("Comparing delta on array is not possible in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - case COMPARE_ANY: \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_SET_OUTPUT_ARRAY(P_RESULT_ARRAY, P_OUT_ARRAY, LENGTH, TYPE) do { \ - uint32_t __loop_i; \ - TYPE * __result_array = (TYPE *)P_RESULT_ARRAY; \ - for (__loop_i = 0; __loop_i < LENGTH; __loop_i++) \ - { \ - P_OUT_ARRAY[__loop_i] = __result_array[__loop_i]; \ - } \ - }while(0) - -#define MOCK_CALL_COMPARE_INPUT_POINTER(P_MOCK, ARGUMENT, P_RECV_VALUE) do { \ - char __str[4096]; \ - switch (P_MOCK->compare_rule_arg[ARGUMENT]) \ - { \ - case COMPARE_STRICT: \ - sprintf(__str, " as argument " #ARGUMENT " in %s(...), mock index=%lu, " __FILE__ ":" TO_STR_MACRO(__LINE__), __FUNCTION__, (long unsigned)g_mock_index); \ - TEST_ASSERT_EQUAL_PTR_MESSAGE(P_MOCK->expect_arg[ARGUMENT].p, P_RECV_VALUE, __str); \ - break; \ - case COMPARE_NOT_NULL: \ - sprintf(__str, " Expected Non-NULL as argument " #ARGUMENT " in %s(...), mock call expect@%s:%lu, mock_id:%lu, ", __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NOT_NULL_MESSAGE(P_RECV_VALUE, __str); \ - break; \ - case COMPARE_NULL: \ - sprintf(__str, " Expected NULL for argument %u in %s(...), mock call expect@%s::%lu. mock_id:%lu", ARGUMENT, __FUNCTION__, Unity.CurrentTestName, (long unsigned)P_MOCK->line_number, (long unsigned)P_MOCK->mock_id); \ - TEST_ASSERT_NULL_MESSAGE(P_RECV_VALUE, __str); \ - break; \ - case COMPARE_ANY: \ - break; \ - case COMPARE_DELTA: \ - TEST_FAIL_MESSAGE("Comparing delta on pointer in " TO_STR_MACRO(__FILE__) ":" TO_STR_MACRO(__LINE__) ); \ - break; \ - } \ - }while(0) - -#define MOCK_CALL_FIND_RETURN_ON_FAILURE(P_MOCK, DEFAULT_VAL) do { \ - if (!mock_call_find(__FUNCTION__, &P_MOCK)) \ - { \ - return DEFAULT_VAL; \ - } \ -}while(0) - -#define MOCK_CALL_FIND_RETURN_VOID_ON_FAILURE(P_MOCK) do { \ - if (!mock_call_find(__FUNCTION__, &P_MOCK)) \ - { \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_IF_USED_AS_STUB(DEFAULT_VAL) do { \ - if (mock_call_used_as_stub( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return DEFAULT_VAL; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_IF_USED_AS_STUB() do { \ - if (mock_call_used_as_stub( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG1(P_FUNCTION, ARG0) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG2(P_FUNCTION, ARG0, ARG1) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG3(P_FUNCTION, ARG0, ARG1, ARG2) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG4(P_FUNCTION, ARG0, ARG1, ARG2, ARG3) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG5(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG6(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG7(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG8(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_FAKE_ARG9(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - return P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8); \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG1(P_FUNCTION, ARG0) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG2(P_FUNCTION, ARG0, ARG1) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG3(P_FUNCTION, ARG0, ARG1, ARG2) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG4(P_FUNCTION, ARG0, ARG1, ARG2, ARG3) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG5(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG6(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG7(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG8(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VOID_FAKE_ARG9(P_FUNCTION, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) do { \ - if (mock_call_used_as_fake( MOCK_FILE, __FUNCTION__) == true) \ - { \ - P_FUNCTION(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8); \ - return; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_IF_ERROR_SET(P_MOCK, TYPE) do { \ - if (P_MOCK->error_code.value != 0 ) \ - { \ - return (TYPE)P_MOCK->error_code.value; \ - } \ -}while(0) - -#define MOCK_CALL_RETURN_VALUE(P_MOCK, TYPE) do { \ - return (TYPE)P_MOCK->return_code.value; \ -}while(0) - -#define MOCK_CALL_RETURN_POINTER(P_MOCK, TYPE) do { \ - return (TYPE)P_MOCK->return_code.pointer; \ -}while(0) - - -#if __C51__ -#define MOCK_CALL_ACTUAL_ARG1(P_MOCK, ARG0) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG2(P_MOCK, ARG0, ARG1) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG3(P_MOCK, ARG0, ARG1, ARG2) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \ - P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG4(P_MOCK, ARG0, ARG1, ARG2, ARG3) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \ - P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \ - P_MOCK->actual_arg[3].value = (uint32_t) ARG3; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG5(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \ - P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \ - P_MOCK->actual_arg[3].value = (uint32_t) ARG3; \ - P_MOCK->actual_arg[4].value = (uint32_t) ARG4; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG6(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5) do { \ - P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \ - P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \ - P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \ - P_MOCK->actual_arg[3].value = (uint32_t) ARG3; \ - P_MOCK->actual_arg[4].value = (uint32_t) ARG4; \ - P_MOCK->actual_arg[5].value = (uint32_t) ARG5; \ - }while(0) -#else -#define MOCK_CALL_ACTUAL_ARG1(P_MOCK, ARG0) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG2(P_MOCK, ARG0, ARG1) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG3(P_MOCK, ARG0, ARG1, ARG2) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG4(P_MOCK, ARG0, ARG1, ARG2, ARG3) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG5(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - P_MOCK->actual_arg[4].pointer = (void *)(uintptr_t) ARG4; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG6(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - P_MOCK->actual_arg[4].pointer = (void *)(uintptr_t) ARG4; \ - P_MOCK->actual_arg[5].pointer = (void *)(uintptr_t) ARG5; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG7(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - P_MOCK->actual_arg[4].pointer = (void *)(uintptr_t) ARG4; \ - P_MOCK->actual_arg[5].pointer = (void *)(uintptr_t) ARG5; \ - P_MOCK->actual_arg[6].pointer = (void *)(uintptr_t) ARG6; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG8(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - P_MOCK->actual_arg[4].pointer = (void *)(uintptr_t) ARG4; \ - P_MOCK->actual_arg[5].pointer = (void *)(uintptr_t) ARG5; \ - P_MOCK->actual_arg[6].pointer = (void *)(uintptr_t) ARG6; \ - P_MOCK->actual_arg[7].pointer = (void *)(uintptr_t) ARG7; \ - }while(0) - -#define MOCK_CALL_ACTUAL_ARG9(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) do { \ - P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \ - P_MOCK->actual_arg[1].pointer = (void *)(uintptr_t) ARG1; \ - P_MOCK->actual_arg[2].pointer = (void *)(uintptr_t) ARG2; \ - P_MOCK->actual_arg[3].pointer = (void *)(uintptr_t) ARG3; \ - P_MOCK->actual_arg[4].pointer = (void *)(uintptr_t) ARG4; \ - P_MOCK->actual_arg[5].pointer = (void *)(uintptr_t) ARG5; \ - P_MOCK->actual_arg[6].pointer = (void *)(uintptr_t) ARG6; \ - P_MOCK->actual_arg[7].pointer = (void *)(uintptr_t) ARG7; \ - P_MOCK->actual_arg[8].pointer = (void *)(uintptr_t) ARG8; \ - }while(0) -#endif - -#define N_ARGS_COUNT(_1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) N -#define N_ARGS(...) N_ARGS_COUNT(__VA_ARGS__, 9, 8, 7, 6, 5, 4, 3, 2, 1) - -#define MOCK_CALL_RETURN_VOID_FAKE_HELPER_IMPL(P_FUNCTION, COUNT, ...) MOCK_CALL_RETURN_VOID_FAKE_ARG ## COUNT (P_FUNCTION, __VA_ARGS__) -#define MOCK_CALL_RETURN_VOID_FAKE_HELPER(P_FUNCTION, COUNT, ...) MOCK_CALL_RETURN_VOID_FAKE_HELPER_IMPL(P_FUNCTION, COUNT, __VA_ARGS__) -#define MOCK_CALL_RETURN_VOID_IF_USED_AS_FAKE(P_FUNCTION, ...) MOCK_CALL_RETURN_VOID_FAKE_HELPER(P_FUNCTION, N_ARGS(__VA_ARGS__), __VA_ARGS__) - -#define MOCK_CALL_RETURN_FAKE_HELPER_IMPL(P_FUNCTION, COUNT, ...) MOCK_CALL_RETURN_FAKE_ARG ## COUNT (P_FUNCTION, __VA_ARGS__) -#define MOCK_CALL_RETURN_FAKE_HELPER(P_FUNCTION, COUNT, ...) MOCK_CALL_RETURN_FAKE_HELPER_IMPL(P_FUNCTION, COUNT, __VA_ARGS__) -#define MOCK_CALL_RETURN_IF_USED_AS_FAKE(P_FUNCTION, ...) MOCK_CALL_RETURN_FAKE_HELPER(P_FUNCTION, N_ARGS(__VA_ARGS__), __VA_ARGS__) - -#define MOCK_CALL_ACTUAL_IMPL(P_MOCK, COUNT, ...) MOCK_CALL_ACTUAL_ARG ## COUNT (P_MOCK, __VA_ARGS__) -#define MOCK_CALL_ACTUAL_HELPER(P_MOCK, COUNT, ...) MOCK_CALL_ACTUAL_IMPL(P_MOCK, COUNT, __VA_ARGS__) -#define MOCK_CALL_ACTUAL(P_MOCK, ...) MOCK_CALL_ACTUAL_HELPER(P_MOCK, N_ARGS(__VA_ARGS__), __VA_ARGS__) - -void mock_call_expect_ex(uint32_t line_number, const char * p_func_name, mock_t ** pp_mock); -#define mock_call_expect(fn, mock) mock_call_expect_ex(__LINE__, fn, mock) - -/**@brief Function for clearing all expectation in the mock framework. - * - * @details A prematurely unit abort might result in the mock database not being cleaned up. - * This can potentially interfere with following test cases. - * To ensure that the mock db is properly initialized for a test case, then it is advise - * to clear the db at the start of a test case, by calling @ref mock_calls_clear. - */ -void mock_calls_clear(void); - -/**@brief Function for verifying that all expected calls to mocks has occured. - * - * @details During a unit test several mock calls may be expected. During test execution the mock - * framework monitors the calls to each expected call. The mock framework can evaluate - * upon each mock call whether the call is expected. - * At the end of a unit test @ref mock_calls_verify must be executed to ensure that all - * expectation regarding mock calls are met. As example, function_A was expected to be - * called from the unit under test, but due to error in implementation, this never happened. - * This is validated when @ref mock_calls_verify is executed. - */ -void mock_calls_verify(void); - -bool mock_call_find(char const * const p_func_name, mock_t ** pp_mock); - -bool mock_call_used_as_stub(char const * const p_file_name, char const * const p_function_name); - -void mock_call_use_as_stub(const char * const p_name); - -bool mock_call_used_as_fake(char const * const p_file_name, char const * const p_function_name); - -void mock_call_use_as_fake(char * const p_name); - -#endif // _MOCK_CONTROL_H_ - diff --git a/components/testframework/libs/testframework/mock/test/CMakeLists.txt b/components/testframework/libs/testframework/mock/test/CMakeLists.txt deleted file mode 100644 index afdf03e10..000000000 --- a/components/testframework/libs/testframework/mock/test/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_definitions( -DUNIT_TEST ) - -add_unity_test(NAME test_mock_framework FILES test_mock_framework.c example_test_mock.c LIBRARIES mock) diff --git a/components/testframework/libs/testframework/mock/test/example_test_mock.c b/components/testframework/libs/testframework/mock/test/example_test_mock.c deleted file mode 100644 index 21ea54d7d..000000000 --- a/components/testframework/libs/testframework/mock/test/example_test_mock.c +++ /dev/null @@ -1,135 +0,0 @@ -/* © 2014 Silicon Laboratories Inc. - */ - -/* - * ZW_timer_mock.c - * - * Created on: Aug 14, 2015 - * Author: trasmussen - */ - -#include "example_test_mock.h" -#include -#include -#include "mock_control.h" -#include "unity.h" - -#define MOCK_FILE "example_test_mock.c" - -uint32_t mock_function_simple_input(uint8_t arg0, uint16_t arg1, uint32_t arg2) -{ - mock_t * p_mock; - - MOCK_CALL_RETURN_IF_USED_AS_STUB(0x00); - MOCK_CALL_FIND_RETURN_ON_FAILURE(p_mock, 0xFF); - MOCK_CALL_ACTUAL(p_mock, arg0, arg1, arg2); - MOCK_CALL_RETURN_IF_ERROR_SET(p_mock, uint32_t); - MOCK_CALL_COMPARE_INPUT_UINT8(p_mock, ARG0, arg0); - MOCK_CALL_COMPARE_INPUT_UINT16(p_mock, ARG1, arg1); - MOCK_CALL_COMPARE_INPUT_UINT32(p_mock, ARG2, arg2); - MOCK_CALL_RETURN_VALUE(p_mock, uint32_t); -} - -uint32_t mock_function_pointer_input(void * void_pointer , uint32_t * num_pointer, mock_callback_function_t func_pointer) -{ - mock_t * p_mock; - - MOCK_CALL_RETURN_IF_USED_AS_STUB(0x00); - MOCK_CALL_FIND_RETURN_ON_FAILURE(p_mock, 0xFF); - MOCK_CALL_ACTUAL(p_mock, void_pointer, num_pointer, func_pointer); - MOCK_CALL_RETURN_IF_ERROR_SET(p_mock, uint32_t); - MOCK_CALL_COMPARE_INPUT_POINTER(p_mock, ARG0, void_pointer); - MOCK_CALL_COMPARE_INPUT_POINTER(p_mock, ARG1, num_pointer); - MOCK_CALL_COMPARE_INPUT_POINTER(p_mock, ARG2, func_pointer); - MOCK_CALL_RETURN_VALUE(p_mock, uint32_t); -} - -/** - * @brief This function provides a fake implementation example when using the mock function - * \ref mock_function_array as fake. - * - * @param[in] p_in_array Pointer to an array. - * @param[in] in_length Length of array. - * @param[out] p_out_array Pointer to an array. - * @param[in,out] p_in_out_length Pointer where size of incoming array is specified, used for actual length when outgoing. - * - * @return Return value represented by uint32_t. - - */ -static uint32_t mock_function_array_fake(uint8_t * p_in_array, uint32_t in_length, - uint8_t * p_out_array, uint32_t *p_in_out_length) -{ - memcpy(p_out_array, p_in_array, in_length); - return 0; -} - -/**@brief This function provides a function for mock calls that takes arrays with length information as input/output. - * - * @param[in] p_in_array Pointer to an array. - * @param[in] in_length Length of array. - * @param[out] p_out_array Pointer to an array. - * @param[in,out] p_in_out_length Pointer where size of incoming array is specified, used for actual length when outgoing. - * - * @return Return value represented by uint32_t. - */ -uint32_t mock_function_array(uint8_t * p_in_array, uint32_t in_length, - uint8_t * p_out_array, uint32_t *p_in_out_length) -{ - mock_t * p_mock; - - MOCK_CALL_RETURN_IF_USED_AS_STUB(0x00); - MOCK_CALL_RETURN_IF_USED_AS_FAKE(mock_function_array_fake, p_in_array, in_length, p_out_array, p_in_out_length); - MOCK_CALL_FIND_RETURN_ON_FAILURE(p_mock, 0xFF); - MOCK_CALL_ACTUAL(p_mock, p_in_array, in_length, p_out_array, p_in_out_length); - MOCK_CALL_RETURN_IF_ERROR_SET(p_mock, uint32_t); - - // Validating array input according to expectation setup in unit test. - MOCK_CALL_COMPARE_INPUT_UINT8_ARRAY(p_mock, ARG0, p_mock->expect_arg[1].v, p_in_array, in_length); - MOCK_CALL_COMPARE_INPUT_UINT8(p_mock, ARG3, *p_in_out_length); - - // Setting data output according to rules setup in unit test. - MOCK_CALL_SET_OUTPUT_ARRAY(p_mock->output_arg[2].p, p_out_array, p_mock->output_arg[3].v, uint8_t); - *p_in_out_length = p_mock->output_arg[3].v; - - MOCK_CALL_RETURN_VALUE(p_mock, uint32_t); -} - -/** - * Fake implementation example when using the mock function \ref mock_function_struct as fake. - */ -static void mock_function_struct_fake(test_mock_struct_t * p_test_struct) -{ - p_test_struct->member_byte = p_test_struct->member_byte + 1; - p_test_struct->member = p_test_struct->member + 2; - p_test_struct->union_member.submember_b = p_test_struct->union_member.submember_b + 3; -} - -void mock_function_struct(test_mock_struct_t * p_test_struct) -{ - mock_t * p_mock; - - MOCK_CALL_RETURN_VOID_IF_USED_AS_STUB(); - MOCK_CALL_RETURN_VOID_IF_USED_AS_FAKE(mock_function_struct_fake, p_test_struct); - MOCK_CALL_FIND_RETURN_VOID_ON_FAILURE(p_mock); - MOCK_CALL_ACTUAL(p_mock, p_test_struct); - - // This type of compare is comparing raw memory. - // It is usefull if it can be ensure that ALL mem is filled out as expected. - // If only certain fields are to be examined, used the example below. - //MOCK_CALL_COMPARE_INPUT_POINTER(p_mock, ARG0, p_test_struct); - - // This validation checks only fields required in the struct - recommended. - MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT8(p_mock, ARG0, p_test_struct, test_mock_struct_t, member_byte); - MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT32(p_mock, ARG0, p_test_struct, test_mock_struct_t, member); - MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT32(p_mock, ARG0, p_test_struct, test_mock_struct_t, union_member.submember_a); - MOCK_CALL_COMPARE_STRUCT_MEMBER_UINT32(p_mock, ARG0, p_test_struct, test_mock_struct_t, union_member.submember_b); -} - - -void mock_function_void(void) -{ - mock_t * p_mock; - - MOCK_CALL_RETURN_VOID_IF_USED_AS_STUB(); - MOCK_CALL_FIND_RETURN_VOID_ON_FAILURE(p_mock); -} diff --git a/components/testframework/libs/testframework/mock/test/example_test_mock.h b/components/testframework/libs/testframework/mock/test/example_test_mock.h deleted file mode 100644 index 2ca5653d2..000000000 --- a/components/testframework/libs/testframework/mock/test/example_test_mock.h +++ /dev/null @@ -1,100 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. */ -/* - * example_test_mock.h - * - * Created on: Aug 21, 2015 - * Author: trasmussen - */ -#ifndef _EXAMPLE_TEST_MOCK_H_ -#define _EXAMPLE_TEST_MOCK_H_ - -#include -#include - -#if __C51__ - typedef uint16_t WORD; - typedef uint8_t BYTE; - #define CODE code - #define VOID_CALLBACKFUNC(completedFunc) void (CODE *completedFunc) - #define STRIP_GENERIC_PTR(p) ((unsigned) (void *) (p)) - #define IS_NULL(x) (STRIP_GENERIC_PTR(x) == 0) - #define NON_NULL(x) (STRIP_GENERIC_PTR(x) != 0) -#elif __GNUC__ - typedef uint16_t WORD; - typedef uint8_t BYTE; - #define CODE - #define VOID_CALLBACKFUNC(completedFunc) void (*completedFunc) - #define IS_NULL(x) (x == 0) - #define NON_NULL(x) (x != 0) -#else - #error Unknown compiler -#endif - -/**@brief Mock file for testing the mock framework. - * - * In order to verify that the mock framework itself is testing correctly, this mock file has - * been created. This file can also be used as a generic template for creation of new mocks. - * - * Feel free to add more mock templates and extend the test cases in order to make it easier for your - * co-workers to create new mocks. - */ - -/**@brief Example of a callback function which can be used for further testing. - */ -typedef void (*mock_callback_function_t)(uint32_t test_number); - -typedef struct -{ - uint8_t member_byte; - uint32_t member; - union - { - uint8_t submember_a; - uint32_t submember_b; - }union_member; -}test_mock_struct_t; - -/**@brief This function provides a simple function for mock calls that takes normal types. - * - * @param[in] arg0 First argument represented by uint8_t. - * @param[in] arg1 Second argument represented by uint16_t. - * @param[in] arg2 Third argument represented by uint32_t. - * - * @return Return value represented by uint32_t. - */ -uint32_t mock_function_simple_input(uint8_t arg0, uint16_t arg1, uint32_t arg2); - -/**@brief This function provides a simple function for mock calls that takes pointers as input. - * - * @param[in] void_pointer First argument represented by a void pointer. - * @param[in] num_pointer Second argument represented by a pointer to uint32_t data. - * @param[in] func_pointer Third argument represented by a function pointer to a mock_callback_function_t callback function. - * - * @return Return value represented by uint32_t. - */ -uint32_t mock_function_pointer_input(void * void_pointer , uint32_t * num_pointer, mock_callback_function_t func_pointer); - -/**@brief This function provides a function for mock calls that takes arrays with length information as input/output. - * - * @param[in] in_array Pointer to an array. - * @param[in] in_length Length of array. - * @param[out] out_array Pointer to an array. - * @param[in,out] in_out_length Pointer where size of incoming array is specified, used for actual length when outgoing. - * - * @return Return value represented by uint32_t. - */ -uint32_t mock_function_array(uint8_t * in_array, uint32_t in_length, - uint8_t * out_array, uint32_t *in_out_length); - -/**@brief This function provides a function for void mock calls. - */ -void mock_function_void(void); - -/**@brief This function provides a function for mock calls that takes a pointer to a struct as input. - * - * @param[in] p_test_struct Pointer to the test struct. - */ -void mock_function_struct(test_mock_struct_t * p_test_struct); - - -#endif /* _EXAMPLE_TEST_MOCK_H_ */ diff --git a/components/testframework/libs/testframework/mock/test/test_mock_framework.c b/components/testframework/libs/testframework/mock/test/test_mock_framework.c deleted file mode 100644 index 5cdca5bbc..000000000 --- a/components/testframework/libs/testframework/mock/test/test_mock_framework.c +++ /dev/null @@ -1,359 +0,0 @@ -/* © 2014 Silicon Laboratories Inc. - */ - -/* - * test_kex.c - * - * Created on: Aug 12, 2015 - * Author: trasmussen - */ - -/** Extensions to mock framework: - * - Setting of output values: - * - Structs, due to nature of structs, this must be handled by the mock itself. - * - void functions (in mock), when used as stub and default value in error, done, needs testing. - */ - -#include -#include -#include -#include "unity.h" -#include "example_test_mock.h" - -static bool m_callback_executed = false; -static uint32_t m_callback_test_number; - -void callback_func_used_for_mock_verification(uint32_t test_number) -{ - m_callback_executed = true; - m_callback_test_number = test_number; -} - -/* Test that ensures the mock framework and db are correctly configured :-) - * This test verifies normal mock operations with following compare rules: - * Compare Strict : The value received in the mock must match exactly the value expected (default setting) - * Compare Any : Any value will be expepted in the mock - * Compare Delta : The value +/- the delta will be expepted in the mock - * Expected outcome: Test pass - */ -void test_mock_framework_compare_rules_simple() { - mock_t * p_mock; - - // Expected values. - const uint8_t expected_return_value = 0; - - // Clearing the mock db. - mock_calls_clear(); - - // Compare strict (default setting) - mock_call_expect(TO_STR(mock_function_simple_input), &p_mock); - p_mock->expect_arg[0].value = 0x12; // Default rule: Compare strict. - p_mock->expect_arg[1].value = 0x1234; // Default rule: Compare strict. - p_mock->expect_arg[2].value = 0x12345678; // Default rule: Compare strict. - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(mock_function_simple_input), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_DELTA; - p_mock->compare_rule_arg[1] = COMPARE_STRICT; - p_mock->compare_rule_arg[2] = COMPARE_ANY; - p_mock->expect_arg[0].value = 10; - p_mock->delta_arg[0].value = 2; - p_mock->expect_arg[1].value = 0x12; - p_mock->return_code.value = 0; - - mock_call_expect(TO_STR(mock_function_simple_input), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_DELTA; - p_mock->compare_rule_arg[1] = COMPARE_DELTA; - p_mock->compare_rule_arg[2] = COMPARE_DELTA; - p_mock->expect_arg[0].value = 0x50; - p_mock->delta_arg[0].value = 0x10; - p_mock->expect_arg[1].value = 0x5050; - p_mock->delta_arg[1].value = 0x500; - p_mock->expect_arg[2].value = 0x12121212; - p_mock->delta_arg[2].value = 0x100000; - p_mock->return_code.value = 0; - - // When starting the timer we expect to receive the first handle. - uint8_t retval = mock_function_simple_input(0x12, 0x1234, 0x12345678); - TEST_ASSERT_EQUAL_INT(expected_return_value, retval); - - retval = mock_function_simple_input(12, 0x12, 15); - TEST_ASSERT_EQUAL_INT(expected_return_value, retval); - - retval = mock_function_simple_input(0x40, 0x5500, 0x12021212); - TEST_ASSERT_EQUAL_INT(expected_return_value, retval); - - mock_calls_verify(); -} - -/* Test that ensures the mock framework and db are correctly configured :-) - * This test ensures that is the mock function is configured to return an error for error handling - * verification, then arguments are not verified. - * - * Expected outcome: Test pass - */ -void test_mock_framework_error_return() { - mock_t * p_mock; - - // Expected values. - const uint8_t expected_return_value = 0xFF; - - // Clearing the mock db. - mock_calls_clear(); - - // Expected mock calls and corresponding setup. - // 1) TimerStart, which returns an error. - mock_call_expect(TO_STR(mock_function_simple_input), &p_mock); - p_mock->error_code.value = 255; - - // When calling the mock we expect to receive an error back to ensure the mock behavois as defined. - uint8_t retval = mock_function_simple_input(1, 2, 3); - TEST_ASSERT_EQUAL_INT(expected_return_value, retval); - - mock_calls_verify(); -} - -/* Test that ensures the mock framework and db are correctly configured :-) - * - */ -void test_mock_framework_stub_function() -{ - // Expected mock calls and corresponding setup. - mock_call_use_as_stub(TO_STR(mock_function_simple_input)); - - mock_function_simple_input(1, 2 , 3); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - mock_function_simple_input(0x12, 0x9876, 0x98765432); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - mock_function_simple_input(0, 0, 0); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - - mock_calls_verify(); -} - -/* Test that ensures the mock framework and db are correctly configured :-) - * - * This test ensures that a given mock file is completely used as a stub on all functions. - */ -void test_mock_framework_stub_file() -{ - uint32_t number = 10; - uint32_t * p_number = &number; - void * p_void = &number; - - // Clearing the mock db. - mock_calls_clear(); - - // Expected mock calls and corresponding setup. - mock_call_use_as_stub("example_test_mock.c"); - - mock_function_simple_input(1, 2 , 3); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - mock_function_simple_input(0x12, 0x9876, 0x98765432); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - mock_function_simple_input(0, 0, 0); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - mock_function_pointer_input(p_void, p_number, callback_func_used_for_mock_verification); // When used as stub, then anything should be accepted. Return value will be the default encoded in the stub. - - mock_calls_verify(); -} - -void test_mock_framework_array() -{ - mock_t * p_mock; - // This is the expected array that will be specified as expected in p_mock. - uint8_t expected_array[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 9}; - uint32_t expected_length = 10; - // This is the actual array that will be passed to the function call (mock) and will internally - // within the mock be compared against the expected. - uint8_t actual_array[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 9}; - uint32_t actual_length = 10; - - // This is the out array that will be specified as output in p_mock, the mock will copy the - // content to the parameter passed in the function call. - uint8_t out_array[10] = {9, 1, 2, 3, 4, 5, 6, 7, 8, 9}; - uint32_t out_length = 10; - - // This is the return array which contains no data, but is expected to be filled with out array - // in p_mock, the mock is expected to copy the content of out_array to the parameter passed in - // the function call (return_array). - uint8_t return_array[20]; - uint32_t return_length = 20; - - // This is the expected array that whichi is used in this test to ensure that what was returned - // in return array as expected. - uint8_t expected_out_array[10] = {9, 1, 2, 3, 4, 5, 6, 7, 8, 9};; - uint32_t expected_out_length = 10; - - // Clearing the mock db. - mock_calls_clear(); - - mock_call_expect(TO_STR(mock_function_array), &p_mock); - p_mock->expect_arg[0].pointer = expected_array; // Default rule: Compare strict. - p_mock->expect_arg[1].value = expected_length; // Default rule: Compare strict. - p_mock->expect_arg[3].value = return_length; // Default rule: Compare strict. - // Control the output from the mock when mock_function_array(...) is called. - p_mock->output_arg[2].pointer = out_array; // Output: Reversed array. - p_mock->output_arg[3].value = out_length; // Output: Reversed array. - - p_mock->return_code.value = 0; - - mock_function_array(actual_array, actual_length, return_array, &return_length); - - // Validating that the mock returned the correct output. - TEST_ASSERT_EQUAL_UINT32(expected_out_length, return_length); - TEST_ASSERT_EQUAL_UINT8_ARRAY(expected_out_array, return_array, expected_out_length); - - mock_calls_verify(); -} - - -/* Test that ensures the mock framework and db are correctly configured :-) - * - */ -void test_mock_framework_pointer() -{ - mock_t * p_mock; - // Clearing the mock db. - mock_calls_clear(); - - // As we are emulating a unit under test providing an internal function pointer, we don't have the knowledge on which. - // It is just expected that the function pointer is NOT NULL. - // Thereafter we execute whatever actual argument that was stored to ensure the functionality was indeed as expected. - mock_call_expect(TO_STR(mock_function_pointer_input), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - p_mock->compare_rule_arg[1] = COMPARE_ANY; - p_mock->compare_rule_arg[2] = COMPARE_NOT_NULL; // This is where we expect the function pointer tro be passed and retrieved. - p_mock->return_code.value = 0; - - mock_function_pointer_input(NULL, NULL, callback_func_used_for_mock_verification); - - // Potential value which can be fetched, e.g. to get a callback handle inside the mock or post validation of a value/struct. - // We try and fetch actual_arg[2] from the mock, which should contain argument 2 above (callback_func_used_for_mock_verification), - // in case the mock is correctly created and then cast it. - mock_callback_function_t cb = (mock_callback_function_t)p_mock->actual_arg[2].pointer; - TEST_ASSERT_EQUAL_PTR(callback_func_used_for_mock_verification, cb); - - // By calling the callback function here, then it is ensured that the actual callback passed to - // the mock, and received back through the actual_arg list are the same. - // The function pointers has already been compared so this is an additional verification. - // Values are not correct until the mock has been called so we verify m_callback_executed is FALSE. - TEST_ASSERT_FALSE(m_callback_executed); - cb(0x34325354); - TEST_ASSERT_TRUE(m_callback_executed); - TEST_ASSERT_EQUAL_UINT32(0x34325354, m_callback_test_number); - - mock_calls_verify(); -} - -void mock_function_void(void); -/* Test that ensures the mock framework and db are correctly configured :-) - * - */ -void test_mock_framework_void_function() -{ - mock_t * p_mock; - // Clearing the mock db. - mock_calls_clear(); - - // As we are emulating a unit under test providing an internal function pointer, we don't have the knowledge on which. - // It is just expected that the function pointer is NOT NULL. - // Thereafter we execute whatever actual argument that was stored to ensure the functionality was indeed as expected. - mock_call_expect(TO_STR(mock_function_void), &p_mock); - mock_call_expect(TO_STR(mock_function_void), &p_mock); - mock_call_expect(TO_STR(mock_function_void), &p_mock); - - mock_function_void(); - mock_function_void(); - mock_function_void(); - - mock_calls_verify(); -} - -/** TODO Test array embedded in struct. */ -void test_mock_framework_struct() { - mock_t * p_mock; - - test_mock_struct_t expect_struct_2 = - { - .member_byte = 0xAB, - .member = 0x23455432, - .union_member = {.submember_b = 0x3333} - }; - - test_mock_struct_t actual_struct_1; - - test_mock_struct_t actual_struct_2 = - { - .member_byte = 0xAB, - .member = 0x23455432, - .union_member = {.submember_b = 0x3333} - }; - - // Clearing the mock db. - mock_calls_clear(); - - // Compare strict (default setting) - mock_call_expect(TO_STR(mock_function_struct), &p_mock); - p_mock->compare_rule_arg[0] = COMPARE_ANY; - - mock_call_expect(TO_STR(mock_function_struct), &p_mock); - p_mock->expect_arg[0].pointer = &expect_struct_2; - - mock_function_struct(&actual_struct_1); - - mock_function_struct(&actual_struct_2); - - mock_calls_verify(); -} - -/* Test that ensures the framework and cmake files are correctly configured :-) */ -/* Seconde test to ensure the framework and cmake files are correctly configured :-) - * Expected outcome: Test pass - */ -void test_mock_first_build_pass() { - TEST_ASSERT_TRUE(1); -} - -/* Test that ensures that fake implementation of a function is correctly executed. - * When the mock is setup as a fake then it is expected that data will be copied from buffer_in to buffer_out. - * Expected outcome: Test pass - * Buffer_out == buffer_in - */ -void test_mock_fake_handling() { - uint8_t buffer_in[] = {0xDE, 0xAD, 0xBE, 0xEF}; - uint8_t buffer_out[] = {0xCA, 0xFE, 0xBA, 0xBE}; - uint32_t buffer_out_length = sizeof(buffer_out); - test_mock_struct_t test_struct = {.member_byte = 0xA5, - .member = 0xDEADC0DE, - .union_member.submember_b = 0xDEADBEEF - }; - - // Clearing the mock db. - mock_calls_clear(); - - // Setup the array function to be use its fake implementation (memcpy) - mock_call_use_as_fake(TO_STR(mock_function_array)); - mock_call_use_as_fake(TO_STR(mock_function_struct)); - - uint32_t compare_result = memcmp(buffer_in, buffer_out, sizeof(buffer_in)); - TEST_ASSERT_TRUE(compare_result != 0); - - // Calling mock_function_array(...) should result in the fake implementation to be used, thus - // content of buffer_in should be copied to buffer_out. - mock_function_array(buffer_in, sizeof(buffer_in), buffer_out, &buffer_out_length); - - TEST_ASSERT_EQUAL_UINT32(sizeof(buffer_in), buffer_out_length); - TEST_ASSERT_EQUAL_UINT8_ARRAY(buffer_in, buffer_out, sizeof(buffer_in)); - - // Calling mock_function_array(...) should result in the fake implementation to be used, thus - // content of buffer_in should be copied to buffer_out. - mock_function_array(buffer_in, sizeof(buffer_in), buffer_out, &buffer_out_length); - - TEST_ASSERT_EQUAL_UINT32(sizeof(buffer_in), buffer_out_length); - TEST_ASSERT_EQUAL_UINT8_ARRAY(buffer_in, buffer_out, sizeof(buffer_in)); - - // Calling mock_function_struct(...) should result in the fake implementation to be used, thus - // content of test_struct should be update with +1, +2, +3, as seen in the fake implementation. - mock_function_struct(&test_struct); - TEST_ASSERT_EQUAL_UINT8(0xA6, test_struct.member_byte); - TEST_ASSERT_EQUAL_UINT32(0xDEADC0E0, test_struct.member); - TEST_ASSERT_EQUAL_UINT32(0xDEADBEF2, test_struct.union_member.submember_b); - - mock_calls_verify(); -} - diff --git a/components/testframework/libs/testframework/python/__init__.py b/components/testframework/libs/testframework/python/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/components/testframework/libs/testframework/python/remote_execution.py b/components/testframework/libs/testframework/python/remote_execution.py deleted file mode 100644 index 6e89bfeee..000000000 --- a/components/testframework/libs/testframework/python/remote_execution.py +++ /dev/null @@ -1,297 +0,0 @@ -#!/usr/bin/python -# Copyright (c) 2018 Silicon Laboratories Inc. - -import sys -import os -import paramiko -import socket -import threading -import time -import re -from . import xunit -from distutils.version import StrictVersion - -zw700versions = [(StrictVersion('0.1.9'), './bin/start-700_platform.sh -k ~/{} -r 256', './bin/start-700_platform.sh -s'), - (StrictVersion('0.1.8'), './bin/start-700_platform.sh -k ~/{} -r 256 -c', './bin/start-700_platform.sh -s'), - (StrictVersion('0.0.1'), './bin/start-700_platform.sh -k ~/{} -r 256', 'killall toplevel')] - -DEBUG = 0 - -class RemoteTestSession(): - def __init__(self, server, username='developer', password='1234', timeout=60, xmlfile=None): - self.server = server - self.xmlfile = xmlfile - self.testResult = [] - self.testTime = 0.0 - self.commands = zw700versions[-1] - - self.username = username - self.password = password - self.timeout = timeout - - self.remotesession_stdin = None - - self.sshclient = paramiko.SSHClient() - self.sshclient.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - if DEBUG: print('Connecting to: %s' % self.server) - self.sshclient.connect(self.server, username=self.username, password=self.password) - self.sftpsession = self.sshclient.open_sftp() - self.getServerVersion() - - def put(self, localFile, remoteFile): - # Use SFTP module to upload file - self.sftpsession.put(localFile, remoteFile) - - def executeTest(self, remoteFile): - self.testResult = [] - consoleThread = RemoteTestConsoleThread(self, self.server, 11236) - consoleThread.start() - if DEBUG: print('Running %s remotely' % remoteFile) - remote_cmd = self.commands[1].format(remoteFile) - stdin, stdout, stderr = self.sshclient.exec_command(remote_cmd) - if DEBUG: - s = stdout.read() - if s: - print('commands[1] stdout:') - print('%s' % s) - s = stderr.read() - if s: - print('commands[1] stderr:') - print('%s' % s) - stdin.close() - stdout.close() - stderr.close() - consoleThread.join() - - def getTestResult(self): - return self.testResult - - def getTestResultXml(self, testname): - return xunit.TestSuite().fromUnity(self.testResult, name=testname, time=self.testTime, hostname=self.server) - - def setTestResult(self, testResult, time=0.0): - self.testResult = testResult - self.testTime = time - - def endTest(self): - remote_cmd = self.commands[2] - stdin, stdout, stderr = self.sshclient.exec_command(remote_cmd) - if DEBUG: - s = stdout.read() - if s: - print('commands[2] stdout:') - print('%s' % s) - s = stderr.read() - if s: - print('commands[2] stderr:') - print('%s' % s) - stdin.close() - stdout.close() - stderr.close() - - def getTimeout(self): - return self.timeout - - def getServerVersion(self): - systemtype = 'Unknown' - version = 'Unknown' - remote_cmd = './bin/start-700_platform.sh -v -k none' - stdin, stdout, stderr = self.sshclient.exec_command(remote_cmd) - versionstr = stdout.read() - versionlist = re.findall(r".*;.*;?", versionstr, re.MULTILINE) - if len(versionlist) > 0: - versiongrp = re.match(r"([^;]*);([^;]*)(.*)?", versionlist[0]) - if versiongrp.group(1) is not None and versiongrp.group(1) != "": systemtype = versiongrp.group(1) - if versiongrp.group(2) is not None and versiongrp.group(2) != "": version = versiongrp.group(2) - for i in zw700versions: - if StrictVersion(version) >= StrictVersion('%s' % (i[0])): - if DEBUG: print('System version: %s, Version required: %s or newer' % (version, i[0])) - self.commands = i - break - - if DEBUG: print('Remote server: System: %s, Version: %s' % (systemtype, version)) - - def close(self): - self.sftpsession.close() - self.sshclient.close() - -class TimeoutMonitorThread(threading.Thread): - - def __init__(self, sshsession): - super(TimeoutMonitorThread, self).__init__() - self.sshsession = sshsession - self.timeout = sshsession.getTimeout() - self.starttime = 0 - self.stoptime = 0 - self.status = 'stopped' - - def run(self): - if DEBUG: print('TimeoutMonitor started') - self.starttime = time.time() - self.timeouttime = self.starttime + self.timeout - currentTime = time.time() - while currentTime < self.timeouttime: - time.sleep(0.2) - currentTime = time.time() - - self.stoptime = time.time() - if self.timeouttime and (currentTime >= self.timeouttime ): - if DEBUG: print('Timeout reached') - self.status = 'expired' - else: - if DEBUG: print('TimeoutMonitor stopped') - self.status = 'stopped' - self.sshsession.endTest() - - def resettimer(self): - currentTime = time.time() - self.timeouttime = currentTime + self.timeout - - def status(self): - return self.status - - def timeElapsed(self): - return self.stoptime - self.starttime - - def exit(self): - self.timeouttime = 0 - -class RemoteTestConsoleThread(threading.Thread): - - def __init__(self, sshsession, host, port): - super(RemoteTestConsoleThread, self).__init__() - self.sshsession = sshsession - self.host = host - self.port = port - - def run(self): - self.running = 50 - receive_buffer = '' - timeoutThread = TimeoutMonitorThread(self.sshsession) - timeoutThread.start() - while self.running: - try: - self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.socket.connect((self.host, self.port)) - if DEBUG: print('Connected %s:%d' % (self.host, self.port)) - while self.running: - try: - if not self.running: break - new_data = self.socket.recv(1024) - if not new_data: break - timeoutThread.resettimer() - receive_buffer += new_data - - retval = re.search(r"\x04", new_data) - if retval: - if DEBUG: print('Test completed') - self.running = 0 - timeoutThread.exit() - self.sshsession.endTest() - - except IOError as e: - if DEBUG: print('Connection has been closed / 2') - self.running = 0 - - self.socket.close() - except IOError as e: - if DEBUG: print('Connection closed / 1') - if self.running: self.running -= 1 - if self.running: - time.sleep(0.2) - console_output = receive_buffer.splitlines() - - # make sure timeout thread is stopped and joined - timeoutThread.exit() - timeoutThread.join() - - if timeoutThread.status == 'expired': - summary = '%i Tests 1 Failures 0 Ignored' % ((len(console_output)+1), ) - console_output.append(':9999:Unknown:FAIL: Timeout') - console_output.append('-----------------------') - console_output.append(summary) - console_output.append('FAIL') - totaltime = timeoutThread.timeElapsed() - self.sshsession.setTestResult(console_output, totaltime) - - def exit(self): - if self.running == 1: - self.running = 0 - try: - eof_message = b'' - self.socket.shutdown(socket.SHUT_RDWR) - self.socket.sendto(eof_message, (self.host, self.port)) - except IOError as e: - if DEBUG: print('Connection exit / 4') - self.socket.close() - -def usage(): - print('Usage') - print('') - print(' remote_execution.py [options]') - print('') - print('Options') - print(' -h, --help = Print this help text.') - print(' -V, --verbose = Enable verbose output') - print(' -r, --remote-target = Remote target for test execution (Currently only SSH targets are supported)') - print(' can be dns name or ip of remote system') - print(' -u, --user = Username when accessing remote test system (only for SSH targets), default=developer') - print(' -p, --password = Password for user specified by \'-u\' or \'--user\' (only for SSH targets), , default=1234') - print(' -f, --file = Test file (executable) to upload to remote target') - print(' -t, --timeout = Timeout before terminating a stalled test in seconds, default=10 seconds') - print(' -o, --out = Test report in Xunit xml format') - -def main(argv): - import getopt - opts, args = getopt.getopt(sys.argv[1:], 'hVr:u:p:f:t:o:', ['help', 'verbose', 'remote-target=', 'user=', 'password=', 'file=', 'timeout=', 'out=']) - - remote_target = "" - username = "developer" - password = "1234" - file = "" - timeout = 10 - xml = None - xmlfile = None - - global DEBUG - - for opt, arg in opts: - if opt in ('-h', '--help'): - usage() - sys.exit(0) - elif opt in ('-V', '--verbose'): - DEBUG = True - elif opt in ('-r', '--remote-target'): - remote_target = arg - elif opt in ('-u', '--user'): - username = arg - elif opt in ('-p', '--password'): - password = arg - elif opt in ('-f', '--file'): - file = arg - elif opt in ('-t', '--timeout'): - timeout = int(arg) - elif opt in ('-o', '--out'): - from . import xunit - import xml.etree.ElementTree as ElementTree - xml = xunit.Xunit() - xmlfile = arg - - test_session = RemoteTestSession(remote_target, username, password, timeout=timeout) - testsuitename = os.path.basename(file) - remote_file = 'projects/700series/images/%s' % testsuitename - if DEBUG: print('Uploading: %s' % testsuitename) - test_session.put(file, remote_file) - - test_session.executeTest(remote_file) - if xmlfile is not None: - xml.append(test_session.getTestResultXml(testsuitename)) - ElementTree.ElementTree(xml.getTree()).write(xmlfile, encoding="UTF-8", xml_declaration=True) - if DEBUG: - result = test_session.getTestResult() - for line in result: - print(line) - - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/components/testframework/libs/testframework/python/xunit.py b/components/testframework/libs/testframework/python/xunit.py deleted file mode 100644 index 68ac71514..000000000 --- a/components/testframework/libs/testframework/python/xunit.py +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright (c) 2018 Silicon Laboratories Inc. -import os -import xml.etree.ElementTree as ElementTree -import re - -class Xunit(): - def __init__(self, testsuite=None): - self.testsuites = ElementTree.Element("testsuites") - self.testsuites.text = '\n' - self.testsuites.tail = '\n' - - if testsuite is not None: - self.testsuites.append(testsuite) - - def append(self, testsuite): - testsuitetree = testsuite.getTree() - self.testsuites.append(testsuitetree) - - def getTree(self): - return self.testsuites - - def tostring(self): - xmlout = '\n' - xmlout += ElementTree.tostring(self.testsuites) - return xmlout - -class TestSuite(): - def __init__(self, name="", hostname=None): - self.testsuite = ElementTree.Element("testsuite") - self.testsuite.set('name', name) - self.testsuite.text = '\n' - self.testsuite.tail = '\n' - if hostname is not None: - self.testsuite.set('hostname', hostname) - - self.testsuite.set('failures', "0") - - self.tests = 0 - self.passed = 0 - self.failures = 0 - self.skipped = 0 - self.time = 0.0 - - def getTree(self): - return self.testsuite - - def append(self, testcase): - sub = ElementTree.SubElement(self.testsuite, "testcase") - sub.set('name', testcase.getName()) - sub.set('time', str(testcase.getTime())) - sub.text = '\n' - sub.tail = '\n' - self.tests += 1 - self.time += testcase.getTime() - if testcase.failed(): - self.failures += 1 - sub = ElementTree.SubElement(sub, "error") - sub.set('message', testcase.getMessage()) - sub.text = testcase.getVerboseMessage() - sub.tail = '\n' - - if testcase.skipped(): - self.skipped += 1 - sub = ElementTree.SubElement(sub, "skipped") - sub.text = '\n' - sub.tail = '\n' - self.testsuite.set('tests', str(self.tests)) - self.testsuite.set('errors', str(self.failures)) - self.testsuite.set('skipped', str(self.skipped)) - self.testsuite.set('time', str(self.time)) - - def setTime(self, time): - self.time = time - self.testsuite.set('time', str(self.time)) - - def fromUnity(self, report, name="", time=None, hostname=None): - self.testsuite.set('name', name) - self.testsuite.text = '\n' - self.testsuite.tail = '\n' - - for line in report: - passed = re.match(r":[0-9]*:(.*):PASS.*", line) - failed = re.match(r":[0-9]*:(.*):FAIL:(.*)", line) - ignore = re.match(r":[0-9]*:(.*):IGNORE:(.*)", line) - if passed: - testcase = TestCase(passed.group(1)) - self.append(testcase) - elif failed: - testcase = TestCase(failed.group(1), error=True) - testcase.setMessage(failed.group(2)) - self.append(testcase) - elif ignore: - testcase = TestCase(ignore.group(1), ignore=True) - testcase.setMessage(ignore.group(2)) - self.append(testcase) - - self.testsuite.set('tests', str(self.tests)) - self.testsuite.set('errors', str(self.failures)) - self.testsuite.set('skipped', str(self.skipped)) - self.testsuite.set('time', str(self.time)) - if time is not None: - self.testsuite.set('time', str(time)) - if hostname is not None: - self.testsuite.set('hostname', hostname) - return self - - def fromCtest(self, report, hostname=None): - testsuites = [] - - current = '1' - next = '2' - testsuiterep = [] - time = 0.0 - for line in report: - found = re.match(r"[ \t]*[0-9]*/[0-9]* Test[ \t]*#[0-9]*:.*([0-9]*\.[0-9]*)[ \t]*sec.*", line) - if found: - time = float(found.group(1)) - - found = re.match(r""+current+": (.*)", line) - if found: - testsuiterep.append(found.group(1)) - - found = re.match(r""+next+": (.*)", line) - if found: - testsuitename = os.path.basename(re.sub(r"^Test[ \t]*command:[ \t]*(.*)[\r|\n]+$", "\\1", testsuiterep[0])) - testsuite = TestSuite().fromUnity(testsuiterep, name=testsuitename, hostname=hostname, time=time) - testsuites.append(testsuite) - - current = str(int(current) + 1) - next = str(int(next) + 1) - time = 0.0 - testsuiterep = [] - testsuiterep.append(found.group(1)) - - testsuitename = os.path.basename(re.sub(r"^Test[ \t]*command:[ \t]*(.*)[\r|\n]+$", "\\1", testsuiterep[0])) - testsuite = TestSuite().fromUnity(testsuiterep, name=testsuitename, hostname=hostname, time=time) - testsuites.append(testsuite) - return testsuites - -class TestCase(): - def __init__(self, name="", error=False, ignore=False, time=0.0): - self.name = name - self.time = time - self.error = error - self.ignore = ignore - self.message = '' - self.vmessage = '' - - def failed(self): - return self.error - - def skipped(self): - return self.ignore - - def getName(self): - return self.name - - def getTime(self): - return self.time - - def getMessage(self): - return self.message - - def getVerboseMessage(self): - return self.vmessage - - def setMessage(self, message): - self.message = message - - def setVerboseMessage(self, message): - self.vmessage = message diff --git a/components/testframework/libs/testframework/unity/CMakeLists.txt b/components/testframework/libs/testframework/unity/CMakeLists.txt deleted file mode 100644 index 306ed3d6b..000000000 --- a/components/testframework/libs/testframework/unity/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ - -CROSS_SYSTEM_DIR("." "" CROSS_SYSTEM_DIR) - -SET(SOURCES - unity.c - ${CROSS_SYSTEM_DIR}/unity_print.c -) - -# unity target may be imported be several projects, e.g. 700 series and libs2 simultaneously. -# This test ensures that the target named 'unity' will only be declared if it is not already declared. -if (NOT TARGET unity) - add_library(unity ${SOURCES} ) - target_compile_definitions(unity PUBLIC "-DUNITY_EXCLUDE_FLOAT -DUNITY_OUTPUT_CHAR=ZW_putchar") - target_include_directories(unity PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -endif (NOT TARGET unity) - diff --git a/components/testframework/libs/testframework/unity/asip/unity_print.c b/components/testframework/libs/testframework/unity/asip/unity_print.c deleted file mode 100644 index 33380b1ca..000000000 --- a/components/testframework/libs/testframework/unity/asip/unity_print.c +++ /dev/null @@ -1,44 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ - -#include "../unity_print.h" -#include - -#define ASIP_THREEPORT_ThreadAnd (0x8020) - -/*extern uint8_t * gUnityMessageBuffer; -extern uint16_t gUnityMessageBufferSize;*/ - - -uint8_t p [1024]; - -uint8_t * gUnityMessageBuffer = p; -uint16_t gUnityMessageBufferSize = sizeof(p); -/*void longjmp() { - while(1); -} -int setjmp() -{ - return 0; -} -*/ -static uint16_t mMessageBufferIndex; - -void unity_print_init(void) -{ - gUnityMessageBuffer[gUnityMessageBufferSize-1] = 0; -} - -int ZW_putchar(int c) -{ - if (c != 0 && (mMessageBufferIndex < gUnityMessageBufferSize)) - gUnityMessageBuffer[mMessageBufferIndex++] = c; - return 0; -} - -void unity_print_close(void) -{ - *((int *)ASIP_THREEPORT_ThreadAnd) = 0x00000000; - while(1); -} - diff --git a/components/testframework/libs/testframework/unity/auto/colour_prompt.rb b/components/testframework/libs/testframework/unity/auto/colour_prompt.rb deleted file mode 100644 index 8adab6e61..000000000 --- a/components/testframework/libs/testframework/unity/auto/colour_prompt.rb +++ /dev/null @@ -1,115 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -if RUBY_PLATFORM =~/(win|w)32$/ - begin - require 'Win32API' - rescue LoadError - puts "ERROR! \"Win32API\" library not found" - puts "\"Win32API\" is required for colour on a windows machine" - puts " try => \"gem install Win32API\" on the command line" - puts - end - # puts - # puts 'Windows Environment Detected...' - # puts 'Win32API Library Found.' - # puts -end - -class ColourCommandLine - def initialize - if RUBY_PLATFORM =~/(win|w)32$/ - get_std_handle = Win32API.new("kernel32", "GetStdHandle", ['L'], 'L') - @set_console_txt_attrb = - Win32API.new("kernel32","SetConsoleTextAttribute",['L','N'], 'I') - @hout = get_std_handle.call(-11) - end - end - - def change_to(new_colour) - if RUBY_PLATFORM =~/(win|w)32$/ - @set_console_txt_attrb.call(@hout,self.win32_colour(new_colour)) - else - "\033[30;#{posix_colour(new_colour)};22m" - end - end - - def win32_colour(colour) - case colour - when :black then 0 - when :dark_blue then 1 - when :dark_green then 2 - when :dark_cyan then 3 - when :dark_red then 4 - when :dark_purple then 5 - when :dark_yellow, :narrative then 6 - when :default_white, :default, :dark_white then 7 - when :silver then 8 - when :blue then 9 - when :green, :success then 10 - when :cyan, :output then 11 - when :red, :failure then 12 - when :purple then 13 - when :yellow then 14 - when :white then 15 - else - 0 - end - end - - def posix_colour(colour) - # ANSI Escape Codes - Foreground colors - # | Code | Color | - # | 39 | Default foreground color | - # | 30 | Black | - # | 31 | Red | - # | 32 | Green | - # | 33 | Yellow | - # | 34 | Blue | - # | 35 | Magenta | - # | 36 | Cyan | - # | 37 | Light gray | - # | 90 | Dark gray | - # | 91 | Light red | - # | 92 | Light green | - # | 93 | Light yellow | - # | 94 | Light blue | - # | 95 | Light magenta | - # | 96 | Light cyan | - # | 97 | White | - - case colour - when :black then 30 - when :red, :failure then 31 - when :green, :success then 32 - when :yellow then 33 - when :blue, :narrative then 34 - when :purple, :magenta then 35 - when :cyan, :output then 36 - when :white, :default_white then 37 - when :default then 39 - else - 39 - end - end - - def out_c(mode, colour, str) - case RUBY_PLATFORM - when /(win|w)32$/ - change_to(colour) - $stdout.puts str if mode == :puts - $stdout.print str if mode == :print - change_to(:default_white) - else - $stdout.puts("#{change_to(colour)}#{str}\033[0m") if mode == :puts - $stdout.print("#{change_to(colour)}#{str}\033[0m") if mode == :print - end - end -end # ColourCommandLine - -def colour_puts(role,str) ColourCommandLine.new.out_c(:puts, role, str) end -def colour_print(role,str) ColourCommandLine.new.out_c(:print, role, str) end - diff --git a/components/testframework/libs/testframework/unity/auto/colour_reporter.rb b/components/testframework/libs/testframework/unity/auto/colour_reporter.rb deleted file mode 100644 index 89e79519c..000000000 --- a/components/testframework/libs/testframework/unity/auto/colour_reporter.rb +++ /dev/null @@ -1,39 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -require "#{File.expand_path(File.dirname(__FILE__))}/colour_prompt" - -$colour_output = true - -def report(message) - if not $colour_output - $stdout.puts(message) - else - message = message.join('\n') if (message.class == Array) - message.each_line do |line| - line.chomp! - colour = case(line) - when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i - ($1.to_i == 0) ? :green : :red - when /PASS/ - :green - when /^OK$/ - :green - when /(?:FAIL|ERROR)/ - :red - when /IGNORE/ - :yellow - when /^(?:Creating|Compiling|Linking)/ - :white - else - :silver - end - colour_puts(colour, line) - end - end - $stdout.flush - $stderr.flush -end \ No newline at end of file diff --git a/components/testframework/libs/testframework/unity/auto/generate_config.yml b/components/testframework/libs/testframework/unity/auto/generate_config.yml deleted file mode 100644 index ce66cead5..000000000 --- a/components/testframework/libs/testframework/unity/auto/generate_config.yml +++ /dev/null @@ -1,36 +0,0 @@ -#this is a sample configuration file for generate_module -#you would use it by calling generate_module with the -ygenerate_config.yml option -#files like this are useful for customizing generate_module to your environment -:generate_module: - :defaults: - #these defaults are used in place of any missing options at the command line - :path_src: ../src/ - :path_inc: ../src/ - :path_tst: ../test/ - :update_svn: true - :includes: - #use [] for no additional includes, otherwise list the includes on separate lines - :src: - - Defs.h - - Board.h - :inc: [] - :tst: - - Defs.h - - Board.h - - Exception.h - :boilerplates: - #these are inserted at the top of generated files. - #just comment out or remove if not desired. - #use %1$s where you would like the file name to appear (path/extension not included) - :src: | - //------------------------------------------- - // %1$s.c - //------------------------------------------- - :inc: | - //------------------------------------------- - // %1$s.h - //------------------------------------------- - :tst: | - //------------------------------------------- - // Test%1$s.c : Units tests for %1$s.c - //------------------------------------------- diff --git a/components/testframework/libs/testframework/unity/auto/generate_module.rb b/components/testframework/libs/testframework/unity/auto/generate_module.rb deleted file mode 100644 index 4a020ebbf..000000000 --- a/components/testframework/libs/testframework/unity/auto/generate_module.rb +++ /dev/null @@ -1,202 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -# This script creates all the files with start code necessary for a new module. -# A simple module only requires a source file, header file, and test file. -# Triad modules require a source, header, and test file for each triad type (like model, conductor, and hardware). - -require 'rubygems' -require 'fileutils' - -HERE = File.expand_path(File.dirname(__FILE__)) + '/' - -#help text when requested -HELP_TEXT = [ "\nGENERATE MODULE\n-------- ------", - "\nUsage: ruby generate_module [options] module_name", - " -i\"include\" sets the path to output headers to 'include' (DEFAULT ../src)", - " -s\"../src\" sets the path to output source to '../src' (DEFAULT ../src)", - " -t\"C:/test\" sets the path to output source to 'C:/test' (DEFAULT ../test)", - " -p\"MCH\" sets the output pattern to MCH.", - " dh - driver hardware.", - " dih - driver interrupt hardware.", - " mch - model conductor hardware.", - " mvp - model view presenter.", - " src - just a single source module. (DEFAULT)", - " -d destroy module instead of creating it.", - " -u update subversion too (requires subversion command line)", - " -y\"my.yml\" selects a different yaml config file for module generation", - "" ].join("\n") - -#Built in patterns -PATTERNS = { 'src' => {'' => { :inc => [] } }, - 'dh' => {'Driver' => { :inc => ['%1$sHardware.h'] }, - 'Hardware' => { :inc => [] } - }, - 'dih' => {'Driver' => { :inc => ['%1$sHardware.h', '%1$sInterrupt.h'] }, - 'Interrupt'=> { :inc => ['%1$sHardware.h'] }, - 'Hardware' => { :inc => [] } - }, - 'mch' => {'Model' => { :inc => [] }, - 'Conductor'=> { :inc => ['%1$sModel.h', '%1$sHardware.h'] }, - 'Hardware' => { :inc => [] } - }, - 'mvp' => {'Model' => { :inc => [] }, - 'Presenter'=> { :inc => ['%1$sModel.h', '%1$sView.h'] }, - 'View' => { :inc => [] } - } - } - -#TEMPLATE_TST -TEMPLATE_TST = %q[#include "unity.h" -%2$s#include "%1$s.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void test_%1$s_NeedToImplement(void) -{ - TEST_IGNORE(); -} -] - -#TEMPLATE_SRC -TEMPLATE_SRC = %q[%2$s#include "%1$s.h" -] - -#TEMPLATE_INC -TEMPLATE_INC = %q[#ifndef _%3$s_H -#define _%3$s_H%2$s - -#endif // _%3$s_H -] - -# Parse the command line parameters. -ARGV.each do |arg| - case(arg) - when /^-d/ then @destroy = true - when /^-u/ then @update_svn = true - when /^-p(\w+)/ then @pattern = $1 - when /^-s(.+)/ then @path_src = $1 - when /^-i(.+)/ then @path_inc = $1 - when /^-t(.+)/ then @path_tst = $1 - when /^-y(.+)/ then @yaml_config = $1 - when /^(\w+)/ - raise "ERROR: You can't have more than one Module name specified!" unless @module_name.nil? - @module_name = arg - when /^-(h|-help)/ - puts HELP_TEXT - exit - else - raise "ERROR: Unknown option specified '#{arg}'" - end -end -raise "ERROR: You must have a Module name specified! (use option -h for help)" if @module_name.nil? - -#load yaml file if one was requested -if @yaml_config - require 'yaml' - cfg = YAML.load_file(HERE + @yaml_config)[:generate_module] - @path_src = cfg[:defaults][:path_src] if @path_src.nil? - @path_inc = cfg[:defaults][:path_inc] if @path_inc.nil? - @path_tst = cfg[:defaults][:path_tst] if @path_tst.nil? - @update_svn = cfg[:defaults][:update_svn] if @update_svn.nil? - @extra_inc = cfg[:includes] - @boilerplates = cfg[:boilerplates] -else - @boilerplates = {} -end - -# Create default file paths if none were provided -@path_src = HERE + "../src/" if @path_src.nil? -@path_inc = @path_src if @path_inc.nil? -@path_tst = HERE + "../test/" if @path_tst.nil? -@path_src += '/' unless (@path_src[-1] == 47) -@path_inc += '/' unless (@path_inc[-1] == 47) -@path_tst += '/' unless (@path_tst[-1] == 47) -@pattern = 'src' if @pattern.nil? -@includes = { :src => [], :inc => [], :tst => [] } -@includes.merge!(@extra_inc) unless @extra_inc.nil? - -#create triad definition -TRIAD = [ { :ext => '.c', :path => @path_src, :template => TEMPLATE_SRC, :inc => :src, :boilerplate => @boilerplates[:src] }, - { :ext => '.h', :path => @path_inc, :template => TEMPLATE_INC, :inc => :inc, :boilerplate => @boilerplates[:inc] }, - { :ext => '.c', :path => @path_tst+'Test', :template => TEMPLATE_TST, :inc => :tst, :boilerplate => @boilerplates[:tst] }, - ] - -#prepare the pattern for use -@patterns = PATTERNS[@pattern.downcase] -raise "ERROR: The design pattern specified isn't one that I recognize!" if @patterns.nil? - -# Assemble the path/names of the files we need to work with. -files = [] -TRIAD.each do |triad| - @patterns.each_pair do |pattern_file, pattern_traits| - files << { - :path => "#{triad[:path]}#{@module_name}#{pattern_file}#{triad[:ext]}", - :name => "#{@module_name}#{pattern_file}", - :template => triad[:template], - :boilerplate => triad[:boilerplate], - :includes => case(triad[:inc]) - when :src then @includes[:src] | pattern_traits[:inc].map{|f| f % [@module_name]} - when :inc then @includes[:inc] - when :tst then @includes[:tst] | pattern_traits[:inc].map{|f| "Mock#{f}"% [@module_name]} - end - } - end -end - -# destroy files if that was what was requested -if @destroy - files.each do |filespec| - file = filespec[:path] - if File.exist?(file) - if @update_svn - `svn delete \"#{file}\" --force` - puts "File #{file} deleted and removed from source control" - else - FileUtils.remove(file) - puts "File #{file} deleted" - end - else - puts "File #{file} does not exist so cannot be removed." - end - end - puts "Destroy Complete" - exit -end - -#Abort if any module already exists -files.each do |file| - raise "ERROR: File #{file[:name]} already exists. Exiting." if File.exist?(file[:path]) -end - -# Create Source Modules -files.each_with_index do |file, i| - File.open(file[:path], 'w') do |f| - f.write(file[:boilerplate] % [file[:name]]) unless file[:boilerplate].nil? - f.write(file[:template] % [ file[:name], - file[:includes].map{|f| "#include \"#{f}\"\n"}.join, - file[:name].upcase ] - ) - end - if (@update_svn) - `svn add \"#{file[:path]}\"` - if $?.exitstatus == 0 - puts "File #{file[:path]} created and added to source control" - else - puts "File #{file[:path]} created but FAILED adding to source control!" - end - else - puts "File #{file[:path]} created" - end -end - -puts 'Generate Complete' diff --git a/components/testframework/libs/testframework/unity/auto/generate_test_runner.rb b/components/testframework/libs/testframework/unity/auto/generate_test_runner.rb deleted file mode 100644 index e29a9be95..000000000 --- a/components/testframework/libs/testframework/unity/auto/generate_test_runner.rb +++ /dev/null @@ -1,374 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -$QUICK_RUBY_VERSION = RUBY_VERSION.split('.').inject(0){|vv,v| vv * 100 + v.to_i } -File.expand_path(File.join(File.dirname(__FILE__),'colour_prompt')) - -class UnityTestRunnerGenerator - - def initialize(options = nil) - @options = UnityTestRunnerGenerator.default_options - case(options) - when NilClass then @options - when String then @options.merge!(UnityTestRunnerGenerator.grab_config(options)) - when Hash then @options.merge!(options) - else raise "If you specify arguments, it should be a filename or a hash of options" - end - require "#{File.expand_path(File.dirname(__FILE__))}/type_sanitizer" - end - - def self.default_options - { - :includes => [], - :plugins => [], - :framework => :unity, - :test_prefix => "test|spec|should", - :setup_name => "setUp", - :teardown_name => "tearDown", - } - end - - def self.grab_config(config_file) - options = self.default_options - unless (config_file.nil? or config_file.empty?) - require 'yaml' - yaml_guts = YAML.load_file(config_file) - options.merge!(yaml_guts[:unity] || yaml_guts[:cmock]) - raise "No :unity or :cmock section found in #{config_file}" unless options - end - return(options) - end - - def run(input_file, output_file, options=nil) - tests = [] - testfile_includes = [] - used_mocks = [] - - @options.merge!(options) unless options.nil? - module_name = File.basename(input_file) - - #pull required data from source file - source = File.read(input_file) - source = source.force_encoding("ISO-8859-1").encode("utf-8", :replace => nil) if ($QUICK_RUBY_VERSION > 10900) - tests = find_tests(source) - headers = find_includes(source) - testfile_includes = (headers[:local] + headers[:system]) - used_mocks = find_mocks(testfile_includes) - testfile_includes = (testfile_includes - used_mocks) - testfile_includes.delete_if{|inc| inc =~ /(unity|cmock)/} - - #build runner file - generate(input_file, output_file, tests, used_mocks, testfile_includes) - - #determine which files were used to return them - all_files_used = [input_file, output_file] - all_files_used += testfile_includes.map {|filename| filename + '.c'} unless testfile_includes.empty? - all_files_used += @options[:includes] unless @options[:includes].empty? - return all_files_used.uniq - end - - def generate(input_file, output_file, tests, used_mocks, testfile_includes) - File.open(output_file, 'w') do |output| - create_header(output, used_mocks, testfile_includes) - create_externs(output, tests, used_mocks) - create_mock_management(output, used_mocks) - create_suite_setup_and_teardown(output) - create_reset(output, used_mocks) - create_main(output, input_file, tests, used_mocks) - end - - if (@options[:header_file] && !@options[:header_file].empty?) - File.open(@options[:header_file], 'w') do |output| - create_h_file(output, @options[:header_file], tests, testfile_includes) - end - end - end - - def find_tests(source) - tests_and_line_numbers = [] - - source_scrubbed = source.gsub(/\/\/.*$/, '') # remove line comments - source_scrubbed = source_scrubbed.gsub(/\/\*.*?\*\//m, '') # remove block comments - lines = source_scrubbed.split(/(^\s*\#.*$) # Treat preprocessor directives as a logical line - | (;|\{|\}) /x) # Match ;, {, and } as end of lines - - lines.each_with_index do |line, index| - #find tests - if line =~ /^((?:\s*TEST_CASE\s*\(.*?\)\s*)*)\s*void\s+((?:#{@options[:test_prefix]}).*)\s*\(\s*(.*)\s*\)/ - arguments = $1 - name = $2 - call = $3 - params = $4 - args = nil - if (@options[:use_param_tests] and !arguments.empty?) - args = [] - arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) {|a| args << a[0]} - end - tests_and_line_numbers << { :test => name, :args => args, :call => call, :params => params, :line_number => 0 } - end - end - tests_and_line_numbers.uniq! {|v| v[:test] } - - #determine line numbers and create tests to run - source_lines = source.split("\n") - source_index = 0; - tests_and_line_numbers.size.times do |i| - source_lines[source_index..-1].each_with_index do |line, index| - if (line =~ /#{tests_and_line_numbers[i][:test]}/) - source_index += index - tests_and_line_numbers[i][:line_number] = source_index + 1 - break - end - end - end - - return tests_and_line_numbers - end - - def find_includes(source) - - #remove comments (block and line, in three steps to ensure correct precedence) - source.gsub!(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks - source.gsub!(/\/\*.*?\*\//m, '') # remove block comments - source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain) - - #parse out includes - includes = { - :local => source.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/).flatten, - :system => source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" } - } - return includes - end - - def find_mocks(includes) - mock_headers = [] - includes.each do |include_file| - mock_headers << File.basename(include_file) if (include_file =~ /^mock/i) - end - return mock_headers - end - - def create_header(output, mocks, testfile_includes=[]) - output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') - create_runtest(output, mocks) - output.puts("\n//=======Automagically Detected Files To Include=====") - output.puts("#include \"#{@options[:framework].to_s}.h\"") - output.puts('#include "cmock.h"') unless (mocks.empty?) - output.puts('#include ') - output.puts('#include ') - output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception) - if (@options[:header_file] && !@options[:header_file].empty?) - output.puts("#include \"#{File.basename(@options[:header_file])}\"") - else - @options[:includes].flatten.uniq.compact.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}") - end - testfile_includes.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}") - end - end - mocks.each do |mock| - output.puts("#include \"#{mock.gsub('.h','')}.h\"") - end - if @options[:enforce_strict_ordering] - output.puts('') - output.puts('int GlobalExpectCount;') - output.puts('int GlobalVerifyOrder;') - output.puts('char* GlobalOrderError;') - end - end - - def create_externs(output, tests, mocks) - output.puts("\n//=======External Functions This Runner Calls=====") - output.puts("extern void #{@options[:setup_name]}(void);") - output.puts("extern void #{@options[:teardown_name]}(void);") - tests.each do |test| - output.puts("extern void #{test[:test]}(#{test[:call] || 'void'});") - end - output.puts('') - end - - def create_mock_management(output, mocks) - unless (mocks.empty?) - output.puts("\n//=======Mock Management=====") - output.puts("static void CMock_Init(void)") - output.puts("{") - if @options[:enforce_strict_ordering] - output.puts(" GlobalExpectCount = 0;") - output.puts(" GlobalVerifyOrder = 0;") - output.puts(" GlobalOrderError = NULL;") - end - mocks.each do |mock| - mock_clean = TypeSanitizer.sanitize_c_identifier(mock) - output.puts(" #{mock_clean}_Init();") - end - output.puts("}\n") - - output.puts("static void CMock_Verify(void)") - output.puts("{") - mocks.each do |mock| - mock_clean = TypeSanitizer.sanitize_c_identifier(mock) - output.puts(" #{mock_clean}_Verify();") - end - output.puts("}\n") - - output.puts("static void CMock_Destroy(void)") - output.puts("{") - mocks.each do |mock| - mock_clean = TypeSanitizer.sanitize_c_identifier(mock) - output.puts(" #{mock_clean}_Destroy();") - end - output.puts("}\n") - end - end - - def create_suite_setup_and_teardown(output) - unless (@options[:suite_setup].nil?) - output.puts("\n//=======Suite Setup=====") - output.puts("static int suite_setup(void)") - output.puts("{") - output.puts(@options[:suite_setup]) - output.puts("}") - end - unless (@options[:suite_teardown].nil?) - output.puts("\n//=======Suite Teardown=====") - output.puts("static int suite_teardown(int num_failures)") - output.puts("{") - output.puts(@options[:suite_teardown]) - output.puts("}") - end - end - - def create_runtest(output, used_mocks) - cexception = @options[:plugins].include? :cexception - va_args1 = @options[:use_param_tests] ? ', ...' : '' - va_args2 = @options[:use_param_tests] ? '__VA_ARGS__' : '' - output.puts("\n//=======Test Runner Used To Run Each Test Below=====") - output.puts("#define RUN_TEST_NO_ARGS") if @options[:use_param_tests] - output.puts("#define RUN_TEST(TestFunc, TestLineNum#{va_args1}) \\") - output.puts("{ \\") - output.puts(" Unity.CurrentTestName = #TestFunc#{va_args2.empty? ? '' : " \"(\" ##{va_args2} \")\""}; \\") - output.puts(" Unity.CurrentTestLineNumber = TestLineNum; \\") - output.puts(" Unity.NumberOfTests++; \\") - output.puts(" CMock_Init(); \\") unless (used_mocks.empty?) - output.puts(" if (TEST_PROTECT()) \\") - output.puts(" { \\") - output.puts(" CEXCEPTION_T e; \\") if cexception - output.puts(" Try { \\") if cexception - output.puts(" #{@options[:setup_name]}(); \\") - output.puts(" TestFunc(#{va_args2}); \\") - output.puts(" } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, \"Unhandled Exception!\"); } \\") if cexception - output.puts(" } \\") - output.puts(" if (TEST_PROTECT() && !TEST_IS_IGNORED) \\") - output.puts(" { \\") - output.puts(" #{@options[:teardown_name]}(); \\") - output.puts(" CMock_Verify(); \\") unless (used_mocks.empty?) - output.puts(" } \\") - output.puts(" CMock_Destroy(); \\") unless (used_mocks.empty?) - output.puts(" UnityConcludeTest(); \\") - output.puts("}\n") - end - - def create_reset(output, used_mocks) - output.puts("\n//=======Test Reset Option=====") - output.puts("void resetTest(void);") - output.puts("void resetTest(void)") - output.puts("{") - output.puts(" CMock_Verify();") unless (used_mocks.empty?) - output.puts(" CMock_Destroy();") unless (used_mocks.empty?) - output.puts(" #{@options[:teardown_name]}();") - output.puts(" CMock_Init();") unless (used_mocks.empty?) - output.puts(" #{@options[:setup_name]}();") - output.puts("}") - end - - def create_main(output, filename, tests, used_mocks) - output.puts("\n\n//=======MAIN=====") - output.puts("int main(void)") - output.puts("{") - output.puts(" suite_setup();") unless @options[:suite_setup].nil? - output.puts(" UnityBegin(\"#{filename}\");") - if (@options[:use_param_tests]) - tests.each do |test| - if ((test[:args].nil?) or (test[:args].empty?)) - output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]}, RUN_TEST_NO_ARGS);") - else - test[:args].each {|args| output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]}, #{args});")} - end - end - else - tests.each { |test| output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]});") } - end - output.puts() - output.puts(" CMock_Guts_MemFreeFinal();") unless used_mocks.empty? - output.puts(" return #{@options[:suite_teardown].nil? ? "" : "suite_teardown"}(UnityEnd());") - output.puts("}") - end - - def create_h_file(output, filename, tests, testfile_includes) - filename = filename.upcase.gsub(/(?:\/|\\|\.)*/,'_') - output.puts("/* AUTOGENERATED FILE. DO NOT EDIT. */") - output.puts("#ifndef _#{filename}") - output.puts("#define _#{filename}\n\n") - @options[:includes].flatten.uniq.compact.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}") - end - testfile_includes.each do |inc| - output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}") - end - output.puts "\n" - tests.each {|test| output.puts("void #{test[:test]}(#{test[:params]});") } - output.puts("#endif\n\n") - end -end - -if ($0 == __FILE__) - options = { :includes => [] } - yaml_file = nil - - #parse out all the options first (these will all be removed as we go) - ARGV.reject! do |arg| - case(arg) - when '-cexception' - options[:plugins] = [:cexception]; true - when /\.*\.ya?ml/ - options = UnityTestRunnerGenerator.grab_config(arg); true - when /\.*\.h/ - options[:includes] << arg; true - when /--(\w+)=\"?(.*)\"?/ - options[$1.to_sym] = $2; true - else false - end - end - - #make sure there is at least one parameter left (the input file) - if !ARGV[0] - puts ["\nusage: ruby #{__FILE__} (files) (options) input_test_file (output)", - "\n input_test_file - this is the C file you want to create a runner for", - " output - this is the name of the runner file to generate", - " defaults to (input_test_file)_Runner", - " files:", - " *.yml / *.yaml - loads configuration from here in :unity or :cmock", - " *.h - header files are added as #includes in runner", - " options:", - " -cexception - include cexception support", - " --setup_name=\"\" - redefine setUp func name to something else", - " --teardown_name=\"\" - redefine tearDown func name to something else", - " --test_prefix=\"\" - redefine test prefix from default test|spec|should", - " --suite_setup=\"\" - code to execute for setup of entire suite", - " --suite_teardown=\"\" - code to execute for teardown of entire suite", - " --use_param_tests=1 - enable parameterized tests (disabled by default)", - " --header_file=\"\" - path/name of test header file to generate too" - ].join("\n") - exit 1 - end - - #create the default test runner name if not specified - ARGV[1] = ARGV[0].gsub(".c","_Runner.c") if (!ARGV[1]) - - - UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1]) -end diff --git a/components/testframework/libs/testframework/unity/auto/parseOutput.rb b/components/testframework/libs/testframework/unity/auto/parseOutput.rb deleted file mode 100644 index 7ea180f4c..000000000 --- a/components/testframework/libs/testframework/unity/auto/parseOutput.rb +++ /dev/null @@ -1,191 +0,0 @@ -#============================================================ -# Author: John Theofanopoulos -# A simple parser. Takes the output files generated during the build process and -# extracts information relating to the tests. -# -# Notes: -# To capture an output file under VS builds use the following: -# devenv [build instructions] > Output.txt & type Output.txt -# -# To capture an output file under GCC/Linux builds use the following: -# make | tee Output.txt -# -# To use this parser use the following command -# ruby parseOutput.rb [options] [file] -# options: -xml : produce a JUnit compatible XML file -# file : file to scan for results -#============================================================ - - -class ParseOutput -# The following flag is set to true when a test is found or false otherwise. - @testFlag - @xmlOut - @arrayList - @totalTests - @classIndex - -# Set the flag to indicate if there will be an XML output file or not - def setXmlOutput() - @xmlOut = true - end - -# if write our output to XML - def writeXmlOuput() - output = File.open("report.xml", "w") - output << "\n" - @arrayList.each do |item| - output << item << "\n" - end - output << "\n" - end - -# This function will try and determine when the suite is changed. This is -# is the name that gets added to the classname parameter. - def testSuiteVerify(testSuiteName) - if @testFlag == false - @testFlag = true; - # Split the path name - testName = testSuiteName.split("/") - # Remove the extension - baseName = testName[testName.size - 1].split(".") - @testSuite = "test." + baseName[0] - printf "New Test: %s\n", @testSuite - end - end - - -# Test was flagged as having passed so format the output - def testPassed(array) - lastItem = array.length - 1 - testName = array[lastItem - 1] - testSuiteVerify(array[@className]) - printf "%-40s PASS\n", testName - if @xmlOut == true - @arrayList.push " " - end - end - -# Test was flagged as being ingored so format the output - def testIgnored(array) - lastItem = array.length - 1 - testName = array[lastItem - 2] - reason = array[lastItem].chomp - testSuiteVerify(array[@className]) - printf "%-40s IGNORED\n", testName - if @xmlOut == true - @arrayList.push " " - @arrayList.push " " + reason + " " - @arrayList.push " " - end - end - -# Test was flagged as having failed so format the line - def testFailed(array) - lastItem = array.length - 1 - testName = array[lastItem - 2] - reason = array[lastItem].chomp + " at line: " + array[lastItem - 3] - testSuiteVerify(array[@className]) - printf "%-40s FAILED\n", testName - if @xmlOut == true - @arrayList.push " " - @arrayList.push " " + reason + " " - @arrayList.push " " - end - end - - -# Figure out what OS we are running on. For now we are assuming if it's not Windows it must -# be Unix based. - def detectOS() - myOS = RUBY_PLATFORM.split("-") - if myOS.size == 2 - if myOS[1] == "mingw32" - @className = 1 - else - @className = 0 - end - else - @className = 0 - end - - end - -# Main function used to parse the file that was captured. - def process(name) - @testFlag = false - @arrayList = Array.new - - detectOS() - - puts "Parsing file: " + name - - - testPass = 0 - testFail = 0 - testIgnore = 0 - puts "" - puts "=================== RESULTS =====================" - puts "" - File.open(name).each do |line| - # Typical test lines look like this: - # /.c:36:test_tc1000_opsys:FAIL: Expected 1 Was 0 - # /.c:112:test_tc5004_initCanChannel:IGNORE: Not Yet Implemented - # /.c:115:test_tc5100_initCanVoidPtrs:PASS - # - # where path is different on Unix vs Windows devices (Windows leads with a drive letter) - lineArray = line.split(":") - lineSize = lineArray.size - # If we were able to split the line then we can look to see if any of our target words - # were found. Case is important. - if lineSize >= 4 - # Determine if this test passed - if line.include? ":PASS" - testPassed(lineArray) - testPass += 1 - elsif line.include? ":FAIL:" - testFailed(lineArray) - testFail += 1 - elsif line.include? ":IGNORE:" - testIgnored(lineArray) - testIgnore += 1 - # If none of the keywords are found there are no more tests for this suite so clear - # the test flag - else - @testFlag = false - end - else - @testFlag = false - end - end - puts "" - puts "=================== SUMMARY =====================" - puts "" - puts "Tests Passed : " + testPass.to_s - puts "Tests Failed : " + testFail.to_s - puts "Tests Ignored : " + testIgnore.to_s - @totalTests = testPass + testFail + testIgnore - if @xmlOut == true - heading = "" - @arrayList.insert(0, heading) - writeXmlOuput() - end - - # return result - end - - end - -# If the command line has no values in, used a default value of Output.txt -parseMyFile = ParseOutput.new - -if ARGV.size >= 1 - ARGV.each do |a| - if a == "-xml" - parseMyFile.setXmlOutput(); - else - parseMyFile.process(a) - break - end - end -end diff --git a/components/testframework/libs/testframework/unity/auto/test_file_filter.rb b/components/testframework/libs/testframework/unity/auto/test_file_filter.rb deleted file mode 100644 index 3dbc26a28..000000000 --- a/components/testframework/libs/testframework/unity/auto/test_file_filter.rb +++ /dev/null @@ -1,23 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -require'yaml' - -module RakefileHelpers - class TestFileFilter - def initialize(all_files = false) - @all_files = all_files - if not @all_files == true - if File.exist?('test_file_filter.yml') - filters = YAML.load_file( 'test_file_filter.yml' ) - @all_files, @only_files, @exclude_files = - filters[:all_files], filters[:only_files], filters[:exclude_files] - end - end - end - attr_accessor :all_files, :only_files, :exclude_files - end -end diff --git a/components/testframework/libs/testframework/unity/auto/type_sanitizer.rb b/components/testframework/libs/testframework/unity/auto/type_sanitizer.rb deleted file mode 100644 index 7c2c0ac2c..000000000 --- a/components/testframework/libs/testframework/unity/auto/type_sanitizer.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TypeSanitizer - - def self.sanitize_c_identifier(unsanitized) - # convert filename to valid C identifier by replacing invalid chars with '_' - return unsanitized.gsub(/[-\/\\\.\,\s]/, "_") - end - -end diff --git a/components/testframework/libs/testframework/unity/auto/unity_test_summary.py b/components/testframework/libs/testframework/unity/auto/unity_test_summary.py deleted file mode 100644 index f25fe31a4..000000000 --- a/components/testframework/libs/testframework/unity/auto/unity_test_summary.py +++ /dev/null @@ -1,135 +0,0 @@ -#! python3 -# ========================================== -# Unity Project - A Test Framework for C -# Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de -# [Released under MIT License. Please refer to license.txt for details] -# Based on the ruby script by Mike Karlesky, Mark VanderVoord, Greg Williams -# ========================================== -import sys -import os -import re -from glob import glob - -class UnityTestSummary: - def __init__(self): - self.report = '' - self.total_tests = 0 - self.failures = 0 - self.ignored = 0 - - def run(self): - # Clean up result file names - results = [] - for target in self.targets: - results.append(target.replace('\\', '/')) - - # Dig through each result file, looking for details on pass/fail: - failure_output = [] - ignore_output = [] - - for result_file in results: - lines = list([line.rstrip() for line in open(result_file, "r").read().split('\n')]) - if len(lines) == 0: - raise Exception("Empty test result file: %s" % result_file) - - details = self.get_details(result_file, lines) - failures = details['failures'] - ignores = details['ignores'] - if len(failures) > 0: failure_output.append('\n'.join(failures)) - if len(ignores) > 0: ignore_output.append('n'.join(ignores)) - tests,failures,ignored = self.parse_test_summary('\n'.join(lines)) - self.total_tests += tests - self.failures += failures - self.ignored += ignored - - if self.ignored > 0: - self.report += "\n" - self.report += "--------------------------\n" - self.report += "UNITY IGNORED TEST SUMMARY\n" - self.report += "--------------------------\n" - self.report += "\n".join(ignore_output) - - if self.failures > 0: - self.report += "\n" - self.report += "--------------------------\n" - self.report += "UNITY FAILED TEST SUMMARY\n" - self.report += "--------------------------\n" - self.report += '\n'.join(failure_output) - - self.report += "\n" - self.report += "--------------------------\n" - self.report += "OVERALL UNITY TEST SUMMARY\n" - self.report += "--------------------------\n" - self.report += "{total_tests} TOTAL TESTS {failures} TOTAL FAILURES {ignored} IGNORED\n".format(total_tests = self.total_tests, failures=self.failures, ignored=self.ignored) - self.report += "\n" - - return self.report - - def set_targets(self, target_array): - self.targets = target_array - - def set_root_path(self, path): - self.root = path - - def usage(self, err_msg=None): - print("\nERROR: ") - if err_msg: - print(err_msg) - print("\nUsage: unity_test_summary.py result_file_directory/ root_path/") - print(" result_file_directory - The location of your results files.") - print(" Defaults to current directory if not specified.") - print(" Should end in / if specified.") - print(" root_path - Helpful for producing more verbose output if using relative paths.") - sys.exit(1) - - def get_details(self, result_file, lines): - results = { 'failures': [], 'ignores': [], 'successes': [] } - for line in lines: - parts = line.split(':') - if len(parts) != 5: - continue - src_file,src_line,test_name,status,msg = parts - if len(self.root) > 0: - line_out = "%s%s" % (self.root, line) - else: - line_out = line - if status == 'IGNORE': - results['ignores'].append(line_out) - elif status == 'FAIL': - results['failures'].append(line_out) - elif status == 'PASS': - results['successes'].append(line_out) - return results - - def parse_test_summary(self, summary): - m = re.search(r"([0-9]+) Tests ([0-9]+) Failures ([0-9]+) Ignored", summary) - if not m: - raise Exception("Couldn't parse test results: %s" % summary) - - return int(m.group(1)), int(m.group(2)), int(m.group(3)) - - -if __name__ == '__main__': - uts = UnityTestSummary() - try: - #look in the specified or current directory for result files - if len(sys.argv) > 1: - targets_dir = sys.argv[1] - else: - targets_dir = './' - targets = list([x.replace('\\', '/') for x in glob(targets_dir + '*.test*')]) - if len(targets) == 0: - raise Exception("No *.testpass or *.testfail files found in '%s'" % targets_dir) - uts.set_targets(targets) - - #set the root path - if len(sys.argv) > 2: - root_path = sys.argv[2] - else: - root_path = os.path.split(__file__)[0] - uts.set_root_path(root_path) - - #run the summarizer - print((uts.run())) - except Exception as e: - uts.usage(e) diff --git a/components/testframework/libs/testframework/unity/auto/unity_test_summary.rb b/components/testframework/libs/testframework/unity/auto/unity_test_summary.rb deleted file mode 100644 index 39e309420..000000000 --- a/components/testframework/libs/testframework/unity/auto/unity_test_summary.rb +++ /dev/null @@ -1,148 +0,0 @@ -# ========================================== -# 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] -# ========================================== - -#!/usr/bin/ruby -# -# unity_test_summary.rb -# -require 'fileutils' -require 'set' - -class UnityTestSummary - include FileUtils::Verbose - - attr_reader :report, :total_tests, :failures, :ignored - - def initialize(opts = {}) - @report = '' - @total_tests = 0 - @failures = 0 - @ignored = 0 - - - end - - def run - # Clean up result file names - results = @targets.map {|target| target.gsub(/\\/,'/')} - - # Dig through each result file, looking for details on pass/fail: - failure_output = [] - ignore_output = [] - - results.each do |result_file| - lines = File.readlines(result_file).map { |line| line.chomp } - if lines.length == 0 - raise "Empty test result file: #{result_file}" - else - output = get_details(result_file, lines) - failure_output << output[:failures] unless output[:failures].empty? - ignore_output << output[:ignores] unless output[:ignores].empty? - tests,failures,ignored = parse_test_summary(lines) - @total_tests += tests - @failures += failures - @ignored += ignored - end - end - - if @ignored > 0 - @report += "\n" - @report += "--------------------------\n" - @report += "UNITY IGNORED TEST SUMMARY\n" - @report += "--------------------------\n" - @report += ignore_output.flatten.join("\n") - end - - if @failures > 0 - @report += "\n" - @report += "--------------------------\n" - @report += "UNITY FAILED TEST SUMMARY\n" - @report += "--------------------------\n" - @report += failure_output.flatten.join("\n") - end - - @report += "\n" - @report += "--------------------------\n" - @report += "OVERALL UNITY TEST SUMMARY\n" - @report += "--------------------------\n" - @report += "#{@total_tests} TOTAL TESTS #{@failures} TOTAL FAILURES #{@ignored} IGNORED\n" - @report += "\n" - end - - def set_targets(target_array) - @targets = target_array - end - - def set_root_path(path) - @root = path - end - - def usage(err_msg=nil) - puts "\nERROR: " - puts err_msg if err_msg - puts "\nUsage: unity_test_summary.rb result_file_directory/ root_path/" - puts " result_file_directory - The location of your results files." - puts " Defaults to current directory if not specified." - puts " Should end in / if specified." - puts " root_path - Helpful for producing more verbose output if using relative paths." - exit 1 - end - - protected - - def get_details(result_file, lines) - results = { :failures => [], :ignores => [], :successes => [] } - lines.each do |line| - src_file,src_line,test_name,status,msg = line.split(/:/) - line_out = ((@root && (@root != 0)) ? "#{@root}#{line}" : line ).gsub(/\//, "\\") - case(status) - when 'IGNORE' then results[:ignores] << line_out - when 'FAIL' then results[:failures] << line_out - when 'PASS' then results[:successes] << line_out - end - end - return results - end - - def parse_test_summary(summary) - if summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ } - [$1.to_i,$2.to_i,$3.to_i] - else - raise "Couldn't parse test results: #{summary}" - end - end - - def here; File.expand_path(File.dirname(__FILE__)); end - -end - -if $0 == __FILE__ - - #parse out the command options - opts, args = ARGV.partition {|v| v =~ /^--\w+/} - opts.map! {|v| v[2..-1].to_sym } - - #create an instance to work with - uts = UnityTestSummary.new(opts) - - begin - #look in the specified or current directory for result files - args[0] ||= './' - targets = "#{ARGV[0].gsub(/\\/, '/')}**/*.test*" - results = Dir[targets] - raise "No *.testpass, *.testfail, or *.testresults files found in '#{targets}'" if results.empty? - uts.set_targets(results) - - #set the root path - args[1] ||= Dir.pwd + '/' - uts.set_root_path(ARGV[1]) - - #run the summarizer - puts uts.run - rescue Exception => e - uts.usage e.message - end -end diff --git a/components/testframework/libs/testframework/unity/c51/unity_print.c b/components/testframework/libs/testframework/unity/c51/unity_print.c deleted file mode 100644 index 93afdbcb8..000000000 --- a/components/testframework/libs/testframework/unity/c51/unity_print.c +++ /dev/null @@ -1,97 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ - -#include "../unity_print.h" -#include -#include "reg51.h" - -sfr SFRPAGE = 0xFF; -sfr UART0BRL = 0xAF; -sfr UARTCON = 0xEC; -sfr UARTSTAT = 0xED; -sfr UART0BUF = 0xEF; - -sfr WDTCON = 0xE4; - -#define WDTCON_PAGE SFRPAGE=0x02 -#define WATCHDOG_DISABLE {WDTCON_PAGE; WDTCON = WDTCON_NOTIFY_BIT; WDTCON = 0;} -#define WDTCON_NOTIFY_BIT 0x04 - -#define UARTCON_PAGE -#define UARTSTAT_PAGE -#define UART0BUF_PAGE /* ANY */ -#define UART0BRL_PAGE SFRPAGE=0x02 -#define UART0BRL_BRL0_BITS 0xFF - -#define UARTCON_CTX1_BIT 0x80 -#define UARTCON_REN1_BIT 0x40 -#define UARTCON_CTX0_BIT 0x08 -#define UARTCON_REN0_BIT 0x04 -#define UARTCON_BRH0_BITS 0x03 - -#define UARTSTAT_TA0_BIT 0x01 - -sfr RSETVEC = 0xE6; -#define RSETVEC_PORTKEEP_BIT 0x40 -#define RSETVEC_PAGE SFRPAGE=0x02 - -#define SFR_AND(r,v) {r##_PAGE;r=(r&v);} -#define SFR_SET(r,v) {r##_PAGE;r=v;} -#define SFR_OR(r,v) {r##_PAGE;r=(r|v);} - -#define OPEN_IOS {SFR_AND(RSETVEC,~RSETVEC_PORTKEEP_BIT);} - -#define UART0_SET_BAUD_RATE(BAUD_TIMER) {SFR_AND(UARTCON, ~UARTCON_BRH0_BITS);\ - SFR_OR(UARTCON,((BAUD_TIMER & 0x0300) >> 8));\ - SFR_SET(UART0BRL, (BAUD_TIMER & (0x00FF)));\ - } -#define UART0_TX_WRITE_BUFFER(TX_DATA) {SFR_SET(UART0BUF, TX_DATA);} -#define UART0_TX_ENABLE {SFR_OR(UARTCON, UARTCON_CTX0_BIT);} -#define UART0_TX_ACTIVE_GET (UARTSTAT & UARTSTAT_TA0_BIT) - - -void unity_print_init(void) -{ -#if 1 - SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */ - TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */ - TH1 = 0xf3; /* TH1: reload value for 2400 baud */ - TR1 = 1; /* TR1: timer 1 run */ - TI = 1; /* TI: set TI to send first char of UART */ -#else - int bBaudRate; - WATCHDOG_DISABLE; - bBaudRate = 1152; - bBaudRate = (80000/bBaudRate ) + (((80000 %bBaudRate ) >= (bBaudRate >> 1)) ? 1:0); - UART0_SET_BAUD_RATE(68); - UART0_TX_ENABLE; - - OPEN_IOS - UART0BUF = '*'; -#endif - -} - -#if 0 -char -putchar( - char c) /* IN a byte to write to the UART transmit register.*/ -{ - while(UART0_TX_ACTIVE_GET); - UART0_TX_WRITE_BUFFER(c); - return c; -} -#endif - -void unity_print_close(void) -{ - // Do nothing. -} - -int ZW_putchar(int c) -{ - while(UART0_TX_ACTIVE_GET); - UART0_TX_WRITE_BUFFER(c); - return c; -} - diff --git a/components/testframework/libs/testframework/unity/generic/unity_print.c b/components/testframework/libs/testframework/unity/generic/unity_print.c deleted file mode 100644 index d7f312ac3..000000000 --- a/components/testframework/libs/testframework/unity/generic/unity_print.c +++ /dev/null @@ -1,27 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ - -#include "../unity_print.h" -#include -#include - - -void unity_print_init(void) -{ - // Do nothing. On i386 output is automatically sent to stdout. - // Disable all print buffering. This ensures output is written to stdout as early as possible - // and minimizes risk of lost print messages if program seg faults. - setvbuf(stdout, NULL, _IONBF, 0); - setvbuf(stderr, NULL, _IONBF, 0); -} - -void unity_print_close(void) -{ - // Do nothing. On i386 output is automatically sent to stdout. -} - -int ZW_putchar(int c) -{ - return putchar(c); -} - diff --git a/components/testframework/libs/testframework/unity/license.txt b/components/testframework/libs/testframework/unity/license.txt deleted file mode 100644 index d0f635fa3..000000000 --- a/components/testframework/libs/testframework/unity/license.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams - -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. diff --git a/components/testframework/libs/testframework/unity/unity.c b/components/testframework/libs/testframework/unity/unity.c deleted file mode 100644 index ebe6fd5e6..000000000 --- a/components/testframework/libs/testframework/unity/unity.c +++ /dev/null @@ -1,1323 +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] -============================================================================ */ - -#include "unity.h" - -#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); } -#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); } -/// return prematurely if we are already in failure or ignore state -#define UNITY_SKIP_EXECUTION { if ((Unity.CurrentTestFailed != 0) || (Unity.CurrentTestIgnored != 0)) {return;} } -#define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\n'); } - -struct _Unity Unity; - -const char UnityStrOk[] = "OK"; -const char UnityStrPass[] = " "; -const char UnityStrFail[] = " "; -const char UnityStrIgnore[] = "IGNORE"; -const char UnityStrNull[] = "NULL"; -const char UnityStrSpacer[] = ". "; -const char UnityStrExpected[] = " Expected "; -const char UnityStrWas[] = " Was "; -const char UnityStrTo[] = " To "; -const char UnityStrElement[] = " Element "; -const char UnityStrByte[] = " Byte "; -const char UnityStrMemory[] = " Memory Mismatch."; -const char UnityStrDelta[] = " Values Not Within Delta "; -const char UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless."; -const char UnityStrNullPointerForExpected[] = " Expected pointer to be NULL"; -const char UnityStrNullPointerForActual[] = " Actual pointer was NULL"; -const char UnityStrNot[] = "Not "; -const char UnityStrInf[] = "Infinity"; -const char UnityStrNegInf[] = "Negative Infinity"; -const char UnityStrNaN[] = "NaN"; -const char UnityStrDet[] = "Determinate"; -const char UnityStrErrFloat[] = "Unity Floating Point Disabled"; -const char UnityStrErrDouble[] = "Unity Double Precision Disabled"; -const char UnityStrErr64[] = "Unity 64-bit Support Disabled"; -const char UnityStrBreaker[] = "-----------------------"; -const char UnityStrResultsTests[] = " Tests "; -const char UnityStrResultsFailures[] = " Failures "; -const char UnityStrResultsIgnored[] = " Ignored "; - -#ifndef UNITY_EXCLUDE_FLOAT -// Dividing by these constants produces +/- infinity. -// The rationale is given in UnityAssertFloatIsInf's body. -static const _UF f_zero = 0.0f; -#ifndef UNITY_EXCLUDE_DOUBLE -static const _UD d_zero = 0.0; -#endif -#endif - -// compiler-generic print formatting masks -const _U_UINT UnitySizeMask[] = -{ - 255u, // 0xFF - 65535u, // 0xFFFF - 65535u, - 4294967295u, // 0xFFFFFFFF - 4294967295u, - 4294967295u, - 4294967295u -#ifdef UNITY_SUPPORT_64 - ,0xFFFFFFFFFFFFFFFF -#endif -}; - -void UnityPrintFail(void); -void UnityPrintOk(void); - -//----------------------------------------------- -// Pretty Printers & Test Result Output Handlers -//----------------------------------------------- - -void UnityPrint(const char* string) -{ - const char* pch = string; - - if (pch != NULL) - { - while (*pch) - { - // printable characters plus CR & LF are printed - if ((*pch <= 126) && (*pch >= 32)) - { - UNITY_OUTPUT_CHAR(*pch); - } - //write escaped carriage returns - else if (*pch == 13) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('r'); - } - //write escaped line feeds - else if (*pch == 10) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('n'); - } - // unprintable characters are shown as codes - else - { - UNITY_OUTPUT_CHAR('\\'); - UnityPrintNumberHex((_U_UINT)*pch, 2); - } - pch++; - } - } -} - -void UnityPrintLen(const char* string, const _UU32 length); -void UnityPrintLen(const char* string, const _UU32 length) -{ - const char* pch = string; - - if (pch != NULL) - { - while (*pch && (pch - string) < length) - { - // printable characters plus CR & LF are printed - if ((*pch <= 126) && (*pch >= 32)) - { - UNITY_OUTPUT_CHAR(*pch); - } - //write escaped carriage returns - else if (*pch == 13) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('r'); - } - //write escaped line feeds - else if (*pch == 10) - { - UNITY_OUTPUT_CHAR('\\'); - UNITY_OUTPUT_CHAR('n'); - } - // unprintable characters are shown as codes - else - { - UNITY_OUTPUT_CHAR('\\'); - UnityPrintNumberHex((_U_UINT)*pch, 2); - } - pch++; - } - } -} - -//----------------------------------------------- -void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T style) -{ - if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) - { - UnityPrintNumber(number); - } - else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) - { - UnityPrintNumberUnsigned( (_U_UINT)number & UnitySizeMask[((_U_UINT)style & (_U_UINT)0x0F) - 1] ); - } - else - { - UnityPrintNumberHex((_U_UINT)number, (char)((style & 0x000F) << 1)); - } -} - -//----------------------------------------------- -/// basically do an itoa using as little ram as possible -void UnityPrintNumber(const _U_SINT number_to_print) -{ -#ifdef __codasip__ - _U_UINT nibbles = 0; - _U_UINT tmp; - tmp = number_to_print; - do - { - tmp >>= 4; - nibbles++; - } - while (tmp > 0); - UnityPrintNumberHex(number_to_print , nibbles); -#else - _U_SINT divisor = 1; - _U_SINT next_divisor; - _U_UINT number; - if (number_to_print == (1l << (UNITY_LONG_WIDTH-1))) - { - //The largest representable negative number - UNITY_OUTPUT_CHAR('-'); - number = (1ul << (UNITY_LONG_WIDTH-1)); - } - else if (number_to_print < 0) - { - //Some other negative number - UNITY_OUTPUT_CHAR('-'); - number = (_U_UINT)(-number_to_print); - } - else - { - //Positive number - number = (_U_UINT)number_to_print; - } - - // figure out initial divisor - while (number / divisor > 9) - { - next_divisor = divisor * 10; - if (next_divisor > divisor) - divisor = next_divisor; - else - break; - } - - // now mod and print, then divide divisor - do - { - UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10))); - divisor /= 10; - } - while (divisor > 0); -#endif /* __codasip__ */ -} - -//----------------------------------------------- -/// basically do an itoa using as little ram as possible -void UnityPrintNumberUnsigned(const _U_UINT number) -{ -#ifdef __codasip__ - _U_UINT nibbles = 0; - _U_UINT tmp; - tmp = number; - do - { - tmp = tmp >> 4; - nibbles++; - } - while (tmp > 0); - UnityPrintNumberHex(number, nibbles); -#else - _U_UINT divisor = 1; - _U_UINT next_divisor; - // figure out initial divisor - while (number / divisor > 9) - { - next_divisor = divisor * 10; - if (next_divisor > divisor) - divisor = next_divisor; - else - break; - } - - // now mod and print, then divide divisor - do - { - UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10))); - divisor /= 10; - } - while (divisor > 0); -#endif /* __codasip__ */ -} - -//----------------------------------------------- -void UnityPrintNumberHex(const _U_UINT number, const char nibbles_to_print) -{ - _U_UINT nibble; - char nibbles = nibbles_to_print; - UNITY_OUTPUT_CHAR('0'); - UNITY_OUTPUT_CHAR('x'); - - while (nibbles > 0) - { - nibble = (number >> (--nibbles << 2)) & 0x0000000F; - if (nibble <= 9) - { - UNITY_OUTPUT_CHAR((char)('0' + nibble)); - } - else - { - UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble)); - } - } -} - -//----------------------------------------------- -void UnityPrintMask(const _U_UINT mask, const _U_UINT number) -{ - _U_UINT current_bit = (_U_UINT)1 << (UNITY_INT_WIDTH - 1); - _US32 i; - - for (i = 0; i < UNITY_INT_WIDTH; i++) - { - if (current_bit & mask) - { - if (current_bit & number) - { - UNITY_OUTPUT_CHAR('1'); - } - else - { - UNITY_OUTPUT_CHAR('0'); - } - } - else - { - UNITY_OUTPUT_CHAR('X'); - } - current_bit = current_bit >> 1; - } -} - -//----------------------------------------------- -#ifdef UNITY_FLOAT_VERBOSE -#include -void UnityPrintFloat(_UF number) -{ - char TempBuffer[32]; - sprintf(TempBuffer, "%.6f", number); - UnityPrint(TempBuffer); -} -#endif - -//----------------------------------------------- - -void UnityPrintFail(void); -void UnityPrintFail(void) -{ - UnityPrint(UnityStrFail); -} - -void UnityPrintOk(void); -void UnityPrintOk(void) -{ - UnityPrint(UnityStrOk); -} - -//----------------------------------------------- -static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line); -static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line) -{ -#ifndef UNITY_FIXTURES - UnityPrint(file); - UNITY_OUTPUT_CHAR(':'); - UnityPrintNumber((_U_SINT)line); - UNITY_OUTPUT_CHAR(':'); - UnityPrint(Unity.CurrentTestName); - UNITY_OUTPUT_CHAR(':'); -#else - UNITY_UNUSED(file); - UNITY_UNUSED(line); -#endif -} - -//----------------------------------------------- -static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line); -static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line) -{ -#ifndef UNITY_FIXTURES - UnityTestResultsBegin(Unity.TestFile, line); -#else - UNITY_UNUSED(line); -#endif - UnityPrint(UnityStrFail); - UNITY_OUTPUT_CHAR(':'); -} - -//----------------------------------------------- -void UnityConcludeTest(void) -{ - if (Unity.CurrentTestIgnored) - { - Unity.TestIgnores++; - } - else if (!Unity.CurrentTestFailed) - { - UnityTestResultsBegin(Unity.TestFile, Unity.CurrentTestLineNumber); - UnityPrint(UnityStrPass); - } - else - { - Unity.TestFailures++; - } - - Unity.CurrentTestFailed = 0; - Unity.CurrentTestIgnored = 0; - UNITY_PRINT_EOL; -} - -//----------------------------------------------- -static void UnityAddMsgIfSpecified(const char* msg); -static void UnityAddMsgIfSpecified(const char* msg) -{ - if (msg) - { - UnityPrint(UnityStrSpacer); - UnityPrint(msg); - } -} - -//----------------------------------------------- -static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual); -static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual) -{ - UnityPrint(UnityStrExpected); - if (expected != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrint(expected); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } - UnityPrint(UnityStrWas); - if (actual != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrint(actual); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } -} - -//----------------------------------------------- -static void UnityPrintExpectedAndActualStringsLen(const char* expected, const char* actual, const _UU32 length) -{ - UnityPrint(UnityStrExpected); - if (expected != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrintLen(expected, length); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } - UnityPrint(UnityStrWas); - if (actual != NULL) - { - UNITY_OUTPUT_CHAR('\''); - UnityPrintLen(actual, length); - UNITY_OUTPUT_CHAR('\''); - } - else - { - UnityPrint(UnityStrNull); - } -} - - - -//----------------------------------------------- -// Assertion & Control Helpers -//----------------------------------------------- - -static int UnityCheckArraysForNull(UNITY_PTR_ATTRIBUTE const void* expected, UNITY_PTR_ATTRIBUTE const void* actual, const UNITY_LINE_TYPE lineNumber, const char* msg) -{ - //return true if they are both NULL - if ((expected == NULL) && (actual == NULL)) - return 1; - - //throw error if just expected is NULL - if (expected == NULL) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrNullPointerForExpected); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - //throw error if just actual is NULL - if (actual == NULL) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrNullPointerForActual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - //return false if neither is NULL - return 0; -} - -//----------------------------------------------- -// Assertion Functions -//----------------------------------------------- - -void UnityAssertBits(const _U_SINT mask, - const _U_SINT expected, - const _U_SINT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - UNITY_SKIP_EXECUTION; - - if ((mask & expected) != (mask & actual)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - UnityPrintMask((_U_UINT)mask, (_U_UINT)expected); - UnityPrint(UnityStrWas); - UnityPrintMask((_U_UINT)mask, (_U_UINT)actual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- -void UnityAssertEqualNumber(const _U_SINT expected, - const _U_SINT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style) -{ - UNITY_SKIP_EXECUTION; - - if (expected != actual) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expected, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- -void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected, - UNITY_PTR_ATTRIBUTE const void* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style) -{ - _UU32 elements = num_elements; - UNITY_PTR_ATTRIBUTE const void* ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)expected; - UNITY_PTR_ATTRIBUTE const void* ptr_act = (UNITY_PTR_ATTRIBUTE const void*)actual; - - UNITY_SKIP_EXECUTION; - - if (elements == 0) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrPointless); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE const void*)expected, (UNITY_PTR_ATTRIBUTE const void*)actual, lineNumber, msg) == 1) - return; - - // If style is UNITY_DISPLAY_STYLE_INT, we'll fall into the default case rather than the INT16 or INT32 (etc) case - // as UNITY_DISPLAY_STYLE_INT includes a flag for UNITY_DISPLAY_RANGE_AUTO, which the width-specific - // variants do not. Therefore remove this flag. - switch(style & (UNITY_DISPLAY_STYLE_T)(~UNITY_DISPLAY_RANGE_AUTO)) - { - case UNITY_DISPLAY_STYLE_HEX8: - case UNITY_DISPLAY_STYLE_INT8: - case UNITY_DISPLAY_STYLE_UINT8: - while (elements--) - { - if (*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US8*)ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_exp, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_act, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 1); - ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 1); - } - break; - case UNITY_DISPLAY_STYLE_HEX16: - case UNITY_DISPLAY_STYLE_INT16: - case UNITY_DISPLAY_STYLE_UINT16: - while (elements--) - { - if (*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US16*)ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_exp, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_act, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 2); - ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 2); - } - break; -#ifdef UNITY_SUPPORT_64 - case UNITY_DISPLAY_STYLE_HEX64: - case UNITY_DISPLAY_STYLE_INT64: - case UNITY_DISPLAY_STYLE_UINT64: - while (elements--) - { - if (*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US64*)ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_exp, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_act, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 8); - ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 8); - } - break; -#endif - default: - while (elements--) - { - if (*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US32*)ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_exp, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_act, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 4); - ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 4); - } - break; - } -} - -//----------------------------------------------- -#ifndef UNITY_EXCLUDE_FLOAT -void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected, - UNITY_PTR_ATTRIBUTE const _UF* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UU32 elements = num_elements; - UNITY_PTR_ATTRIBUTE const _UF* ptr_expected = expected; - UNITY_PTR_ATTRIBUTE const _UF* ptr_actual = actual; - _UF diff, tol; - - UNITY_SKIP_EXECUTION; - - if (elements == 0) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrPointless); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE const void*)expected, (UNITY_PTR_ATTRIBUTE const void*)actual, lineNumber, msg) == 1) - return; - - while (elements--) - { - diff = *ptr_expected - *ptr_actual; - if (diff < 0.0f) - diff = 0.0f - diff; - tol = UNITY_FLOAT_PRECISION * *ptr_expected; - if (tol < 0.0f) - tol = 0.0f - tol; - - //This first part of this condition will catch any NaN or Infinite values - if ((diff * 0.0f != 0.0f) || (diff > tol)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); -#ifdef UNITY_FLOAT_VERBOSE - UnityPrint(UnityStrExpected); - UnityPrintFloat(*ptr_expected); - UnityPrint(UnityStrWas); - UnityPrintFloat(*ptr_actual); -#else - UnityPrint(UnityStrDelta); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_expected++; - ptr_actual++; - } -} - -//----------------------------------------------- -void UnityAssertFloatsWithin(const _UF delta, - const _UF expected, - const _UF actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UF diff = actual - expected; - _UF pos_delta = delta; - - UNITY_SKIP_EXECUTION; - - if (diff < 0.0f) - { - diff = 0.0f - diff; - } - if (pos_delta < 0.0f) - { - pos_delta = 0.0f - pos_delta; - } - - //This first part of this condition will catch any NaN or Infinite values - if ((diff * 0.0f != 0.0f) || (pos_delta < diff)) - { - UnityTestResultsFailBegin(lineNumber); -#ifdef UNITY_FLOAT_VERBOSE - UnityPrint(UnityStrExpected); - UnityPrintFloat(expected); - UnityPrint(UnityStrWas); - UnityPrintFloat(actual); -#else - UnityPrint(UnityStrDelta); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- -void UnityAssertFloatSpecial(const _UF actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style) -{ - const char* trait_names[] = { UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet }; - _U_SINT should_be_trait = ((_U_SINT)style & 1); - _U_SINT is_trait = !should_be_trait; - _U_SINT trait_index = style >> 1; - - UNITY_SKIP_EXECUTION; - - switch(style) - { - //To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly - //We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise - case UNITY_FLOAT_IS_INF: - case UNITY_FLOAT_IS_NOT_INF: - is_trait = ((1.0f / f_zero) == actual) ? 1 : 0; - break; - case UNITY_FLOAT_IS_NEG_INF: - case UNITY_FLOAT_IS_NOT_NEG_INF: - is_trait = ((-1.0f / f_zero) == actual) ? 1 : 0; - break; - - //NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN. - case UNITY_FLOAT_IS_NAN: - case UNITY_FLOAT_IS_NOT_NAN: - is_trait = (actual == actual) ? 0 : 1; - break; - - //A determinate number is non infinite and not NaN. (therefore the opposite of the two above) - case UNITY_FLOAT_IS_DET: - case UNITY_FLOAT_IS_NOT_DET: - if ( (actual != actual) || ((1.0f / f_zero) == actual) || ((-1.0f / f_zero) == actual) ) - is_trait = 0; - else - is_trait = 1; - break; - default: - ; - } - - if (is_trait != should_be_trait) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - if (!should_be_trait) - UnityPrint(UnityStrNot); - UnityPrint(trait_names[trait_index]); - UnityPrint(UnityStrWas); -#ifdef UNITY_FLOAT_VERBOSE - UnityPrintFloat(actual); -#else - if (should_be_trait) - UnityPrint(UnityStrNot); - UnityPrint(trait_names[trait_index]); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -#endif //not UNITY_EXCLUDE_FLOAT - -//----------------------------------------------- -#ifndef UNITY_EXCLUDE_DOUBLE -void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected, - UNITY_PTR_ATTRIBUTE const _UD* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UU32 elements = num_elements; - UNITY_PTR_ATTRIBUTE const _UD* ptr_expected = expected; - UNITY_PTR_ATTRIBUTE const _UD* ptr_actual = actual; - _UD diff, tol; - - UNITY_SKIP_EXECUTION; - - if (elements == 0) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrPointless); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1) - return; - - while (elements--) - { - diff = *ptr_expected - *ptr_actual; - if (diff < 0.0) - diff = 0.0 - diff; - tol = UNITY_DOUBLE_PRECISION * *ptr_expected; - if (tol < 0.0) - tol = 0.0 - tol; - - //This first part of this condition will catch any NaN or Infinite values - if ((diff * 0.0 != 0.0) || (diff > tol)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); -#ifdef UNITY_DOUBLE_VERBOSE - UnityPrint(UnityStrExpected); - UnityPrintFloat((float)(*ptr_expected)); - UnityPrint(UnityStrWas); - UnityPrintFloat((float)(*ptr_actual)); -#else - UnityPrint(UnityStrDelta); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_expected++; - ptr_actual++; - } -} - -//----------------------------------------------- -void UnityAssertDoublesWithin(const _UD delta, - const _UD expected, - const _UD actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UD diff = actual - expected; - _UD pos_delta = delta; - - UNITY_SKIP_EXECUTION; - - if (diff < 0.0) - { - diff = 0.0 - diff; - } - if (pos_delta < 0.0) - { - pos_delta = 0.0 - pos_delta; - } - - //This first part of this condition will catch any NaN or Infinite values - if ((diff * 0.0 != 0.0) || (pos_delta < diff)) - { - UnityTestResultsFailBegin(lineNumber); -#ifdef UNITY_DOUBLE_VERBOSE - UnityPrint(UnityStrExpected); - UnityPrintFloat((float)expected); - UnityPrint(UnityStrWas); - UnityPrintFloat((float)actual); -#else - UnityPrint(UnityStrDelta); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- - -void UnityAssertDoubleSpecial(const _UD actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style) -{ - const char* trait_names[] = { UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet }; - _U_SINT should_be_trait = ((_U_SINT)style & 1); - _U_SINT is_trait = !should_be_trait; - _U_SINT trait_index = style >> 1; - - UNITY_SKIP_EXECUTION; - - switch(style) - { - //To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly - //We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise - case UNITY_FLOAT_IS_INF: - case UNITY_FLOAT_IS_NOT_INF: - is_trait = ((1.0 / d_zero) == actual) ? 1 : 0; - break; - case UNITY_FLOAT_IS_NEG_INF: - case UNITY_FLOAT_IS_NOT_NEG_INF: - is_trait = ((-1.0 / d_zero) == actual) ? 1 : 0; - break; - - //NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN. - case UNITY_FLOAT_IS_NAN: - case UNITY_FLOAT_IS_NOT_NAN: - is_trait = (actual == actual) ? 0 : 1; - break; - - //A determinate number is non infinite and not NaN. (therefore the opposite of the two above) - case UNITY_FLOAT_IS_DET: - case UNITY_FLOAT_IS_NOT_DET: - if ( (actual != actual) || ((1.0 / d_zero) == actual) || ((-1.0 / d_zero) == actual) ) - is_trait = 0; - else - is_trait = 1; - break; - default: - ; - } - - if (is_trait != should_be_trait) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrExpected); - if (!should_be_trait) - UnityPrint(UnityStrNot); - UnityPrint(trait_names[trait_index]); - UnityPrint(UnityStrWas); -#ifdef UNITY_DOUBLE_VERBOSE - UnityPrintFloat(actual); -#else - if (should_be_trait) - UnityPrint(UnityStrNot); - UnityPrint(trait_names[trait_index]); -#endif - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - - -#endif // not UNITY_EXCLUDE_DOUBLE - -//----------------------------------------------- -void UnityAssertNumbersWithin( const _U_SINT delta, - const _U_SINT expected, - const _U_SINT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style) -{ - UNITY_SKIP_EXECUTION; - - if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) - { - if (actual > expected) - Unity.CurrentTestFailed = ((actual - expected) > delta); - else - Unity.CurrentTestFailed = ((expected - actual) > delta); - } - else - { - if ((_U_UINT)actual > (_U_UINT)expected) - Unity.CurrentTestFailed = ((_U_UINT)(actual - expected) > (_U_UINT)delta); - else - Unity.CurrentTestFailed = ((_U_UINT)(expected - actual) > (_U_UINT)delta); - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrDelta); - UnityPrintNumberByStyle(delta, style); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(expected, style); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(actual, style); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- -void UnityAssertEqualString(const char* expected, - const char* actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UU32 i; - - UNITY_SKIP_EXECUTION; - - // if both pointers not null compare the strings - if (expected && actual) - { - for (i = 0; expected[i] || actual[i]; i++) - { - if (expected[i] != actual[i]) - { - Unity.CurrentTestFailed = 1; - break; - } - } - } - else - { // handle case of one pointers being null (if both null, test should pass) - if (expected != actual) - { - Unity.CurrentTestFailed = 1; - } - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrintExpectedAndActualStrings(expected, actual); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - -//----------------------------------------------- -void UnityAssertEqualStringLen(const char* expected, - const char* actual, - const _UU32 length, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UU32 i; - - UNITY_SKIP_EXECUTION; - - // if both pointers not null compare the strings - if (expected && actual) - { - for (i = 0; (expected[i] || actual[i]) && i < length; i++) - { - if (expected[i] != actual[i]) - { - Unity.CurrentTestFailed = 1; - break; - } - } - } - else - { // handle case of one pointers being null (if both null, test should pass) - if (expected != actual) - { - Unity.CurrentTestFailed = 1; - } - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrintExpectedAndActualStringsLen(expected, actual, length); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } -} - - -//----------------------------------------------- -void UnityAssertEqualStringArray( const char** expected, - const char** actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - _UU32 i, j = 0; - - UNITY_SKIP_EXECUTION; - - // if no elements, it's an error - if (num_elements == 0) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrPointless); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1) - return; - - do - { - // if both pointers not null compare the strings - if (expected[j] && actual[j]) - { - for (i = 0; expected[j][i] || actual[j][i]; i++) - { - if (expected[j][i] != actual[j][i]) - { - Unity.CurrentTestFailed = 1; - break; - } - } - } - else - { // handle case of one pointers being null (if both null, test should pass) - if (expected[j] != actual[j]) - { - Unity.CurrentTestFailed = 1; - } - } - - if (Unity.CurrentTestFailed) - { - UnityTestResultsFailBegin(lineNumber); - if (num_elements > 1) - { - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((j), UNITY_DISPLAY_STYLE_UINT); - } - UnityPrintExpectedAndActualStrings((const char*)(expected[j]), (const char*)(actual[j])); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - } while (++j < num_elements); -} - -//----------------------------------------------- -void UnityAssertEqualMemory( UNITY_PTR_ATTRIBUTE const void* expected, - UNITY_PTR_ATTRIBUTE const void* actual, - const _UU32 length, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber) -{ - UNITY_PTR_ATTRIBUTE const unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; - UNITY_PTR_ATTRIBUTE const unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE const unsigned char*)actual; - _UU32 elements = num_elements; - _UU32 bytes; - - UNITY_SKIP_EXECUTION; - - if ((elements == 0) || (length == 0)) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrPointless); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - - if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE const void*)expected, (UNITY_PTR_ATTRIBUTE const void*)actual, lineNumber, msg) == 1) - return; - - while (elements--) - { - ///////////////////////////////////// - bytes = length; - while (bytes--) - { - if (*ptr_exp != *ptr_act) - { - UnityTestResultsFailBegin(lineNumber); - UnityPrint(UnityStrMemory); - if (num_elements > 1) - { - UnityPrint(UnityStrElement); - UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT); - } - UnityPrint(UnityStrByte); - UnityPrintNumberByStyle((length - bytes - 1), UNITY_DISPLAY_STYLE_UINT); - UnityPrint(UnityStrExpected); - UnityPrintNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8); - UnityPrint(UnityStrWas); - UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8); - UnityAddMsgIfSpecified(msg); - UNITY_FAIL_AND_BAIL; - } - ptr_exp += 1; - ptr_act += 1; - } - ///////////////////////////////////// - - } -} - -//----------------------------------------------- -// Control Functions -//----------------------------------------------- - -void UnityFail(const char* msg, const UNITY_LINE_TYPE line) -{ - UNITY_SKIP_EXECUTION; - - UnityTestResultsBegin(Unity.TestFile, line); - UnityPrintFail(); - if (msg != NULL) - { - UNITY_OUTPUT_CHAR(':'); - if (msg[0] != ' ') - { - UNITY_OUTPUT_CHAR(' '); - } - UnityPrint(msg); - } - UNITY_FAIL_AND_BAIL; -} - -//----------------------------------------------- -void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line) -{ - UNITY_SKIP_EXECUTION; - - UnityTestResultsBegin(Unity.TestFile, line); - UnityPrint(UnityStrIgnore); - if (msg != NULL) - { - UNITY_OUTPUT_CHAR(':'); - UNITY_OUTPUT_CHAR(' '); - UnityPrint(msg); - } - UNITY_IGNORE_AND_BAIL; -} - -//----------------------------------------------- -#if defined(UNITY_WEAK_ATTRIBUTE) - void setUp(void); - void tearDown(void); - UNITY_WEAK_ATTRIBUTE void setUp(void) { } - UNITY_WEAK_ATTRIBUTE void tearDown(void) { } -#elif defined(UNITY_WEAK_PRAGMA) -# pragma weak setUp - void setUp(void); -# pragma weak tearDown - void tearDown(void); -#else - void setUp(void); - void tearDown(void); -#endif -//----------------------------------------------- -void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum) -{ - Unity.CurrentTestName = FuncName; - Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum; - Unity.NumberOfTests++; - if (TEST_PROTECT()) - { - setUp(); - Func(); - } - if (TEST_PROTECT() && !(Unity.CurrentTestIgnored)) - { - tearDown(); - } - UnityConcludeTest(); -} - -//----------------------------------------------- -void UnityBegin(const char* filename) -{ - Unity.TestFile = filename; - Unity.CurrentTestName = NULL; - Unity.CurrentTestLineNumber = 0; - Unity.NumberOfTests = 0; - Unity.TestFailures = 0; - Unity.TestIgnores = 0; - Unity.CurrentTestFailed = 0; - Unity.CurrentTestIgnored = 0; - - UNITY_OUTPUT_START(); -} - -//----------------------------------------------- -int UnityEnd(void) -{ - UNITY_PRINT_EOL; - UnityPrint(UnityStrBreaker); - UNITY_PRINT_EOL; - UnityPrintNumber((_U_SINT)(Unity.NumberOfTests)); - UnityPrint(UnityStrResultsTests); - UnityPrintNumber((_U_SINT)(Unity.TestFailures)); - UnityPrint(UnityStrResultsFailures); - UnityPrintNumber((_U_SINT)(Unity.TestIgnores)); - UnityPrint(UnityStrResultsIgnored); - UNITY_PRINT_EOL; - if (Unity.TestFailures == 0U) - { - UnityPrintOk(); - } - else - { - UnityPrintFail(); - } - UNITY_PRINT_EOL; - UNITY_OUTPUT_COMPLETE(); - return (int)(Unity.TestFailures); -} - -//----------------------------------------------- diff --git a/components/testframework/libs/testframework/unity/unity.h b/components/testframework/libs/testframework/unity/unity.h deleted file mode 100644 index e883bb587..000000000 --- a/components/testframework/libs/testframework/unity/unity.h +++ /dev/null @@ -1,281 +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" - -//------------------------------------------------------- -// 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 -// - define UNITY_EXCLUDE_SIZEOF to stop attempting to use sizeof in macros -// - If you cannot use the automatic methods above, you can force Unity by using these options: -// - define UNITY_SUPPORT_64 -// - define UNITY_INT_WIDTH -// - UNITY_LONG_WIDTH -// - 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_FLOAT_VERBOSE to print floating point values in errors (uses sprintf) -// - 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_DOUBLE_VERBOSE to print floating point values in errors (uses sprintf) - -// Output -// - by default, Unity prints to standard out with putchar. define UNITY_OUTPUT_CHAR(a) with a different function if desired - -// 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 - -//------------------------------------------------------- -// 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() - -//------------------------------------------------------- -// 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), (_UU32)(-1), (actual), __LINE__, NULL) -#define TEST_ASSERT_BITS_LOW(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (_UU32)(0), (actual), __LINE__, NULL) -#define TEST_ASSERT_BIT_HIGH(bit, actual) UNITY_TEST_ASSERT_BITS(((_UU32)1 << bit), (_UU32)(-1), (actual), __LINE__, NULL) -#define TEST_ASSERT_BIT_LOW(bit, actual) UNITY_TEST_ASSERT_BITS(((_UU32)1 << bit), (_UU32)(0), (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) - -//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_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_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), (_UU32)(-1), (actual), __LINE__, message) -#define TEST_ASSERT_BITS_LOW_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (_UU32)(0), (actual), __LINE__, message) -#define TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((_UU32)1 << bit), (_UU32)(-1), (actual), __LINE__, message) -#define TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((_UU32)1 << bit), (_UU32)(0), (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_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) - -//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_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_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/components/testframework/libs/testframework/unity/unity_internals.h b/components/testframework/libs/testframework/unity/unity_internals.h deleted file mode 100644 index aa113e3df..000000000 --- a/components/testframework/libs/testframework/unity/unity_internals.h +++ /dev/null @@ -1,707 +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 - -#ifdef UNITY_INCLUDE_CONFIG_H -#include "unity_config.h" -#endif - -#include - -// Unity Attempts to Auto-Detect Integer Types -// Attempt 1: UINT_MAX, ULONG_MAX, etc in -// Attempt 2: UINT_MAX, ULONG_MAX, etc in -// Attempt 3: Deduced from sizeof() macros -#ifndef UNITY_EXCLUDE_STDINT_H -#include -#endif - -#ifndef UNITY_EXCLUDE_LIMITS_H -#include -#endif - -#ifndef UNITY_EXCLUDE_SIZEOF -#ifndef UINT_MAX -#define UINT_MAX (sizeof(unsigned int) * 256 - 1) -#endif -#ifndef ULONG_MAX -#define ULONG_MAX (sizeof(unsigned long) * 256 - 1) -#endif -#ifndef UINTPTR_MAX -//apparently this is not a constant expression: (sizeof(unsigned int *) * 256 - 1) so we have to just let this fall through -#endif -#endif -//------------------------------------------------------- -// Guess Widths If Not Specified -//------------------------------------------------------- - -// Determine the size of an int, if not already specificied. -// We cannot use sizeof(int), because it is not yet defined -// at this stage in the trnslation 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 - #endif -#endif -#ifndef UNITY_INT_WIDTH - #define UNITY_INT_WIDTH (32) -#endif - -// Determine the size of a long, if not already specified, -// by following the process used above to define -// UNITY_INT_WIDTH. -#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 - #endif -#endif -#ifndef UNITY_LONG_WIDTH - #define UNITY_LONG_WIDTH (32) -#endif - -// Determine the size of a pointer, if not already specified, -// by following the process used above to define -// UNITY_INT_WIDTH. -#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 - #endif -#endif -#ifndef UNITY_POINTER_WIDTH - #ifdef INTPTR_MAX - #if (INTPTR_MAX <= 0x7FFF) - #define UNITY_POINTER_WIDTH (16) - #elif (INTPTR_MAX <= 0x7FFFFFFF) - #define UNITY_POINTER_WIDTH (32) - #elif (INTPTR_MAX <= 0x7FFFFFFFFFFFFFFF) - #define UNITY_POINTER_WIDTH (64) - #endif - #endif -#endif -#ifndef UNITY_POINTER_WIDTH - #define UNITY_POINTER_WIDTH UNITY_LONG_WIDTH -#endif - -//------------------------------------------------------- -// Int Support (Define types based on detected sizes) -//------------------------------------------------------- - -#if (UNITY_INT_WIDTH == 32) - typedef unsigned char _UU8; - typedef unsigned short _UU16; - typedef unsigned int _UU32; - typedef signed char _US8; - typedef signed short _US16; - typedef signed int _US32; -#elif (UNITY_INT_WIDTH == 16) - typedef unsigned char _UU8; - typedef unsigned int _UU16; - typedef unsigned long _UU32; - typedef signed char _US8; - typedef signed int _US16; - typedef signed long _US32; -#else - #error Invalid UNITY_INT_WIDTH specified! (16 or 32 are supported) -#endif - -//------------------------------------------------------- -// 64-bit Support -//------------------------------------------------------- - -#ifndef UNITY_SUPPORT_64 -#if UNITY_LONG_WIDTH > 32 -#define UNITY_SUPPORT_64 -#endif -#endif -#ifndef UNITY_SUPPORT_64 -#if UNITY_POINTER_WIDTH > 32 -#define UNITY_SUPPORT_64 -#endif -#endif - -#ifndef UNITY_SUPPORT_64 - -//No 64-bit Support -typedef _UU32 _U_UINT; -typedef _US32 _U_SINT; - -#else - -//64-bit Support -#if (UNITY_LONG_WIDTH == 32) - typedef unsigned long long _UU64; - typedef signed long long _US64; -#elif (UNITY_LONG_WIDTH == 64) - typedef unsigned long _UU64; - typedef signed long _US64; -#else - #error Invalid UNITY_LONG_WIDTH specified! (32 or 64 are supported) -#endif -typedef _UU64 _U_UINT; -typedef _US64 _U_SINT; - -#endif - -//------------------------------------------------------- -// Pointer Support -//------------------------------------------------------- - -#if (UNITY_POINTER_WIDTH == 32) - typedef _UU32 _UP; -#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX32 -#elif (UNITY_POINTER_WIDTH == 64) - typedef _UU64 _UP; -#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX64 -#elif (UNITY_POINTER_WIDTH == 16) - typedef _UU16 _UP; -#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 - -//------------------------------------------------------- -// Float Support -//------------------------------------------------------- - -#ifdef UNITY_EXCLUDE_FLOAT - -//No Floating Point Support -#undef UNITY_INCLUDE_FLOAT -#undef UNITY_FLOAT_PRECISION -#undef UNITY_FLOAT_TYPE -#undef UNITY_FLOAT_VERBOSE - -#else - -#ifndef UNITY_INCLUDE_FLOAT -#define UNITY_INCLUDE_FLOAT -#endif - -//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 _UF; - -#endif - -//------------------------------------------------------- -// Double Float Support -//------------------------------------------------------- - -//unlike FLOAT, we DON'T include by default -#ifndef UNITY_EXCLUDE_DOUBLE -#ifndef UNITY_INCLUDE_DOUBLE -#define UNITY_EXCLUDE_DOUBLE -#endif -#endif - -#ifdef UNITY_EXCLUDE_DOUBLE - -//No Floating Point Support -#undef UNITY_DOUBLE_PRECISION -#undef UNITY_DOUBLE_TYPE -#undef UNITY_DOUBLE_VERBOSE - -#ifdef UNITY_INCLUDE_DOUBLE -#undef UNITY_INCLUDE_DOUBLE -#endif - -#else - -//Double Floating Point Support -#ifndef UNITY_DOUBLE_PRECISION -#define UNITY_DOUBLE_PRECISION (1e-12f) -#endif -#ifndef UNITY_DOUBLE_TYPE -#define UNITY_DOUBLE_TYPE double -#endif -typedef UNITY_DOUBLE_TYPE _UD; - -#endif - -#ifdef UNITY_DOUBLE_VERBOSE -#ifndef UNITY_FLOAT_VERBOSE -#define UNITY_FLOAT_VERBOSE -#endif -#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) putchar(a) -#else -//If defined as something else, make sure we declare it here so it's ready for use -#ifndef NULL -#define NULL 0 -#endif // NULL -extern int UNITY_OUTPUT_CHAR(int); -#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 _U_UINT -#endif - -#ifndef UNITY_COUNTER_TYPE -#define UNITY_COUNTER_TYPE _U_UINT -#endif - -//------------------------------------------------------- -// Language Features Available -//------------------------------------------------------- -#if !defined(UNITY_WEAK_ATTRIBUTE) && !defined(UNITY_WEAK_PRAGMA) -# ifdef __GNUC__ // includes clang -# if !(defined(__WIN32__) && defined(__clang__)) -# define UNITY_WEAK_ATTRIBUTE __attribute__((weak)) -# endif -# endif -# ifdef _MSC_VER -# define UNITY_WEAK_ATTRIBUTE -# 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) -#define UNITY_DISPLAY_RANGE_AUTO (0x80) - -typedef enum -{ -#if (UNITY_INT_WIDTH == 16) - UNITY_DISPLAY_STYLE_INT = 2 + UNITY_DISPLAY_RANGE_INT + UNITY_DISPLAY_RANGE_AUTO, -#elif (UNITY_INT_WIDTH == 32) - UNITY_DISPLAY_STYLE_INT = 4 + UNITY_DISPLAY_RANGE_INT + UNITY_DISPLAY_RANGE_AUTO, -#elif (UNITY_INT_WIDTH == 64) - UNITY_DISPLAY_STYLE_INT = 8 + UNITY_DISPLAY_RANGE_INT + UNITY_DISPLAY_RANGE_AUTO, -#endif - 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 - -#if (UNITY_INT_WIDTH == 16) - UNITY_DISPLAY_STYLE_UINT = 2 + UNITY_DISPLAY_RANGE_UINT + UNITY_DISPLAY_RANGE_AUTO, -#elif (UNITY_INT_WIDTH == 32) - UNITY_DISPLAY_STYLE_UINT = 4 + UNITY_DISPLAY_RANGE_UINT + UNITY_DISPLAY_RANGE_AUTO, -#elif (UNITY_INT_WIDTH == 64) - UNITY_DISPLAY_STYLE_UINT = 8 + UNITY_DISPLAY_RANGE_UINT + UNITY_DISPLAY_RANGE_AUTO, -#endif - 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; - -#ifndef UNITY_EXCLUDE_FLOAT -typedef enum _UNITY_FLOAT_TRAIT_T -{ - 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_TRAIT_T; -#endif - -struct _Unity -{ - const char* TestFile; - const char* CurrentTestName; - UNITY_LINE_TYPE CurrentTestLineNumber; - UNITY_COUNTER_TYPE NumberOfTests; - UNITY_COUNTER_TYPE TestFailures; - UNITY_COUNTER_TYPE TestIgnores; - UNITY_COUNTER_TYPE CurrentTestFailed; - UNITY_COUNTER_TYPE CurrentTestIgnored; - jmp_buf AbortFrame; -}; - -extern struct _Unity 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); - -//------------------------------------------------------- -// Test Output -//------------------------------------------------------- - -void UnityPrint(const char* string); -void UnityPrintMask(const _U_UINT mask, const _U_UINT number); -void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T style); -void UnityPrintNumber(const _U_SINT number); -void UnityPrintNumberUnsigned(const _U_UINT number); -void UnityPrintNumberHex(const _U_UINT number, const char nibbles); - -#ifdef UNITY_FLOAT_VERBOSE -void UnityPrintFloat(const _UF number); -#endif - -//------------------------------------------------------- -// Test Assertion Fuctions -//------------------------------------------------------- -// 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 _U_SINT expected, - const _U_SINT actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style); - -void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected, - UNITY_PTR_ATTRIBUTE const void* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_DISPLAY_STYLE_T style); - -void UnityAssertBits(const _U_SINT mask, - const _U_SINT expected, - const _U_SINT 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 _UU32 length, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualStringArray( const char** expected, - const char** actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualMemory( UNITY_PTR_ATTRIBUTE const void* expected, - UNITY_PTR_ATTRIBUTE const void* actual, - const _UU32 length, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertNumbersWithin(const _U_SINT delta, - const _U_SINT expected, - const _U_SINT 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 _UF delta, - const _UF expected, - const _UF actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected, - UNITY_PTR_ATTRIBUTE const _UF* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertFloatSpecial(const _UF actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style); -#endif - -#ifndef UNITY_EXCLUDE_DOUBLE -void UnityAssertDoublesWithin(const _UD delta, - const _UD expected, - const _UD actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected, - UNITY_PTR_ATTRIBUTE const _UD* actual, - const _UU32 num_elements, - const char* msg, - const UNITY_LINE_TYPE lineNumber); - -void UnityAssertDoubleSpecial(const _UD actual, - const char* msg, - const UNITY_LINE_TYPE lineNumber, - const UNITY_FLOAT_TRAIT_T style); -#endif - -//------------------------------------------------------- -// Error Strings We Might Need -//------------------------------------------------------- - -extern const char UnityStrErrFloat[]; -extern const char UnityStrErrDouble[]; -extern const char UnityStrErr64[]; - -//------------------------------------------------------- -// Test Running Macros -//------------------------------------------------------- - -#define TEST_PROTECT() (setjmp(Unity.AbortFrame) == 0) - -#define TEST_ABORT() {longjmp(Unity.AbortFrame, 1);} - -//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("") -#endif - -#ifndef UNITY_END -#define UNITY_END() UnityEnd() -#endif - -#define UNITY_UNUSED(x) (void)(sizeof(x)) - -//------------------------------------------------------- -// 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((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UU8 )(expected), (_U_SINT)(_UU8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UU16)(expected), (_U_SINT)(_UU16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UU32)(expected), (_U_SINT)(_UU32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message) UnityAssertBits((_U_SINT)(mask), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line) - -#define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_US8 )(delta), (_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_INT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_US16)(delta), (_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_INT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_US32)(delta), (_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_UINT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU8 )(delta), (_U_SINT)(_U_UINT)(_UU8 )(expected), (_U_SINT)(_U_UINT)(_UU8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_UINT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU16)(delta), (_U_SINT)(_U_UINT)(_UU16)(expected), (_U_SINT)(_U_UINT)(_UU16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_UINT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU32)(delta), (_U_SINT)(_U_UINT)(_UU32)(expected), (_U_SINT)(_U_UINT)(_UU32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU8 )(delta), (_U_SINT)(_U_UINT)(_UU8 )(expected), (_U_SINT)(_U_UINT)(_UU8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU16)(delta), (_U_SINT)(_U_UINT)(_UU16)(expected), (_U_SINT)(_U_UINT)(_UU16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU32)(delta), (_U_SINT)(_U_UINT)(_UU32)(expected), (_U_SINT)(_U_UINT)(_UU32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32) - -#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UP)(expected), (_U_SINT)(_UP)(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), (_UU32)(len), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_PTR_ATTRIBUTE void*)(expected), (UNITY_PTR_ATTRIBUTE void*)(actual), (_UU32)(len), 1, (message), (UNITY_LINE_TYPE)line) - -#define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT) -#define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT8) -#define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT16) -#define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT32) -#define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT) -#define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT8) -#define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT16) -#define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT32) -#define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8) -#define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16) -#define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32) -#define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(_UP*)(expected), (const void*)(_UP*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_POINTER) -#define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((const char**)(expected), (const char**)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_PTR_ATTRIBUTE void*)(expected), (UNITY_PTR_ATTRIBUTE void*)(actual), (_UU32)(len), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line) - -#ifdef UNITY_SUPPORT_64 -#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(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_PTR_ATTRIBUTE const _U_SINT*)(expected), (UNITY_PTR_ATTRIBUTE const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const _U_SINT*)(expected), (UNITY_PTR_ATTRIBUTE const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const _U_SINT*)(expected), (UNITY_PTR_ATTRIBUTE const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64) -#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64) -#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64) -#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (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) -#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_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((_UF)(delta), (_UF)(expected), (_UF)(actual), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((_UF)(expected) * (_UF)UNITY_FLOAT_PRECISION, (_UF)expected, (_UF)actual, (UNITY_LINE_TYPE)line, message) -#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray((_UF*)(expected), (_UF*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NEG_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NAN) -#define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_DET) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_NEG_INF) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_NAN) -#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((_UF)(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_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((_UD)(delta), (_UD)(expected), (_UD)(actual), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((_UD)(expected) * (_UD)UNITY_DOUBLE_PRECISION, (_UD)expected, (_UD)actual, (UNITY_LINE_TYPE)line, message) -#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray((_UD*)(expected), (_UD*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line) -#define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NEG_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NAN) -#define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_DET) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_NEG_INF) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_NAN) -#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_DET) -#endif - -//End of UNITY_INTERNALS_H -#endif diff --git a/components/testframework/libs/testframework/unity/unity_print.h b/components/testframework/libs/testframework/unity/unity_print.h deleted file mode 100644 index f09abaa07..000000000 --- a/components/testframework/libs/testframework/unity/unity_print.h +++ /dev/null @@ -1,11 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ - -#ifndef UNITY_PRINT_H -#define UNITY_PRINT_H - -void unity_print_init(void); - -void unity_print_close(void); - -#endif // UNITY_PRINT_H diff --git a/components/testframework/libs/testframework/unity/zw700/unity_print.c b/components/testframework/libs/testframework/unity/zw700/unity_print.c deleted file mode 100644 index fe066b22c..000000000 --- a/components/testframework/libs/testframework/unity/zw700/unity_print.c +++ /dev/null @@ -1,76 +0,0 @@ -/* © 2017 Silicon Laboratories Inc. - */ - -#include "../unity_print.h" -#include "../unity.h" -#include -#include -#include - -#define UNITY_PRINT_BAUD_RATE 115200 /**< Baud rate to use for unity printing, 115200. */ -#define UNITY_PRINT_TX_ENABLE 1 -#define UNITY_PRINT_RX_ENABLE 1 -#define UNITY_PRINT_UART_CTRL_HS_TEST (1 << 6) - -#define __XTAL ( 9600000UL) /* Oscillator frequency */ -#define __SYSTEM_CLOCK (5*__XTAL) - -extern uint8_t * gUnityMessageBuffer; -extern uint32_t gUnityMessageBufferSize; - -uint8_t * gUnityMessageBuffer __attribute__((weak)) = NULL; -uint32_t gUnityMessageBufferSize __attribute__((weak)) = 0; - -void unity_print_init(void) -{ - // ZW_UART0_init(1152,1,1); - ARM_UART0->BAUDDIV = __SYSTEM_CLOCK / UNITY_PRINT_BAUD_RATE; - ARM_UART0->CTRL |= APB_UART_CTRL_TX_ENABLE; - ARM_UART0->CTRL |= APB_UART_CTRL_RX_ENABLE; - ARM_UART0->CTRL |= UNITY_PRINT_UART_CTRL_HS_TEST; -} - -int ZW_putchar(int c) -{ - while(ARM_UART0->STATE & APB_UART_STATE_TX_FULL ); - ARM_UART0->DATA = c; // Transmit char - return c; -} - -/** Function for printing ASIP messages. - * - * @details When unit testing on ASIP a memory buffer is used to pass the log messages from the - * ASIP to the ARM Cortex CPU. This function is used for reading the memory buffer from - * the ASIP and write the content to the UART. - */ -static void unity_print_asip(void) -{ - uint32_t messageBufferIndex = 0; - - if ((gUnityMessageBuffer == NULL) || (gUnityMessageBufferSize == 0)) - { - return; - } - - UnityPrint("UnityAsip - start."); - ZW_putchar('\n'); - while((messageBufferIndex < gUnityMessageBufferSize) && (gUnityMessageBuffer[messageBufferIndex] != 0)) - { - ZW_putchar(gUnityMessageBuffer[messageBufferIndex++]); - } - ZW_putchar('\n'); - UnityPrint("UnityAsip - end."); - ZW_putchar('\n'); -} - -void unity_print_close(void) -{ - unity_print_asip(); - ZW_putchar('\04'); -} - -int fputc(int c, FILE * stream) -{ - (void)stream; - return ZW_putchar(c); -} diff --git a/components/testframework/src/unity_helpers.cpp b/components/testframework/src/unity_helpers.cpp deleted file mode 100644 index f11547bf7..000000000 --- a/components/testframework/src/unity_helpers.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * # License - * Copyright 2021 Silicon Laboratories Inc. www.silabs.com - ****************************************************************************** - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - *****************************************************************************/ -#include "unity_helpers.h" -#include -#include - -extern "C" { -#include "unity.h" -#include "unity_internals.h" -} - -extern "C" { -void INTERNAL_TEST_ASSERT_EQUAL_JSON(const char *expected, - const char *actual, - unsigned int line) -{ - bool result; - char dbg[1001]; - // In case of failed tests Unity will make a goto/long_jump which will cause a memory leak, - // if the cpp destructors are not called for std::stringstream and boost::property_tree, - // thus those are scoped here, and the debug string is copied to the dbg char array. - { - nlohmann::json json_expected = nlohmann::json::parse(expected); - nlohmann::json json_actual = nlohmann::json::parse(actual); - result = json_expected == json_actual; - std::stringstream ss_dbg; - if (!result) { - ss_dbg << "Expected: " << json_expected.dump(); - ss_dbg << " Actual: " << json_actual.dump(); - strncpy(dbg, ss_dbg.str().c_str(), sizeof(dbg) - 1); - // Ensure null termination - dbg[1000] = 0; - } - } - UNITY_TEST_ASSERT(result, line, dbg); -} - -__attribute__((weak)) void setUp() { - -}; -__attribute__((weak)) void tearDown() { - -}; -} \ No newline at end of file diff --git a/components/testframework/target_add_unittest.cmake b/components/testframework/target_add_unittest.cmake deleted file mode 100644 index 7129c27dc..000000000 --- a/components/testframework/target_add_unittest.cmake +++ /dev/null @@ -1,165 +0,0 @@ -find_package(Ruby) -# The RUBY_EXECUTABLE variable does not exist when the ADD_UNITY2_TEST function -# is called So instaed store the value in cache and use the cached value -set(UNITY2_RUBY_EXECUTABLE - ${RUBY_EXECUTABLE} - CACHE INTERNAL "") - -set(DIR_OF_TARGET_ADD_UNIT_TEST - ${CMAKE_CURRENT_LIST_DIR} - CACHE INTERNAL "DIR_OF_TARGET_ADD_UNIT_TEST") - -function(generate_unity_runner test_runner test_file) - if(EXISTS ${UNIFY-TESTFRAMEWORK_LOCATION}) - set(ZWAVE_UNITY_CONFIG - ${UNIFY-TESTFRAMEWORK_LOCATION}/unify_cmock_config.yml) - else() - set(ZWAVE_UNITY_CONFIG - ${DIR_OF_TARGET_ADD_UNIT_TEST}/unify_cmock_config.yml) - endif() - if(NOT EXISTS ${ZWAVE_UNITY_CONFIG}) - message( - FATAL_ERROR "Did not find unify_cmock_config.yml at ${ZWAVE_UNITY_CONFIG}" - ) - endif() - if(EXISTS ${THS-UNITY_LOCATION}) - set(UNITY_DIR ${THS-UNITY_LOCATION}) - add_custom_command( - OUTPUT ${TEST_RUNNER} - DEPENDS ${TEST_FILE} - COMMAND - ${UNITY2_RUBY_EXECUTABLE} ${UNITY_DIR}/auto/generate_test_runner.rb - ${ZWAVE_UNITY_CONFIG} ${TEST_FILE} ${TEST_RUNNER} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - else() - set(UNITY_DIR "${DIR_OF_TARGET_ADD_UNIT_TEST}/libs/cmock/vendor/unity") - add_custom_command( - OUTPUT ${TEST_RUNNER} - DEPENDS ${TEST_FILE} - COMMAND - ${UNITY2_RUBY_EXECUTABLE} ${UNITY_DIR}/auto/generate_test_runner.rb - ${DIR_OF_TARGET_ADD_UNIT_TEST}/zwave_unity_config.yml ${TEST_FILE} - ${TEST_RUNNER} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - endif() -endfunction() - -# This function creates unity2 test executables. It uses the provided target to setup and import configuration -# to successfully compile a unit-test executable. more specifically, it re-uses the build object files of the provided target -# to relink it with optional mock dependencies into a new executable. It does so using the same include and link directives as the provided target. -# the provided target need to exist and be valid before calling this function. -# -# usage: -# `target_add_unittest(my_component SOURCES test.c)` - creates a cmake target named my_component_test. it will compile test.c and link it against my_component. -# -# `target_add_unittest(my_component SOURCES test.c DEPENDS my_mock)` - creates a cmake target named my_component_test and links target my_mock -# -# `target_add_unittest(my_component SOURCES test.c DEPENDS foo_mock EXCLUDE foo.c)` - leaves out foo.c object when linking the new test target. -# use when you want to replace it with an mock -# -# possible arguments: -# +-----------+----------------------------------------------------------------------+----------+ -# | Argument | Description | optional | -# +-----------+----------------------------------------------------------------------+----------+ -# | 1st arg | target to setup an unit-test target for | | -# | NAME | Overwrite the default name of test executable (default=$Target_test) | x | -# | SOURCES | Source files that define unit-tests | | -# | DEPENDS | New additional dependencies | x | -# | EXCLUDE | Omit certain source files from the imported target | x | -# | DISABLED | Disable test | x | -# +-----------+----------------------------------------------------------------------+----------+ -# -function(target_add_unittest) - # first argument is the target to make unit-test exe of - list(POP_FRONT ARGV TARGET) - - cmake_parse_arguments(PARSED_ARGS "DISABLED" "NAME" "DEPENDS;SOURCES;EXCLUDE" - ${ARGV}) - if(NOT ${PARSED_ARGS_UNPARSED_ARGUMENTS} STREQUAL "") - message(FATAL_ERROR "could not parse ${PARSED_ARGS_UNPARSED_ARGUMENTS}") - elseif(NOT ${PARSED_ARGS_KEYWORDS_MISSING_VALUES} STREQUAL "") - message( - FATAL_ERROR - "following keywords are missing values: ${PARSED_ARGS_KEYWORDS_MISSING_VALUES}" - ) - endif() - - if(NOT DEFINED PARSED_ARGS_NAME) - set(TEST_TARGET "${TARGET}_test") - else() - set(TEST_TARGET "${PARSED_ARGS_NAME}") - endif() - - # The first file in the source list is the main test file - list(GET PARSED_ARGS_SOURCES 0 TEST_FILE) - get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE) - set(TEST_RUNNER "${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}_runner.c") - generate_unity_runner(${TEST_RUNNER} ${TEST_FILE}) - - get_target_property(target_type ${TARGET} TYPE) - if(target_type STREQUAL "INTERFACE_LIBRARY") - list(APPEND PARSED_ARGS_DEPENDS ${TARGET}) - else() - collect_object_files(${TARGET} "${TARGET_OBJS}" "${PARSED_ARGS_EXCLUDE}") - endif() - - # tests binaries reuse the o files of the actual target and relink them with - # the correct components nessicary for the test. e.g. mocks/stubs. - add_executable(${TEST_TARGET} ${PARSED_ARGS_SOURCES} ${TARGET_OBJS} - ${TEST_RUNNER}) - - target_include_directories( - ${TEST_TARGET} PRIVATE . $) - - target_link_libraries( - ${TEST_TARGET} PRIVATE unity2 ${PARSED_ARGS_DEPENDS} - $) - add_test(${TEST_NAME} ${TEST_TARGET}) - - if(${PARSED_ARGS_DISABLED}) - set_tests_properties(${TEST_NAME} PROPERTIES DISABLED True) - endif() -endfunction() - -function(target_add_gtest) - # first argument is the target to make unit-test exe of - list(POP_FRONT ARGV TARGET) - cmake_parse_arguments(PARSED_ARGS "DISABLED" "NAME" - "DEPENDS;SOURCES;EXCLUDE;INCLUDES" ${ARGV}) - if(NOT ${PARSED_ARGS_UNPARSED_ARGUMENTS} STREQUAL "") - message(FATAL_ERROR "could not parse ${PARSED_ARGS_UNPARSED_ARGUMENTS}") - elseif(NOT ${PARSED_ARGS_KEYWORDS_MISSING_VALUES} STREQUAL "") - message( - FATAL_ERROR - "following keywords are missing values: ${PARSED_ARGS_KEYWORDS_MISSING_VALUES}" - ) - endif() - - if(NOT DEFINED PARSED_ARGS_NAME) - set(TEST_TARGET "${TARGET}_test") - else() - set(TEST_TARGET "${PARSED_ARGS_NAME}") - endif() - - get_target_property(target_type ${TARGET} TYPE) - if(target_type STREQUAL "INTERFACE_LIBRARY") - list(APPEND PARSED_ARGS_DEPENDS ${TARGET}) - else() - collect_object_files(${TARGET} "${TARGET_OBJS}" "${PARSED_ARGS_EXCLUDE}") - endif() - - find_package(Threads REQUIRED) - include(GoogleTest) - - # tests binaries reuse the o files of the actual target and relink them with - # the correct components nessicary for the test. e.g. mocks/stubs. - add_executable(${TEST_TARGET} ${PARSED_ARGS_SOURCES} ${TARGET_OBJS}) - target_include_directories( - ${TEST_TARGET} PRIVATE . $ - ${PARSED_ARGS_INCLUDES}) - target_link_libraries( - ${TEST_TARGET} - PRIVATE ${PARSED_ARGS_DEPENDS} $ - gtest gmock gmock_main pthread) - gtest_discover_tests(${TEST_TARGET}) -endfunction() diff --git a/components/testframework/test/CMakeLists.txt b/components/testframework/test/CMakeLists.txt deleted file mode 100644 index 3d0625f0c..000000000 --- a/components/testframework/test/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -target_add_unittest(unity_helper unity_helper_test.c) \ No newline at end of file diff --git a/components/testframework/test/unity_helper_test.c b/components/testframework/test/unity_helper_test.c deleted file mode 100644 index 05a5a9fdf..000000000 --- a/components/testframework/test/unity_helper_test.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "unity_helpers.h" -// Unity stuff to be able to test for failed results -#include "unity.h" -#define TEST_INSTANCES -#include "self_assessment_utils.h" -static int SetToOneMeanWeAlreadyCheckedThisGuy; - -/** - * @brief Test that TEST_ASSERT_EQUAL_JSON work as expected - * - */ -void test_unity_json_equal() { - // C interface - TEST_ASSERT_EQUAL_JSON("{\"mybool\":true}", "{\"mybool\":true}"); - EXPECT_ABORT_BEGIN - TEST_ASSERT_EQUAL_JSON("{\"mybool\":true}", "{\"mybool\":false}"); - VERIFY_FAILS_END -} \ No newline at end of file diff --git a/components/testframework/unify_cmock_config.yml b/components/testframework/unify_cmock_config.yml deleted file mode 100644 index c9c84cf91..000000000 --- a/components/testframework/unify_cmock_config.yml +++ /dev/null @@ -1,27 +0,0 @@ -:cmock: - :mock_prefix: '' - :mock_suffix: '_mock' - - :array_as_byte: true - :when_ptr: :smart - :array_size_type: ['uint8_t','uint16_t'] - :treat_as_array: - zwapi_nodemask_t: 'uint8_t' - network_key_t: 'uint8_t' - zwave_dsk_t: 'uint8_t' - zwave_nodemask_t: 'uint8_t' - unid_t: 'char' - datastore_key_t: 'const char' - EmberEUI64: 'uint8_t' - sl_802154_long_addr_t: 'uint8_t' - zigbee_eui64_t: 'uint8_t' - zigbee_install_code_t: 'uint8_t' - zigbee_ext_panid_t: 'uint8_t' - aoa_id_t: 'char' - :plugins: - - :ignore_arg - - :ignore - - :callback - - :array - - :return_thru_ptr - diff --git a/components/testframework/zwave_unity_config.yml b/components/testframework/zwave_unity_config.yml deleted file mode 100644 index 7f1d31a62..000000000 --- a/components/testframework/zwave_unity_config.yml +++ /dev/null @@ -1,4 +0,0 @@ -:unity: - :mock_prefix: '' - :mock_suffix: '_mock.h' - :include_extensions: '(?:h)' diff --git a/doc/how_to_write_uam_files.rst b/doc/how_to_write_uam_files.rst deleted file mode 100644 index aed858e9a..000000000 --- a/doc/how_to_write_uam_files.rst +++ /dev/null @@ -1,845 +0,0 @@ -.. meta:: - :description: Guide to UAM files - :keywords: Mapper, UAM, Mapping - -.. raw:: latex - - \newpage - -.. _how_to_write_uam_files_section: - -How to write UAM files -====================== - -The attribute mapper is a component that allows to define relations between -attributes stored in the Attribute Store. It can be used for mapping, as -well as easily adding logic around attributes. - -Syntax highlighting -------------------- - -To make developer easier, we recommend that you enable some syntax highlighting -for the UAM files. A VSCode extension configuration is provided in the mapper -component folder: ``components/uic_attribute_mapper/vscode-extension``. - -No binaries are distributed, but can be generated using vsce. -To enable it, navigate to the folder, and generate the package: - -.. code-block:: console - - pi@raspberrypi:~/unify $ npm install -g vsce - pi@raspberrypi:~/unify $ cd ./components/uic_attribute_mapper/vscode-extension - pi@raspberrypi:~/unify/components/uic_attribute_mapper/vscode-extension $ vsce package - WARNING LICENSE.md, LICENSE.txt or LICENSE not found - Do you want to continue? [y/N] y - DONE Packaged: ~/unify/components/uic_attribute_mapper/vscode-extension/attribute-mapper-0.2.0.vsix (7 files, 3.23KB) - -Afterwards the ``attribute-mapper-0.2.0.vsix`` file can be installed in VSCode -using the command palette *(Ctrl+Shift+P)*, select ``"Install from VSIX"`` and -provide the path to the generated extension. - -Path Configuration ------------------- - -To enable the Attribute Mapper with user-defined *uam* files, it needs to be -initialized and provided with a directory name containing a set of *.uam* -files. - -For example, using an application like the -:doc:`Example Protocol Controller `: - -.. code-block:: console - - pi@raspberrypi:~ $ ./applications/epc/epc --mapdir /path/to/uam/files/ - - -Attribute Type registration ---------------------------- - -.. raw:: html - - The mapper allows to manipulate attributes that are stored as numerical values, - as long as they are registered to the Attribute Store using the - - attribute_store_register_type API - . - -Attribute types not registered to the Attribute Store will be treated as -32-bit signed integer values. - -UAM File structure and syntax ------------------------------ - -A uam file template could be as follow. It contains a set of definitions and a -scope. The scope itself contains a set of assignments. - -.. code-block:: uam - - // this is a comment - - def expression - def expression - - scope 0 { - = - = - } - - -The mapper can identify the following "value states" for each attribute: - -* ``r`` for reported value -* ``d`` for desired value -* ``e`` for the existence of the attribute. - (evaluates to true/false depending on if the attribute exists) - -The value states must be used in front of attribute types, using a ``'`` character. -To perform an assignment, the ``=`` sign must be used. -For example, if the reported value of attribute type 1 should take the -desired value of attribute type 2, the following expression can be used: - -.. code-block:: uam - - r'1 = d'2 - -The mapper constantly monitor attribute updates, so whenever -the desired value of attribute 2 is updated, the reported value of attribute -1 will be adjusted. - -.. note:: - - Assignments to reported values will trigger attribute creations - in the attribute store. - -* ``r'1 = r'2`` will create attribute type 1 and set its reported value - if it does not exist. - - But -* ``d'1 = r'2`` will not create attribute type 1 and set its desired value - if it does not exist. - -Aliases (def) -''''''''''''' - -To avoid using raw type values, the mapper allows to define value substitutions -using the ``def`` keyword. For example, ``r'1 = d'2`` above could be expressed -as: - -.. code-block:: uam - - def zwave_state 1 - def zigbee_state 2 - scope 0 { - r'zwave_state = d'zigbee_state - } - -Operators -''''''''' - -Regular operators can be used to modify the value. The available operators are -shown in -:numref:`table_attribute_mapper_available_operators`. - -.. list-table:: Unify Attribute Mapper available operators - :name: table_attribute_mapper_available_operators - :widths: 20 80 - :header-rows: 1 - - * - Operator - - Name/Description - * - \+ - - Addition - * - \- - - Subtraction - * - \* - - Multiplication - * - / - - Division - * - & - - bitwise AND - * - \| - - bitwise OR - * - % - - Modulo - * - \*\* - - Exponent - - -For example, if a value needs to be multiplicated by 2 and incremented by 1: - -.. code-block:: uam - - def zwave_state 1 - def zigbee_state 2 - scope 0 { - r'zwave_state = ((d'zigbee_state * 2) + 1) - } - -.. note:: - - It is **strongly recommended** to use parentheses around operations, as - little priority handling is implemented in the mapper. - -IF and Comparison Operators -''''''''''''''''''''''''''' - -Comparison operators are also available for in UAM maps. -The available comparison operators are shown in -:numref:`table_attribute_mapper_available_comparison_operators`. - -.. list-table:: Unify Attribute Mapper available comparison operators - :name: table_attribute_mapper_available_comparison_operators - :widths: 20 80 - :header-rows: 1 - - * - Operator - - Name/Description - * - == - - Equal to - * - != - - Not equal to - * - > - - Greater than - * - < - - Less than - * - <= - - Less than or equal to - * - >= - - Greater than or equal to - -These operators should be used with ``if`` statements. The ``if`` syntax is as -follows: ``if condition value_if_true value_if_false``. -A switch-like statement can be made using multiple ``if`` statements. - -.. code-block:: uam - - scope 0 { - // If the desired value of attribute 2 is 0, set reported of 1 to 1 - // If the reported value of attribute 3 is 3, set reported of 1 to 2 - // if none of the previous conditions is true, set the reported of 1 to 0. - r'1 = - if (d'2 == 0) 1 - if (r'3 == 3) 2 - 0 - } - -Note in the example above that line breaks and indentation does not have any -impact, and are just used for readability. The statement can be written in one -line too. This is an example from the ZPC default maps, which determines if the -reported value of the battery low flag should go to 1 or 0 based on the -reported battery percentage. - -.. code-block:: uam - - // [...] Skipping def statements - r'zbBATTERY_LOW = - if (r'zwBATTERY < 10) 1 - if (r'zwBATTERY == 0xFF) 1 - 0 - -Note that bitwise operators ``&`` and ``|`` can be used for evaluating a set of -boolean expressions: - -.. code-block:: uam - - r'1 = - if ((d'2 == 0) & (r'3 == 3)) 12 - if (d'2 == 0) 1 - if (r'3 == 3) 2 - 0 - -undefined keyword -''''''''''''''''' - -A special ``undefined`` keyword can be used to abort assignment evaluations. -For example, to set the reported value of an attribute **only if** another -attribute exists, the following map can be used: - - -.. code-block:: uam - - // If attribute type 2 exists, set the value to 1, else do not do anything - r'1 = - if (e'2) 1 - undefined - -.. note:: - - ``undefined`` evaluates to false in an ``if`` condition, so the expression - ``if (undefined) 1 2`` will evaluate to 2. - -An attribute path will evaluate to undefined if either: - -1. The attribute type does not exist -2. The value of the attribute is empty, i.e. undefined - -or keyword -'''''''''' - -Additionally, a special ``or`` keyword can be used for fallback values, -in case something is undefined: - -.. code-block:: uam - - // If attribute type 2 has a reported value, set the reported value of 1 to this value - // else set it to the (reported value of attribute type 3) + 2 - r'1 = r'2 or (r'3 + 2) - -For example ``undefined or 4`` will evaluate to 4. - -Attribute navigation -'''''''''''''''''''' - -Tree navigation operators can be used to navigate the Attribute Store tree, -for when attributes are organized in a more complicated manner. They are -shown in :numref:`table_attribute_mapper_available_navigation_operators`. - -.. list-table:: Unify Attribute Mapper available navigation operators - :name: table_attribute_mapper_available_navigation_operators - :widths: 20 80 - :header-rows: 1 - - * - Operator - - Name/Description - * - [] - - Reported value navigation - * - . - - Child navigation - * - ^ - - Parent navigation - -.. warning:: - - Parent navigation operator has some known issues and may not work. - -.. code-block:: uam - - // If the desired value of (attribute 3 placed under attribute 2 with reported value 1) is greater than 0, set reported of 1 to 1 - r'1 = - if (d'2[1].3 > 0) 1 - undefined - -All attributes are placed under a common parent attribute type, usually -representing an endpoint. -For example, if trying to navigate up the tree, the parent is the endpoint -attribute. - -.. code-block:: uam - - def ep 0x00000004 - scope 0 { - // Set the reported value of attribute 1 to the reported value of attribute 1 under endpoint ID 1 to the same value under endpoint 0. - r'^.ep[1].1 = r'^.ep[0].1 - } - - -Built-in functions -'''''''''''''''''' - -A few built-in functions are available for usage in the UAM files. -Functions are invoked with the following syntax: -``fn_(expression, expression, ...)`` - -The following example shows the use of a function as an assignment: - -.. code-block:: uam - - scope 0 { - // Attribute type 1 will be the absolute value of attribute type 2 - r'1 = fn_absolute_value(r'2) - // Attribute type 10 will be the min value between the reported value of type 2, 3 or 4 - r'10 = fn_min_value(r'2,r'3,r'4) - } - -The following example shows the use of a function as condition evaluation and assignment. - -.. code-block:: uam - - scope 0 { - r'1 = if (fn_is_any_undefined(r'2, r'3, r'4)) r'6 fn_min_value(r'2, (2 * r'3), (20 % r'3)) - } - -.. raw:: html - - The available functions can be found in the - - Available Mapper built-in functions - . -

- -Scope settings -'''''''''''''' - -Some mapper configuration can be attached to scopes. The available settings -are shown in :numref:`table_attribute_mapper_available_scope_settings`. - -.. list-table:: Unify Attribute Mapper available scope settings - :name: table_attribute_mapper_available_scope_settings - :widths: 30 20 30 40 - :header-rows: 1 - - * - Setting - - Setting Name - - Default value - - Description - * - :ref:`how_to_write_uam_files_clear_desired_subsection` - - ``clear_desired`` - - 1 - - Controls if the desired value gets - - undefined automatically during mappings. - * - :ref:`how_to_write_uam_files_chain_reaction_subsection` - - ``chain_reaction`` - - 1 - - Controls if the Attribute Mapper triggers new - - evaluations based on attribute - - update it performed itself. - * - :ref:`how_to_write_uam_files_attribute_creaction_subsection` - - ``create_attributes`` - - 1 - - Controls when to create new attributes. - * - :ref:`how_to_write_uam_files_common_parent_type_setting_subsection` - - ``common_parent_type`` - - Mapper's engine - - Common Parent Type - - configuration - - Temporarily changes the Common Parent Type for a scope. - -The syntax is as follow: ``scope setting_name(value) setting_name(value) {}`` -For example, this UAM snippet shows scopes with different configurations. -Note that the priority value has no effect at the moment. - -.. code-block:: uam - - scope 0 chain_reaction(0) clear_desired(0) create_attributes(2) { - r'1 = r'2 - r'2 = r'1 - d'1 = d'2 - d'2 = d'1 - } - scope 1 chain_reaction(0) clear_desired(1) { - r'3 = d'4 - r'4 = d'3 - } - scope 2 chain_reaction(1) clear_desired(0) { - d'6 = r'5 - r'6 = d'6 - } - scope 3 chain_reaction(1) clear_desired(1) common_parent_type(3) { - r'8 = d'9 - r'9 = r'8 - r'10 = r'9 - } - -.. _how_to_write_uam_files_scope_priority: - -Scope priority -~~~~~~~~~~~~~~ - -The Scope priority is used to rank rules by priority, and let overlapping rules -co-exist. Let's take the following example: - -.. code-block:: uam - - scope 0 { - r'2 = r'3 - } - scope 1 { - r'2 = r'4 - } - -The reported value of Attribute Type 2 is assigned in several maps. Whenever -an attribute of type 3 or 4 is updated, the mapper will try to execute rules -with the highest priority first, and will stop at the first one that return -assigns a value. - -* If r'3 is set to 3, then r'2 will be 3. -* If r'3 is set to 3, attribute 4 exists but has no reported, then r'2 will be 3. -* If r'4 is set to 20, then r'2 will be 20 regardless of the value set in r'3. - -Here is another scope priority example: - -.. code-block:: uam - - scope 10 { - r'2 = r'3 - } - scope 100 { - r'2 = if (r'4>0) r'4 undefined - } - -First, if neither Attribute 3 and 4 exist, then attribute 2 does not exist either. - -If r'3 is created and assigned a value, the scope 10 rule will trigger the creation -of r'2. The mapper will verify if the scope 100 rule (which prevails) would lead -to an attribute deletion, and if so, would cancel the scope 10 rule. - -Whenever r'4 value is defined and positive, r'2 will be set to the value of r'4. -Else r'2 would fallback on the r'3 value. - -For the scope priority to cancel lower priority maps, the mapper checks that -the "destination" attribute to be the same. Taking this map: - -.. code-block:: uam - - scope 1 { - r'3.2 = r'10 - } - scope 2 { - r'3[0].2 = r'11 - } - -Scope 2 will take precedence only if we have an attribute 2 placed under an -attribute 3 with value 0. In other cases, scope 2 will not affect scope 1. - -Note that if 2 equivalent mappings have the same priority, it will be -unpredictable which mapping prevails. If possible, all maps to a given -attribute type should have a unique scope priority. - -.. code-block:: uam - - // This is strongly NOT RECOMMENDED: - scope 1 { - r'2 = r'3 - } - scope 1 { - r'2 = r'4 - } - -.. _how_to_write_uam_files_clear_desired_subsection: - -Automatic desired value clearance -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -By default, the Attribute Mapper will clear (undefine) the desired value of -an attribute when it sets the reported value. - -For example, in the following map: - -.. code-block:: uam - - scope 0 { - d'1 = r'2 - r'1 = r'2 - } - -If the reported value of Attribute Type 2 is updated, it will be mapped to both -the desired and reported value of Attribute Type 1, but setting the reported -value of Attribute Type 1 will clear the desired value. - -Evaluation steps: - -1. r'2 is updated to a new value x -2. d'1 is updated to x -3. d'1 is undefined, r'1 is updated to x. - -To prevent this from happening, the scope can be configured not to clear the -desired value. - -.. code-block:: uam - - scope 0 clear_desired(0) { - d'1 = r'2 - r'1 = r'2 - } - -Evaluation steps: - -1. r'2 is updated to a new value x -2. d'1 is updated to x -3. r'1 is updated to x. - -.. _how_to_write_uam_files_chain_reaction_subsection: - -Chain reaction evaluations -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -By default, the Attribute Mapper will react to its own updates, so it can -continously trigger itself to update more values. - -Let's take the following map as a example: - -.. code-block:: uam - - scope 0 { - r'2 = r'1 - r'3 = r'2 - r'4 = r'3 - } - -Evaluation steps: - -1. r'1 is updated to a new value x -2. r'2 is updated to x. -3. r'3 is updated to x. -4. r'4 is updated to x. - -When attributes have many dependencies, it can be difficult to keep track of -the chain reaction of changes triggered by one attribute. - -.. code-block:: uam - - scope 0 chain_reaction(0) { - r'2 = r'1 - r'3 = r'2 - r'4 = r'3 - } - -Evaluation steps: - -1. r'1 is updated to a new value x -2. r'2 is updated to x. - -Note that switching off the chain-reaction and desired clearance allows the -mapper to map 2 attributes in all directions (desired <-> reported) -without any infinite loop. - -.. code-block:: uam - - scope 0 chain_reaction(0) clear_desired(0) { - r'1 = r'2 - r'2 = r'1 - d'1 = d'2 - d'2 = d'1 - } - -.. note:: - - Chain reaction is always active for attribute creations done automatically - by regular assignments. - -For example, considering the following map: - -.. code-block:: uam - - scope 0 chain_reaction(0) { - r'1 = r'2 - } - scope 0 { - r'3 = if (e'1) 1 undefined - } - -If the Reported value of Attribute Type 2 is updated and no Attribute -Type 1 exists, then: - -1. Attribute Type 1 is created. Other maps depending on the existence of -Attribute Type 1 will be evaluated immediately. -2. Attribute Type 3 is (possibly created), then its reported value is set to 1 -3. r'1 is updated to the same value as the reported value of Type 2. - -.. _how_to_write_uam_files_attribute_creaction_subsection: - -Attribute Creations -~~~~~~~~~~~~~~~~~~~ - -Scope configurations allows to change the default attribute creation settings. -For example using the following map: - -.. code-block:: uam - - scope 0 { - r'2 = r'1 - e'3 = r'1 - d'4 = r'1 - } - -If the Reported value of Attribute Type 1 is updated, the mapper will: - -* Create Attribute Type 2 and set its reported value. -* Create Attribute Type 3. -* Not create Attribute Type 4. - -A ``create_attributes`` setting can be used to modify this behavior. Here are -the possible values: - -* 0. will create attributes only when assigning values types ``e``. -* 1. (default) will create attributes when assigning values types ``e`` and ``r`` -* 2. will create attributes when assigning any values type ``e``, ``r`` and ``d`` - -.. _how_to_write_uam_files_common_parent_type_setting_subsection: - -Common Parent Type local override -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The attribute mapper should be configured by default with an Attribute -representing Endpoints, but if mapping needs to happen at another level, -scope settings can locally override the Common Parent Attribute Type using the ``common_parent_type`` scope -configuration. - -.. code-block:: uam - - scope 0 common_parent_type(23) { - // Attribute Type 23 is the "Common Parent Type" for this mapping. - r'2 = r'1 - e'3 = r'1 - d'4 = r'1 - } - -It is recommended to use this setting if mapping have to be done where both -the destination and original attributes are located some levels above or under -the default parent type. - -.. code-block:: uam - - def ep 0x00000004 - scope 0 common_parent_type(3) { - // Set the reported value of attribute 1 to the reported value of - // attribute 1 under endpoint ID 1 to the same value under endpoint 0. - // Equivalent to : r'^.ep[1].1 = r'^.ep[0].1 - r'ep[1].1 = r'ep[0].1 - } - -Instance assignments -'''''''''''''''''''' - -Until now, the examples have been using regular assignments. UAM file allows -to add a ``i:``modifier before the left-hand side of an assignment, which -will make it an instance assignemnt. Here is an example: - -.. code-block:: uam - - scope 0 { - i:r'2 = r'3 - } - -Instance assignments are intended for making sure that an attribute with a certain -value exists or not. Consider the following map: - -.. code-block:: uam - - scope 0 { - // Create an attribute 2 with reported value 1 if r'3 is greater than 0. - i:r'2 = if (r'3 > 0) 1 undefined - // Also create an attribute reported 2 with value 2 if r'3 is greater than 0. - i:r'2 = if (r'3 > 0) 2 undefined - } - -Here the difference, is that regular assignments would end up creating a single -Attribute 2, and will either set the reported value to 1 or 2. - -Instance assignments will create 2 Attributes 2, one with value 1 and one with value 2. -The evaluated values of expression will differ slightly when using instance -assignments. It is recommended to use an index at the end of the left-hand -side to indicate the instance values. - -The value type ``e'`` cannot be used with a instance assignment. It must be -either the reported or the desired value. - -.. code-block:: uam - - scope 0 { - // Here the expression will be interpreted as the value that must exist in the reported value of an attribute 2 - i:r'2 = - // Here the expression will be interpreted as a boolean expression that indicate if the Attribute 2 with Value 1 should exist or not. - i:r'2[1] = - } - -Scope settings with Instance assignments -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Scope priorities are respected within a type of assignment. -There is no guarantee that Instance assignments will run before or after -another type of assignment (regular, clearance), but scope priorities within -the same type of assignement will be respected. - -Scope settings will behave as follow with instance assignments: - -* ``clear_desired``: will have no effect. The desired_value will not be cleared. -* ``chain_reaction``: works normally -* ``common_parent_type``: works normally -* ``create_attributes``: will have no effect. The instance assignement expressions will dictate if attributes are to be created or deleted. - - -Clearance assignments -''''''''''''''''''''' - -Clearance assignments are run by the mapper before the regular assignments, -if the destination already exists. - -Scope priorities are respected within a type of assignment. -There is no guarantee that Clearance assignments will run before or after -another type of assignment (regular, clearance), but scope priorities within -the same type of assignement will be respected. - -Until now, the examples have been using regular assignments. UAM file allows -to add a ``c:``modifier before the left-hand side of an assignment, which -will make it an instance assignemnt. Here is an example: - -The value type ``e'`` cannot be used with a clearance assignment. It must be -either the reported or the desired value. - -.. code-block:: uam - - scope 0 { - // Clear the reported value of attribute 2 if r'3 != 0. - c:r'2 = r'3 - } - -Right-hand sides in clearance assignments are evaluated like a boolean expression. -If the Right-hand side evaluates to: - -* ``0 ``: The value will not be cleared. Stop looking at lower priority clearance maps for the same destination. -* ``!= 0`` : The value will be cleared. Stop looking at lower priority clearance maps for the same destination. -* ``undefined``: Ignore this map and check the lower priority clearance maps for the same destination. - -Scope settings with Clearance assignments -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Scope settings will behave as follow with clearance assignments: - -* ``clear_desired``: will have no effect. -* ``chain_reaction``: works normally -* ``common_parent_type``: works normally -* ``create_attributes``: will have no effect. Clearance assignements will never create or delete attributes. - - -Debugging evaluations -''''''''''''''''''''' - -When the mapper is running, it can be configured to print its evaluations. -Make sure to run with the debug log level enabled for the ``attribute_mapper`` -logging tag. - -For debug builds, it will by default print the left-hand side of the assignment, -the Attribute ID that triggered the change and the calculated value. - -.. code-block:: console - - [mqtt_client] mqtt_client::on_message: ucl/by-unid/zw-F4DC26FF-000D/ep0/Level/Commands/MoveToLevelWithOnOff - {"Level":85,"TransitionTi..., QoS: 0 - [unify_dotdot_attribute_store_level_commands_callbacks] Updating ZCL desired values after Level:CurrentLevel command - [unify_dotdot_attribute_store_level_commands_callbacks] Updating ZCL desired values after Level:OnOffTransitionTime command - [attribute_store_process] Restarting Attribute Store auto-save cooldown timer for 10 seconds. - [unify_attribute_mapper_process] 1 pending attribute updates to evaluate. - [attribute_mapper] Checking assignments for Destination ID 2808 (Value), Original Node 2841 (ZCL Level CurrentLevel). (1 candidate(s)) - [attribute_mapper] Match expression: d'( ( Multilevel Switch State ) ).( ( Value ) ) triggered by Attribute ID 2841 (ZCL Level CurrentLevel) affecting Attribute ID 2808 - Result value: 85 - [unify_attribute_mapper_process] Ignoring update to Attribute ID 2808 as the mapper was instructed to ignore it. - [attribute_mapper] Assigment with priority 0 executed successfully. - [attribute_mapper] Checking assignments for Destination ID 2841 (ZCL Level CurrentLevel), Original Node 2841 (ZCL Level CurrentLevel). (3 candidate(s)) - [attribute_mapper] Match expression: r'( ( ZCL Level CurrentLevel ) ) triggered by Attribute ID 2841 (ZCL Level CurrentLevel) affecting Attribute ID 2841 - Result value: 50.0824 - [attribute_mapper] Assigment with priority 100 executed successfully. - [attribute_mapper] Checking assignments for Destination ID 2849 (Value), Original Node 2841 (ZCL Level CurrentLevel). (5 candidate(s)) - [attribute_mapper] Match expression: d'( ( Color Switch State ) ).( ( Component ID ) )[( ( 0x0 ) )].( ( Value ) ) triggered by Attribute ID 2841 (ZCL Level CurrentLevel) affecting Attribute ID 2849 - Result value: 0 - [attribute_mapper] Assigment with priority 100 executed successfully. - -If the same attribute ID has several assignments, the full expression can -be logged, by changing ``assignment->lhs`` to ``assignment`` in the -``attribute_mapper_engine.cpp``. Assigning different priority to each assignment -is also a good method to identify which assignment was run. - -.. code-block:: cpp - - #ifndef NDEBUG - // Debug build will print the matched expressions - std::stringstream ss; - ss << "Match expression: " << assignment << " triggered by Attribute ID " - << std::dec << original_node << " (" - << attribute_store_get_type_name(original_node.type()) << ")" - << " affecting Attribute ID " << std::dec << destination - << " - Result value: " << value.value(); - sl_log_debug(LOG_TAG, ss.str().c_str()); - #endif - diff --git a/doc/readme_debug.md b/doc/protocol/zwave/readme_debug.md similarity index 100% rename from doc/readme_debug.md rename to doc/protocol/zwave/readme_debug.md diff --git a/doc/protocol/zwave/zpc_introduction.md b/doc/protocol/zwave/zpc_introduction.md index 0e04f8961..68e3893e0 100644 --- a/doc/protocol/zwave/zpc_introduction.md +++ b/doc/protocol/zwave/zpc_introduction.md @@ -9,18 +9,18 @@ hidden: --- ../../../applications/zpc/readme_user.md ../../../applications/zpc/readme_certification.md -../../readme_debug.md +readme_debug.md ../../../applications/zpc/how_to_implement_zwave_command_classes.rst ../../../applications/zpc/how_to_write_uam_files_for_the_zpc.md ../../../applications/zpc/how_to_interact_with_clusters.rst -../../../applications/zpc/doc/supported_command_classes.md +../../../applications/zpc/doc/supported_command_classes.rst ``` The [ZPC User Guide](../../../applications/zpc/readme_user.md) explains how to use and configure ZPC. The [ZPC Z-Wave Certification](../../../applications/zpc/readme_certification.md) page has information about obtaining Z-Wave certification with a Unify Z-Wave gateway. -The [ZPC Debugging Guide](../../readme_debug.md) has tips for debugging a Z-Wave network with Unify. +The [ZPC Debugging Guide](readme_debug.md) has tips for debugging a Z-Wave network with Unify. The guide [How to implement new Z-Wave command classes](../../../applications/zpc/how_to_implement_zwave_command_classes.rst) explains how to add support for additional Z-Wave command classes to support more Z-Wave devices. @@ -28,6 +28,6 @@ The guide [How to write UAM files for ZPC](../../../applications/zpc/how_to_writ The guide [How to interact with clusters](../../../applications/zpc/how_to_interact_with_clusters.rst) goes into detail about the implementation of Cluster in Unify. -The guide [Supported Command Classes](../../../applications/zpc/doc/supported_command_classes.md) goes into detail about how the command class are implemented. This documents gives specifics about the attributes store and MQTT topics that can interact with the class. +The guide [Supported Command Classes](../../../applications/zpc/doc/supported_command_classes.rst) goes into detail about how the command class are implemented. This documents gives specifics about the attributes store and MQTT topics that can interact with the class. -The doxygen generated ZPC API \ No newline at end of file +The doxygen generated ZPC API diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..4a55732a0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ +# YAML -*- mode: yaml; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*- +# SPDX-License-Identifier: Zlib +# SPDX-FileCopyrightText: Silicon Laboratories Inc. https://www.silabs.com +--- + +services: + broker: + image: eclipse-mosquitto:1.6.15 # TODO: 2.0.21 needs config files + ports: + - '1883:1883' + command: mosquitto + logging: + driver: "none" # Disables logging for this service + restart: "no" + stop_signal: SIGTERM + zpc: + image: z-wave-protocol-controller + build: . + command: run --mqtt.host=broker --zpc.serial="${ZPC_DEVICE:-/dev/ttyACM0}" ${ZPC_ARGS:--} + volumes: + - /dev/pts:/dev/pts + devices: + - ${ZPC_DEVICE:-/dev/ttyACM0}:/dev/ttyUSB0 + depends_on: + broker: + condition: service_started + environment: + ZPC_ARGS: "--" diff --git a/docker/host_dependencies.apt b/docker/host_dependencies.apt index 7c2c752c9..4cca326a4 100644 --- a/docker/host_dependencies.apt +++ b/docker/host_dependencies.apt @@ -12,12 +12,8 @@ git // cmake. download gecko_skc and cpc-deamon git-lfs // cmake. download gecko_skc and cpc-deamon graphviz // For docs generation lcov // code coverage report (for local code coverage report) -libasound2 // ZAP generation -libgbm1 // ZAP generation ninja-build // Build system nlohmann-json3-dev // ZigPC, ZPC, testframework, uic_dotdot_mqtt, uic_smartstart_management. Read JSON from a file. -nodejs // DevGUI. JavaScript runtime built on Chrome`s -npm // DevGUI. package manager for the JavaScript runtime environment Node.js openjdk-17-jre // For docs generation parted // For Make SD card in jenkinsfile in Release builds pkg-config // PortableRuntime, Nal, Gms. insert the compiler options on the command line @@ -37,6 +33,4 @@ udev // For Make SD card in jenkinsfile in Release bu unzip // Dockerfile. Unzip files valgrind // Tests. instrumentation framework for building dynamic analysis tools wget // Dockerfile. Downloads -xauth // ZAP generation -xvfb // ZAP generation zip // Zwave_Transports, Doxygen diff --git a/helper.mk b/helper.mk index 16dfb32a7..746ddf4e3 100755 --- a/helper.mk +++ b/helper.mk @@ -16,7 +16,7 @@ url?=https://github.com/SiliconLabsSoftware/z-wave-protocol-controller # https://gitlab.kitware.com/cmake/cmake/-/issues/22813#note_1620373 project_test_dir?=applications project_docs_api_target?=zpc_doxygen -version?=$(shell git describe --tags || echo "0") +version?=$(shell git describe --tags --always 2> /dev/null || echo "0") # Allow overloading from env if needed # VERBOSE?=1 @@ -34,11 +34,12 @@ sudo?=sudo debian_codename?=bookworm packages?=cmake ninja-build build-essential python3-full ruby clang -packages+=git-lfs unp time file +packages+=git-lfs unp time file usbutils bsdutils packages+=nlohmann-json3-dev +packages+=python3-defusedxml # For extract_get.py # TODO: remove for offline build packages+=curl wget python3-pip -packages+=time +packages+=expect # For docs packages+=graphviz @@ -92,6 +93,7 @@ cmake_options+=-DCARGO_TARGET_TRIPLE="${CARGO_TARGET_TRIPLE}" export CMAKE_TARGET_TRIPLE endif +run_file?=${build_dir}/applications/zpc/zpc help: ./helper.mk @echo "# ${project}: ${url}" @@ -99,7 +101,7 @@ help: ./helper.mk @echo "# Usage:" @echo "# ${ Date: Tue, 23 Jan 2024 16:27:50 +0100 -Subject: [PATCH] UIC-3202: Relax compiler warnings to support more compilers +Subject: [PATCH] build: Relax compiler warnings to support more compilers Threating warning as error is a good practice durring development phase, for release it's ok to relax this to support more (future) compilers @@ -17,8 +17,11 @@ Ideally it should be near to release tags. Origin: uic/pull-requests/2704/overview Relate-to: uic/pull-requests/2705/overview?commentId=796680 -Relate-to: /x/FND4Dg#BrainstormItems-Identifystandardsbreakage +Relate-to: c.s.com/x/FND4Dg#BrainstormItems-Identifystandardsbreakage Forwarded: uic/pull-requests/2704/overview +Bug-SiliconLabs: UIC-3202 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/6 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-protocol-controller/issues/71 Signed-off-by: Philippe Coval --- cmake/include/compiler_options.cmake | 4 ++-- @@ -40,5 +43,5 @@ index 751ffe84bd..1f83caa008 100644 # Only add code coverage when CMAKE_GCOV is True if(CMAKE_GCOV) -- -2.39.5 +2.43.0 diff --git a/patches/UnifySDK/0002-tests-components-testframework-libs-cmock-Remove-ven.patch b/patches/UnifySDK/0002-tests-components-testframework-libs-cmock-Remove-ven.patch new file mode 100644 index 000000000..a612ec335 --- /dev/null +++ b/patches/UnifySDK/0002-tests-components-testframework-libs-cmock-Remove-ven.patch @@ -0,0 +1,106323 @@ +From c63ab0efe42bb2d4e4a5c818b1a36a1837569c4c Mon Sep 17 00:00:00 2001 +From: Philippe Coval +Date: Mon, 10 Mar 2025 14:28:26 +0100 +Subject: [PATCH] tests: components/testframework/libs/cmock: Remove vendored + CMock + +CMake script will be used to fetch from upstream + +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-protocol-controller/issues/60 +Bug-SiliconLabs: UIC-3312 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/6 +Signed-off-by: Philippe Coval +--- + .../testframework/libs/cmock/.travis.yml | 28 - + components/testframework/libs/cmock/Gemfile | 8 - + .../testframework/libs/cmock/LICENSE.txt | 19 - + components/testframework/libs/cmock/README.md | 34 - + .../cmock/config/production_environment.rb | 12 - + .../libs/cmock/config/test_environment.rb | 16 - + .../libs/cmock/docs/CMock_Summary.md | 806 --- + .../docs/ThrowTheSwitchCodingStandard.md | 207 - + .../libs/cmock/examples/make_example/Makefile | 30 - + .../cmock/examples/make_example/src/foo.c | 5 - + .../cmock/examples/make_example/src/foo.h | 5 - + .../cmock/examples/make_example/src/main.c | 15 - + .../examples/make_example/test/test_foo.c | 17 - + .../examples/make_example/test/test_main.c | 15 - + .../libs/cmock/examples/temp_sensor/gcc.yml | 44 - + .../cmock/examples/temp_sensor/iar_v4.yml | 92 - + .../cmock/examples/temp_sensor/iar_v5.yml | 81 - + .../cmock/examples/temp_sensor/rakefile.rb | 42 - + .../examples/temp_sensor/rakefile_helper.rb | 268 - + .../examples/temp_sensor/src/AT91SAM7X256.h | 2556 --------- + .../examples/temp_sensor/src/AdcConductor.c | 42 - + .../examples/temp_sensor/src/AdcConductor.h | 11 - + .../examples/temp_sensor/src/AdcHardware.c | 27 - + .../examples/temp_sensor/src/AdcHardware.h | 9 - + .../temp_sensor/src/AdcHardwareConfigurator.c | 18 - + .../temp_sensor/src/AdcHardwareConfigurator.h | 10 - + .../cmock/examples/temp_sensor/src/AdcModel.c | 33 - + .../cmock/examples/temp_sensor/src/AdcModel.h | 13 - + .../temp_sensor/src/AdcTemperatureSensor.c | 51 - + .../temp_sensor/src/AdcTemperatureSensor.h | 10 - + .../cmock/examples/temp_sensor/src/Executor.c | 25 - + .../cmock/examples/temp_sensor/src/Executor.h | 9 - + .../temp_sensor/src/IntrinsicsWrapper.c | 18 - + .../temp_sensor/src/IntrinsicsWrapper.h | 7 - + .../cmock/examples/temp_sensor/src/Main.c | 46 - + .../cmock/examples/temp_sensor/src/Main.h | 7 - + .../cmock/examples/temp_sensor/src/Model.c | 10 - + .../cmock/examples/temp_sensor/src/Model.h | 8 - + .../examples/temp_sensor/src/ModelConfig.h | 7 - + .../examples/temp_sensor/src/TaskScheduler.c | 72 - + .../examples/temp_sensor/src/TaskScheduler.h | 11 - + .../temp_sensor/src/TemperatureCalculator.c | 27 - + .../temp_sensor/src/TemperatureCalculator.h | 6 - + .../temp_sensor/src/TemperatureFilter.c | 39 - + .../temp_sensor/src/TemperatureFilter.h | 10 - + .../examples/temp_sensor/src/TimerConductor.c | 15 - + .../examples/temp_sensor/src/TimerConductor.h | 9 - + .../temp_sensor/src/TimerConfigurator.c | 51 - + .../temp_sensor/src/TimerConfigurator.h | 15 - + .../examples/temp_sensor/src/TimerHardware.c | 15 - + .../examples/temp_sensor/src/TimerHardware.h | 8 - + .../src/TimerInterruptConfigurator.c | 55 - + .../src/TimerInterruptConfigurator.h | 13 - + .../temp_sensor/src/TimerInterruptHandler.c | 25 - + .../temp_sensor/src/TimerInterruptHandler.h | 10 - + .../examples/temp_sensor/src/TimerModel.c | 9 - + .../examples/temp_sensor/src/TimerModel.h | 8 - + .../cmock/examples/temp_sensor/src/Types.h | 103 - + .../src/UsartBaudRateRegisterCalculator.c | 18 - + .../src/UsartBaudRateRegisterCalculator.h | 6 - + .../examples/temp_sensor/src/UsartConductor.c | 21 - + .../examples/temp_sensor/src/UsartConductor.h | 7 - + .../temp_sensor/src/UsartConfigurator.c | 39 - + .../temp_sensor/src/UsartConfigurator.h | 13 - + .../examples/temp_sensor/src/UsartHardware.c | 22 - + .../examples/temp_sensor/src/UsartHardware.h | 9 - + .../examples/temp_sensor/src/UsartModel.c | 34 - + .../examples/temp_sensor/src/UsartModel.h | 10 - + .../examples/temp_sensor/src/UsartPutChar.c | 16 - + .../examples/temp_sensor/src/UsartPutChar.h | 8 - + .../src/UsartTransmitBufferStatus.c | 7 - + .../src/UsartTransmitBufferStatus.h | 8 - + .../temp_sensor/test/TestAdcConductor.c | 121 - + .../temp_sensor/test/TestAdcHardware.c | 44 - + .../test/TestAdcHardwareConfigurator.c | 43 - + .../examples/temp_sensor/test/TestAdcModel.c | 33 - + .../test/TestAdcTemperatureSensor.c | 47 - + .../examples/temp_sensor/test/TestExecutor.c | 36 - + .../examples/temp_sensor/test/TestMain.c | 24 - + .../examples/temp_sensor/test/TestModel.c | 20 - + .../temp_sensor/test/TestTaskScheduler.c | 104 - + .../test/TestTemperatureCalculator.c | 33 - + .../temp_sensor/test/TestTemperatureFilter.c | 69 - + .../temp_sensor/test/TestTimerConductor.c | 32 - + .../temp_sensor/test/TestTimerConfigurator.c | 112 - + .../temp_sensor/test/TestTimerHardware.c | 26 - + .../test/TestTimerInterruptConfigurator.c | 78 - + .../test/TestTimerInterruptHandler.c | 66 - + .../temp_sensor/test/TestTimerModel.c | 18 - + .../TestUsartBaudRateRegisterCalculator.c | 21 - + .../temp_sensor/test/TestUsartConductor.c | 40 - + .../temp_sensor/test/TestUsartConfigurator.c | 77 - + .../temp_sensor/test/TestUsartHardware.c | 37 - + .../temp_sensor/test/TestUsartModel.c | 40 - + .../temp_sensor/test/TestUsartPutChar.c | 43 - + .../test/TestUsartTransmitBufferStatus.c | 22 - + .../testframework/libs/cmock/lib/cmock.rb | 104 - + .../libs/cmock/lib/cmock_config.rb | 173 - + .../libs/cmock/lib/cmock_file_writer.rb | 48 - + .../libs/cmock/lib/cmock_generator.rb | 333 -- + .../cmock/lib/cmock_generator_plugin_array.rb | 63 - + .../lib/cmock_generator_plugin_callback.rb | 88 - + .../lib/cmock_generator_plugin_cexception.rb | 49 - + .../lib/cmock_generator_plugin_expect.rb | 100 - + .../cmock_generator_plugin_expect_any_args.rb | 50 - + .../lib/cmock_generator_plugin_ignore.rb | 88 - + .../lib/cmock_generator_plugin_ignore_arg.rb | 42 - + .../cmock_generator_plugin_return_thru_ptr.rb | 79 - + .../libs/cmock/lib/cmock_generator_utils.rb | 247 - + .../libs/cmock/lib/cmock_header_parser.rb | 595 --- + .../libs/cmock/lib/cmock_plugin_manager.rb | 50 - + .../cmock/lib/cmock_unityhelper_parser.rb | 77 - + .../testframework/libs/cmock/meson.build | 53 - + .../libs/cmock/scripts/create_makefile.rb | 203 - + .../libs/cmock/scripts/create_mock.rb | 8 - + .../libs/cmock/scripts/create_runner.rb | 18 - + .../libs/cmock/scripts/test_summary.rb | 18 - + .../testframework/libs/cmock/src/cmock.c | 216 - + .../testframework/libs/cmock/src/cmock.h | 41 - + .../libs/cmock/src/cmock_internals.h | 91 - + .../testframework/libs/cmock/src/meson.build | 12 - + .../libs/cmock/test/c/TestCMockC.c | 333 -- + .../libs/cmock/test/c/TestCMockC.yml | 14 - + .../libs/cmock/test/c/TestCMockCDynamic.c | 186 - + .../libs/cmock/test/c/TestCMockCDynamic.yml | 12 - + .../cmock/test/c/TestCMockCDynamic_Runner.c | 36 - + .../libs/cmock/test/c/TestCMockC_Runner.c | 41 - + .../test/iar/iar_v4/Resource/SAM7_FLASH.mac | 71 - + .../test/iar/iar_v4/Resource/SAM7_RAM.mac | 94 - + .../test/iar/iar_v4/Resource/SAM7_SIM.mac | 67 - + .../iar_v4/Resource/at91SAM7X256_FLASH.xcl | 185 - + .../iar/iar_v4/Resource/at91SAM7X256_RAM.xcl | 185 - + .../iar/iar_v4/Resource/ioat91sam7x256.ddf | 2259 -------- + .../libs/cmock/test/iar/iar_v4/cmock_demo.dep | 3691 ------------- + .../libs/cmock/test/iar/iar_v4/cmock_demo.ewd | 1696 ------ + .../libs/cmock/test/iar/iar_v4/cmock_demo.ewp | 2581 --------- + .../libs/cmock/test/iar/iar_v4/cmock_demo.eww | 10 - + .../test/iar/iar_v4/incIAR/AT91SAM7X-EK.h | 61 - + .../test/iar/iar_v4/incIAR/AT91SAM7X256.inc | 2314 -------- + .../test/iar/iar_v4/incIAR/AT91SAM7X256.rdf | 4704 ----------------- + .../test/iar/iar_v4/incIAR/AT91SAM7X256.tcl | 3407 ------------ + .../test/iar/iar_v4/incIAR/AT91SAM7X256_inc.h | 2268 -------- + .../test/iar/iar_v4/incIAR/ioat91sam7x256.h | 4380 --------------- + .../test/iar/iar_v4/incIAR/lib_AT91SAM7X256.h | 4211 --------------- + .../iar/iar_v4/settings/cmock_demo.cspy.bat | 32 - + .../test/iar/iar_v4/settings/cmock_demo.dbgdt | 86 - + .../test/iar/iar_v4/settings/cmock_demo.dni | 42 - + .../test/iar/iar_v4/settings/cmock_demo.wsdt | 76 - + .../cmock/test/iar/iar_v4/srcIAR/Cstartup.s79 | 266 - + .../test/iar/iar_v4/srcIAR/Cstartup_SAM7.c | 98 - + .../test/iar/iar_v5/Resource/SAM7_FLASH.mac | 71 - + .../test/iar/iar_v5/Resource/SAM7_RAM.mac | 94 - + .../test/iar/iar_v5/Resource/SAM7_SIM.mac | 67 - + .../iar_v5/Resource/at91SAM7X256_FLASH.icf | 43 - + .../iar/iar_v5/Resource/at91SAM7X256_RAM.icf | 42 - + .../libs/cmock/test/iar/iar_v5/cmock_demo.dep | 4204 --------------- + .../libs/cmock/test/iar/iar_v5/cmock_demo.ewd | 1906 ------- + .../libs/cmock/test/iar/iar_v5/cmock_demo.ewp | 2426 --------- + .../libs/cmock/test/iar/iar_v5/cmock_demo.eww | 26 - + .../test/iar/iar_v5/incIAR/AT91SAM7X-EK.h | 61 - + .../test/iar/iar_v5/incIAR/AT91SAM7X256_inc.h | 2268 -------- + .../test/iar/iar_v5/incIAR/lib_AT91SAM7X256.h | 4211 --------------- + .../cmock/test/iar/iar_v5/incIAR/project.h | 30 - + .../settings/BasicInterrupt_SAM7X.cspy.bat | 33 - + .../settings/BasicInterrupt_SAM7X.dbgdt | 5 - + .../iar_v5/settings/BasicInterrupt_SAM7X.dni | 18 - + .../iar_v5/settings/BasicInterrupt_SAM7X.wsdt | 74 - + .../BasicInterrupt_SAM7X_FLASH_Debug.jlink | 12 - + .../iar/iar_v5/settings/cmock_demo.cspy.bat | 33 - + .../test/iar/iar_v5/settings/cmock_demo.dbgdt | 85 - + .../test/iar/iar_v5/settings/cmock_demo.dni | 44 - + .../test/iar/iar_v5/settings/cmock_demo.wsdt | 73 - + .../iar_v5/settings/cmock_demo_Binary.jlink | 12 - + .../settings/cmock_demo_FLASH_Debug.jlink | 12 - + .../settings/cmock_demo_RAM_Debug.jlink | 12 - + .../cmock/test/iar/iar_v5/srcIAR/Cstartup.s | 299 -- + .../test/iar/iar_v5/srcIAR/Cstartup_SAM7.c | 98 - + .../testframework/libs/cmock/test/rakefile | 147 - + .../libs/cmock/test/rakefile_helper.rb | 403 -- + .../cmock/test/system/systest_generator.rb | 205 - + .../system/test_compilation/callingconv.h | 11 - + .../test/system/test_compilation/config.yml | 10 - + .../test/system/test_compilation/const.h | 37 - + .../test/system/test_compilation/inline.h | 23 - + .../cmock/test/system/test_compilation/osek.h | 275 - + .../test/system/test_compilation/parsing.h | 89 - + .../all_plugins_but_other_limits.yml | 375 -- + .../test_interactions/all_plugins_coexist.yml | 460 -- + .../array_and_pointer_handling.yml | 446 -- + .../basic_expect_and_return.yml | 124 - + .../const_primitives_handling.yml | 87 - + .../doesnt_leave_details_behind.yml | 308 -- + .../enforce_strict_ordering.yml | 247 - + .../expect_and_return_custom_types.yml | 108 - + .../expect_and_return_treat_as.yml | 173 - + .../test_interactions/expect_and_throw.yml | 170 - + .../test_interactions/expect_any_args.yml | 238 - + .../fancy_pointer_handling.yml | 210 - + .../function_pointer_handling.yml | 83 - + .../test_interactions/ignore_and_return.yml | 329 -- + .../ignore_strict_mock_calling.yml | 37 - + .../newer_standards_stuff1.yml | 52 - + .../nonstandard_parsed_stuff_1.yml | 91 - + .../nonstandard_parsed_stuff_2.yml | 59 - + .../test_interactions/out_of_memory.yml | 65 - + .../test_interactions/parsing_challenges.yml | 242 - + .../return_thru_ptr_and_expect_any_args.yml | 235 - + .../return_thru_ptr_ignore_arg.yml | 231 - + .../system/test_interactions/skeleton.yml | 55 - + .../test_interactions/skeleton_update.yml | 76 - + .../struct_union_enum_expect_and_return.yml | 277 - + ...on_enum_expect_and_return_with_plugins.yml | 280 - + .../stubs_with_callbacks.yml | 221 - + .../test_interactions/unity_64bit_support.yml | 77 - + .../test_interactions/unity_ignores.yml | 139 - + .../unity_void_pointer_compare.yml | 91 - + .../libs/cmock/test/targets/clang_strict.yml | 90 - + .../libs/cmock/test/targets/gcc.yml | 58 - + .../libs/cmock/test/targets/gcc_64.yml | 58 - + .../libs/cmock/test/targets/gcc_tiny.yml | 80 - + .../libs/cmock/test/targets/iar_arm_v4.yml | 110 - + .../libs/cmock/test/targets/iar_arm_v5.yml | 95 - + .../libs/cmock/test/test_helper.rb | 44 - + .../libs/cmock/test/unit/cmock_config_test.rb | 126 - + .../cmock/test/unit/cmock_config_test.yml | 7 - + .../cmock/test/unit/cmock_file_writer_test.rb | 27 - + .../test/unit/cmock_generator_main_test.rb | 686 --- + .../unit/cmock_generator_plugin_array_test.rb | 141 - + .../cmock_generator_plugin_callback_test.rb | 281 - + .../cmock_generator_plugin_cexception_test.rb | 96 - + .../cmock_generator_plugin_expect_a_test.rb | 185 - + ...k_generator_plugin_expect_any_args_test.rb | 67 - + .../cmock_generator_plugin_expect_b_test.rb | 201 - + .../cmock_generator_plugin_ignore_arg_test.rb | 116 - + .../cmock_generator_plugin_ignore_test.rb | 119 - + ...k_generator_plugin_return_thru_ptr_test.rb | 136 - + .../test/unit/cmock_generator_utils_test.rb | 398 -- + .../test/unit/cmock_header_parser_test.rb | 2717 ---------- + .../test/unit/cmock_plugin_manager_test.rb | 100 - + .../unit/cmock_unityhelper_parser_test.rb | 223 - + .../libs/cmock/vendor/behaviors/Manifest.txt | 9 - + .../libs/cmock/vendor/behaviors/Rakefile | 19 - + .../cmock/vendor/behaviors/lib/behaviors.rb | 76 - + .../behaviors/lib/behaviors/reporttask.rb | 158 - + .../behaviors/test/behaviors_tasks_test.rb | 73 - + .../vendor/behaviors/test/behaviors_test.rb | 50 - + .../vendor/behaviors/test/tasks_test/Rakefile | 19 - + .../behaviors/test/tasks_test/lib/user.rb | 2 - + .../test/tasks_test/test/user_test.rb | 17 - + .../libs/cmock/vendor/c_exception/.travis.yml | 16 - + .../libs/cmock/vendor/c_exception/Gemfile | 4 - + .../cmock/vendor/c_exception/Gemfile.lock | 12 - + .../libs/cmock/vendor/c_exception/README.md | 249 - + .../vendor/c_exception/docs/CException.md | 332 -- + .../docs/ThrowTheSwitchCodingStandard.md | 207 - + .../cmock/vendor/c_exception/lib/CException.c | 46 - + .../cmock/vendor/c_exception/lib/CException.h | 115 - + .../cmock/vendor/c_exception/lib/meson.build | 11 - + .../libs/cmock/vendor/c_exception/meson.build | 48 - + .../libs/cmock/vendor/c_exception/project.yml | 37 - + .../vendor/c_exception/test/TestException.c | 391 -- + .../test/support/CExceptionConfig.h | 46 - + .../libs/cmock/vendor/unity/.editorconfig | 27 - + .../libs/cmock/vendor/unity/.travis.yml | 26 - + .../libs/cmock/vendor/unity/CMakeLists.txt | 133 - + .../libs/cmock/vendor/unity/LICENSE.txt | 21 - + .../libs/cmock/vendor/unity/README.md | 191 - + .../cmock/vendor/unity/auto/colour_prompt.rb | 119 - + .../vendor/unity/auto/colour_reporter.rb | 39 - + .../vendor/unity/auto/generate_config.yml | 36 - + .../vendor/unity/auto/generate_module.rb | 312 -- + .../vendor/unity/auto/generate_test_runner.rb | 511 -- + .../cmock/vendor/unity/auto/parse_output.rb | 322 -- + .../libs/cmock/vendor/unity/auto/run_test.erb | 37 - + .../vendor/unity/auto/stylize_as_junit.rb | 251 - + .../vendor/unity/auto/test_file_filter.rb | 25 - + .../cmock/vendor/unity/auto/type_sanitizer.rb | 6 - + .../vendor/unity/auto/unity_test_summary.py | 139 - + .../vendor/unity/auto/unity_test_summary.rb | 135 - + .../cmock/vendor/unity/auto/unity_to_junit.py | 146 - + .../docs/ThrowTheSwitchCodingStandard.md | 206 - + ...tSuitableforPrintingandPossiblyFraming.pdf | Bin 144467 -> 0 bytes + .../unity/docs/UnityAssertionsReference.md | 831 --- + .../unity/docs/UnityConfigurationGuide.md | 563 -- + .../unity/docs/UnityGettingStartedGuide.md | 251 - + .../unity/docs/UnityHelperScriptsGuide.md | 278 - + .../vendor/unity/examples/example_1/makefile | 72 - + .../unity/examples/example_1/readme.txt | 5 - + .../examples/example_1/src/ProductionCode.c | 24 - + .../examples/example_1/src/ProductionCode.h | 3 - + .../examples/example_1/src/ProductionCode2.c | 11 - + .../examples/example_1/src/ProductionCode2.h | 2 - + .../example_1/test/TestProductionCode.c | 62 - + .../example_1/test/TestProductionCode2.c | 31 - + .../test_runners/TestProductionCode2_Runner.c | 53 - + .../test_runners/TestProductionCode_Runner.c | 57 - + .../vendor/unity/examples/example_2/makefile | 71 - + .../unity/examples/example_2/readme.txt | 5 - + .../examples/example_2/src/ProductionCode.c | 24 - + .../examples/example_2/src/ProductionCode.h | 3 - + .../examples/example_2/src/ProductionCode2.c | 11 - + .../examples/example_2/src/ProductionCode2.h | 2 - + .../example_2/test/TestProductionCode.c | 64 - + .../example_2/test/TestProductionCode2.c | 33 - + .../test_runners/TestProductionCode2_Runner.c | 9 - + .../test_runners/TestProductionCode_Runner.c | 11 - + .../example_2/test/test_runners/all_tests.c | 12 - + .../examples/example_3/helper/UnityHelper.c | 10 - + .../examples/example_3/helper/UnityHelper.h | 12 - + .../unity/examples/example_3/rakefile.rb | 38 - + .../examples/example_3/rakefile_helper.rb | 250 - + .../unity/examples/example_3/readme.txt | 13 - + .../examples/example_3/src/ProductionCode.c | 24 - + .../examples/example_3/src/ProductionCode.h | 3 - + .../examples/example_3/src/ProductionCode2.c | 11 - + .../examples/example_3/src/ProductionCode2.h | 2 - + .../examples/example_3/target_gcc_32.yml | 47 - + .../example_3/test/TestProductionCode.c | 62 - + .../example_3/test/TestProductionCode2.c | 31 - + .../unity/examples/example_4/meson.build | 12 - + .../unity/examples/example_4/readme.txt | 15 - + .../examples/example_4/src/ProductionCode.c | 24 - + .../examples/example_4/src/ProductionCode.h | 3 - + .../examples/example_4/src/ProductionCode2.c | 11 - + .../examples/example_4/src/ProductionCode2.h | 2 - + .../unity/examples/example_4/src/meson.build | 16 - + .../examples/example_4/subprojects/unity.wrap | 4 - + .../example_4/test/TestProductionCode.c | 63 - + .../example_4/test/TestProductionCode2.c | 35 - + .../unity/examples/example_4/test/meson.build | 7 - + .../test_runners/TestProductionCode2_Runner.c | 53 - + .../test_runners/TestProductionCode_Runner.c | 57 - + .../example_4/test/test_runners/meson.build | 13 - + .../vendor/unity/examples/unity_config.h | 244 - + .../unity/extras/eclipse/error_parsers.txt | 26 - + .../vendor/unity/extras/fixture/readme.md | 29 - + .../unity/extras/fixture/src/unity_fixture.c | 310 -- + .../unity/extras/fixture/src/unity_fixture.h | 83 - + .../fixture/src/unity_fixture_internals.h | 50 - + .../vendor/unity/extras/fixture/test/Makefile | 72 - + .../unity/extras/fixture/test/main/AllTests.c | 20 - + .../fixture/test/template_fixture_tests.c | 39 - + .../extras/fixture/test/unity_fixture_Test.c | 245 - + .../fixture/test/unity_fixture_TestRunner.c | 32 - + .../vendor/unity/extras/memory/readme.md | 49 - + .../unity/extras/memory/src/unity_memory.c | 202 - + .../unity/extras/memory/src/unity_memory.h | 60 - + .../vendor/unity/extras/memory/test/Makefile | 78 - + .../extras/memory/test/unity_memory_Test.c | 325 -- + .../memory/test/unity_memory_TestRunner.c | 49 - + .../extras/memory/test/unity_output_Spy.c | 56 - + .../extras/memory/test/unity_output_Spy.h | 16 - + .../libs/cmock/vendor/unity/meson.build | 48 - + .../libs/cmock/vendor/unity/src/meson.build | 11 - + .../libs/cmock/vendor/unity/src/unity.c | 2109 -------- + .../libs/cmock/vendor/unity/src/unity.h | 661 --- + .../cmock/vendor/unity/src/unity_internals.h | 1030 ---- + .../libs/cmock/vendor/unity/test/.rubocop.yml | 76 - + .../libs/cmock/vendor/unity/test/Makefile | 159 - + .../unity/test/expectdata/testsample_cmd.c | 61 - + .../unity/test/expectdata/testsample_def.c | 57 - + .../unity/test/expectdata/testsample_head1.c | 55 - + .../unity/test/expectdata/testsample_head1.h | 15 - + .../test/expectdata/testsample_mock_cmd.c | 80 - + .../test/expectdata/testsample_mock_def.c | 76 - + .../test/expectdata/testsample_mock_head1.c | 75 - + .../test/expectdata/testsample_mock_head1.h | 13 - + .../test/expectdata/testsample_mock_new1.c | 89 - + .../test/expectdata/testsample_mock_new2.c | 89 - + .../test/expectdata/testsample_mock_param.c | 77 - + .../test/expectdata/testsample_mock_run1.c | 89 - + .../test/expectdata/testsample_mock_run2.c | 89 - + .../test/expectdata/testsample_mock_yaml.c | 90 - + .../unity/test/expectdata/testsample_new1.c | 67 - + .../unity/test/expectdata/testsample_new2.c | 70 - + .../unity/test/expectdata/testsample_param.c | 58 - + .../unity/test/expectdata/testsample_run1.c | 67 - + .../unity/test/expectdata/testsample_run2.c | 70 - + .../unity/test/expectdata/testsample_yaml.c | 71 - + .../libs/cmock/vendor/unity/test/rakefile | 163 - + .../vendor/unity/test/rakefile_helper.rb | 315 -- + .../generate_module_existing_file_spec.rb | 158 - + .../cmock/vendor/unity/test/targets/ansi.yml | 44 - + .../vendor/unity/test/targets/clang_file.yml | 72 - + .../unity/test/targets/clang_strict.yml | 71 - + .../vendor/unity/test/targets/gcc_32.yml | 45 - + .../vendor/unity/test/targets/gcc_64.yml | 46 - + .../unity/test/targets/gcc_auto_limits.yml | 43 - + .../unity/test/targets/gcc_auto_stdint.yml | 55 - + .../unity/test/targets/gcc_manual_math.yml | 43 - + .../unity/test/targets/hitech_picc18.yml | 91 - + .../vendor/unity/test/targets/iar_arm_v4.yml | 98 - + .../vendor/unity/test/targets/iar_arm_v5.yml | 92 - + .../unity/test/targets/iar_arm_v5_3.yml | 92 - + .../targets/iar_armcortex_LM3S9B92_v5_4.yml | 90 - + .../unity/test/targets/iar_cortexm3_v5.yml | 94 - + .../vendor/unity/test/targets/iar_msp430.yml | 112 - + .../vendor/unity/test/targets/iar_sh2a_v6.yml | 99 - + .../vendor/unity/test/testdata/CException.h | 11 - + .../cmock/vendor/unity/test/testdata/Defs.h | 8 - + .../cmock/vendor/unity/test/testdata/cmock.h | 14 - + .../vendor/unity/test/testdata/mockMock.h | 13 - + .../unity/test/testdata/testRunnerGenerator.c | 189 - + .../test/testdata/testRunnerGeneratorSmall.c | 70 - + .../testdata/testRunnerGeneratorWithMocks.c | 197 - + .../unity/test/tests/self_assessment_utils.h | 144 - + .../test/tests/test_generate_test_runner.rb | 1260 ----- + .../unity/test/tests/test_unity_arrays.c | 2874 ---------- + .../vendor/unity/test/tests/test_unity_core.c | 371 -- + .../unity/test/tests/test_unity_doubles.c | 773 --- + .../unity/test/tests/test_unity_floats.c | 884 ---- + .../unity/test/tests/test_unity_integers.c | 2847 ---------- + .../unity/test/tests/test_unity_integers_64.c | 773 --- + .../unity/test/tests/test_unity_memory.c | 81 - + .../test/tests/test_unity_parameterized.c | 171 - + .../unity/test/tests/test_unity_strings.c | 329 -- + .../libs/cmock/vendor/unity/unityConfig.cmake | 1 - + 417 files changed, 100219 deletions(-) + delete mode 100644 components/testframework/libs/cmock/.travis.yml + delete mode 100644 components/testframework/libs/cmock/Gemfile + delete mode 100644 components/testframework/libs/cmock/LICENSE.txt + delete mode 100644 components/testframework/libs/cmock/README.md + delete mode 100644 components/testframework/libs/cmock/config/production_environment.rb + delete mode 100644 components/testframework/libs/cmock/config/test_environment.rb + delete mode 100644 components/testframework/libs/cmock/docs/CMock_Summary.md + delete mode 100644 components/testframework/libs/cmock/docs/ThrowTheSwitchCodingStandard.md + delete mode 100644 components/testframework/libs/cmock/examples/make_example/Makefile + delete mode 100644 components/testframework/libs/cmock/examples/make_example/src/foo.c + delete mode 100644 components/testframework/libs/cmock/examples/make_example/src/foo.h + delete mode 100644 components/testframework/libs/cmock/examples/make_example/src/main.c + delete mode 100644 components/testframework/libs/cmock/examples/make_example/test/test_foo.c + delete mode 100644 components/testframework/libs/cmock/examples/make_example/test/test_main.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/gcc.yml + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/iar_v4.yml + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/iar_v5.yml + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/rakefile.rb + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/rakefile_helper.rb + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AT91SAM7X256.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/Executor.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/Executor.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/Main.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/Main.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/Model.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/Model.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/ModelConfig.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/Types.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.h + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcConductor.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardware.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardwareConfigurator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcModel.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcTemperatureSensor.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestExecutor.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestMain.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestModel.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestTaskScheduler.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureCalculator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureFilter.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConductor.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConfigurator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerHardware.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptConfigurator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptHandler.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerModel.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConductor.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConfigurator.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartHardware.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartModel.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartPutChar.c + delete mode 100644 components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartTransmitBufferStatus.c + delete mode 100644 components/testframework/libs/cmock/lib/cmock.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_config.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_file_writer.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_generator.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_generator_plugin_array.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_generator_plugin_callback.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_generator_plugin_cexception.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_generator_plugin_expect.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_generator_plugin_expect_any_args.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore_arg.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_generator_utils.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_header_parser.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_plugin_manager.rb + delete mode 100644 components/testframework/libs/cmock/lib/cmock_unityhelper_parser.rb + delete mode 100755 components/testframework/libs/cmock/meson.build + delete mode 100644 components/testframework/libs/cmock/scripts/create_makefile.rb + delete mode 100644 components/testframework/libs/cmock/scripts/create_mock.rb + delete mode 100644 components/testframework/libs/cmock/scripts/create_runner.rb + delete mode 100644 components/testframework/libs/cmock/scripts/test_summary.rb + delete mode 100644 components/testframework/libs/cmock/src/cmock.c + delete mode 100644 components/testframework/libs/cmock/src/cmock.h + delete mode 100644 components/testframework/libs/cmock/src/cmock_internals.h + delete mode 100644 components/testframework/libs/cmock/src/meson.build + delete mode 100644 components/testframework/libs/cmock/test/c/TestCMockC.c + delete mode 100644 components/testframework/libs/cmock/test/c/TestCMockC.yml + delete mode 100644 components/testframework/libs/cmock/test/c/TestCMockCDynamic.c + delete mode 100644 components/testframework/libs/cmock/test/c/TestCMockCDynamic.yml + delete mode 100644 components/testframework/libs/cmock/test/c/TestCMockCDynamic_Runner.c + delete mode 100644 components/testframework/libs/cmock/test/c/TestCMockC_Runner.c + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_FLASH.mac + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_RAM.mac + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_SIM.mac + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_FLASH.xcl + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_RAM.xcl + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/Resource/ioat91sam7x256.ddf + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.dep + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewd + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewp + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.eww + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X-EK.h + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.inc + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.rdf + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.tcl + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256_inc.h + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/incIAR/ioat91sam7x256.h + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/incIAR/lib_AT91SAM7X256.h + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.cspy.bat + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dbgdt + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dni + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.wsdt + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup.s79 + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup_SAM7.c + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_FLASH.mac + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_RAM.mac + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_SIM.mac + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_FLASH.icf + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_RAM.icf + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.dep + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewd + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewp + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.eww + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X-EK.h + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X256_inc.h + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/incIAR/lib_AT91SAM7X256.h + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/incIAR/project.h + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dni + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.wsdt + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.cspy.bat + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dbgdt + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dni + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.wsdt + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_Binary.jlink + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_FLASH_Debug.jlink + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_RAM_Debug.jlink + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup.s + delete mode 100644 components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup_SAM7.c + delete mode 100644 components/testframework/libs/cmock/test/rakefile + delete mode 100644 components/testframework/libs/cmock/test/rakefile_helper.rb + delete mode 100644 components/testframework/libs/cmock/test/system/systest_generator.rb + delete mode 100644 components/testframework/libs/cmock/test/system/test_compilation/callingconv.h + delete mode 100644 components/testframework/libs/cmock/test/system/test_compilation/config.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_compilation/const.h + delete mode 100644 components/testframework/libs/cmock/test/system/test_compilation/inline.h + delete mode 100644 components/testframework/libs/cmock/test/system/test_compilation/osek.h + delete mode 100644 components/testframework/libs/cmock/test/system/test_compilation/parsing.h + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/all_plugins_coexist.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/array_and_pointer_handling.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/basic_expect_and_return.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/const_primitives_handling.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/doesnt_leave_details_behind.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/enforce_strict_ordering.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_custom_types.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_treat_as.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/expect_and_throw.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/expect_any_args.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/fancy_pointer_handling.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/function_pointer_handling.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/ignore_and_return.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/ignore_strict_mock_calling.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/newer_standards_stuff1.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_1.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/out_of_memory.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/parsing_challenges.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/skeleton.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/skeleton_update.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return_with_plugins.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/stubs_with_callbacks.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/unity_64bit_support.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/unity_ignores.yml + delete mode 100644 components/testframework/libs/cmock/test/system/test_interactions/unity_void_pointer_compare.yml + delete mode 100644 components/testframework/libs/cmock/test/targets/clang_strict.yml + delete mode 100644 components/testframework/libs/cmock/test/targets/gcc.yml + delete mode 100644 components/testframework/libs/cmock/test/targets/gcc_64.yml + delete mode 100644 components/testframework/libs/cmock/test/targets/gcc_tiny.yml + delete mode 100644 components/testframework/libs/cmock/test/targets/iar_arm_v4.yml + delete mode 100644 components/testframework/libs/cmock/test/targets/iar_arm_v5.yml + delete mode 100644 components/testframework/libs/cmock/test/test_helper.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_config_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_config_test.yml + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_file_writer_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_main_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_plugin_array_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_plugin_callback_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_plugin_cexception_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_generator_utils_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_header_parser_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_plugin_manager_test.rb + delete mode 100644 components/testframework/libs/cmock/test/unit/cmock_unityhelper_parser_test.rb + delete mode 100644 components/testframework/libs/cmock/vendor/behaviors/Manifest.txt + delete mode 100644 components/testframework/libs/cmock/vendor/behaviors/Rakefile + delete mode 100644 components/testframework/libs/cmock/vendor/behaviors/lib/behaviors.rb + delete mode 100644 components/testframework/libs/cmock/vendor/behaviors/lib/behaviors/reporttask.rb + delete mode 100644 components/testframework/libs/cmock/vendor/behaviors/test/behaviors_tasks_test.rb + delete mode 100644 components/testframework/libs/cmock/vendor/behaviors/test/behaviors_test.rb + delete mode 100644 components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/Rakefile + delete mode 100644 components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/lib/user.rb + delete mode 100644 components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/test/user_test.rb + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/.travis.yml + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/Gemfile + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/Gemfile.lock + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/README.md + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/docs/CException.md + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/lib/CException.c + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/lib/CException.h + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/lib/meson.build + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/meson.build + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/project.yml + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/test/TestException.c + delete mode 100644 components/testframework/libs/cmock/vendor/c_exception/test/support/CExceptionConfig.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/.editorconfig + delete mode 100644 components/testframework/libs/cmock/vendor/unity/.travis.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/CMakeLists.txt + delete mode 100644 components/testframework/libs/cmock/vendor/unity/LICENSE.txt + delete mode 100644 components/testframework/libs/cmock/vendor/unity/README.md + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/colour_prompt.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/colour_reporter.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/generate_config.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/generate_module.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/generate_test_runner.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/parse_output.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/run_test.erb + delete mode 100755 components/testframework/libs/cmock/vendor/unity/auto/stylize_as_junit.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/test_file_filter.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/type_sanitizer.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.py + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/auto/unity_to_junit.py + delete mode 100644 components/testframework/libs/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md + delete mode 100644 components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf + delete mode 100644 components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsReference.md + delete mode 100644 components/testframework/libs/cmock/vendor/unity/docs/UnityConfigurationGuide.md + delete mode 100644 components/testframework/libs/cmock/vendor/unity/docs/UnityGettingStartedGuide.md + delete mode 100644 components/testframework/libs/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_1/makefile + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_1/readme.txt + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/makefile + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/readme.txt + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile_helper.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/readme.txt + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/target_gcc_32.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/meson.build + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/readme.txt + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/src/meson.build + delete mode 100755 components/testframework/libs/cmock/vendor/unity/examples/example_4/subprojects/unity.wrap + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/test/meson.build + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/meson.build + delete mode 100644 components/testframework/libs/cmock/vendor/unity/examples/unity_config.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/eclipse/error_parsers.txt + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/fixture/readme.md + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/fixture/test/Makefile + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/fixture/test/main/AllTests.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/memory/readme.md + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/memory/test/Makefile + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_Test.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_TestRunner.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/meson.build + delete mode 100644 components/testframework/libs/cmock/vendor/unity/src/meson.build + delete mode 100644 components/testframework/libs/cmock/vendor/unity/src/unity.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/src/unity.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/src/unity_internals.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/.rubocop.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/Makefile + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_cmd.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_def.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_def.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_param.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new1.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_param.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run1.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run2.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_yaml.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/rakefile + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/rakefile_helper.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/ansi.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/clang_file.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/clang_strict.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/gcc_32.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/gcc_64.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_limits.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/gcc_manual_math.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/hitech_picc18.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v4.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/iar_msp430.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/testdata/CException.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/testdata/Defs.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/testdata/cmock.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/testdata/mockMock.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGenerator.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/self_assessment_utils.h + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/test_generate_test_runner.rb + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_arrays.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_core.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_doubles.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_floats.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers_64.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_memory.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_parameterized.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_strings.c + delete mode 100644 components/testframework/libs/cmock/vendor/unity/unityConfig.cmake + +diff --git a/components/testframework/libs/cmock/.travis.yml b/components/testframework/libs/cmock/.travis.yml +deleted file mode 100644 +index d9e84ad22b..0000000000 +--- a/components/testframework/libs/cmock/.travis.yml ++++ /dev/null +@@ -1,28 +0,0 @@ +-sudo: required +-language: ruby c +- +-matrix: +- include: +- #- os: osx +- # compiler: clang +- # osx_image: xcode7.3 +- - os: linux +- dist: trusty +- rvm: "2.4" +- compiler: gcc +- - os: linux +- dist: xenial +- rvm: "2.7" +- compiler: clang +- +-before_install: +- - sudo apt-get install --assume-yes --quiet gcc-multilib +- +-install: +- - gem install bundler +- - bundle install +- - gem install rspec +- - gem install rubocop -v 0.57.2 +- +-script: +- - cd test && rake ci +diff --git a/components/testframework/libs/cmock/Gemfile b/components/testframework/libs/cmock/Gemfile +deleted file mode 100644 +index 96ac06ec6f..0000000000 +--- a/components/testframework/libs/cmock/Gemfile ++++ /dev/null +@@ -1,8 +0,0 @@ +-source "http://rubygems.org/" +- +-gem "bundler" +-gem "rake" +-gem "minitest" +-gem "require_all" +-gem "constructor" +-gem "diy" +diff --git a/components/testframework/libs/cmock/LICENSE.txt b/components/testframework/libs/cmock/LICENSE.txt +deleted file mode 100644 +index 98167e40c3..0000000000 +--- a/components/testframework/libs/cmock/LICENSE.txt ++++ /dev/null +@@ -1,19 +0,0 @@ +-Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams +- +-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. +\ No newline at end of file +diff --git a/components/testframework/libs/cmock/README.md b/components/testframework/libs/cmock/README.md +deleted file mode 100644 +index 112007367d..0000000000 +--- a/components/testframework/libs/cmock/README.md ++++ /dev/null +@@ -1,34 +0,0 @@ +-CMock - Mock/stub generator for C +-================================= +- +-[![CMock Build Status](https://api.travis-ci.org/ThrowTheSwitch/CMock.png?branch=master)](https://travis-ci.org/ThrowTheSwitch/CMock) +- +-Getting Started +-================ +- +-If you're using Ceedling, there is no need to install CMock. It will handle it for you. +-For everyone else, the simplest way is to grab it off github. You can also download it +-as a zip if you prefer. The Github method looks something like this: +- +- > git clone --recursive https://github.com/throwtheswitch/cmock.git +- > cd cmock +- > bundle install # Ensures you have all RubyGems needed +- +-If you plan to help with the development of CMock (or just want to verify that it can +-perform its self tests on your system) then you can enter the test directory and then +-ask it to test: +- +- > cd test +- > rake # Run all CMock self tests +- +-API Documentation +-================= +- +-* Not sure what you're doing? +- * [View docs/CMock_Summary.md](docs/CMock_Summary.md) +-* Interested in our MIT-style license? +- * [View docs/license.txt](docs/license.txt) +-* Are there examples? +- * They are all in [/examples](examples/) +-* Any other resources to check out? +- * Definitely! Check out our developer portal on [ThrowTheSwitch.org](http://throwtheswitch.org) +diff --git a/components/testframework/libs/cmock/config/production_environment.rb b/components/testframework/libs/cmock/config/production_environment.rb +deleted file mode 100644 +index 082b63fde7..0000000000 +--- a/components/testframework/libs/cmock/config/production_environment.rb ++++ /dev/null +@@ -1,12 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-# Setup our load path: +-[ +- 'lib' +-].each do |dir| +- $:.unshift(File.join(__dir__ + '/../', dir)) +-end +diff --git a/components/testframework/libs/cmock/config/test_environment.rb b/components/testframework/libs/cmock/config/test_environment.rb +deleted file mode 100644 +index aeae3a3426..0000000000 +--- a/components/testframework/libs/cmock/config/test_environment.rb ++++ /dev/null +@@ -1,16 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-# Setup our load path: +-[ +- './lib', +- './vendor/behaviors/lib', +- './vendor/hardmock/lib', +- './vendor/unity/auto/', +- './test/system/' +-].each do |dir| +- $:.unshift(File.join(File.expand_path(File.dirname(__FILE__) + '/../'), dir)) +-end +diff --git a/components/testframework/libs/cmock/docs/CMock_Summary.md b/components/testframework/libs/cmock/docs/CMock_Summary.md +deleted file mode 100644 +index fa7904bbef..0000000000 +--- a/components/testframework/libs/cmock/docs/CMock_Summary.md ++++ /dev/null +@@ -1,806 +0,0 @@ +-CMock: A Summary +-================ +- +-*[ThrowTheSwitch.org](http://throwtheswitch.org)* +- +-*This documentation is released under a Creative Commons 3.0 Attribution Share-Alike License* +- +- +-What Exactly Are We Talking About Here? +---------------------------------------- +- +-CMock is a nice little tool which takes your header files and creates +-a Mock interface for it so that you can more easily unit test modules +-that touch other modules. For each function prototype in your +-header, like this one: +- +- int DoesSomething(int a, int b); +- +- +-...you get an automatically generated DoesSomething function +-that you can link to instead of your real DoesSomething function. +-By using this Mocked version, you can then verify that it receives +-the data you want, and make it return whatever data you desire, +-make it throw errors when you want, and more... Create these for +-everything your latest real module touches, and you're suddenly +-in a position of power: You can control and verify every detail +-of your latest creation. +- +-To make that easier, CMock also gives you a bunch of functions +-like the ones below, so you can tell that generated DoesSomething +-function how to behave for each test: +- +- void DoesSomething_ExpectAndReturn(int a, int b, int toReturn); +- void DoesSomething_ExpectAndThrow(int a, int b, EXCEPTION_T error); +- void DoesSomething_StubWithCallback(CMOCK_DoesSomething_CALLBACK YourCallback); +- void DoesSomething_IgnoreAndReturn(int toReturn); +- +- +-You can pile a bunch of these back to back, and it remembers what +-you wanted to pass when, like so: +- +- test_CallsDoesSomething_ShouldDoJustThat(void) +- { +- DoesSomething_ExpectAndReturn(1,2,3); +- DoesSomething_ExpectAndReturn(4,5,6); +- DoesSomething_ExpectAndThrow(7,8, STATUS_ERROR_OOPS); +- +- CallsDoesSomething( ); +- } +- +- +-This test will call CallsDoesSomething, which is the function +-we are testing. We are expecting that function to call DoesSomething +-three times. The first time, we check to make sure it's called +-as DoesSomething(1, 2) and we'll magically return a 3. The second +-time we check for DoesSomething(4, 5) and we'll return a 6. The +-third time we verify DoesSomething(7, 8) and we'll throw an error +-instead of returning anything. If CallsDoesSomething gets +-any of this wrong, it fails the test. It will fail if you didn't +-call DoesSomething enough, or too much, or with the wrong arguments, +-or in the wrong order. +- +-CMock is based on Unity, which it uses for all internal testing. +-It uses Ruby to do all the main work (versions 2.0.0 and above). +- +- +-Installing +-========== +- +-The first thing you need to do to install CMock is to get yourself +-a copy of Ruby. If you're on linux or osx, you probably already +-have it. You can prove it by typing the following: +- +- ruby --version +- +- +-If it replied in a way that implies ignorance, then you're going to +-need to install it. You can go to [ruby-lang](https://ruby-lang.org) +-to get the latest version. You're also going to need to do that if it +-replied with a version that is older than 2.0.0. Go ahead. We'll wait. +- +-Once you have Ruby, you have three options: +- +-* Clone the latest [CMock repo on github](https://github.com/ThrowTheSwitch/CMock/) +-* Download the latest [CMock zip from github](https://github.com/ThrowTheSwitch/CMock/) +-* Install Ceedling (which has it built in!) through your commandline using `gem install ceedling`. +- +- +-Generated Mock Module Summary +-============================= +- +-In addition to the mocks themselves, CMock will generate the +-following functions for use in your tests. The expect functions +-are always generated. The other functions are only generated +-if those plugins are enabled: +- +- +-Expect: +-------- +- +-Your basic staple Expects which will be used for most of your day +-to day CMock work. By calling this, you are telling CMock that you +-expect that function to be called during your test. It also specifies +-which arguments you expect it to be called with, and what return +-value you want returned when that happens. You can call this function +-multiple times back to back in order to queue up multiple calls. +- +-* `void func(void)` => `void func_Expect(void)` +-* `void func(params)` => `void func_Expect(expected_params)` +-* `retval func(void)` => `void func_ExpectAndReturn(retval_to_return)` +-* `retval func(params)` => `void func_ExpectAndReturn(expected_params, retval_to_return)` +- +- +-ExpectAnyArgs: +--------------- +- +-This behaves just like the Expects calls, except that it doesn't really +-care what the arguments are that the mock gets called with. It still counts +-the number of times the mock is called and it still handles return values +-if there are some. Note that an ExpectAnyArgs call is not generated for +-functions that have no arguments, because it would act exactly like the existing +-Expect and ExpectAndReturn calls. +- +-* `void func(params)` => `void func_ExpectAnyArgs(void)` +-* `retval func(params)` => `void func_ExpectAnyArgsAndReturn(retval_to_return)` +- +- +-Array: +------- +- +-An ExpectWithArray is another variant of Expect. Like expect, it cares about +-the number of times a mock is called, the arguments it is called with, and the +-values it is to return. This variant has another feature, though. For anything +-that resembles a pointer or array, it breaks the argument into TWO arguments. +-The first is the original pointer. The second specify the number of elements +-it is to verify of that array. If you specify 1, it'll check one object. If 2, +-it'll assume your pointer is pointing at the first of two elements in an array. +-If you specify zero elements, it will check just the pointer if +-`:smart` mode is configured or fail if `:compare_data` is set. +- +-* `void func(void)` => (nothing. In fact, an additional function is only generated if the params list contains pointers) +-* `void func(ptr * param, other)` => `void func_ExpectWithArray(ptr* param, int param_depth, other)` +-* `retval func(void)` => (nothing. In fact, an additional function is only generated if the params list contains pointers) +-* `retval func(other, ptr* param)` => `void func_ExpectWithArrayAndReturn(other, ptr* param, int param_depth, retval_to_return)` +- +- +-Ignore: +-------- +- +-Maybe you don't care about the number of times a particular function is called or +-the actual arguments it is called with. In that case, you want to use Ignore. Ignore +-only needs to be called once per test. It will then ignore any further calls to that +-particular mock. The IgnoreAndReturn works similarly, except that it has the added +-benefit of knowing what to return when that call happens. If the mock is called more +-times than IgnoreAndReturn was called, it will keep returning the last value without +-complaint. If it's called fewer times, it will also ignore that. You SAID you didn't +-care how many times it was called, right? +- +-* `void func(void)` => `void func_Ignore(void)` +-* `void func(params)` => `void func_Ignore(void)` +-* `retval func(void)` => `void func_IgnoreAndReturn(retval_to_return)` +-* `retval func(params)` => `void func_IgnoreAndReturn(retval_to_return)` +- +-StopIgnore: +-------- +- +-Maybe you want to ignore a particular function for part of a test but dont want to +-ignore it later on. In that case, you want to use StopIgnore which will cancel the +-previously called Ignore or IgnoreAndReturn requiring you to Expect or otherwise +-handle the call to a function. +- +-* `void func(void)` => `void func_StopIgnore(void)` +-* `void func(params)` => `void func_StopIgnore(void)` +-* `retval func(void)` => `void func_StopIgnore(void)` +-* `retval func(params)` => `void func_StopIgnore(void)` +- +-Ignore Arg: +------------- +- +-Maybe you overall want to use Expect and its similar variations, but you don't care +-what is passed to a particular argument. This is particularly useful when that argument +-is a pointer to a value that is supposed to be filled in by the function. You don't want +-to use ExpectAnyArgs, because you still care about the other arguments. Instead, after +-an Expect call is made, you can call this function. It tells CMock to ignore +-a particular argument for the rest of this test, for this mock function. You may call +-multiple instances of this to ignore multiple arguments after each expectation if +-desired. +- +-* `void func(params)` => `void func_IgnoreArg_paramName(void)` +- +- +-ReturnThruPtr: +--------------- +- +-Another option which operates on a particular argument of a function is the ReturnThruPtr +-plugin. For every argument that resembles a pointer or reference, CMock generates an +-instance of this function. Just as the AndReturn functions support injecting one or more +-return values into a queue, this function lets you specify one or more return values which +-are queued up and copied into the space being pointed at each time the mock is called. +- +-* `void func(param1)` => `void func_ReturnThruPtr_paramName(val_to_return)` +-* => `void func_ReturnArrayThruPtr_paramName(cal_to_return, len)` +-* => `void func_ReturnMemThruPtr_paramName(val_to_return, size)` +- +- +-Callback: +---------- +- +-If all those other options don't work, and you really need to do something custom, you +-still have a choice. As soon as you stub a callback in a test, it will call the callback +-whenever the mock is encountered and return the retval returned from the callback (if any). +- +-* `void func(void)` => `void func_[AddCallback,Stub](CMOCK_func_CALLBACK callback)` +-where `CMOCK_func_CALLBACK` looks like: `void func(int NumCalls)` +-* `void func(params)` => `void func_[AddCallback,Stub](CMOCK_func_CALLBACK callback)` +-where `CMOCK_func_CALLBACK` looks like: `void func(params, int NumCalls)` +-* `retval func(void)` => `void func_[AddCallback,Stub](CMOCK_func_CALLBACK callback)` +-where `CMOCK_func_CALLBACK` looks like: `retval func(int NumCalls)` +-* `retval func(params)` => `void func_[AddCallback,Stub](CMOCK_func_CALLBACK callback)` +-where `CMOCK_func_CALLBACK` looks like: `retval func(params, int NumCalls)` +- +-You can choose from two options: +- +-* `func_AddCallback` tells the mock to check its arguments and calling +-order (based on any Expects you've set up) before calling the callback. +-* `func_Stub` tells the mock to skip all the normal checks and jump directly +-to the callback instead. In this case, you are replacing the normal mock calls +-with your own custom stub function. +- +-There is also an older name, `func_StubWithCallback`, which is just an alias +-for either `func_AddCallback` or `func_Stub` depending on setting of the +-`:callback_after_arg_check` toggle. This is deprecated and we recommend using +-the two options above. +- +- +-Cexception: +------------ +- +-Finally, if you are using Cexception for error handling, you can use this to throw errors +-from inside mocks. Like Expects, it remembers which call was supposed to throw the error, +-and it still checks parameters first. +- +-* `void func(void)` => `void func_ExpectAndThrow(value_to_throw)` +-* `void func(params)` => `void func_ExpectAndThrow(expected_params, value_to_throw)` +-* `retval func(void)` => `void func_ExpectAndThrow(value_to_throw)` +-* `retval func(params)` => `void func_ExpectAndThrow(expected_params, value_to_throw)` +- +- +- +-Running CMock +-============= +- +-CMock is a Ruby script and class. You can therefore use it directly +-from the command line, or include it in your own scripts or rakefiles. +- +- +-Mocking from the Command Line +------------------------------ +- +-After unpacking CMock, you will find cmock.rb in the 'lib' directory. +-This is the file that you want to run. It takes a list of header files +-to be mocked, as well as an optional yaml file for a more detailed +-configuration (see config options below). +- +-For example, this will create three mocks using the configuration +-specified in MyConfig.yml: +- +- ruby cmock.rb -oMyConfig.yml super.h duper.h awesome.h +- +-And this will create two mocks using the default configuration: +- +- ruby cmock.rb ../mocking/stuff/is/fun.h ../try/it/yourself.h +- +- +-Mocking From Scripts or Rake +----------------------------- +- +-CMock can be used directly from your own scripts or from a rakefile. +-Start by including cmock.rb, then create an instance of CMock. +-When you create your instance, you may initialize it in one of +-three ways. +- +-You may specify nothing, allowing it to run with default settings: +- +- require 'cmock.rb' +- cmock = CMock.new +- +-You may specify a YAML file containing the configuration options +-you desire: +- +- cmock = CMock.new('../MyConfig.yml') +- +-You may specify the options explicitly: +- +- cmock = Cmock.new(:plugins => [:cexception, :ignore], :mock_path => 'my/mocks/') +- +-Creating Skeletons: +-------------------- +- +-Not only is CMock able to generate mock files from a header file, but it is also able +-to generate (and update) skeleton C files from headers. It does this by creating a +-(mostly) empty implementation for every function that is declared in the header. If you later +-add to that header list, just run this feature again and it will add prototypes for the missing +-functions! +- +-Like the normal usecase for CMock, this feature can be used from the command line +-or from within its ruby API. For example, from the command line, add `--skeleton` to +-generate a skeleton instead: +- +-``` +-ruby cmock.rb --skeleton ../create/c/for/this.h +-``` +- +-Config Options: +---------------- +- +-The following configuration options can be specified in the +-yaml file or directly when instantiating. +- +-Passed as Ruby, they look like this: +- +- { :attributes => [“__funky”, “__intrinsic”], :when_ptr => :compare } +- +-Defined in the yaml file, they look more like this: +- +- :cmock: +- :attributes: +- - __funky +- - __intrinsic +- :when_ptr: :compare +- +-In all cases, you can just include the things that you want to override +-from the defaults. We've tried to specify what the defaults are below. +- +-* `:attributes`: +- These are attributes that CMock should ignore for you for testing +- purposes. Custom compiler extensions and externs are handy things to +- put here. If your compiler is choking on some extended syntax, this +- is often a good place to look. +- +- * defaults: ['__ramfunc', '__irq', '__fiq', 'register', 'extern'] +- * **note:** this option will reinsert these attributes onto the mock's calls. +- If that isn't what you are looking for, check out :strippables. +- +-* `:c_calling_conventions`: +- Similarly, CMock may need to understand which C calling conventions +- might show up in your codebase. If it encounters something it doesn't +- recognize, it's not going to mock it. We have the most common covered, +- but there are many compilers out there, and therefore many other options. +- +- * defaults: ['__stdcall', '__cdecl', '__fastcall'] +- * **note:** this option will reinsert these attributes onto the mock's calls. +- If that isn't what you are looking for, check out :strippables. +- +-* `:callback_after_arg_check`: +- Tell `:callback` plugin to do the normal argument checking **before** it +- calls the callback function by setting this to true. When false, the +- callback function is called **instead** of the argument verification. +- +- * default: false +- +-* `:callback_include_count`: +- Tell `:callback` plugin to include an extra parameter to specify the +- number of times the callback has been called. If set to false, the +- callback has the same interface as the mocked function. This can be +- handy when you're wanting to use callback as a stub. +- +- * default: true +- +-* `:cexception_include`: +- Tell `:cexception` plugin where to find CException.h... You only need to +- define this if it's not in your build path already... which it usually +- will be for the purpose of your builds. +- +- * default: *nil* +- +-* `:enforce_strict_ordering`: +- CMock always enforces the order that you call a particular function, +- so if you expect GrabNabber(int size) to be called three times, it +- will verify that the sizes are in the order you specified. You might +- *also* want to make sure that all different functions are called in a +- particular order. If so, set this to true. +- +- * default: false +- +-* `:framework`: +- Currently the only option is `:unity.` Eventually if we support other +- unity test frameworks (or if you write one for us), they'll get added +- here. +- +- : default: :unity +- +-* `:includes`: +- An array of additional include files which should be added to the +- mocks. Useful for global types and definitions used in your project. +- There are more specific versions if you care WHERE in the mock files +- the includes get placed. You can define any or all of these options. +- +- * `:includes` +- * `:includes_h_pre_orig_header` +- * `:includes_h_post_orig_header` +- * `:includes_c_pre_header` +- * `:includes_c_post_header` +- * default: nil #for all 5 options +- +-* `:memcmp_if_unknown`: +- C developers create a lot of types, either through typedef or preprocessor +- macros. CMock isn't going to automatically know what you were thinking all +- the time (though it tries its best). If it comes across a type it doesn't +- recognize, you have a choice on how you want it to handle it. It can either +- perform a raw memory comparison and report any differences, or it can fail +- with a meaningful message. Either way, this feature will only happen after +- all other mechanisms have failed (The thing encountered isn't a standard +- type. It isn't in the :treat_as list. It isn't in a custom unity_helper). +- +- * default: true +- +-* `:mock_path`: +- The directory where you would like the mock files generated to be +- placed. +- +- * default: mocks +- +-* `:mock_prefix`: +- The prefix to prepend to your mock files. For example, if it's `Mock`, a file +- “USART.h” will get a mock called “MockUSART.c”. This CAN be used with a suffix +- at the same time. +- +- * default: Mock +- +-* `:mock_suffix`: +- The suffix to append to your mock files. For example, it it's `_Mock`, a file +- "USART.h" will get a mock called "USART_Mock.h". This CAN be used with a prefix +- at the same time. +- +- * default: "" +- +-* `:plugins`: +- An array of which plugins to enable. ':expect' is always active. Also +- available currently: +- +- * `:ignore` +- * `:ignore_arg` +- * `:expect_any_args` +- * `:array` +- * `:cexception` +- * `:callback` +- * `:return_thru_ptr` +- +-* `:strippables`: +- An array containing a list of items to remove from the header +- before deciding what should be mocked. This can be something simple +- like a compiler extension CMock wouldn't recognize, or could be a +- regex to reject certain function name patterns. This is a great way to +- get rid of compiler extensions when your test compiler doesn't support +- them. For example, use `:strippables: ['(?:functionName\s*\(+.*?\)+)']` +- to prevent a function `functionName` from being mocked. By default, it +- is ignoring all gcc attribute extensions. +- +- * default: ['(?:__attribute__\s*\(+.*?\)+)'] +- +-* `:subdir`: +- This is a relative subdirectory for your mocks. Set this to e.g. "sys" in +- order to create a mock for `sys/types.h` in `(:mock_path)/sys/`. +- +- * default: "" +- +-* `:treat_as`: +- The `:treat_as` list is a shortcut for when you have created typedefs +- of standard types. Why create a custom unity helper for UINT16 when +- the unity function TEST_ASSERT_EQUAL_HEX16 will work just perfectly? +- Just add 'UINT16' => 'HEX16' to your list (actually, don't. We already +- did that one for you). Maybe you have a type that is a pointer to an +- array of unsigned characters? No problem, just add 'UINT8_T*' => +- 'HEX8*' +- +- * NOTE: unlike the other options, your specifications MERGE with the +- default list. Therefore, if you want to override something, you must +- reassign it to something else (or to *nil* if you don't want it) +- +- * default: +- * 'int': 'INT' +- * 'char': 'INT8' +- * 'short': 'INT16' +- * 'long': 'INT' +- * 'int8': 'INT8' +- * 'int16': 'INT16' +- * 'int32': 'INT' +- * 'int8_t': 'INT8' +- * 'int16_t': 'INT16' +- * 'int32_t': 'INT' +- * 'INT8_T': 'INT8' +- * 'INT16_T': 'INT16' +- * 'INT32_T': 'INT' +- * 'bool': 'INT' +- * 'bool_t': 'INT' +- * 'BOOL': 'INT' +- * 'BOOL_T': 'INT' +- * 'unsigned int': 'HEX32' +- * 'unsigned long': 'HEX32' +- * 'uint32': 'HEX32' +- * 'uint32_t': 'HEX32' +- * 'UINT32': 'HEX32' +- * 'UINT32_T': 'HEX32' +- * 'void*': 'HEX8_ARRAY' +- * 'unsigned short': 'HEX16' +- * 'uint16': 'HEX16' +- * 'uint16_t': 'HEX16' +- * 'UINT16': 'HEX16' +- * 'UINT16_T': 'HEX16' +- * 'unsigned char': 'HEX8' +- * 'uint8': 'HEX8' +- * 'uint8_t': 'HEX8' +- * 'UINT8': 'HEX8' +- * 'UINT8_T': 'HEX8' +- * 'char*': 'STRING' +- * 'pCHAR': 'STRING' +- * 'cstring': 'STRING' +- * 'CSTRING': 'STRING' +- * 'float': 'FLOAT' +- * 'double': 'FLOAT' +- +-* `:treat_as_array`: +- A specialized sort of `:treat_as` to be used when you've created a +- typedef of an array type, such as `typedef int TenIntegers[10];`. This +- is a hash of typedef name to element type. For example: +- +- { "TenIntegers" => "int", +- "ArrayOfFloat" => "float" } +- +- Telling CMock about these typedefs allows it to be more intelligent +- about parameters of such types, so that you can use features like +- ExpectWithArray and ReturnArrayThruPtr with them. +- +-* `:treat_as_void`: +- We've seen "fun" legacy systems typedef 'void' with a custom type, +- like MY_VOID. Add any instances of those to this list to help CMock +- understand how to deal with your code. +- +- * default: [] +- +-* `:treat_externs`: +- This specifies how you want CMock to handle functions that have been +- marked as extern in the header file. Should it mock them? +- +- * `:include` will mock externed functions +- * `:exclude` will ignore externed functions (default). +- +-* `:treat_inlines`: +- This specifies how you want CMock to handle functions that have been +- marked as inline in the header file. Should it mock them? +- +- * `:include` will mock inlined functions +- * `:exclude` will ignore inlined functions (default). +- +- CMock will look for the following default patterns (simplified from the actual regex): +- - "static inline" +- - "inline static" +- - "inline" +- - "static" +- You can override these patterns, check out :inline_function_patterns. +- +- Enabling this feature does require a change in the build system that +- is using CMock. To understand why, we need to give some more info +- on how we are handling inline functions internally. +- Let's say we want to mock a header called example.h. example.h +- contains inline functions, we cannot include this header in the +- mocks or test code if we want to mock the inline functions simply +- because the inline functions contain an implementation that we want +- to override in our mocks! +- So, to circumvent this, we generate a new header, also named +- example.h, in the same directory as mock_example.h/c . This newly +- generated header should/is exactly the same as the original header, +- only difference is the inline functions are transformed to 'normal' +- functions declarations. Placing the new header in the same +- directory as mock_example.h/c ensures that they will include the new +- header and not the old one. +- However, CMock has no control in how the build system is configured +- and which include paths the test code is compiled with. In order +- for the test code to also see the newly generated header ,and not +- the old header with inline functions, the build system has to add +- the mock folder to the include paths. +- Furthermore, we need to keep the order of include paths in mind. We +- have to set the mock folder before the other includes to avoid the +- test code including the original header instead of the newly +- generated header (without inline functions). +- +-* `:unity_helper_path`: +- If you have created a header with your own extensions to unity to +- handle your own types, you can set this argument to that path. CMock +- will then automagically pull in your helpers and use them. The only +- trick is that you make sure you follow the naming convention: +- `UNITY_TEST_ASSERT_EQUAL_YourType`. If it finds macros of the right +- shape that match that pattern, it'll use them. +- +- * default: [] +- +-* `:verbosity`: +- How loud should CMock be? +- +- * 0 for errors only +- * 1 for errors and warnings +- * 2 for normal (default) +- * 3 for verbose +- +-* `:weak`: +- When set this to some value, the generated mocks are defined as weak +- symbols using the configured format. This allows them to be overridden +- in particular tests. +- +- * Set to '__attribute ((weak))' for weak mocks when using GCC. +- * Set to any non-empty string for weak mocks when using IAR. +- * default: "" +- +-* `:when_no_prototypes`: +- When you give CMock a header file and ask it to create a mock out of +- it, it usually contains function prototypes (otherwise what was the +- point?). You can control what happens when this isn't true. You can +- set this to `:warn,` `:ignore,` or `:error` +- +- * default: :warn +- +-* `:when_ptr`: +- You can customize how CMock deals with pointers (c strings result in +- string comparisons... we're talking about **other** pointers here). Your +- options are `:compare_ptr` to just verify the pointers are the same, +- `:compare_data` or `:smart` to verify that the data is the same. +- `:compare_data` and `:smart` behaviors will change slightly based on +- if you have the array plugin enabled. By default, they compare a +- single element of what is being pointed to. So if you have a pointer +- to a struct called ORGAN_T, it will compare one ORGAN_T (whatever that +- is). +- +- * default: :smart +- +-* `:array_size_type`: +-* `:array_size_name`: +- When the `:array` plugin is disabled, these options do nothing. +- +- When the `:array` plugin is enabled, these options allow CMock to recognize +- functions with parameters that might refer to an array, like the following, +- and treat them more intelligently: +- +- * `void GoBananas(Banana * bananas, int num_bananas)` +- * `int write_data(int fd, const uint8_t * data, uint32_t size)` +- +- To recognize functions like these, CMock looks for a parameter list +- containing a pointer (which could be an array) followed by something that +- could be an array size. "Something", by default, means an `int` or `size_t` +- parameter with a name containing "size" or "len". +- +- `:array_size_type` is a list of additional types (besides `int` and `size_t`) +- that could be used for an array size parameter. For example, to get CMock to +- recognize that `uint32_t size` is an array size, you'd need to say: +- +- cfg[:array_size_type] = ['uint32_t'] +- +- `:array_size_name` is a regular expression used to match an array size +- parameter by name. By default, it's 'size|len'. To get CMock to recognize a +- name like `num_bananas`, you could tell it to also accept names containing +- 'num_' like this: +- +- cfg[:array_size_name] = 'size|len|num_' +- +- Parameters must match *both* `:array_size_type` and `:array_size_name` (and +- must come right after a pointer parameter) to be treated as an array size. +- +- Once you've told it how to recognize your arrays, CMock will give you `_Expect` +- calls that work more like `_ExpectWithArray`, and compare an array of objects +- rather than just a single object. +- +- For example, if you write the following, CMock will check that GoBananas is +- called and passed an array containing a green banana followed by a yellow +- banana: +- +- Banana b[2] = {GreenBanana, YellowBanana}; +- GoBananas_Expect(b, 2); +- +- In other words, `GoBananas_Expect(b, 2)` now works just the same as: +- +- GoBananas_ExpectWithArray(b, 2, 2); +- +-* `:fail_on_unexpected_calls`: +- By default, CMock will fail a test if a mock is called without `_Expect` and `_Ignore` +- called first. While this forces test writers to be more explicit in their expectations, +- it can clutter tests with `_Expect` or `_Ignore` calls for functions which are not the focus +- of the test. While this is a good indicator that this module should be refactored, some +- users are not fans of the additional noise. +- +- Therefore, :fail_on_unexpected_calls can be set to false to force all mocks to start with +- the assumption that they are operating as `_Ignore` unless otherwise specified. +- +- * default: true +- * **note:** +- If this option is disabled, the mocked functions will return +- a default value (0) when called (and only if they have to return something of course). +- +-* `:inline_function_patterns`: +- An array containing a list of strings to detect inline functions. +- This option is only taken into account if you enable :treat_inlines. +- These strings are interpreted as regex patterns so be sure to escape +- certain characters. For example, use `:inline_function_patterns: ['static inline __attribute__ \(\(always_inline\)\)']` +- to recognize `static inline __attribute__ ((always_inline)) int my_func(void)` +- as an inline function. +- The default patterns are are: +- +- * default: ['(static\s+inline|inline\s+static)\s*', '(\bstatic\b|\binline\b)\s*'] +- * **note:** +- The order of patterns is important here! +- We go from specific patterns ('static inline') to general patterns ('inline'), +- otherwise we would miss functions that use 'static inline' iso 'inline'. +- +- +-Compiled Options: +------------------ +- +-A number of #defines also exist for customizing the cmock experience. +-Feel free to pass these into your compiler or whatever is most +-convenient. CMock will otherwise do its best to guess what you want +-based on other settings, particularly Unity's settings. +- +-* `CMOCK_MEM_STATIC` or `CMOCK_MEM_DYNAMIC` +- Define one of these to determine if you want to dynamically add +- memory during tests as required from the heap. If static, you +- can control the total footprint of Cmock. If dynamic, you will +- need to make sure you make some heap space available for Cmock. +- +-* `CMOCK_MEM_SIZE` +- In static mode this is the total amount of memory you are allocating +- to Cmock. In Dynamic mode this is the size of each chunk allocated +- at once (larger numbers grab more memory but require fewer mallocs). +- +-* `CMOCK_MEM_ALIGN` +- The way to align your data to. Not everything is as flexible as +- a PC, as most embedded designers know. This defaults to 2, meaning +- align to the closest 2^2 -> 4 bytes (32 bits). You can turn off alignment +- by setting 0, force alignment to the closest uint16 with 1 or even +- to the closest uint64 with 3. +- +-* `CMOCK_MEM_PTR_AS_INT` +- This is used internally to hold pointers... it needs to be big +- enough. On most processors a pointer is the same as an unsigned +- long... but maybe that's not true for yours? +- +-* `CMOCK_MEM_INDEX_TYPE` +- This needs to be something big enough to point anywhere in Cmock's +- memory space... usually it's a size_t. +- +-Other Tips +-========== +- +-resetTest +---------- +- +-While this isn't strictly a CMock feature, often users of CMock are using +-either the test runner generator scripts in Unity or using Ceedling. In +-either case, there is a handy function called `resetTest` which gets +-generated with your runner. You can then use this handy function in your tests +-themselves. Call it during a test to have CMock validate everything to this point +-and start over clean. This is really useful when wanting to test a function in +-an iterative manner with different arguments. +- +-C++ Support +---------- +-C++ unit test/mocking frameworks often use a completely different approach (vs. +-CMock) that relies on overloading virtual class members and does not support +-directly mocking static class member methods or free functions (i.e., functions +-in plain C). One workaround is to wrap the non-virtual functions in an object +-that exposes them as virtual methods and modify your code to inject mocks at +-run-time... but there is another way! +- +-Simply use CMock to mock the static member methods and a C++ mocking framework +-to handle the virtual methods. (Yes, you can mix mocks from CMock and a C++ +-mocking framework together in the same test!) +- +-Keep in mind that since C++ mocking frameworks often link the real object to the +-unit test too, we need to resolve multiple definition errors with something like +-the following in the source of the real implementation for any functions that +-CMock mocks: +- +- #if defined(TEST) +- __attribute__((weak)) +- #endif +- +-To address potential issues with re-using the same function name in different +-namespaces/classes, the generated function names include the namespace(s) and +-class. For example: +- +- namespace MyNamespace { +- class MyClass { +- static int DoesSomething(int a, int b); +- }; +- } +- +-Will generate functions like +- +- void MyNamespace_MyClass_DoesSomething_ExpectAndReturn(int a, int b, int toReturn); +- +-Examples +-======== +- +-You can look in the [examples directory](/examples/) for a couple of examples on how +-you might tool CMock into your build process. You may also want to consider +-using [Ceedling](https://throwtheswitch.org/ceedling). Please note that +-these examples are meant to show how the build process works. They have +-failing tests ON PURPOSE to show what that would look like. Don't be alarmed. ;) +diff --git a/components/testframework/libs/cmock/docs/ThrowTheSwitchCodingStandard.md b/components/testframework/libs/cmock/docs/ThrowTheSwitchCodingStandard.md +deleted file mode 100644 +index a85adef3de..0000000000 +--- a/components/testframework/libs/cmock/docs/ThrowTheSwitchCodingStandard.md ++++ /dev/null +@@ -1,207 +0,0 @@ +-# ThrowTheSwitch.org Coding Standard +- +-Hi. Welcome to the coding standard for ThrowTheSwitch.org. For the most part, +-we try to follow these standards to unify our contributors' code into a cohesive +-unit (puns intended). You might find places where these standards aren't +-followed. We're not perfect. Please be polite where you notice these discrepancies +-and we'll try to be polite when we notice yours. +- +-;) +- +- +-## Why Have A Coding Standard? +- +-Being consistent makes code easier to understand. We've made an attempt to keep +-our standard simple because we also believe that we can only expect someone to +-follow something that is understandable. Please do your best. +- +- +-## Our Philosophy +- +-Before we get into details on syntax, let's take a moment to talk about our +-vision for these tools. We're C developers and embedded software developers. +-These tools are great to test any C code, but catering to embedded software has +-made us more tolerant of compiler quirks. There are a LOT of quirky compilers +-out there. By quirky I mean "doesn't follow standards because they feel like +-they have a license to do as they wish." +- +-Our philosophy is "support every compiler we can". Most often, this means that +-we aim for writing C code that is standards compliant (often C89... that seems +-to be a sweet spot that is almost always compatible). But it also means these +-tools are tolerant of things that aren't common. Some that aren't even +-compliant. There are configuration options to override the size of standard +-types. There are configuration options to force Unity to not use certain +-standard library functions. A lot of Unity is configurable and we have worked +-hard to make it not TOO ugly in the process. +- +-Similarly, our tools that parse C do their best. They aren't full C parsers +-(yet) and, even if they were, they would still have to accept non-standard +-additions like gcc extensions or specifying `@0x1000` to force a variable to +-compile to a particular location. It's just what we do, because we like +-everything to Just Work™. +- +-Speaking of having things Just Work™, that's our second philosophy. By that, we +-mean that we do our best to have EVERY configuration option have a logical +-default. We believe that if you're working with a simple compiler and target, +-you shouldn't need to configure very much... we try to make the tools guess as +-much as they can, but give the user the power to override it when it's wrong. +- +- +-## Naming Things +- +-Let's talk about naming things. Programming is all about naming things. We name +-files, functions, variables, and so much more. While we're not always going to +-find the best name for something, we actually put quite a bit of effort into +-finding *What Something WANTS to be Called*™. +- +-When naming things, we more or less follow this hierarchy, the first being the +-most important to us (but we do all four whenever possible): +-1. Readable +-2. Descriptive +-3. Consistent +-4. Memorable +- +- +-#### Readable +- +-We want to read our code. This means we like names and flow that are more +-naturally read. We try to avoid double negatives. We try to avoid cryptic +-abbreviations (sticking to ones we feel are common). +- +- +-#### Descriptive +- +-We like descriptive names for things, especially functions and variables. +-Finding the right name for something is an important endeavor. You might notice +-from poking around our code that this often results in names that are a little +-longer than the average. Guilty. We're okay with a tiny bit more typing if it +-means our code is easier to understand. +- +-There are two exceptions to this rule that we also stick to as religiously as +-possible: +- +-First, while we realize hungarian notation (and similar systems for encoding +-type information into variable names) is providing a more descriptive name, we +-feel that (for the average developer) it takes away from readability and +-therefore is to be avoided. +- +-Second, loop counters and other local throw-away variables often have a purpose +-which is obvious. There's no need, therefore, to get carried away with complex +-naming. We find i, j, and k are better loop counters than loopCounterVar or +-whatnot. We only break this rule when we see that more description could improve +-understanding of an algorithm. +- +- +-#### Consistent +- +-We like consistency, but we're not really obsessed with it. We try to name our +-configuration macros in a consistent fashion... you'll notice a repeated use of +-UNITY_EXCLUDE_BLAH or UNITY_USES_BLAH macros. This helps users avoid having to +-remember each macro's details. +- +- +-#### Memorable +- +-Where ever it doesn't violate the above principles, we try to apply memorable +-names. Sometimes this means using something that is simply descriptive, but +-often we strive for descriptive AND unique... we like quirky names that stand +-out in our memory and are easier to search for. Take a look through the file +-names in Ceedling and you'll get a good idea of what we are talking about here. +-Why use preprocess when you can use preprocessinator? Or what better describes a +-module in charge of invoking tasks during releases than release_invoker? Don't +-get carried away. The names are still descriptive and fulfill the above +-requirements, but they don't feel stale. +- +- +-## C and C++ Details +- +-We don't really want to add to the style battles out there. Tabs or spaces? +-How many spaces? Where do the braces go? These are age-old questions that will +-never be answered... or at least not answered in a way that will make everyone +-happy. +- +-We've decided on our own style preferences. If you'd like to contribute to these +-projects (and we hope that you do), then we ask if you do your best to follow +-the same. It will only hurt a little. We promise. +- +- +-#### Whitespace +- +-Our C-style is to use spaces and to use 4 of them per indent level. It's a nice +-power-of-2 number that looks decent on a wide screen. We have no more reason +-than that. We break that rule when we have lines that wrap (macros or function +-arguments or whatnot). When that happens, we like to indent further to line +-things up in nice tidy columns. +- +-```C +- if (stuff_happened) +- { +- do_something(); +- } +-``` +- +- +-#### Case +- +-- Files - all lower case with underscores. +-- Variables - all lower case with underscores +-- Macros - all caps with underscores. +-- Typedefs - all caps with underscores. (also ends with _T). +-- Functions - camel cased. Usually named ModuleName_FuncName +-- Constants and Globals - camel cased. +- +- +-#### Braces +- +-The left brace is on the next line after the declaration. The right brace is +-directly below that. Everything in between in indented one level. If you're +-catching an error and you have a one-line, go ahead and to it on the same line. +- +-```C +- while (blah) +- { +- //Like so. Even if only one line, we use braces. +- } +-``` +- +- +-#### Comments +- +-Do you know what we hate? Old-school C block comments. BUT, we're using them +-anyway. As we mentioned, our goal is to support every compiler we can, +-especially embedded compilers. There are STILL C compilers out there that only +-support old-school block comments. So that is what we're using. We apologize. We +-think they are ugly too. +- +- +-## Ruby Details +- +-Is there really such thing as a Ruby coding standard? Ruby is such a free form +-language, it seems almost sacrilegious to suggest that people should comply to +-one method! We'll keep it really brief! +- +- +-#### Whitespace +- +-Our Ruby style is to use spaces and to use 2 of them per indent level. It's a +-nice power-of-2 number that really grooves with Ruby's compact style. We have no +-more reason than that. We break that rule when we have lines that wrap. When +-that happens, we like to indent further to line things up in nice tidy columns. +- +- +-#### Case +- +-- Files - all lower case with underscores. +-- Variables - all lower case with underscores +-- Classes, Modules, etc - Camel cased. +-- Functions - all lower case with underscores +-- Constants - all upper case with underscores +- +- +-## Documentation +- +-Egad. Really? We use markdown and we like pdf files because they can be made to +-look nice while still being portable. Good enough? +- +- +-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* +diff --git a/components/testframework/libs/cmock/examples/make_example/Makefile b/components/testframework/libs/cmock/examples/make_example/Makefile +deleted file mode 100644 +index a0fe53227a..0000000000 +--- a/components/testframework/libs/cmock/examples/make_example/Makefile ++++ /dev/null +@@ -1,30 +0,0 @@ +-CC ?= gcc +-export BUILD_DIR ?= ./build +-export SRC_DIR ?= ./src +-export TEST_DIR ?= ./test +-export TEST_BUILD_DIR ?= ${BUILD_DIR}/test +-TEST_MAKEFILE = ${TEST_BUILD_DIR}/MakefileTestSupport +-OBJ ?= ${BUILD_DIR}/obj +-OBJ_DIR = ${OBJ} +- +-default: all +- +-all: setup test ${BUILD_DIR}/main run +- +-setup: +- mkdir -p ${BUILD_DIR} +- mkdir -p ${OBJ} +- ruby ../../scripts/create_makefile.rb --silent +- +-clean: +- rm -rf ${BUILD_DIR} +- +-${BUILD_DIR}/main: ${SRC_DIR}/main.c ${SRC_DIR}/foo.c +- ${CC} $< -o $@ +- +-run: +- ./build/main || true +- +-test: setup +- +--include ${TEST_MAKEFILE} +diff --git a/components/testframework/libs/cmock/examples/make_example/src/foo.c b/components/testframework/libs/cmock/examples/make_example/src/foo.c +deleted file mode 100644 +index 5490203d14..0000000000 +--- a/components/testframework/libs/cmock/examples/make_example/src/foo.c ++++ /dev/null +@@ -1,5 +0,0 @@ +-#include "foo.h" +- +-void foo_init(void) +-{ +-} +diff --git a/components/testframework/libs/cmock/examples/make_example/src/foo.h b/components/testframework/libs/cmock/examples/make_example/src/foo.h +deleted file mode 100644 +index 3d2b5fba6f..0000000000 +--- a/components/testframework/libs/cmock/examples/make_example/src/foo.h ++++ /dev/null +@@ -1,5 +0,0 @@ +-#ifndef _foo_h +- +-void foo_init(void); +- +-#endif +diff --git a/components/testframework/libs/cmock/examples/make_example/src/main.c b/components/testframework/libs/cmock/examples/make_example/src/main.c +deleted file mode 100644 +index 52e86795ad..0000000000 +--- a/components/testframework/libs/cmock/examples/make_example/src/main.c ++++ /dev/null +@@ -1,15 +0,0 @@ +-#include +-#include "foo.h" +- +-int real_main(int argc, char ** argv) +-{ +- printf("Hello world!\n"); +- return 0; +-} +- +-#ifndef TEST +-int main(int argc, char ** argv) +-{ +- return real_main(argc, argv); +-} +-#endif +diff --git a/components/testframework/libs/cmock/examples/make_example/test/test_foo.c b/components/testframework/libs/cmock/examples/make_example/test/test_foo.c +deleted file mode 100644 +index 80f17f337e..0000000000 +--- a/components/testframework/libs/cmock/examples/make_example/test/test_foo.c ++++ /dev/null +@@ -1,17 +0,0 @@ +-#include "unity.h" +-#include "foo.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void test_foo_init_should_initialize_multiplier() +-{ +- foo_init(); +- +- TEST_ASSERT_FALSE(1); +-} +diff --git a/components/testframework/libs/cmock/examples/make_example/test/test_main.c b/components/testframework/libs/cmock/examples/make_example/test/test_main.c +deleted file mode 100644 +index f9b674906e..0000000000 +--- a/components/testframework/libs/cmock/examples/make_example/test/test_main.c ++++ /dev/null +@@ -1,15 +0,0 @@ +-#include "unity.h" +-#include "mock_foo.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void test_main_should_initialize_foo(void) +-{ +- TEST_IGNORE_MESSAGE("TODO: Implement main!"); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/gcc.yml b/components/testframework/libs/cmock/examples/temp_sensor/gcc.yml +deleted file mode 100644 +index f41bf07d34..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/gcc.yml ++++ /dev/null +@@ -1,44 +0,0 @@ +-compiler: +- path: gcc +- source_path: 'src/' +- unit_tests_path: &unit_tests_path 'test/' +- build_path: &build_path 'build/' +- options: +- - -c +- includes: +- prefix: '-I' +- items: +- - 'src/' +- - '../../src/' +- - '../../vendor/unity/src/' +- - '../../vendor/unity/examples/example_3/helper/' +- - './build/mocks/' +- - *unit_tests_path +- defines: +- prefix: '-D' +- items: +- - __monitor +- object_files: +- prefix: '-o' +- extension: '.o' +- destination: *build_path +-linker: +- path: gcc +- options: +- - -lm +- includes: +- prefix: '-I' +- object_files: +- path: *build_path +- extension: '.o' +- bin_files: +- prefix: '-o' +- extension: '.exe' +- destination: *build_path +-:cmock: +- :plugins: [] +- :includes: +- - Types.h +- :mock_path: ./build/mocks +- +-colour: true +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/iar_v4.yml b/components/testframework/libs/cmock/examples/temp_sensor/iar_v4.yml +deleted file mode 100644 +index 762175215f..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/iar_v4.yml ++++ /dev/null +@@ -1,92 +0,0 @@ +-tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\' +-compiler: +- path: [*tools_root, 'arm\bin\iccarm.exe'] +- source_path: 'src\' +- unit_tests_path: &unit_tests_path 'test\' +- build_path: &build_path 'build\' +- options: +- - --dlib_config +- - [*tools_root, 'arm\lib\dl4tptinl8n.h'] +- - -z3 +- - --no_cse +- - --no_unroll +- - --no_inline +- - --no_code_motion +- - --no_tbaa +- - --no_clustering +- - --no_scheduling +- - --debug +- - --cpu_mode thumb +- - --endian little +- - --cpu ARM7TDMI +- - --stack_align 4 +- - --interwork +- - -e +- - --silent +- - --warnings_are_errors +- - --fpu None +- - --diag_suppress Pa050 +- includes: +- prefix: '-I' +- items: +- - 'src/' +- - '../../src/' +- - '../../vendor/unity/src/' +- - '../../vendor/unity/examples/example_3/helper/' +- - './build/mocks/' +- - [*tools_root, 'arm\inc\'] +- - *unit_tests_path +- defines: +- prefix: '-D' +- items: +- object_files: +- prefix: '-o' +- extension: '.r79' +- destination: *build_path +-linker: +- path: [*tools_root, 'common\bin\xlink.exe'] +- options: +- - -rt +- - [*tools_root, 'arm\lib\dl4tptinl8n.r79'] +- - -D_L_EXTMEM_START=0 +- - -D_L_EXTMEM_SIZE=0 +- - -D_L_HEAP_SIZE=120 +- - -D_L_STACK_SIZE=32 +- - -e_small_write=_formatted_write +- - -s +- - __program_start +- - -f +- - [*tools_root, '\arm\config\lnkarm.xcl'] +- includes: +- prefix: '-I' +- items: +- - [*tools_root, 'arm\config\'] +- - [*tools_root, 'arm\lib\'] +- object_files: +- path: *build_path +- extension: '.r79' +- bin_files: +- prefix: '-o' +- extension: '.d79' +- destination: *build_path +-simulator: +- path: [*tools_root, 'common\bin\CSpyBat.exe'] +- pre_support: +- - --silent +- - [*tools_root, 'arm\bin\armproc.dll'] +- - [*tools_root, 'arm\bin\armsim.dll'] +- post_support: +- - --plugin +- - [*tools_root, 'arm\bin\armbat.dll'] +- - --backend +- - -B +- - -p +- - [*tools_root, 'arm\config\ioat91sam7X256.ddf'] +- - -d +- - sim +-:cmock: +- :plugins: [] +- :includes: +- - Types.h +- :mock_path: ./build/mocks +- +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/iar_v5.yml b/components/testframework/libs/cmock/examples/temp_sensor/iar_v5.yml +deleted file mode 100644 +index 01786496ab..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/iar_v5.yml ++++ /dev/null +@@ -1,81 +0,0 @@ +-tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 5.3\' +-compiler: +- path: [*tools_root, 'arm\bin\iccarm.exe'] +- source_path: 'src\' +- unit_tests_path: &unit_tests_path 'test\' +- build_path: &build_path 'build\' +- options: +- - --dlib_config +- - [*tools_root, 'arm\inc\DLib_Config_Normal.h'] +- - --no_cse +- - --no_unroll +- - --no_inline +- - --no_code_motion +- - --no_tbaa +- - --no_clustering +- - --no_scheduling +- - --debug +- - --cpu_mode thumb +- - --endian=little +- - --cpu=ARM7TDMI +- - --interwork +- - --warnings_are_errors +- - --fpu=None +- - --diag_suppress=Pa050 +- - --diag_suppress=Pe111 +- - -e +- - -On +- includes: +- prefix: '-I' +- items: +- - 'src/' +- - '../../src/' +- - '../../vendor/unity/src/' +- - '../../vendor/unity/examples/example_3/helper/' +- - './build/mocks/' +- - [*tools_root, 'arm\inc\'] +- - *unit_tests_path +- defines: +- prefix: '-D' +- items: +- object_files: +- prefix: '-o' +- extension: '.r79' +- destination: *build_path +-linker: +- path: [*tools_root, 'arm\bin\ilinkarm.exe'] +- options: +- - --redirect _Printf=_PrintfLarge +- - --redirect _Scanf=_ScanfSmall +- - --semihosting +- - --entry __iar_program_start +- - --config +- - [*tools_root, 'arm\config\generic.icf'] +- object_files: +- path: *build_path +- extension: '.o' +- bin_files: +- prefix: '-o' +- extension: '.out' +- destination: *build_path +-simulator: +- path: [*tools_root, 'common\bin\CSpyBat.exe'] +- pre_support: +- - --silent +- - [*tools_root, 'arm\bin\armproc.dll'] +- - [*tools_root, 'arm\bin\armsim.dll'] +- post_support: +- - --plugin +- - [*tools_root, 'arm\bin\armbat.dll'] +- - --backend +- - -B +- - -p +- - [*tools_root, 'arm\config\debugger\atmel\ioat91sam7X256.ddf'] +- - -d +- - sim +-:cmock: +- :plugins: [] +- :includes: +- - Types.h +- :mock_path: ./build/mocks +- +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/rakefile.rb b/components/testframework/libs/cmock/examples/temp_sensor/rakefile.rb +deleted file mode 100644 +index 06ab1d51d7..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/rakefile.rb ++++ /dev/null +@@ -1,42 +0,0 @@ +-HERE = __dir__ + '/' +- +-require 'rake' +-require 'rake/clean' +-require 'rake/testtask' +-require './rakefile_helper' +- +-include RakefileHelpers +- +-REQUIRED_DIRS = ['./build', './build/mocks'].freeze +-REQUIRED_DIRS.each do |v| +- directory v +-end +- +-# Load default configuration, for now +-DEFAULT_CONFIG_FILE = 'gcc.yml'.freeze +-configure_toolchain(DEFAULT_CONFIG_FILE) +- +-task :unit do +- run_tests(unit_test_files) +-end +- +-desc 'Generate test summary' +-task :summary do +- report_summary +-end +- +-desc 'Build and test Unity' +-task :all => %i[clean unit summary] +-task :default => REQUIRED_DIRS + %i[clobber all] +-task :ci => [:default] +-task :cruise => [:default] +- +-desc 'Load configuration' +-task :config, :config_file do |_t, args| +- configure_toolchain(args[:config_file]) +-end +- +-desc 'Return error on Failures' +-task :strict do +- $return_error_on_failures = true +-end +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/rakefile_helper.rb b/components/testframework/libs/cmock/examples/temp_sensor/rakefile_helper.rb +deleted file mode 100644 +index ce401d3712..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/rakefile_helper.rb ++++ /dev/null +@@ -1,268 +0,0 @@ +-require 'yaml' +-require 'fileutils' +-require '../../vendor/unity/auto/unity_test_summary' +-require '../../vendor/unity/auto/generate_test_runner' +-require '../../vendor/unity/auto/colour_reporter' +- +-module RakefileHelpers +- $return_error_on_failures = false +- +- C_EXTENSION = '.c'.freeze +- +- def load_configuration(config_file) +- $cfg_file = config_file +- $cfg = YAML.load(File.read($cfg_file)) +- $colour_output = false unless $cfg['colour'] +- end +- +- def configure_clean +- CLEAN.include($cfg['compiler']['build_path'] + '*.*') unless $cfg['compiler']['build_path'].nil? +- end +- +- def configure_toolchain(config_file = DEFAULT_CONFIG_FILE) +- config_file += '.yml' unless config_file =~ /\.yml$/ +- load_configuration(config_file) +- configure_clean +- end +- +- def unit_test_files +- path = $cfg['compiler']['unit_tests_path'] + 'Test*' + C_EXTENSION +- path.tr!('\\', '/') +- FileList.new(path) +- end +- +- def local_include_dirs +- include_dirs = $cfg['compiler']['includes']['items'].dup +- include_dirs.delete_if { |dir| dir.is_a?(Array) } +- include_dirs +- end +- +- def extract_headers(filename) +- includes = [] +- lines = File.readlines(filename) +- lines.each do |line| +- m = line.match(/^\s*#include\s+\"\s*(.+\.[hH])\s*\"/) +- unless m.nil? +- includes << m[1] +- end +- end +- includes +- end +- +- def find_source_file(header, paths) +- paths.each do |dir| +- src_file = dir + header.ext(C_EXTENSION) +- if File.exist?(src_file) +- return src_file +- end +- end +- nil +- end +- +- def tackit(strings) +- case strings +- when Array +- "\"#{strings.join}\"" +- when /^-/ +- strings +- when /\s/ +- "\"#{strings}\"" +- else +- strings +- end +- end +- +- def squash(prefix, items) +- result = '' +- items.each { |item| result += " #{prefix}#{tackit(item)}" } +- result +- end +- +- def build_compiler_fields +- command = tackit($cfg['compiler']['path']) +- defines = if $cfg['compiler']['defines']['items'].nil? +- '' +- else +- squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items']) +- end +- options = squash('', $cfg['compiler']['options']) +- includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items']) +- includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) +- { :command => command, :defines => defines, :options => options, :includes => includes } +- end +- +- def compile(file, _defines = []) +- compiler = build_compiler_fields +- cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{compiler[:options]}#{compiler[:includes]} #{file} " \ +- "#{$cfg['compiler']['object_files']['prefix']}#{$cfg['compiler']['object_files']['destination']}" +- obj_file = "#{File.basename(file, C_EXTENSION)}#{$cfg['compiler']['object_files']['extension']}" +- execute(cmd_str + obj_file) +- obj_file +- end +- +- def build_linker_fields +- command = tackit($cfg['linker']['path']) +- options = if $cfg['linker']['options'].nil? +- '' +- else +- squash('', $cfg['linker']['options']) +- end +- includes = if $cfg['linker']['includes'].nil? || $cfg['linker']['includes']['items'].nil? +- '' +- else +- squash($cfg['linker']['includes']['prefix'], $cfg['linker']['includes']['items']) +- end +- includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) +- { :command => command, :options => options, :includes => includes } +- end +- +- def link_it(exe_name, obj_list) +- linker = build_linker_fields +- cmd_str = "#{linker[:command]}#{linker[:includes]} " + +- (obj_list.map { |obj| "#{$cfg['linker']['object_files']['path']}#{obj} " }).join + +- $cfg['linker']['bin_files']['prefix'] + ' ' + +- $cfg['linker']['bin_files']['destination'] + +- exe_name + $cfg['linker']['bin_files']['extension'] + " #{linker[:options]}" +- execute(cmd_str) +- end +- +- def build_simulator_fields +- return nil if $cfg['simulator'].nil? +- +- command = if $cfg['simulator']['path'].nil? +- '' +- else +- (tackit($cfg['simulator']['path']) + ' ') +- end +- pre_support = if $cfg['simulator']['pre_support'].nil? +- '' +- else +- squash('', $cfg['simulator']['pre_support']) +- end +- post_support = if $cfg['simulator']['post_support'].nil? +- '' +- else +- squash('', $cfg['simulator']['post_support']) +- end +- { :command => command, :pre_support => pre_support, :post_support => post_support } +- end +- +- def execute(command_string, verbose = true, ok_to_fail = false) +- report command_string +- output = `#{command_string}`.chomp +- report(output) if verbose && !output.nil? && !output.empty? +- unless (!$?.nil? && $?.exitstatus.zero?) || ok_to_fail +- raise "Command failed. (Returned #{$?.exitstatus})" +- end +- +- output +- end +- +- def report_summary +- summary = UnityTestSummary.new +- summary.root = HERE +- results_glob = "#{$cfg['compiler']['build_path']}*.test*" +- results_glob.tr!('\\', '/') +- results = Dir[results_glob] +- summary.targets = results +- report summary.run +- raise 'There were failures' if (summary.failures > 0) && $return_error_on_failures +- end +- +- def run_tests(test_files) +- report 'Running system tests...' +- +- # Tack on TEST define for compiling unit tests +- load_configuration($cfg_file) +- test_defines = ['TEST'] +- $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? +- $cfg['compiler']['defines']['items'] << 'TEST' +- +- include_dirs = local_include_dirs +- +- # Build and execute each unit test +- test_files.each do |test| +- obj_list = [] +- +- # Detect dependencies and build required required modules +- header_list = (extract_headers(test) + ['cmock.h'] + [$cfg[:cmock][:unity_helper_path]]).compact.uniq +- header_list.each do |header| +- # create mocks if needed +- next unless header =~ /Mock/ +- +- require '../../lib/cmock.rb' +- @cmock ||= CMock.new($cfg_file) +- @cmock.setup_mocks([$cfg['compiler']['source_path'] + header.gsub('Mock', '')]) +- end +- +- # compile all mocks +- header_list.each do |header| +- # compile source file header if it exists +- src_file = find_source_file(header, include_dirs) +- unless src_file.nil? +- obj_list << compile(src_file, test_defines) +- end +- end +- +- # Build the test runner (generate if configured to do so) +- test_base = File.basename(test, C_EXTENSION) +- runner_name = test_base + '_Runner.c' +- if $cfg['compiler']['runner_path'].nil? +- runner_path = $cfg['compiler']['build_path'] + runner_name +- test_gen = UnityTestRunnerGenerator.new($cfg_file) +- test_gen.run(test, runner_path) +- else +- runner_path = $cfg['compiler']['runner_path'] + runner_name +- end +- +- obj_list << compile(runner_path, test_defines) +- +- # Build the test module +- obj_list << compile(test, test_defines) +- +- # Link the test executable +- link_it(test_base, obj_list) +- +- # Execute unit test and generate results file +- simulator = build_simulator_fields +- executable = $cfg['linker']['bin_files']['destination'] + test_base + $cfg['linker']['bin_files']['extension'] +- cmd_str = if simulator.nil? +- executable +- else +- "#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}" +- end +- output = execute(cmd_str, true, true) +- test_results = $cfg['compiler']['build_path'] + test_base +- test_results += if output.match(/OK$/m).nil? +- '.testfail' +- else +- '.testpass' +- end +- File.open(test_results, 'w') { |f| f.print output } +- end +- end +- +- def build_application(main) +- report 'Building application...' +- +- obj_list = [] +- load_configuration($cfg_file) +- main_path = $cfg['compiler']['source_path'] + main + C_EXTENSION +- +- # Detect dependencies and build required required modules +- include_dirs = local_include_dirs +- extract_headers(main_path).each do |header| +- src_file = find_source_file(header, include_dirs) +- unless src_file.nil? +- obj_list << compile(src_file) +- end +- end +- +- # Build the main source file +- main_base = File.basename(main_path, C_EXTENSION) +- obj_list << compile(main_path) +- +- # Create the executable +- link_it(main_base, obj_list) +- end +-end +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AT91SAM7X256.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AT91SAM7X256.h +deleted file mode 100644 +index baa031398e..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AT91SAM7X256.h ++++ /dev/null +@@ -1,2556 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h +-// Object : AT91SAM7X256 definitions +-// Generated : AT91 SW Application Group 01/16/2006 (16:36:21) +-// +-// CVS Reference : /AT91SAM7X256.pl/1.15/Wed Nov 2 13:56:49 2005// +-// CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// +-// CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// +-// CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// +-// CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// +-// CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// +-// CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// +-// CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// +-// CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// +-// CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// +-// CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// +-// CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// +-// CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// +-// CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// +-// CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// +-// CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// +-// CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// +-// CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// +-// CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// +-// CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// +-// CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// +-// CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// +-// CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// +-// ---------------------------------------------------------------------------- +- +-#ifndef AT91SAM7X256_H +-#define AT91SAM7X256_H +- +-typedef volatile unsigned int AT91_REG;// Hardware register definition +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR System Peripherals +-// ***************************************************************************** +-typedef struct _AT91S_SYS { +- AT91_REG AIC_SMR[32]; // Source Mode Register +- AT91_REG AIC_SVR[32]; // Source Vector Register +- AT91_REG AIC_IVR; // IRQ Vector Register +- AT91_REG AIC_FVR; // FIQ Vector Register +- AT91_REG AIC_ISR; // Interrupt Status Register +- AT91_REG AIC_IPR; // Interrupt Pending Register +- AT91_REG AIC_IMR; // Interrupt Mask Register +- AT91_REG AIC_CISR; // Core Interrupt Status Register +- AT91_REG Reserved0[2]; // +- AT91_REG AIC_IECR; // Interrupt Enable Command Register +- AT91_REG AIC_IDCR; // Interrupt Disable Command Register +- AT91_REG AIC_ICCR; // Interrupt Clear Command Register +- AT91_REG AIC_ISCR; // Interrupt Set Command Register +- AT91_REG AIC_EOICR; // End of Interrupt Command Register +- AT91_REG AIC_SPU; // Spurious Vector Register +- AT91_REG AIC_DCR; // Debug Control Register (Protect) +- AT91_REG Reserved1[1]; // +- AT91_REG AIC_FFER; // Fast Forcing Enable Register +- AT91_REG AIC_FFDR; // Fast Forcing Disable Register +- AT91_REG AIC_FFSR; // Fast Forcing Status Register +- AT91_REG Reserved2[45]; // +- AT91_REG DBGU_CR; // Control Register +- AT91_REG DBGU_MR; // Mode Register +- AT91_REG DBGU_IER; // Interrupt Enable Register +- AT91_REG DBGU_IDR; // Interrupt Disable Register +- AT91_REG DBGU_IMR; // Interrupt Mask Register +- AT91_REG DBGU_CSR; // Channel Status Register +- AT91_REG DBGU_RHR; // Receiver Holding Register +- AT91_REG DBGU_THR; // Transmitter Holding Register +- AT91_REG DBGU_BRGR; // Baud Rate Generator Register +- AT91_REG Reserved3[7]; // +- AT91_REG DBGU_CIDR; // Chip ID Register +- AT91_REG DBGU_EXID; // Chip ID Extension Register +- AT91_REG DBGU_FNTR; // Force NTRST Register +- AT91_REG Reserved4[45]; // +- AT91_REG DBGU_RPR; // Receive Pointer Register +- AT91_REG DBGU_RCR; // Receive Counter Register +- AT91_REG DBGU_TPR; // Transmit Pointer Register +- AT91_REG DBGU_TCR; // Transmit Counter Register +- AT91_REG DBGU_RNPR; // Receive Next Pointer Register +- AT91_REG DBGU_RNCR; // Receive Next Counter Register +- AT91_REG DBGU_TNPR; // Transmit Next Pointer Register +- AT91_REG DBGU_TNCR; // Transmit Next Counter Register +- AT91_REG DBGU_PTCR; // PDC Transfer Control Register +- AT91_REG DBGU_PTSR; // PDC Transfer Status Register +- AT91_REG Reserved5[54]; // +- AT91_REG PIOA_PER; // PIO Enable Register +- AT91_REG PIOA_PDR; // PIO Disable Register +- AT91_REG PIOA_PSR; // PIO Status Register +- AT91_REG Reserved6[1]; // +- AT91_REG PIOA_OER; // Output Enable Register +- AT91_REG PIOA_ODR; // Output Disable Registerr +- AT91_REG PIOA_OSR; // Output Status Register +- AT91_REG Reserved7[1]; // +- AT91_REG PIOA_IFER; // Input Filter Enable Register +- AT91_REG PIOA_IFDR; // Input Filter Disable Register +- AT91_REG PIOA_IFSR; // Input Filter Status Register +- AT91_REG Reserved8[1]; // +- AT91_REG PIOA_SODR; // Set Output Data Register +- AT91_REG PIOA_CODR; // Clear Output Data Register +- AT91_REG PIOA_ODSR; // Output Data Status Register +- AT91_REG PIOA_PDSR; // Pin Data Status Register +- AT91_REG PIOA_IER; // Interrupt Enable Register +- AT91_REG PIOA_IDR; // Interrupt Disable Register +- AT91_REG PIOA_IMR; // Interrupt Mask Register +- AT91_REG PIOA_ISR; // Interrupt Status Register +- AT91_REG PIOA_MDER; // Multi-driver Enable Register +- AT91_REG PIOA_MDDR; // Multi-driver Disable Register +- AT91_REG PIOA_MDSR; // Multi-driver Status Register +- AT91_REG Reserved9[1]; // +- AT91_REG PIOA_PPUDR; // Pull-up Disable Register +- AT91_REG PIOA_PPUER; // Pull-up Enable Register +- AT91_REG PIOA_PPUSR; // Pull-up Status Register +- AT91_REG Reserved10[1]; // +- AT91_REG PIOA_ASR; // Select A Register +- AT91_REG PIOA_BSR; // Select B Register +- AT91_REG PIOA_ABSR; // AB Select Status Register +- AT91_REG Reserved11[9]; // +- AT91_REG PIOA_OWER; // Output Write Enable Register +- AT91_REG PIOA_OWDR; // Output Write Disable Register +- AT91_REG PIOA_OWSR; // Output Write Status Register +- AT91_REG Reserved12[85]; // +- AT91_REG PIOB_PER; // PIO Enable Register +- AT91_REG PIOB_PDR; // PIO Disable Register +- AT91_REG PIOB_PSR; // PIO Status Register +- AT91_REG Reserved13[1]; // +- AT91_REG PIOB_OER; // Output Enable Register +- AT91_REG PIOB_ODR; // Output Disable Registerr +- AT91_REG PIOB_OSR; // Output Status Register +- AT91_REG Reserved14[1]; // +- AT91_REG PIOB_IFER; // Input Filter Enable Register +- AT91_REG PIOB_IFDR; // Input Filter Disable Register +- AT91_REG PIOB_IFSR; // Input Filter Status Register +- AT91_REG Reserved15[1]; // +- AT91_REG PIOB_SODR; // Set Output Data Register +- AT91_REG PIOB_CODR; // Clear Output Data Register +- AT91_REG PIOB_ODSR; // Output Data Status Register +- AT91_REG PIOB_PDSR; // Pin Data Status Register +- AT91_REG PIOB_IER; // Interrupt Enable Register +- AT91_REG PIOB_IDR; // Interrupt Disable Register +- AT91_REG PIOB_IMR; // Interrupt Mask Register +- AT91_REG PIOB_ISR; // Interrupt Status Register +- AT91_REG PIOB_MDER; // Multi-driver Enable Register +- AT91_REG PIOB_MDDR; // Multi-driver Disable Register +- AT91_REG PIOB_MDSR; // Multi-driver Status Register +- AT91_REG Reserved16[1]; // +- AT91_REG PIOB_PPUDR; // Pull-up Disable Register +- AT91_REG PIOB_PPUER; // Pull-up Enable Register +- AT91_REG PIOB_PPUSR; // Pull-up Status Register +- AT91_REG Reserved17[1]; // +- AT91_REG PIOB_ASR; // Select A Register +- AT91_REG PIOB_BSR; // Select B Register +- AT91_REG PIOB_ABSR; // AB Select Status Register +- AT91_REG Reserved18[9]; // +- AT91_REG PIOB_OWER; // Output Write Enable Register +- AT91_REG PIOB_OWDR; // Output Write Disable Register +- AT91_REG PIOB_OWSR; // Output Write Status Register +- AT91_REG Reserved19[341]; // +- AT91_REG PMC_SCER; // System Clock Enable Register +- AT91_REG PMC_SCDR; // System Clock Disable Register +- AT91_REG PMC_SCSR; // System Clock Status Register +- AT91_REG Reserved20[1]; // +- AT91_REG PMC_PCER; // Peripheral Clock Enable Register +- AT91_REG PMC_PCDR; // Peripheral Clock Disable Register +- AT91_REG PMC_PCSR; // Peripheral Clock Status Register +- AT91_REG Reserved21[1]; // +- AT91_REG PMC_MOR; // Main Oscillator Register +- AT91_REG PMC_MCFR; // Main Clock Frequency Register +- AT91_REG Reserved22[1]; // +- AT91_REG PMC_PLLR; // PLL Register +- AT91_REG PMC_MCKR; // Master Clock Register +- AT91_REG Reserved23[3]; // +- AT91_REG PMC_PCKR[4]; // Programmable Clock Register +- AT91_REG Reserved24[4]; // +- AT91_REG PMC_IER; // Interrupt Enable Register +- AT91_REG PMC_IDR; // Interrupt Disable Register +- AT91_REG PMC_SR; // Status Register +- AT91_REG PMC_IMR; // Interrupt Mask Register +- AT91_REG Reserved25[36]; // +- AT91_REG RSTC_RCR; // Reset Control Register +- AT91_REG RSTC_RSR; // Reset Status Register +- AT91_REG RSTC_RMR; // Reset Mode Register +- AT91_REG Reserved26[5]; // +- AT91_REG RTTC_RTMR; // Real-time Mode Register +- AT91_REG RTTC_RTAR; // Real-time Alarm Register +- AT91_REG RTTC_RTVR; // Real-time Value Register +- AT91_REG RTTC_RTSR; // Real-time Status Register +- AT91_REG PITC_PIMR; // Period Interval Mode Register +- AT91_REG PITC_PISR; // Period Interval Status Register +- AT91_REG PITC_PIVR; // Period Interval Value Register +- AT91_REG PITC_PIIR; // Period Interval Image Register +- AT91_REG WDTC_WDCR; // Watchdog Control Register +- AT91_REG WDTC_WDMR; // Watchdog Mode Register +- AT91_REG WDTC_WDSR; // Watchdog Status Register +- AT91_REG Reserved27[5]; // +- AT91_REG VREG_MR; // Voltage Regulator Mode Register +-} AT91S_SYS, *AT91PS_SYS; +- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Advanced Interrupt Controller +-// ***************************************************************************** +-typedef struct _AT91S_AIC { +- AT91_REG AIC_SMR[32]; // Source Mode Register +- AT91_REG AIC_SVR[32]; // Source Vector Register +- AT91_REG AIC_IVR; // IRQ Vector Register +- AT91_REG AIC_FVR; // FIQ Vector Register +- AT91_REG AIC_ISR; // Interrupt Status Register +- AT91_REG AIC_IPR; // Interrupt Pending Register +- AT91_REG AIC_IMR; // Interrupt Mask Register +- AT91_REG AIC_CISR; // Core Interrupt Status Register +- AT91_REG Reserved0[2]; // +- AT91_REG AIC_IECR; // Interrupt Enable Command Register +- AT91_REG AIC_IDCR; // Interrupt Disable Command Register +- AT91_REG AIC_ICCR; // Interrupt Clear Command Register +- AT91_REG AIC_ISCR; // Interrupt Set Command Register +- AT91_REG AIC_EOICR; // End of Interrupt Command Register +- AT91_REG AIC_SPU; // Spurious Vector Register +- AT91_REG AIC_DCR; // Debug Control Register (Protect) +- AT91_REG Reserved1[1]; // +- AT91_REG AIC_FFER; // Fast Forcing Enable Register +- AT91_REG AIC_FFDR; // Fast Forcing Disable Register +- AT91_REG AIC_FFSR; // Fast Forcing Status Register +-} AT91S_AIC, *AT91PS_AIC; +- +-// -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- +-#define AT91C_AIC_PRIOR ((unsigned int) 0x7 << 0) // (AIC) Priority Level +-#define AT91C_AIC_PRIOR_LOWEST ((unsigned int) 0x0) // (AIC) Lowest priority level +-#define AT91C_AIC_PRIOR_HIGHEST ((unsigned int) 0x7) // (AIC) Highest priority level +-#define AT91C_AIC_SRCTYPE ((unsigned int) 0x3 << 5) // (AIC) Interrupt Source Type +-#define AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL ((unsigned int) 0x0 << 5) // (AIC) External Sources Code Label Low-level Sensitive +-#define AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL ((unsigned int) 0x0 << 5) // (AIC) Internal Sources Code Label High-level Sensitive +-#define AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE ((unsigned int) 0x1 << 5) // (AIC) Internal Sources Code Label Positive Edge triggered +-#define AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE ((unsigned int) 0x1 << 5) // (AIC) External Sources Code Label Negative Edge triggered +-#define AT91C_AIC_SRCTYPE_HIGH_LEVEL ((unsigned int) 0x2 << 5) // (AIC) Internal Or External Sources Code Label High-level Sensitive +-#define AT91C_AIC_SRCTYPE_POSITIVE_EDGE ((unsigned int) 0x3 << 5) // (AIC) Internal Or External Sources Code Label Positive Edge triggered +-// -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- +-#define AT91C_AIC_NFIQ ((unsigned int) 0x1 << 0) // (AIC) NFIQ Status +-#define AT91C_AIC_NIRQ ((unsigned int) 0x1 << 1) // (AIC) NIRQ Status +-// -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- +-#define AT91C_AIC_DCR_PROT ((unsigned int) 0x1 << 0) // (AIC) Protection Mode +-#define AT91C_AIC_DCR_GMSK ((unsigned int) 0x1 << 1) // (AIC) General Mask +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Peripheral DMA Controller +-// ***************************************************************************** +-typedef struct _AT91S_PDC { +- AT91_REG PDC_RPR; // Receive Pointer Register +- AT91_REG PDC_RCR; // Receive Counter Register +- AT91_REG PDC_TPR; // Transmit Pointer Register +- AT91_REG PDC_TCR; // Transmit Counter Register +- AT91_REG PDC_RNPR; // Receive Next Pointer Register +- AT91_REG PDC_RNCR; // Receive Next Counter Register +- AT91_REG PDC_TNPR; // Transmit Next Pointer Register +- AT91_REG PDC_TNCR; // Transmit Next Counter Register +- AT91_REG PDC_PTCR; // PDC Transfer Control Register +- AT91_REG PDC_PTSR; // PDC Transfer Status Register +-} AT91S_PDC, *AT91PS_PDC; +- +-// -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- +-#define AT91C_PDC_RXTEN ((unsigned int) 0x1 << 0) // (PDC) Receiver Transfer Enable +-#define AT91C_PDC_RXTDIS ((unsigned int) 0x1 << 1) // (PDC) Receiver Transfer Disable +-#define AT91C_PDC_TXTEN ((unsigned int) 0x1 << 8) // (PDC) Transmitter Transfer Enable +-#define AT91C_PDC_TXTDIS ((unsigned int) 0x1 << 9) // (PDC) Transmitter Transfer Disable +-// -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Debug Unit +-// ***************************************************************************** +-typedef struct _AT91S_DBGU { +- AT91_REG DBGU_CR; // Control Register +- AT91_REG DBGU_MR; // Mode Register +- AT91_REG DBGU_IER; // Interrupt Enable Register +- AT91_REG DBGU_IDR; // Interrupt Disable Register +- AT91_REG DBGU_IMR; // Interrupt Mask Register +- AT91_REG DBGU_CSR; // Channel Status Register +- AT91_REG DBGU_RHR; // Receiver Holding Register +- AT91_REG DBGU_THR; // Transmitter Holding Register +- AT91_REG DBGU_BRGR; // Baud Rate Generator Register +- AT91_REG Reserved0[7]; // +- AT91_REG DBGU_CIDR; // Chip ID Register +- AT91_REG DBGU_EXID; // Chip ID Extension Register +- AT91_REG DBGU_FNTR; // Force NTRST Register +- AT91_REG Reserved1[45]; // +- AT91_REG DBGU_RPR; // Receive Pointer Register +- AT91_REG DBGU_RCR; // Receive Counter Register +- AT91_REG DBGU_TPR; // Transmit Pointer Register +- AT91_REG DBGU_TCR; // Transmit Counter Register +- AT91_REG DBGU_RNPR; // Receive Next Pointer Register +- AT91_REG DBGU_RNCR; // Receive Next Counter Register +- AT91_REG DBGU_TNPR; // Transmit Next Pointer Register +- AT91_REG DBGU_TNCR; // Transmit Next Counter Register +- AT91_REG DBGU_PTCR; // PDC Transfer Control Register +- AT91_REG DBGU_PTSR; // PDC Transfer Status Register +-} AT91S_DBGU, *AT91PS_DBGU; +- +-// -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- +-#define AT91C_US_RSTRX ((unsigned int) 0x1 << 2) // (DBGU) Reset Receiver +-#define AT91C_US_RSTTX ((unsigned int) 0x1 << 3) // (DBGU) Reset Transmitter +-#define AT91C_US_RXEN ((unsigned int) 0x1 << 4) // (DBGU) Receiver Enable +-#define AT91C_US_RXDIS ((unsigned int) 0x1 << 5) // (DBGU) Receiver Disable +-#define AT91C_US_TXEN ((unsigned int) 0x1 << 6) // (DBGU) Transmitter Enable +-#define AT91C_US_TXDIS ((unsigned int) 0x1 << 7) // (DBGU) Transmitter Disable +-#define AT91C_US_RSTSTA ((unsigned int) 0x1 << 8) // (DBGU) Reset Status Bits +-// -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- +-#define AT91C_US_PAR ((unsigned int) 0x7 << 9) // (DBGU) Parity type +-#define AT91C_US_PAR_EVEN ((unsigned int) 0x0 << 9) // (DBGU) Even Parity +-#define AT91C_US_PAR_ODD ((unsigned int) 0x1 << 9) // (DBGU) Odd Parity +-#define AT91C_US_PAR_SPACE ((unsigned int) 0x2 << 9) // (DBGU) Parity forced to 0 (Space) +-#define AT91C_US_PAR_MARK ((unsigned int) 0x3 << 9) // (DBGU) Parity forced to 1 (Mark) +-#define AT91C_US_PAR_NONE ((unsigned int) 0x4 << 9) // (DBGU) No Parity +-#define AT91C_US_PAR_MULTI_DROP ((unsigned int) 0x6 << 9) // (DBGU) Multi-drop mode +-#define AT91C_US_CHMODE ((unsigned int) 0x3 << 14) // (DBGU) Channel Mode +-#define AT91C_US_CHMODE_NORMAL ((unsigned int) 0x0 << 14) // (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. +-#define AT91C_US_CHMODE_AUTO ((unsigned int) 0x1 << 14) // (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. +-#define AT91C_US_CHMODE_LOCAL ((unsigned int) 0x2 << 14) // (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. +-#define AT91C_US_CHMODE_REMOTE ((unsigned int) 0x3 << 14) // (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. +-// -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-#define AT91C_US_RXRDY ((unsigned int) 0x1 << 0) // (DBGU) RXRDY Interrupt +-#define AT91C_US_TXRDY ((unsigned int) 0x1 << 1) // (DBGU) TXRDY Interrupt +-#define AT91C_US_ENDRX ((unsigned int) 0x1 << 3) // (DBGU) End of Receive Transfer Interrupt +-#define AT91C_US_ENDTX ((unsigned int) 0x1 << 4) // (DBGU) End of Transmit Interrupt +-#define AT91C_US_OVRE ((unsigned int) 0x1 << 5) // (DBGU) Overrun Interrupt +-#define AT91C_US_FRAME ((unsigned int) 0x1 << 6) // (DBGU) Framing Error Interrupt +-#define AT91C_US_PARE ((unsigned int) 0x1 << 7) // (DBGU) Parity Error Interrupt +-#define AT91C_US_TXEMPTY ((unsigned int) 0x1 << 9) // (DBGU) TXEMPTY Interrupt +-#define AT91C_US_TXBUFE ((unsigned int) 0x1 << 11) // (DBGU) TXBUFE Interrupt +-#define AT91C_US_RXBUFF ((unsigned int) 0x1 << 12) // (DBGU) RXBUFF Interrupt +-#define AT91C_US_COMM_TX ((unsigned int) 0x1 << 30) // (DBGU) COMM_TX Interrupt +-#define AT91C_US_COMM_RX ((unsigned int) 0x1 << 31) // (DBGU) COMM_RX Interrupt +-// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- +-// -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- +-#define AT91C_US_FORCE_NTRST ((unsigned int) 0x1 << 0) // (DBGU) Force NTRST in JTAG +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Parallel Input Output Controler +-// ***************************************************************************** +-typedef struct _AT91S_PIO { +- AT91_REG PIO_PER; // PIO Enable Register +- AT91_REG PIO_PDR; // PIO Disable Register +- AT91_REG PIO_PSR; // PIO Status Register +- AT91_REG Reserved0[1]; // +- AT91_REG PIO_OER; // Output Enable Register +- AT91_REG PIO_ODR; // Output Disable Registerr +- AT91_REG PIO_OSR; // Output Status Register +- AT91_REG Reserved1[1]; // +- AT91_REG PIO_IFER; // Input Filter Enable Register +- AT91_REG PIO_IFDR; // Input Filter Disable Register +- AT91_REG PIO_IFSR; // Input Filter Status Register +- AT91_REG Reserved2[1]; // +- AT91_REG PIO_SODR; // Set Output Data Register +- AT91_REG PIO_CODR; // Clear Output Data Register +- AT91_REG PIO_ODSR; // Output Data Status Register +- AT91_REG PIO_PDSR; // Pin Data Status Register +- AT91_REG PIO_IER; // Interrupt Enable Register +- AT91_REG PIO_IDR; // Interrupt Disable Register +- AT91_REG PIO_IMR; // Interrupt Mask Register +- AT91_REG PIO_ISR; // Interrupt Status Register +- AT91_REG PIO_MDER; // Multi-driver Enable Register +- AT91_REG PIO_MDDR; // Multi-driver Disable Register +- AT91_REG PIO_MDSR; // Multi-driver Status Register +- AT91_REG Reserved3[1]; // +- AT91_REG PIO_PPUDR; // Pull-up Disable Register +- AT91_REG PIO_PPUER; // Pull-up Enable Register +- AT91_REG PIO_PPUSR; // Pull-up Status Register +- AT91_REG Reserved4[1]; // +- AT91_REG PIO_ASR; // Select A Register +- AT91_REG PIO_BSR; // Select B Register +- AT91_REG PIO_ABSR; // AB Select Status Register +- AT91_REG Reserved5[9]; // +- AT91_REG PIO_OWER; // Output Write Enable Register +- AT91_REG PIO_OWDR; // Output Write Disable Register +- AT91_REG PIO_OWSR; // Output Write Status Register +-} AT91S_PIO, *AT91PS_PIO; +- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Clock Generator Controler +-// ***************************************************************************** +-typedef struct _AT91S_CKGR { +- AT91_REG CKGR_MOR; // Main Oscillator Register +- AT91_REG CKGR_MCFR; // Main Clock Frequency Register +- AT91_REG Reserved0[1]; // +- AT91_REG CKGR_PLLR; // PLL Register +-} AT91S_CKGR, *AT91PS_CKGR; +- +-// -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- +-#define AT91C_CKGR_MOSCEN ((unsigned int) 0x1 << 0) // (CKGR) Main Oscillator Enable +-#define AT91C_CKGR_OSCBYPASS ((unsigned int) 0x1 << 1) // (CKGR) Main Oscillator Bypass +-#define AT91C_CKGR_OSCOUNT ((unsigned int) 0xFF << 8) // (CKGR) Main Oscillator Start-up Time +-// -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- +-#define AT91C_CKGR_MAINF ((unsigned int) 0xFFFF << 0) // (CKGR) Main Clock Frequency +-#define AT91C_CKGR_MAINRDY ((unsigned int) 0x1 << 16) // (CKGR) Main Clock Ready +-// -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- +-#define AT91C_CKGR_DIV ((unsigned int) 0xFF << 0) // (CKGR) Divider Selected +-#define AT91C_CKGR_DIV_0 ((unsigned int) 0x0) // (CKGR) Divider output is 0 +-#define AT91C_CKGR_DIV_BYPASS ((unsigned int) 0x1) // (CKGR) Divider is bypassed +-#define AT91C_CKGR_PLLCOUNT ((unsigned int) 0x3F << 8) // (CKGR) PLL Counter +-#define AT91C_CKGR_OUT ((unsigned int) 0x3 << 14) // (CKGR) PLL Output Frequency Range +-#define AT91C_CKGR_OUT_0 ((unsigned int) 0x0 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_1 ((unsigned int) 0x1 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_2 ((unsigned int) 0x2 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_3 ((unsigned int) 0x3 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_MUL ((unsigned int) 0x7FF << 16) // (CKGR) PLL Multiplier +-#define AT91C_CKGR_USBDIV ((unsigned int) 0x3 << 28) // (CKGR) Divider for USB Clocks +-#define AT91C_CKGR_USBDIV_0 ((unsigned int) 0x0 << 28) // (CKGR) Divider output is PLL clock output +-#define AT91C_CKGR_USBDIV_1 ((unsigned int) 0x1 << 28) // (CKGR) Divider output is PLL clock output divided by 2 +-#define AT91C_CKGR_USBDIV_2 ((unsigned int) 0x2 << 28) // (CKGR) Divider output is PLL clock output divided by 4 +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Power Management Controler +-// ***************************************************************************** +-typedef struct _AT91S_PMC { +- AT91_REG PMC_SCER; // System Clock Enable Register +- AT91_REG PMC_SCDR; // System Clock Disable Register +- AT91_REG PMC_SCSR; // System Clock Status Register +- AT91_REG Reserved0[1]; // +- AT91_REG PMC_PCER; // Peripheral Clock Enable Register +- AT91_REG PMC_PCDR; // Peripheral Clock Disable Register +- AT91_REG PMC_PCSR; // Peripheral Clock Status Register +- AT91_REG Reserved1[1]; // +- AT91_REG PMC_MOR; // Main Oscillator Register +- AT91_REG PMC_MCFR; // Main Clock Frequency Register +- AT91_REG Reserved2[1]; // +- AT91_REG PMC_PLLR; // PLL Register +- AT91_REG PMC_MCKR; // Master Clock Register +- AT91_REG Reserved3[3]; // +- AT91_REG PMC_PCKR[4]; // Programmable Clock Register +- AT91_REG Reserved4[4]; // +- AT91_REG PMC_IER; // Interrupt Enable Register +- AT91_REG PMC_IDR; // Interrupt Disable Register +- AT91_REG PMC_SR; // Status Register +- AT91_REG PMC_IMR; // Interrupt Mask Register +-} AT91S_PMC, *AT91PS_PMC; +- +-// -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- +-#define AT91C_PMC_PCK ((unsigned int) 0x1 << 0) // (PMC) Processor Clock +-#define AT91C_PMC_UDP ((unsigned int) 0x1 << 7) // (PMC) USB Device Port Clock +-#define AT91C_PMC_PCK0 ((unsigned int) 0x1 << 8) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK1 ((unsigned int) 0x1 << 9) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK2 ((unsigned int) 0x1 << 10) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK3 ((unsigned int) 0x1 << 11) // (PMC) Programmable Clock Output +-// -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- +-// -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- +-// -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- +-// -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- +-// -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- +-// -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- +-#define AT91C_PMC_CSS ((unsigned int) 0x3 << 0) // (PMC) Programmable Clock Selection +-#define AT91C_PMC_CSS_SLOW_CLK ((unsigned int) 0x0) // (PMC) Slow Clock is selected +-#define AT91C_PMC_CSS_MAIN_CLK ((unsigned int) 0x1) // (PMC) Main Clock is selected +-#define AT91C_PMC_CSS_PLL_CLK ((unsigned int) 0x3) // (PMC) Clock from PLL is selected +-#define AT91C_PMC_PRES ((unsigned int) 0x7 << 2) // (PMC) Programmable Clock Prescaler +-#define AT91C_PMC_PRES_CLK ((unsigned int) 0x0 << 2) // (PMC) Selected clock +-#define AT91C_PMC_PRES_CLK_2 ((unsigned int) 0x1 << 2) // (PMC) Selected clock divided by 2 +-#define AT91C_PMC_PRES_CLK_4 ((unsigned int) 0x2 << 2) // (PMC) Selected clock divided by 4 +-#define AT91C_PMC_PRES_CLK_8 ((unsigned int) 0x3 << 2) // (PMC) Selected clock divided by 8 +-#define AT91C_PMC_PRES_CLK_16 ((unsigned int) 0x4 << 2) // (PMC) Selected clock divided by 16 +-#define AT91C_PMC_PRES_CLK_32 ((unsigned int) 0x5 << 2) // (PMC) Selected clock divided by 32 +-#define AT91C_PMC_PRES_CLK_64 ((unsigned int) 0x6 << 2) // (PMC) Selected clock divided by 64 +-// -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- +-// -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- +-#define AT91C_PMC_MOSCS ((unsigned int) 0x1 << 0) // (PMC) MOSC Status/Enable/Disable/Mask +-#define AT91C_PMC_LOCK ((unsigned int) 0x1 << 2) // (PMC) PLL Status/Enable/Disable/Mask +-#define AT91C_PMC_MCKRDY ((unsigned int) 0x1 << 3) // (PMC) MCK_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK0RDY ((unsigned int) 0x1 << 8) // (PMC) PCK0_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK1RDY ((unsigned int) 0x1 << 9) // (PMC) PCK1_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK2RDY ((unsigned int) 0x1 << 10) // (PMC) PCK2_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK3RDY ((unsigned int) 0x1 << 11) // (PMC) PCK3_RDY Status/Enable/Disable/Mask +-// -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- +-// -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- +-// -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Reset Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_RSTC { +- AT91_REG RSTC_RCR; // Reset Control Register +- AT91_REG RSTC_RSR; // Reset Status Register +- AT91_REG RSTC_RMR; // Reset Mode Register +-} AT91S_RSTC, *AT91PS_RSTC; +- +-// -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- +-#define AT91C_RSTC_PROCRST ((unsigned int) 0x1 << 0) // (RSTC) Processor Reset +-#define AT91C_RSTC_PERRST ((unsigned int) 0x1 << 2) // (RSTC) Peripheral Reset +-#define AT91C_RSTC_EXTRST ((unsigned int) 0x1 << 3) // (RSTC) External Reset +-#define AT91C_RSTC_KEY ((unsigned int) 0xFF << 24) // (RSTC) Password +-// -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- +-#define AT91C_RSTC_URSTS ((unsigned int) 0x1 << 0) // (RSTC) User Reset Status +-#define AT91C_RSTC_BODSTS ((unsigned int) 0x1 << 1) // (RSTC) Brownout Detection Status +-#define AT91C_RSTC_RSTTYP ((unsigned int) 0x7 << 8) // (RSTC) Reset Type +-#define AT91C_RSTC_RSTTYP_POWERUP ((unsigned int) 0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising. +-#define AT91C_RSTC_RSTTYP_WAKEUP ((unsigned int) 0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising. +-#define AT91C_RSTC_RSTTYP_WATCHDOG ((unsigned int) 0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occured. +-#define AT91C_RSTC_RSTTYP_SOFTWARE ((unsigned int) 0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software. +-#define AT91C_RSTC_RSTTYP_USER ((unsigned int) 0x4 << 8) // (RSTC) User Reset. NRST pin detected low. +-#define AT91C_RSTC_RSTTYP_BROWNOUT ((unsigned int) 0x5 << 8) // (RSTC) Brownout Reset occured. +-#define AT91C_RSTC_NRSTL ((unsigned int) 0x1 << 16) // (RSTC) NRST pin level +-#define AT91C_RSTC_SRCMP ((unsigned int) 0x1 << 17) // (RSTC) Software Reset Command in Progress. +-// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- +-#define AT91C_RSTC_URSTEN ((unsigned int) 0x1 << 0) // (RSTC) User Reset Enable +-#define AT91C_RSTC_URSTIEN ((unsigned int) 0x1 << 4) // (RSTC) User Reset Interrupt Enable +-#define AT91C_RSTC_ERSTL ((unsigned int) 0xF << 8) // (RSTC) User Reset Length +-#define AT91C_RSTC_BODIEN ((unsigned int) 0x1 << 16) // (RSTC) Brownout Detection Interrupt Enable +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_RTTC { +- AT91_REG RTTC_RTMR; // Real-time Mode Register +- AT91_REG RTTC_RTAR; // Real-time Alarm Register +- AT91_REG RTTC_RTVR; // Real-time Value Register +- AT91_REG RTTC_RTSR; // Real-time Status Register +-} AT91S_RTTC, *AT91PS_RTTC; +- +-// -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- +-#define AT91C_RTTC_RTPRES ((unsigned int) 0xFFFF << 0) // (RTTC) Real-time Timer Prescaler Value +-#define AT91C_RTTC_ALMIEN ((unsigned int) 0x1 << 16) // (RTTC) Alarm Interrupt Enable +-#define AT91C_RTTC_RTTINCIEN ((unsigned int) 0x1 << 17) // (RTTC) Real Time Timer Increment Interrupt Enable +-#define AT91C_RTTC_RTTRST ((unsigned int) 0x1 << 18) // (RTTC) Real Time Timer Restart +-// -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- +-#define AT91C_RTTC_ALMV ((unsigned int) 0x0 << 0) // (RTTC) Alarm Value +-// -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- +-#define AT91C_RTTC_CRTV ((unsigned int) 0x0 << 0) // (RTTC) Current Real-time Value +-// -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- +-#define AT91C_RTTC_ALMS ((unsigned int) 0x1 << 0) // (RTTC) Real-time Alarm Status +-#define AT91C_RTTC_RTTINC ((unsigned int) 0x1 << 1) // (RTTC) Real-time Timer Increment +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_PITC { +- AT91_REG PITC_PIMR; // Period Interval Mode Register +- AT91_REG PITC_PISR; // Period Interval Status Register +- AT91_REG PITC_PIVR; // Period Interval Value Register +- AT91_REG PITC_PIIR; // Period Interval Image Register +-} AT91S_PITC, *AT91PS_PITC; +- +-// -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- +-#define AT91C_PITC_PIV ((unsigned int) 0xFFFFF << 0) // (PITC) Periodic Interval Value +-#define AT91C_PITC_PITEN ((unsigned int) 0x1 << 24) // (PITC) Periodic Interval Timer Enabled +-#define AT91C_PITC_PITIEN ((unsigned int) 0x1 << 25) // (PITC) Periodic Interval Timer Interrupt Enable +-// -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- +-#define AT91C_PITC_PITS ((unsigned int) 0x1 << 0) // (PITC) Periodic Interval Timer Status +-// -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- +-#define AT91C_PITC_CPIV ((unsigned int) 0xFFFFF << 0) // (PITC) Current Periodic Interval Value +-#define AT91C_PITC_PICNT ((unsigned int) 0xFFF << 20) // (PITC) Periodic Interval Counter +-// -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_WDTC { +- AT91_REG WDTC_WDCR; // Watchdog Control Register +- AT91_REG WDTC_WDMR; // Watchdog Mode Register +- AT91_REG WDTC_WDSR; // Watchdog Status Register +-} AT91S_WDTC, *AT91PS_WDTC; +- +-// -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- +-#define AT91C_WDTC_WDRSTT ((unsigned int) 0x1 << 0) // (WDTC) Watchdog Restart +-#define AT91C_WDTC_KEY ((unsigned int) 0xFF << 24) // (WDTC) Watchdog KEY Password +-// -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- +-#define AT91C_WDTC_WDV ((unsigned int) 0xFFF << 0) // (WDTC) Watchdog Timer Restart +-#define AT91C_WDTC_WDFIEN ((unsigned int) 0x1 << 12) // (WDTC) Watchdog Fault Interrupt Enable +-#define AT91C_WDTC_WDRSTEN ((unsigned int) 0x1 << 13) // (WDTC) Watchdog Reset Enable +-#define AT91C_WDTC_WDRPROC ((unsigned int) 0x1 << 14) // (WDTC) Watchdog Timer Restart +-#define AT91C_WDTC_WDDIS ((unsigned int) 0x1 << 15) // (WDTC) Watchdog Disable +-#define AT91C_WDTC_WDD ((unsigned int) 0xFFF << 16) // (WDTC) Watchdog Delta Value +-#define AT91C_WDTC_WDDBGHLT ((unsigned int) 0x1 << 28) // (WDTC) Watchdog Debug Halt +-#define AT91C_WDTC_WDIDLEHLT ((unsigned int) 0x1 << 29) // (WDTC) Watchdog Idle Halt +-// -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- +-#define AT91C_WDTC_WDUNF ((unsigned int) 0x1 << 0) // (WDTC) Watchdog Underflow +-#define AT91C_WDTC_WDERR ((unsigned int) 0x1 << 1) // (WDTC) Watchdog Error +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_VREG { +- AT91_REG VREG_MR; // Voltage Regulator Mode Register +-} AT91S_VREG, *AT91PS_VREG; +- +-// -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- +-#define AT91C_VREG_PSTDBY ((unsigned int) 0x1 << 0) // (VREG) Voltage Regulator Power Standby Mode +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Memory Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_MC { +- AT91_REG MC_RCR; // MC Remap Control Register +- AT91_REG MC_ASR; // MC Abort Status Register +- AT91_REG MC_AASR; // MC Abort Address Status Register +- AT91_REG Reserved0[21]; // +- AT91_REG MC_FMR; // MC Flash Mode Register +- AT91_REG MC_FCR; // MC Flash Command Register +- AT91_REG MC_FSR; // MC Flash Status Register +-} AT91S_MC, *AT91PS_MC; +- +-// -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- +-#define AT91C_MC_RCB ((unsigned int) 0x1 << 0) // (MC) Remap Command Bit +-// -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- +-#define AT91C_MC_UNDADD ((unsigned int) 0x1 << 0) // (MC) Undefined Addess Abort Status +-#define AT91C_MC_MISADD ((unsigned int) 0x1 << 1) // (MC) Misaligned Addess Abort Status +-#define AT91C_MC_ABTSZ ((unsigned int) 0x3 << 8) // (MC) Abort Size Status +-#define AT91C_MC_ABTSZ_BYTE ((unsigned int) 0x0 << 8) // (MC) Byte +-#define AT91C_MC_ABTSZ_HWORD ((unsigned int) 0x1 << 8) // (MC) Half-word +-#define AT91C_MC_ABTSZ_WORD ((unsigned int) 0x2 << 8) // (MC) Word +-#define AT91C_MC_ABTTYP ((unsigned int) 0x3 << 10) // (MC) Abort Type Status +-#define AT91C_MC_ABTTYP_DATAR ((unsigned int) 0x0 << 10) // (MC) Data Read +-#define AT91C_MC_ABTTYP_DATAW ((unsigned int) 0x1 << 10) // (MC) Data Write +-#define AT91C_MC_ABTTYP_FETCH ((unsigned int) 0x2 << 10) // (MC) Code Fetch +-#define AT91C_MC_MST0 ((unsigned int) 0x1 << 16) // (MC) Master 0 Abort Source +-#define AT91C_MC_MST1 ((unsigned int) 0x1 << 17) // (MC) Master 1 Abort Source +-#define AT91C_MC_SVMST0 ((unsigned int) 0x1 << 24) // (MC) Saved Master 0 Abort Source +-#define AT91C_MC_SVMST1 ((unsigned int) 0x1 << 25) // (MC) Saved Master 1 Abort Source +-// -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- +-#define AT91C_MC_FRDY ((unsigned int) 0x1 << 0) // (MC) Flash Ready +-#define AT91C_MC_LOCKE ((unsigned int) 0x1 << 2) // (MC) Lock Error +-#define AT91C_MC_PROGE ((unsigned int) 0x1 << 3) // (MC) Programming Error +-#define AT91C_MC_NEBP ((unsigned int) 0x1 << 7) // (MC) No Erase Before Programming +-#define AT91C_MC_FWS ((unsigned int) 0x3 << 8) // (MC) Flash Wait State +-#define AT91C_MC_FWS_0FWS ((unsigned int) 0x0 << 8) // (MC) 1 cycle for Read, 2 for Write operations +-#define AT91C_MC_FWS_1FWS ((unsigned int) 0x1 << 8) // (MC) 2 cycles for Read, 3 for Write operations +-#define AT91C_MC_FWS_2FWS ((unsigned int) 0x2 << 8) // (MC) 3 cycles for Read, 4 for Write operations +-#define AT91C_MC_FWS_3FWS ((unsigned int) 0x3 << 8) // (MC) 4 cycles for Read, 4 for Write operations +-#define AT91C_MC_FMCN ((unsigned int) 0xFF << 16) // (MC) Flash Microsecond Cycle Number +-// -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- +-#define AT91C_MC_FCMD ((unsigned int) 0xF << 0) // (MC) Flash Command +-#define AT91C_MC_FCMD_START_PROG ((unsigned int) 0x1) // (MC) Starts the programming of th epage specified by PAGEN. +-#define AT91C_MC_FCMD_LOCK ((unsigned int) 0x2) // (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-#define AT91C_MC_FCMD_PROG_AND_LOCK ((unsigned int) 0x3) // (MC) The lock sequence automatically happens after the programming sequence is completed. +-#define AT91C_MC_FCMD_UNLOCK ((unsigned int) 0x4) // (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-#define AT91C_MC_FCMD_ERASE_ALL ((unsigned int) 0x8) // (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. +-#define AT91C_MC_FCMD_SET_GP_NVM ((unsigned int) 0xB) // (MC) Set General Purpose NVM bits. +-#define AT91C_MC_FCMD_CLR_GP_NVM ((unsigned int) 0xD) // (MC) Clear General Purpose NVM bits. +-#define AT91C_MC_FCMD_SET_SECURITY ((unsigned int) 0xF) // (MC) Set Security Bit. +-#define AT91C_MC_PAGEN ((unsigned int) 0x3FF << 8) // (MC) Page Number +-#define AT91C_MC_KEY ((unsigned int) 0xFF << 24) // (MC) Writing Protect Key +-// -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- +-#define AT91C_MC_SECURITY ((unsigned int) 0x1 << 4) // (MC) Security Bit Status +-#define AT91C_MC_GPNVM0 ((unsigned int) 0x1 << 8) // (MC) Sector 0 Lock Status +-#define AT91C_MC_GPNVM1 ((unsigned int) 0x1 << 9) // (MC) Sector 1 Lock Status +-#define AT91C_MC_GPNVM2 ((unsigned int) 0x1 << 10) // (MC) Sector 2 Lock Status +-#define AT91C_MC_GPNVM3 ((unsigned int) 0x1 << 11) // (MC) Sector 3 Lock Status +-#define AT91C_MC_GPNVM4 ((unsigned int) 0x1 << 12) // (MC) Sector 4 Lock Status +-#define AT91C_MC_GPNVM5 ((unsigned int) 0x1 << 13) // (MC) Sector 5 Lock Status +-#define AT91C_MC_GPNVM6 ((unsigned int) 0x1 << 14) // (MC) Sector 6 Lock Status +-#define AT91C_MC_GPNVM7 ((unsigned int) 0x1 << 15) // (MC) Sector 7 Lock Status +-#define AT91C_MC_LOCKS0 ((unsigned int) 0x1 << 16) // (MC) Sector 0 Lock Status +-#define AT91C_MC_LOCKS1 ((unsigned int) 0x1 << 17) // (MC) Sector 1 Lock Status +-#define AT91C_MC_LOCKS2 ((unsigned int) 0x1 << 18) // (MC) Sector 2 Lock Status +-#define AT91C_MC_LOCKS3 ((unsigned int) 0x1 << 19) // (MC) Sector 3 Lock Status +-#define AT91C_MC_LOCKS4 ((unsigned int) 0x1 << 20) // (MC) Sector 4 Lock Status +-#define AT91C_MC_LOCKS5 ((unsigned int) 0x1 << 21) // (MC) Sector 5 Lock Status +-#define AT91C_MC_LOCKS6 ((unsigned int) 0x1 << 22) // (MC) Sector 6 Lock Status +-#define AT91C_MC_LOCKS7 ((unsigned int) 0x1 << 23) // (MC) Sector 7 Lock Status +-#define AT91C_MC_LOCKS8 ((unsigned int) 0x1 << 24) // (MC) Sector 8 Lock Status +-#define AT91C_MC_LOCKS9 ((unsigned int) 0x1 << 25) // (MC) Sector 9 Lock Status +-#define AT91C_MC_LOCKS10 ((unsigned int) 0x1 << 26) // (MC) Sector 10 Lock Status +-#define AT91C_MC_LOCKS11 ((unsigned int) 0x1 << 27) // (MC) Sector 11 Lock Status +-#define AT91C_MC_LOCKS12 ((unsigned int) 0x1 << 28) // (MC) Sector 12 Lock Status +-#define AT91C_MC_LOCKS13 ((unsigned int) 0x1 << 29) // (MC) Sector 13 Lock Status +-#define AT91C_MC_LOCKS14 ((unsigned int) 0x1 << 30) // (MC) Sector 14 Lock Status +-#define AT91C_MC_LOCKS15 ((unsigned int) 0x1 << 31) // (MC) Sector 15 Lock Status +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Serial Parallel Interface +-// ***************************************************************************** +-typedef struct _AT91S_SPI { +- AT91_REG SPI_CR; // Control Register +- AT91_REG SPI_MR; // Mode Register +- AT91_REG SPI_RDR; // Receive Data Register +- AT91_REG SPI_TDR; // Transmit Data Register +- AT91_REG SPI_SR; // Status Register +- AT91_REG SPI_IER; // Interrupt Enable Register +- AT91_REG SPI_IDR; // Interrupt Disable Register +- AT91_REG SPI_IMR; // Interrupt Mask Register +- AT91_REG Reserved0[4]; // +- AT91_REG SPI_CSR[4]; // Chip Select Register +- AT91_REG Reserved1[48]; // +- AT91_REG SPI_RPR; // Receive Pointer Register +- AT91_REG SPI_RCR; // Receive Counter Register +- AT91_REG SPI_TPR; // Transmit Pointer Register +- AT91_REG SPI_TCR; // Transmit Counter Register +- AT91_REG SPI_RNPR; // Receive Next Pointer Register +- AT91_REG SPI_RNCR; // Receive Next Counter Register +- AT91_REG SPI_TNPR; // Transmit Next Pointer Register +- AT91_REG SPI_TNCR; // Transmit Next Counter Register +- AT91_REG SPI_PTCR; // PDC Transfer Control Register +- AT91_REG SPI_PTSR; // PDC Transfer Status Register +-} AT91S_SPI, *AT91PS_SPI; +- +-// -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- +-#define AT91C_SPI_SPIEN ((unsigned int) 0x1 << 0) // (SPI) SPI Enable +-#define AT91C_SPI_SPIDIS ((unsigned int) 0x1 << 1) // (SPI) SPI Disable +-#define AT91C_SPI_SWRST ((unsigned int) 0x1 << 7) // (SPI) SPI Software reset +-#define AT91C_SPI_LASTXFER ((unsigned int) 0x1 << 24) // (SPI) SPI Last Transfer +-// -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- +-#define AT91C_SPI_MSTR ((unsigned int) 0x1 << 0) // (SPI) Master/Slave Mode +-#define AT91C_SPI_PS ((unsigned int) 0x1 << 1) // (SPI) Peripheral Select +-#define AT91C_SPI_PS_FIXED ((unsigned int) 0x0 << 1) // (SPI) Fixed Peripheral Select +-#define AT91C_SPI_PS_VARIABLE ((unsigned int) 0x1 << 1) // (SPI) Variable Peripheral Select +-#define AT91C_SPI_PCSDEC ((unsigned int) 0x1 << 2) // (SPI) Chip Select Decode +-#define AT91C_SPI_FDIV ((unsigned int) 0x1 << 3) // (SPI) Clock Selection +-#define AT91C_SPI_MODFDIS ((unsigned int) 0x1 << 4) // (SPI) Mode Fault Detection +-#define AT91C_SPI_LLB ((unsigned int) 0x1 << 7) // (SPI) Clock Selection +-#define AT91C_SPI_PCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select +-#define AT91C_SPI_DLYBCS ((unsigned int) 0xFF << 24) // (SPI) Delay Between Chip Selects +-// -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- +-#define AT91C_SPI_RD ((unsigned int) 0xFFFF << 0) // (SPI) Receive Data +-#define AT91C_SPI_RPCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select Status +-// -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- +-#define AT91C_SPI_TD ((unsigned int) 0xFFFF << 0) // (SPI) Transmit Data +-#define AT91C_SPI_TPCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select Status +-// -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- +-#define AT91C_SPI_RDRF ((unsigned int) 0x1 << 0) // (SPI) Receive Data Register Full +-#define AT91C_SPI_TDRE ((unsigned int) 0x1 << 1) // (SPI) Transmit Data Register Empty +-#define AT91C_SPI_MODF ((unsigned int) 0x1 << 2) // (SPI) Mode Fault Error +-#define AT91C_SPI_OVRES ((unsigned int) 0x1 << 3) // (SPI) Overrun Error Status +-#define AT91C_SPI_ENDRX ((unsigned int) 0x1 << 4) // (SPI) End of Receiver Transfer +-#define AT91C_SPI_ENDTX ((unsigned int) 0x1 << 5) // (SPI) End of Receiver Transfer +-#define AT91C_SPI_RXBUFF ((unsigned int) 0x1 << 6) // (SPI) RXBUFF Interrupt +-#define AT91C_SPI_TXBUFE ((unsigned int) 0x1 << 7) // (SPI) TXBUFE Interrupt +-#define AT91C_SPI_NSSR ((unsigned int) 0x1 << 8) // (SPI) NSSR Interrupt +-#define AT91C_SPI_TXEMPTY ((unsigned int) 0x1 << 9) // (SPI) TXEMPTY Interrupt +-#define AT91C_SPI_SPIENS ((unsigned int) 0x1 << 16) // (SPI) Enable Status +-// -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- +-// -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- +-// -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- +-// -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- +-#define AT91C_SPI_CPOL ((unsigned int) 0x1 << 0) // (SPI) Clock Polarity +-#define AT91C_SPI_NCPHA ((unsigned int) 0x1 << 1) // (SPI) Clock Phase +-#define AT91C_SPI_CSAAT ((unsigned int) 0x1 << 3) // (SPI) Chip Select Active After Transfer +-#define AT91C_SPI_BITS ((unsigned int) 0xF << 4) // (SPI) Bits Per Transfer +-#define AT91C_SPI_BITS_8 ((unsigned int) 0x0 << 4) // (SPI) 8 Bits Per transfer +-#define AT91C_SPI_BITS_9 ((unsigned int) 0x1 << 4) // (SPI) 9 Bits Per transfer +-#define AT91C_SPI_BITS_10 ((unsigned int) 0x2 << 4) // (SPI) 10 Bits Per transfer +-#define AT91C_SPI_BITS_11 ((unsigned int) 0x3 << 4) // (SPI) 11 Bits Per transfer +-#define AT91C_SPI_BITS_12 ((unsigned int) 0x4 << 4) // (SPI) 12 Bits Per transfer +-#define AT91C_SPI_BITS_13 ((unsigned int) 0x5 << 4) // (SPI) 13 Bits Per transfer +-#define AT91C_SPI_BITS_14 ((unsigned int) 0x6 << 4) // (SPI) 14 Bits Per transfer +-#define AT91C_SPI_BITS_15 ((unsigned int) 0x7 << 4) // (SPI) 15 Bits Per transfer +-#define AT91C_SPI_BITS_16 ((unsigned int) 0x8 << 4) // (SPI) 16 Bits Per transfer +-#define AT91C_SPI_SCBR ((unsigned int) 0xFF << 8) // (SPI) Serial Clock Baud Rate +-#define AT91C_SPI_DLYBS ((unsigned int) 0xFF << 16) // (SPI) Delay Before SPCK +-#define AT91C_SPI_DLYBCT ((unsigned int) 0xFF << 24) // (SPI) Delay Between Consecutive Transfers +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Usart +-// ***************************************************************************** +-typedef struct _AT91S_USART { +- AT91_REG US_CR; // Control Register +- AT91_REG US_MR; // Mode Register +- AT91_REG US_IER; // Interrupt Enable Register +- AT91_REG US_IDR; // Interrupt Disable Register +- AT91_REG US_IMR; // Interrupt Mask Register +- AT91_REG US_CSR; // Channel Status Register +- AT91_REG US_RHR; // Receiver Holding Register +- AT91_REG US_THR; // Transmitter Holding Register +- AT91_REG US_BRGR; // Baud Rate Generator Register +- AT91_REG US_RTOR; // Receiver Time-out Register +- AT91_REG US_TTGR; // Transmitter Time-guard Register +- AT91_REG Reserved0[5]; // +- AT91_REG US_FIDI; // FI_DI_Ratio Register +- AT91_REG US_NER; // Nb Errors Register +- AT91_REG Reserved1[1]; // +- AT91_REG US_IF; // IRDA_FILTER Register +- AT91_REG Reserved2[44]; // +- AT91_REG US_RPR; // Receive Pointer Register +- AT91_REG US_RCR; // Receive Counter Register +- AT91_REG US_TPR; // Transmit Pointer Register +- AT91_REG US_TCR; // Transmit Counter Register +- AT91_REG US_RNPR; // Receive Next Pointer Register +- AT91_REG US_RNCR; // Receive Next Counter Register +- AT91_REG US_TNPR; // Transmit Next Pointer Register +- AT91_REG US_TNCR; // Transmit Next Counter Register +- AT91_REG US_PTCR; // PDC Transfer Control Register +- AT91_REG US_PTSR; // PDC Transfer Status Register +-} AT91S_USART, *AT91PS_USART; +- +-// -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- +-#define AT91C_US_STTBRK ((unsigned int) 0x1 << 9) // (USART) Start Break +-#define AT91C_US_STPBRK ((unsigned int) 0x1 << 10) // (USART) Stop Break +-#define AT91C_US_STTTO ((unsigned int) 0x1 << 11) // (USART) Start Time-out +-#define AT91C_US_SENDA ((unsigned int) 0x1 << 12) // (USART) Send Address +-#define AT91C_US_RSTIT ((unsigned int) 0x1 << 13) // (USART) Reset Iterations +-#define AT91C_US_RSTNACK ((unsigned int) 0x1 << 14) // (USART) Reset Non Acknowledge +-#define AT91C_US_RETTO ((unsigned int) 0x1 << 15) // (USART) Rearm Time-out +-#define AT91C_US_DTREN ((unsigned int) 0x1 << 16) // (USART) Data Terminal ready Enable +-#define AT91C_US_DTRDIS ((unsigned int) 0x1 << 17) // (USART) Data Terminal ready Disable +-#define AT91C_US_RTSEN ((unsigned int) 0x1 << 18) // (USART) Request to Send enable +-#define AT91C_US_RTSDIS ((unsigned int) 0x1 << 19) // (USART) Request to Send Disable +-// -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- +-#define AT91C_US_USMODE ((unsigned int) 0xF << 0) // (USART) Usart mode +-#define AT91C_US_USMODE_NORMAL ((unsigned int) 0x0) // (USART) Normal +-#define AT91C_US_USMODE_RS485 ((unsigned int) 0x1) // (USART) RS485 +-#define AT91C_US_USMODE_HWHSH ((unsigned int) 0x2) // (USART) Hardware Handshaking +-#define AT91C_US_USMODE_MODEM ((unsigned int) 0x3) // (USART) Modem +-#define AT91C_US_USMODE_ISO7816_0 ((unsigned int) 0x4) // (USART) ISO7816 protocol: T = 0 +-#define AT91C_US_USMODE_ISO7816_1 ((unsigned int) 0x6) // (USART) ISO7816 protocol: T = 1 +-#define AT91C_US_USMODE_IRDA ((unsigned int) 0x8) // (USART) IrDA +-#define AT91C_US_USMODE_SWHSH ((unsigned int) 0xC) // (USART) Software Handshaking +-#define AT91C_US_CLKS ((unsigned int) 0x3 << 4) // (USART) Clock Selection (Baud Rate generator Input Clock +-#define AT91C_US_CLKS_CLOCK ((unsigned int) 0x0 << 4) // (USART) Clock +-#define AT91C_US_CLKS_FDIV1 ((unsigned int) 0x1 << 4) // (USART) fdiv1 +-#define AT91C_US_CLKS_SLOW ((unsigned int) 0x2 << 4) // (USART) slow_clock (ARM) +-#define AT91C_US_CLKS_EXT ((unsigned int) 0x3 << 4) // (USART) External (SCK) +-#define AT91C_US_CHRL ((unsigned int) 0x3 << 6) // (USART) Clock Selection (Baud Rate generator Input Clock +-#define AT91C_US_CHRL_5_BITS ((unsigned int) 0x0 << 6) // (USART) Character Length: 5 bits +-#define AT91C_US_CHRL_6_BITS ((unsigned int) 0x1 << 6) // (USART) Character Length: 6 bits +-#define AT91C_US_CHRL_7_BITS ((unsigned int) 0x2 << 6) // (USART) Character Length: 7 bits +-#define AT91C_US_CHRL_8_BITS ((unsigned int) 0x3 << 6) // (USART) Character Length: 8 bits +-#define AT91C_US_SYNC ((unsigned int) 0x1 << 8) // (USART) Synchronous Mode Select +-#define AT91C_US_NBSTOP ((unsigned int) 0x3 << 12) // (USART) Number of Stop bits +-#define AT91C_US_NBSTOP_1_BIT ((unsigned int) 0x0 << 12) // (USART) 1 stop bit +-#define AT91C_US_NBSTOP_15_BIT ((unsigned int) 0x1 << 12) // (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits +-#define AT91C_US_NBSTOP_2_BIT ((unsigned int) 0x2 << 12) // (USART) 2 stop bits +-#define AT91C_US_MSBF ((unsigned int) 0x1 << 16) // (USART) Bit Order +-#define AT91C_US_MODE9 ((unsigned int) 0x1 << 17) // (USART) 9-bit Character length +-#define AT91C_US_CKLO ((unsigned int) 0x1 << 18) // (USART) Clock Output Select +-#define AT91C_US_OVER ((unsigned int) 0x1 << 19) // (USART) Over Sampling Mode +-#define AT91C_US_INACK ((unsigned int) 0x1 << 20) // (USART) Inhibit Non Acknowledge +-#define AT91C_US_DSNACK ((unsigned int) 0x1 << 21) // (USART) Disable Successive NACK +-#define AT91C_US_MAX_ITER ((unsigned int) 0x1 << 24) // (USART) Number of Repetitions +-#define AT91C_US_FILTER ((unsigned int) 0x1 << 28) // (USART) Receive Line Filter +-// -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-#define AT91C_US_RXBRK ((unsigned int) 0x1 << 2) // (USART) Break Received/End of Break +-#define AT91C_US_TIMEOUT ((unsigned int) 0x1 << 8) // (USART) Receiver Time-out +-#define AT91C_US_ITERATION ((unsigned int) 0x1 << 10) // (USART) Max number of Repetitions Reached +-#define AT91C_US_NACK ((unsigned int) 0x1 << 13) // (USART) Non Acknowledge +-#define AT91C_US_RIIC ((unsigned int) 0x1 << 16) // (USART) Ring INdicator Input Change Flag +-#define AT91C_US_DSRIC ((unsigned int) 0x1 << 17) // (USART) Data Set Ready Input Change Flag +-#define AT91C_US_DCDIC ((unsigned int) 0x1 << 18) // (USART) Data Carrier Flag +-#define AT91C_US_CTSIC ((unsigned int) 0x1 << 19) // (USART) Clear To Send Input Change Flag +-// -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-// -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-// -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- +-#define AT91C_US_RI ((unsigned int) 0x1 << 20) // (USART) Image of RI Input +-#define AT91C_US_DSR ((unsigned int) 0x1 << 21) // (USART) Image of DSR Input +-#define AT91C_US_DCD ((unsigned int) 0x1 << 22) // (USART) Image of DCD Input +-#define AT91C_US_CTS ((unsigned int) 0x1 << 23) // (USART) Image of CTS Input +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_SSC { +- AT91_REG SSC_CR; // Control Register +- AT91_REG SSC_CMR; // Clock Mode Register +- AT91_REG Reserved0[2]; // +- AT91_REG SSC_RCMR; // Receive Clock ModeRegister +- AT91_REG SSC_RFMR; // Receive Frame Mode Register +- AT91_REG SSC_TCMR; // Transmit Clock Mode Register +- AT91_REG SSC_TFMR; // Transmit Frame Mode Register +- AT91_REG SSC_RHR; // Receive Holding Register +- AT91_REG SSC_THR; // Transmit Holding Register +- AT91_REG Reserved1[2]; // +- AT91_REG SSC_RSHR; // Receive Sync Holding Register +- AT91_REG SSC_TSHR; // Transmit Sync Holding Register +- AT91_REG Reserved2[2]; // +- AT91_REG SSC_SR; // Status Register +- AT91_REG SSC_IER; // Interrupt Enable Register +- AT91_REG SSC_IDR; // Interrupt Disable Register +- AT91_REG SSC_IMR; // Interrupt Mask Register +- AT91_REG Reserved3[44]; // +- AT91_REG SSC_RPR; // Receive Pointer Register +- AT91_REG SSC_RCR; // Receive Counter Register +- AT91_REG SSC_TPR; // Transmit Pointer Register +- AT91_REG SSC_TCR; // Transmit Counter Register +- AT91_REG SSC_RNPR; // Receive Next Pointer Register +- AT91_REG SSC_RNCR; // Receive Next Counter Register +- AT91_REG SSC_TNPR; // Transmit Next Pointer Register +- AT91_REG SSC_TNCR; // Transmit Next Counter Register +- AT91_REG SSC_PTCR; // PDC Transfer Control Register +- AT91_REG SSC_PTSR; // PDC Transfer Status Register +-} AT91S_SSC, *AT91PS_SSC; +- +-// -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- +-#define AT91C_SSC_RXEN ((unsigned int) 0x1 << 0) // (SSC) Receive Enable +-#define AT91C_SSC_RXDIS ((unsigned int) 0x1 << 1) // (SSC) Receive Disable +-#define AT91C_SSC_TXEN ((unsigned int) 0x1 << 8) // (SSC) Transmit Enable +-#define AT91C_SSC_TXDIS ((unsigned int) 0x1 << 9) // (SSC) Transmit Disable +-#define AT91C_SSC_SWRST ((unsigned int) 0x1 << 15) // (SSC) Software Reset +-// -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- +-#define AT91C_SSC_CKS ((unsigned int) 0x3 << 0) // (SSC) Receive/Transmit Clock Selection +-#define AT91C_SSC_CKS_DIV ((unsigned int) 0x0) // (SSC) Divided Clock +-#define AT91C_SSC_CKS_TK ((unsigned int) 0x1) // (SSC) TK Clock signal +-#define AT91C_SSC_CKS_RK ((unsigned int) 0x2) // (SSC) RK pin +-#define AT91C_SSC_CKO ((unsigned int) 0x7 << 2) // (SSC) Receive/Transmit Clock Output Mode Selection +-#define AT91C_SSC_CKO_NONE ((unsigned int) 0x0 << 2) // (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only +-#define AT91C_SSC_CKO_CONTINOUS ((unsigned int) 0x1 << 2) // (SSC) Continuous Receive/Transmit Clock RK pin: Output +-#define AT91C_SSC_CKO_DATA_TX ((unsigned int) 0x2 << 2) // (SSC) Receive/Transmit Clock only during data transfers RK pin: Output +-#define AT91C_SSC_CKI ((unsigned int) 0x1 << 5) // (SSC) Receive/Transmit Clock Inversion +-#define AT91C_SSC_CKG ((unsigned int) 0x3 << 6) // (SSC) Receive/Transmit Clock Gating Selection +-#define AT91C_SSC_CKG_NONE ((unsigned int) 0x0 << 6) // (SSC) Receive/Transmit Clock Gating: None, continuous clock +-#define AT91C_SSC_CKG_LOW ((unsigned int) 0x1 << 6) // (SSC) Receive/Transmit Clock enabled only if RF Low +-#define AT91C_SSC_CKG_HIGH ((unsigned int) 0x2 << 6) // (SSC) Receive/Transmit Clock enabled only if RF High +-#define AT91C_SSC_START ((unsigned int) 0xF << 8) // (SSC) Receive/Transmit Start Selection +-#define AT91C_SSC_START_CONTINOUS ((unsigned int) 0x0 << 8) // (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. +-#define AT91C_SSC_START_TX ((unsigned int) 0x1 << 8) // (SSC) Transmit/Receive start +-#define AT91C_SSC_START_LOW_RF ((unsigned int) 0x2 << 8) // (SSC) Detection of a low level on RF input +-#define AT91C_SSC_START_HIGH_RF ((unsigned int) 0x3 << 8) // (SSC) Detection of a high level on RF input +-#define AT91C_SSC_START_FALL_RF ((unsigned int) 0x4 << 8) // (SSC) Detection of a falling edge on RF input +-#define AT91C_SSC_START_RISE_RF ((unsigned int) 0x5 << 8) // (SSC) Detection of a rising edge on RF input +-#define AT91C_SSC_START_LEVEL_RF ((unsigned int) 0x6 << 8) // (SSC) Detection of any level change on RF input +-#define AT91C_SSC_START_EDGE_RF ((unsigned int) 0x7 << 8) // (SSC) Detection of any edge on RF input +-#define AT91C_SSC_START_0 ((unsigned int) 0x8 << 8) // (SSC) Compare 0 +-#define AT91C_SSC_STOP ((unsigned int) 0x1 << 12) // (SSC) Receive Stop Selection +-#define AT91C_SSC_STTDLY ((unsigned int) 0xFF << 16) // (SSC) Receive/Transmit Start Delay +-#define AT91C_SSC_PERIOD ((unsigned int) 0xFF << 24) // (SSC) Receive/Transmit Period Divider Selection +-// -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- +-#define AT91C_SSC_DATLEN ((unsigned int) 0x1F << 0) // (SSC) Data Length +-#define AT91C_SSC_LOOP ((unsigned int) 0x1 << 5) // (SSC) Loop Mode +-#define AT91C_SSC_MSBF ((unsigned int) 0x1 << 7) // (SSC) Most Significant Bit First +-#define AT91C_SSC_DATNB ((unsigned int) 0xF << 8) // (SSC) Data Number per Frame +-#define AT91C_SSC_FSLEN ((unsigned int) 0xF << 16) // (SSC) Receive/Transmit Frame Sync length +-#define AT91C_SSC_FSOS ((unsigned int) 0x7 << 20) // (SSC) Receive/Transmit Frame Sync Output Selection +-#define AT91C_SSC_FSOS_NONE ((unsigned int) 0x0 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only +-#define AT91C_SSC_FSOS_NEGATIVE ((unsigned int) 0x1 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse +-#define AT91C_SSC_FSOS_POSITIVE ((unsigned int) 0x2 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse +-#define AT91C_SSC_FSOS_LOW ((unsigned int) 0x3 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer +-#define AT91C_SSC_FSOS_HIGH ((unsigned int) 0x4 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer +-#define AT91C_SSC_FSOS_TOGGLE ((unsigned int) 0x5 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer +-#define AT91C_SSC_FSEDGE ((unsigned int) 0x1 << 24) // (SSC) Frame Sync Edge Detection +-// -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- +-// -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- +-#define AT91C_SSC_DATDEF ((unsigned int) 0x1 << 5) // (SSC) Data Default Value +-#define AT91C_SSC_FSDEN ((unsigned int) 0x1 << 23) // (SSC) Frame Sync Data Enable +-// -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- +-#define AT91C_SSC_TXRDY ((unsigned int) 0x1 << 0) // (SSC) Transmit Ready +-#define AT91C_SSC_TXEMPTY ((unsigned int) 0x1 << 1) // (SSC) Transmit Empty +-#define AT91C_SSC_ENDTX ((unsigned int) 0x1 << 2) // (SSC) End Of Transmission +-#define AT91C_SSC_TXBUFE ((unsigned int) 0x1 << 3) // (SSC) Transmit Buffer Empty +-#define AT91C_SSC_RXRDY ((unsigned int) 0x1 << 4) // (SSC) Receive Ready +-#define AT91C_SSC_OVRUN ((unsigned int) 0x1 << 5) // (SSC) Receive Overrun +-#define AT91C_SSC_ENDRX ((unsigned int) 0x1 << 6) // (SSC) End of Reception +-#define AT91C_SSC_RXBUFF ((unsigned int) 0x1 << 7) // (SSC) Receive Buffer Full +-#define AT91C_SSC_CP0 ((unsigned int) 0x1 << 8) // (SSC) Compare 0 +-#define AT91C_SSC_CP1 ((unsigned int) 0x1 << 9) // (SSC) Compare 1 +-#define AT91C_SSC_TXSYN ((unsigned int) 0x1 << 10) // (SSC) Transmit Sync +-#define AT91C_SSC_RXSYN ((unsigned int) 0x1 << 11) // (SSC) Receive Sync +-#define AT91C_SSC_TXENA ((unsigned int) 0x1 << 16) // (SSC) Transmit Enable +-#define AT91C_SSC_RXENA ((unsigned int) 0x1 << 17) // (SSC) Receive Enable +-// -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- +-// -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- +-// -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Two-wire Interface +-// ***************************************************************************** +-typedef struct _AT91S_TWI { +- AT91_REG TWI_CR; // Control Register +- AT91_REG TWI_MMR; // Master Mode Register +- AT91_REG Reserved0[1]; // +- AT91_REG TWI_IADR; // Internal Address Register +- AT91_REG TWI_CWGR; // Clock Waveform Generator Register +- AT91_REG Reserved1[3]; // +- AT91_REG TWI_SR; // Status Register +- AT91_REG TWI_IER; // Interrupt Enable Register +- AT91_REG TWI_IDR; // Interrupt Disable Register +- AT91_REG TWI_IMR; // Interrupt Mask Register +- AT91_REG TWI_RHR; // Receive Holding Register +- AT91_REG TWI_THR; // Transmit Holding Register +-} AT91S_TWI, *AT91PS_TWI; +- +-// -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- +-#define AT91C_TWI_START ((unsigned int) 0x1 << 0) // (TWI) Send a START Condition +-#define AT91C_TWI_STOP ((unsigned int) 0x1 << 1) // (TWI) Send a STOP Condition +-#define AT91C_TWI_MSEN ((unsigned int) 0x1 << 2) // (TWI) TWI Master Transfer Enabled +-#define AT91C_TWI_MSDIS ((unsigned int) 0x1 << 3) // (TWI) TWI Master Transfer Disabled +-#define AT91C_TWI_SWRST ((unsigned int) 0x1 << 7) // (TWI) Software Reset +-// -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- +-#define AT91C_TWI_IADRSZ ((unsigned int) 0x3 << 8) // (TWI) Internal Device Address Size +-#define AT91C_TWI_IADRSZ_NO ((unsigned int) 0x0 << 8) // (TWI) No internal device address +-#define AT91C_TWI_IADRSZ_1_BYTE ((unsigned int) 0x1 << 8) // (TWI) One-byte internal device address +-#define AT91C_TWI_IADRSZ_2_BYTE ((unsigned int) 0x2 << 8) // (TWI) Two-byte internal device address +-#define AT91C_TWI_IADRSZ_3_BYTE ((unsigned int) 0x3 << 8) // (TWI) Three-byte internal device address +-#define AT91C_TWI_MREAD ((unsigned int) 0x1 << 12) // (TWI) Master Read Direction +-#define AT91C_TWI_DADR ((unsigned int) 0x7F << 16) // (TWI) Device Address +-// -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- +-#define AT91C_TWI_CLDIV ((unsigned int) 0xFF << 0) // (TWI) Clock Low Divider +-#define AT91C_TWI_CHDIV ((unsigned int) 0xFF << 8) // (TWI) Clock High Divider +-#define AT91C_TWI_CKDIV ((unsigned int) 0x7 << 16) // (TWI) Clock Divider +-// -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- +-#define AT91C_TWI_TXCOMP ((unsigned int) 0x1 << 0) // (TWI) Transmission Completed +-#define AT91C_TWI_RXRDY ((unsigned int) 0x1 << 1) // (TWI) Receive holding register ReaDY +-#define AT91C_TWI_TXRDY ((unsigned int) 0x1 << 2) // (TWI) Transmit holding register ReaDY +-#define AT91C_TWI_OVRE ((unsigned int) 0x1 << 6) // (TWI) Overrun Error +-#define AT91C_TWI_UNRE ((unsigned int) 0x1 << 7) // (TWI) Underrun Error +-#define AT91C_TWI_NACK ((unsigned int) 0x1 << 8) // (TWI) Not Acknowledged +-// -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- +-// -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- +-// -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR PWMC Channel Interface +-// ***************************************************************************** +-typedef struct _AT91S_PWMC_CH { +- AT91_REG PWMC_CMR; // Channel Mode Register +- AT91_REG PWMC_CDTYR; // Channel Duty Cycle Register +- AT91_REG PWMC_CPRDR; // Channel Period Register +- AT91_REG PWMC_CCNTR; // Channel Counter Register +- AT91_REG PWMC_CUPDR; // Channel Update Register +- AT91_REG PWMC_Reserved[3]; // Reserved +-} AT91S_PWMC_CH, *AT91PS_PWMC_CH; +- +-// -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- +-#define AT91C_PWMC_CPRE ((unsigned int) 0xF << 0) // (PWMC_CH) Channel Pre-scaler : PWMC_CLKx +-#define AT91C_PWMC_CPRE_MCK ((unsigned int) 0x0) // (PWMC_CH) +-#define AT91C_PWMC_CPRE_MCKA ((unsigned int) 0xB) // (PWMC_CH) +-#define AT91C_PWMC_CPRE_MCKB ((unsigned int) 0xC) // (PWMC_CH) +-#define AT91C_PWMC_CALG ((unsigned int) 0x1 << 8) // (PWMC_CH) Channel Alignment +-#define AT91C_PWMC_CPOL ((unsigned int) 0x1 << 9) // (PWMC_CH) Channel Polarity +-#define AT91C_PWMC_CPD ((unsigned int) 0x1 << 10) // (PWMC_CH) Channel Update Period +-// -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- +-#define AT91C_PWMC_CDTY ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Duty Cycle +-// -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- +-#define AT91C_PWMC_CPRD ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Period +-// -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- +-#define AT91C_PWMC_CCNT ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Counter +-// -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- +-#define AT91C_PWMC_CUPD ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Update +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_PWMC { +- AT91_REG PWMC_MR; // PWMC Mode Register +- AT91_REG PWMC_ENA; // PWMC Enable Register +- AT91_REG PWMC_DIS; // PWMC Disable Register +- AT91_REG PWMC_SR; // PWMC Status Register +- AT91_REG PWMC_IER; // PWMC Interrupt Enable Register +- AT91_REG PWMC_IDR; // PWMC Interrupt Disable Register +- AT91_REG PWMC_IMR; // PWMC Interrupt Mask Register +- AT91_REG PWMC_ISR; // PWMC Interrupt Status Register +- AT91_REG Reserved0[55]; // +- AT91_REG PWMC_VR; // PWMC Version Register +- AT91_REG Reserved1[64]; // +- AT91S_PWMC_CH PWMC_CH[4]; // PWMC Channel +-} AT91S_PWMC, *AT91PS_PWMC; +- +-// -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- +-#define AT91C_PWMC_DIVA ((unsigned int) 0xFF << 0) // (PWMC) CLKA divide factor. +-#define AT91C_PWMC_PREA ((unsigned int) 0xF << 8) // (PWMC) Divider Input Clock Prescaler A +-#define AT91C_PWMC_PREA_MCK ((unsigned int) 0x0 << 8) // (PWMC) +-#define AT91C_PWMC_DIVB ((unsigned int) 0xFF << 16) // (PWMC) CLKB divide factor. +-#define AT91C_PWMC_PREB ((unsigned int) 0xF << 24) // (PWMC) Divider Input Clock Prescaler B +-#define AT91C_PWMC_PREB_MCK ((unsigned int) 0x0 << 24) // (PWMC) +-// -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- +-#define AT91C_PWMC_CHID0 ((unsigned int) 0x1 << 0) // (PWMC) Channel ID 0 +-#define AT91C_PWMC_CHID1 ((unsigned int) 0x1 << 1) // (PWMC) Channel ID 1 +-#define AT91C_PWMC_CHID2 ((unsigned int) 0x1 << 2) // (PWMC) Channel ID 2 +-#define AT91C_PWMC_CHID3 ((unsigned int) 0x1 << 3) // (PWMC) Channel ID 3 +-// -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- +-// -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- +-// -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- +-// -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- +-// -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- +-// -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR USB Device Interface +-// ***************************************************************************** +-typedef struct _AT91S_UDP { +- AT91_REG UDP_NUM; // Frame Number Register +- AT91_REG UDP_GLBSTATE; // Global State Register +- AT91_REG UDP_FADDR; // Function Address Register +- AT91_REG Reserved0[1]; // +- AT91_REG UDP_IER; // Interrupt Enable Register +- AT91_REG UDP_IDR; // Interrupt Disable Register +- AT91_REG UDP_IMR; // Interrupt Mask Register +- AT91_REG UDP_ISR; // Interrupt Status Register +- AT91_REG UDP_ICR; // Interrupt Clear Register +- AT91_REG Reserved1[1]; // +- AT91_REG UDP_RSTEP; // Reset Endpoint Register +- AT91_REG Reserved2[1]; // +- AT91_REG UDP_CSR[6]; // Endpoint Control and Status Register +- AT91_REG Reserved3[2]; // +- AT91_REG UDP_FDR[6]; // Endpoint FIFO Data Register +- AT91_REG Reserved4[3]; // +- AT91_REG UDP_TXVC; // Transceiver Control Register +-} AT91S_UDP, *AT91PS_UDP; +- +-// -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- +-#define AT91C_UDP_FRM_NUM ((unsigned int) 0x7FF << 0) // (UDP) Frame Number as Defined in the Packet Field Formats +-#define AT91C_UDP_FRM_ERR ((unsigned int) 0x1 << 16) // (UDP) Frame Error +-#define AT91C_UDP_FRM_OK ((unsigned int) 0x1 << 17) // (UDP) Frame OK +-// -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- +-#define AT91C_UDP_FADDEN ((unsigned int) 0x1 << 0) // (UDP) Function Address Enable +-#define AT91C_UDP_CONFG ((unsigned int) 0x1 << 1) // (UDP) Configured +-#define AT91C_UDP_ESR ((unsigned int) 0x1 << 2) // (UDP) Enable Send Resume +-#define AT91C_UDP_RSMINPR ((unsigned int) 0x1 << 3) // (UDP) A Resume Has Been Sent to the Host +-#define AT91C_UDP_RMWUPE ((unsigned int) 0x1 << 4) // (UDP) Remote Wake Up Enable +-// -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- +-#define AT91C_UDP_FADD ((unsigned int) 0xFF << 0) // (UDP) Function Address Value +-#define AT91C_UDP_FEN ((unsigned int) 0x1 << 8) // (UDP) Function Enable +-// -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- +-#define AT91C_UDP_EPINT0 ((unsigned int) 0x1 << 0) // (UDP) Endpoint 0 Interrupt +-#define AT91C_UDP_EPINT1 ((unsigned int) 0x1 << 1) // (UDP) Endpoint 0 Interrupt +-#define AT91C_UDP_EPINT2 ((unsigned int) 0x1 << 2) // (UDP) Endpoint 2 Interrupt +-#define AT91C_UDP_EPINT3 ((unsigned int) 0x1 << 3) // (UDP) Endpoint 3 Interrupt +-#define AT91C_UDP_EPINT4 ((unsigned int) 0x1 << 4) // (UDP) Endpoint 4 Interrupt +-#define AT91C_UDP_EPINT5 ((unsigned int) 0x1 << 5) // (UDP) Endpoint 5 Interrupt +-#define AT91C_UDP_RXSUSP ((unsigned int) 0x1 << 8) // (UDP) USB Suspend Interrupt +-#define AT91C_UDP_RXRSM ((unsigned int) 0x1 << 9) // (UDP) USB Resume Interrupt +-#define AT91C_UDP_EXTRSM ((unsigned int) 0x1 << 10) // (UDP) USB External Resume Interrupt +-#define AT91C_UDP_SOFINT ((unsigned int) 0x1 << 11) // (UDP) USB Start Of frame Interrupt +-#define AT91C_UDP_WAKEUP ((unsigned int) 0x1 << 13) // (UDP) USB Resume Interrupt +-// -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- +-// -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- +-// -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- +-#define AT91C_UDP_ENDBUSRES ((unsigned int) 0x1 << 12) // (UDP) USB End Of Bus Reset Interrupt +-// -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- +-// -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- +-#define AT91C_UDP_EP0 ((unsigned int) 0x1 << 0) // (UDP) Reset Endpoint 0 +-#define AT91C_UDP_EP1 ((unsigned int) 0x1 << 1) // (UDP) Reset Endpoint 1 +-#define AT91C_UDP_EP2 ((unsigned int) 0x1 << 2) // (UDP) Reset Endpoint 2 +-#define AT91C_UDP_EP3 ((unsigned int) 0x1 << 3) // (UDP) Reset Endpoint 3 +-#define AT91C_UDP_EP4 ((unsigned int) 0x1 << 4) // (UDP) Reset Endpoint 4 +-#define AT91C_UDP_EP5 ((unsigned int) 0x1 << 5) // (UDP) Reset Endpoint 5 +-// -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- +-#define AT91C_UDP_TXCOMP ((unsigned int) 0x1 << 0) // (UDP) Generates an IN packet with data previously written in the DPR +-#define AT91C_UDP_RX_DATA_BK0 ((unsigned int) 0x1 << 1) // (UDP) Receive Data Bank 0 +-#define AT91C_UDP_RXSETUP ((unsigned int) 0x1 << 2) // (UDP) Sends STALL to the Host (Control endpoints) +-#define AT91C_UDP_ISOERROR ((unsigned int) 0x1 << 3) // (UDP) Isochronous error (Isochronous endpoints) +-#define AT91C_UDP_TXPKTRDY ((unsigned int) 0x1 << 4) // (UDP) Transmit Packet Ready +-#define AT91C_UDP_FORCESTALL ((unsigned int) 0x1 << 5) // (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). +-#define AT91C_UDP_RX_DATA_BK1 ((unsigned int) 0x1 << 6) // (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). +-#define AT91C_UDP_DIR ((unsigned int) 0x1 << 7) // (UDP) Transfer Direction +-#define AT91C_UDP_EPTYPE ((unsigned int) 0x7 << 8) // (UDP) Endpoint type +-#define AT91C_UDP_EPTYPE_CTRL ((unsigned int) 0x0 << 8) // (UDP) Control +-#define AT91C_UDP_EPTYPE_ISO_OUT ((unsigned int) 0x1 << 8) // (UDP) Isochronous OUT +-#define AT91C_UDP_EPTYPE_BULK_OUT ((unsigned int) 0x2 << 8) // (UDP) Bulk OUT +-#define AT91C_UDP_EPTYPE_INT_OUT ((unsigned int) 0x3 << 8) // (UDP) Interrupt OUT +-#define AT91C_UDP_EPTYPE_ISO_IN ((unsigned int) 0x5 << 8) // (UDP) Isochronous IN +-#define AT91C_UDP_EPTYPE_BULK_IN ((unsigned int) 0x6 << 8) // (UDP) Bulk IN +-#define AT91C_UDP_EPTYPE_INT_IN ((unsigned int) 0x7 << 8) // (UDP) Interrupt IN +-#define AT91C_UDP_DTGLE ((unsigned int) 0x1 << 11) // (UDP) Data Toggle +-#define AT91C_UDP_EPEDS ((unsigned int) 0x1 << 15) // (UDP) Endpoint Enable Disable +-#define AT91C_UDP_RXBYTECNT ((unsigned int) 0x7FF << 16) // (UDP) Number Of Bytes Available in the FIFO +-// -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- +-#define AT91C_UDP_TXVDIS ((unsigned int) 0x1 << 8) // (UDP) +-#define AT91C_UDP_PUON ((unsigned int) 0x1 << 9) // (UDP) Pull-up ON +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Timer Counter Channel Interface +-// ***************************************************************************** +-typedef struct _AT91S_TC { +- AT91_REG TC_CCR; // Channel Control Register +- AT91_REG TC_CMR; // Channel Mode Register (Capture Mode / Waveform Mode) +- AT91_REG Reserved0[2]; // +- AT91_REG TC_CV; // Counter Value +- AT91_REG TC_RA; // Register A +- AT91_REG TC_RB; // Register B +- AT91_REG TC_RC; // Register C +- AT91_REG TC_SR; // Status Register +- AT91_REG TC_IER; // Interrupt Enable Register +- AT91_REG TC_IDR; // Interrupt Disable Register +- AT91_REG TC_IMR; // Interrupt Mask Register +-} AT91S_TC, *AT91PS_TC; +- +-// -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- +-#define AT91C_TC_CLKEN ((unsigned int) 0x1 << 0) // (TC) Counter Clock Enable Command +-#define AT91C_TC_CLKDIS ((unsigned int) 0x1 << 1) // (TC) Counter Clock Disable Command +-#define AT91C_TC_SWTRG ((unsigned int) 0x1 << 2) // (TC) Software Trigger Command +-// -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- +-#define AT91C_TC_CLKS ((unsigned int) 0x7 << 0) // (TC) Clock Selection +-#define AT91C_TC_CLKS_TIMER_DIV1_CLOCK ((unsigned int) 0x0) // (TC) Clock selected: TIMER_DIV1_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV2_CLOCK ((unsigned int) 0x1) // (TC) Clock selected: TIMER_DIV2_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV3_CLOCK ((unsigned int) 0x2) // (TC) Clock selected: TIMER_DIV3_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV4_CLOCK ((unsigned int) 0x3) // (TC) Clock selected: TIMER_DIV4_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV5_CLOCK ((unsigned int) 0x4) // (TC) Clock selected: TIMER_DIV5_CLOCK +-#define AT91C_TC_CLKS_XC0 ((unsigned int) 0x5) // (TC) Clock selected: XC0 +-#define AT91C_TC_CLKS_XC1 ((unsigned int) 0x6) // (TC) Clock selected: XC1 +-#define AT91C_TC_CLKS_XC2 ((unsigned int) 0x7) // (TC) Clock selected: XC2 +-#define AT91C_TC_CLKI ((unsigned int) 0x1 << 3) // (TC) Clock Invert +-#define AT91C_TC_BURST ((unsigned int) 0x3 << 4) // (TC) Burst Signal Selection +-#define AT91C_TC_BURST_NONE ((unsigned int) 0x0 << 4) // (TC) The clock is not gated by an external signal +-#define AT91C_TC_BURST_XC0 ((unsigned int) 0x1 << 4) // (TC) XC0 is ANDed with the selected clock +-#define AT91C_TC_BURST_XC1 ((unsigned int) 0x2 << 4) // (TC) XC1 is ANDed with the selected clock +-#define AT91C_TC_BURST_XC2 ((unsigned int) 0x3 << 4) // (TC) XC2 is ANDed with the selected clock +-#define AT91C_TC_CPCSTOP ((unsigned int) 0x1 << 6) // (TC) Counter Clock Stopped with RC Compare +-#define AT91C_TC_LDBSTOP ((unsigned int) 0x1 << 6) // (TC) Counter Clock Stopped with RB Loading +-#define AT91C_TC_LDBDIS ((unsigned int) 0x1 << 7) // (TC) Counter Clock Disabled with RB Loading +-#define AT91C_TC_CPCDIS ((unsigned int) 0x1 << 7) // (TC) Counter Clock Disable with RC Compare +-#define AT91C_TC_ETRGEDG ((unsigned int) 0x3 << 8) // (TC) External Trigger Edge Selection +-#define AT91C_TC_ETRGEDG_NONE ((unsigned int) 0x0 << 8) // (TC) Edge: None +-#define AT91C_TC_ETRGEDG_RISING ((unsigned int) 0x1 << 8) // (TC) Edge: rising edge +-#define AT91C_TC_ETRGEDG_FALLING ((unsigned int) 0x2 << 8) // (TC) Edge: falling edge +-#define AT91C_TC_ETRGEDG_BOTH ((unsigned int) 0x3 << 8) // (TC) Edge: each edge +-#define AT91C_TC_EEVTEDG ((unsigned int) 0x3 << 8) // (TC) External Event Edge Selection +-#define AT91C_TC_EEVTEDG_NONE ((unsigned int) 0x0 << 8) // (TC) Edge: None +-#define AT91C_TC_EEVTEDG_RISING ((unsigned int) 0x1 << 8) // (TC) Edge: rising edge +-#define AT91C_TC_EEVTEDG_FALLING ((unsigned int) 0x2 << 8) // (TC) Edge: falling edge +-#define AT91C_TC_EEVTEDG_BOTH ((unsigned int) 0x3 << 8) // (TC) Edge: each edge +-#define AT91C_TC_ABETRG ((unsigned int) 0x1 << 10) // (TC) TIOA or TIOB External Trigger Selection +-#define AT91C_TC_EEVT ((unsigned int) 0x3 << 10) // (TC) External Event Selection +-#define AT91C_TC_EEVT_TIOB ((unsigned int) 0x0 << 10) // (TC) Signal selected as external event: TIOB TIOB direction: input +-#define AT91C_TC_EEVT_XC0 ((unsigned int) 0x1 << 10) // (TC) Signal selected as external event: XC0 TIOB direction: output +-#define AT91C_TC_EEVT_XC1 ((unsigned int) 0x2 << 10) // (TC) Signal selected as external event: XC1 TIOB direction: output +-#define AT91C_TC_EEVT_XC2 ((unsigned int) 0x3 << 10) // (TC) Signal selected as external event: XC2 TIOB direction: output +-#define AT91C_TC_ENETRG ((unsigned int) 0x1 << 12) // (TC) External Event Trigger enable +-#define AT91C_TC_WAVESEL ((unsigned int) 0x3 << 13) // (TC) Waveform Selection +-#define AT91C_TC_WAVESEL_UP ((unsigned int) 0x0 << 13) // (TC) UP mode without atomatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UPDOWN ((unsigned int) 0x1 << 13) // (TC) UPDOWN mode without automatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UP_AUTO ((unsigned int) 0x2 << 13) // (TC) UP mode with automatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UPDOWN_AUTO ((unsigned int) 0x3 << 13) // (TC) UPDOWN mode with automatic trigger on RC Compare +-#define AT91C_TC_CPCTRG ((unsigned int) 0x1 << 14) // (TC) RC Compare Trigger Enable +-#define AT91C_TC_WAVE ((unsigned int) 0x1 << 15) // (TC) +-#define AT91C_TC_LDRA ((unsigned int) 0x3 << 16) // (TC) RA Loading Selection +-#define AT91C_TC_LDRA_NONE ((unsigned int) 0x0 << 16) // (TC) Edge: None +-#define AT91C_TC_LDRA_RISING ((unsigned int) 0x1 << 16) // (TC) Edge: rising edge of TIOA +-#define AT91C_TC_LDRA_FALLING ((unsigned int) 0x2 << 16) // (TC) Edge: falling edge of TIOA +-#define AT91C_TC_LDRA_BOTH ((unsigned int) 0x3 << 16) // (TC) Edge: each edge of TIOA +-#define AT91C_TC_ACPA ((unsigned int) 0x3 << 16) // (TC) RA Compare Effect on TIOA +-#define AT91C_TC_ACPA_NONE ((unsigned int) 0x0 << 16) // (TC) Effect: none +-#define AT91C_TC_ACPA_SET ((unsigned int) 0x1 << 16) // (TC) Effect: set +-#define AT91C_TC_ACPA_CLEAR ((unsigned int) 0x2 << 16) // (TC) Effect: clear +-#define AT91C_TC_ACPA_TOGGLE ((unsigned int) 0x3 << 16) // (TC) Effect: toggle +-#define AT91C_TC_LDRB ((unsigned int) 0x3 << 18) // (TC) RB Loading Selection +-#define AT91C_TC_LDRB_NONE ((unsigned int) 0x0 << 18) // (TC) Edge: None +-#define AT91C_TC_LDRB_RISING ((unsigned int) 0x1 << 18) // (TC) Edge: rising edge of TIOA +-#define AT91C_TC_LDRB_FALLING ((unsigned int) 0x2 << 18) // (TC) Edge: falling edge of TIOA +-#define AT91C_TC_LDRB_BOTH ((unsigned int) 0x3 << 18) // (TC) Edge: each edge of TIOA +-#define AT91C_TC_ACPC ((unsigned int) 0x3 << 18) // (TC) RC Compare Effect on TIOA +-#define AT91C_TC_ACPC_NONE ((unsigned int) 0x0 << 18) // (TC) Effect: none +-#define AT91C_TC_ACPC_SET ((unsigned int) 0x1 << 18) // (TC) Effect: set +-#define AT91C_TC_ACPC_CLEAR ((unsigned int) 0x2 << 18) // (TC) Effect: clear +-#define AT91C_TC_ACPC_TOGGLE ((unsigned int) 0x3 << 18) // (TC) Effect: toggle +-#define AT91C_TC_AEEVT ((unsigned int) 0x3 << 20) // (TC) External Event Effect on TIOA +-#define AT91C_TC_AEEVT_NONE ((unsigned int) 0x0 << 20) // (TC) Effect: none +-#define AT91C_TC_AEEVT_SET ((unsigned int) 0x1 << 20) // (TC) Effect: set +-#define AT91C_TC_AEEVT_CLEAR ((unsigned int) 0x2 << 20) // (TC) Effect: clear +-#define AT91C_TC_AEEVT_TOGGLE ((unsigned int) 0x3 << 20) // (TC) Effect: toggle +-#define AT91C_TC_ASWTRG ((unsigned int) 0x3 << 22) // (TC) Software Trigger Effect on TIOA +-#define AT91C_TC_ASWTRG_NONE ((unsigned int) 0x0 << 22) // (TC) Effect: none +-#define AT91C_TC_ASWTRG_SET ((unsigned int) 0x1 << 22) // (TC) Effect: set +-#define AT91C_TC_ASWTRG_CLEAR ((unsigned int) 0x2 << 22) // (TC) Effect: clear +-#define AT91C_TC_ASWTRG_TOGGLE ((unsigned int) 0x3 << 22) // (TC) Effect: toggle +-#define AT91C_TC_BCPB ((unsigned int) 0x3 << 24) // (TC) RB Compare Effect on TIOB +-#define AT91C_TC_BCPB_NONE ((unsigned int) 0x0 << 24) // (TC) Effect: none +-#define AT91C_TC_BCPB_SET ((unsigned int) 0x1 << 24) // (TC) Effect: set +-#define AT91C_TC_BCPB_CLEAR ((unsigned int) 0x2 << 24) // (TC) Effect: clear +-#define AT91C_TC_BCPB_TOGGLE ((unsigned int) 0x3 << 24) // (TC) Effect: toggle +-#define AT91C_TC_BCPC ((unsigned int) 0x3 << 26) // (TC) RC Compare Effect on TIOB +-#define AT91C_TC_BCPC_NONE ((unsigned int) 0x0 << 26) // (TC) Effect: none +-#define AT91C_TC_BCPC_SET ((unsigned int) 0x1 << 26) // (TC) Effect: set +-#define AT91C_TC_BCPC_CLEAR ((unsigned int) 0x2 << 26) // (TC) Effect: clear +-#define AT91C_TC_BCPC_TOGGLE ((unsigned int) 0x3 << 26) // (TC) Effect: toggle +-#define AT91C_TC_BEEVT ((unsigned int) 0x3 << 28) // (TC) External Event Effect on TIOB +-#define AT91C_TC_BEEVT_NONE ((unsigned int) 0x0 << 28) // (TC) Effect: none +-#define AT91C_TC_BEEVT_SET ((unsigned int) 0x1 << 28) // (TC) Effect: set +-#define AT91C_TC_BEEVT_CLEAR ((unsigned int) 0x2 << 28) // (TC) Effect: clear +-#define AT91C_TC_BEEVT_TOGGLE ((unsigned int) 0x3 << 28) // (TC) Effect: toggle +-#define AT91C_TC_BSWTRG ((unsigned int) 0x3 << 30) // (TC) Software Trigger Effect on TIOB +-#define AT91C_TC_BSWTRG_NONE ((unsigned int) 0x0 << 30) // (TC) Effect: none +-#define AT91C_TC_BSWTRG_SET ((unsigned int) 0x1 << 30) // (TC) Effect: set +-#define AT91C_TC_BSWTRG_CLEAR ((unsigned int) 0x2 << 30) // (TC) Effect: clear +-#define AT91C_TC_BSWTRG_TOGGLE ((unsigned int) 0x3 << 30) // (TC) Effect: toggle +-// -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- +-#define AT91C_TC_COVFS ((unsigned int) 0x1 << 0) // (TC) Counter Overflow +-#define AT91C_TC_LOVRS ((unsigned int) 0x1 << 1) // (TC) Load Overrun +-#define AT91C_TC_CPAS ((unsigned int) 0x1 << 2) // (TC) RA Compare +-#define AT91C_TC_CPBS ((unsigned int) 0x1 << 3) // (TC) RB Compare +-#define AT91C_TC_CPCS ((unsigned int) 0x1 << 4) // (TC) RC Compare +-#define AT91C_TC_LDRAS ((unsigned int) 0x1 << 5) // (TC) RA Loading +-#define AT91C_TC_LDRBS ((unsigned int) 0x1 << 6) // (TC) RB Loading +-#define AT91C_TC_ETRGS ((unsigned int) 0x1 << 7) // (TC) External Trigger +-#define AT91C_TC_CLKSTA ((unsigned int) 0x1 << 16) // (TC) Clock Enabling +-#define AT91C_TC_MTIOA ((unsigned int) 0x1 << 17) // (TC) TIOA Mirror +-#define AT91C_TC_MTIOB ((unsigned int) 0x1 << 18) // (TC) TIOA Mirror +-// -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- +-// -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- +-// -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Timer Counter Interface +-// ***************************************************************************** +-typedef struct _AT91S_TCB { +- AT91S_TC TCB_TC0; // TC Channel 0 +- AT91_REG Reserved0[4]; // +- AT91S_TC TCB_TC1; // TC Channel 1 +- AT91_REG Reserved1[4]; // +- AT91S_TC TCB_TC2; // TC Channel 2 +- AT91_REG Reserved2[4]; // +- AT91_REG TCB_BCR; // TC Block Control Register +- AT91_REG TCB_BMR; // TC Block Mode Register +-} AT91S_TCB, *AT91PS_TCB; +- +-// -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- +-#define AT91C_TCB_SYNC ((unsigned int) 0x1 << 0) // (TCB) Synchro Command +-// -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- +-#define AT91C_TCB_TC0XC0S ((unsigned int) 0x3 << 0) // (TCB) External Clock Signal 0 Selection +-#define AT91C_TCB_TC0XC0S_TCLK0 ((unsigned int) 0x0) // (TCB) TCLK0 connected to XC0 +-#define AT91C_TCB_TC0XC0S_NONE ((unsigned int) 0x1) // (TCB) None signal connected to XC0 +-#define AT91C_TCB_TC0XC0S_TIOA1 ((unsigned int) 0x2) // (TCB) TIOA1 connected to XC0 +-#define AT91C_TCB_TC0XC0S_TIOA2 ((unsigned int) 0x3) // (TCB) TIOA2 connected to XC0 +-#define AT91C_TCB_TC1XC1S ((unsigned int) 0x3 << 2) // (TCB) External Clock Signal 1 Selection +-#define AT91C_TCB_TC1XC1S_TCLK1 ((unsigned int) 0x0 << 2) // (TCB) TCLK1 connected to XC1 +-#define AT91C_TCB_TC1XC1S_NONE ((unsigned int) 0x1 << 2) // (TCB) None signal connected to XC1 +-#define AT91C_TCB_TC1XC1S_TIOA0 ((unsigned int) 0x2 << 2) // (TCB) TIOA0 connected to XC1 +-#define AT91C_TCB_TC1XC1S_TIOA2 ((unsigned int) 0x3 << 2) // (TCB) TIOA2 connected to XC1 +-#define AT91C_TCB_TC2XC2S ((unsigned int) 0x3 << 4) // (TCB) External Clock Signal 2 Selection +-#define AT91C_TCB_TC2XC2S_TCLK2 ((unsigned int) 0x0 << 4) // (TCB) TCLK2 connected to XC2 +-#define AT91C_TCB_TC2XC2S_NONE ((unsigned int) 0x1 << 4) // (TCB) None signal connected to XC2 +-#define AT91C_TCB_TC2XC2S_TIOA0 ((unsigned int) 0x2 << 4) // (TCB) TIOA0 connected to XC2 +-#define AT91C_TCB_TC2XC2S_TIOA1 ((unsigned int) 0x3 << 4) // (TCB) TIOA2 connected to XC2 +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface +-// ***************************************************************************** +-typedef struct _AT91S_CAN_MB { +- AT91_REG CAN_MB_MMR; // MailBox Mode Register +- AT91_REG CAN_MB_MAM; // MailBox Acceptance Mask Register +- AT91_REG CAN_MB_MID; // MailBox ID Register +- AT91_REG CAN_MB_MFID; // MailBox Family ID Register +- AT91_REG CAN_MB_MSR; // MailBox Status Register +- AT91_REG CAN_MB_MDL; // MailBox Data Low Register +- AT91_REG CAN_MB_MDH; // MailBox Data High Register +- AT91_REG CAN_MB_MCR; // MailBox Control Register +-} AT91S_CAN_MB, *AT91PS_CAN_MB; +- +-// -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- +-#define AT91C_CAN_MTIMEMARK ((unsigned int) 0xFFFF << 0) // (CAN_MB) Mailbox Timemark +-#define AT91C_CAN_PRIOR ((unsigned int) 0xF << 16) // (CAN_MB) Mailbox Priority +-#define AT91C_CAN_MOT ((unsigned int) 0x7 << 24) // (CAN_MB) Mailbox Object Type +-#define AT91C_CAN_MOT_DIS ((unsigned int) 0x0 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_RX ((unsigned int) 0x1 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_RXOVERWRITE ((unsigned int) 0x2 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_TX ((unsigned int) 0x3 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_CONSUMER ((unsigned int) 0x4 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_PRODUCER ((unsigned int) 0x5 << 24) // (CAN_MB) +-// -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- +-#define AT91C_CAN_MIDvB ((unsigned int) 0x3FFFF << 0) // (CAN_MB) Complementary bits for identifier in extended mode +-#define AT91C_CAN_MIDvA ((unsigned int) 0x7FF << 18) // (CAN_MB) Identifier for standard frame mode +-#define AT91C_CAN_MIDE ((unsigned int) 0x1 << 29) // (CAN_MB) Identifier Version +-// -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- +-// -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- +-// -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- +-#define AT91C_CAN_MTIMESTAMP ((unsigned int) 0xFFFF << 0) // (CAN_MB) Timer Value +-#define AT91C_CAN_MDLC ((unsigned int) 0xF << 16) // (CAN_MB) Mailbox Data Length Code +-#define AT91C_CAN_MRTR ((unsigned int) 0x1 << 20) // (CAN_MB) Mailbox Remote Transmission Request +-#define AT91C_CAN_MABT ((unsigned int) 0x1 << 22) // (CAN_MB) Mailbox Message Abort +-#define AT91C_CAN_MRDY ((unsigned int) 0x1 << 23) // (CAN_MB) Mailbox Ready +-#define AT91C_CAN_MMI ((unsigned int) 0x1 << 24) // (CAN_MB) Mailbox Message Ignored +-// -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- +-// -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- +-// -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- +-#define AT91C_CAN_MACR ((unsigned int) 0x1 << 22) // (CAN_MB) Abort Request for Mailbox +-#define AT91C_CAN_MTCR ((unsigned int) 0x1 << 23) // (CAN_MB) Mailbox Transfer Command +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Control Area Network Interface +-// ***************************************************************************** +-typedef struct _AT91S_CAN { +- AT91_REG CAN_MR; // Mode Register +- AT91_REG CAN_IER; // Interrupt Enable Register +- AT91_REG CAN_IDR; // Interrupt Disable Register +- AT91_REG CAN_IMR; // Interrupt Mask Register +- AT91_REG CAN_SR; // Status Register +- AT91_REG CAN_BR; // Baudrate Register +- AT91_REG CAN_TIM; // Timer Register +- AT91_REG CAN_TIMESTP; // Time Stamp Register +- AT91_REG CAN_ECR; // Error Counter Register +- AT91_REG CAN_TCR; // Transfer Command Register +- AT91_REG CAN_ACR; // Abort Command Register +- AT91_REG Reserved0[52]; // +- AT91_REG CAN_VR; // Version Register +- AT91_REG Reserved1[64]; // +- AT91S_CAN_MB CAN_MB0; // CAN Mailbox 0 +- AT91S_CAN_MB CAN_MB1; // CAN Mailbox 1 +- AT91S_CAN_MB CAN_MB2; // CAN Mailbox 2 +- AT91S_CAN_MB CAN_MB3; // CAN Mailbox 3 +- AT91S_CAN_MB CAN_MB4; // CAN Mailbox 4 +- AT91S_CAN_MB CAN_MB5; // CAN Mailbox 5 +- AT91S_CAN_MB CAN_MB6; // CAN Mailbox 6 +- AT91S_CAN_MB CAN_MB7; // CAN Mailbox 7 +- AT91S_CAN_MB CAN_MB8; // CAN Mailbox 8 +- AT91S_CAN_MB CAN_MB9; // CAN Mailbox 9 +- AT91S_CAN_MB CAN_MB10; // CAN Mailbox 10 +- AT91S_CAN_MB CAN_MB11; // CAN Mailbox 11 +- AT91S_CAN_MB CAN_MB12; // CAN Mailbox 12 +- AT91S_CAN_MB CAN_MB13; // CAN Mailbox 13 +- AT91S_CAN_MB CAN_MB14; // CAN Mailbox 14 +- AT91S_CAN_MB CAN_MB15; // CAN Mailbox 15 +-} AT91S_CAN, *AT91PS_CAN; +- +-// -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- +-#define AT91C_CAN_CANEN ((unsigned int) 0x1 << 0) // (CAN) CAN Controller Enable +-#define AT91C_CAN_LPM ((unsigned int) 0x1 << 1) // (CAN) Disable/Enable Low Power Mode +-#define AT91C_CAN_ABM ((unsigned int) 0x1 << 2) // (CAN) Disable/Enable Autobaud/Listen Mode +-#define AT91C_CAN_OVL ((unsigned int) 0x1 << 3) // (CAN) Disable/Enable Overload Frame +-#define AT91C_CAN_TEOF ((unsigned int) 0x1 << 4) // (CAN) Time Stamp messages at each end of Frame +-#define AT91C_CAN_TTM ((unsigned int) 0x1 << 5) // (CAN) Disable/Enable Time Trigger Mode +-#define AT91C_CAN_TIMFRZ ((unsigned int) 0x1 << 6) // (CAN) Enable Timer Freeze +-#define AT91C_CAN_DRPT ((unsigned int) 0x1 << 7) // (CAN) Disable Repeat +-// -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- +-#define AT91C_CAN_MB0 ((unsigned int) 0x1 << 0) // (CAN) Mailbox 0 Flag +-#define AT91C_CAN_MB1 ((unsigned int) 0x1 << 1) // (CAN) Mailbox 1 Flag +-#define AT91C_CAN_MB2 ((unsigned int) 0x1 << 2) // (CAN) Mailbox 2 Flag +-#define AT91C_CAN_MB3 ((unsigned int) 0x1 << 3) // (CAN) Mailbox 3 Flag +-#define AT91C_CAN_MB4 ((unsigned int) 0x1 << 4) // (CAN) Mailbox 4 Flag +-#define AT91C_CAN_MB5 ((unsigned int) 0x1 << 5) // (CAN) Mailbox 5 Flag +-#define AT91C_CAN_MB6 ((unsigned int) 0x1 << 6) // (CAN) Mailbox 6 Flag +-#define AT91C_CAN_MB7 ((unsigned int) 0x1 << 7) // (CAN) Mailbox 7 Flag +-#define AT91C_CAN_MB8 ((unsigned int) 0x1 << 8) // (CAN) Mailbox 8 Flag +-#define AT91C_CAN_MB9 ((unsigned int) 0x1 << 9) // (CAN) Mailbox 9 Flag +-#define AT91C_CAN_MB10 ((unsigned int) 0x1 << 10) // (CAN) Mailbox 10 Flag +-#define AT91C_CAN_MB11 ((unsigned int) 0x1 << 11) // (CAN) Mailbox 11 Flag +-#define AT91C_CAN_MB12 ((unsigned int) 0x1 << 12) // (CAN) Mailbox 12 Flag +-#define AT91C_CAN_MB13 ((unsigned int) 0x1 << 13) // (CAN) Mailbox 13 Flag +-#define AT91C_CAN_MB14 ((unsigned int) 0x1 << 14) // (CAN) Mailbox 14 Flag +-#define AT91C_CAN_MB15 ((unsigned int) 0x1 << 15) // (CAN) Mailbox 15 Flag +-#define AT91C_CAN_ERRA ((unsigned int) 0x1 << 16) // (CAN) Error Active Mode Flag +-#define AT91C_CAN_WARN ((unsigned int) 0x1 << 17) // (CAN) Warning Limit Flag +-#define AT91C_CAN_ERRP ((unsigned int) 0x1 << 18) // (CAN) Error Passive Mode Flag +-#define AT91C_CAN_BOFF ((unsigned int) 0x1 << 19) // (CAN) Bus Off Mode Flag +-#define AT91C_CAN_SLEEP ((unsigned int) 0x1 << 20) // (CAN) Sleep Flag +-#define AT91C_CAN_WAKEUP ((unsigned int) 0x1 << 21) // (CAN) Wakeup Flag +-#define AT91C_CAN_TOVF ((unsigned int) 0x1 << 22) // (CAN) Timer Overflow Flag +-#define AT91C_CAN_TSTP ((unsigned int) 0x1 << 23) // (CAN) Timestamp Flag +-#define AT91C_CAN_CERR ((unsigned int) 0x1 << 24) // (CAN) CRC Error +-#define AT91C_CAN_SERR ((unsigned int) 0x1 << 25) // (CAN) Stuffing Error +-#define AT91C_CAN_AERR ((unsigned int) 0x1 << 26) // (CAN) Acknowledgment Error +-#define AT91C_CAN_FERR ((unsigned int) 0x1 << 27) // (CAN) Form Error +-#define AT91C_CAN_BERR ((unsigned int) 0x1 << 28) // (CAN) Bit Error +-// -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- +-// -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- +-// -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- +-#define AT91C_CAN_RBSY ((unsigned int) 0x1 << 29) // (CAN) Receiver Busy +-#define AT91C_CAN_TBSY ((unsigned int) 0x1 << 30) // (CAN) Transmitter Busy +-#define AT91C_CAN_OVLY ((unsigned int) 0x1 << 31) // (CAN) Overload Busy +-// -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- +-#define AT91C_CAN_PHASE2 ((unsigned int) 0x7 << 0) // (CAN) Phase 2 segment +-#define AT91C_CAN_PHASE1 ((unsigned int) 0x7 << 4) // (CAN) Phase 1 segment +-#define AT91C_CAN_PROPAG ((unsigned int) 0x7 << 8) // (CAN) Programmation time segment +-#define AT91C_CAN_SYNC ((unsigned int) 0x3 << 12) // (CAN) Re-synchronization jump width segment +-#define AT91C_CAN_BRP ((unsigned int) 0x7F << 16) // (CAN) Baudrate Prescaler +-#define AT91C_CAN_SMP ((unsigned int) 0x1 << 24) // (CAN) Sampling mode +-// -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- +-#define AT91C_CAN_TIMER ((unsigned int) 0xFFFF << 0) // (CAN) Timer field +-// -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- +-// -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- +-#define AT91C_CAN_REC ((unsigned int) 0xFF << 0) // (CAN) Receive Error Counter +-#define AT91C_CAN_TEC ((unsigned int) 0xFF << 16) // (CAN) Transmit Error Counter +-// -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- +-#define AT91C_CAN_TIMRST ((unsigned int) 0x1 << 31) // (CAN) Timer Reset Field +-// -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 +-// ***************************************************************************** +-typedef struct _AT91S_EMAC { +- AT91_REG EMAC_NCR; // Network Control Register +- AT91_REG EMAC_NCFGR; // Network Configuration Register +- AT91_REG EMAC_NSR; // Network Status Register +- AT91_REG Reserved0[2]; // +- AT91_REG EMAC_TSR; // Transmit Status Register +- AT91_REG EMAC_RBQP; // Receive Buffer Queue Pointer +- AT91_REG EMAC_TBQP; // Transmit Buffer Queue Pointer +- AT91_REG EMAC_RSR; // Receive Status Register +- AT91_REG EMAC_ISR; // Interrupt Status Register +- AT91_REG EMAC_IER; // Interrupt Enable Register +- AT91_REG EMAC_IDR; // Interrupt Disable Register +- AT91_REG EMAC_IMR; // Interrupt Mask Register +- AT91_REG EMAC_MAN; // PHY Maintenance Register +- AT91_REG EMAC_PTR; // Pause Time Register +- AT91_REG EMAC_PFR; // Pause Frames received Register +- AT91_REG EMAC_FTO; // Frames Transmitted OK Register +- AT91_REG EMAC_SCF; // Single Collision Frame Register +- AT91_REG EMAC_MCF; // Multiple Collision Frame Register +- AT91_REG EMAC_FRO; // Frames Received OK Register +- AT91_REG EMAC_FCSE; // Frame Check Sequence Error Register +- AT91_REG EMAC_ALE; // Alignment Error Register +- AT91_REG EMAC_DTF; // Deferred Transmission Frame Register +- AT91_REG EMAC_LCOL; // Late Collision Register +- AT91_REG EMAC_ECOL; // Excessive Collision Register +- AT91_REG EMAC_TUND; // Transmit Underrun Error Register +- AT91_REG EMAC_CSE; // Carrier Sense Error Register +- AT91_REG EMAC_RRE; // Receive Ressource Error Register +- AT91_REG EMAC_ROV; // Receive Overrun Errors Register +- AT91_REG EMAC_RSE; // Receive Symbol Errors Register +- AT91_REG EMAC_ELE; // Excessive Length Errors Register +- AT91_REG EMAC_RJA; // Receive Jabbers Register +- AT91_REG EMAC_USF; // Undersize Frames Register +- AT91_REG EMAC_STE; // SQE Test Error Register +- AT91_REG EMAC_RLE; // Receive Length Field Mismatch Register +- AT91_REG EMAC_TPF; // Transmitted Pause Frames Register +- AT91_REG EMAC_HRB; // Hash Address Bottom[31:0] +- AT91_REG EMAC_HRT; // Hash Address Top[63:32] +- AT91_REG EMAC_SA1L; // Specific Address 1 Bottom, First 4 bytes +- AT91_REG EMAC_SA1H; // Specific Address 1 Top, Last 2 bytes +- AT91_REG EMAC_SA2L; // Specific Address 2 Bottom, First 4 bytes +- AT91_REG EMAC_SA2H; // Specific Address 2 Top, Last 2 bytes +- AT91_REG EMAC_SA3L; // Specific Address 3 Bottom, First 4 bytes +- AT91_REG EMAC_SA3H; // Specific Address 3 Top, Last 2 bytes +- AT91_REG EMAC_SA4L; // Specific Address 4 Bottom, First 4 bytes +- AT91_REG EMAC_SA4H; // Specific Address 4 Top, Last 2 bytes +- AT91_REG EMAC_TID; // Type ID Checking Register +- AT91_REG EMAC_TPQ; // Transmit Pause Quantum Register +- AT91_REG EMAC_USRIO; // USER Input/Output Register +- AT91_REG EMAC_WOL; // Wake On LAN Register +- AT91_REG Reserved1[13]; // +- AT91_REG EMAC_REV; // Revision Register +-} AT91S_EMAC, *AT91PS_EMAC; +- +-// -------- EMAC_NCR : (EMAC Offset: 0x0) -------- +-#define AT91C_EMAC_LB ((unsigned int) 0x1 << 0) // (EMAC) Loopback. Optional. When set, loopback signal is at high level. +-#define AT91C_EMAC_LLB ((unsigned int) 0x1 << 1) // (EMAC) Loopback local. +-#define AT91C_EMAC_RE ((unsigned int) 0x1 << 2) // (EMAC) Receive enable. +-#define AT91C_EMAC_TE ((unsigned int) 0x1 << 3) // (EMAC) Transmit enable. +-#define AT91C_EMAC_MPE ((unsigned int) 0x1 << 4) // (EMAC) Management port enable. +-#define AT91C_EMAC_CLRSTAT ((unsigned int) 0x1 << 5) // (EMAC) Clear statistics registers. +-#define AT91C_EMAC_INCSTAT ((unsigned int) 0x1 << 6) // (EMAC) Increment statistics registers. +-#define AT91C_EMAC_WESTAT ((unsigned int) 0x1 << 7) // (EMAC) Write enable for statistics registers. +-#define AT91C_EMAC_BP ((unsigned int) 0x1 << 8) // (EMAC) Back pressure. +-#define AT91C_EMAC_TSTART ((unsigned int) 0x1 << 9) // (EMAC) Start Transmission. +-#define AT91C_EMAC_THALT ((unsigned int) 0x1 << 10) // (EMAC) Transmission Halt. +-#define AT91C_EMAC_TPFR ((unsigned int) 0x1 << 11) // (EMAC) Transmit pause frame +-#define AT91C_EMAC_TZQ ((unsigned int) 0x1 << 12) // (EMAC) Transmit zero quantum pause frame +-// -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- +-#define AT91C_EMAC_SPD ((unsigned int) 0x1 << 0) // (EMAC) Speed. +-#define AT91C_EMAC_FD ((unsigned int) 0x1 << 1) // (EMAC) Full duplex. +-#define AT91C_EMAC_JFRAME ((unsigned int) 0x1 << 3) // (EMAC) Jumbo Frames. +-#define AT91C_EMAC_CAF ((unsigned int) 0x1 << 4) // (EMAC) Copy all frames. +-#define AT91C_EMAC_NBC ((unsigned int) 0x1 << 5) // (EMAC) No broadcast. +-#define AT91C_EMAC_MTI ((unsigned int) 0x1 << 6) // (EMAC) Multicast hash event enable +-#define AT91C_EMAC_UNI ((unsigned int) 0x1 << 7) // (EMAC) Unicast hash enable. +-#define AT91C_EMAC_BIG ((unsigned int) 0x1 << 8) // (EMAC) Receive 1522 bytes. +-#define AT91C_EMAC_EAE ((unsigned int) 0x1 << 9) // (EMAC) External address match enable. +-#define AT91C_EMAC_CLK ((unsigned int) 0x3 << 10) // (EMAC) +-#define AT91C_EMAC_CLK_HCLK_8 ((unsigned int) 0x0 << 10) // (EMAC) HCLK divided by 8 +-#define AT91C_EMAC_CLK_HCLK_16 ((unsigned int) 0x1 << 10) // (EMAC) HCLK divided by 16 +-#define AT91C_EMAC_CLK_HCLK_32 ((unsigned int) 0x2 << 10) // (EMAC) HCLK divided by 32 +-#define AT91C_EMAC_CLK_HCLK_64 ((unsigned int) 0x3 << 10) // (EMAC) HCLK divided by 64 +-#define AT91C_EMAC_RTY ((unsigned int) 0x1 << 12) // (EMAC) +-#define AT91C_EMAC_PAE ((unsigned int) 0x1 << 13) // (EMAC) +-#define AT91C_EMAC_RBOF ((unsigned int) 0x3 << 14) // (EMAC) +-#define AT91C_EMAC_RBOF_OFFSET_0 ((unsigned int) 0x0 << 14) // (EMAC) no offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_1 ((unsigned int) 0x1 << 14) // (EMAC) one byte offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_2 ((unsigned int) 0x2 << 14) // (EMAC) two bytes offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_3 ((unsigned int) 0x3 << 14) // (EMAC) three bytes offset from start of receive buffer +-#define AT91C_EMAC_RLCE ((unsigned int) 0x1 << 16) // (EMAC) Receive Length field Checking Enable +-#define AT91C_EMAC_DRFCS ((unsigned int) 0x1 << 17) // (EMAC) Discard Receive FCS +-#define AT91C_EMAC_EFRHD ((unsigned int) 0x1 << 18) // (EMAC) +-#define AT91C_EMAC_IRXFCS ((unsigned int) 0x1 << 19) // (EMAC) Ignore RX FCS +-// -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- +-#define AT91C_EMAC_LINKR ((unsigned int) 0x1 << 0) // (EMAC) +-#define AT91C_EMAC_MDIO ((unsigned int) 0x1 << 1) // (EMAC) +-#define AT91C_EMAC_IDLE ((unsigned int) 0x1 << 2) // (EMAC) +-// -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- +-#define AT91C_EMAC_UBR ((unsigned int) 0x1 << 0) // (EMAC) +-#define AT91C_EMAC_COL ((unsigned int) 0x1 << 1) // (EMAC) +-#define AT91C_EMAC_RLES ((unsigned int) 0x1 << 2) // (EMAC) +-#define AT91C_EMAC_TGO ((unsigned int) 0x1 << 3) // (EMAC) Transmit Go +-#define AT91C_EMAC_BEX ((unsigned int) 0x1 << 4) // (EMAC) Buffers exhausted mid frame +-#define AT91C_EMAC_COMP ((unsigned int) 0x1 << 5) // (EMAC) +-#define AT91C_EMAC_UND ((unsigned int) 0x1 << 6) // (EMAC) +-// -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- +-#define AT91C_EMAC_BNA ((unsigned int) 0x1 << 0) // (EMAC) +-#define AT91C_EMAC_REC ((unsigned int) 0x1 << 1) // (EMAC) +-#define AT91C_EMAC_OVR ((unsigned int) 0x1 << 2) // (EMAC) +-// -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- +-#define AT91C_EMAC_MFD ((unsigned int) 0x1 << 0) // (EMAC) +-#define AT91C_EMAC_RCOMP ((unsigned int) 0x1 << 1) // (EMAC) +-#define AT91C_EMAC_RXUBR ((unsigned int) 0x1 << 2) // (EMAC) +-#define AT91C_EMAC_TXUBR ((unsigned int) 0x1 << 3) // (EMAC) +-#define AT91C_EMAC_TUNDR ((unsigned int) 0x1 << 4) // (EMAC) +-#define AT91C_EMAC_RLEX ((unsigned int) 0x1 << 5) // (EMAC) +-#define AT91C_EMAC_TXERR ((unsigned int) 0x1 << 6) // (EMAC) +-#define AT91C_EMAC_TCOMP ((unsigned int) 0x1 << 7) // (EMAC) +-#define AT91C_EMAC_LINK ((unsigned int) 0x1 << 9) // (EMAC) +-#define AT91C_EMAC_ROVR ((unsigned int) 0x1 << 10) // (EMAC) +-#define AT91C_EMAC_HRESP ((unsigned int) 0x1 << 11) // (EMAC) +-#define AT91C_EMAC_PFRE ((unsigned int) 0x1 << 12) // (EMAC) +-#define AT91C_EMAC_PTZ ((unsigned int) 0x1 << 13) // (EMAC) +-// -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- +-// -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- +-// -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- +-// -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- +-#define AT91C_EMAC_DATA ((unsigned int) 0xFFFF << 0) // (EMAC) +-#define AT91C_EMAC_CODE ((unsigned int) 0x3 << 16) // (EMAC) +-#define AT91C_EMAC_REGA ((unsigned int) 0x1F << 18) // (EMAC) +-#define AT91C_EMAC_PHYA ((unsigned int) 0x1F << 23) // (EMAC) +-#define AT91C_EMAC_RW ((unsigned int) 0x3 << 28) // (EMAC) +-#define AT91C_EMAC_SOF ((unsigned int) 0x3 << 30) // (EMAC) +-// -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- +-#define AT91C_EMAC_RMII ((unsigned int) 0x1 << 0) // (EMAC) Reduce MII +-#define AT91C_EMAC_CLKEN ((unsigned int) 0x1 << 1) // (EMAC) Clock Enable +-// -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- +-#define AT91C_EMAC_IP ((unsigned int) 0xFFFF << 0) // (EMAC) ARP request IP address +-#define AT91C_EMAC_MAG ((unsigned int) 0x1 << 16) // (EMAC) Magic packet event enable +-#define AT91C_EMAC_ARP ((unsigned int) 0x1 << 17) // (EMAC) ARP request event enable +-#define AT91C_EMAC_SA1 ((unsigned int) 0x1 << 18) // (EMAC) Specific address register 1 event enable +-// -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- +-#define AT91C_EMAC_REVREF ((unsigned int) 0xFFFF << 0) // (EMAC) +-#define AT91C_EMAC_PARTREF ((unsigned int) 0xFFFF << 16) // (EMAC) +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Analog to Digital Convertor +-// ***************************************************************************** +-typedef struct _AT91S_ADC { +- AT91_REG ADC_CR; // ADC Control Register +- AT91_REG ADC_MR; // ADC Mode Register +- AT91_REG Reserved0[2]; // +- AT91_REG ADC_CHER; // ADC Channel Enable Register +- AT91_REG ADC_CHDR; // ADC Channel Disable Register +- AT91_REG ADC_CHSR; // ADC Channel Status Register +- AT91_REG ADC_SR; // ADC Status Register +- AT91_REG ADC_LCDR; // ADC Last Converted Data Register +- AT91_REG ADC_IER; // ADC Interrupt Enable Register +- AT91_REG ADC_IDR; // ADC Interrupt Disable Register +- AT91_REG ADC_IMR; // ADC Interrupt Mask Register +- AT91_REG ADC_CDR0; // ADC Channel Data Register 0 +- AT91_REG ADC_CDR1; // ADC Channel Data Register 1 +- AT91_REG ADC_CDR2; // ADC Channel Data Register 2 +- AT91_REG ADC_CDR3; // ADC Channel Data Register 3 +- AT91_REG ADC_CDR4; // ADC Channel Data Register 4 +- AT91_REG ADC_CDR5; // ADC Channel Data Register 5 +- AT91_REG ADC_CDR6; // ADC Channel Data Register 6 +- AT91_REG ADC_CDR7; // ADC Channel Data Register 7 +- AT91_REG Reserved1[44]; // +- AT91_REG ADC_RPR; // Receive Pointer Register +- AT91_REG ADC_RCR; // Receive Counter Register +- AT91_REG ADC_TPR; // Transmit Pointer Register +- AT91_REG ADC_TCR; // Transmit Counter Register +- AT91_REG ADC_RNPR; // Receive Next Pointer Register +- AT91_REG ADC_RNCR; // Receive Next Counter Register +- AT91_REG ADC_TNPR; // Transmit Next Pointer Register +- AT91_REG ADC_TNCR; // Transmit Next Counter Register +- AT91_REG ADC_PTCR; // PDC Transfer Control Register +- AT91_REG ADC_PTSR; // PDC Transfer Status Register +-} AT91S_ADC, *AT91PS_ADC; +- +-// -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- +-#define AT91C_ADC_SWRST ((unsigned int) 0x1 << 0) // (ADC) Software Reset +-#define AT91C_ADC_START ((unsigned int) 0x1 << 1) // (ADC) Start Conversion +-// -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- +-#define AT91C_ADC_TRGEN ((unsigned int) 0x1 << 0) // (ADC) Trigger Enable +-#define AT91C_ADC_TRGEN_DIS ((unsigned int) 0x0) // (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software +-#define AT91C_ADC_TRGEN_EN ((unsigned int) 0x1) // (ADC) Hardware trigger selected by TRGSEL field is enabled. +-#define AT91C_ADC_TRGSEL ((unsigned int) 0x7 << 1) // (ADC) Trigger Selection +-#define AT91C_ADC_TRGSEL_TIOA0 ((unsigned int) 0x0 << 1) // (ADC) Selected TRGSEL = TIAO0 +-#define AT91C_ADC_TRGSEL_TIOA1 ((unsigned int) 0x1 << 1) // (ADC) Selected TRGSEL = TIAO1 +-#define AT91C_ADC_TRGSEL_TIOA2 ((unsigned int) 0x2 << 1) // (ADC) Selected TRGSEL = TIAO2 +-#define AT91C_ADC_TRGSEL_TIOA3 ((unsigned int) 0x3 << 1) // (ADC) Selected TRGSEL = TIAO3 +-#define AT91C_ADC_TRGSEL_TIOA4 ((unsigned int) 0x4 << 1) // (ADC) Selected TRGSEL = TIAO4 +-#define AT91C_ADC_TRGSEL_TIOA5 ((unsigned int) 0x5 << 1) // (ADC) Selected TRGSEL = TIAO5 +-#define AT91C_ADC_TRGSEL_EXT ((unsigned int) 0x6 << 1) // (ADC) Selected TRGSEL = External Trigger +-#define AT91C_ADC_LOWRES ((unsigned int) 0x1 << 4) // (ADC) Resolution. +-#define AT91C_ADC_LOWRES_10_BIT ((unsigned int) 0x0 << 4) // (ADC) 10-bit resolution +-#define AT91C_ADC_LOWRES_8_BIT ((unsigned int) 0x1 << 4) // (ADC) 8-bit resolution +-#define AT91C_ADC_SLEEP ((unsigned int) 0x1 << 5) // (ADC) Sleep Mode +-#define AT91C_ADC_SLEEP_NORMAL_MODE ((unsigned int) 0x0 << 5) // (ADC) Normal Mode +-#define AT91C_ADC_SLEEP_MODE ((unsigned int) 0x1 << 5) // (ADC) Sleep Mode +-#define AT91C_ADC_PRESCAL ((unsigned int) 0x3F << 8) // (ADC) Prescaler rate selection +-#define AT91C_ADC_STARTUP ((unsigned int) 0x1F << 16) // (ADC) Startup Time +-#define AT91C_ADC_SHTIM ((unsigned int) 0xF << 24) // (ADC) Sample & Hold Time +-// -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- +-#define AT91C_ADC_CH0 ((unsigned int) 0x1 << 0) // (ADC) Channel 0 +-#define AT91C_ADC_CH1 ((unsigned int) 0x1 << 1) // (ADC) Channel 1 +-#define AT91C_ADC_CH2 ((unsigned int) 0x1 << 2) // (ADC) Channel 2 +-#define AT91C_ADC_CH3 ((unsigned int) 0x1 << 3) // (ADC) Channel 3 +-#define AT91C_ADC_CH4 ((unsigned int) 0x1 << 4) // (ADC) Channel 4 +-#define AT91C_ADC_CH5 ((unsigned int) 0x1 << 5) // (ADC) Channel 5 +-#define AT91C_ADC_CH6 ((unsigned int) 0x1 << 6) // (ADC) Channel 6 +-#define AT91C_ADC_CH7 ((unsigned int) 0x1 << 7) // (ADC) Channel 7 +-// -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- +-// -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- +-// -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- +-#define AT91C_ADC_EOC0 ((unsigned int) 0x1 << 0) // (ADC) End of Conversion +-#define AT91C_ADC_EOC1 ((unsigned int) 0x1 << 1) // (ADC) End of Conversion +-#define AT91C_ADC_EOC2 ((unsigned int) 0x1 << 2) // (ADC) End of Conversion +-#define AT91C_ADC_EOC3 ((unsigned int) 0x1 << 3) // (ADC) End of Conversion +-#define AT91C_ADC_EOC4 ((unsigned int) 0x1 << 4) // (ADC) End of Conversion +-#define AT91C_ADC_EOC5 ((unsigned int) 0x1 << 5) // (ADC) End of Conversion +-#define AT91C_ADC_EOC6 ((unsigned int) 0x1 << 6) // (ADC) End of Conversion +-#define AT91C_ADC_EOC7 ((unsigned int) 0x1 << 7) // (ADC) End of Conversion +-#define AT91C_ADC_OVRE0 ((unsigned int) 0x1 << 8) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE1 ((unsigned int) 0x1 << 9) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE2 ((unsigned int) 0x1 << 10) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE3 ((unsigned int) 0x1 << 11) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE4 ((unsigned int) 0x1 << 12) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE5 ((unsigned int) 0x1 << 13) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE6 ((unsigned int) 0x1 << 14) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE7 ((unsigned int) 0x1 << 15) // (ADC) Overrun Error +-#define AT91C_ADC_DRDY ((unsigned int) 0x1 << 16) // (ADC) Data Ready +-#define AT91C_ADC_GOVRE ((unsigned int) 0x1 << 17) // (ADC) General Overrun +-#define AT91C_ADC_ENDRX ((unsigned int) 0x1 << 18) // (ADC) End of Receiver Transfer +-#define AT91C_ADC_RXBUFF ((unsigned int) 0x1 << 19) // (ADC) RXBUFF Interrupt +-// -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- +-#define AT91C_ADC_LDATA ((unsigned int) 0x3FF << 0) // (ADC) Last Data Converted +-// -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- +-// -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- +-// -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- +-// -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- +-#define AT91C_ADC_DATA ((unsigned int) 0x3FF << 0) // (ADC) Converted Data +-// -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- +-// -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- +-// -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- +-// -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- +-// -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- +-// -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- +-// -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- +- +-// ***************************************************************************** +-// REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 +-// ***************************************************************************** +-// ========== Register definition for SYS peripheral ========== +-// ========== Register definition for AIC peripheral ========== +-#define AT91C_AIC_ICCR ((AT91_REG *) 0xFFFFF128) // (AIC) Interrupt Clear Command Register +-#define AT91C_AIC_IECR ((AT91_REG *) 0xFFFFF120) // (AIC) Interrupt Enable Command Register +-#define AT91C_AIC_SMR ((AT91_REG *) 0xFFFFF000) // (AIC) Source Mode Register +-#define AT91C_AIC_ISCR ((AT91_REG *) 0xFFFFF12C) // (AIC) Interrupt Set Command Register +-#define AT91C_AIC_EOICR ((AT91_REG *) 0xFFFFF130) // (AIC) End of Interrupt Command Register +-#define AT91C_AIC_DCR ((AT91_REG *) 0xFFFFF138) // (AIC) Debug Control Register (Protect) +-#define AT91C_AIC_FFER ((AT91_REG *) 0xFFFFF140) // (AIC) Fast Forcing Enable Register +-#define AT91C_AIC_SVR ((AT91_REG *) 0xFFFFF080) // (AIC) Source Vector Register +-#define AT91C_AIC_SPU ((AT91_REG *) 0xFFFFF134) // (AIC) Spurious Vector Register +-#define AT91C_AIC_FFDR ((AT91_REG *) 0xFFFFF144) // (AIC) Fast Forcing Disable Register +-#define AT91C_AIC_FVR ((AT91_REG *) 0xFFFFF104) // (AIC) FIQ Vector Register +-#define AT91C_AIC_FFSR ((AT91_REG *) 0xFFFFF148) // (AIC) Fast Forcing Status Register +-#define AT91C_AIC_IMR ((AT91_REG *) 0xFFFFF110) // (AIC) Interrupt Mask Register +-#define AT91C_AIC_ISR ((AT91_REG *) 0xFFFFF108) // (AIC) Interrupt Status Register +-#define AT91C_AIC_IVR ((AT91_REG *) 0xFFFFF100) // (AIC) IRQ Vector Register +-#define AT91C_AIC_IDCR ((AT91_REG *) 0xFFFFF124) // (AIC) Interrupt Disable Command Register +-#define AT91C_AIC_CISR ((AT91_REG *) 0xFFFFF114) // (AIC) Core Interrupt Status Register +-#define AT91C_AIC_IPR ((AT91_REG *) 0xFFFFF10C) // (AIC) Interrupt Pending Register +-// ========== Register definition for PDC_DBGU peripheral ========== +-#define AT91C_DBGU_TNCR ((AT91_REG *) 0xFFFFF31C) // (PDC_DBGU) Transmit Next Counter Register +-#define AT91C_DBGU_RNCR ((AT91_REG *) 0xFFFFF314) // (PDC_DBGU) Receive Next Counter Register +-#define AT91C_DBGU_PTCR ((AT91_REG *) 0xFFFFF320) // (PDC_DBGU) PDC Transfer Control Register +-#define AT91C_DBGU_PTSR ((AT91_REG *) 0xFFFFF324) // (PDC_DBGU) PDC Transfer Status Register +-#define AT91C_DBGU_RCR ((AT91_REG *) 0xFFFFF304) // (PDC_DBGU) Receive Counter Register +-#define AT91C_DBGU_TCR ((AT91_REG *) 0xFFFFF30C) // (PDC_DBGU) Transmit Counter Register +-#define AT91C_DBGU_RPR ((AT91_REG *) 0xFFFFF300) // (PDC_DBGU) Receive Pointer Register +-#define AT91C_DBGU_TPR ((AT91_REG *) 0xFFFFF308) // (PDC_DBGU) Transmit Pointer Register +-#define AT91C_DBGU_RNPR ((AT91_REG *) 0xFFFFF310) // (PDC_DBGU) Receive Next Pointer Register +-#define AT91C_DBGU_TNPR ((AT91_REG *) 0xFFFFF318) // (PDC_DBGU) Transmit Next Pointer Register +-// ========== Register definition for DBGU peripheral ========== +-#define AT91C_DBGU_EXID ((AT91_REG *) 0xFFFFF244) // (DBGU) Chip ID Extension Register +-#define AT91C_DBGU_THR ((AT91_REG *) 0xFFFFF21C) // (DBGU) Transmitter Holding Register +-#define AT91C_DBGU_CSR ((AT91_REG *) 0xFFFFF214) // (DBGU) Channel Status Register +-#define AT91C_DBGU_IDR ((AT91_REG *) 0xFFFFF20C) // (DBGU) Interrupt Disable Register +-#define AT91C_DBGU_MR ((AT91_REG *) 0xFFFFF204) // (DBGU) Mode Register +-#define AT91C_DBGU_FNTR ((AT91_REG *) 0xFFFFF248) // (DBGU) Force NTRST Register +-#define AT91C_DBGU_CIDR ((AT91_REG *) 0xFFFFF240) // (DBGU) Chip ID Register +-#define AT91C_DBGU_BRGR ((AT91_REG *) 0xFFFFF220) // (DBGU) Baud Rate Generator Register +-#define AT91C_DBGU_RHR ((AT91_REG *) 0xFFFFF218) // (DBGU) Receiver Holding Register +-#define AT91C_DBGU_IMR ((AT91_REG *) 0xFFFFF210) // (DBGU) Interrupt Mask Register +-#define AT91C_DBGU_IER ((AT91_REG *) 0xFFFFF208) // (DBGU) Interrupt Enable Register +-#define AT91C_DBGU_CR ((AT91_REG *) 0xFFFFF200) // (DBGU) Control Register +-// ========== Register definition for PIOA peripheral ========== +-#define AT91C_PIOA_IMR ((AT91_REG *) 0xFFFFF448) // (PIOA) Interrupt Mask Register +-#define AT91C_PIOA_IER ((AT91_REG *) 0xFFFFF440) // (PIOA) Interrupt Enable Register +-#define AT91C_PIOA_OWDR ((AT91_REG *) 0xFFFFF4A4) // (PIOA) Output Write Disable Register +-#define AT91C_PIOA_ISR ((AT91_REG *) 0xFFFFF44C) // (PIOA) Interrupt Status Register +-#define AT91C_PIOA_PPUDR ((AT91_REG *) 0xFFFFF460) // (PIOA) Pull-up Disable Register +-#define AT91C_PIOA_MDSR ((AT91_REG *) 0xFFFFF458) // (PIOA) Multi-driver Status Register +-#define AT91C_PIOA_MDER ((AT91_REG *) 0xFFFFF450) // (PIOA) Multi-driver Enable Register +-#define AT91C_PIOA_PER ((AT91_REG *) 0xFFFFF400) // (PIOA) PIO Enable Register +-#define AT91C_PIOA_PSR ((AT91_REG *) 0xFFFFF408) // (PIOA) PIO Status Register +-#define AT91C_PIOA_OER ((AT91_REG *) 0xFFFFF410) // (PIOA) Output Enable Register +-#define AT91C_PIOA_BSR ((AT91_REG *) 0xFFFFF474) // (PIOA) Select B Register +-#define AT91C_PIOA_PPUER ((AT91_REG *) 0xFFFFF464) // (PIOA) Pull-up Enable Register +-#define AT91C_PIOA_MDDR ((AT91_REG *) 0xFFFFF454) // (PIOA) Multi-driver Disable Register +-#define AT91C_PIOA_PDR ((AT91_REG *) 0xFFFFF404) // (PIOA) PIO Disable Register +-#define AT91C_PIOA_ODR ((AT91_REG *) 0xFFFFF414) // (PIOA) Output Disable Registerr +-#define AT91C_PIOA_IFDR ((AT91_REG *) 0xFFFFF424) // (PIOA) Input Filter Disable Register +-#define AT91C_PIOA_ABSR ((AT91_REG *) 0xFFFFF478) // (PIOA) AB Select Status Register +-#define AT91C_PIOA_ASR ((AT91_REG *) 0xFFFFF470) // (PIOA) Select A Register +-#define AT91C_PIOA_PPUSR ((AT91_REG *) 0xFFFFF468) // (PIOA) Pull-up Status Register +-#define AT91C_PIOA_ODSR ((AT91_REG *) 0xFFFFF438) // (PIOA) Output Data Status Register +-#define AT91C_PIOA_SODR ((AT91_REG *) 0xFFFFF430) // (PIOA) Set Output Data Register +-#define AT91C_PIOA_IFSR ((AT91_REG *) 0xFFFFF428) // (PIOA) Input Filter Status Register +-#define AT91C_PIOA_IFER ((AT91_REG *) 0xFFFFF420) // (PIOA) Input Filter Enable Register +-#define AT91C_PIOA_OSR ((AT91_REG *) 0xFFFFF418) // (PIOA) Output Status Register +-#define AT91C_PIOA_IDR ((AT91_REG *) 0xFFFFF444) // (PIOA) Interrupt Disable Register +-#define AT91C_PIOA_PDSR ((AT91_REG *) 0xFFFFF43C) // (PIOA) Pin Data Status Register +-#define AT91C_PIOA_CODR ((AT91_REG *) 0xFFFFF434) // (PIOA) Clear Output Data Register +-#define AT91C_PIOA_OWSR ((AT91_REG *) 0xFFFFF4A8) // (PIOA) Output Write Status Register +-#define AT91C_PIOA_OWER ((AT91_REG *) 0xFFFFF4A0) // (PIOA) Output Write Enable Register +-// ========== Register definition for PIOB peripheral ========== +-#define AT91C_PIOB_OWSR ((AT91_REG *) 0xFFFFF6A8) // (PIOB) Output Write Status Register +-#define AT91C_PIOB_PPUSR ((AT91_REG *) 0xFFFFF668) // (PIOB) Pull-up Status Register +-#define AT91C_PIOB_PPUDR ((AT91_REG *) 0xFFFFF660) // (PIOB) Pull-up Disable Register +-#define AT91C_PIOB_MDSR ((AT91_REG *) 0xFFFFF658) // (PIOB) Multi-driver Status Register +-#define AT91C_PIOB_MDER ((AT91_REG *) 0xFFFFF650) // (PIOB) Multi-driver Enable Register +-#define AT91C_PIOB_IMR ((AT91_REG *) 0xFFFFF648) // (PIOB) Interrupt Mask Register +-#define AT91C_PIOB_OSR ((AT91_REG *) 0xFFFFF618) // (PIOB) Output Status Register +-#define AT91C_PIOB_OER ((AT91_REG *) 0xFFFFF610) // (PIOB) Output Enable Register +-#define AT91C_PIOB_PSR ((AT91_REG *) 0xFFFFF608) // (PIOB) PIO Status Register +-#define AT91C_PIOB_PER ((AT91_REG *) 0xFFFFF600) // (PIOB) PIO Enable Register +-#define AT91C_PIOB_BSR ((AT91_REG *) 0xFFFFF674) // (PIOB) Select B Register +-#define AT91C_PIOB_PPUER ((AT91_REG *) 0xFFFFF664) // (PIOB) Pull-up Enable Register +-#define AT91C_PIOB_IFDR ((AT91_REG *) 0xFFFFF624) // (PIOB) Input Filter Disable Register +-#define AT91C_PIOB_ODR ((AT91_REG *) 0xFFFFF614) // (PIOB) Output Disable Registerr +-#define AT91C_PIOB_ABSR ((AT91_REG *) 0xFFFFF678) // (PIOB) AB Select Status Register +-#define AT91C_PIOB_ASR ((AT91_REG *) 0xFFFFF670) // (PIOB) Select A Register +-#define AT91C_PIOB_IFER ((AT91_REG *) 0xFFFFF620) // (PIOB) Input Filter Enable Register +-#define AT91C_PIOB_IFSR ((AT91_REG *) 0xFFFFF628) // (PIOB) Input Filter Status Register +-#define AT91C_PIOB_SODR ((AT91_REG *) 0xFFFFF630) // (PIOB) Set Output Data Register +-#define AT91C_PIOB_ODSR ((AT91_REG *) 0xFFFFF638) // (PIOB) Output Data Status Register +-#define AT91C_PIOB_CODR ((AT91_REG *) 0xFFFFF634) // (PIOB) Clear Output Data Register +-#define AT91C_PIOB_PDSR ((AT91_REG *) 0xFFFFF63C) // (PIOB) Pin Data Status Register +-#define AT91C_PIOB_OWER ((AT91_REG *) 0xFFFFF6A0) // (PIOB) Output Write Enable Register +-#define AT91C_PIOB_IER ((AT91_REG *) 0xFFFFF640) // (PIOB) Interrupt Enable Register +-#define AT91C_PIOB_OWDR ((AT91_REG *) 0xFFFFF6A4) // (PIOB) Output Write Disable Register +-#define AT91C_PIOB_MDDR ((AT91_REG *) 0xFFFFF654) // (PIOB) Multi-driver Disable Register +-#define AT91C_PIOB_ISR ((AT91_REG *) 0xFFFFF64C) // (PIOB) Interrupt Status Register +-#define AT91C_PIOB_IDR ((AT91_REG *) 0xFFFFF644) // (PIOB) Interrupt Disable Register +-#define AT91C_PIOB_PDR ((AT91_REG *) 0xFFFFF604) // (PIOB) PIO Disable Register +-// ========== Register definition for CKGR peripheral ========== +-#define AT91C_CKGR_PLLR ((AT91_REG *) 0xFFFFFC2C) // (CKGR) PLL Register +-#define AT91C_CKGR_MCFR ((AT91_REG *) 0xFFFFFC24) // (CKGR) Main Clock Frequency Register +-#define AT91C_CKGR_MOR ((AT91_REG *) 0xFFFFFC20) // (CKGR) Main Oscillator Register +-// ========== Register definition for PMC peripheral ========== +-#define AT91C_PMC_SCSR ((AT91_REG *) 0xFFFFFC08) // (PMC) System Clock Status Register +-#define AT91C_PMC_SCER ((AT91_REG *) 0xFFFFFC00) // (PMC) System Clock Enable Register +-#define AT91C_PMC_IMR ((AT91_REG *) 0xFFFFFC6C) // (PMC) Interrupt Mask Register +-#define AT91C_PMC_IDR ((AT91_REG *) 0xFFFFFC64) // (PMC) Interrupt Disable Register +-#define AT91C_PMC_PCDR ((AT91_REG *) 0xFFFFFC14) // (PMC) Peripheral Clock Disable Register +-#define AT91C_PMC_SCDR ((AT91_REG *) 0xFFFFFC04) // (PMC) System Clock Disable Register +-#define AT91C_PMC_SR ((AT91_REG *) 0xFFFFFC68) // (PMC) Status Register +-#define AT91C_PMC_IER ((AT91_REG *) 0xFFFFFC60) // (PMC) Interrupt Enable Register +-#define AT91C_PMC_MCKR ((AT91_REG *) 0xFFFFFC30) // (PMC) Master Clock Register +-#define AT91C_PMC_MOR ((AT91_REG *) 0xFFFFFC20) // (PMC) Main Oscillator Register +-#define AT91C_PMC_PCER ((AT91_REG *) 0xFFFFFC10) // (PMC) Peripheral Clock Enable Register +-#define AT91C_PMC_PCSR ((AT91_REG *) 0xFFFFFC18) // (PMC) Peripheral Clock Status Register +-#define AT91C_PMC_PLLR ((AT91_REG *) 0xFFFFFC2C) // (PMC) PLL Register +-#define AT91C_PMC_MCFR ((AT91_REG *) 0xFFFFFC24) // (PMC) Main Clock Frequency Register +-#define AT91C_PMC_PCKR ((AT91_REG *) 0xFFFFFC40) // (PMC) Programmable Clock Register +-// ========== Register definition for RSTC peripheral ========== +-#define AT91C_RSTC_RSR ((AT91_REG *) 0xFFFFFD04) // (RSTC) Reset Status Register +-#define AT91C_RSTC_RMR ((AT91_REG *) 0xFFFFFD08) // (RSTC) Reset Mode Register +-#define AT91C_RSTC_RCR ((AT91_REG *) 0xFFFFFD00) // (RSTC) Reset Control Register +-// ========== Register definition for RTTC peripheral ========== +-#define AT91C_RTTC_RTSR ((AT91_REG *) 0xFFFFFD2C) // (RTTC) Real-time Status Register +-#define AT91C_RTTC_RTAR ((AT91_REG *) 0xFFFFFD24) // (RTTC) Real-time Alarm Register +-#define AT91C_RTTC_RTVR ((AT91_REG *) 0xFFFFFD28) // (RTTC) Real-time Value Register +-#define AT91C_RTTC_RTMR ((AT91_REG *) 0xFFFFFD20) // (RTTC) Real-time Mode Register +-// ========== Register definition for PITC peripheral ========== +-#define AT91C_PITC_PIIR ((AT91_REG *) 0xFFFFFD3C) // (PITC) Period Interval Image Register +-#define AT91C_PITC_PISR ((AT91_REG *) 0xFFFFFD34) // (PITC) Period Interval Status Register +-#define AT91C_PITC_PIVR ((AT91_REG *) 0xFFFFFD38) // (PITC) Period Interval Value Register +-#define AT91C_PITC_PIMR ((AT91_REG *) 0xFFFFFD30) // (PITC) Period Interval Mode Register +-// ========== Register definition for WDTC peripheral ========== +-#define AT91C_WDTC_WDMR ((AT91_REG *) 0xFFFFFD44) // (WDTC) Watchdog Mode Register +-#define AT91C_WDTC_WDSR ((AT91_REG *) 0xFFFFFD48) // (WDTC) Watchdog Status Register +-#define AT91C_WDTC_WDCR ((AT91_REG *) 0xFFFFFD40) // (WDTC) Watchdog Control Register +-// ========== Register definition for VREG peripheral ========== +-#define AT91C_VREG_MR ((AT91_REG *) 0xFFFFFD60) // (VREG) Voltage Regulator Mode Register +-// ========== Register definition for MC peripheral ========== +-#define AT91C_MC_FCR ((AT91_REG *) 0xFFFFFF64) // (MC) MC Flash Command Register +-#define AT91C_MC_ASR ((AT91_REG *) 0xFFFFFF04) // (MC) MC Abort Status Register +-#define AT91C_MC_FSR ((AT91_REG *) 0xFFFFFF68) // (MC) MC Flash Status Register +-#define AT91C_MC_FMR ((AT91_REG *) 0xFFFFFF60) // (MC) MC Flash Mode Register +-#define AT91C_MC_AASR ((AT91_REG *) 0xFFFFFF08) // (MC) MC Abort Address Status Register +-#define AT91C_MC_RCR ((AT91_REG *) 0xFFFFFF00) // (MC) MC Remap Control Register +-// ========== Register definition for PDC_SPI1 peripheral ========== +-#define AT91C_SPI1_RNPR ((AT91_REG *) 0xFFFE4110) // (PDC_SPI1) Receive Next Pointer Register +-#define AT91C_SPI1_TPR ((AT91_REG *) 0xFFFE4108) // (PDC_SPI1) Transmit Pointer Register +-#define AT91C_SPI1_RPR ((AT91_REG *) 0xFFFE4100) // (PDC_SPI1) Receive Pointer Register +-#define AT91C_SPI1_PTSR ((AT91_REG *) 0xFFFE4124) // (PDC_SPI1) PDC Transfer Status Register +-#define AT91C_SPI1_RCR ((AT91_REG *) 0xFFFE4104) // (PDC_SPI1) Receive Counter Register +-#define AT91C_SPI1_TCR ((AT91_REG *) 0xFFFE410C) // (PDC_SPI1) Transmit Counter Register +-#define AT91C_SPI1_RNCR ((AT91_REG *) 0xFFFE4114) // (PDC_SPI1) Receive Next Counter Register +-#define AT91C_SPI1_TNCR ((AT91_REG *) 0xFFFE411C) // (PDC_SPI1) Transmit Next Counter Register +-#define AT91C_SPI1_TNPR ((AT91_REG *) 0xFFFE4118) // (PDC_SPI1) Transmit Next Pointer Register +-#define AT91C_SPI1_PTCR ((AT91_REG *) 0xFFFE4120) // (PDC_SPI1) PDC Transfer Control Register +-// ========== Register definition for SPI1 peripheral ========== +-#define AT91C_SPI1_CSR ((AT91_REG *) 0xFFFE4030) // (SPI1) Chip Select Register +-#define AT91C_SPI1_IDR ((AT91_REG *) 0xFFFE4018) // (SPI1) Interrupt Disable Register +-#define AT91C_SPI1_SR ((AT91_REG *) 0xFFFE4010) // (SPI1) Status Register +-#define AT91C_SPI1_RDR ((AT91_REG *) 0xFFFE4008) // (SPI1) Receive Data Register +-#define AT91C_SPI1_CR ((AT91_REG *) 0xFFFE4000) // (SPI1) Control Register +-#define AT91C_SPI1_IMR ((AT91_REG *) 0xFFFE401C) // (SPI1) Interrupt Mask Register +-#define AT91C_SPI1_IER ((AT91_REG *) 0xFFFE4014) // (SPI1) Interrupt Enable Register +-#define AT91C_SPI1_TDR ((AT91_REG *) 0xFFFE400C) // (SPI1) Transmit Data Register +-#define AT91C_SPI1_MR ((AT91_REG *) 0xFFFE4004) // (SPI1) Mode Register +-// ========== Register definition for PDC_SPI0 peripheral ========== +-#define AT91C_SPI0_PTCR ((AT91_REG *) 0xFFFE0120) // (PDC_SPI0) PDC Transfer Control Register +-#define AT91C_SPI0_TNPR ((AT91_REG *) 0xFFFE0118) // (PDC_SPI0) Transmit Next Pointer Register +-#define AT91C_SPI0_RNPR ((AT91_REG *) 0xFFFE0110) // (PDC_SPI0) Receive Next Pointer Register +-#define AT91C_SPI0_TPR ((AT91_REG *) 0xFFFE0108) // (PDC_SPI0) Transmit Pointer Register +-#define AT91C_SPI0_RPR ((AT91_REG *) 0xFFFE0100) // (PDC_SPI0) Receive Pointer Register +-#define AT91C_SPI0_PTSR ((AT91_REG *) 0xFFFE0124) // (PDC_SPI0) PDC Transfer Status Register +-#define AT91C_SPI0_TNCR ((AT91_REG *) 0xFFFE011C) // (PDC_SPI0) Transmit Next Counter Register +-#define AT91C_SPI0_RNCR ((AT91_REG *) 0xFFFE0114) // (PDC_SPI0) Receive Next Counter Register +-#define AT91C_SPI0_TCR ((AT91_REG *) 0xFFFE010C) // (PDC_SPI0) Transmit Counter Register +-#define AT91C_SPI0_RCR ((AT91_REG *) 0xFFFE0104) // (PDC_SPI0) Receive Counter Register +-// ========== Register definition for SPI0 peripheral ========== +-#define AT91C_SPI0_CSR ((AT91_REG *) 0xFFFE0030) // (SPI0) Chip Select Register +-#define AT91C_SPI0_IDR ((AT91_REG *) 0xFFFE0018) // (SPI0) Interrupt Disable Register +-#define AT91C_SPI0_SR ((AT91_REG *) 0xFFFE0010) // (SPI0) Status Register +-#define AT91C_SPI0_RDR ((AT91_REG *) 0xFFFE0008) // (SPI0) Receive Data Register +-#define AT91C_SPI0_CR ((AT91_REG *) 0xFFFE0000) // (SPI0) Control Register +-#define AT91C_SPI0_IMR ((AT91_REG *) 0xFFFE001C) // (SPI0) Interrupt Mask Register +-#define AT91C_SPI0_IER ((AT91_REG *) 0xFFFE0014) // (SPI0) Interrupt Enable Register +-#define AT91C_SPI0_TDR ((AT91_REG *) 0xFFFE000C) // (SPI0) Transmit Data Register +-#define AT91C_SPI0_MR ((AT91_REG *) 0xFFFE0004) // (SPI0) Mode Register +-// ========== Register definition for PDC_US1 peripheral ========== +-#define AT91C_US1_PTSR ((AT91_REG *) 0xFFFC4124) // (PDC_US1) PDC Transfer Status Register +-#define AT91C_US1_TNCR ((AT91_REG *) 0xFFFC411C) // (PDC_US1) Transmit Next Counter Register +-#define AT91C_US1_RNCR ((AT91_REG *) 0xFFFC4114) // (PDC_US1) Receive Next Counter Register +-#define AT91C_US1_TCR ((AT91_REG *) 0xFFFC410C) // (PDC_US1) Transmit Counter Register +-#define AT91C_US1_RCR ((AT91_REG *) 0xFFFC4104) // (PDC_US1) Receive Counter Register +-#define AT91C_US1_PTCR ((AT91_REG *) 0xFFFC4120) // (PDC_US1) PDC Transfer Control Register +-#define AT91C_US1_TNPR ((AT91_REG *) 0xFFFC4118) // (PDC_US1) Transmit Next Pointer Register +-#define AT91C_US1_RNPR ((AT91_REG *) 0xFFFC4110) // (PDC_US1) Receive Next Pointer Register +-#define AT91C_US1_TPR ((AT91_REG *) 0xFFFC4108) // (PDC_US1) Transmit Pointer Register +-#define AT91C_US1_RPR ((AT91_REG *) 0xFFFC4100) // (PDC_US1) Receive Pointer Register +-// ========== Register definition for US1 peripheral ========== +-#define AT91C_US1_RHR ((AT91_REG *) 0xFFFC4018) // (US1) Receiver Holding Register +-#define AT91C_US1_IMR ((AT91_REG *) 0xFFFC4010) // (US1) Interrupt Mask Register +-#define AT91C_US1_IER ((AT91_REG *) 0xFFFC4008) // (US1) Interrupt Enable Register +-#define AT91C_US1_CR ((AT91_REG *) 0xFFFC4000) // (US1) Control Register +-#define AT91C_US1_RTOR ((AT91_REG *) 0xFFFC4024) // (US1) Receiver Time-out Register +-#define AT91C_US1_THR ((AT91_REG *) 0xFFFC401C) // (US1) Transmitter Holding Register +-#define AT91C_US1_CSR ((AT91_REG *) 0xFFFC4014) // (US1) Channel Status Register +-#define AT91C_US1_IDR ((AT91_REG *) 0xFFFC400C) // (US1) Interrupt Disable Register +-#define AT91C_US1_FIDI ((AT91_REG *) 0xFFFC4040) // (US1) FI_DI_Ratio Register +-#define AT91C_US1_BRGR ((AT91_REG *) 0xFFFC4020) // (US1) Baud Rate Generator Register +-#define AT91C_US1_TTGR ((AT91_REG *) 0xFFFC4028) // (US1) Transmitter Time-guard Register +-#define AT91C_US1_IF ((AT91_REG *) 0xFFFC404C) // (US1) IRDA_FILTER Register +-#define AT91C_US1_NER ((AT91_REG *) 0xFFFC4044) // (US1) Nb Errors Register +-#define AT91C_US1_MR ((AT91_REG *) 0xFFFC4004) // (US1) Mode Register +-// ========== Register definition for PDC_US0 peripheral ========== +-#define AT91C_US0_PTCR ((AT91_REG *) 0xFFFC0120) // (PDC_US0) PDC Transfer Control Register +-#define AT91C_US0_TNPR ((AT91_REG *) 0xFFFC0118) // (PDC_US0) Transmit Next Pointer Register +-#define AT91C_US0_RNPR ((AT91_REG *) 0xFFFC0110) // (PDC_US0) Receive Next Pointer Register +-#define AT91C_US0_TPR ((AT91_REG *) 0xFFFC0108) // (PDC_US0) Transmit Pointer Register +-#define AT91C_US0_RPR ((AT91_REG *) 0xFFFC0100) // (PDC_US0) Receive Pointer Register +-#define AT91C_US0_PTSR ((AT91_REG *) 0xFFFC0124) // (PDC_US0) PDC Transfer Status Register +-#define AT91C_US0_TNCR ((AT91_REG *) 0xFFFC011C) // (PDC_US0) Transmit Next Counter Register +-#define AT91C_US0_RNCR ((AT91_REG *) 0xFFFC0114) // (PDC_US0) Receive Next Counter Register +-#define AT91C_US0_TCR ((AT91_REG *) 0xFFFC010C) // (PDC_US0) Transmit Counter Register +-#define AT91C_US0_RCR ((AT91_REG *) 0xFFFC0104) // (PDC_US0) Receive Counter Register +-// ========== Register definition for US0 peripheral ========== +-#define AT91C_US0_TTGR ((AT91_REG *) 0xFFFC0028) // (US0) Transmitter Time-guard Register +-#define AT91C_US0_BRGR ((AT91_REG *) 0xFFFC0020) // (US0) Baud Rate Generator Register +-#define AT91C_US0_RHR ((AT91_REG *) 0xFFFC0018) // (US0) Receiver Holding Register +-#define AT91C_US0_IMR ((AT91_REG *) 0xFFFC0010) // (US0) Interrupt Mask Register +-#define AT91C_US0_NER ((AT91_REG *) 0xFFFC0044) // (US0) Nb Errors Register +-#define AT91C_US0_RTOR ((AT91_REG *) 0xFFFC0024) // (US0) Receiver Time-out Register +-#define AT91C_US0_FIDI ((AT91_REG *) 0xFFFC0040) // (US0) FI_DI_Ratio Register +-#define AT91C_US0_CR ((AT91_REG *) 0xFFFC0000) // (US0) Control Register +-#define AT91C_US0_IER ((AT91_REG *) 0xFFFC0008) // (US0) Interrupt Enable Register +-#define AT91C_US0_IF ((AT91_REG *) 0xFFFC004C) // (US0) IRDA_FILTER Register +-#define AT91C_US0_MR ((AT91_REG *) 0xFFFC0004) // (US0) Mode Register +-#define AT91C_US0_IDR ((AT91_REG *) 0xFFFC000C) // (US0) Interrupt Disable Register +-#define AT91C_US0_CSR ((AT91_REG *) 0xFFFC0014) // (US0) Channel Status Register +-#define AT91C_US0_THR ((AT91_REG *) 0xFFFC001C) // (US0) Transmitter Holding Register +-// ========== Register definition for PDC_SSC peripheral ========== +-#define AT91C_SSC_PTCR ((AT91_REG *) 0xFFFD4120) // (PDC_SSC) PDC Transfer Control Register +-#define AT91C_SSC_TNPR ((AT91_REG *) 0xFFFD4118) // (PDC_SSC) Transmit Next Pointer Register +-#define AT91C_SSC_RNPR ((AT91_REG *) 0xFFFD4110) // (PDC_SSC) Receive Next Pointer Register +-#define AT91C_SSC_TPR ((AT91_REG *) 0xFFFD4108) // (PDC_SSC) Transmit Pointer Register +-#define AT91C_SSC_RPR ((AT91_REG *) 0xFFFD4100) // (PDC_SSC) Receive Pointer Register +-#define AT91C_SSC_PTSR ((AT91_REG *) 0xFFFD4124) // (PDC_SSC) PDC Transfer Status Register +-#define AT91C_SSC_TNCR ((AT91_REG *) 0xFFFD411C) // (PDC_SSC) Transmit Next Counter Register +-#define AT91C_SSC_RNCR ((AT91_REG *) 0xFFFD4114) // (PDC_SSC) Receive Next Counter Register +-#define AT91C_SSC_TCR ((AT91_REG *) 0xFFFD410C) // (PDC_SSC) Transmit Counter Register +-#define AT91C_SSC_RCR ((AT91_REG *) 0xFFFD4104) // (PDC_SSC) Receive Counter Register +-// ========== Register definition for SSC peripheral ========== +-#define AT91C_SSC_RFMR ((AT91_REG *) 0xFFFD4014) // (SSC) Receive Frame Mode Register +-#define AT91C_SSC_CMR ((AT91_REG *) 0xFFFD4004) // (SSC) Clock Mode Register +-#define AT91C_SSC_IDR ((AT91_REG *) 0xFFFD4048) // (SSC) Interrupt Disable Register +-#define AT91C_SSC_SR ((AT91_REG *) 0xFFFD4040) // (SSC) Status Register +-#define AT91C_SSC_RSHR ((AT91_REG *) 0xFFFD4030) // (SSC) Receive Sync Holding Register +-#define AT91C_SSC_RHR ((AT91_REG *) 0xFFFD4020) // (SSC) Receive Holding Register +-#define AT91C_SSC_TCMR ((AT91_REG *) 0xFFFD4018) // (SSC) Transmit Clock Mode Register +-#define AT91C_SSC_RCMR ((AT91_REG *) 0xFFFD4010) // (SSC) Receive Clock ModeRegister +-#define AT91C_SSC_CR ((AT91_REG *) 0xFFFD4000) // (SSC) Control Register +-#define AT91C_SSC_IMR ((AT91_REG *) 0xFFFD404C) // (SSC) Interrupt Mask Register +-#define AT91C_SSC_IER ((AT91_REG *) 0xFFFD4044) // (SSC) Interrupt Enable Register +-#define AT91C_SSC_TSHR ((AT91_REG *) 0xFFFD4034) // (SSC) Transmit Sync Holding Register +-#define AT91C_SSC_THR ((AT91_REG *) 0xFFFD4024) // (SSC) Transmit Holding Register +-#define AT91C_SSC_TFMR ((AT91_REG *) 0xFFFD401C) // (SSC) Transmit Frame Mode Register +-// ========== Register definition for TWI peripheral ========== +-#define AT91C_TWI_RHR ((AT91_REG *) 0xFFFB8030) // (TWI) Receive Holding Register +-#define AT91C_TWI_IDR ((AT91_REG *) 0xFFFB8028) // (TWI) Interrupt Disable Register +-#define AT91C_TWI_SR ((AT91_REG *) 0xFFFB8020) // (TWI) Status Register +-#define AT91C_TWI_CWGR ((AT91_REG *) 0xFFFB8010) // (TWI) Clock Waveform Generator Register +-#define AT91C_TWI_CR ((AT91_REG *) 0xFFFB8000) // (TWI) Control Register +-#define AT91C_TWI_THR ((AT91_REG *) 0xFFFB8034) // (TWI) Transmit Holding Register +-#define AT91C_TWI_IMR ((AT91_REG *) 0xFFFB802C) // (TWI) Interrupt Mask Register +-#define AT91C_TWI_IER ((AT91_REG *) 0xFFFB8024) // (TWI) Interrupt Enable Register +-#define AT91C_TWI_IADR ((AT91_REG *) 0xFFFB800C) // (TWI) Internal Address Register +-#define AT91C_TWI_MMR ((AT91_REG *) 0xFFFB8004) // (TWI) Master Mode Register +-// ========== Register definition for PWMC_CH3 peripheral ========== +-#define AT91C_PWMC_CH3_CUPDR ((AT91_REG *) 0xFFFCC270) // (PWMC_CH3) Channel Update Register +-#define AT91C_PWMC_CH3_CPRDR ((AT91_REG *) 0xFFFCC268) // (PWMC_CH3) Channel Period Register +-#define AT91C_PWMC_CH3_CMR ((AT91_REG *) 0xFFFCC260) // (PWMC_CH3) Channel Mode Register +-#define AT91C_PWMC_CH3_Reserved ((AT91_REG *) 0xFFFCC274) // (PWMC_CH3) Reserved +-#define AT91C_PWMC_CH3_CCNTR ((AT91_REG *) 0xFFFCC26C) // (PWMC_CH3) Channel Counter Register +-#define AT91C_PWMC_CH3_CDTYR ((AT91_REG *) 0xFFFCC264) // (PWMC_CH3) Channel Duty Cycle Register +-// ========== Register definition for PWMC_CH2 peripheral ========== +-#define AT91C_PWMC_CH2_CUPDR ((AT91_REG *) 0xFFFCC250) // (PWMC_CH2) Channel Update Register +-#define AT91C_PWMC_CH2_CPRDR ((AT91_REG *) 0xFFFCC248) // (PWMC_CH2) Channel Period Register +-#define AT91C_PWMC_CH2_CMR ((AT91_REG *) 0xFFFCC240) // (PWMC_CH2) Channel Mode Register +-#define AT91C_PWMC_CH2_Reserved ((AT91_REG *) 0xFFFCC254) // (PWMC_CH2) Reserved +-#define AT91C_PWMC_CH2_CCNTR ((AT91_REG *) 0xFFFCC24C) // (PWMC_CH2) Channel Counter Register +-#define AT91C_PWMC_CH2_CDTYR ((AT91_REG *) 0xFFFCC244) // (PWMC_CH2) Channel Duty Cycle Register +-// ========== Register definition for PWMC_CH1 peripheral ========== +-#define AT91C_PWMC_CH1_CUPDR ((AT91_REG *) 0xFFFCC230) // (PWMC_CH1) Channel Update Register +-#define AT91C_PWMC_CH1_CPRDR ((AT91_REG *) 0xFFFCC228) // (PWMC_CH1) Channel Period Register +-#define AT91C_PWMC_CH1_CMR ((AT91_REG *) 0xFFFCC220) // (PWMC_CH1) Channel Mode Register +-#define AT91C_PWMC_CH1_Reserved ((AT91_REG *) 0xFFFCC234) // (PWMC_CH1) Reserved +-#define AT91C_PWMC_CH1_CCNTR ((AT91_REG *) 0xFFFCC22C) // (PWMC_CH1) Channel Counter Register +-#define AT91C_PWMC_CH1_CDTYR ((AT91_REG *) 0xFFFCC224) // (PWMC_CH1) Channel Duty Cycle Register +-// ========== Register definition for PWMC_CH0 peripheral ========== +-#define AT91C_PWMC_CH0_CUPDR ((AT91_REG *) 0xFFFCC210) // (PWMC_CH0) Channel Update Register +-#define AT91C_PWMC_CH0_CPRDR ((AT91_REG *) 0xFFFCC208) // (PWMC_CH0) Channel Period Register +-#define AT91C_PWMC_CH0_CMR ((AT91_REG *) 0xFFFCC200) // (PWMC_CH0) Channel Mode Register +-#define AT91C_PWMC_CH0_Reserved ((AT91_REG *) 0xFFFCC214) // (PWMC_CH0) Reserved +-#define AT91C_PWMC_CH0_CCNTR ((AT91_REG *) 0xFFFCC20C) // (PWMC_CH0) Channel Counter Register +-#define AT91C_PWMC_CH0_CDTYR ((AT91_REG *) 0xFFFCC204) // (PWMC_CH0) Channel Duty Cycle Register +-// ========== Register definition for PWMC peripheral ========== +-#define AT91C_PWMC_VR ((AT91_REG *) 0xFFFCC0FC) // (PWMC) PWMC Version Register +-#define AT91C_PWMC_ISR ((AT91_REG *) 0xFFFCC01C) // (PWMC) PWMC Interrupt Status Register +-#define AT91C_PWMC_IDR ((AT91_REG *) 0xFFFCC014) // (PWMC) PWMC Interrupt Disable Register +-#define AT91C_PWMC_SR ((AT91_REG *) 0xFFFCC00C) // (PWMC) PWMC Status Register +-#define AT91C_PWMC_ENA ((AT91_REG *) 0xFFFCC004) // (PWMC) PWMC Enable Register +-#define AT91C_PWMC_IMR ((AT91_REG *) 0xFFFCC018) // (PWMC) PWMC Interrupt Mask Register +-#define AT91C_PWMC_MR ((AT91_REG *) 0xFFFCC000) // (PWMC) PWMC Mode Register +-#define AT91C_PWMC_DIS ((AT91_REG *) 0xFFFCC008) // (PWMC) PWMC Disable Register +-#define AT91C_PWMC_IER ((AT91_REG *) 0xFFFCC010) // (PWMC) PWMC Interrupt Enable Register +-// ========== Register definition for UDP peripheral ========== +-#define AT91C_UDP_TXVC ((AT91_REG *) 0xFFFB0074) // (UDP) Transceiver Control Register +-#define AT91C_UDP_ISR ((AT91_REG *) 0xFFFB001C) // (UDP) Interrupt Status Register +-#define AT91C_UDP_IDR ((AT91_REG *) 0xFFFB0014) // (UDP) Interrupt Disable Register +-#define AT91C_UDP_CSR ((AT91_REG *) 0xFFFB0030) // (UDP) Endpoint Control and Status Register +-#define AT91C_UDP_RSTEP ((AT91_REG *) 0xFFFB0028) // (UDP) Reset Endpoint Register +-#define AT91C_UDP_ICR ((AT91_REG *) 0xFFFB0020) // (UDP) Interrupt Clear Register +-#define AT91C_UDP_GLBSTATE ((AT91_REG *) 0xFFFB0004) // (UDP) Global State Register +-#define AT91C_UDP_NUM ((AT91_REG *) 0xFFFB0000) // (UDP) Frame Number Register +-#define AT91C_UDP_FADDR ((AT91_REG *) 0xFFFB0008) // (UDP) Function Address Register +-#define AT91C_UDP_IER ((AT91_REG *) 0xFFFB0010) // (UDP) Interrupt Enable Register +-#define AT91C_UDP_IMR ((AT91_REG *) 0xFFFB0018) // (UDP) Interrupt Mask Register +-#define AT91C_UDP_FDR ((AT91_REG *) 0xFFFB0050) // (UDP) Endpoint FIFO Data Register +-// ========== Register definition for TC0 peripheral ========== +-#define AT91C_TC0_IMR ((AT91_REG *) 0xFFFA002C) // (TC0) Interrupt Mask Register +-#define AT91C_TC0_IER ((AT91_REG *) 0xFFFA0024) // (TC0) Interrupt Enable Register +-#define AT91C_TC0_RC ((AT91_REG *) 0xFFFA001C) // (TC0) Register C +-#define AT91C_TC0_RA ((AT91_REG *) 0xFFFA0014) // (TC0) Register A +-#define AT91C_TC0_CMR ((AT91_REG *) 0xFFFA0004) // (TC0) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC0_IDR ((AT91_REG *) 0xFFFA0028) // (TC0) Interrupt Disable Register +-#define AT91C_TC0_SR ((AT91_REG *) 0xFFFA0020) // (TC0) Status Register +-#define AT91C_TC0_RB ((AT91_REG *) 0xFFFA0018) // (TC0) Register B +-#define AT91C_TC0_CV ((AT91_REG *) 0xFFFA0010) // (TC0) Counter Value +-#define AT91C_TC0_CCR ((AT91_REG *) 0xFFFA0000) // (TC0) Channel Control Register +-// ========== Register definition for TC1 peripheral ========== +-#define AT91C_TC1_IMR ((AT91_REG *) 0xFFFA006C) // (TC1) Interrupt Mask Register +-#define AT91C_TC1_IER ((AT91_REG *) 0xFFFA0064) // (TC1) Interrupt Enable Register +-#define AT91C_TC1_RC ((AT91_REG *) 0xFFFA005C) // (TC1) Register C +-#define AT91C_TC1_RA ((AT91_REG *) 0xFFFA0054) // (TC1) Register A +-#define AT91C_TC1_CMR ((AT91_REG *) 0xFFFA0044) // (TC1) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC1_IDR ((AT91_REG *) 0xFFFA0068) // (TC1) Interrupt Disable Register +-#define AT91C_TC1_SR ((AT91_REG *) 0xFFFA0060) // (TC1) Status Register +-#define AT91C_TC1_RB ((AT91_REG *) 0xFFFA0058) // (TC1) Register B +-#define AT91C_TC1_CV ((AT91_REG *) 0xFFFA0050) // (TC1) Counter Value +-#define AT91C_TC1_CCR ((AT91_REG *) 0xFFFA0040) // (TC1) Channel Control Register +-// ========== Register definition for TC2 peripheral ========== +-#define AT91C_TC2_IMR ((AT91_REG *) 0xFFFA00AC) // (TC2) Interrupt Mask Register +-#define AT91C_TC2_IER ((AT91_REG *) 0xFFFA00A4) // (TC2) Interrupt Enable Register +-#define AT91C_TC2_RC ((AT91_REG *) 0xFFFA009C) // (TC2) Register C +-#define AT91C_TC2_RA ((AT91_REG *) 0xFFFA0094) // (TC2) Register A +-#define AT91C_TC2_CMR ((AT91_REG *) 0xFFFA0084) // (TC2) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC2_IDR ((AT91_REG *) 0xFFFA00A8) // (TC2) Interrupt Disable Register +-#define AT91C_TC2_SR ((AT91_REG *) 0xFFFA00A0) // (TC2) Status Register +-#define AT91C_TC2_RB ((AT91_REG *) 0xFFFA0098) // (TC2) Register B +-#define AT91C_TC2_CV ((AT91_REG *) 0xFFFA0090) // (TC2) Counter Value +-#define AT91C_TC2_CCR ((AT91_REG *) 0xFFFA0080) // (TC2) Channel Control Register +-// ========== Register definition for TCB peripheral ========== +-#define AT91C_TCB_BMR ((AT91_REG *) 0xFFFA00C4) // (TCB) TC Block Mode Register +-#define AT91C_TCB_BCR ((AT91_REG *) 0xFFFA00C0) // (TCB) TC Block Control Register +-// ========== Register definition for CAN_MB0 peripheral ========== +-#define AT91C_CAN_MB0_MCR ((AT91_REG *) 0xFFFD021C) // (CAN_MB0) MailBox Control Register +-#define AT91C_CAN_MB0_MDL ((AT91_REG *) 0xFFFD0214) // (CAN_MB0) MailBox Data Low Register +-#define AT91C_CAN_MB0_MFID ((AT91_REG *) 0xFFFD020C) // (CAN_MB0) MailBox Family ID Register +-#define AT91C_CAN_MB0_MAM ((AT91_REG *) 0xFFFD0204) // (CAN_MB0) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB0_MDH ((AT91_REG *) 0xFFFD0218) // (CAN_MB0) MailBox Data High Register +-#define AT91C_CAN_MB0_MSR ((AT91_REG *) 0xFFFD0210) // (CAN_MB0) MailBox Status Register +-#define AT91C_CAN_MB0_MID ((AT91_REG *) 0xFFFD0208) // (CAN_MB0) MailBox ID Register +-#define AT91C_CAN_MB0_MMR ((AT91_REG *) 0xFFFD0200) // (CAN_MB0) MailBox Mode Register +-// ========== Register definition for CAN_MB1 peripheral ========== +-#define AT91C_CAN_MB1_MCR ((AT91_REG *) 0xFFFD023C) // (CAN_MB1) MailBox Control Register +-#define AT91C_CAN_MB1_MDL ((AT91_REG *) 0xFFFD0234) // (CAN_MB1) MailBox Data Low Register +-#define AT91C_CAN_MB1_MFID ((AT91_REG *) 0xFFFD022C) // (CAN_MB1) MailBox Family ID Register +-#define AT91C_CAN_MB1_MAM ((AT91_REG *) 0xFFFD0224) // (CAN_MB1) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB1_MDH ((AT91_REG *) 0xFFFD0238) // (CAN_MB1) MailBox Data High Register +-#define AT91C_CAN_MB1_MSR ((AT91_REG *) 0xFFFD0230) // (CAN_MB1) MailBox Status Register +-#define AT91C_CAN_MB1_MID ((AT91_REG *) 0xFFFD0228) // (CAN_MB1) MailBox ID Register +-#define AT91C_CAN_MB1_MMR ((AT91_REG *) 0xFFFD0220) // (CAN_MB1) MailBox Mode Register +-// ========== Register definition for CAN_MB2 peripheral ========== +-#define AT91C_CAN_MB2_MCR ((AT91_REG *) 0xFFFD025C) // (CAN_MB2) MailBox Control Register +-#define AT91C_CAN_MB2_MDL ((AT91_REG *) 0xFFFD0254) // (CAN_MB2) MailBox Data Low Register +-#define AT91C_CAN_MB2_MFID ((AT91_REG *) 0xFFFD024C) // (CAN_MB2) MailBox Family ID Register +-#define AT91C_CAN_MB2_MAM ((AT91_REG *) 0xFFFD0244) // (CAN_MB2) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB2_MDH ((AT91_REG *) 0xFFFD0258) // (CAN_MB2) MailBox Data High Register +-#define AT91C_CAN_MB2_MSR ((AT91_REG *) 0xFFFD0250) // (CAN_MB2) MailBox Status Register +-#define AT91C_CAN_MB2_MID ((AT91_REG *) 0xFFFD0248) // (CAN_MB2) MailBox ID Register +-#define AT91C_CAN_MB2_MMR ((AT91_REG *) 0xFFFD0240) // (CAN_MB2) MailBox Mode Register +-// ========== Register definition for CAN_MB3 peripheral ========== +-#define AT91C_CAN_MB3_MCR ((AT91_REG *) 0xFFFD027C) // (CAN_MB3) MailBox Control Register +-#define AT91C_CAN_MB3_MDL ((AT91_REG *) 0xFFFD0274) // (CAN_MB3) MailBox Data Low Register +-#define AT91C_CAN_MB3_MFID ((AT91_REG *) 0xFFFD026C) // (CAN_MB3) MailBox Family ID Register +-#define AT91C_CAN_MB3_MAM ((AT91_REG *) 0xFFFD0264) // (CAN_MB3) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB3_MDH ((AT91_REG *) 0xFFFD0278) // (CAN_MB3) MailBox Data High Register +-#define AT91C_CAN_MB3_MSR ((AT91_REG *) 0xFFFD0270) // (CAN_MB3) MailBox Status Register +-#define AT91C_CAN_MB3_MID ((AT91_REG *) 0xFFFD0268) // (CAN_MB3) MailBox ID Register +-#define AT91C_CAN_MB3_MMR ((AT91_REG *) 0xFFFD0260) // (CAN_MB3) MailBox Mode Register +-// ========== Register definition for CAN_MB4 peripheral ========== +-#define AT91C_CAN_MB4_MCR ((AT91_REG *) 0xFFFD029C) // (CAN_MB4) MailBox Control Register +-#define AT91C_CAN_MB4_MDL ((AT91_REG *) 0xFFFD0294) // (CAN_MB4) MailBox Data Low Register +-#define AT91C_CAN_MB4_MFID ((AT91_REG *) 0xFFFD028C) // (CAN_MB4) MailBox Family ID Register +-#define AT91C_CAN_MB4_MAM ((AT91_REG *) 0xFFFD0284) // (CAN_MB4) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB4_MDH ((AT91_REG *) 0xFFFD0298) // (CAN_MB4) MailBox Data High Register +-#define AT91C_CAN_MB4_MSR ((AT91_REG *) 0xFFFD0290) // (CAN_MB4) MailBox Status Register +-#define AT91C_CAN_MB4_MID ((AT91_REG *) 0xFFFD0288) // (CAN_MB4) MailBox ID Register +-#define AT91C_CAN_MB4_MMR ((AT91_REG *) 0xFFFD0280) // (CAN_MB4) MailBox Mode Register +-// ========== Register definition for CAN_MB5 peripheral ========== +-#define AT91C_CAN_MB5_MCR ((AT91_REG *) 0xFFFD02BC) // (CAN_MB5) MailBox Control Register +-#define AT91C_CAN_MB5_MDL ((AT91_REG *) 0xFFFD02B4) // (CAN_MB5) MailBox Data Low Register +-#define AT91C_CAN_MB5_MFID ((AT91_REG *) 0xFFFD02AC) // (CAN_MB5) MailBox Family ID Register +-#define AT91C_CAN_MB5_MAM ((AT91_REG *) 0xFFFD02A4) // (CAN_MB5) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB5_MDH ((AT91_REG *) 0xFFFD02B8) // (CAN_MB5) MailBox Data High Register +-#define AT91C_CAN_MB5_MSR ((AT91_REG *) 0xFFFD02B0) // (CAN_MB5) MailBox Status Register +-#define AT91C_CAN_MB5_MID ((AT91_REG *) 0xFFFD02A8) // (CAN_MB5) MailBox ID Register +-#define AT91C_CAN_MB5_MMR ((AT91_REG *) 0xFFFD02A0) // (CAN_MB5) MailBox Mode Register +-// ========== Register definition for CAN_MB6 peripheral ========== +-#define AT91C_CAN_MB6_MAM ((AT91_REG *) 0xFFFD02C4) // (CAN_MB6) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB6_MDH ((AT91_REG *) 0xFFFD02D8) // (CAN_MB6) MailBox Data High Register +-#define AT91C_CAN_MB6_MSR ((AT91_REG *) 0xFFFD02D0) // (CAN_MB6) MailBox Status Register +-#define AT91C_CAN_MB6_MID ((AT91_REG *) 0xFFFD02C8) // (CAN_MB6) MailBox ID Register +-#define AT91C_CAN_MB6_MMR ((AT91_REG *) 0xFFFD02C0) // (CAN_MB6) MailBox Mode Register +-#define AT91C_CAN_MB6_MCR ((AT91_REG *) 0xFFFD02DC) // (CAN_MB6) MailBox Control Register +-#define AT91C_CAN_MB6_MDL ((AT91_REG *) 0xFFFD02D4) // (CAN_MB6) MailBox Data Low Register +-#define AT91C_CAN_MB6_MFID ((AT91_REG *) 0xFFFD02CC) // (CAN_MB6) MailBox Family ID Register +-// ========== Register definition for CAN_MB7 peripheral ========== +-#define AT91C_CAN_MB7_MDH ((AT91_REG *) 0xFFFD02F8) // (CAN_MB7) MailBox Data High Register +-#define AT91C_CAN_MB7_MSR ((AT91_REG *) 0xFFFD02F0) // (CAN_MB7) MailBox Status Register +-#define AT91C_CAN_MB7_MID ((AT91_REG *) 0xFFFD02E8) // (CAN_MB7) MailBox ID Register +-#define AT91C_CAN_MB7_MMR ((AT91_REG *) 0xFFFD02E0) // (CAN_MB7) MailBox Mode Register +-#define AT91C_CAN_MB7_MCR ((AT91_REG *) 0xFFFD02FC) // (CAN_MB7) MailBox Control Register +-#define AT91C_CAN_MB7_MDL ((AT91_REG *) 0xFFFD02F4) // (CAN_MB7) MailBox Data Low Register +-#define AT91C_CAN_MB7_MFID ((AT91_REG *) 0xFFFD02EC) // (CAN_MB7) MailBox Family ID Register +-#define AT91C_CAN_MB7_MAM ((AT91_REG *) 0xFFFD02E4) // (CAN_MB7) MailBox Acceptance Mask Register +-// ========== Register definition for CAN peripheral ========== +-#define AT91C_CAN_IMR ((AT91_REG *) 0xFFFD000C) // (CAN) Interrupt Mask Register +-#define AT91C_CAN_IER ((AT91_REG *) 0xFFFD0004) // (CAN) Interrupt Enable Register +-#define AT91C_CAN_ECR ((AT91_REG *) 0xFFFD0020) // (CAN) Error Counter Register +-#define AT91C_CAN_TIM ((AT91_REG *) 0xFFFD0018) // (CAN) Timer Register +-#define AT91C_CAN_SR ((AT91_REG *) 0xFFFD0010) // (CAN) Status Register +-#define AT91C_CAN_IDR ((AT91_REG *) 0xFFFD0008) // (CAN) Interrupt Disable Register +-#define AT91C_CAN_MR ((AT91_REG *) 0xFFFD0000) // (CAN) Mode Register +-#define AT91C_CAN_BR ((AT91_REG *) 0xFFFD0014) // (CAN) Baudrate Register +-#define AT91C_CAN_TIMESTP ((AT91_REG *) 0xFFFD001C) // (CAN) Time Stamp Register +-#define AT91C_CAN_TCR ((AT91_REG *) 0xFFFD0024) // (CAN) Transfer Command Register +-#define AT91C_CAN_ACR ((AT91_REG *) 0xFFFD0028) // (CAN) Abort Command Register +-#define AT91C_CAN_VR ((AT91_REG *) 0xFFFD00FC) // (CAN) Version Register +-// ========== Register definition for EMAC peripheral ========== +-#define AT91C_EMAC_TID ((AT91_REG *) 0xFFFDC0B8) // (EMAC) Type ID Checking Register +-#define AT91C_EMAC_SA3L ((AT91_REG *) 0xFFFDC0A8) // (EMAC) Specific Address 3 Bottom, First 4 bytes +-#define AT91C_EMAC_STE ((AT91_REG *) 0xFFFDC084) // (EMAC) SQE Test Error Register +-#define AT91C_EMAC_RSE ((AT91_REG *) 0xFFFDC074) // (EMAC) Receive Symbol Errors Register +-#define AT91C_EMAC_IDR ((AT91_REG *) 0xFFFDC02C) // (EMAC) Interrupt Disable Register +-#define AT91C_EMAC_TBQP ((AT91_REG *) 0xFFFDC01C) // (EMAC) Transmit Buffer Queue Pointer +-#define AT91C_EMAC_TPQ ((AT91_REG *) 0xFFFDC0BC) // (EMAC) Transmit Pause Quantum Register +-#define AT91C_EMAC_SA1L ((AT91_REG *) 0xFFFDC098) // (EMAC) Specific Address 1 Bottom, First 4 bytes +-#define AT91C_EMAC_RLE ((AT91_REG *) 0xFFFDC088) // (EMAC) Receive Length Field Mismatch Register +-#define AT91C_EMAC_IMR ((AT91_REG *) 0xFFFDC030) // (EMAC) Interrupt Mask Register +-#define AT91C_EMAC_SA1H ((AT91_REG *) 0xFFFDC09C) // (EMAC) Specific Address 1 Top, Last 2 bytes +-#define AT91C_EMAC_PFR ((AT91_REG *) 0xFFFDC03C) // (EMAC) Pause Frames received Register +-#define AT91C_EMAC_FCSE ((AT91_REG *) 0xFFFDC050) // (EMAC) Frame Check Sequence Error Register +-#define AT91C_EMAC_FTO ((AT91_REG *) 0xFFFDC040) // (EMAC) Frames Transmitted OK Register +-#define AT91C_EMAC_TUND ((AT91_REG *) 0xFFFDC064) // (EMAC) Transmit Underrun Error Register +-#define AT91C_EMAC_ALE ((AT91_REG *) 0xFFFDC054) // (EMAC) Alignment Error Register +-#define AT91C_EMAC_SCF ((AT91_REG *) 0xFFFDC044) // (EMAC) Single Collision Frame Register +-#define AT91C_EMAC_SA3H ((AT91_REG *) 0xFFFDC0AC) // (EMAC) Specific Address 3 Top, Last 2 bytes +-#define AT91C_EMAC_ELE ((AT91_REG *) 0xFFFDC078) // (EMAC) Excessive Length Errors Register +-#define AT91C_EMAC_CSE ((AT91_REG *) 0xFFFDC068) // (EMAC) Carrier Sense Error Register +-#define AT91C_EMAC_DTF ((AT91_REG *) 0xFFFDC058) // (EMAC) Deferred Transmission Frame Register +-#define AT91C_EMAC_RSR ((AT91_REG *) 0xFFFDC020) // (EMAC) Receive Status Register +-#define AT91C_EMAC_USRIO ((AT91_REG *) 0xFFFDC0C0) // (EMAC) USER Input/Output Register +-#define AT91C_EMAC_SA4L ((AT91_REG *) 0xFFFDC0B0) // (EMAC) Specific Address 4 Bottom, First 4 bytes +-#define AT91C_EMAC_RRE ((AT91_REG *) 0xFFFDC06C) // (EMAC) Receive Ressource Error Register +-#define AT91C_EMAC_RJA ((AT91_REG *) 0xFFFDC07C) // (EMAC) Receive Jabbers Register +-#define AT91C_EMAC_TPF ((AT91_REG *) 0xFFFDC08C) // (EMAC) Transmitted Pause Frames Register +-#define AT91C_EMAC_ISR ((AT91_REG *) 0xFFFDC024) // (EMAC) Interrupt Status Register +-#define AT91C_EMAC_MAN ((AT91_REG *) 0xFFFDC034) // (EMAC) PHY Maintenance Register +-#define AT91C_EMAC_WOL ((AT91_REG *) 0xFFFDC0C4) // (EMAC) Wake On LAN Register +-#define AT91C_EMAC_USF ((AT91_REG *) 0xFFFDC080) // (EMAC) Undersize Frames Register +-#define AT91C_EMAC_HRB ((AT91_REG *) 0xFFFDC090) // (EMAC) Hash Address Bottom[31:0] +-#define AT91C_EMAC_PTR ((AT91_REG *) 0xFFFDC038) // (EMAC) Pause Time Register +-#define AT91C_EMAC_HRT ((AT91_REG *) 0xFFFDC094) // (EMAC) Hash Address Top[63:32] +-#define AT91C_EMAC_REV ((AT91_REG *) 0xFFFDC0FC) // (EMAC) Revision Register +-#define AT91C_EMAC_MCF ((AT91_REG *) 0xFFFDC048) // (EMAC) Multiple Collision Frame Register +-#define AT91C_EMAC_SA2L ((AT91_REG *) 0xFFFDC0A0) // (EMAC) Specific Address 2 Bottom, First 4 bytes +-#define AT91C_EMAC_NCR ((AT91_REG *) 0xFFFDC000) // (EMAC) Network Control Register +-#define AT91C_EMAC_FRO ((AT91_REG *) 0xFFFDC04C) // (EMAC) Frames Received OK Register +-#define AT91C_EMAC_LCOL ((AT91_REG *) 0xFFFDC05C) // (EMAC) Late Collision Register +-#define AT91C_EMAC_SA4H ((AT91_REG *) 0xFFFDC0B4) // (EMAC) Specific Address 4 Top, Last 2 bytes +-#define AT91C_EMAC_NCFGR ((AT91_REG *) 0xFFFDC004) // (EMAC) Network Configuration Register +-#define AT91C_EMAC_TSR ((AT91_REG *) 0xFFFDC014) // (EMAC) Transmit Status Register +-#define AT91C_EMAC_SA2H ((AT91_REG *) 0xFFFDC0A4) // (EMAC) Specific Address 2 Top, Last 2 bytes +-#define AT91C_EMAC_ECOL ((AT91_REG *) 0xFFFDC060) // (EMAC) Excessive Collision Register +-#define AT91C_EMAC_ROV ((AT91_REG *) 0xFFFDC070) // (EMAC) Receive Overrun Errors Register +-#define AT91C_EMAC_NSR ((AT91_REG *) 0xFFFDC008) // (EMAC) Network Status Register +-#define AT91C_EMAC_RBQP ((AT91_REG *) 0xFFFDC018) // (EMAC) Receive Buffer Queue Pointer +-#define AT91C_EMAC_IER ((AT91_REG *) 0xFFFDC028) // (EMAC) Interrupt Enable Register +-// ========== Register definition for PDC_ADC peripheral ========== +-#define AT91C_ADC_PTCR ((AT91_REG *) 0xFFFD8120) // (PDC_ADC) PDC Transfer Control Register +-#define AT91C_ADC_TNPR ((AT91_REG *) 0xFFFD8118) // (PDC_ADC) Transmit Next Pointer Register +-#define AT91C_ADC_RNPR ((AT91_REG *) 0xFFFD8110) // (PDC_ADC) Receive Next Pointer Register +-#define AT91C_ADC_TPR ((AT91_REG *) 0xFFFD8108) // (PDC_ADC) Transmit Pointer Register +-#define AT91C_ADC_RPR ((AT91_REG *) 0xFFFD8100) // (PDC_ADC) Receive Pointer Register +-#define AT91C_ADC_PTSR ((AT91_REG *) 0xFFFD8124) // (PDC_ADC) PDC Transfer Status Register +-#define AT91C_ADC_TNCR ((AT91_REG *) 0xFFFD811C) // (PDC_ADC) Transmit Next Counter Register +-#define AT91C_ADC_RNCR ((AT91_REG *) 0xFFFD8114) // (PDC_ADC) Receive Next Counter Register +-#define AT91C_ADC_TCR ((AT91_REG *) 0xFFFD810C) // (PDC_ADC) Transmit Counter Register +-#define AT91C_ADC_RCR ((AT91_REG *) 0xFFFD8104) // (PDC_ADC) Receive Counter Register +-// ========== Register definition for ADC peripheral ========== +-#define AT91C_ADC_IMR ((AT91_REG *) 0xFFFD802C) // (ADC) ADC Interrupt Mask Register +-#define AT91C_ADC_CDR4 ((AT91_REG *) 0xFFFD8040) // (ADC) ADC Channel Data Register 4 +-#define AT91C_ADC_CDR2 ((AT91_REG *) 0xFFFD8038) // (ADC) ADC Channel Data Register 2 +-#define AT91C_ADC_CDR0 ((AT91_REG *) 0xFFFD8030) // (ADC) ADC Channel Data Register 0 +-#define AT91C_ADC_CDR7 ((AT91_REG *) 0xFFFD804C) // (ADC) ADC Channel Data Register 7 +-#define AT91C_ADC_CDR1 ((AT91_REG *) 0xFFFD8034) // (ADC) ADC Channel Data Register 1 +-#define AT91C_ADC_CDR3 ((AT91_REG *) 0xFFFD803C) // (ADC) ADC Channel Data Register 3 +-#define AT91C_ADC_CDR5 ((AT91_REG *) 0xFFFD8044) // (ADC) ADC Channel Data Register 5 +-#define AT91C_ADC_MR ((AT91_REG *) 0xFFFD8004) // (ADC) ADC Mode Register +-#define AT91C_ADC_CDR6 ((AT91_REG *) 0xFFFD8048) // (ADC) ADC Channel Data Register 6 +-#define AT91C_ADC_CR ((AT91_REG *) 0xFFFD8000) // (ADC) ADC Control Register +-#define AT91C_ADC_CHER ((AT91_REG *) 0xFFFD8010) // (ADC) ADC Channel Enable Register +-#define AT91C_ADC_CHSR ((AT91_REG *) 0xFFFD8018) // (ADC) ADC Channel Status Register +-#define AT91C_ADC_IER ((AT91_REG *) 0xFFFD8024) // (ADC) ADC Interrupt Enable Register +-#define AT91C_ADC_SR ((AT91_REG *) 0xFFFD801C) // (ADC) ADC Status Register +-#define AT91C_ADC_CHDR ((AT91_REG *) 0xFFFD8014) // (ADC) ADC Channel Disable Register +-#define AT91C_ADC_IDR ((AT91_REG *) 0xFFFD8028) // (ADC) ADC Interrupt Disable Register +-#define AT91C_ADC_LCDR ((AT91_REG *) 0xFFFD8020) // (ADC) ADC Last Converted Data Register +- +-// ***************************************************************************** +-// PIO DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_PIO_PA0 ((unsigned int) 1 << 0) // Pin Controlled by PA0 +-#define AT91C_PA0_RXD0 ((unsigned int) AT91C_PIO_PA0) // USART 0 Receive Data +-#define AT91C_PIO_PA1 ((unsigned int) 1 << 1) // Pin Controlled by PA1 +-#define AT91C_PA1_TXD0 ((unsigned int) AT91C_PIO_PA1) // USART 0 Transmit Data +-#define AT91C_PIO_PA10 ((unsigned int) 1 << 10) // Pin Controlled by PA10 +-#define AT91C_PA10_TWD ((unsigned int) AT91C_PIO_PA10) // TWI Two-wire Serial Data +-#define AT91C_PIO_PA11 ((unsigned int) 1 << 11) // Pin Controlled by PA11 +-#define AT91C_PA11_TWCK ((unsigned int) AT91C_PIO_PA11) // TWI Two-wire Serial Clock +-#define AT91C_PIO_PA12 ((unsigned int) 1 << 12) // Pin Controlled by PA12 +-#define AT91C_PA12_SPI0_NPCS0 ((unsigned int) AT91C_PIO_PA12) // SPI 0 Peripheral Chip Select 0 +-#define AT91C_PIO_PA13 ((unsigned int) 1 << 13) // Pin Controlled by PA13 +-#define AT91C_PA13_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PA13) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PA13_PCK1 ((unsigned int) AT91C_PIO_PA13) // PMC Programmable Clock Output 1 +-#define AT91C_PIO_PA14 ((unsigned int) 1 << 14) // Pin Controlled by PA14 +-#define AT91C_PA14_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PA14) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PA14_IRQ1 ((unsigned int) AT91C_PIO_PA14) // External Interrupt 1 +-#define AT91C_PIO_PA15 ((unsigned int) 1 << 15) // Pin Controlled by PA15 +-#define AT91C_PA15_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PA15) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PA15_TCLK2 ((unsigned int) AT91C_PIO_PA15) // Timer Counter 2 external clock input +-#define AT91C_PIO_PA16 ((unsigned int) 1 << 16) // Pin Controlled by PA16 +-#define AT91C_PA16_SPI0_MISO ((unsigned int) AT91C_PIO_PA16) // SPI 0 Master In Slave +-#define AT91C_PIO_PA17 ((unsigned int) 1 << 17) // Pin Controlled by PA17 +-#define AT91C_PA17_SPI0_MOSI ((unsigned int) AT91C_PIO_PA17) // SPI 0 Master Out Slave +-#define AT91C_PIO_PA18 ((unsigned int) 1 << 18) // Pin Controlled by PA18 +-#define AT91C_PA18_SPI0_SPCK ((unsigned int) AT91C_PIO_PA18) // SPI 0 Serial Clock +-#define AT91C_PIO_PA19 ((unsigned int) 1 << 19) // Pin Controlled by PA19 +-#define AT91C_PA19_CANRX ((unsigned int) AT91C_PIO_PA19) // CAN Receive +-#define AT91C_PIO_PA2 ((unsigned int) 1 << 2) // Pin Controlled by PA2 +-#define AT91C_PA2_SCK0 ((unsigned int) AT91C_PIO_PA2) // USART 0 Serial Clock +-#define AT91C_PA2_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PA2) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PA20 ((unsigned int) 1 << 20) // Pin Controlled by PA20 +-#define AT91C_PA20_CANTX ((unsigned int) AT91C_PIO_PA20) // CAN Transmit +-#define AT91C_PIO_PA21 ((unsigned int) 1 << 21) // Pin Controlled by PA21 +-#define AT91C_PA21_TF ((unsigned int) AT91C_PIO_PA21) // SSC Transmit Frame Sync +-#define AT91C_PA21_SPI1_NPCS0 ((unsigned int) AT91C_PIO_PA21) // SPI 1 Peripheral Chip Select 0 +-#define AT91C_PIO_PA22 ((unsigned int) 1 << 22) // Pin Controlled by PA22 +-#define AT91C_PA22_TK ((unsigned int) AT91C_PIO_PA22) // SSC Transmit Clock +-#define AT91C_PA22_SPI1_SPCK ((unsigned int) AT91C_PIO_PA22) // SPI 1 Serial Clock +-#define AT91C_PIO_PA23 ((unsigned int) 1 << 23) // Pin Controlled by PA23 +-#define AT91C_PA23_TD ((unsigned int) AT91C_PIO_PA23) // SSC Transmit data +-#define AT91C_PA23_SPI1_MOSI ((unsigned int) AT91C_PIO_PA23) // SPI 1 Master Out Slave +-#define AT91C_PIO_PA24 ((unsigned int) 1 << 24) // Pin Controlled by PA24 +-#define AT91C_PA24_RD ((unsigned int) AT91C_PIO_PA24) // SSC Receive Data +-#define AT91C_PA24_SPI1_MISO ((unsigned int) AT91C_PIO_PA24) // SPI 1 Master In Slave +-#define AT91C_PIO_PA25 ((unsigned int) 1 << 25) // Pin Controlled by PA25 +-#define AT91C_PA25_RK ((unsigned int) AT91C_PIO_PA25) // SSC Receive Clock +-#define AT91C_PA25_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PA25) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PA26 ((unsigned int) 1 << 26) // Pin Controlled by PA26 +-#define AT91C_PA26_RF ((unsigned int) AT91C_PIO_PA26) // SSC Receive Frame Sync +-#define AT91C_PA26_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PA26) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PA27 ((unsigned int) 1 << 27) // Pin Controlled by PA27 +-#define AT91C_PA27_DRXD ((unsigned int) AT91C_PIO_PA27) // DBGU Debug Receive Data +-#define AT91C_PA27_PCK3 ((unsigned int) AT91C_PIO_PA27) // PMC Programmable Clock Output 3 +-#define AT91C_PIO_PA28 ((unsigned int) 1 << 28) // Pin Controlled by PA28 +-#define AT91C_PA28_DTXD ((unsigned int) AT91C_PIO_PA28) // DBGU Debug Transmit Data +-#define AT91C_PIO_PA29 ((unsigned int) 1 << 29) // Pin Controlled by PA29 +-#define AT91C_PA29_FIQ ((unsigned int) AT91C_PIO_PA29) // AIC Fast Interrupt Input +-#define AT91C_PA29_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PA29) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PA3 ((unsigned int) 1 << 3) // Pin Controlled by PA3 +-#define AT91C_PA3_RTS0 ((unsigned int) AT91C_PIO_PA3) // USART 0 Ready To Send +-#define AT91C_PA3_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PA3) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PA30 ((unsigned int) 1 << 30) // Pin Controlled by PA30 +-#define AT91C_PA30_IRQ0 ((unsigned int) AT91C_PIO_PA30) // External Interrupt 0 +-#define AT91C_PA30_PCK2 ((unsigned int) AT91C_PIO_PA30) // PMC Programmable Clock Output 2 +-#define AT91C_PIO_PA4 ((unsigned int) 1 << 4) // Pin Controlled by PA4 +-#define AT91C_PA4_CTS0 ((unsigned int) AT91C_PIO_PA4) // USART 0 Clear To Send +-#define AT91C_PA4_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PA4) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PA5 ((unsigned int) 1 << 5) // Pin Controlled by PA5 +-#define AT91C_PA5_RXD1 ((unsigned int) AT91C_PIO_PA5) // USART 1 Receive Data +-#define AT91C_PIO_PA6 ((unsigned int) 1 << 6) // Pin Controlled by PA6 +-#define AT91C_PA6_TXD1 ((unsigned int) AT91C_PIO_PA6) // USART 1 Transmit Data +-#define AT91C_PIO_PA7 ((unsigned int) 1 << 7) // Pin Controlled by PA7 +-#define AT91C_PA7_SCK1 ((unsigned int) AT91C_PIO_PA7) // USART 1 Serial Clock +-#define AT91C_PA7_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PA7) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PIO_PA8 ((unsigned int) 1 << 8) // Pin Controlled by PA8 +-#define AT91C_PA8_RTS1 ((unsigned int) AT91C_PIO_PA8) // USART 1 Ready To Send +-#define AT91C_PA8_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PA8) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PIO_PA9 ((unsigned int) 1 << 9) // Pin Controlled by PA9 +-#define AT91C_PA9_CTS1 ((unsigned int) AT91C_PIO_PA9) // USART 1 Clear To Send +-#define AT91C_PA9_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PA9) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PIO_PB0 ((unsigned int) 1 << 0) // Pin Controlled by PB0 +-#define AT91C_PB0_ETXCK_EREFCK ((unsigned int) AT91C_PIO_PB0) // Ethernet MAC Transmit Clock/Reference Clock +-#define AT91C_PB0_PCK0 ((unsigned int) AT91C_PIO_PB0) // PMC Programmable Clock Output 0 +-#define AT91C_PIO_PB1 ((unsigned int) 1 << 1) // Pin Controlled by PB1 +-#define AT91C_PB1_ETXEN ((unsigned int) AT91C_PIO_PB1) // Ethernet MAC Transmit Enable +-#define AT91C_PIO_PB10 ((unsigned int) 1 << 10) // Pin Controlled by PB10 +-#define AT91C_PB10_ETX2 ((unsigned int) AT91C_PIO_PB10) // Ethernet MAC Transmit Data 2 +-#define AT91C_PB10_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PB10) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PB11 ((unsigned int) 1 << 11) // Pin Controlled by PB11 +-#define AT91C_PB11_ETX3 ((unsigned int) AT91C_PIO_PB11) // Ethernet MAC Transmit Data 3 +-#define AT91C_PB11_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PB11) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PB12 ((unsigned int) 1 << 12) // Pin Controlled by PB12 +-#define AT91C_PB12_ETXER ((unsigned int) AT91C_PIO_PB12) // Ethernet MAC Transmikt Coding Error +-#define AT91C_PB12_TCLK0 ((unsigned int) AT91C_PIO_PB12) // Timer Counter 0 external clock input +-#define AT91C_PIO_PB13 ((unsigned int) 1 << 13) // Pin Controlled by PB13 +-#define AT91C_PB13_ERX2 ((unsigned int) AT91C_PIO_PB13) // Ethernet MAC Receive Data 2 +-#define AT91C_PB13_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PB13) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PIO_PB14 ((unsigned int) 1 << 14) // Pin Controlled by PB14 +-#define AT91C_PB14_ERX3 ((unsigned int) AT91C_PIO_PB14) // Ethernet MAC Receive Data 3 +-#define AT91C_PB14_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PB14) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PIO_PB15 ((unsigned int) 1 << 15) // Pin Controlled by PB15 +-#define AT91C_PB15_ERXDV_ECRSDV ((unsigned int) AT91C_PIO_PB15) // Ethernet MAC Receive Data Valid +-#define AT91C_PIO_PB16 ((unsigned int) 1 << 16) // Pin Controlled by PB16 +-#define AT91C_PB16_ECOL ((unsigned int) AT91C_PIO_PB16) // Ethernet MAC Collision Detected +-#define AT91C_PB16_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PB16) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PB17 ((unsigned int) 1 << 17) // Pin Controlled by PB17 +-#define AT91C_PB17_ERXCK ((unsigned int) AT91C_PIO_PB17) // Ethernet MAC Receive Clock +-#define AT91C_PB17_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PB17) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PIO_PB18 ((unsigned int) 1 << 18) // Pin Controlled by PB18 +-#define AT91C_PB18_EF100 ((unsigned int) AT91C_PIO_PB18) // Ethernet MAC Force 100 Mbits/sec +-#define AT91C_PB18_ADTRG ((unsigned int) AT91C_PIO_PB18) // ADC External Trigger +-#define AT91C_PIO_PB19 ((unsigned int) 1 << 19) // Pin Controlled by PB19 +-#define AT91C_PB19_PWM0 ((unsigned int) AT91C_PIO_PB19) // PWM Channel 0 +-#define AT91C_PB19_TCLK1 ((unsigned int) AT91C_PIO_PB19) // Timer Counter 1 external clock input +-#define AT91C_PIO_PB2 ((unsigned int) 1 << 2) // Pin Controlled by PB2 +-#define AT91C_PB2_ETX0 ((unsigned int) AT91C_PIO_PB2) // Ethernet MAC Transmit Data 0 +-#define AT91C_PIO_PB20 ((unsigned int) 1 << 20) // Pin Controlled by PB20 +-#define AT91C_PB20_PWM1 ((unsigned int) AT91C_PIO_PB20) // PWM Channel 1 +-#define AT91C_PB20_PCK0 ((unsigned int) AT91C_PIO_PB20) // PMC Programmable Clock Output 0 +-#define AT91C_PIO_PB21 ((unsigned int) 1 << 21) // Pin Controlled by PB21 +-#define AT91C_PB21_PWM2 ((unsigned int) AT91C_PIO_PB21) // PWM Channel 2 +-#define AT91C_PB21_PCK1 ((unsigned int) AT91C_PIO_PB21) // PMC Programmable Clock Output 1 +-#define AT91C_PIO_PB22 ((unsigned int) 1 << 22) // Pin Controlled by PB22 +-#define AT91C_PB22_PWM3 ((unsigned int) AT91C_PIO_PB22) // PWM Channel 3 +-#define AT91C_PB22_PCK2 ((unsigned int) AT91C_PIO_PB22) // PMC Programmable Clock Output 2 +-#define AT91C_PIO_PB23 ((unsigned int) 1 << 23) // Pin Controlled by PB23 +-#define AT91C_PB23_TIOA0 ((unsigned int) AT91C_PIO_PB23) // Timer Counter 0 Multipurpose Timer I/O Pin A +-#define AT91C_PB23_DCD1 ((unsigned int) AT91C_PIO_PB23) // USART 1 Data Carrier Detect +-#define AT91C_PIO_PB24 ((unsigned int) 1 << 24) // Pin Controlled by PB24 +-#define AT91C_PB24_TIOB0 ((unsigned int) AT91C_PIO_PB24) // Timer Counter 0 Multipurpose Timer I/O Pin B +-#define AT91C_PB24_DSR1 ((unsigned int) AT91C_PIO_PB24) // USART 1 Data Set ready +-#define AT91C_PIO_PB25 ((unsigned int) 1 << 25) // Pin Controlled by PB25 +-#define AT91C_PB25_TIOA1 ((unsigned int) AT91C_PIO_PB25) // Timer Counter 1 Multipurpose Timer I/O Pin A +-#define AT91C_PB25_DTR1 ((unsigned int) AT91C_PIO_PB25) // USART 1 Data Terminal ready +-#define AT91C_PIO_PB26 ((unsigned int) 1 << 26) // Pin Controlled by PB26 +-#define AT91C_PB26_TIOB1 ((unsigned int) AT91C_PIO_PB26) // Timer Counter 1 Multipurpose Timer I/O Pin B +-#define AT91C_PB26_RI1 ((unsigned int) AT91C_PIO_PB26) // USART 1 Ring Indicator +-#define AT91C_PIO_PB27 ((unsigned int) 1 << 27) // Pin Controlled by PB27 +-#define AT91C_PB27_TIOA2 ((unsigned int) AT91C_PIO_PB27) // Timer Counter 2 Multipurpose Timer I/O Pin A +-#define AT91C_PB27_PWM0 ((unsigned int) AT91C_PIO_PB27) // PWM Channel 0 +-#define AT91C_PIO_PB28 ((unsigned int) 1 << 28) // Pin Controlled by PB28 +-#define AT91C_PB28_TIOB2 ((unsigned int) AT91C_PIO_PB28) // Timer Counter 2 Multipurpose Timer I/O Pin B +-#define AT91C_PB28_PWM1 ((unsigned int) AT91C_PIO_PB28) // PWM Channel 1 +-#define AT91C_PIO_PB29 ((unsigned int) 1 << 29) // Pin Controlled by PB29 +-#define AT91C_PB29_PCK1 ((unsigned int) AT91C_PIO_PB29) // PMC Programmable Clock Output 1 +-#define AT91C_PB29_PWM2 ((unsigned int) AT91C_PIO_PB29) // PWM Channel 2 +-#define AT91C_PIO_PB3 ((unsigned int) 1 << 3) // Pin Controlled by PB3 +-#define AT91C_PB3_ETX1 ((unsigned int) AT91C_PIO_PB3) // Ethernet MAC Transmit Data 1 +-#define AT91C_PIO_PB30 ((unsigned int) 1 << 30) // Pin Controlled by PB30 +-#define AT91C_PB30_PCK2 ((unsigned int) AT91C_PIO_PB30) // PMC Programmable Clock Output 2 +-#define AT91C_PB30_PWM3 ((unsigned int) AT91C_PIO_PB30) // PWM Channel 3 +-#define AT91C_PIO_PB4 ((unsigned int) 1 << 4) // Pin Controlled by PB4 +-#define AT91C_PB4_ECRS ((unsigned int) AT91C_PIO_PB4) // Ethernet MAC Carrier Sense/Carrier Sense and Data Valid +-#define AT91C_PIO_PB5 ((unsigned int) 1 << 5) // Pin Controlled by PB5 +-#define AT91C_PB5_ERX0 ((unsigned int) AT91C_PIO_PB5) // Ethernet MAC Receive Data 0 +-#define AT91C_PIO_PB6 ((unsigned int) 1 << 6) // Pin Controlled by PB6 +-#define AT91C_PB6_ERX1 ((unsigned int) AT91C_PIO_PB6) // Ethernet MAC Receive Data 1 +-#define AT91C_PIO_PB7 ((unsigned int) 1 << 7) // Pin Controlled by PB7 +-#define AT91C_PB7_ERXER ((unsigned int) AT91C_PIO_PB7) // Ethernet MAC Receive Error +-#define AT91C_PIO_PB8 ((unsigned int) 1 << 8) // Pin Controlled by PB8 +-#define AT91C_PB8_EMDC ((unsigned int) AT91C_PIO_PB8) // Ethernet MAC Management Data Clock +-#define AT91C_PIO_PB9 ((unsigned int) 1 << 9) // Pin Controlled by PB9 +-#define AT91C_PB9_EMDIO ((unsigned int) AT91C_PIO_PB9) // Ethernet MAC Management Data Input/Output +- +-// ***************************************************************************** +-// PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_ID_FIQ ((unsigned int) 0) // Advanced Interrupt Controller (FIQ) +-#define AT91C_ID_SYS ((unsigned int) 1) // System Peripheral +-#define AT91C_ID_PIOA ((unsigned int) 2) // Parallel IO Controller A +-#define AT91C_ID_PIOB ((unsigned int) 3) // Parallel IO Controller B +-#define AT91C_ID_SPI0 ((unsigned int) 4) // Serial Peripheral Interface 0 +-#define AT91C_ID_SPI1 ((unsigned int) 5) // Serial Peripheral Interface 1 +-#define AT91C_ID_US0 ((unsigned int) 6) // USART 0 +-#define AT91C_ID_US1 ((unsigned int) 7) // USART 1 +-#define AT91C_ID_SSC ((unsigned int) 8) // Serial Synchronous Controller +-#define AT91C_ID_TWI ((unsigned int) 9) // Two-Wire Interface +-#define AT91C_ID_PWMC ((unsigned int) 10) // PWM Controller +-#define AT91C_ID_UDP ((unsigned int) 11) // USB Device Port +-#define AT91C_ID_TC0 ((unsigned int) 12) // Timer Counter 0 +-#define AT91C_ID_TC1 ((unsigned int) 13) // Timer Counter 1 +-#define AT91C_ID_TC2 ((unsigned int) 14) // Timer Counter 2 +-#define AT91C_ID_CAN ((unsigned int) 15) // Control Area Network Controller +-#define AT91C_ID_EMAC ((unsigned int) 16) // Ethernet MAC +-#define AT91C_ID_ADC ((unsigned int) 17) // Analog-to-Digital Converter +-#define AT91C_ID_18_Reserved ((unsigned int) 18) // Reserved +-#define AT91C_ID_19_Reserved ((unsigned int) 19) // Reserved +-#define AT91C_ID_20_Reserved ((unsigned int) 20) // Reserved +-#define AT91C_ID_21_Reserved ((unsigned int) 21) // Reserved +-#define AT91C_ID_22_Reserved ((unsigned int) 22) // Reserved +-#define AT91C_ID_23_Reserved ((unsigned int) 23) // Reserved +-#define AT91C_ID_24_Reserved ((unsigned int) 24) // Reserved +-#define AT91C_ID_25_Reserved ((unsigned int) 25) // Reserved +-#define AT91C_ID_26_Reserved ((unsigned int) 26) // Reserved +-#define AT91C_ID_27_Reserved ((unsigned int) 27) // Reserved +-#define AT91C_ID_28_Reserved ((unsigned int) 28) // Reserved +-#define AT91C_ID_29_Reserved ((unsigned int) 29) // Reserved +-#define AT91C_ID_IRQ0 ((unsigned int) 30) // Advanced Interrupt Controller (IRQ0) +-#define AT91C_ID_IRQ1 ((unsigned int) 31) // Advanced Interrupt Controller (IRQ1) +-#define AT91C_ALL_INT ((unsigned int) 0xC003FFFF) // ALL VALID INTERRUPTS +- +-// ***************************************************************************** +-// BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +- +-#ifdef TEST +- +-extern AT91S_AIC AicPeripheral; +-extern AT91S_PIO PioAPeripheral; +-extern AT91S_PIO PioBPeripheral; +-extern AT91S_PMC PmcPeripheral; +-extern AT91S_USART Usart0Peripheral; +-extern AT91S_TC TimerCounter0Peripheral; +-extern AT91S_ADC AdcPeripheral; +- +-#define AIC_ADDR &AicPeripheral +-#define PIOA_ADDR &PioAPeripheral +-#define PIOB_ADDR &PioBPeripheral +-#define PMC_ADDR &PmcPeripheral +-#define US0_ADDR &Usart0Peripheral +-#define TC0_ADDR &TimerCounter0Peripheral +-#define ADC_ADDR &AdcPeripheral +- +-#else +- +-#define AIC_ADDR 0xFFFFF000 +-#define PIOA_ADDR 0xFFFFF400 +-#define PIOB_ADDR 0xFFFFF600 +-#define PMC_ADDR 0xFFFFFC00 +-#define US0_ADDR 0xFFFC0000 +-#define TC0_ADDR 0xFFFA0000 +-#define ADC_ADDR 0xFFFD8000 +- +-#endif // TEST +- +-#define AT91C_BASE_SYS ((AT91PS_SYS) 0xFFFFF000) // (SYS) Base Address +-#define AT91C_BASE_AIC ((AT91PS_AIC) AIC_ADDR) // (AIC) Base Address +-#define AT91C_BASE_PDC_DBGU ((AT91PS_PDC) 0xFFFFF300) // (PDC_DBGU) Base Address +-#define AT91C_BASE_DBGU ((AT91PS_DBGU) 0xFFFFF200) // (DBGU) Base Address +-#define AT91C_BASE_PIOA ((AT91PS_PIO) PIOA_ADDR) // (PIOA) Base Address +-#define AT91C_BASE_PIOB ((AT91PS_PIO) PIOB_ADDR) // (PIOB) Base Address +-#define AT91C_BASE_PMC ((AT91PS_PMC) PMC_ADDR) // (PMC) Base Address +-#define AT91C_BASE_CKGR ((AT91PS_CKGR) 0xFFFFFC20) // (CKGR) Base Address +-#define AT91C_BASE_RSTC ((AT91PS_RSTC) 0xFFFFFD00) // (RSTC) Base Address +-#define AT91C_BASE_RTTC ((AT91PS_RTTC) 0xFFFFFD20) // (RTTC) Base Address +-#define AT91C_BASE_PITC ((AT91PS_PITC) 0xFFFFFD30) // (PITC) Base Address +-#define AT91C_BASE_WDTC ((AT91PS_WDTC) 0xFFFFFD40) // (WDTC) Base Address +-#define AT91C_BASE_VREG ((AT91PS_VREG) 0xFFFFFD60) // (VREG) Base Address +-#define AT91C_BASE_MC ((AT91PS_MC) 0xFFFFFF00) // (MC) Base Address +-#define AT91C_BASE_PDC_SPI1 ((AT91PS_PDC) 0xFFFE4100) // (PDC_SPI1) Base Address +-#define AT91C_BASE_SPI1 ((AT91PS_SPI) 0xFFFE4000) // (SPI1) Base Address +-#define AT91C_BASE_PDC_SPI0 ((AT91PS_PDC) 0xFFFE0100) // (PDC_SPI0) Base Address +-#define AT91C_BASE_SPI0 ((AT91PS_SPI) 0xFFFE0000) // (SPI0) Base Address +-#define AT91C_BASE_PDC_US1 ((AT91PS_PDC) 0xFFFC4100) // (PDC_US1) Base Address +-#define AT91C_BASE_US1 ((AT91PS_USART) 0xFFFC4000) // (US1) Base Address +-#define AT91C_BASE_PDC_US0 ((AT91PS_PDC) 0xFFFC0100) // (PDC_US0) Base Address +-#define AT91C_BASE_US0 ((AT91PS_USART) US0_ADDR) // (US0) Base Address +-#define AT91C_BASE_PDC_SSC ((AT91PS_PDC) 0xFFFD4100) // (PDC_SSC) Base Address +-#define AT91C_BASE_SSC ((AT91PS_SSC) 0xFFFD4000) // (SSC) Base Address +-#define AT91C_BASE_TWI ((AT91PS_TWI) 0xFFFB8000) // (TWI) Base Address +-#define AT91C_BASE_PWMC_CH3 ((AT91PS_PWMC_CH) 0xFFFCC260) // (PWMC_CH3) Base Address +-#define AT91C_BASE_PWMC_CH2 ((AT91PS_PWMC_CH) 0xFFFCC240) // (PWMC_CH2) Base Address +-#define AT91C_BASE_PWMC_CH1 ((AT91PS_PWMC_CH) 0xFFFCC220) // (PWMC_CH1) Base Address +-#define AT91C_BASE_PWMC_CH0 ((AT91PS_PWMC_CH) 0xFFFCC200) // (PWMC_CH0) Base Address +-#define AT91C_BASE_PWMC ((AT91PS_PWMC) 0xFFFCC000) // (PWMC) Base Address +-#define AT91C_BASE_UDP ((AT91PS_UDP) 0xFFFB0000) // (UDP) Base Address +-#define AT91C_BASE_TC0 ((AT91PS_TC) TC0_ADDR) // (TC0) Base Address +-#define AT91C_BASE_TC1 ((AT91PS_TC) 0xFFFA0040) // (TC1) Base Address +-#define AT91C_BASE_TC2 ((AT91PS_TC) 0xFFFA0080) // (TC2) Base Address +-#define AT91C_BASE_TCB ((AT91PS_TCB) 0xFFFA0000) // (TCB) Base Address +-#define AT91C_BASE_CAN_MB0 ((AT91PS_CAN_MB) 0xFFFD0200) // (CAN_MB0) Base Address +-#define AT91C_BASE_CAN_MB1 ((AT91PS_CAN_MB) 0xFFFD0220) // (CAN_MB1) Base Address +-#define AT91C_BASE_CAN_MB2 ((AT91PS_CAN_MB) 0xFFFD0240) // (CAN_MB2) Base Address +-#define AT91C_BASE_CAN_MB3 ((AT91PS_CAN_MB) 0xFFFD0260) // (CAN_MB3) Base Address +-#define AT91C_BASE_CAN_MB4 ((AT91PS_CAN_MB) 0xFFFD0280) // (CAN_MB4) Base Address +-#define AT91C_BASE_CAN_MB5 ((AT91PS_CAN_MB) 0xFFFD02A0) // (CAN_MB5) Base Address +-#define AT91C_BASE_CAN_MB6 ((AT91PS_CAN_MB) 0xFFFD02C0) // (CAN_MB6) Base Address +-#define AT91C_BASE_CAN_MB7 ((AT91PS_CAN_MB) 0xFFFD02E0) // (CAN_MB7) Base Address +-#define AT91C_BASE_CAN ((AT91PS_CAN) 0xFFFD0000) // (CAN) Base Address +-#define AT91C_BASE_ADC ((AT91PS_ADC) ADC_ADDR) // (ADC) Base Address +-#define AT91C_BASE_EMAC ((AT91PS_EMAC) 0xFFFDC000) // (EMAC) Base Address +-#define AT91C_BASE_PDC_ADC ((AT91PS_PDC) 0xFFFD8100) // (PDC_ADC) Base Address +- +-// ***************************************************************************** +-// MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-// ISRAM +-#define AT91C_ISRAM ((char *) 0x00200000) // Internal SRAM base address +-#define AT91C_ISRAM_SIZE ((unsigned int) 0x00010000) // Internal SRAM size in byte (64 Kbytes) +-// IFLASH +-#define AT91C_IFLASH ((char *) 0x00100000) // Internal FLASH base address +-#define AT91C_IFLASH_SIZE ((unsigned int) 0x00040000) // Internal FLASH size in byte (256 Kbytes) +-#define AT91C_IFLASH_PAGE_SIZE ((unsigned int) 256) // Internal FLASH Page Size: 256 bytes +-#define AT91C_IFLASH_LOCK_REGION_SIZE ((unsigned int) 16384) // Internal FLASH Lock Region Size: 16 Kbytes +-#define AT91C_IFLASH_NB_OF_PAGES ((unsigned int) 1024) // Internal FLASH Number of Pages: 1024 bytes +-#define AT91C_IFLASH_NB_OF_LOCK_BITS ((unsigned int) 16) // Internal FLASH Number of Lock Bits: 16 bytes +- +-#endif +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.c +deleted file mode 100644 +index 28d9d20cf3..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.c ++++ /dev/null +@@ -1,42 +0,0 @@ +-#include "Types.h" +-#include "AdcConductor.h" +-#include "AdcModel.h" +-#include "AdcHardware.h" +- +-void AdcConductor_Init(void) +-{ +- AdcHardware_Init(); +-} +- +-void AdcConductor_Run(void) +-{ +- if (AdcModel_DoGetSample() && AdcHardware_GetSampleComplete()) +- { +- AdcModel_ProcessInput(AdcHardware_GetSample()); +- AdcHardware_StartConversion(); +- } +-} +- +-bool AdcConductor_JustHereToTest(void) +-{ +- EXAMPLE_STRUCT_T ExampleStruct; +- ExampleStruct.x = 5; +- ExampleStruct.y = 7; +- +- return AdcModel_DoNothingExceptTestASpecialType(ExampleStruct); +-} +- +-bool AdcConductor_AlsoHereToTest(void) +-{ +- EXAMPLE_STRUCT_T example = AdcModel_DoNothingExceptReturnASpecialType(); +- +- return ((example.x == 99) && (example.y == 1)); +-} +- +-bool AdcConductor_YetAnotherTest(void) +-{ +- uint32 example = 3; +- +- return AdModel_DoNothingExceptTestPointers(&example); +-} +- +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.h +deleted file mode 100644 +index 4280da3cf7..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcConductor.h ++++ /dev/null +@@ -1,11 +0,0 @@ +-#ifndef _ADCCONDUCTOR_H +-#define _ADCCONDUCTOR_H +- +-void AdcConductor_Init(void); +-void AdcConductor_Run(void); +- +-bool AdcConductor_JustHereToTest(void); +-bool AdcConductor_AlsoHereToTest(void); +-bool AdcConductor_YetAnotherTest(void); +- +-#endif // _ADCCONDUCTOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.c +deleted file mode 100644 +index 9807641171..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.c ++++ /dev/null +@@ -1,27 +0,0 @@ +-#include "Types.h" +-#include "AdcHardware.h" +-#include "AdcHardwareConfigurator.h" +-#include "AdcTemperatureSensor.h" +- +-void AdcHardware_Init(void) +-{ +- Adc_Reset(); +- Adc_ConfigureMode(); +- Adc_EnableTemperatureChannel(); +- Adc_StartTemperatureSensorConversion(); +-} +- +-void AdcHardware_StartConversion(void) +-{ +- Adc_StartTemperatureSensorConversion(); +-} +- +-bool AdcHardware_GetSampleComplete(void) +-{ +- return Adc_TemperatureSensorSampleReady(); +-} +- +-uint16 AdcHardware_GetSample(void) +-{ +- return Adc_ReadTemperatureSensor(); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.h +deleted file mode 100644 +index 3209a4c2a7..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardware.h ++++ /dev/null +@@ -1,9 +0,0 @@ +-#ifndef _ADCHARDWARE_H +-#define _ADCHARDWARE_H +- +-void AdcHardware_Init(void); +-void AdcHardware_StartConversion(void); +-bool AdcHardware_GetSampleComplete(void); +-uint16 AdcHardware_GetSample(void); +- +-#endif // _ADCHARDWARE_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.c +deleted file mode 100644 +index f7e08a2398..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.c ++++ /dev/null +@@ -1,18 +0,0 @@ +-#include "Types.h" +-#include "AdcHardwareConfigurator.h" +-#include "ModelConfig.h" +- +-void Adc_Reset(void) +-{ +- AT91C_BASE_ADC->ADC_CR = AT91C_ADC_SWRST; +-} +- +-void Adc_ConfigureMode(void) +-{ +- AT91C_BASE_ADC->ADC_MR = (((uint32)11) << 8) | (((uint32)4) << 16); +-} +- +-void Adc_EnableTemperatureChannel(void) +-{ +- AT91C_BASE_ADC->ADC_CHER = 0x10; +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.h +deleted file mode 100644 +index 78b9e9fcfb..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.h ++++ /dev/null +@@ -1,10 +0,0 @@ +-#ifndef _ADCHARDWARECONFIGURATOR_H +-#define _ADCHARDWARECONFIGURATOR_H +- +-#include "Types.h" +- +-void Adc_Reset(void); +-void Adc_ConfigureMode(void); +-void Adc_EnableTemperatureChannel(void); +- +-#endif // _ADCHARDWARECONFIGURATOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.c b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.c +deleted file mode 100644 +index ad9111d2c1..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.c ++++ /dev/null +@@ -1,33 +0,0 @@ +-#include "AdcModel.h" +-#include "TaskScheduler.h" +-#include "TemperatureCalculator.h" +-#include "TemperatureFilter.h" +- +-bool AdcModel_DoGetSample(void) +-{ +- return TaskScheduler_DoAdc(); +-} +- +-void AdcModel_ProcessInput(uint16 millivolts) +-{ +- TemperatureFilter_ProcessInput(TemperatureCalculator_Calculate(millivolts)); +-} +- +-bool AdcModel_DoNothingExceptTestASpecialType(EXAMPLE_STRUCT_T ExampleStruct) +-{ +- //This doesn't really do anything. it's only here to make sure I can compare a struct. +- return FALSE; +-} +-bool AdModel_DoNothingExceptTestPointers(uint32* pExample) +-{ +- //This doesn't really do anything. it's only here to make sure I can compare a pointer value. +- return FALSE; +-} +- +-EXAMPLE_STRUCT_T AdcModel_DoNothingExceptReturnASpecialType(void) +-{ +- EXAMPLE_STRUCT_T example; //again, this just is here to test that I can return a struct +- example.x = 99; +- example.y = 1; +- return example; +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.h +deleted file mode 100644 +index 6b871fdbff..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcModel.h ++++ /dev/null +@@ -1,13 +0,0 @@ +-#ifndef _ADCMODEL_H +-#define _ADCMODEL_H +- +-#include "Types.h" +- +-bool AdcModel_DoGetSample(void); +-void AdcModel_ProcessInput(uint16 millivolts); +- +-bool AdcModel_DoNothingExceptTestASpecialType(EXAMPLE_STRUCT_T ExampleStruct); +-bool AdModel_DoNothingExceptTestPointers(uint32* pExample); +-EXAMPLE_STRUCT_T AdcModel_DoNothingExceptReturnASpecialType(void); +- +-#endif // _ADCMODEL_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.c b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.c +deleted file mode 100644 +index b2a3f2c135..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.c ++++ /dev/null +@@ -1,51 +0,0 @@ +-#include "Types.h" +-#include "AdcTemperatureSensor.h" +- +-static inline uint32 ConvertAdcCountsToPicovolts(uint32 counts); +-static inline uint16 ConvertPicovoltsToMillivolts(uint32 picovolts); +- +-// +-// PUBLIC METHODS +-// +- +-void Adc_StartTemperatureSensorConversion(void) +-{ +- AT91C_BASE_ADC->ADC_CR = AT91C_ADC_START; +-} +- +-bool Adc_TemperatureSensorSampleReady(void) +-{ +- return ((AT91C_BASE_ADC->ADC_SR & AT91C_ADC_EOC4) == AT91C_ADC_EOC4); +-} +- +-uint16 Adc_ReadTemperatureSensor(void) +-{ +- uint32 picovolts = ConvertAdcCountsToPicovolts(AT91C_BASE_ADC->ADC_CDR4); +- return ConvertPicovoltsToMillivolts(picovolts); +-} +- +-// +-// PRIVATE HELPERS +-// +- +-static inline uint32 ConvertAdcCountsToPicovolts(uint32 counts) +-{ +- // ADC bit weight at 10-bit resolution with 3.0V reference = 2.9296875 mV/LSB +- uint32 picovoltsPerAdcCount = 2929688; +- +- // Shift decimal point by 6 places to preserve accuracy in fixed-point math +- return counts * picovoltsPerAdcCount; +-} +- +-static inline uint16 ConvertPicovoltsToMillivolts(uint32 picovolts) +-{ +- const uint32 halfMillivoltInPicovolts = 500000; +- const uint32 picovoltsPerMillivolt = 1000000; +- +- // Add 0.5 mV to result so that truncation yields properly rounded result +- picovolts += halfMillivoltInPicovolts; +- +- // Divide appropriately to convert to millivolts +- return (uint16)(picovolts / picovoltsPerMillivolt); +-} +- +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.h b/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.h +deleted file mode 100644 +index bf2cc5b0d5..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/AdcTemperatureSensor.h ++++ /dev/null +@@ -1,10 +0,0 @@ +-#ifndef _ADCTEMPERATURESENSOR_H +-#define _ADCTEMPERATURESENSOR_H +- +-#include "Types.h" +- +-void Adc_StartTemperatureSensorConversion(void); +-bool Adc_TemperatureSensorSampleReady(void); +-uint16 Adc_ReadTemperatureSensor(void); +- +-#endif // _ADCTEMPERATURESENSOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.c b/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.c +deleted file mode 100644 +index 7e45c3e57e..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.c ++++ /dev/null +@@ -1,25 +0,0 @@ +-#include "Types.h" +-#include "Executor.h" +-#include "Model.h" +-#include "UsartConductor.h" +-#include "TimerConductor.h" +-#include "AdcConductor.h" +-#include "IntrinsicsWrapper.h" +- +- +-void Executor_Init(void) +-{ +- Model_Init(); +- UsartConductor_Init(); +- AdcConductor_Init(); +- TimerConductor_Init(); +- Interrupt_Enable(); +-} +- +-bool Executor_Run(void) +-{ +- UsartConductor_Run(); +- TimerConductor_Run(); +- AdcConductor_Run(); +- return TRUE; +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.h b/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.h +deleted file mode 100644 +index 51a61a97ee..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/Executor.h ++++ /dev/null +@@ -1,9 +0,0 @@ +-#ifndef _EXECUTOR_H +-#define _EXECUTOR_H +- +-#include "Types.h" +- +-void Executor_Init(void); +-bool Executor_Run(void); +- +-#endif // _EXECUTOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.c b/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.c +deleted file mode 100644 +index 8b082aef44..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.c ++++ /dev/null +@@ -1,18 +0,0 @@ +-#include "IntrinsicsWrapper.h" +-#ifdef __ICCARM__ +-#include +-#endif +- +-void Interrupt_Enable(void) +-{ +-#ifdef __ICCARM__ +- __enable_interrupt(); +-#endif +-} +- +-void Interrupt_Disable(void) +-{ +-#ifdef __ICCARM__ +- __disable_interrupt(); +-#endif +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.h b/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.h +deleted file mode 100644 +index 9273317cda..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/IntrinsicsWrapper.h ++++ /dev/null +@@ -1,7 +0,0 @@ +-#ifndef _INTRINSICS_WRAPPER_H +-#define _INTRINSICS_WRAPPER_H +- +-void Interrupt_Enable(void); +-void Interrupt_Disable(void); +- +-#endif // _INTRINSICS_WRAPPER_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Main.c b/components/testframework/libs/cmock/examples/temp_sensor/src/Main.c +deleted file mode 100644 +index a784f4759d..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/Main.c ++++ /dev/null +@@ -1,46 +0,0 @@ +-#include "Types.h" +- +-#include "IntrinsicsWrapper.h" +-#include "Executor.h" +- +-#include "Model.h" +-#include "TaskScheduler.h" +-#include "TemperatureCalculator.h" +-#include "TemperatureFilter.h" +- +-#include "UsartConductor.h" +-#include "UsartHardware.h" +-#include "UsartConfigurator.h" +-#include "UsartPutChar.h" +-#include "UsartModel.h" +-#include "UsartBaudRateRegisterCalculator.h" +-#include "UsartTransmitBufferStatus.h" +- +-#include "TimerConductor.h" +-#include "TimerHardware.h" +-#include "TimerConfigurator.h" +-#include "TimerInterruptConfigurator.h" +-#include "TimerInterruptHandler.h" +-#include "TimerModel.h" +- +-#include "AdcConductor.h" +-#include "AdcHardware.h" +-#include "AdcHardwareConfigurator.h" +-#include "AdcTemperatureSensor.h" +-#include "AdcModel.h" +- +-int AppMain(void) +-{ +- Executor_Init(); +- +- while(Executor_Run()); +- +- return 0; +-} +- +-#ifndef TEST +-int main(void) +-{ +- return AppMain(); +-} +-#endif // TEST +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Main.h b/components/testframework/libs/cmock/examples/temp_sensor/src/Main.h +deleted file mode 100644 +index 6cbe5f43a4..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/Main.h ++++ /dev/null +@@ -1,7 +0,0 @@ +-#ifndef _MAIN_H_ +-#define _MAIN_H_ +- +-int AppMain(void); +-int main(void); +- +-#endif // _MAIN_H_ +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Model.c b/components/testframework/libs/cmock/examples/temp_sensor/src/Model.c +deleted file mode 100644 +index 5b34c40cd9..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/Model.c ++++ /dev/null +@@ -1,10 +0,0 @@ +-#include "Model.h" +-#include "TaskScheduler.h" +-#include "TemperatureFilter.h" +- +-void Model_Init(void) +-{ +- TaskScheduler_Init(); +- TemperatureFilter_Init(); +-} +- +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Model.h b/components/testframework/libs/cmock/examples/temp_sensor/src/Model.h +deleted file mode 100644 +index d1309387d7..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/Model.h ++++ /dev/null +@@ -1,8 +0,0 @@ +-#ifndef _MODEL_H +-#define _MODEL_H +- +-#include "Types.h" +- +-void Model_Init(void); +- +-#endif // _MODEL_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/ModelConfig.h b/components/testframework/libs/cmock/examples/temp_sensor/src/ModelConfig.h +deleted file mode 100644 +index edc8e8d4ba..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/ModelConfig.h ++++ /dev/null +@@ -1,7 +0,0 @@ +-#ifndef _MODELCONFIG_H +-#define _MODELCONFIG_H +- +-#define MASTER_CLOCK 48054857 // Master Clock +-#define USART0_BAUDRATE 115200 // USART Baudrate +- +-#endif // _MODELCONFIG_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.c +deleted file mode 100644 +index bcc0e64369..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.c ++++ /dev/null +@@ -1,72 +0,0 @@ +-#include "Types.h" +-#include "TaskScheduler.h" +- +-typedef struct _Task +-{ +- bool doIt; +- uint32 period; +- uint32 startTime; +-} Task; +- +-typedef struct _TaskSchedulerInstance +-{ +- Task usart; +- Task adc; +-} TaskSchedulerInstance; +- +-static TaskSchedulerInstance this; +- +-void TaskScheduler_Init(void) +-{ +- this.usart.doIt = FALSE; +- this.usart.startTime = 0; +- +- //The correct period +- this.usart.period = 1000; +- +- this.adc.doIt = FALSE; +- this.adc.startTime = 0; +- this.adc.period = 100; +-} +- +-void TaskScheduler_Update(uint32 time) +-{ +- if ((time - this.usart.startTime) >= this.usart.period) +- { +- this.usart.doIt = TRUE; +- this.usart.startTime = time - (time % this.usart.period); +- } +- +- if ((time - this.adc.startTime) >= this.adc.period) +- { +- this.adc.doIt = TRUE; +- this.adc.startTime = time - (time % this.adc.period); +- } +-} +- +-bool TaskScheduler_DoUsart(void) +-{ +- bool doIt = FALSE; +- +- if (this.usart.doIt) +- { +- doIt = TRUE; +- this.usart.doIt = FALSE; +- } +- +- return doIt; +-} +- +-bool TaskScheduler_DoAdc(void) +-{ +- bool doIt = FALSE; +- +- if (this.adc.doIt) +- { +- doIt = TRUE; +- this.adc.doIt = FALSE; +- } +- +- return doIt; +-} +- +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.h +deleted file mode 100644 +index cc58342c5f..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TaskScheduler.h ++++ /dev/null +@@ -1,11 +0,0 @@ +-#ifndef _TASKSCHEDULER_H +-#define _TASKSCHEDULER_H +- +-#include "Types.h" +- +-void TaskScheduler_Init(void); +-void TaskScheduler_Update(uint32 time); +-bool TaskScheduler_DoUsart(void); +-bool TaskScheduler_DoAdc(void); +- +-#endif // _TASKSCHEDULER_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.c +deleted file mode 100644 +index 04cec59d47..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.c ++++ /dev/null +@@ -1,27 +0,0 @@ +-#include "Types.h" +-#include "TemperatureCalculator.h" +-#include +- +-#ifndef logl +-#define logl log +-#endif +- +-float TemperatureCalculator_Calculate(uint16 millivolts) +-{ +- const double supply_voltage = 3.0; +- const double series_resistance = 5000; +- const double coefficient_A = 316589.698; +- const double coefficient_B = -0.1382009; +- double sensor_voltage = ((double)millivolts / 1000); +- double resistance; +- +- if (millivolts == 0) +- { +- return -INFINITY; +- } +- +- // Series resistor is 5k Ohms; Reference voltage is 3.0V +- // R(t) = A * e^(B*t); R is resistance of thermisor; t is temperature in C +- resistance = ((supply_voltage * series_resistance) / sensor_voltage) - series_resistance; +- return (float)(logl(resistance / coefficient_A) / coefficient_B); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.h +deleted file mode 100644 +index b606c2d40f..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureCalculator.h ++++ /dev/null +@@ -1,6 +0,0 @@ +-#ifndef _TEMPERATURECALCULATOR_H +-#define _TEMPERATURECALCULATOR_H +- +-float TemperatureCalculator_Calculate(uint16 millivolts); +- +-#endif // _TEMPERATURECALCULATOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.c +deleted file mode 100644 +index 02fc045061..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.c ++++ /dev/null +@@ -1,39 +0,0 @@ +-#include "Types.h" +-#include "TemperatureFilter.h" +-#include +- +-static bool initialized; +-static float temperatureInCelcius; +- +-void TemperatureFilter_Init(void) +-{ +- initialized = FALSE; +- temperatureInCelcius = -INFINITY; +-} +- +-float TemperatureFilter_GetTemperatureInCelcius(void) +-{ +- return temperatureInCelcius; +-} +- +-void TemperatureFilter_ProcessInput(float temperature) +-{ +- if (!initialized) +- { +- temperatureInCelcius = temperature; +- initialized = TRUE; +- } +- else +- { +- if (temperature == +INFINITY || +- temperature == -INFINITY || +- temperature == +NAN || +- temperature == -NAN) +- { +- initialized = FALSE; +- temperature = -INFINITY; +- } +- +- temperatureInCelcius = (temperatureInCelcius * 0.75f) + (temperature * 0.25); +- } +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.h +deleted file mode 100644 +index 31413f491f..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TemperatureFilter.h ++++ /dev/null +@@ -1,10 +0,0 @@ +-#ifndef _TEMPERATUREFILTER_H +-#define _TEMPERATUREFILTER_H +- +-#include "Types.h" +- +-void TemperatureFilter_Init(void); +-float TemperatureFilter_GetTemperatureInCelcius(void); +-void TemperatureFilter_ProcessInput(float temperature); +- +-#endif // _TEMPERATUREFILTER_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.c +deleted file mode 100644 +index 569b489a0b..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.c ++++ /dev/null +@@ -1,15 +0,0 @@ +-#include "Types.h" +-#include "TimerConductor.h" +-#include "TimerModel.h" +-#include "TimerHardware.h" +-#include "TimerInterruptHandler.h" +- +-void TimerConductor_Init(void) +-{ +- TimerHardware_Init(); +-} +- +-void TimerConductor_Run(void) +-{ +- TimerModel_UpdateTime(Timer_GetSystemTime()); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.h +deleted file mode 100644 +index 7cd4109705..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConductor.h ++++ /dev/null +@@ -1,9 +0,0 @@ +-#ifndef _TIMERCONDUCTOR_H +-#define _TIMERCONDUCTOR_H +- +-#include "Types.h" +- +-void TimerConductor_Init(void); +-void TimerConductor_Run(void); +- +-#endif // _TIMERCONDUCTOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.c +deleted file mode 100644 +index 996cedefbd..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.c ++++ /dev/null +@@ -1,51 +0,0 @@ +-#include "Types.h" +-#include "TimerConfigurator.h" +-#include "TimerInterruptConfigurator.h" +- +-void Timer_EnablePeripheralClocks(void) +-{ +- AT91C_BASE_PMC->PMC_PCER = TIMER0_CLOCK_ENABLE | PIOB_CLOCK_ENABLE; +-} +- +-void Timer_Reset(void) +-{ +- uint32 dummy; +- AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKDIS; +- AT91C_BASE_TC0->TC_IDR = 0xffffffff; +- dummy = AT91C_BASE_TC0->TC_SR; +- dummy = dummy; +-} +- +-void Timer_ConfigureMode(void) +-{ +- AT91C_BASE_TC0->TC_CMR = 0x000CC004; // ACPC=toggle TIOA on RC compare; mode=WAVE; WAVE_SEL=UP w/auto-trigger on RC compare; clock=MCK/1024 +-} +- +-void Timer_ConfigurePeriod(void) +-{ +- AT91C_BASE_TC0->TC_RC = 469; // 10ms period for timer clock source of MCK/1024 with MCK=48054857 +-} +- +-void Timer_EnableOutputPin(void) +-{ +- AT91C_BASE_PIOB->PIO_PDR = TIOA0_PIN_MASK; +-} +- +-void Timer_Enable(void) +-{ +- AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKEN; +-} +- +-void Timer_ConfigureInterruptHandler(void) +-{ +- Timer_DisableInterrupt(); +- Timer_ResetSystemTime(); +- Timer_ConfigureInterrupt(); +- Timer_EnableInterrupt(); +-} +- +-void Timer_Start(void) +-{ +- AT91C_BASE_TC0->TC_CCR = AT91C_TC_SWTRG; +-} +- +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.h +deleted file mode 100644 +index d078c54e63..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerConfigurator.h ++++ /dev/null +@@ -1,15 +0,0 @@ +-#ifndef _TIMERCONFIGURATOR_H +-#define _TIMERCONFIGURATOR_H +- +-#include "Types.h" +- +-void Timer_EnablePeripheralClocks(void); +-void Timer_Reset(void); +-void Timer_ConfigureMode(void); +-void Timer_ConfigurePeriod(void); +-void Timer_EnableOutputPin(void); +-void Timer_Enable(void); +-void Timer_ConfigureInterruptHandler(void); +-void Timer_Start(void); +- +-#endif // _TIMERCONFIGURATOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.c +deleted file mode 100644 +index d5e983ff54..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.c ++++ /dev/null +@@ -1,15 +0,0 @@ +-#include "Types.h" +-#include "TimerHardware.h" +-#include "TimerConfigurator.h" +- +-void TimerHardware_Init(void) +-{ +- Timer_EnablePeripheralClocks(); +- Timer_Reset(); +- Timer_ConfigureMode(); +- Timer_ConfigurePeriod(); +- Timer_EnableOutputPin(); +- Timer_Enable(); +- Timer_ConfigureInterruptHandler(); +- Timer_Start(); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.h +deleted file mode 100644 +index 92fa287100..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerHardware.h ++++ /dev/null +@@ -1,8 +0,0 @@ +-#ifndef _TIMERHARDWARE_H +-#define _TIMERHARDWARE_H +- +-#include "Types.h" +- +-void TimerHardware_Init(void); +- +-#endif // _TIMERHARDWARE_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c +deleted file mode 100644 +index fe603ef32b..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c ++++ /dev/null +@@ -1,55 +0,0 @@ +-#include "Types.h" +-#include "TimerInterruptConfigurator.h" +-#include "TimerInterruptHandler.h" +- +-static inline void SetInterruptHandler(void); +-static inline void ConfigureInterruptSourceModeRegister(void); +-static inline void ClearInterrupt(void); +-static inline void EnableCompareInterruptForRegisterC(void); +- +-void Timer_DisableInterrupt(void) +-{ +- AT91C_BASE_AIC->AIC_IDCR = TIMER0_ID_MASK; +-} +- +-void Timer_ResetSystemTime(void) +-{ +- Timer_SetSystemTime(0); +-} +- +-void Timer_ConfigureInterrupt(void) +-{ +- SetInterruptHandler(); +- ConfigureInterruptSourceModeRegister(); +- ClearInterrupt(); +- EnableCompareInterruptForRegisterC(); +-} +- +-void Timer_EnableInterrupt(void) +-{ +- AT91C_BASE_AIC->AIC_IECR = TIMER0_ID_MASK; +-} +- +-// +-// Helpers +-// +- +-static inline void SetInterruptHandler(void) +-{ +- AT91C_BASE_AIC->AIC_SVR[AT91C_ID_TC0] = (uint32)Timer_InterruptHandler; +-} +- +-static inline void ConfigureInterruptSourceModeRegister(void) +-{ +- AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] = 1; +-} +- +-static inline void ClearInterrupt(void) +-{ +- AT91C_BASE_AIC->AIC_ICCR = TIMER0_ID_MASK; +-} +- +-static inline void EnableCompareInterruptForRegisterC(void) +-{ +- AT91C_BASE_TC0->TC_IER = AT91C_TC_CPCS; +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.h +deleted file mode 100644 +index bdf64718d3..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.h ++++ /dev/null +@@ -1,13 +0,0 @@ +-#ifndef _TIMERINTERRUPTCONFIGURATOR_H +-#define _TIMERINTERRUPTCONFIGURATOR_H +- +-#include "Types.h" +- +-#define TIMER0_ID_MASK (((uint32)0x1) << AT91C_ID_TC0) +- +-void Timer_DisableInterrupt(void); +-void Timer_ResetSystemTime(void); +-void Timer_ConfigureInterrupt(void); +-void Timer_EnableInterrupt(void); +- +-#endif // _TIMERINTERRUPTCONFIGURATOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.c +deleted file mode 100644 +index ebb543d442..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.c ++++ /dev/null +@@ -1,25 +0,0 @@ +-#include "Types.h" +-#include "TimerInterruptHandler.h" +-#include "TimerInterruptConfigurator.h" +- +-static uint32 systemTime; +- +-void Timer_SetSystemTime(uint32 time) +-{ +- systemTime = time; +-} +- +-uint32 Timer_GetSystemTime(void) +-{ +- return systemTime; +-} +- +-void Timer_InterruptHandler(void) +-{ +- uint32 status = AT91C_BASE_TC0->TC_SR; +- if (status & AT91C_TC_CPCS) +- { +- systemTime += 10; +- } +-} +- +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.h +deleted file mode 100644 +index 29c0413bb9..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerInterruptHandler.h ++++ /dev/null +@@ -1,10 +0,0 @@ +-#ifndef _TIMERINTERRUPTHANDLER_H +-#define _TIMERINTERRUPTHANDLER_H +- +-#include "Types.h" +- +-void Timer_SetSystemTime(uint32 time); +-uint32 Timer_GetSystemTime(void); +-void Timer_InterruptHandler(void); +- +-#endif // _TIMERINTERRUPTHANDLER_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.c b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.c +deleted file mode 100644 +index fcc9db9bda..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.c ++++ /dev/null +@@ -1,9 +0,0 @@ +-#include "Types.h" +-#include "TimerModel.h" +-#include "TaskScheduler.h" +- +-void TimerModel_UpdateTime(uint32 systemTime) +-{ +- TaskScheduler_Update(systemTime); +-} +- +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.h b/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.h +deleted file mode 100644 +index 54be21a473..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/TimerModel.h ++++ /dev/null +@@ -1,8 +0,0 @@ +-#ifndef _TIMERMODEL_H +-#define _TIMERMODEL_H +- +-#include "Types.h" +- +-void TimerModel_UpdateTime(uint32 systemTime); +- +-#endif // _TIMERMODEL_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/Types.h b/components/testframework/libs/cmock/examples/temp_sensor/src/Types.h +deleted file mode 100644 +index 6a0f8247f1..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/Types.h ++++ /dev/null +@@ -1,103 +0,0 @@ +-#ifndef _MYTYPES_H_ +-#define _MYTYPES_H_ +- +-#include "AT91SAM7X256.h" +-#include +- +-#ifndef __monitor +-#define __monitor +-#endif +- +-// Peripheral Helper Definitions +-#define USART0_CLOCK_ENABLE (AT91C_ID_US0) +-#define USART0_TX_PIN (AT91C_PA1_TXD0) +-#define TIMER0_CLOCK_ENABLE (((uint32)0x1) << AT91C_ID_TC0) +-#define PIOA_CLOCK_ENABLE (((uint32)0x1) << AT91C_ID_PIOA) +-#define PIOB_CLOCK_ENABLE (((uint32)0x1) << AT91C_ID_PIOB) +-#define TIOA0_PIN_MASK (((uint32)0x1) << 23) // Timer/Counter Output Pin +- +-// Application Type Definitions +-typedef unsigned int uint32; +-typedef int int32; +-typedef unsigned short uint16; +-typedef short int16; +-typedef unsigned char uint8; +-typedef char int8; +-typedef char bool; +- +-// Application Special Value Definitions +-#ifndef TRUE +-#define TRUE (1) +-#endif +-#ifndef FALSE +-#define FALSE (0) +-#endif +-#ifndef NULL +-#define NULL (0) +-#endif // NULL +-#define DONT_CARE (0) +- +-#ifndef INFINITY +-#define INFINITY (1.0 / 0.0) +-#endif +- +-#ifndef NAN +-#define NAN (0.0 / 0.0) +-#endif +- +-// MIN/MAX Definitions for Standard Types +-#ifndef INT8_MAX +-#define INT8_MAX 127 +-#endif +- +-#ifndef INT8_MIN +-#define INT8_MIN (-128) +-#endif +- +-#ifndef UINT8_MAX +-#define UINT8_MAX 0xFFU +-#endif +- +-#ifndef UINT8_MIN +-#define UINT8_MIN 0x00U +-#endif +- +-#ifndef INT16_MAX +-#define INT16_MAX 32767 +-#endif +- +-#ifndef INT16_MIN +-#define INT16_MIN (-32768) +-#endif +- +-#ifndef UINT16_MAX +-#define UINT16_MAX 0xFFFFU +-#endif +- +-#ifndef UINT16_MIN +-#define UINT16_MIN 0x0000U +-#endif +- +-#ifndef INT32_MAX +-#define INT32_MAX 0x7FFFFFFF +-#endif +- +-#ifndef INT32_MIN +-#define INT32_MIN (-INT32_MAX - 1) +-#endif +- +-#ifndef UINT32_MAX +-#define UINT32_MAX 0xFFFFFFFFU +-#endif +- +-#ifndef UINT32_MIN +-#define UINT32_MIN 0x00000000U +-#endif +- +-typedef struct _EXAMPLE_STRUCT_T +-{ +- int x; +- int y; +-} EXAMPLE_STRUCT_T; +- +-#endif // _MYTYPES_H_ +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c +deleted file mode 100644 +index f4ad1470fc..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c ++++ /dev/null +@@ -1,18 +0,0 @@ +-#include "Types.h" +-#include "UsartBaudRateRegisterCalculator.h" +- +-uint8 UsartModel_CalculateBaudRateRegisterSetting(uint32 masterClock, uint32 baudRate) +-{ +- uint32 registerSetting = ((masterClock * 10) / (baudRate * 16)); +- +- if ((registerSetting % 10) >= 5) +- { +- registerSetting = (registerSetting / 10) + 1; +- } +- else +- { +- registerSetting /= 10; +- } +- +- return (uint8)registerSetting; +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h +deleted file mode 100644 +index 50e9048750..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h ++++ /dev/null +@@ -1,6 +0,0 @@ +-#ifndef _USARTBAUDRATEREGISTERCALCULATOR_H +-#define _USARTBAUDRATEREGISTERCALCULATOR_H +- +-uint8 UsartModel_CalculateBaudRateRegisterSetting(uint32 masterClock, uint32 baudRate); +- +-#endif // _USARTBAUDRATEREGISTERCALCULATOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.c +deleted file mode 100644 +index 3eeec3c1b2..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.c ++++ /dev/null +@@ -1,21 +0,0 @@ +-#include "Types.h" +-#include "UsartConductor.h" +-#include "UsartHardware.h" +-#include "UsartModel.h" +-#include "TaskScheduler.h" +- +-void UsartConductor_Init(void) +-{ +- UsartHardware_Init(UsartModel_GetBaudRateRegisterSetting()); +- UsartHardware_TransmitString(UsartModel_GetWakeupMessage()); +-} +- +-void UsartConductor_Run(void) +-{ +- char* temp; +- if (TaskScheduler_DoUsart()) +- { +- temp = UsartModel_GetFormattedTemperature(); +- UsartHardware_TransmitString(temp); +- } +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.h +deleted file mode 100644 +index f4207365f1..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConductor.h ++++ /dev/null +@@ -1,7 +0,0 @@ +-#ifndef _USARTCONDUCTOR_H +-#define _USARTCONDUCTOR_H +- +-void UsartConductor_Init(void); +-void UsartConductor_Run(void); +- +-#endif // _USARTCONDUCTOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.c +deleted file mode 100644 +index b8c2cdc734..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.c ++++ /dev/null +@@ -1,39 +0,0 @@ +-#include "Types.h" +-#include "UsartConfigurator.h" +- +-void Usart_ConfigureUsartIO(void) +-{ +- AT91C_BASE_PIOA->PIO_ASR = USART0_TX_PIN; +- AT91C_BASE_PIOA->PIO_BSR = 0; +- AT91C_BASE_PIOA->PIO_PDR = USART0_TX_PIN; +-} +- +-void Usart_EnablePeripheralClock(void) +-{ +- AT91C_BASE_PMC->PMC_PCER = ((uint32)1) << USART0_CLOCK_ENABLE; +-} +- +-void Usart_Reset(void) +-{ +- AT91C_BASE_US0->US_IDR = 0xffffffff; +- AT91C_BASE_US0->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS; +-} +- +-void Usart_ConfigureMode(void) +-{ +- AT91C_BASE_US0->US_MR = AT91C_US_USMODE_NORMAL | +- AT91C_US_NBSTOP_1_BIT | +- AT91C_US_PAR_NONE | +- AT91C_US_CHRL_8_BITS | +- AT91C_US_CLKS_CLOCK; +-} +- +-void Usart_SetBaudRateRegister(uint8 baudRateRegisterSetting) +-{ +- AT91C_BASE_US0->US_BRGR = baudRateRegisterSetting; +-} +- +-void Usart_Enable(void) +-{ +- AT91C_BASE_US0->US_CR = AT91C_US_TXEN; +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.h +deleted file mode 100644 +index 02bede2ab8..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartConfigurator.h ++++ /dev/null +@@ -1,13 +0,0 @@ +-#ifndef _USARTCONFIGURATOR_H +-#define _USARTCONFIGURATOR_H +- +-#include "Types.h" +- +-void Usart_ConfigureUsartIO(void); +-void Usart_EnablePeripheralClock(void); +-void Usart_Reset(void); +-void Usart_ConfigureMode(void); +-void Usart_SetBaudRateRegister(uint8 baudRateRegisterSetting); +-void Usart_Enable(void); +- +-#endif // _USARTCONFIGURATOR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.c +deleted file mode 100644 +index e37c2c606f..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.c ++++ /dev/null +@@ -1,22 +0,0 @@ +-#include "Types.h" +-#include "UsartHardware.h" +-#include "UsartConfigurator.h" +-#include "UsartPutChar.h" +- +-void UsartHardware_Init(uint8 baudRateRegisterSetting) +-{ +- Usart_ConfigureUsartIO(); +- Usart_EnablePeripheralClock(); +- Usart_Reset(); +- Usart_ConfigureMode(); +- Usart_SetBaudRateRegister(baudRateRegisterSetting); +- Usart_Enable(); +-} +- +-void UsartHardware_TransmitString(char* data) +-{ +- while(*data != NULL) +- { +- Usart_PutChar(*data++); +- } +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.h +deleted file mode 100644 +index 041e280864..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartHardware.h ++++ /dev/null +@@ -1,9 +0,0 @@ +-#ifndef _USARTHARDWARE_H +-#define _USARTHARDWARE_H +- +-#include "Types.h" +- +-void UsartHardware_Init(uint8 baudRateRegisterSetting); +-void UsartHardware_TransmitString(char* data); +- +-#endif // _USARTHARDWARE_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.c +deleted file mode 100644 +index d722a2f3e7..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.c ++++ /dev/null +@@ -1,34 +0,0 @@ +-#include "Types.h" +-#include "UsartModel.h" +-#include "ModelConfig.h" +-#include "UsartBaudRateRegisterCalculator.h" +-#include "TemperatureFilter.h" +-#include +-#include +- +-char formattedTemperature[32]; +-char* wakeup = "It's Awesome Time!\n"; +- +-uint8 UsartModel_GetBaudRateRegisterSetting(void) +-{ +- return UsartModel_CalculateBaudRateRegisterSetting(MASTER_CLOCK, USART0_BAUDRATE); +-} +- +-char* UsartModel_GetFormattedTemperature(void) +-{ +- float temperature = TemperatureFilter_GetTemperatureInCelcius(); +- if (temperature == -INFINITY) +- { +- sprintf(formattedTemperature, "%s", "Temperature sensor failure!\n"); +- } +- else +- { +- sprintf(formattedTemperature, "%.1f C\n", temperature); +- } +- return formattedTemperature; +-} +- +-char* UsartModel_GetWakeupMessage(void) +-{ +- return wakeup; +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.h +deleted file mode 100644 +index 7d9485440c..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartModel.h ++++ /dev/null +@@ -1,10 +0,0 @@ +-#ifndef _USARTMODEL_H +-#define _USARTMODEL_H +- +-#include "Types.h" +- +-uint8 UsartModel_GetBaudRateRegisterSetting(void); +-char* UsartModel_GetFormattedTemperature(void); +-char* UsartModel_GetWakeupMessage(void); +- +-#endif // _USARTMODEL_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.c +deleted file mode 100644 +index 9e3ce2c8b2..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.c ++++ /dev/null +@@ -1,16 +0,0 @@ +-#include "Types.h" +-#include "UsartPutChar.h" +-#include "UsartTransmitBufferStatus.h" +-#ifdef SIMULATE +-#include +-#endif +- +-void Usart_PutChar(char data) +-{ +- while(!Usart_ReadyToTransmit()); +-#ifdef SIMULATE +- printf("%c", data); +-#else +- AT91C_BASE_US0->US_THR = data; +-#endif +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.h +deleted file mode 100644 +index 924446ab9a..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartPutChar.h ++++ /dev/null +@@ -1,8 +0,0 @@ +-#ifndef _USARTPUT_HAR_H +-#define _USARTPUT_HAR_H +- +-#include "Types.h" +- +-void Usart_PutChar(char data); +- +-#endif // _USARTPUT_HAR_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.c b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.c +deleted file mode 100644 +index 914b2e1478..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.c ++++ /dev/null +@@ -1,7 +0,0 @@ +-#include "Types.h" +-#include "UsartTransmitBufferStatus.h" +- +-bool Usart_ReadyToTransmit(void) +-{ +- return (AT91C_BASE_US0->US_CSR & AT91C_US_TXRDY) > 0; +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.h b/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.h +deleted file mode 100644 +index b5925ba21a..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.h ++++ /dev/null +@@ -1,8 +0,0 @@ +-#ifndef _USARTTRANSMITBUFFERSTATUS_H +-#define _USARTTRANSMITBUFFERSTATUS_H +- +-#include "Types.h" +- +-bool Usart_ReadyToTransmit(void); +- +-#endif // _USARTTRANSMITBUFFERSTATUS_H +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcConductor.c +deleted file mode 100644 +index a15d7d1b4d..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcConductor.c ++++ /dev/null +@@ -1,121 +0,0 @@ +-#include "unity.h" +-#include "UnityHelper.h" +-#include "Types.h" +-#include "Types.h" +-#include "AdcConductor.h" +-#include "MockAdcModel.h" +-#include "MockAdcHardware.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testInitShouldCallHardwareInit(void) +-{ +- AdcHardware_Init_Expect(); +- AdcConductor_Init(); +-} +- +-void testRunShouldNotDoAnythingIfItIsNotTime(void) +-{ +- AdcModel_DoGetSample_ExpectAndReturn(FALSE); +- +- AdcConductor_Run(); +-} +- +-void testRunShouldNotPassAdcResultToModelIfSampleIsNotComplete(void) +-{ +- AdcModel_DoGetSample_ExpectAndReturn(TRUE); +- AdcHardware_GetSampleComplete_ExpectAndReturn(FALSE); +- +- AdcConductor_Run(); +-} +- +-void testRunShouldGetLatestSampleFromAdcAndPassItToModelAndStartNewConversionWhenItIsTime(void) +-{ +- AdcModel_DoGetSample_ExpectAndReturn(TRUE); +- AdcHardware_GetSampleComplete_ExpectAndReturn(TRUE); +- AdcHardware_GetSample_ExpectAndReturn(293U); +- AdcModel_ProcessInput_Expect(293U); +- AdcHardware_StartConversion_Expect(); +- +- AdcConductor_Run(); +-} +- +-void testJustHereToTest_Should_ProperlyPassAStructAndVerifyIt(void) +-{ +- EXAMPLE_STRUCT_T TestStruct; +- TestStruct.x = 5; +- TestStruct.y = 7; +- +- AdcModel_DoNothingExceptTestASpecialType_ExpectAndReturn(TestStruct, TRUE); +- +- TEST_ASSERT_TRUE(AdcConductor_JustHereToTest()); +-} +- +-//void testJustHereToTest_Should_FailThisTestIfYouUncommentXIsBecauseItsWrong(void) +-//{ +-// EXAMPLE_STRUCT_T TestStruct; +-// TestStruct.x = 6; +-// TestStruct.y = 7; +-// +-// AdcModel_DoNothingExceptTestASpecialType_ExpectAndReturn(TestStruct, TRUE); +-// +-// TEST_ASSERT_TRUE(AdcConductor_JustHereToTest()); +-//} +-// +-//void testJustHereToTest_Should_FailThisTestIfYouUncommentYIsBecauseItsWrong(void) +-//{ +-// EXAMPLE_STRUCT_T TestStruct; +-// TestStruct.x = 5; +-// TestStruct.y = 8; +-// +-// AdcModel_DoNothingExceptTestASpecialType_ExpectAndReturn(TestStruct, TRUE); +-// +-// TEST_ASSERT_TRUE(AdcConductor_JustHereToTest()); +-//} +- +-void test_AdcConductor_AlsoHereToTest_Should_ProperlyReturnAStructAsExpected1(void) +-{ +- EXAMPLE_STRUCT_T TestStruct; +- TestStruct.x = 99; +- TestStruct.y = 1; +- +- AdcModel_DoNothingExceptReturnASpecialType_ExpectAndReturn(TestStruct); +- +- TEST_ASSERT_TRUE(AdcConductor_AlsoHereToTest()); +-} +- +-void test_AdcConductor_AlsoHereToTest_Should_ProperlyReturnAStructAsExpected2(void) +-{ +- EXAMPLE_STRUCT_T TestStruct; +- TestStruct.x = 98; +- TestStruct.y = 1; +- +- AdcModel_DoNothingExceptReturnASpecialType_ExpectAndReturn(TestStruct); +- +- TEST_ASSERT_FALSE(AdcConductor_AlsoHereToTest()); +-} +- +-void test_AdcConductor_YetAnotherTest_Should_VerifyThatPointersToStructsAreTestable(void) +-{ +- uint32 TestNum = 3; +- +- AdModel_DoNothingExceptTestPointers_ExpectAndReturn(&TestNum, TRUE); +- +- TEST_ASSERT_TRUE(AdcConductor_YetAnotherTest()); +-} +- +-//void test_AdcConductor_YetAnotherTest_Should_FailIfYouUncommentThisTestBecauseTheValuePointedToIsWrong(void) +-//{ +-// uint32 TestNum = 7; +-// +-// AdModel_DoNothingExceptTestPointers_ExpectAndReturn(&TestNum, FALSE); +-// +-// TEST_ASSERT_FALSE(AdcConductor_YetAnotherTest()); +-//} +- +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardware.c +deleted file mode 100644 +index 7aabaa7597..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardware.c ++++ /dev/null +@@ -1,44 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "AdcHardware.h" +-#include "MockAdcHardwareConfigurator.h" +-#include "MockAdcTemperatureSensor.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testInitShouldDelegateToConfiguratorAndTemperatureSensor(void) +-{ +- Adc_Reset_Expect(); +- Adc_ConfigureMode_Expect(); +- Adc_EnableTemperatureChannel_Expect(); +- Adc_StartTemperatureSensorConversion_Expect(); +- +- AdcHardware_Init(); +-} +- +-void testGetSampleCompleteShouldReturn_FALSE_WhenTemperatureSensorSampleReadyReturns_FALSE(void) +-{ +- Adc_TemperatureSensorSampleReady_ExpectAndReturn(FALSE); +- TEST_ASSERT(!AdcHardware_GetSampleComplete()); +-} +- +-void testGetSampleCompleteShouldReturn_TRUE_WhenTemperatureSensorSampleReadyReturns_TRUE(void) +-{ +- Adc_TemperatureSensorSampleReady_ExpectAndReturn(TRUE); +- TEST_ASSERT(AdcHardware_GetSampleComplete()); +-} +- +-void testGetSampleShouldDelegateToAdcTemperatureSensor(void) +-{ +- uint16 sample; +- Adc_ReadTemperatureSensor_ExpectAndReturn(847); +- +- sample = AdcHardware_GetSample(); +- TEST_ASSERT_EQUAL(847, sample); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardwareConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardwareConfigurator.c +deleted file mode 100644 +index c1feceb713..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcHardwareConfigurator.c ++++ /dev/null +@@ -1,43 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "AdcHardwareConfigurator.h" +-#include "AT91SAM7X256.h" +-#include "ModelConfig.h" +- +-AT91S_ADC AdcPeripheral; +- +-void setUp(void) +-{ +- +-} +- +-void tearDown(void) +-{ +-} +- +-void testResetShouldResetTheAdcConverterPeripheral(void) +-{ +- AT91C_BASE_ADC->ADC_CR = 0; +- Adc_Reset(); +- TEST_ASSERT_EQUAL(AT91C_ADC_SWRST, AT91C_BASE_ADC->ADC_CR); +-} +- +-void testConfigureModeShouldSetAdcModeRegisterAppropriately(void) +-{ +- uint32 prescaler = (MASTER_CLOCK / (2 * 2000000)) - 1; // 5MHz ADC clock +- +- AT91C_BASE_ADC->ADC_MR = 0; +- +- Adc_ConfigureMode(); +- +- TEST_ASSERT_EQUAL(prescaler, (AT91C_BASE_ADC->ADC_MR & AT91C_ADC_PRESCAL) >> 8); +-} +- +-void testEnableTemperatureChannelShouldEnableTheAppropriateAdcInput(void) +-{ +- AT91C_BASE_ADC->ADC_CHER = 0; +- +- Adc_EnableTemperatureChannel(); +- +- TEST_ASSERT_EQUAL(0x1 << 4, AT91C_BASE_ADC->ADC_CHER); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcModel.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcModel.c +deleted file mode 100644 +index f1dcb4aaea..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcModel.c ++++ /dev/null +@@ -1,33 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "AdcModel.h" +-#include "MockTaskScheduler.h" +-#include "MockTemperatureCalculator.h" +-#include "MockTemperatureFilter.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testDoGetSampleShouldReturn_FALSE_WhenTaskSchedulerReturns_FALSE(void) +-{ +- TaskScheduler_DoAdc_ExpectAndReturn(FALSE); +- TEST_ASSERT_EQUAL(FALSE, AdcModel_DoGetSample()); +-} +- +-void testDoGetSampleShouldReturn_TRUE_WhenTaskSchedulerReturns_TRUE(void) +-{ +- TaskScheduler_DoAdc_ExpectAndReturn(TRUE); +- TEST_ASSERT_EQUAL(TRUE, AdcModel_DoGetSample()); +-} +- +-void testProcessInputShouldDelegateToTemperatureCalculatorAndPassResultToFilter(void) +-{ +- TemperatureCalculator_Calculate_ExpectAndReturn(21473, 23.5f); +- TemperatureFilter_ProcessInput_Expect(23.5f); +- AdcModel_ProcessInput(21473); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcTemperatureSensor.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcTemperatureSensor.c +deleted file mode 100644 +index 0be339ff23..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestAdcTemperatureSensor.c ++++ /dev/null +@@ -1,47 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "AdcTemperatureSensor.h" +-#include "AT91SAM7X256.h" +- +-AT91S_ADC AdcPeripheral; +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testShouldStartTemperatureSensorConversionWhenTriggered(void) +-{ +- AT91C_BASE_ADC->ADC_CR = 0; +- Adc_StartTemperatureSensorConversion(); +- TEST_ASSERT_EQUAL(AT91C_ADC_START, AT91C_BASE_ADC->ADC_CR); +-} +- +-void testTemperatureSensorSampleReadyShouldReturnChannelConversionCompletionStatus(void) +-{ +- AT91C_BASE_ADC->ADC_SR = 0; +- TEST_ASSERT_EQUAL(FALSE, Adc_TemperatureSensorSampleReady()); +- AT91C_BASE_ADC->ADC_SR = ~AT91C_ADC_EOC4; +- TEST_ASSERT_EQUAL(FALSE, Adc_TemperatureSensorSampleReady()); +- AT91C_BASE_ADC->ADC_SR = AT91C_ADC_EOC4; +- TEST_ASSERT_EQUAL(TRUE, Adc_TemperatureSensorSampleReady()); +- AT91C_BASE_ADC->ADC_SR = 0xffffffff; +- TEST_ASSERT_EQUAL(TRUE, Adc_TemperatureSensorSampleReady()); +-} +- +-void testReadTemperatureSensorShouldFetchAndTranslateLatestReadingToMillivolts(void) +-{ +- uint16 result; +- +- // ADC bit weight at 10-bit resolution with 3.0V reference = 2.9296875 mV/LSB +- AT91C_BASE_ADC->ADC_CDR4 = 138; +- result = Adc_ReadTemperatureSensor(); +- TEST_ASSERT_EQUAL(404, result); +- +- AT91C_BASE_ADC->ADC_CDR4 = 854; +- result = Adc_ReadTemperatureSensor(); +- TEST_ASSERT_EQUAL(2502, result); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestExecutor.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestExecutor.c +deleted file mode 100644 +index 8e4832620f..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestExecutor.c ++++ /dev/null +@@ -1,36 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "Executor.h" +-#include "MockModel.h" +-#include "MockUsartConductor.h" +-#include "MockAdcConductor.h" +-#include "MockTimerConductor.h" +-#include "MockIntrinsicsWrapper.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testInitShouldCallInitOfAllConductorsAndTheModel(void) +-{ +- Model_Init_Expect(); +- UsartConductor_Init_Expect(); +- AdcConductor_Init_Expect(); +- TimerConductor_Init_Expect(); +- Interrupt_Enable_Expect(); +- +- Executor_Init(); +-} +- +-void testRunShouldCallRunForEachConductorAndReturnTrueAlways(void) +-{ +- UsartConductor_Run_Expect(); +- TimerConductor_Run_Expect(); +- AdcConductor_Run_Expect(); +- +- TEST_ASSERT_EQUAL(TRUE, Executor_Run()); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestMain.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestMain.c +deleted file mode 100644 +index baf338290c..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestMain.c ++++ /dev/null +@@ -1,24 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "MockExecutor.h" +-#include "Main.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testMainShouldCallExecutorInitAndContinueToCallExecutorRunUntilHalted(void) +-{ +- Executor_Init_Expect(); +- Executor_Run_ExpectAndReturn(TRUE); +- Executor_Run_ExpectAndReturn(TRUE); +- Executor_Run_ExpectAndReturn(TRUE); +- Executor_Run_ExpectAndReturn(TRUE); +- Executor_Run_ExpectAndReturn(FALSE); +- +- AppMain(); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestModel.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestModel.c +deleted file mode 100644 +index 59dda1dc7e..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestModel.c ++++ /dev/null +@@ -1,20 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "Model.h" +-#include "MockTaskScheduler.h" +-#include "MockTemperatureFilter.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testInitShouldCallSchedulerAndTemperatureFilterInit(void) +-{ +- TaskScheduler_Init_Expect(); +- TemperatureFilter_Init_Expect(); +- Model_Init(); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTaskScheduler.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTaskScheduler.c +deleted file mode 100644 +index 29d1edf1d7..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTaskScheduler.c ++++ /dev/null +@@ -1,104 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "TaskScheduler.h" +- +-void setUp(void) +-{ +- TaskScheduler_Init(); +-} +- +-void tearDown(void) +-{ +-} +- +-void testShouldScheduleUsartTaskAfter1000ms(void) +-{ +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); +- +- TaskScheduler_Update(999); +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); +- +- TaskScheduler_Update(1000); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); +-} +- +-void testShouldClearUsartDoFlagAfterReported(void) +-{ +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); +- TaskScheduler_Update(1000); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); +-} +- +-void testShouldScheduleUsartTaskEvery1000ms(void) +-{ +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); +- +- TaskScheduler_Update(1300); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); +- +- TaskScheduler_Update(2000); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); +- +- TaskScheduler_Update(3100); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); +-} +- +-void testShouldScheduleUsartTaskOnlyOncePerPeriod(void) +-{ +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); +- TaskScheduler_Update(1000); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); +- TaskScheduler_Update(1001); +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); +- TaskScheduler_Update(1999); +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoUsart()); +- TaskScheduler_Update(2000); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoUsart()); +-} +- +-void testShouldScheduleAdcTaskAfter100ms(void) +-{ +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); +- +- TaskScheduler_Update(99); +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); +- +- TaskScheduler_Update(100); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); +-} +- +-void testShouldClearAdcDoFlagAfterReported(void) +-{ +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); +- TaskScheduler_Update(100); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); +-} +- +-void testShouldScheduleAdcTaskEvery100ms(void) +-{ +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); +- +- TaskScheduler_Update(121); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); +- +- TaskScheduler_Update(200); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); +- +- TaskScheduler_Update(356); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); +-} +- +-void testShouldScheduleAdcTaskOnlyOncePerPeriod(void) +-{ +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); +- TaskScheduler_Update(100); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); +- TaskScheduler_Update(101); +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); +- TaskScheduler_Update(199); +- TEST_ASSERT_EQUAL(FALSE, TaskScheduler_DoAdc()); +- TaskScheduler_Update(200); +- TEST_ASSERT_EQUAL(TRUE, TaskScheduler_DoAdc()); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureCalculator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureCalculator.c +deleted file mode 100644 +index dbb7dea062..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureCalculator.c ++++ /dev/null +@@ -1,33 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "TemperatureCalculator.h" +-#include +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testTemperatureCalculatorShouldCalculateTemperatureFromMillivolts(void) +-{ +- float result; +- +- // Series resistor is 5k Ohms; Reference voltage is 3.0V +- // R(t) = A * e^(B*t); R is resistance of thermisor; t is temperature in C +- result = TemperatureCalculator_Calculate(1000); +- TEST_ASSERT_FLOAT_WITHIN(0.01f, 25.0f, result); +- +- result = TemperatureCalculator_Calculate(2985); +- TEST_ASSERT_FLOAT_WITHIN(0.01f, 68.317f, result); +- +- result = TemperatureCalculator_Calculate(3); +- TEST_ASSERT_FLOAT_WITHIN(0.01f, -19.96f, result); +-} +- +-void testShouldReturnNegativeInfinityWhen_0_millivoltsInput(void) +-{ +- TEST_ASSERT_FLOAT_WITHIN(0.0000001f, -INFINITY, TemperatureCalculator_Calculate(0)); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureFilter.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureFilter.c +deleted file mode 100644 +index 58fb178f14..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTemperatureFilter.c ++++ /dev/null +@@ -1,69 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "TemperatureFilter.h" +-#include +- +-void setUp(void) +-{ +- TemperatureFilter_Init(); +-} +- +-void tearDown(void) +-{ +-} +- +-void testShouldInitializeTemeratureToInvalidValue(void) +-{ +- TemperatureFilter_Init(); +- TEST_ASSERT_FLOAT_WITHIN(0.0001f, -INFINITY, TemperatureFilter_GetTemperatureInCelcius()); +-} +- +-void testShouldInitializeTemperatureAfterCallToInit(void) +-{ +- TemperatureFilter_Init(); +- TemperatureFilter_ProcessInput(17.8f); +- TEST_ASSERT_FLOAT_WITHIN(0.0001f, 17.8f, TemperatureFilter_GetTemperatureInCelcius()); +- +- TemperatureFilter_Init(); +- TemperatureFilter_ProcessInput(32.6f); +- TEST_ASSERT_FLOAT_WITHIN(0.0001f, 32.6f, TemperatureFilter_GetTemperatureInCelcius()); +-} +- +-void setValueAndVerifyResponse(float input, float response) +-{ +- float actual; +- TemperatureFilter_ProcessInput(input); +- actual = TemperatureFilter_GetTemperatureInCelcius(); +- TEST_ASSERT_FLOAT_WITHIN(0.0001f, response, actual); +-} +- +-void testShouldWeightEachSubsequentValueBy25PercentAfterInitialValue(void) +-{ +- TemperatureFilter_Init(); +- setValueAndVerifyResponse(0.0f, 0.0f); +- setValueAndVerifyResponse(10.0f, 2.5f); +- setValueAndVerifyResponse(10.0f, 4.375f); +- setValueAndVerifyResponse(10.0f, 5.78125f); +- +- TemperatureFilter_Init(); +- setValueAndVerifyResponse(100.0f, 100.0f); +- setValueAndVerifyResponse(0.0f, 75.0f); +- setValueAndVerifyResponse(0.0f, 56.25f); +- setValueAndVerifyResponse(0.0f, 42.1875f); +-} +- +-void setInvalidTemperatureAndVerifyReinitialized(float invalidTemperature) +-{ +- TemperatureFilter_Init(); +- setValueAndVerifyResponse(100.0f, 100.0f); +- setValueAndVerifyResponse(invalidTemperature, -INFINITY); +- setValueAndVerifyResponse(14.3f, 14.3f); +-} +- +-void testShouldResetAverageIfPassedInfinityOrInvalidValue(void) +-{ +- setInvalidTemperatureAndVerifyReinitialized(-INFINITY); +- setInvalidTemperatureAndVerifyReinitialized(+INFINITY); +- setInvalidTemperatureAndVerifyReinitialized(+NAN); +- setInvalidTemperatureAndVerifyReinitialized(-NAN); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConductor.c +deleted file mode 100644 +index 8064a8c511..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConductor.c ++++ /dev/null +@@ -1,32 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "TimerConductor.h" +-#include "MockTimerHardware.h" +-#include "MockTimerModel.h" +-#include "MockTimerInterruptHandler.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testInitShouldCallHardwareInit(void) +-{ +- TimerHardware_Init_Expect(); +- +- TimerConductor_Init(); +-} +- +-void testRunShouldGetSystemTimeAndPassOnToModelForEventScheduling(void) +-{ +- Timer_GetSystemTime_ExpectAndReturn(1230); +- TimerModel_UpdateTime_Expect(1230); +- TimerConductor_Run(); +- +- Timer_GetSystemTime_ExpectAndReturn(837460); +- TimerModel_UpdateTime_Expect(837460); +- TimerConductor_Run(); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConfigurator.c +deleted file mode 100644 +index 5c7d4e044e..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerConfigurator.c ++++ /dev/null +@@ -1,112 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "TimerConfigurator.h" +-#include "AT91SAM7X256.h" +-#include "MockTimerInterruptConfigurator.h" +- +-AT91S_PMC PmcPeripheral; +-AT91S_TC TimerCounter0Peripheral; +-AT91S_PIO PioBPeripheral; +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testEnablePeripheralClocksShouldEnableClockToTimer0Peripheral(void) +-{ +- AT91C_BASE_PMC->PMC_PCER = 0; +- Timer_EnablePeripheralClocks(); +- TEST_ASSERT_EQUAL( +- TIMER0_CLOCK_ENABLE, +- AT91C_BASE_PMC->PMC_PCER & TIMER0_CLOCK_ENABLE); +-} +- +-void testEnablePeripheralClocksShouldEnableClockToPIOBPeripheral(void) +-{ +- AT91C_BASE_PMC->PMC_PCER = 0; +- Timer_EnablePeripheralClocks(); +- TEST_ASSERT_EQUAL( +- PIOB_CLOCK_ENABLE, +- AT91C_BASE_PMC->PMC_PCER & PIOB_CLOCK_ENABLE); +-} +- +-void testResetShouldSetTimer0ClockDisableBit_DisableTimer0Interrupts_ClearStatusRegister(void) +-{ +- AT91C_BASE_TC0->TC_CCR = 0; +- AT91C_BASE_TC0->TC_IDR = 0; +- AT91C_BASE_TC0->TC_SR = 0xFFFFFFFF; +- Timer_Reset(); +- TEST_ASSERT_EQUAL(0x00000002, AT91C_BASE_TC0->TC_CCR); +- TEST_ASSERT_EQUAL(0xffffffff, AT91C_BASE_TC0->TC_IDR); +- // CANNOT BE VERIFIED!! TEST_ASSERT_EQUAL(0X00000000, AT91C_BASE_TC0->TC_SR); +-} +- +-void testEnableOutputPinShouldEnable_TIOA0_DigitalOutput(void) +-{ +- AT91C_BASE_PIOB->PIO_PDR = 0; +- Timer_EnableOutputPin(); +- TEST_ASSERT_EQUAL(TIOA0_PIN_MASK, AT91C_BASE_PIOB->PIO_PDR); +-} +- +-void testConfigureModeShouldConfigureTimer0ClockSourceForMasterClockDividedBy1024(void) +-{ +- AT91C_BASE_TC0->TC_CMR = 0; +- Timer_ConfigureMode(); +- TEST_ASSERT_EQUAL(0x00000004, AT91C_BASE_TC0->TC_CMR & 0x00000007); +-} +- +-void testConfigureModeShouldConfigureTimer0ForWaveGeneration(void) +-{ +- AT91C_BASE_TC0->TC_CMR = 0; +- Timer_ConfigureMode(); +- TEST_ASSERT_EQUAL(0x00008000, AT91C_BASE_TC0->TC_CMR & 0x00008000); +-} +- +-void testConfigureModeShouldConfigureTimer0ForUpModeWithAutomaticTriggerOnRCCompare(void) +-{ +- AT91C_BASE_TC0->TC_CMR = 0; +- Timer_ConfigureMode(); +- TEST_ASSERT_EQUAL(0x00004000, AT91C_BASE_TC0->TC_CMR & 0x00006000); +-} +- +-void testConfigureModeShouldConfigureTimer0ToToggleTIOAOnRCCompare(void) +-{ +- AT91C_BASE_TC0->TC_CMR = 0; +- Timer_ConfigureMode(); +- TEST_ASSERT_EQUAL(0x000C0000, AT91C_BASE_TC0->TC_CMR & 0x000C0000); +-} +- +-void testConfigurePeriodShouldConfigureRegisterCFor10msInterval(void) +-{ +- AT91C_BASE_TC0->TC_RC = 0; +- Timer_ConfigurePeriod(); +- TEST_ASSERT_EQUAL(469, AT91C_BASE_TC0->TC_RC); +-} +- +-void testEnableShouldSetEnableFlagForTimer0(void) +-{ +- AT91C_BASE_TC0->TC_CCR = 0; +- Timer_Enable(); +- TEST_ASSERT_EQUAL_INT(1, AT91C_BASE_TC0->TC_CCR); +-} +- +-void testConfigureInterruptHandler(void) +-{ +- Timer_DisableInterrupt_Expect(); +- Timer_ResetSystemTime_Expect(); +- Timer_ConfigureInterrupt_Expect(); +- Timer_EnableInterrupt_Expect(); +- +- Timer_ConfigureInterruptHandler(); +-} +- +-void testStartShouldSetSoftwareTriggerFlag(void) +-{ +- AT91C_BASE_TC0->TC_CCR = 0; +- Timer_Start(); +- TEST_ASSERT_EQUAL(0x04, AT91C_BASE_TC0->TC_CCR); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerHardware.c +deleted file mode 100644 +index 16339d0ca4..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerHardware.c ++++ /dev/null +@@ -1,26 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "TimerHardware.h" +-#include "MockTimerConfigurator.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testInitShouldDelegateAppropriatelyToConfigurator(void) +-{ +- Timer_EnablePeripheralClocks_Expect(); +- Timer_Reset_Expect(); +- Timer_ConfigureMode_Expect(); +- Timer_ConfigurePeriod_Expect(); +- Timer_EnableOutputPin_Expect(); +- Timer_Enable_Expect(); +- Timer_ConfigureInterruptHandler_Expect(); +- Timer_Start_Expect(); +- +- TimerHardware_Init(); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptConfigurator.c +deleted file mode 100644 +index 13c35f444c..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptConfigurator.c ++++ /dev/null +@@ -1,78 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "TimerInterruptConfigurator.h" +-#include "MockTimerInterruptHandler.h" +-#include "AT91SAM7X256.h" +- +-AT91S_AIC AicPeripheral; +-AT91S_TC TimerCounter0Peripheral; +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void test_TIMER0_ID_MASK_ShouldBeCorrect(void) +-{ +- TEST_ASSERT_EQUAL(((uint32)0x1) << AT91C_ID_TC0, TIMER0_ID_MASK); +-} +- +-void testDisableInterruptDisablesTimer0InterruptInTheInterruptController(void) +-{ +- AT91C_BASE_AIC->AIC_IDCR = 0; +- Timer_DisableInterrupt(); +- TEST_ASSERT_EQUAL(TIMER0_ID_MASK, AT91C_BASE_AIC->AIC_IDCR); +-} +- +-void testResetSystemTimeDelegatesTo_Timer_SetSystemTime_Appropriately(void) +-{ +- Timer_SetSystemTime_Expect(0); +- Timer_ResetSystemTime(); +-} +- +-void testConfigureInterruptShouldSetInterruptHandlerAppropriately(void) +-{ +- AT91C_BASE_AIC->AIC_SVR[AT91C_ID_TC0] = (uint32)NULL; +- Timer_ConfigureInterrupt(); +- TEST_ASSERT_EQUAL((uint32)Timer_InterruptHandler, AT91C_BASE_AIC->AIC_SVR[AT91C_ID_TC0]); +-} +- +-void testConfigureInterruptShouldSetInterruptLevelInSourceModeRegisterAppropriately(void) +-{ +- AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] = 0; +- Timer_ConfigureInterrupt(); +- TEST_ASSERT_EQUAL( +- AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, +- AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] & 0x00000060); +-} +- +-void testConfigureInterruptShouldSetInterruptPriorityInSourceModeRegisterAppropriately(void) +-{ +- AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] = 0; +- Timer_ConfigureInterrupt(); +- TEST_ASSERT_EQUAL(1, AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] & 0x00000007); +-} +- +-void testConfigureInterruptShouldClearTimer0InterruptOnTheInterruptController(void) +-{ +- AT91C_BASE_AIC->AIC_ICCR = 0; +- Timer_ConfigureInterrupt(); +- TEST_ASSERT_EQUAL(TIMER0_ID_MASK, AT91C_BASE_AIC->AIC_ICCR); +-} +- +-void testConfigureInterruptShouldEnableCompareInterruptForRegisterC(void) +-{ +- AT91C_BASE_TC0->TC_IER = 0; +- Timer_ConfigureInterrupt(); +- TEST_ASSERT_EQUAL(AT91C_TC_CPCS, AT91C_BASE_TC0->TC_IER); +-} +- +-void testEnableInterruptShouldEnableTimer0InterruptsInInterruptCotroller(void) +-{ +- AT91C_BASE_AIC->AIC_IECR = 0; +- Timer_EnableInterrupt(); +- TEST_ASSERT_EQUAL(TIMER0_ID_MASK, AT91C_BASE_AIC->AIC_IECR); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptHandler.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptHandler.c +deleted file mode 100644 +index 8e2e64e9d9..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerInterruptHandler.c ++++ /dev/null +@@ -1,66 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "TimerInterruptHandler.h" +-#include "AT91SAM7X256.h" +- +-AT91S_TC TimerCounter0Peripheral; +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testSetAndGetSystemTime(void) +-{ +- Timer_SetSystemTime(0); +- TEST_ASSERT_EQUAL(0, Timer_GetSystemTime()); +- +- Timer_SetSystemTime(129837); +- TEST_ASSERT_EQUAL(129837, Timer_GetSystemTime()); +- +- Timer_SetSystemTime(UINT32_MAX); +- TEST_ASSERT_EQUAL(UINT32_MAX, Timer_GetSystemTime()); +-} +- +-void testInterruptHandlerShouldIncrementSystemTimeOnlyIfStatusHasCompareRegisterCOverflowBitSet(void) +-{ +- Timer_SetSystemTime(0); +- AT91C_BASE_TC0->TC_SR = 0; +- Timer_InterruptHandler(); +- TEST_ASSERT_EQUAL(0, Timer_GetSystemTime()); +- +- Timer_SetSystemTime(0); +- AT91C_BASE_TC0->TC_SR = ~AT91C_TC_CPCS; +- Timer_InterruptHandler(); +- TEST_ASSERT_EQUAL(0, Timer_GetSystemTime()); +- +- Timer_SetSystemTime(0); +- AT91C_BASE_TC0->TC_SR = AT91C_TC_CPCS; +- Timer_InterruptHandler(); +- TEST_ASSERT(Timer_GetSystemTime() > 0); +- +- Timer_SetSystemTime(0); +- AT91C_BASE_TC0->TC_SR = 0xffffffff; +- Timer_InterruptHandler(); +- TEST_ASSERT(Timer_GetSystemTime() > 0); +-} +- +-void testInterruptHandlerShouldIncrementSystemTimerBy_10(void) +-{ +- Timer_SetSystemTime(0); +- AT91C_BASE_TC0->TC_SR = AT91C_TC_CPCS; +- Timer_InterruptHandler(); +- TEST_ASSERT_EQUAL(10, Timer_GetSystemTime()); +- +- AT91C_BASE_TC0->TC_SR = AT91C_TC_CPCS; +- Timer_InterruptHandler(); +- TEST_ASSERT_EQUAL(20, Timer_GetSystemTime()); +- +- Timer_SetSystemTime(39426857); +- AT91C_BASE_TC0->TC_SR = AT91C_TC_CPCS; +- Timer_InterruptHandler(); +- TEST_ASSERT_EQUAL(39426867, Timer_GetSystemTime()); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerModel.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerModel.c +deleted file mode 100644 +index e92a96aa8e..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestTimerModel.c ++++ /dev/null +@@ -1,18 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "TimerModel.h" +-#include "MockTaskScheduler.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testUpdateTimeShouldDelegateToTaskScheduler(void) +-{ +- TaskScheduler_Update_Expect(19387L); +- TimerModel_UpdateTime(19387L); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c +deleted file mode 100644 +index 08dc045918..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c ++++ /dev/null +@@ -1,21 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "UsartBaudRateRegisterCalculator.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testCalculateBaudRateRegisterSettingShouldCalculateRegisterSettingAppropriately(void) +-{ +- // BaudRate = MCK / (CD x 16) - per datasheet section 30.6.1.2 "Baud Rate Calculation Example" +- TEST_ASSERT_EQUAL(26, UsartModel_CalculateBaudRateRegisterSetting(48000000, 115200)); +- TEST_ASSERT_EQUAL(6, UsartModel_CalculateBaudRateRegisterSetting(3686400, 38400)); +- TEST_ASSERT_EQUAL(23, UsartModel_CalculateBaudRateRegisterSetting(14318180, 38400)); +- TEST_ASSERT_EQUAL(20, UsartModel_CalculateBaudRateRegisterSetting(12000000, 38400)); +- TEST_ASSERT_EQUAL(13, UsartModel_CalculateBaudRateRegisterSetting(12000000, 56800)); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConductor.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConductor.c +deleted file mode 100644 +index fd6de6eb73..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConductor.c ++++ /dev/null +@@ -1,40 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "UsartConductor.h" +-#include "MockUsartModel.h" +-#include "MockUsartHardware.h" +-#include "MockTaskScheduler.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testShouldInitializeHardwareWhenInitCalled(void) +-{ +- UsartModel_GetBaudRateRegisterSetting_ExpectAndReturn(4); +- UsartModel_GetWakeupMessage_ExpectAndReturn("Hey there!"); +- UsartHardware_TransmitString_Expect("Hey there!"); +- UsartHardware_Init_Expect(4); +- +- UsartConductor_Init(); +-} +- +-void testRunShouldNotDoAnythingIfSchedulerSaysItIsNotTimeYet(void) +-{ +- TaskScheduler_DoUsart_ExpectAndReturn(FALSE); +- +- UsartConductor_Run(); +-} +- +-void testRunShouldGetCurrentTemperatureAndTransmitIfSchedulerSaysItIsTime(void) +-{ +- TaskScheduler_DoUsart_ExpectAndReturn(TRUE); +- UsartModel_GetFormattedTemperature_ExpectAndReturn("hey there"); +- UsartHardware_TransmitString_Expect("hey there"); +- +- UsartConductor_Run(); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConfigurator.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConfigurator.c +deleted file mode 100644 +index b23029e9b3..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartConfigurator.c ++++ /dev/null +@@ -1,77 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "UsartConfigurator.h" +- +-AT91S_PIO PioAPeripheral; +-AT91S_PMC PmcPeripheral; +-AT91S_USART Usart0Peripheral; +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testConfigureUsartIOShouldConfigureUsartTxPinfForPeripheralIO(void) +-{ +- AT91C_BASE_PIOA->PIO_ASR = 0; +- AT91C_BASE_PIOA->PIO_BSR = 0xffffffff; +- AT91C_BASE_PIOA->PIO_PDR = 0; +- Usart_ConfigureUsartIO(); +- TEST_ASSERT_EQUAL(USART0_TX_PIN, AT91C_BASE_PIOA->PIO_ASR); +- TEST_ASSERT_EQUAL(0, AT91C_BASE_PIOA->PIO_BSR); +- TEST_ASSERT_EQUAL(USART0_TX_PIN, AT91C_BASE_PIOA->PIO_PDR); +-} +- +-void testEnablePeripheralClockShouldEnableClockToUsartPeripheral(void) +-{ +- AT91C_BASE_PMC->PMC_PCER = 0; +- Usart_EnablePeripheralClock(); +- TEST_ASSERT_EQUAL(((uint32)1) << USART0_CLOCK_ENABLE, AT91C_BASE_PMC->PMC_PCER); +-} +- +-void testResetShouldDisableAllUsartInterrupts(void) +-{ +- AT91C_BASE_US0->US_IDR = 0; +- Usart_Reset(); +- TEST_ASSERT_EQUAL(0xffffffff, AT91C_BASE_US0->US_IDR); +-} +- +-void testResetShouldResetUsartTransmitterAndReceiver(void) +-{ +- AT91C_BASE_US0->US_CR = 0; +- Usart_Reset(); +- TEST_ASSERT_EQUAL(AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS, AT91C_BASE_US0->US_CR); +-} +- +-void testConfigureModeShouldSetUsartModeToAsynchronous(void) +-{ +- uint32 asyncMode = (AT91C_US_USMODE_NORMAL | +- AT91C_US_NBSTOP_1_BIT | +- AT91C_US_PAR_NONE | +- AT91C_US_CHRL_8_BITS | +- AT91C_US_CLKS_CLOCK); +- +- AT91C_BASE_US0->US_MR = ~asyncMode; +- Usart_ConfigureMode(); +- TEST_ASSERT_EQUAL(asyncMode, AT91C_BASE_US0->US_MR); +-} +- +-void testSetBaudRateRegisterShouldSetUsartBaudRateRegisterToValuePassedAsParameter(void) +-{ +- AT91C_BASE_US0->US_BRGR = 0; +- Usart_SetBaudRateRegister(3); +- TEST_ASSERT_EQUAL(3, AT91C_BASE_US0->US_BRGR); +- Usart_SetBaudRateRegister(251); +- TEST_ASSERT_EQUAL(251, AT91C_BASE_US0->US_BRGR); +-} +- +- +-void testEnableShouldEnableUsart0Transmitter(void) +-{ +- AT91C_BASE_US0->US_CR = 0; +- Usart_Enable(); +- TEST_ASSERT_EQUAL(AT91C_US_TXEN, AT91C_BASE_US0->US_CR); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartHardware.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartHardware.c +deleted file mode 100644 +index b4a0d0ca7c..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartHardware.c ++++ /dev/null +@@ -1,37 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "UsartHardware.h" +-#include "AT91SAM7X256.h" +-#include "MockUsartConfigurator.h" +-#include "MockUsartPutChar.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testInitShouldConfigureUsartPeripheralByCallingConfiguratorAppropriately(void) +-{ +- Usart_ConfigureUsartIO_Expect(); +- Usart_EnablePeripheralClock_Expect(); +- Usart_Reset_Expect(); +- Usart_ConfigureMode_Expect(); +- Usart_SetBaudRateRegister_Expect(73); +- Usart_Enable_Expect(); +- +- UsartHardware_Init(73); +-} +- +-void testTransmitStringShouldSendDesiredStringOutUsingUsart(void) +-{ +- Usart_PutChar_Expect('h'); +- Usart_PutChar_Expect('e'); +- Usart_PutChar_Expect('l'); +- Usart_PutChar_Expect('l'); +- Usart_PutChar_Expect('o'); +- +- UsartHardware_TransmitString("hello"); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartModel.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartModel.c +deleted file mode 100644 +index 6ab23bc0f3..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartModel.c ++++ /dev/null +@@ -1,40 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "UsartModel.h" +-#include "ModelConfig.h" +-#include "MockTemperatureFilter.h" +-#include "MockUsartBaudRateRegisterCalculator.h" +-#include +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testGetBaudRateRegisterSettingShouldReturnAppropriateBaudRateRegisterSetting(void) +-{ +- uint8 dummyRegisterSetting = 17; +- UsartModel_CalculateBaudRateRegisterSetting_ExpectAndReturn(MASTER_CLOCK, USART0_BAUDRATE, dummyRegisterSetting); +- +- TEST_ASSERT_EQUAL(dummyRegisterSetting, UsartModel_GetBaudRateRegisterSetting()); +-} +- +-void testGetFormattedTemperatureFormatsTemperatureFromCalculatorAppropriately(void) +-{ +- TemperatureFilter_GetTemperatureInCelcius_ExpectAndReturn(25.0f); +- TEST_ASSERT_EQUAL_STRING("25.0 C\n", UsartModel_GetFormattedTemperature()); +-} +- +-void testShouldReturnErrorMessageUponInvalidTemperatureValue(void) +-{ +- TemperatureFilter_GetTemperatureInCelcius_ExpectAndReturn(-INFINITY); +- TEST_ASSERT_EQUAL_STRING("Temperature sensor failure!\n", UsartModel_GetFormattedTemperature()); +-} +- +-void testShouldReturnWakeupMessage(void) +-{ +- TEST_ASSERT_EQUAL_STRING("It's Awesome Time!\n", UsartModel_GetWakeupMessage()); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartPutChar.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartPutChar.c +deleted file mode 100644 +index 766a88901b..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartPutChar.c ++++ /dev/null +@@ -1,43 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "UsartPutChar.h" +-#include "MockUsartTransmitBufferStatus.h" +- +-AT91S_USART Usart0Peripheral; +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testPutCharShouldWriteDesiredCharacterToUsartTransmitBuffer(void) +-{ +- AT91C_BASE_US0->US_THR = 0; +- +- Usart_ReadyToTransmit_ExpectAndReturn(TRUE); +- Usart_PutChar('x'); +- TEST_ASSERT_EQUAL('x', AT91C_BASE_US0->US_THR); +- +- Usart_ReadyToTransmit_ExpectAndReturn(TRUE); +- Usart_PutChar('1'); +- TEST_ASSERT_EQUAL('1', AT91C_BASE_US0->US_THR); +- +- Usart_ReadyToTransmit_ExpectAndReturn(TRUE); +- Usart_PutChar(':'); +- TEST_ASSERT_EQUAL(':', AT91C_BASE_US0->US_THR); +-} +- +-void testPutCharShouldWaitUntilReadyToTransmitBeforeLoadingTransmitBufffer(void) +-{ +- AT91C_BASE_US0->US_THR = 0; +- +- Usart_ReadyToTransmit_ExpectAndReturn(FALSE); +- Usart_ReadyToTransmit_ExpectAndReturn(FALSE); +- Usart_ReadyToTransmit_ExpectAndReturn(FALSE); +- Usart_ReadyToTransmit_ExpectAndReturn(TRUE); +- Usart_PutChar('x'); +- TEST_ASSERT_EQUAL('x', AT91C_BASE_US0->US_THR); +-} +diff --git a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartTransmitBufferStatus.c b/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartTransmitBufferStatus.c +deleted file mode 100644 +index c06084f325..0000000000 +--- a/components/testframework/libs/cmock/examples/temp_sensor/test/TestUsartTransmitBufferStatus.c ++++ /dev/null +@@ -1,22 +0,0 @@ +-#include "unity.h" +-#include "Types.h" +-#include "UsartTransmitBufferStatus.h" +- +-AT91S_USART Usart0Peripheral; +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void testReadyToTransmitShouldReturnStatusPerTransmitBufferReadyStatus(void) +-{ +- AT91C_BASE_US0->US_CSR = 0; +- TEST_ASSERT(!Usart_ReadyToTransmit()); +- +- AT91C_BASE_US0->US_CSR = AT91C_US_TXRDY; +- TEST_ASSERT(Usart_ReadyToTransmit()); +-} +diff --git a/components/testframework/libs/cmock/lib/cmock.rb b/components/testframework/libs/cmock/lib/cmock.rb +deleted file mode 100644 +index b4dbab57de..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock.rb ++++ /dev/null +@@ -1,104 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-['../config/production_environment', +- 'cmock_header_parser', +- 'cmock_generator', +- 'cmock_file_writer', +- 'cmock_config', +- 'cmock_plugin_manager', +- 'cmock_generator_utils', +- 'cmock_unityhelper_parser'].each { |req| require "#{__dir__}/#{req}" } +- +-class CMock +- def initialize(options = nil) +- cm_config = CMockConfig.new(options) +- cm_unityhelper = CMockUnityHelperParser.new(cm_config) +- cm_writer = CMockFileWriter.new(cm_config) +- cm_gen_utils = CMockGeneratorUtils.new(cm_config, :unity_helper => cm_unityhelper) +- cm_gen_plugins = CMockPluginManager.new(cm_config, cm_gen_utils) +- @cm_parser = CMockHeaderParser.new(cm_config) +- @cm_generator = CMockGenerator.new(cm_config, cm_writer, cm_gen_utils, cm_gen_plugins) +- @silent = (cm_config.verbosity < 2) +- end +- +- def setup_mocks(files) +- [files].flatten.each do |src| +- generate_mock src +- end +- end +- +- def setup_skeletons(files) +- [files].flatten.each do |src| +- generate_skeleton src +- end +- end +- +- private ############################### +- +- def generate_mock(src) +- name = File.basename(src, '.*') +- ext = File.extname(src) +- puts "Creating mock for #{name}..." unless @silent +- @cm_generator.create_mock(name, @cm_parser.parse(name, File.read(src)), ext) +- end +- +- def generate_skeleton(src) +- name = File.basename(src, '.*') +- puts "Creating skeleton for #{name}..." unless @silent +- @cm_generator.create_skeleton(name, @cm_parser.parse(name, File.read(src))) +- end +-end +- +-def option_maker(options, key, val) +- options ||= {} +- options[key.to_sym] = +- if val.chr == ':' +- val[1..-1].to_sym +- elsif val.include? ';' +- val.split(';') +- elsif val == 'true' +- true +- elsif val == 'false' +- false +- elsif val =~ /^\d+$/ +- val.to_i +- else +- val +- end +- options +-end +- +-# Command Line Support ############################### +- +-if $0 == __FILE__ +- usage = "usage: ruby #{__FILE__} (-oOptionsFile) File(s)ToMock" +- +- unless ARGV[0] +- puts usage +- exit 1 +- end +- +- options = {} +- filelist = [] +- ARGV.each do |arg| +- if arg =~ /^-o\"?([a-zA-Z0-9._\\\/:\s]+)\"?/ +- options.merge! CMockConfig.load_config_file_from_yaml(arg.gsub(/^-o/, '')) +- elsif arg == '--skeleton' +- options[:skeleton] = true +- elsif arg =~ /^--([a-zA-Z0-9._\\\/:\s]+)=\"?([a-zA-Z0-9._\-\\\/:\s\;]+)\"?/ +- options = option_maker(options, Regexp.last_match(1), Regexp.last_match(2)) +- else +- filelist << arg +- end +- end +- +- if options[:skeleton] +- CMock.new(options).setup_skeletons(filelist) +- else +- CMock.new(options).setup_mocks(filelist) +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_config.rb b/components/testframework/libs/cmock/lib/cmock_config.rb +deleted file mode 100644 +index 9515481c9e..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_config.rb ++++ /dev/null +@@ -1,173 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockConfig +- CMOCK_DEFAULT_OPTIONS = +- { +- :framework => :unity, +- :mock_path => 'mocks', +- :mock_prefix => 'Mock', +- :mock_suffix => '', +- :skeleton_path => '', +- :weak => '', +- :subdir => nil, +- :plugins => [], +- :strippables => ['(?:__attribute__\s*\(+.*?\)+)'], +- :attributes => %w[__ramfunc __irq __fiq register extern], +- :c_calling_conventions => %w[__stdcall __cdecl __fastcall], +- :enforce_strict_ordering => false, +- :fail_on_unexpected_calls => true, +- :unity_helper_path => false, +- :treat_as => {}, +- :treat_as_array => {}, +- :treat_as_void => [], +- :memcmp_if_unknown => true, +- :when_no_prototypes => :warn, # the options being :ignore, :warn, or :error +- :when_ptr => :compare_data, # the options being :compare_ptr, :compare_data, or :smart +- :verbosity => 2, # the options being 0 errors only, 1 warnings and errors, 2 normal info, 3 verbose +- :treat_externs => :exclude, # the options being :include or :exclude +- :treat_inlines => :exclude, # the options being :include or :exclude +- :callback_include_count => true, +- :callback_after_arg_check => false, +- :includes => nil, +- :includes_h_pre_orig_header => nil, +- :includes_h_post_orig_header => nil, +- :includes_c_pre_header => nil, +- :includes_c_post_header => nil, +- :orig_header_include_fmt => '#include "%s"', +- :array_size_type => [], +- :array_size_name => 'size|len', +- :skeleton => false, +- +- # Format to look for inline functions. +- # This is a combination of "static" and "inline" keywords ("static inline", "inline static", "inline", "static") +- # There are several possibilities: +- # - sometimes they appear together, sometimes individually, +- # - The keywords can appear before or after the return type (this is a compiler warning but people do weird stuff), +- # so we check for word boundaries when searching for them +- # - We first remove "static inline" combinations and boil down to single inline or static statements +- :inline_function_patterns => ['(static\s+inline|inline\s+static)\s*', '(\bstatic\b|\binline\b)\s*'] # Last part (\s*) is just to remove whitespaces (only to prettify the output) +- }.freeze +- +- def initialize(options = nil) +- case options +- when NilClass then options = CMOCK_DEFAULT_OPTIONS.dup +- when String then options = CMOCK_DEFAULT_OPTIONS.dup.merge(load_config_file_from_yaml(options)) +- when Hash then options = CMOCK_DEFAULT_OPTIONS.dup.merge(options) +- else raise 'If you specify arguments, it should be a filename or a hash of options' +- end +- +- # do some quick type verification +- %i[plugins attributes treat_as_void].each do |opt| +- unless options[opt].class == Array +- options[opt] = [] +- puts "WARNING: :#{opt} should be an array." unless options[:verbosity] < 1 +- end +- end +- %i[includes includes_h_pre_orig_header includes_h_post_orig_header includes_c_pre_header includes_c_post_header].each do |opt| +- unless options[opt].nil? || (options[opt].class == Array) +- options[opt] = [] +- puts "WARNING: :#{opt} should be an array." unless options[:verbosity] < 1 +- end +- end +- options[:unity_helper_path] ||= options[:unity_helper] +- options[:unity_helper_path] = [options[:unity_helper_path]] if options[:unity_helper_path].is_a? String +- +- if options[:unity_helper_path] +- require 'pathname' +- includes1 = options[:includes_c_post_header] || [] +- includes2 = options[:unity_helper_path].map do |path| +- Pathname(path).relative_path_from(Pathname(options[:mock_path])).to_s +- end +- options[:includes_c_post_header] = (includes1 + includes2).uniq +- end +- +- options[:plugins].compact! +- options[:plugins].map!(&:to_sym) +- @options = options +- +- treat_as_map = standard_treat_as_map # .clone +- treat_as_map.merge!(@options[:treat_as]) +- @options[:treat_as] = treat_as_map +- +- @options.each_key do |key| +- unless methods.include?(key) +- eval("def #{key}() return @options[:#{key}] end") +- end +- end +- end +- +- def load_config_file_from_yaml(yaml_filename) +- self.class.load_config_file_from_yaml yaml_filename +- end +- +- def self.load_config_file_from_yaml(yaml_filename) +- require 'yaml' +- require 'fileutils' +- YAML.load_file(yaml_filename)[:cmock] +- end +- +- def path(new_path) +- @src_path = new_path +- end +- +- def load_unity_helper +- return nil unless @options[:unity_helper_path] +- +- @options[:unity_helper_path].inject('') do |unity_helper, filename| +- unity_helper + "\n" + File.new(filename).read +- end +- end +- +- def standard_treat_as_map +- { +- 'int' => 'INT', +- 'char' => 'INT8', +- 'short' => 'INT16', +- 'long' => 'INT', +- 'int8' => 'INT8', +- 'int16' => 'INT16', +- 'int32' => 'INT', +- 'int8_t' => 'INT8', +- 'int16_t' => 'INT16', +- 'int32_t' => 'INT', +- 'INT8_T' => 'INT8', +- 'INT16_T' => 'INT16', +- 'INT32_T' => 'INT', +- 'bool' => 'INT', +- 'bool_t' => 'INT', +- 'BOOL' => 'INT', +- 'BOOL_T' => 'INT', +- 'unsigned int' => 'HEX32', +- 'unsigned long' => 'HEX32', +- 'uint32' => 'HEX32', +- 'uint32_t' => 'HEX32', +- 'UINT32' => 'HEX32', +- 'UINT32_T' => 'HEX32', +- 'void*' => 'HEX8_ARRAY', +- 'void const*' => 'HEX8_ARRAY', +- 'const void*' => 'HEX8_ARRAY', +- 'unsigned short' => 'HEX16', +- 'uint16' => 'HEX16', +- 'uint16_t' => 'HEX16', +- 'UINT16' => 'HEX16', +- 'UINT16_T' => 'HEX16', +- 'unsigned char' => 'HEX8', +- 'uint8' => 'HEX8', +- 'uint8_t' => 'HEX8', +- 'UINT8' => 'HEX8', +- 'UINT8_T' => 'HEX8', +- 'char*' => 'STRING', +- 'char const*' => 'STRING', +- 'const char*' => 'STRING', +- 'pCHAR' => 'STRING', +- 'cstring' => 'STRING', +- 'CSTRING' => 'STRING', +- 'float' => 'FLOAT', +- 'double' => 'FLOAT' +- } +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_file_writer.rb b/components/testframework/libs/cmock/lib/cmock_file_writer.rb +deleted file mode 100644 +index 787d688e1d..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_file_writer.rb ++++ /dev/null +@@ -1,48 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockFileWriter +- attr_reader :config +- +- def initialize(config) +- @config = config +- end +- +- def create_subdir(subdir) +- require 'fileutils' +- FileUtils.mkdir_p "#{@config.mock_path}/" unless Dir.exist?("#{@config.mock_path}/") +- FileUtils.mkdir_p "#{@config.mock_path}/#{subdir + '/' if subdir}" if subdir && !Dir.exist?("#{@config.mock_path}/#{subdir + '/' if subdir}") +- end +- +- def create_file(filename, subdir) +- raise "Where's the block of data to create?" unless block_given? +- +- full_file_name_temp = "#{@config.mock_path}/#{subdir + '/' if subdir}#{filename}.new" +- full_file_name_done = "#{@config.mock_path}/#{subdir + '/' if subdir}#{filename}" +- File.open(full_file_name_temp, 'w') do |file| +- yield(file, filename) +- end +- update_file(full_file_name_done, full_file_name_temp) +- end +- +- def append_file(filename, subdir) +- raise "Where's the block of data to create?" unless block_given? +- +- full_file_name = "#{@config.skeleton_path}/#{subdir + '/' if subdir}#{filename}" +- File.open(full_file_name, 'a') do |file| +- yield(file, filename) +- end +- end +- +- private ################################### +- +- def update_file(dest, src) +- require 'fileutils' +- FileUtils.rm(dest) if File.exist?(dest) +- FileUtils.cp(src, dest) +- FileUtils.rm(src) +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_generator.rb b/components/testframework/libs/cmock/lib/cmock_generator.rb +deleted file mode 100644 +index f08cadd770..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_generator.rb ++++ /dev/null +@@ -1,333 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockGenerator +- attr_accessor :config, :file_writer, :module_name, :module_ext, :clean_mock_name, :mock_name, :utils, :plugins, :weak, :ordered +- +- def initialize(config, file_writer, utils, plugins) +- @file_writer = file_writer +- @utils = utils +- @plugins = plugins +- @config = config +- @prefix = @config.mock_prefix +- @suffix = @config.mock_suffix +- @weak = @config.weak +- @include_inline = @config.treat_inlines +- @ordered = @config.enforce_strict_ordering +- @framework = @config.framework.to_s +- @fail_on_unexpected_calls = @config.fail_on_unexpected_calls +- +- @subdir = @config.subdir +- +- @includes_h_pre_orig_header = (@config.includes || @config.includes_h_pre_orig_header || []).map { |h| h =~ / 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n" +- file << "#pragma GCC diagnostic push\n" +- file << "#endif\n" +- file << "#if !defined(__clang__)\n" +- file << "#pragma GCC diagnostic ignored \"-Wpragmas\"\n" +- file << "#endif\n" +- file << "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n" +- file << "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n" +- file << "#endif\n" +- file << "\n" +- end +- +- def create_typedefs(file, typedefs) +- file << "\n" +- typedefs.each { |typedef| file << "#{typedef}\n" } +- file << "\n\n" +- end +- +- def create_mock_header_service_call_declarations(file) +- file << "void #{@clean_mock_name}_Init(void);\n" +- file << "void #{@clean_mock_name}_Destroy(void);\n" +- file << "void #{@clean_mock_name}_Verify(void);\n\n" +- end +- +- def create_mock_header_footer(header) +- header << "\n" +- header << "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n" +- header << "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n" +- header << "#pragma GCC diagnostic pop\n" +- header << "#endif\n" +- header << "#endif\n" +- header << "\n" +- header << "#endif\n" +- end +- +- def create_source_header_section(file, filename, functions) +- header_file = (@subdir ? @subdir + '/' : '') + filename.gsub('.c', (@module_ext || '.h')) +- file << "/* AUTOGENERATED FILE. DO NOT EDIT. */\n" unless functions.empty? +- file << "#include \n" +- file << "#include \n" +- file << "#include \n" +- file << "#include \"cmock.h\"\n" +- @includes_c_pre_header.each { |inc| file << "#include #{inc}\n" } +- file << "#include \"#{header_file}\"\n" +- @includes_c_post_header.each { |inc| file << "#include #{inc}\n" } +- file << "\n" +- strs = [] +- functions.each do |func| +- strs << func[:name] +- func[:args].each { |arg| strs << arg[:name] } +- end +- strs.uniq.sort.each do |str| +- file << "static const char* CMockString_#{str} = \"#{str}\";\n" +- end +- file << "\n" +- end +- +- def create_instance_structure(file, functions) +- functions.each do |function| +- file << "typedef struct _CMOCK_#{function[:name]}_CALL_INSTANCE\n{\n" +- file << " UNITY_LINE_TYPE LineNumber;\n" +- file << @plugins.run(:instance_typedefs, function) +- file << "\n} CMOCK_#{function[:name]}_CALL_INSTANCE;\n\n" +- end +- file << "static struct #{@clean_mock_name}Instance\n{\n" +- if functions.empty? +- file << " unsigned char placeHolder;\n" +- end +- functions.each do |function| +- file << @plugins.run(:instance_structure, function) +- file << " CMOCK_MEM_INDEX_TYPE #{function[:name]}_CallInstance;\n" +- end +- file << "} Mock;\n\n" +- end +- +- def create_extern_declarations(file) +- file << "extern jmp_buf AbortFrame;\n" +- if @ordered +- file << "extern int GlobalExpectCount;\n" +- file << "extern int GlobalVerifyOrder;\n" +- end +- file << "\n" +- end +- +- def create_mock_verify_function(file, functions) +- file << "void #{@clean_mock_name}_Verify(void)\n{\n" +- verifications = functions.collect do |function| +- v = @plugins.run(:mock_verify, function) +- v.empty? ? v : [" call_instance = Mock.#{function[:name]}_CallInstance;\n", v] +- end.join +- unless verifications.empty? +- file << " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n" +- file << " CMOCK_MEM_INDEX_TYPE call_instance;\n" +- file << verifications +- end +- file << "}\n\n" +- end +- +- def create_mock_init_function(file) +- file << "void #{@clean_mock_name}_Init(void)\n{\n" +- file << " #{@clean_mock_name}_Destroy();\n" +- file << "}\n\n" +- end +- +- def create_mock_destroy_function(file, functions) +- file << "void #{@clean_mock_name}_Destroy(void)\n{\n" +- file << " CMock_Guts_MemFreeAll();\n" +- file << " memset(&Mock, 0, sizeof(Mock));\n" +- file << functions.collect { |function| @plugins.run(:mock_destroy, function) }.join +- +- unless @fail_on_unexpected_calls +- file << functions.collect { |function| @plugins.run(:mock_ignore, function) }.join +- end +- +- if @ordered +- file << " GlobalExpectCount = 0;\n" +- file << " GlobalVerifyOrder = 0;\n" +- end +- file << "}\n\n" +- end +- +- def create_mock_implementation(file, function) +- # prepare return value and arguments +- function_mod_and_rettype = (function[:modifier].empty? ? '' : "#{function[:modifier]} ") + +- (function[:return][:type]) + +- (function[:c_calling_convention] ? " #{function[:c_calling_convention]}" : '') +- args_string = function[:args_string] +- args_string += (', ' + function[:var_arg]) unless function[:var_arg].nil? +- +- # Encapsulate in namespace(s) if applicable +- function[:namespace].each do |ns| +- file << "namespace #{ns} {\n" +- end +- +- # Determine class prefix (if any) +- cls_pre = '' +- unless function[:class].nil? +- cls_pre = "#{function[:class]}::" +- end +- +- # Create mock function +- unless @weak.empty? +- file << "#if defined (__IAR_SYSTEMS_ICC__)\n" +- file << "#pragma weak #{function[:unscoped_name]}\n" +- file << "#else\n" +- file << "#{function_mod_and_rettype} #{function[:unscoped_name]}(#{args_string}) #{weak};\n" +- file << "#endif\n\n" +- end +- file << "#{function_mod_and_rettype} #{cls_pre}#{function[:unscoped_name]}(#{args_string})\n" +- file << "{\n" +- file << " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n" +- file << " CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance;\n" +- file << " UNITY_SET_DETAIL(CMockString_#{function[:name]});\n" +- file << " cmock_call_instance = (CMOCK_#{function[:name]}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.#{function[:name]}_CallInstance);\n" +- file << " Mock.#{function[:name]}_CallInstance = CMock_Guts_MemNext(Mock.#{function[:name]}_CallInstance);\n" +- file << @plugins.run(:mock_implementation_precheck, function) +- file << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n" +- file << " cmock_line = cmock_call_instance->LineNumber;\n" +- if @ordered +- file << " if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)\n" +- file << " UNITY_TEST_FAIL(cmock_line, CMockStringCalledEarly);\n" +- file << " if (cmock_call_instance->CallOrder < GlobalVerifyOrder)\n" +- file << " UNITY_TEST_FAIL(cmock_line, CMockStringCalledLate);\n" +- end +- file << @plugins.run(:mock_implementation, function) +- file << " UNITY_CLR_DETAILS();\n" +- file << " return cmock_call_instance->ReturnVal;\n" unless function[:return][:void?] +- file << "}\n" +- +- # Close any namespace(s) opened above +- function[:namespace].each do +- file << "}\n" +- end +- +- file << "\n" +- end +- +- def create_mock_interfaces(file, function) +- file << @utils.code_add_argument_loader(function) +- file << @plugins.run(:mock_interfaces, function) +- end +- +- def create_function_skeleton(file, function, existing) +- # prepare return value and arguments +- function_mod_and_rettype = (function[:modifier].empty? ? '' : "#{function[:modifier]} ") + +- (function[:return][:type]) + +- (function[:c_calling_convention] ? " #{function[:c_calling_convention]}" : '') +- args_string = function[:args_string] +- args_string += (', ' + function[:var_arg]) unless function[:var_arg].nil? +- +- decl = "#{function_mod_and_rettype} #{function[:name]}(#{args_string})" +- +- return if existing.include?(decl) +- +- file << "#{decl}\n" +- file << "{\n" +- file << " /*TODO: Implement Me!*/\n" +- function[:args].each { |arg| file << " (void)#{arg[:name]};\n" } +- file << " return (#{(function[:return][:type])})0;\n" unless function[:return][:void?] +- file << "}\n\n" +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_array.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_array.rb +deleted file mode 100644 +index a9864ab749..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_array.rb ++++ /dev/null +@@ -1,63 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockGeneratorPluginArray +- attr_reader :priority +- attr_accessor :config, :utils, :unity_helper, :ordered +- def initialize(config, utils) +- @config = config +- @ptr_handling = @config.when_ptr +- @ordered = @config.enforce_strict_ordering +- @utils = utils +- @unity_helper = @utils.helpers[:unity_helper] +- @priority = 8 +- end +- +- def instance_typedefs(function) +- function[:args].inject('') do |all, arg| +- arg[:ptr?] ? all + " int Expected_#{arg[:name]}_Depth;\n" : all +- end +- end +- +- def mock_function_declarations(function) +- return nil unless function[:contains_ptr?] +- +- args_call = function[:args].map { |m| m[:ptr?] ? "#{m[:name]}, #{m[:name]}_Depth" : (m[:name]).to_s }.join(', ') +- args_string = function[:args].map do |m| +- type = @utils.arg_type_with_const(m) +- m[:ptr?] ? "#{type} #{m[:name]}, int #{m[:name]}_Depth" : "#{type} #{m[:name]}" +- end.join(', ') +- if function[:return][:void?] +- return "#define #{function[:name]}_ExpectWithArray(#{args_call}) #{function[:name]}_CMockExpectWithArray(__LINE__, #{args_call})\n" \ +- "void #{function[:name]}_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, #{args_string});\n" +- else +- return "#define #{function[:name]}_ExpectWithArrayAndReturn(#{args_call}, cmock_retval) #{function[:name]}_CMockExpectWithArrayAndReturn(__LINE__, #{args_call}, cmock_retval)\n" \ +- "void #{function[:name]}_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, #{args_string}, #{function[:return][:str]});\n" +- end +- end +- +- def mock_interfaces(function) +- return nil unless function[:contains_ptr?] +- +- lines = [] +- func_name = function[:name] +- args_string = function[:args].map do |m| +- type = @utils.arg_type_with_const(m) +- m[:ptr?] ? "#{type} #{m[:name]}, int #{m[:name]}_Depth" : "#{type} #{m[:name]}" +- end.join(', ') +- call_string = function[:args].map { |m| m[:ptr?] ? "#{m[:name]}, #{m[:name]}_Depth" : m[:name] }.join(', ') +- lines << if function[:return][:void?] +- "void #{func_name}_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, #{args_string})\n" +- else +- "void #{func_name}_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, #{args_string}, #{function[:return][:str]})\n" +- end +- lines << "{\n" +- lines << @utils.code_add_base_expectation(func_name) +- lines << " CMockExpectParameters_#{func_name}(cmock_call_instance, #{call_string});\n" +- lines << " cmock_call_instance->ReturnVal = cmock_to_return;\n" unless function[:return][:void?] +- lines << "}\n\n" +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_callback.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_callback.rb +deleted file mode 100644 +index 6ba8e9bd9f..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_callback.rb ++++ /dev/null +@@ -1,88 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockGeneratorPluginCallback +- attr_accessor :include_count +- attr_reader :priority +- attr_reader :config, :utils +- +- def initialize(config, utils) +- @config = config +- @utils = utils +- @priority = 6 +- +- @include_count = @config.callback_include_count +- end +- +- def instance_structure(function) +- func_name = function[:name] +- " char #{func_name}_CallbackBool;\n" \ +- " CMOCK_#{func_name}_CALLBACK #{func_name}_CallbackFunctionPointer;\n" \ +- " int #{func_name}_CallbackCalls;\n" +- end +- +- def mock_function_declarations(function) +- func_name = function[:name] +- return_type = function[:return][:type] +- action = @config.callback_after_arg_check ? 'AddCallback' : 'Stub' +- style = (@include_count ? 1 : 0) | (function[:args].empty? ? 0 : 2) +- styles = ['void', 'int cmock_num_calls', function[:args_string], "#{function[:args_string]}, int cmock_num_calls"] +- "typedef #{return_type} (* CMOCK_#{func_name}_CALLBACK)(#{styles[style]});\n" \ +- "void #{func_name}_AddCallback(CMOCK_#{func_name}_CALLBACK Callback);\n" \ +- "void #{func_name}_Stub(CMOCK_#{func_name}_CALLBACK Callback);\n" \ +- "#define #{func_name}_StubWithCallback #{func_name}_#{action}\n" +- end +- +- def generate_call(function) +- args = function[:args].map { |m| m[:name] } +- args << "Mock.#{function[:name]}_CallbackCalls++" if @include_count +- "Mock.#{function[:name]}_CallbackFunctionPointer(#{args.join(', ')})" +- end +- +- def mock_implementation(function) +- " if (Mock.#{function[:name]}_CallbackFunctionPointer != NULL)\n {\n" + +- if function[:return][:void?] +- " #{generate_call(function)};\n }\n" +- else +- " cmock_call_instance->ReturnVal = #{generate_call(function)};\n }\n" +- end +- end +- +- def mock_implementation_precheck(function) +- " if (!Mock.#{function[:name]}_CallbackBool &&\n" \ +- " Mock.#{function[:name]}_CallbackFunctionPointer != NULL)\n {\n" + +- if function[:return][:void?] +- " #{generate_call(function)};\n" \ +- " UNITY_CLR_DETAILS();\n" \ +- " return;\n }\n" +- else +- " #{function[:return][:type]} cmock_cb_ret = #{generate_call(function)};\n" \ +- " UNITY_CLR_DETAILS();\n" \ +- " return cmock_cb_ret;\n }\n" +- end +- end +- +- def mock_interfaces(function) +- func_name = function[:name] +- has_ignore = @config.plugins.include? :ignore +- lines = '' +- lines << "void #{func_name}_AddCallback(CMOCK_#{func_name}_CALLBACK Callback)\n{\n" +- lines << " Mock.#{func_name}_IgnoreBool = (char)0;\n" if has_ignore +- lines << " Mock.#{func_name}_CallbackBool = (char)1;\n" +- lines << " Mock.#{func_name}_CallbackFunctionPointer = Callback;\n}\n\n" +- lines << "void #{func_name}_Stub(CMOCK_#{func_name}_CALLBACK Callback)\n{\n" +- lines << " Mock.#{func_name}_IgnoreBool = (char)0;\n" if has_ignore +- lines << " Mock.#{func_name}_CallbackBool = (char)0;\n" +- lines << " Mock.#{func_name}_CallbackFunctionPointer = Callback;\n}\n\n" +- end +- +- def mock_verify(function) +- func_name = function[:name] +- " if (Mock.#{func_name}_CallbackFunctionPointer != NULL)\n {\n" \ +- " call_instance = CMOCK_GUTS_NONE;\n" \ +- " (void)call_instance;\n }\n" +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_cexception.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_cexception.rb +deleted file mode 100644 +index a757669e69..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_cexception.rb ++++ /dev/null +@@ -1,49 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockGeneratorPluginCexception +- attr_reader :priority +- attr_reader :config, :utils +- +- def initialize(config, utils) +- @config = config +- @utils = utils +- @priority = 7 +- end +- +- def include_files +- "#include \"CException.h\"\n" +- end +- +- def instance_typedefs(_function) +- " CEXCEPTION_T ExceptionToThrow;\n" +- end +- +- def mock_function_declarations(function) +- if function[:args_string] == 'void' +- "#define #{function[:name]}_ExpectAndThrow(cmock_to_throw) #{function[:name]}_CMockExpectAndThrow(__LINE__, cmock_to_throw)\n" \ +- "void #{function[:name]}_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, CEXCEPTION_T cmock_to_throw);\n" +- else +- "#define #{function[:name]}_ExpectAndThrow(#{function[:args_call]}, cmock_to_throw) #{function[:name]}_CMockExpectAndThrow(__LINE__, #{function[:args_call]}, cmock_to_throw)\n" \ +- "void #{function[:name]}_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, #{function[:args_string]}, CEXCEPTION_T cmock_to_throw);\n" +- end +- end +- +- def mock_implementation(_function) +- " if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)\n {\n" \ +- " UNITY_CLR_DETAILS();\n" \ +- " Throw(cmock_call_instance->ExceptionToThrow);\n }\n" +- end +- +- def mock_interfaces(function) +- arg_insert = function[:args_string] == 'void' ? '' : "#{function[:args_string]}, " +- ["void #{function[:name]}_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, #{arg_insert}CEXCEPTION_T cmock_to_throw)\n{\n", +- @utils.code_add_base_expectation(function[:name]), +- @utils.code_call_argument_loader(function), +- " cmock_call_instance->ExceptionToThrow = cmock_to_throw;\n", +- "}\n\n"].join +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect.rb +deleted file mode 100644 +index 3a79c1a4d8..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect.rb ++++ /dev/null +@@ -1,100 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockGeneratorPluginExpect +- attr_reader :priority +- attr_accessor :config, :utils, :unity_helper, :ordered +- +- def initialize(config, utils) +- @config = config +- @ptr_handling = @config.when_ptr +- @ordered = @config.enforce_strict_ordering +- @utils = utils +- @unity_helper = @utils.helpers[:unity_helper] +- @priority = 5 +- +- if @config.plugins.include? :expect_any_args +- alias :mock_implementation :mock_implementation_might_check_args +- else +- alias :mock_implementation :mock_implementation_always_check_args +- end +- end +- +- def instance_typedefs(function) +- lines = '' +- lines << " #{function[:return][:type]} ReturnVal;\n" unless function[:return][:void?] +- lines << " int CallOrder;\n" if @ordered +- function[:args].each do |arg| +- lines << " #{arg[:type]} Expected_#{arg[:name]};\n" +- end +- lines +- end +- +- def mock_function_declarations(function) +- if function[:args].empty? +- if function[:return][:void?] +- "#define #{function[:name]}_Expect() #{function[:name]}_CMockExpect(__LINE__)\n" \ +- "void #{function[:name]}_CMockExpect(UNITY_LINE_TYPE cmock_line);\n" +- else +- "#define #{function[:name]}_ExpectAndReturn(cmock_retval) #{function[:name]}_CMockExpectAndReturn(__LINE__, cmock_retval)\n" \ +- "void #{function[:name]}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]});\n" +- end +- elsif function[:return][:void?] +- "#define #{function[:name]}_Expect(#{function[:args_call]}) #{function[:name]}_CMockExpect(__LINE__, #{function[:args_call]})\n" \ +- "void #{function[:name]}_CMockExpect(UNITY_LINE_TYPE cmock_line, #{function[:args_string]});\n" +- else +- "#define #{function[:name]}_ExpectAndReturn(#{function[:args_call]}, cmock_retval) #{function[:name]}_CMockExpectAndReturn(__LINE__, #{function[:args_call]}, cmock_retval)\n" \ +- "void #{function[:name]}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:args_string]}, #{function[:return][:str]});\n" +- end +- end +- +- def mock_implementation_always_check_args(function) +- lines = '' +- function[:args].each do |arg| +- lines << @utils.code_verify_an_arg_expectation(function, arg) +- end +- lines +- end +- +- def mock_implementation_might_check_args(function) +- return '' if function[:args].empty? +- +- lines = " if (!cmock_call_instance->ExpectAnyArgsBool)\n {\n" +- function[:args].each do |arg| +- lines << @utils.code_verify_an_arg_expectation(function, arg) +- end +- lines << " }\n" +- lines +- end +- +- def mock_interfaces(function) +- lines = '' +- func_name = function[:name] +- lines << if function[:return][:void?] +- if function[:args_string] == 'void' +- "void #{func_name}_CMockExpect(UNITY_LINE_TYPE cmock_line)\n{\n" +- else +- "void #{func_name}_CMockExpect(UNITY_LINE_TYPE cmock_line, #{function[:args_string]})\n{\n" +- end +- elsif function[:args_string] == 'void' +- "void #{func_name}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]})\n{\n" +- else +- "void #{func_name}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:args_string]}, #{function[:return][:str]})\n{\n" +- end +- lines << @utils.code_add_base_expectation(func_name) +- lines << @utils.code_call_argument_loader(function) +- lines << @utils.code_assign_argument_quickly('cmock_call_instance->ReturnVal', function[:return]) unless function[:return][:void?] +- lines << "}\n\n" +- end +- +- def mock_verify(function) +- " if (CMOCK_GUTS_NONE != call_instance)\n" \ +- " {\n" \ +- " UNITY_SET_DETAIL(CMockString_#{function[:name]});\n" \ +- " UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess);\n" \ +- " }\n" +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect_any_args.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect_any_args.rb +deleted file mode 100644 +index 0fc88e1246..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_expect_any_args.rb ++++ /dev/null +@@ -1,50 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockGeneratorPluginExpectAnyArgs +- attr_reader :priority +- attr_reader :config, :utils +- +- def initialize(config, utils) +- @config = config +- @utils = utils +- @priority = 3 +- end +- +- def instance_typedefs(_function) +- " char ExpectAnyArgsBool;\n" +- end +- +- def mock_function_declarations(function) +- if function[:args].empty? +- '' +- elsif function[:return][:void?] +- "#define #{function[:name]}_ExpectAnyArgs() #{function[:name]}_CMockExpectAnyArgs(__LINE__)\n" \ +- "void #{function[:name]}_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line);\n" +- else +- "#define #{function[:name]}_ExpectAnyArgsAndReturn(cmock_retval) #{function[:name]}_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval)\n" \ +- "void #{function[:name]}_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]});\n" +- end +- end +- +- def mock_interfaces(function) +- lines = '' +- unless function[:args].empty? +- lines << if function[:return][:void?] +- "void #{function[:name]}_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line)\n{\n" +- else +- "void #{function[:name]}_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]})\n{\n" +- end +- lines << @utils.code_add_base_expectation(function[:name], true) +- unless function[:return][:void?] +- lines << " cmock_call_instance->ReturnVal = cmock_to_return;\n" +- end +- lines << " cmock_call_instance->ExpectAnyArgsBool = (char)1;\n" +- lines << "}\n\n" +- end +- lines +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore.rb +deleted file mode 100644 +index b292f3d4f0..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore.rb ++++ /dev/null +@@ -1,88 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockGeneratorPluginIgnore +- attr_reader :priority +- attr_reader :config, :utils +- +- def initialize(config, utils) +- @config = config +- @utils = utils +- @priority = 2 +- end +- +- def instance_structure(function) +- if function[:return][:void?] +- " char #{function[:name]}_IgnoreBool;\n" +- else +- " char #{function[:name]}_IgnoreBool;\n #{function[:return][:type]} #{function[:name]}_FinalReturn;\n" +- end +- end +- +- def mock_function_declarations(function) +- lines = if function[:return][:void?] +- "#define #{function[:name]}_Ignore() #{function[:name]}_CMockIgnore()\n" \ +- "void #{function[:name]}_CMockIgnore(void);\n" +- else +- "#define #{function[:name]}_IgnoreAndReturn(cmock_retval) #{function[:name]}_CMockIgnoreAndReturn(__LINE__, cmock_retval)\n" \ +- "void #{function[:name]}_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]});\n" +- end +- +- # Add stop ignore function. it does not matter if there are any args +- lines << "#define #{function[:name]}_StopIgnore() #{function[:name]}_CMockStopIgnore()\n" \ +- "void #{function[:name]}_CMockStopIgnore(void);\n" +- lines +- end +- +- def mock_implementation_precheck(function) +- lines = " if (Mock.#{function[:name]}_IgnoreBool)\n {\n" +- lines << " UNITY_CLR_DETAILS();\n" +- if function[:return][:void?] +- lines << " return;\n }\n" +- else +- retval = function[:return].merge(:name => 'cmock_call_instance->ReturnVal') +- lines << " if (cmock_call_instance == NULL)\n return Mock.#{function[:name]}_FinalReturn;\n" +- lines << ' ' + @utils.code_assign_argument_quickly("Mock.#{function[:name]}_FinalReturn", retval) unless retval[:void?] +- lines << " return cmock_call_instance->ReturnVal;\n }\n" +- end +- lines +- end +- +- def mock_interfaces(function) +- lines = '' +- lines << if function[:return][:void?] +- "void #{function[:name]}_CMockIgnore(void)\n{\n" +- else +- "void #{function[:name]}_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]})\n{\n" +- end +- unless function[:return][:void?] +- lines << @utils.code_add_base_expectation(function[:name], false) +- end +- unless function[:return][:void?] +- lines << " cmock_call_instance->ReturnVal = cmock_to_return;\n" +- end +- lines << " Mock.#{function[:name]}_IgnoreBool = (char)1;\n" +- lines << "}\n\n" +- +- # Add stop ignore function. it does not matter if there are any args +- lines << "void #{function[:name]}_CMockStopIgnore(void)\n{\n" +- unless function[:return][:void?] +- lines << " if(Mock.#{function[:name]}_IgnoreBool)\n" +- lines << " Mock.#{function[:name]}_CallInstance = CMock_Guts_MemNext(Mock.#{function[:name]}_CallInstance);\n" +- end +- lines << " Mock.#{function[:name]}_IgnoreBool = (char)0;\n" +- lines << "}\n\n" +- end +- +- def mock_ignore(function) +- " Mock.#{function[:name]}_IgnoreBool = (char) 1;\n" +- end +- +- def mock_verify(function) +- func_name = function[:name] +- " if (Mock.#{func_name}_IgnoreBool)\n call_instance = CMOCK_GUTS_NONE;\n" +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore_arg.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore_arg.rb +deleted file mode 100644 +index d55e84c252..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_ignore_arg.rb ++++ /dev/null +@@ -1,42 +0,0 @@ +-class CMockGeneratorPluginIgnoreArg +- attr_reader :priority +- attr_accessor :utils +- +- def initialize(_config, utils) +- @utils = utils +- @priority = 10 +- end +- +- def instance_typedefs(function) +- lines = '' +- function[:args].each do |arg| +- lines << " char IgnoreArg_#{arg[:name]};\n" +- end +- lines +- end +- +- def mock_function_declarations(function) +- lines = '' +- function[:args].each do |arg| +- lines << "#define #{function[:name]}_IgnoreArg_#{arg[:name]}()" +- lines << " #{function[:name]}_CMockIgnoreArg_#{arg[:name]}(__LINE__)\n" +- lines << "void #{function[:name]}_CMockIgnoreArg_#{arg[:name]}(UNITY_LINE_TYPE cmock_line);\n" +- end +- lines +- end +- +- def mock_interfaces(function) +- lines = [] +- func_name = function[:name] +- function[:args].each do |arg| +- lines << "void #{func_name}_CMockIgnoreArg_#{arg[:name]}(UNITY_LINE_TYPE cmock_line)\n" +- lines << "{\n" +- lines << " CMOCK_#{func_name}_CALL_INSTANCE* cmock_call_instance = " \ +- "(CMOCK_#{func_name}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.#{func_name}_CallInstance));\n" +- lines << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp);\n" +- lines << " cmock_call_instance->IgnoreArg_#{arg[:name]} = 1;\n" +- lines << "}\n\n" +- end +- lines +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb b/components/testframework/libs/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +deleted file mode 100644 +index 9321559360..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb ++++ /dev/null +@@ -1,79 +0,0 @@ +-class CMockGeneratorPluginReturnThruPtr +- attr_reader :priority +- attr_accessor :utils +- +- def initialize(_config, utils) +- @utils = utils +- @priority = 9 +- end +- +- def instance_typedefs(function) +- lines = '' +- function[:args].each do |arg| +- next unless @utils.ptr_or_str?(arg[:type]) && !(arg[:const?]) +- +- lines << " char ReturnThruPtr_#{arg[:name]}_Used;\n" +- lines << " #{arg[:type]} ReturnThruPtr_#{arg[:name]}_Val;\n" +- lines << " int ReturnThruPtr_#{arg[:name]}_Size;\n" +- end +- lines +- end +- +- def mock_function_declarations(function) +- lines = '' +- function[:args].each do |arg| +- next unless @utils.ptr_or_str?(arg[:type]) && !(arg[:const?]) +- +- lines << "#define #{function[:name]}_ReturnThruPtr_#{arg[:name]}(#{arg[:name]})" +- # If the pointer type actually contains an asterisk, we can do sizeof the type (super safe), otherwise +- # we need to do a sizeof the dereferenced pointer (which could be a problem if give the wrong size +- lines << if arg[:type][-1] == '*' +- " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, sizeof(#{arg[:type][0..-2]}))\n" +- else +- " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, sizeof(*#{arg[:name]}))\n" +- end +- lines << "#define #{function[:name]}_ReturnArrayThruPtr_#{arg[:name]}(#{arg[:name]}, cmock_len)" +- lines << " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, (int)(cmock_len * (int)sizeof(*#{arg[:name]})))\n" +- lines << "#define #{function[:name]}_ReturnMemThruPtr_#{arg[:name]}(#{arg[:name]}, cmock_size)" +- lines << " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, cmock_size)\n" +- lines << "void #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(UNITY_LINE_TYPE cmock_line, #{arg[:type]} #{arg[:name]}, int cmock_size);\n" +- end +- lines +- end +- +- def mock_interfaces(function) +- lines = [] +- func_name = function[:name] +- function[:args].each do |arg| +- arg_name = arg[:name] +- next unless @utils.ptr_or_str?(arg[:type]) && !(arg[:const?]) +- +- lines << "void #{func_name}_CMockReturnMemThruPtr_#{arg_name}(UNITY_LINE_TYPE cmock_line, #{arg[:type]} #{arg_name}, int cmock_size)\n" +- lines << "{\n" +- lines << " CMOCK_#{func_name}_CALL_INSTANCE* cmock_call_instance = " \ +- "(CMOCK_#{func_name}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.#{func_name}_CallInstance));\n" +- lines << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp);\n" +- lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Used = 1;\n" +- lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Val = #{arg_name};\n" +- lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Size = cmock_size;\n" +- lines << "}\n\n" +- end +- lines +- end +- +- def mock_implementation(function) +- lines = [] +- function[:args].each do |arg| +- arg_name = arg[:name] +- next unless @utils.ptr_or_str?(arg[:type]) && !(arg[:const?]) +- +- lines << " if (cmock_call_instance->ReturnThruPtr_#{arg_name}_Used)\n" +- lines << " {\n" +- lines << " UNITY_TEST_ASSERT_NOT_NULL(#{arg_name}, cmock_line, CMockStringPtrIsNULL);\n" +- lines << " memcpy((void*)#{arg_name}, (void*)cmock_call_instance->ReturnThruPtr_#{arg_name}_Val,\n" +- lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Size);\n" +- lines << " }\n" +- end +- lines +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_generator_utils.rb b/components/testframework/libs/cmock/lib/cmock_generator_utils.rb +deleted file mode 100644 +index 11225d6eed..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_generator_utils.rb ++++ /dev/null +@@ -1,247 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockGeneratorUtils +- attr_accessor :config, :helpers, :ordered, :ptr_handling, :arrays, :cexception +- +- def initialize(config, helpers = {}) +- @config = config +- @ptr_handling = @config.when_ptr +- @ordered = @config.enforce_strict_ordering +- @arrays = @config.plugins.include? :array +- @cexception = @config.plugins.include? :cexception +- @expect_any = @config.plugins.include? :expect_any_args +- @return_thru_ptr = @config.plugins.include? :return_thru_ptr +- @ignore_arg = @config.plugins.include? :ignore_arg +- @ignore = @config.plugins.include? :ignore +- @treat_as = @config.treat_as +- @helpers = helpers +- end +- +- def self.arg_type_with_const(arg) +- # Restore any "const" that was removed in header parsing +- if arg[:type].include?('*') +- arg[:const_ptr?] ? "#{arg[:type]} const" : arg[:type] +- else +- arg[:const?] ? "const #{arg[:type]}" : arg[:type] +- end +- end +- +- def arg_type_with_const(arg) +- self.class.arg_type_with_const(arg) +- end +- +- def code_verify_an_arg_expectation(function, arg) +- if @arrays +- case @ptr_handling +- when :smart then code_verify_an_arg_expectation_with_smart_arrays(function, arg) +- when :compare_data then code_verify_an_arg_expectation_with_normal_arrays(function, arg) +- when :compare_ptr then raise "ERROR: the array plugin doesn't enjoy working with :compare_ptr only. Disable one option." +- end +- else +- code_verify_an_arg_expectation_with_no_arrays(function, arg) +- end +- end +- +- def code_add_base_expectation(func_name, global_ordering_supported = true) +- lines = " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_#{func_name}_CALL_INSTANCE));\n" +- lines << " CMOCK_#{func_name}_CALL_INSTANCE* cmock_call_instance = (CMOCK_#{func_name}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n" +- lines << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);\n" +- lines << " memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));\n" +- lines << " Mock.#{func_name}_CallInstance = CMock_Guts_MemChain(Mock.#{func_name}_CallInstance, cmock_guts_index);\n" +- lines << " Mock.#{func_name}_IgnoreBool = (char)0;\n" if @ignore +- lines << " cmock_call_instance->LineNumber = cmock_line;\n" +- lines << " cmock_call_instance->CallOrder = ++GlobalExpectCount;\n" if @ordered && global_ordering_supported +- lines << " cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;\n" if @cexception +- lines << " cmock_call_instance->ExpectAnyArgsBool = (char)0;\n" if @expect_any +- lines +- end +- +- def code_add_an_arg_expectation(arg, depth = 1) +- lines = code_assign_argument_quickly("cmock_call_instance->Expected_#{arg[:name]}", arg) +- lines << " cmock_call_instance->Expected_#{arg[:name]}_Depth = #{arg[:name]}_Depth;\n" if @arrays && (depth.class == String) +- lines << " cmock_call_instance->IgnoreArg_#{arg[:name]} = 0;\n" if @ignore_arg +- lines << " cmock_call_instance->ReturnThruPtr_#{arg[:name]}_Used = 0;\n" if @return_thru_ptr && ptr_or_str?(arg[:type]) && !(arg[:const?]) +- lines +- end +- +- def code_assign_argument_quickly(dest, arg) +- if arg[:ptr?] || @treat_as.include?(arg[:type]) +- " #{dest} = #{arg[:name]};\n" +- else +- assert_expr = "sizeof(#{arg[:name]}) == sizeof(#{arg[:type]}) ? 1 : -1" +- comment = "/* add #{arg[:type]} to :treat_as_array if this causes an error */" +- " memcpy((void*)(&#{dest}), (void*)(&#{arg[:name]}),\n" \ +- " sizeof(#{arg[:type]}[#{assert_expr}])); #{comment}\n" +- end +- end +- +- def code_add_argument_loader(function) +- if function[:args_string] != 'void' +- if @arrays +- args_string = function[:args].map do |m| +- type = arg_type_with_const(m) +- m[:ptr?] ? "#{type} #{m[:name]}, int #{m[:name]}_Depth" : "#{type} #{m[:name]}" +- end.join(', ') +- "void CMockExpectParameters_#{function[:name]}(CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance, #{args_string})\n{\n" + +- function[:args].inject('') { |all, arg| all + code_add_an_arg_expectation(arg, (arg[:ptr?] ? "#{arg[:name]}_Depth" : 1)) } + +- "}\n\n" +- else +- "void CMockExpectParameters_#{function[:name]}(CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance, #{function[:args_string]})\n{\n" + +- function[:args].inject('') { |all, arg| all + code_add_an_arg_expectation(arg) } + +- "}\n\n" +- end +- else +- '' +- end +- end +- +- def code_call_argument_loader(function) +- if function[:args_string] != 'void' +- args = function[:args].map do |m| +- if @arrays && m[:ptr?] && !(m[:array_data?]) +- "#{m[:name]}, 1" +- elsif @arrays && m[:array_size?] +- "#{m[:name]}, #{m[:name]}" +- else +- m[:name] +- end +- end +- " CMockExpectParameters_#{function[:name]}(cmock_call_instance, #{args.join(', ')});\n" +- else +- '' +- end +- end +- +- def ptr_or_str?(arg_type) +- (arg_type.include?('*') || +- @treat_as.fetch(arg_type, '').include?('*')) +- end +- +- # private ###################### +- +- def lookup_expect_type(_function, arg) +- c_type = arg[:type] +- arg_name = arg[:name] +- expected = "cmock_call_instance->Expected_#{arg_name}" +- ignore = "cmock_call_instance->IgnoreArg_#{arg_name}" +- unity_func = if (arg[:ptr?]) && ((c_type =~ /\*\*/) || (@ptr_handling == :compare_ptr)) +- ['UNITY_TEST_ASSERT_EQUAL_PTR', ''] +- else +- @helpers.nil? || @helpers[:unity_helper].nil? ? ['UNITY_TEST_ASSERT_EQUAL', ''] : @helpers[:unity_helper].get_helper(c_type) +- end +- [c_type, arg_name, expected, ignore, unity_func[0], unity_func[1]] +- end +- +- def code_verify_an_arg_expectation_with_no_arrays(function, arg) +- c_type, arg_name, expected, ignore, unity_func, pre = lookup_expect_type(function, arg) +- lines = '' +- lines << " if (!#{ignore})\n" if @ignore_arg +- lines << " {\n" +- lines << " UNITY_SET_DETAILS(CMockString_#{function[:name]},CMockString_#{arg_name});\n" +- case unity_func +- when 'UNITY_TEST_ASSERT_EQUAL_MEMORY' +- c_type_local = c_type.gsub(/\*$/, '') +- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type_local}), cmock_line, CMockStringMismatch);\n" +- when 'UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY' +- if pre == '&' +- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), cmock_line, CMockStringMismatch);\n" +- else +- lines << " if (#{pre}#{expected} == NULL)\n" +- lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n" +- lines << " else\n" +- lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), cmock_line, CMockStringMismatch); }\n" +- end +- when /_ARRAY/ +- if pre == '&' +- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, 1, cmock_line, CMockStringMismatch);\n" +- else +- lines << " if (#{pre}#{expected} == NULL)\n" +- lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n" +- lines << " else\n" +- lines << " { #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, 1, cmock_line, CMockStringMismatch); }\n" +- end +- else +- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch);\n" +- end +- lines << " }\n" +- lines +- end +- +- def code_verify_an_arg_expectation_with_normal_arrays(function, arg) +- c_type, arg_name, expected, ignore, unity_func, pre = lookup_expect_type(function, arg) +- depth_name = arg[:ptr?] ? "cmock_call_instance->Expected_#{arg_name}_Depth" : 1 +- lines = '' +- lines << " if (!#{ignore})\n" if @ignore_arg +- lines << " {\n" +- lines << " UNITY_SET_DETAILS(CMockString_#{function[:name]},CMockString_#{arg_name});\n" +- case unity_func +- when 'UNITY_TEST_ASSERT_EQUAL_MEMORY' +- c_type_local = c_type.gsub(/\*$/, '') +- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type_local}), cmock_line, CMockStringMismatch);\n" +- when 'UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY' +- if pre == '&' +- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), cmock_line, CMockStringMismatch);\n" +- else +- lines << " if (#{pre}#{expected} == NULL)\n" +- lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n" +- lines << " else\n" +- lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), #{depth_name}, cmock_line, CMockStringMismatch); }\n" +- end +- when /_ARRAY/ +- if pre == '&' +- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch);\n" +- else +- lines << " if (#{pre}#{expected} == NULL)\n" +- lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n" +- lines << " else\n" +- lines << " { #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch); }\n" +- end +- else +- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch);\n" +- end +- lines << " }\n" +- lines +- end +- +- def code_verify_an_arg_expectation_with_smart_arrays(function, arg) +- c_type, arg_name, expected, ignore, unity_func, pre = lookup_expect_type(function, arg) +- depth_name = arg[:ptr?] ? "cmock_call_instance->Expected_#{arg_name}_Depth" : 1 +- lines = '' +- lines << " if (!#{ignore})\n" if @ignore_arg +- lines << " {\n" +- lines << " UNITY_SET_DETAILS(CMockString_#{function[:name]},CMockString_#{arg_name});\n" +- case unity_func +- when 'UNITY_TEST_ASSERT_EQUAL_MEMORY' +- c_type_local = c_type.gsub(/\*$/, '') +- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type_local}), cmock_line, CMockStringMismatch);\n" +- when 'UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY' +- if pre == '&' +- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), #{depth_name}, cmock_line, CMockStringMismatch);\n" +- else +- lines << " if (#{pre}#{expected} == NULL)\n" +- lines << " { UNITY_TEST_ASSERT_NULL(#{arg_name}, cmock_line, CMockStringExpNULL); }\n" +- lines << (depth_name != 1 ? " else if (#{depth_name} == 0)\n { UNITY_TEST_ASSERT_EQUAL_PTR(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch); }\n" : '') +- lines << " else\n" +- lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), #{depth_name}, cmock_line, CMockStringMismatch); }\n" +- end +- when /_ARRAY/ +- if pre == '&' +- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch);\n" +- else +- lines << " if (#{pre}#{expected} == NULL)\n" +- lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n" +- lines << (depth_name != 1 ? " else if (#{depth_name} == 0)\n { UNITY_TEST_ASSERT_EQUAL_PTR(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch); }\n" : '') +- lines << " else\n" +- lines << " { #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch); }\n" +- end +- else +- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch);\n" +- end +- lines << " }\n" +- lines +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_header_parser.rb b/components/testframework/libs/cmock/lib/cmock_header_parser.rb +deleted file mode 100644 +index 8638a04f91..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_header_parser.rb ++++ /dev/null +@@ -1,595 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockHeaderParser +- attr_accessor :funcs, :c_attr_noconst, :c_attributes, :treat_as_void, :treat_externs, :treat_inlines, :inline_function_patterns +- +- def initialize(cfg) +- @funcs = [] +- @c_strippables = cfg.strippables +- @c_attr_noconst = cfg.attributes.uniq - ['const'] +- @c_attributes = ['const'] + c_attr_noconst +- @c_calling_conventions = cfg.c_calling_conventions.uniq +- @treat_as_array = cfg.treat_as_array +- @treat_as_void = (['void'] + cfg.treat_as_void).uniq +- @function_declaration_parse_base_match = '([\w\s\*\(\),\[\]]+??)\(([\w\s\*\(\),\.\[\]+\-\/]*)\)' +- @declaration_parse_matcher = /#{@function_declaration_parse_base_match}$/m +- @standards = (%w[int short char long unsigned signed] + cfg.treat_as.keys).uniq +- @array_size_name = cfg.array_size_name +- @array_size_type = (%w[int size_t] + cfg.array_size_type).uniq +- @when_no_prototypes = cfg.when_no_prototypes +- @local_as_void = @treat_as_void +- @verbosity = cfg.verbosity +- @treat_externs = cfg.treat_externs +- @treat_inlines = cfg.treat_inlines +- @inline_function_patterns = cfg.inline_function_patterns +- @c_strippables += ['extern'] if @treat_externs == :include # we'll need to remove the attribute if we're allowing externs +- @c_strippables += ['inline'] if @treat_inlines == :include # we'll need to remove the attribute if we're allowing inlines +- end +- +- def parse(name, source) +- @module_name = name.gsub(/\W/, '') +- @typedefs = [] +- @funcs = [] +- @normalized_source = nil +- function_names = [] +- +- all_funcs = parse_functions(import_source(source)).map { |item| [item] } +- all_funcs += parse_cpp_functions(import_source(source, true)) +- all_funcs.map do |decl| +- func = parse_declaration(*decl) +- unless function_names.include? func[:name] +- @funcs << func +- function_names << func[:name] +- end +- end +- +- @normalized_source = if @treat_inlines == :include +- transform_inline_functions(source) +- else +- '' +- end +- +- { :includes => nil, +- :functions => @funcs, +- :typedefs => @typedefs, +- :normalized_source => @normalized_source } +- end +- +- private if $ThisIsOnlyATest.nil? ################ +- +- def remove_nested_pairs_of_braces(source) +- # remove nested pairs of braces because no function declarations will be inside of them (leave outer pair for function definition detection) +- if RUBY_VERSION.split('.')[0].to_i > 1 +- # we assign a string first because (no joke) if Ruby 1.9.3 sees this line as a regex, it will crash. +- r = '\\{([^\\{\\}]*|\\g<0>)*\\}' +- source.gsub!(/#{r}/m, '{ }') +- else +- while source.gsub!(/\{[^\{\}]*\{[^\{\}]*\}[^\{\}]*\}/m, '{ }') +- end +- end +- +- source +- end +- +- # Return the number of pairs of braces/square brackets in the function provided by the user +- # +source+:: String containing the function to be processed +- def count_number_of_pairs_of_braces_in_function(source) +- is_function_start_found = false +- curr_level = 0 +- total_pairs = 0 +- +- source.each_char do |c| +- if c == '{' +- curr_level += 1 +- total_pairs += 1 +- is_function_start_found = true +- elsif c == '}' +- curr_level -= 1 +- end +- +- break if is_function_start_found && curr_level == 0 # We reached the end of the inline function body +- end +- +- if curr_level != 0 +- total_pairs = 0 # Something is fishy about this source, not enough closing braces? +- end +- +- total_pairs +- end +- +- # Transform inline functions to regular functions in the source by the user +- # +source+:: String containing the source to be processed +- def transform_inline_functions(source) +- inline_function_regex_formats = [] +- square_bracket_pair_regex_format = /\{[^\{\}]*\}/ # Regex to match one whole block enclosed by two square brackets +- +- # Convert user provided string patterns to regex +- # Use word bounderies before and after the user regex to limit matching to actual word iso part of a word +- @inline_function_patterns.each do |user_format_string| +- user_regex = Regexp.new(user_format_string) +- word_boundary_before_user_regex = /\b/ +- cleanup_spaces_after_user_regex = /[ ]*\b/ +- inline_function_regex_formats << Regexp.new(word_boundary_before_user_regex.source + user_regex.source + cleanup_spaces_after_user_regex.source) +- end +- +- # let's clean up the encoding in case they've done anything weird with the characters we might find +- source = source.force_encoding('ISO-8859-1').encode('utf-8', :replace => nil) +- +- # smush multiline macros into single line (checking for continuation character at end of line '\') +- # If the user uses a macro to declare an inline function, +- # smushing the macros makes it easier to recognize them as a macro and if required, +- # remove them later on in this function +- source.gsub!(/\s*\\\s*/m, ' ') +- +- # Just looking for static|inline in the gsub is a bit too aggressive (functions that are named like this, ...), so we try to be a bit smarter +- # Instead, look for an inline pattern (f.e. "static inline") and parse it. +- # Below is a small explanation on how the general mechanism works: +- # - Everything before the match should just be copied, we don't want +- # to touch anything but the inline functions. +- # - Remove the implementation of the inline function (this is enclosed +- # in square brackets) and replace it with ";" to complete the +- # transformation to normal/non-inline function. +- # To ensure proper removal of the function body, we count the number of square-bracket pairs +- # and remove the pairs one-by-one. +- # - Copy everything after the inline function implementation and start the parsing of the next inline function +- # There are ofcourse some special cases (inline macro declarations, inline function declarations, ...) which are handled and explained below +- inline_function_regex_formats.each do |format| +- loop do +- inline_function_match = source.match(/#{format}/) # Search for inline function declaration +- +- break if inline_function_match.nil? # No inline functions so nothing to do +- +- # 1. Determine if we are dealing with a user defined macro to declare inline functions +- # If the end of the pre-match string is a macro-declaration-like string, +- # we are dealing with a user defined macro to declare inline functions +- if /(#define\s*)\z/ =~ inline_function_match.pre_match +- # Remove the macro from the source +- stripped_pre_match = inline_function_match.pre_match.sub(/(#define\s*)\z/, '') +- stripped_post_match = inline_function_match.post_match.sub(/\A(.*[\n]?)/, '') +- source = stripped_pre_match + stripped_post_match +- next +- end +- +- # 2. Determine if we are dealing with an inline function declaration iso function definition +- # If the start of the post-match string is a function-declaration-like string (something ending with semicolon after the function arguments), +- # we are dealing with a inline function declaration +- if /\A#{@function_declaration_parse_base_match}\s*;/m =~ inline_function_match.post_match +- # Only remove the inline part from the function declaration, leaving the function declaration won't do any harm +- source = inline_function_match.pre_match + inline_function_match.post_match +- next +- end +- +- # 3. If we get here, we found an inline function declaration AND inline function body. +- # Remove the function body to transform it into a 'normal' function. +- total_pairs_to_remove = count_number_of_pairs_of_braces_in_function(inline_function_match.post_match) +- +- break if total_pairs_to_remove == 0 # Bad source? +- +- inline_function_stripped = inline_function_match.post_match +- +- total_pairs_to_remove.times do +- inline_function_stripped.sub!(/\s*#{square_bracket_pair_regex_format}/, ';') # Remove inline implementation (+ some whitespace because it's prettier) +- end +- +- source = inline_function_match.pre_match + inline_function_stripped # Make new source with the inline function removed and move on to the next +- end +- end +- +- source +- end +- +- def import_source(source, cpp = false) +- # let's clean up the encoding in case they've done anything weird with the characters we might find +- source = source.force_encoding('ISO-8859-1').encode('utf-8', :replace => nil) +- +- # void must be void for cmock _ExpectAndReturn calls to process properly, not some weird typedef which equates to void +- # to a certain extent, this action assumes we're chewing on pre-processed header files, otherwise we'll most likely just get stuff from @treat_as_void +- @local_as_void = @treat_as_void +- void_types = source.scan(/typedef\s+(?:\(\s*)?void(?:\s*\))?\s+([\w]+)\s*;/) +- if void_types +- @local_as_void += void_types.flatten.uniq.compact +- end +- +- # If user wants to mock inline functions, +- # remove the (user specific) inline keywords before removing anything else to avoid missing an inline function +- if @treat_inlines == :include +- @inline_function_patterns.each do |user_format_string| +- source.gsub!(/#{user_format_string}/, '') # remove user defined inline function patterns +- end +- end +- +- # smush multiline macros into single line (checking for continuation character at end of line '\') +- source.gsub!(/\s*\\\s*/m, ' ') +- +- # remove comments (block and line, in three steps to ensure correct precedence) +- source.gsub!(/(? * , <@array_size_type> <@array_size_name> +- args.each_with_index do |val, index| +- next_index = index + 1 +- next unless args.length > next_index +- +- if (val[:ptr?] == true) && args[next_index][:name].match(@array_size_name) && @array_size_type.include?(args[next_index][:type]) +- val[:array_data?] = true +- args[next_index][:array_size?] = true +- end +- end +- +- args +- end +- +- def divine_ptr(arg) +- return false unless arg.include? '*' +- # treat "const char *" and similar as a string, not a pointer +- return false if /(^|\s)(const\s+)?char(\s+const)?\s*\*(?!.*\*)/ =~ arg +- +- true +- end +- +- def divine_const(arg) +- # a non-pointer arg containing "const" is a constant +- # an arg containing "const" before the last * is a pointer to a constant +- if arg.include?('*') ? (/(^|\s|\*)const(\s(\w|\s)*)?\*(?!.*\*)/ =~ arg) : (/(^|\s)const(\s|$)/ =~ arg) +- true +- else +- false +- end +- end +- +- def divine_ptr_and_const(arg) +- divination = {} +- +- divination[:ptr?] = divine_ptr(arg) +- divination[:const?] = divine_const(arg) +- +- # an arg containing "const" after the last * is a constant pointer +- divination[:const_ptr?] = /\*(?!.*\*)\s*const(\s|$)/ =~ arg ? true : false +- +- divination +- end +- +- def clean_args(arg_list) +- if @local_as_void.include?(arg_list.strip) || arg_list.empty? +- 'void' +- else +- c = 0 +- # magically turn brackets into asterisks, also match for parentheses that come from macros +- arg_list.gsub!(/(\w+)(?:\s*\[[^\[\]]*\])+/, '*\1') +- # remove space to place asterisks with type (where they belong) +- arg_list.gsub!(/\s+\*/, '*') +- # pull asterisks away from arg to place asterisks with type (where they belong) +- arg_list.gsub!(/\*(\w)/, '* \1') +- +- # scan argument list for function pointers and replace them with custom types +- arg_list.gsub!(/([\w\s\*]+)\(+\s*\*[\*\s]*([\w\s]*)\s*\)+\s*\(((?:[\w\s\*]*,?)*)\s*\)*/) do |_m| +- functype = "cmock_#{@module_name}_func_ptr#{@typedefs.size + 1}" +- funcret = Regexp.last_match(1).strip +- funcname = Regexp.last_match(2).strip +- funcargs = Regexp.last_match(3).strip +- funconst = '' +- if funcname.include? 'const' +- funcname.gsub!('const', '').strip! +- funconst = 'const ' +- end +- @typedefs << "typedef #{funcret}(*#{functype})(#{funcargs});" +- funcname = "cmock_arg#{c += 1}" if funcname.empty? +- "#{functype} #{funconst}#{funcname}" +- end +- +- # scan argument list for function pointers with shorthand notation and replace them with custom types +- arg_list.gsub!(/([\w\s\*]+)+\s+(\w+)\s*\(((?:[\w\s\*]*,?)*)\s*\)*/) do |_m| +- functype = "cmock_#{@module_name}_func_ptr#{@typedefs.size + 1}" +- funcret = Regexp.last_match(1).strip +- funcname = Regexp.last_match(2).strip +- funcargs = Regexp.last_match(3).strip +- funconst = '' +- if funcname.include? 'const' +- funcname.gsub!('const', '').strip! +- funconst = 'const ' +- end +- @typedefs << "typedef #{funcret}(*#{functype})(#{funcargs});" +- funcname = "cmock_arg#{c += 1}" if funcname.empty? +- "#{functype} #{funconst}#{funcname}" +- end +- +- # automatically name unnamed arguments (those that only had a type) +- arg_list.split(/\s*,\s*/).map do |arg| +- parts = (arg.split - ['struct', 'union', 'enum', 'const', 'const*']) +- if (parts.size < 2) || (parts[-1][-1].chr == '*') || @standards.include?(parts[-1]) +- "#{arg} cmock_arg#{c += 1}" +- else +- arg +- end +- end.join(', ') +- end +- end +- +- def parse_declaration(declaration, namespace = [], classname = nil) +- decl = {} +- decl[:namespace] = namespace +- decl[:class] = classname +- +- regex_match = @declaration_parse_matcher.match(declaration) +- raise "Failed parsing function declaration: '#{declaration}'" if regex_match.nil? +- +- # grab argument list +- args = regex_match[2].strip +- +- # process function attributes, return type, and name +- parsed = parse_type_and_name(regex_match[1]) +- +- # Record original name without scope prefix +- decl[:unscoped_name] = parsed[:name] +- +- # Prefix name with namespace scope (if any) and then class +- decl[:name] = namespace.join('_') +- unless classname.nil? +- decl[:name] << '_' unless decl[:name].empty? +- decl[:name] << classname +- end +- # Add original name to complete fully scoped name +- decl[:name] << '_' unless decl[:name].empty? +- decl[:name] << decl[:unscoped_name] +- +- decl[:modifier] = parsed[:modifier] +- unless parsed[:c_calling_convention].nil? +- decl[:c_calling_convention] = parsed[:c_calling_convention] +- end +- +- rettype = parsed[:type] +- rettype = 'void' if @local_as_void.include?(rettype.strip) +- decl[:return] = { :type => rettype, +- :name => 'cmock_to_return', +- :str => "#{rettype} cmock_to_return", +- :void? => (rettype == 'void'), +- :ptr? => parsed[:ptr?] || false, +- :const? => parsed[:const?] || false, +- :const_ptr? => parsed[:const_ptr?] || false } +- +- # remove default argument statements from mock definitions +- args.gsub!(/=\s*[a-zA-Z0-9_\.]+\s*/, ' ') +- +- # check for var args +- if args =~ /\.\.\./ +- decl[:var_arg] = args.match(/[\w\s]*\.\.\./).to_s.strip +- args = if args =~ /\,[\w\s]*\.\.\./ +- args.gsub!(/\,[\w\s]*\.\.\./, '') +- else +- 'void' +- end +- else +- decl[:var_arg] = nil +- end +- args = clean_args(args) +- decl[:args_string] = args +- decl[:args] = parse_args(args) +- decl[:args_call] = decl[:args].map { |a| a[:name] }.join(', ') +- decl[:contains_ptr?] = decl[:args].inject(false) { |ptr, arg| arg[:ptr?] ? true : ptr } +- +- if decl[:return][:type].nil? || decl[:name].nil? || decl[:args].nil? || +- decl[:return][:type].empty? || decl[:name].empty? +- raise "Failed Parsing Declaration Prototype!\n" \ +- " declaration: '#{declaration}'\n" \ +- " modifier: '#{decl[:modifier]}'\n" \ +- " return: #{prototype_inspect_hash(decl[:return])}\n" \ +- " function: '#{decl[:name]}'\n" \ +- " args: #{prototype_inspect_array_of_hashes(decl[:args])}\n" +- end +- +- decl +- end +- +- def prototype_inspect_hash(hash) +- pairs = [] +- hash.each_pair { |name, value| pairs << ":#{name} => #{"'" if value.class == String}#{value}#{"'" if value.class == String}" } +- "{#{pairs.join(', ')}}" +- end +- +- def prototype_inspect_array_of_hashes(array) +- hashes = [] +- array.each { |hash| hashes << prototype_inspect_hash(hash) } +- case array.size +- when 0 +- return '[]' +- when 1 +- return "[#{hashes[0]}]" +- else +- return "[\n #{hashes.join("\n ")}\n ]\n" +- end +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_plugin_manager.rb b/components/testframework/libs/cmock/lib/cmock_plugin_manager.rb +deleted file mode 100644 +index 342014e221..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_plugin_manager.rb ++++ /dev/null +@@ -1,50 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockPluginManager +- attr_accessor :plugins +- +- def initialize(config, utils) +- @plugins = [] +- plugins_to_load = [:expect, config.plugins].flatten.uniq.compact +- plugins_to_load.each do |plugin| +- plugin_name = plugin.to_s +- object_name = 'CMockGeneratorPlugin' + camelize(plugin_name) +- self.class.mutex.synchronize { load_plugin(plugin_name, object_name, config, utils) } +- end +- @plugins.sort! { |a, b| a.priority <=> b.priority } +- end +- +- def run(method, args = nil) +- if args.nil? +- @plugins.collect { |plugin| plugin.send(method) if plugin.respond_to?(method) }.flatten.join +- else +- @plugins.collect { |plugin| plugin.send(method, args) if plugin.respond_to?(method) }.flatten.join +- end +- end +- +- def camelize(lower_case_and_underscored_word) +- lower_case_and_underscored_word.gsub(/\/(.?)/) { '::' + Regexp.last_match(1).upcase }.gsub(/(^|_)(.)/) { Regexp.last_match(2).upcase } +- end +- +- def self.mutex +- @mutex ||= Mutex.new +- end +- +- private +- +- def load_plugin(plugin_name, object_name, config, utils) +- unless Object.const_defined? object_name +- file_name = "#{__dir__}/cmock_generator_plugin_#{plugin_name.downcase}.rb" +- require file_name +- end +- class_name = Object.const_get(object_name) +- @plugins << class_name.new(config, utils) +- rescue StandardError +- file_name = "#{__dir__}/cmock_generator_plugin_#{plugin_name.downcase}.rb" +- raise "ERROR: CMock unable to load plugin '#{plugin_name}' '#{object_name}' #{file_name}" +- end +-end +diff --git a/components/testframework/libs/cmock/lib/cmock_unityhelper_parser.rb b/components/testframework/libs/cmock/lib/cmock_unityhelper_parser.rb +deleted file mode 100644 +index 9f4beb7709..0000000000 +--- a/components/testframework/libs/cmock/lib/cmock_unityhelper_parser.rb ++++ /dev/null +@@ -1,77 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-class CMockUnityHelperParser +- attr_accessor :c_types +- +- def initialize(config) +- @config = config +- @fallback = @config.plugins.include?(:array) ? 'UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY' : 'UNITY_TEST_ASSERT_EQUAL_MEMORY' +- @c_types = map_c_types.merge(import_source) +- end +- +- def get_helper(ctype) +- lookup = ctype.gsub(/(?:^|(\S?)(\s*)|(\W))const(?:$|(\s*)(\S)|(\W))/, '\1\3\5\6').strip.gsub(/\s+/, '_') +- return [@c_types[lookup], ''] if @c_types[lookup] +- +- if lookup =~ /\*$/ +- lookup = lookup.gsub(/\*$/, '') +- return [@c_types[lookup], '*'] if @c_types[lookup] +- else +- lookup += '*' +- return [@c_types[lookup], '&'] if @c_types[lookup] +- end +- return ['UNITY_TEST_ASSERT_EQUAL_PTR', ''] if ctype =~ /cmock_\w+_ptr\d+/ +- raise("Don't know how to test #{ctype} and memory tests are disabled!") unless @config.memcmp_if_unknown +- +- lookup =~ /\*$/ ? [@fallback, '&'] : [@fallback, ''] +- end +- +- private ########################### +- +- def map_c_types +- c_types = {} +- @config.treat_as.each_pair do |ctype, expecttype| +- c_type = ctype.gsub(/\s+/, '_') +- if expecttype =~ /\*/ +- c_types[c_type] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype.delete('*')}_ARRAY" +- else +- c_types[c_type] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype}" +- c_types[c_type + '*'] ||= "UNITY_TEST_ASSERT_EQUAL_#{expecttype}_ARRAY" +- end +- end +- c_types +- end +- +- def import_source +- source = @config.load_unity_helper +- return {} if source.nil? +- +- c_types = {} +- source = source.gsub(/\/\/.*$/, '') # remove line comments +- source = source.gsub(/\/\*.*?\*\//m, '') # remove block comments +- +- # scan for comparison helpers +- match_regex = Regexp.new('^\s*#define\s+(UNITY_TEST_ASSERT_EQUAL_(\w+))\s*\(' + Array.new(4, '\s*\w+\s*').join(',') + '\)') +- pairs = source.scan(match_regex).flatten.compact +- (pairs.size / 2).times do |i| +- expect = pairs[i * 2] +- ctype = pairs[(i * 2) + 1] +- c_types[ctype] = expect unless expect.include?('_ARRAY') +- end +- +- # scan for array variants of those helpers +- match_regex = Regexp.new('^\s*#define\s+(UNITY_TEST_ASSERT_EQUAL_(\w+_ARRAY))\s*\(' + Array.new(5, '\s*\w+\s*').join(',') + '\)') +- pairs = source.scan(match_regex).flatten.compact +- (pairs.size / 2).times do |i| +- expect = pairs[i * 2] +- ctype = pairs[(i * 2) + 1] +- c_types[ctype.gsub('_ARRAY', '*')] = expect +- end +- +- c_types +- end +-end +diff --git a/components/testframework/libs/cmock/meson.build b/components/testframework/libs/cmock/meson.build +deleted file mode 100755 +index e29864f46b..0000000000 +--- a/components/testframework/libs/cmock/meson.build ++++ /dev/null +@@ -1,53 +0,0 @@ +-# +-# build script written by : Michael Brockus. +-# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. +-# +-# license: MIT +-# +-project('cmock', 'c', +- license: 'MIT', +- meson_version: '>=0.53.0', +- subproject_dir : 'vendor', +- default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11'] +-) +-lang = 'c' +-cc = meson.get_compiler(lang) +- +- +-# +-# Meson: Add compiler flags +-# +-if cc.get_id() == 'clang' +- add_project_arguments(cc.get_supported_arguments( +- [ +- '-Wexit-time-destructors', +- '-Wglobal-constructors', +- '-Wmissing-prototypes', +- '-Wmissing-noreturn', +- '-Wno-missing-braces', +- '-Wold-style-cast', '-Wpointer-arith', '-Wweak-vtables', +- '-Wcast-align', '-Wconversion', '-Wcast-qual', '-Wshadow' +- ] +- ), language: lang) +-endif +- +-if cc.get_argument_syntax() == 'gcc' +- add_project_arguments(cc.get_supported_arguments( +- [ +- '-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar', +- '-Wpointer-arith' , '-Wwrite-strings' , +- '-Wno-parentheses' , '-Wno-type-limits' , +- '-Wformat-security' , '-Wunreachable-code' , +- '-Waggregate-return' , '-Wformat-nonliteral' , +- '-Wmissing-declarations', '-Wmissing-include-dirs' , +- '-Wno-unused-parameter' +- ] +- ), language: lang) +-endif +- +-unity_dep = dependency('unity', fallback: ['unity', 'unity_dep']) +- +-# +-# Sub directory to project source code +-subdir('src') +-cmock_dep = declare_dependency(link_with: cmock_lib, include_directories: cmock_dir) +diff --git a/components/testframework/libs/cmock/scripts/create_makefile.rb b/components/testframework/libs/cmock/scripts/create_makefile.rb +deleted file mode 100644 +index 56cb78e908..0000000000 +--- a/components/testframework/libs/cmock/scripts/create_makefile.rb ++++ /dev/null +@@ -1,203 +0,0 @@ +-require 'fileutils' +-ABS_ROOT = FileUtils.pwd +-CMOCK_DIR = File.expand_path(ENV.fetch('CMOCK_DIR', File.join(ABS_ROOT, '..', '..'))) +-require "#{CMOCK_DIR}/lib/cmock" +-UNITY_DIR = File.join(CMOCK_DIR, 'vendor', 'unity') +-require "#{UNITY_DIR}/auto/generate_test_runner" +- +-SRC_DIR = ENV.fetch('SRC_DIR', './src') +-TEST_DIR = ENV.fetch('TEST_DIR', './test') +-UNITY_SRC = File.join(UNITY_DIR, 'src') +-CMOCK_SRC = File.join(CMOCK_DIR, 'src') +-BUILD_DIR = ENV.fetch('BUILD_DIR', './build') +-TEST_BUILD_DIR = ENV.fetch('TEST_BUILD_DIR', File.join(BUILD_DIR, 'test')) +-OBJ_DIR = File.join(TEST_BUILD_DIR, 'obj') +-UNITY_OBJ = File.join(OBJ_DIR, 'unity.o') +-CMOCK_OBJ = File.join(OBJ_DIR, 'cmock.o') +-RUNNERS_DIR = File.join(TEST_BUILD_DIR, 'runners') +-MOCKS_DIR = File.join(TEST_BUILD_DIR, 'mocks') +-TEST_BIN_DIR = TEST_BUILD_DIR +-MOCK_PREFIX = ENV.fetch('TEST_MOCK_PREFIX', 'mock_') +-MOCK_SUFFIX = ENV.fetch('TEST_MOCK_SUFFIX', '') +-TEST_MAKEFILE = ENV.fetch('TEST_MAKEFILE', File.join(TEST_BUILD_DIR, 'MakefileTestSupport')) +-MOCK_MATCHER = /#{MOCK_PREFIX}[A-Za-z_][A-Za-z0-9_\-\.]+#{MOCK_SUFFIX}/ +- +-[TEST_BUILD_DIR, OBJ_DIR, RUNNERS_DIR, MOCKS_DIR, TEST_BIN_DIR].each do |dir| +- FileUtils.mkdir_p dir +-end +- +-all_headers_to_mock = [] +- +-suppress_error = !ARGV.nil? && !ARGV.empty? && (ARGV[0].casecmp('--SILENT') == 0) +- +-File.open(TEST_MAKEFILE, 'w') do |mkfile| +- # Define make variables +- mkfile.puts 'CC ?= gcc' +- mkfile.puts "BUILD_DIR = #{BUILD_DIR}" +- mkfile.puts "SRC_DIR = #{SRC_DIR}" +- mkfile.puts "TEST_DIR = #{TEST_DIR}" +- mkfile.puts 'TEST_CFLAGS ?= -DTEST' +- mkfile.puts "CMOCK_DIR ?= #{CMOCK_DIR}" +- mkfile.puts "UNITY_DIR ?= #{UNITY_DIR}" +- mkfile.puts 'TEST_BUILD_DIR ?= ${BUILD_DIR}/test' +- mkfile.puts 'TEST_MAKEFILE = ${TEST_BUILD_DIR}/MakefileTestSupport' +- mkfile.puts 'OBJ ?= ${BUILD_DIR}/obj' +- mkfile.puts 'OBJ_DIR = ${OBJ}' +- mkfile.puts '' +- +- # Build Unity +- mkfile.puts "#{UNITY_OBJ}: #{UNITY_SRC}/unity.c" +- mkfile.puts "\t${CC} -o $@ -c $< -I #{UNITY_SRC}" +- mkfile.puts '' +- +- # Build CMock +- mkfile.puts "#{CMOCK_OBJ}: #{CMOCK_SRC}/cmock.c" +- mkfile.puts "\t${CC} -o $@ -c $< -I #{UNITY_SRC} -I #{CMOCK_SRC}" +- mkfile.puts '' +- +- test_sources = Dir["#{TEST_DIR}/**/test_*.c"] +- test_targets = [] +- generator = UnityTestRunnerGenerator.new +- +- # headers that begin with prefix or end with suffix are not included +- all_headers = Dir["#{SRC_DIR}/**/*.h*"] +- +- def reject_mock_files(file) +- extn = File.extname file +- filename = File.basename file, extn +- if MOCK_SUFFIX.empty? +- return filename.start_with? MOCK_PREFIX +- end +- +- (filename.start_with?(MOCK_PREFIX) || filename.end_with?(MOCK_SUFFIX)) +- end +- +- all_headers = all_headers.reject { |f| reject_mock_files(f) } +- +- makefile_targets = [] +- +- test_sources.each do |test| +- module_name = File.basename(test, '.c') +- src_module_name = module_name.sub(/^test_/, '') +- test_obj = File.join(OBJ_DIR, "#{module_name}.o") +- runner_source = File.join(RUNNERS_DIR, "runner_#{module_name}.c") +- runner_obj = File.join(OBJ_DIR, "runner_#{module_name}.o") +- test_bin = File.join(TEST_BIN_DIR, module_name) +- test_results = File.join(TEST_BIN_DIR, module_name + '.testresult') +- +- cfg = { +- src: test, +- includes: generator.find_includes(File.readlines(test).join('')) +- } +- +- # Build main project modules, with TEST defined +- module_src = File.join(SRC_DIR, "#{src_module_name}.c") +- module_obj = File.join(OBJ_DIR, "#{src_module_name}.o") +- unless makefile_targets.include? module_obj +- makefile_targets.push(module_obj) +- mkfile.puts "#{module_obj}: #{module_src}" +- mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I ${SRC_DIR} ${INCLUDE_PATH}" +- mkfile.puts '' +- end +- +- # process link-only files +- linkonly = cfg[:includes][:linkonly] +- linkonly_objs = [] +- linkonly.each do |linkonlyfile| +- linkonlybase = File.basename(linkonlyfile, '.*') +- linkonlymodule_src = File.join(SRC_DIR, linkonlyfile.to_s) +- linkonlymodule_obj = File.join(OBJ_DIR, "#{linkonlybase}.o") +- linkonly_objs.push(linkonlymodule_obj) +- # only create the target if we didn't already +- next if makefile_targets.include? linkonlymodule_obj +- +- makefile_targets.push(linkonlymodule_obj) +- mkfile.puts "#{linkonlymodule_obj}: #{linkonlymodule_src}" +- mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I ${SRC_DIR} ${INCLUDE_PATH}" +- mkfile.puts '' +- end +- +- # Create runners +- mkfile.puts "#{runner_source}: #{test}" +- mkfile.puts "\t@UNITY_DIR=${UNITY_DIR} ruby ${CMOCK_DIR}/scripts/create_runner.rb #{test} #{runner_source}" +- mkfile.puts '' +- +- # Build runner +- mkfile.puts "#{runner_obj}: #{runner_source}" +- mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{SRC_DIR} -I #{MOCKS_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC} ${INCLUDE_PATH}" +- mkfile.puts '' +- +- # Collect mocks to generate +- system_mocks = cfg[:includes][:system].select { |name| name =~ MOCK_MATCHER } +- raise 'Mocking of system headers is not yet supported!' unless system_mocks.empty? +- +- local_mocks = cfg[:includes][:local].select { |name| name =~ MOCK_MATCHER } +- +- module_names_to_mock = local_mocks.map { |name| name.sub(/#{MOCK_PREFIX}/, '').to_s } +- headers_to_mock = [] +- module_names_to_mock.each do |name| +- header_to_mock = nil +- all_headers.each do |header| +- if header =~ /[\/\\]?#{name}$/ +- header_to_mock = header +- break +- end +- end +- raise "Module header '#{name}' not found to mock!" unless header_to_mock +- +- headers_to_mock << header_to_mock +- end +- +- all_headers_to_mock += headers_to_mock +- mock_objs = headers_to_mock.map do |hdr| +- mock_name = MOCK_PREFIX + File.basename(hdr, '.*') +- File.join(MOCKS_DIR, mock_name + '.o') +- end +- all_headers_to_mock.uniq! +- +- # Build test suite +- mkfile.puts "#{test_obj}: #{test} #{module_obj} #{mock_objs.join(' ')}" +- mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC} -I #{MOCKS_DIR} ${INCLUDE_PATH}" +- mkfile.puts '' +- +- # Build test suite executable +- test_objs = "#{test_obj} #{runner_obj} #{module_obj} #{mock_objs.join(' ')} #{linkonly_objs.join(' ')} #{UNITY_OBJ} #{CMOCK_OBJ}" +- mkfile.puts "#{test_bin}: #{test_objs}" +- mkfile.puts "\t${CC} -o $@ ${LDFLAGS} #{test_objs}" +- mkfile.puts '' +- +- # Run test suite and generate report +- mkfile.puts "#{test_results}: #{test_bin}" +- mkfile.puts "\t-#{test_bin} > #{test_results} 2>&1" +- mkfile.puts '' +- +- test_targets << test_bin +- end +- +- # Generate and build mocks +- all_headers_to_mock.each do |hdr| +- mock_name = MOCK_PREFIX + File.basename(hdr, '.*') +- mock_header = File.join(MOCKS_DIR, mock_name + File.extname(hdr)) +- mock_src = File.join(MOCKS_DIR, mock_name + '.c') +- mock_obj = File.join(MOCKS_DIR, mock_name + '.o') +- +- mkfile.puts "#{mock_src}: #{hdr}" +- mkfile.puts "\t@CMOCK_DIR=${CMOCK_DIR} ruby ${CMOCK_DIR}/scripts/create_mock.rb #{hdr}" +- mkfile.puts '' +- +- mkfile.puts "#{mock_obj}: #{mock_src} #{mock_header}" +- mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{MOCKS_DIR} -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC} ${INCLUDE_PATH}" +- mkfile.puts '' +- end +- +- # Create test summary task +- mkfile.puts 'test_summary:' +- mkfile.puts "\t@UNITY_DIR=${UNITY_DIR} ruby ${CMOCK_DIR}/scripts/test_summary.rb #{suppress_error ? '--silent' : ''}" +- mkfile.puts '' +- mkfile.puts '.PHONY: test_summary' +- mkfile.puts '' +- +- # Create target to run all tests +- mkfile.puts "test: #{test_targets.map { |t| t + '.testresult' }.join(' ')} test_summary" +- mkfile.puts '' +-end +diff --git a/components/testframework/libs/cmock/scripts/create_mock.rb b/components/testframework/libs/cmock/scripts/create_mock.rb +deleted file mode 100644 +index 93107a9425..0000000000 +--- a/components/testframework/libs/cmock/scripts/create_mock.rb ++++ /dev/null +@@ -1,8 +0,0 @@ +-require "#{ENV['CMOCK_DIR']}/lib/cmock" +- +-raise 'Header file to mock must be specified!' unless ARGV.length >= 1 +- +-mock_out = ENV.fetch('MOCK_OUT', './build/test/mocks') +-mock_prefix = ENV.fetch('MOCK_PREFIX', 'mock_') +-cmock = CMock.new(:plugins => %i[ignore return_thru_ptr], :mock_prefix => mock_prefix, :mock_path => mock_out) +-cmock.setup_mocks(ARGV[0]) +diff --git a/components/testframework/libs/cmock/scripts/create_runner.rb b/components/testframework/libs/cmock/scripts/create_runner.rb +deleted file mode 100644 +index 621980507f..0000000000 +--- a/components/testframework/libs/cmock/scripts/create_runner.rb ++++ /dev/null +@@ -1,18 +0,0 @@ +-if $0 == __FILE__ +- +- # make sure there is at least one parameter left (the input file) +- if ARGV.length < 2 +- puts ["\nusage: ruby #{__FILE__} input_test_file (output)", +- '', +- ' input_test_file - this is the C file you want to create a runner for', +- ' output - this is the name of the runner file to generate', +- ' defaults to (input_test_file)_Runner'].join("\n") +- exit 1 +- end +- +- require "#{ENV['UNITY_DIR']}/auto/generate_test_runner" +- +- test = ARGV[0] +- runner = ARGV[1] +- UnityTestRunnerGenerator.new.run(test, runner) +-end +diff --git a/components/testframework/libs/cmock/scripts/test_summary.rb b/components/testframework/libs/cmock/scripts/test_summary.rb +deleted file mode 100644 +index cbcbaf8b12..0000000000 +--- a/components/testframework/libs/cmock/scripts/test_summary.rb ++++ /dev/null +@@ -1,18 +0,0 @@ +-suppress_error = !ARGV.nil? && !ARGV.empty? && (ARGV[0].casecmp('--SILENT') == 0) +- +-begin +- require "#{ENV['UNITY_DIR']}/auto/unity_test_summary.rb" +- +- build_dir = ENV.fetch('BUILD_DIR', './build') +- test_build_dir = ENV.fetch('TEST_BUILD_DIR', File.join(build_dir, 'test')) +- +- results = Dir["#{test_build_dir}/*.testresult"] +- parser = UnityTestSummary.new +- parser.targets = results +- parser.run +- puts parser.report +-rescue StandardError => e +- raise e unless suppress_error +-end +- +-exit(parser.failures) unless suppress_error +diff --git a/components/testframework/libs/cmock/src/cmock.c b/components/testframework/libs/cmock/src/cmock.c +deleted file mode 100644 +index 88f2c2b252..0000000000 +--- a/components/testframework/libs/cmock/src/cmock.c ++++ /dev/null +@@ -1,216 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-#include "cmock.h" +- +-/* public constants to be used by mocks */ +-const char* CMockStringOutOfMemory = "CMock has run out of memory. Please allocate more."; +-const char* CMockStringCalledMore = "Called more times than expected."; +-const char* CMockStringCalledLess = "Called fewer times than expected."; +-const char* CMockStringCalledEarly = "Called earlier than expected."; +-const char* CMockStringCalledLate = "Called later than expected."; +-const char* CMockStringCallOrder = "Called out of order."; +-const char* CMockStringIgnPreExp = "IgnoreArg called before Expect."; +-const char* CMockStringPtrPreExp = "ReturnThruPtr called before Expect."; +-const char* CMockStringPtrIsNULL = "Pointer is NULL."; +-const char* CMockStringExpNULL = "Expected NULL."; +-const char* CMockStringMismatch = "Function called with unexpected argument value."; +- +-/* private variables */ +-#ifdef CMOCK_MEM_DYNAMIC +-static unsigned char* CMock_Guts_Buffer = NULL; +-static CMOCK_MEM_INDEX_TYPE CMock_Guts_BufferSize = CMOCK_MEM_ALIGN_SIZE; +-static CMOCK_MEM_INDEX_TYPE CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE; +-#else +-static unsigned char CMock_Guts_Buffer[CMOCK_MEM_SIZE + CMOCK_MEM_ALIGN_SIZE]; +-static CMOCK_MEM_INDEX_TYPE CMock_Guts_BufferSize = CMOCK_MEM_SIZE + CMOCK_MEM_ALIGN_SIZE; +-static CMOCK_MEM_INDEX_TYPE CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE; +-#endif +- +-/*------------------------------------------------------- +- * CMock_Guts_MemNew +- *-------------------------------------------------------*/ +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNew(CMOCK_MEM_INDEX_TYPE size) +-{ +- CMOCK_MEM_INDEX_TYPE index; +- +- /* verify arguments valid (we must be allocating space for at least 1 byte, and the existing chain must be in memory somewhere) */ +- if (size < 1) +- return CMOCK_GUTS_NONE; +- +- /* verify we have enough room */ +- size = size + CMOCK_MEM_INDEX_SIZE; +- if (size & CMOCK_MEM_ALIGN_MASK) +- size = (size + CMOCK_MEM_ALIGN_MASK) & ~CMOCK_MEM_ALIGN_MASK; +- if ((CMock_Guts_BufferSize - CMock_Guts_FreePtr) < size) +- { +-#ifndef CMOCK_MEM_DYNAMIC +- return CMOCK_GUTS_NONE; /* nothing we can do; our static buffer is out of memory */ +-#else +- /* our dynamic buffer does not have enough room; request more via realloc() */ +- CMOCK_MEM_INDEX_TYPE new_buffersize = CMock_Guts_BufferSize + CMOCK_MEM_SIZE + size; +- unsigned char* new_buffer = realloc(CMock_Guts_Buffer, (size_t)new_buffersize); +- if (new_buffer == NULL) +- return CMOCK_GUTS_NONE; /* realloc() failed; out of memory */ +- CMock_Guts_Buffer = new_buffer; +- CMock_Guts_BufferSize = new_buffersize; +-#endif +- } +- +- /* determine where we're putting this new block, and init its pointer to be the end of the line */ +- index = CMock_Guts_FreePtr + CMOCK_MEM_INDEX_SIZE; +- *(CMOCK_MEM_INDEX_TYPE*)(&CMock_Guts_Buffer[CMock_Guts_FreePtr]) = CMOCK_GUTS_NONE; +- CMock_Guts_FreePtr += size; +- +- return index; +-} +- +-/*------------------------------------------------------- +- * CMock_Guts_MemChain +- *-------------------------------------------------------*/ +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemChain(CMOCK_MEM_INDEX_TYPE root_index, CMOCK_MEM_INDEX_TYPE obj_index) +-{ +- CMOCK_MEM_INDEX_TYPE index; +- void* root; +- void* obj; +- void* next; +- +- if (root_index == CMOCK_GUTS_NONE) +- { +- /* if there is no root currently, we return this object as the root of the chain */ +- return obj_index; +- } +- else +- { +- /* reject illegal nodes */ +- if ((root_index < CMOCK_MEM_ALIGN_SIZE) || (root_index >= CMock_Guts_FreePtr)) +- { +- return CMOCK_GUTS_NONE; +- } +- if ((obj_index < CMOCK_MEM_ALIGN_SIZE) || (obj_index >= CMock_Guts_FreePtr)) +- { +- return CMOCK_GUTS_NONE; +- } +- +- root = (void*)(&CMock_Guts_Buffer[root_index]); +- obj = (void*)(&CMock_Guts_Buffer[obj_index]); +- +- /* find the end of the existing chain and add us */ +- next = root; +- do { +- index = *(CMOCK_MEM_INDEX_TYPE*)((CMOCK_MEM_PTR_AS_INT)next - CMOCK_MEM_INDEX_SIZE); +- if (index >= CMock_Guts_FreePtr) +- return CMOCK_GUTS_NONE; +- if (index > 0) +- next = (void*)(&CMock_Guts_Buffer[index]); +- } while (index > 0); +- *(CMOCK_MEM_INDEX_TYPE*)((CMOCK_MEM_PTR_AS_INT)next - CMOCK_MEM_INDEX_SIZE) = (CMOCK_MEM_INDEX_TYPE)((CMOCK_MEM_PTR_AS_INT)obj - (CMOCK_MEM_PTR_AS_INT)CMock_Guts_Buffer); +- return root_index; +- } +-} +- +-/*------------------------------------------------------- +- * CMock_Guts_MemNext +- *-------------------------------------------------------*/ +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNext(CMOCK_MEM_INDEX_TYPE previous_item_index) +-{ +- CMOCK_MEM_INDEX_TYPE index; +- void* previous_item; +- +- /* There is nothing "next" if the pointer isn't from our buffer */ +- if ((previous_item_index < CMOCK_MEM_ALIGN_SIZE) || (previous_item_index >= CMock_Guts_FreePtr)) +- return CMOCK_GUTS_NONE; +- previous_item = (void*)(&CMock_Guts_Buffer[previous_item_index]); +- +- /* if the pointer is good, then use it to look up the next index +- * (we know the first element always goes in zero, so NEXT must always be > 1) */ +- index = *(CMOCK_MEM_INDEX_TYPE*)((CMOCK_MEM_PTR_AS_INT)previous_item - CMOCK_MEM_INDEX_SIZE); +- if ((index > 1) && (index < CMock_Guts_FreePtr)) +- return index; +- else +- return CMOCK_GUTS_NONE; +-} +- +-/*------------------------------------------------------- +- * CMock_Guts_MemEndOfChain +- *-------------------------------------------------------*/ +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemEndOfChain(CMOCK_MEM_INDEX_TYPE root_index) +-{ +- CMOCK_MEM_INDEX_TYPE index = root_index; +- CMOCK_MEM_INDEX_TYPE next_index; +- +- for (next_index = root_index; +- next_index != CMOCK_GUTS_NONE; +- next_index = CMock_Guts_MemNext(index)) +- { +- index = next_index; +- } +- +- return index; +-} +- +-/*------------------------------------------------------- +- * CMock_GetAddressFor +- *-------------------------------------------------------*/ +-void* CMock_Guts_GetAddressFor(CMOCK_MEM_INDEX_TYPE index) +-{ +- if ((index >= CMOCK_MEM_ALIGN_SIZE) && (index < CMock_Guts_FreePtr)) +- { +- return (void*)(&CMock_Guts_Buffer[index]); +- } +- else +- { +- return NULL; +- } +-} +- +-/*------------------------------------------------------- +- * CMock_Guts_MemBytesCapacity +- *-------------------------------------------------------*/ +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesCapacity(void) +-{ +- return (sizeof(CMock_Guts_Buffer) - CMOCK_MEM_ALIGN_SIZE); +-} +- +-/*------------------------------------------------------- +- * CMock_Guts_MemBytesFree +- *-------------------------------------------------------*/ +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesFree(void) +-{ +- return CMock_Guts_BufferSize - CMock_Guts_FreePtr; +-} +- +-/*------------------------------------------------------- +- * CMock_Guts_MemBytesUsed +- *-------------------------------------------------------*/ +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesUsed(void) +-{ +- return CMock_Guts_FreePtr - CMOCK_MEM_ALIGN_SIZE; +-} +- +-/*------------------------------------------------------- +- * CMock_Guts_MemFreeAll +- *-------------------------------------------------------*/ +-void CMock_Guts_MemFreeAll(void) +-{ +- CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE; /* skip the very beginning */ +-} +- +-/*------------------------------------------------------- +- * CMock_Guts_MemFreeFinal +- *-------------------------------------------------------*/ +-void CMock_Guts_MemFreeFinal(void) +-{ +- CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE; +-#ifdef CMOCK_MEM_DYNAMIC +- if (CMock_Guts_Buffer) +- { +- free(CMock_Guts_Buffer); +- CMock_Guts_Buffer = NULL; +- } +-#endif +-} +- +diff --git a/components/testframework/libs/cmock/src/cmock.h b/components/testframework/libs/cmock/src/cmock.h +deleted file mode 100644 +index 21123e925d..0000000000 +--- a/components/testframework/libs/cmock/src/cmock.h ++++ /dev/null +@@ -1,41 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-#ifndef CMOCK_FRAMEWORK_H +-#define CMOCK_FRAMEWORK_H +- +-#include "cmock_internals.h" +- +-#define CMOCK_VERSION_MAJOR 2 +-#define CMOCK_VERSION_MINOR 5 +-#define CMOCK_VERSION_BUILD 2 +-#define CMOCK_VERSION ((CMOCK_VERSION_MAJOR << 16) | (CMOCK_VERSION_MINOR << 8) | CMOCK_VERSION_BUILD) +- +-/* should be big enough to index full range of CMOCK_MEM_MAX */ +-#ifndef CMOCK_MEM_INDEX_TYPE +-#include +-#define CMOCK_MEM_INDEX_TYPE size_t +-#endif +- +-#define CMOCK_GUTS_NONE (0) +- +-/*------------------------------------------------------- +- * Memory API +- *-------------------------------------------------------*/ +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNew(CMOCK_MEM_INDEX_TYPE size); +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemChain(CMOCK_MEM_INDEX_TYPE root_index, CMOCK_MEM_INDEX_TYPE obj_index); +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNext(CMOCK_MEM_INDEX_TYPE previous_item_index); +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemEndOfChain(CMOCK_MEM_INDEX_TYPE root_index); +- +-void* CMock_Guts_GetAddressFor(CMOCK_MEM_INDEX_TYPE index); +- +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesCapacity(void); +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesFree(void); +-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesUsed(void); +-void CMock_Guts_MemFreeAll(void); +-void CMock_Guts_MemFreeFinal(void); +- +-#endif /* end of CMOCK_FRAMEWORK_H */ +diff --git a/components/testframework/libs/cmock/src/cmock_internals.h b/components/testframework/libs/cmock/src/cmock_internals.h +deleted file mode 100644 +index 56fb33b1aa..0000000000 +--- a/components/testframework/libs/cmock/src/cmock_internals.h ++++ /dev/null +@@ -1,91 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-#ifndef CMOCK_FRAMEWORK_INTERNALS_H +-#define CMOCK_FRAMEWORK_INTERNALS_H +- +-#include "unity.h" +- +-/* These are constants that the generated mocks have access to */ +-extern const char* CMockStringOutOfMemory; +-extern const char* CMockStringCalledMore; +-extern const char* CMockStringCalledLess; +-extern const char* CMockStringCalledEarly; +-extern const char* CMockStringCalledLate; +-extern const char* CMockStringCallOrder; +-extern const char* CMockStringIgnPreExp; +-extern const char* CMockStringPtrPreExp; +-extern const char* CMockStringPtrIsNULL; +-extern const char* CMockStringExpNULL; +-extern const char* CMockStringMismatch; +- +-/* define CMOCK_MEM_DYNAMIC to grab memory as needed with malloc +- * when you do that, CMOCK_MEM_SIZE is used for incremental size instead of total */ +-#ifdef CMOCK_MEM_STATIC +-#undef CMOCK_MEM_DYNAMIC +-#endif +- +-#ifdef CMOCK_MEM_DYNAMIC +-#include +-#endif +- +-/* this is used internally during pointer arithmetic. make sure this type is the same size as the target's pointer type */ +-#ifndef CMOCK_MEM_PTR_AS_INT +-#ifdef UNITY_POINTER_WIDTH +-#ifdef UNITY_INT_WIDTH +-#if UNITY_POINTER_WIDTH == UNITY_INT_WIDTH +-#define CMOCK_MEM_PTR_AS_INT unsigned int +-#endif +-#endif +-#endif +-#endif +- +-#ifndef CMOCK_MEM_PTR_AS_INT +-#ifdef UNITY_POINTER_WIDTH +-#ifdef UNITY_LONG_WIDTH +-#if UNITY_POINTER_WIDTH == UNITY_LONG_WIDTH +-#define CMOCK_MEM_PTR_AS_INT unsigned long +-#endif +-#if UNITY_POINTER_WIDTH > UNITY_LONG_WIDTH +-#define CMOCK_MEM_PTR_AS_INT unsigned long long +-#endif +-#endif +-#endif +-#endif +- +-#ifndef CMOCK_MEM_PTR_AS_INT +-#define CMOCK_MEM_PTR_AS_INT unsigned long +-#endif +- +-/* 0 for no alignment, 1 for 16-bit, 2 for 32-bit, 3 for 64-bit */ +-#ifndef CMOCK_MEM_ALIGN +- #ifdef UNITY_LONG_WIDTH +- #if (UNITY_LONG_WIDTH == 16) +- #define CMOCK_MEM_ALIGN (1) +- #elif (UNITY_LONG_WIDTH == 32) +- #define CMOCK_MEM_ALIGN (2) +- #elif (UNITY_LONG_WIDTH == 64) +- #define CMOCK_MEM_ALIGN (3) +- #else +- #define CMOCK_MEM_ALIGN (2) +- #endif +- #else +- #define CMOCK_MEM_ALIGN (2) +- #endif +-#endif +- +-/* amount of memory to allow cmock to use in its internal heap */ +-#ifndef CMOCK_MEM_SIZE +-#define CMOCK_MEM_SIZE (32768) +-#endif +- +-/* automatically calculated defs for easier reading */ +-#define CMOCK_MEM_ALIGN_SIZE (CMOCK_MEM_INDEX_TYPE)(1u << CMOCK_MEM_ALIGN) +-#define CMOCK_MEM_ALIGN_MASK (CMOCK_MEM_INDEX_TYPE)(CMOCK_MEM_ALIGN_SIZE - 1) +-#define CMOCK_MEM_INDEX_SIZE (CMOCK_MEM_INDEX_TYPE)(CMOCK_MEM_PTR_AS_INT)((sizeof(CMOCK_MEM_INDEX_TYPE) > CMOCK_MEM_ALIGN_SIZE) ? sizeof(CMOCK_MEM_INDEX_TYPE) : CMOCK_MEM_ALIGN_SIZE) +- +- +-#endif /* end of CMOCK_FRAMEWORK_INTERNALS_H */ +diff --git a/components/testframework/libs/cmock/src/meson.build b/components/testframework/libs/cmock/src/meson.build +deleted file mode 100644 +index 0273afece4..0000000000 +--- a/components/testframework/libs/cmock/src/meson.build ++++ /dev/null +@@ -1,12 +0,0 @@ +-# +-# build script written by : Michael Brockus. +-# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. +-# +-# license: MIT +-# +-cmock_dir = include_directories('.') +- +-cmock_lib = static_library(meson.project_name(), +- sources: ['cmock.c'], +- dependencies: [unity_dep], +- include_directories: cmock_dir) +diff --git a/components/testframework/libs/cmock/test/c/TestCMockC.c b/components/testframework/libs/cmock/test/c/TestCMockC.c +deleted file mode 100644 +index 769a2b31de..0000000000 +--- a/components/testframework/libs/cmock/test/c/TestCMockC.c ++++ /dev/null +@@ -1,333 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-#include "unity.h" +-#include "cmock.h" +- +-#define TEST_MEM_INDEX_SIZE (sizeof(CMOCK_MEM_INDEX_TYPE)) +- +-void setUp(void) +-{ +- CMock_Guts_MemFreeAll(); +-} +- +-void tearDown(void) +-{ +-} +- +-void test_MemNewWillReturnNullIfGivenIllegalSizes(void) +-{ +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNew(0) ); +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNew(CMOCK_MEM_SIZE - TEST_MEM_INDEX_SIZE + 1) ); +- TEST_ASSERT_NULL( CMock_Guts_GetAddressFor(CMOCK_GUTS_NONE) ); +- +- //verify we're cleared still +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(CMOCK_MEM_SIZE, CMock_Guts_MemBytesCapacity()); +- TEST_ASSERT_EQUAL_UINT32(0, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); +-} +- +-void test_MemShouldProtectAgainstMemoryOverflow(void) +-{ +- (void)CMock_Guts_MemNew(CMOCK_MEM_SIZE - TEST_MEM_INDEX_SIZE); +- +- //verify we've used all the memory +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(TEST_MEM_INDEX_SIZE, CMock_Guts_MemBytesFree()); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT32(CMOCK_MEM_SIZE, CMock_Guts_MemBytesUsed()); +-} +- +-void test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation(void) +-{ +- CMOCK_MEM_INDEX_TYPE next = CMock_Guts_MemNew(4); +- TEST_ASSERT_EQUAL(4 + TEST_MEM_INDEX_SIZE, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 4 - TEST_MEM_INDEX_SIZE, CMock_Guts_MemBytesFree()); +- +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemChain(next + CMOCK_MEM_SIZE, next) ); +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemChain(next, next + CMOCK_MEM_SIZE) ); +- +- //verify we're still the same +- TEST_ASSERT_EQUAL(4 + TEST_MEM_INDEX_SIZE, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 4 - TEST_MEM_INDEX_SIZE, CMock_Guts_MemBytesFree()); +-} +- +-void test_MemNextWillReturnNullIfGivenABadRoot(void) +-{ +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(0) ); +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(2) ); +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(CMOCK_MEM_SIZE - 4) ); +- +- //verify we're cleared still +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); +-} +- +-void test_ThatWeCanClaimAndChainAFewElementsTogether(void) +-{ +- unsigned int i; +- CMOCK_MEM_INDEX_TYPE next; +- CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; +- CMOCK_MEM_INDEX_TYPE element[4]; +- +- //verify we're cleared first +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); +- +- //first element +- element[0] = CMock_Guts_MemNew(sizeof(unsigned int)); +- TEST_ASSERT_MESSAGE(element[0] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- first = CMock_Guts_MemChain(first, element[0]); +- TEST_ASSERT_EQUAL(element[0], first); +- *((unsigned int*)CMock_Guts_GetAddressFor(element[0])) = 0; +- +- //verify we're using the right amount of memory +- TEST_ASSERT_EQUAL(1 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 1 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesFree()); +- +- //second element +- element[1] = CMock_Guts_MemNew(sizeof(unsigned int)); +- TEST_ASSERT_MESSAGE(element[1] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- TEST_ASSERT_NOT_EQUAL(element[0], element[1]); +- TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[1])); +- *((unsigned int*)CMock_Guts_GetAddressFor(element[1])) = 1; +- +- //verify we're using the right amount of memory +- TEST_ASSERT_EQUAL(2 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 2 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesFree()); +- +- //third element +- element[2] = CMock_Guts_MemNew(sizeof(unsigned int)); +- TEST_ASSERT_MESSAGE(element[2] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- TEST_ASSERT_NOT_EQUAL(element[0], element[2]); +- TEST_ASSERT_NOT_EQUAL(element[1], element[2]); +- TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[2])); +- *((unsigned int*)CMock_Guts_GetAddressFor(element[2])) = 2; +- +- //verify we're using the right amount of memory +- TEST_ASSERT_EQUAL(3 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 3 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesFree()); +- +- //fourth element +- element[3] = CMock_Guts_MemNew(sizeof(unsigned int)); +- TEST_ASSERT_MESSAGE(element[3] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- TEST_ASSERT_NOT_EQUAL(element[0], element[3]); +- TEST_ASSERT_NOT_EQUAL(element[1], element[3]); +- TEST_ASSERT_NOT_EQUAL(element[2], element[3]); +- TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[3])); +- *((unsigned int*)CMock_Guts_GetAddressFor(element[3])) = 3; +- +- //verify we're using the right amount of memory +- TEST_ASSERT_EQUAL(4 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 4 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesFree()); +- +- //traverse list +- next = first; +- for (i = 0; i < 4; i++) +- { +- TEST_ASSERT_EQUAL(element[i], next); +- TEST_ASSERT_EQUAL(i, *((unsigned int*)CMock_Guts_GetAddressFor(element[i]))); +- next = CMock_Guts_MemNext(next); +- } +- +- //verify we get a null at the end of the list +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, next); +- +- //verify we're using the right amount of memory +- TEST_ASSERT_EQUAL(4 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - 4 * (TEST_MEM_INDEX_SIZE + sizeof(unsigned int)), CMock_Guts_MemBytesFree()); +- +- //Free it all +- CMock_Guts_MemFreeAll(); +- +- //verify we're cleared +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); +-} +- +-void test_ThatCMockStopsReturningMoreDataWhenItRunsOutOfMemory(void) +-{ +- unsigned int i; +- CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; +- CMOCK_MEM_INDEX_TYPE next; +- +- //even though we are asking for one byte, we've told it to align to closest CMOCK_MEM_ALIGN_SIZE bytes, therefore it will waste a byte each time +- //so each call will use (CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE) bytes (CMOCK_MEM_INDEX_SIZE for the index, 1 for the data, and (CMOCK_MEM_ALIGN_SIZE - 1) wasted). +- //therefore we can safely allocated total/(CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE) times. +- for (i = 0; i < (CMOCK_MEM_SIZE / (CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE)); i++) +- { +- TEST_ASSERT_EQUAL(i*(CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - i*(CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE), CMock_Guts_MemBytesFree()); +- +- next = CMock_Guts_MemNew(1); +- TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- +- first = CMock_Guts_MemChain(first, next); +- TEST_ASSERT_MESSAGE(first != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- } +- +- //verify we're at top of memory +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesFree()); +- +- //The very next call will return a NULL, and any after that +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(1)); +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(1)); +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(1)); +- +- //verify nothing has changed +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesFree()); +- +- //verify we can still walk through the elements allocated +- next = first; +- for (i = 0; i < (CMOCK_MEM_SIZE / (CMOCK_MEM_INDEX_SIZE + CMOCK_MEM_ALIGN_SIZE)); i++) +- { +- TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- next = CMock_Guts_MemNext(next); +- } +- +- //there aren't any after that +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, (UNITY_UINT32)next); +-} +- +-void test_ThatCMockStopsReturningMoreDataWhenAskForMoreThanItHasLeftEvenIfNotAtExactEnd(void) +-{ +- unsigned int i; +- CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; +- CMOCK_MEM_INDEX_TYPE next; +- +- //we're asking for (CMOCK_MEM_INDEX_SIZE + 8) bytes each time now (CMOCK_MEM_INDEX_SIZE for index, 8 for data). +- //CMOCK_MEM_SIZE/(CMOCK_MEM_INDEX_SIZE + 8) requests will request as much data as possible, while ensuring that there isn't enough +- //memory for the next request +- for (i = 0; i < CMOCK_MEM_SIZE/(CMOCK_MEM_INDEX_SIZE + 8); i++) +- { +- TEST_ASSERT_EQUAL(i*(CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - i*(CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesFree()); +- +- next = CMock_Guts_MemNew(8); +- TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- +- first = CMock_Guts_MemChain(first, next); +- TEST_ASSERT_MESSAGE(first != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- +- //verify writing data won't screw us up +- *((unsigned int*)CMock_Guts_GetAddressFor(next)) = i; +- } +- +- //verify we're at top of memory +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - CMOCK_MEM_SIZE % (CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE % (CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesFree()); +- +- //The very next call will return a NONE, and any after that +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(8)); +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(5)); +- +- //verify nothing has changed +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - CMOCK_MEM_SIZE % (CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE % (CMOCK_MEM_INDEX_SIZE + 8), CMock_Guts_MemBytesFree()); +- +- //verify we can still walk through the elements allocated +- next = first; +- for (i = 0; i < CMOCK_MEM_SIZE/(CMOCK_MEM_INDEX_SIZE + 8); i++) +- { +- TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- TEST_ASSERT_EQUAL(i, *((unsigned int*)CMock_Guts_GetAddressFor(next))); +- next = CMock_Guts_MemNext(next); +- } +- +- //there aren't any after that +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, next); +-} +- +-void test_ThatWeCanAskForAllSortsOfSizes(void) +-{ +-#if CMOCK_MEM_ALIGN != 2 +- TEST_IGNORE_MESSAGE("Test relies on a particular environmental setup, which is not present"); +-#else +- +- unsigned int i; +- CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; +- CMOCK_MEM_INDEX_TYPE next; +- CMOCK_MEM_INDEX_TYPE sizes[5] = {3, 1, 80, 5, 4}; +- CMOCK_MEM_INDEX_TYPE sizes_buffered[5] = {4, 4, 80, 8, 4}; +- CMOCK_MEM_INDEX_TYPE sum = 0; +- +- for (i = 0; i < 5; i++) +- { +- next = CMock_Guts_MemNew(sizes[i]); +- TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- +- first = CMock_Guts_MemChain(first, next); +- TEST_ASSERT_MESSAGE(first != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- +- sum += sizes_buffered[i] + 4; +- TEST_ASSERT_EQUAL(sum, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE - sum, CMock_Guts_MemBytesFree()); +- } +- +- //show that we can't ask for too much memory +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(CMOCK_MEM_SIZE - sum + 8)); +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, CMock_Guts_MemNew(CMOCK_MEM_SIZE - sum + 1)); +- +- //but we CAN ask for something that will still fit +- next = CMock_Guts_MemNew(CMOCK_MEM_SIZE - sum - 4); +- TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- +- first = CMock_Guts_MemChain(first, next); +- TEST_ASSERT_MESSAGE(first != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- +- //verify we're used up now +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesFree()); +- +- //verify we can still walk through the elements allocated +- next = first; +- for (i = 0; i < 6; i++) +- { +- TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- next = CMock_Guts_MemNext(next); +- } +- +- //there aren't any after that +- TEST_ASSERT_EQUAL_HEX(CMOCK_GUTS_NONE, next); +-#endif +-} +- +-void test_MemEndOfChain(void) +-{ +- CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; +- CMOCK_MEM_INDEX_TYPE element[4]; +- +- //verify we're cleared first +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); +- +- //first element +- element[0] = CMock_Guts_MemNew(sizeof(unsigned int)); +- first = CMock_Guts_MemChain(first, element[0]); +- TEST_ASSERT_MESSAGE(element[0] == CMock_Guts_MemEndOfChain(first), "Should have returned element[0]"); +- +- //second element +- element[1] = CMock_Guts_MemNew(sizeof(unsigned int)); +- CMock_Guts_MemChain(first, element[1]); +- TEST_ASSERT_MESSAGE(element[1] == CMock_Guts_MemEndOfChain(first), "Should have returned element[1]"); +- +- //third element +- element[2] = CMock_Guts_MemNew(sizeof(unsigned int)); +- CMock_Guts_MemChain(first, element[2]); +- TEST_ASSERT_MESSAGE(element[2] == CMock_Guts_MemEndOfChain(first), "Should have returned element[2]"); +- +- //fourth element +- element[3] = CMock_Guts_MemNew(sizeof(unsigned int)); +- CMock_Guts_MemChain(first, element[3]); +- TEST_ASSERT_MESSAGE(element[3] == CMock_Guts_MemEndOfChain(first), "Should have returned element[3]"); +- +- //Free it all +- CMock_Guts_MemFreeAll(); +- +- //verify we're cleared +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); +-} +diff --git a/components/testframework/libs/cmock/test/c/TestCMockC.yml b/components/testframework/libs/cmock/test/c/TestCMockC.yml +deleted file mode 100644 +index 06067b161e..0000000000 +--- a/components/testframework/libs/cmock/test/c/TestCMockC.yml ++++ /dev/null +@@ -1,14 +0,0 @@ +---- +-:files: +- - '../src/cmock.c' +- - './c/TestCMockC.c' +- - './c/TestCMockC_Runner.c' +- - '../vendor/unity/src/unity.c' +-:options: +- - 'TEST' +- - 'CMOCK_MEM_STATIC' +- - 'CMOCK_MEM_SIZE=128' +- #- 'CMOCK_MEM_SIZE=40000' +- - 'CMOCK_MEM_ALIGN=2' +- - 'CMOCK_MEM_INDEX_TYPE=int' +- +diff --git a/components/testframework/libs/cmock/test/c/TestCMockCDynamic.c b/components/testframework/libs/cmock/test/c/TestCMockCDynamic.c +deleted file mode 100644 +index b81d9d0b2f..0000000000 +--- a/components/testframework/libs/cmock/test/c/TestCMockCDynamic.c ++++ /dev/null +@@ -1,186 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-#include "unity.h" +-#include "cmock.h" +- +-#define TEST_MEM_INDEX_SIZE (CMOCK_MEM_INDEX_TYPE)(sizeof(CMOCK_MEM_INDEX_TYPE)) +-#define TEST_MEM_INDEX_PAD (CMOCK_MEM_INDEX_TYPE)(((CMOCK_MEM_INDEX_TYPE)sizeof(CMOCK_MEM_INDEX_TYPE) + 7) & ~7) //round up to nearest 4 byte boundary +- +-CMOCK_MEM_INDEX_TYPE StartingSize; +- +-void setUp(void) +-{ +- CMock_Guts_MemFreeAll(); +- StartingSize = CMock_Guts_MemBytesFree(); +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); +-} +- +-void tearDown(void) +-{ +-} +- +-void test_MemNewWillReturnNullIfGivenIllegalSizes(void) +-{ +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNew(0) ); +- +- //verify we're cleared still +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesFree()); +-} +- +-void test_MemNewWillNowSupportSizesGreaterThanTheDefinesCMockSize(void) +-{ +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesFree()); +- +- TEST_ASSERT_MESSAGE(CMock_Guts_MemNew(CMOCK_MEM_SIZE - TEST_MEM_INDEX_SIZE + 1) != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- +- TEST_ASSERT_EQUAL(((CMOCK_MEM_INDEX_TYPE)CMOCK_MEM_SIZE + TEST_MEM_INDEX_PAD), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL((CMOCK_MEM_INDEX_TYPE)CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree()); +-} +- +-void test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation(void) +-{ +- CMOCK_MEM_INDEX_TYPE next = CMock_Guts_MemNew(8); +- TEST_ASSERT_EQUAL(8 + TEST_MEM_INDEX_PAD, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(StartingSize - 8 - TEST_MEM_INDEX_PAD, CMock_Guts_MemBytesFree()); +- +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemChain(next + CMOCK_MEM_SIZE, next) ); +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemChain(next, next + CMOCK_MEM_SIZE) ); +- +- //verify we're still the same +- TEST_ASSERT_EQUAL(8 + TEST_MEM_INDEX_PAD, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(StartingSize - 8 - TEST_MEM_INDEX_PAD, CMock_Guts_MemBytesFree()); +-} +- +-void test_MemNextWillReturnNullIfGivenABadRoot(void) +-{ +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(0) ); +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(2) ); +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext( CMOCK_MEM_SIZE - 4 ) ); +- +- //verify we're cleared still +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(StartingSize, CMock_Guts_MemBytesFree()); +-} +- +-void test_ThatWeCanClaimAndChainAFewElementsTogether(void) +-{ +- unsigned int i; +- CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; +- CMOCK_MEM_INDEX_TYPE next; +- CMOCK_MEM_INDEX_TYPE element[4]; +- +- //verify we're cleared first +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(StartingSize, CMock_Guts_MemBytesFree()); +- +- //first element +- element[0] = CMock_Guts_MemNew(sizeof(unsigned int)); +- TEST_ASSERT_MESSAGE(element[0] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- first = CMock_Guts_MemChain(first, element[0]); +- TEST_ASSERT_EQUAL(element[0], first); +- *((unsigned int*)CMock_Guts_GetAddressFor(element[0])) = 0; +- +- //verify we're using the right amount of memory +- TEST_ASSERT_EQUAL(1 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(StartingSize - 1 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesFree()); +- +- //second element +- element[1] = CMock_Guts_MemNew(sizeof(unsigned int)); +- TEST_ASSERT_MESSAGE(element[1] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- TEST_ASSERT_NOT_EQUAL(element[0], element[1]); +- TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[1])); +- *((unsigned int*)CMock_Guts_GetAddressFor(element[1])) = 1; +- +- //verify we're using the right amount of memory +- TEST_ASSERT_EQUAL(2 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(StartingSize - 2 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesFree()); +- +- //third element +- element[2] = CMock_Guts_MemNew(sizeof(unsigned int)); +- TEST_ASSERT_MESSAGE(element[2] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- TEST_ASSERT_NOT_EQUAL(element[0], element[2]); +- TEST_ASSERT_NOT_EQUAL(element[1], element[2]); +- TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[2])); +- *((unsigned int*)CMock_Guts_GetAddressFor(element[2])) = 2; +- +- //verify we're using the right amount of memory +- TEST_ASSERT_EQUAL(3 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(StartingSize - 3 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesFree()); +- +- //fourth element +- element[3] = CMock_Guts_MemNew(sizeof(unsigned int)); +- TEST_ASSERT_MESSAGE(element[3] != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- TEST_ASSERT_NOT_EQUAL(element[0], element[3]); +- TEST_ASSERT_NOT_EQUAL(element[1], element[3]); +- TEST_ASSERT_NOT_EQUAL(element[2], element[3]); +- TEST_ASSERT_EQUAL(first, CMock_Guts_MemChain(first, element[3])); +- *((unsigned int*)CMock_Guts_GetAddressFor(element[3])) = 3; +- +- //verify we're using the right amount of memory +- TEST_ASSERT_EQUAL(4 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(StartingSize - 4 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesFree()); +- +- //traverse list +- next = first; +- for (i = 0; i < 4; i++) +- { +- TEST_ASSERT_EQUAL(element[i], next); +- TEST_ASSERT_EQUAL(i, *((unsigned int*)CMock_Guts_GetAddressFor(element[i]))); +- next = CMock_Guts_MemNext(next); +- } +- +- //verify we get a null at the end of the list +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, next); +- +- //verify we're using the right amount of memory +- TEST_ASSERT_EQUAL(4 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(StartingSize - 4 * (TEST_MEM_INDEX_PAD + 8), CMock_Guts_MemBytesFree()); +- +- //Free it all +- CMock_Guts_MemFreeAll(); +- +- //verify we're cleared +- TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT_EQUAL(StartingSize, CMock_Guts_MemBytesFree()); +-} +- +-void test_ThatWeCanAskForAllSortsOfSizes(void) +-{ +- CMOCK_MEM_INDEX_TYPE i; +- CMOCK_MEM_INDEX_TYPE first = CMOCK_GUTS_NONE; +- CMOCK_MEM_INDEX_TYPE next; +- CMOCK_MEM_INDEX_TYPE sizes[10] = {3, 1, 80, 5, 8, 31, 7, 911, 2, 80}; +- CMOCK_MEM_INDEX_TYPE sizes_buffered[10] = {16, 16, 88, 16, 16, 40, 16, 920, 16, 88}; //includes counter +- CMOCK_MEM_INDEX_TYPE sum = 0; +- CMOCK_MEM_INDEX_TYPE cap; +- +- for (i = 0; i < 10; i++) +- { +- next = CMock_Guts_MemNew(sizes[i]); +- TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- +- first = CMock_Guts_MemChain(first, next); +- TEST_ASSERT_MESSAGE(first != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- +- sum += sizes_buffered[i]; +- cap = (StartingSize > (sum + CMOCK_MEM_SIZE)) ? StartingSize : (sum + CMOCK_MEM_SIZE); +- TEST_ASSERT_EQUAL(sum, CMock_Guts_MemBytesUsed()); +- TEST_ASSERT(cap >= CMock_Guts_MemBytesFree()); +- } +- +- //verify we can still walk through the elements allocated +- next = first; +- for (i = 0; i < 10; i++) +- { +- TEST_ASSERT_MESSAGE(next != CMOCK_GUTS_NONE, "Should Not Have Returned CMOCK_GUTS_NONE"); +- next = CMock_Guts_MemNext(next); +- } +- +- //there aren't any after that +- TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, next); +-} +diff --git a/components/testframework/libs/cmock/test/c/TestCMockCDynamic.yml b/components/testframework/libs/cmock/test/c/TestCMockCDynamic.yml +deleted file mode 100644 +index 393d8dd86b..0000000000 +--- a/components/testframework/libs/cmock/test/c/TestCMockCDynamic.yml ++++ /dev/null +@@ -1,12 +0,0 @@ +---- +-:files: +- - '../src/cmock.c' +- - './c/TestCMockCDynamic.c' +- - './c/TestCMockCDynamic_Runner.c' +- - '../vendor/unity/src/unity.c' +-:options: +- - 'TEST' +- - 'CMOCK_MEM_DYNAMIC' +- - 'CMOCK_MEM_SIZE=64' +- - 'CMOCK_MEM_ALIGN=3' +- - 'CMOCK_MEM_INDEX_TYPE=short' +diff --git a/components/testframework/libs/cmock/test/c/TestCMockCDynamic_Runner.c b/components/testframework/libs/cmock/test/c/TestCMockCDynamic_Runner.c +deleted file mode 100644 +index d686080912..0000000000 +--- a/components/testframework/libs/cmock/test/c/TestCMockCDynamic_Runner.c ++++ /dev/null +@@ -1,36 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-#include "unity.h" +-#include "cmock.h" +-#include +-#include +- +-extern void setUp(void); +-extern void tearDown(void); +- +-extern void test_MemNewWillReturnNullIfGivenIllegalSizes(void); +-extern void test_MemNewWillNowSupportSizesGreaterThanTheDefinesCMockSize(void); +-extern void test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation(void); +-extern void test_MemNextWillReturnNullIfGivenABadRoot(void); +-extern void test_ThatWeCanClaimAndChainAFewElementsTogether(void); +-extern void test_ThatWeCanAskForAllSortsOfSizes(void); +- +-int main(void) +-{ +- UnityBegin("TestCMockDynamic.c"); +- +- RUN_TEST(test_MemNewWillReturnNullIfGivenIllegalSizes, 26); +- RUN_TEST(test_MemNewWillNowSupportSizesGreaterThanTheDefinesCMockSize, 35); +- RUN_TEST(test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation, 45); +- RUN_TEST(test_MemNextWillReturnNullIfGivenABadRoot, 59); +- RUN_TEST(test_ThatWeCanClaimAndChainAFewElementsTogether, 70); +- RUN_TEST(test_ThatWeCanAskForAllSortsOfSizes, 152); +- +- UnityEnd(); +- CMock_Guts_MemFreeFinal(); +- return 0; +-} +diff --git a/components/testframework/libs/cmock/test/c/TestCMockC_Runner.c b/components/testframework/libs/cmock/test/c/TestCMockC_Runner.c +deleted file mode 100644 +index af559d8f4f..0000000000 +--- a/components/testframework/libs/cmock/test/c/TestCMockC_Runner.c ++++ /dev/null +@@ -1,41 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-#include "unity.h" +-#include +-#include +- +-extern void setUp(void); +-extern void tearDown(void); +- +-extern void test_MemNewWillReturnNullIfGivenIllegalSizes(void); +-extern void test_MemShouldProtectAgainstMemoryOverflow(void); +-extern void test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation(void); +-extern void test_MemNextWillReturnNullIfGivenABadRoot(void); +-extern void test_ThatWeCanClaimAndChainAFewElementsTogether(void); +-extern void test_MemEndOfChain(void); +-extern void test_ThatCMockStopsReturningMoreDataWhenItRunsOutOfMemory(void); +-extern void test_ThatCMockStopsReturningMoreDataWhenAskForMoreThanItHasLeftEvenIfNotAtExactEnd(void); +-extern void test_ThatWeCanAskForAllSortsOfSizes(void); +- +-int main(void) +-{ +- Unity.TestFile = "TestCMock.c"; +- UnityBegin(Unity.TestFile); +- +- RUN_TEST(test_MemNewWillReturnNullIfGivenIllegalSizes, 21); +- RUN_TEST(test_MemShouldProtectAgainstMemoryOverflow, 33); +- RUN_TEST(test_MemChainWillReturnNullAndDoNothingIfGivenIllegalInformation, 42); +- RUN_TEST(test_MemNextWillReturnNullIfGivenABadRoot, 56); +- RUN_TEST(test_ThatWeCanClaimAndChainAFewElementsTogether, 67); +- RUN_TEST(test_MemEndOfChain, 149); +- RUN_TEST(test_ThatCMockStopsReturningMoreDataWhenItRunsOutOfMemory, 195); +- RUN_TEST(test_ThatCMockStopsReturningMoreDataWhenAskForMoreThanItHasLeftEvenIfNotAtExactEnd, 244); +- RUN_TEST(test_ThatWeCanAskForAllSortsOfSizes, 298); +- +- UnityEnd(); +- return 0; +-} +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_FLASH.mac b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_FLASH.mac +deleted file mode 100644 +index 7c4021aad5..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_FLASH.mac ++++ /dev/null +@@ -1,71 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : SAM7_FLASH.mac +-// Object : Generic Macro File for IAR +-// 1.0 17/Aug/05 FBr : Creation +-// ---------------------------------------------------------------------------- +- +-/********************************************************************* +-* +-* _InitRSTC() +-* +-* Function description +-* Initializes the RSTC (Reset controller). +-* This makes sense since the default is to not allow user resets, which makes it impossible to +-* apply a second RESET via J-Link +-*/ +-_InitRSTC() { +- __writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset +-} +- +-/********************************************************************* +-* +-* _InitPLL() +-* Function description +-* Initializes the PMC. +-* 1. Enable the Main Oscillator +-* 2. Configure PLL to 96MHz +-* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz +-*/ +- _InitPLL() { +- +- __message "Enable Main Oscillator"; +- __writeMemory32(0x00000601,0xFFFFFc20,"Memory"); // MOSC +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) ); +- +- __message "Set PLL to 96MHz"; +- __writeMemory32(0x10191c05,0xFFFFFc2c,"Memory"); // LOCK +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) ); +- +- __message "Set Master Clock to 48MHz"; +- __writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); +- __writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); +-} +- +-/********************************************************************* +-* +-* execUserReset() : JTAG set initially to Full Speed +-*/ +-execUserReset() { +- __message "execUserReset()"; +- __emulatorSpeed(30000); // Set JTAG speed to 30kHz to make a hardware reset +- __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz) +- _InitPLL(); // Allow to debug at JTAG Full Speed +- _InitRSTC(); // Enable User Reset to allow execUserReset() execution +- __emulatorSpeed(0); // Set JTAG speed to full speed +-} +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_RAM.mac b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_RAM.mac +deleted file mode 100644 +index a1bf81dc79..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_RAM.mac ++++ /dev/null +@@ -1,94 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : SAM7_RAM.mac +-// Object : Generic Macro File for IAR +-// 1.0 17/Aug/05 FBr : Creation +-// ---------------------------------------------------------------------------- +- +-/********************************************************************* +-* +-* _MapRAMAt0() +-* +-* Function description +-* Maps RAM at 0. +-*/ +-_MapRAMAt0(){ +- __message "Changing mapping: RAM mapped to 0"; +- __writeMemory32(0x00000001,0xFFFFFF00,"Memory"); +-} +- +-/********************************************************************* +-* +-* _InitRSTC() +-* +-* Function description +-* Initializes the RSTC (Reset controller). +-* This makes sense since the default is to not allow user resets, which makes it impossible to +-* apply a second RESET via J-Link +-*/ +-_InitRSTC() { +- __writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset +-} +- +-/********************************************************************* +-* +-* _InitPLL() +-* Function description +-* Initializes the PMC. +-* 1. Enable the Main Oscillator +-* 2. Configure PLL to 96MHz +-* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz +-*/ +- _InitPLL() { +- +- __message "Set Main Oscillator"; +- __writeMemory32(0x00004001,0xFFFFFc20,"Memory"); // MOSC +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) ); +- +- __message "Set PLL to 96MHz"; +- __writeMemory32(0x10483f0e,0xFFFFFc2c,"Memory"); // LOCK +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) ); +- +- __message "Set Master Clock to 48MHz"; +- __writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); +- __writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); +-} +- +-/********************************************************************* +-* +-* execUserReset() : JTAG set initially to Full Speed +-*/ +-execUserReset() { +- __message "execUserReset()"; +- __emulatorSpeed(30000); // Set JTAG speed to 30kHz to make a hardware reset +- __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset +- _InitPLL(); // Allow to debug at JTAG Full Speed +- _MapRAMAt0(); // Remap RAM to address 0 +- __emulatorSpeed(0); // Set JTAG speed to full speed +-} +- +-/********************************************************************* +-* +-* execUserPreload() : JTAG set initially to 32kHz +-*/ +-execUserPreload() { +- __message "execUserPreload()"; +- __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz) +- _InitPLL(); // Allow to load Code at JTAG Full Speed +- _MapRAMAt0(); // Remap RAM to address 0 +- _InitRSTC(); // Enable User Reset to allow execUserReset() execution +-} +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_SIM.mac b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_SIM.mac +deleted file mode 100644 +index 2be1a4c9b9..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/SAM7_SIM.mac ++++ /dev/null +@@ -1,67 +0,0 @@ +-//========================================================= +-// Simulation setup file for esc07_demo project +-//========================================================= +- +-__var _timer0_interrupt_ID; +- +-irqBreak() +-{ +- __var __AIC_SMR; +- __var __AIC_IECR; +- __var __AIC_IVR; +- +- // read AIC_IECR instead, since not fully supported by simulator +- __AIC_IECR = __readMemory32(0xFFFFF120, "Memory"); +- if(__AIC_IECR & 0x1000) +- { +- __AIC_SMR = __readMemory32(0xFFFFF060, "Memory"); +- __AIC_IVR = __readMemory32(0xFFFFF0B0, "Memory"); //AIC_IVR = AIC_SVR[x] +- __writeMemory32(__AIC_IVR, 0xFFFFF100, "Memory"); //AIC_IVR +- __writeMemory32(0x1000, 0xFFFFF10C, "Memory"); //AIC_IPR +- __writeMemory32(0x2, 0xFFFFF114, "Memory"); //AIC_CISR +- } +- +- return 0; +-} +- +-setupProcessorRegisters() +-{ +- // Write TC0_SR.CPCS with correct status for ISR (Clock enabled; RC Compare Flag = TRUE) +- __writeMemory32(0x00010010, 0xfffa0020, "Memory"); +- +- // Set TX ready flag in USART0 status register +- // USART0_BASE->US_CSR = AT91C_US_TXRDY +- __writeMemory32(0x00000002, 0xfffc0014, "Memory"); +-} +- +-configureTimer0Interrupt() +-{ +- __var _master_clock_frequency; +- __var _timer0_period_cycles; +- +- // Calculate timer0 frequency in master clock cycles +- _master_clock_frequency = 48054857; +- _timer0_period_cycles = _master_clock_frequency / 100; +- if((_master_clock_frequency % 100) >= 50) +- { +- _timer0_period_cycles++; +- } +- +- __cancelAllInterrupts(); +- __enableInterrupts(); +- +- _timer0_interrupt_ID = __orderInterrupt("IRQ", _timer0_period_cycles, _timer0_period_cycles, 0, 0, 0, 100); +- +- if(-1 == _timer0_interrupt_ID) +- { +- __message "ERROR: failed to order timer 0 interrupt"; +- } +- +- __setCodeBreak("0x18", 0, "irqBreak()", "TRUE", ""); +-} +- +-execUserReset() +-{ +- setupProcessorRegisters(); +- configureTimer0Interrupt(); +-} +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_FLASH.xcl b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_FLASH.xcl +deleted file mode 100644 +index 02eaec7dcb..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_FLASH.xcl ++++ /dev/null +@@ -1,185 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : at91SAM7X256_FLASH.xcl +-// Object : Generic Linker Command File for IAR +-// 1.0 30/Aug/05 FBr : Creation for 4.30A +-// ---------------------------------------------------------------------------- +- +-//************************************************************************* +-// XLINK command file template for EWARM/ICCARM +-// +-// Usage: xlink -f lnkarm +-// -s +-//************************************************************************* +-// +-// ------------- +-// Code segments - may be placed anywhere in memory. +-// ------------- +-// +-// INTVEC -- Exception vector table. +-// SWITAB -- Software interrupt vector table. +-// ICODE -- Startup (cstartup) and exception code. +-// DIFUNCT -- Dynamic initialization vectors used by C++. +-// CODE -- Compiler generated code. +-// CODE_I -- Compiler generated code declared __ramfunc (executes in RAM) +-// CODE_ID -- Initializer for CODE_I (ROM). +-// +-// ------------- +-// Data segments - may be placed anywhere in memory. +-// ------------- +-// +-// CSTACK -- The stack used by C/C++ programs (system and user mode). +-// IRQ_STACK -- The stack used by IRQ service routines. +-// SVC_STACK -- The stack used in supervisor mode +-// (Define other exception stacks as needed for +-// FIQ, ABT, UND). +-// HEAP -- The heap used by malloc and free in C and new and +-// delete in C++. +-// INITTAB -- Table containing addresses and sizes of segments that +-// need to be initialized at startup (by cstartup). +-// CHECKSUM -- The linker places checksum byte(s) in this segment, +-// when the -J linker command line option is used. +-// DATA_y -- Data objects. +-// +-// Where _y can be one of: +-// +-// _AN -- Holds uninitialized located objects, i.e. objects with +-// an absolute location given by the @ operator or the +-// #pragma location directive. Since these segments +-// contain objects which already have a fixed address, +-// they should not be mentioned in this linker command +-// file. +-// _C -- Constants (ROM). +-// _I -- Initialized data (RAM). +-// _ID -- The original content of _I (copied to _I by cstartup) (ROM). +-// _N -- Uninitialized data (RAM). +-// _Z -- Zero initialized data (RAM). +-// +-// Note: Be sure to use end values for the defined address ranges. +-// Otherwise, the linker may allocate space outside the +-// intended memory range. +-//************************************************************************* +- +-//************************************************************************* +-// Inform the linker about the CPU family used. +-// AT91SAM7X256 Memory mapping +-// No remap +-// ROMSTART +-// Start address 0x0000 0000 +-// Size 256 Kbo 0x0004 0000 +-// RAMSTART +-// Start address 0x0020 0000 +-// Size 64 Kbo 0x0001 0000 +-// Remap done +-// RAMSTART +-// Start address 0x0000 0000 +-// Size 64 Kbo 0x0001 0000 +-// ROMSTART +-// Start address 0x0010 0000 +-// Size 256 Kbo 0x0004 0000 +- +-//************************************************************************* +--carm +- +-//************************************************************************* +-// Internal Ram segments mapped AFTER REMAP 64 K. +-//************************************************************************* +--Z(CONST)INTRAMSTART_REMAP=00200000 +--Z(CONST)INTRAMEND_REMAP=0020FFFF +- +-//************************************************************************* +-// Read-only segments mapped to Flash 256 K. +-//************************************************************************* +--DROMSTART=00000000 +--DROMEND=0003FFFF +-//************************************************************************* +-// Read/write segments mapped to 64 K RAM. +-//************************************************************************* +--DRAMSTART=00200000 +--DRAMEND=0020FFFF +- +-//************************************************************************* +-// Address range for reset and exception +-// vectors (INTVEC). +-// The vector area is 32 bytes, +-// an additional 32 bytes is allocated for the +-// constant table used by ldr PC in cstartup.s79. +-//************************************************************************* +--Z(CODE)INTVEC=00-3F +- +-//************************************************************************* +-// Startup code and exception routines (ICODE). +-//************************************************************************* +--Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND +--Z(CODE)SWITAB=ROMSTART-ROMEND +- +-//************************************************************************* +-// Code segments may be placed anywhere. +-//************************************************************************* +--Z(CODE)CODE=ROMSTART-ROMEND +- +-//************************************************************************* +-// Various constants and initializers. +-//************************************************************************* +--Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND +--Z(CONST)CHECKSUM=ROMSTART-ROMEND +- +-//************************************************************************* +-// Data segments. +-//************************************************************************* +--Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND +- +-//************************************************************************* +-// __ramfunc code copied to and executed from RAM. +-//************************************************************************* +--Z(DATA)CODE_I=RAMSTART-RAMEND +--Z(CONST)CODE_ID=ROMSTART-ROMEND // Initializer for +--QCODE_I=CODE_ID +- +-//************************************************************************* +-// ICCARM produces code for __ramfunc functions in +-// CODE_I segments. The -Q XLINK command line +-// option redirects XLINK to emit the code in the +-// debug information associated with the CODE_I +-// segment, where the code will execute. +-//************************************************************************* +- +-//************************************************************************* +-// Stack and heap segments. +-//************************************************************************* +--D_CSTACK_SIZE=(100*4) +--D_IRQ_STACK_SIZE=(3*8*4) +--D_HEAP_SIZE=(1024*1) +- +--Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND +--Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE=RAMSTART-RAMEND +--Z(DATA)HEAP+_HEAP_SIZE=RAMSTART-RAMEND +- +-//************************************************************************* +-// ELF/DWARF support. +-// +-// Uncomment the line "-Felf" below to generate ELF/DWARF output. +-// Available format specifiers are: +-// +-// "-yn": Suppress DWARF debug output +-// "-yp": Multiple ELF program sections +-// "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag) +-// +-// "-Felf" and the format specifiers can also be supplied directly as +-// command line options, or selected from the Xlink Output tab in the +-// IAR Embedded Workbench. +-//************************************************************************* +- +-// -Felf +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_RAM.xcl b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_RAM.xcl +deleted file mode 100644 +index adcec108e2..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/at91SAM7X256_RAM.xcl ++++ /dev/null +@@ -1,185 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : at91SAM7X256_RAM.xcl +-// Object : Generic Linker Command File for IAR +-// 1.0 30/Aug/05 FBr : Creation for 4.30A +-// ---------------------------------------------------------------------------- +- +-//************************************************************************* +-// XLINK command file template for EWARM/ICCARM +-// +-// Usage: xlink -f lnkarm +-// -s +-//************************************************************************* +-// +-// ------------- +-// Code segments - may be placed anywhere in memory. +-// ------------- +-// +-// INTVEC -- Exception vector table. +-// SWITAB -- Software interrupt vector table. +-// ICODE -- Startup (cstartup) and exception code. +-// DIFUNCT -- Dynamic initialization vectors used by C++. +-// CODE -- Compiler generated code. +-// CODE_I -- Compiler generated code declared __ramfunc (executes in RAM) +-// CODE_ID -- Initializer for CODE_I (ROM). +-// +-// ------------- +-// Data segments - may be placed anywhere in memory. +-// ------------- +-// +-// CSTACK -- The stack used by C/C++ programs (system and user mode). +-// IRQ_STACK -- The stack used by IRQ service routines. +-// SVC_STACK -- The stack used in supervisor mode +-// (Define other exception stacks as needed for +-// FIQ, ABT, UND). +-// HEAP -- The heap used by malloc and free in C and new and +-// delete in C++. +-// INITTAB -- Table containing addresses and sizes of segments that +-// need to be initialized at startup (by cstartup). +-// CHECKSUM -- The linker places checksum byte(s) in this segment, +-// when the -J linker command line option is used. +-// DATA_y -- Data objects. +-// +-// Where _y can be one of: +-// +-// _AN -- Holds uninitialized located objects, i.e. objects with +-// an absolute location given by the @ operator or the +-// #pragma location directive. Since these segments +-// contain objects which already have a fixed address, +-// they should not be mentioned in this linker command +-// file. +-// _C -- Constants (ROM). +-// _I -- Initialized data (RAM). +-// _ID -- The original content of _I (copied to _I by cstartup) (ROM). +-// _N -- Uninitialized data (RAM). +-// _Z -- Zero initialized data (RAM). +-// +-// Note: Be sure to use end values for the defined address ranges. +-// Otherwise, the linker may allocate space outside the +-// intended memory range. +-//************************************************************************* +- +-//************************************************************************* +-// Inform the linker about the CPU family used. +-// AT91SAM7X256 Memory mapping +-// No remap +-// ROMSTART +-// Start address 0x0000 0000 +-// Size 256 Kbo 0x0004 0000 +-// RAMSTART +-// Start address 0x0020 0000 +-// Size 64 Kbo 0x0001 0000 +-// Remap done +-// RAMSTART +-// Start address 0x0000 0000 +-// Size 64 Kbo 0x0001 0000 +-// ROMSTART +-// Start address 0x0010 0000 +-// Size 256 Kbo 0x0004 0000 +- +-//************************************************************************* +--carm +- +-//************************************************************************* +-// Internal Ram segments mapped AFTER REMAP 64 K. +-//************************************************************************* +--Z(CONST)INTRAMSTART_REMAP=00000000 +--Z(CONST)INTRAMEND_REMAP=0000FFFF +- +-//************************************************************************* +-// Read-only segments mapped to Flash 256 K. +-//************************************************************************* +--DROMSTART=00000000 +--DROMEND=0003FFFF +-//************************************************************************* +-// Read/write segments mapped to 64 K RAM. +-//************************************************************************* +--DRAMSTART=00000000 +--DRAMEND=0000FFFF +- +-//************************************************************************* +-// Address range for reset and exception +-// vectors (INTVEC). +-// The vector area is 32 bytes, +-// an additional 32 bytes is allocated for the +-// constant table used by ldr PC in cstartup.s79. +-//************************************************************************* +--Z(CODE)INTVEC=00-3F +- +-//************************************************************************* +-// Startup code and exception routines (ICODE). +-//************************************************************************* +--Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND +--Z(CODE)SWITAB=ROMSTART-ROMEND +- +-//************************************************************************* +-// Code segments may be placed anywhere. +-//************************************************************************* +--Z(CODE)CODE=ROMSTART-ROMEND +- +-//************************************************************************* +-// Various constants and initializers. +-//************************************************************************* +--Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND +--Z(CONST)CHECKSUM=ROMSTART-ROMEND +- +-//************************************************************************* +-// Data segments. +-//************************************************************************* +--Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND +- +-//************************************************************************* +-// __ramfunc code copied to and executed from RAM. +-//************************************************************************* +--Z(DATA)CODE_I=RAMSTART-RAMEND +--Z(CONST)CODE_ID=ROMSTART-ROMEND // Initializer for +--QCODE_I=CODE_ID +- +-//************************************************************************* +-// ICCARM produces code for __ramfunc functions in +-// CODE_I segments. The -Q XLINK command line +-// option redirects XLINK to emit the code in the +-// debug information associated with the CODE_I +-// segment, where the code will execute. +-//************************************************************************* +- +-//************************************************************************* +-// Stack and heap segments. +-//************************************************************************* +--D_CSTACK_SIZE=(100*4) +--D_IRQ_STACK_SIZE=(3*8*4) +--D_HEAP_SIZE=(1024*2) +- +--Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND +--Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE=RAMSTART-RAMEND +--Z(DATA)HEAP+_HEAP_SIZE=RAMSTART-RAMEND +- +-//************************************************************************* +-// ELF/DWARF support. +-// +-// Uncomment the line "-Felf" below to generate ELF/DWARF output. +-// Available format specifiers are: +-// +-// "-yn": Suppress DWARF debug output +-// "-yp": Multiple ELF program sections +-// "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag) +-// +-// "-Felf" and the format specifiers can also be supplied directly as +-// command line options, or selected from the Xlink Output tab in the +-// IAR Embedded Workbench. +-//************************************************************************* +- +-// -Felf +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/ioat91sam7x256.ddf b/components/testframework/libs/cmock/test/iar/iar_v4/Resource/ioat91sam7x256.ddf +deleted file mode 100644 +index c9fcf323f2..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/Resource/ioat91sam7x256.ddf ++++ /dev/null +@@ -1,2259 +0,0 @@ +-; ---------------------------------------------------------------------------- +-; ATMEL Microcontroller Software Support - ROUSSET - +-; ---------------------------------------------------------------------------- +-; DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-; DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.ddf +-; Object : AT91SAM7X256 definitions +-; Generated : AT91 SW Application Group 11/02/2005 (15:17:30) +-; +-; CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// +-; CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// +-; CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// +-; CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// +-; CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// +-; CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// +-; CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// +-; CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// +-; CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// +-; CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// +-; CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// +-; CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// +-; CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// +-; CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// +-; CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// +-; CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// +-; CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// +-; CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// +-; CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// +-; CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// +-; CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// +-; CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// +-; CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// +-; ---------------------------------------------------------------------------- +- +-[Sfr] +- +-; ========== Register definition for SYS peripheral ========== +-; ========== Register definition for AIC peripheral ========== +-sfr = "AIC_SMR", "Memory", 0xfffff000, 4, base=16 +-sfr = "AIC_SMR.PRIOR", "Memory", 0xfffff000, 4, base=16, bitRange=0-2 +-sfr = "AIC_SMR.SRCTYPE", "Memory", 0xfffff000, 4, base=16, bitRange=5-6 +-sfr = "AIC_SVR", "Memory", 0xfffff080, 4, base=16 +-sfr = "AIC_IVR", "Memory", 0xfffff100, 4, base=16 +-sfr = "AIC_FVR", "Memory", 0xfffff104, 4, base=16 +-sfr = "AIC_ISR", "Memory", 0xfffff108, 4, base=16 +-sfr = "AIC_IPR", "Memory", 0xfffff10c, 4, base=16 +-sfr = "AIC_IMR", "Memory", 0xfffff110, 4, base=16 +-sfr = "AIC_CISR", "Memory", 0xfffff114, 4, base=16 +-sfr = "AIC_CISR.NFIQ", "Memory", 0xfffff114, 4, base=16, bitRange=0 +-sfr = "AIC_CISR.NIRQ", "Memory", 0xfffff114, 4, base=16, bitRange=1 +-sfr = "AIC_IECR", "Memory", 0xfffff120, 4, base=16 +-sfr = "AIC_IDCR", "Memory", 0xfffff124, 4, base=16 +-sfr = "AIC_ICCR", "Memory", 0xfffff128, 4, base=16 +-sfr = "AIC_ISCR", "Memory", 0xfffff12c, 4, base=16 +-sfr = "AIC_EOICR", "Memory", 0xfffff130, 4, base=16 +-sfr = "AIC_SPU", "Memory", 0xfffff134, 4, base=16 +-sfr = "AIC_DCR", "Memory", 0xfffff138, 4, base=16 +-sfr = "AIC_DCR.PROT", "Memory", 0xfffff138, 4, base=16, bitRange=0 +-sfr = "AIC_DCR.GMSK", "Memory", 0xfffff138, 4, base=16, bitRange=1 +-sfr = "AIC_FFER", "Memory", 0xfffff140, 4, base=16 +-sfr = "AIC_FFDR", "Memory", 0xfffff144, 4, base=16 +-sfr = "AIC_FFSR", "Memory", 0xfffff148, 4, base=16 +-; ========== Register definition for PDC_DBGU peripheral ========== +-sfr = "DBGU_RPR", "Memory", 0xfffff300, 4, base=16 +-sfr = "DBGU_RCR", "Memory", 0xfffff304, 4, base=16 +-sfr = "DBGU_TPR", "Memory", 0xfffff308, 4, base=16 +-sfr = "DBGU_TCR", "Memory", 0xfffff30c, 4, base=16 +-sfr = "DBGU_RNPR", "Memory", 0xfffff310, 4, base=16 +-sfr = "DBGU_RNCR", "Memory", 0xfffff314, 4, base=16 +-sfr = "DBGU_TNPR", "Memory", 0xfffff318, 4, base=16 +-sfr = "DBGU_TNCR", "Memory", 0xfffff31c, 4, base=16 +-sfr = "DBGU_PTCR", "Memory", 0xfffff320, 4, base=16 +-sfr = "DBGU_PTCR.RXTEN", "Memory", 0xfffff320, 4, base=16, bitRange=0 +-sfr = "DBGU_PTCR.RXTDIS", "Memory", 0xfffff320, 4, base=16, bitRange=1 +-sfr = "DBGU_PTCR.TXTEN", "Memory", 0xfffff320, 4, base=16, bitRange=8 +-sfr = "DBGU_PTCR.TXTDIS", "Memory", 0xfffff320, 4, base=16, bitRange=9 +-sfr = "DBGU_PTSR", "Memory", 0xfffff324, 4, base=16 +-sfr = "DBGU_PTSR.RXTEN", "Memory", 0xfffff324, 4, base=16, bitRange=0 +-sfr = "DBGU_PTSR.TXTEN", "Memory", 0xfffff324, 4, base=16, bitRange=8 +-; ========== Register definition for DBGU peripheral ========== +-sfr = "DBGU_CR", "Memory", 0xfffff200, 4, base=16 +-sfr = "DBGU_CR.RSTRX", "Memory", 0xfffff200, 4, base=16, bitRange=2 +-sfr = "DBGU_CR.RSTTX", "Memory", 0xfffff200, 4, base=16, bitRange=3 +-sfr = "DBGU_CR.RXEN", "Memory", 0xfffff200, 4, base=16, bitRange=4 +-sfr = "DBGU_CR.RXDIS", "Memory", 0xfffff200, 4, base=16, bitRange=5 +-sfr = "DBGU_CR.TXEN", "Memory", 0xfffff200, 4, base=16, bitRange=6 +-sfr = "DBGU_CR.TXDIS", "Memory", 0xfffff200, 4, base=16, bitRange=7 +-sfr = "DBGU_CR.RSTSTA", "Memory", 0xfffff200, 4, base=16, bitRange=8 +-sfr = "DBGU_MR", "Memory", 0xfffff204, 4, base=16 +-sfr = "DBGU_MR.PAR", "Memory", 0xfffff204, 4, base=16, bitRange=9-11 +-sfr = "DBGU_MR.CHMODE", "Memory", 0xfffff204, 4, base=16, bitRange=14-15 +-sfr = "DBGU_IER", "Memory", 0xfffff208, 4, base=16 +-sfr = "DBGU_IER.RXRDY", "Memory", 0xfffff208, 4, base=16, bitRange=0 +-sfr = "DBGU_IER.TXRDY", "Memory", 0xfffff208, 4, base=16, bitRange=1 +-sfr = "DBGU_IER.ENDRX", "Memory", 0xfffff208, 4, base=16, bitRange=3 +-sfr = "DBGU_IER.ENDTX", "Memory", 0xfffff208, 4, base=16, bitRange=4 +-sfr = "DBGU_IER.OVRE", "Memory", 0xfffff208, 4, base=16, bitRange=5 +-sfr = "DBGU_IER.FRAME", "Memory", 0xfffff208, 4, base=16, bitRange=6 +-sfr = "DBGU_IER.PARE", "Memory", 0xfffff208, 4, base=16, bitRange=7 +-sfr = "DBGU_IER.TXEMPTY", "Memory", 0xfffff208, 4, base=16, bitRange=9 +-sfr = "DBGU_IER.TXBUFE", "Memory", 0xfffff208, 4, base=16, bitRange=11 +-sfr = "DBGU_IER.RXBUFF", "Memory", 0xfffff208, 4, base=16, bitRange=12 +-sfr = "DBGU_IER.TX", "Memory", 0xfffff208, 4, base=16, bitRange=30 +-sfr = "DBGU_IER.RX", "Memory", 0xfffff208, 4, base=16, bitRange=31 +-sfr = "DBGU_IDR", "Memory", 0xfffff20c, 4, base=16 +-sfr = "DBGU_IDR.RXRDY", "Memory", 0xfffff20c, 4, base=16, bitRange=0 +-sfr = "DBGU_IDR.TXRDY", "Memory", 0xfffff20c, 4, base=16, bitRange=1 +-sfr = "DBGU_IDR.ENDRX", "Memory", 0xfffff20c, 4, base=16, bitRange=3 +-sfr = "DBGU_IDR.ENDTX", "Memory", 0xfffff20c, 4, base=16, bitRange=4 +-sfr = "DBGU_IDR.OVRE", "Memory", 0xfffff20c, 4, base=16, bitRange=5 +-sfr = "DBGU_IDR.FRAME", "Memory", 0xfffff20c, 4, base=16, bitRange=6 +-sfr = "DBGU_IDR.PARE", "Memory", 0xfffff20c, 4, base=16, bitRange=7 +-sfr = "DBGU_IDR.TXEMPTY", "Memory", 0xfffff20c, 4, base=16, bitRange=9 +-sfr = "DBGU_IDR.TXBUFE", "Memory", 0xfffff20c, 4, base=16, bitRange=11 +-sfr = "DBGU_IDR.RXBUFF", "Memory", 0xfffff20c, 4, base=16, bitRange=12 +-sfr = "DBGU_IDR.TX", "Memory", 0xfffff20c, 4, base=16, bitRange=30 +-sfr = "DBGU_IDR.RX", "Memory", 0xfffff20c, 4, base=16, bitRange=31 +-sfr = "DBGU_IMR", "Memory", 0xfffff210, 4, base=16 +-sfr = "DBGU_IMR.RXRDY", "Memory", 0xfffff210, 4, base=16, bitRange=0 +-sfr = "DBGU_IMR.TXRDY", "Memory", 0xfffff210, 4, base=16, bitRange=1 +-sfr = "DBGU_IMR.ENDRX", "Memory", 0xfffff210, 4, base=16, bitRange=3 +-sfr = "DBGU_IMR.ENDTX", "Memory", 0xfffff210, 4, base=16, bitRange=4 +-sfr = "DBGU_IMR.OVRE", "Memory", 0xfffff210, 4, base=16, bitRange=5 +-sfr = "DBGU_IMR.FRAME", "Memory", 0xfffff210, 4, base=16, bitRange=6 +-sfr = "DBGU_IMR.PARE", "Memory", 0xfffff210, 4, base=16, bitRange=7 +-sfr = "DBGU_IMR.TXEMPTY", "Memory", 0xfffff210, 4, base=16, bitRange=9 +-sfr = "DBGU_IMR.TXBUFE", "Memory", 0xfffff210, 4, base=16, bitRange=11 +-sfr = "DBGU_IMR.RXBUFF", "Memory", 0xfffff210, 4, base=16, bitRange=12 +-sfr = "DBGU_IMR.TX", "Memory", 0xfffff210, 4, base=16, bitRange=30 +-sfr = "DBGU_IMR.RX", "Memory", 0xfffff210, 4, base=16, bitRange=31 +-sfr = "DBGU_CSR", "Memory", 0xfffff214, 4, base=16 +-sfr = "DBGU_CSR.RXRDY", "Memory", 0xfffff214, 4, base=16, bitRange=0 +-sfr = "DBGU_CSR.TXRDY", "Memory", 0xfffff214, 4, base=16, bitRange=1 +-sfr = "DBGU_CSR.ENDRX", "Memory", 0xfffff214, 4, base=16, bitRange=3 +-sfr = "DBGU_CSR.ENDTX", "Memory", 0xfffff214, 4, base=16, bitRange=4 +-sfr = "DBGU_CSR.OVRE", "Memory", 0xfffff214, 4, base=16, bitRange=5 +-sfr = "DBGU_CSR.FRAME", "Memory", 0xfffff214, 4, base=16, bitRange=6 +-sfr = "DBGU_CSR.PARE", "Memory", 0xfffff214, 4, base=16, bitRange=7 +-sfr = "DBGU_CSR.TXEMPTY", "Memory", 0xfffff214, 4, base=16, bitRange=9 +-sfr = "DBGU_CSR.TXBUFE", "Memory", 0xfffff214, 4, base=16, bitRange=11 +-sfr = "DBGU_CSR.RXBUFF", "Memory", 0xfffff214, 4, base=16, bitRange=12 +-sfr = "DBGU_CSR.TX", "Memory", 0xfffff214, 4, base=16, bitRange=30 +-sfr = "DBGU_CSR.RX", "Memory", 0xfffff214, 4, base=16, bitRange=31 +-sfr = "DBGU_RHR", "Memory", 0xfffff218, 4, base=16 +-sfr = "DBGU_THR", "Memory", 0xfffff21c, 4, base=16 +-sfr = "DBGU_BRGR", "Memory", 0xfffff220, 4, base=16 +-sfr = "DBGU_CIDR", "Memory", 0xfffff240, 4, base=16 +-sfr = "DBGU_EXID", "Memory", 0xfffff244, 4, base=16 +-sfr = "DBGU_FNTR", "Memory", 0xfffff248, 4, base=16 +-sfr = "DBGU_FNTR.NTRST", "Memory", 0xfffff248, 4, base=16, bitRange=0 +-; ========== Register definition for PIOA peripheral ========== +-sfr = "PIOA_PER", "Memory", 0xfffff400, 4, base=16 +-sfr = "PIOA_PDR", "Memory", 0xfffff404, 4, base=16 +-sfr = "PIOA_PSR", "Memory", 0xfffff408, 4, base=16 +-sfr = "PIOA_OER", "Memory", 0xfffff410, 4, base=16 +-sfr = "PIOA_ODR", "Memory", 0xfffff414, 4, base=16 +-sfr = "PIOA_OSR", "Memory", 0xfffff418, 4, base=16 +-sfr = "PIOA_IFER", "Memory", 0xfffff420, 4, base=16 +-sfr = "PIOA_IFDR", "Memory", 0xfffff424, 4, base=16 +-sfr = "PIOA_IFSR", "Memory", 0xfffff428, 4, base=16 +-sfr = "PIOA_SODR", "Memory", 0xfffff430, 4, base=16 +-sfr = "PIOA_CODR", "Memory", 0xfffff434, 4, base=16 +-sfr = "PIOA_ODSR", "Memory", 0xfffff438, 4, base=16 +-sfr = "PIOA_PDSR", "Memory", 0xfffff43c, 4, base=16 +-sfr = "PIOA_IER", "Memory", 0xfffff440, 4, base=16 +-sfr = "PIOA_IDR", "Memory", 0xfffff444, 4, base=16 +-sfr = "PIOA_IMR", "Memory", 0xfffff448, 4, base=16 +-sfr = "PIOA_ISR", "Memory", 0xfffff44c, 4, base=16 +-sfr = "PIOA_MDER", "Memory", 0xfffff450, 4, base=16 +-sfr = "PIOA_MDDR", "Memory", 0xfffff454, 4, base=16 +-sfr = "PIOA_MDSR", "Memory", 0xfffff458, 4, base=16 +-sfr = "PIOA_PPUDR", "Memory", 0xfffff460, 4, base=16 +-sfr = "PIOA_PPUER", "Memory", 0xfffff464, 4, base=16 +-sfr = "PIOA_PPUSR", "Memory", 0xfffff468, 4, base=16 +-sfr = "PIOA_ASR", "Memory", 0xfffff470, 4, base=16 +-sfr = "PIOA_BSR", "Memory", 0xfffff474, 4, base=16 +-sfr = "PIOA_ABSR", "Memory", 0xfffff478, 4, base=16 +-sfr = "PIOA_OWER", "Memory", 0xfffff4a0, 4, base=16 +-sfr = "PIOA_OWDR", "Memory", 0xfffff4a4, 4, base=16 +-sfr = "PIOA_OWSR", "Memory", 0xfffff4a8, 4, base=16 +-; ========== Register definition for PIOB peripheral ========== +-sfr = "PIOB_PER", "Memory", 0xfffff600, 4, base=16 +-sfr = "PIOB_PDR", "Memory", 0xfffff604, 4, base=16 +-sfr = "PIOB_PSR", "Memory", 0xfffff608, 4, base=16 +-sfr = "PIOB_OER", "Memory", 0xfffff610, 4, base=16 +-sfr = "PIOB_ODR", "Memory", 0xfffff614, 4, base=16 +-sfr = "PIOB_OSR", "Memory", 0xfffff618, 4, base=16 +-sfr = "PIOB_IFER", "Memory", 0xfffff620, 4, base=16 +-sfr = "PIOB_IFDR", "Memory", 0xfffff624, 4, base=16 +-sfr = "PIOB_IFSR", "Memory", 0xfffff628, 4, base=16 +-sfr = "PIOB_SODR", "Memory", 0xfffff630, 4, base=16 +-sfr = "PIOB_CODR", "Memory", 0xfffff634, 4, base=16 +-sfr = "PIOB_ODSR", "Memory", 0xfffff638, 4, base=16 +-sfr = "PIOB_PDSR", "Memory", 0xfffff63c, 4, base=16 +-sfr = "PIOB_IER", "Memory", 0xfffff640, 4, base=16 +-sfr = "PIOB_IDR", "Memory", 0xfffff644, 4, base=16 +-sfr = "PIOB_IMR", "Memory", 0xfffff648, 4, base=16 +-sfr = "PIOB_ISR", "Memory", 0xfffff64c, 4, base=16 +-sfr = "PIOB_MDER", "Memory", 0xfffff650, 4, base=16 +-sfr = "PIOB_MDDR", "Memory", 0xfffff654, 4, base=16 +-sfr = "PIOB_MDSR", "Memory", 0xfffff658, 4, base=16 +-sfr = "PIOB_PPUDR", "Memory", 0xfffff660, 4, base=16 +-sfr = "PIOB_PPUER", "Memory", 0xfffff664, 4, base=16 +-sfr = "PIOB_PPUSR", "Memory", 0xfffff668, 4, base=16 +-sfr = "PIOB_ASR", "Memory", 0xfffff670, 4, base=16 +-sfr = "PIOB_BSR", "Memory", 0xfffff674, 4, base=16 +-sfr = "PIOB_ABSR", "Memory", 0xfffff678, 4, base=16 +-sfr = "PIOB_OWER", "Memory", 0xfffff6a0, 4, base=16 +-sfr = "PIOB_OWDR", "Memory", 0xfffff6a4, 4, base=16 +-sfr = "PIOB_OWSR", "Memory", 0xfffff6a8, 4, base=16 +-; ========== Register definition for CKGR peripheral ========== +-sfr = "CKGR_MOR", "Memory", 0xfffffc20, 4, base=16 +-sfr = "CKGR_MOR.MOSCEN", "Memory", 0xfffffc20, 4, base=16, bitRange=0 +-sfr = "CKGR_MOR.OSCBYPASS", "Memory", 0xfffffc20, 4, base=16, bitRange=1 +-sfr = "CKGR_MOR.OSCOUNT", "Memory", 0xfffffc20, 4, base=16, bitRange=8-15 +-sfr = "CKGR_MCFR", "Memory", 0xfffffc24, 4, base=16 +-sfr = "CKGR_MCFR.MAINF", "Memory", 0xfffffc24, 4, base=16, bitRange=0-15 +-sfr = "CKGR_MCFR.MAINRDY", "Memory", 0xfffffc24, 4, base=16, bitRange=16 +-sfr = "CKGR_PLLR", "Memory", 0xfffffc2c, 4, base=16 +-sfr = "CKGR_PLLR.DIV", "Memory", 0xfffffc2c, 4, base=16, bitRange=0-7 +-sfr = "CKGR_PLLR.PLLCOUNT", "Memory", 0xfffffc2c, 4, base=16, bitRange=8-13 +-sfr = "CKGR_PLLR.OUT", "Memory", 0xfffffc2c, 4, base=16, bitRange=14-15 +-sfr = "CKGR_PLLR.MUL", "Memory", 0xfffffc2c, 4, base=16, bitRange=16-26 +-sfr = "CKGR_PLLR.USBDIV", "Memory", 0xfffffc2c, 4, base=16, bitRange=28-29 +-; ========== Register definition for PMC peripheral ========== +-sfr = "PMC_SCER", "Memory", 0xfffffc00, 4, base=16 +-sfr = "PMC_SCER.PCK", "Memory", 0xfffffc00, 4, base=16, bitRange=0 +-sfr = "PMC_SCER.UDP", "Memory", 0xfffffc00, 4, base=16, bitRange=7 +-sfr = "PMC_SCER.PCK0", "Memory", 0xfffffc00, 4, base=16, bitRange=8 +-sfr = "PMC_SCER.PCK1", "Memory", 0xfffffc00, 4, base=16, bitRange=9 +-sfr = "PMC_SCER.PCK2", "Memory", 0xfffffc00, 4, base=16, bitRange=10 +-sfr = "PMC_SCER.PCK3", "Memory", 0xfffffc00, 4, base=16, bitRange=11 +-sfr = "PMC_SCDR", "Memory", 0xfffffc04, 4, base=16 +-sfr = "PMC_SCDR.PCK", "Memory", 0xfffffc04, 4, base=16, bitRange=0 +-sfr = "PMC_SCDR.UDP", "Memory", 0xfffffc04, 4, base=16, bitRange=7 +-sfr = "PMC_SCDR.PCK0", "Memory", 0xfffffc04, 4, base=16, bitRange=8 +-sfr = "PMC_SCDR.PCK1", "Memory", 0xfffffc04, 4, base=16, bitRange=9 +-sfr = "PMC_SCDR.PCK2", "Memory", 0xfffffc04, 4, base=16, bitRange=10 +-sfr = "PMC_SCDR.PCK3", "Memory", 0xfffffc04, 4, base=16, bitRange=11 +-sfr = "PMC_SCSR", "Memory", 0xfffffc08, 4, base=16 +-sfr = "PMC_SCSR.PCK", "Memory", 0xfffffc08, 4, base=16, bitRange=0 +-sfr = "PMC_SCSR.UDP", "Memory", 0xfffffc08, 4, base=16, bitRange=7 +-sfr = "PMC_SCSR.PCK0", "Memory", 0xfffffc08, 4, base=16, bitRange=8 +-sfr = "PMC_SCSR.PCK1", "Memory", 0xfffffc08, 4, base=16, bitRange=9 +-sfr = "PMC_SCSR.PCK2", "Memory", 0xfffffc08, 4, base=16, bitRange=10 +-sfr = "PMC_SCSR.PCK3", "Memory", 0xfffffc08, 4, base=16, bitRange=11 +-sfr = "PMC_PCER", "Memory", 0xfffffc10, 4, base=16 +-sfr = "PMC_PCDR", "Memory", 0xfffffc14, 4, base=16 +-sfr = "PMC_PCSR", "Memory", 0xfffffc18, 4, base=16 +-sfr = "PMC_MOR", "Memory", 0xfffffc20, 4, base=16 +-sfr = "PMC_MOR.MOSCEN", "Memory", 0xfffffc20, 4, base=16, bitRange=0 +-sfr = "PMC_MOR.OSCBYPASS", "Memory", 0xfffffc20, 4, base=16, bitRange=1 +-sfr = "PMC_MOR.OSCOUNT", "Memory", 0xfffffc20, 4, base=16, bitRange=8-15 +-sfr = "PMC_MCFR", "Memory", 0xfffffc24, 4, base=16 +-sfr = "PMC_MCFR.MAINF", "Memory", 0xfffffc24, 4, base=16, bitRange=0-15 +-sfr = "PMC_MCFR.MAINRDY", "Memory", 0xfffffc24, 4, base=16, bitRange=16 +-sfr = "PMC_PLLR", "Memory", 0xfffffc2c, 4, base=16 +-sfr = "PMC_PLLR.DIV", "Memory", 0xfffffc2c, 4, base=16, bitRange=0-7 +-sfr = "PMC_PLLR.PLLCOUNT", "Memory", 0xfffffc2c, 4, base=16, bitRange=8-13 +-sfr = "PMC_PLLR.OUT", "Memory", 0xfffffc2c, 4, base=16, bitRange=14-15 +-sfr = "PMC_PLLR.MUL", "Memory", 0xfffffc2c, 4, base=16, bitRange=16-26 +-sfr = "PMC_PLLR.USBDIV", "Memory", 0xfffffc2c, 4, base=16, bitRange=28-29 +-sfr = "PMC_MCKR", "Memory", 0xfffffc30, 4, base=16 +-sfr = "PMC_MCKR.CSS", "Memory", 0xfffffc30, 4, base=16, bitRange=0-1 +-sfr = "PMC_MCKR.PRES", "Memory", 0xfffffc30, 4, base=16, bitRange=2-4 +-sfr = "PMC_PCKR", "Memory", 0xfffffc40, 4, base=16 +-sfr = "PMC_PCKR.CSS", "Memory", 0xfffffc40, 4, base=16, bitRange=0-1 +-sfr = "PMC_PCKR.PRES", "Memory", 0xfffffc40, 4, base=16, bitRange=2-4 +-sfr = "PMC_IER", "Memory", 0xfffffc60, 4, base=16 +-sfr = "PMC_IER.MOSCS", "Memory", 0xfffffc60, 4, base=16, bitRange=0 +-sfr = "PMC_IER.LOCK", "Memory", 0xfffffc60, 4, base=16, bitRange=2 +-sfr = "PMC_IER.MCKRDY", "Memory", 0xfffffc60, 4, base=16, bitRange=3 +-sfr = "PMC_IER.PCK0RDY", "Memory", 0xfffffc60, 4, base=16, bitRange=8 +-sfr = "PMC_IER.PCK1RDY", "Memory", 0xfffffc60, 4, base=16, bitRange=9 +-sfr = "PMC_IER.PCK2RDY", "Memory", 0xfffffc60, 4, base=16, bitRange=10 +-sfr = "PMC_IER.PCK3RDY", "Memory", 0xfffffc60, 4, base=16, bitRange=11 +-sfr = "PMC_IDR", "Memory", 0xfffffc64, 4, base=16 +-sfr = "PMC_IDR.MOSCS", "Memory", 0xfffffc64, 4, base=16, bitRange=0 +-sfr = "PMC_IDR.LOCK", "Memory", 0xfffffc64, 4, base=16, bitRange=2 +-sfr = "PMC_IDR.MCKRDY", "Memory", 0xfffffc64, 4, base=16, bitRange=3 +-sfr = "PMC_IDR.PCK0RDY", "Memory", 0xfffffc64, 4, base=16, bitRange=8 +-sfr = "PMC_IDR.PCK1RDY", "Memory", 0xfffffc64, 4, base=16, bitRange=9 +-sfr = "PMC_IDR.PCK2RDY", "Memory", 0xfffffc64, 4, base=16, bitRange=10 +-sfr = "PMC_IDR.PCK3RDY", "Memory", 0xfffffc64, 4, base=16, bitRange=11 +-sfr = "PMC_SR", "Memory", 0xfffffc68, 4, base=16 +-sfr = "PMC_SR.MOSCS", "Memory", 0xfffffc68, 4, base=16, bitRange=0 +-sfr = "PMC_SR.LOCK", "Memory", 0xfffffc68, 4, base=16, bitRange=2 +-sfr = "PMC_SR.MCKRDY", "Memory", 0xfffffc68, 4, base=16, bitRange=3 +-sfr = "PMC_SR.PCK0RDY", "Memory", 0xfffffc68, 4, base=16, bitRange=8 +-sfr = "PMC_SR.PCK1RDY", "Memory", 0xfffffc68, 4, base=16, bitRange=9 +-sfr = "PMC_SR.PCK2RDY", "Memory", 0xfffffc68, 4, base=16, bitRange=10 +-sfr = "PMC_SR.PCK3RDY", "Memory", 0xfffffc68, 4, base=16, bitRange=11 +-sfr = "PMC_IMR", "Memory", 0xfffffc6c, 4, base=16 +-sfr = "PMC_IMR.MOSCS", "Memory", 0xfffffc6c, 4, base=16, bitRange=0 +-sfr = "PMC_IMR.LOCK", "Memory", 0xfffffc6c, 4, base=16, bitRange=2 +-sfr = "PMC_IMR.MCKRDY", "Memory", 0xfffffc6c, 4, base=16, bitRange=3 +-sfr = "PMC_IMR.PCK0RDY", "Memory", 0xfffffc6c, 4, base=16, bitRange=8 +-sfr = "PMC_IMR.PCK1RDY", "Memory", 0xfffffc6c, 4, base=16, bitRange=9 +-sfr = "PMC_IMR.PCK2RDY", "Memory", 0xfffffc6c, 4, base=16, bitRange=10 +-sfr = "PMC_IMR.PCK3RDY", "Memory", 0xfffffc6c, 4, base=16, bitRange=11 +-; ========== Register definition for RSTC peripheral ========== +-sfr = "RSTC_RCR", "Memory", 0xfffffd00, 4, base=16 +-sfr = "RSTC_RCR.PROCRST", "Memory", 0xfffffd00, 4, base=16, bitRange=0 +-sfr = "RSTC_RCR.PERRST", "Memory", 0xfffffd00, 4, base=16, bitRange=2 +-sfr = "RSTC_RCR.EXTRST", "Memory", 0xfffffd00, 4, base=16, bitRange=3 +-sfr = "RSTC_RCR.KEY", "Memory", 0xfffffd00, 4, base=16, bitRange=24-31 +-sfr = "RSTC_RSR", "Memory", 0xfffffd04, 4, base=16 +-sfr = "RSTC_RSR.URSTS", "Memory", 0xfffffd04, 4, base=16, bitRange=0 +-sfr = "RSTC_RSR.BODSTS", "Memory", 0xfffffd04, 4, base=16, bitRange=1 +-sfr = "RSTC_RSR.RSTTYP", "Memory", 0xfffffd04, 4, base=16, bitRange=8-10 +-sfr = "RSTC_RSR.NRSTL", "Memory", 0xfffffd04, 4, base=16, bitRange=16 +-sfr = "RSTC_RSR.SRCMP", "Memory", 0xfffffd04, 4, base=16, bitRange=17 +-sfr = "RSTC_RMR", "Memory", 0xfffffd08, 4, base=16 +-sfr = "RSTC_RMR.URSTEN", "Memory", 0xfffffd08, 4, base=16, bitRange=0 +-sfr = "RSTC_RMR.URSTIEN", "Memory", 0xfffffd08, 4, base=16, bitRange=4 +-sfr = "RSTC_RMR.ERSTL", "Memory", 0xfffffd08, 4, base=16, bitRange=8-11 +-sfr = "RSTC_RMR.BODIEN", "Memory", 0xfffffd08, 4, base=16, bitRange=16 +-sfr = "RSTC_RMR.KEY", "Memory", 0xfffffd08, 4, base=16, bitRange=24-31 +-; ========== Register definition for RTTC peripheral ========== +-sfr = "RTTC_RTMR", "Memory", 0xfffffd20, 4, base=16 +-sfr = "RTTC_RTMR.RTPRES", "Memory", 0xfffffd20, 4, base=16, bitRange=0-15 +-sfr = "RTTC_RTMR.ALMIEN", "Memory", 0xfffffd20, 4, base=16, bitRange=16 +-sfr = "RTTC_RTMR.RTTINCIEN", "Memory", 0xfffffd20, 4, base=16, bitRange=17 +-sfr = "RTTC_RTMR.RTTRST", "Memory", 0xfffffd20, 4, base=16, bitRange=18 +-sfr = "RTTC_RTAR", "Memory", 0xfffffd24, 4, base=16 +-sfr = "RTTC_RTAR.ALMV", "Memory", 0xfffffd24, 4, base=16, bitRange=0-31 +-sfr = "RTTC_RTVR", "Memory", 0xfffffd28, 4, base=16 +-sfr = "RTTC_RTVR.CRTV", "Memory", 0xfffffd28, 4, base=16, bitRange=0-31 +-sfr = "RTTC_RTSR", "Memory", 0xfffffd2c, 4, base=16 +-sfr = "RTTC_RTSR.ALMS", "Memory", 0xfffffd2c, 4, base=16, bitRange=0 +-sfr = "RTTC_RTSR.RTTINC", "Memory", 0xfffffd2c, 4, base=16, bitRange=1 +-; ========== Register definition for PITC peripheral ========== +-sfr = "PITC_PIMR", "Memory", 0xfffffd30, 4, base=16 +-sfr = "PITC_PIMR.PIV", "Memory", 0xfffffd30, 4, base=16, bitRange=0-19 +-sfr = "PITC_PIMR.PITEN", "Memory", 0xfffffd30, 4, base=16, bitRange=24 +-sfr = "PITC_PIMR.PITIEN", "Memory", 0xfffffd30, 4, base=16, bitRange=25 +-sfr = "PITC_PISR", "Memory", 0xfffffd34, 4, base=16 +-sfr = "PITC_PISR.PITS", "Memory", 0xfffffd34, 4, base=16, bitRange=0 +-sfr = "PITC_PIVR", "Memory", 0xfffffd38, 4, base=16 +-sfr = "PITC_PIVR.CPIV", "Memory", 0xfffffd38, 4, base=16, bitRange=0-19 +-sfr = "PITC_PIVR.PICNT", "Memory", 0xfffffd38, 4, base=16, bitRange=20-31 +-sfr = "PITC_PIIR", "Memory", 0xfffffd3c, 4, base=16 +-sfr = "PITC_PIIR.CPIV", "Memory", 0xfffffd3c, 4, base=16, bitRange=0-19 +-sfr = "PITC_PIIR.PICNT", "Memory", 0xfffffd3c, 4, base=16, bitRange=20-31 +-; ========== Register definition for WDTC peripheral ========== +-sfr = "WDTC_WDCR", "Memory", 0xfffffd40, 4, base=16 +-sfr = "WDTC_WDCR.WDRSTT", "Memory", 0xfffffd40, 4, base=16, bitRange=0 +-sfr = "WDTC_WDCR.KEY", "Memory", 0xfffffd40, 4, base=16, bitRange=24-31 +-sfr = "WDTC_WDMR", "Memory", 0xfffffd44, 4, base=16 +-sfr = "WDTC_WDMR.WDV", "Memory", 0xfffffd44, 4, base=16, bitRange=0-11 +-sfr = "WDTC_WDMR.WDFIEN", "Memory", 0xfffffd44, 4, base=16, bitRange=12 +-sfr = "WDTC_WDMR.WDRSTEN", "Memory", 0xfffffd44, 4, base=16, bitRange=13 +-sfr = "WDTC_WDMR.WDRPROC", "Memory", 0xfffffd44, 4, base=16, bitRange=14 +-sfr = "WDTC_WDMR.WDDIS", "Memory", 0xfffffd44, 4, base=16, bitRange=15 +-sfr = "WDTC_WDMR.WDD", "Memory", 0xfffffd44, 4, base=16, bitRange=16-27 +-sfr = "WDTC_WDMR.WDDBGHLT", "Memory", 0xfffffd44, 4, base=16, bitRange=28 +-sfr = "WDTC_WDMR.WDIDLEHLT", "Memory", 0xfffffd44, 4, base=16, bitRange=29 +-sfr = "WDTC_WDSR", "Memory", 0xfffffd48, 4, base=16 +-sfr = "WDTC_WDSR.WDUNF", "Memory", 0xfffffd48, 4, base=16, bitRange=0 +-sfr = "WDTC_WDSR.WDERR", "Memory", 0xfffffd48, 4, base=16, bitRange=1 +-; ========== Register definition for VREG peripheral ========== +-sfr = "VREG_MR", "Memory", 0xfffffd60, 4, base=16 +-sfr = "VREG_MR.PSTDBY", "Memory", 0xfffffd60, 4, base=16, bitRange=0 +-; ========== Register definition for MC peripheral ========== +-sfr = "MC_RCR", "Memory", 0xffffff00, 4, base=16 +-sfr = "MC_RCR.RCB", "Memory", 0xffffff00, 4, base=16, bitRange=0 +-sfr = "MC_ASR", "Memory", 0xffffff04, 4, base=16 +-sfr = "MC_ASR.UNDADD", "Memory", 0xffffff04, 4, base=16, bitRange=0 +-sfr = "MC_ASR.MISADD", "Memory", 0xffffff04, 4, base=16, bitRange=1 +-sfr = "MC_ASR.ABTSZ", "Memory", 0xffffff04, 4, base=16, bitRange=8-9 +-sfr = "MC_ASR.ABTTYP", "Memory", 0xffffff04, 4, base=16, bitRange=10-11 +-sfr = "MC_ASR.MST0", "Memory", 0xffffff04, 4, base=16, bitRange=16 +-sfr = "MC_ASR.MST1", "Memory", 0xffffff04, 4, base=16, bitRange=17 +-sfr = "MC_ASR.SVMST0", "Memory", 0xffffff04, 4, base=16, bitRange=24 +-sfr = "MC_ASR.SVMST1", "Memory", 0xffffff04, 4, base=16, bitRange=25 +-sfr = "MC_AASR", "Memory", 0xffffff08, 4, base=16 +-sfr = "MC_FMR", "Memory", 0xffffff60, 4, base=16 +-sfr = "MC_FMR.FRDY", "Memory", 0xffffff60, 4, base=16, bitRange=0 +-sfr = "MC_FMR.LOCKE", "Memory", 0xffffff60, 4, base=16, bitRange=2 +-sfr = "MC_FMR.PROGE", "Memory", 0xffffff60, 4, base=16, bitRange=3 +-sfr = "MC_FMR.NEBP", "Memory", 0xffffff60, 4, base=16, bitRange=7 +-sfr = "MC_FMR.FWS", "Memory", 0xffffff60, 4, base=16, bitRange=8-9 +-sfr = "MC_FMR.FMCN", "Memory", 0xffffff60, 4, base=16, bitRange=16-23 +-sfr = "MC_FCR", "Memory", 0xffffff64, 4, base=16 +-sfr = "MC_FCR.FCMD", "Memory", 0xffffff64, 4, base=16, bitRange=0-3 +-sfr = "MC_FCR.PAGEN", "Memory", 0xffffff64, 4, base=16, bitRange=8-17 +-sfr = "MC_FCR.KEY", "Memory", 0xffffff64, 4, base=16, bitRange=24-31 +-sfr = "MC_FSR", "Memory", 0xffffff68, 4, base=16 +-sfr = "MC_FSR.FRDY", "Memory", 0xffffff68, 4, base=16, bitRange=0 +-sfr = "MC_FSR.LOCKE", "Memory", 0xffffff68, 4, base=16, bitRange=2 +-sfr = "MC_FSR.PROGE", "Memory", 0xffffff68, 4, base=16, bitRange=3 +-sfr = "MC_FSR.SECURITY", "Memory", 0xffffff68, 4, base=16, bitRange=4 +-sfr = "MC_FSR.GPNVM0", "Memory", 0xffffff68, 4, base=16, bitRange=8 +-sfr = "MC_FSR.GPNVM1", "Memory", 0xffffff68, 4, base=16, bitRange=9 +-sfr = "MC_FSR.GPNVM2", "Memory", 0xffffff68, 4, base=16, bitRange=10 +-sfr = "MC_FSR.GPNVM3", "Memory", 0xffffff68, 4, base=16, bitRange=11 +-sfr = "MC_FSR.GPNVM4", "Memory", 0xffffff68, 4, base=16, bitRange=12 +-sfr = "MC_FSR.GPNVM5", "Memory", 0xffffff68, 4, base=16, bitRange=13 +-sfr = "MC_FSR.GPNVM6", "Memory", 0xffffff68, 4, base=16, bitRange=14 +-sfr = "MC_FSR.GPNVM7", "Memory", 0xffffff68, 4, base=16, bitRange=15 +-sfr = "MC_FSR.LOCKS0", "Memory", 0xffffff68, 4, base=16, bitRange=16 +-sfr = "MC_FSR.LOCKS1", "Memory", 0xffffff68, 4, base=16, bitRange=17 +-sfr = "MC_FSR.LOCKS2", "Memory", 0xffffff68, 4, base=16, bitRange=18 +-sfr = "MC_FSR.LOCKS3", "Memory", 0xffffff68, 4, base=16, bitRange=19 +-sfr = "MC_FSR.LOCKS4", "Memory", 0xffffff68, 4, base=16, bitRange=20 +-sfr = "MC_FSR.LOCKS5", "Memory", 0xffffff68, 4, base=16, bitRange=21 +-sfr = "MC_FSR.LOCKS6", "Memory", 0xffffff68, 4, base=16, bitRange=22 +-sfr = "MC_FSR.LOCKS7", "Memory", 0xffffff68, 4, base=16, bitRange=23 +-sfr = "MC_FSR.LOCKS8", "Memory", 0xffffff68, 4, base=16, bitRange=24 +-sfr = "MC_FSR.LOCKS9", "Memory", 0xffffff68, 4, base=16, bitRange=25 +-sfr = "MC_FSR.LOCKS10", "Memory", 0xffffff68, 4, base=16, bitRange=26 +-sfr = "MC_FSR.LOCKS11", "Memory", 0xffffff68, 4, base=16, bitRange=27 +-sfr = "MC_FSR.LOCKS12", "Memory", 0xffffff68, 4, base=16, bitRange=28 +-sfr = "MC_FSR.LOCKS13", "Memory", 0xffffff68, 4, base=16, bitRange=29 +-sfr = "MC_FSR.LOCKS14", "Memory", 0xffffff68, 4, base=16, bitRange=30 +-sfr = "MC_FSR.LOCKS15", "Memory", 0xffffff68, 4, base=16, bitRange=31 +-; ========== Register definition for PDC_SPI1 peripheral ========== +-sfr = "SPI1_RPR", "Memory", 0xfffe4100, 4, base=16 +-sfr = "SPI1_RCR", "Memory", 0xfffe4104, 4, base=16 +-sfr = "SPI1_TPR", "Memory", 0xfffe4108, 4, base=16 +-sfr = "SPI1_TCR", "Memory", 0xfffe410c, 4, base=16 +-sfr = "SPI1_RNPR", "Memory", 0xfffe4110, 4, base=16 +-sfr = "SPI1_RNCR", "Memory", 0xfffe4114, 4, base=16 +-sfr = "SPI1_TNPR", "Memory", 0xfffe4118, 4, base=16 +-sfr = "SPI1_TNCR", "Memory", 0xfffe411c, 4, base=16 +-sfr = "SPI1_PTCR", "Memory", 0xfffe4120, 4, base=16 +-sfr = "SPI1_PTCR.RXTEN", "Memory", 0xfffe4120, 4, base=16, bitRange=0 +-sfr = "SPI1_PTCR.RXTDIS", "Memory", 0xfffe4120, 4, base=16, bitRange=1 +-sfr = "SPI1_PTCR.TXTEN", "Memory", 0xfffe4120, 4, base=16, bitRange=8 +-sfr = "SPI1_PTCR.TXTDIS", "Memory", 0xfffe4120, 4, base=16, bitRange=9 +-sfr = "SPI1_PTSR", "Memory", 0xfffe4124, 4, base=16 +-sfr = "SPI1_PTSR.RXTEN", "Memory", 0xfffe4124, 4, base=16, bitRange=0 +-sfr = "SPI1_PTSR.TXTEN", "Memory", 0xfffe4124, 4, base=16, bitRange=8 +-; ========== Register definition for SPI1 peripheral ========== +-sfr = "SPI1_CR", "Memory", 0xfffe4000, 4, base=16 +-sfr = "SPI1_CR.SPIEN", "Memory", 0xfffe4000, 4, base=16, bitRange=0 +-sfr = "SPI1_CR.SPIDIS", "Memory", 0xfffe4000, 4, base=16, bitRange=1 +-sfr = "SPI1_CR.SWRST", "Memory", 0xfffe4000, 4, base=16, bitRange=7 +-sfr = "SPI1_CR.LASTXFER", "Memory", 0xfffe4000, 4, base=16, bitRange=24 +-sfr = "SPI1_MR", "Memory", 0xfffe4004, 4, base=16 +-sfr = "SPI1_MR.MSTR", "Memory", 0xfffe4004, 4, base=16, bitRange=0 +-sfr = "SPI1_MR.PS", "Memory", 0xfffe4004, 4, base=16, bitRange=1 +-sfr = "SPI1_MR.PCSDEC", "Memory", 0xfffe4004, 4, base=16, bitRange=2 +-sfr = "SPI1_MR.FDIV", "Memory", 0xfffe4004, 4, base=16, bitRange=3 +-sfr = "SPI1_MR.MODFDIS", "Memory", 0xfffe4004, 4, base=16, bitRange=4 +-sfr = "SPI1_MR.LLB", "Memory", 0xfffe4004, 4, base=16, bitRange=7 +-sfr = "SPI1_MR.PCS", "Memory", 0xfffe4004, 4, base=16, bitRange=16-19 +-sfr = "SPI1_MR.DLYBCS", "Memory", 0xfffe4004, 4, base=16, bitRange=24-31 +-sfr = "SPI1_RDR", "Memory", 0xfffe4008, 4, base=16 +-sfr = "SPI1_RDR.RD", "Memory", 0xfffe4008, 4, base=16, bitRange=0-15 +-sfr = "SPI1_RDR.RPCS", "Memory", 0xfffe4008, 4, base=16, bitRange=16-19 +-sfr = "SPI1_TDR", "Memory", 0xfffe400c, 4, base=16 +-sfr = "SPI1_TDR.TD", "Memory", 0xfffe400c, 4, base=16, bitRange=0-15 +-sfr = "SPI1_TDR.TPCS", "Memory", 0xfffe400c, 4, base=16, bitRange=16-19 +-sfr = "SPI1_TDR.LASTXFER", "Memory", 0xfffe400c, 4, base=16, bitRange=24 +-sfr = "SPI1_SR", "Memory", 0xfffe4010, 4, base=16 +-sfr = "SPI1_SR.RDRF", "Memory", 0xfffe4010, 4, base=16, bitRange=0 +-sfr = "SPI1_SR.TDRE", "Memory", 0xfffe4010, 4, base=16, bitRange=1 +-sfr = "SPI1_SR.MODF", "Memory", 0xfffe4010, 4, base=16, bitRange=2 +-sfr = "SPI1_SR.OVRES", "Memory", 0xfffe4010, 4, base=16, bitRange=3 +-sfr = "SPI1_SR.ENDRX", "Memory", 0xfffe4010, 4, base=16, bitRange=4 +-sfr = "SPI1_SR.ENDTX", "Memory", 0xfffe4010, 4, base=16, bitRange=5 +-sfr = "SPI1_SR.RXBUFF", "Memory", 0xfffe4010, 4, base=16, bitRange=6 +-sfr = "SPI1_SR.TXBUFE", "Memory", 0xfffe4010, 4, base=16, bitRange=7 +-sfr = "SPI1_SR.NSSR", "Memory", 0xfffe4010, 4, base=16, bitRange=8 +-sfr = "SPI1_SR.TXEMPTY", "Memory", 0xfffe4010, 4, base=16, bitRange=9 +-sfr = "SPI1_SR.SPIENS", "Memory", 0xfffe4010, 4, base=16, bitRange=16 +-sfr = "SPI1_IER", "Memory", 0xfffe4014, 4, base=16 +-sfr = "SPI1_IER.RDRF", "Memory", 0xfffe4014, 4, base=16, bitRange=0 +-sfr = "SPI1_IER.TDRE", "Memory", 0xfffe4014, 4, base=16, bitRange=1 +-sfr = "SPI1_IER.MODF", "Memory", 0xfffe4014, 4, base=16, bitRange=2 +-sfr = "SPI1_IER.OVRES", "Memory", 0xfffe4014, 4, base=16, bitRange=3 +-sfr = "SPI1_IER.ENDRX", "Memory", 0xfffe4014, 4, base=16, bitRange=4 +-sfr = "SPI1_IER.ENDTX", "Memory", 0xfffe4014, 4, base=16, bitRange=5 +-sfr = "SPI1_IER.RXBUFF", "Memory", 0xfffe4014, 4, base=16, bitRange=6 +-sfr = "SPI1_IER.TXBUFE", "Memory", 0xfffe4014, 4, base=16, bitRange=7 +-sfr = "SPI1_IER.NSSR", "Memory", 0xfffe4014, 4, base=16, bitRange=8 +-sfr = "SPI1_IER.TXEMPTY", "Memory", 0xfffe4014, 4, base=16, bitRange=9 +-sfr = "SPI1_IDR", "Memory", 0xfffe4018, 4, base=16 +-sfr = "SPI1_IDR.RDRF", "Memory", 0xfffe4018, 4, base=16, bitRange=0 +-sfr = "SPI1_IDR.TDRE", "Memory", 0xfffe4018, 4, base=16, bitRange=1 +-sfr = "SPI1_IDR.MODF", "Memory", 0xfffe4018, 4, base=16, bitRange=2 +-sfr = "SPI1_IDR.OVRES", "Memory", 0xfffe4018, 4, base=16, bitRange=3 +-sfr = "SPI1_IDR.ENDRX", "Memory", 0xfffe4018, 4, base=16, bitRange=4 +-sfr = "SPI1_IDR.ENDTX", "Memory", 0xfffe4018, 4, base=16, bitRange=5 +-sfr = "SPI1_IDR.RXBUFF", "Memory", 0xfffe4018, 4, base=16, bitRange=6 +-sfr = "SPI1_IDR.TXBUFE", "Memory", 0xfffe4018, 4, base=16, bitRange=7 +-sfr = "SPI1_IDR.NSSR", "Memory", 0xfffe4018, 4, base=16, bitRange=8 +-sfr = "SPI1_IDR.TXEMPTY", "Memory", 0xfffe4018, 4, base=16, bitRange=9 +-sfr = "SPI1_IMR", "Memory", 0xfffe401c, 4, base=16 +-sfr = "SPI1_IMR.RDRF", "Memory", 0xfffe401c, 4, base=16, bitRange=0 +-sfr = "SPI1_IMR.TDRE", "Memory", 0xfffe401c, 4, base=16, bitRange=1 +-sfr = "SPI1_IMR.MODF", "Memory", 0xfffe401c, 4, base=16, bitRange=2 +-sfr = "SPI1_IMR.OVRES", "Memory", 0xfffe401c, 4, base=16, bitRange=3 +-sfr = "SPI1_IMR.ENDRX", "Memory", 0xfffe401c, 4, base=16, bitRange=4 +-sfr = "SPI1_IMR.ENDTX", "Memory", 0xfffe401c, 4, base=16, bitRange=5 +-sfr = "SPI1_IMR.RXBUFF", "Memory", 0xfffe401c, 4, base=16, bitRange=6 +-sfr = "SPI1_IMR.TXBUFE", "Memory", 0xfffe401c, 4, base=16, bitRange=7 +-sfr = "SPI1_IMR.NSSR", "Memory", 0xfffe401c, 4, base=16, bitRange=8 +-sfr = "SPI1_IMR.TXEMPTY", "Memory", 0xfffe401c, 4, base=16, bitRange=9 +-sfr = "SPI1_CSR", "Memory", 0xfffe4030, 4, base=16 +-sfr = "SPI1_CSR.CPOL", "Memory", 0xfffe4030, 4, base=16, bitRange=0 +-sfr = "SPI1_CSR.NCPHA", "Memory", 0xfffe4030, 4, base=16, bitRange=1 +-sfr = "SPI1_CSR.CSAAT", "Memory", 0xfffe4030, 4, base=16, bitRange=3 +-sfr = "SPI1_CSR.BITS", "Memory", 0xfffe4030, 4, base=16, bitRange=4-7 +-sfr = "SPI1_CSR.SCBR", "Memory", 0xfffe4030, 4, base=16, bitRange=8-15 +-sfr = "SPI1_CSR.DLYBS", "Memory", 0xfffe4030, 4, base=16, bitRange=16-23 +-sfr = "SPI1_CSR.DLYBCT", "Memory", 0xfffe4030, 4, base=16, bitRange=24-31 +-; ========== Register definition for PDC_SPI0 peripheral ========== +-sfr = "SPI0_RPR", "Memory", 0xfffe0100, 4, base=16 +-sfr = "SPI0_RCR", "Memory", 0xfffe0104, 4, base=16 +-sfr = "SPI0_TPR", "Memory", 0xfffe0108, 4, base=16 +-sfr = "SPI0_TCR", "Memory", 0xfffe010c, 4, base=16 +-sfr = "SPI0_RNPR", "Memory", 0xfffe0110, 4, base=16 +-sfr = "SPI0_RNCR", "Memory", 0xfffe0114, 4, base=16 +-sfr = "SPI0_TNPR", "Memory", 0xfffe0118, 4, base=16 +-sfr = "SPI0_TNCR", "Memory", 0xfffe011c, 4, base=16 +-sfr = "SPI0_PTCR", "Memory", 0xfffe0120, 4, base=16 +-sfr = "SPI0_PTCR.RXTEN", "Memory", 0xfffe0120, 4, base=16, bitRange=0 +-sfr = "SPI0_PTCR.RXTDIS", "Memory", 0xfffe0120, 4, base=16, bitRange=1 +-sfr = "SPI0_PTCR.TXTEN", "Memory", 0xfffe0120, 4, base=16, bitRange=8 +-sfr = "SPI0_PTCR.TXTDIS", "Memory", 0xfffe0120, 4, base=16, bitRange=9 +-sfr = "SPI0_PTSR", "Memory", 0xfffe0124, 4, base=16 +-sfr = "SPI0_PTSR.RXTEN", "Memory", 0xfffe0124, 4, base=16, bitRange=0 +-sfr = "SPI0_PTSR.TXTEN", "Memory", 0xfffe0124, 4, base=16, bitRange=8 +-; ========== Register definition for SPI0 peripheral ========== +-sfr = "SPI0_CR", "Memory", 0xfffe0000, 4, base=16 +-sfr = "SPI0_CR.SPIEN", "Memory", 0xfffe0000, 4, base=16, bitRange=0 +-sfr = "SPI0_CR.SPIDIS", "Memory", 0xfffe0000, 4, base=16, bitRange=1 +-sfr = "SPI0_CR.SWRST", "Memory", 0xfffe0000, 4, base=16, bitRange=7 +-sfr = "SPI0_CR.LASTXFER", "Memory", 0xfffe0000, 4, base=16, bitRange=24 +-sfr = "SPI0_MR", "Memory", 0xfffe0004, 4, base=16 +-sfr = "SPI0_MR.MSTR", "Memory", 0xfffe0004, 4, base=16, bitRange=0 +-sfr = "SPI0_MR.PS", "Memory", 0xfffe0004, 4, base=16, bitRange=1 +-sfr = "SPI0_MR.PCSDEC", "Memory", 0xfffe0004, 4, base=16, bitRange=2 +-sfr = "SPI0_MR.FDIV", "Memory", 0xfffe0004, 4, base=16, bitRange=3 +-sfr = "SPI0_MR.MODFDIS", "Memory", 0xfffe0004, 4, base=16, bitRange=4 +-sfr = "SPI0_MR.LLB", "Memory", 0xfffe0004, 4, base=16, bitRange=7 +-sfr = "SPI0_MR.PCS", "Memory", 0xfffe0004, 4, base=16, bitRange=16-19 +-sfr = "SPI0_MR.DLYBCS", "Memory", 0xfffe0004, 4, base=16, bitRange=24-31 +-sfr = "SPI0_RDR", "Memory", 0xfffe0008, 4, base=16 +-sfr = "SPI0_RDR.RD", "Memory", 0xfffe0008, 4, base=16, bitRange=0-15 +-sfr = "SPI0_RDR.RPCS", "Memory", 0xfffe0008, 4, base=16, bitRange=16-19 +-sfr = "SPI0_TDR", "Memory", 0xfffe000c, 4, base=16 +-sfr = "SPI0_TDR.TD", "Memory", 0xfffe000c, 4, base=16, bitRange=0-15 +-sfr = "SPI0_TDR.TPCS", "Memory", 0xfffe000c, 4, base=16, bitRange=16-19 +-sfr = "SPI0_TDR.LASTXFER", "Memory", 0xfffe000c, 4, base=16, bitRange=24 +-sfr = "SPI0_SR", "Memory", 0xfffe0010, 4, base=16 +-sfr = "SPI0_SR.RDRF", "Memory", 0xfffe0010, 4, base=16, bitRange=0 +-sfr = "SPI0_SR.TDRE", "Memory", 0xfffe0010, 4, base=16, bitRange=1 +-sfr = "SPI0_SR.MODF", "Memory", 0xfffe0010, 4, base=16, bitRange=2 +-sfr = "SPI0_SR.OVRES", "Memory", 0xfffe0010, 4, base=16, bitRange=3 +-sfr = "SPI0_SR.ENDRX", "Memory", 0xfffe0010, 4, base=16, bitRange=4 +-sfr = "SPI0_SR.ENDTX", "Memory", 0xfffe0010, 4, base=16, bitRange=5 +-sfr = "SPI0_SR.RXBUFF", "Memory", 0xfffe0010, 4, base=16, bitRange=6 +-sfr = "SPI0_SR.TXBUFE", "Memory", 0xfffe0010, 4, base=16, bitRange=7 +-sfr = "SPI0_SR.NSSR", "Memory", 0xfffe0010, 4, base=16, bitRange=8 +-sfr = "SPI0_SR.TXEMPTY", "Memory", 0xfffe0010, 4, base=16, bitRange=9 +-sfr = "SPI0_SR.SPIENS", "Memory", 0xfffe0010, 4, base=16, bitRange=16 +-sfr = "SPI0_IER", "Memory", 0xfffe0014, 4, base=16 +-sfr = "SPI0_IER.RDRF", "Memory", 0xfffe0014, 4, base=16, bitRange=0 +-sfr = "SPI0_IER.TDRE", "Memory", 0xfffe0014, 4, base=16, bitRange=1 +-sfr = "SPI0_IER.MODF", "Memory", 0xfffe0014, 4, base=16, bitRange=2 +-sfr = "SPI0_IER.OVRES", "Memory", 0xfffe0014, 4, base=16, bitRange=3 +-sfr = "SPI0_IER.ENDRX", "Memory", 0xfffe0014, 4, base=16, bitRange=4 +-sfr = "SPI0_IER.ENDTX", "Memory", 0xfffe0014, 4, base=16, bitRange=5 +-sfr = "SPI0_IER.RXBUFF", "Memory", 0xfffe0014, 4, base=16, bitRange=6 +-sfr = "SPI0_IER.TXBUFE", "Memory", 0xfffe0014, 4, base=16, bitRange=7 +-sfr = "SPI0_IER.NSSR", "Memory", 0xfffe0014, 4, base=16, bitRange=8 +-sfr = "SPI0_IER.TXEMPTY", "Memory", 0xfffe0014, 4, base=16, bitRange=9 +-sfr = "SPI0_IDR", "Memory", 0xfffe0018, 4, base=16 +-sfr = "SPI0_IDR.RDRF", "Memory", 0xfffe0018, 4, base=16, bitRange=0 +-sfr = "SPI0_IDR.TDRE", "Memory", 0xfffe0018, 4, base=16, bitRange=1 +-sfr = "SPI0_IDR.MODF", "Memory", 0xfffe0018, 4, base=16, bitRange=2 +-sfr = "SPI0_IDR.OVRES", "Memory", 0xfffe0018, 4, base=16, bitRange=3 +-sfr = "SPI0_IDR.ENDRX", "Memory", 0xfffe0018, 4, base=16, bitRange=4 +-sfr = "SPI0_IDR.ENDTX", "Memory", 0xfffe0018, 4, base=16, bitRange=5 +-sfr = "SPI0_IDR.RXBUFF", "Memory", 0xfffe0018, 4, base=16, bitRange=6 +-sfr = "SPI0_IDR.TXBUFE", "Memory", 0xfffe0018, 4, base=16, bitRange=7 +-sfr = "SPI0_IDR.NSSR", "Memory", 0xfffe0018, 4, base=16, bitRange=8 +-sfr = "SPI0_IDR.TXEMPTY", "Memory", 0xfffe0018, 4, base=16, bitRange=9 +-sfr = "SPI0_IMR", "Memory", 0xfffe001c, 4, base=16 +-sfr = "SPI0_IMR.RDRF", "Memory", 0xfffe001c, 4, base=16, bitRange=0 +-sfr = "SPI0_IMR.TDRE", "Memory", 0xfffe001c, 4, base=16, bitRange=1 +-sfr = "SPI0_IMR.MODF", "Memory", 0xfffe001c, 4, base=16, bitRange=2 +-sfr = "SPI0_IMR.OVRES", "Memory", 0xfffe001c, 4, base=16, bitRange=3 +-sfr = "SPI0_IMR.ENDRX", "Memory", 0xfffe001c, 4, base=16, bitRange=4 +-sfr = "SPI0_IMR.ENDTX", "Memory", 0xfffe001c, 4, base=16, bitRange=5 +-sfr = "SPI0_IMR.RXBUFF", "Memory", 0xfffe001c, 4, base=16, bitRange=6 +-sfr = "SPI0_IMR.TXBUFE", "Memory", 0xfffe001c, 4, base=16, bitRange=7 +-sfr = "SPI0_IMR.NSSR", "Memory", 0xfffe001c, 4, base=16, bitRange=8 +-sfr = "SPI0_IMR.TXEMPTY", "Memory", 0xfffe001c, 4, base=16, bitRange=9 +-sfr = "SPI0_CSR", "Memory", 0xfffe0030, 4, base=16 +-sfr = "SPI0_CSR.CPOL", "Memory", 0xfffe0030, 4, base=16, bitRange=0 +-sfr = "SPI0_CSR.NCPHA", "Memory", 0xfffe0030, 4, base=16, bitRange=1 +-sfr = "SPI0_CSR.CSAAT", "Memory", 0xfffe0030, 4, base=16, bitRange=3 +-sfr = "SPI0_CSR.BITS", "Memory", 0xfffe0030, 4, base=16, bitRange=4-7 +-sfr = "SPI0_CSR.SCBR", "Memory", 0xfffe0030, 4, base=16, bitRange=8-15 +-sfr = "SPI0_CSR.DLYBS", "Memory", 0xfffe0030, 4, base=16, bitRange=16-23 +-sfr = "SPI0_CSR.DLYBCT", "Memory", 0xfffe0030, 4, base=16, bitRange=24-31 +-; ========== Register definition for PDC_US1 peripheral ========== +-sfr = "US1_RPR", "Memory", 0xfffc4100, 4, base=16 +-sfr = "US1_RCR", "Memory", 0xfffc4104, 4, base=16 +-sfr = "US1_TPR", "Memory", 0xfffc4108, 4, base=16 +-sfr = "US1_TCR", "Memory", 0xfffc410c, 4, base=16 +-sfr = "US1_RNPR", "Memory", 0xfffc4110, 4, base=16 +-sfr = "US1_RNCR", "Memory", 0xfffc4114, 4, base=16 +-sfr = "US1_TNPR", "Memory", 0xfffc4118, 4, base=16 +-sfr = "US1_TNCR", "Memory", 0xfffc411c, 4, base=16 +-sfr = "US1_PTCR", "Memory", 0xfffc4120, 4, base=16 +-sfr = "US1_PTCR.RXTEN", "Memory", 0xfffc4120, 4, base=16, bitRange=0 +-sfr = "US1_PTCR.RXTDIS", "Memory", 0xfffc4120, 4, base=16, bitRange=1 +-sfr = "US1_PTCR.TXTEN", "Memory", 0xfffc4120, 4, base=16, bitRange=8 +-sfr = "US1_PTCR.TXTDIS", "Memory", 0xfffc4120, 4, base=16, bitRange=9 +-sfr = "US1_PTSR", "Memory", 0xfffc4124, 4, base=16 +-sfr = "US1_PTSR.RXTEN", "Memory", 0xfffc4124, 4, base=16, bitRange=0 +-sfr = "US1_PTSR.TXTEN", "Memory", 0xfffc4124, 4, base=16, bitRange=8 +-; ========== Register definition for US1 peripheral ========== +-sfr = "US1_CR", "Memory", 0xfffc4000, 4, base=16 +-sfr = "US1_CR.RSTRX", "Memory", 0xfffc4000, 4, base=16, bitRange=2 +-sfr = "US1_CR.RSTTX", "Memory", 0xfffc4000, 4, base=16, bitRange=3 +-sfr = "US1_CR.RXEN", "Memory", 0xfffc4000, 4, base=16, bitRange=4 +-sfr = "US1_CR.RXDIS", "Memory", 0xfffc4000, 4, base=16, bitRange=5 +-sfr = "US1_CR.TXEN", "Memory", 0xfffc4000, 4, base=16, bitRange=6 +-sfr = "US1_CR.TXDIS", "Memory", 0xfffc4000, 4, base=16, bitRange=7 +-sfr = "US1_CR.RSTSTA", "Memory", 0xfffc4000, 4, base=16, bitRange=8 +-sfr = "US1_CR.STTBRK", "Memory", 0xfffc4000, 4, base=16, bitRange=9 +-sfr = "US1_CR.STPBRK", "Memory", 0xfffc4000, 4, base=16, bitRange=10 +-sfr = "US1_CR.STTTO", "Memory", 0xfffc4000, 4, base=16, bitRange=11 +-sfr = "US1_CR.SENDA", "Memory", 0xfffc4000, 4, base=16, bitRange=12 +-sfr = "US1_CR.RSTIT", "Memory", 0xfffc4000, 4, base=16, bitRange=13 +-sfr = "US1_CR.RSTNACK", "Memory", 0xfffc4000, 4, base=16, bitRange=14 +-sfr = "US1_CR.RETTO", "Memory", 0xfffc4000, 4, base=16, bitRange=15 +-sfr = "US1_CR.DTREN", "Memory", 0xfffc4000, 4, base=16, bitRange=16 +-sfr = "US1_CR.DTRDIS", "Memory", 0xfffc4000, 4, base=16, bitRange=17 +-sfr = "US1_CR.RTSEN", "Memory", 0xfffc4000, 4, base=16, bitRange=18 +-sfr = "US1_CR.RTSDIS", "Memory", 0xfffc4000, 4, base=16, bitRange=19 +-sfr = "US1_MR", "Memory", 0xfffc4004, 4, base=16 +-sfr = "US1_MR.USMODE", "Memory", 0xfffc4004, 4, base=16, bitRange=0-3 +-sfr = "US1_MR.CLKS", "Memory", 0xfffc4004, 4, base=16, bitRange=4-5 +-sfr = "US1_MR.CHRL", "Memory", 0xfffc4004, 4, base=16, bitRange=6-7 +-sfr = "US1_MR.SYNC", "Memory", 0xfffc4004, 4, base=16, bitRange=8 +-sfr = "US1_MR.PAR", "Memory", 0xfffc4004, 4, base=16, bitRange=9-11 +-sfr = "US1_MR.NBSTOP", "Memory", 0xfffc4004, 4, base=16, bitRange=12-13 +-sfr = "US1_MR.CHMODE", "Memory", 0xfffc4004, 4, base=16, bitRange=14-15 +-sfr = "US1_MR.MSBF", "Memory", 0xfffc4004, 4, base=16, bitRange=16 +-sfr = "US1_MR.MODE9", "Memory", 0xfffc4004, 4, base=16, bitRange=17 +-sfr = "US1_MR.CKLO", "Memory", 0xfffc4004, 4, base=16, bitRange=18 +-sfr = "US1_MR.OVER", "Memory", 0xfffc4004, 4, base=16, bitRange=19 +-sfr = "US1_MR.INACK", "Memory", 0xfffc4004, 4, base=16, bitRange=20 +-sfr = "US1_MR.DSNACK", "Memory", 0xfffc4004, 4, base=16, bitRange=21 +-sfr = "US1_MR.ITER", "Memory", 0xfffc4004, 4, base=16, bitRange=24 +-sfr = "US1_MR.FILTER", "Memory", 0xfffc4004, 4, base=16, bitRange=28 +-sfr = "US1_IER", "Memory", 0xfffc4008, 4, base=16 +-sfr = "US1_IER.RXRDY", "Memory", 0xfffc4008, 4, base=16, bitRange=0 +-sfr = "US1_IER.TXRDY", "Memory", 0xfffc4008, 4, base=16, bitRange=1 +-sfr = "US1_IER.RXBRK", "Memory", 0xfffc4008, 4, base=16, bitRange=2 +-sfr = "US1_IER.ENDRX", "Memory", 0xfffc4008, 4, base=16, bitRange=3 +-sfr = "US1_IER.ENDTX", "Memory", 0xfffc4008, 4, base=16, bitRange=4 +-sfr = "US1_IER.OVRE", "Memory", 0xfffc4008, 4, base=16, bitRange=5 +-sfr = "US1_IER.FRAME", "Memory", 0xfffc4008, 4, base=16, bitRange=6 +-sfr = "US1_IER.PARE", "Memory", 0xfffc4008, 4, base=16, bitRange=7 +-sfr = "US1_IER.TIMEOUT", "Memory", 0xfffc4008, 4, base=16, bitRange=8 +-sfr = "US1_IER.TXEMPTY", "Memory", 0xfffc4008, 4, base=16, bitRange=9 +-sfr = "US1_IER.ITERATION", "Memory", 0xfffc4008, 4, base=16, bitRange=10 +-sfr = "US1_IER.TXBUFE", "Memory", 0xfffc4008, 4, base=16, bitRange=11 +-sfr = "US1_IER.RXBUFF", "Memory", 0xfffc4008, 4, base=16, bitRange=12 +-sfr = "US1_IER.NACK", "Memory", 0xfffc4008, 4, base=16, bitRange=13 +-sfr = "US1_IER.RIIC", "Memory", 0xfffc4008, 4, base=16, bitRange=16 +-sfr = "US1_IER.DSRIC", "Memory", 0xfffc4008, 4, base=16, bitRange=17 +-sfr = "US1_IER.DCDIC", "Memory", 0xfffc4008, 4, base=16, bitRange=18 +-sfr = "US1_IER.CTSIC", "Memory", 0xfffc4008, 4, base=16, bitRange=19 +-sfr = "US1_IDR", "Memory", 0xfffc400c, 4, base=16 +-sfr = "US1_IDR.RXRDY", "Memory", 0xfffc400c, 4, base=16, bitRange=0 +-sfr = "US1_IDR.TXRDY", "Memory", 0xfffc400c, 4, base=16, bitRange=1 +-sfr = "US1_IDR.RXBRK", "Memory", 0xfffc400c, 4, base=16, bitRange=2 +-sfr = "US1_IDR.ENDRX", "Memory", 0xfffc400c, 4, base=16, bitRange=3 +-sfr = "US1_IDR.ENDTX", "Memory", 0xfffc400c, 4, base=16, bitRange=4 +-sfr = "US1_IDR.OVRE", "Memory", 0xfffc400c, 4, base=16, bitRange=5 +-sfr = "US1_IDR.FRAME", "Memory", 0xfffc400c, 4, base=16, bitRange=6 +-sfr = "US1_IDR.PARE", "Memory", 0xfffc400c, 4, base=16, bitRange=7 +-sfr = "US1_IDR.TIMEOUT", "Memory", 0xfffc400c, 4, base=16, bitRange=8 +-sfr = "US1_IDR.TXEMPTY", "Memory", 0xfffc400c, 4, base=16, bitRange=9 +-sfr = "US1_IDR.ITERATION", "Memory", 0xfffc400c, 4, base=16, bitRange=10 +-sfr = "US1_IDR.TXBUFE", "Memory", 0xfffc400c, 4, base=16, bitRange=11 +-sfr = "US1_IDR.RXBUFF", "Memory", 0xfffc400c, 4, base=16, bitRange=12 +-sfr = "US1_IDR.NACK", "Memory", 0xfffc400c, 4, base=16, bitRange=13 +-sfr = "US1_IDR.RIIC", "Memory", 0xfffc400c, 4, base=16, bitRange=16 +-sfr = "US1_IDR.DSRIC", "Memory", 0xfffc400c, 4, base=16, bitRange=17 +-sfr = "US1_IDR.DCDIC", "Memory", 0xfffc400c, 4, base=16, bitRange=18 +-sfr = "US1_IDR.CTSIC", "Memory", 0xfffc400c, 4, base=16, bitRange=19 +-sfr = "US1_IMR", "Memory", 0xfffc4010, 4, base=16 +-sfr = "US1_IMR.RXRDY", "Memory", 0xfffc4010, 4, base=16, bitRange=0 +-sfr = "US1_IMR.TXRDY", "Memory", 0xfffc4010, 4, base=16, bitRange=1 +-sfr = "US1_IMR.RXBRK", "Memory", 0xfffc4010, 4, base=16, bitRange=2 +-sfr = "US1_IMR.ENDRX", "Memory", 0xfffc4010, 4, base=16, bitRange=3 +-sfr = "US1_IMR.ENDTX", "Memory", 0xfffc4010, 4, base=16, bitRange=4 +-sfr = "US1_IMR.OVRE", "Memory", 0xfffc4010, 4, base=16, bitRange=5 +-sfr = "US1_IMR.FRAME", "Memory", 0xfffc4010, 4, base=16, bitRange=6 +-sfr = "US1_IMR.PARE", "Memory", 0xfffc4010, 4, base=16, bitRange=7 +-sfr = "US1_IMR.TIMEOUT", "Memory", 0xfffc4010, 4, base=16, bitRange=8 +-sfr = "US1_IMR.TXEMPTY", "Memory", 0xfffc4010, 4, base=16, bitRange=9 +-sfr = "US1_IMR.ITERATION", "Memory", 0xfffc4010, 4, base=16, bitRange=10 +-sfr = "US1_IMR.TXBUFE", "Memory", 0xfffc4010, 4, base=16, bitRange=11 +-sfr = "US1_IMR.RXBUFF", "Memory", 0xfffc4010, 4, base=16, bitRange=12 +-sfr = "US1_IMR.NACK", "Memory", 0xfffc4010, 4, base=16, bitRange=13 +-sfr = "US1_IMR.RIIC", "Memory", 0xfffc4010, 4, base=16, bitRange=16 +-sfr = "US1_IMR.DSRIC", "Memory", 0xfffc4010, 4, base=16, bitRange=17 +-sfr = "US1_IMR.DCDIC", "Memory", 0xfffc4010, 4, base=16, bitRange=18 +-sfr = "US1_IMR.CTSIC", "Memory", 0xfffc4010, 4, base=16, bitRange=19 +-sfr = "US1_CSR", "Memory", 0xfffc4014, 4, base=16 +-sfr = "US1_CSR.RXRDY", "Memory", 0xfffc4014, 4, base=16, bitRange=0 +-sfr = "US1_CSR.TXRDY", "Memory", 0xfffc4014, 4, base=16, bitRange=1 +-sfr = "US1_CSR.RXBRK", "Memory", 0xfffc4014, 4, base=16, bitRange=2 +-sfr = "US1_CSR.ENDRX", "Memory", 0xfffc4014, 4, base=16, bitRange=3 +-sfr = "US1_CSR.ENDTX", "Memory", 0xfffc4014, 4, base=16, bitRange=4 +-sfr = "US1_CSR.OVRE", "Memory", 0xfffc4014, 4, base=16, bitRange=5 +-sfr = "US1_CSR.FRAME", "Memory", 0xfffc4014, 4, base=16, bitRange=6 +-sfr = "US1_CSR.PARE", "Memory", 0xfffc4014, 4, base=16, bitRange=7 +-sfr = "US1_CSR.TIMEOUT", "Memory", 0xfffc4014, 4, base=16, bitRange=8 +-sfr = "US1_CSR.TXEMPTY", "Memory", 0xfffc4014, 4, base=16, bitRange=9 +-sfr = "US1_CSR.ITERATION", "Memory", 0xfffc4014, 4, base=16, bitRange=10 +-sfr = "US1_CSR.TXBUFE", "Memory", 0xfffc4014, 4, base=16, bitRange=11 +-sfr = "US1_CSR.RXBUFF", "Memory", 0xfffc4014, 4, base=16, bitRange=12 +-sfr = "US1_CSR.NACK", "Memory", 0xfffc4014, 4, base=16, bitRange=13 +-sfr = "US1_CSR.RIIC", "Memory", 0xfffc4014, 4, base=16, bitRange=16 +-sfr = "US1_CSR.DSRIC", "Memory", 0xfffc4014, 4, base=16, bitRange=17 +-sfr = "US1_CSR.DCDIC", "Memory", 0xfffc4014, 4, base=16, bitRange=18 +-sfr = "US1_CSR.CTSIC", "Memory", 0xfffc4014, 4, base=16, bitRange=19 +-sfr = "US1_CSR.RI", "Memory", 0xfffc4014, 4, base=16, bitRange=20 +-sfr = "US1_CSR.DSR", "Memory", 0xfffc4014, 4, base=16, bitRange=21 +-sfr = "US1_CSR.DCD", "Memory", 0xfffc4014, 4, base=16, bitRange=22 +-sfr = "US1_CSR.CTS", "Memory", 0xfffc4014, 4, base=16, bitRange=23 +-sfr = "US1_RHR", "Memory", 0xfffc4018, 4, base=16 +-sfr = "US1_THR", "Memory", 0xfffc401c, 4, base=16 +-sfr = "US1_BRGR", "Memory", 0xfffc4020, 4, base=16 +-sfr = "US1_RTOR", "Memory", 0xfffc4024, 4, base=16 +-sfr = "US1_TTGR", "Memory", 0xfffc4028, 4, base=16 +-sfr = "US1_FIDI", "Memory", 0xfffc4040, 4, base=16 +-sfr = "US1_NER", "Memory", 0xfffc4044, 4, base=16 +-sfr = "US1_IF", "Memory", 0xfffc404c, 4, base=16 +-; ========== Register definition for PDC_US0 peripheral ========== +-sfr = "US0_RPR", "Memory", 0xfffc0100, 4, base=16 +-sfr = "US0_RCR", "Memory", 0xfffc0104, 4, base=16 +-sfr = "US0_TPR", "Memory", 0xfffc0108, 4, base=16 +-sfr = "US0_TCR", "Memory", 0xfffc010c, 4, base=16 +-sfr = "US0_RNPR", "Memory", 0xfffc0110, 4, base=16 +-sfr = "US0_RNCR", "Memory", 0xfffc0114, 4, base=16 +-sfr = "US0_TNPR", "Memory", 0xfffc0118, 4, base=16 +-sfr = "US0_TNCR", "Memory", 0xfffc011c, 4, base=16 +-sfr = "US0_PTCR", "Memory", 0xfffc0120, 4, base=16 +-sfr = "US0_PTCR.RXTEN", "Memory", 0xfffc0120, 4, base=16, bitRange=0 +-sfr = "US0_PTCR.RXTDIS", "Memory", 0xfffc0120, 4, base=16, bitRange=1 +-sfr = "US0_PTCR.TXTEN", "Memory", 0xfffc0120, 4, base=16, bitRange=8 +-sfr = "US0_PTCR.TXTDIS", "Memory", 0xfffc0120, 4, base=16, bitRange=9 +-sfr = "US0_PTSR", "Memory", 0xfffc0124, 4, base=16 +-sfr = "US0_PTSR.RXTEN", "Memory", 0xfffc0124, 4, base=16, bitRange=0 +-sfr = "US0_PTSR.TXTEN", "Memory", 0xfffc0124, 4, base=16, bitRange=8 +-; ========== Register definition for US0 peripheral ========== +-sfr = "US0_CR", "Memory", 0xfffc0000, 4, base=16 +-sfr = "US0_CR.RSTRX", "Memory", 0xfffc0000, 4, base=16, bitRange=2 +-sfr = "US0_CR.RSTTX", "Memory", 0xfffc0000, 4, base=16, bitRange=3 +-sfr = "US0_CR.RXEN", "Memory", 0xfffc0000, 4, base=16, bitRange=4 +-sfr = "US0_CR.RXDIS", "Memory", 0xfffc0000, 4, base=16, bitRange=5 +-sfr = "US0_CR.TXEN", "Memory", 0xfffc0000, 4, base=16, bitRange=6 +-sfr = "US0_CR.TXDIS", "Memory", 0xfffc0000, 4, base=16, bitRange=7 +-sfr = "US0_CR.RSTSTA", "Memory", 0xfffc0000, 4, base=16, bitRange=8 +-sfr = "US0_CR.STTBRK", "Memory", 0xfffc0000, 4, base=16, bitRange=9 +-sfr = "US0_CR.STPBRK", "Memory", 0xfffc0000, 4, base=16, bitRange=10 +-sfr = "US0_CR.STTTO", "Memory", 0xfffc0000, 4, base=16, bitRange=11 +-sfr = "US0_CR.SENDA", "Memory", 0xfffc0000, 4, base=16, bitRange=12 +-sfr = "US0_CR.RSTIT", "Memory", 0xfffc0000, 4, base=16, bitRange=13 +-sfr = "US0_CR.RSTNACK", "Memory", 0xfffc0000, 4, base=16, bitRange=14 +-sfr = "US0_CR.RETTO", "Memory", 0xfffc0000, 4, base=16, bitRange=15 +-sfr = "US0_CR.DTREN", "Memory", 0xfffc0000, 4, base=16, bitRange=16 +-sfr = "US0_CR.DTRDIS", "Memory", 0xfffc0000, 4, base=16, bitRange=17 +-sfr = "US0_CR.RTSEN", "Memory", 0xfffc0000, 4, base=16, bitRange=18 +-sfr = "US0_CR.RTSDIS", "Memory", 0xfffc0000, 4, base=16, bitRange=19 +-sfr = "US0_MR", "Memory", 0xfffc0004, 4, base=16 +-sfr = "US0_MR.USMODE", "Memory", 0xfffc0004, 4, base=16, bitRange=0-3 +-sfr = "US0_MR.CLKS", "Memory", 0xfffc0004, 4, base=16, bitRange=4-5 +-sfr = "US0_MR.CHRL", "Memory", 0xfffc0004, 4, base=16, bitRange=6-7 +-sfr = "US0_MR.SYNC", "Memory", 0xfffc0004, 4, base=16, bitRange=8 +-sfr = "US0_MR.PAR", "Memory", 0xfffc0004, 4, base=16, bitRange=9-11 +-sfr = "US0_MR.NBSTOP", "Memory", 0xfffc0004, 4, base=16, bitRange=12-13 +-sfr = "US0_MR.CHMODE", "Memory", 0xfffc0004, 4, base=16, bitRange=14-15 +-sfr = "US0_MR.MSBF", "Memory", 0xfffc0004, 4, base=16, bitRange=16 +-sfr = "US0_MR.MODE9", "Memory", 0xfffc0004, 4, base=16, bitRange=17 +-sfr = "US0_MR.CKLO", "Memory", 0xfffc0004, 4, base=16, bitRange=18 +-sfr = "US0_MR.OVER", "Memory", 0xfffc0004, 4, base=16, bitRange=19 +-sfr = "US0_MR.INACK", "Memory", 0xfffc0004, 4, base=16, bitRange=20 +-sfr = "US0_MR.DSNACK", "Memory", 0xfffc0004, 4, base=16, bitRange=21 +-sfr = "US0_MR.ITER", "Memory", 0xfffc0004, 4, base=16, bitRange=24 +-sfr = "US0_MR.FILTER", "Memory", 0xfffc0004, 4, base=16, bitRange=28 +-sfr = "US0_IER", "Memory", 0xfffc0008, 4, base=16 +-sfr = "US0_IER.RXRDY", "Memory", 0xfffc0008, 4, base=16, bitRange=0 +-sfr = "US0_IER.TXRDY", "Memory", 0xfffc0008, 4, base=16, bitRange=1 +-sfr = "US0_IER.RXBRK", "Memory", 0xfffc0008, 4, base=16, bitRange=2 +-sfr = "US0_IER.ENDRX", "Memory", 0xfffc0008, 4, base=16, bitRange=3 +-sfr = "US0_IER.ENDTX", "Memory", 0xfffc0008, 4, base=16, bitRange=4 +-sfr = "US0_IER.OVRE", "Memory", 0xfffc0008, 4, base=16, bitRange=5 +-sfr = "US0_IER.FRAME", "Memory", 0xfffc0008, 4, base=16, bitRange=6 +-sfr = "US0_IER.PARE", "Memory", 0xfffc0008, 4, base=16, bitRange=7 +-sfr = "US0_IER.TIMEOUT", "Memory", 0xfffc0008, 4, base=16, bitRange=8 +-sfr = "US0_IER.TXEMPTY", "Memory", 0xfffc0008, 4, base=16, bitRange=9 +-sfr = "US0_IER.ITERATION", "Memory", 0xfffc0008, 4, base=16, bitRange=10 +-sfr = "US0_IER.TXBUFE", "Memory", 0xfffc0008, 4, base=16, bitRange=11 +-sfr = "US0_IER.RXBUFF", "Memory", 0xfffc0008, 4, base=16, bitRange=12 +-sfr = "US0_IER.NACK", "Memory", 0xfffc0008, 4, base=16, bitRange=13 +-sfr = "US0_IER.RIIC", "Memory", 0xfffc0008, 4, base=16, bitRange=16 +-sfr = "US0_IER.DSRIC", "Memory", 0xfffc0008, 4, base=16, bitRange=17 +-sfr = "US0_IER.DCDIC", "Memory", 0xfffc0008, 4, base=16, bitRange=18 +-sfr = "US0_IER.CTSIC", "Memory", 0xfffc0008, 4, base=16, bitRange=19 +-sfr = "US0_IDR", "Memory", 0xfffc000c, 4, base=16 +-sfr = "US0_IDR.RXRDY", "Memory", 0xfffc000c, 4, base=16, bitRange=0 +-sfr = "US0_IDR.TXRDY", "Memory", 0xfffc000c, 4, base=16, bitRange=1 +-sfr = "US0_IDR.RXBRK", "Memory", 0xfffc000c, 4, base=16, bitRange=2 +-sfr = "US0_IDR.ENDRX", "Memory", 0xfffc000c, 4, base=16, bitRange=3 +-sfr = "US0_IDR.ENDTX", "Memory", 0xfffc000c, 4, base=16, bitRange=4 +-sfr = "US0_IDR.OVRE", "Memory", 0xfffc000c, 4, base=16, bitRange=5 +-sfr = "US0_IDR.FRAME", "Memory", 0xfffc000c, 4, base=16, bitRange=6 +-sfr = "US0_IDR.PARE", "Memory", 0xfffc000c, 4, base=16, bitRange=7 +-sfr = "US0_IDR.TIMEOUT", "Memory", 0xfffc000c, 4, base=16, bitRange=8 +-sfr = "US0_IDR.TXEMPTY", "Memory", 0xfffc000c, 4, base=16, bitRange=9 +-sfr = "US0_IDR.ITERATION", "Memory", 0xfffc000c, 4, base=16, bitRange=10 +-sfr = "US0_IDR.TXBUFE", "Memory", 0xfffc000c, 4, base=16, bitRange=11 +-sfr = "US0_IDR.RXBUFF", "Memory", 0xfffc000c, 4, base=16, bitRange=12 +-sfr = "US0_IDR.NACK", "Memory", 0xfffc000c, 4, base=16, bitRange=13 +-sfr = "US0_IDR.RIIC", "Memory", 0xfffc000c, 4, base=16, bitRange=16 +-sfr = "US0_IDR.DSRIC", "Memory", 0xfffc000c, 4, base=16, bitRange=17 +-sfr = "US0_IDR.DCDIC", "Memory", 0xfffc000c, 4, base=16, bitRange=18 +-sfr = "US0_IDR.CTSIC", "Memory", 0xfffc000c, 4, base=16, bitRange=19 +-sfr = "US0_IMR", "Memory", 0xfffc0010, 4, base=16 +-sfr = "US0_IMR.RXRDY", "Memory", 0xfffc0010, 4, base=16, bitRange=0 +-sfr = "US0_IMR.TXRDY", "Memory", 0xfffc0010, 4, base=16, bitRange=1 +-sfr = "US0_IMR.RXBRK", "Memory", 0xfffc0010, 4, base=16, bitRange=2 +-sfr = "US0_IMR.ENDRX", "Memory", 0xfffc0010, 4, base=16, bitRange=3 +-sfr = "US0_IMR.ENDTX", "Memory", 0xfffc0010, 4, base=16, bitRange=4 +-sfr = "US0_IMR.OVRE", "Memory", 0xfffc0010, 4, base=16, bitRange=5 +-sfr = "US0_IMR.FRAME", "Memory", 0xfffc0010, 4, base=16, bitRange=6 +-sfr = "US0_IMR.PARE", "Memory", 0xfffc0010, 4, base=16, bitRange=7 +-sfr = "US0_IMR.TIMEOUT", "Memory", 0xfffc0010, 4, base=16, bitRange=8 +-sfr = "US0_IMR.TXEMPTY", "Memory", 0xfffc0010, 4, base=16, bitRange=9 +-sfr = "US0_IMR.ITERATION", "Memory", 0xfffc0010, 4, base=16, bitRange=10 +-sfr = "US0_IMR.TXBUFE", "Memory", 0xfffc0010, 4, base=16, bitRange=11 +-sfr = "US0_IMR.RXBUFF", "Memory", 0xfffc0010, 4, base=16, bitRange=12 +-sfr = "US0_IMR.NACK", "Memory", 0xfffc0010, 4, base=16, bitRange=13 +-sfr = "US0_IMR.RIIC", "Memory", 0xfffc0010, 4, base=16, bitRange=16 +-sfr = "US0_IMR.DSRIC", "Memory", 0xfffc0010, 4, base=16, bitRange=17 +-sfr = "US0_IMR.DCDIC", "Memory", 0xfffc0010, 4, base=16, bitRange=18 +-sfr = "US0_IMR.CTSIC", "Memory", 0xfffc0010, 4, base=16, bitRange=19 +-sfr = "US0_CSR", "Memory", 0xfffc0014, 4, base=16 +-sfr = "US0_CSR.RXRDY", "Memory", 0xfffc0014, 4, base=16, bitRange=0 +-sfr = "US0_CSR.TXRDY", "Memory", 0xfffc0014, 4, base=16, bitRange=1 +-sfr = "US0_CSR.RXBRK", "Memory", 0xfffc0014, 4, base=16, bitRange=2 +-sfr = "US0_CSR.ENDRX", "Memory", 0xfffc0014, 4, base=16, bitRange=3 +-sfr = "US0_CSR.ENDTX", "Memory", 0xfffc0014, 4, base=16, bitRange=4 +-sfr = "US0_CSR.OVRE", "Memory", 0xfffc0014, 4, base=16, bitRange=5 +-sfr = "US0_CSR.FRAME", "Memory", 0xfffc0014, 4, base=16, bitRange=6 +-sfr = "US0_CSR.PARE", "Memory", 0xfffc0014, 4, base=16, bitRange=7 +-sfr = "US0_CSR.TIMEOUT", "Memory", 0xfffc0014, 4, base=16, bitRange=8 +-sfr = "US0_CSR.TXEMPTY", "Memory", 0xfffc0014, 4, base=16, bitRange=9 +-sfr = "US0_CSR.ITERATION", "Memory", 0xfffc0014, 4, base=16, bitRange=10 +-sfr = "US0_CSR.TXBUFE", "Memory", 0xfffc0014, 4, base=16, bitRange=11 +-sfr = "US0_CSR.RXBUFF", "Memory", 0xfffc0014, 4, base=16, bitRange=12 +-sfr = "US0_CSR.NACK", "Memory", 0xfffc0014, 4, base=16, bitRange=13 +-sfr = "US0_CSR.RIIC", "Memory", 0xfffc0014, 4, base=16, bitRange=16 +-sfr = "US0_CSR.DSRIC", "Memory", 0xfffc0014, 4, base=16, bitRange=17 +-sfr = "US0_CSR.DCDIC", "Memory", 0xfffc0014, 4, base=16, bitRange=18 +-sfr = "US0_CSR.CTSIC", "Memory", 0xfffc0014, 4, base=16, bitRange=19 +-sfr = "US0_CSR.RI", "Memory", 0xfffc0014, 4, base=16, bitRange=20 +-sfr = "US0_CSR.DSR", "Memory", 0xfffc0014, 4, base=16, bitRange=21 +-sfr = "US0_CSR.DCD", "Memory", 0xfffc0014, 4, base=16, bitRange=22 +-sfr = "US0_CSR.CTS", "Memory", 0xfffc0014, 4, base=16, bitRange=23 +-sfr = "US0_RHR", "Memory", 0xfffc0018, 4, base=16 +-sfr = "US0_THR", "Memory", 0xfffc001c, 4, base=16 +-sfr = "US0_BRGR", "Memory", 0xfffc0020, 4, base=16 +-sfr = "US0_RTOR", "Memory", 0xfffc0024, 4, base=16 +-sfr = "US0_TTGR", "Memory", 0xfffc0028, 4, base=16 +-sfr = "US0_FIDI", "Memory", 0xfffc0040, 4, base=16 +-sfr = "US0_NER", "Memory", 0xfffc0044, 4, base=16 +-sfr = "US0_IF", "Memory", 0xfffc004c, 4, base=16 +-; ========== Register definition for PDC_SSC peripheral ========== +-sfr = "SSC_RPR", "Memory", 0xfffd4100, 4, base=16 +-sfr = "SSC_RCR", "Memory", 0xfffd4104, 4, base=16 +-sfr = "SSC_TPR", "Memory", 0xfffd4108, 4, base=16 +-sfr = "SSC_TCR", "Memory", 0xfffd410c, 4, base=16 +-sfr = "SSC_RNPR", "Memory", 0xfffd4110, 4, base=16 +-sfr = "SSC_RNCR", "Memory", 0xfffd4114, 4, base=16 +-sfr = "SSC_TNPR", "Memory", 0xfffd4118, 4, base=16 +-sfr = "SSC_TNCR", "Memory", 0xfffd411c, 4, base=16 +-sfr = "SSC_PTCR", "Memory", 0xfffd4120, 4, base=16 +-sfr = "SSC_PTCR.RXTEN", "Memory", 0xfffd4120, 4, base=16, bitRange=0 +-sfr = "SSC_PTCR.RXTDIS", "Memory", 0xfffd4120, 4, base=16, bitRange=1 +-sfr = "SSC_PTCR.TXTEN", "Memory", 0xfffd4120, 4, base=16, bitRange=8 +-sfr = "SSC_PTCR.TXTDIS", "Memory", 0xfffd4120, 4, base=16, bitRange=9 +-sfr = "SSC_PTSR", "Memory", 0xfffd4124, 4, base=16 +-sfr = "SSC_PTSR.RXTEN", "Memory", 0xfffd4124, 4, base=16, bitRange=0 +-sfr = "SSC_PTSR.TXTEN", "Memory", 0xfffd4124, 4, base=16, bitRange=8 +-; ========== Register definition for SSC peripheral ========== +-sfr = "SSC_CR", "Memory", 0xfffd4000, 4, base=16 +-sfr = "SSC_CR.RXEN", "Memory", 0xfffd4000, 4, base=16, bitRange=0 +-sfr = "SSC_CR.RXDIS", "Memory", 0xfffd4000, 4, base=16, bitRange=1 +-sfr = "SSC_CR.TXEN", "Memory", 0xfffd4000, 4, base=16, bitRange=8 +-sfr = "SSC_CR.TXDIS", "Memory", 0xfffd4000, 4, base=16, bitRange=9 +-sfr = "SSC_CR.SWRST", "Memory", 0xfffd4000, 4, base=16, bitRange=15 +-sfr = "SSC_CMR", "Memory", 0xfffd4004, 4, base=16 +-sfr = "SSC_RCMR", "Memory", 0xfffd4010, 4, base=16 +-sfr = "SSC_RCMR.CKS", "Memory", 0xfffd4010, 4, base=16, bitRange=0-1 +-sfr = "SSC_RCMR.CKO", "Memory", 0xfffd4010, 4, base=16, bitRange=2-4 +-sfr = "SSC_RCMR.CKI", "Memory", 0xfffd4010, 4, base=16, bitRange=5 +-sfr = "SSC_RCMR.CKG", "Memory", 0xfffd4010, 4, base=16, bitRange=6-7 +-sfr = "SSC_RCMR.START", "Memory", 0xfffd4010, 4, base=16, bitRange=8-11 +-sfr = "SSC_RCMR.STOP", "Memory", 0xfffd4010, 4, base=16, bitRange=12 +-sfr = "SSC_RCMR.STTDLY", "Memory", 0xfffd4010, 4, base=16, bitRange=16-23 +-sfr = "SSC_RCMR.PERIOD", "Memory", 0xfffd4010, 4, base=16, bitRange=24-31 +-sfr = "SSC_RFMR", "Memory", 0xfffd4014, 4, base=16 +-sfr = "SSC_RFMR.DATLEN", "Memory", 0xfffd4014, 4, base=16, bitRange=0-4 +-sfr = "SSC_RFMR.LOOP", "Memory", 0xfffd4014, 4, base=16, bitRange=5 +-sfr = "SSC_RFMR.MSBF", "Memory", 0xfffd4014, 4, base=16, bitRange=7 +-sfr = "SSC_RFMR.DATNB", "Memory", 0xfffd4014, 4, base=16, bitRange=8-11 +-sfr = "SSC_RFMR.FSLEN", "Memory", 0xfffd4014, 4, base=16, bitRange=16-19 +-sfr = "SSC_RFMR.FSOS", "Memory", 0xfffd4014, 4, base=16, bitRange=20-22 +-sfr = "SSC_RFMR.FSEDGE", "Memory", 0xfffd4014, 4, base=16, bitRange=24 +-sfr = "SSC_TCMR", "Memory", 0xfffd4018, 4, base=16 +-sfr = "SSC_TCMR.CKS", "Memory", 0xfffd4018, 4, base=16, bitRange=0-1 +-sfr = "SSC_TCMR.CKO", "Memory", 0xfffd4018, 4, base=16, bitRange=2-4 +-sfr = "SSC_TCMR.CKI", "Memory", 0xfffd4018, 4, base=16, bitRange=5 +-sfr = "SSC_TCMR.CKG", "Memory", 0xfffd4018, 4, base=16, bitRange=6-7 +-sfr = "SSC_TCMR.START", "Memory", 0xfffd4018, 4, base=16, bitRange=8-11 +-sfr = "SSC_TCMR.STTDLY", "Memory", 0xfffd4018, 4, base=16, bitRange=16-23 +-sfr = "SSC_TCMR.PERIOD", "Memory", 0xfffd4018, 4, base=16, bitRange=24-31 +-sfr = "SSC_TFMR", "Memory", 0xfffd401c, 4, base=16 +-sfr = "SSC_TFMR.DATLEN", "Memory", 0xfffd401c, 4, base=16, bitRange=0-4 +-sfr = "SSC_TFMR.DATDEF", "Memory", 0xfffd401c, 4, base=16, bitRange=5 +-sfr = "SSC_TFMR.MSBF", "Memory", 0xfffd401c, 4, base=16, bitRange=7 +-sfr = "SSC_TFMR.DATNB", "Memory", 0xfffd401c, 4, base=16, bitRange=8-11 +-sfr = "SSC_TFMR.FSLEN", "Memory", 0xfffd401c, 4, base=16, bitRange=16-19 +-sfr = "SSC_TFMR.FSOS", "Memory", 0xfffd401c, 4, base=16, bitRange=20-22 +-sfr = "SSC_TFMR.FSDEN", "Memory", 0xfffd401c, 4, base=16, bitRange=23 +-sfr = "SSC_TFMR.FSEDGE", "Memory", 0xfffd401c, 4, base=16, bitRange=24 +-sfr = "SSC_RHR", "Memory", 0xfffd4020, 4, base=16 +-sfr = "SSC_THR", "Memory", 0xfffd4024, 4, base=16 +-sfr = "SSC_RSHR", "Memory", 0xfffd4030, 4, base=16 +-sfr = "SSC_TSHR", "Memory", 0xfffd4034, 4, base=16 +-sfr = "SSC_SR", "Memory", 0xfffd4040, 4, base=16 +-sfr = "SSC_SR.TXRDY", "Memory", 0xfffd4040, 4, base=16, bitRange=0 +-sfr = "SSC_SR.TXEMPTY", "Memory", 0xfffd4040, 4, base=16, bitRange=1 +-sfr = "SSC_SR.ENDTX", "Memory", 0xfffd4040, 4, base=16, bitRange=2 +-sfr = "SSC_SR.TXBUFE", "Memory", 0xfffd4040, 4, base=16, bitRange=3 +-sfr = "SSC_SR.RXRDY", "Memory", 0xfffd4040, 4, base=16, bitRange=4 +-sfr = "SSC_SR.OVRUN", "Memory", 0xfffd4040, 4, base=16, bitRange=5 +-sfr = "SSC_SR.ENDRX", "Memory", 0xfffd4040, 4, base=16, bitRange=6 +-sfr = "SSC_SR.RXBUFF", "Memory", 0xfffd4040, 4, base=16, bitRange=7 +-sfr = "SSC_SR.CP0", "Memory", 0xfffd4040, 4, base=16, bitRange=8 +-sfr = "SSC_SR.CP1", "Memory", 0xfffd4040, 4, base=16, bitRange=9 +-sfr = "SSC_SR.TXSYN", "Memory", 0xfffd4040, 4, base=16, bitRange=10 +-sfr = "SSC_SR.RXSYN", "Memory", 0xfffd4040, 4, base=16, bitRange=11 +-sfr = "SSC_SR.TXENA", "Memory", 0xfffd4040, 4, base=16, bitRange=16 +-sfr = "SSC_SR.RXENA", "Memory", 0xfffd4040, 4, base=16, bitRange=17 +-sfr = "SSC_IER", "Memory", 0xfffd4044, 4, base=16 +-sfr = "SSC_IER.TXRDY", "Memory", 0xfffd4044, 4, base=16, bitRange=0 +-sfr = "SSC_IER.TXEMPTY", "Memory", 0xfffd4044, 4, base=16, bitRange=1 +-sfr = "SSC_IER.ENDTX", "Memory", 0xfffd4044, 4, base=16, bitRange=2 +-sfr = "SSC_IER.TXBUFE", "Memory", 0xfffd4044, 4, base=16, bitRange=3 +-sfr = "SSC_IER.RXRDY", "Memory", 0xfffd4044, 4, base=16, bitRange=4 +-sfr = "SSC_IER.OVRUN", "Memory", 0xfffd4044, 4, base=16, bitRange=5 +-sfr = "SSC_IER.ENDRX", "Memory", 0xfffd4044, 4, base=16, bitRange=6 +-sfr = "SSC_IER.RXBUFF", "Memory", 0xfffd4044, 4, base=16, bitRange=7 +-sfr = "SSC_IER.CP0", "Memory", 0xfffd4044, 4, base=16, bitRange=8 +-sfr = "SSC_IER.CP1", "Memory", 0xfffd4044, 4, base=16, bitRange=9 +-sfr = "SSC_IER.TXSYN", "Memory", 0xfffd4044, 4, base=16, bitRange=10 +-sfr = "SSC_IER.RXSYN", "Memory", 0xfffd4044, 4, base=16, bitRange=11 +-sfr = "SSC_IDR", "Memory", 0xfffd4048, 4, base=16 +-sfr = "SSC_IDR.TXRDY", "Memory", 0xfffd4048, 4, base=16, bitRange=0 +-sfr = "SSC_IDR.TXEMPTY", "Memory", 0xfffd4048, 4, base=16, bitRange=1 +-sfr = "SSC_IDR.ENDTX", "Memory", 0xfffd4048, 4, base=16, bitRange=2 +-sfr = "SSC_IDR.TXBUFE", "Memory", 0xfffd4048, 4, base=16, bitRange=3 +-sfr = "SSC_IDR.RXRDY", "Memory", 0xfffd4048, 4, base=16, bitRange=4 +-sfr = "SSC_IDR.OVRUN", "Memory", 0xfffd4048, 4, base=16, bitRange=5 +-sfr = "SSC_IDR.ENDRX", "Memory", 0xfffd4048, 4, base=16, bitRange=6 +-sfr = "SSC_IDR.RXBUFF", "Memory", 0xfffd4048, 4, base=16, bitRange=7 +-sfr = "SSC_IDR.CP0", "Memory", 0xfffd4048, 4, base=16, bitRange=8 +-sfr = "SSC_IDR.CP1", "Memory", 0xfffd4048, 4, base=16, bitRange=9 +-sfr = "SSC_IDR.TXSYN", "Memory", 0xfffd4048, 4, base=16, bitRange=10 +-sfr = "SSC_IDR.RXSYN", "Memory", 0xfffd4048, 4, base=16, bitRange=11 +-sfr = "SSC_IMR", "Memory", 0xfffd404c, 4, base=16 +-sfr = "SSC_IMR.TXRDY", "Memory", 0xfffd404c, 4, base=16, bitRange=0 +-sfr = "SSC_IMR.TXEMPTY", "Memory", 0xfffd404c, 4, base=16, bitRange=1 +-sfr = "SSC_IMR.ENDTX", "Memory", 0xfffd404c, 4, base=16, bitRange=2 +-sfr = "SSC_IMR.TXBUFE", "Memory", 0xfffd404c, 4, base=16, bitRange=3 +-sfr = "SSC_IMR.RXRDY", "Memory", 0xfffd404c, 4, base=16, bitRange=4 +-sfr = "SSC_IMR.OVRUN", "Memory", 0xfffd404c, 4, base=16, bitRange=5 +-sfr = "SSC_IMR.ENDRX", "Memory", 0xfffd404c, 4, base=16, bitRange=6 +-sfr = "SSC_IMR.RXBUFF", "Memory", 0xfffd404c, 4, base=16, bitRange=7 +-sfr = "SSC_IMR.CP0", "Memory", 0xfffd404c, 4, base=16, bitRange=8 +-sfr = "SSC_IMR.CP1", "Memory", 0xfffd404c, 4, base=16, bitRange=9 +-sfr = "SSC_IMR.TXSYN", "Memory", 0xfffd404c, 4, base=16, bitRange=10 +-sfr = "SSC_IMR.RXSYN", "Memory", 0xfffd404c, 4, base=16, bitRange=11 +-; ========== Register definition for TWI peripheral ========== +-sfr = "TWI_CR", "Memory", 0xfffb8000, 4, base=16 +-sfr = "TWI_CR.START", "Memory", 0xfffb8000, 4, base=16, bitRange=0 +-sfr = "TWI_CR.STOP", "Memory", 0xfffb8000, 4, base=16, bitRange=1 +-sfr = "TWI_CR.MSEN", "Memory", 0xfffb8000, 4, base=16, bitRange=2 +-sfr = "TWI_CR.MSDIS", "Memory", 0xfffb8000, 4, base=16, bitRange=3 +-sfr = "TWI_CR.SWRST", "Memory", 0xfffb8000, 4, base=16, bitRange=7 +-sfr = "TWI_MMR", "Memory", 0xfffb8004, 4, base=16 +-sfr = "TWI_MMR.IADRSZ", "Memory", 0xfffb8004, 4, base=16, bitRange=8-9 +-sfr = "TWI_MMR.MREAD", "Memory", 0xfffb8004, 4, base=16, bitRange=12 +-sfr = "TWI_MMR.DADR", "Memory", 0xfffb8004, 4, base=16, bitRange=16-22 +-sfr = "TWI_IADR", "Memory", 0xfffb800c, 4, base=16 +-sfr = "TWI_CWGR", "Memory", 0xfffb8010, 4, base=16 +-sfr = "TWI_CWGR.CLDIV", "Memory", 0xfffb8010, 4, base=16, bitRange=0-7 +-sfr = "TWI_CWGR.CHDIV", "Memory", 0xfffb8010, 4, base=16, bitRange=8-15 +-sfr = "TWI_CWGR.CKDIV", "Memory", 0xfffb8010, 4, base=16, bitRange=16-18 +-sfr = "TWI_SR", "Memory", 0xfffb8020, 4, base=16 +-sfr = "TWI_SR.TXCOMP", "Memory", 0xfffb8020, 4, base=16, bitRange=0 +-sfr = "TWI_SR.RXRDY", "Memory", 0xfffb8020, 4, base=16, bitRange=1 +-sfr = "TWI_SR.TXRDY", "Memory", 0xfffb8020, 4, base=16, bitRange=2 +-sfr = "TWI_SR.OVRE", "Memory", 0xfffb8020, 4, base=16, bitRange=6 +-sfr = "TWI_SR.UNRE", "Memory", 0xfffb8020, 4, base=16, bitRange=7 +-sfr = "TWI_SR.NACK", "Memory", 0xfffb8020, 4, base=16, bitRange=8 +-sfr = "TWI_IER", "Memory", 0xfffb8024, 4, base=16 +-sfr = "TWI_IER.TXCOMP", "Memory", 0xfffb8024, 4, base=16, bitRange=0 +-sfr = "TWI_IER.RXRDY", "Memory", 0xfffb8024, 4, base=16, bitRange=1 +-sfr = "TWI_IER.TXRDY", "Memory", 0xfffb8024, 4, base=16, bitRange=2 +-sfr = "TWI_IER.OVRE", "Memory", 0xfffb8024, 4, base=16, bitRange=6 +-sfr = "TWI_IER.UNRE", "Memory", 0xfffb8024, 4, base=16, bitRange=7 +-sfr = "TWI_IER.NACK", "Memory", 0xfffb8024, 4, base=16, bitRange=8 +-sfr = "TWI_IDR", "Memory", 0xfffb8028, 4, base=16 +-sfr = "TWI_IDR.TXCOMP", "Memory", 0xfffb8028, 4, base=16, bitRange=0 +-sfr = "TWI_IDR.RXRDY", "Memory", 0xfffb8028, 4, base=16, bitRange=1 +-sfr = "TWI_IDR.TXRDY", "Memory", 0xfffb8028, 4, base=16, bitRange=2 +-sfr = "TWI_IDR.OVRE", "Memory", 0xfffb8028, 4, base=16, bitRange=6 +-sfr = "TWI_IDR.UNRE", "Memory", 0xfffb8028, 4, base=16, bitRange=7 +-sfr = "TWI_IDR.NACK", "Memory", 0xfffb8028, 4, base=16, bitRange=8 +-sfr = "TWI_IMR", "Memory", 0xfffb802c, 4, base=16 +-sfr = "TWI_IMR.TXCOMP", "Memory", 0xfffb802c, 4, base=16, bitRange=0 +-sfr = "TWI_IMR.RXRDY", "Memory", 0xfffb802c, 4, base=16, bitRange=1 +-sfr = "TWI_IMR.TXRDY", "Memory", 0xfffb802c, 4, base=16, bitRange=2 +-sfr = "TWI_IMR.OVRE", "Memory", 0xfffb802c, 4, base=16, bitRange=6 +-sfr = "TWI_IMR.UNRE", "Memory", 0xfffb802c, 4, base=16, bitRange=7 +-sfr = "TWI_IMR.NACK", "Memory", 0xfffb802c, 4, base=16, bitRange=8 +-sfr = "TWI_RHR", "Memory", 0xfffb8030, 4, base=16 +-sfr = "TWI_THR", "Memory", 0xfffb8034, 4, base=16 +-; ========== Register definition for PWMC_CH3 peripheral ========== +-sfr = "PWMC_CH3_CMR", "Memory", 0xfffcc260, 4, base=16 +-sfr = "PWMC_CH3_CMR.CPRE", "Memory", 0xfffcc260, 4, base=16, bitRange=0-3 +-sfr = "PWMC_CH3_CMR.CALG", "Memory", 0xfffcc260, 4, base=16, bitRange=8 +-sfr = "PWMC_CH3_CMR.CPOL", "Memory", 0xfffcc260, 4, base=16, bitRange=9 +-sfr = "PWMC_CH3_CMR.CPD", "Memory", 0xfffcc260, 4, base=16, bitRange=10 +-sfr = "PWMC_CH3_CDTYR", "Memory", 0xfffcc264, 4, base=16 +-sfr = "PWMC_CH3_CDTYR.CDTY", "Memory", 0xfffcc264, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH3_CPRDR", "Memory", 0xfffcc268, 4, base=16 +-sfr = "PWMC_CH3_CPRDR.CPRD", "Memory", 0xfffcc268, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH3_CCNTR", "Memory", 0xfffcc26c, 4, base=16 +-sfr = "PWMC_CH3_CCNTR.CCNT", "Memory", 0xfffcc26c, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH3_CUPDR", "Memory", 0xfffcc270, 4, base=16 +-sfr = "PWMC_CH3_CUPDR.CUPD", "Memory", 0xfffcc270, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH3_Reserved", "Memory", 0xfffcc274, 4, base=16 +-; ========== Register definition for PWMC_CH2 peripheral ========== +-sfr = "PWMC_CH2_CMR", "Memory", 0xfffcc240, 4, base=16 +-sfr = "PWMC_CH2_CMR.CPRE", "Memory", 0xfffcc240, 4, base=16, bitRange=0-3 +-sfr = "PWMC_CH2_CMR.CALG", "Memory", 0xfffcc240, 4, base=16, bitRange=8 +-sfr = "PWMC_CH2_CMR.CPOL", "Memory", 0xfffcc240, 4, base=16, bitRange=9 +-sfr = "PWMC_CH2_CMR.CPD", "Memory", 0xfffcc240, 4, base=16, bitRange=10 +-sfr = "PWMC_CH2_CDTYR", "Memory", 0xfffcc244, 4, base=16 +-sfr = "PWMC_CH2_CDTYR.CDTY", "Memory", 0xfffcc244, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH2_CPRDR", "Memory", 0xfffcc248, 4, base=16 +-sfr = "PWMC_CH2_CPRDR.CPRD", "Memory", 0xfffcc248, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH2_CCNTR", "Memory", 0xfffcc24c, 4, base=16 +-sfr = "PWMC_CH2_CCNTR.CCNT", "Memory", 0xfffcc24c, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH2_CUPDR", "Memory", 0xfffcc250, 4, base=16 +-sfr = "PWMC_CH2_CUPDR.CUPD", "Memory", 0xfffcc250, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH2_Reserved", "Memory", 0xfffcc254, 4, base=16 +-; ========== Register definition for PWMC_CH1 peripheral ========== +-sfr = "PWMC_CH1_CMR", "Memory", 0xfffcc220, 4, base=16 +-sfr = "PWMC_CH1_CMR.CPRE", "Memory", 0xfffcc220, 4, base=16, bitRange=0-3 +-sfr = "PWMC_CH1_CMR.CALG", "Memory", 0xfffcc220, 4, base=16, bitRange=8 +-sfr = "PWMC_CH1_CMR.CPOL", "Memory", 0xfffcc220, 4, base=16, bitRange=9 +-sfr = "PWMC_CH1_CMR.CPD", "Memory", 0xfffcc220, 4, base=16, bitRange=10 +-sfr = "PWMC_CH1_CDTYR", "Memory", 0xfffcc224, 4, base=16 +-sfr = "PWMC_CH1_CDTYR.CDTY", "Memory", 0xfffcc224, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH1_CPRDR", "Memory", 0xfffcc228, 4, base=16 +-sfr = "PWMC_CH1_CPRDR.CPRD", "Memory", 0xfffcc228, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH1_CCNTR", "Memory", 0xfffcc22c, 4, base=16 +-sfr = "PWMC_CH1_CCNTR.CCNT", "Memory", 0xfffcc22c, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH1_CUPDR", "Memory", 0xfffcc230, 4, base=16 +-sfr = "PWMC_CH1_CUPDR.CUPD", "Memory", 0xfffcc230, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH1_Reserved", "Memory", 0xfffcc234, 4, base=16 +-; ========== Register definition for PWMC_CH0 peripheral ========== +-sfr = "PWMC_CH0_CMR", "Memory", 0xfffcc200, 4, base=16 +-sfr = "PWMC_CH0_CMR.CPRE", "Memory", 0xfffcc200, 4, base=16, bitRange=0-3 +-sfr = "PWMC_CH0_CMR.CALG", "Memory", 0xfffcc200, 4, base=16, bitRange=8 +-sfr = "PWMC_CH0_CMR.CPOL", "Memory", 0xfffcc200, 4, base=16, bitRange=9 +-sfr = "PWMC_CH0_CMR.CPD", "Memory", 0xfffcc200, 4, base=16, bitRange=10 +-sfr = "PWMC_CH0_CDTYR", "Memory", 0xfffcc204, 4, base=16 +-sfr = "PWMC_CH0_CDTYR.CDTY", "Memory", 0xfffcc204, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH0_CPRDR", "Memory", 0xfffcc208, 4, base=16 +-sfr = "PWMC_CH0_CPRDR.CPRD", "Memory", 0xfffcc208, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH0_CCNTR", "Memory", 0xfffcc20c, 4, base=16 +-sfr = "PWMC_CH0_CCNTR.CCNT", "Memory", 0xfffcc20c, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH0_CUPDR", "Memory", 0xfffcc210, 4, base=16 +-sfr = "PWMC_CH0_CUPDR.CUPD", "Memory", 0xfffcc210, 4, base=16, bitRange=0-31 +-sfr = "PWMC_CH0_Reserved", "Memory", 0xfffcc214, 4, base=16 +-; ========== Register definition for PWMC peripheral ========== +-sfr = "PWMC_MR", "Memory", 0xfffcc000, 4, base=16 +-sfr = "PWMC_MR.DIVA", "Memory", 0xfffcc000, 4, base=16, bitRange=0-7 +-sfr = "PWMC_MR.PREA", "Memory", 0xfffcc000, 4, base=16, bitRange=8-11 +-sfr = "PWMC_MR.DIVB", "Memory", 0xfffcc000, 4, base=16, bitRange=16-23 +-sfr = "PWMC_MR.PREB", "Memory", 0xfffcc000, 4, base=16, bitRange=24-27 +-sfr = "PWMC_ENA", "Memory", 0xfffcc004, 4, base=16 +-sfr = "PWMC_ENA.CHID0", "Memory", 0xfffcc004, 4, base=16, bitRange=0 +-sfr = "PWMC_ENA.CHID1", "Memory", 0xfffcc004, 4, base=16, bitRange=1 +-sfr = "PWMC_ENA.CHID2", "Memory", 0xfffcc004, 4, base=16, bitRange=2 +-sfr = "PWMC_ENA.CHID3", "Memory", 0xfffcc004, 4, base=16, bitRange=3 +-sfr = "PWMC_DIS", "Memory", 0xfffcc008, 4, base=16 +-sfr = "PWMC_DIS.CHID0", "Memory", 0xfffcc008, 4, base=16, bitRange=0 +-sfr = "PWMC_DIS.CHID1", "Memory", 0xfffcc008, 4, base=16, bitRange=1 +-sfr = "PWMC_DIS.CHID2", "Memory", 0xfffcc008, 4, base=16, bitRange=2 +-sfr = "PWMC_DIS.CHID3", "Memory", 0xfffcc008, 4, base=16, bitRange=3 +-sfr = "PWMC_SR", "Memory", 0xfffcc00c, 4, base=16 +-sfr = "PWMC_SR.CHID0", "Memory", 0xfffcc00c, 4, base=16, bitRange=0 +-sfr = "PWMC_SR.CHID1", "Memory", 0xfffcc00c, 4, base=16, bitRange=1 +-sfr = "PWMC_SR.CHID2", "Memory", 0xfffcc00c, 4, base=16, bitRange=2 +-sfr = "PWMC_SR.CHID3", "Memory", 0xfffcc00c, 4, base=16, bitRange=3 +-sfr = "PWMC_IER", "Memory", 0xfffcc010, 4, base=16 +-sfr = "PWMC_IER.CHID0", "Memory", 0xfffcc010, 4, base=16, bitRange=0 +-sfr = "PWMC_IER.CHID1", "Memory", 0xfffcc010, 4, base=16, bitRange=1 +-sfr = "PWMC_IER.CHID2", "Memory", 0xfffcc010, 4, base=16, bitRange=2 +-sfr = "PWMC_IER.CHID3", "Memory", 0xfffcc010, 4, base=16, bitRange=3 +-sfr = "PWMC_IDR", "Memory", 0xfffcc014, 4, base=16 +-sfr = "PWMC_IDR.CHID0", "Memory", 0xfffcc014, 4, base=16, bitRange=0 +-sfr = "PWMC_IDR.CHID1", "Memory", 0xfffcc014, 4, base=16, bitRange=1 +-sfr = "PWMC_IDR.CHID2", "Memory", 0xfffcc014, 4, base=16, bitRange=2 +-sfr = "PWMC_IDR.CHID3", "Memory", 0xfffcc014, 4, base=16, bitRange=3 +-sfr = "PWMC_IMR", "Memory", 0xfffcc018, 4, base=16 +-sfr = "PWMC_IMR.CHID0", "Memory", 0xfffcc018, 4, base=16, bitRange=0 +-sfr = "PWMC_IMR.CHID1", "Memory", 0xfffcc018, 4, base=16, bitRange=1 +-sfr = "PWMC_IMR.CHID2", "Memory", 0xfffcc018, 4, base=16, bitRange=2 +-sfr = "PWMC_IMR.CHID3", "Memory", 0xfffcc018, 4, base=16, bitRange=3 +-sfr = "PWMC_ISR", "Memory", 0xfffcc01c, 4, base=16 +-sfr = "PWMC_ISR.CHID0", "Memory", 0xfffcc01c, 4, base=16, bitRange=0 +-sfr = "PWMC_ISR.CHID1", "Memory", 0xfffcc01c, 4, base=16, bitRange=1 +-sfr = "PWMC_ISR.CHID2", "Memory", 0xfffcc01c, 4, base=16, bitRange=2 +-sfr = "PWMC_ISR.CHID3", "Memory", 0xfffcc01c, 4, base=16, bitRange=3 +-sfr = "PWMC_VR", "Memory", 0xfffcc0fc, 4, base=16 +-; ========== Register definition for UDP peripheral ========== +-sfr = "UDP_NUM", "Memory", 0xfffb0000, 4, base=16 +-sfr = "UDP_NUM.NUM", "Memory", 0xfffb0000, 4, base=16, bitRange=0-10 +-sfr = "UDP_NUM.ERR", "Memory", 0xfffb0000, 4, base=16, bitRange=16 +-sfr = "UDP_NUM.OK", "Memory", 0xfffb0000, 4, base=16, bitRange=17 +-sfr = "UDP_GLBSTATE", "Memory", 0xfffb0004, 4, base=16 +-sfr = "UDP_GLBSTATE.FADDEN", "Memory", 0xfffb0004, 4, base=16, bitRange=0 +-sfr = "UDP_GLBSTATE.CONFG", "Memory", 0xfffb0004, 4, base=16, bitRange=1 +-sfr = "UDP_GLBSTATE.ESR", "Memory", 0xfffb0004, 4, base=16, bitRange=2 +-sfr = "UDP_GLBSTATE.RSMINPR", "Memory", 0xfffb0004, 4, base=16, bitRange=3 +-sfr = "UDP_GLBSTATE.RMWUPE", "Memory", 0xfffb0004, 4, base=16, bitRange=4 +-sfr = "UDP_FADDR", "Memory", 0xfffb0008, 4, base=16 +-sfr = "UDP_FADDR.FADD", "Memory", 0xfffb0008, 4, base=16, bitRange=0-7 +-sfr = "UDP_FADDR.FEN", "Memory", 0xfffb0008, 4, base=16, bitRange=8 +-sfr = "UDP_IER", "Memory", 0xfffb0010, 4, base=16 +-sfr = "UDP_IER.EPINT0", "Memory", 0xfffb0010, 4, base=16, bitRange=0 +-sfr = "UDP_IER.EPINT1", "Memory", 0xfffb0010, 4, base=16, bitRange=1 +-sfr = "UDP_IER.EPINT2", "Memory", 0xfffb0010, 4, base=16, bitRange=2 +-sfr = "UDP_IER.EPINT3", "Memory", 0xfffb0010, 4, base=16, bitRange=3 +-sfr = "UDP_IER.EPINT4", "Memory", 0xfffb0010, 4, base=16, bitRange=4 +-sfr = "UDP_IER.EPINT5", "Memory", 0xfffb0010, 4, base=16, bitRange=5 +-sfr = "UDP_IER.RXSUSP", "Memory", 0xfffb0010, 4, base=16, bitRange=8 +-sfr = "UDP_IER.RXRSM", "Memory", 0xfffb0010, 4, base=16, bitRange=9 +-sfr = "UDP_IER.EXTRSM", "Memory", 0xfffb0010, 4, base=16, bitRange=10 +-sfr = "UDP_IER.SOFINT", "Memory", 0xfffb0010, 4, base=16, bitRange=11 +-sfr = "UDP_IER.WAKEUP", "Memory", 0xfffb0010, 4, base=16, bitRange=13 +-sfr = "UDP_IDR", "Memory", 0xfffb0014, 4, base=16 +-sfr = "UDP_IDR.EPINT0", "Memory", 0xfffb0014, 4, base=16, bitRange=0 +-sfr = "UDP_IDR.EPINT1", "Memory", 0xfffb0014, 4, base=16, bitRange=1 +-sfr = "UDP_IDR.EPINT2", "Memory", 0xfffb0014, 4, base=16, bitRange=2 +-sfr = "UDP_IDR.EPINT3", "Memory", 0xfffb0014, 4, base=16, bitRange=3 +-sfr = "UDP_IDR.EPINT4", "Memory", 0xfffb0014, 4, base=16, bitRange=4 +-sfr = "UDP_IDR.EPINT5", "Memory", 0xfffb0014, 4, base=16, bitRange=5 +-sfr = "UDP_IDR.RXSUSP", "Memory", 0xfffb0014, 4, base=16, bitRange=8 +-sfr = "UDP_IDR.RXRSM", "Memory", 0xfffb0014, 4, base=16, bitRange=9 +-sfr = "UDP_IDR.EXTRSM", "Memory", 0xfffb0014, 4, base=16, bitRange=10 +-sfr = "UDP_IDR.SOFINT", "Memory", 0xfffb0014, 4, base=16, bitRange=11 +-sfr = "UDP_IDR.WAKEUP", "Memory", 0xfffb0014, 4, base=16, bitRange=13 +-sfr = "UDP_IMR", "Memory", 0xfffb0018, 4, base=16 +-sfr = "UDP_IMR.EPINT0", "Memory", 0xfffb0018, 4, base=16, bitRange=0 +-sfr = "UDP_IMR.EPINT1", "Memory", 0xfffb0018, 4, base=16, bitRange=1 +-sfr = "UDP_IMR.EPINT2", "Memory", 0xfffb0018, 4, base=16, bitRange=2 +-sfr = "UDP_IMR.EPINT3", "Memory", 0xfffb0018, 4, base=16, bitRange=3 +-sfr = "UDP_IMR.EPINT4", "Memory", 0xfffb0018, 4, base=16, bitRange=4 +-sfr = "UDP_IMR.EPINT5", "Memory", 0xfffb0018, 4, base=16, bitRange=5 +-sfr = "UDP_IMR.RXSUSP", "Memory", 0xfffb0018, 4, base=16, bitRange=8 +-sfr = "UDP_IMR.RXRSM", "Memory", 0xfffb0018, 4, base=16, bitRange=9 +-sfr = "UDP_IMR.EXTRSM", "Memory", 0xfffb0018, 4, base=16, bitRange=10 +-sfr = "UDP_IMR.SOFINT", "Memory", 0xfffb0018, 4, base=16, bitRange=11 +-sfr = "UDP_IMR.WAKEUP", "Memory", 0xfffb0018, 4, base=16, bitRange=13 +-sfr = "UDP_ISR", "Memory", 0xfffb001c, 4, base=16 +-sfr = "UDP_ISR.EPINT0", "Memory", 0xfffb001c, 4, base=16, bitRange=0 +-sfr = "UDP_ISR.EPINT1", "Memory", 0xfffb001c, 4, base=16, bitRange=1 +-sfr = "UDP_ISR.EPINT2", "Memory", 0xfffb001c, 4, base=16, bitRange=2 +-sfr = "UDP_ISR.EPINT3", "Memory", 0xfffb001c, 4, base=16, bitRange=3 +-sfr = "UDP_ISR.EPINT4", "Memory", 0xfffb001c, 4, base=16, bitRange=4 +-sfr = "UDP_ISR.EPINT5", "Memory", 0xfffb001c, 4, base=16, bitRange=5 +-sfr = "UDP_ISR.RXSUSP", "Memory", 0xfffb001c, 4, base=16, bitRange=8 +-sfr = "UDP_ISR.RXRSM", "Memory", 0xfffb001c, 4, base=16, bitRange=9 +-sfr = "UDP_ISR.EXTRSM", "Memory", 0xfffb001c, 4, base=16, bitRange=10 +-sfr = "UDP_ISR.SOFINT", "Memory", 0xfffb001c, 4, base=16, bitRange=11 +-sfr = "UDP_ISR.ENDBUSRES", "Memory", 0xfffb001c, 4, base=16, bitRange=12 +-sfr = "UDP_ISR.WAKEUP", "Memory", 0xfffb001c, 4, base=16, bitRange=13 +-sfr = "UDP_ICR", "Memory", 0xfffb0020, 4, base=16 +-sfr = "UDP_ICR.EPINT0", "Memory", 0xfffb0020, 4, base=16, bitRange=0 +-sfr = "UDP_ICR.EPINT1", "Memory", 0xfffb0020, 4, base=16, bitRange=1 +-sfr = "UDP_ICR.EPINT2", "Memory", 0xfffb0020, 4, base=16, bitRange=2 +-sfr = "UDP_ICR.EPINT3", "Memory", 0xfffb0020, 4, base=16, bitRange=3 +-sfr = "UDP_ICR.EPINT4", "Memory", 0xfffb0020, 4, base=16, bitRange=4 +-sfr = "UDP_ICR.EPINT5", "Memory", 0xfffb0020, 4, base=16, bitRange=5 +-sfr = "UDP_ICR.RXSUSP", "Memory", 0xfffb0020, 4, base=16, bitRange=8 +-sfr = "UDP_ICR.RXRSM", "Memory", 0xfffb0020, 4, base=16, bitRange=9 +-sfr = "UDP_ICR.EXTRSM", "Memory", 0xfffb0020, 4, base=16, bitRange=10 +-sfr = "UDP_ICR.SOFINT", "Memory", 0xfffb0020, 4, base=16, bitRange=11 +-sfr = "UDP_ICR.WAKEUP", "Memory", 0xfffb0020, 4, base=16, bitRange=13 +-sfr = "UDP_RSTEP", "Memory", 0xfffb0028, 4, base=16 +-sfr = "UDP_RSTEP.EP0", "Memory", 0xfffb0028, 4, base=16, bitRange=0 +-sfr = "UDP_RSTEP.EP1", "Memory", 0xfffb0028, 4, base=16, bitRange=1 +-sfr = "UDP_RSTEP.EP2", "Memory", 0xfffb0028, 4, base=16, bitRange=2 +-sfr = "UDP_RSTEP.EP3", "Memory", 0xfffb0028, 4, base=16, bitRange=3 +-sfr = "UDP_RSTEP.EP4", "Memory", 0xfffb0028, 4, base=16, bitRange=4 +-sfr = "UDP_RSTEP.EP5", "Memory", 0xfffb0028, 4, base=16, bitRange=5 +-sfr = "UDP_CSR", "Memory", 0xfffb0030, 4, base=16 +-sfr = "UDP_CSR.TXCOMP", "Memory", 0xfffb0030, 4, base=16, bitRange=0 +-sfr = "UDP_CSR.BK0", "Memory", 0xfffb0030, 4, base=16, bitRange=1 +-sfr = "UDP_CSR.RXSETUP", "Memory", 0xfffb0030, 4, base=16, bitRange=2 +-sfr = "UDP_CSR.ISOERROR", "Memory", 0xfffb0030, 4, base=16, bitRange=3 +-sfr = "UDP_CSR.TXPKTRDY", "Memory", 0xfffb0030, 4, base=16, bitRange=4 +-sfr = "UDP_CSR.FORCESTALL", "Memory", 0xfffb0030, 4, base=16, bitRange=5 +-sfr = "UDP_CSR.BK1", "Memory", 0xfffb0030, 4, base=16, bitRange=6 +-sfr = "UDP_CSR.DIR", "Memory", 0xfffb0030, 4, base=16, bitRange=7 +-sfr = "UDP_CSR.EPTYPE", "Memory", 0xfffb0030, 4, base=16, bitRange=8-10 +-sfr = "UDP_CSR.DTGLE", "Memory", 0xfffb0030, 4, base=16, bitRange=11 +-sfr = "UDP_CSR.EPEDS", "Memory", 0xfffb0030, 4, base=16, bitRange=15 +-sfr = "UDP_CSR.RXBYTECNT", "Memory", 0xfffb0030, 4, base=16, bitRange=16-26 +-sfr = "UDP_FDR", "Memory", 0xfffb0050, 4, base=16 +-sfr = "UDP_TXVC", "Memory", 0xfffb0074, 4, base=16 +-sfr = "UDP_TXVC.TXVDIS", "Memory", 0xfffb0074, 4, base=16, bitRange=8 +-sfr = "UDP_TXVC.PUON", "Memory", 0xfffb0074, 4, base=16, bitRange=9 +-; ========== Register definition for TC0 peripheral ========== +-sfr = "TC0_CCR", "Memory", 0xfffa0000, 4, base=16 +-sfr = "TC0_CCR.CLKEN", "Memory", 0xfffa0000, 4, base=16, bitRange=0 +-sfr = "TC0_CCR.CLKDIS", "Memory", 0xfffa0000, 4, base=16, bitRange=1 +-sfr = "TC0_CCR.SWTRG", "Memory", 0xfffa0000, 4, base=16, bitRange=2 +-sfr = "TC0_CMR", "Memory", 0xfffa0004, 4, base=16 +-sfr = "TC0_CMR.CLKS", "Memory", 0xfffa0004, 4, base=16, bitRange=0-2 +-sfr = "TC0_CMR.CLKI", "Memory", 0xfffa0004, 4, base=16, bitRange=3 +-sfr = "TC0_CMR.BURST", "Memory", 0xfffa0004, 4, base=16, bitRange=4-5 +-sfr = "TC0_CMR.CPCSTOP", "Memory", 0xfffa0004, 4, base=16, bitRange=6 +-sfr = "TC0_CMR.LDBSTOP", "Memory", 0xfffa0004, 4, base=16, bitRange=6 +-sfr = "TC0_CMR.CPCDIS", "Memory", 0xfffa0004, 4, base=16, bitRange=7 +-sfr = "TC0_CMR.LDBDIS", "Memory", 0xfffa0004, 4, base=16, bitRange=7 +-sfr = "TC0_CMR.ETRGEDG", "Memory", 0xfffa0004, 4, base=16, bitRange=8-9 +-sfr = "TC0_CMR.EEVTEDG", "Memory", 0xfffa0004, 4, base=16, bitRange=8-9 +-sfr = "TC0_CMR.EEVT", "Memory", 0xfffa0004, 4, base=16, bitRange=10-11 +-sfr = "TC0_CMR.ABETRG", "Memory", 0xfffa0004, 4, base=16, bitRange=10 +-sfr = "TC0_CMR.ENETRG", "Memory", 0xfffa0004, 4, base=16, bitRange=12 +-sfr = "TC0_CMR.WAVESEL", "Memory", 0xfffa0004, 4, base=16, bitRange=13-14 +-sfr = "TC0_CMR.CPCTRG", "Memory", 0xfffa0004, 4, base=16, bitRange=14 +-sfr = "TC0_CMR.WAVE", "Memory", 0xfffa0004, 4, base=16, bitRange=15 +-sfr = "TC0_CMR.ACPA", "Memory", 0xfffa0004, 4, base=16, bitRange=16-17 +-sfr = "TC0_CMR.LDRA", "Memory", 0xfffa0004, 4, base=16, bitRange=16-17 +-sfr = "TC0_CMR.ACPC", "Memory", 0xfffa0004, 4, base=16, bitRange=18-19 +-sfr = "TC0_CMR.LDRB", "Memory", 0xfffa0004, 4, base=16, bitRange=18-19 +-sfr = "TC0_CMR.AEEVT", "Memory", 0xfffa0004, 4, base=16, bitRange=20-21 +-sfr = "TC0_CMR.ASWTRG", "Memory", 0xfffa0004, 4, base=16, bitRange=22-23 +-sfr = "TC0_CMR.BCPB", "Memory", 0xfffa0004, 4, base=16, bitRange=24-25 +-sfr = "TC0_CMR.BCPC", "Memory", 0xfffa0004, 4, base=16, bitRange=26-27 +-sfr = "TC0_CMR.BEEVT", "Memory", 0xfffa0004, 4, base=16, bitRange=28-29 +-sfr = "TC0_CMR.BSWTRG", "Memory", 0xfffa0004, 4, base=16, bitRange=30-31 +-sfr = "TC0_CV", "Memory", 0xfffa0010, 4, base=16 +-sfr = "TC0_RA", "Memory", 0xfffa0014, 4, base=16 +-sfr = "TC0_RB", "Memory", 0xfffa0018, 4, base=16 +-sfr = "TC0_RC", "Memory", 0xfffa001c, 4, base=16 +-sfr = "TC0_SR", "Memory", 0xfffa0020, 4, base=16 +-sfr = "TC0_SR.COVFS", "Memory", 0xfffa0020, 4, base=16, bitRange=0 +-sfr = "TC0_SR.LOVRS", "Memory", 0xfffa0020, 4, base=16, bitRange=1 +-sfr = "TC0_SR.CPAS", "Memory", 0xfffa0020, 4, base=16, bitRange=2 +-sfr = "TC0_SR.CPBS", "Memory", 0xfffa0020, 4, base=16, bitRange=3 +-sfr = "TC0_SR.CPCS", "Memory", 0xfffa0020, 4, base=16, bitRange=4 +-sfr = "TC0_SR.LDRAS", "Memory", 0xfffa0020, 4, base=16, bitRange=5 +-sfr = "TC0_SR.LDRBS", "Memory", 0xfffa0020, 4, base=16, bitRange=6 +-sfr = "TC0_SR.ETRGS", "Memory", 0xfffa0020, 4, base=16, bitRange=7 +-sfr = "TC0_SR.CLKSTA", "Memory", 0xfffa0020, 4, base=16, bitRange=16 +-sfr = "TC0_SR.MTIOA", "Memory", 0xfffa0020, 4, base=16, bitRange=17 +-sfr = "TC0_SR.MTIOB", "Memory", 0xfffa0020, 4, base=16, bitRange=18 +-sfr = "TC0_IER", "Memory", 0xfffa0024, 4, base=16 +-sfr = "TC0_IER.COVFS", "Memory", 0xfffa0024, 4, base=16, bitRange=0 +-sfr = "TC0_IER.LOVRS", "Memory", 0xfffa0024, 4, base=16, bitRange=1 +-sfr = "TC0_IER.CPAS", "Memory", 0xfffa0024, 4, base=16, bitRange=2 +-sfr = "TC0_IER.CPBS", "Memory", 0xfffa0024, 4, base=16, bitRange=3 +-sfr = "TC0_IER.CPCS", "Memory", 0xfffa0024, 4, base=16, bitRange=4 +-sfr = "TC0_IER.LDRAS", "Memory", 0xfffa0024, 4, base=16, bitRange=5 +-sfr = "TC0_IER.LDRBS", "Memory", 0xfffa0024, 4, base=16, bitRange=6 +-sfr = "TC0_IER.ETRGS", "Memory", 0xfffa0024, 4, base=16, bitRange=7 +-sfr = "TC0_IDR", "Memory", 0xfffa0028, 4, base=16 +-sfr = "TC0_IDR.COVFS", "Memory", 0xfffa0028, 4, base=16, bitRange=0 +-sfr = "TC0_IDR.LOVRS", "Memory", 0xfffa0028, 4, base=16, bitRange=1 +-sfr = "TC0_IDR.CPAS", "Memory", 0xfffa0028, 4, base=16, bitRange=2 +-sfr = "TC0_IDR.CPBS", "Memory", 0xfffa0028, 4, base=16, bitRange=3 +-sfr = "TC0_IDR.CPCS", "Memory", 0xfffa0028, 4, base=16, bitRange=4 +-sfr = "TC0_IDR.LDRAS", "Memory", 0xfffa0028, 4, base=16, bitRange=5 +-sfr = "TC0_IDR.LDRBS", "Memory", 0xfffa0028, 4, base=16, bitRange=6 +-sfr = "TC0_IDR.ETRGS", "Memory", 0xfffa0028, 4, base=16, bitRange=7 +-sfr = "TC0_IMR", "Memory", 0xfffa002c, 4, base=16 +-sfr = "TC0_IMR.COVFS", "Memory", 0xfffa002c, 4, base=16, bitRange=0 +-sfr = "TC0_IMR.LOVRS", "Memory", 0xfffa002c, 4, base=16, bitRange=1 +-sfr = "TC0_IMR.CPAS", "Memory", 0xfffa002c, 4, base=16, bitRange=2 +-sfr = "TC0_IMR.CPBS", "Memory", 0xfffa002c, 4, base=16, bitRange=3 +-sfr = "TC0_IMR.CPCS", "Memory", 0xfffa002c, 4, base=16, bitRange=4 +-sfr = "TC0_IMR.LDRAS", "Memory", 0xfffa002c, 4, base=16, bitRange=5 +-sfr = "TC0_IMR.LDRBS", "Memory", 0xfffa002c, 4, base=16, bitRange=6 +-sfr = "TC0_IMR.ETRGS", "Memory", 0xfffa002c, 4, base=16, bitRange=7 +-; ========== Register definition for TC1 peripheral ========== +-sfr = "TC1_CCR", "Memory", 0xfffa0040, 4, base=16 +-sfr = "TC1_CCR.CLKEN", "Memory", 0xfffa0040, 4, base=16, bitRange=0 +-sfr = "TC1_CCR.CLKDIS", "Memory", 0xfffa0040, 4, base=16, bitRange=1 +-sfr = "TC1_CCR.SWTRG", "Memory", 0xfffa0040, 4, base=16, bitRange=2 +-sfr = "TC1_CMR", "Memory", 0xfffa0044, 4, base=16 +-sfr = "TC1_CMR.CLKS", "Memory", 0xfffa0044, 4, base=16, bitRange=0-2 +-sfr = "TC1_CMR.CLKI", "Memory", 0xfffa0044, 4, base=16, bitRange=3 +-sfr = "TC1_CMR.BURST", "Memory", 0xfffa0044, 4, base=16, bitRange=4-5 +-sfr = "TC1_CMR.CPCSTOP", "Memory", 0xfffa0044, 4, base=16, bitRange=6 +-sfr = "TC1_CMR.LDBSTOP", "Memory", 0xfffa0044, 4, base=16, bitRange=6 +-sfr = "TC1_CMR.CPCDIS", "Memory", 0xfffa0044, 4, base=16, bitRange=7 +-sfr = "TC1_CMR.LDBDIS", "Memory", 0xfffa0044, 4, base=16, bitRange=7 +-sfr = "TC1_CMR.ETRGEDG", "Memory", 0xfffa0044, 4, base=16, bitRange=8-9 +-sfr = "TC1_CMR.EEVTEDG", "Memory", 0xfffa0044, 4, base=16, bitRange=8-9 +-sfr = "TC1_CMR.EEVT", "Memory", 0xfffa0044, 4, base=16, bitRange=10-11 +-sfr = "TC1_CMR.ABETRG", "Memory", 0xfffa0044, 4, base=16, bitRange=10 +-sfr = "TC1_CMR.ENETRG", "Memory", 0xfffa0044, 4, base=16, bitRange=12 +-sfr = "TC1_CMR.WAVESEL", "Memory", 0xfffa0044, 4, base=16, bitRange=13-14 +-sfr = "TC1_CMR.CPCTRG", "Memory", 0xfffa0044, 4, base=16, bitRange=14 +-sfr = "TC1_CMR.WAVE", "Memory", 0xfffa0044, 4, base=16, bitRange=15 +-sfr = "TC1_CMR.ACPA", "Memory", 0xfffa0044, 4, base=16, bitRange=16-17 +-sfr = "TC1_CMR.LDRA", "Memory", 0xfffa0044, 4, base=16, bitRange=16-17 +-sfr = "TC1_CMR.ACPC", "Memory", 0xfffa0044, 4, base=16, bitRange=18-19 +-sfr = "TC1_CMR.LDRB", "Memory", 0xfffa0044, 4, base=16, bitRange=18-19 +-sfr = "TC1_CMR.AEEVT", "Memory", 0xfffa0044, 4, base=16, bitRange=20-21 +-sfr = "TC1_CMR.ASWTRG", "Memory", 0xfffa0044, 4, base=16, bitRange=22-23 +-sfr = "TC1_CMR.BCPB", "Memory", 0xfffa0044, 4, base=16, bitRange=24-25 +-sfr = "TC1_CMR.BCPC", "Memory", 0xfffa0044, 4, base=16, bitRange=26-27 +-sfr = "TC1_CMR.BEEVT", "Memory", 0xfffa0044, 4, base=16, bitRange=28-29 +-sfr = "TC1_CMR.BSWTRG", "Memory", 0xfffa0044, 4, base=16, bitRange=30-31 +-sfr = "TC1_CV", "Memory", 0xfffa0050, 4, base=16 +-sfr = "TC1_RA", "Memory", 0xfffa0054, 4, base=16 +-sfr = "TC1_RB", "Memory", 0xfffa0058, 4, base=16 +-sfr = "TC1_RC", "Memory", 0xfffa005c, 4, base=16 +-sfr = "TC1_SR", "Memory", 0xfffa0060, 4, base=16 +-sfr = "TC1_SR.COVFS", "Memory", 0xfffa0060, 4, base=16, bitRange=0 +-sfr = "TC1_SR.LOVRS", "Memory", 0xfffa0060, 4, base=16, bitRange=1 +-sfr = "TC1_SR.CPAS", "Memory", 0xfffa0060, 4, base=16, bitRange=2 +-sfr = "TC1_SR.CPBS", "Memory", 0xfffa0060, 4, base=16, bitRange=3 +-sfr = "TC1_SR.CPCS", "Memory", 0xfffa0060, 4, base=16, bitRange=4 +-sfr = "TC1_SR.LDRAS", "Memory", 0xfffa0060, 4, base=16, bitRange=5 +-sfr = "TC1_SR.LDRBS", "Memory", 0xfffa0060, 4, base=16, bitRange=6 +-sfr = "TC1_SR.ETRGS", "Memory", 0xfffa0060, 4, base=16, bitRange=7 +-sfr = "TC1_SR.CLKSTA", "Memory", 0xfffa0060, 4, base=16, bitRange=16 +-sfr = "TC1_SR.MTIOA", "Memory", 0xfffa0060, 4, base=16, bitRange=17 +-sfr = "TC1_SR.MTIOB", "Memory", 0xfffa0060, 4, base=16, bitRange=18 +-sfr = "TC1_IER", "Memory", 0xfffa0064, 4, base=16 +-sfr = "TC1_IER.COVFS", "Memory", 0xfffa0064, 4, base=16, bitRange=0 +-sfr = "TC1_IER.LOVRS", "Memory", 0xfffa0064, 4, base=16, bitRange=1 +-sfr = "TC1_IER.CPAS", "Memory", 0xfffa0064, 4, base=16, bitRange=2 +-sfr = "TC1_IER.CPBS", "Memory", 0xfffa0064, 4, base=16, bitRange=3 +-sfr = "TC1_IER.CPCS", "Memory", 0xfffa0064, 4, base=16, bitRange=4 +-sfr = "TC1_IER.LDRAS", "Memory", 0xfffa0064, 4, base=16, bitRange=5 +-sfr = "TC1_IER.LDRBS", "Memory", 0xfffa0064, 4, base=16, bitRange=6 +-sfr = "TC1_IER.ETRGS", "Memory", 0xfffa0064, 4, base=16, bitRange=7 +-sfr = "TC1_IDR", "Memory", 0xfffa0068, 4, base=16 +-sfr = "TC1_IDR.COVFS", "Memory", 0xfffa0068, 4, base=16, bitRange=0 +-sfr = "TC1_IDR.LOVRS", "Memory", 0xfffa0068, 4, base=16, bitRange=1 +-sfr = "TC1_IDR.CPAS", "Memory", 0xfffa0068, 4, base=16, bitRange=2 +-sfr = "TC1_IDR.CPBS", "Memory", 0xfffa0068, 4, base=16, bitRange=3 +-sfr = "TC1_IDR.CPCS", "Memory", 0xfffa0068, 4, base=16, bitRange=4 +-sfr = "TC1_IDR.LDRAS", "Memory", 0xfffa0068, 4, base=16, bitRange=5 +-sfr = "TC1_IDR.LDRBS", "Memory", 0xfffa0068, 4, base=16, bitRange=6 +-sfr = "TC1_IDR.ETRGS", "Memory", 0xfffa0068, 4, base=16, bitRange=7 +-sfr = "TC1_IMR", "Memory", 0xfffa006c, 4, base=16 +-sfr = "TC1_IMR.COVFS", "Memory", 0xfffa006c, 4, base=16, bitRange=0 +-sfr = "TC1_IMR.LOVRS", "Memory", 0xfffa006c, 4, base=16, bitRange=1 +-sfr = "TC1_IMR.CPAS", "Memory", 0xfffa006c, 4, base=16, bitRange=2 +-sfr = "TC1_IMR.CPBS", "Memory", 0xfffa006c, 4, base=16, bitRange=3 +-sfr = "TC1_IMR.CPCS", "Memory", 0xfffa006c, 4, base=16, bitRange=4 +-sfr = "TC1_IMR.LDRAS", "Memory", 0xfffa006c, 4, base=16, bitRange=5 +-sfr = "TC1_IMR.LDRBS", "Memory", 0xfffa006c, 4, base=16, bitRange=6 +-sfr = "TC1_IMR.ETRGS", "Memory", 0xfffa006c, 4, base=16, bitRange=7 +-; ========== Register definition for TC2 peripheral ========== +-sfr = "TC2_CCR", "Memory", 0xfffa0080, 4, base=16 +-sfr = "TC2_CCR.CLKEN", "Memory", 0xfffa0080, 4, base=16, bitRange=0 +-sfr = "TC2_CCR.CLKDIS", "Memory", 0xfffa0080, 4, base=16, bitRange=1 +-sfr = "TC2_CCR.SWTRG", "Memory", 0xfffa0080, 4, base=16, bitRange=2 +-sfr = "TC2_CMR", "Memory", 0xfffa0084, 4, base=16 +-sfr = "TC2_CMR.CLKS", "Memory", 0xfffa0084, 4, base=16, bitRange=0-2 +-sfr = "TC2_CMR.CLKI", "Memory", 0xfffa0084, 4, base=16, bitRange=3 +-sfr = "TC2_CMR.BURST", "Memory", 0xfffa0084, 4, base=16, bitRange=4-5 +-sfr = "TC2_CMR.CPCSTOP", "Memory", 0xfffa0084, 4, base=16, bitRange=6 +-sfr = "TC2_CMR.LDBSTOP", "Memory", 0xfffa0084, 4, base=16, bitRange=6 +-sfr = "TC2_CMR.CPCDIS", "Memory", 0xfffa0084, 4, base=16, bitRange=7 +-sfr = "TC2_CMR.LDBDIS", "Memory", 0xfffa0084, 4, base=16, bitRange=7 +-sfr = "TC2_CMR.ETRGEDG", "Memory", 0xfffa0084, 4, base=16, bitRange=8-9 +-sfr = "TC2_CMR.EEVTEDG", "Memory", 0xfffa0084, 4, base=16, bitRange=8-9 +-sfr = "TC2_CMR.EEVT", "Memory", 0xfffa0084, 4, base=16, bitRange=10-11 +-sfr = "TC2_CMR.ABETRG", "Memory", 0xfffa0084, 4, base=16, bitRange=10 +-sfr = "TC2_CMR.ENETRG", "Memory", 0xfffa0084, 4, base=16, bitRange=12 +-sfr = "TC2_CMR.WAVESEL", "Memory", 0xfffa0084, 4, base=16, bitRange=13-14 +-sfr = "TC2_CMR.CPCTRG", "Memory", 0xfffa0084, 4, base=16, bitRange=14 +-sfr = "TC2_CMR.WAVE", "Memory", 0xfffa0084, 4, base=16, bitRange=15 +-sfr = "TC2_CMR.ACPA", "Memory", 0xfffa0084, 4, base=16, bitRange=16-17 +-sfr = "TC2_CMR.LDRA", "Memory", 0xfffa0084, 4, base=16, bitRange=16-17 +-sfr = "TC2_CMR.ACPC", "Memory", 0xfffa0084, 4, base=16, bitRange=18-19 +-sfr = "TC2_CMR.LDRB", "Memory", 0xfffa0084, 4, base=16, bitRange=18-19 +-sfr = "TC2_CMR.AEEVT", "Memory", 0xfffa0084, 4, base=16, bitRange=20-21 +-sfr = "TC2_CMR.ASWTRG", "Memory", 0xfffa0084, 4, base=16, bitRange=22-23 +-sfr = "TC2_CMR.BCPB", "Memory", 0xfffa0084, 4, base=16, bitRange=24-25 +-sfr = "TC2_CMR.BCPC", "Memory", 0xfffa0084, 4, base=16, bitRange=26-27 +-sfr = "TC2_CMR.BEEVT", "Memory", 0xfffa0084, 4, base=16, bitRange=28-29 +-sfr = "TC2_CMR.BSWTRG", "Memory", 0xfffa0084, 4, base=16, bitRange=30-31 +-sfr = "TC2_CV", "Memory", 0xfffa0090, 4, base=16 +-sfr = "TC2_RA", "Memory", 0xfffa0094, 4, base=16 +-sfr = "TC2_RB", "Memory", 0xfffa0098, 4, base=16 +-sfr = "TC2_RC", "Memory", 0xfffa009c, 4, base=16 +-sfr = "TC2_SR", "Memory", 0xfffa00a0, 4, base=16 +-sfr = "TC2_SR.COVFS", "Memory", 0xfffa00a0, 4, base=16, bitRange=0 +-sfr = "TC2_SR.LOVRS", "Memory", 0xfffa00a0, 4, base=16, bitRange=1 +-sfr = "TC2_SR.CPAS", "Memory", 0xfffa00a0, 4, base=16, bitRange=2 +-sfr = "TC2_SR.CPBS", "Memory", 0xfffa00a0, 4, base=16, bitRange=3 +-sfr = "TC2_SR.CPCS", "Memory", 0xfffa00a0, 4, base=16, bitRange=4 +-sfr = "TC2_SR.LDRAS", "Memory", 0xfffa00a0, 4, base=16, bitRange=5 +-sfr = "TC2_SR.LDRBS", "Memory", 0xfffa00a0, 4, base=16, bitRange=6 +-sfr = "TC2_SR.ETRGS", "Memory", 0xfffa00a0, 4, base=16, bitRange=7 +-sfr = "TC2_SR.CLKSTA", "Memory", 0xfffa00a0, 4, base=16, bitRange=16 +-sfr = "TC2_SR.MTIOA", "Memory", 0xfffa00a0, 4, base=16, bitRange=17 +-sfr = "TC2_SR.MTIOB", "Memory", 0xfffa00a0, 4, base=16, bitRange=18 +-sfr = "TC2_IER", "Memory", 0xfffa00a4, 4, base=16 +-sfr = "TC2_IER.COVFS", "Memory", 0xfffa00a4, 4, base=16, bitRange=0 +-sfr = "TC2_IER.LOVRS", "Memory", 0xfffa00a4, 4, base=16, bitRange=1 +-sfr = "TC2_IER.CPAS", "Memory", 0xfffa00a4, 4, base=16, bitRange=2 +-sfr = "TC2_IER.CPBS", "Memory", 0xfffa00a4, 4, base=16, bitRange=3 +-sfr = "TC2_IER.CPCS", "Memory", 0xfffa00a4, 4, base=16, bitRange=4 +-sfr = "TC2_IER.LDRAS", "Memory", 0xfffa00a4, 4, base=16, bitRange=5 +-sfr = "TC2_IER.LDRBS", "Memory", 0xfffa00a4, 4, base=16, bitRange=6 +-sfr = "TC2_IER.ETRGS", "Memory", 0xfffa00a4, 4, base=16, bitRange=7 +-sfr = "TC2_IDR", "Memory", 0xfffa00a8, 4, base=16 +-sfr = "TC2_IDR.COVFS", "Memory", 0xfffa00a8, 4, base=16, bitRange=0 +-sfr = "TC2_IDR.LOVRS", "Memory", 0xfffa00a8, 4, base=16, bitRange=1 +-sfr = "TC2_IDR.CPAS", "Memory", 0xfffa00a8, 4, base=16, bitRange=2 +-sfr = "TC2_IDR.CPBS", "Memory", 0xfffa00a8, 4, base=16, bitRange=3 +-sfr = "TC2_IDR.CPCS", "Memory", 0xfffa00a8, 4, base=16, bitRange=4 +-sfr = "TC2_IDR.LDRAS", "Memory", 0xfffa00a8, 4, base=16, bitRange=5 +-sfr = "TC2_IDR.LDRBS", "Memory", 0xfffa00a8, 4, base=16, bitRange=6 +-sfr = "TC2_IDR.ETRGS", "Memory", 0xfffa00a8, 4, base=16, bitRange=7 +-sfr = "TC2_IMR", "Memory", 0xfffa00ac, 4, base=16 +-sfr = "TC2_IMR.COVFS", "Memory", 0xfffa00ac, 4, base=16, bitRange=0 +-sfr = "TC2_IMR.LOVRS", "Memory", 0xfffa00ac, 4, base=16, bitRange=1 +-sfr = "TC2_IMR.CPAS", "Memory", 0xfffa00ac, 4, base=16, bitRange=2 +-sfr = "TC2_IMR.CPBS", "Memory", 0xfffa00ac, 4, base=16, bitRange=3 +-sfr = "TC2_IMR.CPCS", "Memory", 0xfffa00ac, 4, base=16, bitRange=4 +-sfr = "TC2_IMR.LDRAS", "Memory", 0xfffa00ac, 4, base=16, bitRange=5 +-sfr = "TC2_IMR.LDRBS", "Memory", 0xfffa00ac, 4, base=16, bitRange=6 +-sfr = "TC2_IMR.ETRGS", "Memory", 0xfffa00ac, 4, base=16, bitRange=7 +-; ========== Register definition for TCB peripheral ========== +-sfr = "TCB_BCR", "Memory", 0xfffa00c0, 4, base=16 +-sfr = "TCB_BCR.SYNC", "Memory", 0xfffa00c0, 4, base=16, bitRange=0 +-sfr = "TCB_BMR", "Memory", 0xfffa00c4, 4, base=16 +-sfr = "TCB_BMR.TC0XC0S", "Memory", 0xfffa00c4, 4, base=16, bitRange=0-1 +-sfr = "TCB_BMR.TC1XC1S", "Memory", 0xfffa00c4, 4, base=16, bitRange=2-3 +-sfr = "TCB_BMR.TC2XC2S", "Memory", 0xfffa00c4, 4, base=16, bitRange=4-5 +-; ========== Register definition for CAN_MB0 peripheral ========== +-sfr = "CAN_MB0_MMR", "Memory", 0xfffd0200, 4, base=16 +-sfr = "CAN_MB0_MMR.MTIMEMARK", "Memory", 0xfffd0200, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB0_MMR.PRIOR", "Memory", 0xfffd0200, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB0_MMR.MOT", "Memory", 0xfffd0200, 4, base=16, bitRange=24-26 +-sfr = "CAN_MB0_MAM", "Memory", 0xfffd0204, 4, base=16 +-sfr = "CAN_MB0_MAM.MIDvB", "Memory", 0xfffd0204, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB0_MAM.MIDvA", "Memory", 0xfffd0204, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB0_MAM.MIDE", "Memory", 0xfffd0204, 4, base=16, bitRange=29 +-sfr = "CAN_MB0_MID", "Memory", 0xfffd0208, 4, base=16 +-sfr = "CAN_MB0_MID.MIDvB", "Memory", 0xfffd0208, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB0_MID.MIDvA", "Memory", 0xfffd0208, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB0_MID.MIDE", "Memory", 0xfffd0208, 4, base=16, bitRange=29 +-sfr = "CAN_MB0_MFID", "Memory", 0xfffd020c, 4, base=16 +-sfr = "CAN_MB0_MSR", "Memory", 0xfffd0210, 4, base=16 +-sfr = "CAN_MB0_MSR.MTIMESTAMP", "Memory", 0xfffd0210, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB0_MSR.MDLC", "Memory", 0xfffd0210, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB0_MSR.MRTR", "Memory", 0xfffd0210, 4, base=16, bitRange=20 +-sfr = "CAN_MB0_MSR.MABT", "Memory", 0xfffd0210, 4, base=16, bitRange=22 +-sfr = "CAN_MB0_MSR.MRDY", "Memory", 0xfffd0210, 4, base=16, bitRange=23 +-sfr = "CAN_MB0_MSR.MMI", "Memory", 0xfffd0210, 4, base=16, bitRange=24 +-sfr = "CAN_MB0_MDL", "Memory", 0xfffd0214, 4, base=16 +-sfr = "CAN_MB0_MDH", "Memory", 0xfffd0218, 4, base=16 +-sfr = "CAN_MB0_MCR", "Memory", 0xfffd021c, 4, base=16 +-sfr = "CAN_MB0_MCR.MDLC", "Memory", 0xfffd021c, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB0_MCR.MRTR", "Memory", 0xfffd021c, 4, base=16, bitRange=20 +-sfr = "CAN_MB0_MCR.MACR", "Memory", 0xfffd021c, 4, base=16, bitRange=22 +-sfr = "CAN_MB0_MCR.MTCR", "Memory", 0xfffd021c, 4, base=16, bitRange=23 +-; ========== Register definition for CAN_MB1 peripheral ========== +-sfr = "CAN_MB1_MMR", "Memory", 0xfffd0220, 4, base=16 +-sfr = "CAN_MB1_MMR.MTIMEMARK", "Memory", 0xfffd0220, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB1_MMR.PRIOR", "Memory", 0xfffd0220, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB1_MMR.MOT", "Memory", 0xfffd0220, 4, base=16, bitRange=24-26 +-sfr = "CAN_MB1_MAM", "Memory", 0xfffd0224, 4, base=16 +-sfr = "CAN_MB1_MAM.MIDvB", "Memory", 0xfffd0224, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB1_MAM.MIDvA", "Memory", 0xfffd0224, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB1_MAM.MIDE", "Memory", 0xfffd0224, 4, base=16, bitRange=29 +-sfr = "CAN_MB1_MID", "Memory", 0xfffd0228, 4, base=16 +-sfr = "CAN_MB1_MID.MIDvB", "Memory", 0xfffd0228, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB1_MID.MIDvA", "Memory", 0xfffd0228, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB1_MID.MIDE", "Memory", 0xfffd0228, 4, base=16, bitRange=29 +-sfr = "CAN_MB1_MFID", "Memory", 0xfffd022c, 4, base=16 +-sfr = "CAN_MB1_MSR", "Memory", 0xfffd0230, 4, base=16 +-sfr = "CAN_MB1_MSR.MTIMESTAMP", "Memory", 0xfffd0230, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB1_MSR.MDLC", "Memory", 0xfffd0230, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB1_MSR.MRTR", "Memory", 0xfffd0230, 4, base=16, bitRange=20 +-sfr = "CAN_MB1_MSR.MABT", "Memory", 0xfffd0230, 4, base=16, bitRange=22 +-sfr = "CAN_MB1_MSR.MRDY", "Memory", 0xfffd0230, 4, base=16, bitRange=23 +-sfr = "CAN_MB1_MSR.MMI", "Memory", 0xfffd0230, 4, base=16, bitRange=24 +-sfr = "CAN_MB1_MDL", "Memory", 0xfffd0234, 4, base=16 +-sfr = "CAN_MB1_MDH", "Memory", 0xfffd0238, 4, base=16 +-sfr = "CAN_MB1_MCR", "Memory", 0xfffd023c, 4, base=16 +-sfr = "CAN_MB1_MCR.MDLC", "Memory", 0xfffd023c, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB1_MCR.MRTR", "Memory", 0xfffd023c, 4, base=16, bitRange=20 +-sfr = "CAN_MB1_MCR.MACR", "Memory", 0xfffd023c, 4, base=16, bitRange=22 +-sfr = "CAN_MB1_MCR.MTCR", "Memory", 0xfffd023c, 4, base=16, bitRange=23 +-; ========== Register definition for CAN_MB2 peripheral ========== +-sfr = "CAN_MB2_MMR", "Memory", 0xfffd0240, 4, base=16 +-sfr = "CAN_MB2_MMR.MTIMEMARK", "Memory", 0xfffd0240, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB2_MMR.PRIOR", "Memory", 0xfffd0240, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB2_MMR.MOT", "Memory", 0xfffd0240, 4, base=16, bitRange=24-26 +-sfr = "CAN_MB2_MAM", "Memory", 0xfffd0244, 4, base=16 +-sfr = "CAN_MB2_MAM.MIDvB", "Memory", 0xfffd0244, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB2_MAM.MIDvA", "Memory", 0xfffd0244, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB2_MAM.MIDE", "Memory", 0xfffd0244, 4, base=16, bitRange=29 +-sfr = "CAN_MB2_MID", "Memory", 0xfffd0248, 4, base=16 +-sfr = "CAN_MB2_MID.MIDvB", "Memory", 0xfffd0248, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB2_MID.MIDvA", "Memory", 0xfffd0248, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB2_MID.MIDE", "Memory", 0xfffd0248, 4, base=16, bitRange=29 +-sfr = "CAN_MB2_MFID", "Memory", 0xfffd024c, 4, base=16 +-sfr = "CAN_MB2_MSR", "Memory", 0xfffd0250, 4, base=16 +-sfr = "CAN_MB2_MSR.MTIMESTAMP", "Memory", 0xfffd0250, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB2_MSR.MDLC", "Memory", 0xfffd0250, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB2_MSR.MRTR", "Memory", 0xfffd0250, 4, base=16, bitRange=20 +-sfr = "CAN_MB2_MSR.MABT", "Memory", 0xfffd0250, 4, base=16, bitRange=22 +-sfr = "CAN_MB2_MSR.MRDY", "Memory", 0xfffd0250, 4, base=16, bitRange=23 +-sfr = "CAN_MB2_MSR.MMI", "Memory", 0xfffd0250, 4, base=16, bitRange=24 +-sfr = "CAN_MB2_MDL", "Memory", 0xfffd0254, 4, base=16 +-sfr = "CAN_MB2_MDH", "Memory", 0xfffd0258, 4, base=16 +-sfr = "CAN_MB2_MCR", "Memory", 0xfffd025c, 4, base=16 +-sfr = "CAN_MB2_MCR.MDLC", "Memory", 0xfffd025c, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB2_MCR.MRTR", "Memory", 0xfffd025c, 4, base=16, bitRange=20 +-sfr = "CAN_MB2_MCR.MACR", "Memory", 0xfffd025c, 4, base=16, bitRange=22 +-sfr = "CAN_MB2_MCR.MTCR", "Memory", 0xfffd025c, 4, base=16, bitRange=23 +-; ========== Register definition for CAN_MB3 peripheral ========== +-sfr = "CAN_MB3_MMR", "Memory", 0xfffd0260, 4, base=16 +-sfr = "CAN_MB3_MMR.MTIMEMARK", "Memory", 0xfffd0260, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB3_MMR.PRIOR", "Memory", 0xfffd0260, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB3_MMR.MOT", "Memory", 0xfffd0260, 4, base=16, bitRange=24-26 +-sfr = "CAN_MB3_MAM", "Memory", 0xfffd0264, 4, base=16 +-sfr = "CAN_MB3_MAM.MIDvB", "Memory", 0xfffd0264, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB3_MAM.MIDvA", "Memory", 0xfffd0264, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB3_MAM.MIDE", "Memory", 0xfffd0264, 4, base=16, bitRange=29 +-sfr = "CAN_MB3_MID", "Memory", 0xfffd0268, 4, base=16 +-sfr = "CAN_MB3_MID.MIDvB", "Memory", 0xfffd0268, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB3_MID.MIDvA", "Memory", 0xfffd0268, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB3_MID.MIDE", "Memory", 0xfffd0268, 4, base=16, bitRange=29 +-sfr = "CAN_MB3_MFID", "Memory", 0xfffd026c, 4, base=16 +-sfr = "CAN_MB3_MSR", "Memory", 0xfffd0270, 4, base=16 +-sfr = "CAN_MB3_MSR.MTIMESTAMP", "Memory", 0xfffd0270, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB3_MSR.MDLC", "Memory", 0xfffd0270, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB3_MSR.MRTR", "Memory", 0xfffd0270, 4, base=16, bitRange=20 +-sfr = "CAN_MB3_MSR.MABT", "Memory", 0xfffd0270, 4, base=16, bitRange=22 +-sfr = "CAN_MB3_MSR.MRDY", "Memory", 0xfffd0270, 4, base=16, bitRange=23 +-sfr = "CAN_MB3_MSR.MMI", "Memory", 0xfffd0270, 4, base=16, bitRange=24 +-sfr = "CAN_MB3_MDL", "Memory", 0xfffd0274, 4, base=16 +-sfr = "CAN_MB3_MDH", "Memory", 0xfffd0278, 4, base=16 +-sfr = "CAN_MB3_MCR", "Memory", 0xfffd027c, 4, base=16 +-sfr = "CAN_MB3_MCR.MDLC", "Memory", 0xfffd027c, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB3_MCR.MRTR", "Memory", 0xfffd027c, 4, base=16, bitRange=20 +-sfr = "CAN_MB3_MCR.MACR", "Memory", 0xfffd027c, 4, base=16, bitRange=22 +-sfr = "CAN_MB3_MCR.MTCR", "Memory", 0xfffd027c, 4, base=16, bitRange=23 +-; ========== Register definition for CAN_MB4 peripheral ========== +-sfr = "CAN_MB4_MMR", "Memory", 0xfffd0280, 4, base=16 +-sfr = "CAN_MB4_MMR.MTIMEMARK", "Memory", 0xfffd0280, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB4_MMR.PRIOR", "Memory", 0xfffd0280, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB4_MMR.MOT", "Memory", 0xfffd0280, 4, base=16, bitRange=24-26 +-sfr = "CAN_MB4_MAM", "Memory", 0xfffd0284, 4, base=16 +-sfr = "CAN_MB4_MAM.MIDvB", "Memory", 0xfffd0284, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB4_MAM.MIDvA", "Memory", 0xfffd0284, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB4_MAM.MIDE", "Memory", 0xfffd0284, 4, base=16, bitRange=29 +-sfr = "CAN_MB4_MID", "Memory", 0xfffd0288, 4, base=16 +-sfr = "CAN_MB4_MID.MIDvB", "Memory", 0xfffd0288, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB4_MID.MIDvA", "Memory", 0xfffd0288, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB4_MID.MIDE", "Memory", 0xfffd0288, 4, base=16, bitRange=29 +-sfr = "CAN_MB4_MFID", "Memory", 0xfffd028c, 4, base=16 +-sfr = "CAN_MB4_MSR", "Memory", 0xfffd0290, 4, base=16 +-sfr = "CAN_MB4_MSR.MTIMESTAMP", "Memory", 0xfffd0290, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB4_MSR.MDLC", "Memory", 0xfffd0290, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB4_MSR.MRTR", "Memory", 0xfffd0290, 4, base=16, bitRange=20 +-sfr = "CAN_MB4_MSR.MABT", "Memory", 0xfffd0290, 4, base=16, bitRange=22 +-sfr = "CAN_MB4_MSR.MRDY", "Memory", 0xfffd0290, 4, base=16, bitRange=23 +-sfr = "CAN_MB4_MSR.MMI", "Memory", 0xfffd0290, 4, base=16, bitRange=24 +-sfr = "CAN_MB4_MDL", "Memory", 0xfffd0294, 4, base=16 +-sfr = "CAN_MB4_MDH", "Memory", 0xfffd0298, 4, base=16 +-sfr = "CAN_MB4_MCR", "Memory", 0xfffd029c, 4, base=16 +-sfr = "CAN_MB4_MCR.MDLC", "Memory", 0xfffd029c, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB4_MCR.MRTR", "Memory", 0xfffd029c, 4, base=16, bitRange=20 +-sfr = "CAN_MB4_MCR.MACR", "Memory", 0xfffd029c, 4, base=16, bitRange=22 +-sfr = "CAN_MB4_MCR.MTCR", "Memory", 0xfffd029c, 4, base=16, bitRange=23 +-; ========== Register definition for CAN_MB5 peripheral ========== +-sfr = "CAN_MB5_MMR", "Memory", 0xfffd02a0, 4, base=16 +-sfr = "CAN_MB5_MMR.MTIMEMARK", "Memory", 0xfffd02a0, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB5_MMR.PRIOR", "Memory", 0xfffd02a0, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB5_MMR.MOT", "Memory", 0xfffd02a0, 4, base=16, bitRange=24-26 +-sfr = "CAN_MB5_MAM", "Memory", 0xfffd02a4, 4, base=16 +-sfr = "CAN_MB5_MAM.MIDvB", "Memory", 0xfffd02a4, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB5_MAM.MIDvA", "Memory", 0xfffd02a4, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB5_MAM.MIDE", "Memory", 0xfffd02a4, 4, base=16, bitRange=29 +-sfr = "CAN_MB5_MID", "Memory", 0xfffd02a8, 4, base=16 +-sfr = "CAN_MB5_MID.MIDvB", "Memory", 0xfffd02a8, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB5_MID.MIDvA", "Memory", 0xfffd02a8, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB5_MID.MIDE", "Memory", 0xfffd02a8, 4, base=16, bitRange=29 +-sfr = "CAN_MB5_MFID", "Memory", 0xfffd02ac, 4, base=16 +-sfr = "CAN_MB5_MSR", "Memory", 0xfffd02b0, 4, base=16 +-sfr = "CAN_MB5_MSR.MTIMESTAMP", "Memory", 0xfffd02b0, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB5_MSR.MDLC", "Memory", 0xfffd02b0, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB5_MSR.MRTR", "Memory", 0xfffd02b0, 4, base=16, bitRange=20 +-sfr = "CAN_MB5_MSR.MABT", "Memory", 0xfffd02b0, 4, base=16, bitRange=22 +-sfr = "CAN_MB5_MSR.MRDY", "Memory", 0xfffd02b0, 4, base=16, bitRange=23 +-sfr = "CAN_MB5_MSR.MMI", "Memory", 0xfffd02b0, 4, base=16, bitRange=24 +-sfr = "CAN_MB5_MDL", "Memory", 0xfffd02b4, 4, base=16 +-sfr = "CAN_MB5_MDH", "Memory", 0xfffd02b8, 4, base=16 +-sfr = "CAN_MB5_MCR", "Memory", 0xfffd02bc, 4, base=16 +-sfr = "CAN_MB5_MCR.MDLC", "Memory", 0xfffd02bc, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB5_MCR.MRTR", "Memory", 0xfffd02bc, 4, base=16, bitRange=20 +-sfr = "CAN_MB5_MCR.MACR", "Memory", 0xfffd02bc, 4, base=16, bitRange=22 +-sfr = "CAN_MB5_MCR.MTCR", "Memory", 0xfffd02bc, 4, base=16, bitRange=23 +-; ========== Register definition for CAN_MB6 peripheral ========== +-sfr = "CAN_MB6_MMR", "Memory", 0xfffd02c0, 4, base=16 +-sfr = "CAN_MB6_MMR.MTIMEMARK", "Memory", 0xfffd02c0, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB6_MMR.PRIOR", "Memory", 0xfffd02c0, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB6_MMR.MOT", "Memory", 0xfffd02c0, 4, base=16, bitRange=24-26 +-sfr = "CAN_MB6_MAM", "Memory", 0xfffd02c4, 4, base=16 +-sfr = "CAN_MB6_MAM.MIDvB", "Memory", 0xfffd02c4, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB6_MAM.MIDvA", "Memory", 0xfffd02c4, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB6_MAM.MIDE", "Memory", 0xfffd02c4, 4, base=16, bitRange=29 +-sfr = "CAN_MB6_MID", "Memory", 0xfffd02c8, 4, base=16 +-sfr = "CAN_MB6_MID.MIDvB", "Memory", 0xfffd02c8, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB6_MID.MIDvA", "Memory", 0xfffd02c8, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB6_MID.MIDE", "Memory", 0xfffd02c8, 4, base=16, bitRange=29 +-sfr = "CAN_MB6_MFID", "Memory", 0xfffd02cc, 4, base=16 +-sfr = "CAN_MB6_MSR", "Memory", 0xfffd02d0, 4, base=16 +-sfr = "CAN_MB6_MSR.MTIMESTAMP", "Memory", 0xfffd02d0, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB6_MSR.MDLC", "Memory", 0xfffd02d0, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB6_MSR.MRTR", "Memory", 0xfffd02d0, 4, base=16, bitRange=20 +-sfr = "CAN_MB6_MSR.MABT", "Memory", 0xfffd02d0, 4, base=16, bitRange=22 +-sfr = "CAN_MB6_MSR.MRDY", "Memory", 0xfffd02d0, 4, base=16, bitRange=23 +-sfr = "CAN_MB6_MSR.MMI", "Memory", 0xfffd02d0, 4, base=16, bitRange=24 +-sfr = "CAN_MB6_MDL", "Memory", 0xfffd02d4, 4, base=16 +-sfr = "CAN_MB6_MDH", "Memory", 0xfffd02d8, 4, base=16 +-sfr = "CAN_MB6_MCR", "Memory", 0xfffd02dc, 4, base=16 +-sfr = "CAN_MB6_MCR.MDLC", "Memory", 0xfffd02dc, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB6_MCR.MRTR", "Memory", 0xfffd02dc, 4, base=16, bitRange=20 +-sfr = "CAN_MB6_MCR.MACR", "Memory", 0xfffd02dc, 4, base=16, bitRange=22 +-sfr = "CAN_MB6_MCR.MTCR", "Memory", 0xfffd02dc, 4, base=16, bitRange=23 +-; ========== Register definition for CAN_MB7 peripheral ========== +-sfr = "CAN_MB7_MMR", "Memory", 0xfffd02e0, 4, base=16 +-sfr = "CAN_MB7_MMR.MTIMEMARK", "Memory", 0xfffd02e0, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB7_MMR.PRIOR", "Memory", 0xfffd02e0, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB7_MMR.MOT", "Memory", 0xfffd02e0, 4, base=16, bitRange=24-26 +-sfr = "CAN_MB7_MAM", "Memory", 0xfffd02e4, 4, base=16 +-sfr = "CAN_MB7_MAM.MIDvB", "Memory", 0xfffd02e4, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB7_MAM.MIDvA", "Memory", 0xfffd02e4, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB7_MAM.MIDE", "Memory", 0xfffd02e4, 4, base=16, bitRange=29 +-sfr = "CAN_MB7_MID", "Memory", 0xfffd02e8, 4, base=16 +-sfr = "CAN_MB7_MID.MIDvB", "Memory", 0xfffd02e8, 4, base=16, bitRange=0-17 +-sfr = "CAN_MB7_MID.MIDvA", "Memory", 0xfffd02e8, 4, base=16, bitRange=18-28 +-sfr = "CAN_MB7_MID.MIDE", "Memory", 0xfffd02e8, 4, base=16, bitRange=29 +-sfr = "CAN_MB7_MFID", "Memory", 0xfffd02ec, 4, base=16 +-sfr = "CAN_MB7_MSR", "Memory", 0xfffd02f0, 4, base=16 +-sfr = "CAN_MB7_MSR.MTIMESTAMP", "Memory", 0xfffd02f0, 4, base=16, bitRange=0-15 +-sfr = "CAN_MB7_MSR.MDLC", "Memory", 0xfffd02f0, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB7_MSR.MRTR", "Memory", 0xfffd02f0, 4, base=16, bitRange=20 +-sfr = "CAN_MB7_MSR.MABT", "Memory", 0xfffd02f0, 4, base=16, bitRange=22 +-sfr = "CAN_MB7_MSR.MRDY", "Memory", 0xfffd02f0, 4, base=16, bitRange=23 +-sfr = "CAN_MB7_MSR.MMI", "Memory", 0xfffd02f0, 4, base=16, bitRange=24 +-sfr = "CAN_MB7_MDL", "Memory", 0xfffd02f4, 4, base=16 +-sfr = "CAN_MB7_MDH", "Memory", 0xfffd02f8, 4, base=16 +-sfr = "CAN_MB7_MCR", "Memory", 0xfffd02fc, 4, base=16 +-sfr = "CAN_MB7_MCR.MDLC", "Memory", 0xfffd02fc, 4, base=16, bitRange=16-19 +-sfr = "CAN_MB7_MCR.MRTR", "Memory", 0xfffd02fc, 4, base=16, bitRange=20 +-sfr = "CAN_MB7_MCR.MACR", "Memory", 0xfffd02fc, 4, base=16, bitRange=22 +-sfr = "CAN_MB7_MCR.MTCR", "Memory", 0xfffd02fc, 4, base=16, bitRange=23 +-; ========== Register definition for CAN peripheral ========== +-sfr = "CAN_MR", "Memory", 0xfffd0000, 4, base=16 +-sfr = "CAN_MR.CANEN", "Memory", 0xfffd0000, 4, base=16, bitRange=0 +-sfr = "CAN_MR.LPM", "Memory", 0xfffd0000, 4, base=16, bitRange=1 +-sfr = "CAN_MR.ABM", "Memory", 0xfffd0000, 4, base=16, bitRange=2 +-sfr = "CAN_MR.OVL", "Memory", 0xfffd0000, 4, base=16, bitRange=3 +-sfr = "CAN_MR.TEOF", "Memory", 0xfffd0000, 4, base=16, bitRange=4 +-sfr = "CAN_MR.TTM", "Memory", 0xfffd0000, 4, base=16, bitRange=5 +-sfr = "CAN_MR.TIMFRZ", "Memory", 0xfffd0000, 4, base=16, bitRange=6 +-sfr = "CAN_MR.DRPT", "Memory", 0xfffd0000, 4, base=16, bitRange=7 +-sfr = "CAN_IER", "Memory", 0xfffd0004, 4, base=16 +-sfr = "CAN_IER.MB0", "Memory", 0xfffd0004, 4, base=16, bitRange=0 +-sfr = "CAN_IER.MB1", "Memory", 0xfffd0004, 4, base=16, bitRange=1 +-sfr = "CAN_IER.MB2", "Memory", 0xfffd0004, 4, base=16, bitRange=2 +-sfr = "CAN_IER.MB3", "Memory", 0xfffd0004, 4, base=16, bitRange=3 +-sfr = "CAN_IER.MB4", "Memory", 0xfffd0004, 4, base=16, bitRange=4 +-sfr = "CAN_IER.MB5", "Memory", 0xfffd0004, 4, base=16, bitRange=5 +-sfr = "CAN_IER.MB6", "Memory", 0xfffd0004, 4, base=16, bitRange=6 +-sfr = "CAN_IER.MB7", "Memory", 0xfffd0004, 4, base=16, bitRange=7 +-sfr = "CAN_IER.MB8", "Memory", 0xfffd0004, 4, base=16, bitRange=8 +-sfr = "CAN_IER.MB9", "Memory", 0xfffd0004, 4, base=16, bitRange=9 +-sfr = "CAN_IER.MB10", "Memory", 0xfffd0004, 4, base=16, bitRange=10 +-sfr = "CAN_IER.MB11", "Memory", 0xfffd0004, 4, base=16, bitRange=11 +-sfr = "CAN_IER.MB12", "Memory", 0xfffd0004, 4, base=16, bitRange=12 +-sfr = "CAN_IER.MB13", "Memory", 0xfffd0004, 4, base=16, bitRange=13 +-sfr = "CAN_IER.MB14", "Memory", 0xfffd0004, 4, base=16, bitRange=14 +-sfr = "CAN_IER.MB15", "Memory", 0xfffd0004, 4, base=16, bitRange=15 +-sfr = "CAN_IER.ERRA", "Memory", 0xfffd0004, 4, base=16, bitRange=16 +-sfr = "CAN_IER.WARN", "Memory", 0xfffd0004, 4, base=16, bitRange=17 +-sfr = "CAN_IER.ERRP", "Memory", 0xfffd0004, 4, base=16, bitRange=18 +-sfr = "CAN_IER.BOFF", "Memory", 0xfffd0004, 4, base=16, bitRange=19 +-sfr = "CAN_IER.SLEEP", "Memory", 0xfffd0004, 4, base=16, bitRange=20 +-sfr = "CAN_IER.WAKEUP", "Memory", 0xfffd0004, 4, base=16, bitRange=21 +-sfr = "CAN_IER.TOVF", "Memory", 0xfffd0004, 4, base=16, bitRange=22 +-sfr = "CAN_IER.TSTP", "Memory", 0xfffd0004, 4, base=16, bitRange=23 +-sfr = "CAN_IER.CERR", "Memory", 0xfffd0004, 4, base=16, bitRange=24 +-sfr = "CAN_IER.SERR", "Memory", 0xfffd0004, 4, base=16, bitRange=25 +-sfr = "CAN_IER.AERR", "Memory", 0xfffd0004, 4, base=16, bitRange=26 +-sfr = "CAN_IER.FERR", "Memory", 0xfffd0004, 4, base=16, bitRange=27 +-sfr = "CAN_IER.BERR", "Memory", 0xfffd0004, 4, base=16, bitRange=28 +-sfr = "CAN_IDR", "Memory", 0xfffd0008, 4, base=16 +-sfr = "CAN_IDR.MB0", "Memory", 0xfffd0008, 4, base=16, bitRange=0 +-sfr = "CAN_IDR.MB1", "Memory", 0xfffd0008, 4, base=16, bitRange=1 +-sfr = "CAN_IDR.MB2", "Memory", 0xfffd0008, 4, base=16, bitRange=2 +-sfr = "CAN_IDR.MB3", "Memory", 0xfffd0008, 4, base=16, bitRange=3 +-sfr = "CAN_IDR.MB4", "Memory", 0xfffd0008, 4, base=16, bitRange=4 +-sfr = "CAN_IDR.MB5", "Memory", 0xfffd0008, 4, base=16, bitRange=5 +-sfr = "CAN_IDR.MB6", "Memory", 0xfffd0008, 4, base=16, bitRange=6 +-sfr = "CAN_IDR.MB7", "Memory", 0xfffd0008, 4, base=16, bitRange=7 +-sfr = "CAN_IDR.MB8", "Memory", 0xfffd0008, 4, base=16, bitRange=8 +-sfr = "CAN_IDR.MB9", "Memory", 0xfffd0008, 4, base=16, bitRange=9 +-sfr = "CAN_IDR.MB10", "Memory", 0xfffd0008, 4, base=16, bitRange=10 +-sfr = "CAN_IDR.MB11", "Memory", 0xfffd0008, 4, base=16, bitRange=11 +-sfr = "CAN_IDR.MB12", "Memory", 0xfffd0008, 4, base=16, bitRange=12 +-sfr = "CAN_IDR.MB13", "Memory", 0xfffd0008, 4, base=16, bitRange=13 +-sfr = "CAN_IDR.MB14", "Memory", 0xfffd0008, 4, base=16, bitRange=14 +-sfr = "CAN_IDR.MB15", "Memory", 0xfffd0008, 4, base=16, bitRange=15 +-sfr = "CAN_IDR.ERRA", "Memory", 0xfffd0008, 4, base=16, bitRange=16 +-sfr = "CAN_IDR.WARN", "Memory", 0xfffd0008, 4, base=16, bitRange=17 +-sfr = "CAN_IDR.ERRP", "Memory", 0xfffd0008, 4, base=16, bitRange=18 +-sfr = "CAN_IDR.BOFF", "Memory", 0xfffd0008, 4, base=16, bitRange=19 +-sfr = "CAN_IDR.SLEEP", "Memory", 0xfffd0008, 4, base=16, bitRange=20 +-sfr = "CAN_IDR.WAKEUP", "Memory", 0xfffd0008, 4, base=16, bitRange=21 +-sfr = "CAN_IDR.TOVF", "Memory", 0xfffd0008, 4, base=16, bitRange=22 +-sfr = "CAN_IDR.TSTP", "Memory", 0xfffd0008, 4, base=16, bitRange=23 +-sfr = "CAN_IDR.CERR", "Memory", 0xfffd0008, 4, base=16, bitRange=24 +-sfr = "CAN_IDR.SERR", "Memory", 0xfffd0008, 4, base=16, bitRange=25 +-sfr = "CAN_IDR.AERR", "Memory", 0xfffd0008, 4, base=16, bitRange=26 +-sfr = "CAN_IDR.FERR", "Memory", 0xfffd0008, 4, base=16, bitRange=27 +-sfr = "CAN_IDR.BERR", "Memory", 0xfffd0008, 4, base=16, bitRange=28 +-sfr = "CAN_IMR", "Memory", 0xfffd000c, 4, base=16 +-sfr = "CAN_IMR.MB0", "Memory", 0xfffd000c, 4, base=16, bitRange=0 +-sfr = "CAN_IMR.MB1", "Memory", 0xfffd000c, 4, base=16, bitRange=1 +-sfr = "CAN_IMR.MB2", "Memory", 0xfffd000c, 4, base=16, bitRange=2 +-sfr = "CAN_IMR.MB3", "Memory", 0xfffd000c, 4, base=16, bitRange=3 +-sfr = "CAN_IMR.MB4", "Memory", 0xfffd000c, 4, base=16, bitRange=4 +-sfr = "CAN_IMR.MB5", "Memory", 0xfffd000c, 4, base=16, bitRange=5 +-sfr = "CAN_IMR.MB6", "Memory", 0xfffd000c, 4, base=16, bitRange=6 +-sfr = "CAN_IMR.MB7", "Memory", 0xfffd000c, 4, base=16, bitRange=7 +-sfr = "CAN_IMR.MB8", "Memory", 0xfffd000c, 4, base=16, bitRange=8 +-sfr = "CAN_IMR.MB9", "Memory", 0xfffd000c, 4, base=16, bitRange=9 +-sfr = "CAN_IMR.MB10", "Memory", 0xfffd000c, 4, base=16, bitRange=10 +-sfr = "CAN_IMR.MB11", "Memory", 0xfffd000c, 4, base=16, bitRange=11 +-sfr = "CAN_IMR.MB12", "Memory", 0xfffd000c, 4, base=16, bitRange=12 +-sfr = "CAN_IMR.MB13", "Memory", 0xfffd000c, 4, base=16, bitRange=13 +-sfr = "CAN_IMR.MB14", "Memory", 0xfffd000c, 4, base=16, bitRange=14 +-sfr = "CAN_IMR.MB15", "Memory", 0xfffd000c, 4, base=16, bitRange=15 +-sfr = "CAN_IMR.ERRA", "Memory", 0xfffd000c, 4, base=16, bitRange=16 +-sfr = "CAN_IMR.WARN", "Memory", 0xfffd000c, 4, base=16, bitRange=17 +-sfr = "CAN_IMR.ERRP", "Memory", 0xfffd000c, 4, base=16, bitRange=18 +-sfr = "CAN_IMR.BOFF", "Memory", 0xfffd000c, 4, base=16, bitRange=19 +-sfr = "CAN_IMR.SLEEP", "Memory", 0xfffd000c, 4, base=16, bitRange=20 +-sfr = "CAN_IMR.WAKEUP", "Memory", 0xfffd000c, 4, base=16, bitRange=21 +-sfr = "CAN_IMR.TOVF", "Memory", 0xfffd000c, 4, base=16, bitRange=22 +-sfr = "CAN_IMR.TSTP", "Memory", 0xfffd000c, 4, base=16, bitRange=23 +-sfr = "CAN_IMR.CERR", "Memory", 0xfffd000c, 4, base=16, bitRange=24 +-sfr = "CAN_IMR.SERR", "Memory", 0xfffd000c, 4, base=16, bitRange=25 +-sfr = "CAN_IMR.AERR", "Memory", 0xfffd000c, 4, base=16, bitRange=26 +-sfr = "CAN_IMR.FERR", "Memory", 0xfffd000c, 4, base=16, bitRange=27 +-sfr = "CAN_IMR.BERR", "Memory", 0xfffd000c, 4, base=16, bitRange=28 +-sfr = "CAN_SR", "Memory", 0xfffd0010, 4, base=16 +-sfr = "CAN_SR.MB0", "Memory", 0xfffd0010, 4, base=16, bitRange=0 +-sfr = "CAN_SR.MB1", "Memory", 0xfffd0010, 4, base=16, bitRange=1 +-sfr = "CAN_SR.MB2", "Memory", 0xfffd0010, 4, base=16, bitRange=2 +-sfr = "CAN_SR.MB3", "Memory", 0xfffd0010, 4, base=16, bitRange=3 +-sfr = "CAN_SR.MB4", "Memory", 0xfffd0010, 4, base=16, bitRange=4 +-sfr = "CAN_SR.MB5", "Memory", 0xfffd0010, 4, base=16, bitRange=5 +-sfr = "CAN_SR.MB6", "Memory", 0xfffd0010, 4, base=16, bitRange=6 +-sfr = "CAN_SR.MB7", "Memory", 0xfffd0010, 4, base=16, bitRange=7 +-sfr = "CAN_SR.MB8", "Memory", 0xfffd0010, 4, base=16, bitRange=8 +-sfr = "CAN_SR.MB9", "Memory", 0xfffd0010, 4, base=16, bitRange=9 +-sfr = "CAN_SR.MB10", "Memory", 0xfffd0010, 4, base=16, bitRange=10 +-sfr = "CAN_SR.MB11", "Memory", 0xfffd0010, 4, base=16, bitRange=11 +-sfr = "CAN_SR.MB12", "Memory", 0xfffd0010, 4, base=16, bitRange=12 +-sfr = "CAN_SR.MB13", "Memory", 0xfffd0010, 4, base=16, bitRange=13 +-sfr = "CAN_SR.MB14", "Memory", 0xfffd0010, 4, base=16, bitRange=14 +-sfr = "CAN_SR.MB15", "Memory", 0xfffd0010, 4, base=16, bitRange=15 +-sfr = "CAN_SR.ERRA", "Memory", 0xfffd0010, 4, base=16, bitRange=16 +-sfr = "CAN_SR.WARN", "Memory", 0xfffd0010, 4, base=16, bitRange=17 +-sfr = "CAN_SR.ERRP", "Memory", 0xfffd0010, 4, base=16, bitRange=18 +-sfr = "CAN_SR.BOFF", "Memory", 0xfffd0010, 4, base=16, bitRange=19 +-sfr = "CAN_SR.SLEEP", "Memory", 0xfffd0010, 4, base=16, bitRange=20 +-sfr = "CAN_SR.WAKEUP", "Memory", 0xfffd0010, 4, base=16, bitRange=21 +-sfr = "CAN_SR.TOVF", "Memory", 0xfffd0010, 4, base=16, bitRange=22 +-sfr = "CAN_SR.TSTP", "Memory", 0xfffd0010, 4, base=16, bitRange=23 +-sfr = "CAN_SR.CERR", "Memory", 0xfffd0010, 4, base=16, bitRange=24 +-sfr = "CAN_SR.SERR", "Memory", 0xfffd0010, 4, base=16, bitRange=25 +-sfr = "CAN_SR.AERR", "Memory", 0xfffd0010, 4, base=16, bitRange=26 +-sfr = "CAN_SR.FERR", "Memory", 0xfffd0010, 4, base=16, bitRange=27 +-sfr = "CAN_SR.BERR", "Memory", 0xfffd0010, 4, base=16, bitRange=28 +-sfr = "CAN_SR.RBSY", "Memory", 0xfffd0010, 4, base=16, bitRange=29 +-sfr = "CAN_SR.TBSY", "Memory", 0xfffd0010, 4, base=16, bitRange=30 +-sfr = "CAN_SR.OVLY", "Memory", 0xfffd0010, 4, base=16, bitRange=31 +-sfr = "CAN_BR", "Memory", 0xfffd0014, 4, base=16 +-sfr = "CAN_BR.PHASE2", "Memory", 0xfffd0014, 4, base=16, bitRange=0-2 +-sfr = "CAN_BR.PHASE1", "Memory", 0xfffd0014, 4, base=16, bitRange=4-6 +-sfr = "CAN_BR.PROPAG", "Memory", 0xfffd0014, 4, base=16, bitRange=8-10 +-sfr = "CAN_BR.SYNC", "Memory", 0xfffd0014, 4, base=16, bitRange=12-13 +-sfr = "CAN_BR.BRP", "Memory", 0xfffd0014, 4, base=16, bitRange=16-22 +-sfr = "CAN_BR.SMP", "Memory", 0xfffd0014, 4, base=16, bitRange=24 +-sfr = "CAN_TIM", "Memory", 0xfffd0018, 4, base=16 +-sfr = "CAN_TIM.TIMER", "Memory", 0xfffd0018, 4, base=16, bitRange=0-15 +-sfr = "CAN_TIMESTP", "Memory", 0xfffd001c, 4, base=16 +-sfr = "CAN_TIMESTP.MTIMESTAMP", "Memory", 0xfffd001c, 4, base=16, bitRange=0-15 +-sfr = "CAN_ECR", "Memory", 0xfffd0020, 4, base=16 +-sfr = "CAN_ECR.REC", "Memory", 0xfffd0020, 4, base=16, bitRange=0-7 +-sfr = "CAN_ECR.TEC", "Memory", 0xfffd0020, 4, base=16, bitRange=16-23 +-sfr = "CAN_TCR", "Memory", 0xfffd0024, 4, base=16 +-sfr = "CAN_TCR.MB0", "Memory", 0xfffd0024, 4, base=16, bitRange=0 +-sfr = "CAN_TCR.MB1", "Memory", 0xfffd0024, 4, base=16, bitRange=1 +-sfr = "CAN_TCR.MB2", "Memory", 0xfffd0024, 4, base=16, bitRange=2 +-sfr = "CAN_TCR.MB3", "Memory", 0xfffd0024, 4, base=16, bitRange=3 +-sfr = "CAN_TCR.MB4", "Memory", 0xfffd0024, 4, base=16, bitRange=4 +-sfr = "CAN_TCR.MB5", "Memory", 0xfffd0024, 4, base=16, bitRange=5 +-sfr = "CAN_TCR.MB6", "Memory", 0xfffd0024, 4, base=16, bitRange=6 +-sfr = "CAN_TCR.MB7", "Memory", 0xfffd0024, 4, base=16, bitRange=7 +-sfr = "CAN_TCR.MB8", "Memory", 0xfffd0024, 4, base=16, bitRange=8 +-sfr = "CAN_TCR.MB9", "Memory", 0xfffd0024, 4, base=16, bitRange=9 +-sfr = "CAN_TCR.MB10", "Memory", 0xfffd0024, 4, base=16, bitRange=10 +-sfr = "CAN_TCR.MB11", "Memory", 0xfffd0024, 4, base=16, bitRange=11 +-sfr = "CAN_TCR.MB12", "Memory", 0xfffd0024, 4, base=16, bitRange=12 +-sfr = "CAN_TCR.MB13", "Memory", 0xfffd0024, 4, base=16, bitRange=13 +-sfr = "CAN_TCR.MB14", "Memory", 0xfffd0024, 4, base=16, bitRange=14 +-sfr = "CAN_TCR.MB15", "Memory", 0xfffd0024, 4, base=16, bitRange=15 +-sfr = "CAN_TCR.TIMRST", "Memory", 0xfffd0024, 4, base=16, bitRange=31 +-sfr = "CAN_ACR", "Memory", 0xfffd0028, 4, base=16 +-sfr = "CAN_ACR.MB0", "Memory", 0xfffd0028, 4, base=16, bitRange=0 +-sfr = "CAN_ACR.MB1", "Memory", 0xfffd0028, 4, base=16, bitRange=1 +-sfr = "CAN_ACR.MB2", "Memory", 0xfffd0028, 4, base=16, bitRange=2 +-sfr = "CAN_ACR.MB3", "Memory", 0xfffd0028, 4, base=16, bitRange=3 +-sfr = "CAN_ACR.MB4", "Memory", 0xfffd0028, 4, base=16, bitRange=4 +-sfr = "CAN_ACR.MB5", "Memory", 0xfffd0028, 4, base=16, bitRange=5 +-sfr = "CAN_ACR.MB6", "Memory", 0xfffd0028, 4, base=16, bitRange=6 +-sfr = "CAN_ACR.MB7", "Memory", 0xfffd0028, 4, base=16, bitRange=7 +-sfr = "CAN_ACR.MB8", "Memory", 0xfffd0028, 4, base=16, bitRange=8 +-sfr = "CAN_ACR.MB9", "Memory", 0xfffd0028, 4, base=16, bitRange=9 +-sfr = "CAN_ACR.MB10", "Memory", 0xfffd0028, 4, base=16, bitRange=10 +-sfr = "CAN_ACR.MB11", "Memory", 0xfffd0028, 4, base=16, bitRange=11 +-sfr = "CAN_ACR.MB12", "Memory", 0xfffd0028, 4, base=16, bitRange=12 +-sfr = "CAN_ACR.MB13", "Memory", 0xfffd0028, 4, base=16, bitRange=13 +-sfr = "CAN_ACR.MB14", "Memory", 0xfffd0028, 4, base=16, bitRange=14 +-sfr = "CAN_ACR.MB15", "Memory", 0xfffd0028, 4, base=16, bitRange=15 +-sfr = "CAN_VR", "Memory", 0xfffd00fc, 4, base=16 +-; ========== Register definition for EMAC peripheral ========== +-sfr = "EMAC_NCR", "Memory", 0xfffdc000, 4, base=16 +-sfr = "EMAC_NCR.LB", "Memory", 0xfffdc000, 4, base=16, bitRange=0 +-sfr = "EMAC_NCR.LLB", "Memory", 0xfffdc000, 4, base=16, bitRange=1 +-sfr = "EMAC_NCR.RE", "Memory", 0xfffdc000, 4, base=16, bitRange=2 +-sfr = "EMAC_NCR.TE", "Memory", 0xfffdc000, 4, base=16, bitRange=3 +-sfr = "EMAC_NCR.MPE", "Memory", 0xfffdc000, 4, base=16, bitRange=4 +-sfr = "EMAC_NCR.CLRSTAT", "Memory", 0xfffdc000, 4, base=16, bitRange=5 +-sfr = "EMAC_NCR.INCSTAT", "Memory", 0xfffdc000, 4, base=16, bitRange=6 +-sfr = "EMAC_NCR.WESTAT", "Memory", 0xfffdc000, 4, base=16, bitRange=7 +-sfr = "EMAC_NCR.BP", "Memory", 0xfffdc000, 4, base=16, bitRange=8 +-sfr = "EMAC_NCR.TSTART", "Memory", 0xfffdc000, 4, base=16, bitRange=9 +-sfr = "EMAC_NCR.THALT", "Memory", 0xfffdc000, 4, base=16, bitRange=10 +-sfr = "EMAC_NCR.TPFR", "Memory", 0xfffdc000, 4, base=16, bitRange=11 +-sfr = "EMAC_NCR.TZQ", "Memory", 0xfffdc000, 4, base=16, bitRange=12 +-sfr = "EMAC_NCFGR", "Memory", 0xfffdc004, 4, base=16 +-sfr = "EMAC_NCFGR.SPD", "Memory", 0xfffdc004, 4, base=16, bitRange=0 +-sfr = "EMAC_NCFGR.FD", "Memory", 0xfffdc004, 4, base=16, bitRange=1 +-sfr = "EMAC_NCFGR.JFRAME", "Memory", 0xfffdc004, 4, base=16, bitRange=3 +-sfr = "EMAC_NCFGR.CAF", "Memory", 0xfffdc004, 4, base=16, bitRange=4 +-sfr = "EMAC_NCFGR.NBC", "Memory", 0xfffdc004, 4, base=16, bitRange=5 +-sfr = "EMAC_NCFGR.MTI", "Memory", 0xfffdc004, 4, base=16, bitRange=6 +-sfr = "EMAC_NCFGR.UNI", "Memory", 0xfffdc004, 4, base=16, bitRange=7 +-sfr = "EMAC_NCFGR.BIG", "Memory", 0xfffdc004, 4, base=16, bitRange=8 +-sfr = "EMAC_NCFGR.EAE", "Memory", 0xfffdc004, 4, base=16, bitRange=9 +-sfr = "EMAC_NCFGR.CLK", "Memory", 0xfffdc004, 4, base=16, bitRange=10-11 +-sfr = "EMAC_NCFGR.RTY", "Memory", 0xfffdc004, 4, base=16, bitRange=12 +-sfr = "EMAC_NCFGR.PAE", "Memory", 0xfffdc004, 4, base=16, bitRange=13 +-sfr = "EMAC_NCFGR.RBOF", "Memory", 0xfffdc004, 4, base=16, bitRange=14-15 +-sfr = "EMAC_NCFGR.RLCE", "Memory", 0xfffdc004, 4, base=16, bitRange=16 +-sfr = "EMAC_NCFGR.DRFCS", "Memory", 0xfffdc004, 4, base=16, bitRange=17 +-sfr = "EMAC_NCFGR.EFRHD", "Memory", 0xfffdc004, 4, base=16, bitRange=18 +-sfr = "EMAC_NCFGR.IRXFCS", "Memory", 0xfffdc004, 4, base=16, bitRange=19 +-sfr = "EMAC_NSR", "Memory", 0xfffdc008, 4, base=16 +-sfr = "EMAC_NSR.LINKR", "Memory", 0xfffdc008, 4, base=16, bitRange=0 +-sfr = "EMAC_NSR.MDIO", "Memory", 0xfffdc008, 4, base=16, bitRange=1 +-sfr = "EMAC_NSR.IDLE", "Memory", 0xfffdc008, 4, base=16, bitRange=2 +-sfr = "EMAC_TSR", "Memory", 0xfffdc014, 4, base=16 +-sfr = "EMAC_TSR.UBR", "Memory", 0xfffdc014, 4, base=16, bitRange=0 +-sfr = "EMAC_TSR.COL", "Memory", 0xfffdc014, 4, base=16, bitRange=1 +-sfr = "EMAC_TSR.RLES", "Memory", 0xfffdc014, 4, base=16, bitRange=2 +-sfr = "EMAC_TSR.TGO", "Memory", 0xfffdc014, 4, base=16, bitRange=3 +-sfr = "EMAC_TSR.BEX", "Memory", 0xfffdc014, 4, base=16, bitRange=4 +-sfr = "EMAC_TSR.COMP", "Memory", 0xfffdc014, 4, base=16, bitRange=5 +-sfr = "EMAC_TSR.UND", "Memory", 0xfffdc014, 4, base=16, bitRange=6 +-sfr = "EMAC_RBQP", "Memory", 0xfffdc018, 4, base=16 +-sfr = "EMAC_TBQP", "Memory", 0xfffdc01c, 4, base=16 +-sfr = "EMAC_RSR", "Memory", 0xfffdc020, 4, base=16 +-sfr = "EMAC_RSR.BNA", "Memory", 0xfffdc020, 4, base=16, bitRange=0 +-sfr = "EMAC_RSR.REC", "Memory", 0xfffdc020, 4, base=16, bitRange=1 +-sfr = "EMAC_RSR.OVR", "Memory", 0xfffdc020, 4, base=16, bitRange=2 +-sfr = "EMAC_ISR", "Memory", 0xfffdc024, 4, base=16 +-sfr = "EMAC_ISR.MFD", "Memory", 0xfffdc024, 4, base=16, bitRange=0 +-sfr = "EMAC_ISR.RCOMP", "Memory", 0xfffdc024, 4, base=16, bitRange=1 +-sfr = "EMAC_ISR.RXUBR", "Memory", 0xfffdc024, 4, base=16, bitRange=2 +-sfr = "EMAC_ISR.TXUBR", "Memory", 0xfffdc024, 4, base=16, bitRange=3 +-sfr = "EMAC_ISR.TUNDR", "Memory", 0xfffdc024, 4, base=16, bitRange=4 +-sfr = "EMAC_ISR.RLEX", "Memory", 0xfffdc024, 4, base=16, bitRange=5 +-sfr = "EMAC_ISR.TXERR", "Memory", 0xfffdc024, 4, base=16, bitRange=6 +-sfr = "EMAC_ISR.TCOMP", "Memory", 0xfffdc024, 4, base=16, bitRange=7 +-sfr = "EMAC_ISR.LINK", "Memory", 0xfffdc024, 4, base=16, bitRange=9 +-sfr = "EMAC_ISR.ROVR", "Memory", 0xfffdc024, 4, base=16, bitRange=10 +-sfr = "EMAC_ISR.HRESP", "Memory", 0xfffdc024, 4, base=16, bitRange=11 +-sfr = "EMAC_ISR.PFRE", "Memory", 0xfffdc024, 4, base=16, bitRange=12 +-sfr = "EMAC_ISR.PTZ", "Memory", 0xfffdc024, 4, base=16, bitRange=13 +-sfr = "EMAC_IER", "Memory", 0xfffdc028, 4, base=16 +-sfr = "EMAC_IER.MFD", "Memory", 0xfffdc028, 4, base=16, bitRange=0 +-sfr = "EMAC_IER.RCOMP", "Memory", 0xfffdc028, 4, base=16, bitRange=1 +-sfr = "EMAC_IER.RXUBR", "Memory", 0xfffdc028, 4, base=16, bitRange=2 +-sfr = "EMAC_IER.TXUBR", "Memory", 0xfffdc028, 4, base=16, bitRange=3 +-sfr = "EMAC_IER.TUNDR", "Memory", 0xfffdc028, 4, base=16, bitRange=4 +-sfr = "EMAC_IER.RLEX", "Memory", 0xfffdc028, 4, base=16, bitRange=5 +-sfr = "EMAC_IER.TXERR", "Memory", 0xfffdc028, 4, base=16, bitRange=6 +-sfr = "EMAC_IER.TCOMP", "Memory", 0xfffdc028, 4, base=16, bitRange=7 +-sfr = "EMAC_IER.LINK", "Memory", 0xfffdc028, 4, base=16, bitRange=9 +-sfr = "EMAC_IER.ROVR", "Memory", 0xfffdc028, 4, base=16, bitRange=10 +-sfr = "EMAC_IER.HRESP", "Memory", 0xfffdc028, 4, base=16, bitRange=11 +-sfr = "EMAC_IER.PFRE", "Memory", 0xfffdc028, 4, base=16, bitRange=12 +-sfr = "EMAC_IER.PTZ", "Memory", 0xfffdc028, 4, base=16, bitRange=13 +-sfr = "EMAC_IDR", "Memory", 0xfffdc02c, 4, base=16 +-sfr = "EMAC_IDR.MFD", "Memory", 0xfffdc02c, 4, base=16, bitRange=0 +-sfr = "EMAC_IDR.RCOMP", "Memory", 0xfffdc02c, 4, base=16, bitRange=1 +-sfr = "EMAC_IDR.RXUBR", "Memory", 0xfffdc02c, 4, base=16, bitRange=2 +-sfr = "EMAC_IDR.TXUBR", "Memory", 0xfffdc02c, 4, base=16, bitRange=3 +-sfr = "EMAC_IDR.TUNDR", "Memory", 0xfffdc02c, 4, base=16, bitRange=4 +-sfr = "EMAC_IDR.RLEX", "Memory", 0xfffdc02c, 4, base=16, bitRange=5 +-sfr = "EMAC_IDR.TXERR", "Memory", 0xfffdc02c, 4, base=16, bitRange=6 +-sfr = "EMAC_IDR.TCOMP", "Memory", 0xfffdc02c, 4, base=16, bitRange=7 +-sfr = "EMAC_IDR.LINK", "Memory", 0xfffdc02c, 4, base=16, bitRange=9 +-sfr = "EMAC_IDR.ROVR", "Memory", 0xfffdc02c, 4, base=16, bitRange=10 +-sfr = "EMAC_IDR.HRESP", "Memory", 0xfffdc02c, 4, base=16, bitRange=11 +-sfr = "EMAC_IDR.PFRE", "Memory", 0xfffdc02c, 4, base=16, bitRange=12 +-sfr = "EMAC_IDR.PTZ", "Memory", 0xfffdc02c, 4, base=16, bitRange=13 +-sfr = "EMAC_IMR", "Memory", 0xfffdc030, 4, base=16 +-sfr = "EMAC_IMR.MFD", "Memory", 0xfffdc030, 4, base=16, bitRange=0 +-sfr = "EMAC_IMR.RCOMP", "Memory", 0xfffdc030, 4, base=16, bitRange=1 +-sfr = "EMAC_IMR.RXUBR", "Memory", 0xfffdc030, 4, base=16, bitRange=2 +-sfr = "EMAC_IMR.TXUBR", "Memory", 0xfffdc030, 4, base=16, bitRange=3 +-sfr = "EMAC_IMR.TUNDR", "Memory", 0xfffdc030, 4, base=16, bitRange=4 +-sfr = "EMAC_IMR.RLEX", "Memory", 0xfffdc030, 4, base=16, bitRange=5 +-sfr = "EMAC_IMR.TXERR", "Memory", 0xfffdc030, 4, base=16, bitRange=6 +-sfr = "EMAC_IMR.TCOMP", "Memory", 0xfffdc030, 4, base=16, bitRange=7 +-sfr = "EMAC_IMR.LINK", "Memory", 0xfffdc030, 4, base=16, bitRange=9 +-sfr = "EMAC_IMR.ROVR", "Memory", 0xfffdc030, 4, base=16, bitRange=10 +-sfr = "EMAC_IMR.HRESP", "Memory", 0xfffdc030, 4, base=16, bitRange=11 +-sfr = "EMAC_IMR.PFRE", "Memory", 0xfffdc030, 4, base=16, bitRange=12 +-sfr = "EMAC_IMR.PTZ", "Memory", 0xfffdc030, 4, base=16, bitRange=13 +-sfr = "EMAC_MAN", "Memory", 0xfffdc034, 4, base=16 +-sfr = "EMAC_MAN.DATA", "Memory", 0xfffdc034, 4, base=16, bitRange=0-15 +-sfr = "EMAC_MAN.CODE", "Memory", 0xfffdc034, 4, base=16, bitRange=16-17 +-sfr = "EMAC_MAN.REGA", "Memory", 0xfffdc034, 4, base=16, bitRange=18-22 +-sfr = "EMAC_MAN.PHYA", "Memory", 0xfffdc034, 4, base=16, bitRange=23-27 +-sfr = "EMAC_MAN.RW", "Memory", 0xfffdc034, 4, base=16, bitRange=28-29 +-sfr = "EMAC_MAN.SOF", "Memory", 0xfffdc034, 4, base=16, bitRange=30-31 +-sfr = "EMAC_PTR", "Memory", 0xfffdc038, 4, base=16 +-sfr = "EMAC_PFR", "Memory", 0xfffdc03c, 4, base=16 +-sfr = "EMAC_FTO", "Memory", 0xfffdc040, 4, base=16 +-sfr = "EMAC_SCF", "Memory", 0xfffdc044, 4, base=16 +-sfr = "EMAC_MCF", "Memory", 0xfffdc048, 4, base=16 +-sfr = "EMAC_FRO", "Memory", 0xfffdc04c, 4, base=16 +-sfr = "EMAC_FCSE", "Memory", 0xfffdc050, 4, base=16 +-sfr = "EMAC_ALE", "Memory", 0xfffdc054, 4, base=16 +-sfr = "EMAC_DTF", "Memory", 0xfffdc058, 4, base=16 +-sfr = "EMAC_LCOL", "Memory", 0xfffdc05c, 4, base=16 +-sfr = "EMAC_ECOL", "Memory", 0xfffdc060, 4, base=16 +-sfr = "EMAC_TUND", "Memory", 0xfffdc064, 4, base=16 +-sfr = "EMAC_CSE", "Memory", 0xfffdc068, 4, base=16 +-sfr = "EMAC_RRE", "Memory", 0xfffdc06c, 4, base=16 +-sfr = "EMAC_ROV", "Memory", 0xfffdc070, 4, base=16 +-sfr = "EMAC_RSE", "Memory", 0xfffdc074, 4, base=16 +-sfr = "EMAC_ELE", "Memory", 0xfffdc078, 4, base=16 +-sfr = "EMAC_RJA", "Memory", 0xfffdc07c, 4, base=16 +-sfr = "EMAC_USF", "Memory", 0xfffdc080, 4, base=16 +-sfr = "EMAC_STE", "Memory", 0xfffdc084, 4, base=16 +-sfr = "EMAC_RLE", "Memory", 0xfffdc088, 4, base=16 +-sfr = "EMAC_TPF", "Memory", 0xfffdc08c, 4, base=16 +-sfr = "EMAC_HRB", "Memory", 0xfffdc090, 4, base=16 +-sfr = "EMAC_HRT", "Memory", 0xfffdc094, 4, base=16 +-sfr = "EMAC_SA1L", "Memory", 0xfffdc098, 4, base=16 +-sfr = "EMAC_SA1H", "Memory", 0xfffdc09c, 4, base=16 +-sfr = "EMAC_SA2L", "Memory", 0xfffdc0a0, 4, base=16 +-sfr = "EMAC_SA2H", "Memory", 0xfffdc0a4, 4, base=16 +-sfr = "EMAC_SA3L", "Memory", 0xfffdc0a8, 4, base=16 +-sfr = "EMAC_SA3H", "Memory", 0xfffdc0ac, 4, base=16 +-sfr = "EMAC_SA4L", "Memory", 0xfffdc0b0, 4, base=16 +-sfr = "EMAC_SA4H", "Memory", 0xfffdc0b4, 4, base=16 +-sfr = "EMAC_TID", "Memory", 0xfffdc0b8, 4, base=16 +-sfr = "EMAC_TPQ", "Memory", 0xfffdc0bc, 4, base=16 +-sfr = "EMAC_USRIO", "Memory", 0xfffdc0c0, 4, base=16 +-sfr = "EMAC_USRIO.RMII", "Memory", 0xfffdc0c0, 4, base=16, bitRange=0 +-sfr = "EMAC_USRIO.CLKEN", "Memory", 0xfffdc0c0, 4, base=16, bitRange=1 +-sfr = "EMAC_WOL", "Memory", 0xfffdc0c4, 4, base=16 +-sfr = "EMAC_WOL.IP", "Memory", 0xfffdc0c4, 4, base=16, bitRange=0-15 +-sfr = "EMAC_WOL.MAG", "Memory", 0xfffdc0c4, 4, base=16, bitRange=16 +-sfr = "EMAC_WOL.ARP", "Memory", 0xfffdc0c4, 4, base=16, bitRange=17 +-sfr = "EMAC_WOL.SA1", "Memory", 0xfffdc0c4, 4, base=16, bitRange=18 +-sfr = "EMAC_WOL.MTI", "Memory", 0xfffdc0c4, 4, base=16, bitRange=19 +-sfr = "EMAC_REV", "Memory", 0xfffdc0fc, 4, base=16 +-sfr = "EMAC_REV.REVREF", "Memory", 0xfffdc0fc, 4, base=16, bitRange=0-15 +-sfr = "EMAC_REV.PARTREF", "Memory", 0xfffdc0fc, 4, base=16, bitRange=16-31 +-; ========== Register definition for PDC_ADC peripheral ========== +-sfr = "ADC_RPR", "Memory", 0xfffd8100, 4, base=16 +-sfr = "ADC_RCR", "Memory", 0xfffd8104, 4, base=16 +-sfr = "ADC_TPR", "Memory", 0xfffd8108, 4, base=16 +-sfr = "ADC_TCR", "Memory", 0xfffd810c, 4, base=16 +-sfr = "ADC_RNPR", "Memory", 0xfffd8110, 4, base=16 +-sfr = "ADC_RNCR", "Memory", 0xfffd8114, 4, base=16 +-sfr = "ADC_TNPR", "Memory", 0xfffd8118, 4, base=16 +-sfr = "ADC_TNCR", "Memory", 0xfffd811c, 4, base=16 +-sfr = "ADC_PTCR", "Memory", 0xfffd8120, 4, base=16 +-sfr = "ADC_PTCR.RXTEN", "Memory", 0xfffd8120, 4, base=16, bitRange=0 +-sfr = "ADC_PTCR.RXTDIS", "Memory", 0xfffd8120, 4, base=16, bitRange=1 +-sfr = "ADC_PTCR.TXTEN", "Memory", 0xfffd8120, 4, base=16, bitRange=8 +-sfr = "ADC_PTCR.TXTDIS", "Memory", 0xfffd8120, 4, base=16, bitRange=9 +-sfr = "ADC_PTSR", "Memory", 0xfffd8124, 4, base=16 +-sfr = "ADC_PTSR.RXTEN", "Memory", 0xfffd8124, 4, base=16, bitRange=0 +-sfr = "ADC_PTSR.TXTEN", "Memory", 0xfffd8124, 4, base=16, bitRange=8 +-; ========== Register definition for ADC peripheral ========== +-sfr = "ADC_CR", "Memory", 0xfffd8000, 4, base=16 +-sfr = "ADC_CR.SWRST", "Memory", 0xfffd8000, 4, base=16, bitRange=0 +-sfr = "ADC_CR.START", "Memory", 0xfffd8000, 4, base=16, bitRange=1 +-sfr = "ADC_MR", "Memory", 0xfffd8004, 4, base=16 +-sfr = "ADC_MR.TRGEN", "Memory", 0xfffd8004, 4, base=16, bitRange=0 +-sfr = "ADC_MR.TRGSEL", "Memory", 0xfffd8004, 4, base=16, bitRange=1-3 +-sfr = "ADC_MR.LOWRES", "Memory", 0xfffd8004, 4, base=16, bitRange=4 +-sfr = "ADC_MR.SLEEP", "Memory", 0xfffd8004, 4, base=16, bitRange=5 +-sfr = "ADC_MR.PRESCAL", "Memory", 0xfffd8004, 4, base=16, bitRange=8-13 +-sfr = "ADC_MR.STARTUP", "Memory", 0xfffd8004, 4, base=16, bitRange=16-20 +-sfr = "ADC_MR.SHTIM", "Memory", 0xfffd8004, 4, base=16, bitRange=24-27 +-sfr = "ADC_CHER", "Memory", 0xfffd8010, 4, base=16 +-sfr = "ADC_CHER.CH0", "Memory", 0xfffd8010, 4, base=16, bitRange=0 +-sfr = "ADC_CHER.CH1", "Memory", 0xfffd8010, 4, base=16, bitRange=1 +-sfr = "ADC_CHER.CH2", "Memory", 0xfffd8010, 4, base=16, bitRange=2 +-sfr = "ADC_CHER.CH3", "Memory", 0xfffd8010, 4, base=16, bitRange=3 +-sfr = "ADC_CHER.CH4", "Memory", 0xfffd8010, 4, base=16, bitRange=4 +-sfr = "ADC_CHER.CH5", "Memory", 0xfffd8010, 4, base=16, bitRange=5 +-sfr = "ADC_CHER.CH6", "Memory", 0xfffd8010, 4, base=16, bitRange=6 +-sfr = "ADC_CHER.CH7", "Memory", 0xfffd8010, 4, base=16, bitRange=7 +-sfr = "ADC_CHDR", "Memory", 0xfffd8014, 4, base=16 +-sfr = "ADC_CHDR.CH0", "Memory", 0xfffd8014, 4, base=16, bitRange=0 +-sfr = "ADC_CHDR.CH1", "Memory", 0xfffd8014, 4, base=16, bitRange=1 +-sfr = "ADC_CHDR.CH2", "Memory", 0xfffd8014, 4, base=16, bitRange=2 +-sfr = "ADC_CHDR.CH3", "Memory", 0xfffd8014, 4, base=16, bitRange=3 +-sfr = "ADC_CHDR.CH4", "Memory", 0xfffd8014, 4, base=16, bitRange=4 +-sfr = "ADC_CHDR.CH5", "Memory", 0xfffd8014, 4, base=16, bitRange=5 +-sfr = "ADC_CHDR.CH6", "Memory", 0xfffd8014, 4, base=16, bitRange=6 +-sfr = "ADC_CHDR.CH7", "Memory", 0xfffd8014, 4, base=16, bitRange=7 +-sfr = "ADC_CHSR", "Memory", 0xfffd8018, 4, base=16 +-sfr = "ADC_CHSR.CH0", "Memory", 0xfffd8018, 4, base=16, bitRange=0 +-sfr = "ADC_CHSR.CH1", "Memory", 0xfffd8018, 4, base=16, bitRange=1 +-sfr = "ADC_CHSR.CH2", "Memory", 0xfffd8018, 4, base=16, bitRange=2 +-sfr = "ADC_CHSR.CH3", "Memory", 0xfffd8018, 4, base=16, bitRange=3 +-sfr = "ADC_CHSR.CH4", "Memory", 0xfffd8018, 4, base=16, bitRange=4 +-sfr = "ADC_CHSR.CH5", "Memory", 0xfffd8018, 4, base=16, bitRange=5 +-sfr = "ADC_CHSR.CH6", "Memory", 0xfffd8018, 4, base=16, bitRange=6 +-sfr = "ADC_CHSR.CH7", "Memory", 0xfffd8018, 4, base=16, bitRange=7 +-sfr = "ADC_SR", "Memory", 0xfffd801c, 4, base=16 +-sfr = "ADC_SR.EOC0", "Memory", 0xfffd801c, 4, base=16, bitRange=0 +-sfr = "ADC_SR.EOC1", "Memory", 0xfffd801c, 4, base=16, bitRange=1 +-sfr = "ADC_SR.EOC2", "Memory", 0xfffd801c, 4, base=16, bitRange=2 +-sfr = "ADC_SR.EOC3", "Memory", 0xfffd801c, 4, base=16, bitRange=3 +-sfr = "ADC_SR.EOC4", "Memory", 0xfffd801c, 4, base=16, bitRange=4 +-sfr = "ADC_SR.EOC5", "Memory", 0xfffd801c, 4, base=16, bitRange=5 +-sfr = "ADC_SR.EOC6", "Memory", 0xfffd801c, 4, base=16, bitRange=6 +-sfr = "ADC_SR.EOC7", "Memory", 0xfffd801c, 4, base=16, bitRange=7 +-sfr = "ADC_SR.OVRE0", "Memory", 0xfffd801c, 4, base=16, bitRange=8 +-sfr = "ADC_SR.OVRE1", "Memory", 0xfffd801c, 4, base=16, bitRange=9 +-sfr = "ADC_SR.OVRE2", "Memory", 0xfffd801c, 4, base=16, bitRange=10 +-sfr = "ADC_SR.OVRE3", "Memory", 0xfffd801c, 4, base=16, bitRange=11 +-sfr = "ADC_SR.OVRE4", "Memory", 0xfffd801c, 4, base=16, bitRange=12 +-sfr = "ADC_SR.OVRE5", "Memory", 0xfffd801c, 4, base=16, bitRange=13 +-sfr = "ADC_SR.OVRE6", "Memory", 0xfffd801c, 4, base=16, bitRange=14 +-sfr = "ADC_SR.OVRE7", "Memory", 0xfffd801c, 4, base=16, bitRange=15 +-sfr = "ADC_SR.DRDY", "Memory", 0xfffd801c, 4, base=16, bitRange=16 +-sfr = "ADC_SR.GOVRE", "Memory", 0xfffd801c, 4, base=16, bitRange=17 +-sfr = "ADC_SR.ENDRX", "Memory", 0xfffd801c, 4, base=16, bitRange=18 +-sfr = "ADC_SR.RXBUFF", "Memory", 0xfffd801c, 4, base=16, bitRange=19 +-sfr = "ADC_LCDR", "Memory", 0xfffd8020, 4, base=16 +-sfr = "ADC_LCDR.LDATA", "Memory", 0xfffd8020, 4, base=16, bitRange=0-9 +-sfr = "ADC_IER", "Memory", 0xfffd8024, 4, base=16 +-sfr = "ADC_IER.EOC0", "Memory", 0xfffd8024, 4, base=16, bitRange=0 +-sfr = "ADC_IER.EOC1", "Memory", 0xfffd8024, 4, base=16, bitRange=1 +-sfr = "ADC_IER.EOC2", "Memory", 0xfffd8024, 4, base=16, bitRange=2 +-sfr = "ADC_IER.EOC3", "Memory", 0xfffd8024, 4, base=16, bitRange=3 +-sfr = "ADC_IER.EOC4", "Memory", 0xfffd8024, 4, base=16, bitRange=4 +-sfr = "ADC_IER.EOC5", "Memory", 0xfffd8024, 4, base=16, bitRange=5 +-sfr = "ADC_IER.EOC6", "Memory", 0xfffd8024, 4, base=16, bitRange=6 +-sfr = "ADC_IER.EOC7", "Memory", 0xfffd8024, 4, base=16, bitRange=7 +-sfr = "ADC_IER.OVRE0", "Memory", 0xfffd8024, 4, base=16, bitRange=8 +-sfr = "ADC_IER.OVRE1", "Memory", 0xfffd8024, 4, base=16, bitRange=9 +-sfr = "ADC_IER.OVRE2", "Memory", 0xfffd8024, 4, base=16, bitRange=10 +-sfr = "ADC_IER.OVRE3", "Memory", 0xfffd8024, 4, base=16, bitRange=11 +-sfr = "ADC_IER.OVRE4", "Memory", 0xfffd8024, 4, base=16, bitRange=12 +-sfr = "ADC_IER.OVRE5", "Memory", 0xfffd8024, 4, base=16, bitRange=13 +-sfr = "ADC_IER.OVRE6", "Memory", 0xfffd8024, 4, base=16, bitRange=14 +-sfr = "ADC_IER.OVRE7", "Memory", 0xfffd8024, 4, base=16, bitRange=15 +-sfr = "ADC_IER.DRDY", "Memory", 0xfffd8024, 4, base=16, bitRange=16 +-sfr = "ADC_IER.GOVRE", "Memory", 0xfffd8024, 4, base=16, bitRange=17 +-sfr = "ADC_IER.ENDRX", "Memory", 0xfffd8024, 4, base=16, bitRange=18 +-sfr = "ADC_IER.RXBUFF", "Memory", 0xfffd8024, 4, base=16, bitRange=19 +-sfr = "ADC_IDR", "Memory", 0xfffd8028, 4, base=16 +-sfr = "ADC_IDR.EOC0", "Memory", 0xfffd8028, 4, base=16, bitRange=0 +-sfr = "ADC_IDR.EOC1", "Memory", 0xfffd8028, 4, base=16, bitRange=1 +-sfr = "ADC_IDR.EOC2", "Memory", 0xfffd8028, 4, base=16, bitRange=2 +-sfr = "ADC_IDR.EOC3", "Memory", 0xfffd8028, 4, base=16, bitRange=3 +-sfr = "ADC_IDR.EOC4", "Memory", 0xfffd8028, 4, base=16, bitRange=4 +-sfr = "ADC_IDR.EOC5", "Memory", 0xfffd8028, 4, base=16, bitRange=5 +-sfr = "ADC_IDR.EOC6", "Memory", 0xfffd8028, 4, base=16, bitRange=6 +-sfr = "ADC_IDR.EOC7", "Memory", 0xfffd8028, 4, base=16, bitRange=7 +-sfr = "ADC_IDR.OVRE0", "Memory", 0xfffd8028, 4, base=16, bitRange=8 +-sfr = "ADC_IDR.OVRE1", "Memory", 0xfffd8028, 4, base=16, bitRange=9 +-sfr = "ADC_IDR.OVRE2", "Memory", 0xfffd8028, 4, base=16, bitRange=10 +-sfr = "ADC_IDR.OVRE3", "Memory", 0xfffd8028, 4, base=16, bitRange=11 +-sfr = "ADC_IDR.OVRE4", "Memory", 0xfffd8028, 4, base=16, bitRange=12 +-sfr = "ADC_IDR.OVRE5", "Memory", 0xfffd8028, 4, base=16, bitRange=13 +-sfr = "ADC_IDR.OVRE6", "Memory", 0xfffd8028, 4, base=16, bitRange=14 +-sfr = "ADC_IDR.OVRE7", "Memory", 0xfffd8028, 4, base=16, bitRange=15 +-sfr = "ADC_IDR.DRDY", "Memory", 0xfffd8028, 4, base=16, bitRange=16 +-sfr = "ADC_IDR.GOVRE", "Memory", 0xfffd8028, 4, base=16, bitRange=17 +-sfr = "ADC_IDR.ENDRX", "Memory", 0xfffd8028, 4, base=16, bitRange=18 +-sfr = "ADC_IDR.RXBUFF", "Memory", 0xfffd8028, 4, base=16, bitRange=19 +-sfr = "ADC_IMR", "Memory", 0xfffd802c, 4, base=16 +-sfr = "ADC_IMR.EOC0", "Memory", 0xfffd802c, 4, base=16, bitRange=0 +-sfr = "ADC_IMR.EOC1", "Memory", 0xfffd802c, 4, base=16, bitRange=1 +-sfr = "ADC_IMR.EOC2", "Memory", 0xfffd802c, 4, base=16, bitRange=2 +-sfr = "ADC_IMR.EOC3", "Memory", 0xfffd802c, 4, base=16, bitRange=3 +-sfr = "ADC_IMR.EOC4", "Memory", 0xfffd802c, 4, base=16, bitRange=4 +-sfr = "ADC_IMR.EOC5", "Memory", 0xfffd802c, 4, base=16, bitRange=5 +-sfr = "ADC_IMR.EOC6", "Memory", 0xfffd802c, 4, base=16, bitRange=6 +-sfr = "ADC_IMR.EOC7", "Memory", 0xfffd802c, 4, base=16, bitRange=7 +-sfr = "ADC_IMR.OVRE0", "Memory", 0xfffd802c, 4, base=16, bitRange=8 +-sfr = "ADC_IMR.OVRE1", "Memory", 0xfffd802c, 4, base=16, bitRange=9 +-sfr = "ADC_IMR.OVRE2", "Memory", 0xfffd802c, 4, base=16, bitRange=10 +-sfr = "ADC_IMR.OVRE3", "Memory", 0xfffd802c, 4, base=16, bitRange=11 +-sfr = "ADC_IMR.OVRE4", "Memory", 0xfffd802c, 4, base=16, bitRange=12 +-sfr = "ADC_IMR.OVRE5", "Memory", 0xfffd802c, 4, base=16, bitRange=13 +-sfr = "ADC_IMR.OVRE6", "Memory", 0xfffd802c, 4, base=16, bitRange=14 +-sfr = "ADC_IMR.OVRE7", "Memory", 0xfffd802c, 4, base=16, bitRange=15 +-sfr = "ADC_IMR.DRDY", "Memory", 0xfffd802c, 4, base=16, bitRange=16 +-sfr = "ADC_IMR.GOVRE", "Memory", 0xfffd802c, 4, base=16, bitRange=17 +-sfr = "ADC_IMR.ENDRX", "Memory", 0xfffd802c, 4, base=16, bitRange=18 +-sfr = "ADC_IMR.RXBUFF", "Memory", 0xfffd802c, 4, base=16, bitRange=19 +-sfr = "ADC_CDR0", "Memory", 0xfffd8030, 4, base=16 +-sfr = "ADC_CDR0.DATA", "Memory", 0xfffd8030, 4, base=16, bitRange=0-9 +-sfr = "ADC_CDR1", "Memory", 0xfffd8034, 4, base=16 +-sfr = "ADC_CDR1.DATA", "Memory", 0xfffd8034, 4, base=16, bitRange=0-9 +-sfr = "ADC_CDR2", "Memory", 0xfffd8038, 4, base=16 +-sfr = "ADC_CDR2.DATA", "Memory", 0xfffd8038, 4, base=16, bitRange=0-9 +-sfr = "ADC_CDR3", "Memory", 0xfffd803c, 4, base=16 +-sfr = "ADC_CDR3.DATA", "Memory", 0xfffd803c, 4, base=16, bitRange=0-9 +-sfr = "ADC_CDR4", "Memory", 0xfffd8040, 4, base=16 +-sfr = "ADC_CDR4.DATA", "Memory", 0xfffd8040, 4, base=16, bitRange=0-9 +-sfr = "ADC_CDR5", "Memory", 0xfffd8044, 4, base=16 +-sfr = "ADC_CDR5.DATA", "Memory", 0xfffd8044, 4, base=16, bitRange=0-9 +-sfr = "ADC_CDR6", "Memory", 0xfffd8048, 4, base=16 +-sfr = "ADC_CDR6.DATA", "Memory", 0xfffd8048, 4, base=16, bitRange=0-9 +-sfr = "ADC_CDR7", "Memory", 0xfffd804c, 4, base=16 +-sfr = "ADC_CDR7.DATA", "Memory", 0xfffd804c, 4, base=16, bitRange=0-9 +- +- +-[SfrGroupInfo] +-group = "TC0", "TC0_CCR", "TC0_CMR", "TC0_CV", "TC0_RA", "TC0_RB", "TC0_RC", "TC0_SR", "TC0_IER", "TC0_IDR", "TC0_IMR" +-group = "TCB", "TCB_BCR", "TCB_BMR" +-group = "TC1", "TC1_CCR", "TC1_CMR", "TC1_CV", "TC1_RA", "TC1_RB", "TC1_RC", "TC1_SR", "TC1_IER", "TC1_IDR", "TC1_IMR" +-group = "TC2", "TC2_CCR", "TC2_CMR", "TC2_CV", "TC2_RA", "TC2_RB", "TC2_RC", "TC2_SR", "TC2_IER", "TC2_IDR", "TC2_IMR" +-group = "UDP", "UDP_NUM", "UDP_GLBSTATE", "UDP_FADDR", "UDP_IER", "UDP_IDR", "UDP_IMR", "UDP_ISR", "UDP_ICR", "UDP_RSTEP", "UDP_CSR", "UDP_FDR", "UDP_TXVC" +-group = "TWI", "TWI_CR", "TWI_MMR", "TWI_IADR", "TWI_CWGR", "TWI_SR", "TWI_IER", "TWI_IDR", "TWI_IMR", "TWI_RHR", "TWI_THR" +-group = "US0", "US0_CR", "US0_MR", "US0_IER", "US0_IDR", "US0_IMR", "US0_CSR", "US0_RHR", "US0_THR", "US0_BRGR", "US0_RTOR", "US0_TTGR", "US0_FIDI", "US0_NER", "US0_IF" +-group = "PDC_US0", "US0_RPR", "US0_RCR", "US0_TPR", "US0_TCR", "US0_RNPR", "US0_RNCR", "US0_TNPR", "US0_TNCR", "US0_PTCR", "US0_PTSR" +-group = "US1", "US1_CR", "US1_MR", "US1_IER", "US1_IDR", "US1_IMR", "US1_CSR", "US1_RHR", "US1_THR", "US1_BRGR", "US1_RTOR", "US1_TTGR", "US1_FIDI", "US1_NER", "US1_IF" +-group = "PDC_US1", "US1_RPR", "US1_RCR", "US1_TPR", "US1_TCR", "US1_RNPR", "US1_RNCR", "US1_TNPR", "US1_TNCR", "US1_PTCR", "US1_PTSR" +-group = "PWMC", "PWMC_MR", "PWMC_ENA", "PWMC_DIS", "PWMC_SR", "PWMC_IER", "PWMC_IDR", "PWMC_IMR", "PWMC_ISR", "PWMC_VR" +-group = "PWMC_CH0", "PWMC_CH0_CMR", "PWMC_CH0_CDTYR", "PWMC_CH0_CPRDR", "PWMC_CH0_CCNTR", "PWMC_CH0_CUPDR", "PWMC_CH0_Reserved" +-group = "PWMC_CH1", "PWMC_CH1_CMR", "PWMC_CH1_CDTYR", "PWMC_CH1_CPRDR", "PWMC_CH1_CCNTR", "PWMC_CH1_CUPDR", "PWMC_CH1_Reserved" +-group = "PWMC_CH2", "PWMC_CH2_CMR", "PWMC_CH2_CDTYR", "PWMC_CH2_CPRDR", "PWMC_CH2_CCNTR", "PWMC_CH2_CUPDR", "PWMC_CH2_Reserved" +-group = "PWMC_CH3", "PWMC_CH3_CMR", "PWMC_CH3_CDTYR", "PWMC_CH3_CPRDR", "PWMC_CH3_CCNTR", "PWMC_CH3_CUPDR", "PWMC_CH3_Reserved" +-group = "CAN", "CAN_MR", "CAN_IER", "CAN_IDR", "CAN_IMR", "CAN_SR", "CAN_BR", "CAN_TIM", "CAN_TIMESTP", "CAN_ECR", "CAN_TCR", "CAN_ACR", "CAN_VR" +-group = "CAN_MB0", "CAN_MB0_MMR", "CAN_MB0_MAM", "CAN_MB0_MID", "CAN_MB0_MFID", "CAN_MB0_MSR", "CAN_MB0_MDL", "CAN_MB0_MDH", "CAN_MB0_MCR" +-group = "CAN_MB1", "CAN_MB1_MMR", "CAN_MB1_MAM", "CAN_MB1_MID", "CAN_MB1_MFID", "CAN_MB1_MSR", "CAN_MB1_MDL", "CAN_MB1_MDH", "CAN_MB1_MCR" +-group = "CAN_MB2", "CAN_MB2_MMR", "CAN_MB2_MAM", "CAN_MB2_MID", "CAN_MB2_MFID", "CAN_MB2_MSR", "CAN_MB2_MDL", "CAN_MB2_MDH", "CAN_MB2_MCR" +-group = "CAN_MB3", "CAN_MB3_MMR", "CAN_MB3_MAM", "CAN_MB3_MID", "CAN_MB3_MFID", "CAN_MB3_MSR", "CAN_MB3_MDL", "CAN_MB3_MDH", "CAN_MB3_MCR" +-group = "CAN_MB4", "CAN_MB4_MMR", "CAN_MB4_MAM", "CAN_MB4_MID", "CAN_MB4_MFID", "CAN_MB4_MSR", "CAN_MB4_MDL", "CAN_MB4_MDH", "CAN_MB4_MCR" +-group = "CAN_MB5", "CAN_MB5_MMR", "CAN_MB5_MAM", "CAN_MB5_MID", "CAN_MB5_MFID", "CAN_MB5_MSR", "CAN_MB5_MDL", "CAN_MB5_MDH", "CAN_MB5_MCR" +-group = "CAN_MB6", "CAN_MB6_MMR", "CAN_MB6_MAM", "CAN_MB6_MID", "CAN_MB6_MFID", "CAN_MB6_MSR", "CAN_MB6_MDL", "CAN_MB6_MDH", "CAN_MB6_MCR" +-group = "CAN_MB7", "CAN_MB7_MMR", "CAN_MB7_MAM", "CAN_MB7_MID", "CAN_MB7_MFID", "CAN_MB7_MSR", "CAN_MB7_MDL", "CAN_MB7_MDH", "CAN_MB7_MCR" +-group = "SSC", "SSC_CR", "SSC_CMR", "SSC_RCMR", "SSC_RFMR", "SSC_TCMR", "SSC_TFMR", "SSC_RHR", "SSC_THR", "SSC_RSHR", "SSC_TSHR", "SSC_SR", "SSC_IER", "SSC_IDR", "SSC_IMR" +-group = "PDC_SSC", "SSC_RPR", "SSC_RCR", "SSC_TPR", "SSC_TCR", "SSC_RNPR", "SSC_RNCR", "SSC_TNPR", "SSC_TNCR", "SSC_PTCR", "SSC_PTSR" +-group = "ADC", "ADC_CR", "ADC_MR", "ADC_CHER", "ADC_CHDR", "ADC_CHSR", "ADC_SR", "ADC_LCDR", "ADC_IER", "ADC_IDR", "ADC_IMR", "ADC_CDR0", "ADC_CDR1", "ADC_CDR2", "ADC_CDR3", "ADC_CDR4", "ADC_CDR5", "ADC_CDR6", "ADC_CDR7" +-group = "PDC_ADC", "ADC_RPR", "ADC_RCR", "ADC_TPR", "ADC_TCR", "ADC_RNPR", "ADC_RNCR", "ADC_TNPR", "ADC_TNCR", "ADC_PTCR", "ADC_PTSR" +-group = "EMAC", "EMAC_NCR", "EMAC_NCFGR", "EMAC_NSR", "EMAC_TSR", "EMAC_RBQP", "EMAC_TBQP", "EMAC_RSR", "EMAC_ISR", "EMAC_IER", "EMAC_IDR", "EMAC_IMR", "EMAC_MAN", "EMAC_PTR", "EMAC_PFR", "EMAC_FTO", "EMAC_SCF", "EMAC_MCF", "EMAC_FRO", "EMAC_FCSE", "EMAC_ALE", "EMAC_DTF", "EMAC_LCOL", "EMAC_ECOL", "EMAC_TUND", "EMAC_CSE", "EMAC_RRE", "EMAC_ROV", "EMAC_RSE", "EMAC_ELE", "EMAC_RJA", "EMAC_USF", "EMAC_STE", "EMAC_RLE", "EMAC_TPF", "EMAC_HRB", "EMAC_HRT", "EMAC_SA1L", "EMAC_SA1H", "EMAC_SA2L", "EMAC_SA2H", "EMAC_SA3L", "EMAC_SA3H", "EMAC_SA4L", "EMAC_SA4H", "EMAC_TID", "EMAC_TPQ", "EMAC_USRIO", "EMAC_WOL", "EMAC_REV" +-group = "SPI0", "SPI0_CR", "SPI0_MR", "SPI0_RDR", "SPI0_TDR", "SPI0_SR", "SPI0_IER", "SPI0_IDR", "SPI0_IMR", "SPI0_CSR" +-group = "PDC_SPI0", "SPI0_RPR", "SPI0_RCR", "SPI0_TPR", "SPI0_TCR", "SPI0_RNPR", "SPI0_RNCR", "SPI0_TNPR", "SPI0_TNCR", "SPI0_PTCR", "SPI0_PTSR" +-group = "SPI1", "SPI1_CR", "SPI1_MR", "SPI1_RDR", "SPI1_TDR", "SPI1_SR", "SPI1_IER", "SPI1_IDR", "SPI1_IMR", "SPI1_CSR" +-group = "PDC_SPI1", "SPI1_RPR", "SPI1_RCR", "SPI1_TPR", "SPI1_TCR", "SPI1_RNPR", "SPI1_RNCR", "SPI1_TNPR", "SPI1_TNCR", "SPI1_PTCR", "SPI1_PTSR" +-group = "SYS" +-group = "AIC", "AIC_SMR", "AIC_SVR", "AIC_IVR", "AIC_FVR", "AIC_ISR", "AIC_IPR", "AIC_IMR", "AIC_CISR", "AIC_IECR", "AIC_IDCR", "AIC_ICCR", "AIC_ISCR", "AIC_EOICR", "AIC_SPU", "AIC_DCR", "AIC_FFER", "AIC_FFDR", "AIC_FFSR" +-group = "DBGU", "DBGU_CR", "DBGU_MR", "DBGU_IER", "DBGU_IDR", "DBGU_IMR", "DBGU_CSR", "DBGU_RHR", "DBGU_THR", "DBGU_BRGR", "DBGU_CIDR", "DBGU_EXID", "DBGU_FNTR" +-group = "PDC_DBGU", "DBGU_RPR", "DBGU_RCR", "DBGU_TPR", "DBGU_TCR", "DBGU_RNPR", "DBGU_RNCR", "DBGU_TNPR", "DBGU_TNCR", "DBGU_PTCR", "DBGU_PTSR" +-group = "PIOA", "PIOA_PER", "PIOA_PDR", "PIOA_PSR", "PIOA_OER", "PIOA_ODR", "PIOA_OSR", "PIOA_IFER", "PIOA_IFDR", "PIOA_IFSR", "PIOA_SODR", "PIOA_CODR", "PIOA_ODSR", "PIOA_PDSR", "PIOA_IER", "PIOA_IDR", "PIOA_IMR", "PIOA_ISR", "PIOA_MDER", "PIOA_MDDR", "PIOA_MDSR", "PIOA_PPUDR", "PIOA_PPUER", "PIOA_PPUSR", "PIOA_ASR", "PIOA_BSR", "PIOA_ABSR", "PIOA_OWER", "PIOA_OWDR", "PIOA_OWSR" +-group = "PIOB", "PIOB_PER", "PIOB_PDR", "PIOB_PSR", "PIOB_OER", "PIOB_ODR", "PIOB_OSR", "PIOB_IFER", "PIOB_IFDR", "PIOB_IFSR", "PIOB_SODR", "PIOB_CODR", "PIOB_ODSR", "PIOB_PDSR", "PIOB_IER", "PIOB_IDR", "PIOB_IMR", "PIOB_ISR", "PIOB_MDER", "PIOB_MDDR", "PIOB_MDSR", "PIOB_PPUDR", "PIOB_PPUER", "PIOB_PPUSR", "PIOB_ASR", "PIOB_BSR", "PIOB_ABSR", "PIOB_OWER", "PIOB_OWDR", "PIOB_OWSR" +-group = "PMC", "PMC_SCER", "PMC_SCDR", "PMC_SCSR", "PMC_PCER", "PMC_PCDR", "PMC_PCSR", "PMC_MOR", "PMC_MCFR", "PMC_PLLR", "PMC_MCKR", "PMC_PCKR", "PMC_IER", "PMC_IDR", "PMC_SR", "PMC_IMR" +-group = "CKGR", "CKGR_MOR", "CKGR_MCFR", "CKGR_PLLR" +-group = "RSTC", "RSTC_RCR", "RSTC_RSR", "RSTC_RMR" +-group = "RTTC", "RTTC_RTMR", "RTTC_RTAR", "RTTC_RTVR", "RTTC_RTSR" +-group = "PITC", "PITC_PIMR", "PITC_PISR", "PITC_PIVR", "PITC_PIIR" +-group = "WDTC", "WDTC_WDCR", "WDTC_WDMR", "WDTC_WDSR" +-group = "VREG", "VREG_MR" +-group = "MC", "MC_RCR", "MC_ASR", "MC_AASR", "MC_FMR", "MC_FCR", "MC_FSR" +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.dep b/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.dep +deleted file mode 100644 +index ed687695d2..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.dep ++++ /dev/null +@@ -1,3691 +0,0 @@ +- +- +- +- 2 +- +- Debug +- +- $PROJ_DIR$\Debug\Obj\Main.r79 +- $PROJ_DIR$\Debug\Obj\IntrinsicsWrapper.r79 +- $PROJ_DIR$\Debug\Obj\cmock_demo.pbd +- $PROJ_DIR$\Debug\Obj\TimerInterruptConfigurator.r79 +- $PROJ_DIR$\Debug\Obj\AdcConductor.r79 +- $PROJ_DIR$\Debug\Obj\AdcModel.pbi +- $PROJ_DIR$\Debug\Obj\Model.pbi +- $PROJ_DIR$\Debug\Obj\AdcModel.r79 +- $PROJ_DIR$\Debug\Obj\UsartModel.r79 +- $PROJ_DIR$\Debug\Obj\TemperatureFilter.pbi +- $PROJ_DIR$\Debug\List\AdcHardwareConfigurator.lst +- $PROJ_DIR$\Debug\Obj\UsartConductor.pbi +- $PROJ_DIR$\..\..\examples\src\Types.h +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h +- $TOOLKIT_DIR$\inc\DLib_Defaults.h +- $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h +- $PROJ_DIR$\..\..\examples\src\AdcConductor.h +- $PROJ_DIR$\Debug\List\TimerInterruptHandler.lst +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.h +- $PROJ_DIR$\..\..\examples\src\UsartConductor.h +- $PROJ_DIR$\..\..\examples\src\Model.h +- $TOOLKIT_DIR$\inc\intrinsics.h +- $PROJ_DIR$\Debug\Obj\UsartHardware.pbi +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h +- $PROJ_DIR$\Debug\Exe\cmock_demo.d79 +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h +- $PROJ_DIR$\..\..\examples\src\AdcHardware.h +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h +- $PROJ_DIR$\..\..\examples\src\TimerConductor.h +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.h +- $PROJ_DIR$\Debug\Obj\Executor.pbi +- $PROJ_DIR$\..\..\examples\src\UsartModel.h +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h +- $PROJ_DIR$\Debug\List\UsartBaudRateRegisterCalculator.lst +- $PROJ_DIR$\..\..\examples\src\UsartHardware.h +- $PROJ_DIR$\Debug\List\UsartModel.lst +- $PROJ_DIR$\Debug\List\Executor.lst +- $PROJ_DIR$\Debug\List\UsartTransmitBufferStatus.lst +- $PROJ_DIR$\Debug\Exe\cmock_demo.sim +- $PROJ_DIR$\Debug\List\TimerModel.lst +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\Debug\List\TimerHardware.lst +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h +- $PROJ_DIR$\Debug\Obj\UsartTransmitBufferStatus.r79 +- $PROJ_DIR$\..\..\examples\src\TimerModel.h +- $PROJ_DIR$\Debug\List\IntrinsicsWrapper.lst +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h +- $PROJ_DIR$\..\..\examples\src\TimerHardware.h +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h +- $PROJ_DIR$\Debug\List\Cstartup_SAM7.lst +- $TOOLKIT_DIR$\inc\DLib_Product.h +- $PROJ_DIR$\Debug\Obj\UsartModel.pbi +- $TOOLKIT_DIR$\inc\math.h +- $PROJ_DIR$\Debug\Obj\AdcHardware.r79 +- $PROJ_DIR$\Debug\Obj\TimerModel.r79 +- $TOOLKIT_DIR$\inc\stdio.h +- $PROJ_DIR$\Debug\Obj\UsartConfigurator.pbi +- $PROJ_DIR$\Debug\List\AdcModel.lst +- $PROJ_DIR$\Debug\List\AdcConductor.lst +- $PROJ_DIR$\Debug\List\UsartConductor.lst +- $PROJ_DIR$\Debug\List\Model.lst +- $PROJ_DIR$\Debug\List\TaskScheduler.lst +- $PROJ_DIR$\Debug\List\UsartHardware.lst +- $PROJ_DIR$\Debug\List\AdcHardware.lst +- $PROJ_DIR$\Debug\List\Main.lst +- $PROJ_DIR$\Debug\Obj\UsartBaudRateRegisterCalculator.r79 +- $PROJ_DIR$\Debug\Obj\AdcConductor.pbi +- $PROJ_DIR$\Debug\Obj\TaskScheduler.pbi +- $PROJ_DIR$\Debug\List\UsartConfigurator.lst +- $PROJ_DIR$\Debug\Obj\TaskScheduler.r79 +- $TOOLKIT_DIR$\inc\ymath.h +- $PROJ_DIR$\Debug\Obj\TemperatureFilter.r79 +- $TOOLKIT_DIR$\inc\ysizet.h +- $PROJ_DIR$\Debug\Obj\TimerHardware.pbi +- $PROJ_DIR$\Debug\Obj\TemperatureCalculator.r79 +- $PROJ_DIR$\Debug\Obj\AdcTemperatureSensor.pbi +- $PROJ_DIR$\Debug\List\TemperatureCalculator.lst +- $PROJ_DIR$\Debug\List\AdcTemperatureSensor.lst +- $TOOLKIT_DIR$\lib\dl4tptinl8n.h +- $PROJ_DIR$\Debug\Obj\AdcHardware.pbi +- $PROJ_DIR$\Debug\Obj\UsartConfigurator.r79 +- $TOOLKIT_DIR$\inc\xencoding_limits.h +- $PROJ_DIR$\Debug\Obj\TimerConfigurator.r79 +- $PROJ_DIR$\Debug\Obj\AdcTemperatureSensor.r79 +- $PROJ_DIR$\Debug\Obj\Main.pbi +- $TOOLKIT_DIR$\lib\dl4tptinl8n.r79 +- $PROJ_DIR$\Debug\Obj\TimerInterruptHandler.r79 +- $PROJ_DIR$\Debug\Obj\UsartHardware.r79 +- $PROJ_DIR$\Debug\Obj\UsartPutChar.pbi +- $PROJ_DIR$\Debug\Obj\TimerInterruptConfigurator.pbi +- $TOOLKIT_DIR$\inc\yvals.h +- $PROJ_DIR$\Debug\Obj\UsartTransmitBufferStatus.pbi +- $PROJ_DIR$\Debug\Obj\IntrinsicsWrapper.pbi +- $PROJ_DIR$\Debug\Obj\AdcHardwareConfigurator.r79 +- $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h +- $TOOLKIT_DIR$\inc\DLib_Threads.h +- $PROJ_DIR$\Debug\Obj\TimerConfigurator.pbi +- $PROJ_DIR$\Debug\Obj\TimerConductor.pbi +- $PROJ_DIR$\Debug\Obj\TimerInterruptHandler.pbi +- $PROJ_DIR$\Debug\Obj\UsartPutChar.r79 +- $PROJ_DIR$\Debug\Obj\UsartConductor.r79 +- $PROJ_DIR$\Debug\Obj\TimerHardware.r79 +- $PROJ_DIR$\Debug\Obj\Cstartup_SAM7.r79 +- $PROJ_DIR$\Debug\List\cmock_demo.map +- $PROJ_DIR$\Debug\List\TimerInterruptConfigurator.lst +- $PROJ_DIR$\Debug\Obj\TimerConductor.r79 +- $PROJ_DIR$\Debug\Obj\Model.r79 +- $PROJ_DIR$\Debug\Obj\UsartBaudRateRegisterCalculator.pbi +- $PROJ_DIR$\Debug\Obj\AdcHardwareConfigurator.pbi +- $PROJ_DIR$\Debug\Obj\TemperatureCalculator.pbi +- $PROJ_DIR$\Debug\Obj\Cstartup_SAM7.pbi +- $PROJ_DIR$\Resource\at91SAM7X256_FLASH.xcl +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- $PROJ_DIR$\Cstartup.s79 +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\Cstartup_SAM7.c +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\..\examples\src\Executor.c +- $PROJ_DIR$\..\..\examples\src\Main.c +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- $PROJ_DIR$\..\..\examples\src\Model.c +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- $PROJ_DIR$\Debug\Obj\Cstartup.r79 +- $PROJ_DIR$\Debug\List\TimerConfigurator.lst +- $PROJ_DIR$\..\..\examples\src\Executor.h +- $PROJ_DIR$\Debug\List\TimerConductor.lst +- $PROJ_DIR$\..\..\examples\src\AdcModel.h +- $PROJ_DIR$\..\..\examples\src\ModelConfig.h +- $PROJ_DIR$\Debug\Obj\Executor.r79 +- $PROJ_DIR$\Debug\List\UsartPutChar.lst +- $PROJ_DIR$\Debug\List\TemperatureFilter.lst +- $PROJ_DIR$\Debug\Obj\TimerModel.pbi +- $PROJ_DIR$\srcIAR\Cstartup.s79 +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- [ROOT_NODE] +- +- +- XLINK +- 25 105 39 +- +- +- +- +- $PROJ_DIR$\Debug\Obj\cmock_demo.pbd +- +- +- BILINK +- 68 81 110 5 77 112 31 94 86 6 69 111 9 99 98 75 91 100 150 109 11 58 22 53 90 93 +- +- +- +- +- $PROJ_DIR$\Debug\Exe\cmock_demo.d79 +- +- +- XLINK +- 105 39 +- +- +- +- +- XLINK +- 113 4 55 95 7 85 141 104 147 1 0 108 71 76 73 107 84 103 3 88 56 67 102 82 89 8 101 45 87 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- +- +- ICCARM +- 107 144 +- +- +- BICOMP +- 99 +- +- +- +- +- ICCARM +- 12 15 29 46 49 44 +- +- +- BICOMP +- 12 15 29 46 49 44 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- +- +- ICCARM +- 84 142 +- +- +- BICOMP +- 98 +- +- +- +- +- ICCARM +- 12 15 48 42 +- +- +- BICOMP +- 12 15 48 42 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- +- +- ICCARM +- 103 43 +- +- +- BICOMP +- 75 +- +- +- +- +- ICCARM +- 12 15 49 48 +- +- +- BICOMP +- 12 15 49 48 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- +- +- ICCARM +- 3 106 +- +- +- BICOMP +- 91 +- +- +- +- +- ICCARM +- 12 15 42 44 +- +- +- BICOMP +- 12 15 42 44 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- +- +- ICCARM +- 56 40 +- +- +- BICOMP +- 150 +- +- +- +- +- ICCARM +- 12 15 46 18 +- +- +- BICOMP +- 12 15 46 18 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- +- +- ICCARM +- 67 34 +- +- +- BICOMP +- 109 +- +- +- +- +- ICCARM +- 12 15 50 +- +- +- BICOMP +- 12 15 50 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- +- +- ICCARM +- 8 36 +- +- +- BICOMP +- 53 +- +- +- +- +- ICCARM +- 12 15 32 146 50 28 57 92 14 80 52 83 97 74 54 72 +- +- +- BICOMP +- 12 15 32 146 50 28 57 92 14 52 83 97 74 54 72 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- +- +- ICCARM +- 102 61 +- +- +- BICOMP +- 11 +- +- +- +- +- ICCARM +- 12 15 19 35 32 18 +- +- +- BICOMP +- 12 15 19 35 32 18 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- +- +- ICCARM +- 82 70 +- +- +- BICOMP +- 58 +- +- +- +- +- ICCARM +- 12 15 26 +- +- +- BICOMP +- 12 15 26 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- +- +- ICCARM +- 89 64 +- +- +- BICOMP +- 22 +- +- +- +- +- ICCARM +- 12 15 35 26 30 +- +- +- BICOMP +- 12 15 35 26 30 +- +- +- +- +- $PROJ_DIR$\Cstartup.s79 +- +- +- AARM +- 141 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- +- +- ICCARM +- 101 148 +- +- +- BICOMP +- 90 +- +- +- +- +- ICCARM +- 12 15 30 41 +- +- +- BICOMP +- 12 15 30 41 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- +- +- ICCARM +- 45 38 +- +- +- BICOMP +- 93 +- +- +- +- +- ICCARM +- 12 15 41 +- +- +- BICOMP +- 12 15 41 +- +- +- +- +- $PROJ_DIR$\Cstartup_SAM7.c +- +- +- ICCARM +- 104 51 +- +- +- BICOMP +- 112 +- +- +- +- +- ICCARM +- 15 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- +- +- ICCARM +- 7 59 +- +- +- BICOMP +- 5 +- +- +- +- +- ICCARM +- 12 15 145 18 23 28 +- +- +- BICOMP +- 12 15 145 18 23 28 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- +- +- ICCARM +- 85 79 +- +- +- BICOMP +- 77 +- +- +- +- +- ICCARM +- 12 15 24 +- +- +- BICOMP +- 12 15 24 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Executor.c +- +- +- ICCARM +- 147 37 +- +- +- BICOMP +- 31 +- +- +- +- +- ICCARM +- 12 15 143 20 19 29 16 33 +- +- +- BICOMP +- 12 15 143 20 19 29 16 33 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Main.c +- +- +- ICCARM +- 0 66 +- +- +- BICOMP +- 86 +- +- +- +- +- ICCARM +- 12 15 33 143 20 18 23 28 19 35 26 30 32 50 41 29 49 48 42 44 46 16 27 13 24 145 +- +- +- BICOMP +- 12 15 33 143 20 18 23 28 19 35 26 30 32 50 41 29 49 48 42 44 46 16 27 13 24 145 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- +- +- ICCARM +- 1 47 +- +- +- BICOMP +- 94 +- +- +- +- +- ICCARM +- 33 21 +- +- +- BICOMP +- 33 21 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Model.c +- +- +- ICCARM +- 108 62 +- +- +- BICOMP +- 6 +- +- +- +- +- ICCARM +- 20 12 15 18 28 +- +- +- BICOMP +- 20 12 15 18 28 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- +- +- ICCARM +- 76 78 +- +- +- BICOMP +- 111 +- +- +- +- +- ICCARM +- 12 15 23 54 72 92 14 80 52 83 97 +- +- +- BICOMP +- 12 15 23 54 72 92 14 52 83 97 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- +- +- ICCARM +- 71 63 +- +- +- BICOMP +- 69 +- +- +- +- +- ICCARM +- 12 15 18 +- +- +- BICOMP +- 12 15 18 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- +- +- ICCARM +- 88 17 +- +- +- BICOMP +- 100 +- +- +- +- +- ICCARM +- 12 15 44 42 +- +- +- BICOMP +- 12 15 44 42 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- +- +- ICCARM +- 73 149 +- +- +- BICOMP +- 9 +- +- +- +- +- ICCARM +- 12 15 28 54 72 92 14 80 52 83 97 +- +- +- BICOMP +- 12 15 28 54 72 92 14 52 83 97 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- +- +- ICCARM +- 95 10 +- +- +- BICOMP +- 110 +- +- +- +- +- ICCARM +- 12 15 13 146 +- +- +- BICOMP +- 12 15 13 146 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- +- +- ICCARM +- 4 60 +- +- +- BICOMP +- 68 +- +- +- +- +- ICCARM +- 12 15 16 145 27 +- +- +- BICOMP +- 12 15 16 145 27 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- +- +- ICCARM +- 55 65 +- +- +- BICOMP +- 81 +- +- +- +- +- ICCARM +- 12 15 27 13 24 +- +- +- BICOMP +- 12 15 27 13 24 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup.s79 +- +- +- AARM +- 141 +- +- +- +- +- AARM +- 96 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- ICCARM +- 104 51 +- +- +- BICOMP +- 112 +- +- +- +- +- ICCARM +- 15 +- +- +- +- +- +- Release +- +- $PROJ_DIR$\..\test\system\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\examples\src\Types.h +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h +- $TOOLKIT_DIR$\inc\DLib_Defaults.h +- $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h +- $PROJ_DIR$\..\..\examples\src\AdcConductor.h +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.h +- $PROJ_DIR$\..\..\examples\src\UsartConductor.h +- $PROJ_DIR$\..\..\examples\src\Model.h +- $TOOLKIT_DIR$\inc\intrinsics.h +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h +- $PROJ_DIR$\..\..\examples\src\AdcHardware.h +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h +- $PROJ_DIR$\..\..\examples\src\TimerConductor.h +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.h +- $PROJ_DIR$\..\..\examples\src\UsartModel.h +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h +- $PROJ_DIR$\..\..\examples\src\UsartHardware.h +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h +- $PROJ_DIR$\..\..\examples\src\TimerModel.h +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h +- $PROJ_DIR$\..\..\examples\src\TimerHardware.h +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h +- $TOOLKIT_DIR$\inc\DLib_Product.h +- $TOOLKIT_DIR$\inc\math.h +- $TOOLKIT_DIR$\inc\stdio.h +- $TOOLKIT_DIR$\inc\ymath.h +- $TOOLKIT_DIR$\inc\ysizet.h +- $TOOLKIT_DIR$\lib\dl4tptinl8n.h +- $PROJ_DIR$\..\test\system\src\UsartPutChar.h +- $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.h +- $PROJ_DIR$\..\test\system\src\TaskScheduler.h +- $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\..\test\system\src\UsartConfigurator.h +- $PROJ_DIR$\..\test\system\src\TimerConfigurator.h +- $PROJ_DIR$\..\test\system\src\AT91SAM7X256.h +- $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.h +- $PROJ_DIR$\..\test\system\src\Executor.h +- $PROJ_DIR$\..\test\system\src\ModelConfig.h +- $PROJ_DIR$\..\test\system\src\TimerModel.h +- $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.h +- $PROJ_DIR$\..\test\system\src\Main.c +- $PROJ_DIR$\..\test\system\src\Model.c +- $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\test\system\src\TimerModel.c +- $PROJ_DIR$\..\test\system\src\UsartModel.c +- $PROJ_DIR$\..\test\system\src\UsartHardware.c +- $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\..\test\system\src\UsartPutChar.c +- $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\test\system\src\TaskScheduler.c +- $PROJ_DIR$\..\test\system\src\AdcConductor.h +- $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\..\test\system\src\Model.h +- $PROJ_DIR$\..\test\system\src\TemperatureFilter.h +- $PROJ_DIR$\..\test\system\src\AdcModel.c +- $PROJ_DIR$\..\test\system\src\TimerHardware.h +- $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\test\system\src\AdcConductor.c +- $PROJ_DIR$\..\test\system\src\AdcHardware.c +- $PROJ_DIR$\..\test\system\src\AdcHardware.h +- $PROJ_DIR$\..\test\system\src\Executor.c +- $TOOLKIT_DIR$\inc\xencoding_limits.h +- $TOOLKIT_DIR$\lib\dl4tptinl8n.r79 +- $PROJ_DIR$\..\test\system\src\TemperatureCalculator.c +- $PROJ_DIR$\..\test\system\src\Types.h +- $PROJ_DIR$\..\test\system\src\TemperatureFilter.c +- $PROJ_DIR$\..\test\system\src\TimerConductor.c +- $PROJ_DIR$\..\test\system\src\TimerConfigurator.c +- $PROJ_DIR$\..\test\system\src\TimerHardware.c +- $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.c +- $PROJ_DIR$\..\test\system\src\UsartConductor.c +- $PROJ_DIR$\..\test\system\src\UsartConfigurator.c +- $PROJ_DIR$\..\test\system\src\UsartHardware.h +- $PROJ_DIR$\..\test\system\src\TimerConductor.h +- $PROJ_DIR$\..\test\system\src\AdcModel.h +- $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.h +- $PROJ_DIR$\..\test\system\src\UsartConductor.h +- $PROJ_DIR$\Release\Obj\Executor.pbi +- $PROJ_DIR$\..\test\system\src\UsartModel.h +- $PROJ_DIR$\Release\Obj\Model.pbi +- $PROJ_DIR$\Release\Obj\Cstartup_SAM7.pbi +- $PROJ_DIR$\Release\Obj\UsartConductor.pbi +- $PROJ_DIR$\Release\Obj\AdcConductor.r79 +- $PROJ_DIR$\Release\Obj\AdcHardware.r79 +- $PROJ_DIR$\Release\Obj\TimerModel.pbi +- $PROJ_DIR$\Release\Obj\AdcTemperatureSensor.pbi +- $PROJ_DIR$\Release\Obj\UsartHardware.r79 +- $PROJ_DIR$\Release\Obj\TemperatureFilter.pbi +- $PROJ_DIR$\Release\Obj\UsartPutChar.pbi +- $PROJ_DIR$\Release\Obj\TemperatureCalculator.r79 +- $PROJ_DIR$\Release\Obj\AdcHardwareConfigurator.r79 +- $PROJ_DIR$\Release\Obj\cmock_demo.pbd +- $PROJ_DIR$\Release\Obj\UsartModel.r79 +- $PROJ_DIR$\Release\Obj\UsartBaudRateRegisterCalculator.r79 +- $PROJ_DIR$\Release\Obj\Model.r79 +- $PROJ_DIR$\Release\Obj\AdcModel.r79 +- $PROJ_DIR$\Release\Obj\AdcHardware.pbi +- $PROJ_DIR$\Release\Obj\TimerModel.r79 +- $PROJ_DIR$\Release\Obj\TimerHardware.r79 +- $PROJ_DIR$\Release\Obj\UsartPutChar.r79 +- $PROJ_DIR$\Release\Obj\AdcHardwareConfigurator.pbi +- $PROJ_DIR$\Release\Obj\TimerInterruptConfigurator.r79 +- $PROJ_DIR$\Release\Obj\TaskScheduler.pbi +- $PROJ_DIR$\Release\List\cmock_demo.map +- $PROJ_DIR$\Release\Obj\UsartTransmitBufferStatus.pbi +- $PROJ_DIR$\Release\Exe\cmock_demo.d79 +- $PROJ_DIR$\Release\Obj\AdcTemperatureSensor.r79 +- $PROJ_DIR$\Release\Obj\TimerConductor.r79 +- $PROJ_DIR$\Release\Obj\TimerConfigurator.r79 +- $PROJ_DIR$\Release\Obj\Main.pbi +- $PROJ_DIR$\Release\Obj\TimerInterruptConfigurator.pbi +- $PROJ_DIR$\Release\Obj\UsartTransmitBufferStatus.r79 +- $PROJ_DIR$\Release\Obj\AdcModel.pbi +- $PROJ_DIR$\Release\Obj\TemperatureFilter.r79 +- $PROJ_DIR$\Release\Obj\UsartHardware.pbi +- $PROJ_DIR$\Release\Obj\Cstartup.r79 +- $PROJ_DIR$\Release\Obj\UsartConductor.r79 +- $PROJ_DIR$\Release\Obj\TimerInterruptHandler.pbi +- $PROJ_DIR$\Release\Obj\TimerConductor.pbi +- $PROJ_DIR$\Release\Obj\Main.r79 +- $PROJ_DIR$\Release\Obj\UsartConfigurator.pbi +- $PROJ_DIR$\Release\Obj\Executor.r79 +- $PROJ_DIR$\Release\Obj\Cstartup_SAM7.r79 +- $PROJ_DIR$\Release\Obj\TemperatureCalculator.pbi +- $PROJ_DIR$\Release\Obj\TimerHardware.pbi +- $PROJ_DIR$\Release\Exe\cmock_demo.sim +- $PROJ_DIR$\Release\Obj\TimerConfigurator.pbi +- $PROJ_DIR$\Release\Obj\UsartModel.pbi +- $PROJ_DIR$\Release\Obj\TaskScheduler.r79 +- $PROJ_DIR$\Release\Obj\UsartBaudRateRegisterCalculator.pbi +- $PROJ_DIR$\Release\Obj\AdcConductor.pbi +- $PROJ_DIR$\Release\Obj\TimerInterruptHandler.r79 +- $PROJ_DIR$\Release\Obj\UsartConfigurator.r79 +- $PROJ_DIR$\Release\Obj\IntrinsicsWrapper.pbi +- $PROJ_DIR$\Release\Obj\IntrinsicsWrapper.r79 +- $TOOLKIT_DIR$\inc\yvals.h +- $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h +- $TOOLKIT_DIR$\inc\DLib_Threads.h +- $PROJ_DIR$\Resource\at91SAM7X256_FLASH.xcl +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- $PROJ_DIR$\Cstartup.s79 +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\Cstartup_SAM7.c +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\..\examples\src\Executor.c +- $PROJ_DIR$\..\..\examples\src\Main.c +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- $PROJ_DIR$\..\..\examples\src\Model.c +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- $PROJ_DIR$\..\..\examples\src\Executor.h +- $PROJ_DIR$\..\..\examples\src\AdcModel.h +- $PROJ_DIR$\..\..\examples\src\ModelConfig.h +- $PROJ_DIR$\srcIAR\Cstartup.s79 +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- [ROOT_NODE] +- +- +- XLINK +- 111 109 131 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\Main.c +- +- +- ICCARM +- 125 +- +- +- BICOMP +- 115 +- +- +- +- +- ICCARM +- 70 39 41 58 35 0 59 82 78 37 33 84 40 36 79 61 38 57 44 43 56 65 81 34 80 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\Model.c +- +- +- ICCARM +- 100 +- +- +- BICOMP +- 85 +- +- +- +- +- ICCARM +- 58 70 39 35 59 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.c +- +- +- ICCARM +- 96 +- +- +- BICOMP +- 106 +- +- +- +- +- ICCARM +- 70 39 81 42 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerModel.c +- +- +- ICCARM +- 103 +- +- +- BICOMP +- 90 +- +- +- +- +- ICCARM +- 70 39 43 35 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartModel.c +- +- +- ICCARM +- 98 +- +- +- BICOMP +- 133 +- +- +- +- +- ICCARM +- 70 39 84 42 40 59 29 141 3 32 27 67 143 31 28 30 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartHardware.c +- +- +- ICCARM +- 92 +- +- +- BICOMP +- 120 +- +- +- +- +- ICCARM +- 70 39 78 37 33 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.c +- +- +- ICCARM +- 117 +- +- +- BICOMP +- 110 +- +- +- +- +- ICCARM +- 70 39 36 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartPutChar.c +- +- +- ICCARM +- 105 +- +- +- BICOMP +- 94 +- +- +- +- +- ICCARM +- 70 39 33 36 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.c +- +- +- ICCARM +- 107 +- +- +- BICOMP +- 116 +- +- +- +- +- ICCARM +- 70 39 57 44 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.c +- +- +- ICCARM +- 99 +- +- +- BICOMP +- 135 +- +- +- +- +- ICCARM +- 70 39 40 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TaskScheduler.c +- +- +- ICCARM +- 134 +- +- +- BICOMP +- 108 +- +- +- +- +- ICCARM +- 70 39 35 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\AdcModel.c +- +- +- ICCARM +- 101 +- +- +- BICOMP +- 118 +- +- +- +- +- ICCARM +- 70 39 80 35 0 59 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.c +- +- +- ICCARM +- 112 +- +- +- BICOMP +- 91 +- +- +- +- +- ICCARM +- 70 39 34 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\AdcConductor.c +- +- +- ICCARM +- 88 +- +- +- BICOMP +- 136 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\AdcHardware.c +- +- +- ICCARM +- 89 +- +- +- BICOMP +- 102 +- +- +- +- +- ICCARM +- 70 39 65 81 34 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\Executor.c +- +- +- ICCARM +- 127 +- +- +- BICOMP +- 83 +- +- +- +- +- ICCARM +- 70 39 41 58 82 79 56 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TemperatureCalculator.c +- +- +- ICCARM +- 95 +- +- +- BICOMP +- 129 +- +- +- +- +- ICCARM +- 70 39 0 28 30 141 3 32 27 67 143 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TemperatureFilter.c +- +- +- ICCARM +- 119 +- +- +- BICOMP +- 93 +- +- +- +- +- ICCARM +- 70 39 59 28 30 141 3 32 27 67 143 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerConductor.c +- +- +- ICCARM +- 113 +- +- +- BICOMP +- 124 +- +- +- +- +- ICCARM +- 70 39 79 43 61 44 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerConfigurator.c +- +- +- ICCARM +- 114 +- +- +- BICOMP +- 132 +- +- +- +- +- ICCARM +- 70 39 38 57 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerHardware.c +- +- +- ICCARM +- 104 +- +- +- BICOMP +- 130 +- +- +- +- +- ICCARM +- 70 39 61 38 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.c +- +- +- ICCARM +- 137 +- +- +- BICOMP +- 123 +- +- +- +- +- ICCARM +- 70 39 44 57 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartConductor.c +- +- +- ICCARM +- 122 +- +- +- BICOMP +- 87 +- +- +- +- +- ICCARM +- 70 39 82 78 84 35 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartConfigurator.c +- +- +- ICCARM +- 138 +- +- +- BICOMP +- 126 +- +- +- +- +- ICCARM +- 70 39 37 +- +- +- +- +- $PROJ_DIR$\Release\Obj\cmock_demo.pbd +- +- +- BILINK +- 136 102 106 118 91 86 83 139 115 85 108 129 93 124 132 130 116 123 90 135 87 126 120 133 94 110 +- +- +- +- +- $PROJ_DIR$\Release\Exe\cmock_demo.d79 +- +- +- XLINK +- 109 131 +- +- +- +- +- XLINK +- 144 88 89 96 101 112 121 128 127 140 125 100 134 95 119 113 114 104 107 137 103 99 122 138 92 98 105 117 68 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- +- +- ICCARM +- 113 +- +- +- BICOMP +- 124 +- +- +- +- +- ICCARM +- 1 4 15 23 25 22 +- +- +- BICOMP +- 1 4 15 23 25 22 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- +- +- ICCARM +- 114 +- +- +- BICOMP +- 132 +- +- +- +- +- ICCARM +- 1 4 24 21 +- +- +- BICOMP +- 1 4 24 21 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- +- +- ICCARM +- 104 +- +- +- BICOMP +- 130 +- +- +- +- +- ICCARM +- 1 4 25 24 +- +- +- BICOMP +- 1 4 25 24 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- +- +- ICCARM +- 107 +- +- +- BICOMP +- 116 +- +- +- +- +- ICCARM +- 1 4 21 22 +- +- +- BICOMP +- 1 4 21 22 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- +- +- ICCARM +- 103 +- +- +- BICOMP +- 90 +- +- +- +- +- ICCARM +- 1 4 23 6 +- +- +- BICOMP +- 1 4 23 6 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- +- +- ICCARM +- 99 +- +- +- BICOMP +- 135 +- +- +- +- +- ICCARM +- 1 4 26 +- +- +- BICOMP +- 1 4 26 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- +- +- ICCARM +- 98 +- +- +- BICOMP +- 133 +- +- +- +- +- ICCARM +- 1 4 17 174 26 14 29 141 3 32 27 67 143 31 28 30 +- +- +- BICOMP +- 1 4 17 174 26 14 29 141 3 27 67 143 31 28 30 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- +- +- ICCARM +- 122 +- +- +- BICOMP +- 87 +- +- +- +- +- ICCARM +- 1 4 7 19 17 6 +- +- +- BICOMP +- 1 4 7 19 17 6 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- +- +- ICCARM +- 138 +- +- +- BICOMP +- 126 +- +- +- +- +- ICCARM +- 1 4 12 +- +- +- BICOMP +- 1 4 12 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- +- +- ICCARM +- 92 +- +- +- BICOMP +- 120 +- +- +- +- +- ICCARM +- 1 4 19 12 16 +- +- +- BICOMP +- 1 4 19 12 16 +- +- +- +- +- $PROJ_DIR$\Cstartup.s79 +- +- +- AARM +- 121 +- +- +- +- +- AARM +- 142 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- +- +- ICCARM +- 105 +- +- +- BICOMP +- 94 +- +- +- +- +- ICCARM +- 1 4 16 20 +- +- +- BICOMP +- 1 4 16 20 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- +- +- ICCARM +- 117 +- +- +- BICOMP +- 110 +- +- +- +- +- ICCARM +- 1 4 20 +- +- +- BICOMP +- 1 4 20 +- +- +- +- +- $PROJ_DIR$\Cstartup_SAM7.c +- +- +- ICCARM +- 128 +- +- +- BICOMP +- 86 +- +- +- +- +- ICCARM +- 4 +- +- +- BICOMP +- 4 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- +- +- ICCARM +- 101 +- +- +- BICOMP +- 118 +- +- +- +- +- ICCARM +- 1 4 173 6 10 14 +- +- +- BICOMP +- 1 4 173 6 10 14 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- +- +- ICCARM +- 112 +- +- +- BICOMP +- 91 +- +- +- +- +- ICCARM +- 1 4 11 +- +- +- BICOMP +- 1 4 11 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Executor.c +- +- +- ICCARM +- 127 +- +- +- BICOMP +- 83 +- +- +- +- +- ICCARM +- 1 4 172 8 7 15 5 18 +- +- +- BICOMP +- 1 4 172 8 7 15 5 18 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Main.c +- +- +- ICCARM +- 125 +- +- +- BICOMP +- 115 +- +- +- +- +- ICCARM +- 1 4 18 172 8 6 10 14 7 19 12 16 17 26 20 15 25 24 21 22 23 5 13 2 11 173 +- +- +- BICOMP +- 1 4 18 172 8 6 10 14 7 19 12 16 17 26 20 15 25 24 21 22 23 5 13 2 11 173 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- +- +- ICCARM +- 140 +- +- +- BICOMP +- 139 +- +- +- +- +- ICCARM +- 18 9 +- +- +- BICOMP +- 18 9 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Model.c +- +- +- ICCARM +- 100 +- +- +- BICOMP +- 85 +- +- +- +- +- ICCARM +- 8 1 4 6 14 +- +- +- BICOMP +- 8 1 4 6 14 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- +- +- ICCARM +- 95 +- +- +- BICOMP +- 129 +- +- +- +- +- ICCARM +- 1 4 10 28 30 141 3 32 27 67 143 +- +- +- BICOMP +- 1 4 10 28 30 141 3 27 67 143 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- +- +- ICCARM +- 134 +- +- +- BICOMP +- 108 +- +- +- +- +- ICCARM +- 1 4 6 +- +- +- BICOMP +- 1 4 6 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- +- +- ICCARM +- 137 +- +- +- BICOMP +- 123 +- +- +- +- +- ICCARM +- 1 4 22 21 +- +- +- BICOMP +- 1 4 22 21 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- +- +- ICCARM +- 119 +- +- +- BICOMP +- 93 +- +- +- +- +- ICCARM +- 1 4 14 28 30 141 3 32 27 67 143 +- +- +- BICOMP +- 1 4 14 28 30 141 3 27 67 143 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- +- +- ICCARM +- 96 +- +- +- BICOMP +- 106 +- +- +- +- +- ICCARM +- 1 4 2 174 +- +- +- BICOMP +- 1 4 2 174 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- +- +- ICCARM +- 88 +- +- +- BICOMP +- 136 +- +- +- +- +- ICCARM +- 1 4 5 173 13 +- +- +- BICOMP +- 1 4 5 173 13 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- +- +- ICCARM +- 89 +- +- +- BICOMP +- 102 +- +- +- +- +- ICCARM +- 1 4 13 2 11 +- +- +- BICOMP +- 1 4 13 2 11 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup.s79 +- +- +- AARM +- 121 +- +- +- +- +- AARM +- 142 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- ICCARM +- 128 +- +- +- BICOMP +- 86 +- +- +- +- +- ICCARM +- 4 +- +- +- BICOMP +- 4 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\Main.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\Model.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\TimerModel.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\UsartModel.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\UsartHardware.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\UsartPutChar.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\TaskScheduler.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\AdcModel.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\AdcConductor.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\AdcHardware.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\Executor.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\TemperatureCalculator.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\TemperatureFilter.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\TimerConductor.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\TimerConfigurator.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\TimerHardware.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\UsartConductor.c +- ICCARM +- +- +- $PROJ_DIR$\..\test\system\src\UsartConfigurator.c +- ICCARM +- +- +- +- Simulate +- +- $PROJ_DIR$\..\test\system\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\examples\src\Types.h +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h +- $TOOLKIT_DIR$\inc\DLib_Defaults.h +- $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h +- $PROJ_DIR$\..\..\examples\src\AdcConductor.h +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.h +- $PROJ_DIR$\..\..\examples\src\UsartConductor.h +- $PROJ_DIR$\..\..\examples\src\Model.h +- $TOOLKIT_DIR$\inc\intrinsics.h +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h +- $PROJ_DIR$\..\..\examples\src\AdcHardware.h +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h +- $PROJ_DIR$\..\..\examples\src\TimerConductor.h +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.h +- $PROJ_DIR$\..\..\examples\src\UsartModel.h +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h +- $PROJ_DIR$\..\..\examples\src\UsartHardware.h +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h +- $PROJ_DIR$\..\..\examples\src\TimerModel.h +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h +- $PROJ_DIR$\..\..\examples\src\TimerHardware.h +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h +- $TOOLKIT_DIR$\inc\DLib_Product.h +- $TOOLKIT_DIR$\inc\math.h +- $TOOLKIT_DIR$\inc\stdio.h +- $TOOLKIT_DIR$\inc\ymath.h +- $TOOLKIT_DIR$\inc\ysizet.h +- $TOOLKIT_DIR$\lib\dl4tptinl8n.h +- $PROJ_DIR$\..\test\system\src\UsartPutChar.h +- $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.h +- $PROJ_DIR$\Simulate\Obj\cmock_demo.pbd +- $PROJ_DIR$\..\test\system\src\TaskScheduler.h +- $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\..\test\system\src\UsartConfigurator.h +- $PROJ_DIR$\..\test\system\src\TimerConfigurator.h +- $PROJ_DIR$\..\test\system\src\AT91SAM7X256.h +- $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.h +- $PROJ_DIR$\..\test\system\src\Executor.h +- $PROJ_DIR$\..\test\system\src\ModelConfig.h +- $PROJ_DIR$\..\test\system\src\TimerModel.h +- $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.h +- $PROJ_DIR$\..\test\system\src\Main.c +- $PROJ_DIR$\..\test\system\src\Model.c +- $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\test\system\src\TimerModel.c +- $PROJ_DIR$\..\test\system\src\UsartModel.c +- $PROJ_DIR$\..\test\system\src\UsartHardware.c +- $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\..\test\system\src\UsartPutChar.c +- $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\test\system\src\TaskScheduler.c +- $PROJ_DIR$\..\test\system\src\AdcConductor.h +- $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\..\test\system\src\Model.h +- $PROJ_DIR$\..\test\system\src\TemperatureFilter.h +- $PROJ_DIR$\..\test\system\src\AdcModel.c +- $PROJ_DIR$\..\test\system\src\TimerHardware.h +- $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\test\system\src\AdcConductor.c +- $PROJ_DIR$\..\test\system\src\AdcHardware.c +- $PROJ_DIR$\..\test\system\src\AdcHardware.h +- $PROJ_DIR$\..\test\system\src\Executor.c +- $TOOLKIT_DIR$\inc\xencoding_limits.h +- $TOOLKIT_DIR$\lib\dl4tptinl8n.r79 +- $PROJ_DIR$\..\test\system\src\TemperatureCalculator.c +- $PROJ_DIR$\..\test\system\src\Types.h +- $PROJ_DIR$\..\test\system\src\TemperatureFilter.c +- $PROJ_DIR$\..\test\system\src\TimerConductor.c +- $PROJ_DIR$\..\test\system\src\TimerConfigurator.c +- $PROJ_DIR$\..\test\system\src\TimerHardware.c +- $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.c +- $PROJ_DIR$\..\test\system\src\UsartConductor.c +- $PROJ_DIR$\..\test\system\src\UsartConfigurator.c +- $PROJ_DIR$\..\test\system\src\UsartHardware.h +- $PROJ_DIR$\..\test\system\src\TimerConductor.h +- $PROJ_DIR$\..\test\system\src\AdcModel.h +- $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.h +- $PROJ_DIR$\..\test\system\src\UsartConductor.h +- $PROJ_DIR$\..\test\system\src\UsartModel.h +- $PROJ_DIR$\Simulate\Obj\AdcConductor.r79 +- $PROJ_DIR$\Simulate\Obj\Cstartup_SAM7.pbi +- $PROJ_DIR$\Simulate\Obj\UsartHardware.r79 +- $TOOLKIT_DIR$\inc\yvals.h +- $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h +- $PROJ_DIR$\Simulate\List\TimerModel.lst +- $PROJ_DIR$\Simulate\Obj\Executor.r79 +- $PROJ_DIR$\Simulate\Obj\TimerHardware.pbi +- $PROJ_DIR$\Simulate\Obj\UsartModel.pbi +- $PROJ_DIR$\Simulate\Obj\IntrinsicsWrapper.r79 +- $PROJ_DIR$\Simulate\Obj\TimerConductor.pbi +- $PROJ_DIR$\Simulate\List\UsartConductor.lst +- $PROJ_DIR$\Simulate\Obj\Main.pbi +- $TOOLKIT_DIR$\inc\DLib_Threads.h +- $PROJ_DIR$\Simulate\Obj\AdcHardwareConfigurator.pbi +- $PROJ_DIR$\Simulate\Obj\TimerConfigurator.pbi +- $PROJ_DIR$\Simulate\Exe\cmock_demo.sim +- $PROJ_DIR$\Simulate\Obj\UsartTransmitBufferStatus.pbi +- $PROJ_DIR$\Simulate\Obj\AdcHardware.r79 +- $PROJ_DIR$\Simulate\Obj\Main.r79 +- $PROJ_DIR$\Simulate\Obj\AdcTemperatureSensor.pbi +- $PROJ_DIR$\Simulate\Obj\UsartPutChar.r79 +- $PROJ_DIR$\Simulate\Obj\AdcHardwareConfigurator.r79 +- $PROJ_DIR$\Simulate\Obj\UsartConductor.r79 +- $PROJ_DIR$\Simulate\Obj\TimerHardware.r79 +- $PROJ_DIR$\Simulate\Obj\TemperatureFilter.r79 +- $PROJ_DIR$\Simulate\Obj\TemperatureCalculator.pbi +- $PROJ_DIR$\Simulate\Obj\TimerInterruptConfigurator.r79 +- $PROJ_DIR$\Simulate\Obj\UsartTransmitBufferStatus.r79 +- $PROJ_DIR$\Simulate\Obj\TimerConductor.r79 +- $PROJ_DIR$\Simulate\Obj\Executor.pbi +- $PROJ_DIR$\Simulate\Obj\UsartConductor.pbi +- $PROJ_DIR$\Simulate\Obj\TimerModel.pbi +- $PROJ_DIR$\Simulate\Obj\AdcModel.pbi +- $PROJ_DIR$\Simulate\List\TaskScheduler.lst +- $PROJ_DIR$\Simulate\Obj\TimerModel.r79 +- $PROJ_DIR$\Simulate\Obj\TemperatureFilter.pbi +- $PROJ_DIR$\Simulate\Obj\UsartBaudRateRegisterCalculator.pbi +- $PROJ_DIR$\Simulate\Obj\UsartHardware.pbi +- $PROJ_DIR$\Simulate\Obj\TaskScheduler.pbi +- $PROJ_DIR$\Simulate\Obj\AdcConductor.pbi +- $PROJ_DIR$\Simulate\Obj\TimerConfigurator.r79 +- $PROJ_DIR$\Simulate\Obj\Cstartup.r79 +- $PROJ_DIR$\Simulate\Obj\TimerInterruptHandler.pbi +- $PROJ_DIR$\Simulate\Obj\AdcModel.r79 +- $PROJ_DIR$\Simulate\Obj\IntrinsicsWrapper.pbi +- $PROJ_DIR$\Simulate\List\cmock_demo.map +- $PROJ_DIR$\Simulate\Obj\TimerInterruptConfigurator.pbi +- $PROJ_DIR$\Simulate\Exe\cmock_demo.d79 +- $PROJ_DIR$\Simulate\Obj\TaskScheduler.r79 +- $PROJ_DIR$\Simulate\Obj\Model.r79 +- $PROJ_DIR$\Simulate\Obj\UsartConfigurator.pbi +- $PROJ_DIR$\Simulate\Obj\UsartModel.r79 +- $PROJ_DIR$\Simulate\Obj\Cstartup_SAM7.r79 +- $PROJ_DIR$\Simulate\Obj\TemperatureCalculator.r79 +- $PROJ_DIR$\Simulate\Obj\UsartPutChar.pbi +- $PROJ_DIR$\Simulate\Obj\UsartConfigurator.r79 +- $PROJ_DIR$\Simulate\Obj\AdcHardware.pbi +- $PROJ_DIR$\Simulate\Obj\AdcTemperatureSensor.r79 +- $PROJ_DIR$\Simulate\Obj\Model.pbi +- $PROJ_DIR$\Simulate\Obj\UsartBaudRateRegisterCalculator.r79 +- $PROJ_DIR$\Simulate\List\UsartBaudRateRegisterCalculator.lst +- $PROJ_DIR$\Simulate\List\UsartTransmitBufferStatus.lst +- $PROJ_DIR$\Simulate\List\AdcHardware.lst +- $PROJ_DIR$\Simulate\List\TimerInterruptConfigurator.lst +- $PROJ_DIR$\Simulate\List\Model.lst +- $PROJ_DIR$\Simulate\Obj\TimerInterruptHandler.r79 +- $PROJ_DIR$\Simulate\List\UsartPutChar.lst +- $PROJ_DIR$\Simulate\List\UsartHardware.lst +- $PROJ_DIR$\Simulate\List\Executor.lst +- $PROJ_DIR$\Simulate\List\TimerConfigurator.lst +- $PROJ_DIR$\Simulate\List\AdcTemperatureSensor.lst +- $PROJ_DIR$\Simulate\List\Cstartup_SAM7.lst +- $PROJ_DIR$\Simulate\List\AdcHardwareConfigurator.lst +- $PROJ_DIR$\Simulate\List\AdcModel.lst +- $PROJ_DIR$\Simulate\List\TemperatureFilter.lst +- $PROJ_DIR$\Simulate\List\AdcConductor.lst +- $PROJ_DIR$\Simulate\List\UsartConfigurator.lst +- $PROJ_DIR$\Simulate\List\IntrinsicsWrapper.lst +- $PROJ_DIR$\Simulate\List\TimerHardware.lst +- $PROJ_DIR$\Simulate\List\TemperatureCalculator.lst +- $PROJ_DIR$\Simulate\List\TimerInterruptHandler.lst +- $PROJ_DIR$\Simulate\List\UsartModel.lst +- $PROJ_DIR$\Simulate\List\Main.lst +- $PROJ_DIR$\Simulate\List\TimerConductor.lst +- $PROJ_DIR$\Resource\at91SAM7X256_FLASH.xcl +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- $PROJ_DIR$\Cstartup.s79 +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\Cstartup_SAM7.c +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\..\examples\src\Executor.c +- $PROJ_DIR$\..\..\examples\src\Main.c +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- $PROJ_DIR$\..\..\examples\src\Model.c +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- $PROJ_DIR$\..\..\examples\src\Executor.h +- $PROJ_DIR$\..\..\examples\src\AdcModel.h +- $PROJ_DIR$\..\..\examples\src\ModelConfig.h +- $PROJ_DIR$\srcIAR\Cstartup.s79 +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- [ROOT_NODE] +- +- +- XLINK +- 133 131 101 +- +- +- +- +- $PROJ_DIR$\Simulate\Obj\cmock_demo.pbd +- +- +- BILINK +- 125 142 99 118 105 86 115 130 97 144 124 111 121 95 100 92 132 128 117 122 116 136 123 93 140 102 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\Main.c +- +- +- ICCARM +- 104 +- +- +- BICOMP +- 97 +- +- +- +- +- ICCARM +- 71 40 42 59 36 0 60 83 79 38 33 84 41 37 80 62 39 58 45 44 57 66 82 34 81 +- +- +- BICOMP +- 71 40 42 59 36 0 60 83 79 38 33 84 41 37 80 62 39 58 45 44 57 66 82 34 81 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\Model.c +- +- +- ICCARM +- 135 +- +- +- BICOMP +- 144 +- +- +- +- +- ICCARM +- 59 71 40 36 60 +- +- +- BICOMP +- 59 71 40 36 60 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\AdcHardwareConfigurator.c +- +- +- ICCARM +- 107 +- +- +- BICOMP +- 99 +- +- +- +- +- ICCARM +- 71 40 82 43 +- +- +- BICOMP +- 71 40 82 43 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerModel.c +- +- +- ICCARM +- 120 +- +- +- BICOMP +- 117 +- +- +- +- +- ICCARM +- 71 40 44 36 +- +- +- BICOMP +- 71 40 44 36 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartModel.c +- +- +- ICCARM +- 137 +- +- +- BICOMP +- 93 +- +- +- +- +- ICCARM +- 71 40 84 43 41 60 29 88 3 32 27 68 98 31 28 30 +- +- +- BICOMP +- 71 40 84 43 41 60 29 88 3 27 68 98 31 28 30 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartHardware.c +- +- +- ICCARM +- 87 +- +- +- BICOMP +- 123 +- +- +- +- +- ICCARM +- 71 40 79 38 33 +- +- +- BICOMP +- 71 40 79 38 33 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartTransmitBufferStatus.c +- +- +- ICCARM +- 113 +- +- +- BICOMP +- 102 +- +- +- +- +- ICCARM +- 71 40 37 +- +- +- BICOMP +- 71 40 37 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartPutChar.c +- +- +- ICCARM +- 106 +- +- +- BICOMP +- 140 +- +- +- +- +- ICCARM +- 71 40 33 37 29 88 3 32 27 68 98 31 +- +- +- BICOMP +- 71 40 33 37 29 88 3 27 68 98 31 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerInterruptConfigurator.c +- +- +- ICCARM +- 112 +- +- +- BICOMP +- 132 +- +- +- +- +- ICCARM +- 71 40 58 45 +- +- +- BICOMP +- 71 40 58 45 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartBaudRateRegisterCalculator.c +- +- +- ICCARM +- 145 +- +- +- BICOMP +- 122 +- +- +- +- +- ICCARM +- 71 40 41 +- +- +- BICOMP +- 71 40 41 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TaskScheduler.c +- +- +- ICCARM +- 134 +- +- +- BICOMP +- 124 +- +- +- +- +- ICCARM +- 71 40 36 +- +- +- BICOMP +- 71 40 36 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\AdcModel.c +- +- +- ICCARM +- 129 +- +- +- BICOMP +- 118 +- +- +- +- +- ICCARM +- 71 40 81 36 0 60 +- +- +- BICOMP +- 71 40 81 36 0 60 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\AdcTemperatureSensor.c +- +- +- ICCARM +- 143 +- +- +- BICOMP +- 105 +- +- +- +- +- ICCARM +- 71 40 34 +- +- +- BICOMP +- 71 40 34 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\AdcConductor.c +- +- +- ICCARM +- 85 +- +- +- BICOMP +- 125 +- +- +- +- +- ICCARM +- 71 40 57 81 66 +- +- +- BICOMP +- 71 40 57 81 66 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\AdcHardware.c +- +- +- ICCARM +- 103 +- +- +- BICOMP +- 142 +- +- +- +- +- ICCARM +- 71 40 66 82 34 +- +- +- BICOMP +- 71 40 66 82 34 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\Executor.c +- +- +- ICCARM +- 91 +- +- +- BICOMP +- 115 +- +- +- +- +- ICCARM +- 71 40 42 59 83 80 57 +- +- +- BICOMP +- 71 40 42 59 83 80 57 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TemperatureCalculator.c +- +- +- ICCARM +- 139 +- +- +- BICOMP +- 111 +- +- +- +- +- ICCARM +- 71 40 0 28 30 88 3 32 27 68 98 +- +- +- BICOMP +- 71 40 0 28 30 88 3 27 68 98 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TemperatureFilter.c +- +- +- ICCARM +- 110 +- +- +- BICOMP +- 121 +- +- +- +- +- ICCARM +- 71 40 60 28 30 88 3 32 27 68 98 +- +- +- BICOMP +- 71 40 60 28 30 88 3 27 68 98 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerConductor.c +- +- +- ICCARM +- 114 +- +- +- BICOMP +- 95 +- +- +- +- +- ICCARM +- 71 40 80 44 62 45 +- +- +- BICOMP +- 71 40 80 44 62 45 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerConfigurator.c +- +- +- ICCARM +- 126 +- +- +- BICOMP +- 100 +- +- +- +- +- ICCARM +- 71 40 39 58 +- +- +- BICOMP +- 71 40 39 58 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerHardware.c +- +- +- ICCARM +- 109 +- +- +- BICOMP +- 92 +- +- +- +- +- ICCARM +- 71 40 62 39 +- +- +- BICOMP +- 71 40 62 39 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\TimerInterruptHandler.c +- +- +- ICCARM +- 151 +- +- +- BICOMP +- 128 +- +- +- +- +- ICCARM +- 71 40 45 58 +- +- +- BICOMP +- 71 40 45 58 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartConductor.c +- +- +- ICCARM +- 108 +- +- +- BICOMP +- 116 +- +- +- +- +- ICCARM +- 71 40 83 79 84 36 +- +- +- BICOMP +- 71 40 83 79 84 36 +- +- +- +- +- $PROJ_DIR$\..\test\system\src\UsartConfigurator.c +- +- +- ICCARM +- 141 +- +- +- BICOMP +- 136 +- +- +- +- +- ICCARM +- 71 40 38 +- +- +- BICOMP +- 71 40 38 +- +- +- +- +- $PROJ_DIR$\Simulate\Exe\cmock_demo.d79 +- +- +- XLINK +- 131 101 +- +- +- +- +- XLINK +- 170 85 103 107 129 143 127 138 91 94 104 135 134 139 110 114 126 109 112 151 120 145 108 141 87 137 106 113 69 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- +- +- ICCARM +- 114 169 +- +- +- BICOMP +- 95 +- +- +- +- +- ICCARM +- 1 4 15 23 25 22 +- +- +- BICOMP +- 1 4 15 23 25 22 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- +- +- ICCARM +- 126 155 +- +- +- BICOMP +- 100 +- +- +- +- +- ICCARM +- 1 4 24 21 +- +- +- BICOMP +- 1 4 24 21 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- +- +- ICCARM +- 109 164 +- +- +- BICOMP +- 92 +- +- +- +- +- ICCARM +- 1 4 25 24 +- +- +- BICOMP +- 1 4 25 24 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- +- +- ICCARM +- 112 149 +- +- +- BICOMP +- 132 +- +- +- +- +- ICCARM +- 1 4 21 22 +- +- +- BICOMP +- 1 4 21 22 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- +- +- ICCARM +- 120 90 +- +- +- BICOMP +- 117 +- +- +- +- +- ICCARM +- 1 4 23 6 +- +- +- BICOMP +- 1 4 23 6 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- +- +- ICCARM +- 145 146 +- +- +- BICOMP +- 122 +- +- +- +- +- ICCARM +- 1 4 26 +- +- +- BICOMP +- 1 4 26 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- +- +- ICCARM +- 137 167 +- +- +- BICOMP +- 93 +- +- +- +- +- ICCARM +- 1 4 17 200 26 14 29 88 3 32 27 68 98 31 28 30 +- +- +- BICOMP +- 1 4 17 200 26 14 29 88 3 27 68 98 31 28 30 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- +- +- ICCARM +- 108 96 +- +- +- BICOMP +- 116 +- +- +- +- +- ICCARM +- 1 4 7 19 17 6 +- +- +- BICOMP +- 1 4 7 19 17 6 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- +- +- ICCARM +- 141 162 +- +- +- BICOMP +- 136 +- +- +- +- +- ICCARM +- 1 4 12 +- +- +- BICOMP +- 1 4 12 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- +- +- ICCARM +- 87 153 +- +- +- BICOMP +- 123 +- +- +- +- +- ICCARM +- 1 4 19 12 16 +- +- +- BICOMP +- 1 4 19 12 16 +- +- +- +- +- $PROJ_DIR$\Cstartup.s79 +- +- +- AARM +- 127 +- +- +- +- +- AARM +- 89 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- +- +- ICCARM +- 106 152 +- +- +- BICOMP +- 140 +- +- +- +- +- ICCARM +- 1 4 16 20 29 88 3 32 27 68 98 31 +- +- +- BICOMP +- 1 4 16 20 29 88 3 27 68 98 31 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- +- +- ICCARM +- 113 147 +- +- +- BICOMP +- 102 +- +- +- +- +- ICCARM +- 1 4 20 +- +- +- BICOMP +- 1 4 20 +- +- +- +- +- $PROJ_DIR$\Cstartup_SAM7.c +- +- +- ICCARM +- 138 157 +- +- +- BICOMP +- 86 +- +- +- +- +- ICCARM +- 4 +- +- +- BICOMP +- 4 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- +- +- ICCARM +- 129 159 +- +- +- BICOMP +- 118 +- +- +- +- +- ICCARM +- 1 4 199 6 10 14 +- +- +- BICOMP +- 1 4 199 6 10 14 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- +- +- ICCARM +- 143 156 +- +- +- BICOMP +- 105 +- +- +- +- +- ICCARM +- 1 4 11 +- +- +- BICOMP +- 1 4 11 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Executor.c +- +- +- ICCARM +- 91 154 +- +- +- BICOMP +- 115 +- +- +- +- +- ICCARM +- 1 4 198 8 7 15 5 18 +- +- +- BICOMP +- 1 4 198 8 7 15 5 18 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Main.c +- +- +- ICCARM +- 104 168 +- +- +- BICOMP +- 97 +- +- +- +- +- ICCARM +- 1 4 18 198 8 6 10 14 7 19 12 16 17 26 20 15 25 24 21 22 23 5 13 2 11 199 +- +- +- BICOMP +- 1 4 18 198 8 6 10 14 7 19 12 16 17 26 20 15 25 24 21 22 23 5 13 2 11 199 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- +- +- ICCARM +- 94 163 +- +- +- BICOMP +- 130 +- +- +- +- +- ICCARM +- 18 9 +- +- +- BICOMP +- 18 9 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Model.c +- +- +- ICCARM +- 135 150 +- +- +- BICOMP +- 144 +- +- +- +- +- ICCARM +- 8 1 4 6 14 +- +- +- BICOMP +- 8 1 4 6 14 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- +- +- ICCARM +- 139 165 +- +- +- BICOMP +- 111 +- +- +- +- +- ICCARM +- 1 4 10 28 30 88 3 32 27 68 98 +- +- +- BICOMP +- 1 4 10 28 30 88 3 27 68 98 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- +- +- ICCARM +- 134 119 +- +- +- BICOMP +- 124 +- +- +- +- +- ICCARM +- 1 4 6 +- +- +- BICOMP +- 1 4 6 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- +- +- ICCARM +- 151 166 +- +- +- BICOMP +- 128 +- +- +- +- +- ICCARM +- 1 4 22 21 +- +- +- BICOMP +- 1 4 22 21 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- +- +- ICCARM +- 110 160 +- +- +- BICOMP +- 121 +- +- +- +- +- ICCARM +- 1 4 14 28 30 88 3 32 27 68 98 +- +- +- BICOMP +- 1 4 14 28 30 88 3 27 68 98 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- +- +- ICCARM +- 107 158 +- +- +- BICOMP +- 99 +- +- +- +- +- ICCARM +- 1 4 2 200 +- +- +- BICOMP +- 1 4 2 200 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- +- +- ICCARM +- 85 161 +- +- +- BICOMP +- 125 +- +- +- +- +- ICCARM +- 1 4 5 199 13 +- +- +- BICOMP +- 1 4 5 199 13 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- +- +- ICCARM +- 103 148 +- +- +- BICOMP +- 142 +- +- +- +- +- ICCARM +- 1 4 13 2 11 +- +- +- BICOMP +- 1 4 13 2 11 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup.s79 +- +- +- AARM +- 127 +- +- +- +- +- AARM +- 89 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- ICCARM +- 138 157 +- +- +- BICOMP +- 86 +- +- +- +- +- ICCARM +- 4 +- +- +- BICOMP +- 4 +- +- +- +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewd b/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewd +deleted file mode 100644 +index 1632636e64..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewd ++++ /dev/null +@@ -1,1696 +0,0 @@ +- +- +- +- 1 +- +- Debug +- +- ARM +- +- 1 +- +- C-SPY +- 2 +- +- 13 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ARMSIM_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- ANGEL_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- IARROM_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- JLINK_ID +- 2 +- +- 6 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- LMIFTDI_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- MACRAIGOR_ID +- 2 +- +- 2 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- RDI_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- THIRDPARTY_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Orti\Orti.ewplugin +- 0 +- +- +- $EW_DIR$\common\plugins\Profiling\Profiling.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Stack\Stack.ewplugin +- 1 +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CMXArmPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CMXTinyArmPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin +- 0 +- +- +- +- +- Simulate +- +- ARM +- +- 1 +- +- C-SPY +- 2 +- +- 13 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ARMSIM_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- ANGEL_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- IARROM_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- JLINK_ID +- 2 +- +- 6 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- LMIFTDI_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- MACRAIGOR_ID +- 2 +- +- 2 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- RDI_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- THIRDPARTY_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Orti\Orti.ewplugin +- 0 +- +- +- $EW_DIR$\common\plugins\Profiling\Profiling.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Stack\Stack.ewplugin +- 1 +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CMXArmPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CMXTinyArmPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin +- 0 +- +- +- +- +- Release +- +- ARM +- +- 0 +- +- C-SPY +- 2 +- +- 13 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ARMSIM_ID +- 2 +- +- 0 +- 1 +- 0 +- +- +- +- +- ANGEL_ID +- 2 +- +- 0 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- +- +- IARROM_ID +- 2 +- +- 0 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- JLINK_ID +- 2 +- +- 6 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- LMIFTDI_ID +- 2 +- +- 0 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- +- +- MACRAIGOR_ID +- 2 +- +- 2 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- RDI_ID +- 2 +- +- 1 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- THIRDPARTY_ID +- 2 +- +- 0 +- 1 +- 0 +- +- +- +- +- +- +- +- +- $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Orti\Orti.ewplugin +- 0 +- +- +- $EW_DIR$\common\plugins\Profiling\Profiling.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Stack\Stack.ewplugin +- 1 +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CMXArmPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CMXTinyArmPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin +- 0 +- +- +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewp b/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewp +deleted file mode 100644 +index ec55fbe548..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.ewp ++++ /dev/null +@@ -1,2581 +0,0 @@ +- +- +- +- 1 +- +- Debug +- +- ARM +- +- 1 +- +- General +- 2 +- +- 9 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ICCARM +- 2 +- +- 14 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- AARM +- 2 +- +- 7 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- CUSTOM +- 3 +- +- +- +- +- +- +- BICOMP +- 0 +- +- +- +- BUILDACTION +- 1 +- +- +- +- +- +- +- XLINK +- 2 +- +- 18 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- XAR +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- BILINK +- 0 +- +- +- +- +- Simulate +- +- ARM +- +- 1 +- +- General +- 2 +- +- 9 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ICCARM +- 2 +- +- 14 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- AARM +- 2 +- +- 7 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- CUSTOM +- 3 +- +- +- +- +- +- +- BICOMP +- 0 +- +- +- +- BUILDACTION +- 1 +- +- +- +- +- +- +- XLINK +- 2 +- +- 18 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- XAR +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- BILINK +- 0 +- +- +- +- +- Release +- +- ARM +- +- 0 +- +- General +- 2 +- +- 9 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ICCARM +- 2 +- +- 14 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- AARM +- 2 +- +- 7 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- CUSTOM +- 3 +- +- +- +- +- +- +- BICOMP +- 0 +- +- +- +- BUILDACTION +- 1 +- +- +- +- +- +- +- XLINK +- 2 +- +- 18 +- 1 +- 0 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- XAR +- 2 +- +- 0 +- 1 +- 0 +- +- +- +- +- +- +- BILINK +- 0 +- +- +- +- +- Resource +- +- $PROJ_DIR$\Resource\at91SAM7X256_FLASH.xcl +- +- +- $PROJ_DIR$\Resource\at91SAM7X256_RAM.xcl +- +- +- $PROJ_DIR$\Resource\SAM7_FLASH.mac +- +- +- $PROJ_DIR$\Resource\SAM7_RAM.mac +- +- +- $PROJ_DIR$\Resource\SAM7_SIM.mac +- +- +- +- Source +- +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- +- +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- +- +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- +- +- $PROJ_DIR$\..\..\examples\src\Executor.c +- +- +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- +- +- $PROJ_DIR$\..\..\examples\src\Main.c +- +- +- $PROJ_DIR$\..\..\examples\src\Model.c +- +- +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- +- +- +- Startup +- +- $PROJ_DIR$\srcIAR\Cstartup.s79 +- +- +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.eww b/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.eww +deleted file mode 100644 +index dabdf551e5..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/cmock_demo.eww ++++ /dev/null +@@ -1,10 +0,0 @@ +- +- +- +- +- $WS_DIR$\cmock_demo.ewp +- +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X-EK.h b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X-EK.h +deleted file mode 100644 +index 98346759bf..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X-EK.h ++++ /dev/null +@@ -1,61 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X-EK.h +-// Object : AT91SAM7X-EK Evaluation Board Features Definition File +-// +-// ---------------------------------------------------------------------------- +- +-#ifndef AT91SAM7X_EK_H +-#define AT91SAM7X_EK_H +- +-/*-----------------*/ +-/* LEDs Definition */ +-/*-----------------*/ +-#define AT91B_LED1 (1<<19) // AT91C_PIO_PB19 AT91C_PB19_PWM0 AT91C_PB19_TCLK1 +-#define AT91B_LED2 (1<<20) // AT91C_PIO_PB20 AT91C_PB20_PWM1 AT91C_PB20_PWM1 +-#define AT91B_LED3 (AT91C_PIO_PB21) // AT91C_PIO_PB21 AT91C_PB21_PWM2 AT91C_PB21_PCK1 +-#define AT91B_LED4 (AT91C_PIO_PB22) // AT91C_PIO_PB22 AT91C_PB22_PWM3 AT91C_PB22_PCK2 +-#define AT91B_NB_LEB 4 +-#define AT91B_LED_MASK (AT91B_LED1|AT91B_LED2|AT91B_LED3|AT91B_LED4) +-#define AT91D_BASE_PIO_LED (AT91C_BASE_PIOB) +- +-#define AT91B_POWERLED (1<<25) // PB25 +- +- +-/*-------------------------------*/ +-/* JOYSTICK Position Definition */ +-/*-------------------------------*/ +-#define AT91B_SW1 (1<<21) // PA21 Up Button AT91C_PA21_TF AT91C_PA21_NPCS10 +-#define AT91B_SW2 (1<<22) // PA22 Down Button AT91C_PA22_TK AT91C_PA22_SPCK1 +-#define AT91B_SW3 (1<<23) // PA23 Left Button AT91C_PA23_TD AT91C_PA23_MOSI1 +-#define AT91B_SW4 (1<<24) // PA24 Right Button AT91C_PA24_RD AT91C_PA24_MISO1 +-#define AT91B_SW5 (1<<25) // PA25 Push Button AT91C_PA25_RK AT91C_PA25_NPCS11 +-#define AT91B_SW_MASK (AT91B_SW1|AT91B_SW2|AT91B_SW3|AT91B_SW4|AT91B_SW5) +- +- +-#define AT91D_BASE_PIO_SW (AT91C_BASE_PIOA) +- +-/*------------------*/ +-/* CAN Definition */ +-/*------------------*/ +-#define AT91B_CAN_TRANSCEIVER_RS (1<<2) // PA2 +- +-/*--------------*/ +-/* Clocks */ +-/*--------------*/ +-#define AT91B_MAIN_OSC 18432000 // Main Oscillator MAINCK +-#define AT91B_MCK ((18432000*73/14)/2) // Output PLL Clock +- +-#endif /* AT91SAM7X-EK_H */ +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.inc b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.inc +deleted file mode 100644 +index da339852f1..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.inc ++++ /dev/null +@@ -1,2314 +0,0 @@ +-;- ---------------------------------------------------------------------------- +-;- ATMEL Microcontroller Software Support - ROUSSET - +-;- ---------------------------------------------------------------------------- +-;- DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-;- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-;- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-;- DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h +-;- Object : AT91SAM7X256 definitions +-;- Generated : AT91 SW Application Group 11/02/2005 (15:17:24) +-;- +-;- CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// +-;- CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// +-;- CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// +-;- CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// +-;- CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// +-;- CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// +-;- CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// +-;- CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// +-;- CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// +-;- CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// +-;- CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// +-;- CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// +-;- CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// +-;- CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// +-;- CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// +-;- CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// +-;- CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// +-;- CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// +-;- CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// +-;- CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// +-;- CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// +-;- CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// +-;- CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// +-;- ---------------------------------------------------------------------------- +- +-;- Hardware register definition +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR System Peripherals +-;- ***************************************************************************** +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Advanced Interrupt Controller +-;- ***************************************************************************** +- ^ 0 ;- AT91S_AIC +-AIC_SMR # 128 ;- Source Mode Register +-AIC_SVR # 128 ;- Source Vector Register +-AIC_IVR # 4 ;- IRQ Vector Register +-AIC_FVR # 4 ;- FIQ Vector Register +-AIC_ISR # 4 ;- Interrupt Status Register +-AIC_IPR # 4 ;- Interrupt Pending Register +-AIC_IMR # 4 ;- Interrupt Mask Register +-AIC_CISR # 4 ;- Core Interrupt Status Register +- # 8 ;- Reserved +-AIC_IECR # 4 ;- Interrupt Enable Command Register +-AIC_IDCR # 4 ;- Interrupt Disable Command Register +-AIC_ICCR # 4 ;- Interrupt Clear Command Register +-AIC_ISCR # 4 ;- Interrupt Set Command Register +-AIC_EOICR # 4 ;- End of Interrupt Command Register +-AIC_SPU # 4 ;- Spurious Vector Register +-AIC_DCR # 4 ;- Debug Control Register (Protect) +- # 4 ;- Reserved +-AIC_FFER # 4 ;- Fast Forcing Enable Register +-AIC_FFDR # 4 ;- Fast Forcing Disable Register +-AIC_FFSR # 4 ;- Fast Forcing Status Register +-;- -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- +-AT91C_AIC_PRIOR EQU (0x7:SHL:0) ;- (AIC) Priority Level +-AT91C_AIC_PRIOR_LOWEST EQU (0x0) ;- (AIC) Lowest priority level +-AT91C_AIC_PRIOR_HIGHEST EQU (0x7) ;- (AIC) Highest priority level +-AT91C_AIC_SRCTYPE EQU (0x3:SHL:5) ;- (AIC) Interrupt Source Type +-AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL EQU (0x0:SHL:5) ;- (AIC) Internal Sources Code Label High-level Sensitive +-AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL EQU (0x0:SHL:5) ;- (AIC) External Sources Code Label Low-level Sensitive +-AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE EQU (0x1:SHL:5) ;- (AIC) Internal Sources Code Label Positive Edge triggered +-AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE EQU (0x1:SHL:5) ;- (AIC) External Sources Code Label Negative Edge triggered +-AT91C_AIC_SRCTYPE_HIGH_LEVEL EQU (0x2:SHL:5) ;- (AIC) Internal Or External Sources Code Label High-level Sensitive +-AT91C_AIC_SRCTYPE_POSITIVE_EDGE EQU (0x3:SHL:5) ;- (AIC) Internal Or External Sources Code Label Positive Edge triggered +-;- -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- +-AT91C_AIC_NFIQ EQU (0x1:SHL:0) ;- (AIC) NFIQ Status +-AT91C_AIC_NIRQ EQU (0x1:SHL:1) ;- (AIC) NIRQ Status +-;- -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- +-AT91C_AIC_DCR_PROT EQU (0x1:SHL:0) ;- (AIC) Protection Mode +-AT91C_AIC_DCR_GMSK EQU (0x1:SHL:1) ;- (AIC) General Mask +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Peripheral DMA Controller +-;- ***************************************************************************** +- ^ 0 ;- AT91S_PDC +-PDC_RPR # 4 ;- Receive Pointer Register +-PDC_RCR # 4 ;- Receive Counter Register +-PDC_TPR # 4 ;- Transmit Pointer Register +-PDC_TCR # 4 ;- Transmit Counter Register +-PDC_RNPR # 4 ;- Receive Next Pointer Register +-PDC_RNCR # 4 ;- Receive Next Counter Register +-PDC_TNPR # 4 ;- Transmit Next Pointer Register +-PDC_TNCR # 4 ;- Transmit Next Counter Register +-PDC_PTCR # 4 ;- PDC Transfer Control Register +-PDC_PTSR # 4 ;- PDC Transfer Status Register +-;- -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- +-AT91C_PDC_RXTEN EQU (0x1:SHL:0) ;- (PDC) Receiver Transfer Enable +-AT91C_PDC_RXTDIS EQU (0x1:SHL:1) ;- (PDC) Receiver Transfer Disable +-AT91C_PDC_TXTEN EQU (0x1:SHL:8) ;- (PDC) Transmitter Transfer Enable +-AT91C_PDC_TXTDIS EQU (0x1:SHL:9) ;- (PDC) Transmitter Transfer Disable +-;- -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Debug Unit +-;- ***************************************************************************** +- ^ 0 ;- AT91S_DBGU +-DBGU_CR # 4 ;- Control Register +-DBGU_MR # 4 ;- Mode Register +-DBGU_IER # 4 ;- Interrupt Enable Register +-DBGU_IDR # 4 ;- Interrupt Disable Register +-DBGU_IMR # 4 ;- Interrupt Mask Register +-DBGU_CSR # 4 ;- Channel Status Register +-DBGU_RHR # 4 ;- Receiver Holding Register +-DBGU_THR # 4 ;- Transmitter Holding Register +-DBGU_BRGR # 4 ;- Baud Rate Generator Register +- # 28 ;- Reserved +-DBGU_CIDR # 4 ;- Chip ID Register +-DBGU_EXID # 4 ;- Chip ID Extension Register +-DBGU_FNTR # 4 ;- Force NTRST Register +- # 180 ;- Reserved +-DBGU_RPR # 4 ;- Receive Pointer Register +-DBGU_RCR # 4 ;- Receive Counter Register +-DBGU_TPR # 4 ;- Transmit Pointer Register +-DBGU_TCR # 4 ;- Transmit Counter Register +-DBGU_RNPR # 4 ;- Receive Next Pointer Register +-DBGU_RNCR # 4 ;- Receive Next Counter Register +-DBGU_TNPR # 4 ;- Transmit Next Pointer Register +-DBGU_TNCR # 4 ;- Transmit Next Counter Register +-DBGU_PTCR # 4 ;- PDC Transfer Control Register +-DBGU_PTSR # 4 ;- PDC Transfer Status Register +-;- -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- +-AT91C_US_RSTRX EQU (0x1:SHL:2) ;- (DBGU) Reset Receiver +-AT91C_US_RSTTX EQU (0x1:SHL:3) ;- (DBGU) Reset Transmitter +-AT91C_US_RXEN EQU (0x1:SHL:4) ;- (DBGU) Receiver Enable +-AT91C_US_RXDIS EQU (0x1:SHL:5) ;- (DBGU) Receiver Disable +-AT91C_US_TXEN EQU (0x1:SHL:6) ;- (DBGU) Transmitter Enable +-AT91C_US_TXDIS EQU (0x1:SHL:7) ;- (DBGU) Transmitter Disable +-AT91C_US_RSTSTA EQU (0x1:SHL:8) ;- (DBGU) Reset Status Bits +-;- -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- +-AT91C_US_PAR EQU (0x7:SHL:9) ;- (DBGU) Parity type +-AT91C_US_PAR_EVEN EQU (0x0:SHL:9) ;- (DBGU) Even Parity +-AT91C_US_PAR_ODD EQU (0x1:SHL:9) ;- (DBGU) Odd Parity +-AT91C_US_PAR_SPACE EQU (0x2:SHL:9) ;- (DBGU) Parity forced to 0 (Space) +-AT91C_US_PAR_MARK EQU (0x3:SHL:9) ;- (DBGU) Parity forced to 1 (Mark) +-AT91C_US_PAR_NONE EQU (0x4:SHL:9) ;- (DBGU) No Parity +-AT91C_US_PAR_MULTI_DROP EQU (0x6:SHL:9) ;- (DBGU) Multi-drop mode +-AT91C_US_CHMODE EQU (0x3:SHL:14) ;- (DBGU) Channel Mode +-AT91C_US_CHMODE_NORMAL EQU (0x0:SHL:14) ;- (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. +-AT91C_US_CHMODE_AUTO EQU (0x1:SHL:14) ;- (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. +-AT91C_US_CHMODE_LOCAL EQU (0x2:SHL:14) ;- (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. +-AT91C_US_CHMODE_REMOTE EQU (0x3:SHL:14) ;- (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. +-;- -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-AT91C_US_RXRDY EQU (0x1:SHL:0) ;- (DBGU) RXRDY Interrupt +-AT91C_US_TXRDY EQU (0x1:SHL:1) ;- (DBGU) TXRDY Interrupt +-AT91C_US_ENDRX EQU (0x1:SHL:3) ;- (DBGU) End of Receive Transfer Interrupt +-AT91C_US_ENDTX EQU (0x1:SHL:4) ;- (DBGU) End of Transmit Interrupt +-AT91C_US_OVRE EQU (0x1:SHL:5) ;- (DBGU) Overrun Interrupt +-AT91C_US_FRAME EQU (0x1:SHL:6) ;- (DBGU) Framing Error Interrupt +-AT91C_US_PARE EQU (0x1:SHL:7) ;- (DBGU) Parity Error Interrupt +-AT91C_US_TXEMPTY EQU (0x1:SHL:9) ;- (DBGU) TXEMPTY Interrupt +-AT91C_US_TXBUFE EQU (0x1:SHL:11) ;- (DBGU) TXBUFE Interrupt +-AT91C_US_RXBUFF EQU (0x1:SHL:12) ;- (DBGU) RXBUFF Interrupt +-AT91C_US_COMM_TX EQU (0x1:SHL:30) ;- (DBGU) COMM_TX Interrupt +-AT91C_US_COMM_RX EQU (0x1:SHL:31) ;- (DBGU) COMM_RX Interrupt +-;- -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-;- -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-;- -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- +-;- -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- +-AT91C_US_FORCE_NTRST EQU (0x1:SHL:0) ;- (DBGU) Force NTRST in JTAG +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Parallel Input Output Controler +-;- ***************************************************************************** +- ^ 0 ;- AT91S_PIO +-PIO_PER # 4 ;- PIO Enable Register +-PIO_PDR # 4 ;- PIO Disable Register +-PIO_PSR # 4 ;- PIO Status Register +- # 4 ;- Reserved +-PIO_OER # 4 ;- Output Enable Register +-PIO_ODR # 4 ;- Output Disable Registerr +-PIO_OSR # 4 ;- Output Status Register +- # 4 ;- Reserved +-PIO_IFER # 4 ;- Input Filter Enable Register +-PIO_IFDR # 4 ;- Input Filter Disable Register +-PIO_IFSR # 4 ;- Input Filter Status Register +- # 4 ;- Reserved +-PIO_SODR # 4 ;- Set Output Data Register +-PIO_CODR # 4 ;- Clear Output Data Register +-PIO_ODSR # 4 ;- Output Data Status Register +-PIO_PDSR # 4 ;- Pin Data Status Register +-PIO_IER # 4 ;- Interrupt Enable Register +-PIO_IDR # 4 ;- Interrupt Disable Register +-PIO_IMR # 4 ;- Interrupt Mask Register +-PIO_ISR # 4 ;- Interrupt Status Register +-PIO_MDER # 4 ;- Multi-driver Enable Register +-PIO_MDDR # 4 ;- Multi-driver Disable Register +-PIO_MDSR # 4 ;- Multi-driver Status Register +- # 4 ;- Reserved +-PIO_PPUDR # 4 ;- Pull-up Disable Register +-PIO_PPUER # 4 ;- Pull-up Enable Register +-PIO_PPUSR # 4 ;- Pull-up Status Register +- # 4 ;- Reserved +-PIO_ASR # 4 ;- Select A Register +-PIO_BSR # 4 ;- Select B Register +-PIO_ABSR # 4 ;- AB Select Status Register +- # 36 ;- Reserved +-PIO_OWER # 4 ;- Output Write Enable Register +-PIO_OWDR # 4 ;- Output Write Disable Register +-PIO_OWSR # 4 ;- Output Write Status Register +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Clock Generator Controler +-;- ***************************************************************************** +- ^ 0 ;- AT91S_CKGR +-CKGR_MOR # 4 ;- Main Oscillator Register +-CKGR_MCFR # 4 ;- Main Clock Frequency Register +- # 4 ;- Reserved +-CKGR_PLLR # 4 ;- PLL Register +-;- -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- +-AT91C_CKGR_MOSCEN EQU (0x1:SHL:0) ;- (CKGR) Main Oscillator Enable +-AT91C_CKGR_OSCBYPASS EQU (0x1:SHL:1) ;- (CKGR) Main Oscillator Bypass +-AT91C_CKGR_OSCOUNT EQU (0xFF:SHL:8) ;- (CKGR) Main Oscillator Start-up Time +-;- -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- +-AT91C_CKGR_MAINF EQU (0xFFFF:SHL:0) ;- (CKGR) Main Clock Frequency +-AT91C_CKGR_MAINRDY EQU (0x1:SHL:16) ;- (CKGR) Main Clock Ready +-;- -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- +-AT91C_CKGR_DIV EQU (0xFF:SHL:0) ;- (CKGR) Divider Selected +-AT91C_CKGR_DIV_0 EQU (0x0) ;- (CKGR) Divider output is 0 +-AT91C_CKGR_DIV_BYPASS EQU (0x1) ;- (CKGR) Divider is bypassed +-AT91C_CKGR_PLLCOUNT EQU (0x3F:SHL:8) ;- (CKGR) PLL Counter +-AT91C_CKGR_OUT EQU (0x3:SHL:14) ;- (CKGR) PLL Output Frequency Range +-AT91C_CKGR_OUT_0 EQU (0x0:SHL:14) ;- (CKGR) Please refer to the PLL datasheet +-AT91C_CKGR_OUT_1 EQU (0x1:SHL:14) ;- (CKGR) Please refer to the PLL datasheet +-AT91C_CKGR_OUT_2 EQU (0x2:SHL:14) ;- (CKGR) Please refer to the PLL datasheet +-AT91C_CKGR_OUT_3 EQU (0x3:SHL:14) ;- (CKGR) Please refer to the PLL datasheet +-AT91C_CKGR_MUL EQU (0x7FF:SHL:16) ;- (CKGR) PLL Multiplier +-AT91C_CKGR_USBDIV EQU (0x3:SHL:28) ;- (CKGR) Divider for USB Clocks +-AT91C_CKGR_USBDIV_0 EQU (0x0:SHL:28) ;- (CKGR) Divider output is PLL clock output +-AT91C_CKGR_USBDIV_1 EQU (0x1:SHL:28) ;- (CKGR) Divider output is PLL clock output divided by 2 +-AT91C_CKGR_USBDIV_2 EQU (0x2:SHL:28) ;- (CKGR) Divider output is PLL clock output divided by 4 +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Power Management Controler +-;- ***************************************************************************** +- ^ 0 ;- AT91S_PMC +-PMC_SCER # 4 ;- System Clock Enable Register +-PMC_SCDR # 4 ;- System Clock Disable Register +-PMC_SCSR # 4 ;- System Clock Status Register +- # 4 ;- Reserved +-PMC_PCER # 4 ;- Peripheral Clock Enable Register +-PMC_PCDR # 4 ;- Peripheral Clock Disable Register +-PMC_PCSR # 4 ;- Peripheral Clock Status Register +- # 4 ;- Reserved +-PMC_MOR # 4 ;- Main Oscillator Register +-PMC_MCFR # 4 ;- Main Clock Frequency Register +- # 4 ;- Reserved +-PMC_PLLR # 4 ;- PLL Register +-PMC_MCKR # 4 ;- Master Clock Register +- # 12 ;- Reserved +-PMC_PCKR # 16 ;- Programmable Clock Register +- # 16 ;- Reserved +-PMC_IER # 4 ;- Interrupt Enable Register +-PMC_IDR # 4 ;- Interrupt Disable Register +-PMC_SR # 4 ;- Status Register +-PMC_IMR # 4 ;- Interrupt Mask Register +-;- -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- +-AT91C_PMC_PCK EQU (0x1:SHL:0) ;- (PMC) Processor Clock +-AT91C_PMC_UDP EQU (0x1:SHL:7) ;- (PMC) USB Device Port Clock +-AT91C_PMC_PCK0 EQU (0x1:SHL:8) ;- (PMC) Programmable Clock Output +-AT91C_PMC_PCK1 EQU (0x1:SHL:9) ;- (PMC) Programmable Clock Output +-AT91C_PMC_PCK2 EQU (0x1:SHL:10) ;- (PMC) Programmable Clock Output +-AT91C_PMC_PCK3 EQU (0x1:SHL:11) ;- (PMC) Programmable Clock Output +-;- -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- +-;- -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- +-;- -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- +-;- -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- +-;- -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- +-;- -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- +-AT91C_PMC_CSS EQU (0x3:SHL:0) ;- (PMC) Programmable Clock Selection +-AT91C_PMC_CSS_SLOW_CLK EQU (0x0) ;- (PMC) Slow Clock is selected +-AT91C_PMC_CSS_MAIN_CLK EQU (0x1) ;- (PMC) Main Clock is selected +-AT91C_PMC_CSS_PLL_CLK EQU (0x3) ;- (PMC) Clock from PLL is selected +-AT91C_PMC_PRES EQU (0x7:SHL:2) ;- (PMC) Programmable Clock Prescaler +-AT91C_PMC_PRES_CLK EQU (0x0:SHL:2) ;- (PMC) Selected clock +-AT91C_PMC_PRES_CLK_2 EQU (0x1:SHL:2) ;- (PMC) Selected clock divided by 2 +-AT91C_PMC_PRES_CLK_4 EQU (0x2:SHL:2) ;- (PMC) Selected clock divided by 4 +-AT91C_PMC_PRES_CLK_8 EQU (0x3:SHL:2) ;- (PMC) Selected clock divided by 8 +-AT91C_PMC_PRES_CLK_16 EQU (0x4:SHL:2) ;- (PMC) Selected clock divided by 16 +-AT91C_PMC_PRES_CLK_32 EQU (0x5:SHL:2) ;- (PMC) Selected clock divided by 32 +-AT91C_PMC_PRES_CLK_64 EQU (0x6:SHL:2) ;- (PMC) Selected clock divided by 64 +-;- -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- +-;- -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- +-AT91C_PMC_MOSCS EQU (0x1:SHL:0) ;- (PMC) MOSC Status/Enable/Disable/Mask +-AT91C_PMC_LOCK EQU (0x1:SHL:2) ;- (PMC) PLL Status/Enable/Disable/Mask +-AT91C_PMC_MCKRDY EQU (0x1:SHL:3) ;- (PMC) MCK_RDY Status/Enable/Disable/Mask +-AT91C_PMC_PCK0RDY EQU (0x1:SHL:8) ;- (PMC) PCK0_RDY Status/Enable/Disable/Mask +-AT91C_PMC_PCK1RDY EQU (0x1:SHL:9) ;- (PMC) PCK1_RDY Status/Enable/Disable/Mask +-AT91C_PMC_PCK2RDY EQU (0x1:SHL:10) ;- (PMC) PCK2_RDY Status/Enable/Disable/Mask +-AT91C_PMC_PCK3RDY EQU (0x1:SHL:11) ;- (PMC) PCK3_RDY Status/Enable/Disable/Mask +-;- -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- +-;- -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- +-;- -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Reset Controller Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_RSTC +-RSTC_RCR # 4 ;- Reset Control Register +-RSTC_RSR # 4 ;- Reset Status Register +-RSTC_RMR # 4 ;- Reset Mode Register +-;- -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- +-AT91C_RSTC_PROCRST EQU (0x1:SHL:0) ;- (RSTC) Processor Reset +-AT91C_RSTC_PERRST EQU (0x1:SHL:2) ;- (RSTC) Peripheral Reset +-AT91C_RSTC_EXTRST EQU (0x1:SHL:3) ;- (RSTC) External Reset +-AT91C_RSTC_KEY EQU (0xFF:SHL:24) ;- (RSTC) Password +-;- -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- +-AT91C_RSTC_URSTS EQU (0x1:SHL:0) ;- (RSTC) User Reset Status +-AT91C_RSTC_BODSTS EQU (0x1:SHL:1) ;- (RSTC) Brownout Detection Status +-AT91C_RSTC_RSTTYP EQU (0x7:SHL:8) ;- (RSTC) Reset Type +-AT91C_RSTC_RSTTYP_POWERUP EQU (0x0:SHL:8) ;- (RSTC) Power-up Reset. VDDCORE rising. +-AT91C_RSTC_RSTTYP_WAKEUP EQU (0x1:SHL:8) ;- (RSTC) WakeUp Reset. VDDCORE rising. +-AT91C_RSTC_RSTTYP_WATCHDOG EQU (0x2:SHL:8) ;- (RSTC) Watchdog Reset. Watchdog overflow occured. +-AT91C_RSTC_RSTTYP_SOFTWARE EQU (0x3:SHL:8) ;- (RSTC) Software Reset. Processor reset required by the software. +-AT91C_RSTC_RSTTYP_USER EQU (0x4:SHL:8) ;- (RSTC) User Reset. NRST pin detected low. +-AT91C_RSTC_RSTTYP_BROWNOUT EQU (0x5:SHL:8) ;- (RSTC) Brownout Reset occured. +-AT91C_RSTC_NRSTL EQU (0x1:SHL:16) ;- (RSTC) NRST pin level +-AT91C_RSTC_SRCMP EQU (0x1:SHL:17) ;- (RSTC) Software Reset Command in Progress. +-;- -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- +-AT91C_RSTC_URSTEN EQU (0x1:SHL:0) ;- (RSTC) User Reset Enable +-AT91C_RSTC_URSTIEN EQU (0x1:SHL:4) ;- (RSTC) User Reset Interrupt Enable +-AT91C_RSTC_ERSTL EQU (0xF:SHL:8) ;- (RSTC) User Reset Length +-AT91C_RSTC_BODIEN EQU (0x1:SHL:16) ;- (RSTC) Brownout Detection Interrupt Enable +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_RTTC +-RTTC_RTMR # 4 ;- Real-time Mode Register +-RTTC_RTAR # 4 ;- Real-time Alarm Register +-RTTC_RTVR # 4 ;- Real-time Value Register +-RTTC_RTSR # 4 ;- Real-time Status Register +-;- -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- +-AT91C_RTTC_RTPRES EQU (0xFFFF:SHL:0) ;- (RTTC) Real-time Timer Prescaler Value +-AT91C_RTTC_ALMIEN EQU (0x1:SHL:16) ;- (RTTC) Alarm Interrupt Enable +-AT91C_RTTC_RTTINCIEN EQU (0x1:SHL:17) ;- (RTTC) Real Time Timer Increment Interrupt Enable +-AT91C_RTTC_RTTRST EQU (0x1:SHL:18) ;- (RTTC) Real Time Timer Restart +-;- -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- +-AT91C_RTTC_ALMV EQU (0x0:SHL:0) ;- (RTTC) Alarm Value +-;- -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- +-AT91C_RTTC_CRTV EQU (0x0:SHL:0) ;- (RTTC) Current Real-time Value +-;- -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- +-AT91C_RTTC_ALMS EQU (0x1:SHL:0) ;- (RTTC) Real-time Alarm Status +-AT91C_RTTC_RTTINC EQU (0x1:SHL:1) ;- (RTTC) Real-time Timer Increment +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_PITC +-PITC_PIMR # 4 ;- Period Interval Mode Register +-PITC_PISR # 4 ;- Period Interval Status Register +-PITC_PIVR # 4 ;- Period Interval Value Register +-PITC_PIIR # 4 ;- Period Interval Image Register +-;- -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- +-AT91C_PITC_PIV EQU (0xFFFFF:SHL:0) ;- (PITC) Periodic Interval Value +-AT91C_PITC_PITEN EQU (0x1:SHL:24) ;- (PITC) Periodic Interval Timer Enabled +-AT91C_PITC_PITIEN EQU (0x1:SHL:25) ;- (PITC) Periodic Interval Timer Interrupt Enable +-;- -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- +-AT91C_PITC_PITS EQU (0x1:SHL:0) ;- (PITC) Periodic Interval Timer Status +-;- -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- +-AT91C_PITC_CPIV EQU (0xFFFFF:SHL:0) ;- (PITC) Current Periodic Interval Value +-AT91C_PITC_PICNT EQU (0xFFF:SHL:20) ;- (PITC) Periodic Interval Counter +-;- -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_WDTC +-WDTC_WDCR # 4 ;- Watchdog Control Register +-WDTC_WDMR # 4 ;- Watchdog Mode Register +-WDTC_WDSR # 4 ;- Watchdog Status Register +-;- -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- +-AT91C_WDTC_WDRSTT EQU (0x1:SHL:0) ;- (WDTC) Watchdog Restart +-AT91C_WDTC_KEY EQU (0xFF:SHL:24) ;- (WDTC) Watchdog KEY Password +-;- -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- +-AT91C_WDTC_WDV EQU (0xFFF:SHL:0) ;- (WDTC) Watchdog Timer Restart +-AT91C_WDTC_WDFIEN EQU (0x1:SHL:12) ;- (WDTC) Watchdog Fault Interrupt Enable +-AT91C_WDTC_WDRSTEN EQU (0x1:SHL:13) ;- (WDTC) Watchdog Reset Enable +-AT91C_WDTC_WDRPROC EQU (0x1:SHL:14) ;- (WDTC) Watchdog Timer Restart +-AT91C_WDTC_WDDIS EQU (0x1:SHL:15) ;- (WDTC) Watchdog Disable +-AT91C_WDTC_WDD EQU (0xFFF:SHL:16) ;- (WDTC) Watchdog Delta Value +-AT91C_WDTC_WDDBGHLT EQU (0x1:SHL:28) ;- (WDTC) Watchdog Debug Halt +-AT91C_WDTC_WDIDLEHLT EQU (0x1:SHL:29) ;- (WDTC) Watchdog Idle Halt +-;- -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- +-AT91C_WDTC_WDUNF EQU (0x1:SHL:0) ;- (WDTC) Watchdog Underflow +-AT91C_WDTC_WDERR EQU (0x1:SHL:1) ;- (WDTC) Watchdog Error +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_VREG +-VREG_MR # 4 ;- Voltage Regulator Mode Register +-;- -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- +-AT91C_VREG_PSTDBY EQU (0x1:SHL:0) ;- (VREG) Voltage Regulator Power Standby Mode +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Memory Controller Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_MC +-MC_RCR # 4 ;- MC Remap Control Register +-MC_ASR # 4 ;- MC Abort Status Register +-MC_AASR # 4 ;- MC Abort Address Status Register +- # 84 ;- Reserved +-MC_FMR # 4 ;- MC Flash Mode Register +-MC_FCR # 4 ;- MC Flash Command Register +-MC_FSR # 4 ;- MC Flash Status Register +-;- -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- +-AT91C_MC_RCB EQU (0x1:SHL:0) ;- (MC) Remap Command Bit +-;- -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- +-AT91C_MC_UNDADD EQU (0x1:SHL:0) ;- (MC) Undefined Addess Abort Status +-AT91C_MC_MISADD EQU (0x1:SHL:1) ;- (MC) Misaligned Addess Abort Status +-AT91C_MC_ABTSZ EQU (0x3:SHL:8) ;- (MC) Abort Size Status +-AT91C_MC_ABTSZ_BYTE EQU (0x0:SHL:8) ;- (MC) Byte +-AT91C_MC_ABTSZ_HWORD EQU (0x1:SHL:8) ;- (MC) Half-word +-AT91C_MC_ABTSZ_WORD EQU (0x2:SHL:8) ;- (MC) Word +-AT91C_MC_ABTTYP EQU (0x3:SHL:10) ;- (MC) Abort Type Status +-AT91C_MC_ABTTYP_DATAR EQU (0x0:SHL:10) ;- (MC) Data Read +-AT91C_MC_ABTTYP_DATAW EQU (0x1:SHL:10) ;- (MC) Data Write +-AT91C_MC_ABTTYP_FETCH EQU (0x2:SHL:10) ;- (MC) Code Fetch +-AT91C_MC_MST0 EQU (0x1:SHL:16) ;- (MC) Master 0 Abort Source +-AT91C_MC_MST1 EQU (0x1:SHL:17) ;- (MC) Master 1 Abort Source +-AT91C_MC_SVMST0 EQU (0x1:SHL:24) ;- (MC) Saved Master 0 Abort Source +-AT91C_MC_SVMST1 EQU (0x1:SHL:25) ;- (MC) Saved Master 1 Abort Source +-;- -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- +-AT91C_MC_FRDY EQU (0x1:SHL:0) ;- (MC) Flash Ready +-AT91C_MC_LOCKE EQU (0x1:SHL:2) ;- (MC) Lock Error +-AT91C_MC_PROGE EQU (0x1:SHL:3) ;- (MC) Programming Error +-AT91C_MC_NEBP EQU (0x1:SHL:7) ;- (MC) No Erase Before Programming +-AT91C_MC_FWS EQU (0x3:SHL:8) ;- (MC) Flash Wait State +-AT91C_MC_FWS_0FWS EQU (0x0:SHL:8) ;- (MC) 1 cycle for Read, 2 for Write operations +-AT91C_MC_FWS_1FWS EQU (0x1:SHL:8) ;- (MC) 2 cycles for Read, 3 for Write operations +-AT91C_MC_FWS_2FWS EQU (0x2:SHL:8) ;- (MC) 3 cycles for Read, 4 for Write operations +-AT91C_MC_FWS_3FWS EQU (0x3:SHL:8) ;- (MC) 4 cycles for Read, 4 for Write operations +-AT91C_MC_FMCN EQU (0xFF:SHL:16) ;- (MC) Flash Microsecond Cycle Number +-;- -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- +-AT91C_MC_FCMD EQU (0xF:SHL:0) ;- (MC) Flash Command +-AT91C_MC_FCMD_START_PROG EQU (0x1) ;- (MC) Starts the programming of th epage specified by PAGEN. +-AT91C_MC_FCMD_LOCK EQU (0x2) ;- (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-AT91C_MC_FCMD_PROG_AND_LOCK EQU (0x3) ;- (MC) The lock sequence automatically happens after the programming sequence is completed. +-AT91C_MC_FCMD_UNLOCK EQU (0x4) ;- (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-AT91C_MC_FCMD_ERASE_ALL EQU (0x8) ;- (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. +-AT91C_MC_FCMD_SET_GP_NVM EQU (0xB) ;- (MC) Set General Purpose NVM bits. +-AT91C_MC_FCMD_CLR_GP_NVM EQU (0xD) ;- (MC) Clear General Purpose NVM bits. +-AT91C_MC_FCMD_SET_SECURITY EQU (0xF) ;- (MC) Set Security Bit. +-AT91C_MC_PAGEN EQU (0x3FF:SHL:8) ;- (MC) Page Number +-AT91C_MC_KEY EQU (0xFF:SHL:24) ;- (MC) Writing Protect Key +-;- -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- +-AT91C_MC_SECURITY EQU (0x1:SHL:4) ;- (MC) Security Bit Status +-AT91C_MC_GPNVM0 EQU (0x1:SHL:8) ;- (MC) Sector 0 Lock Status +-AT91C_MC_GPNVM1 EQU (0x1:SHL:9) ;- (MC) Sector 1 Lock Status +-AT91C_MC_GPNVM2 EQU (0x1:SHL:10) ;- (MC) Sector 2 Lock Status +-AT91C_MC_GPNVM3 EQU (0x1:SHL:11) ;- (MC) Sector 3 Lock Status +-AT91C_MC_GPNVM4 EQU (0x1:SHL:12) ;- (MC) Sector 4 Lock Status +-AT91C_MC_GPNVM5 EQU (0x1:SHL:13) ;- (MC) Sector 5 Lock Status +-AT91C_MC_GPNVM6 EQU (0x1:SHL:14) ;- (MC) Sector 6 Lock Status +-AT91C_MC_GPNVM7 EQU (0x1:SHL:15) ;- (MC) Sector 7 Lock Status +-AT91C_MC_LOCKS0 EQU (0x1:SHL:16) ;- (MC) Sector 0 Lock Status +-AT91C_MC_LOCKS1 EQU (0x1:SHL:17) ;- (MC) Sector 1 Lock Status +-AT91C_MC_LOCKS2 EQU (0x1:SHL:18) ;- (MC) Sector 2 Lock Status +-AT91C_MC_LOCKS3 EQU (0x1:SHL:19) ;- (MC) Sector 3 Lock Status +-AT91C_MC_LOCKS4 EQU (0x1:SHL:20) ;- (MC) Sector 4 Lock Status +-AT91C_MC_LOCKS5 EQU (0x1:SHL:21) ;- (MC) Sector 5 Lock Status +-AT91C_MC_LOCKS6 EQU (0x1:SHL:22) ;- (MC) Sector 6 Lock Status +-AT91C_MC_LOCKS7 EQU (0x1:SHL:23) ;- (MC) Sector 7 Lock Status +-AT91C_MC_LOCKS8 EQU (0x1:SHL:24) ;- (MC) Sector 8 Lock Status +-AT91C_MC_LOCKS9 EQU (0x1:SHL:25) ;- (MC) Sector 9 Lock Status +-AT91C_MC_LOCKS10 EQU (0x1:SHL:26) ;- (MC) Sector 10 Lock Status +-AT91C_MC_LOCKS11 EQU (0x1:SHL:27) ;- (MC) Sector 11 Lock Status +-AT91C_MC_LOCKS12 EQU (0x1:SHL:28) ;- (MC) Sector 12 Lock Status +-AT91C_MC_LOCKS13 EQU (0x1:SHL:29) ;- (MC) Sector 13 Lock Status +-AT91C_MC_LOCKS14 EQU (0x1:SHL:30) ;- (MC) Sector 14 Lock Status +-AT91C_MC_LOCKS15 EQU (0x1:SHL:31) ;- (MC) Sector 15 Lock Status +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Serial Parallel Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_SPI +-SPI_CR # 4 ;- Control Register +-SPI_MR # 4 ;- Mode Register +-SPI_RDR # 4 ;- Receive Data Register +-SPI_TDR # 4 ;- Transmit Data Register +-SPI_SR # 4 ;- Status Register +-SPI_IER # 4 ;- Interrupt Enable Register +-SPI_IDR # 4 ;- Interrupt Disable Register +-SPI_IMR # 4 ;- Interrupt Mask Register +- # 16 ;- Reserved +-SPI_CSR # 16 ;- Chip Select Register +- # 192 ;- Reserved +-SPI_RPR # 4 ;- Receive Pointer Register +-SPI_RCR # 4 ;- Receive Counter Register +-SPI_TPR # 4 ;- Transmit Pointer Register +-SPI_TCR # 4 ;- Transmit Counter Register +-SPI_RNPR # 4 ;- Receive Next Pointer Register +-SPI_RNCR # 4 ;- Receive Next Counter Register +-SPI_TNPR # 4 ;- Transmit Next Pointer Register +-SPI_TNCR # 4 ;- Transmit Next Counter Register +-SPI_PTCR # 4 ;- PDC Transfer Control Register +-SPI_PTSR # 4 ;- PDC Transfer Status Register +-;- -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- +-AT91C_SPI_SPIEN EQU (0x1:SHL:0) ;- (SPI) SPI Enable +-AT91C_SPI_SPIDIS EQU (0x1:SHL:1) ;- (SPI) SPI Disable +-AT91C_SPI_SWRST EQU (0x1:SHL:7) ;- (SPI) SPI Software reset +-AT91C_SPI_LASTXFER EQU (0x1:SHL:24) ;- (SPI) SPI Last Transfer +-;- -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- +-AT91C_SPI_MSTR EQU (0x1:SHL:0) ;- (SPI) Master/Slave Mode +-AT91C_SPI_PS EQU (0x1:SHL:1) ;- (SPI) Peripheral Select +-AT91C_SPI_PS_FIXED EQU (0x0:SHL:1) ;- (SPI) Fixed Peripheral Select +-AT91C_SPI_PS_VARIABLE EQU (0x1:SHL:1) ;- (SPI) Variable Peripheral Select +-AT91C_SPI_PCSDEC EQU (0x1:SHL:2) ;- (SPI) Chip Select Decode +-AT91C_SPI_FDIV EQU (0x1:SHL:3) ;- (SPI) Clock Selection +-AT91C_SPI_MODFDIS EQU (0x1:SHL:4) ;- (SPI) Mode Fault Detection +-AT91C_SPI_LLB EQU (0x1:SHL:7) ;- (SPI) Clock Selection +-AT91C_SPI_PCS EQU (0xF:SHL:16) ;- (SPI) Peripheral Chip Select +-AT91C_SPI_DLYBCS EQU (0xFF:SHL:24) ;- (SPI) Delay Between Chip Selects +-;- -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- +-AT91C_SPI_RD EQU (0xFFFF:SHL:0) ;- (SPI) Receive Data +-AT91C_SPI_RPCS EQU (0xF:SHL:16) ;- (SPI) Peripheral Chip Select Status +-;- -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- +-AT91C_SPI_TD EQU (0xFFFF:SHL:0) ;- (SPI) Transmit Data +-AT91C_SPI_TPCS EQU (0xF:SHL:16) ;- (SPI) Peripheral Chip Select Status +-;- -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- +-AT91C_SPI_RDRF EQU (0x1:SHL:0) ;- (SPI) Receive Data Register Full +-AT91C_SPI_TDRE EQU (0x1:SHL:1) ;- (SPI) Transmit Data Register Empty +-AT91C_SPI_MODF EQU (0x1:SHL:2) ;- (SPI) Mode Fault Error +-AT91C_SPI_OVRES EQU (0x1:SHL:3) ;- (SPI) Overrun Error Status +-AT91C_SPI_ENDRX EQU (0x1:SHL:4) ;- (SPI) End of Receiver Transfer +-AT91C_SPI_ENDTX EQU (0x1:SHL:5) ;- (SPI) End of Receiver Transfer +-AT91C_SPI_RXBUFF EQU (0x1:SHL:6) ;- (SPI) RXBUFF Interrupt +-AT91C_SPI_TXBUFE EQU (0x1:SHL:7) ;- (SPI) TXBUFE Interrupt +-AT91C_SPI_NSSR EQU (0x1:SHL:8) ;- (SPI) NSSR Interrupt +-AT91C_SPI_TXEMPTY EQU (0x1:SHL:9) ;- (SPI) TXEMPTY Interrupt +-AT91C_SPI_SPIENS EQU (0x1:SHL:16) ;- (SPI) Enable Status +-;- -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- +-;- -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- +-;- -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- +-;- -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- +-AT91C_SPI_CPOL EQU (0x1:SHL:0) ;- (SPI) Clock Polarity +-AT91C_SPI_NCPHA EQU (0x1:SHL:1) ;- (SPI) Clock Phase +-AT91C_SPI_CSAAT EQU (0x1:SHL:3) ;- (SPI) Chip Select Active After Transfer +-AT91C_SPI_BITS EQU (0xF:SHL:4) ;- (SPI) Bits Per Transfer +-AT91C_SPI_BITS_8 EQU (0x0:SHL:4) ;- (SPI) 8 Bits Per transfer +-AT91C_SPI_BITS_9 EQU (0x1:SHL:4) ;- (SPI) 9 Bits Per transfer +-AT91C_SPI_BITS_10 EQU (0x2:SHL:4) ;- (SPI) 10 Bits Per transfer +-AT91C_SPI_BITS_11 EQU (0x3:SHL:4) ;- (SPI) 11 Bits Per transfer +-AT91C_SPI_BITS_12 EQU (0x4:SHL:4) ;- (SPI) 12 Bits Per transfer +-AT91C_SPI_BITS_13 EQU (0x5:SHL:4) ;- (SPI) 13 Bits Per transfer +-AT91C_SPI_BITS_14 EQU (0x6:SHL:4) ;- (SPI) 14 Bits Per transfer +-AT91C_SPI_BITS_15 EQU (0x7:SHL:4) ;- (SPI) 15 Bits Per transfer +-AT91C_SPI_BITS_16 EQU (0x8:SHL:4) ;- (SPI) 16 Bits Per transfer +-AT91C_SPI_SCBR EQU (0xFF:SHL:8) ;- (SPI) Serial Clock Baud Rate +-AT91C_SPI_DLYBS EQU (0xFF:SHL:16) ;- (SPI) Delay Before SPCK +-AT91C_SPI_DLYBCT EQU (0xFF:SHL:24) ;- (SPI) Delay Between Consecutive Transfers +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Usart +-;- ***************************************************************************** +- ^ 0 ;- AT91S_USART +-US_CR # 4 ;- Control Register +-US_MR # 4 ;- Mode Register +-US_IER # 4 ;- Interrupt Enable Register +-US_IDR # 4 ;- Interrupt Disable Register +-US_IMR # 4 ;- Interrupt Mask Register +-US_CSR # 4 ;- Channel Status Register +-US_RHR # 4 ;- Receiver Holding Register +-US_THR # 4 ;- Transmitter Holding Register +-US_BRGR # 4 ;- Baud Rate Generator Register +-US_RTOR # 4 ;- Receiver Time-out Register +-US_TTGR # 4 ;- Transmitter Time-guard Register +- # 20 ;- Reserved +-US_FIDI # 4 ;- FI_DI_Ratio Register +-US_NER # 4 ;- Nb Errors Register +- # 4 ;- Reserved +-US_IF # 4 ;- IRDA_FILTER Register +- # 176 ;- Reserved +-US_RPR # 4 ;- Receive Pointer Register +-US_RCR # 4 ;- Receive Counter Register +-US_TPR # 4 ;- Transmit Pointer Register +-US_TCR # 4 ;- Transmit Counter Register +-US_RNPR # 4 ;- Receive Next Pointer Register +-US_RNCR # 4 ;- Receive Next Counter Register +-US_TNPR # 4 ;- Transmit Next Pointer Register +-US_TNCR # 4 ;- Transmit Next Counter Register +-US_PTCR # 4 ;- PDC Transfer Control Register +-US_PTSR # 4 ;- PDC Transfer Status Register +-;- -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- +-AT91C_US_STTBRK EQU (0x1:SHL:9) ;- (USART) Start Break +-AT91C_US_STPBRK EQU (0x1:SHL:10) ;- (USART) Stop Break +-AT91C_US_STTTO EQU (0x1:SHL:11) ;- (USART) Start Time-out +-AT91C_US_SENDA EQU (0x1:SHL:12) ;- (USART) Send Address +-AT91C_US_RSTIT EQU (0x1:SHL:13) ;- (USART) Reset Iterations +-AT91C_US_RSTNACK EQU (0x1:SHL:14) ;- (USART) Reset Non Acknowledge +-AT91C_US_RETTO EQU (0x1:SHL:15) ;- (USART) Rearm Time-out +-AT91C_US_DTREN EQU (0x1:SHL:16) ;- (USART) Data Terminal ready Enable +-AT91C_US_DTRDIS EQU (0x1:SHL:17) ;- (USART) Data Terminal ready Disable +-AT91C_US_RTSEN EQU (0x1:SHL:18) ;- (USART) Request to Send enable +-AT91C_US_RTSDIS EQU (0x1:SHL:19) ;- (USART) Request to Send Disable +-;- -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- +-AT91C_US_USMODE EQU (0xF:SHL:0) ;- (USART) Usart mode +-AT91C_US_USMODE_NORMAL EQU (0x0) ;- (USART) Normal +-AT91C_US_USMODE_RS485 EQU (0x1) ;- (USART) RS485 +-AT91C_US_USMODE_HWHSH EQU (0x2) ;- (USART) Hardware Handshaking +-AT91C_US_USMODE_MODEM EQU (0x3) ;- (USART) Modem +-AT91C_US_USMODE_ISO7816_0 EQU (0x4) ;- (USART) ISO7816 protocol: T = 0 +-AT91C_US_USMODE_ISO7816_1 EQU (0x6) ;- (USART) ISO7816 protocol: T = 1 +-AT91C_US_USMODE_IRDA EQU (0x8) ;- (USART) IrDA +-AT91C_US_USMODE_SWHSH EQU (0xC) ;- (USART) Software Handshaking +-AT91C_US_CLKS EQU (0x3:SHL:4) ;- (USART) Clock Selection (Baud Rate generator Input Clock +-AT91C_US_CLKS_CLOCK EQU (0x0:SHL:4) ;- (USART) Clock +-AT91C_US_CLKS_FDIV1 EQU (0x1:SHL:4) ;- (USART) fdiv1 +-AT91C_US_CLKS_SLOW EQU (0x2:SHL:4) ;- (USART) slow_clock (ARM) +-AT91C_US_CLKS_EXT EQU (0x3:SHL:4) ;- (USART) External (SCK) +-AT91C_US_CHRL EQU (0x3:SHL:6) ;- (USART) Clock Selection (Baud Rate generator Input Clock +-AT91C_US_CHRL_5_BITS EQU (0x0:SHL:6) ;- (USART) Character Length: 5 bits +-AT91C_US_CHRL_6_BITS EQU (0x1:SHL:6) ;- (USART) Character Length: 6 bits +-AT91C_US_CHRL_7_BITS EQU (0x2:SHL:6) ;- (USART) Character Length: 7 bits +-AT91C_US_CHRL_8_BITS EQU (0x3:SHL:6) ;- (USART) Character Length: 8 bits +-AT91C_US_SYNC EQU (0x1:SHL:8) ;- (USART) Synchronous Mode Select +-AT91C_US_NBSTOP EQU (0x3:SHL:12) ;- (USART) Number of Stop bits +-AT91C_US_NBSTOP_1_BIT EQU (0x0:SHL:12) ;- (USART) 1 stop bit +-AT91C_US_NBSTOP_15_BIT EQU (0x1:SHL:12) ;- (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits +-AT91C_US_NBSTOP_2_BIT EQU (0x2:SHL:12) ;- (USART) 2 stop bits +-AT91C_US_MSBF EQU (0x1:SHL:16) ;- (USART) Bit Order +-AT91C_US_MODE9 EQU (0x1:SHL:17) ;- (USART) 9-bit Character length +-AT91C_US_CKLO EQU (0x1:SHL:18) ;- (USART) Clock Output Select +-AT91C_US_OVER EQU (0x1:SHL:19) ;- (USART) Over Sampling Mode +-AT91C_US_INACK EQU (0x1:SHL:20) ;- (USART) Inhibit Non Acknowledge +-AT91C_US_DSNACK EQU (0x1:SHL:21) ;- (USART) Disable Successive NACK +-AT91C_US_MAX_ITER EQU (0x1:SHL:24) ;- (USART) Number of Repetitions +-AT91C_US_FILTER EQU (0x1:SHL:28) ;- (USART) Receive Line Filter +-;- -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-AT91C_US_RXBRK EQU (0x1:SHL:2) ;- (USART) Break Received/End of Break +-AT91C_US_TIMEOUT EQU (0x1:SHL:8) ;- (USART) Receiver Time-out +-AT91C_US_ITERATION EQU (0x1:SHL:10) ;- (USART) Max number of Repetitions Reached +-AT91C_US_NACK EQU (0x1:SHL:13) ;- (USART) Non Acknowledge +-AT91C_US_RIIC EQU (0x1:SHL:16) ;- (USART) Ring INdicator Input Change Flag +-AT91C_US_DSRIC EQU (0x1:SHL:17) ;- (USART) Data Set Ready Input Change Flag +-AT91C_US_DCDIC EQU (0x1:SHL:18) ;- (USART) Data Carrier Flag +-AT91C_US_CTSIC EQU (0x1:SHL:19) ;- (USART) Clear To Send Input Change Flag +-;- -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-;- -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-;- -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- +-AT91C_US_RI EQU (0x1:SHL:20) ;- (USART) Image of RI Input +-AT91C_US_DSR EQU (0x1:SHL:21) ;- (USART) Image of DSR Input +-AT91C_US_DCD EQU (0x1:SHL:22) ;- (USART) Image of DCD Input +-AT91C_US_CTS EQU (0x1:SHL:23) ;- (USART) Image of CTS Input +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_SSC +-SSC_CR # 4 ;- Control Register +-SSC_CMR # 4 ;- Clock Mode Register +- # 8 ;- Reserved +-SSC_RCMR # 4 ;- Receive Clock ModeRegister +-SSC_RFMR # 4 ;- Receive Frame Mode Register +-SSC_TCMR # 4 ;- Transmit Clock Mode Register +-SSC_TFMR # 4 ;- Transmit Frame Mode Register +-SSC_RHR # 4 ;- Receive Holding Register +-SSC_THR # 4 ;- Transmit Holding Register +- # 8 ;- Reserved +-SSC_RSHR # 4 ;- Receive Sync Holding Register +-SSC_TSHR # 4 ;- Transmit Sync Holding Register +- # 8 ;- Reserved +-SSC_SR # 4 ;- Status Register +-SSC_IER # 4 ;- Interrupt Enable Register +-SSC_IDR # 4 ;- Interrupt Disable Register +-SSC_IMR # 4 ;- Interrupt Mask Register +- # 176 ;- Reserved +-SSC_RPR # 4 ;- Receive Pointer Register +-SSC_RCR # 4 ;- Receive Counter Register +-SSC_TPR # 4 ;- Transmit Pointer Register +-SSC_TCR # 4 ;- Transmit Counter Register +-SSC_RNPR # 4 ;- Receive Next Pointer Register +-SSC_RNCR # 4 ;- Receive Next Counter Register +-SSC_TNPR # 4 ;- Transmit Next Pointer Register +-SSC_TNCR # 4 ;- Transmit Next Counter Register +-SSC_PTCR # 4 ;- PDC Transfer Control Register +-SSC_PTSR # 4 ;- PDC Transfer Status Register +-;- -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- +-AT91C_SSC_RXEN EQU (0x1:SHL:0) ;- (SSC) Receive Enable +-AT91C_SSC_RXDIS EQU (0x1:SHL:1) ;- (SSC) Receive Disable +-AT91C_SSC_TXEN EQU (0x1:SHL:8) ;- (SSC) Transmit Enable +-AT91C_SSC_TXDIS EQU (0x1:SHL:9) ;- (SSC) Transmit Disable +-AT91C_SSC_SWRST EQU (0x1:SHL:15) ;- (SSC) Software Reset +-;- -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- +-AT91C_SSC_CKS EQU (0x3:SHL:0) ;- (SSC) Receive/Transmit Clock Selection +-AT91C_SSC_CKS_DIV EQU (0x0) ;- (SSC) Divided Clock +-AT91C_SSC_CKS_TK EQU (0x1) ;- (SSC) TK Clock signal +-AT91C_SSC_CKS_RK EQU (0x2) ;- (SSC) RK pin +-AT91C_SSC_CKO EQU (0x7:SHL:2) ;- (SSC) Receive/Transmit Clock Output Mode Selection +-AT91C_SSC_CKO_NONE EQU (0x0:SHL:2) ;- (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only +-AT91C_SSC_CKO_CONTINOUS EQU (0x1:SHL:2) ;- (SSC) Continuous Receive/Transmit Clock RK pin: Output +-AT91C_SSC_CKO_DATA_TX EQU (0x2:SHL:2) ;- (SSC) Receive/Transmit Clock only during data transfers RK pin: Output +-AT91C_SSC_CKI EQU (0x1:SHL:5) ;- (SSC) Receive/Transmit Clock Inversion +-AT91C_SSC_CKG EQU (0x3:SHL:6) ;- (SSC) Receive/Transmit Clock Gating Selection +-AT91C_SSC_CKG_NONE EQU (0x0:SHL:6) ;- (SSC) Receive/Transmit Clock Gating: None, continuous clock +-AT91C_SSC_CKG_LOW EQU (0x1:SHL:6) ;- (SSC) Receive/Transmit Clock enabled only if RF Low +-AT91C_SSC_CKG_HIGH EQU (0x2:SHL:6) ;- (SSC) Receive/Transmit Clock enabled only if RF High +-AT91C_SSC_START EQU (0xF:SHL:8) ;- (SSC) Receive/Transmit Start Selection +-AT91C_SSC_START_CONTINOUS EQU (0x0:SHL:8) ;- (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. +-AT91C_SSC_START_TX EQU (0x1:SHL:8) ;- (SSC) Transmit/Receive start +-AT91C_SSC_START_LOW_RF EQU (0x2:SHL:8) ;- (SSC) Detection of a low level on RF input +-AT91C_SSC_START_HIGH_RF EQU (0x3:SHL:8) ;- (SSC) Detection of a high level on RF input +-AT91C_SSC_START_FALL_RF EQU (0x4:SHL:8) ;- (SSC) Detection of a falling edge on RF input +-AT91C_SSC_START_RISE_RF EQU (0x5:SHL:8) ;- (SSC) Detection of a rising edge on RF input +-AT91C_SSC_START_LEVEL_RF EQU (0x6:SHL:8) ;- (SSC) Detection of any level change on RF input +-AT91C_SSC_START_EDGE_RF EQU (0x7:SHL:8) ;- (SSC) Detection of any edge on RF input +-AT91C_SSC_START_0 EQU (0x8:SHL:8) ;- (SSC) Compare 0 +-AT91C_SSC_STOP EQU (0x1:SHL:12) ;- (SSC) Receive Stop Selection +-AT91C_SSC_STTDLY EQU (0xFF:SHL:16) ;- (SSC) Receive/Transmit Start Delay +-AT91C_SSC_PERIOD EQU (0xFF:SHL:24) ;- (SSC) Receive/Transmit Period Divider Selection +-;- -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- +-AT91C_SSC_DATLEN EQU (0x1F:SHL:0) ;- (SSC) Data Length +-AT91C_SSC_LOOP EQU (0x1:SHL:5) ;- (SSC) Loop Mode +-AT91C_SSC_MSBF EQU (0x1:SHL:7) ;- (SSC) Most Significant Bit First +-AT91C_SSC_DATNB EQU (0xF:SHL:8) ;- (SSC) Data Number per Frame +-AT91C_SSC_FSLEN EQU (0xF:SHL:16) ;- (SSC) Receive/Transmit Frame Sync length +-AT91C_SSC_FSOS EQU (0x7:SHL:20) ;- (SSC) Receive/Transmit Frame Sync Output Selection +-AT91C_SSC_FSOS_NONE EQU (0x0:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only +-AT91C_SSC_FSOS_NEGATIVE EQU (0x1:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse +-AT91C_SSC_FSOS_POSITIVE EQU (0x2:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse +-AT91C_SSC_FSOS_LOW EQU (0x3:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer +-AT91C_SSC_FSOS_HIGH EQU (0x4:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer +-AT91C_SSC_FSOS_TOGGLE EQU (0x5:SHL:20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer +-AT91C_SSC_FSEDGE EQU (0x1:SHL:24) ;- (SSC) Frame Sync Edge Detection +-;- -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- +-;- -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- +-AT91C_SSC_DATDEF EQU (0x1:SHL:5) ;- (SSC) Data Default Value +-AT91C_SSC_FSDEN EQU (0x1:SHL:23) ;- (SSC) Frame Sync Data Enable +-;- -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- +-AT91C_SSC_TXRDY EQU (0x1:SHL:0) ;- (SSC) Transmit Ready +-AT91C_SSC_TXEMPTY EQU (0x1:SHL:1) ;- (SSC) Transmit Empty +-AT91C_SSC_ENDTX EQU (0x1:SHL:2) ;- (SSC) End Of Transmission +-AT91C_SSC_TXBUFE EQU (0x1:SHL:3) ;- (SSC) Transmit Buffer Empty +-AT91C_SSC_RXRDY EQU (0x1:SHL:4) ;- (SSC) Receive Ready +-AT91C_SSC_OVRUN EQU (0x1:SHL:5) ;- (SSC) Receive Overrun +-AT91C_SSC_ENDRX EQU (0x1:SHL:6) ;- (SSC) End of Reception +-AT91C_SSC_RXBUFF EQU (0x1:SHL:7) ;- (SSC) Receive Buffer Full +-AT91C_SSC_CP0 EQU (0x1:SHL:8) ;- (SSC) Compare 0 +-AT91C_SSC_CP1 EQU (0x1:SHL:9) ;- (SSC) Compare 1 +-AT91C_SSC_TXSYN EQU (0x1:SHL:10) ;- (SSC) Transmit Sync +-AT91C_SSC_RXSYN EQU (0x1:SHL:11) ;- (SSC) Receive Sync +-AT91C_SSC_TXENA EQU (0x1:SHL:16) ;- (SSC) Transmit Enable +-AT91C_SSC_RXENA EQU (0x1:SHL:17) ;- (SSC) Receive Enable +-;- -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- +-;- -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- +-;- -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Two-wire Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_TWI +-TWI_CR # 4 ;- Control Register +-TWI_MMR # 4 ;- Master Mode Register +- # 4 ;- Reserved +-TWI_IADR # 4 ;- Internal Address Register +-TWI_CWGR # 4 ;- Clock Waveform Generator Register +- # 12 ;- Reserved +-TWI_SR # 4 ;- Status Register +-TWI_IER # 4 ;- Interrupt Enable Register +-TWI_IDR # 4 ;- Interrupt Disable Register +-TWI_IMR # 4 ;- Interrupt Mask Register +-TWI_RHR # 4 ;- Receive Holding Register +-TWI_THR # 4 ;- Transmit Holding Register +-;- -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- +-AT91C_TWI_START EQU (0x1:SHL:0) ;- (TWI) Send a START Condition +-AT91C_TWI_STOP EQU (0x1:SHL:1) ;- (TWI) Send a STOP Condition +-AT91C_TWI_MSEN EQU (0x1:SHL:2) ;- (TWI) TWI Master Transfer Enabled +-AT91C_TWI_MSDIS EQU (0x1:SHL:3) ;- (TWI) TWI Master Transfer Disabled +-AT91C_TWI_SWRST EQU (0x1:SHL:7) ;- (TWI) Software Reset +-;- -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- +-AT91C_TWI_IADRSZ EQU (0x3:SHL:8) ;- (TWI) Internal Device Address Size +-AT91C_TWI_IADRSZ_NO EQU (0x0:SHL:8) ;- (TWI) No internal device address +-AT91C_TWI_IADRSZ_1_BYTE EQU (0x1:SHL:8) ;- (TWI) One-byte internal device address +-AT91C_TWI_IADRSZ_2_BYTE EQU (0x2:SHL:8) ;- (TWI) Two-byte internal device address +-AT91C_TWI_IADRSZ_3_BYTE EQU (0x3:SHL:8) ;- (TWI) Three-byte internal device address +-AT91C_TWI_MREAD EQU (0x1:SHL:12) ;- (TWI) Master Read Direction +-AT91C_TWI_DADR EQU (0x7F:SHL:16) ;- (TWI) Device Address +-;- -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- +-AT91C_TWI_CLDIV EQU (0xFF:SHL:0) ;- (TWI) Clock Low Divider +-AT91C_TWI_CHDIV EQU (0xFF:SHL:8) ;- (TWI) Clock High Divider +-AT91C_TWI_CKDIV EQU (0x7:SHL:16) ;- (TWI) Clock Divider +-;- -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- +-AT91C_TWI_TXCOMP EQU (0x1:SHL:0) ;- (TWI) Transmission Completed +-AT91C_TWI_RXRDY EQU (0x1:SHL:1) ;- (TWI) Receive holding register ReaDY +-AT91C_TWI_TXRDY EQU (0x1:SHL:2) ;- (TWI) Transmit holding register ReaDY +-AT91C_TWI_OVRE EQU (0x1:SHL:6) ;- (TWI) Overrun Error +-AT91C_TWI_UNRE EQU (0x1:SHL:7) ;- (TWI) Underrun Error +-AT91C_TWI_NACK EQU (0x1:SHL:8) ;- (TWI) Not Acknowledged +-;- -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- +-;- -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- +-;- -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR PWMC Channel Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_PWMC_CH +-PWMC_CMR # 4 ;- Channel Mode Register +-PWMC_CDTYR # 4 ;- Channel Duty Cycle Register +-PWMC_CPRDR # 4 ;- Channel Period Register +-PWMC_CCNTR # 4 ;- Channel Counter Register +-PWMC_CUPDR # 4 ;- Channel Update Register +-PWMC_Reserved # 12 ;- Reserved +-;- -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- +-AT91C_PWMC_CPRE EQU (0xF:SHL:0) ;- (PWMC_CH) Channel Pre-scaler : PWMC_CLKx +-AT91C_PWMC_CPRE_MCK EQU (0x0) ;- (PWMC_CH) +-AT91C_PWMC_CPRE_MCKA EQU (0xB) ;- (PWMC_CH) +-AT91C_PWMC_CPRE_MCKB EQU (0xC) ;- (PWMC_CH) +-AT91C_PWMC_CALG EQU (0x1:SHL:8) ;- (PWMC_CH) Channel Alignment +-AT91C_PWMC_CPOL EQU (0x1:SHL:9) ;- (PWMC_CH) Channel Polarity +-AT91C_PWMC_CPD EQU (0x1:SHL:10) ;- (PWMC_CH) Channel Update Period +-;- -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- +-AT91C_PWMC_CDTY EQU (0x0:SHL:0) ;- (PWMC_CH) Channel Duty Cycle +-;- -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- +-AT91C_PWMC_CPRD EQU (0x0:SHL:0) ;- (PWMC_CH) Channel Period +-;- -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- +-AT91C_PWMC_CCNT EQU (0x0:SHL:0) ;- (PWMC_CH) Channel Counter +-;- -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- +-AT91C_PWMC_CUPD EQU (0x0:SHL:0) ;- (PWMC_CH) Channel Update +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_PWMC +-PWMC_MR # 4 ;- PWMC Mode Register +-PWMC_ENA # 4 ;- PWMC Enable Register +-PWMC_DIS # 4 ;- PWMC Disable Register +-PWMC_SR # 4 ;- PWMC Status Register +-PWMC_IER # 4 ;- PWMC Interrupt Enable Register +-PWMC_IDR # 4 ;- PWMC Interrupt Disable Register +-PWMC_IMR # 4 ;- PWMC Interrupt Mask Register +-PWMC_ISR # 4 ;- PWMC Interrupt Status Register +- # 220 ;- Reserved +-PWMC_VR # 4 ;- PWMC Version Register +- # 256 ;- Reserved +-PWMC_CH # 96 ;- PWMC Channel +-;- -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- +-AT91C_PWMC_DIVA EQU (0xFF:SHL:0) ;- (PWMC) CLKA divide factor. +-AT91C_PWMC_PREA EQU (0xF:SHL:8) ;- (PWMC) Divider Input Clock Prescaler A +-AT91C_PWMC_PREA_MCK EQU (0x0:SHL:8) ;- (PWMC) +-AT91C_PWMC_DIVB EQU (0xFF:SHL:16) ;- (PWMC) CLKB divide factor. +-AT91C_PWMC_PREB EQU (0xF:SHL:24) ;- (PWMC) Divider Input Clock Prescaler B +-AT91C_PWMC_PREB_MCK EQU (0x0:SHL:24) ;- (PWMC) +-;- -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- +-AT91C_PWMC_CHID0 EQU (0x1:SHL:0) ;- (PWMC) Channel ID 0 +-AT91C_PWMC_CHID1 EQU (0x1:SHL:1) ;- (PWMC) Channel ID 1 +-AT91C_PWMC_CHID2 EQU (0x1:SHL:2) ;- (PWMC) Channel ID 2 +-AT91C_PWMC_CHID3 EQU (0x1:SHL:3) ;- (PWMC) Channel ID 3 +-;- -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- +-;- -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- +-;- -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- +-;- -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- +-;- -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- +-;- -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR USB Device Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_UDP +-UDP_NUM # 4 ;- Frame Number Register +-UDP_GLBSTATE # 4 ;- Global State Register +-UDP_FADDR # 4 ;- Function Address Register +- # 4 ;- Reserved +-UDP_IER # 4 ;- Interrupt Enable Register +-UDP_IDR # 4 ;- Interrupt Disable Register +-UDP_IMR # 4 ;- Interrupt Mask Register +-UDP_ISR # 4 ;- Interrupt Status Register +-UDP_ICR # 4 ;- Interrupt Clear Register +- # 4 ;- Reserved +-UDP_RSTEP # 4 ;- Reset Endpoint Register +- # 4 ;- Reserved +-UDP_CSR # 24 ;- Endpoint Control and Status Register +- # 8 ;- Reserved +-UDP_FDR # 24 ;- Endpoint FIFO Data Register +- # 12 ;- Reserved +-UDP_TXVC # 4 ;- Transceiver Control Register +-;- -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- +-AT91C_UDP_FRM_NUM EQU (0x7FF:SHL:0) ;- (UDP) Frame Number as Defined in the Packet Field Formats +-AT91C_UDP_FRM_ERR EQU (0x1:SHL:16) ;- (UDP) Frame Error +-AT91C_UDP_FRM_OK EQU (0x1:SHL:17) ;- (UDP) Frame OK +-;- -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- +-AT91C_UDP_FADDEN EQU (0x1:SHL:0) ;- (UDP) Function Address Enable +-AT91C_UDP_CONFG EQU (0x1:SHL:1) ;- (UDP) Configured +-AT91C_UDP_ESR EQU (0x1:SHL:2) ;- (UDP) Enable Send Resume +-AT91C_UDP_RSMINPR EQU (0x1:SHL:3) ;- (UDP) A Resume Has Been Sent to the Host +-AT91C_UDP_RMWUPE EQU (0x1:SHL:4) ;- (UDP) Remote Wake Up Enable +-;- -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- +-AT91C_UDP_FADD EQU (0xFF:SHL:0) ;- (UDP) Function Address Value +-AT91C_UDP_FEN EQU (0x1:SHL:8) ;- (UDP) Function Enable +-;- -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- +-AT91C_UDP_EPINT0 EQU (0x1:SHL:0) ;- (UDP) Endpoint 0 Interrupt +-AT91C_UDP_EPINT1 EQU (0x1:SHL:1) ;- (UDP) Endpoint 0 Interrupt +-AT91C_UDP_EPINT2 EQU (0x1:SHL:2) ;- (UDP) Endpoint 2 Interrupt +-AT91C_UDP_EPINT3 EQU (0x1:SHL:3) ;- (UDP) Endpoint 3 Interrupt +-AT91C_UDP_EPINT4 EQU (0x1:SHL:4) ;- (UDP) Endpoint 4 Interrupt +-AT91C_UDP_EPINT5 EQU (0x1:SHL:5) ;- (UDP) Endpoint 5 Interrupt +-AT91C_UDP_RXSUSP EQU (0x1:SHL:8) ;- (UDP) USB Suspend Interrupt +-AT91C_UDP_RXRSM EQU (0x1:SHL:9) ;- (UDP) USB Resume Interrupt +-AT91C_UDP_EXTRSM EQU (0x1:SHL:10) ;- (UDP) USB External Resume Interrupt +-AT91C_UDP_SOFINT EQU (0x1:SHL:11) ;- (UDP) USB Start Of frame Interrupt +-AT91C_UDP_WAKEUP EQU (0x1:SHL:13) ;- (UDP) USB Resume Interrupt +-;- -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- +-;- -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- +-;- -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- +-AT91C_UDP_ENDBUSRES EQU (0x1:SHL:12) ;- (UDP) USB End Of Bus Reset Interrupt +-;- -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- +-;- -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- +-AT91C_UDP_EP0 EQU (0x1:SHL:0) ;- (UDP) Reset Endpoint 0 +-AT91C_UDP_EP1 EQU (0x1:SHL:1) ;- (UDP) Reset Endpoint 1 +-AT91C_UDP_EP2 EQU (0x1:SHL:2) ;- (UDP) Reset Endpoint 2 +-AT91C_UDP_EP3 EQU (0x1:SHL:3) ;- (UDP) Reset Endpoint 3 +-AT91C_UDP_EP4 EQU (0x1:SHL:4) ;- (UDP) Reset Endpoint 4 +-AT91C_UDP_EP5 EQU (0x1:SHL:5) ;- (UDP) Reset Endpoint 5 +-;- -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- +-AT91C_UDP_TXCOMP EQU (0x1:SHL:0) ;- (UDP) Generates an IN packet with data previously written in the DPR +-AT91C_UDP_RX_DATA_BK0 EQU (0x1:SHL:1) ;- (UDP) Receive Data Bank 0 +-AT91C_UDP_RXSETUP EQU (0x1:SHL:2) ;- (UDP) Sends STALL to the Host (Control endpoints) +-AT91C_UDP_ISOERROR EQU (0x1:SHL:3) ;- (UDP) Isochronous error (Isochronous endpoints) +-AT91C_UDP_TXPKTRDY EQU (0x1:SHL:4) ;- (UDP) Transmit Packet Ready +-AT91C_UDP_FORCESTALL EQU (0x1:SHL:5) ;- (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). +-AT91C_UDP_RX_DATA_BK1 EQU (0x1:SHL:6) ;- (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). +-AT91C_UDP_DIR EQU (0x1:SHL:7) ;- (UDP) Transfer Direction +-AT91C_UDP_EPTYPE EQU (0x7:SHL:8) ;- (UDP) Endpoint type +-AT91C_UDP_EPTYPE_CTRL EQU (0x0:SHL:8) ;- (UDP) Control +-AT91C_UDP_EPTYPE_ISO_OUT EQU (0x1:SHL:8) ;- (UDP) Isochronous OUT +-AT91C_UDP_EPTYPE_BULK_OUT EQU (0x2:SHL:8) ;- (UDP) Bulk OUT +-AT91C_UDP_EPTYPE_INT_OUT EQU (0x3:SHL:8) ;- (UDP) Interrupt OUT +-AT91C_UDP_EPTYPE_ISO_IN EQU (0x5:SHL:8) ;- (UDP) Isochronous IN +-AT91C_UDP_EPTYPE_BULK_IN EQU (0x6:SHL:8) ;- (UDP) Bulk IN +-AT91C_UDP_EPTYPE_INT_IN EQU (0x7:SHL:8) ;- (UDP) Interrupt IN +-AT91C_UDP_DTGLE EQU (0x1:SHL:11) ;- (UDP) Data Toggle +-AT91C_UDP_EPEDS EQU (0x1:SHL:15) ;- (UDP) Endpoint Enable Disable +-AT91C_UDP_RXBYTECNT EQU (0x7FF:SHL:16) ;- (UDP) Number Of Bytes Available in the FIFO +-;- -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- +-AT91C_UDP_TXVDIS EQU (0x1:SHL:8) ;- (UDP) +-AT91C_UDP_PUON EQU (0x1:SHL:9) ;- (UDP) Pull-up ON +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Timer Counter Channel Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_TC +-TC_CCR # 4 ;- Channel Control Register +-TC_CMR # 4 ;- Channel Mode Register (Capture Mode / Waveform Mode) +- # 8 ;- Reserved +-TC_CV # 4 ;- Counter Value +-TC_RA # 4 ;- Register A +-TC_RB # 4 ;- Register B +-TC_RC # 4 ;- Register C +-TC_SR # 4 ;- Status Register +-TC_IER # 4 ;- Interrupt Enable Register +-TC_IDR # 4 ;- Interrupt Disable Register +-TC_IMR # 4 ;- Interrupt Mask Register +-;- -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- +-AT91C_TC_CLKEN EQU (0x1:SHL:0) ;- (TC) Counter Clock Enable Command +-AT91C_TC_CLKDIS EQU (0x1:SHL:1) ;- (TC) Counter Clock Disable Command +-AT91C_TC_SWTRG EQU (0x1:SHL:2) ;- (TC) Software Trigger Command +-;- -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- +-AT91C_TC_CLKS EQU (0x7:SHL:0) ;- (TC) Clock Selection +-AT91C_TC_CLKS_TIMER_DIV1_CLOCK EQU (0x0) ;- (TC) Clock selected: TIMER_DIV1_CLOCK +-AT91C_TC_CLKS_TIMER_DIV2_CLOCK EQU (0x1) ;- (TC) Clock selected: TIMER_DIV2_CLOCK +-AT91C_TC_CLKS_TIMER_DIV3_CLOCK EQU (0x2) ;- (TC) Clock selected: TIMER_DIV3_CLOCK +-AT91C_TC_CLKS_TIMER_DIV4_CLOCK EQU (0x3) ;- (TC) Clock selected: TIMER_DIV4_CLOCK +-AT91C_TC_CLKS_TIMER_DIV5_CLOCK EQU (0x4) ;- (TC) Clock selected: TIMER_DIV5_CLOCK +-AT91C_TC_CLKS_XC0 EQU (0x5) ;- (TC) Clock selected: XC0 +-AT91C_TC_CLKS_XC1 EQU (0x6) ;- (TC) Clock selected: XC1 +-AT91C_TC_CLKS_XC2 EQU (0x7) ;- (TC) Clock selected: XC2 +-AT91C_TC_CLKI EQU (0x1:SHL:3) ;- (TC) Clock Invert +-AT91C_TC_BURST EQU (0x3:SHL:4) ;- (TC) Burst Signal Selection +-AT91C_TC_BURST_NONE EQU (0x0:SHL:4) ;- (TC) The clock is not gated by an external signal +-AT91C_TC_BURST_XC0 EQU (0x1:SHL:4) ;- (TC) XC0 is ANDed with the selected clock +-AT91C_TC_BURST_XC1 EQU (0x2:SHL:4) ;- (TC) XC1 is ANDed with the selected clock +-AT91C_TC_BURST_XC2 EQU (0x3:SHL:4) ;- (TC) XC2 is ANDed with the selected clock +-AT91C_TC_CPCSTOP EQU (0x1:SHL:6) ;- (TC) Counter Clock Stopped with RC Compare +-AT91C_TC_LDBSTOP EQU (0x1:SHL:6) ;- (TC) Counter Clock Stopped with RB Loading +-AT91C_TC_CPCDIS EQU (0x1:SHL:7) ;- (TC) Counter Clock Disable with RC Compare +-AT91C_TC_LDBDIS EQU (0x1:SHL:7) ;- (TC) Counter Clock Disabled with RB Loading +-AT91C_TC_ETRGEDG EQU (0x3:SHL:8) ;- (TC) External Trigger Edge Selection +-AT91C_TC_ETRGEDG_NONE EQU (0x0:SHL:8) ;- (TC) Edge: None +-AT91C_TC_ETRGEDG_RISING EQU (0x1:SHL:8) ;- (TC) Edge: rising edge +-AT91C_TC_ETRGEDG_FALLING EQU (0x2:SHL:8) ;- (TC) Edge: falling edge +-AT91C_TC_ETRGEDG_BOTH EQU (0x3:SHL:8) ;- (TC) Edge: each edge +-AT91C_TC_EEVTEDG EQU (0x3:SHL:8) ;- (TC) External Event Edge Selection +-AT91C_TC_EEVTEDG_NONE EQU (0x0:SHL:8) ;- (TC) Edge: None +-AT91C_TC_EEVTEDG_RISING EQU (0x1:SHL:8) ;- (TC) Edge: rising edge +-AT91C_TC_EEVTEDG_FALLING EQU (0x2:SHL:8) ;- (TC) Edge: falling edge +-AT91C_TC_EEVTEDG_BOTH EQU (0x3:SHL:8) ;- (TC) Edge: each edge +-AT91C_TC_EEVT EQU (0x3:SHL:10) ;- (TC) External Event Selection +-AT91C_TC_EEVT_TIOB EQU (0x0:SHL:10) ;- (TC) Signal selected as external event: TIOB TIOB direction: input +-AT91C_TC_EEVT_XC0 EQU (0x1:SHL:10) ;- (TC) Signal selected as external event: XC0 TIOB direction: output +-AT91C_TC_EEVT_XC1 EQU (0x2:SHL:10) ;- (TC) Signal selected as external event: XC1 TIOB direction: output +-AT91C_TC_EEVT_XC2 EQU (0x3:SHL:10) ;- (TC) Signal selected as external event: XC2 TIOB direction: output +-AT91C_TC_ABETRG EQU (0x1:SHL:10) ;- (TC) TIOA or TIOB External Trigger Selection +-AT91C_TC_ENETRG EQU (0x1:SHL:12) ;- (TC) External Event Trigger enable +-AT91C_TC_WAVESEL EQU (0x3:SHL:13) ;- (TC) Waveform Selection +-AT91C_TC_WAVESEL_UP EQU (0x0:SHL:13) ;- (TC) UP mode without atomatic trigger on RC Compare +-AT91C_TC_WAVESEL_UPDOWN EQU (0x1:SHL:13) ;- (TC) UPDOWN mode without automatic trigger on RC Compare +-AT91C_TC_WAVESEL_UP_AUTO EQU (0x2:SHL:13) ;- (TC) UP mode with automatic trigger on RC Compare +-AT91C_TC_WAVESEL_UPDOWN_AUTO EQU (0x3:SHL:13) ;- (TC) UPDOWN mode with automatic trigger on RC Compare +-AT91C_TC_CPCTRG EQU (0x1:SHL:14) ;- (TC) RC Compare Trigger Enable +-AT91C_TC_WAVE EQU (0x1:SHL:15) ;- (TC) +-AT91C_TC_ACPA EQU (0x3:SHL:16) ;- (TC) RA Compare Effect on TIOA +-AT91C_TC_ACPA_NONE EQU (0x0:SHL:16) ;- (TC) Effect: none +-AT91C_TC_ACPA_SET EQU (0x1:SHL:16) ;- (TC) Effect: set +-AT91C_TC_ACPA_CLEAR EQU (0x2:SHL:16) ;- (TC) Effect: clear +-AT91C_TC_ACPA_TOGGLE EQU (0x3:SHL:16) ;- (TC) Effect: toggle +-AT91C_TC_LDRA EQU (0x3:SHL:16) ;- (TC) RA Loading Selection +-AT91C_TC_LDRA_NONE EQU (0x0:SHL:16) ;- (TC) Edge: None +-AT91C_TC_LDRA_RISING EQU (0x1:SHL:16) ;- (TC) Edge: rising edge of TIOA +-AT91C_TC_LDRA_FALLING EQU (0x2:SHL:16) ;- (TC) Edge: falling edge of TIOA +-AT91C_TC_LDRA_BOTH EQU (0x3:SHL:16) ;- (TC) Edge: each edge of TIOA +-AT91C_TC_ACPC EQU (0x3:SHL:18) ;- (TC) RC Compare Effect on TIOA +-AT91C_TC_ACPC_NONE EQU (0x0:SHL:18) ;- (TC) Effect: none +-AT91C_TC_ACPC_SET EQU (0x1:SHL:18) ;- (TC) Effect: set +-AT91C_TC_ACPC_CLEAR EQU (0x2:SHL:18) ;- (TC) Effect: clear +-AT91C_TC_ACPC_TOGGLE EQU (0x3:SHL:18) ;- (TC) Effect: toggle +-AT91C_TC_LDRB EQU (0x3:SHL:18) ;- (TC) RB Loading Selection +-AT91C_TC_LDRB_NONE EQU (0x0:SHL:18) ;- (TC) Edge: None +-AT91C_TC_LDRB_RISING EQU (0x1:SHL:18) ;- (TC) Edge: rising edge of TIOA +-AT91C_TC_LDRB_FALLING EQU (0x2:SHL:18) ;- (TC) Edge: falling edge of TIOA +-AT91C_TC_LDRB_BOTH EQU (0x3:SHL:18) ;- (TC) Edge: each edge of TIOA +-AT91C_TC_AEEVT EQU (0x3:SHL:20) ;- (TC) External Event Effect on TIOA +-AT91C_TC_AEEVT_NONE EQU (0x0:SHL:20) ;- (TC) Effect: none +-AT91C_TC_AEEVT_SET EQU (0x1:SHL:20) ;- (TC) Effect: set +-AT91C_TC_AEEVT_CLEAR EQU (0x2:SHL:20) ;- (TC) Effect: clear +-AT91C_TC_AEEVT_TOGGLE EQU (0x3:SHL:20) ;- (TC) Effect: toggle +-AT91C_TC_ASWTRG EQU (0x3:SHL:22) ;- (TC) Software Trigger Effect on TIOA +-AT91C_TC_ASWTRG_NONE EQU (0x0:SHL:22) ;- (TC) Effect: none +-AT91C_TC_ASWTRG_SET EQU (0x1:SHL:22) ;- (TC) Effect: set +-AT91C_TC_ASWTRG_CLEAR EQU (0x2:SHL:22) ;- (TC) Effect: clear +-AT91C_TC_ASWTRG_TOGGLE EQU (0x3:SHL:22) ;- (TC) Effect: toggle +-AT91C_TC_BCPB EQU (0x3:SHL:24) ;- (TC) RB Compare Effect on TIOB +-AT91C_TC_BCPB_NONE EQU (0x0:SHL:24) ;- (TC) Effect: none +-AT91C_TC_BCPB_SET EQU (0x1:SHL:24) ;- (TC) Effect: set +-AT91C_TC_BCPB_CLEAR EQU (0x2:SHL:24) ;- (TC) Effect: clear +-AT91C_TC_BCPB_TOGGLE EQU (0x3:SHL:24) ;- (TC) Effect: toggle +-AT91C_TC_BCPC EQU (0x3:SHL:26) ;- (TC) RC Compare Effect on TIOB +-AT91C_TC_BCPC_NONE EQU (0x0:SHL:26) ;- (TC) Effect: none +-AT91C_TC_BCPC_SET EQU (0x1:SHL:26) ;- (TC) Effect: set +-AT91C_TC_BCPC_CLEAR EQU (0x2:SHL:26) ;- (TC) Effect: clear +-AT91C_TC_BCPC_TOGGLE EQU (0x3:SHL:26) ;- (TC) Effect: toggle +-AT91C_TC_BEEVT EQU (0x3:SHL:28) ;- (TC) External Event Effect on TIOB +-AT91C_TC_BEEVT_NONE EQU (0x0:SHL:28) ;- (TC) Effect: none +-AT91C_TC_BEEVT_SET EQU (0x1:SHL:28) ;- (TC) Effect: set +-AT91C_TC_BEEVT_CLEAR EQU (0x2:SHL:28) ;- (TC) Effect: clear +-AT91C_TC_BEEVT_TOGGLE EQU (0x3:SHL:28) ;- (TC) Effect: toggle +-AT91C_TC_BSWTRG EQU (0x3:SHL:30) ;- (TC) Software Trigger Effect on TIOB +-AT91C_TC_BSWTRG_NONE EQU (0x0:SHL:30) ;- (TC) Effect: none +-AT91C_TC_BSWTRG_SET EQU (0x1:SHL:30) ;- (TC) Effect: set +-AT91C_TC_BSWTRG_CLEAR EQU (0x2:SHL:30) ;- (TC) Effect: clear +-AT91C_TC_BSWTRG_TOGGLE EQU (0x3:SHL:30) ;- (TC) Effect: toggle +-;- -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- +-AT91C_TC_COVFS EQU (0x1:SHL:0) ;- (TC) Counter Overflow +-AT91C_TC_LOVRS EQU (0x1:SHL:1) ;- (TC) Load Overrun +-AT91C_TC_CPAS EQU (0x1:SHL:2) ;- (TC) RA Compare +-AT91C_TC_CPBS EQU (0x1:SHL:3) ;- (TC) RB Compare +-AT91C_TC_CPCS EQU (0x1:SHL:4) ;- (TC) RC Compare +-AT91C_TC_LDRAS EQU (0x1:SHL:5) ;- (TC) RA Loading +-AT91C_TC_LDRBS EQU (0x1:SHL:6) ;- (TC) RB Loading +-AT91C_TC_ETRGS EQU (0x1:SHL:7) ;- (TC) External Trigger +-AT91C_TC_CLKSTA EQU (0x1:SHL:16) ;- (TC) Clock Enabling +-AT91C_TC_MTIOA EQU (0x1:SHL:17) ;- (TC) TIOA Mirror +-AT91C_TC_MTIOB EQU (0x1:SHL:18) ;- (TC) TIOA Mirror +-;- -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- +-;- -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- +-;- -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Timer Counter Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_TCB +-TCB_TC0 # 48 ;- TC Channel 0 +- # 16 ;- Reserved +-TCB_TC1 # 48 ;- TC Channel 1 +- # 16 ;- Reserved +-TCB_TC2 # 48 ;- TC Channel 2 +- # 16 ;- Reserved +-TCB_BCR # 4 ;- TC Block Control Register +-TCB_BMR # 4 ;- TC Block Mode Register +-;- -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- +-AT91C_TCB_SYNC EQU (0x1:SHL:0) ;- (TCB) Synchro Command +-;- -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- +-AT91C_TCB_TC0XC0S EQU (0x3:SHL:0) ;- (TCB) External Clock Signal 0 Selection +-AT91C_TCB_TC0XC0S_TCLK0 EQU (0x0) ;- (TCB) TCLK0 connected to XC0 +-AT91C_TCB_TC0XC0S_NONE EQU (0x1) ;- (TCB) None signal connected to XC0 +-AT91C_TCB_TC0XC0S_TIOA1 EQU (0x2) ;- (TCB) TIOA1 connected to XC0 +-AT91C_TCB_TC0XC0S_TIOA2 EQU (0x3) ;- (TCB) TIOA2 connected to XC0 +-AT91C_TCB_TC1XC1S EQU (0x3:SHL:2) ;- (TCB) External Clock Signal 1 Selection +-AT91C_TCB_TC1XC1S_TCLK1 EQU (0x0:SHL:2) ;- (TCB) TCLK1 connected to XC1 +-AT91C_TCB_TC1XC1S_NONE EQU (0x1:SHL:2) ;- (TCB) None signal connected to XC1 +-AT91C_TCB_TC1XC1S_TIOA0 EQU (0x2:SHL:2) ;- (TCB) TIOA0 connected to XC1 +-AT91C_TCB_TC1XC1S_TIOA2 EQU (0x3:SHL:2) ;- (TCB) TIOA2 connected to XC1 +-AT91C_TCB_TC2XC2S EQU (0x3:SHL:4) ;- (TCB) External Clock Signal 2 Selection +-AT91C_TCB_TC2XC2S_TCLK2 EQU (0x0:SHL:4) ;- (TCB) TCLK2 connected to XC2 +-AT91C_TCB_TC2XC2S_NONE EQU (0x1:SHL:4) ;- (TCB) None signal connected to XC2 +-AT91C_TCB_TC2XC2S_TIOA0 EQU (0x2:SHL:4) ;- (TCB) TIOA0 connected to XC2 +-AT91C_TCB_TC2XC2S_TIOA1 EQU (0x3:SHL:4) ;- (TCB) TIOA2 connected to XC2 +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_CAN_MB +-CAN_MB_MMR # 4 ;- MailBox Mode Register +-CAN_MB_MAM # 4 ;- MailBox Acceptance Mask Register +-CAN_MB_MID # 4 ;- MailBox ID Register +-CAN_MB_MFID # 4 ;- MailBox Family ID Register +-CAN_MB_MSR # 4 ;- MailBox Status Register +-CAN_MB_MDL # 4 ;- MailBox Data Low Register +-CAN_MB_MDH # 4 ;- MailBox Data High Register +-CAN_MB_MCR # 4 ;- MailBox Control Register +-;- -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- +-AT91C_CAN_MTIMEMARK EQU (0xFFFF:SHL:0) ;- (CAN_MB) Mailbox Timemark +-AT91C_CAN_PRIOR EQU (0xF:SHL:16) ;- (CAN_MB) Mailbox Priority +-AT91C_CAN_MOT EQU (0x7:SHL:24) ;- (CAN_MB) Mailbox Object Type +-AT91C_CAN_MOT_DIS EQU (0x0:SHL:24) ;- (CAN_MB) +-AT91C_CAN_MOT_RX EQU (0x1:SHL:24) ;- (CAN_MB) +-AT91C_CAN_MOT_RXOVERWRITE EQU (0x2:SHL:24) ;- (CAN_MB) +-AT91C_CAN_MOT_TX EQU (0x3:SHL:24) ;- (CAN_MB) +-AT91C_CAN_MOT_CONSUMER EQU (0x4:SHL:24) ;- (CAN_MB) +-AT91C_CAN_MOT_PRODUCER EQU (0x5:SHL:24) ;- (CAN_MB) +-;- -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- +-AT91C_CAN_MIDvB EQU (0x3FFFF:SHL:0) ;- (CAN_MB) Complementary bits for identifier in extended mode +-AT91C_CAN_MIDvA EQU (0x7FF:SHL:18) ;- (CAN_MB) Identifier for standard frame mode +-AT91C_CAN_MIDE EQU (0x1:SHL:29) ;- (CAN_MB) Identifier Version +-;- -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- +-;- -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- +-;- -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- +-AT91C_CAN_MTIMESTAMP EQU (0xFFFF:SHL:0) ;- (CAN_MB) Timer Value +-AT91C_CAN_MDLC EQU (0xF:SHL:16) ;- (CAN_MB) Mailbox Data Length Code +-AT91C_CAN_MRTR EQU (0x1:SHL:20) ;- (CAN_MB) Mailbox Remote Transmission Request +-AT91C_CAN_MABT EQU (0x1:SHL:22) ;- (CAN_MB) Mailbox Message Abort +-AT91C_CAN_MRDY EQU (0x1:SHL:23) ;- (CAN_MB) Mailbox Ready +-AT91C_CAN_MMI EQU (0x1:SHL:24) ;- (CAN_MB) Mailbox Message Ignored +-;- -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- +-;- -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- +-;- -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- +-AT91C_CAN_MACR EQU (0x1:SHL:22) ;- (CAN_MB) Abort Request for Mailbox +-AT91C_CAN_MTCR EQU (0x1:SHL:23) ;- (CAN_MB) Mailbox Transfer Command +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Control Area Network Interface +-;- ***************************************************************************** +- ^ 0 ;- AT91S_CAN +-CAN_MR # 4 ;- Mode Register +-CAN_IER # 4 ;- Interrupt Enable Register +-CAN_IDR # 4 ;- Interrupt Disable Register +-CAN_IMR # 4 ;- Interrupt Mask Register +-CAN_SR # 4 ;- Status Register +-CAN_BR # 4 ;- Baudrate Register +-CAN_TIM # 4 ;- Timer Register +-CAN_TIMESTP # 4 ;- Time Stamp Register +-CAN_ECR # 4 ;- Error Counter Register +-CAN_TCR # 4 ;- Transfer Command Register +-CAN_ACR # 4 ;- Abort Command Register +- # 208 ;- Reserved +-CAN_VR # 4 ;- Version Register +- # 256 ;- Reserved +-CAN_MB0 # 32 ;- CAN Mailbox 0 +-CAN_MB1 # 32 ;- CAN Mailbox 1 +-CAN_MB2 # 32 ;- CAN Mailbox 2 +-CAN_MB3 # 32 ;- CAN Mailbox 3 +-CAN_MB4 # 32 ;- CAN Mailbox 4 +-CAN_MB5 # 32 ;- CAN Mailbox 5 +-CAN_MB6 # 32 ;- CAN Mailbox 6 +-CAN_MB7 # 32 ;- CAN Mailbox 7 +-CAN_MB8 # 32 ;- CAN Mailbox 8 +-CAN_MB9 # 32 ;- CAN Mailbox 9 +-CAN_MB10 # 32 ;- CAN Mailbox 10 +-CAN_MB11 # 32 ;- CAN Mailbox 11 +-CAN_MB12 # 32 ;- CAN Mailbox 12 +-CAN_MB13 # 32 ;- CAN Mailbox 13 +-CAN_MB14 # 32 ;- CAN Mailbox 14 +-CAN_MB15 # 32 ;- CAN Mailbox 15 +-;- -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- +-AT91C_CAN_CANEN EQU (0x1:SHL:0) ;- (CAN) CAN Controller Enable +-AT91C_CAN_LPM EQU (0x1:SHL:1) ;- (CAN) Disable/Enable Low Power Mode +-AT91C_CAN_ABM EQU (0x1:SHL:2) ;- (CAN) Disable/Enable Autobaud/Listen Mode +-AT91C_CAN_OVL EQU (0x1:SHL:3) ;- (CAN) Disable/Enable Overload Frame +-AT91C_CAN_TEOF EQU (0x1:SHL:4) ;- (CAN) Time Stamp messages at each end of Frame +-AT91C_CAN_TTM EQU (0x1:SHL:5) ;- (CAN) Disable/Enable Time Trigger Mode +-AT91C_CAN_TIMFRZ EQU (0x1:SHL:6) ;- (CAN) Enable Timer Freeze +-AT91C_CAN_DRPT EQU (0x1:SHL:7) ;- (CAN) Disable Repeat +-;- -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- +-AT91C_CAN_MB0 EQU (0x1:SHL:0) ;- (CAN) Mailbox 0 Flag +-AT91C_CAN_MB1 EQU (0x1:SHL:1) ;- (CAN) Mailbox 1 Flag +-AT91C_CAN_MB2 EQU (0x1:SHL:2) ;- (CAN) Mailbox 2 Flag +-AT91C_CAN_MB3 EQU (0x1:SHL:3) ;- (CAN) Mailbox 3 Flag +-AT91C_CAN_MB4 EQU (0x1:SHL:4) ;- (CAN) Mailbox 4 Flag +-AT91C_CAN_MB5 EQU (0x1:SHL:5) ;- (CAN) Mailbox 5 Flag +-AT91C_CAN_MB6 EQU (0x1:SHL:6) ;- (CAN) Mailbox 6 Flag +-AT91C_CAN_MB7 EQU (0x1:SHL:7) ;- (CAN) Mailbox 7 Flag +-AT91C_CAN_MB8 EQU (0x1:SHL:8) ;- (CAN) Mailbox 8 Flag +-AT91C_CAN_MB9 EQU (0x1:SHL:9) ;- (CAN) Mailbox 9 Flag +-AT91C_CAN_MB10 EQU (0x1:SHL:10) ;- (CAN) Mailbox 10 Flag +-AT91C_CAN_MB11 EQU (0x1:SHL:11) ;- (CAN) Mailbox 11 Flag +-AT91C_CAN_MB12 EQU (0x1:SHL:12) ;- (CAN) Mailbox 12 Flag +-AT91C_CAN_MB13 EQU (0x1:SHL:13) ;- (CAN) Mailbox 13 Flag +-AT91C_CAN_MB14 EQU (0x1:SHL:14) ;- (CAN) Mailbox 14 Flag +-AT91C_CAN_MB15 EQU (0x1:SHL:15) ;- (CAN) Mailbox 15 Flag +-AT91C_CAN_ERRA EQU (0x1:SHL:16) ;- (CAN) Error Active Mode Flag +-AT91C_CAN_WARN EQU (0x1:SHL:17) ;- (CAN) Warning Limit Flag +-AT91C_CAN_ERRP EQU (0x1:SHL:18) ;- (CAN) Error Passive Mode Flag +-AT91C_CAN_BOFF EQU (0x1:SHL:19) ;- (CAN) Bus Off Mode Flag +-AT91C_CAN_SLEEP EQU (0x1:SHL:20) ;- (CAN) Sleep Flag +-AT91C_CAN_WAKEUP EQU (0x1:SHL:21) ;- (CAN) Wakeup Flag +-AT91C_CAN_TOVF EQU (0x1:SHL:22) ;- (CAN) Timer Overflow Flag +-AT91C_CAN_TSTP EQU (0x1:SHL:23) ;- (CAN) Timestamp Flag +-AT91C_CAN_CERR EQU (0x1:SHL:24) ;- (CAN) CRC Error +-AT91C_CAN_SERR EQU (0x1:SHL:25) ;- (CAN) Stuffing Error +-AT91C_CAN_AERR EQU (0x1:SHL:26) ;- (CAN) Acknowledgment Error +-AT91C_CAN_FERR EQU (0x1:SHL:27) ;- (CAN) Form Error +-AT91C_CAN_BERR EQU (0x1:SHL:28) ;- (CAN) Bit Error +-;- -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- +-;- -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- +-;- -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- +-AT91C_CAN_RBSY EQU (0x1:SHL:29) ;- (CAN) Receiver Busy +-AT91C_CAN_TBSY EQU (0x1:SHL:30) ;- (CAN) Transmitter Busy +-AT91C_CAN_OVLY EQU (0x1:SHL:31) ;- (CAN) Overload Busy +-;- -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- +-AT91C_CAN_PHASE2 EQU (0x7:SHL:0) ;- (CAN) Phase 2 segment +-AT91C_CAN_PHASE1 EQU (0x7:SHL:4) ;- (CAN) Phase 1 segment +-AT91C_CAN_PROPAG EQU (0x7:SHL:8) ;- (CAN) Programmation time segment +-AT91C_CAN_SYNC EQU (0x3:SHL:12) ;- (CAN) Re-synchronization jump width segment +-AT91C_CAN_BRP EQU (0x7F:SHL:16) ;- (CAN) Baudrate Prescaler +-AT91C_CAN_SMP EQU (0x1:SHL:24) ;- (CAN) Sampling mode +-;- -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- +-AT91C_CAN_TIMER EQU (0xFFFF:SHL:0) ;- (CAN) Timer field +-;- -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- +-;- -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- +-AT91C_CAN_REC EQU (0xFF:SHL:0) ;- (CAN) Receive Error Counter +-AT91C_CAN_TEC EQU (0xFF:SHL:16) ;- (CAN) Transmit Error Counter +-;- -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- +-AT91C_CAN_TIMRST EQU (0x1:SHL:31) ;- (CAN) Timer Reset Field +-;- -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 +-;- ***************************************************************************** +- ^ 0 ;- AT91S_EMAC +-EMAC_NCR # 4 ;- Network Control Register +-EMAC_NCFGR # 4 ;- Network Configuration Register +-EMAC_NSR # 4 ;- Network Status Register +- # 8 ;- Reserved +-EMAC_TSR # 4 ;- Transmit Status Register +-EMAC_RBQP # 4 ;- Receive Buffer Queue Pointer +-EMAC_TBQP # 4 ;- Transmit Buffer Queue Pointer +-EMAC_RSR # 4 ;- Receive Status Register +-EMAC_ISR # 4 ;- Interrupt Status Register +-EMAC_IER # 4 ;- Interrupt Enable Register +-EMAC_IDR # 4 ;- Interrupt Disable Register +-EMAC_IMR # 4 ;- Interrupt Mask Register +-EMAC_MAN # 4 ;- PHY Maintenance Register +-EMAC_PTR # 4 ;- Pause Time Register +-EMAC_PFR # 4 ;- Pause Frames received Register +-EMAC_FTO # 4 ;- Frames Transmitted OK Register +-EMAC_SCF # 4 ;- Single Collision Frame Register +-EMAC_MCF # 4 ;- Multiple Collision Frame Register +-EMAC_FRO # 4 ;- Frames Received OK Register +-EMAC_FCSE # 4 ;- Frame Check Sequence Error Register +-EMAC_ALE # 4 ;- Alignment Error Register +-EMAC_DTF # 4 ;- Deferred Transmission Frame Register +-EMAC_LCOL # 4 ;- Late Collision Register +-EMAC_ECOL # 4 ;- Excessive Collision Register +-EMAC_TUND # 4 ;- Transmit Underrun Error Register +-EMAC_CSE # 4 ;- Carrier Sense Error Register +-EMAC_RRE # 4 ;- Receive Ressource Error Register +-EMAC_ROV # 4 ;- Receive Overrun Errors Register +-EMAC_RSE # 4 ;- Receive Symbol Errors Register +-EMAC_ELE # 4 ;- Excessive Length Errors Register +-EMAC_RJA # 4 ;- Receive Jabbers Register +-EMAC_USF # 4 ;- Undersize Frames Register +-EMAC_STE # 4 ;- SQE Test Error Register +-EMAC_RLE # 4 ;- Receive Length Field Mismatch Register +-EMAC_TPF # 4 ;- Transmitted Pause Frames Register +-EMAC_HRB # 4 ;- Hash Address Bottom[31:0] +-EMAC_HRT # 4 ;- Hash Address Top[63:32] +-EMAC_SA1L # 4 ;- Specific Address 1 Bottom, First 4 bytes +-EMAC_SA1H # 4 ;- Specific Address 1 Top, Last 2 bytes +-EMAC_SA2L # 4 ;- Specific Address 2 Bottom, First 4 bytes +-EMAC_SA2H # 4 ;- Specific Address 2 Top, Last 2 bytes +-EMAC_SA3L # 4 ;- Specific Address 3 Bottom, First 4 bytes +-EMAC_SA3H # 4 ;- Specific Address 3 Top, Last 2 bytes +-EMAC_SA4L # 4 ;- Specific Address 4 Bottom, First 4 bytes +-EMAC_SA4H # 4 ;- Specific Address 4 Top, Last 2 bytes +-EMAC_TID # 4 ;- Type ID Checking Register +-EMAC_TPQ # 4 ;- Transmit Pause Quantum Register +-EMAC_USRIO # 4 ;- USER Input/Output Register +-EMAC_WOL # 4 ;- Wake On LAN Register +- # 52 ;- Reserved +-EMAC_REV # 4 ;- Revision Register +-;- -------- EMAC_NCR : (EMAC Offset: 0x0) -------- +-AT91C_EMAC_LB EQU (0x1:SHL:0) ;- (EMAC) Loopback. Optional. When set, loopback signal is at high level. +-AT91C_EMAC_LLB EQU (0x1:SHL:1) ;- (EMAC) Loopback local. +-AT91C_EMAC_RE EQU (0x1:SHL:2) ;- (EMAC) Receive enable. +-AT91C_EMAC_TE EQU (0x1:SHL:3) ;- (EMAC) Transmit enable. +-AT91C_EMAC_MPE EQU (0x1:SHL:4) ;- (EMAC) Management port enable. +-AT91C_EMAC_CLRSTAT EQU (0x1:SHL:5) ;- (EMAC) Clear statistics registers. +-AT91C_EMAC_INCSTAT EQU (0x1:SHL:6) ;- (EMAC) Increment statistics registers. +-AT91C_EMAC_WESTAT EQU (0x1:SHL:7) ;- (EMAC) Write enable for statistics registers. +-AT91C_EMAC_BP EQU (0x1:SHL:8) ;- (EMAC) Back pressure. +-AT91C_EMAC_TSTART EQU (0x1:SHL:9) ;- (EMAC) Start Transmission. +-AT91C_EMAC_THALT EQU (0x1:SHL:10) ;- (EMAC) Transmission Halt. +-AT91C_EMAC_TPFR EQU (0x1:SHL:11) ;- (EMAC) Transmit pause frame +-AT91C_EMAC_TZQ EQU (0x1:SHL:12) ;- (EMAC) Transmit zero quantum pause frame +-;- -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- +-AT91C_EMAC_SPD EQU (0x1:SHL:0) ;- (EMAC) Speed. +-AT91C_EMAC_FD EQU (0x1:SHL:1) ;- (EMAC) Full duplex. +-AT91C_EMAC_JFRAME EQU (0x1:SHL:3) ;- (EMAC) Jumbo Frames. +-AT91C_EMAC_CAF EQU (0x1:SHL:4) ;- (EMAC) Copy all frames. +-AT91C_EMAC_NBC EQU (0x1:SHL:5) ;- (EMAC) No broadcast. +-AT91C_EMAC_MTI EQU (0x1:SHL:6) ;- (EMAC) Multicast hash event enable +-AT91C_EMAC_UNI EQU (0x1:SHL:7) ;- (EMAC) Unicast hash enable. +-AT91C_EMAC_BIG EQU (0x1:SHL:8) ;- (EMAC) Receive 1522 bytes. +-AT91C_EMAC_EAE EQU (0x1:SHL:9) ;- (EMAC) External address match enable. +-AT91C_EMAC_CLK EQU (0x3:SHL:10) ;- (EMAC) +-AT91C_EMAC_CLK_HCLK_8 EQU (0x0:SHL:10) ;- (EMAC) HCLK divided by 8 +-AT91C_EMAC_CLK_HCLK_16 EQU (0x1:SHL:10) ;- (EMAC) HCLK divided by 16 +-AT91C_EMAC_CLK_HCLK_32 EQU (0x2:SHL:10) ;- (EMAC) HCLK divided by 32 +-AT91C_EMAC_CLK_HCLK_64 EQU (0x3:SHL:10) ;- (EMAC) HCLK divided by 64 +-AT91C_EMAC_RTY EQU (0x1:SHL:12) ;- (EMAC) +-AT91C_EMAC_PAE EQU (0x1:SHL:13) ;- (EMAC) +-AT91C_EMAC_RBOF EQU (0x3:SHL:14) ;- (EMAC) +-AT91C_EMAC_RBOF_OFFSET_0 EQU (0x0:SHL:14) ;- (EMAC) no offset from start of receive buffer +-AT91C_EMAC_RBOF_OFFSET_1 EQU (0x1:SHL:14) ;- (EMAC) one byte offset from start of receive buffer +-AT91C_EMAC_RBOF_OFFSET_2 EQU (0x2:SHL:14) ;- (EMAC) two bytes offset from start of receive buffer +-AT91C_EMAC_RBOF_OFFSET_3 EQU (0x3:SHL:14) ;- (EMAC) three bytes offset from start of receive buffer +-AT91C_EMAC_RLCE EQU (0x1:SHL:16) ;- (EMAC) Receive Length field Checking Enable +-AT91C_EMAC_DRFCS EQU (0x1:SHL:17) ;- (EMAC) Discard Receive FCS +-AT91C_EMAC_EFRHD EQU (0x1:SHL:18) ;- (EMAC) +-AT91C_EMAC_IRXFCS EQU (0x1:SHL:19) ;- (EMAC) Ignore RX FCS +-;- -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- +-AT91C_EMAC_LINKR EQU (0x1:SHL:0) ;- (EMAC) +-AT91C_EMAC_MDIO EQU (0x1:SHL:1) ;- (EMAC) +-AT91C_EMAC_IDLE EQU (0x1:SHL:2) ;- (EMAC) +-;- -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- +-AT91C_EMAC_UBR EQU (0x1:SHL:0) ;- (EMAC) +-AT91C_EMAC_COL EQU (0x1:SHL:1) ;- (EMAC) +-AT91C_EMAC_RLES EQU (0x1:SHL:2) ;- (EMAC) +-AT91C_EMAC_TGO EQU (0x1:SHL:3) ;- (EMAC) Transmit Go +-AT91C_EMAC_BEX EQU (0x1:SHL:4) ;- (EMAC) Buffers exhausted mid frame +-AT91C_EMAC_COMP EQU (0x1:SHL:5) ;- (EMAC) +-AT91C_EMAC_UND EQU (0x1:SHL:6) ;- (EMAC) +-;- -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- +-AT91C_EMAC_BNA EQU (0x1:SHL:0) ;- (EMAC) +-AT91C_EMAC_REC EQU (0x1:SHL:1) ;- (EMAC) +-AT91C_EMAC_OVR EQU (0x1:SHL:2) ;- (EMAC) +-;- -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- +-AT91C_EMAC_MFD EQU (0x1:SHL:0) ;- (EMAC) +-AT91C_EMAC_RCOMP EQU (0x1:SHL:1) ;- (EMAC) +-AT91C_EMAC_RXUBR EQU (0x1:SHL:2) ;- (EMAC) +-AT91C_EMAC_TXUBR EQU (0x1:SHL:3) ;- (EMAC) +-AT91C_EMAC_TUNDR EQU (0x1:SHL:4) ;- (EMAC) +-AT91C_EMAC_RLEX EQU (0x1:SHL:5) ;- (EMAC) +-AT91C_EMAC_TXERR EQU (0x1:SHL:6) ;- (EMAC) +-AT91C_EMAC_TCOMP EQU (0x1:SHL:7) ;- (EMAC) +-AT91C_EMAC_LINK EQU (0x1:SHL:9) ;- (EMAC) +-AT91C_EMAC_ROVR EQU (0x1:SHL:10) ;- (EMAC) +-AT91C_EMAC_HRESP EQU (0x1:SHL:11) ;- (EMAC) +-AT91C_EMAC_PFRE EQU (0x1:SHL:12) ;- (EMAC) +-AT91C_EMAC_PTZ EQU (0x1:SHL:13) ;- (EMAC) +-;- -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- +-;- -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- +-;- -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- +-;- -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- +-AT91C_EMAC_DATA EQU (0xFFFF:SHL:0) ;- (EMAC) +-AT91C_EMAC_CODE EQU (0x3:SHL:16) ;- (EMAC) +-AT91C_EMAC_REGA EQU (0x1F:SHL:18) ;- (EMAC) +-AT91C_EMAC_PHYA EQU (0x1F:SHL:23) ;- (EMAC) +-AT91C_EMAC_RW EQU (0x3:SHL:28) ;- (EMAC) +-AT91C_EMAC_SOF EQU (0x3:SHL:30) ;- (EMAC) +-;- -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- +-AT91C_EMAC_RMII EQU (0x1:SHL:0) ;- (EMAC) Reduce MII +-AT91C_EMAC_CLKEN EQU (0x1:SHL:1) ;- (EMAC) Clock Enable +-;- -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- +-AT91C_EMAC_IP EQU (0xFFFF:SHL:0) ;- (EMAC) ARP request IP address +-AT91C_EMAC_MAG EQU (0x1:SHL:16) ;- (EMAC) Magic packet event enable +-AT91C_EMAC_ARP EQU (0x1:SHL:17) ;- (EMAC) ARP request event enable +-AT91C_EMAC_SA1 EQU (0x1:SHL:18) ;- (EMAC) Specific address register 1 event enable +-;- -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- +-AT91C_EMAC_REVREF EQU (0xFFFF:SHL:0) ;- (EMAC) +-AT91C_EMAC_PARTREF EQU (0xFFFF:SHL:16) ;- (EMAC) +- +-;- ***************************************************************************** +-;- SOFTWARE API DEFINITION FOR Analog to Digital Convertor +-;- ***************************************************************************** +- ^ 0 ;- AT91S_ADC +-ADC_CR # 4 ;- ADC Control Register +-ADC_MR # 4 ;- ADC Mode Register +- # 8 ;- Reserved +-ADC_CHER # 4 ;- ADC Channel Enable Register +-ADC_CHDR # 4 ;- ADC Channel Disable Register +-ADC_CHSR # 4 ;- ADC Channel Status Register +-ADC_SR # 4 ;- ADC Status Register +-ADC_LCDR # 4 ;- ADC Last Converted Data Register +-ADC_IER # 4 ;- ADC Interrupt Enable Register +-ADC_IDR # 4 ;- ADC Interrupt Disable Register +-ADC_IMR # 4 ;- ADC Interrupt Mask Register +-ADC_CDR0 # 4 ;- ADC Channel Data Register 0 +-ADC_CDR1 # 4 ;- ADC Channel Data Register 1 +-ADC_CDR2 # 4 ;- ADC Channel Data Register 2 +-ADC_CDR3 # 4 ;- ADC Channel Data Register 3 +-ADC_CDR4 # 4 ;- ADC Channel Data Register 4 +-ADC_CDR5 # 4 ;- ADC Channel Data Register 5 +-ADC_CDR6 # 4 ;- ADC Channel Data Register 6 +-ADC_CDR7 # 4 ;- ADC Channel Data Register 7 +- # 176 ;- Reserved +-ADC_RPR # 4 ;- Receive Pointer Register +-ADC_RCR # 4 ;- Receive Counter Register +-ADC_TPR # 4 ;- Transmit Pointer Register +-ADC_TCR # 4 ;- Transmit Counter Register +-ADC_RNPR # 4 ;- Receive Next Pointer Register +-ADC_RNCR # 4 ;- Receive Next Counter Register +-ADC_TNPR # 4 ;- Transmit Next Pointer Register +-ADC_TNCR # 4 ;- Transmit Next Counter Register +-ADC_PTCR # 4 ;- PDC Transfer Control Register +-ADC_PTSR # 4 ;- PDC Transfer Status Register +-;- -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- +-AT91C_ADC_SWRST EQU (0x1:SHL:0) ;- (ADC) Software Reset +-AT91C_ADC_START EQU (0x1:SHL:1) ;- (ADC) Start Conversion +-;- -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- +-AT91C_ADC_TRGEN EQU (0x1:SHL:0) ;- (ADC) Trigger Enable +-AT91C_ADC_TRGEN_DIS EQU (0x0) ;- (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software +-AT91C_ADC_TRGEN_EN EQU (0x1) ;- (ADC) Hardware trigger selected by TRGSEL field is enabled. +-AT91C_ADC_TRGSEL EQU (0x7:SHL:1) ;- (ADC) Trigger Selection +-AT91C_ADC_TRGSEL_TIOA0 EQU (0x0:SHL:1) ;- (ADC) Selected TRGSEL = TIAO0 +-AT91C_ADC_TRGSEL_TIOA1 EQU (0x1:SHL:1) ;- (ADC) Selected TRGSEL = TIAO1 +-AT91C_ADC_TRGSEL_TIOA2 EQU (0x2:SHL:1) ;- (ADC) Selected TRGSEL = TIAO2 +-AT91C_ADC_TRGSEL_TIOA3 EQU (0x3:SHL:1) ;- (ADC) Selected TRGSEL = TIAO3 +-AT91C_ADC_TRGSEL_TIOA4 EQU (0x4:SHL:1) ;- (ADC) Selected TRGSEL = TIAO4 +-AT91C_ADC_TRGSEL_TIOA5 EQU (0x5:SHL:1) ;- (ADC) Selected TRGSEL = TIAO5 +-AT91C_ADC_TRGSEL_EXT EQU (0x6:SHL:1) ;- (ADC) Selected TRGSEL = External Trigger +-AT91C_ADC_LOWRES EQU (0x1:SHL:4) ;- (ADC) Resolution. +-AT91C_ADC_LOWRES_10_BIT EQU (0x0:SHL:4) ;- (ADC) 10-bit resolution +-AT91C_ADC_LOWRES_8_BIT EQU (0x1:SHL:4) ;- (ADC) 8-bit resolution +-AT91C_ADC_SLEEP EQU (0x1:SHL:5) ;- (ADC) Sleep Mode +-AT91C_ADC_SLEEP_NORMAL_MODE EQU (0x0:SHL:5) ;- (ADC) Normal Mode +-AT91C_ADC_SLEEP_MODE EQU (0x1:SHL:5) ;- (ADC) Sleep Mode +-AT91C_ADC_PRESCAL EQU (0x3F:SHL:8) ;- (ADC) Prescaler rate selection +-AT91C_ADC_STARTUP EQU (0x1F:SHL:16) ;- (ADC) Startup Time +-AT91C_ADC_SHTIM EQU (0xF:SHL:24) ;- (ADC) Sample & Hold Time +-;- -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- +-AT91C_ADC_CH0 EQU (0x1:SHL:0) ;- (ADC) Channel 0 +-AT91C_ADC_CH1 EQU (0x1:SHL:1) ;- (ADC) Channel 1 +-AT91C_ADC_CH2 EQU (0x1:SHL:2) ;- (ADC) Channel 2 +-AT91C_ADC_CH3 EQU (0x1:SHL:3) ;- (ADC) Channel 3 +-AT91C_ADC_CH4 EQU (0x1:SHL:4) ;- (ADC) Channel 4 +-AT91C_ADC_CH5 EQU (0x1:SHL:5) ;- (ADC) Channel 5 +-AT91C_ADC_CH6 EQU (0x1:SHL:6) ;- (ADC) Channel 6 +-AT91C_ADC_CH7 EQU (0x1:SHL:7) ;- (ADC) Channel 7 +-;- -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- +-;- -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- +-;- -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- +-AT91C_ADC_EOC0 EQU (0x1:SHL:0) ;- (ADC) End of Conversion +-AT91C_ADC_EOC1 EQU (0x1:SHL:1) ;- (ADC) End of Conversion +-AT91C_ADC_EOC2 EQU (0x1:SHL:2) ;- (ADC) End of Conversion +-AT91C_ADC_EOC3 EQU (0x1:SHL:3) ;- (ADC) End of Conversion +-AT91C_ADC_EOC4 EQU (0x1:SHL:4) ;- (ADC) End of Conversion +-AT91C_ADC_EOC5 EQU (0x1:SHL:5) ;- (ADC) End of Conversion +-AT91C_ADC_EOC6 EQU (0x1:SHL:6) ;- (ADC) End of Conversion +-AT91C_ADC_EOC7 EQU (0x1:SHL:7) ;- (ADC) End of Conversion +-AT91C_ADC_OVRE0 EQU (0x1:SHL:8) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE1 EQU (0x1:SHL:9) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE2 EQU (0x1:SHL:10) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE3 EQU (0x1:SHL:11) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE4 EQU (0x1:SHL:12) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE5 EQU (0x1:SHL:13) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE6 EQU (0x1:SHL:14) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE7 EQU (0x1:SHL:15) ;- (ADC) Overrun Error +-AT91C_ADC_DRDY EQU (0x1:SHL:16) ;- (ADC) Data Ready +-AT91C_ADC_GOVRE EQU (0x1:SHL:17) ;- (ADC) General Overrun +-AT91C_ADC_ENDRX EQU (0x1:SHL:18) ;- (ADC) End of Receiver Transfer +-AT91C_ADC_RXBUFF EQU (0x1:SHL:19) ;- (ADC) RXBUFF Interrupt +-;- -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- +-AT91C_ADC_LDATA EQU (0x3FF:SHL:0) ;- (ADC) Last Data Converted +-;- -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- +-;- -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- +-;- -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- +-;- -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- +-AT91C_ADC_DATA EQU (0x3FF:SHL:0) ;- (ADC) Converted Data +-;- -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- +-;- -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- +-;- -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- +-;- -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- +-;- -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- +-;- -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- +-;- -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- +- +-;- ***************************************************************************** +-;- REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 +-;- ***************************************************************************** +-;- ========== Register definition for SYS peripheral ========== +-;- ========== Register definition for AIC peripheral ========== +-AT91C_AIC_IVR EQU (0xFFFFF100) ;- (AIC) IRQ Vector Register +-AT91C_AIC_SMR EQU (0xFFFFF000) ;- (AIC) Source Mode Register +-AT91C_AIC_FVR EQU (0xFFFFF104) ;- (AIC) FIQ Vector Register +-AT91C_AIC_DCR EQU (0xFFFFF138) ;- (AIC) Debug Control Register (Protect) +-AT91C_AIC_EOICR EQU (0xFFFFF130) ;- (AIC) End of Interrupt Command Register +-AT91C_AIC_SVR EQU (0xFFFFF080) ;- (AIC) Source Vector Register +-AT91C_AIC_FFSR EQU (0xFFFFF148) ;- (AIC) Fast Forcing Status Register +-AT91C_AIC_ICCR EQU (0xFFFFF128) ;- (AIC) Interrupt Clear Command Register +-AT91C_AIC_ISR EQU (0xFFFFF108) ;- (AIC) Interrupt Status Register +-AT91C_AIC_IMR EQU (0xFFFFF110) ;- (AIC) Interrupt Mask Register +-AT91C_AIC_IPR EQU (0xFFFFF10C) ;- (AIC) Interrupt Pending Register +-AT91C_AIC_FFER EQU (0xFFFFF140) ;- (AIC) Fast Forcing Enable Register +-AT91C_AIC_IECR EQU (0xFFFFF120) ;- (AIC) Interrupt Enable Command Register +-AT91C_AIC_ISCR EQU (0xFFFFF12C) ;- (AIC) Interrupt Set Command Register +-AT91C_AIC_FFDR EQU (0xFFFFF144) ;- (AIC) Fast Forcing Disable Register +-AT91C_AIC_CISR EQU (0xFFFFF114) ;- (AIC) Core Interrupt Status Register +-AT91C_AIC_IDCR EQU (0xFFFFF124) ;- (AIC) Interrupt Disable Command Register +-AT91C_AIC_SPU EQU (0xFFFFF134) ;- (AIC) Spurious Vector Register +-;- ========== Register definition for PDC_DBGU peripheral ========== +-AT91C_DBGU_TCR EQU (0xFFFFF30C) ;- (PDC_DBGU) Transmit Counter Register +-AT91C_DBGU_RNPR EQU (0xFFFFF310) ;- (PDC_DBGU) Receive Next Pointer Register +-AT91C_DBGU_TNPR EQU (0xFFFFF318) ;- (PDC_DBGU) Transmit Next Pointer Register +-AT91C_DBGU_TPR EQU (0xFFFFF308) ;- (PDC_DBGU) Transmit Pointer Register +-AT91C_DBGU_RPR EQU (0xFFFFF300) ;- (PDC_DBGU) Receive Pointer Register +-AT91C_DBGU_RCR EQU (0xFFFFF304) ;- (PDC_DBGU) Receive Counter Register +-AT91C_DBGU_RNCR EQU (0xFFFFF314) ;- (PDC_DBGU) Receive Next Counter Register +-AT91C_DBGU_PTCR EQU (0xFFFFF320) ;- (PDC_DBGU) PDC Transfer Control Register +-AT91C_DBGU_PTSR EQU (0xFFFFF324) ;- (PDC_DBGU) PDC Transfer Status Register +-AT91C_DBGU_TNCR EQU (0xFFFFF31C) ;- (PDC_DBGU) Transmit Next Counter Register +-;- ========== Register definition for DBGU peripheral ========== +-AT91C_DBGU_EXID EQU (0xFFFFF244) ;- (DBGU) Chip ID Extension Register +-AT91C_DBGU_BRGR EQU (0xFFFFF220) ;- (DBGU) Baud Rate Generator Register +-AT91C_DBGU_IDR EQU (0xFFFFF20C) ;- (DBGU) Interrupt Disable Register +-AT91C_DBGU_CSR EQU (0xFFFFF214) ;- (DBGU) Channel Status Register +-AT91C_DBGU_CIDR EQU (0xFFFFF240) ;- (DBGU) Chip ID Register +-AT91C_DBGU_MR EQU (0xFFFFF204) ;- (DBGU) Mode Register +-AT91C_DBGU_IMR EQU (0xFFFFF210) ;- (DBGU) Interrupt Mask Register +-AT91C_DBGU_CR EQU (0xFFFFF200) ;- (DBGU) Control Register +-AT91C_DBGU_FNTR EQU (0xFFFFF248) ;- (DBGU) Force NTRST Register +-AT91C_DBGU_THR EQU (0xFFFFF21C) ;- (DBGU) Transmitter Holding Register +-AT91C_DBGU_RHR EQU (0xFFFFF218) ;- (DBGU) Receiver Holding Register +-AT91C_DBGU_IER EQU (0xFFFFF208) ;- (DBGU) Interrupt Enable Register +-;- ========== Register definition for PIOA peripheral ========== +-AT91C_PIOA_ODR EQU (0xFFFFF414) ;- (PIOA) Output Disable Registerr +-AT91C_PIOA_SODR EQU (0xFFFFF430) ;- (PIOA) Set Output Data Register +-AT91C_PIOA_ISR EQU (0xFFFFF44C) ;- (PIOA) Interrupt Status Register +-AT91C_PIOA_ABSR EQU (0xFFFFF478) ;- (PIOA) AB Select Status Register +-AT91C_PIOA_IER EQU (0xFFFFF440) ;- (PIOA) Interrupt Enable Register +-AT91C_PIOA_PPUDR EQU (0xFFFFF460) ;- (PIOA) Pull-up Disable Register +-AT91C_PIOA_IMR EQU (0xFFFFF448) ;- (PIOA) Interrupt Mask Register +-AT91C_PIOA_PER EQU (0xFFFFF400) ;- (PIOA) PIO Enable Register +-AT91C_PIOA_IFDR EQU (0xFFFFF424) ;- (PIOA) Input Filter Disable Register +-AT91C_PIOA_OWDR EQU (0xFFFFF4A4) ;- (PIOA) Output Write Disable Register +-AT91C_PIOA_MDSR EQU (0xFFFFF458) ;- (PIOA) Multi-driver Status Register +-AT91C_PIOA_IDR EQU (0xFFFFF444) ;- (PIOA) Interrupt Disable Register +-AT91C_PIOA_ODSR EQU (0xFFFFF438) ;- (PIOA) Output Data Status Register +-AT91C_PIOA_PPUSR EQU (0xFFFFF468) ;- (PIOA) Pull-up Status Register +-AT91C_PIOA_OWSR EQU (0xFFFFF4A8) ;- (PIOA) Output Write Status Register +-AT91C_PIOA_BSR EQU (0xFFFFF474) ;- (PIOA) Select B Register +-AT91C_PIOA_OWER EQU (0xFFFFF4A0) ;- (PIOA) Output Write Enable Register +-AT91C_PIOA_IFER EQU (0xFFFFF420) ;- (PIOA) Input Filter Enable Register +-AT91C_PIOA_PDSR EQU (0xFFFFF43C) ;- (PIOA) Pin Data Status Register +-AT91C_PIOA_PPUER EQU (0xFFFFF464) ;- (PIOA) Pull-up Enable Register +-AT91C_PIOA_OSR EQU (0xFFFFF418) ;- (PIOA) Output Status Register +-AT91C_PIOA_ASR EQU (0xFFFFF470) ;- (PIOA) Select A Register +-AT91C_PIOA_MDDR EQU (0xFFFFF454) ;- (PIOA) Multi-driver Disable Register +-AT91C_PIOA_CODR EQU (0xFFFFF434) ;- (PIOA) Clear Output Data Register +-AT91C_PIOA_MDER EQU (0xFFFFF450) ;- (PIOA) Multi-driver Enable Register +-AT91C_PIOA_PDR EQU (0xFFFFF404) ;- (PIOA) PIO Disable Register +-AT91C_PIOA_IFSR EQU (0xFFFFF428) ;- (PIOA) Input Filter Status Register +-AT91C_PIOA_OER EQU (0xFFFFF410) ;- (PIOA) Output Enable Register +-AT91C_PIOA_PSR EQU (0xFFFFF408) ;- (PIOA) PIO Status Register +-;- ========== Register definition for PIOB peripheral ========== +-AT91C_PIOB_OWDR EQU (0xFFFFF6A4) ;- (PIOB) Output Write Disable Register +-AT91C_PIOB_MDER EQU (0xFFFFF650) ;- (PIOB) Multi-driver Enable Register +-AT91C_PIOB_PPUSR EQU (0xFFFFF668) ;- (PIOB) Pull-up Status Register +-AT91C_PIOB_IMR EQU (0xFFFFF648) ;- (PIOB) Interrupt Mask Register +-AT91C_PIOB_ASR EQU (0xFFFFF670) ;- (PIOB) Select A Register +-AT91C_PIOB_PPUDR EQU (0xFFFFF660) ;- (PIOB) Pull-up Disable Register +-AT91C_PIOB_PSR EQU (0xFFFFF608) ;- (PIOB) PIO Status Register +-AT91C_PIOB_IER EQU (0xFFFFF640) ;- (PIOB) Interrupt Enable Register +-AT91C_PIOB_CODR EQU (0xFFFFF634) ;- (PIOB) Clear Output Data Register +-AT91C_PIOB_OWER EQU (0xFFFFF6A0) ;- (PIOB) Output Write Enable Register +-AT91C_PIOB_ABSR EQU (0xFFFFF678) ;- (PIOB) AB Select Status Register +-AT91C_PIOB_IFDR EQU (0xFFFFF624) ;- (PIOB) Input Filter Disable Register +-AT91C_PIOB_PDSR EQU (0xFFFFF63C) ;- (PIOB) Pin Data Status Register +-AT91C_PIOB_IDR EQU (0xFFFFF644) ;- (PIOB) Interrupt Disable Register +-AT91C_PIOB_OWSR EQU (0xFFFFF6A8) ;- (PIOB) Output Write Status Register +-AT91C_PIOB_PDR EQU (0xFFFFF604) ;- (PIOB) PIO Disable Register +-AT91C_PIOB_ODR EQU (0xFFFFF614) ;- (PIOB) Output Disable Registerr +-AT91C_PIOB_IFSR EQU (0xFFFFF628) ;- (PIOB) Input Filter Status Register +-AT91C_PIOB_PPUER EQU (0xFFFFF664) ;- (PIOB) Pull-up Enable Register +-AT91C_PIOB_SODR EQU (0xFFFFF630) ;- (PIOB) Set Output Data Register +-AT91C_PIOB_ISR EQU (0xFFFFF64C) ;- (PIOB) Interrupt Status Register +-AT91C_PIOB_ODSR EQU (0xFFFFF638) ;- (PIOB) Output Data Status Register +-AT91C_PIOB_OSR EQU (0xFFFFF618) ;- (PIOB) Output Status Register +-AT91C_PIOB_MDSR EQU (0xFFFFF658) ;- (PIOB) Multi-driver Status Register +-AT91C_PIOB_IFER EQU (0xFFFFF620) ;- (PIOB) Input Filter Enable Register +-AT91C_PIOB_BSR EQU (0xFFFFF674) ;- (PIOB) Select B Register +-AT91C_PIOB_MDDR EQU (0xFFFFF654) ;- (PIOB) Multi-driver Disable Register +-AT91C_PIOB_OER EQU (0xFFFFF610) ;- (PIOB) Output Enable Register +-AT91C_PIOB_PER EQU (0xFFFFF600) ;- (PIOB) PIO Enable Register +-;- ========== Register definition for CKGR peripheral ========== +-AT91C_CKGR_MOR EQU (0xFFFFFC20) ;- (CKGR) Main Oscillator Register +-AT91C_CKGR_PLLR EQU (0xFFFFFC2C) ;- (CKGR) PLL Register +-AT91C_CKGR_MCFR EQU (0xFFFFFC24) ;- (CKGR) Main Clock Frequency Register +-;- ========== Register definition for PMC peripheral ========== +-AT91C_PMC_IDR EQU (0xFFFFFC64) ;- (PMC) Interrupt Disable Register +-AT91C_PMC_MOR EQU (0xFFFFFC20) ;- (PMC) Main Oscillator Register +-AT91C_PMC_PLLR EQU (0xFFFFFC2C) ;- (PMC) PLL Register +-AT91C_PMC_PCER EQU (0xFFFFFC10) ;- (PMC) Peripheral Clock Enable Register +-AT91C_PMC_PCKR EQU (0xFFFFFC40) ;- (PMC) Programmable Clock Register +-AT91C_PMC_MCKR EQU (0xFFFFFC30) ;- (PMC) Master Clock Register +-AT91C_PMC_SCDR EQU (0xFFFFFC04) ;- (PMC) System Clock Disable Register +-AT91C_PMC_PCDR EQU (0xFFFFFC14) ;- (PMC) Peripheral Clock Disable Register +-AT91C_PMC_SCSR EQU (0xFFFFFC08) ;- (PMC) System Clock Status Register +-AT91C_PMC_PCSR EQU (0xFFFFFC18) ;- (PMC) Peripheral Clock Status Register +-AT91C_PMC_MCFR EQU (0xFFFFFC24) ;- (PMC) Main Clock Frequency Register +-AT91C_PMC_SCER EQU (0xFFFFFC00) ;- (PMC) System Clock Enable Register +-AT91C_PMC_IMR EQU (0xFFFFFC6C) ;- (PMC) Interrupt Mask Register +-AT91C_PMC_IER EQU (0xFFFFFC60) ;- (PMC) Interrupt Enable Register +-AT91C_PMC_SR EQU (0xFFFFFC68) ;- (PMC) Status Register +-;- ========== Register definition for RSTC peripheral ========== +-AT91C_RSTC_RCR EQU (0xFFFFFD00) ;- (RSTC) Reset Control Register +-AT91C_RSTC_RMR EQU (0xFFFFFD08) ;- (RSTC) Reset Mode Register +-AT91C_RSTC_RSR EQU (0xFFFFFD04) ;- (RSTC) Reset Status Register +-;- ========== Register definition for RTTC peripheral ========== +-AT91C_RTTC_RTSR EQU (0xFFFFFD2C) ;- (RTTC) Real-time Status Register +-AT91C_RTTC_RTMR EQU (0xFFFFFD20) ;- (RTTC) Real-time Mode Register +-AT91C_RTTC_RTVR EQU (0xFFFFFD28) ;- (RTTC) Real-time Value Register +-AT91C_RTTC_RTAR EQU (0xFFFFFD24) ;- (RTTC) Real-time Alarm Register +-;- ========== Register definition for PITC peripheral ========== +-AT91C_PITC_PIVR EQU (0xFFFFFD38) ;- (PITC) Period Interval Value Register +-AT91C_PITC_PISR EQU (0xFFFFFD34) ;- (PITC) Period Interval Status Register +-AT91C_PITC_PIIR EQU (0xFFFFFD3C) ;- (PITC) Period Interval Image Register +-AT91C_PITC_PIMR EQU (0xFFFFFD30) ;- (PITC) Period Interval Mode Register +-;- ========== Register definition for WDTC peripheral ========== +-AT91C_WDTC_WDCR EQU (0xFFFFFD40) ;- (WDTC) Watchdog Control Register +-AT91C_WDTC_WDSR EQU (0xFFFFFD48) ;- (WDTC) Watchdog Status Register +-AT91C_WDTC_WDMR EQU (0xFFFFFD44) ;- (WDTC) Watchdog Mode Register +-;- ========== Register definition for VREG peripheral ========== +-AT91C_VREG_MR EQU (0xFFFFFD60) ;- (VREG) Voltage Regulator Mode Register +-;- ========== Register definition for MC peripheral ========== +-AT91C_MC_ASR EQU (0xFFFFFF04) ;- (MC) MC Abort Status Register +-AT91C_MC_RCR EQU (0xFFFFFF00) ;- (MC) MC Remap Control Register +-AT91C_MC_FCR EQU (0xFFFFFF64) ;- (MC) MC Flash Command Register +-AT91C_MC_AASR EQU (0xFFFFFF08) ;- (MC) MC Abort Address Status Register +-AT91C_MC_FSR EQU (0xFFFFFF68) ;- (MC) MC Flash Status Register +-AT91C_MC_FMR EQU (0xFFFFFF60) ;- (MC) MC Flash Mode Register +-;- ========== Register definition for PDC_SPI1 peripheral ========== +-AT91C_SPI1_PTCR EQU (0xFFFE4120) ;- (PDC_SPI1) PDC Transfer Control Register +-AT91C_SPI1_RPR EQU (0xFFFE4100) ;- (PDC_SPI1) Receive Pointer Register +-AT91C_SPI1_TNCR EQU (0xFFFE411C) ;- (PDC_SPI1) Transmit Next Counter Register +-AT91C_SPI1_TPR EQU (0xFFFE4108) ;- (PDC_SPI1) Transmit Pointer Register +-AT91C_SPI1_TNPR EQU (0xFFFE4118) ;- (PDC_SPI1) Transmit Next Pointer Register +-AT91C_SPI1_TCR EQU (0xFFFE410C) ;- (PDC_SPI1) Transmit Counter Register +-AT91C_SPI1_RCR EQU (0xFFFE4104) ;- (PDC_SPI1) Receive Counter Register +-AT91C_SPI1_RNPR EQU (0xFFFE4110) ;- (PDC_SPI1) Receive Next Pointer Register +-AT91C_SPI1_RNCR EQU (0xFFFE4114) ;- (PDC_SPI1) Receive Next Counter Register +-AT91C_SPI1_PTSR EQU (0xFFFE4124) ;- (PDC_SPI1) PDC Transfer Status Register +-;- ========== Register definition for SPI1 peripheral ========== +-AT91C_SPI1_IMR EQU (0xFFFE401C) ;- (SPI1) Interrupt Mask Register +-AT91C_SPI1_IER EQU (0xFFFE4014) ;- (SPI1) Interrupt Enable Register +-AT91C_SPI1_MR EQU (0xFFFE4004) ;- (SPI1) Mode Register +-AT91C_SPI1_RDR EQU (0xFFFE4008) ;- (SPI1) Receive Data Register +-AT91C_SPI1_IDR EQU (0xFFFE4018) ;- (SPI1) Interrupt Disable Register +-AT91C_SPI1_SR EQU (0xFFFE4010) ;- (SPI1) Status Register +-AT91C_SPI1_TDR EQU (0xFFFE400C) ;- (SPI1) Transmit Data Register +-AT91C_SPI1_CR EQU (0xFFFE4000) ;- (SPI1) Control Register +-AT91C_SPI1_CSR EQU (0xFFFE4030) ;- (SPI1) Chip Select Register +-;- ========== Register definition for PDC_SPI0 peripheral ========== +-AT91C_SPI0_PTCR EQU (0xFFFE0120) ;- (PDC_SPI0) PDC Transfer Control Register +-AT91C_SPI0_TPR EQU (0xFFFE0108) ;- (PDC_SPI0) Transmit Pointer Register +-AT91C_SPI0_TCR EQU (0xFFFE010C) ;- (PDC_SPI0) Transmit Counter Register +-AT91C_SPI0_RCR EQU (0xFFFE0104) ;- (PDC_SPI0) Receive Counter Register +-AT91C_SPI0_PTSR EQU (0xFFFE0124) ;- (PDC_SPI0) PDC Transfer Status Register +-AT91C_SPI0_RNPR EQU (0xFFFE0110) ;- (PDC_SPI0) Receive Next Pointer Register +-AT91C_SPI0_RPR EQU (0xFFFE0100) ;- (PDC_SPI0) Receive Pointer Register +-AT91C_SPI0_TNCR EQU (0xFFFE011C) ;- (PDC_SPI0) Transmit Next Counter Register +-AT91C_SPI0_RNCR EQU (0xFFFE0114) ;- (PDC_SPI0) Receive Next Counter Register +-AT91C_SPI0_TNPR EQU (0xFFFE0118) ;- (PDC_SPI0) Transmit Next Pointer Register +-;- ========== Register definition for SPI0 peripheral ========== +-AT91C_SPI0_IER EQU (0xFFFE0014) ;- (SPI0) Interrupt Enable Register +-AT91C_SPI0_SR EQU (0xFFFE0010) ;- (SPI0) Status Register +-AT91C_SPI0_IDR EQU (0xFFFE0018) ;- (SPI0) Interrupt Disable Register +-AT91C_SPI0_CR EQU (0xFFFE0000) ;- (SPI0) Control Register +-AT91C_SPI0_MR EQU (0xFFFE0004) ;- (SPI0) Mode Register +-AT91C_SPI0_IMR EQU (0xFFFE001C) ;- (SPI0) Interrupt Mask Register +-AT91C_SPI0_TDR EQU (0xFFFE000C) ;- (SPI0) Transmit Data Register +-AT91C_SPI0_RDR EQU (0xFFFE0008) ;- (SPI0) Receive Data Register +-AT91C_SPI0_CSR EQU (0xFFFE0030) ;- (SPI0) Chip Select Register +-;- ========== Register definition for PDC_US1 peripheral ========== +-AT91C_US1_RNCR EQU (0xFFFC4114) ;- (PDC_US1) Receive Next Counter Register +-AT91C_US1_PTCR EQU (0xFFFC4120) ;- (PDC_US1) PDC Transfer Control Register +-AT91C_US1_TCR EQU (0xFFFC410C) ;- (PDC_US1) Transmit Counter Register +-AT91C_US1_PTSR EQU (0xFFFC4124) ;- (PDC_US1) PDC Transfer Status Register +-AT91C_US1_TNPR EQU (0xFFFC4118) ;- (PDC_US1) Transmit Next Pointer Register +-AT91C_US1_RCR EQU (0xFFFC4104) ;- (PDC_US1) Receive Counter Register +-AT91C_US1_RNPR EQU (0xFFFC4110) ;- (PDC_US1) Receive Next Pointer Register +-AT91C_US1_RPR EQU (0xFFFC4100) ;- (PDC_US1) Receive Pointer Register +-AT91C_US1_TNCR EQU (0xFFFC411C) ;- (PDC_US1) Transmit Next Counter Register +-AT91C_US1_TPR EQU (0xFFFC4108) ;- (PDC_US1) Transmit Pointer Register +-;- ========== Register definition for US1 peripheral ========== +-AT91C_US1_IF EQU (0xFFFC404C) ;- (US1) IRDA_FILTER Register +-AT91C_US1_NER EQU (0xFFFC4044) ;- (US1) Nb Errors Register +-AT91C_US1_RTOR EQU (0xFFFC4024) ;- (US1) Receiver Time-out Register +-AT91C_US1_CSR EQU (0xFFFC4014) ;- (US1) Channel Status Register +-AT91C_US1_IDR EQU (0xFFFC400C) ;- (US1) Interrupt Disable Register +-AT91C_US1_IER EQU (0xFFFC4008) ;- (US1) Interrupt Enable Register +-AT91C_US1_THR EQU (0xFFFC401C) ;- (US1) Transmitter Holding Register +-AT91C_US1_TTGR EQU (0xFFFC4028) ;- (US1) Transmitter Time-guard Register +-AT91C_US1_RHR EQU (0xFFFC4018) ;- (US1) Receiver Holding Register +-AT91C_US1_BRGR EQU (0xFFFC4020) ;- (US1) Baud Rate Generator Register +-AT91C_US1_IMR EQU (0xFFFC4010) ;- (US1) Interrupt Mask Register +-AT91C_US1_FIDI EQU (0xFFFC4040) ;- (US1) FI_DI_Ratio Register +-AT91C_US1_CR EQU (0xFFFC4000) ;- (US1) Control Register +-AT91C_US1_MR EQU (0xFFFC4004) ;- (US1) Mode Register +-;- ========== Register definition for PDC_US0 peripheral ========== +-AT91C_US0_TNPR EQU (0xFFFC0118) ;- (PDC_US0) Transmit Next Pointer Register +-AT91C_US0_RNPR EQU (0xFFFC0110) ;- (PDC_US0) Receive Next Pointer Register +-AT91C_US0_TCR EQU (0xFFFC010C) ;- (PDC_US0) Transmit Counter Register +-AT91C_US0_PTCR EQU (0xFFFC0120) ;- (PDC_US0) PDC Transfer Control Register +-AT91C_US0_PTSR EQU (0xFFFC0124) ;- (PDC_US0) PDC Transfer Status Register +-AT91C_US0_TNCR EQU (0xFFFC011C) ;- (PDC_US0) Transmit Next Counter Register +-AT91C_US0_TPR EQU (0xFFFC0108) ;- (PDC_US0) Transmit Pointer Register +-AT91C_US0_RCR EQU (0xFFFC0104) ;- (PDC_US0) Receive Counter Register +-AT91C_US0_RPR EQU (0xFFFC0100) ;- (PDC_US0) Receive Pointer Register +-AT91C_US0_RNCR EQU (0xFFFC0114) ;- (PDC_US0) Receive Next Counter Register +-;- ========== Register definition for US0 peripheral ========== +-AT91C_US0_BRGR EQU (0xFFFC0020) ;- (US0) Baud Rate Generator Register +-AT91C_US0_NER EQU (0xFFFC0044) ;- (US0) Nb Errors Register +-AT91C_US0_CR EQU (0xFFFC0000) ;- (US0) Control Register +-AT91C_US0_IMR EQU (0xFFFC0010) ;- (US0) Interrupt Mask Register +-AT91C_US0_FIDI EQU (0xFFFC0040) ;- (US0) FI_DI_Ratio Register +-AT91C_US0_TTGR EQU (0xFFFC0028) ;- (US0) Transmitter Time-guard Register +-AT91C_US0_MR EQU (0xFFFC0004) ;- (US0) Mode Register +-AT91C_US0_RTOR EQU (0xFFFC0024) ;- (US0) Receiver Time-out Register +-AT91C_US0_CSR EQU (0xFFFC0014) ;- (US0) Channel Status Register +-AT91C_US0_RHR EQU (0xFFFC0018) ;- (US0) Receiver Holding Register +-AT91C_US0_IDR EQU (0xFFFC000C) ;- (US0) Interrupt Disable Register +-AT91C_US0_THR EQU (0xFFFC001C) ;- (US0) Transmitter Holding Register +-AT91C_US0_IF EQU (0xFFFC004C) ;- (US0) IRDA_FILTER Register +-AT91C_US0_IER EQU (0xFFFC0008) ;- (US0) Interrupt Enable Register +-;- ========== Register definition for PDC_SSC peripheral ========== +-AT91C_SSC_TNCR EQU (0xFFFD411C) ;- (PDC_SSC) Transmit Next Counter Register +-AT91C_SSC_RPR EQU (0xFFFD4100) ;- (PDC_SSC) Receive Pointer Register +-AT91C_SSC_RNCR EQU (0xFFFD4114) ;- (PDC_SSC) Receive Next Counter Register +-AT91C_SSC_TPR EQU (0xFFFD4108) ;- (PDC_SSC) Transmit Pointer Register +-AT91C_SSC_PTCR EQU (0xFFFD4120) ;- (PDC_SSC) PDC Transfer Control Register +-AT91C_SSC_TCR EQU (0xFFFD410C) ;- (PDC_SSC) Transmit Counter Register +-AT91C_SSC_RCR EQU (0xFFFD4104) ;- (PDC_SSC) Receive Counter Register +-AT91C_SSC_RNPR EQU (0xFFFD4110) ;- (PDC_SSC) Receive Next Pointer Register +-AT91C_SSC_TNPR EQU (0xFFFD4118) ;- (PDC_SSC) Transmit Next Pointer Register +-AT91C_SSC_PTSR EQU (0xFFFD4124) ;- (PDC_SSC) PDC Transfer Status Register +-;- ========== Register definition for SSC peripheral ========== +-AT91C_SSC_RHR EQU (0xFFFD4020) ;- (SSC) Receive Holding Register +-AT91C_SSC_RSHR EQU (0xFFFD4030) ;- (SSC) Receive Sync Holding Register +-AT91C_SSC_TFMR EQU (0xFFFD401C) ;- (SSC) Transmit Frame Mode Register +-AT91C_SSC_IDR EQU (0xFFFD4048) ;- (SSC) Interrupt Disable Register +-AT91C_SSC_THR EQU (0xFFFD4024) ;- (SSC) Transmit Holding Register +-AT91C_SSC_RCMR EQU (0xFFFD4010) ;- (SSC) Receive Clock ModeRegister +-AT91C_SSC_IER EQU (0xFFFD4044) ;- (SSC) Interrupt Enable Register +-AT91C_SSC_TSHR EQU (0xFFFD4034) ;- (SSC) Transmit Sync Holding Register +-AT91C_SSC_SR EQU (0xFFFD4040) ;- (SSC) Status Register +-AT91C_SSC_CMR EQU (0xFFFD4004) ;- (SSC) Clock Mode Register +-AT91C_SSC_TCMR EQU (0xFFFD4018) ;- (SSC) Transmit Clock Mode Register +-AT91C_SSC_CR EQU (0xFFFD4000) ;- (SSC) Control Register +-AT91C_SSC_IMR EQU (0xFFFD404C) ;- (SSC) Interrupt Mask Register +-AT91C_SSC_RFMR EQU (0xFFFD4014) ;- (SSC) Receive Frame Mode Register +-;- ========== Register definition for TWI peripheral ========== +-AT91C_TWI_IER EQU (0xFFFB8024) ;- (TWI) Interrupt Enable Register +-AT91C_TWI_CR EQU (0xFFFB8000) ;- (TWI) Control Register +-AT91C_TWI_SR EQU (0xFFFB8020) ;- (TWI) Status Register +-AT91C_TWI_IMR EQU (0xFFFB802C) ;- (TWI) Interrupt Mask Register +-AT91C_TWI_THR EQU (0xFFFB8034) ;- (TWI) Transmit Holding Register +-AT91C_TWI_IDR EQU (0xFFFB8028) ;- (TWI) Interrupt Disable Register +-AT91C_TWI_IADR EQU (0xFFFB800C) ;- (TWI) Internal Address Register +-AT91C_TWI_MMR EQU (0xFFFB8004) ;- (TWI) Master Mode Register +-AT91C_TWI_CWGR EQU (0xFFFB8010) ;- (TWI) Clock Waveform Generator Register +-AT91C_TWI_RHR EQU (0xFFFB8030) ;- (TWI) Receive Holding Register +-;- ========== Register definition for PWMC_CH3 peripheral ========== +-AT91C_PWMC_CH3_CUPDR EQU (0xFFFCC270) ;- (PWMC_CH3) Channel Update Register +-AT91C_PWMC_CH3_Reserved EQU (0xFFFCC274) ;- (PWMC_CH3) Reserved +-AT91C_PWMC_CH3_CPRDR EQU (0xFFFCC268) ;- (PWMC_CH3) Channel Period Register +-AT91C_PWMC_CH3_CDTYR EQU (0xFFFCC264) ;- (PWMC_CH3) Channel Duty Cycle Register +-AT91C_PWMC_CH3_CCNTR EQU (0xFFFCC26C) ;- (PWMC_CH3) Channel Counter Register +-AT91C_PWMC_CH3_CMR EQU (0xFFFCC260) ;- (PWMC_CH3) Channel Mode Register +-;- ========== Register definition for PWMC_CH2 peripheral ========== +-AT91C_PWMC_CH2_Reserved EQU (0xFFFCC254) ;- (PWMC_CH2) Reserved +-AT91C_PWMC_CH2_CMR EQU (0xFFFCC240) ;- (PWMC_CH2) Channel Mode Register +-AT91C_PWMC_CH2_CCNTR EQU (0xFFFCC24C) ;- (PWMC_CH2) Channel Counter Register +-AT91C_PWMC_CH2_CPRDR EQU (0xFFFCC248) ;- (PWMC_CH2) Channel Period Register +-AT91C_PWMC_CH2_CUPDR EQU (0xFFFCC250) ;- (PWMC_CH2) Channel Update Register +-AT91C_PWMC_CH2_CDTYR EQU (0xFFFCC244) ;- (PWMC_CH2) Channel Duty Cycle Register +-;- ========== Register definition for PWMC_CH1 peripheral ========== +-AT91C_PWMC_CH1_Reserved EQU (0xFFFCC234) ;- (PWMC_CH1) Reserved +-AT91C_PWMC_CH1_CUPDR EQU (0xFFFCC230) ;- (PWMC_CH1) Channel Update Register +-AT91C_PWMC_CH1_CPRDR EQU (0xFFFCC228) ;- (PWMC_CH1) Channel Period Register +-AT91C_PWMC_CH1_CCNTR EQU (0xFFFCC22C) ;- (PWMC_CH1) Channel Counter Register +-AT91C_PWMC_CH1_CDTYR EQU (0xFFFCC224) ;- (PWMC_CH1) Channel Duty Cycle Register +-AT91C_PWMC_CH1_CMR EQU (0xFFFCC220) ;- (PWMC_CH1) Channel Mode Register +-;- ========== Register definition for PWMC_CH0 peripheral ========== +-AT91C_PWMC_CH0_Reserved EQU (0xFFFCC214) ;- (PWMC_CH0) Reserved +-AT91C_PWMC_CH0_CPRDR EQU (0xFFFCC208) ;- (PWMC_CH0) Channel Period Register +-AT91C_PWMC_CH0_CDTYR EQU (0xFFFCC204) ;- (PWMC_CH0) Channel Duty Cycle Register +-AT91C_PWMC_CH0_CMR EQU (0xFFFCC200) ;- (PWMC_CH0) Channel Mode Register +-AT91C_PWMC_CH0_CUPDR EQU (0xFFFCC210) ;- (PWMC_CH0) Channel Update Register +-AT91C_PWMC_CH0_CCNTR EQU (0xFFFCC20C) ;- (PWMC_CH0) Channel Counter Register +-;- ========== Register definition for PWMC peripheral ========== +-AT91C_PWMC_IDR EQU (0xFFFCC014) ;- (PWMC) PWMC Interrupt Disable Register +-AT91C_PWMC_DIS EQU (0xFFFCC008) ;- (PWMC) PWMC Disable Register +-AT91C_PWMC_IER EQU (0xFFFCC010) ;- (PWMC) PWMC Interrupt Enable Register +-AT91C_PWMC_VR EQU (0xFFFCC0FC) ;- (PWMC) PWMC Version Register +-AT91C_PWMC_ISR EQU (0xFFFCC01C) ;- (PWMC) PWMC Interrupt Status Register +-AT91C_PWMC_SR EQU (0xFFFCC00C) ;- (PWMC) PWMC Status Register +-AT91C_PWMC_IMR EQU (0xFFFCC018) ;- (PWMC) PWMC Interrupt Mask Register +-AT91C_PWMC_MR EQU (0xFFFCC000) ;- (PWMC) PWMC Mode Register +-AT91C_PWMC_ENA EQU (0xFFFCC004) ;- (PWMC) PWMC Enable Register +-;- ========== Register definition for UDP peripheral ========== +-AT91C_UDP_IMR EQU (0xFFFB0018) ;- (UDP) Interrupt Mask Register +-AT91C_UDP_FADDR EQU (0xFFFB0008) ;- (UDP) Function Address Register +-AT91C_UDP_NUM EQU (0xFFFB0000) ;- (UDP) Frame Number Register +-AT91C_UDP_FDR EQU (0xFFFB0050) ;- (UDP) Endpoint FIFO Data Register +-AT91C_UDP_ISR EQU (0xFFFB001C) ;- (UDP) Interrupt Status Register +-AT91C_UDP_CSR EQU (0xFFFB0030) ;- (UDP) Endpoint Control and Status Register +-AT91C_UDP_IDR EQU (0xFFFB0014) ;- (UDP) Interrupt Disable Register +-AT91C_UDP_ICR EQU (0xFFFB0020) ;- (UDP) Interrupt Clear Register +-AT91C_UDP_RSTEP EQU (0xFFFB0028) ;- (UDP) Reset Endpoint Register +-AT91C_UDP_TXVC EQU (0xFFFB0074) ;- (UDP) Transceiver Control Register +-AT91C_UDP_GLBSTATE EQU (0xFFFB0004) ;- (UDP) Global State Register +-AT91C_UDP_IER EQU (0xFFFB0010) ;- (UDP) Interrupt Enable Register +-;- ========== Register definition for TC0 peripheral ========== +-AT91C_TC0_SR EQU (0xFFFA0020) ;- (TC0) Status Register +-AT91C_TC0_RC EQU (0xFFFA001C) ;- (TC0) Register C +-AT91C_TC0_RB EQU (0xFFFA0018) ;- (TC0) Register B +-AT91C_TC0_CCR EQU (0xFFFA0000) ;- (TC0) Channel Control Register +-AT91C_TC0_CMR EQU (0xFFFA0004) ;- (TC0) Channel Mode Register (Capture Mode / Waveform Mode) +-AT91C_TC0_IER EQU (0xFFFA0024) ;- (TC0) Interrupt Enable Register +-AT91C_TC0_RA EQU (0xFFFA0014) ;- (TC0) Register A +-AT91C_TC0_IDR EQU (0xFFFA0028) ;- (TC0) Interrupt Disable Register +-AT91C_TC0_CV EQU (0xFFFA0010) ;- (TC0) Counter Value +-AT91C_TC0_IMR EQU (0xFFFA002C) ;- (TC0) Interrupt Mask Register +-;- ========== Register definition for TC1 peripheral ========== +-AT91C_TC1_RB EQU (0xFFFA0058) ;- (TC1) Register B +-AT91C_TC1_CCR EQU (0xFFFA0040) ;- (TC1) Channel Control Register +-AT91C_TC1_IER EQU (0xFFFA0064) ;- (TC1) Interrupt Enable Register +-AT91C_TC1_IDR EQU (0xFFFA0068) ;- (TC1) Interrupt Disable Register +-AT91C_TC1_SR EQU (0xFFFA0060) ;- (TC1) Status Register +-AT91C_TC1_CMR EQU (0xFFFA0044) ;- (TC1) Channel Mode Register (Capture Mode / Waveform Mode) +-AT91C_TC1_RA EQU (0xFFFA0054) ;- (TC1) Register A +-AT91C_TC1_RC EQU (0xFFFA005C) ;- (TC1) Register C +-AT91C_TC1_IMR EQU (0xFFFA006C) ;- (TC1) Interrupt Mask Register +-AT91C_TC1_CV EQU (0xFFFA0050) ;- (TC1) Counter Value +-;- ========== Register definition for TC2 peripheral ========== +-AT91C_TC2_CMR EQU (0xFFFA0084) ;- (TC2) Channel Mode Register (Capture Mode / Waveform Mode) +-AT91C_TC2_CCR EQU (0xFFFA0080) ;- (TC2) Channel Control Register +-AT91C_TC2_CV EQU (0xFFFA0090) ;- (TC2) Counter Value +-AT91C_TC2_RA EQU (0xFFFA0094) ;- (TC2) Register A +-AT91C_TC2_RB EQU (0xFFFA0098) ;- (TC2) Register B +-AT91C_TC2_IDR EQU (0xFFFA00A8) ;- (TC2) Interrupt Disable Register +-AT91C_TC2_IMR EQU (0xFFFA00AC) ;- (TC2) Interrupt Mask Register +-AT91C_TC2_RC EQU (0xFFFA009C) ;- (TC2) Register C +-AT91C_TC2_IER EQU (0xFFFA00A4) ;- (TC2) Interrupt Enable Register +-AT91C_TC2_SR EQU (0xFFFA00A0) ;- (TC2) Status Register +-;- ========== Register definition for TCB peripheral ========== +-AT91C_TCB_BMR EQU (0xFFFA00C4) ;- (TCB) TC Block Mode Register +-AT91C_TCB_BCR EQU (0xFFFA00C0) ;- (TCB) TC Block Control Register +-;- ========== Register definition for CAN_MB0 peripheral ========== +-AT91C_CAN_MB0_MDL EQU (0xFFFD0214) ;- (CAN_MB0) MailBox Data Low Register +-AT91C_CAN_MB0_MAM EQU (0xFFFD0204) ;- (CAN_MB0) MailBox Acceptance Mask Register +-AT91C_CAN_MB0_MCR EQU (0xFFFD021C) ;- (CAN_MB0) MailBox Control Register +-AT91C_CAN_MB0_MID EQU (0xFFFD0208) ;- (CAN_MB0) MailBox ID Register +-AT91C_CAN_MB0_MSR EQU (0xFFFD0210) ;- (CAN_MB0) MailBox Status Register +-AT91C_CAN_MB0_MFID EQU (0xFFFD020C) ;- (CAN_MB0) MailBox Family ID Register +-AT91C_CAN_MB0_MDH EQU (0xFFFD0218) ;- (CAN_MB0) MailBox Data High Register +-AT91C_CAN_MB0_MMR EQU (0xFFFD0200) ;- (CAN_MB0) MailBox Mode Register +-;- ========== Register definition for CAN_MB1 peripheral ========== +-AT91C_CAN_MB1_MDL EQU (0xFFFD0234) ;- (CAN_MB1) MailBox Data Low Register +-AT91C_CAN_MB1_MID EQU (0xFFFD0228) ;- (CAN_MB1) MailBox ID Register +-AT91C_CAN_MB1_MMR EQU (0xFFFD0220) ;- (CAN_MB1) MailBox Mode Register +-AT91C_CAN_MB1_MSR EQU (0xFFFD0230) ;- (CAN_MB1) MailBox Status Register +-AT91C_CAN_MB1_MAM EQU (0xFFFD0224) ;- (CAN_MB1) MailBox Acceptance Mask Register +-AT91C_CAN_MB1_MDH EQU (0xFFFD0238) ;- (CAN_MB1) MailBox Data High Register +-AT91C_CAN_MB1_MCR EQU (0xFFFD023C) ;- (CAN_MB1) MailBox Control Register +-AT91C_CAN_MB1_MFID EQU (0xFFFD022C) ;- (CAN_MB1) MailBox Family ID Register +-;- ========== Register definition for CAN_MB2 peripheral ========== +-AT91C_CAN_MB2_MCR EQU (0xFFFD025C) ;- (CAN_MB2) MailBox Control Register +-AT91C_CAN_MB2_MDH EQU (0xFFFD0258) ;- (CAN_MB2) MailBox Data High Register +-AT91C_CAN_MB2_MID EQU (0xFFFD0248) ;- (CAN_MB2) MailBox ID Register +-AT91C_CAN_MB2_MDL EQU (0xFFFD0254) ;- (CAN_MB2) MailBox Data Low Register +-AT91C_CAN_MB2_MMR EQU (0xFFFD0240) ;- (CAN_MB2) MailBox Mode Register +-AT91C_CAN_MB2_MAM EQU (0xFFFD0244) ;- (CAN_MB2) MailBox Acceptance Mask Register +-AT91C_CAN_MB2_MFID EQU (0xFFFD024C) ;- (CAN_MB2) MailBox Family ID Register +-AT91C_CAN_MB2_MSR EQU (0xFFFD0250) ;- (CAN_MB2) MailBox Status Register +-;- ========== Register definition for CAN_MB3 peripheral ========== +-AT91C_CAN_MB3_MFID EQU (0xFFFD026C) ;- (CAN_MB3) MailBox Family ID Register +-AT91C_CAN_MB3_MAM EQU (0xFFFD0264) ;- (CAN_MB3) MailBox Acceptance Mask Register +-AT91C_CAN_MB3_MID EQU (0xFFFD0268) ;- (CAN_MB3) MailBox ID Register +-AT91C_CAN_MB3_MCR EQU (0xFFFD027C) ;- (CAN_MB3) MailBox Control Register +-AT91C_CAN_MB3_MMR EQU (0xFFFD0260) ;- (CAN_MB3) MailBox Mode Register +-AT91C_CAN_MB3_MSR EQU (0xFFFD0270) ;- (CAN_MB3) MailBox Status Register +-AT91C_CAN_MB3_MDL EQU (0xFFFD0274) ;- (CAN_MB3) MailBox Data Low Register +-AT91C_CAN_MB3_MDH EQU (0xFFFD0278) ;- (CAN_MB3) MailBox Data High Register +-;- ========== Register definition for CAN_MB4 peripheral ========== +-AT91C_CAN_MB4_MID EQU (0xFFFD0288) ;- (CAN_MB4) MailBox ID Register +-AT91C_CAN_MB4_MMR EQU (0xFFFD0280) ;- (CAN_MB4) MailBox Mode Register +-AT91C_CAN_MB4_MDH EQU (0xFFFD0298) ;- (CAN_MB4) MailBox Data High Register +-AT91C_CAN_MB4_MFID EQU (0xFFFD028C) ;- (CAN_MB4) MailBox Family ID Register +-AT91C_CAN_MB4_MSR EQU (0xFFFD0290) ;- (CAN_MB4) MailBox Status Register +-AT91C_CAN_MB4_MCR EQU (0xFFFD029C) ;- (CAN_MB4) MailBox Control Register +-AT91C_CAN_MB4_MDL EQU (0xFFFD0294) ;- (CAN_MB4) MailBox Data Low Register +-AT91C_CAN_MB4_MAM EQU (0xFFFD0284) ;- (CAN_MB4) MailBox Acceptance Mask Register +-;- ========== Register definition for CAN_MB5 peripheral ========== +-AT91C_CAN_MB5_MSR EQU (0xFFFD02B0) ;- (CAN_MB5) MailBox Status Register +-AT91C_CAN_MB5_MCR EQU (0xFFFD02BC) ;- (CAN_MB5) MailBox Control Register +-AT91C_CAN_MB5_MFID EQU (0xFFFD02AC) ;- (CAN_MB5) MailBox Family ID Register +-AT91C_CAN_MB5_MDH EQU (0xFFFD02B8) ;- (CAN_MB5) MailBox Data High Register +-AT91C_CAN_MB5_MID EQU (0xFFFD02A8) ;- (CAN_MB5) MailBox ID Register +-AT91C_CAN_MB5_MMR EQU (0xFFFD02A0) ;- (CAN_MB5) MailBox Mode Register +-AT91C_CAN_MB5_MDL EQU (0xFFFD02B4) ;- (CAN_MB5) MailBox Data Low Register +-AT91C_CAN_MB5_MAM EQU (0xFFFD02A4) ;- (CAN_MB5) MailBox Acceptance Mask Register +-;- ========== Register definition for CAN_MB6 peripheral ========== +-AT91C_CAN_MB6_MFID EQU (0xFFFD02CC) ;- (CAN_MB6) MailBox Family ID Register +-AT91C_CAN_MB6_MID EQU (0xFFFD02C8) ;- (CAN_MB6) MailBox ID Register +-AT91C_CAN_MB6_MAM EQU (0xFFFD02C4) ;- (CAN_MB6) MailBox Acceptance Mask Register +-AT91C_CAN_MB6_MSR EQU (0xFFFD02D0) ;- (CAN_MB6) MailBox Status Register +-AT91C_CAN_MB6_MDL EQU (0xFFFD02D4) ;- (CAN_MB6) MailBox Data Low Register +-AT91C_CAN_MB6_MCR EQU (0xFFFD02DC) ;- (CAN_MB6) MailBox Control Register +-AT91C_CAN_MB6_MDH EQU (0xFFFD02D8) ;- (CAN_MB6) MailBox Data High Register +-AT91C_CAN_MB6_MMR EQU (0xFFFD02C0) ;- (CAN_MB6) MailBox Mode Register +-;- ========== Register definition for CAN_MB7 peripheral ========== +-AT91C_CAN_MB7_MCR EQU (0xFFFD02FC) ;- (CAN_MB7) MailBox Control Register +-AT91C_CAN_MB7_MDH EQU (0xFFFD02F8) ;- (CAN_MB7) MailBox Data High Register +-AT91C_CAN_MB7_MFID EQU (0xFFFD02EC) ;- (CAN_MB7) MailBox Family ID Register +-AT91C_CAN_MB7_MDL EQU (0xFFFD02F4) ;- (CAN_MB7) MailBox Data Low Register +-AT91C_CAN_MB7_MID EQU (0xFFFD02E8) ;- (CAN_MB7) MailBox ID Register +-AT91C_CAN_MB7_MMR EQU (0xFFFD02E0) ;- (CAN_MB7) MailBox Mode Register +-AT91C_CAN_MB7_MAM EQU (0xFFFD02E4) ;- (CAN_MB7) MailBox Acceptance Mask Register +-AT91C_CAN_MB7_MSR EQU (0xFFFD02F0) ;- (CAN_MB7) MailBox Status Register +-;- ========== Register definition for CAN peripheral ========== +-AT91C_CAN_TCR EQU (0xFFFD0024) ;- (CAN) Transfer Command Register +-AT91C_CAN_IMR EQU (0xFFFD000C) ;- (CAN) Interrupt Mask Register +-AT91C_CAN_IER EQU (0xFFFD0004) ;- (CAN) Interrupt Enable Register +-AT91C_CAN_ECR EQU (0xFFFD0020) ;- (CAN) Error Counter Register +-AT91C_CAN_TIMESTP EQU (0xFFFD001C) ;- (CAN) Time Stamp Register +-AT91C_CAN_MR EQU (0xFFFD0000) ;- (CAN) Mode Register +-AT91C_CAN_IDR EQU (0xFFFD0008) ;- (CAN) Interrupt Disable Register +-AT91C_CAN_ACR EQU (0xFFFD0028) ;- (CAN) Abort Command Register +-AT91C_CAN_TIM EQU (0xFFFD0018) ;- (CAN) Timer Register +-AT91C_CAN_SR EQU (0xFFFD0010) ;- (CAN) Status Register +-AT91C_CAN_BR EQU (0xFFFD0014) ;- (CAN) Baudrate Register +-AT91C_CAN_VR EQU (0xFFFD00FC) ;- (CAN) Version Register +-;- ========== Register definition for EMAC peripheral ========== +-AT91C_EMAC_ISR EQU (0xFFFDC024) ;- (EMAC) Interrupt Status Register +-AT91C_EMAC_SA4H EQU (0xFFFDC0B4) ;- (EMAC) Specific Address 4 Top, Last 2 bytes +-AT91C_EMAC_SA1L EQU (0xFFFDC098) ;- (EMAC) Specific Address 1 Bottom, First 4 bytes +-AT91C_EMAC_ELE EQU (0xFFFDC078) ;- (EMAC) Excessive Length Errors Register +-AT91C_EMAC_LCOL EQU (0xFFFDC05C) ;- (EMAC) Late Collision Register +-AT91C_EMAC_RLE EQU (0xFFFDC088) ;- (EMAC) Receive Length Field Mismatch Register +-AT91C_EMAC_WOL EQU (0xFFFDC0C4) ;- (EMAC) Wake On LAN Register +-AT91C_EMAC_DTF EQU (0xFFFDC058) ;- (EMAC) Deferred Transmission Frame Register +-AT91C_EMAC_TUND EQU (0xFFFDC064) ;- (EMAC) Transmit Underrun Error Register +-AT91C_EMAC_NCR EQU (0xFFFDC000) ;- (EMAC) Network Control Register +-AT91C_EMAC_SA4L EQU (0xFFFDC0B0) ;- (EMAC) Specific Address 4 Bottom, First 4 bytes +-AT91C_EMAC_RSR EQU (0xFFFDC020) ;- (EMAC) Receive Status Register +-AT91C_EMAC_SA3L EQU (0xFFFDC0A8) ;- (EMAC) Specific Address 3 Bottom, First 4 bytes +-AT91C_EMAC_TSR EQU (0xFFFDC014) ;- (EMAC) Transmit Status Register +-AT91C_EMAC_IDR EQU (0xFFFDC02C) ;- (EMAC) Interrupt Disable Register +-AT91C_EMAC_RSE EQU (0xFFFDC074) ;- (EMAC) Receive Symbol Errors Register +-AT91C_EMAC_ECOL EQU (0xFFFDC060) ;- (EMAC) Excessive Collision Register +-AT91C_EMAC_TID EQU (0xFFFDC0B8) ;- (EMAC) Type ID Checking Register +-AT91C_EMAC_HRB EQU (0xFFFDC090) ;- (EMAC) Hash Address Bottom[31:0] +-AT91C_EMAC_TBQP EQU (0xFFFDC01C) ;- (EMAC) Transmit Buffer Queue Pointer +-AT91C_EMAC_USRIO EQU (0xFFFDC0C0) ;- (EMAC) USER Input/Output Register +-AT91C_EMAC_PTR EQU (0xFFFDC038) ;- (EMAC) Pause Time Register +-AT91C_EMAC_SA2H EQU (0xFFFDC0A4) ;- (EMAC) Specific Address 2 Top, Last 2 bytes +-AT91C_EMAC_ROV EQU (0xFFFDC070) ;- (EMAC) Receive Overrun Errors Register +-AT91C_EMAC_ALE EQU (0xFFFDC054) ;- (EMAC) Alignment Error Register +-AT91C_EMAC_RJA EQU (0xFFFDC07C) ;- (EMAC) Receive Jabbers Register +-AT91C_EMAC_RBQP EQU (0xFFFDC018) ;- (EMAC) Receive Buffer Queue Pointer +-AT91C_EMAC_TPF EQU (0xFFFDC08C) ;- (EMAC) Transmitted Pause Frames Register +-AT91C_EMAC_NCFGR EQU (0xFFFDC004) ;- (EMAC) Network Configuration Register +-AT91C_EMAC_HRT EQU (0xFFFDC094) ;- (EMAC) Hash Address Top[63:32] +-AT91C_EMAC_USF EQU (0xFFFDC080) ;- (EMAC) Undersize Frames Register +-AT91C_EMAC_FCSE EQU (0xFFFDC050) ;- (EMAC) Frame Check Sequence Error Register +-AT91C_EMAC_TPQ EQU (0xFFFDC0BC) ;- (EMAC) Transmit Pause Quantum Register +-AT91C_EMAC_MAN EQU (0xFFFDC034) ;- (EMAC) PHY Maintenance Register +-AT91C_EMAC_FTO EQU (0xFFFDC040) ;- (EMAC) Frames Transmitted OK Register +-AT91C_EMAC_REV EQU (0xFFFDC0FC) ;- (EMAC) Revision Register +-AT91C_EMAC_IMR EQU (0xFFFDC030) ;- (EMAC) Interrupt Mask Register +-AT91C_EMAC_SCF EQU (0xFFFDC044) ;- (EMAC) Single Collision Frame Register +-AT91C_EMAC_PFR EQU (0xFFFDC03C) ;- (EMAC) Pause Frames received Register +-AT91C_EMAC_MCF EQU (0xFFFDC048) ;- (EMAC) Multiple Collision Frame Register +-AT91C_EMAC_NSR EQU (0xFFFDC008) ;- (EMAC) Network Status Register +-AT91C_EMAC_SA2L EQU (0xFFFDC0A0) ;- (EMAC) Specific Address 2 Bottom, First 4 bytes +-AT91C_EMAC_FRO EQU (0xFFFDC04C) ;- (EMAC) Frames Received OK Register +-AT91C_EMAC_IER EQU (0xFFFDC028) ;- (EMAC) Interrupt Enable Register +-AT91C_EMAC_SA1H EQU (0xFFFDC09C) ;- (EMAC) Specific Address 1 Top, Last 2 bytes +-AT91C_EMAC_CSE EQU (0xFFFDC068) ;- (EMAC) Carrier Sense Error Register +-AT91C_EMAC_SA3H EQU (0xFFFDC0AC) ;- (EMAC) Specific Address 3 Top, Last 2 bytes +-AT91C_EMAC_RRE EQU (0xFFFDC06C) ;- (EMAC) Receive Ressource Error Register +-AT91C_EMAC_STE EQU (0xFFFDC084) ;- (EMAC) SQE Test Error Register +-;- ========== Register definition for PDC_ADC peripheral ========== +-AT91C_ADC_PTSR EQU (0xFFFD8124) ;- (PDC_ADC) PDC Transfer Status Register +-AT91C_ADC_PTCR EQU (0xFFFD8120) ;- (PDC_ADC) PDC Transfer Control Register +-AT91C_ADC_TNPR EQU (0xFFFD8118) ;- (PDC_ADC) Transmit Next Pointer Register +-AT91C_ADC_TNCR EQU (0xFFFD811C) ;- (PDC_ADC) Transmit Next Counter Register +-AT91C_ADC_RNPR EQU (0xFFFD8110) ;- (PDC_ADC) Receive Next Pointer Register +-AT91C_ADC_RNCR EQU (0xFFFD8114) ;- (PDC_ADC) Receive Next Counter Register +-AT91C_ADC_RPR EQU (0xFFFD8100) ;- (PDC_ADC) Receive Pointer Register +-AT91C_ADC_TCR EQU (0xFFFD810C) ;- (PDC_ADC) Transmit Counter Register +-AT91C_ADC_TPR EQU (0xFFFD8108) ;- (PDC_ADC) Transmit Pointer Register +-AT91C_ADC_RCR EQU (0xFFFD8104) ;- (PDC_ADC) Receive Counter Register +-;- ========== Register definition for ADC peripheral ========== +-AT91C_ADC_CDR2 EQU (0xFFFD8038) ;- (ADC) ADC Channel Data Register 2 +-AT91C_ADC_CDR3 EQU (0xFFFD803C) ;- (ADC) ADC Channel Data Register 3 +-AT91C_ADC_CDR0 EQU (0xFFFD8030) ;- (ADC) ADC Channel Data Register 0 +-AT91C_ADC_CDR5 EQU (0xFFFD8044) ;- (ADC) ADC Channel Data Register 5 +-AT91C_ADC_CHDR EQU (0xFFFD8014) ;- (ADC) ADC Channel Disable Register +-AT91C_ADC_SR EQU (0xFFFD801C) ;- (ADC) ADC Status Register +-AT91C_ADC_CDR4 EQU (0xFFFD8040) ;- (ADC) ADC Channel Data Register 4 +-AT91C_ADC_CDR1 EQU (0xFFFD8034) ;- (ADC) ADC Channel Data Register 1 +-AT91C_ADC_LCDR EQU (0xFFFD8020) ;- (ADC) ADC Last Converted Data Register +-AT91C_ADC_IDR EQU (0xFFFD8028) ;- (ADC) ADC Interrupt Disable Register +-AT91C_ADC_CR EQU (0xFFFD8000) ;- (ADC) ADC Control Register +-AT91C_ADC_CDR7 EQU (0xFFFD804C) ;- (ADC) ADC Channel Data Register 7 +-AT91C_ADC_CDR6 EQU (0xFFFD8048) ;- (ADC) ADC Channel Data Register 6 +-AT91C_ADC_IER EQU (0xFFFD8024) ;- (ADC) ADC Interrupt Enable Register +-AT91C_ADC_CHER EQU (0xFFFD8010) ;- (ADC) ADC Channel Enable Register +-AT91C_ADC_CHSR EQU (0xFFFD8018) ;- (ADC) ADC Channel Status Register +-AT91C_ADC_MR EQU (0xFFFD8004) ;- (ADC) ADC Mode Register +-AT91C_ADC_IMR EQU (0xFFFD802C) ;- (ADC) ADC Interrupt Mask Register +- +-;- ***************************************************************************** +-;- PIO DEFINITIONS FOR AT91SAM7X256 +-;- ***************************************************************************** +-AT91C_PIO_PA0 EQU (1:SHL:0) ;- Pin Controlled by PA0 +-AT91C_PA0_RXD0 EQU (AT91C_PIO_PA0) ;- USART 0 Receive Data +-AT91C_PIO_PA1 EQU (1:SHL:1) ;- Pin Controlled by PA1 +-AT91C_PA1_TXD0 EQU (AT91C_PIO_PA1) ;- USART 0 Transmit Data +-AT91C_PIO_PA10 EQU (1:SHL:10) ;- Pin Controlled by PA10 +-AT91C_PA10_TWD EQU (AT91C_PIO_PA10) ;- TWI Two-wire Serial Data +-AT91C_PIO_PA11 EQU (1:SHL:11) ;- Pin Controlled by PA11 +-AT91C_PA11_TWCK EQU (AT91C_PIO_PA11) ;- TWI Two-wire Serial Clock +-AT91C_PIO_PA12 EQU (1:SHL:12) ;- Pin Controlled by PA12 +-AT91C_PA12_SPI0_NPCS0 EQU (AT91C_PIO_PA12) ;- SPI 0 Peripheral Chip Select 0 +-AT91C_PIO_PA13 EQU (1:SHL:13) ;- Pin Controlled by PA13 +-AT91C_PA13_SPI0_NPCS1 EQU (AT91C_PIO_PA13) ;- SPI 0 Peripheral Chip Select 1 +-AT91C_PA13_PCK1 EQU (AT91C_PIO_PA13) ;- PMC Programmable Clock Output 1 +-AT91C_PIO_PA14 EQU (1:SHL:14) ;- Pin Controlled by PA14 +-AT91C_PA14_SPI0_NPCS2 EQU (AT91C_PIO_PA14) ;- SPI 0 Peripheral Chip Select 2 +-AT91C_PA14_IRQ1 EQU (AT91C_PIO_PA14) ;- External Interrupt 1 +-AT91C_PIO_PA15 EQU (1:SHL:15) ;- Pin Controlled by PA15 +-AT91C_PA15_SPI0_NPCS3 EQU (AT91C_PIO_PA15) ;- SPI 0 Peripheral Chip Select 3 +-AT91C_PA15_TCLK2 EQU (AT91C_PIO_PA15) ;- Timer Counter 2 external clock input +-AT91C_PIO_PA16 EQU (1:SHL:16) ;- Pin Controlled by PA16 +-AT91C_PA16_SPI0_MISO EQU (AT91C_PIO_PA16) ;- SPI 0 Master In Slave +-AT91C_PIO_PA17 EQU (1:SHL:17) ;- Pin Controlled by PA17 +-AT91C_PA17_SPI0_MOSI EQU (AT91C_PIO_PA17) ;- SPI 0 Master Out Slave +-AT91C_PIO_PA18 EQU (1:SHL:18) ;- Pin Controlled by PA18 +-AT91C_PA18_SPI0_SPCK EQU (AT91C_PIO_PA18) ;- SPI 0 Serial Clock +-AT91C_PIO_PA19 EQU (1:SHL:19) ;- Pin Controlled by PA19 +-AT91C_PA19_CANRX EQU (AT91C_PIO_PA19) ;- CAN Receive +-AT91C_PIO_PA2 EQU (1:SHL:2) ;- Pin Controlled by PA2 +-AT91C_PA2_SCK0 EQU (AT91C_PIO_PA2) ;- USART 0 Serial Clock +-AT91C_PA2_SPI1_NPCS1 EQU (AT91C_PIO_PA2) ;- SPI 1 Peripheral Chip Select 1 +-AT91C_PIO_PA20 EQU (1:SHL:20) ;- Pin Controlled by PA20 +-AT91C_PA20_CANTX EQU (AT91C_PIO_PA20) ;- CAN Transmit +-AT91C_PIO_PA21 EQU (1:SHL:21) ;- Pin Controlled by PA21 +-AT91C_PA21_TF EQU (AT91C_PIO_PA21) ;- SSC Transmit Frame Sync +-AT91C_PA21_SPI1_NPCS0 EQU (AT91C_PIO_PA21) ;- SPI 1 Peripheral Chip Select 0 +-AT91C_PIO_PA22 EQU (1:SHL:22) ;- Pin Controlled by PA22 +-AT91C_PA22_TK EQU (AT91C_PIO_PA22) ;- SSC Transmit Clock +-AT91C_PA22_SPI1_SPCK EQU (AT91C_PIO_PA22) ;- SPI 1 Serial Clock +-AT91C_PIO_PA23 EQU (1:SHL:23) ;- Pin Controlled by PA23 +-AT91C_PA23_TD EQU (AT91C_PIO_PA23) ;- SSC Transmit data +-AT91C_PA23_SPI1_MOSI EQU (AT91C_PIO_PA23) ;- SPI 1 Master Out Slave +-AT91C_PIO_PA24 EQU (1:SHL:24) ;- Pin Controlled by PA24 +-AT91C_PA24_RD EQU (AT91C_PIO_PA24) ;- SSC Receive Data +-AT91C_PA24_SPI1_MISO EQU (AT91C_PIO_PA24) ;- SPI 1 Master In Slave +-AT91C_PIO_PA25 EQU (1:SHL:25) ;- Pin Controlled by PA25 +-AT91C_PA25_RK EQU (AT91C_PIO_PA25) ;- SSC Receive Clock +-AT91C_PA25_SPI1_NPCS1 EQU (AT91C_PIO_PA25) ;- SPI 1 Peripheral Chip Select 1 +-AT91C_PIO_PA26 EQU (1:SHL:26) ;- Pin Controlled by PA26 +-AT91C_PA26_RF EQU (AT91C_PIO_PA26) ;- SSC Receive Frame Sync +-AT91C_PA26_SPI1_NPCS2 EQU (AT91C_PIO_PA26) ;- SPI 1 Peripheral Chip Select 2 +-AT91C_PIO_PA27 EQU (1:SHL:27) ;- Pin Controlled by PA27 +-AT91C_PA27_DRXD EQU (AT91C_PIO_PA27) ;- DBGU Debug Receive Data +-AT91C_PA27_PCK3 EQU (AT91C_PIO_PA27) ;- PMC Programmable Clock Output 3 +-AT91C_PIO_PA28 EQU (1:SHL:28) ;- Pin Controlled by PA28 +-AT91C_PA28_DTXD EQU (AT91C_PIO_PA28) ;- DBGU Debug Transmit Data +-AT91C_PIO_PA29 EQU (1:SHL:29) ;- Pin Controlled by PA29 +-AT91C_PA29_FIQ EQU (AT91C_PIO_PA29) ;- AIC Fast Interrupt Input +-AT91C_PA29_SPI1_NPCS3 EQU (AT91C_PIO_PA29) ;- SPI 1 Peripheral Chip Select 3 +-AT91C_PIO_PA3 EQU (1:SHL:3) ;- Pin Controlled by PA3 +-AT91C_PA3_RTS0 EQU (AT91C_PIO_PA3) ;- USART 0 Ready To Send +-AT91C_PA3_SPI1_NPCS2 EQU (AT91C_PIO_PA3) ;- SPI 1 Peripheral Chip Select 2 +-AT91C_PIO_PA30 EQU (1:SHL:30) ;- Pin Controlled by PA30 +-AT91C_PA30_IRQ0 EQU (AT91C_PIO_PA30) ;- External Interrupt 0 +-AT91C_PA30_PCK2 EQU (AT91C_PIO_PA30) ;- PMC Programmable Clock Output 2 +-AT91C_PIO_PA4 EQU (1:SHL:4) ;- Pin Controlled by PA4 +-AT91C_PA4_CTS0 EQU (AT91C_PIO_PA4) ;- USART 0 Clear To Send +-AT91C_PA4_SPI1_NPCS3 EQU (AT91C_PIO_PA4) ;- SPI 1 Peripheral Chip Select 3 +-AT91C_PIO_PA5 EQU (1:SHL:5) ;- Pin Controlled by PA5 +-AT91C_PA5_RXD1 EQU (AT91C_PIO_PA5) ;- USART 1 Receive Data +-AT91C_PIO_PA6 EQU (1:SHL:6) ;- Pin Controlled by PA6 +-AT91C_PA6_TXD1 EQU (AT91C_PIO_PA6) ;- USART 1 Transmit Data +-AT91C_PIO_PA7 EQU (1:SHL:7) ;- Pin Controlled by PA7 +-AT91C_PA7_SCK1 EQU (AT91C_PIO_PA7) ;- USART 1 Serial Clock +-AT91C_PA7_SPI0_NPCS1 EQU (AT91C_PIO_PA7) ;- SPI 0 Peripheral Chip Select 1 +-AT91C_PIO_PA8 EQU (1:SHL:8) ;- Pin Controlled by PA8 +-AT91C_PA8_RTS1 EQU (AT91C_PIO_PA8) ;- USART 1 Ready To Send +-AT91C_PA8_SPI0_NPCS2 EQU (AT91C_PIO_PA8) ;- SPI 0 Peripheral Chip Select 2 +-AT91C_PIO_PA9 EQU (1:SHL:9) ;- Pin Controlled by PA9 +-AT91C_PA9_CTS1 EQU (AT91C_PIO_PA9) ;- USART 1 Clear To Send +-AT91C_PA9_SPI0_NPCS3 EQU (AT91C_PIO_PA9) ;- SPI 0 Peripheral Chip Select 3 +-AT91C_PIO_PB0 EQU (1:SHL:0) ;- Pin Controlled by PB0 +-AT91C_PB0_ETXCK_EREFCK EQU (AT91C_PIO_PB0) ;- Ethernet MAC Transmit Clock/Reference Clock +-AT91C_PB0_PCK0 EQU (AT91C_PIO_PB0) ;- PMC Programmable Clock Output 0 +-AT91C_PIO_PB1 EQU (1:SHL:1) ;- Pin Controlled by PB1 +-AT91C_PB1_ETXEN EQU (AT91C_PIO_PB1) ;- Ethernet MAC Transmit Enable +-AT91C_PIO_PB10 EQU (1:SHL:10) ;- Pin Controlled by PB10 +-AT91C_PB10_ETX2 EQU (AT91C_PIO_PB10) ;- Ethernet MAC Transmit Data 2 +-AT91C_PB10_SPI1_NPCS1 EQU (AT91C_PIO_PB10) ;- SPI 1 Peripheral Chip Select 1 +-AT91C_PIO_PB11 EQU (1:SHL:11) ;- Pin Controlled by PB11 +-AT91C_PB11_ETX3 EQU (AT91C_PIO_PB11) ;- Ethernet MAC Transmit Data 3 +-AT91C_PB11_SPI1_NPCS2 EQU (AT91C_PIO_PB11) ;- SPI 1 Peripheral Chip Select 2 +-AT91C_PIO_PB12 EQU (1:SHL:12) ;- Pin Controlled by PB12 +-AT91C_PB12_ETXER EQU (AT91C_PIO_PB12) ;- Ethernet MAC Transmikt Coding Error +-AT91C_PB12_TCLK0 EQU (AT91C_PIO_PB12) ;- Timer Counter 0 external clock input +-AT91C_PIO_PB13 EQU (1:SHL:13) ;- Pin Controlled by PB13 +-AT91C_PB13_ERX2 EQU (AT91C_PIO_PB13) ;- Ethernet MAC Receive Data 2 +-AT91C_PB13_SPI0_NPCS1 EQU (AT91C_PIO_PB13) ;- SPI 0 Peripheral Chip Select 1 +-AT91C_PIO_PB14 EQU (1:SHL:14) ;- Pin Controlled by PB14 +-AT91C_PB14_ERX3 EQU (AT91C_PIO_PB14) ;- Ethernet MAC Receive Data 3 +-AT91C_PB14_SPI0_NPCS2 EQU (AT91C_PIO_PB14) ;- SPI 0 Peripheral Chip Select 2 +-AT91C_PIO_PB15 EQU (1:SHL:15) ;- Pin Controlled by PB15 +-AT91C_PB15_ERXDV_ECRSDV EQU (AT91C_PIO_PB15) ;- Ethernet MAC Receive Data Valid +-AT91C_PIO_PB16 EQU (1:SHL:16) ;- Pin Controlled by PB16 +-AT91C_PB16_ECOL EQU (AT91C_PIO_PB16) ;- Ethernet MAC Collision Detected +-AT91C_PB16_SPI1_NPCS3 EQU (AT91C_PIO_PB16) ;- SPI 1 Peripheral Chip Select 3 +-AT91C_PIO_PB17 EQU (1:SHL:17) ;- Pin Controlled by PB17 +-AT91C_PB17_ERXCK EQU (AT91C_PIO_PB17) ;- Ethernet MAC Receive Clock +-AT91C_PB17_SPI0_NPCS3 EQU (AT91C_PIO_PB17) ;- SPI 0 Peripheral Chip Select 3 +-AT91C_PIO_PB18 EQU (1:SHL:18) ;- Pin Controlled by PB18 +-AT91C_PB18_EF100 EQU (AT91C_PIO_PB18) ;- Ethernet MAC Force 100 Mbits/sec +-AT91C_PB18_ADTRG EQU (AT91C_PIO_PB18) ;- ADC External Trigger +-AT91C_PIO_PB19 EQU (1:SHL:19) ;- Pin Controlled by PB19 +-AT91C_PB19_PWM0 EQU (AT91C_PIO_PB19) ;- PWM Channel 0 +-AT91C_PB19_TCLK1 EQU (AT91C_PIO_PB19) ;- Timer Counter 1 external clock input +-AT91C_PIO_PB2 EQU (1:SHL:2) ;- Pin Controlled by PB2 +-AT91C_PB2_ETX0 EQU (AT91C_PIO_PB2) ;- Ethernet MAC Transmit Data 0 +-AT91C_PIO_PB20 EQU (1:SHL:20) ;- Pin Controlled by PB20 +-AT91C_PB20_PWM1 EQU (AT91C_PIO_PB20) ;- PWM Channel 1 +-AT91C_PB20_PCK0 EQU (AT91C_PIO_PB20) ;- PMC Programmable Clock Output 0 +-AT91C_PIO_PB21 EQU (1:SHL:21) ;- Pin Controlled by PB21 +-AT91C_PB21_PWM2 EQU (AT91C_PIO_PB21) ;- PWM Channel 2 +-AT91C_PB21_PCK1 EQU (AT91C_PIO_PB21) ;- PMC Programmable Clock Output 1 +-AT91C_PIO_PB22 EQU (1:SHL:22) ;- Pin Controlled by PB22 +-AT91C_PB22_PWM3 EQU (AT91C_PIO_PB22) ;- PWM Channel 3 +-AT91C_PB22_PCK2 EQU (AT91C_PIO_PB22) ;- PMC Programmable Clock Output 2 +-AT91C_PIO_PB23 EQU (1:SHL:23) ;- Pin Controlled by PB23 +-AT91C_PB23_TIOA0 EQU (AT91C_PIO_PB23) ;- Timer Counter 0 Multipurpose Timer I/O Pin A +-AT91C_PB23_DCD1 EQU (AT91C_PIO_PB23) ;- USART 1 Data Carrier Detect +-AT91C_PIO_PB24 EQU (1:SHL:24) ;- Pin Controlled by PB24 +-AT91C_PB24_TIOB0 EQU (AT91C_PIO_PB24) ;- Timer Counter 0 Multipurpose Timer I/O Pin B +-AT91C_PB24_DSR1 EQU (AT91C_PIO_PB24) ;- USART 1 Data Set ready +-AT91C_PIO_PB25 EQU (1:SHL:25) ;- Pin Controlled by PB25 +-AT91C_PB25_TIOA1 EQU (AT91C_PIO_PB25) ;- Timer Counter 1 Multipurpose Timer I/O Pin A +-AT91C_PB25_DTR1 EQU (AT91C_PIO_PB25) ;- USART 1 Data Terminal ready +-AT91C_PIO_PB26 EQU (1:SHL:26) ;- Pin Controlled by PB26 +-AT91C_PB26_TIOB1 EQU (AT91C_PIO_PB26) ;- Timer Counter 1 Multipurpose Timer I/O Pin B +-AT91C_PB26_RI1 EQU (AT91C_PIO_PB26) ;- USART 1 Ring Indicator +-AT91C_PIO_PB27 EQU (1:SHL:27) ;- Pin Controlled by PB27 +-AT91C_PB27_TIOA2 EQU (AT91C_PIO_PB27) ;- Timer Counter 2 Multipurpose Timer I/O Pin A +-AT91C_PB27_PWM0 EQU (AT91C_PIO_PB27) ;- PWM Channel 0 +-AT91C_PIO_PB28 EQU (1:SHL:28) ;- Pin Controlled by PB28 +-AT91C_PB28_TIOB2 EQU (AT91C_PIO_PB28) ;- Timer Counter 2 Multipurpose Timer I/O Pin B +-AT91C_PB28_PWM1 EQU (AT91C_PIO_PB28) ;- PWM Channel 1 +-AT91C_PIO_PB29 EQU (1:SHL:29) ;- Pin Controlled by PB29 +-AT91C_PB29_PCK1 EQU (AT91C_PIO_PB29) ;- PMC Programmable Clock Output 1 +-AT91C_PB29_PWM2 EQU (AT91C_PIO_PB29) ;- PWM Channel 2 +-AT91C_PIO_PB3 EQU (1:SHL:3) ;- Pin Controlled by PB3 +-AT91C_PB3_ETX1 EQU (AT91C_PIO_PB3) ;- Ethernet MAC Transmit Data 1 +-AT91C_PIO_PB30 EQU (1:SHL:30) ;- Pin Controlled by PB30 +-AT91C_PB30_PCK2 EQU (AT91C_PIO_PB30) ;- PMC Programmable Clock Output 2 +-AT91C_PB30_PWM3 EQU (AT91C_PIO_PB30) ;- PWM Channel 3 +-AT91C_PIO_PB4 EQU (1:SHL:4) ;- Pin Controlled by PB4 +-AT91C_PB4_ECRS EQU (AT91C_PIO_PB4) ;- Ethernet MAC Carrier Sense/Carrier Sense and Data Valid +-AT91C_PIO_PB5 EQU (1:SHL:5) ;- Pin Controlled by PB5 +-AT91C_PB5_ERX0 EQU (AT91C_PIO_PB5) ;- Ethernet MAC Receive Data 0 +-AT91C_PIO_PB6 EQU (1:SHL:6) ;- Pin Controlled by PB6 +-AT91C_PB6_ERX1 EQU (AT91C_PIO_PB6) ;- Ethernet MAC Receive Data 1 +-AT91C_PIO_PB7 EQU (1:SHL:7) ;- Pin Controlled by PB7 +-AT91C_PB7_ERXER EQU (AT91C_PIO_PB7) ;- Ethernet MAC Receive Error +-AT91C_PIO_PB8 EQU (1:SHL:8) ;- Pin Controlled by PB8 +-AT91C_PB8_EMDC EQU (AT91C_PIO_PB8) ;- Ethernet MAC Management Data Clock +-AT91C_PIO_PB9 EQU (1:SHL:9) ;- Pin Controlled by PB9 +-AT91C_PB9_EMDIO EQU (AT91C_PIO_PB9) ;- Ethernet MAC Management Data Input/Output +- +-;- ***************************************************************************** +-;- PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 +-;- ***************************************************************************** +-AT91C_ID_FIQ EQU ( 0) ;- Advanced Interrupt Controller (FIQ) +-AT91C_ID_SYS EQU ( 1) ;- System Peripheral +-AT91C_ID_PIOA EQU ( 2) ;- Parallel IO Controller A +-AT91C_ID_PIOB EQU ( 3) ;- Parallel IO Controller B +-AT91C_ID_SPI0 EQU ( 4) ;- Serial Peripheral Interface 0 +-AT91C_ID_SPI1 EQU ( 5) ;- Serial Peripheral Interface 1 +-AT91C_ID_US0 EQU ( 6) ;- USART 0 +-AT91C_ID_US1 EQU ( 7) ;- USART 1 +-AT91C_ID_SSC EQU ( 8) ;- Serial Synchronous Controller +-AT91C_ID_TWI EQU ( 9) ;- Two-Wire Interface +-AT91C_ID_PWMC EQU (10) ;- PWM Controller +-AT91C_ID_UDP EQU (11) ;- USB Device Port +-AT91C_ID_TC0 EQU (12) ;- Timer Counter 0 +-AT91C_ID_TC1 EQU (13) ;- Timer Counter 1 +-AT91C_ID_TC2 EQU (14) ;- Timer Counter 2 +-AT91C_ID_CAN EQU (15) ;- Control Area Network Controller +-AT91C_ID_EMAC EQU (16) ;- Ethernet MAC +-AT91C_ID_ADC EQU (17) ;- Analog-to-Digital Converter +-AT91C_ID_18_Reserved EQU (18) ;- Reserved +-AT91C_ID_19_Reserved EQU (19) ;- Reserved +-AT91C_ID_20_Reserved EQU (20) ;- Reserved +-AT91C_ID_21_Reserved EQU (21) ;- Reserved +-AT91C_ID_22_Reserved EQU (22) ;- Reserved +-AT91C_ID_23_Reserved EQU (23) ;- Reserved +-AT91C_ID_24_Reserved EQU (24) ;- Reserved +-AT91C_ID_25_Reserved EQU (25) ;- Reserved +-AT91C_ID_26_Reserved EQU (26) ;- Reserved +-AT91C_ID_27_Reserved EQU (27) ;- Reserved +-AT91C_ID_28_Reserved EQU (28) ;- Reserved +-AT91C_ID_29_Reserved EQU (29) ;- Reserved +-AT91C_ID_IRQ0 EQU (30) ;- Advanced Interrupt Controller (IRQ0) +-AT91C_ID_IRQ1 EQU (31) ;- Advanced Interrupt Controller (IRQ1) +-AT91C_ALL_INT EQU (0xC003FFFF) ;- ALL VALID INTERRUPTS +- +-;- ***************************************************************************** +-;- BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 +-;- ***************************************************************************** +-AT91C_BASE_SYS EQU (0xFFFFF000) ;- (SYS) Base Address +-AT91C_BASE_AIC EQU (0xFFFFF000) ;- (AIC) Base Address +-AT91C_BASE_PDC_DBGU EQU (0xFFFFF300) ;- (PDC_DBGU) Base Address +-AT91C_BASE_DBGU EQU (0xFFFFF200) ;- (DBGU) Base Address +-AT91C_BASE_PIOA EQU (0xFFFFF400) ;- (PIOA) Base Address +-AT91C_BASE_PIOB EQU (0xFFFFF600) ;- (PIOB) Base Address +-AT91C_BASE_CKGR EQU (0xFFFFFC20) ;- (CKGR) Base Address +-AT91C_BASE_PMC EQU (0xFFFFFC00) ;- (PMC) Base Address +-AT91C_BASE_RSTC EQU (0xFFFFFD00) ;- (RSTC) Base Address +-AT91C_BASE_RTTC EQU (0xFFFFFD20) ;- (RTTC) Base Address +-AT91C_BASE_PITC EQU (0xFFFFFD30) ;- (PITC) Base Address +-AT91C_BASE_WDTC EQU (0xFFFFFD40) ;- (WDTC) Base Address +-AT91C_BASE_VREG EQU (0xFFFFFD60) ;- (VREG) Base Address +-AT91C_BASE_MC EQU (0xFFFFFF00) ;- (MC) Base Address +-AT91C_BASE_PDC_SPI1 EQU (0xFFFE4100) ;- (PDC_SPI1) Base Address +-AT91C_BASE_SPI1 EQU (0xFFFE4000) ;- (SPI1) Base Address +-AT91C_BASE_PDC_SPI0 EQU (0xFFFE0100) ;- (PDC_SPI0) Base Address +-AT91C_BASE_SPI0 EQU (0xFFFE0000) ;- (SPI0) Base Address +-AT91C_BASE_PDC_US1 EQU (0xFFFC4100) ;- (PDC_US1) Base Address +-AT91C_BASE_US1 EQU (0xFFFC4000) ;- (US1) Base Address +-AT91C_BASE_PDC_US0 EQU (0xFFFC0100) ;- (PDC_US0) Base Address +-AT91C_BASE_US0 EQU (0xFFFC0000) ;- (US0) Base Address +-AT91C_BASE_PDC_SSC EQU (0xFFFD4100) ;- (PDC_SSC) Base Address +-AT91C_BASE_SSC EQU (0xFFFD4000) ;- (SSC) Base Address +-AT91C_BASE_TWI EQU (0xFFFB8000) ;- (TWI) Base Address +-AT91C_BASE_PWMC_CH3 EQU (0xFFFCC260) ;- (PWMC_CH3) Base Address +-AT91C_BASE_PWMC_CH2 EQU (0xFFFCC240) ;- (PWMC_CH2) Base Address +-AT91C_BASE_PWMC_CH1 EQU (0xFFFCC220) ;- (PWMC_CH1) Base Address +-AT91C_BASE_PWMC_CH0 EQU (0xFFFCC200) ;- (PWMC_CH0) Base Address +-AT91C_BASE_PWMC EQU (0xFFFCC000) ;- (PWMC) Base Address +-AT91C_BASE_UDP EQU (0xFFFB0000) ;- (UDP) Base Address +-AT91C_BASE_TC0 EQU (0xFFFA0000) ;- (TC0) Base Address +-AT91C_BASE_TC1 EQU (0xFFFA0040) ;- (TC1) Base Address +-AT91C_BASE_TC2 EQU (0xFFFA0080) ;- (TC2) Base Address +-AT91C_BASE_TCB EQU (0xFFFA0000) ;- (TCB) Base Address +-AT91C_BASE_CAN_MB0 EQU (0xFFFD0200) ;- (CAN_MB0) Base Address +-AT91C_BASE_CAN_MB1 EQU (0xFFFD0220) ;- (CAN_MB1) Base Address +-AT91C_BASE_CAN_MB2 EQU (0xFFFD0240) ;- (CAN_MB2) Base Address +-AT91C_BASE_CAN_MB3 EQU (0xFFFD0260) ;- (CAN_MB3) Base Address +-AT91C_BASE_CAN_MB4 EQU (0xFFFD0280) ;- (CAN_MB4) Base Address +-AT91C_BASE_CAN_MB5 EQU (0xFFFD02A0) ;- (CAN_MB5) Base Address +-AT91C_BASE_CAN_MB6 EQU (0xFFFD02C0) ;- (CAN_MB6) Base Address +-AT91C_BASE_CAN_MB7 EQU (0xFFFD02E0) ;- (CAN_MB7) Base Address +-AT91C_BASE_CAN EQU (0xFFFD0000) ;- (CAN) Base Address +-AT91C_BASE_EMAC EQU (0xFFFDC000) ;- (EMAC) Base Address +-AT91C_BASE_PDC_ADC EQU (0xFFFD8100) ;- (PDC_ADC) Base Address +-AT91C_BASE_ADC EQU (0xFFFD8000) ;- (ADC) Base Address +- +-;- ***************************************************************************** +-;- MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 +-;- ***************************************************************************** +-;- ISRAM +-AT91C_ISRAM EQU (0x00200000) ;- Internal SRAM base address +-AT91C_ISRAM_SIZE EQU (0x00010000) ;- Internal SRAM size in byte (64 Kbytes) +-;- IFLASH +-AT91C_IFLASH EQU (0x00100000) ;- Internal FLASH base address +-AT91C_IFLASH_SIZE EQU (0x00040000) ;- Internal FLASH size in byte (256 Kbytes) +-AT91C_IFLASH_PAGE_SIZE EQU (256) ;- Internal FLASH Page Size: 256 bytes +-AT91C_IFLASH_LOCK_REGION_SIZE EQU (16384) ;- Internal FLASH Lock Region Size: 16 Kbytes +-AT91C_IFLASH_NB_OF_PAGES EQU (1024) ;- Internal FLASH Number of Pages: 1024 bytes +-AT91C_IFLASH_NB_OF_LOCK_BITS EQU (16) ;- Internal FLASH Number of Lock Bits: 16 bytes +- +- +- END +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.rdf b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.rdf +deleted file mode 100644 +index 7668f5b4f1..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.rdf ++++ /dev/null +@@ -1,4704 +0,0 @@ +-# ---------------------------------------------------------------------------- +-# ATMEL Microcontroller Software Support - ROUSSET - +-# ---------------------------------------------------------------------------- +-# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-# DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h +-# Object : AT91SAM7X256 definitions +-# Generated : AT91 SW Application Group 11/02/2005 (15:17:24) +-# +-# CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// +-# CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// +-# CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// +-# CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// +-# CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// +-# CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// +-# CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// +-# CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// +-# CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// +-# CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// +-# CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// +-# CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// +-# CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// +-# CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// +-# CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// +-# CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// +-# CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// +-# CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// +-# CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// +-# CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// +-# CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// +-# CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// +-# CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// +-# ---------------------------------------------------------------------------- +- +-rdf.version=1 +- +-~sysinclude=arm_default.rdf +-~sysinclude=arm_status.rdf +-# ========== Register definition for SYS peripheral ========== +-# ========== Register definition for AIC peripheral ========== +-AT91C_AIC_IVR.name="AT91C_AIC_IVR" +-AT91C_AIC_IVR.description="IRQ Vector Register" +-AT91C_AIC_IVR.helpkey="IRQ Vector Register" +-AT91C_AIC_IVR.access=memorymapped +-AT91C_AIC_IVR.address=0xFFFFF100 +-AT91C_AIC_IVR.width=32 +-AT91C_AIC_IVR.byteEndian=little +-AT91C_AIC_IVR.permission.write=none +-AT91C_AIC_SMR.name="AT91C_AIC_SMR" +-AT91C_AIC_SMR.description="Source Mode Register" +-AT91C_AIC_SMR.helpkey="Source Mode Register" +-AT91C_AIC_SMR.access=memorymapped +-AT91C_AIC_SMR.address=0xFFFFF000 +-AT91C_AIC_SMR.width=32 +-AT91C_AIC_SMR.byteEndian=little +-AT91C_AIC_FVR.name="AT91C_AIC_FVR" +-AT91C_AIC_FVR.description="FIQ Vector Register" +-AT91C_AIC_FVR.helpkey="FIQ Vector Register" +-AT91C_AIC_FVR.access=memorymapped +-AT91C_AIC_FVR.address=0xFFFFF104 +-AT91C_AIC_FVR.width=32 +-AT91C_AIC_FVR.byteEndian=little +-AT91C_AIC_FVR.permission.write=none +-AT91C_AIC_DCR.name="AT91C_AIC_DCR" +-AT91C_AIC_DCR.description="Debug Control Register (Protect)" +-AT91C_AIC_DCR.helpkey="Debug Control Register (Protect)" +-AT91C_AIC_DCR.access=memorymapped +-AT91C_AIC_DCR.address=0xFFFFF138 +-AT91C_AIC_DCR.width=32 +-AT91C_AIC_DCR.byteEndian=little +-AT91C_AIC_EOICR.name="AT91C_AIC_EOICR" +-AT91C_AIC_EOICR.description="End of Interrupt Command Register" +-AT91C_AIC_EOICR.helpkey="End of Interrupt Command Register" +-AT91C_AIC_EOICR.access=memorymapped +-AT91C_AIC_EOICR.address=0xFFFFF130 +-AT91C_AIC_EOICR.width=32 +-AT91C_AIC_EOICR.byteEndian=little +-AT91C_AIC_EOICR.type=enum +-AT91C_AIC_EOICR.enum.0.name=*** Write only *** +-AT91C_AIC_EOICR.enum.1.name=Error +-AT91C_AIC_SVR.name="AT91C_AIC_SVR" +-AT91C_AIC_SVR.description="Source Vector Register" +-AT91C_AIC_SVR.helpkey="Source Vector Register" +-AT91C_AIC_SVR.access=memorymapped +-AT91C_AIC_SVR.address=0xFFFFF080 +-AT91C_AIC_SVR.width=32 +-AT91C_AIC_SVR.byteEndian=little +-AT91C_AIC_FFSR.name="AT91C_AIC_FFSR" +-AT91C_AIC_FFSR.description="Fast Forcing Status Register" +-AT91C_AIC_FFSR.helpkey="Fast Forcing Status Register" +-AT91C_AIC_FFSR.access=memorymapped +-AT91C_AIC_FFSR.address=0xFFFFF148 +-AT91C_AIC_FFSR.width=32 +-AT91C_AIC_FFSR.byteEndian=little +-AT91C_AIC_FFSR.permission.write=none +-AT91C_AIC_ICCR.name="AT91C_AIC_ICCR" +-AT91C_AIC_ICCR.description="Interrupt Clear Command Register" +-AT91C_AIC_ICCR.helpkey="Interrupt Clear Command Register" +-AT91C_AIC_ICCR.access=memorymapped +-AT91C_AIC_ICCR.address=0xFFFFF128 +-AT91C_AIC_ICCR.width=32 +-AT91C_AIC_ICCR.byteEndian=little +-AT91C_AIC_ICCR.type=enum +-AT91C_AIC_ICCR.enum.0.name=*** Write only *** +-AT91C_AIC_ICCR.enum.1.name=Error +-AT91C_AIC_ISR.name="AT91C_AIC_ISR" +-AT91C_AIC_ISR.description="Interrupt Status Register" +-AT91C_AIC_ISR.helpkey="Interrupt Status Register" +-AT91C_AIC_ISR.access=memorymapped +-AT91C_AIC_ISR.address=0xFFFFF108 +-AT91C_AIC_ISR.width=32 +-AT91C_AIC_ISR.byteEndian=little +-AT91C_AIC_ISR.permission.write=none +-AT91C_AIC_IMR.name="AT91C_AIC_IMR" +-AT91C_AIC_IMR.description="Interrupt Mask Register" +-AT91C_AIC_IMR.helpkey="Interrupt Mask Register" +-AT91C_AIC_IMR.access=memorymapped +-AT91C_AIC_IMR.address=0xFFFFF110 +-AT91C_AIC_IMR.width=32 +-AT91C_AIC_IMR.byteEndian=little +-AT91C_AIC_IMR.permission.write=none +-AT91C_AIC_IPR.name="AT91C_AIC_IPR" +-AT91C_AIC_IPR.description="Interrupt Pending Register" +-AT91C_AIC_IPR.helpkey="Interrupt Pending Register" +-AT91C_AIC_IPR.access=memorymapped +-AT91C_AIC_IPR.address=0xFFFFF10C +-AT91C_AIC_IPR.width=32 +-AT91C_AIC_IPR.byteEndian=little +-AT91C_AIC_IPR.permission.write=none +-AT91C_AIC_FFER.name="AT91C_AIC_FFER" +-AT91C_AIC_FFER.description="Fast Forcing Enable Register" +-AT91C_AIC_FFER.helpkey="Fast Forcing Enable Register" +-AT91C_AIC_FFER.access=memorymapped +-AT91C_AIC_FFER.address=0xFFFFF140 +-AT91C_AIC_FFER.width=32 +-AT91C_AIC_FFER.byteEndian=little +-AT91C_AIC_FFER.type=enum +-AT91C_AIC_FFER.enum.0.name=*** Write only *** +-AT91C_AIC_FFER.enum.1.name=Error +-AT91C_AIC_IECR.name="AT91C_AIC_IECR" +-AT91C_AIC_IECR.description="Interrupt Enable Command Register" +-AT91C_AIC_IECR.helpkey="Interrupt Enable Command Register" +-AT91C_AIC_IECR.access=memorymapped +-AT91C_AIC_IECR.address=0xFFFFF120 +-AT91C_AIC_IECR.width=32 +-AT91C_AIC_IECR.byteEndian=little +-AT91C_AIC_IECR.type=enum +-AT91C_AIC_IECR.enum.0.name=*** Write only *** +-AT91C_AIC_IECR.enum.1.name=Error +-AT91C_AIC_ISCR.name="AT91C_AIC_ISCR" +-AT91C_AIC_ISCR.description="Interrupt Set Command Register" +-AT91C_AIC_ISCR.helpkey="Interrupt Set Command Register" +-AT91C_AIC_ISCR.access=memorymapped +-AT91C_AIC_ISCR.address=0xFFFFF12C +-AT91C_AIC_ISCR.width=32 +-AT91C_AIC_ISCR.byteEndian=little +-AT91C_AIC_ISCR.type=enum +-AT91C_AIC_ISCR.enum.0.name=*** Write only *** +-AT91C_AIC_ISCR.enum.1.name=Error +-AT91C_AIC_FFDR.name="AT91C_AIC_FFDR" +-AT91C_AIC_FFDR.description="Fast Forcing Disable Register" +-AT91C_AIC_FFDR.helpkey="Fast Forcing Disable Register" +-AT91C_AIC_FFDR.access=memorymapped +-AT91C_AIC_FFDR.address=0xFFFFF144 +-AT91C_AIC_FFDR.width=32 +-AT91C_AIC_FFDR.byteEndian=little +-AT91C_AIC_FFDR.type=enum +-AT91C_AIC_FFDR.enum.0.name=*** Write only *** +-AT91C_AIC_FFDR.enum.1.name=Error +-AT91C_AIC_CISR.name="AT91C_AIC_CISR" +-AT91C_AIC_CISR.description="Core Interrupt Status Register" +-AT91C_AIC_CISR.helpkey="Core Interrupt Status Register" +-AT91C_AIC_CISR.access=memorymapped +-AT91C_AIC_CISR.address=0xFFFFF114 +-AT91C_AIC_CISR.width=32 +-AT91C_AIC_CISR.byteEndian=little +-AT91C_AIC_CISR.permission.write=none +-AT91C_AIC_IDCR.name="AT91C_AIC_IDCR" +-AT91C_AIC_IDCR.description="Interrupt Disable Command Register" +-AT91C_AIC_IDCR.helpkey="Interrupt Disable Command Register" +-AT91C_AIC_IDCR.access=memorymapped +-AT91C_AIC_IDCR.address=0xFFFFF124 +-AT91C_AIC_IDCR.width=32 +-AT91C_AIC_IDCR.byteEndian=little +-AT91C_AIC_IDCR.type=enum +-AT91C_AIC_IDCR.enum.0.name=*** Write only *** +-AT91C_AIC_IDCR.enum.1.name=Error +-AT91C_AIC_SPU.name="AT91C_AIC_SPU" +-AT91C_AIC_SPU.description="Spurious Vector Register" +-AT91C_AIC_SPU.helpkey="Spurious Vector Register" +-AT91C_AIC_SPU.access=memorymapped +-AT91C_AIC_SPU.address=0xFFFFF134 +-AT91C_AIC_SPU.width=32 +-AT91C_AIC_SPU.byteEndian=little +-# ========== Register definition for PDC_DBGU peripheral ========== +-AT91C_DBGU_TCR.name="AT91C_DBGU_TCR" +-AT91C_DBGU_TCR.description="Transmit Counter Register" +-AT91C_DBGU_TCR.helpkey="Transmit Counter Register" +-AT91C_DBGU_TCR.access=memorymapped +-AT91C_DBGU_TCR.address=0xFFFFF30C +-AT91C_DBGU_TCR.width=32 +-AT91C_DBGU_TCR.byteEndian=little +-AT91C_DBGU_RNPR.name="AT91C_DBGU_RNPR" +-AT91C_DBGU_RNPR.description="Receive Next Pointer Register" +-AT91C_DBGU_RNPR.helpkey="Receive Next Pointer Register" +-AT91C_DBGU_RNPR.access=memorymapped +-AT91C_DBGU_RNPR.address=0xFFFFF310 +-AT91C_DBGU_RNPR.width=32 +-AT91C_DBGU_RNPR.byteEndian=little +-AT91C_DBGU_TNPR.name="AT91C_DBGU_TNPR" +-AT91C_DBGU_TNPR.description="Transmit Next Pointer Register" +-AT91C_DBGU_TNPR.helpkey="Transmit Next Pointer Register" +-AT91C_DBGU_TNPR.access=memorymapped +-AT91C_DBGU_TNPR.address=0xFFFFF318 +-AT91C_DBGU_TNPR.width=32 +-AT91C_DBGU_TNPR.byteEndian=little +-AT91C_DBGU_TPR.name="AT91C_DBGU_TPR" +-AT91C_DBGU_TPR.description="Transmit Pointer Register" +-AT91C_DBGU_TPR.helpkey="Transmit Pointer Register" +-AT91C_DBGU_TPR.access=memorymapped +-AT91C_DBGU_TPR.address=0xFFFFF308 +-AT91C_DBGU_TPR.width=32 +-AT91C_DBGU_TPR.byteEndian=little +-AT91C_DBGU_RPR.name="AT91C_DBGU_RPR" +-AT91C_DBGU_RPR.description="Receive Pointer Register" +-AT91C_DBGU_RPR.helpkey="Receive Pointer Register" +-AT91C_DBGU_RPR.access=memorymapped +-AT91C_DBGU_RPR.address=0xFFFFF300 +-AT91C_DBGU_RPR.width=32 +-AT91C_DBGU_RPR.byteEndian=little +-AT91C_DBGU_RCR.name="AT91C_DBGU_RCR" +-AT91C_DBGU_RCR.description="Receive Counter Register" +-AT91C_DBGU_RCR.helpkey="Receive Counter Register" +-AT91C_DBGU_RCR.access=memorymapped +-AT91C_DBGU_RCR.address=0xFFFFF304 +-AT91C_DBGU_RCR.width=32 +-AT91C_DBGU_RCR.byteEndian=little +-AT91C_DBGU_RNCR.name="AT91C_DBGU_RNCR" +-AT91C_DBGU_RNCR.description="Receive Next Counter Register" +-AT91C_DBGU_RNCR.helpkey="Receive Next Counter Register" +-AT91C_DBGU_RNCR.access=memorymapped +-AT91C_DBGU_RNCR.address=0xFFFFF314 +-AT91C_DBGU_RNCR.width=32 +-AT91C_DBGU_RNCR.byteEndian=little +-AT91C_DBGU_PTCR.name="AT91C_DBGU_PTCR" +-AT91C_DBGU_PTCR.description="PDC Transfer Control Register" +-AT91C_DBGU_PTCR.helpkey="PDC Transfer Control Register" +-AT91C_DBGU_PTCR.access=memorymapped +-AT91C_DBGU_PTCR.address=0xFFFFF320 +-AT91C_DBGU_PTCR.width=32 +-AT91C_DBGU_PTCR.byteEndian=little +-AT91C_DBGU_PTCR.type=enum +-AT91C_DBGU_PTCR.enum.0.name=*** Write only *** +-AT91C_DBGU_PTCR.enum.1.name=Error +-AT91C_DBGU_PTSR.name="AT91C_DBGU_PTSR" +-AT91C_DBGU_PTSR.description="PDC Transfer Status Register" +-AT91C_DBGU_PTSR.helpkey="PDC Transfer Status Register" +-AT91C_DBGU_PTSR.access=memorymapped +-AT91C_DBGU_PTSR.address=0xFFFFF324 +-AT91C_DBGU_PTSR.width=32 +-AT91C_DBGU_PTSR.byteEndian=little +-AT91C_DBGU_PTSR.permission.write=none +-AT91C_DBGU_TNCR.name="AT91C_DBGU_TNCR" +-AT91C_DBGU_TNCR.description="Transmit Next Counter Register" +-AT91C_DBGU_TNCR.helpkey="Transmit Next Counter Register" +-AT91C_DBGU_TNCR.access=memorymapped +-AT91C_DBGU_TNCR.address=0xFFFFF31C +-AT91C_DBGU_TNCR.width=32 +-AT91C_DBGU_TNCR.byteEndian=little +-# ========== Register definition for DBGU peripheral ========== +-AT91C_DBGU_EXID.name="AT91C_DBGU_EXID" +-AT91C_DBGU_EXID.description="Chip ID Extension Register" +-AT91C_DBGU_EXID.helpkey="Chip ID Extension Register" +-AT91C_DBGU_EXID.access=memorymapped +-AT91C_DBGU_EXID.address=0xFFFFF244 +-AT91C_DBGU_EXID.width=32 +-AT91C_DBGU_EXID.byteEndian=little +-AT91C_DBGU_EXID.permission.write=none +-AT91C_DBGU_BRGR.name="AT91C_DBGU_BRGR" +-AT91C_DBGU_BRGR.description="Baud Rate Generator Register" +-AT91C_DBGU_BRGR.helpkey="Baud Rate Generator Register" +-AT91C_DBGU_BRGR.access=memorymapped +-AT91C_DBGU_BRGR.address=0xFFFFF220 +-AT91C_DBGU_BRGR.width=32 +-AT91C_DBGU_BRGR.byteEndian=little +-AT91C_DBGU_IDR.name="AT91C_DBGU_IDR" +-AT91C_DBGU_IDR.description="Interrupt Disable Register" +-AT91C_DBGU_IDR.helpkey="Interrupt Disable Register" +-AT91C_DBGU_IDR.access=memorymapped +-AT91C_DBGU_IDR.address=0xFFFFF20C +-AT91C_DBGU_IDR.width=32 +-AT91C_DBGU_IDR.byteEndian=little +-AT91C_DBGU_IDR.type=enum +-AT91C_DBGU_IDR.enum.0.name=*** Write only *** +-AT91C_DBGU_IDR.enum.1.name=Error +-AT91C_DBGU_CSR.name="AT91C_DBGU_CSR" +-AT91C_DBGU_CSR.description="Channel Status Register" +-AT91C_DBGU_CSR.helpkey="Channel Status Register" +-AT91C_DBGU_CSR.access=memorymapped +-AT91C_DBGU_CSR.address=0xFFFFF214 +-AT91C_DBGU_CSR.width=32 +-AT91C_DBGU_CSR.byteEndian=little +-AT91C_DBGU_CSR.permission.write=none +-AT91C_DBGU_CIDR.name="AT91C_DBGU_CIDR" +-AT91C_DBGU_CIDR.description="Chip ID Register" +-AT91C_DBGU_CIDR.helpkey="Chip ID Register" +-AT91C_DBGU_CIDR.access=memorymapped +-AT91C_DBGU_CIDR.address=0xFFFFF240 +-AT91C_DBGU_CIDR.width=32 +-AT91C_DBGU_CIDR.byteEndian=little +-AT91C_DBGU_CIDR.permission.write=none +-AT91C_DBGU_MR.name="AT91C_DBGU_MR" +-AT91C_DBGU_MR.description="Mode Register" +-AT91C_DBGU_MR.helpkey="Mode Register" +-AT91C_DBGU_MR.access=memorymapped +-AT91C_DBGU_MR.address=0xFFFFF204 +-AT91C_DBGU_MR.width=32 +-AT91C_DBGU_MR.byteEndian=little +-AT91C_DBGU_IMR.name="AT91C_DBGU_IMR" +-AT91C_DBGU_IMR.description="Interrupt Mask Register" +-AT91C_DBGU_IMR.helpkey="Interrupt Mask Register" +-AT91C_DBGU_IMR.access=memorymapped +-AT91C_DBGU_IMR.address=0xFFFFF210 +-AT91C_DBGU_IMR.width=32 +-AT91C_DBGU_IMR.byteEndian=little +-AT91C_DBGU_IMR.permission.write=none +-AT91C_DBGU_CR.name="AT91C_DBGU_CR" +-AT91C_DBGU_CR.description="Control Register" +-AT91C_DBGU_CR.helpkey="Control Register" +-AT91C_DBGU_CR.access=memorymapped +-AT91C_DBGU_CR.address=0xFFFFF200 +-AT91C_DBGU_CR.width=32 +-AT91C_DBGU_CR.byteEndian=little +-AT91C_DBGU_CR.type=enum +-AT91C_DBGU_CR.enum.0.name=*** Write only *** +-AT91C_DBGU_CR.enum.1.name=Error +-AT91C_DBGU_FNTR.name="AT91C_DBGU_FNTR" +-AT91C_DBGU_FNTR.description="Force NTRST Register" +-AT91C_DBGU_FNTR.helpkey="Force NTRST Register" +-AT91C_DBGU_FNTR.access=memorymapped +-AT91C_DBGU_FNTR.address=0xFFFFF248 +-AT91C_DBGU_FNTR.width=32 +-AT91C_DBGU_FNTR.byteEndian=little +-AT91C_DBGU_THR.name="AT91C_DBGU_THR" +-AT91C_DBGU_THR.description="Transmitter Holding Register" +-AT91C_DBGU_THR.helpkey="Transmitter Holding Register" +-AT91C_DBGU_THR.access=memorymapped +-AT91C_DBGU_THR.address=0xFFFFF21C +-AT91C_DBGU_THR.width=32 +-AT91C_DBGU_THR.byteEndian=little +-AT91C_DBGU_THR.type=enum +-AT91C_DBGU_THR.enum.0.name=*** Write only *** +-AT91C_DBGU_THR.enum.1.name=Error +-AT91C_DBGU_RHR.name="AT91C_DBGU_RHR" +-AT91C_DBGU_RHR.description="Receiver Holding Register" +-AT91C_DBGU_RHR.helpkey="Receiver Holding Register" +-AT91C_DBGU_RHR.access=memorymapped +-AT91C_DBGU_RHR.address=0xFFFFF218 +-AT91C_DBGU_RHR.width=32 +-AT91C_DBGU_RHR.byteEndian=little +-AT91C_DBGU_RHR.permission.write=none +-AT91C_DBGU_IER.name="AT91C_DBGU_IER" +-AT91C_DBGU_IER.description="Interrupt Enable Register" +-AT91C_DBGU_IER.helpkey="Interrupt Enable Register" +-AT91C_DBGU_IER.access=memorymapped +-AT91C_DBGU_IER.address=0xFFFFF208 +-AT91C_DBGU_IER.width=32 +-AT91C_DBGU_IER.byteEndian=little +-AT91C_DBGU_IER.type=enum +-AT91C_DBGU_IER.enum.0.name=*** Write only *** +-AT91C_DBGU_IER.enum.1.name=Error +-# ========== Register definition for PIOA peripheral ========== +-AT91C_PIOA_ODR.name="AT91C_PIOA_ODR" +-AT91C_PIOA_ODR.description="Output Disable Registerr" +-AT91C_PIOA_ODR.helpkey="Output Disable Registerr" +-AT91C_PIOA_ODR.access=memorymapped +-AT91C_PIOA_ODR.address=0xFFFFF414 +-AT91C_PIOA_ODR.width=32 +-AT91C_PIOA_ODR.byteEndian=little +-AT91C_PIOA_ODR.type=enum +-AT91C_PIOA_ODR.enum.0.name=*** Write only *** +-AT91C_PIOA_ODR.enum.1.name=Error +-AT91C_PIOA_SODR.name="AT91C_PIOA_SODR" +-AT91C_PIOA_SODR.description="Set Output Data Register" +-AT91C_PIOA_SODR.helpkey="Set Output Data Register" +-AT91C_PIOA_SODR.access=memorymapped +-AT91C_PIOA_SODR.address=0xFFFFF430 +-AT91C_PIOA_SODR.width=32 +-AT91C_PIOA_SODR.byteEndian=little +-AT91C_PIOA_SODR.type=enum +-AT91C_PIOA_SODR.enum.0.name=*** Write only *** +-AT91C_PIOA_SODR.enum.1.name=Error +-AT91C_PIOA_ISR.name="AT91C_PIOA_ISR" +-AT91C_PIOA_ISR.description="Interrupt Status Register" +-AT91C_PIOA_ISR.helpkey="Interrupt Status Register" +-AT91C_PIOA_ISR.access=memorymapped +-AT91C_PIOA_ISR.address=0xFFFFF44C +-AT91C_PIOA_ISR.width=32 +-AT91C_PIOA_ISR.byteEndian=little +-AT91C_PIOA_ISR.permission.write=none +-AT91C_PIOA_ABSR.name="AT91C_PIOA_ABSR" +-AT91C_PIOA_ABSR.description="AB Select Status Register" +-AT91C_PIOA_ABSR.helpkey="AB Select Status Register" +-AT91C_PIOA_ABSR.access=memorymapped +-AT91C_PIOA_ABSR.address=0xFFFFF478 +-AT91C_PIOA_ABSR.width=32 +-AT91C_PIOA_ABSR.byteEndian=little +-AT91C_PIOA_ABSR.permission.write=none +-AT91C_PIOA_IER.name="AT91C_PIOA_IER" +-AT91C_PIOA_IER.description="Interrupt Enable Register" +-AT91C_PIOA_IER.helpkey="Interrupt Enable Register" +-AT91C_PIOA_IER.access=memorymapped +-AT91C_PIOA_IER.address=0xFFFFF440 +-AT91C_PIOA_IER.width=32 +-AT91C_PIOA_IER.byteEndian=little +-AT91C_PIOA_IER.type=enum +-AT91C_PIOA_IER.enum.0.name=*** Write only *** +-AT91C_PIOA_IER.enum.1.name=Error +-AT91C_PIOA_PPUDR.name="AT91C_PIOA_PPUDR" +-AT91C_PIOA_PPUDR.description="Pull-up Disable Register" +-AT91C_PIOA_PPUDR.helpkey="Pull-up Disable Register" +-AT91C_PIOA_PPUDR.access=memorymapped +-AT91C_PIOA_PPUDR.address=0xFFFFF460 +-AT91C_PIOA_PPUDR.width=32 +-AT91C_PIOA_PPUDR.byteEndian=little +-AT91C_PIOA_PPUDR.type=enum +-AT91C_PIOA_PPUDR.enum.0.name=*** Write only *** +-AT91C_PIOA_PPUDR.enum.1.name=Error +-AT91C_PIOA_IMR.name="AT91C_PIOA_IMR" +-AT91C_PIOA_IMR.description="Interrupt Mask Register" +-AT91C_PIOA_IMR.helpkey="Interrupt Mask Register" +-AT91C_PIOA_IMR.access=memorymapped +-AT91C_PIOA_IMR.address=0xFFFFF448 +-AT91C_PIOA_IMR.width=32 +-AT91C_PIOA_IMR.byteEndian=little +-AT91C_PIOA_IMR.permission.write=none +-AT91C_PIOA_PER.name="AT91C_PIOA_PER" +-AT91C_PIOA_PER.description="PIO Enable Register" +-AT91C_PIOA_PER.helpkey="PIO Enable Register" +-AT91C_PIOA_PER.access=memorymapped +-AT91C_PIOA_PER.address=0xFFFFF400 +-AT91C_PIOA_PER.width=32 +-AT91C_PIOA_PER.byteEndian=little +-AT91C_PIOA_PER.type=enum +-AT91C_PIOA_PER.enum.0.name=*** Write only *** +-AT91C_PIOA_PER.enum.1.name=Error +-AT91C_PIOA_IFDR.name="AT91C_PIOA_IFDR" +-AT91C_PIOA_IFDR.description="Input Filter Disable Register" +-AT91C_PIOA_IFDR.helpkey="Input Filter Disable Register" +-AT91C_PIOA_IFDR.access=memorymapped +-AT91C_PIOA_IFDR.address=0xFFFFF424 +-AT91C_PIOA_IFDR.width=32 +-AT91C_PIOA_IFDR.byteEndian=little +-AT91C_PIOA_IFDR.type=enum +-AT91C_PIOA_IFDR.enum.0.name=*** Write only *** +-AT91C_PIOA_IFDR.enum.1.name=Error +-AT91C_PIOA_OWDR.name="AT91C_PIOA_OWDR" +-AT91C_PIOA_OWDR.description="Output Write Disable Register" +-AT91C_PIOA_OWDR.helpkey="Output Write Disable Register" +-AT91C_PIOA_OWDR.access=memorymapped +-AT91C_PIOA_OWDR.address=0xFFFFF4A4 +-AT91C_PIOA_OWDR.width=32 +-AT91C_PIOA_OWDR.byteEndian=little +-AT91C_PIOA_OWDR.type=enum +-AT91C_PIOA_OWDR.enum.0.name=*** Write only *** +-AT91C_PIOA_OWDR.enum.1.name=Error +-AT91C_PIOA_MDSR.name="AT91C_PIOA_MDSR" +-AT91C_PIOA_MDSR.description="Multi-driver Status Register" +-AT91C_PIOA_MDSR.helpkey="Multi-driver Status Register" +-AT91C_PIOA_MDSR.access=memorymapped +-AT91C_PIOA_MDSR.address=0xFFFFF458 +-AT91C_PIOA_MDSR.width=32 +-AT91C_PIOA_MDSR.byteEndian=little +-AT91C_PIOA_MDSR.permission.write=none +-AT91C_PIOA_IDR.name="AT91C_PIOA_IDR" +-AT91C_PIOA_IDR.description="Interrupt Disable Register" +-AT91C_PIOA_IDR.helpkey="Interrupt Disable Register" +-AT91C_PIOA_IDR.access=memorymapped +-AT91C_PIOA_IDR.address=0xFFFFF444 +-AT91C_PIOA_IDR.width=32 +-AT91C_PIOA_IDR.byteEndian=little +-AT91C_PIOA_IDR.type=enum +-AT91C_PIOA_IDR.enum.0.name=*** Write only *** +-AT91C_PIOA_IDR.enum.1.name=Error +-AT91C_PIOA_ODSR.name="AT91C_PIOA_ODSR" +-AT91C_PIOA_ODSR.description="Output Data Status Register" +-AT91C_PIOA_ODSR.helpkey="Output Data Status Register" +-AT91C_PIOA_ODSR.access=memorymapped +-AT91C_PIOA_ODSR.address=0xFFFFF438 +-AT91C_PIOA_ODSR.width=32 +-AT91C_PIOA_ODSR.byteEndian=little +-AT91C_PIOA_ODSR.permission.write=none +-AT91C_PIOA_PPUSR.name="AT91C_PIOA_PPUSR" +-AT91C_PIOA_PPUSR.description="Pull-up Status Register" +-AT91C_PIOA_PPUSR.helpkey="Pull-up Status Register" +-AT91C_PIOA_PPUSR.access=memorymapped +-AT91C_PIOA_PPUSR.address=0xFFFFF468 +-AT91C_PIOA_PPUSR.width=32 +-AT91C_PIOA_PPUSR.byteEndian=little +-AT91C_PIOA_PPUSR.permission.write=none +-AT91C_PIOA_OWSR.name="AT91C_PIOA_OWSR" +-AT91C_PIOA_OWSR.description="Output Write Status Register" +-AT91C_PIOA_OWSR.helpkey="Output Write Status Register" +-AT91C_PIOA_OWSR.access=memorymapped +-AT91C_PIOA_OWSR.address=0xFFFFF4A8 +-AT91C_PIOA_OWSR.width=32 +-AT91C_PIOA_OWSR.byteEndian=little +-AT91C_PIOA_OWSR.permission.write=none +-AT91C_PIOA_BSR.name="AT91C_PIOA_BSR" +-AT91C_PIOA_BSR.description="Select B Register" +-AT91C_PIOA_BSR.helpkey="Select B Register" +-AT91C_PIOA_BSR.access=memorymapped +-AT91C_PIOA_BSR.address=0xFFFFF474 +-AT91C_PIOA_BSR.width=32 +-AT91C_PIOA_BSR.byteEndian=little +-AT91C_PIOA_BSR.type=enum +-AT91C_PIOA_BSR.enum.0.name=*** Write only *** +-AT91C_PIOA_BSR.enum.1.name=Error +-AT91C_PIOA_OWER.name="AT91C_PIOA_OWER" +-AT91C_PIOA_OWER.description="Output Write Enable Register" +-AT91C_PIOA_OWER.helpkey="Output Write Enable Register" +-AT91C_PIOA_OWER.access=memorymapped +-AT91C_PIOA_OWER.address=0xFFFFF4A0 +-AT91C_PIOA_OWER.width=32 +-AT91C_PIOA_OWER.byteEndian=little +-AT91C_PIOA_OWER.type=enum +-AT91C_PIOA_OWER.enum.0.name=*** Write only *** +-AT91C_PIOA_OWER.enum.1.name=Error +-AT91C_PIOA_IFER.name="AT91C_PIOA_IFER" +-AT91C_PIOA_IFER.description="Input Filter Enable Register" +-AT91C_PIOA_IFER.helpkey="Input Filter Enable Register" +-AT91C_PIOA_IFER.access=memorymapped +-AT91C_PIOA_IFER.address=0xFFFFF420 +-AT91C_PIOA_IFER.width=32 +-AT91C_PIOA_IFER.byteEndian=little +-AT91C_PIOA_IFER.type=enum +-AT91C_PIOA_IFER.enum.0.name=*** Write only *** +-AT91C_PIOA_IFER.enum.1.name=Error +-AT91C_PIOA_PDSR.name="AT91C_PIOA_PDSR" +-AT91C_PIOA_PDSR.description="Pin Data Status Register" +-AT91C_PIOA_PDSR.helpkey="Pin Data Status Register" +-AT91C_PIOA_PDSR.access=memorymapped +-AT91C_PIOA_PDSR.address=0xFFFFF43C +-AT91C_PIOA_PDSR.width=32 +-AT91C_PIOA_PDSR.byteEndian=little +-AT91C_PIOA_PDSR.permission.write=none +-AT91C_PIOA_PPUER.name="AT91C_PIOA_PPUER" +-AT91C_PIOA_PPUER.description="Pull-up Enable Register" +-AT91C_PIOA_PPUER.helpkey="Pull-up Enable Register" +-AT91C_PIOA_PPUER.access=memorymapped +-AT91C_PIOA_PPUER.address=0xFFFFF464 +-AT91C_PIOA_PPUER.width=32 +-AT91C_PIOA_PPUER.byteEndian=little +-AT91C_PIOA_PPUER.type=enum +-AT91C_PIOA_PPUER.enum.0.name=*** Write only *** +-AT91C_PIOA_PPUER.enum.1.name=Error +-AT91C_PIOA_OSR.name="AT91C_PIOA_OSR" +-AT91C_PIOA_OSR.description="Output Status Register" +-AT91C_PIOA_OSR.helpkey="Output Status Register" +-AT91C_PIOA_OSR.access=memorymapped +-AT91C_PIOA_OSR.address=0xFFFFF418 +-AT91C_PIOA_OSR.width=32 +-AT91C_PIOA_OSR.byteEndian=little +-AT91C_PIOA_OSR.permission.write=none +-AT91C_PIOA_ASR.name="AT91C_PIOA_ASR" +-AT91C_PIOA_ASR.description="Select A Register" +-AT91C_PIOA_ASR.helpkey="Select A Register" +-AT91C_PIOA_ASR.access=memorymapped +-AT91C_PIOA_ASR.address=0xFFFFF470 +-AT91C_PIOA_ASR.width=32 +-AT91C_PIOA_ASR.byteEndian=little +-AT91C_PIOA_ASR.type=enum +-AT91C_PIOA_ASR.enum.0.name=*** Write only *** +-AT91C_PIOA_ASR.enum.1.name=Error +-AT91C_PIOA_MDDR.name="AT91C_PIOA_MDDR" +-AT91C_PIOA_MDDR.description="Multi-driver Disable Register" +-AT91C_PIOA_MDDR.helpkey="Multi-driver Disable Register" +-AT91C_PIOA_MDDR.access=memorymapped +-AT91C_PIOA_MDDR.address=0xFFFFF454 +-AT91C_PIOA_MDDR.width=32 +-AT91C_PIOA_MDDR.byteEndian=little +-AT91C_PIOA_MDDR.type=enum +-AT91C_PIOA_MDDR.enum.0.name=*** Write only *** +-AT91C_PIOA_MDDR.enum.1.name=Error +-AT91C_PIOA_CODR.name="AT91C_PIOA_CODR" +-AT91C_PIOA_CODR.description="Clear Output Data Register" +-AT91C_PIOA_CODR.helpkey="Clear Output Data Register" +-AT91C_PIOA_CODR.access=memorymapped +-AT91C_PIOA_CODR.address=0xFFFFF434 +-AT91C_PIOA_CODR.width=32 +-AT91C_PIOA_CODR.byteEndian=little +-AT91C_PIOA_CODR.type=enum +-AT91C_PIOA_CODR.enum.0.name=*** Write only *** +-AT91C_PIOA_CODR.enum.1.name=Error +-AT91C_PIOA_MDER.name="AT91C_PIOA_MDER" +-AT91C_PIOA_MDER.description="Multi-driver Enable Register" +-AT91C_PIOA_MDER.helpkey="Multi-driver Enable Register" +-AT91C_PIOA_MDER.access=memorymapped +-AT91C_PIOA_MDER.address=0xFFFFF450 +-AT91C_PIOA_MDER.width=32 +-AT91C_PIOA_MDER.byteEndian=little +-AT91C_PIOA_MDER.type=enum +-AT91C_PIOA_MDER.enum.0.name=*** Write only *** +-AT91C_PIOA_MDER.enum.1.name=Error +-AT91C_PIOA_PDR.name="AT91C_PIOA_PDR" +-AT91C_PIOA_PDR.description="PIO Disable Register" +-AT91C_PIOA_PDR.helpkey="PIO Disable Register" +-AT91C_PIOA_PDR.access=memorymapped +-AT91C_PIOA_PDR.address=0xFFFFF404 +-AT91C_PIOA_PDR.width=32 +-AT91C_PIOA_PDR.byteEndian=little +-AT91C_PIOA_PDR.type=enum +-AT91C_PIOA_PDR.enum.0.name=*** Write only *** +-AT91C_PIOA_PDR.enum.1.name=Error +-AT91C_PIOA_IFSR.name="AT91C_PIOA_IFSR" +-AT91C_PIOA_IFSR.description="Input Filter Status Register" +-AT91C_PIOA_IFSR.helpkey="Input Filter Status Register" +-AT91C_PIOA_IFSR.access=memorymapped +-AT91C_PIOA_IFSR.address=0xFFFFF428 +-AT91C_PIOA_IFSR.width=32 +-AT91C_PIOA_IFSR.byteEndian=little +-AT91C_PIOA_IFSR.permission.write=none +-AT91C_PIOA_OER.name="AT91C_PIOA_OER" +-AT91C_PIOA_OER.description="Output Enable Register" +-AT91C_PIOA_OER.helpkey="Output Enable Register" +-AT91C_PIOA_OER.access=memorymapped +-AT91C_PIOA_OER.address=0xFFFFF410 +-AT91C_PIOA_OER.width=32 +-AT91C_PIOA_OER.byteEndian=little +-AT91C_PIOA_OER.type=enum +-AT91C_PIOA_OER.enum.0.name=*** Write only *** +-AT91C_PIOA_OER.enum.1.name=Error +-AT91C_PIOA_PSR.name="AT91C_PIOA_PSR" +-AT91C_PIOA_PSR.description="PIO Status Register" +-AT91C_PIOA_PSR.helpkey="PIO Status Register" +-AT91C_PIOA_PSR.access=memorymapped +-AT91C_PIOA_PSR.address=0xFFFFF408 +-AT91C_PIOA_PSR.width=32 +-AT91C_PIOA_PSR.byteEndian=little +-AT91C_PIOA_PSR.permission.write=none +-# ========== Register definition for PIOB peripheral ========== +-AT91C_PIOB_OWDR.name="AT91C_PIOB_OWDR" +-AT91C_PIOB_OWDR.description="Output Write Disable Register" +-AT91C_PIOB_OWDR.helpkey="Output Write Disable Register" +-AT91C_PIOB_OWDR.access=memorymapped +-AT91C_PIOB_OWDR.address=0xFFFFF6A4 +-AT91C_PIOB_OWDR.width=32 +-AT91C_PIOB_OWDR.byteEndian=little +-AT91C_PIOB_OWDR.type=enum +-AT91C_PIOB_OWDR.enum.0.name=*** Write only *** +-AT91C_PIOB_OWDR.enum.1.name=Error +-AT91C_PIOB_MDER.name="AT91C_PIOB_MDER" +-AT91C_PIOB_MDER.description="Multi-driver Enable Register" +-AT91C_PIOB_MDER.helpkey="Multi-driver Enable Register" +-AT91C_PIOB_MDER.access=memorymapped +-AT91C_PIOB_MDER.address=0xFFFFF650 +-AT91C_PIOB_MDER.width=32 +-AT91C_PIOB_MDER.byteEndian=little +-AT91C_PIOB_MDER.type=enum +-AT91C_PIOB_MDER.enum.0.name=*** Write only *** +-AT91C_PIOB_MDER.enum.1.name=Error +-AT91C_PIOB_PPUSR.name="AT91C_PIOB_PPUSR" +-AT91C_PIOB_PPUSR.description="Pull-up Status Register" +-AT91C_PIOB_PPUSR.helpkey="Pull-up Status Register" +-AT91C_PIOB_PPUSR.access=memorymapped +-AT91C_PIOB_PPUSR.address=0xFFFFF668 +-AT91C_PIOB_PPUSR.width=32 +-AT91C_PIOB_PPUSR.byteEndian=little +-AT91C_PIOB_PPUSR.permission.write=none +-AT91C_PIOB_IMR.name="AT91C_PIOB_IMR" +-AT91C_PIOB_IMR.description="Interrupt Mask Register" +-AT91C_PIOB_IMR.helpkey="Interrupt Mask Register" +-AT91C_PIOB_IMR.access=memorymapped +-AT91C_PIOB_IMR.address=0xFFFFF648 +-AT91C_PIOB_IMR.width=32 +-AT91C_PIOB_IMR.byteEndian=little +-AT91C_PIOB_IMR.permission.write=none +-AT91C_PIOB_ASR.name="AT91C_PIOB_ASR" +-AT91C_PIOB_ASR.description="Select A Register" +-AT91C_PIOB_ASR.helpkey="Select A Register" +-AT91C_PIOB_ASR.access=memorymapped +-AT91C_PIOB_ASR.address=0xFFFFF670 +-AT91C_PIOB_ASR.width=32 +-AT91C_PIOB_ASR.byteEndian=little +-AT91C_PIOB_ASR.type=enum +-AT91C_PIOB_ASR.enum.0.name=*** Write only *** +-AT91C_PIOB_ASR.enum.1.name=Error +-AT91C_PIOB_PPUDR.name="AT91C_PIOB_PPUDR" +-AT91C_PIOB_PPUDR.description="Pull-up Disable Register" +-AT91C_PIOB_PPUDR.helpkey="Pull-up Disable Register" +-AT91C_PIOB_PPUDR.access=memorymapped +-AT91C_PIOB_PPUDR.address=0xFFFFF660 +-AT91C_PIOB_PPUDR.width=32 +-AT91C_PIOB_PPUDR.byteEndian=little +-AT91C_PIOB_PPUDR.type=enum +-AT91C_PIOB_PPUDR.enum.0.name=*** Write only *** +-AT91C_PIOB_PPUDR.enum.1.name=Error +-AT91C_PIOB_PSR.name="AT91C_PIOB_PSR" +-AT91C_PIOB_PSR.description="PIO Status Register" +-AT91C_PIOB_PSR.helpkey="PIO Status Register" +-AT91C_PIOB_PSR.access=memorymapped +-AT91C_PIOB_PSR.address=0xFFFFF608 +-AT91C_PIOB_PSR.width=32 +-AT91C_PIOB_PSR.byteEndian=little +-AT91C_PIOB_PSR.permission.write=none +-AT91C_PIOB_IER.name="AT91C_PIOB_IER" +-AT91C_PIOB_IER.description="Interrupt Enable Register" +-AT91C_PIOB_IER.helpkey="Interrupt Enable Register" +-AT91C_PIOB_IER.access=memorymapped +-AT91C_PIOB_IER.address=0xFFFFF640 +-AT91C_PIOB_IER.width=32 +-AT91C_PIOB_IER.byteEndian=little +-AT91C_PIOB_IER.type=enum +-AT91C_PIOB_IER.enum.0.name=*** Write only *** +-AT91C_PIOB_IER.enum.1.name=Error +-AT91C_PIOB_CODR.name="AT91C_PIOB_CODR" +-AT91C_PIOB_CODR.description="Clear Output Data Register" +-AT91C_PIOB_CODR.helpkey="Clear Output Data Register" +-AT91C_PIOB_CODR.access=memorymapped +-AT91C_PIOB_CODR.address=0xFFFFF634 +-AT91C_PIOB_CODR.width=32 +-AT91C_PIOB_CODR.byteEndian=little +-AT91C_PIOB_CODR.type=enum +-AT91C_PIOB_CODR.enum.0.name=*** Write only *** +-AT91C_PIOB_CODR.enum.1.name=Error +-AT91C_PIOB_OWER.name="AT91C_PIOB_OWER" +-AT91C_PIOB_OWER.description="Output Write Enable Register" +-AT91C_PIOB_OWER.helpkey="Output Write Enable Register" +-AT91C_PIOB_OWER.access=memorymapped +-AT91C_PIOB_OWER.address=0xFFFFF6A0 +-AT91C_PIOB_OWER.width=32 +-AT91C_PIOB_OWER.byteEndian=little +-AT91C_PIOB_OWER.type=enum +-AT91C_PIOB_OWER.enum.0.name=*** Write only *** +-AT91C_PIOB_OWER.enum.1.name=Error +-AT91C_PIOB_ABSR.name="AT91C_PIOB_ABSR" +-AT91C_PIOB_ABSR.description="AB Select Status Register" +-AT91C_PIOB_ABSR.helpkey="AB Select Status Register" +-AT91C_PIOB_ABSR.access=memorymapped +-AT91C_PIOB_ABSR.address=0xFFFFF678 +-AT91C_PIOB_ABSR.width=32 +-AT91C_PIOB_ABSR.byteEndian=little +-AT91C_PIOB_ABSR.permission.write=none +-AT91C_PIOB_IFDR.name="AT91C_PIOB_IFDR" +-AT91C_PIOB_IFDR.description="Input Filter Disable Register" +-AT91C_PIOB_IFDR.helpkey="Input Filter Disable Register" +-AT91C_PIOB_IFDR.access=memorymapped +-AT91C_PIOB_IFDR.address=0xFFFFF624 +-AT91C_PIOB_IFDR.width=32 +-AT91C_PIOB_IFDR.byteEndian=little +-AT91C_PIOB_IFDR.type=enum +-AT91C_PIOB_IFDR.enum.0.name=*** Write only *** +-AT91C_PIOB_IFDR.enum.1.name=Error +-AT91C_PIOB_PDSR.name="AT91C_PIOB_PDSR" +-AT91C_PIOB_PDSR.description="Pin Data Status Register" +-AT91C_PIOB_PDSR.helpkey="Pin Data Status Register" +-AT91C_PIOB_PDSR.access=memorymapped +-AT91C_PIOB_PDSR.address=0xFFFFF63C +-AT91C_PIOB_PDSR.width=32 +-AT91C_PIOB_PDSR.byteEndian=little +-AT91C_PIOB_PDSR.permission.write=none +-AT91C_PIOB_IDR.name="AT91C_PIOB_IDR" +-AT91C_PIOB_IDR.description="Interrupt Disable Register" +-AT91C_PIOB_IDR.helpkey="Interrupt Disable Register" +-AT91C_PIOB_IDR.access=memorymapped +-AT91C_PIOB_IDR.address=0xFFFFF644 +-AT91C_PIOB_IDR.width=32 +-AT91C_PIOB_IDR.byteEndian=little +-AT91C_PIOB_IDR.type=enum +-AT91C_PIOB_IDR.enum.0.name=*** Write only *** +-AT91C_PIOB_IDR.enum.1.name=Error +-AT91C_PIOB_OWSR.name="AT91C_PIOB_OWSR" +-AT91C_PIOB_OWSR.description="Output Write Status Register" +-AT91C_PIOB_OWSR.helpkey="Output Write Status Register" +-AT91C_PIOB_OWSR.access=memorymapped +-AT91C_PIOB_OWSR.address=0xFFFFF6A8 +-AT91C_PIOB_OWSR.width=32 +-AT91C_PIOB_OWSR.byteEndian=little +-AT91C_PIOB_OWSR.permission.write=none +-AT91C_PIOB_PDR.name="AT91C_PIOB_PDR" +-AT91C_PIOB_PDR.description="PIO Disable Register" +-AT91C_PIOB_PDR.helpkey="PIO Disable Register" +-AT91C_PIOB_PDR.access=memorymapped +-AT91C_PIOB_PDR.address=0xFFFFF604 +-AT91C_PIOB_PDR.width=32 +-AT91C_PIOB_PDR.byteEndian=little +-AT91C_PIOB_PDR.type=enum +-AT91C_PIOB_PDR.enum.0.name=*** Write only *** +-AT91C_PIOB_PDR.enum.1.name=Error +-AT91C_PIOB_ODR.name="AT91C_PIOB_ODR" +-AT91C_PIOB_ODR.description="Output Disable Registerr" +-AT91C_PIOB_ODR.helpkey="Output Disable Registerr" +-AT91C_PIOB_ODR.access=memorymapped +-AT91C_PIOB_ODR.address=0xFFFFF614 +-AT91C_PIOB_ODR.width=32 +-AT91C_PIOB_ODR.byteEndian=little +-AT91C_PIOB_ODR.type=enum +-AT91C_PIOB_ODR.enum.0.name=*** Write only *** +-AT91C_PIOB_ODR.enum.1.name=Error +-AT91C_PIOB_IFSR.name="AT91C_PIOB_IFSR" +-AT91C_PIOB_IFSR.description="Input Filter Status Register" +-AT91C_PIOB_IFSR.helpkey="Input Filter Status Register" +-AT91C_PIOB_IFSR.access=memorymapped +-AT91C_PIOB_IFSR.address=0xFFFFF628 +-AT91C_PIOB_IFSR.width=32 +-AT91C_PIOB_IFSR.byteEndian=little +-AT91C_PIOB_IFSR.permission.write=none +-AT91C_PIOB_PPUER.name="AT91C_PIOB_PPUER" +-AT91C_PIOB_PPUER.description="Pull-up Enable Register" +-AT91C_PIOB_PPUER.helpkey="Pull-up Enable Register" +-AT91C_PIOB_PPUER.access=memorymapped +-AT91C_PIOB_PPUER.address=0xFFFFF664 +-AT91C_PIOB_PPUER.width=32 +-AT91C_PIOB_PPUER.byteEndian=little +-AT91C_PIOB_PPUER.type=enum +-AT91C_PIOB_PPUER.enum.0.name=*** Write only *** +-AT91C_PIOB_PPUER.enum.1.name=Error +-AT91C_PIOB_SODR.name="AT91C_PIOB_SODR" +-AT91C_PIOB_SODR.description="Set Output Data Register" +-AT91C_PIOB_SODR.helpkey="Set Output Data Register" +-AT91C_PIOB_SODR.access=memorymapped +-AT91C_PIOB_SODR.address=0xFFFFF630 +-AT91C_PIOB_SODR.width=32 +-AT91C_PIOB_SODR.byteEndian=little +-AT91C_PIOB_SODR.type=enum +-AT91C_PIOB_SODR.enum.0.name=*** Write only *** +-AT91C_PIOB_SODR.enum.1.name=Error +-AT91C_PIOB_ISR.name="AT91C_PIOB_ISR" +-AT91C_PIOB_ISR.description="Interrupt Status Register" +-AT91C_PIOB_ISR.helpkey="Interrupt Status Register" +-AT91C_PIOB_ISR.access=memorymapped +-AT91C_PIOB_ISR.address=0xFFFFF64C +-AT91C_PIOB_ISR.width=32 +-AT91C_PIOB_ISR.byteEndian=little +-AT91C_PIOB_ISR.permission.write=none +-AT91C_PIOB_ODSR.name="AT91C_PIOB_ODSR" +-AT91C_PIOB_ODSR.description="Output Data Status Register" +-AT91C_PIOB_ODSR.helpkey="Output Data Status Register" +-AT91C_PIOB_ODSR.access=memorymapped +-AT91C_PIOB_ODSR.address=0xFFFFF638 +-AT91C_PIOB_ODSR.width=32 +-AT91C_PIOB_ODSR.byteEndian=little +-AT91C_PIOB_ODSR.permission.write=none +-AT91C_PIOB_OSR.name="AT91C_PIOB_OSR" +-AT91C_PIOB_OSR.description="Output Status Register" +-AT91C_PIOB_OSR.helpkey="Output Status Register" +-AT91C_PIOB_OSR.access=memorymapped +-AT91C_PIOB_OSR.address=0xFFFFF618 +-AT91C_PIOB_OSR.width=32 +-AT91C_PIOB_OSR.byteEndian=little +-AT91C_PIOB_OSR.permission.write=none +-AT91C_PIOB_MDSR.name="AT91C_PIOB_MDSR" +-AT91C_PIOB_MDSR.description="Multi-driver Status Register" +-AT91C_PIOB_MDSR.helpkey="Multi-driver Status Register" +-AT91C_PIOB_MDSR.access=memorymapped +-AT91C_PIOB_MDSR.address=0xFFFFF658 +-AT91C_PIOB_MDSR.width=32 +-AT91C_PIOB_MDSR.byteEndian=little +-AT91C_PIOB_MDSR.permission.write=none +-AT91C_PIOB_IFER.name="AT91C_PIOB_IFER" +-AT91C_PIOB_IFER.description="Input Filter Enable Register" +-AT91C_PIOB_IFER.helpkey="Input Filter Enable Register" +-AT91C_PIOB_IFER.access=memorymapped +-AT91C_PIOB_IFER.address=0xFFFFF620 +-AT91C_PIOB_IFER.width=32 +-AT91C_PIOB_IFER.byteEndian=little +-AT91C_PIOB_IFER.type=enum +-AT91C_PIOB_IFER.enum.0.name=*** Write only *** +-AT91C_PIOB_IFER.enum.1.name=Error +-AT91C_PIOB_BSR.name="AT91C_PIOB_BSR" +-AT91C_PIOB_BSR.description="Select B Register" +-AT91C_PIOB_BSR.helpkey="Select B Register" +-AT91C_PIOB_BSR.access=memorymapped +-AT91C_PIOB_BSR.address=0xFFFFF674 +-AT91C_PIOB_BSR.width=32 +-AT91C_PIOB_BSR.byteEndian=little +-AT91C_PIOB_BSR.type=enum +-AT91C_PIOB_BSR.enum.0.name=*** Write only *** +-AT91C_PIOB_BSR.enum.1.name=Error +-AT91C_PIOB_MDDR.name="AT91C_PIOB_MDDR" +-AT91C_PIOB_MDDR.description="Multi-driver Disable Register" +-AT91C_PIOB_MDDR.helpkey="Multi-driver Disable Register" +-AT91C_PIOB_MDDR.access=memorymapped +-AT91C_PIOB_MDDR.address=0xFFFFF654 +-AT91C_PIOB_MDDR.width=32 +-AT91C_PIOB_MDDR.byteEndian=little +-AT91C_PIOB_MDDR.type=enum +-AT91C_PIOB_MDDR.enum.0.name=*** Write only *** +-AT91C_PIOB_MDDR.enum.1.name=Error +-AT91C_PIOB_OER.name="AT91C_PIOB_OER" +-AT91C_PIOB_OER.description="Output Enable Register" +-AT91C_PIOB_OER.helpkey="Output Enable Register" +-AT91C_PIOB_OER.access=memorymapped +-AT91C_PIOB_OER.address=0xFFFFF610 +-AT91C_PIOB_OER.width=32 +-AT91C_PIOB_OER.byteEndian=little +-AT91C_PIOB_OER.type=enum +-AT91C_PIOB_OER.enum.0.name=*** Write only *** +-AT91C_PIOB_OER.enum.1.name=Error +-AT91C_PIOB_PER.name="AT91C_PIOB_PER" +-AT91C_PIOB_PER.description="PIO Enable Register" +-AT91C_PIOB_PER.helpkey="PIO Enable Register" +-AT91C_PIOB_PER.access=memorymapped +-AT91C_PIOB_PER.address=0xFFFFF600 +-AT91C_PIOB_PER.width=32 +-AT91C_PIOB_PER.byteEndian=little +-AT91C_PIOB_PER.type=enum +-AT91C_PIOB_PER.enum.0.name=*** Write only *** +-AT91C_PIOB_PER.enum.1.name=Error +-# ========== Register definition for CKGR peripheral ========== +-AT91C_CKGR_MOR.name="AT91C_CKGR_MOR" +-AT91C_CKGR_MOR.description="Main Oscillator Register" +-AT91C_CKGR_MOR.helpkey="Main Oscillator Register" +-AT91C_CKGR_MOR.access=memorymapped +-AT91C_CKGR_MOR.address=0xFFFFFC20 +-AT91C_CKGR_MOR.width=32 +-AT91C_CKGR_MOR.byteEndian=little +-AT91C_CKGR_PLLR.name="AT91C_CKGR_PLLR" +-AT91C_CKGR_PLLR.description="PLL Register" +-AT91C_CKGR_PLLR.helpkey="PLL Register" +-AT91C_CKGR_PLLR.access=memorymapped +-AT91C_CKGR_PLLR.address=0xFFFFFC2C +-AT91C_CKGR_PLLR.width=32 +-AT91C_CKGR_PLLR.byteEndian=little +-AT91C_CKGR_MCFR.name="AT91C_CKGR_MCFR" +-AT91C_CKGR_MCFR.description="Main Clock Frequency Register" +-AT91C_CKGR_MCFR.helpkey="Main Clock Frequency Register" +-AT91C_CKGR_MCFR.access=memorymapped +-AT91C_CKGR_MCFR.address=0xFFFFFC24 +-AT91C_CKGR_MCFR.width=32 +-AT91C_CKGR_MCFR.byteEndian=little +-AT91C_CKGR_MCFR.permission.write=none +-# ========== Register definition for PMC peripheral ========== +-AT91C_PMC_IDR.name="AT91C_PMC_IDR" +-AT91C_PMC_IDR.description="Interrupt Disable Register" +-AT91C_PMC_IDR.helpkey="Interrupt Disable Register" +-AT91C_PMC_IDR.access=memorymapped +-AT91C_PMC_IDR.address=0xFFFFFC64 +-AT91C_PMC_IDR.width=32 +-AT91C_PMC_IDR.byteEndian=little +-AT91C_PMC_IDR.type=enum +-AT91C_PMC_IDR.enum.0.name=*** Write only *** +-AT91C_PMC_IDR.enum.1.name=Error +-AT91C_PMC_MOR.name="AT91C_PMC_MOR" +-AT91C_PMC_MOR.description="Main Oscillator Register" +-AT91C_PMC_MOR.helpkey="Main Oscillator Register" +-AT91C_PMC_MOR.access=memorymapped +-AT91C_PMC_MOR.address=0xFFFFFC20 +-AT91C_PMC_MOR.width=32 +-AT91C_PMC_MOR.byteEndian=little +-AT91C_PMC_PLLR.name="AT91C_PMC_PLLR" +-AT91C_PMC_PLLR.description="PLL Register" +-AT91C_PMC_PLLR.helpkey="PLL Register" +-AT91C_PMC_PLLR.access=memorymapped +-AT91C_PMC_PLLR.address=0xFFFFFC2C +-AT91C_PMC_PLLR.width=32 +-AT91C_PMC_PLLR.byteEndian=little +-AT91C_PMC_PCER.name="AT91C_PMC_PCER" +-AT91C_PMC_PCER.description="Peripheral Clock Enable Register" +-AT91C_PMC_PCER.helpkey="Peripheral Clock Enable Register" +-AT91C_PMC_PCER.access=memorymapped +-AT91C_PMC_PCER.address=0xFFFFFC10 +-AT91C_PMC_PCER.width=32 +-AT91C_PMC_PCER.byteEndian=little +-AT91C_PMC_PCER.type=enum +-AT91C_PMC_PCER.enum.0.name=*** Write only *** +-AT91C_PMC_PCER.enum.1.name=Error +-AT91C_PMC_PCKR.name="AT91C_PMC_PCKR" +-AT91C_PMC_PCKR.description="Programmable Clock Register" +-AT91C_PMC_PCKR.helpkey="Programmable Clock Register" +-AT91C_PMC_PCKR.access=memorymapped +-AT91C_PMC_PCKR.address=0xFFFFFC40 +-AT91C_PMC_PCKR.width=32 +-AT91C_PMC_PCKR.byteEndian=little +-AT91C_PMC_MCKR.name="AT91C_PMC_MCKR" +-AT91C_PMC_MCKR.description="Master Clock Register" +-AT91C_PMC_MCKR.helpkey="Master Clock Register" +-AT91C_PMC_MCKR.access=memorymapped +-AT91C_PMC_MCKR.address=0xFFFFFC30 +-AT91C_PMC_MCKR.width=32 +-AT91C_PMC_MCKR.byteEndian=little +-AT91C_PMC_SCDR.name="AT91C_PMC_SCDR" +-AT91C_PMC_SCDR.description="System Clock Disable Register" +-AT91C_PMC_SCDR.helpkey="System Clock Disable Register" +-AT91C_PMC_SCDR.access=memorymapped +-AT91C_PMC_SCDR.address=0xFFFFFC04 +-AT91C_PMC_SCDR.width=32 +-AT91C_PMC_SCDR.byteEndian=little +-AT91C_PMC_SCDR.type=enum +-AT91C_PMC_SCDR.enum.0.name=*** Write only *** +-AT91C_PMC_SCDR.enum.1.name=Error +-AT91C_PMC_PCDR.name="AT91C_PMC_PCDR" +-AT91C_PMC_PCDR.description="Peripheral Clock Disable Register" +-AT91C_PMC_PCDR.helpkey="Peripheral Clock Disable Register" +-AT91C_PMC_PCDR.access=memorymapped +-AT91C_PMC_PCDR.address=0xFFFFFC14 +-AT91C_PMC_PCDR.width=32 +-AT91C_PMC_PCDR.byteEndian=little +-AT91C_PMC_PCDR.type=enum +-AT91C_PMC_PCDR.enum.0.name=*** Write only *** +-AT91C_PMC_PCDR.enum.1.name=Error +-AT91C_PMC_SCSR.name="AT91C_PMC_SCSR" +-AT91C_PMC_SCSR.description="System Clock Status Register" +-AT91C_PMC_SCSR.helpkey="System Clock Status Register" +-AT91C_PMC_SCSR.access=memorymapped +-AT91C_PMC_SCSR.address=0xFFFFFC08 +-AT91C_PMC_SCSR.width=32 +-AT91C_PMC_SCSR.byteEndian=little +-AT91C_PMC_SCSR.permission.write=none +-AT91C_PMC_PCSR.name="AT91C_PMC_PCSR" +-AT91C_PMC_PCSR.description="Peripheral Clock Status Register" +-AT91C_PMC_PCSR.helpkey="Peripheral Clock Status Register" +-AT91C_PMC_PCSR.access=memorymapped +-AT91C_PMC_PCSR.address=0xFFFFFC18 +-AT91C_PMC_PCSR.width=32 +-AT91C_PMC_PCSR.byteEndian=little +-AT91C_PMC_PCSR.permission.write=none +-AT91C_PMC_MCFR.name="AT91C_PMC_MCFR" +-AT91C_PMC_MCFR.description="Main Clock Frequency Register" +-AT91C_PMC_MCFR.helpkey="Main Clock Frequency Register" +-AT91C_PMC_MCFR.access=memorymapped +-AT91C_PMC_MCFR.address=0xFFFFFC24 +-AT91C_PMC_MCFR.width=32 +-AT91C_PMC_MCFR.byteEndian=little +-AT91C_PMC_MCFR.permission.write=none +-AT91C_PMC_SCER.name="AT91C_PMC_SCER" +-AT91C_PMC_SCER.description="System Clock Enable Register" +-AT91C_PMC_SCER.helpkey="System Clock Enable Register" +-AT91C_PMC_SCER.access=memorymapped +-AT91C_PMC_SCER.address=0xFFFFFC00 +-AT91C_PMC_SCER.width=32 +-AT91C_PMC_SCER.byteEndian=little +-AT91C_PMC_SCER.type=enum +-AT91C_PMC_SCER.enum.0.name=*** Write only *** +-AT91C_PMC_SCER.enum.1.name=Error +-AT91C_PMC_IMR.name="AT91C_PMC_IMR" +-AT91C_PMC_IMR.description="Interrupt Mask Register" +-AT91C_PMC_IMR.helpkey="Interrupt Mask Register" +-AT91C_PMC_IMR.access=memorymapped +-AT91C_PMC_IMR.address=0xFFFFFC6C +-AT91C_PMC_IMR.width=32 +-AT91C_PMC_IMR.byteEndian=little +-AT91C_PMC_IMR.permission.write=none +-AT91C_PMC_IER.name="AT91C_PMC_IER" +-AT91C_PMC_IER.description="Interrupt Enable Register" +-AT91C_PMC_IER.helpkey="Interrupt Enable Register" +-AT91C_PMC_IER.access=memorymapped +-AT91C_PMC_IER.address=0xFFFFFC60 +-AT91C_PMC_IER.width=32 +-AT91C_PMC_IER.byteEndian=little +-AT91C_PMC_IER.type=enum +-AT91C_PMC_IER.enum.0.name=*** Write only *** +-AT91C_PMC_IER.enum.1.name=Error +-AT91C_PMC_SR.name="AT91C_PMC_SR" +-AT91C_PMC_SR.description="Status Register" +-AT91C_PMC_SR.helpkey="Status Register" +-AT91C_PMC_SR.access=memorymapped +-AT91C_PMC_SR.address=0xFFFFFC68 +-AT91C_PMC_SR.width=32 +-AT91C_PMC_SR.byteEndian=little +-AT91C_PMC_SR.permission.write=none +-# ========== Register definition for RSTC peripheral ========== +-AT91C_RSTC_RCR.name="AT91C_RSTC_RCR" +-AT91C_RSTC_RCR.description="Reset Control Register" +-AT91C_RSTC_RCR.helpkey="Reset Control Register" +-AT91C_RSTC_RCR.access=memorymapped +-AT91C_RSTC_RCR.address=0xFFFFFD00 +-AT91C_RSTC_RCR.width=32 +-AT91C_RSTC_RCR.byteEndian=little +-AT91C_RSTC_RCR.type=enum +-AT91C_RSTC_RCR.enum.0.name=*** Write only *** +-AT91C_RSTC_RCR.enum.1.name=Error +-AT91C_RSTC_RMR.name="AT91C_RSTC_RMR" +-AT91C_RSTC_RMR.description="Reset Mode Register" +-AT91C_RSTC_RMR.helpkey="Reset Mode Register" +-AT91C_RSTC_RMR.access=memorymapped +-AT91C_RSTC_RMR.address=0xFFFFFD08 +-AT91C_RSTC_RMR.width=32 +-AT91C_RSTC_RMR.byteEndian=little +-AT91C_RSTC_RSR.name="AT91C_RSTC_RSR" +-AT91C_RSTC_RSR.description="Reset Status Register" +-AT91C_RSTC_RSR.helpkey="Reset Status Register" +-AT91C_RSTC_RSR.access=memorymapped +-AT91C_RSTC_RSR.address=0xFFFFFD04 +-AT91C_RSTC_RSR.width=32 +-AT91C_RSTC_RSR.byteEndian=little +-AT91C_RSTC_RSR.permission.write=none +-# ========== Register definition for RTTC peripheral ========== +-AT91C_RTTC_RTSR.name="AT91C_RTTC_RTSR" +-AT91C_RTTC_RTSR.description="Real-time Status Register" +-AT91C_RTTC_RTSR.helpkey="Real-time Status Register" +-AT91C_RTTC_RTSR.access=memorymapped +-AT91C_RTTC_RTSR.address=0xFFFFFD2C +-AT91C_RTTC_RTSR.width=32 +-AT91C_RTTC_RTSR.byteEndian=little +-AT91C_RTTC_RTSR.permission.write=none +-AT91C_RTTC_RTMR.name="AT91C_RTTC_RTMR" +-AT91C_RTTC_RTMR.description="Real-time Mode Register" +-AT91C_RTTC_RTMR.helpkey="Real-time Mode Register" +-AT91C_RTTC_RTMR.access=memorymapped +-AT91C_RTTC_RTMR.address=0xFFFFFD20 +-AT91C_RTTC_RTMR.width=32 +-AT91C_RTTC_RTMR.byteEndian=little +-AT91C_RTTC_RTVR.name="AT91C_RTTC_RTVR" +-AT91C_RTTC_RTVR.description="Real-time Value Register" +-AT91C_RTTC_RTVR.helpkey="Real-time Value Register" +-AT91C_RTTC_RTVR.access=memorymapped +-AT91C_RTTC_RTVR.address=0xFFFFFD28 +-AT91C_RTTC_RTVR.width=32 +-AT91C_RTTC_RTVR.byteEndian=little +-AT91C_RTTC_RTVR.permission.write=none +-AT91C_RTTC_RTAR.name="AT91C_RTTC_RTAR" +-AT91C_RTTC_RTAR.description="Real-time Alarm Register" +-AT91C_RTTC_RTAR.helpkey="Real-time Alarm Register" +-AT91C_RTTC_RTAR.access=memorymapped +-AT91C_RTTC_RTAR.address=0xFFFFFD24 +-AT91C_RTTC_RTAR.width=32 +-AT91C_RTTC_RTAR.byteEndian=little +-# ========== Register definition for PITC peripheral ========== +-AT91C_PITC_PIVR.name="AT91C_PITC_PIVR" +-AT91C_PITC_PIVR.description="Period Interval Value Register" +-AT91C_PITC_PIVR.helpkey="Period Interval Value Register" +-AT91C_PITC_PIVR.access=memorymapped +-AT91C_PITC_PIVR.address=0xFFFFFD38 +-AT91C_PITC_PIVR.width=32 +-AT91C_PITC_PIVR.byteEndian=little +-AT91C_PITC_PIVR.permission.write=none +-AT91C_PITC_PISR.name="AT91C_PITC_PISR" +-AT91C_PITC_PISR.description="Period Interval Status Register" +-AT91C_PITC_PISR.helpkey="Period Interval Status Register" +-AT91C_PITC_PISR.access=memorymapped +-AT91C_PITC_PISR.address=0xFFFFFD34 +-AT91C_PITC_PISR.width=32 +-AT91C_PITC_PISR.byteEndian=little +-AT91C_PITC_PISR.permission.write=none +-AT91C_PITC_PIIR.name="AT91C_PITC_PIIR" +-AT91C_PITC_PIIR.description="Period Interval Image Register" +-AT91C_PITC_PIIR.helpkey="Period Interval Image Register" +-AT91C_PITC_PIIR.access=memorymapped +-AT91C_PITC_PIIR.address=0xFFFFFD3C +-AT91C_PITC_PIIR.width=32 +-AT91C_PITC_PIIR.byteEndian=little +-AT91C_PITC_PIIR.permission.write=none +-AT91C_PITC_PIMR.name="AT91C_PITC_PIMR" +-AT91C_PITC_PIMR.description="Period Interval Mode Register" +-AT91C_PITC_PIMR.helpkey="Period Interval Mode Register" +-AT91C_PITC_PIMR.access=memorymapped +-AT91C_PITC_PIMR.address=0xFFFFFD30 +-AT91C_PITC_PIMR.width=32 +-AT91C_PITC_PIMR.byteEndian=little +-# ========== Register definition for WDTC peripheral ========== +-AT91C_WDTC_WDCR.name="AT91C_WDTC_WDCR" +-AT91C_WDTC_WDCR.description="Watchdog Control Register" +-AT91C_WDTC_WDCR.helpkey="Watchdog Control Register" +-AT91C_WDTC_WDCR.access=memorymapped +-AT91C_WDTC_WDCR.address=0xFFFFFD40 +-AT91C_WDTC_WDCR.width=32 +-AT91C_WDTC_WDCR.byteEndian=little +-AT91C_WDTC_WDCR.type=enum +-AT91C_WDTC_WDCR.enum.0.name=*** Write only *** +-AT91C_WDTC_WDCR.enum.1.name=Error +-AT91C_WDTC_WDSR.name="AT91C_WDTC_WDSR" +-AT91C_WDTC_WDSR.description="Watchdog Status Register" +-AT91C_WDTC_WDSR.helpkey="Watchdog Status Register" +-AT91C_WDTC_WDSR.access=memorymapped +-AT91C_WDTC_WDSR.address=0xFFFFFD48 +-AT91C_WDTC_WDSR.width=32 +-AT91C_WDTC_WDSR.byteEndian=little +-AT91C_WDTC_WDSR.permission.write=none +-AT91C_WDTC_WDMR.name="AT91C_WDTC_WDMR" +-AT91C_WDTC_WDMR.description="Watchdog Mode Register" +-AT91C_WDTC_WDMR.helpkey="Watchdog Mode Register" +-AT91C_WDTC_WDMR.access=memorymapped +-AT91C_WDTC_WDMR.address=0xFFFFFD44 +-AT91C_WDTC_WDMR.width=32 +-AT91C_WDTC_WDMR.byteEndian=little +-# ========== Register definition for VREG peripheral ========== +-AT91C_VREG_MR.name="AT91C_VREG_MR" +-AT91C_VREG_MR.description="Voltage Regulator Mode Register" +-AT91C_VREG_MR.helpkey="Voltage Regulator Mode Register" +-AT91C_VREG_MR.access=memorymapped +-AT91C_VREG_MR.address=0xFFFFFD60 +-AT91C_VREG_MR.width=32 +-AT91C_VREG_MR.byteEndian=little +-# ========== Register definition for MC peripheral ========== +-AT91C_MC_ASR.name="AT91C_MC_ASR" +-AT91C_MC_ASR.description="MC Abort Status Register" +-AT91C_MC_ASR.helpkey="MC Abort Status Register" +-AT91C_MC_ASR.access=memorymapped +-AT91C_MC_ASR.address=0xFFFFFF04 +-AT91C_MC_ASR.width=32 +-AT91C_MC_ASR.byteEndian=little +-AT91C_MC_ASR.permission.write=none +-AT91C_MC_RCR.name="AT91C_MC_RCR" +-AT91C_MC_RCR.description="MC Remap Control Register" +-AT91C_MC_RCR.helpkey="MC Remap Control Register" +-AT91C_MC_RCR.access=memorymapped +-AT91C_MC_RCR.address=0xFFFFFF00 +-AT91C_MC_RCR.width=32 +-AT91C_MC_RCR.byteEndian=little +-AT91C_MC_RCR.type=enum +-AT91C_MC_RCR.enum.0.name=*** Write only *** +-AT91C_MC_RCR.enum.1.name=Error +-AT91C_MC_FCR.name="AT91C_MC_FCR" +-AT91C_MC_FCR.description="MC Flash Command Register" +-AT91C_MC_FCR.helpkey="MC Flash Command Register" +-AT91C_MC_FCR.access=memorymapped +-AT91C_MC_FCR.address=0xFFFFFF64 +-AT91C_MC_FCR.width=32 +-AT91C_MC_FCR.byteEndian=little +-AT91C_MC_FCR.type=enum +-AT91C_MC_FCR.enum.0.name=*** Write only *** +-AT91C_MC_FCR.enum.1.name=Error +-AT91C_MC_AASR.name="AT91C_MC_AASR" +-AT91C_MC_AASR.description="MC Abort Address Status Register" +-AT91C_MC_AASR.helpkey="MC Abort Address Status Register" +-AT91C_MC_AASR.access=memorymapped +-AT91C_MC_AASR.address=0xFFFFFF08 +-AT91C_MC_AASR.width=32 +-AT91C_MC_AASR.byteEndian=little +-AT91C_MC_AASR.permission.write=none +-AT91C_MC_FSR.name="AT91C_MC_FSR" +-AT91C_MC_FSR.description="MC Flash Status Register" +-AT91C_MC_FSR.helpkey="MC Flash Status Register" +-AT91C_MC_FSR.access=memorymapped +-AT91C_MC_FSR.address=0xFFFFFF68 +-AT91C_MC_FSR.width=32 +-AT91C_MC_FSR.byteEndian=little +-AT91C_MC_FSR.permission.write=none +-AT91C_MC_FMR.name="AT91C_MC_FMR" +-AT91C_MC_FMR.description="MC Flash Mode Register" +-AT91C_MC_FMR.helpkey="MC Flash Mode Register" +-AT91C_MC_FMR.access=memorymapped +-AT91C_MC_FMR.address=0xFFFFFF60 +-AT91C_MC_FMR.width=32 +-AT91C_MC_FMR.byteEndian=little +-# ========== Register definition for PDC_SPI1 peripheral ========== +-AT91C_SPI1_PTCR.name="AT91C_SPI1_PTCR" +-AT91C_SPI1_PTCR.description="PDC Transfer Control Register" +-AT91C_SPI1_PTCR.helpkey="PDC Transfer Control Register" +-AT91C_SPI1_PTCR.access=memorymapped +-AT91C_SPI1_PTCR.address=0xFFFE4120 +-AT91C_SPI1_PTCR.width=32 +-AT91C_SPI1_PTCR.byteEndian=little +-AT91C_SPI1_PTCR.type=enum +-AT91C_SPI1_PTCR.enum.0.name=*** Write only *** +-AT91C_SPI1_PTCR.enum.1.name=Error +-AT91C_SPI1_RPR.name="AT91C_SPI1_RPR" +-AT91C_SPI1_RPR.description="Receive Pointer Register" +-AT91C_SPI1_RPR.helpkey="Receive Pointer Register" +-AT91C_SPI1_RPR.access=memorymapped +-AT91C_SPI1_RPR.address=0xFFFE4100 +-AT91C_SPI1_RPR.width=32 +-AT91C_SPI1_RPR.byteEndian=little +-AT91C_SPI1_TNCR.name="AT91C_SPI1_TNCR" +-AT91C_SPI1_TNCR.description="Transmit Next Counter Register" +-AT91C_SPI1_TNCR.helpkey="Transmit Next Counter Register" +-AT91C_SPI1_TNCR.access=memorymapped +-AT91C_SPI1_TNCR.address=0xFFFE411C +-AT91C_SPI1_TNCR.width=32 +-AT91C_SPI1_TNCR.byteEndian=little +-AT91C_SPI1_TPR.name="AT91C_SPI1_TPR" +-AT91C_SPI1_TPR.description="Transmit Pointer Register" +-AT91C_SPI1_TPR.helpkey="Transmit Pointer Register" +-AT91C_SPI1_TPR.access=memorymapped +-AT91C_SPI1_TPR.address=0xFFFE4108 +-AT91C_SPI1_TPR.width=32 +-AT91C_SPI1_TPR.byteEndian=little +-AT91C_SPI1_TNPR.name="AT91C_SPI1_TNPR" +-AT91C_SPI1_TNPR.description="Transmit Next Pointer Register" +-AT91C_SPI1_TNPR.helpkey="Transmit Next Pointer Register" +-AT91C_SPI1_TNPR.access=memorymapped +-AT91C_SPI1_TNPR.address=0xFFFE4118 +-AT91C_SPI1_TNPR.width=32 +-AT91C_SPI1_TNPR.byteEndian=little +-AT91C_SPI1_TCR.name="AT91C_SPI1_TCR" +-AT91C_SPI1_TCR.description="Transmit Counter Register" +-AT91C_SPI1_TCR.helpkey="Transmit Counter Register" +-AT91C_SPI1_TCR.access=memorymapped +-AT91C_SPI1_TCR.address=0xFFFE410C +-AT91C_SPI1_TCR.width=32 +-AT91C_SPI1_TCR.byteEndian=little +-AT91C_SPI1_RCR.name="AT91C_SPI1_RCR" +-AT91C_SPI1_RCR.description="Receive Counter Register" +-AT91C_SPI1_RCR.helpkey="Receive Counter Register" +-AT91C_SPI1_RCR.access=memorymapped +-AT91C_SPI1_RCR.address=0xFFFE4104 +-AT91C_SPI1_RCR.width=32 +-AT91C_SPI1_RCR.byteEndian=little +-AT91C_SPI1_RNPR.name="AT91C_SPI1_RNPR" +-AT91C_SPI1_RNPR.description="Receive Next Pointer Register" +-AT91C_SPI1_RNPR.helpkey="Receive Next Pointer Register" +-AT91C_SPI1_RNPR.access=memorymapped +-AT91C_SPI1_RNPR.address=0xFFFE4110 +-AT91C_SPI1_RNPR.width=32 +-AT91C_SPI1_RNPR.byteEndian=little +-AT91C_SPI1_RNCR.name="AT91C_SPI1_RNCR" +-AT91C_SPI1_RNCR.description="Receive Next Counter Register" +-AT91C_SPI1_RNCR.helpkey="Receive Next Counter Register" +-AT91C_SPI1_RNCR.access=memorymapped +-AT91C_SPI1_RNCR.address=0xFFFE4114 +-AT91C_SPI1_RNCR.width=32 +-AT91C_SPI1_RNCR.byteEndian=little +-AT91C_SPI1_PTSR.name="AT91C_SPI1_PTSR" +-AT91C_SPI1_PTSR.description="PDC Transfer Status Register" +-AT91C_SPI1_PTSR.helpkey="PDC Transfer Status Register" +-AT91C_SPI1_PTSR.access=memorymapped +-AT91C_SPI1_PTSR.address=0xFFFE4124 +-AT91C_SPI1_PTSR.width=32 +-AT91C_SPI1_PTSR.byteEndian=little +-AT91C_SPI1_PTSR.permission.write=none +-# ========== Register definition for SPI1 peripheral ========== +-AT91C_SPI1_IMR.name="AT91C_SPI1_IMR" +-AT91C_SPI1_IMR.description="Interrupt Mask Register" +-AT91C_SPI1_IMR.helpkey="Interrupt Mask Register" +-AT91C_SPI1_IMR.access=memorymapped +-AT91C_SPI1_IMR.address=0xFFFE401C +-AT91C_SPI1_IMR.width=32 +-AT91C_SPI1_IMR.byteEndian=little +-AT91C_SPI1_IMR.permission.write=none +-AT91C_SPI1_IER.name="AT91C_SPI1_IER" +-AT91C_SPI1_IER.description="Interrupt Enable Register" +-AT91C_SPI1_IER.helpkey="Interrupt Enable Register" +-AT91C_SPI1_IER.access=memorymapped +-AT91C_SPI1_IER.address=0xFFFE4014 +-AT91C_SPI1_IER.width=32 +-AT91C_SPI1_IER.byteEndian=little +-AT91C_SPI1_IER.type=enum +-AT91C_SPI1_IER.enum.0.name=*** Write only *** +-AT91C_SPI1_IER.enum.1.name=Error +-AT91C_SPI1_MR.name="AT91C_SPI1_MR" +-AT91C_SPI1_MR.description="Mode Register" +-AT91C_SPI1_MR.helpkey="Mode Register" +-AT91C_SPI1_MR.access=memorymapped +-AT91C_SPI1_MR.address=0xFFFE4004 +-AT91C_SPI1_MR.width=32 +-AT91C_SPI1_MR.byteEndian=little +-AT91C_SPI1_RDR.name="AT91C_SPI1_RDR" +-AT91C_SPI1_RDR.description="Receive Data Register" +-AT91C_SPI1_RDR.helpkey="Receive Data Register" +-AT91C_SPI1_RDR.access=memorymapped +-AT91C_SPI1_RDR.address=0xFFFE4008 +-AT91C_SPI1_RDR.width=32 +-AT91C_SPI1_RDR.byteEndian=little +-AT91C_SPI1_RDR.permission.write=none +-AT91C_SPI1_IDR.name="AT91C_SPI1_IDR" +-AT91C_SPI1_IDR.description="Interrupt Disable Register" +-AT91C_SPI1_IDR.helpkey="Interrupt Disable Register" +-AT91C_SPI1_IDR.access=memorymapped +-AT91C_SPI1_IDR.address=0xFFFE4018 +-AT91C_SPI1_IDR.width=32 +-AT91C_SPI1_IDR.byteEndian=little +-AT91C_SPI1_IDR.type=enum +-AT91C_SPI1_IDR.enum.0.name=*** Write only *** +-AT91C_SPI1_IDR.enum.1.name=Error +-AT91C_SPI1_SR.name="AT91C_SPI1_SR" +-AT91C_SPI1_SR.description="Status Register" +-AT91C_SPI1_SR.helpkey="Status Register" +-AT91C_SPI1_SR.access=memorymapped +-AT91C_SPI1_SR.address=0xFFFE4010 +-AT91C_SPI1_SR.width=32 +-AT91C_SPI1_SR.byteEndian=little +-AT91C_SPI1_SR.permission.write=none +-AT91C_SPI1_TDR.name="AT91C_SPI1_TDR" +-AT91C_SPI1_TDR.description="Transmit Data Register" +-AT91C_SPI1_TDR.helpkey="Transmit Data Register" +-AT91C_SPI1_TDR.access=memorymapped +-AT91C_SPI1_TDR.address=0xFFFE400C +-AT91C_SPI1_TDR.width=32 +-AT91C_SPI1_TDR.byteEndian=little +-AT91C_SPI1_TDR.type=enum +-AT91C_SPI1_TDR.enum.0.name=*** Write only *** +-AT91C_SPI1_TDR.enum.1.name=Error +-AT91C_SPI1_CR.name="AT91C_SPI1_CR" +-AT91C_SPI1_CR.description="Control Register" +-AT91C_SPI1_CR.helpkey="Control Register" +-AT91C_SPI1_CR.access=memorymapped +-AT91C_SPI1_CR.address=0xFFFE4000 +-AT91C_SPI1_CR.width=32 +-AT91C_SPI1_CR.byteEndian=little +-AT91C_SPI1_CR.permission.write=none +-AT91C_SPI1_CSR.name="AT91C_SPI1_CSR" +-AT91C_SPI1_CSR.description="Chip Select Register" +-AT91C_SPI1_CSR.helpkey="Chip Select Register" +-AT91C_SPI1_CSR.access=memorymapped +-AT91C_SPI1_CSR.address=0xFFFE4030 +-AT91C_SPI1_CSR.width=32 +-AT91C_SPI1_CSR.byteEndian=little +-# ========== Register definition for PDC_SPI0 peripheral ========== +-AT91C_SPI0_PTCR.name="AT91C_SPI0_PTCR" +-AT91C_SPI0_PTCR.description="PDC Transfer Control Register" +-AT91C_SPI0_PTCR.helpkey="PDC Transfer Control Register" +-AT91C_SPI0_PTCR.access=memorymapped +-AT91C_SPI0_PTCR.address=0xFFFE0120 +-AT91C_SPI0_PTCR.width=32 +-AT91C_SPI0_PTCR.byteEndian=little +-AT91C_SPI0_PTCR.type=enum +-AT91C_SPI0_PTCR.enum.0.name=*** Write only *** +-AT91C_SPI0_PTCR.enum.1.name=Error +-AT91C_SPI0_TPR.name="AT91C_SPI0_TPR" +-AT91C_SPI0_TPR.description="Transmit Pointer Register" +-AT91C_SPI0_TPR.helpkey="Transmit Pointer Register" +-AT91C_SPI0_TPR.access=memorymapped +-AT91C_SPI0_TPR.address=0xFFFE0108 +-AT91C_SPI0_TPR.width=32 +-AT91C_SPI0_TPR.byteEndian=little +-AT91C_SPI0_TCR.name="AT91C_SPI0_TCR" +-AT91C_SPI0_TCR.description="Transmit Counter Register" +-AT91C_SPI0_TCR.helpkey="Transmit Counter Register" +-AT91C_SPI0_TCR.access=memorymapped +-AT91C_SPI0_TCR.address=0xFFFE010C +-AT91C_SPI0_TCR.width=32 +-AT91C_SPI0_TCR.byteEndian=little +-AT91C_SPI0_RCR.name="AT91C_SPI0_RCR" +-AT91C_SPI0_RCR.description="Receive Counter Register" +-AT91C_SPI0_RCR.helpkey="Receive Counter Register" +-AT91C_SPI0_RCR.access=memorymapped +-AT91C_SPI0_RCR.address=0xFFFE0104 +-AT91C_SPI0_RCR.width=32 +-AT91C_SPI0_RCR.byteEndian=little +-AT91C_SPI0_PTSR.name="AT91C_SPI0_PTSR" +-AT91C_SPI0_PTSR.description="PDC Transfer Status Register" +-AT91C_SPI0_PTSR.helpkey="PDC Transfer Status Register" +-AT91C_SPI0_PTSR.access=memorymapped +-AT91C_SPI0_PTSR.address=0xFFFE0124 +-AT91C_SPI0_PTSR.width=32 +-AT91C_SPI0_PTSR.byteEndian=little +-AT91C_SPI0_PTSR.permission.write=none +-AT91C_SPI0_RNPR.name="AT91C_SPI0_RNPR" +-AT91C_SPI0_RNPR.description="Receive Next Pointer Register" +-AT91C_SPI0_RNPR.helpkey="Receive Next Pointer Register" +-AT91C_SPI0_RNPR.access=memorymapped +-AT91C_SPI0_RNPR.address=0xFFFE0110 +-AT91C_SPI0_RNPR.width=32 +-AT91C_SPI0_RNPR.byteEndian=little +-AT91C_SPI0_RPR.name="AT91C_SPI0_RPR" +-AT91C_SPI0_RPR.description="Receive Pointer Register" +-AT91C_SPI0_RPR.helpkey="Receive Pointer Register" +-AT91C_SPI0_RPR.access=memorymapped +-AT91C_SPI0_RPR.address=0xFFFE0100 +-AT91C_SPI0_RPR.width=32 +-AT91C_SPI0_RPR.byteEndian=little +-AT91C_SPI0_TNCR.name="AT91C_SPI0_TNCR" +-AT91C_SPI0_TNCR.description="Transmit Next Counter Register" +-AT91C_SPI0_TNCR.helpkey="Transmit Next Counter Register" +-AT91C_SPI0_TNCR.access=memorymapped +-AT91C_SPI0_TNCR.address=0xFFFE011C +-AT91C_SPI0_TNCR.width=32 +-AT91C_SPI0_TNCR.byteEndian=little +-AT91C_SPI0_RNCR.name="AT91C_SPI0_RNCR" +-AT91C_SPI0_RNCR.description="Receive Next Counter Register" +-AT91C_SPI0_RNCR.helpkey="Receive Next Counter Register" +-AT91C_SPI0_RNCR.access=memorymapped +-AT91C_SPI0_RNCR.address=0xFFFE0114 +-AT91C_SPI0_RNCR.width=32 +-AT91C_SPI0_RNCR.byteEndian=little +-AT91C_SPI0_TNPR.name="AT91C_SPI0_TNPR" +-AT91C_SPI0_TNPR.description="Transmit Next Pointer Register" +-AT91C_SPI0_TNPR.helpkey="Transmit Next Pointer Register" +-AT91C_SPI0_TNPR.access=memorymapped +-AT91C_SPI0_TNPR.address=0xFFFE0118 +-AT91C_SPI0_TNPR.width=32 +-AT91C_SPI0_TNPR.byteEndian=little +-# ========== Register definition for SPI0 peripheral ========== +-AT91C_SPI0_IER.name="AT91C_SPI0_IER" +-AT91C_SPI0_IER.description="Interrupt Enable Register" +-AT91C_SPI0_IER.helpkey="Interrupt Enable Register" +-AT91C_SPI0_IER.access=memorymapped +-AT91C_SPI0_IER.address=0xFFFE0014 +-AT91C_SPI0_IER.width=32 +-AT91C_SPI0_IER.byteEndian=little +-AT91C_SPI0_IER.type=enum +-AT91C_SPI0_IER.enum.0.name=*** Write only *** +-AT91C_SPI0_IER.enum.1.name=Error +-AT91C_SPI0_SR.name="AT91C_SPI0_SR" +-AT91C_SPI0_SR.description="Status Register" +-AT91C_SPI0_SR.helpkey="Status Register" +-AT91C_SPI0_SR.access=memorymapped +-AT91C_SPI0_SR.address=0xFFFE0010 +-AT91C_SPI0_SR.width=32 +-AT91C_SPI0_SR.byteEndian=little +-AT91C_SPI0_SR.permission.write=none +-AT91C_SPI0_IDR.name="AT91C_SPI0_IDR" +-AT91C_SPI0_IDR.description="Interrupt Disable Register" +-AT91C_SPI0_IDR.helpkey="Interrupt Disable Register" +-AT91C_SPI0_IDR.access=memorymapped +-AT91C_SPI0_IDR.address=0xFFFE0018 +-AT91C_SPI0_IDR.width=32 +-AT91C_SPI0_IDR.byteEndian=little +-AT91C_SPI0_IDR.type=enum +-AT91C_SPI0_IDR.enum.0.name=*** Write only *** +-AT91C_SPI0_IDR.enum.1.name=Error +-AT91C_SPI0_CR.name="AT91C_SPI0_CR" +-AT91C_SPI0_CR.description="Control Register" +-AT91C_SPI0_CR.helpkey="Control Register" +-AT91C_SPI0_CR.access=memorymapped +-AT91C_SPI0_CR.address=0xFFFE0000 +-AT91C_SPI0_CR.width=32 +-AT91C_SPI0_CR.byteEndian=little +-AT91C_SPI0_CR.permission.write=none +-AT91C_SPI0_MR.name="AT91C_SPI0_MR" +-AT91C_SPI0_MR.description="Mode Register" +-AT91C_SPI0_MR.helpkey="Mode Register" +-AT91C_SPI0_MR.access=memorymapped +-AT91C_SPI0_MR.address=0xFFFE0004 +-AT91C_SPI0_MR.width=32 +-AT91C_SPI0_MR.byteEndian=little +-AT91C_SPI0_IMR.name="AT91C_SPI0_IMR" +-AT91C_SPI0_IMR.description="Interrupt Mask Register" +-AT91C_SPI0_IMR.helpkey="Interrupt Mask Register" +-AT91C_SPI0_IMR.access=memorymapped +-AT91C_SPI0_IMR.address=0xFFFE001C +-AT91C_SPI0_IMR.width=32 +-AT91C_SPI0_IMR.byteEndian=little +-AT91C_SPI0_IMR.permission.write=none +-AT91C_SPI0_TDR.name="AT91C_SPI0_TDR" +-AT91C_SPI0_TDR.description="Transmit Data Register" +-AT91C_SPI0_TDR.helpkey="Transmit Data Register" +-AT91C_SPI0_TDR.access=memorymapped +-AT91C_SPI0_TDR.address=0xFFFE000C +-AT91C_SPI0_TDR.width=32 +-AT91C_SPI0_TDR.byteEndian=little +-AT91C_SPI0_TDR.type=enum +-AT91C_SPI0_TDR.enum.0.name=*** Write only *** +-AT91C_SPI0_TDR.enum.1.name=Error +-AT91C_SPI0_RDR.name="AT91C_SPI0_RDR" +-AT91C_SPI0_RDR.description="Receive Data Register" +-AT91C_SPI0_RDR.helpkey="Receive Data Register" +-AT91C_SPI0_RDR.access=memorymapped +-AT91C_SPI0_RDR.address=0xFFFE0008 +-AT91C_SPI0_RDR.width=32 +-AT91C_SPI0_RDR.byteEndian=little +-AT91C_SPI0_RDR.permission.write=none +-AT91C_SPI0_CSR.name="AT91C_SPI0_CSR" +-AT91C_SPI0_CSR.description="Chip Select Register" +-AT91C_SPI0_CSR.helpkey="Chip Select Register" +-AT91C_SPI0_CSR.access=memorymapped +-AT91C_SPI0_CSR.address=0xFFFE0030 +-AT91C_SPI0_CSR.width=32 +-AT91C_SPI0_CSR.byteEndian=little +-# ========== Register definition for PDC_US1 peripheral ========== +-AT91C_US1_RNCR.name="AT91C_US1_RNCR" +-AT91C_US1_RNCR.description="Receive Next Counter Register" +-AT91C_US1_RNCR.helpkey="Receive Next Counter Register" +-AT91C_US1_RNCR.access=memorymapped +-AT91C_US1_RNCR.address=0xFFFC4114 +-AT91C_US1_RNCR.width=32 +-AT91C_US1_RNCR.byteEndian=little +-AT91C_US1_PTCR.name="AT91C_US1_PTCR" +-AT91C_US1_PTCR.description="PDC Transfer Control Register" +-AT91C_US1_PTCR.helpkey="PDC Transfer Control Register" +-AT91C_US1_PTCR.access=memorymapped +-AT91C_US1_PTCR.address=0xFFFC4120 +-AT91C_US1_PTCR.width=32 +-AT91C_US1_PTCR.byteEndian=little +-AT91C_US1_PTCR.type=enum +-AT91C_US1_PTCR.enum.0.name=*** Write only *** +-AT91C_US1_PTCR.enum.1.name=Error +-AT91C_US1_TCR.name="AT91C_US1_TCR" +-AT91C_US1_TCR.description="Transmit Counter Register" +-AT91C_US1_TCR.helpkey="Transmit Counter Register" +-AT91C_US1_TCR.access=memorymapped +-AT91C_US1_TCR.address=0xFFFC410C +-AT91C_US1_TCR.width=32 +-AT91C_US1_TCR.byteEndian=little +-AT91C_US1_PTSR.name="AT91C_US1_PTSR" +-AT91C_US1_PTSR.description="PDC Transfer Status Register" +-AT91C_US1_PTSR.helpkey="PDC Transfer Status Register" +-AT91C_US1_PTSR.access=memorymapped +-AT91C_US1_PTSR.address=0xFFFC4124 +-AT91C_US1_PTSR.width=32 +-AT91C_US1_PTSR.byteEndian=little +-AT91C_US1_PTSR.permission.write=none +-AT91C_US1_TNPR.name="AT91C_US1_TNPR" +-AT91C_US1_TNPR.description="Transmit Next Pointer Register" +-AT91C_US1_TNPR.helpkey="Transmit Next Pointer Register" +-AT91C_US1_TNPR.access=memorymapped +-AT91C_US1_TNPR.address=0xFFFC4118 +-AT91C_US1_TNPR.width=32 +-AT91C_US1_TNPR.byteEndian=little +-AT91C_US1_RCR.name="AT91C_US1_RCR" +-AT91C_US1_RCR.description="Receive Counter Register" +-AT91C_US1_RCR.helpkey="Receive Counter Register" +-AT91C_US1_RCR.access=memorymapped +-AT91C_US1_RCR.address=0xFFFC4104 +-AT91C_US1_RCR.width=32 +-AT91C_US1_RCR.byteEndian=little +-AT91C_US1_RNPR.name="AT91C_US1_RNPR" +-AT91C_US1_RNPR.description="Receive Next Pointer Register" +-AT91C_US1_RNPR.helpkey="Receive Next Pointer Register" +-AT91C_US1_RNPR.access=memorymapped +-AT91C_US1_RNPR.address=0xFFFC4110 +-AT91C_US1_RNPR.width=32 +-AT91C_US1_RNPR.byteEndian=little +-AT91C_US1_RPR.name="AT91C_US1_RPR" +-AT91C_US1_RPR.description="Receive Pointer Register" +-AT91C_US1_RPR.helpkey="Receive Pointer Register" +-AT91C_US1_RPR.access=memorymapped +-AT91C_US1_RPR.address=0xFFFC4100 +-AT91C_US1_RPR.width=32 +-AT91C_US1_RPR.byteEndian=little +-AT91C_US1_TNCR.name="AT91C_US1_TNCR" +-AT91C_US1_TNCR.description="Transmit Next Counter Register" +-AT91C_US1_TNCR.helpkey="Transmit Next Counter Register" +-AT91C_US1_TNCR.access=memorymapped +-AT91C_US1_TNCR.address=0xFFFC411C +-AT91C_US1_TNCR.width=32 +-AT91C_US1_TNCR.byteEndian=little +-AT91C_US1_TPR.name="AT91C_US1_TPR" +-AT91C_US1_TPR.description="Transmit Pointer Register" +-AT91C_US1_TPR.helpkey="Transmit Pointer Register" +-AT91C_US1_TPR.access=memorymapped +-AT91C_US1_TPR.address=0xFFFC4108 +-AT91C_US1_TPR.width=32 +-AT91C_US1_TPR.byteEndian=little +-# ========== Register definition for US1 peripheral ========== +-AT91C_US1_IF.name="AT91C_US1_IF" +-AT91C_US1_IF.description="IRDA_FILTER Register" +-AT91C_US1_IF.helpkey="IRDA_FILTER Register" +-AT91C_US1_IF.access=memorymapped +-AT91C_US1_IF.address=0xFFFC404C +-AT91C_US1_IF.width=32 +-AT91C_US1_IF.byteEndian=little +-AT91C_US1_NER.name="AT91C_US1_NER" +-AT91C_US1_NER.description="Nb Errors Register" +-AT91C_US1_NER.helpkey="Nb Errors Register" +-AT91C_US1_NER.access=memorymapped +-AT91C_US1_NER.address=0xFFFC4044 +-AT91C_US1_NER.width=32 +-AT91C_US1_NER.byteEndian=little +-AT91C_US1_NER.permission.write=none +-AT91C_US1_RTOR.name="AT91C_US1_RTOR" +-AT91C_US1_RTOR.description="Receiver Time-out Register" +-AT91C_US1_RTOR.helpkey="Receiver Time-out Register" +-AT91C_US1_RTOR.access=memorymapped +-AT91C_US1_RTOR.address=0xFFFC4024 +-AT91C_US1_RTOR.width=32 +-AT91C_US1_RTOR.byteEndian=little +-AT91C_US1_CSR.name="AT91C_US1_CSR" +-AT91C_US1_CSR.description="Channel Status Register" +-AT91C_US1_CSR.helpkey="Channel Status Register" +-AT91C_US1_CSR.access=memorymapped +-AT91C_US1_CSR.address=0xFFFC4014 +-AT91C_US1_CSR.width=32 +-AT91C_US1_CSR.byteEndian=little +-AT91C_US1_CSR.permission.write=none +-AT91C_US1_IDR.name="AT91C_US1_IDR" +-AT91C_US1_IDR.description="Interrupt Disable Register" +-AT91C_US1_IDR.helpkey="Interrupt Disable Register" +-AT91C_US1_IDR.access=memorymapped +-AT91C_US1_IDR.address=0xFFFC400C +-AT91C_US1_IDR.width=32 +-AT91C_US1_IDR.byteEndian=little +-AT91C_US1_IDR.type=enum +-AT91C_US1_IDR.enum.0.name=*** Write only *** +-AT91C_US1_IDR.enum.1.name=Error +-AT91C_US1_IER.name="AT91C_US1_IER" +-AT91C_US1_IER.description="Interrupt Enable Register" +-AT91C_US1_IER.helpkey="Interrupt Enable Register" +-AT91C_US1_IER.access=memorymapped +-AT91C_US1_IER.address=0xFFFC4008 +-AT91C_US1_IER.width=32 +-AT91C_US1_IER.byteEndian=little +-AT91C_US1_IER.type=enum +-AT91C_US1_IER.enum.0.name=*** Write only *** +-AT91C_US1_IER.enum.1.name=Error +-AT91C_US1_THR.name="AT91C_US1_THR" +-AT91C_US1_THR.description="Transmitter Holding Register" +-AT91C_US1_THR.helpkey="Transmitter Holding Register" +-AT91C_US1_THR.access=memorymapped +-AT91C_US1_THR.address=0xFFFC401C +-AT91C_US1_THR.width=32 +-AT91C_US1_THR.byteEndian=little +-AT91C_US1_THR.type=enum +-AT91C_US1_THR.enum.0.name=*** Write only *** +-AT91C_US1_THR.enum.1.name=Error +-AT91C_US1_TTGR.name="AT91C_US1_TTGR" +-AT91C_US1_TTGR.description="Transmitter Time-guard Register" +-AT91C_US1_TTGR.helpkey="Transmitter Time-guard Register" +-AT91C_US1_TTGR.access=memorymapped +-AT91C_US1_TTGR.address=0xFFFC4028 +-AT91C_US1_TTGR.width=32 +-AT91C_US1_TTGR.byteEndian=little +-AT91C_US1_RHR.name="AT91C_US1_RHR" +-AT91C_US1_RHR.description="Receiver Holding Register" +-AT91C_US1_RHR.helpkey="Receiver Holding Register" +-AT91C_US1_RHR.access=memorymapped +-AT91C_US1_RHR.address=0xFFFC4018 +-AT91C_US1_RHR.width=32 +-AT91C_US1_RHR.byteEndian=little +-AT91C_US1_RHR.permission.write=none +-AT91C_US1_BRGR.name="AT91C_US1_BRGR" +-AT91C_US1_BRGR.description="Baud Rate Generator Register" +-AT91C_US1_BRGR.helpkey="Baud Rate Generator Register" +-AT91C_US1_BRGR.access=memorymapped +-AT91C_US1_BRGR.address=0xFFFC4020 +-AT91C_US1_BRGR.width=32 +-AT91C_US1_BRGR.byteEndian=little +-AT91C_US1_IMR.name="AT91C_US1_IMR" +-AT91C_US1_IMR.description="Interrupt Mask Register" +-AT91C_US1_IMR.helpkey="Interrupt Mask Register" +-AT91C_US1_IMR.access=memorymapped +-AT91C_US1_IMR.address=0xFFFC4010 +-AT91C_US1_IMR.width=32 +-AT91C_US1_IMR.byteEndian=little +-AT91C_US1_IMR.permission.write=none +-AT91C_US1_FIDI.name="AT91C_US1_FIDI" +-AT91C_US1_FIDI.description="FI_DI_Ratio Register" +-AT91C_US1_FIDI.helpkey="FI_DI_Ratio Register" +-AT91C_US1_FIDI.access=memorymapped +-AT91C_US1_FIDI.address=0xFFFC4040 +-AT91C_US1_FIDI.width=32 +-AT91C_US1_FIDI.byteEndian=little +-AT91C_US1_CR.name="AT91C_US1_CR" +-AT91C_US1_CR.description="Control Register" +-AT91C_US1_CR.helpkey="Control Register" +-AT91C_US1_CR.access=memorymapped +-AT91C_US1_CR.address=0xFFFC4000 +-AT91C_US1_CR.width=32 +-AT91C_US1_CR.byteEndian=little +-AT91C_US1_CR.type=enum +-AT91C_US1_CR.enum.0.name=*** Write only *** +-AT91C_US1_CR.enum.1.name=Error +-AT91C_US1_MR.name="AT91C_US1_MR" +-AT91C_US1_MR.description="Mode Register" +-AT91C_US1_MR.helpkey="Mode Register" +-AT91C_US1_MR.access=memorymapped +-AT91C_US1_MR.address=0xFFFC4004 +-AT91C_US1_MR.width=32 +-AT91C_US1_MR.byteEndian=little +-# ========== Register definition for PDC_US0 peripheral ========== +-AT91C_US0_TNPR.name="AT91C_US0_TNPR" +-AT91C_US0_TNPR.description="Transmit Next Pointer Register" +-AT91C_US0_TNPR.helpkey="Transmit Next Pointer Register" +-AT91C_US0_TNPR.access=memorymapped +-AT91C_US0_TNPR.address=0xFFFC0118 +-AT91C_US0_TNPR.width=32 +-AT91C_US0_TNPR.byteEndian=little +-AT91C_US0_RNPR.name="AT91C_US0_RNPR" +-AT91C_US0_RNPR.description="Receive Next Pointer Register" +-AT91C_US0_RNPR.helpkey="Receive Next Pointer Register" +-AT91C_US0_RNPR.access=memorymapped +-AT91C_US0_RNPR.address=0xFFFC0110 +-AT91C_US0_RNPR.width=32 +-AT91C_US0_RNPR.byteEndian=little +-AT91C_US0_TCR.name="AT91C_US0_TCR" +-AT91C_US0_TCR.description="Transmit Counter Register" +-AT91C_US0_TCR.helpkey="Transmit Counter Register" +-AT91C_US0_TCR.access=memorymapped +-AT91C_US0_TCR.address=0xFFFC010C +-AT91C_US0_TCR.width=32 +-AT91C_US0_TCR.byteEndian=little +-AT91C_US0_PTCR.name="AT91C_US0_PTCR" +-AT91C_US0_PTCR.description="PDC Transfer Control Register" +-AT91C_US0_PTCR.helpkey="PDC Transfer Control Register" +-AT91C_US0_PTCR.access=memorymapped +-AT91C_US0_PTCR.address=0xFFFC0120 +-AT91C_US0_PTCR.width=32 +-AT91C_US0_PTCR.byteEndian=little +-AT91C_US0_PTCR.type=enum +-AT91C_US0_PTCR.enum.0.name=*** Write only *** +-AT91C_US0_PTCR.enum.1.name=Error +-AT91C_US0_PTSR.name="AT91C_US0_PTSR" +-AT91C_US0_PTSR.description="PDC Transfer Status Register" +-AT91C_US0_PTSR.helpkey="PDC Transfer Status Register" +-AT91C_US0_PTSR.access=memorymapped +-AT91C_US0_PTSR.address=0xFFFC0124 +-AT91C_US0_PTSR.width=32 +-AT91C_US0_PTSR.byteEndian=little +-AT91C_US0_PTSR.permission.write=none +-AT91C_US0_TNCR.name="AT91C_US0_TNCR" +-AT91C_US0_TNCR.description="Transmit Next Counter Register" +-AT91C_US0_TNCR.helpkey="Transmit Next Counter Register" +-AT91C_US0_TNCR.access=memorymapped +-AT91C_US0_TNCR.address=0xFFFC011C +-AT91C_US0_TNCR.width=32 +-AT91C_US0_TNCR.byteEndian=little +-AT91C_US0_TPR.name="AT91C_US0_TPR" +-AT91C_US0_TPR.description="Transmit Pointer Register" +-AT91C_US0_TPR.helpkey="Transmit Pointer Register" +-AT91C_US0_TPR.access=memorymapped +-AT91C_US0_TPR.address=0xFFFC0108 +-AT91C_US0_TPR.width=32 +-AT91C_US0_TPR.byteEndian=little +-AT91C_US0_RCR.name="AT91C_US0_RCR" +-AT91C_US0_RCR.description="Receive Counter Register" +-AT91C_US0_RCR.helpkey="Receive Counter Register" +-AT91C_US0_RCR.access=memorymapped +-AT91C_US0_RCR.address=0xFFFC0104 +-AT91C_US0_RCR.width=32 +-AT91C_US0_RCR.byteEndian=little +-AT91C_US0_RPR.name="AT91C_US0_RPR" +-AT91C_US0_RPR.description="Receive Pointer Register" +-AT91C_US0_RPR.helpkey="Receive Pointer Register" +-AT91C_US0_RPR.access=memorymapped +-AT91C_US0_RPR.address=0xFFFC0100 +-AT91C_US0_RPR.width=32 +-AT91C_US0_RPR.byteEndian=little +-AT91C_US0_RNCR.name="AT91C_US0_RNCR" +-AT91C_US0_RNCR.description="Receive Next Counter Register" +-AT91C_US0_RNCR.helpkey="Receive Next Counter Register" +-AT91C_US0_RNCR.access=memorymapped +-AT91C_US0_RNCR.address=0xFFFC0114 +-AT91C_US0_RNCR.width=32 +-AT91C_US0_RNCR.byteEndian=little +-# ========== Register definition for US0 peripheral ========== +-AT91C_US0_BRGR.name="AT91C_US0_BRGR" +-AT91C_US0_BRGR.description="Baud Rate Generator Register" +-AT91C_US0_BRGR.helpkey="Baud Rate Generator Register" +-AT91C_US0_BRGR.access=memorymapped +-AT91C_US0_BRGR.address=0xFFFC0020 +-AT91C_US0_BRGR.width=32 +-AT91C_US0_BRGR.byteEndian=little +-AT91C_US0_NER.name="AT91C_US0_NER" +-AT91C_US0_NER.description="Nb Errors Register" +-AT91C_US0_NER.helpkey="Nb Errors Register" +-AT91C_US0_NER.access=memorymapped +-AT91C_US0_NER.address=0xFFFC0044 +-AT91C_US0_NER.width=32 +-AT91C_US0_NER.byteEndian=little +-AT91C_US0_NER.permission.write=none +-AT91C_US0_CR.name="AT91C_US0_CR" +-AT91C_US0_CR.description="Control Register" +-AT91C_US0_CR.helpkey="Control Register" +-AT91C_US0_CR.access=memorymapped +-AT91C_US0_CR.address=0xFFFC0000 +-AT91C_US0_CR.width=32 +-AT91C_US0_CR.byteEndian=little +-AT91C_US0_CR.type=enum +-AT91C_US0_CR.enum.0.name=*** Write only *** +-AT91C_US0_CR.enum.1.name=Error +-AT91C_US0_IMR.name="AT91C_US0_IMR" +-AT91C_US0_IMR.description="Interrupt Mask Register" +-AT91C_US0_IMR.helpkey="Interrupt Mask Register" +-AT91C_US0_IMR.access=memorymapped +-AT91C_US0_IMR.address=0xFFFC0010 +-AT91C_US0_IMR.width=32 +-AT91C_US0_IMR.byteEndian=little +-AT91C_US0_IMR.permission.write=none +-AT91C_US0_FIDI.name="AT91C_US0_FIDI" +-AT91C_US0_FIDI.description="FI_DI_Ratio Register" +-AT91C_US0_FIDI.helpkey="FI_DI_Ratio Register" +-AT91C_US0_FIDI.access=memorymapped +-AT91C_US0_FIDI.address=0xFFFC0040 +-AT91C_US0_FIDI.width=32 +-AT91C_US0_FIDI.byteEndian=little +-AT91C_US0_TTGR.name="AT91C_US0_TTGR" +-AT91C_US0_TTGR.description="Transmitter Time-guard Register" +-AT91C_US0_TTGR.helpkey="Transmitter Time-guard Register" +-AT91C_US0_TTGR.access=memorymapped +-AT91C_US0_TTGR.address=0xFFFC0028 +-AT91C_US0_TTGR.width=32 +-AT91C_US0_TTGR.byteEndian=little +-AT91C_US0_MR.name="AT91C_US0_MR" +-AT91C_US0_MR.description="Mode Register" +-AT91C_US0_MR.helpkey="Mode Register" +-AT91C_US0_MR.access=memorymapped +-AT91C_US0_MR.address=0xFFFC0004 +-AT91C_US0_MR.width=32 +-AT91C_US0_MR.byteEndian=little +-AT91C_US0_RTOR.name="AT91C_US0_RTOR" +-AT91C_US0_RTOR.description="Receiver Time-out Register" +-AT91C_US0_RTOR.helpkey="Receiver Time-out Register" +-AT91C_US0_RTOR.access=memorymapped +-AT91C_US0_RTOR.address=0xFFFC0024 +-AT91C_US0_RTOR.width=32 +-AT91C_US0_RTOR.byteEndian=little +-AT91C_US0_CSR.name="AT91C_US0_CSR" +-AT91C_US0_CSR.description="Channel Status Register" +-AT91C_US0_CSR.helpkey="Channel Status Register" +-AT91C_US0_CSR.access=memorymapped +-AT91C_US0_CSR.address=0xFFFC0014 +-AT91C_US0_CSR.width=32 +-AT91C_US0_CSR.byteEndian=little +-AT91C_US0_CSR.permission.write=none +-AT91C_US0_RHR.name="AT91C_US0_RHR" +-AT91C_US0_RHR.description="Receiver Holding Register" +-AT91C_US0_RHR.helpkey="Receiver Holding Register" +-AT91C_US0_RHR.access=memorymapped +-AT91C_US0_RHR.address=0xFFFC0018 +-AT91C_US0_RHR.width=32 +-AT91C_US0_RHR.byteEndian=little +-AT91C_US0_RHR.permission.write=none +-AT91C_US0_IDR.name="AT91C_US0_IDR" +-AT91C_US0_IDR.description="Interrupt Disable Register" +-AT91C_US0_IDR.helpkey="Interrupt Disable Register" +-AT91C_US0_IDR.access=memorymapped +-AT91C_US0_IDR.address=0xFFFC000C +-AT91C_US0_IDR.width=32 +-AT91C_US0_IDR.byteEndian=little +-AT91C_US0_IDR.type=enum +-AT91C_US0_IDR.enum.0.name=*** Write only *** +-AT91C_US0_IDR.enum.1.name=Error +-AT91C_US0_THR.name="AT91C_US0_THR" +-AT91C_US0_THR.description="Transmitter Holding Register" +-AT91C_US0_THR.helpkey="Transmitter Holding Register" +-AT91C_US0_THR.access=memorymapped +-AT91C_US0_THR.address=0xFFFC001C +-AT91C_US0_THR.width=32 +-AT91C_US0_THR.byteEndian=little +-AT91C_US0_THR.type=enum +-AT91C_US0_THR.enum.0.name=*** Write only *** +-AT91C_US0_THR.enum.1.name=Error +-AT91C_US0_IF.name="AT91C_US0_IF" +-AT91C_US0_IF.description="IRDA_FILTER Register" +-AT91C_US0_IF.helpkey="IRDA_FILTER Register" +-AT91C_US0_IF.access=memorymapped +-AT91C_US0_IF.address=0xFFFC004C +-AT91C_US0_IF.width=32 +-AT91C_US0_IF.byteEndian=little +-AT91C_US0_IER.name="AT91C_US0_IER" +-AT91C_US0_IER.description="Interrupt Enable Register" +-AT91C_US0_IER.helpkey="Interrupt Enable Register" +-AT91C_US0_IER.access=memorymapped +-AT91C_US0_IER.address=0xFFFC0008 +-AT91C_US0_IER.width=32 +-AT91C_US0_IER.byteEndian=little +-AT91C_US0_IER.type=enum +-AT91C_US0_IER.enum.0.name=*** Write only *** +-AT91C_US0_IER.enum.1.name=Error +-# ========== Register definition for PDC_SSC peripheral ========== +-AT91C_SSC_TNCR.name="AT91C_SSC_TNCR" +-AT91C_SSC_TNCR.description="Transmit Next Counter Register" +-AT91C_SSC_TNCR.helpkey="Transmit Next Counter Register" +-AT91C_SSC_TNCR.access=memorymapped +-AT91C_SSC_TNCR.address=0xFFFD411C +-AT91C_SSC_TNCR.width=32 +-AT91C_SSC_TNCR.byteEndian=little +-AT91C_SSC_RPR.name="AT91C_SSC_RPR" +-AT91C_SSC_RPR.description="Receive Pointer Register" +-AT91C_SSC_RPR.helpkey="Receive Pointer Register" +-AT91C_SSC_RPR.access=memorymapped +-AT91C_SSC_RPR.address=0xFFFD4100 +-AT91C_SSC_RPR.width=32 +-AT91C_SSC_RPR.byteEndian=little +-AT91C_SSC_RNCR.name="AT91C_SSC_RNCR" +-AT91C_SSC_RNCR.description="Receive Next Counter Register" +-AT91C_SSC_RNCR.helpkey="Receive Next Counter Register" +-AT91C_SSC_RNCR.access=memorymapped +-AT91C_SSC_RNCR.address=0xFFFD4114 +-AT91C_SSC_RNCR.width=32 +-AT91C_SSC_RNCR.byteEndian=little +-AT91C_SSC_TPR.name="AT91C_SSC_TPR" +-AT91C_SSC_TPR.description="Transmit Pointer Register" +-AT91C_SSC_TPR.helpkey="Transmit Pointer Register" +-AT91C_SSC_TPR.access=memorymapped +-AT91C_SSC_TPR.address=0xFFFD4108 +-AT91C_SSC_TPR.width=32 +-AT91C_SSC_TPR.byteEndian=little +-AT91C_SSC_PTCR.name="AT91C_SSC_PTCR" +-AT91C_SSC_PTCR.description="PDC Transfer Control Register" +-AT91C_SSC_PTCR.helpkey="PDC Transfer Control Register" +-AT91C_SSC_PTCR.access=memorymapped +-AT91C_SSC_PTCR.address=0xFFFD4120 +-AT91C_SSC_PTCR.width=32 +-AT91C_SSC_PTCR.byteEndian=little +-AT91C_SSC_PTCR.type=enum +-AT91C_SSC_PTCR.enum.0.name=*** Write only *** +-AT91C_SSC_PTCR.enum.1.name=Error +-AT91C_SSC_TCR.name="AT91C_SSC_TCR" +-AT91C_SSC_TCR.description="Transmit Counter Register" +-AT91C_SSC_TCR.helpkey="Transmit Counter Register" +-AT91C_SSC_TCR.access=memorymapped +-AT91C_SSC_TCR.address=0xFFFD410C +-AT91C_SSC_TCR.width=32 +-AT91C_SSC_TCR.byteEndian=little +-AT91C_SSC_RCR.name="AT91C_SSC_RCR" +-AT91C_SSC_RCR.description="Receive Counter Register" +-AT91C_SSC_RCR.helpkey="Receive Counter Register" +-AT91C_SSC_RCR.access=memorymapped +-AT91C_SSC_RCR.address=0xFFFD4104 +-AT91C_SSC_RCR.width=32 +-AT91C_SSC_RCR.byteEndian=little +-AT91C_SSC_RNPR.name="AT91C_SSC_RNPR" +-AT91C_SSC_RNPR.description="Receive Next Pointer Register" +-AT91C_SSC_RNPR.helpkey="Receive Next Pointer Register" +-AT91C_SSC_RNPR.access=memorymapped +-AT91C_SSC_RNPR.address=0xFFFD4110 +-AT91C_SSC_RNPR.width=32 +-AT91C_SSC_RNPR.byteEndian=little +-AT91C_SSC_TNPR.name="AT91C_SSC_TNPR" +-AT91C_SSC_TNPR.description="Transmit Next Pointer Register" +-AT91C_SSC_TNPR.helpkey="Transmit Next Pointer Register" +-AT91C_SSC_TNPR.access=memorymapped +-AT91C_SSC_TNPR.address=0xFFFD4118 +-AT91C_SSC_TNPR.width=32 +-AT91C_SSC_TNPR.byteEndian=little +-AT91C_SSC_PTSR.name="AT91C_SSC_PTSR" +-AT91C_SSC_PTSR.description="PDC Transfer Status Register" +-AT91C_SSC_PTSR.helpkey="PDC Transfer Status Register" +-AT91C_SSC_PTSR.access=memorymapped +-AT91C_SSC_PTSR.address=0xFFFD4124 +-AT91C_SSC_PTSR.width=32 +-AT91C_SSC_PTSR.byteEndian=little +-AT91C_SSC_PTSR.permission.write=none +-# ========== Register definition for SSC peripheral ========== +-AT91C_SSC_RHR.name="AT91C_SSC_RHR" +-AT91C_SSC_RHR.description="Receive Holding Register" +-AT91C_SSC_RHR.helpkey="Receive Holding Register" +-AT91C_SSC_RHR.access=memorymapped +-AT91C_SSC_RHR.address=0xFFFD4020 +-AT91C_SSC_RHR.width=32 +-AT91C_SSC_RHR.byteEndian=little +-AT91C_SSC_RHR.permission.write=none +-AT91C_SSC_RSHR.name="AT91C_SSC_RSHR" +-AT91C_SSC_RSHR.description="Receive Sync Holding Register" +-AT91C_SSC_RSHR.helpkey="Receive Sync Holding Register" +-AT91C_SSC_RSHR.access=memorymapped +-AT91C_SSC_RSHR.address=0xFFFD4030 +-AT91C_SSC_RSHR.width=32 +-AT91C_SSC_RSHR.byteEndian=little +-AT91C_SSC_RSHR.permission.write=none +-AT91C_SSC_TFMR.name="AT91C_SSC_TFMR" +-AT91C_SSC_TFMR.description="Transmit Frame Mode Register" +-AT91C_SSC_TFMR.helpkey="Transmit Frame Mode Register" +-AT91C_SSC_TFMR.access=memorymapped +-AT91C_SSC_TFMR.address=0xFFFD401C +-AT91C_SSC_TFMR.width=32 +-AT91C_SSC_TFMR.byteEndian=little +-AT91C_SSC_IDR.name="AT91C_SSC_IDR" +-AT91C_SSC_IDR.description="Interrupt Disable Register" +-AT91C_SSC_IDR.helpkey="Interrupt Disable Register" +-AT91C_SSC_IDR.access=memorymapped +-AT91C_SSC_IDR.address=0xFFFD4048 +-AT91C_SSC_IDR.width=32 +-AT91C_SSC_IDR.byteEndian=little +-AT91C_SSC_IDR.type=enum +-AT91C_SSC_IDR.enum.0.name=*** Write only *** +-AT91C_SSC_IDR.enum.1.name=Error +-AT91C_SSC_THR.name="AT91C_SSC_THR" +-AT91C_SSC_THR.description="Transmit Holding Register" +-AT91C_SSC_THR.helpkey="Transmit Holding Register" +-AT91C_SSC_THR.access=memorymapped +-AT91C_SSC_THR.address=0xFFFD4024 +-AT91C_SSC_THR.width=32 +-AT91C_SSC_THR.byteEndian=little +-AT91C_SSC_THR.type=enum +-AT91C_SSC_THR.enum.0.name=*** Write only *** +-AT91C_SSC_THR.enum.1.name=Error +-AT91C_SSC_RCMR.name="AT91C_SSC_RCMR" +-AT91C_SSC_RCMR.description="Receive Clock ModeRegister" +-AT91C_SSC_RCMR.helpkey="Receive Clock ModeRegister" +-AT91C_SSC_RCMR.access=memorymapped +-AT91C_SSC_RCMR.address=0xFFFD4010 +-AT91C_SSC_RCMR.width=32 +-AT91C_SSC_RCMR.byteEndian=little +-AT91C_SSC_IER.name="AT91C_SSC_IER" +-AT91C_SSC_IER.description="Interrupt Enable Register" +-AT91C_SSC_IER.helpkey="Interrupt Enable Register" +-AT91C_SSC_IER.access=memorymapped +-AT91C_SSC_IER.address=0xFFFD4044 +-AT91C_SSC_IER.width=32 +-AT91C_SSC_IER.byteEndian=little +-AT91C_SSC_IER.type=enum +-AT91C_SSC_IER.enum.0.name=*** Write only *** +-AT91C_SSC_IER.enum.1.name=Error +-AT91C_SSC_TSHR.name="AT91C_SSC_TSHR" +-AT91C_SSC_TSHR.description="Transmit Sync Holding Register" +-AT91C_SSC_TSHR.helpkey="Transmit Sync Holding Register" +-AT91C_SSC_TSHR.access=memorymapped +-AT91C_SSC_TSHR.address=0xFFFD4034 +-AT91C_SSC_TSHR.width=32 +-AT91C_SSC_TSHR.byteEndian=little +-AT91C_SSC_SR.name="AT91C_SSC_SR" +-AT91C_SSC_SR.description="Status Register" +-AT91C_SSC_SR.helpkey="Status Register" +-AT91C_SSC_SR.access=memorymapped +-AT91C_SSC_SR.address=0xFFFD4040 +-AT91C_SSC_SR.width=32 +-AT91C_SSC_SR.byteEndian=little +-AT91C_SSC_SR.permission.write=none +-AT91C_SSC_CMR.name="AT91C_SSC_CMR" +-AT91C_SSC_CMR.description="Clock Mode Register" +-AT91C_SSC_CMR.helpkey="Clock Mode Register" +-AT91C_SSC_CMR.access=memorymapped +-AT91C_SSC_CMR.address=0xFFFD4004 +-AT91C_SSC_CMR.width=32 +-AT91C_SSC_CMR.byteEndian=little +-AT91C_SSC_TCMR.name="AT91C_SSC_TCMR" +-AT91C_SSC_TCMR.description="Transmit Clock Mode Register" +-AT91C_SSC_TCMR.helpkey="Transmit Clock Mode Register" +-AT91C_SSC_TCMR.access=memorymapped +-AT91C_SSC_TCMR.address=0xFFFD4018 +-AT91C_SSC_TCMR.width=32 +-AT91C_SSC_TCMR.byteEndian=little +-AT91C_SSC_CR.name="AT91C_SSC_CR" +-AT91C_SSC_CR.description="Control Register" +-AT91C_SSC_CR.helpkey="Control Register" +-AT91C_SSC_CR.access=memorymapped +-AT91C_SSC_CR.address=0xFFFD4000 +-AT91C_SSC_CR.width=32 +-AT91C_SSC_CR.byteEndian=little +-AT91C_SSC_CR.type=enum +-AT91C_SSC_CR.enum.0.name=*** Write only *** +-AT91C_SSC_CR.enum.1.name=Error +-AT91C_SSC_IMR.name="AT91C_SSC_IMR" +-AT91C_SSC_IMR.description="Interrupt Mask Register" +-AT91C_SSC_IMR.helpkey="Interrupt Mask Register" +-AT91C_SSC_IMR.access=memorymapped +-AT91C_SSC_IMR.address=0xFFFD404C +-AT91C_SSC_IMR.width=32 +-AT91C_SSC_IMR.byteEndian=little +-AT91C_SSC_IMR.permission.write=none +-AT91C_SSC_RFMR.name="AT91C_SSC_RFMR" +-AT91C_SSC_RFMR.description="Receive Frame Mode Register" +-AT91C_SSC_RFMR.helpkey="Receive Frame Mode Register" +-AT91C_SSC_RFMR.access=memorymapped +-AT91C_SSC_RFMR.address=0xFFFD4014 +-AT91C_SSC_RFMR.width=32 +-AT91C_SSC_RFMR.byteEndian=little +-# ========== Register definition for TWI peripheral ========== +-AT91C_TWI_IER.name="AT91C_TWI_IER" +-AT91C_TWI_IER.description="Interrupt Enable Register" +-AT91C_TWI_IER.helpkey="Interrupt Enable Register" +-AT91C_TWI_IER.access=memorymapped +-AT91C_TWI_IER.address=0xFFFB8024 +-AT91C_TWI_IER.width=32 +-AT91C_TWI_IER.byteEndian=little +-AT91C_TWI_IER.type=enum +-AT91C_TWI_IER.enum.0.name=*** Write only *** +-AT91C_TWI_IER.enum.1.name=Error +-AT91C_TWI_CR.name="AT91C_TWI_CR" +-AT91C_TWI_CR.description="Control Register" +-AT91C_TWI_CR.helpkey="Control Register" +-AT91C_TWI_CR.access=memorymapped +-AT91C_TWI_CR.address=0xFFFB8000 +-AT91C_TWI_CR.width=32 +-AT91C_TWI_CR.byteEndian=little +-AT91C_TWI_CR.type=enum +-AT91C_TWI_CR.enum.0.name=*** Write only *** +-AT91C_TWI_CR.enum.1.name=Error +-AT91C_TWI_SR.name="AT91C_TWI_SR" +-AT91C_TWI_SR.description="Status Register" +-AT91C_TWI_SR.helpkey="Status Register" +-AT91C_TWI_SR.access=memorymapped +-AT91C_TWI_SR.address=0xFFFB8020 +-AT91C_TWI_SR.width=32 +-AT91C_TWI_SR.byteEndian=little +-AT91C_TWI_SR.permission.write=none +-AT91C_TWI_IMR.name="AT91C_TWI_IMR" +-AT91C_TWI_IMR.description="Interrupt Mask Register" +-AT91C_TWI_IMR.helpkey="Interrupt Mask Register" +-AT91C_TWI_IMR.access=memorymapped +-AT91C_TWI_IMR.address=0xFFFB802C +-AT91C_TWI_IMR.width=32 +-AT91C_TWI_IMR.byteEndian=little +-AT91C_TWI_IMR.permission.write=none +-AT91C_TWI_THR.name="AT91C_TWI_THR" +-AT91C_TWI_THR.description="Transmit Holding Register" +-AT91C_TWI_THR.helpkey="Transmit Holding Register" +-AT91C_TWI_THR.access=memorymapped +-AT91C_TWI_THR.address=0xFFFB8034 +-AT91C_TWI_THR.width=32 +-AT91C_TWI_THR.byteEndian=little +-AT91C_TWI_THR.type=enum +-AT91C_TWI_THR.enum.0.name=*** Write only *** +-AT91C_TWI_THR.enum.1.name=Error +-AT91C_TWI_IDR.name="AT91C_TWI_IDR" +-AT91C_TWI_IDR.description="Interrupt Disable Register" +-AT91C_TWI_IDR.helpkey="Interrupt Disable Register" +-AT91C_TWI_IDR.access=memorymapped +-AT91C_TWI_IDR.address=0xFFFB8028 +-AT91C_TWI_IDR.width=32 +-AT91C_TWI_IDR.byteEndian=little +-AT91C_TWI_IDR.type=enum +-AT91C_TWI_IDR.enum.0.name=*** Write only *** +-AT91C_TWI_IDR.enum.1.name=Error +-AT91C_TWI_IADR.name="AT91C_TWI_IADR" +-AT91C_TWI_IADR.description="Internal Address Register" +-AT91C_TWI_IADR.helpkey="Internal Address Register" +-AT91C_TWI_IADR.access=memorymapped +-AT91C_TWI_IADR.address=0xFFFB800C +-AT91C_TWI_IADR.width=32 +-AT91C_TWI_IADR.byteEndian=little +-AT91C_TWI_MMR.name="AT91C_TWI_MMR" +-AT91C_TWI_MMR.description="Master Mode Register" +-AT91C_TWI_MMR.helpkey="Master Mode Register" +-AT91C_TWI_MMR.access=memorymapped +-AT91C_TWI_MMR.address=0xFFFB8004 +-AT91C_TWI_MMR.width=32 +-AT91C_TWI_MMR.byteEndian=little +-AT91C_TWI_CWGR.name="AT91C_TWI_CWGR" +-AT91C_TWI_CWGR.description="Clock Waveform Generator Register" +-AT91C_TWI_CWGR.helpkey="Clock Waveform Generator Register" +-AT91C_TWI_CWGR.access=memorymapped +-AT91C_TWI_CWGR.address=0xFFFB8010 +-AT91C_TWI_CWGR.width=32 +-AT91C_TWI_CWGR.byteEndian=little +-AT91C_TWI_RHR.name="AT91C_TWI_RHR" +-AT91C_TWI_RHR.description="Receive Holding Register" +-AT91C_TWI_RHR.helpkey="Receive Holding Register" +-AT91C_TWI_RHR.access=memorymapped +-AT91C_TWI_RHR.address=0xFFFB8030 +-AT91C_TWI_RHR.width=32 +-AT91C_TWI_RHR.byteEndian=little +-AT91C_TWI_RHR.permission.write=none +-# ========== Register definition for PWMC_CH3 peripheral ========== +-AT91C_PWMC_CH3_CUPDR.name="AT91C_PWMC_CH3_CUPDR" +-AT91C_PWMC_CH3_CUPDR.description="Channel Update Register" +-AT91C_PWMC_CH3_CUPDR.helpkey="Channel Update Register" +-AT91C_PWMC_CH3_CUPDR.access=memorymapped +-AT91C_PWMC_CH3_CUPDR.address=0xFFFCC270 +-AT91C_PWMC_CH3_CUPDR.width=32 +-AT91C_PWMC_CH3_CUPDR.byteEndian=little +-AT91C_PWMC_CH3_CUPDR.type=enum +-AT91C_PWMC_CH3_CUPDR.enum.0.name=*** Write only *** +-AT91C_PWMC_CH3_CUPDR.enum.1.name=Error +-AT91C_PWMC_CH3_Reserved.name="AT91C_PWMC_CH3_Reserved" +-AT91C_PWMC_CH3_Reserved.description="Reserved" +-AT91C_PWMC_CH3_Reserved.helpkey="Reserved" +-AT91C_PWMC_CH3_Reserved.access=memorymapped +-AT91C_PWMC_CH3_Reserved.address=0xFFFCC274 +-AT91C_PWMC_CH3_Reserved.width=32 +-AT91C_PWMC_CH3_Reserved.byteEndian=little +-AT91C_PWMC_CH3_Reserved.type=enum +-AT91C_PWMC_CH3_Reserved.enum.0.name=*** Write only *** +-AT91C_PWMC_CH3_Reserved.enum.1.name=Error +-AT91C_PWMC_CH3_CPRDR.name="AT91C_PWMC_CH3_CPRDR" +-AT91C_PWMC_CH3_CPRDR.description="Channel Period Register" +-AT91C_PWMC_CH3_CPRDR.helpkey="Channel Period Register" +-AT91C_PWMC_CH3_CPRDR.access=memorymapped +-AT91C_PWMC_CH3_CPRDR.address=0xFFFCC268 +-AT91C_PWMC_CH3_CPRDR.width=32 +-AT91C_PWMC_CH3_CPRDR.byteEndian=little +-AT91C_PWMC_CH3_CDTYR.name="AT91C_PWMC_CH3_CDTYR" +-AT91C_PWMC_CH3_CDTYR.description="Channel Duty Cycle Register" +-AT91C_PWMC_CH3_CDTYR.helpkey="Channel Duty Cycle Register" +-AT91C_PWMC_CH3_CDTYR.access=memorymapped +-AT91C_PWMC_CH3_CDTYR.address=0xFFFCC264 +-AT91C_PWMC_CH3_CDTYR.width=32 +-AT91C_PWMC_CH3_CDTYR.byteEndian=little +-AT91C_PWMC_CH3_CCNTR.name="AT91C_PWMC_CH3_CCNTR" +-AT91C_PWMC_CH3_CCNTR.description="Channel Counter Register" +-AT91C_PWMC_CH3_CCNTR.helpkey="Channel Counter Register" +-AT91C_PWMC_CH3_CCNTR.access=memorymapped +-AT91C_PWMC_CH3_CCNTR.address=0xFFFCC26C +-AT91C_PWMC_CH3_CCNTR.width=32 +-AT91C_PWMC_CH3_CCNTR.byteEndian=little +-AT91C_PWMC_CH3_CCNTR.permission.write=none +-AT91C_PWMC_CH3_CMR.name="AT91C_PWMC_CH3_CMR" +-AT91C_PWMC_CH3_CMR.description="Channel Mode Register" +-AT91C_PWMC_CH3_CMR.helpkey="Channel Mode Register" +-AT91C_PWMC_CH3_CMR.access=memorymapped +-AT91C_PWMC_CH3_CMR.address=0xFFFCC260 +-AT91C_PWMC_CH3_CMR.width=32 +-AT91C_PWMC_CH3_CMR.byteEndian=little +-# ========== Register definition for PWMC_CH2 peripheral ========== +-AT91C_PWMC_CH2_Reserved.name="AT91C_PWMC_CH2_Reserved" +-AT91C_PWMC_CH2_Reserved.description="Reserved" +-AT91C_PWMC_CH2_Reserved.helpkey="Reserved" +-AT91C_PWMC_CH2_Reserved.access=memorymapped +-AT91C_PWMC_CH2_Reserved.address=0xFFFCC254 +-AT91C_PWMC_CH2_Reserved.width=32 +-AT91C_PWMC_CH2_Reserved.byteEndian=little +-AT91C_PWMC_CH2_Reserved.type=enum +-AT91C_PWMC_CH2_Reserved.enum.0.name=*** Write only *** +-AT91C_PWMC_CH2_Reserved.enum.1.name=Error +-AT91C_PWMC_CH2_CMR.name="AT91C_PWMC_CH2_CMR" +-AT91C_PWMC_CH2_CMR.description="Channel Mode Register" +-AT91C_PWMC_CH2_CMR.helpkey="Channel Mode Register" +-AT91C_PWMC_CH2_CMR.access=memorymapped +-AT91C_PWMC_CH2_CMR.address=0xFFFCC240 +-AT91C_PWMC_CH2_CMR.width=32 +-AT91C_PWMC_CH2_CMR.byteEndian=little +-AT91C_PWMC_CH2_CCNTR.name="AT91C_PWMC_CH2_CCNTR" +-AT91C_PWMC_CH2_CCNTR.description="Channel Counter Register" +-AT91C_PWMC_CH2_CCNTR.helpkey="Channel Counter Register" +-AT91C_PWMC_CH2_CCNTR.access=memorymapped +-AT91C_PWMC_CH2_CCNTR.address=0xFFFCC24C +-AT91C_PWMC_CH2_CCNTR.width=32 +-AT91C_PWMC_CH2_CCNTR.byteEndian=little +-AT91C_PWMC_CH2_CCNTR.permission.write=none +-AT91C_PWMC_CH2_CPRDR.name="AT91C_PWMC_CH2_CPRDR" +-AT91C_PWMC_CH2_CPRDR.description="Channel Period Register" +-AT91C_PWMC_CH2_CPRDR.helpkey="Channel Period Register" +-AT91C_PWMC_CH2_CPRDR.access=memorymapped +-AT91C_PWMC_CH2_CPRDR.address=0xFFFCC248 +-AT91C_PWMC_CH2_CPRDR.width=32 +-AT91C_PWMC_CH2_CPRDR.byteEndian=little +-AT91C_PWMC_CH2_CUPDR.name="AT91C_PWMC_CH2_CUPDR" +-AT91C_PWMC_CH2_CUPDR.description="Channel Update Register" +-AT91C_PWMC_CH2_CUPDR.helpkey="Channel Update Register" +-AT91C_PWMC_CH2_CUPDR.access=memorymapped +-AT91C_PWMC_CH2_CUPDR.address=0xFFFCC250 +-AT91C_PWMC_CH2_CUPDR.width=32 +-AT91C_PWMC_CH2_CUPDR.byteEndian=little +-AT91C_PWMC_CH2_CUPDR.type=enum +-AT91C_PWMC_CH2_CUPDR.enum.0.name=*** Write only *** +-AT91C_PWMC_CH2_CUPDR.enum.1.name=Error +-AT91C_PWMC_CH2_CDTYR.name="AT91C_PWMC_CH2_CDTYR" +-AT91C_PWMC_CH2_CDTYR.description="Channel Duty Cycle Register" +-AT91C_PWMC_CH2_CDTYR.helpkey="Channel Duty Cycle Register" +-AT91C_PWMC_CH2_CDTYR.access=memorymapped +-AT91C_PWMC_CH2_CDTYR.address=0xFFFCC244 +-AT91C_PWMC_CH2_CDTYR.width=32 +-AT91C_PWMC_CH2_CDTYR.byteEndian=little +-# ========== Register definition for PWMC_CH1 peripheral ========== +-AT91C_PWMC_CH1_Reserved.name="AT91C_PWMC_CH1_Reserved" +-AT91C_PWMC_CH1_Reserved.description="Reserved" +-AT91C_PWMC_CH1_Reserved.helpkey="Reserved" +-AT91C_PWMC_CH1_Reserved.access=memorymapped +-AT91C_PWMC_CH1_Reserved.address=0xFFFCC234 +-AT91C_PWMC_CH1_Reserved.width=32 +-AT91C_PWMC_CH1_Reserved.byteEndian=little +-AT91C_PWMC_CH1_Reserved.type=enum +-AT91C_PWMC_CH1_Reserved.enum.0.name=*** Write only *** +-AT91C_PWMC_CH1_Reserved.enum.1.name=Error +-AT91C_PWMC_CH1_CUPDR.name="AT91C_PWMC_CH1_CUPDR" +-AT91C_PWMC_CH1_CUPDR.description="Channel Update Register" +-AT91C_PWMC_CH1_CUPDR.helpkey="Channel Update Register" +-AT91C_PWMC_CH1_CUPDR.access=memorymapped +-AT91C_PWMC_CH1_CUPDR.address=0xFFFCC230 +-AT91C_PWMC_CH1_CUPDR.width=32 +-AT91C_PWMC_CH1_CUPDR.byteEndian=little +-AT91C_PWMC_CH1_CUPDR.type=enum +-AT91C_PWMC_CH1_CUPDR.enum.0.name=*** Write only *** +-AT91C_PWMC_CH1_CUPDR.enum.1.name=Error +-AT91C_PWMC_CH1_CPRDR.name="AT91C_PWMC_CH1_CPRDR" +-AT91C_PWMC_CH1_CPRDR.description="Channel Period Register" +-AT91C_PWMC_CH1_CPRDR.helpkey="Channel Period Register" +-AT91C_PWMC_CH1_CPRDR.access=memorymapped +-AT91C_PWMC_CH1_CPRDR.address=0xFFFCC228 +-AT91C_PWMC_CH1_CPRDR.width=32 +-AT91C_PWMC_CH1_CPRDR.byteEndian=little +-AT91C_PWMC_CH1_CCNTR.name="AT91C_PWMC_CH1_CCNTR" +-AT91C_PWMC_CH1_CCNTR.description="Channel Counter Register" +-AT91C_PWMC_CH1_CCNTR.helpkey="Channel Counter Register" +-AT91C_PWMC_CH1_CCNTR.access=memorymapped +-AT91C_PWMC_CH1_CCNTR.address=0xFFFCC22C +-AT91C_PWMC_CH1_CCNTR.width=32 +-AT91C_PWMC_CH1_CCNTR.byteEndian=little +-AT91C_PWMC_CH1_CCNTR.permission.write=none +-AT91C_PWMC_CH1_CDTYR.name="AT91C_PWMC_CH1_CDTYR" +-AT91C_PWMC_CH1_CDTYR.description="Channel Duty Cycle Register" +-AT91C_PWMC_CH1_CDTYR.helpkey="Channel Duty Cycle Register" +-AT91C_PWMC_CH1_CDTYR.access=memorymapped +-AT91C_PWMC_CH1_CDTYR.address=0xFFFCC224 +-AT91C_PWMC_CH1_CDTYR.width=32 +-AT91C_PWMC_CH1_CDTYR.byteEndian=little +-AT91C_PWMC_CH1_CMR.name="AT91C_PWMC_CH1_CMR" +-AT91C_PWMC_CH1_CMR.description="Channel Mode Register" +-AT91C_PWMC_CH1_CMR.helpkey="Channel Mode Register" +-AT91C_PWMC_CH1_CMR.access=memorymapped +-AT91C_PWMC_CH1_CMR.address=0xFFFCC220 +-AT91C_PWMC_CH1_CMR.width=32 +-AT91C_PWMC_CH1_CMR.byteEndian=little +-# ========== Register definition for PWMC_CH0 peripheral ========== +-AT91C_PWMC_CH0_Reserved.name="AT91C_PWMC_CH0_Reserved" +-AT91C_PWMC_CH0_Reserved.description="Reserved" +-AT91C_PWMC_CH0_Reserved.helpkey="Reserved" +-AT91C_PWMC_CH0_Reserved.access=memorymapped +-AT91C_PWMC_CH0_Reserved.address=0xFFFCC214 +-AT91C_PWMC_CH0_Reserved.width=32 +-AT91C_PWMC_CH0_Reserved.byteEndian=little +-AT91C_PWMC_CH0_Reserved.type=enum +-AT91C_PWMC_CH0_Reserved.enum.0.name=*** Write only *** +-AT91C_PWMC_CH0_Reserved.enum.1.name=Error +-AT91C_PWMC_CH0_CPRDR.name="AT91C_PWMC_CH0_CPRDR" +-AT91C_PWMC_CH0_CPRDR.description="Channel Period Register" +-AT91C_PWMC_CH0_CPRDR.helpkey="Channel Period Register" +-AT91C_PWMC_CH0_CPRDR.access=memorymapped +-AT91C_PWMC_CH0_CPRDR.address=0xFFFCC208 +-AT91C_PWMC_CH0_CPRDR.width=32 +-AT91C_PWMC_CH0_CPRDR.byteEndian=little +-AT91C_PWMC_CH0_CDTYR.name="AT91C_PWMC_CH0_CDTYR" +-AT91C_PWMC_CH0_CDTYR.description="Channel Duty Cycle Register" +-AT91C_PWMC_CH0_CDTYR.helpkey="Channel Duty Cycle Register" +-AT91C_PWMC_CH0_CDTYR.access=memorymapped +-AT91C_PWMC_CH0_CDTYR.address=0xFFFCC204 +-AT91C_PWMC_CH0_CDTYR.width=32 +-AT91C_PWMC_CH0_CDTYR.byteEndian=little +-AT91C_PWMC_CH0_CMR.name="AT91C_PWMC_CH0_CMR" +-AT91C_PWMC_CH0_CMR.description="Channel Mode Register" +-AT91C_PWMC_CH0_CMR.helpkey="Channel Mode Register" +-AT91C_PWMC_CH0_CMR.access=memorymapped +-AT91C_PWMC_CH0_CMR.address=0xFFFCC200 +-AT91C_PWMC_CH0_CMR.width=32 +-AT91C_PWMC_CH0_CMR.byteEndian=little +-AT91C_PWMC_CH0_CUPDR.name="AT91C_PWMC_CH0_CUPDR" +-AT91C_PWMC_CH0_CUPDR.description="Channel Update Register" +-AT91C_PWMC_CH0_CUPDR.helpkey="Channel Update Register" +-AT91C_PWMC_CH0_CUPDR.access=memorymapped +-AT91C_PWMC_CH0_CUPDR.address=0xFFFCC210 +-AT91C_PWMC_CH0_CUPDR.width=32 +-AT91C_PWMC_CH0_CUPDR.byteEndian=little +-AT91C_PWMC_CH0_CUPDR.type=enum +-AT91C_PWMC_CH0_CUPDR.enum.0.name=*** Write only *** +-AT91C_PWMC_CH0_CUPDR.enum.1.name=Error +-AT91C_PWMC_CH0_CCNTR.name="AT91C_PWMC_CH0_CCNTR" +-AT91C_PWMC_CH0_CCNTR.description="Channel Counter Register" +-AT91C_PWMC_CH0_CCNTR.helpkey="Channel Counter Register" +-AT91C_PWMC_CH0_CCNTR.access=memorymapped +-AT91C_PWMC_CH0_CCNTR.address=0xFFFCC20C +-AT91C_PWMC_CH0_CCNTR.width=32 +-AT91C_PWMC_CH0_CCNTR.byteEndian=little +-AT91C_PWMC_CH0_CCNTR.permission.write=none +-# ========== Register definition for PWMC peripheral ========== +-AT91C_PWMC_IDR.name="AT91C_PWMC_IDR" +-AT91C_PWMC_IDR.description="PWMC Interrupt Disable Register" +-AT91C_PWMC_IDR.helpkey="PWMC Interrupt Disable Register" +-AT91C_PWMC_IDR.access=memorymapped +-AT91C_PWMC_IDR.address=0xFFFCC014 +-AT91C_PWMC_IDR.width=32 +-AT91C_PWMC_IDR.byteEndian=little +-AT91C_PWMC_IDR.type=enum +-AT91C_PWMC_IDR.enum.0.name=*** Write only *** +-AT91C_PWMC_IDR.enum.1.name=Error +-AT91C_PWMC_DIS.name="AT91C_PWMC_DIS" +-AT91C_PWMC_DIS.description="PWMC Disable Register" +-AT91C_PWMC_DIS.helpkey="PWMC Disable Register" +-AT91C_PWMC_DIS.access=memorymapped +-AT91C_PWMC_DIS.address=0xFFFCC008 +-AT91C_PWMC_DIS.width=32 +-AT91C_PWMC_DIS.byteEndian=little +-AT91C_PWMC_DIS.type=enum +-AT91C_PWMC_DIS.enum.0.name=*** Write only *** +-AT91C_PWMC_DIS.enum.1.name=Error +-AT91C_PWMC_IER.name="AT91C_PWMC_IER" +-AT91C_PWMC_IER.description="PWMC Interrupt Enable Register" +-AT91C_PWMC_IER.helpkey="PWMC Interrupt Enable Register" +-AT91C_PWMC_IER.access=memorymapped +-AT91C_PWMC_IER.address=0xFFFCC010 +-AT91C_PWMC_IER.width=32 +-AT91C_PWMC_IER.byteEndian=little +-AT91C_PWMC_IER.type=enum +-AT91C_PWMC_IER.enum.0.name=*** Write only *** +-AT91C_PWMC_IER.enum.1.name=Error +-AT91C_PWMC_VR.name="AT91C_PWMC_VR" +-AT91C_PWMC_VR.description="PWMC Version Register" +-AT91C_PWMC_VR.helpkey="PWMC Version Register" +-AT91C_PWMC_VR.access=memorymapped +-AT91C_PWMC_VR.address=0xFFFCC0FC +-AT91C_PWMC_VR.width=32 +-AT91C_PWMC_VR.byteEndian=little +-AT91C_PWMC_VR.permission.write=none +-AT91C_PWMC_ISR.name="AT91C_PWMC_ISR" +-AT91C_PWMC_ISR.description="PWMC Interrupt Status Register" +-AT91C_PWMC_ISR.helpkey="PWMC Interrupt Status Register" +-AT91C_PWMC_ISR.access=memorymapped +-AT91C_PWMC_ISR.address=0xFFFCC01C +-AT91C_PWMC_ISR.width=32 +-AT91C_PWMC_ISR.byteEndian=little +-AT91C_PWMC_ISR.permission.write=none +-AT91C_PWMC_SR.name="AT91C_PWMC_SR" +-AT91C_PWMC_SR.description="PWMC Status Register" +-AT91C_PWMC_SR.helpkey="PWMC Status Register" +-AT91C_PWMC_SR.access=memorymapped +-AT91C_PWMC_SR.address=0xFFFCC00C +-AT91C_PWMC_SR.width=32 +-AT91C_PWMC_SR.byteEndian=little +-AT91C_PWMC_SR.permission.write=none +-AT91C_PWMC_IMR.name="AT91C_PWMC_IMR" +-AT91C_PWMC_IMR.description="PWMC Interrupt Mask Register" +-AT91C_PWMC_IMR.helpkey="PWMC Interrupt Mask Register" +-AT91C_PWMC_IMR.access=memorymapped +-AT91C_PWMC_IMR.address=0xFFFCC018 +-AT91C_PWMC_IMR.width=32 +-AT91C_PWMC_IMR.byteEndian=little +-AT91C_PWMC_IMR.permission.write=none +-AT91C_PWMC_MR.name="AT91C_PWMC_MR" +-AT91C_PWMC_MR.description="PWMC Mode Register" +-AT91C_PWMC_MR.helpkey="PWMC Mode Register" +-AT91C_PWMC_MR.access=memorymapped +-AT91C_PWMC_MR.address=0xFFFCC000 +-AT91C_PWMC_MR.width=32 +-AT91C_PWMC_MR.byteEndian=little +-AT91C_PWMC_ENA.name="AT91C_PWMC_ENA" +-AT91C_PWMC_ENA.description="PWMC Enable Register" +-AT91C_PWMC_ENA.helpkey="PWMC Enable Register" +-AT91C_PWMC_ENA.access=memorymapped +-AT91C_PWMC_ENA.address=0xFFFCC004 +-AT91C_PWMC_ENA.width=32 +-AT91C_PWMC_ENA.byteEndian=little +-AT91C_PWMC_ENA.type=enum +-AT91C_PWMC_ENA.enum.0.name=*** Write only *** +-AT91C_PWMC_ENA.enum.1.name=Error +-# ========== Register definition for UDP peripheral ========== +-AT91C_UDP_IMR.name="AT91C_UDP_IMR" +-AT91C_UDP_IMR.description="Interrupt Mask Register" +-AT91C_UDP_IMR.helpkey="Interrupt Mask Register" +-AT91C_UDP_IMR.access=memorymapped +-AT91C_UDP_IMR.address=0xFFFB0018 +-AT91C_UDP_IMR.width=32 +-AT91C_UDP_IMR.byteEndian=little +-AT91C_UDP_IMR.permission.write=none +-AT91C_UDP_FADDR.name="AT91C_UDP_FADDR" +-AT91C_UDP_FADDR.description="Function Address Register" +-AT91C_UDP_FADDR.helpkey="Function Address Register" +-AT91C_UDP_FADDR.access=memorymapped +-AT91C_UDP_FADDR.address=0xFFFB0008 +-AT91C_UDP_FADDR.width=32 +-AT91C_UDP_FADDR.byteEndian=little +-AT91C_UDP_NUM.name="AT91C_UDP_NUM" +-AT91C_UDP_NUM.description="Frame Number Register" +-AT91C_UDP_NUM.helpkey="Frame Number Register" +-AT91C_UDP_NUM.access=memorymapped +-AT91C_UDP_NUM.address=0xFFFB0000 +-AT91C_UDP_NUM.width=32 +-AT91C_UDP_NUM.byteEndian=little +-AT91C_UDP_NUM.permission.write=none +-AT91C_UDP_FDR.name="AT91C_UDP_FDR" +-AT91C_UDP_FDR.description="Endpoint FIFO Data Register" +-AT91C_UDP_FDR.helpkey="Endpoint FIFO Data Register" +-AT91C_UDP_FDR.access=memorymapped +-AT91C_UDP_FDR.address=0xFFFB0050 +-AT91C_UDP_FDR.width=32 +-AT91C_UDP_FDR.byteEndian=little +-AT91C_UDP_ISR.name="AT91C_UDP_ISR" +-AT91C_UDP_ISR.description="Interrupt Status Register" +-AT91C_UDP_ISR.helpkey="Interrupt Status Register" +-AT91C_UDP_ISR.access=memorymapped +-AT91C_UDP_ISR.address=0xFFFB001C +-AT91C_UDP_ISR.width=32 +-AT91C_UDP_ISR.byteEndian=little +-AT91C_UDP_ISR.permission.write=none +-AT91C_UDP_CSR.name="AT91C_UDP_CSR" +-AT91C_UDP_CSR.description="Endpoint Control and Status Register" +-AT91C_UDP_CSR.helpkey="Endpoint Control and Status Register" +-AT91C_UDP_CSR.access=memorymapped +-AT91C_UDP_CSR.address=0xFFFB0030 +-AT91C_UDP_CSR.width=32 +-AT91C_UDP_CSR.byteEndian=little +-AT91C_UDP_IDR.name="AT91C_UDP_IDR" +-AT91C_UDP_IDR.description="Interrupt Disable Register" +-AT91C_UDP_IDR.helpkey="Interrupt Disable Register" +-AT91C_UDP_IDR.access=memorymapped +-AT91C_UDP_IDR.address=0xFFFB0014 +-AT91C_UDP_IDR.width=32 +-AT91C_UDP_IDR.byteEndian=little +-AT91C_UDP_IDR.type=enum +-AT91C_UDP_IDR.enum.0.name=*** Write only *** +-AT91C_UDP_IDR.enum.1.name=Error +-AT91C_UDP_ICR.name="AT91C_UDP_ICR" +-AT91C_UDP_ICR.description="Interrupt Clear Register" +-AT91C_UDP_ICR.helpkey="Interrupt Clear Register" +-AT91C_UDP_ICR.access=memorymapped +-AT91C_UDP_ICR.address=0xFFFB0020 +-AT91C_UDP_ICR.width=32 +-AT91C_UDP_ICR.byteEndian=little +-AT91C_UDP_ICR.permission.write=none +-AT91C_UDP_RSTEP.name="AT91C_UDP_RSTEP" +-AT91C_UDP_RSTEP.description="Reset Endpoint Register" +-AT91C_UDP_RSTEP.helpkey="Reset Endpoint Register" +-AT91C_UDP_RSTEP.access=memorymapped +-AT91C_UDP_RSTEP.address=0xFFFB0028 +-AT91C_UDP_RSTEP.width=32 +-AT91C_UDP_RSTEP.byteEndian=little +-AT91C_UDP_RSTEP.permission.write=none +-AT91C_UDP_TXVC.name="AT91C_UDP_TXVC" +-AT91C_UDP_TXVC.description="Transceiver Control Register" +-AT91C_UDP_TXVC.helpkey="Transceiver Control Register" +-AT91C_UDP_TXVC.access=memorymapped +-AT91C_UDP_TXVC.address=0xFFFB0074 +-AT91C_UDP_TXVC.width=32 +-AT91C_UDP_TXVC.byteEndian=little +-AT91C_UDP_GLBSTATE.name="AT91C_UDP_GLBSTATE" +-AT91C_UDP_GLBSTATE.description="Global State Register" +-AT91C_UDP_GLBSTATE.helpkey="Global State Register" +-AT91C_UDP_GLBSTATE.access=memorymapped +-AT91C_UDP_GLBSTATE.address=0xFFFB0004 +-AT91C_UDP_GLBSTATE.width=32 +-AT91C_UDP_GLBSTATE.byteEndian=little +-AT91C_UDP_IER.name="AT91C_UDP_IER" +-AT91C_UDP_IER.description="Interrupt Enable Register" +-AT91C_UDP_IER.helpkey="Interrupt Enable Register" +-AT91C_UDP_IER.access=memorymapped +-AT91C_UDP_IER.address=0xFFFB0010 +-AT91C_UDP_IER.width=32 +-AT91C_UDP_IER.byteEndian=little +-AT91C_UDP_IER.type=enum +-AT91C_UDP_IER.enum.0.name=*** Write only *** +-AT91C_UDP_IER.enum.1.name=Error +-# ========== Register definition for TC0 peripheral ========== +-AT91C_TC0_SR.name="AT91C_TC0_SR" +-AT91C_TC0_SR.description="Status Register" +-AT91C_TC0_SR.helpkey="Status Register" +-AT91C_TC0_SR.access=memorymapped +-AT91C_TC0_SR.address=0xFFFA0020 +-AT91C_TC0_SR.width=32 +-AT91C_TC0_SR.byteEndian=little +-AT91C_TC0_SR.permission.write=none +-AT91C_TC0_RC.name="AT91C_TC0_RC" +-AT91C_TC0_RC.description="Register C" +-AT91C_TC0_RC.helpkey="Register C" +-AT91C_TC0_RC.access=memorymapped +-AT91C_TC0_RC.address=0xFFFA001C +-AT91C_TC0_RC.width=32 +-AT91C_TC0_RC.byteEndian=little +-AT91C_TC0_RB.name="AT91C_TC0_RB" +-AT91C_TC0_RB.description="Register B" +-AT91C_TC0_RB.helpkey="Register B" +-AT91C_TC0_RB.access=memorymapped +-AT91C_TC0_RB.address=0xFFFA0018 +-AT91C_TC0_RB.width=32 +-AT91C_TC0_RB.byteEndian=little +-AT91C_TC0_CCR.name="AT91C_TC0_CCR" +-AT91C_TC0_CCR.description="Channel Control Register" +-AT91C_TC0_CCR.helpkey="Channel Control Register" +-AT91C_TC0_CCR.access=memorymapped +-AT91C_TC0_CCR.address=0xFFFA0000 +-AT91C_TC0_CCR.width=32 +-AT91C_TC0_CCR.byteEndian=little +-AT91C_TC0_CCR.type=enum +-AT91C_TC0_CCR.enum.0.name=*** Write only *** +-AT91C_TC0_CCR.enum.1.name=Error +-AT91C_TC0_CMR.name="AT91C_TC0_CMR" +-AT91C_TC0_CMR.description="Channel Mode Register (Capture Mode / Waveform Mode)" +-AT91C_TC0_CMR.helpkey="Channel Mode Register (Capture Mode / Waveform Mode)" +-AT91C_TC0_CMR.access=memorymapped +-AT91C_TC0_CMR.address=0xFFFA0004 +-AT91C_TC0_CMR.width=32 +-AT91C_TC0_CMR.byteEndian=little +-AT91C_TC0_IER.name="AT91C_TC0_IER" +-AT91C_TC0_IER.description="Interrupt Enable Register" +-AT91C_TC0_IER.helpkey="Interrupt Enable Register" +-AT91C_TC0_IER.access=memorymapped +-AT91C_TC0_IER.address=0xFFFA0024 +-AT91C_TC0_IER.width=32 +-AT91C_TC0_IER.byteEndian=little +-AT91C_TC0_IER.type=enum +-AT91C_TC0_IER.enum.0.name=*** Write only *** +-AT91C_TC0_IER.enum.1.name=Error +-AT91C_TC0_RA.name="AT91C_TC0_RA" +-AT91C_TC0_RA.description="Register A" +-AT91C_TC0_RA.helpkey="Register A" +-AT91C_TC0_RA.access=memorymapped +-AT91C_TC0_RA.address=0xFFFA0014 +-AT91C_TC0_RA.width=32 +-AT91C_TC0_RA.byteEndian=little +-AT91C_TC0_IDR.name="AT91C_TC0_IDR" +-AT91C_TC0_IDR.description="Interrupt Disable Register" +-AT91C_TC0_IDR.helpkey="Interrupt Disable Register" +-AT91C_TC0_IDR.access=memorymapped +-AT91C_TC0_IDR.address=0xFFFA0028 +-AT91C_TC0_IDR.width=32 +-AT91C_TC0_IDR.byteEndian=little +-AT91C_TC0_IDR.type=enum +-AT91C_TC0_IDR.enum.0.name=*** Write only *** +-AT91C_TC0_IDR.enum.1.name=Error +-AT91C_TC0_CV.name="AT91C_TC0_CV" +-AT91C_TC0_CV.description="Counter Value" +-AT91C_TC0_CV.helpkey="Counter Value" +-AT91C_TC0_CV.access=memorymapped +-AT91C_TC0_CV.address=0xFFFA0010 +-AT91C_TC0_CV.width=32 +-AT91C_TC0_CV.byteEndian=little +-AT91C_TC0_IMR.name="AT91C_TC0_IMR" +-AT91C_TC0_IMR.description="Interrupt Mask Register" +-AT91C_TC0_IMR.helpkey="Interrupt Mask Register" +-AT91C_TC0_IMR.access=memorymapped +-AT91C_TC0_IMR.address=0xFFFA002C +-AT91C_TC0_IMR.width=32 +-AT91C_TC0_IMR.byteEndian=little +-AT91C_TC0_IMR.permission.write=none +-# ========== Register definition for TC1 peripheral ========== +-AT91C_TC1_RB.name="AT91C_TC1_RB" +-AT91C_TC1_RB.description="Register B" +-AT91C_TC1_RB.helpkey="Register B" +-AT91C_TC1_RB.access=memorymapped +-AT91C_TC1_RB.address=0xFFFA0058 +-AT91C_TC1_RB.width=32 +-AT91C_TC1_RB.byteEndian=little +-AT91C_TC1_CCR.name="AT91C_TC1_CCR" +-AT91C_TC1_CCR.description="Channel Control Register" +-AT91C_TC1_CCR.helpkey="Channel Control Register" +-AT91C_TC1_CCR.access=memorymapped +-AT91C_TC1_CCR.address=0xFFFA0040 +-AT91C_TC1_CCR.width=32 +-AT91C_TC1_CCR.byteEndian=little +-AT91C_TC1_CCR.type=enum +-AT91C_TC1_CCR.enum.0.name=*** Write only *** +-AT91C_TC1_CCR.enum.1.name=Error +-AT91C_TC1_IER.name="AT91C_TC1_IER" +-AT91C_TC1_IER.description="Interrupt Enable Register" +-AT91C_TC1_IER.helpkey="Interrupt Enable Register" +-AT91C_TC1_IER.access=memorymapped +-AT91C_TC1_IER.address=0xFFFA0064 +-AT91C_TC1_IER.width=32 +-AT91C_TC1_IER.byteEndian=little +-AT91C_TC1_IER.type=enum +-AT91C_TC1_IER.enum.0.name=*** Write only *** +-AT91C_TC1_IER.enum.1.name=Error +-AT91C_TC1_IDR.name="AT91C_TC1_IDR" +-AT91C_TC1_IDR.description="Interrupt Disable Register" +-AT91C_TC1_IDR.helpkey="Interrupt Disable Register" +-AT91C_TC1_IDR.access=memorymapped +-AT91C_TC1_IDR.address=0xFFFA0068 +-AT91C_TC1_IDR.width=32 +-AT91C_TC1_IDR.byteEndian=little +-AT91C_TC1_IDR.type=enum +-AT91C_TC1_IDR.enum.0.name=*** Write only *** +-AT91C_TC1_IDR.enum.1.name=Error +-AT91C_TC1_SR.name="AT91C_TC1_SR" +-AT91C_TC1_SR.description="Status Register" +-AT91C_TC1_SR.helpkey="Status Register" +-AT91C_TC1_SR.access=memorymapped +-AT91C_TC1_SR.address=0xFFFA0060 +-AT91C_TC1_SR.width=32 +-AT91C_TC1_SR.byteEndian=little +-AT91C_TC1_SR.permission.write=none +-AT91C_TC1_CMR.name="AT91C_TC1_CMR" +-AT91C_TC1_CMR.description="Channel Mode Register (Capture Mode / Waveform Mode)" +-AT91C_TC1_CMR.helpkey="Channel Mode Register (Capture Mode / Waveform Mode)" +-AT91C_TC1_CMR.access=memorymapped +-AT91C_TC1_CMR.address=0xFFFA0044 +-AT91C_TC1_CMR.width=32 +-AT91C_TC1_CMR.byteEndian=little +-AT91C_TC1_RA.name="AT91C_TC1_RA" +-AT91C_TC1_RA.description="Register A" +-AT91C_TC1_RA.helpkey="Register A" +-AT91C_TC1_RA.access=memorymapped +-AT91C_TC1_RA.address=0xFFFA0054 +-AT91C_TC1_RA.width=32 +-AT91C_TC1_RA.byteEndian=little +-AT91C_TC1_RC.name="AT91C_TC1_RC" +-AT91C_TC1_RC.description="Register C" +-AT91C_TC1_RC.helpkey="Register C" +-AT91C_TC1_RC.access=memorymapped +-AT91C_TC1_RC.address=0xFFFA005C +-AT91C_TC1_RC.width=32 +-AT91C_TC1_RC.byteEndian=little +-AT91C_TC1_IMR.name="AT91C_TC1_IMR" +-AT91C_TC1_IMR.description="Interrupt Mask Register" +-AT91C_TC1_IMR.helpkey="Interrupt Mask Register" +-AT91C_TC1_IMR.access=memorymapped +-AT91C_TC1_IMR.address=0xFFFA006C +-AT91C_TC1_IMR.width=32 +-AT91C_TC1_IMR.byteEndian=little +-AT91C_TC1_IMR.permission.write=none +-AT91C_TC1_CV.name="AT91C_TC1_CV" +-AT91C_TC1_CV.description="Counter Value" +-AT91C_TC1_CV.helpkey="Counter Value" +-AT91C_TC1_CV.access=memorymapped +-AT91C_TC1_CV.address=0xFFFA0050 +-AT91C_TC1_CV.width=32 +-AT91C_TC1_CV.byteEndian=little +-# ========== Register definition for TC2 peripheral ========== +-AT91C_TC2_CMR.name="AT91C_TC2_CMR" +-AT91C_TC2_CMR.description="Channel Mode Register (Capture Mode / Waveform Mode)" +-AT91C_TC2_CMR.helpkey="Channel Mode Register (Capture Mode / Waveform Mode)" +-AT91C_TC2_CMR.access=memorymapped +-AT91C_TC2_CMR.address=0xFFFA0084 +-AT91C_TC2_CMR.width=32 +-AT91C_TC2_CMR.byteEndian=little +-AT91C_TC2_CCR.name="AT91C_TC2_CCR" +-AT91C_TC2_CCR.description="Channel Control Register" +-AT91C_TC2_CCR.helpkey="Channel Control Register" +-AT91C_TC2_CCR.access=memorymapped +-AT91C_TC2_CCR.address=0xFFFA0080 +-AT91C_TC2_CCR.width=32 +-AT91C_TC2_CCR.byteEndian=little +-AT91C_TC2_CCR.type=enum +-AT91C_TC2_CCR.enum.0.name=*** Write only *** +-AT91C_TC2_CCR.enum.1.name=Error +-AT91C_TC2_CV.name="AT91C_TC2_CV" +-AT91C_TC2_CV.description="Counter Value" +-AT91C_TC2_CV.helpkey="Counter Value" +-AT91C_TC2_CV.access=memorymapped +-AT91C_TC2_CV.address=0xFFFA0090 +-AT91C_TC2_CV.width=32 +-AT91C_TC2_CV.byteEndian=little +-AT91C_TC2_RA.name="AT91C_TC2_RA" +-AT91C_TC2_RA.description="Register A" +-AT91C_TC2_RA.helpkey="Register A" +-AT91C_TC2_RA.access=memorymapped +-AT91C_TC2_RA.address=0xFFFA0094 +-AT91C_TC2_RA.width=32 +-AT91C_TC2_RA.byteEndian=little +-AT91C_TC2_RB.name="AT91C_TC2_RB" +-AT91C_TC2_RB.description="Register B" +-AT91C_TC2_RB.helpkey="Register B" +-AT91C_TC2_RB.access=memorymapped +-AT91C_TC2_RB.address=0xFFFA0098 +-AT91C_TC2_RB.width=32 +-AT91C_TC2_RB.byteEndian=little +-AT91C_TC2_IDR.name="AT91C_TC2_IDR" +-AT91C_TC2_IDR.description="Interrupt Disable Register" +-AT91C_TC2_IDR.helpkey="Interrupt Disable Register" +-AT91C_TC2_IDR.access=memorymapped +-AT91C_TC2_IDR.address=0xFFFA00A8 +-AT91C_TC2_IDR.width=32 +-AT91C_TC2_IDR.byteEndian=little +-AT91C_TC2_IDR.type=enum +-AT91C_TC2_IDR.enum.0.name=*** Write only *** +-AT91C_TC2_IDR.enum.1.name=Error +-AT91C_TC2_IMR.name="AT91C_TC2_IMR" +-AT91C_TC2_IMR.description="Interrupt Mask Register" +-AT91C_TC2_IMR.helpkey="Interrupt Mask Register" +-AT91C_TC2_IMR.access=memorymapped +-AT91C_TC2_IMR.address=0xFFFA00AC +-AT91C_TC2_IMR.width=32 +-AT91C_TC2_IMR.byteEndian=little +-AT91C_TC2_IMR.permission.write=none +-AT91C_TC2_RC.name="AT91C_TC2_RC" +-AT91C_TC2_RC.description="Register C" +-AT91C_TC2_RC.helpkey="Register C" +-AT91C_TC2_RC.access=memorymapped +-AT91C_TC2_RC.address=0xFFFA009C +-AT91C_TC2_RC.width=32 +-AT91C_TC2_RC.byteEndian=little +-AT91C_TC2_IER.name="AT91C_TC2_IER" +-AT91C_TC2_IER.description="Interrupt Enable Register" +-AT91C_TC2_IER.helpkey="Interrupt Enable Register" +-AT91C_TC2_IER.access=memorymapped +-AT91C_TC2_IER.address=0xFFFA00A4 +-AT91C_TC2_IER.width=32 +-AT91C_TC2_IER.byteEndian=little +-AT91C_TC2_IER.type=enum +-AT91C_TC2_IER.enum.0.name=*** Write only *** +-AT91C_TC2_IER.enum.1.name=Error +-AT91C_TC2_SR.name="AT91C_TC2_SR" +-AT91C_TC2_SR.description="Status Register" +-AT91C_TC2_SR.helpkey="Status Register" +-AT91C_TC2_SR.access=memorymapped +-AT91C_TC2_SR.address=0xFFFA00A0 +-AT91C_TC2_SR.width=32 +-AT91C_TC2_SR.byteEndian=little +-AT91C_TC2_SR.permission.write=none +-# ========== Register definition for TCB peripheral ========== +-AT91C_TCB_BMR.name="AT91C_TCB_BMR" +-AT91C_TCB_BMR.description="TC Block Mode Register" +-AT91C_TCB_BMR.helpkey="TC Block Mode Register" +-AT91C_TCB_BMR.access=memorymapped +-AT91C_TCB_BMR.address=0xFFFA00C4 +-AT91C_TCB_BMR.width=32 +-AT91C_TCB_BMR.byteEndian=little +-AT91C_TCB_BCR.name="AT91C_TCB_BCR" +-AT91C_TCB_BCR.description="TC Block Control Register" +-AT91C_TCB_BCR.helpkey="TC Block Control Register" +-AT91C_TCB_BCR.access=memorymapped +-AT91C_TCB_BCR.address=0xFFFA00C0 +-AT91C_TCB_BCR.width=32 +-AT91C_TCB_BCR.byteEndian=little +-AT91C_TCB_BCR.type=enum +-AT91C_TCB_BCR.enum.0.name=*** Write only *** +-AT91C_TCB_BCR.enum.1.name=Error +-# ========== Register definition for CAN_MB0 peripheral ========== +-AT91C_CAN_MB0_MDL.name="AT91C_CAN_MB0_MDL" +-AT91C_CAN_MB0_MDL.description="MailBox Data Low Register" +-AT91C_CAN_MB0_MDL.helpkey="MailBox Data Low Register" +-AT91C_CAN_MB0_MDL.access=memorymapped +-AT91C_CAN_MB0_MDL.address=0xFFFD0214 +-AT91C_CAN_MB0_MDL.width=32 +-AT91C_CAN_MB0_MDL.byteEndian=little +-AT91C_CAN_MB0_MAM.name="AT91C_CAN_MB0_MAM" +-AT91C_CAN_MB0_MAM.description="MailBox Acceptance Mask Register" +-AT91C_CAN_MB0_MAM.helpkey="MailBox Acceptance Mask Register" +-AT91C_CAN_MB0_MAM.access=memorymapped +-AT91C_CAN_MB0_MAM.address=0xFFFD0204 +-AT91C_CAN_MB0_MAM.width=32 +-AT91C_CAN_MB0_MAM.byteEndian=little +-AT91C_CAN_MB0_MCR.name="AT91C_CAN_MB0_MCR" +-AT91C_CAN_MB0_MCR.description="MailBox Control Register" +-AT91C_CAN_MB0_MCR.helpkey="MailBox Control Register" +-AT91C_CAN_MB0_MCR.access=memorymapped +-AT91C_CAN_MB0_MCR.address=0xFFFD021C +-AT91C_CAN_MB0_MCR.width=32 +-AT91C_CAN_MB0_MCR.byteEndian=little +-AT91C_CAN_MB0_MCR.type=enum +-AT91C_CAN_MB0_MCR.enum.0.name=*** Write only *** +-AT91C_CAN_MB0_MCR.enum.1.name=Error +-AT91C_CAN_MB0_MID.name="AT91C_CAN_MB0_MID" +-AT91C_CAN_MB0_MID.description="MailBox ID Register" +-AT91C_CAN_MB0_MID.helpkey="MailBox ID Register" +-AT91C_CAN_MB0_MID.access=memorymapped +-AT91C_CAN_MB0_MID.address=0xFFFD0208 +-AT91C_CAN_MB0_MID.width=32 +-AT91C_CAN_MB0_MID.byteEndian=little +-AT91C_CAN_MB0_MSR.name="AT91C_CAN_MB0_MSR" +-AT91C_CAN_MB0_MSR.description="MailBox Status Register" +-AT91C_CAN_MB0_MSR.helpkey="MailBox Status Register" +-AT91C_CAN_MB0_MSR.access=memorymapped +-AT91C_CAN_MB0_MSR.address=0xFFFD0210 +-AT91C_CAN_MB0_MSR.width=32 +-AT91C_CAN_MB0_MSR.byteEndian=little +-AT91C_CAN_MB0_MSR.permission.write=none +-AT91C_CAN_MB0_MFID.name="AT91C_CAN_MB0_MFID" +-AT91C_CAN_MB0_MFID.description="MailBox Family ID Register" +-AT91C_CAN_MB0_MFID.helpkey="MailBox Family ID Register" +-AT91C_CAN_MB0_MFID.access=memorymapped +-AT91C_CAN_MB0_MFID.address=0xFFFD020C +-AT91C_CAN_MB0_MFID.width=32 +-AT91C_CAN_MB0_MFID.byteEndian=little +-AT91C_CAN_MB0_MFID.permission.write=none +-AT91C_CAN_MB0_MDH.name="AT91C_CAN_MB0_MDH" +-AT91C_CAN_MB0_MDH.description="MailBox Data High Register" +-AT91C_CAN_MB0_MDH.helpkey="MailBox Data High Register" +-AT91C_CAN_MB0_MDH.access=memorymapped +-AT91C_CAN_MB0_MDH.address=0xFFFD0218 +-AT91C_CAN_MB0_MDH.width=32 +-AT91C_CAN_MB0_MDH.byteEndian=little +-AT91C_CAN_MB0_MMR.name="AT91C_CAN_MB0_MMR" +-AT91C_CAN_MB0_MMR.description="MailBox Mode Register" +-AT91C_CAN_MB0_MMR.helpkey="MailBox Mode Register" +-AT91C_CAN_MB0_MMR.access=memorymapped +-AT91C_CAN_MB0_MMR.address=0xFFFD0200 +-AT91C_CAN_MB0_MMR.width=32 +-AT91C_CAN_MB0_MMR.byteEndian=little +-# ========== Register definition for CAN_MB1 peripheral ========== +-AT91C_CAN_MB1_MDL.name="AT91C_CAN_MB1_MDL" +-AT91C_CAN_MB1_MDL.description="MailBox Data Low Register" +-AT91C_CAN_MB1_MDL.helpkey="MailBox Data Low Register" +-AT91C_CAN_MB1_MDL.access=memorymapped +-AT91C_CAN_MB1_MDL.address=0xFFFD0234 +-AT91C_CAN_MB1_MDL.width=32 +-AT91C_CAN_MB1_MDL.byteEndian=little +-AT91C_CAN_MB1_MID.name="AT91C_CAN_MB1_MID" +-AT91C_CAN_MB1_MID.description="MailBox ID Register" +-AT91C_CAN_MB1_MID.helpkey="MailBox ID Register" +-AT91C_CAN_MB1_MID.access=memorymapped +-AT91C_CAN_MB1_MID.address=0xFFFD0228 +-AT91C_CAN_MB1_MID.width=32 +-AT91C_CAN_MB1_MID.byteEndian=little +-AT91C_CAN_MB1_MMR.name="AT91C_CAN_MB1_MMR" +-AT91C_CAN_MB1_MMR.description="MailBox Mode Register" +-AT91C_CAN_MB1_MMR.helpkey="MailBox Mode Register" +-AT91C_CAN_MB1_MMR.access=memorymapped +-AT91C_CAN_MB1_MMR.address=0xFFFD0220 +-AT91C_CAN_MB1_MMR.width=32 +-AT91C_CAN_MB1_MMR.byteEndian=little +-AT91C_CAN_MB1_MSR.name="AT91C_CAN_MB1_MSR" +-AT91C_CAN_MB1_MSR.description="MailBox Status Register" +-AT91C_CAN_MB1_MSR.helpkey="MailBox Status Register" +-AT91C_CAN_MB1_MSR.access=memorymapped +-AT91C_CAN_MB1_MSR.address=0xFFFD0230 +-AT91C_CAN_MB1_MSR.width=32 +-AT91C_CAN_MB1_MSR.byteEndian=little +-AT91C_CAN_MB1_MSR.permission.write=none +-AT91C_CAN_MB1_MAM.name="AT91C_CAN_MB1_MAM" +-AT91C_CAN_MB1_MAM.description="MailBox Acceptance Mask Register" +-AT91C_CAN_MB1_MAM.helpkey="MailBox Acceptance Mask Register" +-AT91C_CAN_MB1_MAM.access=memorymapped +-AT91C_CAN_MB1_MAM.address=0xFFFD0224 +-AT91C_CAN_MB1_MAM.width=32 +-AT91C_CAN_MB1_MAM.byteEndian=little +-AT91C_CAN_MB1_MDH.name="AT91C_CAN_MB1_MDH" +-AT91C_CAN_MB1_MDH.description="MailBox Data High Register" +-AT91C_CAN_MB1_MDH.helpkey="MailBox Data High Register" +-AT91C_CAN_MB1_MDH.access=memorymapped +-AT91C_CAN_MB1_MDH.address=0xFFFD0238 +-AT91C_CAN_MB1_MDH.width=32 +-AT91C_CAN_MB1_MDH.byteEndian=little +-AT91C_CAN_MB1_MCR.name="AT91C_CAN_MB1_MCR" +-AT91C_CAN_MB1_MCR.description="MailBox Control Register" +-AT91C_CAN_MB1_MCR.helpkey="MailBox Control Register" +-AT91C_CAN_MB1_MCR.access=memorymapped +-AT91C_CAN_MB1_MCR.address=0xFFFD023C +-AT91C_CAN_MB1_MCR.width=32 +-AT91C_CAN_MB1_MCR.byteEndian=little +-AT91C_CAN_MB1_MCR.type=enum +-AT91C_CAN_MB1_MCR.enum.0.name=*** Write only *** +-AT91C_CAN_MB1_MCR.enum.1.name=Error +-AT91C_CAN_MB1_MFID.name="AT91C_CAN_MB1_MFID" +-AT91C_CAN_MB1_MFID.description="MailBox Family ID Register" +-AT91C_CAN_MB1_MFID.helpkey="MailBox Family ID Register" +-AT91C_CAN_MB1_MFID.access=memorymapped +-AT91C_CAN_MB1_MFID.address=0xFFFD022C +-AT91C_CAN_MB1_MFID.width=32 +-AT91C_CAN_MB1_MFID.byteEndian=little +-AT91C_CAN_MB1_MFID.permission.write=none +-# ========== Register definition for CAN_MB2 peripheral ========== +-AT91C_CAN_MB2_MCR.name="AT91C_CAN_MB2_MCR" +-AT91C_CAN_MB2_MCR.description="MailBox Control Register" +-AT91C_CAN_MB2_MCR.helpkey="MailBox Control Register" +-AT91C_CAN_MB2_MCR.access=memorymapped +-AT91C_CAN_MB2_MCR.address=0xFFFD025C +-AT91C_CAN_MB2_MCR.width=32 +-AT91C_CAN_MB2_MCR.byteEndian=little +-AT91C_CAN_MB2_MCR.type=enum +-AT91C_CAN_MB2_MCR.enum.0.name=*** Write only *** +-AT91C_CAN_MB2_MCR.enum.1.name=Error +-AT91C_CAN_MB2_MDH.name="AT91C_CAN_MB2_MDH" +-AT91C_CAN_MB2_MDH.description="MailBox Data High Register" +-AT91C_CAN_MB2_MDH.helpkey="MailBox Data High Register" +-AT91C_CAN_MB2_MDH.access=memorymapped +-AT91C_CAN_MB2_MDH.address=0xFFFD0258 +-AT91C_CAN_MB2_MDH.width=32 +-AT91C_CAN_MB2_MDH.byteEndian=little +-AT91C_CAN_MB2_MID.name="AT91C_CAN_MB2_MID" +-AT91C_CAN_MB2_MID.description="MailBox ID Register" +-AT91C_CAN_MB2_MID.helpkey="MailBox ID Register" +-AT91C_CAN_MB2_MID.access=memorymapped +-AT91C_CAN_MB2_MID.address=0xFFFD0248 +-AT91C_CAN_MB2_MID.width=32 +-AT91C_CAN_MB2_MID.byteEndian=little +-AT91C_CAN_MB2_MDL.name="AT91C_CAN_MB2_MDL" +-AT91C_CAN_MB2_MDL.description="MailBox Data Low Register" +-AT91C_CAN_MB2_MDL.helpkey="MailBox Data Low Register" +-AT91C_CAN_MB2_MDL.access=memorymapped +-AT91C_CAN_MB2_MDL.address=0xFFFD0254 +-AT91C_CAN_MB2_MDL.width=32 +-AT91C_CAN_MB2_MDL.byteEndian=little +-AT91C_CAN_MB2_MMR.name="AT91C_CAN_MB2_MMR" +-AT91C_CAN_MB2_MMR.description="MailBox Mode Register" +-AT91C_CAN_MB2_MMR.helpkey="MailBox Mode Register" +-AT91C_CAN_MB2_MMR.access=memorymapped +-AT91C_CAN_MB2_MMR.address=0xFFFD0240 +-AT91C_CAN_MB2_MMR.width=32 +-AT91C_CAN_MB2_MMR.byteEndian=little +-AT91C_CAN_MB2_MAM.name="AT91C_CAN_MB2_MAM" +-AT91C_CAN_MB2_MAM.description="MailBox Acceptance Mask Register" +-AT91C_CAN_MB2_MAM.helpkey="MailBox Acceptance Mask Register" +-AT91C_CAN_MB2_MAM.access=memorymapped +-AT91C_CAN_MB2_MAM.address=0xFFFD0244 +-AT91C_CAN_MB2_MAM.width=32 +-AT91C_CAN_MB2_MAM.byteEndian=little +-AT91C_CAN_MB2_MFID.name="AT91C_CAN_MB2_MFID" +-AT91C_CAN_MB2_MFID.description="MailBox Family ID Register" +-AT91C_CAN_MB2_MFID.helpkey="MailBox Family ID Register" +-AT91C_CAN_MB2_MFID.access=memorymapped +-AT91C_CAN_MB2_MFID.address=0xFFFD024C +-AT91C_CAN_MB2_MFID.width=32 +-AT91C_CAN_MB2_MFID.byteEndian=little +-AT91C_CAN_MB2_MFID.permission.write=none +-AT91C_CAN_MB2_MSR.name="AT91C_CAN_MB2_MSR" +-AT91C_CAN_MB2_MSR.description="MailBox Status Register" +-AT91C_CAN_MB2_MSR.helpkey="MailBox Status Register" +-AT91C_CAN_MB2_MSR.access=memorymapped +-AT91C_CAN_MB2_MSR.address=0xFFFD0250 +-AT91C_CAN_MB2_MSR.width=32 +-AT91C_CAN_MB2_MSR.byteEndian=little +-AT91C_CAN_MB2_MSR.permission.write=none +-# ========== Register definition for CAN_MB3 peripheral ========== +-AT91C_CAN_MB3_MFID.name="AT91C_CAN_MB3_MFID" +-AT91C_CAN_MB3_MFID.description="MailBox Family ID Register" +-AT91C_CAN_MB3_MFID.helpkey="MailBox Family ID Register" +-AT91C_CAN_MB3_MFID.access=memorymapped +-AT91C_CAN_MB3_MFID.address=0xFFFD026C +-AT91C_CAN_MB3_MFID.width=32 +-AT91C_CAN_MB3_MFID.byteEndian=little +-AT91C_CAN_MB3_MFID.permission.write=none +-AT91C_CAN_MB3_MAM.name="AT91C_CAN_MB3_MAM" +-AT91C_CAN_MB3_MAM.description="MailBox Acceptance Mask Register" +-AT91C_CAN_MB3_MAM.helpkey="MailBox Acceptance Mask Register" +-AT91C_CAN_MB3_MAM.access=memorymapped +-AT91C_CAN_MB3_MAM.address=0xFFFD0264 +-AT91C_CAN_MB3_MAM.width=32 +-AT91C_CAN_MB3_MAM.byteEndian=little +-AT91C_CAN_MB3_MID.name="AT91C_CAN_MB3_MID" +-AT91C_CAN_MB3_MID.description="MailBox ID Register" +-AT91C_CAN_MB3_MID.helpkey="MailBox ID Register" +-AT91C_CAN_MB3_MID.access=memorymapped +-AT91C_CAN_MB3_MID.address=0xFFFD0268 +-AT91C_CAN_MB3_MID.width=32 +-AT91C_CAN_MB3_MID.byteEndian=little +-AT91C_CAN_MB3_MCR.name="AT91C_CAN_MB3_MCR" +-AT91C_CAN_MB3_MCR.description="MailBox Control Register" +-AT91C_CAN_MB3_MCR.helpkey="MailBox Control Register" +-AT91C_CAN_MB3_MCR.access=memorymapped +-AT91C_CAN_MB3_MCR.address=0xFFFD027C +-AT91C_CAN_MB3_MCR.width=32 +-AT91C_CAN_MB3_MCR.byteEndian=little +-AT91C_CAN_MB3_MCR.type=enum +-AT91C_CAN_MB3_MCR.enum.0.name=*** Write only *** +-AT91C_CAN_MB3_MCR.enum.1.name=Error +-AT91C_CAN_MB3_MMR.name="AT91C_CAN_MB3_MMR" +-AT91C_CAN_MB3_MMR.description="MailBox Mode Register" +-AT91C_CAN_MB3_MMR.helpkey="MailBox Mode Register" +-AT91C_CAN_MB3_MMR.access=memorymapped +-AT91C_CAN_MB3_MMR.address=0xFFFD0260 +-AT91C_CAN_MB3_MMR.width=32 +-AT91C_CAN_MB3_MMR.byteEndian=little +-AT91C_CAN_MB3_MSR.name="AT91C_CAN_MB3_MSR" +-AT91C_CAN_MB3_MSR.description="MailBox Status Register" +-AT91C_CAN_MB3_MSR.helpkey="MailBox Status Register" +-AT91C_CAN_MB3_MSR.access=memorymapped +-AT91C_CAN_MB3_MSR.address=0xFFFD0270 +-AT91C_CAN_MB3_MSR.width=32 +-AT91C_CAN_MB3_MSR.byteEndian=little +-AT91C_CAN_MB3_MSR.permission.write=none +-AT91C_CAN_MB3_MDL.name="AT91C_CAN_MB3_MDL" +-AT91C_CAN_MB3_MDL.description="MailBox Data Low Register" +-AT91C_CAN_MB3_MDL.helpkey="MailBox Data Low Register" +-AT91C_CAN_MB3_MDL.access=memorymapped +-AT91C_CAN_MB3_MDL.address=0xFFFD0274 +-AT91C_CAN_MB3_MDL.width=32 +-AT91C_CAN_MB3_MDL.byteEndian=little +-AT91C_CAN_MB3_MDH.name="AT91C_CAN_MB3_MDH" +-AT91C_CAN_MB3_MDH.description="MailBox Data High Register" +-AT91C_CAN_MB3_MDH.helpkey="MailBox Data High Register" +-AT91C_CAN_MB3_MDH.access=memorymapped +-AT91C_CAN_MB3_MDH.address=0xFFFD0278 +-AT91C_CAN_MB3_MDH.width=32 +-AT91C_CAN_MB3_MDH.byteEndian=little +-# ========== Register definition for CAN_MB4 peripheral ========== +-AT91C_CAN_MB4_MID.name="AT91C_CAN_MB4_MID" +-AT91C_CAN_MB4_MID.description="MailBox ID Register" +-AT91C_CAN_MB4_MID.helpkey="MailBox ID Register" +-AT91C_CAN_MB4_MID.access=memorymapped +-AT91C_CAN_MB4_MID.address=0xFFFD0288 +-AT91C_CAN_MB4_MID.width=32 +-AT91C_CAN_MB4_MID.byteEndian=little +-AT91C_CAN_MB4_MMR.name="AT91C_CAN_MB4_MMR" +-AT91C_CAN_MB4_MMR.description="MailBox Mode Register" +-AT91C_CAN_MB4_MMR.helpkey="MailBox Mode Register" +-AT91C_CAN_MB4_MMR.access=memorymapped +-AT91C_CAN_MB4_MMR.address=0xFFFD0280 +-AT91C_CAN_MB4_MMR.width=32 +-AT91C_CAN_MB4_MMR.byteEndian=little +-AT91C_CAN_MB4_MDH.name="AT91C_CAN_MB4_MDH" +-AT91C_CAN_MB4_MDH.description="MailBox Data High Register" +-AT91C_CAN_MB4_MDH.helpkey="MailBox Data High Register" +-AT91C_CAN_MB4_MDH.access=memorymapped +-AT91C_CAN_MB4_MDH.address=0xFFFD0298 +-AT91C_CAN_MB4_MDH.width=32 +-AT91C_CAN_MB4_MDH.byteEndian=little +-AT91C_CAN_MB4_MFID.name="AT91C_CAN_MB4_MFID" +-AT91C_CAN_MB4_MFID.description="MailBox Family ID Register" +-AT91C_CAN_MB4_MFID.helpkey="MailBox Family ID Register" +-AT91C_CAN_MB4_MFID.access=memorymapped +-AT91C_CAN_MB4_MFID.address=0xFFFD028C +-AT91C_CAN_MB4_MFID.width=32 +-AT91C_CAN_MB4_MFID.byteEndian=little +-AT91C_CAN_MB4_MFID.permission.write=none +-AT91C_CAN_MB4_MSR.name="AT91C_CAN_MB4_MSR" +-AT91C_CAN_MB4_MSR.description="MailBox Status Register" +-AT91C_CAN_MB4_MSR.helpkey="MailBox Status Register" +-AT91C_CAN_MB4_MSR.access=memorymapped +-AT91C_CAN_MB4_MSR.address=0xFFFD0290 +-AT91C_CAN_MB4_MSR.width=32 +-AT91C_CAN_MB4_MSR.byteEndian=little +-AT91C_CAN_MB4_MSR.permission.write=none +-AT91C_CAN_MB4_MCR.name="AT91C_CAN_MB4_MCR" +-AT91C_CAN_MB4_MCR.description="MailBox Control Register" +-AT91C_CAN_MB4_MCR.helpkey="MailBox Control Register" +-AT91C_CAN_MB4_MCR.access=memorymapped +-AT91C_CAN_MB4_MCR.address=0xFFFD029C +-AT91C_CAN_MB4_MCR.width=32 +-AT91C_CAN_MB4_MCR.byteEndian=little +-AT91C_CAN_MB4_MCR.type=enum +-AT91C_CAN_MB4_MCR.enum.0.name=*** Write only *** +-AT91C_CAN_MB4_MCR.enum.1.name=Error +-AT91C_CAN_MB4_MDL.name="AT91C_CAN_MB4_MDL" +-AT91C_CAN_MB4_MDL.description="MailBox Data Low Register" +-AT91C_CAN_MB4_MDL.helpkey="MailBox Data Low Register" +-AT91C_CAN_MB4_MDL.access=memorymapped +-AT91C_CAN_MB4_MDL.address=0xFFFD0294 +-AT91C_CAN_MB4_MDL.width=32 +-AT91C_CAN_MB4_MDL.byteEndian=little +-AT91C_CAN_MB4_MAM.name="AT91C_CAN_MB4_MAM" +-AT91C_CAN_MB4_MAM.description="MailBox Acceptance Mask Register" +-AT91C_CAN_MB4_MAM.helpkey="MailBox Acceptance Mask Register" +-AT91C_CAN_MB4_MAM.access=memorymapped +-AT91C_CAN_MB4_MAM.address=0xFFFD0284 +-AT91C_CAN_MB4_MAM.width=32 +-AT91C_CAN_MB4_MAM.byteEndian=little +-# ========== Register definition for CAN_MB5 peripheral ========== +-AT91C_CAN_MB5_MSR.name="AT91C_CAN_MB5_MSR" +-AT91C_CAN_MB5_MSR.description="MailBox Status Register" +-AT91C_CAN_MB5_MSR.helpkey="MailBox Status Register" +-AT91C_CAN_MB5_MSR.access=memorymapped +-AT91C_CAN_MB5_MSR.address=0xFFFD02B0 +-AT91C_CAN_MB5_MSR.width=32 +-AT91C_CAN_MB5_MSR.byteEndian=little +-AT91C_CAN_MB5_MSR.permission.write=none +-AT91C_CAN_MB5_MCR.name="AT91C_CAN_MB5_MCR" +-AT91C_CAN_MB5_MCR.description="MailBox Control Register" +-AT91C_CAN_MB5_MCR.helpkey="MailBox Control Register" +-AT91C_CAN_MB5_MCR.access=memorymapped +-AT91C_CAN_MB5_MCR.address=0xFFFD02BC +-AT91C_CAN_MB5_MCR.width=32 +-AT91C_CAN_MB5_MCR.byteEndian=little +-AT91C_CAN_MB5_MCR.type=enum +-AT91C_CAN_MB5_MCR.enum.0.name=*** Write only *** +-AT91C_CAN_MB5_MCR.enum.1.name=Error +-AT91C_CAN_MB5_MFID.name="AT91C_CAN_MB5_MFID" +-AT91C_CAN_MB5_MFID.description="MailBox Family ID Register" +-AT91C_CAN_MB5_MFID.helpkey="MailBox Family ID Register" +-AT91C_CAN_MB5_MFID.access=memorymapped +-AT91C_CAN_MB5_MFID.address=0xFFFD02AC +-AT91C_CAN_MB5_MFID.width=32 +-AT91C_CAN_MB5_MFID.byteEndian=little +-AT91C_CAN_MB5_MFID.permission.write=none +-AT91C_CAN_MB5_MDH.name="AT91C_CAN_MB5_MDH" +-AT91C_CAN_MB5_MDH.description="MailBox Data High Register" +-AT91C_CAN_MB5_MDH.helpkey="MailBox Data High Register" +-AT91C_CAN_MB5_MDH.access=memorymapped +-AT91C_CAN_MB5_MDH.address=0xFFFD02B8 +-AT91C_CAN_MB5_MDH.width=32 +-AT91C_CAN_MB5_MDH.byteEndian=little +-AT91C_CAN_MB5_MID.name="AT91C_CAN_MB5_MID" +-AT91C_CAN_MB5_MID.description="MailBox ID Register" +-AT91C_CAN_MB5_MID.helpkey="MailBox ID Register" +-AT91C_CAN_MB5_MID.access=memorymapped +-AT91C_CAN_MB5_MID.address=0xFFFD02A8 +-AT91C_CAN_MB5_MID.width=32 +-AT91C_CAN_MB5_MID.byteEndian=little +-AT91C_CAN_MB5_MMR.name="AT91C_CAN_MB5_MMR" +-AT91C_CAN_MB5_MMR.description="MailBox Mode Register" +-AT91C_CAN_MB5_MMR.helpkey="MailBox Mode Register" +-AT91C_CAN_MB5_MMR.access=memorymapped +-AT91C_CAN_MB5_MMR.address=0xFFFD02A0 +-AT91C_CAN_MB5_MMR.width=32 +-AT91C_CAN_MB5_MMR.byteEndian=little +-AT91C_CAN_MB5_MDL.name="AT91C_CAN_MB5_MDL" +-AT91C_CAN_MB5_MDL.description="MailBox Data Low Register" +-AT91C_CAN_MB5_MDL.helpkey="MailBox Data Low Register" +-AT91C_CAN_MB5_MDL.access=memorymapped +-AT91C_CAN_MB5_MDL.address=0xFFFD02B4 +-AT91C_CAN_MB5_MDL.width=32 +-AT91C_CAN_MB5_MDL.byteEndian=little +-AT91C_CAN_MB5_MAM.name="AT91C_CAN_MB5_MAM" +-AT91C_CAN_MB5_MAM.description="MailBox Acceptance Mask Register" +-AT91C_CAN_MB5_MAM.helpkey="MailBox Acceptance Mask Register" +-AT91C_CAN_MB5_MAM.access=memorymapped +-AT91C_CAN_MB5_MAM.address=0xFFFD02A4 +-AT91C_CAN_MB5_MAM.width=32 +-AT91C_CAN_MB5_MAM.byteEndian=little +-# ========== Register definition for CAN_MB6 peripheral ========== +-AT91C_CAN_MB6_MFID.name="AT91C_CAN_MB6_MFID" +-AT91C_CAN_MB6_MFID.description="MailBox Family ID Register" +-AT91C_CAN_MB6_MFID.helpkey="MailBox Family ID Register" +-AT91C_CAN_MB6_MFID.access=memorymapped +-AT91C_CAN_MB6_MFID.address=0xFFFD02CC +-AT91C_CAN_MB6_MFID.width=32 +-AT91C_CAN_MB6_MFID.byteEndian=little +-AT91C_CAN_MB6_MFID.permission.write=none +-AT91C_CAN_MB6_MID.name="AT91C_CAN_MB6_MID" +-AT91C_CAN_MB6_MID.description="MailBox ID Register" +-AT91C_CAN_MB6_MID.helpkey="MailBox ID Register" +-AT91C_CAN_MB6_MID.access=memorymapped +-AT91C_CAN_MB6_MID.address=0xFFFD02C8 +-AT91C_CAN_MB6_MID.width=32 +-AT91C_CAN_MB6_MID.byteEndian=little +-AT91C_CAN_MB6_MAM.name="AT91C_CAN_MB6_MAM" +-AT91C_CAN_MB6_MAM.description="MailBox Acceptance Mask Register" +-AT91C_CAN_MB6_MAM.helpkey="MailBox Acceptance Mask Register" +-AT91C_CAN_MB6_MAM.access=memorymapped +-AT91C_CAN_MB6_MAM.address=0xFFFD02C4 +-AT91C_CAN_MB6_MAM.width=32 +-AT91C_CAN_MB6_MAM.byteEndian=little +-AT91C_CAN_MB6_MSR.name="AT91C_CAN_MB6_MSR" +-AT91C_CAN_MB6_MSR.description="MailBox Status Register" +-AT91C_CAN_MB6_MSR.helpkey="MailBox Status Register" +-AT91C_CAN_MB6_MSR.access=memorymapped +-AT91C_CAN_MB6_MSR.address=0xFFFD02D0 +-AT91C_CAN_MB6_MSR.width=32 +-AT91C_CAN_MB6_MSR.byteEndian=little +-AT91C_CAN_MB6_MSR.permission.write=none +-AT91C_CAN_MB6_MDL.name="AT91C_CAN_MB6_MDL" +-AT91C_CAN_MB6_MDL.description="MailBox Data Low Register" +-AT91C_CAN_MB6_MDL.helpkey="MailBox Data Low Register" +-AT91C_CAN_MB6_MDL.access=memorymapped +-AT91C_CAN_MB6_MDL.address=0xFFFD02D4 +-AT91C_CAN_MB6_MDL.width=32 +-AT91C_CAN_MB6_MDL.byteEndian=little +-AT91C_CAN_MB6_MCR.name="AT91C_CAN_MB6_MCR" +-AT91C_CAN_MB6_MCR.description="MailBox Control Register" +-AT91C_CAN_MB6_MCR.helpkey="MailBox Control Register" +-AT91C_CAN_MB6_MCR.access=memorymapped +-AT91C_CAN_MB6_MCR.address=0xFFFD02DC +-AT91C_CAN_MB6_MCR.width=32 +-AT91C_CAN_MB6_MCR.byteEndian=little +-AT91C_CAN_MB6_MCR.type=enum +-AT91C_CAN_MB6_MCR.enum.0.name=*** Write only *** +-AT91C_CAN_MB6_MCR.enum.1.name=Error +-AT91C_CAN_MB6_MDH.name="AT91C_CAN_MB6_MDH" +-AT91C_CAN_MB6_MDH.description="MailBox Data High Register" +-AT91C_CAN_MB6_MDH.helpkey="MailBox Data High Register" +-AT91C_CAN_MB6_MDH.access=memorymapped +-AT91C_CAN_MB6_MDH.address=0xFFFD02D8 +-AT91C_CAN_MB6_MDH.width=32 +-AT91C_CAN_MB6_MDH.byteEndian=little +-AT91C_CAN_MB6_MMR.name="AT91C_CAN_MB6_MMR" +-AT91C_CAN_MB6_MMR.description="MailBox Mode Register" +-AT91C_CAN_MB6_MMR.helpkey="MailBox Mode Register" +-AT91C_CAN_MB6_MMR.access=memorymapped +-AT91C_CAN_MB6_MMR.address=0xFFFD02C0 +-AT91C_CAN_MB6_MMR.width=32 +-AT91C_CAN_MB6_MMR.byteEndian=little +-# ========== Register definition for CAN_MB7 peripheral ========== +-AT91C_CAN_MB7_MCR.name="AT91C_CAN_MB7_MCR" +-AT91C_CAN_MB7_MCR.description="MailBox Control Register" +-AT91C_CAN_MB7_MCR.helpkey="MailBox Control Register" +-AT91C_CAN_MB7_MCR.access=memorymapped +-AT91C_CAN_MB7_MCR.address=0xFFFD02FC +-AT91C_CAN_MB7_MCR.width=32 +-AT91C_CAN_MB7_MCR.byteEndian=little +-AT91C_CAN_MB7_MCR.type=enum +-AT91C_CAN_MB7_MCR.enum.0.name=*** Write only *** +-AT91C_CAN_MB7_MCR.enum.1.name=Error +-AT91C_CAN_MB7_MDH.name="AT91C_CAN_MB7_MDH" +-AT91C_CAN_MB7_MDH.description="MailBox Data High Register" +-AT91C_CAN_MB7_MDH.helpkey="MailBox Data High Register" +-AT91C_CAN_MB7_MDH.access=memorymapped +-AT91C_CAN_MB7_MDH.address=0xFFFD02F8 +-AT91C_CAN_MB7_MDH.width=32 +-AT91C_CAN_MB7_MDH.byteEndian=little +-AT91C_CAN_MB7_MFID.name="AT91C_CAN_MB7_MFID" +-AT91C_CAN_MB7_MFID.description="MailBox Family ID Register" +-AT91C_CAN_MB7_MFID.helpkey="MailBox Family ID Register" +-AT91C_CAN_MB7_MFID.access=memorymapped +-AT91C_CAN_MB7_MFID.address=0xFFFD02EC +-AT91C_CAN_MB7_MFID.width=32 +-AT91C_CAN_MB7_MFID.byteEndian=little +-AT91C_CAN_MB7_MFID.permission.write=none +-AT91C_CAN_MB7_MDL.name="AT91C_CAN_MB7_MDL" +-AT91C_CAN_MB7_MDL.description="MailBox Data Low Register" +-AT91C_CAN_MB7_MDL.helpkey="MailBox Data Low Register" +-AT91C_CAN_MB7_MDL.access=memorymapped +-AT91C_CAN_MB7_MDL.address=0xFFFD02F4 +-AT91C_CAN_MB7_MDL.width=32 +-AT91C_CAN_MB7_MDL.byteEndian=little +-AT91C_CAN_MB7_MID.name="AT91C_CAN_MB7_MID" +-AT91C_CAN_MB7_MID.description="MailBox ID Register" +-AT91C_CAN_MB7_MID.helpkey="MailBox ID Register" +-AT91C_CAN_MB7_MID.access=memorymapped +-AT91C_CAN_MB7_MID.address=0xFFFD02E8 +-AT91C_CAN_MB7_MID.width=32 +-AT91C_CAN_MB7_MID.byteEndian=little +-AT91C_CAN_MB7_MMR.name="AT91C_CAN_MB7_MMR" +-AT91C_CAN_MB7_MMR.description="MailBox Mode Register" +-AT91C_CAN_MB7_MMR.helpkey="MailBox Mode Register" +-AT91C_CAN_MB7_MMR.access=memorymapped +-AT91C_CAN_MB7_MMR.address=0xFFFD02E0 +-AT91C_CAN_MB7_MMR.width=32 +-AT91C_CAN_MB7_MMR.byteEndian=little +-AT91C_CAN_MB7_MAM.name="AT91C_CAN_MB7_MAM" +-AT91C_CAN_MB7_MAM.description="MailBox Acceptance Mask Register" +-AT91C_CAN_MB7_MAM.helpkey="MailBox Acceptance Mask Register" +-AT91C_CAN_MB7_MAM.access=memorymapped +-AT91C_CAN_MB7_MAM.address=0xFFFD02E4 +-AT91C_CAN_MB7_MAM.width=32 +-AT91C_CAN_MB7_MAM.byteEndian=little +-AT91C_CAN_MB7_MSR.name="AT91C_CAN_MB7_MSR" +-AT91C_CAN_MB7_MSR.description="MailBox Status Register" +-AT91C_CAN_MB7_MSR.helpkey="MailBox Status Register" +-AT91C_CAN_MB7_MSR.access=memorymapped +-AT91C_CAN_MB7_MSR.address=0xFFFD02F0 +-AT91C_CAN_MB7_MSR.width=32 +-AT91C_CAN_MB7_MSR.byteEndian=little +-AT91C_CAN_MB7_MSR.permission.write=none +-# ========== Register definition for CAN peripheral ========== +-AT91C_CAN_TCR.name="AT91C_CAN_TCR" +-AT91C_CAN_TCR.description="Transfer Command Register" +-AT91C_CAN_TCR.helpkey="Transfer Command Register" +-AT91C_CAN_TCR.access=memorymapped +-AT91C_CAN_TCR.address=0xFFFD0024 +-AT91C_CAN_TCR.width=32 +-AT91C_CAN_TCR.byteEndian=little +-AT91C_CAN_TCR.type=enum +-AT91C_CAN_TCR.enum.0.name=*** Write only *** +-AT91C_CAN_TCR.enum.1.name=Error +-AT91C_CAN_IMR.name="AT91C_CAN_IMR" +-AT91C_CAN_IMR.description="Interrupt Mask Register" +-AT91C_CAN_IMR.helpkey="Interrupt Mask Register" +-AT91C_CAN_IMR.access=memorymapped +-AT91C_CAN_IMR.address=0xFFFD000C +-AT91C_CAN_IMR.width=32 +-AT91C_CAN_IMR.byteEndian=little +-AT91C_CAN_IMR.permission.write=none +-AT91C_CAN_IER.name="AT91C_CAN_IER" +-AT91C_CAN_IER.description="Interrupt Enable Register" +-AT91C_CAN_IER.helpkey="Interrupt Enable Register" +-AT91C_CAN_IER.access=memorymapped +-AT91C_CAN_IER.address=0xFFFD0004 +-AT91C_CAN_IER.width=32 +-AT91C_CAN_IER.byteEndian=little +-AT91C_CAN_IER.type=enum +-AT91C_CAN_IER.enum.0.name=*** Write only *** +-AT91C_CAN_IER.enum.1.name=Error +-AT91C_CAN_ECR.name="AT91C_CAN_ECR" +-AT91C_CAN_ECR.description="Error Counter Register" +-AT91C_CAN_ECR.helpkey="Error Counter Register" +-AT91C_CAN_ECR.access=memorymapped +-AT91C_CAN_ECR.address=0xFFFD0020 +-AT91C_CAN_ECR.width=32 +-AT91C_CAN_ECR.byteEndian=little +-AT91C_CAN_ECR.permission.write=none +-AT91C_CAN_TIMESTP.name="AT91C_CAN_TIMESTP" +-AT91C_CAN_TIMESTP.description="Time Stamp Register" +-AT91C_CAN_TIMESTP.helpkey="Time Stamp Register" +-AT91C_CAN_TIMESTP.access=memorymapped +-AT91C_CAN_TIMESTP.address=0xFFFD001C +-AT91C_CAN_TIMESTP.width=32 +-AT91C_CAN_TIMESTP.byteEndian=little +-AT91C_CAN_TIMESTP.permission.write=none +-AT91C_CAN_MR.name="AT91C_CAN_MR" +-AT91C_CAN_MR.description="Mode Register" +-AT91C_CAN_MR.helpkey="Mode Register" +-AT91C_CAN_MR.access=memorymapped +-AT91C_CAN_MR.address=0xFFFD0000 +-AT91C_CAN_MR.width=32 +-AT91C_CAN_MR.byteEndian=little +-AT91C_CAN_IDR.name="AT91C_CAN_IDR" +-AT91C_CAN_IDR.description="Interrupt Disable Register" +-AT91C_CAN_IDR.helpkey="Interrupt Disable Register" +-AT91C_CAN_IDR.access=memorymapped +-AT91C_CAN_IDR.address=0xFFFD0008 +-AT91C_CAN_IDR.width=32 +-AT91C_CAN_IDR.byteEndian=little +-AT91C_CAN_IDR.type=enum +-AT91C_CAN_IDR.enum.0.name=*** Write only *** +-AT91C_CAN_IDR.enum.1.name=Error +-AT91C_CAN_ACR.name="AT91C_CAN_ACR" +-AT91C_CAN_ACR.description="Abort Command Register" +-AT91C_CAN_ACR.helpkey="Abort Command Register" +-AT91C_CAN_ACR.access=memorymapped +-AT91C_CAN_ACR.address=0xFFFD0028 +-AT91C_CAN_ACR.width=32 +-AT91C_CAN_ACR.byteEndian=little +-AT91C_CAN_ACR.type=enum +-AT91C_CAN_ACR.enum.0.name=*** Write only *** +-AT91C_CAN_ACR.enum.1.name=Error +-AT91C_CAN_TIM.name="AT91C_CAN_TIM" +-AT91C_CAN_TIM.description="Timer Register" +-AT91C_CAN_TIM.helpkey="Timer Register" +-AT91C_CAN_TIM.access=memorymapped +-AT91C_CAN_TIM.address=0xFFFD0018 +-AT91C_CAN_TIM.width=32 +-AT91C_CAN_TIM.byteEndian=little +-AT91C_CAN_TIM.permission.write=none +-AT91C_CAN_SR.name="AT91C_CAN_SR" +-AT91C_CAN_SR.description="Status Register" +-AT91C_CAN_SR.helpkey="Status Register" +-AT91C_CAN_SR.access=memorymapped +-AT91C_CAN_SR.address=0xFFFD0010 +-AT91C_CAN_SR.width=32 +-AT91C_CAN_SR.byteEndian=little +-AT91C_CAN_SR.permission.write=none +-AT91C_CAN_BR.name="AT91C_CAN_BR" +-AT91C_CAN_BR.description="Baudrate Register" +-AT91C_CAN_BR.helpkey="Baudrate Register" +-AT91C_CAN_BR.access=memorymapped +-AT91C_CAN_BR.address=0xFFFD0014 +-AT91C_CAN_BR.width=32 +-AT91C_CAN_BR.byteEndian=little +-AT91C_CAN_VR.name="AT91C_CAN_VR" +-AT91C_CAN_VR.description="Version Register" +-AT91C_CAN_VR.helpkey="Version Register" +-AT91C_CAN_VR.access=memorymapped +-AT91C_CAN_VR.address=0xFFFD00FC +-AT91C_CAN_VR.width=32 +-AT91C_CAN_VR.byteEndian=little +-AT91C_CAN_VR.permission.write=none +-# ========== Register definition for EMAC peripheral ========== +-AT91C_EMAC_ISR.name="AT91C_EMAC_ISR" +-AT91C_EMAC_ISR.description="Interrupt Status Register" +-AT91C_EMAC_ISR.helpkey="Interrupt Status Register" +-AT91C_EMAC_ISR.access=memorymapped +-AT91C_EMAC_ISR.address=0xFFFDC024 +-AT91C_EMAC_ISR.width=32 +-AT91C_EMAC_ISR.byteEndian=little +-AT91C_EMAC_SA4H.name="AT91C_EMAC_SA4H" +-AT91C_EMAC_SA4H.description="Specific Address 4 Top, Last 2 bytes" +-AT91C_EMAC_SA4H.helpkey="Specific Address 4 Top, Last 2 bytes" +-AT91C_EMAC_SA4H.access=memorymapped +-AT91C_EMAC_SA4H.address=0xFFFDC0B4 +-AT91C_EMAC_SA4H.width=32 +-AT91C_EMAC_SA4H.byteEndian=little +-AT91C_EMAC_SA1L.name="AT91C_EMAC_SA1L" +-AT91C_EMAC_SA1L.description="Specific Address 1 Bottom, First 4 bytes" +-AT91C_EMAC_SA1L.helpkey="Specific Address 1 Bottom, First 4 bytes" +-AT91C_EMAC_SA1L.access=memorymapped +-AT91C_EMAC_SA1L.address=0xFFFDC098 +-AT91C_EMAC_SA1L.width=32 +-AT91C_EMAC_SA1L.byteEndian=little +-AT91C_EMAC_ELE.name="AT91C_EMAC_ELE" +-AT91C_EMAC_ELE.description="Excessive Length Errors Register" +-AT91C_EMAC_ELE.helpkey="Excessive Length Errors Register" +-AT91C_EMAC_ELE.access=memorymapped +-AT91C_EMAC_ELE.address=0xFFFDC078 +-AT91C_EMAC_ELE.width=32 +-AT91C_EMAC_ELE.byteEndian=little +-AT91C_EMAC_LCOL.name="AT91C_EMAC_LCOL" +-AT91C_EMAC_LCOL.description="Late Collision Register" +-AT91C_EMAC_LCOL.helpkey="Late Collision Register" +-AT91C_EMAC_LCOL.access=memorymapped +-AT91C_EMAC_LCOL.address=0xFFFDC05C +-AT91C_EMAC_LCOL.width=32 +-AT91C_EMAC_LCOL.byteEndian=little +-AT91C_EMAC_RLE.name="AT91C_EMAC_RLE" +-AT91C_EMAC_RLE.description="Receive Length Field Mismatch Register" +-AT91C_EMAC_RLE.helpkey="Receive Length Field Mismatch Register" +-AT91C_EMAC_RLE.access=memorymapped +-AT91C_EMAC_RLE.address=0xFFFDC088 +-AT91C_EMAC_RLE.width=32 +-AT91C_EMAC_RLE.byteEndian=little +-AT91C_EMAC_WOL.name="AT91C_EMAC_WOL" +-AT91C_EMAC_WOL.description="Wake On LAN Register" +-AT91C_EMAC_WOL.helpkey="Wake On LAN Register" +-AT91C_EMAC_WOL.access=memorymapped +-AT91C_EMAC_WOL.address=0xFFFDC0C4 +-AT91C_EMAC_WOL.width=32 +-AT91C_EMAC_WOL.byteEndian=little +-AT91C_EMAC_DTF.name="AT91C_EMAC_DTF" +-AT91C_EMAC_DTF.description="Deferred Transmission Frame Register" +-AT91C_EMAC_DTF.helpkey="Deferred Transmission Frame Register" +-AT91C_EMAC_DTF.access=memorymapped +-AT91C_EMAC_DTF.address=0xFFFDC058 +-AT91C_EMAC_DTF.width=32 +-AT91C_EMAC_DTF.byteEndian=little +-AT91C_EMAC_TUND.name="AT91C_EMAC_TUND" +-AT91C_EMAC_TUND.description="Transmit Underrun Error Register" +-AT91C_EMAC_TUND.helpkey="Transmit Underrun Error Register" +-AT91C_EMAC_TUND.access=memorymapped +-AT91C_EMAC_TUND.address=0xFFFDC064 +-AT91C_EMAC_TUND.width=32 +-AT91C_EMAC_TUND.byteEndian=little +-AT91C_EMAC_NCR.name="AT91C_EMAC_NCR" +-AT91C_EMAC_NCR.description="Network Control Register" +-AT91C_EMAC_NCR.helpkey="Network Control Register" +-AT91C_EMAC_NCR.access=memorymapped +-AT91C_EMAC_NCR.address=0xFFFDC000 +-AT91C_EMAC_NCR.width=32 +-AT91C_EMAC_NCR.byteEndian=little +-AT91C_EMAC_SA4L.name="AT91C_EMAC_SA4L" +-AT91C_EMAC_SA4L.description="Specific Address 4 Bottom, First 4 bytes" +-AT91C_EMAC_SA4L.helpkey="Specific Address 4 Bottom, First 4 bytes" +-AT91C_EMAC_SA4L.access=memorymapped +-AT91C_EMAC_SA4L.address=0xFFFDC0B0 +-AT91C_EMAC_SA4L.width=32 +-AT91C_EMAC_SA4L.byteEndian=little +-AT91C_EMAC_RSR.name="AT91C_EMAC_RSR" +-AT91C_EMAC_RSR.description="Receive Status Register" +-AT91C_EMAC_RSR.helpkey="Receive Status Register" +-AT91C_EMAC_RSR.access=memorymapped +-AT91C_EMAC_RSR.address=0xFFFDC020 +-AT91C_EMAC_RSR.width=32 +-AT91C_EMAC_RSR.byteEndian=little +-AT91C_EMAC_SA3L.name="AT91C_EMAC_SA3L" +-AT91C_EMAC_SA3L.description="Specific Address 3 Bottom, First 4 bytes" +-AT91C_EMAC_SA3L.helpkey="Specific Address 3 Bottom, First 4 bytes" +-AT91C_EMAC_SA3L.access=memorymapped +-AT91C_EMAC_SA3L.address=0xFFFDC0A8 +-AT91C_EMAC_SA3L.width=32 +-AT91C_EMAC_SA3L.byteEndian=little +-AT91C_EMAC_TSR.name="AT91C_EMAC_TSR" +-AT91C_EMAC_TSR.description="Transmit Status Register" +-AT91C_EMAC_TSR.helpkey="Transmit Status Register" +-AT91C_EMAC_TSR.access=memorymapped +-AT91C_EMAC_TSR.address=0xFFFDC014 +-AT91C_EMAC_TSR.width=32 +-AT91C_EMAC_TSR.byteEndian=little +-AT91C_EMAC_IDR.name="AT91C_EMAC_IDR" +-AT91C_EMAC_IDR.description="Interrupt Disable Register" +-AT91C_EMAC_IDR.helpkey="Interrupt Disable Register" +-AT91C_EMAC_IDR.access=memorymapped +-AT91C_EMAC_IDR.address=0xFFFDC02C +-AT91C_EMAC_IDR.width=32 +-AT91C_EMAC_IDR.byteEndian=little +-AT91C_EMAC_IDR.type=enum +-AT91C_EMAC_IDR.enum.0.name=*** Write only *** +-AT91C_EMAC_IDR.enum.1.name=Error +-AT91C_EMAC_RSE.name="AT91C_EMAC_RSE" +-AT91C_EMAC_RSE.description="Receive Symbol Errors Register" +-AT91C_EMAC_RSE.helpkey="Receive Symbol Errors Register" +-AT91C_EMAC_RSE.access=memorymapped +-AT91C_EMAC_RSE.address=0xFFFDC074 +-AT91C_EMAC_RSE.width=32 +-AT91C_EMAC_RSE.byteEndian=little +-AT91C_EMAC_ECOL.name="AT91C_EMAC_ECOL" +-AT91C_EMAC_ECOL.description="Excessive Collision Register" +-AT91C_EMAC_ECOL.helpkey="Excessive Collision Register" +-AT91C_EMAC_ECOL.access=memorymapped +-AT91C_EMAC_ECOL.address=0xFFFDC060 +-AT91C_EMAC_ECOL.width=32 +-AT91C_EMAC_ECOL.byteEndian=little +-AT91C_EMAC_TID.name="AT91C_EMAC_TID" +-AT91C_EMAC_TID.description="Type ID Checking Register" +-AT91C_EMAC_TID.helpkey="Type ID Checking Register" +-AT91C_EMAC_TID.access=memorymapped +-AT91C_EMAC_TID.address=0xFFFDC0B8 +-AT91C_EMAC_TID.width=32 +-AT91C_EMAC_TID.byteEndian=little +-AT91C_EMAC_HRB.name="AT91C_EMAC_HRB" +-AT91C_EMAC_HRB.description="Hash Address Bottom[31:0]" +-AT91C_EMAC_HRB.helpkey="Hash Address Bottom[31:0]" +-AT91C_EMAC_HRB.access=memorymapped +-AT91C_EMAC_HRB.address=0xFFFDC090 +-AT91C_EMAC_HRB.width=32 +-AT91C_EMAC_HRB.byteEndian=little +-AT91C_EMAC_TBQP.name="AT91C_EMAC_TBQP" +-AT91C_EMAC_TBQP.description="Transmit Buffer Queue Pointer" +-AT91C_EMAC_TBQP.helpkey="Transmit Buffer Queue Pointer" +-AT91C_EMAC_TBQP.access=memorymapped +-AT91C_EMAC_TBQP.address=0xFFFDC01C +-AT91C_EMAC_TBQP.width=32 +-AT91C_EMAC_TBQP.byteEndian=little +-AT91C_EMAC_USRIO.name="AT91C_EMAC_USRIO" +-AT91C_EMAC_USRIO.description="USER Input/Output Register" +-AT91C_EMAC_USRIO.helpkey="USER Input/Output Register" +-AT91C_EMAC_USRIO.access=memorymapped +-AT91C_EMAC_USRIO.address=0xFFFDC0C0 +-AT91C_EMAC_USRIO.width=32 +-AT91C_EMAC_USRIO.byteEndian=little +-AT91C_EMAC_PTR.name="AT91C_EMAC_PTR" +-AT91C_EMAC_PTR.description="Pause Time Register" +-AT91C_EMAC_PTR.helpkey="Pause Time Register" +-AT91C_EMAC_PTR.access=memorymapped +-AT91C_EMAC_PTR.address=0xFFFDC038 +-AT91C_EMAC_PTR.width=32 +-AT91C_EMAC_PTR.byteEndian=little +-AT91C_EMAC_SA2H.name="AT91C_EMAC_SA2H" +-AT91C_EMAC_SA2H.description="Specific Address 2 Top, Last 2 bytes" +-AT91C_EMAC_SA2H.helpkey="Specific Address 2 Top, Last 2 bytes" +-AT91C_EMAC_SA2H.access=memorymapped +-AT91C_EMAC_SA2H.address=0xFFFDC0A4 +-AT91C_EMAC_SA2H.width=32 +-AT91C_EMAC_SA2H.byteEndian=little +-AT91C_EMAC_ROV.name="AT91C_EMAC_ROV" +-AT91C_EMAC_ROV.description="Receive Overrun Errors Register" +-AT91C_EMAC_ROV.helpkey="Receive Overrun Errors Register" +-AT91C_EMAC_ROV.access=memorymapped +-AT91C_EMAC_ROV.address=0xFFFDC070 +-AT91C_EMAC_ROV.width=32 +-AT91C_EMAC_ROV.byteEndian=little +-AT91C_EMAC_ALE.name="AT91C_EMAC_ALE" +-AT91C_EMAC_ALE.description="Alignment Error Register" +-AT91C_EMAC_ALE.helpkey="Alignment Error Register" +-AT91C_EMAC_ALE.access=memorymapped +-AT91C_EMAC_ALE.address=0xFFFDC054 +-AT91C_EMAC_ALE.width=32 +-AT91C_EMAC_ALE.byteEndian=little +-AT91C_EMAC_RJA.name="AT91C_EMAC_RJA" +-AT91C_EMAC_RJA.description="Receive Jabbers Register" +-AT91C_EMAC_RJA.helpkey="Receive Jabbers Register" +-AT91C_EMAC_RJA.access=memorymapped +-AT91C_EMAC_RJA.address=0xFFFDC07C +-AT91C_EMAC_RJA.width=32 +-AT91C_EMAC_RJA.byteEndian=little +-AT91C_EMAC_RBQP.name="AT91C_EMAC_RBQP" +-AT91C_EMAC_RBQP.description="Receive Buffer Queue Pointer" +-AT91C_EMAC_RBQP.helpkey="Receive Buffer Queue Pointer" +-AT91C_EMAC_RBQP.access=memorymapped +-AT91C_EMAC_RBQP.address=0xFFFDC018 +-AT91C_EMAC_RBQP.width=32 +-AT91C_EMAC_RBQP.byteEndian=little +-AT91C_EMAC_TPF.name="AT91C_EMAC_TPF" +-AT91C_EMAC_TPF.description="Transmitted Pause Frames Register" +-AT91C_EMAC_TPF.helpkey="Transmitted Pause Frames Register" +-AT91C_EMAC_TPF.access=memorymapped +-AT91C_EMAC_TPF.address=0xFFFDC08C +-AT91C_EMAC_TPF.width=32 +-AT91C_EMAC_TPF.byteEndian=little +-AT91C_EMAC_NCFGR.name="AT91C_EMAC_NCFGR" +-AT91C_EMAC_NCFGR.description="Network Configuration Register" +-AT91C_EMAC_NCFGR.helpkey="Network Configuration Register" +-AT91C_EMAC_NCFGR.access=memorymapped +-AT91C_EMAC_NCFGR.address=0xFFFDC004 +-AT91C_EMAC_NCFGR.width=32 +-AT91C_EMAC_NCFGR.byteEndian=little +-AT91C_EMAC_HRT.name="AT91C_EMAC_HRT" +-AT91C_EMAC_HRT.description="Hash Address Top[63:32]" +-AT91C_EMAC_HRT.helpkey="Hash Address Top[63:32]" +-AT91C_EMAC_HRT.access=memorymapped +-AT91C_EMAC_HRT.address=0xFFFDC094 +-AT91C_EMAC_HRT.width=32 +-AT91C_EMAC_HRT.byteEndian=little +-AT91C_EMAC_USF.name="AT91C_EMAC_USF" +-AT91C_EMAC_USF.description="Undersize Frames Register" +-AT91C_EMAC_USF.helpkey="Undersize Frames Register" +-AT91C_EMAC_USF.access=memorymapped +-AT91C_EMAC_USF.address=0xFFFDC080 +-AT91C_EMAC_USF.width=32 +-AT91C_EMAC_USF.byteEndian=little +-AT91C_EMAC_FCSE.name="AT91C_EMAC_FCSE" +-AT91C_EMAC_FCSE.description="Frame Check Sequence Error Register" +-AT91C_EMAC_FCSE.helpkey="Frame Check Sequence Error Register" +-AT91C_EMAC_FCSE.access=memorymapped +-AT91C_EMAC_FCSE.address=0xFFFDC050 +-AT91C_EMAC_FCSE.width=32 +-AT91C_EMAC_FCSE.byteEndian=little +-AT91C_EMAC_TPQ.name="AT91C_EMAC_TPQ" +-AT91C_EMAC_TPQ.description="Transmit Pause Quantum Register" +-AT91C_EMAC_TPQ.helpkey="Transmit Pause Quantum Register" +-AT91C_EMAC_TPQ.access=memorymapped +-AT91C_EMAC_TPQ.address=0xFFFDC0BC +-AT91C_EMAC_TPQ.width=32 +-AT91C_EMAC_TPQ.byteEndian=little +-AT91C_EMAC_MAN.name="AT91C_EMAC_MAN" +-AT91C_EMAC_MAN.description="PHY Maintenance Register" +-AT91C_EMAC_MAN.helpkey="PHY Maintenance Register" +-AT91C_EMAC_MAN.access=memorymapped +-AT91C_EMAC_MAN.address=0xFFFDC034 +-AT91C_EMAC_MAN.width=32 +-AT91C_EMAC_MAN.byteEndian=little +-AT91C_EMAC_FTO.name="AT91C_EMAC_FTO" +-AT91C_EMAC_FTO.description="Frames Transmitted OK Register" +-AT91C_EMAC_FTO.helpkey="Frames Transmitted OK Register" +-AT91C_EMAC_FTO.access=memorymapped +-AT91C_EMAC_FTO.address=0xFFFDC040 +-AT91C_EMAC_FTO.width=32 +-AT91C_EMAC_FTO.byteEndian=little +-AT91C_EMAC_REV.name="AT91C_EMAC_REV" +-AT91C_EMAC_REV.description="Revision Register" +-AT91C_EMAC_REV.helpkey="Revision Register" +-AT91C_EMAC_REV.access=memorymapped +-AT91C_EMAC_REV.address=0xFFFDC0FC +-AT91C_EMAC_REV.width=32 +-AT91C_EMAC_REV.byteEndian=little +-AT91C_EMAC_REV.permission.write=none +-AT91C_EMAC_IMR.name="AT91C_EMAC_IMR" +-AT91C_EMAC_IMR.description="Interrupt Mask Register" +-AT91C_EMAC_IMR.helpkey="Interrupt Mask Register" +-AT91C_EMAC_IMR.access=memorymapped +-AT91C_EMAC_IMR.address=0xFFFDC030 +-AT91C_EMAC_IMR.width=32 +-AT91C_EMAC_IMR.byteEndian=little +-AT91C_EMAC_IMR.permission.write=none +-AT91C_EMAC_SCF.name="AT91C_EMAC_SCF" +-AT91C_EMAC_SCF.description="Single Collision Frame Register" +-AT91C_EMAC_SCF.helpkey="Single Collision Frame Register" +-AT91C_EMAC_SCF.access=memorymapped +-AT91C_EMAC_SCF.address=0xFFFDC044 +-AT91C_EMAC_SCF.width=32 +-AT91C_EMAC_SCF.byteEndian=little +-AT91C_EMAC_PFR.name="AT91C_EMAC_PFR" +-AT91C_EMAC_PFR.description="Pause Frames received Register" +-AT91C_EMAC_PFR.helpkey="Pause Frames received Register" +-AT91C_EMAC_PFR.access=memorymapped +-AT91C_EMAC_PFR.address=0xFFFDC03C +-AT91C_EMAC_PFR.width=32 +-AT91C_EMAC_PFR.byteEndian=little +-AT91C_EMAC_MCF.name="AT91C_EMAC_MCF" +-AT91C_EMAC_MCF.description="Multiple Collision Frame Register" +-AT91C_EMAC_MCF.helpkey="Multiple Collision Frame Register" +-AT91C_EMAC_MCF.access=memorymapped +-AT91C_EMAC_MCF.address=0xFFFDC048 +-AT91C_EMAC_MCF.width=32 +-AT91C_EMAC_MCF.byteEndian=little +-AT91C_EMAC_NSR.name="AT91C_EMAC_NSR" +-AT91C_EMAC_NSR.description="Network Status Register" +-AT91C_EMAC_NSR.helpkey="Network Status Register" +-AT91C_EMAC_NSR.access=memorymapped +-AT91C_EMAC_NSR.address=0xFFFDC008 +-AT91C_EMAC_NSR.width=32 +-AT91C_EMAC_NSR.byteEndian=little +-AT91C_EMAC_NSR.permission.write=none +-AT91C_EMAC_SA2L.name="AT91C_EMAC_SA2L" +-AT91C_EMAC_SA2L.description="Specific Address 2 Bottom, First 4 bytes" +-AT91C_EMAC_SA2L.helpkey="Specific Address 2 Bottom, First 4 bytes" +-AT91C_EMAC_SA2L.access=memorymapped +-AT91C_EMAC_SA2L.address=0xFFFDC0A0 +-AT91C_EMAC_SA2L.width=32 +-AT91C_EMAC_SA2L.byteEndian=little +-AT91C_EMAC_FRO.name="AT91C_EMAC_FRO" +-AT91C_EMAC_FRO.description="Frames Received OK Register" +-AT91C_EMAC_FRO.helpkey="Frames Received OK Register" +-AT91C_EMAC_FRO.access=memorymapped +-AT91C_EMAC_FRO.address=0xFFFDC04C +-AT91C_EMAC_FRO.width=32 +-AT91C_EMAC_FRO.byteEndian=little +-AT91C_EMAC_IER.name="AT91C_EMAC_IER" +-AT91C_EMAC_IER.description="Interrupt Enable Register" +-AT91C_EMAC_IER.helpkey="Interrupt Enable Register" +-AT91C_EMAC_IER.access=memorymapped +-AT91C_EMAC_IER.address=0xFFFDC028 +-AT91C_EMAC_IER.width=32 +-AT91C_EMAC_IER.byteEndian=little +-AT91C_EMAC_IER.type=enum +-AT91C_EMAC_IER.enum.0.name=*** Write only *** +-AT91C_EMAC_IER.enum.1.name=Error +-AT91C_EMAC_SA1H.name="AT91C_EMAC_SA1H" +-AT91C_EMAC_SA1H.description="Specific Address 1 Top, Last 2 bytes" +-AT91C_EMAC_SA1H.helpkey="Specific Address 1 Top, Last 2 bytes" +-AT91C_EMAC_SA1H.access=memorymapped +-AT91C_EMAC_SA1H.address=0xFFFDC09C +-AT91C_EMAC_SA1H.width=32 +-AT91C_EMAC_SA1H.byteEndian=little +-AT91C_EMAC_CSE.name="AT91C_EMAC_CSE" +-AT91C_EMAC_CSE.description="Carrier Sense Error Register" +-AT91C_EMAC_CSE.helpkey="Carrier Sense Error Register" +-AT91C_EMAC_CSE.access=memorymapped +-AT91C_EMAC_CSE.address=0xFFFDC068 +-AT91C_EMAC_CSE.width=32 +-AT91C_EMAC_CSE.byteEndian=little +-AT91C_EMAC_SA3H.name="AT91C_EMAC_SA3H" +-AT91C_EMAC_SA3H.description="Specific Address 3 Top, Last 2 bytes" +-AT91C_EMAC_SA3H.helpkey="Specific Address 3 Top, Last 2 bytes" +-AT91C_EMAC_SA3H.access=memorymapped +-AT91C_EMAC_SA3H.address=0xFFFDC0AC +-AT91C_EMAC_SA3H.width=32 +-AT91C_EMAC_SA3H.byteEndian=little +-AT91C_EMAC_RRE.name="AT91C_EMAC_RRE" +-AT91C_EMAC_RRE.description="Receive Ressource Error Register" +-AT91C_EMAC_RRE.helpkey="Receive Ressource Error Register" +-AT91C_EMAC_RRE.access=memorymapped +-AT91C_EMAC_RRE.address=0xFFFDC06C +-AT91C_EMAC_RRE.width=32 +-AT91C_EMAC_RRE.byteEndian=little +-AT91C_EMAC_STE.name="AT91C_EMAC_STE" +-AT91C_EMAC_STE.description="SQE Test Error Register" +-AT91C_EMAC_STE.helpkey="SQE Test Error Register" +-AT91C_EMAC_STE.access=memorymapped +-AT91C_EMAC_STE.address=0xFFFDC084 +-AT91C_EMAC_STE.width=32 +-AT91C_EMAC_STE.byteEndian=little +-# ========== Register definition for PDC_ADC peripheral ========== +-AT91C_ADC_PTSR.name="AT91C_ADC_PTSR" +-AT91C_ADC_PTSR.description="PDC Transfer Status Register" +-AT91C_ADC_PTSR.helpkey="PDC Transfer Status Register" +-AT91C_ADC_PTSR.access=memorymapped +-AT91C_ADC_PTSR.address=0xFFFD8124 +-AT91C_ADC_PTSR.width=32 +-AT91C_ADC_PTSR.byteEndian=little +-AT91C_ADC_PTSR.permission.write=none +-AT91C_ADC_PTCR.name="AT91C_ADC_PTCR" +-AT91C_ADC_PTCR.description="PDC Transfer Control Register" +-AT91C_ADC_PTCR.helpkey="PDC Transfer Control Register" +-AT91C_ADC_PTCR.access=memorymapped +-AT91C_ADC_PTCR.address=0xFFFD8120 +-AT91C_ADC_PTCR.width=32 +-AT91C_ADC_PTCR.byteEndian=little +-AT91C_ADC_PTCR.type=enum +-AT91C_ADC_PTCR.enum.0.name=*** Write only *** +-AT91C_ADC_PTCR.enum.1.name=Error +-AT91C_ADC_TNPR.name="AT91C_ADC_TNPR" +-AT91C_ADC_TNPR.description="Transmit Next Pointer Register" +-AT91C_ADC_TNPR.helpkey="Transmit Next Pointer Register" +-AT91C_ADC_TNPR.access=memorymapped +-AT91C_ADC_TNPR.address=0xFFFD8118 +-AT91C_ADC_TNPR.width=32 +-AT91C_ADC_TNPR.byteEndian=little +-AT91C_ADC_TNCR.name="AT91C_ADC_TNCR" +-AT91C_ADC_TNCR.description="Transmit Next Counter Register" +-AT91C_ADC_TNCR.helpkey="Transmit Next Counter Register" +-AT91C_ADC_TNCR.access=memorymapped +-AT91C_ADC_TNCR.address=0xFFFD811C +-AT91C_ADC_TNCR.width=32 +-AT91C_ADC_TNCR.byteEndian=little +-AT91C_ADC_RNPR.name="AT91C_ADC_RNPR" +-AT91C_ADC_RNPR.description="Receive Next Pointer Register" +-AT91C_ADC_RNPR.helpkey="Receive Next Pointer Register" +-AT91C_ADC_RNPR.access=memorymapped +-AT91C_ADC_RNPR.address=0xFFFD8110 +-AT91C_ADC_RNPR.width=32 +-AT91C_ADC_RNPR.byteEndian=little +-AT91C_ADC_RNCR.name="AT91C_ADC_RNCR" +-AT91C_ADC_RNCR.description="Receive Next Counter Register" +-AT91C_ADC_RNCR.helpkey="Receive Next Counter Register" +-AT91C_ADC_RNCR.access=memorymapped +-AT91C_ADC_RNCR.address=0xFFFD8114 +-AT91C_ADC_RNCR.width=32 +-AT91C_ADC_RNCR.byteEndian=little +-AT91C_ADC_RPR.name="AT91C_ADC_RPR" +-AT91C_ADC_RPR.description="Receive Pointer Register" +-AT91C_ADC_RPR.helpkey="Receive Pointer Register" +-AT91C_ADC_RPR.access=memorymapped +-AT91C_ADC_RPR.address=0xFFFD8100 +-AT91C_ADC_RPR.width=32 +-AT91C_ADC_RPR.byteEndian=little +-AT91C_ADC_TCR.name="AT91C_ADC_TCR" +-AT91C_ADC_TCR.description="Transmit Counter Register" +-AT91C_ADC_TCR.helpkey="Transmit Counter Register" +-AT91C_ADC_TCR.access=memorymapped +-AT91C_ADC_TCR.address=0xFFFD810C +-AT91C_ADC_TCR.width=32 +-AT91C_ADC_TCR.byteEndian=little +-AT91C_ADC_TPR.name="AT91C_ADC_TPR" +-AT91C_ADC_TPR.description="Transmit Pointer Register" +-AT91C_ADC_TPR.helpkey="Transmit Pointer Register" +-AT91C_ADC_TPR.access=memorymapped +-AT91C_ADC_TPR.address=0xFFFD8108 +-AT91C_ADC_TPR.width=32 +-AT91C_ADC_TPR.byteEndian=little +-AT91C_ADC_RCR.name="AT91C_ADC_RCR" +-AT91C_ADC_RCR.description="Receive Counter Register" +-AT91C_ADC_RCR.helpkey="Receive Counter Register" +-AT91C_ADC_RCR.access=memorymapped +-AT91C_ADC_RCR.address=0xFFFD8104 +-AT91C_ADC_RCR.width=32 +-AT91C_ADC_RCR.byteEndian=little +-# ========== Register definition for ADC peripheral ========== +-AT91C_ADC_CDR2.name="AT91C_ADC_CDR2" +-AT91C_ADC_CDR2.description="ADC Channel Data Register 2" +-AT91C_ADC_CDR2.helpkey="ADC Channel Data Register 2" +-AT91C_ADC_CDR2.access=memorymapped +-AT91C_ADC_CDR2.address=0xFFFD8038 +-AT91C_ADC_CDR2.width=32 +-AT91C_ADC_CDR2.byteEndian=little +-AT91C_ADC_CDR2.permission.write=none +-AT91C_ADC_CDR3.name="AT91C_ADC_CDR3" +-AT91C_ADC_CDR3.description="ADC Channel Data Register 3" +-AT91C_ADC_CDR3.helpkey="ADC Channel Data Register 3" +-AT91C_ADC_CDR3.access=memorymapped +-AT91C_ADC_CDR3.address=0xFFFD803C +-AT91C_ADC_CDR3.width=32 +-AT91C_ADC_CDR3.byteEndian=little +-AT91C_ADC_CDR3.permission.write=none +-AT91C_ADC_CDR0.name="AT91C_ADC_CDR0" +-AT91C_ADC_CDR0.description="ADC Channel Data Register 0" +-AT91C_ADC_CDR0.helpkey="ADC Channel Data Register 0" +-AT91C_ADC_CDR0.access=memorymapped +-AT91C_ADC_CDR0.address=0xFFFD8030 +-AT91C_ADC_CDR0.width=32 +-AT91C_ADC_CDR0.byteEndian=little +-AT91C_ADC_CDR0.permission.write=none +-AT91C_ADC_CDR5.name="AT91C_ADC_CDR5" +-AT91C_ADC_CDR5.description="ADC Channel Data Register 5" +-AT91C_ADC_CDR5.helpkey="ADC Channel Data Register 5" +-AT91C_ADC_CDR5.access=memorymapped +-AT91C_ADC_CDR5.address=0xFFFD8044 +-AT91C_ADC_CDR5.width=32 +-AT91C_ADC_CDR5.byteEndian=little +-AT91C_ADC_CDR5.permission.write=none +-AT91C_ADC_CHDR.name="AT91C_ADC_CHDR" +-AT91C_ADC_CHDR.description="ADC Channel Disable Register" +-AT91C_ADC_CHDR.helpkey="ADC Channel Disable Register" +-AT91C_ADC_CHDR.access=memorymapped +-AT91C_ADC_CHDR.address=0xFFFD8014 +-AT91C_ADC_CHDR.width=32 +-AT91C_ADC_CHDR.byteEndian=little +-AT91C_ADC_CHDR.type=enum +-AT91C_ADC_CHDR.enum.0.name=*** Write only *** +-AT91C_ADC_CHDR.enum.1.name=Error +-AT91C_ADC_SR.name="AT91C_ADC_SR" +-AT91C_ADC_SR.description="ADC Status Register" +-AT91C_ADC_SR.helpkey="ADC Status Register" +-AT91C_ADC_SR.access=memorymapped +-AT91C_ADC_SR.address=0xFFFD801C +-AT91C_ADC_SR.width=32 +-AT91C_ADC_SR.byteEndian=little +-AT91C_ADC_SR.permission.write=none +-AT91C_ADC_CDR4.name="AT91C_ADC_CDR4" +-AT91C_ADC_CDR4.description="ADC Channel Data Register 4" +-AT91C_ADC_CDR4.helpkey="ADC Channel Data Register 4" +-AT91C_ADC_CDR4.access=memorymapped +-AT91C_ADC_CDR4.address=0xFFFD8040 +-AT91C_ADC_CDR4.width=32 +-AT91C_ADC_CDR4.byteEndian=little +-AT91C_ADC_CDR4.permission.write=none +-AT91C_ADC_CDR1.name="AT91C_ADC_CDR1" +-AT91C_ADC_CDR1.description="ADC Channel Data Register 1" +-AT91C_ADC_CDR1.helpkey="ADC Channel Data Register 1" +-AT91C_ADC_CDR1.access=memorymapped +-AT91C_ADC_CDR1.address=0xFFFD8034 +-AT91C_ADC_CDR1.width=32 +-AT91C_ADC_CDR1.byteEndian=little +-AT91C_ADC_CDR1.permission.write=none +-AT91C_ADC_LCDR.name="AT91C_ADC_LCDR" +-AT91C_ADC_LCDR.description="ADC Last Converted Data Register" +-AT91C_ADC_LCDR.helpkey="ADC Last Converted Data Register" +-AT91C_ADC_LCDR.access=memorymapped +-AT91C_ADC_LCDR.address=0xFFFD8020 +-AT91C_ADC_LCDR.width=32 +-AT91C_ADC_LCDR.byteEndian=little +-AT91C_ADC_LCDR.permission.write=none +-AT91C_ADC_IDR.name="AT91C_ADC_IDR" +-AT91C_ADC_IDR.description="ADC Interrupt Disable Register" +-AT91C_ADC_IDR.helpkey="ADC Interrupt Disable Register" +-AT91C_ADC_IDR.access=memorymapped +-AT91C_ADC_IDR.address=0xFFFD8028 +-AT91C_ADC_IDR.width=32 +-AT91C_ADC_IDR.byteEndian=little +-AT91C_ADC_IDR.type=enum +-AT91C_ADC_IDR.enum.0.name=*** Write only *** +-AT91C_ADC_IDR.enum.1.name=Error +-AT91C_ADC_CR.name="AT91C_ADC_CR" +-AT91C_ADC_CR.description="ADC Control Register" +-AT91C_ADC_CR.helpkey="ADC Control Register" +-AT91C_ADC_CR.access=memorymapped +-AT91C_ADC_CR.address=0xFFFD8000 +-AT91C_ADC_CR.width=32 +-AT91C_ADC_CR.byteEndian=little +-AT91C_ADC_CR.type=enum +-AT91C_ADC_CR.enum.0.name=*** Write only *** +-AT91C_ADC_CR.enum.1.name=Error +-AT91C_ADC_CDR7.name="AT91C_ADC_CDR7" +-AT91C_ADC_CDR7.description="ADC Channel Data Register 7" +-AT91C_ADC_CDR7.helpkey="ADC Channel Data Register 7" +-AT91C_ADC_CDR7.access=memorymapped +-AT91C_ADC_CDR7.address=0xFFFD804C +-AT91C_ADC_CDR7.width=32 +-AT91C_ADC_CDR7.byteEndian=little +-AT91C_ADC_CDR7.permission.write=none +-AT91C_ADC_CDR6.name="AT91C_ADC_CDR6" +-AT91C_ADC_CDR6.description="ADC Channel Data Register 6" +-AT91C_ADC_CDR6.helpkey="ADC Channel Data Register 6" +-AT91C_ADC_CDR6.access=memorymapped +-AT91C_ADC_CDR6.address=0xFFFD8048 +-AT91C_ADC_CDR6.width=32 +-AT91C_ADC_CDR6.byteEndian=little +-AT91C_ADC_CDR6.permission.write=none +-AT91C_ADC_IER.name="AT91C_ADC_IER" +-AT91C_ADC_IER.description="ADC Interrupt Enable Register" +-AT91C_ADC_IER.helpkey="ADC Interrupt Enable Register" +-AT91C_ADC_IER.access=memorymapped +-AT91C_ADC_IER.address=0xFFFD8024 +-AT91C_ADC_IER.width=32 +-AT91C_ADC_IER.byteEndian=little +-AT91C_ADC_IER.type=enum +-AT91C_ADC_IER.enum.0.name=*** Write only *** +-AT91C_ADC_IER.enum.1.name=Error +-AT91C_ADC_CHER.name="AT91C_ADC_CHER" +-AT91C_ADC_CHER.description="ADC Channel Enable Register" +-AT91C_ADC_CHER.helpkey="ADC Channel Enable Register" +-AT91C_ADC_CHER.access=memorymapped +-AT91C_ADC_CHER.address=0xFFFD8010 +-AT91C_ADC_CHER.width=32 +-AT91C_ADC_CHER.byteEndian=little +-AT91C_ADC_CHER.type=enum +-AT91C_ADC_CHER.enum.0.name=*** Write only *** +-AT91C_ADC_CHER.enum.1.name=Error +-AT91C_ADC_CHSR.name="AT91C_ADC_CHSR" +-AT91C_ADC_CHSR.description="ADC Channel Status Register" +-AT91C_ADC_CHSR.helpkey="ADC Channel Status Register" +-AT91C_ADC_CHSR.access=memorymapped +-AT91C_ADC_CHSR.address=0xFFFD8018 +-AT91C_ADC_CHSR.width=32 +-AT91C_ADC_CHSR.byteEndian=little +-AT91C_ADC_CHSR.permission.write=none +-AT91C_ADC_MR.name="AT91C_ADC_MR" +-AT91C_ADC_MR.description="ADC Mode Register" +-AT91C_ADC_MR.helpkey="ADC Mode Register" +-AT91C_ADC_MR.access=memorymapped +-AT91C_ADC_MR.address=0xFFFD8004 +-AT91C_ADC_MR.width=32 +-AT91C_ADC_MR.byteEndian=little +-AT91C_ADC_IMR.name="AT91C_ADC_IMR" +-AT91C_ADC_IMR.description="ADC Interrupt Mask Register" +-AT91C_ADC_IMR.helpkey="ADC Interrupt Mask Register" +-AT91C_ADC_IMR.access=memorymapped +-AT91C_ADC_IMR.address=0xFFFD802C +-AT91C_ADC_IMR.width=32 +-AT91C_ADC_IMR.byteEndian=little +-AT91C_ADC_IMR.permission.write=none +-# ========== Group definition for SYS peripheral ========== +-group.SYS.description="ATMEL SYS Registers" +-group.SYS.helpkey="ATMEL SYS Registers" +-# ========== Group definition for AIC peripheral ========== +-group.AIC.description="ATMEL AIC Registers" +-group.AIC.helpkey="ATMEL AIC Registers" +-group.AIC.register.0=AT91C_AIC_IVR +-group.AIC.register.1=AT91C_AIC_SMR +-group.AIC.register.2=AT91C_AIC_FVR +-group.AIC.register.3=AT91C_AIC_DCR +-group.AIC.register.4=AT91C_AIC_EOICR +-group.AIC.register.5=AT91C_AIC_SVR +-group.AIC.register.6=AT91C_AIC_FFSR +-group.AIC.register.7=AT91C_AIC_ICCR +-group.AIC.register.8=AT91C_AIC_ISR +-group.AIC.register.9=AT91C_AIC_IMR +-group.AIC.register.10=AT91C_AIC_IPR +-group.AIC.register.11=AT91C_AIC_FFER +-group.AIC.register.12=AT91C_AIC_IECR +-group.AIC.register.13=AT91C_AIC_ISCR +-group.AIC.register.14=AT91C_AIC_FFDR +-group.AIC.register.15=AT91C_AIC_CISR +-group.AIC.register.16=AT91C_AIC_IDCR +-group.AIC.register.17=AT91C_AIC_SPU +-# ========== Group definition for PDC_DBGU peripheral ========== +-group.PDC_DBGU.description="ATMEL PDC_DBGU Registers" +-group.PDC_DBGU.helpkey="ATMEL PDC_DBGU Registers" +-group.PDC_DBGU.register.0=AT91C_DBGU_TCR +-group.PDC_DBGU.register.1=AT91C_DBGU_RNPR +-group.PDC_DBGU.register.2=AT91C_DBGU_TNPR +-group.PDC_DBGU.register.3=AT91C_DBGU_TPR +-group.PDC_DBGU.register.4=AT91C_DBGU_RPR +-group.PDC_DBGU.register.5=AT91C_DBGU_RCR +-group.PDC_DBGU.register.6=AT91C_DBGU_RNCR +-group.PDC_DBGU.register.7=AT91C_DBGU_PTCR +-group.PDC_DBGU.register.8=AT91C_DBGU_PTSR +-group.PDC_DBGU.register.9=AT91C_DBGU_TNCR +-# ========== Group definition for DBGU peripheral ========== +-group.DBGU.description="ATMEL DBGU Registers" +-group.DBGU.helpkey="ATMEL DBGU Registers" +-group.DBGU.register.0=AT91C_DBGU_EXID +-group.DBGU.register.1=AT91C_DBGU_BRGR +-group.DBGU.register.2=AT91C_DBGU_IDR +-group.DBGU.register.3=AT91C_DBGU_CSR +-group.DBGU.register.4=AT91C_DBGU_CIDR +-group.DBGU.register.5=AT91C_DBGU_MR +-group.DBGU.register.6=AT91C_DBGU_IMR +-group.DBGU.register.7=AT91C_DBGU_CR +-group.DBGU.register.8=AT91C_DBGU_FNTR +-group.DBGU.register.9=AT91C_DBGU_THR +-group.DBGU.register.10=AT91C_DBGU_RHR +-group.DBGU.register.11=AT91C_DBGU_IER +-# ========== Group definition for PIOA peripheral ========== +-group.PIOA.description="ATMEL PIOA Registers" +-group.PIOA.helpkey="ATMEL PIOA Registers" +-group.PIOA.register.0=AT91C_PIOA_ODR +-group.PIOA.register.1=AT91C_PIOA_SODR +-group.PIOA.register.2=AT91C_PIOA_ISR +-group.PIOA.register.3=AT91C_PIOA_ABSR +-group.PIOA.register.4=AT91C_PIOA_IER +-group.PIOA.register.5=AT91C_PIOA_PPUDR +-group.PIOA.register.6=AT91C_PIOA_IMR +-group.PIOA.register.7=AT91C_PIOA_PER +-group.PIOA.register.8=AT91C_PIOA_IFDR +-group.PIOA.register.9=AT91C_PIOA_OWDR +-group.PIOA.register.10=AT91C_PIOA_MDSR +-group.PIOA.register.11=AT91C_PIOA_IDR +-group.PIOA.register.12=AT91C_PIOA_ODSR +-group.PIOA.register.13=AT91C_PIOA_PPUSR +-group.PIOA.register.14=AT91C_PIOA_OWSR +-group.PIOA.register.15=AT91C_PIOA_BSR +-group.PIOA.register.16=AT91C_PIOA_OWER +-group.PIOA.register.17=AT91C_PIOA_IFER +-group.PIOA.register.18=AT91C_PIOA_PDSR +-group.PIOA.register.19=AT91C_PIOA_PPUER +-group.PIOA.register.20=AT91C_PIOA_OSR +-group.PIOA.register.21=AT91C_PIOA_ASR +-group.PIOA.register.22=AT91C_PIOA_MDDR +-group.PIOA.register.23=AT91C_PIOA_CODR +-group.PIOA.register.24=AT91C_PIOA_MDER +-group.PIOA.register.25=AT91C_PIOA_PDR +-group.PIOA.register.26=AT91C_PIOA_IFSR +-group.PIOA.register.27=AT91C_PIOA_OER +-group.PIOA.register.28=AT91C_PIOA_PSR +-# ========== Group definition for PIOB peripheral ========== +-group.PIOB.description="ATMEL PIOB Registers" +-group.PIOB.helpkey="ATMEL PIOB Registers" +-group.PIOB.register.0=AT91C_PIOB_OWDR +-group.PIOB.register.1=AT91C_PIOB_MDER +-group.PIOB.register.2=AT91C_PIOB_PPUSR +-group.PIOB.register.3=AT91C_PIOB_IMR +-group.PIOB.register.4=AT91C_PIOB_ASR +-group.PIOB.register.5=AT91C_PIOB_PPUDR +-group.PIOB.register.6=AT91C_PIOB_PSR +-group.PIOB.register.7=AT91C_PIOB_IER +-group.PIOB.register.8=AT91C_PIOB_CODR +-group.PIOB.register.9=AT91C_PIOB_OWER +-group.PIOB.register.10=AT91C_PIOB_ABSR +-group.PIOB.register.11=AT91C_PIOB_IFDR +-group.PIOB.register.12=AT91C_PIOB_PDSR +-group.PIOB.register.13=AT91C_PIOB_IDR +-group.PIOB.register.14=AT91C_PIOB_OWSR +-group.PIOB.register.15=AT91C_PIOB_PDR +-group.PIOB.register.16=AT91C_PIOB_ODR +-group.PIOB.register.17=AT91C_PIOB_IFSR +-group.PIOB.register.18=AT91C_PIOB_PPUER +-group.PIOB.register.19=AT91C_PIOB_SODR +-group.PIOB.register.20=AT91C_PIOB_ISR +-group.PIOB.register.21=AT91C_PIOB_ODSR +-group.PIOB.register.22=AT91C_PIOB_OSR +-group.PIOB.register.23=AT91C_PIOB_MDSR +-group.PIOB.register.24=AT91C_PIOB_IFER +-group.PIOB.register.25=AT91C_PIOB_BSR +-group.PIOB.register.26=AT91C_PIOB_MDDR +-group.PIOB.register.27=AT91C_PIOB_OER +-group.PIOB.register.28=AT91C_PIOB_PER +-# ========== Group definition for CKGR peripheral ========== +-group.CKGR.description="ATMEL CKGR Registers" +-group.CKGR.helpkey="ATMEL CKGR Registers" +-group.CKGR.register.0=AT91C_CKGR_MOR +-group.CKGR.register.1=AT91C_CKGR_PLLR +-group.CKGR.register.2=AT91C_CKGR_MCFR +-# ========== Group definition for PMC peripheral ========== +-group.PMC.description="ATMEL PMC Registers" +-group.PMC.helpkey="ATMEL PMC Registers" +-group.PMC.register.0=AT91C_PMC_IDR +-group.PMC.register.1=AT91C_PMC_MOR +-group.PMC.register.2=AT91C_PMC_PLLR +-group.PMC.register.3=AT91C_PMC_PCER +-group.PMC.register.4=AT91C_PMC_PCKR +-group.PMC.register.5=AT91C_PMC_MCKR +-group.PMC.register.6=AT91C_PMC_SCDR +-group.PMC.register.7=AT91C_PMC_PCDR +-group.PMC.register.8=AT91C_PMC_SCSR +-group.PMC.register.9=AT91C_PMC_PCSR +-group.PMC.register.10=AT91C_PMC_MCFR +-group.PMC.register.11=AT91C_PMC_SCER +-group.PMC.register.12=AT91C_PMC_IMR +-group.PMC.register.13=AT91C_PMC_IER +-group.PMC.register.14=AT91C_PMC_SR +-# ========== Group definition for RSTC peripheral ========== +-group.RSTC.description="ATMEL RSTC Registers" +-group.RSTC.helpkey="ATMEL RSTC Registers" +-group.RSTC.register.0=AT91C_RSTC_RCR +-group.RSTC.register.1=AT91C_RSTC_RMR +-group.RSTC.register.2=AT91C_RSTC_RSR +-# ========== Group definition for RTTC peripheral ========== +-group.RTTC.description="ATMEL RTTC Registers" +-group.RTTC.helpkey="ATMEL RTTC Registers" +-group.RTTC.register.0=AT91C_RTTC_RTSR +-group.RTTC.register.1=AT91C_RTTC_RTMR +-group.RTTC.register.2=AT91C_RTTC_RTVR +-group.RTTC.register.3=AT91C_RTTC_RTAR +-# ========== Group definition for PITC peripheral ========== +-group.PITC.description="ATMEL PITC Registers" +-group.PITC.helpkey="ATMEL PITC Registers" +-group.PITC.register.0=AT91C_PITC_PIVR +-group.PITC.register.1=AT91C_PITC_PISR +-group.PITC.register.2=AT91C_PITC_PIIR +-group.PITC.register.3=AT91C_PITC_PIMR +-# ========== Group definition for WDTC peripheral ========== +-group.WDTC.description="ATMEL WDTC Registers" +-group.WDTC.helpkey="ATMEL WDTC Registers" +-group.WDTC.register.0=AT91C_WDTC_WDCR +-group.WDTC.register.1=AT91C_WDTC_WDSR +-group.WDTC.register.2=AT91C_WDTC_WDMR +-# ========== Group definition for VREG peripheral ========== +-group.VREG.description="ATMEL VREG Registers" +-group.VREG.helpkey="ATMEL VREG Registers" +-group.VREG.register.0=AT91C_VREG_MR +-# ========== Group definition for MC peripheral ========== +-group.MC.description="ATMEL MC Registers" +-group.MC.helpkey="ATMEL MC Registers" +-group.MC.register.0=AT91C_MC_ASR +-group.MC.register.1=AT91C_MC_RCR +-group.MC.register.2=AT91C_MC_FCR +-group.MC.register.3=AT91C_MC_AASR +-group.MC.register.4=AT91C_MC_FSR +-group.MC.register.5=AT91C_MC_FMR +-# ========== Group definition for PDC_SPI1 peripheral ========== +-group.PDC_SPI1.description="ATMEL PDC_SPI1 Registers" +-group.PDC_SPI1.helpkey="ATMEL PDC_SPI1 Registers" +-group.PDC_SPI1.register.0=AT91C_SPI1_PTCR +-group.PDC_SPI1.register.1=AT91C_SPI1_RPR +-group.PDC_SPI1.register.2=AT91C_SPI1_TNCR +-group.PDC_SPI1.register.3=AT91C_SPI1_TPR +-group.PDC_SPI1.register.4=AT91C_SPI1_TNPR +-group.PDC_SPI1.register.5=AT91C_SPI1_TCR +-group.PDC_SPI1.register.6=AT91C_SPI1_RCR +-group.PDC_SPI1.register.7=AT91C_SPI1_RNPR +-group.PDC_SPI1.register.8=AT91C_SPI1_RNCR +-group.PDC_SPI1.register.9=AT91C_SPI1_PTSR +-# ========== Group definition for SPI1 peripheral ========== +-group.SPI1.description="ATMEL SPI1 Registers" +-group.SPI1.helpkey="ATMEL SPI1 Registers" +-group.SPI1.register.0=AT91C_SPI1_IMR +-group.SPI1.register.1=AT91C_SPI1_IER +-group.SPI1.register.2=AT91C_SPI1_MR +-group.SPI1.register.3=AT91C_SPI1_RDR +-group.SPI1.register.4=AT91C_SPI1_IDR +-group.SPI1.register.5=AT91C_SPI1_SR +-group.SPI1.register.6=AT91C_SPI1_TDR +-group.SPI1.register.7=AT91C_SPI1_CR +-group.SPI1.register.8=AT91C_SPI1_CSR +-# ========== Group definition for PDC_SPI0 peripheral ========== +-group.PDC_SPI0.description="ATMEL PDC_SPI0 Registers" +-group.PDC_SPI0.helpkey="ATMEL PDC_SPI0 Registers" +-group.PDC_SPI0.register.0=AT91C_SPI0_PTCR +-group.PDC_SPI0.register.1=AT91C_SPI0_TPR +-group.PDC_SPI0.register.2=AT91C_SPI0_TCR +-group.PDC_SPI0.register.3=AT91C_SPI0_RCR +-group.PDC_SPI0.register.4=AT91C_SPI0_PTSR +-group.PDC_SPI0.register.5=AT91C_SPI0_RNPR +-group.PDC_SPI0.register.6=AT91C_SPI0_RPR +-group.PDC_SPI0.register.7=AT91C_SPI0_TNCR +-group.PDC_SPI0.register.8=AT91C_SPI0_RNCR +-group.PDC_SPI0.register.9=AT91C_SPI0_TNPR +-# ========== Group definition for SPI0 peripheral ========== +-group.SPI0.description="ATMEL SPI0 Registers" +-group.SPI0.helpkey="ATMEL SPI0 Registers" +-group.SPI0.register.0=AT91C_SPI0_IER +-group.SPI0.register.1=AT91C_SPI0_SR +-group.SPI0.register.2=AT91C_SPI0_IDR +-group.SPI0.register.3=AT91C_SPI0_CR +-group.SPI0.register.4=AT91C_SPI0_MR +-group.SPI0.register.5=AT91C_SPI0_IMR +-group.SPI0.register.6=AT91C_SPI0_TDR +-group.SPI0.register.7=AT91C_SPI0_RDR +-group.SPI0.register.8=AT91C_SPI0_CSR +-# ========== Group definition for PDC_US1 peripheral ========== +-group.PDC_US1.description="ATMEL PDC_US1 Registers" +-group.PDC_US1.helpkey="ATMEL PDC_US1 Registers" +-group.PDC_US1.register.0=AT91C_US1_RNCR +-group.PDC_US1.register.1=AT91C_US1_PTCR +-group.PDC_US1.register.2=AT91C_US1_TCR +-group.PDC_US1.register.3=AT91C_US1_PTSR +-group.PDC_US1.register.4=AT91C_US1_TNPR +-group.PDC_US1.register.5=AT91C_US1_RCR +-group.PDC_US1.register.6=AT91C_US1_RNPR +-group.PDC_US1.register.7=AT91C_US1_RPR +-group.PDC_US1.register.8=AT91C_US1_TNCR +-group.PDC_US1.register.9=AT91C_US1_TPR +-# ========== Group definition for US1 peripheral ========== +-group.US1.description="ATMEL US1 Registers" +-group.US1.helpkey="ATMEL US1 Registers" +-group.US1.register.0=AT91C_US1_IF +-group.US1.register.1=AT91C_US1_NER +-group.US1.register.2=AT91C_US1_RTOR +-group.US1.register.3=AT91C_US1_CSR +-group.US1.register.4=AT91C_US1_IDR +-group.US1.register.5=AT91C_US1_IER +-group.US1.register.6=AT91C_US1_THR +-group.US1.register.7=AT91C_US1_TTGR +-group.US1.register.8=AT91C_US1_RHR +-group.US1.register.9=AT91C_US1_BRGR +-group.US1.register.10=AT91C_US1_IMR +-group.US1.register.11=AT91C_US1_FIDI +-group.US1.register.12=AT91C_US1_CR +-group.US1.register.13=AT91C_US1_MR +-# ========== Group definition for PDC_US0 peripheral ========== +-group.PDC_US0.description="ATMEL PDC_US0 Registers" +-group.PDC_US0.helpkey="ATMEL PDC_US0 Registers" +-group.PDC_US0.register.0=AT91C_US0_TNPR +-group.PDC_US0.register.1=AT91C_US0_RNPR +-group.PDC_US0.register.2=AT91C_US0_TCR +-group.PDC_US0.register.3=AT91C_US0_PTCR +-group.PDC_US0.register.4=AT91C_US0_PTSR +-group.PDC_US0.register.5=AT91C_US0_TNCR +-group.PDC_US0.register.6=AT91C_US0_TPR +-group.PDC_US0.register.7=AT91C_US0_RCR +-group.PDC_US0.register.8=AT91C_US0_RPR +-group.PDC_US0.register.9=AT91C_US0_RNCR +-# ========== Group definition for US0 peripheral ========== +-group.US0.description="ATMEL US0 Registers" +-group.US0.helpkey="ATMEL US0 Registers" +-group.US0.register.0=AT91C_US0_BRGR +-group.US0.register.1=AT91C_US0_NER +-group.US0.register.2=AT91C_US0_CR +-group.US0.register.3=AT91C_US0_IMR +-group.US0.register.4=AT91C_US0_FIDI +-group.US0.register.5=AT91C_US0_TTGR +-group.US0.register.6=AT91C_US0_MR +-group.US0.register.7=AT91C_US0_RTOR +-group.US0.register.8=AT91C_US0_CSR +-group.US0.register.9=AT91C_US0_RHR +-group.US0.register.10=AT91C_US0_IDR +-group.US0.register.11=AT91C_US0_THR +-group.US0.register.12=AT91C_US0_IF +-group.US0.register.13=AT91C_US0_IER +-# ========== Group definition for PDC_SSC peripheral ========== +-group.PDC_SSC.description="ATMEL PDC_SSC Registers" +-group.PDC_SSC.helpkey="ATMEL PDC_SSC Registers" +-group.PDC_SSC.register.0=AT91C_SSC_TNCR +-group.PDC_SSC.register.1=AT91C_SSC_RPR +-group.PDC_SSC.register.2=AT91C_SSC_RNCR +-group.PDC_SSC.register.3=AT91C_SSC_TPR +-group.PDC_SSC.register.4=AT91C_SSC_PTCR +-group.PDC_SSC.register.5=AT91C_SSC_TCR +-group.PDC_SSC.register.6=AT91C_SSC_RCR +-group.PDC_SSC.register.7=AT91C_SSC_RNPR +-group.PDC_SSC.register.8=AT91C_SSC_TNPR +-group.PDC_SSC.register.9=AT91C_SSC_PTSR +-# ========== Group definition for SSC peripheral ========== +-group.SSC.description="ATMEL SSC Registers" +-group.SSC.helpkey="ATMEL SSC Registers" +-group.SSC.register.0=AT91C_SSC_RHR +-group.SSC.register.1=AT91C_SSC_RSHR +-group.SSC.register.2=AT91C_SSC_TFMR +-group.SSC.register.3=AT91C_SSC_IDR +-group.SSC.register.4=AT91C_SSC_THR +-group.SSC.register.5=AT91C_SSC_RCMR +-group.SSC.register.6=AT91C_SSC_IER +-group.SSC.register.7=AT91C_SSC_TSHR +-group.SSC.register.8=AT91C_SSC_SR +-group.SSC.register.9=AT91C_SSC_CMR +-group.SSC.register.10=AT91C_SSC_TCMR +-group.SSC.register.11=AT91C_SSC_CR +-group.SSC.register.12=AT91C_SSC_IMR +-group.SSC.register.13=AT91C_SSC_RFMR +-# ========== Group definition for TWI peripheral ========== +-group.TWI.description="ATMEL TWI Registers" +-group.TWI.helpkey="ATMEL TWI Registers" +-group.TWI.register.0=AT91C_TWI_IER +-group.TWI.register.1=AT91C_TWI_CR +-group.TWI.register.2=AT91C_TWI_SR +-group.TWI.register.3=AT91C_TWI_IMR +-group.TWI.register.4=AT91C_TWI_THR +-group.TWI.register.5=AT91C_TWI_IDR +-group.TWI.register.6=AT91C_TWI_IADR +-group.TWI.register.7=AT91C_TWI_MMR +-group.TWI.register.8=AT91C_TWI_CWGR +-group.TWI.register.9=AT91C_TWI_RHR +-# ========== Group definition for PWMC_CH3 peripheral ========== +-group.PWMC_CH3.description="ATMEL PWMC_CH3 Registers" +-group.PWMC_CH3.helpkey="ATMEL PWMC_CH3 Registers" +-group.PWMC_CH3.register.0=AT91C_PWMC_CH3_CUPDR +-group.PWMC_CH3.register.1=AT91C_PWMC_CH3_Reserved +-group.PWMC_CH3.register.2=AT91C_PWMC_CH3_CPRDR +-group.PWMC_CH3.register.3=AT91C_PWMC_CH3_CDTYR +-group.PWMC_CH3.register.4=AT91C_PWMC_CH3_CCNTR +-group.PWMC_CH3.register.5=AT91C_PWMC_CH3_CMR +-# ========== Group definition for PWMC_CH2 peripheral ========== +-group.PWMC_CH2.description="ATMEL PWMC_CH2 Registers" +-group.PWMC_CH2.helpkey="ATMEL PWMC_CH2 Registers" +-group.PWMC_CH2.register.0=AT91C_PWMC_CH2_Reserved +-group.PWMC_CH2.register.1=AT91C_PWMC_CH2_CMR +-group.PWMC_CH2.register.2=AT91C_PWMC_CH2_CCNTR +-group.PWMC_CH2.register.3=AT91C_PWMC_CH2_CPRDR +-group.PWMC_CH2.register.4=AT91C_PWMC_CH2_CUPDR +-group.PWMC_CH2.register.5=AT91C_PWMC_CH2_CDTYR +-# ========== Group definition for PWMC_CH1 peripheral ========== +-group.PWMC_CH1.description="ATMEL PWMC_CH1 Registers" +-group.PWMC_CH1.helpkey="ATMEL PWMC_CH1 Registers" +-group.PWMC_CH1.register.0=AT91C_PWMC_CH1_Reserved +-group.PWMC_CH1.register.1=AT91C_PWMC_CH1_CUPDR +-group.PWMC_CH1.register.2=AT91C_PWMC_CH1_CPRDR +-group.PWMC_CH1.register.3=AT91C_PWMC_CH1_CCNTR +-group.PWMC_CH1.register.4=AT91C_PWMC_CH1_CDTYR +-group.PWMC_CH1.register.5=AT91C_PWMC_CH1_CMR +-# ========== Group definition for PWMC_CH0 peripheral ========== +-group.PWMC_CH0.description="ATMEL PWMC_CH0 Registers" +-group.PWMC_CH0.helpkey="ATMEL PWMC_CH0 Registers" +-group.PWMC_CH0.register.0=AT91C_PWMC_CH0_Reserved +-group.PWMC_CH0.register.1=AT91C_PWMC_CH0_CPRDR +-group.PWMC_CH0.register.2=AT91C_PWMC_CH0_CDTYR +-group.PWMC_CH0.register.3=AT91C_PWMC_CH0_CMR +-group.PWMC_CH0.register.4=AT91C_PWMC_CH0_CUPDR +-group.PWMC_CH0.register.5=AT91C_PWMC_CH0_CCNTR +-# ========== Group definition for PWMC peripheral ========== +-group.PWMC.description="ATMEL PWMC Registers" +-group.PWMC.helpkey="ATMEL PWMC Registers" +-group.PWMC.register.0=AT91C_PWMC_IDR +-group.PWMC.register.1=AT91C_PWMC_DIS +-group.PWMC.register.2=AT91C_PWMC_IER +-group.PWMC.register.3=AT91C_PWMC_VR +-group.PWMC.register.4=AT91C_PWMC_ISR +-group.PWMC.register.5=AT91C_PWMC_SR +-group.PWMC.register.6=AT91C_PWMC_IMR +-group.PWMC.register.7=AT91C_PWMC_MR +-group.PWMC.register.8=AT91C_PWMC_ENA +-# ========== Group definition for UDP peripheral ========== +-group.UDP.description="ATMEL UDP Registers" +-group.UDP.helpkey="ATMEL UDP Registers" +-group.UDP.register.0=AT91C_UDP_IMR +-group.UDP.register.1=AT91C_UDP_FADDR +-group.UDP.register.2=AT91C_UDP_NUM +-group.UDP.register.3=AT91C_UDP_FDR +-group.UDP.register.4=AT91C_UDP_ISR +-group.UDP.register.5=AT91C_UDP_CSR +-group.UDP.register.6=AT91C_UDP_IDR +-group.UDP.register.7=AT91C_UDP_ICR +-group.UDP.register.8=AT91C_UDP_RSTEP +-group.UDP.register.9=AT91C_UDP_TXVC +-group.UDP.register.10=AT91C_UDP_GLBSTATE +-group.UDP.register.11=AT91C_UDP_IER +-# ========== Group definition for TC0 peripheral ========== +-group.TC0.description="ATMEL TC0 Registers" +-group.TC0.helpkey="ATMEL TC0 Registers" +-group.TC0.register.0=AT91C_TC0_SR +-group.TC0.register.1=AT91C_TC0_RC +-group.TC0.register.2=AT91C_TC0_RB +-group.TC0.register.3=AT91C_TC0_CCR +-group.TC0.register.4=AT91C_TC0_CMR +-group.TC0.register.5=AT91C_TC0_IER +-group.TC0.register.6=AT91C_TC0_RA +-group.TC0.register.7=AT91C_TC0_IDR +-group.TC0.register.8=AT91C_TC0_CV +-group.TC0.register.9=AT91C_TC0_IMR +-# ========== Group definition for TC1 peripheral ========== +-group.TC1.description="ATMEL TC1 Registers" +-group.TC1.helpkey="ATMEL TC1 Registers" +-group.TC1.register.0=AT91C_TC1_RB +-group.TC1.register.1=AT91C_TC1_CCR +-group.TC1.register.2=AT91C_TC1_IER +-group.TC1.register.3=AT91C_TC1_IDR +-group.TC1.register.4=AT91C_TC1_SR +-group.TC1.register.5=AT91C_TC1_CMR +-group.TC1.register.6=AT91C_TC1_RA +-group.TC1.register.7=AT91C_TC1_RC +-group.TC1.register.8=AT91C_TC1_IMR +-group.TC1.register.9=AT91C_TC1_CV +-# ========== Group definition for TC2 peripheral ========== +-group.TC2.description="ATMEL TC2 Registers" +-group.TC2.helpkey="ATMEL TC2 Registers" +-group.TC2.register.0=AT91C_TC2_CMR +-group.TC2.register.1=AT91C_TC2_CCR +-group.TC2.register.2=AT91C_TC2_CV +-group.TC2.register.3=AT91C_TC2_RA +-group.TC2.register.4=AT91C_TC2_RB +-group.TC2.register.5=AT91C_TC2_IDR +-group.TC2.register.6=AT91C_TC2_IMR +-group.TC2.register.7=AT91C_TC2_RC +-group.TC2.register.8=AT91C_TC2_IER +-group.TC2.register.9=AT91C_TC2_SR +-# ========== Group definition for TCB peripheral ========== +-group.TCB.description="ATMEL TCB Registers" +-group.TCB.helpkey="ATMEL TCB Registers" +-group.TCB.register.0=AT91C_TCB_BMR +-group.TCB.register.1=AT91C_TCB_BCR +-# ========== Group definition for CAN_MB0 peripheral ========== +-group.CAN_MB0.description="ATMEL CAN_MB0 Registers" +-group.CAN_MB0.helpkey="ATMEL CAN_MB0 Registers" +-group.CAN_MB0.register.0=AT91C_CAN_MB0_MDL +-group.CAN_MB0.register.1=AT91C_CAN_MB0_MAM +-group.CAN_MB0.register.2=AT91C_CAN_MB0_MCR +-group.CAN_MB0.register.3=AT91C_CAN_MB0_MID +-group.CAN_MB0.register.4=AT91C_CAN_MB0_MSR +-group.CAN_MB0.register.5=AT91C_CAN_MB0_MFID +-group.CAN_MB0.register.6=AT91C_CAN_MB0_MDH +-group.CAN_MB0.register.7=AT91C_CAN_MB0_MMR +-# ========== Group definition for CAN_MB1 peripheral ========== +-group.CAN_MB1.description="ATMEL CAN_MB1 Registers" +-group.CAN_MB1.helpkey="ATMEL CAN_MB1 Registers" +-group.CAN_MB1.register.0=AT91C_CAN_MB1_MDL +-group.CAN_MB1.register.1=AT91C_CAN_MB1_MID +-group.CAN_MB1.register.2=AT91C_CAN_MB1_MMR +-group.CAN_MB1.register.3=AT91C_CAN_MB1_MSR +-group.CAN_MB1.register.4=AT91C_CAN_MB1_MAM +-group.CAN_MB1.register.5=AT91C_CAN_MB1_MDH +-group.CAN_MB1.register.6=AT91C_CAN_MB1_MCR +-group.CAN_MB1.register.7=AT91C_CAN_MB1_MFID +-# ========== Group definition for CAN_MB2 peripheral ========== +-group.CAN_MB2.description="ATMEL CAN_MB2 Registers" +-group.CAN_MB2.helpkey="ATMEL CAN_MB2 Registers" +-group.CAN_MB2.register.0=AT91C_CAN_MB2_MCR +-group.CAN_MB2.register.1=AT91C_CAN_MB2_MDH +-group.CAN_MB2.register.2=AT91C_CAN_MB2_MID +-group.CAN_MB2.register.3=AT91C_CAN_MB2_MDL +-group.CAN_MB2.register.4=AT91C_CAN_MB2_MMR +-group.CAN_MB2.register.5=AT91C_CAN_MB2_MAM +-group.CAN_MB2.register.6=AT91C_CAN_MB2_MFID +-group.CAN_MB2.register.7=AT91C_CAN_MB2_MSR +-# ========== Group definition for CAN_MB3 peripheral ========== +-group.CAN_MB3.description="ATMEL CAN_MB3 Registers" +-group.CAN_MB3.helpkey="ATMEL CAN_MB3 Registers" +-group.CAN_MB3.register.0=AT91C_CAN_MB3_MFID +-group.CAN_MB3.register.1=AT91C_CAN_MB3_MAM +-group.CAN_MB3.register.2=AT91C_CAN_MB3_MID +-group.CAN_MB3.register.3=AT91C_CAN_MB3_MCR +-group.CAN_MB3.register.4=AT91C_CAN_MB3_MMR +-group.CAN_MB3.register.5=AT91C_CAN_MB3_MSR +-group.CAN_MB3.register.6=AT91C_CAN_MB3_MDL +-group.CAN_MB3.register.7=AT91C_CAN_MB3_MDH +-# ========== Group definition for CAN_MB4 peripheral ========== +-group.CAN_MB4.description="ATMEL CAN_MB4 Registers" +-group.CAN_MB4.helpkey="ATMEL CAN_MB4 Registers" +-group.CAN_MB4.register.0=AT91C_CAN_MB4_MID +-group.CAN_MB4.register.1=AT91C_CAN_MB4_MMR +-group.CAN_MB4.register.2=AT91C_CAN_MB4_MDH +-group.CAN_MB4.register.3=AT91C_CAN_MB4_MFID +-group.CAN_MB4.register.4=AT91C_CAN_MB4_MSR +-group.CAN_MB4.register.5=AT91C_CAN_MB4_MCR +-group.CAN_MB4.register.6=AT91C_CAN_MB4_MDL +-group.CAN_MB4.register.7=AT91C_CAN_MB4_MAM +-# ========== Group definition for CAN_MB5 peripheral ========== +-group.CAN_MB5.description="ATMEL CAN_MB5 Registers" +-group.CAN_MB5.helpkey="ATMEL CAN_MB5 Registers" +-group.CAN_MB5.register.0=AT91C_CAN_MB5_MSR +-group.CAN_MB5.register.1=AT91C_CAN_MB5_MCR +-group.CAN_MB5.register.2=AT91C_CAN_MB5_MFID +-group.CAN_MB5.register.3=AT91C_CAN_MB5_MDH +-group.CAN_MB5.register.4=AT91C_CAN_MB5_MID +-group.CAN_MB5.register.5=AT91C_CAN_MB5_MMR +-group.CAN_MB5.register.6=AT91C_CAN_MB5_MDL +-group.CAN_MB5.register.7=AT91C_CAN_MB5_MAM +-# ========== Group definition for CAN_MB6 peripheral ========== +-group.CAN_MB6.description="ATMEL CAN_MB6 Registers" +-group.CAN_MB6.helpkey="ATMEL CAN_MB6 Registers" +-group.CAN_MB6.register.0=AT91C_CAN_MB6_MFID +-group.CAN_MB6.register.1=AT91C_CAN_MB6_MID +-group.CAN_MB6.register.2=AT91C_CAN_MB6_MAM +-group.CAN_MB6.register.3=AT91C_CAN_MB6_MSR +-group.CAN_MB6.register.4=AT91C_CAN_MB6_MDL +-group.CAN_MB6.register.5=AT91C_CAN_MB6_MCR +-group.CAN_MB6.register.6=AT91C_CAN_MB6_MDH +-group.CAN_MB6.register.7=AT91C_CAN_MB6_MMR +-# ========== Group definition for CAN_MB7 peripheral ========== +-group.CAN_MB7.description="ATMEL CAN_MB7 Registers" +-group.CAN_MB7.helpkey="ATMEL CAN_MB7 Registers" +-group.CAN_MB7.register.0=AT91C_CAN_MB7_MCR +-group.CAN_MB7.register.1=AT91C_CAN_MB7_MDH +-group.CAN_MB7.register.2=AT91C_CAN_MB7_MFID +-group.CAN_MB7.register.3=AT91C_CAN_MB7_MDL +-group.CAN_MB7.register.4=AT91C_CAN_MB7_MID +-group.CAN_MB7.register.5=AT91C_CAN_MB7_MMR +-group.CAN_MB7.register.6=AT91C_CAN_MB7_MAM +-group.CAN_MB7.register.7=AT91C_CAN_MB7_MSR +-# ========== Group definition for CAN peripheral ========== +-group.CAN.description="ATMEL CAN Registers" +-group.CAN.helpkey="ATMEL CAN Registers" +-group.CAN.register.0=AT91C_CAN_TCR +-group.CAN.register.1=AT91C_CAN_IMR +-group.CAN.register.2=AT91C_CAN_IER +-group.CAN.register.3=AT91C_CAN_ECR +-group.CAN.register.4=AT91C_CAN_TIMESTP +-group.CAN.register.5=AT91C_CAN_MR +-group.CAN.register.6=AT91C_CAN_IDR +-group.CAN.register.7=AT91C_CAN_ACR +-group.CAN.register.8=AT91C_CAN_TIM +-group.CAN.register.9=AT91C_CAN_SR +-group.CAN.register.10=AT91C_CAN_BR +-group.CAN.register.11=AT91C_CAN_VR +-# ========== Group definition for EMAC peripheral ========== +-group.EMAC.description="ATMEL EMAC Registers" +-group.EMAC.helpkey="ATMEL EMAC Registers" +-group.EMAC.register.0=AT91C_EMAC_ISR +-group.EMAC.register.1=AT91C_EMAC_SA4H +-group.EMAC.register.2=AT91C_EMAC_SA1L +-group.EMAC.register.3=AT91C_EMAC_ELE +-group.EMAC.register.4=AT91C_EMAC_LCOL +-group.EMAC.register.5=AT91C_EMAC_RLE +-group.EMAC.register.6=AT91C_EMAC_WOL +-group.EMAC.register.7=AT91C_EMAC_DTF +-group.EMAC.register.8=AT91C_EMAC_TUND +-group.EMAC.register.9=AT91C_EMAC_NCR +-group.EMAC.register.10=AT91C_EMAC_SA4L +-group.EMAC.register.11=AT91C_EMAC_RSR +-group.EMAC.register.12=AT91C_EMAC_SA3L +-group.EMAC.register.13=AT91C_EMAC_TSR +-group.EMAC.register.14=AT91C_EMAC_IDR +-group.EMAC.register.15=AT91C_EMAC_RSE +-group.EMAC.register.16=AT91C_EMAC_ECOL +-group.EMAC.register.17=AT91C_EMAC_TID +-group.EMAC.register.18=AT91C_EMAC_HRB +-group.EMAC.register.19=AT91C_EMAC_TBQP +-group.EMAC.register.20=AT91C_EMAC_USRIO +-group.EMAC.register.21=AT91C_EMAC_PTR +-group.EMAC.register.22=AT91C_EMAC_SA2H +-group.EMAC.register.23=AT91C_EMAC_ROV +-group.EMAC.register.24=AT91C_EMAC_ALE +-group.EMAC.register.25=AT91C_EMAC_RJA +-group.EMAC.register.26=AT91C_EMAC_RBQP +-group.EMAC.register.27=AT91C_EMAC_TPF +-group.EMAC.register.28=AT91C_EMAC_NCFGR +-group.EMAC.register.29=AT91C_EMAC_HRT +-group.EMAC.register.30=AT91C_EMAC_USF +-group.EMAC.register.31=AT91C_EMAC_FCSE +-group.EMAC.register.32=AT91C_EMAC_TPQ +-group.EMAC.register.33=AT91C_EMAC_MAN +-group.EMAC.register.34=AT91C_EMAC_FTO +-group.EMAC.register.35=AT91C_EMAC_REV +-group.EMAC.register.36=AT91C_EMAC_IMR +-group.EMAC.register.37=AT91C_EMAC_SCF +-group.EMAC.register.38=AT91C_EMAC_PFR +-group.EMAC.register.39=AT91C_EMAC_MCF +-group.EMAC.register.40=AT91C_EMAC_NSR +-group.EMAC.register.41=AT91C_EMAC_SA2L +-group.EMAC.register.42=AT91C_EMAC_FRO +-group.EMAC.register.43=AT91C_EMAC_IER +-group.EMAC.register.44=AT91C_EMAC_SA1H +-group.EMAC.register.45=AT91C_EMAC_CSE +-group.EMAC.register.46=AT91C_EMAC_SA3H +-group.EMAC.register.47=AT91C_EMAC_RRE +-group.EMAC.register.48=AT91C_EMAC_STE +-# ========== Group definition for PDC_ADC peripheral ========== +-group.PDC_ADC.description="ATMEL PDC_ADC Registers" +-group.PDC_ADC.helpkey="ATMEL PDC_ADC Registers" +-group.PDC_ADC.register.0=AT91C_ADC_PTSR +-group.PDC_ADC.register.1=AT91C_ADC_PTCR +-group.PDC_ADC.register.2=AT91C_ADC_TNPR +-group.PDC_ADC.register.3=AT91C_ADC_TNCR +-group.PDC_ADC.register.4=AT91C_ADC_RNPR +-group.PDC_ADC.register.5=AT91C_ADC_RNCR +-group.PDC_ADC.register.6=AT91C_ADC_RPR +-group.PDC_ADC.register.7=AT91C_ADC_TCR +-group.PDC_ADC.register.8=AT91C_ADC_TPR +-group.PDC_ADC.register.9=AT91C_ADC_RCR +-# ========== Group definition for ADC peripheral ========== +-group.ADC.description="ATMEL ADC Registers" +-group.ADC.helpkey="ATMEL ADC Registers" +-group.ADC.register.0=AT91C_ADC_CDR2 +-group.ADC.register.1=AT91C_ADC_CDR3 +-group.ADC.register.2=AT91C_ADC_CDR0 +-group.ADC.register.3=AT91C_ADC_CDR5 +-group.ADC.register.4=AT91C_ADC_CHDR +-group.ADC.register.5=AT91C_ADC_SR +-group.ADC.register.6=AT91C_ADC_CDR4 +-group.ADC.register.7=AT91C_ADC_CDR1 +-group.ADC.register.8=AT91C_ADC_LCDR +-group.ADC.register.9=AT91C_ADC_IDR +-group.ADC.register.10=AT91C_ADC_CR +-group.ADC.register.11=AT91C_ADC_CDR7 +-group.ADC.register.12=AT91C_ADC_CDR6 +-group.ADC.register.13=AT91C_ADC_IER +-group.ADC.register.14=AT91C_ADC_CHER +-group.ADC.register.15=AT91C_ADC_CHSR +-group.ADC.register.16=AT91C_ADC_MR +-group.ADC.register.17=AT91C_ADC_IMR +-group.AT91SAM7X256.description="ATMEL AT91SAM7X256 Registers" +-group.AT91SAM7X256.helpkey="ATMEL AT91SAM7X256 Registers" +-group.AT91SAM7X256.topLevelIndex=100 +-group.AT91SAM7X256.group.0=SYS +-group.AT91SAM7X256.group.1=AIC +-group.AT91SAM7X256.group.2=PDC_DBGU +-group.AT91SAM7X256.group.3=DBGU +-group.AT91SAM7X256.group.4=PIOA +-group.AT91SAM7X256.group.5=PIOB +-group.AT91SAM7X256.group.6=CKGR +-group.AT91SAM7X256.group.7=PMC +-group.AT91SAM7X256.group.8=RSTC +-group.AT91SAM7X256.group.9=RTTC +-group.AT91SAM7X256.group.10=PITC +-group.AT91SAM7X256.group.11=WDTC +-group.AT91SAM7X256.group.12=VREG +-group.AT91SAM7X256.group.13=MC +-group.AT91SAM7X256.group.14=PDC_SPI1 +-group.AT91SAM7X256.group.15=SPI1 +-group.AT91SAM7X256.group.16=PDC_SPI0 +-group.AT91SAM7X256.group.17=SPI0 +-group.AT91SAM7X256.group.18=PDC_US1 +-group.AT91SAM7X256.group.19=US1 +-group.AT91SAM7X256.group.20=PDC_US0 +-group.AT91SAM7X256.group.21=US0 +-group.AT91SAM7X256.group.22=PDC_SSC +-group.AT91SAM7X256.group.23=SSC +-group.AT91SAM7X256.group.24=TWI +-group.AT91SAM7X256.group.25=PWMC_CH3 +-group.AT91SAM7X256.group.26=PWMC_CH2 +-group.AT91SAM7X256.group.27=PWMC_CH1 +-group.AT91SAM7X256.group.28=PWMC_CH0 +-group.AT91SAM7X256.group.29=PWMC +-group.AT91SAM7X256.group.30=UDP +-group.AT91SAM7X256.group.31=TC0 +-group.AT91SAM7X256.group.32=TC1 +-group.AT91SAM7X256.group.33=TC2 +-group.AT91SAM7X256.group.34=TCB +-group.AT91SAM7X256.group.35=CAN_MB0 +-group.AT91SAM7X256.group.36=CAN_MB1 +-group.AT91SAM7X256.group.37=CAN_MB2 +-group.AT91SAM7X256.group.38=CAN_MB3 +-group.AT91SAM7X256.group.39=CAN_MB4 +-group.AT91SAM7X256.group.40=CAN_MB5 +-group.AT91SAM7X256.group.41=CAN_MB6 +-group.AT91SAM7X256.group.42=CAN_MB7 +-group.AT91SAM7X256.group.43=CAN +-group.AT91SAM7X256.group.44=EMAC +-group.AT91SAM7X256.group.45=PDC_ADC +-group.AT91SAM7X256.group.46=ADC +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.tcl b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.tcl +deleted file mode 100644 +index 5d3a662231..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.tcl ++++ /dev/null +@@ -1,3407 +0,0 @@ +-# ---------------------------------------------------------------------------- +-# ATMEL Microcontroller Software Support - ROUSSET - +-# ---------------------------------------------------------------------------- +-# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-# DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.tcl +-# Object : AT91SAM7X256 definitions +-# Generated : AT91 SW Application Group 11/02/2005 (15:17:30) +-# +-# CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// +-# CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// +-# CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// +-# CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// +-# CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// +-# CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// +-# CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// +-# CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// +-# CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// +-# CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// +-# CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// +-# CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// +-# CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// +-# CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// +-# CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// +-# CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// +-# CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// +-# CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// +-# CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// +-# CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// +-# CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// +-# CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// +-# CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// +-# ---------------------------------------------------------------------------- +- +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR System Peripherals +-# ***************************************************************************** +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Advanced Interrupt Controller +-# ***************************************************************************** +-# -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- +-set AT91C_AIC_PRIOR [expr 0x7 << 0 ] +-set AT91C_AIC_PRIOR_LOWEST 0x0 +-set AT91C_AIC_PRIOR_HIGHEST 0x7 +-set AT91C_AIC_SRCTYPE [expr 0x3 << 5 ] +-set AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL [expr 0x0 << 5 ] +-set AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL [expr 0x0 << 5 ] +-set AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE [expr 0x1 << 5 ] +-set AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE [expr 0x1 << 5 ] +-set AT91C_AIC_SRCTYPE_HIGH_LEVEL [expr 0x2 << 5 ] +-set AT91C_AIC_SRCTYPE_POSITIVE_EDGE [expr 0x3 << 5 ] +-# -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- +-set AT91C_AIC_NFIQ [expr 0x1 << 0 ] +-set AT91C_AIC_NIRQ [expr 0x1 << 1 ] +-# -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- +-set AT91C_AIC_DCR_PROT [expr 0x1 << 0 ] +-set AT91C_AIC_DCR_GMSK [expr 0x1 << 1 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Peripheral DMA Controller +-# ***************************************************************************** +-# -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- +-set AT91C_PDC_RXTEN [expr 0x1 << 0 ] +-set AT91C_PDC_RXTDIS [expr 0x1 << 1 ] +-set AT91C_PDC_TXTEN [expr 0x1 << 8 ] +-set AT91C_PDC_TXTDIS [expr 0x1 << 9 ] +-# -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- +-set AT91C_PDC_RXTEN [expr 0x1 << 0 ] +-set AT91C_PDC_TXTEN [expr 0x1 << 8 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Debug Unit +-# ***************************************************************************** +-# -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- +-set AT91C_US_RSTRX [expr 0x1 << 2 ] +-set AT91C_US_RSTTX [expr 0x1 << 3 ] +-set AT91C_US_RXEN [expr 0x1 << 4 ] +-set AT91C_US_RXDIS [expr 0x1 << 5 ] +-set AT91C_US_TXEN [expr 0x1 << 6 ] +-set AT91C_US_TXDIS [expr 0x1 << 7 ] +-set AT91C_US_RSTSTA [expr 0x1 << 8 ] +-# -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- +-set AT91C_US_PAR [expr 0x7 << 9 ] +-set AT91C_US_PAR_EVEN [expr 0x0 << 9 ] +-set AT91C_US_PAR_ODD [expr 0x1 << 9 ] +-set AT91C_US_PAR_SPACE [expr 0x2 << 9 ] +-set AT91C_US_PAR_MARK [expr 0x3 << 9 ] +-set AT91C_US_PAR_NONE [expr 0x4 << 9 ] +-set AT91C_US_PAR_MULTI_DROP [expr 0x6 << 9 ] +-set AT91C_US_CHMODE [expr 0x3 << 14 ] +-set AT91C_US_CHMODE_NORMAL [expr 0x0 << 14 ] +-set AT91C_US_CHMODE_AUTO [expr 0x1 << 14 ] +-set AT91C_US_CHMODE_LOCAL [expr 0x2 << 14 ] +-set AT91C_US_CHMODE_REMOTE [expr 0x3 << 14 ] +-# -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-set AT91C_US_RXRDY [expr 0x1 << 0 ] +-set AT91C_US_TXRDY [expr 0x1 << 1 ] +-set AT91C_US_ENDRX [expr 0x1 << 3 ] +-set AT91C_US_ENDTX [expr 0x1 << 4 ] +-set AT91C_US_OVRE [expr 0x1 << 5 ] +-set AT91C_US_FRAME [expr 0x1 << 6 ] +-set AT91C_US_PARE [expr 0x1 << 7 ] +-set AT91C_US_TXEMPTY [expr 0x1 << 9 ] +-set AT91C_US_TXBUFE [expr 0x1 << 11 ] +-set AT91C_US_RXBUFF [expr 0x1 << 12 ] +-set AT91C_US_COMM_TX [expr 0x1 << 30 ] +-set AT91C_US_COMM_RX [expr 0x1 << 31 ] +-# -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-set AT91C_US_RXRDY [expr 0x1 << 0 ] +-set AT91C_US_TXRDY [expr 0x1 << 1 ] +-set AT91C_US_ENDRX [expr 0x1 << 3 ] +-set AT91C_US_ENDTX [expr 0x1 << 4 ] +-set AT91C_US_OVRE [expr 0x1 << 5 ] +-set AT91C_US_FRAME [expr 0x1 << 6 ] +-set AT91C_US_PARE [expr 0x1 << 7 ] +-set AT91C_US_TXEMPTY [expr 0x1 << 9 ] +-set AT91C_US_TXBUFE [expr 0x1 << 11 ] +-set AT91C_US_RXBUFF [expr 0x1 << 12 ] +-set AT91C_US_COMM_TX [expr 0x1 << 30 ] +-set AT91C_US_COMM_RX [expr 0x1 << 31 ] +-# -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-set AT91C_US_RXRDY [expr 0x1 << 0 ] +-set AT91C_US_TXRDY [expr 0x1 << 1 ] +-set AT91C_US_ENDRX [expr 0x1 << 3 ] +-set AT91C_US_ENDTX [expr 0x1 << 4 ] +-set AT91C_US_OVRE [expr 0x1 << 5 ] +-set AT91C_US_FRAME [expr 0x1 << 6 ] +-set AT91C_US_PARE [expr 0x1 << 7 ] +-set AT91C_US_TXEMPTY [expr 0x1 << 9 ] +-set AT91C_US_TXBUFE [expr 0x1 << 11 ] +-set AT91C_US_RXBUFF [expr 0x1 << 12 ] +-set AT91C_US_COMM_TX [expr 0x1 << 30 ] +-set AT91C_US_COMM_RX [expr 0x1 << 31 ] +-# -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- +-set AT91C_US_RXRDY [expr 0x1 << 0 ] +-set AT91C_US_TXRDY [expr 0x1 << 1 ] +-set AT91C_US_ENDRX [expr 0x1 << 3 ] +-set AT91C_US_ENDTX [expr 0x1 << 4 ] +-set AT91C_US_OVRE [expr 0x1 << 5 ] +-set AT91C_US_FRAME [expr 0x1 << 6 ] +-set AT91C_US_PARE [expr 0x1 << 7 ] +-set AT91C_US_TXEMPTY [expr 0x1 << 9 ] +-set AT91C_US_TXBUFE [expr 0x1 << 11 ] +-set AT91C_US_RXBUFF [expr 0x1 << 12 ] +-set AT91C_US_COMM_TX [expr 0x1 << 30 ] +-set AT91C_US_COMM_RX [expr 0x1 << 31 ] +-# -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- +-set AT91C_US_FORCE_NTRST [expr 0x1 << 0 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Parallel Input Output Controler +-# ***************************************************************************** +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Clock Generator Controler +-# ***************************************************************************** +-# -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- +-set AT91C_CKGR_MOSCEN [expr 0x1 << 0 ] +-set AT91C_CKGR_OSCBYPASS [expr 0x1 << 1 ] +-set AT91C_CKGR_OSCOUNT [expr 0xFF << 8 ] +-# -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- +-set AT91C_CKGR_MAINF [expr 0xFFFF << 0 ] +-set AT91C_CKGR_MAINRDY [expr 0x1 << 16 ] +-# -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- +-set AT91C_CKGR_DIV [expr 0xFF << 0 ] +-set AT91C_CKGR_DIV_0 0x0 +-set AT91C_CKGR_DIV_BYPASS 0x1 +-set AT91C_CKGR_PLLCOUNT [expr 0x3F << 8 ] +-set AT91C_CKGR_OUT [expr 0x3 << 14 ] +-set AT91C_CKGR_OUT_0 [expr 0x0 << 14 ] +-set AT91C_CKGR_OUT_1 [expr 0x1 << 14 ] +-set AT91C_CKGR_OUT_2 [expr 0x2 << 14 ] +-set AT91C_CKGR_OUT_3 [expr 0x3 << 14 ] +-set AT91C_CKGR_MUL [expr 0x7FF << 16 ] +-set AT91C_CKGR_USBDIV [expr 0x3 << 28 ] +-set AT91C_CKGR_USBDIV_0 [expr 0x0 << 28 ] +-set AT91C_CKGR_USBDIV_1 [expr 0x1 << 28 ] +-set AT91C_CKGR_USBDIV_2 [expr 0x2 << 28 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Power Management Controler +-# ***************************************************************************** +-# -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- +-set AT91C_PMC_PCK [expr 0x1 << 0 ] +-set AT91C_PMC_UDP [expr 0x1 << 7 ] +-set AT91C_PMC_PCK0 [expr 0x1 << 8 ] +-set AT91C_PMC_PCK1 [expr 0x1 << 9 ] +-set AT91C_PMC_PCK2 [expr 0x1 << 10 ] +-set AT91C_PMC_PCK3 [expr 0x1 << 11 ] +-# -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- +-set AT91C_PMC_PCK [expr 0x1 << 0 ] +-set AT91C_PMC_UDP [expr 0x1 << 7 ] +-set AT91C_PMC_PCK0 [expr 0x1 << 8 ] +-set AT91C_PMC_PCK1 [expr 0x1 << 9 ] +-set AT91C_PMC_PCK2 [expr 0x1 << 10 ] +-set AT91C_PMC_PCK3 [expr 0x1 << 11 ] +-# -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- +-set AT91C_PMC_PCK [expr 0x1 << 0 ] +-set AT91C_PMC_UDP [expr 0x1 << 7 ] +-set AT91C_PMC_PCK0 [expr 0x1 << 8 ] +-set AT91C_PMC_PCK1 [expr 0x1 << 9 ] +-set AT91C_PMC_PCK2 [expr 0x1 << 10 ] +-set AT91C_PMC_PCK3 [expr 0x1 << 11 ] +-# -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- +-set AT91C_CKGR_MOSCEN [expr 0x1 << 0 ] +-set AT91C_CKGR_OSCBYPASS [expr 0x1 << 1 ] +-set AT91C_CKGR_OSCOUNT [expr 0xFF << 8 ] +-# -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- +-set AT91C_CKGR_MAINF [expr 0xFFFF << 0 ] +-set AT91C_CKGR_MAINRDY [expr 0x1 << 16 ] +-# -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- +-set AT91C_CKGR_DIV [expr 0xFF << 0 ] +-set AT91C_CKGR_DIV_0 0x0 +-set AT91C_CKGR_DIV_BYPASS 0x1 +-set AT91C_CKGR_PLLCOUNT [expr 0x3F << 8 ] +-set AT91C_CKGR_OUT [expr 0x3 << 14 ] +-set AT91C_CKGR_OUT_0 [expr 0x0 << 14 ] +-set AT91C_CKGR_OUT_1 [expr 0x1 << 14 ] +-set AT91C_CKGR_OUT_2 [expr 0x2 << 14 ] +-set AT91C_CKGR_OUT_3 [expr 0x3 << 14 ] +-set AT91C_CKGR_MUL [expr 0x7FF << 16 ] +-set AT91C_CKGR_USBDIV [expr 0x3 << 28 ] +-set AT91C_CKGR_USBDIV_0 [expr 0x0 << 28 ] +-set AT91C_CKGR_USBDIV_1 [expr 0x1 << 28 ] +-set AT91C_CKGR_USBDIV_2 [expr 0x2 << 28 ] +-# -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- +-set AT91C_PMC_CSS [expr 0x3 << 0 ] +-set AT91C_PMC_CSS_SLOW_CLK 0x0 +-set AT91C_PMC_CSS_MAIN_CLK 0x1 +-set AT91C_PMC_CSS_PLL_CLK 0x3 +-set AT91C_PMC_PRES [expr 0x7 << 2 ] +-set AT91C_PMC_PRES_CLK [expr 0x0 << 2 ] +-set AT91C_PMC_PRES_CLK_2 [expr 0x1 << 2 ] +-set AT91C_PMC_PRES_CLK_4 [expr 0x2 << 2 ] +-set AT91C_PMC_PRES_CLK_8 [expr 0x3 << 2 ] +-set AT91C_PMC_PRES_CLK_16 [expr 0x4 << 2 ] +-set AT91C_PMC_PRES_CLK_32 [expr 0x5 << 2 ] +-set AT91C_PMC_PRES_CLK_64 [expr 0x6 << 2 ] +-# -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- +-set AT91C_PMC_CSS [expr 0x3 << 0 ] +-set AT91C_PMC_CSS_SLOW_CLK 0x0 +-set AT91C_PMC_CSS_MAIN_CLK 0x1 +-set AT91C_PMC_CSS_PLL_CLK 0x3 +-set AT91C_PMC_PRES [expr 0x7 << 2 ] +-set AT91C_PMC_PRES_CLK [expr 0x0 << 2 ] +-set AT91C_PMC_PRES_CLK_2 [expr 0x1 << 2 ] +-set AT91C_PMC_PRES_CLK_4 [expr 0x2 << 2 ] +-set AT91C_PMC_PRES_CLK_8 [expr 0x3 << 2 ] +-set AT91C_PMC_PRES_CLK_16 [expr 0x4 << 2 ] +-set AT91C_PMC_PRES_CLK_32 [expr 0x5 << 2 ] +-set AT91C_PMC_PRES_CLK_64 [expr 0x6 << 2 ] +-# -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- +-set AT91C_PMC_MOSCS [expr 0x1 << 0 ] +-set AT91C_PMC_LOCK [expr 0x1 << 2 ] +-set AT91C_PMC_MCKRDY [expr 0x1 << 3 ] +-set AT91C_PMC_PCK0RDY [expr 0x1 << 8 ] +-set AT91C_PMC_PCK1RDY [expr 0x1 << 9 ] +-set AT91C_PMC_PCK2RDY [expr 0x1 << 10 ] +-set AT91C_PMC_PCK3RDY [expr 0x1 << 11 ] +-# -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- +-set AT91C_PMC_MOSCS [expr 0x1 << 0 ] +-set AT91C_PMC_LOCK [expr 0x1 << 2 ] +-set AT91C_PMC_MCKRDY [expr 0x1 << 3 ] +-set AT91C_PMC_PCK0RDY [expr 0x1 << 8 ] +-set AT91C_PMC_PCK1RDY [expr 0x1 << 9 ] +-set AT91C_PMC_PCK2RDY [expr 0x1 << 10 ] +-set AT91C_PMC_PCK3RDY [expr 0x1 << 11 ] +-# -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- +-set AT91C_PMC_MOSCS [expr 0x1 << 0 ] +-set AT91C_PMC_LOCK [expr 0x1 << 2 ] +-set AT91C_PMC_MCKRDY [expr 0x1 << 3 ] +-set AT91C_PMC_PCK0RDY [expr 0x1 << 8 ] +-set AT91C_PMC_PCK1RDY [expr 0x1 << 9 ] +-set AT91C_PMC_PCK2RDY [expr 0x1 << 10 ] +-set AT91C_PMC_PCK3RDY [expr 0x1 << 11 ] +-# -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- +-set AT91C_PMC_MOSCS [expr 0x1 << 0 ] +-set AT91C_PMC_LOCK [expr 0x1 << 2 ] +-set AT91C_PMC_MCKRDY [expr 0x1 << 3 ] +-set AT91C_PMC_PCK0RDY [expr 0x1 << 8 ] +-set AT91C_PMC_PCK1RDY [expr 0x1 << 9 ] +-set AT91C_PMC_PCK2RDY [expr 0x1 << 10 ] +-set AT91C_PMC_PCK3RDY [expr 0x1 << 11 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Reset Controller Interface +-# ***************************************************************************** +-# -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- +-set AT91C_RSTC_PROCRST [expr 0x1 << 0 ] +-set AT91C_RSTC_PERRST [expr 0x1 << 2 ] +-set AT91C_RSTC_EXTRST [expr 0x1 << 3 ] +-set AT91C_RSTC_KEY [expr 0xFF << 24 ] +-# -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- +-set AT91C_RSTC_URSTS [expr 0x1 << 0 ] +-set AT91C_RSTC_BODSTS [expr 0x1 << 1 ] +-set AT91C_RSTC_RSTTYP [expr 0x7 << 8 ] +-set AT91C_RSTC_RSTTYP_POWERUP [expr 0x0 << 8 ] +-set AT91C_RSTC_RSTTYP_WAKEUP [expr 0x1 << 8 ] +-set AT91C_RSTC_RSTTYP_WATCHDOG [expr 0x2 << 8 ] +-set AT91C_RSTC_RSTTYP_SOFTWARE [expr 0x3 << 8 ] +-set AT91C_RSTC_RSTTYP_USER [expr 0x4 << 8 ] +-set AT91C_RSTC_RSTTYP_BROWNOUT [expr 0x5 << 8 ] +-set AT91C_RSTC_NRSTL [expr 0x1 << 16 ] +-set AT91C_RSTC_SRCMP [expr 0x1 << 17 ] +-# -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- +-set AT91C_RSTC_URSTEN [expr 0x1 << 0 ] +-set AT91C_RSTC_URSTIEN [expr 0x1 << 4 ] +-set AT91C_RSTC_ERSTL [expr 0xF << 8 ] +-set AT91C_RSTC_BODIEN [expr 0x1 << 16 ] +-set AT91C_RSTC_KEY [expr 0xFF << 24 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface +-# ***************************************************************************** +-# -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- +-set AT91C_RTTC_RTPRES [expr 0xFFFF << 0 ] +-set AT91C_RTTC_ALMIEN [expr 0x1 << 16 ] +-set AT91C_RTTC_RTTINCIEN [expr 0x1 << 17 ] +-set AT91C_RTTC_RTTRST [expr 0x1 << 18 ] +-# -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- +-set AT91C_RTTC_ALMV [expr 0x0 << 0 ] +-# -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- +-set AT91C_RTTC_CRTV [expr 0x0 << 0 ] +-# -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- +-set AT91C_RTTC_ALMS [expr 0x1 << 0 ] +-set AT91C_RTTC_RTTINC [expr 0x1 << 1 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface +-# ***************************************************************************** +-# -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- +-set AT91C_PITC_PIV [expr 0xFFFFF << 0 ] +-set AT91C_PITC_PITEN [expr 0x1 << 24 ] +-set AT91C_PITC_PITIEN [expr 0x1 << 25 ] +-# -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- +-set AT91C_PITC_PITS [expr 0x1 << 0 ] +-# -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- +-set AT91C_PITC_CPIV [expr 0xFFFFF << 0 ] +-set AT91C_PITC_PICNT [expr 0xFFF << 20 ] +-# -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- +-set AT91C_PITC_CPIV [expr 0xFFFFF << 0 ] +-set AT91C_PITC_PICNT [expr 0xFFF << 20 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface +-# ***************************************************************************** +-# -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- +-set AT91C_WDTC_WDRSTT [expr 0x1 << 0 ] +-set AT91C_WDTC_KEY [expr 0xFF << 24 ] +-# -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- +-set AT91C_WDTC_WDV [expr 0xFFF << 0 ] +-set AT91C_WDTC_WDFIEN [expr 0x1 << 12 ] +-set AT91C_WDTC_WDRSTEN [expr 0x1 << 13 ] +-set AT91C_WDTC_WDRPROC [expr 0x1 << 14 ] +-set AT91C_WDTC_WDDIS [expr 0x1 << 15 ] +-set AT91C_WDTC_WDD [expr 0xFFF << 16 ] +-set AT91C_WDTC_WDDBGHLT [expr 0x1 << 28 ] +-set AT91C_WDTC_WDIDLEHLT [expr 0x1 << 29 ] +-# -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- +-set AT91C_WDTC_WDUNF [expr 0x1 << 0 ] +-set AT91C_WDTC_WDERR [expr 0x1 << 1 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface +-# ***************************************************************************** +-# -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- +-set AT91C_VREG_PSTDBY [expr 0x1 << 0 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Memory Controller Interface +-# ***************************************************************************** +-# -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- +-set AT91C_MC_RCB [expr 0x1 << 0 ] +-# -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- +-set AT91C_MC_UNDADD [expr 0x1 << 0 ] +-set AT91C_MC_MISADD [expr 0x1 << 1 ] +-set AT91C_MC_ABTSZ [expr 0x3 << 8 ] +-set AT91C_MC_ABTSZ_BYTE [expr 0x0 << 8 ] +-set AT91C_MC_ABTSZ_HWORD [expr 0x1 << 8 ] +-set AT91C_MC_ABTSZ_WORD [expr 0x2 << 8 ] +-set AT91C_MC_ABTTYP [expr 0x3 << 10 ] +-set AT91C_MC_ABTTYP_DATAR [expr 0x0 << 10 ] +-set AT91C_MC_ABTTYP_DATAW [expr 0x1 << 10 ] +-set AT91C_MC_ABTTYP_FETCH [expr 0x2 << 10 ] +-set AT91C_MC_MST0 [expr 0x1 << 16 ] +-set AT91C_MC_MST1 [expr 0x1 << 17 ] +-set AT91C_MC_SVMST0 [expr 0x1 << 24 ] +-set AT91C_MC_SVMST1 [expr 0x1 << 25 ] +-# -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- +-set AT91C_MC_FRDY [expr 0x1 << 0 ] +-set AT91C_MC_LOCKE [expr 0x1 << 2 ] +-set AT91C_MC_PROGE [expr 0x1 << 3 ] +-set AT91C_MC_NEBP [expr 0x1 << 7 ] +-set AT91C_MC_FWS [expr 0x3 << 8 ] +-set AT91C_MC_FWS_0FWS [expr 0x0 << 8 ] +-set AT91C_MC_FWS_1FWS [expr 0x1 << 8 ] +-set AT91C_MC_FWS_2FWS [expr 0x2 << 8 ] +-set AT91C_MC_FWS_3FWS [expr 0x3 << 8 ] +-set AT91C_MC_FMCN [expr 0xFF << 16 ] +-# -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- +-set AT91C_MC_FCMD [expr 0xF << 0 ] +-set AT91C_MC_FCMD_START_PROG 0x1 +-set AT91C_MC_FCMD_LOCK 0x2 +-set AT91C_MC_FCMD_PROG_AND_LOCK 0x3 +-set AT91C_MC_FCMD_UNLOCK 0x4 +-set AT91C_MC_FCMD_ERASE_ALL 0x8 +-set AT91C_MC_FCMD_SET_GP_NVM 0xB +-set AT91C_MC_FCMD_CLR_GP_NVM 0xD +-set AT91C_MC_FCMD_SET_SECURITY 0xF +-set AT91C_MC_PAGEN [expr 0x3FF << 8 ] +-set AT91C_MC_KEY [expr 0xFF << 24 ] +-# -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- +-set AT91C_MC_FRDY [expr 0x1 << 0 ] +-set AT91C_MC_LOCKE [expr 0x1 << 2 ] +-set AT91C_MC_PROGE [expr 0x1 << 3 ] +-set AT91C_MC_SECURITY [expr 0x1 << 4 ] +-set AT91C_MC_GPNVM0 [expr 0x1 << 8 ] +-set AT91C_MC_GPNVM1 [expr 0x1 << 9 ] +-set AT91C_MC_GPNVM2 [expr 0x1 << 10 ] +-set AT91C_MC_GPNVM3 [expr 0x1 << 11 ] +-set AT91C_MC_GPNVM4 [expr 0x1 << 12 ] +-set AT91C_MC_GPNVM5 [expr 0x1 << 13 ] +-set AT91C_MC_GPNVM6 [expr 0x1 << 14 ] +-set AT91C_MC_GPNVM7 [expr 0x1 << 15 ] +-set AT91C_MC_LOCKS0 [expr 0x1 << 16 ] +-set AT91C_MC_LOCKS1 [expr 0x1 << 17 ] +-set AT91C_MC_LOCKS2 [expr 0x1 << 18 ] +-set AT91C_MC_LOCKS3 [expr 0x1 << 19 ] +-set AT91C_MC_LOCKS4 [expr 0x1 << 20 ] +-set AT91C_MC_LOCKS5 [expr 0x1 << 21 ] +-set AT91C_MC_LOCKS6 [expr 0x1 << 22 ] +-set AT91C_MC_LOCKS7 [expr 0x1 << 23 ] +-set AT91C_MC_LOCKS8 [expr 0x1 << 24 ] +-set AT91C_MC_LOCKS9 [expr 0x1 << 25 ] +-set AT91C_MC_LOCKS10 [expr 0x1 << 26 ] +-set AT91C_MC_LOCKS11 [expr 0x1 << 27 ] +-set AT91C_MC_LOCKS12 [expr 0x1 << 28 ] +-set AT91C_MC_LOCKS13 [expr 0x1 << 29 ] +-set AT91C_MC_LOCKS14 [expr 0x1 << 30 ] +-set AT91C_MC_LOCKS15 [expr 0x1 << 31 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Serial Parallel Interface +-# ***************************************************************************** +-# -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- +-set AT91C_SPI_SPIEN [expr 0x1 << 0 ] +-set AT91C_SPI_SPIDIS [expr 0x1 << 1 ] +-set AT91C_SPI_SWRST [expr 0x1 << 7 ] +-set AT91C_SPI_LASTXFER [expr 0x1 << 24 ] +-# -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- +-set AT91C_SPI_MSTR [expr 0x1 << 0 ] +-set AT91C_SPI_PS [expr 0x1 << 1 ] +-set AT91C_SPI_PS_FIXED [expr 0x0 << 1 ] +-set AT91C_SPI_PS_VARIABLE [expr 0x1 << 1 ] +-set AT91C_SPI_PCSDEC [expr 0x1 << 2 ] +-set AT91C_SPI_FDIV [expr 0x1 << 3 ] +-set AT91C_SPI_MODFDIS [expr 0x1 << 4 ] +-set AT91C_SPI_LLB [expr 0x1 << 7 ] +-set AT91C_SPI_PCS [expr 0xF << 16 ] +-set AT91C_SPI_DLYBCS [expr 0xFF << 24 ] +-# -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- +-set AT91C_SPI_RD [expr 0xFFFF << 0 ] +-set AT91C_SPI_RPCS [expr 0xF << 16 ] +-# -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- +-set AT91C_SPI_TD [expr 0xFFFF << 0 ] +-set AT91C_SPI_TPCS [expr 0xF << 16 ] +-set AT91C_SPI_LASTXFER [expr 0x1 << 24 ] +-# -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- +-set AT91C_SPI_RDRF [expr 0x1 << 0 ] +-set AT91C_SPI_TDRE [expr 0x1 << 1 ] +-set AT91C_SPI_MODF [expr 0x1 << 2 ] +-set AT91C_SPI_OVRES [expr 0x1 << 3 ] +-set AT91C_SPI_ENDRX [expr 0x1 << 4 ] +-set AT91C_SPI_ENDTX [expr 0x1 << 5 ] +-set AT91C_SPI_RXBUFF [expr 0x1 << 6 ] +-set AT91C_SPI_TXBUFE [expr 0x1 << 7 ] +-set AT91C_SPI_NSSR [expr 0x1 << 8 ] +-set AT91C_SPI_TXEMPTY [expr 0x1 << 9 ] +-set AT91C_SPI_SPIENS [expr 0x1 << 16 ] +-# -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- +-set AT91C_SPI_RDRF [expr 0x1 << 0 ] +-set AT91C_SPI_TDRE [expr 0x1 << 1 ] +-set AT91C_SPI_MODF [expr 0x1 << 2 ] +-set AT91C_SPI_OVRES [expr 0x1 << 3 ] +-set AT91C_SPI_ENDRX [expr 0x1 << 4 ] +-set AT91C_SPI_ENDTX [expr 0x1 << 5 ] +-set AT91C_SPI_RXBUFF [expr 0x1 << 6 ] +-set AT91C_SPI_TXBUFE [expr 0x1 << 7 ] +-set AT91C_SPI_NSSR [expr 0x1 << 8 ] +-set AT91C_SPI_TXEMPTY [expr 0x1 << 9 ] +-# -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- +-set AT91C_SPI_RDRF [expr 0x1 << 0 ] +-set AT91C_SPI_TDRE [expr 0x1 << 1 ] +-set AT91C_SPI_MODF [expr 0x1 << 2 ] +-set AT91C_SPI_OVRES [expr 0x1 << 3 ] +-set AT91C_SPI_ENDRX [expr 0x1 << 4 ] +-set AT91C_SPI_ENDTX [expr 0x1 << 5 ] +-set AT91C_SPI_RXBUFF [expr 0x1 << 6 ] +-set AT91C_SPI_TXBUFE [expr 0x1 << 7 ] +-set AT91C_SPI_NSSR [expr 0x1 << 8 ] +-set AT91C_SPI_TXEMPTY [expr 0x1 << 9 ] +-# -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- +-set AT91C_SPI_RDRF [expr 0x1 << 0 ] +-set AT91C_SPI_TDRE [expr 0x1 << 1 ] +-set AT91C_SPI_MODF [expr 0x1 << 2 ] +-set AT91C_SPI_OVRES [expr 0x1 << 3 ] +-set AT91C_SPI_ENDRX [expr 0x1 << 4 ] +-set AT91C_SPI_ENDTX [expr 0x1 << 5 ] +-set AT91C_SPI_RXBUFF [expr 0x1 << 6 ] +-set AT91C_SPI_TXBUFE [expr 0x1 << 7 ] +-set AT91C_SPI_NSSR [expr 0x1 << 8 ] +-set AT91C_SPI_TXEMPTY [expr 0x1 << 9 ] +-# -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- +-set AT91C_SPI_CPOL [expr 0x1 << 0 ] +-set AT91C_SPI_NCPHA [expr 0x1 << 1 ] +-set AT91C_SPI_CSAAT [expr 0x1 << 3 ] +-set AT91C_SPI_BITS [expr 0xF << 4 ] +-set AT91C_SPI_BITS_8 [expr 0x0 << 4 ] +-set AT91C_SPI_BITS_9 [expr 0x1 << 4 ] +-set AT91C_SPI_BITS_10 [expr 0x2 << 4 ] +-set AT91C_SPI_BITS_11 [expr 0x3 << 4 ] +-set AT91C_SPI_BITS_12 [expr 0x4 << 4 ] +-set AT91C_SPI_BITS_13 [expr 0x5 << 4 ] +-set AT91C_SPI_BITS_14 [expr 0x6 << 4 ] +-set AT91C_SPI_BITS_15 [expr 0x7 << 4 ] +-set AT91C_SPI_BITS_16 [expr 0x8 << 4 ] +-set AT91C_SPI_SCBR [expr 0xFF << 8 ] +-set AT91C_SPI_DLYBS [expr 0xFF << 16 ] +-set AT91C_SPI_DLYBCT [expr 0xFF << 24 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Usart +-# ***************************************************************************** +-# -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- +-set AT91C_US_RSTRX [expr 0x1 << 2 ] +-set AT91C_US_RSTTX [expr 0x1 << 3 ] +-set AT91C_US_RXEN [expr 0x1 << 4 ] +-set AT91C_US_RXDIS [expr 0x1 << 5 ] +-set AT91C_US_TXEN [expr 0x1 << 6 ] +-set AT91C_US_TXDIS [expr 0x1 << 7 ] +-set AT91C_US_RSTSTA [expr 0x1 << 8 ] +-set AT91C_US_STTBRK [expr 0x1 << 9 ] +-set AT91C_US_STPBRK [expr 0x1 << 10 ] +-set AT91C_US_STTTO [expr 0x1 << 11 ] +-set AT91C_US_SENDA [expr 0x1 << 12 ] +-set AT91C_US_RSTIT [expr 0x1 << 13 ] +-set AT91C_US_RSTNACK [expr 0x1 << 14 ] +-set AT91C_US_RETTO [expr 0x1 << 15 ] +-set AT91C_US_DTREN [expr 0x1 << 16 ] +-set AT91C_US_DTRDIS [expr 0x1 << 17 ] +-set AT91C_US_RTSEN [expr 0x1 << 18 ] +-set AT91C_US_RTSDIS [expr 0x1 << 19 ] +-# -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- +-set AT91C_US_USMODE [expr 0xF << 0 ] +-set AT91C_US_USMODE_NORMAL 0x0 +-set AT91C_US_USMODE_RS485 0x1 +-set AT91C_US_USMODE_HWHSH 0x2 +-set AT91C_US_USMODE_MODEM 0x3 +-set AT91C_US_USMODE_ISO7816_0 0x4 +-set AT91C_US_USMODE_ISO7816_1 0x6 +-set AT91C_US_USMODE_IRDA 0x8 +-set AT91C_US_USMODE_SWHSH 0xC +-set AT91C_US_CLKS [expr 0x3 << 4 ] +-set AT91C_US_CLKS_CLOCK [expr 0x0 << 4 ] +-set AT91C_US_CLKS_FDIV1 [expr 0x1 << 4 ] +-set AT91C_US_CLKS_SLOW [expr 0x2 << 4 ] +-set AT91C_US_CLKS_EXT [expr 0x3 << 4 ] +-set AT91C_US_CHRL [expr 0x3 << 6 ] +-set AT91C_US_CHRL_5_BITS [expr 0x0 << 6 ] +-set AT91C_US_CHRL_6_BITS [expr 0x1 << 6 ] +-set AT91C_US_CHRL_7_BITS [expr 0x2 << 6 ] +-set AT91C_US_CHRL_8_BITS [expr 0x3 << 6 ] +-set AT91C_US_SYNC [expr 0x1 << 8 ] +-set AT91C_US_PAR [expr 0x7 << 9 ] +-set AT91C_US_PAR_EVEN [expr 0x0 << 9 ] +-set AT91C_US_PAR_ODD [expr 0x1 << 9 ] +-set AT91C_US_PAR_SPACE [expr 0x2 << 9 ] +-set AT91C_US_PAR_MARK [expr 0x3 << 9 ] +-set AT91C_US_PAR_NONE [expr 0x4 << 9 ] +-set AT91C_US_PAR_MULTI_DROP [expr 0x6 << 9 ] +-set AT91C_US_NBSTOP [expr 0x3 << 12 ] +-set AT91C_US_NBSTOP_1_BIT [expr 0x0 << 12 ] +-set AT91C_US_NBSTOP_15_BIT [expr 0x1 << 12 ] +-set AT91C_US_NBSTOP_2_BIT [expr 0x2 << 12 ] +-set AT91C_US_CHMODE [expr 0x3 << 14 ] +-set AT91C_US_CHMODE_NORMAL [expr 0x0 << 14 ] +-set AT91C_US_CHMODE_AUTO [expr 0x1 << 14 ] +-set AT91C_US_CHMODE_LOCAL [expr 0x2 << 14 ] +-set AT91C_US_CHMODE_REMOTE [expr 0x3 << 14 ] +-set AT91C_US_MSBF [expr 0x1 << 16 ] +-set AT91C_US_MODE9 [expr 0x1 << 17 ] +-set AT91C_US_CKLO [expr 0x1 << 18 ] +-set AT91C_US_OVER [expr 0x1 << 19 ] +-set AT91C_US_INACK [expr 0x1 << 20 ] +-set AT91C_US_DSNACK [expr 0x1 << 21 ] +-set AT91C_US_MAX_ITER [expr 0x1 << 24 ] +-set AT91C_US_FILTER [expr 0x1 << 28 ] +-# -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-set AT91C_US_RXRDY [expr 0x1 << 0 ] +-set AT91C_US_TXRDY [expr 0x1 << 1 ] +-set AT91C_US_RXBRK [expr 0x1 << 2 ] +-set AT91C_US_ENDRX [expr 0x1 << 3 ] +-set AT91C_US_ENDTX [expr 0x1 << 4 ] +-set AT91C_US_OVRE [expr 0x1 << 5 ] +-set AT91C_US_FRAME [expr 0x1 << 6 ] +-set AT91C_US_PARE [expr 0x1 << 7 ] +-set AT91C_US_TIMEOUT [expr 0x1 << 8 ] +-set AT91C_US_TXEMPTY [expr 0x1 << 9 ] +-set AT91C_US_ITERATION [expr 0x1 << 10 ] +-set AT91C_US_TXBUFE [expr 0x1 << 11 ] +-set AT91C_US_RXBUFF [expr 0x1 << 12 ] +-set AT91C_US_NACK [expr 0x1 << 13 ] +-set AT91C_US_RIIC [expr 0x1 << 16 ] +-set AT91C_US_DSRIC [expr 0x1 << 17 ] +-set AT91C_US_DCDIC [expr 0x1 << 18 ] +-set AT91C_US_CTSIC [expr 0x1 << 19 ] +-# -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-set AT91C_US_RXRDY [expr 0x1 << 0 ] +-set AT91C_US_TXRDY [expr 0x1 << 1 ] +-set AT91C_US_RXBRK [expr 0x1 << 2 ] +-set AT91C_US_ENDRX [expr 0x1 << 3 ] +-set AT91C_US_ENDTX [expr 0x1 << 4 ] +-set AT91C_US_OVRE [expr 0x1 << 5 ] +-set AT91C_US_FRAME [expr 0x1 << 6 ] +-set AT91C_US_PARE [expr 0x1 << 7 ] +-set AT91C_US_TIMEOUT [expr 0x1 << 8 ] +-set AT91C_US_TXEMPTY [expr 0x1 << 9 ] +-set AT91C_US_ITERATION [expr 0x1 << 10 ] +-set AT91C_US_TXBUFE [expr 0x1 << 11 ] +-set AT91C_US_RXBUFF [expr 0x1 << 12 ] +-set AT91C_US_NACK [expr 0x1 << 13 ] +-set AT91C_US_RIIC [expr 0x1 << 16 ] +-set AT91C_US_DSRIC [expr 0x1 << 17 ] +-set AT91C_US_DCDIC [expr 0x1 << 18 ] +-set AT91C_US_CTSIC [expr 0x1 << 19 ] +-# -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-set AT91C_US_RXRDY [expr 0x1 << 0 ] +-set AT91C_US_TXRDY [expr 0x1 << 1 ] +-set AT91C_US_RXBRK [expr 0x1 << 2 ] +-set AT91C_US_ENDRX [expr 0x1 << 3 ] +-set AT91C_US_ENDTX [expr 0x1 << 4 ] +-set AT91C_US_OVRE [expr 0x1 << 5 ] +-set AT91C_US_FRAME [expr 0x1 << 6 ] +-set AT91C_US_PARE [expr 0x1 << 7 ] +-set AT91C_US_TIMEOUT [expr 0x1 << 8 ] +-set AT91C_US_TXEMPTY [expr 0x1 << 9 ] +-set AT91C_US_ITERATION [expr 0x1 << 10 ] +-set AT91C_US_TXBUFE [expr 0x1 << 11 ] +-set AT91C_US_RXBUFF [expr 0x1 << 12 ] +-set AT91C_US_NACK [expr 0x1 << 13 ] +-set AT91C_US_RIIC [expr 0x1 << 16 ] +-set AT91C_US_DSRIC [expr 0x1 << 17 ] +-set AT91C_US_DCDIC [expr 0x1 << 18 ] +-set AT91C_US_CTSIC [expr 0x1 << 19 ] +-# -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- +-set AT91C_US_RXRDY [expr 0x1 << 0 ] +-set AT91C_US_TXRDY [expr 0x1 << 1 ] +-set AT91C_US_RXBRK [expr 0x1 << 2 ] +-set AT91C_US_ENDRX [expr 0x1 << 3 ] +-set AT91C_US_ENDTX [expr 0x1 << 4 ] +-set AT91C_US_OVRE [expr 0x1 << 5 ] +-set AT91C_US_FRAME [expr 0x1 << 6 ] +-set AT91C_US_PARE [expr 0x1 << 7 ] +-set AT91C_US_TIMEOUT [expr 0x1 << 8 ] +-set AT91C_US_TXEMPTY [expr 0x1 << 9 ] +-set AT91C_US_ITERATION [expr 0x1 << 10 ] +-set AT91C_US_TXBUFE [expr 0x1 << 11 ] +-set AT91C_US_RXBUFF [expr 0x1 << 12 ] +-set AT91C_US_NACK [expr 0x1 << 13 ] +-set AT91C_US_RIIC [expr 0x1 << 16 ] +-set AT91C_US_DSRIC [expr 0x1 << 17 ] +-set AT91C_US_DCDIC [expr 0x1 << 18 ] +-set AT91C_US_CTSIC [expr 0x1 << 19 ] +-set AT91C_US_RI [expr 0x1 << 20 ] +-set AT91C_US_DSR [expr 0x1 << 21 ] +-set AT91C_US_DCD [expr 0x1 << 22 ] +-set AT91C_US_CTS [expr 0x1 << 23 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface +-# ***************************************************************************** +-# -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- +-set AT91C_SSC_RXEN [expr 0x1 << 0 ] +-set AT91C_SSC_RXDIS [expr 0x1 << 1 ] +-set AT91C_SSC_TXEN [expr 0x1 << 8 ] +-set AT91C_SSC_TXDIS [expr 0x1 << 9 ] +-set AT91C_SSC_SWRST [expr 0x1 << 15 ] +-# -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- +-set AT91C_SSC_CKS [expr 0x3 << 0 ] +-set AT91C_SSC_CKS_DIV 0x0 +-set AT91C_SSC_CKS_TK 0x1 +-set AT91C_SSC_CKS_RK 0x2 +-set AT91C_SSC_CKO [expr 0x7 << 2 ] +-set AT91C_SSC_CKO_NONE [expr 0x0 << 2 ] +-set AT91C_SSC_CKO_CONTINOUS [expr 0x1 << 2 ] +-set AT91C_SSC_CKO_DATA_TX [expr 0x2 << 2 ] +-set AT91C_SSC_CKI [expr 0x1 << 5 ] +-set AT91C_SSC_CKG [expr 0x3 << 6 ] +-set AT91C_SSC_CKG_NONE [expr 0x0 << 6 ] +-set AT91C_SSC_CKG_LOW [expr 0x1 << 6 ] +-set AT91C_SSC_CKG_HIGH [expr 0x2 << 6 ] +-set AT91C_SSC_START [expr 0xF << 8 ] +-set AT91C_SSC_START_CONTINOUS [expr 0x0 << 8 ] +-set AT91C_SSC_START_TX [expr 0x1 << 8 ] +-set AT91C_SSC_START_LOW_RF [expr 0x2 << 8 ] +-set AT91C_SSC_START_HIGH_RF [expr 0x3 << 8 ] +-set AT91C_SSC_START_FALL_RF [expr 0x4 << 8 ] +-set AT91C_SSC_START_RISE_RF [expr 0x5 << 8 ] +-set AT91C_SSC_START_LEVEL_RF [expr 0x6 << 8 ] +-set AT91C_SSC_START_EDGE_RF [expr 0x7 << 8 ] +-set AT91C_SSC_START_0 [expr 0x8 << 8 ] +-set AT91C_SSC_STOP [expr 0x1 << 12 ] +-set AT91C_SSC_STTDLY [expr 0xFF << 16 ] +-set AT91C_SSC_PERIOD [expr 0xFF << 24 ] +-# -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- +-set AT91C_SSC_DATLEN [expr 0x1F << 0 ] +-set AT91C_SSC_LOOP [expr 0x1 << 5 ] +-set AT91C_SSC_MSBF [expr 0x1 << 7 ] +-set AT91C_SSC_DATNB [expr 0xF << 8 ] +-set AT91C_SSC_FSLEN [expr 0xF << 16 ] +-set AT91C_SSC_FSOS [expr 0x7 << 20 ] +-set AT91C_SSC_FSOS_NONE [expr 0x0 << 20 ] +-set AT91C_SSC_FSOS_NEGATIVE [expr 0x1 << 20 ] +-set AT91C_SSC_FSOS_POSITIVE [expr 0x2 << 20 ] +-set AT91C_SSC_FSOS_LOW [expr 0x3 << 20 ] +-set AT91C_SSC_FSOS_HIGH [expr 0x4 << 20 ] +-set AT91C_SSC_FSOS_TOGGLE [expr 0x5 << 20 ] +-set AT91C_SSC_FSEDGE [expr 0x1 << 24 ] +-# -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- +-set AT91C_SSC_CKS [expr 0x3 << 0 ] +-set AT91C_SSC_CKS_DIV 0x0 +-set AT91C_SSC_CKS_TK 0x1 +-set AT91C_SSC_CKS_RK 0x2 +-set AT91C_SSC_CKO [expr 0x7 << 2 ] +-set AT91C_SSC_CKO_NONE [expr 0x0 << 2 ] +-set AT91C_SSC_CKO_CONTINOUS [expr 0x1 << 2 ] +-set AT91C_SSC_CKO_DATA_TX [expr 0x2 << 2 ] +-set AT91C_SSC_CKI [expr 0x1 << 5 ] +-set AT91C_SSC_CKG [expr 0x3 << 6 ] +-set AT91C_SSC_CKG_NONE [expr 0x0 << 6 ] +-set AT91C_SSC_CKG_LOW [expr 0x1 << 6 ] +-set AT91C_SSC_CKG_HIGH [expr 0x2 << 6 ] +-set AT91C_SSC_START [expr 0xF << 8 ] +-set AT91C_SSC_START_CONTINOUS [expr 0x0 << 8 ] +-set AT91C_SSC_START_TX [expr 0x1 << 8 ] +-set AT91C_SSC_START_LOW_RF [expr 0x2 << 8 ] +-set AT91C_SSC_START_HIGH_RF [expr 0x3 << 8 ] +-set AT91C_SSC_START_FALL_RF [expr 0x4 << 8 ] +-set AT91C_SSC_START_RISE_RF [expr 0x5 << 8 ] +-set AT91C_SSC_START_LEVEL_RF [expr 0x6 << 8 ] +-set AT91C_SSC_START_EDGE_RF [expr 0x7 << 8 ] +-set AT91C_SSC_START_0 [expr 0x8 << 8 ] +-set AT91C_SSC_STTDLY [expr 0xFF << 16 ] +-set AT91C_SSC_PERIOD [expr 0xFF << 24 ] +-# -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- +-set AT91C_SSC_DATLEN [expr 0x1F << 0 ] +-set AT91C_SSC_DATDEF [expr 0x1 << 5 ] +-set AT91C_SSC_MSBF [expr 0x1 << 7 ] +-set AT91C_SSC_DATNB [expr 0xF << 8 ] +-set AT91C_SSC_FSLEN [expr 0xF << 16 ] +-set AT91C_SSC_FSOS [expr 0x7 << 20 ] +-set AT91C_SSC_FSOS_NONE [expr 0x0 << 20 ] +-set AT91C_SSC_FSOS_NEGATIVE [expr 0x1 << 20 ] +-set AT91C_SSC_FSOS_POSITIVE [expr 0x2 << 20 ] +-set AT91C_SSC_FSOS_LOW [expr 0x3 << 20 ] +-set AT91C_SSC_FSOS_HIGH [expr 0x4 << 20 ] +-set AT91C_SSC_FSOS_TOGGLE [expr 0x5 << 20 ] +-set AT91C_SSC_FSDEN [expr 0x1 << 23 ] +-set AT91C_SSC_FSEDGE [expr 0x1 << 24 ] +-# -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- +-set AT91C_SSC_TXRDY [expr 0x1 << 0 ] +-set AT91C_SSC_TXEMPTY [expr 0x1 << 1 ] +-set AT91C_SSC_ENDTX [expr 0x1 << 2 ] +-set AT91C_SSC_TXBUFE [expr 0x1 << 3 ] +-set AT91C_SSC_RXRDY [expr 0x1 << 4 ] +-set AT91C_SSC_OVRUN [expr 0x1 << 5 ] +-set AT91C_SSC_ENDRX [expr 0x1 << 6 ] +-set AT91C_SSC_RXBUFF [expr 0x1 << 7 ] +-set AT91C_SSC_CP0 [expr 0x1 << 8 ] +-set AT91C_SSC_CP1 [expr 0x1 << 9 ] +-set AT91C_SSC_TXSYN [expr 0x1 << 10 ] +-set AT91C_SSC_RXSYN [expr 0x1 << 11 ] +-set AT91C_SSC_TXENA [expr 0x1 << 16 ] +-set AT91C_SSC_RXENA [expr 0x1 << 17 ] +-# -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- +-set AT91C_SSC_TXRDY [expr 0x1 << 0 ] +-set AT91C_SSC_TXEMPTY [expr 0x1 << 1 ] +-set AT91C_SSC_ENDTX [expr 0x1 << 2 ] +-set AT91C_SSC_TXBUFE [expr 0x1 << 3 ] +-set AT91C_SSC_RXRDY [expr 0x1 << 4 ] +-set AT91C_SSC_OVRUN [expr 0x1 << 5 ] +-set AT91C_SSC_ENDRX [expr 0x1 << 6 ] +-set AT91C_SSC_RXBUFF [expr 0x1 << 7 ] +-set AT91C_SSC_CP0 [expr 0x1 << 8 ] +-set AT91C_SSC_CP1 [expr 0x1 << 9 ] +-set AT91C_SSC_TXSYN [expr 0x1 << 10 ] +-set AT91C_SSC_RXSYN [expr 0x1 << 11 ] +-# -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- +-set AT91C_SSC_TXRDY [expr 0x1 << 0 ] +-set AT91C_SSC_TXEMPTY [expr 0x1 << 1 ] +-set AT91C_SSC_ENDTX [expr 0x1 << 2 ] +-set AT91C_SSC_TXBUFE [expr 0x1 << 3 ] +-set AT91C_SSC_RXRDY [expr 0x1 << 4 ] +-set AT91C_SSC_OVRUN [expr 0x1 << 5 ] +-set AT91C_SSC_ENDRX [expr 0x1 << 6 ] +-set AT91C_SSC_RXBUFF [expr 0x1 << 7 ] +-set AT91C_SSC_CP0 [expr 0x1 << 8 ] +-set AT91C_SSC_CP1 [expr 0x1 << 9 ] +-set AT91C_SSC_TXSYN [expr 0x1 << 10 ] +-set AT91C_SSC_RXSYN [expr 0x1 << 11 ] +-# -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- +-set AT91C_SSC_TXRDY [expr 0x1 << 0 ] +-set AT91C_SSC_TXEMPTY [expr 0x1 << 1 ] +-set AT91C_SSC_ENDTX [expr 0x1 << 2 ] +-set AT91C_SSC_TXBUFE [expr 0x1 << 3 ] +-set AT91C_SSC_RXRDY [expr 0x1 << 4 ] +-set AT91C_SSC_OVRUN [expr 0x1 << 5 ] +-set AT91C_SSC_ENDRX [expr 0x1 << 6 ] +-set AT91C_SSC_RXBUFF [expr 0x1 << 7 ] +-set AT91C_SSC_CP0 [expr 0x1 << 8 ] +-set AT91C_SSC_CP1 [expr 0x1 << 9 ] +-set AT91C_SSC_TXSYN [expr 0x1 << 10 ] +-set AT91C_SSC_RXSYN [expr 0x1 << 11 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Two-wire Interface +-# ***************************************************************************** +-# -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- +-set AT91C_TWI_START [expr 0x1 << 0 ] +-set AT91C_TWI_STOP [expr 0x1 << 1 ] +-set AT91C_TWI_MSEN [expr 0x1 << 2 ] +-set AT91C_TWI_MSDIS [expr 0x1 << 3 ] +-set AT91C_TWI_SWRST [expr 0x1 << 7 ] +-# -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- +-set AT91C_TWI_IADRSZ [expr 0x3 << 8 ] +-set AT91C_TWI_IADRSZ_NO [expr 0x0 << 8 ] +-set AT91C_TWI_IADRSZ_1_BYTE [expr 0x1 << 8 ] +-set AT91C_TWI_IADRSZ_2_BYTE [expr 0x2 << 8 ] +-set AT91C_TWI_IADRSZ_3_BYTE [expr 0x3 << 8 ] +-set AT91C_TWI_MREAD [expr 0x1 << 12 ] +-set AT91C_TWI_DADR [expr 0x7F << 16 ] +-# -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- +-set AT91C_TWI_CLDIV [expr 0xFF << 0 ] +-set AT91C_TWI_CHDIV [expr 0xFF << 8 ] +-set AT91C_TWI_CKDIV [expr 0x7 << 16 ] +-# -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- +-set AT91C_TWI_TXCOMP [expr 0x1 << 0 ] +-set AT91C_TWI_RXRDY [expr 0x1 << 1 ] +-set AT91C_TWI_TXRDY [expr 0x1 << 2 ] +-set AT91C_TWI_OVRE [expr 0x1 << 6 ] +-set AT91C_TWI_UNRE [expr 0x1 << 7 ] +-set AT91C_TWI_NACK [expr 0x1 << 8 ] +-# -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- +-set AT91C_TWI_TXCOMP [expr 0x1 << 0 ] +-set AT91C_TWI_RXRDY [expr 0x1 << 1 ] +-set AT91C_TWI_TXRDY [expr 0x1 << 2 ] +-set AT91C_TWI_OVRE [expr 0x1 << 6 ] +-set AT91C_TWI_UNRE [expr 0x1 << 7 ] +-set AT91C_TWI_NACK [expr 0x1 << 8 ] +-# -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- +-set AT91C_TWI_TXCOMP [expr 0x1 << 0 ] +-set AT91C_TWI_RXRDY [expr 0x1 << 1 ] +-set AT91C_TWI_TXRDY [expr 0x1 << 2 ] +-set AT91C_TWI_OVRE [expr 0x1 << 6 ] +-set AT91C_TWI_UNRE [expr 0x1 << 7 ] +-set AT91C_TWI_NACK [expr 0x1 << 8 ] +-# -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- +-set AT91C_TWI_TXCOMP [expr 0x1 << 0 ] +-set AT91C_TWI_RXRDY [expr 0x1 << 1 ] +-set AT91C_TWI_TXRDY [expr 0x1 << 2 ] +-set AT91C_TWI_OVRE [expr 0x1 << 6 ] +-set AT91C_TWI_UNRE [expr 0x1 << 7 ] +-set AT91C_TWI_NACK [expr 0x1 << 8 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR PWMC Channel Interface +-# ***************************************************************************** +-# -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- +-set AT91C_PWMC_CPRE [expr 0xF << 0 ] +-set AT91C_PWMC_CPRE_MCK 0x0 +-set AT91C_PWMC_CPRE_MCK/2 0x1 +-set AT91C_PWMC_CPRE_MCK/4 0x2 +-set AT91C_PWMC_CPRE_MCK/8 0x3 +-set AT91C_PWMC_CPRE_MCK/16 0x4 +-set AT91C_PWMC_CPRE_MCK/32 0x5 +-set AT91C_PWMC_CPRE_MCK/64 0x6 +-set AT91C_PWMC_CPRE_MCK/128 0x7 +-set AT91C_PWMC_CPRE_MCK/256 0x8 +-set AT91C_PWMC_CPRE_MCK/512 0x9 +-set AT91C_PWMC_CPRE_MCK/1024 0xA +-set AT91C_PWMC_CPRE_MCKA 0xB +-set AT91C_PWMC_CPRE_MCKB 0xC +-set AT91C_PWMC_CALG [expr 0x1 << 8 ] +-set AT91C_PWMC_CPOL [expr 0x1 << 9 ] +-set AT91C_PWMC_CPD [expr 0x1 << 10 ] +-# -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- +-set AT91C_PWMC_CDTY [expr 0x0 << 0 ] +-# -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- +-set AT91C_PWMC_CPRD [expr 0x0 << 0 ] +-# -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- +-set AT91C_PWMC_CCNT [expr 0x0 << 0 ] +-# -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- +-set AT91C_PWMC_CUPD [expr 0x0 << 0 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface +-# ***************************************************************************** +-# -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- +-set AT91C_PWMC_DIVA [expr 0xFF << 0 ] +-set AT91C_PWMC_PREA [expr 0xF << 8 ] +-set AT91C_PWMC_PREA_MCK [expr 0x0 << 8 ] +-set AT91C_PWMC_PREA_MCK/2 [expr 0x1 << 8 ] +-set AT91C_PWMC_PREA_MCK/4 [expr 0x2 << 8 ] +-set AT91C_PWMC_PREA_MCK/8 [expr 0x3 << 8 ] +-set AT91C_PWMC_PREA_MCK/16 [expr 0x4 << 8 ] +-set AT91C_PWMC_PREA_MCK/32 [expr 0x5 << 8 ] +-set AT91C_PWMC_PREA_MCK/64 [expr 0x6 << 8 ] +-set AT91C_PWMC_PREA_MCK/128 [expr 0x7 << 8 ] +-set AT91C_PWMC_PREA_MCK/256 [expr 0x8 << 8 ] +-set AT91C_PWMC_DIVB [expr 0xFF << 16 ] +-set AT91C_PWMC_PREB [expr 0xF << 24 ] +-set AT91C_PWMC_PREB_MCK [expr 0x0 << 24 ] +-set AT91C_PWMC_PREB_MCK/2 [expr 0x1 << 24 ] +-set AT91C_PWMC_PREB_MCK/4 [expr 0x2 << 24 ] +-set AT91C_PWMC_PREB_MCK/8 [expr 0x3 << 24 ] +-set AT91C_PWMC_PREB_MCK/16 [expr 0x4 << 24 ] +-set AT91C_PWMC_PREB_MCK/32 [expr 0x5 << 24 ] +-set AT91C_PWMC_PREB_MCK/64 [expr 0x6 << 24 ] +-set AT91C_PWMC_PREB_MCK/128 [expr 0x7 << 24 ] +-set AT91C_PWMC_PREB_MCK/256 [expr 0x8 << 24 ] +-# -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- +-set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] +-set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] +-set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] +-set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] +-# -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- +-set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] +-set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] +-set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] +-set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] +-# -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- +-set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] +-set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] +-set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] +-set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] +-# -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- +-set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] +-set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] +-set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] +-set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] +-# -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- +-set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] +-set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] +-set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] +-set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] +-# -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- +-set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] +-set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] +-set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] +-set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] +-# -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- +-set AT91C_PWMC_CHID0 [expr 0x1 << 0 ] +-set AT91C_PWMC_CHID1 [expr 0x1 << 1 ] +-set AT91C_PWMC_CHID2 [expr 0x1 << 2 ] +-set AT91C_PWMC_CHID3 [expr 0x1 << 3 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR USB Device Interface +-# ***************************************************************************** +-# -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- +-set AT91C_UDP_FRM_NUM [expr 0x7FF << 0 ] +-set AT91C_UDP_FRM_ERR [expr 0x1 << 16 ] +-set AT91C_UDP_FRM_OK [expr 0x1 << 17 ] +-# -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- +-set AT91C_UDP_FADDEN [expr 0x1 << 0 ] +-set AT91C_UDP_CONFG [expr 0x1 << 1 ] +-set AT91C_UDP_ESR [expr 0x1 << 2 ] +-set AT91C_UDP_RSMINPR [expr 0x1 << 3 ] +-set AT91C_UDP_RMWUPE [expr 0x1 << 4 ] +-# -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- +-set AT91C_UDP_FADD [expr 0xFF << 0 ] +-set AT91C_UDP_FEN [expr 0x1 << 8 ] +-# -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- +-set AT91C_UDP_EPINT0 [expr 0x1 << 0 ] +-set AT91C_UDP_EPINT1 [expr 0x1 << 1 ] +-set AT91C_UDP_EPINT2 [expr 0x1 << 2 ] +-set AT91C_UDP_EPINT3 [expr 0x1 << 3 ] +-set AT91C_UDP_EPINT4 [expr 0x1 << 4 ] +-set AT91C_UDP_EPINT5 [expr 0x1 << 5 ] +-set AT91C_UDP_RXSUSP [expr 0x1 << 8 ] +-set AT91C_UDP_RXRSM [expr 0x1 << 9 ] +-set AT91C_UDP_EXTRSM [expr 0x1 << 10 ] +-set AT91C_UDP_SOFINT [expr 0x1 << 11 ] +-set AT91C_UDP_WAKEUP [expr 0x1 << 13 ] +-# -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- +-set AT91C_UDP_EPINT0 [expr 0x1 << 0 ] +-set AT91C_UDP_EPINT1 [expr 0x1 << 1 ] +-set AT91C_UDP_EPINT2 [expr 0x1 << 2 ] +-set AT91C_UDP_EPINT3 [expr 0x1 << 3 ] +-set AT91C_UDP_EPINT4 [expr 0x1 << 4 ] +-set AT91C_UDP_EPINT5 [expr 0x1 << 5 ] +-set AT91C_UDP_RXSUSP [expr 0x1 << 8 ] +-set AT91C_UDP_RXRSM [expr 0x1 << 9 ] +-set AT91C_UDP_EXTRSM [expr 0x1 << 10 ] +-set AT91C_UDP_SOFINT [expr 0x1 << 11 ] +-set AT91C_UDP_WAKEUP [expr 0x1 << 13 ] +-# -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- +-set AT91C_UDP_EPINT0 [expr 0x1 << 0 ] +-set AT91C_UDP_EPINT1 [expr 0x1 << 1 ] +-set AT91C_UDP_EPINT2 [expr 0x1 << 2 ] +-set AT91C_UDP_EPINT3 [expr 0x1 << 3 ] +-set AT91C_UDP_EPINT4 [expr 0x1 << 4 ] +-set AT91C_UDP_EPINT5 [expr 0x1 << 5 ] +-set AT91C_UDP_RXSUSP [expr 0x1 << 8 ] +-set AT91C_UDP_RXRSM [expr 0x1 << 9 ] +-set AT91C_UDP_EXTRSM [expr 0x1 << 10 ] +-set AT91C_UDP_SOFINT [expr 0x1 << 11 ] +-set AT91C_UDP_WAKEUP [expr 0x1 << 13 ] +-# -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- +-set AT91C_UDP_EPINT0 [expr 0x1 << 0 ] +-set AT91C_UDP_EPINT1 [expr 0x1 << 1 ] +-set AT91C_UDP_EPINT2 [expr 0x1 << 2 ] +-set AT91C_UDP_EPINT3 [expr 0x1 << 3 ] +-set AT91C_UDP_EPINT4 [expr 0x1 << 4 ] +-set AT91C_UDP_EPINT5 [expr 0x1 << 5 ] +-set AT91C_UDP_RXSUSP [expr 0x1 << 8 ] +-set AT91C_UDP_RXRSM [expr 0x1 << 9 ] +-set AT91C_UDP_EXTRSM [expr 0x1 << 10 ] +-set AT91C_UDP_SOFINT [expr 0x1 << 11 ] +-set AT91C_UDP_ENDBUSRES [expr 0x1 << 12 ] +-set AT91C_UDP_WAKEUP [expr 0x1 << 13 ] +-# -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- +-set AT91C_UDP_EPINT0 [expr 0x1 << 0 ] +-set AT91C_UDP_EPINT1 [expr 0x1 << 1 ] +-set AT91C_UDP_EPINT2 [expr 0x1 << 2 ] +-set AT91C_UDP_EPINT3 [expr 0x1 << 3 ] +-set AT91C_UDP_EPINT4 [expr 0x1 << 4 ] +-set AT91C_UDP_EPINT5 [expr 0x1 << 5 ] +-set AT91C_UDP_RXSUSP [expr 0x1 << 8 ] +-set AT91C_UDP_RXRSM [expr 0x1 << 9 ] +-set AT91C_UDP_EXTRSM [expr 0x1 << 10 ] +-set AT91C_UDP_SOFINT [expr 0x1 << 11 ] +-set AT91C_UDP_WAKEUP [expr 0x1 << 13 ] +-# -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- +-set AT91C_UDP_EP0 [expr 0x1 << 0 ] +-set AT91C_UDP_EP1 [expr 0x1 << 1 ] +-set AT91C_UDP_EP2 [expr 0x1 << 2 ] +-set AT91C_UDP_EP3 [expr 0x1 << 3 ] +-set AT91C_UDP_EP4 [expr 0x1 << 4 ] +-set AT91C_UDP_EP5 [expr 0x1 << 5 ] +-# -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- +-set AT91C_UDP_TXCOMP [expr 0x1 << 0 ] +-set AT91C_UDP_RX_DATA_BK0 [expr 0x1 << 1 ] +-set AT91C_UDP_RXSETUP [expr 0x1 << 2 ] +-set AT91C_UDP_ISOERROR [expr 0x1 << 3 ] +-set AT91C_UDP_TXPKTRDY [expr 0x1 << 4 ] +-set AT91C_UDP_FORCESTALL [expr 0x1 << 5 ] +-set AT91C_UDP_RX_DATA_BK1 [expr 0x1 << 6 ] +-set AT91C_UDP_DIR [expr 0x1 << 7 ] +-set AT91C_UDP_EPTYPE [expr 0x7 << 8 ] +-set AT91C_UDP_EPTYPE_CTRL [expr 0x0 << 8 ] +-set AT91C_UDP_EPTYPE_ISO_OUT [expr 0x1 << 8 ] +-set AT91C_UDP_EPTYPE_BULK_OUT [expr 0x2 << 8 ] +-set AT91C_UDP_EPTYPE_INT_OUT [expr 0x3 << 8 ] +-set AT91C_UDP_EPTYPE_ISO_IN [expr 0x5 << 8 ] +-set AT91C_UDP_EPTYPE_BULK_IN [expr 0x6 << 8 ] +-set AT91C_UDP_EPTYPE_INT_IN [expr 0x7 << 8 ] +-set AT91C_UDP_DTGLE [expr 0x1 << 11 ] +-set AT91C_UDP_EPEDS [expr 0x1 << 15 ] +-set AT91C_UDP_RXBYTECNT [expr 0x7FF << 16 ] +-# -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- +-set AT91C_UDP_TXVDIS [expr 0x1 << 8 ] +-set AT91C_UDP_PUON [expr 0x1 << 9 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Timer Counter Channel Interface +-# ***************************************************************************** +-# -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- +-set AT91C_TC_CLKEN [expr 0x1 << 0 ] +-set AT91C_TC_CLKDIS [expr 0x1 << 1 ] +-set AT91C_TC_SWTRG [expr 0x1 << 2 ] +-# -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- +-set AT91C_TC_CLKS [expr 0x7 << 0 ] +-set AT91C_TC_CLKS_TIMER_DIV1_CLOCK 0x0 +-set AT91C_TC_CLKS_TIMER_DIV2_CLOCK 0x1 +-set AT91C_TC_CLKS_TIMER_DIV3_CLOCK 0x2 +-set AT91C_TC_CLKS_TIMER_DIV4_CLOCK 0x3 +-set AT91C_TC_CLKS_TIMER_DIV5_CLOCK 0x4 +-set AT91C_TC_CLKS_XC0 0x5 +-set AT91C_TC_CLKS_XC1 0x6 +-set AT91C_TC_CLKS_XC2 0x7 +-set AT91C_TC_CLKS [expr 0x7 << 0 ] +-set AT91C_TC_CLKS_TIMER_DIV1_CLOCK 0x0 +-set AT91C_TC_CLKS_TIMER_DIV2_CLOCK 0x1 +-set AT91C_TC_CLKS_TIMER_DIV3_CLOCK 0x2 +-set AT91C_TC_CLKS_TIMER_DIV4_CLOCK 0x3 +-set AT91C_TC_CLKS_TIMER_DIV5_CLOCK 0x4 +-set AT91C_TC_CLKS_XC0 0x5 +-set AT91C_TC_CLKS_XC1 0x6 +-set AT91C_TC_CLKS_XC2 0x7 +-set AT91C_TC_CLKI [expr 0x1 << 3 ] +-set AT91C_TC_CLKI [expr 0x1 << 3 ] +-set AT91C_TC_BURST [expr 0x3 << 4 ] +-set AT91C_TC_BURST_NONE [expr 0x0 << 4 ] +-set AT91C_TC_BURST_XC0 [expr 0x1 << 4 ] +-set AT91C_TC_BURST_XC1 [expr 0x2 << 4 ] +-set AT91C_TC_BURST_XC2 [expr 0x3 << 4 ] +-set AT91C_TC_BURST [expr 0x3 << 4 ] +-set AT91C_TC_BURST_NONE [expr 0x0 << 4 ] +-set AT91C_TC_BURST_XC0 [expr 0x1 << 4 ] +-set AT91C_TC_BURST_XC1 [expr 0x2 << 4 ] +-set AT91C_TC_BURST_XC2 [expr 0x3 << 4 ] +-set AT91C_TC_CPCSTOP [expr 0x1 << 6 ] +-set AT91C_TC_LDBSTOP [expr 0x1 << 6 ] +-set AT91C_TC_CPCDIS [expr 0x1 << 7 ] +-set AT91C_TC_LDBDIS [expr 0x1 << 7 ] +-set AT91C_TC_ETRGEDG [expr 0x3 << 8 ] +-set AT91C_TC_ETRGEDG_NONE [expr 0x0 << 8 ] +-set AT91C_TC_ETRGEDG_RISING [expr 0x1 << 8 ] +-set AT91C_TC_ETRGEDG_FALLING [expr 0x2 << 8 ] +-set AT91C_TC_ETRGEDG_BOTH [expr 0x3 << 8 ] +-set AT91C_TC_EEVTEDG [expr 0x3 << 8 ] +-set AT91C_TC_EEVTEDG_NONE [expr 0x0 << 8 ] +-set AT91C_TC_EEVTEDG_RISING [expr 0x1 << 8 ] +-set AT91C_TC_EEVTEDG_FALLING [expr 0x2 << 8 ] +-set AT91C_TC_EEVTEDG_BOTH [expr 0x3 << 8 ] +-set AT91C_TC_EEVT [expr 0x3 << 10 ] +-set AT91C_TC_EEVT_TIOB [expr 0x0 << 10 ] +-set AT91C_TC_EEVT_XC0 [expr 0x1 << 10 ] +-set AT91C_TC_EEVT_XC1 [expr 0x2 << 10 ] +-set AT91C_TC_EEVT_XC2 [expr 0x3 << 10 ] +-set AT91C_TC_ABETRG [expr 0x1 << 10 ] +-set AT91C_TC_ENETRG [expr 0x1 << 12 ] +-set AT91C_TC_WAVESEL [expr 0x3 << 13 ] +-set AT91C_TC_WAVESEL_UP [expr 0x0 << 13 ] +-set AT91C_TC_WAVESEL_UPDOWN [expr 0x1 << 13 ] +-set AT91C_TC_WAVESEL_UP_AUTO [expr 0x2 << 13 ] +-set AT91C_TC_WAVESEL_UPDOWN_AUTO [expr 0x3 << 13 ] +-set AT91C_TC_CPCTRG [expr 0x1 << 14 ] +-set AT91C_TC_WAVE [expr 0x1 << 15 ] +-set AT91C_TC_WAVE [expr 0x1 << 15 ] +-set AT91C_TC_ACPA [expr 0x3 << 16 ] +-set AT91C_TC_ACPA_NONE [expr 0x0 << 16 ] +-set AT91C_TC_ACPA_SET [expr 0x1 << 16 ] +-set AT91C_TC_ACPA_CLEAR [expr 0x2 << 16 ] +-set AT91C_TC_ACPA_TOGGLE [expr 0x3 << 16 ] +-set AT91C_TC_LDRA [expr 0x3 << 16 ] +-set AT91C_TC_LDRA_NONE [expr 0x0 << 16 ] +-set AT91C_TC_LDRA_RISING [expr 0x1 << 16 ] +-set AT91C_TC_LDRA_FALLING [expr 0x2 << 16 ] +-set AT91C_TC_LDRA_BOTH [expr 0x3 << 16 ] +-set AT91C_TC_ACPC [expr 0x3 << 18 ] +-set AT91C_TC_ACPC_NONE [expr 0x0 << 18 ] +-set AT91C_TC_ACPC_SET [expr 0x1 << 18 ] +-set AT91C_TC_ACPC_CLEAR [expr 0x2 << 18 ] +-set AT91C_TC_ACPC_TOGGLE [expr 0x3 << 18 ] +-set AT91C_TC_LDRB [expr 0x3 << 18 ] +-set AT91C_TC_LDRB_NONE [expr 0x0 << 18 ] +-set AT91C_TC_LDRB_RISING [expr 0x1 << 18 ] +-set AT91C_TC_LDRB_FALLING [expr 0x2 << 18 ] +-set AT91C_TC_LDRB_BOTH [expr 0x3 << 18 ] +-set AT91C_TC_AEEVT [expr 0x3 << 20 ] +-set AT91C_TC_AEEVT_NONE [expr 0x0 << 20 ] +-set AT91C_TC_AEEVT_SET [expr 0x1 << 20 ] +-set AT91C_TC_AEEVT_CLEAR [expr 0x2 << 20 ] +-set AT91C_TC_AEEVT_TOGGLE [expr 0x3 << 20 ] +-set AT91C_TC_ASWTRG [expr 0x3 << 22 ] +-set AT91C_TC_ASWTRG_NONE [expr 0x0 << 22 ] +-set AT91C_TC_ASWTRG_SET [expr 0x1 << 22 ] +-set AT91C_TC_ASWTRG_CLEAR [expr 0x2 << 22 ] +-set AT91C_TC_ASWTRG_TOGGLE [expr 0x3 << 22 ] +-set AT91C_TC_BCPB [expr 0x3 << 24 ] +-set AT91C_TC_BCPB_NONE [expr 0x0 << 24 ] +-set AT91C_TC_BCPB_SET [expr 0x1 << 24 ] +-set AT91C_TC_BCPB_CLEAR [expr 0x2 << 24 ] +-set AT91C_TC_BCPB_TOGGLE [expr 0x3 << 24 ] +-set AT91C_TC_BCPC [expr 0x3 << 26 ] +-set AT91C_TC_BCPC_NONE [expr 0x0 << 26 ] +-set AT91C_TC_BCPC_SET [expr 0x1 << 26 ] +-set AT91C_TC_BCPC_CLEAR [expr 0x2 << 26 ] +-set AT91C_TC_BCPC_TOGGLE [expr 0x3 << 26 ] +-set AT91C_TC_BEEVT [expr 0x3 << 28 ] +-set AT91C_TC_BEEVT_NONE [expr 0x0 << 28 ] +-set AT91C_TC_BEEVT_SET [expr 0x1 << 28 ] +-set AT91C_TC_BEEVT_CLEAR [expr 0x2 << 28 ] +-set AT91C_TC_BEEVT_TOGGLE [expr 0x3 << 28 ] +-set AT91C_TC_BSWTRG [expr 0x3 << 30 ] +-set AT91C_TC_BSWTRG_NONE [expr 0x0 << 30 ] +-set AT91C_TC_BSWTRG_SET [expr 0x1 << 30 ] +-set AT91C_TC_BSWTRG_CLEAR [expr 0x2 << 30 ] +-set AT91C_TC_BSWTRG_TOGGLE [expr 0x3 << 30 ] +-# -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- +-set AT91C_TC_COVFS [expr 0x1 << 0 ] +-set AT91C_TC_LOVRS [expr 0x1 << 1 ] +-set AT91C_TC_CPAS [expr 0x1 << 2 ] +-set AT91C_TC_CPBS [expr 0x1 << 3 ] +-set AT91C_TC_CPCS [expr 0x1 << 4 ] +-set AT91C_TC_LDRAS [expr 0x1 << 5 ] +-set AT91C_TC_LDRBS [expr 0x1 << 6 ] +-set AT91C_TC_ETRGS [expr 0x1 << 7 ] +-set AT91C_TC_CLKSTA [expr 0x1 << 16 ] +-set AT91C_TC_MTIOA [expr 0x1 << 17 ] +-set AT91C_TC_MTIOB [expr 0x1 << 18 ] +-# -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- +-set AT91C_TC_COVFS [expr 0x1 << 0 ] +-set AT91C_TC_LOVRS [expr 0x1 << 1 ] +-set AT91C_TC_CPAS [expr 0x1 << 2 ] +-set AT91C_TC_CPBS [expr 0x1 << 3 ] +-set AT91C_TC_CPCS [expr 0x1 << 4 ] +-set AT91C_TC_LDRAS [expr 0x1 << 5 ] +-set AT91C_TC_LDRBS [expr 0x1 << 6 ] +-set AT91C_TC_ETRGS [expr 0x1 << 7 ] +-# -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- +-set AT91C_TC_COVFS [expr 0x1 << 0 ] +-set AT91C_TC_LOVRS [expr 0x1 << 1 ] +-set AT91C_TC_CPAS [expr 0x1 << 2 ] +-set AT91C_TC_CPBS [expr 0x1 << 3 ] +-set AT91C_TC_CPCS [expr 0x1 << 4 ] +-set AT91C_TC_LDRAS [expr 0x1 << 5 ] +-set AT91C_TC_LDRBS [expr 0x1 << 6 ] +-set AT91C_TC_ETRGS [expr 0x1 << 7 ] +-# -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- +-set AT91C_TC_COVFS [expr 0x1 << 0 ] +-set AT91C_TC_LOVRS [expr 0x1 << 1 ] +-set AT91C_TC_CPAS [expr 0x1 << 2 ] +-set AT91C_TC_CPBS [expr 0x1 << 3 ] +-set AT91C_TC_CPCS [expr 0x1 << 4 ] +-set AT91C_TC_LDRAS [expr 0x1 << 5 ] +-set AT91C_TC_LDRBS [expr 0x1 << 6 ] +-set AT91C_TC_ETRGS [expr 0x1 << 7 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Timer Counter Interface +-# ***************************************************************************** +-# -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- +-set AT91C_TCB_SYNC [expr 0x1 << 0 ] +-# -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- +-set AT91C_TCB_TC0XC0S [expr 0x3 << 0 ] +-set AT91C_TCB_TC0XC0S_TCLK0 0x0 +-set AT91C_TCB_TC0XC0S_NONE 0x1 +-set AT91C_TCB_TC0XC0S_TIOA1 0x2 +-set AT91C_TCB_TC0XC0S_TIOA2 0x3 +-set AT91C_TCB_TC1XC1S [expr 0x3 << 2 ] +-set AT91C_TCB_TC1XC1S_TCLK1 [expr 0x0 << 2 ] +-set AT91C_TCB_TC1XC1S_NONE [expr 0x1 << 2 ] +-set AT91C_TCB_TC1XC1S_TIOA0 [expr 0x2 << 2 ] +-set AT91C_TCB_TC1XC1S_TIOA2 [expr 0x3 << 2 ] +-set AT91C_TCB_TC2XC2S [expr 0x3 << 4 ] +-set AT91C_TCB_TC2XC2S_TCLK2 [expr 0x0 << 4 ] +-set AT91C_TCB_TC2XC2S_NONE [expr 0x1 << 4 ] +-set AT91C_TCB_TC2XC2S_TIOA0 [expr 0x2 << 4 ] +-set AT91C_TCB_TC2XC2S_TIOA1 [expr 0x3 << 4 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface +-# ***************************************************************************** +-# -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- +-set AT91C_CAN_MTIMEMARK [expr 0xFFFF << 0 ] +-set AT91C_CAN_PRIOR [expr 0xF << 16 ] +-set AT91C_CAN_MOT [expr 0x7 << 24 ] +-set AT91C_CAN_MOT_DIS [expr 0x0 << 24 ] +-set AT91C_CAN_MOT_RX [expr 0x1 << 24 ] +-set AT91C_CAN_MOT_RXOVERWRITE [expr 0x2 << 24 ] +-set AT91C_CAN_MOT_TX [expr 0x3 << 24 ] +-set AT91C_CAN_MOT_CONSUMER [expr 0x4 << 24 ] +-set AT91C_CAN_MOT_PRODUCER [expr 0x5 << 24 ] +-# -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- +-set AT91C_CAN_MIDvB [expr 0x3FFFF << 0 ] +-set AT91C_CAN_MIDvA [expr 0x7FF << 18 ] +-set AT91C_CAN_MIDE [expr 0x1 << 29 ] +-# -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- +-set AT91C_CAN_MIDvB [expr 0x3FFFF << 0 ] +-set AT91C_CAN_MIDvA [expr 0x7FF << 18 ] +-set AT91C_CAN_MIDE [expr 0x1 << 29 ] +-# -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- +-# -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- +-set AT91C_CAN_MTIMESTAMP [expr 0xFFFF << 0 ] +-set AT91C_CAN_MDLC [expr 0xF << 16 ] +-set AT91C_CAN_MRTR [expr 0x1 << 20 ] +-set AT91C_CAN_MABT [expr 0x1 << 22 ] +-set AT91C_CAN_MRDY [expr 0x1 << 23 ] +-set AT91C_CAN_MMI [expr 0x1 << 24 ] +-# -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- +-# -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- +-# -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- +-set AT91C_CAN_MDLC [expr 0xF << 16 ] +-set AT91C_CAN_MRTR [expr 0x1 << 20 ] +-set AT91C_CAN_MACR [expr 0x1 << 22 ] +-set AT91C_CAN_MTCR [expr 0x1 << 23 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Control Area Network Interface +-# ***************************************************************************** +-# -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- +-set AT91C_CAN_CANEN [expr 0x1 << 0 ] +-set AT91C_CAN_LPM [expr 0x1 << 1 ] +-set AT91C_CAN_ABM [expr 0x1 << 2 ] +-set AT91C_CAN_OVL [expr 0x1 << 3 ] +-set AT91C_CAN_TEOF [expr 0x1 << 4 ] +-set AT91C_CAN_TTM [expr 0x1 << 5 ] +-set AT91C_CAN_TIMFRZ [expr 0x1 << 6 ] +-set AT91C_CAN_DRPT [expr 0x1 << 7 ] +-# -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- +-set AT91C_CAN_MB0 [expr 0x1 << 0 ] +-set AT91C_CAN_MB1 [expr 0x1 << 1 ] +-set AT91C_CAN_MB2 [expr 0x1 << 2 ] +-set AT91C_CAN_MB3 [expr 0x1 << 3 ] +-set AT91C_CAN_MB4 [expr 0x1 << 4 ] +-set AT91C_CAN_MB5 [expr 0x1 << 5 ] +-set AT91C_CAN_MB6 [expr 0x1 << 6 ] +-set AT91C_CAN_MB7 [expr 0x1 << 7 ] +-set AT91C_CAN_MB8 [expr 0x1 << 8 ] +-set AT91C_CAN_MB9 [expr 0x1 << 9 ] +-set AT91C_CAN_MB10 [expr 0x1 << 10 ] +-set AT91C_CAN_MB11 [expr 0x1 << 11 ] +-set AT91C_CAN_MB12 [expr 0x1 << 12 ] +-set AT91C_CAN_MB13 [expr 0x1 << 13 ] +-set AT91C_CAN_MB14 [expr 0x1 << 14 ] +-set AT91C_CAN_MB15 [expr 0x1 << 15 ] +-set AT91C_CAN_ERRA [expr 0x1 << 16 ] +-set AT91C_CAN_WARN [expr 0x1 << 17 ] +-set AT91C_CAN_ERRP [expr 0x1 << 18 ] +-set AT91C_CAN_BOFF [expr 0x1 << 19 ] +-set AT91C_CAN_SLEEP [expr 0x1 << 20 ] +-set AT91C_CAN_WAKEUP [expr 0x1 << 21 ] +-set AT91C_CAN_TOVF [expr 0x1 << 22 ] +-set AT91C_CAN_TSTP [expr 0x1 << 23 ] +-set AT91C_CAN_CERR [expr 0x1 << 24 ] +-set AT91C_CAN_SERR [expr 0x1 << 25 ] +-set AT91C_CAN_AERR [expr 0x1 << 26 ] +-set AT91C_CAN_FERR [expr 0x1 << 27 ] +-set AT91C_CAN_BERR [expr 0x1 << 28 ] +-# -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- +-set AT91C_CAN_MB0 [expr 0x1 << 0 ] +-set AT91C_CAN_MB1 [expr 0x1 << 1 ] +-set AT91C_CAN_MB2 [expr 0x1 << 2 ] +-set AT91C_CAN_MB3 [expr 0x1 << 3 ] +-set AT91C_CAN_MB4 [expr 0x1 << 4 ] +-set AT91C_CAN_MB5 [expr 0x1 << 5 ] +-set AT91C_CAN_MB6 [expr 0x1 << 6 ] +-set AT91C_CAN_MB7 [expr 0x1 << 7 ] +-set AT91C_CAN_MB8 [expr 0x1 << 8 ] +-set AT91C_CAN_MB9 [expr 0x1 << 9 ] +-set AT91C_CAN_MB10 [expr 0x1 << 10 ] +-set AT91C_CAN_MB11 [expr 0x1 << 11 ] +-set AT91C_CAN_MB12 [expr 0x1 << 12 ] +-set AT91C_CAN_MB13 [expr 0x1 << 13 ] +-set AT91C_CAN_MB14 [expr 0x1 << 14 ] +-set AT91C_CAN_MB15 [expr 0x1 << 15 ] +-set AT91C_CAN_ERRA [expr 0x1 << 16 ] +-set AT91C_CAN_WARN [expr 0x1 << 17 ] +-set AT91C_CAN_ERRP [expr 0x1 << 18 ] +-set AT91C_CAN_BOFF [expr 0x1 << 19 ] +-set AT91C_CAN_SLEEP [expr 0x1 << 20 ] +-set AT91C_CAN_WAKEUP [expr 0x1 << 21 ] +-set AT91C_CAN_TOVF [expr 0x1 << 22 ] +-set AT91C_CAN_TSTP [expr 0x1 << 23 ] +-set AT91C_CAN_CERR [expr 0x1 << 24 ] +-set AT91C_CAN_SERR [expr 0x1 << 25 ] +-set AT91C_CAN_AERR [expr 0x1 << 26 ] +-set AT91C_CAN_FERR [expr 0x1 << 27 ] +-set AT91C_CAN_BERR [expr 0x1 << 28 ] +-# -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- +-set AT91C_CAN_MB0 [expr 0x1 << 0 ] +-set AT91C_CAN_MB1 [expr 0x1 << 1 ] +-set AT91C_CAN_MB2 [expr 0x1 << 2 ] +-set AT91C_CAN_MB3 [expr 0x1 << 3 ] +-set AT91C_CAN_MB4 [expr 0x1 << 4 ] +-set AT91C_CAN_MB5 [expr 0x1 << 5 ] +-set AT91C_CAN_MB6 [expr 0x1 << 6 ] +-set AT91C_CAN_MB7 [expr 0x1 << 7 ] +-set AT91C_CAN_MB8 [expr 0x1 << 8 ] +-set AT91C_CAN_MB9 [expr 0x1 << 9 ] +-set AT91C_CAN_MB10 [expr 0x1 << 10 ] +-set AT91C_CAN_MB11 [expr 0x1 << 11 ] +-set AT91C_CAN_MB12 [expr 0x1 << 12 ] +-set AT91C_CAN_MB13 [expr 0x1 << 13 ] +-set AT91C_CAN_MB14 [expr 0x1 << 14 ] +-set AT91C_CAN_MB15 [expr 0x1 << 15 ] +-set AT91C_CAN_ERRA [expr 0x1 << 16 ] +-set AT91C_CAN_WARN [expr 0x1 << 17 ] +-set AT91C_CAN_ERRP [expr 0x1 << 18 ] +-set AT91C_CAN_BOFF [expr 0x1 << 19 ] +-set AT91C_CAN_SLEEP [expr 0x1 << 20 ] +-set AT91C_CAN_WAKEUP [expr 0x1 << 21 ] +-set AT91C_CAN_TOVF [expr 0x1 << 22 ] +-set AT91C_CAN_TSTP [expr 0x1 << 23 ] +-set AT91C_CAN_CERR [expr 0x1 << 24 ] +-set AT91C_CAN_SERR [expr 0x1 << 25 ] +-set AT91C_CAN_AERR [expr 0x1 << 26 ] +-set AT91C_CAN_FERR [expr 0x1 << 27 ] +-set AT91C_CAN_BERR [expr 0x1 << 28 ] +-# -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- +-set AT91C_CAN_MB0 [expr 0x1 << 0 ] +-set AT91C_CAN_MB1 [expr 0x1 << 1 ] +-set AT91C_CAN_MB2 [expr 0x1 << 2 ] +-set AT91C_CAN_MB3 [expr 0x1 << 3 ] +-set AT91C_CAN_MB4 [expr 0x1 << 4 ] +-set AT91C_CAN_MB5 [expr 0x1 << 5 ] +-set AT91C_CAN_MB6 [expr 0x1 << 6 ] +-set AT91C_CAN_MB7 [expr 0x1 << 7 ] +-set AT91C_CAN_MB8 [expr 0x1 << 8 ] +-set AT91C_CAN_MB9 [expr 0x1 << 9 ] +-set AT91C_CAN_MB10 [expr 0x1 << 10 ] +-set AT91C_CAN_MB11 [expr 0x1 << 11 ] +-set AT91C_CAN_MB12 [expr 0x1 << 12 ] +-set AT91C_CAN_MB13 [expr 0x1 << 13 ] +-set AT91C_CAN_MB14 [expr 0x1 << 14 ] +-set AT91C_CAN_MB15 [expr 0x1 << 15 ] +-set AT91C_CAN_ERRA [expr 0x1 << 16 ] +-set AT91C_CAN_WARN [expr 0x1 << 17 ] +-set AT91C_CAN_ERRP [expr 0x1 << 18 ] +-set AT91C_CAN_BOFF [expr 0x1 << 19 ] +-set AT91C_CAN_SLEEP [expr 0x1 << 20 ] +-set AT91C_CAN_WAKEUP [expr 0x1 << 21 ] +-set AT91C_CAN_TOVF [expr 0x1 << 22 ] +-set AT91C_CAN_TSTP [expr 0x1 << 23 ] +-set AT91C_CAN_CERR [expr 0x1 << 24 ] +-set AT91C_CAN_SERR [expr 0x1 << 25 ] +-set AT91C_CAN_AERR [expr 0x1 << 26 ] +-set AT91C_CAN_FERR [expr 0x1 << 27 ] +-set AT91C_CAN_BERR [expr 0x1 << 28 ] +-set AT91C_CAN_RBSY [expr 0x1 << 29 ] +-set AT91C_CAN_TBSY [expr 0x1 << 30 ] +-set AT91C_CAN_OVLY [expr 0x1 << 31 ] +-# -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- +-set AT91C_CAN_PHASE2 [expr 0x7 << 0 ] +-set AT91C_CAN_PHASE1 [expr 0x7 << 4 ] +-set AT91C_CAN_PROPAG [expr 0x7 << 8 ] +-set AT91C_CAN_SYNC [expr 0x3 << 12 ] +-set AT91C_CAN_BRP [expr 0x7F << 16 ] +-set AT91C_CAN_SMP [expr 0x1 << 24 ] +-# -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- +-set AT91C_CAN_TIMER [expr 0xFFFF << 0 ] +-# -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- +-set AT91C_CAN_MTIMESTAMP [expr 0xFFFF << 0 ] +-# -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- +-set AT91C_CAN_REC [expr 0xFF << 0 ] +-set AT91C_CAN_TEC [expr 0xFF << 16 ] +-# -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- +-set AT91C_CAN_MB0 [expr 0x1 << 0 ] +-set AT91C_CAN_MB1 [expr 0x1 << 1 ] +-set AT91C_CAN_MB2 [expr 0x1 << 2 ] +-set AT91C_CAN_MB3 [expr 0x1 << 3 ] +-set AT91C_CAN_MB4 [expr 0x1 << 4 ] +-set AT91C_CAN_MB5 [expr 0x1 << 5 ] +-set AT91C_CAN_MB6 [expr 0x1 << 6 ] +-set AT91C_CAN_MB7 [expr 0x1 << 7 ] +-set AT91C_CAN_MB8 [expr 0x1 << 8 ] +-set AT91C_CAN_MB9 [expr 0x1 << 9 ] +-set AT91C_CAN_MB10 [expr 0x1 << 10 ] +-set AT91C_CAN_MB11 [expr 0x1 << 11 ] +-set AT91C_CAN_MB12 [expr 0x1 << 12 ] +-set AT91C_CAN_MB13 [expr 0x1 << 13 ] +-set AT91C_CAN_MB14 [expr 0x1 << 14 ] +-set AT91C_CAN_MB15 [expr 0x1 << 15 ] +-set AT91C_CAN_TIMRST [expr 0x1 << 31 ] +-# -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- +-set AT91C_CAN_MB0 [expr 0x1 << 0 ] +-set AT91C_CAN_MB1 [expr 0x1 << 1 ] +-set AT91C_CAN_MB2 [expr 0x1 << 2 ] +-set AT91C_CAN_MB3 [expr 0x1 << 3 ] +-set AT91C_CAN_MB4 [expr 0x1 << 4 ] +-set AT91C_CAN_MB5 [expr 0x1 << 5 ] +-set AT91C_CAN_MB6 [expr 0x1 << 6 ] +-set AT91C_CAN_MB7 [expr 0x1 << 7 ] +-set AT91C_CAN_MB8 [expr 0x1 << 8 ] +-set AT91C_CAN_MB9 [expr 0x1 << 9 ] +-set AT91C_CAN_MB10 [expr 0x1 << 10 ] +-set AT91C_CAN_MB11 [expr 0x1 << 11 ] +-set AT91C_CAN_MB12 [expr 0x1 << 12 ] +-set AT91C_CAN_MB13 [expr 0x1 << 13 ] +-set AT91C_CAN_MB14 [expr 0x1 << 14 ] +-set AT91C_CAN_MB15 [expr 0x1 << 15 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 +-# ***************************************************************************** +-# -------- EMAC_NCR : (EMAC Offset: 0x0) -------- +-set AT91C_EMAC_LB [expr 0x1 << 0 ] +-set AT91C_EMAC_LLB [expr 0x1 << 1 ] +-set AT91C_EMAC_RE [expr 0x1 << 2 ] +-set AT91C_EMAC_TE [expr 0x1 << 3 ] +-set AT91C_EMAC_MPE [expr 0x1 << 4 ] +-set AT91C_EMAC_CLRSTAT [expr 0x1 << 5 ] +-set AT91C_EMAC_INCSTAT [expr 0x1 << 6 ] +-set AT91C_EMAC_WESTAT [expr 0x1 << 7 ] +-set AT91C_EMAC_BP [expr 0x1 << 8 ] +-set AT91C_EMAC_TSTART [expr 0x1 << 9 ] +-set AT91C_EMAC_THALT [expr 0x1 << 10 ] +-set AT91C_EMAC_TPFR [expr 0x1 << 11 ] +-set AT91C_EMAC_TZQ [expr 0x1 << 12 ] +-# -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- +-set AT91C_EMAC_SPD [expr 0x1 << 0 ] +-set AT91C_EMAC_FD [expr 0x1 << 1 ] +-set AT91C_EMAC_JFRAME [expr 0x1 << 3 ] +-set AT91C_EMAC_CAF [expr 0x1 << 4 ] +-set AT91C_EMAC_NBC [expr 0x1 << 5 ] +-set AT91C_EMAC_MTI [expr 0x1 << 6 ] +-set AT91C_EMAC_UNI [expr 0x1 << 7 ] +-set AT91C_EMAC_BIG [expr 0x1 << 8 ] +-set AT91C_EMAC_EAE [expr 0x1 << 9 ] +-set AT91C_EMAC_CLK [expr 0x3 << 10 ] +-set AT91C_EMAC_CLK_HCLK_8 [expr 0x0 << 10 ] +-set AT91C_EMAC_CLK_HCLK_16 [expr 0x1 << 10 ] +-set AT91C_EMAC_CLK_HCLK_32 [expr 0x2 << 10 ] +-set AT91C_EMAC_CLK_HCLK_64 [expr 0x3 << 10 ] +-set AT91C_EMAC_RTY [expr 0x1 << 12 ] +-set AT91C_EMAC_PAE [expr 0x1 << 13 ] +-set AT91C_EMAC_RBOF [expr 0x3 << 14 ] +-set AT91C_EMAC_RBOF_OFFSET_0 [expr 0x0 << 14 ] +-set AT91C_EMAC_RBOF_OFFSET_1 [expr 0x1 << 14 ] +-set AT91C_EMAC_RBOF_OFFSET_2 [expr 0x2 << 14 ] +-set AT91C_EMAC_RBOF_OFFSET_3 [expr 0x3 << 14 ] +-set AT91C_EMAC_RLCE [expr 0x1 << 16 ] +-set AT91C_EMAC_DRFCS [expr 0x1 << 17 ] +-set AT91C_EMAC_EFRHD [expr 0x1 << 18 ] +-set AT91C_EMAC_IRXFCS [expr 0x1 << 19 ] +-# -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- +-set AT91C_EMAC_LINKR [expr 0x1 << 0 ] +-set AT91C_EMAC_MDIO [expr 0x1 << 1 ] +-set AT91C_EMAC_IDLE [expr 0x1 << 2 ] +-# -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- +-set AT91C_EMAC_UBR [expr 0x1 << 0 ] +-set AT91C_EMAC_COL [expr 0x1 << 1 ] +-set AT91C_EMAC_RLES [expr 0x1 << 2 ] +-set AT91C_EMAC_TGO [expr 0x1 << 3 ] +-set AT91C_EMAC_BEX [expr 0x1 << 4 ] +-set AT91C_EMAC_COMP [expr 0x1 << 5 ] +-set AT91C_EMAC_UND [expr 0x1 << 6 ] +-# -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- +-set AT91C_EMAC_BNA [expr 0x1 << 0 ] +-set AT91C_EMAC_REC [expr 0x1 << 1 ] +-set AT91C_EMAC_OVR [expr 0x1 << 2 ] +-# -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- +-set AT91C_EMAC_MFD [expr 0x1 << 0 ] +-set AT91C_EMAC_RCOMP [expr 0x1 << 1 ] +-set AT91C_EMAC_RXUBR [expr 0x1 << 2 ] +-set AT91C_EMAC_TXUBR [expr 0x1 << 3 ] +-set AT91C_EMAC_TUNDR [expr 0x1 << 4 ] +-set AT91C_EMAC_RLEX [expr 0x1 << 5 ] +-set AT91C_EMAC_TXERR [expr 0x1 << 6 ] +-set AT91C_EMAC_TCOMP [expr 0x1 << 7 ] +-set AT91C_EMAC_LINK [expr 0x1 << 9 ] +-set AT91C_EMAC_ROVR [expr 0x1 << 10 ] +-set AT91C_EMAC_HRESP [expr 0x1 << 11 ] +-set AT91C_EMAC_PFRE [expr 0x1 << 12 ] +-set AT91C_EMAC_PTZ [expr 0x1 << 13 ] +-# -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- +-set AT91C_EMAC_MFD [expr 0x1 << 0 ] +-set AT91C_EMAC_RCOMP [expr 0x1 << 1 ] +-set AT91C_EMAC_RXUBR [expr 0x1 << 2 ] +-set AT91C_EMAC_TXUBR [expr 0x1 << 3 ] +-set AT91C_EMAC_TUNDR [expr 0x1 << 4 ] +-set AT91C_EMAC_RLEX [expr 0x1 << 5 ] +-set AT91C_EMAC_TXERR [expr 0x1 << 6 ] +-set AT91C_EMAC_TCOMP [expr 0x1 << 7 ] +-set AT91C_EMAC_LINK [expr 0x1 << 9 ] +-set AT91C_EMAC_ROVR [expr 0x1 << 10 ] +-set AT91C_EMAC_HRESP [expr 0x1 << 11 ] +-set AT91C_EMAC_PFRE [expr 0x1 << 12 ] +-set AT91C_EMAC_PTZ [expr 0x1 << 13 ] +-# -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- +-set AT91C_EMAC_MFD [expr 0x1 << 0 ] +-set AT91C_EMAC_RCOMP [expr 0x1 << 1 ] +-set AT91C_EMAC_RXUBR [expr 0x1 << 2 ] +-set AT91C_EMAC_TXUBR [expr 0x1 << 3 ] +-set AT91C_EMAC_TUNDR [expr 0x1 << 4 ] +-set AT91C_EMAC_RLEX [expr 0x1 << 5 ] +-set AT91C_EMAC_TXERR [expr 0x1 << 6 ] +-set AT91C_EMAC_TCOMP [expr 0x1 << 7 ] +-set AT91C_EMAC_LINK [expr 0x1 << 9 ] +-set AT91C_EMAC_ROVR [expr 0x1 << 10 ] +-set AT91C_EMAC_HRESP [expr 0x1 << 11 ] +-set AT91C_EMAC_PFRE [expr 0x1 << 12 ] +-set AT91C_EMAC_PTZ [expr 0x1 << 13 ] +-# -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- +-set AT91C_EMAC_MFD [expr 0x1 << 0 ] +-set AT91C_EMAC_RCOMP [expr 0x1 << 1 ] +-set AT91C_EMAC_RXUBR [expr 0x1 << 2 ] +-set AT91C_EMAC_TXUBR [expr 0x1 << 3 ] +-set AT91C_EMAC_TUNDR [expr 0x1 << 4 ] +-set AT91C_EMAC_RLEX [expr 0x1 << 5 ] +-set AT91C_EMAC_TXERR [expr 0x1 << 6 ] +-set AT91C_EMAC_TCOMP [expr 0x1 << 7 ] +-set AT91C_EMAC_LINK [expr 0x1 << 9 ] +-set AT91C_EMAC_ROVR [expr 0x1 << 10 ] +-set AT91C_EMAC_HRESP [expr 0x1 << 11 ] +-set AT91C_EMAC_PFRE [expr 0x1 << 12 ] +-set AT91C_EMAC_PTZ [expr 0x1 << 13 ] +-# -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- +-set AT91C_EMAC_DATA [expr 0xFFFF << 0 ] +-set AT91C_EMAC_CODE [expr 0x3 << 16 ] +-set AT91C_EMAC_REGA [expr 0x1F << 18 ] +-set AT91C_EMAC_PHYA [expr 0x1F << 23 ] +-set AT91C_EMAC_RW [expr 0x3 << 28 ] +-set AT91C_EMAC_SOF [expr 0x3 << 30 ] +-# -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- +-set AT91C_EMAC_RMII [expr 0x1 << 0 ] +-set AT91C_EMAC_CLKEN [expr 0x1 << 1 ] +-# -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- +-set AT91C_EMAC_IP [expr 0xFFFF << 0 ] +-set AT91C_EMAC_MAG [expr 0x1 << 16 ] +-set AT91C_EMAC_ARP [expr 0x1 << 17 ] +-set AT91C_EMAC_SA1 [expr 0x1 << 18 ] +-set AT91C_EMAC_MTI [expr 0x1 << 19 ] +-# -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- +-set AT91C_EMAC_REVREF [expr 0xFFFF << 0 ] +-set AT91C_EMAC_PARTREF [expr 0xFFFF << 16 ] +- +-# ***************************************************************************** +-# SOFTWARE API DEFINITION FOR Analog to Digital Convertor +-# ***************************************************************************** +-# -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- +-set AT91C_ADC_SWRST [expr 0x1 << 0 ] +-set AT91C_ADC_START [expr 0x1 << 1 ] +-# -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- +-set AT91C_ADC_TRGEN [expr 0x1 << 0 ] +-set AT91C_ADC_TRGEN_DIS 0x0 +-set AT91C_ADC_TRGEN_EN 0x1 +-set AT91C_ADC_TRGSEL [expr 0x7 << 1 ] +-set AT91C_ADC_TRGSEL_TIOA0 [expr 0x0 << 1 ] +-set AT91C_ADC_TRGSEL_TIOA1 [expr 0x1 << 1 ] +-set AT91C_ADC_TRGSEL_TIOA2 [expr 0x2 << 1 ] +-set AT91C_ADC_TRGSEL_TIOA3 [expr 0x3 << 1 ] +-set AT91C_ADC_TRGSEL_TIOA4 [expr 0x4 << 1 ] +-set AT91C_ADC_TRGSEL_TIOA5 [expr 0x5 << 1 ] +-set AT91C_ADC_TRGSEL_EXT [expr 0x6 << 1 ] +-set AT91C_ADC_LOWRES [expr 0x1 << 4 ] +-set AT91C_ADC_LOWRES_10_BIT [expr 0x0 << 4 ] +-set AT91C_ADC_LOWRES_8_BIT [expr 0x1 << 4 ] +-set AT91C_ADC_SLEEP [expr 0x1 << 5 ] +-set AT91C_ADC_SLEEP_NORMAL_MODE [expr 0x0 << 5 ] +-set AT91C_ADC_SLEEP_MODE [expr 0x1 << 5 ] +-set AT91C_ADC_PRESCAL [expr 0x3F << 8 ] +-set AT91C_ADC_STARTUP [expr 0x1F << 16 ] +-set AT91C_ADC_SHTIM [expr 0xF << 24 ] +-# -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- +-set AT91C_ADC_CH0 [expr 0x1 << 0 ] +-set AT91C_ADC_CH1 [expr 0x1 << 1 ] +-set AT91C_ADC_CH2 [expr 0x1 << 2 ] +-set AT91C_ADC_CH3 [expr 0x1 << 3 ] +-set AT91C_ADC_CH4 [expr 0x1 << 4 ] +-set AT91C_ADC_CH5 [expr 0x1 << 5 ] +-set AT91C_ADC_CH6 [expr 0x1 << 6 ] +-set AT91C_ADC_CH7 [expr 0x1 << 7 ] +-# -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- +-set AT91C_ADC_CH0 [expr 0x1 << 0 ] +-set AT91C_ADC_CH1 [expr 0x1 << 1 ] +-set AT91C_ADC_CH2 [expr 0x1 << 2 ] +-set AT91C_ADC_CH3 [expr 0x1 << 3 ] +-set AT91C_ADC_CH4 [expr 0x1 << 4 ] +-set AT91C_ADC_CH5 [expr 0x1 << 5 ] +-set AT91C_ADC_CH6 [expr 0x1 << 6 ] +-set AT91C_ADC_CH7 [expr 0x1 << 7 ] +-# -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- +-set AT91C_ADC_CH0 [expr 0x1 << 0 ] +-set AT91C_ADC_CH1 [expr 0x1 << 1 ] +-set AT91C_ADC_CH2 [expr 0x1 << 2 ] +-set AT91C_ADC_CH3 [expr 0x1 << 3 ] +-set AT91C_ADC_CH4 [expr 0x1 << 4 ] +-set AT91C_ADC_CH5 [expr 0x1 << 5 ] +-set AT91C_ADC_CH6 [expr 0x1 << 6 ] +-set AT91C_ADC_CH7 [expr 0x1 << 7 ] +-# -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- +-set AT91C_ADC_EOC0 [expr 0x1 << 0 ] +-set AT91C_ADC_EOC1 [expr 0x1 << 1 ] +-set AT91C_ADC_EOC2 [expr 0x1 << 2 ] +-set AT91C_ADC_EOC3 [expr 0x1 << 3 ] +-set AT91C_ADC_EOC4 [expr 0x1 << 4 ] +-set AT91C_ADC_EOC5 [expr 0x1 << 5 ] +-set AT91C_ADC_EOC6 [expr 0x1 << 6 ] +-set AT91C_ADC_EOC7 [expr 0x1 << 7 ] +-set AT91C_ADC_OVRE0 [expr 0x1 << 8 ] +-set AT91C_ADC_OVRE1 [expr 0x1 << 9 ] +-set AT91C_ADC_OVRE2 [expr 0x1 << 10 ] +-set AT91C_ADC_OVRE3 [expr 0x1 << 11 ] +-set AT91C_ADC_OVRE4 [expr 0x1 << 12 ] +-set AT91C_ADC_OVRE5 [expr 0x1 << 13 ] +-set AT91C_ADC_OVRE6 [expr 0x1 << 14 ] +-set AT91C_ADC_OVRE7 [expr 0x1 << 15 ] +-set AT91C_ADC_DRDY [expr 0x1 << 16 ] +-set AT91C_ADC_GOVRE [expr 0x1 << 17 ] +-set AT91C_ADC_ENDRX [expr 0x1 << 18 ] +-set AT91C_ADC_RXBUFF [expr 0x1 << 19 ] +-# -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- +-set AT91C_ADC_LDATA [expr 0x3FF << 0 ] +-# -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- +-set AT91C_ADC_EOC0 [expr 0x1 << 0 ] +-set AT91C_ADC_EOC1 [expr 0x1 << 1 ] +-set AT91C_ADC_EOC2 [expr 0x1 << 2 ] +-set AT91C_ADC_EOC3 [expr 0x1 << 3 ] +-set AT91C_ADC_EOC4 [expr 0x1 << 4 ] +-set AT91C_ADC_EOC5 [expr 0x1 << 5 ] +-set AT91C_ADC_EOC6 [expr 0x1 << 6 ] +-set AT91C_ADC_EOC7 [expr 0x1 << 7 ] +-set AT91C_ADC_OVRE0 [expr 0x1 << 8 ] +-set AT91C_ADC_OVRE1 [expr 0x1 << 9 ] +-set AT91C_ADC_OVRE2 [expr 0x1 << 10 ] +-set AT91C_ADC_OVRE3 [expr 0x1 << 11 ] +-set AT91C_ADC_OVRE4 [expr 0x1 << 12 ] +-set AT91C_ADC_OVRE5 [expr 0x1 << 13 ] +-set AT91C_ADC_OVRE6 [expr 0x1 << 14 ] +-set AT91C_ADC_OVRE7 [expr 0x1 << 15 ] +-set AT91C_ADC_DRDY [expr 0x1 << 16 ] +-set AT91C_ADC_GOVRE [expr 0x1 << 17 ] +-set AT91C_ADC_ENDRX [expr 0x1 << 18 ] +-set AT91C_ADC_RXBUFF [expr 0x1 << 19 ] +-# -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- +-set AT91C_ADC_EOC0 [expr 0x1 << 0 ] +-set AT91C_ADC_EOC1 [expr 0x1 << 1 ] +-set AT91C_ADC_EOC2 [expr 0x1 << 2 ] +-set AT91C_ADC_EOC3 [expr 0x1 << 3 ] +-set AT91C_ADC_EOC4 [expr 0x1 << 4 ] +-set AT91C_ADC_EOC5 [expr 0x1 << 5 ] +-set AT91C_ADC_EOC6 [expr 0x1 << 6 ] +-set AT91C_ADC_EOC7 [expr 0x1 << 7 ] +-set AT91C_ADC_OVRE0 [expr 0x1 << 8 ] +-set AT91C_ADC_OVRE1 [expr 0x1 << 9 ] +-set AT91C_ADC_OVRE2 [expr 0x1 << 10 ] +-set AT91C_ADC_OVRE3 [expr 0x1 << 11 ] +-set AT91C_ADC_OVRE4 [expr 0x1 << 12 ] +-set AT91C_ADC_OVRE5 [expr 0x1 << 13 ] +-set AT91C_ADC_OVRE6 [expr 0x1 << 14 ] +-set AT91C_ADC_OVRE7 [expr 0x1 << 15 ] +-set AT91C_ADC_DRDY [expr 0x1 << 16 ] +-set AT91C_ADC_GOVRE [expr 0x1 << 17 ] +-set AT91C_ADC_ENDRX [expr 0x1 << 18 ] +-set AT91C_ADC_RXBUFF [expr 0x1 << 19 ] +-# -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- +-set AT91C_ADC_EOC0 [expr 0x1 << 0 ] +-set AT91C_ADC_EOC1 [expr 0x1 << 1 ] +-set AT91C_ADC_EOC2 [expr 0x1 << 2 ] +-set AT91C_ADC_EOC3 [expr 0x1 << 3 ] +-set AT91C_ADC_EOC4 [expr 0x1 << 4 ] +-set AT91C_ADC_EOC5 [expr 0x1 << 5 ] +-set AT91C_ADC_EOC6 [expr 0x1 << 6 ] +-set AT91C_ADC_EOC7 [expr 0x1 << 7 ] +-set AT91C_ADC_OVRE0 [expr 0x1 << 8 ] +-set AT91C_ADC_OVRE1 [expr 0x1 << 9 ] +-set AT91C_ADC_OVRE2 [expr 0x1 << 10 ] +-set AT91C_ADC_OVRE3 [expr 0x1 << 11 ] +-set AT91C_ADC_OVRE4 [expr 0x1 << 12 ] +-set AT91C_ADC_OVRE5 [expr 0x1 << 13 ] +-set AT91C_ADC_OVRE6 [expr 0x1 << 14 ] +-set AT91C_ADC_OVRE7 [expr 0x1 << 15 ] +-set AT91C_ADC_DRDY [expr 0x1 << 16 ] +-set AT91C_ADC_GOVRE [expr 0x1 << 17 ] +-set AT91C_ADC_ENDRX [expr 0x1 << 18 ] +-set AT91C_ADC_RXBUFF [expr 0x1 << 19 ] +-# -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- +-set AT91C_ADC_DATA [expr 0x3FF << 0 ] +-# -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- +-set AT91C_ADC_DATA [expr 0x3FF << 0 ] +-# -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- +-set AT91C_ADC_DATA [expr 0x3FF << 0 ] +-# -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- +-set AT91C_ADC_DATA [expr 0x3FF << 0 ] +-# -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- +-set AT91C_ADC_DATA [expr 0x3FF << 0 ] +-# -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- +-set AT91C_ADC_DATA [expr 0x3FF << 0 ] +-# -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- +-set AT91C_ADC_DATA [expr 0x3FF << 0 ] +-# -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- +-set AT91C_ADC_DATA [expr 0x3FF << 0 ] +- +-# ***************************************************************************** +-# REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 +-# ***************************************************************************** +-# ========== Register definition for SYS peripheral ========== +-# ========== Register definition for AIC peripheral ========== +-set AT91C_AIC_IVR 0xFFFFF100 +-set AT91C_AIC_SMR 0xFFFFF000 +-set AT91C_AIC_FVR 0xFFFFF104 +-set AT91C_AIC_DCR 0xFFFFF138 +-set AT91C_AIC_EOICR 0xFFFFF130 +-set AT91C_AIC_SVR 0xFFFFF080 +-set AT91C_AIC_FFSR 0xFFFFF148 +-set AT91C_AIC_ICCR 0xFFFFF128 +-set AT91C_AIC_ISR 0xFFFFF108 +-set AT91C_AIC_IMR 0xFFFFF110 +-set AT91C_AIC_IPR 0xFFFFF10C +-set AT91C_AIC_FFER 0xFFFFF140 +-set AT91C_AIC_IECR 0xFFFFF120 +-set AT91C_AIC_ISCR 0xFFFFF12C +-set AT91C_AIC_FFDR 0xFFFFF144 +-set AT91C_AIC_CISR 0xFFFFF114 +-set AT91C_AIC_IDCR 0xFFFFF124 +-set AT91C_AIC_SPU 0xFFFFF134 +-# ========== Register definition for PDC_DBGU peripheral ========== +-set AT91C_DBGU_TCR 0xFFFFF30C +-set AT91C_DBGU_RNPR 0xFFFFF310 +-set AT91C_DBGU_TNPR 0xFFFFF318 +-set AT91C_DBGU_TPR 0xFFFFF308 +-set AT91C_DBGU_RPR 0xFFFFF300 +-set AT91C_DBGU_RCR 0xFFFFF304 +-set AT91C_DBGU_RNCR 0xFFFFF314 +-set AT91C_DBGU_PTCR 0xFFFFF320 +-set AT91C_DBGU_PTSR 0xFFFFF324 +-set AT91C_DBGU_TNCR 0xFFFFF31C +-# ========== Register definition for DBGU peripheral ========== +-set AT91C_DBGU_EXID 0xFFFFF244 +-set AT91C_DBGU_BRGR 0xFFFFF220 +-set AT91C_DBGU_IDR 0xFFFFF20C +-set AT91C_DBGU_CSR 0xFFFFF214 +-set AT91C_DBGU_CIDR 0xFFFFF240 +-set AT91C_DBGU_MR 0xFFFFF204 +-set AT91C_DBGU_IMR 0xFFFFF210 +-set AT91C_DBGU_CR 0xFFFFF200 +-set AT91C_DBGU_FNTR 0xFFFFF248 +-set AT91C_DBGU_THR 0xFFFFF21C +-set AT91C_DBGU_RHR 0xFFFFF218 +-set AT91C_DBGU_IER 0xFFFFF208 +-# ========== Register definition for PIOA peripheral ========== +-set AT91C_PIOA_ODR 0xFFFFF414 +-set AT91C_PIOA_SODR 0xFFFFF430 +-set AT91C_PIOA_ISR 0xFFFFF44C +-set AT91C_PIOA_ABSR 0xFFFFF478 +-set AT91C_PIOA_IER 0xFFFFF440 +-set AT91C_PIOA_PPUDR 0xFFFFF460 +-set AT91C_PIOA_IMR 0xFFFFF448 +-set AT91C_PIOA_PER 0xFFFFF400 +-set AT91C_PIOA_IFDR 0xFFFFF424 +-set AT91C_PIOA_OWDR 0xFFFFF4A4 +-set AT91C_PIOA_MDSR 0xFFFFF458 +-set AT91C_PIOA_IDR 0xFFFFF444 +-set AT91C_PIOA_ODSR 0xFFFFF438 +-set AT91C_PIOA_PPUSR 0xFFFFF468 +-set AT91C_PIOA_OWSR 0xFFFFF4A8 +-set AT91C_PIOA_BSR 0xFFFFF474 +-set AT91C_PIOA_OWER 0xFFFFF4A0 +-set AT91C_PIOA_IFER 0xFFFFF420 +-set AT91C_PIOA_PDSR 0xFFFFF43C +-set AT91C_PIOA_PPUER 0xFFFFF464 +-set AT91C_PIOA_OSR 0xFFFFF418 +-set AT91C_PIOA_ASR 0xFFFFF470 +-set AT91C_PIOA_MDDR 0xFFFFF454 +-set AT91C_PIOA_CODR 0xFFFFF434 +-set AT91C_PIOA_MDER 0xFFFFF450 +-set AT91C_PIOA_PDR 0xFFFFF404 +-set AT91C_PIOA_IFSR 0xFFFFF428 +-set AT91C_PIOA_OER 0xFFFFF410 +-set AT91C_PIOA_PSR 0xFFFFF408 +-# ========== Register definition for PIOB peripheral ========== +-set AT91C_PIOB_OWDR 0xFFFFF6A4 +-set AT91C_PIOB_MDER 0xFFFFF650 +-set AT91C_PIOB_PPUSR 0xFFFFF668 +-set AT91C_PIOB_IMR 0xFFFFF648 +-set AT91C_PIOB_ASR 0xFFFFF670 +-set AT91C_PIOB_PPUDR 0xFFFFF660 +-set AT91C_PIOB_PSR 0xFFFFF608 +-set AT91C_PIOB_IER 0xFFFFF640 +-set AT91C_PIOB_CODR 0xFFFFF634 +-set AT91C_PIOB_OWER 0xFFFFF6A0 +-set AT91C_PIOB_ABSR 0xFFFFF678 +-set AT91C_PIOB_IFDR 0xFFFFF624 +-set AT91C_PIOB_PDSR 0xFFFFF63C +-set AT91C_PIOB_IDR 0xFFFFF644 +-set AT91C_PIOB_OWSR 0xFFFFF6A8 +-set AT91C_PIOB_PDR 0xFFFFF604 +-set AT91C_PIOB_ODR 0xFFFFF614 +-set AT91C_PIOB_IFSR 0xFFFFF628 +-set AT91C_PIOB_PPUER 0xFFFFF664 +-set AT91C_PIOB_SODR 0xFFFFF630 +-set AT91C_PIOB_ISR 0xFFFFF64C +-set AT91C_PIOB_ODSR 0xFFFFF638 +-set AT91C_PIOB_OSR 0xFFFFF618 +-set AT91C_PIOB_MDSR 0xFFFFF658 +-set AT91C_PIOB_IFER 0xFFFFF620 +-set AT91C_PIOB_BSR 0xFFFFF674 +-set AT91C_PIOB_MDDR 0xFFFFF654 +-set AT91C_PIOB_OER 0xFFFFF610 +-set AT91C_PIOB_PER 0xFFFFF600 +-# ========== Register definition for CKGR peripheral ========== +-set AT91C_CKGR_MOR 0xFFFFFC20 +-set AT91C_CKGR_PLLR 0xFFFFFC2C +-set AT91C_CKGR_MCFR 0xFFFFFC24 +-# ========== Register definition for PMC peripheral ========== +-set AT91C_PMC_IDR 0xFFFFFC64 +-set AT91C_PMC_MOR 0xFFFFFC20 +-set AT91C_PMC_PLLR 0xFFFFFC2C +-set AT91C_PMC_PCER 0xFFFFFC10 +-set AT91C_PMC_PCKR 0xFFFFFC40 +-set AT91C_PMC_MCKR 0xFFFFFC30 +-set AT91C_PMC_SCDR 0xFFFFFC04 +-set AT91C_PMC_PCDR 0xFFFFFC14 +-set AT91C_PMC_SCSR 0xFFFFFC08 +-set AT91C_PMC_PCSR 0xFFFFFC18 +-set AT91C_PMC_MCFR 0xFFFFFC24 +-set AT91C_PMC_SCER 0xFFFFFC00 +-set AT91C_PMC_IMR 0xFFFFFC6C +-set AT91C_PMC_IER 0xFFFFFC60 +-set AT91C_PMC_SR 0xFFFFFC68 +-# ========== Register definition for RSTC peripheral ========== +-set AT91C_RSTC_RCR 0xFFFFFD00 +-set AT91C_RSTC_RMR 0xFFFFFD08 +-set AT91C_RSTC_RSR 0xFFFFFD04 +-# ========== Register definition for RTTC peripheral ========== +-set AT91C_RTTC_RTSR 0xFFFFFD2C +-set AT91C_RTTC_RTMR 0xFFFFFD20 +-set AT91C_RTTC_RTVR 0xFFFFFD28 +-set AT91C_RTTC_RTAR 0xFFFFFD24 +-# ========== Register definition for PITC peripheral ========== +-set AT91C_PITC_PIVR 0xFFFFFD38 +-set AT91C_PITC_PISR 0xFFFFFD34 +-set AT91C_PITC_PIIR 0xFFFFFD3C +-set AT91C_PITC_PIMR 0xFFFFFD30 +-# ========== Register definition for WDTC peripheral ========== +-set AT91C_WDTC_WDCR 0xFFFFFD40 +-set AT91C_WDTC_WDSR 0xFFFFFD48 +-set AT91C_WDTC_WDMR 0xFFFFFD44 +-# ========== Register definition for VREG peripheral ========== +-set AT91C_VREG_MR 0xFFFFFD60 +-# ========== Register definition for MC peripheral ========== +-set AT91C_MC_ASR 0xFFFFFF04 +-set AT91C_MC_RCR 0xFFFFFF00 +-set AT91C_MC_FCR 0xFFFFFF64 +-set AT91C_MC_AASR 0xFFFFFF08 +-set AT91C_MC_FSR 0xFFFFFF68 +-set AT91C_MC_FMR 0xFFFFFF60 +-# ========== Register definition for PDC_SPI1 peripheral ========== +-set AT91C_SPI1_PTCR 0xFFFE4120 +-set AT91C_SPI1_RPR 0xFFFE4100 +-set AT91C_SPI1_TNCR 0xFFFE411C +-set AT91C_SPI1_TPR 0xFFFE4108 +-set AT91C_SPI1_TNPR 0xFFFE4118 +-set AT91C_SPI1_TCR 0xFFFE410C +-set AT91C_SPI1_RCR 0xFFFE4104 +-set AT91C_SPI1_RNPR 0xFFFE4110 +-set AT91C_SPI1_RNCR 0xFFFE4114 +-set AT91C_SPI1_PTSR 0xFFFE4124 +-# ========== Register definition for SPI1 peripheral ========== +-set AT91C_SPI1_IMR 0xFFFE401C +-set AT91C_SPI1_IER 0xFFFE4014 +-set AT91C_SPI1_MR 0xFFFE4004 +-set AT91C_SPI1_RDR 0xFFFE4008 +-set AT91C_SPI1_IDR 0xFFFE4018 +-set AT91C_SPI1_SR 0xFFFE4010 +-set AT91C_SPI1_TDR 0xFFFE400C +-set AT91C_SPI1_CR 0xFFFE4000 +-set AT91C_SPI1_CSR 0xFFFE4030 +-# ========== Register definition for PDC_SPI0 peripheral ========== +-set AT91C_SPI0_PTCR 0xFFFE0120 +-set AT91C_SPI0_TPR 0xFFFE0108 +-set AT91C_SPI0_TCR 0xFFFE010C +-set AT91C_SPI0_RCR 0xFFFE0104 +-set AT91C_SPI0_PTSR 0xFFFE0124 +-set AT91C_SPI0_RNPR 0xFFFE0110 +-set AT91C_SPI0_RPR 0xFFFE0100 +-set AT91C_SPI0_TNCR 0xFFFE011C +-set AT91C_SPI0_RNCR 0xFFFE0114 +-set AT91C_SPI0_TNPR 0xFFFE0118 +-# ========== Register definition for SPI0 peripheral ========== +-set AT91C_SPI0_IER 0xFFFE0014 +-set AT91C_SPI0_SR 0xFFFE0010 +-set AT91C_SPI0_IDR 0xFFFE0018 +-set AT91C_SPI0_CR 0xFFFE0000 +-set AT91C_SPI0_MR 0xFFFE0004 +-set AT91C_SPI0_IMR 0xFFFE001C +-set AT91C_SPI0_TDR 0xFFFE000C +-set AT91C_SPI0_RDR 0xFFFE0008 +-set AT91C_SPI0_CSR 0xFFFE0030 +-# ========== Register definition for PDC_US1 peripheral ========== +-set AT91C_US1_RNCR 0xFFFC4114 +-set AT91C_US1_PTCR 0xFFFC4120 +-set AT91C_US1_TCR 0xFFFC410C +-set AT91C_US1_PTSR 0xFFFC4124 +-set AT91C_US1_TNPR 0xFFFC4118 +-set AT91C_US1_RCR 0xFFFC4104 +-set AT91C_US1_RNPR 0xFFFC4110 +-set AT91C_US1_RPR 0xFFFC4100 +-set AT91C_US1_TNCR 0xFFFC411C +-set AT91C_US1_TPR 0xFFFC4108 +-# ========== Register definition for US1 peripheral ========== +-set AT91C_US1_IF 0xFFFC404C +-set AT91C_US1_NER 0xFFFC4044 +-set AT91C_US1_RTOR 0xFFFC4024 +-set AT91C_US1_CSR 0xFFFC4014 +-set AT91C_US1_IDR 0xFFFC400C +-set AT91C_US1_IER 0xFFFC4008 +-set AT91C_US1_THR 0xFFFC401C +-set AT91C_US1_TTGR 0xFFFC4028 +-set AT91C_US1_RHR 0xFFFC4018 +-set AT91C_US1_BRGR 0xFFFC4020 +-set AT91C_US1_IMR 0xFFFC4010 +-set AT91C_US1_FIDI 0xFFFC4040 +-set AT91C_US1_CR 0xFFFC4000 +-set AT91C_US1_MR 0xFFFC4004 +-# ========== Register definition for PDC_US0 peripheral ========== +-set AT91C_US0_TNPR 0xFFFC0118 +-set AT91C_US0_RNPR 0xFFFC0110 +-set AT91C_US0_TCR 0xFFFC010C +-set AT91C_US0_PTCR 0xFFFC0120 +-set AT91C_US0_PTSR 0xFFFC0124 +-set AT91C_US0_TNCR 0xFFFC011C +-set AT91C_US0_TPR 0xFFFC0108 +-set AT91C_US0_RCR 0xFFFC0104 +-set AT91C_US0_RPR 0xFFFC0100 +-set AT91C_US0_RNCR 0xFFFC0114 +-# ========== Register definition for US0 peripheral ========== +-set AT91C_US0_BRGR 0xFFFC0020 +-set AT91C_US0_NER 0xFFFC0044 +-set AT91C_US0_CR 0xFFFC0000 +-set AT91C_US0_IMR 0xFFFC0010 +-set AT91C_US0_FIDI 0xFFFC0040 +-set AT91C_US0_TTGR 0xFFFC0028 +-set AT91C_US0_MR 0xFFFC0004 +-set AT91C_US0_RTOR 0xFFFC0024 +-set AT91C_US0_CSR 0xFFFC0014 +-set AT91C_US0_RHR 0xFFFC0018 +-set AT91C_US0_IDR 0xFFFC000C +-set AT91C_US0_THR 0xFFFC001C +-set AT91C_US0_IF 0xFFFC004C +-set AT91C_US0_IER 0xFFFC0008 +-# ========== Register definition for PDC_SSC peripheral ========== +-set AT91C_SSC_TNCR 0xFFFD411C +-set AT91C_SSC_RPR 0xFFFD4100 +-set AT91C_SSC_RNCR 0xFFFD4114 +-set AT91C_SSC_TPR 0xFFFD4108 +-set AT91C_SSC_PTCR 0xFFFD4120 +-set AT91C_SSC_TCR 0xFFFD410C +-set AT91C_SSC_RCR 0xFFFD4104 +-set AT91C_SSC_RNPR 0xFFFD4110 +-set AT91C_SSC_TNPR 0xFFFD4118 +-set AT91C_SSC_PTSR 0xFFFD4124 +-# ========== Register definition for SSC peripheral ========== +-set AT91C_SSC_RHR 0xFFFD4020 +-set AT91C_SSC_RSHR 0xFFFD4030 +-set AT91C_SSC_TFMR 0xFFFD401C +-set AT91C_SSC_IDR 0xFFFD4048 +-set AT91C_SSC_THR 0xFFFD4024 +-set AT91C_SSC_RCMR 0xFFFD4010 +-set AT91C_SSC_IER 0xFFFD4044 +-set AT91C_SSC_TSHR 0xFFFD4034 +-set AT91C_SSC_SR 0xFFFD4040 +-set AT91C_SSC_CMR 0xFFFD4004 +-set AT91C_SSC_TCMR 0xFFFD4018 +-set AT91C_SSC_CR 0xFFFD4000 +-set AT91C_SSC_IMR 0xFFFD404C +-set AT91C_SSC_RFMR 0xFFFD4014 +-# ========== Register definition for TWI peripheral ========== +-set AT91C_TWI_IER 0xFFFB8024 +-set AT91C_TWI_CR 0xFFFB8000 +-set AT91C_TWI_SR 0xFFFB8020 +-set AT91C_TWI_IMR 0xFFFB802C +-set AT91C_TWI_THR 0xFFFB8034 +-set AT91C_TWI_IDR 0xFFFB8028 +-set AT91C_TWI_IADR 0xFFFB800C +-set AT91C_TWI_MMR 0xFFFB8004 +-set AT91C_TWI_CWGR 0xFFFB8010 +-set AT91C_TWI_RHR 0xFFFB8030 +-# ========== Register definition for PWMC_CH3 peripheral ========== +-set AT91C_PWMC_CH3_CUPDR 0xFFFCC270 +-set AT91C_PWMC_CH3_Reserved 0xFFFCC274 +-set AT91C_PWMC_CH3_CPRDR 0xFFFCC268 +-set AT91C_PWMC_CH3_CDTYR 0xFFFCC264 +-set AT91C_PWMC_CH3_CCNTR 0xFFFCC26C +-set AT91C_PWMC_CH3_CMR 0xFFFCC260 +-# ========== Register definition for PWMC_CH2 peripheral ========== +-set AT91C_PWMC_CH2_Reserved 0xFFFCC254 +-set AT91C_PWMC_CH2_CMR 0xFFFCC240 +-set AT91C_PWMC_CH2_CCNTR 0xFFFCC24C +-set AT91C_PWMC_CH2_CPRDR 0xFFFCC248 +-set AT91C_PWMC_CH2_CUPDR 0xFFFCC250 +-set AT91C_PWMC_CH2_CDTYR 0xFFFCC244 +-# ========== Register definition for PWMC_CH1 peripheral ========== +-set AT91C_PWMC_CH1_Reserved 0xFFFCC234 +-set AT91C_PWMC_CH1_CUPDR 0xFFFCC230 +-set AT91C_PWMC_CH1_CPRDR 0xFFFCC228 +-set AT91C_PWMC_CH1_CCNTR 0xFFFCC22C +-set AT91C_PWMC_CH1_CDTYR 0xFFFCC224 +-set AT91C_PWMC_CH1_CMR 0xFFFCC220 +-# ========== Register definition for PWMC_CH0 peripheral ========== +-set AT91C_PWMC_CH0_Reserved 0xFFFCC214 +-set AT91C_PWMC_CH0_CPRDR 0xFFFCC208 +-set AT91C_PWMC_CH0_CDTYR 0xFFFCC204 +-set AT91C_PWMC_CH0_CMR 0xFFFCC200 +-set AT91C_PWMC_CH0_CUPDR 0xFFFCC210 +-set AT91C_PWMC_CH0_CCNTR 0xFFFCC20C +-# ========== Register definition for PWMC peripheral ========== +-set AT91C_PWMC_IDR 0xFFFCC014 +-set AT91C_PWMC_DIS 0xFFFCC008 +-set AT91C_PWMC_IER 0xFFFCC010 +-set AT91C_PWMC_VR 0xFFFCC0FC +-set AT91C_PWMC_ISR 0xFFFCC01C +-set AT91C_PWMC_SR 0xFFFCC00C +-set AT91C_PWMC_IMR 0xFFFCC018 +-set AT91C_PWMC_MR 0xFFFCC000 +-set AT91C_PWMC_ENA 0xFFFCC004 +-# ========== Register definition for UDP peripheral ========== +-set AT91C_UDP_IMR 0xFFFB0018 +-set AT91C_UDP_FADDR 0xFFFB0008 +-set AT91C_UDP_NUM 0xFFFB0000 +-set AT91C_UDP_FDR 0xFFFB0050 +-set AT91C_UDP_ISR 0xFFFB001C +-set AT91C_UDP_CSR 0xFFFB0030 +-set AT91C_UDP_IDR 0xFFFB0014 +-set AT91C_UDP_ICR 0xFFFB0020 +-set AT91C_UDP_RSTEP 0xFFFB0028 +-set AT91C_UDP_TXVC 0xFFFB0074 +-set AT91C_UDP_GLBSTATE 0xFFFB0004 +-set AT91C_UDP_IER 0xFFFB0010 +-# ========== Register definition for TC0 peripheral ========== +-set AT91C_TC0_SR 0xFFFA0020 +-set AT91C_TC0_RC 0xFFFA001C +-set AT91C_TC0_RB 0xFFFA0018 +-set AT91C_TC0_CCR 0xFFFA0000 +-set AT91C_TC0_CMR 0xFFFA0004 +-set AT91C_TC0_IER 0xFFFA0024 +-set AT91C_TC0_RA 0xFFFA0014 +-set AT91C_TC0_IDR 0xFFFA0028 +-set AT91C_TC0_CV 0xFFFA0010 +-set AT91C_TC0_IMR 0xFFFA002C +-# ========== Register definition for TC1 peripheral ========== +-set AT91C_TC1_RB 0xFFFA0058 +-set AT91C_TC1_CCR 0xFFFA0040 +-set AT91C_TC1_IER 0xFFFA0064 +-set AT91C_TC1_IDR 0xFFFA0068 +-set AT91C_TC1_SR 0xFFFA0060 +-set AT91C_TC1_CMR 0xFFFA0044 +-set AT91C_TC1_RA 0xFFFA0054 +-set AT91C_TC1_RC 0xFFFA005C +-set AT91C_TC1_IMR 0xFFFA006C +-set AT91C_TC1_CV 0xFFFA0050 +-# ========== Register definition for TC2 peripheral ========== +-set AT91C_TC2_CMR 0xFFFA0084 +-set AT91C_TC2_CCR 0xFFFA0080 +-set AT91C_TC2_CV 0xFFFA0090 +-set AT91C_TC2_RA 0xFFFA0094 +-set AT91C_TC2_RB 0xFFFA0098 +-set AT91C_TC2_IDR 0xFFFA00A8 +-set AT91C_TC2_IMR 0xFFFA00AC +-set AT91C_TC2_RC 0xFFFA009C +-set AT91C_TC2_IER 0xFFFA00A4 +-set AT91C_TC2_SR 0xFFFA00A0 +-# ========== Register definition for TCB peripheral ========== +-set AT91C_TCB_BMR 0xFFFA00C4 +-set AT91C_TCB_BCR 0xFFFA00C0 +-# ========== Register definition for CAN_MB0 peripheral ========== +-set AT91C_CAN_MB0_MDL 0xFFFD0214 +-set AT91C_CAN_MB0_MAM 0xFFFD0204 +-set AT91C_CAN_MB0_MCR 0xFFFD021C +-set AT91C_CAN_MB0_MID 0xFFFD0208 +-set AT91C_CAN_MB0_MSR 0xFFFD0210 +-set AT91C_CAN_MB0_MFID 0xFFFD020C +-set AT91C_CAN_MB0_MDH 0xFFFD0218 +-set AT91C_CAN_MB0_MMR 0xFFFD0200 +-# ========== Register definition for CAN_MB1 peripheral ========== +-set AT91C_CAN_MB1_MDL 0xFFFD0234 +-set AT91C_CAN_MB1_MID 0xFFFD0228 +-set AT91C_CAN_MB1_MMR 0xFFFD0220 +-set AT91C_CAN_MB1_MSR 0xFFFD0230 +-set AT91C_CAN_MB1_MAM 0xFFFD0224 +-set AT91C_CAN_MB1_MDH 0xFFFD0238 +-set AT91C_CAN_MB1_MCR 0xFFFD023C +-set AT91C_CAN_MB1_MFID 0xFFFD022C +-# ========== Register definition for CAN_MB2 peripheral ========== +-set AT91C_CAN_MB2_MCR 0xFFFD025C +-set AT91C_CAN_MB2_MDH 0xFFFD0258 +-set AT91C_CAN_MB2_MID 0xFFFD0248 +-set AT91C_CAN_MB2_MDL 0xFFFD0254 +-set AT91C_CAN_MB2_MMR 0xFFFD0240 +-set AT91C_CAN_MB2_MAM 0xFFFD0244 +-set AT91C_CAN_MB2_MFID 0xFFFD024C +-set AT91C_CAN_MB2_MSR 0xFFFD0250 +-# ========== Register definition for CAN_MB3 peripheral ========== +-set AT91C_CAN_MB3_MFID 0xFFFD026C +-set AT91C_CAN_MB3_MAM 0xFFFD0264 +-set AT91C_CAN_MB3_MID 0xFFFD0268 +-set AT91C_CAN_MB3_MCR 0xFFFD027C +-set AT91C_CAN_MB3_MMR 0xFFFD0260 +-set AT91C_CAN_MB3_MSR 0xFFFD0270 +-set AT91C_CAN_MB3_MDL 0xFFFD0274 +-set AT91C_CAN_MB3_MDH 0xFFFD0278 +-# ========== Register definition for CAN_MB4 peripheral ========== +-set AT91C_CAN_MB4_MID 0xFFFD0288 +-set AT91C_CAN_MB4_MMR 0xFFFD0280 +-set AT91C_CAN_MB4_MDH 0xFFFD0298 +-set AT91C_CAN_MB4_MFID 0xFFFD028C +-set AT91C_CAN_MB4_MSR 0xFFFD0290 +-set AT91C_CAN_MB4_MCR 0xFFFD029C +-set AT91C_CAN_MB4_MDL 0xFFFD0294 +-set AT91C_CAN_MB4_MAM 0xFFFD0284 +-# ========== Register definition for CAN_MB5 peripheral ========== +-set AT91C_CAN_MB5_MSR 0xFFFD02B0 +-set AT91C_CAN_MB5_MCR 0xFFFD02BC +-set AT91C_CAN_MB5_MFID 0xFFFD02AC +-set AT91C_CAN_MB5_MDH 0xFFFD02B8 +-set AT91C_CAN_MB5_MID 0xFFFD02A8 +-set AT91C_CAN_MB5_MMR 0xFFFD02A0 +-set AT91C_CAN_MB5_MDL 0xFFFD02B4 +-set AT91C_CAN_MB5_MAM 0xFFFD02A4 +-# ========== Register definition for CAN_MB6 peripheral ========== +-set AT91C_CAN_MB6_MFID 0xFFFD02CC +-set AT91C_CAN_MB6_MID 0xFFFD02C8 +-set AT91C_CAN_MB6_MAM 0xFFFD02C4 +-set AT91C_CAN_MB6_MSR 0xFFFD02D0 +-set AT91C_CAN_MB6_MDL 0xFFFD02D4 +-set AT91C_CAN_MB6_MCR 0xFFFD02DC +-set AT91C_CAN_MB6_MDH 0xFFFD02D8 +-set AT91C_CAN_MB6_MMR 0xFFFD02C0 +-# ========== Register definition for CAN_MB7 peripheral ========== +-set AT91C_CAN_MB7_MCR 0xFFFD02FC +-set AT91C_CAN_MB7_MDH 0xFFFD02F8 +-set AT91C_CAN_MB7_MFID 0xFFFD02EC +-set AT91C_CAN_MB7_MDL 0xFFFD02F4 +-set AT91C_CAN_MB7_MID 0xFFFD02E8 +-set AT91C_CAN_MB7_MMR 0xFFFD02E0 +-set AT91C_CAN_MB7_MAM 0xFFFD02E4 +-set AT91C_CAN_MB7_MSR 0xFFFD02F0 +-# ========== Register definition for CAN peripheral ========== +-set AT91C_CAN_TCR 0xFFFD0024 +-set AT91C_CAN_IMR 0xFFFD000C +-set AT91C_CAN_IER 0xFFFD0004 +-set AT91C_CAN_ECR 0xFFFD0020 +-set AT91C_CAN_TIMESTP 0xFFFD001C +-set AT91C_CAN_MR 0xFFFD0000 +-set AT91C_CAN_IDR 0xFFFD0008 +-set AT91C_CAN_ACR 0xFFFD0028 +-set AT91C_CAN_TIM 0xFFFD0018 +-set AT91C_CAN_SR 0xFFFD0010 +-set AT91C_CAN_BR 0xFFFD0014 +-set AT91C_CAN_VR 0xFFFD00FC +-# ========== Register definition for EMAC peripheral ========== +-set AT91C_EMAC_ISR 0xFFFDC024 +-set AT91C_EMAC_SA4H 0xFFFDC0B4 +-set AT91C_EMAC_SA1L 0xFFFDC098 +-set AT91C_EMAC_ELE 0xFFFDC078 +-set AT91C_EMAC_LCOL 0xFFFDC05C +-set AT91C_EMAC_RLE 0xFFFDC088 +-set AT91C_EMAC_WOL 0xFFFDC0C4 +-set AT91C_EMAC_DTF 0xFFFDC058 +-set AT91C_EMAC_TUND 0xFFFDC064 +-set AT91C_EMAC_NCR 0xFFFDC000 +-set AT91C_EMAC_SA4L 0xFFFDC0B0 +-set AT91C_EMAC_RSR 0xFFFDC020 +-set AT91C_EMAC_SA3L 0xFFFDC0A8 +-set AT91C_EMAC_TSR 0xFFFDC014 +-set AT91C_EMAC_IDR 0xFFFDC02C +-set AT91C_EMAC_RSE 0xFFFDC074 +-set AT91C_EMAC_ECOL 0xFFFDC060 +-set AT91C_EMAC_TID 0xFFFDC0B8 +-set AT91C_EMAC_HRB 0xFFFDC090 +-set AT91C_EMAC_TBQP 0xFFFDC01C +-set AT91C_EMAC_USRIO 0xFFFDC0C0 +-set AT91C_EMAC_PTR 0xFFFDC038 +-set AT91C_EMAC_SA2H 0xFFFDC0A4 +-set AT91C_EMAC_ROV 0xFFFDC070 +-set AT91C_EMAC_ALE 0xFFFDC054 +-set AT91C_EMAC_RJA 0xFFFDC07C +-set AT91C_EMAC_RBQP 0xFFFDC018 +-set AT91C_EMAC_TPF 0xFFFDC08C +-set AT91C_EMAC_NCFGR 0xFFFDC004 +-set AT91C_EMAC_HRT 0xFFFDC094 +-set AT91C_EMAC_USF 0xFFFDC080 +-set AT91C_EMAC_FCSE 0xFFFDC050 +-set AT91C_EMAC_TPQ 0xFFFDC0BC +-set AT91C_EMAC_MAN 0xFFFDC034 +-set AT91C_EMAC_FTO 0xFFFDC040 +-set AT91C_EMAC_REV 0xFFFDC0FC +-set AT91C_EMAC_IMR 0xFFFDC030 +-set AT91C_EMAC_SCF 0xFFFDC044 +-set AT91C_EMAC_PFR 0xFFFDC03C +-set AT91C_EMAC_MCF 0xFFFDC048 +-set AT91C_EMAC_NSR 0xFFFDC008 +-set AT91C_EMAC_SA2L 0xFFFDC0A0 +-set AT91C_EMAC_FRO 0xFFFDC04C +-set AT91C_EMAC_IER 0xFFFDC028 +-set AT91C_EMAC_SA1H 0xFFFDC09C +-set AT91C_EMAC_CSE 0xFFFDC068 +-set AT91C_EMAC_SA3H 0xFFFDC0AC +-set AT91C_EMAC_RRE 0xFFFDC06C +-set AT91C_EMAC_STE 0xFFFDC084 +-# ========== Register definition for PDC_ADC peripheral ========== +-set AT91C_ADC_PTSR 0xFFFD8124 +-set AT91C_ADC_PTCR 0xFFFD8120 +-set AT91C_ADC_TNPR 0xFFFD8118 +-set AT91C_ADC_TNCR 0xFFFD811C +-set AT91C_ADC_RNPR 0xFFFD8110 +-set AT91C_ADC_RNCR 0xFFFD8114 +-set AT91C_ADC_RPR 0xFFFD8100 +-set AT91C_ADC_TCR 0xFFFD810C +-set AT91C_ADC_TPR 0xFFFD8108 +-set AT91C_ADC_RCR 0xFFFD8104 +-# ========== Register definition for ADC peripheral ========== +-set AT91C_ADC_CDR2 0xFFFD8038 +-set AT91C_ADC_CDR3 0xFFFD803C +-set AT91C_ADC_CDR0 0xFFFD8030 +-set AT91C_ADC_CDR5 0xFFFD8044 +-set AT91C_ADC_CHDR 0xFFFD8014 +-set AT91C_ADC_SR 0xFFFD801C +-set AT91C_ADC_CDR4 0xFFFD8040 +-set AT91C_ADC_CDR1 0xFFFD8034 +-set AT91C_ADC_LCDR 0xFFFD8020 +-set AT91C_ADC_IDR 0xFFFD8028 +-set AT91C_ADC_CR 0xFFFD8000 +-set AT91C_ADC_CDR7 0xFFFD804C +-set AT91C_ADC_CDR6 0xFFFD8048 +-set AT91C_ADC_IER 0xFFFD8024 +-set AT91C_ADC_CHER 0xFFFD8010 +-set AT91C_ADC_CHSR 0xFFFD8018 +-set AT91C_ADC_MR 0xFFFD8004 +-set AT91C_ADC_IMR 0xFFFD802C +- +-# ***************************************************************************** +-# BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 +-# ***************************************************************************** +-set AT91C_BASE_SYS 0xFFFFF000 +-set AT91C_BASE_AIC 0xFFFFF000 +-set AT91C_BASE_PDC_DBGU 0xFFFFF300 +-set AT91C_BASE_DBGU 0xFFFFF200 +-set AT91C_BASE_PIOA 0xFFFFF400 +-set AT91C_BASE_PIOB 0xFFFFF600 +-set AT91C_BASE_CKGR 0xFFFFFC20 +-set AT91C_BASE_PMC 0xFFFFFC00 +-set AT91C_BASE_RSTC 0xFFFFFD00 +-set AT91C_BASE_RTTC 0xFFFFFD20 +-set AT91C_BASE_PITC 0xFFFFFD30 +-set AT91C_BASE_WDTC 0xFFFFFD40 +-set AT91C_BASE_VREG 0xFFFFFD60 +-set AT91C_BASE_MC 0xFFFFFF00 +-set AT91C_BASE_PDC_SPI1 0xFFFE4100 +-set AT91C_BASE_SPI1 0xFFFE4000 +-set AT91C_BASE_PDC_SPI0 0xFFFE0100 +-set AT91C_BASE_SPI0 0xFFFE0000 +-set AT91C_BASE_PDC_US1 0xFFFC4100 +-set AT91C_BASE_US1 0xFFFC4000 +-set AT91C_BASE_PDC_US0 0xFFFC0100 +-set AT91C_BASE_US0 0xFFFC0000 +-set AT91C_BASE_PDC_SSC 0xFFFD4100 +-set AT91C_BASE_SSC 0xFFFD4000 +-set AT91C_BASE_TWI 0xFFFB8000 +-set AT91C_BASE_PWMC_CH3 0xFFFCC260 +-set AT91C_BASE_PWMC_CH2 0xFFFCC240 +-set AT91C_BASE_PWMC_CH1 0xFFFCC220 +-set AT91C_BASE_PWMC_CH0 0xFFFCC200 +-set AT91C_BASE_PWMC 0xFFFCC000 +-set AT91C_BASE_UDP 0xFFFB0000 +-set AT91C_BASE_TC0 0xFFFA0000 +-set AT91C_BASE_TC1 0xFFFA0040 +-set AT91C_BASE_TC2 0xFFFA0080 +-set AT91C_BASE_TCB 0xFFFA0000 +-set AT91C_BASE_CAN_MB0 0xFFFD0200 +-set AT91C_BASE_CAN_MB1 0xFFFD0220 +-set AT91C_BASE_CAN_MB2 0xFFFD0240 +-set AT91C_BASE_CAN_MB3 0xFFFD0260 +-set AT91C_BASE_CAN_MB4 0xFFFD0280 +-set AT91C_BASE_CAN_MB5 0xFFFD02A0 +-set AT91C_BASE_CAN_MB6 0xFFFD02C0 +-set AT91C_BASE_CAN_MB7 0xFFFD02E0 +-set AT91C_BASE_CAN 0xFFFD0000 +-set AT91C_BASE_EMAC 0xFFFDC000 +-set AT91C_BASE_PDC_ADC 0xFFFD8100 +-set AT91C_BASE_ADC 0xFFFD8000 +- +-# ***************************************************************************** +-# PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 +-# ***************************************************************************** +-set AT91C_ID_FIQ 0 +-set AT91C_ID_SYS 1 +-set AT91C_ID_PIOA 2 +-set AT91C_ID_PIOB 3 +-set AT91C_ID_SPI0 4 +-set AT91C_ID_SPI1 5 +-set AT91C_ID_US0 6 +-set AT91C_ID_US1 7 +-set AT91C_ID_SSC 8 +-set AT91C_ID_TWI 9 +-set AT91C_ID_PWMC 10 +-set AT91C_ID_UDP 11 +-set AT91C_ID_TC0 12 +-set AT91C_ID_TC1 13 +-set AT91C_ID_TC2 14 +-set AT91C_ID_CAN 15 +-set AT91C_ID_EMAC 16 +-set AT91C_ID_ADC 17 +-set AT91C_ID_18_Reserved 18 +-set AT91C_ID_19_Reserved 19 +-set AT91C_ID_20_Reserved 20 +-set AT91C_ID_21_Reserved 21 +-set AT91C_ID_22_Reserved 22 +-set AT91C_ID_23_Reserved 23 +-set AT91C_ID_24_Reserved 24 +-set AT91C_ID_25_Reserved 25 +-set AT91C_ID_26_Reserved 26 +-set AT91C_ID_27_Reserved 27 +-set AT91C_ID_28_Reserved 28 +-set AT91C_ID_29_Reserved 29 +-set AT91C_ID_IRQ0 30 +-set AT91C_ID_IRQ1 31 +- +-# ***************************************************************************** +-# PIO DEFINITIONS FOR AT91SAM7X256 +-# ***************************************************************************** +-set AT91C_PIO_PA0 [expr 1 << 0 ] +-set AT91C_PA0_RXD0 $AT91C_PIO_PA0 +-set AT91C_PIO_PA1 [expr 1 << 1 ] +-set AT91C_PA1_TXD0 $AT91C_PIO_PA1 +-set AT91C_PIO_PA10 [expr 1 << 10 ] +-set AT91C_PA10_TWD $AT91C_PIO_PA10 +-set AT91C_PIO_PA11 [expr 1 << 11 ] +-set AT91C_PA11_TWCK $AT91C_PIO_PA11 +-set AT91C_PIO_PA12 [expr 1 << 12 ] +-set AT91C_PA12_SPI0_NPCS0 $AT91C_PIO_PA12 +-set AT91C_PIO_PA13 [expr 1 << 13 ] +-set AT91C_PA13_SPI0_NPCS1 $AT91C_PIO_PA13 +-set AT91C_PA13_PCK1 $AT91C_PIO_PA13 +-set AT91C_PIO_PA14 [expr 1 << 14 ] +-set AT91C_PA14_SPI0_NPCS2 $AT91C_PIO_PA14 +-set AT91C_PA14_IRQ1 $AT91C_PIO_PA14 +-set AT91C_PIO_PA15 [expr 1 << 15 ] +-set AT91C_PA15_SPI0_NPCS3 $AT91C_PIO_PA15 +-set AT91C_PA15_TCLK2 $AT91C_PIO_PA15 +-set AT91C_PIO_PA16 [expr 1 << 16 ] +-set AT91C_PA16_SPI0_MISO $AT91C_PIO_PA16 +-set AT91C_PIO_PA17 [expr 1 << 17 ] +-set AT91C_PA17_SPI0_MOSI $AT91C_PIO_PA17 +-set AT91C_PIO_PA18 [expr 1 << 18 ] +-set AT91C_PA18_SPI0_SPCK $AT91C_PIO_PA18 +-set AT91C_PIO_PA19 [expr 1 << 19 ] +-set AT91C_PA19_CANRX $AT91C_PIO_PA19 +-set AT91C_PIO_PA2 [expr 1 << 2 ] +-set AT91C_PA2_SCK0 $AT91C_PIO_PA2 +-set AT91C_PA2_SPI1_NPCS1 $AT91C_PIO_PA2 +-set AT91C_PIO_PA20 [expr 1 << 20 ] +-set AT91C_PA20_CANTX $AT91C_PIO_PA20 +-set AT91C_PIO_PA21 [expr 1 << 21 ] +-set AT91C_PA21_TF $AT91C_PIO_PA21 +-set AT91C_PA21_SPI1_NPCS0 $AT91C_PIO_PA21 +-set AT91C_PIO_PA22 [expr 1 << 22 ] +-set AT91C_PA22_TK $AT91C_PIO_PA22 +-set AT91C_PA22_SPI1_SPCK $AT91C_PIO_PA22 +-set AT91C_PIO_PA23 [expr 1 << 23 ] +-set AT91C_PA23_TD $AT91C_PIO_PA23 +-set AT91C_PA23_SPI1_MOSI $AT91C_PIO_PA23 +-set AT91C_PIO_PA24 [expr 1 << 24 ] +-set AT91C_PA24_RD $AT91C_PIO_PA24 +-set AT91C_PA24_SPI1_MISO $AT91C_PIO_PA24 +-set AT91C_PIO_PA25 [expr 1 << 25 ] +-set AT91C_PA25_RK $AT91C_PIO_PA25 +-set AT91C_PA25_SPI1_NPCS1 $AT91C_PIO_PA25 +-set AT91C_PIO_PA26 [expr 1 << 26 ] +-set AT91C_PA26_RF $AT91C_PIO_PA26 +-set AT91C_PA26_SPI1_NPCS2 $AT91C_PIO_PA26 +-set AT91C_PIO_PA27 [expr 1 << 27 ] +-set AT91C_PA27_DRXD $AT91C_PIO_PA27 +-set AT91C_PA27_PCK3 $AT91C_PIO_PA27 +-set AT91C_PIO_PA28 [expr 1 << 28 ] +-set AT91C_PA28_DTXD $AT91C_PIO_PA28 +-set AT91C_PIO_PA29 [expr 1 << 29 ] +-set AT91C_PA29_FIQ $AT91C_PIO_PA29 +-set AT91C_PA29_SPI1_NPCS3 $AT91C_PIO_PA29 +-set AT91C_PIO_PA3 [expr 1 << 3 ] +-set AT91C_PA3_RTS0 $AT91C_PIO_PA3 +-set AT91C_PA3_SPI1_NPCS2 $AT91C_PIO_PA3 +-set AT91C_PIO_PA30 [expr 1 << 30 ] +-set AT91C_PA30_IRQ0 $AT91C_PIO_PA30 +-set AT91C_PA30_PCK2 $AT91C_PIO_PA30 +-set AT91C_PIO_PA4 [expr 1 << 4 ] +-set AT91C_PA4_CTS0 $AT91C_PIO_PA4 +-set AT91C_PA4_SPI1_NPCS3 $AT91C_PIO_PA4 +-set AT91C_PIO_PA5 [expr 1 << 5 ] +-set AT91C_PA5_RXD1 $AT91C_PIO_PA5 +-set AT91C_PIO_PA6 [expr 1 << 6 ] +-set AT91C_PA6_TXD1 $AT91C_PIO_PA6 +-set AT91C_PIO_PA7 [expr 1 << 7 ] +-set AT91C_PA7_SCK1 $AT91C_PIO_PA7 +-set AT91C_PA7_SPI0_NPCS1 $AT91C_PIO_PA7 +-set AT91C_PIO_PA8 [expr 1 << 8 ] +-set AT91C_PA8_RTS1 $AT91C_PIO_PA8 +-set AT91C_PA8_SPI0_NPCS2 $AT91C_PIO_PA8 +-set AT91C_PIO_PA9 [expr 1 << 9 ] +-set AT91C_PA9_CTS1 $AT91C_PIO_PA9 +-set AT91C_PA9_SPI0_NPCS3 $AT91C_PIO_PA9 +-set AT91C_PIO_PB0 [expr 1 << 0 ] +-set AT91C_PB0_ETXCK_EREFCK $AT91C_PIO_PB0 +-set AT91C_PB0_PCK0 $AT91C_PIO_PB0 +-set AT91C_PIO_PB1 [expr 1 << 1 ] +-set AT91C_PB1_ETXEN $AT91C_PIO_PB1 +-set AT91C_PIO_PB10 [expr 1 << 10 ] +-set AT91C_PB10_ETX2 $AT91C_PIO_PB10 +-set AT91C_PB10_SPI1_NPCS1 $AT91C_PIO_PB10 +-set AT91C_PIO_PB11 [expr 1 << 11 ] +-set AT91C_PB11_ETX3 $AT91C_PIO_PB11 +-set AT91C_PB11_SPI1_NPCS2 $AT91C_PIO_PB11 +-set AT91C_PIO_PB12 [expr 1 << 12 ] +-set AT91C_PB12_ETXER $AT91C_PIO_PB12 +-set AT91C_PB12_TCLK0 $AT91C_PIO_PB12 +-set AT91C_PIO_PB13 [expr 1 << 13 ] +-set AT91C_PB13_ERX2 $AT91C_PIO_PB13 +-set AT91C_PB13_SPI0_NPCS1 $AT91C_PIO_PB13 +-set AT91C_PIO_PB14 [expr 1 << 14 ] +-set AT91C_PB14_ERX3 $AT91C_PIO_PB14 +-set AT91C_PB14_SPI0_NPCS2 $AT91C_PIO_PB14 +-set AT91C_PIO_PB15 [expr 1 << 15 ] +-set AT91C_PB15_ERXDV_ECRSDV $AT91C_PIO_PB15 +-set AT91C_PIO_PB16 [expr 1 << 16 ] +-set AT91C_PB16_ECOL $AT91C_PIO_PB16 +-set AT91C_PB16_SPI1_NPCS3 $AT91C_PIO_PB16 +-set AT91C_PIO_PB17 [expr 1 << 17 ] +-set AT91C_PB17_ERXCK $AT91C_PIO_PB17 +-set AT91C_PB17_SPI0_NPCS3 $AT91C_PIO_PB17 +-set AT91C_PIO_PB18 [expr 1 << 18 ] +-set AT91C_PB18_EF100 $AT91C_PIO_PB18 +-set AT91C_PB18_ADTRG $AT91C_PIO_PB18 +-set AT91C_PIO_PB19 [expr 1 << 19 ] +-set AT91C_PB19_PWM0 $AT91C_PIO_PB19 +-set AT91C_PB19_TCLK1 $AT91C_PIO_PB19 +-set AT91C_PIO_PB2 [expr 1 << 2 ] +-set AT91C_PB2_ETX0 $AT91C_PIO_PB2 +-set AT91C_PIO_PB20 [expr 1 << 20 ] +-set AT91C_PB20_PWM1 $AT91C_PIO_PB20 +-set AT91C_PB20_PCK0 $AT91C_PIO_PB20 +-set AT91C_PIO_PB21 [expr 1 << 21 ] +-set AT91C_PB21_PWM2 $AT91C_PIO_PB21 +-set AT91C_PB21_PCK1 $AT91C_PIO_PB21 +-set AT91C_PIO_PB22 [expr 1 << 22 ] +-set AT91C_PB22_PWM3 $AT91C_PIO_PB22 +-set AT91C_PB22_PCK2 $AT91C_PIO_PB22 +-set AT91C_PIO_PB23 [expr 1 << 23 ] +-set AT91C_PB23_TIOA0 $AT91C_PIO_PB23 +-set AT91C_PB23_DCD1 $AT91C_PIO_PB23 +-set AT91C_PIO_PB24 [expr 1 << 24 ] +-set AT91C_PB24_TIOB0 $AT91C_PIO_PB24 +-set AT91C_PB24_DSR1 $AT91C_PIO_PB24 +-set AT91C_PIO_PB25 [expr 1 << 25 ] +-set AT91C_PB25_TIOA1 $AT91C_PIO_PB25 +-set AT91C_PB25_DTR1 $AT91C_PIO_PB25 +-set AT91C_PIO_PB26 [expr 1 << 26 ] +-set AT91C_PB26_TIOB1 $AT91C_PIO_PB26 +-set AT91C_PB26_RI1 $AT91C_PIO_PB26 +-set AT91C_PIO_PB27 [expr 1 << 27 ] +-set AT91C_PB27_TIOA2 $AT91C_PIO_PB27 +-set AT91C_PB27_PWM0 $AT91C_PIO_PB27 +-set AT91C_PIO_PB28 [expr 1 << 28 ] +-set AT91C_PB28_TIOB2 $AT91C_PIO_PB28 +-set AT91C_PB28_PWM1 $AT91C_PIO_PB28 +-set AT91C_PIO_PB29 [expr 1 << 29 ] +-set AT91C_PB29_PCK1 $AT91C_PIO_PB29 +-set AT91C_PB29_PWM2 $AT91C_PIO_PB29 +-set AT91C_PIO_PB3 [expr 1 << 3 ] +-set AT91C_PB3_ETX1 $AT91C_PIO_PB3 +-set AT91C_PIO_PB30 [expr 1 << 30 ] +-set AT91C_PB30_PCK2 $AT91C_PIO_PB30 +-set AT91C_PB30_PWM3 $AT91C_PIO_PB30 +-set AT91C_PIO_PB4 [expr 1 << 4 ] +-set AT91C_PB4_ECRS $AT91C_PIO_PB4 +-set AT91C_PIO_PB5 [expr 1 << 5 ] +-set AT91C_PB5_ERX0 $AT91C_PIO_PB5 +-set AT91C_PIO_PB6 [expr 1 << 6 ] +-set AT91C_PB6_ERX1 $AT91C_PIO_PB6 +-set AT91C_PIO_PB7 [expr 1 << 7 ] +-set AT91C_PB7_ERXER $AT91C_PIO_PB7 +-set AT91C_PIO_PB8 [expr 1 << 8 ] +-set AT91C_PB8_EMDC $AT91C_PIO_PB8 +-set AT91C_PIO_PB9 [expr 1 << 9 ] +-set AT91C_PB9_EMDIO $AT91C_PIO_PB9 +- +-# ***************************************************************************** +-# MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 +-# ***************************************************************************** +-set AT91C_ISRAM 0x00200000 +-set AT91C_ISRAM_SIZE 0x00010000 +-set AT91C_IFLASH 0x00100000 +-set AT91C_IFLASH_SIZE 0x00040000 +- +- +-# ***************************************************************************** +-# ATTRIBUTES DEFINITIONS FOR AT91SAM7X256 +-# ***************************************************************************** +-array set AT91SAM7X256_att { +- DBGU { LP DBGU_att } +- PMC { LP PMC_att } +- VREG { LP VREG_att } +- RSTC { LP RSTC_att } +- SSC { LP SSC_att } +- WDTC { LP WDTC_att } +- USART { LP US1_att US0_att } +- SPI { LP SPI1_att SPI0_att } +- PITC { LP PITC_att } +- TCB { LP TCB_att } +- CKGR { LP CKGR_att } +- AIC { LP AIC_att } +- TWI { LP TWI_att } +- ADC { LP ADC_att } +- PWMC_CH { LP PWMC_CH3_att PWMC_CH2_att PWMC_CH1_att PWMC_CH0_att } +- RTTC { LP RTTC_att } +- UDP { LP UDP_att } +- EMAC { LP EMAC_att } +- CAN_MB { LP CAN_MB0_att CAN_MB1_att CAN_MB2_att CAN_MB3_att CAN_MB4_att CAN_MB5_att CAN_MB6_att CAN_MB7_att } +- TC { LP TC0_att TC1_att TC2_att } +- SYS { LP SYS_att } +- MC { LP MC_att } +- PIO { LP PIOA_att PIOB_att } +- CAN { LP CAN_att } +- PWMC { LP PWMC_att } +- PDC { LP PDC_DBGU_att PDC_SPI1_att PDC_SPI0_att PDC_US1_att PDC_US0_att PDC_SSC_att PDC_ADC_att } +- +-} +-# ========== Peripheral attributes for DBGU peripheral ========== +-array set DBGU_att { +- EXID { R AT91C_DBGU_EXID RO } +- BRGR { R AT91C_DBGU_BRGR RW } +- IDR { R AT91C_DBGU_IDR WO } +- CSR { R AT91C_DBGU_CSR RO } +- CIDR { R AT91C_DBGU_CIDR RO } +- MR { R AT91C_DBGU_MR RW } +- IMR { R AT91C_DBGU_IMR RO } +- CR { R AT91C_DBGU_CR WO } +- FNTR { R AT91C_DBGU_FNTR RW } +- THR { R AT91C_DBGU_THR WO } +- RHR { R AT91C_DBGU_RHR RO } +- IER { R AT91C_DBGU_IER WO } +- listeReg { EXID BRGR IDR CSR CIDR MR IMR CR FNTR THR RHR IER } +- +-} +- +-# ========== Peripheral attributes for PMC peripheral ========== +-array set PMC_att { +- IDR { R AT91C_PMC_IDR WO } +- MOR { R AT91C_PMC_MOR RW } +- PLLR { R AT91C_PMC_PLLR RW } +- PCER { R AT91C_PMC_PCER WO } +- PCKR { R AT91C_PMC_PCKR RW } +- MCKR { R AT91C_PMC_MCKR RW } +- SCDR { R AT91C_PMC_SCDR WO } +- PCDR { R AT91C_PMC_PCDR WO } +- SCSR { R AT91C_PMC_SCSR RO } +- PCSR { R AT91C_PMC_PCSR RO } +- MCFR { R AT91C_PMC_MCFR RO } +- SCER { R AT91C_PMC_SCER WO } +- IMR { R AT91C_PMC_IMR RO } +- IER { R AT91C_PMC_IER WO } +- SR { R AT91C_PMC_SR RO } +- listeReg { IDR MOR PLLR PCER PCKR MCKR SCDR PCDR SCSR PCSR MCFR SCER IMR IER SR } +- +-} +- +-# ========== Peripheral attributes for VREG peripheral ========== +-array set VREG_att { +- MR { R AT91C_VREG_MR RW } +- listeReg { MR } +- +-} +- +-# ========== Peripheral attributes for RSTC peripheral ========== +-array set RSTC_att { +- RCR { R AT91C_RSTC_RCR WO } +- RMR { R AT91C_RSTC_RMR RW } +- RSR { R AT91C_RSTC_RSR RO } +- listeReg { RCR RMR RSR } +- +-} +- +-# ========== Peripheral attributes for SSC peripheral ========== +-array set SSC_att { +- RHR { R AT91C_SSC_RHR RO } +- RSHR { R AT91C_SSC_RSHR RO } +- TFMR { R AT91C_SSC_TFMR RW } +- IDR { R AT91C_SSC_IDR WO } +- THR { R AT91C_SSC_THR WO } +- RCMR { R AT91C_SSC_RCMR RW } +- IER { R AT91C_SSC_IER WO } +- TSHR { R AT91C_SSC_TSHR RW } +- SR { R AT91C_SSC_SR RO } +- CMR { R AT91C_SSC_CMR RW } +- TCMR { R AT91C_SSC_TCMR RW } +- CR { R AT91C_SSC_CR WO } +- IMR { R AT91C_SSC_IMR RO } +- RFMR { R AT91C_SSC_RFMR RW } +- listeReg { RHR RSHR TFMR IDR THR RCMR IER TSHR SR CMR TCMR CR IMR RFMR } +- +-} +- +-# ========== Peripheral attributes for WDTC peripheral ========== +-array set WDTC_att { +- WDCR { R AT91C_WDTC_WDCR WO } +- WDSR { R AT91C_WDTC_WDSR RO } +- WDMR { R AT91C_WDTC_WDMR RW } +- listeReg { WDCR WDSR WDMR } +- +-} +- +-# ========== Peripheral attributes for USART peripheral ========== +-array set US1_att { +- IF { R AT91C_US1_IF RW } +- NER { R AT91C_US1_NER RO } +- RTOR { R AT91C_US1_RTOR RW } +- CSR { R AT91C_US1_CSR RO } +- IDR { R AT91C_US1_IDR WO } +- IER { R AT91C_US1_IER WO } +- THR { R AT91C_US1_THR WO } +- TTGR { R AT91C_US1_TTGR RW } +- RHR { R AT91C_US1_RHR RO } +- BRGR { R AT91C_US1_BRGR RW } +- IMR { R AT91C_US1_IMR RO } +- FIDI { R AT91C_US1_FIDI RW } +- CR { R AT91C_US1_CR WO } +- MR { R AT91C_US1_MR RW } +- listeReg { IF NER RTOR CSR IDR IER THR TTGR RHR BRGR IMR FIDI CR MR } +- +-} +-array set US0_att { +- BRGR { R AT91C_US0_BRGR RW } +- NER { R AT91C_US0_NER RO } +- CR { R AT91C_US0_CR WO } +- IMR { R AT91C_US0_IMR RO } +- FIDI { R AT91C_US0_FIDI RW } +- TTGR { R AT91C_US0_TTGR RW } +- MR { R AT91C_US0_MR RW } +- RTOR { R AT91C_US0_RTOR RW } +- CSR { R AT91C_US0_CSR RO } +- RHR { R AT91C_US0_RHR RO } +- IDR { R AT91C_US0_IDR WO } +- THR { R AT91C_US0_THR WO } +- IF { R AT91C_US0_IF RW } +- IER { R AT91C_US0_IER WO } +- listeReg { BRGR NER CR IMR FIDI TTGR MR RTOR CSR RHR IDR THR IF IER } +- +-} +- +-# ========== Peripheral attributes for SPI peripheral ========== +-array set SPI1_att { +- IMR { R AT91C_SPI1_IMR RO } +- IER { R AT91C_SPI1_IER WO } +- MR { R AT91C_SPI1_MR RW } +- RDR { R AT91C_SPI1_RDR RO } +- IDR { R AT91C_SPI1_IDR WO } +- SR { R AT91C_SPI1_SR RO } +- TDR { R AT91C_SPI1_TDR WO } +- CR { R AT91C_SPI1_CR RO } +- CSR { R AT91C_SPI1_CSR RW } +- listeReg { IMR IER MR RDR IDR SR TDR CR CSR } +- +-} +-array set SPI0_att { +- IER { R AT91C_SPI0_IER WO } +- SR { R AT91C_SPI0_SR RO } +- IDR { R AT91C_SPI0_IDR WO } +- CR { R AT91C_SPI0_CR RO } +- MR { R AT91C_SPI0_MR RW } +- IMR { R AT91C_SPI0_IMR RO } +- TDR { R AT91C_SPI0_TDR WO } +- RDR { R AT91C_SPI0_RDR RO } +- CSR { R AT91C_SPI0_CSR RW } +- listeReg { IER SR IDR CR MR IMR TDR RDR CSR } +- +-} +- +-# ========== Peripheral attributes for PITC peripheral ========== +-array set PITC_att { +- PIVR { R AT91C_PITC_PIVR RO } +- PISR { R AT91C_PITC_PISR RO } +- PIIR { R AT91C_PITC_PIIR RO } +- PIMR { R AT91C_PITC_PIMR RW } +- listeReg { PIVR PISR PIIR PIMR } +- +-} +- +-# ========== Peripheral attributes for TCB peripheral ========== +-array set TCB_att { +- BMR { R AT91C_TCB_BMR RW } +- BCR { R AT91C_TCB_BCR WO } +- listeReg { BMR BCR } +- +-} +- +-# ========== Peripheral attributes for CKGR peripheral ========== +-array set CKGR_att { +- MOR { R AT91C_CKGR_MOR RW } +- PLLR { R AT91C_CKGR_PLLR RW } +- MCFR { R AT91C_CKGR_MCFR RO } +- listeReg { MOR PLLR MCFR } +- +-} +- +-# ========== Peripheral attributes for AIC peripheral ========== +-array set AIC_att { +- IVR { R AT91C_AIC_IVR RO } +- SMR { R AT91C_AIC_SMR RW } +- FVR { R AT91C_AIC_FVR RO } +- DCR { R AT91C_AIC_DCR RW } +- EOICR { R AT91C_AIC_EOICR WO } +- SVR { R AT91C_AIC_SVR RW } +- FFSR { R AT91C_AIC_FFSR RO } +- ICCR { R AT91C_AIC_ICCR WO } +- ISR { R AT91C_AIC_ISR RO } +- IMR { R AT91C_AIC_IMR RO } +- IPR { R AT91C_AIC_IPR RO } +- FFER { R AT91C_AIC_FFER WO } +- IECR { R AT91C_AIC_IECR WO } +- ISCR { R AT91C_AIC_ISCR WO } +- FFDR { R AT91C_AIC_FFDR WO } +- CISR { R AT91C_AIC_CISR RO } +- IDCR { R AT91C_AIC_IDCR WO } +- SPU { R AT91C_AIC_SPU RW } +- listeReg { IVR SMR FVR DCR EOICR SVR FFSR ICCR ISR IMR IPR FFER IECR ISCR FFDR CISR IDCR SPU } +- +-} +- +-# ========== Peripheral attributes for TWI peripheral ========== +-array set TWI_att { +- IER { R AT91C_TWI_IER WO } +- CR { R AT91C_TWI_CR WO } +- SR { R AT91C_TWI_SR RO } +- IMR { R AT91C_TWI_IMR RO } +- THR { R AT91C_TWI_THR WO } +- IDR { R AT91C_TWI_IDR WO } +- IADR { R AT91C_TWI_IADR RW } +- MMR { R AT91C_TWI_MMR RW } +- CWGR { R AT91C_TWI_CWGR RW } +- RHR { R AT91C_TWI_RHR RO } +- listeReg { IER CR SR IMR THR IDR IADR MMR CWGR RHR } +- +-} +- +-# ========== Peripheral attributes for ADC peripheral ========== +-array set ADC_att { +- CDR2 { R AT91C_ADC_CDR2 RO } +- CDR3 { R AT91C_ADC_CDR3 RO } +- CDR0 { R AT91C_ADC_CDR0 RO } +- CDR5 { R AT91C_ADC_CDR5 RO } +- CHDR { R AT91C_ADC_CHDR WO } +- SR { R AT91C_ADC_SR RO } +- CDR4 { R AT91C_ADC_CDR4 RO } +- CDR1 { R AT91C_ADC_CDR1 RO } +- LCDR { R AT91C_ADC_LCDR RO } +- IDR { R AT91C_ADC_IDR WO } +- CR { R AT91C_ADC_CR WO } +- CDR7 { R AT91C_ADC_CDR7 RO } +- CDR6 { R AT91C_ADC_CDR6 RO } +- IER { R AT91C_ADC_IER WO } +- CHER { R AT91C_ADC_CHER WO } +- CHSR { R AT91C_ADC_CHSR RO } +- MR { R AT91C_ADC_MR RW } +- IMR { R AT91C_ADC_IMR RO } +- listeReg { CDR2 CDR3 CDR0 CDR5 CHDR SR CDR4 CDR1 LCDR IDR CR CDR7 CDR6 IER CHER CHSR MR IMR } +- +-} +- +-# ========== Peripheral attributes for PWMC_CH peripheral ========== +-array set PWMC_CH3_att { +- CUPDR { R AT91C_PWMC_CH3_CUPDR WO } +- Reserved { R AT91C_PWMC_CH3_Reserved WO } +- CPRDR { R AT91C_PWMC_CH3_CPRDR RW } +- CDTYR { R AT91C_PWMC_CH3_CDTYR RW } +- CCNTR { R AT91C_PWMC_CH3_CCNTR RO } +- CMR { R AT91C_PWMC_CH3_CMR RW } +- listeReg { CUPDR Reserved CPRDR CDTYR CCNTR CMR } +- +-} +-array set PWMC_CH2_att { +- Reserved { R AT91C_PWMC_CH2_Reserved WO } +- CMR { R AT91C_PWMC_CH2_CMR RW } +- CCNTR { R AT91C_PWMC_CH2_CCNTR RO } +- CPRDR { R AT91C_PWMC_CH2_CPRDR RW } +- CUPDR { R AT91C_PWMC_CH2_CUPDR WO } +- CDTYR { R AT91C_PWMC_CH2_CDTYR RW } +- listeReg { Reserved CMR CCNTR CPRDR CUPDR CDTYR } +- +-} +-array set PWMC_CH1_att { +- Reserved { R AT91C_PWMC_CH1_Reserved WO } +- CUPDR { R AT91C_PWMC_CH1_CUPDR WO } +- CPRDR { R AT91C_PWMC_CH1_CPRDR RW } +- CCNTR { R AT91C_PWMC_CH1_CCNTR RO } +- CDTYR { R AT91C_PWMC_CH1_CDTYR RW } +- CMR { R AT91C_PWMC_CH1_CMR RW } +- listeReg { Reserved CUPDR CPRDR CCNTR CDTYR CMR } +- +-} +-array set PWMC_CH0_att { +- Reserved { R AT91C_PWMC_CH0_Reserved WO } +- CPRDR { R AT91C_PWMC_CH0_CPRDR RW } +- CDTYR { R AT91C_PWMC_CH0_CDTYR RW } +- CMR { R AT91C_PWMC_CH0_CMR RW } +- CUPDR { R AT91C_PWMC_CH0_CUPDR WO } +- CCNTR { R AT91C_PWMC_CH0_CCNTR RO } +- listeReg { Reserved CPRDR CDTYR CMR CUPDR CCNTR } +- +-} +- +-# ========== Peripheral attributes for RTTC peripheral ========== +-array set RTTC_att { +- RTSR { R AT91C_RTTC_RTSR RO } +- RTMR { R AT91C_RTTC_RTMR RW } +- RTVR { R AT91C_RTTC_RTVR RO } +- RTAR { R AT91C_RTTC_RTAR RW } +- listeReg { RTSR RTMR RTVR RTAR } +- +-} +- +-# ========== Peripheral attributes for UDP peripheral ========== +-array set UDP_att { +- IMR { R AT91C_UDP_IMR RO } +- FADDR { R AT91C_UDP_FADDR RW } +- NUM { R AT91C_UDP_NUM RO } +- FDR { R AT91C_UDP_FDR RW } +- ISR { R AT91C_UDP_ISR RO } +- CSR { R AT91C_UDP_CSR RW } +- IDR { R AT91C_UDP_IDR WO } +- ICR { R AT91C_UDP_ICR RO } +- RSTEP { R AT91C_UDP_RSTEP RO } +- TXVC { R AT91C_UDP_TXVC RW } +- GLBSTATE { R AT91C_UDP_GLBSTATE RW } +- IER { R AT91C_UDP_IER WO } +- listeReg { IMR FADDR NUM FDR ISR CSR IDR ICR RSTEP TXVC GLBSTATE IER } +- +-} +- +-# ========== Peripheral attributes for EMAC peripheral ========== +-array set EMAC_att { +- ISR { R AT91C_EMAC_ISR RW } +- SA4H { R AT91C_EMAC_SA4H RW } +- SA1L { R AT91C_EMAC_SA1L RW } +- ELE { R AT91C_EMAC_ELE RW } +- LCOL { R AT91C_EMAC_LCOL RW } +- RLE { R AT91C_EMAC_RLE RW } +- WOL { R AT91C_EMAC_WOL RW } +- DTF { R AT91C_EMAC_DTF RW } +- TUND { R AT91C_EMAC_TUND RW } +- NCR { R AT91C_EMAC_NCR RW } +- SA4L { R AT91C_EMAC_SA4L RW } +- RSR { R AT91C_EMAC_RSR RW } +- SA3L { R AT91C_EMAC_SA3L RW } +- TSR { R AT91C_EMAC_TSR RW } +- IDR { R AT91C_EMAC_IDR WO } +- RSE { R AT91C_EMAC_RSE RW } +- ECOL { R AT91C_EMAC_ECOL RW } +- TID { R AT91C_EMAC_TID RW } +- HRB { R AT91C_EMAC_HRB RW } +- TBQP { R AT91C_EMAC_TBQP RW } +- USRIO { R AT91C_EMAC_USRIO RW } +- PTR { R AT91C_EMAC_PTR RW } +- SA2H { R AT91C_EMAC_SA2H RW } +- ROV { R AT91C_EMAC_ROV RW } +- ALE { R AT91C_EMAC_ALE RW } +- RJA { R AT91C_EMAC_RJA RW } +- RBQP { R AT91C_EMAC_RBQP RW } +- TPF { R AT91C_EMAC_TPF RW } +- NCFGR { R AT91C_EMAC_NCFGR RW } +- HRT { R AT91C_EMAC_HRT RW } +- USF { R AT91C_EMAC_USF RW } +- FCSE { R AT91C_EMAC_FCSE RW } +- TPQ { R AT91C_EMAC_TPQ RW } +- MAN { R AT91C_EMAC_MAN RW } +- FTO { R AT91C_EMAC_FTO RW } +- REV { R AT91C_EMAC_REV RO } +- IMR { R AT91C_EMAC_IMR RO } +- SCF { R AT91C_EMAC_SCF RW } +- PFR { R AT91C_EMAC_PFR RW } +- MCF { R AT91C_EMAC_MCF RW } +- NSR { R AT91C_EMAC_NSR RO } +- SA2L { R AT91C_EMAC_SA2L RW } +- FRO { R AT91C_EMAC_FRO RW } +- IER { R AT91C_EMAC_IER WO } +- SA1H { R AT91C_EMAC_SA1H RW } +- CSE { R AT91C_EMAC_CSE RW } +- SA3H { R AT91C_EMAC_SA3H RW } +- RRE { R AT91C_EMAC_RRE RW } +- STE { R AT91C_EMAC_STE RW } +- listeReg { ISR SA4H SA1L ELE LCOL RLE WOL DTF TUND NCR SA4L RSR SA3L TSR IDR RSE ECOL TID HRB TBQP USRIO PTR SA2H ROV ALE RJA RBQP TPF NCFGR HRT USF FCSE TPQ MAN FTO REV IMR SCF PFR MCF NSR SA2L FRO IER SA1H CSE SA3H RRE STE } +- +-} +- +-# ========== Peripheral attributes for CAN_MB peripheral ========== +-array set CAN_MB0_att { +- MDL { R AT91C_CAN_MB0_MDL RW } +- MAM { R AT91C_CAN_MB0_MAM RW } +- MCR { R AT91C_CAN_MB0_MCR WO } +- MID { R AT91C_CAN_MB0_MID RW } +- MSR { R AT91C_CAN_MB0_MSR RO } +- MFID { R AT91C_CAN_MB0_MFID RO } +- MDH { R AT91C_CAN_MB0_MDH RW } +- MMR { R AT91C_CAN_MB0_MMR RW } +- listeReg { MDL MAM MCR MID MSR MFID MDH MMR } +- +-} +-array set CAN_MB1_att { +- MDL { R AT91C_CAN_MB1_MDL RW } +- MID { R AT91C_CAN_MB1_MID RW } +- MMR { R AT91C_CAN_MB1_MMR RW } +- MSR { R AT91C_CAN_MB1_MSR RO } +- MAM { R AT91C_CAN_MB1_MAM RW } +- MDH { R AT91C_CAN_MB1_MDH RW } +- MCR { R AT91C_CAN_MB1_MCR WO } +- MFID { R AT91C_CAN_MB1_MFID RO } +- listeReg { MDL MID MMR MSR MAM MDH MCR MFID } +- +-} +-array set CAN_MB2_att { +- MCR { R AT91C_CAN_MB2_MCR WO } +- MDH { R AT91C_CAN_MB2_MDH RW } +- MID { R AT91C_CAN_MB2_MID RW } +- MDL { R AT91C_CAN_MB2_MDL RW } +- MMR { R AT91C_CAN_MB2_MMR RW } +- MAM { R AT91C_CAN_MB2_MAM RW } +- MFID { R AT91C_CAN_MB2_MFID RO } +- MSR { R AT91C_CAN_MB2_MSR RO } +- listeReg { MCR MDH MID MDL MMR MAM MFID MSR } +- +-} +-array set CAN_MB3_att { +- MFID { R AT91C_CAN_MB3_MFID RO } +- MAM { R AT91C_CAN_MB3_MAM RW } +- MID { R AT91C_CAN_MB3_MID RW } +- MCR { R AT91C_CAN_MB3_MCR WO } +- MMR { R AT91C_CAN_MB3_MMR RW } +- MSR { R AT91C_CAN_MB3_MSR RO } +- MDL { R AT91C_CAN_MB3_MDL RW } +- MDH { R AT91C_CAN_MB3_MDH RW } +- listeReg { MFID MAM MID MCR MMR MSR MDL MDH } +- +-} +-array set CAN_MB4_att { +- MID { R AT91C_CAN_MB4_MID RW } +- MMR { R AT91C_CAN_MB4_MMR RW } +- MDH { R AT91C_CAN_MB4_MDH RW } +- MFID { R AT91C_CAN_MB4_MFID RO } +- MSR { R AT91C_CAN_MB4_MSR RO } +- MCR { R AT91C_CAN_MB4_MCR WO } +- MDL { R AT91C_CAN_MB4_MDL RW } +- MAM { R AT91C_CAN_MB4_MAM RW } +- listeReg { MID MMR MDH MFID MSR MCR MDL MAM } +- +-} +-array set CAN_MB5_att { +- MSR { R AT91C_CAN_MB5_MSR RO } +- MCR { R AT91C_CAN_MB5_MCR WO } +- MFID { R AT91C_CAN_MB5_MFID RO } +- MDH { R AT91C_CAN_MB5_MDH RW } +- MID { R AT91C_CAN_MB5_MID RW } +- MMR { R AT91C_CAN_MB5_MMR RW } +- MDL { R AT91C_CAN_MB5_MDL RW } +- MAM { R AT91C_CAN_MB5_MAM RW } +- listeReg { MSR MCR MFID MDH MID MMR MDL MAM } +- +-} +-array set CAN_MB6_att { +- MFID { R AT91C_CAN_MB6_MFID RO } +- MID { R AT91C_CAN_MB6_MID RW } +- MAM { R AT91C_CAN_MB6_MAM RW } +- MSR { R AT91C_CAN_MB6_MSR RO } +- MDL { R AT91C_CAN_MB6_MDL RW } +- MCR { R AT91C_CAN_MB6_MCR WO } +- MDH { R AT91C_CAN_MB6_MDH RW } +- MMR { R AT91C_CAN_MB6_MMR RW } +- listeReg { MFID MID MAM MSR MDL MCR MDH MMR } +- +-} +-array set CAN_MB7_att { +- MCR { R AT91C_CAN_MB7_MCR WO } +- MDH { R AT91C_CAN_MB7_MDH RW } +- MFID { R AT91C_CAN_MB7_MFID RO } +- MDL { R AT91C_CAN_MB7_MDL RW } +- MID { R AT91C_CAN_MB7_MID RW } +- MMR { R AT91C_CAN_MB7_MMR RW } +- MAM { R AT91C_CAN_MB7_MAM RW } +- MSR { R AT91C_CAN_MB7_MSR RO } +- listeReg { MCR MDH MFID MDL MID MMR MAM MSR } +- +-} +- +-# ========== Peripheral attributes for TC peripheral ========== +-array set TC0_att { +- SR { R AT91C_TC0_SR RO } +- RC { R AT91C_TC0_RC RW } +- RB { R AT91C_TC0_RB RW } +- CCR { R AT91C_TC0_CCR WO } +- CMR { R AT91C_TC0_CMR RW } +- IER { R AT91C_TC0_IER WO } +- RA { R AT91C_TC0_RA RW } +- IDR { R AT91C_TC0_IDR WO } +- CV { R AT91C_TC0_CV RW } +- IMR { R AT91C_TC0_IMR RO } +- listeReg { SR RC RB CCR CMR IER RA IDR CV IMR } +- +-} +-array set TC1_att { +- RB { R AT91C_TC1_RB RW } +- CCR { R AT91C_TC1_CCR WO } +- IER { R AT91C_TC1_IER WO } +- IDR { R AT91C_TC1_IDR WO } +- SR { R AT91C_TC1_SR RO } +- CMR { R AT91C_TC1_CMR RW } +- RA { R AT91C_TC1_RA RW } +- RC { R AT91C_TC1_RC RW } +- IMR { R AT91C_TC1_IMR RO } +- CV { R AT91C_TC1_CV RW } +- listeReg { RB CCR IER IDR SR CMR RA RC IMR CV } +- +-} +-array set TC2_att { +- CMR { R AT91C_TC2_CMR RW } +- CCR { R AT91C_TC2_CCR WO } +- CV { R AT91C_TC2_CV RW } +- RA { R AT91C_TC2_RA RW } +- RB { R AT91C_TC2_RB RW } +- IDR { R AT91C_TC2_IDR WO } +- IMR { R AT91C_TC2_IMR RO } +- RC { R AT91C_TC2_RC RW } +- IER { R AT91C_TC2_IER WO } +- SR { R AT91C_TC2_SR RO } +- listeReg { CMR CCR CV RA RB IDR IMR RC IER SR } +- +-} +- +-# ========== Peripheral attributes for SYS peripheral ========== +-array set SYS_att { +- listeReg { } +- +-} +- +-# ========== Peripheral attributes for MC peripheral ========== +-array set MC_att { +- ASR { R AT91C_MC_ASR RO } +- RCR { R AT91C_MC_RCR WO } +- FCR { R AT91C_MC_FCR WO } +- AASR { R AT91C_MC_AASR RO } +- FSR { R AT91C_MC_FSR RO } +- FMR { R AT91C_MC_FMR RW } +- listeReg { ASR RCR FCR AASR FSR FMR } +- +-} +- +-# ========== Peripheral attributes for PIO peripheral ========== +-array set PIOA_att { +- ODR { R AT91C_PIOA_ODR WO } +- SODR { R AT91C_PIOA_SODR WO } +- ISR { R AT91C_PIOA_ISR RO } +- ABSR { R AT91C_PIOA_ABSR RO } +- IER { R AT91C_PIOA_IER WO } +- PPUDR { R AT91C_PIOA_PPUDR WO } +- IMR { R AT91C_PIOA_IMR RO } +- PER { R AT91C_PIOA_PER WO } +- IFDR { R AT91C_PIOA_IFDR WO } +- OWDR { R AT91C_PIOA_OWDR WO } +- MDSR { R AT91C_PIOA_MDSR RO } +- IDR { R AT91C_PIOA_IDR WO } +- ODSR { R AT91C_PIOA_ODSR RO } +- PPUSR { R AT91C_PIOA_PPUSR RO } +- OWSR { R AT91C_PIOA_OWSR RO } +- BSR { R AT91C_PIOA_BSR WO } +- OWER { R AT91C_PIOA_OWER WO } +- IFER { R AT91C_PIOA_IFER WO } +- PDSR { R AT91C_PIOA_PDSR RO } +- PPUER { R AT91C_PIOA_PPUER WO } +- OSR { R AT91C_PIOA_OSR RO } +- ASR { R AT91C_PIOA_ASR WO } +- MDDR { R AT91C_PIOA_MDDR WO } +- CODR { R AT91C_PIOA_CODR WO } +- MDER { R AT91C_PIOA_MDER WO } +- PDR { R AT91C_PIOA_PDR WO } +- IFSR { R AT91C_PIOA_IFSR RO } +- OER { R AT91C_PIOA_OER WO } +- PSR { R AT91C_PIOA_PSR RO } +- listeReg { ODR SODR ISR ABSR IER PPUDR IMR PER IFDR OWDR MDSR IDR ODSR PPUSR OWSR BSR OWER IFER PDSR PPUER OSR ASR MDDR CODR MDER PDR IFSR OER PSR } +- +-} +-array set PIOB_att { +- OWDR { R AT91C_PIOB_OWDR WO } +- MDER { R AT91C_PIOB_MDER WO } +- PPUSR { R AT91C_PIOB_PPUSR RO } +- IMR { R AT91C_PIOB_IMR RO } +- ASR { R AT91C_PIOB_ASR WO } +- PPUDR { R AT91C_PIOB_PPUDR WO } +- PSR { R AT91C_PIOB_PSR RO } +- IER { R AT91C_PIOB_IER WO } +- CODR { R AT91C_PIOB_CODR WO } +- OWER { R AT91C_PIOB_OWER WO } +- ABSR { R AT91C_PIOB_ABSR RO } +- IFDR { R AT91C_PIOB_IFDR WO } +- PDSR { R AT91C_PIOB_PDSR RO } +- IDR { R AT91C_PIOB_IDR WO } +- OWSR { R AT91C_PIOB_OWSR RO } +- PDR { R AT91C_PIOB_PDR WO } +- ODR { R AT91C_PIOB_ODR WO } +- IFSR { R AT91C_PIOB_IFSR RO } +- PPUER { R AT91C_PIOB_PPUER WO } +- SODR { R AT91C_PIOB_SODR WO } +- ISR { R AT91C_PIOB_ISR RO } +- ODSR { R AT91C_PIOB_ODSR RO } +- OSR { R AT91C_PIOB_OSR RO } +- MDSR { R AT91C_PIOB_MDSR RO } +- IFER { R AT91C_PIOB_IFER WO } +- BSR { R AT91C_PIOB_BSR WO } +- MDDR { R AT91C_PIOB_MDDR WO } +- OER { R AT91C_PIOB_OER WO } +- PER { R AT91C_PIOB_PER WO } +- listeReg { OWDR MDER PPUSR IMR ASR PPUDR PSR IER CODR OWER ABSR IFDR PDSR IDR OWSR PDR ODR IFSR PPUER SODR ISR ODSR OSR MDSR IFER BSR MDDR OER PER } +- +-} +- +-# ========== Peripheral attributes for CAN peripheral ========== +-array set CAN_att { +- TCR { R AT91C_CAN_TCR WO } +- IMR { R AT91C_CAN_IMR RO } +- IER { R AT91C_CAN_IER WO } +- ECR { R AT91C_CAN_ECR RO } +- TIMESTP { R AT91C_CAN_TIMESTP RO } +- MR { R AT91C_CAN_MR RW } +- IDR { R AT91C_CAN_IDR WO } +- ACR { R AT91C_CAN_ACR WO } +- TIM { R AT91C_CAN_TIM RO } +- SR { R AT91C_CAN_SR RO } +- BR { R AT91C_CAN_BR RW } +- VR { R AT91C_CAN_VR RO } +- listeReg { TCR IMR IER ECR TIMESTP MR IDR ACR TIM SR BR VR } +- +-} +- +-# ========== Peripheral attributes for PWMC peripheral ========== +-array set PWMC_att { +- IDR { R AT91C_PWMC_IDR WO } +- DIS { R AT91C_PWMC_DIS WO } +- IER { R AT91C_PWMC_IER WO } +- VR { R AT91C_PWMC_VR RO } +- ISR { R AT91C_PWMC_ISR RO } +- SR { R AT91C_PWMC_SR RO } +- IMR { R AT91C_PWMC_IMR RO } +- MR { R AT91C_PWMC_MR RW } +- ENA { R AT91C_PWMC_ENA WO } +- listeReg { IDR DIS IER VR ISR SR IMR MR ENA } +- +-} +- +-# ========== Peripheral attributes for PDC peripheral ========== +-array set PDC_DBGU_att { +- TCR { R AT91C_DBGU_TCR RW } +- RNPR { R AT91C_DBGU_RNPR RW } +- TNPR { R AT91C_DBGU_TNPR RW } +- TPR { R AT91C_DBGU_TPR RW } +- RPR { R AT91C_DBGU_RPR RW } +- RCR { R AT91C_DBGU_RCR RW } +- RNCR { R AT91C_DBGU_RNCR RW } +- PTCR { R AT91C_DBGU_PTCR WO } +- PTSR { R AT91C_DBGU_PTSR RO } +- TNCR { R AT91C_DBGU_TNCR RW } +- listeReg { TCR RNPR TNPR TPR RPR RCR RNCR PTCR PTSR TNCR } +- +-} +-array set PDC_SPI1_att { +- PTCR { R AT91C_SPI1_PTCR WO } +- RPR { R AT91C_SPI1_RPR RW } +- TNCR { R AT91C_SPI1_TNCR RW } +- TPR { R AT91C_SPI1_TPR RW } +- TNPR { R AT91C_SPI1_TNPR RW } +- TCR { R AT91C_SPI1_TCR RW } +- RCR { R AT91C_SPI1_RCR RW } +- RNPR { R AT91C_SPI1_RNPR RW } +- RNCR { R AT91C_SPI1_RNCR RW } +- PTSR { R AT91C_SPI1_PTSR RO } +- listeReg { PTCR RPR TNCR TPR TNPR TCR RCR RNPR RNCR PTSR } +- +-} +-array set PDC_SPI0_att { +- PTCR { R AT91C_SPI0_PTCR WO } +- TPR { R AT91C_SPI0_TPR RW } +- TCR { R AT91C_SPI0_TCR RW } +- RCR { R AT91C_SPI0_RCR RW } +- PTSR { R AT91C_SPI0_PTSR RO } +- RNPR { R AT91C_SPI0_RNPR RW } +- RPR { R AT91C_SPI0_RPR RW } +- TNCR { R AT91C_SPI0_TNCR RW } +- RNCR { R AT91C_SPI0_RNCR RW } +- TNPR { R AT91C_SPI0_TNPR RW } +- listeReg { PTCR TPR TCR RCR PTSR RNPR RPR TNCR RNCR TNPR } +- +-} +-array set PDC_US1_att { +- RNCR { R AT91C_US1_RNCR RW } +- PTCR { R AT91C_US1_PTCR WO } +- TCR { R AT91C_US1_TCR RW } +- PTSR { R AT91C_US1_PTSR RO } +- TNPR { R AT91C_US1_TNPR RW } +- RCR { R AT91C_US1_RCR RW } +- RNPR { R AT91C_US1_RNPR RW } +- RPR { R AT91C_US1_RPR RW } +- TNCR { R AT91C_US1_TNCR RW } +- TPR { R AT91C_US1_TPR RW } +- listeReg { RNCR PTCR TCR PTSR TNPR RCR RNPR RPR TNCR TPR } +- +-} +-array set PDC_US0_att { +- TNPR { R AT91C_US0_TNPR RW } +- RNPR { R AT91C_US0_RNPR RW } +- TCR { R AT91C_US0_TCR RW } +- PTCR { R AT91C_US0_PTCR WO } +- PTSR { R AT91C_US0_PTSR RO } +- TNCR { R AT91C_US0_TNCR RW } +- TPR { R AT91C_US0_TPR RW } +- RCR { R AT91C_US0_RCR RW } +- RPR { R AT91C_US0_RPR RW } +- RNCR { R AT91C_US0_RNCR RW } +- listeReg { TNPR RNPR TCR PTCR PTSR TNCR TPR RCR RPR RNCR } +- +-} +-array set PDC_SSC_att { +- TNCR { R AT91C_SSC_TNCR RW } +- RPR { R AT91C_SSC_RPR RW } +- RNCR { R AT91C_SSC_RNCR RW } +- TPR { R AT91C_SSC_TPR RW } +- PTCR { R AT91C_SSC_PTCR WO } +- TCR { R AT91C_SSC_TCR RW } +- RCR { R AT91C_SSC_RCR RW } +- RNPR { R AT91C_SSC_RNPR RW } +- TNPR { R AT91C_SSC_TNPR RW } +- PTSR { R AT91C_SSC_PTSR RO } +- listeReg { TNCR RPR RNCR TPR PTCR TCR RCR RNPR TNPR PTSR } +- +-} +-array set PDC_ADC_att { +- PTSR { R AT91C_ADC_PTSR RO } +- PTCR { R AT91C_ADC_PTCR WO } +- TNPR { R AT91C_ADC_TNPR RW } +- TNCR { R AT91C_ADC_TNCR RW } +- RNPR { R AT91C_ADC_RNPR RW } +- RNCR { R AT91C_ADC_RNCR RW } +- RPR { R AT91C_ADC_RPR RW } +- TCR { R AT91C_ADC_TCR RW } +- TPR { R AT91C_ADC_TPR RW } +- RCR { R AT91C_ADC_RCR RW } +- listeReg { PTSR PTCR TNPR TNCR RNPR RNCR RPR TCR TPR RCR } +- +-} +- +-# ========== PIO information ========== +- +-array set def_PIOA_att { +- PA0 { RXD0 } +- PA1 { TXD0 } +- PA10 { TWD } +- PA11 { TWCK } +- PA12 { SPI0_NPCS0 } +- PA13 { SPI0_NPCS1 PCK1 } +- PA14 { SPI0_NPCS2 IRQ1 } +- PA15 { SPI0_NPCS3 TCLK2 } +- PA16 { SPI0_MISO } +- PA17 { SPI0_MOSI } +- PA18 { SPI0_SPCK } +- PA19 { CANRX } +- PA2 { SCK0 SPI1_NPCS1 } +- PA20 { CANTX } +- PA21 { TF SPI1_NPCS0 } +- PA22 { TK SPI1_SPCK } +- PA23 { TD SPI1_MOSI } +- PA24 { RD SPI1_MISO } +- PA25 { RK SPI1_NPCS1 } +- PA26 { RF SPI1_NPCS2 } +- PA27 { DRXD PCK3 } +- PA28 { DTXD } +- PA29 { FIQ SPI1_NPCS3 } +- PA3 { RTS0 SPI1_NPCS2 } +- PA30 { IRQ0 PCK2 } +- PA4 { CTS0 SPI1_NPCS3 } +- PA5 { RXD1 } +- PA6 { TXD1 } +- PA7 { SCK1 SPI0_NPCS1 } +- PA8 { RTS1 SPI0_NPCS2 } +- PA9 { CTS1 SPI0_NPCS3 } +- } +- +-array set def_PIOB_att { +- PB0 { ETXCK_EREFCK PCK0 } +- PB1 { ETXEN } +- PB10 { ETX2 SPI1_NPCS1 } +- PB11 { ETX3 SPI1_NPCS2 } +- PB12 { ETXER TCLK0 } +- PB13 { ERX2 SPI0_NPCS1 } +- PB14 { ERX3 SPI0_NPCS2 } +- PB15 { ERXDV_ECRSDV } +- PB16 { ECOL SPI1_NPCS3 } +- PB17 { ERXCK SPI0_NPCS3 } +- PB18 { EF100 ADTRG } +- PB19 { PWM0 TCLK1 } +- PB2 { ETX0 } +- PB20 { PWM1 PCK0 } +- PB21 { PWM2 PCK1 } +- PB22 { PWM3 PCK2 } +- PB23 { TIOA0 DCD1 } +- PB24 { TIOB0 DSR1 } +- PB25 { TIOA1 DTR1 } +- PB26 { TIOB1 RI1 } +- PB27 { TIOA2 PWM0 } +- PB28 { TIOB2 PWM1 } +- PB29 { PCK1 PWM2 } +- PB3 { ETX1 } +- PB30 { PCK2 PWM3 } +- PB4 { ECRS } +- PB5 { ERX0 } +- PB6 { ERX1 } +- PB7 { ERXER } +- PB8 { EMDC } +- PB9 { EMDIO } +- } +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256_inc.h b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256_inc.h +deleted file mode 100644 +index b393d05a3b..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256_inc.h ++++ /dev/null +@@ -1,2268 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h +-// Object : AT91SAM7X256 definitions +-// Generated : AT91 SW Application Group 11/02/2005 (15:17:24) +-// +-// CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// +-// CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// +-// CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// +-// CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// +-// CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// +-// CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// +-// CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// +-// CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// +-// CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// +-// CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// +-// CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// +-// CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// +-// CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// +-// CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// +-// CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// +-// CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// +-// CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// +-// CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// +-// CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// +-// CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// +-// CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// +-// CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// +-// CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// +-// ---------------------------------------------------------------------------- +- +-// Hardware register definition +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR System Peripherals +-// ***************************************************************************** +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Advanced Interrupt Controller +-// ***************************************************************************** +-// *** Register offset in AT91S_AIC structure *** +-#define AIC_SMR ( 0) // Source Mode Register +-#define AIC_SVR (128) // Source Vector Register +-#define AIC_IVR (256) // IRQ Vector Register +-#define AIC_FVR (260) // FIQ Vector Register +-#define AIC_ISR (264) // Interrupt Status Register +-#define AIC_IPR (268) // Interrupt Pending Register +-#define AIC_IMR (272) // Interrupt Mask Register +-#define AIC_CISR (276) // Core Interrupt Status Register +-#define AIC_IECR (288) // Interrupt Enable Command Register +-#define AIC_IDCR (292) // Interrupt Disable Command Register +-#define AIC_ICCR (296) // Interrupt Clear Command Register +-#define AIC_ISCR (300) // Interrupt Set Command Register +-#define AIC_EOICR (304) // End of Interrupt Command Register +-#define AIC_SPU (308) // Spurious Vector Register +-#define AIC_DCR (312) // Debug Control Register (Protect) +-#define AIC_FFER (320) // Fast Forcing Enable Register +-#define AIC_FFDR (324) // Fast Forcing Disable Register +-#define AIC_FFSR (328) // Fast Forcing Status Register +-// -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- +-#define AT91C_AIC_PRIOR (0x7 << 0) // (AIC) Priority Level +-#define AT91C_AIC_PRIOR_LOWEST (0x0) // (AIC) Lowest priority level +-#define AT91C_AIC_PRIOR_HIGHEST (0x7) // (AIC) Highest priority level +-#define AT91C_AIC_SRCTYPE (0x3 << 5) // (AIC) Interrupt Source Type +-#define AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL (0x0 << 5) // (AIC) Internal Sources Code Label High-level Sensitive +-#define AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL (0x0 << 5) // (AIC) External Sources Code Label Low-level Sensitive +-#define AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE (0x1 << 5) // (AIC) Internal Sources Code Label Positive Edge triggered +-#define AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE (0x1 << 5) // (AIC) External Sources Code Label Negative Edge triggered +-#define AT91C_AIC_SRCTYPE_HIGH_LEVEL (0x2 << 5) // (AIC) Internal Or External Sources Code Label High-level Sensitive +-#define AT91C_AIC_SRCTYPE_POSITIVE_EDGE (0x3 << 5) // (AIC) Internal Or External Sources Code Label Positive Edge triggered +-// -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- +-#define AT91C_AIC_NFIQ (0x1 << 0) // (AIC) NFIQ Status +-#define AT91C_AIC_NIRQ (0x1 << 1) // (AIC) NIRQ Status +-// -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- +-#define AT91C_AIC_DCR_PROT (0x1 << 0) // (AIC) Protection Mode +-#define AT91C_AIC_DCR_GMSK (0x1 << 1) // (AIC) General Mask +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Peripheral DMA Controller +-// ***************************************************************************** +-// *** Register offset in AT91S_PDC structure *** +-#define PDC_RPR ( 0) // Receive Pointer Register +-#define PDC_RCR ( 4) // Receive Counter Register +-#define PDC_TPR ( 8) // Transmit Pointer Register +-#define PDC_TCR (12) // Transmit Counter Register +-#define PDC_RNPR (16) // Receive Next Pointer Register +-#define PDC_RNCR (20) // Receive Next Counter Register +-#define PDC_TNPR (24) // Transmit Next Pointer Register +-#define PDC_TNCR (28) // Transmit Next Counter Register +-#define PDC_PTCR (32) // PDC Transfer Control Register +-#define PDC_PTSR (36) // PDC Transfer Status Register +-// -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- +-#define AT91C_PDC_RXTEN (0x1 << 0) // (PDC) Receiver Transfer Enable +-#define AT91C_PDC_RXTDIS (0x1 << 1) // (PDC) Receiver Transfer Disable +-#define AT91C_PDC_TXTEN (0x1 << 8) // (PDC) Transmitter Transfer Enable +-#define AT91C_PDC_TXTDIS (0x1 << 9) // (PDC) Transmitter Transfer Disable +-// -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Debug Unit +-// ***************************************************************************** +-// *** Register offset in AT91S_DBGU structure *** +-#define DBGU_CR ( 0) // Control Register +-#define DBGU_MR ( 4) // Mode Register +-#define DBGU_IER ( 8) // Interrupt Enable Register +-#define DBGU_IDR (12) // Interrupt Disable Register +-#define DBGU_IMR (16) // Interrupt Mask Register +-#define DBGU_CSR (20) // Channel Status Register +-#define DBGU_RHR (24) // Receiver Holding Register +-#define DBGU_THR (28) // Transmitter Holding Register +-#define DBGU_BRGR (32) // Baud Rate Generator Register +-#define DBGU_CIDR (64) // Chip ID Register +-#define DBGU_EXID (68) // Chip ID Extension Register +-#define DBGU_FNTR (72) // Force NTRST Register +-#define DBGU_RPR (256) // Receive Pointer Register +-#define DBGU_RCR (260) // Receive Counter Register +-#define DBGU_TPR (264) // Transmit Pointer Register +-#define DBGU_TCR (268) // Transmit Counter Register +-#define DBGU_RNPR (272) // Receive Next Pointer Register +-#define DBGU_RNCR (276) // Receive Next Counter Register +-#define DBGU_TNPR (280) // Transmit Next Pointer Register +-#define DBGU_TNCR (284) // Transmit Next Counter Register +-#define DBGU_PTCR (288) // PDC Transfer Control Register +-#define DBGU_PTSR (292) // PDC Transfer Status Register +-// -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- +-#define AT91C_US_RSTRX (0x1 << 2) // (DBGU) Reset Receiver +-#define AT91C_US_RSTTX (0x1 << 3) // (DBGU) Reset Transmitter +-#define AT91C_US_RXEN (0x1 << 4) // (DBGU) Receiver Enable +-#define AT91C_US_RXDIS (0x1 << 5) // (DBGU) Receiver Disable +-#define AT91C_US_TXEN (0x1 << 6) // (DBGU) Transmitter Enable +-#define AT91C_US_TXDIS (0x1 << 7) // (DBGU) Transmitter Disable +-#define AT91C_US_RSTSTA (0x1 << 8) // (DBGU) Reset Status Bits +-// -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- +-#define AT91C_US_PAR (0x7 << 9) // (DBGU) Parity type +-#define AT91C_US_PAR_EVEN (0x0 << 9) // (DBGU) Even Parity +-#define AT91C_US_PAR_ODD (0x1 << 9) // (DBGU) Odd Parity +-#define AT91C_US_PAR_SPACE (0x2 << 9) // (DBGU) Parity forced to 0 (Space) +-#define AT91C_US_PAR_MARK (0x3 << 9) // (DBGU) Parity forced to 1 (Mark) +-#define AT91C_US_PAR_NONE (0x4 << 9) // (DBGU) No Parity +-#define AT91C_US_PAR_MULTI_DROP (0x6 << 9) // (DBGU) Multi-drop mode +-#define AT91C_US_CHMODE (0x3 << 14) // (DBGU) Channel Mode +-#define AT91C_US_CHMODE_NORMAL (0x0 << 14) // (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. +-#define AT91C_US_CHMODE_AUTO (0x1 << 14) // (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. +-#define AT91C_US_CHMODE_LOCAL (0x2 << 14) // (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. +-#define AT91C_US_CHMODE_REMOTE (0x3 << 14) // (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. +-// -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-#define AT91C_US_RXRDY (0x1 << 0) // (DBGU) RXRDY Interrupt +-#define AT91C_US_TXRDY (0x1 << 1) // (DBGU) TXRDY Interrupt +-#define AT91C_US_ENDRX (0x1 << 3) // (DBGU) End of Receive Transfer Interrupt +-#define AT91C_US_ENDTX (0x1 << 4) // (DBGU) End of Transmit Interrupt +-#define AT91C_US_OVRE (0x1 << 5) // (DBGU) Overrun Interrupt +-#define AT91C_US_FRAME (0x1 << 6) // (DBGU) Framing Error Interrupt +-#define AT91C_US_PARE (0x1 << 7) // (DBGU) Parity Error Interrupt +-#define AT91C_US_TXEMPTY (0x1 << 9) // (DBGU) TXEMPTY Interrupt +-#define AT91C_US_TXBUFE (0x1 << 11) // (DBGU) TXBUFE Interrupt +-#define AT91C_US_RXBUFF (0x1 << 12) // (DBGU) RXBUFF Interrupt +-#define AT91C_US_COMM_TX (0x1 << 30) // (DBGU) COMM_TX Interrupt +-#define AT91C_US_COMM_RX (0x1 << 31) // (DBGU) COMM_RX Interrupt +-// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- +-// -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- +-#define AT91C_US_FORCE_NTRST (0x1 << 0) // (DBGU) Force NTRST in JTAG +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Parallel Input Output Controler +-// ***************************************************************************** +-// *** Register offset in AT91S_PIO structure *** +-#define PIO_PER ( 0) // PIO Enable Register +-#define PIO_PDR ( 4) // PIO Disable Register +-#define PIO_PSR ( 8) // PIO Status Register +-#define PIO_OER (16) // Output Enable Register +-#define PIO_ODR (20) // Output Disable Registerr +-#define PIO_OSR (24) // Output Status Register +-#define PIO_IFER (32) // Input Filter Enable Register +-#define PIO_IFDR (36) // Input Filter Disable Register +-#define PIO_IFSR (40) // Input Filter Status Register +-#define PIO_SODR (48) // Set Output Data Register +-#define PIO_CODR (52) // Clear Output Data Register +-#define PIO_ODSR (56) // Output Data Status Register +-#define PIO_PDSR (60) // Pin Data Status Register +-#define PIO_IER (64) // Interrupt Enable Register +-#define PIO_IDR (68) // Interrupt Disable Register +-#define PIO_IMR (72) // Interrupt Mask Register +-#define PIO_ISR (76) // Interrupt Status Register +-#define PIO_MDER (80) // Multi-driver Enable Register +-#define PIO_MDDR (84) // Multi-driver Disable Register +-#define PIO_MDSR (88) // Multi-driver Status Register +-#define PIO_PPUDR (96) // Pull-up Disable Register +-#define PIO_PPUER (100) // Pull-up Enable Register +-#define PIO_PPUSR (104) // Pull-up Status Register +-#define PIO_ASR (112) // Select A Register +-#define PIO_BSR (116) // Select B Register +-#define PIO_ABSR (120) // AB Select Status Register +-#define PIO_OWER (160) // Output Write Enable Register +-#define PIO_OWDR (164) // Output Write Disable Register +-#define PIO_OWSR (168) // Output Write Status Register +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Clock Generator Controler +-// ***************************************************************************** +-// *** Register offset in AT91S_CKGR structure *** +-#define CKGR_MOR ( 0) // Main Oscillator Register +-#define CKGR_MCFR ( 4) // Main Clock Frequency Register +-#define CKGR_PLLR (12) // PLL Register +-// -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- +-#define AT91C_CKGR_MOSCEN (0x1 << 0) // (CKGR) Main Oscillator Enable +-#define AT91C_CKGR_OSCBYPASS (0x1 << 1) // (CKGR) Main Oscillator Bypass +-#define AT91C_CKGR_OSCOUNT (0xFF << 8) // (CKGR) Main Oscillator Start-up Time +-// -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- +-#define AT91C_CKGR_MAINF (0xFFFF << 0) // (CKGR) Main Clock Frequency +-#define AT91C_CKGR_MAINRDY (0x1 << 16) // (CKGR) Main Clock Ready +-// -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- +-#define AT91C_CKGR_DIV (0xFF << 0) // (CKGR) Divider Selected +-#define AT91C_CKGR_DIV_0 (0x0) // (CKGR) Divider output is 0 +-#define AT91C_CKGR_DIV_BYPASS (0x1) // (CKGR) Divider is bypassed +-#define AT91C_CKGR_PLLCOUNT (0x3F << 8) // (CKGR) PLL Counter +-#define AT91C_CKGR_OUT (0x3 << 14) // (CKGR) PLL Output Frequency Range +-#define AT91C_CKGR_OUT_0 (0x0 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_1 (0x1 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_2 (0x2 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_3 (0x3 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_MUL (0x7FF << 16) // (CKGR) PLL Multiplier +-#define AT91C_CKGR_USBDIV (0x3 << 28) // (CKGR) Divider for USB Clocks +-#define AT91C_CKGR_USBDIV_0 (0x0 << 28) // (CKGR) Divider output is PLL clock output +-#define AT91C_CKGR_USBDIV_1 (0x1 << 28) // (CKGR) Divider output is PLL clock output divided by 2 +-#define AT91C_CKGR_USBDIV_2 (0x2 << 28) // (CKGR) Divider output is PLL clock output divided by 4 +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Power Management Controler +-// ***************************************************************************** +-// *** Register offset in AT91S_PMC structure *** +-#define PMC_SCER ( 0) // System Clock Enable Register +-#define PMC_SCDR ( 4) // System Clock Disable Register +-#define PMC_SCSR ( 8) // System Clock Status Register +-#define PMC_PCER (16) // Peripheral Clock Enable Register +-#define PMC_PCDR (20) // Peripheral Clock Disable Register +-#define PMC_PCSR (24) // Peripheral Clock Status Register +-#define PMC_MOR (32) // Main Oscillator Register +-#define PMC_MCFR (36) // Main Clock Frequency Register +-#define PMC_PLLR (44) // PLL Register +-#define PMC_MCKR (48) // Master Clock Register +-#define PMC_PCKR (64) // Programmable Clock Register +-#define PMC_IER (96) // Interrupt Enable Register +-#define PMC_IDR (100) // Interrupt Disable Register +-#define PMC_SR (104) // Status Register +-#define PMC_IMR (108) // Interrupt Mask Register +-// -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- +-#define AT91C_PMC_PCK (0x1 << 0) // (PMC) Processor Clock +-#define AT91C_PMC_UDP (0x1 << 7) // (PMC) USB Device Port Clock +-#define AT91C_PMC_PCK0 (0x1 << 8) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK1 (0x1 << 9) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK2 (0x1 << 10) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK3 (0x1 << 11) // (PMC) Programmable Clock Output +-// -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- +-// -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- +-// -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- +-// -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- +-// -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- +-// -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- +-#define AT91C_PMC_CSS (0x3 << 0) // (PMC) Programmable Clock Selection +-#define AT91C_PMC_CSS_SLOW_CLK (0x0) // (PMC) Slow Clock is selected +-#define AT91C_PMC_CSS_MAIN_CLK (0x1) // (PMC) Main Clock is selected +-#define AT91C_PMC_CSS_PLL_CLK (0x3) // (PMC) Clock from PLL is selected +-#define AT91C_PMC_PRES (0x7 << 2) // (PMC) Programmable Clock Prescaler +-#define AT91C_PMC_PRES_CLK (0x0 << 2) // (PMC) Selected clock +-#define AT91C_PMC_PRES_CLK_2 (0x1 << 2) // (PMC) Selected clock divided by 2 +-#define AT91C_PMC_PRES_CLK_4 (0x2 << 2) // (PMC) Selected clock divided by 4 +-#define AT91C_PMC_PRES_CLK_8 (0x3 << 2) // (PMC) Selected clock divided by 8 +-#define AT91C_PMC_PRES_CLK_16 (0x4 << 2) // (PMC) Selected clock divided by 16 +-#define AT91C_PMC_PRES_CLK_32 (0x5 << 2) // (PMC) Selected clock divided by 32 +-#define AT91C_PMC_PRES_CLK_64 (0x6 << 2) // (PMC) Selected clock divided by 64 +-// -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- +-// -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- +-#define AT91C_PMC_MOSCS (0x1 << 0) // (PMC) MOSC Status/Enable/Disable/Mask +-#define AT91C_PMC_LOCK (0x1 << 2) // (PMC) PLL Status/Enable/Disable/Mask +-#define AT91C_PMC_MCKRDY (0x1 << 3) // (PMC) MCK_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK0RDY (0x1 << 8) // (PMC) PCK0_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK1RDY (0x1 << 9) // (PMC) PCK1_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK2RDY (0x1 << 10) // (PMC) PCK2_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK3RDY (0x1 << 11) // (PMC) PCK3_RDY Status/Enable/Disable/Mask +-// -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- +-// -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- +-// -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Reset Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_RSTC structure *** +-#define RSTC_RCR ( 0) // Reset Control Register +-#define RSTC_RSR ( 4) // Reset Status Register +-#define RSTC_RMR ( 8) // Reset Mode Register +-// -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- +-#define AT91C_RSTC_PROCRST (0x1 << 0) // (RSTC) Processor Reset +-#define AT91C_RSTC_PERRST (0x1 << 2) // (RSTC) Peripheral Reset +-#define AT91C_RSTC_EXTRST (0x1 << 3) // (RSTC) External Reset +-#define AT91C_RSTC_KEY (0xFF << 24) // (RSTC) Password +-// -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- +-#define AT91C_RSTC_URSTS (0x1 << 0) // (RSTC) User Reset Status +-#define AT91C_RSTC_BODSTS (0x1 << 1) // (RSTC) Brownout Detection Status +-#define AT91C_RSTC_RSTTYP (0x7 << 8) // (RSTC) Reset Type +-#define AT91C_RSTC_RSTTYP_POWERUP (0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising. +-#define AT91C_RSTC_RSTTYP_WAKEUP (0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising. +-#define AT91C_RSTC_RSTTYP_WATCHDOG (0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occured. +-#define AT91C_RSTC_RSTTYP_SOFTWARE (0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software. +-#define AT91C_RSTC_RSTTYP_USER (0x4 << 8) // (RSTC) User Reset. NRST pin detected low. +-#define AT91C_RSTC_RSTTYP_BROWNOUT (0x5 << 8) // (RSTC) Brownout Reset occured. +-#define AT91C_RSTC_NRSTL (0x1 << 16) // (RSTC) NRST pin level +-#define AT91C_RSTC_SRCMP (0x1 << 17) // (RSTC) Software Reset Command in Progress. +-// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- +-#define AT91C_RSTC_URSTEN (0x1 << 0) // (RSTC) User Reset Enable +-#define AT91C_RSTC_URSTIEN (0x1 << 4) // (RSTC) User Reset Interrupt Enable +-#define AT91C_RSTC_ERSTL (0xF << 8) // (RSTC) User Reset Length +-#define AT91C_RSTC_BODIEN (0x1 << 16) // (RSTC) Brownout Detection Interrupt Enable +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_RTTC structure *** +-#define RTTC_RTMR ( 0) // Real-time Mode Register +-#define RTTC_RTAR ( 4) // Real-time Alarm Register +-#define RTTC_RTVR ( 8) // Real-time Value Register +-#define RTTC_RTSR (12) // Real-time Status Register +-// -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- +-#define AT91C_RTTC_RTPRES (0xFFFF << 0) // (RTTC) Real-time Timer Prescaler Value +-#define AT91C_RTTC_ALMIEN (0x1 << 16) // (RTTC) Alarm Interrupt Enable +-#define AT91C_RTTC_RTTINCIEN (0x1 << 17) // (RTTC) Real Time Timer Increment Interrupt Enable +-#define AT91C_RTTC_RTTRST (0x1 << 18) // (RTTC) Real Time Timer Restart +-// -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- +-#define AT91C_RTTC_ALMV (0x0 << 0) // (RTTC) Alarm Value +-// -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- +-#define AT91C_RTTC_CRTV (0x0 << 0) // (RTTC) Current Real-time Value +-// -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- +-#define AT91C_RTTC_ALMS (0x1 << 0) // (RTTC) Real-time Alarm Status +-#define AT91C_RTTC_RTTINC (0x1 << 1) // (RTTC) Real-time Timer Increment +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_PITC structure *** +-#define PITC_PIMR ( 0) // Period Interval Mode Register +-#define PITC_PISR ( 4) // Period Interval Status Register +-#define PITC_PIVR ( 8) // Period Interval Value Register +-#define PITC_PIIR (12) // Period Interval Image Register +-// -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- +-#define AT91C_PITC_PIV (0xFFFFF << 0) // (PITC) Periodic Interval Value +-#define AT91C_PITC_PITEN (0x1 << 24) // (PITC) Periodic Interval Timer Enabled +-#define AT91C_PITC_PITIEN (0x1 << 25) // (PITC) Periodic Interval Timer Interrupt Enable +-// -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- +-#define AT91C_PITC_PITS (0x1 << 0) // (PITC) Periodic Interval Timer Status +-// -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- +-#define AT91C_PITC_CPIV (0xFFFFF << 0) // (PITC) Current Periodic Interval Value +-#define AT91C_PITC_PICNT (0xFFF << 20) // (PITC) Periodic Interval Counter +-// -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_WDTC structure *** +-#define WDTC_WDCR ( 0) // Watchdog Control Register +-#define WDTC_WDMR ( 4) // Watchdog Mode Register +-#define WDTC_WDSR ( 8) // Watchdog Status Register +-// -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- +-#define AT91C_WDTC_WDRSTT (0x1 << 0) // (WDTC) Watchdog Restart +-#define AT91C_WDTC_KEY (0xFF << 24) // (WDTC) Watchdog KEY Password +-// -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- +-#define AT91C_WDTC_WDV (0xFFF << 0) // (WDTC) Watchdog Timer Restart +-#define AT91C_WDTC_WDFIEN (0x1 << 12) // (WDTC) Watchdog Fault Interrupt Enable +-#define AT91C_WDTC_WDRSTEN (0x1 << 13) // (WDTC) Watchdog Reset Enable +-#define AT91C_WDTC_WDRPROC (0x1 << 14) // (WDTC) Watchdog Timer Restart +-#define AT91C_WDTC_WDDIS (0x1 << 15) // (WDTC) Watchdog Disable +-#define AT91C_WDTC_WDD (0xFFF << 16) // (WDTC) Watchdog Delta Value +-#define AT91C_WDTC_WDDBGHLT (0x1 << 28) // (WDTC) Watchdog Debug Halt +-#define AT91C_WDTC_WDIDLEHLT (0x1 << 29) // (WDTC) Watchdog Idle Halt +-// -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- +-#define AT91C_WDTC_WDUNF (0x1 << 0) // (WDTC) Watchdog Underflow +-#define AT91C_WDTC_WDERR (0x1 << 1) // (WDTC) Watchdog Error +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_VREG structure *** +-#define VREG_MR ( 0) // Voltage Regulator Mode Register +-// -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- +-#define AT91C_VREG_PSTDBY (0x1 << 0) // (VREG) Voltage Regulator Power Standby Mode +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Memory Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_MC structure *** +-#define MC_RCR ( 0) // MC Remap Control Register +-#define MC_ASR ( 4) // MC Abort Status Register +-#define MC_AASR ( 8) // MC Abort Address Status Register +-#define MC_FMR (96) // MC Flash Mode Register +-#define MC_FCR (100) // MC Flash Command Register +-#define MC_FSR (104) // MC Flash Status Register +-// -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- +-#define AT91C_MC_RCB (0x1 << 0) // (MC) Remap Command Bit +-// -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- +-#define AT91C_MC_UNDADD (0x1 << 0) // (MC) Undefined Addess Abort Status +-#define AT91C_MC_MISADD (0x1 << 1) // (MC) Misaligned Addess Abort Status +-#define AT91C_MC_ABTSZ (0x3 << 8) // (MC) Abort Size Status +-#define AT91C_MC_ABTSZ_BYTE (0x0 << 8) // (MC) Byte +-#define AT91C_MC_ABTSZ_HWORD (0x1 << 8) // (MC) Half-word +-#define AT91C_MC_ABTSZ_WORD (0x2 << 8) // (MC) Word +-#define AT91C_MC_ABTTYP (0x3 << 10) // (MC) Abort Type Status +-#define AT91C_MC_ABTTYP_DATAR (0x0 << 10) // (MC) Data Read +-#define AT91C_MC_ABTTYP_DATAW (0x1 << 10) // (MC) Data Write +-#define AT91C_MC_ABTTYP_FETCH (0x2 << 10) // (MC) Code Fetch +-#define AT91C_MC_MST0 (0x1 << 16) // (MC) Master 0 Abort Source +-#define AT91C_MC_MST1 (0x1 << 17) // (MC) Master 1 Abort Source +-#define AT91C_MC_SVMST0 (0x1 << 24) // (MC) Saved Master 0 Abort Source +-#define AT91C_MC_SVMST1 (0x1 << 25) // (MC) Saved Master 1 Abort Source +-// -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- +-#define AT91C_MC_FRDY (0x1 << 0) // (MC) Flash Ready +-#define AT91C_MC_LOCKE (0x1 << 2) // (MC) Lock Error +-#define AT91C_MC_PROGE (0x1 << 3) // (MC) Programming Error +-#define AT91C_MC_NEBP (0x1 << 7) // (MC) No Erase Before Programming +-#define AT91C_MC_FWS (0x3 << 8) // (MC) Flash Wait State +-#define AT91C_MC_FWS_0FWS (0x0 << 8) // (MC) 1 cycle for Read, 2 for Write operations +-#define AT91C_MC_FWS_1FWS (0x1 << 8) // (MC) 2 cycles for Read, 3 for Write operations +-#define AT91C_MC_FWS_2FWS (0x2 << 8) // (MC) 3 cycles for Read, 4 for Write operations +-#define AT91C_MC_FWS_3FWS (0x3 << 8) // (MC) 4 cycles for Read, 4 for Write operations +-#define AT91C_MC_FMCN (0xFF << 16) // (MC) Flash Microsecond Cycle Number +-// -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- +-#define AT91C_MC_FCMD (0xF << 0) // (MC) Flash Command +-#define AT91C_MC_FCMD_START_PROG (0x1) // (MC) Starts the programming of th epage specified by PAGEN. +-#define AT91C_MC_FCMD_LOCK (0x2) // (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-#define AT91C_MC_FCMD_PROG_AND_LOCK (0x3) // (MC) The lock sequence automatically happens after the programming sequence is completed. +-#define AT91C_MC_FCMD_UNLOCK (0x4) // (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-#define AT91C_MC_FCMD_ERASE_ALL (0x8) // (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. +-#define AT91C_MC_FCMD_SET_GP_NVM (0xB) // (MC) Set General Purpose NVM bits. +-#define AT91C_MC_FCMD_CLR_GP_NVM (0xD) // (MC) Clear General Purpose NVM bits. +-#define AT91C_MC_FCMD_SET_SECURITY (0xF) // (MC) Set Security Bit. +-#define AT91C_MC_PAGEN (0x3FF << 8) // (MC) Page Number +-#define AT91C_MC_KEY (0xFF << 24) // (MC) Writing Protect Key +-// -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- +-#define AT91C_MC_SECURITY (0x1 << 4) // (MC) Security Bit Status +-#define AT91C_MC_GPNVM0 (0x1 << 8) // (MC) Sector 0 Lock Status +-#define AT91C_MC_GPNVM1 (0x1 << 9) // (MC) Sector 1 Lock Status +-#define AT91C_MC_GPNVM2 (0x1 << 10) // (MC) Sector 2 Lock Status +-#define AT91C_MC_GPNVM3 (0x1 << 11) // (MC) Sector 3 Lock Status +-#define AT91C_MC_GPNVM4 (0x1 << 12) // (MC) Sector 4 Lock Status +-#define AT91C_MC_GPNVM5 (0x1 << 13) // (MC) Sector 5 Lock Status +-#define AT91C_MC_GPNVM6 (0x1 << 14) // (MC) Sector 6 Lock Status +-#define AT91C_MC_GPNVM7 (0x1 << 15) // (MC) Sector 7 Lock Status +-#define AT91C_MC_LOCKS0 (0x1 << 16) // (MC) Sector 0 Lock Status +-#define AT91C_MC_LOCKS1 (0x1 << 17) // (MC) Sector 1 Lock Status +-#define AT91C_MC_LOCKS2 (0x1 << 18) // (MC) Sector 2 Lock Status +-#define AT91C_MC_LOCKS3 (0x1 << 19) // (MC) Sector 3 Lock Status +-#define AT91C_MC_LOCKS4 (0x1 << 20) // (MC) Sector 4 Lock Status +-#define AT91C_MC_LOCKS5 (0x1 << 21) // (MC) Sector 5 Lock Status +-#define AT91C_MC_LOCKS6 (0x1 << 22) // (MC) Sector 6 Lock Status +-#define AT91C_MC_LOCKS7 (0x1 << 23) // (MC) Sector 7 Lock Status +-#define AT91C_MC_LOCKS8 (0x1 << 24) // (MC) Sector 8 Lock Status +-#define AT91C_MC_LOCKS9 (0x1 << 25) // (MC) Sector 9 Lock Status +-#define AT91C_MC_LOCKS10 (0x1 << 26) // (MC) Sector 10 Lock Status +-#define AT91C_MC_LOCKS11 (0x1 << 27) // (MC) Sector 11 Lock Status +-#define AT91C_MC_LOCKS12 (0x1 << 28) // (MC) Sector 12 Lock Status +-#define AT91C_MC_LOCKS13 (0x1 << 29) // (MC) Sector 13 Lock Status +-#define AT91C_MC_LOCKS14 (0x1 << 30) // (MC) Sector 14 Lock Status +-#define AT91C_MC_LOCKS15 (0x1 << 31) // (MC) Sector 15 Lock Status +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Serial Parallel Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_SPI structure *** +-#define SPI_CR ( 0) // Control Register +-#define SPI_MR ( 4) // Mode Register +-#define SPI_RDR ( 8) // Receive Data Register +-#define SPI_TDR (12) // Transmit Data Register +-#define SPI_SR (16) // Status Register +-#define SPI_IER (20) // Interrupt Enable Register +-#define SPI_IDR (24) // Interrupt Disable Register +-#define SPI_IMR (28) // Interrupt Mask Register +-#define SPI_CSR (48) // Chip Select Register +-#define SPI_RPR (256) // Receive Pointer Register +-#define SPI_RCR (260) // Receive Counter Register +-#define SPI_TPR (264) // Transmit Pointer Register +-#define SPI_TCR (268) // Transmit Counter Register +-#define SPI_RNPR (272) // Receive Next Pointer Register +-#define SPI_RNCR (276) // Receive Next Counter Register +-#define SPI_TNPR (280) // Transmit Next Pointer Register +-#define SPI_TNCR (284) // Transmit Next Counter Register +-#define SPI_PTCR (288) // PDC Transfer Control Register +-#define SPI_PTSR (292) // PDC Transfer Status Register +-// -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- +-#define AT91C_SPI_SPIEN (0x1 << 0) // (SPI) SPI Enable +-#define AT91C_SPI_SPIDIS (0x1 << 1) // (SPI) SPI Disable +-#define AT91C_SPI_SWRST (0x1 << 7) // (SPI) SPI Software reset +-#define AT91C_SPI_LASTXFER (0x1 << 24) // (SPI) SPI Last Transfer +-// -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- +-#define AT91C_SPI_MSTR (0x1 << 0) // (SPI) Master/Slave Mode +-#define AT91C_SPI_PS (0x1 << 1) // (SPI) Peripheral Select +-#define AT91C_SPI_PS_FIXED (0x0 << 1) // (SPI) Fixed Peripheral Select +-#define AT91C_SPI_PS_VARIABLE (0x1 << 1) // (SPI) Variable Peripheral Select +-#define AT91C_SPI_PCSDEC (0x1 << 2) // (SPI) Chip Select Decode +-#define AT91C_SPI_FDIV (0x1 << 3) // (SPI) Clock Selection +-#define AT91C_SPI_MODFDIS (0x1 << 4) // (SPI) Mode Fault Detection +-#define AT91C_SPI_LLB (0x1 << 7) // (SPI) Clock Selection +-#define AT91C_SPI_PCS (0xF << 16) // (SPI) Peripheral Chip Select +-#define AT91C_SPI_DLYBCS (0xFF << 24) // (SPI) Delay Between Chip Selects +-// -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- +-#define AT91C_SPI_RD (0xFFFF << 0) // (SPI) Receive Data +-#define AT91C_SPI_RPCS (0xF << 16) // (SPI) Peripheral Chip Select Status +-// -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- +-#define AT91C_SPI_TD (0xFFFF << 0) // (SPI) Transmit Data +-#define AT91C_SPI_TPCS (0xF << 16) // (SPI) Peripheral Chip Select Status +-// -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- +-#define AT91C_SPI_RDRF (0x1 << 0) // (SPI) Receive Data Register Full +-#define AT91C_SPI_TDRE (0x1 << 1) // (SPI) Transmit Data Register Empty +-#define AT91C_SPI_MODF (0x1 << 2) // (SPI) Mode Fault Error +-#define AT91C_SPI_OVRES (0x1 << 3) // (SPI) Overrun Error Status +-#define AT91C_SPI_ENDRX (0x1 << 4) // (SPI) End of Receiver Transfer +-#define AT91C_SPI_ENDTX (0x1 << 5) // (SPI) End of Receiver Transfer +-#define AT91C_SPI_RXBUFF (0x1 << 6) // (SPI) RXBUFF Interrupt +-#define AT91C_SPI_TXBUFE (0x1 << 7) // (SPI) TXBUFE Interrupt +-#define AT91C_SPI_NSSR (0x1 << 8) // (SPI) NSSR Interrupt +-#define AT91C_SPI_TXEMPTY (0x1 << 9) // (SPI) TXEMPTY Interrupt +-#define AT91C_SPI_SPIENS (0x1 << 16) // (SPI) Enable Status +-// -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- +-// -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- +-// -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- +-// -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- +-#define AT91C_SPI_CPOL (0x1 << 0) // (SPI) Clock Polarity +-#define AT91C_SPI_NCPHA (0x1 << 1) // (SPI) Clock Phase +-#define AT91C_SPI_CSAAT (0x1 << 3) // (SPI) Chip Select Active After Transfer +-#define AT91C_SPI_BITS (0xF << 4) // (SPI) Bits Per Transfer +-#define AT91C_SPI_BITS_8 (0x0 << 4) // (SPI) 8 Bits Per transfer +-#define AT91C_SPI_BITS_9 (0x1 << 4) // (SPI) 9 Bits Per transfer +-#define AT91C_SPI_BITS_10 (0x2 << 4) // (SPI) 10 Bits Per transfer +-#define AT91C_SPI_BITS_11 (0x3 << 4) // (SPI) 11 Bits Per transfer +-#define AT91C_SPI_BITS_12 (0x4 << 4) // (SPI) 12 Bits Per transfer +-#define AT91C_SPI_BITS_13 (0x5 << 4) // (SPI) 13 Bits Per transfer +-#define AT91C_SPI_BITS_14 (0x6 << 4) // (SPI) 14 Bits Per transfer +-#define AT91C_SPI_BITS_15 (0x7 << 4) // (SPI) 15 Bits Per transfer +-#define AT91C_SPI_BITS_16 (0x8 << 4) // (SPI) 16 Bits Per transfer +-#define AT91C_SPI_SCBR (0xFF << 8) // (SPI) Serial Clock Baud Rate +-#define AT91C_SPI_DLYBS (0xFF << 16) // (SPI) Delay Before SPCK +-#define AT91C_SPI_DLYBCT (0xFF << 24) // (SPI) Delay Between Consecutive Transfers +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Usart +-// ***************************************************************************** +-// *** Register offset in AT91S_USART structure *** +-#define US_CR ( 0) // Control Register +-#define US_MR ( 4) // Mode Register +-#define US_IER ( 8) // Interrupt Enable Register +-#define US_IDR (12) // Interrupt Disable Register +-#define US_IMR (16) // Interrupt Mask Register +-#define US_CSR (20) // Channel Status Register +-#define US_RHR (24) // Receiver Holding Register +-#define US_THR (28) // Transmitter Holding Register +-#define US_BRGR (32) // Baud Rate Generator Register +-#define US_RTOR (36) // Receiver Time-out Register +-#define US_TTGR (40) // Transmitter Time-guard Register +-#define US_FIDI (64) // FI_DI_Ratio Register +-#define US_NER (68) // Nb Errors Register +-#define US_IF (76) // IRDA_FILTER Register +-#define US_RPR (256) // Receive Pointer Register +-#define US_RCR (260) // Receive Counter Register +-#define US_TPR (264) // Transmit Pointer Register +-#define US_TCR (268) // Transmit Counter Register +-#define US_RNPR (272) // Receive Next Pointer Register +-#define US_RNCR (276) // Receive Next Counter Register +-#define US_TNPR (280) // Transmit Next Pointer Register +-#define US_TNCR (284) // Transmit Next Counter Register +-#define US_PTCR (288) // PDC Transfer Control Register +-#define US_PTSR (292) // PDC Transfer Status Register +-// -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- +-#define AT91C_US_STTBRK (0x1 << 9) // (USART) Start Break +-#define AT91C_US_STPBRK (0x1 << 10) // (USART) Stop Break +-#define AT91C_US_STTTO (0x1 << 11) // (USART) Start Time-out +-#define AT91C_US_SENDA (0x1 << 12) // (USART) Send Address +-#define AT91C_US_RSTIT (0x1 << 13) // (USART) Reset Iterations +-#define AT91C_US_RSTNACK (0x1 << 14) // (USART) Reset Non Acknowledge +-#define AT91C_US_RETTO (0x1 << 15) // (USART) Rearm Time-out +-#define AT91C_US_DTREN (0x1 << 16) // (USART) Data Terminal ready Enable +-#define AT91C_US_DTRDIS (0x1 << 17) // (USART) Data Terminal ready Disable +-#define AT91C_US_RTSEN (0x1 << 18) // (USART) Request to Send enable +-#define AT91C_US_RTSDIS (0x1 << 19) // (USART) Request to Send Disable +-// -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- +-#define AT91C_US_USMODE (0xF << 0) // (USART) Usart mode +-#define AT91C_US_USMODE_NORMAL (0x0) // (USART) Normal +-#define AT91C_US_USMODE_RS485 (0x1) // (USART) RS485 +-#define AT91C_US_USMODE_HWHSH (0x2) // (USART) Hardware Handshaking +-#define AT91C_US_USMODE_MODEM (0x3) // (USART) Modem +-#define AT91C_US_USMODE_ISO7816_0 (0x4) // (USART) ISO7816 protocol: T = 0 +-#define AT91C_US_USMODE_ISO7816_1 (0x6) // (USART) ISO7816 protocol: T = 1 +-#define AT91C_US_USMODE_IRDA (0x8) // (USART) IrDA +-#define AT91C_US_USMODE_SWHSH (0xC) // (USART) Software Handshaking +-#define AT91C_US_CLKS (0x3 << 4) // (USART) Clock Selection (Baud Rate generator Input Clock +-#define AT91C_US_CLKS_CLOCK (0x0 << 4) // (USART) Clock +-#define AT91C_US_CLKS_FDIV1 (0x1 << 4) // (USART) fdiv1 +-#define AT91C_US_CLKS_SLOW (0x2 << 4) // (USART) slow_clock (ARM) +-#define AT91C_US_CLKS_EXT (0x3 << 4) // (USART) External (SCK) +-#define AT91C_US_CHRL (0x3 << 6) // (USART) Clock Selection (Baud Rate generator Input Clock +-#define AT91C_US_CHRL_5_BITS (0x0 << 6) // (USART) Character Length: 5 bits +-#define AT91C_US_CHRL_6_BITS (0x1 << 6) // (USART) Character Length: 6 bits +-#define AT91C_US_CHRL_7_BITS (0x2 << 6) // (USART) Character Length: 7 bits +-#define AT91C_US_CHRL_8_BITS (0x3 << 6) // (USART) Character Length: 8 bits +-#define AT91C_US_SYNC (0x1 << 8) // (USART) Synchronous Mode Select +-#define AT91C_US_NBSTOP (0x3 << 12) // (USART) Number of Stop bits +-#define AT91C_US_NBSTOP_1_BIT (0x0 << 12) // (USART) 1 stop bit +-#define AT91C_US_NBSTOP_15_BIT (0x1 << 12) // (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits +-#define AT91C_US_NBSTOP_2_BIT (0x2 << 12) // (USART) 2 stop bits +-#define AT91C_US_MSBF (0x1 << 16) // (USART) Bit Order +-#define AT91C_US_MODE9 (0x1 << 17) // (USART) 9-bit Character length +-#define AT91C_US_CKLO (0x1 << 18) // (USART) Clock Output Select +-#define AT91C_US_OVER (0x1 << 19) // (USART) Over Sampling Mode +-#define AT91C_US_INACK (0x1 << 20) // (USART) Inhibit Non Acknowledge +-#define AT91C_US_DSNACK (0x1 << 21) // (USART) Disable Successive NACK +-#define AT91C_US_MAX_ITER (0x1 << 24) // (USART) Number of Repetitions +-#define AT91C_US_FILTER (0x1 << 28) // (USART) Receive Line Filter +-// -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-#define AT91C_US_RXBRK (0x1 << 2) // (USART) Break Received/End of Break +-#define AT91C_US_TIMEOUT (0x1 << 8) // (USART) Receiver Time-out +-#define AT91C_US_ITERATION (0x1 << 10) // (USART) Max number of Repetitions Reached +-#define AT91C_US_NACK (0x1 << 13) // (USART) Non Acknowledge +-#define AT91C_US_RIIC (0x1 << 16) // (USART) Ring INdicator Input Change Flag +-#define AT91C_US_DSRIC (0x1 << 17) // (USART) Data Set Ready Input Change Flag +-#define AT91C_US_DCDIC (0x1 << 18) // (USART) Data Carrier Flag +-#define AT91C_US_CTSIC (0x1 << 19) // (USART) Clear To Send Input Change Flag +-// -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-// -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-// -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- +-#define AT91C_US_RI (0x1 << 20) // (USART) Image of RI Input +-#define AT91C_US_DSR (0x1 << 21) // (USART) Image of DSR Input +-#define AT91C_US_DCD (0x1 << 22) // (USART) Image of DCD Input +-#define AT91C_US_CTS (0x1 << 23) // (USART) Image of CTS Input +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_SSC structure *** +-#define SSC_CR ( 0) // Control Register +-#define SSC_CMR ( 4) // Clock Mode Register +-#define SSC_RCMR (16) // Receive Clock ModeRegister +-#define SSC_RFMR (20) // Receive Frame Mode Register +-#define SSC_TCMR (24) // Transmit Clock Mode Register +-#define SSC_TFMR (28) // Transmit Frame Mode Register +-#define SSC_RHR (32) // Receive Holding Register +-#define SSC_THR (36) // Transmit Holding Register +-#define SSC_RSHR (48) // Receive Sync Holding Register +-#define SSC_TSHR (52) // Transmit Sync Holding Register +-#define SSC_SR (64) // Status Register +-#define SSC_IER (68) // Interrupt Enable Register +-#define SSC_IDR (72) // Interrupt Disable Register +-#define SSC_IMR (76) // Interrupt Mask Register +-#define SSC_RPR (256) // Receive Pointer Register +-#define SSC_RCR (260) // Receive Counter Register +-#define SSC_TPR (264) // Transmit Pointer Register +-#define SSC_TCR (268) // Transmit Counter Register +-#define SSC_RNPR (272) // Receive Next Pointer Register +-#define SSC_RNCR (276) // Receive Next Counter Register +-#define SSC_TNPR (280) // Transmit Next Pointer Register +-#define SSC_TNCR (284) // Transmit Next Counter Register +-#define SSC_PTCR (288) // PDC Transfer Control Register +-#define SSC_PTSR (292) // PDC Transfer Status Register +-// -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- +-#define AT91C_SSC_RXEN (0x1 << 0) // (SSC) Receive Enable +-#define AT91C_SSC_RXDIS (0x1 << 1) // (SSC) Receive Disable +-#define AT91C_SSC_TXEN (0x1 << 8) // (SSC) Transmit Enable +-#define AT91C_SSC_TXDIS (0x1 << 9) // (SSC) Transmit Disable +-#define AT91C_SSC_SWRST (0x1 << 15) // (SSC) Software Reset +-// -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- +-#define AT91C_SSC_CKS (0x3 << 0) // (SSC) Receive/Transmit Clock Selection +-#define AT91C_SSC_CKS_DIV (0x0) // (SSC) Divided Clock +-#define AT91C_SSC_CKS_TK (0x1) // (SSC) TK Clock signal +-#define AT91C_SSC_CKS_RK (0x2) // (SSC) RK pin +-#define AT91C_SSC_CKO (0x7 << 2) // (SSC) Receive/Transmit Clock Output Mode Selection +-#define AT91C_SSC_CKO_NONE (0x0 << 2) // (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only +-#define AT91C_SSC_CKO_CONTINOUS (0x1 << 2) // (SSC) Continuous Receive/Transmit Clock RK pin: Output +-#define AT91C_SSC_CKO_DATA_TX (0x2 << 2) // (SSC) Receive/Transmit Clock only during data transfers RK pin: Output +-#define AT91C_SSC_CKI (0x1 << 5) // (SSC) Receive/Transmit Clock Inversion +-#define AT91C_SSC_CKG (0x3 << 6) // (SSC) Receive/Transmit Clock Gating Selection +-#define AT91C_SSC_CKG_NONE (0x0 << 6) // (SSC) Receive/Transmit Clock Gating: None, continuous clock +-#define AT91C_SSC_CKG_LOW (0x1 << 6) // (SSC) Receive/Transmit Clock enabled only if RF Low +-#define AT91C_SSC_CKG_HIGH (0x2 << 6) // (SSC) Receive/Transmit Clock enabled only if RF High +-#define AT91C_SSC_START (0xF << 8) // (SSC) Receive/Transmit Start Selection +-#define AT91C_SSC_START_CONTINOUS (0x0 << 8) // (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. +-#define AT91C_SSC_START_TX (0x1 << 8) // (SSC) Transmit/Receive start +-#define AT91C_SSC_START_LOW_RF (0x2 << 8) // (SSC) Detection of a low level on RF input +-#define AT91C_SSC_START_HIGH_RF (0x3 << 8) // (SSC) Detection of a high level on RF input +-#define AT91C_SSC_START_FALL_RF (0x4 << 8) // (SSC) Detection of a falling edge on RF input +-#define AT91C_SSC_START_RISE_RF (0x5 << 8) // (SSC) Detection of a rising edge on RF input +-#define AT91C_SSC_START_LEVEL_RF (0x6 << 8) // (SSC) Detection of any level change on RF input +-#define AT91C_SSC_START_EDGE_RF (0x7 << 8) // (SSC) Detection of any edge on RF input +-#define AT91C_SSC_START_0 (0x8 << 8) // (SSC) Compare 0 +-#define AT91C_SSC_STOP (0x1 << 12) // (SSC) Receive Stop Selection +-#define AT91C_SSC_STTDLY (0xFF << 16) // (SSC) Receive/Transmit Start Delay +-#define AT91C_SSC_PERIOD (0xFF << 24) // (SSC) Receive/Transmit Period Divider Selection +-// -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- +-#define AT91C_SSC_DATLEN (0x1F << 0) // (SSC) Data Length +-#define AT91C_SSC_LOOP (0x1 << 5) // (SSC) Loop Mode +-#define AT91C_SSC_MSBF (0x1 << 7) // (SSC) Most Significant Bit First +-#define AT91C_SSC_DATNB (0xF << 8) // (SSC) Data Number per Frame +-#define AT91C_SSC_FSLEN (0xF << 16) // (SSC) Receive/Transmit Frame Sync length +-#define AT91C_SSC_FSOS (0x7 << 20) // (SSC) Receive/Transmit Frame Sync Output Selection +-#define AT91C_SSC_FSOS_NONE (0x0 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only +-#define AT91C_SSC_FSOS_NEGATIVE (0x1 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse +-#define AT91C_SSC_FSOS_POSITIVE (0x2 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse +-#define AT91C_SSC_FSOS_LOW (0x3 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer +-#define AT91C_SSC_FSOS_HIGH (0x4 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer +-#define AT91C_SSC_FSOS_TOGGLE (0x5 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer +-#define AT91C_SSC_FSEDGE (0x1 << 24) // (SSC) Frame Sync Edge Detection +-// -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- +-// -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- +-#define AT91C_SSC_DATDEF (0x1 << 5) // (SSC) Data Default Value +-#define AT91C_SSC_FSDEN (0x1 << 23) // (SSC) Frame Sync Data Enable +-// -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- +-#define AT91C_SSC_TXRDY (0x1 << 0) // (SSC) Transmit Ready +-#define AT91C_SSC_TXEMPTY (0x1 << 1) // (SSC) Transmit Empty +-#define AT91C_SSC_ENDTX (0x1 << 2) // (SSC) End Of Transmission +-#define AT91C_SSC_TXBUFE (0x1 << 3) // (SSC) Transmit Buffer Empty +-#define AT91C_SSC_RXRDY (0x1 << 4) // (SSC) Receive Ready +-#define AT91C_SSC_OVRUN (0x1 << 5) // (SSC) Receive Overrun +-#define AT91C_SSC_ENDRX (0x1 << 6) // (SSC) End of Reception +-#define AT91C_SSC_RXBUFF (0x1 << 7) // (SSC) Receive Buffer Full +-#define AT91C_SSC_CP0 (0x1 << 8) // (SSC) Compare 0 +-#define AT91C_SSC_CP1 (0x1 << 9) // (SSC) Compare 1 +-#define AT91C_SSC_TXSYN (0x1 << 10) // (SSC) Transmit Sync +-#define AT91C_SSC_RXSYN (0x1 << 11) // (SSC) Receive Sync +-#define AT91C_SSC_TXENA (0x1 << 16) // (SSC) Transmit Enable +-#define AT91C_SSC_RXENA (0x1 << 17) // (SSC) Receive Enable +-// -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- +-// -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- +-// -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Two-wire Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_TWI structure *** +-#define TWI_CR ( 0) // Control Register +-#define TWI_MMR ( 4) // Master Mode Register +-#define TWI_IADR (12) // Internal Address Register +-#define TWI_CWGR (16) // Clock Waveform Generator Register +-#define TWI_SR (32) // Status Register +-#define TWI_IER (36) // Interrupt Enable Register +-#define TWI_IDR (40) // Interrupt Disable Register +-#define TWI_IMR (44) // Interrupt Mask Register +-#define TWI_RHR (48) // Receive Holding Register +-#define TWI_THR (52) // Transmit Holding Register +-// -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- +-#define AT91C_TWI_START (0x1 << 0) // (TWI) Send a START Condition +-#define AT91C_TWI_STOP (0x1 << 1) // (TWI) Send a STOP Condition +-#define AT91C_TWI_MSEN (0x1 << 2) // (TWI) TWI Master Transfer Enabled +-#define AT91C_TWI_MSDIS (0x1 << 3) // (TWI) TWI Master Transfer Disabled +-#define AT91C_TWI_SWRST (0x1 << 7) // (TWI) Software Reset +-// -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- +-#define AT91C_TWI_IADRSZ (0x3 << 8) // (TWI) Internal Device Address Size +-#define AT91C_TWI_IADRSZ_NO (0x0 << 8) // (TWI) No internal device address +-#define AT91C_TWI_IADRSZ_1_BYTE (0x1 << 8) // (TWI) One-byte internal device address +-#define AT91C_TWI_IADRSZ_2_BYTE (0x2 << 8) // (TWI) Two-byte internal device address +-#define AT91C_TWI_IADRSZ_3_BYTE (0x3 << 8) // (TWI) Three-byte internal device address +-#define AT91C_TWI_MREAD (0x1 << 12) // (TWI) Master Read Direction +-#define AT91C_TWI_DADR (0x7F << 16) // (TWI) Device Address +-// -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- +-#define AT91C_TWI_CLDIV (0xFF << 0) // (TWI) Clock Low Divider +-#define AT91C_TWI_CHDIV (0xFF << 8) // (TWI) Clock High Divider +-#define AT91C_TWI_CKDIV (0x7 << 16) // (TWI) Clock Divider +-// -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- +-#define AT91C_TWI_TXCOMP (0x1 << 0) // (TWI) Transmission Completed +-#define AT91C_TWI_RXRDY (0x1 << 1) // (TWI) Receive holding register ReaDY +-#define AT91C_TWI_TXRDY (0x1 << 2) // (TWI) Transmit holding register ReaDY +-#define AT91C_TWI_OVRE (0x1 << 6) // (TWI) Overrun Error +-#define AT91C_TWI_UNRE (0x1 << 7) // (TWI) Underrun Error +-#define AT91C_TWI_NACK (0x1 << 8) // (TWI) Not Acknowledged +-// -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- +-// -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- +-// -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR PWMC Channel Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_PWMC_CH structure *** +-#define PWMC_CMR ( 0) // Channel Mode Register +-#define PWMC_CDTYR ( 4) // Channel Duty Cycle Register +-#define PWMC_CPRDR ( 8) // Channel Period Register +-#define PWMC_CCNTR (12) // Channel Counter Register +-#define PWMC_CUPDR (16) // Channel Update Register +-#define PWMC_Reserved (20) // Reserved +-// -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- +-#define AT91C_PWMC_CPRE (0xF << 0) // (PWMC_CH) Channel Pre-scaler : PWMC_CLKx +-#define AT91C_PWMC_CPRE_MCK (0x0) // (PWMC_CH) +-#define AT91C_PWMC_CPRE_MCKA (0xB) // (PWMC_CH) +-#define AT91C_PWMC_CPRE_MCKB (0xC) // (PWMC_CH) +-#define AT91C_PWMC_CALG (0x1 << 8) // (PWMC_CH) Channel Alignment +-#define AT91C_PWMC_CPOL (0x1 << 9) // (PWMC_CH) Channel Polarity +-#define AT91C_PWMC_CPD (0x1 << 10) // (PWMC_CH) Channel Update Period +-// -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- +-#define AT91C_PWMC_CDTY (0x0 << 0) // (PWMC_CH) Channel Duty Cycle +-// -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- +-#define AT91C_PWMC_CPRD (0x0 << 0) // (PWMC_CH) Channel Period +-// -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- +-#define AT91C_PWMC_CCNT (0x0 << 0) // (PWMC_CH) Channel Counter +-// -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- +-#define AT91C_PWMC_CUPD (0x0 << 0) // (PWMC_CH) Channel Update +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_PWMC structure *** +-#define PWMC_MR ( 0) // PWMC Mode Register +-#define PWMC_ENA ( 4) // PWMC Enable Register +-#define PWMC_DIS ( 8) // PWMC Disable Register +-#define PWMC_SR (12) // PWMC Status Register +-#define PWMC_IER (16) // PWMC Interrupt Enable Register +-#define PWMC_IDR (20) // PWMC Interrupt Disable Register +-#define PWMC_IMR (24) // PWMC Interrupt Mask Register +-#define PWMC_ISR (28) // PWMC Interrupt Status Register +-#define PWMC_VR (252) // PWMC Version Register +-#define PWMC_CH (512) // PWMC Channel +-// -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- +-#define AT91C_PWMC_DIVA (0xFF << 0) // (PWMC) CLKA divide factor. +-#define AT91C_PWMC_PREA (0xF << 8) // (PWMC) Divider Input Clock Prescaler A +-#define AT91C_PWMC_PREA_MCK (0x0 << 8) // (PWMC) +-#define AT91C_PWMC_DIVB (0xFF << 16) // (PWMC) CLKB divide factor. +-#define AT91C_PWMC_PREB (0xF << 24) // (PWMC) Divider Input Clock Prescaler B +-#define AT91C_PWMC_PREB_MCK (0x0 << 24) // (PWMC) +-// -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- +-#define AT91C_PWMC_CHID0 (0x1 << 0) // (PWMC) Channel ID 0 +-#define AT91C_PWMC_CHID1 (0x1 << 1) // (PWMC) Channel ID 1 +-#define AT91C_PWMC_CHID2 (0x1 << 2) // (PWMC) Channel ID 2 +-#define AT91C_PWMC_CHID3 (0x1 << 3) // (PWMC) Channel ID 3 +-// -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- +-// -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- +-// -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- +-// -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- +-// -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- +-// -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR USB Device Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_UDP structure *** +-#define UDP_NUM ( 0) // Frame Number Register +-#define UDP_GLBSTATE ( 4) // Global State Register +-#define UDP_FADDR ( 8) // Function Address Register +-#define UDP_IER (16) // Interrupt Enable Register +-#define UDP_IDR (20) // Interrupt Disable Register +-#define UDP_IMR (24) // Interrupt Mask Register +-#define UDP_ISR (28) // Interrupt Status Register +-#define UDP_ICR (32) // Interrupt Clear Register +-#define UDP_RSTEP (40) // Reset Endpoint Register +-#define UDP_CSR (48) // Endpoint Control and Status Register +-#define UDP_FDR (80) // Endpoint FIFO Data Register +-#define UDP_TXVC (116) // Transceiver Control Register +-// -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- +-#define AT91C_UDP_FRM_NUM (0x7FF << 0) // (UDP) Frame Number as Defined in the Packet Field Formats +-#define AT91C_UDP_FRM_ERR (0x1 << 16) // (UDP) Frame Error +-#define AT91C_UDP_FRM_OK (0x1 << 17) // (UDP) Frame OK +-// -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- +-#define AT91C_UDP_FADDEN (0x1 << 0) // (UDP) Function Address Enable +-#define AT91C_UDP_CONFG (0x1 << 1) // (UDP) Configured +-#define AT91C_UDP_ESR (0x1 << 2) // (UDP) Enable Send Resume +-#define AT91C_UDP_RSMINPR (0x1 << 3) // (UDP) A Resume Has Been Sent to the Host +-#define AT91C_UDP_RMWUPE (0x1 << 4) // (UDP) Remote Wake Up Enable +-// -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- +-#define AT91C_UDP_FADD (0xFF << 0) // (UDP) Function Address Value +-#define AT91C_UDP_FEN (0x1 << 8) // (UDP) Function Enable +-// -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- +-#define AT91C_UDP_EPINT0 (0x1 << 0) // (UDP) Endpoint 0 Interrupt +-#define AT91C_UDP_EPINT1 (0x1 << 1) // (UDP) Endpoint 0 Interrupt +-#define AT91C_UDP_EPINT2 (0x1 << 2) // (UDP) Endpoint 2 Interrupt +-#define AT91C_UDP_EPINT3 (0x1 << 3) // (UDP) Endpoint 3 Interrupt +-#define AT91C_UDP_EPINT4 (0x1 << 4) // (UDP) Endpoint 4 Interrupt +-#define AT91C_UDP_EPINT5 (0x1 << 5) // (UDP) Endpoint 5 Interrupt +-#define AT91C_UDP_RXSUSP (0x1 << 8) // (UDP) USB Suspend Interrupt +-#define AT91C_UDP_RXRSM (0x1 << 9) // (UDP) USB Resume Interrupt +-#define AT91C_UDP_EXTRSM (0x1 << 10) // (UDP) USB External Resume Interrupt +-#define AT91C_UDP_SOFINT (0x1 << 11) // (UDP) USB Start Of frame Interrupt +-#define AT91C_UDP_WAKEUP (0x1 << 13) // (UDP) USB Resume Interrupt +-// -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- +-// -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- +-// -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- +-#define AT91C_UDP_ENDBUSRES (0x1 << 12) // (UDP) USB End Of Bus Reset Interrupt +-// -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- +-// -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- +-#define AT91C_UDP_EP0 (0x1 << 0) // (UDP) Reset Endpoint 0 +-#define AT91C_UDP_EP1 (0x1 << 1) // (UDP) Reset Endpoint 1 +-#define AT91C_UDP_EP2 (0x1 << 2) // (UDP) Reset Endpoint 2 +-#define AT91C_UDP_EP3 (0x1 << 3) // (UDP) Reset Endpoint 3 +-#define AT91C_UDP_EP4 (0x1 << 4) // (UDP) Reset Endpoint 4 +-#define AT91C_UDP_EP5 (0x1 << 5) // (UDP) Reset Endpoint 5 +-// -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- +-#define AT91C_UDP_TXCOMP (0x1 << 0) // (UDP) Generates an IN packet with data previously written in the DPR +-#define AT91C_UDP_RX_DATA_BK0 (0x1 << 1) // (UDP) Receive Data Bank 0 +-#define AT91C_UDP_RXSETUP (0x1 << 2) // (UDP) Sends STALL to the Host (Control endpoints) +-#define AT91C_UDP_ISOERROR (0x1 << 3) // (UDP) Isochronous error (Isochronous endpoints) +-#define AT91C_UDP_TXPKTRDY (0x1 << 4) // (UDP) Transmit Packet Ready +-#define AT91C_UDP_FORCESTALL (0x1 << 5) // (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). +-#define AT91C_UDP_RX_DATA_BK1 (0x1 << 6) // (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). +-#define AT91C_UDP_DIR (0x1 << 7) // (UDP) Transfer Direction +-#define AT91C_UDP_EPTYPE (0x7 << 8) // (UDP) Endpoint type +-#define AT91C_UDP_EPTYPE_CTRL (0x0 << 8) // (UDP) Control +-#define AT91C_UDP_EPTYPE_ISO_OUT (0x1 << 8) // (UDP) Isochronous OUT +-#define AT91C_UDP_EPTYPE_BULK_OUT (0x2 << 8) // (UDP) Bulk OUT +-#define AT91C_UDP_EPTYPE_INT_OUT (0x3 << 8) // (UDP) Interrupt OUT +-#define AT91C_UDP_EPTYPE_ISO_IN (0x5 << 8) // (UDP) Isochronous IN +-#define AT91C_UDP_EPTYPE_BULK_IN (0x6 << 8) // (UDP) Bulk IN +-#define AT91C_UDP_EPTYPE_INT_IN (0x7 << 8) // (UDP) Interrupt IN +-#define AT91C_UDP_DTGLE (0x1 << 11) // (UDP) Data Toggle +-#define AT91C_UDP_EPEDS (0x1 << 15) // (UDP) Endpoint Enable Disable +-#define AT91C_UDP_RXBYTECNT (0x7FF << 16) // (UDP) Number Of Bytes Available in the FIFO +-// -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- +-#define AT91C_UDP_TXVDIS (0x1 << 8) // (UDP) +-#define AT91C_UDP_PUON (0x1 << 9) // (UDP) Pull-up ON +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Timer Counter Channel Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_TC structure *** +-#define TC_CCR ( 0) // Channel Control Register +-#define TC_CMR ( 4) // Channel Mode Register (Capture Mode / Waveform Mode) +-#define TC_CV (16) // Counter Value +-#define TC_RA (20) // Register A +-#define TC_RB (24) // Register B +-#define TC_RC (28) // Register C +-#define TC_SR (32) // Status Register +-#define TC_IER (36) // Interrupt Enable Register +-#define TC_IDR (40) // Interrupt Disable Register +-#define TC_IMR (44) // Interrupt Mask Register +-// -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- +-#define AT91C_TC_CLKEN (0x1 << 0) // (TC) Counter Clock Enable Command +-#define AT91C_TC_CLKDIS (0x1 << 1) // (TC) Counter Clock Disable Command +-#define AT91C_TC_SWTRG (0x1 << 2) // (TC) Software Trigger Command +-// -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- +-#define AT91C_TC_CLKS (0x7 << 0) // (TC) Clock Selection +-#define AT91C_TC_CLKS_TIMER_DIV1_CLOCK (0x0) // (TC) Clock selected: TIMER_DIV1_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV2_CLOCK (0x1) // (TC) Clock selected: TIMER_DIV2_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV3_CLOCK (0x2) // (TC) Clock selected: TIMER_DIV3_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV4_CLOCK (0x3) // (TC) Clock selected: TIMER_DIV4_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV5_CLOCK (0x4) // (TC) Clock selected: TIMER_DIV5_CLOCK +-#define AT91C_TC_CLKS_XC0 (0x5) // (TC) Clock selected: XC0 +-#define AT91C_TC_CLKS_XC1 (0x6) // (TC) Clock selected: XC1 +-#define AT91C_TC_CLKS_XC2 (0x7) // (TC) Clock selected: XC2 +-#define AT91C_TC_CLKI (0x1 << 3) // (TC) Clock Invert +-#define AT91C_TC_BURST (0x3 << 4) // (TC) Burst Signal Selection +-#define AT91C_TC_BURST_NONE (0x0 << 4) // (TC) The clock is not gated by an external signal +-#define AT91C_TC_BURST_XC0 (0x1 << 4) // (TC) XC0 is ANDed with the selected clock +-#define AT91C_TC_BURST_XC1 (0x2 << 4) // (TC) XC1 is ANDed with the selected clock +-#define AT91C_TC_BURST_XC2 (0x3 << 4) // (TC) XC2 is ANDed with the selected clock +-#define AT91C_TC_CPCSTOP (0x1 << 6) // (TC) Counter Clock Stopped with RC Compare +-#define AT91C_TC_LDBSTOP (0x1 << 6) // (TC) Counter Clock Stopped with RB Loading +-#define AT91C_TC_CPCDIS (0x1 << 7) // (TC) Counter Clock Disable with RC Compare +-#define AT91C_TC_LDBDIS (0x1 << 7) // (TC) Counter Clock Disabled with RB Loading +-#define AT91C_TC_ETRGEDG (0x3 << 8) // (TC) External Trigger Edge Selection +-#define AT91C_TC_ETRGEDG_NONE (0x0 << 8) // (TC) Edge: None +-#define AT91C_TC_ETRGEDG_RISING (0x1 << 8) // (TC) Edge: rising edge +-#define AT91C_TC_ETRGEDG_FALLING (0x2 << 8) // (TC) Edge: falling edge +-#define AT91C_TC_ETRGEDG_BOTH (0x3 << 8) // (TC) Edge: each edge +-#define AT91C_TC_EEVTEDG (0x3 << 8) // (TC) External Event Edge Selection +-#define AT91C_TC_EEVTEDG_NONE (0x0 << 8) // (TC) Edge: None +-#define AT91C_TC_EEVTEDG_RISING (0x1 << 8) // (TC) Edge: rising edge +-#define AT91C_TC_EEVTEDG_FALLING (0x2 << 8) // (TC) Edge: falling edge +-#define AT91C_TC_EEVTEDG_BOTH (0x3 << 8) // (TC) Edge: each edge +-#define AT91C_TC_EEVT (0x3 << 10) // (TC) External Event Selection +-#define AT91C_TC_EEVT_TIOB (0x0 << 10) // (TC) Signal selected as external event: TIOB TIOB direction: input +-#define AT91C_TC_EEVT_XC0 (0x1 << 10) // (TC) Signal selected as external event: XC0 TIOB direction: output +-#define AT91C_TC_EEVT_XC1 (0x2 << 10) // (TC) Signal selected as external event: XC1 TIOB direction: output +-#define AT91C_TC_EEVT_XC2 (0x3 << 10) // (TC) Signal selected as external event: XC2 TIOB direction: output +-#define AT91C_TC_ABETRG (0x1 << 10) // (TC) TIOA or TIOB External Trigger Selection +-#define AT91C_TC_ENETRG (0x1 << 12) // (TC) External Event Trigger enable +-#define AT91C_TC_WAVESEL (0x3 << 13) // (TC) Waveform Selection +-#define AT91C_TC_WAVESEL_UP (0x0 << 13) // (TC) UP mode without atomatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UPDOWN (0x1 << 13) // (TC) UPDOWN mode without automatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UP_AUTO (0x2 << 13) // (TC) UP mode with automatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UPDOWN_AUTO (0x3 << 13) // (TC) UPDOWN mode with automatic trigger on RC Compare +-#define AT91C_TC_CPCTRG (0x1 << 14) // (TC) RC Compare Trigger Enable +-#define AT91C_TC_WAVE (0x1 << 15) // (TC) +-#define AT91C_TC_ACPA (0x3 << 16) // (TC) RA Compare Effect on TIOA +-#define AT91C_TC_ACPA_NONE (0x0 << 16) // (TC) Effect: none +-#define AT91C_TC_ACPA_SET (0x1 << 16) // (TC) Effect: set +-#define AT91C_TC_ACPA_CLEAR (0x2 << 16) // (TC) Effect: clear +-#define AT91C_TC_ACPA_TOGGLE (0x3 << 16) // (TC) Effect: toggle +-#define AT91C_TC_LDRA (0x3 << 16) // (TC) RA Loading Selection +-#define AT91C_TC_LDRA_NONE (0x0 << 16) // (TC) Edge: None +-#define AT91C_TC_LDRA_RISING (0x1 << 16) // (TC) Edge: rising edge of TIOA +-#define AT91C_TC_LDRA_FALLING (0x2 << 16) // (TC) Edge: falling edge of TIOA +-#define AT91C_TC_LDRA_BOTH (0x3 << 16) // (TC) Edge: each edge of TIOA +-#define AT91C_TC_ACPC (0x3 << 18) // (TC) RC Compare Effect on TIOA +-#define AT91C_TC_ACPC_NONE (0x0 << 18) // (TC) Effect: none +-#define AT91C_TC_ACPC_SET (0x1 << 18) // (TC) Effect: set +-#define AT91C_TC_ACPC_CLEAR (0x2 << 18) // (TC) Effect: clear +-#define AT91C_TC_ACPC_TOGGLE (0x3 << 18) // (TC) Effect: toggle +-#define AT91C_TC_LDRB (0x3 << 18) // (TC) RB Loading Selection +-#define AT91C_TC_LDRB_NONE (0x0 << 18) // (TC) Edge: None +-#define AT91C_TC_LDRB_RISING (0x1 << 18) // (TC) Edge: rising edge of TIOA +-#define AT91C_TC_LDRB_FALLING (0x2 << 18) // (TC) Edge: falling edge of TIOA +-#define AT91C_TC_LDRB_BOTH (0x3 << 18) // (TC) Edge: each edge of TIOA +-#define AT91C_TC_AEEVT (0x3 << 20) // (TC) External Event Effect on TIOA +-#define AT91C_TC_AEEVT_NONE (0x0 << 20) // (TC) Effect: none +-#define AT91C_TC_AEEVT_SET (0x1 << 20) // (TC) Effect: set +-#define AT91C_TC_AEEVT_CLEAR (0x2 << 20) // (TC) Effect: clear +-#define AT91C_TC_AEEVT_TOGGLE (0x3 << 20) // (TC) Effect: toggle +-#define AT91C_TC_ASWTRG (0x3 << 22) // (TC) Software Trigger Effect on TIOA +-#define AT91C_TC_ASWTRG_NONE (0x0 << 22) // (TC) Effect: none +-#define AT91C_TC_ASWTRG_SET (0x1 << 22) // (TC) Effect: set +-#define AT91C_TC_ASWTRG_CLEAR (0x2 << 22) // (TC) Effect: clear +-#define AT91C_TC_ASWTRG_TOGGLE (0x3 << 22) // (TC) Effect: toggle +-#define AT91C_TC_BCPB (0x3 << 24) // (TC) RB Compare Effect on TIOB +-#define AT91C_TC_BCPB_NONE (0x0 << 24) // (TC) Effect: none +-#define AT91C_TC_BCPB_SET (0x1 << 24) // (TC) Effect: set +-#define AT91C_TC_BCPB_CLEAR (0x2 << 24) // (TC) Effect: clear +-#define AT91C_TC_BCPB_TOGGLE (0x3 << 24) // (TC) Effect: toggle +-#define AT91C_TC_BCPC (0x3 << 26) // (TC) RC Compare Effect on TIOB +-#define AT91C_TC_BCPC_NONE (0x0 << 26) // (TC) Effect: none +-#define AT91C_TC_BCPC_SET (0x1 << 26) // (TC) Effect: set +-#define AT91C_TC_BCPC_CLEAR (0x2 << 26) // (TC) Effect: clear +-#define AT91C_TC_BCPC_TOGGLE (0x3 << 26) // (TC) Effect: toggle +-#define AT91C_TC_BEEVT (0x3 << 28) // (TC) External Event Effect on TIOB +-#define AT91C_TC_BEEVT_NONE (0x0 << 28) // (TC) Effect: none +-#define AT91C_TC_BEEVT_SET (0x1 << 28) // (TC) Effect: set +-#define AT91C_TC_BEEVT_CLEAR (0x2 << 28) // (TC) Effect: clear +-#define AT91C_TC_BEEVT_TOGGLE (0x3 << 28) // (TC) Effect: toggle +-#define AT91C_TC_BSWTRG (0x3 << 30) // (TC) Software Trigger Effect on TIOB +-#define AT91C_TC_BSWTRG_NONE (0x0 << 30) // (TC) Effect: none +-#define AT91C_TC_BSWTRG_SET (0x1 << 30) // (TC) Effect: set +-#define AT91C_TC_BSWTRG_CLEAR (0x2 << 30) // (TC) Effect: clear +-#define AT91C_TC_BSWTRG_TOGGLE (0x3 << 30) // (TC) Effect: toggle +-// -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- +-#define AT91C_TC_COVFS (0x1 << 0) // (TC) Counter Overflow +-#define AT91C_TC_LOVRS (0x1 << 1) // (TC) Load Overrun +-#define AT91C_TC_CPAS (0x1 << 2) // (TC) RA Compare +-#define AT91C_TC_CPBS (0x1 << 3) // (TC) RB Compare +-#define AT91C_TC_CPCS (0x1 << 4) // (TC) RC Compare +-#define AT91C_TC_LDRAS (0x1 << 5) // (TC) RA Loading +-#define AT91C_TC_LDRBS (0x1 << 6) // (TC) RB Loading +-#define AT91C_TC_ETRGS (0x1 << 7) // (TC) External Trigger +-#define AT91C_TC_CLKSTA (0x1 << 16) // (TC) Clock Enabling +-#define AT91C_TC_MTIOA (0x1 << 17) // (TC) TIOA Mirror +-#define AT91C_TC_MTIOB (0x1 << 18) // (TC) TIOA Mirror +-// -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- +-// -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- +-// -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Timer Counter Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_TCB structure *** +-#define TCB_TC0 ( 0) // TC Channel 0 +-#define TCB_TC1 (64) // TC Channel 1 +-#define TCB_TC2 (128) // TC Channel 2 +-#define TCB_BCR (192) // TC Block Control Register +-#define TCB_BMR (196) // TC Block Mode Register +-// -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- +-#define AT91C_TCB_SYNC (0x1 << 0) // (TCB) Synchro Command +-// -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- +-#define AT91C_TCB_TC0XC0S (0x3 << 0) // (TCB) External Clock Signal 0 Selection +-#define AT91C_TCB_TC0XC0S_TCLK0 (0x0) // (TCB) TCLK0 connected to XC0 +-#define AT91C_TCB_TC0XC0S_NONE (0x1) // (TCB) None signal connected to XC0 +-#define AT91C_TCB_TC0XC0S_TIOA1 (0x2) // (TCB) TIOA1 connected to XC0 +-#define AT91C_TCB_TC0XC0S_TIOA2 (0x3) // (TCB) TIOA2 connected to XC0 +-#define AT91C_TCB_TC1XC1S (0x3 << 2) // (TCB) External Clock Signal 1 Selection +-#define AT91C_TCB_TC1XC1S_TCLK1 (0x0 << 2) // (TCB) TCLK1 connected to XC1 +-#define AT91C_TCB_TC1XC1S_NONE (0x1 << 2) // (TCB) None signal connected to XC1 +-#define AT91C_TCB_TC1XC1S_TIOA0 (0x2 << 2) // (TCB) TIOA0 connected to XC1 +-#define AT91C_TCB_TC1XC1S_TIOA2 (0x3 << 2) // (TCB) TIOA2 connected to XC1 +-#define AT91C_TCB_TC2XC2S (0x3 << 4) // (TCB) External Clock Signal 2 Selection +-#define AT91C_TCB_TC2XC2S_TCLK2 (0x0 << 4) // (TCB) TCLK2 connected to XC2 +-#define AT91C_TCB_TC2XC2S_NONE (0x1 << 4) // (TCB) None signal connected to XC2 +-#define AT91C_TCB_TC2XC2S_TIOA0 (0x2 << 4) // (TCB) TIOA0 connected to XC2 +-#define AT91C_TCB_TC2XC2S_TIOA1 (0x3 << 4) // (TCB) TIOA2 connected to XC2 +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_CAN_MB structure *** +-#define CAN_MB_MMR ( 0) // MailBox Mode Register +-#define CAN_MB_MAM ( 4) // MailBox Acceptance Mask Register +-#define CAN_MB_MID ( 8) // MailBox ID Register +-#define CAN_MB_MFID (12) // MailBox Family ID Register +-#define CAN_MB_MSR (16) // MailBox Status Register +-#define CAN_MB_MDL (20) // MailBox Data Low Register +-#define CAN_MB_MDH (24) // MailBox Data High Register +-#define CAN_MB_MCR (28) // MailBox Control Register +-// -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- +-#define AT91C_CAN_MTIMEMARK (0xFFFF << 0) // (CAN_MB) Mailbox Timemark +-#define AT91C_CAN_PRIOR (0xF << 16) // (CAN_MB) Mailbox Priority +-#define AT91C_CAN_MOT (0x7 << 24) // (CAN_MB) Mailbox Object Type +-#define AT91C_CAN_MOT_DIS (0x0 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_RX (0x1 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_RXOVERWRITE (0x2 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_TX (0x3 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_CONSUMER (0x4 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_PRODUCER (0x5 << 24) // (CAN_MB) +-// -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- +-#define AT91C_CAN_MIDvB (0x3FFFF << 0) // (CAN_MB) Complementary bits for identifier in extended mode +-#define AT91C_CAN_MIDvA (0x7FF << 18) // (CAN_MB) Identifier for standard frame mode +-#define AT91C_CAN_MIDE (0x1 << 29) // (CAN_MB) Identifier Version +-// -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- +-// -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- +-// -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- +-#define AT91C_CAN_MTIMESTAMP (0xFFFF << 0) // (CAN_MB) Timer Value +-#define AT91C_CAN_MDLC (0xF << 16) // (CAN_MB) Mailbox Data Length Code +-#define AT91C_CAN_MRTR (0x1 << 20) // (CAN_MB) Mailbox Remote Transmission Request +-#define AT91C_CAN_MABT (0x1 << 22) // (CAN_MB) Mailbox Message Abort +-#define AT91C_CAN_MRDY (0x1 << 23) // (CAN_MB) Mailbox Ready +-#define AT91C_CAN_MMI (0x1 << 24) // (CAN_MB) Mailbox Message Ignored +-// -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- +-// -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- +-// -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- +-#define AT91C_CAN_MACR (0x1 << 22) // (CAN_MB) Abort Request for Mailbox +-#define AT91C_CAN_MTCR (0x1 << 23) // (CAN_MB) Mailbox Transfer Command +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Control Area Network Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_CAN structure *** +-#define CAN_MR ( 0) // Mode Register +-#define CAN_IER ( 4) // Interrupt Enable Register +-#define CAN_IDR ( 8) // Interrupt Disable Register +-#define CAN_IMR (12) // Interrupt Mask Register +-#define CAN_SR (16) // Status Register +-#define CAN_BR (20) // Baudrate Register +-#define CAN_TIM (24) // Timer Register +-#define CAN_TIMESTP (28) // Time Stamp Register +-#define CAN_ECR (32) // Error Counter Register +-#define CAN_TCR (36) // Transfer Command Register +-#define CAN_ACR (40) // Abort Command Register +-#define CAN_VR (252) // Version Register +-#define CAN_MB0 (512) // CAN Mailbox 0 +-#define CAN_MB1 (544) // CAN Mailbox 1 +-#define CAN_MB2 (576) // CAN Mailbox 2 +-#define CAN_MB3 (608) // CAN Mailbox 3 +-#define CAN_MB4 (640) // CAN Mailbox 4 +-#define CAN_MB5 (672) // CAN Mailbox 5 +-#define CAN_MB6 (704) // CAN Mailbox 6 +-#define CAN_MB7 (736) // CAN Mailbox 7 +-#define CAN_MB8 (768) // CAN Mailbox 8 +-#define CAN_MB9 (800) // CAN Mailbox 9 +-#define CAN_MB10 (832) // CAN Mailbox 10 +-#define CAN_MB11 (864) // CAN Mailbox 11 +-#define CAN_MB12 (896) // CAN Mailbox 12 +-#define CAN_MB13 (928) // CAN Mailbox 13 +-#define CAN_MB14 (960) // CAN Mailbox 14 +-#define CAN_MB15 (992) // CAN Mailbox 15 +-// -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- +-#define AT91C_CAN_CANEN (0x1 << 0) // (CAN) CAN Controller Enable +-#define AT91C_CAN_LPM (0x1 << 1) // (CAN) Disable/Enable Low Power Mode +-#define AT91C_CAN_ABM (0x1 << 2) // (CAN) Disable/Enable Autobaud/Listen Mode +-#define AT91C_CAN_OVL (0x1 << 3) // (CAN) Disable/Enable Overload Frame +-#define AT91C_CAN_TEOF (0x1 << 4) // (CAN) Time Stamp messages at each end of Frame +-#define AT91C_CAN_TTM (0x1 << 5) // (CAN) Disable/Enable Time Trigger Mode +-#define AT91C_CAN_TIMFRZ (0x1 << 6) // (CAN) Enable Timer Freeze +-#define AT91C_CAN_DRPT (0x1 << 7) // (CAN) Disable Repeat +-// -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- +-#define AT91C_CAN_MB0 (0x1 << 0) // (CAN) Mailbox 0 Flag +-#define AT91C_CAN_MB1 (0x1 << 1) // (CAN) Mailbox 1 Flag +-#define AT91C_CAN_MB2 (0x1 << 2) // (CAN) Mailbox 2 Flag +-#define AT91C_CAN_MB3 (0x1 << 3) // (CAN) Mailbox 3 Flag +-#define AT91C_CAN_MB4 (0x1 << 4) // (CAN) Mailbox 4 Flag +-#define AT91C_CAN_MB5 (0x1 << 5) // (CAN) Mailbox 5 Flag +-#define AT91C_CAN_MB6 (0x1 << 6) // (CAN) Mailbox 6 Flag +-#define AT91C_CAN_MB7 (0x1 << 7) // (CAN) Mailbox 7 Flag +-#define AT91C_CAN_MB8 (0x1 << 8) // (CAN) Mailbox 8 Flag +-#define AT91C_CAN_MB9 (0x1 << 9) // (CAN) Mailbox 9 Flag +-#define AT91C_CAN_MB10 (0x1 << 10) // (CAN) Mailbox 10 Flag +-#define AT91C_CAN_MB11 (0x1 << 11) // (CAN) Mailbox 11 Flag +-#define AT91C_CAN_MB12 (0x1 << 12) // (CAN) Mailbox 12 Flag +-#define AT91C_CAN_MB13 (0x1 << 13) // (CAN) Mailbox 13 Flag +-#define AT91C_CAN_MB14 (0x1 << 14) // (CAN) Mailbox 14 Flag +-#define AT91C_CAN_MB15 (0x1 << 15) // (CAN) Mailbox 15 Flag +-#define AT91C_CAN_ERRA (0x1 << 16) // (CAN) Error Active Mode Flag +-#define AT91C_CAN_WARN (0x1 << 17) // (CAN) Warning Limit Flag +-#define AT91C_CAN_ERRP (0x1 << 18) // (CAN) Error Passive Mode Flag +-#define AT91C_CAN_BOFF (0x1 << 19) // (CAN) Bus Off Mode Flag +-#define AT91C_CAN_SLEEP (0x1 << 20) // (CAN) Sleep Flag +-#define AT91C_CAN_WAKEUP (0x1 << 21) // (CAN) Wakeup Flag +-#define AT91C_CAN_TOVF (0x1 << 22) // (CAN) Timer Overflow Flag +-#define AT91C_CAN_TSTP (0x1 << 23) // (CAN) Timestamp Flag +-#define AT91C_CAN_CERR (0x1 << 24) // (CAN) CRC Error +-#define AT91C_CAN_SERR (0x1 << 25) // (CAN) Stuffing Error +-#define AT91C_CAN_AERR (0x1 << 26) // (CAN) Acknowledgment Error +-#define AT91C_CAN_FERR (0x1 << 27) // (CAN) Form Error +-#define AT91C_CAN_BERR (0x1 << 28) // (CAN) Bit Error +-// -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- +-// -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- +-// -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- +-#define AT91C_CAN_RBSY (0x1 << 29) // (CAN) Receiver Busy +-#define AT91C_CAN_TBSY (0x1 << 30) // (CAN) Transmitter Busy +-#define AT91C_CAN_OVLY (0x1 << 31) // (CAN) Overload Busy +-// -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- +-#define AT91C_CAN_PHASE2 (0x7 << 0) // (CAN) Phase 2 segment +-#define AT91C_CAN_PHASE1 (0x7 << 4) // (CAN) Phase 1 segment +-#define AT91C_CAN_PROPAG (0x7 << 8) // (CAN) Programmation time segment +-#define AT91C_CAN_SYNC (0x3 << 12) // (CAN) Re-synchronization jump width segment +-#define AT91C_CAN_BRP (0x7F << 16) // (CAN) Baudrate Prescaler +-#define AT91C_CAN_SMP (0x1 << 24) // (CAN) Sampling mode +-// -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- +-#define AT91C_CAN_TIMER (0xFFFF << 0) // (CAN) Timer field +-// -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- +-// -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- +-#define AT91C_CAN_REC (0xFF << 0) // (CAN) Receive Error Counter +-#define AT91C_CAN_TEC (0xFF << 16) // (CAN) Transmit Error Counter +-// -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- +-#define AT91C_CAN_TIMRST (0x1 << 31) // (CAN) Timer Reset Field +-// -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 +-// ***************************************************************************** +-// *** Register offset in AT91S_EMAC structure *** +-#define EMAC_NCR ( 0) // Network Control Register +-#define EMAC_NCFGR ( 4) // Network Configuration Register +-#define EMAC_NSR ( 8) // Network Status Register +-#define EMAC_TSR (20) // Transmit Status Register +-#define EMAC_RBQP (24) // Receive Buffer Queue Pointer +-#define EMAC_TBQP (28) // Transmit Buffer Queue Pointer +-#define EMAC_RSR (32) // Receive Status Register +-#define EMAC_ISR (36) // Interrupt Status Register +-#define EMAC_IER (40) // Interrupt Enable Register +-#define EMAC_IDR (44) // Interrupt Disable Register +-#define EMAC_IMR (48) // Interrupt Mask Register +-#define EMAC_MAN (52) // PHY Maintenance Register +-#define EMAC_PTR (56) // Pause Time Register +-#define EMAC_PFR (60) // Pause Frames received Register +-#define EMAC_FTO (64) // Frames Transmitted OK Register +-#define EMAC_SCF (68) // Single Collision Frame Register +-#define EMAC_MCF (72) // Multiple Collision Frame Register +-#define EMAC_FRO (76) // Frames Received OK Register +-#define EMAC_FCSE (80) // Frame Check Sequence Error Register +-#define EMAC_ALE (84) // Alignment Error Register +-#define EMAC_DTF (88) // Deferred Transmission Frame Register +-#define EMAC_LCOL (92) // Late Collision Register +-#define EMAC_ECOL (96) // Excessive Collision Register +-#define EMAC_TUND (100) // Transmit Underrun Error Register +-#define EMAC_CSE (104) // Carrier Sense Error Register +-#define EMAC_RRE (108) // Receive Ressource Error Register +-#define EMAC_ROV (112) // Receive Overrun Errors Register +-#define EMAC_RSE (116) // Receive Symbol Errors Register +-#define EMAC_ELE (120) // Excessive Length Errors Register +-#define EMAC_RJA (124) // Receive Jabbers Register +-#define EMAC_USF (128) // Undersize Frames Register +-#define EMAC_STE (132) // SQE Test Error Register +-#define EMAC_RLE (136) // Receive Length Field Mismatch Register +-#define EMAC_TPF (140) // Transmitted Pause Frames Register +-#define EMAC_HRB (144) // Hash Address Bottom[31:0] +-#define EMAC_HRT (148) // Hash Address Top[63:32] +-#define EMAC_SA1L (152) // Specific Address 1 Bottom, First 4 bytes +-#define EMAC_SA1H (156) // Specific Address 1 Top, Last 2 bytes +-#define EMAC_SA2L (160) // Specific Address 2 Bottom, First 4 bytes +-#define EMAC_SA2H (164) // Specific Address 2 Top, Last 2 bytes +-#define EMAC_SA3L (168) // Specific Address 3 Bottom, First 4 bytes +-#define EMAC_SA3H (172) // Specific Address 3 Top, Last 2 bytes +-#define EMAC_SA4L (176) // Specific Address 4 Bottom, First 4 bytes +-#define EMAC_SA4H (180) // Specific Address 4 Top, Last 2 bytes +-#define EMAC_TID (184) // Type ID Checking Register +-#define EMAC_TPQ (188) // Transmit Pause Quantum Register +-#define EMAC_USRIO (192) // USER Input/Output Register +-#define EMAC_WOL (196) // Wake On LAN Register +-#define EMAC_REV (252) // Revision Register +-// -------- EMAC_NCR : (EMAC Offset: 0x0) -------- +-#define AT91C_EMAC_LB (0x1 << 0) // (EMAC) Loopback. Optional. When set, loopback signal is at high level. +-#define AT91C_EMAC_LLB (0x1 << 1) // (EMAC) Loopback local. +-#define AT91C_EMAC_RE (0x1 << 2) // (EMAC) Receive enable. +-#define AT91C_EMAC_TE (0x1 << 3) // (EMAC) Transmit enable. +-#define AT91C_EMAC_MPE (0x1 << 4) // (EMAC) Management port enable. +-#define AT91C_EMAC_CLRSTAT (0x1 << 5) // (EMAC) Clear statistics registers. +-#define AT91C_EMAC_INCSTAT (0x1 << 6) // (EMAC) Increment statistics registers. +-#define AT91C_EMAC_WESTAT (0x1 << 7) // (EMAC) Write enable for statistics registers. +-#define AT91C_EMAC_BP (0x1 << 8) // (EMAC) Back pressure. +-#define AT91C_EMAC_TSTART (0x1 << 9) // (EMAC) Start Transmission. +-#define AT91C_EMAC_THALT (0x1 << 10) // (EMAC) Transmission Halt. +-#define AT91C_EMAC_TPFR (0x1 << 11) // (EMAC) Transmit pause frame +-#define AT91C_EMAC_TZQ (0x1 << 12) // (EMAC) Transmit zero quantum pause frame +-// -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- +-#define AT91C_EMAC_SPD (0x1 << 0) // (EMAC) Speed. +-#define AT91C_EMAC_FD (0x1 << 1) // (EMAC) Full duplex. +-#define AT91C_EMAC_JFRAME (0x1 << 3) // (EMAC) Jumbo Frames. +-#define AT91C_EMAC_CAF (0x1 << 4) // (EMAC) Copy all frames. +-#define AT91C_EMAC_NBC (0x1 << 5) // (EMAC) No broadcast. +-#define AT91C_EMAC_MTI (0x1 << 6) // (EMAC) Multicast hash event enable +-#define AT91C_EMAC_UNI (0x1 << 7) // (EMAC) Unicast hash enable. +-#define AT91C_EMAC_BIG (0x1 << 8) // (EMAC) Receive 1522 bytes. +-#define AT91C_EMAC_EAE (0x1 << 9) // (EMAC) External address match enable. +-#define AT91C_EMAC_CLK (0x3 << 10) // (EMAC) +-#define AT91C_EMAC_CLK_HCLK_8 (0x0 << 10) // (EMAC) HCLK divided by 8 +-#define AT91C_EMAC_CLK_HCLK_16 (0x1 << 10) // (EMAC) HCLK divided by 16 +-#define AT91C_EMAC_CLK_HCLK_32 (0x2 << 10) // (EMAC) HCLK divided by 32 +-#define AT91C_EMAC_CLK_HCLK_64 (0x3 << 10) // (EMAC) HCLK divided by 64 +-#define AT91C_EMAC_RTY (0x1 << 12) // (EMAC) +-#define AT91C_EMAC_PAE (0x1 << 13) // (EMAC) +-#define AT91C_EMAC_RBOF (0x3 << 14) // (EMAC) +-#define AT91C_EMAC_RBOF_OFFSET_0 (0x0 << 14) // (EMAC) no offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_1 (0x1 << 14) // (EMAC) one byte offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_2 (0x2 << 14) // (EMAC) two bytes offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_3 (0x3 << 14) // (EMAC) three bytes offset from start of receive buffer +-#define AT91C_EMAC_RLCE (0x1 << 16) // (EMAC) Receive Length field Checking Enable +-#define AT91C_EMAC_DRFCS (0x1 << 17) // (EMAC) Discard Receive FCS +-#define AT91C_EMAC_EFRHD (0x1 << 18) // (EMAC) +-#define AT91C_EMAC_IRXFCS (0x1 << 19) // (EMAC) Ignore RX FCS +-// -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- +-#define AT91C_EMAC_LINKR (0x1 << 0) // (EMAC) +-#define AT91C_EMAC_MDIO (0x1 << 1) // (EMAC) +-#define AT91C_EMAC_IDLE (0x1 << 2) // (EMAC) +-// -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- +-#define AT91C_EMAC_UBR (0x1 << 0) // (EMAC) +-#define AT91C_EMAC_COL (0x1 << 1) // (EMAC) +-#define AT91C_EMAC_RLES (0x1 << 2) // (EMAC) +-#define AT91C_EMAC_TGO (0x1 << 3) // (EMAC) Transmit Go +-#define AT91C_EMAC_BEX (0x1 << 4) // (EMAC) Buffers exhausted mid frame +-#define AT91C_EMAC_COMP (0x1 << 5) // (EMAC) +-#define AT91C_EMAC_UND (0x1 << 6) // (EMAC) +-// -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- +-#define AT91C_EMAC_BNA (0x1 << 0) // (EMAC) +-#define AT91C_EMAC_REC (0x1 << 1) // (EMAC) +-#define AT91C_EMAC_OVR (0x1 << 2) // (EMAC) +-// -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- +-#define AT91C_EMAC_MFD (0x1 << 0) // (EMAC) +-#define AT91C_EMAC_RCOMP (0x1 << 1) // (EMAC) +-#define AT91C_EMAC_RXUBR (0x1 << 2) // (EMAC) +-#define AT91C_EMAC_TXUBR (0x1 << 3) // (EMAC) +-#define AT91C_EMAC_TUNDR (0x1 << 4) // (EMAC) +-#define AT91C_EMAC_RLEX (0x1 << 5) // (EMAC) +-#define AT91C_EMAC_TXERR (0x1 << 6) // (EMAC) +-#define AT91C_EMAC_TCOMP (0x1 << 7) // (EMAC) +-#define AT91C_EMAC_LINK (0x1 << 9) // (EMAC) +-#define AT91C_EMAC_ROVR (0x1 << 10) // (EMAC) +-#define AT91C_EMAC_HRESP (0x1 << 11) // (EMAC) +-#define AT91C_EMAC_PFRE (0x1 << 12) // (EMAC) +-#define AT91C_EMAC_PTZ (0x1 << 13) // (EMAC) +-// -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- +-// -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- +-// -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- +-// -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- +-#define AT91C_EMAC_DATA (0xFFFF << 0) // (EMAC) +-#define AT91C_EMAC_CODE (0x3 << 16) // (EMAC) +-#define AT91C_EMAC_REGA (0x1F << 18) // (EMAC) +-#define AT91C_EMAC_PHYA (0x1F << 23) // (EMAC) +-#define AT91C_EMAC_RW (0x3 << 28) // (EMAC) +-#define AT91C_EMAC_SOF (0x3 << 30) // (EMAC) +-// -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- +-#define AT91C_EMAC_RMII (0x1 << 0) // (EMAC) Reduce MII +-#define AT91C_EMAC_CLKEN (0x1 << 1) // (EMAC) Clock Enable +-// -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- +-#define AT91C_EMAC_IP (0xFFFF << 0) // (EMAC) ARP request IP address +-#define AT91C_EMAC_MAG (0x1 << 16) // (EMAC) Magic packet event enable +-#define AT91C_EMAC_ARP (0x1 << 17) // (EMAC) ARP request event enable +-#define AT91C_EMAC_SA1 (0x1 << 18) // (EMAC) Specific address register 1 event enable +-// -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- +-#define AT91C_EMAC_REVREF (0xFFFF << 0) // (EMAC) +-#define AT91C_EMAC_PARTREF (0xFFFF << 16) // (EMAC) +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Analog to Digital Convertor +-// ***************************************************************************** +-// *** Register offset in AT91S_ADC structure *** +-#define ADC_CR ( 0) // ADC Control Register +-#define ADC_MR ( 4) // ADC Mode Register +-#define ADC_CHER (16) // ADC Channel Enable Register +-#define ADC_CHDR (20) // ADC Channel Disable Register +-#define ADC_CHSR (24) // ADC Channel Status Register +-#define ADC_SR (28) // ADC Status Register +-#define ADC_LCDR (32) // ADC Last Converted Data Register +-#define ADC_IER (36) // ADC Interrupt Enable Register +-#define ADC_IDR (40) // ADC Interrupt Disable Register +-#define ADC_IMR (44) // ADC Interrupt Mask Register +-#define ADC_CDR0 (48) // ADC Channel Data Register 0 +-#define ADC_CDR1 (52) // ADC Channel Data Register 1 +-#define ADC_CDR2 (56) // ADC Channel Data Register 2 +-#define ADC_CDR3 (60) // ADC Channel Data Register 3 +-#define ADC_CDR4 (64) // ADC Channel Data Register 4 +-#define ADC_CDR5 (68) // ADC Channel Data Register 5 +-#define ADC_CDR6 (72) // ADC Channel Data Register 6 +-#define ADC_CDR7 (76) // ADC Channel Data Register 7 +-#define ADC_RPR (256) // Receive Pointer Register +-#define ADC_RCR (260) // Receive Counter Register +-#define ADC_TPR (264) // Transmit Pointer Register +-#define ADC_TCR (268) // Transmit Counter Register +-#define ADC_RNPR (272) // Receive Next Pointer Register +-#define ADC_RNCR (276) // Receive Next Counter Register +-#define ADC_TNPR (280) // Transmit Next Pointer Register +-#define ADC_TNCR (284) // Transmit Next Counter Register +-#define ADC_PTCR (288) // PDC Transfer Control Register +-#define ADC_PTSR (292) // PDC Transfer Status Register +-// -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- +-#define AT91C_ADC_SWRST (0x1 << 0) // (ADC) Software Reset +-#define AT91C_ADC_START (0x1 << 1) // (ADC) Start Conversion +-// -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- +-#define AT91C_ADC_TRGEN (0x1 << 0) // (ADC) Trigger Enable +-#define AT91C_ADC_TRGEN_DIS (0x0) // (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software +-#define AT91C_ADC_TRGEN_EN (0x1) // (ADC) Hardware trigger selected by TRGSEL field is enabled. +-#define AT91C_ADC_TRGSEL (0x7 << 1) // (ADC) Trigger Selection +-#define AT91C_ADC_TRGSEL_TIOA0 (0x0 << 1) // (ADC) Selected TRGSEL = TIAO0 +-#define AT91C_ADC_TRGSEL_TIOA1 (0x1 << 1) // (ADC) Selected TRGSEL = TIAO1 +-#define AT91C_ADC_TRGSEL_TIOA2 (0x2 << 1) // (ADC) Selected TRGSEL = TIAO2 +-#define AT91C_ADC_TRGSEL_TIOA3 (0x3 << 1) // (ADC) Selected TRGSEL = TIAO3 +-#define AT91C_ADC_TRGSEL_TIOA4 (0x4 << 1) // (ADC) Selected TRGSEL = TIAO4 +-#define AT91C_ADC_TRGSEL_TIOA5 (0x5 << 1) // (ADC) Selected TRGSEL = TIAO5 +-#define AT91C_ADC_TRGSEL_EXT (0x6 << 1) // (ADC) Selected TRGSEL = External Trigger +-#define AT91C_ADC_LOWRES (0x1 << 4) // (ADC) Resolution. +-#define AT91C_ADC_LOWRES_10_BIT (0x0 << 4) // (ADC) 10-bit resolution +-#define AT91C_ADC_LOWRES_8_BIT (0x1 << 4) // (ADC) 8-bit resolution +-#define AT91C_ADC_SLEEP (0x1 << 5) // (ADC) Sleep Mode +-#define AT91C_ADC_SLEEP_NORMAL_MODE (0x0 << 5) // (ADC) Normal Mode +-#define AT91C_ADC_SLEEP_MODE (0x1 << 5) // (ADC) Sleep Mode +-#define AT91C_ADC_PRESCAL (0x3F << 8) // (ADC) Prescaler rate selection +-#define AT91C_ADC_STARTUP (0x1F << 16) // (ADC) Startup Time +-#define AT91C_ADC_SHTIM (0xF << 24) // (ADC) Sample & Hold Time +-// -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- +-#define AT91C_ADC_CH0 (0x1 << 0) // (ADC) Channel 0 +-#define AT91C_ADC_CH1 (0x1 << 1) // (ADC) Channel 1 +-#define AT91C_ADC_CH2 (0x1 << 2) // (ADC) Channel 2 +-#define AT91C_ADC_CH3 (0x1 << 3) // (ADC) Channel 3 +-#define AT91C_ADC_CH4 (0x1 << 4) // (ADC) Channel 4 +-#define AT91C_ADC_CH5 (0x1 << 5) // (ADC) Channel 5 +-#define AT91C_ADC_CH6 (0x1 << 6) // (ADC) Channel 6 +-#define AT91C_ADC_CH7 (0x1 << 7) // (ADC) Channel 7 +-// -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- +-// -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- +-// -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- +-#define AT91C_ADC_EOC0 (0x1 << 0) // (ADC) End of Conversion +-#define AT91C_ADC_EOC1 (0x1 << 1) // (ADC) End of Conversion +-#define AT91C_ADC_EOC2 (0x1 << 2) // (ADC) End of Conversion +-#define AT91C_ADC_EOC3 (0x1 << 3) // (ADC) End of Conversion +-#define AT91C_ADC_EOC4 (0x1 << 4) // (ADC) End of Conversion +-#define AT91C_ADC_EOC5 (0x1 << 5) // (ADC) End of Conversion +-#define AT91C_ADC_EOC6 (0x1 << 6) // (ADC) End of Conversion +-#define AT91C_ADC_EOC7 (0x1 << 7) // (ADC) End of Conversion +-#define AT91C_ADC_OVRE0 (0x1 << 8) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE1 (0x1 << 9) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE2 (0x1 << 10) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE3 (0x1 << 11) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE4 (0x1 << 12) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE5 (0x1 << 13) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE6 (0x1 << 14) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE7 (0x1 << 15) // (ADC) Overrun Error +-#define AT91C_ADC_DRDY (0x1 << 16) // (ADC) Data Ready +-#define AT91C_ADC_GOVRE (0x1 << 17) // (ADC) General Overrun +-#define AT91C_ADC_ENDRX (0x1 << 18) // (ADC) End of Receiver Transfer +-#define AT91C_ADC_RXBUFF (0x1 << 19) // (ADC) RXBUFF Interrupt +-// -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- +-#define AT91C_ADC_LDATA (0x3FF << 0) // (ADC) Last Data Converted +-// -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- +-// -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- +-// -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- +-// -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- +-#define AT91C_ADC_DATA (0x3FF << 0) // (ADC) Converted Data +-// -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- +-// -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- +-// -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- +-// -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- +-// -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- +-// -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- +-// -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- +- +-// ***************************************************************************** +-// REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 +-// ***************************************************************************** +-// ========== Register definition for SYS peripheral ========== +-// ========== Register definition for AIC peripheral ========== +-#define AT91C_AIC_IVR (0xFFFFF100) // (AIC) IRQ Vector Register +-#define AT91C_AIC_SMR (0xFFFFF000) // (AIC) Source Mode Register +-#define AT91C_AIC_FVR (0xFFFFF104) // (AIC) FIQ Vector Register +-#define AT91C_AIC_DCR (0xFFFFF138) // (AIC) Debug Control Register (Protect) +-#define AT91C_AIC_EOICR (0xFFFFF130) // (AIC) End of Interrupt Command Register +-#define AT91C_AIC_SVR (0xFFFFF080) // (AIC) Source Vector Register +-#define AT91C_AIC_FFSR (0xFFFFF148) // (AIC) Fast Forcing Status Register +-#define AT91C_AIC_ICCR (0xFFFFF128) // (AIC) Interrupt Clear Command Register +-#define AT91C_AIC_ISR (0xFFFFF108) // (AIC) Interrupt Status Register +-#define AT91C_AIC_IMR (0xFFFFF110) // (AIC) Interrupt Mask Register +-#define AT91C_AIC_IPR (0xFFFFF10C) // (AIC) Interrupt Pending Register +-#define AT91C_AIC_FFER (0xFFFFF140) // (AIC) Fast Forcing Enable Register +-#define AT91C_AIC_IECR (0xFFFFF120) // (AIC) Interrupt Enable Command Register +-#define AT91C_AIC_ISCR (0xFFFFF12C) // (AIC) Interrupt Set Command Register +-#define AT91C_AIC_FFDR (0xFFFFF144) // (AIC) Fast Forcing Disable Register +-#define AT91C_AIC_CISR (0xFFFFF114) // (AIC) Core Interrupt Status Register +-#define AT91C_AIC_IDCR (0xFFFFF124) // (AIC) Interrupt Disable Command Register +-#define AT91C_AIC_SPU (0xFFFFF134) // (AIC) Spurious Vector Register +-// ========== Register definition for PDC_DBGU peripheral ========== +-#define AT91C_DBGU_TCR (0xFFFFF30C) // (PDC_DBGU) Transmit Counter Register +-#define AT91C_DBGU_RNPR (0xFFFFF310) // (PDC_DBGU) Receive Next Pointer Register +-#define AT91C_DBGU_TNPR (0xFFFFF318) // (PDC_DBGU) Transmit Next Pointer Register +-#define AT91C_DBGU_TPR (0xFFFFF308) // (PDC_DBGU) Transmit Pointer Register +-#define AT91C_DBGU_RPR (0xFFFFF300) // (PDC_DBGU) Receive Pointer Register +-#define AT91C_DBGU_RCR (0xFFFFF304) // (PDC_DBGU) Receive Counter Register +-#define AT91C_DBGU_RNCR (0xFFFFF314) // (PDC_DBGU) Receive Next Counter Register +-#define AT91C_DBGU_PTCR (0xFFFFF320) // (PDC_DBGU) PDC Transfer Control Register +-#define AT91C_DBGU_PTSR (0xFFFFF324) // (PDC_DBGU) PDC Transfer Status Register +-#define AT91C_DBGU_TNCR (0xFFFFF31C) // (PDC_DBGU) Transmit Next Counter Register +-// ========== Register definition for DBGU peripheral ========== +-#define AT91C_DBGU_EXID (0xFFFFF244) // (DBGU) Chip ID Extension Register +-#define AT91C_DBGU_BRGR (0xFFFFF220) // (DBGU) Baud Rate Generator Register +-#define AT91C_DBGU_IDR (0xFFFFF20C) // (DBGU) Interrupt Disable Register +-#define AT91C_DBGU_CSR (0xFFFFF214) // (DBGU) Channel Status Register +-#define AT91C_DBGU_CIDR (0xFFFFF240) // (DBGU) Chip ID Register +-#define AT91C_DBGU_MR (0xFFFFF204) // (DBGU) Mode Register +-#define AT91C_DBGU_IMR (0xFFFFF210) // (DBGU) Interrupt Mask Register +-#define AT91C_DBGU_CR (0xFFFFF200) // (DBGU) Control Register +-#define AT91C_DBGU_FNTR (0xFFFFF248) // (DBGU) Force NTRST Register +-#define AT91C_DBGU_THR (0xFFFFF21C) // (DBGU) Transmitter Holding Register +-#define AT91C_DBGU_RHR (0xFFFFF218) // (DBGU) Receiver Holding Register +-#define AT91C_DBGU_IER (0xFFFFF208) // (DBGU) Interrupt Enable Register +-// ========== Register definition for PIOA peripheral ========== +-#define AT91C_PIOA_ODR (0xFFFFF414) // (PIOA) Output Disable Registerr +-#define AT91C_PIOA_SODR (0xFFFFF430) // (PIOA) Set Output Data Register +-#define AT91C_PIOA_ISR (0xFFFFF44C) // (PIOA) Interrupt Status Register +-#define AT91C_PIOA_ABSR (0xFFFFF478) // (PIOA) AB Select Status Register +-#define AT91C_PIOA_IER (0xFFFFF440) // (PIOA) Interrupt Enable Register +-#define AT91C_PIOA_PPUDR (0xFFFFF460) // (PIOA) Pull-up Disable Register +-#define AT91C_PIOA_IMR (0xFFFFF448) // (PIOA) Interrupt Mask Register +-#define AT91C_PIOA_PER (0xFFFFF400) // (PIOA) PIO Enable Register +-#define AT91C_PIOA_IFDR (0xFFFFF424) // (PIOA) Input Filter Disable Register +-#define AT91C_PIOA_OWDR (0xFFFFF4A4) // (PIOA) Output Write Disable Register +-#define AT91C_PIOA_MDSR (0xFFFFF458) // (PIOA) Multi-driver Status Register +-#define AT91C_PIOA_IDR (0xFFFFF444) // (PIOA) Interrupt Disable Register +-#define AT91C_PIOA_ODSR (0xFFFFF438) // (PIOA) Output Data Status Register +-#define AT91C_PIOA_PPUSR (0xFFFFF468) // (PIOA) Pull-up Status Register +-#define AT91C_PIOA_OWSR (0xFFFFF4A8) // (PIOA) Output Write Status Register +-#define AT91C_PIOA_BSR (0xFFFFF474) // (PIOA) Select B Register +-#define AT91C_PIOA_OWER (0xFFFFF4A0) // (PIOA) Output Write Enable Register +-#define AT91C_PIOA_IFER (0xFFFFF420) // (PIOA) Input Filter Enable Register +-#define AT91C_PIOA_PDSR (0xFFFFF43C) // (PIOA) Pin Data Status Register +-#define AT91C_PIOA_PPUER (0xFFFFF464) // (PIOA) Pull-up Enable Register +-#define AT91C_PIOA_OSR (0xFFFFF418) // (PIOA) Output Status Register +-#define AT91C_PIOA_ASR (0xFFFFF470) // (PIOA) Select A Register +-#define AT91C_PIOA_MDDR (0xFFFFF454) // (PIOA) Multi-driver Disable Register +-#define AT91C_PIOA_CODR (0xFFFFF434) // (PIOA) Clear Output Data Register +-#define AT91C_PIOA_MDER (0xFFFFF450) // (PIOA) Multi-driver Enable Register +-#define AT91C_PIOA_PDR (0xFFFFF404) // (PIOA) PIO Disable Register +-#define AT91C_PIOA_IFSR (0xFFFFF428) // (PIOA) Input Filter Status Register +-#define AT91C_PIOA_OER (0xFFFFF410) // (PIOA) Output Enable Register +-#define AT91C_PIOA_PSR (0xFFFFF408) // (PIOA) PIO Status Register +-// ========== Register definition for PIOB peripheral ========== +-#define AT91C_PIOB_OWDR (0xFFFFF6A4) // (PIOB) Output Write Disable Register +-#define AT91C_PIOB_MDER (0xFFFFF650) // (PIOB) Multi-driver Enable Register +-#define AT91C_PIOB_PPUSR (0xFFFFF668) // (PIOB) Pull-up Status Register +-#define AT91C_PIOB_IMR (0xFFFFF648) // (PIOB) Interrupt Mask Register +-#define AT91C_PIOB_ASR (0xFFFFF670) // (PIOB) Select A Register +-#define AT91C_PIOB_PPUDR (0xFFFFF660) // (PIOB) Pull-up Disable Register +-#define AT91C_PIOB_PSR (0xFFFFF608) // (PIOB) PIO Status Register +-#define AT91C_PIOB_IER (0xFFFFF640) // (PIOB) Interrupt Enable Register +-#define AT91C_PIOB_CODR (0xFFFFF634) // (PIOB) Clear Output Data Register +-#define AT91C_PIOB_OWER (0xFFFFF6A0) // (PIOB) Output Write Enable Register +-#define AT91C_PIOB_ABSR (0xFFFFF678) // (PIOB) AB Select Status Register +-#define AT91C_PIOB_IFDR (0xFFFFF624) // (PIOB) Input Filter Disable Register +-#define AT91C_PIOB_PDSR (0xFFFFF63C) // (PIOB) Pin Data Status Register +-#define AT91C_PIOB_IDR (0xFFFFF644) // (PIOB) Interrupt Disable Register +-#define AT91C_PIOB_OWSR (0xFFFFF6A8) // (PIOB) Output Write Status Register +-#define AT91C_PIOB_PDR (0xFFFFF604) // (PIOB) PIO Disable Register +-#define AT91C_PIOB_ODR (0xFFFFF614) // (PIOB) Output Disable Registerr +-#define AT91C_PIOB_IFSR (0xFFFFF628) // (PIOB) Input Filter Status Register +-#define AT91C_PIOB_PPUER (0xFFFFF664) // (PIOB) Pull-up Enable Register +-#define AT91C_PIOB_SODR (0xFFFFF630) // (PIOB) Set Output Data Register +-#define AT91C_PIOB_ISR (0xFFFFF64C) // (PIOB) Interrupt Status Register +-#define AT91C_PIOB_ODSR (0xFFFFF638) // (PIOB) Output Data Status Register +-#define AT91C_PIOB_OSR (0xFFFFF618) // (PIOB) Output Status Register +-#define AT91C_PIOB_MDSR (0xFFFFF658) // (PIOB) Multi-driver Status Register +-#define AT91C_PIOB_IFER (0xFFFFF620) // (PIOB) Input Filter Enable Register +-#define AT91C_PIOB_BSR (0xFFFFF674) // (PIOB) Select B Register +-#define AT91C_PIOB_MDDR (0xFFFFF654) // (PIOB) Multi-driver Disable Register +-#define AT91C_PIOB_OER (0xFFFFF610) // (PIOB) Output Enable Register +-#define AT91C_PIOB_PER (0xFFFFF600) // (PIOB) PIO Enable Register +-// ========== Register definition for CKGR peripheral ========== +-#define AT91C_CKGR_MOR (0xFFFFFC20) // (CKGR) Main Oscillator Register +-#define AT91C_CKGR_PLLR (0xFFFFFC2C) // (CKGR) PLL Register +-#define AT91C_CKGR_MCFR (0xFFFFFC24) // (CKGR) Main Clock Frequency Register +-// ========== Register definition for PMC peripheral ========== +-#define AT91C_PMC_IDR (0xFFFFFC64) // (PMC) Interrupt Disable Register +-#define AT91C_PMC_MOR (0xFFFFFC20) // (PMC) Main Oscillator Register +-#define AT91C_PMC_PLLR (0xFFFFFC2C) // (PMC) PLL Register +-#define AT91C_PMC_PCER (0xFFFFFC10) // (PMC) Peripheral Clock Enable Register +-#define AT91C_PMC_PCKR (0xFFFFFC40) // (PMC) Programmable Clock Register +-#define AT91C_PMC_MCKR (0xFFFFFC30) // (PMC) Master Clock Register +-#define AT91C_PMC_SCDR (0xFFFFFC04) // (PMC) System Clock Disable Register +-#define AT91C_PMC_PCDR (0xFFFFFC14) // (PMC) Peripheral Clock Disable Register +-#define AT91C_PMC_SCSR (0xFFFFFC08) // (PMC) System Clock Status Register +-#define AT91C_PMC_PCSR (0xFFFFFC18) // (PMC) Peripheral Clock Status Register +-#define AT91C_PMC_MCFR (0xFFFFFC24) // (PMC) Main Clock Frequency Register +-#define AT91C_PMC_SCER (0xFFFFFC00) // (PMC) System Clock Enable Register +-#define AT91C_PMC_IMR (0xFFFFFC6C) // (PMC) Interrupt Mask Register +-#define AT91C_PMC_IER (0xFFFFFC60) // (PMC) Interrupt Enable Register +-#define AT91C_PMC_SR (0xFFFFFC68) // (PMC) Status Register +-// ========== Register definition for RSTC peripheral ========== +-#define AT91C_RSTC_RCR (0xFFFFFD00) // (RSTC) Reset Control Register +-#define AT91C_RSTC_RMR (0xFFFFFD08) // (RSTC) Reset Mode Register +-#define AT91C_RSTC_RSR (0xFFFFFD04) // (RSTC) Reset Status Register +-// ========== Register definition for RTTC peripheral ========== +-#define AT91C_RTTC_RTSR (0xFFFFFD2C) // (RTTC) Real-time Status Register +-#define AT91C_RTTC_RTMR (0xFFFFFD20) // (RTTC) Real-time Mode Register +-#define AT91C_RTTC_RTVR (0xFFFFFD28) // (RTTC) Real-time Value Register +-#define AT91C_RTTC_RTAR (0xFFFFFD24) // (RTTC) Real-time Alarm Register +-// ========== Register definition for PITC peripheral ========== +-#define AT91C_PITC_PIVR (0xFFFFFD38) // (PITC) Period Interval Value Register +-#define AT91C_PITC_PISR (0xFFFFFD34) // (PITC) Period Interval Status Register +-#define AT91C_PITC_PIIR (0xFFFFFD3C) // (PITC) Period Interval Image Register +-#define AT91C_PITC_PIMR (0xFFFFFD30) // (PITC) Period Interval Mode Register +-// ========== Register definition for WDTC peripheral ========== +-#define AT91C_WDTC_WDCR (0xFFFFFD40) // (WDTC) Watchdog Control Register +-#define AT91C_WDTC_WDSR (0xFFFFFD48) // (WDTC) Watchdog Status Register +-#define AT91C_WDTC_WDMR (0xFFFFFD44) // (WDTC) Watchdog Mode Register +-// ========== Register definition for VREG peripheral ========== +-#define AT91C_VREG_MR (0xFFFFFD60) // (VREG) Voltage Regulator Mode Register +-// ========== Register definition for MC peripheral ========== +-#define AT91C_MC_ASR (0xFFFFFF04) // (MC) MC Abort Status Register +-#define AT91C_MC_RCR (0xFFFFFF00) // (MC) MC Remap Control Register +-#define AT91C_MC_FCR (0xFFFFFF64) // (MC) MC Flash Command Register +-#define AT91C_MC_AASR (0xFFFFFF08) // (MC) MC Abort Address Status Register +-#define AT91C_MC_FSR (0xFFFFFF68) // (MC) MC Flash Status Register +-#define AT91C_MC_FMR (0xFFFFFF60) // (MC) MC Flash Mode Register +-// ========== Register definition for PDC_SPI1 peripheral ========== +-#define AT91C_SPI1_PTCR (0xFFFE4120) // (PDC_SPI1) PDC Transfer Control Register +-#define AT91C_SPI1_RPR (0xFFFE4100) // (PDC_SPI1) Receive Pointer Register +-#define AT91C_SPI1_TNCR (0xFFFE411C) // (PDC_SPI1) Transmit Next Counter Register +-#define AT91C_SPI1_TPR (0xFFFE4108) // (PDC_SPI1) Transmit Pointer Register +-#define AT91C_SPI1_TNPR (0xFFFE4118) // (PDC_SPI1) Transmit Next Pointer Register +-#define AT91C_SPI1_TCR (0xFFFE410C) // (PDC_SPI1) Transmit Counter Register +-#define AT91C_SPI1_RCR (0xFFFE4104) // (PDC_SPI1) Receive Counter Register +-#define AT91C_SPI1_RNPR (0xFFFE4110) // (PDC_SPI1) Receive Next Pointer Register +-#define AT91C_SPI1_RNCR (0xFFFE4114) // (PDC_SPI1) Receive Next Counter Register +-#define AT91C_SPI1_PTSR (0xFFFE4124) // (PDC_SPI1) PDC Transfer Status Register +-// ========== Register definition for SPI1 peripheral ========== +-#define AT91C_SPI1_IMR (0xFFFE401C) // (SPI1) Interrupt Mask Register +-#define AT91C_SPI1_IER (0xFFFE4014) // (SPI1) Interrupt Enable Register +-#define AT91C_SPI1_MR (0xFFFE4004) // (SPI1) Mode Register +-#define AT91C_SPI1_RDR (0xFFFE4008) // (SPI1) Receive Data Register +-#define AT91C_SPI1_IDR (0xFFFE4018) // (SPI1) Interrupt Disable Register +-#define AT91C_SPI1_SR (0xFFFE4010) // (SPI1) Status Register +-#define AT91C_SPI1_TDR (0xFFFE400C) // (SPI1) Transmit Data Register +-#define AT91C_SPI1_CR (0xFFFE4000) // (SPI1) Control Register +-#define AT91C_SPI1_CSR (0xFFFE4030) // (SPI1) Chip Select Register +-// ========== Register definition for PDC_SPI0 peripheral ========== +-#define AT91C_SPI0_PTCR (0xFFFE0120) // (PDC_SPI0) PDC Transfer Control Register +-#define AT91C_SPI0_TPR (0xFFFE0108) // (PDC_SPI0) Transmit Pointer Register +-#define AT91C_SPI0_TCR (0xFFFE010C) // (PDC_SPI0) Transmit Counter Register +-#define AT91C_SPI0_RCR (0xFFFE0104) // (PDC_SPI0) Receive Counter Register +-#define AT91C_SPI0_PTSR (0xFFFE0124) // (PDC_SPI0) PDC Transfer Status Register +-#define AT91C_SPI0_RNPR (0xFFFE0110) // (PDC_SPI0) Receive Next Pointer Register +-#define AT91C_SPI0_RPR (0xFFFE0100) // (PDC_SPI0) Receive Pointer Register +-#define AT91C_SPI0_TNCR (0xFFFE011C) // (PDC_SPI0) Transmit Next Counter Register +-#define AT91C_SPI0_RNCR (0xFFFE0114) // (PDC_SPI0) Receive Next Counter Register +-#define AT91C_SPI0_TNPR (0xFFFE0118) // (PDC_SPI0) Transmit Next Pointer Register +-// ========== Register definition for SPI0 peripheral ========== +-#define AT91C_SPI0_IER (0xFFFE0014) // (SPI0) Interrupt Enable Register +-#define AT91C_SPI0_SR (0xFFFE0010) // (SPI0) Status Register +-#define AT91C_SPI0_IDR (0xFFFE0018) // (SPI0) Interrupt Disable Register +-#define AT91C_SPI0_CR (0xFFFE0000) // (SPI0) Control Register +-#define AT91C_SPI0_MR (0xFFFE0004) // (SPI0) Mode Register +-#define AT91C_SPI0_IMR (0xFFFE001C) // (SPI0) Interrupt Mask Register +-#define AT91C_SPI0_TDR (0xFFFE000C) // (SPI0) Transmit Data Register +-#define AT91C_SPI0_RDR (0xFFFE0008) // (SPI0) Receive Data Register +-#define AT91C_SPI0_CSR (0xFFFE0030) // (SPI0) Chip Select Register +-// ========== Register definition for PDC_US1 peripheral ========== +-#define AT91C_US1_RNCR (0xFFFC4114) // (PDC_US1) Receive Next Counter Register +-#define AT91C_US1_PTCR (0xFFFC4120) // (PDC_US1) PDC Transfer Control Register +-#define AT91C_US1_TCR (0xFFFC410C) // (PDC_US1) Transmit Counter Register +-#define AT91C_US1_PTSR (0xFFFC4124) // (PDC_US1) PDC Transfer Status Register +-#define AT91C_US1_TNPR (0xFFFC4118) // (PDC_US1) Transmit Next Pointer Register +-#define AT91C_US1_RCR (0xFFFC4104) // (PDC_US1) Receive Counter Register +-#define AT91C_US1_RNPR (0xFFFC4110) // (PDC_US1) Receive Next Pointer Register +-#define AT91C_US1_RPR (0xFFFC4100) // (PDC_US1) Receive Pointer Register +-#define AT91C_US1_TNCR (0xFFFC411C) // (PDC_US1) Transmit Next Counter Register +-#define AT91C_US1_TPR (0xFFFC4108) // (PDC_US1) Transmit Pointer Register +-// ========== Register definition for US1 peripheral ========== +-#define AT91C_US1_IF (0xFFFC404C) // (US1) IRDA_FILTER Register +-#define AT91C_US1_NER (0xFFFC4044) // (US1) Nb Errors Register +-#define AT91C_US1_RTOR (0xFFFC4024) // (US1) Receiver Time-out Register +-#define AT91C_US1_CSR (0xFFFC4014) // (US1) Channel Status Register +-#define AT91C_US1_IDR (0xFFFC400C) // (US1) Interrupt Disable Register +-#define AT91C_US1_IER (0xFFFC4008) // (US1) Interrupt Enable Register +-#define AT91C_US1_THR (0xFFFC401C) // (US1) Transmitter Holding Register +-#define AT91C_US1_TTGR (0xFFFC4028) // (US1) Transmitter Time-guard Register +-#define AT91C_US1_RHR (0xFFFC4018) // (US1) Receiver Holding Register +-#define AT91C_US1_BRGR (0xFFFC4020) // (US1) Baud Rate Generator Register +-#define AT91C_US1_IMR (0xFFFC4010) // (US1) Interrupt Mask Register +-#define AT91C_US1_FIDI (0xFFFC4040) // (US1) FI_DI_Ratio Register +-#define AT91C_US1_CR (0xFFFC4000) // (US1) Control Register +-#define AT91C_US1_MR (0xFFFC4004) // (US1) Mode Register +-// ========== Register definition for PDC_US0 peripheral ========== +-#define AT91C_US0_TNPR (0xFFFC0118) // (PDC_US0) Transmit Next Pointer Register +-#define AT91C_US0_RNPR (0xFFFC0110) // (PDC_US0) Receive Next Pointer Register +-#define AT91C_US0_TCR (0xFFFC010C) // (PDC_US0) Transmit Counter Register +-#define AT91C_US0_PTCR (0xFFFC0120) // (PDC_US0) PDC Transfer Control Register +-#define AT91C_US0_PTSR (0xFFFC0124) // (PDC_US0) PDC Transfer Status Register +-#define AT91C_US0_TNCR (0xFFFC011C) // (PDC_US0) Transmit Next Counter Register +-#define AT91C_US0_TPR (0xFFFC0108) // (PDC_US0) Transmit Pointer Register +-#define AT91C_US0_RCR (0xFFFC0104) // (PDC_US0) Receive Counter Register +-#define AT91C_US0_RPR (0xFFFC0100) // (PDC_US0) Receive Pointer Register +-#define AT91C_US0_RNCR (0xFFFC0114) // (PDC_US0) Receive Next Counter Register +-// ========== Register definition for US0 peripheral ========== +-#define AT91C_US0_BRGR (0xFFFC0020) // (US0) Baud Rate Generator Register +-#define AT91C_US0_NER (0xFFFC0044) // (US0) Nb Errors Register +-#define AT91C_US0_CR (0xFFFC0000) // (US0) Control Register +-#define AT91C_US0_IMR (0xFFFC0010) // (US0) Interrupt Mask Register +-#define AT91C_US0_FIDI (0xFFFC0040) // (US0) FI_DI_Ratio Register +-#define AT91C_US0_TTGR (0xFFFC0028) // (US0) Transmitter Time-guard Register +-#define AT91C_US0_MR (0xFFFC0004) // (US0) Mode Register +-#define AT91C_US0_RTOR (0xFFFC0024) // (US0) Receiver Time-out Register +-#define AT91C_US0_CSR (0xFFFC0014) // (US0) Channel Status Register +-#define AT91C_US0_RHR (0xFFFC0018) // (US0) Receiver Holding Register +-#define AT91C_US0_IDR (0xFFFC000C) // (US0) Interrupt Disable Register +-#define AT91C_US0_THR (0xFFFC001C) // (US0) Transmitter Holding Register +-#define AT91C_US0_IF (0xFFFC004C) // (US0) IRDA_FILTER Register +-#define AT91C_US0_IER (0xFFFC0008) // (US0) Interrupt Enable Register +-// ========== Register definition for PDC_SSC peripheral ========== +-#define AT91C_SSC_TNCR (0xFFFD411C) // (PDC_SSC) Transmit Next Counter Register +-#define AT91C_SSC_RPR (0xFFFD4100) // (PDC_SSC) Receive Pointer Register +-#define AT91C_SSC_RNCR (0xFFFD4114) // (PDC_SSC) Receive Next Counter Register +-#define AT91C_SSC_TPR (0xFFFD4108) // (PDC_SSC) Transmit Pointer Register +-#define AT91C_SSC_PTCR (0xFFFD4120) // (PDC_SSC) PDC Transfer Control Register +-#define AT91C_SSC_TCR (0xFFFD410C) // (PDC_SSC) Transmit Counter Register +-#define AT91C_SSC_RCR (0xFFFD4104) // (PDC_SSC) Receive Counter Register +-#define AT91C_SSC_RNPR (0xFFFD4110) // (PDC_SSC) Receive Next Pointer Register +-#define AT91C_SSC_TNPR (0xFFFD4118) // (PDC_SSC) Transmit Next Pointer Register +-#define AT91C_SSC_PTSR (0xFFFD4124) // (PDC_SSC) PDC Transfer Status Register +-// ========== Register definition for SSC peripheral ========== +-#define AT91C_SSC_RHR (0xFFFD4020) // (SSC) Receive Holding Register +-#define AT91C_SSC_RSHR (0xFFFD4030) // (SSC) Receive Sync Holding Register +-#define AT91C_SSC_TFMR (0xFFFD401C) // (SSC) Transmit Frame Mode Register +-#define AT91C_SSC_IDR (0xFFFD4048) // (SSC) Interrupt Disable Register +-#define AT91C_SSC_THR (0xFFFD4024) // (SSC) Transmit Holding Register +-#define AT91C_SSC_RCMR (0xFFFD4010) // (SSC) Receive Clock ModeRegister +-#define AT91C_SSC_IER (0xFFFD4044) // (SSC) Interrupt Enable Register +-#define AT91C_SSC_TSHR (0xFFFD4034) // (SSC) Transmit Sync Holding Register +-#define AT91C_SSC_SR (0xFFFD4040) // (SSC) Status Register +-#define AT91C_SSC_CMR (0xFFFD4004) // (SSC) Clock Mode Register +-#define AT91C_SSC_TCMR (0xFFFD4018) // (SSC) Transmit Clock Mode Register +-#define AT91C_SSC_CR (0xFFFD4000) // (SSC) Control Register +-#define AT91C_SSC_IMR (0xFFFD404C) // (SSC) Interrupt Mask Register +-#define AT91C_SSC_RFMR (0xFFFD4014) // (SSC) Receive Frame Mode Register +-// ========== Register definition for TWI peripheral ========== +-#define AT91C_TWI_IER (0xFFFB8024) // (TWI) Interrupt Enable Register +-#define AT91C_TWI_CR (0xFFFB8000) // (TWI) Control Register +-#define AT91C_TWI_SR (0xFFFB8020) // (TWI) Status Register +-#define AT91C_TWI_IMR (0xFFFB802C) // (TWI) Interrupt Mask Register +-#define AT91C_TWI_THR (0xFFFB8034) // (TWI) Transmit Holding Register +-#define AT91C_TWI_IDR (0xFFFB8028) // (TWI) Interrupt Disable Register +-#define AT91C_TWI_IADR (0xFFFB800C) // (TWI) Internal Address Register +-#define AT91C_TWI_MMR (0xFFFB8004) // (TWI) Master Mode Register +-#define AT91C_TWI_CWGR (0xFFFB8010) // (TWI) Clock Waveform Generator Register +-#define AT91C_TWI_RHR (0xFFFB8030) // (TWI) Receive Holding Register +-// ========== Register definition for PWMC_CH3 peripheral ========== +-#define AT91C_PWMC_CH3_CUPDR (0xFFFCC270) // (PWMC_CH3) Channel Update Register +-#define AT91C_PWMC_CH3_Reserved (0xFFFCC274) // (PWMC_CH3) Reserved +-#define AT91C_PWMC_CH3_CPRDR (0xFFFCC268) // (PWMC_CH3) Channel Period Register +-#define AT91C_PWMC_CH3_CDTYR (0xFFFCC264) // (PWMC_CH3) Channel Duty Cycle Register +-#define AT91C_PWMC_CH3_CCNTR (0xFFFCC26C) // (PWMC_CH3) Channel Counter Register +-#define AT91C_PWMC_CH3_CMR (0xFFFCC260) // (PWMC_CH3) Channel Mode Register +-// ========== Register definition for PWMC_CH2 peripheral ========== +-#define AT91C_PWMC_CH2_Reserved (0xFFFCC254) // (PWMC_CH2) Reserved +-#define AT91C_PWMC_CH2_CMR (0xFFFCC240) // (PWMC_CH2) Channel Mode Register +-#define AT91C_PWMC_CH2_CCNTR (0xFFFCC24C) // (PWMC_CH2) Channel Counter Register +-#define AT91C_PWMC_CH2_CPRDR (0xFFFCC248) // (PWMC_CH2) Channel Period Register +-#define AT91C_PWMC_CH2_CUPDR (0xFFFCC250) // (PWMC_CH2) Channel Update Register +-#define AT91C_PWMC_CH2_CDTYR (0xFFFCC244) // (PWMC_CH2) Channel Duty Cycle Register +-// ========== Register definition for PWMC_CH1 peripheral ========== +-#define AT91C_PWMC_CH1_Reserved (0xFFFCC234) // (PWMC_CH1) Reserved +-#define AT91C_PWMC_CH1_CUPDR (0xFFFCC230) // (PWMC_CH1) Channel Update Register +-#define AT91C_PWMC_CH1_CPRDR (0xFFFCC228) // (PWMC_CH1) Channel Period Register +-#define AT91C_PWMC_CH1_CCNTR (0xFFFCC22C) // (PWMC_CH1) Channel Counter Register +-#define AT91C_PWMC_CH1_CDTYR (0xFFFCC224) // (PWMC_CH1) Channel Duty Cycle Register +-#define AT91C_PWMC_CH1_CMR (0xFFFCC220) // (PWMC_CH1) Channel Mode Register +-// ========== Register definition for PWMC_CH0 peripheral ========== +-#define AT91C_PWMC_CH0_Reserved (0xFFFCC214) // (PWMC_CH0) Reserved +-#define AT91C_PWMC_CH0_CPRDR (0xFFFCC208) // (PWMC_CH0) Channel Period Register +-#define AT91C_PWMC_CH0_CDTYR (0xFFFCC204) // (PWMC_CH0) Channel Duty Cycle Register +-#define AT91C_PWMC_CH0_CMR (0xFFFCC200) // (PWMC_CH0) Channel Mode Register +-#define AT91C_PWMC_CH0_CUPDR (0xFFFCC210) // (PWMC_CH0) Channel Update Register +-#define AT91C_PWMC_CH0_CCNTR (0xFFFCC20C) // (PWMC_CH0) Channel Counter Register +-// ========== Register definition for PWMC peripheral ========== +-#define AT91C_PWMC_IDR (0xFFFCC014) // (PWMC) PWMC Interrupt Disable Register +-#define AT91C_PWMC_DIS (0xFFFCC008) // (PWMC) PWMC Disable Register +-#define AT91C_PWMC_IER (0xFFFCC010) // (PWMC) PWMC Interrupt Enable Register +-#define AT91C_PWMC_VR (0xFFFCC0FC) // (PWMC) PWMC Version Register +-#define AT91C_PWMC_ISR (0xFFFCC01C) // (PWMC) PWMC Interrupt Status Register +-#define AT91C_PWMC_SR (0xFFFCC00C) // (PWMC) PWMC Status Register +-#define AT91C_PWMC_IMR (0xFFFCC018) // (PWMC) PWMC Interrupt Mask Register +-#define AT91C_PWMC_MR (0xFFFCC000) // (PWMC) PWMC Mode Register +-#define AT91C_PWMC_ENA (0xFFFCC004) // (PWMC) PWMC Enable Register +-// ========== Register definition for UDP peripheral ========== +-#define AT91C_UDP_IMR (0xFFFB0018) // (UDP) Interrupt Mask Register +-#define AT91C_UDP_FADDR (0xFFFB0008) // (UDP) Function Address Register +-#define AT91C_UDP_NUM (0xFFFB0000) // (UDP) Frame Number Register +-#define AT91C_UDP_FDR (0xFFFB0050) // (UDP) Endpoint FIFO Data Register +-#define AT91C_UDP_ISR (0xFFFB001C) // (UDP) Interrupt Status Register +-#define AT91C_UDP_CSR (0xFFFB0030) // (UDP) Endpoint Control and Status Register +-#define AT91C_UDP_IDR (0xFFFB0014) // (UDP) Interrupt Disable Register +-#define AT91C_UDP_ICR (0xFFFB0020) // (UDP) Interrupt Clear Register +-#define AT91C_UDP_RSTEP (0xFFFB0028) // (UDP) Reset Endpoint Register +-#define AT91C_UDP_TXVC (0xFFFB0074) // (UDP) Transceiver Control Register +-#define AT91C_UDP_GLBSTATE (0xFFFB0004) // (UDP) Global State Register +-#define AT91C_UDP_IER (0xFFFB0010) // (UDP) Interrupt Enable Register +-// ========== Register definition for TC0 peripheral ========== +-#define AT91C_TC0_SR (0xFFFA0020) // (TC0) Status Register +-#define AT91C_TC0_RC (0xFFFA001C) // (TC0) Register C +-#define AT91C_TC0_RB (0xFFFA0018) // (TC0) Register B +-#define AT91C_TC0_CCR (0xFFFA0000) // (TC0) Channel Control Register +-#define AT91C_TC0_CMR (0xFFFA0004) // (TC0) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC0_IER (0xFFFA0024) // (TC0) Interrupt Enable Register +-#define AT91C_TC0_RA (0xFFFA0014) // (TC0) Register A +-#define AT91C_TC0_IDR (0xFFFA0028) // (TC0) Interrupt Disable Register +-#define AT91C_TC0_CV (0xFFFA0010) // (TC0) Counter Value +-#define AT91C_TC0_IMR (0xFFFA002C) // (TC0) Interrupt Mask Register +-// ========== Register definition for TC1 peripheral ========== +-#define AT91C_TC1_RB (0xFFFA0058) // (TC1) Register B +-#define AT91C_TC1_CCR (0xFFFA0040) // (TC1) Channel Control Register +-#define AT91C_TC1_IER (0xFFFA0064) // (TC1) Interrupt Enable Register +-#define AT91C_TC1_IDR (0xFFFA0068) // (TC1) Interrupt Disable Register +-#define AT91C_TC1_SR (0xFFFA0060) // (TC1) Status Register +-#define AT91C_TC1_CMR (0xFFFA0044) // (TC1) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC1_RA (0xFFFA0054) // (TC1) Register A +-#define AT91C_TC1_RC (0xFFFA005C) // (TC1) Register C +-#define AT91C_TC1_IMR (0xFFFA006C) // (TC1) Interrupt Mask Register +-#define AT91C_TC1_CV (0xFFFA0050) // (TC1) Counter Value +-// ========== Register definition for TC2 peripheral ========== +-#define AT91C_TC2_CMR (0xFFFA0084) // (TC2) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC2_CCR (0xFFFA0080) // (TC2) Channel Control Register +-#define AT91C_TC2_CV (0xFFFA0090) // (TC2) Counter Value +-#define AT91C_TC2_RA (0xFFFA0094) // (TC2) Register A +-#define AT91C_TC2_RB (0xFFFA0098) // (TC2) Register B +-#define AT91C_TC2_IDR (0xFFFA00A8) // (TC2) Interrupt Disable Register +-#define AT91C_TC2_IMR (0xFFFA00AC) // (TC2) Interrupt Mask Register +-#define AT91C_TC2_RC (0xFFFA009C) // (TC2) Register C +-#define AT91C_TC2_IER (0xFFFA00A4) // (TC2) Interrupt Enable Register +-#define AT91C_TC2_SR (0xFFFA00A0) // (TC2) Status Register +-// ========== Register definition for TCB peripheral ========== +-#define AT91C_TCB_BMR (0xFFFA00C4) // (TCB) TC Block Mode Register +-#define AT91C_TCB_BCR (0xFFFA00C0) // (TCB) TC Block Control Register +-// ========== Register definition for CAN_MB0 peripheral ========== +-#define AT91C_CAN_MB0_MDL (0xFFFD0214) // (CAN_MB0) MailBox Data Low Register +-#define AT91C_CAN_MB0_MAM (0xFFFD0204) // (CAN_MB0) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB0_MCR (0xFFFD021C) // (CAN_MB0) MailBox Control Register +-#define AT91C_CAN_MB0_MID (0xFFFD0208) // (CAN_MB0) MailBox ID Register +-#define AT91C_CAN_MB0_MSR (0xFFFD0210) // (CAN_MB0) MailBox Status Register +-#define AT91C_CAN_MB0_MFID (0xFFFD020C) // (CAN_MB0) MailBox Family ID Register +-#define AT91C_CAN_MB0_MDH (0xFFFD0218) // (CAN_MB0) MailBox Data High Register +-#define AT91C_CAN_MB0_MMR (0xFFFD0200) // (CAN_MB0) MailBox Mode Register +-// ========== Register definition for CAN_MB1 peripheral ========== +-#define AT91C_CAN_MB1_MDL (0xFFFD0234) // (CAN_MB1) MailBox Data Low Register +-#define AT91C_CAN_MB1_MID (0xFFFD0228) // (CAN_MB1) MailBox ID Register +-#define AT91C_CAN_MB1_MMR (0xFFFD0220) // (CAN_MB1) MailBox Mode Register +-#define AT91C_CAN_MB1_MSR (0xFFFD0230) // (CAN_MB1) MailBox Status Register +-#define AT91C_CAN_MB1_MAM (0xFFFD0224) // (CAN_MB1) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB1_MDH (0xFFFD0238) // (CAN_MB1) MailBox Data High Register +-#define AT91C_CAN_MB1_MCR (0xFFFD023C) // (CAN_MB1) MailBox Control Register +-#define AT91C_CAN_MB1_MFID (0xFFFD022C) // (CAN_MB1) MailBox Family ID Register +-// ========== Register definition for CAN_MB2 peripheral ========== +-#define AT91C_CAN_MB2_MCR (0xFFFD025C) // (CAN_MB2) MailBox Control Register +-#define AT91C_CAN_MB2_MDH (0xFFFD0258) // (CAN_MB2) MailBox Data High Register +-#define AT91C_CAN_MB2_MID (0xFFFD0248) // (CAN_MB2) MailBox ID Register +-#define AT91C_CAN_MB2_MDL (0xFFFD0254) // (CAN_MB2) MailBox Data Low Register +-#define AT91C_CAN_MB2_MMR (0xFFFD0240) // (CAN_MB2) MailBox Mode Register +-#define AT91C_CAN_MB2_MAM (0xFFFD0244) // (CAN_MB2) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB2_MFID (0xFFFD024C) // (CAN_MB2) MailBox Family ID Register +-#define AT91C_CAN_MB2_MSR (0xFFFD0250) // (CAN_MB2) MailBox Status Register +-// ========== Register definition for CAN_MB3 peripheral ========== +-#define AT91C_CAN_MB3_MFID (0xFFFD026C) // (CAN_MB3) MailBox Family ID Register +-#define AT91C_CAN_MB3_MAM (0xFFFD0264) // (CAN_MB3) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB3_MID (0xFFFD0268) // (CAN_MB3) MailBox ID Register +-#define AT91C_CAN_MB3_MCR (0xFFFD027C) // (CAN_MB3) MailBox Control Register +-#define AT91C_CAN_MB3_MMR (0xFFFD0260) // (CAN_MB3) MailBox Mode Register +-#define AT91C_CAN_MB3_MSR (0xFFFD0270) // (CAN_MB3) MailBox Status Register +-#define AT91C_CAN_MB3_MDL (0xFFFD0274) // (CAN_MB3) MailBox Data Low Register +-#define AT91C_CAN_MB3_MDH (0xFFFD0278) // (CAN_MB3) MailBox Data High Register +-// ========== Register definition for CAN_MB4 peripheral ========== +-#define AT91C_CAN_MB4_MID (0xFFFD0288) // (CAN_MB4) MailBox ID Register +-#define AT91C_CAN_MB4_MMR (0xFFFD0280) // (CAN_MB4) MailBox Mode Register +-#define AT91C_CAN_MB4_MDH (0xFFFD0298) // (CAN_MB4) MailBox Data High Register +-#define AT91C_CAN_MB4_MFID (0xFFFD028C) // (CAN_MB4) MailBox Family ID Register +-#define AT91C_CAN_MB4_MSR (0xFFFD0290) // (CAN_MB4) MailBox Status Register +-#define AT91C_CAN_MB4_MCR (0xFFFD029C) // (CAN_MB4) MailBox Control Register +-#define AT91C_CAN_MB4_MDL (0xFFFD0294) // (CAN_MB4) MailBox Data Low Register +-#define AT91C_CAN_MB4_MAM (0xFFFD0284) // (CAN_MB4) MailBox Acceptance Mask Register +-// ========== Register definition for CAN_MB5 peripheral ========== +-#define AT91C_CAN_MB5_MSR (0xFFFD02B0) // (CAN_MB5) MailBox Status Register +-#define AT91C_CAN_MB5_MCR (0xFFFD02BC) // (CAN_MB5) MailBox Control Register +-#define AT91C_CAN_MB5_MFID (0xFFFD02AC) // (CAN_MB5) MailBox Family ID Register +-#define AT91C_CAN_MB5_MDH (0xFFFD02B8) // (CAN_MB5) MailBox Data High Register +-#define AT91C_CAN_MB5_MID (0xFFFD02A8) // (CAN_MB5) MailBox ID Register +-#define AT91C_CAN_MB5_MMR (0xFFFD02A0) // (CAN_MB5) MailBox Mode Register +-#define AT91C_CAN_MB5_MDL (0xFFFD02B4) // (CAN_MB5) MailBox Data Low Register +-#define AT91C_CAN_MB5_MAM (0xFFFD02A4) // (CAN_MB5) MailBox Acceptance Mask Register +-// ========== Register definition for CAN_MB6 peripheral ========== +-#define AT91C_CAN_MB6_MFID (0xFFFD02CC) // (CAN_MB6) MailBox Family ID Register +-#define AT91C_CAN_MB6_MID (0xFFFD02C8) // (CAN_MB6) MailBox ID Register +-#define AT91C_CAN_MB6_MAM (0xFFFD02C4) // (CAN_MB6) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB6_MSR (0xFFFD02D0) // (CAN_MB6) MailBox Status Register +-#define AT91C_CAN_MB6_MDL (0xFFFD02D4) // (CAN_MB6) MailBox Data Low Register +-#define AT91C_CAN_MB6_MCR (0xFFFD02DC) // (CAN_MB6) MailBox Control Register +-#define AT91C_CAN_MB6_MDH (0xFFFD02D8) // (CAN_MB6) MailBox Data High Register +-#define AT91C_CAN_MB6_MMR (0xFFFD02C0) // (CAN_MB6) MailBox Mode Register +-// ========== Register definition for CAN_MB7 peripheral ========== +-#define AT91C_CAN_MB7_MCR (0xFFFD02FC) // (CAN_MB7) MailBox Control Register +-#define AT91C_CAN_MB7_MDH (0xFFFD02F8) // (CAN_MB7) MailBox Data High Register +-#define AT91C_CAN_MB7_MFID (0xFFFD02EC) // (CAN_MB7) MailBox Family ID Register +-#define AT91C_CAN_MB7_MDL (0xFFFD02F4) // (CAN_MB7) MailBox Data Low Register +-#define AT91C_CAN_MB7_MID (0xFFFD02E8) // (CAN_MB7) MailBox ID Register +-#define AT91C_CAN_MB7_MMR (0xFFFD02E0) // (CAN_MB7) MailBox Mode Register +-#define AT91C_CAN_MB7_MAM (0xFFFD02E4) // (CAN_MB7) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB7_MSR (0xFFFD02F0) // (CAN_MB7) MailBox Status Register +-// ========== Register definition for CAN peripheral ========== +-#define AT91C_CAN_TCR (0xFFFD0024) // (CAN) Transfer Command Register +-#define AT91C_CAN_IMR (0xFFFD000C) // (CAN) Interrupt Mask Register +-#define AT91C_CAN_IER (0xFFFD0004) // (CAN) Interrupt Enable Register +-#define AT91C_CAN_ECR (0xFFFD0020) // (CAN) Error Counter Register +-#define AT91C_CAN_TIMESTP (0xFFFD001C) // (CAN) Time Stamp Register +-#define AT91C_CAN_MR (0xFFFD0000) // (CAN) Mode Register +-#define AT91C_CAN_IDR (0xFFFD0008) // (CAN) Interrupt Disable Register +-#define AT91C_CAN_ACR (0xFFFD0028) // (CAN) Abort Command Register +-#define AT91C_CAN_TIM (0xFFFD0018) // (CAN) Timer Register +-#define AT91C_CAN_SR (0xFFFD0010) // (CAN) Status Register +-#define AT91C_CAN_BR (0xFFFD0014) // (CAN) Baudrate Register +-#define AT91C_CAN_VR (0xFFFD00FC) // (CAN) Version Register +-// ========== Register definition for EMAC peripheral ========== +-#define AT91C_EMAC_ISR (0xFFFDC024) // (EMAC) Interrupt Status Register +-#define AT91C_EMAC_SA4H (0xFFFDC0B4) // (EMAC) Specific Address 4 Top, Last 2 bytes +-#define AT91C_EMAC_SA1L (0xFFFDC098) // (EMAC) Specific Address 1 Bottom, First 4 bytes +-#define AT91C_EMAC_ELE (0xFFFDC078) // (EMAC) Excessive Length Errors Register +-#define AT91C_EMAC_LCOL (0xFFFDC05C) // (EMAC) Late Collision Register +-#define AT91C_EMAC_RLE (0xFFFDC088) // (EMAC) Receive Length Field Mismatch Register +-#define AT91C_EMAC_WOL (0xFFFDC0C4) // (EMAC) Wake On LAN Register +-#define AT91C_EMAC_DTF (0xFFFDC058) // (EMAC) Deferred Transmission Frame Register +-#define AT91C_EMAC_TUND (0xFFFDC064) // (EMAC) Transmit Underrun Error Register +-#define AT91C_EMAC_NCR (0xFFFDC000) // (EMAC) Network Control Register +-#define AT91C_EMAC_SA4L (0xFFFDC0B0) // (EMAC) Specific Address 4 Bottom, First 4 bytes +-#define AT91C_EMAC_RSR (0xFFFDC020) // (EMAC) Receive Status Register +-#define AT91C_EMAC_SA3L (0xFFFDC0A8) // (EMAC) Specific Address 3 Bottom, First 4 bytes +-#define AT91C_EMAC_TSR (0xFFFDC014) // (EMAC) Transmit Status Register +-#define AT91C_EMAC_IDR (0xFFFDC02C) // (EMAC) Interrupt Disable Register +-#define AT91C_EMAC_RSE (0xFFFDC074) // (EMAC) Receive Symbol Errors Register +-#define AT91C_EMAC_ECOL (0xFFFDC060) // (EMAC) Excessive Collision Register +-#define AT91C_EMAC_TID (0xFFFDC0B8) // (EMAC) Type ID Checking Register +-#define AT91C_EMAC_HRB (0xFFFDC090) // (EMAC) Hash Address Bottom[31:0] +-#define AT91C_EMAC_TBQP (0xFFFDC01C) // (EMAC) Transmit Buffer Queue Pointer +-#define AT91C_EMAC_USRIO (0xFFFDC0C0) // (EMAC) USER Input/Output Register +-#define AT91C_EMAC_PTR (0xFFFDC038) // (EMAC) Pause Time Register +-#define AT91C_EMAC_SA2H (0xFFFDC0A4) // (EMAC) Specific Address 2 Top, Last 2 bytes +-#define AT91C_EMAC_ROV (0xFFFDC070) // (EMAC) Receive Overrun Errors Register +-#define AT91C_EMAC_ALE (0xFFFDC054) // (EMAC) Alignment Error Register +-#define AT91C_EMAC_RJA (0xFFFDC07C) // (EMAC) Receive Jabbers Register +-#define AT91C_EMAC_RBQP (0xFFFDC018) // (EMAC) Receive Buffer Queue Pointer +-#define AT91C_EMAC_TPF (0xFFFDC08C) // (EMAC) Transmitted Pause Frames Register +-#define AT91C_EMAC_NCFGR (0xFFFDC004) // (EMAC) Network Configuration Register +-#define AT91C_EMAC_HRT (0xFFFDC094) // (EMAC) Hash Address Top[63:32] +-#define AT91C_EMAC_USF (0xFFFDC080) // (EMAC) Undersize Frames Register +-#define AT91C_EMAC_FCSE (0xFFFDC050) // (EMAC) Frame Check Sequence Error Register +-#define AT91C_EMAC_TPQ (0xFFFDC0BC) // (EMAC) Transmit Pause Quantum Register +-#define AT91C_EMAC_MAN (0xFFFDC034) // (EMAC) PHY Maintenance Register +-#define AT91C_EMAC_FTO (0xFFFDC040) // (EMAC) Frames Transmitted OK Register +-#define AT91C_EMAC_REV (0xFFFDC0FC) // (EMAC) Revision Register +-#define AT91C_EMAC_IMR (0xFFFDC030) // (EMAC) Interrupt Mask Register +-#define AT91C_EMAC_SCF (0xFFFDC044) // (EMAC) Single Collision Frame Register +-#define AT91C_EMAC_PFR (0xFFFDC03C) // (EMAC) Pause Frames received Register +-#define AT91C_EMAC_MCF (0xFFFDC048) // (EMAC) Multiple Collision Frame Register +-#define AT91C_EMAC_NSR (0xFFFDC008) // (EMAC) Network Status Register +-#define AT91C_EMAC_SA2L (0xFFFDC0A0) // (EMAC) Specific Address 2 Bottom, First 4 bytes +-#define AT91C_EMAC_FRO (0xFFFDC04C) // (EMAC) Frames Received OK Register +-#define AT91C_EMAC_IER (0xFFFDC028) // (EMAC) Interrupt Enable Register +-#define AT91C_EMAC_SA1H (0xFFFDC09C) // (EMAC) Specific Address 1 Top, Last 2 bytes +-#define AT91C_EMAC_CSE (0xFFFDC068) // (EMAC) Carrier Sense Error Register +-#define AT91C_EMAC_SA3H (0xFFFDC0AC) // (EMAC) Specific Address 3 Top, Last 2 bytes +-#define AT91C_EMAC_RRE (0xFFFDC06C) // (EMAC) Receive Ressource Error Register +-#define AT91C_EMAC_STE (0xFFFDC084) // (EMAC) SQE Test Error Register +-// ========== Register definition for PDC_ADC peripheral ========== +-#define AT91C_ADC_PTSR (0xFFFD8124) // (PDC_ADC) PDC Transfer Status Register +-#define AT91C_ADC_PTCR (0xFFFD8120) // (PDC_ADC) PDC Transfer Control Register +-#define AT91C_ADC_TNPR (0xFFFD8118) // (PDC_ADC) Transmit Next Pointer Register +-#define AT91C_ADC_TNCR (0xFFFD811C) // (PDC_ADC) Transmit Next Counter Register +-#define AT91C_ADC_RNPR (0xFFFD8110) // (PDC_ADC) Receive Next Pointer Register +-#define AT91C_ADC_RNCR (0xFFFD8114) // (PDC_ADC) Receive Next Counter Register +-#define AT91C_ADC_RPR (0xFFFD8100) // (PDC_ADC) Receive Pointer Register +-#define AT91C_ADC_TCR (0xFFFD810C) // (PDC_ADC) Transmit Counter Register +-#define AT91C_ADC_TPR (0xFFFD8108) // (PDC_ADC) Transmit Pointer Register +-#define AT91C_ADC_RCR (0xFFFD8104) // (PDC_ADC) Receive Counter Register +-// ========== Register definition for ADC peripheral ========== +-#define AT91C_ADC_CDR2 (0xFFFD8038) // (ADC) ADC Channel Data Register 2 +-#define AT91C_ADC_CDR3 (0xFFFD803C) // (ADC) ADC Channel Data Register 3 +-#define AT91C_ADC_CDR0 (0xFFFD8030) // (ADC) ADC Channel Data Register 0 +-#define AT91C_ADC_CDR5 (0xFFFD8044) // (ADC) ADC Channel Data Register 5 +-#define AT91C_ADC_CHDR (0xFFFD8014) // (ADC) ADC Channel Disable Register +-#define AT91C_ADC_SR (0xFFFD801C) // (ADC) ADC Status Register +-#define AT91C_ADC_CDR4 (0xFFFD8040) // (ADC) ADC Channel Data Register 4 +-#define AT91C_ADC_CDR1 (0xFFFD8034) // (ADC) ADC Channel Data Register 1 +-#define AT91C_ADC_LCDR (0xFFFD8020) // (ADC) ADC Last Converted Data Register +-#define AT91C_ADC_IDR (0xFFFD8028) // (ADC) ADC Interrupt Disable Register +-#define AT91C_ADC_CR (0xFFFD8000) // (ADC) ADC Control Register +-#define AT91C_ADC_CDR7 (0xFFFD804C) // (ADC) ADC Channel Data Register 7 +-#define AT91C_ADC_CDR6 (0xFFFD8048) // (ADC) ADC Channel Data Register 6 +-#define AT91C_ADC_IER (0xFFFD8024) // (ADC) ADC Interrupt Enable Register +-#define AT91C_ADC_CHER (0xFFFD8010) // (ADC) ADC Channel Enable Register +-#define AT91C_ADC_CHSR (0xFFFD8018) // (ADC) ADC Channel Status Register +-#define AT91C_ADC_MR (0xFFFD8004) // (ADC) ADC Mode Register +-#define AT91C_ADC_IMR (0xFFFD802C) // (ADC) ADC Interrupt Mask Register +- +-// ***************************************************************************** +-// PIO DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_PIO_PA0 (1 << 0) // Pin Controlled by PA0 +-#define AT91C_PA0_RXD0 (AT91C_PIO_PA0) // USART 0 Receive Data +-#define AT91C_PIO_PA1 (1 << 1) // Pin Controlled by PA1 +-#define AT91C_PA1_TXD0 (AT91C_PIO_PA1) // USART 0 Transmit Data +-#define AT91C_PIO_PA10 (1 << 10) // Pin Controlled by PA10 +-#define AT91C_PA10_TWD (AT91C_PIO_PA10) // TWI Two-wire Serial Data +-#define AT91C_PIO_PA11 (1 << 11) // Pin Controlled by PA11 +-#define AT91C_PA11_TWCK (AT91C_PIO_PA11) // TWI Two-wire Serial Clock +-#define AT91C_PIO_PA12 (1 << 12) // Pin Controlled by PA12 +-#define AT91C_PA12_SPI0_NPCS0 (AT91C_PIO_PA12) // SPI 0 Peripheral Chip Select 0 +-#define AT91C_PIO_PA13 (1 << 13) // Pin Controlled by PA13 +-#define AT91C_PA13_SPI0_NPCS1 (AT91C_PIO_PA13) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PA13_PCK1 (AT91C_PIO_PA13) // PMC Programmable Clock Output 1 +-#define AT91C_PIO_PA14 (1 << 14) // Pin Controlled by PA14 +-#define AT91C_PA14_SPI0_NPCS2 (AT91C_PIO_PA14) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PA14_IRQ1 (AT91C_PIO_PA14) // External Interrupt 1 +-#define AT91C_PIO_PA15 (1 << 15) // Pin Controlled by PA15 +-#define AT91C_PA15_SPI0_NPCS3 (AT91C_PIO_PA15) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PA15_TCLK2 (AT91C_PIO_PA15) // Timer Counter 2 external clock input +-#define AT91C_PIO_PA16 (1 << 16) // Pin Controlled by PA16 +-#define AT91C_PA16_SPI0_MISO (AT91C_PIO_PA16) // SPI 0 Master In Slave +-#define AT91C_PIO_PA17 (1 << 17) // Pin Controlled by PA17 +-#define AT91C_PA17_SPI0_MOSI (AT91C_PIO_PA17) // SPI 0 Master Out Slave +-#define AT91C_PIO_PA18 (1 << 18) // Pin Controlled by PA18 +-#define AT91C_PA18_SPI0_SPCK (AT91C_PIO_PA18) // SPI 0 Serial Clock +-#define AT91C_PIO_PA19 (1 << 19) // Pin Controlled by PA19 +-#define AT91C_PA19_CANRX (AT91C_PIO_PA19) // CAN Receive +-#define AT91C_PIO_PA2 (1 << 2) // Pin Controlled by PA2 +-#define AT91C_PA2_SCK0 (AT91C_PIO_PA2) // USART 0 Serial Clock +-#define AT91C_PA2_SPI1_NPCS1 (AT91C_PIO_PA2) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PA20 (1 << 20) // Pin Controlled by PA20 +-#define AT91C_PA20_CANTX (AT91C_PIO_PA20) // CAN Transmit +-#define AT91C_PIO_PA21 (1 << 21) // Pin Controlled by PA21 +-#define AT91C_PA21_TF (AT91C_PIO_PA21) // SSC Transmit Frame Sync +-#define AT91C_PA21_SPI1_NPCS0 (AT91C_PIO_PA21) // SPI 1 Peripheral Chip Select 0 +-#define AT91C_PIO_PA22 (1 << 22) // Pin Controlled by PA22 +-#define AT91C_PA22_TK (AT91C_PIO_PA22) // SSC Transmit Clock +-#define AT91C_PA22_SPI1_SPCK (AT91C_PIO_PA22) // SPI 1 Serial Clock +-#define AT91C_PIO_PA23 (1 << 23) // Pin Controlled by PA23 +-#define AT91C_PA23_TD (AT91C_PIO_PA23) // SSC Transmit data +-#define AT91C_PA23_SPI1_MOSI (AT91C_PIO_PA23) // SPI 1 Master Out Slave +-#define AT91C_PIO_PA24 (1 << 24) // Pin Controlled by PA24 +-#define AT91C_PA24_RD (AT91C_PIO_PA24) // SSC Receive Data +-#define AT91C_PA24_SPI1_MISO (AT91C_PIO_PA24) // SPI 1 Master In Slave +-#define AT91C_PIO_PA25 (1 << 25) // Pin Controlled by PA25 +-#define AT91C_PA25_RK (AT91C_PIO_PA25) // SSC Receive Clock +-#define AT91C_PA25_SPI1_NPCS1 (AT91C_PIO_PA25) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PA26 (1 << 26) // Pin Controlled by PA26 +-#define AT91C_PA26_RF (AT91C_PIO_PA26) // SSC Receive Frame Sync +-#define AT91C_PA26_SPI1_NPCS2 (AT91C_PIO_PA26) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PA27 (1 << 27) // Pin Controlled by PA27 +-#define AT91C_PA27_DRXD (AT91C_PIO_PA27) // DBGU Debug Receive Data +-#define AT91C_PA27_PCK3 (AT91C_PIO_PA27) // PMC Programmable Clock Output 3 +-#define AT91C_PIO_PA28 (1 << 28) // Pin Controlled by PA28 +-#define AT91C_PA28_DTXD (AT91C_PIO_PA28) // DBGU Debug Transmit Data +-#define AT91C_PIO_PA29 (1 << 29) // Pin Controlled by PA29 +-#define AT91C_PA29_FIQ (AT91C_PIO_PA29) // AIC Fast Interrupt Input +-#define AT91C_PA29_SPI1_NPCS3 (AT91C_PIO_PA29) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PA3 (1 << 3) // Pin Controlled by PA3 +-#define AT91C_PA3_RTS0 (AT91C_PIO_PA3) // USART 0 Ready To Send +-#define AT91C_PA3_SPI1_NPCS2 (AT91C_PIO_PA3) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PA30 (1 << 30) // Pin Controlled by PA30 +-#define AT91C_PA30_IRQ0 (AT91C_PIO_PA30) // External Interrupt 0 +-#define AT91C_PA30_PCK2 (AT91C_PIO_PA30) // PMC Programmable Clock Output 2 +-#define AT91C_PIO_PA4 (1 << 4) // Pin Controlled by PA4 +-#define AT91C_PA4_CTS0 (AT91C_PIO_PA4) // USART 0 Clear To Send +-#define AT91C_PA4_SPI1_NPCS3 (AT91C_PIO_PA4) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PA5 (1 << 5) // Pin Controlled by PA5 +-#define AT91C_PA5_RXD1 (AT91C_PIO_PA5) // USART 1 Receive Data +-#define AT91C_PIO_PA6 (1 << 6) // Pin Controlled by PA6 +-#define AT91C_PA6_TXD1 (AT91C_PIO_PA6) // USART 1 Transmit Data +-#define AT91C_PIO_PA7 (1 << 7) // Pin Controlled by PA7 +-#define AT91C_PA7_SCK1 (AT91C_PIO_PA7) // USART 1 Serial Clock +-#define AT91C_PA7_SPI0_NPCS1 (AT91C_PIO_PA7) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PIO_PA8 (1 << 8) // Pin Controlled by PA8 +-#define AT91C_PA8_RTS1 (AT91C_PIO_PA8) // USART 1 Ready To Send +-#define AT91C_PA8_SPI0_NPCS2 (AT91C_PIO_PA8) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PIO_PA9 (1 << 9) // Pin Controlled by PA9 +-#define AT91C_PA9_CTS1 (AT91C_PIO_PA9) // USART 1 Clear To Send +-#define AT91C_PA9_SPI0_NPCS3 (AT91C_PIO_PA9) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PIO_PB0 (1 << 0) // Pin Controlled by PB0 +-#define AT91C_PB0_ETXCK_EREFCK (AT91C_PIO_PB0) // Ethernet MAC Transmit Clock/Reference Clock +-#define AT91C_PB0_PCK0 (AT91C_PIO_PB0) // PMC Programmable Clock Output 0 +-#define AT91C_PIO_PB1 (1 << 1) // Pin Controlled by PB1 +-#define AT91C_PB1_ETXEN (AT91C_PIO_PB1) // Ethernet MAC Transmit Enable +-#define AT91C_PIO_PB10 (1 << 10) // Pin Controlled by PB10 +-#define AT91C_PB10_ETX2 (AT91C_PIO_PB10) // Ethernet MAC Transmit Data 2 +-#define AT91C_PB10_SPI1_NPCS1 (AT91C_PIO_PB10) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PB11 (1 << 11) // Pin Controlled by PB11 +-#define AT91C_PB11_ETX3 (AT91C_PIO_PB11) // Ethernet MAC Transmit Data 3 +-#define AT91C_PB11_SPI1_NPCS2 (AT91C_PIO_PB11) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PB12 (1 << 12) // Pin Controlled by PB12 +-#define AT91C_PB12_ETXER (AT91C_PIO_PB12) // Ethernet MAC Transmikt Coding Error +-#define AT91C_PB12_TCLK0 (AT91C_PIO_PB12) // Timer Counter 0 external clock input +-#define AT91C_PIO_PB13 (1 << 13) // Pin Controlled by PB13 +-#define AT91C_PB13_ERX2 (AT91C_PIO_PB13) // Ethernet MAC Receive Data 2 +-#define AT91C_PB13_SPI0_NPCS1 (AT91C_PIO_PB13) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PIO_PB14 (1 << 14) // Pin Controlled by PB14 +-#define AT91C_PB14_ERX3 (AT91C_PIO_PB14) // Ethernet MAC Receive Data 3 +-#define AT91C_PB14_SPI0_NPCS2 (AT91C_PIO_PB14) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PIO_PB15 (1 << 15) // Pin Controlled by PB15 +-#define AT91C_PB15_ERXDV_ECRSDV (AT91C_PIO_PB15) // Ethernet MAC Receive Data Valid +-#define AT91C_PIO_PB16 (1 << 16) // Pin Controlled by PB16 +-#define AT91C_PB16_ECOL (AT91C_PIO_PB16) // Ethernet MAC Collision Detected +-#define AT91C_PB16_SPI1_NPCS3 (AT91C_PIO_PB16) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PB17 (1 << 17) // Pin Controlled by PB17 +-#define AT91C_PB17_ERXCK (AT91C_PIO_PB17) // Ethernet MAC Receive Clock +-#define AT91C_PB17_SPI0_NPCS3 (AT91C_PIO_PB17) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PIO_PB18 (1 << 18) // Pin Controlled by PB18 +-#define AT91C_PB18_EF100 (AT91C_PIO_PB18) // Ethernet MAC Force 100 Mbits/sec +-#define AT91C_PB18_ADTRG (AT91C_PIO_PB18) // ADC External Trigger +-#define AT91C_PIO_PB19 (1 << 19) // Pin Controlled by PB19 +-#define AT91C_PB19_PWM0 (AT91C_PIO_PB19) // PWM Channel 0 +-#define AT91C_PB19_TCLK1 (AT91C_PIO_PB19) // Timer Counter 1 external clock input +-#define AT91C_PIO_PB2 (1 << 2) // Pin Controlled by PB2 +-#define AT91C_PB2_ETX0 (AT91C_PIO_PB2) // Ethernet MAC Transmit Data 0 +-#define AT91C_PIO_PB20 (1 << 20) // Pin Controlled by PB20 +-#define AT91C_PB20_PWM1 (AT91C_PIO_PB20) // PWM Channel 1 +-#define AT91C_PB20_PCK0 (AT91C_PIO_PB20) // PMC Programmable Clock Output 0 +-#define AT91C_PIO_PB21 (1 << 21) // Pin Controlled by PB21 +-#define AT91C_PB21_PWM2 (AT91C_PIO_PB21) // PWM Channel 2 +-#define AT91C_PB21_PCK1 (AT91C_PIO_PB21) // PMC Programmable Clock Output 1 +-#define AT91C_PIO_PB22 (1 << 22) // Pin Controlled by PB22 +-#define AT91C_PB22_PWM3 (AT91C_PIO_PB22) // PWM Channel 3 +-#define AT91C_PB22_PCK2 (AT91C_PIO_PB22) // PMC Programmable Clock Output 2 +-#define AT91C_PIO_PB23 (1 << 23) // Pin Controlled by PB23 +-#define AT91C_PB23_TIOA0 (AT91C_PIO_PB23) // Timer Counter 0 Multipurpose Timer I/O Pin A +-#define AT91C_PB23_DCD1 (AT91C_PIO_PB23) // USART 1 Data Carrier Detect +-#define AT91C_PIO_PB24 (1 << 24) // Pin Controlled by PB24 +-#define AT91C_PB24_TIOB0 (AT91C_PIO_PB24) // Timer Counter 0 Multipurpose Timer I/O Pin B +-#define AT91C_PB24_DSR1 (AT91C_PIO_PB24) // USART 1 Data Set ready +-#define AT91C_PIO_PB25 (1 << 25) // Pin Controlled by PB25 +-#define AT91C_PB25_TIOA1 (AT91C_PIO_PB25) // Timer Counter 1 Multipurpose Timer I/O Pin A +-#define AT91C_PB25_DTR1 (AT91C_PIO_PB25) // USART 1 Data Terminal ready +-#define AT91C_PIO_PB26 (1 << 26) // Pin Controlled by PB26 +-#define AT91C_PB26_TIOB1 (AT91C_PIO_PB26) // Timer Counter 1 Multipurpose Timer I/O Pin B +-#define AT91C_PB26_RI1 (AT91C_PIO_PB26) // USART 1 Ring Indicator +-#define AT91C_PIO_PB27 (1 << 27) // Pin Controlled by PB27 +-#define AT91C_PB27_TIOA2 (AT91C_PIO_PB27) // Timer Counter 2 Multipurpose Timer I/O Pin A +-#define AT91C_PB27_PWM0 (AT91C_PIO_PB27) // PWM Channel 0 +-#define AT91C_PIO_PB28 (1 << 28) // Pin Controlled by PB28 +-#define AT91C_PB28_TIOB2 (AT91C_PIO_PB28) // Timer Counter 2 Multipurpose Timer I/O Pin B +-#define AT91C_PB28_PWM1 (AT91C_PIO_PB28) // PWM Channel 1 +-#define AT91C_PIO_PB29 (1 << 29) // Pin Controlled by PB29 +-#define AT91C_PB29_PCK1 (AT91C_PIO_PB29) // PMC Programmable Clock Output 1 +-#define AT91C_PB29_PWM2 (AT91C_PIO_PB29) // PWM Channel 2 +-#define AT91C_PIO_PB3 (1 << 3) // Pin Controlled by PB3 +-#define AT91C_PB3_ETX1 (AT91C_PIO_PB3) // Ethernet MAC Transmit Data 1 +-#define AT91C_PIO_PB30 (1 << 30) // Pin Controlled by PB30 +-#define AT91C_PB30_PCK2 (AT91C_PIO_PB30) // PMC Programmable Clock Output 2 +-#define AT91C_PB30_PWM3 (AT91C_PIO_PB30) // PWM Channel 3 +-#define AT91C_PIO_PB4 (1 << 4) // Pin Controlled by PB4 +-#define AT91C_PB4_ECRS (AT91C_PIO_PB4) // Ethernet MAC Carrier Sense/Carrier Sense and Data Valid +-#define AT91C_PIO_PB5 (1 << 5) // Pin Controlled by PB5 +-#define AT91C_PB5_ERX0 (AT91C_PIO_PB5) // Ethernet MAC Receive Data 0 +-#define AT91C_PIO_PB6 (1 << 6) // Pin Controlled by PB6 +-#define AT91C_PB6_ERX1 (AT91C_PIO_PB6) // Ethernet MAC Receive Data 1 +-#define AT91C_PIO_PB7 (1 << 7) // Pin Controlled by PB7 +-#define AT91C_PB7_ERXER (AT91C_PIO_PB7) // Ethernet MAC Receive Error +-#define AT91C_PIO_PB8 (1 << 8) // Pin Controlled by PB8 +-#define AT91C_PB8_EMDC (AT91C_PIO_PB8) // Ethernet MAC Management Data Clock +-#define AT91C_PIO_PB9 (1 << 9) // Pin Controlled by PB9 +-#define AT91C_PB9_EMDIO (AT91C_PIO_PB9) // Ethernet MAC Management Data Input/Output +- +-// ***************************************************************************** +-// PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_ID_FIQ ( 0) // Advanced Interrupt Controller (FIQ) +-#define AT91C_ID_SYS ( 1) // System Peripheral +-#define AT91C_ID_PIOA ( 2) // Parallel IO Controller A +-#define AT91C_ID_PIOB ( 3) // Parallel IO Controller B +-#define AT91C_ID_SPI0 ( 4) // Serial Peripheral Interface 0 +-#define AT91C_ID_SPI1 ( 5) // Serial Peripheral Interface 1 +-#define AT91C_ID_US0 ( 6) // USART 0 +-#define AT91C_ID_US1 ( 7) // USART 1 +-#define AT91C_ID_SSC ( 8) // Serial Synchronous Controller +-#define AT91C_ID_TWI ( 9) // Two-Wire Interface +-#define AT91C_ID_PWMC (10) // PWM Controller +-#define AT91C_ID_UDP (11) // USB Device Port +-#define AT91C_ID_TC0 (12) // Timer Counter 0 +-#define AT91C_ID_TC1 (13) // Timer Counter 1 +-#define AT91C_ID_TC2 (14) // Timer Counter 2 +-#define AT91C_ID_CAN (15) // Control Area Network Controller +-#define AT91C_ID_EMAC (16) // Ethernet MAC +-#define AT91C_ID_ADC (17) // Analog-to-Digital Converter +-#define AT91C_ID_18_Reserved (18) // Reserved +-#define AT91C_ID_19_Reserved (19) // Reserved +-#define AT91C_ID_20_Reserved (20) // Reserved +-#define AT91C_ID_21_Reserved (21) // Reserved +-#define AT91C_ID_22_Reserved (22) // Reserved +-#define AT91C_ID_23_Reserved (23) // Reserved +-#define AT91C_ID_24_Reserved (24) // Reserved +-#define AT91C_ID_25_Reserved (25) // Reserved +-#define AT91C_ID_26_Reserved (26) // Reserved +-#define AT91C_ID_27_Reserved (27) // Reserved +-#define AT91C_ID_28_Reserved (28) // Reserved +-#define AT91C_ID_29_Reserved (29) // Reserved +-#define AT91C_ID_IRQ0 (30) // Advanced Interrupt Controller (IRQ0) +-#define AT91C_ID_IRQ1 (31) // Advanced Interrupt Controller (IRQ1) +-#define AT91C_ALL_INT (0xC003FFFF) // ALL VALID INTERRUPTS +- +-// ***************************************************************************** +-// BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_BASE_SYS (0xFFFFF000) // (SYS) Base Address +-#define AT91C_BASE_AIC (0xFFFFF000) // (AIC) Base Address +-#define AT91C_BASE_PDC_DBGU (0xFFFFF300) // (PDC_DBGU) Base Address +-#define AT91C_BASE_DBGU (0xFFFFF200) // (DBGU) Base Address +-#define AT91C_BASE_PIOA (0xFFFFF400) // (PIOA) Base Address +-#define AT91C_BASE_PIOB (0xFFFFF600) // (PIOB) Base Address +-#define AT91C_BASE_CKGR (0xFFFFFC20) // (CKGR) Base Address +-#define AT91C_BASE_PMC (0xFFFFFC00) // (PMC) Base Address +-#define AT91C_BASE_RSTC (0xFFFFFD00) // (RSTC) Base Address +-#define AT91C_BASE_RTTC (0xFFFFFD20) // (RTTC) Base Address +-#define AT91C_BASE_PITC (0xFFFFFD30) // (PITC) Base Address +-#define AT91C_BASE_WDTC (0xFFFFFD40) // (WDTC) Base Address +-#define AT91C_BASE_VREG (0xFFFFFD60) // (VREG) Base Address +-#define AT91C_BASE_MC (0xFFFFFF00) // (MC) Base Address +-#define AT91C_BASE_PDC_SPI1 (0xFFFE4100) // (PDC_SPI1) Base Address +-#define AT91C_BASE_SPI1 (0xFFFE4000) // (SPI1) Base Address +-#define AT91C_BASE_PDC_SPI0 (0xFFFE0100) // (PDC_SPI0) Base Address +-#define AT91C_BASE_SPI0 (0xFFFE0000) // (SPI0) Base Address +-#define AT91C_BASE_PDC_US1 (0xFFFC4100) // (PDC_US1) Base Address +-#define AT91C_BASE_US1 (0xFFFC4000) // (US1) Base Address +-#define AT91C_BASE_PDC_US0 (0xFFFC0100) // (PDC_US0) Base Address +-#define AT91C_BASE_US0 (0xFFFC0000) // (US0) Base Address +-#define AT91C_BASE_PDC_SSC (0xFFFD4100) // (PDC_SSC) Base Address +-#define AT91C_BASE_SSC (0xFFFD4000) // (SSC) Base Address +-#define AT91C_BASE_TWI (0xFFFB8000) // (TWI) Base Address +-#define AT91C_BASE_PWMC_CH3 (0xFFFCC260) // (PWMC_CH3) Base Address +-#define AT91C_BASE_PWMC_CH2 (0xFFFCC240) // (PWMC_CH2) Base Address +-#define AT91C_BASE_PWMC_CH1 (0xFFFCC220) // (PWMC_CH1) Base Address +-#define AT91C_BASE_PWMC_CH0 (0xFFFCC200) // (PWMC_CH0) Base Address +-#define AT91C_BASE_PWMC (0xFFFCC000) // (PWMC) Base Address +-#define AT91C_BASE_UDP (0xFFFB0000) // (UDP) Base Address +-#define AT91C_BASE_TC0 (0xFFFA0000) // (TC0) Base Address +-#define AT91C_BASE_TC1 (0xFFFA0040) // (TC1) Base Address +-#define AT91C_BASE_TC2 (0xFFFA0080) // (TC2) Base Address +-#define AT91C_BASE_TCB (0xFFFA0000) // (TCB) Base Address +-#define AT91C_BASE_CAN_MB0 (0xFFFD0200) // (CAN_MB0) Base Address +-#define AT91C_BASE_CAN_MB1 (0xFFFD0220) // (CAN_MB1) Base Address +-#define AT91C_BASE_CAN_MB2 (0xFFFD0240) // (CAN_MB2) Base Address +-#define AT91C_BASE_CAN_MB3 (0xFFFD0260) // (CAN_MB3) Base Address +-#define AT91C_BASE_CAN_MB4 (0xFFFD0280) // (CAN_MB4) Base Address +-#define AT91C_BASE_CAN_MB5 (0xFFFD02A0) // (CAN_MB5) Base Address +-#define AT91C_BASE_CAN_MB6 (0xFFFD02C0) // (CAN_MB6) Base Address +-#define AT91C_BASE_CAN_MB7 (0xFFFD02E0) // (CAN_MB7) Base Address +-#define AT91C_BASE_CAN (0xFFFD0000) // (CAN) Base Address +-#define AT91C_BASE_EMAC (0xFFFDC000) // (EMAC) Base Address +-#define AT91C_BASE_PDC_ADC (0xFFFD8100) // (PDC_ADC) Base Address +-#define AT91C_BASE_ADC (0xFFFD8000) // (ADC) Base Address +- +-// ***************************************************************************** +-// MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-// ISRAM +-#define AT91C_ISRAM (0x00200000) // Internal SRAM base address +-#define AT91C_ISRAM_SIZE (0x00010000) // Internal SRAM size in byte (64 Kbytes) +-// IFLASH +-#define AT91C_IFLASH (0x00100000) // Internal FLASH base address +-#define AT91C_IFLASH_SIZE (0x00040000) // Internal FLASH size in byte (256 Kbytes) +-#define AT91C_IFLASH_PAGE_SIZE (256) // Internal FLASH Page Size: 256 bytes +-#define AT91C_IFLASH_LOCK_REGION_SIZE (16384) // Internal FLASH Lock Region Size: 16 Kbytes +-#define AT91C_IFLASH_NB_OF_PAGES (1024) // Internal FLASH Number of Pages: 1024 bytes +-#define AT91C_IFLASH_NB_OF_LOCK_BITS (16) // Internal FLASH Number of Lock Bits: 16 bytes +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/ioat91sam7x256.h b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/ioat91sam7x256.h +deleted file mode 100644 +index ab71b93321..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/ioat91sam7x256.h ++++ /dev/null +@@ -1,4380 +0,0 @@ +-// - ---------------------------------------------------------------------------- +-// - ATMEL Microcontroller Software Support - ROUSSET - +-// - ---------------------------------------------------------------------------- +-// - DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// - DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h +-// - Object : AT91SAM7X256 definitions +-// - Generated : AT91 SW Application Group 11/02/2005 (15:17:24) +-// - +-// - CVS Reference : /AT91SAM7X256.pl/1.14/Tue Sep 13 15:06:52 2005// +-// - CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// +-// - CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// +-// - CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// +-// - CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// +-// - CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// +-// - CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// +-// - CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// +-// - CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// +-// - CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// +-// - CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// +-// - CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// +-// - CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// +-// - CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// +-// - CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// +-// - CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// +-// - CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// +-// - CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// +-// - CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// +-// - CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// +-// - CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// +-// - CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// +-// - CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// +-// - ---------------------------------------------------------------------------- +- +-#ifndef AT91SAM7X256_H +-#define AT91SAM7X256_H +- +-#ifdef __IAR_SYSTEMS_ICC__ +- +-typedef volatile unsigned int AT91_REG;// Hardware register definition +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR System Peripherals +-// ***************************************************************************** +-typedef struct _AT91S_SYS { +- AT91_REG AIC_SMR[32]; // Source Mode Register +- AT91_REG AIC_SVR[32]; // Source Vector Register +- AT91_REG AIC_IVR; // IRQ Vector Register +- AT91_REG AIC_FVR; // FIQ Vector Register +- AT91_REG AIC_ISR; // Interrupt Status Register +- AT91_REG AIC_IPR; // Interrupt Pending Register +- AT91_REG AIC_IMR; // Interrupt Mask Register +- AT91_REG AIC_CISR; // Core Interrupt Status Register +- AT91_REG Reserved0[2]; // +- AT91_REG AIC_IECR; // Interrupt Enable Command Register +- AT91_REG AIC_IDCR; // Interrupt Disable Command Register +- AT91_REG AIC_ICCR; // Interrupt Clear Command Register +- AT91_REG AIC_ISCR; // Interrupt Set Command Register +- AT91_REG AIC_EOICR; // End of Interrupt Command Register +- AT91_REG AIC_SPU; // Spurious Vector Register +- AT91_REG AIC_DCR; // Debug Control Register (Protect) +- AT91_REG Reserved1[1]; // +- AT91_REG AIC_FFER; // Fast Forcing Enable Register +- AT91_REG AIC_FFDR; // Fast Forcing Disable Register +- AT91_REG AIC_FFSR; // Fast Forcing Status Register +- AT91_REG Reserved2[45]; // +- AT91_REG DBGU_CR; // Control Register +- AT91_REG DBGU_MR; // Mode Register +- AT91_REG DBGU_IER; // Interrupt Enable Register +- AT91_REG DBGU_IDR; // Interrupt Disable Register +- AT91_REG DBGU_IMR; // Interrupt Mask Register +- AT91_REG DBGU_CSR; // Channel Status Register +- AT91_REG DBGU_RHR; // Receiver Holding Register +- AT91_REG DBGU_THR; // Transmitter Holding Register +- AT91_REG DBGU_BRGR; // Baud Rate Generator Register +- AT91_REG Reserved3[7]; // +- AT91_REG DBGU_CIDR; // Chip ID Register +- AT91_REG DBGU_EXID; // Chip ID Extension Register +- AT91_REG DBGU_FNTR; // Force NTRST Register +- AT91_REG Reserved4[45]; // +- AT91_REG DBGU_RPR; // Receive Pointer Register +- AT91_REG DBGU_RCR; // Receive Counter Register +- AT91_REG DBGU_TPR; // Transmit Pointer Register +- AT91_REG DBGU_TCR; // Transmit Counter Register +- AT91_REG DBGU_RNPR; // Receive Next Pointer Register +- AT91_REG DBGU_RNCR; // Receive Next Counter Register +- AT91_REG DBGU_TNPR; // Transmit Next Pointer Register +- AT91_REG DBGU_TNCR; // Transmit Next Counter Register +- AT91_REG DBGU_PTCR; // PDC Transfer Control Register +- AT91_REG DBGU_PTSR; // PDC Transfer Status Register +- AT91_REG Reserved5[54]; // +- AT91_REG PIOA_PER; // PIO Enable Register +- AT91_REG PIOA_PDR; // PIO Disable Register +- AT91_REG PIOA_PSR; // PIO Status Register +- AT91_REG Reserved6[1]; // +- AT91_REG PIOA_OER; // Output Enable Register +- AT91_REG PIOA_ODR; // Output Disable Registerr +- AT91_REG PIOA_OSR; // Output Status Register +- AT91_REG Reserved7[1]; // +- AT91_REG PIOA_IFER; // Input Filter Enable Register +- AT91_REG PIOA_IFDR; // Input Filter Disable Register +- AT91_REG PIOA_IFSR; // Input Filter Status Register +- AT91_REG Reserved8[1]; // +- AT91_REG PIOA_SODR; // Set Output Data Register +- AT91_REG PIOA_CODR; // Clear Output Data Register +- AT91_REG PIOA_ODSR; // Output Data Status Register +- AT91_REG PIOA_PDSR; // Pin Data Status Register +- AT91_REG PIOA_IER; // Interrupt Enable Register +- AT91_REG PIOA_IDR; // Interrupt Disable Register +- AT91_REG PIOA_IMR; // Interrupt Mask Register +- AT91_REG PIOA_ISR; // Interrupt Status Register +- AT91_REG PIOA_MDER; // Multi-driver Enable Register +- AT91_REG PIOA_MDDR; // Multi-driver Disable Register +- AT91_REG PIOA_MDSR; // Multi-driver Status Register +- AT91_REG Reserved9[1]; // +- AT91_REG PIOA_PPUDR; // Pull-up Disable Register +- AT91_REG PIOA_PPUER; // Pull-up Enable Register +- AT91_REG PIOA_PPUSR; // Pull-up Status Register +- AT91_REG Reserved10[1]; // +- AT91_REG PIOA_ASR; // Select A Register +- AT91_REG PIOA_BSR; // Select B Register +- AT91_REG PIOA_ABSR; // AB Select Status Register +- AT91_REG Reserved11[9]; // +- AT91_REG PIOA_OWER; // Output Write Enable Register +- AT91_REG PIOA_OWDR; // Output Write Disable Register +- AT91_REG PIOA_OWSR; // Output Write Status Register +- AT91_REG Reserved12[85]; // +- AT91_REG PIOB_PER; // PIO Enable Register +- AT91_REG PIOB_PDR; // PIO Disable Register +- AT91_REG PIOB_PSR; // PIO Status Register +- AT91_REG Reserved13[1]; // +- AT91_REG PIOB_OER; // Output Enable Register +- AT91_REG PIOB_ODR; // Output Disable Registerr +- AT91_REG PIOB_OSR; // Output Status Register +- AT91_REG Reserved14[1]; // +- AT91_REG PIOB_IFER; // Input Filter Enable Register +- AT91_REG PIOB_IFDR; // Input Filter Disable Register +- AT91_REG PIOB_IFSR; // Input Filter Status Register +- AT91_REG Reserved15[1]; // +- AT91_REG PIOB_SODR; // Set Output Data Register +- AT91_REG PIOB_CODR; // Clear Output Data Register +- AT91_REG PIOB_ODSR; // Output Data Status Register +- AT91_REG PIOB_PDSR; // Pin Data Status Register +- AT91_REG PIOB_IER; // Interrupt Enable Register +- AT91_REG PIOB_IDR; // Interrupt Disable Register +- AT91_REG PIOB_IMR; // Interrupt Mask Register +- AT91_REG PIOB_ISR; // Interrupt Status Register +- AT91_REG PIOB_MDER; // Multi-driver Enable Register +- AT91_REG PIOB_MDDR; // Multi-driver Disable Register +- AT91_REG PIOB_MDSR; // Multi-driver Status Register +- AT91_REG Reserved16[1]; // +- AT91_REG PIOB_PPUDR; // Pull-up Disable Register +- AT91_REG PIOB_PPUER; // Pull-up Enable Register +- AT91_REG PIOB_PPUSR; // Pull-up Status Register +- AT91_REG Reserved17[1]; // +- AT91_REG PIOB_ASR; // Select A Register +- AT91_REG PIOB_BSR; // Select B Register +- AT91_REG PIOB_ABSR; // AB Select Status Register +- AT91_REG Reserved18[9]; // +- AT91_REG PIOB_OWER; // Output Write Enable Register +- AT91_REG PIOB_OWDR; // Output Write Disable Register +- AT91_REG PIOB_OWSR; // Output Write Status Register +- AT91_REG Reserved19[341]; // +- AT91_REG PMC_SCER; // System Clock Enable Register +- AT91_REG PMC_SCDR; // System Clock Disable Register +- AT91_REG PMC_SCSR; // System Clock Status Register +- AT91_REG Reserved20[1]; // +- AT91_REG PMC_PCER; // Peripheral Clock Enable Register +- AT91_REG PMC_PCDR; // Peripheral Clock Disable Register +- AT91_REG PMC_PCSR; // Peripheral Clock Status Register +- AT91_REG Reserved21[1]; // +- AT91_REG PMC_MOR; // Main Oscillator Register +- AT91_REG PMC_MCFR; // Main Clock Frequency Register +- AT91_REG Reserved22[1]; // +- AT91_REG PMC_PLLR; // PLL Register +- AT91_REG PMC_MCKR; // Master Clock Register +- AT91_REG Reserved23[3]; // +- AT91_REG PMC_PCKR[4]; // Programmable Clock Register +- AT91_REG Reserved24[4]; // +- AT91_REG PMC_IER; // Interrupt Enable Register +- AT91_REG PMC_IDR; // Interrupt Disable Register +- AT91_REG PMC_SR; // Status Register +- AT91_REG PMC_IMR; // Interrupt Mask Register +- AT91_REG Reserved25[36]; // +- AT91_REG RSTC_RCR; // Reset Control Register +- AT91_REG RSTC_RSR; // Reset Status Register +- AT91_REG RSTC_RMR; // Reset Mode Register +- AT91_REG Reserved26[5]; // +- AT91_REG RTTC_RTMR; // Real-time Mode Register +- AT91_REG RTTC_RTAR; // Real-time Alarm Register +- AT91_REG RTTC_RTVR; // Real-time Value Register +- AT91_REG RTTC_RTSR; // Real-time Status Register +- AT91_REG PITC_PIMR; // Period Interval Mode Register +- AT91_REG PITC_PISR; // Period Interval Status Register +- AT91_REG PITC_PIVR; // Period Interval Value Register +- AT91_REG PITC_PIIR; // Period Interval Image Register +- AT91_REG WDTC_WDCR; // Watchdog Control Register +- AT91_REG WDTC_WDMR; // Watchdog Mode Register +- AT91_REG WDTC_WDSR; // Watchdog Status Register +- AT91_REG Reserved27[5]; // +- AT91_REG VREG_MR; // Voltage Regulator Mode Register +-} AT91S_SYS, *AT91PS_SYS; +- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Advanced Interrupt Controller +-// ***************************************************************************** +-typedef struct _AT91S_AIC { +- AT91_REG AIC_SMR[32]; // Source Mode Register +- AT91_REG AIC_SVR[32]; // Source Vector Register +- AT91_REG AIC_IVR; // IRQ Vector Register +- AT91_REG AIC_FVR; // FIQ Vector Register +- AT91_REG AIC_ISR; // Interrupt Status Register +- AT91_REG AIC_IPR; // Interrupt Pending Register +- AT91_REG AIC_IMR; // Interrupt Mask Register +- AT91_REG AIC_CISR; // Core Interrupt Status Register +- AT91_REG Reserved0[2]; // +- AT91_REG AIC_IECR; // Interrupt Enable Command Register +- AT91_REG AIC_IDCR; // Interrupt Disable Command Register +- AT91_REG AIC_ICCR; // Interrupt Clear Command Register +- AT91_REG AIC_ISCR; // Interrupt Set Command Register +- AT91_REG AIC_EOICR; // End of Interrupt Command Register +- AT91_REG AIC_SPU; // Spurious Vector Register +- AT91_REG AIC_DCR; // Debug Control Register (Protect) +- AT91_REG Reserved1[1]; // +- AT91_REG AIC_FFER; // Fast Forcing Enable Register +- AT91_REG AIC_FFDR; // Fast Forcing Disable Register +- AT91_REG AIC_FFSR; // Fast Forcing Status Register +-} AT91S_AIC, *AT91PS_AIC; +- +-// -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- +-#define AT91C_AIC_PRIOR ((unsigned int) 0x7 << 0) // (AIC) Priority Level +-#define AT91C_AIC_PRIOR_LOWEST ((unsigned int) 0x0) // (AIC) Lowest priority level +-#define AT91C_AIC_PRIOR_HIGHEST ((unsigned int) 0x7) // (AIC) Highest priority level +-#define AT91C_AIC_SRCTYPE ((unsigned int) 0x3 << 5) // (AIC) Interrupt Source Type +-#define AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL ((unsigned int) 0x0 << 5) // (AIC) Internal Sources Code Label High-level Sensitive +-#define AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL ((unsigned int) 0x0 << 5) // (AIC) External Sources Code Label Low-level Sensitive +-#define AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE ((unsigned int) 0x1 << 5) // (AIC) Internal Sources Code Label Positive Edge triggered +-#define AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE ((unsigned int) 0x1 << 5) // (AIC) External Sources Code Label Negative Edge triggered +-#define AT91C_AIC_SRCTYPE_HIGH_LEVEL ((unsigned int) 0x2 << 5) // (AIC) Internal Or External Sources Code Label High-level Sensitive +-#define AT91C_AIC_SRCTYPE_POSITIVE_EDGE ((unsigned int) 0x3 << 5) // (AIC) Internal Or External Sources Code Label Positive Edge triggered +-// -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- +-#define AT91C_AIC_NFIQ ((unsigned int) 0x1 << 0) // (AIC) NFIQ Status +-#define AT91C_AIC_NIRQ ((unsigned int) 0x1 << 1) // (AIC) NIRQ Status +-// -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- +-#define AT91C_AIC_DCR_PROT ((unsigned int) 0x1 << 0) // (AIC) Protection Mode +-#define AT91C_AIC_DCR_GMSK ((unsigned int) 0x1 << 1) // (AIC) General Mask +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Peripheral DMA Controller +-// ***************************************************************************** +-typedef struct _AT91S_PDC { +- AT91_REG PDC_RPR; // Receive Pointer Register +- AT91_REG PDC_RCR; // Receive Counter Register +- AT91_REG PDC_TPR; // Transmit Pointer Register +- AT91_REG PDC_TCR; // Transmit Counter Register +- AT91_REG PDC_RNPR; // Receive Next Pointer Register +- AT91_REG PDC_RNCR; // Receive Next Counter Register +- AT91_REG PDC_TNPR; // Transmit Next Pointer Register +- AT91_REG PDC_TNCR; // Transmit Next Counter Register +- AT91_REG PDC_PTCR; // PDC Transfer Control Register +- AT91_REG PDC_PTSR; // PDC Transfer Status Register +-} AT91S_PDC, *AT91PS_PDC; +- +-// -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- +-#define AT91C_PDC_RXTEN ((unsigned int) 0x1 << 0) // (PDC) Receiver Transfer Enable +-#define AT91C_PDC_RXTDIS ((unsigned int) 0x1 << 1) // (PDC) Receiver Transfer Disable +-#define AT91C_PDC_TXTEN ((unsigned int) 0x1 << 8) // (PDC) Transmitter Transfer Enable +-#define AT91C_PDC_TXTDIS ((unsigned int) 0x1 << 9) // (PDC) Transmitter Transfer Disable +-// -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Debug Unit +-// ***************************************************************************** +-typedef struct _AT91S_DBGU { +- AT91_REG DBGU_CR; // Control Register +- AT91_REG DBGU_MR; // Mode Register +- AT91_REG DBGU_IER; // Interrupt Enable Register +- AT91_REG DBGU_IDR; // Interrupt Disable Register +- AT91_REG DBGU_IMR; // Interrupt Mask Register +- AT91_REG DBGU_CSR; // Channel Status Register +- AT91_REG DBGU_RHR; // Receiver Holding Register +- AT91_REG DBGU_THR; // Transmitter Holding Register +- AT91_REG DBGU_BRGR; // Baud Rate Generator Register +- AT91_REG Reserved0[7]; // +- AT91_REG DBGU_CIDR; // Chip ID Register +- AT91_REG DBGU_EXID; // Chip ID Extension Register +- AT91_REG DBGU_FNTR; // Force NTRST Register +- AT91_REG Reserved1[45]; // +- AT91_REG DBGU_RPR; // Receive Pointer Register +- AT91_REG DBGU_RCR; // Receive Counter Register +- AT91_REG DBGU_TPR; // Transmit Pointer Register +- AT91_REG DBGU_TCR; // Transmit Counter Register +- AT91_REG DBGU_RNPR; // Receive Next Pointer Register +- AT91_REG DBGU_RNCR; // Receive Next Counter Register +- AT91_REG DBGU_TNPR; // Transmit Next Pointer Register +- AT91_REG DBGU_TNCR; // Transmit Next Counter Register +- AT91_REG DBGU_PTCR; // PDC Transfer Control Register +- AT91_REG DBGU_PTSR; // PDC Transfer Status Register +-} AT91S_DBGU, *AT91PS_DBGU; +- +-// -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- +-#define AT91C_US_RSTRX ((unsigned int) 0x1 << 2) // (DBGU) Reset Receiver +-#define AT91C_US_RSTTX ((unsigned int) 0x1 << 3) // (DBGU) Reset Transmitter +-#define AT91C_US_RXEN ((unsigned int) 0x1 << 4) // (DBGU) Receiver Enable +-#define AT91C_US_RXDIS ((unsigned int) 0x1 << 5) // (DBGU) Receiver Disable +-#define AT91C_US_TXEN ((unsigned int) 0x1 << 6) // (DBGU) Transmitter Enable +-#define AT91C_US_TXDIS ((unsigned int) 0x1 << 7) // (DBGU) Transmitter Disable +-#define AT91C_US_RSTSTA ((unsigned int) 0x1 << 8) // (DBGU) Reset Status Bits +-// -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- +-#define AT91C_US_PAR ((unsigned int) 0x7 << 9) // (DBGU) Parity type +-#define AT91C_US_PAR_EVEN ((unsigned int) 0x0 << 9) // (DBGU) Even Parity +-#define AT91C_US_PAR_ODD ((unsigned int) 0x1 << 9) // (DBGU) Odd Parity +-#define AT91C_US_PAR_SPACE ((unsigned int) 0x2 << 9) // (DBGU) Parity forced to 0 (Space) +-#define AT91C_US_PAR_MARK ((unsigned int) 0x3 << 9) // (DBGU) Parity forced to 1 (Mark) +-#define AT91C_US_PAR_NONE ((unsigned int) 0x4 << 9) // (DBGU) No Parity +-#define AT91C_US_PAR_MULTI_DROP ((unsigned int) 0x6 << 9) // (DBGU) Multi-drop mode +-#define AT91C_US_CHMODE ((unsigned int) 0x3 << 14) // (DBGU) Channel Mode +-#define AT91C_US_CHMODE_NORMAL ((unsigned int) 0x0 << 14) // (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. +-#define AT91C_US_CHMODE_AUTO ((unsigned int) 0x1 << 14) // (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. +-#define AT91C_US_CHMODE_LOCAL ((unsigned int) 0x2 << 14) // (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. +-#define AT91C_US_CHMODE_REMOTE ((unsigned int) 0x3 << 14) // (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. +-// -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-#define AT91C_US_RXRDY ((unsigned int) 0x1 << 0) // (DBGU) RXRDY Interrupt +-#define AT91C_US_TXRDY ((unsigned int) 0x1 << 1) // (DBGU) TXRDY Interrupt +-#define AT91C_US_ENDRX ((unsigned int) 0x1 << 3) // (DBGU) End of Receive Transfer Interrupt +-#define AT91C_US_ENDTX ((unsigned int) 0x1 << 4) // (DBGU) End of Transmit Interrupt +-#define AT91C_US_OVRE ((unsigned int) 0x1 << 5) // (DBGU) Overrun Interrupt +-#define AT91C_US_FRAME ((unsigned int) 0x1 << 6) // (DBGU) Framing Error Interrupt +-#define AT91C_US_PARE ((unsigned int) 0x1 << 7) // (DBGU) Parity Error Interrupt +-#define AT91C_US_TXEMPTY ((unsigned int) 0x1 << 9) // (DBGU) TXEMPTY Interrupt +-#define AT91C_US_TXBUFE ((unsigned int) 0x1 << 11) // (DBGU) TXBUFE Interrupt +-#define AT91C_US_RXBUFF ((unsigned int) 0x1 << 12) // (DBGU) RXBUFF Interrupt +-#define AT91C_US_COMM_TX ((unsigned int) 0x1 << 30) // (DBGU) COMM_TX Interrupt +-#define AT91C_US_COMM_RX ((unsigned int) 0x1 << 31) // (DBGU) COMM_RX Interrupt +-// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- +-// -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- +-#define AT91C_US_FORCE_NTRST ((unsigned int) 0x1 << 0) // (DBGU) Force NTRST in JTAG +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Parallel Input Output Controler +-// ***************************************************************************** +-typedef struct _AT91S_PIO { +- AT91_REG PIO_PER; // PIO Enable Register +- AT91_REG PIO_PDR; // PIO Disable Register +- AT91_REG PIO_PSR; // PIO Status Register +- AT91_REG Reserved0[1]; // +- AT91_REG PIO_OER; // Output Enable Register +- AT91_REG PIO_ODR; // Output Disable Registerr +- AT91_REG PIO_OSR; // Output Status Register +- AT91_REG Reserved1[1]; // +- AT91_REG PIO_IFER; // Input Filter Enable Register +- AT91_REG PIO_IFDR; // Input Filter Disable Register +- AT91_REG PIO_IFSR; // Input Filter Status Register +- AT91_REG Reserved2[1]; // +- AT91_REG PIO_SODR; // Set Output Data Register +- AT91_REG PIO_CODR; // Clear Output Data Register +- AT91_REG PIO_ODSR; // Output Data Status Register +- AT91_REG PIO_PDSR; // Pin Data Status Register +- AT91_REG PIO_IER; // Interrupt Enable Register +- AT91_REG PIO_IDR; // Interrupt Disable Register +- AT91_REG PIO_IMR; // Interrupt Mask Register +- AT91_REG PIO_ISR; // Interrupt Status Register +- AT91_REG PIO_MDER; // Multi-driver Enable Register +- AT91_REG PIO_MDDR; // Multi-driver Disable Register +- AT91_REG PIO_MDSR; // Multi-driver Status Register +- AT91_REG Reserved3[1]; // +- AT91_REG PIO_PPUDR; // Pull-up Disable Register +- AT91_REG PIO_PPUER; // Pull-up Enable Register +- AT91_REG PIO_PPUSR; // Pull-up Status Register +- AT91_REG Reserved4[1]; // +- AT91_REG PIO_ASR; // Select A Register +- AT91_REG PIO_BSR; // Select B Register +- AT91_REG PIO_ABSR; // AB Select Status Register +- AT91_REG Reserved5[9]; // +- AT91_REG PIO_OWER; // Output Write Enable Register +- AT91_REG PIO_OWDR; // Output Write Disable Register +- AT91_REG PIO_OWSR; // Output Write Status Register +-} AT91S_PIO, *AT91PS_PIO; +- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Clock Generator Controler +-// ***************************************************************************** +-typedef struct _AT91S_CKGR { +- AT91_REG CKGR_MOR; // Main Oscillator Register +- AT91_REG CKGR_MCFR; // Main Clock Frequency Register +- AT91_REG Reserved0[1]; // +- AT91_REG CKGR_PLLR; // PLL Register +-} AT91S_CKGR, *AT91PS_CKGR; +- +-// -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- +-#define AT91C_CKGR_MOSCEN ((unsigned int) 0x1 << 0) // (CKGR) Main Oscillator Enable +-#define AT91C_CKGR_OSCBYPASS ((unsigned int) 0x1 << 1) // (CKGR) Main Oscillator Bypass +-#define AT91C_CKGR_OSCOUNT ((unsigned int) 0xFF << 8) // (CKGR) Main Oscillator Start-up Time +-// -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- +-#define AT91C_CKGR_MAINF ((unsigned int) 0xFFFF << 0) // (CKGR) Main Clock Frequency +-#define AT91C_CKGR_MAINRDY ((unsigned int) 0x1 << 16) // (CKGR) Main Clock Ready +-// -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- +-#define AT91C_CKGR_DIV ((unsigned int) 0xFF << 0) // (CKGR) Divider Selected +-#define AT91C_CKGR_DIV_0 ((unsigned int) 0x0) // (CKGR) Divider output is 0 +-#define AT91C_CKGR_DIV_BYPASS ((unsigned int) 0x1) // (CKGR) Divider is bypassed +-#define AT91C_CKGR_PLLCOUNT ((unsigned int) 0x3F << 8) // (CKGR) PLL Counter +-#define AT91C_CKGR_OUT ((unsigned int) 0x3 << 14) // (CKGR) PLL Output Frequency Range +-#define AT91C_CKGR_OUT_0 ((unsigned int) 0x0 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_1 ((unsigned int) 0x1 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_2 ((unsigned int) 0x2 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_3 ((unsigned int) 0x3 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_MUL ((unsigned int) 0x7FF << 16) // (CKGR) PLL Multiplier +-#define AT91C_CKGR_USBDIV ((unsigned int) 0x3 << 28) // (CKGR) Divider for USB Clocks +-#define AT91C_CKGR_USBDIV_0 ((unsigned int) 0x0 << 28) // (CKGR) Divider output is PLL clock output +-#define AT91C_CKGR_USBDIV_1 ((unsigned int) 0x1 << 28) // (CKGR) Divider output is PLL clock output divided by 2 +-#define AT91C_CKGR_USBDIV_2 ((unsigned int) 0x2 << 28) // (CKGR) Divider output is PLL clock output divided by 4 +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Power Management Controler +-// ***************************************************************************** +-typedef struct _AT91S_PMC { +- AT91_REG PMC_SCER; // System Clock Enable Register +- AT91_REG PMC_SCDR; // System Clock Disable Register +- AT91_REG PMC_SCSR; // System Clock Status Register +- AT91_REG Reserved0[1]; // +- AT91_REG PMC_PCER; // Peripheral Clock Enable Register +- AT91_REG PMC_PCDR; // Peripheral Clock Disable Register +- AT91_REG PMC_PCSR; // Peripheral Clock Status Register +- AT91_REG Reserved1[1]; // +- AT91_REG PMC_MOR; // Main Oscillator Register +- AT91_REG PMC_MCFR; // Main Clock Frequency Register +- AT91_REG Reserved2[1]; // +- AT91_REG PMC_PLLR; // PLL Register +- AT91_REG PMC_MCKR; // Master Clock Register +- AT91_REG Reserved3[3]; // +- AT91_REG PMC_PCKR[4]; // Programmable Clock Register +- AT91_REG Reserved4[4]; // +- AT91_REG PMC_IER; // Interrupt Enable Register +- AT91_REG PMC_IDR; // Interrupt Disable Register +- AT91_REG PMC_SR; // Status Register +- AT91_REG PMC_IMR; // Interrupt Mask Register +-} AT91S_PMC, *AT91PS_PMC; +- +-// -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- +-#define AT91C_PMC_PCK ((unsigned int) 0x1 << 0) // (PMC) Processor Clock +-#define AT91C_PMC_UDP ((unsigned int) 0x1 << 7) // (PMC) USB Device Port Clock +-#define AT91C_PMC_PCK0 ((unsigned int) 0x1 << 8) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK1 ((unsigned int) 0x1 << 9) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK2 ((unsigned int) 0x1 << 10) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK3 ((unsigned int) 0x1 << 11) // (PMC) Programmable Clock Output +-// -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- +-// -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- +-// -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- +-// -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- +-// -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- +-// -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- +-#define AT91C_PMC_CSS ((unsigned int) 0x3 << 0) // (PMC) Programmable Clock Selection +-#define AT91C_PMC_CSS_SLOW_CLK ((unsigned int) 0x0) // (PMC) Slow Clock is selected +-#define AT91C_PMC_CSS_MAIN_CLK ((unsigned int) 0x1) // (PMC) Main Clock is selected +-#define AT91C_PMC_CSS_PLL_CLK ((unsigned int) 0x3) // (PMC) Clock from PLL is selected +-#define AT91C_PMC_PRES ((unsigned int) 0x7 << 2) // (PMC) Programmable Clock Prescaler +-#define AT91C_PMC_PRES_CLK ((unsigned int) 0x0 << 2) // (PMC) Selected clock +-#define AT91C_PMC_PRES_CLK_2 ((unsigned int) 0x1 << 2) // (PMC) Selected clock divided by 2 +-#define AT91C_PMC_PRES_CLK_4 ((unsigned int) 0x2 << 2) // (PMC) Selected clock divided by 4 +-#define AT91C_PMC_PRES_CLK_8 ((unsigned int) 0x3 << 2) // (PMC) Selected clock divided by 8 +-#define AT91C_PMC_PRES_CLK_16 ((unsigned int) 0x4 << 2) // (PMC) Selected clock divided by 16 +-#define AT91C_PMC_PRES_CLK_32 ((unsigned int) 0x5 << 2) // (PMC) Selected clock divided by 32 +-#define AT91C_PMC_PRES_CLK_64 ((unsigned int) 0x6 << 2) // (PMC) Selected clock divided by 64 +-// -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- +-// -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- +-#define AT91C_PMC_MOSCS ((unsigned int) 0x1 << 0) // (PMC) MOSC Status/Enable/Disable/Mask +-#define AT91C_PMC_LOCK ((unsigned int) 0x1 << 2) // (PMC) PLL Status/Enable/Disable/Mask +-#define AT91C_PMC_MCKRDY ((unsigned int) 0x1 << 3) // (PMC) MCK_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK0RDY ((unsigned int) 0x1 << 8) // (PMC) PCK0_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK1RDY ((unsigned int) 0x1 << 9) // (PMC) PCK1_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK2RDY ((unsigned int) 0x1 << 10) // (PMC) PCK2_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK3RDY ((unsigned int) 0x1 << 11) // (PMC) PCK3_RDY Status/Enable/Disable/Mask +-// -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- +-// -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- +-// -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Reset Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_RSTC { +- AT91_REG RSTC_RCR; // Reset Control Register +- AT91_REG RSTC_RSR; // Reset Status Register +- AT91_REG RSTC_RMR; // Reset Mode Register +-} AT91S_RSTC, *AT91PS_RSTC; +- +-// -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- +-#define AT91C_RSTC_PROCRST ((unsigned int) 0x1 << 0) // (RSTC) Processor Reset +-#define AT91C_RSTC_PERRST ((unsigned int) 0x1 << 2) // (RSTC) Peripheral Reset +-#define AT91C_RSTC_EXTRST ((unsigned int) 0x1 << 3) // (RSTC) External Reset +-#define AT91C_RSTC_KEY ((unsigned int) 0xFF << 24) // (RSTC) Password +-// -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- +-#define AT91C_RSTC_URSTS ((unsigned int) 0x1 << 0) // (RSTC) User Reset Status +-#define AT91C_RSTC_BODSTS ((unsigned int) 0x1 << 1) // (RSTC) Brownout Detection Status +-#define AT91C_RSTC_RSTTYP ((unsigned int) 0x7 << 8) // (RSTC) Reset Type +-#define AT91C_RSTC_RSTTYP_POWERUP ((unsigned int) 0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising. +-#define AT91C_RSTC_RSTTYP_WAKEUP ((unsigned int) 0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising. +-#define AT91C_RSTC_RSTTYP_WATCHDOG ((unsigned int) 0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occured. +-#define AT91C_RSTC_RSTTYP_SOFTWARE ((unsigned int) 0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software. +-#define AT91C_RSTC_RSTTYP_USER ((unsigned int) 0x4 << 8) // (RSTC) User Reset. NRST pin detected low. +-#define AT91C_RSTC_RSTTYP_BROWNOUT ((unsigned int) 0x5 << 8) // (RSTC) Brownout Reset occured. +-#define AT91C_RSTC_NRSTL ((unsigned int) 0x1 << 16) // (RSTC) NRST pin level +-#define AT91C_RSTC_SRCMP ((unsigned int) 0x1 << 17) // (RSTC) Software Reset Command in Progress. +-// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- +-#define AT91C_RSTC_URSTEN ((unsigned int) 0x1 << 0) // (RSTC) User Reset Enable +-#define AT91C_RSTC_URSTIEN ((unsigned int) 0x1 << 4) // (RSTC) User Reset Interrupt Enable +-#define AT91C_RSTC_ERSTL ((unsigned int) 0xF << 8) // (RSTC) User Reset Length +-#define AT91C_RSTC_BODIEN ((unsigned int) 0x1 << 16) // (RSTC) Brownout Detection Interrupt Enable +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_RTTC { +- AT91_REG RTTC_RTMR; // Real-time Mode Register +- AT91_REG RTTC_RTAR; // Real-time Alarm Register +- AT91_REG RTTC_RTVR; // Real-time Value Register +- AT91_REG RTTC_RTSR; // Real-time Status Register +-} AT91S_RTTC, *AT91PS_RTTC; +- +-// -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- +-#define AT91C_RTTC_RTPRES ((unsigned int) 0xFFFF << 0) // (RTTC) Real-time Timer Prescaler Value +-#define AT91C_RTTC_ALMIEN ((unsigned int) 0x1 << 16) // (RTTC) Alarm Interrupt Enable +-#define AT91C_RTTC_RTTINCIEN ((unsigned int) 0x1 << 17) // (RTTC) Real Time Timer Increment Interrupt Enable +-#define AT91C_RTTC_RTTRST ((unsigned int) 0x1 << 18) // (RTTC) Real Time Timer Restart +-// -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- +-#define AT91C_RTTC_ALMV ((unsigned int) 0x0 << 0) // (RTTC) Alarm Value +-// -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- +-#define AT91C_RTTC_CRTV ((unsigned int) 0x0 << 0) // (RTTC) Current Real-time Value +-// -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- +-#define AT91C_RTTC_ALMS ((unsigned int) 0x1 << 0) // (RTTC) Real-time Alarm Status +-#define AT91C_RTTC_RTTINC ((unsigned int) 0x1 << 1) // (RTTC) Real-time Timer Increment +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_PITC { +- AT91_REG PITC_PIMR; // Period Interval Mode Register +- AT91_REG PITC_PISR; // Period Interval Status Register +- AT91_REG PITC_PIVR; // Period Interval Value Register +- AT91_REG PITC_PIIR; // Period Interval Image Register +-} AT91S_PITC, *AT91PS_PITC; +- +-// -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- +-#define AT91C_PITC_PIV ((unsigned int) 0xFFFFF << 0) // (PITC) Periodic Interval Value +-#define AT91C_PITC_PITEN ((unsigned int) 0x1 << 24) // (PITC) Periodic Interval Timer Enabled +-#define AT91C_PITC_PITIEN ((unsigned int) 0x1 << 25) // (PITC) Periodic Interval Timer Interrupt Enable +-// -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- +-#define AT91C_PITC_PITS ((unsigned int) 0x1 << 0) // (PITC) Periodic Interval Timer Status +-// -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- +-#define AT91C_PITC_CPIV ((unsigned int) 0xFFFFF << 0) // (PITC) Current Periodic Interval Value +-#define AT91C_PITC_PICNT ((unsigned int) 0xFFF << 20) // (PITC) Periodic Interval Counter +-// -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_WDTC { +- AT91_REG WDTC_WDCR; // Watchdog Control Register +- AT91_REG WDTC_WDMR; // Watchdog Mode Register +- AT91_REG WDTC_WDSR; // Watchdog Status Register +-} AT91S_WDTC, *AT91PS_WDTC; +- +-// -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- +-#define AT91C_WDTC_WDRSTT ((unsigned int) 0x1 << 0) // (WDTC) Watchdog Restart +-#define AT91C_WDTC_KEY ((unsigned int) 0xFF << 24) // (WDTC) Watchdog KEY Password +-// -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- +-#define AT91C_WDTC_WDV ((unsigned int) 0xFFF << 0) // (WDTC) Watchdog Timer Restart +-#define AT91C_WDTC_WDFIEN ((unsigned int) 0x1 << 12) // (WDTC) Watchdog Fault Interrupt Enable +-#define AT91C_WDTC_WDRSTEN ((unsigned int) 0x1 << 13) // (WDTC) Watchdog Reset Enable +-#define AT91C_WDTC_WDRPROC ((unsigned int) 0x1 << 14) // (WDTC) Watchdog Timer Restart +-#define AT91C_WDTC_WDDIS ((unsigned int) 0x1 << 15) // (WDTC) Watchdog Disable +-#define AT91C_WDTC_WDD ((unsigned int) 0xFFF << 16) // (WDTC) Watchdog Delta Value +-#define AT91C_WDTC_WDDBGHLT ((unsigned int) 0x1 << 28) // (WDTC) Watchdog Debug Halt +-#define AT91C_WDTC_WDIDLEHLT ((unsigned int) 0x1 << 29) // (WDTC) Watchdog Idle Halt +-// -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- +-#define AT91C_WDTC_WDUNF ((unsigned int) 0x1 << 0) // (WDTC) Watchdog Underflow +-#define AT91C_WDTC_WDERR ((unsigned int) 0x1 << 1) // (WDTC) Watchdog Error +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_VREG { +- AT91_REG VREG_MR; // Voltage Regulator Mode Register +-} AT91S_VREG, *AT91PS_VREG; +- +-// -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- +-#define AT91C_VREG_PSTDBY ((unsigned int) 0x1 << 0) // (VREG) Voltage Regulator Power Standby Mode +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Memory Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_MC { +- AT91_REG MC_RCR; // MC Remap Control Register +- AT91_REG MC_ASR; // MC Abort Status Register +- AT91_REG MC_AASR; // MC Abort Address Status Register +- AT91_REG Reserved0[21]; // +- AT91_REG MC_FMR; // MC Flash Mode Register +- AT91_REG MC_FCR; // MC Flash Command Register +- AT91_REG MC_FSR; // MC Flash Status Register +-} AT91S_MC, *AT91PS_MC; +- +-// -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- +-#define AT91C_MC_RCB ((unsigned int) 0x1 << 0) // (MC) Remap Command Bit +-// -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- +-#define AT91C_MC_UNDADD ((unsigned int) 0x1 << 0) // (MC) Undefined Addess Abort Status +-#define AT91C_MC_MISADD ((unsigned int) 0x1 << 1) // (MC) Misaligned Addess Abort Status +-#define AT91C_MC_ABTSZ ((unsigned int) 0x3 << 8) // (MC) Abort Size Status +-#define AT91C_MC_ABTSZ_BYTE ((unsigned int) 0x0 << 8) // (MC) Byte +-#define AT91C_MC_ABTSZ_HWORD ((unsigned int) 0x1 << 8) // (MC) Half-word +-#define AT91C_MC_ABTSZ_WORD ((unsigned int) 0x2 << 8) // (MC) Word +-#define AT91C_MC_ABTTYP ((unsigned int) 0x3 << 10) // (MC) Abort Type Status +-#define AT91C_MC_ABTTYP_DATAR ((unsigned int) 0x0 << 10) // (MC) Data Read +-#define AT91C_MC_ABTTYP_DATAW ((unsigned int) 0x1 << 10) // (MC) Data Write +-#define AT91C_MC_ABTTYP_FETCH ((unsigned int) 0x2 << 10) // (MC) Code Fetch +-#define AT91C_MC_MST0 ((unsigned int) 0x1 << 16) // (MC) Master 0 Abort Source +-#define AT91C_MC_MST1 ((unsigned int) 0x1 << 17) // (MC) Master 1 Abort Source +-#define AT91C_MC_SVMST0 ((unsigned int) 0x1 << 24) // (MC) Saved Master 0 Abort Source +-#define AT91C_MC_SVMST1 ((unsigned int) 0x1 << 25) // (MC) Saved Master 1 Abort Source +-// -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- +-#define AT91C_MC_FRDY ((unsigned int) 0x1 << 0) // (MC) Flash Ready +-#define AT91C_MC_LOCKE ((unsigned int) 0x1 << 2) // (MC) Lock Error +-#define AT91C_MC_PROGE ((unsigned int) 0x1 << 3) // (MC) Programming Error +-#define AT91C_MC_NEBP ((unsigned int) 0x1 << 7) // (MC) No Erase Before Programming +-#define AT91C_MC_FWS ((unsigned int) 0x3 << 8) // (MC) Flash Wait State +-#define AT91C_MC_FWS_0FWS ((unsigned int) 0x0 << 8) // (MC) 1 cycle for Read, 2 for Write operations +-#define AT91C_MC_FWS_1FWS ((unsigned int) 0x1 << 8) // (MC) 2 cycles for Read, 3 for Write operations +-#define AT91C_MC_FWS_2FWS ((unsigned int) 0x2 << 8) // (MC) 3 cycles for Read, 4 for Write operations +-#define AT91C_MC_FWS_3FWS ((unsigned int) 0x3 << 8) // (MC) 4 cycles for Read, 4 for Write operations +-#define AT91C_MC_FMCN ((unsigned int) 0xFF << 16) // (MC) Flash Microsecond Cycle Number +-// -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- +-#define AT91C_MC_FCMD ((unsigned int) 0xF << 0) // (MC) Flash Command +-#define AT91C_MC_FCMD_START_PROG ((unsigned int) 0x1) // (MC) Starts the programming of th epage specified by PAGEN. +-#define AT91C_MC_FCMD_LOCK ((unsigned int) 0x2) // (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-#define AT91C_MC_FCMD_PROG_AND_LOCK ((unsigned int) 0x3) // (MC) The lock sequence automatically happens after the programming sequence is completed. +-#define AT91C_MC_FCMD_UNLOCK ((unsigned int) 0x4) // (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-#define AT91C_MC_FCMD_ERASE_ALL ((unsigned int) 0x8) // (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. +-#define AT91C_MC_FCMD_SET_GP_NVM ((unsigned int) 0xB) // (MC) Set General Purpose NVM bits. +-#define AT91C_MC_FCMD_CLR_GP_NVM ((unsigned int) 0xD) // (MC) Clear General Purpose NVM bits. +-#define AT91C_MC_FCMD_SET_SECURITY ((unsigned int) 0xF) // (MC) Set Security Bit. +-#define AT91C_MC_PAGEN ((unsigned int) 0x3FF << 8) // (MC) Page Number +-#define AT91C_MC_KEY ((unsigned int) 0xFF << 24) // (MC) Writing Protect Key +-// -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- +-#define AT91C_MC_SECURITY ((unsigned int) 0x1 << 4) // (MC) Security Bit Status +-#define AT91C_MC_GPNVM0 ((unsigned int) 0x1 << 8) // (MC) Sector 0 Lock Status +-#define AT91C_MC_GPNVM1 ((unsigned int) 0x1 << 9) // (MC) Sector 1 Lock Status +-#define AT91C_MC_GPNVM2 ((unsigned int) 0x1 << 10) // (MC) Sector 2 Lock Status +-#define AT91C_MC_GPNVM3 ((unsigned int) 0x1 << 11) // (MC) Sector 3 Lock Status +-#define AT91C_MC_GPNVM4 ((unsigned int) 0x1 << 12) // (MC) Sector 4 Lock Status +-#define AT91C_MC_GPNVM5 ((unsigned int) 0x1 << 13) // (MC) Sector 5 Lock Status +-#define AT91C_MC_GPNVM6 ((unsigned int) 0x1 << 14) // (MC) Sector 6 Lock Status +-#define AT91C_MC_GPNVM7 ((unsigned int) 0x1 << 15) // (MC) Sector 7 Lock Status +-#define AT91C_MC_LOCKS0 ((unsigned int) 0x1 << 16) // (MC) Sector 0 Lock Status +-#define AT91C_MC_LOCKS1 ((unsigned int) 0x1 << 17) // (MC) Sector 1 Lock Status +-#define AT91C_MC_LOCKS2 ((unsigned int) 0x1 << 18) // (MC) Sector 2 Lock Status +-#define AT91C_MC_LOCKS3 ((unsigned int) 0x1 << 19) // (MC) Sector 3 Lock Status +-#define AT91C_MC_LOCKS4 ((unsigned int) 0x1 << 20) // (MC) Sector 4 Lock Status +-#define AT91C_MC_LOCKS5 ((unsigned int) 0x1 << 21) // (MC) Sector 5 Lock Status +-#define AT91C_MC_LOCKS6 ((unsigned int) 0x1 << 22) // (MC) Sector 6 Lock Status +-#define AT91C_MC_LOCKS7 ((unsigned int) 0x1 << 23) // (MC) Sector 7 Lock Status +-#define AT91C_MC_LOCKS8 ((unsigned int) 0x1 << 24) // (MC) Sector 8 Lock Status +-#define AT91C_MC_LOCKS9 ((unsigned int) 0x1 << 25) // (MC) Sector 9 Lock Status +-#define AT91C_MC_LOCKS10 ((unsigned int) 0x1 << 26) // (MC) Sector 10 Lock Status +-#define AT91C_MC_LOCKS11 ((unsigned int) 0x1 << 27) // (MC) Sector 11 Lock Status +-#define AT91C_MC_LOCKS12 ((unsigned int) 0x1 << 28) // (MC) Sector 12 Lock Status +-#define AT91C_MC_LOCKS13 ((unsigned int) 0x1 << 29) // (MC) Sector 13 Lock Status +-#define AT91C_MC_LOCKS14 ((unsigned int) 0x1 << 30) // (MC) Sector 14 Lock Status +-#define AT91C_MC_LOCKS15 ((unsigned int) 0x1 << 31) // (MC) Sector 15 Lock Status +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Serial Parallel Interface +-// ***************************************************************************** +-typedef struct _AT91S_SPI { +- AT91_REG SPI_CR; // Control Register +- AT91_REG SPI_MR; // Mode Register +- AT91_REG SPI_RDR; // Receive Data Register +- AT91_REG SPI_TDR; // Transmit Data Register +- AT91_REG SPI_SR; // Status Register +- AT91_REG SPI_IER; // Interrupt Enable Register +- AT91_REG SPI_IDR; // Interrupt Disable Register +- AT91_REG SPI_IMR; // Interrupt Mask Register +- AT91_REG Reserved0[4]; // +- AT91_REG SPI_CSR[4]; // Chip Select Register +- AT91_REG Reserved1[48]; // +- AT91_REG SPI_RPR; // Receive Pointer Register +- AT91_REG SPI_RCR; // Receive Counter Register +- AT91_REG SPI_TPR; // Transmit Pointer Register +- AT91_REG SPI_TCR; // Transmit Counter Register +- AT91_REG SPI_RNPR; // Receive Next Pointer Register +- AT91_REG SPI_RNCR; // Receive Next Counter Register +- AT91_REG SPI_TNPR; // Transmit Next Pointer Register +- AT91_REG SPI_TNCR; // Transmit Next Counter Register +- AT91_REG SPI_PTCR; // PDC Transfer Control Register +- AT91_REG SPI_PTSR; // PDC Transfer Status Register +-} AT91S_SPI, *AT91PS_SPI; +- +-// -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- +-#define AT91C_SPI_SPIEN ((unsigned int) 0x1 << 0) // (SPI) SPI Enable +-#define AT91C_SPI_SPIDIS ((unsigned int) 0x1 << 1) // (SPI) SPI Disable +-#define AT91C_SPI_SWRST ((unsigned int) 0x1 << 7) // (SPI) SPI Software reset +-#define AT91C_SPI_LASTXFER ((unsigned int) 0x1 << 24) // (SPI) SPI Last Transfer +-// -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- +-#define AT91C_SPI_MSTR ((unsigned int) 0x1 << 0) // (SPI) Master/Slave Mode +-#define AT91C_SPI_PS ((unsigned int) 0x1 << 1) // (SPI) Peripheral Select +-#define AT91C_SPI_PS_FIXED ((unsigned int) 0x0 << 1) // (SPI) Fixed Peripheral Select +-#define AT91C_SPI_PS_VARIABLE ((unsigned int) 0x1 << 1) // (SPI) Variable Peripheral Select +-#define AT91C_SPI_PCSDEC ((unsigned int) 0x1 << 2) // (SPI) Chip Select Decode +-#define AT91C_SPI_FDIV ((unsigned int) 0x1 << 3) // (SPI) Clock Selection +-#define AT91C_SPI_MODFDIS ((unsigned int) 0x1 << 4) // (SPI) Mode Fault Detection +-#define AT91C_SPI_LLB ((unsigned int) 0x1 << 7) // (SPI) Clock Selection +-#define AT91C_SPI_PCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select +-#define AT91C_SPI_DLYBCS ((unsigned int) 0xFF << 24) // (SPI) Delay Between Chip Selects +-// -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- +-#define AT91C_SPI_RD ((unsigned int) 0xFFFF << 0) // (SPI) Receive Data +-#define AT91C_SPI_RPCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select Status +-// -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- +-#define AT91C_SPI_TD ((unsigned int) 0xFFFF << 0) // (SPI) Transmit Data +-#define AT91C_SPI_TPCS ((unsigned int) 0xF << 16) // (SPI) Peripheral Chip Select Status +-// -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- +-#define AT91C_SPI_RDRF ((unsigned int) 0x1 << 0) // (SPI) Receive Data Register Full +-#define AT91C_SPI_TDRE ((unsigned int) 0x1 << 1) // (SPI) Transmit Data Register Empty +-#define AT91C_SPI_MODF ((unsigned int) 0x1 << 2) // (SPI) Mode Fault Error +-#define AT91C_SPI_OVRES ((unsigned int) 0x1 << 3) // (SPI) Overrun Error Status +-#define AT91C_SPI_ENDRX ((unsigned int) 0x1 << 4) // (SPI) End of Receiver Transfer +-#define AT91C_SPI_ENDTX ((unsigned int) 0x1 << 5) // (SPI) End of Receiver Transfer +-#define AT91C_SPI_RXBUFF ((unsigned int) 0x1 << 6) // (SPI) RXBUFF Interrupt +-#define AT91C_SPI_TXBUFE ((unsigned int) 0x1 << 7) // (SPI) TXBUFE Interrupt +-#define AT91C_SPI_NSSR ((unsigned int) 0x1 << 8) // (SPI) NSSR Interrupt +-#define AT91C_SPI_TXEMPTY ((unsigned int) 0x1 << 9) // (SPI) TXEMPTY Interrupt +-#define AT91C_SPI_SPIENS ((unsigned int) 0x1 << 16) // (SPI) Enable Status +-// -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- +-// -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- +-// -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- +-// -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- +-#define AT91C_SPI_CPOL ((unsigned int) 0x1 << 0) // (SPI) Clock Polarity +-#define AT91C_SPI_NCPHA ((unsigned int) 0x1 << 1) // (SPI) Clock Phase +-#define AT91C_SPI_CSAAT ((unsigned int) 0x1 << 3) // (SPI) Chip Select Active After Transfer +-#define AT91C_SPI_BITS ((unsigned int) 0xF << 4) // (SPI) Bits Per Transfer +-#define AT91C_SPI_BITS_8 ((unsigned int) 0x0 << 4) // (SPI) 8 Bits Per transfer +-#define AT91C_SPI_BITS_9 ((unsigned int) 0x1 << 4) // (SPI) 9 Bits Per transfer +-#define AT91C_SPI_BITS_10 ((unsigned int) 0x2 << 4) // (SPI) 10 Bits Per transfer +-#define AT91C_SPI_BITS_11 ((unsigned int) 0x3 << 4) // (SPI) 11 Bits Per transfer +-#define AT91C_SPI_BITS_12 ((unsigned int) 0x4 << 4) // (SPI) 12 Bits Per transfer +-#define AT91C_SPI_BITS_13 ((unsigned int) 0x5 << 4) // (SPI) 13 Bits Per transfer +-#define AT91C_SPI_BITS_14 ((unsigned int) 0x6 << 4) // (SPI) 14 Bits Per transfer +-#define AT91C_SPI_BITS_15 ((unsigned int) 0x7 << 4) // (SPI) 15 Bits Per transfer +-#define AT91C_SPI_BITS_16 ((unsigned int) 0x8 << 4) // (SPI) 16 Bits Per transfer +-#define AT91C_SPI_SCBR ((unsigned int) 0xFF << 8) // (SPI) Serial Clock Baud Rate +-#define AT91C_SPI_DLYBS ((unsigned int) 0xFF << 16) // (SPI) Delay Before SPCK +-#define AT91C_SPI_DLYBCT ((unsigned int) 0xFF << 24) // (SPI) Delay Between Consecutive Transfers +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Usart +-// ***************************************************************************** +-typedef struct _AT91S_USART { +- AT91_REG US_CR; // Control Register +- AT91_REG US_MR; // Mode Register +- AT91_REG US_IER; // Interrupt Enable Register +- AT91_REG US_IDR; // Interrupt Disable Register +- AT91_REG US_IMR; // Interrupt Mask Register +- AT91_REG US_CSR; // Channel Status Register +- AT91_REG US_RHR; // Receiver Holding Register +- AT91_REG US_THR; // Transmitter Holding Register +- AT91_REG US_BRGR; // Baud Rate Generator Register +- AT91_REG US_RTOR; // Receiver Time-out Register +- AT91_REG US_TTGR; // Transmitter Time-guard Register +- AT91_REG Reserved0[5]; // +- AT91_REG US_FIDI; // FI_DI_Ratio Register +- AT91_REG US_NER; // Nb Errors Register +- AT91_REG Reserved1[1]; // +- AT91_REG US_IF; // IRDA_FILTER Register +- AT91_REG Reserved2[44]; // +- AT91_REG US_RPR; // Receive Pointer Register +- AT91_REG US_RCR; // Receive Counter Register +- AT91_REG US_TPR; // Transmit Pointer Register +- AT91_REG US_TCR; // Transmit Counter Register +- AT91_REG US_RNPR; // Receive Next Pointer Register +- AT91_REG US_RNCR; // Receive Next Counter Register +- AT91_REG US_TNPR; // Transmit Next Pointer Register +- AT91_REG US_TNCR; // Transmit Next Counter Register +- AT91_REG US_PTCR; // PDC Transfer Control Register +- AT91_REG US_PTSR; // PDC Transfer Status Register +-} AT91S_USART, *AT91PS_USART; +- +-// -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- +-#define AT91C_US_STTBRK ((unsigned int) 0x1 << 9) // (USART) Start Break +-#define AT91C_US_STPBRK ((unsigned int) 0x1 << 10) // (USART) Stop Break +-#define AT91C_US_STTTO ((unsigned int) 0x1 << 11) // (USART) Start Time-out +-#define AT91C_US_SENDA ((unsigned int) 0x1 << 12) // (USART) Send Address +-#define AT91C_US_RSTIT ((unsigned int) 0x1 << 13) // (USART) Reset Iterations +-#define AT91C_US_RSTNACK ((unsigned int) 0x1 << 14) // (USART) Reset Non Acknowledge +-#define AT91C_US_RETTO ((unsigned int) 0x1 << 15) // (USART) Rearm Time-out +-#define AT91C_US_DTREN ((unsigned int) 0x1 << 16) // (USART) Data Terminal ready Enable +-#define AT91C_US_DTRDIS ((unsigned int) 0x1 << 17) // (USART) Data Terminal ready Disable +-#define AT91C_US_RTSEN ((unsigned int) 0x1 << 18) // (USART) Request to Send enable +-#define AT91C_US_RTSDIS ((unsigned int) 0x1 << 19) // (USART) Request to Send Disable +-// -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- +-#define AT91C_US_USMODE ((unsigned int) 0xF << 0) // (USART) Usart mode +-#define AT91C_US_USMODE_NORMAL ((unsigned int) 0x0) // (USART) Normal +-#define AT91C_US_USMODE_RS485 ((unsigned int) 0x1) // (USART) RS485 +-#define AT91C_US_USMODE_HWHSH ((unsigned int) 0x2) // (USART) Hardware Handshaking +-#define AT91C_US_USMODE_MODEM ((unsigned int) 0x3) // (USART) Modem +-#define AT91C_US_USMODE_ISO7816_0 ((unsigned int) 0x4) // (USART) ISO7816 protocol: T = 0 +-#define AT91C_US_USMODE_ISO7816_1 ((unsigned int) 0x6) // (USART) ISO7816 protocol: T = 1 +-#define AT91C_US_USMODE_IRDA ((unsigned int) 0x8) // (USART) IrDA +-#define AT91C_US_USMODE_SWHSH ((unsigned int) 0xC) // (USART) Software Handshaking +-#define AT91C_US_CLKS ((unsigned int) 0x3 << 4) // (USART) Clock Selection (Baud Rate generator Input Clock +-#define AT91C_US_CLKS_CLOCK ((unsigned int) 0x0 << 4) // (USART) Clock +-#define AT91C_US_CLKS_FDIV1 ((unsigned int) 0x1 << 4) // (USART) fdiv1 +-#define AT91C_US_CLKS_SLOW ((unsigned int) 0x2 << 4) // (USART) slow_clock (ARM) +-#define AT91C_US_CLKS_EXT ((unsigned int) 0x3 << 4) // (USART) External (SCK) +-#define AT91C_US_CHRL ((unsigned int) 0x3 << 6) // (USART) Clock Selection (Baud Rate generator Input Clock +-#define AT91C_US_CHRL_5_BITS ((unsigned int) 0x0 << 6) // (USART) Character Length: 5 bits +-#define AT91C_US_CHRL_6_BITS ((unsigned int) 0x1 << 6) // (USART) Character Length: 6 bits +-#define AT91C_US_CHRL_7_BITS ((unsigned int) 0x2 << 6) // (USART) Character Length: 7 bits +-#define AT91C_US_CHRL_8_BITS ((unsigned int) 0x3 << 6) // (USART) Character Length: 8 bits +-#define AT91C_US_SYNC ((unsigned int) 0x1 << 8) // (USART) Synchronous Mode Select +-#define AT91C_US_NBSTOP ((unsigned int) 0x3 << 12) // (USART) Number of Stop bits +-#define AT91C_US_NBSTOP_1_BIT ((unsigned int) 0x0 << 12) // (USART) 1 stop bit +-#define AT91C_US_NBSTOP_15_BIT ((unsigned int) 0x1 << 12) // (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits +-#define AT91C_US_NBSTOP_2_BIT ((unsigned int) 0x2 << 12) // (USART) 2 stop bits +-#define AT91C_US_MSBF ((unsigned int) 0x1 << 16) // (USART) Bit Order +-#define AT91C_US_MODE9 ((unsigned int) 0x1 << 17) // (USART) 9-bit Character length +-#define AT91C_US_CKLO ((unsigned int) 0x1 << 18) // (USART) Clock Output Select +-#define AT91C_US_OVER ((unsigned int) 0x1 << 19) // (USART) Over Sampling Mode +-#define AT91C_US_INACK ((unsigned int) 0x1 << 20) // (USART) Inhibit Non Acknowledge +-#define AT91C_US_DSNACK ((unsigned int) 0x1 << 21) // (USART) Disable Successive NACK +-#define AT91C_US_MAX_ITER ((unsigned int) 0x1 << 24) // (USART) Number of Repetitions +-#define AT91C_US_FILTER ((unsigned int) 0x1 << 28) // (USART) Receive Line Filter +-// -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-#define AT91C_US_RXBRK ((unsigned int) 0x1 << 2) // (USART) Break Received/End of Break +-#define AT91C_US_TIMEOUT ((unsigned int) 0x1 << 8) // (USART) Receiver Time-out +-#define AT91C_US_ITERATION ((unsigned int) 0x1 << 10) // (USART) Max number of Repetitions Reached +-#define AT91C_US_NACK ((unsigned int) 0x1 << 13) // (USART) Non Acknowledge +-#define AT91C_US_RIIC ((unsigned int) 0x1 << 16) // (USART) Ring INdicator Input Change Flag +-#define AT91C_US_DSRIC ((unsigned int) 0x1 << 17) // (USART) Data Set Ready Input Change Flag +-#define AT91C_US_DCDIC ((unsigned int) 0x1 << 18) // (USART) Data Carrier Flag +-#define AT91C_US_CTSIC ((unsigned int) 0x1 << 19) // (USART) Clear To Send Input Change Flag +-// -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-// -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-// -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- +-#define AT91C_US_RI ((unsigned int) 0x1 << 20) // (USART) Image of RI Input +-#define AT91C_US_DSR ((unsigned int) 0x1 << 21) // (USART) Image of DSR Input +-#define AT91C_US_DCD ((unsigned int) 0x1 << 22) // (USART) Image of DCD Input +-#define AT91C_US_CTS ((unsigned int) 0x1 << 23) // (USART) Image of CTS Input +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_SSC { +- AT91_REG SSC_CR; // Control Register +- AT91_REG SSC_CMR; // Clock Mode Register +- AT91_REG Reserved0[2]; // +- AT91_REG SSC_RCMR; // Receive Clock ModeRegister +- AT91_REG SSC_RFMR; // Receive Frame Mode Register +- AT91_REG SSC_TCMR; // Transmit Clock Mode Register +- AT91_REG SSC_TFMR; // Transmit Frame Mode Register +- AT91_REG SSC_RHR; // Receive Holding Register +- AT91_REG SSC_THR; // Transmit Holding Register +- AT91_REG Reserved1[2]; // +- AT91_REG SSC_RSHR; // Receive Sync Holding Register +- AT91_REG SSC_TSHR; // Transmit Sync Holding Register +- AT91_REG Reserved2[2]; // +- AT91_REG SSC_SR; // Status Register +- AT91_REG SSC_IER; // Interrupt Enable Register +- AT91_REG SSC_IDR; // Interrupt Disable Register +- AT91_REG SSC_IMR; // Interrupt Mask Register +- AT91_REG Reserved3[44]; // +- AT91_REG SSC_RPR; // Receive Pointer Register +- AT91_REG SSC_RCR; // Receive Counter Register +- AT91_REG SSC_TPR; // Transmit Pointer Register +- AT91_REG SSC_TCR; // Transmit Counter Register +- AT91_REG SSC_RNPR; // Receive Next Pointer Register +- AT91_REG SSC_RNCR; // Receive Next Counter Register +- AT91_REG SSC_TNPR; // Transmit Next Pointer Register +- AT91_REG SSC_TNCR; // Transmit Next Counter Register +- AT91_REG SSC_PTCR; // PDC Transfer Control Register +- AT91_REG SSC_PTSR; // PDC Transfer Status Register +-} AT91S_SSC, *AT91PS_SSC; +- +-// -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- +-#define AT91C_SSC_RXEN ((unsigned int) 0x1 << 0) // (SSC) Receive Enable +-#define AT91C_SSC_RXDIS ((unsigned int) 0x1 << 1) // (SSC) Receive Disable +-#define AT91C_SSC_TXEN ((unsigned int) 0x1 << 8) // (SSC) Transmit Enable +-#define AT91C_SSC_TXDIS ((unsigned int) 0x1 << 9) // (SSC) Transmit Disable +-#define AT91C_SSC_SWRST ((unsigned int) 0x1 << 15) // (SSC) Software Reset +-// -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- +-#define AT91C_SSC_CKS ((unsigned int) 0x3 << 0) // (SSC) Receive/Transmit Clock Selection +-#define AT91C_SSC_CKS_DIV ((unsigned int) 0x0) // (SSC) Divided Clock +-#define AT91C_SSC_CKS_TK ((unsigned int) 0x1) // (SSC) TK Clock signal +-#define AT91C_SSC_CKS_RK ((unsigned int) 0x2) // (SSC) RK pin +-#define AT91C_SSC_CKO ((unsigned int) 0x7 << 2) // (SSC) Receive/Transmit Clock Output Mode Selection +-#define AT91C_SSC_CKO_NONE ((unsigned int) 0x0 << 2) // (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only +-#define AT91C_SSC_CKO_CONTINOUS ((unsigned int) 0x1 << 2) // (SSC) Continuous Receive/Transmit Clock RK pin: Output +-#define AT91C_SSC_CKO_DATA_TX ((unsigned int) 0x2 << 2) // (SSC) Receive/Transmit Clock only during data transfers RK pin: Output +-#define AT91C_SSC_CKI ((unsigned int) 0x1 << 5) // (SSC) Receive/Transmit Clock Inversion +-#define AT91C_SSC_CKG ((unsigned int) 0x3 << 6) // (SSC) Receive/Transmit Clock Gating Selection +-#define AT91C_SSC_CKG_NONE ((unsigned int) 0x0 << 6) // (SSC) Receive/Transmit Clock Gating: None, continuous clock +-#define AT91C_SSC_CKG_LOW ((unsigned int) 0x1 << 6) // (SSC) Receive/Transmit Clock enabled only if RF Low +-#define AT91C_SSC_CKG_HIGH ((unsigned int) 0x2 << 6) // (SSC) Receive/Transmit Clock enabled only if RF High +-#define AT91C_SSC_START ((unsigned int) 0xF << 8) // (SSC) Receive/Transmit Start Selection +-#define AT91C_SSC_START_CONTINOUS ((unsigned int) 0x0 << 8) // (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. +-#define AT91C_SSC_START_TX ((unsigned int) 0x1 << 8) // (SSC) Transmit/Receive start +-#define AT91C_SSC_START_LOW_RF ((unsigned int) 0x2 << 8) // (SSC) Detection of a low level on RF input +-#define AT91C_SSC_START_HIGH_RF ((unsigned int) 0x3 << 8) // (SSC) Detection of a high level on RF input +-#define AT91C_SSC_START_FALL_RF ((unsigned int) 0x4 << 8) // (SSC) Detection of a falling edge on RF input +-#define AT91C_SSC_START_RISE_RF ((unsigned int) 0x5 << 8) // (SSC) Detection of a rising edge on RF input +-#define AT91C_SSC_START_LEVEL_RF ((unsigned int) 0x6 << 8) // (SSC) Detection of any level change on RF input +-#define AT91C_SSC_START_EDGE_RF ((unsigned int) 0x7 << 8) // (SSC) Detection of any edge on RF input +-#define AT91C_SSC_START_0 ((unsigned int) 0x8 << 8) // (SSC) Compare 0 +-#define AT91C_SSC_STOP ((unsigned int) 0x1 << 12) // (SSC) Receive Stop Selection +-#define AT91C_SSC_STTDLY ((unsigned int) 0xFF << 16) // (SSC) Receive/Transmit Start Delay +-#define AT91C_SSC_PERIOD ((unsigned int) 0xFF << 24) // (SSC) Receive/Transmit Period Divider Selection +-// -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- +-#define AT91C_SSC_DATLEN ((unsigned int) 0x1F << 0) // (SSC) Data Length +-#define AT91C_SSC_LOOP ((unsigned int) 0x1 << 5) // (SSC) Loop Mode +-#define AT91C_SSC_MSBF ((unsigned int) 0x1 << 7) // (SSC) Most Significant Bit First +-#define AT91C_SSC_DATNB ((unsigned int) 0xF << 8) // (SSC) Data Number per Frame +-#define AT91C_SSC_FSLEN ((unsigned int) 0xF << 16) // (SSC) Receive/Transmit Frame Sync length +-#define AT91C_SSC_FSOS ((unsigned int) 0x7 << 20) // (SSC) Receive/Transmit Frame Sync Output Selection +-#define AT91C_SSC_FSOS_NONE ((unsigned int) 0x0 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only +-#define AT91C_SSC_FSOS_NEGATIVE ((unsigned int) 0x1 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse +-#define AT91C_SSC_FSOS_POSITIVE ((unsigned int) 0x2 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse +-#define AT91C_SSC_FSOS_LOW ((unsigned int) 0x3 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer +-#define AT91C_SSC_FSOS_HIGH ((unsigned int) 0x4 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer +-#define AT91C_SSC_FSOS_TOGGLE ((unsigned int) 0x5 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer +-#define AT91C_SSC_FSEDGE ((unsigned int) 0x1 << 24) // (SSC) Frame Sync Edge Detection +-// -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- +-// -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- +-#define AT91C_SSC_DATDEF ((unsigned int) 0x1 << 5) // (SSC) Data Default Value +-#define AT91C_SSC_FSDEN ((unsigned int) 0x1 << 23) // (SSC) Frame Sync Data Enable +-// -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- +-#define AT91C_SSC_TXRDY ((unsigned int) 0x1 << 0) // (SSC) Transmit Ready +-#define AT91C_SSC_TXEMPTY ((unsigned int) 0x1 << 1) // (SSC) Transmit Empty +-#define AT91C_SSC_ENDTX ((unsigned int) 0x1 << 2) // (SSC) End Of Transmission +-#define AT91C_SSC_TXBUFE ((unsigned int) 0x1 << 3) // (SSC) Transmit Buffer Empty +-#define AT91C_SSC_RXRDY ((unsigned int) 0x1 << 4) // (SSC) Receive Ready +-#define AT91C_SSC_OVRUN ((unsigned int) 0x1 << 5) // (SSC) Receive Overrun +-#define AT91C_SSC_ENDRX ((unsigned int) 0x1 << 6) // (SSC) End of Reception +-#define AT91C_SSC_RXBUFF ((unsigned int) 0x1 << 7) // (SSC) Receive Buffer Full +-#define AT91C_SSC_CP0 ((unsigned int) 0x1 << 8) // (SSC) Compare 0 +-#define AT91C_SSC_CP1 ((unsigned int) 0x1 << 9) // (SSC) Compare 1 +-#define AT91C_SSC_TXSYN ((unsigned int) 0x1 << 10) // (SSC) Transmit Sync +-#define AT91C_SSC_RXSYN ((unsigned int) 0x1 << 11) // (SSC) Receive Sync +-#define AT91C_SSC_TXENA ((unsigned int) 0x1 << 16) // (SSC) Transmit Enable +-#define AT91C_SSC_RXENA ((unsigned int) 0x1 << 17) // (SSC) Receive Enable +-// -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- +-// -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- +-// -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Two-wire Interface +-// ***************************************************************************** +-typedef struct _AT91S_TWI { +- AT91_REG TWI_CR; // Control Register +- AT91_REG TWI_MMR; // Master Mode Register +- AT91_REG Reserved0[1]; // +- AT91_REG TWI_IADR; // Internal Address Register +- AT91_REG TWI_CWGR; // Clock Waveform Generator Register +- AT91_REG Reserved1[3]; // +- AT91_REG TWI_SR; // Status Register +- AT91_REG TWI_IER; // Interrupt Enable Register +- AT91_REG TWI_IDR; // Interrupt Disable Register +- AT91_REG TWI_IMR; // Interrupt Mask Register +- AT91_REG TWI_RHR; // Receive Holding Register +- AT91_REG TWI_THR; // Transmit Holding Register +-} AT91S_TWI, *AT91PS_TWI; +- +-// -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- +-#define AT91C_TWI_START ((unsigned int) 0x1 << 0) // (TWI) Send a START Condition +-#define AT91C_TWI_STOP ((unsigned int) 0x1 << 1) // (TWI) Send a STOP Condition +-#define AT91C_TWI_MSEN ((unsigned int) 0x1 << 2) // (TWI) TWI Master Transfer Enabled +-#define AT91C_TWI_MSDIS ((unsigned int) 0x1 << 3) // (TWI) TWI Master Transfer Disabled +-#define AT91C_TWI_SWRST ((unsigned int) 0x1 << 7) // (TWI) Software Reset +-// -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- +-#define AT91C_TWI_IADRSZ ((unsigned int) 0x3 << 8) // (TWI) Internal Device Address Size +-#define AT91C_TWI_IADRSZ_NO ((unsigned int) 0x0 << 8) // (TWI) No internal device address +-#define AT91C_TWI_IADRSZ_1_BYTE ((unsigned int) 0x1 << 8) // (TWI) One-byte internal device address +-#define AT91C_TWI_IADRSZ_2_BYTE ((unsigned int) 0x2 << 8) // (TWI) Two-byte internal device address +-#define AT91C_TWI_IADRSZ_3_BYTE ((unsigned int) 0x3 << 8) // (TWI) Three-byte internal device address +-#define AT91C_TWI_MREAD ((unsigned int) 0x1 << 12) // (TWI) Master Read Direction +-#define AT91C_TWI_DADR ((unsigned int) 0x7F << 16) // (TWI) Device Address +-// -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- +-#define AT91C_TWI_CLDIV ((unsigned int) 0xFF << 0) // (TWI) Clock Low Divider +-#define AT91C_TWI_CHDIV ((unsigned int) 0xFF << 8) // (TWI) Clock High Divider +-#define AT91C_TWI_CKDIV ((unsigned int) 0x7 << 16) // (TWI) Clock Divider +-// -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- +-#define AT91C_TWI_TXCOMP ((unsigned int) 0x1 << 0) // (TWI) Transmission Completed +-#define AT91C_TWI_RXRDY ((unsigned int) 0x1 << 1) // (TWI) Receive holding register ReaDY +-#define AT91C_TWI_TXRDY ((unsigned int) 0x1 << 2) // (TWI) Transmit holding register ReaDY +-#define AT91C_TWI_OVRE ((unsigned int) 0x1 << 6) // (TWI) Overrun Error +-#define AT91C_TWI_UNRE ((unsigned int) 0x1 << 7) // (TWI) Underrun Error +-#define AT91C_TWI_NACK ((unsigned int) 0x1 << 8) // (TWI) Not Acknowledged +-// -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- +-// -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- +-// -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR PWMC Channel Interface +-// ***************************************************************************** +-typedef struct _AT91S_PWMC_CH { +- AT91_REG PWMC_CMR; // Channel Mode Register +- AT91_REG PWMC_CDTYR; // Channel Duty Cycle Register +- AT91_REG PWMC_CPRDR; // Channel Period Register +- AT91_REG PWMC_CCNTR; // Channel Counter Register +- AT91_REG PWMC_CUPDR; // Channel Update Register +- AT91_REG PWMC_Reserved[3]; // Reserved +-} AT91S_PWMC_CH, *AT91PS_PWMC_CH; +- +-// -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- +-#define AT91C_PWMC_CPRE ((unsigned int) 0xF << 0) // (PWMC_CH) Channel Pre-scaler : PWMC_CLKx +-#define AT91C_PWMC_CPRE_MCK ((unsigned int) 0x0) // (PWMC_CH) +-#define AT91C_PWMC_CPRE_MCKA ((unsigned int) 0xB) // (PWMC_CH) +-#define AT91C_PWMC_CPRE_MCKB ((unsigned int) 0xC) // (PWMC_CH) +-#define AT91C_PWMC_CALG ((unsigned int) 0x1 << 8) // (PWMC_CH) Channel Alignment +-#define AT91C_PWMC_CPOL ((unsigned int) 0x1 << 9) // (PWMC_CH) Channel Polarity +-#define AT91C_PWMC_CPD ((unsigned int) 0x1 << 10) // (PWMC_CH) Channel Update Period +-// -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- +-#define AT91C_PWMC_CDTY ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Duty Cycle +-// -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- +-#define AT91C_PWMC_CPRD ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Period +-// -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- +-#define AT91C_PWMC_CCNT ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Counter +-// -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- +-#define AT91C_PWMC_CUPD ((unsigned int) 0x0 << 0) // (PWMC_CH) Channel Update +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface +-// ***************************************************************************** +-typedef struct _AT91S_PWMC { +- AT91_REG PWMC_MR; // PWMC Mode Register +- AT91_REG PWMC_ENA; // PWMC Enable Register +- AT91_REG PWMC_DIS; // PWMC Disable Register +- AT91_REG PWMC_SR; // PWMC Status Register +- AT91_REG PWMC_IER; // PWMC Interrupt Enable Register +- AT91_REG PWMC_IDR; // PWMC Interrupt Disable Register +- AT91_REG PWMC_IMR; // PWMC Interrupt Mask Register +- AT91_REG PWMC_ISR; // PWMC Interrupt Status Register +- AT91_REG Reserved0[55]; // +- AT91_REG PWMC_VR; // PWMC Version Register +- AT91_REG Reserved1[64]; // +- AT91S_PWMC_CH PWMC_CH[4]; // PWMC Channel +-} AT91S_PWMC, *AT91PS_PWMC; +- +-// -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- +-#define AT91C_PWMC_DIVA ((unsigned int) 0xFF << 0) // (PWMC) CLKA divide factor. +-#define AT91C_PWMC_PREA ((unsigned int) 0xF << 8) // (PWMC) Divider Input Clock Prescaler A +-#define AT91C_PWMC_PREA_MCK ((unsigned int) 0x0 << 8) // (PWMC) +-#define AT91C_PWMC_DIVB ((unsigned int) 0xFF << 16) // (PWMC) CLKB divide factor. +-#define AT91C_PWMC_PREB ((unsigned int) 0xF << 24) // (PWMC) Divider Input Clock Prescaler B +-#define AT91C_PWMC_PREB_MCK ((unsigned int) 0x0 << 24) // (PWMC) +-// -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- +-#define AT91C_PWMC_CHID0 ((unsigned int) 0x1 << 0) // (PWMC) Channel ID 0 +-#define AT91C_PWMC_CHID1 ((unsigned int) 0x1 << 1) // (PWMC) Channel ID 1 +-#define AT91C_PWMC_CHID2 ((unsigned int) 0x1 << 2) // (PWMC) Channel ID 2 +-#define AT91C_PWMC_CHID3 ((unsigned int) 0x1 << 3) // (PWMC) Channel ID 3 +-// -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- +-// -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- +-// -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- +-// -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- +-// -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- +-// -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR USB Device Interface +-// ***************************************************************************** +-typedef struct _AT91S_UDP { +- AT91_REG UDP_NUM; // Frame Number Register +- AT91_REG UDP_GLBSTATE; // Global State Register +- AT91_REG UDP_FADDR; // Function Address Register +- AT91_REG Reserved0[1]; // +- AT91_REG UDP_IER; // Interrupt Enable Register +- AT91_REG UDP_IDR; // Interrupt Disable Register +- AT91_REG UDP_IMR; // Interrupt Mask Register +- AT91_REG UDP_ISR; // Interrupt Status Register +- AT91_REG UDP_ICR; // Interrupt Clear Register +- AT91_REG Reserved1[1]; // +- AT91_REG UDP_RSTEP; // Reset Endpoint Register +- AT91_REG Reserved2[1]; // +- AT91_REG UDP_CSR[6]; // Endpoint Control and Status Register +- AT91_REG Reserved3[2]; // +- AT91_REG UDP_FDR[6]; // Endpoint FIFO Data Register +- AT91_REG Reserved4[3]; // +- AT91_REG UDP_TXVC; // Transceiver Control Register +-} AT91S_UDP, *AT91PS_UDP; +- +-// -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- +-#define AT91C_UDP_FRM_NUM ((unsigned int) 0x7FF << 0) // (UDP) Frame Number as Defined in the Packet Field Formats +-#define AT91C_UDP_FRM_ERR ((unsigned int) 0x1 << 16) // (UDP) Frame Error +-#define AT91C_UDP_FRM_OK ((unsigned int) 0x1 << 17) // (UDP) Frame OK +-// -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- +-#define AT91C_UDP_FADDEN ((unsigned int) 0x1 << 0) // (UDP) Function Address Enable +-#define AT91C_UDP_CONFG ((unsigned int) 0x1 << 1) // (UDP) Configured +-#define AT91C_UDP_ESR ((unsigned int) 0x1 << 2) // (UDP) Enable Send Resume +-#define AT91C_UDP_RSMINPR ((unsigned int) 0x1 << 3) // (UDP) A Resume Has Been Sent to the Host +-#define AT91C_UDP_RMWUPE ((unsigned int) 0x1 << 4) // (UDP) Remote Wake Up Enable +-// -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- +-#define AT91C_UDP_FADD ((unsigned int) 0xFF << 0) // (UDP) Function Address Value +-#define AT91C_UDP_FEN ((unsigned int) 0x1 << 8) // (UDP) Function Enable +-// -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- +-#define AT91C_UDP_EPINT0 ((unsigned int) 0x1 << 0) // (UDP) Endpoint 0 Interrupt +-#define AT91C_UDP_EPINT1 ((unsigned int) 0x1 << 1) // (UDP) Endpoint 0 Interrupt +-#define AT91C_UDP_EPINT2 ((unsigned int) 0x1 << 2) // (UDP) Endpoint 2 Interrupt +-#define AT91C_UDP_EPINT3 ((unsigned int) 0x1 << 3) // (UDP) Endpoint 3 Interrupt +-#define AT91C_UDP_EPINT4 ((unsigned int) 0x1 << 4) // (UDP) Endpoint 4 Interrupt +-#define AT91C_UDP_EPINT5 ((unsigned int) 0x1 << 5) // (UDP) Endpoint 5 Interrupt +-#define AT91C_UDP_RXSUSP ((unsigned int) 0x1 << 8) // (UDP) USB Suspend Interrupt +-#define AT91C_UDP_RXRSM ((unsigned int) 0x1 << 9) // (UDP) USB Resume Interrupt +-#define AT91C_UDP_EXTRSM ((unsigned int) 0x1 << 10) // (UDP) USB External Resume Interrupt +-#define AT91C_UDP_SOFINT ((unsigned int) 0x1 << 11) // (UDP) USB Start Of frame Interrupt +-#define AT91C_UDP_WAKEUP ((unsigned int) 0x1 << 13) // (UDP) USB Resume Interrupt +-// -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- +-// -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- +-// -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- +-#define AT91C_UDP_ENDBUSRES ((unsigned int) 0x1 << 12) // (UDP) USB End Of Bus Reset Interrupt +-// -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- +-// -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- +-#define AT91C_UDP_EP0 ((unsigned int) 0x1 << 0) // (UDP) Reset Endpoint 0 +-#define AT91C_UDP_EP1 ((unsigned int) 0x1 << 1) // (UDP) Reset Endpoint 1 +-#define AT91C_UDP_EP2 ((unsigned int) 0x1 << 2) // (UDP) Reset Endpoint 2 +-#define AT91C_UDP_EP3 ((unsigned int) 0x1 << 3) // (UDP) Reset Endpoint 3 +-#define AT91C_UDP_EP4 ((unsigned int) 0x1 << 4) // (UDP) Reset Endpoint 4 +-#define AT91C_UDP_EP5 ((unsigned int) 0x1 << 5) // (UDP) Reset Endpoint 5 +-// -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- +-#define AT91C_UDP_TXCOMP ((unsigned int) 0x1 << 0) // (UDP) Generates an IN packet with data previously written in the DPR +-#define AT91C_UDP_RX_DATA_BK0 ((unsigned int) 0x1 << 1) // (UDP) Receive Data Bank 0 +-#define AT91C_UDP_RXSETUP ((unsigned int) 0x1 << 2) // (UDP) Sends STALL to the Host (Control endpoints) +-#define AT91C_UDP_ISOERROR ((unsigned int) 0x1 << 3) // (UDP) Isochronous error (Isochronous endpoints) +-#define AT91C_UDP_TXPKTRDY ((unsigned int) 0x1 << 4) // (UDP) Transmit Packet Ready +-#define AT91C_UDP_FORCESTALL ((unsigned int) 0x1 << 5) // (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). +-#define AT91C_UDP_RX_DATA_BK1 ((unsigned int) 0x1 << 6) // (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). +-#define AT91C_UDP_DIR ((unsigned int) 0x1 << 7) // (UDP) Transfer Direction +-#define AT91C_UDP_EPTYPE ((unsigned int) 0x7 << 8) // (UDP) Endpoint type +-#define AT91C_UDP_EPTYPE_CTRL ((unsigned int) 0x0 << 8) // (UDP) Control +-#define AT91C_UDP_EPTYPE_ISO_OUT ((unsigned int) 0x1 << 8) // (UDP) Isochronous OUT +-#define AT91C_UDP_EPTYPE_BULK_OUT ((unsigned int) 0x2 << 8) // (UDP) Bulk OUT +-#define AT91C_UDP_EPTYPE_INT_OUT ((unsigned int) 0x3 << 8) // (UDP) Interrupt OUT +-#define AT91C_UDP_EPTYPE_ISO_IN ((unsigned int) 0x5 << 8) // (UDP) Isochronous IN +-#define AT91C_UDP_EPTYPE_BULK_IN ((unsigned int) 0x6 << 8) // (UDP) Bulk IN +-#define AT91C_UDP_EPTYPE_INT_IN ((unsigned int) 0x7 << 8) // (UDP) Interrupt IN +-#define AT91C_UDP_DTGLE ((unsigned int) 0x1 << 11) // (UDP) Data Toggle +-#define AT91C_UDP_EPEDS ((unsigned int) 0x1 << 15) // (UDP) Endpoint Enable Disable +-#define AT91C_UDP_RXBYTECNT ((unsigned int) 0x7FF << 16) // (UDP) Number Of Bytes Available in the FIFO +-// -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- +-#define AT91C_UDP_TXVDIS ((unsigned int) 0x1 << 8) // (UDP) +-#define AT91C_UDP_PUON ((unsigned int) 0x1 << 9) // (UDP) Pull-up ON +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Timer Counter Channel Interface +-// ***************************************************************************** +-typedef struct _AT91S_TC { +- AT91_REG TC_CCR; // Channel Control Register +- AT91_REG TC_CMR; // Channel Mode Register (Capture Mode / Waveform Mode) +- AT91_REG Reserved0[2]; // +- AT91_REG TC_CV; // Counter Value +- AT91_REG TC_RA; // Register A +- AT91_REG TC_RB; // Register B +- AT91_REG TC_RC; // Register C +- AT91_REG TC_SR; // Status Register +- AT91_REG TC_IER; // Interrupt Enable Register +- AT91_REG TC_IDR; // Interrupt Disable Register +- AT91_REG TC_IMR; // Interrupt Mask Register +-} AT91S_TC, *AT91PS_TC; +- +-// -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- +-#define AT91C_TC_CLKEN ((unsigned int) 0x1 << 0) // (TC) Counter Clock Enable Command +-#define AT91C_TC_CLKDIS ((unsigned int) 0x1 << 1) // (TC) Counter Clock Disable Command +-#define AT91C_TC_SWTRG ((unsigned int) 0x1 << 2) // (TC) Software Trigger Command +-// -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- +-#define AT91C_TC_CLKS ((unsigned int) 0x7 << 0) // (TC) Clock Selection +-#define AT91C_TC_CLKS_TIMER_DIV1_CLOCK ((unsigned int) 0x0) // (TC) Clock selected: TIMER_DIV1_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV2_CLOCK ((unsigned int) 0x1) // (TC) Clock selected: TIMER_DIV2_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV3_CLOCK ((unsigned int) 0x2) // (TC) Clock selected: TIMER_DIV3_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV4_CLOCK ((unsigned int) 0x3) // (TC) Clock selected: TIMER_DIV4_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV5_CLOCK ((unsigned int) 0x4) // (TC) Clock selected: TIMER_DIV5_CLOCK +-#define AT91C_TC_CLKS_XC0 ((unsigned int) 0x5) // (TC) Clock selected: XC0 +-#define AT91C_TC_CLKS_XC1 ((unsigned int) 0x6) // (TC) Clock selected: XC1 +-#define AT91C_TC_CLKS_XC2 ((unsigned int) 0x7) // (TC) Clock selected: XC2 +-#define AT91C_TC_CLKI ((unsigned int) 0x1 << 3) // (TC) Clock Invert +-#define AT91C_TC_BURST ((unsigned int) 0x3 << 4) // (TC) Burst Signal Selection +-#define AT91C_TC_BURST_NONE ((unsigned int) 0x0 << 4) // (TC) The clock is not gated by an external signal +-#define AT91C_TC_BURST_XC0 ((unsigned int) 0x1 << 4) // (TC) XC0 is ANDed with the selected clock +-#define AT91C_TC_BURST_XC1 ((unsigned int) 0x2 << 4) // (TC) XC1 is ANDed with the selected clock +-#define AT91C_TC_BURST_XC2 ((unsigned int) 0x3 << 4) // (TC) XC2 is ANDed with the selected clock +-#define AT91C_TC_CPCSTOP ((unsigned int) 0x1 << 6) // (TC) Counter Clock Stopped with RC Compare +-#define AT91C_TC_LDBSTOP ((unsigned int) 0x1 << 6) // (TC) Counter Clock Stopped with RB Loading +-#define AT91C_TC_CPCDIS ((unsigned int) 0x1 << 7) // (TC) Counter Clock Disable with RC Compare +-#define AT91C_TC_LDBDIS ((unsigned int) 0x1 << 7) // (TC) Counter Clock Disabled with RB Loading +-#define AT91C_TC_ETRGEDG ((unsigned int) 0x3 << 8) // (TC) External Trigger Edge Selection +-#define AT91C_TC_ETRGEDG_NONE ((unsigned int) 0x0 << 8) // (TC) Edge: None +-#define AT91C_TC_ETRGEDG_RISING ((unsigned int) 0x1 << 8) // (TC) Edge: rising edge +-#define AT91C_TC_ETRGEDG_FALLING ((unsigned int) 0x2 << 8) // (TC) Edge: falling edge +-#define AT91C_TC_ETRGEDG_BOTH ((unsigned int) 0x3 << 8) // (TC) Edge: each edge +-#define AT91C_TC_EEVTEDG ((unsigned int) 0x3 << 8) // (TC) External Event Edge Selection +-#define AT91C_TC_EEVTEDG_NONE ((unsigned int) 0x0 << 8) // (TC) Edge: None +-#define AT91C_TC_EEVTEDG_RISING ((unsigned int) 0x1 << 8) // (TC) Edge: rising edge +-#define AT91C_TC_EEVTEDG_FALLING ((unsigned int) 0x2 << 8) // (TC) Edge: falling edge +-#define AT91C_TC_EEVTEDG_BOTH ((unsigned int) 0x3 << 8) // (TC) Edge: each edge +-#define AT91C_TC_EEVT ((unsigned int) 0x3 << 10) // (TC) External Event Selection +-#define AT91C_TC_EEVT_TIOB ((unsigned int) 0x0 << 10) // (TC) Signal selected as external event: TIOB TIOB direction: input +-#define AT91C_TC_EEVT_XC0 ((unsigned int) 0x1 << 10) // (TC) Signal selected as external event: XC0 TIOB direction: output +-#define AT91C_TC_EEVT_XC1 ((unsigned int) 0x2 << 10) // (TC) Signal selected as external event: XC1 TIOB direction: output +-#define AT91C_TC_EEVT_XC2 ((unsigned int) 0x3 << 10) // (TC) Signal selected as external event: XC2 TIOB direction: output +-#define AT91C_TC_ABETRG ((unsigned int) 0x1 << 10) // (TC) TIOA or TIOB External Trigger Selection +-#define AT91C_TC_ENETRG ((unsigned int) 0x1 << 12) // (TC) External Event Trigger enable +-#define AT91C_TC_WAVESEL ((unsigned int) 0x3 << 13) // (TC) Waveform Selection +-#define AT91C_TC_WAVESEL_UP ((unsigned int) 0x0 << 13) // (TC) UP mode without atomatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UPDOWN ((unsigned int) 0x1 << 13) // (TC) UPDOWN mode without automatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UP_AUTO ((unsigned int) 0x2 << 13) // (TC) UP mode with automatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UPDOWN_AUTO ((unsigned int) 0x3 << 13) // (TC) UPDOWN mode with automatic trigger on RC Compare +-#define AT91C_TC_CPCTRG ((unsigned int) 0x1 << 14) // (TC) RC Compare Trigger Enable +-#define AT91C_TC_WAVE ((unsigned int) 0x1 << 15) // (TC) +-#define AT91C_TC_ACPA ((unsigned int) 0x3 << 16) // (TC) RA Compare Effect on TIOA +-#define AT91C_TC_ACPA_NONE ((unsigned int) 0x0 << 16) // (TC) Effect: none +-#define AT91C_TC_ACPA_SET ((unsigned int) 0x1 << 16) // (TC) Effect: set +-#define AT91C_TC_ACPA_CLEAR ((unsigned int) 0x2 << 16) // (TC) Effect: clear +-#define AT91C_TC_ACPA_TOGGLE ((unsigned int) 0x3 << 16) // (TC) Effect: toggle +-#define AT91C_TC_LDRA ((unsigned int) 0x3 << 16) // (TC) RA Loading Selection +-#define AT91C_TC_LDRA_NONE ((unsigned int) 0x0 << 16) // (TC) Edge: None +-#define AT91C_TC_LDRA_RISING ((unsigned int) 0x1 << 16) // (TC) Edge: rising edge of TIOA +-#define AT91C_TC_LDRA_FALLING ((unsigned int) 0x2 << 16) // (TC) Edge: falling edge of TIOA +-#define AT91C_TC_LDRA_BOTH ((unsigned int) 0x3 << 16) // (TC) Edge: each edge of TIOA +-#define AT91C_TC_ACPC ((unsigned int) 0x3 << 18) // (TC) RC Compare Effect on TIOA +-#define AT91C_TC_ACPC_NONE ((unsigned int) 0x0 << 18) // (TC) Effect: none +-#define AT91C_TC_ACPC_SET ((unsigned int) 0x1 << 18) // (TC) Effect: set +-#define AT91C_TC_ACPC_CLEAR ((unsigned int) 0x2 << 18) // (TC) Effect: clear +-#define AT91C_TC_ACPC_TOGGLE ((unsigned int) 0x3 << 18) // (TC) Effect: toggle +-#define AT91C_TC_LDRB ((unsigned int) 0x3 << 18) // (TC) RB Loading Selection +-#define AT91C_TC_LDRB_NONE ((unsigned int) 0x0 << 18) // (TC) Edge: None +-#define AT91C_TC_LDRB_RISING ((unsigned int) 0x1 << 18) // (TC) Edge: rising edge of TIOA +-#define AT91C_TC_LDRB_FALLING ((unsigned int) 0x2 << 18) // (TC) Edge: falling edge of TIOA +-#define AT91C_TC_LDRB_BOTH ((unsigned int) 0x3 << 18) // (TC) Edge: each edge of TIOA +-#define AT91C_TC_AEEVT ((unsigned int) 0x3 << 20) // (TC) External Event Effect on TIOA +-#define AT91C_TC_AEEVT_NONE ((unsigned int) 0x0 << 20) // (TC) Effect: none +-#define AT91C_TC_AEEVT_SET ((unsigned int) 0x1 << 20) // (TC) Effect: set +-#define AT91C_TC_AEEVT_CLEAR ((unsigned int) 0x2 << 20) // (TC) Effect: clear +-#define AT91C_TC_AEEVT_TOGGLE ((unsigned int) 0x3 << 20) // (TC) Effect: toggle +-#define AT91C_TC_ASWTRG ((unsigned int) 0x3 << 22) // (TC) Software Trigger Effect on TIOA +-#define AT91C_TC_ASWTRG_NONE ((unsigned int) 0x0 << 22) // (TC) Effect: none +-#define AT91C_TC_ASWTRG_SET ((unsigned int) 0x1 << 22) // (TC) Effect: set +-#define AT91C_TC_ASWTRG_CLEAR ((unsigned int) 0x2 << 22) // (TC) Effect: clear +-#define AT91C_TC_ASWTRG_TOGGLE ((unsigned int) 0x3 << 22) // (TC) Effect: toggle +-#define AT91C_TC_BCPB ((unsigned int) 0x3 << 24) // (TC) RB Compare Effect on TIOB +-#define AT91C_TC_BCPB_NONE ((unsigned int) 0x0 << 24) // (TC) Effect: none +-#define AT91C_TC_BCPB_SET ((unsigned int) 0x1 << 24) // (TC) Effect: set +-#define AT91C_TC_BCPB_CLEAR ((unsigned int) 0x2 << 24) // (TC) Effect: clear +-#define AT91C_TC_BCPB_TOGGLE ((unsigned int) 0x3 << 24) // (TC) Effect: toggle +-#define AT91C_TC_BCPC ((unsigned int) 0x3 << 26) // (TC) RC Compare Effect on TIOB +-#define AT91C_TC_BCPC_NONE ((unsigned int) 0x0 << 26) // (TC) Effect: none +-#define AT91C_TC_BCPC_SET ((unsigned int) 0x1 << 26) // (TC) Effect: set +-#define AT91C_TC_BCPC_CLEAR ((unsigned int) 0x2 << 26) // (TC) Effect: clear +-#define AT91C_TC_BCPC_TOGGLE ((unsigned int) 0x3 << 26) // (TC) Effect: toggle +-#define AT91C_TC_BEEVT ((unsigned int) 0x3 << 28) // (TC) External Event Effect on TIOB +-#define AT91C_TC_BEEVT_NONE ((unsigned int) 0x0 << 28) // (TC) Effect: none +-#define AT91C_TC_BEEVT_SET ((unsigned int) 0x1 << 28) // (TC) Effect: set +-#define AT91C_TC_BEEVT_CLEAR ((unsigned int) 0x2 << 28) // (TC) Effect: clear +-#define AT91C_TC_BEEVT_TOGGLE ((unsigned int) 0x3 << 28) // (TC) Effect: toggle +-#define AT91C_TC_BSWTRG ((unsigned int) 0x3 << 30) // (TC) Software Trigger Effect on TIOB +-#define AT91C_TC_BSWTRG_NONE ((unsigned int) 0x0 << 30) // (TC) Effect: none +-#define AT91C_TC_BSWTRG_SET ((unsigned int) 0x1 << 30) // (TC) Effect: set +-#define AT91C_TC_BSWTRG_CLEAR ((unsigned int) 0x2 << 30) // (TC) Effect: clear +-#define AT91C_TC_BSWTRG_TOGGLE ((unsigned int) 0x3 << 30) // (TC) Effect: toggle +-// -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- +-#define AT91C_TC_COVFS ((unsigned int) 0x1 << 0) // (TC) Counter Overflow +-#define AT91C_TC_LOVRS ((unsigned int) 0x1 << 1) // (TC) Load Overrun +-#define AT91C_TC_CPAS ((unsigned int) 0x1 << 2) // (TC) RA Compare +-#define AT91C_TC_CPBS ((unsigned int) 0x1 << 3) // (TC) RB Compare +-#define AT91C_TC_CPCS ((unsigned int) 0x1 << 4) // (TC) RC Compare +-#define AT91C_TC_LDRAS ((unsigned int) 0x1 << 5) // (TC) RA Loading +-#define AT91C_TC_LDRBS ((unsigned int) 0x1 << 6) // (TC) RB Loading +-#define AT91C_TC_ETRGS ((unsigned int) 0x1 << 7) // (TC) External Trigger +-#define AT91C_TC_CLKSTA ((unsigned int) 0x1 << 16) // (TC) Clock Enabling +-#define AT91C_TC_MTIOA ((unsigned int) 0x1 << 17) // (TC) TIOA Mirror +-#define AT91C_TC_MTIOB ((unsigned int) 0x1 << 18) // (TC) TIOA Mirror +-// -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- +-// -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- +-// -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Timer Counter Interface +-// ***************************************************************************** +-typedef struct _AT91S_TCB { +- AT91S_TC TCB_TC0; // TC Channel 0 +- AT91_REG Reserved0[4]; // +- AT91S_TC TCB_TC1; // TC Channel 1 +- AT91_REG Reserved1[4]; // +- AT91S_TC TCB_TC2; // TC Channel 2 +- AT91_REG Reserved2[4]; // +- AT91_REG TCB_BCR; // TC Block Control Register +- AT91_REG TCB_BMR; // TC Block Mode Register +-} AT91S_TCB, *AT91PS_TCB; +- +-// -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- +-#define AT91C_TCB_SYNC ((unsigned int) 0x1 << 0) // (TCB) Synchro Command +-// -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- +-#define AT91C_TCB_TC0XC0S ((unsigned int) 0x3 << 0) // (TCB) External Clock Signal 0 Selection +-#define AT91C_TCB_TC0XC0S_TCLK0 ((unsigned int) 0x0) // (TCB) TCLK0 connected to XC0 +-#define AT91C_TCB_TC0XC0S_NONE ((unsigned int) 0x1) // (TCB) None signal connected to XC0 +-#define AT91C_TCB_TC0XC0S_TIOA1 ((unsigned int) 0x2) // (TCB) TIOA1 connected to XC0 +-#define AT91C_TCB_TC0XC0S_TIOA2 ((unsigned int) 0x3) // (TCB) TIOA2 connected to XC0 +-#define AT91C_TCB_TC1XC1S ((unsigned int) 0x3 << 2) // (TCB) External Clock Signal 1 Selection +-#define AT91C_TCB_TC1XC1S_TCLK1 ((unsigned int) 0x0 << 2) // (TCB) TCLK1 connected to XC1 +-#define AT91C_TCB_TC1XC1S_NONE ((unsigned int) 0x1 << 2) // (TCB) None signal connected to XC1 +-#define AT91C_TCB_TC1XC1S_TIOA0 ((unsigned int) 0x2 << 2) // (TCB) TIOA0 connected to XC1 +-#define AT91C_TCB_TC1XC1S_TIOA2 ((unsigned int) 0x3 << 2) // (TCB) TIOA2 connected to XC1 +-#define AT91C_TCB_TC2XC2S ((unsigned int) 0x3 << 4) // (TCB) External Clock Signal 2 Selection +-#define AT91C_TCB_TC2XC2S_TCLK2 ((unsigned int) 0x0 << 4) // (TCB) TCLK2 connected to XC2 +-#define AT91C_TCB_TC2XC2S_NONE ((unsigned int) 0x1 << 4) // (TCB) None signal connected to XC2 +-#define AT91C_TCB_TC2XC2S_TIOA0 ((unsigned int) 0x2 << 4) // (TCB) TIOA0 connected to XC2 +-#define AT91C_TCB_TC2XC2S_TIOA1 ((unsigned int) 0x3 << 4) // (TCB) TIOA2 connected to XC2 +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface +-// ***************************************************************************** +-typedef struct _AT91S_CAN_MB { +- AT91_REG CAN_MB_MMR; // MailBox Mode Register +- AT91_REG CAN_MB_MAM; // MailBox Acceptance Mask Register +- AT91_REG CAN_MB_MID; // MailBox ID Register +- AT91_REG CAN_MB_MFID; // MailBox Family ID Register +- AT91_REG CAN_MB_MSR; // MailBox Status Register +- AT91_REG CAN_MB_MDL; // MailBox Data Low Register +- AT91_REG CAN_MB_MDH; // MailBox Data High Register +- AT91_REG CAN_MB_MCR; // MailBox Control Register +-} AT91S_CAN_MB, *AT91PS_CAN_MB; +- +-// -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- +-#define AT91C_CAN_MTIMEMARK ((unsigned int) 0xFFFF << 0) // (CAN_MB) Mailbox Timemark +-#define AT91C_CAN_PRIOR ((unsigned int) 0xF << 16) // (CAN_MB) Mailbox Priority +-#define AT91C_CAN_MOT ((unsigned int) 0x7 << 24) // (CAN_MB) Mailbox Object Type +-#define AT91C_CAN_MOT_DIS ((unsigned int) 0x0 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_RX ((unsigned int) 0x1 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_RXOVERWRITE ((unsigned int) 0x2 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_TX ((unsigned int) 0x3 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_CONSUMER ((unsigned int) 0x4 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_PRODUCER ((unsigned int) 0x5 << 24) // (CAN_MB) +-// -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- +-#define AT91C_CAN_MIDvB ((unsigned int) 0x3FFFF << 0) // (CAN_MB) Complementary bits for identifier in extended mode +-#define AT91C_CAN_MIDvA ((unsigned int) 0x7FF << 18) // (CAN_MB) Identifier for standard frame mode +-#define AT91C_CAN_MIDE ((unsigned int) 0x1 << 29) // (CAN_MB) Identifier Version +-// -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- +-// -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- +-// -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- +-#define AT91C_CAN_MTIMESTAMP ((unsigned int) 0xFFFF << 0) // (CAN_MB) Timer Value +-#define AT91C_CAN_MDLC ((unsigned int) 0xF << 16) // (CAN_MB) Mailbox Data Length Code +-#define AT91C_CAN_MRTR ((unsigned int) 0x1 << 20) // (CAN_MB) Mailbox Remote Transmission Request +-#define AT91C_CAN_MABT ((unsigned int) 0x1 << 22) // (CAN_MB) Mailbox Message Abort +-#define AT91C_CAN_MRDY ((unsigned int) 0x1 << 23) // (CAN_MB) Mailbox Ready +-#define AT91C_CAN_MMI ((unsigned int) 0x1 << 24) // (CAN_MB) Mailbox Message Ignored +-// -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- +-// -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- +-// -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- +-#define AT91C_CAN_MACR ((unsigned int) 0x1 << 22) // (CAN_MB) Abort Request for Mailbox +-#define AT91C_CAN_MTCR ((unsigned int) 0x1 << 23) // (CAN_MB) Mailbox Transfer Command +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Control Area Network Interface +-// ***************************************************************************** +-typedef struct _AT91S_CAN { +- AT91_REG CAN_MR; // Mode Register +- AT91_REG CAN_IER; // Interrupt Enable Register +- AT91_REG CAN_IDR; // Interrupt Disable Register +- AT91_REG CAN_IMR; // Interrupt Mask Register +- AT91_REG CAN_SR; // Status Register +- AT91_REG CAN_BR; // Baudrate Register +- AT91_REG CAN_TIM; // Timer Register +- AT91_REG CAN_TIMESTP; // Time Stamp Register +- AT91_REG CAN_ECR; // Error Counter Register +- AT91_REG CAN_TCR; // Transfer Command Register +- AT91_REG CAN_ACR; // Abort Command Register +- AT91_REG Reserved0[52]; // +- AT91_REG CAN_VR; // Version Register +- AT91_REG Reserved1[64]; // +- AT91S_CAN_MB CAN_MB0; // CAN Mailbox 0 +- AT91S_CAN_MB CAN_MB1; // CAN Mailbox 1 +- AT91S_CAN_MB CAN_MB2; // CAN Mailbox 2 +- AT91S_CAN_MB CAN_MB3; // CAN Mailbox 3 +- AT91S_CAN_MB CAN_MB4; // CAN Mailbox 4 +- AT91S_CAN_MB CAN_MB5; // CAN Mailbox 5 +- AT91S_CAN_MB CAN_MB6; // CAN Mailbox 6 +- AT91S_CAN_MB CAN_MB7; // CAN Mailbox 7 +- AT91S_CAN_MB CAN_MB8; // CAN Mailbox 8 +- AT91S_CAN_MB CAN_MB9; // CAN Mailbox 9 +- AT91S_CAN_MB CAN_MB10; // CAN Mailbox 10 +- AT91S_CAN_MB CAN_MB11; // CAN Mailbox 11 +- AT91S_CAN_MB CAN_MB12; // CAN Mailbox 12 +- AT91S_CAN_MB CAN_MB13; // CAN Mailbox 13 +- AT91S_CAN_MB CAN_MB14; // CAN Mailbox 14 +- AT91S_CAN_MB CAN_MB15; // CAN Mailbox 15 +-} AT91S_CAN, *AT91PS_CAN; +- +-// -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- +-#define AT91C_CAN_CANEN ((unsigned int) 0x1 << 0) // (CAN) CAN Controller Enable +-#define AT91C_CAN_LPM ((unsigned int) 0x1 << 1) // (CAN) Disable/Enable Low Power Mode +-#define AT91C_CAN_ABM ((unsigned int) 0x1 << 2) // (CAN) Disable/Enable Autobaud/Listen Mode +-#define AT91C_CAN_OVL ((unsigned int) 0x1 << 3) // (CAN) Disable/Enable Overload Frame +-#define AT91C_CAN_TEOF ((unsigned int) 0x1 << 4) // (CAN) Time Stamp messages at each end of Frame +-#define AT91C_CAN_TTM ((unsigned int) 0x1 << 5) // (CAN) Disable/Enable Time Trigger Mode +-#define AT91C_CAN_TIMFRZ ((unsigned int) 0x1 << 6) // (CAN) Enable Timer Freeze +-#define AT91C_CAN_DRPT ((unsigned int) 0x1 << 7) // (CAN) Disable Repeat +-// -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- +-#define AT91C_CAN_MB0 ((unsigned int) 0x1 << 0) // (CAN) Mailbox 0 Flag +-#define AT91C_CAN_MB1 ((unsigned int) 0x1 << 1) // (CAN) Mailbox 1 Flag +-#define AT91C_CAN_MB2 ((unsigned int) 0x1 << 2) // (CAN) Mailbox 2 Flag +-#define AT91C_CAN_MB3 ((unsigned int) 0x1 << 3) // (CAN) Mailbox 3 Flag +-#define AT91C_CAN_MB4 ((unsigned int) 0x1 << 4) // (CAN) Mailbox 4 Flag +-#define AT91C_CAN_MB5 ((unsigned int) 0x1 << 5) // (CAN) Mailbox 5 Flag +-#define AT91C_CAN_MB6 ((unsigned int) 0x1 << 6) // (CAN) Mailbox 6 Flag +-#define AT91C_CAN_MB7 ((unsigned int) 0x1 << 7) // (CAN) Mailbox 7 Flag +-#define AT91C_CAN_MB8 ((unsigned int) 0x1 << 8) // (CAN) Mailbox 8 Flag +-#define AT91C_CAN_MB9 ((unsigned int) 0x1 << 9) // (CAN) Mailbox 9 Flag +-#define AT91C_CAN_MB10 ((unsigned int) 0x1 << 10) // (CAN) Mailbox 10 Flag +-#define AT91C_CAN_MB11 ((unsigned int) 0x1 << 11) // (CAN) Mailbox 11 Flag +-#define AT91C_CAN_MB12 ((unsigned int) 0x1 << 12) // (CAN) Mailbox 12 Flag +-#define AT91C_CAN_MB13 ((unsigned int) 0x1 << 13) // (CAN) Mailbox 13 Flag +-#define AT91C_CAN_MB14 ((unsigned int) 0x1 << 14) // (CAN) Mailbox 14 Flag +-#define AT91C_CAN_MB15 ((unsigned int) 0x1 << 15) // (CAN) Mailbox 15 Flag +-#define AT91C_CAN_ERRA ((unsigned int) 0x1 << 16) // (CAN) Error Active Mode Flag +-#define AT91C_CAN_WARN ((unsigned int) 0x1 << 17) // (CAN) Warning Limit Flag +-#define AT91C_CAN_ERRP ((unsigned int) 0x1 << 18) // (CAN) Error Passive Mode Flag +-#define AT91C_CAN_BOFF ((unsigned int) 0x1 << 19) // (CAN) Bus Off Mode Flag +-#define AT91C_CAN_SLEEP ((unsigned int) 0x1 << 20) // (CAN) Sleep Flag +-#define AT91C_CAN_WAKEUP ((unsigned int) 0x1 << 21) // (CAN) Wakeup Flag +-#define AT91C_CAN_TOVF ((unsigned int) 0x1 << 22) // (CAN) Timer Overflow Flag +-#define AT91C_CAN_TSTP ((unsigned int) 0x1 << 23) // (CAN) Timestamp Flag +-#define AT91C_CAN_CERR ((unsigned int) 0x1 << 24) // (CAN) CRC Error +-#define AT91C_CAN_SERR ((unsigned int) 0x1 << 25) // (CAN) Stuffing Error +-#define AT91C_CAN_AERR ((unsigned int) 0x1 << 26) // (CAN) Acknowledgment Error +-#define AT91C_CAN_FERR ((unsigned int) 0x1 << 27) // (CAN) Form Error +-#define AT91C_CAN_BERR ((unsigned int) 0x1 << 28) // (CAN) Bit Error +-// -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- +-// -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- +-// -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- +-#define AT91C_CAN_RBSY ((unsigned int) 0x1 << 29) // (CAN) Receiver Busy +-#define AT91C_CAN_TBSY ((unsigned int) 0x1 << 30) // (CAN) Transmitter Busy +-#define AT91C_CAN_OVLY ((unsigned int) 0x1 << 31) // (CAN) Overload Busy +-// -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- +-#define AT91C_CAN_PHASE2 ((unsigned int) 0x7 << 0) // (CAN) Phase 2 segment +-#define AT91C_CAN_PHASE1 ((unsigned int) 0x7 << 4) // (CAN) Phase 1 segment +-#define AT91C_CAN_PROPAG ((unsigned int) 0x7 << 8) // (CAN) Programmation time segment +-#define AT91C_CAN_SYNC ((unsigned int) 0x3 << 12) // (CAN) Re-synchronization jump width segment +-#define AT91C_CAN_BRP ((unsigned int) 0x7F << 16) // (CAN) Baudrate Prescaler +-#define AT91C_CAN_SMP ((unsigned int) 0x1 << 24) // (CAN) Sampling mode +-// -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- +-#define AT91C_CAN_TIMER ((unsigned int) 0xFFFF << 0) // (CAN) Timer field +-// -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- +-// -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- +-#define AT91C_CAN_REC ((unsigned int) 0xFF << 0) // (CAN) Receive Error Counter +-#define AT91C_CAN_TEC ((unsigned int) 0xFF << 16) // (CAN) Transmit Error Counter +-// -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- +-#define AT91C_CAN_TIMRST ((unsigned int) 0x1 << 31) // (CAN) Timer Reset Field +-// -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 +-// ***************************************************************************** +-typedef struct _AT91S_EMAC { +- AT91_REG EMAC_NCR; // Network Control Register +- AT91_REG EMAC_NCFGR; // Network Configuration Register +- AT91_REG EMAC_NSR; // Network Status Register +- AT91_REG Reserved0[2]; // +- AT91_REG EMAC_TSR; // Transmit Status Register +- AT91_REG EMAC_RBQP; // Receive Buffer Queue Pointer +- AT91_REG EMAC_TBQP; // Transmit Buffer Queue Pointer +- AT91_REG EMAC_RSR; // Receive Status Register +- AT91_REG EMAC_ISR; // Interrupt Status Register +- AT91_REG EMAC_IER; // Interrupt Enable Register +- AT91_REG EMAC_IDR; // Interrupt Disable Register +- AT91_REG EMAC_IMR; // Interrupt Mask Register +- AT91_REG EMAC_MAN; // PHY Maintenance Register +- AT91_REG EMAC_PTR; // Pause Time Register +- AT91_REG EMAC_PFR; // Pause Frames received Register +- AT91_REG EMAC_FTO; // Frames Transmitted OK Register +- AT91_REG EMAC_SCF; // Single Collision Frame Register +- AT91_REG EMAC_MCF; // Multiple Collision Frame Register +- AT91_REG EMAC_FRO; // Frames Received OK Register +- AT91_REG EMAC_FCSE; // Frame Check Sequence Error Register +- AT91_REG EMAC_ALE; // Alignment Error Register +- AT91_REG EMAC_DTF; // Deferred Transmission Frame Register +- AT91_REG EMAC_LCOL; // Late Collision Register +- AT91_REG EMAC_ECOL; // Excessive Collision Register +- AT91_REG EMAC_TUND; // Transmit Underrun Error Register +- AT91_REG EMAC_CSE; // Carrier Sense Error Register +- AT91_REG EMAC_RRE; // Receive Ressource Error Register +- AT91_REG EMAC_ROV; // Receive Overrun Errors Register +- AT91_REG EMAC_RSE; // Receive Symbol Errors Register +- AT91_REG EMAC_ELE; // Excessive Length Errors Register +- AT91_REG EMAC_RJA; // Receive Jabbers Register +- AT91_REG EMAC_USF; // Undersize Frames Register +- AT91_REG EMAC_STE; // SQE Test Error Register +- AT91_REG EMAC_RLE; // Receive Length Field Mismatch Register +- AT91_REG EMAC_TPF; // Transmitted Pause Frames Register +- AT91_REG EMAC_HRB; // Hash Address Bottom[31:0] +- AT91_REG EMAC_HRT; // Hash Address Top[63:32] +- AT91_REG EMAC_SA1L; // Specific Address 1 Bottom, First 4 bytes +- AT91_REG EMAC_SA1H; // Specific Address 1 Top, Last 2 bytes +- AT91_REG EMAC_SA2L; // Specific Address 2 Bottom, First 4 bytes +- AT91_REG EMAC_SA2H; // Specific Address 2 Top, Last 2 bytes +- AT91_REG EMAC_SA3L; // Specific Address 3 Bottom, First 4 bytes +- AT91_REG EMAC_SA3H; // Specific Address 3 Top, Last 2 bytes +- AT91_REG EMAC_SA4L; // Specific Address 4 Bottom, First 4 bytes +- AT91_REG EMAC_SA4H; // Specific Address 4 Top, Last 2 bytes +- AT91_REG EMAC_TID; // Type ID Checking Register +- AT91_REG EMAC_TPQ; // Transmit Pause Quantum Register +- AT91_REG EMAC_USRIO; // USER Input/Output Register +- AT91_REG EMAC_WOL; // Wake On LAN Register +- AT91_REG Reserved1[13]; // +- AT91_REG EMAC_REV; // Revision Register +-} AT91S_EMAC, *AT91PS_EMAC; +- +-// -------- EMAC_NCR : (EMAC Offset: 0x0) -------- +-#define AT91C_EMAC_LB ((unsigned int) 0x1 << 0) // (EMAC) Loopback. Optional. When set, loopback signal is at high level. +-#define AT91C_EMAC_LLB ((unsigned int) 0x1 << 1) // (EMAC) Loopback local. +-#define AT91C_EMAC_RE ((unsigned int) 0x1 << 2) // (EMAC) Receive enable. +-#define AT91C_EMAC_TE ((unsigned int) 0x1 << 3) // (EMAC) Transmit enable. +-#define AT91C_EMAC_MPE ((unsigned int) 0x1 << 4) // (EMAC) Management port enable. +-#define AT91C_EMAC_CLRSTAT ((unsigned int) 0x1 << 5) // (EMAC) Clear statistics registers. +-#define AT91C_EMAC_INCSTAT ((unsigned int) 0x1 << 6) // (EMAC) Increment statistics registers. +-#define AT91C_EMAC_WESTAT ((unsigned int) 0x1 << 7) // (EMAC) Write enable for statistics registers. +-#define AT91C_EMAC_BP ((unsigned int) 0x1 << 8) // (EMAC) Back pressure. +-#define AT91C_EMAC_TSTART ((unsigned int) 0x1 << 9) // (EMAC) Start Transmission. +-#define AT91C_EMAC_THALT ((unsigned int) 0x1 << 10) // (EMAC) Transmission Halt. +-#define AT91C_EMAC_TPFR ((unsigned int) 0x1 << 11) // (EMAC) Transmit pause frame +-#define AT91C_EMAC_TZQ ((unsigned int) 0x1 << 12) // (EMAC) Transmit zero quantum pause frame +-// -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- +-#define AT91C_EMAC_SPD ((unsigned int) 0x1 << 0) // (EMAC) Speed. +-#define AT91C_EMAC_FD ((unsigned int) 0x1 << 1) // (EMAC) Full duplex. +-#define AT91C_EMAC_JFRAME ((unsigned int) 0x1 << 3) // (EMAC) Jumbo Frames. +-#define AT91C_EMAC_CAF ((unsigned int) 0x1 << 4) // (EMAC) Copy all frames. +-#define AT91C_EMAC_NBC ((unsigned int) 0x1 << 5) // (EMAC) No broadcast. +-#define AT91C_EMAC_MTI ((unsigned int) 0x1 << 6) // (EMAC) Multicast hash event enable +-#define AT91C_EMAC_UNI ((unsigned int) 0x1 << 7) // (EMAC) Unicast hash enable. +-#define AT91C_EMAC_BIG ((unsigned int) 0x1 << 8) // (EMAC) Receive 1522 bytes. +-#define AT91C_EMAC_EAE ((unsigned int) 0x1 << 9) // (EMAC) External address match enable. +-#define AT91C_EMAC_CLK ((unsigned int) 0x3 << 10) // (EMAC) +-#define AT91C_EMAC_CLK_HCLK_8 ((unsigned int) 0x0 << 10) // (EMAC) HCLK divided by 8 +-#define AT91C_EMAC_CLK_HCLK_16 ((unsigned int) 0x1 << 10) // (EMAC) HCLK divided by 16 +-#define AT91C_EMAC_CLK_HCLK_32 ((unsigned int) 0x2 << 10) // (EMAC) HCLK divided by 32 +-#define AT91C_EMAC_CLK_HCLK_64 ((unsigned int) 0x3 << 10) // (EMAC) HCLK divided by 64 +-#define AT91C_EMAC_RTY ((unsigned int) 0x1 << 12) // (EMAC) +-#define AT91C_EMAC_PAE ((unsigned int) 0x1 << 13) // (EMAC) +-#define AT91C_EMAC_RBOF ((unsigned int) 0x3 << 14) // (EMAC) +-#define AT91C_EMAC_RBOF_OFFSET_0 ((unsigned int) 0x0 << 14) // (EMAC) no offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_1 ((unsigned int) 0x1 << 14) // (EMAC) one byte offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_2 ((unsigned int) 0x2 << 14) // (EMAC) two bytes offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_3 ((unsigned int) 0x3 << 14) // (EMAC) three bytes offset from start of receive buffer +-#define AT91C_EMAC_RLCE ((unsigned int) 0x1 << 16) // (EMAC) Receive Length field Checking Enable +-#define AT91C_EMAC_DRFCS ((unsigned int) 0x1 << 17) // (EMAC) Discard Receive FCS +-#define AT91C_EMAC_EFRHD ((unsigned int) 0x1 << 18) // (EMAC) +-#define AT91C_EMAC_IRXFCS ((unsigned int) 0x1 << 19) // (EMAC) Ignore RX FCS +-// -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- +-#define AT91C_EMAC_LINKR ((unsigned int) 0x1 << 0) // (EMAC) +-#define AT91C_EMAC_MDIO ((unsigned int) 0x1 << 1) // (EMAC) +-#define AT91C_EMAC_IDLE ((unsigned int) 0x1 << 2) // (EMAC) +-// -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- +-#define AT91C_EMAC_UBR ((unsigned int) 0x1 << 0) // (EMAC) +-#define AT91C_EMAC_COL ((unsigned int) 0x1 << 1) // (EMAC) +-#define AT91C_EMAC_RLES ((unsigned int) 0x1 << 2) // (EMAC) +-#define AT91C_EMAC_TGO ((unsigned int) 0x1 << 3) // (EMAC) Transmit Go +-#define AT91C_EMAC_BEX ((unsigned int) 0x1 << 4) // (EMAC) Buffers exhausted mid frame +-#define AT91C_EMAC_COMP ((unsigned int) 0x1 << 5) // (EMAC) +-#define AT91C_EMAC_UND ((unsigned int) 0x1 << 6) // (EMAC) +-// -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- +-#define AT91C_EMAC_BNA ((unsigned int) 0x1 << 0) // (EMAC) +-#define AT91C_EMAC_REC ((unsigned int) 0x1 << 1) // (EMAC) +-#define AT91C_EMAC_OVR ((unsigned int) 0x1 << 2) // (EMAC) +-// -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- +-#define AT91C_EMAC_MFD ((unsigned int) 0x1 << 0) // (EMAC) +-#define AT91C_EMAC_RCOMP ((unsigned int) 0x1 << 1) // (EMAC) +-#define AT91C_EMAC_RXUBR ((unsigned int) 0x1 << 2) // (EMAC) +-#define AT91C_EMAC_TXUBR ((unsigned int) 0x1 << 3) // (EMAC) +-#define AT91C_EMAC_TUNDR ((unsigned int) 0x1 << 4) // (EMAC) +-#define AT91C_EMAC_RLEX ((unsigned int) 0x1 << 5) // (EMAC) +-#define AT91C_EMAC_TXERR ((unsigned int) 0x1 << 6) // (EMAC) +-#define AT91C_EMAC_TCOMP ((unsigned int) 0x1 << 7) // (EMAC) +-#define AT91C_EMAC_LINK ((unsigned int) 0x1 << 9) // (EMAC) +-#define AT91C_EMAC_ROVR ((unsigned int) 0x1 << 10) // (EMAC) +-#define AT91C_EMAC_HRESP ((unsigned int) 0x1 << 11) // (EMAC) +-#define AT91C_EMAC_PFRE ((unsigned int) 0x1 << 12) // (EMAC) +-#define AT91C_EMAC_PTZ ((unsigned int) 0x1 << 13) // (EMAC) +-// -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- +-// -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- +-// -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- +-// -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- +-#define AT91C_EMAC_DATA ((unsigned int) 0xFFFF << 0) // (EMAC) +-#define AT91C_EMAC_CODE ((unsigned int) 0x3 << 16) // (EMAC) +-#define AT91C_EMAC_REGA ((unsigned int) 0x1F << 18) // (EMAC) +-#define AT91C_EMAC_PHYA ((unsigned int) 0x1F << 23) // (EMAC) +-#define AT91C_EMAC_RW ((unsigned int) 0x3 << 28) // (EMAC) +-#define AT91C_EMAC_SOF ((unsigned int) 0x3 << 30) // (EMAC) +-// -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- +-#define AT91C_EMAC_RMII ((unsigned int) 0x1 << 0) // (EMAC) Reduce MII +-#define AT91C_EMAC_CLKEN ((unsigned int) 0x1 << 1) // (EMAC) Clock Enable +-// -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- +-#define AT91C_EMAC_IP ((unsigned int) 0xFFFF << 0) // (EMAC) ARP request IP address +-#define AT91C_EMAC_MAG ((unsigned int) 0x1 << 16) // (EMAC) Magic packet event enable +-#define AT91C_EMAC_ARP ((unsigned int) 0x1 << 17) // (EMAC) ARP request event enable +-#define AT91C_EMAC_SA1 ((unsigned int) 0x1 << 18) // (EMAC) Specific address register 1 event enable +-// -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- +-#define AT91C_EMAC_REVREF ((unsigned int) 0xFFFF << 0) // (EMAC) +-#define AT91C_EMAC_PARTREF ((unsigned int) 0xFFFF << 16) // (EMAC) +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Analog to Digital Convertor +-// ***************************************************************************** +-typedef struct _AT91S_ADC { +- AT91_REG ADC_CR; // ADC Control Register +- AT91_REG ADC_MR; // ADC Mode Register +- AT91_REG Reserved0[2]; // +- AT91_REG ADC_CHER; // ADC Channel Enable Register +- AT91_REG ADC_CHDR; // ADC Channel Disable Register +- AT91_REG ADC_CHSR; // ADC Channel Status Register +- AT91_REG ADC_SR; // ADC Status Register +- AT91_REG ADC_LCDR; // ADC Last Converted Data Register +- AT91_REG ADC_IER; // ADC Interrupt Enable Register +- AT91_REG ADC_IDR; // ADC Interrupt Disable Register +- AT91_REG ADC_IMR; // ADC Interrupt Mask Register +- AT91_REG ADC_CDR0; // ADC Channel Data Register 0 +- AT91_REG ADC_CDR1; // ADC Channel Data Register 1 +- AT91_REG ADC_CDR2; // ADC Channel Data Register 2 +- AT91_REG ADC_CDR3; // ADC Channel Data Register 3 +- AT91_REG ADC_CDR4; // ADC Channel Data Register 4 +- AT91_REG ADC_CDR5; // ADC Channel Data Register 5 +- AT91_REG ADC_CDR6; // ADC Channel Data Register 6 +- AT91_REG ADC_CDR7; // ADC Channel Data Register 7 +- AT91_REG Reserved1[44]; // +- AT91_REG ADC_RPR; // Receive Pointer Register +- AT91_REG ADC_RCR; // Receive Counter Register +- AT91_REG ADC_TPR; // Transmit Pointer Register +- AT91_REG ADC_TCR; // Transmit Counter Register +- AT91_REG ADC_RNPR; // Receive Next Pointer Register +- AT91_REG ADC_RNCR; // Receive Next Counter Register +- AT91_REG ADC_TNPR; // Transmit Next Pointer Register +- AT91_REG ADC_TNCR; // Transmit Next Counter Register +- AT91_REG ADC_PTCR; // PDC Transfer Control Register +- AT91_REG ADC_PTSR; // PDC Transfer Status Register +-} AT91S_ADC, *AT91PS_ADC; +- +-// -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- +-#define AT91C_ADC_SWRST ((unsigned int) 0x1 << 0) // (ADC) Software Reset +-#define AT91C_ADC_START ((unsigned int) 0x1 << 1) // (ADC) Start Conversion +-// -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- +-#define AT91C_ADC_TRGEN ((unsigned int) 0x1 << 0) // (ADC) Trigger Enable +-#define AT91C_ADC_TRGEN_DIS ((unsigned int) 0x0) // (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software +-#define AT91C_ADC_TRGEN_EN ((unsigned int) 0x1) // (ADC) Hardware trigger selected by TRGSEL field is enabled. +-#define AT91C_ADC_TRGSEL ((unsigned int) 0x7 << 1) // (ADC) Trigger Selection +-#define AT91C_ADC_TRGSEL_TIOA0 ((unsigned int) 0x0 << 1) // (ADC) Selected TRGSEL = TIAO0 +-#define AT91C_ADC_TRGSEL_TIOA1 ((unsigned int) 0x1 << 1) // (ADC) Selected TRGSEL = TIAO1 +-#define AT91C_ADC_TRGSEL_TIOA2 ((unsigned int) 0x2 << 1) // (ADC) Selected TRGSEL = TIAO2 +-#define AT91C_ADC_TRGSEL_TIOA3 ((unsigned int) 0x3 << 1) // (ADC) Selected TRGSEL = TIAO3 +-#define AT91C_ADC_TRGSEL_TIOA4 ((unsigned int) 0x4 << 1) // (ADC) Selected TRGSEL = TIAO4 +-#define AT91C_ADC_TRGSEL_TIOA5 ((unsigned int) 0x5 << 1) // (ADC) Selected TRGSEL = TIAO5 +-#define AT91C_ADC_TRGSEL_EXT ((unsigned int) 0x6 << 1) // (ADC) Selected TRGSEL = External Trigger +-#define AT91C_ADC_LOWRES ((unsigned int) 0x1 << 4) // (ADC) Resolution. +-#define AT91C_ADC_LOWRES_10_BIT ((unsigned int) 0x0 << 4) // (ADC) 10-bit resolution +-#define AT91C_ADC_LOWRES_8_BIT ((unsigned int) 0x1 << 4) // (ADC) 8-bit resolution +-#define AT91C_ADC_SLEEP ((unsigned int) 0x1 << 5) // (ADC) Sleep Mode +-#define AT91C_ADC_SLEEP_NORMAL_MODE ((unsigned int) 0x0 << 5) // (ADC) Normal Mode +-#define AT91C_ADC_SLEEP_MODE ((unsigned int) 0x1 << 5) // (ADC) Sleep Mode +-#define AT91C_ADC_PRESCAL ((unsigned int) 0x3F << 8) // (ADC) Prescaler rate selection +-#define AT91C_ADC_STARTUP ((unsigned int) 0x1F << 16) // (ADC) Startup Time +-#define AT91C_ADC_SHTIM ((unsigned int) 0xF << 24) // (ADC) Sample & Hold Time +-// -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- +-#define AT91C_ADC_CH0 ((unsigned int) 0x1 << 0) // (ADC) Channel 0 +-#define AT91C_ADC_CH1 ((unsigned int) 0x1 << 1) // (ADC) Channel 1 +-#define AT91C_ADC_CH2 ((unsigned int) 0x1 << 2) // (ADC) Channel 2 +-#define AT91C_ADC_CH3 ((unsigned int) 0x1 << 3) // (ADC) Channel 3 +-#define AT91C_ADC_CH4 ((unsigned int) 0x1 << 4) // (ADC) Channel 4 +-#define AT91C_ADC_CH5 ((unsigned int) 0x1 << 5) // (ADC) Channel 5 +-#define AT91C_ADC_CH6 ((unsigned int) 0x1 << 6) // (ADC) Channel 6 +-#define AT91C_ADC_CH7 ((unsigned int) 0x1 << 7) // (ADC) Channel 7 +-// -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- +-// -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- +-// -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- +-#define AT91C_ADC_EOC0 ((unsigned int) 0x1 << 0) // (ADC) End of Conversion +-#define AT91C_ADC_EOC1 ((unsigned int) 0x1 << 1) // (ADC) End of Conversion +-#define AT91C_ADC_EOC2 ((unsigned int) 0x1 << 2) // (ADC) End of Conversion +-#define AT91C_ADC_EOC3 ((unsigned int) 0x1 << 3) // (ADC) End of Conversion +-#define AT91C_ADC_EOC4 ((unsigned int) 0x1 << 4) // (ADC) End of Conversion +-#define AT91C_ADC_EOC5 ((unsigned int) 0x1 << 5) // (ADC) End of Conversion +-#define AT91C_ADC_EOC6 ((unsigned int) 0x1 << 6) // (ADC) End of Conversion +-#define AT91C_ADC_EOC7 ((unsigned int) 0x1 << 7) // (ADC) End of Conversion +-#define AT91C_ADC_OVRE0 ((unsigned int) 0x1 << 8) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE1 ((unsigned int) 0x1 << 9) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE2 ((unsigned int) 0x1 << 10) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE3 ((unsigned int) 0x1 << 11) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE4 ((unsigned int) 0x1 << 12) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE5 ((unsigned int) 0x1 << 13) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE6 ((unsigned int) 0x1 << 14) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE7 ((unsigned int) 0x1 << 15) // (ADC) Overrun Error +-#define AT91C_ADC_DRDY ((unsigned int) 0x1 << 16) // (ADC) Data Ready +-#define AT91C_ADC_GOVRE ((unsigned int) 0x1 << 17) // (ADC) General Overrun +-#define AT91C_ADC_ENDRX ((unsigned int) 0x1 << 18) // (ADC) End of Receiver Transfer +-#define AT91C_ADC_RXBUFF ((unsigned int) 0x1 << 19) // (ADC) RXBUFF Interrupt +-// -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- +-#define AT91C_ADC_LDATA ((unsigned int) 0x3FF << 0) // (ADC) Last Data Converted +-// -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- +-// -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- +-// -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- +-// -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- +-#define AT91C_ADC_DATA ((unsigned int) 0x3FF << 0) // (ADC) Converted Data +-// -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- +-// -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- +-// -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- +-// -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- +-// -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- +-// -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- +-// -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- +- +-// ***************************************************************************** +-// REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 +-// ***************************************************************************** +-// ========== Register definition for SYS peripheral ========== +-// ========== Register definition for AIC peripheral ========== +-#define AT91C_AIC_IVR ((AT91_REG *) 0xFFFFF100) // (AIC) IRQ Vector Register +-#define AT91C_AIC_SMR ((AT91_REG *) 0xFFFFF000) // (AIC) Source Mode Register +-#define AT91C_AIC_FVR ((AT91_REG *) 0xFFFFF104) // (AIC) FIQ Vector Register +-#define AT91C_AIC_DCR ((AT91_REG *) 0xFFFFF138) // (AIC) Debug Control Register (Protect) +-#define AT91C_AIC_EOICR ((AT91_REG *) 0xFFFFF130) // (AIC) End of Interrupt Command Register +-#define AT91C_AIC_SVR ((AT91_REG *) 0xFFFFF080) // (AIC) Source Vector Register +-#define AT91C_AIC_FFSR ((AT91_REG *) 0xFFFFF148) // (AIC) Fast Forcing Status Register +-#define AT91C_AIC_ICCR ((AT91_REG *) 0xFFFFF128) // (AIC) Interrupt Clear Command Register +-#define AT91C_AIC_ISR ((AT91_REG *) 0xFFFFF108) // (AIC) Interrupt Status Register +-#define AT91C_AIC_IMR ((AT91_REG *) 0xFFFFF110) // (AIC) Interrupt Mask Register +-#define AT91C_AIC_IPR ((AT91_REG *) 0xFFFFF10C) // (AIC) Interrupt Pending Register +-#define AT91C_AIC_FFER ((AT91_REG *) 0xFFFFF140) // (AIC) Fast Forcing Enable Register +-#define AT91C_AIC_IECR ((AT91_REG *) 0xFFFFF120) // (AIC) Interrupt Enable Command Register +-#define AT91C_AIC_ISCR ((AT91_REG *) 0xFFFFF12C) // (AIC) Interrupt Set Command Register +-#define AT91C_AIC_FFDR ((AT91_REG *) 0xFFFFF144) // (AIC) Fast Forcing Disable Register +-#define AT91C_AIC_CISR ((AT91_REG *) 0xFFFFF114) // (AIC) Core Interrupt Status Register +-#define AT91C_AIC_IDCR ((AT91_REG *) 0xFFFFF124) // (AIC) Interrupt Disable Command Register +-#define AT91C_AIC_SPU ((AT91_REG *) 0xFFFFF134) // (AIC) Spurious Vector Register +-// ========== Register definition for PDC_DBGU peripheral ========== +-#define AT91C_DBGU_TCR ((AT91_REG *) 0xFFFFF30C) // (PDC_DBGU) Transmit Counter Register +-#define AT91C_DBGU_RNPR ((AT91_REG *) 0xFFFFF310) // (PDC_DBGU) Receive Next Pointer Register +-#define AT91C_DBGU_TNPR ((AT91_REG *) 0xFFFFF318) // (PDC_DBGU) Transmit Next Pointer Register +-#define AT91C_DBGU_TPR ((AT91_REG *) 0xFFFFF308) // (PDC_DBGU) Transmit Pointer Register +-#define AT91C_DBGU_RPR ((AT91_REG *) 0xFFFFF300) // (PDC_DBGU) Receive Pointer Register +-#define AT91C_DBGU_RCR ((AT91_REG *) 0xFFFFF304) // (PDC_DBGU) Receive Counter Register +-#define AT91C_DBGU_RNCR ((AT91_REG *) 0xFFFFF314) // (PDC_DBGU) Receive Next Counter Register +-#define AT91C_DBGU_PTCR ((AT91_REG *) 0xFFFFF320) // (PDC_DBGU) PDC Transfer Control Register +-#define AT91C_DBGU_PTSR ((AT91_REG *) 0xFFFFF324) // (PDC_DBGU) PDC Transfer Status Register +-#define AT91C_DBGU_TNCR ((AT91_REG *) 0xFFFFF31C) // (PDC_DBGU) Transmit Next Counter Register +-// ========== Register definition for DBGU peripheral ========== +-#define AT91C_DBGU_EXID ((AT91_REG *) 0xFFFFF244) // (DBGU) Chip ID Extension Register +-#define AT91C_DBGU_BRGR ((AT91_REG *) 0xFFFFF220) // (DBGU) Baud Rate Generator Register +-#define AT91C_DBGU_IDR ((AT91_REG *) 0xFFFFF20C) // (DBGU) Interrupt Disable Register +-#define AT91C_DBGU_CSR ((AT91_REG *) 0xFFFFF214) // (DBGU) Channel Status Register +-#define AT91C_DBGU_CIDR ((AT91_REG *) 0xFFFFF240) // (DBGU) Chip ID Register +-#define AT91C_DBGU_MR ((AT91_REG *) 0xFFFFF204) // (DBGU) Mode Register +-#define AT91C_DBGU_IMR ((AT91_REG *) 0xFFFFF210) // (DBGU) Interrupt Mask Register +-#define AT91C_DBGU_CR ((AT91_REG *) 0xFFFFF200) // (DBGU) Control Register +-#define AT91C_DBGU_FNTR ((AT91_REG *) 0xFFFFF248) // (DBGU) Force NTRST Register +-#define AT91C_DBGU_THR ((AT91_REG *) 0xFFFFF21C) // (DBGU) Transmitter Holding Register +-#define AT91C_DBGU_RHR ((AT91_REG *) 0xFFFFF218) // (DBGU) Receiver Holding Register +-#define AT91C_DBGU_IER ((AT91_REG *) 0xFFFFF208) // (DBGU) Interrupt Enable Register +-// ========== Register definition for PIOA peripheral ========== +-#define AT91C_PIOA_ODR ((AT91_REG *) 0xFFFFF414) // (PIOA) Output Disable Registerr +-#define AT91C_PIOA_SODR ((AT91_REG *) 0xFFFFF430) // (PIOA) Set Output Data Register +-#define AT91C_PIOA_ISR ((AT91_REG *) 0xFFFFF44C) // (PIOA) Interrupt Status Register +-#define AT91C_PIOA_ABSR ((AT91_REG *) 0xFFFFF478) // (PIOA) AB Select Status Register +-#define AT91C_PIOA_IER ((AT91_REG *) 0xFFFFF440) // (PIOA) Interrupt Enable Register +-#define AT91C_PIOA_PPUDR ((AT91_REG *) 0xFFFFF460) // (PIOA) Pull-up Disable Register +-#define AT91C_PIOA_IMR ((AT91_REG *) 0xFFFFF448) // (PIOA) Interrupt Mask Register +-#define AT91C_PIOA_PER ((AT91_REG *) 0xFFFFF400) // (PIOA) PIO Enable Register +-#define AT91C_PIOA_IFDR ((AT91_REG *) 0xFFFFF424) // (PIOA) Input Filter Disable Register +-#define AT91C_PIOA_OWDR ((AT91_REG *) 0xFFFFF4A4) // (PIOA) Output Write Disable Register +-#define AT91C_PIOA_MDSR ((AT91_REG *) 0xFFFFF458) // (PIOA) Multi-driver Status Register +-#define AT91C_PIOA_IDR ((AT91_REG *) 0xFFFFF444) // (PIOA) Interrupt Disable Register +-#define AT91C_PIOA_ODSR ((AT91_REG *) 0xFFFFF438) // (PIOA) Output Data Status Register +-#define AT91C_PIOA_PPUSR ((AT91_REG *) 0xFFFFF468) // (PIOA) Pull-up Status Register +-#define AT91C_PIOA_OWSR ((AT91_REG *) 0xFFFFF4A8) // (PIOA) Output Write Status Register +-#define AT91C_PIOA_BSR ((AT91_REG *) 0xFFFFF474) // (PIOA) Select B Register +-#define AT91C_PIOA_OWER ((AT91_REG *) 0xFFFFF4A0) // (PIOA) Output Write Enable Register +-#define AT91C_PIOA_IFER ((AT91_REG *) 0xFFFFF420) // (PIOA) Input Filter Enable Register +-#define AT91C_PIOA_PDSR ((AT91_REG *) 0xFFFFF43C) // (PIOA) Pin Data Status Register +-#define AT91C_PIOA_PPUER ((AT91_REG *) 0xFFFFF464) // (PIOA) Pull-up Enable Register +-#define AT91C_PIOA_OSR ((AT91_REG *) 0xFFFFF418) // (PIOA) Output Status Register +-#define AT91C_PIOA_ASR ((AT91_REG *) 0xFFFFF470) // (PIOA) Select A Register +-#define AT91C_PIOA_MDDR ((AT91_REG *) 0xFFFFF454) // (PIOA) Multi-driver Disable Register +-#define AT91C_PIOA_CODR ((AT91_REG *) 0xFFFFF434) // (PIOA) Clear Output Data Register +-#define AT91C_PIOA_MDER ((AT91_REG *) 0xFFFFF450) // (PIOA) Multi-driver Enable Register +-#define AT91C_PIOA_PDR ((AT91_REG *) 0xFFFFF404) // (PIOA) PIO Disable Register +-#define AT91C_PIOA_IFSR ((AT91_REG *) 0xFFFFF428) // (PIOA) Input Filter Status Register +-#define AT91C_PIOA_OER ((AT91_REG *) 0xFFFFF410) // (PIOA) Output Enable Register +-#define AT91C_PIOA_PSR ((AT91_REG *) 0xFFFFF408) // (PIOA) PIO Status Register +-// ========== Register definition for PIOB peripheral ========== +-#define AT91C_PIOB_OWDR ((AT91_REG *) 0xFFFFF6A4) // (PIOB) Output Write Disable Register +-#define AT91C_PIOB_MDER ((AT91_REG *) 0xFFFFF650) // (PIOB) Multi-driver Enable Register +-#define AT91C_PIOB_PPUSR ((AT91_REG *) 0xFFFFF668) // (PIOB) Pull-up Status Register +-#define AT91C_PIOB_IMR ((AT91_REG *) 0xFFFFF648) // (PIOB) Interrupt Mask Register +-#define AT91C_PIOB_ASR ((AT91_REG *) 0xFFFFF670) // (PIOB) Select A Register +-#define AT91C_PIOB_PPUDR ((AT91_REG *) 0xFFFFF660) // (PIOB) Pull-up Disable Register +-#define AT91C_PIOB_PSR ((AT91_REG *) 0xFFFFF608) // (PIOB) PIO Status Register +-#define AT91C_PIOB_IER ((AT91_REG *) 0xFFFFF640) // (PIOB) Interrupt Enable Register +-#define AT91C_PIOB_CODR ((AT91_REG *) 0xFFFFF634) // (PIOB) Clear Output Data Register +-#define AT91C_PIOB_OWER ((AT91_REG *) 0xFFFFF6A0) // (PIOB) Output Write Enable Register +-#define AT91C_PIOB_ABSR ((AT91_REG *) 0xFFFFF678) // (PIOB) AB Select Status Register +-#define AT91C_PIOB_IFDR ((AT91_REG *) 0xFFFFF624) // (PIOB) Input Filter Disable Register +-#define AT91C_PIOB_PDSR ((AT91_REG *) 0xFFFFF63C) // (PIOB) Pin Data Status Register +-#define AT91C_PIOB_IDR ((AT91_REG *) 0xFFFFF644) // (PIOB) Interrupt Disable Register +-#define AT91C_PIOB_OWSR ((AT91_REG *) 0xFFFFF6A8) // (PIOB) Output Write Status Register +-#define AT91C_PIOB_PDR ((AT91_REG *) 0xFFFFF604) // (PIOB) PIO Disable Register +-#define AT91C_PIOB_ODR ((AT91_REG *) 0xFFFFF614) // (PIOB) Output Disable Registerr +-#define AT91C_PIOB_IFSR ((AT91_REG *) 0xFFFFF628) // (PIOB) Input Filter Status Register +-#define AT91C_PIOB_PPUER ((AT91_REG *) 0xFFFFF664) // (PIOB) Pull-up Enable Register +-#define AT91C_PIOB_SODR ((AT91_REG *) 0xFFFFF630) // (PIOB) Set Output Data Register +-#define AT91C_PIOB_ISR ((AT91_REG *) 0xFFFFF64C) // (PIOB) Interrupt Status Register +-#define AT91C_PIOB_ODSR ((AT91_REG *) 0xFFFFF638) // (PIOB) Output Data Status Register +-#define AT91C_PIOB_OSR ((AT91_REG *) 0xFFFFF618) // (PIOB) Output Status Register +-#define AT91C_PIOB_MDSR ((AT91_REG *) 0xFFFFF658) // (PIOB) Multi-driver Status Register +-#define AT91C_PIOB_IFER ((AT91_REG *) 0xFFFFF620) // (PIOB) Input Filter Enable Register +-#define AT91C_PIOB_BSR ((AT91_REG *) 0xFFFFF674) // (PIOB) Select B Register +-#define AT91C_PIOB_MDDR ((AT91_REG *) 0xFFFFF654) // (PIOB) Multi-driver Disable Register +-#define AT91C_PIOB_OER ((AT91_REG *) 0xFFFFF610) // (PIOB) Output Enable Register +-#define AT91C_PIOB_PER ((AT91_REG *) 0xFFFFF600) // (PIOB) PIO Enable Register +-// ========== Register definition for CKGR peripheral ========== +-#define AT91C_CKGR_MOR ((AT91_REG *) 0xFFFFFC20) // (CKGR) Main Oscillator Register +-#define AT91C_CKGR_PLLR ((AT91_REG *) 0xFFFFFC2C) // (CKGR) PLL Register +-#define AT91C_CKGR_MCFR ((AT91_REG *) 0xFFFFFC24) // (CKGR) Main Clock Frequency Register +-// ========== Register definition for PMC peripheral ========== +-#define AT91C_PMC_IDR ((AT91_REG *) 0xFFFFFC64) // (PMC) Interrupt Disable Register +-#define AT91C_PMC_MOR ((AT91_REG *) 0xFFFFFC20) // (PMC) Main Oscillator Register +-#define AT91C_PMC_PLLR ((AT91_REG *) 0xFFFFFC2C) // (PMC) PLL Register +-#define AT91C_PMC_PCER ((AT91_REG *) 0xFFFFFC10) // (PMC) Peripheral Clock Enable Register +-#define AT91C_PMC_PCKR ((AT91_REG *) 0xFFFFFC40) // (PMC) Programmable Clock Register +-#define AT91C_PMC_MCKR ((AT91_REG *) 0xFFFFFC30) // (PMC) Master Clock Register +-#define AT91C_PMC_SCDR ((AT91_REG *) 0xFFFFFC04) // (PMC) System Clock Disable Register +-#define AT91C_PMC_PCDR ((AT91_REG *) 0xFFFFFC14) // (PMC) Peripheral Clock Disable Register +-#define AT91C_PMC_SCSR ((AT91_REG *) 0xFFFFFC08) // (PMC) System Clock Status Register +-#define AT91C_PMC_PCSR ((AT91_REG *) 0xFFFFFC18) // (PMC) Peripheral Clock Status Register +-#define AT91C_PMC_MCFR ((AT91_REG *) 0xFFFFFC24) // (PMC) Main Clock Frequency Register +-#define AT91C_PMC_SCER ((AT91_REG *) 0xFFFFFC00) // (PMC) System Clock Enable Register +-#define AT91C_PMC_IMR ((AT91_REG *) 0xFFFFFC6C) // (PMC) Interrupt Mask Register +-#define AT91C_PMC_IER ((AT91_REG *) 0xFFFFFC60) // (PMC) Interrupt Enable Register +-#define AT91C_PMC_SR ((AT91_REG *) 0xFFFFFC68) // (PMC) Status Register +-// ========== Register definition for RSTC peripheral ========== +-#define AT91C_RSTC_RCR ((AT91_REG *) 0xFFFFFD00) // (RSTC) Reset Control Register +-#define AT91C_RSTC_RMR ((AT91_REG *) 0xFFFFFD08) // (RSTC) Reset Mode Register +-#define AT91C_RSTC_RSR ((AT91_REG *) 0xFFFFFD04) // (RSTC) Reset Status Register +-// ========== Register definition for RTTC peripheral ========== +-#define AT91C_RTTC_RTSR ((AT91_REG *) 0xFFFFFD2C) // (RTTC) Real-time Status Register +-#define AT91C_RTTC_RTMR ((AT91_REG *) 0xFFFFFD20) // (RTTC) Real-time Mode Register +-#define AT91C_RTTC_RTVR ((AT91_REG *) 0xFFFFFD28) // (RTTC) Real-time Value Register +-#define AT91C_RTTC_RTAR ((AT91_REG *) 0xFFFFFD24) // (RTTC) Real-time Alarm Register +-// ========== Register definition for PITC peripheral ========== +-#define AT91C_PITC_PIVR ((AT91_REG *) 0xFFFFFD38) // (PITC) Period Interval Value Register +-#define AT91C_PITC_PISR ((AT91_REG *) 0xFFFFFD34) // (PITC) Period Interval Status Register +-#define AT91C_PITC_PIIR ((AT91_REG *) 0xFFFFFD3C) // (PITC) Period Interval Image Register +-#define AT91C_PITC_PIMR ((AT91_REG *) 0xFFFFFD30) // (PITC) Period Interval Mode Register +-// ========== Register definition for WDTC peripheral ========== +-#define AT91C_WDTC_WDCR ((AT91_REG *) 0xFFFFFD40) // (WDTC) Watchdog Control Register +-#define AT91C_WDTC_WDSR ((AT91_REG *) 0xFFFFFD48) // (WDTC) Watchdog Status Register +-#define AT91C_WDTC_WDMR ((AT91_REG *) 0xFFFFFD44) // (WDTC) Watchdog Mode Register +-// ========== Register definition for VREG peripheral ========== +-#define AT91C_VREG_MR ((AT91_REG *) 0xFFFFFD60) // (VREG) Voltage Regulator Mode Register +-// ========== Register definition for MC peripheral ========== +-#define AT91C_MC_ASR ((AT91_REG *) 0xFFFFFF04) // (MC) MC Abort Status Register +-#define AT91C_MC_RCR ((AT91_REG *) 0xFFFFFF00) // (MC) MC Remap Control Register +-#define AT91C_MC_FCR ((AT91_REG *) 0xFFFFFF64) // (MC) MC Flash Command Register +-#define AT91C_MC_AASR ((AT91_REG *) 0xFFFFFF08) // (MC) MC Abort Address Status Register +-#define AT91C_MC_FSR ((AT91_REG *) 0xFFFFFF68) // (MC) MC Flash Status Register +-#define AT91C_MC_FMR ((AT91_REG *) 0xFFFFFF60) // (MC) MC Flash Mode Register +-// ========== Register definition for PDC_SPI1 peripheral ========== +-#define AT91C_SPI1_PTCR ((AT91_REG *) 0xFFFE4120) // (PDC_SPI1) PDC Transfer Control Register +-#define AT91C_SPI1_RPR ((AT91_REG *) 0xFFFE4100) // (PDC_SPI1) Receive Pointer Register +-#define AT91C_SPI1_TNCR ((AT91_REG *) 0xFFFE411C) // (PDC_SPI1) Transmit Next Counter Register +-#define AT91C_SPI1_TPR ((AT91_REG *) 0xFFFE4108) // (PDC_SPI1) Transmit Pointer Register +-#define AT91C_SPI1_TNPR ((AT91_REG *) 0xFFFE4118) // (PDC_SPI1) Transmit Next Pointer Register +-#define AT91C_SPI1_TCR ((AT91_REG *) 0xFFFE410C) // (PDC_SPI1) Transmit Counter Register +-#define AT91C_SPI1_RCR ((AT91_REG *) 0xFFFE4104) // (PDC_SPI1) Receive Counter Register +-#define AT91C_SPI1_RNPR ((AT91_REG *) 0xFFFE4110) // (PDC_SPI1) Receive Next Pointer Register +-#define AT91C_SPI1_RNCR ((AT91_REG *) 0xFFFE4114) // (PDC_SPI1) Receive Next Counter Register +-#define AT91C_SPI1_PTSR ((AT91_REG *) 0xFFFE4124) // (PDC_SPI1) PDC Transfer Status Register +-// ========== Register definition for SPI1 peripheral ========== +-#define AT91C_SPI1_IMR ((AT91_REG *) 0xFFFE401C) // (SPI1) Interrupt Mask Register +-#define AT91C_SPI1_IER ((AT91_REG *) 0xFFFE4014) // (SPI1) Interrupt Enable Register +-#define AT91C_SPI1_MR ((AT91_REG *) 0xFFFE4004) // (SPI1) Mode Register +-#define AT91C_SPI1_RDR ((AT91_REG *) 0xFFFE4008) // (SPI1) Receive Data Register +-#define AT91C_SPI1_IDR ((AT91_REG *) 0xFFFE4018) // (SPI1) Interrupt Disable Register +-#define AT91C_SPI1_SR ((AT91_REG *) 0xFFFE4010) // (SPI1) Status Register +-#define AT91C_SPI1_TDR ((AT91_REG *) 0xFFFE400C) // (SPI1) Transmit Data Register +-#define AT91C_SPI1_CR ((AT91_REG *) 0xFFFE4000) // (SPI1) Control Register +-#define AT91C_SPI1_CSR ((AT91_REG *) 0xFFFE4030) // (SPI1) Chip Select Register +-// ========== Register definition for PDC_SPI0 peripheral ========== +-#define AT91C_SPI0_PTCR ((AT91_REG *) 0xFFFE0120) // (PDC_SPI0) PDC Transfer Control Register +-#define AT91C_SPI0_TPR ((AT91_REG *) 0xFFFE0108) // (PDC_SPI0) Transmit Pointer Register +-#define AT91C_SPI0_TCR ((AT91_REG *) 0xFFFE010C) // (PDC_SPI0) Transmit Counter Register +-#define AT91C_SPI0_RCR ((AT91_REG *) 0xFFFE0104) // (PDC_SPI0) Receive Counter Register +-#define AT91C_SPI0_PTSR ((AT91_REG *) 0xFFFE0124) // (PDC_SPI0) PDC Transfer Status Register +-#define AT91C_SPI0_RNPR ((AT91_REG *) 0xFFFE0110) // (PDC_SPI0) Receive Next Pointer Register +-#define AT91C_SPI0_RPR ((AT91_REG *) 0xFFFE0100) // (PDC_SPI0) Receive Pointer Register +-#define AT91C_SPI0_TNCR ((AT91_REG *) 0xFFFE011C) // (PDC_SPI0) Transmit Next Counter Register +-#define AT91C_SPI0_RNCR ((AT91_REG *) 0xFFFE0114) // (PDC_SPI0) Receive Next Counter Register +-#define AT91C_SPI0_TNPR ((AT91_REG *) 0xFFFE0118) // (PDC_SPI0) Transmit Next Pointer Register +-// ========== Register definition for SPI0 peripheral ========== +-#define AT91C_SPI0_IER ((AT91_REG *) 0xFFFE0014) // (SPI0) Interrupt Enable Register +-#define AT91C_SPI0_SR ((AT91_REG *) 0xFFFE0010) // (SPI0) Status Register +-#define AT91C_SPI0_IDR ((AT91_REG *) 0xFFFE0018) // (SPI0) Interrupt Disable Register +-#define AT91C_SPI0_CR ((AT91_REG *) 0xFFFE0000) // (SPI0) Control Register +-#define AT91C_SPI0_MR ((AT91_REG *) 0xFFFE0004) // (SPI0) Mode Register +-#define AT91C_SPI0_IMR ((AT91_REG *) 0xFFFE001C) // (SPI0) Interrupt Mask Register +-#define AT91C_SPI0_TDR ((AT91_REG *) 0xFFFE000C) // (SPI0) Transmit Data Register +-#define AT91C_SPI0_RDR ((AT91_REG *) 0xFFFE0008) // (SPI0) Receive Data Register +-#define AT91C_SPI0_CSR ((AT91_REG *) 0xFFFE0030) // (SPI0) Chip Select Register +-// ========== Register definition for PDC_US1 peripheral ========== +-#define AT91C_US1_RNCR ((AT91_REG *) 0xFFFC4114) // (PDC_US1) Receive Next Counter Register +-#define AT91C_US1_PTCR ((AT91_REG *) 0xFFFC4120) // (PDC_US1) PDC Transfer Control Register +-#define AT91C_US1_TCR ((AT91_REG *) 0xFFFC410C) // (PDC_US1) Transmit Counter Register +-#define AT91C_US1_PTSR ((AT91_REG *) 0xFFFC4124) // (PDC_US1) PDC Transfer Status Register +-#define AT91C_US1_TNPR ((AT91_REG *) 0xFFFC4118) // (PDC_US1) Transmit Next Pointer Register +-#define AT91C_US1_RCR ((AT91_REG *) 0xFFFC4104) // (PDC_US1) Receive Counter Register +-#define AT91C_US1_RNPR ((AT91_REG *) 0xFFFC4110) // (PDC_US1) Receive Next Pointer Register +-#define AT91C_US1_RPR ((AT91_REG *) 0xFFFC4100) // (PDC_US1) Receive Pointer Register +-#define AT91C_US1_TNCR ((AT91_REG *) 0xFFFC411C) // (PDC_US1) Transmit Next Counter Register +-#define AT91C_US1_TPR ((AT91_REG *) 0xFFFC4108) // (PDC_US1) Transmit Pointer Register +-// ========== Register definition for US1 peripheral ========== +-#define AT91C_US1_IF ((AT91_REG *) 0xFFFC404C) // (US1) IRDA_FILTER Register +-#define AT91C_US1_NER ((AT91_REG *) 0xFFFC4044) // (US1) Nb Errors Register +-#define AT91C_US1_RTOR ((AT91_REG *) 0xFFFC4024) // (US1) Receiver Time-out Register +-#define AT91C_US1_CSR ((AT91_REG *) 0xFFFC4014) // (US1) Channel Status Register +-#define AT91C_US1_IDR ((AT91_REG *) 0xFFFC400C) // (US1) Interrupt Disable Register +-#define AT91C_US1_IER ((AT91_REG *) 0xFFFC4008) // (US1) Interrupt Enable Register +-#define AT91C_US1_THR ((AT91_REG *) 0xFFFC401C) // (US1) Transmitter Holding Register +-#define AT91C_US1_TTGR ((AT91_REG *) 0xFFFC4028) // (US1) Transmitter Time-guard Register +-#define AT91C_US1_RHR ((AT91_REG *) 0xFFFC4018) // (US1) Receiver Holding Register +-#define AT91C_US1_BRGR ((AT91_REG *) 0xFFFC4020) // (US1) Baud Rate Generator Register +-#define AT91C_US1_IMR ((AT91_REG *) 0xFFFC4010) // (US1) Interrupt Mask Register +-#define AT91C_US1_FIDI ((AT91_REG *) 0xFFFC4040) // (US1) FI_DI_Ratio Register +-#define AT91C_US1_CR ((AT91_REG *) 0xFFFC4000) // (US1) Control Register +-#define AT91C_US1_MR ((AT91_REG *) 0xFFFC4004) // (US1) Mode Register +-// ========== Register definition for PDC_US0 peripheral ========== +-#define AT91C_US0_TNPR ((AT91_REG *) 0xFFFC0118) // (PDC_US0) Transmit Next Pointer Register +-#define AT91C_US0_RNPR ((AT91_REG *) 0xFFFC0110) // (PDC_US0) Receive Next Pointer Register +-#define AT91C_US0_TCR ((AT91_REG *) 0xFFFC010C) // (PDC_US0) Transmit Counter Register +-#define AT91C_US0_PTCR ((AT91_REG *) 0xFFFC0120) // (PDC_US0) PDC Transfer Control Register +-#define AT91C_US0_PTSR ((AT91_REG *) 0xFFFC0124) // (PDC_US0) PDC Transfer Status Register +-#define AT91C_US0_TNCR ((AT91_REG *) 0xFFFC011C) // (PDC_US0) Transmit Next Counter Register +-#define AT91C_US0_TPR ((AT91_REG *) 0xFFFC0108) // (PDC_US0) Transmit Pointer Register +-#define AT91C_US0_RCR ((AT91_REG *) 0xFFFC0104) // (PDC_US0) Receive Counter Register +-#define AT91C_US0_RPR ((AT91_REG *) 0xFFFC0100) // (PDC_US0) Receive Pointer Register +-#define AT91C_US0_RNCR ((AT91_REG *) 0xFFFC0114) // (PDC_US0) Receive Next Counter Register +-// ========== Register definition for US0 peripheral ========== +-#define AT91C_US0_BRGR ((AT91_REG *) 0xFFFC0020) // (US0) Baud Rate Generator Register +-#define AT91C_US0_NER ((AT91_REG *) 0xFFFC0044) // (US0) Nb Errors Register +-#define AT91C_US0_CR ((AT91_REG *) 0xFFFC0000) // (US0) Control Register +-#define AT91C_US0_IMR ((AT91_REG *) 0xFFFC0010) // (US0) Interrupt Mask Register +-#define AT91C_US0_FIDI ((AT91_REG *) 0xFFFC0040) // (US0) FI_DI_Ratio Register +-#define AT91C_US0_TTGR ((AT91_REG *) 0xFFFC0028) // (US0) Transmitter Time-guard Register +-#define AT91C_US0_MR ((AT91_REG *) 0xFFFC0004) // (US0) Mode Register +-#define AT91C_US0_RTOR ((AT91_REG *) 0xFFFC0024) // (US0) Receiver Time-out Register +-#define AT91C_US0_CSR ((AT91_REG *) 0xFFFC0014) // (US0) Channel Status Register +-#define AT91C_US0_RHR ((AT91_REG *) 0xFFFC0018) // (US0) Receiver Holding Register +-#define AT91C_US0_IDR ((AT91_REG *) 0xFFFC000C) // (US0) Interrupt Disable Register +-#define AT91C_US0_THR ((AT91_REG *) 0xFFFC001C) // (US0) Transmitter Holding Register +-#define AT91C_US0_IF ((AT91_REG *) 0xFFFC004C) // (US0) IRDA_FILTER Register +-#define AT91C_US0_IER ((AT91_REG *) 0xFFFC0008) // (US0) Interrupt Enable Register +-// ========== Register definition for PDC_SSC peripheral ========== +-#define AT91C_SSC_TNCR ((AT91_REG *) 0xFFFD411C) // (PDC_SSC) Transmit Next Counter Register +-#define AT91C_SSC_RPR ((AT91_REG *) 0xFFFD4100) // (PDC_SSC) Receive Pointer Register +-#define AT91C_SSC_RNCR ((AT91_REG *) 0xFFFD4114) // (PDC_SSC) Receive Next Counter Register +-#define AT91C_SSC_TPR ((AT91_REG *) 0xFFFD4108) // (PDC_SSC) Transmit Pointer Register +-#define AT91C_SSC_PTCR ((AT91_REG *) 0xFFFD4120) // (PDC_SSC) PDC Transfer Control Register +-#define AT91C_SSC_TCR ((AT91_REG *) 0xFFFD410C) // (PDC_SSC) Transmit Counter Register +-#define AT91C_SSC_RCR ((AT91_REG *) 0xFFFD4104) // (PDC_SSC) Receive Counter Register +-#define AT91C_SSC_RNPR ((AT91_REG *) 0xFFFD4110) // (PDC_SSC) Receive Next Pointer Register +-#define AT91C_SSC_TNPR ((AT91_REG *) 0xFFFD4118) // (PDC_SSC) Transmit Next Pointer Register +-#define AT91C_SSC_PTSR ((AT91_REG *) 0xFFFD4124) // (PDC_SSC) PDC Transfer Status Register +-// ========== Register definition for SSC peripheral ========== +-#define AT91C_SSC_RHR ((AT91_REG *) 0xFFFD4020) // (SSC) Receive Holding Register +-#define AT91C_SSC_RSHR ((AT91_REG *) 0xFFFD4030) // (SSC) Receive Sync Holding Register +-#define AT91C_SSC_TFMR ((AT91_REG *) 0xFFFD401C) // (SSC) Transmit Frame Mode Register +-#define AT91C_SSC_IDR ((AT91_REG *) 0xFFFD4048) // (SSC) Interrupt Disable Register +-#define AT91C_SSC_THR ((AT91_REG *) 0xFFFD4024) // (SSC) Transmit Holding Register +-#define AT91C_SSC_RCMR ((AT91_REG *) 0xFFFD4010) // (SSC) Receive Clock ModeRegister +-#define AT91C_SSC_IER ((AT91_REG *) 0xFFFD4044) // (SSC) Interrupt Enable Register +-#define AT91C_SSC_TSHR ((AT91_REG *) 0xFFFD4034) // (SSC) Transmit Sync Holding Register +-#define AT91C_SSC_SR ((AT91_REG *) 0xFFFD4040) // (SSC) Status Register +-#define AT91C_SSC_CMR ((AT91_REG *) 0xFFFD4004) // (SSC) Clock Mode Register +-#define AT91C_SSC_TCMR ((AT91_REG *) 0xFFFD4018) // (SSC) Transmit Clock Mode Register +-#define AT91C_SSC_CR ((AT91_REG *) 0xFFFD4000) // (SSC) Control Register +-#define AT91C_SSC_IMR ((AT91_REG *) 0xFFFD404C) // (SSC) Interrupt Mask Register +-#define AT91C_SSC_RFMR ((AT91_REG *) 0xFFFD4014) // (SSC) Receive Frame Mode Register +-// ========== Register definition for TWI peripheral ========== +-#define AT91C_TWI_IER ((AT91_REG *) 0xFFFB8024) // (TWI) Interrupt Enable Register +-#define AT91C_TWI_CR ((AT91_REG *) 0xFFFB8000) // (TWI) Control Register +-#define AT91C_TWI_SR ((AT91_REG *) 0xFFFB8020) // (TWI) Status Register +-#define AT91C_TWI_IMR ((AT91_REG *) 0xFFFB802C) // (TWI) Interrupt Mask Register +-#define AT91C_TWI_THR ((AT91_REG *) 0xFFFB8034) // (TWI) Transmit Holding Register +-#define AT91C_TWI_IDR ((AT91_REG *) 0xFFFB8028) // (TWI) Interrupt Disable Register +-#define AT91C_TWI_IADR ((AT91_REG *) 0xFFFB800C) // (TWI) Internal Address Register +-#define AT91C_TWI_MMR ((AT91_REG *) 0xFFFB8004) // (TWI) Master Mode Register +-#define AT91C_TWI_CWGR ((AT91_REG *) 0xFFFB8010) // (TWI) Clock Waveform Generator Register +-#define AT91C_TWI_RHR ((AT91_REG *) 0xFFFB8030) // (TWI) Receive Holding Register +-// ========== Register definition for PWMC_CH3 peripheral ========== +-#define AT91C_PWMC_CH3_CUPDR ((AT91_REG *) 0xFFFCC270) // (PWMC_CH3) Channel Update Register +-#define AT91C_PWMC_CH3_Reserved ((AT91_REG *) 0xFFFCC274) // (PWMC_CH3) Reserved +-#define AT91C_PWMC_CH3_CPRDR ((AT91_REG *) 0xFFFCC268) // (PWMC_CH3) Channel Period Register +-#define AT91C_PWMC_CH3_CDTYR ((AT91_REG *) 0xFFFCC264) // (PWMC_CH3) Channel Duty Cycle Register +-#define AT91C_PWMC_CH3_CCNTR ((AT91_REG *) 0xFFFCC26C) // (PWMC_CH3) Channel Counter Register +-#define AT91C_PWMC_CH3_CMR ((AT91_REG *) 0xFFFCC260) // (PWMC_CH3) Channel Mode Register +-// ========== Register definition for PWMC_CH2 peripheral ========== +-#define AT91C_PWMC_CH2_Reserved ((AT91_REG *) 0xFFFCC254) // (PWMC_CH2) Reserved +-#define AT91C_PWMC_CH2_CMR ((AT91_REG *) 0xFFFCC240) // (PWMC_CH2) Channel Mode Register +-#define AT91C_PWMC_CH2_CCNTR ((AT91_REG *) 0xFFFCC24C) // (PWMC_CH2) Channel Counter Register +-#define AT91C_PWMC_CH2_CPRDR ((AT91_REG *) 0xFFFCC248) // (PWMC_CH2) Channel Period Register +-#define AT91C_PWMC_CH2_CUPDR ((AT91_REG *) 0xFFFCC250) // (PWMC_CH2) Channel Update Register +-#define AT91C_PWMC_CH2_CDTYR ((AT91_REG *) 0xFFFCC244) // (PWMC_CH2) Channel Duty Cycle Register +-// ========== Register definition for PWMC_CH1 peripheral ========== +-#define AT91C_PWMC_CH1_Reserved ((AT91_REG *) 0xFFFCC234) // (PWMC_CH1) Reserved +-#define AT91C_PWMC_CH1_CUPDR ((AT91_REG *) 0xFFFCC230) // (PWMC_CH1) Channel Update Register +-#define AT91C_PWMC_CH1_CPRDR ((AT91_REG *) 0xFFFCC228) // (PWMC_CH1) Channel Period Register +-#define AT91C_PWMC_CH1_CCNTR ((AT91_REG *) 0xFFFCC22C) // (PWMC_CH1) Channel Counter Register +-#define AT91C_PWMC_CH1_CDTYR ((AT91_REG *) 0xFFFCC224) // (PWMC_CH1) Channel Duty Cycle Register +-#define AT91C_PWMC_CH1_CMR ((AT91_REG *) 0xFFFCC220) // (PWMC_CH1) Channel Mode Register +-// ========== Register definition for PWMC_CH0 peripheral ========== +-#define AT91C_PWMC_CH0_Reserved ((AT91_REG *) 0xFFFCC214) // (PWMC_CH0) Reserved +-#define AT91C_PWMC_CH0_CPRDR ((AT91_REG *) 0xFFFCC208) // (PWMC_CH0) Channel Period Register +-#define AT91C_PWMC_CH0_CDTYR ((AT91_REG *) 0xFFFCC204) // (PWMC_CH0) Channel Duty Cycle Register +-#define AT91C_PWMC_CH0_CMR ((AT91_REG *) 0xFFFCC200) // (PWMC_CH0) Channel Mode Register +-#define AT91C_PWMC_CH0_CUPDR ((AT91_REG *) 0xFFFCC210) // (PWMC_CH0) Channel Update Register +-#define AT91C_PWMC_CH0_CCNTR ((AT91_REG *) 0xFFFCC20C) // (PWMC_CH0) Channel Counter Register +-// ========== Register definition for PWMC peripheral ========== +-#define AT91C_PWMC_IDR ((AT91_REG *) 0xFFFCC014) // (PWMC) PWMC Interrupt Disable Register +-#define AT91C_PWMC_DIS ((AT91_REG *) 0xFFFCC008) // (PWMC) PWMC Disable Register +-#define AT91C_PWMC_IER ((AT91_REG *) 0xFFFCC010) // (PWMC) PWMC Interrupt Enable Register +-#define AT91C_PWMC_VR ((AT91_REG *) 0xFFFCC0FC) // (PWMC) PWMC Version Register +-#define AT91C_PWMC_ISR ((AT91_REG *) 0xFFFCC01C) // (PWMC) PWMC Interrupt Status Register +-#define AT91C_PWMC_SR ((AT91_REG *) 0xFFFCC00C) // (PWMC) PWMC Status Register +-#define AT91C_PWMC_IMR ((AT91_REG *) 0xFFFCC018) // (PWMC) PWMC Interrupt Mask Register +-#define AT91C_PWMC_MR ((AT91_REG *) 0xFFFCC000) // (PWMC) PWMC Mode Register +-#define AT91C_PWMC_ENA ((AT91_REG *) 0xFFFCC004) // (PWMC) PWMC Enable Register +-// ========== Register definition for UDP peripheral ========== +-#define AT91C_UDP_IMR ((AT91_REG *) 0xFFFB0018) // (UDP) Interrupt Mask Register +-#define AT91C_UDP_FADDR ((AT91_REG *) 0xFFFB0008) // (UDP) Function Address Register +-#define AT91C_UDP_NUM ((AT91_REG *) 0xFFFB0000) // (UDP) Frame Number Register +-#define AT91C_UDP_FDR ((AT91_REG *) 0xFFFB0050) // (UDP) Endpoint FIFO Data Register +-#define AT91C_UDP_ISR ((AT91_REG *) 0xFFFB001C) // (UDP) Interrupt Status Register +-#define AT91C_UDP_CSR ((AT91_REG *) 0xFFFB0030) // (UDP) Endpoint Control and Status Register +-#define AT91C_UDP_IDR ((AT91_REG *) 0xFFFB0014) // (UDP) Interrupt Disable Register +-#define AT91C_UDP_ICR ((AT91_REG *) 0xFFFB0020) // (UDP) Interrupt Clear Register +-#define AT91C_UDP_RSTEP ((AT91_REG *) 0xFFFB0028) // (UDP) Reset Endpoint Register +-#define AT91C_UDP_TXVC ((AT91_REG *) 0xFFFB0074) // (UDP) Transceiver Control Register +-#define AT91C_UDP_GLBSTATE ((AT91_REG *) 0xFFFB0004) // (UDP) Global State Register +-#define AT91C_UDP_IER ((AT91_REG *) 0xFFFB0010) // (UDP) Interrupt Enable Register +-// ========== Register definition for TC0 peripheral ========== +-#define AT91C_TC0_SR ((AT91_REG *) 0xFFFA0020) // (TC0) Status Register +-#define AT91C_TC0_RC ((AT91_REG *) 0xFFFA001C) // (TC0) Register C +-#define AT91C_TC0_RB ((AT91_REG *) 0xFFFA0018) // (TC0) Register B +-#define AT91C_TC0_CCR ((AT91_REG *) 0xFFFA0000) // (TC0) Channel Control Register +-#define AT91C_TC0_CMR ((AT91_REG *) 0xFFFA0004) // (TC0) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC0_IER ((AT91_REG *) 0xFFFA0024) // (TC0) Interrupt Enable Register +-#define AT91C_TC0_RA ((AT91_REG *) 0xFFFA0014) // (TC0) Register A +-#define AT91C_TC0_IDR ((AT91_REG *) 0xFFFA0028) // (TC0) Interrupt Disable Register +-#define AT91C_TC0_CV ((AT91_REG *) 0xFFFA0010) // (TC0) Counter Value +-#define AT91C_TC0_IMR ((AT91_REG *) 0xFFFA002C) // (TC0) Interrupt Mask Register +-// ========== Register definition for TC1 peripheral ========== +-#define AT91C_TC1_RB ((AT91_REG *) 0xFFFA0058) // (TC1) Register B +-#define AT91C_TC1_CCR ((AT91_REG *) 0xFFFA0040) // (TC1) Channel Control Register +-#define AT91C_TC1_IER ((AT91_REG *) 0xFFFA0064) // (TC1) Interrupt Enable Register +-#define AT91C_TC1_IDR ((AT91_REG *) 0xFFFA0068) // (TC1) Interrupt Disable Register +-#define AT91C_TC1_SR ((AT91_REG *) 0xFFFA0060) // (TC1) Status Register +-#define AT91C_TC1_CMR ((AT91_REG *) 0xFFFA0044) // (TC1) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC1_RA ((AT91_REG *) 0xFFFA0054) // (TC1) Register A +-#define AT91C_TC1_RC ((AT91_REG *) 0xFFFA005C) // (TC1) Register C +-#define AT91C_TC1_IMR ((AT91_REG *) 0xFFFA006C) // (TC1) Interrupt Mask Register +-#define AT91C_TC1_CV ((AT91_REG *) 0xFFFA0050) // (TC1) Counter Value +-// ========== Register definition for TC2 peripheral ========== +-#define AT91C_TC2_CMR ((AT91_REG *) 0xFFFA0084) // (TC2) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC2_CCR ((AT91_REG *) 0xFFFA0080) // (TC2) Channel Control Register +-#define AT91C_TC2_CV ((AT91_REG *) 0xFFFA0090) // (TC2) Counter Value +-#define AT91C_TC2_RA ((AT91_REG *) 0xFFFA0094) // (TC2) Register A +-#define AT91C_TC2_RB ((AT91_REG *) 0xFFFA0098) // (TC2) Register B +-#define AT91C_TC2_IDR ((AT91_REG *) 0xFFFA00A8) // (TC2) Interrupt Disable Register +-#define AT91C_TC2_IMR ((AT91_REG *) 0xFFFA00AC) // (TC2) Interrupt Mask Register +-#define AT91C_TC2_RC ((AT91_REG *) 0xFFFA009C) // (TC2) Register C +-#define AT91C_TC2_IER ((AT91_REG *) 0xFFFA00A4) // (TC2) Interrupt Enable Register +-#define AT91C_TC2_SR ((AT91_REG *) 0xFFFA00A0) // (TC2) Status Register +-// ========== Register definition for TCB peripheral ========== +-#define AT91C_TCB_BMR ((AT91_REG *) 0xFFFA00C4) // (TCB) TC Block Mode Register +-#define AT91C_TCB_BCR ((AT91_REG *) 0xFFFA00C0) // (TCB) TC Block Control Register +-// ========== Register definition for CAN_MB0 peripheral ========== +-#define AT91C_CAN_MB0_MDL ((AT91_REG *) 0xFFFD0214) // (CAN_MB0) MailBox Data Low Register +-#define AT91C_CAN_MB0_MAM ((AT91_REG *) 0xFFFD0204) // (CAN_MB0) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB0_MCR ((AT91_REG *) 0xFFFD021C) // (CAN_MB0) MailBox Control Register +-#define AT91C_CAN_MB0_MID ((AT91_REG *) 0xFFFD0208) // (CAN_MB0) MailBox ID Register +-#define AT91C_CAN_MB0_MSR ((AT91_REG *) 0xFFFD0210) // (CAN_MB0) MailBox Status Register +-#define AT91C_CAN_MB0_MFID ((AT91_REG *) 0xFFFD020C) // (CAN_MB0) MailBox Family ID Register +-#define AT91C_CAN_MB0_MDH ((AT91_REG *) 0xFFFD0218) // (CAN_MB0) MailBox Data High Register +-#define AT91C_CAN_MB0_MMR ((AT91_REG *) 0xFFFD0200) // (CAN_MB0) MailBox Mode Register +-// ========== Register definition for CAN_MB1 peripheral ========== +-#define AT91C_CAN_MB1_MDL ((AT91_REG *) 0xFFFD0234) // (CAN_MB1) MailBox Data Low Register +-#define AT91C_CAN_MB1_MID ((AT91_REG *) 0xFFFD0228) // (CAN_MB1) MailBox ID Register +-#define AT91C_CAN_MB1_MMR ((AT91_REG *) 0xFFFD0220) // (CAN_MB1) MailBox Mode Register +-#define AT91C_CAN_MB1_MSR ((AT91_REG *) 0xFFFD0230) // (CAN_MB1) MailBox Status Register +-#define AT91C_CAN_MB1_MAM ((AT91_REG *) 0xFFFD0224) // (CAN_MB1) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB1_MDH ((AT91_REG *) 0xFFFD0238) // (CAN_MB1) MailBox Data High Register +-#define AT91C_CAN_MB1_MCR ((AT91_REG *) 0xFFFD023C) // (CAN_MB1) MailBox Control Register +-#define AT91C_CAN_MB1_MFID ((AT91_REG *) 0xFFFD022C) // (CAN_MB1) MailBox Family ID Register +-// ========== Register definition for CAN_MB2 peripheral ========== +-#define AT91C_CAN_MB2_MCR ((AT91_REG *) 0xFFFD025C) // (CAN_MB2) MailBox Control Register +-#define AT91C_CAN_MB2_MDH ((AT91_REG *) 0xFFFD0258) // (CAN_MB2) MailBox Data High Register +-#define AT91C_CAN_MB2_MID ((AT91_REG *) 0xFFFD0248) // (CAN_MB2) MailBox ID Register +-#define AT91C_CAN_MB2_MDL ((AT91_REG *) 0xFFFD0254) // (CAN_MB2) MailBox Data Low Register +-#define AT91C_CAN_MB2_MMR ((AT91_REG *) 0xFFFD0240) // (CAN_MB2) MailBox Mode Register +-#define AT91C_CAN_MB2_MAM ((AT91_REG *) 0xFFFD0244) // (CAN_MB2) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB2_MFID ((AT91_REG *) 0xFFFD024C) // (CAN_MB2) MailBox Family ID Register +-#define AT91C_CAN_MB2_MSR ((AT91_REG *) 0xFFFD0250) // (CAN_MB2) MailBox Status Register +-// ========== Register definition for CAN_MB3 peripheral ========== +-#define AT91C_CAN_MB3_MFID ((AT91_REG *) 0xFFFD026C) // (CAN_MB3) MailBox Family ID Register +-#define AT91C_CAN_MB3_MAM ((AT91_REG *) 0xFFFD0264) // (CAN_MB3) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB3_MID ((AT91_REG *) 0xFFFD0268) // (CAN_MB3) MailBox ID Register +-#define AT91C_CAN_MB3_MCR ((AT91_REG *) 0xFFFD027C) // (CAN_MB3) MailBox Control Register +-#define AT91C_CAN_MB3_MMR ((AT91_REG *) 0xFFFD0260) // (CAN_MB3) MailBox Mode Register +-#define AT91C_CAN_MB3_MSR ((AT91_REG *) 0xFFFD0270) // (CAN_MB3) MailBox Status Register +-#define AT91C_CAN_MB3_MDL ((AT91_REG *) 0xFFFD0274) // (CAN_MB3) MailBox Data Low Register +-#define AT91C_CAN_MB3_MDH ((AT91_REG *) 0xFFFD0278) // (CAN_MB3) MailBox Data High Register +-// ========== Register definition for CAN_MB4 peripheral ========== +-#define AT91C_CAN_MB4_MID ((AT91_REG *) 0xFFFD0288) // (CAN_MB4) MailBox ID Register +-#define AT91C_CAN_MB4_MMR ((AT91_REG *) 0xFFFD0280) // (CAN_MB4) MailBox Mode Register +-#define AT91C_CAN_MB4_MDH ((AT91_REG *) 0xFFFD0298) // (CAN_MB4) MailBox Data High Register +-#define AT91C_CAN_MB4_MFID ((AT91_REG *) 0xFFFD028C) // (CAN_MB4) MailBox Family ID Register +-#define AT91C_CAN_MB4_MSR ((AT91_REG *) 0xFFFD0290) // (CAN_MB4) MailBox Status Register +-#define AT91C_CAN_MB4_MCR ((AT91_REG *) 0xFFFD029C) // (CAN_MB4) MailBox Control Register +-#define AT91C_CAN_MB4_MDL ((AT91_REG *) 0xFFFD0294) // (CAN_MB4) MailBox Data Low Register +-#define AT91C_CAN_MB4_MAM ((AT91_REG *) 0xFFFD0284) // (CAN_MB4) MailBox Acceptance Mask Register +-// ========== Register definition for CAN_MB5 peripheral ========== +-#define AT91C_CAN_MB5_MSR ((AT91_REG *) 0xFFFD02B0) // (CAN_MB5) MailBox Status Register +-#define AT91C_CAN_MB5_MCR ((AT91_REG *) 0xFFFD02BC) // (CAN_MB5) MailBox Control Register +-#define AT91C_CAN_MB5_MFID ((AT91_REG *) 0xFFFD02AC) // (CAN_MB5) MailBox Family ID Register +-#define AT91C_CAN_MB5_MDH ((AT91_REG *) 0xFFFD02B8) // (CAN_MB5) MailBox Data High Register +-#define AT91C_CAN_MB5_MID ((AT91_REG *) 0xFFFD02A8) // (CAN_MB5) MailBox ID Register +-#define AT91C_CAN_MB5_MMR ((AT91_REG *) 0xFFFD02A0) // (CAN_MB5) MailBox Mode Register +-#define AT91C_CAN_MB5_MDL ((AT91_REG *) 0xFFFD02B4) // (CAN_MB5) MailBox Data Low Register +-#define AT91C_CAN_MB5_MAM ((AT91_REG *) 0xFFFD02A4) // (CAN_MB5) MailBox Acceptance Mask Register +-// ========== Register definition for CAN_MB6 peripheral ========== +-#define AT91C_CAN_MB6_MFID ((AT91_REG *) 0xFFFD02CC) // (CAN_MB6) MailBox Family ID Register +-#define AT91C_CAN_MB6_MID ((AT91_REG *) 0xFFFD02C8) // (CAN_MB6) MailBox ID Register +-#define AT91C_CAN_MB6_MAM ((AT91_REG *) 0xFFFD02C4) // (CAN_MB6) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB6_MSR ((AT91_REG *) 0xFFFD02D0) // (CAN_MB6) MailBox Status Register +-#define AT91C_CAN_MB6_MDL ((AT91_REG *) 0xFFFD02D4) // (CAN_MB6) MailBox Data Low Register +-#define AT91C_CAN_MB6_MCR ((AT91_REG *) 0xFFFD02DC) // (CAN_MB6) MailBox Control Register +-#define AT91C_CAN_MB6_MDH ((AT91_REG *) 0xFFFD02D8) // (CAN_MB6) MailBox Data High Register +-#define AT91C_CAN_MB6_MMR ((AT91_REG *) 0xFFFD02C0) // (CAN_MB6) MailBox Mode Register +-// ========== Register definition for CAN_MB7 peripheral ========== +-#define AT91C_CAN_MB7_MCR ((AT91_REG *) 0xFFFD02FC) // (CAN_MB7) MailBox Control Register +-#define AT91C_CAN_MB7_MDH ((AT91_REG *) 0xFFFD02F8) // (CAN_MB7) MailBox Data High Register +-#define AT91C_CAN_MB7_MFID ((AT91_REG *) 0xFFFD02EC) // (CAN_MB7) MailBox Family ID Register +-#define AT91C_CAN_MB7_MDL ((AT91_REG *) 0xFFFD02F4) // (CAN_MB7) MailBox Data Low Register +-#define AT91C_CAN_MB7_MID ((AT91_REG *) 0xFFFD02E8) // (CAN_MB7) MailBox ID Register +-#define AT91C_CAN_MB7_MMR ((AT91_REG *) 0xFFFD02E0) // (CAN_MB7) MailBox Mode Register +-#define AT91C_CAN_MB7_MAM ((AT91_REG *) 0xFFFD02E4) // (CAN_MB7) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB7_MSR ((AT91_REG *) 0xFFFD02F0) // (CAN_MB7) MailBox Status Register +-// ========== Register definition for CAN peripheral ========== +-#define AT91C_CAN_TCR ((AT91_REG *) 0xFFFD0024) // (CAN) Transfer Command Register +-#define AT91C_CAN_IMR ((AT91_REG *) 0xFFFD000C) // (CAN) Interrupt Mask Register +-#define AT91C_CAN_IER ((AT91_REG *) 0xFFFD0004) // (CAN) Interrupt Enable Register +-#define AT91C_CAN_ECR ((AT91_REG *) 0xFFFD0020) // (CAN) Error Counter Register +-#define AT91C_CAN_TIMESTP ((AT91_REG *) 0xFFFD001C) // (CAN) Time Stamp Register +-#define AT91C_CAN_MR ((AT91_REG *) 0xFFFD0000) // (CAN) Mode Register +-#define AT91C_CAN_IDR ((AT91_REG *) 0xFFFD0008) // (CAN) Interrupt Disable Register +-#define AT91C_CAN_ACR ((AT91_REG *) 0xFFFD0028) // (CAN) Abort Command Register +-#define AT91C_CAN_TIM ((AT91_REG *) 0xFFFD0018) // (CAN) Timer Register +-#define AT91C_CAN_SR ((AT91_REG *) 0xFFFD0010) // (CAN) Status Register +-#define AT91C_CAN_BR ((AT91_REG *) 0xFFFD0014) // (CAN) Baudrate Register +-#define AT91C_CAN_VR ((AT91_REG *) 0xFFFD00FC) // (CAN) Version Register +-// ========== Register definition for EMAC peripheral ========== +-#define AT91C_EMAC_ISR ((AT91_REG *) 0xFFFDC024) // (EMAC) Interrupt Status Register +-#define AT91C_EMAC_SA4H ((AT91_REG *) 0xFFFDC0B4) // (EMAC) Specific Address 4 Top, Last 2 bytes +-#define AT91C_EMAC_SA1L ((AT91_REG *) 0xFFFDC098) // (EMAC) Specific Address 1 Bottom, First 4 bytes +-#define AT91C_EMAC_ELE ((AT91_REG *) 0xFFFDC078) // (EMAC) Excessive Length Errors Register +-#define AT91C_EMAC_LCOL ((AT91_REG *) 0xFFFDC05C) // (EMAC) Late Collision Register +-#define AT91C_EMAC_RLE ((AT91_REG *) 0xFFFDC088) // (EMAC) Receive Length Field Mismatch Register +-#define AT91C_EMAC_WOL ((AT91_REG *) 0xFFFDC0C4) // (EMAC) Wake On LAN Register +-#define AT91C_EMAC_DTF ((AT91_REG *) 0xFFFDC058) // (EMAC) Deferred Transmission Frame Register +-#define AT91C_EMAC_TUND ((AT91_REG *) 0xFFFDC064) // (EMAC) Transmit Underrun Error Register +-#define AT91C_EMAC_NCR ((AT91_REG *) 0xFFFDC000) // (EMAC) Network Control Register +-#define AT91C_EMAC_SA4L ((AT91_REG *) 0xFFFDC0B0) // (EMAC) Specific Address 4 Bottom, First 4 bytes +-#define AT91C_EMAC_RSR ((AT91_REG *) 0xFFFDC020) // (EMAC) Receive Status Register +-#define AT91C_EMAC_SA3L ((AT91_REG *) 0xFFFDC0A8) // (EMAC) Specific Address 3 Bottom, First 4 bytes +-#define AT91C_EMAC_TSR ((AT91_REG *) 0xFFFDC014) // (EMAC) Transmit Status Register +-#define AT91C_EMAC_IDR ((AT91_REG *) 0xFFFDC02C) // (EMAC) Interrupt Disable Register +-#define AT91C_EMAC_RSE ((AT91_REG *) 0xFFFDC074) // (EMAC) Receive Symbol Errors Register +-#define AT91C_EMAC_ECOL ((AT91_REG *) 0xFFFDC060) // (EMAC) Excessive Collision Register +-#define AT91C_EMAC_TID ((AT91_REG *) 0xFFFDC0B8) // (EMAC) Type ID Checking Register +-#define AT91C_EMAC_HRB ((AT91_REG *) 0xFFFDC090) // (EMAC) Hash Address Bottom[31:0] +-#define AT91C_EMAC_TBQP ((AT91_REG *) 0xFFFDC01C) // (EMAC) Transmit Buffer Queue Pointer +-#define AT91C_EMAC_USRIO ((AT91_REG *) 0xFFFDC0C0) // (EMAC) USER Input/Output Register +-#define AT91C_EMAC_PTR ((AT91_REG *) 0xFFFDC038) // (EMAC) Pause Time Register +-#define AT91C_EMAC_SA2H ((AT91_REG *) 0xFFFDC0A4) // (EMAC) Specific Address 2 Top, Last 2 bytes +-#define AT91C_EMAC_ROV ((AT91_REG *) 0xFFFDC070) // (EMAC) Receive Overrun Errors Register +-#define AT91C_EMAC_ALE ((AT91_REG *) 0xFFFDC054) // (EMAC) Alignment Error Register +-#define AT91C_EMAC_RJA ((AT91_REG *) 0xFFFDC07C) // (EMAC) Receive Jabbers Register +-#define AT91C_EMAC_RBQP ((AT91_REG *) 0xFFFDC018) // (EMAC) Receive Buffer Queue Pointer +-#define AT91C_EMAC_TPF ((AT91_REG *) 0xFFFDC08C) // (EMAC) Transmitted Pause Frames Register +-#define AT91C_EMAC_NCFGR ((AT91_REG *) 0xFFFDC004) // (EMAC) Network Configuration Register +-#define AT91C_EMAC_HRT ((AT91_REG *) 0xFFFDC094) // (EMAC) Hash Address Top[63:32] +-#define AT91C_EMAC_USF ((AT91_REG *) 0xFFFDC080) // (EMAC) Undersize Frames Register +-#define AT91C_EMAC_FCSE ((AT91_REG *) 0xFFFDC050) // (EMAC) Frame Check Sequence Error Register +-#define AT91C_EMAC_TPQ ((AT91_REG *) 0xFFFDC0BC) // (EMAC) Transmit Pause Quantum Register +-#define AT91C_EMAC_MAN ((AT91_REG *) 0xFFFDC034) // (EMAC) PHY Maintenance Register +-#define AT91C_EMAC_FTO ((AT91_REG *) 0xFFFDC040) // (EMAC) Frames Transmitted OK Register +-#define AT91C_EMAC_REV ((AT91_REG *) 0xFFFDC0FC) // (EMAC) Revision Register +-#define AT91C_EMAC_IMR ((AT91_REG *) 0xFFFDC030) // (EMAC) Interrupt Mask Register +-#define AT91C_EMAC_SCF ((AT91_REG *) 0xFFFDC044) // (EMAC) Single Collision Frame Register +-#define AT91C_EMAC_PFR ((AT91_REG *) 0xFFFDC03C) // (EMAC) Pause Frames received Register +-#define AT91C_EMAC_MCF ((AT91_REG *) 0xFFFDC048) // (EMAC) Multiple Collision Frame Register +-#define AT91C_EMAC_NSR ((AT91_REG *) 0xFFFDC008) // (EMAC) Network Status Register +-#define AT91C_EMAC_SA2L ((AT91_REG *) 0xFFFDC0A0) // (EMAC) Specific Address 2 Bottom, First 4 bytes +-#define AT91C_EMAC_FRO ((AT91_REG *) 0xFFFDC04C) // (EMAC) Frames Received OK Register +-#define AT91C_EMAC_IER ((AT91_REG *) 0xFFFDC028) // (EMAC) Interrupt Enable Register +-#define AT91C_EMAC_SA1H ((AT91_REG *) 0xFFFDC09C) // (EMAC) Specific Address 1 Top, Last 2 bytes +-#define AT91C_EMAC_CSE ((AT91_REG *) 0xFFFDC068) // (EMAC) Carrier Sense Error Register +-#define AT91C_EMAC_SA3H ((AT91_REG *) 0xFFFDC0AC) // (EMAC) Specific Address 3 Top, Last 2 bytes +-#define AT91C_EMAC_RRE ((AT91_REG *) 0xFFFDC06C) // (EMAC) Receive Ressource Error Register +-#define AT91C_EMAC_STE ((AT91_REG *) 0xFFFDC084) // (EMAC) SQE Test Error Register +-// ========== Register definition for PDC_ADC peripheral ========== +-#define AT91C_ADC_PTSR ((AT91_REG *) 0xFFFD8124) // (PDC_ADC) PDC Transfer Status Register +-#define AT91C_ADC_PTCR ((AT91_REG *) 0xFFFD8120) // (PDC_ADC) PDC Transfer Control Register +-#define AT91C_ADC_TNPR ((AT91_REG *) 0xFFFD8118) // (PDC_ADC) Transmit Next Pointer Register +-#define AT91C_ADC_TNCR ((AT91_REG *) 0xFFFD811C) // (PDC_ADC) Transmit Next Counter Register +-#define AT91C_ADC_RNPR ((AT91_REG *) 0xFFFD8110) // (PDC_ADC) Receive Next Pointer Register +-#define AT91C_ADC_RNCR ((AT91_REG *) 0xFFFD8114) // (PDC_ADC) Receive Next Counter Register +-#define AT91C_ADC_RPR ((AT91_REG *) 0xFFFD8100) // (PDC_ADC) Receive Pointer Register +-#define AT91C_ADC_TCR ((AT91_REG *) 0xFFFD810C) // (PDC_ADC) Transmit Counter Register +-#define AT91C_ADC_TPR ((AT91_REG *) 0xFFFD8108) // (PDC_ADC) Transmit Pointer Register +-#define AT91C_ADC_RCR ((AT91_REG *) 0xFFFD8104) // (PDC_ADC) Receive Counter Register +-// ========== Register definition for ADC peripheral ========== +-#define AT91C_ADC_CDR2 ((AT91_REG *) 0xFFFD8038) // (ADC) ADC Channel Data Register 2 +-#define AT91C_ADC_CDR3 ((AT91_REG *) 0xFFFD803C) // (ADC) ADC Channel Data Register 3 +-#define AT91C_ADC_CDR0 ((AT91_REG *) 0xFFFD8030) // (ADC) ADC Channel Data Register 0 +-#define AT91C_ADC_CDR5 ((AT91_REG *) 0xFFFD8044) // (ADC) ADC Channel Data Register 5 +-#define AT91C_ADC_CHDR ((AT91_REG *) 0xFFFD8014) // (ADC) ADC Channel Disable Register +-#define AT91C_ADC_SR ((AT91_REG *) 0xFFFD801C) // (ADC) ADC Status Register +-#define AT91C_ADC_CDR4 ((AT91_REG *) 0xFFFD8040) // (ADC) ADC Channel Data Register 4 +-#define AT91C_ADC_CDR1 ((AT91_REG *) 0xFFFD8034) // (ADC) ADC Channel Data Register 1 +-#define AT91C_ADC_LCDR ((AT91_REG *) 0xFFFD8020) // (ADC) ADC Last Converted Data Register +-#define AT91C_ADC_IDR ((AT91_REG *) 0xFFFD8028) // (ADC) ADC Interrupt Disable Register +-#define AT91C_ADC_CR ((AT91_REG *) 0xFFFD8000) // (ADC) ADC Control Register +-#define AT91C_ADC_CDR7 ((AT91_REG *) 0xFFFD804C) // (ADC) ADC Channel Data Register 7 +-#define AT91C_ADC_CDR6 ((AT91_REG *) 0xFFFD8048) // (ADC) ADC Channel Data Register 6 +-#define AT91C_ADC_IER ((AT91_REG *) 0xFFFD8024) // (ADC) ADC Interrupt Enable Register +-#define AT91C_ADC_CHER ((AT91_REG *) 0xFFFD8010) // (ADC) ADC Channel Enable Register +-#define AT91C_ADC_CHSR ((AT91_REG *) 0xFFFD8018) // (ADC) ADC Channel Status Register +-#define AT91C_ADC_MR ((AT91_REG *) 0xFFFD8004) // (ADC) ADC Mode Register +-#define AT91C_ADC_IMR ((AT91_REG *) 0xFFFD802C) // (ADC) ADC Interrupt Mask Register +- +-// ***************************************************************************** +-// PIO DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_PIO_PA0 ((unsigned int) 1 << 0) // Pin Controlled by PA0 +-#define AT91C_PA0_RXD0 ((unsigned int) AT91C_PIO_PA0) // USART 0 Receive Data +-#define AT91C_PIO_PA1 ((unsigned int) 1 << 1) // Pin Controlled by PA1 +-#define AT91C_PA1_TXD0 ((unsigned int) AT91C_PIO_PA1) // USART 0 Transmit Data +-#define AT91C_PIO_PA10 ((unsigned int) 1 << 10) // Pin Controlled by PA10 +-#define AT91C_PA10_TWD ((unsigned int) AT91C_PIO_PA10) // TWI Two-wire Serial Data +-#define AT91C_PIO_PA11 ((unsigned int) 1 << 11) // Pin Controlled by PA11 +-#define AT91C_PA11_TWCK ((unsigned int) AT91C_PIO_PA11) // TWI Two-wire Serial Clock +-#define AT91C_PIO_PA12 ((unsigned int) 1 << 12) // Pin Controlled by PA12 +-#define AT91C_PA12_SPI0_NPCS0 ((unsigned int) AT91C_PIO_PA12) // SPI 0 Peripheral Chip Select 0 +-#define AT91C_PIO_PA13 ((unsigned int) 1 << 13) // Pin Controlled by PA13 +-#define AT91C_PA13_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PA13) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PA13_PCK1 ((unsigned int) AT91C_PIO_PA13) // PMC Programmable Clock Output 1 +-#define AT91C_PIO_PA14 ((unsigned int) 1 << 14) // Pin Controlled by PA14 +-#define AT91C_PA14_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PA14) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PA14_IRQ1 ((unsigned int) AT91C_PIO_PA14) // External Interrupt 1 +-#define AT91C_PIO_PA15 ((unsigned int) 1 << 15) // Pin Controlled by PA15 +-#define AT91C_PA15_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PA15) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PA15_TCLK2 ((unsigned int) AT91C_PIO_PA15) // Timer Counter 2 external clock input +-#define AT91C_PIO_PA16 ((unsigned int) 1 << 16) // Pin Controlled by PA16 +-#define AT91C_PA16_SPI0_MISO ((unsigned int) AT91C_PIO_PA16) // SPI 0 Master In Slave +-#define AT91C_PIO_PA17 ((unsigned int) 1 << 17) // Pin Controlled by PA17 +-#define AT91C_PA17_SPI0_MOSI ((unsigned int) AT91C_PIO_PA17) // SPI 0 Master Out Slave +-#define AT91C_PIO_PA18 ((unsigned int) 1 << 18) // Pin Controlled by PA18 +-#define AT91C_PA18_SPI0_SPCK ((unsigned int) AT91C_PIO_PA18) // SPI 0 Serial Clock +-#define AT91C_PIO_PA19 ((unsigned int) 1 << 19) // Pin Controlled by PA19 +-#define AT91C_PA19_CANRX ((unsigned int) AT91C_PIO_PA19) // CAN Receive +-#define AT91C_PIO_PA2 ((unsigned int) 1 << 2) // Pin Controlled by PA2 +-#define AT91C_PA2_SCK0 ((unsigned int) AT91C_PIO_PA2) // USART 0 Serial Clock +-#define AT91C_PA2_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PA2) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PA20 ((unsigned int) 1 << 20) // Pin Controlled by PA20 +-#define AT91C_PA20_CANTX ((unsigned int) AT91C_PIO_PA20) // CAN Transmit +-#define AT91C_PIO_PA21 ((unsigned int) 1 << 21) // Pin Controlled by PA21 +-#define AT91C_PA21_TF ((unsigned int) AT91C_PIO_PA21) // SSC Transmit Frame Sync +-#define AT91C_PA21_SPI1_NPCS0 ((unsigned int) AT91C_PIO_PA21) // SPI 1 Peripheral Chip Select 0 +-#define AT91C_PIO_PA22 ((unsigned int) 1 << 22) // Pin Controlled by PA22 +-#define AT91C_PA22_TK ((unsigned int) AT91C_PIO_PA22) // SSC Transmit Clock +-#define AT91C_PA22_SPI1_SPCK ((unsigned int) AT91C_PIO_PA22) // SPI 1 Serial Clock +-#define AT91C_PIO_PA23 ((unsigned int) 1 << 23) // Pin Controlled by PA23 +-#define AT91C_PA23_TD ((unsigned int) AT91C_PIO_PA23) // SSC Transmit data +-#define AT91C_PA23_SPI1_MOSI ((unsigned int) AT91C_PIO_PA23) // SPI 1 Master Out Slave +-#define AT91C_PIO_PA24 ((unsigned int) 1 << 24) // Pin Controlled by PA24 +-#define AT91C_PA24_RD ((unsigned int) AT91C_PIO_PA24) // SSC Receive Data +-#define AT91C_PA24_SPI1_MISO ((unsigned int) AT91C_PIO_PA24) // SPI 1 Master In Slave +-#define AT91C_PIO_PA25 ((unsigned int) 1 << 25) // Pin Controlled by PA25 +-#define AT91C_PA25_RK ((unsigned int) AT91C_PIO_PA25) // SSC Receive Clock +-#define AT91C_PA25_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PA25) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PA26 ((unsigned int) 1 << 26) // Pin Controlled by PA26 +-#define AT91C_PA26_RF ((unsigned int) AT91C_PIO_PA26) // SSC Receive Frame Sync +-#define AT91C_PA26_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PA26) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PA27 ((unsigned int) 1 << 27) // Pin Controlled by PA27 +-#define AT91C_PA27_DRXD ((unsigned int) AT91C_PIO_PA27) // DBGU Debug Receive Data +-#define AT91C_PA27_PCK3 ((unsigned int) AT91C_PIO_PA27) // PMC Programmable Clock Output 3 +-#define AT91C_PIO_PA28 ((unsigned int) 1 << 28) // Pin Controlled by PA28 +-#define AT91C_PA28_DTXD ((unsigned int) AT91C_PIO_PA28) // DBGU Debug Transmit Data +-#define AT91C_PIO_PA29 ((unsigned int) 1 << 29) // Pin Controlled by PA29 +-#define AT91C_PA29_FIQ ((unsigned int) AT91C_PIO_PA29) // AIC Fast Interrupt Input +-#define AT91C_PA29_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PA29) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PA3 ((unsigned int) 1 << 3) // Pin Controlled by PA3 +-#define AT91C_PA3_RTS0 ((unsigned int) AT91C_PIO_PA3) // USART 0 Ready To Send +-#define AT91C_PA3_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PA3) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PA30 ((unsigned int) 1 << 30) // Pin Controlled by PA30 +-#define AT91C_PA30_IRQ0 ((unsigned int) AT91C_PIO_PA30) // External Interrupt 0 +-#define AT91C_PA30_PCK2 ((unsigned int) AT91C_PIO_PA30) // PMC Programmable Clock Output 2 +-#define AT91C_PIO_PA4 ((unsigned int) 1 << 4) // Pin Controlled by PA4 +-#define AT91C_PA4_CTS0 ((unsigned int) AT91C_PIO_PA4) // USART 0 Clear To Send +-#define AT91C_PA4_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PA4) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PA5 ((unsigned int) 1 << 5) // Pin Controlled by PA5 +-#define AT91C_PA5_RXD1 ((unsigned int) AT91C_PIO_PA5) // USART 1 Receive Data +-#define AT91C_PIO_PA6 ((unsigned int) 1 << 6) // Pin Controlled by PA6 +-#define AT91C_PA6_TXD1 ((unsigned int) AT91C_PIO_PA6) // USART 1 Transmit Data +-#define AT91C_PIO_PA7 ((unsigned int) 1 << 7) // Pin Controlled by PA7 +-#define AT91C_PA7_SCK1 ((unsigned int) AT91C_PIO_PA7) // USART 1 Serial Clock +-#define AT91C_PA7_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PA7) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PIO_PA8 ((unsigned int) 1 << 8) // Pin Controlled by PA8 +-#define AT91C_PA8_RTS1 ((unsigned int) AT91C_PIO_PA8) // USART 1 Ready To Send +-#define AT91C_PA8_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PA8) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PIO_PA9 ((unsigned int) 1 << 9) // Pin Controlled by PA9 +-#define AT91C_PA9_CTS1 ((unsigned int) AT91C_PIO_PA9) // USART 1 Clear To Send +-#define AT91C_PA9_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PA9) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PIO_PB0 ((unsigned int) 1 << 0) // Pin Controlled by PB0 +-#define AT91C_PB0_ETXCK_EREFCK ((unsigned int) AT91C_PIO_PB0) // Ethernet MAC Transmit Clock/Reference Clock +-#define AT91C_PB0_PCK0 ((unsigned int) AT91C_PIO_PB0) // PMC Programmable Clock Output 0 +-#define AT91C_PIO_PB1 ((unsigned int) 1 << 1) // Pin Controlled by PB1 +-#define AT91C_PB1_ETXEN ((unsigned int) AT91C_PIO_PB1) // Ethernet MAC Transmit Enable +-#define AT91C_PIO_PB10 ((unsigned int) 1 << 10) // Pin Controlled by PB10 +-#define AT91C_PB10_ETX2 ((unsigned int) AT91C_PIO_PB10) // Ethernet MAC Transmit Data 2 +-#define AT91C_PB10_SPI1_NPCS1 ((unsigned int) AT91C_PIO_PB10) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PB11 ((unsigned int) 1 << 11) // Pin Controlled by PB11 +-#define AT91C_PB11_ETX3 ((unsigned int) AT91C_PIO_PB11) // Ethernet MAC Transmit Data 3 +-#define AT91C_PB11_SPI1_NPCS2 ((unsigned int) AT91C_PIO_PB11) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PB12 ((unsigned int) 1 << 12) // Pin Controlled by PB12 +-#define AT91C_PB12_ETXER ((unsigned int) AT91C_PIO_PB12) // Ethernet MAC Transmikt Coding Error +-#define AT91C_PB12_TCLK0 ((unsigned int) AT91C_PIO_PB12) // Timer Counter 0 external clock input +-#define AT91C_PIO_PB13 ((unsigned int) 1 << 13) // Pin Controlled by PB13 +-#define AT91C_PB13_ERX2 ((unsigned int) AT91C_PIO_PB13) // Ethernet MAC Receive Data 2 +-#define AT91C_PB13_SPI0_NPCS1 ((unsigned int) AT91C_PIO_PB13) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PIO_PB14 ((unsigned int) 1 << 14) // Pin Controlled by PB14 +-#define AT91C_PB14_ERX3 ((unsigned int) AT91C_PIO_PB14) // Ethernet MAC Receive Data 3 +-#define AT91C_PB14_SPI0_NPCS2 ((unsigned int) AT91C_PIO_PB14) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PIO_PB15 ((unsigned int) 1 << 15) // Pin Controlled by PB15 +-#define AT91C_PB15_ERXDV_ECRSDV ((unsigned int) AT91C_PIO_PB15) // Ethernet MAC Receive Data Valid +-#define AT91C_PIO_PB16 ((unsigned int) 1 << 16) // Pin Controlled by PB16 +-#define AT91C_PB16_ECOL ((unsigned int) AT91C_PIO_PB16) // Ethernet MAC Collision Detected +-#define AT91C_PB16_SPI1_NPCS3 ((unsigned int) AT91C_PIO_PB16) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PB17 ((unsigned int) 1 << 17) // Pin Controlled by PB17 +-#define AT91C_PB17_ERXCK ((unsigned int) AT91C_PIO_PB17) // Ethernet MAC Receive Clock +-#define AT91C_PB17_SPI0_NPCS3 ((unsigned int) AT91C_PIO_PB17) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PIO_PB18 ((unsigned int) 1 << 18) // Pin Controlled by PB18 +-#define AT91C_PB18_EF100 ((unsigned int) AT91C_PIO_PB18) // Ethernet MAC Force 100 Mbits/sec +-#define AT91C_PB18_ADTRG ((unsigned int) AT91C_PIO_PB18) // ADC External Trigger +-#define AT91C_PIO_PB19 ((unsigned int) 1 << 19) // Pin Controlled by PB19 +-#define AT91C_PB19_PWM0 ((unsigned int) AT91C_PIO_PB19) // PWM Channel 0 +-#define AT91C_PB19_TCLK1 ((unsigned int) AT91C_PIO_PB19) // Timer Counter 1 external clock input +-#define AT91C_PIO_PB2 ((unsigned int) 1 << 2) // Pin Controlled by PB2 +-#define AT91C_PB2_ETX0 ((unsigned int) AT91C_PIO_PB2) // Ethernet MAC Transmit Data 0 +-#define AT91C_PIO_PB20 ((unsigned int) 1 << 20) // Pin Controlled by PB20 +-#define AT91C_PB20_PWM1 ((unsigned int) AT91C_PIO_PB20) // PWM Channel 1 +-#define AT91C_PB20_PCK0 ((unsigned int) AT91C_PIO_PB20) // PMC Programmable Clock Output 0 +-#define AT91C_PIO_PB21 ((unsigned int) 1 << 21) // Pin Controlled by PB21 +-#define AT91C_PB21_PWM2 ((unsigned int) AT91C_PIO_PB21) // PWM Channel 2 +-#define AT91C_PB21_PCK1 ((unsigned int) AT91C_PIO_PB21) // PMC Programmable Clock Output 1 +-#define AT91C_PIO_PB22 ((unsigned int) 1 << 22) // Pin Controlled by PB22 +-#define AT91C_PB22_PWM3 ((unsigned int) AT91C_PIO_PB22) // PWM Channel 3 +-#define AT91C_PB22_PCK2 ((unsigned int) AT91C_PIO_PB22) // PMC Programmable Clock Output 2 +-#define AT91C_PIO_PB23 ((unsigned int) 1 << 23) // Pin Controlled by PB23 +-#define AT91C_PB23_TIOA0 ((unsigned int) AT91C_PIO_PB23) // Timer Counter 0 Multipurpose Timer I/O Pin A +-#define AT91C_PB23_DCD1 ((unsigned int) AT91C_PIO_PB23) // USART 1 Data Carrier Detect +-#define AT91C_PIO_PB24 ((unsigned int) 1 << 24) // Pin Controlled by PB24 +-#define AT91C_PB24_TIOB0 ((unsigned int) AT91C_PIO_PB24) // Timer Counter 0 Multipurpose Timer I/O Pin B +-#define AT91C_PB24_DSR1 ((unsigned int) AT91C_PIO_PB24) // USART 1 Data Set ready +-#define AT91C_PIO_PB25 ((unsigned int) 1 << 25) // Pin Controlled by PB25 +-#define AT91C_PB25_TIOA1 ((unsigned int) AT91C_PIO_PB25) // Timer Counter 1 Multipurpose Timer I/O Pin A +-#define AT91C_PB25_DTR1 ((unsigned int) AT91C_PIO_PB25) // USART 1 Data Terminal ready +-#define AT91C_PIO_PB26 ((unsigned int) 1 << 26) // Pin Controlled by PB26 +-#define AT91C_PB26_TIOB1 ((unsigned int) AT91C_PIO_PB26) // Timer Counter 1 Multipurpose Timer I/O Pin B +-#define AT91C_PB26_RI1 ((unsigned int) AT91C_PIO_PB26) // USART 1 Ring Indicator +-#define AT91C_PIO_PB27 ((unsigned int) 1 << 27) // Pin Controlled by PB27 +-#define AT91C_PB27_TIOA2 ((unsigned int) AT91C_PIO_PB27) // Timer Counter 2 Multipurpose Timer I/O Pin A +-#define AT91C_PB27_PWM0 ((unsigned int) AT91C_PIO_PB27) // PWM Channel 0 +-#define AT91C_PIO_PB28 ((unsigned int) 1 << 28) // Pin Controlled by PB28 +-#define AT91C_PB28_TIOB2 ((unsigned int) AT91C_PIO_PB28) // Timer Counter 2 Multipurpose Timer I/O Pin B +-#define AT91C_PB28_PWM1 ((unsigned int) AT91C_PIO_PB28) // PWM Channel 1 +-#define AT91C_PIO_PB29 ((unsigned int) 1 << 29) // Pin Controlled by PB29 +-#define AT91C_PB29_PCK1 ((unsigned int) AT91C_PIO_PB29) // PMC Programmable Clock Output 1 +-#define AT91C_PB29_PWM2 ((unsigned int) AT91C_PIO_PB29) // PWM Channel 2 +-#define AT91C_PIO_PB3 ((unsigned int) 1 << 3) // Pin Controlled by PB3 +-#define AT91C_PB3_ETX1 ((unsigned int) AT91C_PIO_PB3) // Ethernet MAC Transmit Data 1 +-#define AT91C_PIO_PB30 ((unsigned int) 1 << 30) // Pin Controlled by PB30 +-#define AT91C_PB30_PCK2 ((unsigned int) AT91C_PIO_PB30) // PMC Programmable Clock Output 2 +-#define AT91C_PB30_PWM3 ((unsigned int) AT91C_PIO_PB30) // PWM Channel 3 +-#define AT91C_PIO_PB4 ((unsigned int) 1 << 4) // Pin Controlled by PB4 +-#define AT91C_PB4_ECRS ((unsigned int) AT91C_PIO_PB4) // Ethernet MAC Carrier Sense/Carrier Sense and Data Valid +-#define AT91C_PIO_PB5 ((unsigned int) 1 << 5) // Pin Controlled by PB5 +-#define AT91C_PB5_ERX0 ((unsigned int) AT91C_PIO_PB5) // Ethernet MAC Receive Data 0 +-#define AT91C_PIO_PB6 ((unsigned int) 1 << 6) // Pin Controlled by PB6 +-#define AT91C_PB6_ERX1 ((unsigned int) AT91C_PIO_PB6) // Ethernet MAC Receive Data 1 +-#define AT91C_PIO_PB7 ((unsigned int) 1 << 7) // Pin Controlled by PB7 +-#define AT91C_PB7_ERXER ((unsigned int) AT91C_PIO_PB7) // Ethernet MAC Receive Error +-#define AT91C_PIO_PB8 ((unsigned int) 1 << 8) // Pin Controlled by PB8 +-#define AT91C_PB8_EMDC ((unsigned int) AT91C_PIO_PB8) // Ethernet MAC Management Data Clock +-#define AT91C_PIO_PB9 ((unsigned int) 1 << 9) // Pin Controlled by PB9 +-#define AT91C_PB9_EMDIO ((unsigned int) AT91C_PIO_PB9) // Ethernet MAC Management Data Input/Output +- +-// ***************************************************************************** +-// PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_ID_FIQ ((unsigned int) 0) // Advanced Interrupt Controller (FIQ) +-#define AT91C_ID_SYS ((unsigned int) 1) // System Peripheral +-#define AT91C_ID_PIOA ((unsigned int) 2) // Parallel IO Controller A +-#define AT91C_ID_PIOB ((unsigned int) 3) // Parallel IO Controller B +-#define AT91C_ID_SPI0 ((unsigned int) 4) // Serial Peripheral Interface 0 +-#define AT91C_ID_SPI1 ((unsigned int) 5) // Serial Peripheral Interface 1 +-#define AT91C_ID_US0 ((unsigned int) 6) // USART 0 +-#define AT91C_ID_US1 ((unsigned int) 7) // USART 1 +-#define AT91C_ID_SSC ((unsigned int) 8) // Serial Synchronous Controller +-#define AT91C_ID_TWI ((unsigned int) 9) // Two-Wire Interface +-#define AT91C_ID_PWMC ((unsigned int) 10) // PWM Controller +-#define AT91C_ID_UDP ((unsigned int) 11) // USB Device Port +-#define AT91C_ID_TC0 ((unsigned int) 12) // Timer Counter 0 +-#define AT91C_ID_TC1 ((unsigned int) 13) // Timer Counter 1 +-#define AT91C_ID_TC2 ((unsigned int) 14) // Timer Counter 2 +-#define AT91C_ID_CAN ((unsigned int) 15) // Control Area Network Controller +-#define AT91C_ID_EMAC ((unsigned int) 16) // Ethernet MAC +-#define AT91C_ID_ADC ((unsigned int) 17) // Analog-to-Digital Converter +-#define AT91C_ID_18_Reserved ((unsigned int) 18) // Reserved +-#define AT91C_ID_19_Reserved ((unsigned int) 19) // Reserved +-#define AT91C_ID_20_Reserved ((unsigned int) 20) // Reserved +-#define AT91C_ID_21_Reserved ((unsigned int) 21) // Reserved +-#define AT91C_ID_22_Reserved ((unsigned int) 22) // Reserved +-#define AT91C_ID_23_Reserved ((unsigned int) 23) // Reserved +-#define AT91C_ID_24_Reserved ((unsigned int) 24) // Reserved +-#define AT91C_ID_25_Reserved ((unsigned int) 25) // Reserved +-#define AT91C_ID_26_Reserved ((unsigned int) 26) // Reserved +-#define AT91C_ID_27_Reserved ((unsigned int) 27) // Reserved +-#define AT91C_ID_28_Reserved ((unsigned int) 28) // Reserved +-#define AT91C_ID_29_Reserved ((unsigned int) 29) // Reserved +-#define AT91C_ID_IRQ0 ((unsigned int) 30) // Advanced Interrupt Controller (IRQ0) +-#define AT91C_ID_IRQ1 ((unsigned int) 31) // Advanced Interrupt Controller (IRQ1) +-#define AT91C_ALL_INT ((unsigned int) 0xC003FFFF) // ALL VALID INTERRUPTS +- +-// ***************************************************************************** +-// BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_BASE_SYS ((AT91PS_SYS) 0xFFFFF000) // (SYS) Base Address +-#define AT91C_BASE_AIC ((AT91PS_AIC) 0xFFFFF000) // (AIC) Base Address +-#define AT91C_BASE_PDC_DBGU ((AT91PS_PDC) 0xFFFFF300) // (PDC_DBGU) Base Address +-#define AT91C_BASE_DBGU ((AT91PS_DBGU) 0xFFFFF200) // (DBGU) Base Address +-#define AT91C_BASE_PIOA ((AT91PS_PIO) 0xFFFFF400) // (PIOA) Base Address +-#define AT91C_BASE_PIOB ((AT91PS_PIO) 0xFFFFF600) // (PIOB) Base Address +-#define AT91C_BASE_CKGR ((AT91PS_CKGR) 0xFFFFFC20) // (CKGR) Base Address +-#define AT91C_BASE_PMC ((AT91PS_PMC) 0xFFFFFC00) // (PMC) Base Address +-#define AT91C_BASE_RSTC ((AT91PS_RSTC) 0xFFFFFD00) // (RSTC) Base Address +-#define AT91C_BASE_RTTC ((AT91PS_RTTC) 0xFFFFFD20) // (RTTC) Base Address +-#define AT91C_BASE_PITC ((AT91PS_PITC) 0xFFFFFD30) // (PITC) Base Address +-#define AT91C_BASE_WDTC ((AT91PS_WDTC) 0xFFFFFD40) // (WDTC) Base Address +-#define AT91C_BASE_VREG ((AT91PS_VREG) 0xFFFFFD60) // (VREG) Base Address +-#define AT91C_BASE_MC ((AT91PS_MC) 0xFFFFFF00) // (MC) Base Address +-#define AT91C_BASE_PDC_SPI1 ((AT91PS_PDC) 0xFFFE4100) // (PDC_SPI1) Base Address +-#define AT91C_BASE_SPI1 ((AT91PS_SPI) 0xFFFE4000) // (SPI1) Base Address +-#define AT91C_BASE_PDC_SPI0 ((AT91PS_PDC) 0xFFFE0100) // (PDC_SPI0) Base Address +-#define AT91C_BASE_SPI0 ((AT91PS_SPI) 0xFFFE0000) // (SPI0) Base Address +-#define AT91C_BASE_PDC_US1 ((AT91PS_PDC) 0xFFFC4100) // (PDC_US1) Base Address +-#define AT91C_BASE_US1 ((AT91PS_USART) 0xFFFC4000) // (US1) Base Address +-#define AT91C_BASE_PDC_US0 ((AT91PS_PDC) 0xFFFC0100) // (PDC_US0) Base Address +-#define AT91C_BASE_US0 ((AT91PS_USART) 0xFFFC0000) // (US0) Base Address +-#define AT91C_BASE_PDC_SSC ((AT91PS_PDC) 0xFFFD4100) // (PDC_SSC) Base Address +-#define AT91C_BASE_SSC ((AT91PS_SSC) 0xFFFD4000) // (SSC) Base Address +-#define AT91C_BASE_TWI ((AT91PS_TWI) 0xFFFB8000) // (TWI) Base Address +-#define AT91C_BASE_PWMC_CH3 ((AT91PS_PWMC_CH) 0xFFFCC260) // (PWMC_CH3) Base Address +-#define AT91C_BASE_PWMC_CH2 ((AT91PS_PWMC_CH) 0xFFFCC240) // (PWMC_CH2) Base Address +-#define AT91C_BASE_PWMC_CH1 ((AT91PS_PWMC_CH) 0xFFFCC220) // (PWMC_CH1) Base Address +-#define AT91C_BASE_PWMC_CH0 ((AT91PS_PWMC_CH) 0xFFFCC200) // (PWMC_CH0) Base Address +-#define AT91C_BASE_PWMC ((AT91PS_PWMC) 0xFFFCC000) // (PWMC) Base Address +-#define AT91C_BASE_UDP ((AT91PS_UDP) 0xFFFB0000) // (UDP) Base Address +-#define AT91C_BASE_TC0 ((AT91PS_TC) 0xFFFA0000) // (TC0) Base Address +-#define AT91C_BASE_TC1 ((AT91PS_TC) 0xFFFA0040) // (TC1) Base Address +-#define AT91C_BASE_TC2 ((AT91PS_TC) 0xFFFA0080) // (TC2) Base Address +-#define AT91C_BASE_TCB ((AT91PS_TCB) 0xFFFA0000) // (TCB) Base Address +-#define AT91C_BASE_CAN_MB0 ((AT91PS_CAN_MB) 0xFFFD0200) // (CAN_MB0) Base Address +-#define AT91C_BASE_CAN_MB1 ((AT91PS_CAN_MB) 0xFFFD0220) // (CAN_MB1) Base Address +-#define AT91C_BASE_CAN_MB2 ((AT91PS_CAN_MB) 0xFFFD0240) // (CAN_MB2) Base Address +-#define AT91C_BASE_CAN_MB3 ((AT91PS_CAN_MB) 0xFFFD0260) // (CAN_MB3) Base Address +-#define AT91C_BASE_CAN_MB4 ((AT91PS_CAN_MB) 0xFFFD0280) // (CAN_MB4) Base Address +-#define AT91C_BASE_CAN_MB5 ((AT91PS_CAN_MB) 0xFFFD02A0) // (CAN_MB5) Base Address +-#define AT91C_BASE_CAN_MB6 ((AT91PS_CAN_MB) 0xFFFD02C0) // (CAN_MB6) Base Address +-#define AT91C_BASE_CAN_MB7 ((AT91PS_CAN_MB) 0xFFFD02E0) // (CAN_MB7) Base Address +-#define AT91C_BASE_CAN ((AT91PS_CAN) 0xFFFD0000) // (CAN) Base Address +-#define AT91C_BASE_EMAC ((AT91PS_EMAC) 0xFFFDC000) // (EMAC) Base Address +-#define AT91C_BASE_PDC_ADC ((AT91PS_PDC) 0xFFFD8100) // (PDC_ADC) Base Address +-#define AT91C_BASE_ADC ((AT91PS_ADC) 0xFFFD8000) // (ADC) Base Address +- +-// ***************************************************************************** +-// MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-// ISRAM +-#define AT91C_ISRAM ((char *) 0x00200000) // Internal SRAM base address +-#define AT91C_ISRAM_SIZE ((unsigned int) 0x00010000) // Internal SRAM size in byte (64 Kbytes) +-// IFLASH +-#define AT91C_IFLASH ((char *) 0x00100000) // Internal FLASH base address +-#define AT91C_IFLASH_SIZE ((unsigned int) 0x00040000) // Internal FLASH size in byte (256 Kbytes) +-#define AT91C_IFLASH_PAGE_SIZE ((unsigned int) 256) // Internal FLASH Page Size: 256 bytes +-#define AT91C_IFLASH_LOCK_REGION_SIZE ((unsigned int) 16384) // Internal FLASH Lock Region Size: 16 Kbytes +-#define AT91C_IFLASH_NB_OF_PAGES ((unsigned int) 1024) // Internal FLASH Number of Pages: 1024 bytes +-#define AT91C_IFLASH_NB_OF_LOCK_BITS ((unsigned int) 16) // Internal FLASH Number of Lock Bits: 16 bytes +-#endif /* __IAR_SYSTEMS_ICC__ */ +- +-#ifdef __IAR_SYSTEMS_ASM__ +- +-// - Hardware register definition +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR System Peripherals +-// - ***************************************************************************** +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Advanced Interrupt Controller +-// - ***************************************************************************** +-// - -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- +-AT91C_AIC_PRIOR EQU (0x7 << 0) ;- (AIC) Priority Level +-AT91C_AIC_PRIOR_LOWEST EQU (0x0) ;- (AIC) Lowest priority level +-AT91C_AIC_PRIOR_HIGHEST EQU (0x7) ;- (AIC) Highest priority level +-AT91C_AIC_SRCTYPE EQU (0x3 << 5) ;- (AIC) Interrupt Source Type +-AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL EQU (0x0 << 5) ;- (AIC) Internal Sources Code Label High-level Sensitive +-AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL EQU (0x0 << 5) ;- (AIC) External Sources Code Label Low-level Sensitive +-AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE EQU (0x1 << 5) ;- (AIC) Internal Sources Code Label Positive Edge triggered +-AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE EQU (0x1 << 5) ;- (AIC) External Sources Code Label Negative Edge triggered +-AT91C_AIC_SRCTYPE_HIGH_LEVEL EQU (0x2 << 5) ;- (AIC) Internal Or External Sources Code Label High-level Sensitive +-AT91C_AIC_SRCTYPE_POSITIVE_EDGE EQU (0x3 << 5) ;- (AIC) Internal Or External Sources Code Label Positive Edge triggered +-// - -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- +-AT91C_AIC_NFIQ EQU (0x1 << 0) ;- (AIC) NFIQ Status +-AT91C_AIC_NIRQ EQU (0x1 << 1) ;- (AIC) NIRQ Status +-// - -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- +-AT91C_AIC_DCR_PROT EQU (0x1 << 0) ;- (AIC) Protection Mode +-AT91C_AIC_DCR_GMSK EQU (0x1 << 1) ;- (AIC) General Mask +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Peripheral DMA Controller +-// - ***************************************************************************** +-// - -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- +-AT91C_PDC_RXTEN EQU (0x1 << 0) ;- (PDC) Receiver Transfer Enable +-AT91C_PDC_RXTDIS EQU (0x1 << 1) ;- (PDC) Receiver Transfer Disable +-AT91C_PDC_TXTEN EQU (0x1 << 8) ;- (PDC) Transmitter Transfer Enable +-AT91C_PDC_TXTDIS EQU (0x1 << 9) ;- (PDC) Transmitter Transfer Disable +-// - -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Debug Unit +-// - ***************************************************************************** +-// - -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- +-AT91C_US_RSTRX EQU (0x1 << 2) ;- (DBGU) Reset Receiver +-AT91C_US_RSTTX EQU (0x1 << 3) ;- (DBGU) Reset Transmitter +-AT91C_US_RXEN EQU (0x1 << 4) ;- (DBGU) Receiver Enable +-AT91C_US_RXDIS EQU (0x1 << 5) ;- (DBGU) Receiver Disable +-AT91C_US_TXEN EQU (0x1 << 6) ;- (DBGU) Transmitter Enable +-AT91C_US_TXDIS EQU (0x1 << 7) ;- (DBGU) Transmitter Disable +-AT91C_US_RSTSTA EQU (0x1 << 8) ;- (DBGU) Reset Status Bits +-// - -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- +-AT91C_US_PAR EQU (0x7 << 9) ;- (DBGU) Parity type +-AT91C_US_PAR_EVEN EQU (0x0 << 9) ;- (DBGU) Even Parity +-AT91C_US_PAR_ODD EQU (0x1 << 9) ;- (DBGU) Odd Parity +-AT91C_US_PAR_SPACE EQU (0x2 << 9) ;- (DBGU) Parity forced to 0 (Space) +-AT91C_US_PAR_MARK EQU (0x3 << 9) ;- (DBGU) Parity forced to 1 (Mark) +-AT91C_US_PAR_NONE EQU (0x4 << 9) ;- (DBGU) No Parity +-AT91C_US_PAR_MULTI_DROP EQU (0x6 << 9) ;- (DBGU) Multi-drop mode +-AT91C_US_CHMODE EQU (0x3 << 14) ;- (DBGU) Channel Mode +-AT91C_US_CHMODE_NORMAL EQU (0x0 << 14) ;- (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. +-AT91C_US_CHMODE_AUTO EQU (0x1 << 14) ;- (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. +-AT91C_US_CHMODE_LOCAL EQU (0x2 << 14) ;- (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. +-AT91C_US_CHMODE_REMOTE EQU (0x3 << 14) ;- (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. +-// - -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-AT91C_US_RXRDY EQU (0x1 << 0) ;- (DBGU) RXRDY Interrupt +-AT91C_US_TXRDY EQU (0x1 << 1) ;- (DBGU) TXRDY Interrupt +-AT91C_US_ENDRX EQU (0x1 << 3) ;- (DBGU) End of Receive Transfer Interrupt +-AT91C_US_ENDTX EQU (0x1 << 4) ;- (DBGU) End of Transmit Interrupt +-AT91C_US_OVRE EQU (0x1 << 5) ;- (DBGU) Overrun Interrupt +-AT91C_US_FRAME EQU (0x1 << 6) ;- (DBGU) Framing Error Interrupt +-AT91C_US_PARE EQU (0x1 << 7) ;- (DBGU) Parity Error Interrupt +-AT91C_US_TXEMPTY EQU (0x1 << 9) ;- (DBGU) TXEMPTY Interrupt +-AT91C_US_TXBUFE EQU (0x1 << 11) ;- (DBGU) TXBUFE Interrupt +-AT91C_US_RXBUFF EQU (0x1 << 12) ;- (DBGU) RXBUFF Interrupt +-AT91C_US_COMM_TX EQU (0x1 << 30) ;- (DBGU) COMM_TX Interrupt +-AT91C_US_COMM_RX EQU (0x1 << 31) ;- (DBGU) COMM_RX Interrupt +-// - -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-// - -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-// - -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- +-// - -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- +-AT91C_US_FORCE_NTRST EQU (0x1 << 0) ;- (DBGU) Force NTRST in JTAG +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Parallel Input Output Controler +-// - ***************************************************************************** +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Clock Generator Controler +-// - ***************************************************************************** +-// - -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- +-AT91C_CKGR_MOSCEN EQU (0x1 << 0) ;- (CKGR) Main Oscillator Enable +-AT91C_CKGR_OSCBYPASS EQU (0x1 << 1) ;- (CKGR) Main Oscillator Bypass +-AT91C_CKGR_OSCOUNT EQU (0xFF << 8) ;- (CKGR) Main Oscillator Start-up Time +-// - -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- +-AT91C_CKGR_MAINF EQU (0xFFFF << 0) ;- (CKGR) Main Clock Frequency +-AT91C_CKGR_MAINRDY EQU (0x1 << 16) ;- (CKGR) Main Clock Ready +-// - -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- +-AT91C_CKGR_DIV EQU (0xFF << 0) ;- (CKGR) Divider Selected +-AT91C_CKGR_DIV_0 EQU (0x0) ;- (CKGR) Divider output is 0 +-AT91C_CKGR_DIV_BYPASS EQU (0x1) ;- (CKGR) Divider is bypassed +-AT91C_CKGR_PLLCOUNT EQU (0x3F << 8) ;- (CKGR) PLL Counter +-AT91C_CKGR_OUT EQU (0x3 << 14) ;- (CKGR) PLL Output Frequency Range +-AT91C_CKGR_OUT_0 EQU (0x0 << 14) ;- (CKGR) Please refer to the PLL datasheet +-AT91C_CKGR_OUT_1 EQU (0x1 << 14) ;- (CKGR) Please refer to the PLL datasheet +-AT91C_CKGR_OUT_2 EQU (0x2 << 14) ;- (CKGR) Please refer to the PLL datasheet +-AT91C_CKGR_OUT_3 EQU (0x3 << 14) ;- (CKGR) Please refer to the PLL datasheet +-AT91C_CKGR_MUL EQU (0x7FF << 16) ;- (CKGR) PLL Multiplier +-AT91C_CKGR_USBDIV EQU (0x3 << 28) ;- (CKGR) Divider for USB Clocks +-AT91C_CKGR_USBDIV_0 EQU (0x0 << 28) ;- (CKGR) Divider output is PLL clock output +-AT91C_CKGR_USBDIV_1 EQU (0x1 << 28) ;- (CKGR) Divider output is PLL clock output divided by 2 +-AT91C_CKGR_USBDIV_2 EQU (0x2 << 28) ;- (CKGR) Divider output is PLL clock output divided by 4 +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Power Management Controler +-// - ***************************************************************************** +-// - -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- +-AT91C_PMC_PCK EQU (0x1 << 0) ;- (PMC) Processor Clock +-AT91C_PMC_UDP EQU (0x1 << 7) ;- (PMC) USB Device Port Clock +-AT91C_PMC_PCK0 EQU (0x1 << 8) ;- (PMC) Programmable Clock Output +-AT91C_PMC_PCK1 EQU (0x1 << 9) ;- (PMC) Programmable Clock Output +-AT91C_PMC_PCK2 EQU (0x1 << 10) ;- (PMC) Programmable Clock Output +-AT91C_PMC_PCK3 EQU (0x1 << 11) ;- (PMC) Programmable Clock Output +-// - -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- +-// - -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- +-// - -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- +-// - -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- +-// - -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- +-// - -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- +-AT91C_PMC_CSS EQU (0x3 << 0) ;- (PMC) Programmable Clock Selection +-AT91C_PMC_CSS_SLOW_CLK EQU (0x0) ;- (PMC) Slow Clock is selected +-AT91C_PMC_CSS_MAIN_CLK EQU (0x1) ;- (PMC) Main Clock is selected +-AT91C_PMC_CSS_PLL_CLK EQU (0x3) ;- (PMC) Clock from PLL is selected +-AT91C_PMC_PRES EQU (0x7 << 2) ;- (PMC) Programmable Clock Prescaler +-AT91C_PMC_PRES_CLK EQU (0x0 << 2) ;- (PMC) Selected clock +-AT91C_PMC_PRES_CLK_2 EQU (0x1 << 2) ;- (PMC) Selected clock divided by 2 +-AT91C_PMC_PRES_CLK_4 EQU (0x2 << 2) ;- (PMC) Selected clock divided by 4 +-AT91C_PMC_PRES_CLK_8 EQU (0x3 << 2) ;- (PMC) Selected clock divided by 8 +-AT91C_PMC_PRES_CLK_16 EQU (0x4 << 2) ;- (PMC) Selected clock divided by 16 +-AT91C_PMC_PRES_CLK_32 EQU (0x5 << 2) ;- (PMC) Selected clock divided by 32 +-AT91C_PMC_PRES_CLK_64 EQU (0x6 << 2) ;- (PMC) Selected clock divided by 64 +-// - -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- +-// - -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- +-AT91C_PMC_MOSCS EQU (0x1 << 0) ;- (PMC) MOSC Status/Enable/Disable/Mask +-AT91C_PMC_LOCK EQU (0x1 << 2) ;- (PMC) PLL Status/Enable/Disable/Mask +-AT91C_PMC_MCKRDY EQU (0x1 << 3) ;- (PMC) MCK_RDY Status/Enable/Disable/Mask +-AT91C_PMC_PCK0RDY EQU (0x1 << 8) ;- (PMC) PCK0_RDY Status/Enable/Disable/Mask +-AT91C_PMC_PCK1RDY EQU (0x1 << 9) ;- (PMC) PCK1_RDY Status/Enable/Disable/Mask +-AT91C_PMC_PCK2RDY EQU (0x1 << 10) ;- (PMC) PCK2_RDY Status/Enable/Disable/Mask +-AT91C_PMC_PCK3RDY EQU (0x1 << 11) ;- (PMC) PCK3_RDY Status/Enable/Disable/Mask +-// - -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- +-// - -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- +-// - -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Reset Controller Interface +-// - ***************************************************************************** +-// - -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- +-AT91C_RSTC_PROCRST EQU (0x1 << 0) ;- (RSTC) Processor Reset +-AT91C_RSTC_PERRST EQU (0x1 << 2) ;- (RSTC) Peripheral Reset +-AT91C_RSTC_EXTRST EQU (0x1 << 3) ;- (RSTC) External Reset +-AT91C_RSTC_KEY EQU (0xFF << 24) ;- (RSTC) Password +-// - -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- +-AT91C_RSTC_URSTS EQU (0x1 << 0) ;- (RSTC) User Reset Status +-AT91C_RSTC_BODSTS EQU (0x1 << 1) ;- (RSTC) Brownout Detection Status +-AT91C_RSTC_RSTTYP EQU (0x7 << 8) ;- (RSTC) Reset Type +-AT91C_RSTC_RSTTYP_POWERUP EQU (0x0 << 8) ;- (RSTC) Power-up Reset. VDDCORE rising. +-AT91C_RSTC_RSTTYP_WAKEUP EQU (0x1 << 8) ;- (RSTC) WakeUp Reset. VDDCORE rising. +-AT91C_RSTC_RSTTYP_WATCHDOG EQU (0x2 << 8) ;- (RSTC) Watchdog Reset. Watchdog overflow occured. +-AT91C_RSTC_RSTTYP_SOFTWARE EQU (0x3 << 8) ;- (RSTC) Software Reset. Processor reset required by the software. +-AT91C_RSTC_RSTTYP_USER EQU (0x4 << 8) ;- (RSTC) User Reset. NRST pin detected low. +-AT91C_RSTC_RSTTYP_BROWNOUT EQU (0x5 << 8) ;- (RSTC) Brownout Reset occured. +-AT91C_RSTC_NRSTL EQU (0x1 << 16) ;- (RSTC) NRST pin level +-AT91C_RSTC_SRCMP EQU (0x1 << 17) ;- (RSTC) Software Reset Command in Progress. +-// - -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- +-AT91C_RSTC_URSTEN EQU (0x1 << 0) ;- (RSTC) User Reset Enable +-AT91C_RSTC_URSTIEN EQU (0x1 << 4) ;- (RSTC) User Reset Interrupt Enable +-AT91C_RSTC_ERSTL EQU (0xF << 8) ;- (RSTC) User Reset Length +-AT91C_RSTC_BODIEN EQU (0x1 << 16) ;- (RSTC) Brownout Detection Interrupt Enable +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface +-// - ***************************************************************************** +-// - -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- +-AT91C_RTTC_RTPRES EQU (0xFFFF << 0) ;- (RTTC) Real-time Timer Prescaler Value +-AT91C_RTTC_ALMIEN EQU (0x1 << 16) ;- (RTTC) Alarm Interrupt Enable +-AT91C_RTTC_RTTINCIEN EQU (0x1 << 17) ;- (RTTC) Real Time Timer Increment Interrupt Enable +-AT91C_RTTC_RTTRST EQU (0x1 << 18) ;- (RTTC) Real Time Timer Restart +-// - -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- +-AT91C_RTTC_ALMV EQU (0x0 << 0) ;- (RTTC) Alarm Value +-// - -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- +-AT91C_RTTC_CRTV EQU (0x0 << 0) ;- (RTTC) Current Real-time Value +-// - -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- +-AT91C_RTTC_ALMS EQU (0x1 << 0) ;- (RTTC) Real-time Alarm Status +-AT91C_RTTC_RTTINC EQU (0x1 << 1) ;- (RTTC) Real-time Timer Increment +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface +-// - ***************************************************************************** +-// - -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- +-AT91C_PITC_PIV EQU (0xFFFFF << 0) ;- (PITC) Periodic Interval Value +-AT91C_PITC_PITEN EQU (0x1 << 24) ;- (PITC) Periodic Interval Timer Enabled +-AT91C_PITC_PITIEN EQU (0x1 << 25) ;- (PITC) Periodic Interval Timer Interrupt Enable +-// - -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- +-AT91C_PITC_PITS EQU (0x1 << 0) ;- (PITC) Periodic Interval Timer Status +-// - -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- +-AT91C_PITC_CPIV EQU (0xFFFFF << 0) ;- (PITC) Current Periodic Interval Value +-AT91C_PITC_PICNT EQU (0xFFF << 20) ;- (PITC) Periodic Interval Counter +-// - -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface +-// - ***************************************************************************** +-// - -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- +-AT91C_WDTC_WDRSTT EQU (0x1 << 0) ;- (WDTC) Watchdog Restart +-AT91C_WDTC_KEY EQU (0xFF << 24) ;- (WDTC) Watchdog KEY Password +-// - -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- +-AT91C_WDTC_WDV EQU (0xFFF << 0) ;- (WDTC) Watchdog Timer Restart +-AT91C_WDTC_WDFIEN EQU (0x1 << 12) ;- (WDTC) Watchdog Fault Interrupt Enable +-AT91C_WDTC_WDRSTEN EQU (0x1 << 13) ;- (WDTC) Watchdog Reset Enable +-AT91C_WDTC_WDRPROC EQU (0x1 << 14) ;- (WDTC) Watchdog Timer Restart +-AT91C_WDTC_WDDIS EQU (0x1 << 15) ;- (WDTC) Watchdog Disable +-AT91C_WDTC_WDD EQU (0xFFF << 16) ;- (WDTC) Watchdog Delta Value +-AT91C_WDTC_WDDBGHLT EQU (0x1 << 28) ;- (WDTC) Watchdog Debug Halt +-AT91C_WDTC_WDIDLEHLT EQU (0x1 << 29) ;- (WDTC) Watchdog Idle Halt +-// - -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- +-AT91C_WDTC_WDUNF EQU (0x1 << 0) ;- (WDTC) Watchdog Underflow +-AT91C_WDTC_WDERR EQU (0x1 << 1) ;- (WDTC) Watchdog Error +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface +-// - ***************************************************************************** +-// - -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- +-AT91C_VREG_PSTDBY EQU (0x1 << 0) ;- (VREG) Voltage Regulator Power Standby Mode +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Memory Controller Interface +-// - ***************************************************************************** +-// - -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- +-AT91C_MC_RCB EQU (0x1 << 0) ;- (MC) Remap Command Bit +-// - -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- +-AT91C_MC_UNDADD EQU (0x1 << 0) ;- (MC) Undefined Addess Abort Status +-AT91C_MC_MISADD EQU (0x1 << 1) ;- (MC) Misaligned Addess Abort Status +-AT91C_MC_ABTSZ EQU (0x3 << 8) ;- (MC) Abort Size Status +-AT91C_MC_ABTSZ_BYTE EQU (0x0 << 8) ;- (MC) Byte +-AT91C_MC_ABTSZ_HWORD EQU (0x1 << 8) ;- (MC) Half-word +-AT91C_MC_ABTSZ_WORD EQU (0x2 << 8) ;- (MC) Word +-AT91C_MC_ABTTYP EQU (0x3 << 10) ;- (MC) Abort Type Status +-AT91C_MC_ABTTYP_DATAR EQU (0x0 << 10) ;- (MC) Data Read +-AT91C_MC_ABTTYP_DATAW EQU (0x1 << 10) ;- (MC) Data Write +-AT91C_MC_ABTTYP_FETCH EQU (0x2 << 10) ;- (MC) Code Fetch +-AT91C_MC_MST0 EQU (0x1 << 16) ;- (MC) Master 0 Abort Source +-AT91C_MC_MST1 EQU (0x1 << 17) ;- (MC) Master 1 Abort Source +-AT91C_MC_SVMST0 EQU (0x1 << 24) ;- (MC) Saved Master 0 Abort Source +-AT91C_MC_SVMST1 EQU (0x1 << 25) ;- (MC) Saved Master 1 Abort Source +-// - -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- +-AT91C_MC_FRDY EQU (0x1 << 0) ;- (MC) Flash Ready +-AT91C_MC_LOCKE EQU (0x1 << 2) ;- (MC) Lock Error +-AT91C_MC_PROGE EQU (0x1 << 3) ;- (MC) Programming Error +-AT91C_MC_NEBP EQU (0x1 << 7) ;- (MC) No Erase Before Programming +-AT91C_MC_FWS EQU (0x3 << 8) ;- (MC) Flash Wait State +-AT91C_MC_FWS_0FWS EQU (0x0 << 8) ;- (MC) 1 cycle for Read, 2 for Write operations +-AT91C_MC_FWS_1FWS EQU (0x1 << 8) ;- (MC) 2 cycles for Read, 3 for Write operations +-AT91C_MC_FWS_2FWS EQU (0x2 << 8) ;- (MC) 3 cycles for Read, 4 for Write operations +-AT91C_MC_FWS_3FWS EQU (0x3 << 8) ;- (MC) 4 cycles for Read, 4 for Write operations +-AT91C_MC_FMCN EQU (0xFF << 16) ;- (MC) Flash Microsecond Cycle Number +-// - -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- +-AT91C_MC_FCMD EQU (0xF << 0) ;- (MC) Flash Command +-AT91C_MC_FCMD_START_PROG EQU (0x1) ;- (MC) Starts the programming of th epage specified by PAGEN. +-AT91C_MC_FCMD_LOCK EQU (0x2) ;- (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-AT91C_MC_FCMD_PROG_AND_LOCK EQU (0x3) ;- (MC) The lock sequence automatically happens after the programming sequence is completed. +-AT91C_MC_FCMD_UNLOCK EQU (0x4) ;- (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-AT91C_MC_FCMD_ERASE_ALL EQU (0x8) ;- (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. +-AT91C_MC_FCMD_SET_GP_NVM EQU (0xB) ;- (MC) Set General Purpose NVM bits. +-AT91C_MC_FCMD_CLR_GP_NVM EQU (0xD) ;- (MC) Clear General Purpose NVM bits. +-AT91C_MC_FCMD_SET_SECURITY EQU (0xF) ;- (MC) Set Security Bit. +-AT91C_MC_PAGEN EQU (0x3FF << 8) ;- (MC) Page Number +-AT91C_MC_KEY EQU (0xFF << 24) ;- (MC) Writing Protect Key +-// - -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- +-AT91C_MC_SECURITY EQU (0x1 << 4) ;- (MC) Security Bit Status +-AT91C_MC_GPNVM0 EQU (0x1 << 8) ;- (MC) Sector 0 Lock Status +-AT91C_MC_GPNVM1 EQU (0x1 << 9) ;- (MC) Sector 1 Lock Status +-AT91C_MC_GPNVM2 EQU (0x1 << 10) ;- (MC) Sector 2 Lock Status +-AT91C_MC_GPNVM3 EQU (0x1 << 11) ;- (MC) Sector 3 Lock Status +-AT91C_MC_GPNVM4 EQU (0x1 << 12) ;- (MC) Sector 4 Lock Status +-AT91C_MC_GPNVM5 EQU (0x1 << 13) ;- (MC) Sector 5 Lock Status +-AT91C_MC_GPNVM6 EQU (0x1 << 14) ;- (MC) Sector 6 Lock Status +-AT91C_MC_GPNVM7 EQU (0x1 << 15) ;- (MC) Sector 7 Lock Status +-AT91C_MC_LOCKS0 EQU (0x1 << 16) ;- (MC) Sector 0 Lock Status +-AT91C_MC_LOCKS1 EQU (0x1 << 17) ;- (MC) Sector 1 Lock Status +-AT91C_MC_LOCKS2 EQU (0x1 << 18) ;- (MC) Sector 2 Lock Status +-AT91C_MC_LOCKS3 EQU (0x1 << 19) ;- (MC) Sector 3 Lock Status +-AT91C_MC_LOCKS4 EQU (0x1 << 20) ;- (MC) Sector 4 Lock Status +-AT91C_MC_LOCKS5 EQU (0x1 << 21) ;- (MC) Sector 5 Lock Status +-AT91C_MC_LOCKS6 EQU (0x1 << 22) ;- (MC) Sector 6 Lock Status +-AT91C_MC_LOCKS7 EQU (0x1 << 23) ;- (MC) Sector 7 Lock Status +-AT91C_MC_LOCKS8 EQU (0x1 << 24) ;- (MC) Sector 8 Lock Status +-AT91C_MC_LOCKS9 EQU (0x1 << 25) ;- (MC) Sector 9 Lock Status +-AT91C_MC_LOCKS10 EQU (0x1 << 26) ;- (MC) Sector 10 Lock Status +-AT91C_MC_LOCKS11 EQU (0x1 << 27) ;- (MC) Sector 11 Lock Status +-AT91C_MC_LOCKS12 EQU (0x1 << 28) ;- (MC) Sector 12 Lock Status +-AT91C_MC_LOCKS13 EQU (0x1 << 29) ;- (MC) Sector 13 Lock Status +-AT91C_MC_LOCKS14 EQU (0x1 << 30) ;- (MC) Sector 14 Lock Status +-AT91C_MC_LOCKS15 EQU (0x1 << 31) ;- (MC) Sector 15 Lock Status +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Serial Parallel Interface +-// - ***************************************************************************** +-// - -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- +-AT91C_SPI_SPIEN EQU (0x1 << 0) ;- (SPI) SPI Enable +-AT91C_SPI_SPIDIS EQU (0x1 << 1) ;- (SPI) SPI Disable +-AT91C_SPI_SWRST EQU (0x1 << 7) ;- (SPI) SPI Software reset +-AT91C_SPI_LASTXFER EQU (0x1 << 24) ;- (SPI) SPI Last Transfer +-// - -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- +-AT91C_SPI_MSTR EQU (0x1 << 0) ;- (SPI) Master/Slave Mode +-AT91C_SPI_PS EQU (0x1 << 1) ;- (SPI) Peripheral Select +-AT91C_SPI_PS_FIXED EQU (0x0 << 1) ;- (SPI) Fixed Peripheral Select +-AT91C_SPI_PS_VARIABLE EQU (0x1 << 1) ;- (SPI) Variable Peripheral Select +-AT91C_SPI_PCSDEC EQU (0x1 << 2) ;- (SPI) Chip Select Decode +-AT91C_SPI_FDIV EQU (0x1 << 3) ;- (SPI) Clock Selection +-AT91C_SPI_MODFDIS EQU (0x1 << 4) ;- (SPI) Mode Fault Detection +-AT91C_SPI_LLB EQU (0x1 << 7) ;- (SPI) Clock Selection +-AT91C_SPI_PCS EQU (0xF << 16) ;- (SPI) Peripheral Chip Select +-AT91C_SPI_DLYBCS EQU (0xFF << 24) ;- (SPI) Delay Between Chip Selects +-// - -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- +-AT91C_SPI_RD EQU (0xFFFF << 0) ;- (SPI) Receive Data +-AT91C_SPI_RPCS EQU (0xF << 16) ;- (SPI) Peripheral Chip Select Status +-// - -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- +-AT91C_SPI_TD EQU (0xFFFF << 0) ;- (SPI) Transmit Data +-AT91C_SPI_TPCS EQU (0xF << 16) ;- (SPI) Peripheral Chip Select Status +-// - -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- +-AT91C_SPI_RDRF EQU (0x1 << 0) ;- (SPI) Receive Data Register Full +-AT91C_SPI_TDRE EQU (0x1 << 1) ;- (SPI) Transmit Data Register Empty +-AT91C_SPI_MODF EQU (0x1 << 2) ;- (SPI) Mode Fault Error +-AT91C_SPI_OVRES EQU (0x1 << 3) ;- (SPI) Overrun Error Status +-AT91C_SPI_ENDRX EQU (0x1 << 4) ;- (SPI) End of Receiver Transfer +-AT91C_SPI_ENDTX EQU (0x1 << 5) ;- (SPI) End of Receiver Transfer +-AT91C_SPI_RXBUFF EQU (0x1 << 6) ;- (SPI) RXBUFF Interrupt +-AT91C_SPI_TXBUFE EQU (0x1 << 7) ;- (SPI) TXBUFE Interrupt +-AT91C_SPI_NSSR EQU (0x1 << 8) ;- (SPI) NSSR Interrupt +-AT91C_SPI_TXEMPTY EQU (0x1 << 9) ;- (SPI) TXEMPTY Interrupt +-AT91C_SPI_SPIENS EQU (0x1 << 16) ;- (SPI) Enable Status +-// - -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- +-// - -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- +-// - -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- +-// - -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- +-AT91C_SPI_CPOL EQU (0x1 << 0) ;- (SPI) Clock Polarity +-AT91C_SPI_NCPHA EQU (0x1 << 1) ;- (SPI) Clock Phase +-AT91C_SPI_CSAAT EQU (0x1 << 3) ;- (SPI) Chip Select Active After Transfer +-AT91C_SPI_BITS EQU (0xF << 4) ;- (SPI) Bits Per Transfer +-AT91C_SPI_BITS_8 EQU (0x0 << 4) ;- (SPI) 8 Bits Per transfer +-AT91C_SPI_BITS_9 EQU (0x1 << 4) ;- (SPI) 9 Bits Per transfer +-AT91C_SPI_BITS_10 EQU (0x2 << 4) ;- (SPI) 10 Bits Per transfer +-AT91C_SPI_BITS_11 EQU (0x3 << 4) ;- (SPI) 11 Bits Per transfer +-AT91C_SPI_BITS_12 EQU (0x4 << 4) ;- (SPI) 12 Bits Per transfer +-AT91C_SPI_BITS_13 EQU (0x5 << 4) ;- (SPI) 13 Bits Per transfer +-AT91C_SPI_BITS_14 EQU (0x6 << 4) ;- (SPI) 14 Bits Per transfer +-AT91C_SPI_BITS_15 EQU (0x7 << 4) ;- (SPI) 15 Bits Per transfer +-AT91C_SPI_BITS_16 EQU (0x8 << 4) ;- (SPI) 16 Bits Per transfer +-AT91C_SPI_SCBR EQU (0xFF << 8) ;- (SPI) Serial Clock Baud Rate +-AT91C_SPI_DLYBS EQU (0xFF << 16) ;- (SPI) Delay Before SPCK +-AT91C_SPI_DLYBCT EQU (0xFF << 24) ;- (SPI) Delay Between Consecutive Transfers +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Usart +-// - ***************************************************************************** +-// - -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- +-AT91C_US_STTBRK EQU (0x1 << 9) ;- (USART) Start Break +-AT91C_US_STPBRK EQU (0x1 << 10) ;- (USART) Stop Break +-AT91C_US_STTTO EQU (0x1 << 11) ;- (USART) Start Time-out +-AT91C_US_SENDA EQU (0x1 << 12) ;- (USART) Send Address +-AT91C_US_RSTIT EQU (0x1 << 13) ;- (USART) Reset Iterations +-AT91C_US_RSTNACK EQU (0x1 << 14) ;- (USART) Reset Non Acknowledge +-AT91C_US_RETTO EQU (0x1 << 15) ;- (USART) Rearm Time-out +-AT91C_US_DTREN EQU (0x1 << 16) ;- (USART) Data Terminal ready Enable +-AT91C_US_DTRDIS EQU (0x1 << 17) ;- (USART) Data Terminal ready Disable +-AT91C_US_RTSEN EQU (0x1 << 18) ;- (USART) Request to Send enable +-AT91C_US_RTSDIS EQU (0x1 << 19) ;- (USART) Request to Send Disable +-// - -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- +-AT91C_US_USMODE EQU (0xF << 0) ;- (USART) Usart mode +-AT91C_US_USMODE_NORMAL EQU (0x0) ;- (USART) Normal +-AT91C_US_USMODE_RS485 EQU (0x1) ;- (USART) RS485 +-AT91C_US_USMODE_HWHSH EQU (0x2) ;- (USART) Hardware Handshaking +-AT91C_US_USMODE_MODEM EQU (0x3) ;- (USART) Modem +-AT91C_US_USMODE_ISO7816_0 EQU (0x4) ;- (USART) ISO7816 protocol: T = 0 +-AT91C_US_USMODE_ISO7816_1 EQU (0x6) ;- (USART) ISO7816 protocol: T = 1 +-AT91C_US_USMODE_IRDA EQU (0x8) ;- (USART) IrDA +-AT91C_US_USMODE_SWHSH EQU (0xC) ;- (USART) Software Handshaking +-AT91C_US_CLKS EQU (0x3 << 4) ;- (USART) Clock Selection (Baud Rate generator Input Clock +-AT91C_US_CLKS_CLOCK EQU (0x0 << 4) ;- (USART) Clock +-AT91C_US_CLKS_FDIV1 EQU (0x1 << 4) ;- (USART) fdiv1 +-AT91C_US_CLKS_SLOW EQU (0x2 << 4) ;- (USART) slow_clock (ARM) +-AT91C_US_CLKS_EXT EQU (0x3 << 4) ;- (USART) External (SCK) +-AT91C_US_CHRL EQU (0x3 << 6) ;- (USART) Clock Selection (Baud Rate generator Input Clock +-AT91C_US_CHRL_5_BITS EQU (0x0 << 6) ;- (USART) Character Length: 5 bits +-AT91C_US_CHRL_6_BITS EQU (0x1 << 6) ;- (USART) Character Length: 6 bits +-AT91C_US_CHRL_7_BITS EQU (0x2 << 6) ;- (USART) Character Length: 7 bits +-AT91C_US_CHRL_8_BITS EQU (0x3 << 6) ;- (USART) Character Length: 8 bits +-AT91C_US_SYNC EQU (0x1 << 8) ;- (USART) Synchronous Mode Select +-AT91C_US_NBSTOP EQU (0x3 << 12) ;- (USART) Number of Stop bits +-AT91C_US_NBSTOP_1_BIT EQU (0x0 << 12) ;- (USART) 1 stop bit +-AT91C_US_NBSTOP_15_BIT EQU (0x1 << 12) ;- (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits +-AT91C_US_NBSTOP_2_BIT EQU (0x2 << 12) ;- (USART) 2 stop bits +-AT91C_US_MSBF EQU (0x1 << 16) ;- (USART) Bit Order +-AT91C_US_MODE9 EQU (0x1 << 17) ;- (USART) 9-bit Character length +-AT91C_US_CKLO EQU (0x1 << 18) ;- (USART) Clock Output Select +-AT91C_US_OVER EQU (0x1 << 19) ;- (USART) Over Sampling Mode +-AT91C_US_INACK EQU (0x1 << 20) ;- (USART) Inhibit Non Acknowledge +-AT91C_US_DSNACK EQU (0x1 << 21) ;- (USART) Disable Successive NACK +-AT91C_US_MAX_ITER EQU (0x1 << 24) ;- (USART) Number of Repetitions +-AT91C_US_FILTER EQU (0x1 << 28) ;- (USART) Receive Line Filter +-// - -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-AT91C_US_RXBRK EQU (0x1 << 2) ;- (USART) Break Received/End of Break +-AT91C_US_TIMEOUT EQU (0x1 << 8) ;- (USART) Receiver Time-out +-AT91C_US_ITERATION EQU (0x1 << 10) ;- (USART) Max number of Repetitions Reached +-AT91C_US_NACK EQU (0x1 << 13) ;- (USART) Non Acknowledge +-AT91C_US_RIIC EQU (0x1 << 16) ;- (USART) Ring INdicator Input Change Flag +-AT91C_US_DSRIC EQU (0x1 << 17) ;- (USART) Data Set Ready Input Change Flag +-AT91C_US_DCDIC EQU (0x1 << 18) ;- (USART) Data Carrier Flag +-AT91C_US_CTSIC EQU (0x1 << 19) ;- (USART) Clear To Send Input Change Flag +-// - -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-// - -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-// - -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- +-AT91C_US_RI EQU (0x1 << 20) ;- (USART) Image of RI Input +-AT91C_US_DSR EQU (0x1 << 21) ;- (USART) Image of DSR Input +-AT91C_US_DCD EQU (0x1 << 22) ;- (USART) Image of DCD Input +-AT91C_US_CTS EQU (0x1 << 23) ;- (USART) Image of CTS Input +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface +-// - ***************************************************************************** +-// - -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- +-AT91C_SSC_RXEN EQU (0x1 << 0) ;- (SSC) Receive Enable +-AT91C_SSC_RXDIS EQU (0x1 << 1) ;- (SSC) Receive Disable +-AT91C_SSC_TXEN EQU (0x1 << 8) ;- (SSC) Transmit Enable +-AT91C_SSC_TXDIS EQU (0x1 << 9) ;- (SSC) Transmit Disable +-AT91C_SSC_SWRST EQU (0x1 << 15) ;- (SSC) Software Reset +-// - -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- +-AT91C_SSC_CKS EQU (0x3 << 0) ;- (SSC) Receive/Transmit Clock Selection +-AT91C_SSC_CKS_DIV EQU (0x0) ;- (SSC) Divided Clock +-AT91C_SSC_CKS_TK EQU (0x1) ;- (SSC) TK Clock signal +-AT91C_SSC_CKS_RK EQU (0x2) ;- (SSC) RK pin +-AT91C_SSC_CKO EQU (0x7 << 2) ;- (SSC) Receive/Transmit Clock Output Mode Selection +-AT91C_SSC_CKO_NONE EQU (0x0 << 2) ;- (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only +-AT91C_SSC_CKO_CONTINOUS EQU (0x1 << 2) ;- (SSC) Continuous Receive/Transmit Clock RK pin: Output +-AT91C_SSC_CKO_DATA_TX EQU (0x2 << 2) ;- (SSC) Receive/Transmit Clock only during data transfers RK pin: Output +-AT91C_SSC_CKI EQU (0x1 << 5) ;- (SSC) Receive/Transmit Clock Inversion +-AT91C_SSC_CKG EQU (0x3 << 6) ;- (SSC) Receive/Transmit Clock Gating Selection +-AT91C_SSC_CKG_NONE EQU (0x0 << 6) ;- (SSC) Receive/Transmit Clock Gating: None, continuous clock +-AT91C_SSC_CKG_LOW EQU (0x1 << 6) ;- (SSC) Receive/Transmit Clock enabled only if RF Low +-AT91C_SSC_CKG_HIGH EQU (0x2 << 6) ;- (SSC) Receive/Transmit Clock enabled only if RF High +-AT91C_SSC_START EQU (0xF << 8) ;- (SSC) Receive/Transmit Start Selection +-AT91C_SSC_START_CONTINOUS EQU (0x0 << 8) ;- (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. +-AT91C_SSC_START_TX EQU (0x1 << 8) ;- (SSC) Transmit/Receive start +-AT91C_SSC_START_LOW_RF EQU (0x2 << 8) ;- (SSC) Detection of a low level on RF input +-AT91C_SSC_START_HIGH_RF EQU (0x3 << 8) ;- (SSC) Detection of a high level on RF input +-AT91C_SSC_START_FALL_RF EQU (0x4 << 8) ;- (SSC) Detection of a falling edge on RF input +-AT91C_SSC_START_RISE_RF EQU (0x5 << 8) ;- (SSC) Detection of a rising edge on RF input +-AT91C_SSC_START_LEVEL_RF EQU (0x6 << 8) ;- (SSC) Detection of any level change on RF input +-AT91C_SSC_START_EDGE_RF EQU (0x7 << 8) ;- (SSC) Detection of any edge on RF input +-AT91C_SSC_START_0 EQU (0x8 << 8) ;- (SSC) Compare 0 +-AT91C_SSC_STOP EQU (0x1 << 12) ;- (SSC) Receive Stop Selection +-AT91C_SSC_STTDLY EQU (0xFF << 16) ;- (SSC) Receive/Transmit Start Delay +-AT91C_SSC_PERIOD EQU (0xFF << 24) ;- (SSC) Receive/Transmit Period Divider Selection +-// - -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- +-AT91C_SSC_DATLEN EQU (0x1F << 0) ;- (SSC) Data Length +-AT91C_SSC_LOOP EQU (0x1 << 5) ;- (SSC) Loop Mode +-AT91C_SSC_MSBF EQU (0x1 << 7) ;- (SSC) Most Significant Bit First +-AT91C_SSC_DATNB EQU (0xF << 8) ;- (SSC) Data Number per Frame +-AT91C_SSC_FSLEN EQU (0xF << 16) ;- (SSC) Receive/Transmit Frame Sync length +-AT91C_SSC_FSOS EQU (0x7 << 20) ;- (SSC) Receive/Transmit Frame Sync Output Selection +-AT91C_SSC_FSOS_NONE EQU (0x0 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only +-AT91C_SSC_FSOS_NEGATIVE EQU (0x1 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse +-AT91C_SSC_FSOS_POSITIVE EQU (0x2 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse +-AT91C_SSC_FSOS_LOW EQU (0x3 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer +-AT91C_SSC_FSOS_HIGH EQU (0x4 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer +-AT91C_SSC_FSOS_TOGGLE EQU (0x5 << 20) ;- (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer +-AT91C_SSC_FSEDGE EQU (0x1 << 24) ;- (SSC) Frame Sync Edge Detection +-// - -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- +-// - -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- +-AT91C_SSC_DATDEF EQU (0x1 << 5) ;- (SSC) Data Default Value +-AT91C_SSC_FSDEN EQU (0x1 << 23) ;- (SSC) Frame Sync Data Enable +-// - -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- +-AT91C_SSC_TXRDY EQU (0x1 << 0) ;- (SSC) Transmit Ready +-AT91C_SSC_TXEMPTY EQU (0x1 << 1) ;- (SSC) Transmit Empty +-AT91C_SSC_ENDTX EQU (0x1 << 2) ;- (SSC) End Of Transmission +-AT91C_SSC_TXBUFE EQU (0x1 << 3) ;- (SSC) Transmit Buffer Empty +-AT91C_SSC_RXRDY EQU (0x1 << 4) ;- (SSC) Receive Ready +-AT91C_SSC_OVRUN EQU (0x1 << 5) ;- (SSC) Receive Overrun +-AT91C_SSC_ENDRX EQU (0x1 << 6) ;- (SSC) End of Reception +-AT91C_SSC_RXBUFF EQU (0x1 << 7) ;- (SSC) Receive Buffer Full +-AT91C_SSC_CP0 EQU (0x1 << 8) ;- (SSC) Compare 0 +-AT91C_SSC_CP1 EQU (0x1 << 9) ;- (SSC) Compare 1 +-AT91C_SSC_TXSYN EQU (0x1 << 10) ;- (SSC) Transmit Sync +-AT91C_SSC_RXSYN EQU (0x1 << 11) ;- (SSC) Receive Sync +-AT91C_SSC_TXENA EQU (0x1 << 16) ;- (SSC) Transmit Enable +-AT91C_SSC_RXENA EQU (0x1 << 17) ;- (SSC) Receive Enable +-// - -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- +-// - -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- +-// - -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Two-wire Interface +-// - ***************************************************************************** +-// - -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- +-AT91C_TWI_START EQU (0x1 << 0) ;- (TWI) Send a START Condition +-AT91C_TWI_STOP EQU (0x1 << 1) ;- (TWI) Send a STOP Condition +-AT91C_TWI_MSEN EQU (0x1 << 2) ;- (TWI) TWI Master Transfer Enabled +-AT91C_TWI_MSDIS EQU (0x1 << 3) ;- (TWI) TWI Master Transfer Disabled +-AT91C_TWI_SWRST EQU (0x1 << 7) ;- (TWI) Software Reset +-// - -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- +-AT91C_TWI_IADRSZ EQU (0x3 << 8) ;- (TWI) Internal Device Address Size +-AT91C_TWI_IADRSZ_NO EQU (0x0 << 8) ;- (TWI) No internal device address +-AT91C_TWI_IADRSZ_1_BYTE EQU (0x1 << 8) ;- (TWI) One-byte internal device address +-AT91C_TWI_IADRSZ_2_BYTE EQU (0x2 << 8) ;- (TWI) Two-byte internal device address +-AT91C_TWI_IADRSZ_3_BYTE EQU (0x3 << 8) ;- (TWI) Three-byte internal device address +-AT91C_TWI_MREAD EQU (0x1 << 12) ;- (TWI) Master Read Direction +-AT91C_TWI_DADR EQU (0x7F << 16) ;- (TWI) Device Address +-// - -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- +-AT91C_TWI_CLDIV EQU (0xFF << 0) ;- (TWI) Clock Low Divider +-AT91C_TWI_CHDIV EQU (0xFF << 8) ;- (TWI) Clock High Divider +-AT91C_TWI_CKDIV EQU (0x7 << 16) ;- (TWI) Clock Divider +-// - -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- +-AT91C_TWI_TXCOMP EQU (0x1 << 0) ;- (TWI) Transmission Completed +-AT91C_TWI_RXRDY EQU (0x1 << 1) ;- (TWI) Receive holding register ReaDY +-AT91C_TWI_TXRDY EQU (0x1 << 2) ;- (TWI) Transmit holding register ReaDY +-AT91C_TWI_OVRE EQU (0x1 << 6) ;- (TWI) Overrun Error +-AT91C_TWI_UNRE EQU (0x1 << 7) ;- (TWI) Underrun Error +-AT91C_TWI_NACK EQU (0x1 << 8) ;- (TWI) Not Acknowledged +-// - -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- +-// - -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- +-// - -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR PWMC Channel Interface +-// - ***************************************************************************** +-// - -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- +-AT91C_PWMC_CPRE EQU (0xF << 0) ;- (PWMC_CH) Channel Pre-scaler : PWMC_CLKx +-AT91C_PWMC_CPRE_MCK EQU (0x0) ;- (PWMC_CH) +-AT91C_PWMC_CPRE_MCKA EQU (0xB) ;- (PWMC_CH) +-AT91C_PWMC_CPRE_MCKB EQU (0xC) ;- (PWMC_CH) +-AT91C_PWMC_CALG EQU (0x1 << 8) ;- (PWMC_CH) Channel Alignment +-AT91C_PWMC_CPOL EQU (0x1 << 9) ;- (PWMC_CH) Channel Polarity +-AT91C_PWMC_CPD EQU (0x1 << 10) ;- (PWMC_CH) Channel Update Period +-// - -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- +-AT91C_PWMC_CDTY EQU (0x0 << 0) ;- (PWMC_CH) Channel Duty Cycle +-// - -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- +-AT91C_PWMC_CPRD EQU (0x0 << 0) ;- (PWMC_CH) Channel Period +-// - -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- +-AT91C_PWMC_CCNT EQU (0x0 << 0) ;- (PWMC_CH) Channel Counter +-// - -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- +-AT91C_PWMC_CUPD EQU (0x0 << 0) ;- (PWMC_CH) Channel Update +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface +-// - ***************************************************************************** +-// - -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- +-AT91C_PWMC_DIVA EQU (0xFF << 0) ;- (PWMC) CLKA divide factor. +-AT91C_PWMC_PREA EQU (0xF << 8) ;- (PWMC) Divider Input Clock Prescaler A +-AT91C_PWMC_PREA_MCK EQU (0x0 << 8) ;- (PWMC) +-AT91C_PWMC_DIVB EQU (0xFF << 16) ;- (PWMC) CLKB divide factor. +-AT91C_PWMC_PREB EQU (0xF << 24) ;- (PWMC) Divider Input Clock Prescaler B +-AT91C_PWMC_PREB_MCK EQU (0x0 << 24) ;- (PWMC) +-// - -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- +-AT91C_PWMC_CHID0 EQU (0x1 << 0) ;- (PWMC) Channel ID 0 +-AT91C_PWMC_CHID1 EQU (0x1 << 1) ;- (PWMC) Channel ID 1 +-AT91C_PWMC_CHID2 EQU (0x1 << 2) ;- (PWMC) Channel ID 2 +-AT91C_PWMC_CHID3 EQU (0x1 << 3) ;- (PWMC) Channel ID 3 +-// - -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- +-// - -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- +-// - -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- +-// - -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- +-// - -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- +-// - -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR USB Device Interface +-// - ***************************************************************************** +-// - -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- +-AT91C_UDP_FRM_NUM EQU (0x7FF << 0) ;- (UDP) Frame Number as Defined in the Packet Field Formats +-AT91C_UDP_FRM_ERR EQU (0x1 << 16) ;- (UDP) Frame Error +-AT91C_UDP_FRM_OK EQU (0x1 << 17) ;- (UDP) Frame OK +-// - -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- +-AT91C_UDP_FADDEN EQU (0x1 << 0) ;- (UDP) Function Address Enable +-AT91C_UDP_CONFG EQU (0x1 << 1) ;- (UDP) Configured +-AT91C_UDP_ESR EQU (0x1 << 2) ;- (UDP) Enable Send Resume +-AT91C_UDP_RSMINPR EQU (0x1 << 3) ;- (UDP) A Resume Has Been Sent to the Host +-AT91C_UDP_RMWUPE EQU (0x1 << 4) ;- (UDP) Remote Wake Up Enable +-// - -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- +-AT91C_UDP_FADD EQU (0xFF << 0) ;- (UDP) Function Address Value +-AT91C_UDP_FEN EQU (0x1 << 8) ;- (UDP) Function Enable +-// - -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- +-AT91C_UDP_EPINT0 EQU (0x1 << 0) ;- (UDP) Endpoint 0 Interrupt +-AT91C_UDP_EPINT1 EQU (0x1 << 1) ;- (UDP) Endpoint 0 Interrupt +-AT91C_UDP_EPINT2 EQU (0x1 << 2) ;- (UDP) Endpoint 2 Interrupt +-AT91C_UDP_EPINT3 EQU (0x1 << 3) ;- (UDP) Endpoint 3 Interrupt +-AT91C_UDP_EPINT4 EQU (0x1 << 4) ;- (UDP) Endpoint 4 Interrupt +-AT91C_UDP_EPINT5 EQU (0x1 << 5) ;- (UDP) Endpoint 5 Interrupt +-AT91C_UDP_RXSUSP EQU (0x1 << 8) ;- (UDP) USB Suspend Interrupt +-AT91C_UDP_RXRSM EQU (0x1 << 9) ;- (UDP) USB Resume Interrupt +-AT91C_UDP_EXTRSM EQU (0x1 << 10) ;- (UDP) USB External Resume Interrupt +-AT91C_UDP_SOFINT EQU (0x1 << 11) ;- (UDP) USB Start Of frame Interrupt +-AT91C_UDP_WAKEUP EQU (0x1 << 13) ;- (UDP) USB Resume Interrupt +-// - -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- +-// - -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- +-// - -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- +-AT91C_UDP_ENDBUSRES EQU (0x1 << 12) ;- (UDP) USB End Of Bus Reset Interrupt +-// - -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- +-// - -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- +-AT91C_UDP_EP0 EQU (0x1 << 0) ;- (UDP) Reset Endpoint 0 +-AT91C_UDP_EP1 EQU (0x1 << 1) ;- (UDP) Reset Endpoint 1 +-AT91C_UDP_EP2 EQU (0x1 << 2) ;- (UDP) Reset Endpoint 2 +-AT91C_UDP_EP3 EQU (0x1 << 3) ;- (UDP) Reset Endpoint 3 +-AT91C_UDP_EP4 EQU (0x1 << 4) ;- (UDP) Reset Endpoint 4 +-AT91C_UDP_EP5 EQU (0x1 << 5) ;- (UDP) Reset Endpoint 5 +-// - -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- +-AT91C_UDP_TXCOMP EQU (0x1 << 0) ;- (UDP) Generates an IN packet with data previously written in the DPR +-AT91C_UDP_RX_DATA_BK0 EQU (0x1 << 1) ;- (UDP) Receive Data Bank 0 +-AT91C_UDP_RXSETUP EQU (0x1 << 2) ;- (UDP) Sends STALL to the Host (Control endpoints) +-AT91C_UDP_ISOERROR EQU (0x1 << 3) ;- (UDP) Isochronous error (Isochronous endpoints) +-AT91C_UDP_TXPKTRDY EQU (0x1 << 4) ;- (UDP) Transmit Packet Ready +-AT91C_UDP_FORCESTALL EQU (0x1 << 5) ;- (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). +-AT91C_UDP_RX_DATA_BK1 EQU (0x1 << 6) ;- (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). +-AT91C_UDP_DIR EQU (0x1 << 7) ;- (UDP) Transfer Direction +-AT91C_UDP_EPTYPE EQU (0x7 << 8) ;- (UDP) Endpoint type +-AT91C_UDP_EPTYPE_CTRL EQU (0x0 << 8) ;- (UDP) Control +-AT91C_UDP_EPTYPE_ISO_OUT EQU (0x1 << 8) ;- (UDP) Isochronous OUT +-AT91C_UDP_EPTYPE_BULK_OUT EQU (0x2 << 8) ;- (UDP) Bulk OUT +-AT91C_UDP_EPTYPE_INT_OUT EQU (0x3 << 8) ;- (UDP) Interrupt OUT +-AT91C_UDP_EPTYPE_ISO_IN EQU (0x5 << 8) ;- (UDP) Isochronous IN +-AT91C_UDP_EPTYPE_BULK_IN EQU (0x6 << 8) ;- (UDP) Bulk IN +-AT91C_UDP_EPTYPE_INT_IN EQU (0x7 << 8) ;- (UDP) Interrupt IN +-AT91C_UDP_DTGLE EQU (0x1 << 11) ;- (UDP) Data Toggle +-AT91C_UDP_EPEDS EQU (0x1 << 15) ;- (UDP) Endpoint Enable Disable +-AT91C_UDP_RXBYTECNT EQU (0x7FF << 16) ;- (UDP) Number Of Bytes Available in the FIFO +-// - -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- +-AT91C_UDP_TXVDIS EQU (0x1 << 8) ;- (UDP) +-AT91C_UDP_PUON EQU (0x1 << 9) ;- (UDP) Pull-up ON +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Timer Counter Channel Interface +-// - ***************************************************************************** +-// - -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- +-AT91C_TC_CLKEN EQU (0x1 << 0) ;- (TC) Counter Clock Enable Command +-AT91C_TC_CLKDIS EQU (0x1 << 1) ;- (TC) Counter Clock Disable Command +-AT91C_TC_SWTRG EQU (0x1 << 2) ;- (TC) Software Trigger Command +-// - -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- +-AT91C_TC_CLKS EQU (0x7 << 0) ;- (TC) Clock Selection +-AT91C_TC_CLKS_TIMER_DIV1_CLOCK EQU (0x0) ;- (TC) Clock selected: TIMER_DIV1_CLOCK +-AT91C_TC_CLKS_TIMER_DIV2_CLOCK EQU (0x1) ;- (TC) Clock selected: TIMER_DIV2_CLOCK +-AT91C_TC_CLKS_TIMER_DIV3_CLOCK EQU (0x2) ;- (TC) Clock selected: TIMER_DIV3_CLOCK +-AT91C_TC_CLKS_TIMER_DIV4_CLOCK EQU (0x3) ;- (TC) Clock selected: TIMER_DIV4_CLOCK +-AT91C_TC_CLKS_TIMER_DIV5_CLOCK EQU (0x4) ;- (TC) Clock selected: TIMER_DIV5_CLOCK +-AT91C_TC_CLKS_XC0 EQU (0x5) ;- (TC) Clock selected: XC0 +-AT91C_TC_CLKS_XC1 EQU (0x6) ;- (TC) Clock selected: XC1 +-AT91C_TC_CLKS_XC2 EQU (0x7) ;- (TC) Clock selected: XC2 +-AT91C_TC_CLKI EQU (0x1 << 3) ;- (TC) Clock Invert +-AT91C_TC_BURST EQU (0x3 << 4) ;- (TC) Burst Signal Selection +-AT91C_TC_BURST_NONE EQU (0x0 << 4) ;- (TC) The clock is not gated by an external signal +-AT91C_TC_BURST_XC0 EQU (0x1 << 4) ;- (TC) XC0 is ANDed with the selected clock +-AT91C_TC_BURST_XC1 EQU (0x2 << 4) ;- (TC) XC1 is ANDed with the selected clock +-AT91C_TC_BURST_XC2 EQU (0x3 << 4) ;- (TC) XC2 is ANDed with the selected clock +-AT91C_TC_CPCSTOP EQU (0x1 << 6) ;- (TC) Counter Clock Stopped with RC Compare +-AT91C_TC_LDBSTOP EQU (0x1 << 6) ;- (TC) Counter Clock Stopped with RB Loading +-AT91C_TC_CPCDIS EQU (0x1 << 7) ;- (TC) Counter Clock Disable with RC Compare +-AT91C_TC_LDBDIS EQU (0x1 << 7) ;- (TC) Counter Clock Disabled with RB Loading +-AT91C_TC_ETRGEDG EQU (0x3 << 8) ;- (TC) External Trigger Edge Selection +-AT91C_TC_ETRGEDG_NONE EQU (0x0 << 8) ;- (TC) Edge: None +-AT91C_TC_ETRGEDG_RISING EQU (0x1 << 8) ;- (TC) Edge: rising edge +-AT91C_TC_ETRGEDG_FALLING EQU (0x2 << 8) ;- (TC) Edge: falling edge +-AT91C_TC_ETRGEDG_BOTH EQU (0x3 << 8) ;- (TC) Edge: each edge +-AT91C_TC_EEVTEDG EQU (0x3 << 8) ;- (TC) External Event Edge Selection +-AT91C_TC_EEVTEDG_NONE EQU (0x0 << 8) ;- (TC) Edge: None +-AT91C_TC_EEVTEDG_RISING EQU (0x1 << 8) ;- (TC) Edge: rising edge +-AT91C_TC_EEVTEDG_FALLING EQU (0x2 << 8) ;- (TC) Edge: falling edge +-AT91C_TC_EEVTEDG_BOTH EQU (0x3 << 8) ;- (TC) Edge: each edge +-AT91C_TC_EEVT EQU (0x3 << 10) ;- (TC) External Event Selection +-AT91C_TC_EEVT_TIOB EQU (0x0 << 10) ;- (TC) Signal selected as external event: TIOB TIOB direction: input +-AT91C_TC_EEVT_XC0 EQU (0x1 << 10) ;- (TC) Signal selected as external event: XC0 TIOB direction: output +-AT91C_TC_EEVT_XC1 EQU (0x2 << 10) ;- (TC) Signal selected as external event: XC1 TIOB direction: output +-AT91C_TC_EEVT_XC2 EQU (0x3 << 10) ;- (TC) Signal selected as external event: XC2 TIOB direction: output +-AT91C_TC_ABETRG EQU (0x1 << 10) ;- (TC) TIOA or TIOB External Trigger Selection +-AT91C_TC_ENETRG EQU (0x1 << 12) ;- (TC) External Event Trigger enable +-AT91C_TC_WAVESEL EQU (0x3 << 13) ;- (TC) Waveform Selection +-AT91C_TC_WAVESEL_UP EQU (0x0 << 13) ;- (TC) UP mode without atomatic trigger on RC Compare +-AT91C_TC_WAVESEL_UPDOWN EQU (0x1 << 13) ;- (TC) UPDOWN mode without automatic trigger on RC Compare +-AT91C_TC_WAVESEL_UP_AUTO EQU (0x2 << 13) ;- (TC) UP mode with automatic trigger on RC Compare +-AT91C_TC_WAVESEL_UPDOWN_AUTO EQU (0x3 << 13) ;- (TC) UPDOWN mode with automatic trigger on RC Compare +-AT91C_TC_CPCTRG EQU (0x1 << 14) ;- (TC) RC Compare Trigger Enable +-AT91C_TC_WAVE EQU (0x1 << 15) ;- (TC) +-AT91C_TC_ACPA EQU (0x3 << 16) ;- (TC) RA Compare Effect on TIOA +-AT91C_TC_ACPA_NONE EQU (0x0 << 16) ;- (TC) Effect: none +-AT91C_TC_ACPA_SET EQU (0x1 << 16) ;- (TC) Effect: set +-AT91C_TC_ACPA_CLEAR EQU (0x2 << 16) ;- (TC) Effect: clear +-AT91C_TC_ACPA_TOGGLE EQU (0x3 << 16) ;- (TC) Effect: toggle +-AT91C_TC_LDRA EQU (0x3 << 16) ;- (TC) RA Loading Selection +-AT91C_TC_LDRA_NONE EQU (0x0 << 16) ;- (TC) Edge: None +-AT91C_TC_LDRA_RISING EQU (0x1 << 16) ;- (TC) Edge: rising edge of TIOA +-AT91C_TC_LDRA_FALLING EQU (0x2 << 16) ;- (TC) Edge: falling edge of TIOA +-AT91C_TC_LDRA_BOTH EQU (0x3 << 16) ;- (TC) Edge: each edge of TIOA +-AT91C_TC_ACPC EQU (0x3 << 18) ;- (TC) RC Compare Effect on TIOA +-AT91C_TC_ACPC_NONE EQU (0x0 << 18) ;- (TC) Effect: none +-AT91C_TC_ACPC_SET EQU (0x1 << 18) ;- (TC) Effect: set +-AT91C_TC_ACPC_CLEAR EQU (0x2 << 18) ;- (TC) Effect: clear +-AT91C_TC_ACPC_TOGGLE EQU (0x3 << 18) ;- (TC) Effect: toggle +-AT91C_TC_LDRB EQU (0x3 << 18) ;- (TC) RB Loading Selection +-AT91C_TC_LDRB_NONE EQU (0x0 << 18) ;- (TC) Edge: None +-AT91C_TC_LDRB_RISING EQU (0x1 << 18) ;- (TC) Edge: rising edge of TIOA +-AT91C_TC_LDRB_FALLING EQU (0x2 << 18) ;- (TC) Edge: falling edge of TIOA +-AT91C_TC_LDRB_BOTH EQU (0x3 << 18) ;- (TC) Edge: each edge of TIOA +-AT91C_TC_AEEVT EQU (0x3 << 20) ;- (TC) External Event Effect on TIOA +-AT91C_TC_AEEVT_NONE EQU (0x0 << 20) ;- (TC) Effect: none +-AT91C_TC_AEEVT_SET EQU (0x1 << 20) ;- (TC) Effect: set +-AT91C_TC_AEEVT_CLEAR EQU (0x2 << 20) ;- (TC) Effect: clear +-AT91C_TC_AEEVT_TOGGLE EQU (0x3 << 20) ;- (TC) Effect: toggle +-AT91C_TC_ASWTRG EQU (0x3 << 22) ;- (TC) Software Trigger Effect on TIOA +-AT91C_TC_ASWTRG_NONE EQU (0x0 << 22) ;- (TC) Effect: none +-AT91C_TC_ASWTRG_SET EQU (0x1 << 22) ;- (TC) Effect: set +-AT91C_TC_ASWTRG_CLEAR EQU (0x2 << 22) ;- (TC) Effect: clear +-AT91C_TC_ASWTRG_TOGGLE EQU (0x3 << 22) ;- (TC) Effect: toggle +-AT91C_TC_BCPB EQU (0x3 << 24) ;- (TC) RB Compare Effect on TIOB +-AT91C_TC_BCPB_NONE EQU (0x0 << 24) ;- (TC) Effect: none +-AT91C_TC_BCPB_SET EQU (0x1 << 24) ;- (TC) Effect: set +-AT91C_TC_BCPB_CLEAR EQU (0x2 << 24) ;- (TC) Effect: clear +-AT91C_TC_BCPB_TOGGLE EQU (0x3 << 24) ;- (TC) Effect: toggle +-AT91C_TC_BCPC EQU (0x3 << 26) ;- (TC) RC Compare Effect on TIOB +-AT91C_TC_BCPC_NONE EQU (0x0 << 26) ;- (TC) Effect: none +-AT91C_TC_BCPC_SET EQU (0x1 << 26) ;- (TC) Effect: set +-AT91C_TC_BCPC_CLEAR EQU (0x2 << 26) ;- (TC) Effect: clear +-AT91C_TC_BCPC_TOGGLE EQU (0x3 << 26) ;- (TC) Effect: toggle +-AT91C_TC_BEEVT EQU (0x3 << 28) ;- (TC) External Event Effect on TIOB +-AT91C_TC_BEEVT_NONE EQU (0x0 << 28) ;- (TC) Effect: none +-AT91C_TC_BEEVT_SET EQU (0x1 << 28) ;- (TC) Effect: set +-AT91C_TC_BEEVT_CLEAR EQU (0x2 << 28) ;- (TC) Effect: clear +-AT91C_TC_BEEVT_TOGGLE EQU (0x3 << 28) ;- (TC) Effect: toggle +-AT91C_TC_BSWTRG EQU (0x3 << 30) ;- (TC) Software Trigger Effect on TIOB +-AT91C_TC_BSWTRG_NONE EQU (0x0 << 30) ;- (TC) Effect: none +-AT91C_TC_BSWTRG_SET EQU (0x1 << 30) ;- (TC) Effect: set +-AT91C_TC_BSWTRG_CLEAR EQU (0x2 << 30) ;- (TC) Effect: clear +-AT91C_TC_BSWTRG_TOGGLE EQU (0x3 << 30) ;- (TC) Effect: toggle +-// - -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- +-AT91C_TC_COVFS EQU (0x1 << 0) ;- (TC) Counter Overflow +-AT91C_TC_LOVRS EQU (0x1 << 1) ;- (TC) Load Overrun +-AT91C_TC_CPAS EQU (0x1 << 2) ;- (TC) RA Compare +-AT91C_TC_CPBS EQU (0x1 << 3) ;- (TC) RB Compare +-AT91C_TC_CPCS EQU (0x1 << 4) ;- (TC) RC Compare +-AT91C_TC_LDRAS EQU (0x1 << 5) ;- (TC) RA Loading +-AT91C_TC_LDRBS EQU (0x1 << 6) ;- (TC) RB Loading +-AT91C_TC_ETRGS EQU (0x1 << 7) ;- (TC) External Trigger +-AT91C_TC_CLKSTA EQU (0x1 << 16) ;- (TC) Clock Enabling +-AT91C_TC_MTIOA EQU (0x1 << 17) ;- (TC) TIOA Mirror +-AT91C_TC_MTIOB EQU (0x1 << 18) ;- (TC) TIOA Mirror +-// - -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- +-// - -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- +-// - -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Timer Counter Interface +-// - ***************************************************************************** +-// - -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- +-AT91C_TCB_SYNC EQU (0x1 << 0) ;- (TCB) Synchro Command +-// - -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- +-AT91C_TCB_TC0XC0S EQU (0x3 << 0) ;- (TCB) External Clock Signal 0 Selection +-AT91C_TCB_TC0XC0S_TCLK0 EQU (0x0) ;- (TCB) TCLK0 connected to XC0 +-AT91C_TCB_TC0XC0S_NONE EQU (0x1) ;- (TCB) None signal connected to XC0 +-AT91C_TCB_TC0XC0S_TIOA1 EQU (0x2) ;- (TCB) TIOA1 connected to XC0 +-AT91C_TCB_TC0XC0S_TIOA2 EQU (0x3) ;- (TCB) TIOA2 connected to XC0 +-AT91C_TCB_TC1XC1S EQU (0x3 << 2) ;- (TCB) External Clock Signal 1 Selection +-AT91C_TCB_TC1XC1S_TCLK1 EQU (0x0 << 2) ;- (TCB) TCLK1 connected to XC1 +-AT91C_TCB_TC1XC1S_NONE EQU (0x1 << 2) ;- (TCB) None signal connected to XC1 +-AT91C_TCB_TC1XC1S_TIOA0 EQU (0x2 << 2) ;- (TCB) TIOA0 connected to XC1 +-AT91C_TCB_TC1XC1S_TIOA2 EQU (0x3 << 2) ;- (TCB) TIOA2 connected to XC1 +-AT91C_TCB_TC2XC2S EQU (0x3 << 4) ;- (TCB) External Clock Signal 2 Selection +-AT91C_TCB_TC2XC2S_TCLK2 EQU (0x0 << 4) ;- (TCB) TCLK2 connected to XC2 +-AT91C_TCB_TC2XC2S_NONE EQU (0x1 << 4) ;- (TCB) None signal connected to XC2 +-AT91C_TCB_TC2XC2S_TIOA0 EQU (0x2 << 4) ;- (TCB) TIOA0 connected to XC2 +-AT91C_TCB_TC2XC2S_TIOA1 EQU (0x3 << 4) ;- (TCB) TIOA2 connected to XC2 +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface +-// - ***************************************************************************** +-// - -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- +-AT91C_CAN_MTIMEMARK EQU (0xFFFF << 0) ;- (CAN_MB) Mailbox Timemark +-AT91C_CAN_PRIOR EQU (0xF << 16) ;- (CAN_MB) Mailbox Priority +-AT91C_CAN_MOT EQU (0x7 << 24) ;- (CAN_MB) Mailbox Object Type +-AT91C_CAN_MOT_DIS EQU (0x0 << 24) ;- (CAN_MB) +-AT91C_CAN_MOT_RX EQU (0x1 << 24) ;- (CAN_MB) +-AT91C_CAN_MOT_RXOVERWRITE EQU (0x2 << 24) ;- (CAN_MB) +-AT91C_CAN_MOT_TX EQU (0x3 << 24) ;- (CAN_MB) +-AT91C_CAN_MOT_CONSUMER EQU (0x4 << 24) ;- (CAN_MB) +-AT91C_CAN_MOT_PRODUCER EQU (0x5 << 24) ;- (CAN_MB) +-// - -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- +-AT91C_CAN_MIDvB EQU (0x3FFFF << 0) ;- (CAN_MB) Complementary bits for identifier in extended mode +-AT91C_CAN_MIDvA EQU (0x7FF << 18) ;- (CAN_MB) Identifier for standard frame mode +-AT91C_CAN_MIDE EQU (0x1 << 29) ;- (CAN_MB) Identifier Version +-// - -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- +-// - -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- +-// - -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- +-AT91C_CAN_MTIMESTAMP EQU (0xFFFF << 0) ;- (CAN_MB) Timer Value +-AT91C_CAN_MDLC EQU (0xF << 16) ;- (CAN_MB) Mailbox Data Length Code +-AT91C_CAN_MRTR EQU (0x1 << 20) ;- (CAN_MB) Mailbox Remote Transmission Request +-AT91C_CAN_MABT EQU (0x1 << 22) ;- (CAN_MB) Mailbox Message Abort +-AT91C_CAN_MRDY EQU (0x1 << 23) ;- (CAN_MB) Mailbox Ready +-AT91C_CAN_MMI EQU (0x1 << 24) ;- (CAN_MB) Mailbox Message Ignored +-// - -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- +-// - -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- +-// - -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- +-AT91C_CAN_MACR EQU (0x1 << 22) ;- (CAN_MB) Abort Request for Mailbox +-AT91C_CAN_MTCR EQU (0x1 << 23) ;- (CAN_MB) Mailbox Transfer Command +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Control Area Network Interface +-// - ***************************************************************************** +-// - -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- +-AT91C_CAN_CANEN EQU (0x1 << 0) ;- (CAN) CAN Controller Enable +-AT91C_CAN_LPM EQU (0x1 << 1) ;- (CAN) Disable/Enable Low Power Mode +-AT91C_CAN_ABM EQU (0x1 << 2) ;- (CAN) Disable/Enable Autobaud/Listen Mode +-AT91C_CAN_OVL EQU (0x1 << 3) ;- (CAN) Disable/Enable Overload Frame +-AT91C_CAN_TEOF EQU (0x1 << 4) ;- (CAN) Time Stamp messages at each end of Frame +-AT91C_CAN_TTM EQU (0x1 << 5) ;- (CAN) Disable/Enable Time Trigger Mode +-AT91C_CAN_TIMFRZ EQU (0x1 << 6) ;- (CAN) Enable Timer Freeze +-AT91C_CAN_DRPT EQU (0x1 << 7) ;- (CAN) Disable Repeat +-// - -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- +-AT91C_CAN_MB0 EQU (0x1 << 0) ;- (CAN) Mailbox 0 Flag +-AT91C_CAN_MB1 EQU (0x1 << 1) ;- (CAN) Mailbox 1 Flag +-AT91C_CAN_MB2 EQU (0x1 << 2) ;- (CAN) Mailbox 2 Flag +-AT91C_CAN_MB3 EQU (0x1 << 3) ;- (CAN) Mailbox 3 Flag +-AT91C_CAN_MB4 EQU (0x1 << 4) ;- (CAN) Mailbox 4 Flag +-AT91C_CAN_MB5 EQU (0x1 << 5) ;- (CAN) Mailbox 5 Flag +-AT91C_CAN_MB6 EQU (0x1 << 6) ;- (CAN) Mailbox 6 Flag +-AT91C_CAN_MB7 EQU (0x1 << 7) ;- (CAN) Mailbox 7 Flag +-AT91C_CAN_MB8 EQU (0x1 << 8) ;- (CAN) Mailbox 8 Flag +-AT91C_CAN_MB9 EQU (0x1 << 9) ;- (CAN) Mailbox 9 Flag +-AT91C_CAN_MB10 EQU (0x1 << 10) ;- (CAN) Mailbox 10 Flag +-AT91C_CAN_MB11 EQU (0x1 << 11) ;- (CAN) Mailbox 11 Flag +-AT91C_CAN_MB12 EQU (0x1 << 12) ;- (CAN) Mailbox 12 Flag +-AT91C_CAN_MB13 EQU (0x1 << 13) ;- (CAN) Mailbox 13 Flag +-AT91C_CAN_MB14 EQU (0x1 << 14) ;- (CAN) Mailbox 14 Flag +-AT91C_CAN_MB15 EQU (0x1 << 15) ;- (CAN) Mailbox 15 Flag +-AT91C_CAN_ERRA EQU (0x1 << 16) ;- (CAN) Error Active Mode Flag +-AT91C_CAN_WARN EQU (0x1 << 17) ;- (CAN) Warning Limit Flag +-AT91C_CAN_ERRP EQU (0x1 << 18) ;- (CAN) Error Passive Mode Flag +-AT91C_CAN_BOFF EQU (0x1 << 19) ;- (CAN) Bus Off Mode Flag +-AT91C_CAN_SLEEP EQU (0x1 << 20) ;- (CAN) Sleep Flag +-AT91C_CAN_WAKEUP EQU (0x1 << 21) ;- (CAN) Wakeup Flag +-AT91C_CAN_TOVF EQU (0x1 << 22) ;- (CAN) Timer Overflow Flag +-AT91C_CAN_TSTP EQU (0x1 << 23) ;- (CAN) Timestamp Flag +-AT91C_CAN_CERR EQU (0x1 << 24) ;- (CAN) CRC Error +-AT91C_CAN_SERR EQU (0x1 << 25) ;- (CAN) Stuffing Error +-AT91C_CAN_AERR EQU (0x1 << 26) ;- (CAN) Acknowledgment Error +-AT91C_CAN_FERR EQU (0x1 << 27) ;- (CAN) Form Error +-AT91C_CAN_BERR EQU (0x1 << 28) ;- (CAN) Bit Error +-// - -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- +-// - -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- +-// - -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- +-AT91C_CAN_RBSY EQU (0x1 << 29) ;- (CAN) Receiver Busy +-AT91C_CAN_TBSY EQU (0x1 << 30) ;- (CAN) Transmitter Busy +-AT91C_CAN_OVLY EQU (0x1 << 31) ;- (CAN) Overload Busy +-// - -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- +-AT91C_CAN_PHASE2 EQU (0x7 << 0) ;- (CAN) Phase 2 segment +-AT91C_CAN_PHASE1 EQU (0x7 << 4) ;- (CAN) Phase 1 segment +-AT91C_CAN_PROPAG EQU (0x7 << 8) ;- (CAN) Programmation time segment +-AT91C_CAN_SYNC EQU (0x3 << 12) ;- (CAN) Re-synchronization jump width segment +-AT91C_CAN_BRP EQU (0x7F << 16) ;- (CAN) Baudrate Prescaler +-AT91C_CAN_SMP EQU (0x1 << 24) ;- (CAN) Sampling mode +-// - -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- +-AT91C_CAN_TIMER EQU (0xFFFF << 0) ;- (CAN) Timer field +-// - -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- +-// - -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- +-AT91C_CAN_REC EQU (0xFF << 0) ;- (CAN) Receive Error Counter +-AT91C_CAN_TEC EQU (0xFF << 16) ;- (CAN) Transmit Error Counter +-// - -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- +-AT91C_CAN_TIMRST EQU (0x1 << 31) ;- (CAN) Timer Reset Field +-// - -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 +-// - ***************************************************************************** +-// - -------- EMAC_NCR : (EMAC Offset: 0x0) -------- +-AT91C_EMAC_LB EQU (0x1 << 0) ;- (EMAC) Loopback. Optional. When set, loopback signal is at high level. +-AT91C_EMAC_LLB EQU (0x1 << 1) ;- (EMAC) Loopback local. +-AT91C_EMAC_RE EQU (0x1 << 2) ;- (EMAC) Receive enable. +-AT91C_EMAC_TE EQU (0x1 << 3) ;- (EMAC) Transmit enable. +-AT91C_EMAC_MPE EQU (0x1 << 4) ;- (EMAC) Management port enable. +-AT91C_EMAC_CLRSTAT EQU (0x1 << 5) ;- (EMAC) Clear statistics registers. +-AT91C_EMAC_INCSTAT EQU (0x1 << 6) ;- (EMAC) Increment statistics registers. +-AT91C_EMAC_WESTAT EQU (0x1 << 7) ;- (EMAC) Write enable for statistics registers. +-AT91C_EMAC_BP EQU (0x1 << 8) ;- (EMAC) Back pressure. +-AT91C_EMAC_TSTART EQU (0x1 << 9) ;- (EMAC) Start Transmission. +-AT91C_EMAC_THALT EQU (0x1 << 10) ;- (EMAC) Transmission Halt. +-AT91C_EMAC_TPFR EQU (0x1 << 11) ;- (EMAC) Transmit pause frame +-AT91C_EMAC_TZQ EQU (0x1 << 12) ;- (EMAC) Transmit zero quantum pause frame +-// - -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- +-AT91C_EMAC_SPD EQU (0x1 << 0) ;- (EMAC) Speed. +-AT91C_EMAC_FD EQU (0x1 << 1) ;- (EMAC) Full duplex. +-AT91C_EMAC_JFRAME EQU (0x1 << 3) ;- (EMAC) Jumbo Frames. +-AT91C_EMAC_CAF EQU (0x1 << 4) ;- (EMAC) Copy all frames. +-AT91C_EMAC_NBC EQU (0x1 << 5) ;- (EMAC) No broadcast. +-AT91C_EMAC_MTI EQU (0x1 << 6) ;- (EMAC) Multicast hash event enable +-AT91C_EMAC_UNI EQU (0x1 << 7) ;- (EMAC) Unicast hash enable. +-AT91C_EMAC_BIG EQU (0x1 << 8) ;- (EMAC) Receive 1522 bytes. +-AT91C_EMAC_EAE EQU (0x1 << 9) ;- (EMAC) External address match enable. +-AT91C_EMAC_CLK EQU (0x3 << 10) ;- (EMAC) +-AT91C_EMAC_CLK_HCLK_8 EQU (0x0 << 10) ;- (EMAC) HCLK divided by 8 +-AT91C_EMAC_CLK_HCLK_16 EQU (0x1 << 10) ;- (EMAC) HCLK divided by 16 +-AT91C_EMAC_CLK_HCLK_32 EQU (0x2 << 10) ;- (EMAC) HCLK divided by 32 +-AT91C_EMAC_CLK_HCLK_64 EQU (0x3 << 10) ;- (EMAC) HCLK divided by 64 +-AT91C_EMAC_RTY EQU (0x1 << 12) ;- (EMAC) +-AT91C_EMAC_PAE EQU (0x1 << 13) ;- (EMAC) +-AT91C_EMAC_RBOF EQU (0x3 << 14) ;- (EMAC) +-AT91C_EMAC_RBOF_OFFSET_0 EQU (0x0 << 14) ;- (EMAC) no offset from start of receive buffer +-AT91C_EMAC_RBOF_OFFSET_1 EQU (0x1 << 14) ;- (EMAC) one byte offset from start of receive buffer +-AT91C_EMAC_RBOF_OFFSET_2 EQU (0x2 << 14) ;- (EMAC) two bytes offset from start of receive buffer +-AT91C_EMAC_RBOF_OFFSET_3 EQU (0x3 << 14) ;- (EMAC) three bytes offset from start of receive buffer +-AT91C_EMAC_RLCE EQU (0x1 << 16) ;- (EMAC) Receive Length field Checking Enable +-AT91C_EMAC_DRFCS EQU (0x1 << 17) ;- (EMAC) Discard Receive FCS +-AT91C_EMAC_EFRHD EQU (0x1 << 18) ;- (EMAC) +-AT91C_EMAC_IRXFCS EQU (0x1 << 19) ;- (EMAC) Ignore RX FCS +-// - -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- +-AT91C_EMAC_LINKR EQU (0x1 << 0) ;- (EMAC) +-AT91C_EMAC_MDIO EQU (0x1 << 1) ;- (EMAC) +-AT91C_EMAC_IDLE EQU (0x1 << 2) ;- (EMAC) +-// - -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- +-AT91C_EMAC_UBR EQU (0x1 << 0) ;- (EMAC) +-AT91C_EMAC_COL EQU (0x1 << 1) ;- (EMAC) +-AT91C_EMAC_RLES EQU (0x1 << 2) ;- (EMAC) +-AT91C_EMAC_TGO EQU (0x1 << 3) ;- (EMAC) Transmit Go +-AT91C_EMAC_BEX EQU (0x1 << 4) ;- (EMAC) Buffers exhausted mid frame +-AT91C_EMAC_COMP EQU (0x1 << 5) ;- (EMAC) +-AT91C_EMAC_UND EQU (0x1 << 6) ;- (EMAC) +-// - -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- +-AT91C_EMAC_BNA EQU (0x1 << 0) ;- (EMAC) +-AT91C_EMAC_REC EQU (0x1 << 1) ;- (EMAC) +-AT91C_EMAC_OVR EQU (0x1 << 2) ;- (EMAC) +-// - -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- +-AT91C_EMAC_MFD EQU (0x1 << 0) ;- (EMAC) +-AT91C_EMAC_RCOMP EQU (0x1 << 1) ;- (EMAC) +-AT91C_EMAC_RXUBR EQU (0x1 << 2) ;- (EMAC) +-AT91C_EMAC_TXUBR EQU (0x1 << 3) ;- (EMAC) +-AT91C_EMAC_TUNDR EQU (0x1 << 4) ;- (EMAC) +-AT91C_EMAC_RLEX EQU (0x1 << 5) ;- (EMAC) +-AT91C_EMAC_TXERR EQU (0x1 << 6) ;- (EMAC) +-AT91C_EMAC_TCOMP EQU (0x1 << 7) ;- (EMAC) +-AT91C_EMAC_LINK EQU (0x1 << 9) ;- (EMAC) +-AT91C_EMAC_ROVR EQU (0x1 << 10) ;- (EMAC) +-AT91C_EMAC_HRESP EQU (0x1 << 11) ;- (EMAC) +-AT91C_EMAC_PFRE EQU (0x1 << 12) ;- (EMAC) +-AT91C_EMAC_PTZ EQU (0x1 << 13) ;- (EMAC) +-// - -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- +-// - -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- +-// - -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- +-// - -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- +-AT91C_EMAC_DATA EQU (0xFFFF << 0) ;- (EMAC) +-AT91C_EMAC_CODE EQU (0x3 << 16) ;- (EMAC) +-AT91C_EMAC_REGA EQU (0x1F << 18) ;- (EMAC) +-AT91C_EMAC_PHYA EQU (0x1F << 23) ;- (EMAC) +-AT91C_EMAC_RW EQU (0x3 << 28) ;- (EMAC) +-AT91C_EMAC_SOF EQU (0x3 << 30) ;- (EMAC) +-// - -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- +-AT91C_EMAC_RMII EQU (0x1 << 0) ;- (EMAC) Reduce MII +-AT91C_EMAC_CLKEN EQU (0x1 << 1) ;- (EMAC) Clock Enable +-// - -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- +-AT91C_EMAC_IP EQU (0xFFFF << 0) ;- (EMAC) ARP request IP address +-AT91C_EMAC_MAG EQU (0x1 << 16) ;- (EMAC) Magic packet event enable +-AT91C_EMAC_ARP EQU (0x1 << 17) ;- (EMAC) ARP request event enable +-AT91C_EMAC_SA1 EQU (0x1 << 18) ;- (EMAC) Specific address register 1 event enable +-// - -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- +-AT91C_EMAC_REVREF EQU (0xFFFF << 0) ;- (EMAC) +-AT91C_EMAC_PARTREF EQU (0xFFFF << 16) ;- (EMAC) +- +-// - ***************************************************************************** +-// - SOFTWARE API DEFINITION FOR Analog to Digital Convertor +-// - ***************************************************************************** +-// - -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- +-AT91C_ADC_SWRST EQU (0x1 << 0) ;- (ADC) Software Reset +-AT91C_ADC_START EQU (0x1 << 1) ;- (ADC) Start Conversion +-// - -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- +-AT91C_ADC_TRGEN EQU (0x1 << 0) ;- (ADC) Trigger Enable +-AT91C_ADC_TRGEN_DIS EQU (0x0) ;- (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software +-AT91C_ADC_TRGEN_EN EQU (0x1) ;- (ADC) Hardware trigger selected by TRGSEL field is enabled. +-AT91C_ADC_TRGSEL EQU (0x7 << 1) ;- (ADC) Trigger Selection +-AT91C_ADC_TRGSEL_TIOA0 EQU (0x0 << 1) ;- (ADC) Selected TRGSEL = TIAO0 +-AT91C_ADC_TRGSEL_TIOA1 EQU (0x1 << 1) ;- (ADC) Selected TRGSEL = TIAO1 +-AT91C_ADC_TRGSEL_TIOA2 EQU (0x2 << 1) ;- (ADC) Selected TRGSEL = TIAO2 +-AT91C_ADC_TRGSEL_TIOA3 EQU (0x3 << 1) ;- (ADC) Selected TRGSEL = TIAO3 +-AT91C_ADC_TRGSEL_TIOA4 EQU (0x4 << 1) ;- (ADC) Selected TRGSEL = TIAO4 +-AT91C_ADC_TRGSEL_TIOA5 EQU (0x5 << 1) ;- (ADC) Selected TRGSEL = TIAO5 +-AT91C_ADC_TRGSEL_EXT EQU (0x6 << 1) ;- (ADC) Selected TRGSEL = External Trigger +-AT91C_ADC_LOWRES EQU (0x1 << 4) ;- (ADC) Resolution. +-AT91C_ADC_LOWRES_10_BIT EQU (0x0 << 4) ;- (ADC) 10-bit resolution +-AT91C_ADC_LOWRES_8_BIT EQU (0x1 << 4) ;- (ADC) 8-bit resolution +-AT91C_ADC_SLEEP EQU (0x1 << 5) ;- (ADC) Sleep Mode +-AT91C_ADC_SLEEP_NORMAL_MODE EQU (0x0 << 5) ;- (ADC) Normal Mode +-AT91C_ADC_SLEEP_MODE EQU (0x1 << 5) ;- (ADC) Sleep Mode +-AT91C_ADC_PRESCAL EQU (0x3F << 8) ;- (ADC) Prescaler rate selection +-AT91C_ADC_STARTUP EQU (0x1F << 16) ;- (ADC) Startup Time +-AT91C_ADC_SHTIM EQU (0xF << 24) ;- (ADC) Sample & Hold Time +-// - -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- +-AT91C_ADC_CH0 EQU (0x1 << 0) ;- (ADC) Channel 0 +-AT91C_ADC_CH1 EQU (0x1 << 1) ;- (ADC) Channel 1 +-AT91C_ADC_CH2 EQU (0x1 << 2) ;- (ADC) Channel 2 +-AT91C_ADC_CH3 EQU (0x1 << 3) ;- (ADC) Channel 3 +-AT91C_ADC_CH4 EQU (0x1 << 4) ;- (ADC) Channel 4 +-AT91C_ADC_CH5 EQU (0x1 << 5) ;- (ADC) Channel 5 +-AT91C_ADC_CH6 EQU (0x1 << 6) ;- (ADC) Channel 6 +-AT91C_ADC_CH7 EQU (0x1 << 7) ;- (ADC) Channel 7 +-// - -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- +-// - -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- +-// - -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- +-AT91C_ADC_EOC0 EQU (0x1 << 0) ;- (ADC) End of Conversion +-AT91C_ADC_EOC1 EQU (0x1 << 1) ;- (ADC) End of Conversion +-AT91C_ADC_EOC2 EQU (0x1 << 2) ;- (ADC) End of Conversion +-AT91C_ADC_EOC3 EQU (0x1 << 3) ;- (ADC) End of Conversion +-AT91C_ADC_EOC4 EQU (0x1 << 4) ;- (ADC) End of Conversion +-AT91C_ADC_EOC5 EQU (0x1 << 5) ;- (ADC) End of Conversion +-AT91C_ADC_EOC6 EQU (0x1 << 6) ;- (ADC) End of Conversion +-AT91C_ADC_EOC7 EQU (0x1 << 7) ;- (ADC) End of Conversion +-AT91C_ADC_OVRE0 EQU (0x1 << 8) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE1 EQU (0x1 << 9) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE2 EQU (0x1 << 10) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE3 EQU (0x1 << 11) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE4 EQU (0x1 << 12) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE5 EQU (0x1 << 13) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE6 EQU (0x1 << 14) ;- (ADC) Overrun Error +-AT91C_ADC_OVRE7 EQU (0x1 << 15) ;- (ADC) Overrun Error +-AT91C_ADC_DRDY EQU (0x1 << 16) ;- (ADC) Data Ready +-AT91C_ADC_GOVRE EQU (0x1 << 17) ;- (ADC) General Overrun +-AT91C_ADC_ENDRX EQU (0x1 << 18) ;- (ADC) End of Receiver Transfer +-AT91C_ADC_RXBUFF EQU (0x1 << 19) ;- (ADC) RXBUFF Interrupt +-// - -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- +-AT91C_ADC_LDATA EQU (0x3FF << 0) ;- (ADC) Last Data Converted +-// - -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- +-// - -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- +-// - -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- +-// - -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- +-AT91C_ADC_DATA EQU (0x3FF << 0) ;- (ADC) Converted Data +-// - -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- +-// - -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- +-// - -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- +-// - -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- +-// - -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- +-// - -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- +-// - -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- +- +-// - ***************************************************************************** +-// - REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 +-// - ***************************************************************************** +-// - ========== Register definition for SYS peripheral ========== +-// - ========== Register definition for AIC peripheral ========== +-AT91C_AIC_IVR EQU (0xFFFFF100) ;- (AIC) IRQ Vector Register +-AT91C_AIC_SMR EQU (0xFFFFF000) ;- (AIC) Source Mode Register +-AT91C_AIC_FVR EQU (0xFFFFF104) ;- (AIC) FIQ Vector Register +-AT91C_AIC_DCR EQU (0xFFFFF138) ;- (AIC) Debug Control Register (Protect) +-AT91C_AIC_EOICR EQU (0xFFFFF130) ;- (AIC) End of Interrupt Command Register +-AT91C_AIC_SVR EQU (0xFFFFF080) ;- (AIC) Source Vector Register +-AT91C_AIC_FFSR EQU (0xFFFFF148) ;- (AIC) Fast Forcing Status Register +-AT91C_AIC_ICCR EQU (0xFFFFF128) ;- (AIC) Interrupt Clear Command Register +-AT91C_AIC_ISR EQU (0xFFFFF108) ;- (AIC) Interrupt Status Register +-AT91C_AIC_IMR EQU (0xFFFFF110) ;- (AIC) Interrupt Mask Register +-AT91C_AIC_IPR EQU (0xFFFFF10C) ;- (AIC) Interrupt Pending Register +-AT91C_AIC_FFER EQU (0xFFFFF140) ;- (AIC) Fast Forcing Enable Register +-AT91C_AIC_IECR EQU (0xFFFFF120) ;- (AIC) Interrupt Enable Command Register +-AT91C_AIC_ISCR EQU (0xFFFFF12C) ;- (AIC) Interrupt Set Command Register +-AT91C_AIC_FFDR EQU (0xFFFFF144) ;- (AIC) Fast Forcing Disable Register +-AT91C_AIC_CISR EQU (0xFFFFF114) ;- (AIC) Core Interrupt Status Register +-AT91C_AIC_IDCR EQU (0xFFFFF124) ;- (AIC) Interrupt Disable Command Register +-AT91C_AIC_SPU EQU (0xFFFFF134) ;- (AIC) Spurious Vector Register +-// - ========== Register definition for PDC_DBGU peripheral ========== +-AT91C_DBGU_TCR EQU (0xFFFFF30C) ;- (PDC_DBGU) Transmit Counter Register +-AT91C_DBGU_RNPR EQU (0xFFFFF310) ;- (PDC_DBGU) Receive Next Pointer Register +-AT91C_DBGU_TNPR EQU (0xFFFFF318) ;- (PDC_DBGU) Transmit Next Pointer Register +-AT91C_DBGU_TPR EQU (0xFFFFF308) ;- (PDC_DBGU) Transmit Pointer Register +-AT91C_DBGU_RPR EQU (0xFFFFF300) ;- (PDC_DBGU) Receive Pointer Register +-AT91C_DBGU_RCR EQU (0xFFFFF304) ;- (PDC_DBGU) Receive Counter Register +-AT91C_DBGU_RNCR EQU (0xFFFFF314) ;- (PDC_DBGU) Receive Next Counter Register +-AT91C_DBGU_PTCR EQU (0xFFFFF320) ;- (PDC_DBGU) PDC Transfer Control Register +-AT91C_DBGU_PTSR EQU (0xFFFFF324) ;- (PDC_DBGU) PDC Transfer Status Register +-AT91C_DBGU_TNCR EQU (0xFFFFF31C) ;- (PDC_DBGU) Transmit Next Counter Register +-// - ========== Register definition for DBGU peripheral ========== +-AT91C_DBGU_EXID EQU (0xFFFFF244) ;- (DBGU) Chip ID Extension Register +-AT91C_DBGU_BRGR EQU (0xFFFFF220) ;- (DBGU) Baud Rate Generator Register +-AT91C_DBGU_IDR EQU (0xFFFFF20C) ;- (DBGU) Interrupt Disable Register +-AT91C_DBGU_CSR EQU (0xFFFFF214) ;- (DBGU) Channel Status Register +-AT91C_DBGU_CIDR EQU (0xFFFFF240) ;- (DBGU) Chip ID Register +-AT91C_DBGU_MR EQU (0xFFFFF204) ;- (DBGU) Mode Register +-AT91C_DBGU_IMR EQU (0xFFFFF210) ;- (DBGU) Interrupt Mask Register +-AT91C_DBGU_CR EQU (0xFFFFF200) ;- (DBGU) Control Register +-AT91C_DBGU_FNTR EQU (0xFFFFF248) ;- (DBGU) Force NTRST Register +-AT91C_DBGU_THR EQU (0xFFFFF21C) ;- (DBGU) Transmitter Holding Register +-AT91C_DBGU_RHR EQU (0xFFFFF218) ;- (DBGU) Receiver Holding Register +-AT91C_DBGU_IER EQU (0xFFFFF208) ;- (DBGU) Interrupt Enable Register +-// - ========== Register definition for PIOA peripheral ========== +-AT91C_PIOA_ODR EQU (0xFFFFF414) ;- (PIOA) Output Disable Registerr +-AT91C_PIOA_SODR EQU (0xFFFFF430) ;- (PIOA) Set Output Data Register +-AT91C_PIOA_ISR EQU (0xFFFFF44C) ;- (PIOA) Interrupt Status Register +-AT91C_PIOA_ABSR EQU (0xFFFFF478) ;- (PIOA) AB Select Status Register +-AT91C_PIOA_IER EQU (0xFFFFF440) ;- (PIOA) Interrupt Enable Register +-AT91C_PIOA_PPUDR EQU (0xFFFFF460) ;- (PIOA) Pull-up Disable Register +-AT91C_PIOA_IMR EQU (0xFFFFF448) ;- (PIOA) Interrupt Mask Register +-AT91C_PIOA_PER EQU (0xFFFFF400) ;- (PIOA) PIO Enable Register +-AT91C_PIOA_IFDR EQU (0xFFFFF424) ;- (PIOA) Input Filter Disable Register +-AT91C_PIOA_OWDR EQU (0xFFFFF4A4) ;- (PIOA) Output Write Disable Register +-AT91C_PIOA_MDSR EQU (0xFFFFF458) ;- (PIOA) Multi-driver Status Register +-AT91C_PIOA_IDR EQU (0xFFFFF444) ;- (PIOA) Interrupt Disable Register +-AT91C_PIOA_ODSR EQU (0xFFFFF438) ;- (PIOA) Output Data Status Register +-AT91C_PIOA_PPUSR EQU (0xFFFFF468) ;- (PIOA) Pull-up Status Register +-AT91C_PIOA_OWSR EQU (0xFFFFF4A8) ;- (PIOA) Output Write Status Register +-AT91C_PIOA_BSR EQU (0xFFFFF474) ;- (PIOA) Select B Register +-AT91C_PIOA_OWER EQU (0xFFFFF4A0) ;- (PIOA) Output Write Enable Register +-AT91C_PIOA_IFER EQU (0xFFFFF420) ;- (PIOA) Input Filter Enable Register +-AT91C_PIOA_PDSR EQU (0xFFFFF43C) ;- (PIOA) Pin Data Status Register +-AT91C_PIOA_PPUER EQU (0xFFFFF464) ;- (PIOA) Pull-up Enable Register +-AT91C_PIOA_OSR EQU (0xFFFFF418) ;- (PIOA) Output Status Register +-AT91C_PIOA_ASR EQU (0xFFFFF470) ;- (PIOA) Select A Register +-AT91C_PIOA_MDDR EQU (0xFFFFF454) ;- (PIOA) Multi-driver Disable Register +-AT91C_PIOA_CODR EQU (0xFFFFF434) ;- (PIOA) Clear Output Data Register +-AT91C_PIOA_MDER EQU (0xFFFFF450) ;- (PIOA) Multi-driver Enable Register +-AT91C_PIOA_PDR EQU (0xFFFFF404) ;- (PIOA) PIO Disable Register +-AT91C_PIOA_IFSR EQU (0xFFFFF428) ;- (PIOA) Input Filter Status Register +-AT91C_PIOA_OER EQU (0xFFFFF410) ;- (PIOA) Output Enable Register +-AT91C_PIOA_PSR EQU (0xFFFFF408) ;- (PIOA) PIO Status Register +-// - ========== Register definition for PIOB peripheral ========== +-AT91C_PIOB_OWDR EQU (0xFFFFF6A4) ;- (PIOB) Output Write Disable Register +-AT91C_PIOB_MDER EQU (0xFFFFF650) ;- (PIOB) Multi-driver Enable Register +-AT91C_PIOB_PPUSR EQU (0xFFFFF668) ;- (PIOB) Pull-up Status Register +-AT91C_PIOB_IMR EQU (0xFFFFF648) ;- (PIOB) Interrupt Mask Register +-AT91C_PIOB_ASR EQU (0xFFFFF670) ;- (PIOB) Select A Register +-AT91C_PIOB_PPUDR EQU (0xFFFFF660) ;- (PIOB) Pull-up Disable Register +-AT91C_PIOB_PSR EQU (0xFFFFF608) ;- (PIOB) PIO Status Register +-AT91C_PIOB_IER EQU (0xFFFFF640) ;- (PIOB) Interrupt Enable Register +-AT91C_PIOB_CODR EQU (0xFFFFF634) ;- (PIOB) Clear Output Data Register +-AT91C_PIOB_OWER EQU (0xFFFFF6A0) ;- (PIOB) Output Write Enable Register +-AT91C_PIOB_ABSR EQU (0xFFFFF678) ;- (PIOB) AB Select Status Register +-AT91C_PIOB_IFDR EQU (0xFFFFF624) ;- (PIOB) Input Filter Disable Register +-AT91C_PIOB_PDSR EQU (0xFFFFF63C) ;- (PIOB) Pin Data Status Register +-AT91C_PIOB_IDR EQU (0xFFFFF644) ;- (PIOB) Interrupt Disable Register +-AT91C_PIOB_OWSR EQU (0xFFFFF6A8) ;- (PIOB) Output Write Status Register +-AT91C_PIOB_PDR EQU (0xFFFFF604) ;- (PIOB) PIO Disable Register +-AT91C_PIOB_ODR EQU (0xFFFFF614) ;- (PIOB) Output Disable Registerr +-AT91C_PIOB_IFSR EQU (0xFFFFF628) ;- (PIOB) Input Filter Status Register +-AT91C_PIOB_PPUER EQU (0xFFFFF664) ;- (PIOB) Pull-up Enable Register +-AT91C_PIOB_SODR EQU (0xFFFFF630) ;- (PIOB) Set Output Data Register +-AT91C_PIOB_ISR EQU (0xFFFFF64C) ;- (PIOB) Interrupt Status Register +-AT91C_PIOB_ODSR EQU (0xFFFFF638) ;- (PIOB) Output Data Status Register +-AT91C_PIOB_OSR EQU (0xFFFFF618) ;- (PIOB) Output Status Register +-AT91C_PIOB_MDSR EQU (0xFFFFF658) ;- (PIOB) Multi-driver Status Register +-AT91C_PIOB_IFER EQU (0xFFFFF620) ;- (PIOB) Input Filter Enable Register +-AT91C_PIOB_BSR EQU (0xFFFFF674) ;- (PIOB) Select B Register +-AT91C_PIOB_MDDR EQU (0xFFFFF654) ;- (PIOB) Multi-driver Disable Register +-AT91C_PIOB_OER EQU (0xFFFFF610) ;- (PIOB) Output Enable Register +-AT91C_PIOB_PER EQU (0xFFFFF600) ;- (PIOB) PIO Enable Register +-// - ========== Register definition for CKGR peripheral ========== +-AT91C_CKGR_MOR EQU (0xFFFFFC20) ;- (CKGR) Main Oscillator Register +-AT91C_CKGR_PLLR EQU (0xFFFFFC2C) ;- (CKGR) PLL Register +-AT91C_CKGR_MCFR EQU (0xFFFFFC24) ;- (CKGR) Main Clock Frequency Register +-// - ========== Register definition for PMC peripheral ========== +-AT91C_PMC_IDR EQU (0xFFFFFC64) ;- (PMC) Interrupt Disable Register +-AT91C_PMC_MOR EQU (0xFFFFFC20) ;- (PMC) Main Oscillator Register +-AT91C_PMC_PLLR EQU (0xFFFFFC2C) ;- (PMC) PLL Register +-AT91C_PMC_PCER EQU (0xFFFFFC10) ;- (PMC) Peripheral Clock Enable Register +-AT91C_PMC_PCKR EQU (0xFFFFFC40) ;- (PMC) Programmable Clock Register +-AT91C_PMC_MCKR EQU (0xFFFFFC30) ;- (PMC) Master Clock Register +-AT91C_PMC_SCDR EQU (0xFFFFFC04) ;- (PMC) System Clock Disable Register +-AT91C_PMC_PCDR EQU (0xFFFFFC14) ;- (PMC) Peripheral Clock Disable Register +-AT91C_PMC_SCSR EQU (0xFFFFFC08) ;- (PMC) System Clock Status Register +-AT91C_PMC_PCSR EQU (0xFFFFFC18) ;- (PMC) Peripheral Clock Status Register +-AT91C_PMC_MCFR EQU (0xFFFFFC24) ;- (PMC) Main Clock Frequency Register +-AT91C_PMC_SCER EQU (0xFFFFFC00) ;- (PMC) System Clock Enable Register +-AT91C_PMC_IMR EQU (0xFFFFFC6C) ;- (PMC) Interrupt Mask Register +-AT91C_PMC_IER EQU (0xFFFFFC60) ;- (PMC) Interrupt Enable Register +-AT91C_PMC_SR EQU (0xFFFFFC68) ;- (PMC) Status Register +-// - ========== Register definition for RSTC peripheral ========== +-AT91C_RSTC_RCR EQU (0xFFFFFD00) ;- (RSTC) Reset Control Register +-AT91C_RSTC_RMR EQU (0xFFFFFD08) ;- (RSTC) Reset Mode Register +-AT91C_RSTC_RSR EQU (0xFFFFFD04) ;- (RSTC) Reset Status Register +-// - ========== Register definition for RTTC peripheral ========== +-AT91C_RTTC_RTSR EQU (0xFFFFFD2C) ;- (RTTC) Real-time Status Register +-AT91C_RTTC_RTMR EQU (0xFFFFFD20) ;- (RTTC) Real-time Mode Register +-AT91C_RTTC_RTVR EQU (0xFFFFFD28) ;- (RTTC) Real-time Value Register +-AT91C_RTTC_RTAR EQU (0xFFFFFD24) ;- (RTTC) Real-time Alarm Register +-// - ========== Register definition for PITC peripheral ========== +-AT91C_PITC_PIVR EQU (0xFFFFFD38) ;- (PITC) Period Interval Value Register +-AT91C_PITC_PISR EQU (0xFFFFFD34) ;- (PITC) Period Interval Status Register +-AT91C_PITC_PIIR EQU (0xFFFFFD3C) ;- (PITC) Period Interval Image Register +-AT91C_PITC_PIMR EQU (0xFFFFFD30) ;- (PITC) Period Interval Mode Register +-// - ========== Register definition for WDTC peripheral ========== +-AT91C_WDTC_WDCR EQU (0xFFFFFD40) ;- (WDTC) Watchdog Control Register +-AT91C_WDTC_WDSR EQU (0xFFFFFD48) ;- (WDTC) Watchdog Status Register +-AT91C_WDTC_WDMR EQU (0xFFFFFD44) ;- (WDTC) Watchdog Mode Register +-// - ========== Register definition for VREG peripheral ========== +-AT91C_VREG_MR EQU (0xFFFFFD60) ;- (VREG) Voltage Regulator Mode Register +-// - ========== Register definition for MC peripheral ========== +-AT91C_MC_ASR EQU (0xFFFFFF04) ;- (MC) MC Abort Status Register +-AT91C_MC_RCR EQU (0xFFFFFF00) ;- (MC) MC Remap Control Register +-AT91C_MC_FCR EQU (0xFFFFFF64) ;- (MC) MC Flash Command Register +-AT91C_MC_AASR EQU (0xFFFFFF08) ;- (MC) MC Abort Address Status Register +-AT91C_MC_FSR EQU (0xFFFFFF68) ;- (MC) MC Flash Status Register +-AT91C_MC_FMR EQU (0xFFFFFF60) ;- (MC) MC Flash Mode Register +-// - ========== Register definition for PDC_SPI1 peripheral ========== +-AT91C_SPI1_PTCR EQU (0xFFFE4120) ;- (PDC_SPI1) PDC Transfer Control Register +-AT91C_SPI1_RPR EQU (0xFFFE4100) ;- (PDC_SPI1) Receive Pointer Register +-AT91C_SPI1_TNCR EQU (0xFFFE411C) ;- (PDC_SPI1) Transmit Next Counter Register +-AT91C_SPI1_TPR EQU (0xFFFE4108) ;- (PDC_SPI1) Transmit Pointer Register +-AT91C_SPI1_TNPR EQU (0xFFFE4118) ;- (PDC_SPI1) Transmit Next Pointer Register +-AT91C_SPI1_TCR EQU (0xFFFE410C) ;- (PDC_SPI1) Transmit Counter Register +-AT91C_SPI1_RCR EQU (0xFFFE4104) ;- (PDC_SPI1) Receive Counter Register +-AT91C_SPI1_RNPR EQU (0xFFFE4110) ;- (PDC_SPI1) Receive Next Pointer Register +-AT91C_SPI1_RNCR EQU (0xFFFE4114) ;- (PDC_SPI1) Receive Next Counter Register +-AT91C_SPI1_PTSR EQU (0xFFFE4124) ;- (PDC_SPI1) PDC Transfer Status Register +-// - ========== Register definition for SPI1 peripheral ========== +-AT91C_SPI1_IMR EQU (0xFFFE401C) ;- (SPI1) Interrupt Mask Register +-AT91C_SPI1_IER EQU (0xFFFE4014) ;- (SPI1) Interrupt Enable Register +-AT91C_SPI1_MR EQU (0xFFFE4004) ;- (SPI1) Mode Register +-AT91C_SPI1_RDR EQU (0xFFFE4008) ;- (SPI1) Receive Data Register +-AT91C_SPI1_IDR EQU (0xFFFE4018) ;- (SPI1) Interrupt Disable Register +-AT91C_SPI1_SR EQU (0xFFFE4010) ;- (SPI1) Status Register +-AT91C_SPI1_TDR EQU (0xFFFE400C) ;- (SPI1) Transmit Data Register +-AT91C_SPI1_CR EQU (0xFFFE4000) ;- (SPI1) Control Register +-AT91C_SPI1_CSR EQU (0xFFFE4030) ;- (SPI1) Chip Select Register +-// - ========== Register definition for PDC_SPI0 peripheral ========== +-AT91C_SPI0_PTCR EQU (0xFFFE0120) ;- (PDC_SPI0) PDC Transfer Control Register +-AT91C_SPI0_TPR EQU (0xFFFE0108) ;- (PDC_SPI0) Transmit Pointer Register +-AT91C_SPI0_TCR EQU (0xFFFE010C) ;- (PDC_SPI0) Transmit Counter Register +-AT91C_SPI0_RCR EQU (0xFFFE0104) ;- (PDC_SPI0) Receive Counter Register +-AT91C_SPI0_PTSR EQU (0xFFFE0124) ;- (PDC_SPI0) PDC Transfer Status Register +-AT91C_SPI0_RNPR EQU (0xFFFE0110) ;- (PDC_SPI0) Receive Next Pointer Register +-AT91C_SPI0_RPR EQU (0xFFFE0100) ;- (PDC_SPI0) Receive Pointer Register +-AT91C_SPI0_TNCR EQU (0xFFFE011C) ;- (PDC_SPI0) Transmit Next Counter Register +-AT91C_SPI0_RNCR EQU (0xFFFE0114) ;- (PDC_SPI0) Receive Next Counter Register +-AT91C_SPI0_TNPR EQU (0xFFFE0118) ;- (PDC_SPI0) Transmit Next Pointer Register +-// - ========== Register definition for SPI0 peripheral ========== +-AT91C_SPI0_IER EQU (0xFFFE0014) ;- (SPI0) Interrupt Enable Register +-AT91C_SPI0_SR EQU (0xFFFE0010) ;- (SPI0) Status Register +-AT91C_SPI0_IDR EQU (0xFFFE0018) ;- (SPI0) Interrupt Disable Register +-AT91C_SPI0_CR EQU (0xFFFE0000) ;- (SPI0) Control Register +-AT91C_SPI0_MR EQU (0xFFFE0004) ;- (SPI0) Mode Register +-AT91C_SPI0_IMR EQU (0xFFFE001C) ;- (SPI0) Interrupt Mask Register +-AT91C_SPI0_TDR EQU (0xFFFE000C) ;- (SPI0) Transmit Data Register +-AT91C_SPI0_RDR EQU (0xFFFE0008) ;- (SPI0) Receive Data Register +-AT91C_SPI0_CSR EQU (0xFFFE0030) ;- (SPI0) Chip Select Register +-// - ========== Register definition for PDC_US1 peripheral ========== +-AT91C_US1_RNCR EQU (0xFFFC4114) ;- (PDC_US1) Receive Next Counter Register +-AT91C_US1_PTCR EQU (0xFFFC4120) ;- (PDC_US1) PDC Transfer Control Register +-AT91C_US1_TCR EQU (0xFFFC410C) ;- (PDC_US1) Transmit Counter Register +-AT91C_US1_PTSR EQU (0xFFFC4124) ;- (PDC_US1) PDC Transfer Status Register +-AT91C_US1_TNPR EQU (0xFFFC4118) ;- (PDC_US1) Transmit Next Pointer Register +-AT91C_US1_RCR EQU (0xFFFC4104) ;- (PDC_US1) Receive Counter Register +-AT91C_US1_RNPR EQU (0xFFFC4110) ;- (PDC_US1) Receive Next Pointer Register +-AT91C_US1_RPR EQU (0xFFFC4100) ;- (PDC_US1) Receive Pointer Register +-AT91C_US1_TNCR EQU (0xFFFC411C) ;- (PDC_US1) Transmit Next Counter Register +-AT91C_US1_TPR EQU (0xFFFC4108) ;- (PDC_US1) Transmit Pointer Register +-// - ========== Register definition for US1 peripheral ========== +-AT91C_US1_IF EQU (0xFFFC404C) ;- (US1) IRDA_FILTER Register +-AT91C_US1_NER EQU (0xFFFC4044) ;- (US1) Nb Errors Register +-AT91C_US1_RTOR EQU (0xFFFC4024) ;- (US1) Receiver Time-out Register +-AT91C_US1_CSR EQU (0xFFFC4014) ;- (US1) Channel Status Register +-AT91C_US1_IDR EQU (0xFFFC400C) ;- (US1) Interrupt Disable Register +-AT91C_US1_IER EQU (0xFFFC4008) ;- (US1) Interrupt Enable Register +-AT91C_US1_THR EQU (0xFFFC401C) ;- (US1) Transmitter Holding Register +-AT91C_US1_TTGR EQU (0xFFFC4028) ;- (US1) Transmitter Time-guard Register +-AT91C_US1_RHR EQU (0xFFFC4018) ;- (US1) Receiver Holding Register +-AT91C_US1_BRGR EQU (0xFFFC4020) ;- (US1) Baud Rate Generator Register +-AT91C_US1_IMR EQU (0xFFFC4010) ;- (US1) Interrupt Mask Register +-AT91C_US1_FIDI EQU (0xFFFC4040) ;- (US1) FI_DI_Ratio Register +-AT91C_US1_CR EQU (0xFFFC4000) ;- (US1) Control Register +-AT91C_US1_MR EQU (0xFFFC4004) ;- (US1) Mode Register +-// - ========== Register definition for PDC_US0 peripheral ========== +-AT91C_US0_TNPR EQU (0xFFFC0118) ;- (PDC_US0) Transmit Next Pointer Register +-AT91C_US0_RNPR EQU (0xFFFC0110) ;- (PDC_US0) Receive Next Pointer Register +-AT91C_US0_TCR EQU (0xFFFC010C) ;- (PDC_US0) Transmit Counter Register +-AT91C_US0_PTCR EQU (0xFFFC0120) ;- (PDC_US0) PDC Transfer Control Register +-AT91C_US0_PTSR EQU (0xFFFC0124) ;- (PDC_US0) PDC Transfer Status Register +-AT91C_US0_TNCR EQU (0xFFFC011C) ;- (PDC_US0) Transmit Next Counter Register +-AT91C_US0_TPR EQU (0xFFFC0108) ;- (PDC_US0) Transmit Pointer Register +-AT91C_US0_RCR EQU (0xFFFC0104) ;- (PDC_US0) Receive Counter Register +-AT91C_US0_RPR EQU (0xFFFC0100) ;- (PDC_US0) Receive Pointer Register +-AT91C_US0_RNCR EQU (0xFFFC0114) ;- (PDC_US0) Receive Next Counter Register +-// - ========== Register definition for US0 peripheral ========== +-AT91C_US0_BRGR EQU (0xFFFC0020) ;- (US0) Baud Rate Generator Register +-AT91C_US0_NER EQU (0xFFFC0044) ;- (US0) Nb Errors Register +-AT91C_US0_CR EQU (0xFFFC0000) ;- (US0) Control Register +-AT91C_US0_IMR EQU (0xFFFC0010) ;- (US0) Interrupt Mask Register +-AT91C_US0_FIDI EQU (0xFFFC0040) ;- (US0) FI_DI_Ratio Register +-AT91C_US0_TTGR EQU (0xFFFC0028) ;- (US0) Transmitter Time-guard Register +-AT91C_US0_MR EQU (0xFFFC0004) ;- (US0) Mode Register +-AT91C_US0_RTOR EQU (0xFFFC0024) ;- (US0) Receiver Time-out Register +-AT91C_US0_CSR EQU (0xFFFC0014) ;- (US0) Channel Status Register +-AT91C_US0_RHR EQU (0xFFFC0018) ;- (US0) Receiver Holding Register +-AT91C_US0_IDR EQU (0xFFFC000C) ;- (US0) Interrupt Disable Register +-AT91C_US0_THR EQU (0xFFFC001C) ;- (US0) Transmitter Holding Register +-AT91C_US0_IF EQU (0xFFFC004C) ;- (US0) IRDA_FILTER Register +-AT91C_US0_IER EQU (0xFFFC0008) ;- (US0) Interrupt Enable Register +-// - ========== Register definition for PDC_SSC peripheral ========== +-AT91C_SSC_TNCR EQU (0xFFFD411C) ;- (PDC_SSC) Transmit Next Counter Register +-AT91C_SSC_RPR EQU (0xFFFD4100) ;- (PDC_SSC) Receive Pointer Register +-AT91C_SSC_RNCR EQU (0xFFFD4114) ;- (PDC_SSC) Receive Next Counter Register +-AT91C_SSC_TPR EQU (0xFFFD4108) ;- (PDC_SSC) Transmit Pointer Register +-AT91C_SSC_PTCR EQU (0xFFFD4120) ;- (PDC_SSC) PDC Transfer Control Register +-AT91C_SSC_TCR EQU (0xFFFD410C) ;- (PDC_SSC) Transmit Counter Register +-AT91C_SSC_RCR EQU (0xFFFD4104) ;- (PDC_SSC) Receive Counter Register +-AT91C_SSC_RNPR EQU (0xFFFD4110) ;- (PDC_SSC) Receive Next Pointer Register +-AT91C_SSC_TNPR EQU (0xFFFD4118) ;- (PDC_SSC) Transmit Next Pointer Register +-AT91C_SSC_PTSR EQU (0xFFFD4124) ;- (PDC_SSC) PDC Transfer Status Register +-// - ========== Register definition for SSC peripheral ========== +-AT91C_SSC_RHR EQU (0xFFFD4020) ;- (SSC) Receive Holding Register +-AT91C_SSC_RSHR EQU (0xFFFD4030) ;- (SSC) Receive Sync Holding Register +-AT91C_SSC_TFMR EQU (0xFFFD401C) ;- (SSC) Transmit Frame Mode Register +-AT91C_SSC_IDR EQU (0xFFFD4048) ;- (SSC) Interrupt Disable Register +-AT91C_SSC_THR EQU (0xFFFD4024) ;- (SSC) Transmit Holding Register +-AT91C_SSC_RCMR EQU (0xFFFD4010) ;- (SSC) Receive Clock ModeRegister +-AT91C_SSC_IER EQU (0xFFFD4044) ;- (SSC) Interrupt Enable Register +-AT91C_SSC_TSHR EQU (0xFFFD4034) ;- (SSC) Transmit Sync Holding Register +-AT91C_SSC_SR EQU (0xFFFD4040) ;- (SSC) Status Register +-AT91C_SSC_CMR EQU (0xFFFD4004) ;- (SSC) Clock Mode Register +-AT91C_SSC_TCMR EQU (0xFFFD4018) ;- (SSC) Transmit Clock Mode Register +-AT91C_SSC_CR EQU (0xFFFD4000) ;- (SSC) Control Register +-AT91C_SSC_IMR EQU (0xFFFD404C) ;- (SSC) Interrupt Mask Register +-AT91C_SSC_RFMR EQU (0xFFFD4014) ;- (SSC) Receive Frame Mode Register +-// - ========== Register definition for TWI peripheral ========== +-AT91C_TWI_IER EQU (0xFFFB8024) ;- (TWI) Interrupt Enable Register +-AT91C_TWI_CR EQU (0xFFFB8000) ;- (TWI) Control Register +-AT91C_TWI_SR EQU (0xFFFB8020) ;- (TWI) Status Register +-AT91C_TWI_IMR EQU (0xFFFB802C) ;- (TWI) Interrupt Mask Register +-AT91C_TWI_THR EQU (0xFFFB8034) ;- (TWI) Transmit Holding Register +-AT91C_TWI_IDR EQU (0xFFFB8028) ;- (TWI) Interrupt Disable Register +-AT91C_TWI_IADR EQU (0xFFFB800C) ;- (TWI) Internal Address Register +-AT91C_TWI_MMR EQU (0xFFFB8004) ;- (TWI) Master Mode Register +-AT91C_TWI_CWGR EQU (0xFFFB8010) ;- (TWI) Clock Waveform Generator Register +-AT91C_TWI_RHR EQU (0xFFFB8030) ;- (TWI) Receive Holding Register +-// - ========== Register definition for PWMC_CH3 peripheral ========== +-AT91C_PWMC_CH3_CUPDR EQU (0xFFFCC270) ;- (PWMC_CH3) Channel Update Register +-AT91C_PWMC_CH3_Reserved EQU (0xFFFCC274) ;- (PWMC_CH3) Reserved +-AT91C_PWMC_CH3_CPRDR EQU (0xFFFCC268) ;- (PWMC_CH3) Channel Period Register +-AT91C_PWMC_CH3_CDTYR EQU (0xFFFCC264) ;- (PWMC_CH3) Channel Duty Cycle Register +-AT91C_PWMC_CH3_CCNTR EQU (0xFFFCC26C) ;- (PWMC_CH3) Channel Counter Register +-AT91C_PWMC_CH3_CMR EQU (0xFFFCC260) ;- (PWMC_CH3) Channel Mode Register +-// - ========== Register definition for PWMC_CH2 peripheral ========== +-AT91C_PWMC_CH2_Reserved EQU (0xFFFCC254) ;- (PWMC_CH2) Reserved +-AT91C_PWMC_CH2_CMR EQU (0xFFFCC240) ;- (PWMC_CH2) Channel Mode Register +-AT91C_PWMC_CH2_CCNTR EQU (0xFFFCC24C) ;- (PWMC_CH2) Channel Counter Register +-AT91C_PWMC_CH2_CPRDR EQU (0xFFFCC248) ;- (PWMC_CH2) Channel Period Register +-AT91C_PWMC_CH2_CUPDR EQU (0xFFFCC250) ;- (PWMC_CH2) Channel Update Register +-AT91C_PWMC_CH2_CDTYR EQU (0xFFFCC244) ;- (PWMC_CH2) Channel Duty Cycle Register +-// - ========== Register definition for PWMC_CH1 peripheral ========== +-AT91C_PWMC_CH1_Reserved EQU (0xFFFCC234) ;- (PWMC_CH1) Reserved +-AT91C_PWMC_CH1_CUPDR EQU (0xFFFCC230) ;- (PWMC_CH1) Channel Update Register +-AT91C_PWMC_CH1_CPRDR EQU (0xFFFCC228) ;- (PWMC_CH1) Channel Period Register +-AT91C_PWMC_CH1_CCNTR EQU (0xFFFCC22C) ;- (PWMC_CH1) Channel Counter Register +-AT91C_PWMC_CH1_CDTYR EQU (0xFFFCC224) ;- (PWMC_CH1) Channel Duty Cycle Register +-AT91C_PWMC_CH1_CMR EQU (0xFFFCC220) ;- (PWMC_CH1) Channel Mode Register +-// - ========== Register definition for PWMC_CH0 peripheral ========== +-AT91C_PWMC_CH0_Reserved EQU (0xFFFCC214) ;- (PWMC_CH0) Reserved +-AT91C_PWMC_CH0_CPRDR EQU (0xFFFCC208) ;- (PWMC_CH0) Channel Period Register +-AT91C_PWMC_CH0_CDTYR EQU (0xFFFCC204) ;- (PWMC_CH0) Channel Duty Cycle Register +-AT91C_PWMC_CH0_CMR EQU (0xFFFCC200) ;- (PWMC_CH0) Channel Mode Register +-AT91C_PWMC_CH0_CUPDR EQU (0xFFFCC210) ;- (PWMC_CH0) Channel Update Register +-AT91C_PWMC_CH0_CCNTR EQU (0xFFFCC20C) ;- (PWMC_CH0) Channel Counter Register +-// - ========== Register definition for PWMC peripheral ========== +-AT91C_PWMC_IDR EQU (0xFFFCC014) ;- (PWMC) PWMC Interrupt Disable Register +-AT91C_PWMC_DIS EQU (0xFFFCC008) ;- (PWMC) PWMC Disable Register +-AT91C_PWMC_IER EQU (0xFFFCC010) ;- (PWMC) PWMC Interrupt Enable Register +-AT91C_PWMC_VR EQU (0xFFFCC0FC) ;- (PWMC) PWMC Version Register +-AT91C_PWMC_ISR EQU (0xFFFCC01C) ;- (PWMC) PWMC Interrupt Status Register +-AT91C_PWMC_SR EQU (0xFFFCC00C) ;- (PWMC) PWMC Status Register +-AT91C_PWMC_IMR EQU (0xFFFCC018) ;- (PWMC) PWMC Interrupt Mask Register +-AT91C_PWMC_MR EQU (0xFFFCC000) ;- (PWMC) PWMC Mode Register +-AT91C_PWMC_ENA EQU (0xFFFCC004) ;- (PWMC) PWMC Enable Register +-// - ========== Register definition for UDP peripheral ========== +-AT91C_UDP_IMR EQU (0xFFFB0018) ;- (UDP) Interrupt Mask Register +-AT91C_UDP_FADDR EQU (0xFFFB0008) ;- (UDP) Function Address Register +-AT91C_UDP_NUM EQU (0xFFFB0000) ;- (UDP) Frame Number Register +-AT91C_UDP_FDR EQU (0xFFFB0050) ;- (UDP) Endpoint FIFO Data Register +-AT91C_UDP_ISR EQU (0xFFFB001C) ;- (UDP) Interrupt Status Register +-AT91C_UDP_CSR EQU (0xFFFB0030) ;- (UDP) Endpoint Control and Status Register +-AT91C_UDP_IDR EQU (0xFFFB0014) ;- (UDP) Interrupt Disable Register +-AT91C_UDP_ICR EQU (0xFFFB0020) ;- (UDP) Interrupt Clear Register +-AT91C_UDP_RSTEP EQU (0xFFFB0028) ;- (UDP) Reset Endpoint Register +-AT91C_UDP_TXVC EQU (0xFFFB0074) ;- (UDP) Transceiver Control Register +-AT91C_UDP_GLBSTATE EQU (0xFFFB0004) ;- (UDP) Global State Register +-AT91C_UDP_IER EQU (0xFFFB0010) ;- (UDP) Interrupt Enable Register +-// - ========== Register definition for TC0 peripheral ========== +-AT91C_TC0_SR EQU (0xFFFA0020) ;- (TC0) Status Register +-AT91C_TC0_RC EQU (0xFFFA001C) ;- (TC0) Register C +-AT91C_TC0_RB EQU (0xFFFA0018) ;- (TC0) Register B +-AT91C_TC0_CCR EQU (0xFFFA0000) ;- (TC0) Channel Control Register +-AT91C_TC0_CMR EQU (0xFFFA0004) ;- (TC0) Channel Mode Register (Capture Mode / Waveform Mode) +-AT91C_TC0_IER EQU (0xFFFA0024) ;- (TC0) Interrupt Enable Register +-AT91C_TC0_RA EQU (0xFFFA0014) ;- (TC0) Register A +-AT91C_TC0_IDR EQU (0xFFFA0028) ;- (TC0) Interrupt Disable Register +-AT91C_TC0_CV EQU (0xFFFA0010) ;- (TC0) Counter Value +-AT91C_TC0_IMR EQU (0xFFFA002C) ;- (TC0) Interrupt Mask Register +-// - ========== Register definition for TC1 peripheral ========== +-AT91C_TC1_RB EQU (0xFFFA0058) ;- (TC1) Register B +-AT91C_TC1_CCR EQU (0xFFFA0040) ;- (TC1) Channel Control Register +-AT91C_TC1_IER EQU (0xFFFA0064) ;- (TC1) Interrupt Enable Register +-AT91C_TC1_IDR EQU (0xFFFA0068) ;- (TC1) Interrupt Disable Register +-AT91C_TC1_SR EQU (0xFFFA0060) ;- (TC1) Status Register +-AT91C_TC1_CMR EQU (0xFFFA0044) ;- (TC1) Channel Mode Register (Capture Mode / Waveform Mode) +-AT91C_TC1_RA EQU (0xFFFA0054) ;- (TC1) Register A +-AT91C_TC1_RC EQU (0xFFFA005C) ;- (TC1) Register C +-AT91C_TC1_IMR EQU (0xFFFA006C) ;- (TC1) Interrupt Mask Register +-AT91C_TC1_CV EQU (0xFFFA0050) ;- (TC1) Counter Value +-// - ========== Register definition for TC2 peripheral ========== +-AT91C_TC2_CMR EQU (0xFFFA0084) ;- (TC2) Channel Mode Register (Capture Mode / Waveform Mode) +-AT91C_TC2_CCR EQU (0xFFFA0080) ;- (TC2) Channel Control Register +-AT91C_TC2_CV EQU (0xFFFA0090) ;- (TC2) Counter Value +-AT91C_TC2_RA EQU (0xFFFA0094) ;- (TC2) Register A +-AT91C_TC2_RB EQU (0xFFFA0098) ;- (TC2) Register B +-AT91C_TC2_IDR EQU (0xFFFA00A8) ;- (TC2) Interrupt Disable Register +-AT91C_TC2_IMR EQU (0xFFFA00AC) ;- (TC2) Interrupt Mask Register +-AT91C_TC2_RC EQU (0xFFFA009C) ;- (TC2) Register C +-AT91C_TC2_IER EQU (0xFFFA00A4) ;- (TC2) Interrupt Enable Register +-AT91C_TC2_SR EQU (0xFFFA00A0) ;- (TC2) Status Register +-// - ========== Register definition for TCB peripheral ========== +-AT91C_TCB_BMR EQU (0xFFFA00C4) ;- (TCB) TC Block Mode Register +-AT91C_TCB_BCR EQU (0xFFFA00C0) ;- (TCB) TC Block Control Register +-// - ========== Register definition for CAN_MB0 peripheral ========== +-AT91C_CAN_MB0_MDL EQU (0xFFFD0214) ;- (CAN_MB0) MailBox Data Low Register +-AT91C_CAN_MB0_MAM EQU (0xFFFD0204) ;- (CAN_MB0) MailBox Acceptance Mask Register +-AT91C_CAN_MB0_MCR EQU (0xFFFD021C) ;- (CAN_MB0) MailBox Control Register +-AT91C_CAN_MB0_MID EQU (0xFFFD0208) ;- (CAN_MB0) MailBox ID Register +-AT91C_CAN_MB0_MSR EQU (0xFFFD0210) ;- (CAN_MB0) MailBox Status Register +-AT91C_CAN_MB0_MFID EQU (0xFFFD020C) ;- (CAN_MB0) MailBox Family ID Register +-AT91C_CAN_MB0_MDH EQU (0xFFFD0218) ;- (CAN_MB0) MailBox Data High Register +-AT91C_CAN_MB0_MMR EQU (0xFFFD0200) ;- (CAN_MB0) MailBox Mode Register +-// - ========== Register definition for CAN_MB1 peripheral ========== +-AT91C_CAN_MB1_MDL EQU (0xFFFD0234) ;- (CAN_MB1) MailBox Data Low Register +-AT91C_CAN_MB1_MID EQU (0xFFFD0228) ;- (CAN_MB1) MailBox ID Register +-AT91C_CAN_MB1_MMR EQU (0xFFFD0220) ;- (CAN_MB1) MailBox Mode Register +-AT91C_CAN_MB1_MSR EQU (0xFFFD0230) ;- (CAN_MB1) MailBox Status Register +-AT91C_CAN_MB1_MAM EQU (0xFFFD0224) ;- (CAN_MB1) MailBox Acceptance Mask Register +-AT91C_CAN_MB1_MDH EQU (0xFFFD0238) ;- (CAN_MB1) MailBox Data High Register +-AT91C_CAN_MB1_MCR EQU (0xFFFD023C) ;- (CAN_MB1) MailBox Control Register +-AT91C_CAN_MB1_MFID EQU (0xFFFD022C) ;- (CAN_MB1) MailBox Family ID Register +-// - ========== Register definition for CAN_MB2 peripheral ========== +-AT91C_CAN_MB2_MCR EQU (0xFFFD025C) ;- (CAN_MB2) MailBox Control Register +-AT91C_CAN_MB2_MDH EQU (0xFFFD0258) ;- (CAN_MB2) MailBox Data High Register +-AT91C_CAN_MB2_MID EQU (0xFFFD0248) ;- (CAN_MB2) MailBox ID Register +-AT91C_CAN_MB2_MDL EQU (0xFFFD0254) ;- (CAN_MB2) MailBox Data Low Register +-AT91C_CAN_MB2_MMR EQU (0xFFFD0240) ;- (CAN_MB2) MailBox Mode Register +-AT91C_CAN_MB2_MAM EQU (0xFFFD0244) ;- (CAN_MB2) MailBox Acceptance Mask Register +-AT91C_CAN_MB2_MFID EQU (0xFFFD024C) ;- (CAN_MB2) MailBox Family ID Register +-AT91C_CAN_MB2_MSR EQU (0xFFFD0250) ;- (CAN_MB2) MailBox Status Register +-// - ========== Register definition for CAN_MB3 peripheral ========== +-AT91C_CAN_MB3_MFID EQU (0xFFFD026C) ;- (CAN_MB3) MailBox Family ID Register +-AT91C_CAN_MB3_MAM EQU (0xFFFD0264) ;- (CAN_MB3) MailBox Acceptance Mask Register +-AT91C_CAN_MB3_MID EQU (0xFFFD0268) ;- (CAN_MB3) MailBox ID Register +-AT91C_CAN_MB3_MCR EQU (0xFFFD027C) ;- (CAN_MB3) MailBox Control Register +-AT91C_CAN_MB3_MMR EQU (0xFFFD0260) ;- (CAN_MB3) MailBox Mode Register +-AT91C_CAN_MB3_MSR EQU (0xFFFD0270) ;- (CAN_MB3) MailBox Status Register +-AT91C_CAN_MB3_MDL EQU (0xFFFD0274) ;- (CAN_MB3) MailBox Data Low Register +-AT91C_CAN_MB3_MDH EQU (0xFFFD0278) ;- (CAN_MB3) MailBox Data High Register +-// - ========== Register definition for CAN_MB4 peripheral ========== +-AT91C_CAN_MB4_MID EQU (0xFFFD0288) ;- (CAN_MB4) MailBox ID Register +-AT91C_CAN_MB4_MMR EQU (0xFFFD0280) ;- (CAN_MB4) MailBox Mode Register +-AT91C_CAN_MB4_MDH EQU (0xFFFD0298) ;- (CAN_MB4) MailBox Data High Register +-AT91C_CAN_MB4_MFID EQU (0xFFFD028C) ;- (CAN_MB4) MailBox Family ID Register +-AT91C_CAN_MB4_MSR EQU (0xFFFD0290) ;- (CAN_MB4) MailBox Status Register +-AT91C_CAN_MB4_MCR EQU (0xFFFD029C) ;- (CAN_MB4) MailBox Control Register +-AT91C_CAN_MB4_MDL EQU (0xFFFD0294) ;- (CAN_MB4) MailBox Data Low Register +-AT91C_CAN_MB4_MAM EQU (0xFFFD0284) ;- (CAN_MB4) MailBox Acceptance Mask Register +-// - ========== Register definition for CAN_MB5 peripheral ========== +-AT91C_CAN_MB5_MSR EQU (0xFFFD02B0) ;- (CAN_MB5) MailBox Status Register +-AT91C_CAN_MB5_MCR EQU (0xFFFD02BC) ;- (CAN_MB5) MailBox Control Register +-AT91C_CAN_MB5_MFID EQU (0xFFFD02AC) ;- (CAN_MB5) MailBox Family ID Register +-AT91C_CAN_MB5_MDH EQU (0xFFFD02B8) ;- (CAN_MB5) MailBox Data High Register +-AT91C_CAN_MB5_MID EQU (0xFFFD02A8) ;- (CAN_MB5) MailBox ID Register +-AT91C_CAN_MB5_MMR EQU (0xFFFD02A0) ;- (CAN_MB5) MailBox Mode Register +-AT91C_CAN_MB5_MDL EQU (0xFFFD02B4) ;- (CAN_MB5) MailBox Data Low Register +-AT91C_CAN_MB5_MAM EQU (0xFFFD02A4) ;- (CAN_MB5) MailBox Acceptance Mask Register +-// - ========== Register definition for CAN_MB6 peripheral ========== +-AT91C_CAN_MB6_MFID EQU (0xFFFD02CC) ;- (CAN_MB6) MailBox Family ID Register +-AT91C_CAN_MB6_MID EQU (0xFFFD02C8) ;- (CAN_MB6) MailBox ID Register +-AT91C_CAN_MB6_MAM EQU (0xFFFD02C4) ;- (CAN_MB6) MailBox Acceptance Mask Register +-AT91C_CAN_MB6_MSR EQU (0xFFFD02D0) ;- (CAN_MB6) MailBox Status Register +-AT91C_CAN_MB6_MDL EQU (0xFFFD02D4) ;- (CAN_MB6) MailBox Data Low Register +-AT91C_CAN_MB6_MCR EQU (0xFFFD02DC) ;- (CAN_MB6) MailBox Control Register +-AT91C_CAN_MB6_MDH EQU (0xFFFD02D8) ;- (CAN_MB6) MailBox Data High Register +-AT91C_CAN_MB6_MMR EQU (0xFFFD02C0) ;- (CAN_MB6) MailBox Mode Register +-// - ========== Register definition for CAN_MB7 peripheral ========== +-AT91C_CAN_MB7_MCR EQU (0xFFFD02FC) ;- (CAN_MB7) MailBox Control Register +-AT91C_CAN_MB7_MDH EQU (0xFFFD02F8) ;- (CAN_MB7) MailBox Data High Register +-AT91C_CAN_MB7_MFID EQU (0xFFFD02EC) ;- (CAN_MB7) MailBox Family ID Register +-AT91C_CAN_MB7_MDL EQU (0xFFFD02F4) ;- (CAN_MB7) MailBox Data Low Register +-AT91C_CAN_MB7_MID EQU (0xFFFD02E8) ;- (CAN_MB7) MailBox ID Register +-AT91C_CAN_MB7_MMR EQU (0xFFFD02E0) ;- (CAN_MB7) MailBox Mode Register +-AT91C_CAN_MB7_MAM EQU (0xFFFD02E4) ;- (CAN_MB7) MailBox Acceptance Mask Register +-AT91C_CAN_MB7_MSR EQU (0xFFFD02F0) ;- (CAN_MB7) MailBox Status Register +-// - ========== Register definition for CAN peripheral ========== +-AT91C_CAN_TCR EQU (0xFFFD0024) ;- (CAN) Transfer Command Register +-AT91C_CAN_IMR EQU (0xFFFD000C) ;- (CAN) Interrupt Mask Register +-AT91C_CAN_IER EQU (0xFFFD0004) ;- (CAN) Interrupt Enable Register +-AT91C_CAN_ECR EQU (0xFFFD0020) ;- (CAN) Error Counter Register +-AT91C_CAN_TIMESTP EQU (0xFFFD001C) ;- (CAN) Time Stamp Register +-AT91C_CAN_MR EQU (0xFFFD0000) ;- (CAN) Mode Register +-AT91C_CAN_IDR EQU (0xFFFD0008) ;- (CAN) Interrupt Disable Register +-AT91C_CAN_ACR EQU (0xFFFD0028) ;- (CAN) Abort Command Register +-AT91C_CAN_TIM EQU (0xFFFD0018) ;- (CAN) Timer Register +-AT91C_CAN_SR EQU (0xFFFD0010) ;- (CAN) Status Register +-AT91C_CAN_BR EQU (0xFFFD0014) ;- (CAN) Baudrate Register +-AT91C_CAN_VR EQU (0xFFFD00FC) ;- (CAN) Version Register +-// - ========== Register definition for EMAC peripheral ========== +-AT91C_EMAC_ISR EQU (0xFFFDC024) ;- (EMAC) Interrupt Status Register +-AT91C_EMAC_SA4H EQU (0xFFFDC0B4) ;- (EMAC) Specific Address 4 Top, Last 2 bytes +-AT91C_EMAC_SA1L EQU (0xFFFDC098) ;- (EMAC) Specific Address 1 Bottom, First 4 bytes +-AT91C_EMAC_ELE EQU (0xFFFDC078) ;- (EMAC) Excessive Length Errors Register +-AT91C_EMAC_LCOL EQU (0xFFFDC05C) ;- (EMAC) Late Collision Register +-AT91C_EMAC_RLE EQU (0xFFFDC088) ;- (EMAC) Receive Length Field Mismatch Register +-AT91C_EMAC_WOL EQU (0xFFFDC0C4) ;- (EMAC) Wake On LAN Register +-AT91C_EMAC_DTF EQU (0xFFFDC058) ;- (EMAC) Deferred Transmission Frame Register +-AT91C_EMAC_TUND EQU (0xFFFDC064) ;- (EMAC) Transmit Underrun Error Register +-AT91C_EMAC_NCR EQU (0xFFFDC000) ;- (EMAC) Network Control Register +-AT91C_EMAC_SA4L EQU (0xFFFDC0B0) ;- (EMAC) Specific Address 4 Bottom, First 4 bytes +-AT91C_EMAC_RSR EQU (0xFFFDC020) ;- (EMAC) Receive Status Register +-AT91C_EMAC_SA3L EQU (0xFFFDC0A8) ;- (EMAC) Specific Address 3 Bottom, First 4 bytes +-AT91C_EMAC_TSR EQU (0xFFFDC014) ;- (EMAC) Transmit Status Register +-AT91C_EMAC_IDR EQU (0xFFFDC02C) ;- (EMAC) Interrupt Disable Register +-AT91C_EMAC_RSE EQU (0xFFFDC074) ;- (EMAC) Receive Symbol Errors Register +-AT91C_EMAC_ECOL EQU (0xFFFDC060) ;- (EMAC) Excessive Collision Register +-AT91C_EMAC_TID EQU (0xFFFDC0B8) ;- (EMAC) Type ID Checking Register +-AT91C_EMAC_HRB EQU (0xFFFDC090) ;- (EMAC) Hash Address Bottom[31:0] +-AT91C_EMAC_TBQP EQU (0xFFFDC01C) ;- (EMAC) Transmit Buffer Queue Pointer +-AT91C_EMAC_USRIO EQU (0xFFFDC0C0) ;- (EMAC) USER Input/Output Register +-AT91C_EMAC_PTR EQU (0xFFFDC038) ;- (EMAC) Pause Time Register +-AT91C_EMAC_SA2H EQU (0xFFFDC0A4) ;- (EMAC) Specific Address 2 Top, Last 2 bytes +-AT91C_EMAC_ROV EQU (0xFFFDC070) ;- (EMAC) Receive Overrun Errors Register +-AT91C_EMAC_ALE EQU (0xFFFDC054) ;- (EMAC) Alignment Error Register +-AT91C_EMAC_RJA EQU (0xFFFDC07C) ;- (EMAC) Receive Jabbers Register +-AT91C_EMAC_RBQP EQU (0xFFFDC018) ;- (EMAC) Receive Buffer Queue Pointer +-AT91C_EMAC_TPF EQU (0xFFFDC08C) ;- (EMAC) Transmitted Pause Frames Register +-AT91C_EMAC_NCFGR EQU (0xFFFDC004) ;- (EMAC) Network Configuration Register +-AT91C_EMAC_HRT EQU (0xFFFDC094) ;- (EMAC) Hash Address Top[63:32] +-AT91C_EMAC_USF EQU (0xFFFDC080) ;- (EMAC) Undersize Frames Register +-AT91C_EMAC_FCSE EQU (0xFFFDC050) ;- (EMAC) Frame Check Sequence Error Register +-AT91C_EMAC_TPQ EQU (0xFFFDC0BC) ;- (EMAC) Transmit Pause Quantum Register +-AT91C_EMAC_MAN EQU (0xFFFDC034) ;- (EMAC) PHY Maintenance Register +-AT91C_EMAC_FTO EQU (0xFFFDC040) ;- (EMAC) Frames Transmitted OK Register +-AT91C_EMAC_REV EQU (0xFFFDC0FC) ;- (EMAC) Revision Register +-AT91C_EMAC_IMR EQU (0xFFFDC030) ;- (EMAC) Interrupt Mask Register +-AT91C_EMAC_SCF EQU (0xFFFDC044) ;- (EMAC) Single Collision Frame Register +-AT91C_EMAC_PFR EQU (0xFFFDC03C) ;- (EMAC) Pause Frames received Register +-AT91C_EMAC_MCF EQU (0xFFFDC048) ;- (EMAC) Multiple Collision Frame Register +-AT91C_EMAC_NSR EQU (0xFFFDC008) ;- (EMAC) Network Status Register +-AT91C_EMAC_SA2L EQU (0xFFFDC0A0) ;- (EMAC) Specific Address 2 Bottom, First 4 bytes +-AT91C_EMAC_FRO EQU (0xFFFDC04C) ;- (EMAC) Frames Received OK Register +-AT91C_EMAC_IER EQU (0xFFFDC028) ;- (EMAC) Interrupt Enable Register +-AT91C_EMAC_SA1H EQU (0xFFFDC09C) ;- (EMAC) Specific Address 1 Top, Last 2 bytes +-AT91C_EMAC_CSE EQU (0xFFFDC068) ;- (EMAC) Carrier Sense Error Register +-AT91C_EMAC_SA3H EQU (0xFFFDC0AC) ;- (EMAC) Specific Address 3 Top, Last 2 bytes +-AT91C_EMAC_RRE EQU (0xFFFDC06C) ;- (EMAC) Receive Ressource Error Register +-AT91C_EMAC_STE EQU (0xFFFDC084) ;- (EMAC) SQE Test Error Register +-// - ========== Register definition for PDC_ADC peripheral ========== +-AT91C_ADC_PTSR EQU (0xFFFD8124) ;- (PDC_ADC) PDC Transfer Status Register +-AT91C_ADC_PTCR EQU (0xFFFD8120) ;- (PDC_ADC) PDC Transfer Control Register +-AT91C_ADC_TNPR EQU (0xFFFD8118) ;- (PDC_ADC) Transmit Next Pointer Register +-AT91C_ADC_TNCR EQU (0xFFFD811C) ;- (PDC_ADC) Transmit Next Counter Register +-AT91C_ADC_RNPR EQU (0xFFFD8110) ;- (PDC_ADC) Receive Next Pointer Register +-AT91C_ADC_RNCR EQU (0xFFFD8114) ;- (PDC_ADC) Receive Next Counter Register +-AT91C_ADC_RPR EQU (0xFFFD8100) ;- (PDC_ADC) Receive Pointer Register +-AT91C_ADC_TCR EQU (0xFFFD810C) ;- (PDC_ADC) Transmit Counter Register +-AT91C_ADC_TPR EQU (0xFFFD8108) ;- (PDC_ADC) Transmit Pointer Register +-AT91C_ADC_RCR EQU (0xFFFD8104) ;- (PDC_ADC) Receive Counter Register +-// - ========== Register definition for ADC peripheral ========== +-AT91C_ADC_CDR2 EQU (0xFFFD8038) ;- (ADC) ADC Channel Data Register 2 +-AT91C_ADC_CDR3 EQU (0xFFFD803C) ;- (ADC) ADC Channel Data Register 3 +-AT91C_ADC_CDR0 EQU (0xFFFD8030) ;- (ADC) ADC Channel Data Register 0 +-AT91C_ADC_CDR5 EQU (0xFFFD8044) ;- (ADC) ADC Channel Data Register 5 +-AT91C_ADC_CHDR EQU (0xFFFD8014) ;- (ADC) ADC Channel Disable Register +-AT91C_ADC_SR EQU (0xFFFD801C) ;- (ADC) ADC Status Register +-AT91C_ADC_CDR4 EQU (0xFFFD8040) ;- (ADC) ADC Channel Data Register 4 +-AT91C_ADC_CDR1 EQU (0xFFFD8034) ;- (ADC) ADC Channel Data Register 1 +-AT91C_ADC_LCDR EQU (0xFFFD8020) ;- (ADC) ADC Last Converted Data Register +-AT91C_ADC_IDR EQU (0xFFFD8028) ;- (ADC) ADC Interrupt Disable Register +-AT91C_ADC_CR EQU (0xFFFD8000) ;- (ADC) ADC Control Register +-AT91C_ADC_CDR7 EQU (0xFFFD804C) ;- (ADC) ADC Channel Data Register 7 +-AT91C_ADC_CDR6 EQU (0xFFFD8048) ;- (ADC) ADC Channel Data Register 6 +-AT91C_ADC_IER EQU (0xFFFD8024) ;- (ADC) ADC Interrupt Enable Register +-AT91C_ADC_CHER EQU (0xFFFD8010) ;- (ADC) ADC Channel Enable Register +-AT91C_ADC_CHSR EQU (0xFFFD8018) ;- (ADC) ADC Channel Status Register +-AT91C_ADC_MR EQU (0xFFFD8004) ;- (ADC) ADC Mode Register +-AT91C_ADC_IMR EQU (0xFFFD802C) ;- (ADC) ADC Interrupt Mask Register +- +-// - ***************************************************************************** +-// - PIO DEFINITIONS FOR AT91SAM7X256 +-// - ***************************************************************************** +-AT91C_PIO_PA0 EQU (1 << 0) ;- Pin Controlled by PA0 +-AT91C_PA0_RXD0 EQU (AT91C_PIO_PA0) ;- USART 0 Receive Data +-AT91C_PIO_PA1 EQU (1 << 1) ;- Pin Controlled by PA1 +-AT91C_PA1_TXD0 EQU (AT91C_PIO_PA1) ;- USART 0 Transmit Data +-AT91C_PIO_PA10 EQU (1 << 10) ;- Pin Controlled by PA10 +-AT91C_PA10_TWD EQU (AT91C_PIO_PA10) ;- TWI Two-wire Serial Data +-AT91C_PIO_PA11 EQU (1 << 11) ;- Pin Controlled by PA11 +-AT91C_PA11_TWCK EQU (AT91C_PIO_PA11) ;- TWI Two-wire Serial Clock +-AT91C_PIO_PA12 EQU (1 << 12) ;- Pin Controlled by PA12 +-AT91C_PA12_SPI0_NPCS0 EQU (AT91C_PIO_PA12) ;- SPI 0 Peripheral Chip Select 0 +-AT91C_PIO_PA13 EQU (1 << 13) ;- Pin Controlled by PA13 +-AT91C_PA13_SPI0_NPCS1 EQU (AT91C_PIO_PA13) ;- SPI 0 Peripheral Chip Select 1 +-AT91C_PA13_PCK1 EQU (AT91C_PIO_PA13) ;- PMC Programmable Clock Output 1 +-AT91C_PIO_PA14 EQU (1 << 14) ;- Pin Controlled by PA14 +-AT91C_PA14_SPI0_NPCS2 EQU (AT91C_PIO_PA14) ;- SPI 0 Peripheral Chip Select 2 +-AT91C_PA14_IRQ1 EQU (AT91C_PIO_PA14) ;- External Interrupt 1 +-AT91C_PIO_PA15 EQU (1 << 15) ;- Pin Controlled by PA15 +-AT91C_PA15_SPI0_NPCS3 EQU (AT91C_PIO_PA15) ;- SPI 0 Peripheral Chip Select 3 +-AT91C_PA15_TCLK2 EQU (AT91C_PIO_PA15) ;- Timer Counter 2 external clock input +-AT91C_PIO_PA16 EQU (1 << 16) ;- Pin Controlled by PA16 +-AT91C_PA16_SPI0_MISO EQU (AT91C_PIO_PA16) ;- SPI 0 Master In Slave +-AT91C_PIO_PA17 EQU (1 << 17) ;- Pin Controlled by PA17 +-AT91C_PA17_SPI0_MOSI EQU (AT91C_PIO_PA17) ;- SPI 0 Master Out Slave +-AT91C_PIO_PA18 EQU (1 << 18) ;- Pin Controlled by PA18 +-AT91C_PA18_SPI0_SPCK EQU (AT91C_PIO_PA18) ;- SPI 0 Serial Clock +-AT91C_PIO_PA19 EQU (1 << 19) ;- Pin Controlled by PA19 +-AT91C_PA19_CANRX EQU (AT91C_PIO_PA19) ;- CAN Receive +-AT91C_PIO_PA2 EQU (1 << 2) ;- Pin Controlled by PA2 +-AT91C_PA2_SCK0 EQU (AT91C_PIO_PA2) ;- USART 0 Serial Clock +-AT91C_PA2_SPI1_NPCS1 EQU (AT91C_PIO_PA2) ;- SPI 1 Peripheral Chip Select 1 +-AT91C_PIO_PA20 EQU (1 << 20) ;- Pin Controlled by PA20 +-AT91C_PA20_CANTX EQU (AT91C_PIO_PA20) ;- CAN Transmit +-AT91C_PIO_PA21 EQU (1 << 21) ;- Pin Controlled by PA21 +-AT91C_PA21_TF EQU (AT91C_PIO_PA21) ;- SSC Transmit Frame Sync +-AT91C_PA21_SPI1_NPCS0 EQU (AT91C_PIO_PA21) ;- SPI 1 Peripheral Chip Select 0 +-AT91C_PIO_PA22 EQU (1 << 22) ;- Pin Controlled by PA22 +-AT91C_PA22_TK EQU (AT91C_PIO_PA22) ;- SSC Transmit Clock +-AT91C_PA22_SPI1_SPCK EQU (AT91C_PIO_PA22) ;- SPI 1 Serial Clock +-AT91C_PIO_PA23 EQU (1 << 23) ;- Pin Controlled by PA23 +-AT91C_PA23_TD EQU (AT91C_PIO_PA23) ;- SSC Transmit data +-AT91C_PA23_SPI1_MOSI EQU (AT91C_PIO_PA23) ;- SPI 1 Master Out Slave +-AT91C_PIO_PA24 EQU (1 << 24) ;- Pin Controlled by PA24 +-AT91C_PA24_RD EQU (AT91C_PIO_PA24) ;- SSC Receive Data +-AT91C_PA24_SPI1_MISO EQU (AT91C_PIO_PA24) ;- SPI 1 Master In Slave +-AT91C_PIO_PA25 EQU (1 << 25) ;- Pin Controlled by PA25 +-AT91C_PA25_RK EQU (AT91C_PIO_PA25) ;- SSC Receive Clock +-AT91C_PA25_SPI1_NPCS1 EQU (AT91C_PIO_PA25) ;- SPI 1 Peripheral Chip Select 1 +-AT91C_PIO_PA26 EQU (1 << 26) ;- Pin Controlled by PA26 +-AT91C_PA26_RF EQU (AT91C_PIO_PA26) ;- SSC Receive Frame Sync +-AT91C_PA26_SPI1_NPCS2 EQU (AT91C_PIO_PA26) ;- SPI 1 Peripheral Chip Select 2 +-AT91C_PIO_PA27 EQU (1 << 27) ;- Pin Controlled by PA27 +-AT91C_PA27_DRXD EQU (AT91C_PIO_PA27) ;- DBGU Debug Receive Data +-AT91C_PA27_PCK3 EQU (AT91C_PIO_PA27) ;- PMC Programmable Clock Output 3 +-AT91C_PIO_PA28 EQU (1 << 28) ;- Pin Controlled by PA28 +-AT91C_PA28_DTXD EQU (AT91C_PIO_PA28) ;- DBGU Debug Transmit Data +-AT91C_PIO_PA29 EQU (1 << 29) ;- Pin Controlled by PA29 +-AT91C_PA29_FIQ EQU (AT91C_PIO_PA29) ;- AIC Fast Interrupt Input +-AT91C_PA29_SPI1_NPCS3 EQU (AT91C_PIO_PA29) ;- SPI 1 Peripheral Chip Select 3 +-AT91C_PIO_PA3 EQU (1 << 3) ;- Pin Controlled by PA3 +-AT91C_PA3_RTS0 EQU (AT91C_PIO_PA3) ;- USART 0 Ready To Send +-AT91C_PA3_SPI1_NPCS2 EQU (AT91C_PIO_PA3) ;- SPI 1 Peripheral Chip Select 2 +-AT91C_PIO_PA30 EQU (1 << 30) ;- Pin Controlled by PA30 +-AT91C_PA30_IRQ0 EQU (AT91C_PIO_PA30) ;- External Interrupt 0 +-AT91C_PA30_PCK2 EQU (AT91C_PIO_PA30) ;- PMC Programmable Clock Output 2 +-AT91C_PIO_PA4 EQU (1 << 4) ;- Pin Controlled by PA4 +-AT91C_PA4_CTS0 EQU (AT91C_PIO_PA4) ;- USART 0 Clear To Send +-AT91C_PA4_SPI1_NPCS3 EQU (AT91C_PIO_PA4) ;- SPI 1 Peripheral Chip Select 3 +-AT91C_PIO_PA5 EQU (1 << 5) ;- Pin Controlled by PA5 +-AT91C_PA5_RXD1 EQU (AT91C_PIO_PA5) ;- USART 1 Receive Data +-AT91C_PIO_PA6 EQU (1 << 6) ;- Pin Controlled by PA6 +-AT91C_PA6_TXD1 EQU (AT91C_PIO_PA6) ;- USART 1 Transmit Data +-AT91C_PIO_PA7 EQU (1 << 7) ;- Pin Controlled by PA7 +-AT91C_PA7_SCK1 EQU (AT91C_PIO_PA7) ;- USART 1 Serial Clock +-AT91C_PA7_SPI0_NPCS1 EQU (AT91C_PIO_PA7) ;- SPI 0 Peripheral Chip Select 1 +-AT91C_PIO_PA8 EQU (1 << 8) ;- Pin Controlled by PA8 +-AT91C_PA8_RTS1 EQU (AT91C_PIO_PA8) ;- USART 1 Ready To Send +-AT91C_PA8_SPI0_NPCS2 EQU (AT91C_PIO_PA8) ;- SPI 0 Peripheral Chip Select 2 +-AT91C_PIO_PA9 EQU (1 << 9) ;- Pin Controlled by PA9 +-AT91C_PA9_CTS1 EQU (AT91C_PIO_PA9) ;- USART 1 Clear To Send +-AT91C_PA9_SPI0_NPCS3 EQU (AT91C_PIO_PA9) ;- SPI 0 Peripheral Chip Select 3 +-AT91C_PIO_PB0 EQU (1 << 0) ;- Pin Controlled by PB0 +-AT91C_PB0_ETXCK_EREFCK EQU (AT91C_PIO_PB0) ;- Ethernet MAC Transmit Clock/Reference Clock +-AT91C_PB0_PCK0 EQU (AT91C_PIO_PB0) ;- PMC Programmable Clock Output 0 +-AT91C_PIO_PB1 EQU (1 << 1) ;- Pin Controlled by PB1 +-AT91C_PB1_ETXEN EQU (AT91C_PIO_PB1) ;- Ethernet MAC Transmit Enable +-AT91C_PIO_PB10 EQU (1 << 10) ;- Pin Controlled by PB10 +-AT91C_PB10_ETX2 EQU (AT91C_PIO_PB10) ;- Ethernet MAC Transmit Data 2 +-AT91C_PB10_SPI1_NPCS1 EQU (AT91C_PIO_PB10) ;- SPI 1 Peripheral Chip Select 1 +-AT91C_PIO_PB11 EQU (1 << 11) ;- Pin Controlled by PB11 +-AT91C_PB11_ETX3 EQU (AT91C_PIO_PB11) ;- Ethernet MAC Transmit Data 3 +-AT91C_PB11_SPI1_NPCS2 EQU (AT91C_PIO_PB11) ;- SPI 1 Peripheral Chip Select 2 +-AT91C_PIO_PB12 EQU (1 << 12) ;- Pin Controlled by PB12 +-AT91C_PB12_ETXER EQU (AT91C_PIO_PB12) ;- Ethernet MAC Transmikt Coding Error +-AT91C_PB12_TCLK0 EQU (AT91C_PIO_PB12) ;- Timer Counter 0 external clock input +-AT91C_PIO_PB13 EQU (1 << 13) ;- Pin Controlled by PB13 +-AT91C_PB13_ERX2 EQU (AT91C_PIO_PB13) ;- Ethernet MAC Receive Data 2 +-AT91C_PB13_SPI0_NPCS1 EQU (AT91C_PIO_PB13) ;- SPI 0 Peripheral Chip Select 1 +-AT91C_PIO_PB14 EQU (1 << 14) ;- Pin Controlled by PB14 +-AT91C_PB14_ERX3 EQU (AT91C_PIO_PB14) ;- Ethernet MAC Receive Data 3 +-AT91C_PB14_SPI0_NPCS2 EQU (AT91C_PIO_PB14) ;- SPI 0 Peripheral Chip Select 2 +-AT91C_PIO_PB15 EQU (1 << 15) ;- Pin Controlled by PB15 +-AT91C_PB15_ERXDV_ECRSDV EQU (AT91C_PIO_PB15) ;- Ethernet MAC Receive Data Valid +-AT91C_PIO_PB16 EQU (1 << 16) ;- Pin Controlled by PB16 +-AT91C_PB16_ECOL EQU (AT91C_PIO_PB16) ;- Ethernet MAC Collision Detected +-AT91C_PB16_SPI1_NPCS3 EQU (AT91C_PIO_PB16) ;- SPI 1 Peripheral Chip Select 3 +-AT91C_PIO_PB17 EQU (1 << 17) ;- Pin Controlled by PB17 +-AT91C_PB17_ERXCK EQU (AT91C_PIO_PB17) ;- Ethernet MAC Receive Clock +-AT91C_PB17_SPI0_NPCS3 EQU (AT91C_PIO_PB17) ;- SPI 0 Peripheral Chip Select 3 +-AT91C_PIO_PB18 EQU (1 << 18) ;- Pin Controlled by PB18 +-AT91C_PB18_EF100 EQU (AT91C_PIO_PB18) ;- Ethernet MAC Force 100 Mbits/sec +-AT91C_PB18_ADTRG EQU (AT91C_PIO_PB18) ;- ADC External Trigger +-AT91C_PIO_PB19 EQU (1 << 19) ;- Pin Controlled by PB19 +-AT91C_PB19_PWM0 EQU (AT91C_PIO_PB19) ;- PWM Channel 0 +-AT91C_PB19_TCLK1 EQU (AT91C_PIO_PB19) ;- Timer Counter 1 external clock input +-AT91C_PIO_PB2 EQU (1 << 2) ;- Pin Controlled by PB2 +-AT91C_PB2_ETX0 EQU (AT91C_PIO_PB2) ;- Ethernet MAC Transmit Data 0 +-AT91C_PIO_PB20 EQU (1 << 20) ;- Pin Controlled by PB20 +-AT91C_PB20_PWM1 EQU (AT91C_PIO_PB20) ;- PWM Channel 1 +-AT91C_PB20_PCK0 EQU (AT91C_PIO_PB20) ;- PMC Programmable Clock Output 0 +-AT91C_PIO_PB21 EQU (1 << 21) ;- Pin Controlled by PB21 +-AT91C_PB21_PWM2 EQU (AT91C_PIO_PB21) ;- PWM Channel 2 +-AT91C_PB21_PCK1 EQU (AT91C_PIO_PB21) ;- PMC Programmable Clock Output 1 +-AT91C_PIO_PB22 EQU (1 << 22) ;- Pin Controlled by PB22 +-AT91C_PB22_PWM3 EQU (AT91C_PIO_PB22) ;- PWM Channel 3 +-AT91C_PB22_PCK2 EQU (AT91C_PIO_PB22) ;- PMC Programmable Clock Output 2 +-AT91C_PIO_PB23 EQU (1 << 23) ;- Pin Controlled by PB23 +-AT91C_PB23_TIOA0 EQU (AT91C_PIO_PB23) ;- Timer Counter 0 Multipurpose Timer I/O Pin A +-AT91C_PB23_DCD1 EQU (AT91C_PIO_PB23) ;- USART 1 Data Carrier Detect +-AT91C_PIO_PB24 EQU (1 << 24) ;- Pin Controlled by PB24 +-AT91C_PB24_TIOB0 EQU (AT91C_PIO_PB24) ;- Timer Counter 0 Multipurpose Timer I/O Pin B +-AT91C_PB24_DSR1 EQU (AT91C_PIO_PB24) ;- USART 1 Data Set ready +-AT91C_PIO_PB25 EQU (1 << 25) ;- Pin Controlled by PB25 +-AT91C_PB25_TIOA1 EQU (AT91C_PIO_PB25) ;- Timer Counter 1 Multipurpose Timer I/O Pin A +-AT91C_PB25_DTR1 EQU (AT91C_PIO_PB25) ;- USART 1 Data Terminal ready +-AT91C_PIO_PB26 EQU (1 << 26) ;- Pin Controlled by PB26 +-AT91C_PB26_TIOB1 EQU (AT91C_PIO_PB26) ;- Timer Counter 1 Multipurpose Timer I/O Pin B +-AT91C_PB26_RI1 EQU (AT91C_PIO_PB26) ;- USART 1 Ring Indicator +-AT91C_PIO_PB27 EQU (1 << 27) ;- Pin Controlled by PB27 +-AT91C_PB27_TIOA2 EQU (AT91C_PIO_PB27) ;- Timer Counter 2 Multipurpose Timer I/O Pin A +-AT91C_PB27_PWM0 EQU (AT91C_PIO_PB27) ;- PWM Channel 0 +-AT91C_PIO_PB28 EQU (1 << 28) ;- Pin Controlled by PB28 +-AT91C_PB28_TIOB2 EQU (AT91C_PIO_PB28) ;- Timer Counter 2 Multipurpose Timer I/O Pin B +-AT91C_PB28_PWM1 EQU (AT91C_PIO_PB28) ;- PWM Channel 1 +-AT91C_PIO_PB29 EQU (1 << 29) ;- Pin Controlled by PB29 +-AT91C_PB29_PCK1 EQU (AT91C_PIO_PB29) ;- PMC Programmable Clock Output 1 +-AT91C_PB29_PWM2 EQU (AT91C_PIO_PB29) ;- PWM Channel 2 +-AT91C_PIO_PB3 EQU (1 << 3) ;- Pin Controlled by PB3 +-AT91C_PB3_ETX1 EQU (AT91C_PIO_PB3) ;- Ethernet MAC Transmit Data 1 +-AT91C_PIO_PB30 EQU (1 << 30) ;- Pin Controlled by PB30 +-AT91C_PB30_PCK2 EQU (AT91C_PIO_PB30) ;- PMC Programmable Clock Output 2 +-AT91C_PB30_PWM3 EQU (AT91C_PIO_PB30) ;- PWM Channel 3 +-AT91C_PIO_PB4 EQU (1 << 4) ;- Pin Controlled by PB4 +-AT91C_PB4_ECRS EQU (AT91C_PIO_PB4) ;- Ethernet MAC Carrier Sense/Carrier Sense and Data Valid +-AT91C_PIO_PB5 EQU (1 << 5) ;- Pin Controlled by PB5 +-AT91C_PB5_ERX0 EQU (AT91C_PIO_PB5) ;- Ethernet MAC Receive Data 0 +-AT91C_PIO_PB6 EQU (1 << 6) ;- Pin Controlled by PB6 +-AT91C_PB6_ERX1 EQU (AT91C_PIO_PB6) ;- Ethernet MAC Receive Data 1 +-AT91C_PIO_PB7 EQU (1 << 7) ;- Pin Controlled by PB7 +-AT91C_PB7_ERXER EQU (AT91C_PIO_PB7) ;- Ethernet MAC Receive Error +-AT91C_PIO_PB8 EQU (1 << 8) ;- Pin Controlled by PB8 +-AT91C_PB8_EMDC EQU (AT91C_PIO_PB8) ;- Ethernet MAC Management Data Clock +-AT91C_PIO_PB9 EQU (1 << 9) ;- Pin Controlled by PB9 +-AT91C_PB9_EMDIO EQU (AT91C_PIO_PB9) ;- Ethernet MAC Management Data Input/Output +- +-// - ***************************************************************************** +-// - PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 +-// - ***************************************************************************** +-AT91C_ID_FIQ EQU ( 0) ;- Advanced Interrupt Controller (FIQ) +-AT91C_ID_SYS EQU ( 1) ;- System Peripheral +-AT91C_ID_PIOA EQU ( 2) ;- Parallel IO Controller A +-AT91C_ID_PIOB EQU ( 3) ;- Parallel IO Controller B +-AT91C_ID_SPI0 EQU ( 4) ;- Serial Peripheral Interface 0 +-AT91C_ID_SPI1 EQU ( 5) ;- Serial Peripheral Interface 1 +-AT91C_ID_US0 EQU ( 6) ;- USART 0 +-AT91C_ID_US1 EQU ( 7) ;- USART 1 +-AT91C_ID_SSC EQU ( 8) ;- Serial Synchronous Controller +-AT91C_ID_TWI EQU ( 9) ;- Two-Wire Interface +-AT91C_ID_PWMC EQU (10) ;- PWM Controller +-AT91C_ID_UDP EQU (11) ;- USB Device Port +-AT91C_ID_TC0 EQU (12) ;- Timer Counter 0 +-AT91C_ID_TC1 EQU (13) ;- Timer Counter 1 +-AT91C_ID_TC2 EQU (14) ;- Timer Counter 2 +-AT91C_ID_CAN EQU (15) ;- Control Area Network Controller +-AT91C_ID_EMAC EQU (16) ;- Ethernet MAC +-AT91C_ID_ADC EQU (17) ;- Analog-to-Digital Converter +-AT91C_ID_18_Reserved EQU (18) ;- Reserved +-AT91C_ID_19_Reserved EQU (19) ;- Reserved +-AT91C_ID_20_Reserved EQU (20) ;- Reserved +-AT91C_ID_21_Reserved EQU (21) ;- Reserved +-AT91C_ID_22_Reserved EQU (22) ;- Reserved +-AT91C_ID_23_Reserved EQU (23) ;- Reserved +-AT91C_ID_24_Reserved EQU (24) ;- Reserved +-AT91C_ID_25_Reserved EQU (25) ;- Reserved +-AT91C_ID_26_Reserved EQU (26) ;- Reserved +-AT91C_ID_27_Reserved EQU (27) ;- Reserved +-AT91C_ID_28_Reserved EQU (28) ;- Reserved +-AT91C_ID_29_Reserved EQU (29) ;- Reserved +-AT91C_ID_IRQ0 EQU (30) ;- Advanced Interrupt Controller (IRQ0) +-AT91C_ID_IRQ1 EQU (31) ;- Advanced Interrupt Controller (IRQ1) +-AT91C_ALL_INT EQU (0xC003FFFF) ;- ALL VALID INTERRUPTS +- +-// - ***************************************************************************** +-// - BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 +-// - ***************************************************************************** +-AT91C_BASE_SYS EQU (0xFFFFF000) ;- (SYS) Base Address +-AT91C_BASE_AIC EQU (0xFFFFF000) ;- (AIC) Base Address +-AT91C_BASE_PDC_DBGU EQU (0xFFFFF300) ;- (PDC_DBGU) Base Address +-AT91C_BASE_DBGU EQU (0xFFFFF200) ;- (DBGU) Base Address +-AT91C_BASE_PIOA EQU (0xFFFFF400) ;- (PIOA) Base Address +-AT91C_BASE_PIOB EQU (0xFFFFF600) ;- (PIOB) Base Address +-AT91C_BASE_CKGR EQU (0xFFFFFC20) ;- (CKGR) Base Address +-AT91C_BASE_PMC EQU (0xFFFFFC00) ;- (PMC) Base Address +-AT91C_BASE_RSTC EQU (0xFFFFFD00) ;- (RSTC) Base Address +-AT91C_BASE_RTTC EQU (0xFFFFFD20) ;- (RTTC) Base Address +-AT91C_BASE_PITC EQU (0xFFFFFD30) ;- (PITC) Base Address +-AT91C_BASE_WDTC EQU (0xFFFFFD40) ;- (WDTC) Base Address +-AT91C_BASE_VREG EQU (0xFFFFFD60) ;- (VREG) Base Address +-AT91C_BASE_MC EQU (0xFFFFFF00) ;- (MC) Base Address +-AT91C_BASE_PDC_SPI1 EQU (0xFFFE4100) ;- (PDC_SPI1) Base Address +-AT91C_BASE_SPI1 EQU (0xFFFE4000) ;- (SPI1) Base Address +-AT91C_BASE_PDC_SPI0 EQU (0xFFFE0100) ;- (PDC_SPI0) Base Address +-AT91C_BASE_SPI0 EQU (0xFFFE0000) ;- (SPI0) Base Address +-AT91C_BASE_PDC_US1 EQU (0xFFFC4100) ;- (PDC_US1) Base Address +-AT91C_BASE_US1 EQU (0xFFFC4000) ;- (US1) Base Address +-AT91C_BASE_PDC_US0 EQU (0xFFFC0100) ;- (PDC_US0) Base Address +-AT91C_BASE_US0 EQU (0xFFFC0000) ;- (US0) Base Address +-AT91C_BASE_PDC_SSC EQU (0xFFFD4100) ;- (PDC_SSC) Base Address +-AT91C_BASE_SSC EQU (0xFFFD4000) ;- (SSC) Base Address +-AT91C_BASE_TWI EQU (0xFFFB8000) ;- (TWI) Base Address +-AT91C_BASE_PWMC_CH3 EQU (0xFFFCC260) ;- (PWMC_CH3) Base Address +-AT91C_BASE_PWMC_CH2 EQU (0xFFFCC240) ;- (PWMC_CH2) Base Address +-AT91C_BASE_PWMC_CH1 EQU (0xFFFCC220) ;- (PWMC_CH1) Base Address +-AT91C_BASE_PWMC_CH0 EQU (0xFFFCC200) ;- (PWMC_CH0) Base Address +-AT91C_BASE_PWMC EQU (0xFFFCC000) ;- (PWMC) Base Address +-AT91C_BASE_UDP EQU (0xFFFB0000) ;- (UDP) Base Address +-AT91C_BASE_TC0 EQU (0xFFFA0000) ;- (TC0) Base Address +-AT91C_BASE_TC1 EQU (0xFFFA0040) ;- (TC1) Base Address +-AT91C_BASE_TC2 EQU (0xFFFA0080) ;- (TC2) Base Address +-AT91C_BASE_TCB EQU (0xFFFA0000) ;- (TCB) Base Address +-AT91C_BASE_CAN_MB0 EQU (0xFFFD0200) ;- (CAN_MB0) Base Address +-AT91C_BASE_CAN_MB1 EQU (0xFFFD0220) ;- (CAN_MB1) Base Address +-AT91C_BASE_CAN_MB2 EQU (0xFFFD0240) ;- (CAN_MB2) Base Address +-AT91C_BASE_CAN_MB3 EQU (0xFFFD0260) ;- (CAN_MB3) Base Address +-AT91C_BASE_CAN_MB4 EQU (0xFFFD0280) ;- (CAN_MB4) Base Address +-AT91C_BASE_CAN_MB5 EQU (0xFFFD02A0) ;- (CAN_MB5) Base Address +-AT91C_BASE_CAN_MB6 EQU (0xFFFD02C0) ;- (CAN_MB6) Base Address +-AT91C_BASE_CAN_MB7 EQU (0xFFFD02E0) ;- (CAN_MB7) Base Address +-AT91C_BASE_CAN EQU (0xFFFD0000) ;- (CAN) Base Address +-AT91C_BASE_EMAC EQU (0xFFFDC000) ;- (EMAC) Base Address +-AT91C_BASE_PDC_ADC EQU (0xFFFD8100) ;- (PDC_ADC) Base Address +-AT91C_BASE_ADC EQU (0xFFFD8000) ;- (ADC) Base Address +- +-// - ***************************************************************************** +-// - MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 +-// - ***************************************************************************** +-// - ISRAM +-AT91C_ISRAM EQU (0x00200000) ;- Internal SRAM base address +-AT91C_ISRAM_SIZE EQU (0x00010000) ;- Internal SRAM size in byte (64 Kbytes) +-// - IFLASH +-AT91C_IFLASH EQU (0x00100000) ;- Internal FLASH base address +-AT91C_IFLASH_SIZE EQU (0x00040000) ;- Internal FLASH size in byte (256 Kbytes) +-AT91C_IFLASH_PAGE_SIZE EQU (256) ;- Internal FLASH Page Size: 256 bytes +-AT91C_IFLASH_LOCK_REGION_SIZE EQU (16384) ;- Internal FLASH Lock Region Size: 16 Kbytes +-AT91C_IFLASH_NB_OF_PAGES EQU (1024) ;- Internal FLASH Number of Pages: 1024 bytes +-AT91C_IFLASH_NB_OF_LOCK_BITS EQU (16) ;- Internal FLASH Number of Lock Bits: 16 bytes +-#endif /* __IAR_SYSTEMS_ASM__ */ +- +- +-#endif /* AT91SAM7X256_H */ +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/lib_AT91SAM7X256.h b/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/lib_AT91SAM7X256.h +deleted file mode 100644 +index 95492d0c3d..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/incIAR/lib_AT91SAM7X256.h ++++ /dev/null +@@ -1,4211 +0,0 @@ +-//* ---------------------------------------------------------------------------- +-//* ATMEL Microcontroller Software Support - ROUSSET - +-//* ---------------------------------------------------------------------------- +-//* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-//* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-//* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-//* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : lib_AT91SAM7X256.h +-//* Object : AT91SAM7X256 inlined functions +-//* Generated : AT91 SW Application Group 11/02/2005 (15:17:24) +-//* +-//* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// +-//* CVS Reference : /lib_pmc_SAM7X.h/1.4/Tue Aug 30 13:00:36 2005// +-//* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// +-//* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// +-//* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// +-//* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// +-//* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// +-//* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// +-//* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// +-//* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// +-//* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// +-//* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// +-//* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// +-//* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// +-//* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// +-//* CVS Reference : /lib_MC_SAM7X.h/1.1/Thu Mar 25 15:19:14 2004// +-//* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// +-//* CVS Reference : /lib_can_AT91.h/1.5/Tue Aug 23 15:37:07 2005// +-//* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// +-//* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// +-//* ---------------------------------------------------------------------------- +- +-#ifndef lib_AT91SAM7X256_H +-#define lib_AT91SAM7X256_H +- +-/* ***************************************************************************** +- SOFTWARE API FOR AIC +- ***************************************************************************** */ +-#define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_ConfigureIt +-//* \brief Interrupt Handler Initialization +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_AIC_ConfigureIt ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id, // \arg interrupt number to initialize +- unsigned int priority, // \arg priority to give to the interrupt +- unsigned int src_type, // \arg activation and sense of activation +- void (*newHandler) () ) // \arg address of the interrupt handler +-{ +- unsigned int oldHandler; +- unsigned int mask ; +- +- oldHandler = pAic->AIC_SVR[irq_id]; +- +- mask = 0x1 << irq_id ; +- //* Disable the interrupt on the interrupt controller +- pAic->AIC_IDCR = mask ; +- //* Save the interrupt handler routine pointer and the interrupt priority +- pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; +- //* Store the Source Mode Register +- pAic->AIC_SMR[irq_id] = src_type | priority ; +- //* Clear the interrupt on the interrupt controller +- pAic->AIC_ICCR = mask ; +- +- return oldHandler; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_EnableIt +-//* \brief Enable corresponding IT number +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_EnableIt ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id ) // \arg interrupt number to initialize +-{ +- //* Enable the interrupt on the interrupt controller +- pAic->AIC_IECR = 0x1 << irq_id ; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_DisableIt +-//* \brief Disable corresponding IT number +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_DisableIt ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id ) // \arg interrupt number to initialize +-{ +- unsigned int mask = 0x1 << irq_id; +- //* Disable the interrupt on the interrupt controller +- pAic->AIC_IDCR = mask ; +- //* Clear the interrupt on the Interrupt Controller ( if one is pending ) +- pAic->AIC_ICCR = mask ; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_ClearIt +-//* \brief Clear corresponding IT number +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_ClearIt ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id) // \arg interrupt number to initialize +-{ +- //* Clear the interrupt on the Interrupt Controller ( if one is pending ) +- pAic->AIC_ICCR = (0x1 << irq_id); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_AcknowledgeIt +-//* \brief Acknowledge corresponding IT number +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_AcknowledgeIt ( +- AT91PS_AIC pAic) // \arg pointer to the AIC registers +-{ +- pAic->AIC_EOICR = pAic->AIC_EOICR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_SetExceptionVector +-//* \brief Configure vector handler +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_AIC_SetExceptionVector ( +- unsigned int *pVector, // \arg pointer to the AIC registers +- void (*Handler) () ) // \arg Interrupt Handler +-{ +- unsigned int oldVector = *pVector; +- +- if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) +- *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; +- else +- *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; +- +- return oldVector; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_Trig +-//* \brief Trig an IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_Trig ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id) // \arg interrupt number +-{ +- pAic->AIC_ISCR = (0x1 << irq_id) ; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_IsActive +-//* \brief Test if an IT is active +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_AIC_IsActive ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id) // \arg Interrupt Number +-{ +- return (pAic->AIC_ISR & (0x1 << irq_id)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_IsPending +-//* \brief Test if an IT is pending +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_AIC_IsPending ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id) // \arg Interrupt Number +-{ +- return (pAic->AIC_IPR & (0x1 << irq_id)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_Open +-//* \brief Set exception vectors and AIC registers to default values +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_Open( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- void (*IrqHandler) (), // \arg Default IRQ vector exception +- void (*FiqHandler) (), // \arg Default FIQ vector exception +- void (*DefaultHandler) (), // \arg Default Handler set in ISR +- void (*SpuriousHandler) (), // \arg Default Spurious Handler +- unsigned int protectMode) // \arg Debug Control Register +-{ +- int i; +- +- // Disable all interrupts and set IVR to the default handler +- for (i = 0; i < 32; ++i) { +- AT91F_AIC_DisableIt(pAic, i); +- AT91F_AIC_ConfigureIt(pAic, i, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_HIGH_LEVEL, DefaultHandler); +- } +- +- // Set the IRQ exception vector +- AT91F_AIC_SetExceptionVector((unsigned int *) 0x18, IrqHandler); +- // Set the Fast Interrupt exception vector +- AT91F_AIC_SetExceptionVector((unsigned int *) 0x1C, FiqHandler); +- +- pAic->AIC_SPU = (unsigned int) SpuriousHandler; +- pAic->AIC_DCR = protectMode; +-} +-/* ***************************************************************************** +- SOFTWARE API FOR PDC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_SetNextRx +-//* \brief Set the next receive transfer descriptor +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_SetNextRx ( +- AT91PS_PDC pPDC, // \arg pointer to a PDC controller +- char *address, // \arg address to the next bloc to be received +- unsigned int bytes) // \arg number of bytes to be received +-{ +- pPDC->PDC_RNPR = (unsigned int) address; +- pPDC->PDC_RNCR = bytes; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_SetNextTx +-//* \brief Set the next transmit transfer descriptor +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_SetNextTx ( +- AT91PS_PDC pPDC, // \arg pointer to a PDC controller +- char *address, // \arg address to the next bloc to be transmitted +- unsigned int bytes) // \arg number of bytes to be transmitted +-{ +- pPDC->PDC_TNPR = (unsigned int) address; +- pPDC->PDC_TNCR = bytes; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_SetRx +-//* \brief Set the receive transfer descriptor +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_SetRx ( +- AT91PS_PDC pPDC, // \arg pointer to a PDC controller +- char *address, // \arg address to the next bloc to be received +- unsigned int bytes) // \arg number of bytes to be received +-{ +- pPDC->PDC_RPR = (unsigned int) address; +- pPDC->PDC_RCR = bytes; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_SetTx +-//* \brief Set the transmit transfer descriptor +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_SetTx ( +- AT91PS_PDC pPDC, // \arg pointer to a PDC controller +- char *address, // \arg address to the next bloc to be transmitted +- unsigned int bytes) // \arg number of bytes to be transmitted +-{ +- pPDC->PDC_TPR = (unsigned int) address; +- pPDC->PDC_TCR = bytes; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_EnableTx +-//* \brief Enable transmit +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_EnableTx ( +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- pPDC->PDC_PTCR = AT91C_PDC_TXTEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_EnableRx +-//* \brief Enable receive +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_EnableRx ( +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- pPDC->PDC_PTCR = AT91C_PDC_RXTEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_DisableTx +-//* \brief Disable transmit +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_DisableTx ( +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_DisableRx +-//* \brief Disable receive +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_DisableRx ( +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_IsTxEmpty +-//* \brief Test if the current transfer descriptor has been sent +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- return !(pPDC->PDC_TCR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_IsNextTxEmpty +-//* \brief Test if the next transfer descriptor has been moved to the current td +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- return !(pPDC->PDC_TNCR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_IsRxEmpty +-//* \brief Test if the current transfer descriptor has been filled +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- return !(pPDC->PDC_RCR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_IsNextRxEmpty +-//* \brief Test if the next transfer descriptor has been moved to the current td +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- return !(pPDC->PDC_RNCR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_Open +-//* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_Open ( +- AT91PS_PDC pPDC) // \arg pointer to a PDC controller +-{ +- //* Disable the RX and TX PDC transfer requests +- AT91F_PDC_DisableRx(pPDC); +- AT91F_PDC_DisableTx(pPDC); +- +- //* Reset all Counter register Next buffer first +- AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetTx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetRx(pPDC, (char *) 0, 0); +- +- //* Enable the RX and TX PDC transfer requests +- AT91F_PDC_EnableRx(pPDC); +- AT91F_PDC_EnableTx(pPDC); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_Close +-//* \brief Close PDC: disable TX and RX reset transfer descriptors +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_Close ( +- AT91PS_PDC pPDC) // \arg pointer to a PDC controller +-{ +- //* Disable the RX and TX PDC transfer requests +- AT91F_PDC_DisableRx(pPDC); +- AT91F_PDC_DisableTx(pPDC); +- +- //* Reset all Counter register Next buffer first +- AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetTx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetRx(pPDC, (char *) 0, 0); +- +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_SendFrame +-//* \brief Close PDC: disable TX and RX reset transfer descriptors +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PDC_SendFrame( +- AT91PS_PDC pPDC, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- if (AT91F_PDC_IsTxEmpty(pPDC)) { +- //* Buffer and next buffer can be initialized +- AT91F_PDC_SetTx(pPDC, pBuffer, szBuffer); +- AT91F_PDC_SetNextTx(pPDC, pNextBuffer, szNextBuffer); +- return 2; +- } +- else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { +- //* Only one buffer can be initialized +- AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); +- return 1; +- } +- else { +- //* All buffer are in use... +- return 0; +- } +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_ReceiveFrame +-//* \brief Close PDC: disable TX and RX reset transfer descriptors +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PDC_ReceiveFrame ( +- AT91PS_PDC pPDC, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- if (AT91F_PDC_IsRxEmpty(pPDC)) { +- //* Buffer and next buffer can be initialized +- AT91F_PDC_SetRx(pPDC, pBuffer, szBuffer); +- AT91F_PDC_SetNextRx(pPDC, pNextBuffer, szNextBuffer); +- return 2; +- } +- else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { +- //* Only one buffer can be initialized +- AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); +- return 1; +- } +- else { +- //* All buffer are in use... +- return 0; +- } +-} +-/* ***************************************************************************** +- SOFTWARE API FOR DBGU +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_InterruptEnable +-//* \brief Enable DBGU Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_DBGU_InterruptEnable( +- AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller +- unsigned int flag) // \arg dbgu interrupt to be enabled +-{ +- pDbgu->DBGU_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_InterruptDisable +-//* \brief Disable DBGU Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_DBGU_InterruptDisable( +- AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller +- unsigned int flag) // \arg dbgu interrupt to be disabled +-{ +- pDbgu->DBGU_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_GetInterruptMaskStatus +-//* \brief Return DBGU Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status +- AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller +-{ +- return pDbgu->DBGU_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_IsInterruptMasked +-//* \brief Test if DBGU Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_DBGU_IsInterruptMasked( +- AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR PIO +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgPeriph +-//* \brief Enable pins to be drived by peripheral +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgPeriph( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int periphAEnable, // \arg PERIPH A to enable +- unsigned int periphBEnable) // \arg PERIPH B to enable +- +-{ +- pPio->PIO_ASR = periphAEnable; +- pPio->PIO_BSR = periphBEnable; +- pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgOutput +-//* \brief Enable PIO in output mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgOutput( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int pioEnable) // \arg PIO to be enabled +-{ +- pPio->PIO_PER = pioEnable; // Set in PIO mode +- pPio->PIO_OER = pioEnable; // Configure in Output +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgInput +-//* \brief Enable PIO in input mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgInput( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int inputEnable) // \arg PIO to be enabled +-{ +- // Disable output +- pPio->PIO_ODR = inputEnable; +- pPio->PIO_PER = inputEnable; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgOpendrain +-//* \brief Configure PIO in open drain +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgOpendrain( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int multiDrvEnable) // \arg pio to be configured in open drain +-{ +- // Configure the multi-drive option +- pPio->PIO_MDDR = ~multiDrvEnable; +- pPio->PIO_MDER = multiDrvEnable; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgPullup +-//* \brief Enable pullup on PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgPullup( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int pullupEnable) // \arg enable pullup on PIO +-{ +- // Connect or not Pullup +- pPio->PIO_PPUDR = ~pullupEnable; +- pPio->PIO_PPUER = pullupEnable; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgDirectDrive +-//* \brief Enable direct drive on PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgDirectDrive( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int directDrive) // \arg PIO to be configured with direct drive +- +-{ +- // Configure the Direct Drive +- pPio->PIO_OWDR = ~directDrive; +- pPio->PIO_OWER = directDrive; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgInputFilter +-//* \brief Enable input filter on input PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgInputFilter( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int inputFilter) // \arg PIO to be configured with input filter +- +-{ +- // Configure the Direct Drive +- pPio->PIO_IFDR = ~inputFilter; +- pPio->PIO_IFER = inputFilter; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetInput +-//* \brief Return PIO input value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetInput( // \return PIO input +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_PDSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsInputSet +-//* \brief Test if PIO is input flag is active +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsInputSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetInput(pPio) & flag); +-} +- +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_SetOutput +-//* \brief Set to 1 output PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_SetOutput( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg output to be set +-{ +- pPio->PIO_SODR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_ClearOutput +-//* \brief Set to 0 output PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_ClearOutput( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg output to be cleared +-{ +- pPio->PIO_CODR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_ForceOutput +-//* \brief Force output when Direct drive option is enabled +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_ForceOutput( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg output to be forced +-{ +- pPio->PIO_ODSR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_Enable +-//* \brief Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_Enable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio to be enabled +-{ +- pPio->PIO_PER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_Disable +-//* \brief Disable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_Disable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio to be disabled +-{ +- pPio->PIO_PDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetStatus +-//* \brief Return PIO Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_PSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsSet +-//* \brief Test if PIO is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_OutputEnable +-//* \brief Output Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_OutputEnable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio output to be enabled +-{ +- pPio->PIO_OER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_OutputDisable +-//* \brief Output Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_OutputDisable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio output to be disabled +-{ +- pPio->PIO_ODR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetOutputStatus +-//* \brief Return PIO Output Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_OSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsOuputSet +-//* \brief Test if PIO Output is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsOutputSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetOutputStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_InputFilterEnable +-//* \brief Input Filter Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_InputFilterEnable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio input filter to be enabled +-{ +- pPio->PIO_IFER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_InputFilterDisable +-//* \brief Input Filter Disable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_InputFilterDisable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio input filter to be disabled +-{ +- pPio->PIO_IFDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetInputFilterStatus +-//* \brief Return PIO Input Filter Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_IFSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsInputFilterSet +-//* \brief Test if PIO Input filter is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsInputFilterSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetOutputDataStatus +-//* \brief Return PIO Output Data Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_ODSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_InterruptEnable +-//* \brief Enable PIO Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_InterruptEnable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio interrupt to be enabled +-{ +- pPio->PIO_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_InterruptDisable +-//* \brief Disable PIO Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_InterruptDisable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio interrupt to be disabled +-{ +- pPio->PIO_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetInterruptMaskStatus +-//* \brief Return PIO Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetInterruptStatus +-//* \brief Return PIO Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_ISR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsInterruptMasked +-//* \brief Test if PIO Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsInterruptMasked( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsInterruptSet +-//* \brief Test if PIO Interrupt is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsInterruptSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetInterruptStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_MultiDriverEnable +-//* \brief Multi Driver Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_MultiDriverEnable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio to be enabled +-{ +- pPio->PIO_MDER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_MultiDriverDisable +-//* \brief Multi Driver Disable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_MultiDriverDisable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio to be disabled +-{ +- pPio->PIO_MDDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetMultiDriverStatus +-//* \brief Return PIO Multi Driver Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_MDSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsMultiDriverSet +-//* \brief Test if PIO MultiDriver is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsMultiDriverSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_A_RegisterSelection +-//* \brief PIO A Register Selection +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_A_RegisterSelection( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio A register selection +-{ +- pPio->PIO_ASR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_B_RegisterSelection +-//* \brief PIO B Register Selection +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_B_RegisterSelection( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio B register selection +-{ +- pPio->PIO_BSR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_Get_AB_RegisterStatus +-//* \brief Return PIO Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_ABSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsAB_RegisterSet +-//* \brief Test if PIO AB Register is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsAB_RegisterSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_OutputWriteEnable +-//* \brief Output Write Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_OutputWriteEnable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio output write to be enabled +-{ +- pPio->PIO_OWER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_OutputWriteDisable +-//* \brief Output Write Disable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_OutputWriteDisable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio output write to be disabled +-{ +- pPio->PIO_OWDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetOutputWriteStatus +-//* \brief Return PIO Output Write Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_OWSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsOutputWriteSet +-//* \brief Test if PIO OutputWrite is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsOutputWriteSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetCfgPullup +-//* \brief Return PIO Configuration Pullup +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_PPUSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsOutputDataStatusSet +-//* \brief Test if PIO Output Data Status is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsOutputDataStatusSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsCfgPullupStatusSet +-//* \brief Test if PIO Configuration Pullup Status is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsCfgPullupStatusSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (~AT91F_PIO_GetCfgPullup(pPio) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR PMC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_CfgSysClkEnableReg +-//* \brief Configure the System Clock Enable Register of the PMC controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_CfgSysClkEnableReg ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int mode) +-{ +- //* Write to the SCER register +- pPMC->PMC_SCER = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_CfgSysClkDisableReg +-//* \brief Configure the System Clock Disable Register of the PMC controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_CfgSysClkDisableReg ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int mode) +-{ +- //* Write to the SCDR register +- pPMC->PMC_SCDR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_GetSysClkStatusReg +-//* \brief Return the System Clock Status Register of the PMC controller +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_GetSysClkStatusReg ( +- AT91PS_PMC pPMC // pointer to a CAN controller +- ) +-{ +- return pPMC->PMC_SCSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_EnablePeriphClock +-//* \brief Enable peripheral clock +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_EnablePeriphClock ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int periphIds) // \arg IDs of peripherals to enable +-{ +- pPMC->PMC_PCER = periphIds; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_DisablePeriphClock +-//* \brief Disable peripheral clock +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_DisablePeriphClock ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int periphIds) // \arg IDs of peripherals to enable +-{ +- pPMC->PMC_PCDR = periphIds; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_GetPeriphClock +-//* \brief Get peripheral clock status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_GetPeriphClock ( +- AT91PS_PMC pPMC) // \arg pointer to PMC controller +-{ +- return pPMC->PMC_PCSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_CfgMainOscillatorReg +-//* \brief Cfg the main oscillator +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CKGR_CfgMainOscillatorReg ( +- AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +- unsigned int mode) +-{ +- pCKGR->CKGR_MOR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_GetMainOscillatorReg +-//* \brief Cfg the main oscillator +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( +- AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +-{ +- return pCKGR->CKGR_MOR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_EnableMainOscillator +-//* \brief Enable the main oscillator +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CKGR_EnableMainOscillator( +- AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +-{ +- pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_DisableMainOscillator +-//* \brief Disable the main oscillator +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CKGR_DisableMainOscillator ( +- AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +-{ +- pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_CfgMainOscStartUpTime +-//* \brief Cfg MOR Register according to the main osc startup time +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CKGR_CfgMainOscStartUpTime ( +- AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +- unsigned int startup_time, // \arg main osc startup time in microsecond (us) +- unsigned int slowClock) // \arg slowClock in Hz +-{ +- pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +- pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_GetMainClockFreqReg +-//* \brief Cfg the main oscillator +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +- AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +-{ +- return pCKGR->CKGR_MCFR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_GetMainClock +-//* \brief Return Main clock in Hz +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CKGR_GetMainClock ( +- AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +- unsigned int slowClock) // \arg slowClock in Hz +-{ +- return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_CfgMCKReg +-//* \brief Cfg Master Clock Register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_CfgMCKReg ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int mode) +-{ +- pPMC->PMC_MCKR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_GetMCKReg +-//* \brief Return Master Clock Register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_GetMCKReg( +- AT91PS_PMC pPMC) // \arg pointer to PMC controller +-{ +- return pPMC->PMC_MCKR; +-} +- +-//*------------------------------------------------------------------------------ +-//* \fn AT91F_PMC_GetMasterClock +-//* \brief Return master clock in Hz which correponds to processor clock for ARM7 +-//*------------------------------------------------------------------------------ +-__inline unsigned int AT91F_PMC_GetMasterClock ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +- unsigned int slowClock) // \arg slowClock in Hz +-{ +- unsigned int reg = pPMC->PMC_MCKR; +- unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); +- unsigned int pllDivider, pllMultiplier; +- +- switch (reg & AT91C_PMC_CSS) { +- case AT91C_PMC_CSS_SLOW_CLK: // Slow clock selected +- return slowClock / prescaler; +- case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected +- return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; +- case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected +- reg = pCKGR->CKGR_PLLR; +- pllDivider = (reg & AT91C_CKGR_DIV); +- pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; +- return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; +- } +- return 0; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_EnablePCK +-//* \brief Enable peripheral clock +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_EnablePCK ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int pck, // \arg Peripheral clock identifier 0 .. 7 +- unsigned int mode) +-{ +- pPMC->PMC_PCKR[pck] = mode; +- pPMC->PMC_SCER = (1 << pck) << 8; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_DisablePCK +-//* \brief Enable peripheral clock +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_DisablePCK ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int pck) // \arg Peripheral clock identifier 0 .. 7 +-{ +- pPMC->PMC_SCDR = (1 << pck) << 8; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_EnableIt +-//* \brief Enable PMC interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_EnableIt ( +- AT91PS_PMC pPMC, // pointer to a PMC controller +- unsigned int flag) // IT to be enabled +-{ +- //* Write to the IER register +- pPMC->PMC_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_DisableIt +-//* \brief Disable PMC interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_DisableIt ( +- AT91PS_PMC pPMC, // pointer to a PMC controller +- unsigned int flag) // IT to be disabled +-{ +- //* Write to the IDR register +- pPMC->PMC_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_GetStatus +-//* \brief Return PMC Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +- AT91PS_PMC pPMC) // pointer to a PMC controller +-{ +- return pPMC->PMC_SR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_GetInterruptMaskStatus +-//* \brief Return PMC Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +- AT91PS_PMC pPMC) // pointer to a PMC controller +-{ +- return pPMC->PMC_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_IsInterruptMasked +-//* \brief Test if PMC Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_IsInterruptMasked( +- AT91PS_PMC pPMC, // \arg pointer to a PMC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_IsStatusSet +-//* \brief Test if PMC Status is Set +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_IsStatusSet( +- AT91PS_PMC pPMC, // \arg pointer to a PMC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PMC_GetStatus(pPMC) & flag); +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_CKGR_CfgPLLReg +-// \brief Cfg the PLL Register +-// ---------------------------------------------------------------------------- +-__inline void AT91F_CKGR_CfgPLLReg ( +- AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +- unsigned int mode) +-{ +- pCKGR->CKGR_PLLR = mode; +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_CKGR_GetPLLReg +-// \brief Get the PLL Register +-// ---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CKGR_GetPLLReg ( +- AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +-{ +- return pCKGR->CKGR_PLLR; +-} +- +- +-/* ***************************************************************************** +- SOFTWARE API FOR RSTC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTSoftReset +-//* \brief Start Software Reset +-//*---------------------------------------------------------------------------- +-__inline void AT91F_RSTSoftReset( +- AT91PS_RSTC pRSTC, +- unsigned int reset) +-{ +- pRSTC->RSTC_RCR = (0xA5000000 | reset); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTSetMode +-//* \brief Set Reset Mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_RSTSetMode( +- AT91PS_RSTC pRSTC, +- unsigned int mode) +-{ +- pRSTC->RSTC_RMR = (0xA5000000 | mode); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTGetMode +-//* \brief Get Reset Mode +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_RSTGetMode( +- AT91PS_RSTC pRSTC) +-{ +- return (pRSTC->RSTC_RMR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTGetStatus +-//* \brief Get Reset Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_RSTGetStatus( +- AT91PS_RSTC pRSTC) +-{ +- return (pRSTC->RSTC_RSR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTIsSoftRstActive +-//* \brief Return !=0 if software reset is still not completed +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_RSTIsSoftRstActive( +- AT91PS_RSTC pRSTC) +-{ +- return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +-} +-/* ***************************************************************************** +- SOFTWARE API FOR RTTC +- ***************************************************************************** */ +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_SetRTT_TimeBase() +-//* \brief Set the RTT prescaler according to the TimeBase in ms +-//*-------------------------------------------------------------------------------------- +-__inline unsigned int AT91F_RTTSetTimeBase( +- AT91PS_RTTC pRTTC, +- unsigned int ms) +-{ +- if (ms > 2000) +- return 1; // AT91C_TIME_OUT_OF_RANGE +- pRTTC->RTTC_RTMR &= ~0xFFFF; +- pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +- return 0; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTTSetPrescaler() +-//* \brief Set the new prescaler value +-//*-------------------------------------------------------------------------------------- +-__inline unsigned int AT91F_RTTSetPrescaler( +- AT91PS_RTTC pRTTC, +- unsigned int rtpres) +-{ +- pRTTC->RTTC_RTMR &= ~0xFFFF; +- pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +- return (pRTTC->RTTC_RTMR); +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTTRestart() +-//* \brief Restart the RTT prescaler +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTRestart( +- AT91PS_RTTC pRTTC) +-{ +- pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +-} +- +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_SetAlarmINT() +-//* \brief Enable RTT Alarm Interrupt +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTSetAlarmINT( +- AT91PS_RTTC pRTTC) +-{ +- pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_ClearAlarmINT() +-//* \brief Disable RTT Alarm Interrupt +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTClearAlarmINT( +- AT91PS_RTTC pRTTC) +-{ +- pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_SetRttIncINT() +-//* \brief Enable RTT INC Interrupt +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTSetRttIncINT( +- AT91PS_RTTC pRTTC) +-{ +- pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_ClearRttIncINT() +-//* \brief Disable RTT INC Interrupt +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTClearRttIncINT( +- AT91PS_RTTC pRTTC) +-{ +- pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_SetAlarmValue() +-//* \brief Set RTT Alarm Value +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTSetAlarmValue( +- AT91PS_RTTC pRTTC, unsigned int alarm) +-{ +- pRTTC->RTTC_RTAR = alarm; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_GetAlarmValue() +-//* \brief Get RTT Alarm Value +-//*-------------------------------------------------------------------------------------- +-__inline unsigned int AT91F_RTTGetAlarmValue( +- AT91PS_RTTC pRTTC) +-{ +- return(pRTTC->RTTC_RTAR); +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTTGetStatus() +-//* \brief Read the RTT status +-//*-------------------------------------------------------------------------------------- +-__inline unsigned int AT91F_RTTGetStatus( +- AT91PS_RTTC pRTTC) +-{ +- return(pRTTC->RTTC_RTSR); +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_ReadValue() +-//* \brief Read the RTT value +-//*-------------------------------------------------------------------------------------- +-__inline unsigned int AT91F_RTTReadValue( +- AT91PS_RTTC pRTTC) +-{ +- register volatile unsigned int val1,val2; +- do +- { +- val1 = pRTTC->RTTC_RTVR; +- val2 = pRTTC->RTTC_RTVR; +- } +- while(val1 != val2); +- return(val1); +-} +-/* ***************************************************************************** +- SOFTWARE API FOR PITC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITInit +-//* \brief System timer init : period in second, system clock freq in MHz +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PITInit( +- AT91PS_PITC pPITC, +- unsigned int period, +- unsigned int pit_frequency) +-{ +- pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +- pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITSetPIV +-//* \brief Set the PIT Periodic Interval Value +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PITSetPIV( +- AT91PS_PITC pPITC, +- unsigned int piv) +-{ +- pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITEnableInt +-//* \brief Enable PIT periodic interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PITEnableInt( +- AT91PS_PITC pPITC) +-{ +- pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITDisableInt +-//* \brief Disable PIT periodic interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PITDisableInt( +- AT91PS_PITC pPITC) +-{ +- pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITGetMode +-//* \brief Read PIT mode register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PITGetMode( +- AT91PS_PITC pPITC) +-{ +- return(pPITC->PITC_PIMR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITGetStatus +-//* \brief Read PIT status register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PITGetStatus( +- AT91PS_PITC pPITC) +-{ +- return(pPITC->PITC_PISR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITGetPIIR +-//* \brief Read PIT CPIV and PICNT without ressetting the counters +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PITGetPIIR( +- AT91PS_PITC pPITC) +-{ +- return(pPITC->PITC_PIIR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITGetPIVR +-//* \brief Read System timer CPIV and PICNT without ressetting the counters +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PITGetPIVR( +- AT91PS_PITC pPITC) +-{ +- return(pPITC->PITC_PIVR); +-} +-/* ***************************************************************************** +- SOFTWARE API FOR WDTC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_WDTSetMode +-//* \brief Set Watchdog Mode Register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_WDTSetMode( +- AT91PS_WDTC pWDTC, +- unsigned int Mode) +-{ +- pWDTC->WDTC_WDMR = Mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_WDTRestart +-//* \brief Restart Watchdog +-//*---------------------------------------------------------------------------- +-__inline void AT91F_WDTRestart( +- AT91PS_WDTC pWDTC) +-{ +- pWDTC->WDTC_WDCR = 0xA5000001; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_WDTSGettatus +-//* \brief Get Watchdog Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_WDTSGettatus( +- AT91PS_WDTC pWDTC) +-{ +- return(pWDTC->WDTC_WDSR & 0x3); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_WDTGetPeriod +-//* \brief Translate ms into Watchdog Compatible value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +-{ +- if ((ms < 4) || (ms > 16000)) +- return 0; +- return((ms << 8) / 1000); +-} +-/* ***************************************************************************** +- SOFTWARE API FOR VREG +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_VREG_Enable_LowPowerMode +-//* \brief Enable VREG Low Power Mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_VREG_Enable_LowPowerMode( +- AT91PS_VREG pVREG) +-{ +- pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_VREG_Disable_LowPowerMode +-//* \brief Disable VREG Low Power Mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_VREG_Disable_LowPowerMode( +- AT91PS_VREG pVREG) +-{ +- pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +-}/* ***************************************************************************** +- SOFTWARE API FOR MC +- ***************************************************************************** */ +- +-#define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_Remap +-//* \brief Make Remap +-//*---------------------------------------------------------------------------- +-__inline void AT91F_MC_Remap (void) // +-{ +- AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; +- +- pMC->MC_RCR = AT91C_MC_RCB; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_CfgModeReg +-//* \brief Configure the EFC Mode Register of the MC controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_MC_EFC_CfgModeReg ( +- AT91PS_MC pMC, // pointer to a MC controller +- unsigned int mode) // mode register +-{ +- // Write to the FMR register +- pMC->MC_FMR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_GetModeReg +-//* \brief Return MC EFC Mode Regsiter +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_MC_EFC_GetModeReg( +- AT91PS_MC pMC) // pointer to a MC controller +-{ +- return pMC->MC_FMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_ComputeFMCN +-//* \brief Return MC EFC Mode Regsiter +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_MC_EFC_ComputeFMCN( +- int master_clock) // master clock in Hz +-{ +- return (master_clock/1000000 +2); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_PerformCmd +-//* \brief Perform EFC Command +-//*---------------------------------------------------------------------------- +-__inline void AT91F_MC_EFC_PerformCmd ( +- AT91PS_MC pMC, // pointer to a MC controller +- unsigned int transfer_cmd) +-{ +- pMC->MC_FCR = transfer_cmd; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_GetStatus +-//* \brief Return MC EFC Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_MC_EFC_GetStatus( +- AT91PS_MC pMC) // pointer to a MC controller +-{ +- return pMC->MC_FSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_IsInterruptMasked +-//* \brief Test if EFC MC Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_MC_EFC_IsInterruptMasked( +- AT91PS_MC pMC, // \arg pointer to a MC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_MC_EFC_GetModeReg(pMC) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_IsInterruptSet +-//* \brief Test if EFC MC Interrupt is Set +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_MC_EFC_IsInterruptSet( +- AT91PS_MC pMC, // \arg pointer to a MC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_MC_EFC_GetStatus(pMC) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR SPI +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_CfgCs +-//* \brief Configure SPI chip select register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_CfgCs ( +- AT91PS_SPI pSPI, // pointer to a SPI controller +- int cs, // SPI cs number (0 to 3) +- int val) // chip select register +-{ +- //* Write to the CSR register +- *(pSPI->SPI_CSR + cs) = val; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_EnableIt +-//* \brief Enable SPI interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_EnableIt ( +- AT91PS_SPI pSPI, // pointer to a SPI controller +- unsigned int flag) // IT to be enabled +-{ +- //* Write to the IER register +- pSPI->SPI_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_DisableIt +-//* \brief Disable SPI interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_DisableIt ( +- AT91PS_SPI pSPI, // pointer to a SPI controller +- unsigned int flag) // IT to be disabled +-{ +- //* Write to the IDR register +- pSPI->SPI_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_Reset +-//* \brief Reset the SPI controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_Reset ( +- AT91PS_SPI pSPI // pointer to a SPI controller +- ) +-{ +- //* Write to the CR register +- pSPI->SPI_CR = AT91C_SPI_SWRST; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_Enable +-//* \brief Enable the SPI controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_Enable ( +- AT91PS_SPI pSPI // pointer to a SPI controller +- ) +-{ +- //* Write to the CR register +- pSPI->SPI_CR = AT91C_SPI_SPIEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_Disable +-//* \brief Disable the SPI controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_Disable ( +- AT91PS_SPI pSPI // pointer to a SPI controller +- ) +-{ +- //* Write to the CR register +- pSPI->SPI_CR = AT91C_SPI_SPIDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_CfgMode +-//* \brief Enable the SPI controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_CfgMode ( +- AT91PS_SPI pSPI, // pointer to a SPI controller +- int mode) // mode register +-{ +- //* Write to the MR register +- pSPI->SPI_MR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_CfgPCS +-//* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_CfgPCS ( +- AT91PS_SPI pSPI, // pointer to a SPI controller +- char PCS_Device) // PCS of the Device +-{ +- //* Write to the MR register +- pSPI->SPI_MR &= 0xFFF0FFFF; +- pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_ReceiveFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SPI_ReceiveFrame ( +- AT91PS_SPI pSPI, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_ReceiveFrame( +- (AT91PS_PDC) &(pSPI->SPI_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_SendFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is bSPIy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SPI_SendFrame( +- AT91PS_SPI pSPI, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_SendFrame( +- (AT91PS_PDC) &(pSPI->SPI_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_Close +-//* \brief Close SPI: disable IT disable transfert, close PDC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_Close ( +- AT91PS_SPI pSPI) // \arg pointer to a SPI controller +-{ +- //* Reset all the Chip Select register +- pSPI->SPI_CSR[0] = 0 ; +- pSPI->SPI_CSR[1] = 0 ; +- pSPI->SPI_CSR[2] = 0 ; +- pSPI->SPI_CSR[3] = 0 ; +- +- //* Reset the SPI mode +- pSPI->SPI_MR = 0 ; +- +- //* Disable all interrupts +- pSPI->SPI_IDR = 0xFFFFFFFF ; +- +- //* Abort the Peripheral Data Transfers +- AT91F_PDC_Close((AT91PS_PDC) &(pSPI->SPI_RPR)); +- +- //* Disable receiver and transmitter and stop any activity immediately +- pSPI->SPI_CR = AT91C_SPI_SPIDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_PutChar +-//* \brief Send a character,does not check if ready to send +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_PutChar ( +- AT91PS_SPI pSPI, +- unsigned int character, +- unsigned int cs_number ) +-{ +- unsigned int value_for_cs; +- value_for_cs = (~(1 << cs_number)) & 0xF; //Place a zero among a 4 ONEs number +- pSPI->SPI_TDR = (character & 0xFFFF) | (value_for_cs << 16); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_GetChar +-//* \brief Receive a character,does not check if a character is available +-//*---------------------------------------------------------------------------- +-__inline int AT91F_SPI_GetChar ( +- const AT91PS_SPI pSPI) +-{ +- return((pSPI->SPI_RDR) & 0xFFFF); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_GetInterruptMaskStatus +-//* \brief Return SPI Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Interrupt Mask Status +- AT91PS_SPI pSpi) // \arg pointer to a SPI controller +-{ +- return pSpi->SPI_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_IsInterruptMasked +-//* \brief Test if SPI Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_SPI_IsInterruptMasked( +- AT91PS_SPI pSpi, // \arg pointer to a SPI controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_SPI_GetInterruptMaskStatus(pSpi) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR USART +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_Baudrate +-//* \brief Calculate the baudrate +-//* Standard Asynchronous Mode : 8 bits , 1 stop , no parity +-#define AT91C_US_ASYNC_MODE ( AT91C_US_USMODE_NORMAL + \ +- AT91C_US_NBSTOP_1_BIT + \ +- AT91C_US_PAR_NONE + \ +- AT91C_US_CHRL_8_BITS + \ +- AT91C_US_CLKS_CLOCK ) +- +-//* Standard External Asynchronous Mode : 8 bits , 1 stop , no parity +-#define AT91C_US_ASYNC_SCK_MODE ( AT91C_US_USMODE_NORMAL + \ +- AT91C_US_NBSTOP_1_BIT + \ +- AT91C_US_PAR_NONE + \ +- AT91C_US_CHRL_8_BITS + \ +- AT91C_US_CLKS_EXT ) +- +-//* Standard Synchronous Mode : 8 bits , 1 stop , no parity +-#define AT91C_US_SYNC_MODE ( AT91C_US_SYNC + \ +- AT91C_US_USMODE_NORMAL + \ +- AT91C_US_NBSTOP_1_BIT + \ +- AT91C_US_PAR_NONE + \ +- AT91C_US_CHRL_8_BITS + \ +- AT91C_US_CLKS_CLOCK ) +- +-//* SCK used Label +-#define AT91C_US_SCK_USED (AT91C_US_CKLO | AT91C_US_CLKS_EXT) +- +-//* Standard ISO T=0 Mode : 8 bits , 1 stop , parity +-#define AT91C_US_ISO_READER_MODE ( AT91C_US_USMODE_ISO7816_0 + \ +- AT91C_US_CLKS_CLOCK +\ +- AT91C_US_NBSTOP_1_BIT + \ +- AT91C_US_PAR_EVEN + \ +- AT91C_US_CHRL_8_BITS + \ +- AT91C_US_CKLO +\ +- AT91C_US_OVER) +- +-//* Standard IRDA mode +-#define AT91C_US_ASYNC_IRDA_MODE ( AT91C_US_USMODE_IRDA + \ +- AT91C_US_NBSTOP_1_BIT + \ +- AT91C_US_PAR_NONE + \ +- AT91C_US_CHRL_8_BITS + \ +- AT91C_US_CLKS_CLOCK ) +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_Baudrate +-//* \brief Caluculate baud_value according to the main clock and the baud rate +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_Baudrate ( +- const unsigned int main_clock, // \arg peripheral clock +- const unsigned int baud_rate) // \arg UART baudrate +-{ +- unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); +- if ((baud_value % 10) >= 5) +- baud_value = (baud_value / 10) + 1; +- else +- baud_value /= 10; +- return baud_value; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_SetBaudrate +-//* \brief Set the baudrate according to the CPU clock +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_SetBaudrate ( +- AT91PS_USART pUSART, // \arg pointer to a USART controller +- unsigned int mainClock, // \arg peripheral clock +- unsigned int speed) // \arg UART baudrate +-{ +- //* Define the baud rate divisor register +- pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_SetTimeguard +-//* \brief Set USART timeguard +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_SetTimeguard ( +- AT91PS_USART pUSART, // \arg pointer to a USART controller +- unsigned int timeguard) // \arg timeguard value +-{ +- //* Write the Timeguard Register +- pUSART->US_TTGR = timeguard ; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_EnableIt +-//* \brief Enable USART IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_EnableIt ( +- AT91PS_USART pUSART, // \arg pointer to a USART controller +- unsigned int flag) // \arg IT to be enabled +-{ +- //* Write to the IER register +- pUSART->US_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_DisableIt +-//* \brief Disable USART IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_DisableIt ( +- AT91PS_USART pUSART, // \arg pointer to a USART controller +- unsigned int flag) // \arg IT to be disabled +-{ +- //* Write to the IER register +- pUSART->US_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_Configure +-//* \brief Configure USART +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_Configure ( +- AT91PS_USART pUSART, // \arg pointer to a USART controller +- unsigned int mainClock, // \arg peripheral clock +- unsigned int mode , // \arg mode Register to be programmed +- unsigned int baudRate , // \arg baudrate to be programmed +- unsigned int timeguard ) // \arg timeguard to be programmed +-{ +- //* Disable interrupts +- pUSART->US_IDR = (unsigned int) -1; +- +- //* Reset receiver and transmitter +- pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS ; +- +- //* Define the baud rate divisor register +- AT91F_US_SetBaudrate(pUSART, mainClock, baudRate); +- +- //* Write the Timeguard Register +- AT91F_US_SetTimeguard(pUSART, timeguard); +- +- //* Clear Transmit and Receive Counters +- AT91F_PDC_Open((AT91PS_PDC) &(pUSART->US_RPR)); +- +- //* Define the USART mode +- pUSART->US_MR = mode ; +- +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_EnableRx +-//* \brief Enable receiving characters +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_EnableRx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Enable receiver +- pUSART->US_CR = AT91C_US_RXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_EnableTx +-//* \brief Enable sending characters +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_EnableTx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Enable transmitter +- pUSART->US_CR = AT91C_US_TXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_ResetRx +-//* \brief Reset Receiver and re-enable it +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_ResetRx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Reset receiver +- pUSART->US_CR = AT91C_US_RSTRX; +- //* Re-Enable receiver +- pUSART->US_CR = AT91C_US_RXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_ResetTx +-//* \brief Reset Transmitter and re-enable it +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_ResetTx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Reset transmitter +- pUSART->US_CR = AT91C_US_RSTTX; +- //* Enable transmitter +- pUSART->US_CR = AT91C_US_TXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_DisableRx +-//* \brief Disable Receiver +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_DisableRx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Disable receiver +- pUSART->US_CR = AT91C_US_RXDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_DisableTx +-//* \brief Disable Transmitter +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_DisableTx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Disable transmitter +- pUSART->US_CR = AT91C_US_TXDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_Close +-//* \brief Close USART: disable IT disable receiver and transmitter, close PDC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_Close ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Reset the baud rate divisor register +- pUSART->US_BRGR = 0 ; +- +- //* Reset the USART mode +- pUSART->US_MR = 0 ; +- +- //* Reset the Timeguard Register +- pUSART->US_TTGR = 0; +- +- //* Disable all interrupts +- pUSART->US_IDR = 0xFFFFFFFF ; +- +- //* Abort the Peripheral Data Transfers +- AT91F_PDC_Close((AT91PS_PDC) &(pUSART->US_RPR)); +- +- //* Disable receiver and transmitter and stop any activity immediately +- pUSART->US_CR = AT91C_US_TXDIS | AT91C_US_RXDIS | AT91C_US_RSTTX | AT91C_US_RSTRX ; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_TxReady +-//* \brief Return 1 if a character can be written in US_THR +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_TxReady ( +- AT91PS_USART pUSART ) // \arg pointer to a USART controller +-{ +- return (pUSART->US_CSR & AT91C_US_TXRDY); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_RxReady +-//* \brief Return 1 if a character can be read in US_RHR +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_RxReady ( +- AT91PS_USART pUSART ) // \arg pointer to a USART controller +-{ +- return (pUSART->US_CSR & AT91C_US_RXRDY); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_Error +-//* \brief Return the error flag +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_Error ( +- AT91PS_USART pUSART ) // \arg pointer to a USART controller +-{ +- return (pUSART->US_CSR & +- (AT91C_US_OVRE | // Overrun error +- AT91C_US_FRAME | // Framing error +- AT91C_US_PARE)); // Parity error +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_PutChar +-//* \brief Send a character,does not check if ready to send +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_PutChar ( +- AT91PS_USART pUSART, +- int character ) +-{ +- pUSART->US_THR = (character & 0x1FF); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_GetChar +-//* \brief Receive a character,does not check if a character is available +-//*---------------------------------------------------------------------------- +-__inline int AT91F_US_GetChar ( +- const AT91PS_USART pUSART) +-{ +- return((pUSART->US_RHR) & 0x1FF); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_SendFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_SendFrame( +- AT91PS_USART pUSART, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_SendFrame( +- (AT91PS_PDC) &(pUSART->US_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_ReceiveFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_ReceiveFrame ( +- AT91PS_USART pUSART, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_ReceiveFrame( +- (AT91PS_PDC) &(pUSART->US_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_SetIrdaFilter +-//* \brief Set the value of IrDa filter tregister +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_SetIrdaFilter ( +- AT91PS_USART pUSART, +- unsigned char value +-) +-{ +- pUSART->US_IF = value; +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR SSC +- ***************************************************************************** */ +-//* Define the standard I2S mode configuration +- +-//* Configuration to set in the SSC Transmit Clock Mode Register +-//* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +-//* nb_slot_by_frame : number of channels +-#define AT91C_I2S_ASY_MASTER_TX_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +- AT91C_SSC_CKS_DIV +\ +- AT91C_SSC_CKO_CONTINOUS +\ +- AT91C_SSC_CKG_NONE +\ +- AT91C_SSC_START_FALL_RF +\ +- AT91C_SSC_STTOUT +\ +- ((1<<16) & AT91C_SSC_STTDLY) +\ +- ((((nb_bit_by_slot*nb_slot_by_frame)/2)-1) <<24)) +- +- +-//* Configuration to set in the SSC Transmit Frame Mode Register +-//* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +-//* nb_slot_by_frame : number of channels +-#define AT91C_I2S_ASY_TX_FRAME_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +- (nb_bit_by_slot-1) +\ +- AT91C_SSC_MSBF +\ +- (((nb_slot_by_frame-1)<<8) & AT91C_SSC_DATNB) +\ +- (((nb_bit_by_slot-1)<<16) & AT91C_SSC_FSLEN) +\ +- AT91C_SSC_FSOS_NEGATIVE) +- +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_SetBaudrate +-//* \brief Set the baudrate according to the CPU clock +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_SetBaudrate ( +- AT91PS_SSC pSSC, // \arg pointer to a SSC controller +- unsigned int mainClock, // \arg peripheral clock +- unsigned int speed) // \arg SSC baudrate +-{ +- unsigned int baud_value; +- //* Define the baud rate divisor register +- if (speed == 0) +- baud_value = 0; +- else +- { +- baud_value = (unsigned int) (mainClock * 10)/(2*speed); +- if ((baud_value % 10) >= 5) +- baud_value = (baud_value / 10) + 1; +- else +- baud_value /= 10; +- } +- +- pSSC->SSC_CMR = baud_value; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_Configure +-//* \brief Configure SSC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_Configure ( +- AT91PS_SSC pSSC, // \arg pointer to a SSC controller +- unsigned int syst_clock, // \arg System Clock Frequency +- unsigned int baud_rate, // \arg Expected Baud Rate Frequency +- unsigned int clock_rx, // \arg Receiver Clock Parameters +- unsigned int mode_rx, // \arg mode Register to be programmed +- unsigned int clock_tx, // \arg Transmitter Clock Parameters +- unsigned int mode_tx) // \arg mode Register to be programmed +-{ +- //* Disable interrupts +- pSSC->SSC_IDR = (unsigned int) -1; +- +- //* Reset receiver and transmitter +- pSSC->SSC_CR = AT91C_SSC_SWRST | AT91C_SSC_RXDIS | AT91C_SSC_TXDIS ; +- +- //* Define the Clock Mode Register +- AT91F_SSC_SetBaudrate(pSSC, syst_clock, baud_rate); +- +- //* Write the Receive Clock Mode Register +- pSSC->SSC_RCMR = clock_rx; +- +- //* Write the Transmit Clock Mode Register +- pSSC->SSC_TCMR = clock_tx; +- +- //* Write the Receive Frame Mode Register +- pSSC->SSC_RFMR = mode_rx; +- +- //* Write the Transmit Frame Mode Register +- pSSC->SSC_TFMR = mode_tx; +- +- //* Clear Transmit and Receive Counters +- AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); +- +- +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_EnableRx +-//* \brief Enable receiving datas +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_EnableRx ( +- AT91PS_SSC pSSC) // \arg pointer to a SSC controller +-{ +- //* Enable receiver +- pSSC->SSC_CR = AT91C_SSC_RXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_DisableRx +-//* \brief Disable receiving datas +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_DisableRx ( +- AT91PS_SSC pSSC) // \arg pointer to a SSC controller +-{ +- //* Disable receiver +- pSSC->SSC_CR = AT91C_SSC_RXDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_EnableTx +-//* \brief Enable sending datas +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_EnableTx ( +- AT91PS_SSC pSSC) // \arg pointer to a SSC controller +-{ +- //* Enable transmitter +- pSSC->SSC_CR = AT91C_SSC_TXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_DisableTx +-//* \brief Disable sending datas +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_DisableTx ( +- AT91PS_SSC pSSC) // \arg pointer to a SSC controller +-{ +- //* Disable transmitter +- pSSC->SSC_CR = AT91C_SSC_TXDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_EnableIt +-//* \brief Enable SSC IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_EnableIt ( +- AT91PS_SSC pSSC, // \arg pointer to a SSC controller +- unsigned int flag) // \arg IT to be enabled +-{ +- //* Write to the IER register +- pSSC->SSC_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_DisableIt +-//* \brief Disable SSC IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_DisableIt ( +- AT91PS_SSC pSSC, // \arg pointer to a SSC controller +- unsigned int flag) // \arg IT to be disabled +-{ +- //* Write to the IDR register +- pSSC->SSC_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_ReceiveFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initialized with Next Buffer, 0 if PDC is busy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SSC_ReceiveFrame ( +- AT91PS_SSC pSSC, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_ReceiveFrame( +- (AT91PS_PDC) &(pSSC->SSC_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_SendFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initialized with Next Buffer, 0 if PDC is busy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SSC_SendFrame( +- AT91PS_SSC pSSC, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_SendFrame( +- (AT91PS_PDC) &(pSSC->SSC_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_GetInterruptMaskStatus +-//* \brief Return SSC Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Interrupt Mask Status +- AT91PS_SSC pSsc) // \arg pointer to a SSC controller +-{ +- return pSsc->SSC_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_IsInterruptMasked +-//* \brief Test if SSC Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_SSC_IsInterruptMasked( +- AT91PS_SSC pSsc, // \arg pointer to a SSC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_SSC_GetInterruptMaskStatus(pSsc) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR TWI +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_EnableIt +-//* \brief Enable TWI IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TWI_EnableIt ( +- AT91PS_TWI pTWI, // \arg pointer to a TWI controller +- unsigned int flag) // \arg IT to be enabled +-{ +- //* Write to the IER register +- pTWI->TWI_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_DisableIt +-//* \brief Disable TWI IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TWI_DisableIt ( +- AT91PS_TWI pTWI, // \arg pointer to a TWI controller +- unsigned int flag) // \arg IT to be disabled +-{ +- //* Write to the IDR register +- pTWI->TWI_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_Configure +-//* \brief Configure TWI in master mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TWI_Configure ( AT91PS_TWI pTWI ) // \arg pointer to a TWI controller +-{ +- //* Disable interrupts +- pTWI->TWI_IDR = (unsigned int) -1; +- +- //* Reset peripheral +- pTWI->TWI_CR = AT91C_TWI_SWRST; +- +- //* Set Master mode +- pTWI->TWI_CR = AT91C_TWI_MSEN; +- +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_GetInterruptMaskStatus +-//* \brief Return TWI Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_TWI_GetInterruptMaskStatus( // \return TWI Interrupt Mask Status +- AT91PS_TWI pTwi) // \arg pointer to a TWI controller +-{ +- return pTwi->TWI_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_IsInterruptMasked +-//* \brief Test if TWI Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_TWI_IsInterruptMasked( +- AT91PS_TWI pTwi, // \arg pointer to a TWI controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_TWI_GetInterruptMaskStatus(pTwi) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR PWMC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_GetStatus +-//* \brief Return PWM Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PWMC_GetStatus( // \return PWM Interrupt Status +- AT91PS_PWMC pPWM) // pointer to a PWM controller +-{ +- return pPWM->PWMC_SR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_InterruptEnable +-//* \brief Enable PWM Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_InterruptEnable( +- AT91PS_PWMC pPwm, // \arg pointer to a PWM controller +- unsigned int flag) // \arg PWM interrupt to be enabled +-{ +- pPwm->PWMC_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_InterruptDisable +-//* \brief Disable PWM Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_InterruptDisable( +- AT91PS_PWMC pPwm, // \arg pointer to a PWM controller +- unsigned int flag) // \arg PWM interrupt to be disabled +-{ +- pPwm->PWMC_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_GetInterruptMaskStatus +-//* \brief Return PWM Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PWMC_GetInterruptMaskStatus( // \return PWM Interrupt Mask Status +- AT91PS_PWMC pPwm) // \arg pointer to a PWM controller +-{ +- return pPwm->PWMC_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_IsInterruptMasked +-//* \brief Test if PWM Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PWMC_IsInterruptMasked( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PWMC_GetInterruptMaskStatus(pPWM) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_IsStatusSet +-//* \brief Test if PWM Interrupt is Set +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PWMC_IsStatusSet( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PWMC_GetStatus(pPWM) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_CfgChannel +-//* \brief Test if PWM Interrupt is Set +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CfgChannel( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int channelId, // \arg PWM channel ID +- unsigned int mode, // \arg PWM mode +- unsigned int period, // \arg PWM period +- unsigned int duty) // \arg PWM duty cycle +-{ +- pPWM->PWMC_CH[channelId].PWMC_CMR = mode; +- pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; +- pPWM->PWMC_CH[channelId].PWMC_CPRDR = period; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_StartChannel +-//* \brief Enable channel +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_StartChannel( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int flag) // \arg Channels IDs to be enabled +-{ +- pPWM->PWMC_ENA = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_StopChannel +-//* \brief Disable channel +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_StopChannel( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int flag) // \arg Channels IDs to be enabled +-{ +- pPWM->PWMC_DIS = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_UpdateChannel +-//* \brief Update Period or Duty Cycle +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_UpdateChannel( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int channelId, // \arg PWM channel ID +- unsigned int update) // \arg Channels IDs to be enabled +-{ +- pPWM->PWMC_CH[channelId].PWMC_CUPDR = update; +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR UDP +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EnableIt +-//* \brief Enable UDP IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EnableIt ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned int flag) // \arg IT to be enabled +-{ +- //* Write to the IER register +- pUDP->UDP_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_DisableIt +-//* \brief Disable UDP IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_DisableIt ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned int flag) // \arg IT to be disabled +-{ +- //* Write to the IDR register +- pUDP->UDP_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_SetAddress +-//* \brief Set UDP functional address +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_SetAddress ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char address) // \arg new UDP address +-{ +- pUDP->UDP_FADDR = (AT91C_UDP_FEN | address); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EnableEp +-//* \brief Enable Endpoint +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EnableEp ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- pUDP->UDP_CSR[endpoint] |= AT91C_UDP_EPEDS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_DisableEp +-//* \brief Enable Endpoint +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_DisableEp ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- pUDP->UDP_CSR[endpoint] &= ~AT91C_UDP_EPEDS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_SetState +-//* \brief Set UDP Device state +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_SetState ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned int flag) // \arg new UDP address +-{ +- pUDP->UDP_GLBSTATE &= ~(AT91C_UDP_FADDEN | AT91C_UDP_CONFG); +- pUDP->UDP_GLBSTATE |= flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_GetState +-//* \brief return UDP Device state +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_UDP_GetState ( // \return the UDP device state +- AT91PS_UDP pUDP) // \arg pointer to a UDP controller +-{ +- return (pUDP->UDP_GLBSTATE & (AT91C_UDP_FADDEN | AT91C_UDP_CONFG)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_ResetEp +-//* \brief Reset UDP endpoint +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_ResetEp ( // \return the UDP device state +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned int flag) // \arg Endpoints to be reset +-{ +- pUDP->UDP_RSTEP = flag; +- pUDP->UDP_RSTEP = 0; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpStall +-//* \brief Endpoint will STALL requests +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EpStall( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- pUDP->UDP_CSR[endpoint] |= AT91C_UDP_FORCESTALL; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpWrite +-//* \brief Write value in the DPR +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EpWrite( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint, // \arg endpoint number +- unsigned char value) // \arg value to be written in the DPR +-{ +- pUDP->UDP_FDR[endpoint] = value; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpRead +-//* \brief Return value from the DPR +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_UDP_EpRead( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- return pUDP->UDP_FDR[endpoint]; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpEndOfWr +-//* \brief Notify the UDP that values in DPR are ready to be sent +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EpEndOfWr( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- pUDP->UDP_CSR[endpoint] |= AT91C_UDP_TXPKTRDY; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpClear +-//* \brief Clear flag in the endpoint CSR register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EpClear( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint, // \arg endpoint number +- unsigned int flag) // \arg flag to be cleared +-{ +- pUDP->UDP_CSR[endpoint] &= ~(flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpSet +-//* \brief Set flag in the endpoint CSR register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EpSet( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint, // \arg endpoint number +- unsigned int flag) // \arg flag to be cleared +-{ +- pUDP->UDP_CSR[endpoint] |= flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpStatus +-//* \brief Return the endpoint CSR register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_UDP_EpStatus( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- return pUDP->UDP_CSR[endpoint]; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_GetInterruptMaskStatus +-//* \brief Return UDP Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_UDP_GetInterruptMaskStatus( +- AT91PS_UDP pUdp) // \arg pointer to a UDP controller +-{ +- return pUdp->UDP_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_IsInterruptMasked +-//* \brief Test if UDP Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_UDP_IsInterruptMasked( +- AT91PS_UDP pUdp, // \arg pointer to a UDP controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_UDP_GetInterruptMaskStatus(pUdp) & flag); +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_UDP_InterruptStatusRegister +-// \brief Return the Interrupt Status Register +-// ---------------------------------------------------------------------------- +-__inline unsigned int AT91F_UDP_InterruptStatusRegister( +- AT91PS_UDP pUDP ) // \arg pointer to a UDP controller +-{ +- return pUDP->UDP_ISR; +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_UDP_InterruptClearRegister +-// \brief Clear Interrupt Register +-// ---------------------------------------------------------------------------- +-__inline void AT91F_UDP_InterruptClearRegister ( +- AT91PS_UDP pUDP, // \arg pointer to UDP controller +- unsigned int flag) // \arg IT to be cleat +-{ +- pUDP->UDP_ICR = flag; +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_UDP_EnableTransceiver +-// \brief Enable transceiver +-// ---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EnableTransceiver( +- AT91PS_UDP pUDP ) // \arg pointer to a UDP controller +-{ +- pUDP->UDP_TXVC &= ~AT91C_UDP_TXVDIS; +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_UDP_DisableTransceiver +-// \brief Disable transceiver +-// ---------------------------------------------------------------------------- +-__inline void AT91F_UDP_DisableTransceiver( +- AT91PS_UDP pUDP ) // \arg pointer to a UDP controller +-{ +- pUDP->UDP_TXVC = AT91C_UDP_TXVDIS; +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR TC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC_InterruptEnable +-//* \brief Enable TC Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC_InterruptEnable( +- AT91PS_TC pTc, // \arg pointer to a TC controller +- unsigned int flag) // \arg TC interrupt to be enabled +-{ +- pTc->TC_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC_InterruptDisable +-//* \brief Disable TC Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC_InterruptDisable( +- AT91PS_TC pTc, // \arg pointer to a TC controller +- unsigned int flag) // \arg TC interrupt to be disabled +-{ +- pTc->TC_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC_GetInterruptMaskStatus +-//* \brief Return TC Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_TC_GetInterruptMaskStatus( // \return TC Interrupt Mask Status +- AT91PS_TC pTc) // \arg pointer to a TC controller +-{ +- return pTc->TC_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC_IsInterruptMasked +-//* \brief Test if TC Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_TC_IsInterruptMasked( +- AT91PS_TC pTc, // \arg pointer to a TC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_TC_GetInterruptMaskStatus(pTc) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR CAN +- ***************************************************************************** */ +-#define STANDARD_FORMAT 0 +-#define EXTENDED_FORMAT 1 +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_InitMailboxRegisters() +-//* \brief Configure the corresponding mailbox +-//*---------------------------------------------------------------------------- +-__inline void AT91F_InitMailboxRegisters(AT91PS_CAN_MB CAN_Mailbox, +- int mode_reg, +- int acceptance_mask_reg, +- int id_reg, +- int data_low_reg, +- int data_high_reg, +- int control_reg) +-{ +- CAN_Mailbox->CAN_MB_MCR = 0x0; +- CAN_Mailbox->CAN_MB_MMR = mode_reg; +- CAN_Mailbox->CAN_MB_MAM = acceptance_mask_reg; +- CAN_Mailbox->CAN_MB_MID = id_reg; +- CAN_Mailbox->CAN_MB_MDL = data_low_reg; +- CAN_Mailbox->CAN_MB_MDH = data_high_reg; +- CAN_Mailbox->CAN_MB_MCR = control_reg; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_EnableCAN() +-//* \brief +-//*---------------------------------------------------------------------------- +-__inline void AT91F_EnableCAN( +- AT91PS_CAN pCAN) // pointer to a CAN controller +-{ +- pCAN->CAN_MR |= AT91C_CAN_CANEN; +- +- // Wait for WAKEUP flag raising <=> 11-recessive-bit were scanned by the transceiver +- while( (pCAN->CAN_SR & AT91C_CAN_WAKEUP) != AT91C_CAN_WAKEUP ); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DisableCAN() +-//* \brief +-//*---------------------------------------------------------------------------- +-__inline void AT91F_DisableCAN( +- AT91PS_CAN pCAN) // pointer to a CAN controller +-{ +- pCAN->CAN_MR &= ~AT91C_CAN_CANEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_EnableIt +-//* \brief Enable CAN interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_EnableIt ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int flag) // IT to be enabled +-{ +- //* Write to the IER register +- pCAN->CAN_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_DisableIt +-//* \brief Disable CAN interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_DisableIt ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int flag) // IT to be disabled +-{ +- //* Write to the IDR register +- pCAN->CAN_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetStatus +-//* \brief Return CAN Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetStatus( // \return CAN Interrupt Status +- AT91PS_CAN pCAN) // pointer to a CAN controller +-{ +- return pCAN->CAN_SR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetInterruptMaskStatus +-//* \brief Return CAN Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetInterruptMaskStatus( // \return CAN Interrupt Mask Status +- AT91PS_CAN pCAN) // pointer to a CAN controller +-{ +- return pCAN->CAN_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_IsInterruptMasked +-//* \brief Test if CAN Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_IsInterruptMasked( +- AT91PS_CAN pCAN, // \arg pointer to a CAN controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_CAN_GetInterruptMaskStatus(pCAN) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_IsStatusSet +-//* \brief Test if CAN Interrupt is Set +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_IsStatusSet( +- AT91PS_CAN pCAN, // \arg pointer to a CAN controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_CAN_GetStatus(pCAN) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgModeReg +-//* \brief Configure the Mode Register of the CAN controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgModeReg ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int mode) // mode register +-{ +- //* Write to the MR register +- pCAN->CAN_MR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetModeReg +-//* \brief Return the Mode Register of the CAN controller value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetModeReg ( +- AT91PS_CAN pCAN // pointer to a CAN controller +- ) +-{ +- return pCAN->CAN_MR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgBaudrateReg +-//* \brief Configure the Baudrate of the CAN controller for the network +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgBaudrateReg ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int baudrate_cfg) +-{ +- //* Write to the BR register +- pCAN->CAN_BR = baudrate_cfg; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetBaudrate +-//* \brief Return the Baudrate of the CAN controller for the network value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetBaudrate ( +- AT91PS_CAN pCAN // pointer to a CAN controller +- ) +-{ +- return pCAN->CAN_BR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetInternalCounter +-//* \brief Return CAN Timer Regsiter Value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetInternalCounter ( +- AT91PS_CAN pCAN // pointer to a CAN controller +- ) +-{ +- return pCAN->CAN_TIM; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetTimestamp +-//* \brief Return CAN Timestamp Register Value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetTimestamp ( +- AT91PS_CAN pCAN // pointer to a CAN controller +- ) +-{ +- return pCAN->CAN_TIMESTP; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetErrorCounter +-//* \brief Return CAN Error Counter Register Value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetErrorCounter ( +- AT91PS_CAN pCAN // pointer to a CAN controller +- ) +-{ +- return pCAN->CAN_ECR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_InitTransferRequest +-//* \brief Request for a transfer on the corresponding mailboxes +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_InitTransferRequest ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int transfer_cmd) +-{ +- pCAN->CAN_TCR = transfer_cmd; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_InitAbortRequest +-//* \brief Abort the corresponding mailboxes +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_InitAbortRequest ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int abort_cmd) +-{ +- pCAN->CAN_ACR = abort_cmd; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageModeReg +-//* \brief Program the Message Mode Register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageModeReg ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int mode) +-{ +- CAN_Mailbox->CAN_MB_MMR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageModeReg +-//* \brief Return the Message Mode Register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageModeReg ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageIDReg +-//* \brief Program the Message ID Register +-//* \brief Version == 0 for Standard messsage, Version == 1 for Extended +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageIDReg ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int id, +- unsigned char version) +-{ +- if(version==0) // IDvA Standard Format +- CAN_Mailbox->CAN_MB_MID = id<<18; +- else // IDvB Extended Format +- CAN_Mailbox->CAN_MB_MID = id | (1<<29); // set MIDE bit +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageIDReg +-//* \brief Return the Message ID Register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageIDReg ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MID; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageAcceptanceMaskReg +-//* \brief Program the Message Acceptance Mask Register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageAcceptanceMaskReg ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int mask) +-{ +- CAN_Mailbox->CAN_MB_MAM = mask; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageAcceptanceMaskReg +-//* \brief Return the Message Acceptance Mask Register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageAcceptanceMaskReg ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MAM; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetFamilyID +-//* \brief Return the Message ID Register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetFamilyID ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MFID; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageCtrl +-//* \brief Request and config for a transfer on the corresponding mailbox +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageCtrlReg ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int message_ctrl_cmd) +-{ +- CAN_Mailbox->CAN_MB_MCR = message_ctrl_cmd; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageStatus +-//* \brief Return CAN Mailbox Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageStatus ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageDataLow +-//* \brief Program data low value +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageDataLow ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int data) +-{ +- CAN_Mailbox->CAN_MB_MDL = data; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageDataLow +-//* \brief Return data low value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageDataLow ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MDL; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageDataHigh +-//* \brief Program data high value +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageDataHigh ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int data) +-{ +- CAN_Mailbox->CAN_MB_MDH = data; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageDataHigh +-//* \brief Return data high value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageDataHigh ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MDH; +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR ADC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_EnableIt +-//* \brief Enable ADC interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_EnableIt ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int flag) // IT to be enabled +-{ +- //* Write to the IER register +- pADC->ADC_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_DisableIt +-//* \brief Disable ADC interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_DisableIt ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int flag) // IT to be disabled +-{ +- //* Write to the IDR register +- pADC->ADC_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetStatus +-//* \brief Return ADC Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetStatus( // \return ADC Interrupt Status +- AT91PS_ADC pADC) // pointer to a ADC controller +-{ +- return pADC->ADC_SR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetInterruptMaskStatus +-//* \brief Return ADC Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetInterruptMaskStatus( // \return ADC Interrupt Mask Status +- AT91PS_ADC pADC) // pointer to a ADC controller +-{ +- return pADC->ADC_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_IsInterruptMasked +-//* \brief Test if ADC Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_IsInterruptMasked( +- AT91PS_ADC pADC, // \arg pointer to a ADC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_ADC_GetInterruptMaskStatus(pADC) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_IsStatusSet +-//* \brief Test if ADC Status is Set +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_IsStatusSet( +- AT91PS_ADC pADC, // \arg pointer to a ADC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_ADC_GetStatus(pADC) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_CfgModeReg +-//* \brief Configure the Mode Register of the ADC controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_CfgModeReg ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int mode) // mode register +-{ +- //* Write to the MR register +- pADC->ADC_MR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetModeReg +-//* \brief Return the Mode Register of the ADC controller value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetModeReg ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_MR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_CfgTimings +-//* \brief Configure the different necessary timings of the ADC controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_CfgTimings ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int mck_clock, // in MHz +- unsigned int adc_clock, // in MHz +- unsigned int startup_time, // in us +- unsigned int sample_and_hold_time) // in ns +-{ +- unsigned int prescal,startup,shtim; +- +- prescal = mck_clock/(2*adc_clock) - 1; +- startup = adc_clock*startup_time/8 - 1; +- shtim = adc_clock*sample_and_hold_time/1000 - 1; +- +- //* Write to the MR register +- pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_EnableChannel +-//* \brief Return ADC Timer Register Value +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_EnableChannel ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int channel) // mode register +-{ +- //* Write to the CHER register +- pADC->ADC_CHER = channel; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_DisableChannel +-//* \brief Return ADC Timer Register Value +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_DisableChannel ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int channel) // mode register +-{ +- //* Write to the CHDR register +- pADC->ADC_CHDR = channel; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetChannelStatus +-//* \brief Return ADC Timer Register Value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetChannelStatus ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CHSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_StartConversion +-//* \brief Software request for a analog to digital conversion +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_StartConversion ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- pADC->ADC_CR = AT91C_ADC_START; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_SoftReset +-//* \brief Software reset +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_SoftReset ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- pADC->ADC_CR = AT91C_ADC_SWRST; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetLastConvertedData +-//* \brief Return the Last Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetLastConvertedData ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_LCDR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH0 +-//* \brief Return the Channel 0 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH0 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR0; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH1 +-//* \brief Return the Channel 1 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH1 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR1; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH2 +-//* \brief Return the Channel 2 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH2 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR2; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH3 +-//* \brief Return the Channel 3 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH3 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR3; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH4 +-//* \brief Return the Channel 4 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH4 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR4; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH5 +-//* \brief Return the Channel 5 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH5 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR5; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH6 +-//* \brief Return the Channel 6 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH6 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR6; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH7 +-//* \brief Return the Channel 7 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH7 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR7; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_CfgPMC +-//* \brief Enable Peripheral clock in PMC for DBGU +-//*---------------------------------------------------------------------------- +-__inline void AT91F_DBGU_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_CfgPIO +-//* \brief Configure PIO controllers to drive DBGU signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_DBGU_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA27_DRXD ) | +- ((unsigned int) AT91C_PA28_DTXD ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for PMC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_CfgPIO +-//* \brief Configure PIO controllers to drive PMC signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB30_PCK2 ) | +- ((unsigned int) AT91C_PB29_PCK1 ), // Peripheral A +- ((unsigned int) AT91C_PB20_PCK0 ) | +- ((unsigned int) AT91C_PB0_PCK0 ) | +- ((unsigned int) AT91C_PB22_PCK2 ) | +- ((unsigned int) AT91C_PB21_PCK1 )); // Peripheral B +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PA30_PCK2 ) | +- ((unsigned int) AT91C_PA13_PCK1 ) | +- ((unsigned int) AT91C_PA27_PCK3 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_VREG_CfgPMC +-//* \brief Enable Peripheral clock in PMC for VREG +-//*---------------------------------------------------------------------------- +-__inline void AT91F_VREG_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for RSTC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_RSTC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for SSC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SSC)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_CfgPIO +-//* \brief Configure PIO controllers to drive SSC signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA25_RK ) | +- ((unsigned int) AT91C_PA22_TK ) | +- ((unsigned int) AT91C_PA21_TF ) | +- ((unsigned int) AT91C_PA24_RD ) | +- ((unsigned int) AT91C_PA26_RF ) | +- ((unsigned int) AT91C_PA23_TD ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_WDTC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for WDTC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_WDTC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US1_CfgPMC +-//* \brief Enable Peripheral clock in PMC for US1 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US1_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_US1)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US1_CfgPIO +-//* \brief Configure PIO controllers to drive US1 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US1_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PB26_RI1 ) | +- ((unsigned int) AT91C_PB24_DSR1 ) | +- ((unsigned int) AT91C_PB23_DCD1 ) | +- ((unsigned int) AT91C_PB25_DTR1 )); // Peripheral B +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA7_SCK1 ) | +- ((unsigned int) AT91C_PA8_RTS1 ) | +- ((unsigned int) AT91C_PA6_TXD1 ) | +- ((unsigned int) AT91C_PA5_RXD1 ) | +- ((unsigned int) AT91C_PA9_CTS1 ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US0_CfgPMC +-//* \brief Enable Peripheral clock in PMC for US0 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US0_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_US0)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US0_CfgPIO +-//* \brief Configure PIO controllers to drive US0 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US0_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA0_RXD0 ) | +- ((unsigned int) AT91C_PA4_CTS0 ) | +- ((unsigned int) AT91C_PA3_RTS0 ) | +- ((unsigned int) AT91C_PA2_SCK0 ) | +- ((unsigned int) AT91C_PA1_TXD0 ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI1_CfgPMC +-//* \brief Enable Peripheral clock in PMC for SPI1 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI1_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SPI1)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI1_CfgPIO +-//* \brief Configure PIO controllers to drive SPI1 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI1_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PB11_SPI1_NPCS2) | +- ((unsigned int) AT91C_PB10_SPI1_NPCS1) | +- ((unsigned int) AT91C_PB16_SPI1_NPCS3)); // Peripheral B +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PA22_SPI1_SPCK) | +- ((unsigned int) AT91C_PA3_SPI1_NPCS2) | +- ((unsigned int) AT91C_PA26_SPI1_NPCS2) | +- ((unsigned int) AT91C_PA25_SPI1_NPCS1) | +- ((unsigned int) AT91C_PA2_SPI1_NPCS1) | +- ((unsigned int) AT91C_PA24_SPI1_MISO) | +- ((unsigned int) AT91C_PA4_SPI1_NPCS3) | +- ((unsigned int) AT91C_PA29_SPI1_NPCS3) | +- ((unsigned int) AT91C_PA21_SPI1_NPCS0) | +- ((unsigned int) AT91C_PA23_SPI1_MOSI)); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI0_CfgPMC +-//* \brief Enable Peripheral clock in PMC for SPI0 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI0_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SPI0)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI0_CfgPIO +-//* \brief Configure PIO controllers to drive SPI0 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI0_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PB13_SPI0_NPCS1) | +- ((unsigned int) AT91C_PB14_SPI0_NPCS2) | +- ((unsigned int) AT91C_PB17_SPI0_NPCS3)); // Peripheral B +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA16_SPI0_MISO) | +- ((unsigned int) AT91C_PA13_SPI0_NPCS1) | +- ((unsigned int) AT91C_PA14_SPI0_NPCS2) | +- ((unsigned int) AT91C_PA12_SPI0_NPCS0) | +- ((unsigned int) AT91C_PA17_SPI0_MOSI) | +- ((unsigned int) AT91C_PA15_SPI0_NPCS3) | +- ((unsigned int) AT91C_PA18_SPI0_SPCK), // Peripheral A +- ((unsigned int) AT91C_PA7_SPI0_NPCS1) | +- ((unsigned int) AT91C_PA8_SPI0_NPCS2) | +- ((unsigned int) AT91C_PA9_SPI0_NPCS3)); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for PITC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PITC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for AIC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_FIQ) | +- ((unsigned int) 1 << AT91C_ID_IRQ0) | +- ((unsigned int) 1 << AT91C_ID_IRQ1)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_CfgPIO +-//* \brief Configure PIO controllers to drive AIC signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA30_IRQ0 ) | +- ((unsigned int) AT91C_PA29_FIQ ), // Peripheral A +- ((unsigned int) AT91C_PA14_IRQ1 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_CfgPMC +-//* \brief Enable Peripheral clock in PMC for TWI +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TWI_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_TWI)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_CfgPIO +-//* \brief Configure PIO controllers to drive TWI signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TWI_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA11_TWCK ) | +- ((unsigned int) AT91C_PA10_TWD ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for ADC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_ADC)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_CfgPIO +-//* \brief Configure PIO controllers to drive ADC signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PB18_ADTRG )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWMC_CH3_CfgPIO +-//* \brief Configure PIO controllers to drive PWMC_CH3 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CH3_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB22_PWM3 ), // Peripheral A +- ((unsigned int) AT91C_PB30_PWM3 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWMC_CH2_CfgPIO +-//* \brief Configure PIO controllers to drive PWMC_CH2 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CH2_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB21_PWM2 ), // Peripheral A +- ((unsigned int) AT91C_PB29_PWM2 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWMC_CH1_CfgPIO +-//* \brief Configure PIO controllers to drive PWMC_CH1 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CH1_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB20_PWM1 ), // Peripheral A +- ((unsigned int) AT91C_PB28_PWM1 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWMC_CH0_CfgPIO +-//* \brief Configure PIO controllers to drive PWMC_CH0 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CH0_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB19_PWM0 ), // Peripheral A +- ((unsigned int) AT91C_PB27_PWM0 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RTTC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for RTTC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_RTTC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_CfgPMC +-//* \brief Enable Peripheral clock in PMC for UDP +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_UDP)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_EMAC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for EMAC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_EMAC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_EMAC)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_EMAC_CfgPIO +-//* \brief Configure PIO controllers to drive EMAC signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_EMAC_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB2_ETX0 ) | +- ((unsigned int) AT91C_PB12_ETXER ) | +- ((unsigned int) AT91C_PB16_ECOL ) | +- ((unsigned int) AT91C_PB15_ERXDV_ECRSDV) | +- ((unsigned int) AT91C_PB11_ETX3 ) | +- ((unsigned int) AT91C_PB6_ERX1 ) | +- ((unsigned int) AT91C_PB13_ERX2 ) | +- ((unsigned int) AT91C_PB3_ETX1 ) | +- ((unsigned int) AT91C_PB4_ECRS ) | +- ((unsigned int) AT91C_PB8_EMDC ) | +- ((unsigned int) AT91C_PB5_ERX0 ) | +- ((unsigned int) AT91C_PB18_EF100 ) | +- ((unsigned int) AT91C_PB14_ERX3 ) | +- ((unsigned int) AT91C_PB1_ETXEN ) | +- ((unsigned int) AT91C_PB10_ETX2 ) | +- ((unsigned int) AT91C_PB0_ETXCK_EREFCK) | +- ((unsigned int) AT91C_PB9_EMDIO ) | +- ((unsigned int) AT91C_PB7_ERXER ) | +- ((unsigned int) AT91C_PB17_ERXCK ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC0_CfgPMC +-//* \brief Enable Peripheral clock in PMC for TC0 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC0_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_TC0)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC0_CfgPIO +-//* \brief Configure PIO controllers to drive TC0 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC0_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB23_TIOA0 ) | +- ((unsigned int) AT91C_PB24_TIOB0 ), // Peripheral A +- ((unsigned int) AT91C_PB12_TCLK0 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC1_CfgPMC +-//* \brief Enable Peripheral clock in PMC for TC1 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC1_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_TC1)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC1_CfgPIO +-//* \brief Configure PIO controllers to drive TC1 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC1_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB25_TIOA1 ) | +- ((unsigned int) AT91C_PB26_TIOB1 ), // Peripheral A +- ((unsigned int) AT91C_PB19_TCLK1 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC2_CfgPMC +-//* \brief Enable Peripheral clock in PMC for TC2 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC2_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_TC2)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC2_CfgPIO +-//* \brief Configure PIO controllers to drive TC2 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC2_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB28_TIOB2 ) | +- ((unsigned int) AT91C_PB27_TIOA2 ), // Peripheral A +- 0); // Peripheral B +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PA15_TCLK2 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for MC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_MC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIOA_CfgPMC +-//* \brief Enable Peripheral clock in PMC for PIOA +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIOA_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_PIOA)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIOB_CfgPMC +-//* \brief Enable Peripheral clock in PMC for PIOB +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIOB_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_PIOB)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgPMC +-//* \brief Enable Peripheral clock in PMC for CAN +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_CAN)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgPIO +-//* \brief Configure PIO controllers to drive CAN signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA20_CANTX ) | +- ((unsigned int) AT91C_PA19_CANRX ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWMC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for PWMC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_PWMC)); +-} +- +-#endif // lib_AT91SAM7X256_H +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.cspy.bat b/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.cspy.bat +deleted file mode 100644 +index 46433e0a50..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.cspy.bat ++++ /dev/null +@@ -1,32 +0,0 @@ +-@REM This bat file has been generated by the IAR Embeddded Workbench +-@REM C-SPY interactive debugger,as an aid to preparing a command +-@REM line for running the cspybat command line utility with the +-@REM appropriate settings. +-@REM +-@REM After making some adjustments to this file, you can launch cspybat +-@REM by typing the name of this file followed by the name of the debug +-@REM file (usually an ubrof file). Note that this file is generated +-@REM every time a new debug session is initialized, so you may want to +-@REM move or rename the file before making changes. +-@REM +-@REM Note: some command line arguments cannot be properly generated +-@REM by this process. Specifically, the plugin which is responsible +-@REM for the Terminal I/O window (and other C runtime functionality) +-@REM comes in a special version for cspybat, and the name of that +-@REM plugin dll is not known when generating this file. It resides in +-@REM the $TOOLKIT_DIR$\bin folder and is usually called XXXbat.dll or +-@REM XXXlibsupportbat.dll, where XXX is the name of the corresponding +-@REM tool chain. Replace the '' parameter +-@REM below with the appropriate file name. Other plugins loaded by +-@REM C-SPY are usually not needed by, or will not work in, cspybat +-@REM but they are listed at the end of this file for reference. +- +- +-"C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\bin\armproc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\bin\armjlink.dll" %1 --plugin "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\bin\" --macro "C:\svn\cmock\iar\iar_v4\Resource\SAM7_FLASH.mac" --backend -B "--endian" "little" "--cpu" "ARM7TDMI" "--fpu" "None" "--proc_device_desc_file" "C:\Program Files\IAR Systems\Embedded Workbench 4.0\ARM\CONFIG\ioAT91SAM7X256.ddf" "--drv_verify_download" "all" "--proc_driver" "jlink" "--jlink_connection" "USB:0" "--jlink_initial_speed" "32" +- +- +-@REM loaded plugins: +-@REM armlibsupport.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\plugins\CodeCoverage\CodeCoverage.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\plugins\Profiling\Profiling.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\plugins\stack\stack.dll +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dbgdt b/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dbgdt +deleted file mode 100644 +index 7243596cc4..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dbgdt ++++ /dev/null +@@ -1,86 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- 185272727 +- +- +- +- +- +- 100 +- +- 20 +- 1115 +- 297 +- 74 +- +- 110$PROJ_DIR$\TermIOInput.txt10 +- +- +- +- +- +- +- +- TabID-23656-3537 +- Debug Log +- Debug-Log +- +- +- +- TabID-22088-3567 +- Build +- Build +- +- +- TabID-16970-5692Terminal I/OTerminalIO +- +- 0 +- +- +- TabID-1637-3541 +- Workspace +- Workspace +- +- +- cmock_democmock_demo/source +- +- +- +- 0 +- +- +- TabID-12385-3544 +- Disassembly +- Disassembly +- +- +- +- +- 0 +- +- +- +- +- +- TextEditorC:\svn\cmock\examples\src\Main.c02780680600100000010000001 +- +- +- +- +- +- +- iaridepm1debuggergui1-2-2509276-2-2179148129149173302200577598361-2-2509177-2-2179148129149173302129149598361-2-22771388-2-213902791002886326698129149173302 +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dni b/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dni +deleted file mode 100644 +index 149ec3d7d8..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.dni ++++ /dev/null +@@ -1,42 +0,0 @@ +-[JLinkDriver] +-WatchCond=_ 0 +-Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 +-Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 +-[DisAssemblyWindow] +-NumStates=_ 1 +-State 1=_ 1 +-[StackPlugin] +-Enabled=1 +-OverflowWarningsEnabled=1 +-WarningThreshold=90 +-SpWarningsEnabled=1 +-WarnHow=0 +-UseTrigger=1 +-TriggerName=main +-LimitSize=0 +-ByteLimit=50 +-[Log file] +-LoggingEnabled=_ 0 +-LogFile=_ "" +-Category=_ 0 +-[TermIOLog] +-LoggingEnabled=_ 0 +-LogFile=_ "" +-[Interrupts] +-Enabled=1 +-Irq0=_ 0 480549 0 480549 0 0 0 100 0 1 "IRQ 1 0x18 CPSR.I" +-Count=1 +-[MemoryMap] +-Enabled=0 +-Base=0 +-UseAuto=0 +-TypeViolation=1 +-UnspecRange=1 +-ActionState=1 +-[Disassemble mode] +-mode=0 +-[Breakpoints] +-Count=0 +-[TraceHelper] +-Enabled=0 +-ShowSource=1 +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.wsdt b/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.wsdt +deleted file mode 100644 +index 5b92806fee..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/settings/cmock_demo.wsdt ++++ /dev/null +@@ -1,76 +0,0 @@ +- +- +- +- +- +- cmock_demo/Debug +- +- +- +- +- +- +- +- +- 237272727 +- +- +- +- +- +- +- 20111529774 +- +- +- +- +- 100 +- +- +- +- +- +- +- TabID-20770-112 +- Workspace +- Workspace +- +- +- cmock_democmock_demo/Sourcecmock_demo/source +- +- +- +- 0 +- +- +- TabID-10733-1323 +- Build +- Build +- +- +- +- TabID-27316-3469 +- Debug Log +- Debug-Log +- +- +- +- +- 0 +- +- +- +- +- +- TextEditorC:\svn\cmock\examples\src\Main.c0056856800100000010000001 +- +- +- +- +- +- +- iaridepm1-2-2554328-2-2179148129149173302238095651054-2-22561388-2-213902581002886302108129149173302 +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup.s79 b/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup.s79 +deleted file mode 100644 +index 73a53fca5a..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup.s79 ++++ /dev/null +@@ -1,266 +0,0 @@ +-;- ---------------------------------------------------------------------------- +-;- ATMEL Microcontroller Software Support - ROUSSET - +-;- ---------------------------------------------------------------------------- +-;- DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-;- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-;- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-;- DISCLAIMED. IN NO EVENT SHALL ATMEL 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 source : Cstartup.s79 +-;- Object : Generic CStartup +-;- 1.0 01/Sep/05 FBr : Creation +-;- 1.1 09/Sep/05 JPP : Change Interrupt management +-;------------------------------------------------------------------------------ +- +-;------------------------------------------------------------------------------ +-; Include your AT91 Library files +-;------------------------------------------------------------------------------ +-#include "AT91SAM7X256_inc.h" +-;------------------------------------------------------------------------------ +- +-;------------------------------------------------------------------------------ +-; ?RESET +-; Reset Vector. +-; Normally, segment INTVEC is linked at address 0. +-; For debugging purposes, INTVEC may be placed at other addresses. +-; A debugger that honors the entry point will start the +-; program in a normal way even if INTVEC is not at address 0. +-;------------------------------------------------------------------------------ +- +- PROGRAM ?RESET ;- Begins a program module +- RSEG INTRAMEND_REMAP ;- Begins a relocatable segment +- RSEG ICODE:CODE (2) ;- Begins a relocatable segment : corresponding address is 32-bit aligned +- CODE32 ;- Always ARM mode after reset +- ORG 0 ;- Sets the location counter: corresponds to the RESET vector address +- +-;------------------------------------------------------------------------------ +-;- Exception vectors +-;------------------------------------------------------------------------------ +-;- These vectors can be read at address 0 or at RAM address +-;- They ABSOLUTELY requires to be in relative addresssing mode in order to +-;- guarantee a valid jump. For the moment, all are just looping. +-;- If an exception occurs before remap, this would result in an infinite loop. +-;- To ensure if a exeption occurs before start application to infinite loop. +-;------------------------------------------------------------------------------ +- +-reset +- B InitReset ; 0x00 Reset handler +-undefvec: +- B undefvec ; 0x04 Undefined Instruction +-swivec: +- B swivec ; 0x08 Software Interrupt +-pabtvec: +- B pabtvec ; 0x0C Prefetch Abort +-dabtvec: +- B dabtvec ; 0x10 Data Abort +-rsvdvec: +- B rsvdvec ; 0x14 reserved +-irqvec: +- B IRQ_Handler_Entry ; 0x18 IRQ +- +-fiqvec: ; 0x1c FIQ +-;------------------------------------------------------------------------------ +-;- Function : FIQ_Handler_Entry +-;- Treatments : FIQ Controller Interrupt Handler. +-;- Called Functions : AIC_FVR[interrupt] +-;------------------------------------------------------------------------------ +- +-FIQ_Handler_Entry: +- +-;- Switch in SVC/User Mode to allow User Stack access for C code +-; because the FIQ is not yet acknowledged +- +-;- Save and r0 in FIQ_Register +- mov r9,r0 +- ldr r0 , [r8, #AIC_FVR] +- msr CPSR_c,#I_BIT | F_BIT | ARM_MODE_SVC +-;- Save scratch/used registers and LR in User Stack +- stmfd sp!, { r1-r3, r12, lr} +- +-;- Branch to the routine pointed by the AIC_FVR +- mov r14, pc +- bx r0 +- +-;- Restore scratch/used registers and LR from User Stack +- ldmia sp!, { r1-r3, r12, lr} +- +-;- Leave Interrupts disabled and switch back in FIQ mode +- msr CPSR_c, #I_BIT | F_BIT | ARM_MODE_FIQ +- +-;- Restore the R0 ARM_MODE_SVC register +- mov r0,r9 +- +-;- Restore the Program Counter using the LR_fiq directly in the PC +- subs pc,lr,#4 +- +-;------------------------------------------------------------------------------ +-;- Manage exception: The exception must be ensure in ARM mode +-;------------------------------------------------------------------------------ +-;------------------------------------------------------------------------------ +-;- Function : IRQ_Handler_Entry +-;- Treatments : IRQ Controller Interrupt Handler. +-;- Called Functions : AIC_IVR[interrupt] +-;------------------------------------------------------------------------------ +-IRQ_Handler_Entry: +- +-;------------------------- +-;- Manage Exception Entry +-;------------------------- +-;- Adjust and save LR_irq in IRQ stack +- sub lr, lr, #4 +- stmfd sp!, {lr} +- +-;- Save r0 and SPSR (need to be saved for nested interrupt) +- mrs r14, SPSR +- stmfd sp!, {r0,r14} +- +-;- Write in the IVR to support Protect Mode +-;- No effect in Normal Mode +-;- De-assert the NIRQ and clear the source in Protect Mode +- ldr r14, =AT91C_BASE_AIC +- ldr r0 , [r14, #AIC_IVR] +- str r14, [r14, #AIC_IVR] +- +-;- Enable Interrupt and Switch in Supervisor Mode +- msr CPSR_c, #ARM_MODE_SVC +- +-;- Save scratch/used registers and LR in User Stack +- stmfd sp!, { r1-r3, r12, r14} +- +-;---------------------------------------------- +-;- Branch to the routine pointed by the AIC_IVR +-;---------------------------------------------- +- mov r14, pc +- bx r0 +- +-;---------------------------------------------- +-;- Manage Exception Exit +-;---------------------------------------------- +-;- Restore scratch/used registers and LR from User Stack +- ldmia sp!, { r1-r3, r12, r14} +- +-;- Disable Interrupt and switch back in IRQ mode +- msr CPSR_c, #I_BIT | ARM_MODE_IRQ +- +-;- Mark the End of Interrupt on the AIC +- ldr r14, =AT91C_BASE_AIC +- str r14, [r14, #AIC_EOICR] +- +-;- Restore SPSR_irq and r0 from IRQ stack +- ldmia sp!, {r0,r14} +- msr SPSR_cxsf, r14 +- +-;- Restore adjusted LR_irq from IRQ stack directly in the PC +- ldmia sp!, {pc}^ +- +- +- +-InitReset: +- +-;------------------------------------------------------------------------------ +-;- Low level Init is performed in a C function: AT91F_LowLevelInit +-;- Init Stack Pointer to a valid memory area before calling AT91F_LowLevelInit +-;------------------------------------------------------------------------------ +- +-;- Retrieve end of RAM address +-__iramend EQU SFB(INTRAMEND_REMAP) ;- Segment begin +- +- EXTERN AT91F_LowLevelInit +- ldr r13,=__iramend ;- Temporary stack in internal RAM for Low Level Init execution +- ldr r0,=AT91F_LowLevelInit +- mov lr, pc +- bx r0 ;- Branch on C function (with interworking) +- +-;------------------------------------------------------------------------------ +-;- Top of Stack Definition +-;------------------------------------------------------------------------------ +-;- Interrupt and Supervisor Stack are located at the top of internal memory in +-;- order to speed the exception handling context saving and restoring. +-;- ARM_MODE_SVC (Application, C) Stack is located at the top of the external memory. +-;------------------------------------------------------------------------------ +- +-IRQ_STACK_SIZE EQU (3*8*4) ; 3 words to be saved per interrupt priority level +-ARM_MODE_FIQ EQU 0x11 +-ARM_MODE_IRQ EQU 0x12 +-ARM_MODE_SVC EQU 0x13 +-I_BIT EQU 0x80 +-F_BIT EQU 0x40 +- +-;------------------------------------------------------------------------------ +-;- Setup the stack for each mode +-;------------------------------------------------------------------------------ +- ldr r0, =__iramend +- +-;- Set up Fast Interrupt Mode and set FIQ Mode Stack +- msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT +-;- Init the FIQ register +- ldr r8, =AT91C_BASE_AIC +- +-;- Set up Interrupt Mode and set IRQ Mode Stack +- msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT +- mov r13, r0 ; Init stack IRQ +- sub r0, r0, #IRQ_STACK_SIZE +- +-;- Enable interrupt & Set up Supervisor Mode and set Supervisor Mode Stack +- msr CPSR_c, #ARM_MODE_SVC +- mov r13, r0 +- +-;------------------------------------------------------------------------------ +-; Initialize segments. +-;------------------------------------------------------------------------------ +-; __segment_init is assumed to use +-; instruction set and to be reachable by BL from the ICODE segment +-; (it is safest to link them in segment ICODE). +-;------------------------------------------------------------------------------ +- EXTERN __segment_init +- ldr r0,=__segment_init +- mov lr, pc +- bx r0 +- +-;------------------------------------------------------------------------------ +-;- Branch on C code Main function (with interworking) +-;------------------------------------------------------------------------------ +- EXTERN main +- PUBLIC __main +-?jump_to_main: +- ldr lr,=?call_exit +- ldr r0,=main +-__main: +- bx r0 +- +-;------------------------------------------------------------------------------ +-;- Loop for ever +-;------------------------------------------------------------------------------ +-;- End of application. Normally, never occur. +-;- Could jump on Software Reset ( B 0x0 ). +-;------------------------------------------------------------------------------ +-?call_exit: +-End +- b End +- +-;------------------------------------------------------------------------------ +-;- Exception Vectors +-;------------------------------------------------------------------------------ +- PUBLIC AT91F_Default_FIQ_handler +- PUBLIC AT91F_Default_IRQ_handler +- PUBLIC AT91F_Spurious_handler +- +- CODE32 ; Always ARM mode after exeption +- +-AT91F_Default_FIQ_handler +- b AT91F_Default_FIQ_handler +- +-AT91F_Default_IRQ_handler +- b AT91F_Default_IRQ_handler +- +-AT91F_Spurious_handler +- b AT91F_Spurious_handler +- +- ENDMOD ;- Terminates the assembly of the current module +- END ;- Terminates the assembly of the last module in a file +\ No newline at end of file +diff --git a/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup_SAM7.c b/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup_SAM7.c +deleted file mode 100644 +index 0913da3dd1..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v4/srcIAR/Cstartup_SAM7.c ++++ /dev/null +@@ -1,98 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : Cstartup_SAM7.c +-// Object : Low level initialisations written in C for IAR Tools +-// Creation : FBr 01-Sep-2005 +-// 1.0 08-Sep-2005 JPP : Suppress Reset +-// ---------------------------------------------------------------------------- +- +-#include "AT91SAM7X256.h" +- +-// The following functions must be write in ARM mode this function called directly by exception vector +-extern void AT91F_Spurious_handler(void); +-extern void AT91F_Default_IRQ_handler(void); +-extern void AT91F_Default_FIQ_handler(void); +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_LowLevelInit +-//* \brief This function performs very low level HW initialization +-//* this function can use a Stack, depending the compilation +-//* optimization mode +-//*---------------------------------------------------------------------------- +-void AT91F_LowLevelInit(void) +-{ +- unsigned char i; +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- // EFC Init +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_MC->MC_FMR = AT91C_MC_FWS_1FWS; // 1 Wait State necessary to work at 48MHz +- +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- // Init PMC Step 1. Enable Main Oscillator +- // Main Oscillator startup time is board specific: +- // Main Oscillator Startup Time worst case (3MHz) corresponds to 15ms (0x40 for AT91C_CKGR_OSCOUNT field) +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_PMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (0x40 <<8) | AT91C_CKGR_MOSCEN )); +-#ifndef SIMULATE +- // Wait Main Oscillator stabilization +- while(!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MOSCS)); +-#endif +- +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- // Init PMC Step 2. +- // Set PLL to 96MHz (96,109MHz) and UDP Clock to 48MHz +- // PLL Startup time depends on PLL RC filter: worst case is choosen +- // UDP Clock (48,058MHz) is compliant with the Universal Serial Bus Specification (+/- 0.25% for full speed) +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_PMC->PMC_PLLR = AT91C_CKGR_USBDIV_1 | AT91C_CKGR_OUT_0 | AT91C_CKGR_PLLCOUNT | +- (AT91C_CKGR_MUL & (72 << 16)) | (AT91C_CKGR_DIV & 14); +-#ifndef SIMULATE +- // Wait for PLL stabilization +- while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_LOCK) ); +- // Wait until the master clock is established for the case we already turn on the PLL +- while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); +-#endif +- +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- // Init PMC Step 3. +- // Selection of Master Clock MCK (equal to Processor Clock PCK) equal to PLL/2 = 48MHz +- // The PMC_MCKR register must not be programmed in a single write operation (see. Product Errata Sheet) +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_PMC->PMC_MCKR = AT91C_PMC_PRES_CLK_2; +-#ifndef SIMULATE +- // Wait until the master clock is established +- while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); +-#endif +- +- AT91C_BASE_PMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK; +-#ifndef SIMULATE +- // Wait until the master clock is established +- while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); +-#endif +- +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- // Disable Watchdog (write once register) +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_WDTC->WDTC_WDMR = AT91C_WDTC_WDDIS; +- +- //////////////////////////////////////////////////////////////////////////////////////////////////// +- // Init AIC: assign corresponding handler for each interrupt source +- ///////////////////////////////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler ; +- for (i = 1; i < 31; i++) { +- AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler ; +- } +- AT91C_BASE_AIC->AIC_SPU = (unsigned int) AT91F_Spurious_handler; +-} +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_FLASH.mac b/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_FLASH.mac +deleted file mode 100644 +index 7c4021aad5..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_FLASH.mac ++++ /dev/null +@@ -1,71 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : SAM7_FLASH.mac +-// Object : Generic Macro File for IAR +-// 1.0 17/Aug/05 FBr : Creation +-// ---------------------------------------------------------------------------- +- +-/********************************************************************* +-* +-* _InitRSTC() +-* +-* Function description +-* Initializes the RSTC (Reset controller). +-* This makes sense since the default is to not allow user resets, which makes it impossible to +-* apply a second RESET via J-Link +-*/ +-_InitRSTC() { +- __writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset +-} +- +-/********************************************************************* +-* +-* _InitPLL() +-* Function description +-* Initializes the PMC. +-* 1. Enable the Main Oscillator +-* 2. Configure PLL to 96MHz +-* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz +-*/ +- _InitPLL() { +- +- __message "Enable Main Oscillator"; +- __writeMemory32(0x00000601,0xFFFFFc20,"Memory"); // MOSC +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) ); +- +- __message "Set PLL to 96MHz"; +- __writeMemory32(0x10191c05,0xFFFFFc2c,"Memory"); // LOCK +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) ); +- +- __message "Set Master Clock to 48MHz"; +- __writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); +- __writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); +-} +- +-/********************************************************************* +-* +-* execUserReset() : JTAG set initially to Full Speed +-*/ +-execUserReset() { +- __message "execUserReset()"; +- __emulatorSpeed(30000); // Set JTAG speed to 30kHz to make a hardware reset +- __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz) +- _InitPLL(); // Allow to debug at JTAG Full Speed +- _InitRSTC(); // Enable User Reset to allow execUserReset() execution +- __emulatorSpeed(0); // Set JTAG speed to full speed +-} +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_RAM.mac b/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_RAM.mac +deleted file mode 100644 +index a1bf81dc79..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_RAM.mac ++++ /dev/null +@@ -1,94 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : SAM7_RAM.mac +-// Object : Generic Macro File for IAR +-// 1.0 17/Aug/05 FBr : Creation +-// ---------------------------------------------------------------------------- +- +-/********************************************************************* +-* +-* _MapRAMAt0() +-* +-* Function description +-* Maps RAM at 0. +-*/ +-_MapRAMAt0(){ +- __message "Changing mapping: RAM mapped to 0"; +- __writeMemory32(0x00000001,0xFFFFFF00,"Memory"); +-} +- +-/********************************************************************* +-* +-* _InitRSTC() +-* +-* Function description +-* Initializes the RSTC (Reset controller). +-* This makes sense since the default is to not allow user resets, which makes it impossible to +-* apply a second RESET via J-Link +-*/ +-_InitRSTC() { +- __writeMemory32(0xA5000001, 0xFFFFFD08,"Memory"); // Allow user reset +-} +- +-/********************************************************************* +-* +-* _InitPLL() +-* Function description +-* Initializes the PMC. +-* 1. Enable the Main Oscillator +-* 2. Configure PLL to 96MHz +-* 3. Switch Master Clock (MCK) on PLL/2 = 48MHz +-*/ +- _InitPLL() { +- +- __message "Set Main Oscillator"; +- __writeMemory32(0x00004001,0xFFFFFc20,"Memory"); // MOSC +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x1) ); +- +- __message "Set PLL to 96MHz"; +- __writeMemory32(0x10483f0e,0xFFFFFc2c,"Memory"); // LOCK +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x4) ); +- +- __message "Set Master Clock to 48MHz"; +- __writeMemory32(0x00000004,0xFFFFFc30,"Memory"); // MCKRDY +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); +- __writeMemory32(0x00000007,0xFFFFFc30,"Memory"); // MCKRDY +- while( !(__readMemory32(0xFFFFFc68,"Memory") & 0x8) ); +-} +- +-/********************************************************************* +-* +-* execUserReset() : JTAG set initially to Full Speed +-*/ +-execUserReset() { +- __message "execUserReset()"; +- __emulatorSpeed(30000); // Set JTAG speed to 30kHz to make a hardware reset +- __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset +- _InitPLL(); // Allow to debug at JTAG Full Speed +- _MapRAMAt0(); // Remap RAM to address 0 +- __emulatorSpeed(0); // Set JTAG speed to full speed +-} +- +-/********************************************************************* +-* +-* execUserPreload() : JTAG set initially to 32kHz +-*/ +-execUserPreload() { +- __message "execUserPreload()"; +- __hwReset(0); // Hardware Reset: CPU is automatically halted after the reset (JTAG is already configured to 32kHz) +- _InitPLL(); // Allow to load Code at JTAG Full Speed +- _MapRAMAt0(); // Remap RAM to address 0 +- _InitRSTC(); // Enable User Reset to allow execUserReset() execution +-} +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_SIM.mac b/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_SIM.mac +deleted file mode 100644 +index 2be1a4c9b9..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/SAM7_SIM.mac ++++ /dev/null +@@ -1,67 +0,0 @@ +-//========================================================= +-// Simulation setup file for esc07_demo project +-//========================================================= +- +-__var _timer0_interrupt_ID; +- +-irqBreak() +-{ +- __var __AIC_SMR; +- __var __AIC_IECR; +- __var __AIC_IVR; +- +- // read AIC_IECR instead, since not fully supported by simulator +- __AIC_IECR = __readMemory32(0xFFFFF120, "Memory"); +- if(__AIC_IECR & 0x1000) +- { +- __AIC_SMR = __readMemory32(0xFFFFF060, "Memory"); +- __AIC_IVR = __readMemory32(0xFFFFF0B0, "Memory"); //AIC_IVR = AIC_SVR[x] +- __writeMemory32(__AIC_IVR, 0xFFFFF100, "Memory"); //AIC_IVR +- __writeMemory32(0x1000, 0xFFFFF10C, "Memory"); //AIC_IPR +- __writeMemory32(0x2, 0xFFFFF114, "Memory"); //AIC_CISR +- } +- +- return 0; +-} +- +-setupProcessorRegisters() +-{ +- // Write TC0_SR.CPCS with correct status for ISR (Clock enabled; RC Compare Flag = TRUE) +- __writeMemory32(0x00010010, 0xfffa0020, "Memory"); +- +- // Set TX ready flag in USART0 status register +- // USART0_BASE->US_CSR = AT91C_US_TXRDY +- __writeMemory32(0x00000002, 0xfffc0014, "Memory"); +-} +- +-configureTimer0Interrupt() +-{ +- __var _master_clock_frequency; +- __var _timer0_period_cycles; +- +- // Calculate timer0 frequency in master clock cycles +- _master_clock_frequency = 48054857; +- _timer0_period_cycles = _master_clock_frequency / 100; +- if((_master_clock_frequency % 100) >= 50) +- { +- _timer0_period_cycles++; +- } +- +- __cancelAllInterrupts(); +- __enableInterrupts(); +- +- _timer0_interrupt_ID = __orderInterrupt("IRQ", _timer0_period_cycles, _timer0_period_cycles, 0, 0, 0, 100); +- +- if(-1 == _timer0_interrupt_ID) +- { +- __message "ERROR: failed to order timer 0 interrupt"; +- } +- +- __setCodeBreak("0x18", 0, "irqBreak()", "TRUE", ""); +-} +- +-execUserReset() +-{ +- setupProcessorRegisters(); +- configureTimer0Interrupt(); +-} +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_FLASH.icf b/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_FLASH.icf +deleted file mode 100644 +index ab842a2f57..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_FLASH.icf ++++ /dev/null +@@ -1,43 +0,0 @@ +-/*###ICF### Section handled by ICF editor, don't touch! ****/ +-/*-Editor annotation file-*/ +-/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +-/*-Specials-*/ +-define symbol __ICFEDIT_intvec_start__ = 0x00000000; +-/*-Memory Regions-*/ +-define symbol __ICFEDIT_region_ROM_start__ = 0x00000100; +-define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF; +-define symbol __ICFEDIT_region_RAM_start__ = 0x00200000; +-define symbol __ICFEDIT_region_RAM_end__ = 0x0020FFFF; +-/*-Sizes-*/ +-define symbol __ICFEDIT_size_cstack__ = 0x400; +-define symbol __ICFEDIT_size_svcstack__ = 0x100; +-define symbol __ICFEDIT_size_irqstack__ = 0x100; +-define symbol __ICFEDIT_size_fiqstack__ = 0x40; +-define symbol __ICFEDIT_size_undstack__ = 0x40; +-define symbol __ICFEDIT_size_abtstack__ = 0x40; +-define symbol __ICFEDIT_size_heap__ = 0x400; +-/**** End of ICF editor section. ###ICF###*/ +- +- +-define memory mem with size = 4G; +-define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; +-define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; +- +-define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +-define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; +-define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; +-define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; +-define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; +-define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; +-define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; +- +-initialize by copy { readwrite }; +-do not initialize { section .noinit }; +- +-place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; +- +-place in ROM_region { readonly }; +-place in RAM_region { readwrite, +- block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, +- block UND_STACK, block ABT_STACK, block HEAP }; +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_RAM.icf b/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_RAM.icf +deleted file mode 100644 +index cc79cda297..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/Resource/at91SAM7X256_RAM.icf ++++ /dev/null +@@ -1,42 +0,0 @@ +-/*###ICF### Section handled by ICF editor, don't touch! ****/ +-/*-Editor annotation file-*/ +-/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ +-/*-Specials-*/ +-define symbol __ICFEDIT_intvec_start__ = 0x00000000; +-/*-Memory Regions-*/ +-define symbol __ICFEDIT_region_ROM_start__ = 0x00; +-define symbol __ICFEDIT_region_ROM_end__ = 0x00; +-define symbol __ICFEDIT_region_RAM_start__ = 0x00000100; +-define symbol __ICFEDIT_region_RAM_end__ = 0x0000FFFF; +-/*-Sizes-*/ +-define symbol __ICFEDIT_size_cstack__ = 0x400; +-define symbol __ICFEDIT_size_svcstack__ = 0x100; +-define symbol __ICFEDIT_size_irqstack__ = 0x100; +-define symbol __ICFEDIT_size_fiqstack__ = 0x40; +-define symbol __ICFEDIT_size_undstack__ = 0x40; +-define symbol __ICFEDIT_size_abtstack__ = 0x40; +-define symbol __ICFEDIT_size_heap__ = 0x800; +-/**** End of ICF editor section. ###ICF###*/ +- +- +-define memory mem with size = 4G; +-define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; +- +-define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +-define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; +-define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; +-define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; +-define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; +-define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; +-define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; +- +-initialize by copy { readwrite }; +-do not initialize { section .noinit }; +- +-place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; +- +-place in RAM_region { readonly }; +-place in RAM_region { readwrite, +- block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, +- block UND_STACK, block ABT_STACK, block HEAP }; +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.dep b/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.dep +deleted file mode 100644 +index 456f4dbaee..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.dep ++++ /dev/null +@@ -1,4204 +0,0 @@ +- +- +- +- 2 +- 3270150602 +- +- Binary +- +- $PROJ_DIR$\Binary\Obj\TimerConductor.o +- $TOOLKIT_DIR$\inc\DLib_Defaults.h +- $TOOLKIT_DIR$\inc\DLib_Threads.h +- $PROJ_DIR$\Binary\Obj\TimerConductor.pbi +- $PROJ_DIR$\Binary\List\TimerInterruptConfigurator.lst +- $PROJ_DIR$\Binary\Obj\AdcTemperatureSensor.o +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\..\..\test\system\src\TimerModel.h +- $TOOLKIT_DIR$\inc\ymath.h +- $PROJ_DIR$\Binary\Obj\Cstartup_SAM7.o +- $TOOLKIT_DIR$\inc\DLib_Product.h +- $TOOLKIT_DIR$\inc\math.h +- $PROJ_DIR$\Binary\Exe\cmock_demo.hex +- $PROJ_DIR$\Binary\Obj\UsartPutChar.pbi +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.h +- $PROJ_DIR$\Binary\Obj\AdcConductor.pbi +- $PROJ_DIR$\Binary\List\TimerConfigurator.lst +- $PROJ_DIR$\Binary\List\TaskScheduler.lst +- $PROJ_DIR$\Binary\List\TemperatureCalculator.lst +- $PROJ_DIR$\Binary\List\UsartConductor.lst +- $PROJ_DIR$\Binary\Obj\UsartConductor.o +- $PROJ_DIR$\Binary\Obj\TimerModel.o +- $PROJ_DIR$\Binary\Obj\UsartConfigurator.pbi +- $PROJ_DIR$\Binary\Obj\TimerInterruptConfigurator.o +- $PROJ_DIR$\Binary\List\Cstartup.lst +- $PROJ_DIR$\..\..\test\system\src\Executor.h +- $PROJ_DIR$\incIAR\project.h +- $PROJ_DIR$\Binary\Obj\Executor.pbi +- $PROJ_DIR$\Binary\List\TimerConductor.lst +- $PROJ_DIR$\Binary\Obj\TimerModel.pbi +- $TOOLKIT_DIR$\inc\intrinsics.h +- $PROJ_DIR$\Binary\Obj\Model.pbi +- $PROJ_DIR$\Binary\Obj\UsartBaudRateRegisterCalculator.o +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h +- $PROJ_DIR$\..\..\examples\src\UsartModel.h +- $PROJ_DIR$\Binary\Obj\TaskScheduler.pbi +- $PROJ_DIR$\Binary\Obj\Executor.o +- $PROJ_DIR$\Binary\Obj\TemperatureCalculator.o +- $PROJ_DIR$\Binary\Obj\Cstartup_SAM7.pbi +- $PROJ_DIR$\..\..\test\system\src\AT91SAM7X256.h +- $PROJ_DIR$\Binary\Obj\IntrinsicsWrapper.pbi +- $PROJ_DIR$\..\..\examples\src\UsartHardware.h +- $PROJ_DIR$\Binary\List\Main.lst +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\Binary\List\TimerHardware.lst +- $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.h +- $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\test\system\src\UsartPutChar.h +- $PROJ_DIR$\..\..\test\system\src\TaskScheduler.h +- $PROJ_DIR$\Binary\List\UsartTransmitBufferStatus.lst +- $PROJ_DIR$\Binary\Obj\AdcTemperatureSensor.pbi +- $PROJ_DIR$\Binary\Obj\Main.pbi +- $PROJ_DIR$\Binary\List\UsartModel.lst +- $PROJ_DIR$\Binary\Obj\TemperatureFilter.pbi +- $PROJ_DIR$\Binary\List\AdcHardware.lst +- $PROJ_DIR$\Binary\List\AdcTemperatureSensor.lst +- $PROJ_DIR$\Binary\Obj\UsartTransmitBufferStatus.pbi +- $PROJ_DIR$\Binary\Obj\AdcHardware.pbi +- $PROJ_DIR$\Binary\Obj\TemperatureCalculator.pbi +- $TOOLKIT_DIR$\lib\dl4t_tl_in.a +- $TOOLKIT_DIR$\inc\ycheck.h +- $PROJ_DIR$\..\..\test\system\src\ModelConfig.h +- $PROJ_DIR$\Binary\List\AdcConductor.lst +- $PROJ_DIR$\Binary\List\AdcHardwareConfigurator.lst +- $PROJ_DIR$\Binary\Obj\TimerHardware.o +- $PROJ_DIR$\Binary\Obj\TimerInterruptHandler.o +- $TOOLKIT_DIR$\inc\stdio.h +- $PROJ_DIR$\Binary\Obj\UsartHardware.o +- $PROJ_DIR$\Binary\Obj\TimerInterruptHandler.pbi +- $PROJ_DIR$\Binary\Obj\UsartModel.o +- $TOOLKIT_DIR$\inc\DLib_Config_Normal.h +- $PROJ_DIR$\Binary\List\TemperatureFilter.lst +- $PROJ_DIR$\Binary\List\UsartPutChar.lst +- $PROJ_DIR$\Binary\Obj\UsartConfigurator.o +- $PROJ_DIR$\..\..\test\system\src\UsartConductor.h +- $PROJ_DIR$\Binary\List\AdcModel.lst +- $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.h +- $PROJ_DIR$\..\..\test\system\src\Types.h +- $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.h +- $TOOLKIT_DIR$\inc\yvals.h +- $PROJ_DIR$\..\..\test\system\src\UsartModel.h +- $PROJ_DIR$\Binary\Obj\UsartTransmitBufferStatus.o +- $TOOLKIT_DIR$\lib\rt4t_al.a +- $PROJ_DIR$\Binary\List\UsartHardware.lst +- $TOOLKIT_DIR$\inc\ysizet.h +- $PROJ_DIR$\Binary\Obj\AdcModel.o +- $PROJ_DIR$\Binary\Obj\AdcConductor.o +- $PROJ_DIR$\Binary\Exe\cmock_demo.out +- $PROJ_DIR$\..\..\test\system\src\AdcConductor.h +- $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.h +- $PROJ_DIR$\Binary\Obj\UsartModel.pbi +- $PROJ_DIR$\..\..\test\system\src\TimerHardware.h +- $PROJ_DIR$\..\..\test\system\src\AdcModel.h +- $PROJ_DIR$\..\..\test\system\src\AdcHardware.h +- $PROJ_DIR$\Binary\List\UsartBaudRateRegisterCalculator.lst +- $PROJ_DIR$\..\..\test\system\src\Model.h +- $TOOLKIT_DIR$\lib\shs_l.a +- $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.h +- $PROJ_DIR$\Binary\Obj\TimerInterruptConfigurator.pbi +- $PROJ_DIR$\Binary\List\UsartConfigurator.lst +- $PROJ_DIR$\Binary\List\TimerModel.lst +- $PROJ_DIR$\..\..\examples\src\Executor.h +- $PROJ_DIR$\Binary\Obj\IntrinsicsWrapper.o +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h +- $PROJ_DIR$\..\..\examples\src\UsartConductor.h +- $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\..\examples\src\TimerConductor.h +- $PROJ_DIR$\Binary\Obj\AdcHardwareConfigurator.o +- $TOOLKIT_DIR$\inc\xencoding_limits.h +- $PROJ_DIR$\..\..\test\system\src\Main.c +- $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\AdcConductor.c +- $PROJ_DIR$\..\..\test\system\src\AdcHardware.c +- $PROJ_DIR$\..\..\examples\src\TimerModel.h +- $PROJ_DIR$\..\..\test\system\src\AdcModel.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h +- $PROJ_DIR$\..\..\test\system\src\Executor.c +- $PROJ_DIR$\..\..\examples\src\Model.h +- $PROJ_DIR$\..\..\test\system\src\Model.c +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.h +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c +- $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c +- $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\Binary\Obj\AdcModel.pbi +- $PROJ_DIR$\..\..\test\system\src\TimerConductor.c +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c +- $PROJ_DIR$\Binary\Obj\AdcHardware.o +- $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\TimerHardware.c +- $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\..\..\examples\src\AdcModel.h +- $PROJ_DIR$\..\..\test\system\src\TimerModel.c +- $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\..\test\system\src\UsartConductor.c +- $PROJ_DIR$\..\..\examples\src\AdcHardware.h +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h +- $PROJ_DIR$\..\..\test\system\src\UsartHardware.c +- $PROJ_DIR$\..\..\test\system\src\UsartModel.c +- $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h +- $PROJ_DIR$\..\..\examples\src\ModelConfig.h +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h +- $PROJ_DIR$\..\..\examples\src\Types.h +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\examples\src\AdcConductor.h +- $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.h +- $PROJ_DIR$\..\..\examples\src\TimerHardware.h +- $PROJ_DIR$\Binary\Obj\TimerHardware.pbi +- $PROJ_DIR$\Binary\Obj\TimerConfigurator.o +- $PROJ_DIR$\Binary\List\Model.lst +- $PROJ_DIR$\Binary\Obj\Cstartup.o +- $PROJ_DIR$\Binary\Obj\TaskScheduler.o +- $PROJ_DIR$\Binary\Obj\TemperatureFilter.o +- $PROJ_DIR$\..\..\test\system\src\TimerConductor.h +- $PROJ_DIR$\Binary\Obj\Model.o +- $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\Binary\Obj\UsartHardware.pbi +- $PROJ_DIR$\Binary\List\TimerInterruptHandler.lst +- $PROJ_DIR$\Binary\Obj\cmock_demo.pbd +- $PROJ_DIR$\..\..\test\system\src\UsartHardware.h +- $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.h +- $PROJ_DIR$\Binary\Obj\UsartConductor.pbi +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\..\examples\src\Executor.c +- $PROJ_DIR$\..\..\examples\src\Main.c +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- $PROJ_DIR$\..\..\examples\src\Model.c +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- $PROJ_DIR$\Resource\at91SAM7X256_FLASH.icf +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- $PROJ_DIR$\srcIAR\Cstartup.s +- $PROJ_DIR$\Binary\Obj\UsartPutChar.o +- $PROJ_DIR$\Binary\Obj\TimerConfigurator.pbi +- $PROJ_DIR$\Binary\Obj\Main.o +- $PROJ_DIR$\Binary\List\Executor.lst +- $PROJ_DIR$\incIAR\AT91SAM7X-EK.h +- $PROJ_DIR$\incIAR\lib_AT91SAM7X256.h +- $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h +- $PROJ_DIR$\Binary\Obj\AdcHardwareConfigurator.pbi +- $PROJ_DIR$\Binary\Obj\UsartBaudRateRegisterCalculator.pbi +- +- +- [ROOT_NODE] +- +- +- ILINK +- 88 +- +- +- +- +- $PROJ_DIR$\Binary\Exe\cmock_demo.out +- +- +- OBJCOPY +- 12 +- +- +- +- +- ILINK +- 179 87 131 108 86 5 156 9 36 103 198 160 157 37 158 0 154 65 23 66 21 32 20 74 68 70 196 82 97 83 60 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c +- +- +- BICOMP +- 51 +- +- +- ICCARM +- 56 5 +- +- +- +- +- BICOMP +- 78 39 90 +- +- +- ICCARM +- 78 39 90 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\Main.c +- +- +- BICOMP +- 52 +- +- +- ICCARM +- 42 198 +- +- +- +- +- BICOMP +- 78 39 25 96 49 47 77 75 165 98 48 81 46 161 159 92 79 6 14 7 89 94 166 90 93 +- +- +- ICCARM +- 78 39 25 96 49 47 77 75 165 98 48 81 46 161 159 92 79 6 14 7 89 94 166 90 93 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c +- +- +- BICOMP +- 203 +- +- +- ICCARM +- 64 108 +- +- +- +- +- BICOMP +- 78 39 166 62 +- +- +- ICCARM +- 78 39 166 62 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcConductor.c +- +- +- BICOMP +- 15 +- +- +- ICCARM +- 63 87 +- +- +- +- +- BICOMP +- 78 39 89 93 94 +- +- +- ICCARM +- 78 39 89 93 94 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcHardware.c +- +- +- BICOMP +- 58 +- +- +- ICCARM +- 55 131 +- +- +- +- +- BICOMP +- 78 39 94 166 90 +- +- +- ICCARM +- 78 39 94 166 90 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcModel.c +- +- +- BICOMP +- 128 +- +- +- ICCARM +- 76 86 +- +- +- +- +- BICOMP +- 78 39 93 49 47 77 +- +- +- ICCARM +- 78 39 93 49 47 77 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\Executor.c +- +- +- BICOMP +- 27 +- +- +- ICCARM +- 199 36 +- +- +- +- +- BICOMP +- 78 39 25 96 75 159 89 30 61 +- +- +- ICCARM +- 78 39 25 96 75 159 89 30 61 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\Model.c +- +- +- BICOMP +- 31 +- +- +- ICCARM +- 155 160 +- +- +- +- +- BICOMP +- 96 78 39 49 77 +- +- +- ICCARM +- 96 78 39 49 77 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c +- +- +- BICOMP +- 54 +- +- +- ICCARM +- 72 158 +- +- +- +- +- BICOMP +- 78 39 77 11 61 8 80 1 10 109 2 +- +- +- ICCARM +- 78 39 77 11 61 8 80 1 71 10 109 2 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c +- +- +- BICOMP +- 197 +- +- +- ICCARM +- 16 154 +- +- +- +- +- BICOMP +- 78 39 79 6 +- +- +- ICCARM +- 78 39 79 6 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c +- +- +- BICOMP +- 59 +- +- +- ICCARM +- 18 37 +- +- +- +- +- BICOMP +- 78 39 47 11 61 8 80 1 10 109 2 +- +- +- ICCARM +- 78 39 47 11 61 8 80 1 71 10 109 2 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c +- +- +- BICOMP +- 35 +- +- +- ICCARM +- 17 157 +- +- +- +- +- BICOMP +- 78 39 49 +- +- +- ICCARM +- 78 39 49 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c +- +- +- BICOMP +- 99 +- +- +- ICCARM +- 4 23 +- +- +- +- +- BICOMP +- 78 39 6 14 +- +- +- ICCARM +- 78 39 6 14 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerConductor.c +- +- +- BICOMP +- 3 +- +- +- ICCARM +- 28 0 +- +- +- +- +- BICOMP +- 78 39 159 7 92 14 +- +- +- ICCARM +- 78 39 159 7 92 14 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c +- +- +- BICOMP +- 69 +- +- +- ICCARM +- 163 66 +- +- +- +- +- BICOMP +- 78 39 14 6 +- +- +- ICCARM +- 78 39 14 6 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c +- +- +- BICOMP +- 22 +- +- +- ICCARM +- 100 74 +- +- +- +- +- BICOMP +- 78 39 98 +- +- +- ICCARM +- 78 39 98 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerHardware.c +- +- +- BICOMP +- 153 +- +- +- ICCARM +- 45 65 +- +- +- +- +- BICOMP +- 78 39 92 79 +- +- +- ICCARM +- 78 39 92 79 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c +- +- +- BICOMP +- 57 +- +- +- ICCARM +- 50 82 +- +- +- +- +- BICOMP +- 78 39 161 +- +- +- ICCARM +- 78 39 161 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerModel.c +- +- +- BICOMP +- 29 +- +- +- ICCARM +- 101 21 +- +- +- +- +- BICOMP +- 78 39 7 49 +- +- +- ICCARM +- 78 39 7 49 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c +- +- +- BICOMP +- 204 +- +- +- ICCARM +- 95 32 +- +- +- +- +- BICOMP +- 78 39 46 +- +- +- ICCARM +- 78 39 46 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartConductor.c +- +- +- BICOMP +- 167 +- +- +- ICCARM +- 19 20 +- +- +- +- +- BICOMP +- 78 39 75 165 81 49 +- +- +- ICCARM +- 78 39 75 165 81 49 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartHardware.c +- +- +- BICOMP +- 162 +- +- +- ICCARM +- 84 68 +- +- +- +- +- BICOMP +- 78 39 165 98 48 +- +- +- ICCARM +- 78 39 165 98 48 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartModel.c +- +- +- BICOMP +- 91 +- +- +- ICCARM +- 53 70 +- +- +- +- +- BICOMP +- 78 39 81 62 46 77 67 61 80 1 10 109 2 85 11 8 +- +- +- ICCARM +- 78 39 81 62 46 77 67 61 80 1 71 10 109 2 85 11 8 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c +- +- +- BICOMP +- 13 +- +- +- ICCARM +- 73 196 +- +- +- +- +- BICOMP +- 78 39 48 161 +- +- +- ICCARM +- 78 39 48 161 +- +- +- +- +- $PROJ_DIR$\Binary\Obj\cmock_demo.pbd +- +- +- BILINK +- 15 58 203 128 51 38 27 40 52 31 35 59 54 3 197 153 99 69 29 204 167 22 162 91 13 57 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- BICOMP +- 38 +- +- +- +- +- BICOMP +- 26 30 61 200 150 201 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- +- +- BICOMP +- 203 +- +- +- +- +- BICOMP +- 147 150 146 145 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- +- +- BICOMP +- 15 +- +- +- ICCARM +- 63 87 131 108 86 5 36 103 198 160 157 37 158 0 154 65 23 66 21 32 20 74 68 70 196 82 9 +- +- +- +- +- BICOMP +- 147 150 149 135 139 +- +- +- ICCARM +- 147 150 149 135 139 146 144 145 151 148 140 102 118 105 107 120 30 61 41 43 121 34 33 44 152 104 122 116 114 11 8 80 1 71 10 109 2 67 85 26 200 201 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- +- +- BICOMP +- 58 +- +- +- +- +- BICOMP +- 147 150 139 146 144 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- +- +- BICOMP +- 128 +- +- +- +- +- BICOMP +- 147 150 135 151 148 140 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- +- +- BICOMP +- 51 +- +- +- +- +- BICOMP +- 147 150 144 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Executor.c +- +- +- BICOMP +- 27 +- +- +- +- +- BICOMP +- 147 150 102 118 105 107 149 120 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Main.c +- +- +- BICOMP +- 52 +- +- +- +- +- BICOMP +- 147 150 120 102 118 151 148 140 105 41 43 121 34 33 44 107 152 104 122 116 114 149 139 146 144 135 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- +- +- BICOMP +- 40 +- +- +- +- +- BICOMP +- 120 30 61 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Model.c +- +- +- BICOMP +- 31 +- +- +- +- +- BICOMP +- 118 147 150 151 140 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- +- +- BICOMP +- 59 +- +- +- +- +- BICOMP +- 147 150 148 11 61 8 80 1 10 109 2 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- +- +- BICOMP +- 35 +- +- +- +- +- BICOMP +- 147 150 151 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- +- +- BICOMP +- 99 +- +- +- +- +- BICOMP +- 147 150 122 116 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- +- +- BICOMP +- 54 +- +- +- +- +- BICOMP +- 147 150 140 11 61 8 80 1 10 109 2 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- +- +- BICOMP +- 3 +- +- +- +- +- BICOMP +- 147 150 107 114 152 116 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- +- +- BICOMP +- 197 +- +- +- +- +- BICOMP +- 147 150 104 122 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- +- +- BICOMP +- 153 +- +- +- +- +- BICOMP +- 147 150 152 104 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- +- +- BICOMP +- 69 +- +- +- +- +- BICOMP +- 147 150 116 122 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- +- +- BICOMP +- 29 +- +- +- +- +- BICOMP +- 147 150 114 151 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- +- +- BICOMP +- 91 +- +- +- +- +- BICOMP +- 147 150 34 145 33 140 67 61 80 1 10 109 2 85 11 8 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- +- +- BICOMP +- 204 +- +- +- +- +- BICOMP +- 147 150 33 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- +- +- BICOMP +- 167 +- +- +- +- +- BICOMP +- 147 150 105 41 34 151 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- +- +- BICOMP +- 22 +- +- +- +- +- BICOMP +- 147 150 43 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- +- +- BICOMP +- 162 +- +- +- +- +- BICOMP +- 147 150 41 43 121 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- +- +- BICOMP +- 57 +- +- +- +- +- BICOMP +- 147 150 44 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- +- +- BICOMP +- 13 +- +- +- +- +- BICOMP +- 147 150 121 44 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup.s +- +- +- AARM +- 156 24 +- +- +- +- +- AARM +- 202 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\Executor.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\Main.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\Model.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- ICCARM +- +- +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- ICCARM +- +- +- +- FLASH_Debug +- +- $TOOLKIT_DIR$\inc\DLib_Defaults.h +- $TOOLKIT_DIR$\inc\DLib_Threads.h +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\..\..\test\system\src\TimerModel.h +- $TOOLKIT_DIR$\inc\ymath.h +- $TOOLKIT_DIR$\inc\DLib_Product.h +- $TOOLKIT_DIR$\inc\math.h +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.h +- $PROJ_DIR$\..\..\test\system\src\Executor.h +- $PROJ_DIR$\incIAR\project.h +- $TOOLKIT_DIR$\inc\intrinsics.h +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h +- $PROJ_DIR$\..\..\examples\src\UsartModel.h +- $PROJ_DIR$\..\..\test\system\src\AT91SAM7X256.h +- $PROJ_DIR$\..\..\examples\src\UsartHardware.h +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.h +- $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\test\system\src\UsartPutChar.h +- $PROJ_DIR$\..\..\test\system\src\TaskScheduler.h +- $TOOLKIT_DIR$\lib\dl4t_tl_in.a +- $TOOLKIT_DIR$\inc\ycheck.h +- $PROJ_DIR$\..\..\test\system\src\ModelConfig.h +- $TOOLKIT_DIR$\inc\stdio.h +- $TOOLKIT_DIR$\inc\DLib_Config_Normal.h +- $PROJ_DIR$\..\..\test\system\src\UsartConductor.h +- $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.h +- $PROJ_DIR$\..\..\test\system\src\Types.h +- $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.h +- $TOOLKIT_DIR$\inc\yvals.h +- $PROJ_DIR$\..\..\test\system\src\UsartModel.h +- $TOOLKIT_DIR$\lib\rt4t_al.a +- $TOOLKIT_DIR$\inc\ysizet.h +- $PROJ_DIR$\..\..\test\system\src\AdcConductor.h +- $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.h +- $PROJ_DIR$\..\..\test\system\src\TimerHardware.h +- $PROJ_DIR$\..\..\test\system\src\AdcModel.h +- $PROJ_DIR$\..\..\test\system\src\AdcHardware.h +- $PROJ_DIR$\..\..\test\system\src\Model.h +- $TOOLKIT_DIR$\lib\shs_l.a +- $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.h +- $PROJ_DIR$\..\..\examples\src\Executor.h +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h +- $PROJ_DIR$\..\..\examples\src\UsartConductor.h +- $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\..\examples\src\TimerConductor.h +- $TOOLKIT_DIR$\inc\xencoding_limits.h +- $PROJ_DIR$\FLASH_Debug\Obj\cmock_demo.pbd +- $PROJ_DIR$\..\..\test\system\src\Main.c +- $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\AdcConductor.c +- $PROJ_DIR$\..\..\test\system\src\AdcHardware.c +- $PROJ_DIR$\..\..\examples\src\TimerModel.h +- $PROJ_DIR$\..\..\test\system\src\AdcModel.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h +- $PROJ_DIR$\..\..\test\system\src\Executor.c +- $PROJ_DIR$\..\..\examples\src\Model.h +- $PROJ_DIR$\..\..\test\system\src\Model.c +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.h +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c +- $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c +- $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\TimerConductor.c +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c +- $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\TimerHardware.c +- $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\..\..\examples\src\AdcModel.h +- $PROJ_DIR$\..\..\test\system\src\TimerModel.c +- $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\..\test\system\src\UsartConductor.c +- $PROJ_DIR$\..\..\examples\src\AdcHardware.h +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h +- $PROJ_DIR$\..\..\test\system\src\UsartHardware.c +- $PROJ_DIR$\..\..\test\system\src\UsartModel.c +- $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h +- $PROJ_DIR$\..\..\examples\src\ModelConfig.h +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h +- $PROJ_DIR$\..\..\examples\src\Types.h +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\examples\src\AdcConductor.h +- $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.h +- $PROJ_DIR$\..\..\examples\src\TimerHardware.h +- $PROJ_DIR$\..\..\test\system\src\TimerConductor.h +- $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\..\..\test\system\src\UsartHardware.h +- $PROJ_DIR$\FLASH_Debug\Obj\Main.o +- $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.h +- $PROJ_DIR$\FLASH_Debug\List\TimerHardware.lst +- $PROJ_DIR$\FLASH_Debug\List\ext_irq.lst +- $PROJ_DIR$\FLASH_Debug\Obj\Cstartup.o +- $PROJ_DIR$\FLASH_Debug\Obj\TimerConfigurator.pbi +- $PROJ_DIR$\FLASH_Debug\List\UsartHardware.lst +- $PROJ_DIR$\..\src\ext_irq.c +- $PROJ_DIR$\FLASH_Debug\Obj\interrupt_Usart.o +- $PROJ_DIR$\FLASH_Debug\Obj\interrupt_Usart.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\TimerModel.o +- $PROJ_DIR$\FLASH_Debug\Obj\main.pbi +- $PROJ_DIR$\FLASH_Debug\List\Model.lst +- $PROJ_DIR$\FLASH_Debug\Obj\AdcModel.o +- $PROJ_DIR$\FLASH_Debug\Obj\UsartHardware.o +- $PROJ_DIR$\FLASH_Debug\Obj\UsartPutChar.o +- $PROJ_DIR$\FLASH_Debug\Obj\TemperatureCalculator.pbi +- $PROJ_DIR$\FLASH_Debug\List\AdcConductor.lst +- $PROJ_DIR$\FLASH_Debug\Obj\UsartTransmitBufferStatus.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\AdcConductor.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\Model.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\Cstartup_SAM7.o +- $PROJ_DIR$\FLASH_Debug\Obj\IntrinsicsWrapper.o +- $PROJ_DIR$\FLASH_Debug\Obj\IntrinsicsWrapper.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\AdcHardware.o +- $PROJ_DIR$\FLASH_Debug\Obj\UsartPutChar.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\UsartBaudRateRegisterCalculator.pbi +- $PROJ_DIR$\FLASH_Debug\List\interrupt_timer.lst +- $PROJ_DIR$\FLASH_Debug\List\Cstartup_SAM7.lst +- $PROJ_DIR$\FLASH_Debug\Obj\AdcHardwareConfigurator.o +- $PROJ_DIR$\FLASH_Debug\List\AdcHardwareConfigurator.lst +- $PROJ_DIR$\FLASH_Debug\Obj\TemperatureFilter.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\TimerConductor.pbi +- $PROJ_DIR$\..\..\include\lib_AT91SAM7X256.h +- $PROJ_DIR$\FLASH_Debug\Obj\TaskScheduler.o +- $PROJ_DIR$\FLASH_Debug\Obj\TemperatureFilter.o +- $PROJ_DIR$\FLASH_Debug\Obj\ext_irq.pbi +- $PROJ_DIR$\..\..\include\AT91SAM7X256.h +- $PROJ_DIR$\FLASH_Debug\Obj\AdcModel.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\TimerInterruptConfigurator.o +- $PROJ_DIR$\FLASH_Debug\List\AdcModel.lst +- $PROJ_DIR$\FLASH_Debug\List\interrupt_Usart.lst +- $PROJ_DIR$\FLASH_Debug\List\Cstartup.lst +- $PROJ_DIR$\FLASH_Debug\Obj\UsartHardware.pbi +- $PROJ_DIR$\FLASH_Debug\List\TimerModel.lst +- $PROJ_DIR$\FLASH_Debug\Obj\UsartConductor.o +- $PROJ_DIR$\FLASH_Debug\Obj\UsartConfigurator.o +- $PROJ_DIR$\FLASH_Debug\List\UsartPutChar.lst +- $PROJ_DIR$\FLASH_Debug\List\TemperatureFilter.lst +- $PROJ_DIR$\FLASH_Debug\Obj\TimerInterruptHandler.pbi +- $PROJ_DIR$\FLASH_Debug\List\TemperatureCalculator.lst +- $PROJ_DIR$\FLASH_Debug\List\UsartTransmitBufferStatus.lst +- $PROJ_DIR$\FLASH_Debug\Obj\UsartModel.pbi +- $PROJ_DIR$\FLASH_Debug\List\UsartConductor.lst +- $PROJ_DIR$\FLASH_Debug\List\TimerConfigurator.lst +- $PROJ_DIR$\FLASH_Debug\Obj\Model.o +- $PROJ_DIR$\FLASH_Debug\List\Executor.lst +- $PROJ_DIR$\FLASH_Debug\List\UsartModel.lst +- $PROJ_DIR$\FLASH_Debug\List\TimerInterruptHandler.lst +- $PROJ_DIR$\FLASH_Debug\List\Main.lst +- $PROJ_DIR$\FLASH_Debug\List\TimerInterruptConfigurator.lst +- $PROJ_DIR$\FLASH_Debug\Exe\cmock_demo.out +- $PROJ_DIR$\FLASH_Debug\Obj\TimerHardware.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\TaskScheduler.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\TimerModel.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\AdcConductor.o +- $PROJ_DIR$\FLASH_Debug\Obj\AdcTemperatureSensor.o +- $PROJ_DIR$\..\src\AT91SAM7X-EK.h +- $PROJ_DIR$\FLASH_Debug\Obj\UsartTransmitBufferStatus.o +- $PROJ_DIR$\FLASH_Debug\Obj\AdcHardware.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\UsartBaudRateRegisterCalculator.o +- $PROJ_DIR$\FLASH_Debug\Obj\ext_irq.o +- $PROJ_DIR$\FLASH_Debug\Obj\AdcTemperatureSensor.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\TemperatureCalculator.o +- $PROJ_DIR$\FLASH_Debug\Obj\TimerHardware.o +- $PROJ_DIR$\FLASH_Debug\Obj\UsartModel.o +- $PROJ_DIR$\FLASH_Debug\List\UsartConfigurator.lst +- $PROJ_DIR$\FLASH_Debug\Obj\TimerConductor.o +- $PROJ_DIR$\srcIAR\project.h +- $PROJ_DIR$\FLASH_Debug\List\UsartBaudRateRegisterCalculator.lst +- $PROJ_DIR$\FLASH_Debug\Obj\AdcHardwareConfigurator.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\TimerInterruptHandler.o +- $PROJ_DIR$\FLASH_Debug\List\TimerConductor.lst +- $PROJ_DIR$\FLASH_Debug\Obj\Cstartup_SAM7.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\UsartConductor.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\UsartConfigurator.pbi +- $PROJ_DIR$\FLASH_Debug\Obj\Executor.o +- $PROJ_DIR$\FLASH_Debug\List\AdcHardware.lst +- $PROJ_DIR$\FLASH_Debug\Obj\Executor.pbi +- $PROJ_DIR$\..\src\interrupt_timer.c +- $PROJ_DIR$\..\src\interrupt_Usart.c +- $PROJ_DIR$\FLASH_Debug\Obj\TimerInterruptConfigurator.pbi +- $PROJ_DIR$\..\src\main.c +- $PROJ_DIR$\FLASH_Debug\Obj\TimerConfigurator.o +- $PROJ_DIR$\FLASH_Debug\List\AdcTemperatureSensor.lst +- $PROJ_DIR$\FLASH_Debug\List\TaskScheduler.lst +- $PROJ_DIR$\FLASH_Debug\Obj\interrupt_timer.o +- $PROJ_DIR$\FLASH_Debug\List\IntrinsicsWrapper.lst +- $PROJ_DIR$\FLASH_Debug\Obj\interrupt_timer.pbi +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\..\examples\src\Executor.c +- $PROJ_DIR$\..\..\examples\src\Main.c +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- $PROJ_DIR$\..\..\examples\src\Model.c +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- $PROJ_DIR$\Resource\at91SAM7X256_FLASH.icf +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- $PROJ_DIR$\srcIAR\Cstartup.s +- $PROJ_DIR$\incIAR\AT91SAM7X-EK.h +- $PROJ_DIR$\incIAR\lib_AT91SAM7X256.h +- $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h +- +- +- [ROOT_NODE] +- +- +- ILINK +- 154 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c +- +- +- BICOMP +- 165 +- +- +- ICCARM +- 187 159 +- +- +- +- +- ICCARM +- 28 13 35 +- +- +- +- +- $PROJ_DIR$\FLASH_Debug\Obj\cmock_demo.pbd +- +- +- BILINK +- 112 162 173 131 165 176 181 116 113 156 109 124 125 98 155 184 142 157 119 177 178 136 145 118 111 104 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\Main.c +- +- +- BICOMP +- 104 +- +- +- ICCARM +- 152 93 +- +- +- +- +- ICCARM +- 28 13 8 39 20 18 27 26 92 41 19 31 17 91 90 36 29 2 7 3 34 38 94 35 37 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c +- +- +- BICOMP +- 173 +- +- +- ICCARM +- 123 122 +- +- +- +- +- ICCARM +- 28 13 94 23 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcConductor.c +- +- +- BICOMP +- 112 +- +- +- ICCARM +- 110 158 +- +- +- +- +- ICCARM +- 28 13 34 37 38 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcHardware.c +- +- +- BICOMP +- 162 +- +- +- ICCARM +- 180 117 +- +- +- +- +- ICCARM +- 28 13 38 94 35 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcModel.c +- +- +- BICOMP +- 131 +- +- +- ICCARM +- 133 106 +- +- +- +- +- ICCARM +- 28 13 37 20 18 27 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\Executor.c +- +- +- BICOMP +- 181 +- +- +- ICCARM +- 149 179 +- +- +- +- +- ICCARM +- 28 13 8 39 26 90 34 10 22 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\Model.c +- +- +- BICOMP +- 113 +- +- +- ICCARM +- 105 148 +- +- +- +- +- ICCARM +- 39 28 13 20 27 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c +- +- +- BICOMP +- 124 +- +- +- ICCARM +- 141 128 +- +- +- +- +- ICCARM +- 28 13 27 6 22 4 30 0 25 5 47 1 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c +- +- +- BICOMP +- 98 +- +- +- ICCARM +- 147 186 +- +- +- +- +- ICCARM +- 28 13 29 2 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c +- +- +- BICOMP +- 109 +- +- +- ICCARM +- 143 166 +- +- +- +- +- ICCARM +- 28 13 18 6 22 4 30 0 25 5 47 1 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c +- +- +- BICOMP +- 156 +- +- +- ICCARM +- 188 127 +- +- +- +- +- ICCARM +- 28 13 20 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c +- +- +- BICOMP +- 184 +- +- +- ICCARM +- 153 132 +- +- +- +- +- ICCARM +- 28 13 2 7 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerConductor.c +- +- +- BICOMP +- 125 +- +- +- ICCARM +- 175 170 +- +- +- +- +- ICCARM +- 28 13 90 3 36 7 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c +- +- +- BICOMP +- 142 +- +- +- ICCARM +- 151 174 +- +- +- +- +- ICCARM +- 28 13 7 2 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c +- +- +- BICOMP +- 178 +- +- +- ICCARM +- 169 139 +- +- +- +- +- ICCARM +- 28 13 41 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerHardware.c +- +- +- BICOMP +- 155 +- +- +- ICCARM +- 95 167 +- +- +- +- +- ICCARM +- 28 13 36 29 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c +- +- +- BICOMP +- 111 +- +- +- ICCARM +- 144 161 +- +- +- +- +- ICCARM +- 28 13 91 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerModel.c +- +- +- BICOMP +- 157 +- +- +- ICCARM +- 137 103 +- +- +- +- +- ICCARM +- 28 13 3 20 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c +- +- +- BICOMP +- 119 +- +- +- ICCARM +- 172 163 +- +- +- +- +- ICCARM +- 28 13 17 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartConductor.c +- +- +- BICOMP +- 177 +- +- +- ICCARM +- 146 138 +- +- +- +- +- ICCARM +- 28 13 26 92 31 20 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartHardware.c +- +- +- BICOMP +- 136 +- +- +- ICCARM +- 99 107 +- +- +- +- +- ICCARM +- 28 13 92 41 19 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartModel.c +- +- +- BICOMP +- 145 +- +- +- ICCARM +- 150 168 +- +- +- +- +- ICCARM +- 28 13 31 23 17 27 24 22 30 0 25 5 47 1 33 6 4 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c +- +- +- BICOMP +- 118 +- +- +- ICCARM +- 140 108 +- +- +- +- +- ICCARM +- 28 13 19 91 +- +- +- +- +- $PROJ_DIR$\..\src\ext_irq.c +- +- +- BICOMP +- 129 +- +- +- ICCARM +- 96 164 +- +- +- +- +- BICOMP +- 171 10 22 160 130 126 +- +- +- ICCARM +- 171 10 22 160 130 126 +- +- +- +- +- $PROJ_DIR$\FLASH_Debug\Exe\cmock_demo.out +- +- +- ILINK +- 203 158 117 122 106 159 97 114 179 115 93 148 127 166 128 170 186 167 132 174 103 163 138 139 107 168 108 161 40 32 21 +- +- +- +- +- $PROJ_DIR$\..\src\interrupt_timer.c +- +- +- BICOMP +- 191 +- +- +- ICCARM +- 120 189 +- +- +- +- +- BICOMP +- 171 10 22 160 130 126 +- +- +- ICCARM +- 171 10 22 160 130 126 +- +- +- +- +- $PROJ_DIR$\..\src\interrupt_Usart.c +- +- +- BICOMP +- 102 +- +- +- ICCARM +- 134 101 +- +- +- +- +- BICOMP +- 171 10 22 160 130 126 +- +- +- ICCARM +- 171 10 22 160 130 126 +- +- +- +- +- $PROJ_DIR$\..\src\main.c +- +- +- BICOMP +- 104 +- +- +- ICCARM +- 152 93 +- +- +- +- +- BICOMP +- 171 10 22 160 130 126 +- +- +- ICCARM +- 171 10 22 160 130 126 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- BICOMP +- 176 +- +- +- ICCARM +- 121 114 +- +- +- +- +- BICOMP +- 9 10 22 220 221 +- +- +- ICCARM +- 9 10 22 220 87 221 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- +- +- BICOMP +- 173 +- +- +- ICCARM +- 123 122 +- +- +- +- +- BICOMP +- 84 87 83 82 +- +- +- ICCARM +- 84 87 83 82 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- +- +- BICOMP +- 112 +- +- +- ICCARM +- 110 158 +- +- +- +- +- BICOMP +- 84 87 86 72 76 +- +- +- ICCARM +- 84 87 86 72 76 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- +- +- BICOMP +- 162 +- +- +- ICCARM +- 180 117 +- +- +- +- +- BICOMP +- 84 87 76 83 81 +- +- +- ICCARM +- 84 87 76 83 81 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- +- +- BICOMP +- 131 +- +- +- ICCARM +- 133 106 +- +- +- +- +- BICOMP +- 84 87 72 88 85 77 +- +- +- ICCARM +- 84 87 72 88 85 77 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- +- +- BICOMP +- 165 +- +- +- ICCARM +- 187 159 +- +- +- +- +- BICOMP +- 84 87 81 +- +- +- ICCARM +- 84 87 81 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Executor.c +- +- +- BICOMP +- 181 +- +- +- ICCARM +- 149 179 +- +- +- +- +- BICOMP +- 84 87 42 57 44 46 86 59 +- +- +- ICCARM +- 84 87 42 57 44 46 86 59 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Main.c +- +- +- BICOMP +- 104 +- +- +- ICCARM +- 152 93 +- +- +- +- +- BICOMP +- 84 87 59 42 57 88 85 77 44 14 15 60 12 11 16 46 89 43 61 55 53 86 76 83 81 72 +- +- +- ICCARM +- 84 87 59 42 57 88 85 77 44 14 15 60 12 11 16 46 89 43 61 55 53 86 76 83 81 72 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- +- +- BICOMP +- 116 +- +- +- ICCARM +- 190 115 +- +- +- +- +- BICOMP +- 59 10 22 +- +- +- ICCARM +- 59 10 22 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Model.c +- +- +- BICOMP +- 113 +- +- +- ICCARM +- 105 148 +- +- +- +- +- BICOMP +- 57 84 87 88 77 +- +- +- ICCARM +- 57 84 87 88 77 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- +- +- BICOMP +- 109 +- +- +- ICCARM +- 143 166 +- +- +- +- +- BICOMP +- 84 87 85 6 22 4 30 0 5 47 1 +- +- +- ICCARM +- 84 87 85 6 22 4 30 0 25 5 47 1 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- +- +- BICOMP +- 156 +- +- +- ICCARM +- 188 127 +- +- +- +- +- BICOMP +- 84 87 88 +- +- +- ICCARM +- 84 87 88 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- +- +- BICOMP +- 184 +- +- +- ICCARM +- 153 132 +- +- +- +- +- BICOMP +- 84 87 61 55 +- +- +- ICCARM +- 84 87 61 55 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- +- +- BICOMP +- 124 +- +- +- ICCARM +- 141 128 +- +- +- +- +- BICOMP +- 84 87 77 6 22 4 30 0 5 47 1 +- +- +- ICCARM +- 84 87 77 6 22 4 30 0 25 5 47 1 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- +- +- BICOMP +- 125 +- +- +- ICCARM +- 175 170 +- +- +- +- +- BICOMP +- 84 87 46 53 89 55 +- +- +- ICCARM +- 84 87 46 53 89 55 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- +- +- BICOMP +- 98 +- +- +- ICCARM +- 147 186 +- +- +- +- +- BICOMP +- 84 87 43 61 +- +- +- ICCARM +- 84 87 43 61 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- +- +- BICOMP +- 155 +- +- +- ICCARM +- 95 167 +- +- +- +- +- BICOMP +- 84 87 89 43 +- +- +- ICCARM +- 84 87 89 43 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- +- +- BICOMP +- 142 +- +- +- ICCARM +- 151 174 +- +- +- +- +- BICOMP +- 84 87 55 61 +- +- +- ICCARM +- 84 87 55 61 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- +- +- BICOMP +- 157 +- +- +- ICCARM +- 137 103 +- +- +- +- +- BICOMP +- 84 87 53 88 +- +- +- ICCARM +- 84 87 53 88 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- +- +- BICOMP +- 145 +- +- +- ICCARM +- 150 168 +- +- +- +- +- ICCARM +- 84 87 12 82 11 77 24 22 30 0 25 5 47 1 33 6 4 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- +- +- BICOMP +- 119 +- +- +- ICCARM +- 172 163 +- +- +- +- +- BICOMP +- 84 87 11 +- +- +- ICCARM +- 84 87 11 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- +- +- BICOMP +- 177 +- +- +- ICCARM +- 146 138 +- +- +- +- +- BICOMP +- 84 87 44 14 12 88 +- +- +- ICCARM +- 84 87 44 14 12 88 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- +- +- BICOMP +- 178 +- +- +- ICCARM +- 169 139 +- +- +- +- +- BICOMP +- 84 87 15 +- +- +- ICCARM +- 84 87 15 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- +- +- BICOMP +- 136 +- +- +- ICCARM +- 99 107 +- +- +- +- +- BICOMP +- 84 87 14 15 60 +- +- +- ICCARM +- 84 87 14 15 60 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- +- +- BICOMP +- 111 +- +- +- ICCARM +- 144 161 +- +- +- +- +- ICCARM +- 84 87 16 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- +- +- BICOMP +- 118 +- +- +- ICCARM +- 140 108 +- +- +- +- +- ICCARM +- 84 87 60 16 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup.s +- +- +- AARM +- 97 135 +- +- +- +- +- AARM +- 222 +- +- +- +- +- +- RAM_Debug +- +- $PROJ_DIR$\Resource\SAM7_FLASH.mac +- $TOOLKIT_DIR$\inc\DLib_Defaults.h +- $TOOLKIT_DIR$\inc\DLib_Threads.h +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\..\..\test\system\src\TimerModel.h +- $TOOLKIT_DIR$\inc\ymath.h +- $TOOLKIT_DIR$\inc\DLib_Product.h +- $TOOLKIT_DIR$\inc\math.h +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.h +- $PROJ_DIR$\..\..\test\system\src\Executor.h +- $PROJ_DIR$\incIAR\project.h +- $TOOLKIT_DIR$\inc\intrinsics.h +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.h +- $PROJ_DIR$\..\..\examples\src\UsartModel.h +- $PROJ_DIR$\..\..\test\system\src\AT91SAM7X256.h +- $PROJ_DIR$\..\..\examples\src\UsartHardware.h +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.h +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.h +- $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\test\system\src\UsartPutChar.h +- $PROJ_DIR$\..\..\test\system\src\TaskScheduler.h +- $TOOLKIT_DIR$\lib\dl4t_tl_in.a +- $TOOLKIT_DIR$\inc\ycheck.h +- $PROJ_DIR$\..\..\test\system\src\ModelConfig.h +- $TOOLKIT_DIR$\inc\stdio.h +- $TOOLKIT_DIR$\inc\DLib_Config_Normal.h +- $PROJ_DIR$\..\..\test\system\src\UsartConductor.h +- $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.h +- $PROJ_DIR$\..\..\test\system\src\Types.h +- $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.h +- $TOOLKIT_DIR$\inc\yvals.h +- $PROJ_DIR$\..\..\test\system\src\UsartModel.h +- $TOOLKIT_DIR$\lib\rt4t_al.a +- $TOOLKIT_DIR$\inc\ysizet.h +- $PROJ_DIR$\..\..\test\system\src\AdcConductor.h +- $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.h +- $PROJ_DIR$\..\..\test\system\src\TimerHardware.h +- $PROJ_DIR$\..\..\test\system\src\AdcModel.h +- $PROJ_DIR$\..\..\test\system\src\AdcHardware.h +- $PROJ_DIR$\..\..\test\system\src\Model.h +- $TOOLKIT_DIR$\lib\shs_l.a +- $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.h +- $PROJ_DIR$\..\..\examples\src\Executor.h +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.h +- $PROJ_DIR$\..\..\examples\src\UsartConductor.h +- $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\..\examples\src\TimerConductor.h +- $TOOLKIT_DIR$\inc\xencoding_limits.h +- $PROJ_DIR$\..\..\test\system\src\Main.c +- $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\AdcConductor.c +- $PROJ_DIR$\..\..\test\system\src\AdcHardware.c +- $PROJ_DIR$\..\..\examples\src\TimerModel.h +- $PROJ_DIR$\..\..\test\system\src\AdcModel.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.h +- $PROJ_DIR$\..\..\test\system\src\Executor.c +- $PROJ_DIR$\..\..\examples\src\Model.h +- $PROJ_DIR$\..\..\test\system\src\Model.c +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.h +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.h +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.h +- $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c +- $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c +- $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\TimerConductor.c +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c +- $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c +- $PROJ_DIR$\..\..\test\system\src\TimerHardware.c +- $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\..\..\examples\src\AdcModel.h +- $PROJ_DIR$\..\..\test\system\src\TimerModel.c +- $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\..\test\system\src\UsartConductor.c +- $PROJ_DIR$\..\..\examples\src\AdcHardware.h +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.h +- $PROJ_DIR$\..\..\test\system\src\UsartHardware.c +- $PROJ_DIR$\..\..\test\system\src\UsartModel.c +- $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.h +- $PROJ_DIR$\..\..\examples\src\ModelConfig.h +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.h +- $PROJ_DIR$\..\..\examples\src\Types.h +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.h +- $PROJ_DIR$\..\..\examples\src\AdcConductor.h +- $PROJ_DIR$\..\..\examples\src\AT91SAM7X256.h +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.h +- $PROJ_DIR$\..\..\examples\src\TimerHardware.h +- $PROJ_DIR$\..\..\test\system\src\TimerConductor.h +- $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.h +- $PROJ_DIR$\..\..\test\system\src\UsartHardware.h +- $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.h +- $PROJ_DIR$\..\src\ext_irq.c +- $PROJ_DIR$\..\src\interrupt_timer.c +- $PROJ_DIR$\..\src\interrupt_Usart.c +- $PROJ_DIR$\..\src\main.c +- $PROJ_DIR$\RAM_Debug\Obj\UsartConductor.o +- $PROJ_DIR$\RAM_Debug\List\AdcConductor.lst +- $PROJ_DIR$\RAM_Debug\List\TimerInterruptHandler.lst +- $PROJ_DIR$\RAM_Debug\List\AdcHardwareConfigurator.lst +- $PROJ_DIR$\RAM_Debug\Obj\TimerHardware.pbi +- $PROJ_DIR$\RAM_Debug\Obj\UsartHardware.pbi +- $PROJ_DIR$\RAM_Debug\Obj\UsartConductor.pbi +- $PROJ_DIR$\RAM_Debug\List\TimerConfigurator.lst +- $PROJ_DIR$\RAM_Debug\List\UsartPutChar.lst +- $PROJ_DIR$\RAM_Debug\Obj\TimerConductor.o +- $PROJ_DIR$\RAM_Debug\Obj\TimerConfigurator.o +- $PROJ_DIR$\RAM_Debug\Obj\UsartBaudRateRegisterCalculator.pbi +- $PROJ_DIR$\RAM_Debug\Obj\AdcHardwareConfigurator.o +- $PROJ_DIR$\RAM_Debug\List\AdcModel.lst +- $PROJ_DIR$\RAM_Debug\List\TimerConductor.lst +- $PROJ_DIR$\RAM_Debug\List\TimerHardware.lst +- $PROJ_DIR$\RAM_Debug\Obj\AdcHardware.o +- $PROJ_DIR$\RAM_Debug\List\TemperatureFilter.lst +- $PROJ_DIR$\RAM_Debug\Obj\AdcModel.pbi +- $PROJ_DIR$\RAM_Debug\List\IntrinsicsWrapper.lst +- $PROJ_DIR$\RAM_Debug\Obj\Cstartup.o +- $PROJ_DIR$\RAM_Debug\Obj\interrupt_Usart.o +- $PROJ_DIR$\RAM_Debug\Obj\AdcHardwareConfigurator.pbi +- $PROJ_DIR$\RAM_Debug\Obj\main.pbi +- $PROJ_DIR$\RAM_Debug\List\AdcTemperatureSensor.lst +- $PROJ_DIR$\RAM_Debug\Obj\TimerInterruptHandler.pbi +- $PROJ_DIR$\RAM_Debug\List\Model.lst +- $PROJ_DIR$\RAM_Debug\Obj\Model.pbi +- $PROJ_DIR$\RAM_Debug\Obj\AdcHardware.pbi +- $PROJ_DIR$\RAM_Debug\List\UsartBaudRateRegisterCalculator.lst +- $PROJ_DIR$\RAM_Debug\Obj\ext_irq.o +- $PROJ_DIR$\RAM_Debug\Obj\TimerInterruptHandler.o +- $PROJ_DIR$\RAM_Debug\List\Cstartup.lst +- $PROJ_DIR$\RAM_Debug\Obj\TimerConfigurator.pbi +- $PROJ_DIR$\RAM_Debug\Obj\Cstartup_SAM7.o +- $PROJ_DIR$\RAM_Debug\Obj\AdcTemperatureSensor.pbi +- $PROJ_DIR$\RAM_Debug\List\UsartConfigurator.lst +- $PROJ_DIR$\RAM_Debug\List\UsartTransmitBufferStatus.lst +- $PROJ_DIR$\RAM_Debug\Obj\UsartPutChar.pbi +- $PROJ_DIR$\RAM_Debug\List\TaskScheduler.lst +- $PROJ_DIR$\RAM_Debug\Obj\interrupt_timer.pbi +- $PROJ_DIR$\RAM_Debug\List\UsartHardware.lst +- $PROJ_DIR$\RAM_Debug\Obj\TaskScheduler.pbi +- $PROJ_DIR$\RAM_Debug\Obj\Cstartup_SAM7.pbi +- $PROJ_DIR$\RAM_Debug\List\Cstartup_SAM7.lst +- $PROJ_DIR$\RAM_Debug\Obj\UsartTransmitBufferStatus.o +- $PROJ_DIR$\RAM_Debug\Obj\TimerModel.pbi +- $PROJ_DIR$\RAM_Debug\List\UsartConductor.lst +- $PROJ_DIR$\RAM_Debug\Obj\UsartPutChar.o +- $PROJ_DIR$\RAM_Debug\Obj\TimerInterruptConfigurator.pbi +- $PROJ_DIR$\RAM_Debug\Obj\TimerHardware.o +- $PROJ_DIR$\RAM_Debug\Obj\AdcTemperatureSensor.o +- $PROJ_DIR$\RAM_Debug\Obj\AdcModel.o +- $PROJ_DIR$\RAM_Debug\Obj\Executor.pbi +- $PROJ_DIR$\RAM_Debug\Obj\TemperatureFilter.o +- $PROJ_DIR$\RAM_Debug\Obj\AdcConductor.pbi +- $PROJ_DIR$\RAM_Debug\List\TimerInterruptConfigurator.lst +- $PROJ_DIR$\RAM_Debug\List\UsartModel.lst +- $PROJ_DIR$\RAM_Debug\Obj\UsartConfigurator.o +- $PROJ_DIR$\RAM_Debug\Obj\cmock_demo.pbd +- $PROJ_DIR$\RAM_Debug\Exe\cmock_demo.out +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- $PROJ_DIR$\RAM_Debug\List\TemperatureCalculator.lst +- $PROJ_DIR$\RAM_Debug\List\AdcHardware.lst +- $PROJ_DIR$\RAM_Debug\List\Executor.lst +- $PROJ_DIR$\RAM_Debug\Obj\UsartModel.pbi +- $PROJ_DIR$\RAM_Debug\Obj\TimerConductor.pbi +- $PROJ_DIR$\RAM_Debug\Obj\UsartConfigurator.pbi +- $PROJ_DIR$\RAM_Debug\Obj\UsartHardware.o +- $PROJ_DIR$\RAM_Debug\Obj\TemperatureCalculator.o +- $PROJ_DIR$\RAM_Debug\Obj\AdcConductor.o +- $PROJ_DIR$\RAM_Debug\Obj\IntrinsicsWrapper.o +- $PROJ_DIR$\RAM_Debug\Obj\Model.o +- $PROJ_DIR$\RAM_Debug\Obj\UsartTransmitBufferStatus.pbi +- $PROJ_DIR$\RAM_Debug\Obj\TimerModel.o +- $PROJ_DIR$\RAM_Debug\Obj\Executor.o +- $PROJ_DIR$\RAM_Debug\Obj\TemperatureCalculator.pbi +- $PROJ_DIR$\RAM_Debug\Obj\UsartBaudRateRegisterCalculator.o +- $PROJ_DIR$\RAM_Debug\Obj\TimerInterruptConfigurator.o +- $PROJ_DIR$\RAM_Debug\Obj\interrupt_Usart.pbi +- $PROJ_DIR$\RAM_Debug\Obj\TaskScheduler.o +- $PROJ_DIR$\RAM_Debug\Obj\Main.o +- $PROJ_DIR$\RAM_Debug\Obj\ext_irq.pbi +- $PROJ_DIR$\RAM_Debug\List\Main.lst +- $PROJ_DIR$\RAM_Debug\List\TimerModel.lst +- $PROJ_DIR$\RAM_Debug\Obj\interrupt_timer.o +- $PROJ_DIR$\RAM_Debug\Obj\UsartModel.o +- $PROJ_DIR$\RAM_Debug\Obj\TemperatureFilter.pbi +- $PROJ_DIR$\RAM_Debug\Obj\IntrinsicsWrapper.pbi +- $PROJ_DIR$\Resource\at91SAM7X256_RAM.icf +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- $PROJ_DIR$\..\..\examples\src\Executor.c +- $PROJ_DIR$\..\..\examples\src\Main.c +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- $PROJ_DIR$\..\..\examples\src\Model.c +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- $PROJ_DIR$\Resource\SAM7_RAM.mac +- $PROJ_DIR$\Resource\at91SAM7X256_FLASH.icf +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- $PROJ_DIR$\srcIAR\Cstartup.s +- $PROJ_DIR$\incIAR\AT91SAM7X-EK.h +- $PROJ_DIR$\incIAR\lib_AT91SAM7X256.h +- $PROJ_DIR$\incIAR\AT91SAM7X256_inc.h +- +- +- [ROOT_NODE] +- +- +- ILINK +- 158 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcTemperatureSensor.c +- +- +- BICOMP +- 133 +- +- +- ICCARM +- 122 149 +- +- +- +- +- BICOMP +- 29 14 36 +- +- +- ICCARM +- 29 14 36 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\Main.c +- +- +- BICOMP +- 121 +- +- +- ICCARM +- 181 179 +- +- +- +- +- BICOMP +- 29 14 9 40 21 19 28 27 92 42 20 32 18 91 90 37 30 3 8 4 35 39 93 36 38 +- +- +- ICCARM +- 29 14 9 40 21 19 28 27 92 42 20 32 18 91 90 37 30 3 8 4 35 39 93 36 38 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcHardwareConfigurator.c +- +- +- BICOMP +- 120 +- +- +- ICCARM +- 101 110 +- +- +- +- +- BICOMP +- 29 14 93 24 +- +- +- ICCARM +- 29 14 93 24 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcConductor.c +- +- +- BICOMP +- 153 +- +- +- ICCARM +- 99 168 +- +- +- +- +- BICOMP +- 29 14 35 38 39 +- +- +- ICCARM +- 29 14 35 38 39 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcHardware.c +- +- +- BICOMP +- 126 +- +- +- ICCARM +- 161 114 +- +- +- +- +- BICOMP +- 29 14 39 93 36 +- +- +- ICCARM +- 29 14 39 93 36 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\AdcModel.c +- +- +- BICOMP +- 116 +- +- +- ICCARM +- 111 150 +- +- +- +- +- BICOMP +- 29 14 38 21 19 28 +- +- +- ICCARM +- 29 14 38 21 19 28 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\Executor.c +- +- +- BICOMP +- 151 +- +- +- ICCARM +- 162 173 +- +- +- +- +- BICOMP +- 29 14 9 40 27 90 35 11 23 +- +- +- ICCARM +- 29 14 9 40 27 90 35 11 23 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\Model.c +- +- +- BICOMP +- 125 +- +- +- ICCARM +- 124 170 +- +- +- +- +- BICOMP +- 40 29 14 21 28 +- +- +- ICCARM +- 40 29 14 21 28 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TemperatureFilter.c +- +- +- BICOMP +- 185 +- +- +- ICCARM +- 115 152 +- +- +- +- +- BICOMP +- 29 14 28 7 23 5 31 1 6 48 2 +- +- +- ICCARM +- 29 14 28 7 23 5 31 1 26 6 48 2 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerConfigurator.c +- +- +- BICOMP +- 131 +- +- +- ICCARM +- 105 108 +- +- +- +- +- BICOMP +- 29 14 30 3 +- +- +- ICCARM +- 29 14 30 3 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TemperatureCalculator.c +- +- +- BICOMP +- 174 +- +- +- ICCARM +- 160 167 +- +- +- +- +- BICOMP +- 29 14 19 7 23 5 31 1 6 48 2 +- +- +- ICCARM +- 29 14 19 7 23 5 31 1 26 6 48 2 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TaskScheduler.c +- +- +- BICOMP +- 140 +- +- +- ICCARM +- 137 178 +- +- +- +- +- BICOMP +- 29 14 21 +- +- +- ICCARM +- 29 14 21 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptConfigurator.c +- +- +- BICOMP +- 147 +- +- +- ICCARM +- 154 176 +- +- +- +- +- BICOMP +- 29 14 3 8 +- +- +- ICCARM +- 29 14 3 8 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerConductor.c +- +- +- BICOMP +- 164 +- +- +- ICCARM +- 112 107 +- +- +- +- +- BICOMP +- 29 14 90 4 37 8 +- +- +- ICCARM +- 29 14 90 4 37 8 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerInterruptHandler.c +- +- +- BICOMP +- 123 +- +- +- ICCARM +- 100 129 +- +- +- +- +- BICOMP +- 29 14 8 3 +- +- +- ICCARM +- 29 14 8 3 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartConfigurator.c +- +- +- BICOMP +- 165 +- +- +- ICCARM +- 134 156 +- +- +- +- +- BICOMP +- 29 14 42 +- +- +- ICCARM +- 29 14 42 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerHardware.c +- +- +- BICOMP +- 102 +- +- +- ICCARM +- 113 148 +- +- +- +- +- BICOMP +- 29 14 37 30 +- +- +- ICCARM +- 29 14 37 30 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartTransmitBufferStatus.c +- +- +- BICOMP +- 171 +- +- +- ICCARM +- 135 143 +- +- +- +- +- BICOMP +- 29 14 91 +- +- +- ICCARM +- 29 14 91 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\TimerModel.c +- +- +- BICOMP +- 144 +- +- +- ICCARM +- 182 172 +- +- +- +- +- BICOMP +- 29 14 4 21 +- +- +- ICCARM +- 29 14 4 21 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartBaudRateRegisterCalculator.c +- +- +- BICOMP +- 109 +- +- +- ICCARM +- 127 175 +- +- +- +- +- BICOMP +- 29 14 18 +- +- +- ICCARM +- 29 14 18 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartConductor.c +- +- +- BICOMP +- 104 +- +- +- ICCARM +- 145 98 +- +- +- +- +- BICOMP +- 29 14 27 92 32 21 +- +- +- ICCARM +- 29 14 27 92 32 21 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartHardware.c +- +- +- BICOMP +- 103 +- +- +- ICCARM +- 139 166 +- +- +- +- +- BICOMP +- 29 14 92 42 20 +- +- +- ICCARM +- 29 14 92 42 20 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartModel.c +- +- +- BICOMP +- 163 +- +- +- ICCARM +- 155 184 +- +- +- +- +- BICOMP +- 29 14 32 24 18 28 25 23 31 1 6 48 2 34 7 5 +- +- +- ICCARM +- 29 14 32 24 18 28 25 23 31 1 26 6 48 2 34 7 5 +- +- +- +- +- $PROJ_DIR$\..\..\test\system\src\UsartPutChar.c +- +- +- BICOMP +- 136 +- +- +- ICCARM +- 106 146 +- +- +- +- +- BICOMP +- 29 14 20 91 +- +- +- ICCARM +- 29 14 20 91 +- +- +- +- +- $PROJ_DIR$\..\src\ext_irq.c +- +- +- BICOMP +- 180 +- +- +- ICCARM +- 128 +- +- +- +- +- $PROJ_DIR$\..\src\interrupt_timer.c +- +- +- BICOMP +- 138 +- +- +- ICCARM +- 183 +- +- +- +- +- $PROJ_DIR$\..\src\interrupt_Usart.c +- +- +- BICOMP +- 177 +- +- +- ICCARM +- 119 +- +- +- +- +- $PROJ_DIR$\..\src\main.c +- +- +- BICOMP +- 121 +- +- +- ICCARM +- 179 +- +- +- +- +- $PROJ_DIR$\RAM_Debug\Obj\cmock_demo.pbd +- +- +- BILINK +- 153 126 120 116 133 141 151 186 125 140 174 185 164 131 102 147 123 144 109 104 165 103 163 136 171 121 +- +- +- +- +- $PROJ_DIR$\RAM_Debug\Exe\cmock_demo.out +- +- +- ILINK +- 187 168 114 110 150 149 118 132 173 169 179 170 178 167 152 107 108 148 176 129 172 175 98 156 166 184 146 143 41 33 22 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- BICOMP +- 141 +- +- +- ICCARM +- 142 132 +- +- +- +- +- BICOMP +- 10 11 23 216 87 217 +- +- +- ICCARM +- 10 11 23 216 87 217 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- +- +- BICOMP +- 120 +- +- +- ICCARM +- 101 110 +- +- +- +- +- BICOMP +- 84 87 83 82 +- +- +- ICCARM +- 84 87 83 82 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- +- +- BICOMP +- 153 +- +- +- ICCARM +- 99 168 +- +- +- +- +- BICOMP +- 84 87 86 72 76 +- +- +- ICCARM +- 84 87 86 72 76 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- +- +- BICOMP +- 126 +- +- +- ICCARM +- 161 114 +- +- +- +- +- BICOMP +- 84 87 76 83 81 +- +- +- ICCARM +- 84 87 76 83 81 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- +- +- BICOMP +- 116 +- +- +- ICCARM +- 111 150 +- +- +- +- +- BICOMP +- 84 87 72 88 85 77 +- +- +- ICCARM +- 84 87 72 88 85 77 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- +- +- BICOMP +- 133 +- +- +- ICCARM +- 122 149 +- +- +- +- +- BICOMP +- 84 87 81 +- +- +- ICCARM +- 84 87 81 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Executor.c +- +- +- BICOMP +- 151 +- +- +- ICCARM +- 162 173 +- +- +- +- +- BICOMP +- 84 87 43 57 45 47 86 59 +- +- +- ICCARM +- 84 87 43 57 45 47 86 59 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Main.c +- +- +- BICOMP +- 121 +- +- +- ICCARM +- 181 179 +- +- +- +- +- BICOMP +- 84 87 59 43 57 88 85 77 45 15 16 60 13 12 17 47 89 44 61 55 53 86 76 83 81 72 +- +- +- ICCARM +- 84 87 59 43 57 88 85 77 45 15 16 60 13 12 17 47 89 44 61 55 53 86 76 83 81 72 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- +- +- BICOMP +- 186 +- +- +- ICCARM +- 117 169 +- +- +- +- +- BICOMP +- 59 11 23 +- +- +- ICCARM +- 59 11 23 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\Model.c +- +- +- BICOMP +- 125 +- +- +- ICCARM +- 124 170 +- +- +- +- +- BICOMP +- 57 84 87 88 77 +- +- +- ICCARM +- 57 84 87 88 77 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- +- +- BICOMP +- 174 +- +- +- ICCARM +- 160 167 +- +- +- +- +- BICOMP +- 84 87 85 7 23 5 31 1 6 48 2 +- +- +- ICCARM +- 84 87 85 7 23 5 31 1 26 6 48 2 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- +- +- BICOMP +- 140 +- +- +- ICCARM +- 137 178 +- +- +- +- +- BICOMP +- 84 87 88 +- +- +- ICCARM +- 84 87 88 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- +- +- BICOMP +- 147 +- +- +- ICCARM +- 154 176 +- +- +- +- +- BICOMP +- 84 87 61 55 +- +- +- ICCARM +- 84 87 61 55 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- +- +- BICOMP +- 185 +- +- +- ICCARM +- 115 152 +- +- +- +- +- BICOMP +- 84 87 77 7 23 5 31 1 6 48 2 +- +- +- ICCARM +- 84 87 77 7 23 5 31 1 26 6 48 2 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- +- +- BICOMP +- 164 +- +- +- ICCARM +- 112 107 +- +- +- +- +- BICOMP +- 84 87 47 53 89 55 +- +- +- ICCARM +- 84 87 47 53 89 55 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- +- +- BICOMP +- 131 +- +- +- ICCARM +- 105 108 +- +- +- +- +- BICOMP +- 84 87 44 61 +- +- +- ICCARM +- 84 87 44 61 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- +- +- BICOMP +- 102 +- +- +- ICCARM +- 113 148 +- +- +- +- +- BICOMP +- 84 87 89 44 +- +- +- ICCARM +- 84 87 89 44 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- +- +- BICOMP +- 123 +- +- +- ICCARM +- 100 129 +- +- +- +- +- BICOMP +- 84 87 55 61 +- +- +- ICCARM +- 84 87 55 61 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- +- +- BICOMP +- 144 +- +- +- ICCARM +- 182 172 +- +- +- +- +- BICOMP +- 84 87 53 88 +- +- +- ICCARM +- 84 87 53 88 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- +- +- BICOMP +- 163 +- +- +- ICCARM +- 155 184 +- +- +- +- +- BICOMP +- 84 87 13 82 12 77 25 23 31 1 6 48 2 34 7 5 +- +- +- ICCARM +- 84 87 13 82 12 77 25 23 31 1 26 6 48 2 34 7 5 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- +- +- BICOMP +- 109 +- +- +- ICCARM +- 127 175 +- +- +- +- +- BICOMP +- 84 87 12 +- +- +- ICCARM +- 84 87 12 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- +- +- BICOMP +- 104 +- +- +- ICCARM +- 145 98 +- +- +- +- +- BICOMP +- 84 87 45 15 13 88 +- +- +- ICCARM +- 84 87 45 15 13 88 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- +- +- BICOMP +- 165 +- +- +- ICCARM +- 134 156 +- +- +- +- +- BICOMP +- 84 87 16 +- +- +- ICCARM +- 84 87 16 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- +- +- BICOMP +- 103 +- +- +- ICCARM +- 139 166 +- +- +- +- +- BICOMP +- 84 87 15 16 60 +- +- +- ICCARM +- 84 87 15 16 60 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- +- +- BICOMP +- 171 +- +- +- ICCARM +- 135 143 +- +- +- +- +- BICOMP +- 84 87 17 +- +- +- ICCARM +- 84 87 17 +- +- +- +- +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- +- +- BICOMP +- 136 +- +- +- ICCARM +- 106 146 +- +- +- +- +- BICOMP +- 84 87 60 17 +- +- +- ICCARM +- 84 87 60 17 +- +- +- +- +- $PROJ_DIR$\srcIAR\Cstartup.s +- +- +- AARM +- 118 130 +- +- +- +- +- AARM +- 218 +- +- +- +- +- $PROJ_DIR$\..\src\ext_irq.c +- ICCARM +- +- +- $PROJ_DIR$\..\src\interrupt_timer.c +- ICCARM +- +- +- $PROJ_DIR$\..\src\interrupt_Usart.c +- ICCARM +- +- +- $PROJ_DIR$\..\src\main.c +- ICCARM +- +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewd b/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewd +deleted file mode 100644 +index 2d881366b2..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewd ++++ /dev/null +@@ -1,1906 +0,0 @@ +- +- +- +- 2 +- +- RAM_Debug +- +- ARM +- +- 1 +- +- C-SPY +- 2 +- +- 18 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ARMSIM_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- ANGEL_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- GDBSERVER_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- IARROM_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- JLINK_ID +- 2 +- +- 10 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- LMIFTDI_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- MACRAIGOR_ID +- 2 +- +- 3 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- RDI_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- THIRDPARTY_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin +- 0 +- +- +- $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin +- 0 +- +- +- $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin +- 1 +- +- +- +- +- FLASH_Debug +- +- ARM +- +- 1 +- +- C-SPY +- 2 +- +- 18 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ARMSIM_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- ANGEL_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- GDBSERVER_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- IARROM_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- JLINK_ID +- 2 +- +- 10 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- LMIFTDI_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- MACRAIGOR_ID +- 2 +- +- 3 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- RDI_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- THIRDPARTY_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin +- 0 +- +- +- $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin +- 0 +- +- +- $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin +- 1 +- +- +- +- +- Binary +- +- ARM +- +- 1 +- +- C-SPY +- 2 +- +- 18 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ARMSIM_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- ANGEL_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- GDBSERVER_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- IARROM_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- JLINK_ID +- 2 +- +- 10 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- LMIFTDI_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- MACRAIGOR_ID +- 2 +- +- 3 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- RDI_ID +- 2 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- THIRDPARTY_ID +- 2 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin +- 0 +- +- +- $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin +- 0 +- +- +- $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin +- 0 +- +- +- $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin +- 1 +- +- +- $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin +- 1 +- +- +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewp b/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewp +deleted file mode 100644 +index 4524d91074..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.ewp ++++ /dev/null +@@ -1,2426 +0,0 @@ +- +- +- +- 2 +- +- RAM_Debug +- +- ARM +- +- 1 +- +- General +- 3 +- +- 16 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ICCARM +- 2 +- +- 20 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- AARM +- 2 +- +- 7 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- OBJCOPY +- 0 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- +- CUSTOM +- 3 +- +- +- +- +- +- +- BICOMP +- 0 +- +- +- +- BUILDACTION +- 1 +- +- +- +- +- +- +- ILINK +- 0 +- +- 6 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- IARCHIVE +- 0 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- BILINK +- 0 +- +- +- +- +- FLASH_Debug +- +- ARM +- +- 1 +- +- General +- 3 +- +- 16 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ICCARM +- 2 +- +- 20 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- AARM +- 2 +- +- 7 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- OBJCOPY +- 0 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- +- CUSTOM +- 3 +- +- +- +- +- +- +- BICOMP +- 0 +- +- +- +- BUILDACTION +- 1 +- +- +- +- +- +- +- ILINK +- 0 +- +- 6 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- IARCHIVE +- 0 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- BILINK +- 0 +- +- +- +- +- Binary +- +- ARM +- +- 1 +- +- General +- 3 +- +- 16 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ICCARM +- 2 +- +- 20 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- AARM +- 2 +- +- 7 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- OBJCOPY +- 0 +- +- 1 +- 1 +- 1 +- +- +- +- +- +- +- +- +- CUSTOM +- 3 +- +- +- +- +- +- +- BICOMP +- 0 +- +- +- +- BUILDACTION +- 1 +- +- +- +- +- +- +- ILINK +- 0 +- +- 6 +- 1 +- 1 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- IARCHIVE +- 0 +- +- 0 +- 1 +- 1 +- +- +- +- +- +- +- BILINK +- 0 +- +- +- +- +- Binary +- +- +- Resource +- +- $PROJ_DIR$\Resource\at91SAM7X256_FLASH.icf +- +- +- $PROJ_DIR$\Resource\at91SAM7X256_RAM.icf +- +- +- $PROJ_DIR$\Resource\SAM7_FLASH.mac +- +- +- $PROJ_DIR$\Resource\SAM7_RAM.mac +- +- +- +- Source +- +- $PROJ_DIR$\..\..\examples\src\AdcConductor.c +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardware.c +- +- +- $PROJ_DIR$\..\..\examples\src\AdcHardwareConfigurator.c +- +- +- $PROJ_DIR$\..\..\examples\src\AdcModel.c +- +- +- $PROJ_DIR$\..\..\examples\src\AdcTemperatureSensor.c +- +- +- $PROJ_DIR$\..\..\examples\src\Executor.c +- +- +- $PROJ_DIR$\..\..\examples\src\IntrinsicsWrapper.c +- +- +- $PROJ_DIR$\..\..\examples\src\Main.c +- +- +- $PROJ_DIR$\..\..\examples\src\Model.c +- +- +- $PROJ_DIR$\..\..\examples\src\TaskScheduler.c +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureCalculator.c +- +- +- $PROJ_DIR$\..\..\examples\src\TemperatureFilter.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConductor.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerConfigurator.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerHardware.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptConfigurator.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerInterruptHandler.c +- +- +- $PROJ_DIR$\..\..\examples\src\TimerModel.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartBaudRateRegisterCalculator.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConductor.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartConfigurator.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartHardware.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartModel.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartPutChar.c +- +- +- $PROJ_DIR$\..\..\examples\src\UsartTransmitBufferStatus.c +- +- +- +- Startup +- +- $PROJ_DIR$\srcIAR\Cstartup.s +- +- +- $PROJ_DIR$\srcIAR\Cstartup_SAM7.c +- +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.eww b/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.eww +deleted file mode 100644 +index cbf8dd8dee..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/cmock_demo.eww ++++ /dev/null +@@ -1,26 +0,0 @@ +- +- +- +- +- $WS_DIR$\cmock_demo.ewp +- +- +- +- All +- +- cmock_demo +- Binary +- +- +- cmock_demo +- FLASH_Debug +- +- +- cmock_demo +- RAM_Debug +- +- +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X-EK.h b/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X-EK.h +deleted file mode 100644 +index 98346759bf..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X-EK.h ++++ /dev/null +@@ -1,61 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X-EK.h +-// Object : AT91SAM7X-EK Evaluation Board Features Definition File +-// +-// ---------------------------------------------------------------------------- +- +-#ifndef AT91SAM7X_EK_H +-#define AT91SAM7X_EK_H +- +-/*-----------------*/ +-/* LEDs Definition */ +-/*-----------------*/ +-#define AT91B_LED1 (1<<19) // AT91C_PIO_PB19 AT91C_PB19_PWM0 AT91C_PB19_TCLK1 +-#define AT91B_LED2 (1<<20) // AT91C_PIO_PB20 AT91C_PB20_PWM1 AT91C_PB20_PWM1 +-#define AT91B_LED3 (AT91C_PIO_PB21) // AT91C_PIO_PB21 AT91C_PB21_PWM2 AT91C_PB21_PCK1 +-#define AT91B_LED4 (AT91C_PIO_PB22) // AT91C_PIO_PB22 AT91C_PB22_PWM3 AT91C_PB22_PCK2 +-#define AT91B_NB_LEB 4 +-#define AT91B_LED_MASK (AT91B_LED1|AT91B_LED2|AT91B_LED3|AT91B_LED4) +-#define AT91D_BASE_PIO_LED (AT91C_BASE_PIOB) +- +-#define AT91B_POWERLED (1<<25) // PB25 +- +- +-/*-------------------------------*/ +-/* JOYSTICK Position Definition */ +-/*-------------------------------*/ +-#define AT91B_SW1 (1<<21) // PA21 Up Button AT91C_PA21_TF AT91C_PA21_NPCS10 +-#define AT91B_SW2 (1<<22) // PA22 Down Button AT91C_PA22_TK AT91C_PA22_SPCK1 +-#define AT91B_SW3 (1<<23) // PA23 Left Button AT91C_PA23_TD AT91C_PA23_MOSI1 +-#define AT91B_SW4 (1<<24) // PA24 Right Button AT91C_PA24_RD AT91C_PA24_MISO1 +-#define AT91B_SW5 (1<<25) // PA25 Push Button AT91C_PA25_RK AT91C_PA25_NPCS11 +-#define AT91B_SW_MASK (AT91B_SW1|AT91B_SW2|AT91B_SW3|AT91B_SW4|AT91B_SW5) +- +- +-#define AT91D_BASE_PIO_SW (AT91C_BASE_PIOA) +- +-/*------------------*/ +-/* CAN Definition */ +-/*------------------*/ +-#define AT91B_CAN_TRANSCEIVER_RS (1<<2) // PA2 +- +-/*--------------*/ +-/* Clocks */ +-/*--------------*/ +-#define AT91B_MAIN_OSC 18432000 // Main Oscillator MAINCK +-#define AT91B_MCK ((18432000*73/14)/2) // Output PLL Clock +- +-#endif /* AT91SAM7X-EK_H */ +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X256_inc.h b/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X256_inc.h +deleted file mode 100644 +index 18e58d41eb..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/AT91SAM7X256_inc.h ++++ /dev/null +@@ -1,2268 +0,0 @@ +-// ---------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-// ---------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : AT91SAM7X256.h +-// Object : AT91SAM7X256 definitions +-// Generated : AT91 SW Application Group 01/16/2006 (16:36:22) +-// +-// CVS Reference : /AT91SAM7X256.pl/1.15/Wed Nov 2 13:56:49 2005// +-// CVS Reference : /SYS_SAM7X.pl/1.3/Tue Feb 1 17:01:43 2005// +-// CVS Reference : /MC_SAM7X.pl/1.2/Fri May 20 14:13:04 2005// +-// CVS Reference : /PMC_SAM7X.pl/1.4/Tue Feb 8 13:58:10 2005// +-// CVS Reference : /RSTC_SAM7X.pl/1.2/Wed Jul 13 14:57:50 2005// +-// CVS Reference : /UDP_SAM7X.pl/1.1/Tue May 10 11:35:35 2005// +-// CVS Reference : /PWM_SAM7X.pl/1.1/Tue May 10 11:53:07 2005// +-// CVS Reference : /AIC_6075B.pl/1.3/Fri May 20 14:01:30 2005// +-// CVS Reference : /PIO_6057A.pl/1.2/Thu Feb 3 10:18:28 2005// +-// CVS Reference : /RTTC_6081A.pl/1.2/Tue Nov 9 14:43:58 2004// +-// CVS Reference : /PITC_6079A.pl/1.2/Tue Nov 9 14:43:56 2004// +-// CVS Reference : /WDTC_6080A.pl/1.3/Tue Nov 9 14:44:00 2004// +-// CVS Reference : /VREG_6085B.pl/1.1/Tue Feb 1 16:05:48 2005// +-// CVS Reference : /PDC_6074C.pl/1.2/Thu Feb 3 08:48:54 2005// +-// CVS Reference : /DBGU_6059D.pl/1.1/Mon Jan 31 13:15:32 2005// +-// CVS Reference : /SPI_6088D.pl/1.3/Fri May 20 14:08:59 2005// +-// CVS Reference : /US_6089C.pl/1.1/Mon Jul 12 18:23:26 2004// +-// CVS Reference : /SSC_6078B.pl/1.1/Wed Jul 13 15:19:19 2005// +-// CVS Reference : /TWI_6061A.pl/1.1/Tue Jul 13 07:38:06 2004// +-// CVS Reference : /TC_6082A.pl/1.7/Fri Mar 11 12:52:17 2005// +-// CVS Reference : /CAN_6019B.pl/1.1/Tue Mar 8 12:42:22 2005// +-// CVS Reference : /EMACB_6119A.pl/1.6/Wed Jul 13 15:05:35 2005// +-// CVS Reference : /ADC_6051C.pl/1.1/Fri Oct 17 09:12:38 2003// +-// ---------------------------------------------------------------------------- +- +-// Hardware register definition +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR System Peripherals +-// ***************************************************************************** +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Advanced Interrupt Controller +-// ***************************************************************************** +-// *** Register offset in AT91S_AIC structure *** +-#define AIC_SMR ( 0) // Source Mode Register +-#define AIC_SVR (128) // Source Vector Register +-#define AIC_IVR (256) // IRQ Vector Register +-#define AIC_FVR (260) // FIQ Vector Register +-#define AIC_ISR (264) // Interrupt Status Register +-#define AIC_IPR (268) // Interrupt Pending Register +-#define AIC_IMR (272) // Interrupt Mask Register +-#define AIC_CISR (276) // Core Interrupt Status Register +-#define AIC_IECR (288) // Interrupt Enable Command Register +-#define AIC_IDCR (292) // Interrupt Disable Command Register +-#define AIC_ICCR (296) // Interrupt Clear Command Register +-#define AIC_ISCR (300) // Interrupt Set Command Register +-#define AIC_EOICR (304) // End of Interrupt Command Register +-#define AIC_SPU (308) // Spurious Vector Register +-#define AIC_DCR (312) // Debug Control Register (Protect) +-#define AIC_FFER (320) // Fast Forcing Enable Register +-#define AIC_FFDR (324) // Fast Forcing Disable Register +-#define AIC_FFSR (328) // Fast Forcing Status Register +-// -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- +-#define AT91C_AIC_PRIOR (0x7 << 0) // (AIC) Priority Level +-#define AT91C_AIC_PRIOR_LOWEST (0x0) // (AIC) Lowest priority level +-#define AT91C_AIC_PRIOR_HIGHEST (0x7) // (AIC) Highest priority level +-#define AT91C_AIC_SRCTYPE (0x3 << 5) // (AIC) Interrupt Source Type +-#define AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL (0x0 << 5) // (AIC) External Sources Code Label Low-level Sensitive +-#define AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL (0x0 << 5) // (AIC) Internal Sources Code Label High-level Sensitive +-#define AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE (0x1 << 5) // (AIC) Internal Sources Code Label Positive Edge triggered +-#define AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE (0x1 << 5) // (AIC) External Sources Code Label Negative Edge triggered +-#define AT91C_AIC_SRCTYPE_HIGH_LEVEL (0x2 << 5) // (AIC) Internal Or External Sources Code Label High-level Sensitive +-#define AT91C_AIC_SRCTYPE_POSITIVE_EDGE (0x3 << 5) // (AIC) Internal Or External Sources Code Label Positive Edge triggered +-// -------- AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register -------- +-#define AT91C_AIC_NFIQ (0x1 << 0) // (AIC) NFIQ Status +-#define AT91C_AIC_NIRQ (0x1 << 1) // (AIC) NIRQ Status +-// -------- AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) -------- +-#define AT91C_AIC_DCR_PROT (0x1 << 0) // (AIC) Protection Mode +-#define AT91C_AIC_DCR_GMSK (0x1 << 1) // (AIC) General Mask +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Peripheral DMA Controller +-// ***************************************************************************** +-// *** Register offset in AT91S_PDC structure *** +-#define PDC_RPR ( 0) // Receive Pointer Register +-#define PDC_RCR ( 4) // Receive Counter Register +-#define PDC_TPR ( 8) // Transmit Pointer Register +-#define PDC_TCR (12) // Transmit Counter Register +-#define PDC_RNPR (16) // Receive Next Pointer Register +-#define PDC_RNCR (20) // Receive Next Counter Register +-#define PDC_TNPR (24) // Transmit Next Pointer Register +-#define PDC_TNCR (28) // Transmit Next Counter Register +-#define PDC_PTCR (32) // PDC Transfer Control Register +-#define PDC_PTSR (36) // PDC Transfer Status Register +-// -------- PDC_PTCR : (PDC Offset: 0x20) PDC Transfer Control Register -------- +-#define AT91C_PDC_RXTEN (0x1 << 0) // (PDC) Receiver Transfer Enable +-#define AT91C_PDC_RXTDIS (0x1 << 1) // (PDC) Receiver Transfer Disable +-#define AT91C_PDC_TXTEN (0x1 << 8) // (PDC) Transmitter Transfer Enable +-#define AT91C_PDC_TXTDIS (0x1 << 9) // (PDC) Transmitter Transfer Disable +-// -------- PDC_PTSR : (PDC Offset: 0x24) PDC Transfer Status Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Debug Unit +-// ***************************************************************************** +-// *** Register offset in AT91S_DBGU structure *** +-#define DBGU_CR ( 0) // Control Register +-#define DBGU_MR ( 4) // Mode Register +-#define DBGU_IER ( 8) // Interrupt Enable Register +-#define DBGU_IDR (12) // Interrupt Disable Register +-#define DBGU_IMR (16) // Interrupt Mask Register +-#define DBGU_CSR (20) // Channel Status Register +-#define DBGU_RHR (24) // Receiver Holding Register +-#define DBGU_THR (28) // Transmitter Holding Register +-#define DBGU_BRGR (32) // Baud Rate Generator Register +-#define DBGU_CIDR (64) // Chip ID Register +-#define DBGU_EXID (68) // Chip ID Extension Register +-#define DBGU_FNTR (72) // Force NTRST Register +-#define DBGU_RPR (256) // Receive Pointer Register +-#define DBGU_RCR (260) // Receive Counter Register +-#define DBGU_TPR (264) // Transmit Pointer Register +-#define DBGU_TCR (268) // Transmit Counter Register +-#define DBGU_RNPR (272) // Receive Next Pointer Register +-#define DBGU_RNCR (276) // Receive Next Counter Register +-#define DBGU_TNPR (280) // Transmit Next Pointer Register +-#define DBGU_TNCR (284) // Transmit Next Counter Register +-#define DBGU_PTCR (288) // PDC Transfer Control Register +-#define DBGU_PTSR (292) // PDC Transfer Status Register +-// -------- DBGU_CR : (DBGU Offset: 0x0) Debug Unit Control Register -------- +-#define AT91C_US_RSTRX (0x1 << 2) // (DBGU) Reset Receiver +-#define AT91C_US_RSTTX (0x1 << 3) // (DBGU) Reset Transmitter +-#define AT91C_US_RXEN (0x1 << 4) // (DBGU) Receiver Enable +-#define AT91C_US_RXDIS (0x1 << 5) // (DBGU) Receiver Disable +-#define AT91C_US_TXEN (0x1 << 6) // (DBGU) Transmitter Enable +-#define AT91C_US_TXDIS (0x1 << 7) // (DBGU) Transmitter Disable +-#define AT91C_US_RSTSTA (0x1 << 8) // (DBGU) Reset Status Bits +-// -------- DBGU_MR : (DBGU Offset: 0x4) Debug Unit Mode Register -------- +-#define AT91C_US_PAR (0x7 << 9) // (DBGU) Parity type +-#define AT91C_US_PAR_EVEN (0x0 << 9) // (DBGU) Even Parity +-#define AT91C_US_PAR_ODD (0x1 << 9) // (DBGU) Odd Parity +-#define AT91C_US_PAR_SPACE (0x2 << 9) // (DBGU) Parity forced to 0 (Space) +-#define AT91C_US_PAR_MARK (0x3 << 9) // (DBGU) Parity forced to 1 (Mark) +-#define AT91C_US_PAR_NONE (0x4 << 9) // (DBGU) No Parity +-#define AT91C_US_PAR_MULTI_DROP (0x6 << 9) // (DBGU) Multi-drop mode +-#define AT91C_US_CHMODE (0x3 << 14) // (DBGU) Channel Mode +-#define AT91C_US_CHMODE_NORMAL (0x0 << 14) // (DBGU) Normal Mode: The USART channel operates as an RX/TX USART. +-#define AT91C_US_CHMODE_AUTO (0x1 << 14) // (DBGU) Automatic Echo: Receiver Data Input is connected to the TXD pin. +-#define AT91C_US_CHMODE_LOCAL (0x2 << 14) // (DBGU) Local Loopback: Transmitter Output Signal is connected to Receiver Input Signal. +-#define AT91C_US_CHMODE_REMOTE (0x3 << 14) // (DBGU) Remote Loopback: RXD pin is internally connected to TXD pin. +-// -------- DBGU_IER : (DBGU Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-#define AT91C_US_RXRDY (0x1 << 0) // (DBGU) RXRDY Interrupt +-#define AT91C_US_TXRDY (0x1 << 1) // (DBGU) TXRDY Interrupt +-#define AT91C_US_ENDRX (0x1 << 3) // (DBGU) End of Receive Transfer Interrupt +-#define AT91C_US_ENDTX (0x1 << 4) // (DBGU) End of Transmit Interrupt +-#define AT91C_US_OVRE (0x1 << 5) // (DBGU) Overrun Interrupt +-#define AT91C_US_FRAME (0x1 << 6) // (DBGU) Framing Error Interrupt +-#define AT91C_US_PARE (0x1 << 7) // (DBGU) Parity Error Interrupt +-#define AT91C_US_TXEMPTY (0x1 << 9) // (DBGU) TXEMPTY Interrupt +-#define AT91C_US_TXBUFE (0x1 << 11) // (DBGU) TXBUFE Interrupt +-#define AT91C_US_RXBUFF (0x1 << 12) // (DBGU) RXBUFF Interrupt +-#define AT91C_US_COMM_TX (0x1 << 30) // (DBGU) COMM_TX Interrupt +-#define AT91C_US_COMM_RX (0x1 << 31) // (DBGU) COMM_RX Interrupt +-// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register -------- +-// -------- DBGU_FNTR : (DBGU Offset: 0x48) Debug Unit FORCE_NTRST Register -------- +-#define AT91C_US_FORCE_NTRST (0x1 << 0) // (DBGU) Force NTRST in JTAG +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Parallel Input Output Controler +-// ***************************************************************************** +-// *** Register offset in AT91S_PIO structure *** +-#define PIO_PER ( 0) // PIO Enable Register +-#define PIO_PDR ( 4) // PIO Disable Register +-#define PIO_PSR ( 8) // PIO Status Register +-#define PIO_OER (16) // Output Enable Register +-#define PIO_ODR (20) // Output Disable Registerr +-#define PIO_OSR (24) // Output Status Register +-#define PIO_IFER (32) // Input Filter Enable Register +-#define PIO_IFDR (36) // Input Filter Disable Register +-#define PIO_IFSR (40) // Input Filter Status Register +-#define PIO_SODR (48) // Set Output Data Register +-#define PIO_CODR (52) // Clear Output Data Register +-#define PIO_ODSR (56) // Output Data Status Register +-#define PIO_PDSR (60) // Pin Data Status Register +-#define PIO_IER (64) // Interrupt Enable Register +-#define PIO_IDR (68) // Interrupt Disable Register +-#define PIO_IMR (72) // Interrupt Mask Register +-#define PIO_ISR (76) // Interrupt Status Register +-#define PIO_MDER (80) // Multi-driver Enable Register +-#define PIO_MDDR (84) // Multi-driver Disable Register +-#define PIO_MDSR (88) // Multi-driver Status Register +-#define PIO_PPUDR (96) // Pull-up Disable Register +-#define PIO_PPUER (100) // Pull-up Enable Register +-#define PIO_PPUSR (104) // Pull-up Status Register +-#define PIO_ASR (112) // Select A Register +-#define PIO_BSR (116) // Select B Register +-#define PIO_ABSR (120) // AB Select Status Register +-#define PIO_OWER (160) // Output Write Enable Register +-#define PIO_OWDR (164) // Output Write Disable Register +-#define PIO_OWSR (168) // Output Write Status Register +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Clock Generator Controler +-// ***************************************************************************** +-// *** Register offset in AT91S_CKGR structure *** +-#define CKGR_MOR ( 0) // Main Oscillator Register +-#define CKGR_MCFR ( 4) // Main Clock Frequency Register +-#define CKGR_PLLR (12) // PLL Register +-// -------- CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register -------- +-#define AT91C_CKGR_MOSCEN (0x1 << 0) // (CKGR) Main Oscillator Enable +-#define AT91C_CKGR_OSCBYPASS (0x1 << 1) // (CKGR) Main Oscillator Bypass +-#define AT91C_CKGR_OSCOUNT (0xFF << 8) // (CKGR) Main Oscillator Start-up Time +-// -------- CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register -------- +-#define AT91C_CKGR_MAINF (0xFFFF << 0) // (CKGR) Main Clock Frequency +-#define AT91C_CKGR_MAINRDY (0x1 << 16) // (CKGR) Main Clock Ready +-// -------- CKGR_PLLR : (CKGR Offset: 0xc) PLL B Register -------- +-#define AT91C_CKGR_DIV (0xFF << 0) // (CKGR) Divider Selected +-#define AT91C_CKGR_DIV_0 (0x0) // (CKGR) Divider output is 0 +-#define AT91C_CKGR_DIV_BYPASS (0x1) // (CKGR) Divider is bypassed +-#define AT91C_CKGR_PLLCOUNT (0x3F << 8) // (CKGR) PLL Counter +-#define AT91C_CKGR_OUT (0x3 << 14) // (CKGR) PLL Output Frequency Range +-#define AT91C_CKGR_OUT_0 (0x0 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_1 (0x1 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_2 (0x2 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_OUT_3 (0x3 << 14) // (CKGR) Please refer to the PLL datasheet +-#define AT91C_CKGR_MUL (0x7FF << 16) // (CKGR) PLL Multiplier +-#define AT91C_CKGR_USBDIV (0x3 << 28) // (CKGR) Divider for USB Clocks +-#define AT91C_CKGR_USBDIV_0 (0x0 << 28) // (CKGR) Divider output is PLL clock output +-#define AT91C_CKGR_USBDIV_1 (0x1 << 28) // (CKGR) Divider output is PLL clock output divided by 2 +-#define AT91C_CKGR_USBDIV_2 (0x2 << 28) // (CKGR) Divider output is PLL clock output divided by 4 +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Power Management Controler +-// ***************************************************************************** +-// *** Register offset in AT91S_PMC structure *** +-#define PMC_SCER ( 0) // System Clock Enable Register +-#define PMC_SCDR ( 4) // System Clock Disable Register +-#define PMC_SCSR ( 8) // System Clock Status Register +-#define PMC_PCER (16) // Peripheral Clock Enable Register +-#define PMC_PCDR (20) // Peripheral Clock Disable Register +-#define PMC_PCSR (24) // Peripheral Clock Status Register +-#define PMC_MOR (32) // Main Oscillator Register +-#define PMC_MCFR (36) // Main Clock Frequency Register +-#define PMC_PLLR (44) // PLL Register +-#define PMC_MCKR (48) // Master Clock Register +-#define PMC_PCKR (64) // Programmable Clock Register +-#define PMC_IER (96) // Interrupt Enable Register +-#define PMC_IDR (100) // Interrupt Disable Register +-#define PMC_SR (104) // Status Register +-#define PMC_IMR (108) // Interrupt Mask Register +-// -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register -------- +-#define AT91C_PMC_PCK (0x1 << 0) // (PMC) Processor Clock +-#define AT91C_PMC_UDP (0x1 << 7) // (PMC) USB Device Port Clock +-#define AT91C_PMC_PCK0 (0x1 << 8) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK1 (0x1 << 9) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK2 (0x1 << 10) // (PMC) Programmable Clock Output +-#define AT91C_PMC_PCK3 (0x1 << 11) // (PMC) Programmable Clock Output +-// -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register -------- +-// -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register -------- +-// -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- +-// -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register -------- +-// -------- CKGR_PLLR : (PMC Offset: 0x2c) PLL B Register -------- +-// -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- +-#define AT91C_PMC_CSS (0x3 << 0) // (PMC) Programmable Clock Selection +-#define AT91C_PMC_CSS_SLOW_CLK (0x0) // (PMC) Slow Clock is selected +-#define AT91C_PMC_CSS_MAIN_CLK (0x1) // (PMC) Main Clock is selected +-#define AT91C_PMC_CSS_PLL_CLK (0x3) // (PMC) Clock from PLL is selected +-#define AT91C_PMC_PRES (0x7 << 2) // (PMC) Programmable Clock Prescaler +-#define AT91C_PMC_PRES_CLK (0x0 << 2) // (PMC) Selected clock +-#define AT91C_PMC_PRES_CLK_2 (0x1 << 2) // (PMC) Selected clock divided by 2 +-#define AT91C_PMC_PRES_CLK_4 (0x2 << 2) // (PMC) Selected clock divided by 4 +-#define AT91C_PMC_PRES_CLK_8 (0x3 << 2) // (PMC) Selected clock divided by 8 +-#define AT91C_PMC_PRES_CLK_16 (0x4 << 2) // (PMC) Selected clock divided by 16 +-#define AT91C_PMC_PRES_CLK_32 (0x5 << 2) // (PMC) Selected clock divided by 32 +-#define AT91C_PMC_PRES_CLK_64 (0x6 << 2) // (PMC) Selected clock divided by 64 +-// -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register -------- +-// -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register -------- +-#define AT91C_PMC_MOSCS (0x1 << 0) // (PMC) MOSC Status/Enable/Disable/Mask +-#define AT91C_PMC_LOCK (0x1 << 2) // (PMC) PLL Status/Enable/Disable/Mask +-#define AT91C_PMC_MCKRDY (0x1 << 3) // (PMC) MCK_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK0RDY (0x1 << 8) // (PMC) PCK0_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK1RDY (0x1 << 9) // (PMC) PCK1_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK2RDY (0x1 << 10) // (PMC) PCK2_RDY Status/Enable/Disable/Mask +-#define AT91C_PMC_PCK3RDY (0x1 << 11) // (PMC) PCK3_RDY Status/Enable/Disable/Mask +-// -------- PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- +-// -------- PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- +-// -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Reset Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_RSTC structure *** +-#define RSTC_RCR ( 0) // Reset Control Register +-#define RSTC_RSR ( 4) // Reset Status Register +-#define RSTC_RMR ( 8) // Reset Mode Register +-// -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- +-#define AT91C_RSTC_PROCRST (0x1 << 0) // (RSTC) Processor Reset +-#define AT91C_RSTC_PERRST (0x1 << 2) // (RSTC) Peripheral Reset +-#define AT91C_RSTC_EXTRST (0x1 << 3) // (RSTC) External Reset +-#define AT91C_RSTC_KEY (0xFF << 24) // (RSTC) Password +-// -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- +-#define AT91C_RSTC_URSTS (0x1 << 0) // (RSTC) User Reset Status +-#define AT91C_RSTC_BODSTS (0x1 << 1) // (RSTC) Brownout Detection Status +-#define AT91C_RSTC_RSTTYP (0x7 << 8) // (RSTC) Reset Type +-#define AT91C_RSTC_RSTTYP_POWERUP (0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising. +-#define AT91C_RSTC_RSTTYP_WAKEUP (0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising. +-#define AT91C_RSTC_RSTTYP_WATCHDOG (0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occured. +-#define AT91C_RSTC_RSTTYP_SOFTWARE (0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software. +-#define AT91C_RSTC_RSTTYP_USER (0x4 << 8) // (RSTC) User Reset. NRST pin detected low. +-#define AT91C_RSTC_RSTTYP_BROWNOUT (0x5 << 8) // (RSTC) Brownout Reset occured. +-#define AT91C_RSTC_NRSTL (0x1 << 16) // (RSTC) NRST pin level +-#define AT91C_RSTC_SRCMP (0x1 << 17) // (RSTC) Software Reset Command in Progress. +-// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- +-#define AT91C_RSTC_URSTEN (0x1 << 0) // (RSTC) User Reset Enable +-#define AT91C_RSTC_URSTIEN (0x1 << 4) // (RSTC) User Reset Interrupt Enable +-#define AT91C_RSTC_ERSTL (0xF << 8) // (RSTC) User Reset Length +-#define AT91C_RSTC_BODIEN (0x1 << 16) // (RSTC) Brownout Detection Interrupt Enable +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Real Time Timer Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_RTTC structure *** +-#define RTTC_RTMR ( 0) // Real-time Mode Register +-#define RTTC_RTAR ( 4) // Real-time Alarm Register +-#define RTTC_RTVR ( 8) // Real-time Value Register +-#define RTTC_RTSR (12) // Real-time Status Register +-// -------- RTTC_RTMR : (RTTC Offset: 0x0) Real-time Mode Register -------- +-#define AT91C_RTTC_RTPRES (0xFFFF << 0) // (RTTC) Real-time Timer Prescaler Value +-#define AT91C_RTTC_ALMIEN (0x1 << 16) // (RTTC) Alarm Interrupt Enable +-#define AT91C_RTTC_RTTINCIEN (0x1 << 17) // (RTTC) Real Time Timer Increment Interrupt Enable +-#define AT91C_RTTC_RTTRST (0x1 << 18) // (RTTC) Real Time Timer Restart +-// -------- RTTC_RTAR : (RTTC Offset: 0x4) Real-time Alarm Register -------- +-#define AT91C_RTTC_ALMV (0x0 << 0) // (RTTC) Alarm Value +-// -------- RTTC_RTVR : (RTTC Offset: 0x8) Current Real-time Value Register -------- +-#define AT91C_RTTC_CRTV (0x0 << 0) // (RTTC) Current Real-time Value +-// -------- RTTC_RTSR : (RTTC Offset: 0xc) Real-time Status Register -------- +-#define AT91C_RTTC_ALMS (0x1 << 0) // (RTTC) Real-time Alarm Status +-#define AT91C_RTTC_RTTINC (0x1 << 1) // (RTTC) Real-time Timer Increment +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_PITC structure *** +-#define PITC_PIMR ( 0) // Period Interval Mode Register +-#define PITC_PISR ( 4) // Period Interval Status Register +-#define PITC_PIVR ( 8) // Period Interval Value Register +-#define PITC_PIIR (12) // Period Interval Image Register +-// -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- +-#define AT91C_PITC_PIV (0xFFFFF << 0) // (PITC) Periodic Interval Value +-#define AT91C_PITC_PITEN (0x1 << 24) // (PITC) Periodic Interval Timer Enabled +-#define AT91C_PITC_PITIEN (0x1 << 25) // (PITC) Periodic Interval Timer Interrupt Enable +-// -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- +-#define AT91C_PITC_PITS (0x1 << 0) // (PITC) Periodic Interval Timer Status +-// -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- +-#define AT91C_PITC_CPIV (0xFFFFF << 0) // (PITC) Current Periodic Interval Value +-#define AT91C_PITC_PICNT (0xFFF << 20) // (PITC) Periodic Interval Counter +-// -------- PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_WDTC structure *** +-#define WDTC_WDCR ( 0) // Watchdog Control Register +-#define WDTC_WDMR ( 4) // Watchdog Mode Register +-#define WDTC_WDSR ( 8) // Watchdog Status Register +-// -------- WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register -------- +-#define AT91C_WDTC_WDRSTT (0x1 << 0) // (WDTC) Watchdog Restart +-#define AT91C_WDTC_KEY (0xFF << 24) // (WDTC) Watchdog KEY Password +-// -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- +-#define AT91C_WDTC_WDV (0xFFF << 0) // (WDTC) Watchdog Timer Restart +-#define AT91C_WDTC_WDFIEN (0x1 << 12) // (WDTC) Watchdog Fault Interrupt Enable +-#define AT91C_WDTC_WDRSTEN (0x1 << 13) // (WDTC) Watchdog Reset Enable +-#define AT91C_WDTC_WDRPROC (0x1 << 14) // (WDTC) Watchdog Timer Restart +-#define AT91C_WDTC_WDDIS (0x1 << 15) // (WDTC) Watchdog Disable +-#define AT91C_WDTC_WDD (0xFFF << 16) // (WDTC) Watchdog Delta Value +-#define AT91C_WDTC_WDDBGHLT (0x1 << 28) // (WDTC) Watchdog Debug Halt +-#define AT91C_WDTC_WDIDLEHLT (0x1 << 29) // (WDTC) Watchdog Idle Halt +-// -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register -------- +-#define AT91C_WDTC_WDUNF (0x1 << 0) // (WDTC) Watchdog Underflow +-#define AT91C_WDTC_WDERR (0x1 << 1) // (WDTC) Watchdog Error +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Voltage Regulator Mode Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_VREG structure *** +-#define VREG_MR ( 0) // Voltage Regulator Mode Register +-// -------- VREG_MR : (VREG Offset: 0x0) Voltage Regulator Mode Register -------- +-#define AT91C_VREG_PSTDBY (0x1 << 0) // (VREG) Voltage Regulator Power Standby Mode +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Memory Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_MC structure *** +-#define MC_RCR ( 0) // MC Remap Control Register +-#define MC_ASR ( 4) // MC Abort Status Register +-#define MC_AASR ( 8) // MC Abort Address Status Register +-#define MC_FMR (96) // MC Flash Mode Register +-#define MC_FCR (100) // MC Flash Command Register +-#define MC_FSR (104) // MC Flash Status Register +-// -------- MC_RCR : (MC Offset: 0x0) MC Remap Control Register -------- +-#define AT91C_MC_RCB (0x1 << 0) // (MC) Remap Command Bit +-// -------- MC_ASR : (MC Offset: 0x4) MC Abort Status Register -------- +-#define AT91C_MC_UNDADD (0x1 << 0) // (MC) Undefined Addess Abort Status +-#define AT91C_MC_MISADD (0x1 << 1) // (MC) Misaligned Addess Abort Status +-#define AT91C_MC_ABTSZ (0x3 << 8) // (MC) Abort Size Status +-#define AT91C_MC_ABTSZ_BYTE (0x0 << 8) // (MC) Byte +-#define AT91C_MC_ABTSZ_HWORD (0x1 << 8) // (MC) Half-word +-#define AT91C_MC_ABTSZ_WORD (0x2 << 8) // (MC) Word +-#define AT91C_MC_ABTTYP (0x3 << 10) // (MC) Abort Type Status +-#define AT91C_MC_ABTTYP_DATAR (0x0 << 10) // (MC) Data Read +-#define AT91C_MC_ABTTYP_DATAW (0x1 << 10) // (MC) Data Write +-#define AT91C_MC_ABTTYP_FETCH (0x2 << 10) // (MC) Code Fetch +-#define AT91C_MC_MST0 (0x1 << 16) // (MC) Master 0 Abort Source +-#define AT91C_MC_MST1 (0x1 << 17) // (MC) Master 1 Abort Source +-#define AT91C_MC_SVMST0 (0x1 << 24) // (MC) Saved Master 0 Abort Source +-#define AT91C_MC_SVMST1 (0x1 << 25) // (MC) Saved Master 1 Abort Source +-// -------- MC_FMR : (MC Offset: 0x60) MC Flash Mode Register -------- +-#define AT91C_MC_FRDY (0x1 << 0) // (MC) Flash Ready +-#define AT91C_MC_LOCKE (0x1 << 2) // (MC) Lock Error +-#define AT91C_MC_PROGE (0x1 << 3) // (MC) Programming Error +-#define AT91C_MC_NEBP (0x1 << 7) // (MC) No Erase Before Programming +-#define AT91C_MC_FWS (0x3 << 8) // (MC) Flash Wait State +-#define AT91C_MC_FWS_0FWS (0x0 << 8) // (MC) 1 cycle for Read, 2 for Write operations +-#define AT91C_MC_FWS_1FWS (0x1 << 8) // (MC) 2 cycles for Read, 3 for Write operations +-#define AT91C_MC_FWS_2FWS (0x2 << 8) // (MC) 3 cycles for Read, 4 for Write operations +-#define AT91C_MC_FWS_3FWS (0x3 << 8) // (MC) 4 cycles for Read, 4 for Write operations +-#define AT91C_MC_FMCN (0xFF << 16) // (MC) Flash Microsecond Cycle Number +-// -------- MC_FCR : (MC Offset: 0x64) MC Flash Command Register -------- +-#define AT91C_MC_FCMD (0xF << 0) // (MC) Flash Command +-#define AT91C_MC_FCMD_START_PROG (0x1) // (MC) Starts the programming of th epage specified by PAGEN. +-#define AT91C_MC_FCMD_LOCK (0x2) // (MC) Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-#define AT91C_MC_FCMD_PROG_AND_LOCK (0x3) // (MC) The lock sequence automatically happens after the programming sequence is completed. +-#define AT91C_MC_FCMD_UNLOCK (0x4) // (MC) Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN. +-#define AT91C_MC_FCMD_ERASE_ALL (0x8) // (MC) Starts the erase of the entire flash.If at least a page is locked, the command is cancelled. +-#define AT91C_MC_FCMD_SET_GP_NVM (0xB) // (MC) Set General Purpose NVM bits. +-#define AT91C_MC_FCMD_CLR_GP_NVM (0xD) // (MC) Clear General Purpose NVM bits. +-#define AT91C_MC_FCMD_SET_SECURITY (0xF) // (MC) Set Security Bit. +-#define AT91C_MC_PAGEN (0x3FF << 8) // (MC) Page Number +-#define AT91C_MC_KEY (0xFF << 24) // (MC) Writing Protect Key +-// -------- MC_FSR : (MC Offset: 0x68) MC Flash Command Register -------- +-#define AT91C_MC_SECURITY (0x1 << 4) // (MC) Security Bit Status +-#define AT91C_MC_GPNVM0 (0x1 << 8) // (MC) Sector 0 Lock Status +-#define AT91C_MC_GPNVM1 (0x1 << 9) // (MC) Sector 1 Lock Status +-#define AT91C_MC_GPNVM2 (0x1 << 10) // (MC) Sector 2 Lock Status +-#define AT91C_MC_GPNVM3 (0x1 << 11) // (MC) Sector 3 Lock Status +-#define AT91C_MC_GPNVM4 (0x1 << 12) // (MC) Sector 4 Lock Status +-#define AT91C_MC_GPNVM5 (0x1 << 13) // (MC) Sector 5 Lock Status +-#define AT91C_MC_GPNVM6 (0x1 << 14) // (MC) Sector 6 Lock Status +-#define AT91C_MC_GPNVM7 (0x1 << 15) // (MC) Sector 7 Lock Status +-#define AT91C_MC_LOCKS0 (0x1 << 16) // (MC) Sector 0 Lock Status +-#define AT91C_MC_LOCKS1 (0x1 << 17) // (MC) Sector 1 Lock Status +-#define AT91C_MC_LOCKS2 (0x1 << 18) // (MC) Sector 2 Lock Status +-#define AT91C_MC_LOCKS3 (0x1 << 19) // (MC) Sector 3 Lock Status +-#define AT91C_MC_LOCKS4 (0x1 << 20) // (MC) Sector 4 Lock Status +-#define AT91C_MC_LOCKS5 (0x1 << 21) // (MC) Sector 5 Lock Status +-#define AT91C_MC_LOCKS6 (0x1 << 22) // (MC) Sector 6 Lock Status +-#define AT91C_MC_LOCKS7 (0x1 << 23) // (MC) Sector 7 Lock Status +-#define AT91C_MC_LOCKS8 (0x1 << 24) // (MC) Sector 8 Lock Status +-#define AT91C_MC_LOCKS9 (0x1 << 25) // (MC) Sector 9 Lock Status +-#define AT91C_MC_LOCKS10 (0x1 << 26) // (MC) Sector 10 Lock Status +-#define AT91C_MC_LOCKS11 (0x1 << 27) // (MC) Sector 11 Lock Status +-#define AT91C_MC_LOCKS12 (0x1 << 28) // (MC) Sector 12 Lock Status +-#define AT91C_MC_LOCKS13 (0x1 << 29) // (MC) Sector 13 Lock Status +-#define AT91C_MC_LOCKS14 (0x1 << 30) // (MC) Sector 14 Lock Status +-#define AT91C_MC_LOCKS15 (0x1 << 31) // (MC) Sector 15 Lock Status +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Serial Parallel Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_SPI structure *** +-#define SPI_CR ( 0) // Control Register +-#define SPI_MR ( 4) // Mode Register +-#define SPI_RDR ( 8) // Receive Data Register +-#define SPI_TDR (12) // Transmit Data Register +-#define SPI_SR (16) // Status Register +-#define SPI_IER (20) // Interrupt Enable Register +-#define SPI_IDR (24) // Interrupt Disable Register +-#define SPI_IMR (28) // Interrupt Mask Register +-#define SPI_CSR (48) // Chip Select Register +-#define SPI_RPR (256) // Receive Pointer Register +-#define SPI_RCR (260) // Receive Counter Register +-#define SPI_TPR (264) // Transmit Pointer Register +-#define SPI_TCR (268) // Transmit Counter Register +-#define SPI_RNPR (272) // Receive Next Pointer Register +-#define SPI_RNCR (276) // Receive Next Counter Register +-#define SPI_TNPR (280) // Transmit Next Pointer Register +-#define SPI_TNCR (284) // Transmit Next Counter Register +-#define SPI_PTCR (288) // PDC Transfer Control Register +-#define SPI_PTSR (292) // PDC Transfer Status Register +-// -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- +-#define AT91C_SPI_SPIEN (0x1 << 0) // (SPI) SPI Enable +-#define AT91C_SPI_SPIDIS (0x1 << 1) // (SPI) SPI Disable +-#define AT91C_SPI_SWRST (0x1 << 7) // (SPI) SPI Software reset +-#define AT91C_SPI_LASTXFER (0x1 << 24) // (SPI) SPI Last Transfer +-// -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- +-#define AT91C_SPI_MSTR (0x1 << 0) // (SPI) Master/Slave Mode +-#define AT91C_SPI_PS (0x1 << 1) // (SPI) Peripheral Select +-#define AT91C_SPI_PS_FIXED (0x0 << 1) // (SPI) Fixed Peripheral Select +-#define AT91C_SPI_PS_VARIABLE (0x1 << 1) // (SPI) Variable Peripheral Select +-#define AT91C_SPI_PCSDEC (0x1 << 2) // (SPI) Chip Select Decode +-#define AT91C_SPI_FDIV (0x1 << 3) // (SPI) Clock Selection +-#define AT91C_SPI_MODFDIS (0x1 << 4) // (SPI) Mode Fault Detection +-#define AT91C_SPI_LLB (0x1 << 7) // (SPI) Clock Selection +-#define AT91C_SPI_PCS (0xF << 16) // (SPI) Peripheral Chip Select +-#define AT91C_SPI_DLYBCS (0xFF << 24) // (SPI) Delay Between Chip Selects +-// -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- +-#define AT91C_SPI_RD (0xFFFF << 0) // (SPI) Receive Data +-#define AT91C_SPI_RPCS (0xF << 16) // (SPI) Peripheral Chip Select Status +-// -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- +-#define AT91C_SPI_TD (0xFFFF << 0) // (SPI) Transmit Data +-#define AT91C_SPI_TPCS (0xF << 16) // (SPI) Peripheral Chip Select Status +-// -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- +-#define AT91C_SPI_RDRF (0x1 << 0) // (SPI) Receive Data Register Full +-#define AT91C_SPI_TDRE (0x1 << 1) // (SPI) Transmit Data Register Empty +-#define AT91C_SPI_MODF (0x1 << 2) // (SPI) Mode Fault Error +-#define AT91C_SPI_OVRES (0x1 << 3) // (SPI) Overrun Error Status +-#define AT91C_SPI_ENDRX (0x1 << 4) // (SPI) End of Receiver Transfer +-#define AT91C_SPI_ENDTX (0x1 << 5) // (SPI) End of Receiver Transfer +-#define AT91C_SPI_RXBUFF (0x1 << 6) // (SPI) RXBUFF Interrupt +-#define AT91C_SPI_TXBUFE (0x1 << 7) // (SPI) TXBUFE Interrupt +-#define AT91C_SPI_NSSR (0x1 << 8) // (SPI) NSSR Interrupt +-#define AT91C_SPI_TXEMPTY (0x1 << 9) // (SPI) TXEMPTY Interrupt +-#define AT91C_SPI_SPIENS (0x1 << 16) // (SPI) Enable Status +-// -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- +-// -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- +-// -------- SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register -------- +-// -------- SPI_CSR : (SPI Offset: 0x30) Chip Select Register -------- +-#define AT91C_SPI_CPOL (0x1 << 0) // (SPI) Clock Polarity +-#define AT91C_SPI_NCPHA (0x1 << 1) // (SPI) Clock Phase +-#define AT91C_SPI_CSAAT (0x1 << 3) // (SPI) Chip Select Active After Transfer +-#define AT91C_SPI_BITS (0xF << 4) // (SPI) Bits Per Transfer +-#define AT91C_SPI_BITS_8 (0x0 << 4) // (SPI) 8 Bits Per transfer +-#define AT91C_SPI_BITS_9 (0x1 << 4) // (SPI) 9 Bits Per transfer +-#define AT91C_SPI_BITS_10 (0x2 << 4) // (SPI) 10 Bits Per transfer +-#define AT91C_SPI_BITS_11 (0x3 << 4) // (SPI) 11 Bits Per transfer +-#define AT91C_SPI_BITS_12 (0x4 << 4) // (SPI) 12 Bits Per transfer +-#define AT91C_SPI_BITS_13 (0x5 << 4) // (SPI) 13 Bits Per transfer +-#define AT91C_SPI_BITS_14 (0x6 << 4) // (SPI) 14 Bits Per transfer +-#define AT91C_SPI_BITS_15 (0x7 << 4) // (SPI) 15 Bits Per transfer +-#define AT91C_SPI_BITS_16 (0x8 << 4) // (SPI) 16 Bits Per transfer +-#define AT91C_SPI_SCBR (0xFF << 8) // (SPI) Serial Clock Baud Rate +-#define AT91C_SPI_DLYBS (0xFF << 16) // (SPI) Delay Before SPCK +-#define AT91C_SPI_DLYBCT (0xFF << 24) // (SPI) Delay Between Consecutive Transfers +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Usart +-// ***************************************************************************** +-// *** Register offset in AT91S_USART structure *** +-#define US_CR ( 0) // Control Register +-#define US_MR ( 4) // Mode Register +-#define US_IER ( 8) // Interrupt Enable Register +-#define US_IDR (12) // Interrupt Disable Register +-#define US_IMR (16) // Interrupt Mask Register +-#define US_CSR (20) // Channel Status Register +-#define US_RHR (24) // Receiver Holding Register +-#define US_THR (28) // Transmitter Holding Register +-#define US_BRGR (32) // Baud Rate Generator Register +-#define US_RTOR (36) // Receiver Time-out Register +-#define US_TTGR (40) // Transmitter Time-guard Register +-#define US_FIDI (64) // FI_DI_Ratio Register +-#define US_NER (68) // Nb Errors Register +-#define US_IF (76) // IRDA_FILTER Register +-#define US_RPR (256) // Receive Pointer Register +-#define US_RCR (260) // Receive Counter Register +-#define US_TPR (264) // Transmit Pointer Register +-#define US_TCR (268) // Transmit Counter Register +-#define US_RNPR (272) // Receive Next Pointer Register +-#define US_RNCR (276) // Receive Next Counter Register +-#define US_TNPR (280) // Transmit Next Pointer Register +-#define US_TNCR (284) // Transmit Next Counter Register +-#define US_PTCR (288) // PDC Transfer Control Register +-#define US_PTSR (292) // PDC Transfer Status Register +-// -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- +-#define AT91C_US_STTBRK (0x1 << 9) // (USART) Start Break +-#define AT91C_US_STPBRK (0x1 << 10) // (USART) Stop Break +-#define AT91C_US_STTTO (0x1 << 11) // (USART) Start Time-out +-#define AT91C_US_SENDA (0x1 << 12) // (USART) Send Address +-#define AT91C_US_RSTIT (0x1 << 13) // (USART) Reset Iterations +-#define AT91C_US_RSTNACK (0x1 << 14) // (USART) Reset Non Acknowledge +-#define AT91C_US_RETTO (0x1 << 15) // (USART) Rearm Time-out +-#define AT91C_US_DTREN (0x1 << 16) // (USART) Data Terminal ready Enable +-#define AT91C_US_DTRDIS (0x1 << 17) // (USART) Data Terminal ready Disable +-#define AT91C_US_RTSEN (0x1 << 18) // (USART) Request to Send enable +-#define AT91C_US_RTSDIS (0x1 << 19) // (USART) Request to Send Disable +-// -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- +-#define AT91C_US_USMODE (0xF << 0) // (USART) Usart mode +-#define AT91C_US_USMODE_NORMAL (0x0) // (USART) Normal +-#define AT91C_US_USMODE_RS485 (0x1) // (USART) RS485 +-#define AT91C_US_USMODE_HWHSH (0x2) // (USART) Hardware Handshaking +-#define AT91C_US_USMODE_MODEM (0x3) // (USART) Modem +-#define AT91C_US_USMODE_ISO7816_0 (0x4) // (USART) ISO7816 protocol: T = 0 +-#define AT91C_US_USMODE_ISO7816_1 (0x6) // (USART) ISO7816 protocol: T = 1 +-#define AT91C_US_USMODE_IRDA (0x8) // (USART) IrDA +-#define AT91C_US_USMODE_SWHSH (0xC) // (USART) Software Handshaking +-#define AT91C_US_CLKS (0x3 << 4) // (USART) Clock Selection (Baud Rate generator Input Clock +-#define AT91C_US_CLKS_CLOCK (0x0 << 4) // (USART) Clock +-#define AT91C_US_CLKS_FDIV1 (0x1 << 4) // (USART) fdiv1 +-#define AT91C_US_CLKS_SLOW (0x2 << 4) // (USART) slow_clock (ARM) +-#define AT91C_US_CLKS_EXT (0x3 << 4) // (USART) External (SCK) +-#define AT91C_US_CHRL (0x3 << 6) // (USART) Clock Selection (Baud Rate generator Input Clock +-#define AT91C_US_CHRL_5_BITS (0x0 << 6) // (USART) Character Length: 5 bits +-#define AT91C_US_CHRL_6_BITS (0x1 << 6) // (USART) Character Length: 6 bits +-#define AT91C_US_CHRL_7_BITS (0x2 << 6) // (USART) Character Length: 7 bits +-#define AT91C_US_CHRL_8_BITS (0x3 << 6) // (USART) Character Length: 8 bits +-#define AT91C_US_SYNC (0x1 << 8) // (USART) Synchronous Mode Select +-#define AT91C_US_NBSTOP (0x3 << 12) // (USART) Number of Stop bits +-#define AT91C_US_NBSTOP_1_BIT (0x0 << 12) // (USART) 1 stop bit +-#define AT91C_US_NBSTOP_15_BIT (0x1 << 12) // (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits +-#define AT91C_US_NBSTOP_2_BIT (0x2 << 12) // (USART) 2 stop bits +-#define AT91C_US_MSBF (0x1 << 16) // (USART) Bit Order +-#define AT91C_US_MODE9 (0x1 << 17) // (USART) 9-bit Character length +-#define AT91C_US_CKLO (0x1 << 18) // (USART) Clock Output Select +-#define AT91C_US_OVER (0x1 << 19) // (USART) Over Sampling Mode +-#define AT91C_US_INACK (0x1 << 20) // (USART) Inhibit Non Acknowledge +-#define AT91C_US_DSNACK (0x1 << 21) // (USART) Disable Successive NACK +-#define AT91C_US_MAX_ITER (0x1 << 24) // (USART) Number of Repetitions +-#define AT91C_US_FILTER (0x1 << 28) // (USART) Receive Line Filter +-// -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- +-#define AT91C_US_RXBRK (0x1 << 2) // (USART) Break Received/End of Break +-#define AT91C_US_TIMEOUT (0x1 << 8) // (USART) Receiver Time-out +-#define AT91C_US_ITERATION (0x1 << 10) // (USART) Max number of Repetitions Reached +-#define AT91C_US_NACK (0x1 << 13) // (USART) Non Acknowledge +-#define AT91C_US_RIIC (0x1 << 16) // (USART) Ring INdicator Input Change Flag +-#define AT91C_US_DSRIC (0x1 << 17) // (USART) Data Set Ready Input Change Flag +-#define AT91C_US_DCDIC (0x1 << 18) // (USART) Data Carrier Flag +-#define AT91C_US_CTSIC (0x1 << 19) // (USART) Clear To Send Input Change Flag +-// -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- +-// -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- +-// -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- +-#define AT91C_US_RI (0x1 << 20) // (USART) Image of RI Input +-#define AT91C_US_DSR (0x1 << 21) // (USART) Image of DSR Input +-#define AT91C_US_DCD (0x1 << 22) // (USART) Image of DCD Input +-#define AT91C_US_CTS (0x1 << 23) // (USART) Image of CTS Input +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Synchronous Serial Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_SSC structure *** +-#define SSC_CR ( 0) // Control Register +-#define SSC_CMR ( 4) // Clock Mode Register +-#define SSC_RCMR (16) // Receive Clock ModeRegister +-#define SSC_RFMR (20) // Receive Frame Mode Register +-#define SSC_TCMR (24) // Transmit Clock Mode Register +-#define SSC_TFMR (28) // Transmit Frame Mode Register +-#define SSC_RHR (32) // Receive Holding Register +-#define SSC_THR (36) // Transmit Holding Register +-#define SSC_RSHR (48) // Receive Sync Holding Register +-#define SSC_TSHR (52) // Transmit Sync Holding Register +-#define SSC_SR (64) // Status Register +-#define SSC_IER (68) // Interrupt Enable Register +-#define SSC_IDR (72) // Interrupt Disable Register +-#define SSC_IMR (76) // Interrupt Mask Register +-#define SSC_RPR (256) // Receive Pointer Register +-#define SSC_RCR (260) // Receive Counter Register +-#define SSC_TPR (264) // Transmit Pointer Register +-#define SSC_TCR (268) // Transmit Counter Register +-#define SSC_RNPR (272) // Receive Next Pointer Register +-#define SSC_RNCR (276) // Receive Next Counter Register +-#define SSC_TNPR (280) // Transmit Next Pointer Register +-#define SSC_TNCR (284) // Transmit Next Counter Register +-#define SSC_PTCR (288) // PDC Transfer Control Register +-#define SSC_PTSR (292) // PDC Transfer Status Register +-// -------- SSC_CR : (SSC Offset: 0x0) SSC Control Register -------- +-#define AT91C_SSC_RXEN (0x1 << 0) // (SSC) Receive Enable +-#define AT91C_SSC_RXDIS (0x1 << 1) // (SSC) Receive Disable +-#define AT91C_SSC_TXEN (0x1 << 8) // (SSC) Transmit Enable +-#define AT91C_SSC_TXDIS (0x1 << 9) // (SSC) Transmit Disable +-#define AT91C_SSC_SWRST (0x1 << 15) // (SSC) Software Reset +-// -------- SSC_RCMR : (SSC Offset: 0x10) SSC Receive Clock Mode Register -------- +-#define AT91C_SSC_CKS (0x3 << 0) // (SSC) Receive/Transmit Clock Selection +-#define AT91C_SSC_CKS_DIV (0x0) // (SSC) Divided Clock +-#define AT91C_SSC_CKS_TK (0x1) // (SSC) TK Clock signal +-#define AT91C_SSC_CKS_RK (0x2) // (SSC) RK pin +-#define AT91C_SSC_CKO (0x7 << 2) // (SSC) Receive/Transmit Clock Output Mode Selection +-#define AT91C_SSC_CKO_NONE (0x0 << 2) // (SSC) Receive/Transmit Clock Output Mode: None RK pin: Input-only +-#define AT91C_SSC_CKO_CONTINOUS (0x1 << 2) // (SSC) Continuous Receive/Transmit Clock RK pin: Output +-#define AT91C_SSC_CKO_DATA_TX (0x2 << 2) // (SSC) Receive/Transmit Clock only during data transfers RK pin: Output +-#define AT91C_SSC_CKI (0x1 << 5) // (SSC) Receive/Transmit Clock Inversion +-#define AT91C_SSC_CKG (0x3 << 6) // (SSC) Receive/Transmit Clock Gating Selection +-#define AT91C_SSC_CKG_NONE (0x0 << 6) // (SSC) Receive/Transmit Clock Gating: None, continuous clock +-#define AT91C_SSC_CKG_LOW (0x1 << 6) // (SSC) Receive/Transmit Clock enabled only if RF Low +-#define AT91C_SSC_CKG_HIGH (0x2 << 6) // (SSC) Receive/Transmit Clock enabled only if RF High +-#define AT91C_SSC_START (0xF << 8) // (SSC) Receive/Transmit Start Selection +-#define AT91C_SSC_START_CONTINOUS (0x0 << 8) // (SSC) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. +-#define AT91C_SSC_START_TX (0x1 << 8) // (SSC) Transmit/Receive start +-#define AT91C_SSC_START_LOW_RF (0x2 << 8) // (SSC) Detection of a low level on RF input +-#define AT91C_SSC_START_HIGH_RF (0x3 << 8) // (SSC) Detection of a high level on RF input +-#define AT91C_SSC_START_FALL_RF (0x4 << 8) // (SSC) Detection of a falling edge on RF input +-#define AT91C_SSC_START_RISE_RF (0x5 << 8) // (SSC) Detection of a rising edge on RF input +-#define AT91C_SSC_START_LEVEL_RF (0x6 << 8) // (SSC) Detection of any level change on RF input +-#define AT91C_SSC_START_EDGE_RF (0x7 << 8) // (SSC) Detection of any edge on RF input +-#define AT91C_SSC_START_0 (0x8 << 8) // (SSC) Compare 0 +-#define AT91C_SSC_STOP (0x1 << 12) // (SSC) Receive Stop Selection +-#define AT91C_SSC_STTDLY (0xFF << 16) // (SSC) Receive/Transmit Start Delay +-#define AT91C_SSC_PERIOD (0xFF << 24) // (SSC) Receive/Transmit Period Divider Selection +-// -------- SSC_RFMR : (SSC Offset: 0x14) SSC Receive Frame Mode Register -------- +-#define AT91C_SSC_DATLEN (0x1F << 0) // (SSC) Data Length +-#define AT91C_SSC_LOOP (0x1 << 5) // (SSC) Loop Mode +-#define AT91C_SSC_MSBF (0x1 << 7) // (SSC) Most Significant Bit First +-#define AT91C_SSC_DATNB (0xF << 8) // (SSC) Data Number per Frame +-#define AT91C_SSC_FSLEN (0xF << 16) // (SSC) Receive/Transmit Frame Sync length +-#define AT91C_SSC_FSOS (0x7 << 20) // (SSC) Receive/Transmit Frame Sync Output Selection +-#define AT91C_SSC_FSOS_NONE (0x0 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: None RK pin Input-only +-#define AT91C_SSC_FSOS_NEGATIVE (0x1 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Negative Pulse +-#define AT91C_SSC_FSOS_POSITIVE (0x2 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Positive Pulse +-#define AT91C_SSC_FSOS_LOW (0x3 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver Low during data transfer +-#define AT91C_SSC_FSOS_HIGH (0x4 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Driver High during data transfer +-#define AT91C_SSC_FSOS_TOGGLE (0x5 << 20) // (SSC) Selected Receive/Transmit Frame Sync Signal: Toggling at each start of data transfer +-#define AT91C_SSC_FSEDGE (0x1 << 24) // (SSC) Frame Sync Edge Detection +-// -------- SSC_TCMR : (SSC Offset: 0x18) SSC Transmit Clock Mode Register -------- +-// -------- SSC_TFMR : (SSC Offset: 0x1c) SSC Transmit Frame Mode Register -------- +-#define AT91C_SSC_DATDEF (0x1 << 5) // (SSC) Data Default Value +-#define AT91C_SSC_FSDEN (0x1 << 23) // (SSC) Frame Sync Data Enable +-// -------- SSC_SR : (SSC Offset: 0x40) SSC Status Register -------- +-#define AT91C_SSC_TXRDY (0x1 << 0) // (SSC) Transmit Ready +-#define AT91C_SSC_TXEMPTY (0x1 << 1) // (SSC) Transmit Empty +-#define AT91C_SSC_ENDTX (0x1 << 2) // (SSC) End Of Transmission +-#define AT91C_SSC_TXBUFE (0x1 << 3) // (SSC) Transmit Buffer Empty +-#define AT91C_SSC_RXRDY (0x1 << 4) // (SSC) Receive Ready +-#define AT91C_SSC_OVRUN (0x1 << 5) // (SSC) Receive Overrun +-#define AT91C_SSC_ENDRX (0x1 << 6) // (SSC) End of Reception +-#define AT91C_SSC_RXBUFF (0x1 << 7) // (SSC) Receive Buffer Full +-#define AT91C_SSC_CP0 (0x1 << 8) // (SSC) Compare 0 +-#define AT91C_SSC_CP1 (0x1 << 9) // (SSC) Compare 1 +-#define AT91C_SSC_TXSYN (0x1 << 10) // (SSC) Transmit Sync +-#define AT91C_SSC_RXSYN (0x1 << 11) // (SSC) Receive Sync +-#define AT91C_SSC_TXENA (0x1 << 16) // (SSC) Transmit Enable +-#define AT91C_SSC_RXENA (0x1 << 17) // (SSC) Receive Enable +-// -------- SSC_IER : (SSC Offset: 0x44) SSC Interrupt Enable Register -------- +-// -------- SSC_IDR : (SSC Offset: 0x48) SSC Interrupt Disable Register -------- +-// -------- SSC_IMR : (SSC Offset: 0x4c) SSC Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Two-wire Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_TWI structure *** +-#define TWI_CR ( 0) // Control Register +-#define TWI_MMR ( 4) // Master Mode Register +-#define TWI_IADR (12) // Internal Address Register +-#define TWI_CWGR (16) // Clock Waveform Generator Register +-#define TWI_SR (32) // Status Register +-#define TWI_IER (36) // Interrupt Enable Register +-#define TWI_IDR (40) // Interrupt Disable Register +-#define TWI_IMR (44) // Interrupt Mask Register +-#define TWI_RHR (48) // Receive Holding Register +-#define TWI_THR (52) // Transmit Holding Register +-// -------- TWI_CR : (TWI Offset: 0x0) TWI Control Register -------- +-#define AT91C_TWI_START (0x1 << 0) // (TWI) Send a START Condition +-#define AT91C_TWI_STOP (0x1 << 1) // (TWI) Send a STOP Condition +-#define AT91C_TWI_MSEN (0x1 << 2) // (TWI) TWI Master Transfer Enabled +-#define AT91C_TWI_MSDIS (0x1 << 3) // (TWI) TWI Master Transfer Disabled +-#define AT91C_TWI_SWRST (0x1 << 7) // (TWI) Software Reset +-// -------- TWI_MMR : (TWI Offset: 0x4) TWI Master Mode Register -------- +-#define AT91C_TWI_IADRSZ (0x3 << 8) // (TWI) Internal Device Address Size +-#define AT91C_TWI_IADRSZ_NO (0x0 << 8) // (TWI) No internal device address +-#define AT91C_TWI_IADRSZ_1_BYTE (0x1 << 8) // (TWI) One-byte internal device address +-#define AT91C_TWI_IADRSZ_2_BYTE (0x2 << 8) // (TWI) Two-byte internal device address +-#define AT91C_TWI_IADRSZ_3_BYTE (0x3 << 8) // (TWI) Three-byte internal device address +-#define AT91C_TWI_MREAD (0x1 << 12) // (TWI) Master Read Direction +-#define AT91C_TWI_DADR (0x7F << 16) // (TWI) Device Address +-// -------- TWI_CWGR : (TWI Offset: 0x10) TWI Clock Waveform Generator Register -------- +-#define AT91C_TWI_CLDIV (0xFF << 0) // (TWI) Clock Low Divider +-#define AT91C_TWI_CHDIV (0xFF << 8) // (TWI) Clock High Divider +-#define AT91C_TWI_CKDIV (0x7 << 16) // (TWI) Clock Divider +-// -------- TWI_SR : (TWI Offset: 0x20) TWI Status Register -------- +-#define AT91C_TWI_TXCOMP (0x1 << 0) // (TWI) Transmission Completed +-#define AT91C_TWI_RXRDY (0x1 << 1) // (TWI) Receive holding register ReaDY +-#define AT91C_TWI_TXRDY (0x1 << 2) // (TWI) Transmit holding register ReaDY +-#define AT91C_TWI_OVRE (0x1 << 6) // (TWI) Overrun Error +-#define AT91C_TWI_UNRE (0x1 << 7) // (TWI) Underrun Error +-#define AT91C_TWI_NACK (0x1 << 8) // (TWI) Not Acknowledged +-// -------- TWI_IER : (TWI Offset: 0x24) TWI Interrupt Enable Register -------- +-// -------- TWI_IDR : (TWI Offset: 0x28) TWI Interrupt Disable Register -------- +-// -------- TWI_IMR : (TWI Offset: 0x2c) TWI Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR PWMC Channel Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_PWMC_CH structure *** +-#define PWMC_CMR ( 0) // Channel Mode Register +-#define PWMC_CDTYR ( 4) // Channel Duty Cycle Register +-#define PWMC_CPRDR ( 8) // Channel Period Register +-#define PWMC_CCNTR (12) // Channel Counter Register +-#define PWMC_CUPDR (16) // Channel Update Register +-#define PWMC_Reserved (20) // Reserved +-// -------- PWMC_CMR : (PWMC_CH Offset: 0x0) PWMC Channel Mode Register -------- +-#define AT91C_PWMC_CPRE (0xF << 0) // (PWMC_CH) Channel Pre-scaler : PWMC_CLKx +-#define AT91C_PWMC_CPRE_MCK (0x0) // (PWMC_CH) +-#define AT91C_PWMC_CPRE_MCKA (0xB) // (PWMC_CH) +-#define AT91C_PWMC_CPRE_MCKB (0xC) // (PWMC_CH) +-#define AT91C_PWMC_CALG (0x1 << 8) // (PWMC_CH) Channel Alignment +-#define AT91C_PWMC_CPOL (0x1 << 9) // (PWMC_CH) Channel Polarity +-#define AT91C_PWMC_CPD (0x1 << 10) // (PWMC_CH) Channel Update Period +-// -------- PWMC_CDTYR : (PWMC_CH Offset: 0x4) PWMC Channel Duty Cycle Register -------- +-#define AT91C_PWMC_CDTY (0x0 << 0) // (PWMC_CH) Channel Duty Cycle +-// -------- PWMC_CPRDR : (PWMC_CH Offset: 0x8) PWMC Channel Period Register -------- +-#define AT91C_PWMC_CPRD (0x0 << 0) // (PWMC_CH) Channel Period +-// -------- PWMC_CCNTR : (PWMC_CH Offset: 0xc) PWMC Channel Counter Register -------- +-#define AT91C_PWMC_CCNT (0x0 << 0) // (PWMC_CH) Channel Counter +-// -------- PWMC_CUPDR : (PWMC_CH Offset: 0x10) PWMC Channel Update Register -------- +-#define AT91C_PWMC_CUPD (0x0 << 0) // (PWMC_CH) Channel Update +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_PWMC structure *** +-#define PWMC_MR ( 0) // PWMC Mode Register +-#define PWMC_ENA ( 4) // PWMC Enable Register +-#define PWMC_DIS ( 8) // PWMC Disable Register +-#define PWMC_SR (12) // PWMC Status Register +-#define PWMC_IER (16) // PWMC Interrupt Enable Register +-#define PWMC_IDR (20) // PWMC Interrupt Disable Register +-#define PWMC_IMR (24) // PWMC Interrupt Mask Register +-#define PWMC_ISR (28) // PWMC Interrupt Status Register +-#define PWMC_VR (252) // PWMC Version Register +-#define PWMC_CH (512) // PWMC Channel +-// -------- PWMC_MR : (PWMC Offset: 0x0) PWMC Mode Register -------- +-#define AT91C_PWMC_DIVA (0xFF << 0) // (PWMC) CLKA divide factor. +-#define AT91C_PWMC_PREA (0xF << 8) // (PWMC) Divider Input Clock Prescaler A +-#define AT91C_PWMC_PREA_MCK (0x0 << 8) // (PWMC) +-#define AT91C_PWMC_DIVB (0xFF << 16) // (PWMC) CLKB divide factor. +-#define AT91C_PWMC_PREB (0xF << 24) // (PWMC) Divider Input Clock Prescaler B +-#define AT91C_PWMC_PREB_MCK (0x0 << 24) // (PWMC) +-// -------- PWMC_ENA : (PWMC Offset: 0x4) PWMC Enable Register -------- +-#define AT91C_PWMC_CHID0 (0x1 << 0) // (PWMC) Channel ID 0 +-#define AT91C_PWMC_CHID1 (0x1 << 1) // (PWMC) Channel ID 1 +-#define AT91C_PWMC_CHID2 (0x1 << 2) // (PWMC) Channel ID 2 +-#define AT91C_PWMC_CHID3 (0x1 << 3) // (PWMC) Channel ID 3 +-// -------- PWMC_DIS : (PWMC Offset: 0x8) PWMC Disable Register -------- +-// -------- PWMC_SR : (PWMC Offset: 0xc) PWMC Status Register -------- +-// -------- PWMC_IER : (PWMC Offset: 0x10) PWMC Interrupt Enable Register -------- +-// -------- PWMC_IDR : (PWMC Offset: 0x14) PWMC Interrupt Disable Register -------- +-// -------- PWMC_IMR : (PWMC Offset: 0x18) PWMC Interrupt Mask Register -------- +-// -------- PWMC_ISR : (PWMC Offset: 0x1c) PWMC Interrupt Status Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR USB Device Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_UDP structure *** +-#define UDP_NUM ( 0) // Frame Number Register +-#define UDP_GLBSTATE ( 4) // Global State Register +-#define UDP_FADDR ( 8) // Function Address Register +-#define UDP_IER (16) // Interrupt Enable Register +-#define UDP_IDR (20) // Interrupt Disable Register +-#define UDP_IMR (24) // Interrupt Mask Register +-#define UDP_ISR (28) // Interrupt Status Register +-#define UDP_ICR (32) // Interrupt Clear Register +-#define UDP_RSTEP (40) // Reset Endpoint Register +-#define UDP_CSR (48) // Endpoint Control and Status Register +-#define UDP_FDR (80) // Endpoint FIFO Data Register +-#define UDP_TXVC (116) // Transceiver Control Register +-// -------- UDP_FRM_NUM : (UDP Offset: 0x0) USB Frame Number Register -------- +-#define AT91C_UDP_FRM_NUM (0x7FF << 0) // (UDP) Frame Number as Defined in the Packet Field Formats +-#define AT91C_UDP_FRM_ERR (0x1 << 16) // (UDP) Frame Error +-#define AT91C_UDP_FRM_OK (0x1 << 17) // (UDP) Frame OK +-// -------- UDP_GLB_STATE : (UDP Offset: 0x4) USB Global State Register -------- +-#define AT91C_UDP_FADDEN (0x1 << 0) // (UDP) Function Address Enable +-#define AT91C_UDP_CONFG (0x1 << 1) // (UDP) Configured +-#define AT91C_UDP_ESR (0x1 << 2) // (UDP) Enable Send Resume +-#define AT91C_UDP_RSMINPR (0x1 << 3) // (UDP) A Resume Has Been Sent to the Host +-#define AT91C_UDP_RMWUPE (0x1 << 4) // (UDP) Remote Wake Up Enable +-// -------- UDP_FADDR : (UDP Offset: 0x8) USB Function Address Register -------- +-#define AT91C_UDP_FADD (0xFF << 0) // (UDP) Function Address Value +-#define AT91C_UDP_FEN (0x1 << 8) // (UDP) Function Enable +-// -------- UDP_IER : (UDP Offset: 0x10) USB Interrupt Enable Register -------- +-#define AT91C_UDP_EPINT0 (0x1 << 0) // (UDP) Endpoint 0 Interrupt +-#define AT91C_UDP_EPINT1 (0x1 << 1) // (UDP) Endpoint 0 Interrupt +-#define AT91C_UDP_EPINT2 (0x1 << 2) // (UDP) Endpoint 2 Interrupt +-#define AT91C_UDP_EPINT3 (0x1 << 3) // (UDP) Endpoint 3 Interrupt +-#define AT91C_UDP_EPINT4 (0x1 << 4) // (UDP) Endpoint 4 Interrupt +-#define AT91C_UDP_EPINT5 (0x1 << 5) // (UDP) Endpoint 5 Interrupt +-#define AT91C_UDP_RXSUSP (0x1 << 8) // (UDP) USB Suspend Interrupt +-#define AT91C_UDP_RXRSM (0x1 << 9) // (UDP) USB Resume Interrupt +-#define AT91C_UDP_EXTRSM (0x1 << 10) // (UDP) USB External Resume Interrupt +-#define AT91C_UDP_SOFINT (0x1 << 11) // (UDP) USB Start Of frame Interrupt +-#define AT91C_UDP_WAKEUP (0x1 << 13) // (UDP) USB Resume Interrupt +-// -------- UDP_IDR : (UDP Offset: 0x14) USB Interrupt Disable Register -------- +-// -------- UDP_IMR : (UDP Offset: 0x18) USB Interrupt Mask Register -------- +-// -------- UDP_ISR : (UDP Offset: 0x1c) USB Interrupt Status Register -------- +-#define AT91C_UDP_ENDBUSRES (0x1 << 12) // (UDP) USB End Of Bus Reset Interrupt +-// -------- UDP_ICR : (UDP Offset: 0x20) USB Interrupt Clear Register -------- +-// -------- UDP_RST_EP : (UDP Offset: 0x28) USB Reset Endpoint Register -------- +-#define AT91C_UDP_EP0 (0x1 << 0) // (UDP) Reset Endpoint 0 +-#define AT91C_UDP_EP1 (0x1 << 1) // (UDP) Reset Endpoint 1 +-#define AT91C_UDP_EP2 (0x1 << 2) // (UDP) Reset Endpoint 2 +-#define AT91C_UDP_EP3 (0x1 << 3) // (UDP) Reset Endpoint 3 +-#define AT91C_UDP_EP4 (0x1 << 4) // (UDP) Reset Endpoint 4 +-#define AT91C_UDP_EP5 (0x1 << 5) // (UDP) Reset Endpoint 5 +-// -------- UDP_CSR : (UDP Offset: 0x30) USB Endpoint Control and Status Register -------- +-#define AT91C_UDP_TXCOMP (0x1 << 0) // (UDP) Generates an IN packet with data previously written in the DPR +-#define AT91C_UDP_RX_DATA_BK0 (0x1 << 1) // (UDP) Receive Data Bank 0 +-#define AT91C_UDP_RXSETUP (0x1 << 2) // (UDP) Sends STALL to the Host (Control endpoints) +-#define AT91C_UDP_ISOERROR (0x1 << 3) // (UDP) Isochronous error (Isochronous endpoints) +-#define AT91C_UDP_TXPKTRDY (0x1 << 4) // (UDP) Transmit Packet Ready +-#define AT91C_UDP_FORCESTALL (0x1 << 5) // (UDP) Force Stall (used by Control, Bulk and Isochronous endpoints). +-#define AT91C_UDP_RX_DATA_BK1 (0x1 << 6) // (UDP) Receive Data Bank 1 (only used by endpoints with ping-pong attributes). +-#define AT91C_UDP_DIR (0x1 << 7) // (UDP) Transfer Direction +-#define AT91C_UDP_EPTYPE (0x7 << 8) // (UDP) Endpoint type +-#define AT91C_UDP_EPTYPE_CTRL (0x0 << 8) // (UDP) Control +-#define AT91C_UDP_EPTYPE_ISO_OUT (0x1 << 8) // (UDP) Isochronous OUT +-#define AT91C_UDP_EPTYPE_BULK_OUT (0x2 << 8) // (UDP) Bulk OUT +-#define AT91C_UDP_EPTYPE_INT_OUT (0x3 << 8) // (UDP) Interrupt OUT +-#define AT91C_UDP_EPTYPE_ISO_IN (0x5 << 8) // (UDP) Isochronous IN +-#define AT91C_UDP_EPTYPE_BULK_IN (0x6 << 8) // (UDP) Bulk IN +-#define AT91C_UDP_EPTYPE_INT_IN (0x7 << 8) // (UDP) Interrupt IN +-#define AT91C_UDP_DTGLE (0x1 << 11) // (UDP) Data Toggle +-#define AT91C_UDP_EPEDS (0x1 << 15) // (UDP) Endpoint Enable Disable +-#define AT91C_UDP_RXBYTECNT (0x7FF << 16) // (UDP) Number Of Bytes Available in the FIFO +-// -------- UDP_TXVC : (UDP Offset: 0x74) Transceiver Control Register -------- +-#define AT91C_UDP_TXVDIS (0x1 << 8) // (UDP) +-#define AT91C_UDP_PUON (0x1 << 9) // (UDP) Pull-up ON +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Timer Counter Channel Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_TC structure *** +-#define TC_CCR ( 0) // Channel Control Register +-#define TC_CMR ( 4) // Channel Mode Register (Capture Mode / Waveform Mode) +-#define TC_CV (16) // Counter Value +-#define TC_RA (20) // Register A +-#define TC_RB (24) // Register B +-#define TC_RC (28) // Register C +-#define TC_SR (32) // Status Register +-#define TC_IER (36) // Interrupt Enable Register +-#define TC_IDR (40) // Interrupt Disable Register +-#define TC_IMR (44) // Interrupt Mask Register +-// -------- TC_CCR : (TC Offset: 0x0) TC Channel Control Register -------- +-#define AT91C_TC_CLKEN (0x1 << 0) // (TC) Counter Clock Enable Command +-#define AT91C_TC_CLKDIS (0x1 << 1) // (TC) Counter Clock Disable Command +-#define AT91C_TC_SWTRG (0x1 << 2) // (TC) Software Trigger Command +-// -------- TC_CMR : (TC Offset: 0x4) TC Channel Mode Register: Capture Mode / Waveform Mode -------- +-#define AT91C_TC_CLKS (0x7 << 0) // (TC) Clock Selection +-#define AT91C_TC_CLKS_TIMER_DIV1_CLOCK (0x0) // (TC) Clock selected: TIMER_DIV1_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV2_CLOCK (0x1) // (TC) Clock selected: TIMER_DIV2_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV3_CLOCK (0x2) // (TC) Clock selected: TIMER_DIV3_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV4_CLOCK (0x3) // (TC) Clock selected: TIMER_DIV4_CLOCK +-#define AT91C_TC_CLKS_TIMER_DIV5_CLOCK (0x4) // (TC) Clock selected: TIMER_DIV5_CLOCK +-#define AT91C_TC_CLKS_XC0 (0x5) // (TC) Clock selected: XC0 +-#define AT91C_TC_CLKS_XC1 (0x6) // (TC) Clock selected: XC1 +-#define AT91C_TC_CLKS_XC2 (0x7) // (TC) Clock selected: XC2 +-#define AT91C_TC_CLKI (0x1 << 3) // (TC) Clock Invert +-#define AT91C_TC_BURST (0x3 << 4) // (TC) Burst Signal Selection +-#define AT91C_TC_BURST_NONE (0x0 << 4) // (TC) The clock is not gated by an external signal +-#define AT91C_TC_BURST_XC0 (0x1 << 4) // (TC) XC0 is ANDed with the selected clock +-#define AT91C_TC_BURST_XC1 (0x2 << 4) // (TC) XC1 is ANDed with the selected clock +-#define AT91C_TC_BURST_XC2 (0x3 << 4) // (TC) XC2 is ANDed with the selected clock +-#define AT91C_TC_CPCSTOP (0x1 << 6) // (TC) Counter Clock Stopped with RC Compare +-#define AT91C_TC_LDBSTOP (0x1 << 6) // (TC) Counter Clock Stopped with RB Loading +-#define AT91C_TC_LDBDIS (0x1 << 7) // (TC) Counter Clock Disabled with RB Loading +-#define AT91C_TC_CPCDIS (0x1 << 7) // (TC) Counter Clock Disable with RC Compare +-#define AT91C_TC_ETRGEDG (0x3 << 8) // (TC) External Trigger Edge Selection +-#define AT91C_TC_ETRGEDG_NONE (0x0 << 8) // (TC) Edge: None +-#define AT91C_TC_ETRGEDG_RISING (0x1 << 8) // (TC) Edge: rising edge +-#define AT91C_TC_ETRGEDG_FALLING (0x2 << 8) // (TC) Edge: falling edge +-#define AT91C_TC_ETRGEDG_BOTH (0x3 << 8) // (TC) Edge: each edge +-#define AT91C_TC_EEVTEDG (0x3 << 8) // (TC) External Event Edge Selection +-#define AT91C_TC_EEVTEDG_NONE (0x0 << 8) // (TC) Edge: None +-#define AT91C_TC_EEVTEDG_RISING (0x1 << 8) // (TC) Edge: rising edge +-#define AT91C_TC_EEVTEDG_FALLING (0x2 << 8) // (TC) Edge: falling edge +-#define AT91C_TC_EEVTEDG_BOTH (0x3 << 8) // (TC) Edge: each edge +-#define AT91C_TC_ABETRG (0x1 << 10) // (TC) TIOA or TIOB External Trigger Selection +-#define AT91C_TC_EEVT (0x3 << 10) // (TC) External Event Selection +-#define AT91C_TC_EEVT_TIOB (0x0 << 10) // (TC) Signal selected as external event: TIOB TIOB direction: input +-#define AT91C_TC_EEVT_XC0 (0x1 << 10) // (TC) Signal selected as external event: XC0 TIOB direction: output +-#define AT91C_TC_EEVT_XC1 (0x2 << 10) // (TC) Signal selected as external event: XC1 TIOB direction: output +-#define AT91C_TC_EEVT_XC2 (0x3 << 10) // (TC) Signal selected as external event: XC2 TIOB direction: output +-#define AT91C_TC_ENETRG (0x1 << 12) // (TC) External Event Trigger enable +-#define AT91C_TC_WAVESEL (0x3 << 13) // (TC) Waveform Selection +-#define AT91C_TC_WAVESEL_UP (0x0 << 13) // (TC) UP mode without atomatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UPDOWN (0x1 << 13) // (TC) UPDOWN mode without automatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UP_AUTO (0x2 << 13) // (TC) UP mode with automatic trigger on RC Compare +-#define AT91C_TC_WAVESEL_UPDOWN_AUTO (0x3 << 13) // (TC) UPDOWN mode with automatic trigger on RC Compare +-#define AT91C_TC_CPCTRG (0x1 << 14) // (TC) RC Compare Trigger Enable +-#define AT91C_TC_WAVE (0x1 << 15) // (TC) +-#define AT91C_TC_LDRA (0x3 << 16) // (TC) RA Loading Selection +-#define AT91C_TC_LDRA_NONE (0x0 << 16) // (TC) Edge: None +-#define AT91C_TC_LDRA_RISING (0x1 << 16) // (TC) Edge: rising edge of TIOA +-#define AT91C_TC_LDRA_FALLING (0x2 << 16) // (TC) Edge: falling edge of TIOA +-#define AT91C_TC_LDRA_BOTH (0x3 << 16) // (TC) Edge: each edge of TIOA +-#define AT91C_TC_ACPA (0x3 << 16) // (TC) RA Compare Effect on TIOA +-#define AT91C_TC_ACPA_NONE (0x0 << 16) // (TC) Effect: none +-#define AT91C_TC_ACPA_SET (0x1 << 16) // (TC) Effect: set +-#define AT91C_TC_ACPA_CLEAR (0x2 << 16) // (TC) Effect: clear +-#define AT91C_TC_ACPA_TOGGLE (0x3 << 16) // (TC) Effect: toggle +-#define AT91C_TC_LDRB (0x3 << 18) // (TC) RB Loading Selection +-#define AT91C_TC_LDRB_NONE (0x0 << 18) // (TC) Edge: None +-#define AT91C_TC_LDRB_RISING (0x1 << 18) // (TC) Edge: rising edge of TIOA +-#define AT91C_TC_LDRB_FALLING (0x2 << 18) // (TC) Edge: falling edge of TIOA +-#define AT91C_TC_LDRB_BOTH (0x3 << 18) // (TC) Edge: each edge of TIOA +-#define AT91C_TC_ACPC (0x3 << 18) // (TC) RC Compare Effect on TIOA +-#define AT91C_TC_ACPC_NONE (0x0 << 18) // (TC) Effect: none +-#define AT91C_TC_ACPC_SET (0x1 << 18) // (TC) Effect: set +-#define AT91C_TC_ACPC_CLEAR (0x2 << 18) // (TC) Effect: clear +-#define AT91C_TC_ACPC_TOGGLE (0x3 << 18) // (TC) Effect: toggle +-#define AT91C_TC_AEEVT (0x3 << 20) // (TC) External Event Effect on TIOA +-#define AT91C_TC_AEEVT_NONE (0x0 << 20) // (TC) Effect: none +-#define AT91C_TC_AEEVT_SET (0x1 << 20) // (TC) Effect: set +-#define AT91C_TC_AEEVT_CLEAR (0x2 << 20) // (TC) Effect: clear +-#define AT91C_TC_AEEVT_TOGGLE (0x3 << 20) // (TC) Effect: toggle +-#define AT91C_TC_ASWTRG (0x3 << 22) // (TC) Software Trigger Effect on TIOA +-#define AT91C_TC_ASWTRG_NONE (0x0 << 22) // (TC) Effect: none +-#define AT91C_TC_ASWTRG_SET (0x1 << 22) // (TC) Effect: set +-#define AT91C_TC_ASWTRG_CLEAR (0x2 << 22) // (TC) Effect: clear +-#define AT91C_TC_ASWTRG_TOGGLE (0x3 << 22) // (TC) Effect: toggle +-#define AT91C_TC_BCPB (0x3 << 24) // (TC) RB Compare Effect on TIOB +-#define AT91C_TC_BCPB_NONE (0x0 << 24) // (TC) Effect: none +-#define AT91C_TC_BCPB_SET (0x1 << 24) // (TC) Effect: set +-#define AT91C_TC_BCPB_CLEAR (0x2 << 24) // (TC) Effect: clear +-#define AT91C_TC_BCPB_TOGGLE (0x3 << 24) // (TC) Effect: toggle +-#define AT91C_TC_BCPC (0x3 << 26) // (TC) RC Compare Effect on TIOB +-#define AT91C_TC_BCPC_NONE (0x0 << 26) // (TC) Effect: none +-#define AT91C_TC_BCPC_SET (0x1 << 26) // (TC) Effect: set +-#define AT91C_TC_BCPC_CLEAR (0x2 << 26) // (TC) Effect: clear +-#define AT91C_TC_BCPC_TOGGLE (0x3 << 26) // (TC) Effect: toggle +-#define AT91C_TC_BEEVT (0x3 << 28) // (TC) External Event Effect on TIOB +-#define AT91C_TC_BEEVT_NONE (0x0 << 28) // (TC) Effect: none +-#define AT91C_TC_BEEVT_SET (0x1 << 28) // (TC) Effect: set +-#define AT91C_TC_BEEVT_CLEAR (0x2 << 28) // (TC) Effect: clear +-#define AT91C_TC_BEEVT_TOGGLE (0x3 << 28) // (TC) Effect: toggle +-#define AT91C_TC_BSWTRG (0x3 << 30) // (TC) Software Trigger Effect on TIOB +-#define AT91C_TC_BSWTRG_NONE (0x0 << 30) // (TC) Effect: none +-#define AT91C_TC_BSWTRG_SET (0x1 << 30) // (TC) Effect: set +-#define AT91C_TC_BSWTRG_CLEAR (0x2 << 30) // (TC) Effect: clear +-#define AT91C_TC_BSWTRG_TOGGLE (0x3 << 30) // (TC) Effect: toggle +-// -------- TC_SR : (TC Offset: 0x20) TC Channel Status Register -------- +-#define AT91C_TC_COVFS (0x1 << 0) // (TC) Counter Overflow +-#define AT91C_TC_LOVRS (0x1 << 1) // (TC) Load Overrun +-#define AT91C_TC_CPAS (0x1 << 2) // (TC) RA Compare +-#define AT91C_TC_CPBS (0x1 << 3) // (TC) RB Compare +-#define AT91C_TC_CPCS (0x1 << 4) // (TC) RC Compare +-#define AT91C_TC_LDRAS (0x1 << 5) // (TC) RA Loading +-#define AT91C_TC_LDRBS (0x1 << 6) // (TC) RB Loading +-#define AT91C_TC_ETRGS (0x1 << 7) // (TC) External Trigger +-#define AT91C_TC_CLKSTA (0x1 << 16) // (TC) Clock Enabling +-#define AT91C_TC_MTIOA (0x1 << 17) // (TC) TIOA Mirror +-#define AT91C_TC_MTIOB (0x1 << 18) // (TC) TIOA Mirror +-// -------- TC_IER : (TC Offset: 0x24) TC Channel Interrupt Enable Register -------- +-// -------- TC_IDR : (TC Offset: 0x28) TC Channel Interrupt Disable Register -------- +-// -------- TC_IMR : (TC Offset: 0x2c) TC Channel Interrupt Mask Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Timer Counter Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_TCB structure *** +-#define TCB_TC0 ( 0) // TC Channel 0 +-#define TCB_TC1 (64) // TC Channel 1 +-#define TCB_TC2 (128) // TC Channel 2 +-#define TCB_BCR (192) // TC Block Control Register +-#define TCB_BMR (196) // TC Block Mode Register +-// -------- TCB_BCR : (TCB Offset: 0xc0) TC Block Control Register -------- +-#define AT91C_TCB_SYNC (0x1 << 0) // (TCB) Synchro Command +-// -------- TCB_BMR : (TCB Offset: 0xc4) TC Block Mode Register -------- +-#define AT91C_TCB_TC0XC0S (0x3 << 0) // (TCB) External Clock Signal 0 Selection +-#define AT91C_TCB_TC0XC0S_TCLK0 (0x0) // (TCB) TCLK0 connected to XC0 +-#define AT91C_TCB_TC0XC0S_NONE (0x1) // (TCB) None signal connected to XC0 +-#define AT91C_TCB_TC0XC0S_TIOA1 (0x2) // (TCB) TIOA1 connected to XC0 +-#define AT91C_TCB_TC0XC0S_TIOA2 (0x3) // (TCB) TIOA2 connected to XC0 +-#define AT91C_TCB_TC1XC1S (0x3 << 2) // (TCB) External Clock Signal 1 Selection +-#define AT91C_TCB_TC1XC1S_TCLK1 (0x0 << 2) // (TCB) TCLK1 connected to XC1 +-#define AT91C_TCB_TC1XC1S_NONE (0x1 << 2) // (TCB) None signal connected to XC1 +-#define AT91C_TCB_TC1XC1S_TIOA0 (0x2 << 2) // (TCB) TIOA0 connected to XC1 +-#define AT91C_TCB_TC1XC1S_TIOA2 (0x3 << 2) // (TCB) TIOA2 connected to XC1 +-#define AT91C_TCB_TC2XC2S (0x3 << 4) // (TCB) External Clock Signal 2 Selection +-#define AT91C_TCB_TC2XC2S_TCLK2 (0x0 << 4) // (TCB) TCLK2 connected to XC2 +-#define AT91C_TCB_TC2XC2S_NONE (0x1 << 4) // (TCB) None signal connected to XC2 +-#define AT91C_TCB_TC2XC2S_TIOA0 (0x2 << 4) // (TCB) TIOA0 connected to XC2 +-#define AT91C_TCB_TC2XC2S_TIOA1 (0x3 << 4) // (TCB) TIOA2 connected to XC2 +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Control Area Network MailBox Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_CAN_MB structure *** +-#define CAN_MB_MMR ( 0) // MailBox Mode Register +-#define CAN_MB_MAM ( 4) // MailBox Acceptance Mask Register +-#define CAN_MB_MID ( 8) // MailBox ID Register +-#define CAN_MB_MFID (12) // MailBox Family ID Register +-#define CAN_MB_MSR (16) // MailBox Status Register +-#define CAN_MB_MDL (20) // MailBox Data Low Register +-#define CAN_MB_MDH (24) // MailBox Data High Register +-#define CAN_MB_MCR (28) // MailBox Control Register +-// -------- CAN_MMR : (CAN_MB Offset: 0x0) CAN Message Mode Register -------- +-#define AT91C_CAN_MTIMEMARK (0xFFFF << 0) // (CAN_MB) Mailbox Timemark +-#define AT91C_CAN_PRIOR (0xF << 16) // (CAN_MB) Mailbox Priority +-#define AT91C_CAN_MOT (0x7 << 24) // (CAN_MB) Mailbox Object Type +-#define AT91C_CAN_MOT_DIS (0x0 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_RX (0x1 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_RXOVERWRITE (0x2 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_TX (0x3 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_CONSUMER (0x4 << 24) // (CAN_MB) +-#define AT91C_CAN_MOT_PRODUCER (0x5 << 24) // (CAN_MB) +-// -------- CAN_MAM : (CAN_MB Offset: 0x4) CAN Message Acceptance Mask Register -------- +-#define AT91C_CAN_MIDvB (0x3FFFF << 0) // (CAN_MB) Complementary bits for identifier in extended mode +-#define AT91C_CAN_MIDvA (0x7FF << 18) // (CAN_MB) Identifier for standard frame mode +-#define AT91C_CAN_MIDE (0x1 << 29) // (CAN_MB) Identifier Version +-// -------- CAN_MID : (CAN_MB Offset: 0x8) CAN Message ID Register -------- +-// -------- CAN_MFID : (CAN_MB Offset: 0xc) CAN Message Family ID Register -------- +-// -------- CAN_MSR : (CAN_MB Offset: 0x10) CAN Message Status Register -------- +-#define AT91C_CAN_MTIMESTAMP (0xFFFF << 0) // (CAN_MB) Timer Value +-#define AT91C_CAN_MDLC (0xF << 16) // (CAN_MB) Mailbox Data Length Code +-#define AT91C_CAN_MRTR (0x1 << 20) // (CAN_MB) Mailbox Remote Transmission Request +-#define AT91C_CAN_MABT (0x1 << 22) // (CAN_MB) Mailbox Message Abort +-#define AT91C_CAN_MRDY (0x1 << 23) // (CAN_MB) Mailbox Ready +-#define AT91C_CAN_MMI (0x1 << 24) // (CAN_MB) Mailbox Message Ignored +-// -------- CAN_MDL : (CAN_MB Offset: 0x14) CAN Message Data Low Register -------- +-// -------- CAN_MDH : (CAN_MB Offset: 0x18) CAN Message Data High Register -------- +-// -------- CAN_MCR : (CAN_MB Offset: 0x1c) CAN Message Control Register -------- +-#define AT91C_CAN_MACR (0x1 << 22) // (CAN_MB) Abort Request for Mailbox +-#define AT91C_CAN_MTCR (0x1 << 23) // (CAN_MB) Mailbox Transfer Command +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Control Area Network Interface +-// ***************************************************************************** +-// *** Register offset in AT91S_CAN structure *** +-#define CAN_MR ( 0) // Mode Register +-#define CAN_IER ( 4) // Interrupt Enable Register +-#define CAN_IDR ( 8) // Interrupt Disable Register +-#define CAN_IMR (12) // Interrupt Mask Register +-#define CAN_SR (16) // Status Register +-#define CAN_BR (20) // Baudrate Register +-#define CAN_TIM (24) // Timer Register +-#define CAN_TIMESTP (28) // Time Stamp Register +-#define CAN_ECR (32) // Error Counter Register +-#define CAN_TCR (36) // Transfer Command Register +-#define CAN_ACR (40) // Abort Command Register +-#define CAN_VR (252) // Version Register +-#define CAN_MB0 (512) // CAN Mailbox 0 +-#define CAN_MB1 (544) // CAN Mailbox 1 +-#define CAN_MB2 (576) // CAN Mailbox 2 +-#define CAN_MB3 (608) // CAN Mailbox 3 +-#define CAN_MB4 (640) // CAN Mailbox 4 +-#define CAN_MB5 (672) // CAN Mailbox 5 +-#define CAN_MB6 (704) // CAN Mailbox 6 +-#define CAN_MB7 (736) // CAN Mailbox 7 +-#define CAN_MB8 (768) // CAN Mailbox 8 +-#define CAN_MB9 (800) // CAN Mailbox 9 +-#define CAN_MB10 (832) // CAN Mailbox 10 +-#define CAN_MB11 (864) // CAN Mailbox 11 +-#define CAN_MB12 (896) // CAN Mailbox 12 +-#define CAN_MB13 (928) // CAN Mailbox 13 +-#define CAN_MB14 (960) // CAN Mailbox 14 +-#define CAN_MB15 (992) // CAN Mailbox 15 +-// -------- CAN_MR : (CAN Offset: 0x0) CAN Mode Register -------- +-#define AT91C_CAN_CANEN (0x1 << 0) // (CAN) CAN Controller Enable +-#define AT91C_CAN_LPM (0x1 << 1) // (CAN) Disable/Enable Low Power Mode +-#define AT91C_CAN_ABM (0x1 << 2) // (CAN) Disable/Enable Autobaud/Listen Mode +-#define AT91C_CAN_OVL (0x1 << 3) // (CAN) Disable/Enable Overload Frame +-#define AT91C_CAN_TEOF (0x1 << 4) // (CAN) Time Stamp messages at each end of Frame +-#define AT91C_CAN_TTM (0x1 << 5) // (CAN) Disable/Enable Time Trigger Mode +-#define AT91C_CAN_TIMFRZ (0x1 << 6) // (CAN) Enable Timer Freeze +-#define AT91C_CAN_DRPT (0x1 << 7) // (CAN) Disable Repeat +-// -------- CAN_IER : (CAN Offset: 0x4) CAN Interrupt Enable Register -------- +-#define AT91C_CAN_MB0 (0x1 << 0) // (CAN) Mailbox 0 Flag +-#define AT91C_CAN_MB1 (0x1 << 1) // (CAN) Mailbox 1 Flag +-#define AT91C_CAN_MB2 (0x1 << 2) // (CAN) Mailbox 2 Flag +-#define AT91C_CAN_MB3 (0x1 << 3) // (CAN) Mailbox 3 Flag +-#define AT91C_CAN_MB4 (0x1 << 4) // (CAN) Mailbox 4 Flag +-#define AT91C_CAN_MB5 (0x1 << 5) // (CAN) Mailbox 5 Flag +-#define AT91C_CAN_MB6 (0x1 << 6) // (CAN) Mailbox 6 Flag +-#define AT91C_CAN_MB7 (0x1 << 7) // (CAN) Mailbox 7 Flag +-#define AT91C_CAN_MB8 (0x1 << 8) // (CAN) Mailbox 8 Flag +-#define AT91C_CAN_MB9 (0x1 << 9) // (CAN) Mailbox 9 Flag +-#define AT91C_CAN_MB10 (0x1 << 10) // (CAN) Mailbox 10 Flag +-#define AT91C_CAN_MB11 (0x1 << 11) // (CAN) Mailbox 11 Flag +-#define AT91C_CAN_MB12 (0x1 << 12) // (CAN) Mailbox 12 Flag +-#define AT91C_CAN_MB13 (0x1 << 13) // (CAN) Mailbox 13 Flag +-#define AT91C_CAN_MB14 (0x1 << 14) // (CAN) Mailbox 14 Flag +-#define AT91C_CAN_MB15 (0x1 << 15) // (CAN) Mailbox 15 Flag +-#define AT91C_CAN_ERRA (0x1 << 16) // (CAN) Error Active Mode Flag +-#define AT91C_CAN_WARN (0x1 << 17) // (CAN) Warning Limit Flag +-#define AT91C_CAN_ERRP (0x1 << 18) // (CAN) Error Passive Mode Flag +-#define AT91C_CAN_BOFF (0x1 << 19) // (CAN) Bus Off Mode Flag +-#define AT91C_CAN_SLEEP (0x1 << 20) // (CAN) Sleep Flag +-#define AT91C_CAN_WAKEUP (0x1 << 21) // (CAN) Wakeup Flag +-#define AT91C_CAN_TOVF (0x1 << 22) // (CAN) Timer Overflow Flag +-#define AT91C_CAN_TSTP (0x1 << 23) // (CAN) Timestamp Flag +-#define AT91C_CAN_CERR (0x1 << 24) // (CAN) CRC Error +-#define AT91C_CAN_SERR (0x1 << 25) // (CAN) Stuffing Error +-#define AT91C_CAN_AERR (0x1 << 26) // (CAN) Acknowledgment Error +-#define AT91C_CAN_FERR (0x1 << 27) // (CAN) Form Error +-#define AT91C_CAN_BERR (0x1 << 28) // (CAN) Bit Error +-// -------- CAN_IDR : (CAN Offset: 0x8) CAN Interrupt Disable Register -------- +-// -------- CAN_IMR : (CAN Offset: 0xc) CAN Interrupt Mask Register -------- +-// -------- CAN_SR : (CAN Offset: 0x10) CAN Status Register -------- +-#define AT91C_CAN_RBSY (0x1 << 29) // (CAN) Receiver Busy +-#define AT91C_CAN_TBSY (0x1 << 30) // (CAN) Transmitter Busy +-#define AT91C_CAN_OVLY (0x1 << 31) // (CAN) Overload Busy +-// -------- CAN_BR : (CAN Offset: 0x14) CAN Baudrate Register -------- +-#define AT91C_CAN_PHASE2 (0x7 << 0) // (CAN) Phase 2 segment +-#define AT91C_CAN_PHASE1 (0x7 << 4) // (CAN) Phase 1 segment +-#define AT91C_CAN_PROPAG (0x7 << 8) // (CAN) Programmation time segment +-#define AT91C_CAN_SYNC (0x3 << 12) // (CAN) Re-synchronization jump width segment +-#define AT91C_CAN_BRP (0x7F << 16) // (CAN) Baudrate Prescaler +-#define AT91C_CAN_SMP (0x1 << 24) // (CAN) Sampling mode +-// -------- CAN_TIM : (CAN Offset: 0x18) CAN Timer Register -------- +-#define AT91C_CAN_TIMER (0xFFFF << 0) // (CAN) Timer field +-// -------- CAN_TIMESTP : (CAN Offset: 0x1c) CAN Timestamp Register -------- +-// -------- CAN_ECR : (CAN Offset: 0x20) CAN Error Counter Register -------- +-#define AT91C_CAN_REC (0xFF << 0) // (CAN) Receive Error Counter +-#define AT91C_CAN_TEC (0xFF << 16) // (CAN) Transmit Error Counter +-// -------- CAN_TCR : (CAN Offset: 0x24) CAN Transfer Command Register -------- +-#define AT91C_CAN_TIMRST (0x1 << 31) // (CAN) Timer Reset Field +-// -------- CAN_ACR : (CAN Offset: 0x28) CAN Abort Command Register -------- +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Ethernet MAC 10/100 +-// ***************************************************************************** +-// *** Register offset in AT91S_EMAC structure *** +-#define EMAC_NCR ( 0) // Network Control Register +-#define EMAC_NCFGR ( 4) // Network Configuration Register +-#define EMAC_NSR ( 8) // Network Status Register +-#define EMAC_TSR (20) // Transmit Status Register +-#define EMAC_RBQP (24) // Receive Buffer Queue Pointer +-#define EMAC_TBQP (28) // Transmit Buffer Queue Pointer +-#define EMAC_RSR (32) // Receive Status Register +-#define EMAC_ISR (36) // Interrupt Status Register +-#define EMAC_IER (40) // Interrupt Enable Register +-#define EMAC_IDR (44) // Interrupt Disable Register +-#define EMAC_IMR (48) // Interrupt Mask Register +-#define EMAC_MAN (52) // PHY Maintenance Register +-#define EMAC_PTR (56) // Pause Time Register +-#define EMAC_PFR (60) // Pause Frames received Register +-#define EMAC_FTO (64) // Frames Transmitted OK Register +-#define EMAC_SCF (68) // Single Collision Frame Register +-#define EMAC_MCF (72) // Multiple Collision Frame Register +-#define EMAC_FRO (76) // Frames Received OK Register +-#define EMAC_FCSE (80) // Frame Check Sequence Error Register +-#define EMAC_ALE (84) // Alignment Error Register +-#define EMAC_DTF (88) // Deferred Transmission Frame Register +-#define EMAC_LCOL (92) // Late Collision Register +-#define EMAC_ECOL (96) // Excessive Collision Register +-#define EMAC_TUND (100) // Transmit Underrun Error Register +-#define EMAC_CSE (104) // Carrier Sense Error Register +-#define EMAC_RRE (108) // Receive Ressource Error Register +-#define EMAC_ROV (112) // Receive Overrun Errors Register +-#define EMAC_RSE (116) // Receive Symbol Errors Register +-#define EMAC_ELE (120) // Excessive Length Errors Register +-#define EMAC_RJA (124) // Receive Jabbers Register +-#define EMAC_USF (128) // Undersize Frames Register +-#define EMAC_STE (132) // SQE Test Error Register +-#define EMAC_RLE (136) // Receive Length Field Mismatch Register +-#define EMAC_TPF (140) // Transmitted Pause Frames Register +-#define EMAC_HRB (144) // Hash Address Bottom[31:0] +-#define EMAC_HRT (148) // Hash Address Top[63:32] +-#define EMAC_SA1L (152) // Specific Address 1 Bottom, First 4 bytes +-#define EMAC_SA1H (156) // Specific Address 1 Top, Last 2 bytes +-#define EMAC_SA2L (160) // Specific Address 2 Bottom, First 4 bytes +-#define EMAC_SA2H (164) // Specific Address 2 Top, Last 2 bytes +-#define EMAC_SA3L (168) // Specific Address 3 Bottom, First 4 bytes +-#define EMAC_SA3H (172) // Specific Address 3 Top, Last 2 bytes +-#define EMAC_SA4L (176) // Specific Address 4 Bottom, First 4 bytes +-#define EMAC_SA4H (180) // Specific Address 4 Top, Last 2 bytes +-#define EMAC_TID (184) // Type ID Checking Register +-#define EMAC_TPQ (188) // Transmit Pause Quantum Register +-#define EMAC_USRIO (192) // USER Input/Output Register +-#define EMAC_WOL (196) // Wake On LAN Register +-#define EMAC_REV (252) // Revision Register +-// -------- EMAC_NCR : (EMAC Offset: 0x0) -------- +-#define AT91C_EMAC_LB (0x1 << 0) // (EMAC) Loopback. Optional. When set, loopback signal is at high level. +-#define AT91C_EMAC_LLB (0x1 << 1) // (EMAC) Loopback local. +-#define AT91C_EMAC_RE (0x1 << 2) // (EMAC) Receive enable. +-#define AT91C_EMAC_TE (0x1 << 3) // (EMAC) Transmit enable. +-#define AT91C_EMAC_MPE (0x1 << 4) // (EMAC) Management port enable. +-#define AT91C_EMAC_CLRSTAT (0x1 << 5) // (EMAC) Clear statistics registers. +-#define AT91C_EMAC_INCSTAT (0x1 << 6) // (EMAC) Increment statistics registers. +-#define AT91C_EMAC_WESTAT (0x1 << 7) // (EMAC) Write enable for statistics registers. +-#define AT91C_EMAC_BP (0x1 << 8) // (EMAC) Back pressure. +-#define AT91C_EMAC_TSTART (0x1 << 9) // (EMAC) Start Transmission. +-#define AT91C_EMAC_THALT (0x1 << 10) // (EMAC) Transmission Halt. +-#define AT91C_EMAC_TPFR (0x1 << 11) // (EMAC) Transmit pause frame +-#define AT91C_EMAC_TZQ (0x1 << 12) // (EMAC) Transmit zero quantum pause frame +-// -------- EMAC_NCFGR : (EMAC Offset: 0x4) Network Configuration Register -------- +-#define AT91C_EMAC_SPD (0x1 << 0) // (EMAC) Speed. +-#define AT91C_EMAC_FD (0x1 << 1) // (EMAC) Full duplex. +-#define AT91C_EMAC_JFRAME (0x1 << 3) // (EMAC) Jumbo Frames. +-#define AT91C_EMAC_CAF (0x1 << 4) // (EMAC) Copy all frames. +-#define AT91C_EMAC_NBC (0x1 << 5) // (EMAC) No broadcast. +-#define AT91C_EMAC_MTI (0x1 << 6) // (EMAC) Multicast hash event enable +-#define AT91C_EMAC_UNI (0x1 << 7) // (EMAC) Unicast hash enable. +-#define AT91C_EMAC_BIG (0x1 << 8) // (EMAC) Receive 1522 bytes. +-#define AT91C_EMAC_EAE (0x1 << 9) // (EMAC) External address match enable. +-#define AT91C_EMAC_CLK (0x3 << 10) // (EMAC) +-#define AT91C_EMAC_CLK_HCLK_8 (0x0 << 10) // (EMAC) HCLK divided by 8 +-#define AT91C_EMAC_CLK_HCLK_16 (0x1 << 10) // (EMAC) HCLK divided by 16 +-#define AT91C_EMAC_CLK_HCLK_32 (0x2 << 10) // (EMAC) HCLK divided by 32 +-#define AT91C_EMAC_CLK_HCLK_64 (0x3 << 10) // (EMAC) HCLK divided by 64 +-#define AT91C_EMAC_RTY (0x1 << 12) // (EMAC) +-#define AT91C_EMAC_PAE (0x1 << 13) // (EMAC) +-#define AT91C_EMAC_RBOF (0x3 << 14) // (EMAC) +-#define AT91C_EMAC_RBOF_OFFSET_0 (0x0 << 14) // (EMAC) no offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_1 (0x1 << 14) // (EMAC) one byte offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_2 (0x2 << 14) // (EMAC) two bytes offset from start of receive buffer +-#define AT91C_EMAC_RBOF_OFFSET_3 (0x3 << 14) // (EMAC) three bytes offset from start of receive buffer +-#define AT91C_EMAC_RLCE (0x1 << 16) // (EMAC) Receive Length field Checking Enable +-#define AT91C_EMAC_DRFCS (0x1 << 17) // (EMAC) Discard Receive FCS +-#define AT91C_EMAC_EFRHD (0x1 << 18) // (EMAC) +-#define AT91C_EMAC_IRXFCS (0x1 << 19) // (EMAC) Ignore RX FCS +-// -------- EMAC_NSR : (EMAC Offset: 0x8) Network Status Register -------- +-#define AT91C_EMAC_LINKR (0x1 << 0) // (EMAC) +-#define AT91C_EMAC_MDIO (0x1 << 1) // (EMAC) +-#define AT91C_EMAC_IDLE (0x1 << 2) // (EMAC) +-// -------- EMAC_TSR : (EMAC Offset: 0x14) Transmit Status Register -------- +-#define AT91C_EMAC_UBR (0x1 << 0) // (EMAC) +-#define AT91C_EMAC_COL (0x1 << 1) // (EMAC) +-#define AT91C_EMAC_RLES (0x1 << 2) // (EMAC) +-#define AT91C_EMAC_TGO (0x1 << 3) // (EMAC) Transmit Go +-#define AT91C_EMAC_BEX (0x1 << 4) // (EMAC) Buffers exhausted mid frame +-#define AT91C_EMAC_COMP (0x1 << 5) // (EMAC) +-#define AT91C_EMAC_UND (0x1 << 6) // (EMAC) +-// -------- EMAC_RSR : (EMAC Offset: 0x20) Receive Status Register -------- +-#define AT91C_EMAC_BNA (0x1 << 0) // (EMAC) +-#define AT91C_EMAC_REC (0x1 << 1) // (EMAC) +-#define AT91C_EMAC_OVR (0x1 << 2) // (EMAC) +-// -------- EMAC_ISR : (EMAC Offset: 0x24) Interrupt Status Register -------- +-#define AT91C_EMAC_MFD (0x1 << 0) // (EMAC) +-#define AT91C_EMAC_RCOMP (0x1 << 1) // (EMAC) +-#define AT91C_EMAC_RXUBR (0x1 << 2) // (EMAC) +-#define AT91C_EMAC_TXUBR (0x1 << 3) // (EMAC) +-#define AT91C_EMAC_TUNDR (0x1 << 4) // (EMAC) +-#define AT91C_EMAC_RLEX (0x1 << 5) // (EMAC) +-#define AT91C_EMAC_TXERR (0x1 << 6) // (EMAC) +-#define AT91C_EMAC_TCOMP (0x1 << 7) // (EMAC) +-#define AT91C_EMAC_LINK (0x1 << 9) // (EMAC) +-#define AT91C_EMAC_ROVR (0x1 << 10) // (EMAC) +-#define AT91C_EMAC_HRESP (0x1 << 11) // (EMAC) +-#define AT91C_EMAC_PFRE (0x1 << 12) // (EMAC) +-#define AT91C_EMAC_PTZ (0x1 << 13) // (EMAC) +-// -------- EMAC_IER : (EMAC Offset: 0x28) Interrupt Enable Register -------- +-// -------- EMAC_IDR : (EMAC Offset: 0x2c) Interrupt Disable Register -------- +-// -------- EMAC_IMR : (EMAC Offset: 0x30) Interrupt Mask Register -------- +-// -------- EMAC_MAN : (EMAC Offset: 0x34) PHY Maintenance Register -------- +-#define AT91C_EMAC_DATA (0xFFFF << 0) // (EMAC) +-#define AT91C_EMAC_CODE (0x3 << 16) // (EMAC) +-#define AT91C_EMAC_REGA (0x1F << 18) // (EMAC) +-#define AT91C_EMAC_PHYA (0x1F << 23) // (EMAC) +-#define AT91C_EMAC_RW (0x3 << 28) // (EMAC) +-#define AT91C_EMAC_SOF (0x3 << 30) // (EMAC) +-// -------- EMAC_USRIO : (EMAC Offset: 0xc0) USER Input Output Register -------- +-#define AT91C_EMAC_RMII (0x1 << 0) // (EMAC) Reduce MII +-#define AT91C_EMAC_CLKEN (0x1 << 1) // (EMAC) Clock Enable +-// -------- EMAC_WOL : (EMAC Offset: 0xc4) Wake On LAN Register -------- +-#define AT91C_EMAC_IP (0xFFFF << 0) // (EMAC) ARP request IP address +-#define AT91C_EMAC_MAG (0x1 << 16) // (EMAC) Magic packet event enable +-#define AT91C_EMAC_ARP (0x1 << 17) // (EMAC) ARP request event enable +-#define AT91C_EMAC_SA1 (0x1 << 18) // (EMAC) Specific address register 1 event enable +-// -------- EMAC_REV : (EMAC Offset: 0xfc) Revision Register -------- +-#define AT91C_EMAC_REVREF (0xFFFF << 0) // (EMAC) +-#define AT91C_EMAC_PARTREF (0xFFFF << 16) // (EMAC) +- +-// ***************************************************************************** +-// SOFTWARE API DEFINITION FOR Analog to Digital Convertor +-// ***************************************************************************** +-// *** Register offset in AT91S_ADC structure *** +-#define ADC_CR ( 0) // ADC Control Register +-#define ADC_MR ( 4) // ADC Mode Register +-#define ADC_CHER (16) // ADC Channel Enable Register +-#define ADC_CHDR (20) // ADC Channel Disable Register +-#define ADC_CHSR (24) // ADC Channel Status Register +-#define ADC_SR (28) // ADC Status Register +-#define ADC_LCDR (32) // ADC Last Converted Data Register +-#define ADC_IER (36) // ADC Interrupt Enable Register +-#define ADC_IDR (40) // ADC Interrupt Disable Register +-#define ADC_IMR (44) // ADC Interrupt Mask Register +-#define ADC_CDR0 (48) // ADC Channel Data Register 0 +-#define ADC_CDR1 (52) // ADC Channel Data Register 1 +-#define ADC_CDR2 (56) // ADC Channel Data Register 2 +-#define ADC_CDR3 (60) // ADC Channel Data Register 3 +-#define ADC_CDR4 (64) // ADC Channel Data Register 4 +-#define ADC_CDR5 (68) // ADC Channel Data Register 5 +-#define ADC_CDR6 (72) // ADC Channel Data Register 6 +-#define ADC_CDR7 (76) // ADC Channel Data Register 7 +-#define ADC_RPR (256) // Receive Pointer Register +-#define ADC_RCR (260) // Receive Counter Register +-#define ADC_TPR (264) // Transmit Pointer Register +-#define ADC_TCR (268) // Transmit Counter Register +-#define ADC_RNPR (272) // Receive Next Pointer Register +-#define ADC_RNCR (276) // Receive Next Counter Register +-#define ADC_TNPR (280) // Transmit Next Pointer Register +-#define ADC_TNCR (284) // Transmit Next Counter Register +-#define ADC_PTCR (288) // PDC Transfer Control Register +-#define ADC_PTSR (292) // PDC Transfer Status Register +-// -------- ADC_CR : (ADC Offset: 0x0) ADC Control Register -------- +-#define AT91C_ADC_SWRST (0x1 << 0) // (ADC) Software Reset +-#define AT91C_ADC_START (0x1 << 1) // (ADC) Start Conversion +-// -------- ADC_MR : (ADC Offset: 0x4) ADC Mode Register -------- +-#define AT91C_ADC_TRGEN (0x1 << 0) // (ADC) Trigger Enable +-#define AT91C_ADC_TRGEN_DIS (0x0) // (ADC) Hradware triggers are disabled. Starting a conversion is only possible by software +-#define AT91C_ADC_TRGEN_EN (0x1) // (ADC) Hardware trigger selected by TRGSEL field is enabled. +-#define AT91C_ADC_TRGSEL (0x7 << 1) // (ADC) Trigger Selection +-#define AT91C_ADC_TRGSEL_TIOA0 (0x0 << 1) // (ADC) Selected TRGSEL = TIAO0 +-#define AT91C_ADC_TRGSEL_TIOA1 (0x1 << 1) // (ADC) Selected TRGSEL = TIAO1 +-#define AT91C_ADC_TRGSEL_TIOA2 (0x2 << 1) // (ADC) Selected TRGSEL = TIAO2 +-#define AT91C_ADC_TRGSEL_TIOA3 (0x3 << 1) // (ADC) Selected TRGSEL = TIAO3 +-#define AT91C_ADC_TRGSEL_TIOA4 (0x4 << 1) // (ADC) Selected TRGSEL = TIAO4 +-#define AT91C_ADC_TRGSEL_TIOA5 (0x5 << 1) // (ADC) Selected TRGSEL = TIAO5 +-#define AT91C_ADC_TRGSEL_EXT (0x6 << 1) // (ADC) Selected TRGSEL = External Trigger +-#define AT91C_ADC_LOWRES (0x1 << 4) // (ADC) Resolution. +-#define AT91C_ADC_LOWRES_10_BIT (0x0 << 4) // (ADC) 10-bit resolution +-#define AT91C_ADC_LOWRES_8_BIT (0x1 << 4) // (ADC) 8-bit resolution +-#define AT91C_ADC_SLEEP (0x1 << 5) // (ADC) Sleep Mode +-#define AT91C_ADC_SLEEP_NORMAL_MODE (0x0 << 5) // (ADC) Normal Mode +-#define AT91C_ADC_SLEEP_MODE (0x1 << 5) // (ADC) Sleep Mode +-#define AT91C_ADC_PRESCAL (0x3F << 8) // (ADC) Prescaler rate selection +-#define AT91C_ADC_STARTUP (0x1F << 16) // (ADC) Startup Time +-#define AT91C_ADC_SHTIM (0xF << 24) // (ADC) Sample & Hold Time +-// -------- ADC_CHER : (ADC Offset: 0x10) ADC Channel Enable Register -------- +-#define AT91C_ADC_CH0 (0x1 << 0) // (ADC) Channel 0 +-#define AT91C_ADC_CH1 (0x1 << 1) // (ADC) Channel 1 +-#define AT91C_ADC_CH2 (0x1 << 2) // (ADC) Channel 2 +-#define AT91C_ADC_CH3 (0x1 << 3) // (ADC) Channel 3 +-#define AT91C_ADC_CH4 (0x1 << 4) // (ADC) Channel 4 +-#define AT91C_ADC_CH5 (0x1 << 5) // (ADC) Channel 5 +-#define AT91C_ADC_CH6 (0x1 << 6) // (ADC) Channel 6 +-#define AT91C_ADC_CH7 (0x1 << 7) // (ADC) Channel 7 +-// -------- ADC_CHDR : (ADC Offset: 0x14) ADC Channel Disable Register -------- +-// -------- ADC_CHSR : (ADC Offset: 0x18) ADC Channel Status Register -------- +-// -------- ADC_SR : (ADC Offset: 0x1c) ADC Status Register -------- +-#define AT91C_ADC_EOC0 (0x1 << 0) // (ADC) End of Conversion +-#define AT91C_ADC_EOC1 (0x1 << 1) // (ADC) End of Conversion +-#define AT91C_ADC_EOC2 (0x1 << 2) // (ADC) End of Conversion +-#define AT91C_ADC_EOC3 (0x1 << 3) // (ADC) End of Conversion +-#define AT91C_ADC_EOC4 (0x1 << 4) // (ADC) End of Conversion +-#define AT91C_ADC_EOC5 (0x1 << 5) // (ADC) End of Conversion +-#define AT91C_ADC_EOC6 (0x1 << 6) // (ADC) End of Conversion +-#define AT91C_ADC_EOC7 (0x1 << 7) // (ADC) End of Conversion +-#define AT91C_ADC_OVRE0 (0x1 << 8) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE1 (0x1 << 9) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE2 (0x1 << 10) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE3 (0x1 << 11) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE4 (0x1 << 12) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE5 (0x1 << 13) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE6 (0x1 << 14) // (ADC) Overrun Error +-#define AT91C_ADC_OVRE7 (0x1 << 15) // (ADC) Overrun Error +-#define AT91C_ADC_DRDY (0x1 << 16) // (ADC) Data Ready +-#define AT91C_ADC_GOVRE (0x1 << 17) // (ADC) General Overrun +-#define AT91C_ADC_ENDRX (0x1 << 18) // (ADC) End of Receiver Transfer +-#define AT91C_ADC_RXBUFF (0x1 << 19) // (ADC) RXBUFF Interrupt +-// -------- ADC_LCDR : (ADC Offset: 0x20) ADC Last Converted Data Register -------- +-#define AT91C_ADC_LDATA (0x3FF << 0) // (ADC) Last Data Converted +-// -------- ADC_IER : (ADC Offset: 0x24) ADC Interrupt Enable Register -------- +-// -------- ADC_IDR : (ADC Offset: 0x28) ADC Interrupt Disable Register -------- +-// -------- ADC_IMR : (ADC Offset: 0x2c) ADC Interrupt Mask Register -------- +-// -------- ADC_CDR0 : (ADC Offset: 0x30) ADC Channel Data Register 0 -------- +-#define AT91C_ADC_DATA (0x3FF << 0) // (ADC) Converted Data +-// -------- ADC_CDR1 : (ADC Offset: 0x34) ADC Channel Data Register 1 -------- +-// -------- ADC_CDR2 : (ADC Offset: 0x38) ADC Channel Data Register 2 -------- +-// -------- ADC_CDR3 : (ADC Offset: 0x3c) ADC Channel Data Register 3 -------- +-// -------- ADC_CDR4 : (ADC Offset: 0x40) ADC Channel Data Register 4 -------- +-// -------- ADC_CDR5 : (ADC Offset: 0x44) ADC Channel Data Register 5 -------- +-// -------- ADC_CDR6 : (ADC Offset: 0x48) ADC Channel Data Register 6 -------- +-// -------- ADC_CDR7 : (ADC Offset: 0x4c) ADC Channel Data Register 7 -------- +- +-// ***************************************************************************** +-// REGISTER ADDRESS DEFINITION FOR AT91SAM7X256 +-// ***************************************************************************** +-// ========== Register definition for SYS peripheral ========== +-// ========== Register definition for AIC peripheral ========== +-#define AT91C_AIC_ICCR (0xFFFFF128) // (AIC) Interrupt Clear Command Register +-#define AT91C_AIC_IECR (0xFFFFF120) // (AIC) Interrupt Enable Command Register +-#define AT91C_AIC_SMR (0xFFFFF000) // (AIC) Source Mode Register +-#define AT91C_AIC_ISCR (0xFFFFF12C) // (AIC) Interrupt Set Command Register +-#define AT91C_AIC_EOICR (0xFFFFF130) // (AIC) End of Interrupt Command Register +-#define AT91C_AIC_DCR (0xFFFFF138) // (AIC) Debug Control Register (Protect) +-#define AT91C_AIC_FFER (0xFFFFF140) // (AIC) Fast Forcing Enable Register +-#define AT91C_AIC_SVR (0xFFFFF080) // (AIC) Source Vector Register +-#define AT91C_AIC_SPU (0xFFFFF134) // (AIC) Spurious Vector Register +-#define AT91C_AIC_FFDR (0xFFFFF144) // (AIC) Fast Forcing Disable Register +-#define AT91C_AIC_FVR (0xFFFFF104) // (AIC) FIQ Vector Register +-#define AT91C_AIC_FFSR (0xFFFFF148) // (AIC) Fast Forcing Status Register +-#define AT91C_AIC_IMR (0xFFFFF110) // (AIC) Interrupt Mask Register +-#define AT91C_AIC_ISR (0xFFFFF108) // (AIC) Interrupt Status Register +-#define AT91C_AIC_IVR (0xFFFFF100) // (AIC) IRQ Vector Register +-#define AT91C_AIC_IDCR (0xFFFFF124) // (AIC) Interrupt Disable Command Register +-#define AT91C_AIC_CISR (0xFFFFF114) // (AIC) Core Interrupt Status Register +-#define AT91C_AIC_IPR (0xFFFFF10C) // (AIC) Interrupt Pending Register +-// ========== Register definition for PDC_DBGU peripheral ========== +-#define AT91C_DBGU_TNCR (0xFFFFF31C) // (PDC_DBGU) Transmit Next Counter Register +-#define AT91C_DBGU_RNCR (0xFFFFF314) // (PDC_DBGU) Receive Next Counter Register +-#define AT91C_DBGU_PTCR (0xFFFFF320) // (PDC_DBGU) PDC Transfer Control Register +-#define AT91C_DBGU_PTSR (0xFFFFF324) // (PDC_DBGU) PDC Transfer Status Register +-#define AT91C_DBGU_RCR (0xFFFFF304) // (PDC_DBGU) Receive Counter Register +-#define AT91C_DBGU_TCR (0xFFFFF30C) // (PDC_DBGU) Transmit Counter Register +-#define AT91C_DBGU_RPR (0xFFFFF300) // (PDC_DBGU) Receive Pointer Register +-#define AT91C_DBGU_TPR (0xFFFFF308) // (PDC_DBGU) Transmit Pointer Register +-#define AT91C_DBGU_RNPR (0xFFFFF310) // (PDC_DBGU) Receive Next Pointer Register +-#define AT91C_DBGU_TNPR (0xFFFFF318) // (PDC_DBGU) Transmit Next Pointer Register +-// ========== Register definition for DBGU peripheral ========== +-#define AT91C_DBGU_EXID (0xFFFFF244) // (DBGU) Chip ID Extension Register +-#define AT91C_DBGU_THR (0xFFFFF21C) // (DBGU) Transmitter Holding Register +-#define AT91C_DBGU_CSR (0xFFFFF214) // (DBGU) Channel Status Register +-#define AT91C_DBGU_IDR (0xFFFFF20C) // (DBGU) Interrupt Disable Register +-#define AT91C_DBGU_MR (0xFFFFF204) // (DBGU) Mode Register +-#define AT91C_DBGU_FNTR (0xFFFFF248) // (DBGU) Force NTRST Register +-#define AT91C_DBGU_CIDR (0xFFFFF240) // (DBGU) Chip ID Register +-#define AT91C_DBGU_BRGR (0xFFFFF220) // (DBGU) Baud Rate Generator Register +-#define AT91C_DBGU_RHR (0xFFFFF218) // (DBGU) Receiver Holding Register +-#define AT91C_DBGU_IMR (0xFFFFF210) // (DBGU) Interrupt Mask Register +-#define AT91C_DBGU_IER (0xFFFFF208) // (DBGU) Interrupt Enable Register +-#define AT91C_DBGU_CR (0xFFFFF200) // (DBGU) Control Register +-// ========== Register definition for PIOA peripheral ========== +-#define AT91C_PIOA_IMR (0xFFFFF448) // (PIOA) Interrupt Mask Register +-#define AT91C_PIOA_IER (0xFFFFF440) // (PIOA) Interrupt Enable Register +-#define AT91C_PIOA_OWDR (0xFFFFF4A4) // (PIOA) Output Write Disable Register +-#define AT91C_PIOA_ISR (0xFFFFF44C) // (PIOA) Interrupt Status Register +-#define AT91C_PIOA_PPUDR (0xFFFFF460) // (PIOA) Pull-up Disable Register +-#define AT91C_PIOA_MDSR (0xFFFFF458) // (PIOA) Multi-driver Status Register +-#define AT91C_PIOA_MDER (0xFFFFF450) // (PIOA) Multi-driver Enable Register +-#define AT91C_PIOA_PER (0xFFFFF400) // (PIOA) PIO Enable Register +-#define AT91C_PIOA_PSR (0xFFFFF408) // (PIOA) PIO Status Register +-#define AT91C_PIOA_OER (0xFFFFF410) // (PIOA) Output Enable Register +-#define AT91C_PIOA_BSR (0xFFFFF474) // (PIOA) Select B Register +-#define AT91C_PIOA_PPUER (0xFFFFF464) // (PIOA) Pull-up Enable Register +-#define AT91C_PIOA_MDDR (0xFFFFF454) // (PIOA) Multi-driver Disable Register +-#define AT91C_PIOA_PDR (0xFFFFF404) // (PIOA) PIO Disable Register +-#define AT91C_PIOA_ODR (0xFFFFF414) // (PIOA) Output Disable Registerr +-#define AT91C_PIOA_IFDR (0xFFFFF424) // (PIOA) Input Filter Disable Register +-#define AT91C_PIOA_ABSR (0xFFFFF478) // (PIOA) AB Select Status Register +-#define AT91C_PIOA_ASR (0xFFFFF470) // (PIOA) Select A Register +-#define AT91C_PIOA_PPUSR (0xFFFFF468) // (PIOA) Pull-up Status Register +-#define AT91C_PIOA_ODSR (0xFFFFF438) // (PIOA) Output Data Status Register +-#define AT91C_PIOA_SODR (0xFFFFF430) // (PIOA) Set Output Data Register +-#define AT91C_PIOA_IFSR (0xFFFFF428) // (PIOA) Input Filter Status Register +-#define AT91C_PIOA_IFER (0xFFFFF420) // (PIOA) Input Filter Enable Register +-#define AT91C_PIOA_OSR (0xFFFFF418) // (PIOA) Output Status Register +-#define AT91C_PIOA_IDR (0xFFFFF444) // (PIOA) Interrupt Disable Register +-#define AT91C_PIOA_PDSR (0xFFFFF43C) // (PIOA) Pin Data Status Register +-#define AT91C_PIOA_CODR (0xFFFFF434) // (PIOA) Clear Output Data Register +-#define AT91C_PIOA_OWSR (0xFFFFF4A8) // (PIOA) Output Write Status Register +-#define AT91C_PIOA_OWER (0xFFFFF4A0) // (PIOA) Output Write Enable Register +-// ========== Register definition for PIOB peripheral ========== +-#define AT91C_PIOB_OWSR (0xFFFFF6A8) // (PIOB) Output Write Status Register +-#define AT91C_PIOB_PPUSR (0xFFFFF668) // (PIOB) Pull-up Status Register +-#define AT91C_PIOB_PPUDR (0xFFFFF660) // (PIOB) Pull-up Disable Register +-#define AT91C_PIOB_MDSR (0xFFFFF658) // (PIOB) Multi-driver Status Register +-#define AT91C_PIOB_MDER (0xFFFFF650) // (PIOB) Multi-driver Enable Register +-#define AT91C_PIOB_IMR (0xFFFFF648) // (PIOB) Interrupt Mask Register +-#define AT91C_PIOB_OSR (0xFFFFF618) // (PIOB) Output Status Register +-#define AT91C_PIOB_OER (0xFFFFF610) // (PIOB) Output Enable Register +-#define AT91C_PIOB_PSR (0xFFFFF608) // (PIOB) PIO Status Register +-#define AT91C_PIOB_PER (0xFFFFF600) // (PIOB) PIO Enable Register +-#define AT91C_PIOB_BSR (0xFFFFF674) // (PIOB) Select B Register +-#define AT91C_PIOB_PPUER (0xFFFFF664) // (PIOB) Pull-up Enable Register +-#define AT91C_PIOB_IFDR (0xFFFFF624) // (PIOB) Input Filter Disable Register +-#define AT91C_PIOB_ODR (0xFFFFF614) // (PIOB) Output Disable Registerr +-#define AT91C_PIOB_ABSR (0xFFFFF678) // (PIOB) AB Select Status Register +-#define AT91C_PIOB_ASR (0xFFFFF670) // (PIOB) Select A Register +-#define AT91C_PIOB_IFER (0xFFFFF620) // (PIOB) Input Filter Enable Register +-#define AT91C_PIOB_IFSR (0xFFFFF628) // (PIOB) Input Filter Status Register +-#define AT91C_PIOB_SODR (0xFFFFF630) // (PIOB) Set Output Data Register +-#define AT91C_PIOB_ODSR (0xFFFFF638) // (PIOB) Output Data Status Register +-#define AT91C_PIOB_CODR (0xFFFFF634) // (PIOB) Clear Output Data Register +-#define AT91C_PIOB_PDSR (0xFFFFF63C) // (PIOB) Pin Data Status Register +-#define AT91C_PIOB_OWER (0xFFFFF6A0) // (PIOB) Output Write Enable Register +-#define AT91C_PIOB_IER (0xFFFFF640) // (PIOB) Interrupt Enable Register +-#define AT91C_PIOB_OWDR (0xFFFFF6A4) // (PIOB) Output Write Disable Register +-#define AT91C_PIOB_MDDR (0xFFFFF654) // (PIOB) Multi-driver Disable Register +-#define AT91C_PIOB_ISR (0xFFFFF64C) // (PIOB) Interrupt Status Register +-#define AT91C_PIOB_IDR (0xFFFFF644) // (PIOB) Interrupt Disable Register +-#define AT91C_PIOB_PDR (0xFFFFF604) // (PIOB) PIO Disable Register +-// ========== Register definition for CKGR peripheral ========== +-#define AT91C_CKGR_PLLR (0xFFFFFC2C) // (CKGR) PLL Register +-#define AT91C_CKGR_MCFR (0xFFFFFC24) // (CKGR) Main Clock Frequency Register +-#define AT91C_CKGR_MOR (0xFFFFFC20) // (CKGR) Main Oscillator Register +-// ========== Register definition for PMC peripheral ========== +-#define AT91C_PMC_SCSR (0xFFFFFC08) // (PMC) System Clock Status Register +-#define AT91C_PMC_SCER (0xFFFFFC00) // (PMC) System Clock Enable Register +-#define AT91C_PMC_IMR (0xFFFFFC6C) // (PMC) Interrupt Mask Register +-#define AT91C_PMC_IDR (0xFFFFFC64) // (PMC) Interrupt Disable Register +-#define AT91C_PMC_PCDR (0xFFFFFC14) // (PMC) Peripheral Clock Disable Register +-#define AT91C_PMC_SCDR (0xFFFFFC04) // (PMC) System Clock Disable Register +-#define AT91C_PMC_SR (0xFFFFFC68) // (PMC) Status Register +-#define AT91C_PMC_IER (0xFFFFFC60) // (PMC) Interrupt Enable Register +-#define AT91C_PMC_MCKR (0xFFFFFC30) // (PMC) Master Clock Register +-#define AT91C_PMC_MOR (0xFFFFFC20) // (PMC) Main Oscillator Register +-#define AT91C_PMC_PCER (0xFFFFFC10) // (PMC) Peripheral Clock Enable Register +-#define AT91C_PMC_PCSR (0xFFFFFC18) // (PMC) Peripheral Clock Status Register +-#define AT91C_PMC_PLLR (0xFFFFFC2C) // (PMC) PLL Register +-#define AT91C_PMC_MCFR (0xFFFFFC24) // (PMC) Main Clock Frequency Register +-#define AT91C_PMC_PCKR (0xFFFFFC40) // (PMC) Programmable Clock Register +-// ========== Register definition for RSTC peripheral ========== +-#define AT91C_RSTC_RSR (0xFFFFFD04) // (RSTC) Reset Status Register +-#define AT91C_RSTC_RMR (0xFFFFFD08) // (RSTC) Reset Mode Register +-#define AT91C_RSTC_RCR (0xFFFFFD00) // (RSTC) Reset Control Register +-// ========== Register definition for RTTC peripheral ========== +-#define AT91C_RTTC_RTSR (0xFFFFFD2C) // (RTTC) Real-time Status Register +-#define AT91C_RTTC_RTAR (0xFFFFFD24) // (RTTC) Real-time Alarm Register +-#define AT91C_RTTC_RTVR (0xFFFFFD28) // (RTTC) Real-time Value Register +-#define AT91C_RTTC_RTMR (0xFFFFFD20) // (RTTC) Real-time Mode Register +-// ========== Register definition for PITC peripheral ========== +-#define AT91C_PITC_PIIR (0xFFFFFD3C) // (PITC) Period Interval Image Register +-#define AT91C_PITC_PISR (0xFFFFFD34) // (PITC) Period Interval Status Register +-#define AT91C_PITC_PIVR (0xFFFFFD38) // (PITC) Period Interval Value Register +-#define AT91C_PITC_PIMR (0xFFFFFD30) // (PITC) Period Interval Mode Register +-// ========== Register definition for WDTC peripheral ========== +-#define AT91C_WDTC_WDMR (0xFFFFFD44) // (WDTC) Watchdog Mode Register +-#define AT91C_WDTC_WDSR (0xFFFFFD48) // (WDTC) Watchdog Status Register +-#define AT91C_WDTC_WDCR (0xFFFFFD40) // (WDTC) Watchdog Control Register +-// ========== Register definition for VREG peripheral ========== +-#define AT91C_VREG_MR (0xFFFFFD60) // (VREG) Voltage Regulator Mode Register +-// ========== Register definition for MC peripheral ========== +-#define AT91C_MC_FCR (0xFFFFFF64) // (MC) MC Flash Command Register +-#define AT91C_MC_ASR (0xFFFFFF04) // (MC) MC Abort Status Register +-#define AT91C_MC_FSR (0xFFFFFF68) // (MC) MC Flash Status Register +-#define AT91C_MC_FMR (0xFFFFFF60) // (MC) MC Flash Mode Register +-#define AT91C_MC_AASR (0xFFFFFF08) // (MC) MC Abort Address Status Register +-#define AT91C_MC_RCR (0xFFFFFF00) // (MC) MC Remap Control Register +-// ========== Register definition for PDC_SPI1 peripheral ========== +-#define AT91C_SPI1_RNPR (0xFFFE4110) // (PDC_SPI1) Receive Next Pointer Register +-#define AT91C_SPI1_TPR (0xFFFE4108) // (PDC_SPI1) Transmit Pointer Register +-#define AT91C_SPI1_RPR (0xFFFE4100) // (PDC_SPI1) Receive Pointer Register +-#define AT91C_SPI1_PTSR (0xFFFE4124) // (PDC_SPI1) PDC Transfer Status Register +-#define AT91C_SPI1_RCR (0xFFFE4104) // (PDC_SPI1) Receive Counter Register +-#define AT91C_SPI1_TCR (0xFFFE410C) // (PDC_SPI1) Transmit Counter Register +-#define AT91C_SPI1_RNCR (0xFFFE4114) // (PDC_SPI1) Receive Next Counter Register +-#define AT91C_SPI1_TNCR (0xFFFE411C) // (PDC_SPI1) Transmit Next Counter Register +-#define AT91C_SPI1_TNPR (0xFFFE4118) // (PDC_SPI1) Transmit Next Pointer Register +-#define AT91C_SPI1_PTCR (0xFFFE4120) // (PDC_SPI1) PDC Transfer Control Register +-// ========== Register definition for SPI1 peripheral ========== +-#define AT91C_SPI1_CSR (0xFFFE4030) // (SPI1) Chip Select Register +-#define AT91C_SPI1_IDR (0xFFFE4018) // (SPI1) Interrupt Disable Register +-#define AT91C_SPI1_SR (0xFFFE4010) // (SPI1) Status Register +-#define AT91C_SPI1_RDR (0xFFFE4008) // (SPI1) Receive Data Register +-#define AT91C_SPI1_CR (0xFFFE4000) // (SPI1) Control Register +-#define AT91C_SPI1_IMR (0xFFFE401C) // (SPI1) Interrupt Mask Register +-#define AT91C_SPI1_IER (0xFFFE4014) // (SPI1) Interrupt Enable Register +-#define AT91C_SPI1_TDR (0xFFFE400C) // (SPI1) Transmit Data Register +-#define AT91C_SPI1_MR (0xFFFE4004) // (SPI1) Mode Register +-// ========== Register definition for PDC_SPI0 peripheral ========== +-#define AT91C_SPI0_PTCR (0xFFFE0120) // (PDC_SPI0) PDC Transfer Control Register +-#define AT91C_SPI0_TNPR (0xFFFE0118) // (PDC_SPI0) Transmit Next Pointer Register +-#define AT91C_SPI0_RNPR (0xFFFE0110) // (PDC_SPI0) Receive Next Pointer Register +-#define AT91C_SPI0_TPR (0xFFFE0108) // (PDC_SPI0) Transmit Pointer Register +-#define AT91C_SPI0_RPR (0xFFFE0100) // (PDC_SPI0) Receive Pointer Register +-#define AT91C_SPI0_PTSR (0xFFFE0124) // (PDC_SPI0) PDC Transfer Status Register +-#define AT91C_SPI0_TNCR (0xFFFE011C) // (PDC_SPI0) Transmit Next Counter Register +-#define AT91C_SPI0_RNCR (0xFFFE0114) // (PDC_SPI0) Receive Next Counter Register +-#define AT91C_SPI0_TCR (0xFFFE010C) // (PDC_SPI0) Transmit Counter Register +-#define AT91C_SPI0_RCR (0xFFFE0104) // (PDC_SPI0) Receive Counter Register +-// ========== Register definition for SPI0 peripheral ========== +-#define AT91C_SPI0_CSR (0xFFFE0030) // (SPI0) Chip Select Register +-#define AT91C_SPI0_IDR (0xFFFE0018) // (SPI0) Interrupt Disable Register +-#define AT91C_SPI0_SR (0xFFFE0010) // (SPI0) Status Register +-#define AT91C_SPI0_RDR (0xFFFE0008) // (SPI0) Receive Data Register +-#define AT91C_SPI0_CR (0xFFFE0000) // (SPI0) Control Register +-#define AT91C_SPI0_IMR (0xFFFE001C) // (SPI0) Interrupt Mask Register +-#define AT91C_SPI0_IER (0xFFFE0014) // (SPI0) Interrupt Enable Register +-#define AT91C_SPI0_TDR (0xFFFE000C) // (SPI0) Transmit Data Register +-#define AT91C_SPI0_MR (0xFFFE0004) // (SPI0) Mode Register +-// ========== Register definition for PDC_US1 peripheral ========== +-#define AT91C_US1_PTSR (0xFFFC4124) // (PDC_US1) PDC Transfer Status Register +-#define AT91C_US1_TNCR (0xFFFC411C) // (PDC_US1) Transmit Next Counter Register +-#define AT91C_US1_RNCR (0xFFFC4114) // (PDC_US1) Receive Next Counter Register +-#define AT91C_US1_TCR (0xFFFC410C) // (PDC_US1) Transmit Counter Register +-#define AT91C_US1_RCR (0xFFFC4104) // (PDC_US1) Receive Counter Register +-#define AT91C_US1_PTCR (0xFFFC4120) // (PDC_US1) PDC Transfer Control Register +-#define AT91C_US1_TNPR (0xFFFC4118) // (PDC_US1) Transmit Next Pointer Register +-#define AT91C_US1_RNPR (0xFFFC4110) // (PDC_US1) Receive Next Pointer Register +-#define AT91C_US1_TPR (0xFFFC4108) // (PDC_US1) Transmit Pointer Register +-#define AT91C_US1_RPR (0xFFFC4100) // (PDC_US1) Receive Pointer Register +-// ========== Register definition for US1 peripheral ========== +-#define AT91C_US1_RHR (0xFFFC4018) // (US1) Receiver Holding Register +-#define AT91C_US1_IMR (0xFFFC4010) // (US1) Interrupt Mask Register +-#define AT91C_US1_IER (0xFFFC4008) // (US1) Interrupt Enable Register +-#define AT91C_US1_CR (0xFFFC4000) // (US1) Control Register +-#define AT91C_US1_RTOR (0xFFFC4024) // (US1) Receiver Time-out Register +-#define AT91C_US1_THR (0xFFFC401C) // (US1) Transmitter Holding Register +-#define AT91C_US1_CSR (0xFFFC4014) // (US1) Channel Status Register +-#define AT91C_US1_IDR (0xFFFC400C) // (US1) Interrupt Disable Register +-#define AT91C_US1_FIDI (0xFFFC4040) // (US1) FI_DI_Ratio Register +-#define AT91C_US1_BRGR (0xFFFC4020) // (US1) Baud Rate Generator Register +-#define AT91C_US1_TTGR (0xFFFC4028) // (US1) Transmitter Time-guard Register +-#define AT91C_US1_IF (0xFFFC404C) // (US1) IRDA_FILTER Register +-#define AT91C_US1_NER (0xFFFC4044) // (US1) Nb Errors Register +-#define AT91C_US1_MR (0xFFFC4004) // (US1) Mode Register +-// ========== Register definition for PDC_US0 peripheral ========== +-#define AT91C_US0_PTCR (0xFFFC0120) // (PDC_US0) PDC Transfer Control Register +-#define AT91C_US0_TNPR (0xFFFC0118) // (PDC_US0) Transmit Next Pointer Register +-#define AT91C_US0_RNPR (0xFFFC0110) // (PDC_US0) Receive Next Pointer Register +-#define AT91C_US0_TPR (0xFFFC0108) // (PDC_US0) Transmit Pointer Register +-#define AT91C_US0_RPR (0xFFFC0100) // (PDC_US0) Receive Pointer Register +-#define AT91C_US0_PTSR (0xFFFC0124) // (PDC_US0) PDC Transfer Status Register +-#define AT91C_US0_TNCR (0xFFFC011C) // (PDC_US0) Transmit Next Counter Register +-#define AT91C_US0_RNCR (0xFFFC0114) // (PDC_US0) Receive Next Counter Register +-#define AT91C_US0_TCR (0xFFFC010C) // (PDC_US0) Transmit Counter Register +-#define AT91C_US0_RCR (0xFFFC0104) // (PDC_US0) Receive Counter Register +-// ========== Register definition for US0 peripheral ========== +-#define AT91C_US0_TTGR (0xFFFC0028) // (US0) Transmitter Time-guard Register +-#define AT91C_US0_BRGR (0xFFFC0020) // (US0) Baud Rate Generator Register +-#define AT91C_US0_RHR (0xFFFC0018) // (US0) Receiver Holding Register +-#define AT91C_US0_IMR (0xFFFC0010) // (US0) Interrupt Mask Register +-#define AT91C_US0_NER (0xFFFC0044) // (US0) Nb Errors Register +-#define AT91C_US0_RTOR (0xFFFC0024) // (US0) Receiver Time-out Register +-#define AT91C_US0_FIDI (0xFFFC0040) // (US0) FI_DI_Ratio Register +-#define AT91C_US0_CR (0xFFFC0000) // (US0) Control Register +-#define AT91C_US0_IER (0xFFFC0008) // (US0) Interrupt Enable Register +-#define AT91C_US0_IF (0xFFFC004C) // (US0) IRDA_FILTER Register +-#define AT91C_US0_MR (0xFFFC0004) // (US0) Mode Register +-#define AT91C_US0_IDR (0xFFFC000C) // (US0) Interrupt Disable Register +-#define AT91C_US0_CSR (0xFFFC0014) // (US0) Channel Status Register +-#define AT91C_US0_THR (0xFFFC001C) // (US0) Transmitter Holding Register +-// ========== Register definition for PDC_SSC peripheral ========== +-#define AT91C_SSC_PTCR (0xFFFD4120) // (PDC_SSC) PDC Transfer Control Register +-#define AT91C_SSC_TNPR (0xFFFD4118) // (PDC_SSC) Transmit Next Pointer Register +-#define AT91C_SSC_RNPR (0xFFFD4110) // (PDC_SSC) Receive Next Pointer Register +-#define AT91C_SSC_TPR (0xFFFD4108) // (PDC_SSC) Transmit Pointer Register +-#define AT91C_SSC_RPR (0xFFFD4100) // (PDC_SSC) Receive Pointer Register +-#define AT91C_SSC_PTSR (0xFFFD4124) // (PDC_SSC) PDC Transfer Status Register +-#define AT91C_SSC_TNCR (0xFFFD411C) // (PDC_SSC) Transmit Next Counter Register +-#define AT91C_SSC_RNCR (0xFFFD4114) // (PDC_SSC) Receive Next Counter Register +-#define AT91C_SSC_TCR (0xFFFD410C) // (PDC_SSC) Transmit Counter Register +-#define AT91C_SSC_RCR (0xFFFD4104) // (PDC_SSC) Receive Counter Register +-// ========== Register definition for SSC peripheral ========== +-#define AT91C_SSC_RFMR (0xFFFD4014) // (SSC) Receive Frame Mode Register +-#define AT91C_SSC_CMR (0xFFFD4004) // (SSC) Clock Mode Register +-#define AT91C_SSC_IDR (0xFFFD4048) // (SSC) Interrupt Disable Register +-#define AT91C_SSC_SR (0xFFFD4040) // (SSC) Status Register +-#define AT91C_SSC_RSHR (0xFFFD4030) // (SSC) Receive Sync Holding Register +-#define AT91C_SSC_RHR (0xFFFD4020) // (SSC) Receive Holding Register +-#define AT91C_SSC_TCMR (0xFFFD4018) // (SSC) Transmit Clock Mode Register +-#define AT91C_SSC_RCMR (0xFFFD4010) // (SSC) Receive Clock ModeRegister +-#define AT91C_SSC_CR (0xFFFD4000) // (SSC) Control Register +-#define AT91C_SSC_IMR (0xFFFD404C) // (SSC) Interrupt Mask Register +-#define AT91C_SSC_IER (0xFFFD4044) // (SSC) Interrupt Enable Register +-#define AT91C_SSC_TSHR (0xFFFD4034) // (SSC) Transmit Sync Holding Register +-#define AT91C_SSC_THR (0xFFFD4024) // (SSC) Transmit Holding Register +-#define AT91C_SSC_TFMR (0xFFFD401C) // (SSC) Transmit Frame Mode Register +-// ========== Register definition for TWI peripheral ========== +-#define AT91C_TWI_RHR (0xFFFB8030) // (TWI) Receive Holding Register +-#define AT91C_TWI_IDR (0xFFFB8028) // (TWI) Interrupt Disable Register +-#define AT91C_TWI_SR (0xFFFB8020) // (TWI) Status Register +-#define AT91C_TWI_CWGR (0xFFFB8010) // (TWI) Clock Waveform Generator Register +-#define AT91C_TWI_CR (0xFFFB8000) // (TWI) Control Register +-#define AT91C_TWI_THR (0xFFFB8034) // (TWI) Transmit Holding Register +-#define AT91C_TWI_IMR (0xFFFB802C) // (TWI) Interrupt Mask Register +-#define AT91C_TWI_IER (0xFFFB8024) // (TWI) Interrupt Enable Register +-#define AT91C_TWI_IADR (0xFFFB800C) // (TWI) Internal Address Register +-#define AT91C_TWI_MMR (0xFFFB8004) // (TWI) Master Mode Register +-// ========== Register definition for PWMC_CH3 peripheral ========== +-#define AT91C_PWMC_CH3_CUPDR (0xFFFCC270) // (PWMC_CH3) Channel Update Register +-#define AT91C_PWMC_CH3_CPRDR (0xFFFCC268) // (PWMC_CH3) Channel Period Register +-#define AT91C_PWMC_CH3_CMR (0xFFFCC260) // (PWMC_CH3) Channel Mode Register +-#define AT91C_PWMC_CH3_Reserved (0xFFFCC274) // (PWMC_CH3) Reserved +-#define AT91C_PWMC_CH3_CCNTR (0xFFFCC26C) // (PWMC_CH3) Channel Counter Register +-#define AT91C_PWMC_CH3_CDTYR (0xFFFCC264) // (PWMC_CH3) Channel Duty Cycle Register +-// ========== Register definition for PWMC_CH2 peripheral ========== +-#define AT91C_PWMC_CH2_CUPDR (0xFFFCC250) // (PWMC_CH2) Channel Update Register +-#define AT91C_PWMC_CH2_CPRDR (0xFFFCC248) // (PWMC_CH2) Channel Period Register +-#define AT91C_PWMC_CH2_CMR (0xFFFCC240) // (PWMC_CH2) Channel Mode Register +-#define AT91C_PWMC_CH2_Reserved (0xFFFCC254) // (PWMC_CH2) Reserved +-#define AT91C_PWMC_CH2_CCNTR (0xFFFCC24C) // (PWMC_CH2) Channel Counter Register +-#define AT91C_PWMC_CH2_CDTYR (0xFFFCC244) // (PWMC_CH2) Channel Duty Cycle Register +-// ========== Register definition for PWMC_CH1 peripheral ========== +-#define AT91C_PWMC_CH1_CUPDR (0xFFFCC230) // (PWMC_CH1) Channel Update Register +-#define AT91C_PWMC_CH1_CPRDR (0xFFFCC228) // (PWMC_CH1) Channel Period Register +-#define AT91C_PWMC_CH1_CMR (0xFFFCC220) // (PWMC_CH1) Channel Mode Register +-#define AT91C_PWMC_CH1_Reserved (0xFFFCC234) // (PWMC_CH1) Reserved +-#define AT91C_PWMC_CH1_CCNTR (0xFFFCC22C) // (PWMC_CH1) Channel Counter Register +-#define AT91C_PWMC_CH1_CDTYR (0xFFFCC224) // (PWMC_CH1) Channel Duty Cycle Register +-// ========== Register definition for PWMC_CH0 peripheral ========== +-#define AT91C_PWMC_CH0_CUPDR (0xFFFCC210) // (PWMC_CH0) Channel Update Register +-#define AT91C_PWMC_CH0_CPRDR (0xFFFCC208) // (PWMC_CH0) Channel Period Register +-#define AT91C_PWMC_CH0_CMR (0xFFFCC200) // (PWMC_CH0) Channel Mode Register +-#define AT91C_PWMC_CH0_Reserved (0xFFFCC214) // (PWMC_CH0) Reserved +-#define AT91C_PWMC_CH0_CCNTR (0xFFFCC20C) // (PWMC_CH0) Channel Counter Register +-#define AT91C_PWMC_CH0_CDTYR (0xFFFCC204) // (PWMC_CH0) Channel Duty Cycle Register +-// ========== Register definition for PWMC peripheral ========== +-#define AT91C_PWMC_VR (0xFFFCC0FC) // (PWMC) PWMC Version Register +-#define AT91C_PWMC_ISR (0xFFFCC01C) // (PWMC) PWMC Interrupt Status Register +-#define AT91C_PWMC_IDR (0xFFFCC014) // (PWMC) PWMC Interrupt Disable Register +-#define AT91C_PWMC_SR (0xFFFCC00C) // (PWMC) PWMC Status Register +-#define AT91C_PWMC_ENA (0xFFFCC004) // (PWMC) PWMC Enable Register +-#define AT91C_PWMC_IMR (0xFFFCC018) // (PWMC) PWMC Interrupt Mask Register +-#define AT91C_PWMC_MR (0xFFFCC000) // (PWMC) PWMC Mode Register +-#define AT91C_PWMC_DIS (0xFFFCC008) // (PWMC) PWMC Disable Register +-#define AT91C_PWMC_IER (0xFFFCC010) // (PWMC) PWMC Interrupt Enable Register +-// ========== Register definition for UDP peripheral ========== +-#define AT91C_UDP_TXVC (0xFFFB0074) // (UDP) Transceiver Control Register +-#define AT91C_UDP_ISR (0xFFFB001C) // (UDP) Interrupt Status Register +-#define AT91C_UDP_IDR (0xFFFB0014) // (UDP) Interrupt Disable Register +-#define AT91C_UDP_CSR (0xFFFB0030) // (UDP) Endpoint Control and Status Register +-#define AT91C_UDP_RSTEP (0xFFFB0028) // (UDP) Reset Endpoint Register +-#define AT91C_UDP_ICR (0xFFFB0020) // (UDP) Interrupt Clear Register +-#define AT91C_UDP_GLBSTATE (0xFFFB0004) // (UDP) Global State Register +-#define AT91C_UDP_NUM (0xFFFB0000) // (UDP) Frame Number Register +-#define AT91C_UDP_FADDR (0xFFFB0008) // (UDP) Function Address Register +-#define AT91C_UDP_IER (0xFFFB0010) // (UDP) Interrupt Enable Register +-#define AT91C_UDP_IMR (0xFFFB0018) // (UDP) Interrupt Mask Register +-#define AT91C_UDP_FDR (0xFFFB0050) // (UDP) Endpoint FIFO Data Register +-// ========== Register definition for TC0 peripheral ========== +-#define AT91C_TC0_IMR (0xFFFA002C) // (TC0) Interrupt Mask Register +-#define AT91C_TC0_IER (0xFFFA0024) // (TC0) Interrupt Enable Register +-#define AT91C_TC0_RC (0xFFFA001C) // (TC0) Register C +-#define AT91C_TC0_RA (0xFFFA0014) // (TC0) Register A +-#define AT91C_TC0_CMR (0xFFFA0004) // (TC0) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC0_IDR (0xFFFA0028) // (TC0) Interrupt Disable Register +-#define AT91C_TC0_SR (0xFFFA0020) // (TC0) Status Register +-#define AT91C_TC0_RB (0xFFFA0018) // (TC0) Register B +-#define AT91C_TC0_CV (0xFFFA0010) // (TC0) Counter Value +-#define AT91C_TC0_CCR (0xFFFA0000) // (TC0) Channel Control Register +-// ========== Register definition for TC1 peripheral ========== +-#define AT91C_TC1_IMR (0xFFFA006C) // (TC1) Interrupt Mask Register +-#define AT91C_TC1_IER (0xFFFA0064) // (TC1) Interrupt Enable Register +-#define AT91C_TC1_RC (0xFFFA005C) // (TC1) Register C +-#define AT91C_TC1_RA (0xFFFA0054) // (TC1) Register A +-#define AT91C_TC1_CMR (0xFFFA0044) // (TC1) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC1_IDR (0xFFFA0068) // (TC1) Interrupt Disable Register +-#define AT91C_TC1_SR (0xFFFA0060) // (TC1) Status Register +-#define AT91C_TC1_RB (0xFFFA0058) // (TC1) Register B +-#define AT91C_TC1_CV (0xFFFA0050) // (TC1) Counter Value +-#define AT91C_TC1_CCR (0xFFFA0040) // (TC1) Channel Control Register +-// ========== Register definition for TC2 peripheral ========== +-#define AT91C_TC2_IMR (0xFFFA00AC) // (TC2) Interrupt Mask Register +-#define AT91C_TC2_IER (0xFFFA00A4) // (TC2) Interrupt Enable Register +-#define AT91C_TC2_RC (0xFFFA009C) // (TC2) Register C +-#define AT91C_TC2_RA (0xFFFA0094) // (TC2) Register A +-#define AT91C_TC2_CMR (0xFFFA0084) // (TC2) Channel Mode Register (Capture Mode / Waveform Mode) +-#define AT91C_TC2_IDR (0xFFFA00A8) // (TC2) Interrupt Disable Register +-#define AT91C_TC2_SR (0xFFFA00A0) // (TC2) Status Register +-#define AT91C_TC2_RB (0xFFFA0098) // (TC2) Register B +-#define AT91C_TC2_CV (0xFFFA0090) // (TC2) Counter Value +-#define AT91C_TC2_CCR (0xFFFA0080) // (TC2) Channel Control Register +-// ========== Register definition for TCB peripheral ========== +-#define AT91C_TCB_BMR (0xFFFA00C4) // (TCB) TC Block Mode Register +-#define AT91C_TCB_BCR (0xFFFA00C0) // (TCB) TC Block Control Register +-// ========== Register definition for CAN_MB0 peripheral ========== +-#define AT91C_CAN_MB0_MCR (0xFFFD021C) // (CAN_MB0) MailBox Control Register +-#define AT91C_CAN_MB0_MDL (0xFFFD0214) // (CAN_MB0) MailBox Data Low Register +-#define AT91C_CAN_MB0_MFID (0xFFFD020C) // (CAN_MB0) MailBox Family ID Register +-#define AT91C_CAN_MB0_MAM (0xFFFD0204) // (CAN_MB0) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB0_MDH (0xFFFD0218) // (CAN_MB0) MailBox Data High Register +-#define AT91C_CAN_MB0_MSR (0xFFFD0210) // (CAN_MB0) MailBox Status Register +-#define AT91C_CAN_MB0_MID (0xFFFD0208) // (CAN_MB0) MailBox ID Register +-#define AT91C_CAN_MB0_MMR (0xFFFD0200) // (CAN_MB0) MailBox Mode Register +-// ========== Register definition for CAN_MB1 peripheral ========== +-#define AT91C_CAN_MB1_MCR (0xFFFD023C) // (CAN_MB1) MailBox Control Register +-#define AT91C_CAN_MB1_MDL (0xFFFD0234) // (CAN_MB1) MailBox Data Low Register +-#define AT91C_CAN_MB1_MFID (0xFFFD022C) // (CAN_MB1) MailBox Family ID Register +-#define AT91C_CAN_MB1_MAM (0xFFFD0224) // (CAN_MB1) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB1_MDH (0xFFFD0238) // (CAN_MB1) MailBox Data High Register +-#define AT91C_CAN_MB1_MSR (0xFFFD0230) // (CAN_MB1) MailBox Status Register +-#define AT91C_CAN_MB1_MID (0xFFFD0228) // (CAN_MB1) MailBox ID Register +-#define AT91C_CAN_MB1_MMR (0xFFFD0220) // (CAN_MB1) MailBox Mode Register +-// ========== Register definition for CAN_MB2 peripheral ========== +-#define AT91C_CAN_MB2_MCR (0xFFFD025C) // (CAN_MB2) MailBox Control Register +-#define AT91C_CAN_MB2_MDL (0xFFFD0254) // (CAN_MB2) MailBox Data Low Register +-#define AT91C_CAN_MB2_MFID (0xFFFD024C) // (CAN_MB2) MailBox Family ID Register +-#define AT91C_CAN_MB2_MAM (0xFFFD0244) // (CAN_MB2) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB2_MDH (0xFFFD0258) // (CAN_MB2) MailBox Data High Register +-#define AT91C_CAN_MB2_MSR (0xFFFD0250) // (CAN_MB2) MailBox Status Register +-#define AT91C_CAN_MB2_MID (0xFFFD0248) // (CAN_MB2) MailBox ID Register +-#define AT91C_CAN_MB2_MMR (0xFFFD0240) // (CAN_MB2) MailBox Mode Register +-// ========== Register definition for CAN_MB3 peripheral ========== +-#define AT91C_CAN_MB3_MCR (0xFFFD027C) // (CAN_MB3) MailBox Control Register +-#define AT91C_CAN_MB3_MDL (0xFFFD0274) // (CAN_MB3) MailBox Data Low Register +-#define AT91C_CAN_MB3_MFID (0xFFFD026C) // (CAN_MB3) MailBox Family ID Register +-#define AT91C_CAN_MB3_MAM (0xFFFD0264) // (CAN_MB3) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB3_MDH (0xFFFD0278) // (CAN_MB3) MailBox Data High Register +-#define AT91C_CAN_MB3_MSR (0xFFFD0270) // (CAN_MB3) MailBox Status Register +-#define AT91C_CAN_MB3_MID (0xFFFD0268) // (CAN_MB3) MailBox ID Register +-#define AT91C_CAN_MB3_MMR (0xFFFD0260) // (CAN_MB3) MailBox Mode Register +-// ========== Register definition for CAN_MB4 peripheral ========== +-#define AT91C_CAN_MB4_MCR (0xFFFD029C) // (CAN_MB4) MailBox Control Register +-#define AT91C_CAN_MB4_MDL (0xFFFD0294) // (CAN_MB4) MailBox Data Low Register +-#define AT91C_CAN_MB4_MFID (0xFFFD028C) // (CAN_MB4) MailBox Family ID Register +-#define AT91C_CAN_MB4_MAM (0xFFFD0284) // (CAN_MB4) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB4_MDH (0xFFFD0298) // (CAN_MB4) MailBox Data High Register +-#define AT91C_CAN_MB4_MSR (0xFFFD0290) // (CAN_MB4) MailBox Status Register +-#define AT91C_CAN_MB4_MID (0xFFFD0288) // (CAN_MB4) MailBox ID Register +-#define AT91C_CAN_MB4_MMR (0xFFFD0280) // (CAN_MB4) MailBox Mode Register +-// ========== Register definition for CAN_MB5 peripheral ========== +-#define AT91C_CAN_MB5_MCR (0xFFFD02BC) // (CAN_MB5) MailBox Control Register +-#define AT91C_CAN_MB5_MDL (0xFFFD02B4) // (CAN_MB5) MailBox Data Low Register +-#define AT91C_CAN_MB5_MFID (0xFFFD02AC) // (CAN_MB5) MailBox Family ID Register +-#define AT91C_CAN_MB5_MAM (0xFFFD02A4) // (CAN_MB5) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB5_MDH (0xFFFD02B8) // (CAN_MB5) MailBox Data High Register +-#define AT91C_CAN_MB5_MSR (0xFFFD02B0) // (CAN_MB5) MailBox Status Register +-#define AT91C_CAN_MB5_MID (0xFFFD02A8) // (CAN_MB5) MailBox ID Register +-#define AT91C_CAN_MB5_MMR (0xFFFD02A0) // (CAN_MB5) MailBox Mode Register +-// ========== Register definition for CAN_MB6 peripheral ========== +-#define AT91C_CAN_MB6_MAM (0xFFFD02C4) // (CAN_MB6) MailBox Acceptance Mask Register +-#define AT91C_CAN_MB6_MDH (0xFFFD02D8) // (CAN_MB6) MailBox Data High Register +-#define AT91C_CAN_MB6_MSR (0xFFFD02D0) // (CAN_MB6) MailBox Status Register +-#define AT91C_CAN_MB6_MID (0xFFFD02C8) // (CAN_MB6) MailBox ID Register +-#define AT91C_CAN_MB6_MMR (0xFFFD02C0) // (CAN_MB6) MailBox Mode Register +-#define AT91C_CAN_MB6_MCR (0xFFFD02DC) // (CAN_MB6) MailBox Control Register +-#define AT91C_CAN_MB6_MDL (0xFFFD02D4) // (CAN_MB6) MailBox Data Low Register +-#define AT91C_CAN_MB6_MFID (0xFFFD02CC) // (CAN_MB6) MailBox Family ID Register +-// ========== Register definition for CAN_MB7 peripheral ========== +-#define AT91C_CAN_MB7_MDH (0xFFFD02F8) // (CAN_MB7) MailBox Data High Register +-#define AT91C_CAN_MB7_MSR (0xFFFD02F0) // (CAN_MB7) MailBox Status Register +-#define AT91C_CAN_MB7_MID (0xFFFD02E8) // (CAN_MB7) MailBox ID Register +-#define AT91C_CAN_MB7_MMR (0xFFFD02E0) // (CAN_MB7) MailBox Mode Register +-#define AT91C_CAN_MB7_MCR (0xFFFD02FC) // (CAN_MB7) MailBox Control Register +-#define AT91C_CAN_MB7_MDL (0xFFFD02F4) // (CAN_MB7) MailBox Data Low Register +-#define AT91C_CAN_MB7_MFID (0xFFFD02EC) // (CAN_MB7) MailBox Family ID Register +-#define AT91C_CAN_MB7_MAM (0xFFFD02E4) // (CAN_MB7) MailBox Acceptance Mask Register +-// ========== Register definition for CAN peripheral ========== +-#define AT91C_CAN_IMR (0xFFFD000C) // (CAN) Interrupt Mask Register +-#define AT91C_CAN_IER (0xFFFD0004) // (CAN) Interrupt Enable Register +-#define AT91C_CAN_ECR (0xFFFD0020) // (CAN) Error Counter Register +-#define AT91C_CAN_TIM (0xFFFD0018) // (CAN) Timer Register +-#define AT91C_CAN_SR (0xFFFD0010) // (CAN) Status Register +-#define AT91C_CAN_IDR (0xFFFD0008) // (CAN) Interrupt Disable Register +-#define AT91C_CAN_MR (0xFFFD0000) // (CAN) Mode Register +-#define AT91C_CAN_BR (0xFFFD0014) // (CAN) Baudrate Register +-#define AT91C_CAN_TIMESTP (0xFFFD001C) // (CAN) Time Stamp Register +-#define AT91C_CAN_TCR (0xFFFD0024) // (CAN) Transfer Command Register +-#define AT91C_CAN_ACR (0xFFFD0028) // (CAN) Abort Command Register +-#define AT91C_CAN_VR (0xFFFD00FC) // (CAN) Version Register +-// ========== Register definition for EMAC peripheral ========== +-#define AT91C_EMAC_TID (0xFFFDC0B8) // (EMAC) Type ID Checking Register +-#define AT91C_EMAC_SA3L (0xFFFDC0A8) // (EMAC) Specific Address 3 Bottom, First 4 bytes +-#define AT91C_EMAC_STE (0xFFFDC084) // (EMAC) SQE Test Error Register +-#define AT91C_EMAC_RSE (0xFFFDC074) // (EMAC) Receive Symbol Errors Register +-#define AT91C_EMAC_IDR (0xFFFDC02C) // (EMAC) Interrupt Disable Register +-#define AT91C_EMAC_TBQP (0xFFFDC01C) // (EMAC) Transmit Buffer Queue Pointer +-#define AT91C_EMAC_TPQ (0xFFFDC0BC) // (EMAC) Transmit Pause Quantum Register +-#define AT91C_EMAC_SA1L (0xFFFDC098) // (EMAC) Specific Address 1 Bottom, First 4 bytes +-#define AT91C_EMAC_RLE (0xFFFDC088) // (EMAC) Receive Length Field Mismatch Register +-#define AT91C_EMAC_IMR (0xFFFDC030) // (EMAC) Interrupt Mask Register +-#define AT91C_EMAC_SA1H (0xFFFDC09C) // (EMAC) Specific Address 1 Top, Last 2 bytes +-#define AT91C_EMAC_PFR (0xFFFDC03C) // (EMAC) Pause Frames received Register +-#define AT91C_EMAC_FCSE (0xFFFDC050) // (EMAC) Frame Check Sequence Error Register +-#define AT91C_EMAC_FTO (0xFFFDC040) // (EMAC) Frames Transmitted OK Register +-#define AT91C_EMAC_TUND (0xFFFDC064) // (EMAC) Transmit Underrun Error Register +-#define AT91C_EMAC_ALE (0xFFFDC054) // (EMAC) Alignment Error Register +-#define AT91C_EMAC_SCF (0xFFFDC044) // (EMAC) Single Collision Frame Register +-#define AT91C_EMAC_SA3H (0xFFFDC0AC) // (EMAC) Specific Address 3 Top, Last 2 bytes +-#define AT91C_EMAC_ELE (0xFFFDC078) // (EMAC) Excessive Length Errors Register +-#define AT91C_EMAC_CSE (0xFFFDC068) // (EMAC) Carrier Sense Error Register +-#define AT91C_EMAC_DTF (0xFFFDC058) // (EMAC) Deferred Transmission Frame Register +-#define AT91C_EMAC_RSR (0xFFFDC020) // (EMAC) Receive Status Register +-#define AT91C_EMAC_USRIO (0xFFFDC0C0) // (EMAC) USER Input/Output Register +-#define AT91C_EMAC_SA4L (0xFFFDC0B0) // (EMAC) Specific Address 4 Bottom, First 4 bytes +-#define AT91C_EMAC_RRE (0xFFFDC06C) // (EMAC) Receive Ressource Error Register +-#define AT91C_EMAC_RJA (0xFFFDC07C) // (EMAC) Receive Jabbers Register +-#define AT91C_EMAC_TPF (0xFFFDC08C) // (EMAC) Transmitted Pause Frames Register +-#define AT91C_EMAC_ISR (0xFFFDC024) // (EMAC) Interrupt Status Register +-#define AT91C_EMAC_MAN (0xFFFDC034) // (EMAC) PHY Maintenance Register +-#define AT91C_EMAC_WOL (0xFFFDC0C4) // (EMAC) Wake On LAN Register +-#define AT91C_EMAC_USF (0xFFFDC080) // (EMAC) Undersize Frames Register +-#define AT91C_EMAC_HRB (0xFFFDC090) // (EMAC) Hash Address Bottom[31:0] +-#define AT91C_EMAC_PTR (0xFFFDC038) // (EMAC) Pause Time Register +-#define AT91C_EMAC_HRT (0xFFFDC094) // (EMAC) Hash Address Top[63:32] +-#define AT91C_EMAC_REV (0xFFFDC0FC) // (EMAC) Revision Register +-#define AT91C_EMAC_MCF (0xFFFDC048) // (EMAC) Multiple Collision Frame Register +-#define AT91C_EMAC_SA2L (0xFFFDC0A0) // (EMAC) Specific Address 2 Bottom, First 4 bytes +-#define AT91C_EMAC_NCR (0xFFFDC000) // (EMAC) Network Control Register +-#define AT91C_EMAC_FRO (0xFFFDC04C) // (EMAC) Frames Received OK Register +-#define AT91C_EMAC_LCOL (0xFFFDC05C) // (EMAC) Late Collision Register +-#define AT91C_EMAC_SA4H (0xFFFDC0B4) // (EMAC) Specific Address 4 Top, Last 2 bytes +-#define AT91C_EMAC_NCFGR (0xFFFDC004) // (EMAC) Network Configuration Register +-#define AT91C_EMAC_TSR (0xFFFDC014) // (EMAC) Transmit Status Register +-#define AT91C_EMAC_SA2H (0xFFFDC0A4) // (EMAC) Specific Address 2 Top, Last 2 bytes +-#define AT91C_EMAC_ECOL (0xFFFDC060) // (EMAC) Excessive Collision Register +-#define AT91C_EMAC_ROV (0xFFFDC070) // (EMAC) Receive Overrun Errors Register +-#define AT91C_EMAC_NSR (0xFFFDC008) // (EMAC) Network Status Register +-#define AT91C_EMAC_RBQP (0xFFFDC018) // (EMAC) Receive Buffer Queue Pointer +-#define AT91C_EMAC_IER (0xFFFDC028) // (EMAC) Interrupt Enable Register +-// ========== Register definition for PDC_ADC peripheral ========== +-#define AT91C_ADC_PTCR (0xFFFD8120) // (PDC_ADC) PDC Transfer Control Register +-#define AT91C_ADC_TNPR (0xFFFD8118) // (PDC_ADC) Transmit Next Pointer Register +-#define AT91C_ADC_RNPR (0xFFFD8110) // (PDC_ADC) Receive Next Pointer Register +-#define AT91C_ADC_TPR (0xFFFD8108) // (PDC_ADC) Transmit Pointer Register +-#define AT91C_ADC_RPR (0xFFFD8100) // (PDC_ADC) Receive Pointer Register +-#define AT91C_ADC_PTSR (0xFFFD8124) // (PDC_ADC) PDC Transfer Status Register +-#define AT91C_ADC_TNCR (0xFFFD811C) // (PDC_ADC) Transmit Next Counter Register +-#define AT91C_ADC_RNCR (0xFFFD8114) // (PDC_ADC) Receive Next Counter Register +-#define AT91C_ADC_TCR (0xFFFD810C) // (PDC_ADC) Transmit Counter Register +-#define AT91C_ADC_RCR (0xFFFD8104) // (PDC_ADC) Receive Counter Register +-// ========== Register definition for ADC peripheral ========== +-#define AT91C_ADC_IMR (0xFFFD802C) // (ADC) ADC Interrupt Mask Register +-#define AT91C_ADC_CDR4 (0xFFFD8040) // (ADC) ADC Channel Data Register 4 +-#define AT91C_ADC_CDR2 (0xFFFD8038) // (ADC) ADC Channel Data Register 2 +-#define AT91C_ADC_CDR0 (0xFFFD8030) // (ADC) ADC Channel Data Register 0 +-#define AT91C_ADC_CDR7 (0xFFFD804C) // (ADC) ADC Channel Data Register 7 +-#define AT91C_ADC_CDR1 (0xFFFD8034) // (ADC) ADC Channel Data Register 1 +-#define AT91C_ADC_CDR3 (0xFFFD803C) // (ADC) ADC Channel Data Register 3 +-#define AT91C_ADC_CDR5 (0xFFFD8044) // (ADC) ADC Channel Data Register 5 +-#define AT91C_ADC_MR (0xFFFD8004) // (ADC) ADC Mode Register +-#define AT91C_ADC_CDR6 (0xFFFD8048) // (ADC) ADC Channel Data Register 6 +-#define AT91C_ADC_CR (0xFFFD8000) // (ADC) ADC Control Register +-#define AT91C_ADC_CHER (0xFFFD8010) // (ADC) ADC Channel Enable Register +-#define AT91C_ADC_CHSR (0xFFFD8018) // (ADC) ADC Channel Status Register +-#define AT91C_ADC_IER (0xFFFD8024) // (ADC) ADC Interrupt Enable Register +-#define AT91C_ADC_SR (0xFFFD801C) // (ADC) ADC Status Register +-#define AT91C_ADC_CHDR (0xFFFD8014) // (ADC) ADC Channel Disable Register +-#define AT91C_ADC_IDR (0xFFFD8028) // (ADC) ADC Interrupt Disable Register +-#define AT91C_ADC_LCDR (0xFFFD8020) // (ADC) ADC Last Converted Data Register +- +-// ***************************************************************************** +-// PIO DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_PIO_PA0 (1 << 0) // Pin Controlled by PA0 +-#define AT91C_PA0_RXD0 (AT91C_PIO_PA0) // USART 0 Receive Data +-#define AT91C_PIO_PA1 (1 << 1) // Pin Controlled by PA1 +-#define AT91C_PA1_TXD0 (AT91C_PIO_PA1) // USART 0 Transmit Data +-#define AT91C_PIO_PA10 (1 << 10) // Pin Controlled by PA10 +-#define AT91C_PA10_TWD (AT91C_PIO_PA10) // TWI Two-wire Serial Data +-#define AT91C_PIO_PA11 (1 << 11) // Pin Controlled by PA11 +-#define AT91C_PA11_TWCK (AT91C_PIO_PA11) // TWI Two-wire Serial Clock +-#define AT91C_PIO_PA12 (1 << 12) // Pin Controlled by PA12 +-#define AT91C_PA12_SPI0_NPCS0 (AT91C_PIO_PA12) // SPI 0 Peripheral Chip Select 0 +-#define AT91C_PIO_PA13 (1 << 13) // Pin Controlled by PA13 +-#define AT91C_PA13_SPI0_NPCS1 (AT91C_PIO_PA13) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PA13_PCK1 (AT91C_PIO_PA13) // PMC Programmable Clock Output 1 +-#define AT91C_PIO_PA14 (1 << 14) // Pin Controlled by PA14 +-#define AT91C_PA14_SPI0_NPCS2 (AT91C_PIO_PA14) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PA14_IRQ1 (AT91C_PIO_PA14) // External Interrupt 1 +-#define AT91C_PIO_PA15 (1 << 15) // Pin Controlled by PA15 +-#define AT91C_PA15_SPI0_NPCS3 (AT91C_PIO_PA15) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PA15_TCLK2 (AT91C_PIO_PA15) // Timer Counter 2 external clock input +-#define AT91C_PIO_PA16 (1 << 16) // Pin Controlled by PA16 +-#define AT91C_PA16_SPI0_MISO (AT91C_PIO_PA16) // SPI 0 Master In Slave +-#define AT91C_PIO_PA17 (1 << 17) // Pin Controlled by PA17 +-#define AT91C_PA17_SPI0_MOSI (AT91C_PIO_PA17) // SPI 0 Master Out Slave +-#define AT91C_PIO_PA18 (1 << 18) // Pin Controlled by PA18 +-#define AT91C_PA18_SPI0_SPCK (AT91C_PIO_PA18) // SPI 0 Serial Clock +-#define AT91C_PIO_PA19 (1 << 19) // Pin Controlled by PA19 +-#define AT91C_PA19_CANRX (AT91C_PIO_PA19) // CAN Receive +-#define AT91C_PIO_PA2 (1 << 2) // Pin Controlled by PA2 +-#define AT91C_PA2_SCK0 (AT91C_PIO_PA2) // USART 0 Serial Clock +-#define AT91C_PA2_SPI1_NPCS1 (AT91C_PIO_PA2) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PA20 (1 << 20) // Pin Controlled by PA20 +-#define AT91C_PA20_CANTX (AT91C_PIO_PA20) // CAN Transmit +-#define AT91C_PIO_PA21 (1 << 21) // Pin Controlled by PA21 +-#define AT91C_PA21_TF (AT91C_PIO_PA21) // SSC Transmit Frame Sync +-#define AT91C_PA21_SPI1_NPCS0 (AT91C_PIO_PA21) // SPI 1 Peripheral Chip Select 0 +-#define AT91C_PIO_PA22 (1 << 22) // Pin Controlled by PA22 +-#define AT91C_PA22_TK (AT91C_PIO_PA22) // SSC Transmit Clock +-#define AT91C_PA22_SPI1_SPCK (AT91C_PIO_PA22) // SPI 1 Serial Clock +-#define AT91C_PIO_PA23 (1 << 23) // Pin Controlled by PA23 +-#define AT91C_PA23_TD (AT91C_PIO_PA23) // SSC Transmit data +-#define AT91C_PA23_SPI1_MOSI (AT91C_PIO_PA23) // SPI 1 Master Out Slave +-#define AT91C_PIO_PA24 (1 << 24) // Pin Controlled by PA24 +-#define AT91C_PA24_RD (AT91C_PIO_PA24) // SSC Receive Data +-#define AT91C_PA24_SPI1_MISO (AT91C_PIO_PA24) // SPI 1 Master In Slave +-#define AT91C_PIO_PA25 (1 << 25) // Pin Controlled by PA25 +-#define AT91C_PA25_RK (AT91C_PIO_PA25) // SSC Receive Clock +-#define AT91C_PA25_SPI1_NPCS1 (AT91C_PIO_PA25) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PA26 (1 << 26) // Pin Controlled by PA26 +-#define AT91C_PA26_RF (AT91C_PIO_PA26) // SSC Receive Frame Sync +-#define AT91C_PA26_SPI1_NPCS2 (AT91C_PIO_PA26) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PA27 (1 << 27) // Pin Controlled by PA27 +-#define AT91C_PA27_DRXD (AT91C_PIO_PA27) // DBGU Debug Receive Data +-#define AT91C_PA27_PCK3 (AT91C_PIO_PA27) // PMC Programmable Clock Output 3 +-#define AT91C_PIO_PA28 (1 << 28) // Pin Controlled by PA28 +-#define AT91C_PA28_DTXD (AT91C_PIO_PA28) // DBGU Debug Transmit Data +-#define AT91C_PIO_PA29 (1 << 29) // Pin Controlled by PA29 +-#define AT91C_PA29_FIQ (AT91C_PIO_PA29) // AIC Fast Interrupt Input +-#define AT91C_PA29_SPI1_NPCS3 (AT91C_PIO_PA29) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PA3 (1 << 3) // Pin Controlled by PA3 +-#define AT91C_PA3_RTS0 (AT91C_PIO_PA3) // USART 0 Ready To Send +-#define AT91C_PA3_SPI1_NPCS2 (AT91C_PIO_PA3) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PA30 (1 << 30) // Pin Controlled by PA30 +-#define AT91C_PA30_IRQ0 (AT91C_PIO_PA30) // External Interrupt 0 +-#define AT91C_PA30_PCK2 (AT91C_PIO_PA30) // PMC Programmable Clock Output 2 +-#define AT91C_PIO_PA4 (1 << 4) // Pin Controlled by PA4 +-#define AT91C_PA4_CTS0 (AT91C_PIO_PA4) // USART 0 Clear To Send +-#define AT91C_PA4_SPI1_NPCS3 (AT91C_PIO_PA4) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PA5 (1 << 5) // Pin Controlled by PA5 +-#define AT91C_PA5_RXD1 (AT91C_PIO_PA5) // USART 1 Receive Data +-#define AT91C_PIO_PA6 (1 << 6) // Pin Controlled by PA6 +-#define AT91C_PA6_TXD1 (AT91C_PIO_PA6) // USART 1 Transmit Data +-#define AT91C_PIO_PA7 (1 << 7) // Pin Controlled by PA7 +-#define AT91C_PA7_SCK1 (AT91C_PIO_PA7) // USART 1 Serial Clock +-#define AT91C_PA7_SPI0_NPCS1 (AT91C_PIO_PA7) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PIO_PA8 (1 << 8) // Pin Controlled by PA8 +-#define AT91C_PA8_RTS1 (AT91C_PIO_PA8) // USART 1 Ready To Send +-#define AT91C_PA8_SPI0_NPCS2 (AT91C_PIO_PA8) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PIO_PA9 (1 << 9) // Pin Controlled by PA9 +-#define AT91C_PA9_CTS1 (AT91C_PIO_PA9) // USART 1 Clear To Send +-#define AT91C_PA9_SPI0_NPCS3 (AT91C_PIO_PA9) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PIO_PB0 (1 << 0) // Pin Controlled by PB0 +-#define AT91C_PB0_ETXCK_EREFCK (AT91C_PIO_PB0) // Ethernet MAC Transmit Clock/Reference Clock +-#define AT91C_PB0_PCK0 (AT91C_PIO_PB0) // PMC Programmable Clock Output 0 +-#define AT91C_PIO_PB1 (1 << 1) // Pin Controlled by PB1 +-#define AT91C_PB1_ETXEN (AT91C_PIO_PB1) // Ethernet MAC Transmit Enable +-#define AT91C_PIO_PB10 (1 << 10) // Pin Controlled by PB10 +-#define AT91C_PB10_ETX2 (AT91C_PIO_PB10) // Ethernet MAC Transmit Data 2 +-#define AT91C_PB10_SPI1_NPCS1 (AT91C_PIO_PB10) // SPI 1 Peripheral Chip Select 1 +-#define AT91C_PIO_PB11 (1 << 11) // Pin Controlled by PB11 +-#define AT91C_PB11_ETX3 (AT91C_PIO_PB11) // Ethernet MAC Transmit Data 3 +-#define AT91C_PB11_SPI1_NPCS2 (AT91C_PIO_PB11) // SPI 1 Peripheral Chip Select 2 +-#define AT91C_PIO_PB12 (1 << 12) // Pin Controlled by PB12 +-#define AT91C_PB12_ETXER (AT91C_PIO_PB12) // Ethernet MAC Transmikt Coding Error +-#define AT91C_PB12_TCLK0 (AT91C_PIO_PB12) // Timer Counter 0 external clock input +-#define AT91C_PIO_PB13 (1 << 13) // Pin Controlled by PB13 +-#define AT91C_PB13_ERX2 (AT91C_PIO_PB13) // Ethernet MAC Receive Data 2 +-#define AT91C_PB13_SPI0_NPCS1 (AT91C_PIO_PB13) // SPI 0 Peripheral Chip Select 1 +-#define AT91C_PIO_PB14 (1 << 14) // Pin Controlled by PB14 +-#define AT91C_PB14_ERX3 (AT91C_PIO_PB14) // Ethernet MAC Receive Data 3 +-#define AT91C_PB14_SPI0_NPCS2 (AT91C_PIO_PB14) // SPI 0 Peripheral Chip Select 2 +-#define AT91C_PIO_PB15 (1 << 15) // Pin Controlled by PB15 +-#define AT91C_PB15_ERXDV_ECRSDV (AT91C_PIO_PB15) // Ethernet MAC Receive Data Valid +-#define AT91C_PIO_PB16 (1 << 16) // Pin Controlled by PB16 +-#define AT91C_PB16_ECOL (AT91C_PIO_PB16) // Ethernet MAC Collision Detected +-#define AT91C_PB16_SPI1_NPCS3 (AT91C_PIO_PB16) // SPI 1 Peripheral Chip Select 3 +-#define AT91C_PIO_PB17 (1 << 17) // Pin Controlled by PB17 +-#define AT91C_PB17_ERXCK (AT91C_PIO_PB17) // Ethernet MAC Receive Clock +-#define AT91C_PB17_SPI0_NPCS3 (AT91C_PIO_PB17) // SPI 0 Peripheral Chip Select 3 +-#define AT91C_PIO_PB18 (1 << 18) // Pin Controlled by PB18 +-#define AT91C_PB18_EF100 (AT91C_PIO_PB18) // Ethernet MAC Force 100 Mbits/sec +-#define AT91C_PB18_ADTRG (AT91C_PIO_PB18) // ADC External Trigger +-#define AT91C_PIO_PB19 (1 << 19) // Pin Controlled by PB19 +-#define AT91C_PB19_PWM0 (AT91C_PIO_PB19) // PWM Channel 0 +-#define AT91C_PB19_TCLK1 (AT91C_PIO_PB19) // Timer Counter 1 external clock input +-#define AT91C_PIO_PB2 (1 << 2) // Pin Controlled by PB2 +-#define AT91C_PB2_ETX0 (AT91C_PIO_PB2) // Ethernet MAC Transmit Data 0 +-#define AT91C_PIO_PB20 (1 << 20) // Pin Controlled by PB20 +-#define AT91C_PB20_PWM1 (AT91C_PIO_PB20) // PWM Channel 1 +-#define AT91C_PB20_PCK0 (AT91C_PIO_PB20) // PMC Programmable Clock Output 0 +-#define AT91C_PIO_PB21 (1 << 21) // Pin Controlled by PB21 +-#define AT91C_PB21_PWM2 (AT91C_PIO_PB21) // PWM Channel 2 +-#define AT91C_PB21_PCK1 (AT91C_PIO_PB21) // PMC Programmable Clock Output 1 +-#define AT91C_PIO_PB22 (1 << 22) // Pin Controlled by PB22 +-#define AT91C_PB22_PWM3 (AT91C_PIO_PB22) // PWM Channel 3 +-#define AT91C_PB22_PCK2 (AT91C_PIO_PB22) // PMC Programmable Clock Output 2 +-#define AT91C_PIO_PB23 (1 << 23) // Pin Controlled by PB23 +-#define AT91C_PB23_TIOA0 (AT91C_PIO_PB23) // Timer Counter 0 Multipurpose Timer I/O Pin A +-#define AT91C_PB23_DCD1 (AT91C_PIO_PB23) // USART 1 Data Carrier Detect +-#define AT91C_PIO_PB24 (1 << 24) // Pin Controlled by PB24 +-#define AT91C_PB24_TIOB0 (AT91C_PIO_PB24) // Timer Counter 0 Multipurpose Timer I/O Pin B +-#define AT91C_PB24_DSR1 (AT91C_PIO_PB24) // USART 1 Data Set ready +-#define AT91C_PIO_PB25 (1 << 25) // Pin Controlled by PB25 +-#define AT91C_PB25_TIOA1 (AT91C_PIO_PB25) // Timer Counter 1 Multipurpose Timer I/O Pin A +-#define AT91C_PB25_DTR1 (AT91C_PIO_PB25) // USART 1 Data Terminal ready +-#define AT91C_PIO_PB26 (1 << 26) // Pin Controlled by PB26 +-#define AT91C_PB26_TIOB1 (AT91C_PIO_PB26) // Timer Counter 1 Multipurpose Timer I/O Pin B +-#define AT91C_PB26_RI1 (AT91C_PIO_PB26) // USART 1 Ring Indicator +-#define AT91C_PIO_PB27 (1 << 27) // Pin Controlled by PB27 +-#define AT91C_PB27_TIOA2 (AT91C_PIO_PB27) // Timer Counter 2 Multipurpose Timer I/O Pin A +-#define AT91C_PB27_PWM0 (AT91C_PIO_PB27) // PWM Channel 0 +-#define AT91C_PIO_PB28 (1 << 28) // Pin Controlled by PB28 +-#define AT91C_PB28_TIOB2 (AT91C_PIO_PB28) // Timer Counter 2 Multipurpose Timer I/O Pin B +-#define AT91C_PB28_PWM1 (AT91C_PIO_PB28) // PWM Channel 1 +-#define AT91C_PIO_PB29 (1 << 29) // Pin Controlled by PB29 +-#define AT91C_PB29_PCK1 (AT91C_PIO_PB29) // PMC Programmable Clock Output 1 +-#define AT91C_PB29_PWM2 (AT91C_PIO_PB29) // PWM Channel 2 +-#define AT91C_PIO_PB3 (1 << 3) // Pin Controlled by PB3 +-#define AT91C_PB3_ETX1 (AT91C_PIO_PB3) // Ethernet MAC Transmit Data 1 +-#define AT91C_PIO_PB30 (1 << 30) // Pin Controlled by PB30 +-#define AT91C_PB30_PCK2 (AT91C_PIO_PB30) // PMC Programmable Clock Output 2 +-#define AT91C_PB30_PWM3 (AT91C_PIO_PB30) // PWM Channel 3 +-#define AT91C_PIO_PB4 (1 << 4) // Pin Controlled by PB4 +-#define AT91C_PB4_ECRS (AT91C_PIO_PB4) // Ethernet MAC Carrier Sense/Carrier Sense and Data Valid +-#define AT91C_PIO_PB5 (1 << 5) // Pin Controlled by PB5 +-#define AT91C_PB5_ERX0 (AT91C_PIO_PB5) // Ethernet MAC Receive Data 0 +-#define AT91C_PIO_PB6 (1 << 6) // Pin Controlled by PB6 +-#define AT91C_PB6_ERX1 (AT91C_PIO_PB6) // Ethernet MAC Receive Data 1 +-#define AT91C_PIO_PB7 (1 << 7) // Pin Controlled by PB7 +-#define AT91C_PB7_ERXER (AT91C_PIO_PB7) // Ethernet MAC Receive Error +-#define AT91C_PIO_PB8 (1 << 8) // Pin Controlled by PB8 +-#define AT91C_PB8_EMDC (AT91C_PIO_PB8) // Ethernet MAC Management Data Clock +-#define AT91C_PIO_PB9 (1 << 9) // Pin Controlled by PB9 +-#define AT91C_PB9_EMDIO (AT91C_PIO_PB9) // Ethernet MAC Management Data Input/Output +- +-// ***************************************************************************** +-// PERIPHERAL ID DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_ID_FIQ ( 0) // Advanced Interrupt Controller (FIQ) +-#define AT91C_ID_SYS ( 1) // System Peripheral +-#define AT91C_ID_PIOA ( 2) // Parallel IO Controller A +-#define AT91C_ID_PIOB ( 3) // Parallel IO Controller B +-#define AT91C_ID_SPI0 ( 4) // Serial Peripheral Interface 0 +-#define AT91C_ID_SPI1 ( 5) // Serial Peripheral Interface 1 +-#define AT91C_ID_US0 ( 6) // USART 0 +-#define AT91C_ID_US1 ( 7) // USART 1 +-#define AT91C_ID_SSC ( 8) // Serial Synchronous Controller +-#define AT91C_ID_TWI ( 9) // Two-Wire Interface +-#define AT91C_ID_PWMC (10) // PWM Controller +-#define AT91C_ID_UDP (11) // USB Device Port +-#define AT91C_ID_TC0 (12) // Timer Counter 0 +-#define AT91C_ID_TC1 (13) // Timer Counter 1 +-#define AT91C_ID_TC2 (14) // Timer Counter 2 +-#define AT91C_ID_CAN (15) // Control Area Network Controller +-#define AT91C_ID_EMAC (16) // Ethernet MAC +-#define AT91C_ID_ADC (17) // Analog-to-Digital Converter +-#define AT91C_ID_18_Reserved (18) // Reserved +-#define AT91C_ID_19_Reserved (19) // Reserved +-#define AT91C_ID_20_Reserved (20) // Reserved +-#define AT91C_ID_21_Reserved (21) // Reserved +-#define AT91C_ID_22_Reserved (22) // Reserved +-#define AT91C_ID_23_Reserved (23) // Reserved +-#define AT91C_ID_24_Reserved (24) // Reserved +-#define AT91C_ID_25_Reserved (25) // Reserved +-#define AT91C_ID_26_Reserved (26) // Reserved +-#define AT91C_ID_27_Reserved (27) // Reserved +-#define AT91C_ID_28_Reserved (28) // Reserved +-#define AT91C_ID_29_Reserved (29) // Reserved +-#define AT91C_ID_IRQ0 (30) // Advanced Interrupt Controller (IRQ0) +-#define AT91C_ID_IRQ1 (31) // Advanced Interrupt Controller (IRQ1) +-#define AT91C_ALL_INT (0xC003FFFF) // ALL VALID INTERRUPTS +- +-// ***************************************************************************** +-// BASE ADDRESS DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-#define AT91C_BASE_SYS (0xFFFFF000) // (SYS) Base Address +-#define AT91C_BASE_AIC (0xFFFFF000) // (AIC) Base Address +-#define AT91C_BASE_PDC_DBGU (0xFFFFF300) // (PDC_DBGU) Base Address +-#define AT91C_BASE_DBGU (0xFFFFF200) // (DBGU) Base Address +-#define AT91C_BASE_PIOA (0xFFFFF400) // (PIOA) Base Address +-#define AT91C_BASE_PIOB (0xFFFFF600) // (PIOB) Base Address +-#define AT91C_BASE_CKGR (0xFFFFFC20) // (CKGR) Base Address +-#define AT91C_BASE_PMC (0xFFFFFC00) // (PMC) Base Address +-#define AT91C_BASE_RSTC (0xFFFFFD00) // (RSTC) Base Address +-#define AT91C_BASE_RTTC (0xFFFFFD20) // (RTTC) Base Address +-#define AT91C_BASE_PITC (0xFFFFFD30) // (PITC) Base Address +-#define AT91C_BASE_WDTC (0xFFFFFD40) // (WDTC) Base Address +-#define AT91C_BASE_VREG (0xFFFFFD60) // (VREG) Base Address +-#define AT91C_BASE_MC (0xFFFFFF00) // (MC) Base Address +-#define AT91C_BASE_PDC_SPI1 (0xFFFE4100) // (PDC_SPI1) Base Address +-#define AT91C_BASE_SPI1 (0xFFFE4000) // (SPI1) Base Address +-#define AT91C_BASE_PDC_SPI0 (0xFFFE0100) // (PDC_SPI0) Base Address +-#define AT91C_BASE_SPI0 (0xFFFE0000) // (SPI0) Base Address +-#define AT91C_BASE_PDC_US1 (0xFFFC4100) // (PDC_US1) Base Address +-#define AT91C_BASE_US1 (0xFFFC4000) // (US1) Base Address +-#define AT91C_BASE_PDC_US0 (0xFFFC0100) // (PDC_US0) Base Address +-#define AT91C_BASE_US0 (0xFFFC0000) // (US0) Base Address +-#define AT91C_BASE_PDC_SSC (0xFFFD4100) // (PDC_SSC) Base Address +-#define AT91C_BASE_SSC (0xFFFD4000) // (SSC) Base Address +-#define AT91C_BASE_TWI (0xFFFB8000) // (TWI) Base Address +-#define AT91C_BASE_PWMC_CH3 (0xFFFCC260) // (PWMC_CH3) Base Address +-#define AT91C_BASE_PWMC_CH2 (0xFFFCC240) // (PWMC_CH2) Base Address +-#define AT91C_BASE_PWMC_CH1 (0xFFFCC220) // (PWMC_CH1) Base Address +-#define AT91C_BASE_PWMC_CH0 (0xFFFCC200) // (PWMC_CH0) Base Address +-#define AT91C_BASE_PWMC (0xFFFCC000) // (PWMC) Base Address +-#define AT91C_BASE_UDP (0xFFFB0000) // (UDP) Base Address +-#define AT91C_BASE_TC0 (0xFFFA0000) // (TC0) Base Address +-#define AT91C_BASE_TC1 (0xFFFA0040) // (TC1) Base Address +-#define AT91C_BASE_TC2 (0xFFFA0080) // (TC2) Base Address +-#define AT91C_BASE_TCB (0xFFFA0000) // (TCB) Base Address +-#define AT91C_BASE_CAN_MB0 (0xFFFD0200) // (CAN_MB0) Base Address +-#define AT91C_BASE_CAN_MB1 (0xFFFD0220) // (CAN_MB1) Base Address +-#define AT91C_BASE_CAN_MB2 (0xFFFD0240) // (CAN_MB2) Base Address +-#define AT91C_BASE_CAN_MB3 (0xFFFD0260) // (CAN_MB3) Base Address +-#define AT91C_BASE_CAN_MB4 (0xFFFD0280) // (CAN_MB4) Base Address +-#define AT91C_BASE_CAN_MB5 (0xFFFD02A0) // (CAN_MB5) Base Address +-#define AT91C_BASE_CAN_MB6 (0xFFFD02C0) // (CAN_MB6) Base Address +-#define AT91C_BASE_CAN_MB7 (0xFFFD02E0) // (CAN_MB7) Base Address +-#define AT91C_BASE_CAN (0xFFFD0000) // (CAN) Base Address +-#define AT91C_BASE_EMAC (0xFFFDC000) // (EMAC) Base Address +-#define AT91C_BASE_PDC_ADC (0xFFFD8100) // (PDC_ADC) Base Address +-#define AT91C_BASE_ADC (0xFFFD8000) // (ADC) Base Address +- +-// ***************************************************************************** +-// MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256 +-// ***************************************************************************** +-// ISRAM +-#define AT91C_ISRAM (0x00200000) // Internal SRAM base address +-#define AT91C_ISRAM_SIZE (0x00010000) // Internal SRAM size in byte (64 Kbytes) +-// IFLASH +-#define AT91C_IFLASH (0x00100000) // Internal FLASH base address +-#define AT91C_IFLASH_SIZE (0x00040000) // Internal FLASH size in byte (256 Kbytes) +-#define AT91C_IFLASH_PAGE_SIZE (256) // Internal FLASH Page Size: 256 bytes +-#define AT91C_IFLASH_LOCK_REGION_SIZE (16384) // Internal FLASH Lock Region Size: 16 Kbytes +-#define AT91C_IFLASH_NB_OF_PAGES (1024) // Internal FLASH Number of Pages: 1024 bytes +-#define AT91C_IFLASH_NB_OF_LOCK_BITS (16) // Internal FLASH Number of Lock Bits: 16 bytes +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/lib_AT91SAM7X256.h b/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/lib_AT91SAM7X256.h +deleted file mode 100644 +index 8bd8f04d24..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/lib_AT91SAM7X256.h ++++ /dev/null +@@ -1,4211 +0,0 @@ +-//* ---------------------------------------------------------------------------- +-//* ATMEL Microcontroller Software Support - ROUSSET - +-//* ---------------------------------------------------------------------------- +-//* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-//* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-//* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-//* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : lib_AT91SAM7X256.h +-//* Object : AT91SAM7X256 inlined functions +-//* Generated : AT91 SW Application Group 01/16/2006 (16:36:21) +-//* +-//* CVS Reference : /lib_MC_SAM7X.h/1.1/Thu Mar 25 15:19:14 2004// +-//* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// +-//* CVS Reference : /lib_dbgu.h/1.1/Thu Aug 25 12:56:22 2005// +-//* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// +-//* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// +-//* CVS Reference : /lib_spi2.h/1.2/Tue Aug 23 15:37:28 2005// +-//* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// +-//* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// +-//* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// +-//* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// +-//* CVS Reference : /lib_pmc_SAM7X.h/1.5/Fri Nov 4 09:41:32 2005// +-//* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// +-//* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// +-//* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// +-//* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// +-//* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// +-//* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// +-//* CVS Reference : /lib_udp.h/1.5/Tue Aug 30 12:13:47 2005// +-//* CVS Reference : /lib_aic_6075b.h/1.2/Thu Jul 7 07:48:22 2005// +-//* CVS Reference : /lib_can_AT91.h/1.5/Tue Aug 23 15:37:07 2005// +-//* ---------------------------------------------------------------------------- +- +-#ifndef lib_AT91SAM7X256_H +-#define lib_AT91SAM7X256_H +- +-/* ***************************************************************************** +- SOFTWARE API FOR AIC +- ***************************************************************************** */ +-#define AT91C_AIC_BRANCH_OPCODE ((void (*) ()) 0xE51FFF20) // ldr, pc, [pc, #-&F20] +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_ConfigureIt +-//* \brief Interrupt Handler Initialization +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_AIC_ConfigureIt ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id, // \arg interrupt number to initialize +- unsigned int priority, // \arg priority to give to the interrupt +- unsigned int src_type, // \arg activation and sense of activation +- void (*newHandler) () ) // \arg address of the interrupt handler +-{ +- unsigned int oldHandler; +- unsigned int mask ; +- +- oldHandler = pAic->AIC_SVR[irq_id]; +- +- mask = 0x1 << irq_id ; +- //* Disable the interrupt on the interrupt controller +- pAic->AIC_IDCR = mask ; +- //* Save the interrupt handler routine pointer and the interrupt priority +- pAic->AIC_SVR[irq_id] = (unsigned int) newHandler ; +- //* Store the Source Mode Register +- pAic->AIC_SMR[irq_id] = src_type | priority ; +- //* Clear the interrupt on the interrupt controller +- pAic->AIC_ICCR = mask ; +- +- return oldHandler; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_EnableIt +-//* \brief Enable corresponding IT number +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_EnableIt ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id ) // \arg interrupt number to initialize +-{ +- //* Enable the interrupt on the interrupt controller +- pAic->AIC_IECR = 0x1 << irq_id ; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_DisableIt +-//* \brief Disable corresponding IT number +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_DisableIt ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id ) // \arg interrupt number to initialize +-{ +- unsigned int mask = 0x1 << irq_id; +- //* Disable the interrupt on the interrupt controller +- pAic->AIC_IDCR = mask ; +- //* Clear the interrupt on the Interrupt Controller ( if one is pending ) +- pAic->AIC_ICCR = mask ; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_ClearIt +-//* \brief Clear corresponding IT number +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_ClearIt ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id) // \arg interrupt number to initialize +-{ +- //* Clear the interrupt on the Interrupt Controller ( if one is pending ) +- pAic->AIC_ICCR = (0x1 << irq_id); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_AcknowledgeIt +-//* \brief Acknowledge corresponding IT number +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_AcknowledgeIt ( +- AT91PS_AIC pAic) // \arg pointer to the AIC registers +-{ +- pAic->AIC_EOICR = pAic->AIC_EOICR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_SetExceptionVector +-//* \brief Configure vector handler +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_AIC_SetExceptionVector ( +- unsigned int *pVector, // \arg pointer to the AIC registers +- void (*Handler) () ) // \arg Interrupt Handler +-{ +- unsigned int oldVector = *pVector; +- +- if ((unsigned int) Handler == (unsigned int) AT91C_AIC_BRANCH_OPCODE) +- *pVector = (unsigned int) AT91C_AIC_BRANCH_OPCODE; +- else +- *pVector = (((((unsigned int) Handler) - ((unsigned int) pVector) - 0x8) >> 2) & 0x00FFFFFF) | 0xEA000000; +- +- return oldVector; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_Trig +-//* \brief Trig an IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_Trig ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id) // \arg interrupt number +-{ +- pAic->AIC_ISCR = (0x1 << irq_id) ; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_IsActive +-//* \brief Test if an IT is active +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_AIC_IsActive ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id) // \arg Interrupt Number +-{ +- return (pAic->AIC_ISR & (0x1 << irq_id)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_IsPending +-//* \brief Test if an IT is pending +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_AIC_IsPending ( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- unsigned int irq_id) // \arg Interrupt Number +-{ +- return (pAic->AIC_IPR & (0x1 << irq_id)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_Open +-//* \brief Set exception vectors and AIC registers to default values +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_Open( +- AT91PS_AIC pAic, // \arg pointer to the AIC registers +- void (*IrqHandler) (), // \arg Default IRQ vector exception +- void (*FiqHandler) (), // \arg Default FIQ vector exception +- void (*DefaultHandler) (), // \arg Default Handler set in ISR +- void (*SpuriousHandler) (), // \arg Default Spurious Handler +- unsigned int protectMode) // \arg Debug Control Register +-{ +- int i; +- +- // Disable all interrupts and set IVR to the default handler +- for (i = 0; i < 32; ++i) { +- AT91F_AIC_DisableIt(pAic, i); +- AT91F_AIC_ConfigureIt(pAic, i, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_HIGH_LEVEL, DefaultHandler); +- } +- +- // Set the IRQ exception vector +- AT91F_AIC_SetExceptionVector((unsigned int *) 0x18, IrqHandler); +- // Set the Fast Interrupt exception vector +- AT91F_AIC_SetExceptionVector((unsigned int *) 0x1C, FiqHandler); +- +- pAic->AIC_SPU = (unsigned int) SpuriousHandler; +- pAic->AIC_DCR = protectMode; +-} +-/* ***************************************************************************** +- SOFTWARE API FOR PDC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_SetNextRx +-//* \brief Set the next receive transfer descriptor +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_SetNextRx ( +- AT91PS_PDC pPDC, // \arg pointer to a PDC controller +- char *address, // \arg address to the next bloc to be received +- unsigned int bytes) // \arg number of bytes to be received +-{ +- pPDC->PDC_RNPR = (unsigned int) address; +- pPDC->PDC_RNCR = bytes; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_SetNextTx +-//* \brief Set the next transmit transfer descriptor +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_SetNextTx ( +- AT91PS_PDC pPDC, // \arg pointer to a PDC controller +- char *address, // \arg address to the next bloc to be transmitted +- unsigned int bytes) // \arg number of bytes to be transmitted +-{ +- pPDC->PDC_TNPR = (unsigned int) address; +- pPDC->PDC_TNCR = bytes; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_SetRx +-//* \brief Set the receive transfer descriptor +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_SetRx ( +- AT91PS_PDC pPDC, // \arg pointer to a PDC controller +- char *address, // \arg address to the next bloc to be received +- unsigned int bytes) // \arg number of bytes to be received +-{ +- pPDC->PDC_RPR = (unsigned int) address; +- pPDC->PDC_RCR = bytes; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_SetTx +-//* \brief Set the transmit transfer descriptor +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_SetTx ( +- AT91PS_PDC pPDC, // \arg pointer to a PDC controller +- char *address, // \arg address to the next bloc to be transmitted +- unsigned int bytes) // \arg number of bytes to be transmitted +-{ +- pPDC->PDC_TPR = (unsigned int) address; +- pPDC->PDC_TCR = bytes; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_EnableTx +-//* \brief Enable transmit +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_EnableTx ( +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- pPDC->PDC_PTCR = AT91C_PDC_TXTEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_EnableRx +-//* \brief Enable receive +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_EnableRx ( +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- pPDC->PDC_PTCR = AT91C_PDC_RXTEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_DisableTx +-//* \brief Disable transmit +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_DisableTx ( +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- pPDC->PDC_PTCR = AT91C_PDC_TXTDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_DisableRx +-//* \brief Disable receive +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_DisableRx ( +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_IsTxEmpty +-//* \brief Test if the current transfer descriptor has been sent +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PDC_IsTxEmpty ( // \return return 1 if transfer is complete +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- return !(pPDC->PDC_TCR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_IsNextTxEmpty +-//* \brief Test if the next transfer descriptor has been moved to the current td +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PDC_IsNextTxEmpty ( // \return return 1 if transfer is complete +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- return !(pPDC->PDC_TNCR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_IsRxEmpty +-//* \brief Test if the current transfer descriptor has been filled +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PDC_IsRxEmpty ( // \return return 1 if transfer is complete +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- return !(pPDC->PDC_RCR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_IsNextRxEmpty +-//* \brief Test if the next transfer descriptor has been moved to the current td +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PDC_IsNextRxEmpty ( // \return return 1 if transfer is complete +- AT91PS_PDC pPDC ) // \arg pointer to a PDC controller +-{ +- return !(pPDC->PDC_RNCR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_Open +-//* \brief Open PDC: disable TX and RX reset transfer descriptors, re-enable RX and TX +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_Open ( +- AT91PS_PDC pPDC) // \arg pointer to a PDC controller +-{ +- //* Disable the RX and TX PDC transfer requests +- AT91F_PDC_DisableRx(pPDC); +- AT91F_PDC_DisableTx(pPDC); +- +- //* Reset all Counter register Next buffer first +- AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetTx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetRx(pPDC, (char *) 0, 0); +- +- //* Enable the RX and TX PDC transfer requests +- AT91F_PDC_EnableRx(pPDC); +- AT91F_PDC_EnableTx(pPDC); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_Close +-//* \brief Close PDC: disable TX and RX reset transfer descriptors +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PDC_Close ( +- AT91PS_PDC pPDC) // \arg pointer to a PDC controller +-{ +- //* Disable the RX and TX PDC transfer requests +- AT91F_PDC_DisableRx(pPDC); +- AT91F_PDC_DisableTx(pPDC); +- +- //* Reset all Counter register Next buffer first +- AT91F_PDC_SetNextTx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetNextRx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetTx(pPDC, (char *) 0, 0); +- AT91F_PDC_SetRx(pPDC, (char *) 0, 0); +- +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_SendFrame +-//* \brief Close PDC: disable TX and RX reset transfer descriptors +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PDC_SendFrame( +- AT91PS_PDC pPDC, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- if (AT91F_PDC_IsTxEmpty(pPDC)) { +- //* Buffer and next buffer can be initialized +- AT91F_PDC_SetTx(pPDC, pBuffer, szBuffer); +- AT91F_PDC_SetNextTx(pPDC, pNextBuffer, szNextBuffer); +- return 2; +- } +- else if (AT91F_PDC_IsNextTxEmpty(pPDC)) { +- //* Only one buffer can be initialized +- AT91F_PDC_SetNextTx(pPDC, pBuffer, szBuffer); +- return 1; +- } +- else { +- //* All buffer are in use... +- return 0; +- } +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PDC_ReceiveFrame +-//* \brief Close PDC: disable TX and RX reset transfer descriptors +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PDC_ReceiveFrame ( +- AT91PS_PDC pPDC, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- if (AT91F_PDC_IsRxEmpty(pPDC)) { +- //* Buffer and next buffer can be initialized +- AT91F_PDC_SetRx(pPDC, pBuffer, szBuffer); +- AT91F_PDC_SetNextRx(pPDC, pNextBuffer, szNextBuffer); +- return 2; +- } +- else if (AT91F_PDC_IsNextRxEmpty(pPDC)) { +- //* Only one buffer can be initialized +- AT91F_PDC_SetNextRx(pPDC, pBuffer, szBuffer); +- return 1; +- } +- else { +- //* All buffer are in use... +- return 0; +- } +-} +-/* ***************************************************************************** +- SOFTWARE API FOR DBGU +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_InterruptEnable +-//* \brief Enable DBGU Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_DBGU_InterruptEnable( +- AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller +- unsigned int flag) // \arg dbgu interrupt to be enabled +-{ +- pDbgu->DBGU_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_InterruptDisable +-//* \brief Disable DBGU Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_DBGU_InterruptDisable( +- AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller +- unsigned int flag) // \arg dbgu interrupt to be disabled +-{ +- pDbgu->DBGU_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_GetInterruptMaskStatus +-//* \brief Return DBGU Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_DBGU_GetInterruptMaskStatus( // \return DBGU Interrupt Mask Status +- AT91PS_DBGU pDbgu) // \arg pointer to a DBGU controller +-{ +- return pDbgu->DBGU_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_IsInterruptMasked +-//* \brief Test if DBGU Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_DBGU_IsInterruptMasked( +- AT91PS_DBGU pDbgu, // \arg pointer to a DBGU controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_DBGU_GetInterruptMaskStatus(pDbgu) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR PIO +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgPeriph +-//* \brief Enable pins to be drived by peripheral +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgPeriph( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int periphAEnable, // \arg PERIPH A to enable +- unsigned int periphBEnable) // \arg PERIPH B to enable +- +-{ +- pPio->PIO_ASR = periphAEnable; +- pPio->PIO_BSR = periphBEnable; +- pPio->PIO_PDR = (periphAEnable | periphBEnable); // Set in Periph mode +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgOutput +-//* \brief Enable PIO in output mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgOutput( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int pioEnable) // \arg PIO to be enabled +-{ +- pPio->PIO_PER = pioEnable; // Set in PIO mode +- pPio->PIO_OER = pioEnable; // Configure in Output +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgInput +-//* \brief Enable PIO in input mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgInput( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int inputEnable) // \arg PIO to be enabled +-{ +- // Disable output +- pPio->PIO_ODR = inputEnable; +- pPio->PIO_PER = inputEnable; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgOpendrain +-//* \brief Configure PIO in open drain +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgOpendrain( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int multiDrvEnable) // \arg pio to be configured in open drain +-{ +- // Configure the multi-drive option +- pPio->PIO_MDDR = ~multiDrvEnable; +- pPio->PIO_MDER = multiDrvEnable; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgPullup +-//* \brief Enable pullup on PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgPullup( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int pullupEnable) // \arg enable pullup on PIO +-{ +- // Connect or not Pullup +- pPio->PIO_PPUDR = ~pullupEnable; +- pPio->PIO_PPUER = pullupEnable; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgDirectDrive +-//* \brief Enable direct drive on PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgDirectDrive( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int directDrive) // \arg PIO to be configured with direct drive +- +-{ +- // Configure the Direct Drive +- pPio->PIO_OWDR = ~directDrive; +- pPio->PIO_OWER = directDrive; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_CfgInputFilter +-//* \brief Enable input filter on input PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_CfgInputFilter( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int inputFilter) // \arg PIO to be configured with input filter +- +-{ +- // Configure the Direct Drive +- pPio->PIO_IFDR = ~inputFilter; +- pPio->PIO_IFER = inputFilter; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetInput +-//* \brief Return PIO input value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetInput( // \return PIO input +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_PDSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsInputSet +-//* \brief Test if PIO is input flag is active +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsInputSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetInput(pPio) & flag); +-} +- +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_SetOutput +-//* \brief Set to 1 output PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_SetOutput( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg output to be set +-{ +- pPio->PIO_SODR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_ClearOutput +-//* \brief Set to 0 output PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_ClearOutput( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg output to be cleared +-{ +- pPio->PIO_CODR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_ForceOutput +-//* \brief Force output when Direct drive option is enabled +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_ForceOutput( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg output to be forced +-{ +- pPio->PIO_ODSR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_Enable +-//* \brief Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_Enable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio to be enabled +-{ +- pPio->PIO_PER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_Disable +-//* \brief Disable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_Disable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio to be disabled +-{ +- pPio->PIO_PDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetStatus +-//* \brief Return PIO Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetStatus( // \return PIO Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_PSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsSet +-//* \brief Test if PIO is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_OutputEnable +-//* \brief Output Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_OutputEnable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio output to be enabled +-{ +- pPio->PIO_OER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_OutputDisable +-//* \brief Output Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_OutputDisable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio output to be disabled +-{ +- pPio->PIO_ODR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetOutputStatus +-//* \brief Return PIO Output Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetOutputStatus( // \return PIO Output Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_OSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsOuputSet +-//* \brief Test if PIO Output is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsOutputSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetOutputStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_InputFilterEnable +-//* \brief Input Filter Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_InputFilterEnable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio input filter to be enabled +-{ +- pPio->PIO_IFER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_InputFilterDisable +-//* \brief Input Filter Disable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_InputFilterDisable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio input filter to be disabled +-{ +- pPio->PIO_IFDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetInputFilterStatus +-//* \brief Return PIO Input Filter Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetInputFilterStatus( // \return PIO Input Filter Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_IFSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsInputFilterSet +-//* \brief Test if PIO Input filter is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsInputFilterSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetInputFilterStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetOutputDataStatus +-//* \brief Return PIO Output Data Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetOutputDataStatus( // \return PIO Output Data Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_ODSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_InterruptEnable +-//* \brief Enable PIO Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_InterruptEnable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio interrupt to be enabled +-{ +- pPio->PIO_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_InterruptDisable +-//* \brief Disable PIO Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_InterruptDisable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio interrupt to be disabled +-{ +- pPio->PIO_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetInterruptMaskStatus +-//* \brief Return PIO Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetInterruptMaskStatus( // \return PIO Interrupt Mask Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetInterruptStatus +-//* \brief Return PIO Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetInterruptStatus( // \return PIO Interrupt Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_ISR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsInterruptMasked +-//* \brief Test if PIO Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsInterruptMasked( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetInterruptMaskStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsInterruptSet +-//* \brief Test if PIO Interrupt is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsInterruptSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetInterruptStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_MultiDriverEnable +-//* \brief Multi Driver Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_MultiDriverEnable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio to be enabled +-{ +- pPio->PIO_MDER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_MultiDriverDisable +-//* \brief Multi Driver Disable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_MultiDriverDisable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio to be disabled +-{ +- pPio->PIO_MDDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetMultiDriverStatus +-//* \brief Return PIO Multi Driver Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetMultiDriverStatus( // \return PIO Multi Driver Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_MDSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsMultiDriverSet +-//* \brief Test if PIO MultiDriver is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsMultiDriverSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetMultiDriverStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_A_RegisterSelection +-//* \brief PIO A Register Selection +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_A_RegisterSelection( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio A register selection +-{ +- pPio->PIO_ASR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_B_RegisterSelection +-//* \brief PIO B Register Selection +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_B_RegisterSelection( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio B register selection +-{ +- pPio->PIO_BSR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_Get_AB_RegisterStatus +-//* \brief Return PIO Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_Get_AB_RegisterStatus( // \return PIO AB Register Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_ABSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsAB_RegisterSet +-//* \brief Test if PIO AB Register is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsAB_RegisterSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_Get_AB_RegisterStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_OutputWriteEnable +-//* \brief Output Write Enable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_OutputWriteEnable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio output write to be enabled +-{ +- pPio->PIO_OWER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_OutputWriteDisable +-//* \brief Output Write Disable PIO +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIO_OutputWriteDisable( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg pio output write to be disabled +-{ +- pPio->PIO_OWDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetOutputWriteStatus +-//* \brief Return PIO Output Write Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetOutputWriteStatus( // \return PIO Output Write Status +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_OWSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsOutputWriteSet +-//* \brief Test if PIO OutputWrite is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsOutputWriteSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetOutputWriteStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_GetCfgPullup +-//* \brief Return PIO Configuration Pullup +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PIO_GetCfgPullup( // \return PIO Configuration Pullup +- AT91PS_PIO pPio) // \arg pointer to a PIO controller +-{ +- return pPio->PIO_PPUSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsOutputDataStatusSet +-//* \brief Test if PIO Output Data Status is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsOutputDataStatusSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PIO_GetOutputDataStatus(pPio) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIO_IsCfgPullupStatusSet +-//* \brief Test if PIO Configuration Pullup Status is Set +-//*---------------------------------------------------------------------------- +-__inline int AT91F_PIO_IsCfgPullupStatusSet( +- AT91PS_PIO pPio, // \arg pointer to a PIO controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (~AT91F_PIO_GetCfgPullup(pPio) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR PMC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_CfgSysClkEnableReg +-//* \brief Configure the System Clock Enable Register of the PMC controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_CfgSysClkEnableReg ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int mode) +-{ +- //* Write to the SCER register +- pPMC->PMC_SCER = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_CfgSysClkDisableReg +-//* \brief Configure the System Clock Disable Register of the PMC controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_CfgSysClkDisableReg ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int mode) +-{ +- //* Write to the SCDR register +- pPMC->PMC_SCDR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_GetSysClkStatusReg +-//* \brief Return the System Clock Status Register of the PMC controller +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_GetSysClkStatusReg ( +- AT91PS_PMC pPMC // pointer to a CAN controller +- ) +-{ +- return pPMC->PMC_SCSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_EnablePeriphClock +-//* \brief Enable peripheral clock +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_EnablePeriphClock ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int periphIds) // \arg IDs of peripherals +-{ +- pPMC->PMC_PCER = periphIds; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_DisablePeriphClock +-//* \brief Disable peripheral clock +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_DisablePeriphClock ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int periphIds) // \arg IDs of peripherals +-{ +- pPMC->PMC_PCDR = periphIds; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_GetPeriphClock +-//* \brief Get peripheral clock status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_GetPeriphClock ( +- AT91PS_PMC pPMC) // \arg pointer to PMC controller +-{ +- return pPMC->PMC_PCSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_CfgMainOscillatorReg +-//* \brief Cfg the main oscillator +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CKGR_CfgMainOscillatorReg ( +- AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +- unsigned int mode) +-{ +- pCKGR->CKGR_MOR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_GetMainOscillatorReg +-//* \brief Cfg the main oscillator +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CKGR_GetMainOscillatorReg ( +- AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +-{ +- return pCKGR->CKGR_MOR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_EnableMainOscillator +-//* \brief Enable the main oscillator +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CKGR_EnableMainOscillator( +- AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +-{ +- pCKGR->CKGR_MOR |= AT91C_CKGR_MOSCEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_DisableMainOscillator +-//* \brief Disable the main oscillator +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CKGR_DisableMainOscillator ( +- AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +-{ +- pCKGR->CKGR_MOR &= ~AT91C_CKGR_MOSCEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_CfgMainOscStartUpTime +-//* \brief Cfg MOR Register according to the main osc startup time +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CKGR_CfgMainOscStartUpTime ( +- AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +- unsigned int startup_time, // \arg main osc startup time in microsecond (us) +- unsigned int slowClock) // \arg slowClock in Hz +-{ +- pCKGR->CKGR_MOR &= ~AT91C_CKGR_OSCOUNT; +- pCKGR->CKGR_MOR |= ((slowClock * startup_time)/(8*1000000)) << 8; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_GetMainClockFreqReg +-//* \brief Cfg the main oscillator +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CKGR_GetMainClockFreqReg ( +- AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +-{ +- return pCKGR->CKGR_MCFR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CKGR_GetMainClock +-//* \brief Return Main clock in Hz +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CKGR_GetMainClock ( +- AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +- unsigned int slowClock) // \arg slowClock in Hz +-{ +- return ((pCKGR->CKGR_MCFR & AT91C_CKGR_MAINF) * slowClock) >> 4; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_CfgMCKReg +-//* \brief Cfg Master Clock Register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_CfgMCKReg ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int mode) +-{ +- pPMC->PMC_MCKR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_GetMCKReg +-//* \brief Return Master Clock Register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_GetMCKReg( +- AT91PS_PMC pPMC) // \arg pointer to PMC controller +-{ +- return pPMC->PMC_MCKR; +-} +- +-//*------------------------------------------------------------------------------ +-//* \fn AT91F_PMC_GetMasterClock +-//* \brief Return master clock in Hz which correponds to processor clock for ARM7 +-//*------------------------------------------------------------------------------ +-__inline unsigned int AT91F_PMC_GetMasterClock ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +- unsigned int slowClock) // \arg slowClock in Hz +-{ +- unsigned int reg = pPMC->PMC_MCKR; +- unsigned int prescaler = (1 << ((reg & AT91C_PMC_PRES) >> 2)); +- unsigned int pllDivider, pllMultiplier; +- +- switch (reg & AT91C_PMC_CSS) { +- case AT91C_PMC_CSS_SLOW_CLK: // Slow clock selected +- return slowClock / prescaler; +- case AT91C_PMC_CSS_MAIN_CLK: // Main clock is selected +- return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / prescaler; +- case AT91C_PMC_CSS_PLL_CLK: // PLLB clock is selected +- reg = pCKGR->CKGR_PLLR; +- pllDivider = (reg & AT91C_CKGR_DIV); +- pllMultiplier = ((reg & AT91C_CKGR_MUL) >> 16) + 1; +- return AT91F_CKGR_GetMainClock(pCKGR, slowClock) / pllDivider * pllMultiplier / prescaler; +- } +- return 0; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_EnablePCK +-//* \brief Enable Programmable Clock x Output +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_EnablePCK ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int pck, // \arg Programmable Clock x Output +- unsigned int mode) +-{ +- pPMC->PMC_PCKR[pck] = mode; +- pPMC->PMC_SCER = (1 << pck) << 8; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_DisablePCK +-//* \brief Disable Programmable Clock x Output +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_DisablePCK ( +- AT91PS_PMC pPMC, // \arg pointer to PMC controller +- unsigned int pck) // \arg Programmable Clock x Output +-{ +- pPMC->PMC_SCDR = (1 << pck) << 8; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_EnableIt +-//* \brief Enable PMC interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_EnableIt ( +- AT91PS_PMC pPMC, // pointer to a PMC controller +- unsigned int flag) // IT to be enabled +-{ +- //* Write to the IER register +- pPMC->PMC_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_DisableIt +-//* \brief Disable PMC interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_DisableIt ( +- AT91PS_PMC pPMC, // pointer to a PMC controller +- unsigned int flag) // IT to be disabled +-{ +- //* Write to the IDR register +- pPMC->PMC_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_GetStatus +-//* \brief Return PMC Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_GetStatus( // \return PMC Interrupt Status +- AT91PS_PMC pPMC) // pointer to a PMC controller +-{ +- return pPMC->PMC_SR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_GetInterruptMaskStatus +-//* \brief Return PMC Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_GetInterruptMaskStatus( // \return PMC Interrupt Mask Status +- AT91PS_PMC pPMC) // pointer to a PMC controller +-{ +- return pPMC->PMC_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_IsInterruptMasked +-//* \brief Test if PMC Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_IsInterruptMasked( +- AT91PS_PMC pPMC, // \arg pointer to a PMC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PMC_GetInterruptMaskStatus(pPMC) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_IsStatusSet +-//* \brief Test if PMC Status is Set +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PMC_IsStatusSet( +- AT91PS_PMC pPMC, // \arg pointer to a PMC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PMC_GetStatus(pPMC) & flag); +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_CKGR_CfgPLLReg +-// \brief Cfg the PLL Register +-// ---------------------------------------------------------------------------- +-__inline void AT91F_CKGR_CfgPLLReg ( +- AT91PS_CKGR pCKGR, // \arg pointer to CKGR controller +- unsigned int mode) +-{ +- pCKGR->CKGR_PLLR = mode; +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_CKGR_GetPLLReg +-// \brief Get the PLL Register +-// ---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CKGR_GetPLLReg ( +- AT91PS_CKGR pCKGR) // \arg pointer to CKGR controller +-{ +- return pCKGR->CKGR_PLLR; +-} +- +- +-/* ***************************************************************************** +- SOFTWARE API FOR RSTC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTSoftReset +-//* \brief Start Software Reset +-//*---------------------------------------------------------------------------- +-__inline void AT91F_RSTSoftReset( +- AT91PS_RSTC pRSTC, +- unsigned int reset) +-{ +- pRSTC->RSTC_RCR = (0xA5000000 | reset); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTSetMode +-//* \brief Set Reset Mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_RSTSetMode( +- AT91PS_RSTC pRSTC, +- unsigned int mode) +-{ +- pRSTC->RSTC_RMR = (0xA5000000 | mode); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTGetMode +-//* \brief Get Reset Mode +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_RSTGetMode( +- AT91PS_RSTC pRSTC) +-{ +- return (pRSTC->RSTC_RMR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTGetStatus +-//* \brief Get Reset Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_RSTGetStatus( +- AT91PS_RSTC pRSTC) +-{ +- return (pRSTC->RSTC_RSR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTIsSoftRstActive +-//* \brief Return !=0 if software reset is still not completed +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_RSTIsSoftRstActive( +- AT91PS_RSTC pRSTC) +-{ +- return ((pRSTC->RSTC_RSR) & AT91C_RSTC_SRCMP); +-} +-/* ***************************************************************************** +- SOFTWARE API FOR RTTC +- ***************************************************************************** */ +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_SetRTT_TimeBase() +-//* \brief Set the RTT prescaler according to the TimeBase in ms +-//*-------------------------------------------------------------------------------------- +-__inline unsigned int AT91F_RTTSetTimeBase( +- AT91PS_RTTC pRTTC, +- unsigned int ms) +-{ +- if (ms > 2000) +- return 1; // AT91C_TIME_OUT_OF_RANGE +- pRTTC->RTTC_RTMR &= ~0xFFFF; +- pRTTC->RTTC_RTMR |= (((ms << 15) /1000) & 0xFFFF); +- return 0; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTTSetPrescaler() +-//* \brief Set the new prescaler value +-//*-------------------------------------------------------------------------------------- +-__inline unsigned int AT91F_RTTSetPrescaler( +- AT91PS_RTTC pRTTC, +- unsigned int rtpres) +-{ +- pRTTC->RTTC_RTMR &= ~0xFFFF; +- pRTTC->RTTC_RTMR |= (rtpres & 0xFFFF); +- return (pRTTC->RTTC_RTMR); +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTTRestart() +-//* \brief Restart the RTT prescaler +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTRestart( +- AT91PS_RTTC pRTTC) +-{ +- pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTRST; +-} +- +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_SetAlarmINT() +-//* \brief Enable RTT Alarm Interrupt +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTSetAlarmINT( +- AT91PS_RTTC pRTTC) +-{ +- pRTTC->RTTC_RTMR |= AT91C_RTTC_ALMIEN; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_ClearAlarmINT() +-//* \brief Disable RTT Alarm Interrupt +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTClearAlarmINT( +- AT91PS_RTTC pRTTC) +-{ +- pRTTC->RTTC_RTMR &= ~AT91C_RTTC_ALMIEN; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_SetRttIncINT() +-//* \brief Enable RTT INC Interrupt +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTSetRttIncINT( +- AT91PS_RTTC pRTTC) +-{ +- pRTTC->RTTC_RTMR |= AT91C_RTTC_RTTINCIEN; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_ClearRttIncINT() +-//* \brief Disable RTT INC Interrupt +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTClearRttIncINT( +- AT91PS_RTTC pRTTC) +-{ +- pRTTC->RTTC_RTMR &= ~AT91C_RTTC_RTTINCIEN; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_SetAlarmValue() +-//* \brief Set RTT Alarm Value +-//*-------------------------------------------------------------------------------------- +-__inline void AT91F_RTTSetAlarmValue( +- AT91PS_RTTC pRTTC, unsigned int alarm) +-{ +- pRTTC->RTTC_RTAR = alarm; +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_GetAlarmValue() +-//* \brief Get RTT Alarm Value +-//*-------------------------------------------------------------------------------------- +-__inline unsigned int AT91F_RTTGetAlarmValue( +- AT91PS_RTTC pRTTC) +-{ +- return(pRTTC->RTTC_RTAR); +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTTGetStatus() +-//* \brief Read the RTT status +-//*-------------------------------------------------------------------------------------- +-__inline unsigned int AT91F_RTTGetStatus( +- AT91PS_RTTC pRTTC) +-{ +- return(pRTTC->RTTC_RTSR); +-} +- +-//*-------------------------------------------------------------------------------------- +-//* \fn AT91F_RTT_ReadValue() +-//* \brief Read the RTT value +-//*-------------------------------------------------------------------------------------- +-__inline unsigned int AT91F_RTTReadValue( +- AT91PS_RTTC pRTTC) +-{ +- register volatile unsigned int val1,val2; +- do +- { +- val1 = pRTTC->RTTC_RTVR; +- val2 = pRTTC->RTTC_RTVR; +- } +- while(val1 != val2); +- return(val1); +-} +-/* ***************************************************************************** +- SOFTWARE API FOR PITC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITInit +-//* \brief System timer init : period in second, system clock freq in MHz +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PITInit( +- AT91PS_PITC pPITC, +- unsigned int period, +- unsigned int pit_frequency) +-{ +- pPITC->PITC_PIMR = period? (period * pit_frequency + 8) >> 4 : 0; // +8 to avoid %10 and /10 +- pPITC->PITC_PIMR |= AT91C_PITC_PITEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITSetPIV +-//* \brief Set the PIT Periodic Interval Value +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PITSetPIV( +- AT91PS_PITC pPITC, +- unsigned int piv) +-{ +- pPITC->PITC_PIMR = piv | (pPITC->PITC_PIMR & (AT91C_PITC_PITEN | AT91C_PITC_PITIEN)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITEnableInt +-//* \brief Enable PIT periodic interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PITEnableInt( +- AT91PS_PITC pPITC) +-{ +- pPITC->PITC_PIMR |= AT91C_PITC_PITIEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITDisableInt +-//* \brief Disable PIT periodic interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PITDisableInt( +- AT91PS_PITC pPITC) +-{ +- pPITC->PITC_PIMR &= ~AT91C_PITC_PITIEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITGetMode +-//* \brief Read PIT mode register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PITGetMode( +- AT91PS_PITC pPITC) +-{ +- return(pPITC->PITC_PIMR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITGetStatus +-//* \brief Read PIT status register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PITGetStatus( +- AT91PS_PITC pPITC) +-{ +- return(pPITC->PITC_PISR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITGetPIIR +-//* \brief Read PIT CPIV and PICNT without ressetting the counters +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PITGetPIIR( +- AT91PS_PITC pPITC) +-{ +- return(pPITC->PITC_PIIR); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITGetPIVR +-//* \brief Read System timer CPIV and PICNT without ressetting the counters +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PITGetPIVR( +- AT91PS_PITC pPITC) +-{ +- return(pPITC->PITC_PIVR); +-} +-/* ***************************************************************************** +- SOFTWARE API FOR WDTC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_WDTSetMode +-//* \brief Set Watchdog Mode Register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_WDTSetMode( +- AT91PS_WDTC pWDTC, +- unsigned int Mode) +-{ +- pWDTC->WDTC_WDMR = Mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_WDTRestart +-//* \brief Restart Watchdog +-//*---------------------------------------------------------------------------- +-__inline void AT91F_WDTRestart( +- AT91PS_WDTC pWDTC) +-{ +- pWDTC->WDTC_WDCR = 0xA5000001; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_WDTSGettatus +-//* \brief Get Watchdog Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_WDTSGettatus( +- AT91PS_WDTC pWDTC) +-{ +- return(pWDTC->WDTC_WDSR & 0x3); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_WDTGetPeriod +-//* \brief Translate ms into Watchdog Compatible value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_WDTGetPeriod(unsigned int ms) +-{ +- if ((ms < 4) || (ms > 16000)) +- return 0; +- return((ms << 8) / 1000); +-} +-/* ***************************************************************************** +- SOFTWARE API FOR VREG +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_VREG_Enable_LowPowerMode +-//* \brief Enable VREG Low Power Mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_VREG_Enable_LowPowerMode( +- AT91PS_VREG pVREG) +-{ +- pVREG->VREG_MR |= AT91C_VREG_PSTDBY; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_VREG_Disable_LowPowerMode +-//* \brief Disable VREG Low Power Mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_VREG_Disable_LowPowerMode( +- AT91PS_VREG pVREG) +-{ +- pVREG->VREG_MR &= ~AT91C_VREG_PSTDBY; +-}/* ***************************************************************************** +- SOFTWARE API FOR MC +- ***************************************************************************** */ +- +-#define AT91C_MC_CORRECT_KEY ((unsigned int) 0x5A << 24) // (MC) Correct Protect Key +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_Remap +-//* \brief Make Remap +-//*---------------------------------------------------------------------------- +-__inline void AT91F_MC_Remap (void) // +-{ +- AT91PS_MC pMC = (AT91PS_MC) AT91C_BASE_MC; +- +- pMC->MC_RCR = AT91C_MC_RCB; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_CfgModeReg +-//* \brief Configure the EFC Mode Register of the MC controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_MC_EFC_CfgModeReg ( +- AT91PS_MC pMC, // pointer to a MC controller +- unsigned int mode) // mode register +-{ +- // Write to the FMR register +- pMC->MC_FMR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_GetModeReg +-//* \brief Return MC EFC Mode Regsiter +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_MC_EFC_GetModeReg( +- AT91PS_MC pMC) // pointer to a MC controller +-{ +- return pMC->MC_FMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_ComputeFMCN +-//* \brief Return MC EFC Mode Regsiter +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_MC_EFC_ComputeFMCN( +- int master_clock) // master clock in Hz +-{ +- return (master_clock/1000000 +2); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_PerformCmd +-//* \brief Perform EFC Command +-//*---------------------------------------------------------------------------- +-__inline void AT91F_MC_EFC_PerformCmd ( +- AT91PS_MC pMC, // pointer to a MC controller +- unsigned int transfer_cmd) +-{ +- pMC->MC_FCR = transfer_cmd; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_GetStatus +-//* \brief Return MC EFC Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_MC_EFC_GetStatus( +- AT91PS_MC pMC) // pointer to a MC controller +-{ +- return pMC->MC_FSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_IsInterruptMasked +-//* \brief Test if EFC MC Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_MC_EFC_IsInterruptMasked( +- AT91PS_MC pMC, // \arg pointer to a MC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_MC_EFC_GetModeReg(pMC) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_EFC_IsInterruptSet +-//* \brief Test if EFC MC Interrupt is Set +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_MC_EFC_IsInterruptSet( +- AT91PS_MC pMC, // \arg pointer to a MC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_MC_EFC_GetStatus(pMC) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR SPI +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_CfgCs +-//* \brief Configure SPI chip select register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_CfgCs ( +- AT91PS_SPI pSPI, // pointer to a SPI controller +- int cs, // SPI cs number (0 to 3) +- int val) // chip select register +-{ +- //* Write to the CSR register +- *(pSPI->SPI_CSR + cs) = val; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_EnableIt +-//* \brief Enable SPI interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_EnableIt ( +- AT91PS_SPI pSPI, // pointer to a SPI controller +- unsigned int flag) // IT to be enabled +-{ +- //* Write to the IER register +- pSPI->SPI_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_DisableIt +-//* \brief Disable SPI interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_DisableIt ( +- AT91PS_SPI pSPI, // pointer to a SPI controller +- unsigned int flag) // IT to be disabled +-{ +- //* Write to the IDR register +- pSPI->SPI_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_Reset +-//* \brief Reset the SPI controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_Reset ( +- AT91PS_SPI pSPI // pointer to a SPI controller +- ) +-{ +- //* Write to the CR register +- pSPI->SPI_CR = AT91C_SPI_SWRST; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_Enable +-//* \brief Enable the SPI controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_Enable ( +- AT91PS_SPI pSPI // pointer to a SPI controller +- ) +-{ +- //* Write to the CR register +- pSPI->SPI_CR = AT91C_SPI_SPIEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_Disable +-//* \brief Disable the SPI controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_Disable ( +- AT91PS_SPI pSPI // pointer to a SPI controller +- ) +-{ +- //* Write to the CR register +- pSPI->SPI_CR = AT91C_SPI_SPIDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_CfgMode +-//* \brief Enable the SPI controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_CfgMode ( +- AT91PS_SPI pSPI, // pointer to a SPI controller +- int mode) // mode register +-{ +- //* Write to the MR register +- pSPI->SPI_MR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_CfgPCS +-//* \brief Switch to the correct PCS of SPI Mode Register : Fixed Peripheral Selected +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_CfgPCS ( +- AT91PS_SPI pSPI, // pointer to a SPI controller +- char PCS_Device) // PCS of the Device +-{ +- //* Write to the MR register +- pSPI->SPI_MR &= 0xFFF0FFFF; +- pSPI->SPI_MR |= ( (PCS_Device<<16) & AT91C_SPI_PCS ); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_ReceiveFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SPI_ReceiveFrame ( +- AT91PS_SPI pSPI, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_ReceiveFrame( +- (AT91PS_PDC) &(pSPI->SPI_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_SendFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is bSPIy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SPI_SendFrame( +- AT91PS_SPI pSPI, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_SendFrame( +- (AT91PS_PDC) &(pSPI->SPI_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_Close +-//* \brief Close SPI: disable IT disable transfert, close PDC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_Close ( +- AT91PS_SPI pSPI) // \arg pointer to a SPI controller +-{ +- //* Reset all the Chip Select register +- pSPI->SPI_CSR[0] = 0 ; +- pSPI->SPI_CSR[1] = 0 ; +- pSPI->SPI_CSR[2] = 0 ; +- pSPI->SPI_CSR[3] = 0 ; +- +- //* Reset the SPI mode +- pSPI->SPI_MR = 0 ; +- +- //* Disable all interrupts +- pSPI->SPI_IDR = 0xFFFFFFFF ; +- +- //* Abort the Peripheral Data Transfers +- AT91F_PDC_Close((AT91PS_PDC) &(pSPI->SPI_RPR)); +- +- //* Disable receiver and transmitter and stop any activity immediately +- pSPI->SPI_CR = AT91C_SPI_SPIDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_PutChar +-//* \brief Send a character,does not check if ready to send +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI_PutChar ( +- AT91PS_SPI pSPI, +- unsigned int character, +- unsigned int cs_number ) +-{ +- unsigned int value_for_cs; +- value_for_cs = (~(1 << cs_number)) & 0xF; //Place a zero among a 4 ONEs number +- pSPI->SPI_TDR = (character & 0xFFFF) | (value_for_cs << 16); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_GetChar +-//* \brief Receive a character,does not check if a character is available +-//*---------------------------------------------------------------------------- +-__inline int AT91F_SPI_GetChar ( +- const AT91PS_SPI pSPI) +-{ +- return((pSPI->SPI_RDR) & 0xFFFF); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_GetInterruptMaskStatus +-//* \brief Return SPI Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SPI_GetInterruptMaskStatus( // \return SPI Interrupt Mask Status +- AT91PS_SPI pSpi) // \arg pointer to a SPI controller +-{ +- return pSpi->SPI_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI_IsInterruptMasked +-//* \brief Test if SPI Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_SPI_IsInterruptMasked( +- AT91PS_SPI pSpi, // \arg pointer to a SPI controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_SPI_GetInterruptMaskStatus(pSpi) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR USART +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_Baudrate +-//* \brief Calculate the baudrate +-//* Standard Asynchronous Mode : 8 bits , 1 stop , no parity +-#define AT91C_US_ASYNC_MODE ( AT91C_US_USMODE_NORMAL + \ +- AT91C_US_NBSTOP_1_BIT + \ +- AT91C_US_PAR_NONE + \ +- AT91C_US_CHRL_8_BITS + \ +- AT91C_US_CLKS_CLOCK ) +- +-//* Standard External Asynchronous Mode : 8 bits , 1 stop , no parity +-#define AT91C_US_ASYNC_SCK_MODE ( AT91C_US_USMODE_NORMAL + \ +- AT91C_US_NBSTOP_1_BIT + \ +- AT91C_US_PAR_NONE + \ +- AT91C_US_CHRL_8_BITS + \ +- AT91C_US_CLKS_EXT ) +- +-//* Standard Synchronous Mode : 8 bits , 1 stop , no parity +-#define AT91C_US_SYNC_MODE ( AT91C_US_SYNC + \ +- AT91C_US_USMODE_NORMAL + \ +- AT91C_US_NBSTOP_1_BIT + \ +- AT91C_US_PAR_NONE + \ +- AT91C_US_CHRL_8_BITS + \ +- AT91C_US_CLKS_CLOCK ) +- +-//* SCK used Label +-#define AT91C_US_SCK_USED (AT91C_US_CKLO | AT91C_US_CLKS_EXT) +- +-//* Standard ISO T=0 Mode : 8 bits , 1 stop , parity +-#define AT91C_US_ISO_READER_MODE ( AT91C_US_USMODE_ISO7816_0 + \ +- AT91C_US_CLKS_CLOCK +\ +- AT91C_US_NBSTOP_1_BIT + \ +- AT91C_US_PAR_EVEN + \ +- AT91C_US_CHRL_8_BITS + \ +- AT91C_US_CKLO +\ +- AT91C_US_OVER) +- +-//* Standard IRDA mode +-#define AT91C_US_ASYNC_IRDA_MODE ( AT91C_US_USMODE_IRDA + \ +- AT91C_US_NBSTOP_1_BIT + \ +- AT91C_US_PAR_NONE + \ +- AT91C_US_CHRL_8_BITS + \ +- AT91C_US_CLKS_CLOCK ) +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_Baudrate +-//* \brief Caluculate baud_value according to the main clock and the baud rate +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_Baudrate ( +- const unsigned int main_clock, // \arg peripheral clock +- const unsigned int baud_rate) // \arg UART baudrate +-{ +- unsigned int baud_value = ((main_clock*10)/(baud_rate * 16)); +- if ((baud_value % 10) >= 5) +- baud_value = (baud_value / 10) + 1; +- else +- baud_value /= 10; +- return baud_value; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_SetBaudrate +-//* \brief Set the baudrate according to the CPU clock +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_SetBaudrate ( +- AT91PS_USART pUSART, // \arg pointer to a USART controller +- unsigned int mainClock, // \arg peripheral clock +- unsigned int speed) // \arg UART baudrate +-{ +- //* Define the baud rate divisor register +- pUSART->US_BRGR = AT91F_US_Baudrate(mainClock, speed); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_SetTimeguard +-//* \brief Set USART timeguard +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_SetTimeguard ( +- AT91PS_USART pUSART, // \arg pointer to a USART controller +- unsigned int timeguard) // \arg timeguard value +-{ +- //* Write the Timeguard Register +- pUSART->US_TTGR = timeguard ; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_EnableIt +-//* \brief Enable USART IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_EnableIt ( +- AT91PS_USART pUSART, // \arg pointer to a USART controller +- unsigned int flag) // \arg IT to be enabled +-{ +- //* Write to the IER register +- pUSART->US_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_DisableIt +-//* \brief Disable USART IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_DisableIt ( +- AT91PS_USART pUSART, // \arg pointer to a USART controller +- unsigned int flag) // \arg IT to be disabled +-{ +- //* Write to the IER register +- pUSART->US_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_Configure +-//* \brief Configure USART +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_Configure ( +- AT91PS_USART pUSART, // \arg pointer to a USART controller +- unsigned int mainClock, // \arg peripheral clock +- unsigned int mode , // \arg mode Register to be programmed +- unsigned int baudRate , // \arg baudrate to be programmed +- unsigned int timeguard ) // \arg timeguard to be programmed +-{ +- //* Disable interrupts +- pUSART->US_IDR = (unsigned int) -1; +- +- //* Reset receiver and transmitter +- pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS ; +- +- //* Define the baud rate divisor register +- AT91F_US_SetBaudrate(pUSART, mainClock, baudRate); +- +- //* Write the Timeguard Register +- AT91F_US_SetTimeguard(pUSART, timeguard); +- +- //* Clear Transmit and Receive Counters +- AT91F_PDC_Open((AT91PS_PDC) &(pUSART->US_RPR)); +- +- //* Define the USART mode +- pUSART->US_MR = mode ; +- +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_EnableRx +-//* \brief Enable receiving characters +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_EnableRx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Enable receiver +- pUSART->US_CR = AT91C_US_RXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_EnableTx +-//* \brief Enable sending characters +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_EnableTx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Enable transmitter +- pUSART->US_CR = AT91C_US_TXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_ResetRx +-//* \brief Reset Receiver and re-enable it +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_ResetRx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Reset receiver +- pUSART->US_CR = AT91C_US_RSTRX; +- //* Re-Enable receiver +- pUSART->US_CR = AT91C_US_RXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_ResetTx +-//* \brief Reset Transmitter and re-enable it +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_ResetTx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Reset transmitter +- pUSART->US_CR = AT91C_US_RSTTX; +- //* Enable transmitter +- pUSART->US_CR = AT91C_US_TXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_DisableRx +-//* \brief Disable Receiver +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_DisableRx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Disable receiver +- pUSART->US_CR = AT91C_US_RXDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_DisableTx +-//* \brief Disable Transmitter +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_DisableTx ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Disable transmitter +- pUSART->US_CR = AT91C_US_TXDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_Close +-//* \brief Close USART: disable IT disable receiver and transmitter, close PDC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_Close ( +- AT91PS_USART pUSART) // \arg pointer to a USART controller +-{ +- //* Reset the baud rate divisor register +- pUSART->US_BRGR = 0 ; +- +- //* Reset the USART mode +- pUSART->US_MR = 0 ; +- +- //* Reset the Timeguard Register +- pUSART->US_TTGR = 0; +- +- //* Disable all interrupts +- pUSART->US_IDR = 0xFFFFFFFF ; +- +- //* Abort the Peripheral Data Transfers +- AT91F_PDC_Close((AT91PS_PDC) &(pUSART->US_RPR)); +- +- //* Disable receiver and transmitter and stop any activity immediately +- pUSART->US_CR = AT91C_US_TXDIS | AT91C_US_RXDIS | AT91C_US_RSTTX | AT91C_US_RSTRX ; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_TxReady +-//* \brief Return 1 if a character can be written in US_THR +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_TxReady ( +- AT91PS_USART pUSART ) // \arg pointer to a USART controller +-{ +- return (pUSART->US_CSR & AT91C_US_TXRDY); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_RxReady +-//* \brief Return 1 if a character can be read in US_RHR +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_RxReady ( +- AT91PS_USART pUSART ) // \arg pointer to a USART controller +-{ +- return (pUSART->US_CSR & AT91C_US_RXRDY); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_Error +-//* \brief Return the error flag +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_Error ( +- AT91PS_USART pUSART ) // \arg pointer to a USART controller +-{ +- return (pUSART->US_CSR & +- (AT91C_US_OVRE | // Overrun error +- AT91C_US_FRAME | // Framing error +- AT91C_US_PARE)); // Parity error +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_PutChar +-//* \brief Send a character,does not check if ready to send +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_PutChar ( +- AT91PS_USART pUSART, +- int character ) +-{ +- pUSART->US_THR = (character & 0x1FF); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_GetChar +-//* \brief Receive a character,does not check if a character is available +-//*---------------------------------------------------------------------------- +-__inline int AT91F_US_GetChar ( +- const AT91PS_USART pUSART) +-{ +- return((pUSART->US_RHR) & 0x1FF); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_SendFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_SendFrame( +- AT91PS_USART pUSART, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_SendFrame( +- (AT91PS_PDC) &(pUSART->US_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_ReceiveFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initializaed with Next Buffer, 0 if PDC is busy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_US_ReceiveFrame ( +- AT91PS_USART pUSART, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_ReceiveFrame( +- (AT91PS_PDC) &(pUSART->US_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US_SetIrdaFilter +-//* \brief Set the value of IrDa filter tregister +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US_SetIrdaFilter ( +- AT91PS_USART pUSART, +- unsigned char value +-) +-{ +- pUSART->US_IF = value; +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR SSC +- ***************************************************************************** */ +-//* Define the standard I2S mode configuration +- +-//* Configuration to set in the SSC Transmit Clock Mode Register +-//* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +-//* nb_slot_by_frame : number of channels +-#define AT91C_I2S_ASY_MASTER_TX_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +- AT91C_SSC_CKS_DIV +\ +- AT91C_SSC_CKO_CONTINOUS +\ +- AT91C_SSC_CKG_NONE +\ +- AT91C_SSC_START_FALL_RF +\ +- AT91C_SSC_STTOUT +\ +- ((1<<16) & AT91C_SSC_STTDLY) +\ +- ((((nb_bit_by_slot*nb_slot_by_frame)/2)-1) <<24)) +- +- +-//* Configuration to set in the SSC Transmit Frame Mode Register +-//* Parameters : nb_bit_by_slot : 8, 16 or 32 bits +-//* nb_slot_by_frame : number of channels +-#define AT91C_I2S_ASY_TX_FRAME_SETTING(nb_bit_by_slot, nb_slot_by_frame)( +\ +- (nb_bit_by_slot-1) +\ +- AT91C_SSC_MSBF +\ +- (((nb_slot_by_frame-1)<<8) & AT91C_SSC_DATNB) +\ +- (((nb_bit_by_slot-1)<<16) & AT91C_SSC_FSLEN) +\ +- AT91C_SSC_FSOS_NEGATIVE) +- +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_SetBaudrate +-//* \brief Set the baudrate according to the CPU clock +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_SetBaudrate ( +- AT91PS_SSC pSSC, // \arg pointer to a SSC controller +- unsigned int mainClock, // \arg peripheral clock +- unsigned int speed) // \arg SSC baudrate +-{ +- unsigned int baud_value; +- //* Define the baud rate divisor register +- if (speed == 0) +- baud_value = 0; +- else +- { +- baud_value = (unsigned int) (mainClock * 10)/(2*speed); +- if ((baud_value % 10) >= 5) +- baud_value = (baud_value / 10) + 1; +- else +- baud_value /= 10; +- } +- +- pSSC->SSC_CMR = baud_value; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_Configure +-//* \brief Configure SSC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_Configure ( +- AT91PS_SSC pSSC, // \arg pointer to a SSC controller +- unsigned int syst_clock, // \arg System Clock Frequency +- unsigned int baud_rate, // \arg Expected Baud Rate Frequency +- unsigned int clock_rx, // \arg Receiver Clock Parameters +- unsigned int mode_rx, // \arg mode Register to be programmed +- unsigned int clock_tx, // \arg Transmitter Clock Parameters +- unsigned int mode_tx) // \arg mode Register to be programmed +-{ +- //* Disable interrupts +- pSSC->SSC_IDR = (unsigned int) -1; +- +- //* Reset receiver and transmitter +- pSSC->SSC_CR = AT91C_SSC_SWRST | AT91C_SSC_RXDIS | AT91C_SSC_TXDIS ; +- +- //* Define the Clock Mode Register +- AT91F_SSC_SetBaudrate(pSSC, syst_clock, baud_rate); +- +- //* Write the Receive Clock Mode Register +- pSSC->SSC_RCMR = clock_rx; +- +- //* Write the Transmit Clock Mode Register +- pSSC->SSC_TCMR = clock_tx; +- +- //* Write the Receive Frame Mode Register +- pSSC->SSC_RFMR = mode_rx; +- +- //* Write the Transmit Frame Mode Register +- pSSC->SSC_TFMR = mode_tx; +- +- //* Clear Transmit and Receive Counters +- AT91F_PDC_Open((AT91PS_PDC) &(pSSC->SSC_RPR)); +- +- +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_EnableRx +-//* \brief Enable receiving datas +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_EnableRx ( +- AT91PS_SSC pSSC) // \arg pointer to a SSC controller +-{ +- //* Enable receiver +- pSSC->SSC_CR = AT91C_SSC_RXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_DisableRx +-//* \brief Disable receiving datas +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_DisableRx ( +- AT91PS_SSC pSSC) // \arg pointer to a SSC controller +-{ +- //* Disable receiver +- pSSC->SSC_CR = AT91C_SSC_RXDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_EnableTx +-//* \brief Enable sending datas +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_EnableTx ( +- AT91PS_SSC pSSC) // \arg pointer to a SSC controller +-{ +- //* Enable transmitter +- pSSC->SSC_CR = AT91C_SSC_TXEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_DisableTx +-//* \brief Disable sending datas +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_DisableTx ( +- AT91PS_SSC pSSC) // \arg pointer to a SSC controller +-{ +- //* Disable transmitter +- pSSC->SSC_CR = AT91C_SSC_TXDIS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_EnableIt +-//* \brief Enable SSC IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_EnableIt ( +- AT91PS_SSC pSSC, // \arg pointer to a SSC controller +- unsigned int flag) // \arg IT to be enabled +-{ +- //* Write to the IER register +- pSSC->SSC_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_DisableIt +-//* \brief Disable SSC IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_DisableIt ( +- AT91PS_SSC pSSC, // \arg pointer to a SSC controller +- unsigned int flag) // \arg IT to be disabled +-{ +- //* Write to the IDR register +- pSSC->SSC_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_ReceiveFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initialized with Next Buffer, 0 if PDC is busy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SSC_ReceiveFrame ( +- AT91PS_SSC pSSC, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_ReceiveFrame( +- (AT91PS_PDC) &(pSSC->SSC_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_SendFrame +-//* \brief Return 2 if PDC has been initialized with Buffer and Next Buffer, 1 if PDC has been initialized with Next Buffer, 0 if PDC is busy +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SSC_SendFrame( +- AT91PS_SSC pSSC, +- char *pBuffer, +- unsigned int szBuffer, +- char *pNextBuffer, +- unsigned int szNextBuffer ) +-{ +- return AT91F_PDC_SendFrame( +- (AT91PS_PDC) &(pSSC->SSC_RPR), +- pBuffer, +- szBuffer, +- pNextBuffer, +- szNextBuffer); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_GetInterruptMaskStatus +-//* \brief Return SSC Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_SSC_GetInterruptMaskStatus( // \return SSC Interrupt Mask Status +- AT91PS_SSC pSsc) // \arg pointer to a SSC controller +-{ +- return pSsc->SSC_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_IsInterruptMasked +-//* \brief Test if SSC Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_SSC_IsInterruptMasked( +- AT91PS_SSC pSsc, // \arg pointer to a SSC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_SSC_GetInterruptMaskStatus(pSsc) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR TWI +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_EnableIt +-//* \brief Enable TWI IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TWI_EnableIt ( +- AT91PS_TWI pTWI, // \arg pointer to a TWI controller +- unsigned int flag) // \arg IT to be enabled +-{ +- //* Write to the IER register +- pTWI->TWI_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_DisableIt +-//* \brief Disable TWI IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TWI_DisableIt ( +- AT91PS_TWI pTWI, // \arg pointer to a TWI controller +- unsigned int flag) // \arg IT to be disabled +-{ +- //* Write to the IDR register +- pTWI->TWI_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_Configure +-//* \brief Configure TWI in master mode +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TWI_Configure ( AT91PS_TWI pTWI ) // \arg pointer to a TWI controller +-{ +- //* Disable interrupts +- pTWI->TWI_IDR = (unsigned int) -1; +- +- //* Reset peripheral +- pTWI->TWI_CR = AT91C_TWI_SWRST; +- +- //* Set Master mode +- pTWI->TWI_CR = AT91C_TWI_MSEN; +- +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_GetInterruptMaskStatus +-//* \brief Return TWI Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_TWI_GetInterruptMaskStatus( // \return TWI Interrupt Mask Status +- AT91PS_TWI pTwi) // \arg pointer to a TWI controller +-{ +- return pTwi->TWI_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_IsInterruptMasked +-//* \brief Test if TWI Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_TWI_IsInterruptMasked( +- AT91PS_TWI pTwi, // \arg pointer to a TWI controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_TWI_GetInterruptMaskStatus(pTwi) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR PWMC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_GetStatus +-//* \brief Return PWM Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PWMC_GetStatus( // \return PWM Interrupt Status +- AT91PS_PWMC pPWM) // pointer to a PWM controller +-{ +- return pPWM->PWMC_SR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_InterruptEnable +-//* \brief Enable PWM Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_InterruptEnable( +- AT91PS_PWMC pPwm, // \arg pointer to a PWM controller +- unsigned int flag) // \arg PWM interrupt to be enabled +-{ +- pPwm->PWMC_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_InterruptDisable +-//* \brief Disable PWM Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_InterruptDisable( +- AT91PS_PWMC pPwm, // \arg pointer to a PWM controller +- unsigned int flag) // \arg PWM interrupt to be disabled +-{ +- pPwm->PWMC_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_GetInterruptMaskStatus +-//* \brief Return PWM Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PWMC_GetInterruptMaskStatus( // \return PWM Interrupt Mask Status +- AT91PS_PWMC pPwm) // \arg pointer to a PWM controller +-{ +- return pPwm->PWMC_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_IsInterruptMasked +-//* \brief Test if PWM Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PWMC_IsInterruptMasked( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PWMC_GetInterruptMaskStatus(pPWM) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_IsStatusSet +-//* \brief Test if PWM Interrupt is Set +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_PWMC_IsStatusSet( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_PWMC_GetStatus(pPWM) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_CfgChannel +-//* \brief Test if PWM Interrupt is Set +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CfgChannel( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int channelId, // \arg PWM channel ID +- unsigned int mode, // \arg PWM mode +- unsigned int period, // \arg PWM period +- unsigned int duty) // \arg PWM duty cycle +-{ +- pPWM->PWMC_CH[channelId].PWMC_CMR = mode; +- pPWM->PWMC_CH[channelId].PWMC_CDTYR = duty; +- pPWM->PWMC_CH[channelId].PWMC_CPRDR = period; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_StartChannel +-//* \brief Enable channel +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_StartChannel( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int flag) // \arg Channels IDs to be enabled +-{ +- pPWM->PWMC_ENA = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_StopChannel +-//* \brief Disable channel +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_StopChannel( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int flag) // \arg Channels IDs to be enabled +-{ +- pPWM->PWMC_DIS = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWM_UpdateChannel +-//* \brief Update Period or Duty Cycle +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_UpdateChannel( +- AT91PS_PWMC pPWM, // \arg pointer to a PWM controller +- unsigned int channelId, // \arg PWM channel ID +- unsigned int update) // \arg Channels IDs to be enabled +-{ +- pPWM->PWMC_CH[channelId].PWMC_CUPDR = update; +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR UDP +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EnableIt +-//* \brief Enable UDP IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EnableIt ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned int flag) // \arg IT to be enabled +-{ +- //* Write to the IER register +- pUDP->UDP_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_DisableIt +-//* \brief Disable UDP IT +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_DisableIt ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned int flag) // \arg IT to be disabled +-{ +- //* Write to the IDR register +- pUDP->UDP_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_SetAddress +-//* \brief Set UDP functional address +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_SetAddress ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char address) // \arg new UDP address +-{ +- pUDP->UDP_FADDR = (AT91C_UDP_FEN | address); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EnableEp +-//* \brief Enable Endpoint +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EnableEp ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- pUDP->UDP_CSR[endpoint] |= AT91C_UDP_EPEDS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_DisableEp +-//* \brief Enable Endpoint +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_DisableEp ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- pUDP->UDP_CSR[endpoint] &= ~AT91C_UDP_EPEDS; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_SetState +-//* \brief Set UDP Device state +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_SetState ( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned int flag) // \arg new UDP address +-{ +- pUDP->UDP_GLBSTATE &= ~(AT91C_UDP_FADDEN | AT91C_UDP_CONFG); +- pUDP->UDP_GLBSTATE |= flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_GetState +-//* \brief return UDP Device state +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_UDP_GetState ( // \return the UDP device state +- AT91PS_UDP pUDP) // \arg pointer to a UDP controller +-{ +- return (pUDP->UDP_GLBSTATE & (AT91C_UDP_FADDEN | AT91C_UDP_CONFG)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_ResetEp +-//* \brief Reset UDP endpoint +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_ResetEp ( // \return the UDP device state +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned int flag) // \arg Endpoints to be reset +-{ +- pUDP->UDP_RSTEP = flag; +- pUDP->UDP_RSTEP = 0; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpStall +-//* \brief Endpoint will STALL requests +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EpStall( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- pUDP->UDP_CSR[endpoint] |= AT91C_UDP_FORCESTALL; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpWrite +-//* \brief Write value in the DPR +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EpWrite( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint, // \arg endpoint number +- unsigned char value) // \arg value to be written in the DPR +-{ +- pUDP->UDP_FDR[endpoint] = value; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpRead +-//* \brief Return value from the DPR +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_UDP_EpRead( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- return pUDP->UDP_FDR[endpoint]; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpEndOfWr +-//* \brief Notify the UDP that values in DPR are ready to be sent +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EpEndOfWr( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- pUDP->UDP_CSR[endpoint] |= AT91C_UDP_TXPKTRDY; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpClear +-//* \brief Clear flag in the endpoint CSR register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EpClear( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint, // \arg endpoint number +- unsigned int flag) // \arg flag to be cleared +-{ +- pUDP->UDP_CSR[endpoint] &= ~(flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpSet +-//* \brief Set flag in the endpoint CSR register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EpSet( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint, // \arg endpoint number +- unsigned int flag) // \arg flag to be cleared +-{ +- pUDP->UDP_CSR[endpoint] |= flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_EpStatus +-//* \brief Return the endpoint CSR register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_UDP_EpStatus( +- AT91PS_UDP pUDP, // \arg pointer to a UDP controller +- unsigned char endpoint) // \arg endpoint number +-{ +- return pUDP->UDP_CSR[endpoint]; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_GetInterruptMaskStatus +-//* \brief Return UDP Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_UDP_GetInterruptMaskStatus( +- AT91PS_UDP pUdp) // \arg pointer to a UDP controller +-{ +- return pUdp->UDP_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_IsInterruptMasked +-//* \brief Test if UDP Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_UDP_IsInterruptMasked( +- AT91PS_UDP pUdp, // \arg pointer to a UDP controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_UDP_GetInterruptMaskStatus(pUdp) & flag); +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_UDP_InterruptStatusRegister +-// \brief Return the Interrupt Status Register +-// ---------------------------------------------------------------------------- +-__inline unsigned int AT91F_UDP_InterruptStatusRegister( +- AT91PS_UDP pUDP ) // \arg pointer to a UDP controller +-{ +- return pUDP->UDP_ISR; +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_UDP_InterruptClearRegister +-// \brief Clear Interrupt Register +-// ---------------------------------------------------------------------------- +-__inline void AT91F_UDP_InterruptClearRegister ( +- AT91PS_UDP pUDP, // \arg pointer to UDP controller +- unsigned int flag) // \arg IT to be cleat +-{ +- pUDP->UDP_ICR = flag; +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_UDP_EnableTransceiver +-// \brief Enable transceiver +-// ---------------------------------------------------------------------------- +-__inline void AT91F_UDP_EnableTransceiver( +- AT91PS_UDP pUDP ) // \arg pointer to a UDP controller +-{ +- pUDP->UDP_TXVC &= ~AT91C_UDP_TXVDIS; +-} +- +-// ---------------------------------------------------------------------------- +-// \fn AT91F_UDP_DisableTransceiver +-// \brief Disable transceiver +-// ---------------------------------------------------------------------------- +-__inline void AT91F_UDP_DisableTransceiver( +- AT91PS_UDP pUDP ) // \arg pointer to a UDP controller +-{ +- pUDP->UDP_TXVC = AT91C_UDP_TXVDIS; +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR TC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC_InterruptEnable +-//* \brief Enable TC Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC_InterruptEnable( +- AT91PS_TC pTc, // \arg pointer to a TC controller +- unsigned int flag) // \arg TC interrupt to be enabled +-{ +- pTc->TC_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC_InterruptDisable +-//* \brief Disable TC Interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC_InterruptDisable( +- AT91PS_TC pTc, // \arg pointer to a TC controller +- unsigned int flag) // \arg TC interrupt to be disabled +-{ +- pTc->TC_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC_GetInterruptMaskStatus +-//* \brief Return TC Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_TC_GetInterruptMaskStatus( // \return TC Interrupt Mask Status +- AT91PS_TC pTc) // \arg pointer to a TC controller +-{ +- return pTc->TC_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC_IsInterruptMasked +-//* \brief Test if TC Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline int AT91F_TC_IsInterruptMasked( +- AT91PS_TC pTc, // \arg pointer to a TC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_TC_GetInterruptMaskStatus(pTc) & flag); +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR CAN +- ***************************************************************************** */ +-#define STANDARD_FORMAT 0 +-#define EXTENDED_FORMAT 1 +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_InitMailboxRegisters() +-//* \brief Configure the corresponding mailbox +-//*---------------------------------------------------------------------------- +-__inline void AT91F_InitMailboxRegisters(AT91PS_CAN_MB CAN_Mailbox, +- int mode_reg, +- int acceptance_mask_reg, +- int id_reg, +- int data_low_reg, +- int data_high_reg, +- int control_reg) +-{ +- CAN_Mailbox->CAN_MB_MCR = 0x0; +- CAN_Mailbox->CAN_MB_MMR = mode_reg; +- CAN_Mailbox->CAN_MB_MAM = acceptance_mask_reg; +- CAN_Mailbox->CAN_MB_MID = id_reg; +- CAN_Mailbox->CAN_MB_MDL = data_low_reg; +- CAN_Mailbox->CAN_MB_MDH = data_high_reg; +- CAN_Mailbox->CAN_MB_MCR = control_reg; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_EnableCAN() +-//* \brief +-//*---------------------------------------------------------------------------- +-__inline void AT91F_EnableCAN( +- AT91PS_CAN pCAN) // pointer to a CAN controller +-{ +- pCAN->CAN_MR |= AT91C_CAN_CANEN; +- +- // Wait for WAKEUP flag raising <=> 11-recessive-bit were scanned by the transceiver +- while( (pCAN->CAN_SR & AT91C_CAN_WAKEUP) != AT91C_CAN_WAKEUP ); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DisableCAN() +-//* \brief +-//*---------------------------------------------------------------------------- +-__inline void AT91F_DisableCAN( +- AT91PS_CAN pCAN) // pointer to a CAN controller +-{ +- pCAN->CAN_MR &= ~AT91C_CAN_CANEN; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_EnableIt +-//* \brief Enable CAN interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_EnableIt ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int flag) // IT to be enabled +-{ +- //* Write to the IER register +- pCAN->CAN_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_DisableIt +-//* \brief Disable CAN interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_DisableIt ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int flag) // IT to be disabled +-{ +- //* Write to the IDR register +- pCAN->CAN_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetStatus +-//* \brief Return CAN Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetStatus( // \return CAN Interrupt Status +- AT91PS_CAN pCAN) // pointer to a CAN controller +-{ +- return pCAN->CAN_SR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetInterruptMaskStatus +-//* \brief Return CAN Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetInterruptMaskStatus( // \return CAN Interrupt Mask Status +- AT91PS_CAN pCAN) // pointer to a CAN controller +-{ +- return pCAN->CAN_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_IsInterruptMasked +-//* \brief Test if CAN Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_IsInterruptMasked( +- AT91PS_CAN pCAN, // \arg pointer to a CAN controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_CAN_GetInterruptMaskStatus(pCAN) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_IsStatusSet +-//* \brief Test if CAN Interrupt is Set +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_IsStatusSet( +- AT91PS_CAN pCAN, // \arg pointer to a CAN controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_CAN_GetStatus(pCAN) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgModeReg +-//* \brief Configure the Mode Register of the CAN controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgModeReg ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int mode) // mode register +-{ +- //* Write to the MR register +- pCAN->CAN_MR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetModeReg +-//* \brief Return the Mode Register of the CAN controller value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetModeReg ( +- AT91PS_CAN pCAN // pointer to a CAN controller +- ) +-{ +- return pCAN->CAN_MR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgBaudrateReg +-//* \brief Configure the Baudrate of the CAN controller for the network +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgBaudrateReg ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int baudrate_cfg) +-{ +- //* Write to the BR register +- pCAN->CAN_BR = baudrate_cfg; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetBaudrate +-//* \brief Return the Baudrate of the CAN controller for the network value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetBaudrate ( +- AT91PS_CAN pCAN // pointer to a CAN controller +- ) +-{ +- return pCAN->CAN_BR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetInternalCounter +-//* \brief Return CAN Timer Regsiter Value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetInternalCounter ( +- AT91PS_CAN pCAN // pointer to a CAN controller +- ) +-{ +- return pCAN->CAN_TIM; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetTimestamp +-//* \brief Return CAN Timestamp Register Value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetTimestamp ( +- AT91PS_CAN pCAN // pointer to a CAN controller +- ) +-{ +- return pCAN->CAN_TIMESTP; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetErrorCounter +-//* \brief Return CAN Error Counter Register Value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetErrorCounter ( +- AT91PS_CAN pCAN // pointer to a CAN controller +- ) +-{ +- return pCAN->CAN_ECR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_InitTransferRequest +-//* \brief Request for a transfer on the corresponding mailboxes +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_InitTransferRequest ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int transfer_cmd) +-{ +- pCAN->CAN_TCR = transfer_cmd; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_InitAbortRequest +-//* \brief Abort the corresponding mailboxes +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_InitAbortRequest ( +- AT91PS_CAN pCAN, // pointer to a CAN controller +- unsigned int abort_cmd) +-{ +- pCAN->CAN_ACR = abort_cmd; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageModeReg +-//* \brief Program the Message Mode Register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageModeReg ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int mode) +-{ +- CAN_Mailbox->CAN_MB_MMR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageModeReg +-//* \brief Return the Message Mode Register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageModeReg ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageIDReg +-//* \brief Program the Message ID Register +-//* \brief Version == 0 for Standard messsage, Version == 1 for Extended +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageIDReg ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int id, +- unsigned char version) +-{ +- if(version==0) // IDvA Standard Format +- CAN_Mailbox->CAN_MB_MID = id<<18; +- else // IDvB Extended Format +- CAN_Mailbox->CAN_MB_MID = id | (1<<29); // set MIDE bit +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageIDReg +-//* \brief Return the Message ID Register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageIDReg ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MID; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageAcceptanceMaskReg +-//* \brief Program the Message Acceptance Mask Register +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageAcceptanceMaskReg ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int mask) +-{ +- CAN_Mailbox->CAN_MB_MAM = mask; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageAcceptanceMaskReg +-//* \brief Return the Message Acceptance Mask Register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageAcceptanceMaskReg ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MAM; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetFamilyID +-//* \brief Return the Message ID Register +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetFamilyID ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MFID; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageCtrl +-//* \brief Request and config for a transfer on the corresponding mailbox +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageCtrlReg ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int message_ctrl_cmd) +-{ +- CAN_Mailbox->CAN_MB_MCR = message_ctrl_cmd; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageStatus +-//* \brief Return CAN Mailbox Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageStatus ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageDataLow +-//* \brief Program data low value +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageDataLow ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int data) +-{ +- CAN_Mailbox->CAN_MB_MDL = data; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageDataLow +-//* \brief Return data low value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageDataLow ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MDL; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgMessageDataHigh +-//* \brief Program data high value +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgMessageDataHigh ( +- AT91PS_CAN_MB CAN_Mailbox, // pointer to a CAN Mailbox +- unsigned int data) +-{ +- CAN_Mailbox->CAN_MB_MDH = data; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_GetMessageDataHigh +-//* \brief Return data high value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_CAN_GetMessageDataHigh ( +- AT91PS_CAN_MB CAN_Mailbox) // pointer to a CAN Mailbox +-{ +- return CAN_Mailbox->CAN_MB_MDH; +-} +- +-/* ***************************************************************************** +- SOFTWARE API FOR ADC +- ***************************************************************************** */ +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_EnableIt +-//* \brief Enable ADC interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_EnableIt ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int flag) // IT to be enabled +-{ +- //* Write to the IER register +- pADC->ADC_IER = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_DisableIt +-//* \brief Disable ADC interrupt +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_DisableIt ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int flag) // IT to be disabled +-{ +- //* Write to the IDR register +- pADC->ADC_IDR = flag; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetStatus +-//* \brief Return ADC Interrupt Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetStatus( // \return ADC Interrupt Status +- AT91PS_ADC pADC) // pointer to a ADC controller +-{ +- return pADC->ADC_SR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetInterruptMaskStatus +-//* \brief Return ADC Interrupt Mask Status +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetInterruptMaskStatus( // \return ADC Interrupt Mask Status +- AT91PS_ADC pADC) // pointer to a ADC controller +-{ +- return pADC->ADC_IMR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_IsInterruptMasked +-//* \brief Test if ADC Interrupt is Masked +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_IsInterruptMasked( +- AT91PS_ADC pADC, // \arg pointer to a ADC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_ADC_GetInterruptMaskStatus(pADC) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_IsStatusSet +-//* \brief Test if ADC Status is Set +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_IsStatusSet( +- AT91PS_ADC pADC, // \arg pointer to a ADC controller +- unsigned int flag) // \arg flag to be tested +-{ +- return (AT91F_ADC_GetStatus(pADC) & flag); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_CfgModeReg +-//* \brief Configure the Mode Register of the ADC controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_CfgModeReg ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int mode) // mode register +-{ +- //* Write to the MR register +- pADC->ADC_MR = mode; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetModeReg +-//* \brief Return the Mode Register of the ADC controller value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetModeReg ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_MR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_CfgTimings +-//* \brief Configure the different necessary timings of the ADC controller +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_CfgTimings ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int mck_clock, // in MHz +- unsigned int adc_clock, // in MHz +- unsigned int startup_time, // in us +- unsigned int sample_and_hold_time) // in ns +-{ +- unsigned int prescal,startup,shtim; +- +- prescal = mck_clock/(2*adc_clock) - 1; +- startup = adc_clock*startup_time/8 - 1; +- shtim = adc_clock*sample_and_hold_time/1000 - 1; +- +- //* Write to the MR register +- pADC->ADC_MR = ( (prescal<<8) & AT91C_ADC_PRESCAL) | ( (startup<<16) & AT91C_ADC_STARTUP) | ( (shtim<<24) & AT91C_ADC_SHTIM); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_EnableChannel +-//* \brief Return ADC Timer Register Value +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_EnableChannel ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int channel) // mode register +-{ +- //* Write to the CHER register +- pADC->ADC_CHER = channel; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_DisableChannel +-//* \brief Return ADC Timer Register Value +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_DisableChannel ( +- AT91PS_ADC pADC, // pointer to a ADC controller +- unsigned int channel) // mode register +-{ +- //* Write to the CHDR register +- pADC->ADC_CHDR = channel; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetChannelStatus +-//* \brief Return ADC Timer Register Value +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetChannelStatus ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CHSR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_StartConversion +-//* \brief Software request for a analog to digital conversion +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_StartConversion ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- pADC->ADC_CR = AT91C_ADC_START; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_SoftReset +-//* \brief Software reset +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_SoftReset ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- pADC->ADC_CR = AT91C_ADC_SWRST; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetLastConvertedData +-//* \brief Return the Last Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetLastConvertedData ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_LCDR; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH0 +-//* \brief Return the Channel 0 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH0 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR0; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH1 +-//* \brief Return the Channel 1 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH1 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR1; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH2 +-//* \brief Return the Channel 2 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH2 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR2; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH3 +-//* \brief Return the Channel 3 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH3 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR3; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH4 +-//* \brief Return the Channel 4 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH4 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR4; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH5 +-//* \brief Return the Channel 5 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH5 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR5; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH6 +-//* \brief Return the Channel 6 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH6 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR6; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_GetConvertedDataCH7 +-//* \brief Return the Channel 7 Converted Data +-//*---------------------------------------------------------------------------- +-__inline unsigned int AT91F_ADC_GetConvertedDataCH7 ( +- AT91PS_ADC pADC // pointer to a ADC controller +- ) +-{ +- return pADC->ADC_CDR7; +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_MC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for MC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_MC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_CfgPMC +-//* \brief Enable Peripheral clock in PMC for DBGU +-//*---------------------------------------------------------------------------- +-__inline void AT91F_DBGU_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_DBGU_CfgPIO +-//* \brief Configure PIO controllers to drive DBGU signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_DBGU_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA28_DTXD ) | +- ((unsigned int) AT91C_PA27_DRXD ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWMC_CH3_CfgPIO +-//* \brief Configure PIO controllers to drive PWMC_CH3 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CH3_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB22_PWM3 ), // Peripheral A +- ((unsigned int) AT91C_PB30_PWM3 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWMC_CH2_CfgPIO +-//* \brief Configure PIO controllers to drive PWMC_CH2 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CH2_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB21_PWM2 ), // Peripheral A +- ((unsigned int) AT91C_PB29_PWM2 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWMC_CH1_CfgPIO +-//* \brief Configure PIO controllers to drive PWMC_CH1 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CH1_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB20_PWM1 ), // Peripheral A +- ((unsigned int) AT91C_PB28_PWM1 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWMC_CH0_CfgPIO +-//* \brief Configure PIO controllers to drive PWMC_CH0 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CH0_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB19_PWM0 ), // Peripheral A +- ((unsigned int) AT91C_PB27_PWM0 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_EMAC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for EMAC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_EMAC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_EMAC)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_EMAC_CfgPIO +-//* \brief Configure PIO controllers to drive EMAC signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_EMAC_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB9_EMDIO ) | +- ((unsigned int) AT91C_PB17_ERXCK ) | +- ((unsigned int) AT91C_PB15_ERXDV_ECRSDV) | +- ((unsigned int) AT91C_PB8_EMDC ) | +- ((unsigned int) AT91C_PB16_ECOL ) | +- ((unsigned int) AT91C_PB7_ERXER ) | +- ((unsigned int) AT91C_PB5_ERX0 ) | +- ((unsigned int) AT91C_PB6_ERX1 ) | +- ((unsigned int) AT91C_PB13_ERX2 ) | +- ((unsigned int) AT91C_PB1_ETXEN ) | +- ((unsigned int) AT91C_PB14_ERX3 ) | +- ((unsigned int) AT91C_PB12_ETXER ) | +- ((unsigned int) AT91C_PB2_ETX0 ) | +- ((unsigned int) AT91C_PB3_ETX1 ) | +- ((unsigned int) AT91C_PB10_ETX2 ) | +- ((unsigned int) AT91C_PB18_EF100 ) | +- ((unsigned int) AT91C_PB11_ETX3 ) | +- ((unsigned int) AT91C_PB4_ECRS ) | +- ((unsigned int) AT91C_PB0_ETXCK_EREFCK), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_VREG_CfgPMC +-//* \brief Enable Peripheral clock in PMC for VREG +-//*---------------------------------------------------------------------------- +-__inline void AT91F_VREG_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for SSC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SSC)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SSC_CfgPIO +-//* \brief Configure PIO controllers to drive SSC signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SSC_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA23_TD ) | +- ((unsigned int) AT91C_PA21_TF ) | +- ((unsigned int) AT91C_PA25_RK ) | +- ((unsigned int) AT91C_PA24_RD ) | +- ((unsigned int) AT91C_PA26_RF ) | +- ((unsigned int) AT91C_PA22_TK ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI1_CfgPMC +-//* \brief Enable Peripheral clock in PMC for SPI1 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI1_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SPI1)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI1_CfgPIO +-//* \brief Configure PIO controllers to drive SPI1 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI1_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PA23_SPI1_MOSI) | +- ((unsigned int) AT91C_PA21_SPI1_NPCS0) | +- ((unsigned int) AT91C_PA25_SPI1_NPCS1) | +- ((unsigned int) AT91C_PA2_SPI1_NPCS1) | +- ((unsigned int) AT91C_PA24_SPI1_MISO) | +- ((unsigned int) AT91C_PA22_SPI1_SPCK) | +- ((unsigned int) AT91C_PA26_SPI1_NPCS2) | +- ((unsigned int) AT91C_PA3_SPI1_NPCS2) | +- ((unsigned int) AT91C_PA29_SPI1_NPCS3) | +- ((unsigned int) AT91C_PA4_SPI1_NPCS3)); // Peripheral B +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PB10_SPI1_NPCS1) | +- ((unsigned int) AT91C_PB11_SPI1_NPCS2) | +- ((unsigned int) AT91C_PB16_SPI1_NPCS3)); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI0_CfgPMC +-//* \brief Enable Peripheral clock in PMC for SPI0 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI0_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SPI0)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_SPI0_CfgPIO +-//* \brief Configure PIO controllers to drive SPI0 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_SPI0_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA17_SPI0_MOSI) | +- ((unsigned int) AT91C_PA12_SPI0_NPCS0) | +- ((unsigned int) AT91C_PA13_SPI0_NPCS1) | +- ((unsigned int) AT91C_PA16_SPI0_MISO) | +- ((unsigned int) AT91C_PA14_SPI0_NPCS2) | +- ((unsigned int) AT91C_PA18_SPI0_SPCK) | +- ((unsigned int) AT91C_PA15_SPI0_NPCS3), // Peripheral A +- ((unsigned int) AT91C_PA7_SPI0_NPCS1) | +- ((unsigned int) AT91C_PA8_SPI0_NPCS2) | +- ((unsigned int) AT91C_PA9_SPI0_NPCS3)); // Peripheral B +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PB13_SPI0_NPCS1) | +- ((unsigned int) AT91C_PB14_SPI0_NPCS2) | +- ((unsigned int) AT91C_PB17_SPI0_NPCS3)); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PWMC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for PWMC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PWMC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_PWMC)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC0_CfgPMC +-//* \brief Enable Peripheral clock in PMC for TC0 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC0_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_TC0)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC0_CfgPIO +-//* \brief Configure PIO controllers to drive TC0 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC0_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB23_TIOA0 ) | +- ((unsigned int) AT91C_PB24_TIOB0 ), // Peripheral A +- ((unsigned int) AT91C_PB12_TCLK0 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC1_CfgPMC +-//* \brief Enable Peripheral clock in PMC for TC1 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC1_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_TC1)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC1_CfgPIO +-//* \brief Configure PIO controllers to drive TC1 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC1_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB25_TIOA1 ) | +- ((unsigned int) AT91C_PB26_TIOB1 ), // Peripheral A +- ((unsigned int) AT91C_PB19_TCLK1 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC2_CfgPMC +-//* \brief Enable Peripheral clock in PMC for TC2 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC2_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_TC2)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TC2_CfgPIO +-//* \brief Configure PIO controllers to drive TC2 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TC2_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PA15_TCLK2 )); // Peripheral B +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB27_TIOA2 ) | +- ((unsigned int) AT91C_PB28_TIOB2 ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PITC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for PITC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PITC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for ADC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_ADC)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_ADC_CfgPIO +-//* \brief Configure PIO controllers to drive ADC signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_ADC_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PB18_ADTRG )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for PMC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PMC_CfgPIO +-//* \brief Configure PIO controllers to drive PMC signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PMC_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PA13_PCK1 ) | +- ((unsigned int) AT91C_PA30_PCK2 ) | +- ((unsigned int) AT91C_PA27_PCK3 )); // Peripheral B +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- ((unsigned int) AT91C_PB29_PCK1 ) | +- ((unsigned int) AT91C_PB30_PCK2 ), // Peripheral A +- ((unsigned int) AT91C_PB21_PCK1 ) | +- ((unsigned int) AT91C_PB22_PCK2 ) | +- ((unsigned int) AT91C_PB20_PCK0 ) | +- ((unsigned int) AT91C_PB0_PCK0 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RSTC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for RSTC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_RSTC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_RTTC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for RTTC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_RTTC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIOA_CfgPMC +-//* \brief Enable Peripheral clock in PMC for PIOA +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIOA_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_PIOA)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_PIOB_CfgPMC +-//* \brief Enable Peripheral clock in PMC for PIOB +-//*---------------------------------------------------------------------------- +-__inline void AT91F_PIOB_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_PIOB)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_CfgPMC +-//* \brief Enable Peripheral clock in PMC for TWI +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TWI_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_TWI)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_TWI_CfgPIO +-//* \brief Configure PIO controllers to drive TWI signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_TWI_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA10_TWD ) | +- ((unsigned int) AT91C_PA11_TWCK ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_WDTC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for WDTC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_WDTC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_SYS)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US1_CfgPMC +-//* \brief Enable Peripheral clock in PMC for US1 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US1_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_US1)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US1_CfgPIO +-//* \brief Configure PIO controllers to drive US1 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US1_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA5_RXD1 ) | +- ((unsigned int) AT91C_PA6_TXD1 ) | +- ((unsigned int) AT91C_PA8_RTS1 ) | +- ((unsigned int) AT91C_PA7_SCK1 ) | +- ((unsigned int) AT91C_PA9_CTS1 ), // Peripheral A +- 0); // Peripheral B +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOB, // PIO controller base address +- 0, // Peripheral A +- ((unsigned int) AT91C_PB25_DTR1 ) | +- ((unsigned int) AT91C_PB23_DCD1 ) | +- ((unsigned int) AT91C_PB24_DSR1 ) | +- ((unsigned int) AT91C_PB26_RI1 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US0_CfgPMC +-//* \brief Enable Peripheral clock in PMC for US0 +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US0_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_US0)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_US0_CfgPIO +-//* \brief Configure PIO controllers to drive US0 signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_US0_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA0_RXD0 ) | +- ((unsigned int) AT91C_PA1_TXD0 ) | +- ((unsigned int) AT91C_PA3_RTS0 ) | +- ((unsigned int) AT91C_PA2_SCK0 ) | +- ((unsigned int) AT91C_PA4_CTS0 ), // Peripheral A +- 0); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_UDP_CfgPMC +-//* \brief Enable Peripheral clock in PMC for UDP +-//*---------------------------------------------------------------------------- +-__inline void AT91F_UDP_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_UDP)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_CfgPMC +-//* \brief Enable Peripheral clock in PMC for AIC +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_IRQ0) | +- ((unsigned int) 1 << AT91C_ID_FIQ) | +- ((unsigned int) 1 << AT91C_ID_IRQ1)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_AIC_CfgPIO +-//* \brief Configure PIO controllers to drive AIC signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_AIC_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA30_IRQ0 ) | +- ((unsigned int) AT91C_PA29_FIQ ), // Peripheral A +- ((unsigned int) AT91C_PA14_IRQ1 )); // Peripheral B +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgPMC +-//* \brief Enable Peripheral clock in PMC for CAN +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgPMC (void) +-{ +- AT91F_PMC_EnablePeriphClock( +- AT91C_BASE_PMC, // PIO controller base address +- ((unsigned int) 1 << AT91C_ID_CAN)); +-} +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_CAN_CfgPIO +-//* \brief Configure PIO controllers to drive CAN signals +-//*---------------------------------------------------------------------------- +-__inline void AT91F_CAN_CfgPIO (void) +-{ +- // Configure PIO controllers to periph mode +- AT91F_PIO_CfgPeriph( +- AT91C_BASE_PIOA, // PIO controller base address +- ((unsigned int) AT91C_PA20_CANTX ) | +- ((unsigned int) AT91C_PA19_CANRX ), // Peripheral A +- 0); // Peripheral B +-} +- +-#endif // lib_AT91SAM7X256_H +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/project.h b/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/project.h +deleted file mode 100644 +index 24fb698d3a..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/incIAR/project.h ++++ /dev/null +@@ -1,30 +0,0 @@ +-//----------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-//----------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : project.h +-// Object : project specific include file to AT91SAM7X256 +-// Creation : JPP 14-Sep-2006 +-//----------------------------------------------------------------------------- +-#ifndef _PROJECT_H +-#define _PROJECT_H +- +-/// Include your AT91 Library files and specific compiler definitions +- +-#include +-#include "AT91SAM7X-EK.h" +-#include "AT91SAM7X256.h" +-#define __inline inline +-#include "lib_AT91SAM7X256.h" +- +-#endif // _PROJECT_H +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat b/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat +deleted file mode 100644 +index aa07e50c6b..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat ++++ /dev/null +@@ -1,33 +0,0 @@ +-@REM This bat file has been generated by the IAR Embeddded Workbench +-@REM C-SPY interactive debugger,as an aid to preparing a command +-@REM line for running the cspybat command line utility with the +-@REM appropriate settings. +-@REM +-@REM After making some adjustments to this file, you can launch cspybat +-@REM by typing the name of this file followed by the name of the debug +-@REM file (usually an ubrof file). Note that this file is generated +-@REM every time a new debug session is initialized, so you may want to +-@REM move or rename the file before making changes. +-@REM +-@REM Note: some command line arguments cannot be properly generated +-@REM by this process. Specifically, the plugin which is responsible +-@REM for the Terminal I/O window (and other C runtime functionality) +-@REM comes in a special version for cspybat, and the name of that +-@REM plugin dll is not known when generating this file. It resides in +-@REM the $TOOLKIT_DIR$\bin folder and is usually called XXXbat.dll or +-@REM XXXlibsupportbat.dll, where XXX is the name of the corresponding +-@REM tool chain. Replace the '' parameter +-@REM below with the appropriate file name. Other plugins loaded by +-@REM C-SPY are usually not needed by, or will not work in, cspybat +-@REM but they are listed at the end of this file for reference. +- +- +-"C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armproc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armjlink.dll" %1 --plugin "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\" --macro "C:\Documents and Settings\Greg\Desktop\SAM7X256\AT91SAM7X-Interrupt_SAM7X\Compil\resource\SAM7_FLASH.mac" --backend -B "--endian=little" "--cpu=ARM7TDMI" "--fpu=None" "-p" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\CONFIG\debugger\Atmel\ioAT91SAM7X256.ddf" "--drv_verify_download" "--semihosting" "--device=AT91SAM7X256" "-d" "jlink" "--drv_communication=USB0" "--jlink_speed=adaptive" +- +- +-@REM Loaded plugins: +-@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armlibsupport.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\CodeCoverage\CodeCoverage.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\Profiling\Profiling.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\stack\stack.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\SymList\SymList.dll +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt b/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt +deleted file mode 100644 +index 33f4649c2f..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt ++++ /dev/null +@@ -1,5 +0,0 @@ +- +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dni b/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dni +deleted file mode 100644 +index bc8e3f96d6..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.dni ++++ /dev/null +@@ -1,18 +0,0 @@ +-[JLinkDriver] +-WatchCond=_ 0 +-Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 +-Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 +-[TermIOLog] +-LoggingEnabled=_ 0 +-LogFile=_ "" +-[Log file] +-LoggingEnabled=_ 0 +-LogFile=_ "" +-Category=_ 0 +-[Disassemble mode] +-mode=0 +-[Breakpoints] +-Count=0 +-[TraceHelper] +-Enabled=0 +-ShowSource=1 +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.wsdt b/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.wsdt +deleted file mode 100644 +index 39488f056b..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.wsdt ++++ /dev/null +@@ -1,74 +0,0 @@ +- +- +- +- +- +- BasicInterrupt_SAM7X/FLASH_Debug +- +- +- +- +- +- +- +- +- 271272727 +- +- +- 20 +- 995 +- 265 +- 66 +- +- +- +- +- +- +- +- +- +- +- TabID-26686-579 +- Workspace +- Workspace +- +- +- BasicInterrupt_SAM7X +- +- +- +- 0 +- +- +- TabID-13847-615 +- Build +- Build +- +- +- +- TabID-20936-687 +- Debug Log +- Debug-Log +- +- +- +- +- 1 +- +- +- +- +- +- 0100000010000001 +- +- +- +- +- +- +- iaridepm.enu1-2-2612345-2-2200200144300234192250361718970-2-21981388-2-213902001002886234192144300234192 +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink b/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink +deleted file mode 100644 +index ecbb0a8118..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink ++++ /dev/null +@@ -1,12 +0,0 @@ +-[FLASH] +-SkipProgOnCRCMatch = 1 +-VerifyDownload = 1 +-AllowCaching = 1 +-EnableFlashDL = 2 +-Override = 0 +-Device="ADUC7020X62" +-[BREAKPOINTS] +-ShowInfoWin = 1 +-EnableFlashBP = 2 +-[CPU] +-AllowSimulation = 1 +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.cspy.bat b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.cspy.bat +deleted file mode 100644 +index 0e4d177564..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.cspy.bat ++++ /dev/null +@@ -1,33 +0,0 @@ +-@REM This bat file has been generated by the IAR Embeddded Workbench +-@REM C-SPY interactive debugger,as an aid to preparing a command +-@REM line for running the cspybat command line utility with the +-@REM appropriate settings. +-@REM +-@REM After making some adjustments to this file, you can launch cspybat +-@REM by typing the name of this file followed by the name of the debug +-@REM file (usually an ubrof file). Note that this file is generated +-@REM every time a new debug session is initialized, so you may want to +-@REM move or rename the file before making changes. +-@REM +-@REM Note: some command line arguments cannot be properly generated +-@REM by this process. Specifically, the plugin which is responsible +-@REM for the Terminal I/O window (and other C runtime functionality) +-@REM comes in a special version for cspybat, and the name of that +-@REM plugin dll is not known when generating this file. It resides in +-@REM the $TOOLKIT_DIR$\bin folder and is usually called XXXbat.dll or +-@REM XXXlibsupportbat.dll, where XXX is the name of the corresponding +-@REM tool chain. Replace the '' parameter +-@REM below with the appropriate file name. Other plugins loaded by +-@REM C-SPY are usually not needed by, or will not work in, cspybat +-@REM but they are listed at the end of this file for reference. +- +- +-"C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armproc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armjlink.dll" %1 --plugin "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\" --macro "C:\svn\cmock\iar\iar_v5\Resource\SAM7_RAM.mac" --backend -B "--endian=little" "--cpu=ARM7TDMI" "--fpu=None" "-p" "C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\CONFIG\debugger\Atmel\ioAT91SAM7X256.ddf" "--drv_verify_download" "--semihosting" "--device=AT91SAM7X256" "-d" "jlink" "--drv_communication=USB0" "--jlink_speed=adaptive" +- +- +-@REM Loaded plugins: +-@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\ARM\bin\armlibsupport.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\CodeCoverage\CodeCoverage.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\Profiling\Profiling.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\stack\stack.dll +-@REM C:\Program Files\IAR Systems\Embedded Workbench 5.0 Kickstart\common\plugins\SymList\SymList.dll +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dbgdt b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dbgdt +deleted file mode 100644 +index 75a616f196..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dbgdt ++++ /dev/null +@@ -1,85 +0,0 @@ +- +- +- +- +- +- +- +- 20 +- 995 +- 265 +- 66 +- +- +- +- +- +- +- +- 124272727 +- +- +- +- +- 10 +- +- +- +- +- +- +- +- +- TabID-27249-27051 +- Debug Log +- Debug-Log +- +- +- +- TabID-4707-27064 +- Build +- Build +- +- +- +- +- 0 +- +- +- TabID-5230-27054 +- Workspace +- Workspace +- +- +- cmock_demo +- +- +- +- 0 +- +- +- TabID-15978-27058 +- Disassembly +- Disassembly +- +- +- +- +- 0 +- +- +- +- +- +- TextEditorC:\svn\cmock\examples\src\Main.c0258358350TextEditorC:\svn\cmock\examples\src\TaskScheduler.c0439819810100000010000001 +- +- +- +- +- +- +- iaridepm.enu1debuggergui.enu1-2-2588198-2-2200200144300234192144300690867-2-2588198-2-2200200144300234192144300690867-2-21981388-2-213902001002886234192144300234192 +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dni b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dni +deleted file mode 100644 +index 4ec3ceeabe..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.dni ++++ /dev/null +@@ -1,44 +0,0 @@ +-[JLinkDriver] +-WatchCond=_ 0 +-Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 +-Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 +-[DisAssemblyWindow] +-NumStates=_ 1 +-State 1=_ 1 +-[CodeCoverage] +-Enabled=_ 0 +-[Profiling] +-Enabled=0 +-[StackPlugin] +-Enabled=1 +-OverflowWarningsEnabled=1 +-WarningThreshold=90 +-SpWarningsEnabled=1 +-WarnHow=0 +-UseTrigger=1 +-TriggerName=main +-LimitSize=0 +-ByteLimit=50 +-[Interrupts] +-Enabled=1 +-[MemoryMap] +-Enabled=0 +-Base=0 +-UseAuto=0 +-TypeViolation=1 +-UnspecRange=1 +-ActionState=1 +-[Log file] +-LoggingEnabled=_ 0 +-LogFile=_ "" +-Category=_ 0 +-[TermIOLog] +-LoggingEnabled=_ 0 +-LogFile=_ "" +-[Disassemble mode] +-mode=0 +-[Breakpoints] +-Count=0 +-[TraceHelper] +-Enabled=0 +-ShowSource=1 +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.wsdt b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.wsdt +deleted file mode 100644 +index 3bfdc76bf9..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo.wsdt ++++ /dev/null +@@ -1,73 +0,0 @@ +- +- +- +- +- +- cmock_demo/RAM_Debug +- +- +- +- +- +- +- +- 2099526566 +- +- +- +- +- +- +- 216272727 +- +- +- +- +- +- +- +- +- +- TabID-7530-24964 +- Build +- Build +- +- +- +- TabID-25388-26881 +- Debug Log +- Debug-Log +- +- +- +- +- 0 +- +- +- TabID-18278-24968 +- Workspace +- Workspace +- +- +- cmock_democmock_demo/Sourcecmock_demo/srccmock_demo/srcIAR +- +- +- +- 0 +- +- +- +- +- +- TextEditorC:\svn\cmock\examples\src\Main.c02582082000100000010000001 +- +- +- +- +- +- +- iaridepm.enu1-2-2513307-2-2200200144300234192222944603044-2-22971388-2-213902991002886350117144300234192 +- +- +- +- +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_Binary.jlink b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_Binary.jlink +deleted file mode 100644 +index ecbb0a8118..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_Binary.jlink ++++ /dev/null +@@ -1,12 +0,0 @@ +-[FLASH] +-SkipProgOnCRCMatch = 1 +-VerifyDownload = 1 +-AllowCaching = 1 +-EnableFlashDL = 2 +-Override = 0 +-Device="ADUC7020X62" +-[BREAKPOINTS] +-ShowInfoWin = 1 +-EnableFlashBP = 2 +-[CPU] +-AllowSimulation = 1 +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_FLASH_Debug.jlink b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_FLASH_Debug.jlink +deleted file mode 100644 +index ecbb0a8118..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_FLASH_Debug.jlink ++++ /dev/null +@@ -1,12 +0,0 @@ +-[FLASH] +-SkipProgOnCRCMatch = 1 +-VerifyDownload = 1 +-AllowCaching = 1 +-EnableFlashDL = 2 +-Override = 0 +-Device="ADUC7020X62" +-[BREAKPOINTS] +-ShowInfoWin = 1 +-EnableFlashBP = 2 +-[CPU] +-AllowSimulation = 1 +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_RAM_Debug.jlink b/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_RAM_Debug.jlink +deleted file mode 100644 +index ecbb0a8118..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/settings/cmock_demo_RAM_Debug.jlink ++++ /dev/null +@@ -1,12 +0,0 @@ +-[FLASH] +-SkipProgOnCRCMatch = 1 +-VerifyDownload = 1 +-AllowCaching = 1 +-EnableFlashDL = 2 +-Override = 0 +-Device="ADUC7020X62" +-[BREAKPOINTS] +-ShowInfoWin = 1 +-EnableFlashBP = 2 +-[CPU] +-AllowSimulation = 1 +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup.s b/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup.s +deleted file mode 100644 +index 7113c8035d..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup.s ++++ /dev/null +@@ -1,299 +0,0 @@ +-;* ---------------------------------------------------------------------------- +-;* ATMEL Microcontroller Software Support - ROUSSET - +-;* ---------------------------------------------------------------------------- +-;* Copyright (c) 2006, Atmel Corporation +-; +-;* 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 disclaimer below. +-;* +-;* - Redistributions in binary form must reproduce the above copyright notice, +-;* this list of conditions and the disclaimer below in the documentation and/or +-;* other materials provided with the distribution. +-;* +-;* Atmel's name may not be used to endorse or promote products derived from +-;* this software without specific prior written permission. +-;* +-;* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-;* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-;* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 your AT91 Library files +-;------------------------------------------------------------------------------ +-#include "AT91SAM7X256_inc.h" +-;------------------------------------------------------------------------------ +- +-#define TOP_OF_MEMORY (AT91C_ISRAM + AT91C_ISRAM_SIZE) +-#define IRQ_STACK_SIZE (3*8*4) +- ; 3 words to be saved per interrupt priority level +- +-; Mode, correspords to bits 0-5 in CPSR +-MODE_BITS DEFINE 0x1F ; Bit mask for mode bits in CPSR +-USR_MODE DEFINE 0x10 ; User mode +-FIQ_MODE DEFINE 0x11 ; Fast Interrupt Request mode +-IRQ_MODE DEFINE 0x12 ; Interrupt Request mode +-SVC_MODE DEFINE 0x13 ; Supervisor mode +-ABT_MODE DEFINE 0x17 ; Abort mode +-UND_MODE DEFINE 0x1B ; Undefined Instruction mode +-SYS_MODE DEFINE 0x1F ; System mode +- +-I_BIT DEFINE 0x80 +-F_BIT DEFINE 0x40 +- +-;------------------------------------------------------------------------------ +-; ?RESET +-; Reset Vector. +-; Normally, segment INTVEC is linked at address 0. +-; For debugging purposes, INTVEC may be placed at other addresses. +-; A debugger that honors the entry point will start the +-; program in a normal way even if INTVEC is not at address 0. +-;------------------------------------------------------------------------------ +- SECTION .intvec:CODE:NOROOT(2) +- PUBLIC __vector +- PUBLIC __iar_program_start +- +- ARM +-__vector: +- ldr pc,[pc,#+24] ;; Reset +-__und_handler: +- ldr pc,[pc,#+24] ;; Undefined instructions +-__swi_handler: +- ldr pc,[pc,#+24] ;; Software interrupt (SWI/SVC) +-__prefetch_handler: +- ldr pc,[pc,#+24] ;; Prefetch abort +-__data_handler: +- ldr pc,[pc,#+24] ;; Data abort +- DC32 0xFFFFFFFF ;; RESERVED +-__irq_handler: +- ldr pc,[pc,#+24] ;; IRQ +-__fiq_handler: +- ldr pc,[pc,#+24] ;; FIQ +- +- DC32 __iar_program_start +- DC32 __und_handler +- DC32 __swi_handler +- DC32 __prefetch_handler +- DC32 __data_handler +- B . +- DC32 IRQ_Handler_Entry +- DC32 FIQ_Handler_Entry +- +-;------------------------------------------------------------------------------ +-;- Manage exception: The exception must be ensure in ARM mode +-;------------------------------------------------------------------------------ +- SECTION text:CODE:NOROOT(2) +- ARM +-;------------------------------------------------------------------------------ +-;- Function : FIQ_Handler_Entry +-;- Treatments : FIQ Controller Interrupt Handler. +-;- R8 is initialize in Cstartup +-;- Called Functions : None only by FIQ +-;------------------------------------------------------------------------------ +-FIQ_Handler_Entry: +- +-;- Switch in SVC/User Mode to allow User Stack access for C code +-; because the FIQ is not yet acknowledged +- +-;- Save and r0 in FIQ_Register +- mov r9,r0 +- ldr r0 , [r8, #AIC_FVR] +- msr CPSR_c,#I_BIT | F_BIT | SVC_MODE +-;- Save scratch/used registers and LR in User Stack +- stmfd sp!, { r1-r3, r12, lr} +- +-;- Branch to the routine pointed by the AIC_FVR +- mov r14, pc +- bx r0 +- +-;- Restore scratch/used registers and LR from User Stack +- ldmia sp!, { r1-r3, r12, lr} +- +-;- Leave Interrupts disabled and switch back in FIQ mode +- msr CPSR_c, #I_BIT | F_BIT | FIQ_MODE +- +-;- Restore the R0 ARM_MODE_SVC register +- mov r0,r9 +- +-;- Restore the Program Counter using the LR_fiq directly in the PC +- subs pc,lr,#4 +-;------------------------------------------------------------------------------ +-;- Function : IRQ_Handler_Entry +-;- Treatments : IRQ Controller Interrupt Handler. +-;- Called Functions : AIC_IVR[interrupt] +-;------------------------------------------------------------------------------ +-IRQ_Handler_Entry: +-;------------------------- +-;- Manage Exception Entry +-;------------------------- +-;- Adjust and save LR_irq in IRQ stack +- sub lr, lr, #4 +- stmfd sp!, {lr} +- +-;- Save r0 and SPSR (need to be saved for nested interrupt) +- mrs r14, SPSR +- stmfd sp!, {r0,r14} +- +-;- Write in the IVR to support Protect Mode +-;- No effect in Normal Mode +-;- De-assert the NIRQ and clear the source in Protect Mode +- ldr r14, =AT91C_BASE_AIC +- ldr r0 , [r14, #AIC_IVR] +- str r14, [r14, #AIC_IVR] +- +-;- Enable Interrupt and Switch in Supervisor Mode +- msr CPSR_c, #SVC_MODE +- +-;- Save scratch/used registers and LR in User Stack +- stmfd sp!, { r1-r3, r12, r14} +- +-;---------------------------------------------- +-;- Branch to the routine pointed by the AIC_IVR +-;---------------------------------------------- +- mov r14, pc +- bx r0 +- +-;---------------------------------------------- +-;- Manage Exception Exit +-;---------------------------------------------- +-;- Restore scratch/used registers and LR from User Stack +- ldmia sp!, { r1-r3, r12, r14} +- +-;- Disable Interrupt and switch back in IRQ mode +- msr CPSR_c, #I_BIT | IRQ_MODE +- +-;- Mark the End of Interrupt on the AIC +- ldr r14, =AT91C_BASE_AIC +- str r14, [r14, #AIC_EOICR] +- +-;- Restore SPSR_irq and r0 from IRQ stack +- ldmia sp!, {r0,r14} +- msr SPSR_cxsf, r14 +- +-;- Restore adjusted LR_irq from IRQ stack directly in the PC +- ldmia sp!, {pc}^ +- +-;------------------------------------------------------------------------------ +-;- Exception Vectors +-;------------------------------------------------------------------------------ +- PUBLIC AT91F_Default_FIQ_handler +- PUBLIC AT91F_Default_IRQ_handler +- PUBLIC AT91F_Spurious_handler +- +- ARM ; Always ARM mode after exeption +- +-AT91F_Default_FIQ_handler +- b AT91F_Default_FIQ_handler +- +-AT91F_Default_IRQ_handler +- b AT91F_Default_IRQ_handler +- +-AT91F_Spurious_handler +- b AT91F_Spurious_handler +- +- +-;------------------------------------------------------------------------------ +-; ?INIT +-; Program entry. +-;------------------------------------------------------------------------------ +- +- SECTION FIQ_STACK:DATA:NOROOT(3) +- SECTION IRQ_STACK:DATA:NOROOT(3) +- SECTION SVC_STACK:DATA:NOROOT(3) +- SECTION ABT_STACK:DATA:NOROOT(3) +- SECTION UND_STACK:DATA:NOROOT(3) +- SECTION CSTACK:DATA:NOROOT(3) +- SECTION text:CODE:NOROOT(2) +- REQUIRE __vector +- EXTERN ?main +- PUBLIC __iar_program_start +- EXTERN AT91F_LowLevelInit +- +- +-__iar_program_start: +- +-;------------------------------------------------------------------------------ +-;- Low level Init is performed in a C function: AT91F_LowLevelInit +-;- Init Stack Pointer to a valid memory area before calling AT91F_LowLevelInit +-;------------------------------------------------------------------------------ +- +-;- Retrieve end of RAM address +- +- ldr r13,=TOP_OF_MEMORY ;- Temporary stack in internal RAM for Low Level Init execution +- ldr r0,=AT91F_LowLevelInit +- mov lr, pc +- bx r0 ;- Branch on C function (with interworking) +- +-; Initialize the stack pointers. +-; The pattern below can be used for any of the exception stacks: +-; FIQ, IRQ, SVC, ABT, UND, SYS. +-; The USR mode uses the same stack as SYS. +-; The stack segments must be defined in the linker command file, +-; and be declared above. +- +- mrs r0,cpsr ; Original PSR value +- bic r0,r0,#MODE_BITS ; Clear the mode bits +- orr r0,r0,#SVC_MODE ; Set SVC mode bits +- msr cpsr_c,r0 ; Change the mode +- ldr sp,=SFE(SVC_STACK) ; End of SVC_STACK +- +- bic r0,r0,#MODE_BITS ; Clear the mode bits +- orr r0,r0,#UND_MODE ; Set UND mode bits +- msr cpsr_c,r0 ; Change the mode +- ldr sp,=SFE(UND_STACK) ; End of UND_STACK +- +- bic r0,r0,#MODE_BITS ; Clear the mode bits +- orr r0,r0,#ABT_MODE ; Set ABT mode bits +- msr cpsr_c,r0 ; Change the mode +- ldr sp,=SFE(ABT_STACK) ; End of ABT_STACK +- +- bic r0,r0,#MODE_BITS ; Clear the mode bits +- orr r0,r0,#FIQ_MODE ; Set FIQ mode bits +- msr cpsr_c,r0 ; Change the mode +- ldr sp,=SFE(FIQ_STACK) ; End of FIQ_STACK +- ;- Init the FIQ register +- ldr r8, =AT91C_BASE_AIC +- +- bic r0,r0,#MODE_BITS ; Clear the mode bits +- orr r0,r0,#IRQ_MODE ; Set IRQ mode bits +- msr cpsr_c,r0 ; Change the mode +- ldr sp,=SFE(IRQ_STACK) ; End of IRQ_STACK +- +- bic r0,r0,#MODE_BITS ; Clear the mode bits +- orr r0,r0,#SYS_MODE ; Set System mode bits +- msr cpsr_c,r0 ; Change the mode +- ldr sp,=SFE(CSTACK) ; End of CSTACK +- +-#ifdef __ARMVFP__ +-; Enable the VFP coprocessor. +- mov r0, #0x40000000 ; Set EN bit in VFP +- fmxr fpexc, r0 ; FPEXC, clear others. +- +-; Disable underflow exceptions by setting flush to zero mode. +-; For full IEEE 754 underflow compliance this code should be removed +-; and the appropriate exception handler installed. +- mov r0, #0x01000000 ; Set FZ bit in VFP +- fmxr fpscr, r0 ; FPSCR, clear others. +-#endif +- +-; Add more initialization here +- +- +-; Continue to ?main for more IAR specific system startup +- +- ldr r0,=?main +- bx r0 +- +- END ;- Terminates the assembly of the last module in a file +diff --git a/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup_SAM7.c b/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup_SAM7.c +deleted file mode 100644 +index a7c72b9a32..0000000000 +--- a/components/testframework/libs/cmock/test/iar/iar_v5/srcIAR/Cstartup_SAM7.c ++++ /dev/null +@@ -1,98 +0,0 @@ +-//----------------------------------------------------------------------------- +-// ATMEL Microcontroller Software Support - ROUSSET - +-//----------------------------------------------------------------------------- +-// DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +-// DISCLAIMED. IN NO EVENT SHALL ATMEL 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 Name : Cstartup_SAM7.c +-// Object : Low level initialisations written in C for Tools +-// For AT91SAM7X256 with 2 flash plane +-// Creation : JPP 14-Sep-2006 +-//----------------------------------------------------------------------------- +- +-#include "project.h" +- +- +-// The following functions must be write in ARM mode this function called +-// directly by exception vector +-extern void AT91F_Spurious_handler(void); +-extern void AT91F_Default_IRQ_handler(void); +-extern void AT91F_Default_FIQ_handler(void); +- +-//*---------------------------------------------------------------------------- +-//* \fn AT91F_LowLevelInit +-//* \brief This function performs very low level HW initialization +-//* this function can use a Stack, depending the compilation +-//* optimization mode +-//*---------------------------------------------------------------------------- +-void AT91F_LowLevelInit(void) @ "ICODE" +-{ +- unsigned char i; +- /////////////////////////////////////////////////////////////////////////// +- // EFC Init +- /////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_MC->MC_FMR = AT91C_MC_FWS_1FWS ; +- +- /////////////////////////////////////////////////////////////////////////// +- // Init PMC Step 1. Enable Main Oscillator +- // Main Oscillator startup time is board specific: +- // Main Oscillator Startup Time worst case (3MHz) corresponds to 15ms +- // (0x40 for AT91C_CKGR_OSCOUNT field) +- /////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_PMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (0x40 <<8) | AT91C_CKGR_MOSCEN )); +- // Wait Main Oscillator stabilization +- while(!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MOSCS)); +- +- /////////////////////////////////////////////////////////////////////////// +- // Init PMC Step 2. +- // Set PLL to 96MHz (96,109MHz) and UDP Clock to 48MHz +- // PLL Startup time depends on PLL RC filter: worst case is choosen +- // UDP Clock (48,058MHz) is compliant with the Universal Serial Bus +- // Specification (+/- 0.25% for full speed) +- /////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_PMC->PMC_PLLR = AT91C_CKGR_USBDIV_1 | +- (16 << 8) | +- (AT91C_CKGR_MUL & (72 << 16)) | +- (AT91C_CKGR_DIV & 14); +- // Wait for PLL stabilization +- while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_LOCK) ); +- // Wait until the master clock is established for the case we already +- // turn on the PLL +- while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); +- +- /////////////////////////////////////////////////////////////////////////// +- // Init PMC Step 3. +- // Selection of Master Clock MCK equal to (Processor Clock PCK) PLL/2=48MHz +- // The PMC_MCKR register must not be programmed in a single write operation +- // (see. Product Errata Sheet) +- /////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_PMC->PMC_MCKR = AT91C_PMC_PRES_CLK_2; +- // Wait until the master clock is established +- while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); +- +- AT91C_BASE_PMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK; +- // Wait until the master clock is established +- while( !(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY) ); +- +- /////////////////////////////////////////////////////////////////////////// +- // Disable Watchdog (write once register) +- /////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_WDTC->WDTC_WDMR = AT91C_WDTC_WDDIS; +- +- /////////////////////////////////////////////////////////////////////////// +- // Init AIC: assign corresponding handler for each interrupt source +- /////////////////////////////////////////////////////////////////////////// +- AT91C_BASE_AIC->AIC_SVR[0] = (int) AT91F_Default_FIQ_handler ; +- for (i = 1; i < 31; i++) { +- AT91C_BASE_AIC->AIC_SVR[i] = (int) AT91F_Default_IRQ_handler ; +- } +- AT91C_BASE_AIC->AIC_SPU = (unsigned int) AT91F_Spurious_handler; +-} +diff --git a/components/testframework/libs/cmock/test/rakefile b/components/testframework/libs/cmock/test/rakefile +deleted file mode 100644 +index c57c715392..0000000000 +--- a/components/testframework/libs/cmock/test/rakefile ++++ /dev/null +@@ -1,147 +0,0 @@ +-# ============================================================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007-2014 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ============================================================================== +- +-require '../config/test_environment' +-require 'rake' +-require 'rake/clean' +-require 'rake/testtask' +-require './rakefile_helper' +- +-include RakefileHelpers +- +-DEFAULT_CONFIG_FILE = 'gcc.yml' +-CMOCK_TEST_ROOT = File.expand_path(File.dirname(__FILE__)) +- +-SYSTEM_TEST_SUPPORT_DIRS = [ +- File.join(CMOCK_TEST_ROOT, 'system/generated'), +- File.join(CMOCK_TEST_ROOT, 'system/build') +-] +- +-SYSTEM_TEST_SUPPORT_DIRS.each do |dir| +- directory(dir) +- CLOBBER.include(dir) +-end +- +- +-task :prep_system_tests => SYSTEM_TEST_SUPPORT_DIRS +- +-configure_clean +-configure_toolchain(DEFAULT_CONFIG_FILE) +- +-task :default => [:test] +-task :ci => [:no_color, :default, 'test:examples', 'style:check'] +-task :cruise => :ci +- +-desc "Load configuration" +-task :config, :config_file do |t, args| +- args = {:config_file => DEFAULT_CONFIG_FILE} if args[:config_file].nil? +- args = {:config_file => args[:config_file] + '.yml'} unless args[:config_file] =~ /\.yml$/i +- configure_toolchain(args[:config_file]) +-end +- +-# Still support testing everything with just 'test' but switch default to ceedling-like test:all +-task :test => ['test:all'] +- +-namespace :test do +- desc "Run all unit, c, and system tests" +- task :all => [:clobber, :prep_system_tests, 'test:units', 'test:c', 'test:system'] +- +- desc "Run Unit Tests" +- Rake::TestTask.new('units') do |t| +- t.pattern = 'unit/*_test.rb' +- t.verbose = true +- end +- +- #individual unit tests +- FileList['unit/*_test.rb'].each do |test| +- Rake::TestTask.new(File.basename(test,'.*').sub('_test','')) do |t| +- t.pattern = test +- t.verbose = true +- end +- end +- +- desc "Run C Unit Tests" +- task :c => [:prep_system_tests] do +- unless ($cfg['unsupported'].include? "C") +- build_and_test_c_files +- end +- end +- +- desc "Run System Tests" +- task :system => [:clobber, :prep_system_tests] do +- #get a list of all system tests, removing unsupported tests for this compiler +- sys_unsupported = $cfg['unsupported'].map {|a| 'system/test_interactions/'+a+'.yml'} +- sys_tests_to_run = FileList['system/test_interactions/*.yml'] - sys_unsupported +- compile_unsupported = $cfg['unsupported'].map {|a| SYSTEST_COMPILE_MOCKABLES_PATH+a+'.h'} +- compile_tests_to_run = FileList[SYSTEST_COMPILE_MOCKABLES_PATH + '*.h'] - compile_unsupported +- unless (sys_unsupported.empty? and compile_unsupported.empty?) +- report "\nIgnoring these system tests..." +- sys_unsupported.each {|a| report a} +- compile_unsupported.each {|a| report a} +- end +- report "\nRunning system tests..." +- tests_failed = run_system_test_interactions(sys_tests_to_run) +- raise "System tests failed." if (tests_failed > 0) +- +- run_system_test_compilations(compile_tests_to_run) +- end +- +- desc "Test cmock examples" +- task :examples => [:prep_system_tests] do +- run_examples() +- end +- +- #individual system tests +- FileList['system/test_interactions/*.yml'].each do |test| +- basename = File.basename(test,'.*') +- #desc "Run system test #{basename}" +- task basename do +- run_system_test_interactions([test]) +- end +- end +- +- desc "Profile Mock Generation" +- task :profile => [:clobber, :prep_system_tests] do +- run_system_test_profiles(FileList[SYSTEST_COMPILE_MOCKABLES_PATH + '*.h']) +- end +-end +- +-task :no_color do +- $colour_output = false +-end +- +-################### CODING STYLE VALIDATION +-namespace :style do +- desc "Check style" +- task :check do +- report "\nVERIFYING RUBY STYLE" +- report execute("rubocop ../lib ../examples ../config ../scripts --config ../vendor/unity/test/.rubocop.yml", true) +- report "Styling Ruby:PASS" +- end +- +- desc "Fix Style of all C Code" +- task :c do +- run_astyle("../src/*.* ../extras/fixture/src/*.*") +- end +- +- desc "Attempt to Autocorrect style" +- task :auto => ['style:clean'] do +- report execute("rubocop ../lib ../examples ../config ../scripts --auto-correct --config ../vendor/unity/test/.rubocop.yml", true) +- report "Autocorrected What We Could." +- end +- +- desc "Update style todo list" +- task :todo => ['style:clean'] do +- report execute("rubocop ../lib ../examples ../config ../scripts --auto-gen-config --config ../vendor/unity/test/.rubocop.yml", true) +- report "Updated Style TODO List." +- end +- +- task :clean do +- File.delete(".rubocop_todo.yml") if File.exists?(".rubocop_todo.yml") +- end +-end +- +-task :style => ['style:check'] +\ No newline at end of file +diff --git a/components/testframework/libs/cmock/test/rakefile_helper.rb b/components/testframework/libs/cmock/test/rakefile_helper.rb +deleted file mode 100644 +index 3d898905ed..0000000000 +--- a/components/testframework/libs/cmock/test/rakefile_helper.rb ++++ /dev/null +@@ -1,403 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require 'yaml' +-require 'fileutils' +-require '../vendor/unity/auto/generate_test_runner' +-require '../vendor/unity/auto/unity_test_summary' +-require '../vendor/unity/auto/colour_reporter.rb' +-require './system/systest_generator' +- +-module RakefileHelpers +- +- SYSTEST_GENERATED_FILES_PATH = './system/generated/' +- SYSTEST_BUILD_FILES_PATH = './system/build/' +- SYSTEST_COMPILE_MOCKABLES_PATH = './system/test_compilation/' +- C_EXTENSION = '.c' +- RESULT_EXTENSION = '.result' +- +- def load_configuration(config_file) +- $cfg_file = config_file +- $cfg = YAML.load(File.read('./targets/' + $cfg_file)) +- $colour_output = false unless $cfg['colour'] +- end +- +- def configure_clean +- CLEAN.include(SYSTEST_GENERATED_FILES_PATH + '*.*') +- CLEAN.include(SYSTEST_BUILD_FILES_PATH + '*.*') +- end +- +- def configure_toolchain(config_file) +- load_configuration(config_file) +- configure_clean +- end +- +- def get_local_include_dirs +- include_dirs = $cfg['compiler']['includes']['items'].dup +- include_dirs.delete_if {|dir| dir.is_a?(Array)} +- return include_dirs +- end +- +- def extract_headers(filename) +- includes = [] +- lines = File.readlines(filename) +- lines.each do |line| +- m = line.match(/^\s*#include\s+\"\s*(.+\.[hH])\s*\"/) +- if not m.nil? +- includes << m[1] +- end +- end +- includes << File.basename(filename,".c").slice(5,256) + "_unity_helper.h" +- return includes +- end +- +- def find_source_file(header, paths) +- paths.each do |dir| +- src_file = dir + header.ext(C_EXTENSION) +- if (File.exists?(src_file)) +- return src_file +- end +- end +- return nil +- end +- +- def squash(prefix, items) +- result = '' +- items.each { |item| result += " #{prefix}#{tackit(item)}" } +- return result +- end +- +- def build_compiler_fields +- command = tackit($cfg['compiler']['path']) +- if $cfg['compiler']['defines']['items'].nil? +- defines = '' +- else +- defines = squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items']) +- end +- options = squash('', $cfg['compiler']['options']) +- includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items']) +- includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) +- return {:command => command, :defines => defines, :options => options, :includes => includes} +- end +- +- def compile(file, defines=[]) +- compiler = build_compiler_fields +- cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{defines.inject(''){|all, a| ' -D'+a+all }}#{compiler[:options]}#{compiler[:includes]} #{file} " + +- "#{$cfg['compiler']['object_files']['prefix']}#{$cfg['compiler']['object_files']['destination']}" +- obj_file = "#{File.basename(file, C_EXTENSION)}#{$cfg['compiler']['object_files']['extension']}" +- execute(cmd_str + obj_file) +- return obj_file +- end +- +- def build_linker_fields +- command = tackit($cfg['linker']['path']) +- if $cfg['linker']['options'].nil? +- options = '' +- else +- options = squash('', $cfg['linker']['options']) +- end +- if ($cfg['linker']['includes'].nil? || $cfg['linker']['includes']['items'].nil?) +- includes = '' +- else +- includes = squash($cfg['linker']['includes']['prefix'], $cfg['linker']['includes']['items']) +- end +- includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) +- return {:command => command, :options => options, :includes => includes} +- end +- +- def link_it(exe_name, obj_list) +- linker = build_linker_fields +- cmd_str = "#{linker[:command]}#{linker[:options]}#{linker[:includes]} " + +- (obj_list.map{|obj|"#{$cfg['linker']['object_files']['path']}#{obj} "}).uniq.join + +- $cfg['linker']['bin_files']['prefix'] + ' ' + +- $cfg['linker']['bin_files']['destination'] + +- exe_name + $cfg['linker']['bin_files']['extension'] +- execute(cmd_str) +- end +- +- def build_simulator_fields +- return nil if $cfg['simulator'].nil? +- if $cfg['simulator']['path'].nil? +- command = '' +- else +- command = (tackit($cfg['simulator']['path']) + ' ') +- end +- if $cfg['simulator']['pre_support'].nil? +- pre_support = '' +- else +- pre_support = squash('', $cfg['simulator']['pre_support']) +- end +- if $cfg['simulator']['post_support'].nil? +- post_support = '' +- else +- post_support = squash('', $cfg['simulator']['post_support']) +- end +- return {:command => command, :pre_support => pre_support, :post_support => post_support} +- end +- +- def execute(command_string, verbose=true, raise_on_failure=true) +- #report command_string +- output = `#{command_string}`.chomp +- report(output) if (verbose && !output.nil? && (output.length > 0)) +- if ($?.exitstatus != 0) and (raise_on_failure) +- raise "#{command_string} failed. (Returned #{$?.exitstatus})" +- end +- return output +- end +- +- def tackit(strings) +- case(strings) +- when Array +- "\"#{strings.join}\"" +- when /^-/ +- strings +- when /\s/ +- "\"#{strings}\"" +- else +- strings +- end +- end +- +- def run_astyle(style_what) +- report "Styling C Code..." +- command = "AStyle " \ +- "--style=allman --indent=spaces=4 --indent-switches --indent-preproc-define --indent-preproc-block " \ +- "--pad-oper --pad-comma --unpad-paren --pad-header " \ +- "--align-pointer=type --align-reference=name " \ +- "--add-brackets --mode=c --suffix=none " \ +- "#{style_what}" +- execute(command, false) +- report "Styling C:PASS" +- end +- +- def report_summary +- summary = UnityTestSummary.new +- summary.root = File.expand_path(File.dirname(__FILE__)) + '/' +- results_glob = "#{$cfg['compiler']['build_path']}*.test*" +- results_glob.gsub!(/\\/, '/') +- results = Dir[results_glob] +- summary.targets = results +- summary.run +- fail_out "FAIL: There were failures" if (summary.failures > 0) +- end +- +- def run_system_test_interactions(test_case_files) +- load '../lib/cmock.rb' +- +- SystemTestGenerator.new.generate_files(test_case_files) +- test_files = FileList.new(SYSTEST_GENERATED_FILES_PATH + 'test*.c') +- +- load_configuration($cfg_file) +- $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? +- +- include_dirs = get_local_include_dirs +- +- # Build and execute each unit test +- test_files.each do |test| +- +- obj_list = [] +- +- test_base = File.basename(test, C_EXTENSION) +- cmock_config = test_base.gsub(/test_/, '') + '_cmock.yml' +- +- report "Executing system tests in #{File.basename(test)}..." +- +- # Detect dependencies and build required required modules +- extract_headers(test).each do |header| +- +- # Generate any needed mocks +- if header =~ /^mock_(.*)\.h/i +- module_name = $1 +- cmock = CMock.new(SYSTEST_GENERATED_FILES_PATH + cmock_config) +- cmock.setup_mocks("#{$cfg['compiler']['source_path']}#{module_name}.h") +- end +- # Compile corresponding source file if it exists +- src_file = find_source_file(header, include_dirs) +- if !src_file.nil? +- obj_list << compile(src_file) +- end +- end +- +- # Generate and build the test suite runner +- runner_name = test_base + '_runner.c' +- runner_path = $cfg['compiler']['source_path'] + runner_name +- UnityTestRunnerGenerator.new(SYSTEST_GENERATED_FILES_PATH + cmock_config).run(test, runner_path) +- obj_list << compile(runner_path) +- +- # Build the test module +- obj_list << compile(test) +- +- # Link the test executable +- link_it(test_base, obj_list) +- +- # Execute unit test and generate results file +- simulator = build_simulator_fields +- executable = $cfg['linker']['bin_files']['destination'] + test_base + $cfg['linker']['bin_files']['extension'] +- if simulator.nil? +- cmd_str = executable +- else +- cmd_str = "#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}" +- end +- output = execute(cmd_str, false, false) +- test_results = $cfg['compiler']['build_path'] + test_base + RESULT_EXTENSION +- File.open(test_results, 'w') { |f| f.print output } +- end +- +- # Parse and report test results +- total_tests = 0 +- total_failures = 0 +- failure_messages = [] +- +- test_case_files.each do |test_case| +- tests = (YAML.load_file(test_case))[:systest][:tests][:units] +- total_tests += tests.size +- +- test_file = 'test_' + File.basename(test_case).ext(C_EXTENSION) +- result_file = test_file.ext(RESULT_EXTENSION) +- test_results = File.readlines(SYSTEST_BUILD_FILES_PATH + result_file).reject {|line| line.size < 10 } # we're rejecting lines that are too short to be realistic, which handles line ending problems +- tests.each_with_index do |test, index| +- # compare test's intended pass/fail state with pass/fail state in actual results; +- # if they don't match, the system test has failed +- this_failed = case(test[:pass]) +- when :ignore +- (test_results[index] =~ /:IGNORE/).nil? +- when true +- (test_results[index] =~ /:PASS/).nil? +- when false +- (test_results[index] =~ /:FAIL/).nil? +- end +- if (this_failed) +- total_failures += 1 +- test_results[index] =~ /test#{index+1}:(.+)/ +- failure_messages << "#{test_file}:test#{index+1}:should #{test[:should]}:#{$1}" +- end +- # some tests have additional requirements to check for (checking the actual output message) +- if (test[:verify_error]) and not (test_results[index] =~ /test#{index+1}:.*#{test[:verify_error]}/) +- total_failures += 1 +- failure_messages << "#{test_file}:test#{index+1}:should #{test[:should]}:should have output matching '#{test[:verify_error]}' but was '#{test_results[index]}'" +- end +- end +- end +- +- report "\n" +- report "------------------------------------\n" +- report "SYSTEM TEST MOCK INTERACTION SUMMARY\n" +- report "------------------------------------\n" +- report "#{total_tests} Tests #{total_failures} Failures 0 Ignored\n" +- report "\n" +- +- if (failure_messages.size > 0) +- report 'System test failures:' +- failure_messages.each do |failure| +- report failure +- end +- end +- +- report '' +- +- return total_failures +- end +- +- def profile_this(filename) +- profile = true +- begin +- require 'ruby-prof' +- RubyProf.start +- rescue +- profile = false +- end +- +- yield +- +- if (profile) +- profile_result = RubyProf.stop +- File.open("Profile_#{filename}.html", 'w') do |f| +- RubyProf::GraphHtmlPrinter.new(profile_result).print(f) +- end +- end +- end +- +- def run_system_test_compilations(mockables) +- load '../lib/cmock.rb' +- +- load_configuration($cfg_file) +- $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? +- +- report "\n" +- report "------------------------------------\n" +- report "SYSTEM TEST MOCK COMPILATION SUMMARY\n" +- report "------------------------------------\n" +- mockables.each do |header| +- mock_filename = 'mock_' + File.basename(header).ext('.c') +- CMock.new(SYSTEST_COMPILE_MOCKABLES_PATH + 'config.yml').setup_mocks(header) +- report "Compiling #{mock_filename}..." +- compile(SYSTEST_GENERATED_FILES_PATH + mock_filename) +- end +- end +- +- def run_system_test_profiles(mockables) +- load '../lib/cmock.rb' +- +- load_configuration($cfg_file) +- $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? +- +- report "\n" +- report "--------------------------\n" +- report "SYSTEM TEST MOCK PROFILING\n" +- report "--------------------------\n" +- mockables.each do |header| +- mock_filename = 'mock_' + File.basename(header).ext('.c') +- profile_this(mock_filename.gsub('.c','')) do +- 10.times do +- CMock.new(SYSTEST_COMPILE_MOCKABLES_PATH + 'config.yml').setup_mocks(header) +- end +- end +- report "Compiling #{mock_filename}..." +- compile(SYSTEST_GENERATED_FILES_PATH + mock_filename) +- end +- end +- +- def build_and_test_c_files +- report "\n" +- report "----------------\n" +- report "UNIT TEST C CODE\n" +- report "----------------\n" +- errors = false +- FileList.new("c/*.yml").each do |yaml_file| +- test = YAML.load(File.read(yaml_file)) +- report "\nTesting #{yaml_file.sub('.yml','')}" +- report "(#{test[:options].join(', ')})" +- test[:files].each { |f| compile(f, test[:options]) } +- obj_files = test[:files].map { |f| f.gsub!(/.*\//,'').gsub!(C_EXTENSION, $cfg['compiler']['object_files']['extension']) } +- link_it('TestCMockC', obj_files) +- if $cfg['simulator'].nil? +- execute($cfg['linker']['bin_files']['destination'] + 'TestCMockC' + $cfg['linker']['bin_files']['extension']) +- else +- execute(tackit($cfg['simulator']['path'].join) + ' ' + +- $cfg['simulator']['pre_support'].map{|o| tackit(o)}.join(' ') + ' ' + +- $cfg['linker']['bin_files']['destination'] + +- 'TestCMockC' + +- $cfg['linker']['bin_files']['extension'] + ' ' + +- $cfg['simulator']['post_support'].map{|o| tackit(o)}.join(' ') ) +- end +- end +- end +- +- def run_examples() +- [ "cd #{File.join("..","examples","make_example")} && make clean && make setup && make test", +- "cd #{File.join("..","examples","temp_sensor")} && rake ci" +- ].each do |cmd| +- report "Testing '#{cmd}'" +- execute(cmd, false) +- end +- end +- +- def fail_out(msg) +- puts msg +- exit(-1) +- end +-end +- +diff --git a/components/testframework/libs/cmock/test/system/systest_generator.rb b/components/testframework/libs/cmock/test/system/systest_generator.rb +deleted file mode 100644 +index 490a56eb12..0000000000 +--- a/components/testframework/libs/cmock/test/system/systest_generator.rb ++++ /dev/null +@@ -1,205 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require 'yaml' +- +-SYS_TEST_GEN_ROOT = File.expand_path( File.dirname( __FILE__ ) ) + '/' +-GENERATED_PATH = SYS_TEST_GEN_ROOT + 'generated/' +-BUILD_PATH = SYS_TEST_GEN_ROOT + 'build/' +-CASES_PATH = SYS_TEST_GEN_ROOT + 'cases/' +- +-TYPES_H = 'types.h' +-UNITY_H = 'unity.h' +-CMOCK_H = 'cmock.h' +-UNITY_HELPER_H = 'unity_helper.h' +-UNITY_HELPER_C = 'unity_helper.c' +-MOCKABLE_H = 'mockable.h' +- +-YAML_EXTENSION = '.yml' +-TEST_PREFIX = 'test_' +-MOCK_PREFIX = 'mock_' +-H_EXTENSION = '.h' +-C_EXTENSION = '.c' +- +- +-class SystemTestGenerator +- +- def generate_files(test_cases) +- test_cases.each do |filename| +- yaml_hash = YAML.load_file(filename) +- +- name = File.basename(filename, YAML_EXTENSION) +- namix = "#{name}_" +- +- generate_cmock_config(yaml_hash, namix) +- generate_code(yaml_hash, namix, name) +- end +- end +- +- private +- +- def generate_cmock_config(yaml_hash, namix) +- cmock_yaml = yaml_hash.clone +- cmock_yaml.delete(:systest) +- cmock = cmock_yaml[:cmock] +- +- cmock[:mock_path] = GENERATED_PATH +- cmock[:includes] = (cmock[:includes] || []) + [namix + TYPES_H] +- cmock[:mock_prefix] = MOCK_PREFIX +- if not yaml_hash[:systest][:unity_helper].nil? +- cmock[:includes] << namix + UNITY_HELPER_H +- cmock[:unity_helper_path] = GENERATED_PATH + namix + UNITY_HELPER_H +- end +- +- File.open(GENERATED_PATH + namix + 'cmock' + YAML_EXTENSION, 'w') do |out| +- YAML.dump(cmock_yaml, out) +- end +- end +- +- def generate_code(yaml_hash, namix, name) +- generate_types_file(yaml_hash, namix) +- generate_mockable_file(yaml_hash, namix) +- generate_unity_helper_files(yaml_hash, namix) +- +- generate_test_file(yaml_hash, namix, name) +- generate_source_file(yaml_hash, namix, name) +- generate_skeleton_file(yaml_hash, namix, name) +- end +- +- def generate_types_file(yaml_hash, namix) +- types = yaml_hash[:systest][:types] +- return if types.nil? +- +- write_header_file(GENERATED_PATH + namix + TYPES_H, namix.upcase + 'TYPES_H') do |out| +- out.puts(types) +- end +- end +- +- def generate_mockable_file(yaml_hash, namix) +- mockable = yaml_hash[:systest][:mockable] +- return if mockable.nil? +- +- write_header_file(GENERATED_PATH + namix + MOCKABLE_H, namix.upcase + 'MOCKABLE_H', [namix + TYPES_H]) do |out| +- out.puts(mockable) +- end +- end +- +- def generate_unity_helper_files(yaml_hash, namix) +- unity_helper = yaml_hash[:systest][:unity_helper] +- return if unity_helper.nil? +- +- write_header_file(GENERATED_PATH + namix + UNITY_HELPER_H, namix.upcase + 'UNITY_HELPER_H', [namix + TYPES_H]) do |out| +- out.puts(unity_helper[:header]) +- end +- +- write_source_file(GENERATED_PATH + namix + UNITY_HELPER_C, ["unity.h", namix + UNITY_HELPER_H]) do |out| +- out.puts(unity_helper[:code]) +- end +- end +- +- def generate_test_file(yaml_hash, namix, name) +- tests = yaml_hash[:systest][:tests] +- return if tests.nil? +- +- includes = [UNITY_H, CMOCK_H] +- includes << [MOCK_PREFIX + namix + MOCKABLE_H] +- includes << [name + H_EXTENSION] +- +- write_source_file(GENERATED_PATH + TEST_PREFIX + name + C_EXTENSION, includes.flatten) do |out| +- out.puts(tests[:common]) +- out.puts('') +- +- tests[:units].each_with_index do |test, index| +- out.puts('// should ' + test[:should]) +- out.puts(test[:code].gsub!(/test\(\)/, "void test#{index+1}(void)")) +- out.puts('') +- end +- end +- end +- +- def generate_source_file(yaml_hash, namix, name) +- source = yaml_hash[:systest][:source] +- return if source.nil? +- +- header_file = name + H_EXTENSION +- +- includes = yaml_hash[:systest][:types].nil? ? [] : [(namix + TYPES_H)] +- +- write_header_file(GENERATED_PATH + header_file, name.upcase, includes) do |out| +- out.puts(source[:header]) +- end +- +- includes = [] +- includes << (namix + TYPES_H) if not yaml_hash[:systest][:types].nil? +- includes << (namix + MOCKABLE_H) if not yaml_hash[:systest][:mockable].nil? +- includes << header_file +- +- unless (source[:code].nil?) +- write_source_file(GENERATED_PATH + name + C_EXTENSION, includes.flatten) do |out| +- out.puts(source[:code]) +- end +- end +- end +- +- def generate_skeleton_file(yaml_hash, namix, name) +- source = yaml_hash[:systest][:skeleton] +- return if source.nil? +- +- require 'cmock.rb' +- cmock = CMock.new(GENERATED_PATH + namix + 'cmock' + YAML_EXTENSION) +- cmock.setup_skeletons("#{$cfg['compiler']['source_path']}#{name}.h") +- end +- +- def write_header_file(filename, upcase_name, include_list=[]) +- File.open(filename, 'w') do |out| +- out.puts("#ifndef _#{upcase_name}") +- out.puts("#define _#{upcase_name}") +- out.puts('') +- include_list.each do |include| +- out.puts("#include \"#{include}\"") +- end +- out.puts('') +- out.puts("#if defined(__GNUC__) && !defined(__ICC)") +- out.puts("#if !defined(__clang__)") +- out.puts("#pragma GCC diagnostic ignored \"-Wpragmas\"") +- out.puts("#endif") +- out.puts('#pragma GCC diagnostic ignored "-Wunknown-pragmas"') +- out.puts('#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier"') +- out.puts("#endif") +- out.puts('') +- yield(out) +- out.puts('') +- out.puts("#endif // _#{upcase_name}") +- out.puts('') +- end +- end +- +- def write_source_file(filename, include_list=[]) +- File.open(filename, 'w') do |out| +- include_list.each do |include| +- out.puts("#include \"#{include}\"") +- end +- out.puts('') +- out.puts("#if defined(__GNUC__) && !defined(__ICC)") +- out.puts("#if !defined(__clang__)") +- out.puts("#pragma GCC diagnostic ignored \"-Wpragmas\"") +- out.puts("#endif") +- out.puts('#pragma GCC diagnostic ignored "-Wunknown-pragmas"') +- out.puts('#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier"') +- out.puts("#endif") +- out.puts('') +- yield(out) +- out.puts('') +- end +- end +- +-end +- +- +-if ($0 == __FILE__) +- SystemTestGenerator.new.generate_files(Dir[CASES_PATH + "*#{YAML_EXTENSION}"]) +-end +- +diff --git a/components/testframework/libs/cmock/test/system/test_compilation/callingconv.h b/components/testframework/libs/cmock/test/system/test_compilation/callingconv.h +deleted file mode 100644 +index beae0619f8..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_compilation/callingconv.h ++++ /dev/null +@@ -1,11 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-#ifndef __stdcall +-#define __stdcall +-#endif +- +-int __stdcall this_uses_calling_conventions(int b); +diff --git a/components/testframework/libs/cmock/test/system/test_compilation/config.yml b/components/testframework/libs/cmock/test/system/test_compilation/config.yml +deleted file mode 100644 +index 787e2e1f66..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_compilation/config.yml ++++ /dev/null +@@ -1,10 +0,0 @@ +---- +-:cmock: +- :plugins: [] +- :includes: [] +- :mock_path: ./system/generated/ +- :mock_prefix: mock_ +- :treat_inlines: :include +- :treat_as_void: +- - OSEK_TASK +- - VOID_TYPE_CRAZINESS +diff --git a/components/testframework/libs/cmock/test/system/test_compilation/const.h b/components/testframework/libs/cmock/test/system/test_compilation/const.h +deleted file mode 100644 +index 71426bc3ba..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_compilation/const.h ++++ /dev/null +@@ -1,37 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-#if defined(__GNUC__) && !defined(__ICC) +-#if !defined(__clang__) +-#pragma GCC diagnostic ignored "-Wpragmas" +-#endif +-#pragma GCC diagnostic ignored "-Wunknown-pragmas" +-#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier" +-#endif +- +-struct _DUMMY_T { unsigned int a; float b; }; +- +-void const_variants1( const char* a, int const, unsigned short const * c ); +- +-void const_variants2( +- struct _DUMMY_T const * const param1, +- const unsigned long int const * const param2, +- const struct _DUMMY_T const * param3 ); +- +-const int * const_retval1(void); /* nicety version for pointer to constant int */ +-int const * const_retval2(void); /* formal version for pointer to constant int */ +-//int * const const_retval3(void); /* formal version for constant pointer to int */ +-//int const * const const_retval4(void); /* formal version for constant pointer to constant int */ +- +-const int* const_retval5(void); /* sticky-left nicety version for pointer to constant int */ +-int const* const_retval6(void); /* sticky-left formal version for pointer to constant int */ +-//int* const const_retval7(void); /* sticky-left formal version for constant pointer to int */ +-//int const* const const_retval8(void); /* sticky-left formal version for constant pointer to constant int */ +- +-const int *const_retval9(void); /* sticky-right nicety version for pointer to constant int */ +-int const *const_retvalA(void); /* sticky-right formal version for pointer to constant int */ +-//int *const const_retvalB(void); /* sticky-right formal version for constant pointer to int */ +-//int const *const const_retvalC(void); /* sticky-right formal version for constant pointer to constant int */ +diff --git a/components/testframework/libs/cmock/test/system/test_compilation/inline.h b/components/testframework/libs/cmock/test/system/test_compilation/inline.h +deleted file mode 100644 +index 06e33c184c..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_compilation/inline.h ++++ /dev/null +@@ -1,23 +0,0 @@ +- +-static inline int dummy_func_0(void) { +- return 5; +-} +- +-inline static int dummy_func_1(int a) { +- int a = dummy_func_0(); +- int b = 10; +- +- return a + b; +-} +- +-int inline static dummy_func_2(int a, char b, float c) { +- c += 3.14; +- b -= 32; +- return a + (int)(b) + (int)c; +-} +- +-void dummy_normal_func(int a); +- +-inline void dummy_func_3(void) { +- //NOP +-} +diff --git a/components/testframework/libs/cmock/test/system/test_compilation/osek.h b/components/testframework/libs/cmock/test/system/test_compilation/osek.h +deleted file mode 100644 +index f3abe7b57e..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_compilation/osek.h ++++ /dev/null +@@ -1,275 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-typedef unsigned char OSServiceIdType; +-typedef void (*OSEKOS_VOIDFUNCPTR)(void); +- +-typedef unsigned char StatusType; +-typedef unsigned char OSEK_U8; +-typedef unsigned short OSEK_U16; +-typedef unsigned long OSEK_U32; +- +-void OSEKOSDisableAll(void); +-void OSEKOSEnableAll(void); +- +-typedef unsigned long * OSEKOSSaveType; +-typedef void OSEK_TASK; +-typedef OSEK_U8 OSEKOSPrioType; +- +-enum { +-Task_DbgCAN +-, +-Task_ALS +-, +-CalibrateMagTask +-, +-Task_IAQ +-, +-SmartBeam +-, +-Task_QbertTestImage +-, +-Task_TestQbertMem +-, +-Task_Cyclic1000 +-, +-ProcessMagForCompass +-, +-ReadMag +-, +-Task_Cyclic10 +-, +-Task_Wdm +-, +-BackgroundTask +-, +-Task_Cyclic20 +-, +-Task_Cyclic2 +-}; +- +-OSEK_TASK OSEKOS_T_Task_DbgCAN(void); +-OSEK_TASK OSEKOS_T_Task_ALS(void); +-OSEK_TASK OSEKOS_T_CalibrateMagTask(void); +-OSEK_TASK OSEKOS_T_Task_IAQ(void); +-OSEK_TASK OSEKOS_T_SmartBeam(void); +-OSEK_TASK OSEKOS_T_Task_QbertTestImage(void); +-OSEK_TASK OSEKOS_T_Task_TestQbertMem(void); +-OSEK_TASK OSEKOS_T_Task_Cyclic1000(void); +-OSEK_TASK OSEKOS_T_ProcessMagForCompass(void); +-OSEK_TASK OSEKOS_T_ReadMag(void); +-OSEK_TASK OSEKOS_T_Task_Cyclic10(void); +-OSEK_TASK OSEKOS_T_Task_Wdm(void); +-OSEK_TASK OSEKOS_T_BackgroundTask(void); +-OSEK_TASK OSEKOS_T_Task_Cyclic20(void); +-OSEK_TASK OSEKOS_T_Task_Cyclic2(void); +-OSEK_TASK OSEKOS_Twrap_Task_DbgCAN(void); +-OSEK_TASK OSEKOS_Twrap_Task_ALS(void); +-OSEK_TASK OSEKOS_Twrap_CalibrateMagTask(void); +-OSEK_TASK OSEKOS_Twrap_Task_IAQ(void); +-OSEK_TASK OSEKOS_Twrap_SmartBeam(void); +-OSEK_TASK OSEKOS_Twrap_Task_QbertTestImage(void); +-OSEK_TASK OSEKOS_Twrap_Task_TestQbertMem(void); +-OSEK_TASK OSEKOS_Twrap_Task_Cyclic1000(void); +-OSEK_TASK OSEKOS_Twrap_ProcessMagForCompass(void); +-OSEK_TASK OSEKOS_Twrap_ReadMag(void); +-OSEK_TASK OSEKOS_Twrap_Task_Cyclic10(void); +-OSEK_TASK OSEKOS_Twrap_Task_Wdm(void); +-OSEK_TASK OSEKOS_Twrap_BackgroundTask(void); +-OSEK_TASK OSEKOS_Twrap_Task_Cyclic20(void); +-OSEK_TASK OSEKOS_Twrap_Task_Cyclic2(void); +- +-typedef OSEK_U8 TaskType; +-typedef OSEK_U8 TaskStateType; +-typedef OSEK_U16 EventMaskType; +-typedef OSEK_U8 ResourceType; +- +-void OSEKOSEnableSystemTimers(void); +- +-typedef OSEK_U8 CounterType; +-typedef OSEK_U32 TickType; +-typedef OSEK_U8 AlarmType; +- +-void OSEKOS_ISR_CanTxInterrupt(void); +-void OSEKOS_ISR_CanRxInterrupt(void); +-void OSEKOS_ISR_CanErrInterrupt(void); +-void OSEKOS_ISR_SCIRxInterrupt(void); +-void OSEKOS_ISR_SCITxInterrupt(void); +-void OSEKOS_ISR_UP_DMA_Interrupt_0(void); +-void OSEKOS_ISR_UP_DMA_Interrupt_1(void); +-void OSEKOS_ISR_UP_DMA_Interrupt_2(void); +-void OSEKOS_ISR_UP_DMA_Interrupt_3(void); +-void OSEKOS_ISR_CompFreqHandler(void); +-void OSEKOS_ISR_AmbientReturnInt(void); +-void OSEKOS_ISR_GlareReturnInt(void); +-void OSEKOS_ISR_ALSTimeoutInt(void); +-void OSEKOS_ISR_LINTimerInt(void); +-void OSEKOS_ISR_LINDelayInt(void); +-void OSEKOS_ISR_TimerMExpire(void); +-void OSEKOS_ISR_LINRxTx_SCI1(void); +-void OSEKOS_ISR_CanRxInterrupt_1(void); +-void OSEKOS_ISR_LINError_SCI1(void); +-void OSEKOS_ISR_SysCounter(void); +- +- +-// defined multiple times (slightly different forms) These should be ignored because they are externed +-extern void OSEKOS_ISR_CanTxInterrupt( void ); +-extern void OSEKOS_ISR_CanRxInterrupt( void ); +- +- +-unsigned long OSEKOSrtcGetSeconds ( void ); +-void OSEKOSrtcIncrement ( unsigned long nsec ); +- +-enum +-{ +- E_OS_ACCESS = 1, +- E_OS_CALLEVEL = 2, +- E_OS_ID = 3, +- E_OS_LIMIT = 4, +- E_OS_NOFUNC = 5, +- E_OS_RESOURCE = 6, +- E_OS_STATE = 7, +- E_OS_VALUE = 8, +- E_OS_SYS_StackOverflow = 20, +- E_OS_SYS_StackUnderflow = 21, +- E_OS_SYS_INIT = 22, +- E_OS_SYS_CONFIG = 23, +- E_OS_SYS_CODE = 24, +- E_OS_SYS_TOOL = 25, +- E_OS_SYS_TimerRange = 26 +-}; +- +-enum +-{ +- SUSPENDED = 0x00, +- READY = 0x01, +- RUNNING = 0x02, +- WAITING = 0x03, +- INTSTART = 0x08, +- SETSTART = 0x10, +- NPRTASK = 0x20, +- USEFP = 0x40 +-}; +- +-typedef struct +-{ +- TickType maxallowedvalue; +- TickType ticksperbase; +-} AlarmBaseType; +- +-typedef TaskType *TaskRefType; +-typedef TaskStateType *TaskStateRefType; +-typedef EventMaskType *EventMaskRefType; +-typedef TickType *TickRefType; +-typedef AlarmBaseType *AlarmBaseRefType; +-typedef OSEK_U8 AppModeType; +-typedef OSEK_U8 OSEKOSTaskActCntType; +- +-TaskType OSEKOStidact; +-OSEKOSPrioType OSEKOSrunprio; +- +-StatusType OSEKOSError ( register StatusType ); +-void ErrorHook ( StatusType ); +-void StartupHook ( void ); +-void ShutdownHook ( StatusType ); +- +-int getUsedTaskStack ( TaskType ); +-int getUnusedTaskStack ( TaskType ); +-int getUsedIsrStack ( void ); +-int getUnusedIsrStack ( void ); +-void OSEKOStaskStackCheckInit ( void ); +-signed char OSEKOStaskStackCheck ( OSEK_U8 * ); +-signed char OSEKOSisrStackCheck ( OSEK_U8 * ); +-void OSEKOStaskStackCheckFatal ( OSEK_U8 * ); +-void OSEKOSisrStackCheckFatal ( OSEK_U8 * ); +-OSEK_U8 * OSEKOSgetStackPointer ( void ); +-void OSEKOSTaskSwitch ( void ); +-StatusType OSEKOSReturn ( StatusType ); +-StatusType OSEKOSActivateTask ( register TaskType ); +-void OSEKOSTerminateTask ( TaskType, TaskType ); +- +- extern void OSEKOSGetResource ( ResourceType ); +- extern void OSEKOSReleaseResource ( ResourceType ); +- +-int OSEKOSSetEvent ( TaskType, EventMaskType ); +-int OSEKOSWaitEvent ( EventMaskType ); +-TickType OSEKOSGetAlarm(register AlarmType); +-void OSEKOSSetAlarm ( AlarmType, TickType, TickType ); +-StatusType OSEKOSSetAbsAlarm ( AlarmType a, TickType b, TickType c ); +- +-StatusType OSEKOSCancelAlarm ( register AlarmType ); +-void OSEKOSAdvCntr ( void ); +-AppModeType GetActiveApplicationMode ( void ); +- +-void StartOS ( AppModeType ); +- +-void OSEKOSShutdownOS ( StatusType ); +- +-StatusType ActivateTask ( TaskType A ); +-StatusType TerminateTask ( void ); +-StatusType ChainTask ( TaskType A ); +-StatusType GetTaskState ( TaskType A, TaskStateRefType B ); +-StatusType GetTaskID ( TaskRefType A ); +-StatusType Schedule ( void ); +-StatusType GetResource ( ResourceType A ); +-StatusType ReleaseResource ( ResourceType A ); +-StatusType SetEvent ( TaskType A, EventMaskType B ); +-StatusType ClearEvent ( EventMaskType A ); +-StatusType WaitEvent ( EventMaskType A ); +-StatusType GetEvent ( TaskType A, EventMaskRefType B ); +-StatusType GetAlarm ( AlarmType A, TickRefType B ); +-StatusType GetAlarmBase ( AlarmType A, AlarmBaseRefType B ); +-StatusType SetRelAlarm ( AlarmType A, TickType B, TickType C ); +-StatusType SetAbsAlarm ( AlarmType A, TickType B, TickType C ); +-StatusType CancelAlarm ( AlarmType A ); +-StatusType AdvCntr ( CounterType A ); +-StatusType IAdvCntr ( CounterType A ); +-void SuspendOSInterrupts ( void ); +-void ResumeOSInterrupts ( void ); +-void SuspendAllInterrupts ( void ); +-void ResumeAllInterrupts ( void ); +-void DisableAllInterrupts ( void ); +-void EnableAllInterrupts ( void ); +- +-void OSEKOSDisable(void); +-void OSEKOSEnable(void); +-void OSEKOSAsmIDispatch(unsigned long *); +-void OSEKOSAsmDispatch(OSEKOSPrioType p); +-void OSEKOSStartupEnable(void); +-void OSEKOSNop(void); +-unsigned int OSEKOSV850CheckIsrSwitch(void); +-void OSEKOSV850InitInterrupts(void); +-void OSEKOSV850SetupInterrupts(); +-void OSEKOSV850SyncContextLoad(OSEKOSSaveType); +-void OSEKOSV850SyncContextLoadFromIRQ(OSEKOSSaveType); +-void OSEKOSV850ASyncContextLoad(OSEKOSSaveType); +-void OSEKOSV850ASyncContextLoadFromIRQ(OSEKOSSaveType); +- +-// arrays of function pointers - they look like function prototypes +-void ( ( * const OSEKOStaskStartAddress [10] ) ( void ) ); +-StatusType (* OSEKOStaskStatuses [10][5]) ( void ); +- +-void OSEKOSV850StartContext +-( +- OSEK_TASK (( * const ) ( void )), +- OSEK_U8 * const +-); +-void OSEKOSV850StartContextFromIRQ +-( +- OSEK_TASK (( * const ) ( void )), +- OSEK_U8 * const +-); +- +-void OSEKOSSuspendOSInterrupts(void); +-void OSEKOSResumeOSInterrupts(void); +-void OSEKOSSuspendAllInterrupts(void); +-void OSEKOSResumeAllInterrupts(void); +-void OSEKOScheckSuspendResumeNesting(void); +- +- +-void OSEKOSgetSR(void); +-void OSEKOSEnableInterrupt_intern(int nr); +-void OSEKOSDisableInterrupt_intern(int nr); +diff --git a/components/testframework/libs/cmock/test/system/test_compilation/parsing.h b/components/testframework/libs/cmock/test/system/test_compilation/parsing.h +deleted file mode 100644 +index d4734f4484..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_compilation/parsing.h ++++ /dev/null +@@ -1,89 +0,0 @@ +-/* ========================================== +- CMock Project - Automatic Mock Generation for C +- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-========================================== */ +- +-typedef unsigned short U16; +-typedef signed int int32_t; +- +-/* CMock should handle UTF-8 characters in comments. The world is an awesomely diverse place! */ +-/* my µC Rocks! Open Source, not ©! My language has no Ümlauts! ǺƜǝƧǾɱɛ! */ /**! Illegal: åäö */ +- +-typedef struct _POINT_T +-{ +- int x; +- int y; +-} POINT_T; +- +-// typedef edge case; +-// not ANSI C but it has been done and will break cmock if not handled +-typedef void VOID_TYPE_CRAZINESS; +- +-/* fun parsing & mock generation cases */ +- +-void var_args1(int a, ...); +-void var_args2(int a, int b, ...); +- +-VOID_TYPE_CRAZINESS void_type_craziness1(int, float, double, char, short, long, long int, long long, void*); +-int void_type_craziness2( VOID_TYPE_CRAZINESS ); +- +- void crazy_whitespace ( int lint, double shot , short stack ) ; +- +-char +- crazy_multiline +-( +- int a, +- unsigned int b); +- +-U16 *ptr_return1(int a); +-U16* ptr_return2(int a); +-U16 * ptr_return3(int a); +- +-unsigned int** ptr_ptr_return1(unsigned int** a); +-unsigned int* *ptr_ptr_return2(unsigned int* *a); +-unsigned int **ptr_ptr_return3(unsigned int **a); +-unsigned int ** ptr_ptr_return4(unsigned int ** a); +- +-extern unsigned long int incredible_descriptors(register const unsigned short a); +- +-int32_t example_c99_type(int32_t param1); +- +-void I2CIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)); +- +-/* these are function pointers, not function declarations USING a function pointer, and so should NOT get mocked */ +-int (* func_pointer)(void); +-extern int (*another_func_pointer)(unsigned int argument); +-struct struct_to_be_ignored { +- union { +- int i32; +- void *p; +- } variant; +- void (*a_function_pointer_in_a_struct)(void *); +-}; +- +-typedef struct +-{ +- uint32_t a; +- struct +- { +- uint32_t bb; +- float bc; +- float bd; +- } b; +- int (*another_function_pointer_in_a_struct) (void); +-} another_thing_that_should_get_ignored; +- +-inline int stuff(int num) +-{ +- int reg = 0x12; +- if (num > 0) +- { +- reg |= (0x0Eu); +- } +- else +- { +- reg |= (0x07u); +- } +- return reg; +-} +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml b/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml +deleted file mode 100644 +index 9349c00f6d..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml ++++ /dev/null +@@ -1,375 +0,0 @@ +---- +-#this test is different than all_plugins_coexist primarily because of these options +-:cmock: +- :enforce_strict_ordering: 1 +- :treat_externs: :include +- :plugins: +- - :array +- - :cexception +- - :ignore +- - :callback +- - :return_thru_ptr +- - :ignore_arg +- - :expect_any_args +- +-:systest: +- :types: | +- typedef struct _POINT_T { +- int x; +- int y; +- } POINT_T; +- +- :mockable: | +- #include "CException.h" +- void foo(POINT_T* a); +- POINT_T* bar(void); +- void fooa(POINT_T a[]); +- void foos(const char * a); +- extern const char* bars(void); +- void no_pointers(int a, const char* b); +- int mixed(int a, int* b, int c); +- void no_args(void); +- +- :source: +- :header: | +- #include "CException.h" +- void function_a(void); +- void function_b(void); +- void function_c(void); +- int function_d(void); +- void function_e(void); +- +- :code: | +- void function_a(void) +- { +- foo(bar()); +- } +- +- void function_b(void) { +- fooa(bar()); +- } +- +- void function_c(void) { +- CEXCEPTION_T e; +- Try { +- foos(bars()); +- } Catch(e) { foos("err"); } +- } +- +- int function_d(void) { +- int test_list[] = { 1, 2, 3, 4, 5 }; +- no_pointers(1, "silly"); +- return mixed(6, test_list, 7); +- } +- +- void function_e(void) { +- foos("Hello"); +- foos("Tuna"); +- foos("Oranges"); +- } +- +- :tests: +- :common: | +- #include "CException.h" +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'handle the situation where we pass nulls to pointers' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we expected nulls to pointers but did not get that' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(NULL); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we did not expect nulls to pointers but got null' +- :code: | +- test() +- { +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(NULL); +- foo_Expect(&ex); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass single object with expect and it is wrong' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 3}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(&ex); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass single object with expect and use array handler' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_ExpectWithArray(&ex, 1); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass single object with expect and use array handler and it is wrong' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 3}; +- bar_ExpectAndReturn(&pt); +- foo_ExpectWithArray(&ex, 1); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass multiple objects with expect and use array handler' +- :code: | +- test() +- { +- POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; +- POINT_T ex[] = {{1, 2}, {3, 4}, {5, 6}}; +- bar_ExpectAndReturn(pt); +- foo_ExpectWithArray(ex, 3); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass multiple objects with expect and use array handler and it is wrong at end' +- :code: | +- test() +- { +- POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; +- POINT_T ex[] = {{1, 2}, {3, 4}, {5, 9}}; +- bar_ExpectAndReturn(pt); +- foo_ExpectWithArray(ex, 3); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass single array element with expect' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(&pt); +- fooa_Expect(&ex); +- +- function_b(); +- } +- +- - :pass: TRUE +- :should: 'handle standard c string as null terminated and not do crappy memory compares of a byte, passing' +- :code: | +- test() +- { +- const char* constretval = "This is a\0 silly string"; +- char* retval = (char*)constretval; +- bars_ExpectAndReturn(retval); +- foos_Expect("This is a\0 wacky string"); +- +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'handle standard c string as null terminated and not do crappy memory compares of a byte, finding failures' +- :code: | +- test() +- { +- const char* constretval = "This is a silly string"; +- char* retval = (char*)constretval; +- bars_ExpectAndReturn(retval); +- foos_Expect("This is a wacky string"); +- +- function_c(); +- } +- +- - :pass: TRUE +- :should: 'handle creating array expects when we have mixed arguments for single object' +- :code: | +- test() +- { +- int expect_list[] = { 1, 9 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectAndReturn(6, expect_list, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: FALSE +- :should: 'handle creating array expects when we have mixed arguments and handle failures for single object' +- :code: | +- test() +- { +- int expect_list[] = { 9, 1 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectAndReturn(6, expect_list, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'handle creating array expects when we have mixed arguments for multiple objects' +- :code: | +- test() +- { +- int expect_list[] = { 1, 2, 3, 4, 6 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: FALSE +- :should: 'handle creating array expects when we have mixed arguments and handle failures for multiple objects' +- :code: | +- test() +- { +- int expect_list[] = { 1, 2, 3, 4, 6 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectWithArrayAndReturn(6, expect_list, 5, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'handle an exception being caught' +- :code: | +- test() +- { +- const char* constretval = "This is a\0 silly string"; +- char* retval = (char*)constretval; +- bars_ExpectAndReturn(retval); +- foos_ExpectAndThrow("This is a\0 wacky string", 55); +- foos_Expect("err"); +- +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'handle an exception being caught but still catch following errors' +- :code: | +- test() +- { +- const char* constretval = "This is a\0 silly string"; +- char* retval = (char*)constretval; +- bars_ExpectAndReturn(retval); +- foos_ExpectAndThrow("This is a\0 wacky string", 55); +- foos_Expect("wrong error"); +- +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'fail strict ordering problems even though we would otherwise have passed' +- :code: | +- test() +- { +- int expect_list[] = { 1, 2, 3, 4, 6 }; +- mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); +- no_pointers_Expect(1, "silly"); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'properly ExpectAnyArgs first function but the other will work properly' +- :code: | +- test() +- { +- int expect_list[] = { 1, 2, 3, 4, 6 }; +- no_pointers_ExpectAnyArgs(); +- mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'properly ExpectAnyArgs last function but the other will work properly' +- :code: | +- test() +- { +- no_pointers_Expect(1, "silly"); +- mixed_ExpectAnyArgsAndReturn(13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'be ok if we ExpectAnyArgs a call each because we are counting calls' +- :code: | +- test() +- { +- foos_ExpectAnyArgs(); +- foos_ExpectAnyArgs(); +- foos_ExpectAnyArgs(); +- +- function_e(); +- } +- +- - :pass: TRUE +- :should: 'be ok if we ExpectAnyArgs and Expect intermixed because we are counting calls' +- :code: | +- test() +- { +- foos_Expect("Hello"); +- foos_ExpectAnyArgs(); +- foos_ExpectAnyArgs(); +- +- function_e(); +- } +- +- - :pass: FALSE +- :should: 'be able to detect Expect problem if we ExpectAnyArgs and Expect intermixed' +- :code: | +- test() +- { +- foos_Expect("Hello"); +- foos_ExpectAnyArgs(); +- foos_Expect("Wrong"); +- +- function_e(); +- } +- +- - :pass: FALSE +- :should: 'fail if we do not ExpectAnyArgs a call once because we are counting calls' +- :code: | +- test() +- { +- foos_ExpectAnyArgs(); +- foos_ExpectAnyArgs(); +- +- function_e(); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_coexist.yml b/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_coexist.yml +deleted file mode 100644 +index f1c4e38a4d..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/all_plugins_coexist.yml ++++ /dev/null +@@ -1,460 +0,0 @@ +---- +-:cmock: +- :enforce_strict_ordering: 1 +- :plugins: +- - :array +- - :cexception +- - :ignore +- - :callback +- - :return_thru_ptr +- - :ignore_arg +- - :expect_any_args +- :callback_after_arg_check: true +- :callback_include_count: false +- :treat_externs: :include +- :treat_inlines: :include +- +-:systest: +- :types: | +- typedef struct _POINT_T { +- int x; +- int y; +- } POINT_T; +- +- :mockable: | +- #include "CException.h" +- extern void foo(POINT_T* a); +- POINT_T* bar(void); +- void fooa(POINT_T a[]); +- void foos(const char * a); +- const char * bars(void); +- void no_pointers(int a, const char* b); +- int mixed(int a, int* b, int c); +- void no_args(void); +- +- :source: +- :header: | +- #include "CException.h" +- void function_a(void); +- void function_b(void); +- void function_c(void); +- int function_d(void); +- void function_e(void); +- int function_f(void); +- +- :code: | +- void function_a(void) +- { +- foo(bar()); +- } +- +- void function_b(void) { +- fooa(bar()); +- } +- +- void function_c(void) { +- CEXCEPTION_T e; +- Try { +- foos(bars()); +- } Catch(e) { foos("err"); } +- } +- +- int function_d(void) { +- int test_list[] = { 1, 2, 3, 4, 5 }; +- no_pointers(1, "silly"); +- return mixed(6, test_list, 7); +- } +- +- void function_e(void) { +- foos("Hello"); +- foos("Tuna"); +- foos("Oranges"); +- } +- +- int function_f(void) { +- int a = 1; +- int b = 2; +- int c; +- POINT_T* pt = bar(); +- c = pt->x; +- c = mixed(a, &b, c); +- return b + c; +- } +- +- :tests: +- :common: | +- #include "CException.h" +- void setUp(void) {} +- void tearDown(void) {} +- void my_foo_callback(POINT_T* a) { TEST_ASSERT_EQUAL_INT(2, a->x); } +- int my_mixed_callback(int a, int* b, int c) { return a + *b + c; } +- +- :units: +- - :pass: TRUE +- :should: 'handle the situation where we pass nulls to pointers' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we expected nulls to pointers but did not get that' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(NULL); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we did not expect nulls to pointers but got null' +- :code: | +- test() +- { +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(NULL); +- foo_Expect(&ex); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass single object with expect and it is wrong' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 3}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(&ex); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass single object with expect and use array handler' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_ExpectWithArray(&ex, 1); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass single object with expect and use array handler and it is wrong' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 3}; +- bar_ExpectAndReturn(&pt); +- foo_ExpectWithArray(&ex, 1); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass multiple objects with expect and use array handler' +- :code: | +- test() +- { +- POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; +- POINT_T ex[] = {{1, 2}, {3, 4}, {5, 6}}; +- bar_ExpectAndReturn(pt); +- foo_ExpectWithArray(ex, 3); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass multiple objects with expect and use array handler and it is wrong at end' +- :code: | +- test() +- { +- POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; +- POINT_T ex[] = {{1, 2}, {3, 4}, {5, 9}}; +- bar_ExpectAndReturn(pt); +- foo_ExpectWithArray(ex, 3); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass single array element with expect' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(&pt); +- fooa_Expect(&ex); +- +- function_b(); +- } +- +- - :pass: TRUE +- :should: 'handle standard c string as null terminated and not do crappy memory compares of a byte, passing' +- :code: | +- test() +- { +- const char* retval = "This is a\0 silly string"; +- bars_ExpectAndReturn((char*)retval); +- foos_Expect("This is a\0 wacky string"); +- +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'handle standard c string as null terminated and not do crappy memory compares of a byte, finding failures' +- :code: | +- test() +- { +- const char* retval = "This is a silly string"; +- bars_ExpectAndReturn((char*)retval); +- foos_Expect("This is a wacky string"); +- +- function_c(); +- } +- +- - :pass: TRUE +- :should: 'handle creating array expects when we have mixed arguments for single object' +- :code: | +- test() +- { +- int expect_list[] = { 1, 9 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectAndReturn(6, expect_list, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: FALSE +- :should: 'handle creating array expects when we have mixed arguments and handle failures for single object' +- :code: | +- test() +- { +- int expect_list[] = { 9, 1 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectAndReturn(6, expect_list, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'handle creating array expects when we have mixed arguments for multiple objects' +- :code: | +- test() +- { +- int expect_list[] = { 1, 2, 3, 4, 6 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: FALSE +- :should: 'handle creating array expects when we have mixed arguments and handle failures for multiple objects' +- :code: | +- test() +- { +- int expect_list[] = { 1, 2, 3, 4, 6 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectWithArrayAndReturn(6, expect_list, 5, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'handle an exception being caught' +- :code: | +- test() +- { +- const char* retval = "This is a\0 silly string"; +- bars_ExpectAndReturn((char*)retval); +- foos_ExpectAndThrow("This is a\0 wacky string", 55); +- foos_Expect("err"); +- +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'handle an exception being caught but still catch following errors' +- :code: | +- test() +- { +- const char* retval = "This is a\0 silly string"; +- bars_ExpectAndReturn((char*)retval); +- foos_ExpectAndThrow("This is a\0 wacky string", 55); +- foos_Expect("wrong error"); +- +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'fail strict ordering problems even though we would otherwise have passed' +- :code: | +- test() +- { +- int expect_list[] = { 1, 2, 3, 4, 6 }; +- mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); +- no_pointers_Expect(1, "silly"); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'that we can properly ignore last function but the other will work properly' +- :code: | +- test() +- { +- int expect_list[] = { 1, 2, 3, 4, 6 }; +- mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); +- no_pointers_Ignore(); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'that we can properly ignore first function but the other will work properly' +- :code: | +- test() +- { +- mixed_IgnoreAndReturn(13); +- no_pointers_Expect(1, "silly"); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'that we just have to ignore a call once because we are not counting calls' +- :code: | +- test() +- { +- foos_Ignore(); +- +- function_e(); +- } +- +- - :pass: TRUE +- :should: 'that we can use a callback and an expect' +- :code: | +- test() +- { +- POINT_T pt1 = {2, 3}; +- POINT_T pt2 = {2, 3}; +- bar_ExpectAndReturn(&pt1); +- foo_Expect(&pt2); +- foo_StubWithCallback((CMOCK_foo_CALLBACK)my_foo_callback); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'that we can fail even when using a callback if we want to expect call but did not and we are checking that' +- :code: | +- test() +- { +- POINT_T pt = {2, 3}; +- bar_ExpectAndReturn(&pt); +- foo_StubWithCallback((CMOCK_foo_CALLBACK)my_foo_callback); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'that we can fail even when using a callback if args are wrong and we are checking those' +- :code: | +- test() +- { +- POINT_T pt1 = {2, 3}; +- POINT_T pt2 = {1, 3}; +- bar_ExpectAndReturn(&pt1); +- foo_Expect(&pt2); +- foo_StubWithCallback((CMOCK_foo_CALLBACK)my_foo_callback); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'that we can fail from the callback itself' +- :code: | +- test() +- { +- POINT_T pt = {3, 3}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(&pt); +- foo_StubWithCallback((CMOCK_foo_CALLBACK)my_foo_callback); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'that a callback return value overrides the one from ExpectAndReturn' +- :code: | +- test() +- { +- int b = 2; +- POINT_T pt1 = {3, 4}; +- bar_ExpectAndReturn(&pt1); +- mixed_StubWithCallback((CMOCK_mixed_CALLBACK)my_mixed_callback); +- mixed_ExpectAndReturn(1,&b,3,100); +- +- TEST_ASSERT_EQUAL(8, function_f()); +- } +- +- - :pass: TRUE +- :should: 'that a callback return value overrides the one from ExpectAndReturn AND ReturnThruPtr still works' +- :code: | +- test() +- { +- int b_in = 2; +- int b_out = 3; +- POINT_T pt1 = {3, 4}; +- bar_ExpectAndReturn(&pt1); +- mixed_StubWithCallback((CMOCK_mixed_CALLBACK)my_mixed_callback); +- mixed_ExpectAndReturn(1,&b_in,3,100); +- mixed_ReturnThruPtr_b(&b_out); +- +- TEST_ASSERT_EQUAL(9, function_f()); // (a=1, bin=2, c=pt.x=3, bout=3, sum=9) +- } +- +- - :pass: TRUE +- :should: 'that a callback return value overrides the one from ExpectAnyArgs' +- :code: | +- test() +- { +- POINT_T pt1 = {5, 4}; +- bar_ExpectAndReturn(&pt1); +- mixed_StubWithCallback((CMOCK_mixed_CALLBACK)my_mixed_callback); +- mixed_ExpectAnyArgsAndReturn(100); +- +- TEST_ASSERT_EQUAL(10, function_f()); // (a=1, bin=2, c=pt.x=5, bout=2, sum=10) +- } +- +- - :pass: TRUE +- :should: 'that a callback return value overrides the one from ExpectAnyArgs AND ReturnThruPtr still works' +- :code: | +- test() +- { +- int b_out = 3; +- POINT_T pt1 = {5, 4}; +- bar_ExpectAndReturn(&pt1); +- mixed_StubWithCallback((CMOCK_mixed_CALLBACK)my_mixed_callback); +- mixed_ExpectAnyArgsAndReturn(100); +- mixed_ReturnThruPtr_b(&b_out); +- +- TEST_ASSERT_EQUAL(11, function_f()); // (a=1, bin=2, c=pt.x=5, bout=3, sum=11) +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/array_and_pointer_handling.yml b/components/testframework/libs/cmock/test/system/test_interactions/array_and_pointer_handling.yml +deleted file mode 100644 +index ce89287419..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/array_and_pointer_handling.yml ++++ /dev/null +@@ -1,446 +0,0 @@ +---- +-:cmock: +- :when_ptr: :smart +- :plugins: +- - :array +- +-:systest: +- :types: | +- typedef struct _POINT_T { +- int x; +- int y; +- } POINT_T; +- #define ARRAY_A_SIZE (5) +- +- :mockable: | +- void foo(POINT_T* a); +- POINT_T* bar(void); +- void fooa(POINT_T a[ARRAY_A_SIZE+1-1]); +- void foos(const char * a); +- const char * bars(void); +- void no_pointers(int a, const char* b); +- int mixed(int a, int* b, int c); +- void potential_packing_problem(short *a); +- void voidpointerfunc(void* a); +- +- :source: +- :header: | +- void function_a(void); +- void function_b(void); +- void function_c(void); +- int function_d(void); +- void function_e(void); +- void function_f(void); +- +- :code: | +- void function_a(void) +- { +- foo(bar()); +- } +- +- void function_b(void) { +- fooa(bar()); +- } +- +- void function_c(void) { +- foos(bars()); +- } +- +- int function_d(void) { +- int test_list[] = { 1, 2, 3, 4, 5 }; +- no_pointers(1, "silly"); +- return mixed(6, test_list, 7); +- } +- +- void function_e(void) { +- short test_list[] = {-1, -2, -3, -4}; +- potential_packing_problem(&test_list[1]); +- } +- +- void function_f(void) { +- char arg[6] = "hello"; +- voidpointerfunc(arg); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'handle the situation where we pass nulls to pointers' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we expected nulls to pointers but did not get that' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(NULL); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we did not expect nulls to pointers but got null' +- :code: | +- test() +- { +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(NULL); +- foo_Expect(&ex); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where it falls back to pointers because you asked it to compare 0 elements' +- :code: | +- test() +- { +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(&ex); +- foo_ExpectWithArray(&ex, 0); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where it fails because you asked it to compare zero elements and the pointers do not match' +- :code: | +- test() +- { +- POINT_T ex = {1, 2}; +- POINT_T pt = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_ExpectWithArray(&ex, 0); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass single object with expect' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(&ex); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass single object with expect and it is wrong' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 3}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(&ex); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass single object with expect and use array handler' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_ExpectWithArray(&ex, 1); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass single object with expect and use array handler and it is wrong' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 3}; +- bar_ExpectAndReturn(&pt); +- foo_ExpectWithArray(&ex, 1); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass multiple objects with expect and use array handler' +- :code: | +- test() +- { +- POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; +- POINT_T ex[] = {{1, 2}, {3, 4}, {5, 6}}; +- bar_ExpectAndReturn(pt); +- foo_ExpectWithArray(ex, 3); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass multiple objects with expect and use array handler and it is wrong at start' +- :code: | +- test() +- { +- POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; +- POINT_T ex[] = {{9, 2}, {3, 4}, {5, 6}}; +- bar_ExpectAndReturn(pt); +- foo_ExpectWithArray(ex, 3); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass multiple objects with expect and use array handler and it is wrong at end' +- :code: | +- test() +- { +- POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; +- POINT_T ex[] = {{1, 2}, {3, 4}, {5, 9}}; +- bar_ExpectAndReturn(pt); +- foo_ExpectWithArray(ex, 3); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass multiple objects with expect and use array handler and it is wrong in middle' +- :code: | +- test() +- { +- POINT_T pt[] = {{1, 2}, {3, 4}, {5, 6}}; +- POINT_T ex[] = {{1, 2}, {3, 9}, {5, 6}}; +- bar_ExpectAndReturn(pt); +- foo_ExpectWithArray(ex, 3); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass nulls to pointers and fail' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(NULL); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass nulls to arrays' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- fooa_Expect(NULL); +- +- function_b(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass single array element with expect' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(&pt); +- fooa_Expect(&ex); +- +- function_b(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass single array element with expect and it is wrong' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 3}; +- bar_ExpectAndReturn(&pt); +- fooa_Expect(&ex); +- +- function_b(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass nulls to arrays and fail' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- bar_ExpectAndReturn(&pt); +- fooa_Expect(NULL); +- +- function_b(); +- } +- +- - :pass: TRUE +- :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, passing' +- :code: | +- test() +- { +- const char* retval = "This is a\0 silly string"; +- bars_ExpectAndReturn((char*)retval); +- foos_Expect("This is a\0 wacky string"); +- +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, finding failures' +- :code: | +- test() +- { +- const char* retval = "This is a silly string"; +- bars_ExpectAndReturn((char*)retval); +- foos_Expect("This is a wacky string"); +- +- function_c(); +- } +- +- - :pass: TRUE +- :should: 'handle creating array expects when we have mixed arguments for single object' +- :code: | +- test() +- { +- int expect_list[] = { 1, 9 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectAndReturn(6, expect_list, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: FALSE +- :should: 'handle creating array expects when we have mixed arguments and handle failures for single object' +- :code: | +- test() +- { +- int expect_list[] = { 9, 1 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectAndReturn(6, expect_list, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'handle creating array expects when we have mixed arguments for multiple objects' +- :code: | +- test() +- { +- int expect_list[] = { 1, 2, 3, 4, 6 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectWithArrayAndReturn(6, expect_list, 4, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: FALSE +- :should: 'handle creating array expects when we have mixed arguments and handle failures for multiple objects' +- :code: | +- test() +- { +- int expect_list[] = { 1, 2, 3, 4, 6 }; +- no_pointers_Expect(1, "silly"); +- mixed_ExpectWithArrayAndReturn(6, expect_list, 5, 7, 13); +- +- TEST_ASSERT_EQUAL(13, function_d()); +- } +- +- - :pass: TRUE +- :should: 'handle a passing version of a potential packing problem (particularly try with ARM simulators)' +- :code: | +- test() +- { +- short expect_list[] = { -2, -3, -4 }; +- potential_packing_problem_ExpectWithArray(expect_list, 3); +- +- function_e(); +- } +- +- - :pass: FALSE +- :should: 'handle a failing version of a potential packing problem (particularly try with ARM simulators)' +- :code: | +- test() +- { +- short expect_list[] = { -2, -3, 4 }; +- potential_packing_problem_ExpectWithArray(expect_list, 3); +- +- function_e(); +- } +- +- - :pass: TRUE +- :should: 'handle a void pointers as arguments and still be able to use the array plugin' +- :code: | +- test() +- { +- char expect_list[6] = "hello"; +- voidpointerfunc_ExpectWithArray(expect_list, 5); +- +- function_f(); +- } +- +- - :pass: TRUE +- :should: 'handle a void pointers as arguments and still be able to use the array plugin (short)' +- :code: | +- test() +- { +- char expect_list[6] = "help!"; +- voidpointerfunc_ExpectWithArray(expect_list, 3); +- +- function_f(); +- } +- +- - :pass: FALSE +- :should: 'handle a void pointers as arguments and still be able to use the array plugin (fail)' +- :code: | +- test() +- { +- char expect_list[6] = "help!"; +- voidpointerfunc_ExpectWithArray(expect_list, 4); +- +- function_f(); +- } +- +- - :pass: TRUE +- :should: 'handle a void pointer with a standard expectation (pass)' +- :code: | +- test() +- { +- char expect_list[2] = "h"; +- voidpointerfunc_Expect(expect_list); +- +- function_f(); +- } +- +- - :pass: FALSE +- :should: 'handle a void pointer with a standard expectation (fail)' +- :code: | +- test() +- { +- char expect_list[2] = "g"; +- voidpointerfunc_Expect(expect_list); +- +- function_f(); +- } +- +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/basic_expect_and_return.yml b/components/testframework/libs/cmock/test/system/test_interactions/basic_expect_and_return.yml +deleted file mode 100644 +index 38d4edff4f..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/basic_expect_and_return.yml ++++ /dev/null +@@ -1,124 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # none +- +-:systest: +- :types: | +- #define UINT32 unsigned int +- +- typedef signed int custom_type; +- +- :mockable: | +- UINT32 foo(custom_type a); +- UINT32 bar(custom_type b); +- UINT32 foo_varargs(custom_type a, ...); +- const char* foo_char_strings(const char a[], const char* b); +- +- :source: +- :header: | +- UINT32 function_a(int a, int b); +- void function_b(void); +- UINT32 function_c(int a); +- const char* function_d(const char a[], const char* b); +- +- :code: | +- UINT32 function_a(int a, int b) +- { +- return foo((custom_type)a) + bar((custom_type)b); +- } +- +- void function_b(void) { } +- +- UINT32 function_c(int a) +- { +- return foo_varargs((custom_type)a, "ignored", 5); +- } +- +- const char* function_d(const char a[], const char* b) +- { +- return foo_char_strings(a, b); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'successfully exercise two simple ExpectAndReturn mock calls' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- bar_ExpectAndReturn((custom_type)2, 20); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- } +- +- - :pass: FALSE +- :should: 'fail because bar() is not called but is expected' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- } +- +- - :pass: FALSE +- :should: 'fail because bar() is called but is not expected' +- :code: | +- test() +- { +- bar_ExpectAndReturn((custom_type)1, 10); +- function_b(); +- } +- +- - :pass: TRUE +- :should: 'consume var args passed to mocked function' +- :code: | +- test() +- { +- foo_varargs_ExpectAndReturn((custom_type)3, 10); +- TEST_ASSERT_EQUAL(10, function_c(3)); +- } +- +- - :pass: TRUE +- :should: 'handle char strings' +- :code: | +- test() +- { +- const char* retval = "moe"; +- foo_char_strings_ExpectAndReturn("larry", "curly", (char*)retval); +- TEST_ASSERT_EQUAL_STRING("moe", function_d("larry", "curly")); +- } +- +- - :pass: TRUE +- :should: 'successfully exercise multiple cycles of expecting and mocking and pass' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- bar_ExpectAndReturn((custom_type)2, 20); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- +- foo_ExpectAndReturn((custom_type)3, 30); +- bar_ExpectAndReturn((custom_type)4, 40); +- TEST_ASSERT_EQUAL(70, function_a(3, 4)); +- } +- +- - :pass: FALSE +- :should: 'successfully exercise multiple cycles of expecting and mocking and fail' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- bar_ExpectAndReturn((custom_type)2, 20); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- +- foo_ExpectAndReturn((custom_type)3, 30); +- bar_ExpectAndReturn((custom_type)4, 40); +- TEST_ASSERT_EQUAL(70, function_a(3, 5)); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/const_primitives_handling.yml b/components/testframework/libs/cmock/test/system/test_interactions/const_primitives_handling.yml +deleted file mode 100644 +index 2fc1b21323..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/const_primitives_handling.yml ++++ /dev/null +@@ -1,87 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # none +- +-:systest: +- :types: | +- +- :mockable: | +- // no argument names +- void foo(char const*, char* const, const char*); +- +- // argument names +- void bar(char const* param1, char* const param2, const char* param3); +- +- :source: +- :header: | +- void exercise_const1(char const* param1, char* const param2, const char* param3); +- void exercise_const2(char const* param1, char* const param2, const char* param3); +- +- :code: | +- char value1 = '1'; +- char value2 = '2'; +- +- const char* A = &value1; +- char* const B = &value2; +- const char* C = "C"; +- const char* D = "D"; +- +- void exercise_const1(char const* param1, char* const param2, const char* param3) +- { +- foo(param1, param2, param3); +- } +- +- void exercise_const2(char const* param1, char* const param2, const char* param3) +- { +- bar(param1, param2, param3); +- } +- +- :tests: +- :common: | +- extern const char* A; +- extern char* const B; +- extern const char* C; +- extern const char* D; +- +- void setUp(void) {} +- void tearDown(void) {} +- :units: +- - :pass: TRUE +- :should: 'successfully pass several const parameters' +- :code: | +- test() +- { +- foo_Expect( A, B, C ); +- exercise_const1( A, B, C ); +- } +- +- - :pass: FALSE +- :should: 'should fail upon wrong const arguments passed' +- :code: | +- test() +- { +- foo_Expect( A, B, C ); +- exercise_const1( (const char*)B, (char * const)A, C ); +- } +- +- - :pass: FALSE +- :should: 'should fail upon wrong const arguments passed' +- :code: | +- test() +- { +- foo_Expect( A, B, C ); +- exercise_const1( A, B, D ); +- } +- +- - :pass: FALSE +- :should: 'should fail upon wrong const arguments passed' +- :code: | +- test() +- { +- bar_Expect( A, B, C ); +- exercise_const2( A, (char * const)C, (const char *)B ); +- } +- +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/doesnt_leave_details_behind.yml b/components/testframework/libs/cmock/test/system/test_interactions/doesnt_leave_details_behind.yml +deleted file mode 100644 +index a077839e1f..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/doesnt_leave_details_behind.yml ++++ /dev/null +@@ -1,308 +0,0 @@ +---- +-:cmock: +- :enforce_strict_ordering: 1 +- :plugins: +- - :array +- - :cexception +- - :ignore +- - :callback +- - :return_thru_ptr +- - :ignore_arg +- - :expect_any_args +- :callback_after_arg_check: false +- :callback_include_count: false +- :treat_externs: :include +- +-:systest: +- :types: | +- typedef struct _POINT_T { +- int x; +- int y; +- } POINT_T; +- +- :mockable: | +- #include "CException.h" +- extern void foo(POINT_T* a); +- POINT_T* bar(void); +- void no_args(void); +- +- :source: +- :header: | +- #include "CException.h" +- void function_a(void); +- int function_b(void); +- +- :code: | +- void function_a(void) +- { +- foo(bar()); +- no_args(); +- } +- +- int function_b(void) +- { +- POINT_T pt = { 1, 2 }; +- foo(&pt); +- return (pt.x + pt.y); +- } +- +- :tests: +- :common: | +- #include "CException.h" +- void setUp(void) {} +- void tearDown(void) {} +- void my_foo_callback(POINT_T* a) { TEST_ASSERT_EQUAL_INT(2, a->x); } +- +- :units: +- - :pass: TRUE +- :should: 'just pass if we do not insert anything ugly into it' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- no_args_Expect(); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after an expect and return' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- foo_Expect(NULL); +- no_args_Expect(); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after an expect' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- no_args_Expect(); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after throw expectation' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- CEXCEPTION_T e; +- +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- no_args_ExpectAndThrow(5); +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- +- Try { function_a(); } Catch(e) {} +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after a mock call' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- no_args_Expect(); +- +- function_a(); +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after throw' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- CEXCEPTION_T e; +- +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- no_args_ExpectAndThrow(5); +- +- Try { function_a(); } Catch(e) {} +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after ignore' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- no_args_Ignore(); +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after ignored mock' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- no_args_Ignore(); +- +- function_a(); +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after callback setup' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- POINT_T pt = { 2, 2 }; +- bar_ExpectAndReturn(&pt); +- foo_StubWithCallback(my_foo_callback); +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- +- no_args_Expect(); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after mock with callback' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- POINT_T pt = { 2, 2 }; +- bar_ExpectAndReturn(&pt); +- foo_StubWithCallback(my_foo_callback); +- no_args_Expect(); +- +- function_a(); +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after expect any args' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- POINT_T pt = { 2, 2 }; +- bar_ExpectAndReturn(&pt); +- foo_ExpectAnyArgs(); +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- +- no_args_Expect(); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after mock which expected any args' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- POINT_T pt = { 2, 2 }; +- bar_ExpectAndReturn(&pt); +- foo_ExpectAnyArgs(); +- no_args_Expect(); +- +- function_a(); +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after ignored arg' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- POINT_T pt = { 2, 2 }; +- bar_ExpectAndReturn(&pt); +- foo_Expect(NULL); +- foo_IgnoreArg_a(); +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- +- no_args_Expect(); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after mock which ignored an arg' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- POINT_T pt = { 2, 2 }; +- bar_ExpectAndReturn(&pt); +- foo_Expect(NULL); +- foo_IgnoreArg_a(); +- no_args_Expect(); +- +- function_a(); +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after mock which threw a CException' +- :verify_error: 'FAIL: Expected 1 Was 2. CustomFail' +- :code: | +- test() +- { +- CEXCEPTION_T e; +- bar_ExpectAndThrow(0x12); +- +- Try { +- function_a(); +- } +- Catch(e) {} +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail"); +- } +- +- - :pass: FALSE +- :should: 'not contain mock details in failed assertion after mock which used a return thru ptr' +- :verify_error: 'FAIL: Expected 3 Was 7. CustomFail' +- :code: | +- test() +- { +- POINT_T pt1 = { 1, 2 }; +- POINT_T pt2 = { 3, 4 }; +- +- foo_Expect(&pt1); +- foo_ReturnThruPtr_a(&pt2); +- +- TEST_ASSERT_EQUAL_INT_MESSAGE(3, function_b(), "CustomFail"); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/enforce_strict_ordering.yml b/components/testframework/libs/cmock/test/system/test_interactions/enforce_strict_ordering.yml +deleted file mode 100644 +index 7d777a4ecb..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/enforce_strict_ordering.yml ++++ /dev/null +@@ -1,247 +0,0 @@ +---- +-:cmock: +- :enforce_strict_ordering: 1 +- :plugins: +- - :ignore +- - :cexception +- +-:systest: +- :types: | +- #define UINT32 unsigned int +- +- typedef signed int custom_type; +- +- :mockable: | +- #include "CException.h" +- UINT32 foo(custom_type a); +- UINT32 bar(custom_type b); +- void baz(custom_type c); +- +- :source: +- :header: | +- #include "CException.h" +- UINT32 function_a(int a, int b); +- void function_b(void); +- void function_c(void); +- void function_d(void); +- +- :code: | +- UINT32 function_a(int a, int b) +- { +- return foo((custom_type)a) + bar((custom_type)b); +- } +- +- void function_b(void) +- { +- baz((custom_type)1); +- foo((custom_type)2); +- bar((custom_type)3); +- baz((custom_type)4); +- foo((custom_type)5); +- bar((custom_type)6); +- baz((custom_type)7); +- } +- +- void function_c(void) +- { +- foo((custom_type)1); +- foo((custom_type)2); +- bar((custom_type)3); +- bar((custom_type)4); +- foo((custom_type)5); +- } +- +- void function_d(void) +- { +- CEXCEPTION_T e; +- Try +- { +- foo((custom_type)1); +- } +- Catch(e) {} +- Try +- { +- bar((custom_type)2); +- } +- Catch(e) {} +- Try +- { +- foo((custom_type)3); +- } +- Catch(e) {} +- } +- +- :tests: +- :common: | +- #include "CException.h" +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'successfully exercise two simple ExpectAndReturn mock calls' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- bar_ExpectAndReturn((custom_type)2, 20); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- } +- +- - :pass: FALSE +- :should: 'fail because bar() is called but is not expected' +- :verify_error: 'Called more times than expected' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- } +- +- - :pass: FALSE +- :should: 'fail because bar() is called twice but is expected once' +- :verify_error: 'Called fewer times than expected' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- bar_ExpectAndReturn((custom_type)2, 20); +- bar_ExpectAndReturn((custom_type)3, 30); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- } +- +- - :pass: FALSE +- :should: 'fail because bar and foo called in reverse order' +- :verify_error: 'Called earlier than expected' +- :code: | +- test() +- { +- bar_ExpectAndReturn((custom_type)2, 20); +- foo_ExpectAndReturn((custom_type)1, 10); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- } +- +- - :pass: TRUE +- :should: 'pass because bar and foo called in order with multiple params' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- foo_ExpectAndReturn((custom_type)2, 10); +- bar_ExpectAndReturn((custom_type)3, 20); +- bar_ExpectAndReturn((custom_type)4, 10); +- foo_ExpectAndReturn((custom_type)5, 10); +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'fail because bar and foo called out of order at end' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- foo_ExpectAndReturn((custom_type)2, 10); +- bar_ExpectAndReturn((custom_type)3, 20); +- foo_ExpectAndReturn((custom_type)5, 10); +- bar_ExpectAndReturn((custom_type)4, 10); +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'fail because bar and foo called out of order at start' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)2, 10); +- foo_ExpectAndReturn((custom_type)1, 10); +- bar_ExpectAndReturn((custom_type)3, 20); +- bar_ExpectAndReturn((custom_type)4, 10); +- foo_ExpectAndReturn((custom_type)5, 10); +- function_c(); +- } +- +- - :pass: TRUE +- :should: 'pass because we are properly ignoring baz' +- :code: | +- test() +- { +- baz_Ignore(); +- foo_ExpectAndReturn((custom_type)2, 10); +- bar_ExpectAndReturn((custom_type)3, 20); +- foo_ExpectAndReturn((custom_type)5, 10); +- bar_ExpectAndReturn((custom_type)6, 10); +- function_b(); +- } +- +- - :pass: FALSE +- :should: 'fail because bar and foo out of order, even though baz is ignored' +- :code: | +- test() +- { +- baz_Ignore(); +- foo_ExpectAndReturn((custom_type)2, 10); +- foo_ExpectAndReturn((custom_type)5, 10); +- bar_ExpectAndReturn((custom_type)3, 20); +- bar_ExpectAndReturn((custom_type)6, 10); +- function_b(); +- } +- +- - :pass: TRUE +- :should: 'pass when using cexception, as long as the order is right' +- :code: | +- test() +- { +- foo_ExpectAndThrow((custom_type)1, 10); +- bar_ExpectAndReturn((custom_type)2, 20); +- foo_ExpectAndReturn((custom_type)3, 10); +- function_d(); +- } +- +- - :pass: FALSE +- :should: 'fail when an throw call is made out of order' +- :code: | +- test() +- { +- bar_ExpectAndReturn((custom_type)2, 20); +- foo_ExpectAndThrow((custom_type)1, 10); +- foo_ExpectAndReturn((custom_type)3, 10); +- function_d(); +- } +- +- - :pass: TRUE +- :should: 'successfully handle back to back ExpectAndReturn setup and mock calls' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- bar_ExpectAndReturn((custom_type)2, 20); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- +- foo_ExpectAndReturn((custom_type)3, 30); +- bar_ExpectAndReturn((custom_type)4, 40); +- TEST_ASSERT_EQUAL(70, function_a(3, 4)); +- +- foo_ExpectAndReturn((custom_type)1, 50); +- bar_ExpectAndReturn((custom_type)9, 60); +- TEST_ASSERT_EQUAL(110, function_a(1, 9)); +- } +- +- - :pass: FALSE +- :should: 'successfully catch errors during back to back ExpectAndReturn setup and mock calls' +- :verify_error: 'Called earlier than expected' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- bar_ExpectAndReturn((custom_type)2, 20); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- +- foo_ExpectAndReturn((custom_type)3, 30); +- bar_ExpectAndReturn((custom_type)4, 40); +- TEST_ASSERT_EQUAL(70, function_a(3, 4)); +- +- bar_ExpectAndReturn((custom_type)9, 60); +- foo_ExpectAndReturn((custom_type)1, 50); +- TEST_ASSERT_EQUAL(110, function_a(1, 9)); +- } +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_custom_types.yml b/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_custom_types.yml +deleted file mode 100644 +index 5d9d44678d..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_custom_types.yml ++++ /dev/null +@@ -1,108 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # none +- :memcmp_if_unknown: false +- :unity_helper_path: expect_and_return_custom_types_unity_helper.h +- +-:systest: +- :types: | +- typedef struct _EXAMPLE_STRUCT_T { int x; int y; } EXAMPLE_STRUCT_T; +- +- :mockable: | +- EXAMPLE_STRUCT_T foo(EXAMPLE_STRUCT_T a); +- +- :source: +- :header: | +- EXAMPLE_STRUCT_T function_a(EXAMPLE_STRUCT_T a, EXAMPLE_STRUCT_T b); +- EXAMPLE_STRUCT_T function_b(EXAMPLE_STRUCT_T a, EXAMPLE_STRUCT_T b); +- +- :code: | +- EXAMPLE_STRUCT_T function_a(EXAMPLE_STRUCT_T a, EXAMPLE_STRUCT_T b) +- { +- EXAMPLE_STRUCT_T retval = foo(a); +- retval.x += b.x; +- retval.y += b.y; +- return retval; +- } +- +- EXAMPLE_STRUCT_T function_b(EXAMPLE_STRUCT_T a, EXAMPLE_STRUCT_T b) +- { +- EXAMPLE_STRUCT_T retval = foo(b); +- retval.x *= a.x; +- retval.y *= a.y; +- return retval; +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'successfully exercise simple ExpectAndReturn mock calls' +- :code: | +- test() +- { +- EXAMPLE_STRUCT_T c = {1,2}; +- EXAMPLE_STRUCT_T d = {3,4}; +- EXAMPLE_STRUCT_T e = {2,4}; +- EXAMPLE_STRUCT_T f = {5,8}; +- foo_ExpectAndReturn(c, e); +- TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(f, function_a(c,d)); +- } +- +- - :pass: FALSE +- :should: 'fail because it is expecting to call foo with c not d' +- :code: | +- test() +- { +- EXAMPLE_STRUCT_T c = {1,2}; +- EXAMPLE_STRUCT_T d = {3,4}; +- EXAMPLE_STRUCT_T e = {2,4}; +- EXAMPLE_STRUCT_T f = {5,8}; +- foo_ExpectAndReturn(d, e); +- TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(f, function_a(c,d)); +- } +- +- - :pass: TRUE +- :should: 'successfully exercise simple ExpectAndReturn mock calls on other function' +- :code: | +- test() +- { +- EXAMPLE_STRUCT_T c = {1,2}; +- EXAMPLE_STRUCT_T d = {3,4}; +- EXAMPLE_STRUCT_T e = {2,4}; +- EXAMPLE_STRUCT_T f = {2,8}; +- foo_ExpectAndReturn(d, e); +- TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(f, function_b(c,d)); +- } +- +- - :pass: FALSE +- :should: 'fail because it is expecting to call foo with d not c' +- :code: | +- test() +- { +- EXAMPLE_STRUCT_T c = {1,2}; +- EXAMPLE_STRUCT_T d = {3,4}; +- EXAMPLE_STRUCT_T e = {2,4}; +- EXAMPLE_STRUCT_T f = {2,8}; +- foo_ExpectAndReturn(c, e); +- TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(f, function_b(c,d)); +- } +- +- :unity_helper: +- :header: | +- void AssertEqualExampleStruct(EXAMPLE_STRUCT_T expected, EXAMPLE_STRUCT_T actual, unsigned short line); +- #define UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, line, message) {AssertEqualExampleStruct(expected, actual, (unsigned short)line);} +- #define TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual) UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, __LINE__, NULL); +- +- :code: | +- void AssertEqualExampleStruct(EXAMPLE_STRUCT_T expected, EXAMPLE_STRUCT_T actual, unsigned short line) +- { +- UNITY_TEST_ASSERT_EQUAL_INT(expected.x, actual.x, line, "Example Struct Failed For Field x"); +- UNITY_TEST_ASSERT_EQUAL_INT(expected.y, actual.y, line, "Example Struct Failed For Field y"); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_treat_as.yml b/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_treat_as.yml +deleted file mode 100644 +index 2c24f35d82..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_return_treat_as.yml ++++ /dev/null +@@ -1,173 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # none +- :treat_as: +- MY_STRING: STRING +- MY_INT: INT +- PTR_INT: INT* +- MY_HEX: HEX32 +- +-:systest: +- :types: | +- typedef const char* MY_STRING; +- typedef int MY_INT; +- typedef unsigned int MY_HEX; +- typedef int* PTR_INT; +- +- :mockable: | +- MY_INT foo(MY_HEX a); +- MY_INT bar(MY_HEX b); +- MY_STRING foo_char_strings(MY_STRING a, MY_STRING b); +- float float_adder(float a, float b); +- MY_INT* pointer_foo(MY_HEX* a); +- void pointer_bar(PTR_INT a); +- +- :source: +- :header: | +- MY_INT function_a(MY_INT a, MY_INT b); +- MY_STRING function_b(MY_STRING a, MY_STRING b); +- float function_c(float a, float b); +- MY_INT function_d(MY_HEX a); +- void function_e(PTR_INT a); +- +- :code: | +- MY_INT function_a(MY_INT a, MY_INT b) +- { +- return foo((MY_HEX)a) + bar((MY_HEX)b); +- } +- +- MY_STRING function_b(MY_STRING a, MY_STRING b) +- { +- return foo_char_strings(a, b); +- } +- +- float function_c(float a, float b) +- { +- return float_adder(b, a); +- } +- +- MY_INT function_d(MY_HEX a) +- { +- MY_HEX b = a; +- MY_INT* c = pointer_foo(&b); +- return *c; +- } +- +- void function_e(PTR_INT a) +- { +- pointer_bar(a); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'successfully exercise two simple ExpectAndReturn mock calls' +- :code: | +- test() +- { +- foo_ExpectAndReturn((MY_HEX)1, 10); +- bar_ExpectAndReturn((MY_HEX)2, 20); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- } +- +- - :pass: FALSE +- :should: 'fail because bar() is expected but not called' +- :code: | +- test() +- { +- foo_ExpectAndReturn((MY_HEX)1, 10); +- TEST_ASSERT_EQUAL(30, function_a(1, 2)); +- } +- +- - :pass: FALSE +- :should: 'fail because foo_char_strings() is called but is not expected' +- :code: | +- test() +- { +- foo_char_strings_ExpectAndReturn((MY_STRING)"jello", (MY_STRING)"jiggle", (MY_STRING)"boing!"); +- function_a(1,2); +- } +- +- - :pass: TRUE +- :should: 'handle char strings' +- :code: | +- test() +- { +- foo_char_strings_ExpectAndReturn((MY_STRING)"jello", (MY_STRING)"jiggle", (MY_STRING)"boing!"); +- TEST_ASSERT_EQUAL_STRING("boing!", function_b((MY_STRING)"jello", (MY_STRING)"jiggle")); +- } +- +- - :pass: TRUE +- :should: 'handle floating point numbers with Unity support: pass' +- :code: | +- test() +- { +- float_adder_ExpectAndReturn(1.2345f, 6.7890f, 8.0235f); +- TEST_ASSERT_EQUAL_FLOAT(8.0235f, function_c(6.7890f, 1.2345f)); +- } +- +- - :pass: FALSE +- :should: 'handle floating point numbers with Unity support: fail' +- :code: | +- test() +- { +- float_adder_ExpectAndReturn(1.2345f, 6.7892f, 8.0235f); +- TEST_ASSERT_EQUAL_FLOAT(8.0235f, function_c(6.7890f, 1.2345f)); +- } +- +- - :pass: TRUE +- :should: 'handle pointers to treat_as values just as cleanly as the treat_as itself for passes' +- :code: | +- test() +- { +- MY_HEX TestHex = (MY_HEX)45; +- MY_INT TestInt = (MY_INT)33; +- pointer_foo_ExpectAndReturn(&TestHex, &TestInt); +- TEST_ASSERT_EQUAL_INT(33, function_d(45)); +- } +- +- - :pass: FALSE +- :should: 'handle pointers to treat_as values just as cleanly as the treat_as itself for failures' +- :verify_error: 'Element 0 Expected 0x0000002D Was 0x0000002B' +- :code: | +- test() +- { +- MY_HEX TestHex = (MY_HEX)45; +- MY_INT TestInt = (MY_INT)33; +- pointer_foo_ExpectAndReturn(&TestHex, &TestInt); +- TEST_ASSERT_EQUAL_INT(33, function_d(43)); +- } +- +- - :pass: TRUE +- :should: 'handle treat_as values containing pointers for passes' +- :code: | +- test() +- { +- MY_INT ExpInt = (MY_INT)33; +- PTR_INT ExpPtr = (PTR_INT)(&ExpInt); +- MY_INT ActInt = (MY_INT)33; +- PTR_INT ActPtr = (PTR_INT)(&ActInt); +- pointer_bar_Expect(ExpPtr); +- function_e(ActPtr); +- } +- +- - :pass: FALSE +- :should: 'handle treat_as values containing pointers for failures' +- :verify_error: 'Element 0 Expected 33 Was 45' +- :code: | +- test() +- { +- MY_INT ExpInt = (MY_INT)33; +- PTR_INT ExpPtr = (PTR_INT)(&ExpInt); +- MY_INT ActInt = (MY_INT)45; +- PTR_INT ActPtr = (PTR_INT)(&ActInt); +- pointer_bar_Expect(ExpPtr); +- function_e(ActPtr); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_throw.yml b/components/testframework/libs/cmock/test/system/test_interactions/expect_and_throw.yml +deleted file mode 100644 +index c22524c644..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/expect_and_throw.yml ++++ /dev/null +@@ -1,170 +0,0 @@ +---- +-:cmock: +- :plugins: +- - :cexception +- +-:systest: +- :types: | +- #define UINT32 unsigned int +- typedef signed int custom_type; +- +- :mockable: | +- #include "CException.h" +- UINT32 foo(custom_type a); +- UINT32 bar(custom_type b); +- UINT32 foo_varargs(custom_type a, ...); +- +- :source: +- :header: | +- #include "CException.h" +- UINT32 function_a(int a); +- void function_b(char a); +- +- :code: | +- UINT32 function_a(int a) +- { +- UINT32 r = 0; +- CEXCEPTION_T e; +- +- Try +- { +- r = (UINT32)foo((custom_type)a); +- } +- Catch(e) +- { +- r = (UINT32)e*2; +- } +- return r; +- } +- +- void function_b(char a) +- { +- if (a) +- { +- Throw((CEXCEPTION_T)a); +- } +- } +- +- :tests: +- :common: | +- #include "CException.h" +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'successfully exercise a simple ExpectAndReturn mock calls' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- TEST_ASSERT_EQUAL(10, function_a(1)); +- } +- +- - :pass: TRUE +- :should: 'successfully throw an error on first call' +- :code: | +- test() +- { +- foo_ExpectAndThrow((custom_type)1, 55); +- TEST_ASSERT_EQUAL(110, function_a(1)); +- } +- +- - :pass: TRUE +- :should: 'successfully throw an error on later calls' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- foo_ExpectAndReturn((custom_type)2, 20); +- foo_ExpectAndThrow((custom_type)3, 15); +- foo_ExpectAndReturn((custom_type)4, 40); +- TEST_ASSERT_EQUAL(10, function_a(1)); +- TEST_ASSERT_EQUAL(20, function_a(2)); +- TEST_ASSERT_EQUAL(30, function_a(3)); +- TEST_ASSERT_EQUAL(40, function_a(4)); +- } +- +- - :pass: TRUE +- :should: 'pass because we nothing happens' +- :code: | +- test() +- { +- function_b(0); +- } +- +- - :pass: FALSE +- :should: 'fail because we did not expect function B to throw' +- :code: | +- test() +- { +- function_b(1); +- } +- +- - :pass: TRUE +- :should: 'fail because we expect function B to throw' +- :code: | +- test() +- { +- CEXCEPTION_T e; +- Try +- { +- function_b(3); +- TEST_FAIL_MESSAGE("Should Have Thrown"); +- } +- Catch(e) +- { +- TEST_ASSERT_EQUAL(3, e); +- } +- } +- +- - :pass: TRUE +- :should: 'successfully throw an error on consecutive calls' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- foo_ExpectAndReturn((custom_type)1, 20); +- foo_ExpectAndThrow((custom_type)1, 15); +- foo_ExpectAndThrow((custom_type)3, 40); +- TEST_ASSERT_EQUAL(10, function_a(1)); +- TEST_ASSERT_EQUAL(20, function_a(1)); +- TEST_ASSERT_EQUAL(30, function_a(1)); +- TEST_ASSERT_EQUAL(80, function_a(3)); +- } +- +- - :pass: TRUE +- :should: 'successfully throw an error on later calls and after a previous mock call' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- foo_ExpectAndReturn((custom_type)1, 20); +- foo_ExpectAndThrow((custom_type)1, 15); +- TEST_ASSERT_EQUAL(10, function_a(1)); +- TEST_ASSERT_EQUAL(20, function_a(1)); +- TEST_ASSERT_EQUAL(30, function_a(1)); +- +- foo_ExpectAndReturn((custom_type)2, 20); +- foo_ExpectAndThrow((custom_type)3, 40); +- TEST_ASSERT_EQUAL(20, function_a(2)); +- TEST_ASSERT_EQUAL(80, function_a(3)); +- } +- +- - :pass: TRUE +- :should: 'successfully throw an error if expects and mocks called before it' +- :code: | +- test() +- { +- foo_ExpectAndReturn((custom_type)1, 10); +- foo_ExpectAndReturn((custom_type)1, 20); +- TEST_ASSERT_EQUAL(10, function_a(1)); +- TEST_ASSERT_EQUAL(20, function_a(1)); +- +- foo_ExpectAndReturn((custom_type)2, 20); +- foo_ExpectAndThrow((custom_type)3, 40); +- TEST_ASSERT_EQUAL(20, function_a(2)); +- TEST_ASSERT_EQUAL(80, function_a(3)); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/expect_any_args.yml b/components/testframework/libs/cmock/test/system/test_interactions/expect_any_args.yml +deleted file mode 100644 +index 06eb6bb278..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/expect_any_args.yml ++++ /dev/null +@@ -1,238 +0,0 @@ +---- +-:cmock: +- :plugins: +- - 'expect_any_args' +- +-:systest: +- :types: | +- +- :mockable: | +- int foo(int a); +- void bar(int b); +- +- :source: +- :header: | +- int function(int a, int b, int c); +- void func_b(int a); +- :code: | +- int function(int a, int b, int c) +- { +- bar(b); +- return foo(a) + foo(b) + foo(c); +- } +- void func_b(int a) +- { +- bar(a); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- :units: +- - :pass: TRUE +- :should: 'successfully exercise simple ExpectAndReturn mock calls' +- :code: | +- test() +- { +- bar_Expect(2); +- foo_ExpectAndReturn(1, 10); +- foo_ExpectAndReturn(2, 20); +- foo_ExpectAndReturn(3, 30); +- TEST_ASSERT_EQUAL(60, function(1, 2, 3)); +- } +- +- - :pass: TRUE +- :should: 'ignore foo() call details' +- :code: | +- test() +- { +- bar_Expect(4); +- foo_ExpectAnyArgsAndReturn(10); +- foo_ExpectAnyArgsAndReturn(40); +- foo_ExpectAnyArgsAndReturn(80); +- TEST_ASSERT_EQUAL(130, function(3, 4, 3)); +- } +- +- - :pass: FALSE +- :should: 'ignore foo() call details and notice if we called foo() more times than expected' +- :code: | +- test() +- { +- bar_Expect(4); +- foo_ExpectAnyArgsAndReturn(20); +- foo_ExpectAnyArgsAndReturn(30); +- TEST_ASSERT_EQUAL(50, function(3, 4, 9)); +- } +- +- - :pass: FALSE +- :should: 'ignore foo() call details and notice if we called foo() fewer times than expected' +- :code: | +- test() +- { +- bar_Expect(4); +- foo_ExpectAnyArgsAndReturn(20); +- foo_ExpectAnyArgsAndReturn(10); +- foo_ExpectAnyArgsAndReturn(50); +- foo_ExpectAnyArgsAndReturn(60); +- TEST_ASSERT_EQUAL(70, function(3, 4, 9)); +- } +- +- - :pass: TRUE +- :should: 'ignore bar() and foo() call details' +- :code: | +- test() +- { +- bar_ExpectAnyArgs(); +- foo_ExpectAnyArgsAndReturn(50); +- foo_ExpectAnyArgsAndReturn(50); +- foo_ExpectAnyArgsAndReturn(50); +- TEST_ASSERT_EQUAL(150, function(0, 0, 0)); +- } +- +- - :pass: TRUE +- :should: 'be able to handle an expect after ignore calls since we are ignoring args only' +- :code: | +- test() +- { +- bar_ExpectAnyArgs(); +- foo_ExpectAnyArgsAndReturn(50); +- foo_ExpectAnyArgsAndReturn(50); +- foo_ExpectAndReturn(3, 50); +- TEST_ASSERT_EQUAL(150, function(1, 2, 3)); +- } +- +- - :pass: TRUE +- :should: 'be able to handle an ignore after an expect call since we are ignoring args only' +- :code: | +- test() +- { +- bar_ExpectAnyArgs(); +- foo_ExpectAndReturn(1, 50); +- foo_ExpectAnyArgsAndReturn(50); +- foo_ExpectAnyArgsAndReturn(50); +- TEST_ASSERT_EQUAL(150, function(1, 2, 3)); +- } +- +- - :pass: TRUE +- :should: 'be able to handle an ignore within expect calls since we are ignoring args only' +- :code: | +- test() +- { +- bar_ExpectAnyArgs(); +- foo_ExpectAndReturn(1, 50); +- foo_ExpectAnyArgsAndReturn(50); +- foo_ExpectAndReturn(3, 50); +- TEST_ASSERT_EQUAL(150, function(1, 2, 3)); +- } +- +- - :pass: FALSE +- :should: 'be able to detect problems with an expect even when using ignores' +- :code: | +- test() +- { +- bar_ExpectAnyArgs(); +- foo_ExpectAndReturn(1, 50); +- foo_ExpectAnyArgsAndReturn(50); +- foo_ExpectAndReturn(4, 50); +- TEST_ASSERT_EQUAL(150, function(1, 2, 3)); +- } +- +- - :pass: TRUE +- :should: 'be able to handle a lone ExpectAnyArg call' +- :code: | +- test() +- { +- bar_ExpectAnyArgs(); +- func_b(1); +- } +- +- - :pass: FALSE +- :should: 'be able to handle a lone ExpectAnyArg call that does not get called' +- :code: | +- test() +- { +- bar_ExpectAnyArgs(); +- } +- +- - :pass: FALSE +- :should: 'be able to handle a missing ExpectAnyArg call' +- :code: | +- test() +- { +- func_b(1); +- } +- +- - :pass: TRUE +- :should: 'ignore foo() calls over multiple mock calls' +- :code: | +- test() +- { +- bar_ExpectAnyArgs(); +- foo_ExpectAnyArgsAndReturn(50); +- foo_ExpectAnyArgsAndReturn(60); +- foo_ExpectAnyArgsAndReturn(70); +- TEST_ASSERT_EQUAL(180, function(0, 0, 0)); +- +- bar_ExpectAnyArgs(); +- foo_ExpectAnyArgsAndReturn(30); +- foo_ExpectAnyArgsAndReturn(80); +- foo_ExpectAnyArgsAndReturn(10); +- TEST_ASSERT_EQUAL(120, function(0, 0, 0)); +- +- bar_ExpectAnyArgs(); +- foo_ExpectAnyArgsAndReturn(70); +- foo_ExpectAnyArgsAndReturn(20); +- foo_ExpectAnyArgsAndReturn(20); +- TEST_ASSERT_EQUAL(110, function(0, 0, 0)); +- } +- +- - :pass: TRUE +- :should: 'have multiple cycles of expects still pass when this plugin enabled' +- :code: | +- test() +- { +- bar_Expect(2); +- foo_ExpectAndReturn(1, 50); +- foo_ExpectAndReturn(2, 60); +- foo_ExpectAndReturn(3, 70); +- TEST_ASSERT_EQUAL(180, function(1, 2, 3)); +- +- bar_Expect(5); +- foo_ExpectAndReturn(4, 30); +- foo_ExpectAndReturn(5, 80); +- foo_ExpectAndReturn(6, 10); +- TEST_ASSERT_EQUAL(120, function(4, 5, 6)); +- +- bar_Expect(8); +- foo_ExpectAndReturn(7, 70); +- foo_ExpectAndReturn(8, 20); +- foo_ExpectAndReturn(9, 20); +- TEST_ASSERT_EQUAL(110, function(7, 8, 9)); +- } +- +- - :pass: FALSE +- :should: 'have multiple cycles of expects still fail when this plugin enabled' +- :code: | +- test() +- { +- bar_Expect(2); +- foo_ExpectAndReturn(1, 50); +- foo_ExpectAndReturn(2, 60); +- foo_ExpectAndReturn(3, 70); +- TEST_ASSERT_EQUAL(180, function(1, 2, 3)); +- +- bar_Expect(5); +- foo_ExpectAndReturn(4, 30); +- foo_ExpectAndReturn(5, 80); +- foo_ExpectAndReturn(6, 10); +- TEST_ASSERT_EQUAL(120, function(4, 5, 6)); +- +- bar_Expect(8); +- foo_ExpectAndReturn(7, 70); +- foo_ExpectAndReturn(8, 20); +- foo_ExpectAndReturn(9, 20); +- TEST_ASSERT_EQUAL(110, function(0, 8, 9)); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/fancy_pointer_handling.yml b/components/testframework/libs/cmock/test/system/test_interactions/fancy_pointer_handling.yml +deleted file mode 100644 +index 2a47d23f7a..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/fancy_pointer_handling.yml ++++ /dev/null +@@ -1,210 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # none +- :treat_as: +- INT_PTR: INT* +- +-:systest: +- :types: | +- typedef struct _POINT_T { +- int x; +- int y; +- } POINT_T; +- typedef int* INT_PTR; +- +- :mockable: | +- void foo(POINT_T* a); +- POINT_T* bar(void); +- void fooa(POINT_T a[]); +- void foos(const char *a); +- const char* bars(void); +- INT_PTR zoink(INT_PTR a); +- +- :source: +- :header: | +- void function_a(void); +- void function_b(void); +- void function_c(void); +- int function_d(void); +- +- :code: | +- void function_a(void) +- { +- foo(bar()); +- } +- +- void function_b(void) { +- fooa(bar()); +- } +- +- void function_c(void) { +- foos(bars()); +- } +- +- int function_d(void) { +- int i = 456; +- INT_PTR ptr = (INT_PTR)(&i); +- return (int)(*(zoink(ptr))); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'handle the situation where we pass nulls to pointers' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- foo_Expect(NULL); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass single object with expect' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(&ex); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass single object with expect and it is wrong' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 3}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(&ex); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass nulls to pointers and fail' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- bar_ExpectAndReturn(&pt); +- foo_Expect(NULL); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass nulls to arrays' +- :code: | +- test() +- { +- bar_ExpectAndReturn(NULL); +- fooa_Expect(NULL); +- +- function_b(); +- } +- +- - :pass: TRUE +- :should: 'handle the situation where we pass single array element with expect' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 2}; +- bar_ExpectAndReturn(&pt); +- fooa_Expect(&ex); +- +- function_b(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass single array element with expect and it is wrong' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- POINT_T ex = {1, 3}; +- bar_ExpectAndReturn(&pt); +- fooa_Expect(&ex); +- +- function_b(); +- } +- +- - :pass: FALSE +- :should: 'handle the situation where we pass nulls to arrays and fail' +- :code: | +- test() +- { +- POINT_T pt = {1, 2}; +- bar_ExpectAndReturn(&pt); +- fooa_Expect(NULL); +- +- function_b(); +- } +- +- - :pass: TRUE +- :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, passing' +- :code: | +- test() +- { +- const char* retval = "This is a\0 silly string"; +- bars_ExpectAndReturn((char*)retval); +- foos_Expect("This is a\0 wacky string"); +- +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, finding failures' +- :code: | +- test() +- { +- const char* retval = "This is a silly string"; +- bars_ExpectAndReturn((char*)retval); +- foos_Expect("This is a wacky string"); +- +- function_c(); +- } +- +- - :pass: TRUE +- :should: 'handle handle typedefs that ARE pointers by using treat_as' +- :code: | +- test() +- { +- int e = 456; +- int r = 789; +- INT_PTR ptr_e = (INT_PTR)(&e); +- INT_PTR ptr_r = (INT_PTR)(&r); +- +- zoink_ExpectAndReturn(ptr_e, ptr_r); +- +- TEST_ASSERT_EQUAL(r, function_d()); +- } +- +- - :pass: FALSE +- :should: 'handle handle typedefs that ARE pointers by using treat_as and catch failures' +- :code: | +- test() +- { +- int e = 457; +- int r = 789; +- INT_PTR ptr_e = (INT_PTR)(&e); +- INT_PTR ptr_r = (INT_PTR)(&r); +- +- zoink_ExpectAndReturn(ptr_e, ptr_r); +- +- TEST_ASSERT_EQUAL(r, function_d()); +- } +- +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/function_pointer_handling.yml b/components/testframework/libs/cmock/test/system/test_interactions/function_pointer_handling.yml +deleted file mode 100644 +index d286bdb257..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/function_pointer_handling.yml ++++ /dev/null +@@ -1,83 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # none +- :treat_as: +- FUNCTION_T: PTR +- +-:systest: +- :types: | +- typedef void (*FUNCTION_T)(void); +- +- :mockable: | +- void takes_function_type( FUNCTION_T myfunc ); +- void takes_function_ptr( unsigned int (*func_ptr)(int, char) ); +- void takes_function_ptr_shorthand( unsigned int func_ptr(int, char*) ); +- void takes_const_function_ptr( unsigned int (* const)(int, char) ); +- unsigned short (*returns_function_ptr( const char op_code ))( int, long int ); +- +- :source: +- :header: | +- void exercise_function_pointer_param(void); +- unsigned short (*exercise_function_pointer_return( const char op_code ))( int, long int ); +- +- // functions for function pointer tests +- unsigned int dummy_function1(int a, char b); +- unsigned short dummy_function2(int a, long int b); +- +- :code: | +- /* +- * functions used in tests +- */ +- +- unsigned int dummy_function1(int a, char b) +- { +- // prevent compiler warnings by using everything +- return (unsigned int)a + (unsigned int)b; +- } +- +- unsigned short dummy_function2(int a, long int b) +- { +- // prevent compiler warnings by using everything +- return (unsigned short)a + (unsigned short)b; +- } +- +- /* +- * functions executed by tests +- */ +- +- void exercise_function_pointer_param(void) +- { +- takes_function_ptr(dummy_function1); +- } +- +- unsigned short (*exercise_function_pointer_return( const char op_code ))( int, long int ) +- { +- return returns_function_ptr(op_code); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- :units: +- - :pass: TRUE +- :should: 'expect a function pointer param' +- :code: | +- test() +- { +- takes_function_ptr_Expect(dummy_function1); +- exercise_function_pointer_param(); +- } +- +- - :pass: TRUE +- :should: 'return a function pointer' +- :code: | +- test() +- { +- returns_function_ptr_ExpectAndReturn('z', dummy_function2); +- TEST_ASSERT_EQUAL_PTR(dummy_function2, exercise_function_pointer_return('z')); +- } +- +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/ignore_and_return.yml b/components/testframework/libs/cmock/test/system/test_interactions/ignore_and_return.yml +deleted file mode 100644 +index 17f95beefd..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/ignore_and_return.yml ++++ /dev/null +@@ -1,329 +0,0 @@ +---- +-:cmock: +- :plugins: +- - 'ignore' +- +-:systest: +- :types: | +- +- :mockable: | +- int foo(int a); +- void bar(int b); +- +- :source: +- :header: | +- int function(int a, int b, int c); +- :code: | +- int function(int a, int b, int c) +- { +- bar(b); +- return foo(a) + foo(b) + foo(c); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- :units: +- - :pass: TRUE +- :should: 'successfully exercise simple ExpectAndReturn mock calls' +- :code: | +- test() +- { +- bar_Expect(2); +- foo_ExpectAndReturn(1, 10); +- foo_ExpectAndReturn(2, 20); +- foo_ExpectAndReturn(3, 30); +- TEST_ASSERT_EQUAL(60, function(1, 2, 3)); +- } +- +- - :pass: TRUE +- :should: 'ignore foo() calls' +- :code: | +- test() +- { +- bar_Expect(4); +- foo_IgnoreAndReturn(10); +- foo_IgnoreAndReturn(40); +- foo_IgnoreAndReturn(80); +- TEST_ASSERT_EQUAL(130, function(3, 4, 3)); +- } +- +- - :pass: TRUE +- :should: 'ignore the situation where foo() is not called even though we explicitly ignored it' +- :code: | +- test() +- { +- foo_IgnoreAndReturn(20); +- //notice we do not call foo +- } +- +- - :pass: TRUE +- :should: 'ignore foo() calls and always return last item if we run out' +- :code: | +- test() +- { +- bar_Expect(4); +- foo_IgnoreAndReturn(20); +- foo_IgnoreAndReturn(30); +- TEST_ASSERT_EQUAL(80, function(3, 4, 9)); +- } +- +- - :pass: TRUE +- :should: 'ignore foo() calls and always return only item if only one specified' +- :code: | +- test() +- { +- bar_Expect(4); +- foo_IgnoreAndReturn(20); +- TEST_ASSERT_EQUAL(60, function(3, 4, 9)); +- } +- +- - :pass: TRUE +- :should: 'ignore bar() and foo() calls' +- :code: | +- test() +- { +- bar_Ignore(); +- foo_IgnoreAndReturn(50); +- TEST_ASSERT_EQUAL(150, function(0, 0, 0)); +- } +- +- - :pass: TRUE +- :should: 'ignore foo() calls over multiple mock calls' +- :code: | +- test() +- { +- bar_Ignore(); +- foo_IgnoreAndReturn(50); +- foo_IgnoreAndReturn(60); +- foo_IgnoreAndReturn(70); +- TEST_ASSERT_EQUAL(180, function(0, 0, 0)); +- +- bar_Ignore(); +- foo_IgnoreAndReturn(30); +- foo_IgnoreAndReturn(80); +- foo_IgnoreAndReturn(10); +- TEST_ASSERT_EQUAL(120, function(0, 0, 0)); +- +- foo_IgnoreAndReturn(70); +- foo_IgnoreAndReturn(20); +- TEST_ASSERT_EQUAL(110, function(0, 0, 0)); +- } +- +- - :pass: TRUE +- :should: 'multiple cycles of expects still pass when ignores enabled' +- :code: | +- test() +- { +- bar_Expect(2); +- foo_ExpectAndReturn(1, 50); +- foo_ExpectAndReturn(2, 60); +- foo_ExpectAndReturn(3, 70); +- TEST_ASSERT_EQUAL(180, function(1, 2, 3)); +- +- bar_Expect(5); +- foo_ExpectAndReturn(4, 30); +- foo_ExpectAndReturn(5, 80); +- foo_ExpectAndReturn(6, 10); +- TEST_ASSERT_EQUAL(120, function(4, 5, 6)); +- +- bar_Expect(8); +- foo_ExpectAndReturn(7, 70); +- foo_ExpectAndReturn(8, 20); +- foo_ExpectAndReturn(9, 20); +- TEST_ASSERT_EQUAL(110, function(7, 8, 9)); +- } +- +- - :pass: FALSE +- :should: 'multiple cycles of expects still fail when ignores enabled' +- :code: | +- test() +- { +- bar_Expect(2); +- foo_ExpectAndReturn(1, 50); +- foo_ExpectAndReturn(2, 60); +- foo_ExpectAndReturn(3, 70); +- TEST_ASSERT_EQUAL(180, function(1, 2, 3)); +- +- bar_Expect(5); +- foo_ExpectAndReturn(4, 30); +- foo_ExpectAndReturn(5, 80); +- foo_ExpectAndReturn(6, 10); +- TEST_ASSERT_EQUAL(120, function(4, 5, 6)); +- +- bar_Expect(8); +- foo_ExpectAndReturn(7, 70); +- foo_ExpectAndReturn(8, 20); +- foo_ExpectAndReturn(9, 20); +- TEST_ASSERT_EQUAL(110, function(0, 8, 9)); +- } +- +- - :pass: FALSE +- :should: 'With "fail_on_unexpected_calls" enabled, Expect/Ignore/... of bar is required and test fails.' +- :code: | +- test() +- { +- function(1, 2, 3); +- } +- +- - :pass: TRUE +- :should: 'we can override an ignore with an expect and pass' +- :code: | +- test() +- { +- bar_Ignore(); +- +- bar_Expect(2); +- foo_ExpectAndReturn(1, 50); +- foo_ExpectAndReturn(2, 60); +- foo_ExpectAndReturn(3, 70); +- TEST_ASSERT_EQUAL(180, function(1, 2, 3)); +- +- bar_Expect(5); +- foo_ExpectAndReturn(4, 30); +- foo_ExpectAndReturn(5, 80); +- foo_ExpectAndReturn(6, 10); +- TEST_ASSERT_EQUAL(120, function(4, 5, 6)); +- +- bar_Expect(8); +- foo_ExpectAndReturn(7, 70); +- foo_ExpectAndReturn(8, 20); +- foo_ExpectAndReturn(9, 20); +- TEST_ASSERT_EQUAL(110, function(7, 8, 9)); +- } +- +- - :pass: FALSE +- :should: 'we can override an ignore with an expect and fail' +- :code: | +- test() +- { +- bar_Ignore(); +- +- bar_Expect(2); +- foo_ExpectAndReturn(1, 50); +- foo_ExpectAndReturn(2, 60); +- foo_ExpectAndReturn(3, 70); +- TEST_ASSERT_EQUAL(180, function(1, 2, 3)); +- +- bar_Expect(5); +- foo_ExpectAndReturn(4, 30); +- foo_ExpectAndReturn(5, 80); +- foo_ExpectAndReturn(6, 10); +- TEST_ASSERT_EQUAL(120, function(4, 5, 6)); +- +- bar_Expect(9); +- foo_ExpectAndReturn(7, 70); +- foo_ExpectAndReturn(8, 20); +- foo_ExpectAndReturn(9, 20); +- TEST_ASSERT_EQUAL(110, function(7, 8, 9)); +- } +- +- - :pass: TRUE +- :should: 'we can override an ignore and return with an expect and pass' +- :code: | +- test() +- { +- bar_Ignore(); +- foo_IgnoreAndReturn(30); +- TEST_ASSERT_EQUAL(90, function(1, 2, 3)); +- +- bar_Expect(5); +- foo_ExpectAndReturn(4, 30); +- foo_ExpectAndReturn(5, 80); +- foo_ExpectAndReturn(6, 10); +- TEST_ASSERT_EQUAL(120, function(4, 5, 6)); +- +- bar_Expect(8); +- foo_ExpectAndReturn(7, 70); +- foo_ExpectAndReturn(8, 20); +- foo_ExpectAndReturn(9, 20); +- TEST_ASSERT_EQUAL(110, function(7, 8, 9)); +- } +- +- - :pass: FALSE +- :should: 'we can override an ignore and return with an expect and fail' +- :code: | +- test() +- { +- bar_Ignore(); +- foo_IgnoreAndReturn(0); +- TEST_ASSERT_EQUAL(0, function(1, 2, 3)); +- +- bar_Expect(5); +- foo_ExpectAndReturn(4, 30); +- foo_ExpectAndReturn(5, 80); +- foo_ExpectAndReturn(6, 10); +- TEST_ASSERT_EQUAL(120, function(4, 5, 6)); +- +- bar_Expect(9); +- foo_ExpectAndReturn(7, 70); +- foo_ExpectAndReturn(8, 20); +- foo_ExpectAndReturn(9, 20); +- TEST_ASSERT_EQUAL(110, function(7, 8, 9)); +- } +- +- - :pass: TRUE +- :should: 'we can override an an expect with an ignore' +- :code: | +- test() +- { +- bar_Expect(5); +- bar_Ignore(); +- foo_ExpectAndReturn(1, 50); +- foo_ExpectAndReturn(2, 60); +- foo_ExpectAndReturn(3, 70); +- TEST_ASSERT_EQUAL(180, function(1, 2, 3)); +- } +- +- - :pass: TRUE +- :should: 'we can override an expect with an ignore and return and pass' +- :code: | +- test() +- { +- bar_Ignore(); +- foo_IgnoreAndReturn(0); +- TEST_ASSERT_EQUAL(0, function(1, 2, 3)); +- +- bar_Expect(5); +- foo_ExpectAndReturn(4, 30); +- foo_ExpectAndReturn(5, 80); +- foo_IgnoreAndReturn(10); +- TEST_ASSERT_EQUAL(120, function(4, 5, 6)); +- +- bar_Ignore(); +- foo_IgnoreAndReturn(60); +- TEST_ASSERT_EQUAL(180, function(7, 8, 9)); +- } +- +- - :pass: FALSE +- :should: 'we can override an expect with an ignore and return and fail after' +- :code: | +- test() +- { +- bar_Expect(5); +- foo_ExpectAndReturn(4, 30); +- foo_ExpectAndReturn(5, 50); +- foo_IgnoreAndReturn(20); +- TEST_ASSERT_EQUAL(100, function(4, 5, 6)); +- +- bar_Expect(5); +- foo_ExpectAndReturn(9, 30); //THIS ONE WILL FAIL +- foo_ExpectAndReturn(2, 80); +- foo_ExpectAndReturn(3, 60); +- TEST_ASSERT_EQUAL(170, function(1, 2, 3)); +- } +- +- - :pass: TRUE +- :should: 'we can override an expect with an ignore and return and the expected values are ignored' +- :code: | +- test() +- { +- bar_Expect(5); +- foo_ExpectAndReturn(2, 30); //NOTE THIS WOULD NORMALLY FAIL +- foo_ExpectAndReturn(5, 50); +- foo_IgnoreAndReturn(20); //BUT WE SAID WE NO LONGER CARE +- TEST_ASSERT_EQUAL(100, function(4, 5, 6)); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/ignore_strict_mock_calling.yml b/components/testframework/libs/cmock/test/system/test_interactions/ignore_strict_mock_calling.yml +deleted file mode 100644 +index bcfe04c5e2..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/ignore_strict_mock_calling.yml ++++ /dev/null +@@ -1,37 +0,0 @@ +---- +-:cmock: +- :plugins: +- - 'ignore' +- :fail_on_unexpected_calls: FALSE +- +-:systest: +- :types: | +- +- :mockable: | +- int foo(int a); +- void bar(int b); +- +- :source: +- :header: | +- int function(int a, int b, int c); +- :code: | +- int function(int a, int b, int c) +- { +- bar(b); +- return foo(a) + foo(b) + foo(c); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- :units: +- - :pass: TRUE +- :should: 'With "fail_on_unexpected_calls" disabled, Expect/Ignore/... of bar is NOT required.' +- :code: | +- test() +- { +- function(1, 2, 3); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/newer_standards_stuff1.yml b/components/testframework/libs/cmock/test/system/test_interactions/newer_standards_stuff1.yml +deleted file mode 100644 +index 6843eae606..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/newer_standards_stuff1.yml ++++ /dev/null +@@ -1,52 +0,0 @@ +---- +-#The purpose of this test is to pull in some standard library stuff from C99 +-:cmock: +- :includes: +- - "" +- - "" +- +-:systest: +- :types: | +- #include +- #include +- +- +- :mockable: | +- int32_t foo(int32_t a); +- +- :source: +- :header: | +- int8_t function_a(void); +- +- :code: | +- int8_t function_a(void) { +- return (int8_t)(INT_MIN == foo(INT_MAX)); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'handle handle a simple comparison of C99 types which pass' +- :code: | +- test() +- { +- foo_ExpectAndReturn(INT_MAX, INT_MIN); +- +- TEST_ASSERT_TRUE(function_a()); +- } +- +- - :pass: FALSE +- :should: 'handle handle a simple comparison of C99 types which fail' +- :code: | +- test() +- { +- foo_ExpectAndReturn(INT_MIN, INT_MIN); +- +- TEST_ASSERT_TRUE(function_a()); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_1.yml b/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_1.yml +deleted file mode 100644 +index 01538ea329..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_1.yml ++++ /dev/null +@@ -1,91 +0,0 @@ +---- +-#The purpose of this test is to play with things like "const char const *" which isn't supported by some compilers +-:cmock: +- :enforce_strict_ordering: 1 +- :plugins: +- - :array +- - :cexception +- - :ignore +- +-:systest: +- :types: | +- typedef struct _POINT_T { +- int x; +- int y; +- } POINT_T; +- +- :mockable: | +- #include "CException.h" +- void foos(const char const * a); +- const char const * bars(void); +- +- :source: +- :header: | +- #include "CException.h" +- void function_a(void); +- void function_b(void); +- void function_c(void); +- int function_d(void); +- +- :code: | +- void function_c(void) { +- CEXCEPTION_T e; +- Try { +- foos(bars()); +- } Catch(e) { foos("err"); } +- } +- +- :tests: +- :common: | +- #include "CException.h" +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, passing' +- :code: | +- test() +- { +- bars_ExpectAndReturn("This is a\0 silly string"); +- foos_Expect("This is a\0 wacky string"); +- +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, finding failures' +- :code: | +- test() +- { +- bars_ExpectAndReturn("This is a silly string"); +- foos_Expect("This is a wacky string"); +- +- function_c(); +- } +- +- - :pass: TRUE +- :should: 'handle an exception being caught' +- :code: | +- test() +- { +- bars_ExpectAndReturn("This is a\0 silly string"); +- foos_ExpectAndThrow("This is a\0 wacky string", 55); +- foos_Expect("err"); +- +- function_c(); +- } +- +- - :pass: FALSE +- :should: 'handle an exception being caught but still catch following errors' +- :code: | +- test() +- { +- bars_ExpectAndReturn("This is a\0 silly string"); +- foos_ExpectAndThrow("This is a\0 wacky string", 55); +- foos_Expect("wrong error"); +- +- function_c(); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml b/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml +deleted file mode 100644 +index 506e7ee8a1..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml ++++ /dev/null +@@ -1,59 +0,0 @@ +---- +-#The purpose of this test is to play with our really rough multidimensional array support, which involves an implicit cast not supported everywhere +-:cmock: +- :plugins: +- - :array +- +-:systest: +- :types: | +- +- +- :mockable: | +- void foo(unsigned char** a); +- unsigned char** bar(void); +- +- :source: +- :header: | +- void function_a(void); +- +- :code: | +- void function_a(void) { +- foo(bar()); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'handle two dimensional array of unsigned characters just like we would handle a single dimensional array in expect (where we really only care about first element)' +- :code: | +- test() +- { +- unsigned char a[] = { 1, 2, 3, 4, 5, 6 }; +- unsigned char** pa = (unsigned char**)(&a); +- +- bar_ExpectAndReturn(pa); +- foo_Expect(pa); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle two dimensional array of unsigned characters just like we would handle a single dimensional array in expect as failures (where we really only care about first element)' +- :code: | +- test() +- { +- unsigned char a[] = { 1, 2, 3, 4, 5, 6 }; +- unsigned char b[] = { 5, 6, 7, 8, 9, 0 }; +- unsigned char** pa = (unsigned char**)(&a); +- unsigned char** pb = (unsigned char**)(&b); +- +- bar_ExpectAndReturn(pa); +- foo_Expect(pb); +- +- function_a(); +- } +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/out_of_memory.yml b/components/testframework/libs/cmock/test/system/test_interactions/out_of_memory.yml +deleted file mode 100644 +index ed7bed5c1a..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/out_of_memory.yml ++++ /dev/null +@@ -1,65 +0,0 @@ +---- +-:cmock: +- :plugins: [] +- :treat_as: +- custom_type: INT +- +-:systest: +- :types: | +- typedef struct _BIG_FAT_STRUCT_T +- { +- char bytes[512]; +- } BIG_FAT_STRUCT_T; +- +- :mockable: | +- void foo(BIG_FAT_STRUCT_T a); +- +- :source: +- :header: | +- void function_a(void); +- void function_b(void); +- +- :code: | +- void function_a(void) +- { +- BIG_FAT_STRUCT_T stuff = { { 8, 0 } }; +- foo(stuff); +- } +- +- void function_b(void) +- { +- BIG_FAT_STRUCT_T stuff1 = { { 9, 1, 0 } }; +- BIG_FAT_STRUCT_T stuff2 = { { 9, 2, 0 } }; +- foo(stuff1); +- foo(stuff2); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'successfully should be able to run function a because it only takes half the memory' +- :code: | +- test() +- { +- BIG_FAT_STRUCT_T expected = { { 8, 0 } }; +- foo_Expect(expected); +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'should error out because we do not have eough memory to handle two of these structures' +- :code: | +- test() +- { +- BIG_FAT_STRUCT_T expected1 = { { 9, 1, 0 } }; +- BIG_FAT_STRUCT_T expected2 = { { 9, 2, 0 } }; +- foo_Expect(expected1); +- foo_Expect(expected2); +- function_b(); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/parsing_challenges.yml b/components/testframework/libs/cmock/test/system/test_interactions/parsing_challenges.yml +deleted file mode 100644 +index 77e857d869..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/parsing_challenges.yml ++++ /dev/null +@@ -1,242 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # no plugins +- :treat_as_void: +- - VOID_TYPE_CRAZINESS_CFG +- :treat_as: +- TypeDefInt: HEX8 +- VOID_TYPE_CRAZINESS_CFG*: PTR +- +-:systest: +- :types: | +- typedef unsigned short U16; +- typedef struct _POINT_T +- { +- int x; +- int y; +- } POINT_T; +- typedef void VOID_TYPE_CRAZINESS_CFG; +- typedef int TypeDefInt; +- +- :mockable: | +- /* Make sure we ignore the following +- #include "NonExistantFile.h +- */ +- //#include "AndIgnoreThisToo.h" +- #ifdef __cplusplus +- extern "C" { +- #endif +- #define SHOULD_IGNORE_NEXT_FUNC_DEF_AS_PART_OF_MACRO \ +- void IgnoredFunction(NotAValidType ToMakeItFailIfWeActuallyMockedThis); +- +- // typedef edge case; must be in mockable.h for test to compile +- // not ANSI C but it has been done and will break cmock if not handled +- typedef void VOID_TYPE_CRAZINESS_LCL; +- +- VOID_TYPE_CRAZINESS_LCL void_type_craziness1(int * a, int *b, int* c); +- void void_type_craziness2(VOID_TYPE_CRAZINESS_CFG); +- void void_type_craziness3(VOID_TYPE_CRAZINESS_CFG* a); +- +- // pointer parsing exercise +- U16 *ptr_return1(int a); +- U16* ptr_return2(int a); +- U16 * ptr_return3(int a); +- +- unsigned int** ptr_ptr_return1(unsigned int** a); +- unsigned int* *ptr_ptr_return2(unsigned int* *a); +- unsigned int **ptr_ptr_return3(unsigned int **a); +- unsigned int ** ptr_ptr_return4(unsigned int ** a); +- +- // variable argument lists +- void var_args1(int a, ...); +- void var_args2(int a, int b, ...); +- +- // parsing "stress tests" +- char +- crazy_multiline( +- int a, +- unsigned int b); +- +- unsigned long int incredible_descriptors(register const unsigned short a); +- +- TypeDefInt uses_typedef_like_names(TypeDefInt typedefvar); +- +- void oh_brackets1(int fudge[5]); +- void oh_brackets2(int caramel[]); +- void oh_brackets3(int toffee[(32)]); +- void oh_brackets4(int taffy[ (64) ]); +- #ifdef __cplusplus +- } +- #endif +- +- :source: +- :header: | +- U16* exercise_return_pointers(int a); +- void exercise_var_args(int a, int b); +- void exercise_arglist_pointers(void); +- char exercise_multiline_declarations(int a, unsigned int b); +- void exercise_double_pointers(unsigned int** a); +- int exercise_many_descriptors(int a); +- void exercise_type_craziness3(VOID_TYPE_CRAZINESS_CFG* a); +- TypeDefInt exercise_typedef_like_names(TypeDefInt a); +- +- :code: | +- int A, B, C; +- unsigned int *pA, *pB, *pC; +- +- U16* exercise_return_pointers(int a) +- { +- ptr_return1(a); +- ptr_return2(a); +- return ptr_return3(a); +- } +- +- void exercise_var_args(int a, int b) +- { +- var_args1(a, 3); +- var_args2(a, b, 'c'); +- } +- +- void exercise_arglist_pointers(void) +- { +- void_type_craziness1(&A, &B, &C); +- void_type_craziness2(); +- } +- +- char exercise_multiline_declarations(int a, unsigned int b) +- { +- return crazy_multiline(a, b); +- } +- +- void exercise_double_pointers(unsigned int** a) +- { +- ptr_ptr_return1((unsigned int**)a); +- ptr_ptr_return2((unsigned int**)a); +- ptr_ptr_return3((unsigned int**)a); +- ptr_ptr_return4((unsigned int**)a); +- } +- +- int exercise_many_descriptors(int a) +- { +- return (int)incredible_descriptors((unsigned short)a); +- } +- +- void exercise_type_craziness3(VOID_TYPE_CRAZINESS_CFG* a) +- { +- void_type_craziness3(a); +- } +- +- TypeDefInt exercise_typedef_like_names(TypeDefInt a) +- { +- return uses_typedef_like_names(a); +- } +- +- :tests: +- :common: | +- extern int A, B, C; +- extern unsigned int *pA, *pB, *pC; +- +- void setUp(void) +- { +- A = 100; +- B = 200; +- C = 300; +- pA = (unsigned int*)(&A); +- pB = (unsigned int*)(&B); +- pC = (unsigned int*)(&C); +- } +- void tearDown(void) {} +- :units: +- - :pass: TRUE +- :should: 'execute simple pointer return value check' +- :code: | +- test() +- { +- U16 retval; +- ptr_return1_ExpectAndReturn(2, NULL); +- ptr_return2_ExpectAndReturn(2, NULL); +- ptr_return3_ExpectAndReturn(2, &retval); +- TEST_ASSERT_EQUAL_PTR(&retval, exercise_return_pointers(2)); +- } +- +- - :pass: TRUE +- :should: 'ignore var args in expect prototype generation' +- :code: | +- test() +- { +- var_args1_Expect(2); +- var_args2_Expect(2, 3); +- exercise_var_args(2, 3); +- } +- +- - :pass: TRUE +- :should: "not process a typedef'd void as anything other than void" +- :code: | +- test() +- { +- void_type_craziness1_Expect(&A, &B, &C); +- void_type_craziness2_Expect(); +- exercise_arglist_pointers(); +- } +- +- - :pass: TRUE +- :should: 'successfully mock crazy multline function prototypes' +- :code: | +- test() +- { +- crazy_multiline_ExpectAndReturn(-10, 11, 'z'); +- TEST_ASSERT_EQUAL('z', exercise_multiline_declarations(-10, 11)); +- } +- +- - :pass: TRUE +- :should: 'mock double pointers just fine' +- :code: | +- test() +- { +- ptr_ptr_return1_ExpectAndReturn(&pA, &pB); +- ptr_ptr_return2_ExpectAndReturn(&pA, &pB); +- ptr_ptr_return3_ExpectAndReturn(&pA, &pB); +- ptr_ptr_return4_ExpectAndReturn(&pA, &pB); +- exercise_double_pointers((unsigned int**)(&pA)); +- } +- +- - :pass: TRUE +- :should: 'mock prototypes with long lists of return and parameter type descriptors' +- :code: | +- test() +- { +- incredible_descriptors_ExpectAndReturn(888, 777); +- TEST_ASSERT_EQUAL(777, exercise_many_descriptors(888)); +- } +- +- - :pass: TRUE +- :should: 'handle words like typdef as PART of a variable or type' +- :code: | +- test() +- { +- uses_typedef_like_names_ExpectAndReturn((TypeDefInt)54, (TypeDefInt)53); +- TEST_ASSERT_EQUAL(53, exercise_typedef_like_names((TypeDefInt)54)); +- } +- +- - :pass: FALSE +- :should: 'handle words like typdef as PART of a variable or type during failing tests' +- :code: | +- test() +- { +- uses_typedef_like_names_ExpectAndReturn((TypeDefInt)52, (TypeDefInt)53); +- TEST_ASSERT_EQUAL(53, exercise_typedef_like_names((TypeDefInt)54)); +- } +- +- - :pass: TRUE +- :should: 'handle typedef of void used as a void pointer' +- :code: | +- test() +- { +- char blah[5] = "blah"; +- void_type_craziness3_Expect(blah); +- exercise_type_craziness3(blah); +- } +- +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml b/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml +deleted file mode 100644 +index 40e0e7f629..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml ++++ /dev/null +@@ -1,235 +0,0 @@ +---- +-:cmock: +- :mock_path: test/mocks +- :mock_prefix: mock_ +- :treat_as: +- abs_struct: PTR +- intptr: INT* +- :when_ptr: :smart +- :plugins: +- - :array +- - :ignore_arg +- - :return_thru_ptr +- +-:systest: +- :types: | +- typedef int *intptr; +- +- struct a_struct +- { +- int i1; +- int i2; +- int i3; +- }; +- +- struct _abs_struct +- { +- int abs_i1; +- int abs_i2; +- }; +- +- typedef struct _abs_struct abs_struct; +- +- :mockable: | +- void ptr_ret_int(int *r); +- void ptr_ret_ints(int *r, int *s); +- void ptr_ret_array(char r[], int len); +- void ptr_ret_typedef(intptr r); +- void ptr_ret_struct(struct a_struct *r); +- void ptr_ret_abstract(abs_struct *r); +- void ptr_ret_abstract_array(abs_struct *r, int len); +- void ptr_ret_const_int(int *r, const int *s); +- void ptr_ret_string(char *s); +- +- :source: +- :header: | +- #include +- #define lengthof(x) (sizeof(x)/sizeof((x)[0])) +- +- :code: | +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: "handle a single int* argument" +- :code: | +- test() +- { +- int r = 1; +- int res = 4; +- +- ptr_ret_int_Expect(&r); +- ptr_ret_int_ReturnThruPtr_r(&res); +- ptr_ret_int(&r); +- TEST_ASSERT_EQUAL(4, r); +- } +- +- - :pass: TRUE +- :should: "handle multiple calls" +- :code: | +- test() +- { +- int r = 1; +- int res1 = 4; +- int res2 = 8; +- int res3 = 16; +- +- ptr_ret_int_Expect(&r); +- ptr_ret_int_ReturnThruPtr_r(&res1); +- ptr_ret_int_Expect(&r); +- ptr_ret_int_ReturnThruPtr_r(&res2); +- ptr_ret_int_Expect(&r); +- ptr_ret_int_ReturnThruPtr_r(&res3); +- +- ptr_ret_int(&r); +- TEST_ASSERT_EQUAL(4, r); +- ptr_ret_int(&r); +- TEST_ASSERT_EQUAL(8, r); +- ptr_ret_int(&r); +- TEST_ASSERT_EQUAL(16, r); +- +- } +- +- - :pass: TRUE +- :should: "ignore an argument" +- :code: | +- test() +- { +- int r = 1, s = 2; +- int res = 4; +- +- ptr_ret_int_Expect(&r); +- ptr_ret_int_IgnoreArg_r(); +- ptr_ret_int_ReturnThruPtr_r(&res); +- ptr_ret_int(&s); +- TEST_ASSERT_EQUAL(4, s); +- } +- +- - :pass: TRUE +- :should: "ignore a null pointer argument" +- :code: | +- test() +- { +- int r = 1; +- int res = 4; +- +- ptr_ret_int_Expect(NULL); +- ptr_ret_int_IgnoreArg_r(); +- ptr_ret_int_ReturnThruPtr_r(&res); +- ptr_ret_int(&r); +- TEST_ASSERT_EQUAL(4, r); +- } +- +- - :pass: TRUE +- :should: "handle multiple int* arguments" +- :code: | +- test() +- { +- int r, s = 0x0880AA55; +- int r_res = 4; +- int s_res = 6; +- +- ptr_ret_ints_Expect(&r, &s); +- ptr_ret_ints_ReturnThruPtr_r(&r_res); +- ptr_ret_ints_ReturnThruPtr_s(&s_res); +- ptr_ret_ints(&r, &s); +- TEST_ASSERT_EQUAL(4, r); +- TEST_ASSERT_EQUAL(6, s); +- } +- +- - :pass: TRUE +- :should: "only return through pointer when asked to" +- :code: | +- test() +- { +- int r = 0x0880AA55; +- int s = 0xAA55; +- int r_res = 4; +- +- ptr_ret_ints_Expect(&r, &s); +- ptr_ret_ints_ReturnThruPtr_r(&r_res); +- ptr_ret_ints(&r, &s); +- TEST_ASSERT_EQUAL(4, r); +- TEST_ASSERT_EQUAL(0xAA55, s); +- } +- +- - :pass: TRUE +- :should: "return an array through a pointer correctly" +- :code: | +- test() +- { +- char r_a[] = "booboorooboo"; +- char r_a_ret[] = "FEEFI"; +- +- ptr_ret_array_Expect(r_a, lengthof(r_a)); +- ptr_ret_array_ReturnArrayThruPtr_r(r_a_ret, (int)strlen(r_a_ret)); +- ptr_ret_array(r_a, lengthof(r_a)); +- TEST_ASSERT_EQUAL_STRING("FEEFIorooboo", r_a); +- } +- +- - :pass: TRUE +- :should: "handle structs" +- :code: | +- test() +- { +- struct a_struct r_s = { .i1 = 2, .i2 = 3, .i3 = 4, }; +- struct a_struct r_s_ret = { .i1 = 8, .i2 = 16, .i3 = 32, }; +- +- ptr_ret_struct_Expect(&r_s); +- ptr_ret_struct_ReturnThruPtr_r(&r_s_ret); +- ptr_ret_struct(&r_s); +- TEST_ASSERT_EQUAL_MEMORY(&r_s_ret, &r_s, sizeof(struct a_struct)); +- } +- +- - :pass: TRUE +- :should: "handle typedefs" +- :code: | +- test() +- { +- abs_struct r_as = {.abs_i1 = 0x1234, .abs_i2 = 0x4567}; +- abs_struct r_as_ret = {.abs_i1 = 0xFFAA55, .abs_i2 = 0xAAFFAA}; +- ptr_ret_abstract_Expect(&r_as); +- ptr_ret_abstract_ReturnMemThruPtr_r(&r_as_ret, sizeof(abs_struct)); +- ptr_ret_abstract(&r_as); +- TEST_ASSERT_EQUAL_MEMORY(&r_as_ret, &r_as, sizeof(abs_struct)); +- } +- +- - :pass: TRUE +- :should: "only generate ReturnThruPtr definitions for non-const arguments" +- :code: | +- test() +- { +- #if !defined(ptr_ret_const_int_ReturnThruPtr_r) +- TEST_FAIL_MESSAGE("ReturnThruPtr not defined for a pointer argument."); +- #endif +- +- #if defined(ptr_ret_const_int_ReturnThruPtr_s) +- TEST_FAIL_MESSAGE("ReturnThruPtr defined for a const pointer argument."); +- #endif +- } +- +- - :pass: TRUE +- :should: "generate ReturnThruPtr definitions for string arguments" +- :code: | +- test() +- { +- #if !defined(ptr_ret_string_ReturnThruPtr_s) +- TEST_FAIL_MESSAGE("ReturnThruPtr not defined for a string argument."); +- #endif +- } +- +- - :pass: TRUE +- :should: "generate IgnoreArg definitions" +- :code: | +- test() +- { +- #if !defined(ptr_ret_array_IgnoreArg_r) \ +- || !defined(ptr_ret_array_IgnoreArg_len) \ +- || !defined(ptr_ret_const_int_IgnoreArg_s) +- TEST_FAIL_MESSAGE("IgnoreArg not defined for an argument."); +- #endif +- } +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml b/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml +deleted file mode 100644 +index 8b07be9974..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml ++++ /dev/null +@@ -1,231 +0,0 @@ +---- +-:cmock: +- :mock_path: test/mocks +- :mock_prefix: mock_ +- :treat_as: +- abs_struct: PTR +- intptr: INT* +- :when_ptr: :smart +- :plugins: +- - :array +- - :expect_any_args +- - :return_thru_ptr +- +-:systest: +- :types: | +- typedef int *intptr; +- +- struct a_struct +- { +- int i1; +- int i2; +- int i3; +- }; +- +- struct _abs_struct +- { +- int abs_i1; +- int abs_i2; +- }; +- +- typedef struct _abs_struct abs_struct; +- +- :mockable: | +- void ptr_ret_int(int *r); +- void ptr_ret_ints(int *r, int *s); +- void ptr_ret_array(char r[], int len); +- void ptr_ret_typedef(intptr r); +- void ptr_ret_struct(struct a_struct *r); +- void ptr_ret_abstract(abs_struct *r); +- void ptr_ret_abstract_array(abs_struct *r, int len); +- void ptr_ret_const_int(int *r, const int *s); +- void ptr_ret_string(char *s); +- +- :source: +- :header: | +- #include +- #define lengthof(x) (sizeof(x)/sizeof((x)[0])) +- +- :code: | +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: "handle a single int* argument" +- :code: | +- test() +- { +- int r = 1; +- int res = 4; +- +- ptr_ret_int_Expect(&r); +- ptr_ret_int_ReturnThruPtr_r(&res); +- ptr_ret_int(&r); +- TEST_ASSERT_EQUAL(4, r); +- } +- +- - :pass: TRUE +- :should: "handle multiple calls" +- :code: | +- test() +- { +- int r = 1; +- int res1 = 4; +- int res2 = 8; +- int res3 = 16; +- +- ptr_ret_int_Expect(&r); +- ptr_ret_int_ReturnThruPtr_r(&res1); +- ptr_ret_int_Expect(&r); +- ptr_ret_int_ReturnThruPtr_r(&res2); +- ptr_ret_int_Expect(&r); +- ptr_ret_int_ReturnThruPtr_r(&res3); +- +- ptr_ret_int(&r); +- TEST_ASSERT_EQUAL(4, r); +- ptr_ret_int(&r); +- TEST_ASSERT_EQUAL(8, r); +- ptr_ret_int(&r); +- TEST_ASSERT_EQUAL(16, r); +- +- } +- +- - :pass: TRUE +- :should: "ignore an argument" +- :code: | +- test() +- { +- int s = 2; +- int res = 4; +- +- ptr_ret_int_ExpectAnyArgs(); +- ptr_ret_int_ReturnThruPtr_r(&res); +- ptr_ret_int(&s); +- TEST_ASSERT_EQUAL(4, s); +- } +- +- - :pass: TRUE +- :should: "ignore a null pointer argument" +- :code: | +- test() +- { +- int r = 1; +- int res = 4; +- +- ptr_ret_int_ExpectAnyArgs(); +- ptr_ret_int_ReturnThruPtr_r(&res); +- ptr_ret_int(&r); +- TEST_ASSERT_EQUAL(4, r); +- } +- +- - :pass: TRUE +- :should: "handle multiple int* arguments" +- :code: | +- test() +- { +- int r, s = 0x0880AA55; +- int r_res = 4; +- int s_res = 6; +- +- ptr_ret_ints_Expect(&r, &s); +- ptr_ret_ints_ReturnThruPtr_r(&r_res); +- ptr_ret_ints_ReturnThruPtr_s(&s_res); +- ptr_ret_ints(&r, &s); +- TEST_ASSERT_EQUAL(4, r); +- TEST_ASSERT_EQUAL(6, s); +- } +- +- - :pass: TRUE +- :should: "only return through pointer when asked to" +- :code: | +- test() +- { +- int r = 0x0880AA55; +- int s = 0xAA55; +- int r_res = 4; +- +- ptr_ret_ints_Expect(&r, &s); +- ptr_ret_ints_ReturnThruPtr_r(&r_res); +- ptr_ret_ints(&r, &s); +- TEST_ASSERT_EQUAL(4, r); +- TEST_ASSERT_EQUAL(0xAA55, s); +- } +- +- - :pass: TRUE +- :should: "return an array through a pointer correctly" +- :code: | +- test() +- { +- char r_a[] = "booboorooboo"; +- char r_a_ret[] = "FEEFI"; +- +- ptr_ret_array_Expect(r_a, lengthof(r_a)); +- ptr_ret_array_ReturnArrayThruPtr_r(r_a_ret, (int)strlen(r_a_ret)); +- ptr_ret_array(r_a, lengthof(r_a)); +- TEST_ASSERT_EQUAL_STRING("FEEFIorooboo", r_a); +- } +- +- - :pass: TRUE +- :should: "handle structs" +- :code: | +- test() +- { +- struct a_struct r_s = { .i1 = 2, .i2 = 3, .i3 = 4, }; +- struct a_struct r_s_ret = { .i1 = 8, .i2 = 16, .i3 = 32, }; +- +- ptr_ret_struct_Expect(&r_s); +- ptr_ret_struct_ReturnThruPtr_r(&r_s_ret); +- ptr_ret_struct(&r_s); +- TEST_ASSERT_EQUAL_MEMORY(&r_s_ret, &r_s, sizeof(struct a_struct)); +- } +- +- - :pass: TRUE +- :should: "handle typedefs" +- :code: | +- test() +- { +- abs_struct r_as = {.abs_i1 = 0x1234, .abs_i2 = 0x4567}; +- abs_struct r_as_ret = {.abs_i1 = 0xFFAA55, .abs_i2 = 0xAAFFAA}; +- ptr_ret_abstract_Expect(&r_as); +- ptr_ret_abstract_ReturnMemThruPtr_r(&r_as_ret, sizeof(abs_struct)); +- ptr_ret_abstract(&r_as); +- TEST_ASSERT_EQUAL_MEMORY(&r_as_ret, &r_as, sizeof(abs_struct)); +- } +- +- - :pass: TRUE +- :should: "only generate ReturnThruPtr definitions for non-const arguments" +- :code: | +- test() +- { +- #if !defined(ptr_ret_const_int_ReturnThruPtr_r) +- TEST_FAIL_MESSAGE("ReturnThruPtr not defined for a pointer argument."); +- #endif +- +- #if defined(ptr_ret_const_int_ReturnThruPtr_s) +- TEST_FAIL_MESSAGE("ReturnThruPtr defined for a const pointer argument."); +- #endif +- } +- +- - :pass: TRUE +- :should: "generate ReturnThruPtr definitions for string arguments" +- :code: | +- test() +- { +- #if !defined(ptr_ret_string_ReturnThruPtr_s) +- TEST_FAIL_MESSAGE("ReturnThruPtr not defined for a string argument."); +- #endif +- } +- +- - :pass: TRUE +- :should: "generate ExpectAnyArgs definitions" +- :code: | +- test() +- { +- #if !defined(ptr_ret_array_ExpectAnyArgs) +- TEST_FAIL_MESSAGE("ExpectAnyArgs not defined for an argument."); +- #endif +- } +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/skeleton.yml b/components/testframework/libs/cmock/test/system/test_interactions/skeleton.yml +deleted file mode 100644 +index 772080022f..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/skeleton.yml ++++ /dev/null +@@ -1,55 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # none +- :skeleton_path: system/generated +- +-:systest: +- :types: | +- #define UINT32 unsigned int +- +- :mockable: | +- UINT32 something(int a); +- +- :skeleton: skeleton.h +- +- :source: +- :header: | +- void function_a(void); +- int function_b(int a, int b); +- const char* function_c(void); +- +- # we are purposefully not including a :code section because it will be generated with skeleton +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'generate an empty shell for functions with no return values' +- :code: | +- test() +- { +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'return numerical zero for numerical return values' +- :code: | +- test() +- { +- TEST_ASSERT_EQUAL_INT(0, function_b(1, 2)); +- } +- +- - :pass: TRUE +- :should: 'return null for pointer return values' +- :code: | +- test() +- { +- TEST_ASSERT_NULL(function_c()); +- } +- +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/skeleton_update.yml b/components/testframework/libs/cmock/test/system/test_interactions/skeleton_update.yml +deleted file mode 100644 +index 757e8b13db..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/skeleton_update.yml ++++ /dev/null +@@ -1,76 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # none +- :skeleton_path: system/generated +- +-:systest: +- :types: | +- #define UINT32 unsigned int +- +- :mockable: | +- UINT32 something(int a); +- +- :skeleton: skeleton_update.h +- +- :source: +- :header: | +- void function_a(void); +- int function_b(int a, int b); +- const char* function_c(void); +- +- # note that this code section exists and will be updated by the skeleton generator +- :code: | +- const char* donuts = "donuts"; +- const char* function_c(void) +- { +- return donuts; +- } +- +- int function_d(void) +- { +- return 77; +- } +- +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- extern int function_d(); +- +- :units: +- - :pass: TRUE +- :should: 'generate an empty shell for functions with no return values' +- :code: | +- test() +- { +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'return numerical zero for numerical return values' +- :code: | +- test() +- { +- TEST_ASSERT_EQUAL_INT(0, function_b(1, 2)); +- } +- +- - :pass: TRUE +- :should: 'not overwrite functions that already exist' +- :code: | +- test() +- { +- TEST_ASSERT_EQUAL_STRING("donuts", function_c()); +- } +- +- - :pass: TRUE +- :should: 'leave functions it has never heard of' +- :code: | +- test() +- { +- TEST_ASSERT_EQUAL_INT(77, function_d()); +- } +- +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return.yml b/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return.yml +deleted file mode 100644 +index d4cf6af19f..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return.yml ++++ /dev/null +@@ -1,277 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # none +- +-:systest: +- :types: | +- struct THING { int a; int b; }; +- +- union STARS_AND_STRIPES { int a; char b; }; +- +- enum HOKEY_POKEY { IN, OUT, SHAKE_IT_ALL_ABOUT }; +- +- :mockable: | +- void foo_struct(struct THING*, struct THING); +- struct THING foobar_struct(void); +- +- void foo_union(union STARS_AND_STRIPES*, union STARS_AND_STRIPES); +- union STARS_AND_STRIPES foobar_union(void); +- +- void foo_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b); +- enum HOKEY_POKEY foobar_enum(void); +- +- :source: +- :header: | +- void exercise_struct(struct THING* a, struct THING b); +- struct THING return_struct(void); +- +- void exercise_union(union STARS_AND_STRIPES* a, union STARS_AND_STRIPES b); +- union STARS_AND_STRIPES return_union(void); +- +- void exercise_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b); +- enum HOKEY_POKEY return_enum(void); +- +- :code: | +- void exercise_struct(struct THING* a, struct THING b) +- { +- foo_struct(a, b); +- } +- +- struct THING return_struct(void) +- { +- return foobar_struct(); +- } +- +- void exercise_union(union STARS_AND_STRIPES* a, union STARS_AND_STRIPES b) +- { +- foo_union(a, b); +- } +- +- union STARS_AND_STRIPES return_union(void) +- { +- return foobar_union(); +- } +- +- void exercise_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b) +- { +- foo_enum(a, b); +- } +- +- enum HOKEY_POKEY return_enum(void) +- { +- return foobar_enum(); +- } +- +- +- :tests: +- :common: | +- struct THING struct1; +- struct THING struct2; +- struct THING struct3; +- struct THING struct4; +- struct THING struct5; +- struct THING struct6; +- +- union STARS_AND_STRIPES union1; +- union STARS_AND_STRIPES union2; +- union STARS_AND_STRIPES union3; +- union STARS_AND_STRIPES union4; +- union STARS_AND_STRIPES union5; +- union STARS_AND_STRIPES union6; +- +- enum HOKEY_POKEY enum1; +- enum HOKEY_POKEY enum2; +- +- void setUp(void) +- { +- struct1.a = 1; +- struct1.b = 2; +- +- struct2.a = 3; +- struct2.b = 4; +- +- struct3.a = 5; +- struct3.b = 6; +- +- struct4.a = 7; +- struct4.b = 8; +- +- struct5.a = 9; +- struct5.b = 10; +- +- struct6.a = 9; +- struct6.b = 10; +- +- union1.a = 1; +- union2.a = 2; +- union3.a = 3; +- union4.a = 4; +- union5.a = 5; +- union6.a = 5; +- +- enum1 = OUT; +- enum2 = IN; +- } +- +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'successfully compare structs' +- :code: | +- test() +- { +- foo_struct_Expect(&struct1, struct2); +- exercise_struct(&struct1, struct2); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad struct pointer comparison' +- :code: | +- test() +- { +- foo_struct_Expect(&struct1, struct2); +- exercise_struct(&struct3, struct2); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad structure comparison' +- :code: | +- test() +- { +- foo_struct_Expect(&struct1, struct2); +- exercise_struct(&struct1, struct4); +- } +- +- - :pass: TRUE +- :should: 'compare returned structs as equal' +- :code: | +- test() +- { +- foobar_struct_ExpectAndReturn(struct5); +- TEST_ASSERT_EQUAL_THING(struct6, return_struct()); +- } +- +- - :pass: FALSE +- :should: 'compare returned structs as unequal' +- :code: | +- test() +- { +- foobar_struct_ExpectAndReturn(struct4); +- TEST_ASSERT_EQUAL_THING(struct5, return_struct()); +- } +- +- - :pass: TRUE +- :should: 'successfully compare unions' +- :code: | +- test() +- { +- foo_union_Expect(&union1, union2); +- exercise_union(&union1, union2); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad union pointer comparison' +- :code: | +- test() +- { +- foo_union_Expect(&union1, union2); +- exercise_union(&union3, union2); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad union comparison' +- :code: | +- test() +- { +- foo_union_Expect(&union1, union2); +- exercise_union(&union1, union4); +- } +- +- - :pass: TRUE +- :should: 'compare returned unions as equal' +- :code: | +- test() +- { +- foobar_union_ExpectAndReturn(union5); +- TEST_ASSERT_EQUAL_STARS_AND_STRIPES(union6, return_union()); +- } +- +- - :pass: FALSE +- :should: 'compare returned unions as unequal' +- :code: | +- test() +- { +- foobar_union_ExpectAndReturn(union4); +- TEST_ASSERT_EQUAL_STARS_AND_STRIPES(union5, return_union()); +- } +- +- - :pass: TRUE +- :should: 'successfully pass enum values' +- :code: | +- test() +- { +- foo_enum_Expect(OUT, &enum1); +- exercise_enum(OUT, &enum1); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad enum pointer comparison' +- :code: | +- test() +- { +- foo_enum_Expect(IN, &enum1); +- exercise_enum(IN, &enum2); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad enum comparison' +- :code: | +- test() +- { +- foo_enum_Expect(IN, &enum1); +- exercise_enum(SHAKE_IT_ALL_ABOUT, &enum1); +- } +- +- - :pass: TRUE +- :should: 'compare returned enums as equal' +- :code: | +- test() +- { +- foobar_enum_ExpectAndReturn(OUT); +- TEST_ASSERT_EQUAL(OUT, return_enum()); +- } +- +- - :pass: FALSE +- :should: 'compare returned unions as unequal' +- :code: | +- test() +- { +- foobar_enum_ExpectAndReturn(OUT); +- TEST_ASSERT_EQUAL(IN, return_enum()); +- } +- +- +- :unity_helper: +- :header: | +- void AssertEqualTHINGStruct(struct THING expected, struct THING actual); +- void AssertEqualSTARS_AND_STRIPESUnion(union STARS_AND_STRIPES expected, union STARS_AND_STRIPES actual); +- +- #define TEST_ASSERT_EQUAL_THING(expected, actual) {AssertEqualTHINGStruct(expected, actual);} +- #define TEST_ASSERT_EQUAL_STARS_AND_STRIPES(expected, actual) {AssertEqualSTARS_AND_STRIPESUnion(expected, actual);} +- +- :code: | +- void AssertEqualTHINGStruct(struct THING expected, struct THING actual) +- { +- TEST_ASSERT_EQUAL_INT_MESSAGE(expected.a, actual.a, "actual struct member \"a\" does not equal expected"); +- TEST_ASSERT_EQUAL_INT_MESSAGE(expected.b, actual.b, "actual struct member \"b\" does not equal expected"); +- } +- +- void AssertEqualSTARS_AND_STRIPESUnion(union STARS_AND_STRIPES expected, union STARS_AND_STRIPES actual) +- { +- TEST_ASSERT_EQUAL_INT_MESSAGE(expected.a, actual.a, "actual union member \"a\" does not equal expected"); +- TEST_ASSERT_EQUAL_MESSAGE(expected.b, actual.b, "actual union member \"b\" does not equal expected"); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return_with_plugins.yml b/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return_with_plugins.yml +deleted file mode 100644 +index a54826ca44..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/struct_union_enum_expect_and_return_with_plugins.yml ++++ /dev/null +@@ -1,280 +0,0 @@ +---- +-:cmock: +- :plugins: +- - :array +- - :ignore +- - :callback +- - :return_thru_ptr +- +-:systest: +- :types: | +- struct THING { int a; int b; }; +- +- union STARS_AND_STRIPES { int a; char b; }; +- +- enum HOKEY_POKEY { IN, OUT, SHAKE_IT_ALL_ABOUT }; +- +- :mockable: | +- void foo_struct(struct THING*, struct THING); +- struct THING foobar_struct(void); +- +- void foo_union(union STARS_AND_STRIPES*, union STARS_AND_STRIPES); +- union STARS_AND_STRIPES foobar_union(void); +- +- void foo_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b); +- enum HOKEY_POKEY foobar_enum(void); +- +- :source: +- :header: | +- void exercise_struct(struct THING* a, struct THING b); +- struct THING return_struct(void); +- +- void exercise_union(union STARS_AND_STRIPES* a, union STARS_AND_STRIPES b); +- union STARS_AND_STRIPES return_union(void); +- +- void exercise_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b); +- enum HOKEY_POKEY return_enum(void); +- +- :code: | +- void exercise_struct(struct THING* a, struct THING b) +- { +- foo_struct(a, b); +- } +- +- struct THING return_struct(void) +- { +- return foobar_struct(); +- } +- +- void exercise_union(union STARS_AND_STRIPES* a, union STARS_AND_STRIPES b) +- { +- foo_union(a, b); +- } +- +- union STARS_AND_STRIPES return_union(void) +- { +- return foobar_union(); +- } +- +- void exercise_enum(enum HOKEY_POKEY a, enum HOKEY_POKEY * b) +- { +- foo_enum(a, b); +- } +- +- enum HOKEY_POKEY return_enum(void) +- { +- return foobar_enum(); +- } +- +- +- :tests: +- :common: | +- struct THING struct1; +- struct THING struct2; +- struct THING struct3; +- struct THING struct4; +- struct THING struct5; +- struct THING struct6; +- +- union STARS_AND_STRIPES union1; +- union STARS_AND_STRIPES union2; +- union STARS_AND_STRIPES union3; +- union STARS_AND_STRIPES union4; +- union STARS_AND_STRIPES union5; +- union STARS_AND_STRIPES union6; +- +- enum HOKEY_POKEY enum1; +- enum HOKEY_POKEY enum2; +- +- void setUp(void) +- { +- struct1.a = 1; +- struct1.b = 2; +- +- struct2.a = 3; +- struct2.b = 4; +- +- struct3.a = 5; +- struct3.b = 6; +- +- struct4.a = 7; +- struct4.b = 8; +- +- struct5.a = 9; +- struct5.b = 10; +- +- struct6.a = 9; +- struct6.b = 10; +- +- union1.a = 1; +- union2.a = 2; +- union3.a = 3; +- union4.a = 4; +- union5.a = 5; +- union6.a = 5; +- +- enum1 = OUT; +- enum2 = IN; +- } +- +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'successfully compare structs' +- :code: | +- test() +- { +- foo_struct_Expect(&struct1, struct2); +- exercise_struct(&struct1, struct2); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad struct pointer comparison' +- :code: | +- test() +- { +- foo_struct_Expect(&struct1, struct2); +- exercise_struct(&struct3, struct2); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad structure comparison' +- :code: | +- test() +- { +- foo_struct_Expect(&struct1, struct2); +- exercise_struct(&struct1, struct4); +- } +- +- - :pass: TRUE +- :should: 'compare returned structs as equal' +- :code: | +- test() +- { +- foobar_struct_ExpectAndReturn(struct5); +- TEST_ASSERT_EQUAL_THING(struct6, return_struct()); +- } +- +- - :pass: FALSE +- :should: 'compare returned structs as unequal' +- :code: | +- test() +- { +- foobar_struct_ExpectAndReturn(struct4); +- TEST_ASSERT_EQUAL_THING(struct5, return_struct()); +- } +- +- - :pass: TRUE +- :should: 'successfully compare unions' +- :code: | +- test() +- { +- foo_union_Expect(&union1, union2); +- exercise_union(&union1, union2); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad union pointer comparison' +- :code: | +- test() +- { +- foo_union_Expect(&union1, union2); +- exercise_union(&union3, union2); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad union comparison' +- :code: | +- test() +- { +- foo_union_Expect(&union1, union2); +- exercise_union(&union1, union4); +- } +- +- - :pass: TRUE +- :should: 'compare returned unions as equal' +- :code: | +- test() +- { +- foobar_union_ExpectAndReturn(union5); +- TEST_ASSERT_EQUAL_STARS_AND_STRIPES(union6, return_union()); +- } +- +- - :pass: FALSE +- :should: 'compare returned unions as unequal' +- :code: | +- test() +- { +- foobar_union_ExpectAndReturn(union4); +- TEST_ASSERT_EQUAL_STARS_AND_STRIPES(union5, return_union()); +- } +- +- - :pass: TRUE +- :should: 'successfully pass enum values' +- :code: | +- test() +- { +- foo_enum_Expect(OUT, &enum1); +- exercise_enum(OUT, &enum1); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad enum pointer comparison' +- :code: | +- test() +- { +- foo_enum_Expect(IN, &enum1); +- exercise_enum(IN, &enum2); +- } +- +- - :pass: FALSE +- :should: 'blow up on bad enum comparison' +- :code: | +- test() +- { +- foo_enum_Expect(IN, &enum1); +- exercise_enum(SHAKE_IT_ALL_ABOUT, &enum1); +- } +- +- - :pass: TRUE +- :should: 'compare returned enums as equal' +- :code: | +- test() +- { +- foobar_enum_ExpectAndReturn(OUT); +- TEST_ASSERT_EQUAL(OUT, return_enum()); +- } +- +- - :pass: FALSE +- :should: 'compare returned unions as unequal' +- :code: | +- test() +- { +- foobar_enum_ExpectAndReturn(OUT); +- TEST_ASSERT_EQUAL(IN, return_enum()); +- } +- +- +- :unity_helper: +- :header: | +- void AssertEqualTHINGStruct(struct THING expected, struct THING actual); +- void AssertEqualSTARS_AND_STRIPESUnion(union STARS_AND_STRIPES expected, union STARS_AND_STRIPES actual); +- +- #define TEST_ASSERT_EQUAL_THING(expected, actual) {AssertEqualTHINGStruct(expected, actual);} +- #define TEST_ASSERT_EQUAL_STARS_AND_STRIPES(expected, actual) {AssertEqualSTARS_AND_STRIPESUnion(expected, actual);} +- +- :code: | +- void AssertEqualTHINGStruct(struct THING expected, struct THING actual) +- { +- TEST_ASSERT_EQUAL_INT_MESSAGE(expected.a, actual.a, "actual struct member \"a\" does not equal expected"); +- TEST_ASSERT_EQUAL_INT_MESSAGE(expected.b, actual.b, "actual struct member \"b\" does not equal expected"); +- } +- +- void AssertEqualSTARS_AND_STRIPESUnion(union STARS_AND_STRIPES expected, union STARS_AND_STRIPES actual) +- { +- TEST_ASSERT_EQUAL_INT_MESSAGE(expected.a, actual.a, "actual union member \"a\" does not equal expected"); +- TEST_ASSERT_EQUAL_MESSAGE(expected.b, actual.b, "actual union member \"b\" does not equal expected"); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/stubs_with_callbacks.yml b/components/testframework/libs/cmock/test/system/test_interactions/stubs_with_callbacks.yml +deleted file mode 100644 +index 1f2575481a..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/stubs_with_callbacks.yml ++++ /dev/null +@@ -1,221 +0,0 @@ +---- +-:cmock: +- :plugins: +- - :callback +- :treat_as: +- custom_type: INT +- +-:systest: +- :types: | +- #define UINT32 unsigned int +- +- typedef signed int custom_type; +- +- :mockable: | +- UINT32 foo(custom_type* a); +- UINT32 bar(custom_type* b); +- int baz(void); +- void fuz(int* args, int num); +- +- :source: +- :header: | +- void function_a(int a, int b); +- UINT32 function_b(void); +- int function_c(void); +- +- :code: | +- void function_a(int a, int b) +- { +- int args[6] = {0, 1, 2, 3, 5, 5}; +- args[0] = a; +- fuz(args, b); +- } +- +- UINT32 function_b(void) +- { +- UINT32 sum = 0; +- custom_type a = 0; +- custom_type b = 0; +- sum = foo(&a) + bar(&b); +- return (UINT32)((custom_type)sum + a + b); +- } +- +- int function_c(void) +- { +- return (baz() + baz() + baz()); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- UINT32 FooAndBarHelper(custom_type* data, int num) +- { +- num++; +- *data = (custom_type)(num * 2); +- return (UINT32)(*data * 2); +- } +- +- int BazCallbackPointless(int num) +- { +- return num; +- } +- +- int BazCallbackComplainsIfCalledMoreThanTwice(int num) +- { +- TEST_ASSERT_MESSAGE(num < 2, "Do Not Call Baz More Than Twice"); +- return num; +- } +- +- void FuzVerifier(int* args, int num_args, int num_calls) +- { +- int i; +- TEST_ASSERT_MESSAGE(num_args < 5, "No More Than 5 Args Allowed"); +- for (i = 0; i < num_args; i++) +- { +- TEST_ASSERT_EQUAL(num_calls + i, args[i]); +- } +- } +- +- :units: +- - :pass: TRUE +- :should: 'successfully exercise two simple ExpectAndReturn mock calls the normal way' +- :code: | +- test() +- { +- custom_type exp = 0; +- foo_ExpectAndReturn(&exp, 10); +- bar_ExpectAndReturn(&exp, 20); +- TEST_ASSERT_EQUAL(30, function_b()); +- } +- +- - :pass: FALSE +- :should: 'successfully exercise two simple ExpectAndReturn mock calls and catch failure the normal way' +- :code: | +- test() +- { +- custom_type exp = 1; +- foo_ExpectAndReturn(&exp, 10); +- bar_ExpectAndReturn(&exp, 20); +- TEST_ASSERT_EQUAL(30, function_b()); +- } +- +- - :pass: TRUE +- :should: 'successfully exercise using some basic callbacks' +- :code: | +- test() +- { +- foo_StubWithCallback((CMOCK_foo_CALLBACK)FooAndBarHelper); +- bar_StubWithCallback((CMOCK_bar_CALLBACK)FooAndBarHelper); +- TEST_ASSERT_EQUAL(12, function_b()); +- } +- +- - :pass: TRUE +- :should: 'successfully exercise using some basic callbacks even if there were expects' +- :code: | +- test() +- { +- custom_type exp = 500; +- foo_ExpectAndReturn(&exp, 10); +- foo_StubWithCallback((CMOCK_foo_CALLBACK)FooAndBarHelper); +- bar_StubWithCallback((CMOCK_bar_CALLBACK)FooAndBarHelper); +- TEST_ASSERT_EQUAL(12, function_b()); +- } +- +- - :pass: FALSE +- :should: 'successfully exercise using some basic callbacks and notice failures' +- :code: | +- test() +- { +- foo_StubWithCallback((CMOCK_foo_CALLBACK)FooAndBarHelper); +- bar_StubWithCallback((CMOCK_bar_CALLBACK)FooAndBarHelper); +- TEST_ASSERT_EQUAL(10, function_b()); +- } +- +- - :pass: TRUE +- :should: 'successfully exercise a callback with no arguments' +- :code: | +- test() +- { +- baz_StubWithCallback((CMOCK_baz_CALLBACK)BazCallbackPointless); +- TEST_ASSERT_EQUAL(3, function_c()); +- } +- +- - :pass: FALSE +- :should: 'successfully throw a failure from within a callback function' +- :code: | +- test() +- { +- baz_StubWithCallback((CMOCK_baz_CALLBACK)BazCallbackComplainsIfCalledMoreThanTwice); +- function_c(); +- } +- +- - :pass: TRUE +- :should: 'be usable for things like dynamically sized memory checking for passing conditions' +- :code: | +- test() +- { +- fuz_StubWithCallback((CMOCK_fuz_CALLBACK)FuzVerifier); +- function_a(0, 4); +- } +- +- - :pass: FALSE +- :should: 'be usable for things like dynamically sized memory checking for failing conditions' +- :code: | +- test() +- { +- fuz_StubWithCallback((CMOCK_fuz_CALLBACK)FuzVerifier); +- function_a(0, 5); +- } +- +- - :pass: FALSE +- :should: 'be usable for things like dynamically sized memory checking for failing conditions 2' +- :code: | +- test() +- { +- fuz_StubWithCallback((CMOCK_fuz_CALLBACK)FuzVerifier); +- function_a(1, 4); +- } +- +- - :pass: TRUE +- :should: 'run them interlaced' +- :code: | +- test() +- { +- custom_type exp = 0; +- foo_ExpectAndReturn(&exp, 10); +- foo_ExpectAndReturn(&exp, 15); +- bar_ExpectAndReturn(&exp, 20); +- bar_ExpectAndReturn(&exp, 40); +- fuz_StubWithCallback((CMOCK_fuz_CALLBACK)FuzVerifier); +- baz_StubWithCallback((CMOCK_baz_CALLBACK)BazCallbackPointless); +- +- TEST_ASSERT_EQUAL(30, function_b()); +- TEST_ASSERT_EQUAL(55, function_b()); +- function_a(0, 4); +- TEST_ASSERT_EQUAL(3, function_c()); +- } +- +- - :pass: TRUE +- :should: 'run them back to back' +- :code: | +- test() +- { +- custom_type exp = 0; +- foo_ExpectAndReturn(&exp, 10); +- bar_ExpectAndReturn(&exp, 20); +- TEST_ASSERT_EQUAL(30, function_b()); +- +- foo_ExpectAndReturn(&exp, 15); +- bar_ExpectAndReturn(&exp, 40); +- TEST_ASSERT_EQUAL(55, function_b()); +- +- fuz_StubWithCallback((CMOCK_fuz_CALLBACK)FuzVerifier); +- function_a(0, 4); +- +- baz_StubWithCallback((CMOCK_baz_CALLBACK)BazCallbackPointless); +- TEST_ASSERT_EQUAL(3, function_c()); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/unity_64bit_support.yml b/components/testframework/libs/cmock/test/system/test_interactions/unity_64bit_support.yml +deleted file mode 100644 +index 861b15148f..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/unity_64bit_support.yml ++++ /dev/null +@@ -1,77 +0,0 @@ +---- +-#The purpose of this test is to play with things 64-bit integers, which aren't supported by all compilers +-:cmock: +- :plugins: +- - :array +- - :ignore +- +-:systest: +- :types: | +- #include "unity_internals.h" +- typedef UNITY_UINT64 TEST64; +- +- :mockable: | +- TEST64 foo(TEST64 a); +- TEST64* bar(TEST64* b); +- +- :source: +- :header: | +- TEST64 function_a(void); +- +- :code: | +- TEST64 function_a(void) { +- TEST64 a = 0x1234567890123456; +- TEST64 b; +- TEST64* c; +- +- b = foo(a); +- c = bar(&b); +- return *c; +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'handle a straightforward 64-bit series of calls' +- :code: | +- test() +- { +- TEST64 a = 0x0987654321543210; +- TEST64 b = 0x5a5a5a5a5a5a5a5a; +- foo_ExpectAndReturn(0x1234567890123456, 0x0987654321543210); +- bar_ExpectAndReturn(&a, &b); +- +- TEST_ASSERT_EQUAL_HEX64(b, function_a()); +- } +- +- - :pass: FALSE +- :should: 'handle a straightforward 64-bit series of calls with a failure' +- :code: | +- test() +- { +- TEST64 a = 0x0987654321543210; +- TEST64 b = 0x5a5a5a5a5a5a5a5a; +- foo_ExpectAndReturn(0x1234567890123456, 0x0987654321543211); +- bar_ExpectAndReturn(&a, &b); +- +- TEST_ASSERT_EQUAL_HEX64(b, function_a()); +- } +- +- - :pass: FALSE +- :should: 'handle a straightforward 64-bit series of calls returning a failure' +- :code: | +- test() +- { +- TEST64 a = 0x0987654321543210; +- TEST64 b = 0x5a5a5a5a5a5a5a5a; +- foo_ExpectAndReturn(0x1234567890123456, 0x0987654321543210); +- bar_ExpectAndReturn(&a, &b); +- +- TEST_ASSERT_EQUAL_HEX64(b+1, function_a()); +- } +- +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/unity_ignores.yml b/components/testframework/libs/cmock/test/system/test_interactions/unity_ignores.yml +deleted file mode 100644 +index 8595122b27..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/unity_ignores.yml ++++ /dev/null +@@ -1,139 +0,0 @@ +---- +-:cmock: +- :plugins: +- - # none +- +-:systest: +- :types: | +- #define UINT32 unsigned int +- +- :mockable: | +- UINT32 foo(UINT32 a); +- void bar(void); +- +- :source: +- :header: | +- UINT32 function_a(int a); +- void function_b(void); +- +- :code: | +- UINT32 function_a(int a) +- { +- bar(); +- return foo((UINT32)a); +- } +- +- void function_b(void) +- { +- bar(); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: :ignore +- :should: 'ignore incorrect expects after the TEST_IGNORE call' +- :code: | +- test() +- { +- TEST_IGNORE(); +- bar_Expect(); +- foo_ExpectAndReturn(10, 20); +- TEST_ASSERT_EQUAL(40, function_a(30)); +- } +- +- - :pass: :ignore +- :should: 'ignore missing expects after the TEST_IGNORE call' +- :code: | +- test() +- { +- TEST_IGNORE(); +- foo_ExpectAndReturn(10, 20); +- TEST_ASSERT_EQUAL(20, function_a(10)); +- } +- +- - :pass: :ignore +- :should: 'ignore extra expects after the TEST_IGNORE call' +- :code: | +- test() +- { +- TEST_IGNORE(); +- bar_Expect(); +- bar_Expect(); +- foo_ExpectAndReturn(10, 20); +- foo_ExpectAndReturn(10, 20); +- foo_ExpectAndReturn(10, 20); +- TEST_ASSERT_EQUAL(20, function_a(10)); +- } +- +- - :pass: :ignore +- :should: 'ignore no expects after the TEST_IGNORE call' +- :code: | +- test() +- { +- TEST_IGNORE(); +- TEST_ASSERT_EQUAL(20, function_a(10)); +- } +- +- - :pass: :ignore +- :should: 'ignore extra expects after the TEST_IGNORE call even if it happens later' +- :code: | +- test() +- { +- bar_Expect(); +- foo_ExpectAndReturn(10, 20); +- function_a(10); +- +- TEST_IGNORE(); +- bar_Expect(); +- foo_ExpectAndReturn(10, 20); +- TEST_ASSERT_EQUAL(40, function_a(30)); +- } +- +- - :pass: false +- :should: 'still fail if there are expect problems before the TEST_IGNORE' +- :code: | +- test() +- { +- bar_Expect(); +- foo_ExpectAndReturn(10, 20); +- function_a(30); +- +- TEST_IGNORE(); +- bar_Expect(); +- foo_ExpectAndReturn(10, 20); +- TEST_ASSERT_EQUAL(40, function_a(30)); +- } +- +- - :pass: false +- :should: 'still fail if there are missing expect problems before the TEST_IGNORE' +- :code: | +- test() +- { +- bar_Expect(); +- function_a(10); +- +- TEST_IGNORE(); +- bar_Expect(); +- foo_ExpectAndReturn(10, 20); +- TEST_ASSERT_EQUAL(40, function_a(30)); +- } +- +- - :pass: :ignore +- :should: 'ignore if extra expects before the TEST_IGNORE because it ignored the rest of the test that might have made calls to it' +- :code: | +- test() +- { +- bar_Expect(); +- bar_Expect(); +- foo_ExpectAndReturn(10, 20); +- function_a(10); +- +- TEST_IGNORE(); +- foo_ExpectAndReturn(10, 20); +- TEST_ASSERT_EQUAL(40, function_a(30)); +- } +-... +diff --git a/components/testframework/libs/cmock/test/system/test_interactions/unity_void_pointer_compare.yml b/components/testframework/libs/cmock/test/system/test_interactions/unity_void_pointer_compare.yml +deleted file mode 100644 +index 1a49b0cd37..0000000000 +--- a/components/testframework/libs/cmock/test/system/test_interactions/unity_void_pointer_compare.yml ++++ /dev/null +@@ -1,91 +0,0 @@ +---- +-#The purpose of this test is to verify we handle void pointers as memory compares +-:cmock: +- :plugins: +- - :array +- :treat_as_array: +- VOID_PTR: unsigned char +- +-:systest: +- :types: | +- #include "unity_internals.h" +- typedef void* VOID_PTR; +- +- :mockable: | +- void* ret_v_ptr(void); +- void get_v_ptr(void* ptr); +- void get_v_ptr_typedefed(VOID_PTR ptr); +- +- :source: +- :header: | +- void function_a(void); +- +- :code: | +- void function_a(void) { +- void* stuff = ret_v_ptr(); +- get_v_ptr(stuff); +- get_v_ptr_typedefed((VOID_PTR)stuff); +- } +- +- :tests: +- :common: | +- void setUp(void) {} +- void tearDown(void) {} +- +- :units: +- - :pass: TRUE +- :should: 'handle passing working expects' +- :code: | +- test() +- { +- char* a = "Hello"; +- char* b = "Hello"; +- ret_v_ptr_ExpectAndReturn(a); +- get_v_ptr_Expect(b); +- get_v_ptr_typedefed_Expect((VOID_PTR)b); +- +- function_a(); +- } +- +- - :pass: TRUE +- :should: 'handle passing array expects' +- :code: | +- test() +- { +- char* a = "Hello"; +- char* b = "Hello"; +- ret_v_ptr_ExpectAndReturn(a); +- get_v_ptr_ExpectWithArray(b,5); +- get_v_ptr_typedefed_ExpectWithArray((VOID_PTR)b,5); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle failing expects' +- :code: | +- test() +- { +- char* a = "Hello"; +- char* b = "Jello"; +- ret_v_ptr_ExpectAndReturn(a); +- get_v_ptr_Expect(b); +- get_v_ptr_typedefed_Expect((VOID_PTR)b); +- +- function_a(); +- } +- +- - :pass: FALSE +- :should: 'handle failing array expects' +- :code: | +- test() +- { +- char* a = "Hello"; +- char* b = "Hella"; +- ret_v_ptr_ExpectAndReturn(a); +- get_v_ptr_ExpectWithArray(b,5); +- get_v_ptr_typedefed_ExpectWithArray((VOID_PTR)b,5); +- +- function_a(); +- } +-... +diff --git a/components/testframework/libs/cmock/test/targets/clang_strict.yml b/components/testframework/libs/cmock/test/targets/clang_strict.yml +deleted file mode 100644 +index c86f1e1268..0000000000 +--- a/components/testframework/libs/cmock/test/targets/clang_strict.yml ++++ /dev/null +@@ -1,90 +0,0 @@ +---- +-compiler: +- path: clang +- source_path: &systest_generated_path './system/generated/' +- unit_tests_path: &unit_tests_path '../examples/test/' +- mocks_path: &systest_mocks_path './system/generated/' +- build_path: &systest_build_path './system/build/' +- options: +- - '-c' +- - '-Wall' +- - '-Wextra' +- - '-Werror' +- #- '-Wcast-qual' +- - '-Wconversion' +- - '-Wtautological-compare' +- #- '-Wtautological-pointer-compare' +- - '-Wdisabled-optimization' +- - '-Wformat=2' +- - '-Winit-self' +- - '-Winline' +- - '-Winvalid-pch' +- - '-Wmissing-declarations' +- - '-Wmissing-include-dirs' +- - '-Wmissing-prototypes' +- - '-Wnonnull' +- - '-Wpacked' +- - '-Wpointer-arith' +- - '-Wredundant-decls' +- - '-Wswitch-default' +- - '-Wstrict-aliasing=2' +- - '-Wstrict-overflow=5' +- - '-Wuninitialized' +- - '-Wunused' +- - '-Wunreachable-code' +- - '-Wreturn-type' +- - '-Wshadow' +- - '-Wundef' +- - '-Wwrite-strings' +- - '-Wbad-function-cast' +- - '-Wno-missing-prototypes' #we've been lazy about things like setUp and tearDown +- - '-Wno-invalid-token-paste' +- - '-fms-extensions' +- - '-fno-omit-frame-pointer' +- #- '-ffloat-store' +- - '-fno-common' +- - '-fstrict-aliasing' +- - '-std=gnu99' +- - '-pedantic' +- - '-O0' +- includes: +- prefix: '-I' +- items: +- - *systest_generated_path +- - *unit_tests_path +- - *systest_mocks_path +- - '../src/' +- - '../vendor/unity/src/' +- - '../vendor/c_exception/lib/' +- - './system/test_compilation/' +- - './' +- defines: +- prefix: '-D' +- items: +- - CMOCK +- - 'UNITY_SUPPORT_64' +- - 'UNITY_POINTER_WIDTH=64' +- object_files: +- prefix: '-o' +- extension: '.o' +- destination: *systest_build_path +- +-linker: +- path: gcc +- options: +- - -lm +- includes: +- prefix: '-I' +- object_files: +- path: *systest_build_path +- extension: '.o' +- bin_files: +- prefix: '-o' +- extension: '.exe' +- destination: *systest_build_path +- +-unsupported: +- - out_of_memory +- - callingconv +- +-colour: true +diff --git a/components/testframework/libs/cmock/test/targets/gcc.yml b/components/testframework/libs/cmock/test/targets/gcc.yml +deleted file mode 100644 +index 56ed82fd97..0000000000 +--- a/components/testframework/libs/cmock/test/targets/gcc.yml ++++ /dev/null +@@ -1,58 +0,0 @@ +---- +-compiler: +- path: gcc +- source_path: &systest_generated_path './system/generated/' +- unit_tests_path: &unit_tests_path '../examples/test/' +- mocks_path: &systest_mocks_path './system/generated/' +- build_path: &systest_build_path './system/build/' +- options: +- - '-c' +- - '-Wall' +- - '-Wextra' +- - '-Wunused-parameter' +- - '-Wno-address' +- - '-Wno-invalid-token-paste' +- - '-std=c99' +- - '-pedantic' +- - '-O0' +- includes: +- prefix: '-I' +- items: +- - *systest_generated_path +- - *unit_tests_path +- - *systest_mocks_path +- - '../src/' +- - '../vendor/unity/src/' +- - '../vendor/c_exception/lib/' +- - './system/test_compilation/' +- - './' +- defines: +- prefix: '-D' +- items: +- - CMOCK +- - 'UNITY_SUPPORT_64' +- object_files: +- prefix: '-o' +- extension: '.o' +- destination: *systest_build_path +- +-linker: +- path: gcc +- options: +- - -lm +- includes: +- prefix: '-I' +- object_files: +- path: *systest_build_path +- extension: '.o' +- bin_files: +- prefix: '-o' +- extension: '.exe' +- destination: *systest_build_path +- +-unsupported: +- - out_of_memory +- - unity_64bit_support +- - callingconv +- +-colour: true +diff --git a/components/testframework/libs/cmock/test/targets/gcc_64.yml b/components/testframework/libs/cmock/test/targets/gcc_64.yml +deleted file mode 100644 +index 2702d5b5a6..0000000000 +--- a/components/testframework/libs/cmock/test/targets/gcc_64.yml ++++ /dev/null +@@ -1,58 +0,0 @@ +---- +-compiler: +- path: gcc +- source_path: &systest_generated_path './system/generated/' +- unit_tests_path: &unit_tests_path '../examples/test/' +- mocks_path: &systest_mocks_path './system/generated/' +- build_path: &systest_build_path './system/build/' +- options: +- - '-c' +- - '-m64' +- - '-Wall' +- - '-Wunused-parameter' +- - '-Wno-address' +- - '-Wno-invalid-token-paste' +- - '-std=c99' +- - '-pedantic' +- includes: +- prefix: '-I' +- items: +- - *systest_generated_path +- - *unit_tests_path +- - *systest_mocks_path +- - '../src/' +- - '../vendor/unity/src/' +- - '../vendor/c_exception/lib/' +- - './system/test_compilation/' +- - './' +- defines: +- prefix: '-D' +- items: +- - CMOCK +- - 'UNITY_SUPPORT_64' +- - 'UNITY_POINTER_WIDTH=64' +- object_files: +- prefix: '-o' +- extension: '.o' +- destination: *systest_build_path +- +-linker: +- path: gcc +- options: +- - -lm +- - '-m64' +- includes: +- prefix: '-I' +- object_files: +- path: *systest_build_path +- extension: '.o' +- bin_files: +- prefix: '-o' +- extension: '.exe' +- destination: *systest_build_path +- +-unsupported: +- - out_of_memory +- - callingconv +- +-colour: true +diff --git a/components/testframework/libs/cmock/test/targets/gcc_tiny.yml b/components/testframework/libs/cmock/test/targets/gcc_tiny.yml +deleted file mode 100644 +index f7ab5e7934..0000000000 +--- a/components/testframework/libs/cmock/test/targets/gcc_tiny.yml ++++ /dev/null +@@ -1,80 +0,0 @@ +---- +-compiler: +- path: gcc +- source_path: &systest_generated_path './system/generated/' +- unit_tests_path: &unit_tests_path '../examples/test/' +- mocks_path: &systest_mocks_path './system/generated/' +- build_path: &systest_build_path './system/build/' +- options: +- - '-c' +- - '-Wall' +- - '-Wextra' +- - '-Wunused-parameter' +- - '-Wno-address' +- - '-Wno-invalid-token-paste' +- - '-std=c99' +- - '-pedantic' +- - '-O0' +- includes: +- prefix: '-I' +- items: +- - *systest_generated_path +- - *unit_tests_path +- - *systest_mocks_path +- - '../src/' +- - '../vendor/unity/src/' +- - '../vendor/c_exception/lib/' +- - './system/test_compilation/' +- - './' +- defines: +- prefix: '-D' +- items: +- - CMOCK +- - 'CMOCK_MEM_STATIC' +- - 'CMOCK_MEM_SIZE=1024' +- object_files: +- prefix: '-o' +- extension: '.o' +- destination: *systest_build_path +- +-linker: +- path: gcc +- options: +- - -lm +- includes: +- prefix: '-I' +- object_files: +- path: *systest_build_path +- extension: '.o' +- bin_files: +- prefix: '-o' +- extension: '.exe' +- destination: *systest_build_path +- +-unsupported: +- - all_plugins_but_other_limits +- - all_plugins_coexist +- - array_and_pointer_handling +- - const_primitives_handling +- - enforce_strict_ordering +- - expect_and_return_custom_types +- - expect_and_return_treat_as +- - expect_and_throw +- - expect_any_args +- - fancy_pointer_handling +- - function_pointer_handling +- - newer_standards_stuff1 +- - nonstandard_pased_stuff_1 +- - nonstandard_pased_stuff_2 +- - parsing_challenges +- - return_thru_ptr_and_expect_any_args +- - return_thru_ptr_ignore_arg +- - struct_union_enum_expect_and_return +- - struct_union_enum_expect_and_return_with_plugins +- - stubs_with_callbacks +- - unity_64bit_support +- - unity_ignores +- - callingconv +- - C +- +-colour: true +diff --git a/components/testframework/libs/cmock/test/targets/iar_arm_v4.yml b/components/testframework/libs/cmock/test/targets/iar_arm_v4.yml +deleted file mode 100644 +index 61e0331e99..0000000000 +--- a/components/testframework/libs/cmock/test/targets/iar_arm_v4.yml ++++ /dev/null +@@ -1,110 +0,0 @@ +-tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 4.0\' +-compiler: +- path: [*tools_root, 'arm\bin\iccarm.exe'] +- source_path: &systest_generated_path './system/generated/' +- unit_tests_path: &unit_tests_path '../examples/test/' +- mocks_path: &systest_mocks_path './system/generated/' +- build_path: &systest_build_path './system/build/' +- options: +- - --dlib_config +- - [*tools_root, 'arm\lib\dl4tptinl8n.h'] +- - -z3 +- - --no_cse +- - --no_unroll +- - --no_inline +- - --no_code_motion +- - --no_tbaa +- - --no_clustering +- - --no_scheduling +- - --debug +- - --cpu_mode thumb +- - --endian little +- - --cpu ARM7TDMI +- - --stack_align 4 +- - --interwork +- - -e +- - --silent +- - --warnings_are_errors +- - --fpu None +- #We are supressing some warnings here because we test CMock against some questionable code to make sure it still works +- - --diag_suppress Pa050 +- - --diag_suppress Pe191 +- - --diag_suppress=Pe494 +- - --diag_suppress=Pe083 +- includes: +- prefix: '-I' +- items: +- - [*tools_root, 'arm\inc\'] +- - *systest_generated_path +- - *unit_tests_path +- - *systest_mocks_path +- - '../src/' +- - '../vendor/unity/src/' +- - '../vendor/c_exception/lib/' +- - './system/test_compilation/' +- - './' +- defines: +- prefix: '-D' +- items: +- - CMOCK +- object_files: +- prefix: '-o' +- extension: '.r79' +- destination: *systest_build_path +- +-linker: +- path: [*tools_root, 'common\bin\xlink.exe'] +- options: +- - -rt +- - [*tools_root, 'arm\lib\dl4tptinl8n.r79'] +- - -D_L_EXTMEM_START=0 +- - -D_L_EXTMEM_SIZE=0 +- - -D_L_HEAP_SIZE=120 +- - -D_L_STACK_SIZE=32 +- - -e_small_write=_formatted_write +- - -s +- - __program_start +- - '-f iar\iar_v4\Resource\at91SAM7X256_FLASH.xcl' +- includes: +- prefix: '-I' +- items: +- - *systest_generated_path +- - *unit_tests_path +- - *systest_mocks_path +- - 'vendor/unity/src/' +- - [*tools_root, 'arm\config\'] +- - [*tools_root, 'arm\lib\'] +- object_files: +- path: *systest_build_path +- extension: '.r79' +- bin_files: +- prefix: '-o' +- extension: '.d79' +- destination: *systest_build_path +- +-simulator: +- path: [*tools_root, 'common\bin\CSpyBat.exe'] +- pre_support: +- - --silent +- - [*tools_root, 'arm\bin\armproc.dll'] +- - [*tools_root, 'arm\bin\armsim.dll'] +- post_support: +- - --plugin +- - [*tools_root, 'arm\bin\armbat.dll'] +- - --macro +- - 'iar\iar_v4\Resource\SAM7_SIM.mac' +- - --backend +- - -B +- - -p +- - [*tools_root, 'arm\config\ioat91sam7X256.ddf'] +- - -d +- - sim +- +-unsupported: +- - out_of_memory +- - nonstandard_parsed_stuff_1 +- - const +- - callingconv +- - unity_64bit_support +- +-colour: true +diff --git a/components/testframework/libs/cmock/test/targets/iar_arm_v5.yml b/components/testframework/libs/cmock/test/targets/iar_arm_v5.yml +deleted file mode 100644 +index bac2f7a9d4..0000000000 +--- a/components/testframework/libs/cmock/test/targets/iar_arm_v5.yml ++++ /dev/null +@@ -1,95 +0,0 @@ +-tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 5.3\' +-compiler: +- path: [*tools_root, 'arm\bin\iccarm.exe'] +- source_path: &systest_generated_path './system/generated/' +- unit_tests_path: &unit_tests_path '../examples/test/' +- mocks_path: &systest_mocks_path './system/generated/' +- build_path: &systest_build_path './system/build/' +- options: +- - --dlib_config +- - [*tools_root, 'arm\inc\DLib_Config_Normal.h'] +- - --no_cse +- - --no_unroll +- - --no_inline +- - --no_code_motion +- - --no_tbaa +- - --no_clustering +- - --no_scheduling +- - --debug +- - --cpu_mode thumb +- - --endian=little +- - --cpu=ARM7TDMI +- - --interwork +- - --warnings_are_errors +- - --fpu=None +- - -e +- - -On +- #We are supressing some warnings here because we test CMock against some questionable code to make sure it still works +- - --diag_suppress=Pa050 +- - --diag_suppress=Pe191 +- - --diag_suppress=Pe494 +- - --diag_suppress=Pe083 +- includes: +- prefix: '-I' +- items: +- - [*tools_root, 'arm\inc\'] +- - *systest_generated_path +- - *unit_tests_path +- - *systest_mocks_path +- - '../src/' +- - '../vendor/unity/src/' +- - '../vendor/c_exception/lib/' +- - './system/test_compilation/' +- - './' +- - '.\iar\iar_v5\incIAR\' +- defines: +- prefix: '-D' +- items: +- - CMOCK +- object_files: +- prefix: '-o' +- extension: '.r79' +- destination: *systest_build_path +- +-linker: +- path: [*tools_root, 'arm\bin\ilinkarm.exe'] +- options: +- - --redirect _Printf=_PrintfLarge +- - --redirect _Scanf=_ScanfSmall +- - --semihosting +- - --entry __iar_program_start +- - --config iar\iar_v5\Resource\at91SAM7X256_RAM.icf +- object_files: +- path: *systest_build_path +- extension: '.o' +- bin_files: +- prefix: '-o' +- extension: '.out' +- destination: *systest_build_path +- +-simulator: +- path: [*tools_root, 'common\bin\CSpyBat.exe'] +- pre_support: +- - --silent +- - [*tools_root, 'arm\bin\armproc.dll'] +- - [*tools_root, 'arm\bin\armsim.dll'] +- post_support: +- - --plugin +- - [*tools_root, 'arm\bin\armbat.dll'] +- - --macro +- - 'iar\iar_v5\Resource\SAM7_SIM.mac' +- - --backend +- - -B +- - -p +- - [*tools_root, 'arm\config\debugger\Atmel\ioat91sam7X256.ddf'] +- - -d +- - sim +- +-unsupported: +- - out_of_memory +- - nonstandard_parsed_stuff_1 +- - const +- - callingconv +- - unity_64bit_support +- +-colour: true +diff --git a/components/testframework/libs/cmock/test/test_helper.rb b/components/testframework/libs/cmock/test/test_helper.rb +deleted file mode 100644 +index 486196c0f3..0000000000 +--- a/components/testframework/libs/cmock/test/test_helper.rb ++++ /dev/null +@@ -1,44 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +- +-require 'minitest/autorun' +- +-def create_mocks(*mocks) +- mocks.each do |mock| +- eval "@#{mock} = Minitest::Mock.new" +- end +-end +- +-def create_stub(funcs) +- stub = Class.new +- blob = "class << stub\n" +- funcs.each_pair {|k,v| blob += "def #{k.to_s}(unused=nil)\n #{v.inspect}\nend\n" } +- blob += "end" +- eval blob +- stub +-end +- +-def test_return +- { +- :int => {:type => "int", :name => 'cmock_to_return', :ptr? => false, :const? => false, :void? => false, :str => 'int cmock_to_return'}, +- :int_ptr => {:type => "int*", :name => 'cmock_to_return', :ptr? => true, :const? => false, :void? => false, :str => 'int* cmock_to_return'}, +- :void => {:type => "void", :name => 'cmock_to_return', :ptr? => false, :const? => false, :void? => true, :str => 'void cmock_to_return'}, +- :string => {:type => "const char*", :name => 'cmock_to_return', :ptr? => false, :const? => true, :void? => false, :str => 'const char* cmock_to_return'}, +- } +-end +- +-def test_arg +- { +- :int => {:type => "int", :name => 'MyInt', :ptr? => false, :const? => false, :const_ptr? => false}, +- :int_ptr => {:type => "int*", :name => 'MyIntPtr', :ptr? => true, :const? => false, :const_ptr? => false}, +- :const_ptr => {:type => "int*", :name => 'MyConstPtr', :ptr? => true, :const? => false, :const_ptr? => true}, +- :double_ptr => {:type => "int const**", :name => 'MyDoublePtr', :ptr? => true, :const? => true, :const_ptr? => false}, +- :mytype => {:type => "MY_TYPE", :name => 'MyMyType', :ptr? => false, :const? => true, :const_ptr? => false}, +- :mytype_ptr => {:type => "MY_TYPE*", :name => 'MyMyTypePtr', :ptr? => true, :const? => false, :const_ptr? => false}, +- :string => {:type => "const char*", :name => 'MyStr', :ptr? => false, :const? => true, :const_ptr? => false}, +- } +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_config_test.rb b/components/testframework/libs/cmock/test/unit/cmock_config_test.rb +deleted file mode 100644 +index 8c5e410a7d..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_config_test.rb ++++ /dev/null +@@ -1,126 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_config' +- +- +-describe CMockConfig, "Verify CMockConfig Module" do +- +- it "use default settings when no parameters are specified" do +- config = CMockConfig.new +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:mock_path], config.mock_path) +- assert_nil(CMockConfig::CMOCK_DEFAULT_OPTIONS[:includes]) +- assert_nil(config.includes) +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:attributes], config.attributes) +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:plugins], config.plugins) +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:treat_externs], config.treat_externs) +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:treat_inlines], config.treat_inlines) +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:inline_function_patterns], config.inline_function_patterns) +- end +- +- it "replace only options specified in a hash" do +- test_includes = ['hello'] +- test_attributes = ['blah', 'bleh'] +- config = CMockConfig.new(:includes => test_includes, :attributes => test_attributes) +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:mock_path], config.mock_path) +- assert_equal(test_includes, config.includes) +- assert_equal(test_attributes, config.attributes) +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:plugins], config.plugins) +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:treat_externs], config.treat_externs) +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:treat_inlines], config.treat_inlines) +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:inline_function_patterns], config.inline_function_patterns) +- end +- +- it "replace only options specified in a yaml file" do +- test_plugins = [:soda, :pizza] +- config = CMockConfig.new("#{File.expand_path(File.dirname(__FILE__))}/cmock_config_test.yml") +- assert_equal(CMockConfig::CMOCK_DEFAULT_OPTIONS[:mock_path], config.mock_path) +- assert_nil(CMockConfig::CMOCK_DEFAULT_OPTIONS[:includes]) +- assert_nil(config.includes) +- assert_equal(test_plugins, config.plugins) +- assert_equal(:include, config.treat_externs) +- assert_equal(:include, config.treat_inlines) +- assert_equal(['MY_INLINE_FUNCTION_DECLARATION_PATTERN'], config.inline_function_patterns) +- end +- +- it "populate treat_as map with internal standard_treat_as_map defaults, redefine defaults, and add custom values" do +- +- user_treat_as1 = { +- 'BOOL' => 'UINT8', # redefine standard default +- 'unsigned long' => 'INT', # redefine standard default +- 'U8' => 'UINT8', # custom value +- 'U16' => 'UINT16' # custom value +- } +- user_treat_as2 = { +- 'BOOL' => 'INT16', # redefine standard default +- 'U16' => 'HEX16' # custom value +- } +- +- config1 = CMockConfig.new({:treat_as => user_treat_as1}) +- config2 = CMockConfig.new({:treat_as => user_treat_as2}) +- +- # ----- USER SET 1 +- # standard defaults +- assert_equal('INT', config1.treat_as['BOOL_T']) +- assert_equal('HEX32', config1.treat_as['unsigned int']) +- assert_equal('HEX8_ARRAY',config1.treat_as['void*']) +- assert_equal('STRING', config1.treat_as['CSTRING']) +- assert_equal('STRING', config1.treat_as['char*']) +- assert_equal('HEX8', config1.treat_as['unsigned char']) +- assert_equal('INT', config1.treat_as['long']) +- assert_equal('INT16', config1.treat_as['short']) +- +- # overrides +- assert_equal('UINT8', config1.treat_as['BOOL']) +- assert_equal('INT', config1.treat_as['unsigned long']) +- +- # added custom values +- assert_equal('UINT8', config1.treat_as['U8']) +- assert_equal('UINT16', config1.treat_as['U16']) +- +- # standard_treat_as_map: unchanged +- assert_equal('INT', config1.standard_treat_as_map['BOOL']) +- assert_equal('HEX32', config1.standard_treat_as_map['unsigned long']) +- assert_equal('STRING', config1.standard_treat_as_map['char*']) +- +- # ----- USER SET 2 +- # standard defaults +- assert_equal('INT', config2.treat_as['BOOL_T']) +- assert_equal('HEX32', config2.treat_as['unsigned int']) +- assert_equal('HEX8_ARRAY',config2.treat_as['void*']) +- assert_equal('STRING', config2.treat_as['CSTRING']) +- assert_equal('STRING', config2.treat_as['char*']) +- assert_equal('HEX8', config2.treat_as['unsigned char']) +- assert_equal('INT', config2.treat_as['long']) +- assert_equal('INT16', config2.treat_as['short']) +- assert_equal('HEX32', config2.treat_as['unsigned long']) +- +- # overrides +- assert_equal('INT16', config2.treat_as['BOOL']) +- +- # added custom values +- assert_equal('HEX16', config2.treat_as['U16']) +- +- # standard_treat_as_map: unchanged +- assert_equal('INT', config2.standard_treat_as_map['BOOL']) +- assert_equal('HEX32', config2.standard_treat_as_map['unsigned long']) +- assert_equal('STRING', config2.standard_treat_as_map['char*']) +- end +- +- it "standard treat_as map should be incorruptable" do +- config = CMockConfig.new({}) +- +- assert_equal('INT', config.standard_treat_as_map['BOOL_T']) +- +- local = config.standard_treat_as_map +- local['BOOL_T'] = "U8" +- +- assert_equal('INT', config.standard_treat_as_map['BOOL_T']) +- end +- +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_config_test.yml b/components/testframework/libs/cmock/test/unit/cmock_config_test.yml +deleted file mode 100644 +index eaee14b77c..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_config_test.yml ++++ /dev/null +@@ -1,7 +0,0 @@ +-:cmock: +- :plugins: +- - 'soda' +- - 'pizza' +- :treat_externs: :include +- :treat_inlines: :include +- :inline_function_patterns: ['MY_INLINE_FUNCTION_DECLARATION_PATTERN'] +diff --git a/components/testframework/libs/cmock/test/unit/cmock_file_writer_test.rb b/components/testframework/libs/cmock/test/unit/cmock_file_writer_test.rb +deleted file mode 100644 +index 932e7dcc80..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_file_writer_test.rb ++++ /dev/null +@@ -1,27 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_file_writer' +- +-describe CMockFileWriter, "Verify CMockFileWriter Module" do +- +- before do +- create_mocks :config +- @cmock_file_writer = CMockFileWriter.new(@config) +- end +- +- after do +- end +- +- it "complain if a block was not specified when calling create" do +- begin +- @cmock_file_writer.create_file("test.txt") +- assert false, "Should Have Thrown An Error When Calling Without A Block" +- rescue +- end +- end +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_main_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_main_test.rb +deleted file mode 100644 +index 846241250f..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_main_test.rb ++++ /dev/null +@@ -1,686 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-$ThisIsOnlyATest = true +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator' +- +-class MockedPluginHelper +- def initialize return_this +- @return_this = return_this +- end +- +- def include_files +- return @return_this +- end +- +- def instance_structure( name, args, rettype ) +- return " #{@return_this}_#{name}(#{args}, #{rettype})" +- end +- +- def mock_verify( name ) +- return " #{@return_this}_#{name}" +- end +- +- def mock_destroy( name, args, rettype ) +- return " #{@return_this}_#{name}(#{args}, #{rettype})" +- end +- +- def mock_implementation(name, args) +- return " Mock#{name}#{@return_this}(#{args.join(", ")})" +- end +-end +- +-describe CMockGenerator, "Verify CMockGenerator Module" do +- +- before do +- create_mocks :config, :file_writer, :utils, :plugins +- @module_name = "PoutPoutFish" +- +- #no strict handling +- @config.expect :mock_prefix, "Mock" +- @config.expect :mock_suffix, "" +- @config.expect :weak, "" +- @config.expect :enforce_strict_ordering, nil +- @config.expect :framework, :unity +- @config.expect :includes, ["ConfigRequiredHeader1.h","ConfigRequiredHeader2.h"] +- #@config.expect :includes_h_pre_orig_header, nil #not called because includes called +- @config.expect :includes_h_post_orig_header, nil +- @config.expect :includes_c_pre_header, nil +- @config.expect :includes_c_post_header, nil +- @config.expect :subdir, nil +- @config.expect :fail_on_unexpected_calls, true +- @config.expect :treat_inlines, :exclude +- @cmock_generator = CMockGenerator.new(@config, @file_writer, @utils, @plugins) +- @cmock_generator.module_name = @module_name +- @cmock_generator.module_ext = '.h' +- @cmock_generator.mock_name = "Mock#{@module_name}" +- @cmock_generator.clean_mock_name = "Mock#{@module_name}" +- +- #strict handling +- @config.expect :mock_prefix, "Mock" +- @config.expect :mock_suffix, "" +- @config.expect :weak, "" +- @config.expect :enforce_strict_ordering, true +- @config.expect :framework, :unity +- @config.expect :includes, nil +- @config.expect :includes_h_pre_orig_header, nil +- @config.expect :includes_h_post_orig_header, nil +- @config.expect :includes_c_pre_header, nil +- @config.expect :includes_c_post_header, nil +- @config.expect :subdir, nil +- @config.expect :fail_on_unexpected_calls, true +- @config.expect :treat_inlines, :exclude +- @cmock_generator_strict = CMockGenerator.new(@config, @file_writer, @utils, @plugins) +- @cmock_generator_strict.module_name = @module_name +- @cmock_generator_strict.module_ext = '.h' +- @cmock_generator_strict.mock_name = "Mock#{@module_name}" +- @cmock_generator_strict.clean_mock_name = "Mock#{@module_name}" +- end +- +- after do +- end +- +- def helper_create_header_top_with_opt_incldues_form_config_and_plugin(ext) +- @config.expect :mock_prefix, "Mock" +- @config.expect :mock_suffix, "" +- @config.expect :weak, "" +- @cmock_generator.module_ext = ext +- orig_filename = "PoutPoutFish#{ext}" +- define_name = "MOCKPOUTPOUTFISH_H" +- output = [] +- expected = [ +- "/* AUTOGENERATED FILE. DO NOT EDIT. */\n", +- "#ifndef _#{define_name}\n", +- "#define _#{define_name}\n\n", +- "#include \"unity.h\"\n", +- "#include \"ConfigRequiredHeader1.h\"\n", +- "#include \"ConfigRequiredHeader2.h\"\n", +- "#include \"#{orig_filename}\"\n", +- "#include \"PluginRequiredHeader.h\"\n", +- "\n", +- "/* Ignore the following warnings, since we are copying code */\n", +- "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n", +- "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n", +- "#pragma GCC diagnostic push\n", +- "#endif\n", +- "#if !defined(__clang__)\n", +- "#pragma GCC diagnostic ignored \"-Wpragmas\"\n", +- "#endif\n", +- "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n", +- "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n", +- "#endif\n", +- "\n", +- ] +- +- @config.expect :orig_header_include_fmt, "#include \"%s\"" +- @plugins.expect :run, "#include \"PluginRequiredHeader.h\"\n", [:include_files] +- +- @cmock_generator.create_mock_header_header(output, "Mock#{orig_filename}") +- +- assert_equal(expected, output) +- end +- +- it "create the top of a header file with optional include files from config and include file from plugin" do +- ['.h','.hh','.hpp'].each do |ext| +- helper_create_header_top_with_opt_incldues_form_config_and_plugin(ext) +- end +- end +- +- it "handle dashes and spaces in the module name" do +- #no strict handling +- @config.expect :mock_prefix, "Mock" +- @config.expect :mock_suffix, "" +- @config.expect :weak, "" +- @config.expect :enforce_strict_ordering, nil +- @config.expect :framework, :unity +- @config.expect :includes, ["ConfigRequiredHeader1.h","ConfigRequiredHeader2.h"] +- @config.expect :includes_h_post_orig_header, nil +- @config.expect :includes_c_pre_header, nil +- @config.expect :includes_c_post_header, nil +- @config.expect :subdir, nil +- @config.expect :fail_on_unexpected_calls, true +- @config.expect :treat_inlines, :exclude +- @cmock_generator2 = CMockGenerator.new(@config, @file_writer, @utils, @plugins) +- @cmock_generator2.module_name = "Pout-Pout Fish" +- @cmock_generator2.module_ext = '.h' +- @cmock_generator2.mock_name = "MockPout-Pout Fish" +- @cmock_generator2.clean_mock_name = "MockPout_Pout_Fish" +- +- @config.expect :mock_prefix, "Mock" +- @config.expect :mock_suffix, "" +- @config.expect :weak, "" +- orig_filename = "Pout-Pout Fish.h" +- define_name = "MOCKPOUT_POUT_FISH_H" +- output = [] +- expected = [ +- "/* AUTOGENERATED FILE. DO NOT EDIT. */\n", +- "#ifndef _#{define_name}\n", +- "#define _#{define_name}\n\n", +- "#include \"unity.h\"\n", +- "#include \"ConfigRequiredHeader1.h\"\n", +- "#include \"ConfigRequiredHeader2.h\"\n", +- "#include \"#{orig_filename}\"\n", +- "#include \"PluginRequiredHeader.h\"\n", +- "\n", +- "/* Ignore the following warnings, since we are copying code */\n", +- "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n", +- "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n", +- "#pragma GCC diagnostic push\n", +- "#endif\n", +- "#if !defined(__clang__)\n", +- "#pragma GCC diagnostic ignored \"-Wpragmas\"\n", +- "#endif\n", +- "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n", +- "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n", +- "#endif\n", +- "\n", +- ] +- +- @config.expect :orig_header_include_fmt, "#include \"%s\"" +- @plugins.expect :run, "#include \"PluginRequiredHeader.h\"\n", [:include_files] +- +- @cmock_generator2.create_mock_header_header(output, "MockPout-Pout Fish.h") +- +- assert_equal(expected, output) +- end +- +- it "create the top of a header file with optional include files from config" do +- @config.expect :mock_prefix, "Mock" +- @config.expect :mock_suffix, "" +- @config.expect :weak, "" +- orig_filename = "PoutPoutFish.h" +- define_name = "MOCKPOUTPOUTFISH_H" +- output = [] +- expected = [ +- "/* AUTOGENERATED FILE. DO NOT EDIT. */\n", +- "#ifndef _#{define_name}\n", +- "#define _#{define_name}\n\n", +- "#include \"unity.h\"\n", +- "#include \"ConfigRequiredHeader1.h\"\n", +- "#include \"ConfigRequiredHeader2.h\"\n", +- "#include \"#{orig_filename}\"\n", +- "\n", +- "/* Ignore the following warnings, since we are copying code */\n", +- "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n", +- "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n", +- "#pragma GCC diagnostic push\n", +- "#endif\n", +- "#if !defined(__clang__)\n", +- "#pragma GCC diagnostic ignored \"-Wpragmas\"\n", +- "#endif\n", +- "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n", +- "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n", +- "#endif\n", +- "\n", +- ] +- +- @config.expect :orig_header_include_fmt, "#include \"%s\"" +- @plugins.expect :run, '', [:include_files] +- +- @cmock_generator.create_mock_header_header(output, "MockPoutPoutFish.h") +- +- assert_equal(expected, output) +- end +- +- it "create the top of a header file with include file from plugin" do +- @config.expect :mock_prefix, "Mock" +- @config.expect :mock_suffix, "" +- @config.expect :weak, "" +- orig_filename = "PoutPoutFish.h" +- define_name = "MOCKPOUTPOUTFISH_H" +- output = [] +- expected = [ +- "/* AUTOGENERATED FILE. DO NOT EDIT. */\n", +- "#ifndef _#{define_name}\n", +- "#define _#{define_name}\n\n", +- "#include \"unity.h\"\n", +- "#include \"ConfigRequiredHeader1.h\"\n", +- "#include \"ConfigRequiredHeader2.h\"\n", +- "#include \"#{orig_filename}\"\n", +- "#include \"PluginRequiredHeader.h\"\n", +- "\n", +- "/* Ignore the following warnings, since we are copying code */\n", +- "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n", +- "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n", +- "#pragma GCC diagnostic push\n", +- "#endif\n", +- "#if !defined(__clang__)\n", +- "#pragma GCC diagnostic ignored \"-Wpragmas\"\n", +- "#endif\n", +- "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n", +- "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n", +- "#endif\n", +- "\n", +- ] +- +- @config.expect :orig_header_include_fmt, "#include \"%s\"" +- @plugins.expect :run, "#include \"PluginRequiredHeader.h\"\n", [:include_files] +- +- @cmock_generator.create_mock_header_header(output, "MockPoutPoutFish.h") +- +- assert_equal(expected, output) +- end +- +- it "write typedefs" do +- typedefs = [ 'typedef unsigned char U8;', +- 'typedef char S8;', +- 'typedef unsigned long U32;' +- ] +- output = [] +- expected = [ "\n", +- "typedef unsigned char U8;\n", +- "typedef char S8;\n", +- "typedef unsigned long U32;\n", +- "\n\n" +- ] +- +- @cmock_generator.create_typedefs(output, typedefs) +- +- assert_equal(expected, output.flatten) +- end +- +- it "create the header file service call declarations" do +- mock_name = "MockPoutPoutFish" +- +- output = [] +- expected = [ "void #{mock_name}_Init(void);\n", +- "void #{mock_name}_Destroy(void);\n", +- "void #{mock_name}_Verify(void);\n\n" +- ] +- +- @cmock_generator.create_mock_header_service_call_declarations(output) +- +- assert_equal(expected, output) +- end +- +- it "append the proper footer to the header file" do +- output = [] +- expected = ["\n", +- "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n", +- "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n", +- "#pragma GCC diagnostic pop\n", +- "#endif\n", +- "#endif\n", +- "\n", +- "#endif\n" +- ] +- +- @cmock_generator.create_mock_header_footer(output) +- +- assert_equal(expected, output) +- end +- +- it "create a proper heading for a source file" do +- output = [] +- functions = [ { :name => "uno", :args => [ { :name => "arg1" }, { :name => "arg2" } ] }, +- { :name => "dos", :args => [ { :name => "arg3" }, { :name => "arg2" } ] }, +- { :name => "tres", :args => [] } +- ] +- expected = [ "/* AUTOGENERATED FILE. DO NOT EDIT. */\n", +- "#include \n", +- "#include \n", +- "#include \n", +- "#include \"cmock.h\"\n", +- "#include \"MockPoutPoutFish.h\"\n", +- "\n", +- "static const char* CMockString_arg1 = \"arg1\";\n", +- "static const char* CMockString_arg2 = \"arg2\";\n", +- "static const char* CMockString_arg3 = \"arg3\";\n", +- "static const char* CMockString_dos = \"dos\";\n", +- "static const char* CMockString_tres = \"tres\";\n", +- "static const char* CMockString_uno = \"uno\";\n", +- "\n" +- ] +- +- @cmock_generator.create_source_header_section(output, "MockPoutPoutFish.c", functions) +- +- assert_equal(expected, output) +- end +- +- it "create the instance structure where it is needed when no functions" do +- output = [] +- functions = [] +- expected = [ "static struct MockPoutPoutFishInstance\n", +- "{\n", +- " unsigned char placeHolder;\n", +- "} Mock;\n\n" +- ].join +- +- @cmock_generator.create_instance_structure(output, functions) +- +- assert_equal(expected, output.join) +- end +- +- it "create the instance structure where it is needed when functions required" do +- output = [] +- functions = [ { :name => "First", :args => "int Candy", :return => test_return[:int] }, +- { :name => "Second", :args => "bool Smarty", :return => test_return[:string] } +- ] +- expected = [ "typedef struct _CMOCK_First_CALL_INSTANCE\n{\n", +- " UNITY_LINE_TYPE LineNumber;\n", +- " b1 b2", +- "\n} CMOCK_First_CALL_INSTANCE;\n\n", +- "typedef struct _CMOCK_Second_CALL_INSTANCE\n{\n", +- " UNITY_LINE_TYPE LineNumber;\n", +- "\n} CMOCK_Second_CALL_INSTANCE;\n\n", +- "static struct MockPoutPoutFishInstance\n{\n", +- " d1", +- " CMOCK_MEM_INDEX_TYPE First_CallInstance;\n", +- " e1 e2 e3", +- " CMOCK_MEM_INDEX_TYPE Second_CallInstance;\n", +- "} Mock;\n\n" +- ].join +- @plugins.expect :run, [" b1"," b2"], [:instance_typedefs, functions[0]] +- @plugins.expect :run, [], [:instance_typedefs, functions[1]] +- +- @plugins.expect :run, [" d1"], [:instance_structure, functions[0]] +- @plugins.expect :run, [" e1"," e2"," e3"], [:instance_structure, functions[1]] +- +- @cmock_generator.create_instance_structure(output, functions) +- +- assert_equal(expected, output.join) +- end +- +- it "create extern declarations for source file" do +- output = [] +- expected = [ "extern jmp_buf AbortFrame;\n", +- "\n" ] +- +- @cmock_generator.create_extern_declarations(output) +- +- assert_equal(expected, output.flatten) +- end +- +- it "create extern declarations for source file when using strict ordering" do +- output = [] +- expected = [ "extern jmp_buf AbortFrame;\n", +- "extern int GlobalExpectCount;\n", +- "extern int GlobalVerifyOrder;\n", +- "\n" ] +- +- @cmock_generator_strict.create_extern_declarations(output) +- +- assert_equal(expected, output.flatten) +- end +- +- it "create mock verify functions in source file when no functions specified" do +- functions = [] +- output = [] +- expected = "void MockPoutPoutFish_Verify(void)\n{\n}\n\n" +- +- @cmock_generator.create_mock_verify_function(output, functions) +- +- assert_equal(expected, output.join) +- end +- +- it "create mock verify functions in source file when extra functions specified" do +- functions = [ { :name => "First", :args => "int Candy", :return => test_return[:int] }, +- { :name => "Second", :args => "bool Smarty", :return => test_return[:string] } +- ] +- output = [] +- expected = [ "void MockPoutPoutFish_Verify(void)\n{\n", +- " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n", +- " CMOCK_MEM_INDEX_TYPE call_instance;\n", +- " call_instance = Mock.First_CallInstance;\n" + +- " Uno_First" + +- " Dos_First" + +- " call_instance = Mock.Second_CallInstance;\n" + +- " Uno_Second" + +- " Dos_Second", +- "}\n\n" +- ] +- @plugins.expect :run, [" Uno_First"," Dos_First"], [:mock_verify, functions[0]] +- @plugins.expect :run, [" Uno_Second"," Dos_Second"], [:mock_verify, functions[1]] +- +- @cmock_generator.ordered = true +- @cmock_generator.create_mock_verify_function(output, functions) +- +- assert_equal(expected, output.flatten) +- end +- +- it "create mock init functions in source file" do +- output = [] +- expected = [ "void MockPoutPoutFish_Init(void)\n{\n", +- " MockPoutPoutFish_Destroy();\n", +- "}\n\n" +- ] +- +- @cmock_generator.create_mock_init_function(output) +- +- assert_equal(expected.join, output.join) +- end +- +- it "create mock destroy functions in source file" do +- functions = [] +- output = [] +- expected = [ "void MockPoutPoutFish_Destroy(void)\n{\n", +- " CMock_Guts_MemFreeAll();\n", +- " memset(&Mock, 0, sizeof(Mock));\n", +- "}\n\n" +- ] +- +- @cmock_generator.create_mock_destroy_function(output, functions) +- +- assert_equal(expected.join, output.join) +- end +- +- it "create mock destroy functions in source file when specified with strict ordering" do +- functions = [ { :name => "First", :args => "int Candy", :return => test_return[:int] }, +- { :name => "Second", :args => "bool Smarty", :return => test_return[:string] } +- ] +- output = [] +- expected = [ "void MockPoutPoutFish_Destroy(void)\n{\n", +- " CMock_Guts_MemFreeAll();\n", +- " memset(&Mock, 0, sizeof(Mock));\n", +- " uno", +- " GlobalExpectCount = 0;\n", +- " GlobalVerifyOrder = 0;\n", +- "}\n\n" +- ] +- @plugins.expect :run, [], [:mock_destroy, functions[0]] +- @plugins.expect :run, [" uno"], [:mock_destroy, functions[1]] +- +- @cmock_generator_strict.create_mock_destroy_function(output, functions) +- +- assert_equal(expected.join, output.join) +- end +- +- it "create mock implementation functions in source file" do +- function = { :modifier => "static", +- :return => test_return[:int], +- :args_string => "uint32 sandwiches, const char* named", +- :args => ["uint32 sandwiches", "const char* named"], +- :var_arg => nil, +- :name => "SupaFunction", +- :unscoped_name => "SupaFunction", +- :namespace => [], +- :class => nil, +- :attributes => "__inline" +- } +- output = [] +- expected = [ "static int SupaFunction(uint32 sandwiches, const char* named)\n", +- "{\n", +- " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n", +- " CMOCK_SupaFunction_CALL_INSTANCE* cmock_call_instance;\n", +- " UNITY_SET_DETAIL(CMockString_SupaFunction);\n", +- " cmock_call_instance = (CMOCK_SupaFunction_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.SupaFunction_CallInstance);\n", +- " Mock.SupaFunction_CallInstance = CMock_Guts_MemNext(Mock.SupaFunction_CallInstance);\n", +- " uno", +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n", +- " cmock_line = cmock_call_instance->LineNumber;\n", +- " dos", +- " tres", +- " UNITY_CLR_DETAILS();\n", +- " return cmock_call_instance->ReturnVal;\n", +- "}\n\n" +- ] +- @plugins.expect :run, [" uno"], [:mock_implementation_precheck, function] +- @plugins.expect :run, [" dos"," tres"], [:mock_implementation, function] +- +- @cmock_generator.create_mock_implementation(output, function) +- +- assert_equal(expected.join, output.join) +- end +- +- it "create mock implementation functions in source file with different options" do +- function = { :modifier => "", +- :c_calling_convention => "__stdcall", +- :return => test_return[:int], +- :args_string => "uint32 sandwiches", +- :args => ["uint32 sandwiches"], +- :var_arg => "corn ...", +- :name => "SupaFunction", +- :unscoped_name => "SupaFunction", +- :namespace => [], +- :class => nil, +- :attributes => nil +- } +- output = [] +- expected = [ "int __stdcall SupaFunction(uint32 sandwiches, corn ...)\n", +- "{\n", +- " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n", +- " CMOCK_SupaFunction_CALL_INSTANCE* cmock_call_instance;\n", +- " UNITY_SET_DETAIL(CMockString_SupaFunction);\n", +- " cmock_call_instance = (CMOCK_SupaFunction_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.SupaFunction_CallInstance);\n", +- " Mock.SupaFunction_CallInstance = CMock_Guts_MemNext(Mock.SupaFunction_CallInstance);\n", +- " uno", +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n", +- " cmock_line = cmock_call_instance->LineNumber;\n", +- " dos", +- " tres", +- " UNITY_CLR_DETAILS();\n", +- " return cmock_call_instance->ReturnVal;\n", +- "}\n\n" +- ] +- @plugins.expect :run, [" uno"], [:mock_implementation_precheck, function] +- @plugins.expect :run, [" dos"," tres"], [:mock_implementation, function] +- +- @cmock_generator.create_mock_implementation(output, function) +- +- assert_equal(expected.join, output.join) +- end +- +- it "create mock implementation function in source file for C++ static member" do +- function = { :modifier => "static", +- :return => test_return[:int], +- :args_string => "uint32 sandwiches, const char* named", +- :args => ["uint32 sandwiches", "const char* named"], +- :var_arg => nil, +- :unscoped_name => "SupaFunction", +- :namespace => ["ns1", "ns2"], +- :class => "SupaClass", +- :name => "ns1_ns2_SupaClass_SupaFunction", +- :attributes => nil +- } +- output = [] +- expected = [ "namespace ns1 {\n", +- "namespace ns2 {\n", +- "static int SupaClass::SupaFunction(uint32 sandwiches, const char* named)\n", +- "{\n", +- " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n", +- " CMOCK_ns1_ns2_SupaClass_SupaFunction_CALL_INSTANCE* cmock_call_instance;\n", +- " UNITY_SET_DETAIL(CMockString_ns1_ns2_SupaClass_SupaFunction);\n", +- " cmock_call_instance = (CMOCK_ns1_ns2_SupaClass_SupaFunction_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.ns1_ns2_SupaClass_SupaFunction_CallInstance);\n", +- " Mock.ns1_ns2_SupaClass_SupaFunction_CallInstance = CMock_Guts_MemNext(Mock.ns1_ns2_SupaClass_SupaFunction_CallInstance);\n", +- " uno", +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n", +- " cmock_line = cmock_call_instance->LineNumber;\n", +- " dos", +- " tres", +- " UNITY_CLR_DETAILS();\n", +- " return cmock_call_instance->ReturnVal;\n", +- "}\n", +- "}\n", +- "}\n\n", +- ] +- @plugins.expect :run, [" uno"], [:mock_implementation_precheck, function] +- @plugins.expect :run, [" dos"," tres"], [:mock_implementation, function] +- +- @cmock_generator.create_mock_implementation(output, function) +- +- assert_equal(expected.join, output.join) +- end +- +- it "create mock implementation functions in source file with different options for C++ static member" do +- function = { :modifier => "static", +- :c_calling_convention => "__stdcall", +- :return => test_return[:int], +- :args_string => "uint32 sandwiches", +- :args => ["uint32 sandwiches"], +- :var_arg => "corn ...", +- :name => "SupaClass_SupaFunction", +- :unscoped_name => "SupaFunction", +- :namespace => [], +- :class => "SupaClass", +- :attributes => nil +- } +- output = [] +- expected = [ "static int __stdcall SupaClass::SupaFunction(uint32 sandwiches, corn ...)\n", +- "{\n", +- " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n", +- " CMOCK_SupaClass_SupaFunction_CALL_INSTANCE* cmock_call_instance;\n", +- " UNITY_SET_DETAIL(CMockString_SupaClass_SupaFunction);\n", +- " cmock_call_instance = (CMOCK_SupaClass_SupaFunction_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.SupaClass_SupaFunction_CallInstance);\n", +- " Mock.SupaClass_SupaFunction_CallInstance = CMock_Guts_MemNext(Mock.SupaClass_SupaFunction_CallInstance);\n", +- " uno", +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n", +- " cmock_line = cmock_call_instance->LineNumber;\n", +- " dos", +- " tres", +- " UNITY_CLR_DETAILS();\n", +- " return cmock_call_instance->ReturnVal;\n", +- "}\n\n" +- ] +- @plugins.expect :run, [" uno"], [:mock_implementation_precheck, function] +- @plugins.expect :run, [" dos"," tres"], [:mock_implementation, function] +- +- @cmock_generator.create_mock_implementation(output, function) +- +- assert_equal(expected.join, output.join) +- end +- +- it "creates using statements for C++ static member in namespace" do +- function = { :modifier => "static", +- :return => test_return[:int], +- :args_string => "uint32 sandwiches", +- :args => ["uint32 sandwiches"], +- :var_arg => nil, +- :unscoped_name => "SupaFunction", +- :namespace => ["ns1"], +- :class => "SupaClass", +- :name => "ns1_SupaClass_SupaFunction", +- :attributes => nil +- } +- output = [] +- expected = "using namespace ns1;\n" +- +- @cmock_generator.create_using_statement(output, function) +- +- assert_equal(expected, output.join) +- end +- +- it "creates using statements for C++ static member in nested namespace" do +- function = { :modifier => "static", +- :return => test_return[:int], +- :args_string => "uint32 sandwiches", +- :args => ["uint32 sandwiches"], +- :var_arg => nil, +- :unscoped_name => "SupaFunction", +- :namespace => ["ns1", "ns2"], +- :class => "SupaClass", +- :name => "ns1_ns2_SupaClass_SupaFunction", +- :attributes => nil +- } +- output = [] +- expected = "using namespace ns1::ns2;\n" +- +- @cmock_generator.create_using_statement(output, function) +- +- assert_equal(expected, output.join) +- end +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_array_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_array_test.rb +deleted file mode 100644 +index 64c0b2838d..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_array_test.rb ++++ /dev/null +@@ -1,141 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_array' +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_utils' +- +-class UtilsStub +- def helpers +- {} +- end +- def arg_type_with_const(arg) +- CMockGeneratorUtils.arg_type_with_const(arg) +- end +- def code_add_base_expectation(func) +- "mock_retval_0" +- end +-end +- +-describe CMockGeneratorPluginArray, "Verify CMockPGeneratorluginArray Module" do +- before do +- #no strict ordering +- @config = create_stub( +- :when_ptr => :compare_data, +- :enforce_strict_ordering => false, +- :respond_to? => true ) +- +- @utils = UtilsStub.new +- +- @cmock_generator_plugin_array = CMockGeneratorPluginArray.new(@config, @utils) +- end +- +- after do +- end +- +- it "have set up internal priority" do +- assert_nil(@cmock_generator_plugin_array.unity_helper) +- assert_equal(8, @cmock_generator_plugin_array.priority) +- end +- +- it "not include any additional include files" do +- assert(!@cmock_generator_plugin_array.respond_to?(:include_files)) +- end +- +- it "not add to typedef structure for functions of style 'int* func(void)'" do +- function = {:name => "Oak", :args => [], :return => test_return[:int_ptr]} +- returned = @cmock_generator_plugin_array.instance_typedefs(function) +- assert_equal("", returned) +- end +- +- it "add to tyepdef structure mock needs of functions of style 'void func(int chicken, int* pork)'" do +- function = {:name => "Cedar", :args => [{ :name => "chicken", :type => "int", :ptr? => false}, { :name => "pork", :type => "int*", :ptr? => true}], :return => test_return[:void]} +- expected = " int Expected_pork_Depth;\n" +- returned = @cmock_generator_plugin_array.instance_typedefs(function) +- assert_equal(expected, returned) +- end +- +- it "not add an additional mock interface for functions not containing pointers" do +- function = {:name => "Maple", :args_string => "int blah", :return => test_return[:string], :contains_ptr? => false} +- returned = @cmock_generator_plugin_array.mock_function_declarations(function) +- assert_nil(returned) +- end +- +- it "add another mock function declaration for functions of style 'void func(int* tofu)'" do +- function = {:name => "Pine", +- :args => [{ :type => "int*", +- :name => "tofu", +- :ptr? => true, +- }], +- :return => test_return[:void], +- :contains_ptr? => true } +- +- expected = "#define #{function[:name]}_ExpectWithArray(tofu, tofu_Depth) #{function[:name]}_CMockExpectWithArray(__LINE__, tofu, tofu_Depth)\n" + +- "void #{function[:name]}_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, int* tofu, int tofu_Depth);\n" +- returned = @cmock_generator_plugin_array.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add another mock function declaration for functions of style 'const char* func(int* tofu)'" do +- function = {:name => "Pine", +- :args => [{ :type => "int*", +- :name => "tofu", +- :ptr? => true, +- }], +- :return => test_return[:string], +- :contains_ptr? => true } +- +- expected = "#define #{function[:name]}_ExpectWithArrayAndReturn(tofu, tofu_Depth, cmock_retval) #{function[:name]}_CMockExpectWithArrayAndReturn(__LINE__, tofu, tofu_Depth, cmock_retval)\n" + +- "void #{function[:name]}_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, int* tofu, int tofu_Depth, const char* cmock_to_return);\n" +- returned = @cmock_generator_plugin_array.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add another mock function declaration for functions of style 'const char* func(const int* tofu)'" do +- function = {:name => "Pine", +- :args => [{ :type => "const int*", +- :name => "tofu", +- :ptr? => true, +- :const? => true, +- }], +- :return => test_return[:string], +- :contains_ptr? => true } +- +- expected = "#define #{function[:name]}_ExpectWithArrayAndReturn(tofu, tofu_Depth, cmock_retval) #{function[:name]}_CMockExpectWithArrayAndReturn(__LINE__, tofu, tofu_Depth, cmock_retval)\n" + +- "void #{function[:name]}_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, const int* tofu, int tofu_Depth, const char* cmock_to_return);\n" +- returned = @cmock_generator_plugin_array.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "not have a mock function implementation" do +- assert(!@cmock_generator_plugin_array.respond_to?(:mock_implementation)) +- end +- +- it "not have a mock interfaces for functions of style 'int* func(void)'" do +- function = {:name => "Pear", :args => [], :args_string => "void", :return => test_return[:int_ptr]} +- returned = @cmock_generator_plugin_array.mock_interfaces(function) +- assert_nil(returned) +- end +- +- it "add mock interfaces for functions of style 'int* func(int* pescado, int pes)'" do +- function = {:name => "Lemon", +- :args => [{ :type => "int*", :name => "pescado", :ptr? => true}, { :type => "int", :name => "pes", :ptr? => false}], +- :args_string => "int* pescado, int pes", +- :return => test_return[:int_ptr], +- :contains_ptr? => true } +- +- expected = ["void Lemon_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, int* pescado, int pescado_Depth, int pes, int* cmock_to_return)\n", +- "{\n", +- "mock_retval_0", +- " CMockExpectParameters_Lemon(cmock_call_instance, pescado, pescado_Depth, pes);\n", +- " cmock_call_instance->ReturnVal = cmock_to_return;\n", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_array.mock_interfaces(function).join +- assert_equal(expected, returned) +- end +- +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_callback_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_callback_test.rb +deleted file mode 100644 +index 0b5ce1eb8a..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_callback_test.rb ++++ /dev/null +@@ -1,281 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_callback' +- +-describe CMockGeneratorPluginCallback, "Verify CMockGeneratorPluginCallback Module" do +- +- before do +- create_mocks :config, :utils +- +- @config.expect :callback_include_count, true +- @config.expect :callback_after_arg_check, false +- @config.expect :plugins, [:ignore] +- +- @cmock_generator_plugin_callback = CMockGeneratorPluginCallback.new(@config, @utils) +- end +- +- after do +- end +- +- it "have set up internal priority" do +- assert_equal(6, @cmock_generator_plugin_callback.priority) +- end +- +- it "not include any additional include files" do +- assert(!@cmock_generator_plugin_callback.respond_to?(:include_files)) +- end +- +- it "add to instance structure" do +- function = {:name => "Oak", :args => [:type => "int*", :name => "blah", :ptr? => true], :return => test_return[:int_ptr]} +- expected = " char Oak_CallbackBool;\n" + +- " CMOCK_Oak_CALLBACK Oak_CallbackFunctionPointer;\n" + +- " int Oak_CallbackCalls;\n" +- returned = @cmock_generator_plugin_callback.instance_structure(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for function without arguments" do +- function = {:name => "Maple", :args_string => "void", :args => [], :return => test_return[:void]} +- expected = [ "typedef void (* CMOCK_Maple_CALLBACK)(int cmock_num_calls);\n", +- "void Maple_AddCallback(CMOCK_Maple_CALLBACK Callback);\n", +- "void Maple_Stub(CMOCK_Maple_CALLBACK Callback);\n", +- "#define Maple_StubWithCallback Maple_Stub\n" ].join +- returned = @cmock_generator_plugin_callback.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for function without arguments when count is also turned off" do +- function = {:name => "Maple", :args_string => "void", :args => [], :return => test_return[:void]} +- expected = [ "typedef void (* CMOCK_Maple_CALLBACK)(void);\n", +- "void Maple_AddCallback(CMOCK_Maple_CALLBACK Callback);\n", +- "void Maple_Stub(CMOCK_Maple_CALLBACK Callback);\n", +- "#define Maple_StubWithCallback Maple_Stub\n" ].join +- @cmock_generator_plugin_callback.include_count = false +- returned = @cmock_generator_plugin_callback.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for function with arguments" do +- function = {:name => "Maple", :args_string => "int* tofu", :args => [1], :return => test_return[:void]} +- expected = [ "typedef void (* CMOCK_Maple_CALLBACK)(int* tofu, int cmock_num_calls);\n", +- "void Maple_AddCallback(CMOCK_Maple_CALLBACK Callback);\n", +- "void Maple_Stub(CMOCK_Maple_CALLBACK Callback);\n", +- "#define Maple_StubWithCallback Maple_Stub\n" ].join +- returned = @cmock_generator_plugin_callback.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for function with return values" do +- function = {:name => "Maple", :args_string => "int* tofu", :args => [1], :return => test_return[:string]} +- expected = [ "typedef const char* (* CMOCK_Maple_CALLBACK)(int* tofu, int cmock_num_calls);\n", +- "void Maple_AddCallback(CMOCK_Maple_CALLBACK Callback);\n", +- "void Maple_Stub(CMOCK_Maple_CALLBACK Callback);\n", +- "#define Maple_StubWithCallback Maple_Stub\n" ].join +- returned = @cmock_generator_plugin_callback.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for function with return values and count is turned off" do +- function = {:name => "Maple", :args_string => "int* tofu", :args => [1], :return => test_return[:string]} +- expected = [ "typedef const char* (* CMOCK_Maple_CALLBACK)(int* tofu);\n", +- "void Maple_AddCallback(CMOCK_Maple_CALLBACK Callback);\n", +- "void Maple_Stub(CMOCK_Maple_CALLBACK Callback);\n", +- "#define Maple_StubWithCallback Maple_Stub\n" ].join +- @cmock_generator_plugin_callback.include_count = false +- returned = @cmock_generator_plugin_callback.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions with no arg check and of style 'void func(void)'" do +- function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:void]} +- expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " Mock.Apple_CallbackFunctionPointer(Mock.Apple_CallbackCalls++);\n", +- " }\n" +- ].join +- returned = @cmock_generator_plugin_callback.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions with no arg check and of style 'void func(void)' when count turned off" do +- function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:void]} +- expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " Mock.Apple_CallbackFunctionPointer();\n", +- " }\n" +- ].join +- @cmock_generator_plugin_callback.include_count = false +- returned = @cmock_generator_plugin_callback.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions with no arg check and of style 'int func(void)'" do +- function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:int]} +- expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " cmock_call_instance->ReturnVal = Mock.Apple_CallbackFunctionPointer(Mock.Apple_CallbackCalls++);\n", +- " }\n" +- ].join +- returned = @cmock_generator_plugin_callback.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions with no arg check and of style 'void func(int* steak, uint8_t flag)'" do +- function = {:name => "Apple", +- :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, +- { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], +- :args_string => "int* steak, uint8_t flag", +- :return=> test_return[:void]} +- expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n", +- " }\n" +- ].join +- returned = @cmock_generator_plugin_callback.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions with no arg check and of style 'void func(int* steak, uint8_t flag)' when count turned off" do +- function = {:name => "Apple", +- :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, +- { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], +- :args_string => "int* steak, uint8_t flag", +- :return=> test_return[:void]} +- expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " Mock.Apple_CallbackFunctionPointer(steak, flag);\n", +- " }\n" +- ].join +- @cmock_generator_plugin_callback.include_count = false +- returned = @cmock_generator_plugin_callback.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions with no arg check and of style 'int16_t func(int* steak, uint8_t flag)'" do +- function = {:name => "Apple", +- :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, +- { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], +- :args_string => "int* steak, uint8_t flag", +- :return => test_return[:int]} +- expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " cmock_call_instance->ReturnVal = Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n", +- " }\n" +- ].join +- returned = @cmock_generator_plugin_callback.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions without arg check and of style 'void func(void)' when count turned off" do +- function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:void]} +- expected = [" if (!Mock.Apple_CallbackBool &&\n", +- " Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " Mock.Apple_CallbackFunctionPointer();\n", +- " UNITY_CLR_DETAILS();\n", +- " return;\n", +- " }\n" +- ].join +- @cmock_generator_plugin_callback.include_count = false +- returned = @cmock_generator_plugin_callback.mock_implementation_precheck(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions without arg check and of style 'int func(void)'" do +- function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:int]} +- expected = [" if (!Mock.Apple_CallbackBool &&\n", +- " Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " int cmock_cb_ret = Mock.Apple_CallbackFunctionPointer(Mock.Apple_CallbackCalls++);\n", +- " UNITY_CLR_DETAILS();\n", +- " return cmock_cb_ret;\n", +- " }\n" +- ].join +- returned = @cmock_generator_plugin_callback.mock_implementation_precheck(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions without arg check and of style 'void func(int* steak, uint8_t flag)'" do +- function = {:name => "Apple", +- :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, +- { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], +- :args_string => "int* steak, uint8_t flag", +- :return=> test_return[:void]} +- expected = [" if (!Mock.Apple_CallbackBool &&\n", +- " Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n", +- " UNITY_CLR_DETAILS();\n", +- " return;\n", +- " }\n" +- ].join +- returned = @cmock_generator_plugin_callback.mock_implementation_precheck(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions without arg check and of style 'void func(int* steak, uint8_t flag)' when count turned off" do +- function = {:name => "Apple", +- :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, +- { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], +- :args_string => "int* steak, uint8_t flag", +- :return=> test_return[:void]} +- expected = [" if (!Mock.Apple_CallbackBool &&\n", +- " Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " Mock.Apple_CallbackFunctionPointer(steak, flag);\n", +- " UNITY_CLR_DETAILS();\n", +- " return;\n", +- " }\n" +- ].join +- @cmock_generator_plugin_callback.include_count = false +- returned = @cmock_generator_plugin_callback.mock_implementation_precheck(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions without arg check and of style 'int16_t func(int* steak, uint8_t flag)'" do +- function = {:name => "Apple", +- :args => [ { :type => 'int*', :name => 'steak', :ptr? => true}, +- { :type => 'uint8_t', :name => 'flag', :ptr? => false} ], +- :args_string => "int* steak, uint8_t flag", +- :return => test_return[:int]} +- expected = [" if (!Mock.Apple_CallbackBool &&\n", +- " Mock.Apple_CallbackFunctionPointer != NULL)\n", +- " {\n", +- " int cmock_cb_ret = Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n", +- " UNITY_CLR_DETAILS();\n", +- " return cmock_cb_ret;\n", +- " }\n" +- ].join +- returned = @cmock_generator_plugin_callback.mock_implementation_precheck(function) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for functions " do +- function = {:name => "Lemon", +- :args => [{ :type => "char*", :name => "pescado"}], +- :args_string => "char* pescado", +- :return => test_return[:int] +- } +- +- expected = ["void Lemon_AddCallback(CMOCK_Lemon_CALLBACK Callback)\n", +- "{\n", +- " Mock.Lemon_IgnoreBool = (char)0;\n", +- " Mock.Lemon_CallbackBool = (char)1;\n", +- " Mock.Lemon_CallbackFunctionPointer = Callback;\n", +- "}\n\n", +- "void Lemon_Stub(CMOCK_Lemon_CALLBACK Callback)\n", +- "{\n", +- " Mock.Lemon_IgnoreBool = (char)0;\n", +- " Mock.Lemon_CallbackBool = (char)0;\n", +- " Mock.Lemon_CallbackFunctionPointer = Callback;\n", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_callback.mock_interfaces(function) +- assert_equal(expected, returned) +- end +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_cexception_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_cexception_test.rb +deleted file mode 100644 +index 19699ea35c..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_cexception_test.rb ++++ /dev/null +@@ -1,96 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_cexception' +- +-describe CMockGeneratorPluginCexception, "Verify CMockGeneratorPluginCexception Module" do +- +- before do +- create_mocks :config, :utils +- @cmock_generator_plugin_cexception = CMockGeneratorPluginCexception.new(@config, @utils) +- end +- +- after do +- end +- +- it "have set up internal priority" do +- assert_equal(7, @cmock_generator_plugin_cexception.priority) +- end +- +- it "include the cexception library" do +- expected = "#include \"CException.h\"\n" +- returned = @cmock_generator_plugin_cexception.include_files +- assert_equal(expected, returned) +- end +- +- it "add to typedef structure mock needs" do +- function = { :name => "Oak", :args => [], :return => test_return[:void] } +- expected = " CEXCEPTION_T ExceptionToThrow;\n" +- returned = @cmock_generator_plugin_cexception.instance_typedefs(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declarations for functions without arguments" do +- function = { :name => "Spruce", :args_string => "void", :return => test_return[:void] } +- expected = "#define Spruce_ExpectAndThrow(cmock_to_throw) Spruce_CMockExpectAndThrow(__LINE__, cmock_to_throw)\n"+ +- "void Spruce_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, CEXCEPTION_T cmock_to_throw);\n" +- returned = @cmock_generator_plugin_cexception.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declarations for functions with arguments" do +- function = { :name => "Spruce", :args_string => "const char* Petunia, uint32_t Lily", :args_call => "Petunia, Lily", :return => test_return[:void] } +- expected = "#define Spruce_ExpectAndThrow(Petunia, Lily, cmock_to_throw) Spruce_CMockExpectAndThrow(__LINE__, Petunia, Lily, cmock_to_throw)\n" + +- "void Spruce_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, const char* Petunia, uint32_t Lily, CEXCEPTION_T cmock_to_throw);\n" +- returned = @cmock_generator_plugin_cexception.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add a mock implementation" do +- function = {:name => "Cherry", :args => [], :return => test_return[:void]} +- expected = " if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)\n" + +- " {\n" + +- " UNITY_CLR_DETAILS();\n" + +- " Throw(cmock_call_instance->ExceptionToThrow);\n" + +- " }\n" +- returned = @cmock_generator_plugin_cexception.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for functions without arguments" do +- function = {:name => "Pear", :args_string => "void", :args => [], :return => test_return[:void]} +- @utils.expect :code_add_base_expectation, "mock_retval_0", ["Pear"] +- @utils.expect :code_call_argument_loader, "", [function] +- +- expected = ["void Pear_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, CEXCEPTION_T cmock_to_throw)\n", +- "{\n", +- "mock_retval_0", +- "", +- " cmock_call_instance->ExceptionToThrow = cmock_to_throw;\n", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_cexception.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +- it "add a mock interfaces for functions with arguments" do +- function = {:name => "Pear", :args_string => "int blah", :args => [{ :type => "int", :name => "blah" }], :return => test_return[:void]} +- @utils.expect :code_add_base_expectation, "mock_retval_0", ["Pear"] +- @utils.expect :code_call_argument_loader, "mock_return_1", [function] +- +- expected = ["void Pear_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, int blah, CEXCEPTION_T cmock_to_throw)\n", +- "{\n", +- "mock_retval_0", +- "mock_return_1", +- " cmock_call_instance->ExceptionToThrow = cmock_to_throw;\n", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_cexception.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +deleted file mode 100644 +index dd86689a0d..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb ++++ /dev/null +@@ -1,185 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect' +- +-describe CMockGeneratorPluginExpect, "Verify CMockGeneratorPluginExpect Module Without Global Ordering" do +- +- before do +- create_mocks :config, :utils +- +- @config = create_stub( +- :when_ptr => :compare_data, +- :enforce_strict_ordering => false, +- :respond_to? => true, +- :plugins => [ :expect ] ) +- +- @utils.expect :helpers, {} +- @cmock_generator_plugin_expect = CMockGeneratorPluginExpect.new(@config, @utils) +- end +- +- after do +- end +- +- it "have set up internal priority on init" do +- assert_nil(@cmock_generator_plugin_expect.unity_helper) +- assert_equal(5, @cmock_generator_plugin_expect.priority) +- end +- +- it "not include any additional include files" do +- assert(!@cmock_generator_plugin_expect.respond_to?(:include_files)) +- end +- +- it "add to typedef structure mock needs of functions of style 'void func(void)'" do +- function = {:name => "Oak", :args => [], :return => test_return[:void]} +- expected = "" +- returned = @cmock_generator_plugin_expect.instance_typedefs(function) +- assert_equal(expected, returned) +- end +- +- it "add to typedef structure mock needs of functions of style 'int func(void)'" do +- function = {:name => "Elm", :args => [], :return => test_return[:int]} +- expected = " int ReturnVal;\n" +- returned = @cmock_generator_plugin_expect.instance_typedefs(function) +- assert_equal(expected, returned) +- end +- +- it "add to typedef structure mock needs of functions of style 'void func(int chicken, char* pork)'" do +- function = {:name => "Cedar", :args => [{ :name => "chicken", :type => "int"}, { :name => "pork", :type => "char*"}], :return => test_return[:void]} +- expected = " int Expected_chicken;\n char* Expected_pork;\n" +- returned = @cmock_generator_plugin_expect.instance_typedefs(function) +- assert_equal(expected, returned) +- end +- +- it "add to typedef structure mock needs of functions of style 'int func(float beef)'" do +- function = {:name => "Birch", :args => [{ :name => "beef", :type => "float"}], :return => test_return[:int]} +- expected = " int ReturnVal;\n float Expected_beef;\n" +- returned = @cmock_generator_plugin_expect.instance_typedefs(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for functions of style 'void func(void)'" do +- function = {:name => "Maple", :args => [], :return => test_return[:void]} +- expected = "#define Maple_Expect() Maple_CMockExpect(__LINE__)\n" + +- "void Maple_CMockExpect(UNITY_LINE_TYPE cmock_line);\n" +- returned = @cmock_generator_plugin_expect.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for functions of style 'int func(void)'" do +- function = {:name => "Spruce", :args => [], :return => test_return[:int]} +- expected = "#define Spruce_ExpectAndReturn(cmock_retval) Spruce_CMockExpectAndReturn(__LINE__, cmock_retval)\n" + +- "void Spruce_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return);\n" +- returned = @cmock_generator_plugin_expect.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for functions of style 'const char* func(int tofu)'" do +- function = {:name => "Pine", :args => ["int tofu"], :args_string => "int tofu", :args_call => 'tofu', :return => test_return[:string]} +- expected = "#define Pine_ExpectAndReturn(tofu, cmock_retval) Pine_CMockExpectAndReturn(__LINE__, tofu, cmock_retval)\n" + +- "void Pine_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int tofu, const char* cmock_to_return);\n" +- returned = @cmock_generator_plugin_expect.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions of style 'void func(void)'" do +- function = {:name => "Apple", :args => [], :return => test_return[:void]} +- expected = "" +- returned = @cmock_generator_plugin_expect.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions of style 'int func(int veal, unsigned int sushi)'" do +- function = {:name => "Cherry", :args => [ { :type => "int", :name => "veal" }, { :type => "unsigned int", :name => "sushi" } ], :return => test_return[:int]} +- +- @utils.expect :code_verify_an_arg_expectation, " mocked_retval_1", [function, function[:args][0]] +- @utils.expect :code_verify_an_arg_expectation, " mocked_retval_2", [function, function[:args][1]] +- expected = " mocked_retval_1 mocked_retval_2" +- returned = @cmock_generator_plugin_expect.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation using ordering if needed" do +- function = {:name => "Apple", :args => [], :return => test_return[:void]} +- expected = "" +- @cmock_generator_plugin_expect.ordered = true +- returned = @cmock_generator_plugin_expect.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for functions of style 'void func(void)'" do +- function = {:name => "Pear", :args => [], :args_string => "void", :return => test_return[:void]} +- @utils.expect :code_add_base_expectation, "mock_retval_0 ", ["Pear"] +- @utils.expect :code_call_argument_loader, "mock_retval_1 ", [function] +- expected = ["void Pear_CMockExpect(UNITY_LINE_TYPE cmock_line)\n", +- "{\n", +- "mock_retval_0 ", +- "mock_retval_1 ", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_expect.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for functions of style 'int func(void)'" do +- function = {:name => "Orange", :args => [], :args_string => "void", :return => test_return[:int]} +- @utils.expect :code_add_base_expectation, "mock_retval_0 ", ["Orange"] +- @utils.expect :code_call_argument_loader, "mock_retval_1 ", [function] +- @utils.expect :code_assign_argument_quickly, "mock_retval_2", ["cmock_call_instance->ReturnVal", function[:return]] +- expected = ["void Orange_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return)\n", +- "{\n", +- "mock_retval_0 ", +- "mock_retval_1 ", +- "mock_retval_2", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_expect.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for functions of style 'int func(char* pescado)'" do +- function = {:name => "Lemon", :args => [{ :type => "char*", :name => "pescado"}], :args_string => "char* pescado", :return => test_return[:int]} +- @utils.expect :code_add_base_expectation, "mock_retval_0 ", ["Lemon"] +- @utils.expect :code_call_argument_loader, "mock_retval_1 ", [function] +- @utils.expect :code_assign_argument_quickly, "mock_retval_2", ["cmock_call_instance->ReturnVal", function[:return]] +- expected = ["void Lemon_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, char* pescado, int cmock_to_return)\n", +- "{\n", +- "mock_retval_0 ", +- "mock_retval_1 ", +- "mock_retval_2", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_expect.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for functions when using ordering" do +- function = {:name => "Pear", :args => [], :args_string => "void", :return => test_return[:void]} +- @utils.expect :code_add_base_expectation, "mock_retval_0 ", ["Pear"] +- @utils.expect :code_call_argument_loader, "mock_retval_1 ", [function] +- expected = ["void Pear_CMockExpect(UNITY_LINE_TYPE cmock_line)\n", +- "{\n", +- "mock_retval_0 ", +- "mock_retval_1 ", +- "}\n\n" +- ].join +- @cmock_generator_plugin_expect.ordered = true +- returned = @cmock_generator_plugin_expect.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +- it "add mock verify lines" do +- function = {:name => "Banana" } +- expected = " if (CMOCK_GUTS_NONE != call_instance)\n" \ +- " {\n" \ +- " UNITY_SET_DETAIL(CMockString_Banana);\n" \ +- " UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess);\n" \ +- " }\n" +- returned = @cmock_generator_plugin_expect.mock_verify(function) +- assert_equal(expected, returned) +- end +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +deleted file mode 100644 +index 5a014d6e3a..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb ++++ /dev/null +@@ -1,67 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect_any_args.rb' +- +-describe CMockGeneratorPluginExpectAnyArgs, "Verify CMockGeneratorPluginExpectAnyArgs Module" do +- +- before do +- create_mocks :config, :utils +- @config = create_stub(:respond_to? => true) +- @cmock_generator_plugin_expect_any_args = CMockGeneratorPluginExpectAnyArgs.new(@config, @utils) +- end +- +- after do +- end +- +- it "have set up internal priority" do +- assert_equal(3, @cmock_generator_plugin_expect_any_args.priority) +- end +- +- it "not have any additional include file requirements" do +- assert(!@cmock_generator_plugin_expect_any_args.respond_to?(:include_files)) +- end +- +- it "ignore functions without arguments" do +- function = {:name => "Mold", :args_string => "void", :args => [], :return => test_return[:void]} +- expected = "" +- returned = @cmock_generator_plugin_expect_any_args.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "handle function declarations for functions without return values" do +- function = {:name => "Mold", :args_string => "int meh", :args => [ :stuff ], :return => test_return[:void]} +- expected = "#define Mold_ExpectAnyArgs() Mold_CMockExpectAnyArgs(__LINE__)\nvoid Mold_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line);\n" +- returned = @cmock_generator_plugin_expect_any_args.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "handle function declarations for functions that returns something" do +- function = {:name => "Fungus", :args_string => "int meh", :args => [ :stuff ], :return => test_return[:string]} +- expected = "#define Fungus_ExpectAnyArgsAndReturn(cmock_retval) Fungus_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval)\n"+ +- "void Fungus_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, const char* cmock_to_return);\n" +- returned = @cmock_generator_plugin_expect_any_args.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "should not respond to implementation requests" do +- assert(!@cmock_generator_plugin_expect_any_args.respond_to?(:mock_implementation)) +- end +- +- it "add a new mock interface for ignoring when function had no return value" do +- function = {:name => "Slime", :args_string => "int meh", :args => [ :stuff ], :return => test_return[:void]} +- expected = ["void Slime_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line)\n", +- "{\n", +- "mock_return_1", +- " cmock_call_instance->ExpectAnyArgsBool = (char)1;\n", +- "}\n\n" +- ].join +- @utils.expect :code_add_base_expectation, "mock_return_1", ["Slime", true] +- returned = @cmock_generator_plugin_expect_any_args.mock_interfaces(function) +- assert_equal(expected, returned) +- end +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +deleted file mode 100644 +index 35d48715c6..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb ++++ /dev/null +@@ -1,201 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect' +- +-describe CMockGeneratorPluginExpect, "Verify CMockGeneratorPluginExpect Module with Global Ordering" do +- +- before do +- create_mocks :config, :utils +- +- @config = create_stub( +- :when_ptr => :compare_data, +- :enforce_strict_ordering => true, +- :respond_to? => true, +- :plugins => [ :expect, :expect_any_args ] ) +- +- @utils.expect :helpers, {} +- @cmock_generator_plugin_expect = CMockGeneratorPluginExpect.new(@config, @utils) +- end +- +- after do +- end +- +- it "have set up internal priority on init" do +- assert_nil(@cmock_generator_plugin_expect.unity_helper) +- assert_equal(5, @cmock_generator_plugin_expect.priority) +- end +- +- it "not include any additional include files" do +- assert(!@cmock_generator_plugin_expect.respond_to?(:include_files)) +- end +- +- it "add to typedef structure mock needs of functions of style 'void func(void)' and global ordering" do +- function = {:name => "Oak", :args => [], :return => test_return[:void]} +- expected = " int CallOrder;\n" +- returned = @cmock_generator_plugin_expect.instance_typedefs(function) +- assert_equal(expected, returned) +- end +- +- it "add to typedef structure mock needs of functions of style 'int func(void)'" do +- function = {:name => "Elm", :args => [], :return => test_return[:int]} +- expected = " int ReturnVal;\n int CallOrder;\n" +- returned = @cmock_generator_plugin_expect.instance_typedefs(function) +- assert_equal(expected, returned) +- end +- +- it "add to typedef structure mock needs of functions of style 'void func(int chicken, char* pork)'" do +- function = {:name => "Cedar", :args => [{ :name => "chicken", :type => "int"}, { :name => "pork", :type => "char*"}], :return => test_return[:void]} +- expected = " int CallOrder;\n int Expected_chicken;\n char* Expected_pork;\n" +- returned = @cmock_generator_plugin_expect.instance_typedefs(function) +- assert_equal(expected, returned) +- end +- +- it "add to typedef structure mock needs of functions of style 'int func(float beef)'" do +- function = {:name => "Birch", :args => [{ :name => "beef", :type => "float"}], :return => test_return[:int]} +- expected = " int ReturnVal;\n int CallOrder;\n float Expected_beef;\n" +- returned = @cmock_generator_plugin_expect.instance_typedefs(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for functions of style 'void func(void)'" do +- function = {:name => "Maple", :args => [], :return => test_return[:void]} +- expected = "#define Maple_Expect() Maple_CMockExpect(__LINE__)\n" + +- "void Maple_CMockExpect(UNITY_LINE_TYPE cmock_line);\n" +- returned = @cmock_generator_plugin_expect.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for functions of style 'int func(void)'" do +- function = {:name => "Spruce", :args => [], :return => test_return[:int]} +- expected = "#define Spruce_ExpectAndReturn(cmock_retval) Spruce_CMockExpectAndReturn(__LINE__, cmock_retval)\n" + +- "void Spruce_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return);\n" +- returned = @cmock_generator_plugin_expect.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function declaration for functions of style 'const char* func(int tofu)'" do +- function = {:name => "Pine", :args => ["int tofu"], :args_string => "int tofu", :args_call => 'tofu', :return => test_return[:string]} +- expected = "#define Pine_ExpectAndReturn(tofu, cmock_retval) Pine_CMockExpectAndReturn(__LINE__, tofu, cmock_retval)\n" + +- "void Pine_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int tofu, const char* cmock_to_return);\n" +- returned = @cmock_generator_plugin_expect.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions of style 'void func(void)'" do +- function = {:name => "Apple", :args => [], :return => test_return[:void]} +- expected = "" +- returned = @cmock_generator_plugin_expect.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions of style 'int func(int veal, unsigned int sushi)'" do +- function = {:name => "Cherry", :args => [ { :type => "int", :name => "veal" }, { :type => "unsigned int", :name => "sushi" } ], :return => test_return[:int]} +- +- @utils.expect :code_verify_an_arg_expectation, "mocked_retval_1\n", [function, function[:args][0]] +- @utils.expect :code_verify_an_arg_expectation, "mocked_retval_2\n", [function, function[:args][1]] +- expected = " if (!cmock_call_instance->ExpectAnyArgsBool)\n" + +- " {\n" + +- "mocked_retval_1\n" + +- "mocked_retval_2\n" + +- " }\n" +- returned = @cmock_generator_plugin_expect.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation using ordering if needed" do +- function = {:name => "Apple", :args => [], :return => test_return[:void]} +- expected = "" +- @cmock_generator_plugin_expect.ordered = true +- returned = @cmock_generator_plugin_expect.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock function implementation for functions of style 'void func(int worm)' and strict ordering" do +- function = {:name => "Apple", :args => [{ :type => "int", :name => "worm" }], :return => test_return[:void]} +- @utils.expect :code_verify_an_arg_expectation, "mocked_retval_0\n", [function, function[:args][0]] +- expected = " if (!cmock_call_instance->ExpectAnyArgsBool)\n" + +- " {\n" + +- "mocked_retval_0\n" + +- " }\n" +- @cmock_generator_plugin_expect.ordered = true +- returned = @cmock_generator_plugin_expect.mock_implementation(function) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for functions of style 'void func(void)'" do +- function = {:name => "Pear", :args => [], :args_string => "void", :return => test_return[:void]} +- @utils.expect :code_add_base_expectation, "mock_retval_0\n", ["Pear"] +- @utils.expect :code_call_argument_loader, "mock_retval_1\n", [function] +- expected = ["void Pear_CMockExpect(UNITY_LINE_TYPE cmock_line)\n", +- "{\n", +- "mock_retval_0\n", +- "mock_retval_1\n", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_expect.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for functions of style 'int func(void)'" do +- function = {:name => "Orange", :args => [], :args_string => "void", :return => test_return[:int]} +- @utils.expect :code_add_base_expectation, "mock_retval_0\n", ["Orange"] +- @utils.expect :code_call_argument_loader, "mock_retval_1\n", [function] +- @utils.expect :code_assign_argument_quickly, "mock_retval_2\n", ["cmock_call_instance->ReturnVal", function[:return]] +- expected = ["void Orange_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return)\n", +- "{\n", +- "mock_retval_0\n", +- "mock_retval_1\n", +- "mock_retval_2\n", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_expect.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for functions of style 'int func(char* pescado)'" do +- function = {:name => "Lemon", :args => [{ :type => "char*", :name => "pescado"}], :args_string => "char* pescado", :return => test_return[:int]} +- @utils.expect :code_add_base_expectation, "mock_retval_0\n", ["Lemon"] +- @utils.expect :code_call_argument_loader, "mock_retval_1\n", [function] +- @utils.expect :code_assign_argument_quickly, "mock_retval_2\n", ["cmock_call_instance->ReturnVal", function[:return]] +- expected = ["void Lemon_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, char* pescado, int cmock_to_return)\n", +- "{\n", +- "mock_retval_0\n", +- "mock_retval_1\n", +- "mock_retval_2\n", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_expect.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for functions when using ordering" do +- function = {:name => "Pear", :args => [], :args_string => "void", :return => test_return[:void]} +- @utils.expect :code_add_base_expectation, "mock_retval_0\n", ["Pear"] +- @utils.expect :code_call_argument_loader, "mock_retval_1\n", [function] +- expected = ["void Pear_CMockExpect(UNITY_LINE_TYPE cmock_line)\n", +- "{\n", +- "mock_retval_0\n", +- "mock_retval_1\n", +- "}\n\n" +- ].join +- @cmock_generator_plugin_expect.ordered = true +- returned = @cmock_generator_plugin_expect.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +- it "add mock verify lines" do +- function = {:name => "Banana" } +- expected = " if (CMOCK_GUTS_NONE != call_instance)\n" \ +- " {\n" \ +- " UNITY_SET_DETAIL(CMockString_Banana);\n" \ +- " UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess);\n" \ +- " }\n" +- returned = @cmock_generator_plugin_expect.mock_verify(function) +- assert_equal(expected, returned) +- end +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +deleted file mode 100644 +index 5fa18e8c17..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb ++++ /dev/null +@@ -1,116 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_ignore_arg' +- +-describe CMockGeneratorPluginIgnoreArg, "Verify CMockGeneratorPluginIgnoreArg Module" do +- +- before do +- create_mocks :config, :utils +- +- # int *Oak(void)" +- @void_func = {:name => "Oak", :args => [], :return => test_return[:int_ptr]} +- +- # void Pine(int chicken, const int beef, int *tofu) +- @complex_func = {:name => "Pine", +- :args => [{ :type => "int", +- :name => "chicken", +- :ptr? => false, +- }, +- { :type => "const int*", +- :name => "beef", +- :ptr? => true, +- :const? => true, +- }, +- { :type => "int*", +- :name => "tofu", +- :ptr? => true, +- }], +- :return => test_return[:void], +- :contains_ptr? => true } +- +- #no strict ordering +- @cmock_generator_plugin_ignore_arg = CMockGeneratorPluginIgnoreArg.new(@config, @utils) +- end +- +- after do +- end +- +- it "have set up internal priority correctly on init" do +- assert_equal(10, @cmock_generator_plugin_ignore_arg.priority) +- end +- +- it "not include any additional include files" do +- assert(!@cmock_generator_plugin_ignore_arg.respond_to?(:include_files)) +- end +- +- it "not add to typedef structure for functions with no args" do +- returned = @cmock_generator_plugin_ignore_arg.instance_typedefs(@void_func) +- assert_equal("", returned) +- end +- +- it "add to tyepdef structure mock needs of functions of style 'void func(int chicken, int* pork)'" do +- expected = " char IgnoreArg_chicken;\n" + +- " char IgnoreArg_beef;\n" + +- " char IgnoreArg_tofu;\n" +- returned = @cmock_generator_plugin_ignore_arg.instance_typedefs(@complex_func) +- assert_equal(expected, returned) +- end +- +- it "add mock function declarations for all arguments" do +- expected = +- "#define Pine_IgnoreArg_chicken()" + +- " Pine_CMockIgnoreArg_chicken(__LINE__)\n" + +- "void Pine_CMockIgnoreArg_chicken(UNITY_LINE_TYPE cmock_line);\n" + +- +- "#define Pine_IgnoreArg_beef()" + +- " Pine_CMockIgnoreArg_beef(__LINE__)\n" + +- "void Pine_CMockIgnoreArg_beef(UNITY_LINE_TYPE cmock_line);\n" + +- +- "#define Pine_IgnoreArg_tofu()" + +- " Pine_CMockIgnoreArg_tofu(__LINE__)\n" + +- "void Pine_CMockIgnoreArg_tofu(UNITY_LINE_TYPE cmock_line);\n" +- +- returned = @cmock_generator_plugin_ignore_arg.mock_function_declarations(@complex_func) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces for all arguments" do +- expected = +- "void Pine_CMockIgnoreArg_chicken(UNITY_LINE_TYPE cmock_line)\n" + +- "{\n" + +- " CMOCK_Pine_CALL_INSTANCE* cmock_call_instance = " + +- "(CMOCK_Pine_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.Pine_CallInstance));\n" + +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp);\n" + +- " cmock_call_instance->IgnoreArg_chicken = 1;\n" + +- "}\n\n" + +- +- "void Pine_CMockIgnoreArg_beef(UNITY_LINE_TYPE cmock_line)\n" + +- "{\n" + +- " CMOCK_Pine_CALL_INSTANCE* cmock_call_instance = " + +- "(CMOCK_Pine_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.Pine_CallInstance));\n" + +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp);\n" + +- " cmock_call_instance->IgnoreArg_beef = 1;\n" + +- "}\n\n" + +- +- "void Pine_CMockIgnoreArg_tofu(UNITY_LINE_TYPE cmock_line)\n" + +- "{\n" + +- " CMOCK_Pine_CALL_INSTANCE* cmock_call_instance = " + +- "(CMOCK_Pine_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.Pine_CallInstance));\n" + +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp);\n" + +- " cmock_call_instance->IgnoreArg_tofu = 1;\n" + +- "}\n\n" +- +- returned = @cmock_generator_plugin_ignore_arg.mock_interfaces(@complex_func).join("") +- assert_equal(expected, returned) +- end +- +- it "not add a mock implementation" do +- assert(!@cmock_generator_plugin_ignore_arg.respond_to?(:mock_implementation)) +- end +- +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +deleted file mode 100644 +index c0c28b84dd..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_ignore_test.rb ++++ /dev/null +@@ -1,119 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_ignore' +- +-describe CMockGeneratorPluginIgnore, "Verify CMockGeneratorPluginIgnore Module" do +- +- before do +- create_mocks :config, :utils +- @config = create_stub(:respond_to? => true) +- @cmock_generator_plugin_ignore = CMockGeneratorPluginIgnore.new(@config, @utils) +- end +- +- after do +- end +- +- it "have set up internal priority" do +- assert_equal(2, @cmock_generator_plugin_ignore.priority) +- end +- +- it "not have any additional include file requirements" do +- assert(!@cmock_generator_plugin_ignore.respond_to?(:include_files)) +- end +- +- it "add a required variable to the instance structure" do +- function = {:name => "Grass", :args => [], :return => test_return[:void]} +- expected = " char Grass_IgnoreBool;\n" +- returned = @cmock_generator_plugin_ignore.instance_structure(function) +- assert_equal(expected, returned) +- end +- +- it "handle function declarations for functions without return values" do +- function = {:name => "Mold", :args_string => "void", :return => test_return[:void]} +- expected = "#define Mold_Ignore() Mold_CMockIgnore()\nvoid Mold_CMockIgnore(void);\n" + +- "#define Mold_StopIgnore() Mold_CMockStopIgnore()\nvoid Mold_CMockStopIgnore(void);\n" +- returned = @cmock_generator_plugin_ignore.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "handle function declarations for functions that returns something" do +- function = {:name => "Fungus", :args_string => "void", :return => test_return[:string]} +- expected = "#define Fungus_IgnoreAndReturn(cmock_retval) Fungus_CMockIgnoreAndReturn(__LINE__, cmock_retval)\n"+ +- "void Fungus_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, const char* cmock_to_return);\n" + +- "#define Fungus_StopIgnore() Fungus_CMockStopIgnore()\n"+ +- "void Fungus_CMockStopIgnore(void);\n" +- returned = @cmock_generator_plugin_ignore.mock_function_declarations(function) +- assert_equal(expected, returned) +- end +- +- it "add required code to implementation precheck with void function" do +- function = {:name => "Mold", :args_string => "void", :return => test_return[:void]} +- expected = [" if (Mock.Mold_IgnoreBool)\n", +- " {\n", +- " UNITY_CLR_DETAILS();\n", +- " return;\n", +- " }\n" +- ].join +- returned = @cmock_generator_plugin_ignore.mock_implementation_precheck(function) +- assert_equal(expected, returned) +- end +- +- it "add required code to implementation precheck with return functions" do +- function = {:name => "Fungus", :args_string => "void", :return => test_return[:int]} +- retval = test_return[:int].merge({ :name => "cmock_call_instance->ReturnVal"}) +- @utils.expect :code_assign_argument_quickly, ' mock_retval_0', ["Mock.Fungus_FinalReturn", retval] +- expected = [" if (Mock.Fungus_IgnoreBool)\n", +- " {\n", +- " UNITY_CLR_DETAILS();\n", +- " if (cmock_call_instance == NULL)\n", +- " return Mock.Fungus_FinalReturn;\n", +- " mock_retval_0", +- " return cmock_call_instance->ReturnVal;\n", +- " }\n" +- ].join +- returned = @cmock_generator_plugin_ignore.mock_implementation_precheck(function) +- assert_equal(expected, returned) +- end +- +- it "add a new mock interface for ignoring when function had no return value" do +- function = {:name => "Slime", :args => [], :args_string => "void", :return => test_return[:void]} +- expected = ["void Slime_CMockIgnore(void)\n", +- "{\n", +- " Mock.Slime_IgnoreBool = (char)1;\n", +- "}\n\n", +- +- "void Slime_CMockStopIgnore(void)\n", +- "{\n", +- " Mock.Slime_IgnoreBool = (char)0;\n", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_ignore.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +- it "add a new mock interface for ignoring when function has return value" do +- function = {:name => "Slime", :args => [], :args_string => "void", :return => test_return[:int]} +- @utils.expect :code_add_base_expectation, "mock_return_1", ["Slime", false] +- expected = ["void Slime_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return)\n", +- "{\n", +- "mock_return_1", +- " cmock_call_instance->ReturnVal = cmock_to_return;\n", +- " Mock.Slime_IgnoreBool = (char)1;\n", +- "}\n\n", +- +- "void Slime_CMockStopIgnore(void)\n{\n", +- " if(Mock.Slime_IgnoreBool)\n", +- " Mock.Slime_CallInstance = CMock_Guts_MemNext(Mock.Slime_CallInstance);\n", +- " Mock.Slime_IgnoreBool = (char)0;\n", +- "}\n\n" +- ].join +- returned = @cmock_generator_plugin_ignore.mock_interfaces(function) +- assert_equal(expected, returned) +- end +- +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +deleted file mode 100644 +index 3c8b075da8..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb ++++ /dev/null +@@ -1,136 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_return_thru_ptr' +- +-describe CMockGeneratorPluginReturnThruPtr, "Verify CMockGeneratorPluginReturnThruPtr Module" do +- +- before do +- create_mocks :config, :utils +- +- # int *Oak(void)" +- @void_func = {:name => "Oak", :args => [], :return => test_return[:int_ptr]} +- +- # char *Maple(int blah) +- @simple_func = {:name => "Maple", +- :args => [{:name => "blah", :type => "int", :ptr? => false}], +- :return => test_return[:string], +- :contains_ptr? => false} +- +- # void Pine(int chicken, const int beef, int *tofu) +- @complex_func = {:name => "Pine", +- :args => [{ :type => "int", +- :name => "chicken", +- :ptr? => false, +- }, +- { :type => "const int*", +- :name => "beef", +- :ptr? => true, +- :const? => true, +- }, +- { :type => "int*", +- :name => "tofu", +- :ptr? => true, +- }], +- :return => test_return[:void], +- :contains_ptr? => true } +- +- #no strict ordering +- @cmock_generator_plugin_return_thru_ptr = CMockGeneratorPluginReturnThruPtr.new(@config, @utils) +- end +- +- after do +- end +- +- def simple_func_expect +- @utils.expect :ptr_or_str?, false, ['int'] +- end +- +- def complex_func_expect +- @utils.expect :ptr_or_str?, false, ['int'] +- @utils.expect :ptr_or_str?, true, ['const int*'] +- @utils.expect :ptr_or_str?, true, ['int*'] +- end +- +- it "have set up internal priority correctly on init" do +- assert_equal(9, @cmock_generator_plugin_return_thru_ptr.priority) +- end +- +- it "not include any additional include files" do +- assert(!@cmock_generator_plugin_return_thru_ptr.respond_to?(:include_files)) +- end +- +- it "not add to typedef structure for functions of style 'int* func(void)'" do +- returned = @cmock_generator_plugin_return_thru_ptr.instance_typedefs(@void_func) +- assert_equal("", returned) +- end +- +- it "add to tyepdef structure mock needs of functions of style 'void func(int chicken, int* pork)'" do +- complex_func_expect() +- expected = " char ReturnThruPtr_tofu_Used;\n" + +- " int* ReturnThruPtr_tofu_Val;\n" + +- " int ReturnThruPtr_tofu_Size;\n" +- returned = @cmock_generator_plugin_return_thru_ptr.instance_typedefs(@complex_func) +- assert_equal(expected, returned) +- end +- +- it "not add an additional mock interface for functions not containing pointers" do +- simple_func_expect() +- returned = @cmock_generator_plugin_return_thru_ptr.mock_function_declarations(@simple_func) +- assert_equal("", returned) +- end +- +- it "add a mock function declaration only for non-const pointer arguments" do +- complex_func_expect(); +- +- expected = +- "#define Pine_ReturnThruPtr_tofu(tofu)" + +- " Pine_CMockReturnMemThruPtr_tofu(__LINE__, tofu, sizeof(int))\n" + +- "#define Pine_ReturnArrayThruPtr_tofu(tofu, cmock_len)" + +- " Pine_CMockReturnMemThruPtr_tofu(__LINE__, tofu, (int)(cmock_len * (int)sizeof(*tofu)))\n" + +- "#define Pine_ReturnMemThruPtr_tofu(tofu, cmock_size)" + +- " Pine_CMockReturnMemThruPtr_tofu(__LINE__, tofu, cmock_size)\n" + +- "void Pine_CMockReturnMemThruPtr_tofu(UNITY_LINE_TYPE cmock_line, int* tofu, int cmock_size);\n" +- +- returned = @cmock_generator_plugin_return_thru_ptr.mock_function_declarations(@complex_func) +- assert_equal(expected, returned) +- end +- +- it "add mock interfaces only for non-const pointer arguments" do +- complex_func_expect(); +- +- expected = +- "void Pine_CMockReturnMemThruPtr_tofu(UNITY_LINE_TYPE cmock_line, int* tofu, int cmock_size)\n" + +- "{\n" + +- " CMOCK_Pine_CALL_INSTANCE* cmock_call_instance = " + +- "(CMOCK_Pine_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.Pine_CallInstance));\n" + +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp);\n" + +- " cmock_call_instance->ReturnThruPtr_tofu_Used = 1;\n" + +- " cmock_call_instance->ReturnThruPtr_tofu_Val = tofu;\n" + +- " cmock_call_instance->ReturnThruPtr_tofu_Size = cmock_size;\n" + +- "}\n\n" +- +- returned = @cmock_generator_plugin_return_thru_ptr.mock_interfaces(@complex_func).join("") +- assert_equal(expected, returned) +- end +- +- it "add mock implementations only for non-const pointer arguments" do +- complex_func_expect() +- +- expected = +- " if (cmock_call_instance->ReturnThruPtr_tofu_Used)\n" + +- " {\n" + +- " UNITY_TEST_ASSERT_NOT_NULL(tofu, cmock_line, CMockStringPtrIsNULL);\n" + +- " memcpy((void*)tofu, (void*)cmock_call_instance->ReturnThruPtr_tofu_Val,\n" + +- " cmock_call_instance->ReturnThruPtr_tofu_Size);\n" + +- " }\n" +- +- returned = @cmock_generator_plugin_return_thru_ptr.mock_implementation(@complex_func).join("") +- assert_equal(expected, returned) +- end +- +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_generator_utils_test.rb b/components/testframework/libs/cmock/test/unit/cmock_generator_utils_test.rb +deleted file mode 100644 +index ab9df2a2c4..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_generator_utils_test.rb ++++ /dev/null +@@ -1,398 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_utils' +- +-describe CMockGeneratorUtils, "Verify CMockGeneratorUtils Module" do +- +- before do +- create_mocks :config, :unity_helper, :unity_helper +- +- @config.expect :when_ptr, :compare_ptr +- @config.expect :enforce_strict_ordering, false +- @config.expect :plugins, [] +- @config.expect :plugins, [] +- @config.expect :plugins, [] +- @config.expect :plugins, [] +- @config.expect :plugins, [] +- @config.expect :plugins, [] +- @config.expect :treat_as, {'int' => 'INT','short' => 'INT16','long' => 'INT','char' => 'INT8','const char*' => 'STRING'} +- @cmock_generator_utils_simple = CMockGeneratorUtils.new(@config, {:unity_helper => @unity_helper}) +- +- @config.expect :when_ptr, :smart +- @config.expect :enforce_strict_ordering, true +- @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] +- @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] +- @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] +- @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] +- @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] +- @config.expect :plugins, [:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore] +- @config.expect :treat_as, {'int' => 'INT','short' => 'INT16','long' => 'INT','char' => 'INT8','uint32_t' => 'HEX32','const char*' => 'STRING'} +- @cmock_generator_utils_complex = CMockGeneratorUtils.new(@config, {:unity_helper => @unity_helper, :A=>1, :B=>2}) +- end +- +- after do +- end +- +- it "have set up internal accessors correctly on init" do +- assert_equal(false, @cmock_generator_utils_simple.arrays) +- assert_equal(false, @cmock_generator_utils_simple.cexception) +- end +- +- it "have set up internal accessors correctly on init, complete with passed helpers" do +- assert_equal(true, @cmock_generator_utils_complex.arrays) +- assert_equal(true, @cmock_generator_utils_complex.cexception) +- end +- +- it "detect pointers and strings" do +- assert_equal(false, @cmock_generator_utils_simple.ptr_or_str?('int')) +- assert_equal(true, @cmock_generator_utils_simple.ptr_or_str?('int*')) +- assert_equal(true, @cmock_generator_utils_simple.ptr_or_str?('char*')) +- end +- +- it "add code for a base expectation with no plugins" do +- expected = +- " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Apple_CALL_INSTANCE));\n" + +- " CMOCK_Apple_CALL_INSTANCE* cmock_call_instance = (CMOCK_Apple_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n" + +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);\n" + +- " memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));\n" + +- " Mock.Apple_CallInstance = CMock_Guts_MemChain(Mock.Apple_CallInstance, cmock_guts_index);\n" + +- " cmock_call_instance->LineNumber = cmock_line;\n" +- output = @cmock_generator_utils_simple.code_add_base_expectation("Apple") +- assert_equal(expected, output) +- end +- +- it "add code for a base expectation with all plugins" do +- expected = +- " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Apple_CALL_INSTANCE));\n" + +- " CMOCK_Apple_CALL_INSTANCE* cmock_call_instance = (CMOCK_Apple_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n" + +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);\n" + +- " memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));\n" + +- " Mock.Apple_CallInstance = CMock_Guts_MemChain(Mock.Apple_CallInstance, cmock_guts_index);\n" + +- " Mock.Apple_IgnoreBool = (char)0;\n" + +- " cmock_call_instance->LineNumber = cmock_line;\n" + +- " cmock_call_instance->CallOrder = ++GlobalExpectCount;\n" + +- " cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;\n" +- output = @cmock_generator_utils_complex.code_add_base_expectation("Apple", true) +- assert_equal(expected, output) +- end +- +- it "add code for a base expectation with all plugins and ordering not supported" do +- expected = +- " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Apple_CALL_INSTANCE));\n" + +- " CMOCK_Apple_CALL_INSTANCE* cmock_call_instance = (CMOCK_Apple_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n" + +- " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);\n" + +- " memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));\n" + +- " Mock.Apple_CallInstance = CMock_Guts_MemChain(Mock.Apple_CallInstance, cmock_guts_index);\n" + +- " Mock.Apple_IgnoreBool = (char)0;\n" + +- " cmock_call_instance->LineNumber = cmock_line;\n" + +- " cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;\n" +- output = @cmock_generator_utils_complex.code_add_base_expectation("Apple", false) +- assert_equal(expected, output) +- end +- +- it "add argument expectations for values when no array plugin" do +- arg1 = { :name => "Orange", :const? => false, :type => 'int', :ptr? => false } +- expected1 = " cmock_call_instance->Expected_Orange = Orange;\n" +- +- arg2 = { :name => "Lemon", :const? => true, :type => 'const char*', :ptr? => false } +- expected2 = " cmock_call_instance->Expected_Lemon = Lemon;\n" +- +- arg3 = { :name => "Kiwi", :const? => false, :type => 'KIWI_T*', :ptr? => true } +- expected3 = " cmock_call_instance->Expected_Kiwi = Kiwi;\n" +- +- arg4 = { :name => "Lime", :const? => false, :type => 'LIME_T', :ptr? => false } +- expected4 = " memcpy((void*)(&cmock_call_instance->Expected_Lime), (void*)(&Lime),\n" + +- " sizeof(LIME_T[sizeof(Lime) == sizeof(LIME_T) ? 1 : -1])); /* add LIME_T to :treat_as_array if this causes an error */\n" +- +- assert_equal(expected1, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg1)) +- assert_equal(expected2, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg2)) +- assert_equal(expected3, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg3)) +- assert_equal(expected4, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg4)) +- end +- +- it "add argument expectations for values when array plugin enabled" do +- arg1 = { :name => "Orange", :const? => false, :type => 'int', :ptr? => false } +- expected1 = " cmock_call_instance->Expected_Orange = Orange;\n" + +- " cmock_call_instance->IgnoreArg_Orange = 0;\n" +- +- arg2 = { :name => "Lemon", :const? => true, :type => 'const char*', :ptr? => false } +- expected2 = " cmock_call_instance->Expected_Lemon = Lemon;\n" + +- " cmock_call_instance->Expected_Lemon_Depth = Lemon_Depth;\n" + +- " cmock_call_instance->IgnoreArg_Lemon = 0;\n" +- +- arg3 = { :name => "Kiwi", :const? => false, :type => 'KIWI_T*', :ptr? => true } +- expected3 = " cmock_call_instance->Expected_Kiwi = Kiwi;\n" + +- " cmock_call_instance->Expected_Kiwi_Depth = Kiwi_Depth;\n" + +- " cmock_call_instance->IgnoreArg_Kiwi = 0;\n" + +- " cmock_call_instance->ReturnThruPtr_Kiwi_Used = 0;\n" +- +- arg4 = { :name => "Lime", :const? => false, :type => 'LIME_T', :ptr? => false } +- expected4 = " memcpy((void*)(&cmock_call_instance->Expected_Lime), (void*)(&Lime),\n" + +- " sizeof(LIME_T[sizeof(Lime) == sizeof(LIME_T) ? 1 : -1])); /* add LIME_T to :treat_as_array if this causes an error */\n" + +- " cmock_call_instance->IgnoreArg_Lime = 0;\n" +- +- assert_equal(expected1, @cmock_generator_utils_complex.code_add_an_arg_expectation(arg1)) +- assert_equal(expected2, @cmock_generator_utils_complex.code_add_an_arg_expectation(arg2, 'Lemon_Depth')) +- assert_equal(expected3, @cmock_generator_utils_complex.code_add_an_arg_expectation(arg3, 'Lemon_Depth')) +- assert_equal(expected4, @cmock_generator_utils_complex.code_add_an_arg_expectation(arg4)) +- end +- +- it 'not have an argument loader when the function has no arguments' do +- function = { :name => "Melon", :args_string => "void" } +- +- assert_equal("", @cmock_generator_utils_complex.code_add_argument_loader(function)) +- end +- +- it 'create an argument loader when the function has arguments' do +- function = { :name => "Melon", +- :args_string => "stuff", +- :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]] +- } +- expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, stuff)\n{\n" + +- " cmock_call_instance->Expected_MyIntPtr = MyIntPtr;\n" + +- " memcpy((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType),\n" + +- " sizeof(MY_TYPE[sizeof(MyMyType) == sizeof(MY_TYPE) ? 1 : -1])); /* add MY_TYPE to :treat_as_array if this causes an error */\n" + +- " cmock_call_instance->Expected_MyStr = MyStr;\n" + +- "}\n\n" +- assert_equal(expected, @cmock_generator_utils_simple.code_add_argument_loader(function)) +- end +- +- it 'create an argument loader when the function has arguments supporting arrays' do +- function = { :name => "Melon", +- :args_string => "stuff", +- :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]] +- } +- expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, int* MyIntPtr, int MyIntPtr_Depth, const MY_TYPE MyMyType, const char* MyStr)\n{\n" + +- " cmock_call_instance->Expected_MyIntPtr = MyIntPtr;\n" + +- " cmock_call_instance->Expected_MyIntPtr_Depth = MyIntPtr_Depth;\n" + +- " cmock_call_instance->IgnoreArg_MyIntPtr = 0;\n" + +- " cmock_call_instance->ReturnThruPtr_MyIntPtr_Used = 0;\n" + +- " memcpy((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType),\n" + +- " sizeof(MY_TYPE[sizeof(MyMyType) == sizeof(MY_TYPE) ? 1 : -1])); /* add MY_TYPE to :treat_as_array if this causes an error */\n" + +- " cmock_call_instance->IgnoreArg_MyMyType = 0;\n" + +- " cmock_call_instance->Expected_MyStr = MyStr;\n" + +- " cmock_call_instance->IgnoreArg_MyStr = 0;\n" + +- "}\n\n" +- assert_equal(expected, @cmock_generator_utils_complex.code_add_argument_loader(function)) +- end +- +- it 'create an argument loader when the function has pointer arguments supporting arrays' do +- function = { :name => "Melon", +- :args_string => "stuff", +- :args => [test_arg[:const_ptr], test_arg[:double_ptr]] +- } +- expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, int* const MyConstPtr, int MyConstPtr_Depth, int const** MyDoublePtr, int MyDoublePtr_Depth)\n{\n" + +- " cmock_call_instance->Expected_MyConstPtr = MyConstPtr;\n" + +- " cmock_call_instance->Expected_MyConstPtr_Depth = MyConstPtr_Depth;\n" + +- " cmock_call_instance->IgnoreArg_MyConstPtr = 0;\n" + +- " cmock_call_instance->ReturnThruPtr_MyConstPtr_Used = 0;\n" + +- " cmock_call_instance->Expected_MyDoublePtr = MyDoublePtr;\n" + +- " cmock_call_instance->Expected_MyDoublePtr_Depth = MyDoublePtr_Depth;\n" + +- " cmock_call_instance->IgnoreArg_MyDoublePtr = 0;\n" + +- "}\n\n" +- assert_equal(expected, @cmock_generator_utils_complex.code_add_argument_loader(function)) +- end +- +- it "not call argument loader if there are no arguments to actually use for this function" do +- function = { :name => "Pineapple", :args_string => "void" } +- +- assert_equal("", @cmock_generator_utils_complex.code_call_argument_loader(function)) +- end +- +- it 'call an argument loader when the function has arguments' do +- function = { :name => "Pineapple", +- :args_string => "stuff", +- :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]] +- } +- expected = " CMockExpectParameters_Pineapple(cmock_call_instance, MyIntPtr, MyMyType, MyStr);\n" +- assert_equal(expected, @cmock_generator_utils_simple.code_call_argument_loader(function)) +- end +- +- it 'call an argument loader when the function has arguments with arrays' do +- function = { :name => "Pineapple", +- :args_string => "stuff", +- :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]] +- } +- expected = " CMockExpectParameters_Pineapple(cmock_call_instance, MyIntPtr, 1, MyMyType, MyStr);\n" +- assert_equal(expected, @cmock_generator_utils_complex.code_call_argument_loader(function)) +- end +- +- it 'handle a simple assert when requested' do +- function = { :name => 'Pear' } +- arg = test_arg[:int] +- expected = " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyInt);\n" + +- " UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_MyInt, MyInt, cmock_line, CMockStringMismatch);\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_INT', ''], ['int'] +- assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle a pointer comparison when configured to do so' do +- function = { :name => 'Pear' } +- arg = test_arg[:int_ptr] +- expected = " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyIntPtr);\n" + +- " UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_MyIntPtr, MyIntPtr, cmock_line, CMockStringMismatch);\n" + +- " }\n" +- assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle const char as string compares ' do +- function = { :name => 'Pear' } +- arg = test_arg[:string] +- expected = " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyStr);\n" + +- " UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_MyStr, MyStr, cmock_line, CMockStringMismatch);\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_STRING',''], ['const char*'] +- assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle custom types as memory compares when we have no better way to do it' do +- function = { :name => 'Pear' } +- arg = test_arg[:mytype] +- expected = " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + +- " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType), sizeof(MY_TYPE), cmock_line, CMockStringMismatch);\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MEMORY','&'], ['MY_TYPE'] +- assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle custom types with custom handlers when available, even if they do not support the extra message' do +- function = { :name => 'Pear' } +- arg = test_arg[:mytype] +- expected = " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + +- " UNITY_TEST_ASSERT_EQUAL_MY_TYPE(cmock_call_instance->Expected_MyMyType, MyMyType, cmock_line, CMockStringMismatch);\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MY_TYPE',''], ['MY_TYPE'] +- assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle pointers to custom types with array handlers, even if the array extension is turned off' do +- function = { :name => 'Pear' } +- arg = test_arg[:mytype] +- expected = " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + +- " UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY(&cmock_call_instance->Expected_MyMyType, &MyMyType, 1, cmock_line, CMockStringMismatch);\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY','&'], ['MY_TYPE'] +- assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle a simple assert when requested with array plugin enabled' do +- function = { :name => 'Pear' } +- arg = test_arg[:int] +- expected = " if (!cmock_call_instance->IgnoreArg_MyInt)\n" + +- " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyInt);\n" + +- " UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_MyInt, MyInt, cmock_line, CMockStringMismatch);\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_INT',''], ['int'] +- assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle an array comparison with array plugin enabled' do +- function = { :name => 'Pear' } +- arg = test_arg[:int_ptr] +- expected = " if (!cmock_call_instance->IgnoreArg_MyIntPtr)\n" + +- " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyIntPtr);\n" + +- " if (cmock_call_instance->Expected_MyIntPtr == NULL)\n" + +- " { UNITY_TEST_ASSERT_NULL(MyIntPtr, cmock_line, CMockStringExpNULL); }\n" + +- " else if (cmock_call_instance->Expected_MyIntPtr_Depth == 0)\n" + +- " { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_MyIntPtr, MyIntPtr, cmock_line, CMockStringMismatch); }\n" + +- " else\n" + +- " { UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(cmock_call_instance->Expected_MyIntPtr, MyIntPtr, cmock_call_instance->Expected_MyIntPtr_Depth, cmock_line, CMockStringMismatch); }\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_INT_ARRAY',''], ['int*'] +- assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle const char as string compares with array plugin enabled' do +- function = { :name => 'Pear' } +- arg = test_arg[:string] +- expected = " if (!cmock_call_instance->IgnoreArg_MyStr)\n" + +- " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyStr);\n" + +- " UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_MyStr, MyStr, cmock_line, CMockStringMismatch);\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_STRING',''], ['const char*'] +- assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle custom types as memory compares when we have no better way to do it with array plugin enabled' do +- function = { :name => 'Pear' } +- arg = test_arg[:mytype] +- expected = " if (!cmock_call_instance->IgnoreArg_MyMyType)\n" + +- " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + +- " if (cmock_call_instance->Expected_MyMyType == NULL)\n" + +- " { UNITY_TEST_ASSERT_NULL(MyMyType, cmock_line, CMockStringExpNULL); }\n" + +- " else\n" + +- " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_MyMyType), (void*)(MyMyType), sizeof(MY_TYPE), 1, cmock_line, CMockStringMismatch); }\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY', ''], ['MY_TYPE'] +- assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle custom types with custom handlers when available, even if they do not support the extra message with array plugin enabled' do +- function = { :name => 'Pear' } +- arg = test_arg[:mytype] +- expected = " if (!cmock_call_instance->IgnoreArg_MyMyType)\n" + +- " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + +- " UNITY_TEST_ASSERT_EQUAL_MY_TYPE(cmock_call_instance->Expected_MyMyType, MyMyType, cmock_line, CMockStringMismatch);\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MY_TYPE', ''], ['MY_TYPE'] +- assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle custom types with array handlers when array plugin is enabled' do +- function = { :name => 'Pear' } +- arg = test_arg[:mytype_ptr] +- expected = " if (!cmock_call_instance->IgnoreArg_MyMyTypePtr)\n" + +- " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyTypePtr);\n" + +- " if (cmock_call_instance->Expected_MyMyTypePtr == NULL)\n" + +- " { UNITY_TEST_ASSERT_NULL(MyMyTypePtr, cmock_line, CMockStringExpNULL); }\n" + +- " else if (cmock_call_instance->Expected_MyMyTypePtr_Depth == 0)\n" + +- " { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_MyMyTypePtr, MyMyTypePtr, cmock_line, CMockStringMismatch); }\n" + +- " else\n" + +- " { UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY(cmock_call_instance->Expected_MyMyTypePtr, MyMyTypePtr, cmock_call_instance->Expected_MyMyTypePtr_Depth, cmock_line, CMockStringMismatch); }\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY', ''], ['MY_TYPE*'] +- assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) +- end +- +- it 'handle custom types with array handlers when array plugin is enabled for non-array types' do +- function = { :name => 'Pear' } +- arg = test_arg[:mytype] +- expected = " if (!cmock_call_instance->IgnoreArg_MyMyType)\n" + +- " {\n" + +- " UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" + +- " UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY(&cmock_call_instance->Expected_MyMyType, &MyMyType, 1, cmock_line, CMockStringMismatch);\n" + +- " }\n" +- @unity_helper.expect :nil?, false +- @unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY', '&'], ['MY_TYPE'] +- assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg)) +- end +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_header_parser_test.rb b/components/testframework/libs/cmock/test/unit/cmock_header_parser_test.rb +deleted file mode 100644 +index 5d5d2fccae..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_header_parser_test.rb ++++ /dev/null +@@ -1,2717 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-$ThisIsOnlyATest = true +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_header_parser' +- +-describe CMockHeaderParser, "Verify CMockHeaderParser Module" do +- +- before do +- create_mocks :config +- @test_name = 'test_file.h' +- @config.expect :strippables, ["STRIPPABLE"] +- @config.expect :attributes, ['__ramfunc', 'funky_attrib', 'SQLITE_API'] +- @config.expect :c_calling_conventions, ['__stdcall'] +- @config.expect :treat_as_void, ['MY_FUNKY_VOID'] +- @config.expect :treat_as, { "BANJOS" => "INT", "TUBAS" => "HEX16"} +- @config.expect :treat_as_array, {"IntArray" => "int", "Book" => "Page"} +- @config.expect :when_no_prototypes, :error +- @config.expect :verbosity, 1 +- @config.expect :treat_externs, :exclude +- @config.expect :treat_inlines, :exclude +- @config.expect :inline_function_patterns, ['(static\s+inline|inline\s+static)\s*', '(\bstatic\b|\binline\b)\s*'] +- @config.expect :array_size_type, ['int', 'size_t'] +- @config.expect :array_size_name, 'size|len' +- +- @parser = CMockHeaderParser.new(@config) +- end +- +- after do +- end +- +- it "create and initialize variables to defaults appropriately" do +- assert_equal([], @parser.funcs) +- assert_equal(['const', '__ramfunc', 'funky_attrib', 'SQLITE_API'], @parser.c_attributes) +- assert_equal(['void','MY_FUNKY_VOID'], @parser.treat_as_void) +- end +- +- it "strip out line comments" do +- source = +- " abcd;\n" + +- "// hello;\n" + +- "who // is you\n" +- +- expected = +- [ +- "abcd", +- "who" +- ] +- +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- it "remove block comments" do +- source = +- " no_comments;\n" + +- "// basic_line_comment;\n" + +- "/* basic_block_comment;*/\n" + +- "pre_block; /* start_of_block_comment;\n" + +- "// embedded_line_comment_in_block_comment; */\n" + +- "// /* commented_out_block_comment_line\n" + +- "shown_because_block_comment_invalid_from_line_comment;\n" + +- "// */\n" + +- "//* shorter_commented_out_block_comment_line; \n" + +- "shown_because_block_comment_invalid_from_shorter_line_comment;\n" + +- "/*/\n" + +- "not_shown_because_line_above_started_comment;\n" + +- "//*/\n" + +- "/* \n" + +- "not_shown_because_block_comment_started_this_time;\n" + +- "/*/\n" + +- "shown_because_line_above_ended_comment_this_time;\n" + +- "//*/\n" +- +- expected = +- [ +- "no_comments", +- "pre_block", +- "shown_because_block_comment_invalid_from_line_comment", +- "shown_because_block_comment_invalid_from_shorter_line_comment", +- "shown_because_line_above_ended_comment_this_time" +- ] +- +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- it "remove strippables from the beginning or end of function declarations" do +- source = +- "void* my_calloc(size_t, size_t) STRIPPABLE;\n" + +- "void\n" + +- " my_realloc(void*, size_t) STRIPPABLE;\n" + +- "extern int\n" + +- " my_printf (void *my_object, const char *my_format, ...)\n" + +- " STRIPPABLE;\n" + +- " void STRIPPABLE universal_handler ();\n" +- +- expected = +- [ +- "void* my_calloc(size_t, size_t)", +- "void my_realloc(void*, size_t)", +- "void universal_handler()" +- ] +- +- assert_equal(expected, @parser.import_source(source)) +- end +- +- it "remove gcc's function __attribute__'s" do +- source = +- "void* my_calloc(size_t, size_t) __attribute__((alloc_size(1,2)));\n" + +- "void\n" + +- " my_realloc(void*, size_t) __attribute__((alloc_size(2)));\n" + +- "extern int\n" + +- " my_printf (void *my_object, const char *my_format, ...)\n" + +- " __attribute__ ((format (printf, 2, 3)));\n" + +- " void __attribute__ ((interrupt)) universal_handler ();\n" +- +- expected = +- [ +- "void* my_calloc(size_t, size_t)", +- "void my_realloc(void*, size_t)", +- "void universal_handler()" +- ] +- +- assert_equal(expected, @parser.import_source(source)) +- end +- +- it "remove preprocessor directives" do +- source = +- "#when stuff_happens\n" + +- "#ifdef _TEST\n" + +- "#pragma stack_switch" +- +- expected = [] +- +- assert_equal(expected, @parser.import_source(source)) +- end +- +- +- it "remove assembler pragma sections" do +- source = +- " #pragma\tasm\n" + +- " .foo\n" + +- " lda %m\n" + +- " nop\n" + +- "# pragma endasm \n" + +- "foo" +- +- expected = ["foo"] +- +- assert_equal(expected, @parser.import_source(source)) +- end +- +- +- it "smush lines together that contain continuation characters" do +- source = +- "hoo hah \\\n" + +- "when \\ \n" +- +- expected = +- [ +- "hoo hah when" +- ] +- +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- +- it "remove C macro definitions" do +- source = +- "#define this is the first line\\\n" + +- "and the second\\\n" + +- "and the third that should be removed\n" + +- "but I'm here\n" +- +- expected = ["but I'm here"] +- +- assert_equal(expected, @parser.import_source(source)) +- end +- +- +- it "remove typedef statements" do +- source = +- "typedef uint32 (unsigned int);\n" + +- "const typedef int INT;\n" + +- "int notatypedef;\n" + +- "int typedef_isnt_me;\n" + +- " typedef who cares what really comes here \n" + # exercise multiline typedef +- " continuation;\n" + +- "this should remain!;\n" + +- "typedef blah bleh;\n" + +- "typedef struct shell_command_struct {\n" + +- " char_ptr COMMAND;\n" + +- " int_32 (*SHELL_FUNC)(int_32 argc);\n" + +- "} SHELL_COMMAND_STRUCT, * SHELL_COMMAND_PTR;\n" + +- "typedef struct shell_command_struct {\n" + +- " char_ptr COMMAND;\n" + +- " int_32 (*SHELL_FUNC)(int_32 argc, char_ptr argv[]);\n" + +- "} SHELL_COMMAND_STRUCT, * SHELL_COMMAND_PTR;\n" + +- "typedef struct shell_command_struct {\n" + +- " char_ptr COMMAND;\n" + +- " int_32 (*SHELL_FUNC)(int_32 argc);\n" + +- "};\n" +- +- expected = +- [ +- "int notatypedef", +- "int typedef_isnt_me", +- "this should remain!" +- ] +- +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- +- it "remove enum statements" do +- source = +- "enum _NamedEnum {\n" + +- " THING1 = (0x0001),\n" + +- " THING2 = (0x0001 << 5),\n" + +- "}ListOValues;\n\n" + +- "don't delete me!!\n" + +- " modifier_str enum _NamedEnum {THING1 = (0x0001), THING2 = (0x0001 << 5)} ListOValues;\n\n" + +- "typedef enum {\n" + +- " THING1,\n" + +- " THING2,\n" + +- "} Thinger;\n" + +- "or me!!\n" +- +- assert_equal(["don't delete me!! or me!!"], @parser.import_source(source).map!{|s|s.strip}) +- end +- +- +- it "remove union statements" do +- source = +- "union _NamedDoohicky {\n" + +- " unsigned int a;\n" + +- " char b;\n" + +- "} Doohicky;\n\n" + +- "I want to live!!\n" + +- "some_modifier union { unsigned int a; char b;} Whatever;\n" + +- "typedef union {\n" + +- " unsigned int a;\n" + +- " char b;\n" + +- "} Whatever;\n" + +- "me too!!\n" +- +- assert_equal(["I want to live!! me too!!"], @parser.import_source(source).map!{|s|s.strip}) +- end +- +- +- it "remove struct statements" do +- source = +- "struct _NamedStruct1 {\n" + +- " unsigned int a;\n" + +- " signed long int b;\n" + +- "} Thing ;\n\n" + +- "extern struct ForwardDeclared_t TestDataType1;\n" + +- "void foo(void);\n" + +- "struct\n"+ +- " MultilineForwardDeclared_t\n" + +- " TestDataType2;\n" + +- "struct THINGER foo(void);\n" + +- "typedef struct {\n" + +- " unsigned int a;\n" + +- " signed char b;\n" + +- "}Thinger;\n" + +- "I want to live!!\n" +- +- assert_equal(["void foo(void)", "struct THINGER foo(void)", "I want to live!!"], +- @parser.import_source(source).map!{|s|s.strip}) +- end +- +- it "remove externed and inline functions" do +- source = +- " extern uint32 foobar(unsigned int);\n" + +- "uint32 extern_name_func(unsigned int);\n" + +- "uint32 funcinline(unsigned int);\n" + +- "extern void bar(unsigned int);\n" + +- "inline void bar(unsigned int);\n" + +- "extern\n" + +- "void kinda_ugly_on_the_next_line(unsigned int);\n" +- +- expected = +- [ +- "uint32 extern_name_func(unsigned int)", +- "uint32 funcinline(unsigned int)" +- ] +- +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- it "remove function definitions but keep function declarations" do +- source = +- "uint32 func_with_decl_a(unsigned int);\n" + +- "uint32 func_with_decl_a(unsigned int a) { return a; }\n" + +- "uint32 func_with_decl_b(unsigned int);\n" + +- "uint32 func_with_decl_b(unsigned int a)\n" + +- "{\n" + +- " bar((unsigned int) a);\n" + +- " stripme(a);\n" + +- "}\n" +- +- expected = +- [ +- "uint32 func_with_decl_a(unsigned int)", +- "uint32 func_with_decl_a", #okay. it's not going to be interpretted as another function +- "uint32 func_with_decl_b(unsigned int)", +- "uint32 func_with_decl_b", #okay. it's not going to be interpretted as another function +- ] +- +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- it "remove function definitions with nested braces but keep function declarations" do +- source = +- "uint32 func_with_decl_a(unsigned int);\n" + +- "uint32 func_with_decl_a(unsigned int a) {\n" + +- " while (stuff) {\n" + +- " not_a_definition1(void);\n" + +- " }\n" + +- " not_a_definition2(blah, bleh);\n" + +- " return a;\n" + +- "}\n" + +- "uint32 func_with_decl_b(unsigned int);\n" + +- "uint32 func_with_decl_b(unsigned int a)\n" + +- "{\n" + +- " bar((unsigned int) a);\n" + +- " stripme(a);\n" + +- "}\n" + +- "uint32 func_with_decl_c(unsigned int);\n" + +- "uint32 func_with_decl_c(unsigned int a)\n" + +- "{\n" + +- " if(a > 0)\n" + +- " {\n" + +- " return 1;\n" + +- " }\n" + +- " else\n"+ +- " {\n" + +- " return 2;\n" + +- " }\n" + +- "}\n" +- +- expected = +- [ +- "uint32 func_with_decl_a(unsigned int)", +- "uint32 func_with_decl_a", #okay. it's not going to be interpretted as another function +- "uint32 func_with_decl_b(unsigned int)", +- "uint32 func_with_decl_b", #okay. it's not going to be interpretted as another function +- "uint32 func_with_decl_c(unsigned int)", +- "uint32 func_with_decl_c", #okay. it's not going to be interpretted as another function +- ] +- +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- it "remove a fully defined inline function" do +- source = +- "inline void foo(unsigned int a) { oranges = a; }\n" + +- "inline void bar(unsigned int a) { apples = a; };\n" + +- "inline void bar(unsigned int a)\n" + +- "{" + +- " bananas = a;\n" + +- "}" +- +- # ensure it's expected type of exception +- assert_raises RuntimeError do +- @parser.parse("module", source) +- end +- +- assert_equal([], @parser.funcs) +- +- # verify exception message +- begin +- @parser.parse("module", source) +- rescue RuntimeError => e +- assert_equal("ERROR: No function prototypes found!", e.message) +- end +- end +- +- it "remove a fully defined inline function that is multiple lines" do +- source = +- "inline void bar(unsigned int a)\n" + +- "{" + +- " bananas = a;\n" + +- " grapes = a;\n" + +- " apples(bananas, grapes);\n" + +- "}" +- +- # ensure it's expected type of exception +- assert_raises RuntimeError do +- @parser.parse("module", source) +- end +- +- assert_equal([], @parser.funcs) +- +- # verify exception message +- begin +- @parser.parse("module", source) +- rescue RuntimeError => e +- assert_equal("ERROR: No function prototypes found!", e.message) +- end +- end +- +- it "remove a fully defined inline function that contains nested braces" do +- source = +- "inline void bar(unsigned int a)\n" + +- "{" + +- " apples(bananas, grapes);\n" + +- " if (bananas == a)\n" + +- " {\n" + +- " oranges(a);\n" + +- " grapes = a;\n" + +- " }\n" + +- " grapefruit(bananas, grapes);\n" + +- "}" +- +- # ensure it's expected type of exception +- assert_raises RuntimeError do +- @parser.parse("module", source) +- end +- +- assert_equal([], @parser.funcs) +- +- # verify exception message +- begin +- @parser.parse("module", source) +- rescue RuntimeError => e +- assert_equal("ERROR: No function prototypes found!", e.message) +- end +- end +- +- it "remove just inline functions if externs to be included" do +- source = +- " extern uint32 foobar(unsigned int);\n" + +- "uint32 extern_name_func(unsigned int);\n" + +- "uint32 funcinline(unsigned int);\n" + +- "extern void bar(unsigned int);\n" + +- "inline void bar(unsigned int);\n" + +- "extern\n" + +- "void kinda_ugly_on_the_next_line(unsigned int);\n" +- +- expected = +- [ "extern uint32 foobar(unsigned int)", +- "uint32 extern_name_func(unsigned int)", +- "uint32 funcinline(unsigned int)", +- "extern void bar(unsigned int)", +- "extern void kinda_ugly_on_the_next_line(unsigned int)" +- ] +- +- @parser.treat_externs = :include +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- it "leave inline functions if inline to be included" do +- source = +- "extern uint32 foobar(unsigned int);\n" + +- "uint32 extern_name_func(unsigned int);\n" + +- "uint32 funcinline(unsigned int);\n" + +- "inline void inlineBar(unsigned int);\n" + +- "extern int extern_bar(void);\n" + +- "static inline void staticinlineBar(unsigned int);\n" + +- "static inline void bar(unsigned int);\n" + +- "static inline void bar(unsigned int)\n" + +- "{\n" + +- " // NOP\n" + +- "}\n" +- +- expected = +- [ "uint32 extern_name_func(unsigned int)", +- "uint32 funcinline(unsigned int)", +- "void inlineBar(unsigned int)", +- "void staticinlineBar(unsigned int)", +- "void bar(unsigned int)" +- ] +- +- @parser.treat_inlines = :include +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- it "leave inline and extern functions if inline and extern to be included" do +- source = +- "extern uint32 foobar(unsigned int);\n" + +- "uint32 extern_name_func(unsigned int);\n" + +- "uint32 funcinline(unsigned int);\n" + +- "inline void inlineBar(unsigned int);\n" + +- "extern int extern_bar(void);\n" + +- "static inline void staticinlineBar(unsigned int);\n" + +- "static inline void bar(unsigned int);\n" + +- "static inline void bar(unsigned int)\n" + +- "{\n" + +- " // NOP\n" + +- "}\n" +- +- expected = +- [ "extern uint32 foobar(unsigned int)", +- "uint32 extern_name_func(unsigned int)", +- "uint32 funcinline(unsigned int)", +- "void inlineBar(unsigned int)", +- "extern int extern_bar(void)", +- "void staticinlineBar(unsigned int)", +- "void bar(unsigned int)" +- ] +- +- @parser.treat_externs = :include +- @parser.treat_inlines = :include +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- it "Include inline functions that contain user defined inline function formats" do +- source = +- "uint32 foo(unsigned int);\n" + +- "uint32 bar(unsigned int);\n" + +- "inline void inlineBar(void)\n" + +- "{\n" + +- " return 43;\n" + +- "}\n" + +- "static __inline__ __attribute__ ((always_inline)) int alwaysinlinefunc(int a)\n" + +- "{\n" + +- " return a + inlineBar();\n" + +- "}\n" + +- "static __inline__ void inlinebar(unsigned int)\n" + +- "{\n" + +- " int a = alwaysinlinefunc()\n" + +- "}\n" +- +- expected = +- [ +- "uint32 foo(unsigned int)", +- "uint32 bar(unsigned int)", +- "void inlineBar(void)", +- "int alwaysinlinefunc(int a)", +- "void inlinebar(unsigned int)" +- ] +- +- @parser.treat_inlines = :include +- @parser.inline_function_patterns = ['static __inline__ __attribute__ \(\(always_inline\)\)', 'static __inline__', '\binline\b'] +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- it "remove defines" do +- source = +- "#define whatever you feel like defining\n" + +- "void hello(void);\n" + +- "#DEFINE I JUST DON'T CARE\n" + +- "#deFINE\n" + +- "#define get_foo() \\\n ((Thing)foo.bar)" # exercise multiline define +- +- expected = +- [ +- "void hello(void)", +- ] +- +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- +- it "remove keywords that would keep things from going smoothly in the future" do +- source = +- "const int TheMatrix(register int Trinity, unsigned int *restrict Neo)" +- +- expected = +- [ +- "const int TheMatrix(int Trinity, unsigned int * Neo)", +- ] +- +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- +- # some code actually typedef's void even though it's not ANSI C and is, frankly, weird +- # since cmock treats void specially, we can't let void be obfuscated +- it "handle odd case of typedef'd void returned" do +- source = "MY_FUNKY_VOID FunkyVoidReturned(int a)" +- expected = { :var_arg=>nil, +- :name=>"FunkyVoidReturned", +- :unscoped_name=>"FunkyVoidReturned", +- :namespace=>[], +- :class=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[{:type=>"int", :name=>"a", :ptr? => false, :const? => false, :const_ptr? => false}], +- :args_string=>"int a", +- :args_call=>"a"} +- assert_equal(expected, @parser.parse_declaration(source)) +- end +- +- it "handle odd case of typedef'd void as arg" do +- source = "int FunkyVoidAsArg(MY_FUNKY_VOID)" +- expected = { :var_arg=>nil, +- :name=>"FunkyVoidAsArg", +- :unscoped_name=>"FunkyVoidAsArg", +- :namespace=>[], +- :class=>nil, +- :return=>{ :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[], +- :args_string=>"void", +- :args_call=>"" } +- assert_equal(expected, @parser.parse_declaration(source)) +- end +- +- it "handle odd case of typedef'd void as arg pointer" do +- source = "char FunkyVoidPointer(MY_FUNKY_VOID* bluh)" +- expected = { :var_arg=>nil, +- :name=>"FunkyVoidPointer", +- :unscoped_name=>"FunkyVoidPointer", +- :namespace=>[], +- :class=>nil, +- :return=>{ :type => "char", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "char cmock_to_return", +- :void? => false +- }, +- :modifier=>"", +- :contains_ptr? => true, +- :args=>[{:type=>"MY_FUNKY_VOID*", :name=>"bluh", :ptr? => true, :const? => false, :const_ptr? => false}], +- :args_string=>"MY_FUNKY_VOID* bluh", +- :args_call=>"bluh" } +- assert_equal(expected, @parser.parse_declaration(source)) +- end +- +- +- it "strip default values from function parameter lists" do +- source = +- "void Foo(int a = 57, float b=37.52, char c= 'd', char* e=\"junk\");\n" +- +- expected = +- [ +- "void Foo(int a, float b, char c, char* e)" +- ] +- +- assert_equal(expected, @parser.import_source(source).map!{|s|s.strip}) +- end +- +- +- it "raise upon empty file" do +- source = '' +- +- # ensure it's expected type of exception +- assert_raises RuntimeError do +- @parser.parse("module", source) +- end +- +- assert_equal([], @parser.funcs) +- +- # verify exception message +- begin +- @parser.parse("module", source) +- rescue RuntimeError => e +- assert_equal("ERROR: No function prototypes found!", e.message) +- end +- end +- +- it "clean up module names that contain spaces, dashes, and such" do +- source = 'void meh(int (*func)(int));' +- +- retval = @parser.parse("C:\Ugly Module-Name", source) +- assert (retval[:typedefs][0] =~ /CUglyModuleName/) +- end +- +- it "raise upon no function prototypes found in file" do +- source = +- "typedef void SILLY_VOID_TYPE1;\n" + +- "typedef (void) SILLY_VOID_TYPE2 ;\n" + +- "typedef ( void ) (*FUNCPTR)(void);\n\n" + +- "#define get_foo() \\\n ((Thing)foo.bar)" +- +- # ensure it's expected type of exception +- assert_raises(RuntimeError) do +- @parser.parse("module", source) +- end +- +- assert_equal([], @parser.funcs) +- +- # verify exception message +- begin +- @parser.parse("module", source) +- rescue RuntimeError => e +- assert_equal("ERROR: No function prototypes found!", e.message) +- end +- end +- +- +- it "raise upon prototype parsing failure" do +- source = "void (int, )" +- +- # ensure it's expected type of exception +- assert_raises(RuntimeError) do +- @parser.parse("module", source) +- end +- +- # verify exception message +- begin +- @parser.parse("module", source) +- rescue RuntimeError => e +- assert(e.message.include?("Failed Parsing Declaration Prototype!")) +- end +- end +- +- it "extract and return function declarations with retval and args" do +- +- source = "int Foo(int a, unsigned int b)" +- expected = { :var_arg=>nil, +- :name=>"Foo", +- :unscoped_name=>"Foo", +- :namespace=>[], +- :class=>nil, +- :return=>{ :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"int", :name=>"a", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"unsigned int", :name=>"b", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int a, unsigned int b", +- :args_call=>"a, b" } +- assert_equal(expected, @parser.parse_declaration(source)) +- end +- +- it "extract and return function declarations with no retval" do +- +- source = "void FunkyChicken( uint la, int de, bool da)" +- expected = { :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"FunkyChicken", +- :unscoped_name=>"FunkyChicken", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"uint", :name=>"la", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"int", :name=>"de", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"bool", :name=>"da", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"uint la, int de, bool da", +- :args_call=>"la, de, da" } +- assert_equal(expected, @parser.parse_declaration(source)) +- end +- +- it "extract and return function declarations with implied voids" do +- +- source = "void tat()" +- expected = { :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"tat", +- :unscoped_name=>"tat", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ ], +- :args_string=>"void", +- :args_call=>"" } +- assert_equal(expected, @parser.parse_declaration(source)) +- end +- +- it "extract modifiers properly" do +- +- source = "const int TheMatrix(int Trinity, unsigned int * Neo)" +- expected = { :var_arg=>nil, +- :return=>{ :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => true, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"TheMatrix", +- :unscoped_name=>"TheMatrix", +- :namespace=>[], +- :class=>nil, +- :modifier=>"const", +- :contains_ptr? => true, +- :args=>[ {:type=>"int", :name=>"Trinity", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"unsigned int*", :name=>"Neo", :ptr? => true, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int Trinity, unsigned int* Neo", +- :args_call=>"Trinity, Neo" } +- assert_equal(expected, @parser.parse_declaration(source)) +- end +- +- it "extract c calling conventions properly" do +- +- source = "const int __stdcall TheMatrix(int Trinity, unsigned int * Neo)" +- expected = { :var_arg=>nil, +- :return=>{ :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => true, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"TheMatrix", +- :unscoped_name=>"TheMatrix", +- :namespace=>[], +- :class=>nil, +- :modifier=>"const", +- :c_calling_convention=>"__stdcall", +- :contains_ptr? => true, +- :args=>[ {:type=>"int", :name=>"Trinity", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"unsigned int*", :name=>"Neo", :ptr? => true, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int Trinity, unsigned int* Neo", +- :args_call=>"Trinity, Neo" } +- assert_equal(expected, @parser.parse_declaration(source)) +- end +- +- it "extract and return function declarations inside namespace and class" do +- source = "int Foo(int a, unsigned int b)" +- expected = { :var_arg=>nil, +- :name=>"ns1_ns2_Bar_Foo", +- :unscoped_name=>"Foo", +- :class=>"Bar", +- :namespace=>["ns1", "ns2"], +- :return=>{ :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"int", :name=>"a", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"unsigned int", :name=>"b", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int a, unsigned int b", +- :args_call=>"a, b" } +- assert_equal(expected, @parser.parse_declaration(source, ["ns1", "ns2"], "Bar")) +- end +- +- it "fully parse multiple prototypes" do +- +- source = "const int TheMatrix(int Trinity, unsigned int * Neo);\n" + +- "int Morpheus(int, unsigned int*);\n" +- +- expected = [{ :var_arg=>nil, +- :return=> { :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => true, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"TheMatrix", +- :unscoped_name=>"TheMatrix", +- :namespace=>[], +- :class=>nil, +- :modifier=>"const", +- :contains_ptr? => true, +- :args=>[ {:type=>"int", :name=>"Trinity", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"unsigned int*", :name=>"Neo", :ptr? => true, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int Trinity, unsigned int* Neo", +- :args_call=>"Trinity, Neo" }, +- { :var_arg=>nil, +- :return=> { :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"Morpheus", +- :unscoped_name=>"Morpheus", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => true, +- :args=>[ {:type=>"int", :name=>"cmock_arg1", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"unsigned int*", :name=>"cmock_arg2", :ptr? => true, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int cmock_arg1, unsigned int* cmock_arg2", +- :args_call=>"cmock_arg1, cmock_arg2" +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "not extract for mocking multiply defined prototypes" do +- +- source = "const int TheMatrix(int Trinity, unsigned int * Neo);\n" + +- "const int TheMatrix(int, unsigned int*);\n" +- +- expected = [{ :var_arg=>nil, +- :name=>"TheMatrix", +- :unscoped_name=>"TheMatrix", +- :namespace=>[], +- :class=>nil, +- :return=> { :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => true, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :modifier=>"const", +- :contains_ptr? => true, +- :args=>[ {:type=>"int", :name=>"Trinity", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"unsigned int*", :name=>"Neo", :ptr? => true, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int Trinity, unsigned int* Neo", +- :args_call=>"Trinity, Neo" +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "should properly handle const before return type" do +- sources = [ +- "const int * PorkRoast(void);\n", +- "const int* PorkRoast(void);\n", +- "const int *PorkRoast(void);\n" +- ] +- +- expected = [{ :var_arg => nil, +- :name => "PorkRoast", +- :unscoped_name => "PorkRoast", +- :namespace=>[], +- :class=>nil, +- :return => { :type => "const int*", +- :name => 'cmock_to_return', +- :ptr? => true, +- :const? => true, +- :const_ptr? => false, +- :str => "const int* cmock_to_return", +- :void? => false +- }, +- :modifier => "", +- :contains_ptr? => false, +- :args => [], +- :args_string => "void", +- :args_call => "" +- }] +- +- sources.each do |source| +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- end +- +- it "should properly handle const before return type" do +- sources = [ +- "int const * PorkRoast(void);\n", +- "int const* PorkRoast(void);\n", +- "int const *PorkRoast(void);\n" +- ] +- +- expected = [{ :var_arg => nil, +- :name => "PorkRoast", +- :unscoped_name => "PorkRoast", +- :namespace=>[], +- :class=>nil, +- :return => { :type => "int const*", +- :name => 'cmock_to_return', +- :ptr? => true, +- :const? => true, +- :const_ptr? => false, +- :str => "int const* cmock_to_return", +- :void? => false +- }, +- :modifier => "", +- :contains_ptr? => false, +- :args => [], +- :args_string => "void", +- :args_call => "" +- }] +- +- sources.each do |source| +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- end +- +- it "should properly handle const applied after asterisk in return type (not legal C, but sometimes used)" do +- +- source = "int * const PorkRoast(void);\n" +- +- expected = [{ :var_arg=>nil, +- :name=>"PorkRoast", +- :unscoped_name=>"PorkRoast", +- :namespace=>[], +- :class=>nil, +- :return=> { :type => "int*", +- :name => 'cmock_to_return', +- :ptr? => true, +- :const? => false, +- :const_ptr? => true, +- :str => "int* cmock_to_return", +- :void? => false +- }, +- :modifier=>"const", +- :contains_ptr? => false, +- :args=>[], +- :args_string=>"void", +- :args_call=>"" +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "properly parse const and pointer argument types with no arg names" do +- +- source = "void foo(int const*, int*const, const int*, const int*const, int const*const, int*, int, const int);\n" +- +- expected = [{ :name => "foo", +- :unscoped_name => "foo", +- :namespace=>[], +- :class=>nil, +- :modifier => "", +- :return => { :type => "void", +- :name => "cmock_to_return", +- :str => "void cmock_to_return", +- :void? => true, +- :ptr? => false, +- :const? => false, +- :const_ptr? => false +- }, +- :var_arg => nil, +- :args_string => "int const* cmock_arg1, int* const cmock_arg2, const int* cmock_arg3, const int* const cmock_arg4, " + +- "int const* const cmock_arg5, int* cmock_arg6, int cmock_arg7, const int cmock_arg8", +- :args => [{ :type=>"int const*", :name => "cmock_arg1", :ptr? => true, :const? => true, :const_ptr? => false }, +- { :type=>"int*", :name => "cmock_arg2", :ptr? => true, :const? => false, :const_ptr? => true }, +- { :type=>"const int*", :name => "cmock_arg3", :ptr? => true, :const? => true, :const_ptr? => false }, +- { :type=>"const int*", :name => "cmock_arg4", :ptr? => true, :const? => true, :const_ptr? => true }, +- { :type=>"int const*", :name => "cmock_arg5", :ptr? => true, :const? => true, :const_ptr? => true }, +- { :type=>"int*", :name => "cmock_arg6", :ptr? => true, :const? => false, :const_ptr? => false }, +- { :type=>"int", :name => "cmock_arg7", :ptr? => false, :const? => false, :const_ptr? => false }, +- { :type=>"int", :name => "cmock_arg8", :ptr? => false, :const? => true, :const_ptr? => false }], +- :args_call => "cmock_arg1, cmock_arg2, cmock_arg3, cmock_arg4, cmock_arg5, cmock_arg6, cmock_arg7, cmock_arg8", +- :contains_ptr? => true +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "properly parse const and pointer argument types with arg names" do +- +- source = "void bar(int const* param1, int*const param2, const int* param3, const int*const param4,\n" + +- " int const*const param5, int*param6, int param7, const int param8);\n" +- +- expected = [{ :name => "bar", +- :unscoped_name => "bar", +- :namespace=>[], +- :class=>nil, +- :modifier => "", +- :return => { :type => "void", +- :name => "cmock_to_return", +- :str => "void cmock_to_return", +- :void? => true, +- :ptr? => false, +- :const? => false, +- :const_ptr? => false +- }, +- :var_arg => nil, +- :args_string => "int const* param1, int* const param2, const int* param3, const int* const param4, " + +- "int const* const param5, int* param6, int param7, const int param8", +- :args => [{ :type=>"int const*", :name => "param1", :ptr? => true, :const? => true, :const_ptr? => false }, +- { :type=>"int*", :name => "param2", :ptr? => true, :const? => false, :const_ptr? => true }, +- { :type=>"const int*", :name => "param3", :ptr? => true, :const? => true, :const_ptr? => false }, +- { :type=>"const int*", :name => "param4", :ptr? => true, :const? => true, :const_ptr? => true }, +- { :type=>"int const*", :name => "param5", :ptr? => true, :const? => true, :const_ptr? => true }, +- { :type=>"int*", :name => "param6", :ptr? => true, :const? => false, :const_ptr? => false }, +- { :type=>"int", :name => "param7", :ptr? => false, :const? => false, :const_ptr? => false }, +- { :type=>"int", :name => "param8", :ptr? => false, :const? => true, :const_ptr? => false }], +- :args_call => "param1, param2, param3, param4, param5, param6, param7, param8", +- :contains_ptr? => true +- }].freeze +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "converts typedef'd array arguments to pointers" do +- +- source = "Book AddToBook(Book book, const IntArray values);\n" +- +- expected = [{ :name => "AddToBook", +- :unscoped_name => "AddToBook", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :return => { :type => "Book", +- :name => "cmock_to_return", +- :str => "Book cmock_to_return", +- :void? => false, +- :ptr? => false, +- :const? => false, +- :const_ptr? => false +- }, +- :var_arg => nil, +- :args => [{ :type => "Page*", :name => "book", :ptr? => true, :const? => false, :const_ptr? => false }, +- { :type => "const int*", :name => "values", :ptr? => true, :const? => true, :const_ptr? => false }], +- :args_string => "Book book, const IntArray values", +- :args_call => "book, values", +- :contains_ptr? => true +- }] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- +- end +- +- it "properly detect typedef'd variants of void and use those" do +- +- source = "typedef (void) FUNKY_VOID_T;\n" + +- "typedef void CHUNKY_VOID_T;\n" + +- "FUNKY_VOID_T DrHorrible(int SingAlong);\n" + +- "int CaptainHammer(CHUNKY_VOID_T);\n" +- +- expected = [{ :var_arg=>nil, +- :name=>"DrHorrible", +- :unscoped_name=>"DrHorrible", +- :namespace=>[], +- :class=>nil, +- :return => { :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"int", :name=>"SingAlong", :ptr? => false, :const? => false, :const_ptr? => false} ], +- :args_string=>"int SingAlong", +- :args_call=>"SingAlong" +- }, +- { :var_arg=>nil, +- :return=> { :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"CaptainHammer", +- :unscoped_name=>"CaptainHammer", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ ], +- :args_string=>"void", +- :args_call=>"" +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "be ok with structs inside of function declarations" do +- +- source = "int DrHorrible(struct SingAlong Blog);\n" + +- "void Penny(struct const _KeepYourHeadUp_ * const BillyBuddy);\n" + +- "struct TheseArentTheHammer CaptainHammer(void);\n" +- +- expected = [{ :var_arg=>nil, +- :return =>{ :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"DrHorrible", +- :unscoped_name=>"DrHorrible", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"struct SingAlong", :name=>"Blog", :ptr? => false, :const? => false, :const_ptr? => false} ], +- :args_string=>"struct SingAlong Blog", +- :args_call=>"Blog" +- }, +- { :var_arg=>nil, +- :return=> { :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"Penny", +- :unscoped_name=>"Penny", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => true, +- :args=>[ {:type=>"struct const _KeepYourHeadUp_*", :name=>"BillyBuddy", :ptr? => true, :const? => true, :const_ptr? => true} ], +- :args_string=>"struct const _KeepYourHeadUp_* const BillyBuddy", +- :args_call=>"BillyBuddy" +- }, +- { :var_arg=>nil, +- :return=> { :type => "struct TheseArentTheHammer", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "struct TheseArentTheHammer cmock_to_return", +- :void? => false +- }, +- :name=>"CaptainHammer", +- :unscoped_name=>"CaptainHammer", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ ], +- :args_string=>"void", +- :args_call=>"" +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "extract functions containing unions with union specifier" do +- source = "void OrangePeel(union STARS_AND_STRIPES * a, union AFL_CIO b)" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"OrangePeel", +- :unscoped_name=>"OrangePeel", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => true, +- :args=>[ {:type=>"union STARS_AND_STRIPES*", :name=>"a", :ptr? => true, :const? => false, :const_ptr? => false}, +- {:type=>"union AFL_CIO", :name=>"b", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"union STARS_AND_STRIPES* a, union AFL_CIO b", +- :args_call=>"a, b" }] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- end +- +- it "not be thwarted by variables named with primitive types as part of the name" do +- source = "void ApplePeel(const unsigned int const_param, int int_param, int integer, char character, int* const constant)" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"ApplePeel", +- :unscoped_name=>"ApplePeel", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => true, +- :args=>[ {:type=> "unsigned int", :name=>"const_param", :ptr? => false, :const? => true, :const_ptr? => false}, +- {:type=>"int", :name=>"int_param", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"int", :name=>"integer", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"char", :name=>"character", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"int*", :name=>"constant", :ptr? => true, :const? => false, :const_ptr? => true} +- ], +- :args_string=>"const unsigned int const_param, int int_param, int integer, char character, int* const constant", +- :args_call=>"const_param, int_param, integer, character, constant" }] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- end +- +- it "not be thwarted by custom types named similarly to primitive types" do +- source = "void LemonPeel(integer param, character thing, longint * junk, constant value, int32_t const number)" +- expected = [{:var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"LemonPeel", +- :unscoped_name=>"LemonPeel", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => true, +- :args=>[ {:type=>"integer", :name=>"param", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"character", :name=>"thing", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"longint*", :name=>"junk", :ptr? => true, :const? => false, :const_ptr? => false}, +- {:type=>"constant", :name=>"value", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"int32_t", :name=>"number", :ptr? => false, :const? => true, :const_ptr? => false} +- ], +- :args_string=>"integer param, character thing, longint* junk, constant value, int32_t const number", +- :args_call=>"param, thing, junk, value, number" }] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- end +- +- it "handle some of those chains of C name specifiers naturally" do +- source = "void CoinOperated(signed char abc, const unsigned long int xyz_123, unsigned int const abc_123, long long arm_of_the_law)" +- expected = [{:var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"CoinOperated", +- :unscoped_name=>"CoinOperated", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"signed char", :name=>"abc", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"unsigned long int", :name=>"xyz_123", :ptr? => false, :const? => true, :const_ptr? => false}, +- {:type=>"unsigned int", :name=>"abc_123", :ptr? => false, :const? => true, :const_ptr? => false}, +- {:type=>"long long", :name=>"arm_of_the_law", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"signed char abc, const unsigned long int xyz_123, unsigned int const abc_123, long long arm_of_the_law", +- :args_call=>"abc, xyz_123, abc_123, arm_of_the_law" }] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- end +- +- it "handle custom types of various formats" do +- source = "void CardOperated(CUSTOM_TYPE abc, CUSTOM_TYPE* xyz_123, CUSTOM_TYPE const abcxyz, struct CUSTOM_TYPE const * const abc123)" +- expected = [{:var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"CardOperated", +- :unscoped_name=>"CardOperated", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => true, +- :args=>[ {:type=>"CUSTOM_TYPE", :name=>"abc", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"CUSTOM_TYPE*", :name=>"xyz_123", :ptr? => true, :const? => false, :const_ptr? => false}, +- {:type=>"CUSTOM_TYPE", :name=>"abcxyz", :ptr? => false, :const? => true, :const_ptr? => false}, +- {:type=>"struct CUSTOM_TYPE const*", :name=>"abc123", :ptr? => true, :const? => true, :const_ptr? => true} +- ], +- :args_string=>"CUSTOM_TYPE abc, CUSTOM_TYPE* xyz_123, CUSTOM_TYPE const abcxyz, struct CUSTOM_TYPE const* const abc123", +- :args_call=>"abc, xyz_123, abcxyz, abc123" }] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- end +- +- it "handle arrays and treat them as pointers or strings" do +- source = 'void KeyOperated(CUSTOM_TYPE thing1[], int thing2 [ ], ' \ +- 'char thing3 [][2 ][ 3], int* thing4[4], u8 thing5[((u8)((5 + 5*2)/3))])' +- expected_args = [ +- { type: 'CUSTOM_TYPE*', name: 'thing1', ptr?: true, const?: false, const_ptr?: false }, +- { type: 'int*', name: 'thing2', ptr?: true, const?: false, const_ptr?: false }, +- # this one will likely change in the future when we improve multidimensional array support +- { type: 'char*', name: 'thing3', ptr?: false, const?: false, const_ptr?: false }, +- # this one will likely change in the future when we improve multidimensional array support +- { type: 'int**', name: 'thing4', ptr?: true, const?: false, const_ptr?: false }, +- { type: 'u8*', name: 'thing5', ptr?: true, const?: false, const_ptr?: false } +- ] +- expected = [{:var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"KeyOperated", +- :unscoped_name=>"KeyOperated", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => true, +- :args => expected_args, +- :args_string => 'CUSTOM_TYPE* thing1, int* thing2, ' \ +- 'char* thing3, int** thing4, u8* thing5', +- :args_call => 'thing1, thing2, thing3, thing4, thing5' }] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- end +- +- it "give a reasonable guess when dealing with weird combinations of custom types and modifiers" do +- source = "void Cheese(unsigned CUSTOM_TYPE abc, unsigned xyz, CUSTOM_TYPE1 CUSTOM_TYPE2 pdq)" +- expected = [{:var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"Cheese", +- :unscoped_name=>"Cheese", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"unsigned CUSTOM_TYPE", :name=>"abc", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"unsigned", :name=>"xyz", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"CUSTOM_TYPE1 CUSTOM_TYPE2", :name=>"pdq", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"unsigned CUSTOM_TYPE abc, unsigned xyz, CUSTOM_TYPE1 CUSTOM_TYPE2 pdq", +- :args_call=>"abc, xyz, pdq" }] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- end +- +- it "extract functions containing a function pointer" do +- source = "void FunkyTurkey(unsigned int (*func_ptr)(int, char))" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"FunkyTurkey", +- :unscoped_name=>"FunkyTurkey", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"cmock_module_func_ptr1 func_ptr", +- :args_call=>"func_ptr" }] +- typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)(int, char);"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions using a function pointer with shorthand notation" do +- source = "void FunkyTurkey(unsigned int func_ptr(int, char))" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"FunkyTurkey", +- :unscoped_name=>"FunkyTurkey", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"cmock_module_func_ptr1 func_ptr", +- :args_call=>"func_ptr" }] +- typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)(int, char);"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions containing a function pointer with a void" do +- source = "void FunkyTurkey(void (*func_ptr)(void))" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"FunkyTurkey", +- :unscoped_name=>"FunkyTurkey", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"cmock_module_func_ptr1 func_ptr", +- :args_call=>"func_ptr" }] +- typedefs = ["typedef void(*cmock_module_func_ptr1)(void);"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions containing a function pointer with an implied void" do +- source = "void FunkyTurkey(unsigned int (*func_ptr)())" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"FunkyTurkey", +- :unscoped_name=>"FunkyTurkey", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"cmock_module_func_ptr1 func_ptr", +- :args_call=>"func_ptr" }] +- typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)();"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions containing a constant function pointer and a pointer in the nested arg list" do +- source = "void FunkyChicken(unsigned int (* const func_ptr)(unsigned long int * , char))" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"FunkyChicken", +- :unscoped_name=>"FunkyChicken", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => true, :const_ptr? => false} +- ], +- :args_string=>"cmock_module_func_ptr1 const func_ptr", +- :args_call=>"func_ptr" }] +- typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)(unsigned long int* , char);"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- # it "extract functions containing a function pointer taking a vararg" do +- # source = "void FunkyParrot(unsigned int (*func_ptr)(int, char, ...))" +- # expected = [{ :var_arg=>nil, +- # :return=>{ :type => "void", +- # :name => 'cmock_to_return', +- # :ptr? => false, +- # :const? => false, +- # :const_ptr? => false, +- # :str => "void cmock_to_return", +- # :void? => true +- # }, +- # :name=>"FunkyParrot", +- # :unscoped_name=>"FunkyParrot", +- # :namespace=>[], +- # :class=>nil, +- # :modifier=>"", +- # :contains_ptr? => false, +- # :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr", :ptr? => false, :const? => false, :const_ptr? => false} +- # ], +- # :args_string=>"cmock_module_func_ptr1 func_ptr", +- # :args_call=>"func_ptr" }] +- # typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)(int, char, ...);"] +- # result = @parser.parse("module", source) +- # assert_equal(expected, result[:functions]) +- # assert_equal(typedefs, result[:typedefs]) +- # end +- +- it "extract functions containing a function pointer with extra parenthesis and two sets" do +- source = "void FunkyBudgie(int (((* func_ptr1)(int, char))), void (*func_ptr2)(void))" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"FunkyBudgie", +- :unscoped_name=>"FunkyBudgie", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"func_ptr1", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"cmock_module_func_ptr2", :name=>"func_ptr2", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"cmock_module_func_ptr1 func_ptr1, cmock_module_func_ptr2 func_ptr2", +- :args_call=>"func_ptr1, func_ptr2" }] +- typedefs = ["typedef int(*cmock_module_func_ptr1)(int, char);", "typedef void(*cmock_module_func_ptr2)(void);"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions containing a function pointers, structs and other things" do +- source = "struct mytype *FunkyRobin(uint16_t num1, uint16_t num2, void (*func_ptr1)(uint16_t num3, struct mytype2 *s));" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "struct mytype*", +- :name => 'cmock_to_return', +- :ptr? => true, +- :const? => false, +- :const_ptr? => false, +- :str => "struct mytype* cmock_to_return", +- :void? => false +- }, +- :name=>"FunkyRobin", +- :unscoped_name=>"FunkyRobin", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"uint16_t", :name=>"num1", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"uint16_t", :name=>"num2", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"cmock_module_func_ptr1", :name=>"func_ptr1", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"uint16_t num1, uint16_t num2, cmock_module_func_ptr1 func_ptr1", +- :args_call=>"num1, num2, func_ptr1" }] +- typedefs = ["typedef void(*cmock_module_func_ptr1)(uint16_t num3, struct mytype2* s);"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions containing an anonymous function pointer" do +- source = "void FunkyFowl(unsigned int (* const)(int, char))" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "void", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "void cmock_to_return", +- :void? => true +- }, +- :name=>"FunkyFowl", +- :unscoped_name=>"FunkyFowl", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"cmock_module_func_ptr1", :name=>"cmock_arg1", :ptr? => false, :const? => true, :const_ptr? => false} +- ], +- :args_string=>"cmock_module_func_ptr1 const cmock_arg1", +- :args_call=>"cmock_arg1" }] +- typedefs = ["typedef unsigned int(*cmock_module_func_ptr1)(int, char);"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions returning a function pointer" do +- source = "unsigned short (*FunkyPidgeon( const char op_code ))( int, long int )" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "cmock_module_func_ptr1", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "cmock_module_func_ptr1 cmock_to_return", +- :void? => false +- }, +- :name=>"FunkyPidgeon", +- :unscoped_name=>"FunkyPidgeon", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"char", :name=>"op_code", :ptr? => false, :const? => true, :const_ptr? => false} +- ], +- :args_string=>"const char op_code", +- :args_call=>"op_code" }] +- typedefs = ["typedef unsigned short(*cmock_module_func_ptr1)( int, long int );"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions returning a function pointer with implied void" do +- source = "unsigned short (*FunkyTweetie())()" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "cmock_module_func_ptr1", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "cmock_module_func_ptr1 cmock_to_return", +- :void? => false +- }, +- :name=>"FunkyTweetie", +- :unscoped_name=>"FunkyTweetie", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[], +- :args_string=>"void", +- :args_call=>"" }] +- typedefs = ["typedef unsigned short(*cmock_module_func_ptr1)();"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions returning a function pointer where everything is a void" do +- source = "void (* FunkySeaGull(void))(void)" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "cmock_module_func_ptr1", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "cmock_module_func_ptr1 cmock_to_return", +- :void? => false +- }, +- :name=>"FunkySeaGull", +- :unscoped_name=>"FunkySeaGull", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[], +- :args_string=>"void", +- :args_call=>"" }] +- typedefs = ["typedef void(*cmock_module_func_ptr1)(void);"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions returning a function pointer with some pointer nonsense" do +- source = "unsigned int * (* FunkyMacaw(double* foo, THING *bar))(unsigned int)" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "cmock_module_func_ptr1", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "cmock_module_func_ptr1 cmock_to_return", +- :void? => false +- }, +- :name=>"FunkyMacaw", +- :unscoped_name=>"FunkyMacaw", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => true, +- :args=>[ {:type=>"double*", :name=>"foo", :ptr? => true, :const? => false, :const_ptr? => false}, +- {:type=>"THING*", :name=>"bar", :ptr? => true, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"double* foo, THING* bar", +- :args_call=>"foo, bar" }] +- typedefs = ["typedef unsigned int *(*cmock_module_func_ptr1)(unsigned int);"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract this SQLite3 function with an anonymous function pointer arg (regression test)" do +- source = "SQLITE_API int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*))" +- expected = [{ :var_arg=>nil, +- :return=>{ :type => "int", +- :name => "cmock_to_return", +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"sqlite3_bind_text", +- :unscoped_name=>"sqlite3_bind_text", +- :namespace=>[], +- :class=>nil, +- :modifier=>"SQLITE_API", +- :contains_ptr? => true, +- :args=>[ {:type=>"sqlite3_stmt*", :name=>"cmock_arg2", :ptr? => true, :const? => false, :const_ptr? => false}, +- {:type=>"int", :name=>"cmock_arg3", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"const char*", :name=>"cmock_arg4", :ptr? => false, :const? => true, :const_ptr? => false}, +- {:type=>"int", :name=>"n", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"cmock_module_func_ptr1", :name=>"cmock_arg1", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"sqlite3_stmt* cmock_arg2, int cmock_arg3, const char* cmock_arg4, int n, cmock_module_func_ptr1 cmock_arg1", +- :args_call=>"cmock_arg2, cmock_arg3, cmock_arg4, n, cmock_arg1" }] +- typedefs = ["typedef void(*cmock_module_func_ptr1)(void*);"] +- result = @parser.parse("module", source) +- assert_equal(expected, result[:functions]) +- assert_equal(typedefs, result[:typedefs]) +- end +- +- it "extract functions with varargs" do +- source = "int XFiles(int Scully, int Mulder, ...);\n" +- expected = [{ :var_arg=>"...", +- :return=> { :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"XFiles", +- :unscoped_name=>"XFiles", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"int", :name=>"Scully", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"int", :name=>"Mulder", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int Scully, int Mulder", +- :args_call=>"Scully, Mulder" +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "extract functions with void pointers" do +- source = "void* MoreSillySongs(void* stuff);\n" +- expected = [{ :var_arg=>nil, +- :return=> { :type => "void*", +- :name => 'cmock_to_return', +- :ptr? => true, +- :const? => false, +- :const_ptr? => false, +- :str => "void* cmock_to_return", +- :void? => false +- }, +- :name=>"MoreSillySongs", +- :unscoped_name=>"MoreSillySongs", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => true, +- :args=>[ {:type=>"void*", :name=>"stuff", :ptr? => true, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"void* stuff", +- :args_call=>"stuff" +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "extract functions with strippable confusing junk like gcc attributes" do +- source = "int LaverneAndShirley(int Lenny, int Squiggy) __attribute__((weak)) __attribute__ ((deprecated));\n" +- expected = [{ :var_arg=>nil, +- :return=> { :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"LaverneAndShirley", +- :unscoped_name=>"LaverneAndShirley", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"int", :name=>"Lenny", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"int", :name=>"Squiggy", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int Lenny, int Squiggy", +- :args_call=>"Lenny, Squiggy" +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "extract functions with strippable confusing junk like gcc attributes with parenthesis" do +- source = "int TheCosbyShow(int Cliff, int Claire) __attribute__((weak, alias (\"__f\"));\n" +- expected = [{ :var_arg=>nil, +- :return=> { :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"TheCosbyShow", +- :unscoped_name=>"TheCosbyShow", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"int", :name=>"Cliff", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"int", :name=>"Claire", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int Cliff, int Claire", +- :args_call=>"Cliff, Claire" +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "divines all permutations of ptr, const, and const_ptr correctly" do +- truth_table = [ +- # argument ptr const const_ptr +- [ "constNOTconst constNOTconst", false, false, false ], +- [ "const constNOTconst constNOTconst", false, true, false ], +- [ "constNOTconst const constNOTconst", false, true, false ], +- [ "constNOTconst *constNOTconst", true, false, false ], +- [ "const constNOTconst *constNOTconst", true, true, false ], +- [ "constNOTconst const *constNOTconst", true, true, false ], +- [ "constNOTconst *const constNOTconst", true, false, true ], +- [ "const constNOTconst *const constNOTconst", true, true, true ], +- [ "constNOTconst const *const constNOTconst", true, true, true ], +- [ "constNOTconst **constNOTconst", true, false, false ], +- [ "const constNOTconst **constNOTconst", true, false, false ], +- [ "constNOTconst const **constNOTconst", true, false, false ], +- [ "constNOTconst *const *constNOTconst", true, true, false ], +- [ "const constNOTconst *const *constNOTconst", true, true, false ], +- [ "constNOTconst const *const *constNOTconst", true, true, false ], +- [ "constNOTconst **const constNOTconst", true, false, true ], +- [ "const constNOTconst **const constNOTconst", true, false, true ], +- [ "constNOTconst const **const constNOTconst", true, false, true ], +- [ "constNOTconst *const *const constNOTconst", true, true, true ], +- [ "const constNOTconst *const *const constNOTconst", true, true, true ], +- [ "constNOTconst const *const *const constNOTconst", true, true, true ] +- ] +- +- truth_table.each do |entry| +- assert_equal(@parser.divine_ptr(entry[0]), entry[1]) +- assert_equal(@parser.divine_const(entry[0]), entry[2]) +- assert_equal(@parser.divine_ptr_and_const(entry[0]), +- { ptr?: entry[1], const?: entry[2], const_ptr?: entry[3] }) +- end +- end +- +- it "divines ptr correctly for string types" do +- truth_table = [ +- # argument ptr +- [ "char s", false ], +- [ "const char s", false ], +- [ "char const s", false ], +- [ "char *s", false ], +- [ "const char *s", false ], +- [ "char const *s", false ], +- [ "char *const s", false ], +- [ "const char *const s", false ], +- [ "char const *const s", false ], +- [ "char **s", true ], +- [ "const char **s", true ], +- [ "char const **s", true ], +- [ "char *const *s", true ], +- [ "const char *const *s", true ], +- [ "char const *const *s", true ], +- [ "char **const s", true ], +- [ "const char **const s", true ], +- [ "char const **const s", true ], +- [ "char *const *const s", true ], +- [ "const char *const *const s", true ], +- [ "char const *const *const s", true ] +- ] +- +- truth_table.each do |entry| +- assert_equal(@parser.divine_ptr(entry[0]), entry[1]) +- end +- end +- +- it "Transform inline functions doesn't change a header with no inlines" do +- source = +- "#ifndef _NOINCLUDES\n" + +- "#define _NOINCLUDES\n" + +- "#include \"unity.h\"\n" + +- "#include \"cmock.h\"\n" + +- "#include \"YetAnotherHeader.h\"\n" + +- "\n" + +- "/* Ignore the following warnings since we are copying code */\n" + +- "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n" + +- "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n" + +- "#pragma GCC diagnostic push\n" + +- "#endif\n" + +- "#if !defined(__clang__)\n" + +- "#pragma GCC diagnostic ignored \"-Wpragmas\"\n" + +- "#endif\n" + +- "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n" + +- "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n" + +- "#endif\n" + +- "\n" + +- "struct my_struct {\n" + +- "int a;\n" + +- "int b;\n" + +- "int b;\n" + +- "char c;\n" + +- "};\n" + +- "int my_function(int a);\n" + +- "int my_better_function(struct my_struct *s);\n" + +- "\n" + +- "#endif _NOINCLUDES\n" +- +- assert_equal(source, @parser.transform_inline_functions(source)) +- end +- +- it "Transform inline functions changes inline functions to function declarations" do +- source = +- "#ifndef _NOINCLUDES\n" + +- "#define _NOINCLUDES\n" + +- "#include \"unity.h\"\n" + +- "#include \"cmock.h\"\n" + +- "#include \"YetAnotherHeader.h\"\n" + +- "\n" + +- "/* Ignore the following warnings since we are copying code */\n" + +- "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n" + +- "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n" + +- "#pragma GCC diagnostic push\n" + +- "#endif\n" + +- "#if !defined(__clang__)\n" + +- "#pragma GCC diagnostic ignored \"-Wpragmas\"\n" + +- "#endif\n" + +- "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n" + +- "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n" + +- "#endif\n" + +- "\n" + +- "struct my_struct {\n" + +- "int a;\n" + +- "int b;\n" + +- "int b;\n" + +- "char c;\n" + +- "};\n" + +- "int my_function(int a);\n" + +- "int my_better_function(struct my_struct *s);\n" + +- "static inline int staticinlinebar(struct my_struct *s)\n" + # This is a function with a lot of indentation levels, we should be able to handle it +- "{\n" + +- "\t{\n" + +- "\t\t{\n" + +- "\t\t\treturn s->a;\n" + +- "\t\t}\n" + +- "\t}\n" + +- "}\n" + +- "static inline int staticinlinefunc(struct my_struct *s)\n" + +- "{\n" + +- " return s->a;\n" + +- "}\n" + +- "int bar(struct my_struct *s);\n" + # A normal function to screw with our parser +- "inline static int inlinestaticfunc(int a) {\n" + +- " return a + 42;\n" + +- "}\n" + +- "inline int StaticInlineFunc(struct my_struct *s)\n" + +- "{\n" + +- " return get_member_a(s) + 42;\n" + +- "}\n" + +- "int inline StaticInlineBar(struct my_struct *s)\n" + +- "{\n" + +- " return get_member_a(s) + 42;\n" + +- "}\n" + +- "struct staticinlinestruct {\n" + # Add a structure declaration between the inline functions, just to make sure we don't touch it! +- "int a;\n" + +- "};\n" + +- "\n" + +- "struct staticinlinestruct fubarstruct(struct my_struct *s);\n" + # Another normal function to screw with our parser +- "static inline struct staticinlinestruct inlinefubarfunction(struct my_struct *s)\n" + +- "{\n" + +- " return (struct staticinlinestruct)*s;\n" + +- "}\n" + +- "int fubar(struct my_struct *s);\n" + # Another normal function to screw with our parser +- "inline int stuff(int num)" + +- "{" + +- " int reg = 0x12;" + +- " if (num > 0)" + +- " {" + +- " reg |= (0x0Eu);" + +- " }" + +- " else" + +- " {" + +- " reg |= (0x07u);" + +- " }" + +- " return reg;" + +- "}" + +- "\n" + +- "int inline static dummy_func_2(int a, char b, float c) {" + # This is a sneaky one, inline static is placed AFTER the return value +- " c += 3.14;" + +- " b -= 32;" + +- " return a + (int)(b) + (int)c;" + +- "}" + +- "#endif _NOINCLUDES\n" +- +- expected = +- "#ifndef _NOINCLUDES\n" + +- "#define _NOINCLUDES\n" + +- "#include \"unity.h\"\n" + +- "#include \"cmock.h\"\n" + +- "#include \"YetAnotherHeader.h\"\n" + +- "\n" + +- "/* Ignore the following warnings since we are copying code */\n" + +- "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n" + +- "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n" + +- "#pragma GCC diagnostic push\n" + +- "#endif\n" + +- "#if !defined(__clang__)\n" + +- "#pragma GCC diagnostic ignored \"-Wpragmas\"\n" + +- "#endif\n" + +- "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n" + +- "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n" + +- "#endif\n" + +- "\n" + +- "struct my_struct {\n" + +- "int a;\n" + +- "int b;\n" + +- "int b;\n" + +- "char c;\n" + +- "};\n" + +- "int my_function(int a);\n" + +- "int my_better_function(struct my_struct *s);\n" + +- "int staticinlinebar(struct my_struct *s);\n" + +- "int staticinlinefunc(struct my_struct *s);\n" + +- "int bar(struct my_struct *s);\n" + +- "int inlinestaticfunc(int a);\n" + +- "int StaticInlineFunc(struct my_struct *s);\n" + +- "int StaticInlineBar(struct my_struct *s);\n" + +- "struct staticinlinestruct {\n" + +- "int a;\n" + +- "};\n" + +- "\n" + +- "struct staticinlinestruct fubarstruct(struct my_struct *s);\n" + +- "struct staticinlinestruct inlinefubarfunction(struct my_struct *s);\n" + +- "int fubar(struct my_struct *s);\n" + +- "int stuff(int num);\n" + +- "int dummy_func_2(int a, char b, float c);" + +- "#endif _NOINCLUDES\n" +- +- assert_equal(expected, @parser.transform_inline_functions(source)) +- end +- +- it "Count number of pairs of braces in function succesfully" do +- source = +- "int foo(struct my_struct *s)\n" + +- "{\n" + +- " return get_member_a(s) + 42;\n" + +- "}\n" +- complex_source = +- "int bar(struct my_struct *s)\n" + +- "{\n" + +- "\tint a = 6;\n" + +- "\tint res = foo(&(struct my_struct){.nr = a});\n" + +- "\t{\n" + +- "\t\tint a = 5;\n" + +- "\t\tint res = foo(&(struct my_struct){.nr = a});\n" + +- "\t\t{\n" + +- "\t\t\tstruct my_struct a = {.nr = 1};\n" + +- "\t\t}\n" + +- "\t}\n" + +- "\treturn 42;\n" + +- "}\n" +- +- assert_equal(1, @parser.count_number_of_pairs_of_braces_in_function(source)) +- assert_equal(6, @parser.count_number_of_pairs_of_braces_in_function(complex_source)) +- end +- +- it "Count number of pairs of braces returns 0 if bad source is supplied" do +- bad_source_0 = +- "int foo(struct my_struct *s)\n" + +- "{\n" + +- " return get_member_a(s) + 42;\n" + +- "\n" # Missing closing brace +- bad_source_1 = +- "int bar(struct my_struct *s)\n" + +- "{\n" + +- "\tint a = 6;\n" + +- "\tint res = foo(&(struct my_struct){.nr = a});\n" + +- "\t{\n" + +- "\t\tint a = 5;\n" + +- "\t\tint res = foo(&(struct my_struct){.nr = a});\n" + +- "\t\t{\n" + +- "\t\t\n" + # Missing closing brace +- "\t}\n" + +- "\treturn 42;\n" + +- "}\n" +- bad_source_2 = +- "int foo(struct my_struct *s)\n" + +- "\n" # No braces in source +- +- assert_equal(0, @parser.count_number_of_pairs_of_braces_in_function(bad_source_0)) +- assert_equal(0, @parser.count_number_of_pairs_of_braces_in_function(bad_source_1)) +- assert_equal(0, @parser.count_number_of_pairs_of_braces_in_function(bad_source_2)) +- end +- +- it "handles parsing multiline functions" do +- source = "int\nLaverneAndShirley(int Lenny,\n int Squiggy);\n" +- expected = [{ :var_arg=>nil, +- :return=> { :type => "int", +- :name => 'cmock_to_return', +- :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :str => "int cmock_to_return", +- :void? => false +- }, +- :name=>"LaverneAndShirley", +- :unscoped_name=>"LaverneAndShirley", +- :namespace=>[], +- :class=>nil, +- :modifier=>"", +- :contains_ptr? => false, +- :args=>[ {:type=>"int", :name=>"Lenny", :ptr? => false, :const? => false, :const_ptr? => false}, +- {:type=>"int", :name=>"Squiggy", :ptr? => false, :const? => false, :const_ptr? => false} +- ], +- :args_string=>"int Lenny, int Squiggy", +- :args_call=>"Lenny, Squiggy" +- }] +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "imports C++ differently when asked" do +- source = +- [ +- "namespace ns1 {\n", +- " namespace ns2 {\n", +- "\n", +- " class cls1 {\n", +- " public:\n", +- " int f_header_impl(int a, int b){\n", +- " return a + b;\n", +- " }\n", +- "\n", +- " static void f_void();\n", +- " static int f_ret_simple();\n", +- "\n", +- " protected:\n", +- " static void protected_f_void();\n", +- "\n", +- " public:\n", +- " private:\n", +- " static void private_f_void();\n", +- " }; // cls1\n", +- " } // ns2\n", +- "} // ns1\n" +- ].join +- +- expected = +- [ +- "namespace ns1 { namespace ns2 { class cls1 { public: int f_header_impl", +- "static void f_void()", +- "static int f_ret_simple()", +- "protected: static void protected_f_void()", +- "public: private: static void private_f_void()", +- "}", +- "} }" +- ] +- +- assert_equal(expected, @parser.import_source(source, cpp=true)) +- refute_equal(expected, @parser.import_source(source)) +- end +- +- # only so parse_functions does not raise an error +- def dummy_source +- "void dummy(void);" +- end +- +- # Expected result of above +- def dummy_func +- { :name => "dummy", +- :unscoped_name => "dummy", +- :class => nil, +- :namespace => [], +- :var_arg => nil, +- :args_string => "void", +- :args => [], +- :args_call => "", +- :contains_ptr? => false, +- :modifier => "", +- :return => { +- :type => "void", +- :name => "cmock_to_return", +- :str => "void cmock_to_return", +- :void? => true, +- :ptr? => false, +- :const? => false, +- :const_ptr? => false}} +- end +- +- # Commonly used example function +- def voidvoid_func(namespace=[], name="Classic_functional") +- { :name => name, +- :unscoped_name => "functional", +- :class => "Classic", +- :namespace => namespace, +- :var_arg => nil, +- :args_string => "void", +- :args => [], +- :args_call => "", +- :contains_ptr? => false, +- :modifier => "", +- :return => { +- :type=>"void", +- :name=>"cmock_to_return", +- :str=>"void cmock_to_return", +- :void? => true, +- :ptr? => false, +- :const? => false, +- :const_ptr? => false}} +- end +- +- it "parses public C++ functions" do +- source = dummy_source + <<~SOURCE +- class Classic { +- public: +- static void functional(void); +- }; +- SOURCE +- +- expected = [dummy_func, voidvoid_func] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "handles a namespace" do +- source = dummy_source + <<~SOURCE +- namespace ns1 { +- class Classic { +- public: +- static void functional(void); +- }; +- } // ns1 +- SOURCE +- +- expected = [dummy_func, +- voidvoid_func(namespace=["ns1"], name="ns1_Classic_functional")] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "handles nested namespaces" do +- source = dummy_source + <<~SOURCE +- namespace ns1 { +- namespace ns2 { +- class Classic { +- public: +- static void functional(void); +- }; +- } // ns1 +- } // ns1 +- SOURCE +- +- expected = [dummy_func, +- voidvoid_func(namespace=["ns1", "ns2"], name="ns1_ns2_Classic_functional")] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "ignores non-static C++ functions" do +- source = dummy_source + <<~SOURCE +- class Classic { +- public: +- void functional(void); +- }; +- SOURCE +- +- expected = [dummy_func] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "ignores private functions" do +- source = dummy_source + <<~SOURCE +- class Classic { +- private: +- static void functional(void); +- }; +- SOURCE +- +- expected = [dummy_func] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "parses public C++ functions after private functions" do +- source = dummy_source + <<~SOURCE +- class Classic { +- private: +- static void ignoreme(void); +- public: +- static void functional(void); +- }; +- SOURCE +- +- expected = [dummy_func, voidvoid_func] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "ignores protected functions" do +- source = dummy_source + <<~SOURCE +- class Classic { +- protected: +- static void functional(void); +- }; +- SOURCE +- +- expected = [dummy_func] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "parses public C++ functions after protected functions" do +- source = dummy_source + <<~SOURCE +- class Classic { +- protected: +- static void ignoreme(void); +- public: +- static void functional(void); +- }; +- SOURCE +- +- expected = [dummy_func, voidvoid_func] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "parses multiple classes in same file with uniquely named functions" do +- source = dummy_source + <<~SOURCE +- namespace ns1 { +- class Classic { +- public: +- static void functional(void); +- }; +- +- class Classical { +- public: +- static int functionality(int a); +- }; +- } // ns1 +- +- class Classy { +- public: +- static int* func(int* a); +- }; +- SOURCE +- +- expected = [dummy_func, +- voidvoid_func(["ns1"], name="ns1_Classic_functional"), +- { :name => "ns1_Classical_functionality", +- :unscoped_name => "functionality", +- :class => "Classical", +- :namespace => ["ns1"], +- :var_arg => nil, +- :args_string => "int a", +- :args => [ +- { :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :name => "a", +- :type => "int"}], +- :args_call => "a", +- :contains_ptr? => false, +- :modifier => "", +- :return => { +- :type=>"int", +- :name=>"cmock_to_return", +- :str=>"int cmock_to_return", +- :void? => false, +- :ptr? => false, +- :const? => false, +- :const_ptr? => false}}, +- { :name => "Classy_func", +- :unscoped_name => "func", +- :class => "Classy", +- :namespace => [], +- :var_arg => nil, +- :args_string => "int* a", +- :args => [ +- { :ptr? => true, +- :const? => false, +- :const_ptr? => false, +- :name => "a", +- :type => "int*"}], +- :args_call => "a", +- :contains_ptr? => true, +- :modifier => "", +- :return => { +- :type=>"int*", +- :name=>"cmock_to_return", +- :str=>"int* cmock_to_return", +- :void? => false, +- :ptr? => true, +- :const? => false, +- :const_ptr? => false}}] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "handles multiple classes in same file with identically named functions" do +- source = dummy_source + <<~SOURCE +- namespace ns1 { +- class Classic { +- public: +- static void functional(void); +- }; +- +- class Classical { +- public: +- static int functional(int a); +- }; +- } // ns1 +- +- class Classy { +- public: +- static int* functional(int* a); +- }; +- SOURCE +- +- expected = [dummy_func, +- voidvoid_func(["ns1"], name="ns1_Classic_functional"), +- { :name => "ns1_Classical_functional", +- :unscoped_name => "functional", +- :class => "Classical", +- :namespace => ["ns1"], +- :var_arg => nil, +- :args_string => "int a", +- :args => [ +- { :ptr? => false, +- :const? => false, +- :const_ptr? => false, +- :name => "a", +- :type => "int"}], +- :args_call => "a", +- :contains_ptr? => false, +- :modifier => "", +- :return => { +- :type=>"int", +- :name=>"cmock_to_return", +- :str=>"int cmock_to_return", +- :void? => false, +- :ptr? => false, +- :const? => false, +- :const_ptr? => false}}, +- { :name => "Classy_functional", +- :unscoped_name => "functional", +- :class => "Classy", +- :namespace => [], +- :var_arg => nil, +- :args_string => "int* a", +- :args => [ +- { :ptr? => true, +- :const? => false, +- :const_ptr? => false, +- :name => "a", +- :type => "int*"}], +- :args_call => "a", +- :contains_ptr? => true, +- :modifier => "", +- :return => { +- :type=>"int*", +- :name=>"cmock_to_return", +- :str=>"int* cmock_to_return", +- :void? => false, +- :ptr? => true, +- :const? => false, +- :const_ptr? => false}}] +- +- assert_equal(expected, @parser.parse("module", source)[:functions]) +- end +- +- it "Transform inline functions can handle inline function declarations" do +- source = +- "static inline int dummy_func_decl(int a, char b, float c);\n" + # First declaration +- "static inline int dummy_func_decl2(int a, char b, float c)\n\n\n\n\n\n;\n" + # Second declaration with a lot of newlines before the semicolon to mess with the parser +- "static inline int staticinlinefunc(struct my_struct *s)\n" + # 'normal' inline pattern +- "{\n" + +- " return dummy_func_decl(1, 1, 1);\n" + +- "}\n" + +- "struct my_struct_with_inline_in_it\n" + # struct definition in between to mess with the parser +- "{\n" + +- " int a;\n" + +- " char b;\n" + +- " float inlineb;\n" + +- "};\n" + +- "static inline int dummy_func_decl(int a, char b, float c) {\n" + # Second user pattern +- " return 42;\n" + +- "}\n" + +- "\n" +- +- expected = +- "int dummy_func_decl(int a, char b, float c);\n" + +- "int dummy_func_decl2(int a, char b, float c)\n\n\n\n\n\n;\n" + # Second declaration with a lot of newlines until the semicolon to mess with the parser +- "int staticinlinefunc(struct my_struct *s);\n" + +- "struct my_struct_with_inline_in_it\n" + +- "{\n" + +- " int a;\n" + +- " char b;\n" + +- " float inlineb;\n" + +- "};\n" + +- "int dummy_func_decl(int a, char b, float c);\n" + +- "\n" +- +- @parser.treat_inlines = :include +- assert_equal(expected, @parser.transform_inline_functions(source)) +- end +- +- it "Transform inline functions can handle header with only inline function declarations" do +- source = +- "static inline int dummy_func_decl(int a, char b, float c);\n" + +- "\n" +- +- expected = +- "int dummy_func_decl(int a, char b, float c);\n" + +- "\n" +- +- @parser.treat_inlines = :include +- assert_equal(expected, @parser.transform_inline_functions(source)) +- end +- +- it "Transform inline functions takes user provided patterns into account" do +- source = +- "static __inline__ __attribute__ ((always_inline)) uint16_t _somefunc (uint32_t a)\n" + +- "{\n" + +- " return _someotherfunc (a);\n" + +- "}\n" + +- "static __inline__ uint16_t _somefunc_0 (uint32_t a)\n" + +- "{\n" + +- " return (uint16_t) a;\n" + +- "}\n" + +- "\n" +- +- expected = +- "uint16_t _somefunc (uint32_t a);\n" + +- "uint16_t _somefunc_0 (uint32_t a);\n" + +- "\n" +- +- @parser.treat_inlines = :include +- @parser.inline_function_patterns = ['static __inline__ __attribute__ \(\(always_inline\)\)', 'static __inline__'] +- assert_equal(expected, @parser.transform_inline_functions(source)) +- end +- +- it "Transform inline functions limits deleting user macro to actual line/word" do +- source = +- "#if defined (FORCE_INLINE)\n" + +- "#define MY_LIBRARY_INLINE static __inline__ __attribute__ ((always_inline))\n" + +- "#else\n" + +- "#define MY_LIBRARY_INLINE\n" + +- "#endif\n" + +- "#define INLINE static __inline__ __attribute__ ((always_inline))\n" + +- "#define INLINE_TWO \\\nstatic\\\ninline\n" + +- "INLINE uint16_t _somefunc (uint32_t a)\n" + +- "{\n" + +- " return _someotherfunc (a);\n" + +- "}\n" + +- "static __inline__ uint16_t _somefunc_0 (uint32_t a)\n" + +- "{\n" + +- " return (uint16_t) a;\n" + +- "}\n" + +- "static __inline__ __attribute__ \(\(always_inline\)\) uint16_t _somefunc_1 (uint32_t a)\n" + +- "{\n" + +- " return (uint16_t) a;\n" + +- "}\n" + +- "INLINE_TWO uint16_t _somefunc_2(uint32_t a)\n" + +- "{\n" + +- " return (uint16_t) a;\n" + +- "}\n" + +- "#define INLINE_THREE \\\nstatic\\\ninline" +- +- expected = +- "#if defined (FORCE_INLINE)\n" + +- "#else\n" + +- "#endif\n" + +- "uint16_t _somefunc (uint32_t a);\n" + +- "uint16_t _somefunc_0 (uint32_t a);\n" + +- "uint16_t _somefunc_1 (uint32_t a);\n" + +- "uint16_t _somefunc_2(uint32_t a);\n" +- +- @parser.treat_inlines = :include +- @parser.inline_function_patterns = ['MY_LIBRARY_INLINE', 'INLINE_THREE', 'INLINE_TWO', 'INLINE', 'static __inline__ __attribute__ \(\(always_inline\)\)', 'static __inline__'] +- assert_equal(expected, @parser.transform_inline_functions(source)) +- end +- +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_plugin_manager_test.rb b/components/testframework/libs/cmock/test/unit/cmock_plugin_manager_test.rb +deleted file mode 100644 +index f9f0e640cf..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_plugin_manager_test.rb ++++ /dev/null +@@ -1,100 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_plugin_manager' +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect' +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_ignore' +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_cexception' +- +-describe CMockPluginManager, "Verify CMockPluginManager Module" do +- +- before do +- create_mocks :utils, :pluginA, :pluginB +- @config = create_stub( +- :respond_to => true, +- :when_ptr => :compare_data, +- :enforce_strict_ordering => false, +- :ignore => :args_and_calls +- ) +- +- def @config.plugins +- if instance_variable_defined?(:@plugins) +- @plugins || [] +- else +- [] +- end +- end +- +- def @config.plugins=(val) +- @plugins = val +- end +- end +- +- after do +- end +- +- it "return all plugins by default" do +- @config.plugins = ['cexception','ignore'] +- @utils.expect :helpers, {} +- +- @cmock_plugins = CMockPluginManager.new(@config, @utils) +- +- test_plugins = @cmock_plugins.plugins +- contained = { :expect => false, :ignore => false, :cexception => false } +- test_plugins.each do |plugin| +- contained[:expect] = true if plugin.instance_of?(CMockGeneratorPluginExpect) +- contained[:ignore] = true if plugin.instance_of?(CMockGeneratorPluginIgnore) +- contained[:cexception] = true if plugin.instance_of?(CMockGeneratorPluginCexception) +- end +- assert_equal(true, contained[:expect]) +- assert_equal(true, contained[:ignore]) +- assert_equal(true, contained[:cexception]) +- end +- +- it "return restricted plugins based on config" do +- @utils.expect :helpers, {} +- +- @cmock_plugins = CMockPluginManager.new(@config, @utils) +- +- test_plugins = @cmock_plugins.plugins +- contained = { :expect => false, :ignore => false, :cexception => false } +- test_plugins.each do |plugin| +- contained[:expect] = true if plugin.instance_of?(CMockGeneratorPluginExpect) +- contained[:ignore] = true if plugin.instance_of?(CMockGeneratorPluginIgnore) +- contained[:cexception] = true if plugin.instance_of?(CMockGeneratorPluginCexception) +- end +- assert_equal(true, contained[:expect]) +- assert_equal(false,contained[:ignore]) +- assert_equal(false,contained[:cexception]) +- end +- +- it "run a desired method over each plugin requested and return the results" do +- @utils.expect :helpers, {} +- @cmock_plugins = CMockPluginManager.new(@config, @utils) +- +- @pluginA = create_stub(:test_method => ["This Is An Awesome Test-"]) +- @pluginB = create_stub(:test_method => ["And This is Part 2-","Of An Awesome Test"]) +- @cmock_plugins.plugins = [@pluginA, @pluginB] +- +- expected = "This Is An Awesome Test-And This is Part 2-Of An Awesome Test" +- output = @cmock_plugins.run(:test_method) +- assert_equal(expected, output) +- end +- +- it "run a desired method and arg list over each plugin requested and return the results" do +- @utils.expect :helpers, {} +- @cmock_plugins = CMockPluginManager.new(@config, @utils) +- +- @pluginA = create_stub(:test_method => ["This Is An Awesome Test-"]) +- @pluginB = create_stub(:test_method => ["And This is Part 2-","Of An Awesome Test"]) +- @cmock_plugins.plugins = [@pluginA, @pluginB] +- +- expected = "This Is An Awesome Test-And This is Part 2-Of An Awesome Test" +- output = @cmock_plugins.run(:test_method, "chickenpotpie") +- assert_equal(expected, output) +- end +-end +diff --git a/components/testframework/libs/cmock/test/unit/cmock_unityhelper_parser_test.rb b/components/testframework/libs/cmock/test/unit/cmock_unityhelper_parser_test.rb +deleted file mode 100644 +index 987b0d6974..0000000000 +--- a/components/testframework/libs/cmock/test/unit/cmock_unityhelper_parser_test.rb ++++ /dev/null +@@ -1,223 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" +-require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_unityhelper_parser' +- +-describe CMockUnityHelperParser, "Verify CMockUnityHelperParser Module" do +- +- before do +- create_mocks :config +- end +- +- after do +- end +- +- it "ignore lines that are commented out" do +- source = +- " abcd;\n" + +- "// #define UNITY_TEST_ASSERT_EQUAL_CHICKENS(a,b,line,msg) {...};\n" + +- "or maybe // #define UNITY_TEST_ASSERT_EQUAL_CHICKENS(a,b,line,msg) {...};\n\n" +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, {} +- @config.expect :load_unity_helper, source +- @parser = CMockUnityHelperParser.new(@config) +- expected = {} +- +- assert_equal(expected, @parser.c_types) +- end +- +- it "ignore stuff in block comments" do +- source = +- " abcd; /*\n" + +- "#define UNITY_TEST_ASSERT_EQUAL_CHICKENS(a,b,line,msg) {...};\n" + +- "#define UNITY_TEST_ASSERT_EQUAL_CHICKENS(a,b,line,msg) {...};\n */\n" +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, {} +- @config.expect :load_unity_helper, source +- @parser = CMockUnityHelperParser.new(@config) +- expected = {} +- +- assert_equal(expected, @parser.c_types) +- end +- +- it "notice equal helpers in the proper form and ignore others" do +- source = +- "abcd;\n" + +- "#define UNITY_TEST_ASSERT_EQUAL_TURKEYS_T(a,b,line,msg) {...};\n" + +- "abcd;\n" + +- "#define UNITY_TEST_ASSERT_EQUAL_WRONG_NUM_ARGS(a,b,c,d,e) {...};\n" + +- "#define UNITY_TEST_ASSERT_WRONG_NAME_EQUAL(a,b,c,d) {...};\n" + +- "#define UNITY_TEST_ASSERT_EQUAL_unsigned_funky_rabbits(a,b,c,d) {...};\n" + +- "abcd;\n" +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, {} +- @config.expect :load_unity_helper, source +- @parser = CMockUnityHelperParser.new(@config) +- expected = { +- 'TURKEYS_T' => "UNITY_TEST_ASSERT_EQUAL_TURKEYS_T", +- 'unsigned_funky_rabbits' => "UNITY_TEST_ASSERT_EQUAL_unsigned_funky_rabbits" +- } +- +- assert_equal(expected, @parser.c_types) +- end +- +- it "notice equal helpers that contain arrays" do +- source = +- "abcd;\n" + +- "#define UNITY_TEST_ASSERT_EQUAL_TURKEYS_ARRAY(a,b,c,d,e) {...};\n" + +- "abcd;\n" + +- "#define UNITY_TEST_ASSERT_EQUAL_WRONG_NUM_ARGS_ARRAY(a,b,c,d,e,f) {...};\n" + +- "#define UNITY_TEST_ASSERT_WRONG_NAME_EQUAL_ARRAY(a,b,c,d,e) {...};\n" + +- "#define UNITY_TEST_ASSERT_EQUAL_unsigned_funky_rabbits_ARRAY(a,b,c,d,e) {...};\n" + +- "abcd;\n" +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, {} +- @config.expect :load_unity_helper, source +- @parser = CMockUnityHelperParser.new(@config) +- expected = { +- 'TURKEYS*' => "UNITY_TEST_ASSERT_EQUAL_TURKEYS_ARRAY", +- 'unsigned_funky_rabbits*' => "UNITY_TEST_ASSERT_EQUAL_unsigned_funky_rabbits_ARRAY" +- } +- +- assert_equal(expected, @parser.c_types) +- end +- +- it "pull in the standard set of helpers and add them to my list" do +- pairs = { +- "UINT" => "HEX32", +- "unsigned long" => "HEX64", +- } +- expected = { +- "UINT" => "UNITY_TEST_ASSERT_EQUAL_HEX32", +- "unsigned_long" => "UNITY_TEST_ASSERT_EQUAL_HEX64", +- "UINT*" => "UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY", +- "unsigned_long*"=> "UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY", +- } +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, pairs +- @config.expect :load_unity_helper, nil +- @parser = CMockUnityHelperParser.new(@config) +- +- assert_equal(expected, @parser.c_types) +- end +- +- it "pull in the user specified set of helpers and add them to my list" do +- pairs = { +- "char*" => "STRING", +- "unsigned int" => "HEX32", +- } +- expected = { +- "char*" => "UNITY_TEST_ASSERT_EQUAL_STRING", +- "unsigned_int" => "UNITY_TEST_ASSERT_EQUAL_HEX32", +- "char**" => "UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY", +- "unsigned_int*" => "UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY", +- } +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, pairs +- @config.expect :load_unity_helper, nil +- @parser = CMockUnityHelperParser.new(@config) +- +- assert_equal(expected, @parser.c_types) +- end +- +- it "be able to fetch helpers on my list" do +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, {} +- @config.expect :load_unity_helper, "" +- @parser = CMockUnityHelperParser.new(@config) +- @parser.c_types = { +- 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", +- 'UINT16*' => "UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY", +- 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", +- 'LONG_LONG' => "UNITY_TEST_ASSERT_EQUAL_LONG_LONG" +- } +- +- [["UINT8","UINT8"], +- ["UINT16*","UINT16_ARRAY"], +- ["const SPINACH","SPINACH"], +- ["LONG LONG","LONG_LONG"] ].each do |ctype, exptype| +- assert_equal(["UNITY_TEST_ASSERT_EQUAL_#{exptype}",''], @parser.get_helper(ctype)) +- end +- end +- +- it "return memory comparison when asked to fetch helper of types not on my list" do +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, {} +- @config.expect :load_unity_helper, "" +- @parser = CMockUnityHelperParser.new(@config) +- @parser.c_types = { +- 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", +- 'UINT16*' => "UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY", +- 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", +- } +- +- ["UINT32","SPINACH_T","SALAD","PINEAPPLE"].each do |ctype| +- @config.expect :memcmp_if_unknown, true +- assert_equal(["UNITY_TEST_ASSERT_EQUAL_MEMORY",'&'], @parser.get_helper(ctype)) +- end +- end +- +- it "return memory array comparison when asked to fetch helper of types not on my list" do +- @config.expect :plugins, [:array] +- @config.expect :treat_as, {} +- @config.expect :load_unity_helper, "" +- @parser = CMockUnityHelperParser.new(@config) +- @parser.c_types = { +- 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", +- 'UINT16*' => "UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY", +- 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", +- } +- +- ["UINT32*","SPINACH_T*"].each do |ctype| +- @config.expect :memcmp_if_unknown, true +- assert_equal(["UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY",''], @parser.get_helper(ctype)) +- end +- end +- +- it "return the array handler if we cannot find the normal handler" do +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, {} +- @config.expect :load_unity_helper, "" +- @parser = CMockUnityHelperParser.new(@config) +- @parser.c_types = { +- 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", +- 'UINT16*' => "UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY", +- 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", +- } +- +- assert_equal(["UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY",'&'], @parser.get_helper("UINT16")) +- end +- +- it "return the normal handler if we cannot find the array handler" do +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, {} +- @config.expect :load_unity_helper, "" +- @parser = CMockUnityHelperParser.new(@config) +- @parser.c_types = { +- 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", +- 'UINT16' => "UNITY_TEST_ASSERT_EQUAL_UINT16", +- 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", +- } +- +- assert_equal(["UNITY_TEST_ASSERT_EQUAL_UINT8",'*'], @parser.get_helper("UINT8*")) +- end +- +- it "raise error when asked to fetch helper of type not on my list and not allowed to mem check" do +- @config.expect :plugins, [] #not :array +- @config.expect :treat_as, {} +- @config.expect :load_unity_helper, "" +- @config.expect :memcmp_if_unknown, false +- @parser = CMockUnityHelperParser.new(@config) +- @parser.c_types = { +- 'UINT8' => "UNITY_TEST_ASSERT_EQUAL_UINT8", +- 'UINT32*' => "UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY", +- 'SPINACH' => "UNITY_TEST_ASSERT_EQUAL_SPINACH", +- } +- +- assert_raises (RuntimeError) { @parser.get_helper("UINT16") } +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/behaviors/Manifest.txt b/components/testframework/libs/cmock/vendor/behaviors/Manifest.txt +deleted file mode 100644 +index 6c954ecced..0000000000 +--- a/components/testframework/libs/cmock/vendor/behaviors/Manifest.txt ++++ /dev/null +@@ -1,9 +0,0 @@ +-Manifest.txt +-Rakefile +-lib/behaviors.rb +-lib/behaviors/reporttask.rb +-test/behaviors_tasks_test.rb +-test/behaviors_test.rb +-test/tasks_test/lib/user.rb +-test/tasks_test/Rakefile +-test/tasks_test/test/user_test.rb +diff --git a/components/testframework/libs/cmock/vendor/behaviors/Rakefile b/components/testframework/libs/cmock/vendor/behaviors/Rakefile +deleted file mode 100644 +index d4d68b9956..0000000000 +--- a/components/testframework/libs/cmock/vendor/behaviors/Rakefile ++++ /dev/null +@@ -1,19 +0,0 @@ +-require 'rake' +-require 'rubygems' +-require 'hoe' +- +-Hoe.new('behaviors','1.0.3') do |p| +- p.author = "Atomic Object LLC" +- p.email = "dev@atomicobject.com" +- p.url = "http://behaviors.rubyforge.org" +- p.summary = "behavior-driven unit test helper" +- p.description = <<-EOS +-Behaviors allows for Test::Unit test case methods to be defined as +-human-readable descriptions of program behavior. It also provides +-Rake tasks to list the behaviors of your project. +- EOS +- p.test_globs = ['test/*_test.rb'] +- +- p.changes = <<-EOS +- EOS +-end +diff --git a/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors.rb b/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors.rb +deleted file mode 100644 +index d8d70f704c..0000000000 +--- a/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors.rb ++++ /dev/null +@@ -1,76 +0,0 @@ +-=begin rdoc +-= Usage +-Behaviors provides a single method: should. +- +-Instead of naming test methods like: +- +- def test_something +- end +- +-You declare test methods like: +- +- should "perform action" do +- end +- +-You may omit the body of a should method to describe unimplemented behavior. +- +- should "perform other action" +- +-When you run your unit tests, empty should methods will appear as an 'UNIMPLEMENTED CASE' along with the described behavior. +-This is useful for sketching out planned behavior quickly. +- +-Simply extend Behaviors in your TestCase to start using behaviors. +- +- require 'test/unit' +- require 'behaviors' +- require 'user' +- +- class UserTest < Test::Unit::TestCase +- extend Behaviors +- ... +- end +- +-= Motivation +-Test methods typically focus on the name of the method under test instead of its behavior. +-Creating test methods with should statements focuses on the behavior of an object. +-This helps you to think about the role of the object under test. +- +-Using a behavior-driven approach prevents the danger in assuming a one-to-one mapping of method names to +-test method names. +-As always, you get the most value by writing the tests first. +- +-For a more complete BDD framework, try RSpec http://rspec.rubyforge.org/ +- +-= Rake tasks +- +-You can define a Behaviors::ReportTask in your Rakefile to generate rake tasks that +-summarize the behavior of your project. +- +-These tasks are named behaviors and behaviors_html. They will output to the +-console or an html file in the doc directory with a list all of your should tests. +- Behaviors::ReportTask.new do |t| +- t.pattern = 'test/**/*_test.rb' +- end +- +-You may also initialize the ReportTask with a custom name to associate with a particular suite of tests. +- Behaviors::ReportTask.new(:widget_subsystem) do |t| +- t.pattern = 'test/widgets/*_test.rb' +- end +- +-The html report will be placed in the doc directory by default. +-You can override this default by setting the html_dir in the ReportTask. +- Behaviors::ReportTask.new do |t| +- t.pattern = 'test/**/*_test.rb' +- t.html_dir = 'behaviors_html_reports' +- end +-=end +-module Behaviors +- def should(behave,&block) +- mname = "test_should_#{behave}" +- if block +- define_method mname, &block +- else +- puts ">>> UNIMPLEMENTED CASE: #{name.sub(/Test$/,'')} should #{behave}" +- end +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors/reporttask.rb b/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors/reporttask.rb +deleted file mode 100644 +index 51c0eca098..0000000000 +--- a/components/testframework/libs/cmock/vendor/behaviors/lib/behaviors/reporttask.rb ++++ /dev/null +@@ -1,158 +0,0 @@ +-require 'rake' +-require 'rake/tasklib' +- +-module Behaviors +-include Rake +- +- class ReportTask < TaskLib +- attr_accessor :pattern +- attr_accessor :html_dir +- +- def initialize(name=:behaviors) +- @name = name +- @html_dir = 'doc' +- yield self if block_given? +- define +- end +- +- def define +- desc "List behavioral definitions for the classes specified (use for= to further limit files included in report)" +- task @name do +- specifications.each do |spec| +- puts "#{spec.name} should:\n" +- spec.requirements.each do |req| +- puts " - #{req}" +- end +- end +- end +- +- desc "Generate html report of behavioral definitions for the classes specified (use for= to further limit files included in report)" +- task "#{@name}_html" do +- require 'erb' +- txt =<<-EOS +- +- +- +- +- +-
Specifications
+-<% specifications.each do |spec| %> +-
+-<%= spec.name %> should: +-
    +-<% spec.requirements.each do |req| %> +-
  • <%= req %>
  • +-<% end %> +-
+-
+-<% end %> +- +- +- EOS +- output_dir = File.expand_path(@html_dir) +- mkdir_p output_dir +- output_filename = output_dir + "/behaviors.html" +- File.open(output_filename,"w") do |f| +- f.write ERB.new(txt).result(binding) +- end +- puts "(Wrote #{output_filename})" +- end +- end +- +- private +- def test_files +- test_list = FileList[@pattern] +- if ENV['for'] +- test_list = test_list.grep(/#{ENV['for']}/i) +- end +- test_list +- end +- +- def specifications +- test_files.map do |file| +- spec = OpenStruct.new +- m = %r".*/([^/].*)_test.rb".match(file) +- class_name = titleize(m[1]) if m[1] +- spec.name = class_name +- spec.requirements = [] +- File::readlines(file).each do |line| +- if line =~ /^\s*should\s+\(?\s*["'](.*)["']/ +- spec.requirements << $1 +- end +- end +- spec +- end +- end +- +- ############################################################ +- # STOLEN FROM inflector.rb +- ############################################################ +- #-- +- # Copyright (c) 2005 David Heinemeier Hansson +- # +- # 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. +- #++ +- def titleize(word) +- humanize(underscore(word)).gsub(/\b([a-z])/) { $1.capitalize } +- end +- +- def underscore(camel_cased_word) camel_cased_word.to_s.gsub(/::/, '/'). +- gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').tr("-", "_").downcase +- end +- +- def humanize(lower_case_and_underscored_word) +- lower_case_and_underscored_word.to_s.gsub(/_id$/, "").gsub(/_/, " ").capitalize +- end +- +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_tasks_test.rb b/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_tasks_test.rb +deleted file mode 100644 +index 9382e0737c..0000000000 +--- a/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_tasks_test.rb ++++ /dev/null +@@ -1,73 +0,0 @@ +-require 'test/unit' +-require 'fileutils' +- +-class BehaviorsTasksTest < Test::Unit::TestCase +- include FileUtils +- +- def setup +- @here = File.expand_path(File.dirname(__FILE__)) +- @base_cmd = RUBY_PLATFORM[/mswin/] ? 'rake.cmd ' : 'rake ' +- end +- +- # +- # HELPERS +- # +- def run_behaviors_task +- run_cmd "behaviors" +- end +- +- def run_behaviors_html_task +- run_cmd "behaviors_html" +- end +- +- def run_cmd(cmd) +- cd "#{@here}/tasks_test" do +- @report = %x[ #{@base_cmd} #{cmd} ] +- end +- end +- +- def see_html_task_output_message +- @html_output_filename = "#{@here}/tasks_test/behaviors_doc/behaviors.html" +- assert_match(/Wrote #{@html_output_filename}/, @report) +- end +- +- def see_that_html_report_file_exits +- assert File.exists?(@html_output_filename), "html output file should exist" +- end +- +- def html_report_file_should_contain(user_behaviors) +- file_contents = File.read(@html_output_filename) +- user_behaviors.each do |line| +- assert_match(/#{line}/, file_contents) +- end +- rm_rf File.dirname(@html_output_filename) +- end +- +- # +- # TESTS +- # +- def test_that_behaviors_tasks_should_list_behavioral_definitions_for_the_classes_under_test +- run_behaviors_task +- user_behaviors = [ +- "User should:", +- " - be able set user name and age during construction", +- " - be able to get user name and age", +- " - be able to ask if a user is an adult" +- ] +- assert_match(/#{user_behaviors.join("\n")}/, @report) +- end +- +- def test_that_behaviors_tasks_should_list_behavioral_definitions_for_the_classes_under_test_in_html_output +- run_behaviors_html_task +- see_html_task_output_message +- see_that_html_report_file_exits +- user_behaviors = [ +- "User should:", +- "be able set user name and age during construction", +- "be able to get user name and age", +- "be able to ask if a user is an adult" +- ] +- html_report_file_should_contain user_behaviors +- end +- +-end +diff --git a/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_test.rb b/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_test.rb +deleted file mode 100644 +index fd0a77fcb7..0000000000 +--- a/components/testframework/libs/cmock/vendor/behaviors/test/behaviors_test.rb ++++ /dev/null +@@ -1,50 +0,0 @@ +-require 'test/unit' +-require File.expand_path(File.dirname(__FILE__)) + '/../lib/behaviors' +-require 'stringio' +- +-loading_developer_test_class_stdout = StringIO.new +-saved_stdout = $stdout.dup +-$stdout = loading_developer_test_class_stdout +- +-class DeveloperTest +- extend Behaviors +- attr_accessor :flunk_msg, :tested_code +- +- should "test their code" do +- @tested_code = true +- end +- should "go to meetings" +-end +- +-$stdout = saved_stdout +-loading_developer_test_class_stdout.rewind +-$loading_developer_test_class_output = loading_developer_test_class_stdout.read +- +-class BehaviorsTest < Test::Unit::TestCase +- +- +- def setup +- @target = DeveloperTest.new +- assert_nil @target.tested_code, "block called too early" +- end +- +- # +- # TESTS +- # +- def test_should_called_with_a_block_defines_a_test +- assert @target.methods.include?("test_should_test their code"), "Missing test method" +- +- @target.send("test_should_test their code") +- +- assert @target.tested_code, "block not called" +- end +- +- def test_should_called_without_a_block_does_not_create_a_test_method +- assert !@target.methods.include?("test_should_go to meetings"), "Should not have method" +- end +- +- def test_should_called_without_a_block_will_give_unimplemented_output_when_class_loads +- unimplemented_output = "UNIMPLEMENTED CASE: Developer should go to meetings" +- assert_match(/#{unimplemented_output}/, $loading_developer_test_class_output) +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/Rakefile b/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/Rakefile +deleted file mode 100644 +index ba71f715f9..0000000000 +--- a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/Rakefile ++++ /dev/null +@@ -1,19 +0,0 @@ +-require 'rake' +-require 'rake/testtask' +- +-here = File.expand_path(File.dirname(__FILE__)) +-require "#{here}/../../lib/behaviors/reporttask" +- +-desc 'Default: run unit tests.' +-task :default => :test +- +-Rake::TestTask.new(:test) do |t| +- t.libs << "#{here}/../../lib" +- t.pattern = 'test/**/*_test.rb' +- t.verbose = true +-end +- +-Behaviors::ReportTask.new(:behaviors) do |t| +- t.pattern = 'test/**/*_test.rb' +- t.html_dir = 'behaviors_doc' +-end +diff --git a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/lib/user.rb b/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/lib/user.rb +deleted file mode 100644 +index 40bc07ce46..0000000000 +--- a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/lib/user.rb ++++ /dev/null +@@ -1,2 +0,0 @@ +-class User +-end +diff --git a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/test/user_test.rb b/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/test/user_test.rb +deleted file mode 100644 +index ad3cd1b33e..0000000000 +--- a/components/testframework/libs/cmock/vendor/behaviors/test/tasks_test/test/user_test.rb ++++ /dev/null +@@ -1,17 +0,0 @@ +-require 'test/unit' +-require 'behaviors' +- +-require 'user' +- +-class UserTest < Test::Unit::TestCase +- extend Behaviors +- +- def setup +- end +- +- should "be able set user name and age during construction" +- should "be able to get user name and age" +- should "be able to ask if a user is an adult" +- def test_DELETEME +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/c_exception/.travis.yml b/components/testframework/libs/cmock/vendor/c_exception/.travis.yml +deleted file mode 100644 +index ac313a6247..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/.travis.yml ++++ /dev/null +@@ -1,16 +0,0 @@ +-sudo: required +-language: ruby c +- +-os: +- - linux +- +-rvm: +- - "2.3" +- - "2.4" +- - "2.6" +- +-install: +- - gem install ceedling +- +-script: +- - ceedling clobber test:all +diff --git a/components/testframework/libs/cmock/vendor/c_exception/Gemfile b/components/testframework/libs/cmock/vendor/c_exception/Gemfile +deleted file mode 100644 +index 0ab41bb5e0..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/Gemfile ++++ /dev/null +@@ -1,4 +0,0 @@ +-source "http://rubygems.org/" +- +-gem "rake" +-gem "test-unit", "~> 2.4" +diff --git a/components/testframework/libs/cmock/vendor/c_exception/Gemfile.lock b/components/testframework/libs/cmock/vendor/c_exception/Gemfile.lock +deleted file mode 100644 +index 8622142603..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/Gemfile.lock ++++ /dev/null +@@ -1,12 +0,0 @@ +-GEM +- remote: http://rubygems.org/ +- specs: +- rake (12.3.3) +- test-unit (2.5.5) +- +-PLATFORMS +- ruby +- +-DEPENDENCIES +- rake +- test-unit (~> 2.4) +diff --git a/components/testframework/libs/cmock/vendor/c_exception/README.md b/components/testframework/libs/cmock/vendor/c_exception/README.md +deleted file mode 100644 +index 53e52ea63f..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/README.md ++++ /dev/null +@@ -1,249 +0,0 @@ +-CException - Lightweight exception library for C +-================================================ +- +-[![CException Build Status](https://api.travis-ci.org/ThrowTheSwitch/CException.png?branch=master)](https://travis-ci.org/ThrowTheSwitch/CException) +- +-_This Documentation Is Released Under a Creative Commons 3.0 Attribution Share-Alike License_ +- +-CException is simple exception handling in C. It is significantly faster than full-blown C++ exception handling +-but loses some flexibility. It is portable to any platform supporting `setjmp`/`longjmp`. +- +-Getting Started +-================ +- +-The simplest way to get started is to just grab the code and pull it into your project: +- +-``` +-git clone https://github.com/throwtheswitch/cexception.git +-``` +- +-If you want to contribute to this project, you'll also need to have Ruby and Ceedling installed to run the unit tests. +- +-Usage +-===== +- +-### So what's it good for? +- +-Mostly error handling. Passing errors down a long chain of function calls gets ugly. Sometimes really ugly. +-So what if you could just specify certain places where you want to handle errors, and all your errors were +-transferred there? Let's try a lame example: +- +-CException uses C standard library functions setjmp and longjmp to operate. As long as the target system +-has these two functions defined, this library should be useable with very little configuration. It even +-supports environments where multiple program flows are in use, such as real-time operating systems... +-we started this project for use in embedded systems... but it obviously can be used for larger systems too. +- +-### Error Handling with CException: +- +-``` +-void functionC(void) { +- //do some stuff +- if (there_was_a_problem) +- Throw(ERR_BAD_BREATH); +- //this stuff never gets called because of error +-} +-``` +- +-There are about a gajillion exception frameworks using a similar setjmp/longjmp method out there... and there +-will probably be more in the future. Unfortunately, when we started our last embedded project, all those that +-existed either (a) did not support multiple tasks (therefore multiple stacks) or (b) were way more complex +-than we really wanted. CException was born. +- +-Why? +-==== +- +-### It's ANSI C +- +-...and it beats passing error codes around. +- +-### You want something simple... +- +-CException throws a single id. You can define those ID's to be whatever you like. +-You might even choose which type that number is for your project. But that's as far as it goes. We weren't interested +-in passing objects or structs or strings... just simple error codes. Fast. Easy to Use. Easy to Understand. +- +-### Performance... +- +-CException can be configured for single tasking or multitasking. In single tasking, there is +-very little overhead past the setjmp/longjmp calls (which are already fast). In multitasking, your only additional +-overhead is the time it takes you to determine a unique task id (0 to num_tasks). +- +-How? +-==== +- +-Code that is to be protected are wrapped in `Try { }` blocks. The code inside the Try block is _protected_, +-meaning that if any Throws occur, program control is directly transferred to the start of the Catch block. +-The Catch block immediately follows the Try block. It's ignored if no errors have occurred. +- +-A numerical exception ID is included with Throw, and is passed into the Catch block. This allows you to handle +-errors differently or to report which error has occurred... or maybe it just makes debugging easier so you +-know where the problem was Thrown. +- +-Throws can occur from anywhere inside the Try block, directly in the function you're testing or even within +-function calls (nested as deeply as you like). There can be as many Throws as you like, just remember that +-execution of the guts of your Try block ends as soon as the first Throw is triggered. Once you throw, you're +-transferred to the Catch block. A silly example: +- +-``` +-void SillyExampleWhichPrintsZeroThroughFive(void) { +- CEXCEPTION_T e; +- int i; +- while (i = 0; i < 6; i++) { +- Try { +- Throw(i); +- //This spot is never reached +- } +- Catch(e) { +- printf(“%i “, e); +- } +- } +-} +-``` +- +-Limitations +-=========== +- +-This library was made to be as fast as possible, and provide basic exception handling. It is not a full-blown +-exception library like C++. Because of this, there are a few limitations that should be observed in order to +-successfully utilize this library: +- +-### Return & Goto +- +-Do not directly `return` from within a `Try` block, nor `goto` into or out of a `Try` block. +-The `Try` macro allocates some local memory and alters a global pointer. These are cleaned up at the +-top of the `Catch` macro. Gotos and returns would bypass some of these steps, resulting in memory leaks +-or unpredictable behavior. +- +-### Local Variables +- +-If (a) you change local (stack) variables within your `Try` block, and (b) wish to make use of the updated +-values after an exception is thrown, those variables should be made `volatile`. +- +-Note that this is ONLY for locals and ONLY when you need access to them after a `Throw`. +- +-Compilers optimize (and thank goodness they do). There is no way to guarantee that the actual memory +-location was updated and not just a register unless the variable is marked volatile. +- +-### Memory Management +- +-Memory which is `malloc`'d within a `Try` block is not automatically released when an error is thrown. This +-will sometimes be desirable, and othertimes may not. It will be the responsibility of the code you put in +-the `Catch` block to perform this kind of cleanup. +- +-There's just no easy way to track `malloc`'d memory, etc., without replacing or wrapping `malloc` +-calls or something like that. This is a lightweight framework, so these options were not desirable. +- +-CException API +-============== +- +-### `Try { ... }` +- +-`Try` is a macro which starts a protected block. It MUST be followed by a pair of braces or a single +-protected line (similar to an 'if'), enclosing the data that is to be protected. It MUST be followed by +-a `Catch` block (don't worry, you'll get compiler errors to let you know if you mess any of that up). +- +-The `Try` block is your protected block. It contains your main program flow, where you can ignore errors +-(other than a quick `Throw` call). You may nest multiple `Try` blocks if you want to handle errors at +-multiple levels, and you can even rethrow an error from within a nested `Catch`. +- +-### `Catch(e) { }` +- +-`Catch` is a macro which ends the `Try` block and starts the error handling block. The `Catch` block +-is executed if and only if an exception was thrown while within the `Try` block. This error was thrown +-by a `Throw` call somewhere within `Try` (or within a function called within `Try`, or a function called +-by a function called within `Try`... you get the idea.). +- +-`Catch` receives a single id of type `CEXCEPTION_T` which you can ignore or use to handle the error in +-some way. You may throw errors from within Catches, but they will be caught by a `Try` wrapping the `Catch`, +-not the one immediately preceeding. +- +-### `Throw(e)` +- +-`Throw` is the method used to throw an error. `Throw`s should only occur from within a protected +-(`Try`...`Catch`) block, though it may easily be nested many function calls deep without an impact +-on performance or functionality. `Throw` takes a single argument, which is an exception id which will be +- passed to `Catch` as the reason for the error. If you wish to _re-throw_ an error, this can be done by +-calling `Throw(e)` with the error code you just caught. It _IS_ valid to throw from a `Catch` block. +- +-### `ExitTry()` +- +-`ExitTry` is a method used to immediately exit your current Try block but NOT treat this as an error. Don't +-run the Catch. Just start executing from after the Catch as if nothing had happened. +- +-Configuration +-============= +- +-CException is a mostly portable library. It has one universal dependency, plus some macros which are required if +-working in a multi-tasking environment. +- +-The standard C library setjmp must be available. Since this is part of the standard library, it's all good. +- +-If working in a multitasking environment, you need a stack frame for each task. Therefore, you must define +-methods for obtaining an index into an array of frames and to get the overall number of id's are required. If +-the OS supports a method to retrieve task ID's, and those tasks are number 0, 1, 2... you are in an ideal +-situation. Otherwise, a more creative mapping function may be required. Note that this function is likely to +-be called twice for each protected block and once during a throw. This is the only added overhead in the system. +- +-You have options for configuring the library, if the defaults aren't good enough for you. You can add defines +-at the command prompt directly. You can always include a configuration file before including `CException.h`. +-You can make sure `CEXCEPTION_USE_CONFIG_FILE` is defined, which will force make CException look for +-`CExceptionConfig.h`, where you can define whatever you like. However you do it, you can override any or +-all of the following: +- +-### `CEXCEPTION_T` +- +-Set this to the type you want your exception id's to be. Defaults to an 'unsigned int'. +- +-### `CEXCEPTION_NONE` +- +-Set this to a number which will never be an exception id in your system. Defaults to `0x5a5a5a5a`. +- +-### `CEXCEPTION_GET_ID` +- +-If in a multi-tasking environment, this should be set to be a call to the function described in #2 above. +-It defaults to just return 0 all the time (good for single tasking environments, not so good otherwise). +- +-### `CEXCEPTION_NUM_ID` +- +-If in a multi-tasking environment, this should be set to the number of ID's required (usually the number +-of tasks in the system). Defaults to 1 (good for single tasking environments or systems where you will only +-use this from one task). +- +-### `CEXCEPTION_NO_CATCH_HANDLER (id)` +- +-This macro can be optionally specified. It allows you to specify code to be called when a Throw is made +-outside of Try...Catch protection. Consider this the emergency fallback plan for when something has gone +-terribly wrong. +- +-### And More! +- +-You may also want to include any header files which will commonly be needed by the rest of your application +-where it uses exception handling here. For example, OS header files or exception codes would be useful. +- +-Finally, there are some hook macros which you can implement to inject your own target-specific code in +-particular places. It is a rare instance where you will need these, but they are here if you need them: +- +-* `CEXCEPTION_HOOK_START_TRY` - called immediately before the Try block +-* `CEXCEPTION_HOOK_HAPPY_TRY` - called immediately after the Try block if no exception was thrown +-* `CEXCEPTION_HOOK_AFTER_TRY` - called immediately after the Try block OR before an exception is caught +-* `CEXCEPTION_HOOK_START_CATCH` - called immediately before the catch +- +-Testing +-======= +- +-If you want to validate that CException works with your tools or that it works with your custom +-configuration, you may want to run the included test suite. This is the test suite (along with real +-projects we've used it on) that we use to make sure that things actually work the way we claim. +-The test suite makes use of Ceedling, which uses the Unity Test Framework. It will require a native C compiler. +-The example makefile and rakefile both use gcc. +- +-License +-======= +- +-*This software is licensed under the MIT License: +-Copyright (c) 2007-2019 Mark VanderVoord* +- +-*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._* +diff --git a/components/testframework/libs/cmock/vendor/c_exception/docs/CException.md b/components/testframework/libs/cmock/vendor/c_exception/docs/CException.md +deleted file mode 100644 +index bfda613d64..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/docs/CException.md ++++ /dev/null +@@ -1,332 +0,0 @@ +- +-CException +-========== +- +-CException is a basic exception framework for C, suitable for use in +-embedded applications. It provides an exception framework similar in +-use to C++, but with much less overhead. +- +- +-CException uses C standard library functions `setjmp` and `longjmp` to +-operate. As long as the target system has these two functions defined, +-this library should be useable with very little configuration. It +-even supports environments where multiple program flows are in use, +-such as real-time operating systems. +- +- +-There are about a gabillion exception frameworks using a similar +-setjmp/longjmp method out there... and there will probably be more +-in the future. Unfortunately, when we started our last embedded +-project, all those that existed either (a) did not support multiple +-tasks (therefore multiple stacks) or (b) were way more complex than +-we really wanted. CException was born. +- +- +-*Why use CException?* +- +- +-0. It's ANSI C, and it beats passing error codes around. +-1. You want something simple... CException throws a single id. You can +- define those ID's to be whatever you like. You might even choose which +- type that number is for your project. But that's as far as it goes. +- We weren't interested in passing objects or structs or strings... +- just simple error codes. +-2. Performance... CException can be configured for single tasking or +- multitasking. In single tasking, there is very little overhead past +- the setjmp/longjmp calls (which are already fast). In multitasking, +- your only additional overhead is the time it takes you to determine +- a unique task id 0 - num_tasks. +- +- +-For the latest version, go to [ThrowTheSwitch.org](http://throwtheswitch.org) +- +- +-CONTENTS OF THIS DOCUMENT +-========================= +- +-* Usage +-* Limitations +-* API +-* Configuration +-* Testing +-* License +- +- +-Usage +------ +- +-Code that is to be protected are wrapped in `Try { } Catch { }` blocks. +-The code directly following the Try call is "protected", meaning that +-if any Throws occur, program control is directly transferred to the +-start of the Catch block. +- +- +-A numerical exception ID is included with Throw, and is made accessible +-from the Catch block. +- +- +-Throws can occur from within function calls (nested as deeply as you +-like) or directly from within the function itself. +- +- +- +-Limitations +------------ +- +- +-This library was made to be as fast as possible, and provide basic +-exception handling. It is not a full-blown exception library. Because +-of this, there are a few limitations that should be observed in order +-to successfully utilize this library: +- +-1. Do not directly "return" from within a `Try` block, nor `goto` +- into or out of a `Try` block. +- +- *Why?* +- +- The `Try` macro allocates some local memory and alters a global +- pointer. These are cleaned up at the top of the `Catch` macro. +- Gotos and returns would bypass some of these steps, resulting in +- memory leaks or unpredictable behavior. +- +- +-2. If (a) you change local (stack) variables within your `Try` block, +- AND (b) wish to make use of the updated values after an exception +- is thrown, those variables should be made `volatile`. Note that this +- is ONLY for locals and ONLY when you need access to them after a +- `Throw`. +- +- *Why?* +- +- Compilers optimize. There is no way to guarantee that the actual +- memory location was updated and not just a register unless the +- variable is marked volatile. +- +- As an example, if we had the following code, the value `b` is +- very likely at risk. It is assigned to the value `3` inside the +- `Try` block, but the compiler may or may not have written that +- variable to an actual memory location when the Throw happens. If +- it did, the `printf` will have a `3` for the second value. If not, +- it will still have a `0`. Changing `b` to `volatile` would +- guarantee it is the correct value. +- +- ``` +- void func(int *a) +- { +- // ... +- int b = 0; +- Try { +- *a += 2; +- b = *a; +- Throw(MY_EX); +- } Catch(e) { +- // ... +- } +- printf("%d ?= %d", a, b); +- } +- void main() +- { +- int x = 1; +- func(&x); +- printf("%d", x); +- } +- ``` +- +- With most compilers, the `*a` and `x` values are NOT at risk. +- We're dereferencing the pointer, which usually will force +- memory interaction. Optimizing compilers DO optimize, though, +- and it IS possible that even these values may have been cached +- and not written to the final memory location. In those instances, +- they would both report `1`. +- +- If you have a lot of situations like this and a strong optimizing +- compiler, it is best to reduce the optimization level when using +- CException. +- +-3. Memory which is `malloc`'d or `new`'d is not automatically released +- when an error is thrown. This will sometimes be desirable, and +- othertimes may not. It will be the responsibility of the `Catch` +- block to perform this kind of cleanup. +- +- *Why?* +- +- There's just no easy way to track `malloc`'d memory, etc., without +- replacing or wrapping malloc calls or something like that. This +- is a light framework, so these options were not desirable. +- +- +- +-API +---- +- +-###Try +- +-`Try` is a macro which starts a protected block. It MUST be followed by +-a pair of braces or a single protected line (similar to an 'if'), +-enclosing the data that is to be protected. It **must** be followed by a +-`Catch` block (don't worry, you'll get compiler errors to let you know if +-you mess any of that up). +- +- +-###Catch(e) +- +-`Catch` is a macro which ends the `Try` block and starts the error handling +-block. The `Catch` block is called if and only if an exception was thrown +-while within the `Try` block. This error was thrown by a `Throw` call +-somewhere within `Try` (or within a function called within `Try`, or a function +-called by a function called within `Try`, etc). +- +-The single parameter `e` is filled with the error code which was thrown. +-This can be used for reporting, conditional cleanup, etc. (or you can just +-ignore it if you really want... people ignore return codes all the time, +-right?). `e` should be of type `EXCEPTION_T` +- +- +-###Throw(e) +- +-This is the method of throwing an error. A `Throw` should only occur from within a +-protected (`Try` ... `Catch`) block, though it may easily be nested many function +-calls deep without an impact on performance or functionality. `Throw` takes +-a single argument, which is an exception id which will be passed to `Catch` +-as the reason for the error. +- +-If you wish to rethrow an error, this can be done by calling `Throw(e)` with +-the error code you just caught. It **is** valid to throw from a catch block. +- +- +-###ExitTry() +- +-On rare occasion, you might want to immediately exit your current `Try` block +-but **not** treat this as an error. Don't run the `Catch`. Just start executing +-from after the `Catch` as if nothing had happened... That's what `ExitTry` is +-for. +- +- +-CONFIGURATION +-------------- +- +-CException is a mostly portable library. It has one universal +-dependency, and some macros which are required if working in a +-multi-tasking environment. +- +-1. The standard C library setjmp must be available. Since this is part +- of the standard library, chances are good that you'll be fine. +- +-2. If working in a multitasking environment, methods for obtaining an +- index into an array of frames and to get the overall number of +- id's are required. If the OS supports a method to retrieve Task +- ID's, and those Tasks are number 0, 1, 2... you are in an ideal +- situation. Otherwise, a more creative mapping function may be +- required. Note that this function is likely to be called twice +- for each protected block and once during a throw. This is the +- only overhead in the system. +- +- +-Exception.h +------------ +- +-By convention, most projects include `Exception.h` which defines any +-further requirements, then calls `CException.h` to do the gruntwork. All +-of these are optional. You could directly include `CException.h` if +-you wanted and just use the defaults provided. +- +-* `EXCEPTION_T` +- * Set this to the type you want your exception id's to be. Defaults to 'unsigned int'. +- +-* `EXCEPTION_NONE` +- * Set this to a number which will never be an exception id in your system. Defaults to `0x5a5a5a5a`. +- +-* `EXCEPTION_GET_ID` +- * If in a multi-tasking environment, this should be +- set to be a call to the function described in #2 above. +- Defaults to just return `0` all the time (good for +- single tasking environments) +- +-* `EXCEPTION_NUM_ID` +- * If in a multi-tasking environment, this should be set +- to the number of ID's required (usually the number of +- tasks in the system). Defaults to `1` (for single +- tasking environments). +- +-* `CEXCEPTION_NO_CATCH_HANDLER(id)` +- * This macro can be optionally specified. +- It allows you to specify code to be called when a Throw +- is made outside of `Try` ... `Catch` protection. Consider +- this the emergency fallback plan for when something has +- gone terribly wrong. +- +- +-You may also want to include any header files which will commonly be +-needed by the rest of your application where it uses exception handling +-here. For example, OS header files or exception codes would be useful. +- +- +-Finally, there are some hook macros which you can implement to inject +-your own target-specific code in particular places. It is a rare instance +-where you will need these, but they are here if you need them: +- +- +-* `CEXCEPTION_HOOK_START_TRY` +- * called immediately before the Try block +- +-* `CEXCEPTION_HOOK_HAPPY_TRY` +- * called immediately after the Try block if no exception was thrown +- +-* `CEXCEPTION_HOOK_AFTER_TRY` +- * called immediately after the Try block OR before an exception is caught +- +-* `CEXCEPTION_HOOK_START_CATCH` +- * called immediately before the catch +- +- +- +-TESTING +-------- +- +- +-If you want to validate that CException works with your tools or that +-it works with your custom configuration, you may want to run the test +-suite. +- +- +-The test suite included makes use of the `Unity` Test Framework. It will +-require a native C compiler. The example makefile uses MinGW's gcc. +-Modify the makefile to include the proper paths to tools, then run `make` +-to compile and run the test application. +- +-* `C_COMPILER` +- * The C compiler to use to perform the tests +- +-* `C_LIBS` +- * The path to the C libraries (including setjmp) +- +-* `UNITY_DIR` +- * The path to the Unity framework (required to run tests) +- (get it at [ThrowTheSwitch.org](http://throwtheswitch.org)) +- +- +- +-LICENSE +-------- +- +-This software is licensed under the MIT License +- +-Copyright (c) 2007-2020 Mark VanderVoord +- +-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. +diff --git a/components/testframework/libs/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md b/components/testframework/libs/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +deleted file mode 100644 +index a85adef3de..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md ++++ /dev/null +@@ -1,207 +0,0 @@ +-# ThrowTheSwitch.org Coding Standard +- +-Hi. Welcome to the coding standard for ThrowTheSwitch.org. For the most part, +-we try to follow these standards to unify our contributors' code into a cohesive +-unit (puns intended). You might find places where these standards aren't +-followed. We're not perfect. Please be polite where you notice these discrepancies +-and we'll try to be polite when we notice yours. +- +-;) +- +- +-## Why Have A Coding Standard? +- +-Being consistent makes code easier to understand. We've made an attempt to keep +-our standard simple because we also believe that we can only expect someone to +-follow something that is understandable. Please do your best. +- +- +-## Our Philosophy +- +-Before we get into details on syntax, let's take a moment to talk about our +-vision for these tools. We're C developers and embedded software developers. +-These tools are great to test any C code, but catering to embedded software has +-made us more tolerant of compiler quirks. There are a LOT of quirky compilers +-out there. By quirky I mean "doesn't follow standards because they feel like +-they have a license to do as they wish." +- +-Our philosophy is "support every compiler we can". Most often, this means that +-we aim for writing C code that is standards compliant (often C89... that seems +-to be a sweet spot that is almost always compatible). But it also means these +-tools are tolerant of things that aren't common. Some that aren't even +-compliant. There are configuration options to override the size of standard +-types. There are configuration options to force Unity to not use certain +-standard library functions. A lot of Unity is configurable and we have worked +-hard to make it not TOO ugly in the process. +- +-Similarly, our tools that parse C do their best. They aren't full C parsers +-(yet) and, even if they were, they would still have to accept non-standard +-additions like gcc extensions or specifying `@0x1000` to force a variable to +-compile to a particular location. It's just what we do, because we like +-everything to Just Work™. +- +-Speaking of having things Just Work™, that's our second philosophy. By that, we +-mean that we do our best to have EVERY configuration option have a logical +-default. We believe that if you're working with a simple compiler and target, +-you shouldn't need to configure very much... we try to make the tools guess as +-much as they can, but give the user the power to override it when it's wrong. +- +- +-## Naming Things +- +-Let's talk about naming things. Programming is all about naming things. We name +-files, functions, variables, and so much more. While we're not always going to +-find the best name for something, we actually put quite a bit of effort into +-finding *What Something WANTS to be Called*™. +- +-When naming things, we more or less follow this hierarchy, the first being the +-most important to us (but we do all four whenever possible): +-1. Readable +-2. Descriptive +-3. Consistent +-4. Memorable +- +- +-#### Readable +- +-We want to read our code. This means we like names and flow that are more +-naturally read. We try to avoid double negatives. We try to avoid cryptic +-abbreviations (sticking to ones we feel are common). +- +- +-#### Descriptive +- +-We like descriptive names for things, especially functions and variables. +-Finding the right name for something is an important endeavor. You might notice +-from poking around our code that this often results in names that are a little +-longer than the average. Guilty. We're okay with a tiny bit more typing if it +-means our code is easier to understand. +- +-There are two exceptions to this rule that we also stick to as religiously as +-possible: +- +-First, while we realize hungarian notation (and similar systems for encoding +-type information into variable names) is providing a more descriptive name, we +-feel that (for the average developer) it takes away from readability and +-therefore is to be avoided. +- +-Second, loop counters and other local throw-away variables often have a purpose +-which is obvious. There's no need, therefore, to get carried away with complex +-naming. We find i, j, and k are better loop counters than loopCounterVar or +-whatnot. We only break this rule when we see that more description could improve +-understanding of an algorithm. +- +- +-#### Consistent +- +-We like consistency, but we're not really obsessed with it. We try to name our +-configuration macros in a consistent fashion... you'll notice a repeated use of +-UNITY_EXCLUDE_BLAH or UNITY_USES_BLAH macros. This helps users avoid having to +-remember each macro's details. +- +- +-#### Memorable +- +-Where ever it doesn't violate the above principles, we try to apply memorable +-names. Sometimes this means using something that is simply descriptive, but +-often we strive for descriptive AND unique... we like quirky names that stand +-out in our memory and are easier to search for. Take a look through the file +-names in Ceedling and you'll get a good idea of what we are talking about here. +-Why use preprocess when you can use preprocessinator? Or what better describes a +-module in charge of invoking tasks during releases than release_invoker? Don't +-get carried away. The names are still descriptive and fulfill the above +-requirements, but they don't feel stale. +- +- +-## C and C++ Details +- +-We don't really want to add to the style battles out there. Tabs or spaces? +-How many spaces? Where do the braces go? These are age-old questions that will +-never be answered... or at least not answered in a way that will make everyone +-happy. +- +-We've decided on our own style preferences. If you'd like to contribute to these +-projects (and we hope that you do), then we ask if you do your best to follow +-the same. It will only hurt a little. We promise. +- +- +-#### Whitespace +- +-Our C-style is to use spaces and to use 4 of them per indent level. It's a nice +-power-of-2 number that looks decent on a wide screen. We have no more reason +-than that. We break that rule when we have lines that wrap (macros or function +-arguments or whatnot). When that happens, we like to indent further to line +-things up in nice tidy columns. +- +-```C +- if (stuff_happened) +- { +- do_something(); +- } +-``` +- +- +-#### Case +- +-- Files - all lower case with underscores. +-- Variables - all lower case with underscores +-- Macros - all caps with underscores. +-- Typedefs - all caps with underscores. (also ends with _T). +-- Functions - camel cased. Usually named ModuleName_FuncName +-- Constants and Globals - camel cased. +- +- +-#### Braces +- +-The left brace is on the next line after the declaration. The right brace is +-directly below that. Everything in between in indented one level. If you're +-catching an error and you have a one-line, go ahead and to it on the same line. +- +-```C +- while (blah) +- { +- //Like so. Even if only one line, we use braces. +- } +-``` +- +- +-#### Comments +- +-Do you know what we hate? Old-school C block comments. BUT, we're using them +-anyway. As we mentioned, our goal is to support every compiler we can, +-especially embedded compilers. There are STILL C compilers out there that only +-support old-school block comments. So that is what we're using. We apologize. We +-think they are ugly too. +- +- +-## Ruby Details +- +-Is there really such thing as a Ruby coding standard? Ruby is such a free form +-language, it seems almost sacrilegious to suggest that people should comply to +-one method! We'll keep it really brief! +- +- +-#### Whitespace +- +-Our Ruby style is to use spaces and to use 2 of them per indent level. It's a +-nice power-of-2 number that really grooves with Ruby's compact style. We have no +-more reason than that. We break that rule when we have lines that wrap. When +-that happens, we like to indent further to line things up in nice tidy columns. +- +- +-#### Case +- +-- Files - all lower case with underscores. +-- Variables - all lower case with underscores +-- Classes, Modules, etc - Camel cased. +-- Functions - all lower case with underscores +-- Constants - all upper case with underscores +- +- +-## Documentation +- +-Egad. Really? We use markdown and we like pdf files because they can be made to +-look nice while still being portable. Good enough? +- +- +-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* +diff --git a/components/testframework/libs/cmock/vendor/c_exception/lib/CException.c b/components/testframework/libs/cmock/vendor/c_exception/lib/CException.c +deleted file mode 100644 +index fdff8f4753..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/lib/CException.c ++++ /dev/null +@@ -1,46 +0,0 @@ +-#include "CException.h" +- +-#pragma GCC diagnostic push +-#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +-volatile CEXCEPTION_FRAME_T CExceptionFrames[CEXCEPTION_NUM_ID] = {{ 0 }}; +-#pragma GCC diagnostic pop +- +-//------------------------------------------------------------------------------------------ +-// Throw +-//------------------------------------------------------------------------------------------ +-void Throw(CEXCEPTION_T ExceptionID) +-{ +- unsigned int MY_ID = CEXCEPTION_GET_ID; +- CExceptionFrames[MY_ID].Exception = ExceptionID; +- if (CExceptionFrames[MY_ID].pFrame) +- { +- longjmp(*CExceptionFrames[MY_ID].pFrame, 1); +- } +- CEXCEPTION_NO_CATCH_HANDLER(ExceptionID); +-} +- +-//------------------------------------------------------------------------------------------ +-// Explanation of what it's all for: +-//------------------------------------------------------------------------------------------ +-/* +-#define Try +- { <- give us some local scope. most compilers are happy with this +- jmp_buf *PrevFrame, NewFrame; <- prev frame points to the last try block's frame. new frame gets created on stack for this Try block +- unsigned int MY_ID = CEXCEPTION_GET_ID; <- look up this task's id for use in frame array. always 0 if single-tasking +- PrevFrame = CExceptionFrames[CEXCEPTION_GET_ID].pFrame; <- set pointer to point at old frame (which array is currently pointing at) +- CExceptionFrames[MY_ID].pFrame = &NewFrame; <- set array to point at my new frame instead, now +- CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; <- initialize my exception id to be NONE +- if (setjmp(NewFrame) == 0) { <- do setjmp. it returns 1 if longjump called, otherwise 0 +- if (&PrevFrame) <- this is here to force proper scoping. it requires braces or a single line to be but after Try, otherwise won't compile. This is always true at this point. +- +-#define Catch(e) +- else { } <- this also forces proper scoping. Without this they could stick their own 'else' in and it would get ugly +- CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; <- no errors happened, so just set the exception id to NONE (in case it was corrupted) +- } +- else <- an exception occurred +- { e = CExceptionFrames[MY_ID].Exception; e=e;} <- assign the caught exception id to the variable passed in. +- CExceptionFrames[MY_ID].pFrame = PrevFrame; <- make the pointer in the array point at the previous frame again, as if NewFrame never existed. +- } <- finish off that local scope we created to have our own variables +- if (CExceptionFrames[CEXCEPTION_GET_ID].Exception != CEXCEPTION_NONE) <- start the actual 'catch' processing if we have an exception id saved away +- */ +- +diff --git a/components/testframework/libs/cmock/vendor/c_exception/lib/CException.h b/components/testframework/libs/cmock/vendor/c_exception/lib/CException.h +deleted file mode 100644 +index 78f2f940cb..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/lib/CException.h ++++ /dev/null +@@ -1,115 +0,0 @@ +-#ifndef _CEXCEPTION_H +-#define _CEXCEPTION_H +- +-#include +- +-#ifdef __cplusplus +-extern "C" +-{ +-#endif +- +- +-#define CEXCEPTION_VERSION_MAJOR 1 +-#define CEXCEPTION_VERSION_MINOR 3 +-#define CEXCEPTION_VERSION_BUILD 2 +-#define CEXCEPTION_VERSION ((CEXCEPTION_VERSION_MAJOR << 16) | (CEXCEPTION_VERSION_MINOR << 8) | CEXCEPTION_VERSION_BUILD) +- +-//To Use CException, you have a number of options: +-//1. Just include it and run with the defaults +-//2. Define any of the following symbols at the command line to override them +-//3. Include a header file before CException.h everywhere which defines any of these +-//4. Create an Exception.h in your path, and just define EXCEPTION_USE_CONFIG_FILE first +- +-#ifdef CEXCEPTION_USE_CONFIG_FILE +-#include "CExceptionConfig.h" +-#endif +- +-//This is the value to assign when there isn't an exception +-#ifndef CEXCEPTION_NONE +-#define CEXCEPTION_NONE (0x5A5A5A5A) +-#endif +- +-//This is number of exception stacks to keep track of (one per task) +-#ifndef CEXCEPTION_NUM_ID +-#define CEXCEPTION_NUM_ID (1) //there is only the one stack by default +-#endif +- +-//This is the method of getting the current exception stack index (0 if only one stack) +-#ifndef CEXCEPTION_GET_ID +-#define CEXCEPTION_GET_ID (0) //use the first index always because there is only one anyway +-#endif +- +-//The type to use to store the exception values. +-#ifndef CEXCEPTION_T +-#define CEXCEPTION_T unsigned int +-#endif +- +-//This is an optional special handler for when there is no global Catch +-#ifndef CEXCEPTION_NO_CATCH_HANDLER +-#define CEXCEPTION_NO_CATCH_HANDLER(id) +-#endif +- +-//These hooks allow you to inject custom code into places, particularly useful for saving and restoring additional state +-#ifndef CEXCEPTION_HOOK_START_TRY +-#define CEXCEPTION_HOOK_START_TRY +-#endif +-#ifndef CEXCEPTION_HOOK_HAPPY_TRY +-#define CEXCEPTION_HOOK_HAPPY_TRY +-#endif +-#ifndef CEXCEPTION_HOOK_AFTER_TRY +-#define CEXCEPTION_HOOK_AFTER_TRY +-#endif +-#ifndef CEXCEPTION_HOOK_START_CATCH +-#define CEXCEPTION_HOOK_START_CATCH +-#endif +- +-//exception frame structures +-typedef struct { +- jmp_buf* pFrame; +- CEXCEPTION_T volatile Exception; +-} CEXCEPTION_FRAME_T; +- +-//actual root frame storage (only one if single-tasking) +-extern volatile CEXCEPTION_FRAME_T CExceptionFrames[]; +- +-//Try (see C file for explanation) +-#define Try \ +- { \ +- jmp_buf *PrevFrame, NewFrame; \ +- unsigned int MY_ID = CEXCEPTION_GET_ID; \ +- PrevFrame = CExceptionFrames[MY_ID].pFrame; \ +- CExceptionFrames[MY_ID].pFrame = (jmp_buf*)(&NewFrame); \ +- CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; \ +- CEXCEPTION_HOOK_START_TRY; \ +- if (setjmp(NewFrame) == 0) { \ +- if (1) +- +-//Catch (see C file for explanation) +-#define Catch(e) \ +- else { } \ +- CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; \ +- CEXCEPTION_HOOK_HAPPY_TRY; \ +- } \ +- else \ +- { \ +- e = CExceptionFrames[MY_ID].Exception; \ +- (void)e; \ +- CEXCEPTION_HOOK_START_CATCH; \ +- } \ +- CExceptionFrames[MY_ID].pFrame = PrevFrame; \ +- CEXCEPTION_HOOK_AFTER_TRY; \ +- } \ +- if (CExceptionFrames[CEXCEPTION_GET_ID].Exception != CEXCEPTION_NONE) +- +-//Throw an Error +-void Throw(CEXCEPTION_T ExceptionID); +- +-//Just exit the Try block and skip the Catch. +-#define ExitTry() Throw(CEXCEPTION_NONE) +- +-#ifdef __cplusplus +-} // extern "C" +-#endif +- +- +-#endif // _CEXCEPTION_H +diff --git a/components/testframework/libs/cmock/vendor/c_exception/lib/meson.build b/components/testframework/libs/cmock/vendor/c_exception/lib/meson.build +deleted file mode 100644 +index c9afe2048a..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/lib/meson.build ++++ /dev/null +@@ -1,11 +0,0 @@ +-# +-# build script written by : Michael Brockus. +-# github repo author: Mark VanderVoord. +-# +-# license: MIT +-# +-cexception_dir = include_directories('.') +- +-cexception_lib = static_library(meson.project_name(), +- sources: ['CException.c'], +- include_directories: cexception_dir) +diff --git a/components/testframework/libs/cmock/vendor/c_exception/meson.build b/components/testframework/libs/cmock/vendor/c_exception/meson.build +deleted file mode 100644 +index e44cb906d4..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/meson.build ++++ /dev/null +@@ -1,48 +0,0 @@ +-# +-# build script written by : Michael Brockus. +-# github repo author: Mark VanderVoord. +-# +-# license: MIT +-# +-project('CException', 'c', +- license: 'MIT', +- meson_version: '>=0.53.0', +- default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11'] +-) +-lang = 'c' +-cc = meson.get_compiler(lang) +- +-# +-# Meson: Add compiler flags +-if cc.get_id() == 'clang' +- add_project_arguments(cc.get_supported_arguments( +- [ +- '-Wexit-time-destructors', +- '-Wglobal-constructors', +- '-Wmissing-prototypes', +- '-Wmissing-noreturn', +- '-Wno-missing-braces', +- '-Wold-style-cast', '-Wpointer-arith', '-Wweak-vtables', +- '-Wcast-align', '-Wconversion', '-Wcast-qual', '-Wshadow' +- ] +- ), language: lang) +-endif +- +-if cc.get_argument_syntax() == 'gcc' +- add_project_arguments(cc.get_supported_arguments( +- [ +- '-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar', +- '-Wpointer-arith' , '-Wwrite-strings' , +- '-Wno-parentheses' , '-Wno-type-limits' , +- '-Wformat-security' , '-Wunreachable-code' , +- '-Waggregate-return' , '-Wformat-nonliteral' , +- '-Wmissing-declarations', '-Wmissing-include-dirs' , +- '-Wno-unused-parameter' +- ] +- ), language: lang) +-endif +- +-# +-# Sub directory to project source code +-subdir('lib') +-cexception_dep = declare_dependency(link_with: cexception_lib, include_directories: cexception_dir) +diff --git a/components/testframework/libs/cmock/vendor/c_exception/project.yml b/components/testframework/libs/cmock/vendor/c_exception/project.yml +deleted file mode 100644 +index ab4a290af1..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/project.yml ++++ /dev/null +@@ -1,37 +0,0 @@ +---- +- +-# This project file is for using Ceedling to run CException's self-tests. The +-# only requirement for USING CException is in the lib folder. +- +-:project: +- :use_exceptions: FALSE +- :use_test_preprocessor: FALSE +- :use_auxiliary_dependencies: FALSE +- :build_root: build +- :test_file_prefix: Test +- :which_ceedling: gem +- :ceedling_version: 0.29.1 +- :default_tasks: +- - clobber test:all +- +-:extension: +- :executable: .out +- +-:paths: +- :test: +- - +:test/** +- - -:test/support +- :source: +- - lib/** +- :support: +- - test/support +- +-:defines: +- :test: +- - TEST +- - CEXCEPTION_USE_CONFIG_FILE +- :test_preprocess: +- - TEST +- - CEXCEPTION_USE_CONFIG_FILE +- +-... +diff --git a/components/testframework/libs/cmock/vendor/c_exception/test/TestException.c b/components/testframework/libs/cmock/vendor/c_exception/test/TestException.c +deleted file mode 100644 +index e248cb0f28..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/test/TestException.c ++++ /dev/null +@@ -1,391 +0,0 @@ +-#include "unity.h" +-#include "CException.h" +- +-volatile int TestingTheFallback; +-volatile int TestingTheFallbackId; +- +-void setUp(void) +-{ +- CExceptionFrames[0].pFrame = NULL; +- TestingTheFallback = 0; +-} +- +-void tearDown(void) +-{ +-} +- +-void test_BasicTryDoesNothingIfNoThrow(void) +-{ +- int i = 0; +- CEXCEPTION_T e = 0x5a; +- +- Try +- { +- i += 1; +- } +- Catch(e) +- { +- TEST_FAIL_MESSAGE("Should Not Enter Catch If Not Thrown"); +- } +- +- //verify that e was untouched +- TEST_ASSERT_EQUAL(0x5a, e); +- +- // verify that i was incremented once +- TEST_ASSERT_EQUAL(1, i); +-} +- +-void test_BasicThrowAndCatch(void) +-{ +- CEXCEPTION_T e; +- +- Try +- { +- Throw(0xBE); +- TEST_FAIL_MESSAGE("Should Have Thrown An Error"); +- } +- Catch(e) +- { +- //verify that e has the right data +- TEST_ASSERT_EQUAL(0xBE, e); +- } +- +- //verify that e STILL has the right data +- TEST_ASSERT_EQUAL(0xBE, e); +-} +- +-void test_BasicThrowAndCatch_WithMiniSyntax(void) +-{ +- CEXCEPTION_T e; +- +- //Mini Throw and Catch +- Try +- Throw(0xEF); +- Catch(e) +- TEST_ASSERT_EQUAL(0xEF, e); +- TEST_ASSERT_EQUAL(0xEF, e); +- +- //Mini Passthrough +- Try +- e = 0; +- Catch(e) +- TEST_FAIL_MESSAGE("I shouldn't be caught because there was no throw"); +- +- TEST_ASSERT_EQUAL(0, e); +-} +- +-void test_VerifyVolatilesSurviveThrowAndCatch(void) +-{ +- volatile unsigned int VolVal = 0; +- CEXCEPTION_T e; +- +- Try +- { +- VolVal = 2; +- Throw(0xBF); +- TEST_FAIL_MESSAGE("Should Have Thrown An Error"); +- } +- Catch(e) +- { +- VolVal += 2; +- TEST_ASSERT_EQUAL(0xBF, e); +- } +- +- TEST_ASSERT_EQUAL(4, VolVal); +- TEST_ASSERT_EQUAL(0xBF, e); +-} +- +-void HappyExceptionThrower(unsigned int ID) +-{ +- if (ID != 0) +- { +- Throw(ID); +- } +-} +- +-void test_ThrowFromASubFunctionAndCatchInRootFunc(void) +-{ +- volatile unsigned int ID = 0; +- CEXCEPTION_T e; +- +- Try +- { +- +- HappyExceptionThrower(0xBA); +- TEST_FAIL_MESSAGE("Should Have Thrown An Exception"); +- } +- Catch(e) +- { +- ID = e; +- } +- +- //verify that I can pass that value to something else +- TEST_ASSERT_EQUAL(0xBA, e); +- //verify that ID and e have the same value +- TEST_ASSERT_EQUAL(ID, e); +-} +- +-void HappyExceptionRethrower(unsigned int ID) +-{ +- CEXCEPTION_T e; +- +- Try +- { +- Throw(ID); +- } +- Catch(e) +- { +- switch (e) +- { +- case 0xBD: +- Throw(0xBF); +- break; +- default: +- break; +- } +- } +-} +- +-void test_ThrowAndCatchFromASubFunctionAndRethrowToCatchInRootFunc(void) +-{ +- volatile unsigned int ID = 0; +- CEXCEPTION_T e; +- +- Try +- { +- HappyExceptionRethrower(0xBD); +- TEST_FAIL_MESSAGE("Should Have Rethrown Exception"); +- } +- Catch(e) +- { +- ID = 1; +- } +- +- TEST_ASSERT_EQUAL(0xBF, e); +- TEST_ASSERT_EQUAL(1, ID); +-} +- +-void test_ThrowAndCatchFromASubFunctionAndNoRethrowToCatchInRootFunc(void) +-{ +- CEXCEPTION_T e = 3; +- +- Try +- { +- HappyExceptionRethrower(0xBF); +- } +- Catch(e) +- { +- TEST_FAIL_MESSAGE("Should Not Have Re-thrown Error (it should have already been caught)"); +- } +- +- //verify that THIS e is still untouched, even though subfunction was touched +- TEST_ASSERT_EQUAL(3, e); +-} +- +-void test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThisDoesntCorruptExceptionId(void) +-{ +- CEXCEPTION_T e; +- +- Try +- { +- HappyExceptionThrower(0xBF); +- TEST_FAIL_MESSAGE("Should Have Thrown Exception"); +- } +- Catch(e) +- { +- TEST_ASSERT_EQUAL(0xBF, e); +- HappyExceptionRethrower(0x12); +- TEST_ASSERT_EQUAL(0xBF, e); +- } +- TEST_ASSERT_EQUAL(0xBF, e); +-} +- +-void test_ThrowAnErrorThenEnterATryBlockFromWithinCatch_VerifyThatEachExceptionIdIndependent(void) +-{ +- CEXCEPTION_T e1, e2; +- +- Try +- { +- HappyExceptionThrower(0xBF); +- TEST_FAIL_MESSAGE("Should Have Thrown Exception"); +- } +- Catch(e1) +- { +- TEST_ASSERT_EQUAL(0xBF, e1); +- Try +- { +- HappyExceptionThrower(0x12); +- } +- Catch(e2) +- { +- TEST_ASSERT_EQUAL(0x12, e2); +- } +- TEST_ASSERT_EQUAL(0x12, e2); +- TEST_ASSERT_EQUAL(0xBF, e1); +- } +- TEST_ASSERT_EQUAL(0x12, e2); +- TEST_ASSERT_EQUAL(0xBF, e1); +-} +- +-void test_CanHaveMultipleTryBlocksInASingleFunction(void) +-{ +- CEXCEPTION_T e; +- +- Try +- { +- HappyExceptionThrower(0x01); +- TEST_FAIL_MESSAGE("Should Have Thrown Exception"); +- } +- Catch(e) +- { +- TEST_ASSERT_EQUAL(0x01, e); +- } +- +- Try +- { +- HappyExceptionThrower(0xF0); +- TEST_FAIL_MESSAGE("Should Have Thrown Exception"); +- } +- Catch(e) +- { +- TEST_ASSERT_EQUAL(0xF0, e); +- } +-} +- +-void test_CanHaveNestedTryBlocksInASingleFunction_ThrowInside(void) +-{ +- int i = 0; +- CEXCEPTION_T e; +- +- Try +- { +- Try +- { +- HappyExceptionThrower(0x01); +- i = 1; +- TEST_FAIL_MESSAGE("Should Have Rethrown Exception"); +- } +- Catch(e) +- { +- TEST_ASSERT_EQUAL(0x01, e); +- } +- } +- Catch(e) +- { +- TEST_FAIL_MESSAGE("Should Have Been Caught By Inside Catch"); +- } +- +- // verify that i is still zero +- TEST_ASSERT_EQUAL(0, i); +-} +- +-void test_CanHaveNestedTryBlocksInASingleFunction_ThrowOutside(void) +-{ +- int i = 0; +- CEXCEPTION_T e; +- +- Try +- { +- Try +- { +- i = 2; +- } +- Catch(e) +- { +- TEST_FAIL_MESSAGE("Should Not Be Caught Here"); +- } +- HappyExceptionThrower(0x01); +- TEST_FAIL_MESSAGE("Should Have Rethrown Exception"); +- } +- Catch(e) +- { +- TEST_ASSERT_EQUAL(0x01, e); +- } +- +- // verify that i is 2 +- TEST_ASSERT_EQUAL(2, i); +-} +- +-void test_AThrowWithoutATryCatchWillUseDefaultHandlerIfSpecified(void) +-{ +- //Let the fallback handler know we're expecting it to get called this time, so don't fail +- TestingTheFallback = 1; +- +- Throw(0xBE); +- +- //We know the fallback was run because it decrements the counter above +- TEST_ASSERT_FALSE(TestingTheFallback); +- TEST_ASSERT_EQUAL(0xBE, TestingTheFallbackId); +-} +- +-void test_AThrowWithoutOutsideATryCatchWillUseDefaultHandlerEvenAfterTryCatch(void) +-{ +- CEXCEPTION_T e; +- +- Try +- { +- //It's not really important that we do anything here. +- } +- Catch(e) +- { +- //The entire purpose here is just to make sure things get set back to using the default handler when done +- } +- +- //Let the fallback handler know we're expecting it to get called this time, so don't fail +- TestingTheFallback = 1; +- +- Throw(0xBE); +- +- //We know the fallback was run because it decrements the counter above +- TEST_ASSERT_FALSE(TestingTheFallback); +- TEST_ASSERT_EQUAL(0xBE, TestingTheFallbackId); +-} +- +-void test_AbilityToExitTryWithoutThrowingAnError(void) +-{ +- int i=0; +- CEXCEPTION_T e; +- +- Try +- { +- ExitTry(); +- i = 1; +- TEST_FAIL_MESSAGE("Should Have Exited Try Before This"); +- } +- Catch(e) +- { +- i = 2; +- TEST_FAIL_MESSAGE("Should Not Have Been Caught"); +- } +- +- // verify that i is still zero +- TEST_ASSERT_EQUAL(0, i); +-} +- +-void test_AbilityToExitTryWillOnlyExitOneLevel(void) +-{ +- int i=0; +- CEXCEPTION_T e; +- CEXCEPTION_T e2; +- +- Try +- { +- Try +- { +- ExitTry(); +- TEST_FAIL_MESSAGE("Should Have Exited Try Before This"); +- } +- Catch(e) +- { +- TEST_FAIL_MESSAGE("Should Not Have Been Caught By Inside"); +- } +- i = 1; +- } +- Catch(e2) +- { +- TEST_FAIL_MESSAGE("Should Not Have Been Caught By Outside"); +- } +- +- // verify that we picked up and ran after first Try +- TEST_ASSERT_EQUAL(1, i); +-} +diff --git a/components/testframework/libs/cmock/vendor/c_exception/test/support/CExceptionConfig.h b/components/testframework/libs/cmock/vendor/c_exception/test/support/CExceptionConfig.h +deleted file mode 100644 +index 66cb87e7b3..0000000000 +--- a/components/testframework/libs/cmock/vendor/c_exception/test/support/CExceptionConfig.h ++++ /dev/null +@@ -1,46 +0,0 @@ +-#ifndef _EXCEPTION_H +-#define _EXCEPTION_H +- +-#include "unity.h" +- +-extern volatile int TestingTheFallback; +-extern volatile int TestingTheFallbackId; +- +-//Optionally define the exception type (something like an int which can be directly assigned) +-#define CEXCEPTION_T int +- +-// Optionally define the reserved value representing NO EXCEPTION +-#define CEXCEPTION_NONE (1234) +- +-// Optionally define a special handler for unhandled exceptions +-#define CEXCEPTION_NO_CATCH_HANDLER(id) \ +-{ \ +- if (!TestingTheFallback) \ +- { \ +- TEST_FAIL_MESSAGE("Unexpected Exception!"); \ +- } \ +- else \ +- { \ +- TestingTheFallbackId = id; \ +- TestingTheFallback--; \ +- } \ +-} +- +-// Multi-Tasking environments will need a couple of macros defined to make this library +-// properly handle multiple exception stacks. You will need to include and required +-// definitions, then define the following macros: +-// EXCEPTION_GET_ID - returns the id of the current task indexed 0 to (numtasks - 1) +-// EXCEPTION_NUM_ID - returns the number of tasks that might be returned +-// +-// For example, Quadros might include the following implementation: +-#ifndef TEST +-#include "OSAPI.h" +-#define CEXCEPTION_GET_ID (KS_GetTaskID()) +-#define CEXCEPTION_NUM_ID (NTASKS + 1) +-#endif +- +-//This could be a good place to define/include some error ID's: +-#define ERROR_ID_EVERYTHING_IS_BROKEN (0x88) +-#define ERROR_ID_ONLY_THIS_IS_BROKEN (0x77) +- +-#endif // _EXCEPTION_H +diff --git a/components/testframework/libs/cmock/vendor/unity/.editorconfig b/components/testframework/libs/cmock/vendor/unity/.editorconfig +deleted file mode 100644 +index 7b7a47a01d..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/.editorconfig ++++ /dev/null +@@ -1,27 +0,0 @@ +-############################################################################### +-# Unity Project - A Test Framework for C +-# .editorconfig - F. Zahn 2019 +-############################################################################### +- +-# This is the topmost .editorconfig file +-root = true +- +-# Settings that apply to all languages / files +-[*] +-charset = utf-8 +-indent_size = 4 +-indent_style = space +-insert_final_newline = true +-trim_trailing_whitespace = true +- +-[*.md] +-trim_trailing_whitespace = false +- +-[*.txt] +-trim_trailing_whitespace = false +- +-[*.rb] +-indent_size = 2 +- +-[*.yml] +-indent_size = 2 +diff --git a/components/testframework/libs/cmock/vendor/unity/.travis.yml b/components/testframework/libs/cmock/vendor/unity/.travis.yml +deleted file mode 100644 +index d3b9a18e20..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/.travis.yml ++++ /dev/null +@@ -1,26 +0,0 @@ +-sudo: required +-language: ruby c +- +-matrix: +- include: +- #- os: osx +- # compiler: clang +- # osx_image: xcode7.3 +- - os: linux +- dist: trusty +- rvm: "2.4" +- compiler: gcc +- - os: linux +- dist: xenial +- rvm: "2.7" +- compiler: clang +- +-before_install: +- - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install --assume-yes --quiet gcc-multilib; fi +- +-install: +- - gem install rspec +- - gem install rubocop -v 0.57.2 +- +-script: +- - cd test && rake ci +diff --git a/components/testframework/libs/cmock/vendor/unity/CMakeLists.txt b/components/testframework/libs/cmock/vendor/unity/CMakeLists.txt +deleted file mode 100644 +index 3a9d8a94c0..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/CMakeLists.txt ++++ /dev/null +@@ -1,133 +0,0 @@ +-################################################################################### +-# # +-# NAME: CMakeLists.txt # +-# # +-# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. # +-# WRITTEN BY: Michael Brockus. # +-# # +-# License: MIT # +-# # +-################################################################################### +- +-cmake_minimum_required(VERSION 3.12) +- +-# Read src/unity.h file and get project version from it +-set(UNITY_HEADER "src/unity.h") +- +-file(STRINGS "${UNITY_HEADER}" UNITY_HEADER_CONTENT +- REGEX "^#define UNITY_VERSION_(MAJOR|MINOR|BUILD) +[0-9]+$" +-) +- +-set(UNITY_HEADER_VERSION_MAJOR 0) +-set(UNITY_HEADER_VERSION_MINOR 0) +-set(UNITY_HEADER_VERSION_BUILD 0) +- +-foreach(VERSION_LINE IN LISTS UNITY_HEADER_CONTENT) +- foreach(VERSION_PART MAJOR MINOR BUILD) +- string(CONCAT REGEX_STRING "#define UNITY_VERSION_" +- "${VERSION_PART}" +- " +([0-9]+)" +- ) +- +- if(VERSION_LINE MATCHES "${REGEX_STRING}") +- set(UNITY_HEADER_VERSION_${VERSION_PART} "${CMAKE_MATCH_1}") +- endif() +- endforeach() +-endforeach() +- +-project(unity +- VERSION ${UNITY_HEADER_VERSION_MAJOR}.${UNITY_HEADER_VERSION_MINOR}.${UNITY_HEADER_VERSION_BUILD} +- LANGUAGES C +- DESCRIPTION "C Unit testing framework." +-) +- +-# Main target ------------------------------------------------------------------ +-add_library(${PROJECT_NAME} STATIC) +-add_library(${PROJECT_NAME}::framework ALIAS ${PROJECT_NAME}) +- +-# Includes --------------------------------------------------------------------- +-include(GNUInstallDirs) +-include(CMakePackageConfigHelpers) +- +-target_sources(${PROJECT_NAME} +- PRIVATE +- src/unity.c +-) +- +-target_include_directories(${PROJECT_NAME} +- PUBLIC +- $ +- $ +- $ +-) +- +-set(${PROJECT_NAME}_PUBLIC_HEADERS src/unity.h +- src/unity_internals.h +-) +- +-set_target_properties(${PROJECT_NAME} +- PROPERTIES +- C_STANDARD 11 +- C_STANDARD_REQUIRED ON +- C_EXTENSIONS OFF +- PUBLIC_HEADER "${${PROJECT_NAME}_PUBLIC_HEADERS}" +- EXPORT_NAME framework +-) +- +-target_compile_options(${PROJECT_NAME} +- PRIVATE +- $<$:-Wcast-align +- -Wcast-qual +- -Wconversion +- -Wexit-time-destructors +- -Wglobal-constructors +- -Wmissing-noreturn +- -Wmissing-prototypes +- -Wno-missing-braces +- -Wold-style-cast +- -Wshadow +- -Wweak-vtables> +- $<$:-Waddress +- -Waggregate-return +- -Wformat-nonliteral +- -Wformat-security +- -Wformat +- -Winit-self +- -Wmissing-declarations +- -Wmissing-include-dirs +- -Wno-multichar +- -Wno-parentheses +- -Wno-type-limits +- -Wno-unused-parameter +- -Wunreachable-code +- -Wwrite-strings +- -Wpointer-arith> +- -Wall +- -Werror +-) +- +-write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake +- VERSION ${PROJECT_VERSION} +- COMPATIBILITY SameMajorVersion +-) +- +-## Target installation +-install(TARGETS ${PROJECT_NAME} +- EXPORT ${PROJECT_NAME}Targets +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} +- COMPONENT library +-) +- +-## Target's cmake files: targets export +-install(EXPORT ${PROJECT_NAME}Targets +- NAMESPACE ${PROJECT_NAME}:: +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} +-) +- +-## Target's cmake files: config and version config for find_package() +-install(FILES ${PROJECT_NAME}Config.cmake +- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} +-) +diff --git a/components/testframework/libs/cmock/vendor/unity/LICENSE.txt b/components/testframework/libs/cmock/vendor/unity/LICENSE.txt +deleted file mode 100644 +index d66fba53e5..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/LICENSE.txt ++++ /dev/null +@@ -1,21 +0,0 @@ +-The MIT License (MIT) +- +-Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams +- +-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. +diff --git a/components/testframework/libs/cmock/vendor/unity/README.md b/components/testframework/libs/cmock/vendor/unity/README.md +deleted file mode 100644 +index e6e7ea2d04..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/README.md ++++ /dev/null +@@ -1,191 +0,0 @@ +-Unity Test API +-============== +- +-[![Unity Build Status](https://api.travis-ci.org/ThrowTheSwitch/Unity.png?branch=master)](https://travis-ci.org/ThrowTheSwitch/Unity) +-__Copyright (c) 2007 - 2020 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__ +- +-Getting Started +-=============== +-The [docs](docs/) folder contains a [getting started guide](docs/UnityGettingStartedGuide.md) +-and much more tips about using Unity. +- +-Unity Assertion Summary +-======================= +-For the full list, see [UnityAssertionsReference.md](docs/UnityAssertionsReference.md). +- +-Basic Validity Tests +--------------------- +- +- TEST_ASSERT_TRUE(condition) +- +-Evaluates whatever code is in condition and fails if it evaluates to false +- +- TEST_ASSERT_FALSE(condition) +- +-Evaluates whatever code is in condition and fails if it evaluates to true +- +- TEST_ASSERT(condition) +- +-Another way of calling `TEST_ASSERT_TRUE` +- +- TEST_ASSERT_UNLESS(condition) +- +-Another way of calling `TEST_ASSERT_FALSE` +- +- TEST_FAIL() +- TEST_FAIL_MESSAGE(message) +- +-This test is automatically marked as a failure. The message is output stating why. +- +-Numerical Assertions: Integers +------------------------------- +- +- TEST_ASSERT_EQUAL_INT(expected, actual) +- TEST_ASSERT_EQUAL_INT8(expected, actual) +- TEST_ASSERT_EQUAL_INT16(expected, actual) +- TEST_ASSERT_EQUAL_INT32(expected, actual) +- TEST_ASSERT_EQUAL_INT64(expected, actual) +- +-Compare two integers for equality and display errors as signed integers. A cast will be performed +-to your natural integer size so often this can just be used. When you need to specify the exact size, +-like when comparing arrays, you can use a specific version: +- +- TEST_ASSERT_EQUAL_UINT(expected, actual) +- TEST_ASSERT_EQUAL_UINT8(expected, actual) +- TEST_ASSERT_EQUAL_UINT16(expected, actual) +- TEST_ASSERT_EQUAL_UINT32(expected, actual) +- TEST_ASSERT_EQUAL_UINT64(expected, actual) +- +-Compare two integers for equality and display errors as unsigned integers. Like INT, there are +-variants for different sizes also. +- +- TEST_ASSERT_EQUAL_HEX(expected, actual) +- TEST_ASSERT_EQUAL_HEX8(expected, actual) +- TEST_ASSERT_EQUAL_HEX16(expected, actual) +- TEST_ASSERT_EQUAL_HEX32(expected, actual) +- TEST_ASSERT_EQUAL_HEX64(expected, actual) +- +-Compares two integers for equality and display errors as hexadecimal. Like the other integer comparisons, +-you can specify the size... here the size will also effect how many nibbles are shown (for example, `HEX16` +-will show 4 nibbles). +- +- TEST_ASSERT_EQUAL(expected, actual) +- +-Another way of calling TEST_ASSERT_EQUAL_INT +- +- TEST_ASSERT_INT_WITHIN(delta, expected, actual) +- +-Asserts that the actual value is within plus or minus delta of the expected value. This also comes in +-size specific variants. +- +- +- TEST_ASSERT_GREATER_THAN(threshold, actual) +- +-Asserts that the actual value is greater than the threshold. This also comes in size specific variants. +- +- +- TEST_ASSERT_LESS_THAN(threshold, actual) +- +-Asserts that the actual value is less than the threshold. This also comes in size specific variants. +- +- +-Arrays +------- +- +- _ARRAY +- +-You can append `_ARRAY` to any of these macros to make an array comparison of that type. Here you will +-need to care a bit more about the actual size of the value being checked. You will also specify an +-additional argument which is the number of elements to compare. For example: +- +- TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, elements) +- +- _EACH_EQUAL +- +-Another array comparison option is to check that EVERY element of an array is equal to a single expected +-value. You do this by specifying the EACH_EQUAL macro. For example: +- +- TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, elements) +- +-Numerical Assertions: Bitwise +------------------------------ +- +- TEST_ASSERT_BITS(mask, expected, actual) +- +-Use an integer mask to specify which bits should be compared between two other integers. High bits in the mask are compared, low bits ignored. +- +- TEST_ASSERT_BITS_HIGH(mask, actual) +- +-Use an integer mask to specify which bits should be inspected to determine if they are all set high. High bits in the mask are compared, low bits ignored. +- +- TEST_ASSERT_BITS_LOW(mask, actual) +- +-Use an integer mask to specify which bits should be inspected to determine if they are all set low. High bits in the mask are compared, low bits ignored. +- +- TEST_ASSERT_BIT_HIGH(bit, actual) +- +-Test a single bit and verify that it is high. The bit is specified 0-31 for a 32-bit integer. +- +- TEST_ASSERT_BIT_LOW(bit, actual) +- +-Test a single bit and verify that it is low. The bit is specified 0-31 for a 32-bit integer. +- +-Numerical Assertions: Floats +----------------------------- +- +- TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual) +- +-Asserts that the actual value is within plus or minus delta of the expected value. +- +- TEST_ASSERT_EQUAL_FLOAT(expected, actual) +- TEST_ASSERT_EQUAL_DOUBLE(expected, actual) +- +-Asserts that two floating point values are "equal" within a small % delta of the expected value. +- +-String Assertions +------------------ +- +- TEST_ASSERT_EQUAL_STRING(expected, actual) +- +-Compare two null-terminate strings. Fail if any character is different or if the lengths are different. +- +- TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len) +- +-Compare two strings. Fail if any character is different, stop comparing after len characters. +- +- TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, actual, message) +- +-Compare two null-terminate strings. Fail if any character is different or if the lengths are different. Output a custom message on failure. +- +- TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE(expected, actual, len, message) +- +-Compare two strings. Fail if any character is different, stop comparing after len characters. Output a custom message on failure. +- +-Pointer Assertions +------------------- +- +-Most pointer operations can be performed by simply using the integer comparisons above. However, a couple of special cases are added for clarity. +- +- TEST_ASSERT_NULL(pointer) +- +-Fails if the pointer is not equal to NULL +- +- TEST_ASSERT_NOT_NULL(pointer) +- +-Fails if the pointer is equal to NULL +- +-Memory Assertions +------------------ +- +- TEST_ASSERT_EQUAL_MEMORY(expected, actual, len) +- +-Compare two blocks of memory. This is a good generic assertion for types that can't be coerced into acting like +-standard types... but since it's a memory compare, you have to be careful that your data types are packed. +- +-\_MESSAGE +---------- +- +-you can append \_MESSAGE to any of the macros to make them take an additional argument. This argument +-is a string that will be printed at the end of the failure strings. This is useful for specifying more +-information about the problem. +- +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/colour_prompt.rb b/components/testframework/libs/cmock/vendor/unity/auto/colour_prompt.rb +deleted file mode 100644 +index 85cbfd80c9..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/colour_prompt.rb ++++ /dev/null +@@ -1,119 +0,0 @@ +-# ========================================== +-# 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] +-# ========================================== +- +-if RUBY_PLATFORM =~ /(win|w)32$/ +- begin +- require 'Win32API' +- rescue LoadError +- puts 'ERROR! "Win32API" library not found' +- puts '"Win32API" is required for colour on a windows machine' +- puts ' try => "gem install Win32API" on the command line' +- puts +- end +- # puts +- # puts 'Windows Environment Detected...' +- # puts 'Win32API Library Found.' +- # puts +-end +- +-class ColourCommandLine +- def initialize +- return unless RUBY_PLATFORM =~ /(win|w)32$/ +- +- get_std_handle = Win32API.new('kernel32', 'GetStdHandle', ['L'], 'L') +- @set_console_txt_attrb = +- Win32API.new('kernel32', 'SetConsoleTextAttribute', %w[L N], 'I') +- @hout = get_std_handle.call(-11) +- end +- +- def change_to(new_colour) +- if RUBY_PLATFORM =~ /(win|w)32$/ +- @set_console_txt_attrb.call(@hout, win32_colour(new_colour)) +- else +- "\033[30;#{posix_colour(new_colour)};22m" +- end +- end +- +- def win32_colour(colour) +- case colour +- when :black then 0 +- when :dark_blue then 1 +- when :dark_green then 2 +- when :dark_cyan then 3 +- when :dark_red then 4 +- when :dark_purple then 5 +- when :dark_yellow, :narrative then 6 +- when :default_white, :default, :dark_white then 7 +- when :silver then 8 +- when :blue then 9 +- when :green, :success then 10 +- when :cyan, :output then 11 +- when :red, :failure then 12 +- when :purple then 13 +- when :yellow then 14 +- when :white then 15 +- else +- 0 +- end +- end +- +- def posix_colour(colour) +- # ANSI Escape Codes - Foreground colors +- # | Code | Color | +- # | 39 | Default foreground color | +- # | 30 | Black | +- # | 31 | Red | +- # | 32 | Green | +- # | 33 | Yellow | +- # | 34 | Blue | +- # | 35 | Magenta | +- # | 36 | Cyan | +- # | 37 | Light gray | +- # | 90 | Dark gray | +- # | 91 | Light red | +- # | 92 | Light green | +- # | 93 | Light yellow | +- # | 94 | Light blue | +- # | 95 | Light magenta | +- # | 96 | Light cyan | +- # | 97 | White | +- +- case colour +- when :black then 30 +- when :red, :failure then 31 +- when :green, :success then 32 +- when :yellow then 33 +- when :blue, :narrative then 34 +- when :purple, :magenta then 35 +- when :cyan, :output then 36 +- when :white, :default_white then 37 +- when :default then 39 +- else +- 39 +- end +- end +- +- def out_c(mode, colour, str) +- case RUBY_PLATFORM +- when /(win|w)32$/ +- change_to(colour) +- $stdout.puts str if mode == :puts +- $stdout.print str if mode == :print +- change_to(:default_white) +- else +- $stdout.puts("#{change_to(colour)}#{str}\033[0m") if mode == :puts +- $stdout.print("#{change_to(colour)}#{str}\033[0m") if mode == :print +- end +- end +-end +- +-def colour_puts(role, str) +- ColourCommandLine.new.out_c(:puts, role, str) +-end +- +-def colour_print(role, str) +- ColourCommandLine.new.out_c(:print, role, str) +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/colour_reporter.rb b/components/testframework/libs/cmock/vendor/unity/auto/colour_reporter.rb +deleted file mode 100644 +index 1c3bc21627..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/colour_reporter.rb ++++ /dev/null +@@ -1,39 +0,0 @@ +-# ========================================== +-# 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] +-# ========================================== +- +-require_relative 'colour_prompt' +- +-$colour_output = true +- +-def report(message) +- if !$colour_output +- $stdout.puts(message) +- else +- message = message.join('\n') if message.class == Array +- message.each_line do |line| +- line.chomp! +- colour = case line +- when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i +- Regexp.last_match(1).to_i.zero? ? :green : :red +- when /PASS/ +- :green +- when /^OK$/ +- :green +- when /(?:FAIL|ERROR)/ +- :red +- when /IGNORE/ +- :yellow +- when /^(?:Creating|Compiling|Linking)/ +- :white +- else +- :silver +- end +- colour_puts(colour, line) +- end +- end +- $stdout.flush +- $stderr.flush +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/generate_config.yml b/components/testframework/libs/cmock/vendor/unity/auto/generate_config.yml +deleted file mode 100644 +index 4a5e474245..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/generate_config.yml ++++ /dev/null +@@ -1,36 +0,0 @@ +-#this is a sample configuration file for generate_module +-#you would use it by calling generate_module with the -ygenerate_config.yml option +-#files like this are useful for customizing generate_module to your environment +-:generate_module: +- :defaults: +- #these defaults are used in place of any missing options at the command line +- :path_src: ../src/ +- :path_inc: ../src/ +- :path_tst: ../test/ +- :update_svn: true +- :includes: +- #use [] for no additional includes, otherwise list the includes on separate lines +- :src: +- - Defs.h +- - Board.h +- :inc: [] +- :tst: +- - Defs.h +- - Board.h +- - Exception.h +- :boilerplates: +- #these are inserted at the top of generated files. +- #just comment out or remove if not desired. +- #use %1$s where you would like the file name to appear (path/extension not included) +- :src: | +- //------------------------------------------- +- // %1$s.c +- //------------------------------------------- +- :inc: | +- //------------------------------------------- +- // %1$s.h +- //------------------------------------------- +- :tst: | +- //------------------------------------------- +- // Test%1$s.c : Units tests for %1$s.c +- //------------------------------------------- +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/generate_module.rb b/components/testframework/libs/cmock/vendor/unity/auto/generate_module.rb +deleted file mode 100644 +index 3d9ee8d6d3..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/generate_module.rb ++++ /dev/null +@@ -1,312 +0,0 @@ +-# ========================================== +-# 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] +-# ========================================== +- +-# This script creates all the files with start code necessary for a new module. +-# A simple module only requires a source file, header file, and test file. +-# Triad modules require a source, header, and test file for each triad type (like model, conductor, and hardware). +- +-require 'rubygems' +-require 'fileutils' +-require 'pathname' +- +-# TEMPLATE_TST +-TEMPLATE_TST ||= '#include "unity.h" +- +-%2$s#include "%1$s.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void test_%4$s_NeedToImplement(void) +-{ +- TEST_IGNORE_MESSAGE("Need to Implement %1$s"); +-} +-'.freeze +- +-# TEMPLATE_SRC +-TEMPLATE_SRC ||= '%2$s#include "%1$s.h" +-'.freeze +- +-# TEMPLATE_INC +-TEMPLATE_INC ||= '#ifndef %3$s_H +-#define %3$s_H +-%2$s +- +-#endif // %3$s_H +-'.freeze +- +-class UnityModuleGenerator +- ############################ +- def initialize(options = nil) +- @options = UnityModuleGenerator.default_options +- case options +- when NilClass then @options +- when String then @options.merge!(UnityModuleGenerator.grab_config(options)) +- when Hash then @options.merge!(options) +- else raise 'If you specify arguments, it should be a filename or a hash of options' +- end +- +- # Create default file paths if none were provided +- @options[:path_src] = "#{__dir__}/../src/" if @options[:path_src].nil? +- @options[:path_inc] = @options[:path_src] if @options[:path_inc].nil? +- @options[:path_tst] = "#{__dir__}/../test/" if @options[:path_tst].nil? +- @options[:path_src] += '/' unless @options[:path_src][-1] == 47 +- @options[:path_inc] += '/' unless @options[:path_inc][-1] == 47 +- @options[:path_tst] += '/' unless @options[:path_tst][-1] == 47 +- +- # Built in patterns +- @patterns = { +- 'src' => { +- '' => { inc: [] } +- }, +- 'test' => { +- '' => { inc: [] } +- }, +- 'dh' => { +- 'Driver' => { inc: [create_filename('%1$s', 'Hardware.h')] }, +- 'Hardware' => { inc: [] } +- }, +- 'dih' => { +- 'Driver' => { inc: [create_filename('%1$s', 'Hardware.h'), create_filename('%1$s', 'Interrupt.h')] }, +- 'Interrupt' => { inc: [create_filename('%1$s', 'Hardware.h')] }, +- 'Hardware' => { inc: [] } +- }, +- 'mch' => { +- 'Model' => { inc: [] }, +- 'Conductor' => { inc: [create_filename('%1$s', 'Model.h'), create_filename('%1$s', 'Hardware.h')] }, +- 'Hardware' => { inc: [] } +- }, +- 'mvp' => { +- 'Model' => { inc: [] }, +- 'Presenter' => { inc: [create_filename('%1$s', 'Model.h'), create_filename('%1$s', 'View.h')] }, +- 'View' => { inc: [] } +- } +- } +- end +- +- ############################ +- def self.default_options +- { +- pattern: 'src', +- includes: { +- src: [], +- inc: [], +- tst: [] +- }, +- update_svn: false, +- boilerplates: {}, +- test_prefix: 'Test', +- mock_prefix: 'Mock' +- } +- end +- +- ############################ +- def self.grab_config(config_file) +- options = default_options +- unless config_file.nil? || config_file.empty? +- require 'yaml' +- yaml_guts = YAML.load_file(config_file) +- options.merge!(yaml_guts[:unity] || yaml_guts[:cmock]) +- raise "No :unity or :cmock section found in #{config_file}" unless options +- end +- options +- end +- +- ############################ +- def files_to_operate_on(module_name, pattern = nil) +- # strip any leading path information from the module name and save for later +- subfolder = File.dirname(module_name) +- module_name = File.basename(module_name) +- +- # create triad definition +- prefix = @options[:test_prefix] || 'Test' +- triad = [{ ext: '.c', path: @options[:path_src], prefix: '', template: TEMPLATE_SRC, inc: :src, boilerplate: @options[:boilerplates][:src] }, +- { ext: '.h', path: @options[:path_inc], prefix: '', template: TEMPLATE_INC, inc: :inc, boilerplate: @options[:boilerplates][:inc] }, +- { ext: '.c', path: @options[:path_tst], prefix: prefix, template: TEMPLATE_TST, inc: :tst, boilerplate: @options[:boilerplates][:tst] }] +- +- # prepare the pattern for use +- pattern = (pattern || @options[:pattern] || 'src').downcase +- patterns = @patterns[pattern] +- raise "ERROR: The design pattern '#{pattern}' specified isn't one that I recognize!" if patterns.nil? +- +- # single file patterns (currently just 'test') can reject the other parts of the triad +- triad.select! { |v| v[:inc] == :tst } if pattern == 'test' +- +- # Assemble the path/names of the files we need to work with. +- files = [] +- triad.each do |cfg| +- patterns.each_pair do |pattern_file, pattern_traits| +- submodule_name = create_filename(module_name, pattern_file) +- filename = cfg[:prefix] + submodule_name + cfg[:ext] +- files << { +- path: (Pathname.new("#{cfg[:path]}#{subfolder}") + filename).cleanpath, +- name: submodule_name, +- template: cfg[:template], +- boilerplate: cfg[:boilerplate], +- includes: case (cfg[:inc]) +- when :src then (@options[:includes][:src] || []) | (pattern_traits[:inc].map { |f| format(f, module_name) }) +- when :inc then (@options[:includes][:inc] || []) +- when :tst then (@options[:includes][:tst] || []) | (pattern_traits[:inc].map { |f| format("#{@options[:mock_prefix]}#{f}", module_name) }) +- end +- } +- end +- end +- +- files +- end +- +- ############################ +- def neutralize_filename(name, start_cap=true) +- return name if name.empty? +- name = name.split(/(?:\s+|_|(?=[A-Z][a-z]))|(?<=[a-z])(?=[A-Z])/).map{|v|v.capitalize}.join('_') +- if start_cap +- return name +- else +- return name[0].downcase + name[1..-1] +- end +- end +- +- ############################ +- def create_filename(part1, part2 = '') +- name = part2.empty? ? part1 : part1 + '_' + part2 +- case (@options[:naming]) +- when 'bumpy' then neutralize_filename(name,false).gsub('_','') +- when 'camel' then neutralize_filename(name).gsub('_','') +- when 'snake' then neutralize_filename(name).downcase +- when 'caps' then neutralize_filename(name).upcase +- else name +- end +- end +- +- ############################ +- def generate(module_name, pattern = nil) +- files = files_to_operate_on(module_name, pattern) +- +- # Abort if all of the module files already exist +- all_files_exist = true +- files.each do |file| +- all_files_exist = false unless File.exist?(file[:path]) +- end +- raise "ERROR: File #{files[0][:name]} already exists. Exiting." if all_files_exist +- +- # Create Source Modules +- files.each_with_index do |file, _i| +- # If this file already exists, don't overwrite it. +- if File.exist?(file[:path]) +- puts "File #{file[:path]} already exists!" +- next +- end +- # Create the path first if necessary. +- FileUtils.mkdir_p(File.dirname(file[:path]), verbose: false) +- File.open(file[:path], 'w') do |f| +- f.write("#{file[:boilerplate]}\n" % [file[:name]]) unless file[:boilerplate].nil? +- f.write(file[:template] % [file[:name], +- file[:includes].map { |ff| "#include \"#{ff}\"\n" }.join, +- file[:name].upcase.gsub(/-/, '_'), +- file[:name].gsub(/-/, '_')]) +- end +- if @options[:update_svn] +- `svn add \"#{file[:path]}\"` +- if $!.exitstatus.zero? +- puts "File #{file[:path]} created and added to source control" +- else +- puts "File #{file[:path]} created but FAILED adding to source control!" +- end +- else +- puts "File #{file[:path]} created" +- end +- end +- puts 'Generate Complete' +- end +- +- ############################ +- def destroy(module_name, pattern = nil) +- files_to_operate_on(module_name, pattern).each do |filespec| +- file = filespec[:path] +- if File.exist?(file) +- if @options[:update_svn] +- `svn delete \"#{file}\" --force` +- puts "File #{file} deleted and removed from source control" +- else +- FileUtils.remove(file) +- puts "File #{file} deleted" +- end +- else +- puts "File #{file} does not exist so cannot be removed." +- end +- end +- puts 'Destroy Complete' +- end +-end +- +-############################ +-# Handle As Command Line If Called That Way +-if $0 == __FILE__ +- destroy = false +- options = {} +- module_name = nil +- +- # Parse the command line parameters. +- ARGV.each do |arg| +- case arg +- when /^-d/ then destroy = true +- when /^-u/ then options[:update_svn] = true +- when /^-p\"?(\w+)\"?/ then options[:pattern] = Regexp.last_match(1) +- when /^-s\"?(.+)\"?/ then options[:path_src] = Regexp.last_match(1) +- when /^-i\"?(.+)\"?/ then options[:path_inc] = Regexp.last_match(1) +- when /^-t\"?(.+)\"?/ then options[:path_tst] = Regexp.last_match(1) +- when /^-n\"?(.+)\"?/ then options[:naming] = Regexp.last_match(1) +- when /^-y\"?(.+)\"?/ then options = UnityModuleGenerator.grab_config(Regexp.last_match(1)) +- when /^(\w+)/ +- raise "ERROR: You can't have more than one Module name specified!" unless module_name.nil? +- +- module_name = arg +- when /^-(h|-help)/ +- ARGV = [].freeze +- else +- raise "ERROR: Unknown option specified '#{arg}'" +- end +- end +- +- unless ARGV[0] +- puts ["\nGENERATE MODULE\n-------- ------", +- "\nUsage: ruby generate_module [options] module_name", +- " -i\"include\" sets the path to output headers to 'include' (DEFAULT ../src)", +- " -s\"../src\" sets the path to output source to '../src' (DEFAULT ../src)", +- " -t\"C:/test\" sets the path to output source to 'C:/test' (DEFAULT ../test)", +- ' -p"MCH" sets the output pattern to MCH.', +- ' dh - driver hardware.', +- ' dih - driver interrupt hardware.', +- ' mch - model conductor hardware.', +- ' mvp - model view presenter.', +- ' src - just a source module, header and test. (DEFAULT)', +- ' test - just a test file.', +- ' -d destroy module instead of creating it.', +- ' -n"camel" sets the file naming convention.', +- ' bumpy - BumpyCaseFilenames.', +- ' camel - camelCaseFilenames.', +- ' snake - snake_case_filenames.', +- ' caps - CAPS_CASE_FILENAMES.', +- ' -u update subversion too (requires subversion command line)', +- ' -y"my.yml" selects a different yaml config file for module generation', +- ''].join("\n") +- exit +- end +- +- raise 'ERROR: You must have a Module name specified! (use option -h for help)' if module_name.nil? +- +- if destroy +- UnityModuleGenerator.new(options).destroy(module_name) +- else +- UnityModuleGenerator.new(options).generate(module_name) +- end +- +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/generate_test_runner.rb b/components/testframework/libs/cmock/vendor/unity/auto/generate_test_runner.rb +deleted file mode 100644 +index def615df75..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/generate_test_runner.rb ++++ /dev/null +@@ -1,511 +0,0 @@ +-# ========================================== +-# 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] +-# ========================================== +- +-class UnityTestRunnerGenerator +- def initialize(options = nil) +- @options = UnityTestRunnerGenerator.default_options +- case options +- when NilClass +- @options +- when String +- @options.merge!(UnityTestRunnerGenerator.grab_config(options)) +- when Hash +- # Check if some of these have been specified +- @options[:has_setup] = !options[:setup_name].nil? +- @options[:has_teardown] = !options[:teardown_name].nil? +- @options[:has_suite_setup] = !options[:suite_setup].nil? +- @options[:has_suite_teardown] = !options[:suite_teardown].nil? +- @options.merge!(options) +- else +- raise 'If you specify arguments, it should be a filename or a hash of options' +- end +- require_relative 'type_sanitizer' +- end +- +- def self.default_options +- { +- includes: [], +- defines: [], +- plugins: [], +- framework: :unity, +- test_prefix: 'test|spec|should', +- mock_prefix: 'Mock', +- mock_suffix: '', +- setup_name: 'setUp', +- teardown_name: 'tearDown', +- test_reset_name: 'resetTest', +- test_verify_name: 'verifyTest', +- main_name: 'main', # set to :auto to automatically generate each time +- main_export_decl: '', +- cmdline_args: false, +- omit_begin_end: false, +- use_param_tests: false, +- include_extensions: '(?:hpp|hh|H|h)', +- source_extensions: '(?:cpp|cc|ino|C|c)' +- } +- end +- +- def self.grab_config(config_file) +- options = default_options +- unless config_file.nil? || config_file.empty? +- require 'yaml' +- yaml_guts = YAML.load_file(config_file) +- options.merge!(yaml_guts[:unity] || yaml_guts[:cmock]) +- raise "No :unity or :cmock section found in #{config_file}" unless options +- end +- options +- end +- +- def run(input_file, output_file, options = nil) +- @options.merge!(options) unless options.nil? +- +- # pull required data from source file +- source = File.read(input_file) +- source = source.force_encoding('ISO-8859-1').encode('utf-8', replace: nil) +- tests = find_tests(source) +- headers = find_includes(source) +- testfile_includes = (headers[:local] + headers[:system]) +- used_mocks = find_mocks(testfile_includes) +- testfile_includes = (testfile_includes - used_mocks) +- testfile_includes.delete_if { |inc| inc =~ /(unity|cmock)/ } +- find_setup_and_teardown(source) +- +- # build runner file +- generate(input_file, output_file, tests, used_mocks, testfile_includes) +- +- # determine which files were used to return them +- all_files_used = [input_file, output_file] +- all_files_used += testfile_includes.map { |filename| filename + '.c' } unless testfile_includes.empty? +- all_files_used += @options[:includes] unless @options[:includes].empty? +- all_files_used += headers[:linkonly] unless headers[:linkonly].empty? +- all_files_used.uniq +- end +- +- def generate(input_file, output_file, tests, used_mocks, testfile_includes) +- File.open(output_file, 'w') do |output| +- create_header(output, used_mocks, testfile_includes) +- create_externs(output, tests, used_mocks) +- create_mock_management(output, used_mocks) +- create_setup(output) +- create_teardown(output) +- create_suite_setup(output) +- create_suite_teardown(output) +- create_reset(output) +- create_run_test(output) unless tests.empty? +- create_args_wrappers(output, tests) +- create_main(output, input_file, tests, used_mocks) +- end +- +- return unless @options[:header_file] && !@options[:header_file].empty? +- +- File.open(@options[:header_file], 'w') do |output| +- create_h_file(output, @options[:header_file], tests, testfile_includes, used_mocks) +- end +- end +- +- def find_tests(source) +- tests_and_line_numbers = [] +- +- # contains characters which will be substituted from within strings, doing +- # this prevents these characters from interfering with scrubbers +- # @ is not a valid C character, so there should be no clashes with files genuinely containing these markers +- substring_subs = { '{' => '@co@', '}' => '@cc@', ';' => '@ss@', '/' => '@fs@' } +- substring_re = Regexp.union(substring_subs.keys) +- substring_unsubs = substring_subs.invert # the inverse map will be used to fix the strings afterwords +- substring_unsubs['@quote@'] = '\\"' +- substring_unsubs['@apos@'] = '\\\'' +- substring_unre = Regexp.union(substring_unsubs.keys) +- source_scrubbed = source.clone +- source_scrubbed = source_scrubbed.gsub(/\\"/, '@quote@') # hide escaped quotes to allow capture of the full string/char +- source_scrubbed = source_scrubbed.gsub(/\\'/, '@apos@') # hide escaped apostrophes to allow capture of the full string/char +- source_scrubbed = source_scrubbed.gsub(/("[^"\n]*")|('[^'\n]*')/) { |s| s.gsub(substring_re, substring_subs) } # temporarily hide problematic characters within strings +- source_scrubbed = source_scrubbed.gsub(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks +- source_scrubbed = source_scrubbed.gsub(/\/\*.*?\*\//m, '') # remove block comments +- source_scrubbed = source_scrubbed.gsub(/\/\/.*$/, '') # remove line comments (all that remain) +- lines = source_scrubbed.split(/(^\s*\#.*$) | (;|\{|\}) /x) # Treat preprocessor directives as a logical line. Match ;, {, and } as end of lines +- .map { |line| line.gsub(substring_unre, substring_unsubs) } # unhide the problematic characters previously removed +- +- lines.each_with_index do |line, _index| +- # find tests +- next unless line =~ /^((?:\s*(?:TEST_CASE|TEST_RANGE)\s*\(.*?\)\s*)*)\s*void\s+((?:#{@options[:test_prefix]}).*)\s*\(\s*(.*)\s*\)/m +- +- arguments = Regexp.last_match(1) +- name = Regexp.last_match(2) +- call = Regexp.last_match(3) +- params = Regexp.last_match(4) +- args = nil +- +- if @options[:use_param_tests] && !arguments.empty? +- args = [] +- arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) { |a| args << a[0] } +- +- arguments.scan(/\s*TEST_RANGE\s*\((.*)\)\s*$/).flatten.each do |range_str| +- args += range_str.scan(/\[(-?\d+.?\d*), *(-?\d+.?\d*), *(-?\d+.?\d*)\]/).map do |arg_values_str| +- arg_values_str.map do |arg_value_str| +- arg_value_str.include?('.') ? arg_value_str.to_f : arg_value_str.to_i +- end +- end.map do |arg_values| +- (arg_values[0]..arg_values[1]).step(arg_values[2]).to_a +- end.reduce do |result, arg_range_expanded| +- result.product(arg_range_expanded) +- end.map do |arg_combinations| +- arg_combinations.flatten.join(', ') +- end +- end +- end +- +- tests_and_line_numbers << { test: name, args: args, call: call, params: params, line_number: 0 } +- end +- +- tests_and_line_numbers.uniq! { |v| v[:test] } +- +- # determine line numbers and create tests to run +- source_lines = source.split("\n") +- source_index = 0 +- tests_and_line_numbers.size.times do |i| +- source_lines[source_index..-1].each_with_index do |line, index| +- next unless line =~ /\s+#{tests_and_line_numbers[i][:test]}(?:\s|\()/ +- +- source_index += index +- tests_and_line_numbers[i][:line_number] = source_index + 1 +- break +- end +- end +- +- tests_and_line_numbers +- end +- +- def find_includes(source) +- # remove comments (block and line, in three steps to ensure correct precedence) +- source.gsub!(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks +- source.gsub!(/\/\*.*?\*\//m, '') # remove block comments +- source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain) +- +- # parse out includes +- includes = { +- local: source.scan(/^\s*#include\s+\"\s*(.+\.#{@options[:include_extensions]})\s*\"/).flatten, +- system: source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" }, +- linkonly: source.scan(/^TEST_FILE\(\s*\"\s*(.+\.#{@options[:source_extensions]})\s*\"/).flatten +- } +- includes +- end +- +- def find_mocks(includes) +- mock_headers = [] +- includes.each do |include_path| +- include_file = File.basename(include_path) +- mock_headers << include_path if include_file =~ /^#{@options[:mock_prefix]}.*#{@options[:mock_suffix]}$/i +- end +- mock_headers +- end +- +- def find_setup_and_teardown(source) +- @options[:has_setup] = source =~ /void\s+#{@options[:setup_name]}\s*\(/ +- @options[:has_teardown] = source =~ /void\s+#{@options[:teardown_name]}\s*\(/ +- @options[:has_suite_setup] ||= (source =~ /void\s+suiteSetUp\s*\(/) +- @options[:has_suite_teardown] ||= (source =~ /void\s+suiteTearDown\s*\(/) +- end +- +- def create_header(output, mocks, testfile_includes = []) +- output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') +- output.puts("\n/*=======Automagically Detected Files To Include=====*/") +- output.puts("#include \"#{@options[:framework]}.h\"") +- output.puts('#include "cmock.h"') unless mocks.empty? +- if @options[:defines] && !@options[:defines].empty? +- @options[:defines].each { |d| output.puts("#ifndef #{d}\n#define #{d}\n#endif /* #{d} */") } +- end +- if @options[:header_file] && !@options[:header_file].empty? +- output.puts("#include \"#{File.basename(@options[:header_file])}\"") +- else +- @options[:includes].flatten.uniq.compact.each do |inc| +- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") +- end +- testfile_includes.each do |inc| +- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") +- end +- end +- mocks.each do |mock| +- output.puts("#include \"#{mock}\"") +- end +- output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception) +- +- return unless @options[:enforce_strict_ordering] +- +- output.puts('') +- output.puts('int GlobalExpectCount;') +- output.puts('int GlobalVerifyOrder;') +- output.puts('char* GlobalOrderError;') +- end +- +- def create_externs(output, tests, _mocks) +- output.puts("\n/*=======External Functions This Runner Calls=====*/") +- output.puts("extern void #{@options[:setup_name]}(void);") +- output.puts("extern void #{@options[:teardown_name]}(void);") +- output.puts("\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif") if @options[:externc] +- tests.each do |test| +- output.puts("extern void #{test[:test]}(#{test[:call] || 'void'});") +- end +- output.puts("#ifdef __cplusplus\n}\n#endif") if @options[:externc] +- output.puts('') +- end +- +- def create_mock_management(output, mock_headers) +- output.puts("\n/*=======Mock Management=====*/") +- output.puts('static void CMock_Init(void)') +- output.puts('{') +- +- if @options[:enforce_strict_ordering] +- output.puts(' GlobalExpectCount = 0;') +- output.puts(' GlobalVerifyOrder = 0;') +- output.puts(' GlobalOrderError = NULL;') +- end +- +- mocks = mock_headers.map { |mock| File.basename(mock, '.*') } +- mocks.each do |mock| +- mock_clean = TypeSanitizer.sanitize_c_identifier(mock) +- output.puts(" #{mock_clean}_Init();") +- end +- output.puts("}\n") +- +- output.puts('static void CMock_Verify(void)') +- output.puts('{') +- mocks.each do |mock| +- mock_clean = TypeSanitizer.sanitize_c_identifier(mock) +- output.puts(" #{mock_clean}_Verify();") +- end +- output.puts("}\n") +- +- output.puts('static void CMock_Destroy(void)') +- output.puts('{') +- mocks.each do |mock| +- mock_clean = TypeSanitizer.sanitize_c_identifier(mock) +- output.puts(" #{mock_clean}_Destroy();") +- end +- output.puts("}\n") +- end +- +- def create_setup(output) +- return if @options[:has_setup] +- +- output.puts("\n/*=======Setup (stub)=====*/") +- output.puts("void #{@options[:setup_name]}(void) {}") +- end +- +- def create_teardown(output) +- return if @options[:has_teardown] +- +- output.puts("\n/*=======Teardown (stub)=====*/") +- output.puts("void #{@options[:teardown_name]}(void) {}") +- end +- +- def create_suite_setup(output) +- return if @options[:suite_setup].nil? +- +- output.puts("\n/*=======Suite Setup=====*/") +- output.puts('void suiteSetUp(void)') +- output.puts('{') +- output.puts(@options[:suite_setup]) +- output.puts('}') +- end +- +- def create_suite_teardown(output) +- return if @options[:suite_teardown].nil? +- +- output.puts("\n/*=======Suite Teardown=====*/") +- output.puts('int suiteTearDown(int num_failures)') +- output.puts('{') +- output.puts(@options[:suite_teardown]) +- output.puts('}') +- end +- +- def create_reset(output) +- output.puts("\n/*=======Test Reset Options=====*/") +- output.puts("void #{@options[:test_reset_name]}(void);") +- output.puts("void #{@options[:test_reset_name]}(void)") +- output.puts('{') +- output.puts(" #{@options[:teardown_name]}();") +- output.puts(' CMock_Verify();') +- output.puts(' CMock_Destroy();') +- output.puts(' CMock_Init();') +- output.puts(" #{@options[:setup_name]}();") +- output.puts('}') +- output.puts("void #{@options[:test_verify_name]}(void);") +- output.puts("void #{@options[:test_verify_name]}(void)") +- output.puts('{') +- output.puts(' CMock_Verify();') +- output.puts('}') +- end +- +- def create_run_test(output) +- require 'erb' +- template = ERB.new(File.read(File.join(__dir__, 'run_test.erb')), nil, '<>') +- output.puts("\n" + template.result(binding)) +- end +- +- def create_args_wrappers(output, tests) +- return unless @options[:use_param_tests] +- +- output.puts("\n/*=======Parameterized Test Wrappers=====*/") +- tests.each do |test| +- next if test[:args].nil? || test[:args].empty? +- +- test[:args].each.with_index(1) do |args, idx| +- output.puts("static void runner_args#{idx}_#{test[:test]}(void)") +- output.puts('{') +- output.puts(" #{test[:test]}(#{args});") +- output.puts("}\n") +- end +- end +- end +- +- def create_main(output, filename, tests, used_mocks) +- output.puts("\n/*=======MAIN=====*/") +- main_name = @options[:main_name].to_sym == :auto ? "main_#{filename.gsub('.c', '')}" : (@options[:main_name]).to_s +- if @options[:cmdline_args] +- if main_name != 'main' +- output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv);") +- end +- output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv)") +- output.puts('{') +- output.puts(' int parse_status = UnityParseOptions(argc, argv);') +- output.puts(' if (parse_status != 0)') +- output.puts(' {') +- output.puts(' if (parse_status < 0)') +- output.puts(' {') +- output.puts(" UnityPrint(\"#{filename.gsub('.c', '')}.\");") +- output.puts(' UNITY_PRINT_EOL();') +- tests.each do |test| +- if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty? +- output.puts(" UnityPrint(\" #{test[:test]}\");") +- output.puts(' UNITY_PRINT_EOL();') +- else +- test[:args].each do |args| +- output.puts(" UnityPrint(\" #{test[:test]}(#{args})\");") +- output.puts(' UNITY_PRINT_EOL();') +- end +- end +- end +- output.puts(' return 0;') +- output.puts(' }') +- output.puts(' return parse_status;') +- output.puts(' }') +- else +- main_return = @options[:omit_begin_end] ? 'void' : 'int' +- if main_name != 'main' +- output.puts("#{@options[:main_export_decl]} #{main_return} #{main_name}(void);") +- end +- output.puts("#{main_return} #{main_name}(void)") +- output.puts('{') +- end +- output.puts(' suiteSetUp();') if @options[:has_suite_setup] +- if @options[:omit_begin_end] +- output.puts(" UnitySetTestFile(\"#{filename.gsub(/\\/, '\\\\\\')}\");") +- else +- output.puts(" UnityBegin(\"#{filename.gsub(/\\/, '\\\\\\')}\");") +- end +- tests.each do |test| +- if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty? +- output.puts(" run_test(#{test[:test]}, \"#{test[:test]}\", #{test[:line_number]});") +- else +- test[:args].each.with_index(1) do |args, idx| +- wrapper = "runner_args#{idx}_#{test[:test]}" +- testname = "#{test[:test]}(#{args})".dump +- output.puts(" run_test(#{wrapper}, #{testname}, #{test[:line_number]});") +- end +- end +- end +- output.puts +- output.puts(' CMock_Guts_MemFreeFinal();') unless used_mocks.empty? +- if @options[:has_suite_teardown] +- if @options[:omit_begin_end] +- output.puts(' (void) suite_teardown(0);') +- else +- output.puts(' return suiteTearDown(UnityEnd());') +- end +- else +- output.puts(' return UnityEnd();') unless @options[:omit_begin_end] +- end +- output.puts('}') +- end +- +- def create_h_file(output, filename, tests, testfile_includes, used_mocks) +- filename = File.basename(filename).gsub(/[-\/\\\.\,\s]/, '_').upcase +- output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */') +- output.puts("#ifndef _#{filename}") +- output.puts("#define _#{filename}\n\n") +- output.puts("#include \"#{@options[:framework]}.h\"") +- output.puts('#include "cmock.h"') unless used_mocks.empty? +- @options[:includes].flatten.uniq.compact.each do |inc| +- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") +- end +- testfile_includes.each do |inc| +- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}") +- end +- output.puts "\n" +- tests.each do |test| +- if test[:params].nil? || test[:params].empty? +- output.puts("void #{test[:test]}(void);") +- else +- output.puts("void #{test[:test]}(#{test[:params]});") +- end +- end +- output.puts("#endif\n\n") +- end +-end +- +-if $0 == __FILE__ +- options = { includes: [] } +- +- # parse out all the options first (these will all be removed as we go) +- ARGV.reject! do |arg| +- case arg +- when '-cexception' +- options[:plugins] = [:cexception] +- true +- when /\.*\.ya?ml$/ +- options = UnityTestRunnerGenerator.grab_config(arg) +- true +- when /--(\w+)=\"?(.*)\"?/ +- options[Regexp.last_match(1).to_sym] = Regexp.last_match(2) +- true +- when /\.*\.(?:hpp|hh|H|h)$/ +- options[:includes] << arg +- true +- else false +- end +- end +- +- # make sure there is at least one parameter left (the input file) +- unless ARGV[0] +- puts ["\nusage: ruby #{__FILE__} (files) (options) input_test_file (output)", +- "\n input_test_file - this is the C file you want to create a runner for", +- ' output - this is the name of the runner file to generate', +- ' defaults to (input_test_file)_Runner', +- ' files:', +- ' *.yml / *.yaml - loads configuration from here in :unity or :cmock', +- ' *.h - header files are added as #includes in runner', +- ' options:', +- ' -cexception - include cexception support', +- ' -externc - add extern "C" for cpp support', +- ' --setup_name="" - redefine setUp func name to something else', +- ' --teardown_name="" - redefine tearDown func name to something else', +- ' --main_name="" - redefine main func name to something else', +- ' --test_prefix="" - redefine test prefix from default test|spec|should', +- ' --test_reset_name="" - redefine resetTest func name to something else', +- ' --test_verify_name="" - redefine verifyTest func name to something else', +- ' --suite_setup="" - code to execute for setup of entire suite', +- ' --suite_teardown="" - code to execute for teardown of entire suite', +- ' --use_param_tests=1 - enable parameterized tests (disabled by default)', +- ' --omit_begin_end=1 - omit calls to UnityBegin and UnityEnd (disabled by default)', +- ' --header_file="" - path/name of test header file to generate too'].join("\n") +- exit 1 +- end +- +- # create the default test runner name if not specified +- ARGV[1] = ARGV[0].gsub('.c', '_Runner.c') unless ARGV[1] +- +- UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1]) +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/parse_output.rb b/components/testframework/libs/cmock/vendor/unity/auto/parse_output.rb +deleted file mode 100644 +index d72c6e8b2e..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/parse_output.rb ++++ /dev/null +@@ -1,322 +0,0 @@ +-#============================================================ +-# Author: John Theofanopoulos +-# A simple parser. Takes the output files generated during the +-# build process and extracts information relating to the tests. +-# +-# Notes: +-# To capture an output file under VS builds use the following: +-# devenv [build instructions] > Output.txt & type Output.txt +-# +-# To capture an output file under Linux builds use the following: +-# make | tee Output.txt +-# +-# This script can handle the following output formats: +-# - normal output (raw unity) +-# - fixture output (unity_fixture.h/.c) +-# - fixture output with verbose flag set ("-v") +-# +-# To use this parser use the following command +-# ruby parseOutput.rb [options] [file] +-# options: -xml : produce a JUnit compatible XML file +-# file: file to scan for results +-#============================================================ +- +-# Parser class for handling the input file +-class ParseOutput +- def initialize +- # internal data +- @class_name_idx = 0 +- @path_delim = nil +- +- # xml output related +- @xml_out = false +- @array_list = false +- +- # current suite name and statistics +- @test_suite = nil +- @total_tests = 0 +- @test_passed = 0 +- @test_failed = 0 +- @test_ignored = 0 +- end +- +- # Set the flag to indicate if there will be an XML output file or not +- def set_xml_output +- @xml_out = true +- end +- +- # If write our output to XML +- def write_xml_output +- output = File.open('report.xml', 'w') +- output << "\n" +- @array_list.each do |item| +- output << item << "\n" +- end +- end +- +- # Pushes the suite info as xml to the array list, which will be written later +- def push_xml_output_suite_info +- # Insert opening tag at front +- heading = '' +- @array_list.insert(0, heading) +- # Push back the closing tag +- @array_list.push '' +- end +- +- # Pushes xml output data to the array list, which will be written later +- def push_xml_output_passed(test_name) +- @array_list.push ' ' +- end +- +- # Pushes xml output data to the array list, which will be written later +- def push_xml_output_failed(test_name, reason) +- @array_list.push ' ' +- @array_list.push ' ' + reason + '' +- @array_list.push ' ' +- end +- +- # Pushes xml output data to the array list, which will be written later +- def push_xml_output_ignored(test_name, reason) +- @array_list.push ' ' +- @array_list.push ' ' + reason + '' +- @array_list.push ' ' +- end +- +- # This function will try and determine when the suite is changed. This is +- # is the name that gets added to the classname parameter. +- def test_suite_verify(test_suite_name) +- # Split the path name +- test_name = test_suite_name.split(@path_delim) +- +- # Remove the extension and extract the base_name +- base_name = test_name[test_name.size - 1].split('.')[0] +- +- # Return if the test suite hasn't changed +- return unless base_name.to_s != @test_suite.to_s +- +- @test_suite = base_name +- printf "New Test: %s\n", @test_suite +- end +- +- # Prepares the line for verbose fixture output ("-v") +- def prepare_fixture_line(line) +- line = line.sub('IGNORE_TEST(', '') +- line = line.sub('TEST(', '') +- line = line.sub(')', ',') +- line = line.chomp +- array = line.split(',') +- array.map { |x| x.to_s.lstrip.chomp } +- end +- +- # Test was flagged as having passed so format the output. +- # This is using the Unity fixture output and not the original Unity output. +- def test_passed_unity_fixture(array) +- class_name = array[0] +- test_name = array[1] +- test_suite_verify(class_name) +- printf "%-40s PASS\n", test_name +- +- push_xml_output_passed(test_name) if @xml_out +- end +- +- # Test was flagged as having failed so format the output. +- # This is using the Unity fixture output and not the original Unity output. +- def test_failed_unity_fixture(array) +- class_name = array[0] +- test_name = array[1] +- test_suite_verify(class_name) +- reason_array = array[2].split(':') +- reason = reason_array[-1].lstrip.chomp + ' at line: ' + reason_array[-4] +- +- printf "%-40s FAILED\n", test_name +- +- push_xml_output_failed(test_name, reason) if @xml_out +- end +- +- # Test was flagged as being ignored so format the output. +- # This is using the Unity fixture output and not the original Unity output. +- def test_ignored_unity_fixture(array) +- class_name = array[0] +- test_name = array[1] +- reason = 'No reason given' +- if array.size > 2 +- reason_array = array[2].split(':') +- tmp_reason = reason_array[-1].lstrip.chomp +- reason = tmp_reason == 'IGNORE' ? 'No reason given' : tmp_reason +- end +- test_suite_verify(class_name) +- printf "%-40s IGNORED\n", test_name +- +- push_xml_output_ignored(test_name, reason) if @xml_out +- end +- +- # Test was flagged as having passed so format the output +- def test_passed(array) +- last_item = array.length - 1 +- test_name = array[last_item - 1] +- test_suite_verify(array[@class_name_idx]) +- printf "%-40s PASS\n", test_name +- +- return unless @xml_out +- +- push_xml_output_passed(test_name) if @xml_out +- end +- +- # Test was flagged as having failed so format the line +- def test_failed(array) +- last_item = array.length - 1 +- test_name = array[last_item - 2] +- reason = array[last_item].chomp.lstrip + ' at line: ' + array[last_item - 3] +- class_name = array[@class_name_idx] +- +- if test_name.start_with? 'TEST(' +- array2 = test_name.split(' ') +- +- test_suite = array2[0].sub('TEST(', '') +- test_suite = test_suite.sub(',', '') +- class_name = test_suite +- +- test_name = array2[1].sub(')', '') +- end +- +- test_suite_verify(class_name) +- printf "%-40s FAILED\n", test_name +- +- push_xml_output_failed(test_name, reason) if @xml_out +- end +- +- # Test was flagged as being ignored so format the output +- def test_ignored(array) +- last_item = array.length - 1 +- test_name = array[last_item - 2] +- reason = array[last_item].chomp.lstrip +- class_name = array[@class_name_idx] +- +- if test_name.start_with? 'TEST(' +- array2 = test_name.split(' ') +- +- test_suite = array2[0].sub('TEST(', '') +- test_suite = test_suite.sub(',', '') +- class_name = test_suite +- +- test_name = array2[1].sub(')', '') +- end +- +- test_suite_verify(class_name) +- printf "%-40s IGNORED\n", test_name +- +- push_xml_output_ignored(test_name, reason) if @xml_out +- end +- +- # Adjusts the os specific members according to the current path style +- # (Windows or Unix based) +- def detect_os_specifics(line) +- if line.include? '\\' +- # Windows X:\Y\Z +- @class_name_idx = 1 +- @path_delim = '\\' +- else +- # Unix Based /X/Y/Z +- @class_name_idx = 0 +- @path_delim = '/' +- end +- end +- +- # Main function used to parse the file that was captured. +- def process(file_name) +- @array_list = [] +- +- puts 'Parsing file: ' + file_name +- +- @test_passed = 0 +- @test_failed = 0 +- @test_ignored = 0 +- puts '' +- puts '=================== RESULTS =====================' +- puts '' +- File.open(file_name).each do |line| +- # Typical test lines look like these: +- # ---------------------------------------------------- +- # 1. normal output: +- # /.c:36:test_tc1000_opsys:FAIL: Expected 1 Was 0 +- # /.c:112:test_tc5004_initCanChannel:IGNORE: Not Yet Implemented +- # /.c:115:test_tc5100_initCanVoidPtrs:PASS +- # +- # 2. fixture output +- # /.c:63:TEST(, ):FAIL: Expected 0x00001234 Was 0x00005A5A +- # /.c:36:TEST(, ):IGNORE +- # Note: "PASS" information won't be generated in this mode +- # +- # 3. fixture output with verbose information ("-v") +- # TEST()/:168::FAIL: Expected 0x8D Was 0x8C +- # TEST(, )/:22::IGNORE: This Test Was Ignored On Purpose +- # IGNORE_TEST() +- # TEST() PASS +- # +- # Note: Where path is different on Unix vs Windows devices (Windows leads with a drive letter)! +- detect_os_specifics(line) +- line_array = line.split(':') +- +- # If we were able to split the line then we can look to see if any of our target words +- # were found. Case is important. +- next unless (line_array.size >= 4) || (line.start_with? 'TEST(') || (line.start_with? 'IGNORE_TEST(') +- +- # check if the output is fixture output (with verbose flag "-v") +- if (line.start_with? 'TEST(') || (line.start_with? 'IGNORE_TEST(') +- line_array = prepare_fixture_line(line) +- if line.include? ' PASS' +- test_passed_unity_fixture(line_array) +- @test_passed += 1 +- elsif line.include? 'FAIL' +- test_failed_unity_fixture(line_array) +- @test_failed += 1 +- elsif line.include? 'IGNORE' +- test_ignored_unity_fixture(line_array) +- @test_ignored += 1 +- end +- # normal output / fixture output (without verbose "-v") +- elsif line.include? ':PASS' +- test_passed(line_array) +- @test_passed += 1 +- elsif line.include? ':FAIL' +- test_failed(line_array) +- @test_failed += 1 +- elsif line.include? ':IGNORE:' +- test_ignored(line_array) +- @test_ignored += 1 +- elsif line.include? ':IGNORE' +- line_array.push('No reason given') +- test_ignored(line_array) +- @test_ignored += 1 +- end +- @total_tests = @test_passed + @test_failed + @test_ignored +- end +- puts '' +- puts '=================== SUMMARY =====================' +- puts '' +- puts 'Tests Passed : ' + @test_passed.to_s +- puts 'Tests Failed : ' + @test_failed.to_s +- puts 'Tests Ignored : ' + @test_ignored.to_s +- +- return unless @xml_out +- +- # push information about the suite +- push_xml_output_suite_info +- # write xml output file +- write_xml_output +- end +-end +- +-# If the command line has no values in, used a default value of Output.txt +-parse_my_file = ParseOutput.new +- +-if ARGV.size >= 1 +- ARGV.each do |arg| +- if arg == '-xml' +- parse_my_file.set_xml_output +- else +- parse_my_file.process(arg) +- break +- end +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/run_test.erb b/components/testframework/libs/cmock/vendor/unity/auto/run_test.erb +deleted file mode 100644 +index cb7f2b5091..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/run_test.erb ++++ /dev/null +@@ -1,37 +0,0 @@ +-/*=======Test Runner Used To Run Each Test=====*/ +-static void run_test(UnityTestFunction func, const char* name, int line_num) +-{ +- Unity.CurrentTestName = name; +- Unity.CurrentTestLineNumber = line_num; +-#ifdef UNITY_USE_COMMAND_LINE_ARGS +- if (!UnityTestMatches()) +- return; +-#endif +- Unity.NumberOfTests++; +- UNITY_CLR_DETAILS(); +- UNITY_EXEC_TIME_START(); +- CMock_Init(); +- if (TEST_PROTECT()) +- { +-<% if @options[:plugins].include?(:cexception) %> +- CEXCEPTION_T e; +- Try { +- <%= @options[:setup_name] %>(); +- func(); +- } Catch(e) { +- TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); +- } +-<% else %> +- <%= @options[:setup_name] %>(); +- func(); +-<% end %> +- } +- if (TEST_PROTECT()) +- { +- <%= @options[:teardown_name] %>(); +- CMock_Verify(); +- } +- CMock_Destroy(); +- UNITY_EXEC_TIME_STOP(); +- UnityConcludeTest(); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/stylize_as_junit.rb b/components/testframework/libs/cmock/vendor/unity/auto/stylize_as_junit.rb +deleted file mode 100755 +index e01f7912a3..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/stylize_as_junit.rb ++++ /dev/null +@@ -1,251 +0,0 @@ +-#!/usr/bin/ruby +-# +-# unity_to_junit.rb +-# +-require 'fileutils' +-require 'optparse' +-require 'ostruct' +-require 'set' +- +-require 'pp' +- +-VERSION = 1.0 +- +-class ArgvParser +- # +- # Return a structure describing the options. +- # +- def self.parse(args) +- # The options specified on the command line will be collected in *options*. +- # We set default values here. +- options = OpenStruct.new +- options.results_dir = '.' +- options.root_path = '.' +- options.out_file = 'results.xml' +- +- opts = OptionParser.new do |o| +- o.banner = 'Usage: unity_to_junit.rb [options]' +- +- o.separator '' +- o.separator 'Specific options:' +- +- o.on('-r', '--results ', 'Look for Unity Results files here.') do |results| +- # puts "results #{results}" +- options.results_dir = results +- end +- +- o.on('-p', '--root_path ', 'Prepend this path to files in results.') do |root_path| +- options.root_path = root_path +- end +- +- o.on('-o', '--output ', 'XML file to generate.') do |out_file| +- # puts "out_file: #{out_file}" +- options.out_file = out_file +- end +- +- o.separator '' +- o.separator 'Common options:' +- +- # No argument, shows at tail. This will print an options summary. +- o.on_tail('-h', '--help', 'Show this message') do +- puts o +- exit +- end +- +- # Another typical switch to print the version. +- o.on_tail('--version', 'Show version') do +- puts "unity_to_junit.rb version #{VERSION}" +- exit +- end +- end +- +- opts.parse!(args) +- options +- end +-end +- +-class UnityToJUnit +- include FileUtils::Verbose +- attr_reader :report, :total_tests, :failures, :ignored +- attr_writer :targets, :root, :out_file +- +- def initialize +- @report = '' +- @unit_name = '' +- end +- +- def run +- # Clean up result file names +- results = @targets.map { |target| target.tr('\\', '/') } +- # puts "Output File: #{@out_file}" +- f = File.new(@out_file, 'w') +- write_xml_header(f) +- write_suites_header(f) +- results.each do |result_file| +- lines = File.readlines(result_file).map(&:chomp) +- +- raise "Empty test result file: #{result_file}" if lines.empty? +- +- result_output = get_details(result_file, lines) +- tests, failures, ignored = parse_test_summary(lines) +- result_output[:counts][:total] = tests +- result_output[:counts][:failed] = failures +- result_output[:counts][:ignored] = ignored +- result_output[:counts][:passed] = (result_output[:counts][:total] - result_output[:counts][:failed] - result_output[:counts][:ignored]) +- +- # use line[0] from the test output to get the test_file path and name +- test_file_str = lines[0].tr('\\', '/') +- test_file_str = test_file_str.split(':') +- test_file = if test_file_str.length < 2 +- result_file +- else +- test_file_str[0] + ':' + test_file_str[1] +- end +- result_output[:source][:path] = File.dirname(test_file) +- result_output[:source][:file] = File.basename(test_file) +- +- # save result_output +- @unit_name = File.basename(test_file, '.*') +- +- write_suite_header(result_output[:counts], f) +- write_failures(result_output, f) +- write_tests(result_output, f) +- write_ignored(result_output, f) +- write_suite_footer(f) +- end +- write_suites_footer(f) +- f.close +- end +- +- def usage(err_msg = nil) +- puts "\nERROR: " +- puts err_msg if err_msg +- puts 'Usage: unity_to_junit.rb [options]' +- puts '' +- puts 'Specific options:' +- puts ' -r, --results Look for Unity Results files here.' +- puts ' -p, --root_path Prepend this path to files in results.' +- puts ' -o, --output XML file to generate.' +- puts '' +- puts 'Common options:' +- puts ' -h, --help Show this message' +- puts ' --version Show version' +- +- exit 1 +- end +- +- protected +- +- def get_details(_result_file, lines) +- results = results_structure +- lines.each do |line| +- line = line.tr('\\', '/') +- _src_file, src_line, test_name, status, msg = line.split(/:/) +- case status +- when 'IGNORE' then results[:ignores] << { test: test_name, line: src_line, message: msg } +- when 'FAIL' then results[:failures] << { test: test_name, line: src_line, message: msg } +- when 'PASS' then results[:successes] << { test: test_name, line: src_line, message: msg } +- end +- end +- results +- end +- +- def parse_test_summary(summary) +- raise "Couldn't parse test results: #{summary}" unless summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ } +- +- [Regexp.last_match(1).to_i, Regexp.last_match(2).to_i, Regexp.last_match(3).to_i] +- end +- +- private +- +- def results_structure +- { +- source: { path: '', file: '' }, +- successes: [], +- failures: [], +- ignores: [], +- counts: { total: 0, passed: 0, failed: 0, ignored: 0 }, +- stdout: [] +- } +- end +- +- def write_xml_header(stream) +- stream.puts "" +- end +- +- def write_suites_header(stream) +- stream.puts '' +- end +- +- def write_suite_header(counts, stream) +- stream.puts "\t" +- end +- +- def write_failures(results, stream) +- result = results[:failures] +- result.each do |item| +- filename = File.join(results[:source][:path], File.basename(results[:source][:file], '.*')) +- stream.puts "\t\t" +- stream.puts "\t\t\t" +- stream.puts "\t\t\t [File] #{filename} [Line] #{item[:line]} " +- stream.puts "\t\t" +- end +- end +- +- def write_tests(results, stream) +- result = results[:successes] +- result.each do |item| +- stream.puts "\t\t" +- end +- end +- +- def write_ignored(results, stream) +- result = results[:ignores] +- result.each do |item| +- filename = File.join(results[:source][:path], File.basename(results[:source][:file], '.*')) +- puts "Writing ignored tests for test harness: #{filename}" +- stream.puts "\t\t" +- stream.puts "\t\t\t" +- stream.puts "\t\t\t [File] #{filename} [Line] #{item[:line]} " +- stream.puts "\t\t" +- end +- end +- +- def write_suite_footer(stream) +- stream.puts "\t" +- end +- +- def write_suites_footer(stream) +- stream.puts '' +- end +-end +- +-if $0 == __FILE__ +- # parse out the command options +- options = ArgvParser.parse(ARGV) +- +- # create an instance to work with +- utj = UnityToJUnit.new +- begin +- # look in the specified or current directory for result files +- targets = "#{options.results_dir.tr('\\', '/')}**/*.test*" +- +- results = Dir[targets] +- +- raise "No *.testpass, *.testfail, or *.testresults files found in '#{targets}'" if results.empty? +- +- utj.targets = results +- +- # set the root path +- utj.root = options.root_path +- +- # set the output XML file name +- # puts "Output File from options: #{options.out_file}" +- utj.out_file = options.out_file +- +- # run the summarizer +- puts utj.run +- rescue StandardError => e +- utj.usage e.message +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/test_file_filter.rb b/components/testframework/libs/cmock/vendor/unity/auto/test_file_filter.rb +deleted file mode 100644 +index 5c3a79fc67..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/test_file_filter.rb ++++ /dev/null +@@ -1,25 +0,0 @@ +-# ========================================== +-# 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] +-# ========================================== +- +-require'yaml' +- +-module RakefileHelpers +- class TestFileFilter +- def initialize(all_files = false) +- @all_files = all_files +- +- return unless @all_files +- return unless File.exist?('test_file_filter.yml') +- +- filters = YAML.load_file('test_file_filter.yml') +- @all_files = filters[:all_files] +- @only_files = filters[:only_files] +- @exclude_files = filters[:exclude_files] +- end +- +- attr_accessor :all_files, :only_files, :exclude_files +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/type_sanitizer.rb b/components/testframework/libs/cmock/vendor/unity/auto/type_sanitizer.rb +deleted file mode 100644 +index dafb8826e7..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/type_sanitizer.rb ++++ /dev/null +@@ -1,6 +0,0 @@ +-module TypeSanitizer +- def self.sanitize_c_identifier(unsanitized) +- # convert filename to valid C identifier by replacing invalid chars with '_' +- unsanitized.gsub(/[-\/\\\.\,\s]/, '_') +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.py b/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.py +deleted file mode 100644 +index 00c0da8cc3..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.py ++++ /dev/null +@@ -1,139 +0,0 @@ +-#! python3 +-# ========================================== +-# Unity Project - A Test Framework for C +-# Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de +-# [Released under MIT License. Please refer to license.txt for details] +-# Based on the ruby script by Mike Karlesky, Mark VanderVoord, Greg Williams +-# ========================================== +-import sys +-import os +-import re +-from glob import glob +- +-class UnityTestSummary: +- def __init__(self): +- self.report = '' +- self.total_tests = 0 +- self.failures = 0 +- self.ignored = 0 +- +- def run(self): +- # Clean up result file names +- results = [] +- for target in self.targets: +- results.append(target.replace('\\', '/')) +- +- # Dig through each result file, looking for details on pass/fail: +- failure_output = [] +- ignore_output = [] +- +- for result_file in results: +- lines = list(map(lambda line: line.rstrip(), open(result_file, "r").read().split('\n'))) +- if len(lines) == 0: +- raise Exception("Empty test result file: %s" % result_file) +- +- details = self.get_details(result_file, lines) +- failures = details['failures'] +- ignores = details['ignores'] +- if len(failures) > 0: failure_output.append('\n'.join(failures)) +- if len(ignores) > 0: ignore_output.append('n'.join(ignores)) +- tests,failures,ignored = self.parse_test_summary('\n'.join(lines)) +- self.total_tests += tests +- self.failures += failures +- self.ignored += ignored +- +- if self.ignored > 0: +- self.report += "\n" +- self.report += "--------------------------\n" +- self.report += "UNITY IGNORED TEST SUMMARY\n" +- self.report += "--------------------------\n" +- self.report += "\n".join(ignore_output) +- +- if self.failures > 0: +- self.report += "\n" +- self.report += "--------------------------\n" +- self.report += "UNITY FAILED TEST SUMMARY\n" +- self.report += "--------------------------\n" +- self.report += '\n'.join(failure_output) +- +- self.report += "\n" +- self.report += "--------------------------\n" +- self.report += "OVERALL UNITY TEST SUMMARY\n" +- self.report += "--------------------------\n" +- self.report += "{total_tests} TOTAL TESTS {failures} TOTAL FAILURES {ignored} IGNORED\n".format(total_tests = self.total_tests, failures=self.failures, ignored=self.ignored) +- self.report += "\n" +- +- return self.report +- +- def set_targets(self, target_array): +- self.targets = target_array +- +- def set_root_path(self, path): +- self.root = path +- +- def usage(self, err_msg=None): +- print("\nERROR: ") +- if err_msg: +- print(err_msg) +- print("\nUsage: unity_test_summary.py result_file_directory/ root_path/") +- print(" result_file_directory - The location of your results files.") +- print(" Defaults to current directory if not specified.") +- print(" Should end in / if specified.") +- print(" root_path - Helpful for producing more verbose output if using relative paths.") +- sys.exit(1) +- +- def get_details(self, result_file, lines): +- results = { 'failures': [], 'ignores': [], 'successes': [] } +- for line in lines: +- parts = line.split(':') +- if len(parts) == 5: +- src_file,src_line,test_name,status,msg = parts +- elif len(parts) == 4: +- src_file,src_line,test_name,status = parts +- msg = '' +- else: +- continue +- if len(self.root) > 0: +- line_out = "%s%s" % (self.root, line) +- else: +- line_out = line +- if status == 'IGNORE': +- results['ignores'].append(line_out) +- elif status == 'FAIL': +- results['failures'].append(line_out) +- elif status == 'PASS': +- results['successes'].append(line_out) +- return results +- +- def parse_test_summary(self, summary): +- m = re.search(r"([0-9]+) Tests ([0-9]+) Failures ([0-9]+) Ignored", summary) +- if not m: +- raise Exception("Couldn't parse test results: %s" % summary) +- +- return int(m.group(1)), int(m.group(2)), int(m.group(3)) +- +- +-if __name__ == '__main__': +- uts = UnityTestSummary() +- try: +- #look in the specified or current directory for result files +- if len(sys.argv) > 1: +- targets_dir = sys.argv[1] +- else: +- targets_dir = './' +- targets = list(map(lambda x: x.replace('\\', '/'), glob(targets_dir + '**/*.test*', recursive=True))) +- if len(targets) == 0: +- raise Exception("No *.testpass or *.testfail files found in '%s'" % targets_dir) +- uts.set_targets(targets) +- +- #set the root path +- if len(sys.argv) > 2: +- root_path = sys.argv[2] +- else: +- root_path = os.path.split(__file__)[0] +- uts.set_root_path(root_path) +- +- #run the summarizer +- print(uts.run()) +- except Exception as e: +- uts.usage(e) +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.rb b/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.rb +deleted file mode 100644 +index b3fe8a6997..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/unity_test_summary.rb ++++ /dev/null +@@ -1,135 +0,0 @@ +-# ========================================== +-# 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] +-# ========================================== +- +-# !/usr/bin/ruby +-# +-# unity_test_summary.rb +-# +-require 'fileutils' +-require 'set' +- +-class UnityTestSummary +- include FileUtils::Verbose +- +- attr_reader :report, :total_tests, :failures, :ignored +- attr_writer :targets, :root +- +- def initialize(_opts = {}) +- @report = '' +- @total_tests = 0 +- @failures = 0 +- @ignored = 0 +- end +- +- def run +- # Clean up result file names +- results = @targets.map { |target| target.tr('\\', '/') } +- +- # Dig through each result file, looking for details on pass/fail: +- failure_output = [] +- ignore_output = [] +- +- results.each do |result_file| +- lines = File.readlines(result_file).map(&:chomp) +- +- raise "Empty test result file: #{result_file}" if lines.empty? +- +- output = get_details(result_file, lines) +- failure_output << output[:failures] unless output[:failures].empty? +- ignore_output << output[:ignores] unless output[:ignores].empty? +- tests, failures, ignored = parse_test_summary(lines) +- @total_tests += tests +- @failures += failures +- @ignored += ignored +- end +- +- if @ignored > 0 +- @report += "\n" +- @report += "--------------------------\n" +- @report += "UNITY IGNORED TEST SUMMARY\n" +- @report += "--------------------------\n" +- @report += ignore_output.flatten.join("\n") +- end +- +- if @failures > 0 +- @report += "\n" +- @report += "--------------------------\n" +- @report += "UNITY FAILED TEST SUMMARY\n" +- @report += "--------------------------\n" +- @report += failure_output.flatten.join("\n") +- end +- +- @report += "\n" +- @report += "--------------------------\n" +- @report += "OVERALL UNITY TEST SUMMARY\n" +- @report += "--------------------------\n" +- @report += "#{@total_tests} TOTAL TESTS #{@failures} TOTAL FAILURES #{@ignored} IGNORED\n" +- @report += "\n" +- end +- +- def usage(err_msg = nil) +- puts "\nERROR: " +- puts err_msg if err_msg +- puts "\nUsage: unity_test_summary.rb result_file_directory/ root_path/" +- puts ' result_file_directory - The location of your results files.' +- puts ' Defaults to current directory if not specified.' +- puts ' Should end in / if specified.' +- puts ' root_path - Helpful for producing more verbose output if using relative paths.' +- exit 1 +- end +- +- protected +- +- def get_details(_result_file, lines) +- results = { failures: [], ignores: [], successes: [] } +- lines.each do |line| +- _src_file, _src_line, _test_name, status, _msg = line.split(/:/) +- line_out = (@root && (@root != 0) ? "#{@root}#{line}" : line).gsub(/\//, '\\') +- case status +- when 'IGNORE' then results[:ignores] << line_out +- when 'FAIL' then results[:failures] << line_out +- when 'PASS' then results[:successes] << line_out +- end +- end +- results +- end +- +- def parse_test_summary(summary) +- raise "Couldn't parse test results: #{summary}" unless summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ } +- +- [Regexp.last_match(1).to_i, Regexp.last_match(2).to_i, Regexp.last_match(3).to_i] +- end +-end +- +-if $0 == __FILE__ +- +- # parse out the command options +- opts, args = ARGV.partition { |v| v =~ /^--\w+/ } +- opts.map! { |v| v[2..-1].to_sym } +- +- # create an instance to work with +- uts = UnityTestSummary.new(opts) +- +- begin +- # look in the specified or current directory for result files +- args[0] ||= './' +- targets = "#{ARGV[0].tr('\\', '/')}**/*.test*" +- results = Dir[targets] +- +- raise "No *.testpass, *.testfail, or *.testresults files found in '#{targets}'" if results.empty? +- +- uts.targets = results +- +- # set the root path +- args[1] ||= Dir.pwd + '/' +- uts.root = ARGV[1] +- +- # run the summarizer +- puts uts.run +- rescue StandardError => e +- uts.usage e.message +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/auto/unity_to_junit.py b/components/testframework/libs/cmock/vendor/unity/auto/unity_to_junit.py +deleted file mode 100644 +index 71dd568883..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/auto/unity_to_junit.py ++++ /dev/null +@@ -1,146 +0,0 @@ +-import sys +-import os +-from glob import glob +- +-from pyparsing import * +-from junit_xml import TestSuite, TestCase +- +- +-class UnityTestSummary: +- def __init__(self): +- self.report = '' +- self.total_tests = 0 +- self.failures = 0 +- self.ignored = 0 +- self.targets = 0 +- self.root = None +- self.test_suites = dict() +- +- def run(self): +- # Clean up result file names +- results = [] +- for target in self.targets: +- results.append(target.replace('\\', '/')) +- +- # Dig through each result file, looking for details on pass/fail: +- for result_file in results: +- lines = list(map(lambda line: line.rstrip(), open(result_file, "r").read().split('\n'))) +- if len(lines) == 0: +- raise Exception("Empty test result file: %s" % result_file) +- +- # define an expression for your file reference +- entry_one = Combine( +- oneOf(list(alphas)) + ':/' + +- Word(alphanums + '_-./')) +- +- entry_two = Word(printables + ' ', excludeChars=':') +- entry = entry_one | entry_two +- +- delimiter = Literal(':').suppress() +- tc_result_line = Group(entry.setResultsName('tc_file_name') + delimiter + entry.setResultsName( +- 'tc_line_nr') + delimiter + entry.setResultsName('tc_name') + delimiter + entry.setResultsName( +- 'tc_status') + Optional( +- delimiter + entry.setResultsName('tc_msg'))).setResultsName("tc_line") +- +- eol = LineEnd().suppress() +- sol = LineStart().suppress() +- blank_line = sol + eol +- +- tc_summary_line = Group(Word(nums).setResultsName("num_of_tests") + "Tests" + Word(nums).setResultsName( +- "num_of_fail") + "Failures" + Word(nums).setResultsName("num_of_ignore") + "Ignored").setResultsName( +- "tc_summary") +- tc_end_line = Or(Literal("FAIL"), Literal('Ok')).setResultsName("tc_result") +- +- # run it and see... +- pp1 = tc_result_line | Optional(tc_summary_line | tc_end_line) +- pp1.ignore(blank_line | OneOrMore("-")) +- +- result = list() +- for l in lines: +- result.append((pp1.parseString(l)).asDict()) +- # delete empty results +- result = filter(None, result) +- +- tc_list = list() +- for r in result: +- if 'tc_line' in r: +- tmp_tc_line = r['tc_line'] +- +- # get only the file name which will be used as the classname +- file_name = tmp_tc_line['tc_file_name'].split('\\').pop().split('/').pop().rsplit('.', 1)[0] +- tmp_tc = TestCase(name=tmp_tc_line['tc_name'], classname=file_name) +- if 'tc_status' in tmp_tc_line: +- if str(tmp_tc_line['tc_status']) == 'IGNORE': +- if 'tc_msg' in tmp_tc_line: +- tmp_tc.add_skipped_info(message=tmp_tc_line['tc_msg'], +- output=r'[File]={0}, [Line]={1}'.format( +- tmp_tc_line['tc_file_name'], tmp_tc_line['tc_line_nr'])) +- else: +- tmp_tc.add_skipped_info(message=" ") +- elif str(tmp_tc_line['tc_status']) == 'FAIL': +- if 'tc_msg' in tmp_tc_line: +- tmp_tc.add_failure_info(message=tmp_tc_line['tc_msg'], +- output=r'[File]={0}, [Line]={1}'.format( +- tmp_tc_line['tc_file_name'], tmp_tc_line['tc_line_nr'])) +- else: +- tmp_tc.add_failure_info(message=" ") +- +- tc_list.append((str(result_file), tmp_tc)) +- +- for k, v in tc_list: +- try: +- self.test_suites[k].append(v) +- except KeyError: +- self.test_suites[k] = [v] +- ts = [] +- for suite_name in self.test_suites: +- ts.append(TestSuite(suite_name, self.test_suites[suite_name])) +- +- with open('result.xml', 'w') as f: +- TestSuite.to_file(f, ts, prettyprint='True', encoding='utf-8') +- +- return self.report +- +- def set_targets(self, target_array): +- self.targets = target_array +- +- def set_root_path(self, path): +- self.root = path +- +- @staticmethod +- def usage(err_msg=None): +- print("\nERROR: ") +- if err_msg: +- print(err_msg) +- print("\nUsage: unity_test_summary.py result_file_directory/ root_path/") +- print(" result_file_directory - The location of your results files.") +- print(" Defaults to current directory if not specified.") +- print(" Should end in / if specified.") +- print(" root_path - Helpful for producing more verbose output if using relative paths.") +- sys.exit(1) +- +- +-if __name__ == '__main__': +- uts = UnityTestSummary() +- try: +- # look in the specified or current directory for result files +- if len(sys.argv) > 1: +- targets_dir = sys.argv[1] +- else: +- targets_dir = './' +- targets = list(map(lambda x: x.replace('\\', '/'), glob(targets_dir + '*.test*'))) +- if len(targets) == 0: +- raise Exception("No *.testpass or *.testfail files found in '%s'" % targets_dir) +- uts.set_targets(targets) +- +- # set the root path +- if len(sys.argv) > 2: +- root_path = sys.argv[2] +- else: +- root_path = os.path.split(__file__)[0] +- uts.set_root_path(root_path) +- +- # run the summarizer +- print(uts.run()) +- except Exception as e: +- UnityTestSummary.usage(e) +diff --git a/components/testframework/libs/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md b/components/testframework/libs/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +deleted file mode 100644 +index bf4c099bbf..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md ++++ /dev/null +@@ -1,206 +0,0 @@ +-# ThrowTheSwitch.org Coding Standard +- +-Hi. Welcome to the coding standard for ThrowTheSwitch.org. For the most part, +-we try to follow these standards to unify our contributors' code into a cohesive +-unit (puns intended). You might find places where these standards aren't +-followed. We're not perfect. Please be polite where you notice these discrepancies +-and we'll try to be polite when we notice yours. +- +-;) +- +- +-## Why Have A Coding Standard? +- +-Being consistent makes code easier to understand. We've tried to keep +-our standard simple because we also believe that we can only expect someone to +-follow something that is understandable. Please do your best. +- +- +-## Our Philosophy +- +-Before we get into details on syntax, let's take a moment to talk about our +-vision for these tools. We're C developers and embedded software developers. +-These tools are great to test any C code, but catering to embedded software has +-made us more tolerant of compiler quirks. There are a LOT of quirky compilers +-out there. By quirky I mean "doesn't follow standards because they feel like +-they have a license to do as they wish." +- +-Our philosophy is "support every compiler we can". Most often, this means that +-we aim for writing C code that is standards compliant (often C89... that seems +-to be a sweet spot that is almost always compatible). But it also means these +-tools are tolerant of things that aren't common. Some that aren't even +-compliant. There are configuration options to override the size of standard +-types. There are configuration options to force Unity to not use certain +-standard library functions. A lot of Unity is configurable and we have worked +-hard to make it not TOO ugly in the process. +- +-Similarly, our tools that parse C do their best. They aren't full C parsers +-(yet) and, even if they were, they would still have to accept non-standard +-additions like gcc extensions or specifying `@0x1000` to force a variable to +-compile to a particular location. It's just what we do, because we like +-everything to Just Work™. +- +-Speaking of having things Just Work™, that's our second philosophy. By that, we +-mean that we do our best to have EVERY configuration option have a logical +-default. We believe that if you're working with a simple compiler and target, +-you shouldn't need to configure very much... we try to make the tools guess as +-much as they can, but give the user the power to override it when it's wrong. +- +- +-## Naming Things +- +-Let's talk about naming things. Programming is all about naming things. We name +-files, functions, variables, and so much more. While we're not always going to +-find the best name for something, we actually put a bit of effort into +-finding *What Something WANTS to be Called*™. +- +-When naming things, we follow this hierarchy, the first being the +-most important to us (but we do all four when possible): +-1. Readable +-2. Descriptive +-3. Consistent +-4. Memorable +- +- +-#### Readable +- +-We want to read our code. This means we like names and flow that are more +-naturally read. We try to avoid double negatives. We try to avoid cryptic +-abbreviations (sticking to ones we feel are common). +- +- +-#### Descriptive +- +-We like descriptive names for things, especially functions and variables. +-Finding the right name for something is an important endeavor. You might notice +-from poking around our code that this often results in names that are a little +-longer than the average. Guilty. We're okay with a bit more typing if it +-means our code is easier to understand. +- +-There are two exceptions to this rule that we also stick to as religiously as +-possible: +- +-First, while we realize hungarian notation (and similar systems for encoding +-type information into variable names) is providing a more descriptive name, we +-feel that (for the average developer) it takes away from readability and is to be avoided. +- +-Second, loop counters and other local throw-away variables often have a purpose +-which is obvious. There's no need, therefore, to get carried away with complex +-naming. We find i, j, and k are better loop counters than loopCounterVar or +-whatnot. We only break this rule when we see that more description could improve +-understanding of an algorithm. +- +- +-#### Consistent +- +-We like consistency, but we're not really obsessed with it. We try to name our +-configuration macros in a consistent fashion... you'll notice a repeated use of +-UNITY_EXCLUDE_BLAH or UNITY_USES_BLAH macros. This helps users avoid having to +-remember each macro's details. +- +- +-#### Memorable +- +-Where ever it doesn't violate the above principles, we try to apply memorable +-names. Sometimes this means using something that is simply descriptive, but +-often we strive for descriptive AND unique... we like quirky names that stand +-out in our memory and are easier to search for. Take a look through the file +-names in Ceedling and you'll get a good idea of what we are talking about here. +-Why use preprocess when you can use preprocessinator? Or what better describes a +-module in charge of invoking tasks during releases than release_invoker? Don't +-get carried away. The names are still descriptive and fulfill the above +-requirements, but they don't feel stale. +- +- +-## C and C++ Details +- +-We don't really want to add to the style battles out there. Tabs or spaces? +-How many spaces? Where do the braces go? These are age-old questions that will +-never be answered... or at least not answered in a way that will make everyone +-happy. +- +-We've decided on our own style preferences. If you'd like to contribute to these +-projects (and we hope that you do), then we ask if you do your best to follow +-the same. It will only hurt a little. We promise. +- +- +-#### Whitespace +- +-Our C-style is to use spaces and to use 4 of them per indent level. It's a nice +-power-of-2 number that looks decent on a wide-screen. We have no more reason +-than that. We break that rule when we have lines that wrap (macros or function +-arguments or whatnot). When that happens, we like to indent further to line +-things up in nice tidy columns. +- +-```C +- if (stuff_happened) +- { +- do_something(); +- } +-``` +- +- +-#### Case +- +-- Files - all lower case with underscores. +-- Variables - all lower case with underscores +-- Macros - all caps with underscores. +-- Typedefs - all caps with underscores. (also ends with _T). +-- Functions - camel cased. Usually named ModuleName_FuncName +-- Constants and Globals - camel cased. +- +- +-#### Braces +- +-The left brace is on the next line after the declaration. The right brace is +-directly below that. Everything in between in indented one level. If you're +-catching an error and you have a one-line, go ahead and to it on the same line. +- +-```C +- while (blah) +- { +- //Like so. Even if only one line, we use braces. +- } +-``` +- +- +-#### Comments +- +-Do you know what we hate? Old-school C block comments. BUT, we're using them +-anyway. As we mentioned, our goal is to support every compiler we can, +-especially embedded compilers. There are STILL C compilers out there that only +-support old-school block comments. So that is what we're using. We apologize. We +-think they are ugly too. +- +- +-## Ruby Details +- +-Is there really such thing as a Ruby coding standard? Ruby is such a free form +-language, it seems almost sacrilegious to suggest that people should comply to +-one method! We'll keep it really brief! +- +- +-#### Whitespace +- +-Our Ruby style is to use spaces and to use 2 of them per indent level. It's a +-nice power-of-2 number that really grooves with Ruby's compact style. We have no +-more reason than that. We break that rule when we have lines that wrap. When +-that happens, we like to indent further to line things up in nice tidy columns. +- +- +-#### Case +- +-- Files - all lower case with underscores. +-- Variables - all lower case with underscores +-- Classes, Modules, etc - Camel cased. +-- Functions - all lower case with underscores +-- Constants - all upper case with underscores +- +- +-## Documentation +- +-Egad. Really? We use mark down and we like pdf files because they can be made to +-look nice while still being portable. Good enough? +- +- +-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* +diff --git a/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf b/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +deleted file mode 100644 +index 28f0c32144c4f2b55ff07007555e5777480320ac..0000000000000000000000000000000000000000 +GIT binary patch +literal 0 +HcmV?d00001 + +literal 144467 +zcmc$^1#nwUvn?7kGsP@BW|EninVFfHnJH#wW@cuLF=oeh%*-(}UFZA%bKbd7b?>Ws +z^{%9?QMaaMdRDL1TbjK|<%LCQ8R%GGNqZj(-eK7R^Z+|UOIU7h08rY(*2KWk!qdbU +z!0>4S7?_!vS=j(Uaex+pgPs+@z{(8J0RZIy42%Gv2!Mf}jfs^V0F(uMn#zBBGq5lL +zczIz>Y>od83Hbl>0n71U7NYE7Zvp_SE1H;oF2lsu%-I~k&H(_5T39=qIDWR)2F@nJ +zCPsF~pS}Lo${RS^I062GAY^ClVq@zBU;zN-9ZifajGXNp|1Ox97XVcI1cCv;^m%;3 +zAYp54;{NGi2Qah#%Qm$GFtUAyp$Gsf+SxgO0`xCK=@U`_3-dn%y8a6%=Km2JpoB0$ +zi<^a=naP03)YzDfft|sKoz2M9n8nc8kky3MfSKNeor(8<-$Unb2ArH7O$=;c-Ls4g +zjrF(8^bPg(*kWm_%tTIcV7pr+ASZhWiGNf4?>YW&B>R5^@Bh9H`%kX_ +zLrC%lW+qMm#=qM7qMTTP?wgF;8|Ah+VOGp%I$p4(yPvZYS^+CYa*3Q}Klk$IcBJj_<5&)>8 +zDDfX_6fknOu(SP_i^AO5*`5;!bT#$0&+346<0F113j4S{aMkYEI02BM)&!7F2TnwH6k@sh{vii@7|3>zA +z;Qu#~Ss6H5n>bl{{GW%#%Jw%1CXRo{#PUxa`2Q{-XLCn8H)nGbCpQacBXc@CN3;JU +zv>2G_{|W0Kgcv`8`o!!X&;J&!&kjO%w$3KDpIK#K`pm;8TV+0Lo`Im<-^%tkGpwHs +zVB=u?i~MJe{OtLkv{p26vU71X`Xu^a&_&#x#gv>s>*_z27(IaTZ$Vc4C)uK(bNu5L +zr3WzmyC#Z$*3o~@D9Q+6V*S_TqD+6${U;7lW&rbF@_mLR$^u|!`Oneh9qo*iO#a~^ +z@bg^uNdXgg=g)F%^C>#Pf44&aZY4hB{#&^JCBeV4{51dL{PfR?|3k9>Oa1*@dCcse +z)Bo41dakn?v&)L=b5T3v*w{n-}z_yR@vR_@y{cd +zPjbim;bH9h<@Uw2+@@dB`k@~p2e>1?#OX7QZ|}7*O1af$ybs7=m~vmIoZKegL`4)n_ielJ@bME_tu;l0w0wrgOI*wvdURm|^Nt)pXp<>kx +zdZEMfZ3G{QdwyZ0aH-BNln~027&Z^d(`qa&?SiD+7V6@h-^5=e`%#GV+=%z3IMM?WN*l@}&pY?>XfNT_k+swyyW$7h!7 +z;qhIXlt=eCundcd&-vw&X>*xp(ugbF#qEiOal1gq&82Pu(P1X$JO?I4vOljUJPa66 +zkzXOZP!_5P9aGKCs-BE^$tc60_sp%l$(UY`GhVs`AQ@Lg*GB9YLe&@@(g +zYTT`qTu635v9XnI?@j6X=~SZB5^CPZr=i5nb#4UsR7jrP!SS}@XL3EVE#;?ul^lE= +z`auptz?aKi5=60xp@6dz$vB!Q_**)TlLMut?p5O=0oE%uSjGIrpXQr&_;@m;>kL@- +zD2F1&^5A}!^ffIi=oAKdbFOjVD?BM3=_B%9gk*n1?#N-eM~tcOVwd%rEe#61Fxq_9~K?Zzm(^b8Bp3HJ2V#MI=Gu;HZeen>#05l|x;-N{r)tPDsE +z2SHlpVDPIZ3F1p*PeM718BUql6^BGa*uH`!2#Im)z98uMIEAvPFbpJVml(`6K%hqm +z=7Lf1!>&HiDjD5C2ni?MF-(x_Sh64YFOnQ +zRkpu|Vc*!wR56>^h}&=|goR;R-lI=6tI2n(3?$J&9}N*L^+fGcIbkc|Hv3HSG!3}= +zzF2%2&D$8qMj`t)3>$22dIcHW$0&a&c<2)3tN?0M0igs2NJ1KOS~YiZWxe&Jk+%6t +zNi4nC8k9c|nk{gVOm3izEl}-0HT7dE76PB!KFk-JS&V*EF&a5?!@ncE8H)uO4CFJM +zdbOjMysGgzV|ktY^8kclDRZwo|4@{>i0}^7xe5Qa18-? +z+?#aF5G&@YC_uuCj9ek$2inXE;w{jjO_*P)@pqNkIk;|hqC8NxQCjAe-Cue{0(vw{-_<#q9Qi+xpx{ckZ+E?%u=Na%g{` +zwjo5`yIQqv{2aU!D*72|j=DN!OIy+2zAfbY?FbOvGZPf+porWv2`XZt;Gb*kyUmTP +z?I+z4Z8S)!d8|4KvoJEbST>(h;FOO{#|=dgViAk13TI=)1*R;jV?a_N+Tc}K6#h@ +z*7*XowY`{I3Vo~qQUpgff~r64WSwqh>+?0;3c@-Z>O5dOq=>2yjqb-r)gQwn`LUXY +zCd#t29!S50)hn$gA`>oJC_F@>m`=Nh$p?n_>+euxr%|R-PBv`)5H{Ape7Y?g)i2Bk +zT&?ST7umeN8t+|_5{dh;13J&TO{r#nSZ`<_aR54zSOY2z(oNG$|41`EC81>Y(61CI +z2{7TQZ@~Oiu01h%H+XMn`q*Qc|7C|*?uA%>5$so?M$Ys>|FM?tcm4YU^L^VRH2YHS +zj>_tQ@F17#M$Y`+FVOhI%*#b@w~4F-yCnT(PWm7`gU1x|glB5{zC!&W-`|)hJg+9i46LbmpeobH+JeMdJIT@lf69W$p147lDuyhPhNj4gqSXFu& +zL3EmS=g8iQk!9JR^C?n8Rs+^{rp(6!lPRKx%tkoY?MJ5hNnHyv)@eVHG1&=T^U%S` +zNj{_>eCgbp2fYP`Y-WV7gR{m5xnjG7i(Qi(miK=5{d{=LpFw^5(B|+YOB`W&f1-SQ +zy)&*xYk?~{oxXD&AmsJK=JT?6(bKzLntJE>p6Xw=J+mTuIajaq1QVwZ`1QZ +z(K-D=L+~gddLK>i%y}zJXm`fM8~6Q?F_X}gi6c-H0}JW50;O_Oeb)<;4s3X&x{ED5 +z#uD_vDkyo_O4`nCrUL2n{6KVewyz_FVAziQrKp4klx;xPT4=asAdw4I(q9m8#wtW7dtonPk&O*V{CrJDXrpbImR129_XvD6Uvj^A<}Ro +zC!uuX#7sT@WD0znwU0V#4K;U0WT~O^1S15(hJ>?k;fgx@Y}ZZai|dE$-;FXk1;AY& +zgyobFO>z9hyIarHFQnECgk*A00vj>D7zy4QOD8tCvp22s*ik3cY5Qp}N@=>zHqudB +z4~OH1oDBR>2(mnpSVyo}W=3Rc;NJj3B%x +z5xMXz!-h39jhnmmoBTSu9Q76)^{i)`40l(~;7Xgj3ZKr^^67@9k%f^&bZMVhF`t&%)0?xq +zZjKYL=tigX+O*o1%VfLtsXQ<)t4Z}%?%dRWEhglEL*?7biy@s?vXFoJUfLdOoVICM +z3Wti&-zmGtB?hG(r5&}zV=`KqzW&U?OI)kOGn*tCA!!ZSbM7QJTTb+HB5@lm)J|_m +zYp|8n0NZ4i#{4>ByRvFjrIX`1u{W~krgZIO6Zt#J% +zevz3tn(4#Vj3$R#T^nNFm!wg}(Us(88S;3P>tbrrl3jo0*}g{g2G?z}>?|YeLa5LP +zv`ZZd(^f27RdOOv&Jb=&T@4N+4jeb7#R&nf7Gnh>C@C) +z>Y6Ia!qKcX4J5*`wTk$mUG-;=iqzXkaYcr=ZNEz2<@CZK<2Dg7FPD2|*f$Wzr|6ra +zs6^|*uW}=M4U3Dyo@M*gB%k(6CQ~VrJ-WnLCP{F}L9 +z(t^aP@&btqQI1Oa9RJ*5i(s``D>g3i4HE3OGl7 +z-5JXtPB-95iTDc>k;eJj0jTOr-@lNHEWsjU54DWIUgzyz`` +z@|Px?lW|xYV1v!il6{FftnZau +z6fjk`Z;}@}kS@BrRrrXZ+?IIDbh3dqh~J9VrUs#R#RcP$W~Zb_z5BjE{d9+qf^-Ek +zL(&C-j*QuwM5i!ac=DE1^@L!xAjWLi=j|9n+tf8&`tCl8j*nV(YeUA&^chg&amKXx +z7o-~eF;Rv$-+mjvQ8)@jBsZdyBrMnu1y0~jW>iF~b_fhYn-SYjR9Y3!Hqo;7)J<bgJtBC0R0d=! +z97dsw&X&yh?`F%wuPt4fxtl;hp|!+mzsQo0aAj|7TtXx1#8ugT{TWQW(#Pa>g?C*9 +zitYaNY>3HS-j~;b+2g+)Kp_9dd1r^z26mF6?Yp5r(6VLt!p)U%g67BFUjZR0*Tk5KtysKdu?5K+yUIH)_eT^+N?bdpikVOlxW*WJi9b>+{4hD_Tq +z(!A)XrPk`jrnkdtqcQhha7IusQnPX +zracS_Hi@{tLXr44mKN0SrI5poR^frR3ZL;MYy6R7z2K61O8-K}wltV@nPq-mMqars +z(%ssVki$Ips4;pQuEQB8`L6Pg7j2IYsh-zREWaAD+pn|_nTLH~ViVZ2ZukD~@lQVP +z2mM&-W+%VB9WA!n{q4-thNY&p@>0MaseBA@f3bT{t9M#x=bFuFU1sfW(}F=w{7OXm +zDYdvHRNU{$*^(2*qTBBqdBO{81|R39YuBAf0nR!jjpL;wd2`;rmd~R~xPqWBe1Sg8 +zE$@f&E4(d-t@$%C8uQRFK@HWCqbg$pr^X;41iqHF@dYu3Sl9`p5TaAuDT=7CyAIzq@ +zpofptmG%!usG$t-qbA{72v9$Yr@TR +z1jdd}UkcV*Qbu6wbB{?YP1*9?4aBkS%+z{sJI@jj;u@)Sn=TcHw<5U=Vm8k9aW4++ +z_Fl{bp^1*=>Mj1b6J^f|bh39UTnoDRfiM1);sJJT^Sc;;8E}cq>Km%v${g8s74BT) +zNEi_aa&E$8&k3_zztDWt9DjIV*L`~p_Y?Y^g0;~NHdlF(@2zsE4RHz==92-Hi-iu0 +z(IfhEnl4<_6Rc87IlP}bbv;KqHaoL}>#eXVT=JeKtKGIb<>(fHe0TWg +z$ZES-A{LcykD+~@dgZ`(m3g?S`-x()XS|Qwr1!7AoKHp&(-Fqu9rJuVNhNZ!lUyxQ +zKUakYiPO;{5;#ekB|dzPSQH2d%HA7~x#-?}339a9yhjK|I(+D$V4jRcgIZ>@9xxee +zM?8lX&ii_HHU`=g_|DK`m|`f}teVo7nGj_(ed>L~$~mTnN$A%)RAQc%gx^Pu%!UKa4!QNjuqQS8z6GciRem0sX?c43FM`tH$E|9U?Oo +zOxPP%zpdOsrWU=*{gT!HEbQ0199kEhVLQ|-Aa1F%*hzQYQtb1k2pQm=*WFkTLT8(cDDVHa?WM|6 +zbvj4zd8Oq|wJ4PnN0kNXeYfx7%Xz)Jii-=Io6heWLEM^9-7dz$BNzpar0;KwlJeWheX@-T;1YB`G8u;#sB)aLqY +zNInU(TQ^n|A*%A*=3vGG9RBW$<|C+mq3hh#y8OO2vU|2h-_!7~2KZ^}g4ftQp6(!r>BjUYrY +zhiw?!EUJbt20snWkw5UdaJShio@Q!2Ssod8dPN?aPgL3nPHT6cp^jbp!785mzZuG1 +zLfqYN-Gui>yy3?Ek)c_^>+OFU7$#VbxO*7pL+f*T^*^_&w}BqXE^x@hirDhO!I~_T +z%9jt`N*!>Wi`Z>IxjuHOLP)5;g%b(rtowlerQ|RPTD2K_J{vwg@RS{en2&C;Q$N|) +zK5xHaa8_$_E}j{4=&;ihhKy;nS;>r4gLbW-b^wtY*^FGB^`h%)>v}NDboDmj#R+Av +z%i8M4J^I3hQ2KCBxEJuGyB`7?&f#@wXT5)O&aN-khv2T-9<4PU}^3pQS3lJQT!g1)$w>bf@-_OhAF#|f{ea7LT0#)!e(6nu5aodA=d)-&v&>43my>_%3Zatfel=!aOFW<^;T@aKn}ZYkztB3=O$W%TQm*b3k3g! +zw$Mas*Xc}vw>Ss@xjVoOmYqc!rs6wU6QDqoS@Y|x^U1-9`v9*P_R0^#Bk|;nZCm8Z +z%bpU#9c~WZ95jJnepPpkK8~-l8ZO-D=qO4meD+j*!nt{xyogCzyPv70+7Dzp8QwCf +z4|p=eButAn1)N%4_A_*M!5EFs&OdvUnJ*>qs7 +zz28mbmal0px2@r;^1579#W(#!-(skoUDr|TOD~Ea%?AcG+l8fpR`s-DvizHo=eKa` +zqc87Y5IZnOzV~aXOBYr44e#y}24*+Gk3TL`2l`%lMXkmfR>>diGOJg#|uq +zZuRIB&7(jQ-i=7#XC(KVv0#DgDYEq&ELw9J6gD+FqguI;nn){X)eu&dUm$bb=TEk|D*;(qji*s(F7vB2j-Pehvw|b{Wk0 +zLV;WJ6)Wl!2!h85bO5xd#VlS>k1s^s39q2)s^V8=&qcLslc11o1=_w6Wgga=?UQ~0 +zllZV>-&e1z*pr-GrJo3slRs2EMB#CgKm4eYmm40l6t@SDIDVWT>J4`>NiO7K{Q$eE +zp6q4l9rwn)DV@xXNRB#U +z4N!l=ta`%#g*@MbRA35?3tET0V9%f}%^F|5M|S-M8!#d+UxucO5d-a46s(9Nn0;&b +zTduYkX+|&7V28$`zD>AGqf4es%v*eomY2GR+_&U+t*6GF+9KPP+Rz6;M4XILS2Af$ +zu_cKdL#lXAxLoiz2@eeq8BcniBt2Og8YJyClsmVAxH7pYi706Xsu3#w +z_ww&KL*?HQzWmzL&(1uiNnmCDYA#I=2(N!z2TyI`+X+O1GYOcxDL2Ao! +zM(99n%W=YYe4D!~IptX*|D)Kt$uriyuzqCgQ2VNUmwc%*s>VSck~lZ^npjLuo$~Yggxr|g9`#jacp~_8u4@DG +z^aUTs(;m9(`&RB1s0Ey8VtP^586v^AMg@i$>HrRR#z&LOPNfHu`Hhm`m{Xc$B+bRu~rB<9-`b*fu_^ +z7Q^f4d^kH^m>82nD8rfI&b)2zJt+Xz$S&WV=b`Krdtm!hCxeT{&D?gR?8n&-de+r9 +zZpuOIJD-92dNvV@OQ3Jr=MTAO>gRV3p5Bygy%;=0ek6)!pO1{|toS7(c*5b@w^U^- +z`tf&TC~ol7L5zXTE!9Wxn&8uIoHnQ&|FHfqZ=+cgTc(e&?}$tNHufxC;3Hd7ZCEXX +zd|OtJkOaZx+brzxa{Y|v!MJ%ax?!g77%_dd+o_k-?qKhrw3oQT)&UqZkkkekO+rv>u~*J4&H`+={DijyIO=e@1DwlWPPYY@p|SdzF27g{ +z`ZZ(I1@sPV>hrZHuZe;Seiv7^N0p6V9mC&~b;OF|_b>Y%YEC5nhwLHFYs|-d9VreO +zRnnOxid&o@@M0@>&)^!`BZ*s-fLt!_+!)FufmKf@9;VI@d +z(Ob?Jz=w*&At4)&f(kf3+7#$hR>}*cCBp^=0L84}#z)d7!4`WNDA&#OL!rcE& +zo7OtNb;gD{q-2iyB>$K>$aIb-L&nLR?q{LyN#RqIKjs{II*iy!QuX(s5)Q%+9 +z8Iz`X)>+fvf~oVWzeUw%lAE$?3hir_>alj^&QQbOh*%0}F6x +zH|+v-+_^5ub(i5@woI-W&O&+Yq3J^O`cy7ypCaw!U@!63KnBe*V*6x@;9Cklw1sSk +z*d3WP;Dq*w8KrxWdoX$mskU>Ksb2wEMMML!%*tQ$IdMeqn6pIXgX|+TEl8pZL~&$f +zm_vUkK_#1m$`rZcNbSSe9nB_t{COxC_OMp?Z#11w*HYrLdw+sE!KBmF_Ulh5MyRW*FK;*Tuv(2sKCk5D>{NAoxV^8| +z=(K$cg#-R}zbg5es_nV5ucqy>xTy79+kW41+PY!CE5o+gaQ*eS +zt^P0q-@Vxp0zbnS#OFOFxeL5ymNu{H4WDWFbH2+nr|I6yoqoNp+v|Ka#NOxM@k@SB +zm2AFm2U?ezn>}xxZoVI3Zkt{oNA-LJA6tiK`~UOnLuw^*^8%R3p5Ii|R#w+{_;cdt +z*wpx>_(M@~2}!4p#MBV@7z!blRcyTmt*KHI1JxWdN)6I{NT@lBWwJN~=yCECrBpG< +z!yL%$c@`&2&|)^i@(g{A!Lfg^jM7vQc3g@h>n*_57k&5~s~?D)6cs +z=1fB^%xO!#pT)%D16})B^M|k%rfslIF1`q_a${pcGmQ=rLNGfyht`W4jflt4EmGgw +z9ZV1d!~0u55>bibNv+P7^jC^Tu2UQ;LpKqjkF~o_8{aWkQ#sLRI-#P;pE}zpu&5=3 +zvCOe|4pE6rRi1yoa>1;|H^MgS^IIm_lfz}X#|hq>(*?i(5F{DQT`Y;@)!-Kaw_;dT%r#$=efkbeWy>0POcsX8+x_t$lQNF!7;nb3V|yc +ze=ml$tF)Rf8+!{e@_}X5&+7934FQ36mh@0SMn~|?G#SDGtN`w#teuPv!J?@wqANsP +z2@+nabbPvFCOG)RaYp`mc;kK#T{1ISV6`{RD#nbKC>8E&x|?&U>j`Y1Ed +zwzStTLMdaex2e~FqRk^+iIM%~VIG8YW>clzS-C){A8ctEszh5WEXkE+xK{FRA(?g{rK5L!V0TVxR8K(WS&uv1# +zp_p)c$R9{Bd~g^8Rza+RFlfuQN!!OS+fu=RKxl>AtA0Kkhc5n$Z`5Pi>|^KljVX_V +zc$q^oR0fH4-(jV4Fd+TGkx(b{s!81_-0j_*q~UCxn2rq)rspTVhg1`CQ=H*Vj@=*` +z#E(U;k7DX}B@Qn`tlJ594UTpb25Q9t5d?Azd@aK5{2?PPlzIz1xo +zkg2Pgm9EA6A=}SF{r-Go$?;gKS;?thP`X8kZ82@a$<%~iPH;{(!{x&v!wV-3Tftt6 +z+97mT9G);Q{!(zhLEi@YSufNNk)31CxVaZM-MAj>*&319<3{%=)C*S1QBum>Dnf?H +z<9YYSXtW>G_--Y{3~dYMnNsmB=JhQJfT-9?tO!4(*jM#(zCY~k|Me1BHPZ{S!jGgDr7oqhw_wd!6xYZ9(I*}u?dk{7Pnt6pSd9(6~ +zgO(#wL&62OL-+Z@($rt+C^MK!uoI*s&^sexii1jPf)AjKN#V;9mk7&xrPBaP6} +zUUPPt5V+|!ni)8VmzyDQa6Aq3CWqAQj{XJU9ES)y_=w$yG_?~;35b({*g3(_Ne +ziG(=kqf$HtF2P{I%3cQMNN-JpzBj!Xbv;+>zU}M!RI2G6E-rcADRn +zXGn=&;knP&ktbaoRsad@ktvgJ +zcR4ZY?0Xst2oW#=B@M*015U#VG)y1I*$ZDt@HVd#9`0QKwK2vqGcVMgwqF-x01;e) +zl9FBcmnc@CvoQz1V)e~ga%>+MoRw>1vbalUrY&%e8;PLa*5$P +z%(8!_G>hDA{X-OR=G3+CJ9rgpB`!Q*=E%N1Z_7KDc(ojU`*5JW)%Me;cGuM7&pU~% +zGd81B*yd3idhEg>_x90%MMl=6x9N_H3;*emd%>Ystd51GonZke79c9onz+B +z0T`C?JR&i;;P=M03=Bok!qk1tU+L#8^E*uE_ybBk#nH03mMAYo$L9;`1RIwvV2v4P0&?Q>UF~*^u||y% +z@uH3CROuT=`uoT5_8de*Eq@%jp4%&{o;k9!M=wKgvHwJ@mnv~^$dLOnTLym#Q~D%q +zvNfT>E}@8;ut&m>pz~cqypEbO-ffy={XD6YZG0Wq!)@gF4|ls)=UO*@C(nlz-_OK% +zG!YZ6pCpPrUj1~m(iMYQv8kp)OTsl!@m}QCErfvjTb>z%-?$MEWZ6!rNy!>Kp^6DA +zwTQU#MwyTS@u?*0z!pMe5RIwP!8(mvXOkqeq((YrvtJlfw)&E(cRLB-+ItSg6aGKr +z+n`SzOc74@$HxPjiq+YvPx>@hR0I5y3ZVR+pPxNFJztiQ5bc+gk)->Aol;k$)k=#o +zTnM`SRc_xiZ-nmnaS*ADf|xTTyT+9l?rz;5*<(xPMD1-ubKd5uTOAZHZ=;&gSnZH9 +zhlS#bh5C0pca1z2)=$S8J9s=^g7jvkTt)U7b~xweCq#F(ui<&TRTuBRR2*;dhZk4& +z!y>;zZ!19tSoAAVIS&T>+R8l=c7|F-kMq;MWY?B+u0x>TO6{PeQ +zdH-^l|5dvVQ?VcEn?4x=J%o`Fl{Qk!*6DI1#bf#<3}*({7V0C;^VY)*bQlA$J8@3{ +z6@8#qU(lZ8tICBSuQtqTpqRin&utWUHg}q@{^gf|E-6U~g!QTn=)*zCHs~5s%mh)` +zF_EnwJXJx5+j;uXD{uy1;mrhTY5e!=#Ehq8AQ}zGJ;G#vBxClm42dB^<_?XX4#Z>2 +z%U(msU49u7!ufHHN)bf8h1rJx&d)dop7HGu6kJX@$bF){A=&r6;jQ(pzG-;%D6Vcy +z+mQ21sYgXtDtC!BP{k-hZz5F>{Qahv8j<`>PXDa(K+Nh5*TZ4HVk8a_8-BUrTNB%N(5GGE* +zF7S&%n8%!OVJYGwTAbA=T|?@tQaEM~>IRBj`G$%QMi;p|tn;W1R*?{^?{!?zp#a98Vz58L68HgZ +zTVG$H`B1qiiLnwZKmU#ASbu9xKpJ%$NKQi_C~ci1zf`=>5FgTZ2sy!73_Ib-2<@v5 +z;0juF=lnKxF4CPI&TTEKb0(18hWo@0J>3`C*6KGPu@{LVm-%@wymmv3wlE!$*4Wz~ +zk3mJ9;1PNUMZUv=MB?#cfzTS!yQsHbvw(|CAAT8}>2==Mh~M&oFS`D@q%(n))_v0~ +zqhZ;Xc#@|o3%{r3GkZf4+cNq#kut?WCCHK=)58??_~`%$MakAANb&f4KGz}o$W?*` +zbt-Kl?&6QtmslMc8`2jAoyV)p07#Y3J4<~lR9xIQ@GEK;Zx*ze6PYKNV=eqx5?HT) +zk6!Vs_o0g;E`ZY^apP(uYolr7dIKKSFUz;4wgmR8UuluUo=LaKu^DF_D-1Zb{a^H8 +zDiz3IwjtY4_+q!Q_Z||$w%IPV*bxc04$&UbNnbel=3DJyr;SNv6M~)<`7sksib9;@ +z5ni1r{q%gXu(vKM^~miK`QqHh!XCHnVxDlfX!7~Xkf+d0VVpul^EHkJwD!*jbOs6s +zma{dtA_#5VIU=3Rz +zSU@yBPI@^f$09^x>WUmb_43;Z33LCvclhDO;5fR7^O6g%%il!nCV_lqf|_IT9i? +z%mMsc%Oq#eWq^#eT0RoF-mZ>mr+sCe$TAvtAolv^%mpp_^q};G(Cv#wTBSFl-0p@h +z)&^!vTz5eRH^1pNfnho3-L8r_>Yo79-(tcBjh9GQI_`25sF-uk*Uf1{l#`+ypLa0r +zITeJEk5vymq($3(%e=ZJOq>ph&BuBd2poW3r)o-A8m%0naUUhgKmghP)&TF82(DK~ +zlctB6hhMHx%Zt)7kJ*LQRqgqm0L^U12atdz9$+6KDF~4+02eg4rRXPj7vL6{m@fzo +zX@~0aO^?`3bsqE?(6*pb87@!{inW3cjZ84|gy|=^I#5~^>5A+} +zL3W&I54vI81)?>jsI0~iu51qa0e{vd#uMhR_-b=}3HJoeTRbiUj?O*6#llg(T^QjN +z=MCy)p3jlleLvB{edJ6lZir|UQ?)VO!DPDd-qn`uLTGQKO&tMi;cM=Qc?Vd%`{K8V +zx#o8y|FK3ZysXC$!f+`C>e#WoY6xf#1gB;m#-mm+;mIVT1_-+iJ&?5dFI8AymNUMb +zIhlm}zyWx1`s%R(+b-ByUdHx!@9=zs)0a%I|3mWu0euEcExQCmXO?df18i2Z2nj}R +zLQ`FN!RF&!d4aN4Yu~byA$4(b$x+{P#7xsRR*EN+)m<9&1SO7 +zv?qJ|-jj(4j*0XBdb{{$tQd!$fPR>A-izz;+Ii>?js`jp4yEUJ%|z7ZYaGsSP5$d4 +zOjJ5Xok3K<3EIy4h*;Ea +z%9=808&~n76($Eo+w~r8WB}JACrf<=>z6AeRxzT{8!65B93GTPJ7^(&lb<)`XmKEtMS=4T;Sa`O)#o+?vMrrf^^h +zR`Cf{QdoqU-k#IG22Ca9?yzFtz8Op>j*TL~l6?u_-Sr*c6XTqhzs%!XJH8Ga(;sJ@ +z#gzunWJUV*C_N3g3dq(4RY1n#ZsVFijW%k+bZcONe`#KvvnS|UqTEw*(WHwm7L!QC!asJUoBkM{LZV%u%BIE*jsSic); +z3Jl=J+B~B{4COJ#$3n^r)ts8m2E%t-Y>hT?LPKach9TO9mYVCLgUOl=h4@C_VV@!c +zk!n9pH|yiBzAY7uMuNvTv73@cKaRv{XQcBfPzm9EHkt-B8;aTB$$%S`=^qicKSr0` +zfz)rlT2X9@BH>J9mJm`Vk9tazD=FBjJQCqV+g~XCt5w5zxixE%XArsrw83w8cRACd!(80jWD{!C6RE-u-$gNe +zxXw64dPF=@Qf!S;b$$weCoXG5AF-)jD<7=1Ot7 +zRB788Ys`g^0-s3UZ1Eg;SgXNY?>kf7;cF~9-;~M9i~KmeWjWihfnFFp*XH-yvxS=A +z^|15HMh$SGz%!(|=YyFPm-_l(xg+6RKwBUkCW;%8cXOEPDYPPFcK6)H>1Ruz>g1#A +zWgb;S+a&WKaO9BPG08m9G{g*)$D9Vq@LCV;2dm?+xmIxnuE+~|lB57S+CXf_#(ExcsehS;nPDsyY +z8N|+3OFD1CI^-%Wj~~kx#B}+(J}X+t1(cXWM}XKQi~>>_>I#`Phn_|iQ`#1Sgi@@Z +zZ&)la7=#||@;Y7IojeQGKTGre@xJcfm?2_ZA(WIewgD^br}%1eXu$11^^MSld@ZKK +zXhi1sn}dXIXBAb|rC5R3)12&Ci(=uhI!?yRaym|cY47vUs2jmFJ*%Hn=yobXtQx`s +zoN|=7h7dXg177(dXTiQCu~)+4-QDCn&w7#9*~@{a;6lXuyVVUVl|Udhx)SM@5PuZ{ +zHvukoL9Ap}Hv65apP{Gsb+px?s+`{2z&aM)bndZk$$YR#8Y&I%OH)B4n4avoHR*80 +zsT?b9G*a}OR%%8D-MB1J({ncLMylpyUG$(PEj33BvvZP?q2y9L+Nx-TkE!l91pw+onapYh@Wq;z+nSU6&*?wWHqu%VKy3ZQE*W^tdQhRsbxiz3Xzf!mc=yN +zq|-VLF9ok59{NK&{8-dE+FDQC(DEpwjbT!aG;RTc!ioT{VM5;KpQTXQh1K0N4Oh$7 +z(<})E9F+!HatyIFJhFcDM0gcYC#V#Abc@G>q!p8G->f6vs3z9dLzC08huo_{7>=Go +z{8R)n43kB#Pz*{CPBTn56D;lNU19OdN82??=oeF7#wO{?BplVyU>V~(0h)btf7D90 +zabhFX&r&xeqZedolrGd`{b$phPM7^IVnTY*ukAR6$gsylWTNOM_lVP3>MaE8*-?|1 +z?9>VEgf)eE#D{mGJsO>trMJk`b2oS)ZFC`!i)y~>!ax_L4M-nCAfS~io$vrQd`>e- +zQ5Y5W!y|{Wc~j9gT^Za^xtNc1@znU7fwdIt^|4GivGz6-r3!i*(vI|WYUTwMH8Bxi +zIgMMwne02Ff#Wqv)LP7*Irt!}*G3DB1U7$`Z`LM0_n$?9w+XKnNHW`Y_vcxVN!$@{YRE2VRbiJ*%CNPph+bv+Vj +zMaCtWGo!aNkdw*$Oq_ln4tz_b*>^c5TU`7(YHv!u0YDp}C0K|jd?0#ZONO@I6%?Njt)7|Q$3y<`J{bIg~sXLza_1l|Nq{C_znFpA_ +z7>i8`vQ*h9+W&Af^9@-!;d=4$3ugM>)>k?7^YaF}<%OgQO<0?6{IGGNxs#;1sj8l+t +zLPKHNnu0r#pp=x9piDM%|AU<-rxHM+Q(kz8Y9SUH_- +zvuBMGWzevPMwagruEEdBziI(fdm+Xs#sY~(qd)Hga&b5%P*lB#XXBE&ma?){{^HIgS +z%(WkkRx00MpzN$VC{^q}e4?RAyu{r|yF-&1s{#Ccitt6?EK-McW$n%gZP^I$LXlMY +zSP%&i3k>FdXX()?kNudx2^NP>by?%>wQo^a99GZ5EFH2Ko!<4Ip^D=zl$%plE``=t +z^NFIFaLB3`xc|=+vrO(bTv-!cEHPLaC=R3S;eHc75-z4)xG%b*py@+*%w6SK93#@M +zJuq3=#&V#}HIa`x4d~RjXkR*IHwJ*Uyy6t>7^T16eA30kwi;C#lx_nUqHeQC?farG +z5b~dofe)5=Y*F57#Sc>{H=vFzZzuv?suTfeof}5WMErsoDR)Wvw3zW4lKL$Rcu6QV +z^jc`7mG~8MAnJgo9E?4W)s)a#fkDzV0r|4_PJi~p~JwT>at|xpO +z!%y>5Aeo4a?;Z)AU%9Qx%JK%3R3_W1$*R@=&Q&F4xQUgIpd#YDnmBE*8Ki=E1 +z|0uJr_lKmn?s*`JLzReDr3_h9`PNhWju)T~6Uh;1V*zTWac%-w1oUW$R!%$=41-s8 +z^CTu7@!-l&8_$Yu*v2i|{@FR7-8YdOA39A+ie$#HDdnxKEUK!k-0G;TP?eR55>*Av +zT`1C5)UuL4Qq^nOMZ1|Ju|PDmt9k}2p&9ywT7`52m7C^9I!&>rVWNAZ4r*reK1|t +zdqin%bnbNTY=X9ncSPDdqz~9HvM9tX)mFG^FX!MW;wbc<@zkhCV22~P?e)}=A|{27 +zUA0Z<`M2Q83b^db5C`*6lRPh?{m+|oJZXwXm@>H|%IPU`d7by~FtV7hQO;D_An(&s +zo+eh=Lf#~i#e#yC!cFjv(olO#jen%!-@z0VYweFS3-#?5vSnK-hg89MYPh@hOO7{q!R&@OLyE`3C3g;xe +zTYnw}Xl@E26HiD|N0D)A74^&Nc8~@txCmAleT*UXO^B;_S59r^N!j#G +zbLX5rNKR9LUw1m8NxjRq7;UU=Mw*!eLzs=x?%`L@Xks2pZeCvEC62r{+q^%ix%sVL +zOuCox#_ubs5odB3e(baP_Mo!K+%D>42sp>TGN{>%l6@|hWGqV`thvQalzC^bf8I`cA{zW5@VUv1KoXG_vqPmKsq3K9}L9Iz|vf +z{Du*0NQn6B1pWiZaAxiOkb!dy3#aG$hpTqnrtXt8D5Kt^6?ds3LJN}eMJ5|8x)Od* +z!gt;007HBn=ki?8N!3;7&ve$!@z1*~B9snI-6@ztUKr8f1~B +zf_vkGh2^)4VCCRrtm=Q_%e)&HBY>KXm?tfw$oWIOXuA`fD%%sliR2P4M}e_%qBJjp +zdIi07Vcdu6FaHz^XV+NGCeKD-)v;jg?}p)e|BDkvNKE1H)WB~3`OmJUAffHiPd^vV +z=RH5A{z1pz#@v^c-E=bJoW-}g7=!FU+A0u2}g!bJK +zJ(YvHJjq(PPO9^Y`jh)gQdJH)n0%A0EKbEO{B5ir!Q=6ikM$Fkr!s;_nEV`WyyNf% +z+iS|#KvZ891$z(f3{(0w3sn!7mT_%sBGUMmK~>bITsGoJvv!!(rm$1jPcaKZ8e~L} +zgJg^VFXhOk0_@UWc?33Ua=J-8OEJ;!^Z-Z<-i0z_uUuNJ@viG^^8Asj>*;yqUW=Ae +zS?Av4-x4J}zhs%oZq6I{az$CrYjkRv!n)Jq_gXu&s#g!X3`dYV8JI>;2S0DjZ)#sm +zSA0fp5b|}J;0MVXm*aYb^%34}xEQ~ip?LfyAJMFd{dG&bR8!4Mlo?M0P-TxfjX(?J +zyUiaiQ9!Xd`QnKU^;?;vN&;6`EU3$OQg;cr)V2Lw6jUjM8YV^D2JT{R;OG!1@a?w! +zNS)^bcrwe7Z)@Lf|IqL&k%tpG!=8nYRG+cI0nM&1vSk#IBpI_1)!Ev;&F#JY6yK;f +z6Dvn6VqG?X^y&1&*9>d`pEce9*-7|xbMfMSJmO+m(nO>-Vht1RewJaMpb+`W0l8f6 +z86acBIYlh;hnyQcDWQbwmBcAuh-JM*15F-Qm^55eCL*o)yMZbzi5RC*^qr(h)N1TU +z|IBCVj?q7qNNKVK74nyEw5}wfEvlDfWK@*vb;=jhgDzr}gv(@ul4p1un`IxAPoxq_gtGvR|s +zmo-mCr}4=$k0;Ef7$A&77@b{5-%Ko~u9Sp9P@Z9{!7wU9ff-|-Co~XyUt2fvJWDML +z<%+qodEMcwv6E`aMVAp%quEj-6h~zB2{4#p{RPpUk1+F`>;%(5zK&q7lZ$P1~B;N!p0!Z(2{Y4M}LyCkYQ;7EKP9C +z1oJmEH+}%yV?xubT*g7G+IM2i{aid!Ws-`RsBfceTil9WID>EKysJG+F&Rjg^xB^d +z?R7i~i#iXPe?J3Ww+bd;r%BV=_j+s(r3}sQ)Le7uRTPeEm-nBLA?Xgu66cja1;hS) +zx0#B&w)m+3C%b3Hoojg&eg!QbMHeQ%$1W0;93o#XCBh#fiL6{Q_e;;VD|cvUWLQ_7 +zGtp|!a?Q3-3K;eVQONm^*@bV4lU*fyEzyJxFQgLs-*1rw)OE&w1$i<5=N}@!g2%13 +zQr7Yf4+X6JCh0R?rbkeMY#nnPoA#J+NT<#zO)Y@9Q&V&|vfmYy!7wzrBE_+uFi)IR +ze5b?{GX5qp^_DRnQ)QGD6Lo7E7W~9JiAT~rh*kdBJ1WzvWFDM;*1Np1&iojTQ`?H= +ztdL=6xafJfl2LoOi#F>559!^i#>9S#hD2r1=}`+E+$KccyMnQk)BAdMW~&j(E%HAA +zP5ZQed&{Z@z1WKrXtIJq-`D`SZsa$A5BqKfo0+by+ejLsk!@pK5P2+GAuS~(&4B6_ +zl0fRNJyD%PL9>(9!{)DB9LY$-z!4VGkqj3dHI1pBSFw1i(4sgtHL2=E5nqbF_^V=2 +z3)hZ4O=r;6?Eri#O(r&M_A{X*MIYw8L=lH24EIALd*zht1%E_)gkq#-d|!J_xAB!X_1F+(2c>=V|S@} +zA701N1bcKEy>ypIy@8p%)oP!l-+{5L&mLedGXp|PCeyk}VpFZnH!c9z~cIo0sS%*s@VnuP&+DmsUyU +zbq(NP{IzPerFSgjLxU^xC3-%0|IGQ<8Bw=Dh>6p?xT(84?sQ~`=JDxNHplvRrmlyJ +zASK(5!zL+w@x@gmd79Bmp2UqL*8Ftb_%-rmbg`IYlwSUgSt8Y9qA@+IY(0GytITzE +zgTO9NGU>^~MfqL8&aL4clPkHmhd?eFF8rO9%i!|fQrD!L#aa@&LByo@tbX)jWKj$a +z(7Iu(k=y6TS4cZ=@ia8V>!RJkO0Z;%zfsk}PMRc!I0xpB{j$0Y>}DTXKq4B2hgo?O +zz4&OT)s~h`3MnSZ;>dV(r1zgg*B_Y>j*rLqjF|EPRtxo~6P(5863Ch&DNz+K4Cs&6 +z6zvQl_-n?G4~~u1|1d5l{Fz$)!)kYeBT1+ir^VQN83wStiUm^+=Y3A?=C*(rL*Ll= +z6qzW_5_$VJ)Zz7s;Vqzi=@9i(qh}mtmIt})H#krJq%FJdb(ZRj%UOt0Ltjp2iVix8 +z|7TP@tlm-Jh>N^R$U+)cx-fo;vQ6Tqcx#NvP=SHK +z3;`O^_VB;PH?A9JEU&cQx!uzW!#U^G^y)cOf|OL0DrUVH6UnH670SbyPfFPu@%slX +z!Z=9zc@#w_AF%;so>Qi=$osRxE|kPLDH2wS>Y0JYb3FPd-H^4k>9ikksq|~B5)A6Y +zq3TSS35`M85VEjV{m8Db5BsA$Q$#1s{yBq&@NFvHT!)+acjkz>xlKHh2~Lg9?>y|5 +zQW0DFDRh&Gy_2HC%WR{u7b905SzhnwFN1h^cwIfDo!nGjhaUUt;mNi;-ttHaZ+;Du$|0w0ZQNhB&*_EWM_(>1p1fe>ecUxemCeBm!it2 +zZG){2((YeMV31RGKA~RWE5Mi>45Mj +ze!2+4^sot*5G=W9N9|h4IGjeN-&M)X)1ZHlc;+@Y=>jFxEz4?&F-9ZxI0vL +zg|;o?;>1~Rc!NmUVc8F2bSdU*xfKK7(|&8(5dnxq%MJJnIM7+PpHy|QZN=dsEF9Au +zF@Kq8qc_A!KcYKm^fA{{9#ADY^q~Ih*3`yPNz-K-*{^7BLAQR$Ajfqyw=*_ +znL9-Y%e(i$gL6B{wyla??)Y3M{@B);?+4Bsyn*M8_e~Bu;CBN#UvPf{MsE!HF7?(O +zPhjyRi8$i~ZFBSnB#u8``2rcO{Kt$i8!ed3JPj5{-h;XAn +z+0Qs?3pWt7VFaxN&msV>*Fpe)`f0Z*`{n3YoU#;b0evs|$8VOMfC0hfWdyp08npHY +ze}7gO-E2oiyEYr99k`9i5LbzXswrM1MTUM`K?5)@Lm;G}<=#5Odx&kgtsWa_eeh|! +zaw^Relo$0iD2*eOIklcxiBfTLm+3X)2J+B}P=rx&u$Nef6%fcl>rUXcck{elV4E3n +zHp^jogD=jDJSiVurh!gY)_~6stvUBmz2?bn)ijYs5X@ws8RVh6VGC|u4k8rcVW#xbXFfv*4WKrh`0=Sn~R-q#es +zX<|3cz4mz1Q0?a>)OfDx=;cW@Wno6h;miO$wwrvRpU&we;Eo#aQP8fzcw2GkP}qbz +zU|AsboZj{y%v2t)IpW=#YA%;w!`U!JTh{U>YiYi_Yj(J-d6o8ar9Cmh2M}^i>X?J_ +zb?T(&zU=AK9XHb4yX6w)!ddSWrKvOX|H&z^Y)!ty)Ns3-x98q?A*_rG`Y;Zv9J?Xq +z*E|{4=8oGn1ur~ZXD;WH!D%a4>Tn*!b=e^0m!atDKEr(CWy(e|x;X&n1DhAlSg#g` +zco=lQ>s#Ji2k!>2*sf39-KjGxZ$vyxAiGXGIgwjwg_+j0Nq>s;V-Mg;;pwpTghFxZ +zhY`^UcXqGqIsa|X2!QL3SPswZb5dier$-jp(rZa7**()dL1@bfG7Uh*W_E@|x_t~hR)ovllc +z^AWYPte`N{(~oW;>(L@q0C)5X!&lK(-tlca9XsuuMWzZ~FWC#fTyWH=g^_YSzAl@` +zAq_ZF{SH0(9vc(@2m7J>y>+Ty&Ye(=E@f>sJ6ON~f+>I>oRgNwCxe99sEN(`VILI5 +zvN0y&*Puw5cVHV0Jj}Z?9EJ%~cR17IE5&k3u~+S4*ic0fDm&*|rrW$a_L{IT$K=gl +zc%o&^0F|t;m;Rt{9Up}DS#NTUpOjYcu6OqJg?l;@@WI5K)&dS{Ymc6u7d^~vTKFsz +zpY^-+>`)HV^0qOu#V`LBTfTSn`jd9moCvVQGxTS8sz(*lL~6z6(P61dcSc^rH9s>q +z2(r$!jU_N`u)=8#Qs`-FG950@n=pu6(?@zD&xM6rt&YuMoAPdT*hm4*&f0_W7urj^ +zT9xBmXw$YikFB#o3BE{%o!Sju>N1xe7LeCht|Z!fvwxxa{{==IaX1p-JV^PzpWkLR +zz3A!li=H0%IkD5_#99gvADX#tx?`P~hHQC%4e)tV|qn|AXmF9UD2AyU$>o&kezVPXFz$5zSIr(fHp*6G +z4?A<^giIgJ&{!a5@wtfOmA7(h^c%kMeBhx2?+Ut$_l`B*&dUHcTV8z}pv9f`0%$ei# +z>vr?18gzx^>2yKzCwx#%cLpxx_oul;|qnA~bYOa}{j{(Jj +z3~ZAq-QC<>-MH>sT-~JfFJd!Q#6^LF{=^d|$q_aPj5w +zk)1&I^wzYzif;H~bn%@{@ft#Rl5S-#$+V62cnU6WR`Ky;-f?q{R2mPj>Wy}^jCwc1 +zgS23kXuHZpOv}h6C=Zmjt)>vSnB(ClA0{VQm`<^f +zPb}4xug%d`rAf`_YHf6qIGWP&Ef@UL(p)3?kHDOD(6LB=D_4JdtNUyXXA~4Zb*8ty +zHM`W2ch!l|zPPeL&!Edxb9HV?hR3&Zz3}MD&f$LNd3|5ywMveFdRgB7a~vHO#U0;3$z0-WsW~eiW7Ca5l5G>$SX*5Iw3g#G +zF8^9z5(x3CX06P9cYzEd%_s(1s)TH9M2dQMWZ`Y-tmDoIw1?=OpW2;ifkrvmIht8= +zt*z2K+Am9*j_pCZdUa3d^3AO^Hl|Pm;@n&7pvzQ&?#A_IVkQsM6P?BW9`g%3ff`$a +z99fH}%CHC2OCs^5<~){5_HdA1#9dM4(fuAS@3L&wTbB1TYiuq-?DQ7F1WZS&uk(K1 +zGN|W~a`A)1uDnMM3M3#{Br46>THrg5YU*NYIb^p7){PL`U1mOoxcvLPv3#TW|c%;hBe1vSXE_C~EWGS%6cU*1}v<8X21;G(V#PHal@#9QMaM*8N1 +z*$b$7vsNBmIDR*jIuq8|*#T_D7gClv@1^9Y1?(p0s#z)SiK!*ffjfO@-#u +z9!bZ_RYv^c>NdcCi5jl^kY2C2c*@?<1zXd4qh1c2Ehzl!x16Paj0VQ30{t7Xy>sn5#RRfSz=;1&dv^Si^By!Qr+R +zAUA|34cn@*!taj~kU_5V+F|Y<(9+M%1v>N>F=^W@4kJ8trOGDqTpPKsuyi>XYo{!g +zlK0h1eDzu#Tbtg}pYHZW*!=EbKY7dnVb82~MQO`YWeF=@d7;~x0z|n~MRICdYZ@d) +zoDXiTt!z$J=skJ(B=0&#jvw9JcHQ6!Ccj_7>`yMYN7v@~_3>Mf0z7tGI!OJ@apk0y +zgQJM}&C5(cdwH$BF&t>6K6o33aH{NWRU(l>-JTUK2lpBw9Yi-O}Q>a9pcC2D!? +zuaS@pO|ylj8er}zO*vNQ#myS%Cn0Sg=Vvc%U}9hCXYc3(L;Ww{Zv(U%!rwsh$VIKZ +zte-NGA0D1(Oyj7%gCj4^?~mMFy9NQuVNhdOcCV}99MX$J984Lx6z +z{E?QPrJz@#2hk(a$I)ZbONfn-Ct8Qh{YN;z1}=|iG-fGh_8-F55ekZz=PsfPD$S~bLkH|2^(dpNgc*$6!@; +zl`xxnH6Q(ivEf=N6x8P;W$DX3EdnB9jjlB!25;5`>`zfMx?{XsY5V1Q9K|rBT+3zUhcBhP`hm@oJdP +zu8m}NS*RsA`Y&O@x`>xN8BPgDG?RDYpK>V;EAL}|ZQ3oSy5lC%u~Ytnz*9~QPgh2{ +zlx3-+obYmlZB9EVzN+IBtW1c^%Kv-G|A)l?|5$RC@3AbL--B8H_n;FNW@gU+b5g{G +zx3$N&vvpn3@$}f;P2OFc>;g^Rx?m9q-iVT96c9#EPEJW~eD)s+jC3-%wg~1xY2iM2 +z5g6l7Uf#mCzTM?N@Zgq1=I9Rn-!oJ6kR`zNSPKuhqsYIptxLqo(>H-DpPjb@@4Ua+ +z3n!bEs_JDRjWQi@u>ZWY;J}JG=xc#XW)(h16==Z3(C7ItL(VOdP +zGaUw~#t(rZ=NQ68r*STRfq!j6GvC7pcnt2pV${r&Wt}waguVYudL6zLT4WgMIqyvP +z8d>IaKf6x!MfqxOf$7;xQwnS$D5~pReII*1B62 +zcNgp*<8$zfG2phnZlG0Ujb#<>S&0hJf5nKYDiH +z2J4=X8k3Ef(74+Jdqg^Z08#~fc=bu-zxjF~#y%Bt3u#x})eI>&3L=SKWIZ+s>>gyu +z-yh`?)W+|&^z+$k{O||fNfzMjQQgE*TdSY2Y7v&mio#RyX0@gA79 +zUjUZDr{E0XiJ>{}TC|SPD`V1ql?F)4d4FOC6K@8W1(WjMhQZ>Cqyku+0Kzc)WyUn8 +zPkT-YY}o8jM`mTIz=~D(*lP;x;;TMt6=vui(k?{lHhZwzr!bl>2i6T&I3ekf=AHOTwb8;JIcrhm1@uhB)o6qvI1z6sX-z!ETeAcG +zurnk(l>yzF);*9->?pU1gaq{^M4ZB;h8qZLRzm4*(ECHJMvVVn;7XlCq~~p^mvTnC +z7yGy^{Exi@ZzxIDHTxfK$)5_&Q2eL}Bs&Y@Azg>>$^7A78nff;`af|GH{!0Dd;DV@ +z5~itqpep39HXk+jSK%Xudq$DBQHX-*ZxH@qToUadL5=X!r}uOBAl~&7=j}fU@h+bT +za|gPhwW8b!#1#GR4(hY*Ka?=Kxj`SuF8@wY3nZ)f_)`S +zM%Wu$o1Z0rM1UVx%bD~};8In1>YeBSZ1i)?W$>ZThbdyF57S!UmiZ;aF9QjZWrQ+1 +zUiMnlulM*Cf@Oi=P7<>To9o9WGd0=>b39p?e?SF4;jCe>hmvCOYY={(?)*4|3Ge2R +zS;@{own`%~+ad#q_tD=f?}cEDG@$J>^Wchjj87*5GXQ3lQY)t2sVvk!OSc_vN2pXh +z`q3`I4-MB=gX51iAcxH;7{y~uHUudA4gO#;TP%VF`TzqA3aCT-552ek$GPw09zAU( +zWQzt2i7kW+D-e*?>UDsN6DM@!Y~$Y1YtzSvnj7$}hgB5e=}C`h9eg;gqTmKbIy86)rc`)j?9Cl`#wjHYH$UX5!KH&^j+SE;QRW<;}tm21b +za^!T#6V0DbGV_5v@$>{ny>Ax*6vhU*vc^nPjGD?>ilnK9+d`fn=aJ9RYpnN@h1oNd-&+kNPXNxl=3ZxntDQL +zMhzq2TUm)x{$TC%HbamgAz|JK7v8+!wlwY?_q>|v6PmDb7u0|DNmpncQ%_OH_Sm%* +zzYGrdSn~!wOwS5y+q(L-+WA`;^r(CJcD4q3Bg?T +zi4%ut38)9FI)!$yl~FyMvG6;TG%|kr9ys^er(Fq1sVkAq2@tf#D|jU(T~&B}Id0JJ +zKsfQVK2OFEqcUO{TxE%rNCcQ@RqF@%nnP6Nln6wLIjl}< +zHacDs$EVdSYdr0ybyIj;enHOr#qU7_0%mmTiqm;)O_#z_;}OZYqZ*J97*8wfgF&(hWPJihL6ZTp^7w(-HAA|0 +zz~*Ri#f1XKT@MlWi=h6}-J9;|6iBwIdnkE`vPY;6x0}>>cu&c*_-o4BwBZ(wRKVC| +zWmUwf-!0zQ1bXGZ)_3UpZZfV7o})Z+dk6WZ_!{8HE)3xu&^zuqitd~2Cmlo`{M+BW +z`S#i|zii&KZ^}UPO}C1RC#D$e`~iUcA}EK8qP9m~J@4S_1gRmVhVP8IeUvud9YZZa +zsYE5MA)n|pf!J$#cL2Nb+HxXD)Vao#__!Jy**kIE}9TQP>eATQ#@ +zY>x_$Wc#QZRK1wS~2$+{rzxxwoO +zvafmZ!?<>xwf?*6)4k^8hmgM}+eEzTNAbYQ+LL{TwGRuO1=Acf(E^v<{hE`}eH +z-LfP`gkeWUW<<)xB`S_NIt9I_`pD3e$7o4&^GFK@|F}+6J!Iz*6{IpuU>esfj(?B! +zkq0FK$661s4*718*r(qPy>At7f4(Ha!cgi{|&p8L?^{BO&qBv`4EB(OSQ+ABo>y8LY|3h1&vT5 +zVN+;fQ(#OU8be+rMcX{@fGbQ^5i8M8B!w$Yg+q?^t%vb~#|^+dBMS~}y5WC<FW-3@DWY(unkus{tTO{+C +zF;(;WDtdKYthHnT;Qb37O#?{NzWDX=(bp +zY$-aHJR|*BKKmSx@q1er-RSYLS^T&R0S7Au4aq00q+a#34JVH1J#P&ufL!@ExC$&m +z@|l{VNUo%u13Ff`*;SmEZFz5b0jS7i;ZW9---f_amFdWZ^dxAKJJ(O)gqVt@!ZU%3 +zRh+@4JZ}&Ju{nLJ)`i4ZH?TXLJziK-vTJP3S{xUX+ZcvGAWQ +zgXs<8{F$Sv))ir0IuVx@7sNuz-lMqGIc4&NwK85o3{!+L};EFl!As1N85ilQa6<0>vu@M_6U3p_19I1tmcNYKYzrS>Ef%Q +zJwjRkT2m6)%-;f;wU?~G+}#W}wag#+Ya09g!OE!^Un0~Q^~ytf44E+!00avJ51!$> +zSyT>m^zGbQWLsYNxSGM*cex0b+quy%S~@LbGiFy~!u2mZ`H7l +z8;S91QFo0NDeiWok@F3wI>0&Ed%4#Q?4JBT@e&JvvP$0&9u>CBtuj+5`{x>>PtQz) +z2IzFW}GYImn?W`RgsPEfZNQVBmL&%VR3MxFZ!rSX1Tk+ +zmvbvm_WtMf&)XMp!l#y8WT|Owtq3qC&|MCtJ%12zmi=RSTeC!{s?UZqdF(D{eeNjd +zd?fB%R*em>fi#_e2@9Qq=Ag74h+{U-2&HYKsIp75Na7o8Ps(J5_Uh1sv +z6I>C*U}FWA1lOF)n*)_(m>E27=uP$K-g5o}c-D>KJ$s8X{n#!A-+*SnSMkq|Y~8aY +zuPw~}+$0-%iQw_M9qb<3osRIWPY>biZfKB2D&0sYrkBtPao`vb3Be4p2%!vtfVK~j +z2!RZFfqsB?g>HtvL$*OaCY=(_h*gT+70C!?Ml*&Sa0#)7R)4%+34)E%3ryNiD#X|z({3{x}rJ^+OnL!D4oVijlDj@ +zpS0xVSaLhlt&!zeFk9m1lg-(Vz=5zo2p|Luynol?rZ%oE^BssPD+)Sr(Bu@x1-2}7 +zAlriwF471`-E&SG(IQwCvt<6y%4B`#FG<1(#>`@=}#jA!`7;k_e6aQ4&N6iQm +zA@Haz6di0!>OW_&>Ltt?s@P!c3Q5i{Y}oO{VC0|{oC*De)z^V1if^8o%P}m`4g^75S{bCAO6Bi1($2+ +z0{FgMT>cn-zPLkt68Z2Zt?6H&4+utx)JIhq4ZrPMhty%i@7l?~qHPnD{e(X673&Ue +zt+tLp3cO6ewETKJLEf%GJcza90tW`aHC!NXM!A=JH++b|?dsc6`2&aW77@l8a6E(V +zyS2g%7Zn!9u)9|H<+g*z7sH<7v3?|cqV|vjlh3YOki(uLEt0@m=jc@!-3L+e +zIpVt%46x$&8SG)=p4k@nFK8e%W?RQ7_jt8rS4@zS9})xY5`Mfnbbp=2-}?WNydFI7 +z7n~yeqRaoH@Fv!r|0;r78R^9LZuy*Am?89{5;XjLCp*Vbyi| +zl`4^bi4j;=yNK@K-opJVLVBCI%RdpC`MN@q&8knELR*fy`}H3VY7WZ0?*MT4%`76s +z))wqVFsSaoijNOp^5zyuWiOqKHT$^M>|-w783Ckcimh-|s?Roe0Ho+c1^leQ{tm6w2Ds|{(1SmXq%=$cC6B86T0qf8kEgOp6& +zRU2Cl%g>}t45OCA(#NCYtZR`Y_}nVw0xfF|4Qepz$yXbI4WLj! +zhBA$3ujQWvnwl`SRf0(&W;3@*)ibTsbix%AiC +zt)G!wijpK^$N9;>@sv9^O+5M4-Crh;Qu}9}boh*Ul=(;14Ws%VA46@*C;XnnMEjl# +z_YWM1?9lAqWigGv(rsbTXM6UmKe{s>;|Flm{@6yaljAlbkYcL^3#-~hETU)G#jxs% +zh+OlL;wk(r!E-3ZkeD~8Sd2A+Z3+zyVjkdLmV)RuhFep3ObR~qb;_~|$l*jT3_w^8 +z?km0G{LOa%y6q(4WT%6m5Qb1NfL`S$Q@%|5TkuWJw{&p)S#$DFqOz_j=$?c@#f|BlI06R~UzURXf+C3~u! +zUI~$J(o6qj;Cs6(_U+7UZBj?8XI&J=rgsiwFUXY(ZR`m^SGueyuw`hc)+>!f&+S^_ +z+Lbd4nk7Bcl8rQP5g&tPfX_vtg-+Tw37DnPVQ7|1EZ-5$j4pXJx5!|d&g3ZXSEa`F +z%T(&>(P7LR>@!cok1JdZKo5q>E#Ga^R4p0!y^&e)F*~(|{deZG+gcljIE_l8P@=X56kO!X-7N +z?zZi<0uudc==br__cY&gx7X`sGD^9(==paweka$=PkZl8hMVSClzk{U#25MME!!F2 +zeYk#%Ste_dF?F8Yv>|c8;6V7`ZDc_LC6>rOrO{5jMZ1MkH@#+~Wtehff6~SLY*3op +z`53%NSrymb=q`k6ebSj6EGf`Va^Fs6Kr0aXrfu>hHY%R(yg!G-$vA +z0S;~_H;ZCg2J_>SCTZ7&hKBk|X#hd)xi5Kjwde1jhmC?Kg)^=@(crj&7ZR5mHD +z531C6Z8PvDh!XyEr4dO}*un9L(}p>UIS~(aE0_HLU!x`)p$=%jQ9}YcV=X!<2k!t+l3yLqWF~~q8(5lK6&uK3`*G=nu6n8(Ou1)5 +zSVDfgHEch35b!}568At(dC%iPfx451+_cx%kUEF50%Qoh97<}qNY)gL&;;b4$^6AD +zPntc-^fY&=Yt==Kaf(q+pt6!=IppOxbHMS8m +zxFXy<-y?iwBtc&1ug`tJrDxh=?2xm&%}?bSKT(U6WFSZ!&J;8E9$qiGs!?A-%o}l- +zJ35G)b#84xid>{l&g*bzjPJHNs6Zu +z+XxeqK>axn18t)TRo4Jr)T%fZ!W<20?4qT+C783OX2m_JDjo&II$}%4a#Y;4A?74E +zOqpJ>MxNCsD6i*BDcRa3z8$x{%amjxO`2LIL2a6fDvoTiCr~GgV%Bx74F87=gx}Le +zQaX@dp`Di&z@2#nov0@|mOx9_TGR{^9f^8oOP5*+??o3aQR=ShWEd+%%mO_(W1}s% +z%y_U|ZoK`(Vq)tPS!Di+`(uW!lY=!V{RgWKH4DjP$}}r4r6Vd8!0hdG2%P2c{iT!# +zk4Q%^k+tk%Srhmj#K|`JJP!jv)wbDNq~>X0DwfO>ZPl)4t1hB&0dG()e&W>`I(vXw +zSI}NrF=fYP`jBQ#e-C9vyvrHnWe|g&5r%TIhNux-Bt9!)ZI?6Duq8G+eegZNA2_3- +zQw!MSWVyS-;NBG$HVm>eeh3Jnm==9X5x0kT`!#V*JgQ2#d6kW$JFfTX4{?Ovu`? +z$;z0N@SyB2c@gn17IkIgvgM-wVSR{P6mfa$9J|!T__fmIALw$bG)Q_{0T&eq05?+` +zm@v~!%VP$4{rE3itzn&YeX7pU;b}Y^r35@57JL0}oY_#NVd8b0f3tW*k(qAzL^*{>@-G_>&)+LXa~ +ziqJT!M~)`BIdNUA=D&4=9Ue>YgIOJ{s46j94V*z2om}N*h$fC1y?(K+^eKS}`(qq! +zPN+K$LPe4L+bTF<=sUwoPh0-q-S40lxYj|K?_U;-LU +zjCF3!vuAH}*5*#I$4a8w>6rnU(Ey8m#Lm<0-}R(B_?RlzK^z$|u9OILGCQJWPekO@ +zMqfYBk)3IcC9d;-n}XlFb!MiNVqun+VPKl=NYj?2!!E1>y!zYuUGDR@k2#h!J?!`( +zVB2z!8W~m6%O{sH{#yLaa?$4%UludjW3;l$lp~cU-If(2=FAHmXloT`Mu~K*b5Sbv +zIKeHfx23eHG!qE?^$pv&e?VzXV_O`%s@J(s(JOBp?-|6$m^%brN@0~SZN$h0yUtzv&m8!58ju%KR8GaV +z$j8vgGA|{qi5=JohdAWgCoq2aR3O{EJ=MKUsu7wsx96Ir#It+t=YN9tx9SDUJ>F~u +zzlpin`e+CN<_$QO{lr*NBumuU&j0i-&C-1G8Tj{uq5n=R{Pr(P@0CN?MJn`oB>C~J +zlzdC6)Iu@J4Wx&U`!21=JWq5wX4tL$D%gfG6aJ8QBPG;(XccrH1H?OcXhbMjKcHzA +zUFKRrY^`RRfHoy$8c`RUGDO3Auo9f%NwJ2I?0o79hi3OOiHiI!n&~Umyq@$1FPe&1 +zBT{Rs`Z0)EBiw9HK!GjsREV2{+2QlqQjl9LZ0nEt?jgd{Jc&@keIODP2H|T^~AKRY|8$ +zpXWS3pGSC;VZ__r08q8)5TV-TvJ9Itl4ZhV4~EAt1+1#YG|Q>1MRjjq|4m$nwTC&4 +z>-w>1VtL@CI5kX^*cxV#q}TnJfc!?A5#mYz7RK(72j;8WSIBGHj~90Qxf*0O5`Jgn +zAN!G&@x11SWi;bYo+*=XeopQb4Q-lKVPav+q~i6)9l`+(;7Kg85MeW;w5jYcSJ>iV +zBElw|_+8qttFYd%e2x}z^1IbzXU3kYS_dzs$#14DQ{0$w8@`LY1H&<8Fy`%pM>Nd+dO;y +zc3@G+duy{ZF*S>k#UXpD%l;z|-ehF`k#E}nc)9I!lI{J!cjRs|Ol?6~bN|&_dOw}- +za=Nqcw%%6t+$mQxuWhRyWM0YGPhsVIk0;5(GfvBzY9;BMHB;xNN@dW-kclGE9Ls2< +z6j?x8G;k5lsQqQ?xBec;P2NC6>WC(DM3;q}hAtjMpqeC9MN=wOnMCWIac27%9dH4d +zPR3HJX$U6egs(<*<32zO&0?rgXli=9!Bz8z9ZPz%wqCs?hXlr-ag?XT@A_=}mxpw{ +z;o~zk@R9w|e_3UEEzG5-yrjlORzFF+Ft^wI2I4Y$-ah +zbWan{8+tsH*fSQ=#GHmtqtYg#g+vRaA+l6%o+oD71_!>px?CViy_V6c+ja-7;mw=lmYL0V +zXRZB5JvnQ~GS-ZaFBU-TN%#d6p~)NoS^*$S$b|z@9;BuJ+<|D~8K71G#*TYuEP5+8(ETaBt?tI^ +z(#lpL87qwXva|Deg()qpt@LI(-I>BedRr@XEh +z`k_0qliaE8Lm~31omf?HJqv7Ag5A)nsLn~g_J_Xs+!1p-c!@z%d=QM!cWQF&?e5j- +z>54v*EA0 +zp4;F0G$q^GVQ{{#H$b}jK%4iu=I9gFN0eQ^KK6y7dVbt78i6apdS(7X?wHSsRbTix +z=L)cMQxTsweLcN)=CLg!-s*(=lQVN;Q;E(yA=;7vnf{@s9C}mh^<4)1$w%DJn%!{+ +zwP)Km^5?ZzOZsCm*fYk8tG9sh +zH!ee*S_#@-1=!9|O%I2GXVPvErP{7V}|<$f@?+3Mwy<04OozkkSg5_%)Y?YI>18dY|)uR|Y!Ixzn3 +z+~L?P@t)CjO7v$5CTF(+kkx(=sJ~r3^lOYDem6oh|EcH$eIxL+u^+!4%eo$ZMziSx +z@t2o9^jUqbxU_OXz2CyY75XeUX@eJb{4?Bju%p8tQmn61%}n~1+f2WWu3Eqyj+{(U +zb?~;BP!*r9S7xZwo-K57$60zYJbx6LQOv&`$JuwhPesg?dE&~qUm*O&Tj@EP*V1yN +zc%Vix8FXn;q6ZwGbE4N?*T%7*G}#e2wmvsDEB=7=hUaJhE!AWHpGoxym>HP=KXv4$ +z)i480*v%J8*Cn0QQqEr?h?E#1IyZw2Jc8EL)dr3+NBa9`=aQOWOr(d&_fmYys_fIT +z|E-QRjmGo(RYzL(a7Q`}RZ%*`W +zVmrK_#!2(#4Wqf43w>KsvTT@^XdN8ixw1h2bN>Y(NRxy1-`mddKihUj0v0AFCWim3 +zko>)1W&MB7;Xfo&l+kB)pQ^4d?`PU%Ni(L&855@D1Vczoh(L)j(txIVBmxAsjnIZ} +zg8inOh^W0WBC4hd1T^3SQmUdN2)Y6wASwzvM3o~d!pu{Zc@m(t-5dA(Q{Ug_{}*Ah +zT|U)6s=BJ>a=E2m5CQ-K(53_eV-0u0WN};Drl10srvQx8;j-BWdc1dsmH@N|fF&^> +zWN|qByidowfLJj=2*SkUybk&w-P!qoXJ5zy*UVKDqj?zW_ScK}5j6f_Mn?Dm6? +zsv=Vrcgkis8yuVv0$IQsYw_6(HV}pAH{cL%BcEk=!e%lm{uSOZH^%;Zef|@#i1rDI +zZvfE^@gQF#lEh@+9lej%0c0Nf%D_ICkH6fhEPul*1LN&C-~pHQ +zdH|IuwnERR-`w8-AsePKqWf4RgYG%h&jj$XTzk(Dj_|kR99w3nOPgUA>)dY#?ca-F +zj_?ujI}y%e6I}#hgdR`4>&so+YfR)PCsZ!XmnvNb!87cdfq(Tc(2;M%Ib&y{FK|`~ +zFJ}Cc%*H(d@aUdv-K@0*bk*RE*~1?rjW@gn|AgJZi=b^fqU_H-Q-gCTptp(h?Uf|jgv#vJ$Elm}QWh5UlVli!z9gRV*uS_bNJad@ +zaoq8?^JDk+19>LtNPRI=yN^GDyw5Oaj=GC{A5Q|jUstT57e^snQVnDhYeiF;@DU&> +zv>BE$5VRl!BScp{@)Rk`8}AJ`{Sl!*C}@aDV?;irpTI;>Om5JJ11)@JwPLxB&I{?x +z@%oS`*CQEcm)N;!S{b)G`R^*_-)DtPXM$A64`0lI5Xu@te=!cPJdy8_(^t(p_{w6$ +z8=@zyetr7<%N}Tn^u^Hw8z-)Jw$FuK`t)X{k+wqr+LbcScv07z^Vftc&RU|*yd$r& +z`j4BJ^2ewP^c3UTuy~=ri$1xyBYfQ5zq1{2-k5*B_8c^=@ckrLaQ0|4`?E@9W&Gk1 +z`{@ol%ony+{SLM(d2AKUrHM`ps~d`p&|~6H8)TxppHT7CZY}jpe620OW|4n7t}B33 +z@9N^O1&_$%ylJQf^Y}rf9r4@@0k6er#9@wj6jy-=@-{*3kVDB6=C{yjgE@yRAJIKF +zX&9)VivX@i8~e*s3T2N|(j#An#LmShOnepA)P@}T)O_%Kczmu@l?CggM0p*7vYOHx +z}^+`fulZO +z;MJkE9r>6Q>WM>`juzD-(5Dl^jZ-_@jS+FX18(pQp=B;*V5PQFKw8!|u(6tJMD +z8*F|Jb&)=FgG`+rf6VrFbVIIm6?WFhuH-HYufr{e|P_2l@+ +zKC#Z`?|&=Q9r>_flS6VTz4C&?*Tb!2ZU;^&$tX5I)O_qv_pp!X?*}_s@#p-*n;yKS +z@!R{}oEqX5B`w{MQyTvqHZv^Ak2ZNb$~g4$`b>K`R^J_0WAE(8%4d@K(Kqk7E-eQ# +z2xAz9*U<}GdC!>Eqcr5@1+@#Ic?8&sgFJsrXweboMeA_5s9ng5z_vbco*0W6#{<<7 +z8yR*HkNFX}i9GLioDNuw@cCb0OS(LCdj+-ynB^MJI7YAsUtQkp!7oql$Lzu~0oo7V +z1u?-ouxk!mdiZZ!Fdx=q*Ft_o3TWz163qquJg{r@sME=}neE4o`7&+bW1sSeZ}|do +zf?-3$5JBwojdr{Vf4_lqIwQL{WB-Qzh#!9N1J>Qph%^rE<`c3}34=KyB_%$K{#DO_ +zV&-7jg?JEk{UpKoqFRTEr#yc8hfXQ3IhcTS-PQZ~{CV~7o&Wfp&ST$fWm2%0rzWTq +zrv~63vE6+2PH-pA(x%7FmH&Km`ZxGvxXV7JsZ7Ddx~*p=_Fowg*}+Dx6gFwji-&Os +zdSVaV(q6nYM+$FrLHA*cxc3jvihe})yH?Co>gUR>dhPr!*G^ww2Oq&_!Xo~^QSgMo +zmh>gH|15fa#GgiKnRbbZZk{~rr0I6lPV0H^)^<3?Y-e}*AAaNqdYwV;;0|toHhmpw +zhh0M=|3xyNg`*VUdjfqW12TXYfVob_l0~2^!as?clZ3+lUB3jfO8Pxa;^&ZJc-i+;88{yL_cb +z&9HqA-Om~5^WpY!gdfIQ?fIX;9X#um+Mgd0doJdVSh3dt#^trMmr%Pn-|udW^0))9 +z)g72sa-Cql(zuVst@PvX<^z7QN~C^DKbmJ~gWBRP_mgkxm)y>uC>P+R(4>l(a`^a% +zw+;bDN~oNvFaTHi8AGXM_>3-0{@~;Bf(0Br!sZF6rYIW%LZ`40OGMxBKJk8(2m%PJ +zL24c%8niSh>=5|OI9Frf4TEP4?r3e8-VS*m=}*BPs`Fn9C(_mgFDc{F +zJEh9U2o`-UV%sFWG&c!+3Gx#DpH&S*9I1+amyd<6>>0Yw> +zad5tiuFkH|uF|e?A8em(pVO}2F5oWV?nj?-AHC1+ +z`@@%@Kem6Qf5s2r&${$M>8mtt-2%02wPkB}m!_+qYxTwIpR1~FRdm()8a<^i5!ctT +zg{+_~eQWy=`;g(!5Uf?|9Bp~GgyJJEr)vhMYiGaPb90`#B%|dpa*(bG47PFSeDZTZl(nrxTrMPdV88 +z_|B0OImGH3tb%i;>g?ikpw*jd?e*8%Uj|PH7sr3t?O>`bLvyGPbD;f$gWg2erQ#RX +zLdo`-AAz?J#Zo3zO}H?n$+k7(-xhVutbtq4TVbu18QvIpAeIeqVuI!tF2>T?=e9Wf +z4!^KZ?R|U>G3q^yuVPu*+qTyO^2hCFx)@)^`0Zl)5}EQ_=Wc$=_TP?A+48l0-JUjL&C>yLd=uMw(cRk~ +zX{=6~G0lU`o9D`MEd9%FWxg|em}loqawj>K_hjxfLzq{Yj~?gC{ds)PA4iw +z^Z7j9^UE94m+kZY_8;SxL(4aF?0mV7UG6RC&q>5f54#Sjm-!c$KgvIgK5IT>K3hIh +zderoY`^oLo*(d%j`1#VeA~ABIhTZi_XKlad1^HnQ(!Nm#)zZVy3Jf&Vu*=q2W?`_t{XwYoIFbg@kNV=FuB?^*sps|lDF +z-pL@30aCrModG{>2+0FYKTPI=h(@e^I$-Po>KABwOF|REz7L}lc4`3q3D!TPx(>0q +zr^^AeX-EMRoXUU`Hvr)Qz7q_;@B0c6H{|Ys@AFHi<>&z--Z%F^;R}u5M^5>3voEdz +zVr;+?6M9F{`!ej60Z__-NH%Da0i~=^Rz6Ic5xDdPzyrdpIHw;9%K(iR$dm!gKOo-_ +zUqdGUtLGkyfcWDOTtjF*seEKv5vWCkm{~y}lSeq8bUMMcB8nZ6Wf75fHX(M;qZ90( +zD0>8YPvjYCLq?xWYeKyt)|RZUU>-UlrzGb#i0=?YLnb|8*A#w9TAu_}L=M&ze@QN8 +zL}X?Z_;8CFNvL*@#VKGE8B0T2pX{F$T$0oyxI^Mdg6Ad>u^t)RBMO%YazGME64@gQ +zH=OT)+ZSg4i}d#!r$TDL*18Nn%+F +zEbRm7kdW_@mlQe+qt+tVsr_Bx9F^tt5q6 +zj0Ye|RSIDK>dQ^5ima*#V=K}wD)O)@60<5YwJcy-lg3!m{z@Px2_9PTv?_zk7RY5u +zBv(Xtohw}wPL@zkmgpskDp$n6TT;mu!&-2`F8o4hERbd&n;5h+h-Z+|AfiJ|hoJTu +z_aO~yZ)vpV&_mKgYlqwn!yA;>i7%0VAu0$vXgkPp2YO!;9E3iEK9oMBIw*bURUy+u +z^uJ#v)L*fBrTxp+kNS`B@8rF5)#tE+#1^2qTIfN^e@FBT=$q2l&7PSyhuWHKZMd~k +zacM@}nw(l@x;OCJ(tD%a%tO;RsmpUJ$VagFSohc9uT>Ad4{4R4y^ +z*A<@$xyRy~a#mBMB9i=$-yvUr2}W}VMAY7DJ6WZL3t&9N7h`00-zW==!M9w!gBDEMMm3FX9Uk4pgP9pePTonqlzjeHTEUM3!(y@7CM>fv +zQ*)MSn>_WR)1Td1s36+ymYa1AzTt81yUUf%>2=#(FJ~Lo?)iN$&(s(E1_pNpgQUU+ +zXAS$r*Vvp^j~R`JW4ru@M&~7y%4Krde20PH_+B0-#LZJ?KgM%go)73WIxQZPOQzH6 +zH9jtXjN|zm-zQnE^S$0P&GWU}{f5U**?Vsfq_g#RnpD@@zEW`ubC0{-ZZJ>U*dXx1{dMual_;JzK@oX$@xD%qm|3&eLSDHaCh(GZal`_ +zdk(pG?r?8jbY0Q!r3)U=u!M8M#G6f)5XkMG?9m3y92oK)eZZ;ziJA@hx +zM`b}t3E0tpceTim=oG6u?Q1bdvR<~;m@z6bYw9Isu6-u#R~B^7T*Kqq9=fO{e(=5+ +zdTVmqCvdBjmUL4drATYXTgHQ7w?glV|8@$OjOb!m@!PH(3?;d}cI0Zw{x(D*W{JTX +zmWxG8(v}H1?nH7+>QEPvSm+o==c1^1;iydP+p1$Ud2ik!hJfhrC+rtq^S-0DN#A-z +zVX?v_whi|P3-8$?Gl8X0EvTK7k+i~2O0i!r`mi;O^fntFAC#h!VQ3*Oz`nrYGd1W- +zU?`1zFn~Agx)pYS(~tb5j)rUheb#n(*ak6lH2kz+pQqF78Nk)rE#94V=l#@D37H>g +zTUqNfarD0QqGW1Rre}W^J4JnhPV`(a&7KdLr()_y+!4}KVj9C$^4|0ir^Qnal0MYH +z3Ce@_n8J$~-IKZVu4U*r5AL=RZ1+*?j>WoV$s~@^y=)Le +z=JKA6Onh-eNmI<4>&abGA&P9$KR%4^At{OwW<;j4TC7iU6IKX$ +zj9`OA0kw$aSKf3jXM^uoUUMzy`+!6*b#F&{5e-}U`P46#Ok3ul5{=OK#ojJ1a_xR` +ze6>>S&+oo}kVIk6{nST_-nrZJt;d2IWw|LYQLu<2i;&VykpldW`ay3wO*^byn`SQ{GvDoE +z+yBmJmi9$qg$Q>Cmz3gep*w$kn+?R*!TkNUok(XRrTg4?Bz5S(Ylb%kKr-Vp{ZRH=EC;CmX{SrI6JPl1Ha!%CkHz{P{vvhQV +zda*>bSZ%KX%E2BJQ4GRB=o(psUBqAnYJ@9o_HUv*8@2s5YE5EpJpyUkF(Q(1^hZ_kiGlNvKT!;E%}s?N^D8XBU9rIc87RnPtwZWe?UlrA%&7 +zxr0T1%IS&ewK7s5+2Zfd3)vA;5o9!NGtjS&&v~#qsP|bq_kq?vSFkS>A&974-zfMW +zl&y&C2&55_kdVsc3@%91h}4Lu2n3-aHuA<FPsJP9MP+TXA-ow)dRmF7P1o361j(diQTPK +zLuY^0%nM=TaLD?1K}FcVO9B-t0=IN}b4UlpzsJH+1YD&Fzd?N`vQZIqh@n2Sk7hbK +zLHCdDW(ZApy>|7(daT!r*7Uoh*AJ!iyPMaI`i=Y?*vg*=`0TL%iF{zc@rEDcKXDaX +z*`u;xzBeoBV(N-5twS68+~sKL{|o~cuAhPYnE0#n`$w0fb>%^UU>EfbKP9(-lqV8X +zY{?A>rDq7rY}u)M$qfP}Gy+pOr8JSLppr}0B^*sfv7m1I$rI2+$qhuMw%in1GE+aL +z6Jk@!k{Ma2VAK_5Kld~tDAcBE)?Iap8>>{y5k{|sVmuUUc)O2a58f~c>P`YRCvtJB +z&14SQom4%9Np`zL&O%r5cQiI1==6PBj&Oqx0sBIX-cWc?Xncba>)+EaLUP1J6qC^4 +z#su#Z>cqPH3!)f+5t9+x5tERzuOp_Afq;7eXKEl@6ns7A{7CyrayTx`J1CO8jKbiG +zqQ())80jJnMZT!ha7VFgq?XC3wfRB+h5xe@+|`;zS58fUh;C$>Qb+N_yr?R;n)0FV +z+!{wJFN7pqN$j~t&Q~&P*pxI6SRS=(TgRV^uCvQc +zO+iM_sqgH2QfE-IyO_FBu9Y4fje7k@RI(dckMzy!K2i^=HH5u+nLb +zIOo!J*2T>s)|HA~OvDZ*E2gtx@z3(^?jOYbwK>ie)SQ_4t$$Pwa8AeKR>!w&-ny6^ +zAp#_saly8GDqK%wl<=3y+Ja)B*i+TVeopM2nK_i~DZEY6aw*6r)l)@Gl`vGfQpHM@ +zB&f=Ys1-G+`wxQv`~YoIWOA?WU=R$Xwnd*)^HH68#8gl(0u*9rBHT|_!d#(L;ezFb +z*9)zBJ5WV}z*JtF2??dhE*INmD?AI8LU1oI$6#EcN7umbS0pB$h-qPGLr_7h^+6$? +zi#;IMRoB2mGY@H`4q0sWnu>@cn`NjY=o(s?4}aS~vZW;-v0nd?f2X+^S-6(#eF`jYbEMKd*3@1s&*F@$)T3iE5UCaq1S{X +zJwz+Xr-In&!EaTSNc5HyJ^8HT{VR0{dRno%rF`nUzJIHhO14ZD +zy;DV}Smef#L*etFg)zsmcIwLpSQ)TN0IgWYo!jA(NJDI#ex*{b+d*i>xx +zI%_Dh2;8Q_;Ic(66A}xF?jT+X4fkAaacjeUW^V$&U8U`~aT^*K-uQ8YgNe6L+hf{j +zp5ZRlS*V9!Z*;alwpR4jUtaq^G+cigZuHc{b^1GVr|(`5d`unt9^dzIfpAm!1`-`^ +ze_W{uW)rz^qjp7Gu~O8NLgp2*u`Q3NMcuYNj_@ZnHs-Ta|c3Glm?(;Qnu;wx2%?qaHKL)e~`Ff^vI8H5Hc>?5L|J~g#+ +zZ8_+#|5>51opu+*^tDBYBuk`Z=#+pUb-j>PM173&`tz}!-vzFAO(^b(A_kDw34{UFRE@X9?xDrYSoPJj22 +zvxMK^B#Hu%ZODxYySY!$BUuN)zp)A49q7$-wTJ0}ffo*HG5T&iNpu#8k2sA_{(Ng^ +z0ffB}XB$wg@uKGe@*EsH65b!K$sqpq@HvocEnFVEr&<5psP9duV+CF4oXCNB;ILVI_){wb>e)gBWo-mH^&P +zCcsaK`yR(#68jm5BDqzUGkOD&H0u%tX34XZybG +zYZQkB@>1+$DeM`@dkzDn%DS=gCrtR_#0~4~V>1P-cV!$Na-O-iW^0OuH=oS_>fP}2 +zElrQ$BZo43rp&jXT#~(oHdh9pY(E;FIel~dF(Jo4K?c0ELA6)(#)Oj+a7+QQ#PCU= +zdkRhIxTM1)BwJbU<;LG!R*C{u&)oKQIa=1tdF1T?>0HUS|F3W>{-1B^9Lzj;UIjd} +z!?XN=QwOt;Jq(|~eCJzM#K<&^+hKX%kA(2s2MA3uHY)Rl?#A@PBkOx!t%6-iR?%T8 +z(yRe_&AY?WzQB151!tH56)MDLLLj9^@2!z1Ui +z4lNyWJGAyF`}-Hmd;WzIe}}`jtjDb8R)y{cH&bdM0%)y4iV>)DA@D*C3_=-1JOnjp!hPU<>3!?{EC*nI!!kp< +zw3$zu0j`EY8!GQO-|;?V@Ti+;bkbNBy)1fFiT(oQWvOermxSnJ)O)=*WmQOi(NNyo +zi`jav2~Wc|1&YhSW0vR*Mx!@`V^0Pc^e%-Im99*h66Q&}ETXvtt);XQYMsG_Z%40; +zy5cnp=|bpp5wAgvZ+g|YcoWl4eZSM@_JSzffll8D`8>k&3F615l3=Hz&u+{6wuC{T +zp$`Ws4snw+n27%(qbrQf5PVS`Y=5YP6!9*HUc-dS|js +zllVdyy*qUjqMbwR4B%r+^Mz0^cS0UXFy_RDoF<9k``jLg?xMhVew4aVq&JI;HjJ@^ +z-GNQ%Z~f+Elp+YV4CyG)@{;N2=nSZFjIcSVZTn~Oi|QeCmr=jO`ypHglfx +zXJh>2M1q9AJ>yfwZeAJ_Cio@I3RSQoxy|TqZ~lwGRUvemNb$+@7^g*W))D1b&0w#f +zLXg-oUO#%PMtH;am29;EiA4d0e*g_H*4{!tx6uu3JV@8@^+944@Mt0UW8`*W(G5Us +z$)2t7gCa3F{R6$*nl|$Bkypd9XGZU!SEA~>U40X__>tlGw+~P);c5rg4H>>*y#)k4 +zEIvS`+_0>dS{PB^=b$;q^XtOmg-A_S-AlRq&qE?PH=JjPew3F)SQw~y;M;ouJp|DV +zB5)$y7%%;S`3^kBMXwm@dw3&KBjD{p8$<}3U*PM$)F%IAI{*u^;ydDyR=(8EU?Kzo +zz`z3-iKCSL2V)Ld^T!j;F#|G&e*o*m5xfBg+&~u)!5a=gapHkVXuus-fk?ig5?Zhh +zcO(JuTv(G9$GkRyOCG^*4Kw|XK`Mm-u?X;&)&M}*09mZS5)xq-9;pOYGr3>;V{QKJ +z797A`@4b&g&Q5|((h*z(GZrvG2U(c71On`qLZVmL +z2e5^*YD!}Xdkr|(@{{#bU;gt+$NHuaV7Uz2!!moD!E1)E2f@&>k49w=@|J$NU6a)R +z&%dJ$oEDKE5P1uAr34EygQjW9q>4bZ+aOmkl*J-#4HGQT0BI|Tz=oN>JH=g9$GLXO +zr55Uga)3^P@lM&<&93>kBW_H-CNjZU-e8@zB +zTHm{ORrOzAt-mgoEVE+kn8-lU3GqS=G6a4g;woft3|M*~R-5K`-wy_TMziwQ>txgD +zhLLQG85<->(v6g_!*k%bZrq<|g40QL@aI~+t)Ih-EM@++Z>{Q~9dbcb>%r$Bv@CF4 +zhyJYZN~CLaQ%T?cFw1Y0$uH0r?9!FG?sk7408QH;Bi4OEiRG$(Y_M^m+h>T1;%F{DJ5ZoA0k|e1-cUGmrKwqgmNQL +zZfuU2`5U1|%k2v#(yGfa6ryG)9!A>BU?oQLcyz=ccTE7|^a1o3@^1zY#KK#EHoQCf +z^C^mY)O2G{6;Uu&Ka0iUo|`@ZWYMV!AiKXdcqrOZ^^xGEYe()XH=M`auA*H#VU1n; +zVc@jzV>C@T4LUA5G93pCxGQ~F!pJgm%0-luBwx%vphvf!3WTcR^&q&CSjkdJaU8g6 +z<;#UmTp&WKaODN^OsWgA-CdcHok1fvi{zT35>*BDps^trEXjv_gLfdjJ2v-Nxv+K& +zi6?@&p7MaWGUN-IDT`k$pgJa_bEH!`bwwVa_p<8MDYYsJs>(itHj&fBpG^Y`90nPd +zTqv5r7IFL``UM#%^7o@&pPe0evsuR`AH9=P2PUR}9Wot^C76=!kCr%gALMm+dY%jY +zd4!)wKkpXF*SPu~PsRczH{09i@YUWX3Zq|QeJ?Xd8OQrx4ZZtm!P#hWmQW~e`&mtp +zUW#GP_pKT-OY`kgt|_;tyIx$3%nO^p9mzBj;0u1O>sBm4F{?? +zhpZo26$+y?@mFs7E6bM$5n-zfUV5pbvJ8r-wUq^(g1tC1E@#uGc{uN-h-)F#!JfRV +z*%Xjnl>@ICRT4^}lKrT}#6W@66J>X^I_4+^j-6?DbH+PU(%TCh0|=92#E9(_j-!F! +zZ#SHz^ZJNBEfum;$w}C!kTr~q`1}j?RbWOn$SwYWwt99oU3+#F@XM!Piu|RJ_dM1Q +zp`r;l$!s?2H5-&UyU6N%+!%+$-_gw$2J0ud>~)-nZpC)M%&)+V-pUeT+nY;6!Tn2^ +zK_wM3X>|)ZLawkeo^do?V1mmV*8Ncc0ms@{P2~M4WI~LRu6E~}rf)iwo0cBl&jH!D +zj94=odot9GGgL6kD*wQLk5VU?s~b{H92`gj8qUgSnjuytRw*q59hzG9GBT`GdLAWN +zjT9}R|96{33Y+Px>_he^TX5DzW*#O;tr!h+`5cx?GR-wZO_B?fHc)$2voQcFDEqud +zLpYZts)|H1f$D6e086FoCipWS@QPfEKm@zxY>Pn%&CAVve4Uf5#w0`)0cpi;?bl7p +zWk?El@vdi*0zdhjrc`rI#x-$?Nf^JsT4=wFm!&HsogyyCgz}iuO5) +z<^YvPC`SCYT&hW+nXl-pZ%gapF^qnK-g=XqyLsemZ8I6T^~%D($!qt~RN8?zU-c`j#ZIcCz6bP->sCR@>swW-@pAlt4VCe^;C-8x+Dcv3lBV0Lv`?MeeC3X9?f)O9@2t!HkeFO33*rkuC%~7*jSQQ;FhJ5CZ&Y@We2;s{xw`Q +zbEfoXR3)Zp0W>_oXcMGXMG)0IENN7qZbm1y*rLUF2c&%1(j6*k&i;P%UDq!){;jvq +z!?y_BW()&ft!=EsbcQsV58lyAQLM(Shoq7hPXh6_$Y&bT6x7z$@5?={W2GQ;;x3c) +zL{_elb0aOKM#d~U8C$spdCRs*O9O2xQS(e@yuO0B@B87eYqxvib@>`%(^UU3v&&70 +zr@h<@i@v~FalDSDD0Ew5)$1zj7WE7|AM%l97JUdki%?ca3N2cD1HMX8SR#&F +zk|OKRYQ^7!Nwlp`B}Be%>2&k`(r$+OD5WvWA|YybO`D!in_D{W=c9-1Ql-r+_x;Zm +ztX3&vsF+UCSX9_Jtx~6Hq$+mFV!%WuA=6qY6|6w3MfKVO+MqF*#2R#Aqf!q&lLKBV +zy|USaNNiMf3A6>;Jp2`_ZNr*gJbZV&d@^Gv+mEiTM05xxE=r6kXy8B=!!skox9V*5e#w4vM_H|p_=XjoZlYWI +z%K?6B4^y$MkDK^bnl4WoTy=R6nu556G7?CF$0uI7eJCswDiL;k=VYNTwvHzA4_{;M +zIM4TtRDX8cj7M1kk`VLFiIjtz1F%%pvI>lrT^?L-Er$yPtuw;X=ad!(d%!j?HWaBkU<-R>~>7;G*R#yoY6Zu`0>i?H0WfwFPPDz +z7UK#*GVI%7KcMG?`J<(IBxx`lcrmkYm@Y%WdC)`MJMS5WaRAH +zgPp*dq1ck5CW4BU7^T)4qaf|15u^6Bj@Io~(!Y^^nQALk3!A`pl)`C?wYnt`a{$tD +zTmbG-_2FJ(Lb;tR_B9V7f+2QcyHy9DJuASdUfSlBL79msXLvB%A&xhP;wEP#lG43W +zO%(pkCc~)9nqU~EPt=h4ogacOJjOvsxvbf~MV=ntg%WKj9-kreXve$Vq +zCwsa|hxCF?L;M`)U)xq@mMxGrhs8mz7Ox8n<3H{v@{tDEI%pmSIlOLS2xZ*2f+DO6RT$+)>Wr@mg&-(BAxZ=d59<5#oK +z_b=iVyaoOOpJk3kRyOl8o1SKsZi$|aj(Ju(^H94~-&O}V`$(GcthETdw-h9mhA~iT +zBt0p{)M5o0t5!fxWuqW5vP05cNr)^dRb;4w8|9HzN~#IcNQu}rXxB0RFFdRSuz1Na;=D@1ZGg%a?Ao_ +zZ#ad}@J-coUF-zxi-!y=dQ?9vC8L+%cB6Eh69s~D_5|8*ed+ybv;Jqy{SNHWDXCGO +zIt7f?&zOHz{wXhN5dH)0RyKl$qMo +z*~9j!9Dh|W|J5w~idp^|^<{Vc&GahvG#&ZtMW`M782kmsH(BFt{ZB>UUuwm(o546) +zkt8_FAo*pH^g`-IS|wVg`W4lSy0aELU3c6uBP~>~TB~-cmMRsZ-vpmZixTxuNYrjO +zs|C1N#RNpvLGfDIv8#F_(;q3+6GoxMWdp4p11YrySB&C2q-O0)x+R#EFX~0Y4x*@v +zAN1>`G@H1ypC#zgQouNmn9Yvkukai)6b|`TE(Te4f!Dm-`S1L|CtEha +zhGk@w8;+TH)}MP|$XE+tb7Wya!%)Lq!s`Te%$E#0Y!G0<$`REC+Cgov=?jOvb+@D4LmU#NA>PhU}#Pv+^b@RlYj(x93WR&2g +z#z?M`ph&4%Y~$O(b6Tibxd336>JQd*dPhrMg#}e7KrbtIc9tWe@i{#XUxFQkPma9> +z7O^_V$;r7`oHmxCsI0#(UPNpE?AkDNe$_2Ca +znR29Mv<$X*oo2Sf#j2-hO~NpA`z+kwVDGh!A6YWtrWHsNluqLP+U^2>y}0x +z4eUSZnczg{qAyJ@SUD7(4V=QNErjfutOUBasF^vlM7R7UjY)EcUsJ%Ye!ss5HnMcj +z7caNne8M)M%O7&=CmAgDIAqH9&n&_S8~Qru^Wz!(<=0*q*^ukqDazN4;dM& +z_W;^eEN;Y+5Y)LXG`r1fdMuOl=tidJbE@*MzwEo;;`6UZ?6c+Xo%f@o>>q(it9Tu*@FY_;66@+;OFsGhTKjTz=NisAZ%cbwd29Mp +z2`(L+LOe5CN3||KRQVAf%YF>!MK8{4@efhaAR9XMfx*$bGv&@wYU~@ThdXSpf1$JSvl>pPpCl2NT)h +z^56Fm?rV^*$4F9YG>$el_8ibTeqSkt8Z>Gzi*X2JQOGOAEmX*1LS$K1Z$dqGy(bCT +zT3YMbT-w@Q99rDo8eo6DxxzKZxWhQiC76xs7p?Ee8W4;5=<2#-vkeAMSn616*%gx` +zNjX@V90rw>$&C~`4uZT!>B`H@!yiR%9PakkPv=iqGA3AyqdROg%TPEolJb0!r;EH9 +z7fMfnxJm*CT9*QhMy=^6g2LjgEc=|k$2`k%s8ZyrklBz;OoKM4yiu0rc>F}^p@N^; +zKRtI}TGJz+W+06S*y${%PGPmRoTHu>SZ}(|_R}SIJ5Jq^(Jz2-C98S0KguV2jejWa +zM?Tw%^^V;5!Df{)z3Lnrs54Adk&AmHd57^@ibROIv)Ja&8JQ+tsln)DW +zi#jXcI98TtHW`~Eo0N4<7n8v!xFgeCQ#fd>)|J*56t>f=v#mePJX6fof|7&(h$%|+ +z9=^|da;&3k#jDVrPHvgZVrneu<1z45EBYo1P@@6TD^q{00B0VK_pq7fRM+CwJF@g9 +zbXTlCm*&BaXd%iX+cYAzXkzgls9Kp(OQOVFO?BWsVV8fTtn{z<60fT9r-F~*_P~$(2aD>t;$y*o?qYaqa +zA&+rX2)?(=du{el=)WM-P;T5$`0DS{5E>lT_)>{cpg*2uc1IN{9iA^aQZ&t4p^1Qs +zl#^?;VrI(VO<5=5t0YS@%e$zqopoHBF5|BvW8|7^+Cr=iu$vUC=#hR#43DTk^|`we +znoa@)S61P-h%@=HpdjKUfsRm%3_%$EBf_%;na22nilqrWQK7MJ?OoVFBO@Fei-H*& +zFgB=l5)7wdT=|tauTtc?%3`m2Y4E3a>#8Ezd6k*dZ8dHc>W-ML^n@|B!?j`UDD9|C +z!K1n=)GJr2gwLg(IG<2kU@g-;3p-_c=(L>maMi4IESpuCiUPHe@CXSakQO8wdA3QQWXclBbLu8V^HrM1^#@-I(&@ +zajW4@elC^0V#mg`@Jhg#M5Ae7Uk-@mttOg8Jcu&Nkw!8ZB}Xs{JZe#CxJ=Pln()!p +zkZ@0rq_p20?Bj6dY?lG57m?Ch1vX@<&94}juX5pCfGe_RU0G3M&0lONQJnXB!yM_f +z`9+-6mVuL~9E0r?GNOG`B$EUd!8w75qWS>|(QHvXYfGQzBNHu2Iwb5@Q$f^d2D?W@1IxC0>vMtXS4q6g`w$c=PT1tqIvynFAQxcD60@w8&E+GsBq};b +zTnsr8U4*7l7w#gFN17OF7=QXPVl@1?^Z>I(F#rh_$~UhwP%&qE0PID&w=3-83(q$MTT>lMxSaqoB4HFIW+4rG3fQ(3oUQI9CF>i;dW^&!Qf8Nqbx|_dh$oM;3cJ3!@wCO()wLxLe +z8+}H0vQ$2q-V6VsCUO(RMUq +z#$K~5A`pCr1lH1nyOV>#yQ!K+tZFtGEEJ-(N30$}GYJ5dnyB=x`Ub0>ri88Pe%;VQ +z#NEY#@LkFsjb6THLu9`w~zJcI6dP}5;rut>v*;%bH+@c +zpZA3-{vwV*g;m(MJ=MJkf~z~RhIIm~t1d)EQDvP49;g!fJ +zkc1|YO#~jU-3|RM>B|y4DtJ}q%>%|#okLKO8OS|T{o<`sQM){{)-Yck$J$m){kOok +zqpo9GiZVtLm$&BiI?LGaSA;~7NBn<3t;Oy7{6M?(6u2`z;_1;I?_x$F#0txXNHh9a(0Y*nM$(V$+2wvrTzvGTDo*cl9>Evs#tExb2ZgQZ@` +zm+24soV^pB`#lNIy16e~Jv9HKgijmL%KUq#mwuNYtG$!awL5kufrOS8c)_y3XS +ztR*CqRruFdTVR+*K}r&BqT%!JgIm$Xs7>mNT1oNW%64;V$5U<_w{B3I$Z1t+vPZ5$ +zv$kxoTpTzsD$VsO|A`zqMlYLQeV~{4vx_?PeHX>BMHkyyKAypO?ozbtfG)rOjET;)xA?pZ973m%gB3B)hQ%iF!GObBE|tno3NDiz?GqwWd-Wto`lCuo-W=RXQvB%C|FLAWWEMe2Al_E2CN5k2D~#? +zGM+PLGOjarGQMwpZ&ir-X6DT2YfAaaCb+iyxv!(#Bqui}kFw03s+I7r-9|*qW~RB! +zmf1>e9Qke7NgvjU(MWoHsaEjigmP|vYn0k#pYGQ7Ett^PyEP%S-qhnaNsDz&^7Z@9 +z%;-F$x?1|hJol%gxd;E*w_A}pAG5x1lEpkvvIxrtzR^wteTEcs+Jl^NCTHYOH2DA2`)0lW9Q|TNAYAy;7Onq8DRPAX^BLXgPy8{ov$wgi +z_iO;KQ_sv0hOCs@MHs}hzS|8OodxBdzC~v{+QD(7Pkw*P-Fruu2BvjP1QYlBEmuz{ +z`IHNU^;=$yKH4fUMrZ+Iz=-}17tGjGD9tl8Xd +zE4jRk0nNp57cwyKs4F(y|WEP4kS!)A}-DqT6x(EW2xb}01exSj={K7 +z0f;(1LVr)iuGH{HHNq;o)-OPsD!D!)G6gwvrsB*&MT>E!jOVbQR3g3GAZjQUNd5Ip +zVuK;h&YBd-3$sPyGL*ig!he^AM6wq^t2;43%Kozsz1l8kJuIFI7+1Z9{40vBh9rwn +zF2C}W%iS9bW9c!tQI?DOAz8ckZ&vK)Hjk|BjzlT0{F-0%mBl+W=MsXD)t^s8t9Y-t +zA$|b>Dgo!13^_7o2<4{bWmahMV9veu5_;uY)xK!U<@ih1K{1&td#WB~$Gq;^PSA4Z +zzJYcuOZKV@3Lu4Kc-EOLw^oj;N6-ujt1qnt=RdfcDTtXEdNQ=sVE!kp`jIZPK9ZRbn)vutepm6V3 +z(V>XLSKprx!Z>aB^#q*gCsOpj-F#Be>lnVmq+vWB=vUyr%);=gd+(O{w7f9;O>ZV3 +zd&(EVcz93zDD(c-A4YAM%MnZhNX=`4!1avs{O#VPN$>Ek)XlX{VrE3@18eJ2YRo8B +z9+iNy>=HHpOH!j{rJyPEn^?o7j7l&o{5nEjP8|$(EuOgTpYpvKnM*>jBdRi~wWcBH +z4R7+7k^H2FN4sV55zv{SN2Fz5^G^H9eV0m&+(PC8foz_o1aqlYrbd=D5_gX2y$dCF__9V5uRB2Gy|-m})GY^sx6PYN>E8q$-!~*|`Mb-dqm>k&`<+h!Il1XxDRblJeaLOQ5M0|d +zo{uBDPa?ji@0U<|)N-}=uR}}}XU<_ow$10hPZf6@QoiA5uw2wkt^w|YWkCDX{RKKJ +z-r=jtZTHWvmE+se<`or7V%BXfOp6U0x?)d)r7~Cu(3=lk +zr3xKsDec9)D^(G+FVx(BpT}=99%&s2isiZaXRp>7NSOD3Mygt|k;Yf`1Af~m&+bac +zQc*G=PJ?(L26-vVom&(t`~`GGe1L4h6LJ8!TpxPBw72Hq%U;Fa$y!bFra{IYkA3uW +zzw&nN_4AEMX?d^tcWxUN=5R9Gn@-=5@uj_aKRiC0@JH +z=j9i&^wGmv0ykTZ)D{v>$G64aHu4Mzj=Q%Xp^h~gBTJ +zE-9bacCXH7HGt_(UH>&JIKRXB>?^;|_vh!2sHLT&>MHr2^j!RvfYmqcxL;q=;j2c| +zU(pmsQV(A;@_A(6R3#xa8gIO&ep=^tPQ3)@`|)!5T6=HE6X6?-&6|n`FNf#Ki;1nR +zUaO0XE}bIirL|yub6ALRjbO&Jiw~-kKZPa9h0=t62+v49o(?y1>ef6tTy*B^HKo2( +z=7G>=@Zy^%MjE?Fa4+}HjP5Rzi-rHzNpnr1HKIz2YxwzT%`3W^U*RS$1ACsMN{+71 +zw4@dv)bIJ~%tJjPuURF^HEwEs;^L8(2in}V+#qd1ID6_wpZ;#G+YoV1Uk{6j{mm=s +zta2%X@9Un8dbd24z$aIh+3FHapo%H$p8e%a}g5cTbFJ3bH@?6=R0G +zPP@N5rxbF>nSWj4`t?I;QEh~2)-r55S%Sz@0qDYt1Q3W9*G^pwQ*OC=Maw0 +z#+y1tc&|eE0!+-7JvrA#QAA7Pe9|b_fpofyA}suFr?^}>w2<#XHm6aRFp#9@tc`2z +zaO$UES}L|oz$Ut_!An6Y*wo#=d$cwD9+=HeDU2w9?7$={}%4}K;R +ztrBc1-ntuDi8;_-tWzezsQ@{N4=)ry@QLy{gBwtYu`IXKwpG>L>Laq!xS0s{o4WRO +z?OQxq(W*}Q*qvH~lo-I_V8I{aSzji$!m{7$dAAzqAU^SlDb71TeErdS5Y?M#M9OUJ +zb-756_XJ)BnYk{y%eEo)S+LIq+9DOI#b+EUl?K#GSa7<+z8?R1;(#3$yoEf&G#|bT +z+xtYciRBck@j{k)kn5_~Fs>zZ+Q@;aIv`%=!8Y9e +z%|$hI^>Lu?i!TqexB>ocDqaStC?Il`#oDOxDb2>!DCm6BT7;5bHdSAaWs+p%Zb3KV +zrf)Go)l6pfDrh=~%Gv%985vcpQU;UdY?_|gbSRheXtYfxxwb>2_iHs8n!=;pvTV@O +zSKNnb=oUcL(C8sxR!&Q_OD!$h=>yZufOy09eK8BOUC(u=zHi)>uemi^?~JZcV5U(6sA#W_;v`iAWC1n4HEXbR6V;~}iDDPMzzup8=ID5zbqAO7ti+}0gG&67>(qqsOH +zy6V@ec0+&ZUwb)<;Ix?N8JR#`OKanbBhuQ+X%J*mpEcq)dWUPE`x07qE$Y@9obVZz +zijwKje*P2kNV-eq^h?W)K?nP#0g4Ukf-vksu6-To1smBunz{Rgr$1I|#^HVP5&0JB +zkz@l7B6fZ9`EL&t9z~CkS0eZ+c943M9;eoZ`iy%J)s9yUvc#5jQ`1s^hz1y~rVXI< +zK&4<9%TwmM$+{zG^o>$YDa?~*;xA2h*9CYX^i8#W-fh$xuh{1+ZJm+*bGgu;+7a_B +z4}S%sXXFm}6MA*wsOMjSE1xCicON6Re~rYSb-D~vod*w3-gJf!7hJcV^CR$^b3(69 +zb4^w}iYyObdpgVfel1`?A2hkPM9|XZRSvf2ynVjHb6ic_fh +zTcAnSpwF$?C>qX(OD__tYFBDAdlLR0wwDh(TdL)7;C!HjFZKHtK}DV$YXasc*`C{| +z(A+f`tKh=Jrze*SC1I0Ia?}ZNx=n>H&r^XeJ&O#4FfKx&q(s_jVbR#}LCq{pTc-Qj +z(f{=T~0Iw;YXaHF+r +zB(x_+E`9b_?V7e~E@nSp4DgCw)NOX?_!+IRqa!#r#IO_Mn5JsFO{zexn++Kq6@$tU2vf4tI0wvOZ{nr! +zcwB5=;rJYmpK}Fg!lTDXT0&V>0#u(8Mp_CC91wb5$sw`43=fx$MeI~I^Fh0#9JI|I +z8@BrrAc)Y*tQVp}_k=4Z}}Za +zMzS$<$x*ro#3uFoqgFTFwaXd_roWIGejX}Z-`tY`YpU4*?U{q+@?8w*mAl{+RxJ2l +zv}b)0{Z~pSO!+x(&H?#(@I&hj*egjAh_cX$?I25aqDl30wlK;?umVmMdKB6*M*M-o +z9@emFn4vW49(Ylu+O$xZ0MuQJ^+__dzbrvDx@3SU$|%CN-P_? +zU-ZPyN{GWom5VO$)Z1sJXNg$lDWPYJB@nUAS?ODmTh(YlRZ*#HNTjwYA7c<1ECrS* +zT_z0&#Ob2LtGAt;Vx!I$E@#JvxZUJr{(3mRkmPN4k@u13%~9p9tn#xhTedi|^52E(UgRK?^{oK3F<{aI +z|DZ^4+0y@oM!l|E_WnubGHtM=*I7Jk+ku2LPf)YGlYFk*cH!o3iI +z$NotJ(K1EVnnu72R5xOZ9fHdu%(4w~dB=KZvq@T)0!Dk-3BF*rpx%9%oi{~n6KS`g +ztcDk(tN7(G(Kx)yshh#Z=6Q$oI;(K(6e{4H@h{zmAIwjI0?`$(;h0^ +zj8#b{Pob}jZgqbpj27NtPVQg*`E^Nw&H8^ix}5(%jxGT+Gw1)p=ISO+#|9Dn_P^l+ +z8@(<-RM@aFl+o&v<++q!-h!xSaFtXekwEDE0yf$(mR$5^VD@Dwc5$+9b|m?#FEZ~> +z(6g{Gz^YUG#W^T?7VJQjVh=OihQXCo%-4}a4k29h!AL1BG%w%B#mSwtq!(-EE;a8) +z-B0C1Sas9+w5b>K76Q~v%u+!`RPd6b$NjJjCorGhYFn(YZmai^Ek3kj?SDH4YcoV) +zz?AcA;|zv`^r?vGXgrPzi1w$3Inv@p@6(wr)Qm4%Nv=wuIy~8-m{tidLb;e&36Ih& +zfvH;QPf9j%4iRoTxtwNbv*0?IVV6P(I_m_T+D6uak$jj&{PO8L4mBW6B6{x-s6`>; +z24KrL`mgHl6g|bp(IKqfJo$hfG7HYGzFUCu`a-L(1E9-xXoq)pA@A!pT*%*l4ECgi88=T{d!U#f(=BbQ{vNrWG+BBB9A12PN4wjNyqc=_l+`$Qc|#B@4|e-FV)5be +z7IstDRYgASHekFg_d7>*PB=f#wTVB4ggQCESPXw$)_Dn3e^C6AdMs(<4^qGI1XsAaFG7nuY-Yuk1H2M(d-;`H@QzS@ +z;w~m7-ld8EGHGw&a#^9NU{(wH2d+d99aaO((F0@A^2+AAl +zDp6jL<^%!N4S_p!D}~A9Hmvq4hr2{BF#MZUWnIC$pK!2}&=Gt(=}nO%LQ0;JHcQG$ +zd5rlXz5rmre6tAj1gbVjvw55LQe;+C4++69al?}i3IB=ZnZ$#fWsFgU59r}==P$`K +zZjE{<%iHYSKGN`otN7TtvX$J$Es_1+TtD)t+ylr3qoQ0=Go%5Wb-TASTw{yXUr`@&r4Nxp?g^L3?KmVJ@)2$!qeCpO +z9dJ%iJj<@2U5^eJouRC#x}CYn6Z2{IGiAw}H{aVH1}S)*pVjtUY$!EkJgVpL3%oT& +z`@X=xF9FA%$-CHrvmLp}mxL7LtD-J;if@(q6#)|SWd=HS9oP1_N1j4g=;QG35xfVV +zbs?q&X3cbG1{|Ua;$AL!o-k9y8X^n{lR1-WV|41(Z|nndl6DoJ$(I%kZRE8J&7rbA +zPL5kqXUdLWhngMg0HetNJIBNs$aG%$F_yXH*}U6OtP@ESaI#7>t6BM-$50sq)VyZk2X_`Oen +z>lqkTgxEHG6zCS)z=~jXHi+q&k!6>B^A3rRz>xt({C0jXcfM%KSr6i+CDms2@n2Z2 +z1ui}MQxEQ?afCs%B^gH@yxST_oT(!#V!R&`eUL$CY7+B}aIy$v9C;S>{!)=SEhE9S +zox+zv&_(sPU;A$wTF5kooC_&eDlgDLPl~MqftjLTE111i>F=NYw?}6r#8}F-p&gI5 +z>gVAj@GBPoO5_&Xuwx3GS7D&~!lA92(VV(7#9mvnK4=MX>*62q#Vgzd@;%U|5@ln0 +z+odj!?V-DM3_>0;pJ;CuZ*=$KUgh4Q1VH!2P7Ip4(o9;g!_9q&|GEu*m}>LBE#)tO +zc1#p6Iwf7ke)BO!2*|Dd`^ki#^@Zt^(sv#Ukhc}8`KZcV^wrwjzDo4*u$G4ouTC%o +zmawTENwq^|t-#iM{8pEa9*h!$G~vMKHEpHKg9{}*GN1g8v7c^%?=M}d7X^>>3Ac(% +z0x#QrU-2AqheqikD2TPMFd{vrDI_k``f2@_^*_jOiz9jK2PUqZ)Agfc`Mi3zVQFbR +z+mY#Re7_%7%WnTDpz)a6_tEczPa_uhbi+Qwy*}kewS$Q<@kb}mDr8GsoF$Sa=EQ{_ +zm7dvWalwt14d`8gW%dD&VD~bl>{127-9y;ZbAz)x5qQ(5v}~?Ckc^LI61nq{c&lb69_a#_EI +zCsY)Pm6gPeV_eKkVY#V3zd|ANCXvaHk55n1r*qZVdjg^}noQAWGq~-1CC>sw)amc_ +zlv~?zQfYM68oC=R-`7!Dsnu(0YpU!t7TQ}YJht91YIp1hW3cVsm!{h`-!D>Sv$XBH +zzGAs=IzMu~Zn}N~XtmqEj{C##zOSCeU3uPD5Bj|JU%1_PJ3cCS<@q11H@1Cdul&9d +zAl4CjZ%6riUQg2We2m*d9Sxcaq_ubU*j1~ +zhi$cGDYXy?M==Mx;N6Hf!+5UgJ;QR6>=HHeSMx>lifdG}$>`%I_q-r>xUckOTmR4< +zr!vm)uCb1#+@qXLImp?ZGuSzOPS?)Yk_t!z$c0Eq$l&DBGVNpuq?Hi`5e5+n5no6U +zWbo275<1x$36JLU%94JPp4?~n`b~8$_?q$vv-t)P(_6#vfK77qYi;vu?vhcHWSe{I +zH>|ho0Bnfwq+@tDG4340YZf!Lo6WeN(M@%1CvNlW)$NWnz-CuW$DY-Z_~qHz8%jPo +zFw(D2_+S4xvV1#wy0^#*Y7a<2xPa=_{LyRO3h1p3Xtoie&(Z3hnC!qNnk +z*t63F^$CG>L-_@??e*V?=?{Rd!mbFhR{N(Y +zfK>f~s1D^S5Aihj7t;W-DuC)G7_SaTCWO*s +zLYTOn>KV{t2OU6Thg8t|i8N87Oc`m=zQc>`SxODKK0&xN_&I>g_KY~7%64JBA@g=Y +zv%~SSgOePfF9&d@hIyt&fwLnQ>VKCRAxAK9p~;?JxO}%>fH#nEMAu +zr&5{R!we1s?`PG6My4$zW+m}hj9exTi+E~AKC%G=1h|HD+0Ig`#-ZP#C!P0b+#BHZ +zwn-3O(9mMHZt9$>$uAWeo5#hK-FfrPoaiu2C-RiMA|0PhQu6-u3(^s;W^BfB7}rxS +zoEx!+?b%oD_O6tBZinq?92;CzRkycV69z*u4R;|A+39D&`RlCrY$?^p>q^{e0U>|?;*<>XrYxh>$EMLxVX150i +zgB8M;hBvG)Qrcu +zL`80aa3I(Y7ygH=13o!wbw!{lNNbI0k_Nev(?DuN;HelyYi=0sK05j%eaN%j$hbPc +z;nP4JV5fR*cwlFvDzh;{I)gYU`Mysd@m;?4@4BJaZES%`KS`~n%gG7UF->dpaQJ(l +zl6^U|%T0v}kVaoBs^Y{rMQ0=JveYWtP6h#4J}~~0?^Jj@9M{-#m8RsuoTb27EfIMaSIZvacP>)k9WTOf;>y`j}TzHDr(gg%_T9VUQ2p5ql89IyW1s-I>YnsC_7UM +z&TW(Ce#FhixuGdlOCurHgn@$dG0yQwL@G2@Z4EyxbBHA&NplnqPIXFlsD;fnebeBg=!KTNloDOVdH~G!4XWO&$K)@Xg)bVc=QU^AhH8wf +z4c-l_ww)fI(dV?bs+kY5t+qS9apfqt9sd?=Hrv&P0-M1MxQTOY#>e;9i=34mmmVBX +z-A@-cU2>1*eHk|8Ov+i6!{O<-A|WYgQbhy!tpoTRcNS>f +z)=d#B+d$5hij$G54v?cwAeuJ*!{-H~M+#mcgoP`-Fx!QiPR$h;)ijsVAidSvClvJ7 +zv!+_Qttj`Cz}9*pifryT0)ppF&(V5nU$O)Lf!21;5*uxB8VYM^Vo>nQn85Lo$#Ni= +zP{NM#aSe_t=Q_D3Wi+q}3a_i+9$Pot7UtbgH2SeMZfMIq=^(}5+Stk)w@I^^0uFDN +za8{vrn<@7$M+8GiB4ZWKrGdHdfiO6q$vsq~lxZ`C3&=T*$$g5;k~zuj{hv;6=RX%= +z_k7sv6g!vsBbvGYtVJr$3hk)i=5m +zFL4rNlzF-O(s5vT9!cJEd}T6)CvNAekIm(Nee*?I#W{;*!EfH#on;u +z1%mo>DUJ{=!al>n0lTGCb9jQDU=mMnT#PMK(!-~Ud$FM6N`b@%MWDSg(Q<1nps!;a +zcUjG&Uz*lQj<7WG2bj4Qf~5Ei%Crg@6r%`A$&gnerHUrLo`)iG +zo@bcq(62@t;{YtXPpKY^iJX^!grGC*)l%Uwx=(+`i3YWwwB8%vtv +zos2XuXy`|!9;q|}VNptCXaSizz&Ib~)@mU4-7ic3$Fik^;pl#gv(&mG4MX?cN%H>9u +z&Lzmw*|an8WuS6qBuPf^vZC6DDwr-A5peQF{NkO&QOl}n+Zm~-S&@v-MtVCJdcBP= +zJvrj9-w&!D0jVjw7|FS0;$r5F#6n`?DxO*+80v*X2@RM=;9W>--hB|tnS8?5;$c6$ +zKi!w(-?4Wk%;NkH8(u#Q8WwFm&!5bwCf^5kzLa?{|31h(7T@Ul`Pp0@!#x#qH+ga$ +zlBc{7Al2l$jb&mXYDSdI&l@My```Xk;!#)=d;>R#0k&$ZJb#2AW}#tGMRJnyA(xIrjd^5QhGDcVm(w8aDHbkP9kV +zltR!NJzwEDBeNztoVUYavwd6b*N8uep3l2nIGZ)q9D4iw_eW{pFfV;CB-?R%j@YwKKci2VK1Zx` +zgs`UWBcaEZTFoOYPBTD5z0gBGVt;gZiclFgt!V{J9Z?;P!X>UKXIqIA$Zp3d@K&<*mo>EiBqk9Vum8( +zLdJnWuLQowH?yrS^hvH0H*a}7M|tZ7IG2z!UaZqrff>0CG&?m#rQ!=Jwml+t^V*L& +z?*?D(+XdRrqV@%3Rj?||Cqf~>vP&)gJOl6bx4muGO?u!%k23dfpIh_ThK@Uld`>^Q +z)gGPXvSHa6(g7hEG!4eHZ<)zO;{eCT%hZRX!FvZykhMyvIMBlc8JgWBU^z*d%gOI$ +zY5iv8Sm`+DWw*JV7^X?`jgB4lBAmyb2{PvdgMQ(m0b-Ue(7RlQOgP}!%r1+$gg88n +z*;BG +z2GL;|?SQLb*?AkrRvGOSnUB-*Xh)q2)C)K#~s +z960R#XwfndhYUm}JVVk>?`Z{d*0>$}>D(XIEYb|dDpAEpv7{D2p|&9nC7L9&XjY=E +zQW98}thr@8EnMQ-CXr1FyhK>Zfl^qpR1Apd;)-EbVAq|${2b6ZFS)BZ>=nea+@1G +z%qQFfIIwMHTkV4MwmK-vJ@CMnlK-CeRKUtdsK-UPO!Lap5>y@`5AzQN9h5Fbhx?qQ +zI-RrKgWu_sU;CH1jP39phbyy`;?`&h;g&uHy)(Haz7yPK2SFcE^AFo>I51cK0+l9G +zeld>=~%{jrcrmCJHU7v@MqnWum6b{qIUg#B`xWp+h2xJ=IedWs;*T+1SnuovKLL +zbGb&eWYr`|BH;v(DD>;P?TaHql&i4rXJPLGvF(14m_Yb6Vq8kHanj!ES~zPz_25T| +z7c9dMR|{En&$%R8LV42wiSp;eLnZgAHX~n-^6|nZ4H!`#*e7`ph7s9&(87Uix>wxV)zMWvt$x%)ocHCbE7*f920J@2PRQGeg-h +zz4gqMZvw-#YRnOBI3421MyMsCwk6h4FoiO&M($LL<;$+K2mm!|SLaGXPqg0i+eO}adF8|C@;B?2wc-JGoxZY4&JL+>etY9wwU@7NJ)oLN^$Se=Xzz~tXhj}$XhPRT=NVD +zpu{mtLbTJ7iaEXZr&cMjnTv(EH>`i$hAvT@+a>=B6%7tAd3b#OG3M?GVpm*g{-?L +z)yQYN1dEzM5hMDU5Unq};1L12^x6)o|0YZwI&_WFF}=<24`LpPmX(h>W>k-fRsdJ} +zCr^%OLgRn^+ky4d6oc&NKE1=@^w1h2&G_D{fAq>thm-N;F&#S~D_^_m_;k%|VwRdL +z+h?HM-zlDU{qc`fn!JEROzk94VdhOqitI`Q_+1)eXbWlL!pV3H?9`;mlwmYIl^w_F +zqr2rW5k@Fe@EFjlZQZ_iHNNHs?!;8b&eM-b$d>ZV39J(l#MGMa{Q~FqiDvTC)rC4{)vgzzB(s9jRzBk6=Fvr!rkUY4v_Wgy;sKR_o6nMdQd+jGQqf +zv*z-0vNYI%`2dY`kw1(MAW^iXbB0@ZM)D12>oAuk&s1JbK1n`VK50E$-=$x{U){VY +zmj*M2NtDJ44Jb-DXl4mC23mhnKt{~@Ma9g21Ss-X#%{Zxje6O)>-*$9$r`y2C3D6u +zyZ2AiiYseH=DP%;EC9)JR^!F~im_wi=8E)iuAIcg65MN}5%P4N@4rhdIe0#*xF<%o +zn{T>ik4NS4d0l-QN6+{h9xfxNKFjbu_Il>fmGyIOBYtX}MmLR&%=Yqx^m;yMUb5gw +zdJIcotdk4%4(?9Bl-?W0FpsZXJI3^eaE+mo0=FB3Tk30)>6R{3tR;A@IB<9x#*^*+kh79tF+U{yx!Np +z8ZWG~c29jB@0A%7UTeM=?mu@A-+pfh(wx0+rQ7JR~{tY`yDm&o5r?` +zcC0rn_zYG3GCHB&TvTKsC!w=NBtHT6qJ=skCH4rwk|?cP$KK2!k#aTt&kTOScN6xKs)wc7nG4u+zf}r^$aKGKNEki5ei{BZ(gkvq*(tIItSF%FL0u +zgHBAPA`qU)ZVg8pRsetg)~q7ClgVen#4;vNNZZv>^!&__+t1sq&}qHBo=1H*ali}z +zQ20EKa?)Qv@^_uaWD9Omcz^P5m@>qbryJ# +zP1L@W-&JqnzO +z@`Ixb=2m+p4O5n7M)z#i>86p&_vs_iI0tb<0S4FgpY^5nsr5AmmKb7Fe=##rwX3yj +zxN9J)!)kEVmawYsL`p)CQaIsNqQWc>nk_O(M3d^NTF7LVWf&1D5oILU1FNu2SSZBN +z!zPBwq|2ARfGHpF?v~g1cP)2mtEv!0uxim=P%O`3b=!@-pWB2sgw>x%AP%&mx46=Ws4u~gvNnjij +z)Zo>=1<{m_GmtDAZ+WtYSCuH%Y}Rl!pvR5^vEG_!y^G_33O5mI+$lh9@WO=QDGyr0@% +zgS;?oR2Xf(f)ZnZYw_ayBD+uK3|F4%K8g1*Z{+AeYmQURG{fm)kjDC^Vgt-U34QV* +z8S`9%j?1sXMNG;;<}h?vJ3KmsIG0(8>$vH!h96LgOhl%Cb}fw17SRftc%>I8dc22>agH+hsX9;XtLNP8+I#)hlHIS|OMXen=W>bFPlyKah1saahE2fQO;ohvaiF2HK +zuJ7+aU-FsuAt-lhwoCDLvBcLzlc>Va{vbPxLb*dWP$mRUN=F2)k6~=gYpa=pX-PS; +zq$1AWxJ2EB-h^+t$hzA1zRqW?6XLwR=lgwsRDo_@x~DRFc32KjcJ52S&3ComKF9Va +zerA^PA8(Gn3~TRj +z>?#@B$-zn`%4(3X%Q_euJ#~5h1#8c|U7b)4KyfLSmW};*sj2s3tlk<>1na5PEQ=l5K0M9Q3oHwv1Gc83q(i@iuSmy9o4$DIC-ZWwUaO~ +z0J?oaYl`4koox?P3@ffqP*kb;I^8lU1k>=AHbRR@4VbKzB%LXAQhNC7&6M3|5r|eQ +z?$f?kOx_3fiD9naV+hj^NAQ~)E(Uh^3Yj^EUCI%_y`mh`EN +zX-kpByGcBSm=$qS0*_AuNRYDWaB8(`k(ZD6-@`{FgQS#Eoz7FwPcf5fANHcEsbKNt +zRaCe_%zkU#$S^x>3rhx2>C{tqX_Ba~M6bWeraJVC#>P8&42ml`-W!AfcvZWsqN79D^R +z%1z#M6<48NgP?2q&bB#6<}@wicihq~a0ES>rjJ?<*NaS*lh$Z#P$4fFI +zmkQkAK{X2PWR7{7uG!^b(T&jhrXs65D$=VZ0K86QJ1uS7KiR?Xq4uJ4XszGeX1}Cm +zH8dVsah;30cGu5+*AJJ-trLT^o`3Jz5a~YPEfpxQzRD9;#Zkl+oA|LcfP?}FLq3kE +zQdydWRE8OiALi2LlIEu70+q~EPg>^m@-Oo#MP|eF;g&^`v9H!XG)smhMkz)+OlVCq +zjdhG$N3Npzk*s55{)A&+n%f|ce;VC8I)}Y_H$ohFI4?CTpBHKu9x%wjD{2B_$(84w +z(u)2TUfNWC)_u0=O%#FZL-h`nz{%5GDN-hXr2z8MyOfWbdv_mK9NlMH8yElwZap)# +z*5aWUQ`23kJzf300SCgVHDDy91*W7NhYV%i`&$dRp9VeOLo@F%k=Nax0#BV^OSu{w +zN!}j9%P-j2@b=qJO1qVw>Y^02Tl(*PstgRv^Jt(w$~0rVbWd_k_nAjN-O}3?*Gq^e +z847pm@(JZ-*bE@Bx?nco*eV08gV@2LR3Ag-8Ik##FonM?a3>qTh|MDL<1sglDd;~W93?|-E(*amqD=}}K3JOqttnIjP +zE#UJ}I;m2dnRPJ@`s=Lrdp?i2><%CkbY +z>dx65*Faiu7M?Cb*W4{Swu+e&gIqEl65>g+v~KyCOS3FEv8w%$|NHKSaLehDW+jgh +zN_GHt`Gje68?bWaP+a-D7#@?7k>4!*-3e$%bqwd`x3DF*swEa^qibblnqQYt``ar> +z%}gPsm{3&;oU8f2C=10YMD*07nef~GP{VGFA)r3b`P!Q|7&Gb#LKY+Op(mgLz>s54 +zv2qv${hGf?zel4!*vs%GU5P_;zTLq(S6d^8oKQRGTLU(yo>NGEtPi8X-#vL0(r(+L +zFM>nU!;eoLYK+1{<%!c!0?o};=rf8cF|g6}M9e|R4Utv0aT{cQv-o+w6I9_p41@IU +zNc9ss-94ftVD`cvNj!DiUFI>4*t4rp5rvZ^@@Y|58c*Axu8+9YM@@O<^rY2{lu=ip +zQN19(7t?H4$e(ezrg|wi=ae#*%ucbPr-gT>k02%sA)A&An9KaS8%>hHaiXX^DO!pT +zOEgK+TUvhp3R#eBBlK%$WPnCd+WUu2FtaGr+I#Q)4J||BA9L$}Jp%j%;{)FPHTsvx +z{FZRYXWP9ealne|Du#SKw2w9C)DA!0IFgM#oy=LP7m!b!kOVT_rx_V?H>Py3mCl~H +zWnbVPH4HONQ_e;T0Z{2<2-B6a@1zOjcKUSBl5&5lC+DmRUp6XgSHJ- +znV8EP1SZL*6Xeac*!QG&G;|4c;ykt~KU{B7;f7cH{8iF&0-&*>sED!qGg$JxU5A%+8a%UT7Q!rv0BI#tkLIHH2a;VUJCIYP%gm{0fe28v`{EM +z{W(T<2L(a(ouHSm3~jiqr`0Bv9a6B*MTnWx>;1MZ$r&#~?sMOl)%P3wOVR)Tkos2= +ze^XaluP$q7{Hk^=p~K(9%T8ur(NgPf@^c+LJG9PH{k6JUQ^RPW+U>P0bzGEzQ<`Vv +zu%f}Hwp3fK$>C(@JDf05td4G-CGMP+sIf}dx%8}pTAOR2ye(A7B^f6tdu~ge!5Y}w +zuUi%dqX`mY8mk^$O$PFxo$cX4c)vbfGTolLp4^1&C< +zB<-c_rRNpV^E`m23Ex~7`@1q?kVZIJgg;b?8>is}oAymzRgZt31Bnh(t;>S{@o@W4 +zO;vu421}YgF)x(BB9|F=NC!L_U9AS47V8z(I!)Zf(UV=p+Hk{F<6u{YRIX$t!yris +zVBE7)(w`Pk>rPfQf1k_m*^Au$=_ie&p}p*2WkB(3_OM>2YD*gJ{KQ*exte4G<_#gX +zF*3)AIa0Mr|6jyzL8xqFR$kGJI@Bv;@7~5Fc&maJZE1>YpkH}f +zy~vaXqjn0i!|N(i6>&wpAgN=`BJB{Kg79C%n@yp+vablYoAmaLUy=Ii#vvMe>Alq$ +zU6AE%U<*b`zby+ote6E;h1)fiV*r}PdA1mj=z{YC0;4ST4a-CCG@>x*fvpmvoS?e3 +z$Sj)XQdaQuyu*UC2fDQw)q<3SrS&6uRk&~w;J^B)t)O)jx>F)?dM0UO^o|-K-3-&Q +zs;@5&1A`5-IY*6>hslrl#I0 +z7Cdx+u^Xqjg1AR!*K(Xq_)8F~h{+0#{(8DPkTJ1EH~l^w5TrxzN{wn>M&c-PANJwI +z4bfA3tPwP<6f70rKmciJP?JiI`#Z<053njf*(SOu5z!PfINSAoD2k-YG$fJUT|m&c +ztezYW7sl^2ZPZvOAQ$`#c?AyYrMswOU>B{mSs4%9zKVNijkKa-*_8ZzcWIv@-0>%$VsyrV#T~Ldu>-OoGC@B5h0}tyHAvyLvb5j#LT!l94~T58$n?R +z4tzc1-V?c{`VAT1_|_YdwHOgNX-^-cM{o0XYchac6dLJ2h5O9^H{m`JD>Kvo(&_7|$lC`K +zA$8x=a@ir`BD*%qM~~OEM1=VjwFn9sZ6v6XjS+l2gO6NMkR#u3b#b!7k-4rnX>(_E +zt!ugLoRl>+)lF&8{y}h1&M3-~A>RnyV<_1I3}tq@Ix;nTWl3wPWca+C>|MyXQ*tBT +z2qkd-7gCYmS=({n)`@cuiuzj;yPSr`=pkL->;9jjP~z|P)`ihzo#!oQ4WAkasyMD; +zyCFIw=5C<%b67yatNQ%i-`dDODc^h89ihrT&m3iodFIia>Oxu=%Kaof%gEW9Q%#<+ +z{@7RGv&th%({b~Y&SG)5sijf{356_@W}*0|)CoGI;0cfyVWgg7D9#w-WX^O+CNrQI +z6S+zYM4np+f9S)?gV#G_baksA7h^T>M)4r3*f#V7(&ZgOt})}@a`FH3_F4XKx6e$( +z#?8t8KiC8d2OB%{|N0#l-R_2H>Z?qCSJ{6vHZN?(pSD!o7Ga6O8i>KDNr>2mq=4c{ +zppY-X>HdJBq16Wj!eAgl=VO6@(6}M1p`oLxiP0fH023seKD%FCP@p|}=03mse*0cH +z*ya9!MuP5kXiz|9MjQ@Ic@5ri{ft%JK4^U_ctBTbX3vwfc=;Svy?c-VwCGG8^S2vB +z0YYfN1BsB#vm@t}ORYZtk;b2_eV~TUnj8TmtNZ+I3!pZ|y%&Adk_{i%lb&-6kcUK2 +zxbj>szbW<3Qf_dcJ>uYkh&6x69MAbW`Lbm7PXk8D?`5 +z%parIC1y@}4LK#fxX)p(E#J$u@_lvOJ3%0iH)5duyVKQ}T)&FfKR86;pA)Hnx^X{m +zj^BHubae`;`RO%wSZ40o_n?5{eMk=MVEjU&_v1}Z>CQ5}Iw7BK%2fbKjGJ&g+N +z%~JfE{p4C9fkt6`2t5}9K?55Lb-M6C$(;l~eC`9|Kyv2TRTP6>-=Pvo@{zBUrtkrc +zl7`9{|4~_P8_jBa;0uIoia`<%K8qDFt%G*kvr;jH +z;rrv;Sntlr2Su6>i?*+tDgvt|BRek2B@wksmzB$Ji8SMKr5*J=TzfP$Y;N5vK~eLI +z1xdpZmyTp{NImK|@wybYfMl3;b|h;|NEniY5NL27R8CN>G!C?ghEL|HL-a@RH8&y0 +zjyA+@=Jde(S_TEl$xgsp?aLRWG%oZG-=xFgKGHo)TPQ-P>D-{!kSSE`j;^*3B*Y-H +z_bsdgLLc|vWjUGK^x~pmkiSA1(wGf|^_*zA?dZ(+&`om-nz$Pgjf}&`W+aaZjzpeFB5o^`Kzf+}) +zQS{4>;lfE?rdf}w;QcI2``E`iSA{r-?rAamv=5GH4o)C>Z@6)Rk#YfjmUy|XE;|kQ +zAY<3jC6GhM=YV~PK9?k!l`Vv|xDR!h=e;v^E(T~Dwb+mPm@#4$YjFnJxa@%FHNO}6 +zq@~-JAw@CjY7rYIY`wsyZkShd&Ke^;fqvlPHE;B2@d|pPbwjM(d`fH>SVPifqSB;6 +z!xK>&$II)zjxb_)+Fh@N&|*lW8cc3a41FDO0ex5jA4U2ND5I>z>OYoI0!(~v7|p6U +z`kZ@EtTj|Uky>q$b#1XUQji3U5}ih4n-aR$#zULcV;ZDPoQBn4wV6bOx*p%4P;!ZU +zQRltL+l_<|V2Jv@j!zc53^#+D9;=@ooQssTc@k@2uk{81W6oXt)ty8_ap>8Q2sWWN +zz*Z6GV`A#9R}x=janF)s6rhr@xOf9(O=e4S%P*m*kF_pgL&}TPl`;Was#3lVws{0E +zNs#wp^v?c<(g$2|5ch_p3z0T{!nw|!@&otO8*h{m{nZ)s$rjxx*Q0rskAVHM-Sary +zxdEH^h?J8=oWp1`swt3;ta(Uri^RTPD^f%pAzl&*A>IOMiyZRDS(#?ZrgV&sCC!Dz +ziG;NLhACD+;vIlE-W#4#ghH?Kl=aaq%Pm7CnL|-Irp=P98(}*+uBj5$g^3hK7NCYl +zy~DF+&upACj`2=?Yuw9TMy)tN3PtI-lt=~Zu`8376Wb~%az&B5Gm%Sqz2^bBK)e*+ +zn)=Q7;cz)A4jV>+TdWIxO&m%fJhLs{lDIwW8aV+n8SzYNpXklA)!a>gTjM{TO9qM^ +z&SgjxvtL5m`%)^iLm7`syYSrAh2J{Xog4W|L51;ts6=@bQ>1JYN22l5QaDs!gk6*N +zOyaZ&S1Af%cf;lc9+pWXm4TPX_yC*iI1P;nAHcIa^|6LWSUCiNo!&6$=Mu4Bjp#om +z9oA)iNGT*PQf;pSrVr3wQ@~EShO|K^YBcXbw9h|F_w><@dq9@`sqtwhV5*}rw*4~nT1dvBC=;yx5m +z9l*a&ct!m8NH6^D?;o!R3gnu8Yr3sjLm($Np0gF}xk%Shc11LL>~NOZK7wbd +z5|QYQ+*f&AQY*{nh?xm$*)E%s0E)4!S=} +zG_tDu=T=tEV}a>cpsF9sfVkMrLF{Y|C(e(P&7K##n8vc +z;m(o7nD5YIOWG+xu$)^KX&>7n3VA=i5#7Q&2j9!>?yt_wN^bYJjdi8&kcXYM);W6h +zppGQzNNLN=?{0&kmpg>$-XN@R5N3TEV;?uX{d#+4q?94J@cm0&^9v;LOpN6`Fup(f +z{iZ6b9Vq9CV#D~6=3fqKGEX^sFS_eN>oU+bUSwtxsdFsdr`JKeckIXQ+A5@ +zKM}Nvm_qnK_(1T0=c4VdrBiKD?XTU7;Z`@FfZt$YrZ|=|nKDk0Y6M2>E!m>pqVSYt +z1D?`oMy!<~M;#-hD63N>DAgNJ5bsCstNQli8+Gb-%3;~)Qt1-)Absj|%3^76$vKWa +z?u)Wh_<>epGS-ZV^J@k>4ED@&10DbI(BC?4-TT-{-uUb9_ES&9pQp6k$<_Nf{f$Y+ +z=t05H7hJ3xPI4>O??oPlj(evblTV-AZ%3Cj#*Q+xyO7G4@7w)3&Thz~8`K>mE(quO +z7REo6OgTCs$TIv1`*zXP3InwcgxVM0yX;(GlygqC!aAS0St8qy;!S<_13XO>`*Q?( +zA&x^H4Yweye&Ku@s2p!R;C?{R +zC$gUF^oXw_Wz4s;?K|m;w+Y_fMO9J60LY(E+X`P7K=YrQJ_u(-ghHJdoiiPMXPiU; +zcPCzwg<#D)`-Ai6W}nn{$>@_(7>7R23DKQE_r&Ul$E-yJam^=sqJ9Y(eB-{Pw1sDS +zgk$$C@Syl?LDvv!Y4=|lavl6o>3Ck!;*Dg!`SB7umL+Pr_sVBw1BCgMN7AFilv1{dlR9N%lMS3|0dV)yTe^MW@A)!6S_~FtM +zn>%eVx;;HB_UVG?&o3C(3+=kW_oeSAVATQs5pxnoe{j8jeTn{KfGl?FZhQ;2-HHj<`trVEqRFnL<#!J#X^hJ=4$KE>aWzj_D5b*o?;0LJtj& +z;iUI6s1TbfW#$yZB3-Po0;Qe31u$kyr~j3?x$Dx-ub(T3BquLB3l+lJ*x>ARe+LT_ +z#e?q7aH{gJSx2j=%Ue8dA}96nY_s(G@U!ORXa1TT1cCU&YQ-maOV=njAfHZg?#IpqE}hVRcg(zQ=m*+pHE>UEas5jG7+XpHUcs +zH#-SoDFPp3g>n2nHm|6PHJYzWi?dbQpBK)vy>;gF&wCxIE1WjJH`*-kQ&KZqIPBNI +zCStQY^?ffNH|@J#SJtn)-nZVp1=czd1wKypKXZM&b{c1UxjarLYY`0YA{jl0Q@i$L +z^>4{*UlKHY#%X&F(0`7<4W1)O&SXqp2af6=;7aELV^fi!db0c*LSWX}o!@bl?Uy!~4vwR%%dGzK<9VrrqOM +z;cl!g-48IsUuiq0y${4A<9R-clak)X$H&HtIi!kMny=}dI&)r}?mBbEBZG#Sy!H_E +z(7206X@xV +zq&2OWUQ6tWO6L(CjiO~$q( +zLf`i>!R=e^7Dh!06AF1rgRm42lJkl7M)Ahg+}T3fQtz#k{!`yfysX|+ITDSt)fZE4 +zJUbV9)6S10*NVrUTe)}85xILmbKUItn0zE{_p7=#_t;L8+u`N4n;_+v`YxUaBm6^E +z^>sv?ez?>H?^ujtp>stjCxH7!iqjkQ>DTQu?scUpeRJX_JdA<+_R!mSvlNcCFQ~3( +zW9htAj7K{v$%U9pD{d(%m@*@=P_T1#ur8x?=_l>~x=gs|@V>XL@DP{ldukM+mtFRRVcTo8)>&iD4|>b)j1*bX2K +z?W8@oMs2&~eF@a=>TN4zRJNMafIGHfQ!e08xDYSFTV_sE53R&`0s2ael=D?jl#A7+ +zZb5RNg~)Hw;Hy^g;`=_7m#5#fG +z7`F|A2-bsoN79sKZDBL{?-zE*c(8Z+`of9(ZXu^_)62a=l1_UJl4#xr=myBm&PE}s +zr#y*4uqVV(6zZ$*M&JkogM2&4IhcYWj%ePC-6SsKd2XvZoeK>*?BqY46x$&TjdpOo +zR|qh?z)J1dN}d4feyvoacNQCi(96l8Co`d;a=z1ua+Hw67#x!VaM(kcnn+w2Pp;t` +zF@b2@e`&}6wDc$8`^#6OPG#(vN}`6EB;?+sPU-61Q#5lZQc5EZS?YCDs2bVcyOzjH +za8jH!oPvn(bs(I4hkSrEpn<2}O|lO)9J+_Q2;I}u3}P?Mr{4Ft@Q-}ka*Vq6HgDK!iw-I=# +z@2Jlt@8ct9kp}W3@3cYbn|ZkIcNi&Z;H{%CLTS+Sm{7;k3{xhP)W|pQa~3)gU<`kwAeWSs{~gDPmp2?sp8l1T&>V`(;gvVg>>`yOX%jgYOJ&NMo|`=*2sM +zZ-V_-Z3*dANhS_Ck9<4uXnp-(s83`oBy-{_AZW3oNM+U|k4%|hS`l9}&VNcw0k;UK_a`KEjh4AMus5R+pQJbwW +zkIpzpC^M0)7=E(|&;n1ZmAqNrQ#;GdDqX4tAo +z7X}eK+_@;PXj6%U_HNaHcnB@bD&`ekl5L^MO+|4tGC5YvZx0vk_GaBYzGx8kS5>*y +zh*MW%9As71As!iDm!!8#<+D+V^3+%rM8e`8w(X(OV$2mX; +zRS^SR`Mv1b1E51!wqlG)X%K<=lA*-Y_zYbY5__c#V%UuZh0p20BcWs5x%8Y@5mgaK +z&)qxYAZ-)9HYVCaPjeqbBi1627SA4fgthk=oxtJ`@qsuXUWts(Tk;oa)ELiXgK2sL +zn^wgXrSmwPQ?@REa#G!?SeGGn!jn5WXk!kI7X`Y$+bk&QvMVsjf|@Y}d_tuKJ|-mt +zg*!xGF7Nnlp(m&#u?N0$M0mUYDwH+IM_w#~LT>L|0msER|9a=@C{!W8N4{Y#8Gbmw +z2R;&*G|Zmp;ESe;ea<@*3XWh)%(%)jHpVkbCjfAh^==cI15H)maM@&6$)w +z>9X0B?fvwUS;P?^I`cV|e^1+nA~`td3kh$pxnE{AW)hNCSixu<%bluY$xL5yQJ?H) +zthIboJ@L1x?M`N;CTp|sY=g_e#5=Bf$0(f(VZ#QmjS=U#D0{69XmW2qYme&~e4oSR +zQSE7M=e8;ClqUAnYc~xVGd7(lHXVR9I6UexgG2|fDun3Rd$~4=xqQOm&-(u7ck2($CINGtPlOO1l;qWi0*<@7S^fm2P{y=s6 +zg#aGChu{j{*Y4HYe~`YaGp=?NqOI8J<_5l1Y~=a(1?s8lDehvS)xMbt%ZlDj+v{cA +zI)M4eo&tA}V$yK7!)9~arPgFKwceuIWLA4L$5rcqs*1LeuQAItKdHXP6ypzh$CSIv?OMk8 +zeFOt=W^>P#VNKQ&==XG5Jk>|)xA{~Wv-3mrJgX+dS0?kl7nlS^8ZfIlNRM#4Op`ss +z(uf=Ag%=!$fr1(%V>KJ(1+1m{Heq?*z6@#y<>AamUhlPu&wt{oTF8cME6 +z_%4Bd4%Rhc)+~rMlKn)WZ~lQG!@-U57;$g-`a$Ry3NOhn!G9Q0^Ppup5R^n;xY4UB +z%=mI|!_I9mPlIY6Km`3QK6k)fK*)23?|wT_@8=;ZnjoA5luTq#v@Kpc*j&IyCvd1H +z%C`r0NgD{WfR~6<q`GjzT>f3PcgB%{H*PEb(eatVM#u2141){ob5plZG5b@{3zW-2*VsPU9 +zhFxH6i{9IjTEhrOdY4+LGf-@!bHYcAtxe$TS52;?9_R;-)ri0=jCf$M3fIhiW^f(Q +z{QfMyz)?HyYJ11`y!6EFeS}HVHY8?k2^$nKKloxgU*BMS&7Yvpm(NQU;+lZh`;F<~ +zb?9PH^;LqkTSBSrZnzV3q76mTx<$BD_PIU}CL@Z5omzEKB#eiD|23tz +zBwHWWyK*1%J|J}p&&mVS$PLlJObR4^u<{8TJ=OjvBshA`_6cgT!<0IDXdBZeGp~ +zi|{~=3H1>E1d1nhWuVcNH>~x)gToeMACo%L3(@XHBjsbu%Ow$B}k=K-vggI}Q0~3p}C1_!5XU{+k65H{at!$APx8 +z@c5CR7Eu-sDG;3>EY6vzvKQAbtw$FDCx$>c{dE;>&^NnVdu%Vd?t;;Lr0ao15Vks( +zQ6^0S%>9FD1gc%u +z6COA3vAxWMy>5{g(t&;@^qLC^s|?8pH#-pK01yb*-iQ9<*?Elh{-s +zidORdEHtN(_&f`&a>Lk%PQ1!NBCjN28aFC@tBjZ6_mNA?4J$MTG*<&WmkNXx3xrh* +z!nEJ@%cjxS8R6muZ&e;BrxMtw78uOI=jCO6gCa0FXH62dGVi +zDD#X~;KGI(q>u)!Q0uN^_!#PqJf7E&=+cC@&+Mf7p$9Ur7I)`P)Ugf3by~>fp{DDH +zFi`P_X6Pqx154dO(G8S!_>T`E!*6Cxzz#UxSl%&2c~wLihf!s)1vo;I3N%KG170(Y +zX_YN3a8%cK_0b&qK>327ZLtQFh0Hs&ZL!j?f4?S(I7bT~e}kqW?c^^{Us}b~nS9&% +zVZJAJo&Bb5&G{yib}Si{dH1AQAiZOXO%3Y%T}WS%Ai}jTwjs?U~O=X-Lh5KX6V?C +zS+ycm4yS=hM|YxDL`#=ft~s!r8O=kQ{n%Rh=_X2&M|!lnL&^n084sc3amV;Z<5LvhZmQOj%?BfsCWB{)uzMHVf**2$ +z;V4Xypo#ETylEb^C2x2%zN%&R&IhA765oJ3(#9$48^69jUzxI%eb_JVcasW$)&_YU +zXcGvxc8+ZkQ%F2T94%0$7}<^LAgNiZPF#`vjbn*|t*q)VhU2tS8}kVt0Gc`ZRlCZq*pHz|A}1w*W?oE6Ge&o#So +zT8zur>KQzF1Fwu>gmB*LPR#AbL!8gMDZ%Z)y&x)L-Ljcyy`(Owt*{ph4JS&)Zr5Ls +zccN%DeVV5`ViudG`8T^2_dDZJwYVG}K#B;=-wxd5qEc$@i1DPjo!ryzY@@0Dbhd;) +zvq!#}S~P!!IwquI4^Ch+br%j>CEHRUnYf(#$yw~Pux9wBv}Ss&bbLMD<>U}7maG;~ +zC^bx0AW;#!QKUqrzCv*~N+GII3)T`J4+u`+bxQoOwp|r!&rk@GV=}5l9i^NvN1{MP +zvgGYhXoj-TW)gO3Zb~9Pi-n;l3m^_RDcd^=-#lDRj{$aP8a9djvsD^{lsJh*%p*u~ +zaRU5x)x{bs^C6614(oas4reVVeT(+S>slBBE}W}DlSt9lLB$ZMQVwTo>k^B7yVjB0 +zXYU%M$GGWri4&!kkJ3~ktuxAZEAMasKR=rR>5cVP+k3gjxJdD&n0a@BzighqKz2}t +z^C|8-o`%g@7?xwK`{H$hOK=M&wGg8k3C%X_7j;`=Su%-QkGr#*)q;N9P6B4_ +zG@Fr9i|1Ij=qxvL{DKQVuPQq4>CFA%1bu*6%vTWD5+oYSRng%ZW9r?^zA +zVHU|NMLmT|dG`Ch*xm!HJ@+Qtp-0LH8C0m*If0MKREkyUvhk^U>%r}MC_ffPleG4I +zT_&Ny?U!api{bs6WDj97=?Pe)`N-trI|IQ`QSee6UUyqlUmg>*rC!)Ym&MIs8G@i$ +zLLkl(Fu@B`fdub +zc(`U4Uv7a{MY>P$!Hqkhu*P6L{j6g_B`H#+iAuy0mi8m?tV69&Vx{VmE{wuo*qWq*uD0J`$2ByIz@m=ZEfjw@f(-Lc +z?*QG$;1$U)SQke~U@P3_Lg7H4`5FBs)A*fKW@Ou=)u6_1fY;)dkCF2R!V`cv!TLb{ +z*7FwsHvX3R_)h+Ml$UT|x>&_j(e9!}C2E{NQTf>} +zHN2e3+Ub-vup-tIiKV9ppRiN|)BI{}sWFDcvVqNw?K48_f_M;+`ywo!>-%?|oid$F +z$Eh{m*vUe-Ld^dUb!&?in~52H*=`yWzL`XdG)hn#5%_=|Vl5_{c8tQHwE7ttdvfS& +zG?e3cxBS7d6bxAM7ZlisrIQVuGz;lap<{gx8H!S=1d(0}O(Y&FPd-{>G#rJeYk>rs +zqRz0ZNqEzFcQ9JP&)O>OM$AWFia9MBy8gk_Ooinza(VywYW;R&Nh6YG!s(Zv)B29_ +zPYCczvAZvS$0CZ4`M(Er+R->{Wtm6T8vd@cUBM#;&FA^VX9aEMt;+fnIT=xx!RH*r +zRyu>;n=4F6SCQ8@fhYLq?%-?>Xd#Al%+q}DnRkXCAH6aU+G{CjGX&U}(u5+@EgM;m +zwDW1i_|d~SN_uHMWbK?+5KjtM*3EL8U+iH|RNL^U_7s);Y^#6>ipu#bXO7_>o2gqf +z_R*f;q_ykJrn@FKLF-AWdyY}RP@#*_5w+T|znpqh^d!%&@`|ZE9cSc!^@^@OKG>iezX>oyYqo@HGs!2s`sMAa*8c6|@CMczPR5dKbMq`oE-oO>o +zuJ}vpb^E3HYqv29de}W!E)8h|`B8oonF?Y2MS(`QoZnmP2;nu;FFCjE=G$OJ)#EaWX{O*Kx_^d~ +zhhkwF&a|)tm&d%o6Y{{6ky$AT_3f6Oj6^LIce6)-NjMKo)y2_ +zqy^8Bsb0FwV@aVMB-cAzsx}tDC7MB}fiXRyqRBESTqzLF(B7O5Ct3Pqzz#re5@(BK +znL~-0HsdwswcJV-!d-7xuA~z!?4>2y(Tqv?)6)AC%u#aK%;jd{ +zc8KPzIDt#5n< +zjas|?pzYk6g|VY_6UHZ4Ca#z2 +ztHc6uv8l3z?+NsCLto^aEbwXdmsS9F{y8fqH6}L33nuu1Xz=X--Jy$7hg*kThyKdw +z=IrA7HYXdWRzm6N9>Z-C*aS;QFb#Vuw3B$tuj!Zw}Fb8qtWqsueG +z#!k+8&8*g${^iz1O4#9vSTGQt1Wjr%l;fE5#&{MZJ@;((nG_<9YLHXuV0vb%MUraa +z2IgFuZiS6{dPQ%A1iL)BDtmk<>1jIf9E^6wJj2S>!qp&dT5yx4^;K@fh!G)Ewsdjr?{g9qUbe` +zgaHlT?Z{cDJ$9X!+`7mw|DdAPhwFd)`M8C+@;>G+T3xWWJ0FzTUD#I{hrLd|x+=kik#d^hNO2?y`|psApzSLydJL+M +zNNX*^vqmpYXUa_|JQZXKj0lL6%9FxUW>R3x)C;CmPt7j3+3JI2@%{aMmUR5Y&3=M- +zmf({q(jin@1m4ApbT)L$RwRWmVa?y4*F1!=bkO0{=sfB4sw;c!d5oNI0IQN`po1&w +zk3Hyv_da#xu5ba9N4cr>P?T>kx{%ic{}n*0)Ve;OUF2Yf^J83$5;`Y(r&aGO*=j|D +zq(zeeVo3XcUt&)KIXe;Wssvq!yKf +z1(j+7`%e^fV$p7KzmOFXJ%C`R*ehFDvN%U5bRk!KgSv+fWiGfOT;q5`28{p2$Be8% +z`Jrzn6%kcG+OEMlLn$e807OE90y}n6486_!?yc(UH1_-`x|3FWLOUgXV_c__{_E;1 +z1hmi_RfM^#&D^P1n)Uj_R?M9O{joOI?;)~A9dw{unIM#uzagF=L=3ZjrL9ETLYmuF +z#Yw8vnauODMkIIE=on3GawC=>=3U#mQQ +z>bV#@-*7HIV&*tWsysQtFkzOk2}6Ww2TZDAfvlagtUeL-DJ}coWIGYn7|^iHu)r|# +zuylx+G8UYsg!;#^y) +znY>9$hwsJcTglrf&#U97k&`6OpC7WKTH2bQpJ~wzZ}D{&T1SR&R+Ywm4uau79wE~n +zL*hxz?{sH^xXtMq=B +z&P5g05AY!*sP%{jpc&##mk2!VApBL* +z?L0}s=P&t@3OKr(sx7U`0!t?*djS#j+PFeP+5`6Guln>v!iO~}I7$sjE=U9+8iL-6 +z=`e4WBYi|`-7e4m&J$lM&-*q_$bPa-VW~jroH>LpSMcWdjnmZt$wCu6ncgL*oHT)= +z(oGP(53j$!uW!H(l4zq+9$iE(8H+roXdoXrLST!j`lFVJL*3q98@u8OJcixwn?Pt2 +zz%R=L+}ZE$tfEq!fKclq32Sjk%buj!KAqtbr;f#aSq(9URA^6Oo-rhE;9m5&_08pc?zur4EcT5 +zH*iT0p@A!EWvQAjKbkUjbuOy3ljfjGnWG1nhACXs>`>x`?2CMP9H +zf}!VWNx8g3+Czu|HYF;nM%rLTVMIvTVPEY}uq>hgq~;%XJ)*hL)Ym~FQ#d>b +z1sq5j@?A$g1V=ma7j!%1Tqo?`3V7bT`8Oz{LS#P#$@g2+1Q*zh!dDUX9N2fqe<|V& +zoaCU=0{SQMz+_mQ(kVU_cfRs+Y;ntUcItEEAmZF9n>kX}vq+XZ`1sEX}MBecrX3*Enp~(h$xt +z3F3MmP)B?1)BWNLX3VVZJclp~;a@ku=$?wfySDje_r?LJk_tLL@;W;DaYUTrgv&>7 +zom#YeIO5HTuSO>M3>}k;nKtwpiZF1RDjHfVL12Mq^m*grQyHfsNm<nR$ +zIY*^Rh=8-nUaImYjcL`SJ7O1L?k_csp-z;VIpRjF<7)C)=Z5P{f@zvy{6^3g!2@qa +zQ~M9omKxdkqO+OoMQF^Yvu(F_9^!q>#tYB8k@X|0ep+e6w(*&95cQXz6Hyi~!jrm} +z=nr?v)VW5nq2>#kq`qeAb&p(bdavPgev2dh=1d2;UR=2P?Qrx=LpxHq} +zBVhtb$whoZ6M5ZVxy-cL-J+0%c>#ST_LYR2 +zTenQOkR6e*Xtpbs-ww!ie|b<~Kr;Dz@KASYG_8X1CAx7U5J|)pD8n}OU6Gt330eH? +zh~-KlU*J~)OM=jX;6sY^EdfWF99US@D@&&(XJ}`#=k8J2r!;9KD^6@m&eY=w`-lb* +zO~ZAq`P9qP?2kdtolfEG6iBrP}_gx>$&Z`2Cjf$ +zr8NOQGb +z;90Jft{Ln`ldy4Sz8^Fxn6IW;U>=&b8q_ii|LT@ErDdu=03QR>Oq;WEN=#GFHw(vE +z3ngH2`5JW)SG-(^_K1&O(lu-&jJr^;UQRBm{n&pi6RVdXm$a{N-g=agg7^T*ZAmOc +zW;bq&RVbD?Gg|uDRpX6e)O}hQL +zilCWkkZ{ccfn*bpfAeFGXoy&Rz-zXAa4qj=TiHMqVfA>1H?Z{zm>O3Eg7{h38+YE$ +z-YNoj$RrB6&@mbx<(cgxvyAXtqc)o3}qXolk#<-|GEs_5tm|Z{Q?!c<~5yVn+r8Itr80qXITtrmm!rOhx`?=m_{sM7guu%iTH!WMJK05c +z=9}=u=Y&E^Ai$Jn%DvKznG5Tk?NRWA*Kryplj6N$P-n5s5mGlcXCNp*#~&_q#`5;9 +zGrB@vME(xmTB==RS?E~wQL9%88$?(Ke=BkN4P{IMXoOb^oL5ZYy4fUt@GI39{;&>u=GDG@jBQFR`+cL&gpXQ-$J3 +z3fghEQpT2**J`k!Wvlh)O~^#!#FNwR0G#dS}uu(y_~Cl(I&Rur)n|7@}sobFs>$4uDY!_s?BU0f`GA2YoooTwv`iydO2~M +zoK3{#y*8#TrU6#eZPiu|L+R`7U9#$!t&o5mqihHZ2EVZ?r>DnFl*cR<2T +zC3PG77TV;fUR^>(+BR_7Ka?BnE1?VluU-f~Bq67Dwy~~}=ubeQ@T%{&xu0v1YtBny +z$_wL3GnNLHR|r3SJdpaEobAity70v1cxC-?+S}=&_%U>8C24 +zBDfp2eehelK=Q~YI!j2cN9jcGbPi_nscfV$AGMlV{eS +zRLs#EIXS`o?&0x=N5uCMJYio)Di3_HMHTK{J>mk(@1y4Lx1~2$%oEHL^^*;Ni%(@o +zeM^TayD{~hz}v$XF9Qx!7R#8`CCSq^G`7^lK$(87Pn}=tx1@T_~Od2dG8nLgu3Rl{tivLqNA)p_j&c<)iQ!)%;3{ +z>uP6_Y?N$=3GN`UUrP1_Jwcv5@{;j#BjU|1n=QjA1xcWk96784!gUQjMo(> +zGUFUjBvE=K-Mxd~oH7Q5;VG-5G+~}L9LRB8jx+ws>M1KaUCmx-(tZcd6Y&O3pyPYq24^X4&nqGG0U2f!stz!UK}ug +z$iw4`!lX6`AvB(Kp?VDlX;vGqnx4B{bPVYlURqXGOA7u}wcs^RT=9aa{Tk_>&6LP= +zq(qLo62=<#UE}$NhHkON%%Pec(hdDU{4qI0n>)eqXmy71MzawW>M_!iwuziZbHwX@ +z!9N_?xb1Qbb;Vkhe`+=8VQmNTWCB>9uDRPb;w0fV{G7fAWG81ge_eB2s1VERNLYzi +zvo{+nlucvDEGh<~q{rKei!=NSyNS$ni%k?~Tp(a#0>{SCF!qvV)Xr0(LWQ$#k6EIF +zKK8_LWt(@DV|w#HJ3G#m!B{je`~9U-Ga^3vrx13D&$ko^uF@S)p-6jEQz|c|IH^Fb +zAcm5>`LLg9VLy{{-m!DI)MTB**?;aruX547T|bhIM%G+^ +z(VX=?Q6(svKW!e(HD5MwHh(sc_Kb3r?jY`f8Hozl$Wzg*s91XNq(F@Hr!a_2bz^Eu +z%LJqhq$S%><_iyNDax)dsM(Yg5=9M2zocigb_wpV_~%+c$CD={F5k=9>XBUNRL)oVI@dG6x9Xh#~PwVP^ZCZFrlfjlKC0t_Z +ze^EAC)aJUWh~7VIgiZ)h$3+TA7Uq`rGIC-;^Z5QHL6V}W1tCiRqpBgjUfC#YPBs5r +zoF$e}VqL&mFvXhZYRtHAJuJooyloMw2F*N-yx&%~m+=pA7z*}&EE2|fgzA+E#OC!! +zmXU~p_V=1GesC^60sa}CI`JCS9!ZU!Er(KkUu$c{{)wiB9Mz`*Vzfq3vz%tu>&`o; +z3F7*BoR0|>)01opB(NxP;;o-XE|*C5LzuzQE>~Yle0@PIzyE0 +z?+=wFbMlCS&Xw)Ym6MB{Nj$?RhAUhn0b$`U;Vp;u2(ra*`JyLWi?4=$8ILsy-JWqO +zjmYU?EYYUC9b__#3|fe3$qlL>`^@a7wrJ5SWHFp +z6`k&U}*Oyb8HROJ8*dy{d +zR?Ju>VoA3kp`b=sm{^w;5Q>|@WpY`m7pAw2zW-pD{qMUx)iPl&fDDHr?3Mp`e?SY3 +z8AX3Uc*pR2o)3>GV!!U%mO2Yd8^>F}T8(#z=lv+*{j`fP#&?9xY@F$x`aS6z>5;hTsR))OHW63nreo3z!HosokL}D259JfN7X@xajO|W3xfBTD +z9bMRY^h_wOEjgMd3zRx>MOZgLe0*Yje9AHKK9}2wLMo6N;LW5BD#B8H@TwoI`!#AUlDL>^Xda~C$0&*-i(ysE=8?H +znRD~cy{OR~j8;C(xq*GOWFKl~l2L9U&ZLpohT3n*o1b_2dE(-BeFv_3L1X3j$;-K& +zArfv5lgyWSU +z8e|p&*S#jwz@bKx`>XokF(Ob>5we}AbNDykssE?~WiOx9ftb;MGXreg3qGarw)QIKOrJJ$TewJqi5iUy +z4&y>DVB;z*7jDi?thr=zVMp;meNX*n?Tr00&a-l;SePA`;v$Dsn_!EAoBF6ISq5Wc +zx(*TY$&%AW`198M6U*=e@#XRyaI7CrR=}B`H@!ZM#vteqpX$5`$>>xCZ9tZX(1*m? +zBu_RIPZo`n8zqIUOusv8y*o(ozDm0sz^~j?LT~So79$8b~jSI +zRWD4msp;-)TBKg0Y*C3J8)>;gH(V!c8T74P-RZSoi`k4EAJ&LB>FY%i +zPiz#?U7%{sTHn4MpJh;ouGr~P5=kU}om?lomp~DZ{iAEW +z1H7tYPr~6yqW$%wTK`n%M55k&^lJNt#@>v?NlI`iXn-6)3|mh#B4IQUci0M)oa+4{ +zVU`CSI14<%@S=PlG$UiyVViTw +z`Lfw&Iz5@`cszNM-L_HyKFw6wwZ0Pbr!$BMZqS3aFYEB%6~8^QMF|gp*mH6bZ|LYq +zh>XgW7EE#0c!Ye*k20gmUJUJrc(GO92XhvDLsec;ic;df^e+80|BQSOsm4>nP3S6S +zqxIIc*LcPXnxnKHl&%*($L-YU+H{7+jfEWtUm|i-0;tL|u$J1`T{-QXbL@Y|y~OT7 +zaZj)Pwh&y}Tify4F-C1Rhuy!zszo#kq{b#}(A~)dh1A-$kFMx>>VY?8c?c1_xpB|y +z{e6MA({WM#GD`6EG}NLq>Gl3uH@Sv}m!GlUe)@YerROU`*9!}-o(Zn70a(L?nZt9m +zK;dF6|J`&C^OsJ2=Z$a6ed0&r$dpTblOpx;0n?w;n|5=W`9lHS4Bg`^tCh5kc=$U!t__0rq0W;xRSi +zGSRF}0U5q3USj?9kNo~!nKQvqu(yp@$Ok*?LGy}THWcBZH>#TMUUh4MfP%iJT_xZ2 +z?0PBQ?Cx{YNuagkt*gf4_ZVj~lq9@SG#EtfeIln4$P%UyANT=E(WVw{X65yvjZA)-%!wDpSwfallAQ)t*Eo +zbh6bze2UHh<~+a#*oIeN`x^T5dl!77Vx$~n{)Zb*Q4b?|X@PdO!Y(PEJfNU^aF3kk +zu3bsRHtCG7xWz$JN_rB +zWhS4FQM~%YWpQmgeG5Cx@0mCkyEh6O!+~(JDgz?6QpHr1!NJ3gA*NEy;9D+L@nj%M +zJ(xYk#0>`)$`$7~jleVdrwGcia)-TRND89V)D9l8Z>y8(oTBZX5FOd>hL>#D?KaaJ +z&UxJ&JhJAa9Nleqi+3ur8efbaGPC>cmz^EaKWTY7mQT53EQ19(!G@Fdb5Up|r=t-k#r~0!h7N<$-yU&s?0QFP^pLXbY%LM&Tp#k&ivx1MJS&&k +zqbL1M2-|jbNUOSTxi8W}dOn8@8m8qe%w8XlT^Y&hzK>XIExN7-v$;pEUjKsYo?9$$ +zM2ZM5cwD+2nb%_f_&luO`98Yjr}-wdiF+X1)gUn&seh5I)ONi!_ewqd{>zzx2YG49vp>%Om0u^Q6qdx8CU9mPYsqg&VN1S8 +zz?)?$TM(j3bDPVJ>X6!9n>wUy%yq0x8Q_p}FJ2^6LoCTGOTMEtp7@;1F%x+M_YZHH +zz;hp4myfHOZjXNj1Ko~j(|g)C3A1i> +zKCYK4O^uG%9!4ZQPCt3W{`HD){mFICC&=Lw5qg)VF+E7IkF#p)x}{}(khP`tKy%~O +zjg>>gvKS}zjwNi@l`#Lscru$Q38 +z*Xxe73OcWN9B;-M1Zc_ObkRH$&t8#cdRN{6;D#BTMvIQ$gH#y{vyN^};#*xqpV~~0 +z)S(q^7QWiK9BNDR^4nLsD5r2XN6qhx1tynFE$L~Xo9De9->w08Z@f_1FFEj(fOj;o +zmSkIN_dw6Vk>r+FFEKf7XBpcpBl|ldxvh4(WXWa@60u$wKgK-~+hc^aPlfs5li;+7T?D?hVI1#N%iPC) +zzw(=A*ag3}t7q0EJOHKE5ZU`~(J-cNTnPE*&(p0NG0&{s-?z?I%m}7j1a7GXbtS`l +z(8%oZGJZft*78z49)iO3Y7iNG-R1584jnnAM;m!h9O7RD#->KO+A!8SLI2_bU}klC +z=Rg}N%)}c)jo=P!MNbV28;DsF-$=LP-Zc8`t{k-lF~R>b^-NifO0O!+YGem3_w!p) +z2nX!##*!Gn*#hW`(=B1aYU1TbtB2^b>60{`F{8E>3YGXOPNKjDEC%EQ2K5?Ho1Nc1 +zf+t$;CYoiGR@uBDJ+v%*;B?-IKU64l?4^g;UhJ0(nMj~q2aH^l*zhsNytDDOw#|+$^HQ55+S1n=&ujMI8?wglY +zdUo>X&tH)&SGVT%vg#O@p;3)#yX*b6R40|_QPJAvxOcXMNn=Vc%vLhA<7qcgmtv9t +zlZwC8X45#2GUJ8GmM$>^|NWnkbw+@nxE;ZUdwRT<^OZ>##f>k1`!&u-8COax?++{2 +zTd>kDt#0+hvDW*h+w|jL2g)qQxyGtaeFMbzVrRNT)Yxt>HP?KQpgA3n27NXLU$5dqiyXtG%BZ($`SP$#z7iOT#iVKf!MM%_g13!d<)%ZVRa$ +z(Bt>?&AhUPLE~IW6Dw@YudL3`FP>UMH8s3K@C3P~5~NOWDY)mBkAoyQ7KOLuH0ooW +zLBK%Ah1hl$=TrXL{M5Z!@)2h~z?Ml9sMbS;xk&u0!j57r +z)N~76PeolL559>_K1$bfvkQW=F7u)U2iN~gP%aJ_XRMsBu6)wlD`rLaBMNq<%H{_N +z^&NbX=+<^*MZ2fVZX%)-p@ZcSOiNeS=gyVAOp;}D_F;$a+b0@8e=3t|?&J?Bm50;; +z*s!V>sZ0rx&6)>=uu=GhoRA$x{MiBi?BZ@c* +zF^vh5{#B|(AFB}S7k9dq#dcw!TDzBB>1uTHCx~fadU9k2Z{ib>5zQSl^&9VU;{}NQ +z7J0^a+TcL`{=A^!=RT%~>#dhJlS5o3Ll0L_gWNquz`C_VzUZbju%PJKf~yzCLX>_q +zaI0AQ0INK~`5dodrffT@r^4%B>f5kxov9L3Mxls9z$eRCSG*`m<&tl7J^T*!dGd1QSSjdBsbqG7$VWQ4*2s=!}ZnBUEKA>k2;3&3p=^ +ztX83Mb8$Z?702Z`t*ZB?IN6_+^ck-@EUCT3dWi+TOg)P-!lu8Z&6* +zHCDPmjQcM9fNa{0{P5)*6)q0vgC7ZF+V9hV4V@AiO8Hutr(VsS_LtW?&mMOzMyHz; +zmZBXg-0?}CEPc=%7<9D2Q$JFdlMLRjgXx@Ziq0bOc6mnW?Rk`Ao5elMBa0=K1(}7a +zV$W6ZNe2!__=+vMhyuHiBZvn!7>xn_BDPl2j7VJgnraPUS9Eu@QfKTh%6h5lA(O!~ +zm~sbS2pT=*Ein3M`eIT+%Mb}VUMkbWXN|$TBaa=-9Qrq|3q$Yb^oSjDnpGA_7DWh8 +ziqna-(+JSOAfb6q*UzJB34Edg@&Z8<8B=EVhOJ`q;QTJb6vuR<)Ell=r=cm91_{$= +zP;2WKydiTA02Ue5PmO$z>DcUD2Y9{s7J#=FbPOv-1*o71gsiWYqi^tXMOxV1@D +zJ?#-v%bG!x6MM4PRtM{ArB2s&XC3!)H?x!XhjgCihAk}jAkMDR4g`(^lPVPe#0xcQ +zPdJO;vrLDq#f(F)wyck=%5v%A4-#rTx^`4z2mLHvBR +zF!TgRo?}A@$HrEb%^(fSJP^v6Oc0-!l^ADNG1)?A;~CnY;-IJ!^l$NU-PmN>OsDykalyA1gyO_LODX`i-Q +ztu}Z?yE3P*JzySJ6i#eTySrVLy}9wQFCuRU-#ySCdkE^$es>|!^4|1nglzSBi8_lt +zb)M5KnI~C=TvxPrwcniUDD_mCNTR68Tn3_$4FH0aC{^9+{wiujdIZc3j#;Jm>VN93 +zoyE!;gU40Rommn^X!QjfsuBw8A2PRH%F(mPb)^%Z+-k2p7=9WKU=_1+)qLpKdhon@ +z#pnP%Oxe1Vq&V2+%D{H+F7jpJxb?05h1`qfF@h+YBv2eh-WPlxmQyU{I)qlHgM13q +z5a^R5&vZ5`t*ofH+{TB-9d?$z<9>0*8f6R#U}JIPQi&1?u1sZP-7HBVF@mu-_xk|% +zeo;;*&pzoMhkdX2s7pvnTJun*>?lu%t?S|NKWankG>+;w-{00_Liu2WK{5r~Kjp*0 +z3>}#oDGFXthX=p25-oE4#4^M0D5AZnzdgrJ2@(}f37UaR_d5I}zO998u(tgOq +z?dK7svQH=-YZEWUPwNx*Le?5o?az=@zC85%`2>f_#yG+WSO(s`2<#Q~pRlRJ2ZLZ$|H*s^yuI9YfbUetYk=R;>N~r-o+K;$ +z`0zMRn{0RlrA*styYz4b?PhQ2*@StSX|-l~fpFQaN355!58k91p)>l{u~`a_pu|Z_ +z2?Xj{rVQD3OY`3*AWGWNC)$#>T~mM7IH3?kxQ&b`M2I& +zO1GdEMlawW6u#k)4{y-XpKov!6}eYoC@NtL$Xa|NAb=5ZuYV+nnuZ_IsF)wcX) +z{eosh(&HBarv6_eqMEXtE_2ny2FfzZ;05_76;#5?&AC*L{3=ZC784p6F!tzrF5D8LlXR3kL&>VmO?nUD}ENja>0M3n*gUpyJGn`2+@;NO9C3@ +z6s>p#YFrwiC+49${56Vg3M~AzR|xl|P^E*p)Z(oP{)Q-}pk^|fehS#<$wDhyq|Wv> +z0y>tt-G`F(!Y^Dpi4r#<&LJ?1pm9e`tR1LBX$pn5GURsGHP? +zhmqookSjx3)In7RZ>ALRuzC1hfat*19ny$-Bj^YpjIrvi@QWQffZm!=dG202@c>1a9CGfPZ7H05X@xv$L!b=dOqc>KEZYXb5i8(> +zlUxUQJnpD1*7O~kEn%tEyd063RN{h}G}#`cTI`d4aLD{igyLnGZmcFyjjq4W3@FJw +z?zre43$ZEWbP&P1NT4i4XiO?Jk&Yx!LZiY!2GWCBm+JV0dJtLX#xGVa6ygvQtt~5m +zaXw`#!_N1Y!Tz5SrN4&{^$3Sbo3s$Ffm(`*)AWPU^O&C`j3>g{nYq^Xz}5F}@y*-< +z>@B%^L2e_VxMDZ`A#q5|+6-V%Lj;SyAEvs4N5c!UA~$K)`6U%D`LO`(seSF@5W +z{B&c2s}QP(l1=<wk$Ob@Cf?w&NSR<1&-R=F^Hf;sMr%+W^zH +zZfqK$=(uJM*FOw23KJSK29U+VJV=l<#r6zwE#AMN3$kh2I-wl@^TMNfsa=9;2bWz(p)B?UH*Zq^i^kVNhn7;@LR}Z{7L}g6o0j9J +z5Rv!!6KCz3V6Y>4XnpwCv>O18yzDt#NB>vFs|nsz%a$1DjY;e&5WR;MF^7EkELt>v<8|;94Ui@)(lV%UX2!_TKSKJtXU2#_a5A_kgeg{Zu2OZayWP@h +zYX5V;RPnmx{i!_RnOv>WlBnx7v|c2sN~^t8qinAHWmt!jGwl%H8+&BL$N+ih5>I$o +z4-QAtOiYwu$oV!3Vgy;4Dk1!qm-RV4h$7COxyldC#LNJ^iSLwacR(RP+&^MCFbByO +zVE!i1ZtK&sAt&F)oh{g)=F< +z7+P`V?l~ekArJ1cDW^m44d2YV9pb{WKA+3X!cCYmQ-4`!AXvttOi0Hm8itjx>j1A~YxyrIStuu&3y;G4{a=Hw5D6hml?vAG35ugJ>E +zu0)xF@@AszCi}%l-%{nDIdP?5Mim=qhQ5o0jw58A5r>kGDbkP%>vkI%!{#s}FZhWh +zGGPD_{MDev6(7!R^cJV*))b>80P3N|1b3G82m9MaaFup~hJ0S9FPAj8s)|1_rsm-m +ziI?}ba@!avG}Z?tB^oAWCMZ2bB$zlz&WtSNk}&)J`ZqCGc+S37N(ks4R932ptYp5C +zc#M1%J3sMk6roN}X@`8v$;r*iA7Dbvz$GlimsESr$W?(S88dP*vVa_SXZGc0@le|v +z9d_!3)AoQ?oE|+)!18{Q5L@9PFHX*)A?$f#zYZ-sYtI-NRtxY*tg`#^HTO;I>WO}y +zD1oy}zmfDIW``PKiYJN}g*Fp5yGiW&_M49e9HG+Wi=2sT&x@QvouSSPBe?u> +z37n=E9ptfx;SKu{_dlJ~XV@hhQjUXg4@d$rglv!<$A@H+7%;~eRv3FxgN&B|1M7d} +zVtc}->SH{cbkt{OXZ=(oNFhvfIv9?!L_wMq2oxa@rVd*b`#W{pvD9%{egAc+`m;`k +z7Ck?q*|qo8Z@cr3obx?({6scgUZgg*&F_l|pjflSU8nq9sCde`M*99pyBX_WVtNb& +zgYwz?8*#zAT)$TyAa7A%?y>Z +z*Gv)>Zn!^|%ZEAC`@PRg;L!X!Lq4+39@ZrSIzKJRjXyXo-SZ)1`&O?hy}ivv&qV(d +zQvPzy(eNgF!SuUP$Q|ubuFv-ep@pNly4P;31jKI3kwf76|FMw1l{fK7=N-XR)@LvDbMm*mlEMxC!P|dR9J +zcDw|`pqL5NT~XvMpJY0L9YeR2$X$9siZ9ys|o%?aCo#t~H%y+q|8x1#SD^rdDZy0=s0(L~#23S%0j +zBik0;aTsMG>k8`suAd6imCz@uKiS97h?}w-MPVEqXGELL^h5>$!=N-yo0-G*&=o#B +zD~DB{7JooTEQ)?iK>PW_I%Th5trWc;e!!sLilLk*?6{u-G?{0CLOcEYhV)K^WS*Sv +zQ(p%66}{JGF?<;?!lXhO5Olh3paD}>kf2D^_5Nw8G-rHy!emjuF;!;I7ZJvH2dNM*^ta6WXruF`5Pvay)e06wYWje6?5hyH-4)CB +zo=fj&B67*X{OXL5T^|dUB|GhiYN5^6L|gBADOC?#D7q0~!*PZZM5K@n*C44f+W6#z +ztP(1VHi1ViA3#AF2Z$L)i0-wD+TPc%6Hq_7zC)F3Gum~qw=6^@N$ +zb;Sf);&RB{T^{y;UOj$=U*0Ug^mf_pTSQi1us{JOQq1M-Zb-PzZ|-OC5=<)R|L>9f +z`TrdW13m)_D;qsNos_YSsgoH#3nM-2f6rhh +z2$6D(=xy!gA1C4PiwtX<8hz8Qvgh_peBqWYEHyqhPp-b +zf{%Tsgq*IV6p&Ba97VeTyf_$P)?R^r5s)}TqcMP20$5S_=d@8o{lU04U2y+|+|0=X +zjMW&~6j(fiIBkib)qHWZR!Z%SjYcv{=8^}dUcN{)ARu@{T=%|oYYwYN8*`+Lv~)vcGWVPXDH``%K#c~OW4Va +z512C@>H0lUZ>8AAwW-jC40GO^%?J5`6}3EaOMW| +zo8wmUOdzGmLH+94uNj=ZlKUI(0{t7q5@)*zN9;ShDJON@WVg-qwbte0ZX|4*u7$vz +z`O@uI$lsp79eA}rhmQo4YDitak9k&^T^W>niRm-jVp-GKym3ydB@&y`WpCHzi+^4w +zk;PqP|A`!nPaRJvzFmVWHf*&N-#3vd>K;BQcC0durD%^N&^-v2m1h=}Q4W64I~i_= +z><-L9d2ofPOR?;}0p-8=2sv3XZpC(HG?UpD6&sN)e*+#p@mIjT;&4`ef}`_TMF#GM +z3ii6V3;37mU`3;&g7Y{<20l*y)kAB!Sy`EtOQaKxuw!rQ++#Hl=47qUX7`fRWbT13 +z@XnS`V`;Sy*)Hz&u+HX2Gy_!XZ?|Xb*@tKAzxLO-6LSv)IT<~s#brLkJeFZ|W~S?& +z@ZmAIt)6a0R5&}uKZNh`bKLXe!}fwMD+XT7Wr?9ziv%5;kOx55p+`E_HU9Cf(CBqsDq8K+XtJ?7n#!xP|ju1JL%&a +z;_t0rJ2rOrFQTum4sBs)on%emAJz=dZf!UIrl-Qaz5-|_q;C@M*WCopgjfz5XAY2{ +zDf05)j!K6-p^gK9KpU9ND) +zhtZn5_13=bl9|BA?VRnCtFO&0Nj4_MhF{>?B#XNqoJkH{(yr|-a#*`EVI9>24?rJj +z(#1EoqUL4!Gr63O$CNrv)rW9Khs}I8-2o>j*d+#=4=7rqI?vqiaEDkxD||Z^o2Yz0 +z=5Rhy&(@G-WOdbctL-B53m4(Md55ZeGP`e-y9@eE@GoOX;FBh9M0WbBMiXbAq4p$n +z1#}19BETOERpU!%Fe^7^(A$t34x9)hPlrny<^dq5s=X<*PnY!Xd480MUEt{&8BOQlX3DZ% +zdT!TQs8!95^*l-M#2s9grMoM5oXA{q`gKcaa-(y_0CiXOh`H%yas_Ms~ZnT`|?;vo$j%Oq}}guo~IxXN>=cwYLC{WLFji +z%`oOMGmV+s%pNl{y%r<|@Gh=>vd!Bs-b}9vGppwCHcuWc)ZCzrLu(wZevm|g%tAzaoq>QpozvlDoZ0l9C2;GerZ%}t +zf}yX^q!J&aDkzYU3xiGO#)Bn#jd_K6fqAQb+`+GSvwo<4aPGwX(b2sr988@<2Q3_1 +zkP?oDyg^{O5N0DNy6L+-%#RFrdKK5R>}W5KtMy(H|3rUue>muCDMQ=I?X%w5-fWO` +z_q(kS?=Pccxbud$gK@RpmV=I$zva1Vn{N9_YDsu)=i8Y_AUqx?R;Ra@+25*7fpz_7bPsH=zz2^9M33ZmKZH8c +zGfI!>&Z(%{U8@kX6-Mq}#f+9A?8EiJ4W8h`8y>#Ur5jJ(9^Q@^xr5?slCQLk!vw}# +z1{m$xUdivQ!0pqLFL!SNavfPU`51TGJeGP4_}XmjGtdX3S16AV-tmVzV4cS@=^1dD +zFYlyGMh2I?La*6b#;||z-l>tbTunvKaR-uSs#>%5jrowSyh2@_&*h=Qp@Uf}yjX^c +ztFng3M^V=%YHcu8bl++7#aVyCrdhkb69EBkzg`Xc=M+hU7FfZ{3{R4onw0^IDJuu} +zu&wG^#sao%rFca_BHWlrrkeWHqWhq?^;(hYcJsXZTEKl$-xAF_s}?WX-`ooL?|D@m +z@-(!SI`bO$yncRd51L17YB74dl}tC7NpoFqU^$RI6|I{ieAX9%X@bk^ZDn2&H{S|1 +z!l%mS-c{#{7TZ?i>gw1;@^K2sMoVk$6Y2FOvyaJZtKWKhCSJo!^1b|qFYiy2n>4k9 +zr$MT5v7Yi+jr~}sv@9o1zl4n-TZKK)Iyg((ClfEbKzw +z-UJ<=ICK=5*}TskhvEqe2}MsM^=`lDePP}Yy4**p{GGNWe@~&TN_*O**16T5sPm?j +z&c2YpGY$p#nDj?+p^^L39c)n5Csa5(S{tD@|?{EDYw9W4otf8IFkWUO +z^s?GfDVkmp*F2Ku0&_5$AVLYlinQr-l&>ks)AGfg$C-T!!jNENA!{g3DdM0N?J9J +zVUy>HV!CFum&LD~O_~$vRp`6-(htOH${WNpt#)T3#U=VoE0Mm(VuJ3{fwJz_32F-@ +zGZn?|<{AENYa5+VmXZDjF1A0cm3J)3lyr{h$p>wtlGX4T3hwtR#)T$16^@s()|V=) +zo4!fASvn`q6ZDzmUw+6H6%BFbv9=ne#UN(t<+Rg9(+#tmS#`6_VaW-qHcQmSmWieo +ziM*P|wd8+-x+|1P8DICa!D<34z3(EZR_XO8)>*bUY*c`oT?~3>eHRVJuY5(7O-~VZ +zfQhuWq{XI+CfOxhpssaonyRK{<$A|r+PtI0DW6PxW2Mo#x3vo!XnSAPJ5Hl|mCh@+ +zjgn=P&TN|=w-UXs-i_BROWk6Vo{v=ef@9LY-rBmwefEM0UDC)!{VFAfR?V-U(%$p< +zH9h3CHT(m5hnIhwPxU(}&I^l=z1zOk=qOalXyia>^E+PhFbVh>zV8jgdW10WUQ@H0 +z2lK7KZD*hC+Ss!9o+e*4xgdG@>59Q)6r$~mzAUY)*^zzaa5@Nuc-F}VAAY}cYRm3C +z3#sOVEZ#=T_^o97O}3Yc<3EinACQ!{Pn(YHZrKcbb9X1dbUAy4Dp7h`ox3xUDT~A@ +zjQ5un2TZzDMK)vAm4rHP+5Yzk+3iE?x)#0n2|u%-Ce~Z%ltJOt&*W@WE3DkddNaOu{vWq={0vZ_i>+*<8!@zt@pX&2`({33R=mhm{<9mu)7OA> +zmnHs(mgw*WrVy2g-iQ3r|!D@Q~+;j)y#8eT0SI3u|ApvE%B5<`C!*A_neqlLVQaEw+!# +zC#zH9LG9RDvF0&RqK;9k(#{UovIlvhr{7lzkQ5Aq8^~~AFb=L`{86wJMbP8H%T%Lh +zbJoih6LIK)d5&ywW+uOjS;k@#3~Oh`3)}sUehrck{8l74;Hkj;U2oX{0#zsU+YDAR +z0N;K53a+J|%;=@hJ74>Ws5Ct{#VnK@zK|v(1bQNd7~x4oAUH-pAYdybRfiZxiY7FL +zxF#o@E^^dSgoq$oSw;2X;X&1rn<>pX1ij1FWj~mfU8MgbfPuhLG)yKNr98oVeibTz +z!q2uE$p*N*JgdH?USC#dw+mHUt6O1NQMxv*O`)pO(OPBWwGo67o4xg2AVSfj_=4G} +z1ArfE#$h15%PriZB&`mDUJ^<&R>S2Sg1-}xa3AOqK?x>Hbna}hE84(KzHmeW!!HDY +z(^2R@Vv7NrfvWZ0^oMXBi4X+vjpDE9b-K?Z2f-RE?5Lq5e#O|Bv3+!%GGgl22{Jej +z90=*yiWtl{5hFoFwPnWx6v)l~+)tchG(a8HjFpuajkO|~$%jUD7n8?eF&Uu1SpWVF +zr#3}0A`JPuY(6E|6^q&crQg&!?{LUi#8Kp4UOR}?*r|IfA-=G9xJ*0l+*uJN!j9g| +zIUOL5r9ev@8!{3si^?~y!zOnZl&?1M*FsZ8kJ@@?GbZE**KhJ5*dSu_r6R2@Vq~ln +zoE74F?zo|uB;za`Zn57BLfl_Y{iNiTBUJ*w^NA@6%-nrq)@ubgQ0@%NkC-AiW8EW0 +zgZG415QMjz$EcqHKl|xeW4fN6f?_~Vq8>9*%ag10tbUor=rcq3*(9cyd2+hh%NyEn +z-rSz%Qqx(nH{$sTOJ4#2iJ=e((wRq0hU9Hvu@5--U>xIv)`6&U?k+Wo-)ZpQ(c|K> +zyC=_>1-pXVA-S}k^7T1CKR82MLc3~lM{AZu6Zr^4%)g5w!|mq{i>LIw +z>cdwv{sxrx@cAX%BBnzMKBRkzhaVS^5y&0=R2q@_ +zd0}P3V>9Y$(lNagj4k|oHY-3y=(v}NniTTorH^na9f{Y8DB)nqF!uZo1h(Unw$FvL +z=H4hSI?weq6qJh!Q4^ttQe<8QdJqC5?^{Jh9#I#VqtZJoFCx{m(YDR@rhhqM2Br|b +zpGsz1Z!7jZJrDFXUZ6-RUBm)@jlMt^iZ&OA^mO}G2Qs6kKUThBc^!rW4{8HEn;H?x +zJE<9PU<3MNA`HiOGA0b*+sI0d1Zr$Y-)Q7G|C=QL&QH$7m>|)=?Mp7of52D-C4kC! +zYY)HJl+hlK&P7TZQcAfL-*8;~QdHAEuH(Hge}OT(DysK=m&#{cM`R+Z +zhm~@{P;hJ6CTjMLav!%&)s~i5h?ioR$^CK~sICbkF5!rfhETK=(1=NbM-P{GH!PzN +zjM{gkh20Og{o%MTW2ichUKakhMnfd=>7fh=31DxFIw+x5ErDt4{T!BHFP(hsm&!ib +zHz^J`ZZZ;1O!b`qGPo%_!4IO#jz32zv4SHhho1i>`=bj*S>xJWdx^>&pK_vQRH6+F +zUp@HJUBnucj&KWO!Ha1DvT0vd{i+nN=-AmsIN=gyKXMP5VtlRY{uPR>6*9A<~lvPsI!9LU=;iZ2|@-a8&Jq-;evoVTv^ +zdvr=&bvR;vy6RGVDdmLo%oRn+-7CkL>vcW&F-#s!XXp5&;QXZK>mRFD4$5oYTqSE~ +zax+uZ;;J_lt}Jt4TzNLiNLWgoR|G%j;&D#e7MF8%_i;rT4;DOdg#Ai6yT+xCp`t=-Ls_-TFdhONamA#0_%*Dj5< +zspVe49aSb_mrwysN%Wuhfw}je+_~c~gC{HUnFNjpLrv3}3+yV}(%EjusH{nxTLoF} +z!{xO}^)4rOR74(z2gKfkx3HNt~Ip^B-s{#EQ +zoI{^s@X--=_=_*|n%V9Y*W5U$Cl(w^=EE&NoxHQ_F&x}~Y`d*w1Az$_gPpJ5ZCmW +zeuh7aMdor-8eN{1s6@*7J4(3q1P7dDF8AK}hk?bxF5<+b=6vcTzp07SzS~PDDX)*A +zsa%$-k39BFX2nZF!dB{4&8_#1Uf7oMmkZ#c*rbcnpYxHp8}5yLCGMRNWx;c${e1E% +z`Bq6a;BM&n$#WZ~VMi%#r|>Gru<>-k +zm&^&}QJClv3>0scKTvj^&M{|_5d4;!5r-bz< +zVN6!9>3=_#VEvyROArA7%>U&WLMP^@#Q-C`$Rl515_5R3#3J#uES1rWx%nzMM^hXQ +z&I;uuNptmC5S8*T|F=)nt=XlIQi^PWZo3+A@)RDy0hx +zW$v^WySxt1K9BOwhDkieuw>#<+pw1&VZNnCO2de#7lu+JJ@U +z|1g_Q(n97!i0C)u{2+nN4|quM876`cjY(h>H7kr{R5gnXw-XeL-qMW;lT9HCVfhdp +z535P~<=aq`BFP3@&a|MVufI$|N?Rn_Qu8(a9?)n7H +zPlLD9I}5T8w6q#f!obO;P%ORmtt3W8?d0-_gnT8Yj~eyKFkET=f$8g4LwLgOPcl9J +z>-)RT8Us&n%Cdc(*4mo`%lnHCYU*`ejFjeDwTjVZIANwP^`z`e`tF2<U#)8D-!>a(Main`VSu)u25+?;Syg5GovwDSjZfNLdssF=;3&3e +z&u;I}CdXP=mz$S{7VG@MlN+{LQ{6**cP+Xk_-Z_pdSvMXVm!9{JVKv7Z_2mB-E77y +zTip1FMTlTbdXdsfNMy865}J4tBBws}UU|%drJu!btDGtR-kPE7Qz}eECUF?d3Pr<2LXv_&_3INDc8Z>#j`a7)>>8aFz9Tap};NI>51!0&*YhZ7DSxc%e!DKa1a%hxu`YBkP +zqopGfpT!aR4rC#C%-qhwohe1u`O;BxORjk6nz=B}!=4&aO(;Y#2IcOLFX;1clt?B; +zCP_%~6x4~4gqbBo>)^YhL&?7x&<~vN@b^VaA03YXVqA-sU?}r*hiY_bgD9BD>+{yi +z_~n4v)wDfLeUDuf$>A$sEqPzeE=w*e%3`ni%|cZJZ%Kr{AeaDVa7%pD@EO|(KH +z9P-Ra2&h4is(H@Al%g>Z0HaYN5rqRXbK{4Q0XLgHd9>!BSH3^5Z|D$C&#G9yYDvf4t(R_UsLGmHb#8+oGx1sD!W`D010rCWcOj5Oo;4v>jX6h8< +zMCfKW&sGFekVgnfbN0`VoQx?5HW1%)L#YhdZF<*(2a1;L-gmp>wXd{3Ys^ +z!Y)_4U?9Uh8@))&f{J+<{8iC}1(lTxA25{h*pvh!{&sL+ioQmpcQay0*7>F$@h-oh +zQ;TvM=kiZS9964+-R&Bvj!#XBHLl=O0zBXp9z)#gnBz?Q;=S4c=cRo17UHROf@OMs +zL;kv!#GAU7i>!fM&M)635u#2cOB+f0Y0YY3Mn#%SdD*>V169N#ORW{w(!58COK>QE +z1sSjt@}!k$zBxjoc8uPH8Ymk+c{(EcGq$VycD +zHjytPGoQ1jgTDL{DXJGe2k+XjMDDW~PrUW;d<&|XMu)$+rMfCmb6eoen|zJ0o%%2s +z>}52y$>Bo~!ErBy<09D^6zjpAw3E5HSVw;ez?&m?O5d2@ZCpmqI{9<5ZcKjCnDnVK +z2O|L|v7P!C3=O!LTcaSQ!Kh7I?UBRk&ui!~*^f@BNa8a*D<^c(eA1EcReMSpzHvx@ +zG5Lmkx5#T)9MHsp{~>SqO32>Ck0>*(#4G%IRh$VM4t+7as+Q%Ddz%{+eDU5WYVB3H +z(tG7`INn5W%O#G^sl=_P*3jegR0XjMmX%X@85HbAxSE)qAprR;2#PDwc{nOCV9BA|JE=n^;M_Voi21he{ +zpo^oKv4e}bqoEl+(B71R>PsFIF$e4qR5Jb-M>5C@i+*u}v8y8y +zgM_udsj=XHYN7ws5?@RB2bq5}s{9wkSM%E!y8{g@zWuZIf9ii&=l@op{EuZ2GYdQC +zKR5uh-=6PYOMU)|XA-_$j~y3Zwr$NS +z?VLZi_jh03G?$+Gc)u+p5Pm#4x_>G-XMafh$23&I?FAv3=jhD{xq0V>%nvOYA(=nL +z5b<_pZ2E|AA@sFg>@T6}EC~YAF7|J!+U~~2eA;{@O8Xx-#y({W0wOkJ@}$BGb49*| +ztx{Lh(;XbI8w3_%Mb0hJf2?l@M$v!Q$z9GBL! +z_}UJdScM1~ieYh`n3eYY35Fk#6j=q8Or*)ColY?*aka4}5ytHR9XA`>@aG`tn|8+= +z6VFWAZyxS5`{DZ(^e!4xPXLf;U|wAKg>nH7-=93M0ME%`hY+J!QEIJvRq(&OutJtWqV{9oa67a@qA=hz@h*<`3I^dq$Z>6 +zNtg0zDWQhb;-8s6>C~L}F?}m3A8-!K3DbNFV~TPI6NdT$w*YbR*}{@Uoe(8uV8DB0le?BA8v2#g)+MmHhkN +zfHMF}%3avZpSNL(Izu`x!dqXxf(XZsBS2qUHE%NY$KhErN%zJ6p*s@pBcpNc4HY~L +zUSA3klf+Z&cYRw+j8S;)pMu6@bpW(9^sEb1Ur;q0(lqphMt=Z{geMd}Mw+#86Uq$i +zLW79X7K@ckf6>U)Px$6~e}-p=ZcbV)J9YSL6pUDR7~Gb0@FNy)n{KbS*iw-senL*`r6MlB0ZL1wG~S;7dl3 +zr|*M`JB{xPBH2SJp^^s|i$P3Z5dR(;qTlPQVyNCI7IUz$mZ7G87I>UE<}!#brF-hw9EggW15ja>I)g}l|J +zRVL>9Uc7SMgIt#6)C=3o&^tIZ=QPeXDVPIFI&rsG5utcN1xlnWFM1zA(p0BZ(xbpn +z!&C?b=)v@zvp^m(AY`GEDlrz8Ymi~b@80!oBtPe6@N^E(KtFhs7MGe{$W9rRkG{}i +z2r%d(sv+VAuoXnnv#j5UL%am@EAqDZ)z+=bZVfmwEm9$J+LRN5Z$;eJt04HwtcNuk +z;Mznta<^)TI+~ucdq{yu+A5MJe^Y}m93jBxzzr}_z9B(Usn_OP==c1B^x21LhbBmU +z21TKzT}guh%jW1kbxo$zrHBfHg~w_wTY;MMLW~Wuh0GjCk;lCt4kA0CT499slCd$S +z!<^Y;vh#x=`&qF-A`-EKwFk{yo9lszn1xSE*m}C{P~$m?aLX~thgbzaTF04U2R7DG +z;E6nR(!?07>d}X1c!_g~$0sSEDK(^EnGq&8te{4I&lIKU8Uc=q7UP1g#VyZ=g*MLv +z$O8cs8dgw= +zu{@FiFhiy6E%}P`Dd7%!=D=0^TpReCNMoVveXg~`K6b?m(y5$leup1t{TIUa(h!-~ +ztfG8pil%Z&i{diQbJDgyGa=-9V@RNbB3EYI&nAT60$TbOiC+UoW5@k{nZg3@*yDbk +zRWfyCseMkHZHg3kz)MkU=4ULztu22;kBD+tXx@26GrgQ3QOjidIm=r=3_!G-=*1|) +z{rJ2#bb01EP~XB?A90JiACxnRkRI-V?5()s5;er24>ShX?VRA%mVVO2n^(PhN?4(B +zFQ%$c$A^oHkS5fQDdYIwyTTVSj4r{JIs{kktyl2NYPL7raWB!lH!#A0`9U29eY$ac +z$Z?92WN)=E8Oc_P79x +zJV}6aBhY4Txsi?jTcCxr^`?3nEp0{*8H%g2$T=&Rd8}DA17h7YuqR3lyWoX|=gX$< +zzR?>cHVX!4O^p)lgoQRR9=f0`{&m*GPp;nJjvQIm$b_<57tJBT}| +z_o1WS;cuP6Z!>hk +zcGg|s3fFS26`pdS6PRbI^2KdkT@JDKkR0L;khQ@c9()#$pkO5~*AIJ}I61psk8O_|I)pj@434;3rim6mw!TKYj;T_l$SF?3m2n5>H)P1?08#8 +zBUCpL_hqOKSMAuu!^`A?TC);G)k2xzW@gaI92Y3I%>XT%(+_=MD+(|wcDeq!4h;1x +z3tweha8bWj4FF4PPd8%UJ$zb1gGx)~Nr2xLQ))4+FrxBjV<7^?NTqz53LJ&F%pk?9 +zfJ5_d6mNkJ&gfJ>xtp6NxXlfm{_zP6-aImK#j2~GQV^U5Aq2CMa6=2w{u=!pC>|Y; +zb;lX`lTbMDDsXV0Juo$-_1pqcgp%MyGyISSjH)+m(9fPsdI%e2+i)1NV)i*@D|&0E +z+X!YT0FcR9omL)@IxK%FKoEz0eNT$qQ=QgpOPMUA=I`vusy`H1XYsVGMY%%c; +z4!bhko#w^X+c;FYQ1pIi!sEV6e!ku2E8xC{2}BJ-3BR;^AxYANw&9scq<*4isNY5| +zq@Y9{h*eu29zb9;b8zpyVsu_@irB*y*I_7(ITq>K#ZAVG+g5?{D?sk&=ir66DSuOo +z{nnq2s!fnF&;P@+g#4D&p`cE&g2Iw@&x_-5^_EXNWeb?u4CDA_Yg6HWur?$Ehd2Dz +zHM%8%&Ox1hIP82fEvc0R>$U1E1*%kkJ29JVVk*+~(Bi6DQz-M*jtUz=E%zq+vpT%I(`f+#bE0n? +z?t@?*Q-xj$;H-n|arp)=yNC>bCK#(=3@S}O#6$lIOHRbgCG6mB@>eZCpxmH*0y_y_ +zYj%vt(~>SjZys+OFIcTcOpo+%FMP9et~< +z;C@^feM>B>_*rtn6iAJPikU4C_gOHGgp>-p8MPQ_W-a +z`s1oFRkIUa%ZX6^Icg7z-FCX_n2e4nbP(l`p1-wuG`qX +z2N7Nu#y#sXy6L{J=1mu0fu~&fF}(ji%{k}JIBbB`Z4nnKJGoa?Ay!WWo>dC~K#rN8|oj!E=7`&Rm&AtQE6Q$s=9&e%EP_?XgX?&wsl%&gh`IgKa +zh1xMUy$oHlqwJw`V3;&sECe%9Lm_73BJ=$iBONXi0WW&7Xf3#=?09RKxkuM^faLF9&C_q~f(jC^UY +zE0rBK6*(>j84NVS2uuPE1*RA_%tRdO`yUZRWEV)sPMADb`ps)Wh(zL_2+2eDe7#O~ +z3i9;?O+5)lI-BiX94k}HW$ +zlS3kFMVkU>wb_(sFQbKYtKAP3dQv90T|;ZvaP^AVTG*n)IbwPMhh%R-#a7+&V{UQf&M-=ScfzY=&AiDe@@$jx`0ICMN??h&x_NGA +z%xxfs;h^#J5MhVWvv^m{c^mMa^?*qSyf+8XM{rTlBCs>xThPN}MmTwxR5g%v#$gcy +zf>8dVa2eoq>a>XO8i;HUT~Mnd&CrJxo*0}kzoSktXWY-NsE_u@^dr&fQzl({S2Bzn +zhhw}5Q{S!?#-&}RN;1?Jm^-^WF~LunK9gVEckH(&Q~J~WOpitpdf+_Ju1z+;h5~*J +zfPJMwWH}_lXNACLq;IM(tMBa&A#pYWC+@1{&)0r>{%sHeWC}?zxh{M1RzK!kpSUiY +zxYHr7mnDeTLYZQyow+_gko18zM9@u;GyGp`e`=hOS(IYAB!}cGIFW6GZlGiW^j-$q +z;IrMm(R|0(qn*wnuw2n2S>jDm&uAH~zVfXfg4~d?pzgXT_`l#A)I`#=Zi+tUW+%k@ +z5>kphhZ#gtB|v{B>VMpV(2qZV#qgun_dlfhh5MOcz@!GbZE)m0cu28>+b|`nJ=U{E +z;|%}iPL>13r;cRy{o$ui(iP|557P9tM;KR+9Mdq6qXvnd)lR!Y)e(kXZRwNiq26#% +ztZpnmFT5-GZ4G^YB%`cjqQh0;vbsOFbhcPT7*|l+qOm~VZvySxe%^3TbO60rW)gN0 +z?~rxIjvo$ANi`eoP_3AYM;=9pH;3Q`ApH^1vyfcy;MG@CV6pWE-A@M?tzRZlt`n;Zm +z7V2Cw>@G?;2AueH&DjAcR +z;9|=MGVs=;1id$tlfliI?75s=O<@?zoOc0+>uXqZ`QlC39aZ0gQv?!ll?ui{wM@vze(#poeqXHy-W< +zHD2z>W)HR$3=ds4o7?q3r{eqU(v3|`@`w0KT6FL4hk2KHtjp%Px>FZ19n%a`Gp%)q +zF?O5}TZ0WCw_Ws;Dz!)p?KPL%a^o(LTjGsxq?*uc{tI-Q-hAOjp=l$@zeV{i+OQtg +zmi}C)zG-QW&Ite^y5a>R$TcnA!eg#Gh+p|0qC)xld0v=r=)n2e=oJ9$uxBq?{;w0{ltCU +zmD*dzYgEHw!K*vu=qcbb$aGarfJ*8lnP3`w())^xhyT +zgp)r0o!(tzrGR<_$n^2e2g2i0mRgyR9PTTZMn9%wV4TQO$y|&}u$@Usj8MAiG~+#^ +zjDkcu-Im|^ep}q +z?N(6s1`nCt3276The~&yT}VSJ9rS$Eqb1m7?wd0%J&lV3>?@jWGGg@1%6A~-c+U5( +z-#T!VkhWdFFF+?DKEP^_Y%zafZtHon=mfTALtda=LV_g}E42GEeIWm0-v-}W7C>&3 +zUEoK4;y0IHixHxMq{MDPHJN63zRcD3hCQ)mdxMovRxAZEL}pDHpU?3O@K%VIwb=DK +zoa*okdduSNhPFa7mLhcTWwMRzas?6lfVQ;-S%et+7)3k0{hS~A#6aFk^c9)?JZBL+ +zK;G0wM}4l;AdmqXTcM(+E5AeA3J;gBN~XORf^&J +z$JG>c^#DZ2Nt3WIaC|&I+1l +zBrCxZL>rdkM{c=5-_KWC)FvJdib0;5L_s{o!KRzVK|IC4dOQk!LA~ivy#r;5rM^rP +zZ{GHvVA`K&9MXz#lt{or(frdrNhT3Y>kU9 +zWCw)n^=Bi!g0XO9O&HfT+Xb%8x(ZLmK*b02*{SD8@9I`SSnDxG{1;IFsgfN9NNLwTHV2P?96zm0(lLmTH9 +zw*>orvVHV@uf)=_lVb96nt8T+u6w?F8G@eTTev5YH;HL +z4C1XM%q5N`Oer|ywf{)gv2rp6DkdcOqFGA1N;*nP^lGZr`zj{ +zPEb7-@}$ki){z>kjowmK7oJJDvF~R;c((WR&FJb^H!w6Xe5_x&-5u^mQ;LZaC`FkM +z58;jRv+bzw)aDt^MJE!rpDm{uHWS?5(R1k9zNL5R%2f}O^5qseAGbO;1$OpE^*J!~ +zIlQWzJgz5Rt>2%3XIvBU`Rk1=U9Uaizj=Rfd<6=7K7?x4FV?T#3Atz$&hJ;ZlbpiG +zuCowt$H)mZS4e}JLI^&zZ?J1Sqz^hI@I7QhxLL0lxJ6yM_n?Q!3YWmi^Qa;zm2{VV +zMW0H1@UYR5^cXGjp6dKIbsl^;^yo2Z-2LQ0&O01+WeA^z>up8LbI8GVtp2CAb(o%a +z(fRDfu(K1BARA<=@_W{8$YZG%@6KrXs156wgS;C)HwhND8>-e2Mt#wybAzSuj +z!ll$HF4Rr5BNbhtW?7Mgx!~n%C$z`oL)YTk-0RXN@9+A@ht2!W=!ebV%XAO52i+A9 +z5unT^WnT0ls+Z&RYpM5?im%qEo%d8CFaM{Z;S``D3#Y8dJ&1?!`5voDw^57 +z>eF^NxY^5g4f@fiCg{i?LGYo!1S!eW_uJ>s2k0myQ7^{3Uw?Z4`aeSt_EFCslDRaWgPPkYYL|9NyI|a~(FD2=-lZJ#&2@5gBVtovE#in*qIo1o +zV!t_j+t1d;n&gM4SH%e54Q +zPYEdVO2;i5*Kn)i+%dGpeu(-MHpi9+A4zG-U@9Td6>%8>c^j3$>2gIa@=PoWG4}2N +zFB$Ydof(Sxr;SH$i;ws;C1}jhb!7FX)fzH4hCas8iU5=FjuGxF?#|rp{u>g*rP0`_ +zp{alRFAQAjJ(fF5L>`&=P4qu#eK)2EatM#a9*8_btbZZZN1mZHg<6|L*9|Z4mT1^C +zB|6o}zJxy1vNZ)+8_LyCtSEhX)YTC+WuE`)9Um1`r@Wu$SI2@g9$7|Sx8s^`F%`o4_(0Ok?vU6g-^;x%q1Z5T=$+Bu+WQeC6A +zVtM8?KhCZJz#Uag$voHhSkXGGKC^ycU+q;~VN4ndnxnX*S`)jR4!)!B6oWnjf8p+& +z>M{{q?zU6)>hCh%swG^GKBIVG<{q70VOkuEs^?4cbBI7Iq6{mu9n8T(k2g?#LxUSr +zeoF))lZRFOjb8peFMwKKk^?tam@<|&+?Yl|vf+FF0JWWDM_dlPf>l_NcJU8t39BDt +z3UMox#wBri%ZbXyDRD*cYO{%!i3?EW#KO;-o!am5?uqV^ZJIjen>m{mn`N6-o00Li +z#P=vp^)D%HA{%9Vxi)Gp(Xo*`Lxq +zk+#OR{`%|#Z@aI(-ta$MG88Xw9-lzHW4fpKw+U|uK9D|8K2v=9`1e2evahF}i9aAe +z<9r5@Zhfw+pHV)59|)gGKEvIng!OVyNN-{vsGq5X`@?25PL$TP$yqrR$DAGbPP1(8 +zSyefvgNLdoj!s3IWs~xUB@PR>^8lwLuJkU`Y^sgF4j65jh=!(o!tAwRZGPx=g=eA} +znC$h&^MfBFi1j|#WF4V;lj#fgPFe0x`%AaDwj^7WQ+wRcIxTbS{^=9$-rU_0TVrd_UL2)_@?zzN^FWnrC3Di)OXxv( +zc6&uxYHlp$)?PEftHv8RnE&re;#~b5lvsrsrdqpeSRpG-1I3$ZG>?;-hMi;VRMNUS +zv4eT+#3OqC_=j+UmXu3S3_B?qa~S>t5d?mHx(4y(aYm1Mo^Vw&ovdtWp4)xn(w3{kl&<=|9Oz^qg&kK%MwGX#$-)g4KeG^x?BY5Qjm%QVYBK^bZ5bXn#`>r)A(wc^B?0|g +zRyx2}6;DT}pj9JK^^9Iab3;{IA>g>_MT?wF&Rzq+Y*s!* +zkafl$n*^(7q&h<7Op}RYv(A!nAtd@SsLCIeNx0GVvU=?!7>VFb5|{bHY~gG(gPUmy +z<0W{!NTs!~d`p%YE6a9K2bU>IT#m1puKW8b;B}Ic5+Yi#%6iZgvZ;kX)9qEsNK_>!$)J8b!ZSJFe|W~UnJ +zk>j4gFznvrd%;NjhjM>Qv~zKBdoU6vl|foSO5YG{9WNKNp?NZZymh7wwAV}d+ZNZ@ +zuxammXeddKWgA`t2*P6-w((|@DBNGJk=R7t3svd?@n+x;gD5PGecWTrYH?9=U_65t +zicNjzr(O*!prXaSBVFWUsAi0t&sg;)0sD5e;cwHojbSC6$#wG-%Ar%^aNFRO!SQEB;uo +zB?c!3ui=E#c!HkaoT;N8(zjOOg_oG@GMhKMLqjr)vdJ~Kbq?H(xtFX0i#?9en9 +zv`W!(Vze?PH$Vb$=5fu*1VCRCqQ+x6*C1!iVMl9!`yiP6s(>V}UK`b&gTQ>SX6nZp +zyzo0g1dF%wI~pCjhss(y%9`u9xWh6n6fPa4_ +z>VYo9&BI9c+Y;NXa`uQ=&<;v8Ek+SlXDvqQ_d9%}JNdz?SqD+>mjGv_Dud6-W?g*Z +zTZnkSD$DPqztxDp7?QEk!jnRYr(NEIZVb0ssYwY(qzY)CV_-DZ(FZ{sboK?Sa+kKN +z_T-v>L6nB@8noaMF|evl6F})9JBf*c(R!4^xC*lGHv5$79 +znr_Y|;CD@zsW8Kdz`d|zPlcU1V<(tX+s^<}6@D`W_B)mYs(r!LDdbN0_nmM1bP!wq +zuLV(fhAfXjmxSg-FOsfNf(A%$nPK43lMKUyBaH`l?%+(}o62@ppX9}2o}zg&L$5~ +zDpE6mMjmT_RWp?;3h<0zgz}1B=4ckk74WY&3RLCXu37C@9E(2|3#X}h*2q-+O!Et1 +zNdJ$hg#Xu`rIhV|S$TL?|8+eA +zEm;gZ@Hb%AtjRX07AlbO47Xx!1^QtiS`zC6t97 +zb)!kN0&lPS;m*3jkjcf6X@x#*jW!MWmDqrmk|bTg*=ez+nnuve-Pep8Ya)~7JMQ?E +zpd+-#eraH-WtoCn#5V8O1850i`9~9A6zK2|JpkFCj7v<|Z+ekqO|>3PigS7$fHxo+*m})M&6XMx$0W_h8*I!aR>fA{knbFp +zsH@Hp3}u-~WEnY)N&5X`szTx+SCxs>X8K`PZBu#@O;HQZ5I^&(H=S;29f4q^BNbdg +z-`LsnME0K2+Ne-=&@9+=RlnSvbW`?$L`!jc7&@ZV{;53U3bs)!-R9IO?Dl4Sj(n$qv35j4C9aC6GmnTmb3kLjFIEc1No_1di5(8W +zdt#(H``wzIU)C!ANxl2|SK_g}M@AcN1qhm)3Xc!N`S!J5|JGus_;d>t{d$eFMbmW! +zxY9^h{}RyTVDIlrAc1=(^VUmncM!?m+Y!GuU$2BmG@GX%is7%*xILH5{=qSXHjHRq +zzlx_&GcfXxNFuVBuVrM5n*vRi%rMkzT^S3rlq7dB$;rzrb2+-)Fn?;}^28gOc6TZfIm*?=tr*w$hp__nFtNQI%Drs$Dp; +zmU2dJQz1k((-7fy3Ew*zyd6EvuX@zHyR5I8Vbc`CCcq|$NXQa8$^v;a3JP$nx?WLA +z_6Z-mA2KxJSK<4$SVIlj`pqhlIwC`AfkXqARkR8pdYP>$Ge}X6KvfQAh4+B4X~L(d +za?{PPv+@x>J~JTv`pmC(2btq}v`>KIN!oz`^hq0N8)TvNa>DZP?#kl0k-GLH2V1c% +z3%Cu1Ttx2$@7t1r7m!{~(G@ns8jh2~6zw=NOQO{pUgHPm6g3qBeN0G_m|{RyhlvjvFNYzz5qw`*jnqVvJ$00morsGN1<+!+$S--{a3X3oB%t(Hx!k{4QD0r#(Lh-n&JXuFn3 +z7Rw_>`;^H5=W7G@i8v+iHltBV?>+Yex-n)*^d)tVpc2o3X-;*pA4$KmU<@#v>I;yB +zcL@rf +zXuW~DM0xuB;cTIg=NNBi@KLeld5Y|3unmhXMsaB@8Po{b&agdw;4rO=HBQZ*MP_7X +zF{D*=yFJMZ`DYrkwK1eu?wo?Zyk%yi8WYgDlCm*0ed0@{#9lfN-eNBmrQv1^YRR&k +z9vaBvP!^OLvxiD){M(ao3b|2oCsjz$v;B(47*o#8(3|Fn-IIdq~MYwm3^5=iC43$k;og6O7`We6|3cz$$yjT1>A((MAmAs +zf{*0P>(i^F6-g#?4i*hysP0+FtOs9+onqdb-_zdP+|lGB_61xidJ=c0agR4%HG&;r +zoL;+kZX@$HZjxNwolJ9;&9S0)B1!j?Di;e4#EDJ5i!YDJr1NK(CaN$X4 +zmwou-#6+1jh9PrtzAE9mm7LgisX&~S+H!eA~DaD=PU7*pE0 +zNy0)yRWUEJU>v27wZEUIS+un$*}Ws&SLez=*|C;pP6_ued2uAk<287VFzmoW7gf2pHW_>%ES?M%%N04 +z)hdC3f5j|$m%^rvx;e? +z0CLI;of^{QnRinJfiWmm{8SOmCXp*EmWz95|Kv(kGy5l@5652($iWzjV4AsSP%JCF +z!#JZ_B)k>HFdXphoT+W+NUQ-!;a?YhfYevKaN3<#+xMaL@dMELngirKK*opt@B<1h +z7SPAI&$0{qug8p}*M8bYz*p__D{JAG>o8!(3RAMjm>K-vngH1F*D5QZZZRT6sm8|wkt&6`ueM!R|Lp~&*knkU&8%5Rd(X39C3>YK!5j!YKa*@u(==Ct+ +zdJ%6?Q~KX;`tzT-rMtF$dvR-esVM;3dURenb!beoyW2KH3ZKrQuNiJ4(7#l_WwvQX +z%+|3?eds21)n+}YV#e1pP9eSUA)29_N#X+}CAJOz?@1nIs7Y8y;BvoB83PQXfnjPR +zDU;q&wYf9ZP0zY^v*ov1qjQ(H9XC{RJVVXpPon*kM#Ec27s5yeM>l1sLGeZ=OHFro +zceYf;047`<^xwFxxYB{D&fJ&Sc?V4e5p?Iz#g>PWZX%xk_YL@flfWm-HiBhK!@N9{ +z2tFl6YsU0XN^j$czL`rCI+wZ6aSVn>QQJxbXv{s#zk`e|R +z=+*)!OBecvFQ9JB~AzPEtYZy_k9TG?G$eRSGbNJm4vv1pPA7oOOBdLWFq +zA}2?d-=uN6VbDL4_$>{3B3ZQ*u_}Oe2^G{|sirI5@oR#{n)v@VyQ6#r3BfXd=}Nd)B=bCa3B!^;<@|kUs1+ +zedo~7;LRe#B$(=)*vV}#z#`+72WFp6$u5J!e +z7ac)ZLxMLNhVDrBrVgSdqhX=%+Oqb4g+w-HEPMuoByRv-!^m0!Od|FIV)4bb0n{xx +zs9A&1KfPNHua-6rM&z%C$XU8C3dzC9nJZ3~rt{n2P?_<6Q?haD6w0@^JcW_|4cR;N +z|MWlL-Im6!H60Y +zd!B1E7(R>|!~BgCmZs0QPK|`$iz~37Win=TaGU>WH&IzZVxlg(f%2&k-4XOvIC-@|4LgJf57oG&Psam%*qT1_p^6k20GVBa3O{rj+VT +z#xk``29|?6Qt~G82E!|t!XQ;htYG) +zKW{{^Q$=Xnu{TeR-mWOF4n1UAi@6zUk$NL@2&d|NhMF;*5=JJLC5)moA=H&rc>QST +zu@%SZ4h0Sg5sCT^c8+rPzQx8xQ}-338cEJJ>jA?dQka0*wA}E!(i<7e2`GYQYGy@f +zuEbXZj0Wih%-k)1u9WO&b;S>hR|7@wG9*zFN>QTmHw|GR#G)c%T1wQ>&;zQTXaA0L +z&LQJh0+iUM$nS$kM>UWP7S!NpD-AZdK3YlCZ78UrN?hQHCzV~P;ME#HUrK{mlo$Ms +zg+ohE&p1c(F}7Ad&t8O6SlU(8I4@UBl5bkPRFol?i9&z2>#oT??a55!S#n=>=llUP +zgr8owV_>K@_(AX#Ds?9Gun%TKR;tQ`cGlg>Ak3k#3*jc`y9f}s8?k?#X@n)`RfMAu60^EpQjyF%f_qMp8C;_8Puo;imVP&Rj#)l5PBUZL^=_ +zBDkN?cF@SlPuygqDL5S8h5L*d=MC1r~id!=gh0+qUT|9o6% +z#r{L9NXZNL5&Pzs!oC&HHUd|+!NIb#^>+L9@=piI7ObN8YC5ONz7pNoJ&oc*YGaMB +zdB%}&R+o9`-t>Uh04ItmXKH*6SFK`9-{h>A&a$&CFv~#w<|pBfBtZwVB_mkF{>^oQ +zkbCMLizUY*ZEAu_sdL&MqGQq?s%NTkpgsn-@lhR6$-4iEG~U9q)d-2EHqo{R9LE6N +zCe2vQ(k+!|NT=?z_e=8k-$qv6TwCWvLl470@m(AdL0(bngVwEmP|Db}&q?xXP%fEb +zqhohPVo?#>!&%Lx>enEO@SMKWn;JOWz9Bhi5xvzN>0sN%Z|9LmJ1FNRl1L7K=TYbb1ET|ND0 +zOX4_-J!|@5=iLd|6XfUXzp*aCV<&XTvt}2ue#*95_YZ&wgwFEZI +zm*B+oA^zmY$WS;Ve<5m{rJH|UBW9{UG(Z~4>E<2q8w!DAgY^eS1m7mU%(M7}Z?Id0 +zdwfQ^8DVdVb8v=+pNuLmjSufvX!dOTT!TYGlYut`5ADKZXzBhv3k>eXHoZU{r9HDz +zh)vH-OecSq*Zw;llcQ?Cb1p`fFs-4+ZlFFnI0r=?x%Yg)H_p;E{`>|tEeXknwyJsk +z#T6IvT6Fj&ktFDKPi88N!pv8KOpnQpx1-ZYiRcrfGoRTHUuT +zID^^Xv@YqqK%Vtn(A*ovZnftVmkx3z1Lbe;$nJ{*x|P4+H*7V0;rM8ech8j}?75i5(?Upse!SpBbh&4Mu`RK%hg +z4|z0J^#aNedZ$dumzkkqfHc@_>8NuStl~+~_0kz02K-y|D^#v#kQJYtANv#;bGVrL +zr%p7bT-k3!PcA(#{D@gFy=WG_k{1`x9M&o*wPH5-&pf_x>J%=te9=sLPVPi(T_&a` +z<#~8T!sFngsO#=&e*4wk%*L~;k)>OE9aD$qD(e4r*uPm+=Zmi-s0M@ZD&~8(RKqEK +zA+~fW9yXTyY|(5lA%qB<@cUq;w8b%9!E+HRzIoh@-AR4&;0P{(o2PQ2|Kumuv9)oe +zV4*+Th6vm5`}Pzq>$p(J;{cQFwP56o@wI?~2%F%|{3Kb>cUbi^km^$$0@GSizl&g;BrL3?eSgSCV(KtYDvf772ER>4$Xb2)Atb +zMmOJ|DWFdqoLcG!UndagT{yH}Tv|M8fbQ1G;-f`TYIRZRa^U4t_+HEM7qHp#&q6@62vd2cmV+!szVW9^7yampFK&nuVgbuD1xSYn=e3JfZScm;gXrQgQXgcgwp)5yH6RXUOpD41qNe2(BmD@HqR27=t0tuZ +zoYK-fmU;2i!Yt7NDuTR7X-Yl=4gOOJ!Q;v%X`Qi5FIS1l{u?E7W#XBh&84Y&tLTAw +zw5_w<>#NEB8fA+h$<&R@fnEpd*io!z@sGzz^`eJ*QHfBcw4qo)q(s7_X;mU>a`O_S6Y$YCju9}(>z98 +z#&#>y1xH)+PBi-(dt4V4$x_B~!m>))g({wjX;OAIMq&oFy1#dhiIBC*bB%4@q?Och +zFVTF<6#b35AtTC@h}P=$){Q=m(c?|AG1r9jBEgMmR%B=bb<(|d#ZYIG{i9&9Ta${I +z4b!+*eWwpH_ZGi*8kUQ=4C5L5AkMveozVCP<@3}wsY9vsvTTkOfw!E>2weEOpc-4n +zEQiX=u;K^Lr=peS?~Nr+SVRuoTeFZ;B0( +zub66FZb^a4Xv(fz^(Bq)3?=6fH!Bp02wiu{`1Tr-C<;V_(J^z*znZ3R@0y|QQ>ODf +zt~y-rGu)fDl|Q(QW6)*Eo83>Zb!ZepU#jwdc@t^jeEnE7zE^uN!)pIomnQn#GkpPt`$Iw~-pK3V0Cz)ogus!j#H +zC6g_Fj1E0tIPJRI9yfAbn6^8NiXzRw#OO@f$971JQ7$ZETXM*|s;QG+YK<6giC;eE +zUZzgA5~#nr>0T9|r(Pyl-MgIjoi)i$K99Jcg(ltNYf!&cma}i~X_%n9HK3bEi*`~q +zY?a@Q|CUJNyEBMo#v72O+}qNdyG9FAAl_iL`C1~}tT~v5Pp3uA#i5NYopE9ieY3*p +zLPrgMg#DrOXzEO1`{w9qAnbXas8Vxn9)-l$Pa>Mh +zjxbDiy+I^+XZvwsqD*l4LsN6%BNSmnc~R(jnd9+%FTBEUQY7Ian4xtwU(CG7(wHle +zu{gW9I(ukYW>&g_VL>5cDm0C9azkqrHrA*H(^QpTqL!fv*A{m$Y-F+@$G}ffS+!)m +zOj&Miwrt#Pw{?#RT#!pLMX +z{Z2j=_NGBm(S+eup6*^%)U;hhRbf^Z+zQnNqr|U1+a!JJ+le^*`mUbbcCKNrxmyi9 +zx8CR(NUSwqySQ{Xc(0zWIi1W74dFMgOj)N!YGJJk&QJsarD0*gC$5p#T@4^^eqN!T +zp>Zgmp^?1O4(iSiT%u-b$F#JxC=p#8Je0Z&@j;=HSE{Y9taPBch&P;~w4xidRJ|_j +zTF9rN*sw^1ZkU**PPLi0)VAC4o-SU?fr+VQYv5G`CEj^m4L?1vnW9VQRK0$LvAi6K +zw-U~FZf;)Wq4C&hw)~{TukR;eVdbpk)^(;nPabJih4j6G!mK-%3Ljx^R#v7%n7n<+ +zzp0VVAefrIN1rBQy3B^kMpIQbvRIuw4qdZ=r>(TGsd}MFtq6YRzEXcIY(gLjB!MjX +zdoxiGp`M3}gWEybHo$eNqhF}4^aZSzUfcd6kYzCFTShZmnoAie1c1w?8;&7SDws&P +z7ch4~%+)wBQ=wRVS8a}%qu|46jk2aG>1HuVP&hT4I$J#}TD|uN5fqwLuN$w_o7YCA +zGJ8EA#*ZaH{z5{zr82bhvpC%3?;6#H)c4dFA|gsqWHPW#AsQ#Eg=syzQT*T$4ct^+ +zA|eHPxK=%2BGNOXmL`gD;=cP8ppq>nFx7($i$>*CSJZWg9^lmc664dNDogpe1Gd^q +z$Bq!*IQS_-RGSdT7HWAdxka0y>4jS@(?t1E`>zo0%>z*j{}X8{nqF5v0X!^fKzC!3bq{1N(Kdd! +z-yyFh=3-q%lCEl-Q&MZFExu2oSlJzNPb=VGR#Q?U(2v|Si!Y)OaAXnN8Be#3muq5j +zV$$c6{r8s4#7JfRT--dVzqVEj&9=~<+g#kHe%hz0?XrU3rN_g+)T;SV+P@hbt!JI#h`Z^xm?&r~8gv`X2 +z0->V|)lWLf*q{gCe9EX;1)BH@T_=`dPHvI8PFb>vImOyAeEd1SskTJr)THJ_^)$_{ +zqOA2GBrQiG96J3YtD9DV(p9~K3SULJ6%+3MbnrCHU6PKizlK17L`p@Mzh6 +zaRw%e%m33`*Cwy8JF|vBlSF~eDPQgbJV#Cw4RgPAxKfF02+(o|@d?cx7PDv27LYSm +za%&erXp%FZq5y16Fvrun@*%gi-^Z>B?o~*9P|mb!0rMVG@&o34ye;?Ne9ix#`F6j^ +zuK$yOsulOYA_u?2)rup)1x5}0ViD#=Dc@zyxP4az%*)UwSfReVjftg-)cfc4uCZfk +z63V%kmw`pMzj864XVELTq6elZ0->~{kj+5XOKnNkm3G+U1RWTn06x~814to#4+)e< +zc1ct(pKSX`;yT@;wpS@ArX)P}cm0M}^EVq+8Egfbp>z3! +z&y3+44wA_ffJPNqAipnb%OTNMBZMnx7V%d6EVW#=JDyiO6>1ALC8klDh{p(4aLF|j +zjIT(}NP^{alB^d>R&LhXPjR)x6Sw9hePw^5G4jM&Qmtv!z4Y=>Sl4y5=q`BXu)T<= +zo*#QnhT((&rWeqm;NF~ovUD8ZfN`nD3H-N<{QpVo{WXu%vHY^p{&$EV9WyQ4|CJ*6 +zYaUk=TBh|ZKYvcXc65oCX7|{UCc!r(fe6$kgdv27{xDYkcSeXk9~(u9)V>qU%>M}m+e!{VCEY@u@cv>G#m$KsCB2^WKt2yJ^NpV`yZHnib6leNw9Cw>IT +zlm=*;!|S7?XQ$C4cw14c7$#4k1#1IsFi5-n%~X4nZ`wu&8@>NH6CT}3}pT@S}! +z1{I9P+_>M%kSXqz;Fi^E(1#)-;HGdS7s@O|cZ0JMbph}PThymvQM|rZJA5`$*3Xup +zzX1G)zZFrBYQE*6&NEuulqh~1Kq@`$yJz3Mfsv-4JCH4OCW$)$(hA`I?%(900gM^1mUePzz@iTL2k0V~fw4c>M^hu@!RuRnJQtJwh$zyy{8-7B>w +zam`CT{@ncXcGGL%L#@IT%TM4?vC%gMq&6fp{XvI9Jvbi{@VLPjG4PL7vH=dB6Gp-G +zdj}-;YWol5gEu1F%;LK@!dQRhPYr5g*L8WkCV8-5deqif`Xg#{ZrWUAMtjB=Z20!< +z_ +z2G~%cG)n!>Sh*D@AJ_y5ym0|_IN0z=s4*Yor`j=hArn8;uIX661p?tlBLrjquzDj` +z_ashaUSv&PenXz5`7`1GlQgqHn1T?Do70>>;hOH??rT~oa%66(3}`M{d-y&4{iA0> +z4!*_%SVMp%=!(8aJANq~SQje8dn(9_kw4NzFc%#k)RjM#ixnT_m1|}Dang>!TydGF +zxte;5p5J%poOuEp7}6BeX9OPek28`{$IfSudEyOva>^@wLoyfTx$CdF4oOSd +zcKQbnuR{%7z7>f1waezSo75I9) +z+qY?la}L(iZ4xL(ussj_nU_87N>s6%1>iHU{5j6^A9bKZqp1SNpk5z^9H_(G`4J1) +zuaEDNs~;9#o>@-Frcj>(x1F1jug!ih{uin-;aDK1<{MtspxAO50+&%6n?J+;r#tchIYU|1K-Kw>+H6j{74m^5g+H8QIXATHr>^Oz*Sw)~k#eKgw+if_< +zgm~H%2KQFV4 +zzPxVI+{=DAo;ar@vRmKn&{ +z^B{4zf{VYdkuLRvo}v7#w8ro>Y?0bnrcnD)2;uVLa~%0-mEZde%?LVIgz_=XTYVo~ +zvaaLcdX)9>J-}`jbp0`RKRIAjePEvMc}9Pg@8>edK{5G$=jA+ZU#WTaDd6z`@Im2D +zdB&5%@+@-;x&bkwRlGDyM)T)B9BS?GQzh^od7&p +zoJKZz2AJAdRe=d{LbeU7hFsAC);Ygi9bRb%c*+TL%J@OH)2``%paL>qg)`N7>PJB} +zt-j@%Y43$+4Oxpgby0caS=5Yv@&xX7ku%s7`GJ1}T@QVRn4EFtwxh_t3$yKTW^gp! +z34}e3{smL8&{MSiy@O#y +z-Oh~>gLz +zz{}}lu_X2^=t8+ZzOZ8t{9^S%1~a2H47K~>y~Xf#a4j~fP1J&3!Ryh%^FI0G9k-&* +zz0!;7KeDqYbK7?^WS1%2j#&+Oi_0e}f1XYDbsqWy82wmbq+KA*^5DSN0cfxdhW25s +zH;oYfLVViSA;q!{-Ts27#kRbow*eAr@^6=`WW?7hqHa5^2|W*GBW~CSd?UOF?Gc$s +zS}WKJsw*}@R1D;x>6(kP{An|>21d``_Otq$$IrHYy +ziuKsUb6V(AI#B1Y^gm0%R-6&6A@9xrr<6U0?S|=PyNz!t?S~%ipKrJ4on=mIJMKE1 +zXz$mhHj{ZDEwINo+;fMSYTxf4g)JH|t`gZ_LY(pzabTo&cbMM6x?LCtyJk2MZk&UvpMb*y6t&hP=_k1}|EBi;=zPjo@>kkF +zEoBXn3_>FjZqdn7uY96(`BxIM#A%Fr6((Ted$UJ$i|Q2PGW4S{(4uPeE!R6;az6(f +z#uJM<6uHe;&0o!T%>&I#pOKvroLNk1Pw6o3m`ac6ApS&H#tj^~vhhhLGaOm6so>zF +zjuRZ|w~1+!*(Bq}<2smU>P>^2_%p1fon>BkF1lqnSO7}R600KcBlaWaBVs`WAkHHU +z6T2dGQlHniXNtuNCP<1c6KcpC%3I3o%e%{K%j?N|&6gKeBrFqFNwhPabr+7rI}=_> +ztminAo-Gx!Byfwr|7)XN%i?5jqig>t`UCiDXysG>-qN +z+?m?OwclRAXBXMaN`x&;*96#(r*XvHA1CGg<=7q6E7Pm8=Ng;~@^>_uXukorvE +zj6$m9m~2WTUE!``pJj}gO|p4{UK|gZD3$=V6hYM&!SxT(?dTr}Nr!2>>YF59aB)0x +zeC;G&BmSsZ-%l`v)J+P%C$WrpoU^1}3Q|8fIY0t;qFpKNTVysNX)%-E)1M}76Ma7> +zQyGdh0l#NnJrH`LG{uW!dtPH=#Ur^<5+&%-b!DrIGqnjGYgracRK8R1SqN@SGCc02d_Y`Hd};0BCq`_++Vlx!(7{e602Y&k0ZPIkdF19=7rZe?BpepAtI +z(K>-?dJklO*Vl0jW+--pQ1^^nfwY5GcAZ`k%=fHZ5x4!VXmPtkGWNJ!!M20gUopCa +zE_4B2b@3T_xfuJ2P5p&tp{ZseuVz6b^dLMzB=pc7cf&fcs6)7HaVrCn(G+TYZFV_U +zC75G3Ac!JG1%XUBzS-I8szm4jY}QmKKl +zAV3rnT~dCJ)l+&q1a24c75p1CWRLU{nVXnoZt2Ib?i1`@#yf_-6Ee+do;TlAUeN&DU^+47-Jam0v}@#Y;hT5RCV4;-P9!?b0%^v{3W3B +zD77Jh8oWb;oFyaXK)4zNg%N7qFDbGkHL32-5-?+wxNht}bDYI>XO^HDW7K*_mM9rh +z$F*&h{#xV5b>hc*N|otLv@{h)4{F#Cbs(1b6(%s1aZGi_&7n=T%FDy+Yx>QBR7TjA +z=pB(-)5!*cI%CRp6st*>#OdbiY*Q3Opai%K0>8LAKops>M +z?x9LyRL|P}Ysd(aLA4w^ORM1;$VE@iPRvZbjn9Fo874LsAP-tnTx4QsYy>wpHigMf +z>EqfL3I$1nrFMwJ^y_UCI}9W@y=;cT2)4Ew8>? +zp00VIQdQlVU0v)fEo!Rrx{EKuo}ljVd<##isBXP4uc&EreoDVs*6z6u#zxf7Z=4n03tAgXXC-u0zvyySN-l=m~xh8pWyxMwM{4U91 +zv%OtA`L;iOL)G>?J5tg1`t<;BdqQn{pKQHs|LoS_dOx-dh;VbikG)ZzcqTh=Pq5`2 +zJu>CY*iW0Voit?r{1~!Xw{(~u1_hx;lA>kvFw(G?h&n493%jeI?&hJQq)If&Mi2cGtqUu;LguSv+das_l&AyyBOTiYiCnt1FXKB#FUgKVcVsWqiCnV( +zz5@G6jP2v2;bux>;im{LBTr-%%2S_FYH7AK7uKVlY*<5M9AF&4jEja`@d*n?g*vTk +zO>KmE5yFEvr9`eu^WjEnIth1#ORyJc4rK;OCoArkon>+sbr!M?pJgV+ZHo;nc9gUC +zF|{wm6N~CbsunA76f2M<$9Z{j*miYteeJG0X(^YMOEN6AnsYi#aHN@_=nxRXtWaGy +z(s1Ccy@V!&M3d=k^{@n2QH4E@ecD~EFWH|IlO26|WOZgTL7nv0F_tyjTai(BMN81p +zL!s|oK2(ur+_#InN*n>UE$m`km1}h5A|NAlH6s=~v$_b1biBOB@HvKcI=i<`tf?U# +zq#uz*Z&?R4DR4Low;h%GaiO1WRN;p+wq#I|>qB10xO#j56OXbfGdHPZ209#Kgc#3~ +zsZ5NDwL!7aXQFQJ)i%4c#_z3A`WLWU$ij3>52TJaEyH(a#oR0s>e)9wi$GT;RU_`e +zSl*RVtrK3v^vYRdb%6$d0dz7@RWUFnZ3J0ElOwock!6P%7t&nk4`@y)qf;Q^N>Y#L +zH3%E#O=d|~FI{wO$_Bw@RTL*u%+MUCpi0m$elF}7AL_GkrSv{g+%{f3Nu46GtXy7CmBGC$c80sXQKFxvXE3e? +ztwe`0AV{OWzp1VNEo*(A7=N3itZFZnA{|pqsvfGjZdQd=k=Wp$IsIcVoAQH%OH|&i +zN1l;IFb~SDL%Zwt$D_Cj8a+AQZ0&K)Vg(fDlwzp0!P%-zf?7+XZF%8HN9icOs=CSJ +zEa0)PX^JQbAj=gCurR)iM}@M0Spp1*>hf`a~X^?KB2{H)-tORX*aQ +zN-U$I47n2$A+tVus622zBLBb$n{9NQ5@?3i*IF=V;gLgC*jcdHeE_T%U)?(Zm%q*- +z((}^ua|s3aV=b&3!gAF}N1SpfVe}G-C`~Vz-R-1sq4yAS#$olMi3x&hgyMWLBI^+M +z*xubkGc1RgE~JHswtp#toxto$5LZn-R^wvM*Z_dG7oT)n3g7~RPq(xV>$tco0yj&;43L+3(QV(>Z52AChW!StO +zH7{M+p5#Wf3)?M13MS@=@Ry1gsozUC_FK2RnJRZ7{~J~w!@M(PD_XR8Wc=8 +z#_1Gy$q|j}#)V)rkHthFoKZ@g;qMCvu3D$#GVp_sZ}Vi>gIU$F(qQW}+v_)VgIbWZ +zxz5l6BZxwk#IYFsVfunUpF|ulTF#ek=Bjk^GUTn%TS9LzbwW?*YVcm^PkzaH= +zrE|7;(ip$TBq7}lCE`}79eJp+uPM_fwKP2Lt2KDjP5VRdoAk2-{0Jp8T;|~wlk2hHuSv@DKh?HhbMX08( +zP=b=-2%h;4XmS{y>V*(n<-Z;{)o1=oBa4*lgsMt$Nplk~b{48`?L}{hu~h1)T*dOY +zcsyvRs>1HUs~=R^{HRg-GFQ1^CcTi%QeIXI1ev6};ve(|q9dK@%&L`a{(@K||7)8zkG=(*w(}XZ#~Y2p#zs#NbxCJEd#z +z`}`+6F<$r=9V-j1uqXD+~8Mq*V{2dJ}-9ALtgcEzI4FV{1}-e)4wbXhg}Dn2S(=>@~I=Ik{J>H73E; +z1#Up&>4Z|gz2qb$Tj%q$YXomJKu#9$sx?F4mV7&yC&VWXy%6OlXF;u@Fz)z+;Ikw4 +zgmtv9)R|7w7hM)2Wk5V}wW~IZyLb5s>--I!0CzwJ)IJN2!1kv>PPt}a=QbHP=;fBr +zkTOl!(-4s@faMs_9b`+=XV^m%(mS{gY}NXi?j!I^0E2=mse2aVi|iLeljT$9Q}E;a +zqmWnzB(KXk&4x-10(Wf=p$VYUhq1WK_1cEYyzg}xydgl+zD)%RrZaWe-3` +z*i@KJIrOJ7;}YK{-o+H;Y4+pnH%=%s%ECt2hBTR2qH3OlYnGwYL~G_bo8{B^2lgl8 +z`{r|tR0?dI6M`rm;AnR!sm3qkF8Ljgb9_g7*8~?UnBbO4eA*Y6q7I%zj4(h9bo(;Ck8i7}E#)7=6{c;H~3Gy$N;`Z?a3e)^GVJN1w(m$o!WfA~5LE`o6gsy1F2! +zF+nmH{xZikKnHs7QqTU^CzGIkvQ+vnz(uKt~R7l5p!0(cZ5Z#{7=7$N#brajoKz)qUH$F@;|KcQqE- +zaRBwu`yM0<0P$4m)|XM|0p~5XFfJ^ey^$w2y3VdLIe4zb`$72@Vl^oHmOawsm-=cC +z<^FTQ2s1oK+?v8A)g7#LXm7?{AwZoXAEp`9eT#N!Xh1{|8LVZA$|=xX4=0MjiBClo +zb*Stk<^u9ry7kY>V1sF(Q1yp`OJp?Qkm`r~9d7icr{DN-lH^5H?ldK(;H5b?F!Gi( +zx(AG47-g0qIq=(+VBLasm>J03jZC=u&X(*Afa{n%ah^6F5YY^fvarChei<|ubFm|% +z`Nswzt?W-0Oz*fHoWjp9v-L0Ih&R;w%C|}G3@Gg;&|gQQ?D&>Hso4s>oss|(U|zah +zL2fVJzO_04mOenCXjQ&lAb1FGVeUeHryYOv30`kzGD9A0ai#~{Sm93gIRAI^>H|Ug +zk>c*|w%Eer?!{q&!s70_ +zxN9jCC~k|pyA*f0oZRH(p8RuiCo`F3W=XyN?-(^Idgz&s03M +zF4$GIuRl*umjxD|E3HBmPETjr+}qb*~g7X4+o*E@EH?5Ae)f)iZ3zEw=)UKBv`i}QgHW==_@(XyN5?3kkC{+ +z8e6sFE}|gH;rZu9Ym@=pRSmXuvGej;E@~EWOw0kumV#ImrKf5E6O?u_vb@l?RHHTx +zjI*vXqb&F1j)00@d#n=<2(cj2Q4a+M3`rASHG`9ehH*;g`JshWt?k+uDb4L{an`sM +zM%qeRjA;(tUK^JvU-(sA0QD5Gjpl|27vz(;U{f~gbanOcn|@`HBVC69Y*P%r-`s{7^_$=tuHQQsoire&1l;v-yyR0{FH<>v$-d=q0sXsz6Q_L;}z`HneVgP +zMEIFAb5*;Qm{OBP_HxbHgE08??sjwg?3&3jw=xO>8?{|<{B0ry9_d}S|GP}O9{bSE +z$)6IPV`qRr{eew3nxsQy5-FWJNMyN0b5k5?{B3*&z16q~qGcq`W$W&Dxq1Va74m3F +z_Uhd)5=);fV;yqV*;%nom3!V4(!Q7NGHi|YZ-d1aFr`}wN&xB@u*YQexV!GLe3Ttl +zeDr;Aw_SQ2CB#EyBP;@;4Ehx~fq*^SR?(ApVa+W$^)8Ae+gP<DN`8{+#>+e63Tk1&H~^V +z2rg{YX_JLb-;W0`BGYJ2Gx}P^;71BRtFz@kpnXToRT^G?>--^sJ()9<8jqWh(?Mld +zTs(Mj7;j{9pgV)Fn|6YFNQSv$zPaXPLjs&{uf6Jgu}wOV@|1}dI=iw|Cs}8|blu1I +zkQ`ml+xEG*Q+{5R%}tR6w2AOSsQdne|08#^GrFdj^a=%xOptDg@K-P+#_Yz)Ml@~u +zgcX2DkLou8&f6~9cbpQ*I3Q`169D1SYX*`HfVO7|vB|MEE-;R$ZO^BPFKvmX&=9SF +zc(z425AxW`!Eh?;M@v?vJ>{DrmAk23jNcVepC?*R<7|{Ia9-+j|LSz+#{Y4-7pED3FNum~$&ma9@~ya+T98pW)pdXMbHHes=kcA3n(`>nA3 +zQawK*5lS}97>jo*D`RHTCBipBZ*9FV($$!gvlcEMmN{1(%9rOlAi{@fQJ<^_KtB1$ +za&pV4lP)j}_$$^jJ$;nN?BD*4niFfI;!NR;(NEX_^)5E5FuVuf8rQGvw{(<=wJ49N +z06AgiUM26Sxrru5PQd%7z*uGPx6f+BIRF`$gbezKSPQz`uoUj^l7yUT3=(cep0F3* +zteByZ6IskZx8_A<$f;M8;OVB5G^dJPQTEM^f5Uk(N$Hv1p)by-7Zuwogguf+HTo$& +zGRN6fWXBi7E2^GX3AKN<##-%kO9sf?&tmg>$m~O|#`IX2z*!SZ7ghN2PRt`zM%v|w +z&I^SIo3I_h?v4^7a{+>5dUSn<83R(LO>2TNv;jW)Qb8YZ{~t=IUx@>MLAA{*=!#A0eo(SinMC +z;!O?t)-8LX{X|O3_P2C189&`#MnL_ar}_sEBLNk`DZ>Drw=b$#*nWOn?3Jh|rRexv +z(u760{KyiP+mVw5@fph)9JA4#$Grou#5mtvdo@YW`<6)#d$VKwi!$!rd>Z%cEY5>H +zZyujIM?+1up&_7FcN%FG<%C@26a4t5F<+@6ubgT;%gi|QTS>s3?S+}$tSrDR<;R_v +z$oLhdi(S;1S4-|6uVTae28lUD(!N+H-O5?rk0bCXYBo{^6Tuf6P5LR5DG5Gms)QjA +zV>PEiGRi}!8Pm3LV_Inoqn!sa&wO^znI{Q6437VPGHerIQ=+Vj*vl@4dw1j+^}wX +zCJ@I`+3R*VXMth_8H%e;WGE?#WI$FKU9T-KnLlD2NE9Yw$%ZsfHbwN9*0OY&HqAaZ +z37iMUF&a>x$rNkMP!A1w%Rn9G;Q;TF6o>W)-c?`9ce>vRib97%PQLa7Dxat|-YpUS +zaf*N#uWbo +zEw}_22BdDn6<`+SUR$&HJTcAB?@vt7l*#jz4^?8{Al(GwZX199!Rs+d)K#cDT9~IG +z(=2p;|An6YAkV5SXjx@Uss@;3r~k2oU-z9N8r#HgQJHWW%#RfXP~}%!HDa6y`FPVj +zxY$gX9cp22F7$|X|Hz6s*Wi-CJxXDQu5AMdS!CY*(F?L}^a+HLq^1a{vi;=j6~a41 +z-dxl1=jroujLj`>&*)PqG{;e5o6wx{s3d|Y?5gJrIx=)m)(&J22-0O6K0ZD^ATM1H +zTkg~eOV4U(9UaINzz5Poz)0aNmu06UE3Fo!EmoWERSFpg;jPCj=0Kft>yeRkWkWG< +z=D12pPnz${5sPR8kx%IRst07uH30JL(78}$`r6;DRP*WWpb}boChso_s0yeofudo- +zNOrBu%=8V^6~~T +zq%Fh4S?9DCBK~BV8=3pVnMdkyf8!QFXph;OfnQzXc$RC_e+|fFjOoQg0+Bz&<+S6q +zy}BVJ5GDvl5(8M^ +zk)?RTBYwI;FTWYhx%IvLgS+NyDMshPNzUoybrkF6DqA1&(v8;L{3r<`_HH~bsC79pFqcX5b*}#sJ +z@ewt7OGse9us^H?!u$9k_=CQ59)8G&vU<-BOT1H;5X=Pqs=d)T{Z7am*|HEL#L#uV +zr3=K)!hB%g8!Ii7dTE-?CBmf8SeGWsFZO2lYL)Nz?H7#Pd}SKk7fxNkkh!FP;`eH9 +z;0VtmztB7AxbDTEOM4pi9`3N%Rm+ZQ2X`ii5dB=*U&Lb7w6sB*2(8&b?qTJCp5DK0 +zWVH%A80?O`Ksl?DufrB~XNaUIXmvDv^(vV0C<=TbR%)Nl1fFD00jJGDU;;6#mJw8w +z8P>?uQBn75s!#V+-36j6?I00Ln~OTXn+BP7gU@V}z;3t0x2Z8j|7645 +zqC)F+2p5?lh6J4uYtv6qOf|WD2}E~EO>*jQ`M_}<*Af0A8wKg>>mhnL?H3dp;W&b` +zWY*?7R-0e77~2cUV`@Qh^*lez=A9pYB6U8gjSVca_`9y3Tq#iLmdSR1;^7(9ZnFB) +zlDO5`cr|6??Ul9Ky4I4;vy`dfIWIBoJY%2XG?xCzwAmymWX*WO@*(3N>|1URn_BA> +z`!}Cl2@ZfyNxpcRF)?AK43wS8di_o{SHkT0Jljc$?IKxSdpJ^GmLE_>)%2$`W1*xU +z2zOvl8g81A09`45BoWog$P5iGS%-tT{_^1|HGUiJi^XFl-LeYLB2>t4D}iVBpE8HW +z#yYW<2K}S+Y}jWvQZ=TOdG|ZvHTy7PC5?RS +z7N%SBT|pFEHa&udE{}8>cBh~OPfF+jWe<6*B{Kc1 +zS9i|-K4DAEbDJ!Qg;{n3EV)6E~Z*s2GtUv@hk6NDB8rE;+WGmf;C$ROh +z9DD79t=sC$o+ewPZny0*()T?bU1#yNVng~Oq6-uAYgN@)AS6qiZoQQqP3a8jmOES2 +zQdsGkJm7(XZ#%=ORCe%HxE`k-CCN;)8cXApE`gq=-U;g}@pWu2$F=d1mWf9JHlhjv +zGFMSp%0Cwi$)Qqg0VFr=MbVo$a^!rrZ{Tf2HNxn5oF$7_gPn10v)=)t?6gJsHM$r) +z#3{Lum3j_~Tg7KUIpFy64F0(MEosoVwyiq6Gpy;?a0Q(V-8CO4i|}w_HfhqBlPmKT +znCOn%Zz|;KbiwP81|UPm#BG&EII$if16-Z;va6y8o>aR2>=mcGSX +zXTM+EC8mZGA-ibAipRmIGS-l8;^<1BDdv1d*P&_Zfh%ocJ$Sj&d +zLW7B-uMcu4eqFFSH;fQeRK$elRQuK=+D^66@z2=(#AL#nm%0v&n>i8)Z)#$$b*E#Z +zBU-g_(`|lhdKGz>I +zCRbvd&Z(L?&PT~9?8|)A{JR{3y=eE9(`2yrXFG~!ccb&_ea*)0KJK1QN;w0~m+Rt$ +z$B<9S1>_+`!a!zqP!Asc!Cli$&!OcRssqd3lkl-L8EF6fC3tWYjwFG)1V(P!-EUsr +zfhA)SQnnD~H6OPk(qI9i+9xh9MwvYE2znBH%*3?e*3Kj3zX;rIB@=&j+&r=3#%OWr-;LekI=lm@p(+EA!EYxXu^ +z!li>4o$A$|s*aa?ySE&o6j9^049XWstX17KM@kHkqjbqA=D0#=5 +zA1ZN<6&OYrVF;Dm=S@b%8(*9soPHdNKlr{b+T%7G)(gWn+I^dTW0d*f>rYe#e!bUl +zkmy9M+|%m9e`09PGeXe1gsnyXFPkw)SMeIk!aBq?%S9*4;m5VD?zk_X-yMA}ZT?Vm +zJ&R!1=hpEgg`ezjH2ZG1YGODJ5r6l>9Zf*KzD=EMk?Qze(^Y&+MfUI?gr^XO(fu%F +z0nvJ+yp8q_`85@vtbPfGm!0R<#^go@;+|^a#*tWQ<)9|Gj$Jsye0f_wDrEe>fhR`nmF7U5TYAz_3UR +z$zsH?1OZFkjOouGWO%OP8ZK)+H=w>$ojt0nn4rgVzsoH0mxqT>(YROCB|3(lxH4*P87DnzA4UNivef15Je +ze87sH+YJddRMd4aATAX+kVWmlqM_bI7Rnl%3+LlE3c2yrgPr)i|owjRNC7MVk^BI%lPQz!Gw088NjRRcTl&(>|>@2JjT*3Uv(7S$uvH{$`R&ie}vidC_Z +zST^P-poT&N>9oVLG1;_WL)~EU!(NY3`lc8}S9RkM5Sw33YnjqA{i#~PJY9%x!B!o8 +zg|E|9=_FXyeFOLMc%xJaR?%&Gh~VC7kNbAa`gj?l^|*tRU1c9bpl_KwSRs|@-%xF> +z)9?^54C-09kbtrKp&>{F6-Aa8{T_?yj +znt@HME!Jh^&EjP@z!pn7Y0=H~6w@XIJk*VtggW1d+Gc~hkg^JM9c|kIud>TmI?gnm +z=<^yct9M;>E+UTD`*!nZ+R7NB94_+H9khoV0g5EDvnPh{lE9`sP;Ir~iv4;L_wojv=^S=zTfn%iVMOMIzV%l0Slg +z2g^DBp~soj60wNYYTLg{ig!5HH93Au@9b@dPg164ITRcr&GX4!Gm;h2z2{73Zt!oi +zDW73|vhffnW6P?3FqEZh?85~Ar@*tF5tG*H%bC@)_bp8Z>)I1;bs#L?=L@~NFS|h8 +z!5j%~^~@a1BRU7&54P2^mu?ik-lu8P9gbRY25m%(ge)CpQfDPIgqw+T8)}=LFcSM6 +zh)#RQS=x|WQY*<%0mwA3(X_WJgH7WT>A(j@2O0aV%d&~zi--11fX0T>nj+1s#MO8$ +z3Q>m$&xesoLKD9>!)TDvQW8vjO0&6Al?z@n`shtULhZ(-tU73YrU$z{9{kZfL{%;Y +z6d~7dFidoVk*q#j9m|_ML_duN#H{Xh!z{i(2}<$l2n6O^Q0n;2+y!?&S!NEEF>zl* +z+J3mU+{_}&JltnGFg?}QUm6}H`ME77Ydw0)IG&L7JicuMk+80Q%zX(FO@GRlp>VrV +z;ijzkXt@y5bNA@l@t|^hV84t3s@K}8^3bRQefBNx{!V)D{_UXdr=#g<=d?Zr%hqnL +z)(Cmx@|PB?hH=m)AHNl!)QT_1#S>QqJWnzj29a24{BUpS_oDOg;|?$Tvg~f)x0(R! +zs{K`oG>j#^lEC?S=I48oiwvs6g%_MAU)ASh)c4MDKgc|%(c3V_CVrzoCJ={I5dT&h +zUynt)^8gKMV|Epzx94wB0^fHgj|H$NvXgp;87pN)?us$L`^<$Ny5Sr8KD$G4i*2OY +zkiah~T&buZ3DL`^A>7B`MbV*L+hZ4M*ru!~l1&2UQ&N)%)*Ky=0NKqHSUfEWC&t%H +zT;2vF7MaYu+d05Cn%J@w9>;D+KVCkbdRUmu(*i!c+CKAo@1T5DIgc1N9DG^EPYNgd +zo_qCNRsL~ri2pCS_ion8#8JhSy7zY2_P(p3r>L5l8Y%aHS(5DSCM2(%P)R4 +z=IeUT=l3cE+45O4>Z_xAy4#M?ymrzeB5sHTe5vOp_gFoEgC1F+6f1u=YT +zZU?*;U+>aiK~5HY{7bi`Z}A{~HHG;n=*;tA8&q(9TV0o1+WU33fyaZyw*u_snpxbd +zwjBCichP6M!bvZ)Sf%e5W=pB&^*X}{(+Y`wLsLUTX`#k7=S)BOYawQ<;&rLo9m#g% +zwPaO$&#Y$HpN_c&^*>V1?JGexYaUqaxK=iL8(`ZD&$w2Sxa*`Cd7bbA>zbzCphX*- +zGp_}bY6w<|-Cw50^IqL_P@F=SDA?OqFfUL`|5q*w;ThLVeN$sZMPsAul=p*N;Md~B +zstvI9KQ7eBq@obs3Z%O#yT2hM2$ozzV~?~eodu&|-^wp$cwS$@TX(;D4MiyGkKzth +z$ee-*&1d&ul1@s_b%ech+Q+>Tc#aRv)xcBLCHbJHUt)b74SCSRJ2H%4UX&}`({{Sk +zS7nakiCT8{S2JHGFPTBR!;M#S~ZBV@lN-yC!@Wkurya@ +zIElD=8fS2($ZNN0)?0VW5uD{^bQPY;n?Y)?xbu&U&pfcIwJ-t(sunHBMiCI}qLU|7 +z(%ar=vckv6N(#{@cp0U0NWPd5=&*|DUWj$+bR;{p>dT? +z;&Yt5bS&KLi%Ju+n-up{Efw%vN`XeeWw%ra6`1H#mDwG=9F!f#FZtC~za#0J_?Rwn +z59TZE6(@hb94NYD%Gzngtig0gW9}-$Y{@Up{8_%!2w7_2nL%z7w-HgpCHOhBA@)tm +zY3z}pDtXbhNB}Kt+H<@lt*lvXqrdU(u)|yC^}c-xj(<)a4IZ$?aS%x5tFMn^kX70# +zK6SUT*WcW{3Bt04MF$YD4&|wCH59P{F-5d#4`1Tc*skr|RLQrk81;A>9(g_E?@}a? +zuj27t%9ya3PJ?fck-Vj0Uhf!orSamn%Pw1^GROS+u(b5d@l$?keRyorXu4jotwcF* +zSgDs$&`*10LL3*lG+ly523nSKJx*>Wk#y^-vYUpPGgk*@i6soH>we*~vKBE-eUZfR +z-yy*Qebd+An7`c;$19pO=#mp4d%679Ac91DktN;PDMO>6#@4xAgS-!&tG3zjT-pvI +zCD8pli&OGACY&PJ;=Ri-&yGq<<ik6ljB +zvFpV1p7ZmFf1=oJhsoKgS+Is4mwfpA=f(qb5xPWN!QhcsPE``44s;${*~e8)%s>0z +zU@ub^jXuF%U_ag{XG1BfpbJ20zGs8qYiG80bBJE$ktZua9+qgC9??-IV#qS*_F6&!6W}_1U}q +z70vRrG%c(F&wN`aGcidtz!VJ)mE-H=m_3ya1>T$h*8_0kb0a)@XbR8BVn}aw2H^Aoqx2A6`?H|R6OB3KlI2J&ISygV$j|!J=mEWlr(xd>|uEp(nt_%gJHFVF3j4u<^2)@$#5i +z0J&cIqul1)CY-G1yc|OR{}TrP<2sm`zIjV4+4uT#lt)J&RuZ9J^~JXKelN~m^iD?7 +tTMj$DH1O@4089iE)c;U|;(u+Z&MqcSE*?(i7O3oO+^94(5=xS&{|9kAA}Ig> + +diff --git a/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsReference.md b/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsReference.md +deleted file mode 100644 +index 0957bcf6bd..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/docs/UnityAssertionsReference.md ++++ /dev/null +@@ -1,831 +0,0 @@ +-# Unity Assertions Reference +- +-## Background and Overview +- +-### Super Condensed Version +- +-- An assertion establishes truth (i.e. boolean True) for a single condition. +-Upon boolean False, an assertion stops execution and reports the failure. +-- Unity is mainly a rich collection of assertions and the support to gather up +-and easily execute those assertions. +-- The structure of Unity allows you to easily separate test assertions from +-source code in, well, test code. +-- Unity's assertions: +-- Come in many, many flavors to handle different C types and assertion cases. +-- Use context to provide detailed and helpful failure messages. +-- Document types, expected values, and basic behavior in your source code for +-free. +- +- +-### Unity Is Several Things But Mainly It's Assertions +- +-One way to think of Unity is simply as a rich collection of assertions you can +-use to establish whether your source code behaves the way you think it does. +-Unity provides a framework to easily organize and execute those assertions in +-test code separate from your source code. +- +- +-### What's an Assertion? +- +-At their core, assertions are an establishment of truth - boolean truth. Was this +-thing equal to that thing? Does that code doohickey have such-and-such property +-or not? You get the idea. Assertions are executable code (to appreciate the big +-picture on this read up on the difference between +-[link:Dynamic Verification and Static Analysis]). A failing assertion stops +-execution and reports an error through some appropriate I/O channel (e.g. +-stdout, GUI, file, blinky light). +- +-Fundamentally, for dynamic verification all you need is a single assertion +-mechanism. In fact, that's what the [assert() macro in C's standard library](http://en.wikipedia.org/en/wiki/Assert.h) +-is for. So why not just use it? Well, we can do far better in the reporting +-department. C's `assert()` is pretty dumb as-is and is particularly poor for +-handling common data types like arrays, structs, etc. And, without some other +-support, it's far too tempting to litter source code with C's `assert()`'s. It's +-generally much cleaner, manageable, and more useful to separate test and source +-code in the way Unity facilitates. +- +- +-### Unity's Assertions: Helpful Messages _and_ Free Source Code Documentation +- +-Asserting a simple truth condition is valuable, but using the context of the +-assertion is even more valuable. For instance, if you know you're comparing bit +-flags and not just integers, then why not use that context to give explicit, +-readable, bit-level feedback when an assertion fails? +- +-That's what Unity's collection of assertions do - capture context to give you +-helpful, meaningful assertion failure messages. In fact, the assertions +-themselves also serve as executable documentation about types and values in your +-source code. So long as your tests remain current with your source and all those +-tests pass, you have a detailed, up-to-date view of the intent and mechanisms in +-your source code. And due to a wondrous mystery, well-tested code usually tends +-to be well designed code. +- +- +-## Assertion Conventions and Configurations +- +-### Naming and Parameter Conventions +- +-The convention of assertion parameters generally follows this order: +- +-``` +-TEST_ASSERT_X( {modifiers}, {expected}, actual, {size/count} ) +-``` +- +-The very simplest assertion possible uses only a single `actual` parameter (e.g. +-a simple null check). +- +- - `Actual` is the value being tested and unlike the other parameters in an +- assertion construction is the only parameter present in all assertion variants. +- - `Modifiers` are masks, ranges, bit flag specifiers, floating point deltas. +- - `Expected` is your expected value (duh) to compare to an `actual` value; it's +- marked as an optional parameter because some assertions only need a single +- `actual` parameter (e.g. null check). +- - `Size/count` refers to string lengths, number of array elements, etc. +- +-Many of Unity's assertions are clear duplications in that the same data type +-is handled by several assertions. The differences among these are in how failure +-messages are presented. For instance, a `_HEX` variant of an assertion prints +-the expected and actual values of that assertion formatted as hexadecimal. +- +- +-#### TEST_ASSERT_X_MESSAGE Variants +- +-_All_ assertions are complemented with a variant that includes a simple string +-message as a final parameter. The string you specify is appended to an assertion +-failure message in Unity output. +- +-For brevity, the assertion variants with a message parameter are not listed +-below. Just tack on `_MESSAGE` as the final component to any assertion name in +-the reference list below and add a string as the final parameter. +- +-_Example:_ +- +-``` +-TEST_ASSERT_X( {modifiers}, {expected}, actual, {size/count} ) +-``` +- +-becomes messageified like thus... +- +-``` +-TEST_ASSERT_X_MESSAGE( {modifiers}, {expected}, actual, {size/count}, message ) +-``` +- +-Notes: +-- The `_MESSAGE` variants intentionally do not support `printf` style formatting +- since many embedded projects don't support or avoid `printf` for various reasons. +- It is possible to use `sprintf` before the assertion to assemble a complex fail +- message, if necessary. +-- If you want to output a counter value within an assertion fail message (e.g. from +- a loop) , building up an array of results and then using one of the `_ARRAY` +- assertions (see below) might be a handy alternative to `sprintf`. +- +- +-#### TEST_ASSERT_X_ARRAY Variants +- +-Unity provides a collection of assertions for arrays containing a variety of +-types. These are documented in the Array section below. These are almost on par +-with the `_MESSAGE`variants of Unity's Asserts in that for pretty much any Unity +-type assertion you can tack on `_ARRAY` and run assertions on an entire block of +-memory. +- +-``` +- TEST_ASSERT_EQUAL_TYPEX_ARRAY( expected, actual, {size/count} ) +-``` +- +- - `Expected` is an array itself. +- - `Size/count` is one or two parameters necessary to establish the number of array +- elements and perhaps the length of elements within the array. +- +-Notes: +- +- - The `_MESSAGE` variant convention still applies here to array assertions. The +- `_MESSAGE` variants of the `_ARRAY` assertions have names ending with +- `_ARRAY_MESSAGE`. +- - Assertions for handling arrays of floating point values are grouped with float +- and double assertions (see immediately following section). +- +- +-### TEST_ASSERT_EACH_EQUAL_X Variants +- +-Unity provides a collection of assertions for arrays containing a variety of +-types which can be compared to a single value as well. These are documented in +-the Each Equal section below. these are almost on par with the `_MESSAGE` +-variants of Unity's Asserts in that for pretty much any Unity type assertion you +-can inject `_EACH_EQUAL` and run assertions on an entire block of memory. +- +-``` +-TEST_ASSERT_EACH_EQUAL_TYPEX( expected, actual, {size/count} ) +-``` +- +- - `Expected` is a single value to compare to. +- - `Actual` is an array where each element will be compared to the expected value. +- - `Size/count` is one of two parameters necessary to establish the number of array +- elements and perhaps the length of elements within the array. +- +-Notes: +- +- - The `_MESSAGE` variant convention still applies here to Each Equal assertions. +- - Assertions for handling Each Equal of floating point values are grouped with +- float and double assertions (see immediately following section). +- +- +-### Configuration +- +-#### Floating Point Support Is Optional +- +-Support for floating point types is configurable. That is, by defining the +-appropriate preprocessor symbols, floats and doubles can be individually enabled +-or disabled in Unity code. This is useful for embedded targets with no floating +-point math support (i.e. Unity compiles free of errors for fixed point only +-platforms). See Unity documentation for specifics. +- +- +-#### Maximum Data Type Width Is Configurable +- +-Not all targets support 64 bit wide types or even 32 bit wide types. Define the +-appropriate preprocessor symbols and Unity will omit all operations from +-compilation that exceed the maximum width of your target. See Unity +-documentation for specifics. +- +- +-## The Assertions in All Their Blessed Glory +- +-### Basic Fail, Pass and Ignore +- +-##### `TEST_FAIL()` +- +-##### `TEST_FAIL_MESSAGE("message")` +- +-This fella is most often used in special conditions where your test code is +-performing logic beyond a simple assertion. That is, in practice, `TEST_FAIL()` +-will always be found inside a conditional code block. +- +-_Examples:_ +- +-- Executing a state machine multiple times that increments a counter your test +-code then verifies as a final step. +-- Triggering an exception and verifying it (as in Try / Catch / Throw - see the +-[CException](https://github.com/ThrowTheSwitch/CException) project). +- +-##### `TEST_PASS()` +- +-##### `TEST_PASS_MESSAGE("message")` +- +-This will abort the remainder of the test, but count the test as a pass. Under +-normal circumstances, it is not necessary to include this macro in your tests... +-a lack of failure will automatically be counted as a `PASS`. It is occasionally +-useful for tests with `#ifdef`s and such. +- +-##### `TEST_IGNORE()` +- +-##### `TEST_IGNORE_MESSAGE("message")` +- +-Marks a test case (i.e. function meant to contain test assertions) as ignored. +-Usually this is employed as a breadcrumb to come back and implement a test case. +-An ignored test case has effects if other assertions are in the enclosing test +-case (see Unity documentation for more). +- +-##### `TEST_MESSAGE(message)` +- +-This can be useful for outputting `INFO` messages into the Unity output stream +-without actually ending the test. Like pass and fail messages, it will be output +-with the filename and line number. +- +-### Boolean +- +-##### `TEST_ASSERT (condition)` +- +-##### `TEST_ASSERT_TRUE (condition)` +- +-##### `TEST_ASSERT_FALSE (condition)` +- +-##### `TEST_ASSERT_UNLESS (condition)` +- +-A simple wording variation on `TEST_ASSERT_FALSE`.The semantics of +-`TEST_ASSERT_UNLESS` aid readability in certain test constructions or +-conditional statements. +- +-##### `TEST_ASSERT_NULL (pointer)` +- +-##### `TEST_ASSERT_NOT_NULL (pointer)` +- +-Verify if a pointer is or is not NULL. +- +-##### `TEST_ASSERT_EMPTY (pointer)` +- +-##### `TEST_ASSERT_NOT_EMPTY (pointer)` +- +-Verify if the first element dereferenced from a pointer is or is not zero. This +-is particularly useful for checking for empty (or non-empty) null-terminated +-C strings, but can be just as easily used for other null-terminated arrays. +- +-### Signed and Unsigned Integers (of all sizes) +- +-Large integer sizes can be disabled for build targets that do not support them. +-For example, if your target only supports up to 16 bit types, by defining the +-appropriate symbols Unity can be configured to omit 32 and 64 bit operations +-that would break compilation (see Unity documentation for more). Refer to +-Advanced Asserting later in this document for advice on dealing with other word +-sizes. +- +-##### `TEST_ASSERT_EQUAL_INT (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_INT8 (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_INT16 (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_INT32 (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_INT64 (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_UINT (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_UINT8 (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_UINT16 (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_UINT32 (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_UINT64 (expected, actual)` +- +- +-### Unsigned Integers (of all sizes) in Hexadecimal +- +-All `_HEX` assertions are identical in function to unsigned integer assertions +-but produce failure messages with the `expected` and `actual` values formatted +-in hexadecimal. Unity output is big endian. +- +-##### `TEST_ASSERT_EQUAL_HEX (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_HEX8 (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_HEX16 (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_HEX32 (expected, actual)` +- +-##### `TEST_ASSERT_EQUAL_HEX64 (expected, actual)` +- +- +-### Characters +- +-While you can use the 8-bit integer assertions to compare `char`, another option is +-to use this specialized assertion which will show printable characters as printables, +-otherwise showing the HEX escape code for the characters. +- +-##### `TEST_ASSERT_EQUAL_CHAR (expected, actual)` +- +- +-### Masked and Bit-level Assertions +- +-Masked and bit-level assertions produce output formatted in hexadecimal. Unity +-output is big endian. +- +- +-##### `TEST_ASSERT_BITS (mask, expected, actual)` +- +-Only compares the masked (i.e. high) bits of `expected` and `actual` parameters. +- +- +-##### `TEST_ASSERT_BITS_HIGH (mask, actual)` +- +-Asserts the masked bits of the `actual` parameter are high. +- +- +-##### `TEST_ASSERT_BITS_LOW (mask, actual)` +- +-Asserts the masked bits of the `actual` parameter are low. +- +- +-##### `TEST_ASSERT_BIT_HIGH (bit, actual)` +- +-Asserts the specified bit of the `actual` parameter is high. +- +- +-##### `TEST_ASSERT_BIT_LOW (bit, actual)` +- +-Asserts the specified bit of the `actual` parameter is low. +- +-### Integer Less Than / Greater Than +- +-These assertions verify that the `actual` parameter is less than or greater +-than `threshold` (exclusive). For example, if the threshold value is 0 for the +-greater than assertion will fail if it is 0 or less. There are assertions for +-all the various sizes of ints, as for the equality assertions. Some examples: +- +-##### `TEST_ASSERT_GREATER_THAN_INT8 (threshold, actual)` +- +-##### `TEST_ASSERT_GREATER_OR_EQUAL_INT16 (threshold, actual)` +- +-##### `TEST_ASSERT_LESS_THAN_INT32 (threshold, actual)` +- +-##### `TEST_ASSERT_LESS_OR_EQUAL_UINT (threshold, actual)` +- +-##### `TEST_ASSERT_NOT_EQUAL_UINT8 (threshold, actual)` +- +- +-### Integer Ranges (of all sizes) +- +-These assertions verify that the `expected` parameter is within +/- `delta` +-(inclusive) of the `actual` parameter. For example, if the expected value is 10 +-and the delta is 3 then the assertion will fail for any value outside the range +-of 7 - 13. +- +-##### `TEST_ASSERT_INT_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_INT8_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_INT16_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_INT32_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_INT64_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_UINT_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_UINT8_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_UINT16_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_UINT32_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_UINT64_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_HEX_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_HEX8_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_HEX16_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_HEX32_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_HEX64_WITHIN (delta, expected, actual)` +- +-##### `TEST_ASSERT_CHAR_WITHIN (delta, expected, actual)` +- +-### Structs and Strings +- +-##### `TEST_ASSERT_EQUAL_PTR (expected, actual)` +- +-Asserts that the pointers point to the same memory location. +- +- +-##### `TEST_ASSERT_EQUAL_STRING (expected, actual)` +- +-Asserts that the null terminated (`'\0'`)strings are identical. If strings are +-of different lengths or any portion of the strings before their terminators +-differ, the assertion fails. Two NULL strings (i.e. zero length) are considered +-equivalent. +- +- +-##### `TEST_ASSERT_EQUAL_MEMORY (expected, actual, len)` +- +-Asserts that the contents of the memory specified by the `expected` and `actual` +-pointers is identical. The size of the memory blocks in bytes is specified by +-the `len` parameter. +- +- +-### Arrays +- +-`expected` and `actual` parameters are both arrays. `num_elements` specifies the +-number of elements in the arrays to compare. +- +-`_HEX` assertions produce failure messages with expected and actual array +-contents formatted in hexadecimal. +- +-For array of strings comparison behavior, see comments for +-`TEST_ASSERT_EQUAL_STRING` in the preceding section. +- +-Assertions fail upon the first element in the compared arrays found not to +-match. Failure messages specify the array index of the failed comparison. +- +-##### `TEST_ASSERT_EQUAL_INT_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_INT8_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_INT16_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_INT32_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_INT64_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_UINT_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_UINT8_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_UINT16_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_UINT32_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_UINT64_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_HEX_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_HEX8_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_HEX16_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_HEX32_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_HEX64_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_CHAR_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_PTR_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_STRING_ARRAY (expected, actual, num_elements)` +- +-##### `TEST_ASSERT_EQUAL_MEMORY_ARRAY (expected, actual, len, num_elements)` +- +-`len` is the memory in bytes to be compared at each array element. +- +-### Integer Array Ranges (of all sizes) +- +-These assertions verify that the `expected` array parameter is within +/- `delta` +-(inclusive) of the `actual` array parameter. For example, if the expected value is +-\[10, 12\] and the delta is 3 then the assertion will fail for any value +-outside the range of \[7 - 13, 9 - 15\]. +- +-##### `TEST_ASSERT_INT_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_INT8_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_INT16_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_INT32_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_INT64_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_UINT_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_UINT8_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_UINT16_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_UINT32_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_UINT64_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_HEX_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_HEX8_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_HEX16_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_HEX32_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_HEX64_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-##### `TEST_ASSERT_CHAR_ARRAY_WITHIN (delta, expected, actual, num_elements)` +- +-### Each Equal (Arrays to Single Value) +- +-`expected` are single values and `actual` are arrays. `num_elements` specifies +-the number of elements in the arrays to compare. +- +-`_HEX` assertions produce failure messages with expected and actual array +-contents formatted in hexadecimal. +- +-Assertions fail upon the first element in the compared arrays found not to +-match. Failure messages specify the array index of the failed comparison. +- +-#### `TEST_ASSERT_EACH_EQUAL_INT (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_INT8 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_INT16 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_INT32 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_INT64 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_UINT (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_UINT8 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_UINT16 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_UINT32 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_UINT64 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_HEX (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_HEX8 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_HEX16 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_HEX32 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_HEX64 (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_CHAR (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_PTR (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_STRING (expected, actual, num_elements)` +- +-#### `TEST_ASSERT_EACH_EQUAL_MEMORY (expected, actual, len, num_elements)` +- +-`len` is the memory in bytes to be compared at each array element. +- +- +-### Floating Point (If enabled) +- +-##### `TEST_ASSERT_FLOAT_WITHIN (delta, expected, actual)` +- +-Asserts that the `actual` value is within +/- `delta` of the `expected` value. +-The nature of floating point representation is such that exact evaluations of +-equality are not guaranteed. +- +- +-##### `TEST_ASSERT_EQUAL_FLOAT (expected, actual)` +- +-Asserts that the ?actual?value is "close enough to be considered equal" to the +-`expected` value. If you are curious about the details, refer to the Advanced +-Asserting section for more details on this. Omitting a user-specified delta in a +-floating point assertion is both a shorthand convenience and a requirement of +-code generation conventions for CMock. +- +- +-##### `TEST_ASSERT_EQUAL_FLOAT_ARRAY (expected, actual, num_elements)` +- +-See Array assertion section for details. Note that individual array element +-float comparisons are executed using T?EST_ASSERT_EQUAL_FLOAT?.That is, user +-specified delta comparison values requires a custom-implemented floating point +-array assertion. +- +- +-##### `TEST_ASSERT_FLOAT_IS_INF (actual)` +- +-Asserts that `actual` parameter is equivalent to positive infinity floating +-point representation. +- +- +-##### `TEST_ASSERT_FLOAT_IS_NEG_INF (actual)` +- +-Asserts that `actual` parameter is equivalent to negative infinity floating +-point representation. +- +- +-##### `TEST_ASSERT_FLOAT_IS_NAN (actual)` +- +-Asserts that `actual` parameter is a Not A Number floating point representation. +- +- +-##### `TEST_ASSERT_FLOAT_IS_DETERMINATE (actual)` +- +-Asserts that ?actual?parameter is a floating point representation usable for +-mathematical operations. That is, the `actual` parameter is neither positive +-infinity nor negative infinity nor Not A Number floating point representations. +- +- +-##### `TEST_ASSERT_FLOAT_IS_NOT_INF (actual)` +- +-Asserts that `actual` parameter is a value other than positive infinity floating +-point representation. +- +- +-##### `TEST_ASSERT_FLOAT_IS_NOT_NEG_INF (actual)` +- +-Asserts that `actual` parameter is a value other than negative infinity floating +-point representation. +- +- +-##### `TEST_ASSERT_FLOAT_IS_NOT_NAN (actual)` +- +-Asserts that `actual` parameter is a value other than Not A Number floating +-point representation. +- +- +-##### `TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE (actual)` +- +-Asserts that `actual` parameter is not usable for mathematical operations. That +-is, the `actual` parameter is either positive infinity or negative infinity or +-Not A Number floating point representations. +- +- +-### Double (If enabled) +- +-##### `TEST_ASSERT_DOUBLE_WITHIN (delta, expected, actual)` +- +-Asserts that the `actual` value is within +/- `delta` of the `expected` value. +-The nature of floating point representation is such that exact evaluations of +-equality are not guaranteed. +- +- +-##### `TEST_ASSERT_EQUAL_DOUBLE (expected, actual)` +- +-Asserts that the `actual` value is "close enough to be considered equal" to the +-`expected` value. If you are curious about the details, refer to the Advanced +-Asserting section for more details. Omitting a user-specified delta in a +-floating point assertion is both a shorthand convenience and a requirement of +-code generation conventions for CMock. +- +- +-##### `TEST_ASSERT_EQUAL_DOUBLE_ARRAY (expected, actual, num_elements)` +- +-See Array assertion section for details. Note that individual array element +-double comparisons are executed using `TEST_ASSERT_EQUAL_DOUBLE`.That is, user +-specified delta comparison values requires a custom implemented double array +-assertion. +- +- +-##### `TEST_ASSERT_DOUBLE_IS_INF (actual)` +- +-Asserts that `actual` parameter is equivalent to positive infinity floating +-point representation. +- +- +-##### `TEST_ASSERT_DOUBLE_IS_NEG_INF (actual)` +- +-Asserts that `actual` parameter is equivalent to negative infinity floating point +-representation. +- +- +-##### `TEST_ASSERT_DOUBLE_IS_NAN (actual)` +- +-Asserts that `actual` parameter is a Not A Number floating point representation. +- +- +-##### `TEST_ASSERT_DOUBLE_IS_DETERMINATE (actual)` +- +-Asserts that `actual` parameter is a floating point representation usable for +-mathematical operations. That is, the ?actual?parameter is neither positive +-infinity nor negative infinity nor Not A Number floating point representations. +- +- +-##### `TEST_ASSERT_DOUBLE_IS_NOT_INF (actual)` +- +-Asserts that `actual` parameter is a value other than positive infinity floating +-point representation. +- +- +-##### `TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF (actual)` +- +-Asserts that `actual` parameter is a value other than negative infinity floating +-point representation. +- +- +-##### `TEST_ASSERT_DOUBLE_IS_NOT_NAN (actual)` +- +-Asserts that `actual` parameter is a value other than Not A Number floating +-point representation. +- +- +-##### `TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE (actual)` +- +-Asserts that `actual` parameter is not usable for mathematical operations. That +-is, the `actual` parameter is either positive infinity or negative infinity or +-Not A Number floating point representations. +- +- +-## Advanced Asserting: Details On Tricky Assertions +- +-This section helps you understand how to deal with some of the trickier +-assertion situations you may run into. It will give you a glimpse into some of +-the under-the-hood details of Unity's assertion mechanisms. If you're one of +-those people who likes to know what is going on in the background, read on. If +-not, feel free to ignore the rest of this document until you need it. +- +- +-### How do the EQUAL assertions work for FLOAT and DOUBLE? +- +-As you may know, directly checking for equality between a pair of floats or a +-pair of doubles is sloppy at best and an outright no-no at worst. Floating point +-values can often be represented in multiple ways, particularly after a series of +-operations on a value. Initializing a variable to the value of 2.0 is likely to +-result in a floating point representation of 2 x 20,but a series of +-mathematical operations might result in a representation of 8 x 2-2 +-that also evaluates to a value of 2. At some point repeated operations cause +-equality checks to fail. +- +-So Unity doesn't do direct floating point comparisons for equality. Instead, it +-checks if two floating point values are "really close." If you leave Unity +-running with defaults, "really close" means "within a significant bit or two." +-Under the hood, `TEST_ASSERT_EQUAL_FLOAT` is really `TEST_ASSERT_FLOAT_WITHIN` +-with the `delta` parameter calculated on the fly. For single precision, delta is +-the expected value multiplied by 0.00001, producing a very small proportional +-range around the expected value. +- +-If you are expecting a value of 20,000.0 the delta is calculated to be 0.2. So +-any value between 19,999.8 and 20,000.2 will satisfy the equality check. This +-works out to be roughly a single bit of range for a single-precision number, and +-that's just about as tight a tolerance as you can reasonably get from a floating +-point value. +- +-So what happens when it's zero? Zero - even more than other floating point +-values - can be represented many different ways. It doesn't matter if you have +-0 x 20 or 0 x 263.It's still zero, right? Luckily, if you +-subtract these values from each other, they will always produce a difference of +-zero, which will still fall between 0 plus or minus a delta of 0. So it still +-works! +- +-Double precision floating point numbers use a much smaller multiplier, again +-approximating a single bit of error. +- +-If you don't like these ranges and you want to make your floating point equality +-assertions less strict, you can change these multipliers to whatever you like by +-defining UNITY_FLOAT_PRECISION and UNITY_DOUBLE_PRECISION. See Unity +-documentation for more. +- +- +-### How do we deal with targets with non-standard int sizes? +- +-It's "fun" that C is a standard where something as fundamental as an integer +-varies by target. According to the C standard, an `int` is to be the target's +-natural register size, and it should be at least 16-bits and a multiple of a +-byte. It also guarantees an order of sizes: +- +-```C +-char <= short <= int <= long <= long long +-``` +- +-Most often, `int` is 32-bits. In many cases in the embedded world, `int` is +-16-bits. There are rare microcontrollers out there that have 24-bit integers, +-and this remains perfectly standard C. +- +-To make things even more interesting, there are compilers and targets out there +-that have a hard choice to make. What if their natural register size is 10-bits +-or 12-bits? Clearly they can't fulfill _both_ the requirement to be at least +-16-bits AND the requirement to match the natural register size. In these +-situations, they often choose the natural register size, leaving us with +-something like this: +- +-```C +-char (8 bit) <= short (12 bit) <= int (12 bit) <= long (16 bit) +-``` +- +-Um... yikes. It's obviously breaking a rule or two... but they had to break SOME +-rules, so they made a choice. +- +-When the C99 standard rolled around, it introduced alternate standard-size types. +-It also introduced macros for pulling in MIN/MAX values for your integer types. +-It's glorious! Unfortunately, many embedded compilers can't be relied upon to +-use the C99 types (Sometimes because they have weird register sizes as described +-above. Sometimes because they don't feel like it?). +- +-A goal of Unity from the beginning was to support every combination of +-microcontroller or microprocessor and C compiler. Over time, we've gotten really +-close to this. There are a few tricks that you should be aware of, though, if +-you're going to do this effectively on some of these more idiosyncratic targets. +- +-First, when setting up Unity for a new target, you're going to want to pay +-special attention to the macros for automatically detecting types +-(where available) or manually configuring them yourself. You can get information +-on both of these in Unity's documentation. +- +-What about the times where you suddenly need to deal with something odd, like a +-24-bit `int`? The simplest solution is to use the next size up. If you have a +-24-bit `int`, configure Unity to use 32-bit integers. If you have a 12-bit +-`int`, configure Unity to use 16 bits. There are two ways this is going to +-affect you: +- +-1. When Unity displays errors for you, it's going to pad the upper unused bits +-with zeros. +-2. You're going to have to be careful of assertions that perform signed +-operations, particularly `TEST_ASSERT_INT_WITHIN`.Such assertions might wrap +-your `int` in the wrong place, and you could experience false failures. You can +-always back down to a simple `TEST_ASSERT` and do the operations yourself. +- +- +-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* +diff --git a/components/testframework/libs/cmock/vendor/unity/docs/UnityConfigurationGuide.md b/components/testframework/libs/cmock/vendor/unity/docs/UnityConfigurationGuide.md +deleted file mode 100644 +index de691fdf28..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/docs/UnityConfigurationGuide.md ++++ /dev/null +@@ -1,563 +0,0 @@ +-# Unity Configuration Guide +- +-## C Standards, Compilers and Microcontrollers +- +-The embedded software world contains its challenges. Compilers support different +-revisions of the C Standard. They ignore requirements in places, sometimes to +-make the language more usable in some special regard. Sometimes it's to simplify +-their support. Sometimes it's due to specific quirks of the microcontroller they +-are targeting. Simulators add another dimension to this menagerie. +- +-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 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. +- +-Unfortunately, it doesn't usually work well to just #define these things in the +-test itself. These defines need to take effect where ever unity.h is included. +-This would be test test, the test runner (if you're generating one), and from +-unity.c when it's compiled. +- +-## The Options +- +-### Integer Types +- +-If you've been a C developer for long, you probably already know that 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. +- +- +-##### `UNITY_EXCLUDE_STDINT_H` +- +-The first thing that Unity does to guess your types is check `stdint.h`. +-This file includes defines like `UINT_MAX` that Unity can use to +-learn a lot about your system. It's possible you don't want it to do this +-(um. why not?) or (more likely) 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. +- +-_Example:_ +-```C +-#define UNITY_EXCLUDE_STDINT_H +-``` +- +- +-##### `UNITY_EXCLUDE_LIMITS_H` +- +-The second attempt to guess your types is to check `limits.h`. Some compilers +-that don't support `stdint.h` could include `limits.h` instead. If you don't +-want Unity to check this file either, define this to make it skip the inclusion. +- +-_Example:_ +-```C +-#define UNITY_EXCLUDE_LIMITS_H +-``` +- +-If you've disabled both of the automatic options above, you're going to have to +-do the configuration yourself. Don't worry. Even this isn't too bad... there are +-just a handful of defines that you are going to specify if you don't like the +-defaults. +- +- +-##### `UNITY_INT_WIDTH` +- +-Define this to be the number of bits an `int` takes up on your system. The +-default, if not autodetected, is 32 bits. +- +-_Example:_ +-```C +-#define UNITY_INT_WIDTH 16 +-``` +- +- +-##### `UNITY_LONG_WIDTH` +- +-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:_ +-```C +-#define UNITY_LONG_WIDTH 16 +-``` +- +- +-##### `UNITY_POINTER_WIDTH` +- +-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. +- +-_Hint:_ In order to support exotic processors (for example TI C55x with a pointer +-width of 23-bit), choose the next power of two (in this case 32-bit). +- +-_Supported values:_ 16, 32 and 64 +- +-_Example:_ +-```C +-// Choose on of these #defines to set your pointer width (if not autodetected) +-//#define UNITY_POINTER_WIDTH 16 +-//#define UNITY_POINTER_WIDTH 32 +-#define UNITY_POINTER_WIDTH 64 // Set UNITY_POINTER_WIDTH to 64-bit +-``` +- +- +-##### `UNITY_SUPPORT_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. +- +-_Example:_ +-```C +-#define UNITY_SUPPORT_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. +- +- +-##### `UNITY_INCLUDE_FLOAT` +- +-##### `UNITY_EXCLUDE_FLOAT` +- +-##### `UNITY_INCLUDE_DOUBLE` +- +-##### `UNITY_EXCLUDE_DOUBLE` +- +-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, either, or both, as +-suits your needs. For features that are enabled, the following floating point +-options also become available. +- +-_Example:_ +-```C +-//what manner of strange processor is this? +-#define UNITY_EXCLUDE_FLOAT +-#define UNITY_INCLUDE_DOUBLE +-``` +- +- +-##### `UNITY_EXCLUDE_FLOAT_PRINT` +- +-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. +-Therefore, the display of floating point values during a failure are optional. +-By default, Unity will print the actual results of floating point assertion +-failure (e.g. ”Expected 4.56 Was 4.68”). To not include this extra support, you +-can use this define to instead respond to a failed assertion with a message like +-”Values Not Within Delta”. If you would like verbose failure messages for floating +-point assertions, use these options to give more explicit failure messages. +- +-_Example:_ +-```C +-#define UNITY_EXCLUDE_FLOAT_PRINT +-``` +- +- +-##### `UNITY_FLOAT_TYPE` +- +-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:_ +-```C +-#define UNITY_FLOAT_TYPE float16_t +-``` +- +- +-##### `UNITY_DOUBLE_TYPE` +- +-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:_ +-```C +-#define UNITY_DOUBLE_TYPE long double +-``` +- +- +-##### `UNITY_FLOAT_PRECISION` +- +-##### `UNITY_DOUBLE_PRECISION` +- +-If you look up `UNITY_ASSERT_EQUAL_FLOAT` and `UNITY_ASSERT_EQUAL_DOUBLE` as +-documented in the big daddy 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:_ +-```C +-#define UNITY_FLOAT_PRECISION 0.001f +-``` +- +- +-### Miscellaneous +- +-##### `UNITY_EXCLUDE_STDDEF_H` +- +-Unity uses the `NULL` macro, which defines the value of a null pointer constant, +-defined in `stddef.h` by default. If you want to provide +-your own macro for this, you should exclude the `stddef.h` header file by adding this +-define to your configuration. +- +-_Example:_ +-```C +-#define UNITY_EXCLUDE_STDDEF_H +-``` +- +- +-#### `UNITY_INCLUDE_PRINT_FORMATTED` +- +-Unity provides a simple (and very basic) printf-like string output implementation, +-which is able to print a string modified by the following format string modifiers: +- +-- __%d__ - signed value (decimal) +-- __%i__ - same as __%i__ +-- __%u__ - unsigned value (decimal) +-- __%f__ - float/Double (if float support is activated) +-- __%g__ - same as __%f__ +-- __%b__ - binary prefixed with "0b" +-- __%x__ - hexadecimal (upper case) prefixed with "0x" +-- __%X__ - same as __%x__ +-- __%p__ - pointer (same as __%x__ or __%X__) +-- __%c__ - a single character +-- __%s__ - a string (e.g. "string") +-- __%%__ - The "%" symbol (escaped) +- +-_Example:_ +-```C +-#define UNITY_INCLUDE_PRINT_FORMATTED +- +-int a = 0xfab1; +-TEST_PRINTF("Decimal %d\n", -7); +-TEST_PRINTF("Unsigned %u\n", 987); +-TEST_PRINTF("Float %f\n", 3.1415926535897932384); +-TEST_PRINTF("Binary %b\n", 0xA); +-TEST_PRINTF("Hex %X\n", 0xFAB); +-TEST_PRINTF("Pointer %p\n", &a); +-TEST_PRINTF("Character %c\n", 'F'); +-TEST_PRINTF("String %s\n", "My string"); +-TEST_PRINTF("Percent %%\n"); +-TEST_PRINTF("Color Red \033[41mFAIL\033[00m\n"); +-TEST_PRINTF("\n"); +-TEST_PRINTF("Multiple (%d) (%i) (%u) (%x)\n", -100, 0, 200, 0x12345); +-``` +- +- +-### 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 run properly. These macros will help in those +-situations. +- +- +-##### `UNITY_OUTPUT_CHAR(a)` +- +-##### `UNITY_OUTPUT_FLUSH()` +- +-##### `UNITY_OUTPUT_START()` +- +-##### `UNITY_OUTPUT_COMPLETE()` +- +-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: +-```C +-#include "RS232_header.h" +-... +-#define UNITY_OUTPUT_CHAR(a) RS232_putc(a) +-#define UNITY_OUTPUT_START() RS232_config(115200,1,8,0) +-#define UNITY_OUTPUT_FLUSH() RS232_flush() +-#define UNITY_OUTPUT_COMPLETE() RS232_close() +-``` +- +-_Note:_ +-`UNITY_OUTPUT_FLUSH()` can be set to the standard out flush function simply by +-specifying `UNITY_USE_FLUSH_STDOUT`. No other defines are required. +- +- +-##### `UNITY_OUTPUT_FOR_ECLIPSE` +- +-##### `UNITY_OUTPUT_FOR_IAR_WORKBENCH` +- +-##### `UNITY_OUTPUT_FOR_QT_CREATOR` +- +-When managing your own builds, it is often handy to have messages output in a format which is +-recognized by your IDE. These are some standard formats which can be supported. If you're using +-Ceedling to manage your builds, it is better to stick with the standard format (leaving these +-all undefined) and allow Ceedling to use its own decorators. +- +- +-##### `UNITY_PTR_ATTRIBUTE` +- +-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:_ +-```C +-#define UNITY_PTR_ATTRIBUTE __attribute__((far)) +-#define UNITY_PTR_ATTRIBUTE near +-``` +- +-##### `UNITY_PRINT_EOL` +- +-By default, Unity outputs \n at the end of each line of output. This is easy +-to parse by the scripts, by Ceedling, etc, but it might not be ideal for YOUR +-system. Feel free to override this and to make it whatever you wish. +- +-_Example:_ +-```C +-#define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\r'); UNITY_OUTPUT_CHAR('\n') } +-``` +- +- +-##### `UNITY_EXCLUDE_DETAILS` +- +-This is an option for if you absolutely must squeeze every byte of memory out of +-your system. Unity stores a set of internal scratchpads which are used to pass +-extra detail information around. It's used by systems like CMock in order to +-report which function or argument flagged an error. If you're not using CMock and +-you're not using these details for other things, then you can exclude them. +- +-_Example:_ +-```C +-#define UNITY_EXCLUDE_DETAILS +-``` +- +-##### `UNITY_PRINT_TEST_CONTEXT` +- +-This option allows you to specify your own function to print additional context +-as part of the error message when a test has failed. It can be useful if you +-want to output some specific information about the state of the test at the point +-of failure, and `UNITY_SET_DETAILS` isn't flexible enough for your needs. +- +-_Example:_ +-```C +-#define UNITY_PRINT_TEST_CONTEXT PrintIterationCount +- +-extern int iteration_count; +- +-void PrintIterationCount(void) +-{ +- UnityPrintFormatted("At iteration #%d: ", iteration_count); +-} +-``` +- +-##### `UNITY_EXCLUDE_SETJMP` +- +-If your embedded system doesn't support the standard library setjmp, you can +-exclude Unity's reliance on this by using this define. This dropped dependence +-comes at a price, though. You will be unable to use custom helper functions for +-your tests, and you will be unable to use tools like CMock. Very likely, if your +-compiler doesn't support setjmp, you wouldn't have had the memory space for those +-things anyway, though... so this option exists for those situations. +- +-_Example:_ +-```C +-#define UNITY_EXCLUDE_SETJMP +-``` +- +-##### `UNITY_OUTPUT_COLOR` +- +-If you want to add color using ANSI escape codes you can use this define. +- +-_Example:_ +-```C +-#define UNITY_OUTPUT_COLOR +-``` +- +-##### `UNITY_SHORTHAND_AS_INT` +-##### `UNITY_SHORTHAND_AS_MEM` +-##### `UNITY_SHORTHAND_AS_RAW` +-##### `UNITY_SHORTHAND_AS_NONE` +- +-These options give you control of the `TEST_ASSERT_EQUAL` and the +-`TEST_ASSERT_NOT_EQUAL` shorthand assertions. Historically, Unity treated the +-former as an alias for an integer comparison. It treated the latter as a direct +-comparison using `!=`. This assymetry was confusing, but there was much +-disagreement as to how best to treat this pair of assertions. These four options +-will allow you to specify how Unity will treat these assertions. +- +- - AS INT - the values will be cast to integers and directly compared. Arguments +- that don't cast easily to integers will cause compiler errors. +- - AS MEM - the address of both values will be taken and the entire object's +- memory footprint will be compared byte by byte. Directly placing +- constant numbers like `456` as expected values will cause errors. +- - AS_RAW - Unity assumes that you can compare the two values using `==` and `!=` +- and will do so. No details are given about mismatches, because it +- doesn't really know what type it's dealing with. +- - AS_NONE - Unity will disallow the use of these shorthand macros altogether, +- insisting that developers choose a more descriptive option. +- +-#### `UNITY_SUPPORT_VARIADIC_MACROS` +- +-This will force Unity to support variadic macros when using its own built-in +-RUN_TEST macro. This will rarely be necessary. Most often, Unity will automatically +-detect if the compiler supports variadic macros by checking to see if it's C99+ +-compatible. In the event that the compiler supports variadic macros, but is primarily +-C89 (ANSI), defining this option will allow you to use them. This option is also not +-necessary when using Ceedling or the test runner generator script. +- +-## Getting Into The Guts +- +-There will be cases where the options above aren't quite going to get everything +-perfect. They are likely sufficient for any situation where you are compiling +-and executing your tests with a native toolchain (e.g. clang on Mac). These +-options may even get you through the majority of cases encountered in working +-with a target simulator run from your local command line. But especially if you +-must run your test suite on your target hardware, your Unity configuration will +-require special help. This special help will usually reside in one of two +-places: the `main()` function or the `RUN_TEST` macro. Let's look at how these +-work. +- +- +-##### `main()` +- +-Each test module is compiled and run on its own, separate from the other test +-files in your project. Each test file, therefore, has a `main` function. This +-`main` function will need to contain whatever code is necessary to initialize +-your system to a workable state. This is particularly true for situations where +-you must set up a memory map or initialize a communication channel for the +-output of your test results. +- +-A simple main function looks something like this: +- +-```C +-int main(void) { +- UNITY_BEGIN(); +- RUN_TEST(test_TheFirst); +- RUN_TEST(test_TheSecond); +- RUN_TEST(test_TheThird); +- return UNITY_END(); +-} +-``` +- +-You can see that our main function doesn't bother taking any arguments. For our +-most barebones case, we'll never have arguments because we just run all the +-tests each time. Instead, we start by calling `UNITY_BEGIN`. We run each test +-(in whatever order we wish). Finally, we call `UNITY_END`, returning its return +-value (which is the total number of failures). +- +-It should be easy to see that you can add code before any test cases are run or +-after all the test cases have completed. This allows you to do any needed +-system-wide setup or teardown that might be required for your special +-circumstances. +- +- +-##### `RUN_TEST` +- +-The `RUN_TEST` macro is called with each test case function. Its job is to +-perform whatever setup and teardown is necessary for executing a single test +-case function. This includes catching failures, calling the test module's +-`setUp()` and `tearDown()` functions, and calling `UnityConcludeTest()`. If +-using CMock or test coverage, there will be additional stubs in use here. A +-simple minimalist RUN_TEST macro looks something like this: +- +-```C +-#define RUN_TEST(testfunc) \ +- UNITY_NEW_TEST(#testfunc) \ +- if (TEST_PROTECT()) { \ +- setUp(); \ +- testfunc(); \ +- } \ +- if (TEST_PROTECT() && (!TEST_IS_IGNORED)) \ +- tearDown(); \ +- UnityConcludeTest(); +-``` +- +-So that's quite a macro, huh? It gives you a glimpse of what kind of stuff Unity +-has to deal with for every single test case. For each test case, we declare that +-it is a new test. Then we run `setUp` and our test function. These are run +-within a `TEST_PROTECT` block, the function of which is to handle failures that +-occur during the test. Then, assuming our test is still running and hasn't been +-ignored, we run `tearDown`. No matter what, our last step is to conclude this +-test before moving on to the next. +- +-Let's say you need to add a call to `fsync` to force all of your output data to +-flush to a file after each test. You could easily insert this after your +-`UnityConcludeTest` call. Maybe you want to write an xml tag before and after +-each result set. Again, you could do this by adding lines to this macro. Updates +-to this macro are for the occasions when you need an action before or after +-every single test case throughout your entire suite of tests. +- +- +-## Happy Porting +- +-The defines and macros in this guide should help you port Unity to just about +-any C target we can imagine. If you run into a snag or two, don't be afraid of +-asking for help on the forums. We love a good challenge! +- +- +-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* +diff --git a/components/testframework/libs/cmock/vendor/unity/docs/UnityGettingStartedGuide.md b/components/testframework/libs/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +deleted file mode 100644 +index c054b3618f..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/docs/UnityGettingStartedGuide.md ++++ /dev/null +@@ -1,251 +0,0 @@ +-# Unity - Getting Started +- +-## Welcome +- +-Congratulations. You're now the proud owner of your very own pile of bits! What +-are you going to do with all these ones and zeros? This document should be able +-to help you decide just that. +- +-Unity is a unit test framework. The goal has been to keep it small and +-functional. The core Unity test framework is three files: a single C file and a +-couple header files. These team up to provide functions and macros to make +-testing easier. +- +-Unity was designed to be cross-platform. It works hard to stick with C standards +-while still providing support for the many embedded C compilers that bend the +-rules. Unity has been used with many compilers, including GCC, IAR, Clang, +-Green Hills, Microchip, and MS Visual Studio. It's not much work to get it to +-work with a new target. +- +- +-### Overview of the Documents +- +-#### Unity Assertions reference +- +-This document will guide you through all the assertion options provided by +-Unity. This is going to be your unit testing bread and butter. You'll spend more +-time with assertions than any other part of Unity. +- +- +-#### Unity Assertions Cheat Sheet +- +-This document contains an abridged summary of the assertions described in the +-previous document. It's perfect for printing and referencing while you +-familiarize yourself with Unity's options. +- +- +-#### Unity Configuration Guide +- +-This document is the one to reference when you are going to use Unity with a new +-target or compiler. It'll guide you through the configuration options and will +-help you customize your testing experience to meet your needs. +- +- +-#### Unity Helper Scripts +- +-This document describes the helper scripts that are available for simplifying +-your testing workflow. It describes the collection of optional Ruby scripts +-included in the auto directory of your Unity installation. Neither Ruby nor +-these scripts are necessary for using Unity. They are provided as a convenience +-for those who wish to use them. +- +- +-#### Unity License +- +-What's an open source project without a license file? This brief document +-describes the terms you're agreeing to when you use this software. Basically, we +-want it to be useful to you in whatever context you want to use it, but please +-don't blame us if you run into problems. +- +- +-### Overview of the Folders +- +-If you have obtained Unity through Github or something similar, you might be +-surprised by just how much stuff you suddenly have staring you in the face. +-Don't worry, Unity itself is very small. The rest of it is just there to make +-your life easier. You can ignore it or use it at your convenience. Here's an +-overview of everything in the project. +- +-- `src` - This is the code you care about! This folder contains a C file and two +-header files. These three files _are_ Unity. +-- `docs` - You're reading this document, so it's possible you have found your way +-into this folder already. This is where all the handy documentation can be +-found. +-- `examples` - This contains a few examples of using Unity. +-- `extras` - These are optional add ons to Unity that are not part of the core +-project. If you've reached us through James Grenning's book, you're going to +-want to look here. +-- `test` - This is how Unity and its scripts are all tested. If you're just using +-Unity, you'll likely never need to go in here. If you are the lucky team member +-who gets to port Unity to a new toolchain, this is a good place to verify +-everything is configured properly. +-- `auto` - Here you will find helpful Ruby scripts for simplifying your test +-workflow. They are purely optional and are not required to make use of Unity. +- +- +-## How to Create A Test File +- +-Test files are C files. Most often you will create a single test file for each C +-module that you want to test. The test file should include unity.h and the +-header for your C module to be tested. +- +-Next, a test file will include a `setUp()` and `tearDown()` function. The setUp +-function can contain anything you would like to run before each test. The +-tearDown function can contain anything you would like to run after each test. +-Both functions accept no arguments and return nothing. You may leave either or +-both of these blank if you have no need for them. +- +-If you're using Ceedling or the test runner generator script, you may leave these off +-completely. Not sure? Give it a try. If you compiler complains that it can't +-find setUp or tearDown when it links, you'll know you need to at least include +-an empty function for these. +- +-The majority of the file will be a series of test functions. Test functions +-follow the convention of starting with the word "test_" or "spec_". You don't HAVE +-to name them this way, but it makes it clear what functions are tests for other +-developers. Also, the automated scripts that come with Unity or Ceedling will default +-to looking for test functions to be prefixed this way. Test functions take no arguments +-and return nothing. All test accounting is handled internally in Unity. +- +-Finally, at the bottom of your test file, you will write a `main()` function. +-This function will call `UNITY_BEGIN()`, then `RUN_TEST` for each test, and +-finally `UNITY_END()`.This is what will actually trigger each of those test +-functions to run, so it is important that each function gets its own `RUN_TEST` +-call. +- +-Remembering to add each test to the main function can get to be tedious. If you +-enjoy using helper scripts in your build process, you might consider making use +-of our handy [generate_test_runner.rb](../auto/generate_test_runner.rb) script. +-This will create the main function and all the calls for you, assuming that you +-have followed the suggested naming conventions. In this case, there is no need +-for you to include the main function in your test file at all. +- +-When you're done, your test file will look something like this: +- +-```C +-#include "unity.h" +-#include "file_to_test.h" +- +-void setUp(void) { +- // set stuff up here +-} +- +-void tearDown(void) { +- // clean stuff up here +-} +- +-void test_function_should_doBlahAndBlah(void) { +- //test stuff +-} +- +-void test_function_should_doAlsoDoBlah(void) { +- //more test stuff +-} +- +-// not needed when using generate_test_runner.rb +-int main(void) { +- UNITY_BEGIN(); +- RUN_TEST(test_function_should_doBlahAndBlah); +- RUN_TEST(test_function_should_doAlsoDoBlah); +- return UNITY_END(); +-} +-``` +- +-It's possible that you will need more customization than this, eventually. +-For that sort of thing, you're going to want to look at the configuration guide. +-This should be enough to get you going, though. +- +-### Running Test Functions +-When writing your own `main()` functions, for a test-runner. There are two ways +-to execute the test. +- +-The classic variant +-``` c +-RUN_TEST(func, linenum) +-``` +-or its simpler replacement that starts at the beginning of the function. +-``` c +-RUN_TEST(func) +-``` +-These macros perform the necessary setup before the test is called and +-handles cleanup and result tabulation afterwards. +- +-### Ignoring Test Functions +-There are times when a test is incomplete or not valid for some reason. +-At these times, TEST_IGNORE can be called. Control will immediately be +-returned to the caller of the test, and no failures will be returned. +-This is useful when your test runners are automatically generated. +- +-``` c +-TEST_IGNORE() +-``` +- +-Ignore this test and return immediately +- +-``` c +-TEST_IGNORE_MESSAGE (message) +-``` +- +-Ignore this test and return immediately. Output a message stating why the test was ignored. +- +-### Aborting Tests +-There are times when a test will contain an infinite loop on error conditions, or there may be reason to escape from the test early without executing the rest of the test. A pair of macros support this functionality in Unity. The first `TEST_PROTECT` sets up the feature, and handles emergency abort cases. `TEST_ABORT` can then be used at any time within the tests to return to the last `TEST_PROTECT` call. +- +- TEST_PROTECT() +- +-Setup and Catch macro +- +- TEST_ABORT() +- +-Abort Test macro +- +-Example: +- +- main() +- { +- if (TEST_PROTECT()) +- { +- MyTest(); +- } +- } +- +-If MyTest calls `TEST_ABORT`, program control will immediately return to `TEST_PROTECT` with a return value of zero. +- +- +- +-## How to Build and Run A Test File +- +-This is the single biggest challenge to picking up a new unit testing framework, +-at least in a language like C or C++. These languages are REALLY good at getting +-you "close to the metal" (why is the phrase metal? Wouldn't it be more accurate +-to say "close to the silicon"?). While this feature is usually a good thing, it +-can make testing more challenging. +- +-You have two really good options for toolchains. Depending on where you're +-coming from, it might surprise you that neither of these options is running the +-unit tests on your hardware. +-There are many reasons for this, but here's a short version: +-- On hardware, you have too many constraints (processing power, memory, etc), +-- On hardware, you don't have complete control over all registers, +-- On hardware, unit testing is more challenging, +-- Unit testing isn't System testing. Keep them separate. +- +-Instead of running your tests on your actual hardware, most developers choose to +-develop them as native applications (using gcc or MSVC for example) or as +-applications running on a simulator. Either is a good option. Native apps have +-the advantages of being faster and easier to set up. Simulator apps have the +-advantage of working with the same compiler as your target application. The +-options for configuring these are discussed in the configuration guide. +- +-To get either to work, you might need to make a few changes to the file +-containing your register set (discussed later). +- +-In either case, a test is built by linking unity, the test file, and the C +-file(s) being tested. These files create an executable which can be run as the +-test set for that module. Then, this process is repeated for the next test file. +-This flexibility of separating tests into individual executables allows us to +-much more thoroughly unit test our system and it keeps all the test code out of +-our final release! +- +- +-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* +diff --git a/components/testframework/libs/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md b/components/testframework/libs/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +deleted file mode 100644 +index 46c9d74df5..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md ++++ /dev/null +@@ -1,278 +0,0 @@ +-# Unity Helper Scripts +- +-## With a Little Help From Our Friends +- +-Sometimes what it takes to be a really efficient C programmer is a little non-C. +-The Unity project includes a couple of Ruby scripts for making your life just a tad +-easier. They are completely optional. If you choose to use them, you'll need a +-copy of Ruby, of course. Just install whatever the latest version is, and it is +-likely to work. You can find Ruby at [ruby-lang.org](https://ruby-labg.org/). +- +- +-### `generate_test_runner.rb` +- +-Are you tired of creating your own `main` function in your test file? Do you +-keep forgetting to add a `RUN_TEST` call when you add a new test case to your +-suite? Do you want to use CMock or other fancy add-ons but don't want to figure +-out how to create your own `RUN_TEST` macro? +- +-Well then we have the perfect script for you! +- +-The `generate_test_runner` script processes a given test file and automatically +-creates a separate test runner file that includes ?main?to execute the test +-cases within the scanned test file. All you do then is add the generated runner +-to your list of files to be compiled and linked, and presto you're done! +- +-This script searches your test file for void function signatures having a +-function name beginning with "test" or "spec". It treats each of these +-functions as a test case and builds up a test suite of them. For example, the +-following includes three test cases: +- +-```C +-void testVerifyThatUnityIsAwesomeAndWillMakeYourLifeEasier(void) +-{ +- ASSERT_TRUE(1); +-} +-void test_FunctionName_should_WorkProperlyAndReturn8(void) { +- ASSERT_EQUAL_INT(8, FunctionName()); +-} +-void spec_Function_should_DoWhatItIsSupposedToDo(void) { +- ASSERT_NOT_NULL(Function(5)); +-} +-``` +- +-You can run this script a couple of ways. The first is from the command line: +- +-```Shell +-ruby generate_test_runner.rb TestFile.c NameOfRunner.c +-``` +- +-Alternatively, if you include only the test file parameter, the script will copy +-the name of the test file and automatically append `_Runner` to the name of the +-generated file. The example immediately below will create TestFile_Runner.c. +- +-```Shell +-ruby generate_test_runner.rb TestFile.c +-``` +- +-You can also add a [YAML](http://www.yaml.org/) file to configure extra options. +-Conveniently, this YAML file is of the same format as that used by Unity and +-CMock. So if you are using YAML files already, you can simply pass the very same +-file into the generator script. +- +-```Shell +-ruby generate_test_runner.rb TestFile.c my_config.yml +-``` +- +-The contents of the YAML file `my_config.yml` could look something like the +-example below. If you're wondering what some of these options do, you're going +-to love the next section of this document. +- +-```YAML +-:unity: +- :includes: +- - stdio.h +- - microdefs.h +- :cexception: 1 +- :suit_setup: "blah = malloc(1024);" +- :suite_teardown: "free(blah);" +-``` +- +-If you would like to force your generated test runner to include one or more +-header files, you can just include those at the command line too. Just make sure +-these are _after_ the YAML file, if you are using one: +- +-```Shell +-ruby generate_test_runner.rb TestFile.c my_config.yml extras.h +-``` +- +-Another option, particularly if you are already using Ruby to orchestrate your +-builds - or more likely the Ruby-based build tool Rake - is requiring this +-script directly. Anything that you would have specified in a YAML file can be +-passed to the script as part of a hash. Let's push the exact same requirement +-set as we did above but this time through Ruby code directly: +- +-```Ruby +-require "generate_test_runner.rb" +-options = { +- :includes => ["stdio.h", "microdefs.h"], +- :cexception => 1, +- :suite_setup => "blah = malloc(1024);", +- :suite_teardown => "free(blah);" +-} +-UnityTestRunnerGenerator.new.run(testfile, runner_name, options) +-``` +- +-If you have multiple files to generate in a build script (such as a Rakefile), +-you might want to instantiate a generator object with your options and call it +-to generate each runner afterwards. Like thus: +- +-```Ruby +-gen = UnityTestRunnerGenerator.new(options) +-test_files.each do |f| +- gen.run(f, File.basename(f,'.c')+"Runner.c" +-end +-``` +- +-#### Options accepted by generate_test_runner.rb: +- +-The following options are available when executing `generate_test_runner`. You +-may pass these as a Ruby hash directly or specify them in a YAML file, both of +-which are described above. In the `examples` directory, Example 3's Rakefile +-demonstrates using a Ruby hash. +- +- +-##### `:includes` +- +-This option specifies an array of file names to be `#include`'d at the top of +-your runner C file. You might use it to reference custom types or anything else +-universally needed in your generated runners. +- +- +-##### `:suite_setup` +- +-Define this option with C code to be executed _before any_ test cases are run. +- +-Alternatively, if your C compiler supports weak symbols, you can leave this +-option unset and instead provide a `void suiteSetUp(void)` function in your test +-suite. The linker will look for this symbol and fall back to a Unity-provided +-stub if it is not found. +- +- +-##### `:suite_teardown` +- +-Define this option with C code to be executed _after all_ test cases have +-finished. An integer variable `num_failures` is available for diagnostics. +-The code should end with a `return` statement; the value returned will become +-the exit code of `main`. You can normally just return `num_failures`. +- +-Alternatively, if your C compiler supports weak symbols, you can leave this +-option unset and instead provide a `int suiteTearDown(int num_failures)` +-function in your test suite. The linker will look for this symbol and fall +-back to a Unity-provided stub if it is not found. +- +- +-##### `:enforce_strict_ordering` +- +-This option should be defined if you have the strict order feature enabled in +-CMock (see CMock documentation). This generates extra variables required for +-everything to run smoothly. If you provide the same YAML to the generator as +-used in CMock's configuration, you've already configured the generator properly. +- +- +-##### `:externc` +- +-This option should be defined if you are mixing C and CPP and want your test +-runners to automatically include extern "C" support when they are generated. +- +-##### `:mock_prefix` and `:mock_suffix` +- +-Unity automatically generates calls to Init, Verify and Destroy for every file +-included in the main test file that starts with the given mock prefix and ends +-with the given mock suffix, file extension not included. By default, Unity +-assumes a `Mock` prefix and no suffix. +- +-##### `:plugins` +- +-This option specifies an array of plugins to be used (of course, the array can +-contain only a single plugin). This is your opportunity to enable support for +-CException support, which will add a check for unhandled exceptions in each +-test, reporting a failure if one is detected. To enable this feature using Ruby: +- +-```Ruby +-:plugins => [ :cexception ] +-``` +- +-Or as a yaml file: +- +-```YAML +-:plugins: +- -:cexception +-``` +- +-If you are using CMock, it is very likely that you are already passing an array +-of plugins to CMock. You can just use the same array here. This script will just +-ignore the plugins that don't require additional support. +- +-##### `:include_extensions` +- +-This option specifies the pattern for matching acceptable header file extensions. +-By default it will accept hpp, hh, H, and h files. If you need a different combination +-of files to search, update this from the default `'(?:hpp|hh|H|h)'`. +- +-##### `:source_extensions` +- +-This option specifies the pattern for matching acceptable source file extensions. +-By default it will accept cpp, cc, C, c, and ino files. If you need a different combination +-of files to search, update this from the default `'(?:cpp|cc|ino|C|c)'`. +- +- +-### `unity_test_summary.rb` +- +-A Unity test file contains one or more test case functions. Each test case can +-pass, fail, or be ignored. Each test file is run individually producing results +-for its collection of test cases. A given project will almost certainly be +-composed of multiple test files. Therefore, the suite of tests is comprised of +-one or more test cases spread across one or more test files. This script +-aggregates individual test file results to generate a summary of all executed +-test cases. The output includes how many tests were run, how many were ignored, +-and how many failed. In addition, the output includes a listing of which +-specific tests were ignored and failed. A good example of the breadth and +-details of these results can be found in the `examples` directory. Intentionally +-ignored and failing tests in this project generate corresponding entries in the +-summary report. +- +-If you're interested in other (prettier?) output formats, check into the +-Ceedling build tool project (ceedling.sourceforge.net) that works with Unity and +-CMock and supports xunit-style xml as well as other goodies. +- +-This script assumes the existence of files ending with the extensions +-`.testpass` and `.testfail`.The contents of these files includes the test +-results summary corresponding to each test file executed with the extension set +-according to the presence or absence of failures for that test file. The script +-searches a specified path for these files, opens each one it finds, parses the +-results, and aggregates and prints a summary. Calling it from the command line +-looks like this: +- +-```Shell +-ruby unity_test_summary.rb build/test/ +-``` +- +-You can optionally specify a root path as well. This is really helpful when you +-are using relative paths in your tools' setup, but you want to pull the summary +-into an IDE like Eclipse for clickable shortcuts. +- +-```Shell +-ruby unity_test_summary.rb build/test/ ~/projects/myproject/ +-``` +- +-Or, if you're more of a Windows sort of person: +- +-```Shell +-ruby unity_test_summary.rb build\teat\ C:\projects\myproject\ +-``` +- +-When configured correctly, you'll see a final summary, like so: +- +-```Shell +--------------------------- +-UNITY IGNORED TEST SUMMARY +--------------------------- +-blah.c:22:test_sandwiches_should_HaveBreadOnTwoSides:IGNORE +- +-------------------------- +-UNITY FAILED TEST SUMMARY +-------------------------- +-blah.c:87:test_sandwiches_should_HaveCondiments:FAIL:Expected 1 was 0 +-meh.c:38:test_soda_should_BeCalledPop:FAIL:Expected "pop" was "coke" +- +--------------------------- +-OVERALL UNITY TEST SUMMARY +--------------------------- +-45 TOTAL TESTS 2 TOTAL FAILURES 1 IGNORED +-``` +- +-How convenient is that? +- +- +-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)* +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/makefile b/components/testframework/libs/cmock/vendor/unity/examples/example_1/makefile +deleted file mode 100644 +index 28409c1042..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/makefile ++++ /dev/null +@@ -1,72 +0,0 @@ +-# ========================================== +-# 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] +-# ========================================== +- +-#We try to detect the OS we are running on, and adjust commands as needed +-ifeq ($(OS),Windows_NT) +- ifeq ($(shell uname -s),) # not in a bash-like shell +- CLEANUP = del /F /Q +- MKDIR = mkdir +- else # in a bash-like shell, like msys +- CLEANUP = rm -f +- MKDIR = mkdir -p +- endif +- TARGET_EXTENSION=.exe +-else +- CLEANUP = rm -f +- MKDIR = mkdir -p +- TARGET_EXTENSION=.out +-endif +- +-C_COMPILER=gcc +-ifeq ($(shell uname -s), Darwin) +-C_COMPILER=clang +-endif +- +-UNITY_ROOT=../.. +- +-CFLAGS=-std=c89 +-CFLAGS += -Wall +-CFLAGS += -Wextra +-CFLAGS += -Wpointer-arith +-CFLAGS += -Wcast-align +-CFLAGS += -Wwrite-strings +-CFLAGS += -Wswitch-default +-CFLAGS += -Wunreachable-code +-CFLAGS += -Winit-self +-CFLAGS += -Wmissing-field-initializers +-CFLAGS += -Wno-unknown-pragmas +-CFLAGS += -Wstrict-prototypes +-CFLAGS += -Wundef +-CFLAGS += -Wold-style-definition +-#CFLAGS += -Wno-misleading-indentation +- +-TARGET_BASE1=test1 +-TARGET_BASE2=test2 +-TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION) +-TARGET2 = $(TARGET_BASE2)$(TARGET_EXTENSION) +-SRC_FILES1=$(UNITY_ROOT)/src/unity.c src/ProductionCode.c test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c +-SRC_FILES2=$(UNITY_ROOT)/src/unity.c src/ProductionCode2.c test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c +-INC_DIRS=-Isrc -I$(UNITY_ROOT)/src +-SYMBOLS= +- +-all: clean default +- +-default: $(SRC_FILES1) $(SRC_FILES2) +- $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1) +- $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES2) -o $(TARGET2) +- - ./$(TARGET1) +- - ./$(TARGET2) +- +-test/test_runners/TestProductionCode_Runner.c: test/TestProductionCode.c +- ruby $(UNITY_ROOT)/auto/generate_test_runner.rb test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c +-test/test_runners/TestProductionCode2_Runner.c: test/TestProductionCode2.c +- ruby $(UNITY_ROOT)/auto/generate_test_runner.rb test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c +- +-clean: +- $(CLEANUP) $(TARGET1) $(TARGET2) +- +-ci: CFLAGS += -Werror +-ci: default +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/readme.txt b/components/testframework/libs/cmock/vendor/unity/examples/example_1/readme.txt +deleted file mode 100644 +index dfed815022..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/readme.txt ++++ /dev/null +@@ -1,5 +0,0 @@ +-Example 1 +-========= +- +-Close to the simplest possible example of Unity, using only basic features. +-Run make to build & run the example tests. +\ No newline at end of file +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.c +deleted file mode 100644 +index db128e5bd7..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.c ++++ /dev/null +@@ -1,24 +0,0 @@ +- +-#include "ProductionCode.h" +- +-int Counter = 0; +-int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; /* some obnoxious array to search that is 1-based indexing instead of 0. */ +- +-/* This function is supposed to search through NumbersToFind and find a particular number. +- * If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since +- * NumbersToFind is indexed from 1. Unfortunately it's broken +- * (and should therefore be caught by our tests) */ +-int FindFunction_WhichIsBroken(int NumberToFind) +-{ +- int i = 0; +- while (i < 8) /* Notice I should have been in braces */ +- i++; +- if (NumbersToFind[i] == NumberToFind) /* Yikes! I'm getting run after the loop finishes instead of during it! */ +- return i; +- return 0; +-} +- +-int FunctionWhichReturnsLocalVariable(void) +-{ +- return Counter; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.h b/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.h +deleted file mode 100644 +index 250ca0dc6f..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode.h ++++ /dev/null +@@ -1,3 +0,0 @@ +- +-int FindFunction_WhichIsBroken(int NumberToFind); +-int FunctionWhichReturnsLocalVariable(void); +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c +deleted file mode 100644 +index 98ee7eebc0..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c ++++ /dev/null +@@ -1,11 +0,0 @@ +- +-#include "ProductionCode2.h" +- +-char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) +-{ +- (void)Poor; +- (void)LittleFunction; +- /* Since There Are No Tests Yet, This Function Could Be Empty For All We Know. +- * Which isn't terribly useful... but at least we put in a TEST_IGNORE so we won't forget */ +- return (char*)0; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h b/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h +deleted file mode 100644 +index 34ae980d18..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h ++++ /dev/null +@@ -1,2 +0,0 @@ +- +-char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c +deleted file mode 100644 +index 404c371843..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c ++++ /dev/null +@@ -1,62 +0,0 @@ +- +-#include "ProductionCode.h" +-#include "unity.h" +- +-/* sometimes you may want to get at local data in a module. +- * for example: If you plan to pass by reference, this could be useful +- * however, it should often be avoided */ +-extern int Counter; +- +-void setUp(void) +-{ +- /* This is run before EACH TEST */ +- Counter = 0x5a5a; +-} +- +-void tearDown(void) +-{ +-} +- +-void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void) +-{ +- /* All of these should pass */ +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(78)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(2)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(33)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(999)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(-1)); +-} +- +-void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void) +-{ +- /* You should see this line fail in your test summary */ +- TEST_ASSERT_EQUAL(1, FindFunction_WhichIsBroken(34)); +- +- /* Notice the rest of these didn't get a chance to run because the line above failed. +- * Unit tests abort each test function on the first sign of trouble. +- * Then NEXT test function runs as normal. */ +- TEST_ASSERT_EQUAL(8, FindFunction_WhichIsBroken(8888)); +-} +- +-void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void) +-{ +- /* This should be true because setUp set this up for us before this test */ +- TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); +- +- /* This should be true because we can still change our answer */ +- Counter = 0x1234; +- TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); +-} +- +-void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void) +-{ +- /* This should be true again because setup was rerun before this test (and after we changed it to 0x1234) */ +- TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); +-} +- +-void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void) +-{ +- /* Sometimes you get the test wrong. When that happens, you get a failure too... and a quick look should tell +- * you what actually happened...which in this case was a failure to setup the initial condition. */ +- TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c +deleted file mode 100644 +index 7d940c171c..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c ++++ /dev/null +@@ -1,31 +0,0 @@ +- +-#include "ProductionCode2.h" +-#include "unity.h" +- +-/* These should be ignored because they are commented out in various ways: +-#include "whatever.h" +-#include "somethingelse.h" +-*/ +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void test_IgnoredTest(void) +-{ +- TEST_IGNORE_MESSAGE("This Test Was Ignored On Purpose"); +-} +- +-void test_AnotherIgnoredTest(void) +-{ +- TEST_IGNORE_MESSAGE("These Can Be Useful For Leaving Yourself Notes On What You Need To Do Yet"); +-} +- +-void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void) +-{ +- TEST_IGNORE(); /* Like This */ +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +deleted file mode 100644 +index cf72c219d2..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c ++++ /dev/null +@@ -1,53 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT()) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "ProductionCode2.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_IgnoredTest(void); +-extern void test_AnotherIgnoredTest(void); +-extern void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void); +- +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("test/TestProductionCode2.c"); +- RUN_TEST(test_IgnoredTest, 18); +- RUN_TEST(test_AnotherIgnoredTest, 23); +- RUN_TEST(test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented, 28); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +deleted file mode 100644 +index 3b49af748c..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c ++++ /dev/null +@@ -1,57 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT()) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "ProductionCode.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void); +-extern void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void); +-extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void); +-extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void); +-extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void); +- +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("test/TestProductionCode.c"); +- RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode, 20); +- RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken, 30); +- RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue, 41); +- RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain, 51); +- RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed, 57); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/makefile b/components/testframework/libs/cmock/vendor/unity/examples/example_2/makefile +deleted file mode 100644 +index e2832173b2..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/makefile ++++ /dev/null +@@ -1,71 +0,0 @@ +-# ========================================== +-# 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] +-# ========================================== +- +-#We try to detect the OS we are running on, and adjust commands as needed +-ifeq ($(OS),Windows_NT) +- ifeq ($(shell uname -s),) # not in a bash-like shell +- CLEANUP = del /F /Q +- MKDIR = mkdir +- else # in a bash-like shell, like msys +- CLEANUP = rm -f +- MKDIR = mkdir -p +- endif +- TARGET_EXTENSION=.exe +-else +- CLEANUP = rm -f +- MKDIR = mkdir -p +- TARGET_EXTENSION=.out +-endif +- +-C_COMPILER=gcc +-ifeq ($(shell uname -s), Darwin) +-C_COMPILER=clang +-endif +- +-UNITY_ROOT=../.. +- +-CFLAGS=-std=c99 +-CFLAGS += -Wall +-CFLAGS += -Wextra +-CFLAGS += -Wpointer-arith +-CFLAGS += -Wcast-align +-CFLAGS += -Wwrite-strings +-CFLAGS += -Wswitch-default +-CFLAGS += -Wunreachable-code +-CFLAGS += -Winit-self +-CFLAGS += -Wmissing-field-initializers +-CFLAGS += -Wno-unknown-pragmas +-CFLAGS += -Wstrict-prototypes +-CFLAGS += -Wundef +-CFLAGS += -Wold-style-definition +-#CFLAGS += -Wno-misleading-indentation +- +-TARGET_BASE1=all_tests +-TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION) +-SRC_FILES1=\ +- $(UNITY_ROOT)/src/unity.c \ +- $(UNITY_ROOT)/extras/fixture/src/unity_fixture.c \ +- src/ProductionCode.c \ +- src/ProductionCode2.c \ +- test/TestProductionCode.c \ +- test/TestProductionCode2.c \ +- test/test_runners/TestProductionCode_Runner.c \ +- test/test_runners/TestProductionCode2_Runner.c \ +- test/test_runners/all_tests.c +-INC_DIRS=-Isrc -I$(UNITY_ROOT)/src -I$(UNITY_ROOT)/extras/fixture/src +-SYMBOLS=-DUNITY_FIXTURE_NO_EXTRAS +- +-all: clean default +- +-default: +- $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1) +- - ./$(TARGET1) -v +- +-clean: +- $(CLEANUP) $(TARGET1) +- +-ci: CFLAGS += -Werror +-ci: default +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/readme.txt b/components/testframework/libs/cmock/vendor/unity/examples/example_2/readme.txt +deleted file mode 100644 +index f0fce657cf..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/readme.txt ++++ /dev/null +@@ -1,5 +0,0 @@ +-Example 2 +-========= +- +-Same as the first example, but now using Unity's test fixture to group tests +-together. Using the test fixture also makes writing test runners much easier. +\ No newline at end of file +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.c +deleted file mode 100644 +index 3bafe20563..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.c ++++ /dev/null +@@ -1,24 +0,0 @@ +- +-#include "ProductionCode.h" +- +-int Counter = 0; +-int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; //some obnoxious array to search that is 1-based indexing instead of 0. +- +-// This function is supposed to search through NumbersToFind and find a particular number. +-// If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since +-// NumbersToFind is indexed from 1. Unfortunately it's broken +-// (and should therefore be caught by our tests) +-int FindFunction_WhichIsBroken(int NumberToFind) +-{ +- int i = 0; +- while (i < 8) //Notice I should have been in braces +- i++; +- if (NumbersToFind[i] == NumberToFind) //Yikes! I'm getting run after the loop finishes instead of during it! +- return i; +- return 0; +-} +- +-int FunctionWhichReturnsLocalVariable(void) +-{ +- return Counter; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.h b/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.h +deleted file mode 100644 +index 250ca0dc6f..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode.h ++++ /dev/null +@@ -1,3 +0,0 @@ +- +-int FindFunction_WhichIsBroken(int NumberToFind); +-int FunctionWhichReturnsLocalVariable(void); +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c +deleted file mode 100644 +index 77c969f174..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c ++++ /dev/null +@@ -1,11 +0,0 @@ +- +-#include "ProductionCode2.h" +- +-char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) +-{ +- (void)Poor; +- (void)LittleFunction; +- //Since There Are No Tests Yet, This Function Could Be Empty For All We Know. +- // Which isn't terribly useful... but at least we put in a TEST_IGNORE so we won't forget +- return (char*)0; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h b/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h +deleted file mode 100644 +index 34ae980d18..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h ++++ /dev/null +@@ -1,2 +0,0 @@ +- +-char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c +deleted file mode 100644 +index b8fb95c08d..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c ++++ /dev/null +@@ -1,64 +0,0 @@ +-#include "ProductionCode.h" +-#include "unity.h" +-#include "unity_fixture.h" +- +-TEST_GROUP(ProductionCode); +- +-//sometimes you may want to get at local data in a module. +-//for example: If you plan to pass by reference, this could be useful +-//however, it should often be avoided +-extern int Counter; +- +-TEST_SETUP(ProductionCode) +-{ +- //This is run before EACH TEST +- Counter = 0x5a5a; +-} +- +-TEST_TEAR_DOWN(ProductionCode) +-{ +-} +- +-TEST(ProductionCode, FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode) +-{ +- //All of these should pass +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(78)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(2)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(33)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(999)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(-1)); +-} +- +-TEST(ProductionCode, FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken) +-{ +- // You should see this line fail in your test summary +- TEST_ASSERT_EQUAL(1, FindFunction_WhichIsBroken(34)); +- +- // Notice the rest of these didn't get a chance to run because the line above failed. +- // Unit tests abort each test function on the first sign of trouble. +- // Then NEXT test function runs as normal. +- TEST_ASSERT_EQUAL(8, FindFunction_WhichIsBroken(8888)); +-} +- +-TEST(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue) +-{ +- //This should be true because setUp set this up for us before this test +- TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); +- +- //This should be true because we can still change our answer +- Counter = 0x1234; +- TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); +-} +- +-TEST(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain) +-{ +- //This should be true again because setup was rerun before this test (and after we changed it to 0x1234) +- TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); +-} +- +-TEST(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed) +-{ +- //Sometimes you get the test wrong. When that happens, you get a failure too... and a quick look should tell +- // you what actually happened...which in this case was a failure to setup the initial condition. +- TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c +deleted file mode 100644 +index d9f4efe318..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c ++++ /dev/null +@@ -1,33 +0,0 @@ +-#include "ProductionCode2.h" +-#include "unity.h" +-#include "unity_fixture.h" +- +-TEST_GROUP(ProductionCode2); +- +-/* These should be ignored because they are commented out in various ways: +-#include "whatever.h" +-*/ +-//#include "somethingelse.h" +- +-TEST_SETUP(ProductionCode2) +-{ +-} +- +-TEST_TEAR_DOWN(ProductionCode2) +-{ +-} +- +-TEST(ProductionCode2, IgnoredTest) +-{ +- TEST_IGNORE_MESSAGE("This Test Was Ignored On Purpose"); +-} +- +-TEST(ProductionCode2, AnotherIgnoredTest) +-{ +- TEST_IGNORE_MESSAGE("These Can Be Useful For Leaving Yourself Notes On What You Need To Do Yet"); +-} +- +-TEST(ProductionCode2, ThisFunctionHasNotBeenTested_NeedsToBeImplemented) +-{ +- TEST_IGNORE(); //Like This +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +deleted file mode 100644 +index 6fcc3b1204..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c ++++ /dev/null +@@ -1,9 +0,0 @@ +-#include "unity.h" +-#include "unity_fixture.h" +- +-TEST_GROUP_RUNNER(ProductionCode2) +-{ +- RUN_TEST_CASE(ProductionCode2, IgnoredTest); +- RUN_TEST_CASE(ProductionCode2, AnotherIgnoredTest); +- RUN_TEST_CASE(ProductionCode2, ThisFunctionHasNotBeenTested_NeedsToBeImplemented); +-} +\ No newline at end of file +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +deleted file mode 100644 +index 41a416a6e0..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c ++++ /dev/null +@@ -1,11 +0,0 @@ +-#include "unity.h" +-#include "unity_fixture.h" +- +-TEST_GROUP_RUNNER(ProductionCode) +-{ +- RUN_TEST_CASE(ProductionCode, FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode); +- RUN_TEST_CASE(ProductionCode, FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken); +- RUN_TEST_CASE(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue); +- RUN_TEST_CASE(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain); +- RUN_TEST_CASE(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed); +-} +\ No newline at end of file +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c b/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c +deleted file mode 100644 +index e706ece7d0..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c ++++ /dev/null +@@ -1,12 +0,0 @@ +-#include "unity_fixture.h" +- +-static void RunAllTests(void) +-{ +- RUN_TEST_GROUP(ProductionCode); +- RUN_TEST_GROUP(ProductionCode2); +-} +- +-int main(int argc, const char * argv[]) +-{ +- return UnityMain(argc, argv, RunAllTests); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c b/components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c +deleted file mode 100644 +index 9cf42c6784..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c ++++ /dev/null +@@ -1,10 +0,0 @@ +-#include "unity.h" +-#include "UnityHelper.h" +-#include +-#include +- +-void AssertEqualExampleStruct(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line) +-{ +- UNITY_TEST_ASSERT_EQUAL_INT(expected.x, actual.x, line, "Example Struct Failed For Field x"); +- UNITY_TEST_ASSERT_EQUAL_INT(expected.y, actual.y, line, "Example Struct Failed For Field y"); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h b/components/testframework/libs/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h +deleted file mode 100644 +index 151611158a..0000000000 +--- a/components/testframework/libs/cmock/vendor/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/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile.rb b/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile.rb +deleted file mode 100644 +index c095af38ef..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile.rb ++++ /dev/null +@@ -1,38 +0,0 @@ +-require 'rake' +-require 'rake/clean' +-require_relative 'rakefile_helper' +- +-TEMP_DIRS = [ +- File.join(__dir__, 'build') +-].freeze +- +-TEMP_DIRS.each do |dir| +- directory(dir) +- CLOBBER.include(dir) +-end +- +-task prepare_for_tests: TEMP_DIRS +- +-# Load default configuration, for now +-DEFAULT_CONFIG_FILE = 'target_gcc_32.yml'.freeze +-configure_toolchain(DEFAULT_CONFIG_FILE) +- +-task unit: [:prepare_for_tests] do +- run_tests unit_test_files +-end +- +-desc 'Generate test summary' +-task :summary do +- report_summary +-end +- +-desc 'Build and test Unity' +-task all: %i[clean unit summary] +-task default: %i[clobber all] +-task ci: [:default] +-task cruise: [:default] +- +-desc 'Load configuration' +-task :config, :config_file do |_t, args| +- configure_toolchain(args[:config_file]) +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile_helper.rb b/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +deleted file mode 100644 +index 64d20c95f0..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/rakefile_helper.rb ++++ /dev/null +@@ -1,250 +0,0 @@ +-require 'yaml' +-require 'fileutils' +-require_relative '../../auto/unity_test_summary' +-require_relative '../../auto/generate_test_runner' +-require_relative '../../auto/colour_reporter' +- +-C_EXTENSION = '.c'.freeze +- +-def load_configuration(config_file) +- $cfg_file = config_file +- $cfg = YAML.load(File.read($cfg_file)) +-end +- +-def configure_clean +- CLEAN.include($cfg['compiler']['build_path'] + '*.*') unless $cfg['compiler']['build_path'].nil? +-end +- +-def configure_toolchain(config_file = DEFAULT_CONFIG_FILE) +- config_file += '.yml' unless config_file =~ /\.yml$/ +- load_configuration(config_file) +- configure_clean +-end +- +-def unit_test_files +- path = $cfg['compiler']['unit_tests_path'] + 'Test*' + C_EXTENSION +- path.tr!('\\', '/') +- FileList.new(path) +-end +- +-def local_include_dirs +- include_dirs = $cfg['compiler']['includes']['items'].dup +- include_dirs.delete_if { |dir| dir.is_a?(Array) } +- include_dirs +-end +- +-def extract_headers(filename) +- includes = [] +- lines = File.readlines(filename) +- lines.each do |line| +- m = line.match(/^\s*#include\s+\"\s*(.+\.[hH])\s*\"/) +- includes << m[1] unless m.nil? +- end +- includes +-end +- +-def find_source_file(header, paths) +- paths.each do |dir| +- src_file = dir + header.ext(C_EXTENSION) +- return src_file if File.exist?(src_file) +- end +- nil +-end +- +-def tackit(strings) +- result = if strings.is_a?(Array) +- "\"#{strings.join}\"" +- else +- strings +- end +- result +-end +- +-def squash(prefix, items) +- result = '' +- items.each { |item| result += " #{prefix}#{tackit(item)}" } +- result +-end +- +-def build_compiler_fields +- command = tackit($cfg['compiler']['path']) +- defines = if $cfg['compiler']['defines']['items'].nil? +- '' +- else +- squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items']) +- end +- options = squash('', $cfg['compiler']['options']) +- includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items']) +- includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) +- +- { command: command, defines: defines, options: options, includes: includes } +-end +- +-def compile(file, _defines = []) +- compiler = build_compiler_fields +- cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{compiler[:options]}#{compiler[:includes]} #{file} " \ +- "#{$cfg['compiler']['object_files']['prefix']}#{$cfg['compiler']['object_files']['destination']}" +- obj_file = "#{File.basename(file, C_EXTENSION)}#{$cfg['compiler']['object_files']['extension']}" +- execute(cmd_str + obj_file) +- obj_file +-end +- +-def build_linker_fields +- command = tackit($cfg['linker']['path']) +- options = if $cfg['linker']['options'].nil? +- '' +- else +- squash('', $cfg['linker']['options']) +- end +- includes = if $cfg['linker']['includes'].nil? || $cfg['linker']['includes']['items'].nil? +- '' +- else +- squash($cfg['linker']['includes']['prefix'], $cfg['linker']['includes']['items']) +- end.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR) +- +- { command: command, options: options, includes: includes } +-end +- +-def link_it(exe_name, obj_list) +- linker = build_linker_fields +- cmd_str = "#{linker[:command]}#{linker[:options]}#{linker[:includes]} " + +- (obj_list.map { |obj| "#{$cfg['linker']['object_files']['path']}#{obj} " }).join + +- $cfg['linker']['bin_files']['prefix'] + ' ' + +- $cfg['linker']['bin_files']['destination'] + +- exe_name + $cfg['linker']['bin_files']['extension'] +- execute(cmd_str) +-end +- +-def build_simulator_fields +- return nil if $cfg['simulator'].nil? +- +- command = if $cfg['simulator']['path'].nil? +- '' +- else +- (tackit($cfg['simulator']['path']) + ' ') +- end +- pre_support = if $cfg['simulator']['pre_support'].nil? +- '' +- else +- squash('', $cfg['simulator']['pre_support']) +- end +- post_support = if $cfg['simulator']['post_support'].nil? +- '' +- else +- squash('', $cfg['simulator']['post_support']) +- end +- +- { command: command, pre_support: pre_support, post_support: post_support } +-end +- +-def execute(command_string, verbose = true, raise_on_fail = true) +- report command_string +- output = `#{command_string}`.chomp +- report(output) if verbose && !output.nil? && !output.empty? +- +- if !$?.nil? && !$?.exitstatus.zero? && raise_on_fail +- raise "Command failed. (Returned #{$?.exitstatus})" +- end +- +- output +-end +- +-def report_summary +- summary = UnityTestSummary.new +- summary.root = __dir__ +- results_glob = "#{$cfg['compiler']['build_path']}*.test*" +- results_glob.tr!('\\', '/') +- results = Dir[results_glob] +- summary.targets = results +- summary.run +- fail_out 'FAIL: There were failures' if summary.failures > 0 +-end +- +-def run_tests(test_files) +- report 'Running system tests...' +- +- # Tack on TEST define for compiling unit tests +- load_configuration($cfg_file) +- test_defines = ['TEST'] +- $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? +- $cfg['compiler']['defines']['items'] << 'TEST' +- +- include_dirs = local_include_dirs +- +- # Build and execute each unit test +- test_files.each do |test| +- obj_list = [] +- +- # Detect dependencies and build required required modules +- extract_headers(test).each do |header| +- # Compile corresponding source file if it exists +- src_file = find_source_file(header, include_dirs) +- obj_list << compile(src_file, test_defines) unless src_file.nil? +- end +- +- # Build the test runner (generate if configured to do so) +- test_base = File.basename(test, C_EXTENSION) +- runner_name = test_base + '_Runner.c' +- if $cfg['compiler']['runner_path'].nil? +- runner_path = $cfg['compiler']['build_path'] + runner_name +- test_gen = UnityTestRunnerGenerator.new($cfg_file) +- test_gen.run(test, runner_path) +- else +- runner_path = $cfg['compiler']['runner_path'] + runner_name +- end +- +- obj_list << compile(runner_path, test_defines) +- +- # Build the test module +- obj_list << compile(test, test_defines) +- +- # Link the test executable +- link_it(test_base, obj_list) +- +- # Execute unit test and generate results file +- simulator = build_simulator_fields +- executable = $cfg['linker']['bin_files']['destination'] + test_base + $cfg['linker']['bin_files']['extension'] +- cmd_str = if simulator.nil? +- executable +- else +- "#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}" +- end +- output = execute(cmd_str, true, false) +- test_results = $cfg['compiler']['build_path'] + test_base +- test_results += if output.match(/OK$/m).nil? +- '.testfail' +- else +- '.testpass' +- end +- File.open(test_results, 'w') { |f| f.print output } +- end +-end +- +-def build_application(main) +- report 'Building application...' +- +- obj_list = [] +- load_configuration($cfg_file) +- main_path = $cfg['compiler']['source_path'] + main + C_EXTENSION +- +- # Detect dependencies and build required required modules +- include_dirs = get_local_include_dirs +- extract_headers(main_path).each do |header| +- src_file = find_source_file(header, include_dirs) +- obj_list << compile(src_file) unless src_file.nil? +- end +- +- # Build the main source file +- main_base = File.basename(main_path, C_EXTENSION) +- obj_list << compile(main_path) +- +- # Create the executable +- link_it(main_base, obj_list) +-end +- +-def fail_out(msg) +- puts msg +- puts 'Not returning exit code so continuous integration can pass' +- # exit(-1) # Only removed to pass example_3, which has failing tests on purpose. +- # Still fail if the build fails for any other reason. +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/readme.txt b/components/testframework/libs/cmock/vendor/unity/examples/example_3/readme.txt +deleted file mode 100644 +index 7371fea05a..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/readme.txt ++++ /dev/null +@@ -1,13 +0,0 @@ +-Example 3 +-========= +- +-This example project gives an example of some passing, ignored, and failing tests. +-It's simple and meant for you to look over and get an idea for what all of this stuff does. +- +-You can build and test using rake. The rake version will let you test with gcc or a couple +-versions of IAR. You can tweak the yaml files to get those versions running. +- +-Ruby is required if you're using the rake version (obviously). This version shows off most of +-Unity's advanced features (automatically creating test runners, fancy summaries, etc.) +-Without ruby, you have to maintain your own test runners. Do that for a while and you'll learn +-why you really want to start using the Ruby tools. +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.c +deleted file mode 100644 +index 3bafe20563..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.c ++++ /dev/null +@@ -1,24 +0,0 @@ +- +-#include "ProductionCode.h" +- +-int Counter = 0; +-int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; //some obnoxious array to search that is 1-based indexing instead of 0. +- +-// This function is supposed to search through NumbersToFind and find a particular number. +-// If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since +-// NumbersToFind is indexed from 1. Unfortunately it's broken +-// (and should therefore be caught by our tests) +-int FindFunction_WhichIsBroken(int NumberToFind) +-{ +- int i = 0; +- while (i < 8) //Notice I should have been in braces +- i++; +- if (NumbersToFind[i] == NumberToFind) //Yikes! I'm getting run after the loop finishes instead of during it! +- return i; +- return 0; +-} +- +-int FunctionWhichReturnsLocalVariable(void) +-{ +- return Counter; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.h b/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.h +deleted file mode 100644 +index 250ca0dc6f..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode.h ++++ /dev/null +@@ -1,3 +0,0 @@ +- +-int FindFunction_WhichIsBroken(int NumberToFind); +-int FunctionWhichReturnsLocalVariable(void); +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c +deleted file mode 100644 +index 77c969f174..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c ++++ /dev/null +@@ -1,11 +0,0 @@ +- +-#include "ProductionCode2.h" +- +-char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) +-{ +- (void)Poor; +- (void)LittleFunction; +- //Since There Are No Tests Yet, This Function Could Be Empty For All We Know. +- // Which isn't terribly useful... but at least we put in a TEST_IGNORE so we won't forget +- return (char*)0; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h b/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h +deleted file mode 100644 +index 34ae980d18..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h ++++ /dev/null +@@ -1,2 +0,0 @@ +- +-char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/target_gcc_32.yml b/components/testframework/libs/cmock/vendor/unity/examples/example_3/target_gcc_32.yml +deleted file mode 100644 +index d7568ab816..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/target_gcc_32.yml ++++ /dev/null +@@ -1,47 +0,0 @@ +-# Copied from ~Unity/targets/gcc_32.yml +-unity_root: &unity_root '../..' +-unity_source: &unity_source '../../src/' +-compiler: +- path: gcc +- source_path: &source_path 'src/' +- unit_tests_path: &unit_tests_path 'test/' +- build_path: &build_path 'build/' +- options: +- - '-c' +- - '-m32' +- - '-Wall' +- - '-Wno-address' +- - '-std=c99' +- - '-pedantic' +- includes: +- prefix: '-I' +- items: +- - *source_path +- - *unity_source +- - *unit_tests_path +- defines: +- prefix: '-D' +- items: +- - UNITY_INCLUDE_DOUBLE +- - UNITY_SUPPORT_TEST_CASES +- object_files: +- prefix: '-o' +- extension: '.o' +- destination: *build_path +-linker: +- path: gcc +- options: +- - -lm +- - '-m32' +- includes: +- prefix: '-I' +- object_files: +- path: *build_path +- extension: '.o' +- bin_files: +- prefix: '-o' +- extension: '.exe' +- destination: *build_path +-colour: true +-:unity: +- :plugins: [] +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c +deleted file mode 100644 +index 28a55812cf..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c ++++ /dev/null +@@ -1,62 +0,0 @@ +- +-#include "ProductionCode.h" +-#include "unity.h" +- +-//sometimes you may want to get at local data in a module. +-//for example: If you plan to pass by reference, this could be useful +-//however, it should often be avoided +-extern int Counter; +- +-void setUp(void) +-{ +- //This is run before EACH TEST +- Counter = 0x5a5a; +-} +- +-void tearDown(void) +-{ +-} +- +-void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void) +-{ +- //All of these should pass +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(78)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(1)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(33)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(999)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(-1)); +-} +- +-void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void) +-{ +- // You should see this line fail in your test summary +- TEST_ASSERT_EQUAL(1, FindFunction_WhichIsBroken(34)); +- +- // Notice the rest of these didn't get a chance to run because the line above failed. +- // Unit tests abort each test function on the first sign of trouble. +- // Then NEXT test function runs as normal. +- TEST_ASSERT_EQUAL(8, FindFunction_WhichIsBroken(8888)); +-} +- +-void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void) +-{ +- //This should be true because setUp set this up for us before this test +- TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); +- +- //This should be true because we can still change our answer +- Counter = 0x1234; +- TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); +-} +- +-void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void) +-{ +- //This should be true again because setup was rerun before this test (and after we changed it to 0x1234) +- TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); +-} +- +-void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void) +-{ +- //Sometimes you get the test wrong. When that happens, you get a failure too... and a quick look should tell +- // you what actually happened...which in this case was a failure to setup the initial condition. +- TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c +deleted file mode 100644 +index e2119cc381..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c ++++ /dev/null +@@ -1,31 +0,0 @@ +- +-#include "ProductionCode2.h" +-#include "unity.h" +- +-/* These should be ignored because they are commented out in various ways: +-#include "whatever.h" +-*/ +-//#include "somethingelse.h" +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void test_IgnoredTest(void) +-{ +- TEST_IGNORE_MESSAGE("This Test Was Ignored On Purpose"); +-} +- +-void test_AnotherIgnoredTest(void) +-{ +- TEST_IGNORE_MESSAGE("These Can Be Useful For Leaving Yourself Notes On What You Need To Do Yet"); +-} +- +-void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void) +-{ +- TEST_IGNORE(); //Like This +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/meson.build b/components/testframework/libs/cmock/vendor/unity/examples/example_4/meson.build +deleted file mode 100644 +index f06c3fe3aa..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/meson.build ++++ /dev/null +@@ -1,12 +0,0 @@ +-# +-# build script written by : Michael Brockus. +-# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. +-# +-# license: MIT +-# +-project('example-4', 'c') +- +-unity_dep = dependency('unity', fallback : ['unity', 'unity_dep']) +- +-subdir('src') +-subdir('test') +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/readme.txt b/components/testframework/libs/cmock/vendor/unity/examples/example_4/readme.txt +deleted file mode 100644 +index c8f45a8174..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/readme.txt ++++ /dev/null +@@ -1,15 +0,0 @@ +-Example 4 +-========= +- +-Close to the simplest possible example of Unity, using only basic features. +-to build this example run "meson setup ". +- +-Meson uses the Ninja build system to actually build the code. To start the +-build, simply type the following command. +- +-"ninja -C " +- +-Meson provides native support for running tests. The command to do that is simple. +- +-"meson test -C ". +- +\ No newline at end of file +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.c +deleted file mode 100644 +index db128e5bd7..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.c ++++ /dev/null +@@ -1,24 +0,0 @@ +- +-#include "ProductionCode.h" +- +-int Counter = 0; +-int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; /* some obnoxious array to search that is 1-based indexing instead of 0. */ +- +-/* This function is supposed to search through NumbersToFind and find a particular number. +- * If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since +- * NumbersToFind is indexed from 1. Unfortunately it's broken +- * (and should therefore be caught by our tests) */ +-int FindFunction_WhichIsBroken(int NumberToFind) +-{ +- int i = 0; +- while (i < 8) /* Notice I should have been in braces */ +- i++; +- if (NumbersToFind[i] == NumberToFind) /* Yikes! I'm getting run after the loop finishes instead of during it! */ +- return i; +- return 0; +-} +- +-int FunctionWhichReturnsLocalVariable(void) +-{ +- return Counter; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.h b/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.h +deleted file mode 100644 +index 250ca0dc6f..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode.h ++++ /dev/null +@@ -1,3 +0,0 @@ +- +-int FindFunction_WhichIsBroken(int NumberToFind); +-int FunctionWhichReturnsLocalVariable(void); +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.c +deleted file mode 100644 +index 98ee7eebc0..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.c ++++ /dev/null +@@ -1,11 +0,0 @@ +- +-#include "ProductionCode2.h" +- +-char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) +-{ +- (void)Poor; +- (void)LittleFunction; +- /* Since There Are No Tests Yet, This Function Could Be Empty For All We Know. +- * Which isn't terribly useful... but at least we put in a TEST_IGNORE so we won't forget */ +- return (char*)0; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.h b/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.h +deleted file mode 100644 +index 34ae980d18..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/ProductionCode2.h ++++ /dev/null +@@ -1,2 +0,0 @@ +- +-char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction); +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/meson.build b/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/meson.build +deleted file mode 100644 +index 10c5735bef..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/src/meson.build ++++ /dev/null +@@ -1,16 +0,0 @@ +-# +-# build script written by : Michael Brockus. +-# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. +-# +-# license: MIT +-# +-inc_dir = include_directories('.') +-lib_list = {'a': ['ProductionCode.c' ], 'b': ['ProductionCode2.c']} +- +-foreach lib, src : lib_list +- set_variable(lib + '_lib', +- static_library(lib + '_lib', sources: src, include_directories: inc_dir)) +-endforeach +- +-a_dep = declare_dependency(link_with: a_lib, include_directories: inc_dir) +-b_dep = declare_dependency(link_with: b_lib, include_directories: inc_dir) +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/subprojects/unity.wrap b/components/testframework/libs/cmock/vendor/unity/examples/example_4/subprojects/unity.wrap +deleted file mode 100755 +index f2e54c84df..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/subprojects/unity.wrap ++++ /dev/null +@@ -1,4 +0,0 @@ +-[wrap-git] +-directory = unity +-url = https://github.com/ThrowTheSwitch/Unity.git +-revision = head +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode.c +deleted file mode 100644 +index 526a84eb9a..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode.c ++++ /dev/null +@@ -1,63 +0,0 @@ +- +-#include "ProductionCode.h" +-#include "unity.h" +- +-/* sometimes you may want to get at local data in a module. +- * for example: If you plan to pass by reference, this could be useful +- * however, it should often be avoided */ +-extern int Counter; +- +-void setUp(void) +-{ +- /* This is run before EACH TEST */ +- Counter = 0x5a5a; +-} +- +-void tearDown(void) +-{ +-} +- +- +-void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void) +-{ +- /* All of these should pass */ +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(78)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(2)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(33)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(999)); +- TEST_ASSERT_EQUAL(0, FindFunction_WhichIsBroken(-1)); +-} +- +-void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void) +-{ +- /* You should see this line fail in your test summary */ +- TEST_ASSERT_EQUAL(1, FindFunction_WhichIsBroken(34)); +- +- /* Notice the rest of these didn't get a chance to run because the line above failed. +- * Unit tests abort each test function on the first sign of trouble. +- * Then NEXT test function runs as normal. */ +- TEST_ASSERT_EQUAL(8, FindFunction_WhichIsBroken(8888)); +-} +- +-void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void) +-{ +- /* This should be true because setUp set this up for us before this test */ +- TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); +- +- /* This should be true because we can still change our answer */ +- Counter = 0x1234; +- TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); +-} +- +-void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void) +-{ +- /* This should be true again because setup was rerun before this test (and after we changed it to 0x1234) */ +- TEST_ASSERT_EQUAL_HEX(0x5a5a, FunctionWhichReturnsLocalVariable()); +-} +- +-void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void) +-{ +- /* Sometimes you get the test wrong. When that happens, you get a failure too... and a quick look should tell +- * you what actually happened...which in this case was a failure to setup the initial condition. */ +- TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode2.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode2.c +deleted file mode 100644 +index 2578ca94e5..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/TestProductionCode2.c ++++ /dev/null +@@ -1,35 +0,0 @@ +- +-#include "ProductionCode2.h" +-#include "unity.h" +- +-/* These should be ignored because they are commented out in various ways: +-#include "whatever.h" +-#include "somethingelse.h" +-*/ +- +-void setUp(void) +-{ +-} +- +-void tearDown(void) +-{ +-} +- +-void test_IgnoredTest(void); +-void test_AnotherIgnoredTest(void); +-void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void); +- +-void test_IgnoredTest(void) +-{ +- TEST_IGNORE_MESSAGE("This Test Was Ignored On Purpose"); +-} +- +-void test_AnotherIgnoredTest(void) +-{ +- TEST_IGNORE_MESSAGE("These Can Be Useful For Leaving Yourself Notes On What You Need To Do Yet"); +-} +- +-void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void) +-{ +- TEST_IGNORE(); /* Like This */ +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/meson.build b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/meson.build +deleted file mode 100644 +index 0e3c72f5c9..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/meson.build ++++ /dev/null +@@ -1,7 +0,0 @@ +-# +-# build script written by : Michael Brockus. +-# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. +-# +-# license: MIT +-# +-subdir('test_runners') +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c +deleted file mode 100644 +index cf72c219d2..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c ++++ /dev/null +@@ -1,53 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT()) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "ProductionCode2.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_IgnoredTest(void); +-extern void test_AnotherIgnoredTest(void); +-extern void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void); +- +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("test/TestProductionCode2.c"); +- RUN_TEST(test_IgnoredTest, 18); +- RUN_TEST(test_AnotherIgnoredTest, 23); +- RUN_TEST(test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented, 28); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c +deleted file mode 100644 +index 3b49af748c..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c ++++ /dev/null +@@ -1,57 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT()) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "ProductionCode.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void); +-extern void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void); +-extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void); +-extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void); +-extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void); +- +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("test/TestProductionCode.c"); +- RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode, 20); +- RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken, 30); +- RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue, 41); +- RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain, 51); +- RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed, 57); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/meson.build b/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/meson.build +deleted file mode 100644 +index f2a43c1b5f..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/example_4/test/test_runners/meson.build ++++ /dev/null +@@ -1,13 +0,0 @@ +-# +-# build script written by : Michael Brockus. +-# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. +-# +-# license: MIT +-# +-cases = [ +- ['TestProductionCode_Runner.c', join_paths('..' ,'TestProductionCode.c' )], +- ['TestProductionCode2_Runner.c', join_paths('..' ,'TestProductionCode2.c')] +- ] +- +-test('Running: 01-test-case', executable('01-test-case', cases[0], dependencies: [ a_dep, unity_dep ])) +-test('Running: 02-test-case', executable('02-test-case', cases[1], dependencies: [ b_dep, unity_dep ])) +diff --git a/components/testframework/libs/cmock/vendor/unity/examples/unity_config.h b/components/testframework/libs/cmock/vendor/unity/examples/unity_config.h +deleted file mode 100644 +index fc6cdb05a5..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/examples/unity_config.h ++++ /dev/null +@@ -1,244 +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 */ +- +- +-/* *************************** MISCELLANEOUS *********************************** +- * Miscellaneous configuration options for Unity +- **************************************************************************** */ +- +-/* Unity uses the stddef.h header included in the C standard library for the +- * "NULL" macro. Define this in order to disable the include of stddef.h. If you +- * do this, you have to make sure to provide your own "NULL" definition. +- */ +-/* #define UNITY_EXCLUDE_STDDEF_H */ +- +-/* Define this to enable the unity formatted print macro: +- * "TEST_PRINTF" +- */ +-/* #define UNITY_INCLUDE_PRINT_FORMATTED */ +- +- +-/* *************************** 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() */ +- +-/* 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 */ +- +-/* Print execution time of each test when executed in verbose mode +- * +- * Example: +- * +- * TEST - PASS (10 ms) +- */ +-/* #define UNITY_INCLUDE_EXEC_TIME */ +- +-#endif /* UNITY_CONFIG_H */ +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/eclipse/error_parsers.txt b/components/testframework/libs/cmock/vendor/unity/extras/eclipse/error_parsers.txt +deleted file mode 100644 +index 94e34ff385..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/eclipse/error_parsers.txt ++++ /dev/null +@@ -1,26 +0,0 @@ +-Eclipse error parsers +-===================== +- +-These are a godsend for extracting & quickly navigating to +-warnings & error messages from console output. Unforunately +-I don't know how to write an Eclipse plugin so you'll have +-to add them manually. +- +-To add a console parser to Eclipse, go to Window --> Preferences +---> C/C++ --> Build --> Settings. Click on the 'Error Parsers' +-tab and then click the 'Add...' button. See the table below for +-the parser fields to add. +- +-Eclipse will only parse the console output during a build, so +-running your unit tests must be part of your build process. +-Either add this to your make/rakefile, or add it as a post- +-build step in your Eclipse project settings. +- +- +-Unity unit test error parsers +------------------------------ +-Severity Pattern File Line Description +-------------------------------------------------------------------------------- +-Error (\.+)(.*?):(\d+):(.*?):FAIL: (.*) $2 $3 $5 +-Warning (\.+)(.*?):(\d+):(.*?):IGNORE: (.*) $2 $3 $5 +-Warning (\.+)(.*?):(\d+):(.*?):IGNORE\s*$ $2 $3 Ignored test +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/readme.md b/components/testframework/libs/cmock/vendor/unity/extras/fixture/readme.md +deleted file mode 100644 +index 2e0c2f06be..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/readme.md ++++ /dev/null +@@ -1,29 +0,0 @@ +-# Unity Fixtures +- +-This Framework is an optional add-on to Unity. By including unity_framework.h in place of unity.h, +-you may now work with Unity in a manner similar to CppUTest. This framework adds the concepts of +-test groups and gives finer control of your tests over the command line. +- +-This framework is primarily supplied for those working through James Grenning's book on Embedded +-Test Driven Development, or those coming to Unity from CppUTest. We should note that using this +-framework glosses over some of the features of Unity, and makes it more difficult +-to integrate with other testing tools like Ceedling and CMock. +- +-# Dependency Notification +- +-Fixtures, by default, uses the Memory addon as well. This is to make it simple for those trying to +-follow along with James' book. Using them together is completely optional. You may choose to use +-Fixtures without Memory handling by defining `UNITY_FIXTURE_NO_EXTRAS`. It will then stop automatically +-pulling in extras and leave you to do it as desired. +- +-# Usage information +- +-By default the test executables produced by Unity Fixtures run all tests once, but the behavior can +-be configured with command-line flags. Run the test executable with the `--help` flag for more +-information. +- +-It's possible to add a custom line at the end of the help message, typically to point to +-project-specific or company-specific unit test documentation. Define `UNITY_CUSTOM_HELP_MSG` to +-provide a custom message, e.g.: +- +- #define UNITY_CUSTOM_HELP_MSG "If any test fails see https://example.com/troubleshooting" +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.c b/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +deleted file mode 100644 +index c3dda79636..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.c ++++ /dev/null +@@ -1,310 +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] +- * ========================================== */ +- +-#include "unity_fixture.h" +-#include "unity_internals.h" +-#include +- +-struct UNITY_FIXTURE_T UnityFixture; +- +-/* If you decide to use the function pointer approach. +- * Build with -D UNITY_OUTPUT_CHAR=outputChar and include +- * int (*outputChar)(int) = putchar; */ +- +-void setUp(void) { /*does nothing*/ } +-void tearDown(void) { /*does nothing*/ } +- +-static void announceTestRun(unsigned int runNumber) +-{ +- UnityPrint("Unity test run "); +- UnityPrintNumberUnsigned(runNumber+1); +- UnityPrint(" of "); +- UnityPrintNumberUnsigned(UnityFixture.RepeatCount); +- UNITY_PRINT_EOL(); +-} +- +-int UnityMain(int argc, const char* argv[], void (*runAllTests)(void)) +-{ +- int result = UnityGetCommandLineOptions(argc, argv); +- unsigned int r; +- if (result != 0) +- return result; +- +- for (r = 0; r < UnityFixture.RepeatCount; r++) +- { +- UnityBegin(argv[0]); +- announceTestRun(r); +- runAllTests(); +- if (!UnityFixture.Verbose) UNITY_PRINT_EOL(); +- UnityEnd(); +- } +- +- return (int)Unity.TestFailures; +-} +- +-static int selected(const char* filter, const char* name) +-{ +- if (filter == 0) +- return 1; +- return strstr(name, filter) ? 1 : 0; +-} +- +-static int testSelected(const char* test) +-{ +- return selected(UnityFixture.NameFilter, test); +-} +- +-static int groupSelected(const char* group) +-{ +- return selected(UnityFixture.GroupFilter, group); +-} +- +-void UnityTestRunner(unityfunction* setup, +- unityfunction* testBody, +- unityfunction* teardown, +- const char* printableName, +- const char* group, +- const char* name, +- const char* file, +- unsigned int line) +-{ +- if (testSelected(name) && groupSelected(group)) +- { +- Unity.TestFile = file; +- Unity.CurrentTestName = printableName; +- Unity.CurrentTestLineNumber = line; +- if (UnityFixture.Verbose) +- { +- UnityPrint(printableName); +- #ifndef UNITY_REPEAT_TEST_NAME +- Unity.CurrentTestName = NULL; +- #endif +- } +- else if (UnityFixture.Silent) +- { +- /* Do Nothing */ +- } +- else +- { +- UNITY_OUTPUT_CHAR('.'); +- } +- +- Unity.NumberOfTests++; +- UnityPointer_Init(); +- +- UNITY_EXEC_TIME_START(); +- +- if (TEST_PROTECT()) +- { +- setup(); +- testBody(); +- } +- if (TEST_PROTECT()) +- { +- teardown(); +- } +- if (TEST_PROTECT()) +- { +- UnityPointer_UndoAllSets(); +- } +- UnityConcludeFixtureTest(); +- } +-} +- +-void UnityIgnoreTest(const char* printableName, const char* group, const char* name) +-{ +- if (testSelected(name) && groupSelected(group)) +- { +- Unity.NumberOfTests++; +- Unity.TestIgnores++; +- if (UnityFixture.Verbose) +- { +- UnityPrint(printableName); +- UNITY_PRINT_EOL(); +- } +- else if (UnityFixture.Silent) +- { +- /* Do Nothing */ +- } +- else +- { +- UNITY_OUTPUT_CHAR('!'); +- } +- } +-} +- +-/*-------------------------------------------------------- */ +-/*Automatic pointer restoration functions */ +-struct PointerPair +-{ +- void** pointer; +- void* old_value; +-}; +- +-static struct PointerPair pointer_store[UNITY_MAX_POINTERS]; +-static int pointer_index = 0; +- +-void UnityPointer_Init(void) +-{ +- pointer_index = 0; +-} +- +-void UnityPointer_Set(void** pointer, void* newValue, UNITY_LINE_TYPE line) +-{ +- if (pointer_index >= UNITY_MAX_POINTERS) +- { +- UNITY_TEST_FAIL(line, "Too many pointers set"); +- } +- else +- { +- pointer_store[pointer_index].pointer = pointer; +- pointer_store[pointer_index].old_value = *pointer; +- *pointer = newValue; +- pointer_index++; +- } +-} +- +-void UnityPointer_UndoAllSets(void) +-{ +- while (pointer_index > 0) +- { +- pointer_index--; +- *(pointer_store[pointer_index].pointer) = +- pointer_store[pointer_index].old_value; +- } +-} +- +-int UnityGetCommandLineOptions(int argc, const char* argv[]) +-{ +- int i; +- UnityFixture.Verbose = 0; +- UnityFixture.Silent = 0; +- UnityFixture.GroupFilter = 0; +- UnityFixture.NameFilter = 0; +- UnityFixture.RepeatCount = 1; +- +- if (argc == 1) +- return 0; +- +- for (i = 1; i < argc; ) +- { +- if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) +- { +- /* Usage */ +- UnityPrint("Runs a series of unit tests."); +- UNITY_PRINT_EOL(); +- UNITY_PRINT_EOL(); +- UnityPrint("When no flag is specified, all tests are run."); +- UNITY_PRINT_EOL(); +- UNITY_PRINT_EOL(); +- UnityPrint("Optional flags:"); +- UNITY_PRINT_EOL(); +- UnityPrint(" -v Verbose output: show all tests executed even if they pass"); +- UNITY_PRINT_EOL(); +- UnityPrint(" -s Silent mode: minimal output showing only test failures"); +- UNITY_PRINT_EOL(); +- UnityPrint(" -g NAME Only run tests in groups that contain the string NAME"); +- UNITY_PRINT_EOL(); +- UnityPrint(" -n NAME Only run tests whose name contains the string NAME"); +- UNITY_PRINT_EOL(); +- UnityPrint(" -r NUMBER Repeatedly run all tests NUMBER times"); +- UNITY_PRINT_EOL(); +- UnityPrint(" -h, --help Display this help message"); +- UNITY_PRINT_EOL(); +- UNITY_PRINT_EOL(); +-#ifdef UNITY_CUSTOM_HELP_MSG +- /* User-defined help message, e.g. to point to project-specific documentation */ +- UnityPrint(UNITY_CUSTOM_HELP_MSG); +- UNITY_PRINT_EOL(); +-#else +- /* Default help suffix if a custom one is not defined */ +- UnityPrint("More information about Unity: https://www.throwtheswitch.org/unity"); +- UNITY_PRINT_EOL(); +-#endif +- return 1; /* Exit without running the tests */ +- } +- else if (strcmp(argv[i], "-v") == 0) +- { +- UnityFixture.Verbose = 1; +- i++; +- } +- else if (strcmp(argv[i], "-s") == 0) +- { +- UnityFixture.Silent = 1; +- i++; +- } +- else if (strcmp(argv[i], "-g") == 0) +- { +- i++; +- if (i >= argc) +- return 1; +- UnityFixture.GroupFilter = argv[i]; +- i++; +- } +- else if (strcmp(argv[i], "-n") == 0) +- { +- i++; +- if (i >= argc) +- return 1; +- UnityFixture.NameFilter = argv[i]; +- i++; +- } +- else if (strcmp(argv[i], "-r") == 0) +- { +- UnityFixture.RepeatCount = 2; +- i++; +- if (i < argc) +- { +- if (*(argv[i]) >= '0' && *(argv[i]) <= '9') +- { +- unsigned int digit = 0; +- UnityFixture.RepeatCount = 0; +- while (argv[i][digit] >= '0' && argv[i][digit] <= '9') +- { +- UnityFixture.RepeatCount *= 10; +- UnityFixture.RepeatCount += (unsigned int)argv[i][digit++] - '0'; +- } +- i++; +- } +- } +- } +- else +- { +- /* ignore unknown parameter */ +- i++; +- } +- } +- return 0; +-} +- +-void UnityConcludeFixtureTest(void) +-{ +- if (Unity.CurrentTestIgnored) +- { +- Unity.TestIgnores++; +- UNITY_PRINT_EOL(); +- } +- else if (!Unity.CurrentTestFailed) +- { +- if (UnityFixture.Verbose) +- { +- UnityPrint(" "); +- UnityPrint(UnityStrPass); +- UNITY_EXEC_TIME_STOP(); +- UNITY_PRINT_EXEC_TIME(); +- UNITY_PRINT_EOL(); +- } +- } +- else /* Unity.CurrentTestFailed */ +- { +- Unity.TestFailures++; +- UNITY_PRINT_EOL(); +- } +- +- Unity.CurrentTestFailed = 0; +- Unity.CurrentTestIgnored = 0; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.h b/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +deleted file mode 100644 +index 4cc403ef03..0000000000 +--- a/components/testframework/libs/cmock/vendor/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_internals.h" +- +-#ifndef UNITY_FIXTURE_NO_EXTRAS +-#include "unity_memory.h" +-#endif +- +-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 +- +-#endif /* UNITY_FIXTURE_H_ */ +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h b/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +deleted file mode 100644 +index 1c51aa986a..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h ++++ /dev/null +@@ -1,50 +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; +- int Silent; +- unsigned int RepeatCount; +- const char* NameFilter; +- const char* GroupFilter; +-}; +-extern struct UNITY_FIXTURE_T UnityFixture; +- +-typedef void unityfunction(void); +-void UnityTestRunner(unityfunction* setup, +- unityfunction* testBody, +- 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); +-int UnityGetCommandLineOptions(int argc, const char* argv[]); +-void UnityConcludeFixtureTest(void); +- +-void UnityPointer_Set(void** pointer, 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/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/Makefile b/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/Makefile +deleted file mode 100644 +index bbe32410e9..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/Makefile ++++ /dev/null +@@ -1,72 +0,0 @@ +-CC = gcc +-ifeq ($(shell uname -s), Darwin) +-CC = clang +-endif +-#DEBUG = -O0 -g +-CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -DUNITY_FIXTURE_NO_EXTRAS +-CFLAGS += $(DEBUG) +-SRC = ../src/unity_fixture.c \ +- ../../../src/unity.c \ +- unity_fixture_Test.c \ +- unity_fixture_TestRunner.c \ +- main/AllTests.c +- +-INC_DIR = -I../src -I../../../src/ +-BUILD_DIR = ../build +-TARGET = ../build/fixture_tests.exe +- +-all: default noStdlibMalloc 32bits +- +-default: $(BUILD_DIR) +- $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_SUPPORT_64 +- @ echo "default build" +- ./$(TARGET) +- +-32bits: $(BUILD_DIR) +- $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -m32 +- @ echo "32bits build" +- ./$(TARGET) +- +-noStdlibMalloc: $(BUILD_DIR) +- $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC +- @ echo "build with noStdlibMalloc" +- ./$(TARGET) +- +-C89: CFLAGS += -D UNITY_EXCLUDE_STDINT_H # C89 did not have type 'long long', +-C89: $(BUILD_DIR) +- $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -std=c89 && ./$(TARGET) +- $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC -std=c89 +- ./$(TARGET) +- +-$(BUILD_DIR): +- mkdir -p $(BUILD_DIR) +- +-clean: +- rm -f $(TARGET) $(BUILD_DIR)/*.gc* +- +-cov: $(BUILD_DIR) +- cd $(BUILD_DIR) && \ +- $(CC) $(DEFINES) $(foreach i, $(SRC), ../test/$(i)) $(INC_DIR) -o $(TARGET) -fprofile-arcs -ftest-coverage +- rm -f $(BUILD_DIR)/*.gcda +- ./$(TARGET) > /dev/null ; ./$(TARGET) -v > /dev/null +- cd $(BUILD_DIR) && \ +- gcov unity_fixture.c | head -3 +- grep '###' $(BUILD_DIR)/unity_fixture.c.gcov -C2 || true # Show uncovered lines +- +-# These extended flags DO get included before any target build runs +-CFLAGS += -Wbad-function-cast +-CFLAGS += -Wcast-qual +-CFLAGS += -Wconversion +-CFLAGS += -Wformat=2 +-CFLAGS += -Wmissing-prototypes +-CFLAGS += -Wold-style-definition +-CFLAGS += -Wpointer-arith +-CFLAGS += -Wshadow +-CFLAGS += -Wstrict-overflow=5 +-CFLAGS += -Wstrict-prototypes +-CFLAGS += -Wswitch-default +-CFLAGS += -Wundef +-CFLAGS += -Wno-error=undef # Warning only, this should not stop the build +-CFLAGS += -Wunreachable-code +-CFLAGS += -Wunused +-CFLAGS += -fstrict-aliasing +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/main/AllTests.c b/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +deleted file mode 100644 +index 30242cb30e..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/main/AllTests.c ++++ /dev/null +@@ -1,20 +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] +- * ========================================== */ +- +-#include "unity_fixture.h" +- +-static void runAllTests(void) +-{ +- RUN_TEST_GROUP(UnityFixture); +- RUN_TEST_GROUP(UnityCommandOptions); +-} +- +-int main(int argc, const char* argv[]) +-{ +- return UnityMain(argc, argv, runAllTests); +-} +- +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c b/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c +deleted file mode 100644 +index 18bbb89e89..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c ++++ /dev/null +@@ -1,39 +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] +- * ========================================== */ +- +-#include "unity_fixture.h" +- +-static int data = -1; +- +-TEST_GROUP(mygroup); +- +-TEST_SETUP(mygroup) +-{ +- data = 0; +-} +- +-TEST_TEAR_DOWN(mygroup) +-{ +- data = -1; +-} +- +-TEST(mygroup, test1) +-{ +- TEST_ASSERT_EQUAL_INT(0, data); +-} +- +-TEST(mygroup, test2) +-{ +- TEST_ASSERT_EQUAL_INT(0, data); +- data = 5; +-} +- +-TEST(mygroup, test3) +-{ +- data = 7; +- TEST_ASSERT_EQUAL_INT(7, data); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c b/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +deleted file mode 100644 +index 1422b48964..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c ++++ /dev/null +@@ -1,245 +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] +- * ========================================== */ +- +-#include "unity_fixture.h" +-#include +-#include +- +-TEST_GROUP(UnityFixture); +- +-TEST_SETUP(UnityFixture) +-{ +-} +- +-TEST_TEAR_DOWN(UnityFixture) +-{ +-} +- +-static int* pointer1 = 0; +-static int* pointer2 = (int*)2; +-static int* pointer3 = (int*)3; +-static int int1; +-static int int2; +-static int int3; +-static int int4; +- +-TEST(UnityFixture, PointerSetting) +-{ +- TEST_ASSERT_POINTERS_EQUAL(pointer1, 0); +- UT_PTR_SET(pointer1, &int1); +- UT_PTR_SET(pointer2, &int2); +- UT_PTR_SET(pointer3, &int3); +- TEST_ASSERT_POINTERS_EQUAL(pointer1, &int1); +- TEST_ASSERT_POINTERS_EQUAL(pointer2, &int2); +- TEST_ASSERT_POINTERS_EQUAL(pointer3, &int3); +- UT_PTR_SET(pointer1, &int4); +- UnityPointer_UndoAllSets(); +- TEST_ASSERT_POINTERS_EQUAL(pointer1, 0); +- TEST_ASSERT_POINTERS_EQUAL(pointer2, (int*)2); +- TEST_ASSERT_POINTERS_EQUAL(pointer3, (int*)3); +-} +- +-static char *p1; +-static char *p2; +- +-TEST(UnityFixture, PointerSet) +-{ +- char c1; +- char c2; +- char newC1; +- char newC2; +- p1 = &c1; +- p2 = &c2; +- +- UnityPointer_Init(); +- UT_PTR_SET(p1, &newC1); +- UT_PTR_SET(p2, &newC2); +- TEST_ASSERT_POINTERS_EQUAL(&newC1, p1); +- TEST_ASSERT_POINTERS_EQUAL(&newC2, p2); +- UnityPointer_UndoAllSets(); +- TEST_ASSERT_POINTERS_EQUAL(&c1, p1); +- TEST_ASSERT_POINTERS_EQUAL(&c2, p2); +-} +- +-TEST(UnityFixture, FreeNULLSafety) +-{ +- free(NULL); +-} +- +-TEST(UnityFixture, ConcludeTestIncrementsFailCount) +-{ +- UNITY_UINT savedFails = Unity.TestFailures; +- UNITY_UINT savedIgnores = Unity.TestIgnores; +- Unity.CurrentTestFailed = 1; +- UnityConcludeFixtureTest(); /* Resets TestFailed for this test to pass */ +- Unity.CurrentTestIgnored = 1; +- UnityConcludeFixtureTest(); /* Resets TestIgnored */ +- TEST_ASSERT_EQUAL(savedFails + 1, Unity.TestFailures); +- TEST_ASSERT_EQUAL(savedIgnores + 1, Unity.TestIgnores); +- Unity.TestFailures = savedFails; +- Unity.TestIgnores = savedIgnores; +-} +- +-/*------------------------------------------------------------ */ +- +-TEST_GROUP(UnityCommandOptions); +- +-static int savedVerbose; +-static unsigned int savedRepeat; +-static const char* savedName; +-static const char* savedGroup; +- +-TEST_SETUP(UnityCommandOptions) +-{ +- savedVerbose = UnityFixture.Verbose; +- savedRepeat = UnityFixture.RepeatCount; +- savedName = UnityFixture.NameFilter; +- savedGroup = UnityFixture.GroupFilter; +-} +- +-TEST_TEAR_DOWN(UnityCommandOptions) +-{ +- UnityFixture.Verbose = savedVerbose; +- UnityFixture.RepeatCount= savedRepeat; +- UnityFixture.NameFilter = savedName; +- UnityFixture.GroupFilter = savedGroup; +-} +- +- +-static const char* noOptions[] = { +- "testrunner.exe" +-}; +- +-TEST(UnityCommandOptions, DefaultOptions) +-{ +- UnityGetCommandLineOptions(1, noOptions); +- TEST_ASSERT_EQUAL(0, UnityFixture.Verbose); +- TEST_ASSERT_POINTERS_EQUAL(0, UnityFixture.GroupFilter); +- TEST_ASSERT_POINTERS_EQUAL(0, UnityFixture.NameFilter); +- TEST_ASSERT_EQUAL(1, UnityFixture.RepeatCount); +-} +- +-static const char* verbose[] = { +- "testrunner.exe", +- "-v" +-}; +- +-TEST(UnityCommandOptions, OptionVerbose) +-{ +- TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(2, verbose)); +- TEST_ASSERT_EQUAL(1, UnityFixture.Verbose); +-} +- +-static const char* group[] = { +- "testrunner.exe", +- "-g", "groupname" +-}; +- +-TEST(UnityCommandOptions, OptionSelectTestByGroup) +-{ +- TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(3, group)); +- STRCMP_EQUAL("groupname", UnityFixture.GroupFilter); +-} +- +-static const char* name[] = { +- "testrunner.exe", +- "-n", "testname" +-}; +- +-TEST(UnityCommandOptions, OptionSelectTestByName) +-{ +- TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(3, name)); +- STRCMP_EQUAL("testname", UnityFixture.NameFilter); +-} +- +-static const char* repeat[] = { +- "testrunner.exe", +- "-r", "99" +-}; +- +-TEST(UnityCommandOptions, OptionSelectRepeatTestsDefaultCount) +-{ +- TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(2, repeat)); +- TEST_ASSERT_EQUAL(2, UnityFixture.RepeatCount); +-} +- +-TEST(UnityCommandOptions, OptionSelectRepeatTestsSpecificCount) +-{ +- TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(3, repeat)); +- TEST_ASSERT_EQUAL(99, UnityFixture.RepeatCount); +-} +- +-static const char* multiple[] = { +- "testrunner.exe", +- "-v", +- "-g", "groupname", +- "-n", "testname", +- "-r", "98" +-}; +- +-TEST(UnityCommandOptions, MultipleOptions) +-{ +- TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(8, multiple)); +- TEST_ASSERT_EQUAL(1, UnityFixture.Verbose); +- STRCMP_EQUAL("groupname", UnityFixture.GroupFilter); +- STRCMP_EQUAL("testname", UnityFixture.NameFilter); +- TEST_ASSERT_EQUAL(98, UnityFixture.RepeatCount); +-} +- +-static const char* dashRNotLast[] = { +- "testrunner.exe", +- "-v", +- "-g", "gggg", +- "-r", +- "-n", "tttt", +-}; +- +-TEST(UnityCommandOptions, MultipleOptionsDashRNotLastAndNoValueSpecified) +-{ +- TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(7, dashRNotLast)); +- TEST_ASSERT_EQUAL(1, UnityFixture.Verbose); +- STRCMP_EQUAL("gggg", UnityFixture.GroupFilter); +- STRCMP_EQUAL("tttt", UnityFixture.NameFilter); +- TEST_ASSERT_EQUAL(2, UnityFixture.RepeatCount); +-} +- +-static const char* unknownCommand[] = { +- "testrunner.exe", +- "-v", +- "-g", "groupname", +- "-n", "testname", +- "-r", "98", +- "-z" +-}; +-TEST(UnityCommandOptions, UnknownCommandIsIgnored) +-{ +- TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(9, unknownCommand)); +- TEST_ASSERT_EQUAL(1, UnityFixture.Verbose); +- STRCMP_EQUAL("groupname", UnityFixture.GroupFilter); +- STRCMP_EQUAL("testname", UnityFixture.NameFilter); +- TEST_ASSERT_EQUAL(98, UnityFixture.RepeatCount); +-} +- +-TEST(UnityCommandOptions, GroupOrNameFilterWithoutStringFails) +-{ +- TEST_ASSERT_EQUAL(1, UnityGetCommandLineOptions(3, unknownCommand)); +- TEST_ASSERT_EQUAL(1, UnityGetCommandLineOptions(5, unknownCommand)); +- TEST_ASSERT_EQUAL(1, UnityMain(3, unknownCommand, NULL)); +-} +- +-TEST(UnityCommandOptions, GroupFilterReallyFilters) +-{ +- UNITY_UINT saved = Unity.NumberOfTests; +- TEST_ASSERT_EQUAL(0, UnityGetCommandLineOptions(4, unknownCommand)); +- UnityIgnoreTest(NULL, "non-matching", NULL); +- TEST_ASSERT_EQUAL(saved, Unity.NumberOfTests); +-} +- +-IGNORE_TEST(UnityCommandOptions, TestShouldBeIgnored) +-{ +- TEST_FAIL_MESSAGE("This test should not run!"); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c b/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +deleted file mode 100644 +index 7b78c49c0e..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c ++++ /dev/null +@@ -1,32 +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] +- * ========================================== */ +- +-#include "unity_fixture.h" +- +-TEST_GROUP_RUNNER(UnityFixture) +-{ +- RUN_TEST_CASE(UnityFixture, PointerSetting); +- RUN_TEST_CASE(UnityFixture, PointerSet); +- RUN_TEST_CASE(UnityFixture, FreeNULLSafety); +- RUN_TEST_CASE(UnityFixture, ConcludeTestIncrementsFailCount); +-} +- +-TEST_GROUP_RUNNER(UnityCommandOptions) +-{ +- RUN_TEST_CASE(UnityCommandOptions, DefaultOptions); +- RUN_TEST_CASE(UnityCommandOptions, OptionVerbose); +- RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByGroup); +- RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByName); +- RUN_TEST_CASE(UnityCommandOptions, OptionSelectRepeatTestsDefaultCount); +- RUN_TEST_CASE(UnityCommandOptions, OptionSelectRepeatTestsSpecificCount); +- RUN_TEST_CASE(UnityCommandOptions, MultipleOptions); +- RUN_TEST_CASE(UnityCommandOptions, MultipleOptionsDashRNotLastAndNoValueSpecified); +- RUN_TEST_CASE(UnityCommandOptions, UnknownCommandIsIgnored); +- RUN_TEST_CASE(UnityCommandOptions, GroupOrNameFilterWithoutStringFails); +- RUN_TEST_CASE(UnityCommandOptions, GroupFilterReallyFilters); +- RUN_TEST_CASE(UnityCommandOptions, TestShouldBeIgnored); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/readme.md b/components/testframework/libs/cmock/vendor/unity/extras/memory/readme.md +deleted file mode 100644 +index 37769825c9..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/memory/readme.md ++++ /dev/null +@@ -1,49 +0,0 @@ +-# Unity Memory +- +-This Framework is an optional add-on to Unity. By including unity.h and then +-unity_memory.h, you have the added ability to track malloc and free calls. This +-addon requires that the stdlib functions be overridden by its own defines. These +-defines will still malloc / realloc / free etc, but will also track the calls +-in order to ensure that you don't have any memory leaks in your programs. +- +-Note that this is only useful in situations where a unit is in charge of both +-the allocation and deallocation of memory. When it is not symmetric, unit testing +-can report a number of false failures. A more advanced runtime tool is required to +-track complete system memory handling. +- +-# Module API +- +-## `UnityMalloc_StartTest` and `UnityMalloc_EndTest` +- +-These must be called at the beginning and end of each test. For simplicity, they can +-be added to `setUp` and `tearDown` in order to do their job. When using the test +-runner generator scripts, these will be automatically added to the runner whenever +-unity_memory.h is included. +- +-## `UnityMalloc_MakeMallocFailAfterCount` +- +-This can be called from the tests themselves. Passing this function a number will +-force the reference counter to start keeping track of malloc calls. During that test, +-if the number of malloc calls exceeds the number given, malloc will immediately +-start returning `NULL`. This allows you to test error conditions. Think of it as a +-simplified mock. +- +-# Configuration +- +-## `UNITY_MALLOC` and `UNITY_FREE` +- +-By default, this module tries to use the real stdlib `malloc` and `free` internally. +-If you would prefer it to use something else, like FreeRTOS's `pvPortMalloc` and +-`pvPortFree`, then you can use these defines to make it so. +- +-## `UNITY_EXCLUDE_STDLIB_MALLOC` +- +-If you would like this library to ignore stdlib or other heap engines completely, and +-manage the memory on its own, then define this. All memory will be handled internally +-(and at likely lower overhead). Note that this is not a very featureful memory manager, +-but is sufficient for most testing purposes. +- +-## `UNITY_INTERNAL_HEAP_SIZE_BYTES` +- +-When using the built-in memory manager (see `UNITY_EXCLUDE_STDLIB_MALLOC`) this define +-allows you to set the heap size this library will use to manage the memory. +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.c b/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.c +deleted file mode 100644 +index e4dc6654f3..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.c ++++ /dev/null +@@ -1,202 +0,0 @@ +-/* ========================================== +- * 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] +- * ========================================== */ +- +-#include "unity.h" +-#include "unity_memory.h" +-#include +- +-#define MALLOC_DONT_FAIL -1 +-static int malloc_count; +-static int malloc_fail_countdown = MALLOC_DONT_FAIL; +- +-void UnityMalloc_StartTest(void) +-{ +- malloc_count = 0; +- malloc_fail_countdown = MALLOC_DONT_FAIL; +-} +- +-void UnityMalloc_EndTest(void) +-{ +- malloc_fail_countdown = MALLOC_DONT_FAIL; +- if (malloc_count != 0) +- { +- UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "This test leaks!"); +- } +-} +- +-void UnityMalloc_MakeMallocFailAfterCount(int countdown) +-{ +- malloc_fail_countdown = countdown; +-} +- +-/* These definitions are always included from unity_fixture_malloc_overrides.h */ +-/* We undef to use them or avoid conflict with per the C standard */ +-#undef malloc +-#undef free +-#undef calloc +-#undef realloc +- +-#ifdef UNITY_EXCLUDE_STDLIB_MALLOC +-static unsigned char unity_heap[UNITY_INTERNAL_HEAP_SIZE_BYTES]; +-static size_t heap_index; +-#else +-#include +-#endif +- +-typedef struct GuardBytes +-{ +- size_t size; +- size_t guard_space; +-} Guard; +- +-#define UNITY_MALLOC_ALIGNMENT (UNITY_POINTER_WIDTH / 8) +-static const char end[] = "END"; +- +-static size_t unity_size_round_up(size_t size) +-{ +- size_t rounded_size; +- +- rounded_size = ((size + UNITY_MALLOC_ALIGNMENT - 1) / UNITY_MALLOC_ALIGNMENT) * UNITY_MALLOC_ALIGNMENT; +- +- return rounded_size; +-} +- +-void* unity_malloc(size_t size) +-{ +- char* mem; +- Guard* guard; +- size_t total_size; +- +- total_size = sizeof(Guard) + unity_size_round_up(size + sizeof(end)); +- +- if (malloc_fail_countdown != MALLOC_DONT_FAIL) +- { +- if (malloc_fail_countdown == 0) +- return NULL; +- malloc_fail_countdown--; +- } +- +- if (size == 0) return NULL; +-#ifdef UNITY_EXCLUDE_STDLIB_MALLOC +- if (heap_index + total_size > UNITY_INTERNAL_HEAP_SIZE_BYTES) +- { +- guard = NULL; +- } +- else +- { +- /* We know we can get away with this cast because we aligned memory already */ +- guard = (Guard*)(void*)(&unity_heap[heap_index]); +- heap_index += total_size; +- } +-#else +- guard = (Guard*)UNITY_MALLOC(total_size); +-#endif +- if (guard == NULL) return NULL; +- malloc_count++; +- guard->size = size; +- guard->guard_space = 0; +- mem = (char*)&(guard[1]); +- memcpy(&mem[size], end, sizeof(end)); +- +- return (void*)mem; +-} +- +-static int isOverrun(void* mem) +-{ +- Guard* guard = (Guard*)mem; +- char* memAsChar = (char*)mem; +- guard--; +- +- return guard->guard_space != 0 || strcmp(&memAsChar[guard->size], end) != 0; +-} +- +-static void release_memory(void* mem) +-{ +- Guard* guard = (Guard*)mem; +- guard--; +- +- malloc_count--; +-#ifdef UNITY_EXCLUDE_STDLIB_MALLOC +- { +- size_t block_size; +- +- block_size = unity_size_round_up(guard->size + sizeof(end)); +- +- if (mem == unity_heap + heap_index - block_size) +- { +- heap_index -= (sizeof(Guard) + block_size); +- } +- } +-#else +- UNITY_FREE(guard); +-#endif +-} +- +-void unity_free(void* mem) +-{ +- int overrun; +- +- if (mem == NULL) +- { +- return; +- } +- +- overrun = isOverrun(mem); +- release_memory(mem); +- if (overrun) +- { +- UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "Buffer overrun detected during free()"); +- } +-} +- +-void* unity_calloc(size_t num, size_t size) +-{ +- void* mem = unity_malloc(num * size); +- if (mem == NULL) return NULL; +- memset(mem, 0, num * size); +- return mem; +-} +- +-void* unity_realloc(void* oldMem, size_t size) +-{ +- Guard* guard = (Guard*)oldMem; +- void* newMem; +- +- if (oldMem == NULL) return unity_malloc(size); +- +- guard--; +- if (isOverrun(oldMem)) +- { +- release_memory(oldMem); +- UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "Buffer overrun detected during realloc()"); +- } +- +- if (size == 0) +- { +- release_memory(oldMem); +- return NULL; +- } +- +- if (guard->size >= size) return oldMem; +- +-#ifdef UNITY_EXCLUDE_STDLIB_MALLOC /* Optimization if memory is expandable */ +- { +- size_t old_total_size = unity_size_round_up(guard->size + sizeof(end)); +- +- if ((oldMem == unity_heap + heap_index - old_total_size) && +- ((heap_index - old_total_size + unity_size_round_up(size + sizeof(end))) <= UNITY_INTERNAL_HEAP_SIZE_BYTES)) +- { +- release_memory(oldMem); /* Not thread-safe, like unity_heap generally */ +- return unity_malloc(size); /* No memcpy since data is in place */ +- } +- } +-#endif +- newMem = unity_malloc(size); +- if (newMem == NULL) return NULL; /* Do not release old memory */ +- memcpy(newMem, oldMem, guard->size); +- release_memory(oldMem); +- return newMem; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.h b/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.h +deleted file mode 100644 +index ccdb826fe7..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/memory/src/unity_memory.h ++++ /dev/null +@@ -1,60 +0,0 @@ +-/* ========================================== +- * 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_MEMORY_OVERRIDES_H_ +-#define UNITY_MEMORY_OVERRIDES_H_ +- +-#ifdef __cplusplus +-extern "C" +-{ +-#endif +- +-#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 Unity to allocate and release memory +- * on the heap and can be overridden with platform-specific implementations. +- * For example, when using FreeRTOS UNITY_MALLOC becomes pvPortMalloc() +- * and UNITY_FREE becomes vPortFree(). */ +-#if !defined(UNITY_MALLOC) || !defined(UNITY_FREE) +- #include +- #define UNITY_MALLOC(size) malloc(size) +- #define UNITY_FREE(ptr) free(ptr) +-#else +- extern void* UNITY_MALLOC(size_t size); +- extern void UNITY_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); +- +-/* You must compile with malloc replacement, as defined in unity_fixture_malloc_overrides.h */ +-void UnityMalloc_StartTest(void); +-void UnityMalloc_EndTest(void); +-void UnityMalloc_MakeMallocFailAfterCount(int countdown); +- +-#ifdef __cplusplus +-} +-#endif +- +-#endif +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/Makefile b/components/testframework/libs/cmock/vendor/unity/extras/memory/test/Makefile +deleted file mode 100644 +index f3f86ce605..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/Makefile ++++ /dev/null +@@ -1,78 +0,0 @@ +-CC = gcc +-ifeq ($(shell uname -s), Darwin) +-CC = clang +-endif +-#DEBUG = -O0 -g +-CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror +-CFLAGS += $(DEBUG) +-DEFINES = -D UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar +-ifeq ($(OS),Windows_NT) +- DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar(int) +-else +- DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar\(int\) +-endif +-SRC = ../src/unity_memory.c \ +- ../../../src/unity.c \ +- unity_memory_Test.c \ +- unity_memory_TestRunner.c \ +- unity_output_Spy.c \ +- +-INC_DIR = -I../src -I../../../src/ +-BUILD_DIR = ../build +-TARGET = ../build/memory_tests.exe +- +-all: default noStdlibMalloc 32bits +- +-default: $(BUILD_DIR) +- $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_SUPPORT_64 +- @ echo "default build" +- ./$(TARGET) +- +-32bits: $(BUILD_DIR) +- $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -m32 +- @ echo "32bits build" +- ./$(TARGET) +- +-noStdlibMalloc: $(BUILD_DIR) +- $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC +- @ echo "build with noStdlibMalloc" +- ./$(TARGET) +- +-C89: CFLAGS += -D UNITY_EXCLUDE_STDINT_H # C89 did not have type 'long long', +-C89: $(BUILD_DIR) +- $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -std=c89 && ./$(TARGET) +- $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC -std=c89 +- ./$(TARGET) +- +-$(BUILD_DIR): +- mkdir -p $(BUILD_DIR) +- +-clean: +- rm -f $(TARGET) $(BUILD_DIR)/*.gc* +- +-cov: $(BUILD_DIR) +- cd $(BUILD_DIR) && \ +- $(CC) $(DEFINES) $(foreach i, $(SRC), ../test/$(i)) $(INC_DIR) -o $(TARGET) -fprofile-arcs -ftest-coverage +- rm -f $(BUILD_DIR)/*.gcda +- ./$(TARGET) > /dev/null ; ./$(TARGET) -v > /dev/null +- cd $(BUILD_DIR) && \ +- gcov unity_memory.c | head -3 +- grep '###' $(BUILD_DIR)/unity_memory.c.gcov -C2 || true # Show uncovered lines +- +-# These extended flags DO get included before any target build runs +-CFLAGS += -Wbad-function-cast +-CFLAGS += -Wcast-qual +-CFLAGS += -Wconversion +-CFLAGS += -Wformat=2 +-CFLAGS += -Wmissing-prototypes +-CFLAGS += -Wold-style-definition +-CFLAGS += -Wpointer-arith +-CFLAGS += -Wshadow +-CFLAGS += -Wstrict-overflow=5 +-CFLAGS += -Wstrict-prototypes +-CFLAGS += -Wswitch-default +-CFLAGS += -Wundef +-CFLAGS += -Wno-error=undef # Warning only, this should not stop the build +-CFLAGS += -Wunreachable-code +-CFLAGS += -Wunused +-CFLAGS += -fstrict-aliasing +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_Test.c b/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_Test.c +deleted file mode 100644 +index 6f832e2762..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_Test.c ++++ /dev/null +@@ -1,325 +0,0 @@ +-/* ========================================== +- * 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] +- * ========================================== */ +- +-#include "unity.h" +-#include "unity_memory.h" +-#include "unity_output_Spy.h" +-#include +-#include +- +-/* This test module includes the following tests: */ +- +-void test_ForceMallocFail(void); +-void test_ReallocSmallerIsUnchanged(void); +-void test_ReallocSameIsUnchanged(void); +-void test_ReallocLargerNeeded(void); +-void test_ReallocNullPointerIsLikeMalloc(void); +-void test_ReallocSizeZeroFreesMemAndReturnsNullPointer(void); +-void test_CallocFillsWithZero(void); +-void test_FreeNULLSafety(void); +-void test_DetectsLeak(void); +-void test_BufferOverrunFoundDuringFree(void); +-void test_BufferOverrunFoundDuringRealloc(void); +-void test_BufferGuardWriteFoundDuringFree(void); +-void test_BufferGuardWriteFoundDuringRealloc(void); +-void test_MallocPastBufferFails(void); +-void test_CallocPastBufferFails(void); +-void test_MallocThenReallocGrowsMemoryInPlace(void); +-void test_ReallocFailDoesNotFreeMem(void); +- +-/* It makes use of the following features */ +-void setUp(void); +-void tearDown(void); +- +-/* Let's Go! */ +-void setUp(void) +-{ +-#ifdef UNITY_EXCLUDE_STDLIB_MALLOC +- UnityOutputCharSpy_Create(200); +-#else +- UnityOutputCharSpy_Create(1000); +-#endif +- UnityMalloc_StartTest(); +-} +- +-void tearDown(void) +-{ +- UnityMalloc_EndTest(); +- UnityOutputCharSpy_Destroy(); +-} +- +-void test_ForceMallocFail(void) +-{ +- void* m; +- void* mfails; +- UnityMalloc_MakeMallocFailAfterCount(1); +- m = malloc(10); +- TEST_ASSERT_NOT_NULL(m); +- mfails = malloc(10); +- TEST_ASSERT_EQUAL_PTR(0, mfails); +- free(m); +-} +- +-void test_ReallocSmallerIsUnchanged(void) +-{ +- void* m1 = malloc(10); +- void* m2 = realloc(m1, 5); +- TEST_ASSERT_NOT_NULL(m1); +- TEST_ASSERT_EQUAL_PTR(m1, m2); +- free(m2); +-} +- +-void test_ReallocSameIsUnchanged(void) +-{ +- void* m1 = malloc(10); +- void* m2 = realloc(m1, 10); +- TEST_ASSERT_NOT_NULL(m1); +- TEST_ASSERT_EQUAL_PTR(m1, m2); +- free(m2); +-} +- +-void test_ReallocLargerNeeded(void) +-{ +- void* m2; +- void* m1 = malloc(10); +- TEST_ASSERT_NOT_NULL(m1); +- strcpy((char*)m1, "123456789"); +- m2 = realloc(m1, 15); +- TEST_ASSERT_EQUAL_STRING("123456789", m2); +- free(m2); +-} +- +-void test_ReallocNullPointerIsLikeMalloc(void) +-{ +- void* m = realloc(0, 15); +- TEST_ASSERT_NOT_NULL(m); +- free(m); +-} +- +-void test_ReallocSizeZeroFreesMemAndReturnsNullPointer(void) +-{ +- void* m1 = malloc(10); +- void* m2 = realloc(m1, 0); +- TEST_ASSERT_EQUAL_PTR(0, m2); +-} +- +-void test_CallocFillsWithZero(void) +-{ +- void* m = calloc(3, sizeof(char)); +- char* s = (char*)m; +- TEST_ASSERT_NOT_NULL(m); +- TEST_ASSERT_EQUAL_HEX8(0, s[0]); +- TEST_ASSERT_EQUAL_HEX8(0, s[1]); +- TEST_ASSERT_EQUAL_HEX8(0, s[2]); +- free(m); +-} +- +-void test_FreeNULLSafety(void) +-{ +- free(NULL); +-} +- +-/*------------------------------------------------------------ */ +- +-#define EXPECT_ABORT_BEGIN \ +- { \ +- jmp_buf TestAbortFrame; \ +- memcpy(TestAbortFrame, Unity.AbortFrame, sizeof(jmp_buf)); \ +- if (TEST_PROTECT()) \ +- { +- +-#define EXPECT_ABORT_END \ +- } \ +- memcpy(Unity.AbortFrame, TestAbortFrame, sizeof(jmp_buf)); \ +- } +- +-/* This tricky set of defines lets us see if we are using the Spy, returns 1 if true */ +-#ifdef __STDC_VERSION__ +- +-#ifdef UNITY_SUPPORT_VARIADIC_MACROS +-#define USING_SPY_AS(a) EXPAND_AND_USE_2ND(ASSIGN_VALUE(a), 0) +-#define ASSIGN_VALUE(a) VAL_##a +-#define VAL_UnityOutputCharSpy_OutputChar 0, 1 +-#define EXPAND_AND_USE_2ND(a, b) SECOND_PARAM(a, b, throwaway) +-#define SECOND_PARAM(a, b, ...) b +-#if USING_SPY_AS(UNITY_OUTPUT_CHAR) +- #define USING_OUTPUT_SPY /* UNITY_OUTPUT_CHAR = UnityOutputCharSpy_OutputChar */ +-#endif +-#endif /* UNITY_SUPPORT_VARIADIC_MACROS */ +- +-#else /* __STDC_VERSION__ else */ +- +-#define UnityOutputCharSpy_OutputChar 42 +-#if UNITY_OUTPUT_CHAR == UnityOutputCharSpy_OutputChar /* Works if no -Wundef -Werror */ +- #define USING_OUTPUT_SPY +-#endif +-#undef UnityOutputCharSpy_OutputChar +- +-#endif /* __STDC_VERSION__ */ +- +-void test_DetectsLeak(void) +-{ +-#ifdef USING_OUTPUT_SPY +- void* m = malloc(10); +- TEST_ASSERT_NOT_NULL(m); +- UnityOutputCharSpy_Enable(1); +- EXPECT_ABORT_BEGIN +- UnityMalloc_EndTest(); +- EXPECT_ABORT_END +- UnityOutputCharSpy_Enable(0); +- Unity.CurrentTestFailed = 0; +- TEST_ASSERT_NOT_NULL(strstr(UnityOutputCharSpy_Get(), "This test leaks!")); +- free(m); +-#else +- TEST_IGNORE_MESSAGE("Enable USING_OUTPUT_SPY To Run This Test"); +-#endif +-} +- +-void test_BufferOverrunFoundDuringFree(void) +-{ +-#ifdef USING_OUTPUT_SPY +- void* m = malloc(10); +- char* s = (char*)m; +- TEST_ASSERT_NOT_NULL(m); +- s[10] = (char)0xFF; +- UnityOutputCharSpy_Enable(1); +- EXPECT_ABORT_BEGIN +- free(m); +- EXPECT_ABORT_END +- UnityOutputCharSpy_Enable(0); +- Unity.CurrentTestFailed = 0; +- TEST_ASSERT_NOT_NULL(strstr(UnityOutputCharSpy_Get(), "Buffer overrun detected during free()")); +-#else +- TEST_IGNORE_MESSAGE("Enable USING_OUTPUT_SPY To Run This Test"); +-#endif +-} +- +-void test_BufferOverrunFoundDuringRealloc(void) +-{ +-#ifdef USING_OUTPUT_SPY +- void* m = malloc(10); +- char* s = (char*)m; +- TEST_ASSERT_NOT_NULL(m); +- s[10] = (char)0xFF; +- UnityOutputCharSpy_Enable(1); +- EXPECT_ABORT_BEGIN +- m = realloc(m, 100); +- EXPECT_ABORT_END +- UnityOutputCharSpy_Enable(0); +- Unity.CurrentTestFailed = 0; +- TEST_ASSERT_NOT_NULL(strstr(UnityOutputCharSpy_Get(), "Buffer overrun detected during realloc()")); +-#else +- TEST_IGNORE_MESSAGE("Enable USING_OUTPUT_SPY To Run This Test"); +-#endif +-} +- +-void test_BufferGuardWriteFoundDuringFree(void) +-{ +-#ifdef USING_OUTPUT_SPY +- void* m = malloc(10); +- char* s = (char*)m; +- TEST_ASSERT_NOT_NULL(m); +- s[-1] = (char)0x00; /* Will not detect 0 */ +- s[-2] = (char)0x01; +- UnityOutputCharSpy_Enable(1); +- EXPECT_ABORT_BEGIN +- free(m); +- EXPECT_ABORT_END +- UnityOutputCharSpy_Enable(0); +- Unity.CurrentTestFailed = 0; +- TEST_ASSERT_NOT_NULL(strstr(UnityOutputCharSpy_Get(), "Buffer overrun detected during free()")); +-#else +- TEST_IGNORE_MESSAGE("Enable USING_OUTPUT_SPY To Run This Test"); +-#endif +-} +- +-void test_BufferGuardWriteFoundDuringRealloc(void) +-{ +-#ifdef USING_OUTPUT_SPY +- void* m = malloc(10); +- char* s = (char*)m; +- TEST_ASSERT_NOT_NULL(m); +- s[-1] = (char)0x0A; +- UnityOutputCharSpy_Enable(1); +- EXPECT_ABORT_BEGIN +- m = realloc(m, 100); +- EXPECT_ABORT_END +- UnityOutputCharSpy_Enable(0); +- Unity.CurrentTestFailed = 0; +- TEST_ASSERT_NOT_NULL(strstr(UnityOutputCharSpy_Get(), "Buffer overrun detected during realloc()")); +-#else +- TEST_IGNORE_MESSAGE("Enable USING_OUTPUT_SPY To Run This Test"); +-#endif +-} +- +-/*------------------------------------------------------------ */ +- +-#define TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(first_mem_ptr, ptr) \ +- ptr = malloc(10); free(ptr); \ +- TEST_ASSERT_EQUAL_PTR_MESSAGE(first_mem_ptr, ptr, "Memory was stranded, free in LIFO order"); +- +-void test_MallocPastBufferFails(void) +-{ +-#ifdef UNITY_EXCLUDE_STDLIB_MALLOC +- void* m = malloc(UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 1); +- void* n = malloc(UNITY_INTERNAL_HEAP_SIZE_BYTES/2); +- free(m); +- TEST_ASSERT_NOT_NULL(m); +- TEST_ASSERT_NULL(n); +- TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(m, n); +-#else +- TEST_IGNORE_MESSAGE("Enable UNITY_EXCLUDE_STDLIB_MALLOC to Run This Test"); +-#endif +-} +- +-void test_CallocPastBufferFails(void) +-{ +-#ifdef UNITY_EXCLUDE_STDLIB_MALLOC +- void* m = calloc(1, UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 1); +- void* n = calloc(1, UNITY_INTERNAL_HEAP_SIZE_BYTES/2); +- free(m); +- TEST_ASSERT_NOT_NULL(m); +- TEST_ASSERT_NULL(n); +- TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(m, n); +-#else +- TEST_IGNORE_MESSAGE("Enable UNITY_EXCLUDE_STDLIB_MALLOC to Run This Test"); +-#endif +-} +- +-void test_MallocThenReallocGrowsMemoryInPlace(void) +-{ +-#ifdef UNITY_EXCLUDE_STDLIB_MALLOC +- void* m = malloc(UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 1); +- void* n = realloc(m, UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 9); +- free(n); +- TEST_ASSERT_NOT_NULL(m); +- TEST_ASSERT_EQUAL(m, n); +- TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(m, n); +-#else +- TEST_IGNORE_MESSAGE("Enable UNITY_EXCLUDE_STDLIB_MALLOC to Run This Test"); +-#endif +-} +- +-void test_ReallocFailDoesNotFreeMem(void) +-{ +-#ifdef UNITY_EXCLUDE_STDLIB_MALLOC +- void* m = malloc(UNITY_INTERNAL_HEAP_SIZE_BYTES/2); +- void* n1 = malloc(10); +- void* out_of_mem = realloc(n1, UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 1); +- void* n2 = malloc(10); +- +- free(n2); +- if (out_of_mem == NULL) free(n1); +- free(m); +- +- TEST_ASSERT_NOT_NULL(m); /* Got a real memory location */ +- TEST_ASSERT_NULL(out_of_mem); /* The realloc should have failed */ +- TEST_ASSERT_NOT_EQUAL(n2, n1); /* If n1 != n2 then realloc did not free n1 */ +- TEST_ASSERT_MEMORY_ALL_FREE_LIFO_ORDER(m, n2); +-#else +- TEST_IGNORE_MESSAGE("Enable UNITY_EXCLUDE_STDLIB_MALLOC to Run This Test"); +-#endif +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_TestRunner.c b/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_TestRunner.c +deleted file mode 100644 +index 4c91a59953..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_memory_TestRunner.c ++++ /dev/null +@@ -1,49 +0,0 @@ +-/* ========================================== +- * 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] +- * ========================================== */ +- +-#include "unity.h" +-#include "unity_memory.h" +- +-extern void test_ForceMallocFail(void); +-extern void test_ReallocSmallerIsUnchanged(void); +-extern void test_ReallocSameIsUnchanged(void); +-extern void test_ReallocLargerNeeded(void); +-extern void test_ReallocNullPointerIsLikeMalloc(void); +-extern void test_ReallocSizeZeroFreesMemAndReturnsNullPointer(void); +-extern void test_CallocFillsWithZero(void); +-extern void test_FreeNULLSafety(void); +-extern void test_DetectsLeak(void); +-extern void test_BufferOverrunFoundDuringFree(void); +-extern void test_BufferOverrunFoundDuringRealloc(void); +-extern void test_BufferGuardWriteFoundDuringFree(void); +-extern void test_BufferGuardWriteFoundDuringRealloc(void); +-extern void test_MallocPastBufferFails(void); +-extern void test_CallocPastBufferFails(void); +-extern void test_MallocThenReallocGrowsMemoryInPlace(void); +-extern void test_ReallocFailDoesNotFreeMem(void); +- +-int main(void) +-{ +- UnityBegin("unity_memory_Test.c"); +- RUN_TEST(test_ForceMallocFail); +- RUN_TEST(test_ReallocSmallerIsUnchanged); +- RUN_TEST(test_ReallocSameIsUnchanged); +- RUN_TEST(test_ReallocLargerNeeded); +- RUN_TEST(test_ReallocNullPointerIsLikeMalloc); +- RUN_TEST(test_ReallocSizeZeroFreesMemAndReturnsNullPointer); +- RUN_TEST(test_CallocFillsWithZero); +- RUN_TEST(test_FreeNULLSafety); +- RUN_TEST(test_DetectsLeak); +- RUN_TEST(test_BufferOverrunFoundDuringFree); +- RUN_TEST(test_BufferOverrunFoundDuringRealloc); +- RUN_TEST(test_BufferGuardWriteFoundDuringFree); +- RUN_TEST(test_BufferGuardWriteFoundDuringRealloc); +- RUN_TEST(test_MallocPastBufferFails); +- RUN_TEST(test_CallocPastBufferFails); +- RUN_TEST(test_MallocThenReallocGrowsMemoryInPlace); +- RUN_TEST(test_ReallocFailDoesNotFreeMem); +- return UnityEnd(); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.c b/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.c +deleted file mode 100644 +index 772fe0bdfe..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.c ++++ /dev/null +@@ -1,56 +0,0 @@ +-/* ========================================== +- * 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] +- * ========================================== */ +- +-#include "unity.h" +-#include "unity_output_Spy.h" +- +-#include +-#include +-#include +- +-static int size; +-static int count; +-static char* buffer; +-static int spy_enable; +- +-void UnityOutputCharSpy_Create(int s) +-{ +- size = (s > 0) ? s : 0; +- count = 0; +- spy_enable = 0; +- buffer = malloc((size_t)size); +- TEST_ASSERT_NOT_NULL_MESSAGE(buffer, "Internal malloc failed in Spy Create():" __FILE__); +- memset(buffer, 0, (size_t)size); +-} +- +-void UnityOutputCharSpy_Destroy(void) +-{ +- size = 0; +- free(buffer); +-} +- +-void UnityOutputCharSpy_OutputChar(int c) +-{ +- if (spy_enable) +- { +- if (count < (size-1)) +- buffer[count++] = (char)c; +- } +- else +- { +- putchar(c); +- } +-} +- +-const char * UnityOutputCharSpy_Get(void) +-{ +- return buffer; +-} +- +-void UnityOutputCharSpy_Enable(int enable) +-{ +- spy_enable = enable; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.h b/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.h +deleted file mode 100644 +index e2e401c488..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/extras/memory/test/unity_output_Spy.h ++++ /dev/null +@@ -1,16 +0,0 @@ +-/* ========================================== +- * 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_OUTPUT_SPY_H +-#define 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/components/testframework/libs/cmock/vendor/unity/meson.build b/components/testframework/libs/cmock/vendor/unity/meson.build +deleted file mode 100644 +index 968e5b13fd..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/meson.build ++++ /dev/null +@@ -1,48 +0,0 @@ +-# +-# build script written by : Michael Brockus. +-# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. +-# +-# license: MIT +-# +-project('unity', 'c', +- license: 'MIT', +- meson_version: '>=0.53.0', +- default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11'] +-) +-lang = 'c' +-cc = meson.get_compiler(lang) +- +-# +-# Meson: Add compiler flags +-if cc.get_id() == 'clang' +- add_project_arguments(cc.get_supported_arguments( +- [ +- '-Wexit-time-destructors', +- '-Wglobal-constructors', +- '-Wmissing-prototypes', +- '-Wmissing-noreturn', +- '-Wno-missing-braces', +- '-Wold-style-cast', '-Wpointer-arith', '-Wweak-vtables', +- '-Wcast-align', '-Wconversion', '-Wcast-qual', '-Wshadow' +- ] +- ), language: lang) +-endif +- +-if cc.get_argument_syntax() == 'gcc' +- add_project_arguments(cc.get_supported_arguments( +- [ +- '-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar', +- '-Wpointer-arith' , '-Wwrite-strings' , +- '-Wno-parentheses' , '-Wno-type-limits' , +- '-Wformat-security' , '-Wunreachable-code' , +- '-Waggregate-return' , '-Wformat-nonliteral' , +- '-Wmissing-declarations', '-Wmissing-include-dirs' , +- '-Wno-unused-parameter' +- ] +- ), language: lang) +-endif +- +-# +-# Sub directory to project source code +-subdir('src') +-unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir) +diff --git a/components/testframework/libs/cmock/vendor/unity/src/meson.build b/components/testframework/libs/cmock/vendor/unity/src/meson.build +deleted file mode 100644 +index 7ede15af69..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/src/meson.build ++++ /dev/null +@@ -1,11 +0,0 @@ +-# +-# build script written by : Michael Brockus. +-# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams. +-# +-# license: MIT +-# +-unity_dir = include_directories('.') +- +-unity_lib = static_library(meson.project_name(), +- sources: ['unity.c'], +- include_directories: unity_dir) +diff --git a/components/testframework/libs/cmock/vendor/unity/src/unity.c b/components/testframework/libs/cmock/vendor/unity/src/unity.c +deleted file mode 100644 +index ffa5cf0d4e..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/src/unity.c ++++ /dev/null +@@ -1,2109 +0,0 @@ +-/* ========================================================================= +- Unity Project - A Test Framework for C +- Copyright (c) 2007-19 Mike Karlesky, Mark VanderVoord, Greg Williams +- [Released under MIT License. Please refer to license.txt for details] +-============================================================================ */ +- +-#include "unity.h" +-#include +- +-#ifdef AVR +-#include +-#else +-#define PROGMEM +-#endif +- +-/* If omitted from header, declare overrideable prototypes here so they're ready for use */ +-#ifdef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION +-void UNITY_OUTPUT_CHAR(int); +-#endif +- +-/* Helpful macros for us to use here in Assert functions */ +-#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; UNITY_OUTPUT_FLUSH(); TEST_ABORT(); } +-#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; UNITY_OUTPUT_FLUSH(); TEST_ABORT(); } +-#define RETURN_IF_FAIL_OR_IGNORE if (Unity.CurrentTestFailed || Unity.CurrentTestIgnored) TEST_ABORT() +- +-struct UNITY_STORAGE_T Unity; +- +-#ifdef UNITY_OUTPUT_COLOR +-const char PROGMEM UnityStrOk[] = "\033[42mOK\033[00m"; +-const char PROGMEM UnityStrPass[] = "\033[42mPASS\033[00m"; +-const char PROGMEM UnityStrFail[] = "\033[41mFAIL\033[00m"; +-const char PROGMEM UnityStrIgnore[] = "\033[43mIGNORE\033[00m"; +-#else +-const char PROGMEM UnityStrOk[] = "OK"; +-const char PROGMEM UnityStrPass[] = "PASS"; +-const char PROGMEM UnityStrFail[] = "FAIL"; +-const char PROGMEM UnityStrIgnore[] = "IGNORE"; +-#endif +-static const char PROGMEM UnityStrNull[] = "NULL"; +-static const char PROGMEM UnityStrSpacer[] = ". "; +-static const char PROGMEM UnityStrExpected[] = " Expected "; +-static const char PROGMEM UnityStrWas[] = " Was "; +-static const char PROGMEM UnityStrGt[] = " to be greater than "; +-static const char PROGMEM UnityStrLt[] = " to be less than "; +-static const char PROGMEM UnityStrOrEqual[] = "or equal to "; +-static const char PROGMEM UnityStrNotEqual[] = " to be not equal to "; +-static const char PROGMEM UnityStrElement[] = " Element "; +-static const char PROGMEM UnityStrByte[] = " Byte "; +-static const char PROGMEM UnityStrMemory[] = " Memory Mismatch."; +-static const char PROGMEM UnityStrDelta[] = " Values Not Within Delta "; +-static const char PROGMEM UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless."; +-static const char PROGMEM UnityStrNullPointerForExpected[] = " Expected pointer to be NULL"; +-static const char PROGMEM UnityStrNullPointerForActual[] = " Actual pointer was NULL"; +-#ifndef UNITY_EXCLUDE_FLOAT +-static const char PROGMEM UnityStrNot[] = "Not "; +-static const char PROGMEM UnityStrInf[] = "Infinity"; +-static const char PROGMEM UnityStrNegInf[] = "Negative Infinity"; +-static const char PROGMEM UnityStrNaN[] = "NaN"; +-static const char PROGMEM UnityStrDet[] = "Determinate"; +-static const char PROGMEM UnityStrInvalidFloatTrait[] = "Invalid Float Trait"; +-#endif +-const char PROGMEM UnityStrErrShorthand[] = "Unity Shorthand Support Disabled"; +-const char PROGMEM UnityStrErrFloat[] = "Unity Floating Point Disabled"; +-const char PROGMEM UnityStrErrDouble[] = "Unity Double Precision Disabled"; +-const char PROGMEM UnityStrErr64[] = "Unity 64-bit Support Disabled"; +-static const char PROGMEM UnityStrBreaker[] = "-----------------------"; +-static const char PROGMEM UnityStrResultsTests[] = " Tests "; +-static const char PROGMEM UnityStrResultsFailures[] = " Failures "; +-static const char PROGMEM UnityStrResultsIgnored[] = " Ignored "; +-static const char PROGMEM UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " "; +-static const char PROGMEM UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " "; +- +-/*----------------------------------------------- +- * Pretty Printers & Test Result Output Handlers +- *-----------------------------------------------*/ +- +-/*-----------------------------------------------*/ +-/* Local helper function to print characters. */ +-static void UnityPrintChar(const char* pch) +-{ +- /* printable characters plus CR & LF are printed */ +- if ((*pch <= 126) && (*pch >= 32)) +- { +- UNITY_OUTPUT_CHAR(*pch); +- } +- /* write escaped carriage returns */ +- else if (*pch == 13) +- { +- UNITY_OUTPUT_CHAR('\\'); +- UNITY_OUTPUT_CHAR('r'); +- } +- /* write escaped line feeds */ +- else if (*pch == 10) +- { +- UNITY_OUTPUT_CHAR('\\'); +- UNITY_OUTPUT_CHAR('n'); +- } +- /* unprintable characters are shown as codes */ +- else +- { +- UNITY_OUTPUT_CHAR('\\'); +- UNITY_OUTPUT_CHAR('x'); +- UnityPrintNumberHex((UNITY_UINT)*pch, 2); +- } +-} +- +-/*-----------------------------------------------*/ +-/* Local helper function to print ANSI escape strings e.g. "\033[42m". */ +-#ifdef UNITY_OUTPUT_COLOR +-static UNITY_UINT UnityPrintAnsiEscapeString(const char* string) +-{ +- const char* pch = string; +- UNITY_UINT count = 0; +- +- while (*pch && (*pch != 'm')) +- { +- UNITY_OUTPUT_CHAR(*pch); +- pch++; +- count++; +- } +- UNITY_OUTPUT_CHAR('m'); +- count++; +- +- return count; +-} +-#endif +- +-/*-----------------------------------------------*/ +-void UnityPrint(const char* string) +-{ +- const char* pch = string; +- +- if (pch != NULL) +- { +- while (*pch) +- { +-#ifdef UNITY_OUTPUT_COLOR +- /* print ANSI escape code */ +- if ((*pch == 27) && (*(pch + 1) == '[')) +- { +- pch += UnityPrintAnsiEscapeString(pch); +- continue; +- } +-#endif +- UnityPrintChar(pch); +- pch++; +- } +- } +-} +-/*-----------------------------------------------*/ +-void UnityPrintLen(const char* string, const UNITY_UINT32 length) +-{ +- const char* pch = string; +- +- if (pch != NULL) +- { +- while (*pch && ((UNITY_UINT32)(pch - string) < length)) +- { +- /* printable characters plus CR & LF are printed */ +- if ((*pch <= 126) && (*pch >= 32)) +- { +- UNITY_OUTPUT_CHAR(*pch); +- } +- /* write escaped carriage returns */ +- else if (*pch == 13) +- { +- UNITY_OUTPUT_CHAR('\\'); +- UNITY_OUTPUT_CHAR('r'); +- } +- /* write escaped line feeds */ +- else if (*pch == 10) +- { +- UNITY_OUTPUT_CHAR('\\'); +- UNITY_OUTPUT_CHAR('n'); +- } +- /* unprintable characters are shown as codes */ +- else +- { +- UNITY_OUTPUT_CHAR('\\'); +- UNITY_OUTPUT_CHAR('x'); +- UnityPrintNumberHex((UNITY_UINT)*pch, 2); +- } +- pch++; +- } +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style) +-{ +- if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) +- { +- if (style == UNITY_DISPLAY_STYLE_CHAR) +- { +- /* printable characters plus CR & LF are printed */ +- UNITY_OUTPUT_CHAR('\''); +- if ((number <= 126) && (number >= 32)) +- { +- UNITY_OUTPUT_CHAR((int)number); +- } +- /* write escaped carriage returns */ +- else if (number == 13) +- { +- UNITY_OUTPUT_CHAR('\\'); +- UNITY_OUTPUT_CHAR('r'); +- } +- /* write escaped line feeds */ +- else if (number == 10) +- { +- UNITY_OUTPUT_CHAR('\\'); +- UNITY_OUTPUT_CHAR('n'); +- } +- /* unprintable characters are shown as codes */ +- else +- { +- UNITY_OUTPUT_CHAR('\\'); +- UNITY_OUTPUT_CHAR('x'); +- UnityPrintNumberHex((UNITY_UINT)number, 2); +- } +- UNITY_OUTPUT_CHAR('\''); +- } +- else +- { +- UnityPrintNumber(number); +- } +- } +- else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) +- { +- UnityPrintNumberUnsigned((UNITY_UINT)number); +- } +- else +- { +- UNITY_OUTPUT_CHAR('0'); +- UNITY_OUTPUT_CHAR('x'); +- UnityPrintNumberHex((UNITY_UINT)number, (char)((style & 0xF) * 2)); +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityPrintNumber(const UNITY_INT number_to_print) +-{ +- UNITY_UINT number = (UNITY_UINT)number_to_print; +- +- if (number_to_print < 0) +- { +- /* A negative number, including MIN negative */ +- UNITY_OUTPUT_CHAR('-'); +- number = (~number) + 1; +- } +- UnityPrintNumberUnsigned(number); +-} +- +-/*----------------------------------------------- +- * basically do an itoa using as little ram as possible */ +-void UnityPrintNumberUnsigned(const UNITY_UINT number) +-{ +- UNITY_UINT divisor = 1; +- +- /* figure out initial divisor */ +- while (number / divisor > 9) +- { +- divisor *= 10; +- } +- +- /* now mod and print, then divide divisor */ +- do +- { +- UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10))); +- divisor /= 10; +- } while (divisor > 0); +-} +- +-/*-----------------------------------------------*/ +-void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print) +-{ +- int nibble; +- char nibbles = nibbles_to_print; +- +- if ((unsigned)nibbles > UNITY_MAX_NIBBLES) +- { +- nibbles = UNITY_MAX_NIBBLES; +- } +- +- while (nibbles > 0) +- { +- nibbles--; +- nibble = (int)(number >> (nibbles * 4)) & 0x0F; +- if (nibble <= 9) +- { +- UNITY_OUTPUT_CHAR((char)('0' + nibble)); +- } +- else +- { +- UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble)); +- } +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number) +-{ +- UNITY_UINT current_bit = (UNITY_UINT)1 << (UNITY_INT_WIDTH - 1); +- UNITY_INT32 i; +- +- for (i = 0; i < UNITY_INT_WIDTH; i++) +- { +- if (current_bit & mask) +- { +- if (current_bit & number) +- { +- UNITY_OUTPUT_CHAR('1'); +- } +- else +- { +- UNITY_OUTPUT_CHAR('0'); +- } +- } +- else +- { +- UNITY_OUTPUT_CHAR('X'); +- } +- current_bit = current_bit >> 1; +- } +-} +- +-/*-----------------------------------------------*/ +-#ifndef UNITY_EXCLUDE_FLOAT_PRINT +-/* +- * This function prints a floating-point value in a format similar to +- * printf("%.7g") on a single-precision machine or printf("%.9g") on a +- * double-precision machine. The 7th digit won't always be totally correct +- * in single-precision operation (for that level of accuracy, a more +- * complicated algorithm would be needed). +- */ +-void UnityPrintFloat(const UNITY_DOUBLE input_number) +-{ +-#ifdef UNITY_INCLUDE_DOUBLE +- static const int sig_digits = 9; +- static const UNITY_INT32 min_scaled = 100000000; +- static const UNITY_INT32 max_scaled = 1000000000; +-#else +- static const int sig_digits = 7; +- static const UNITY_INT32 min_scaled = 1000000; +- static const UNITY_INT32 max_scaled = 10000000; +-#endif +- +- UNITY_DOUBLE number = input_number; +- +- /* print minus sign (does not handle negative zero) */ +- if (number < 0.0f) +- { +- UNITY_OUTPUT_CHAR('-'); +- number = -number; +- } +- +- /* handle zero, NaN, and +/- infinity */ +- if (number == 0.0f) +- { +- UnityPrint("0"); +- } +- else if (isnan(number)) +- { +- UnityPrint("nan"); +- } +- else if (isinf(number)) +- { +- UnityPrint("inf"); +- } +- else +- { +- UNITY_INT32 n_int = 0, n; +- int exponent = 0; +- int decimals, digits; +- char buf[16] = {0}; +- +- /* +- * Scale up or down by powers of 10. To minimize rounding error, +- * start with a factor/divisor of 10^10, which is the largest +- * power of 10 that can be represented exactly. Finally, compute +- * (exactly) the remaining power of 10 and perform one more +- * multiplication or division. +- */ +- if (number < 1.0f) +- { +- UNITY_DOUBLE factor = 1.0f; +- +- while (number < (UNITY_DOUBLE)max_scaled / 1e10f) { number *= 1e10f; exponent -= 10; } +- while (number * factor < (UNITY_DOUBLE)min_scaled) { factor *= 10.0f; exponent--; } +- +- number *= factor; +- } +- else if (number > (UNITY_DOUBLE)max_scaled) +- { +- UNITY_DOUBLE divisor = 1.0f; +- +- while (number > (UNITY_DOUBLE)min_scaled * 1e10f) { number /= 1e10f; exponent += 10; } +- while (number / divisor > (UNITY_DOUBLE)max_scaled) { divisor *= 10.0f; exponent++; } +- +- number /= divisor; +- } +- else +- { +- /* +- * In this range, we can split off the integer part before +- * doing any multiplications. This reduces rounding error by +- * freeing up significant bits in the fractional part. +- */ +- UNITY_DOUBLE factor = 1.0f; +- n_int = (UNITY_INT32)number; +- number -= (UNITY_DOUBLE)n_int; +- +- while (n_int < min_scaled) { n_int *= 10; factor *= 10.0f; exponent--; } +- +- number *= factor; +- } +- +- /* round to nearest integer */ +- n = ((UNITY_INT32)(number + number) + 1) / 2; +- +-#ifndef UNITY_ROUND_TIES_AWAY_FROM_ZERO +- /* round to even if exactly between two integers */ +- if ((n & 1) && (((UNITY_DOUBLE)n - number) == 0.5f)) +- n--; +-#endif +- +- n += n_int; +- +- if (n >= max_scaled) +- { +- n = min_scaled; +- exponent++; +- } +- +- /* determine where to place decimal point */ +- decimals = ((exponent <= 0) && (exponent >= -(sig_digits + 3))) ? (-exponent) : (sig_digits - 1); +- exponent += decimals; +- +- /* truncate trailing zeroes after decimal point */ +- while ((decimals > 0) && ((n % 10) == 0)) +- { +- n /= 10; +- decimals--; +- } +- +- /* build up buffer in reverse order */ +- digits = 0; +- while ((n != 0) || (digits < (decimals + 1))) +- { +- buf[digits++] = (char)('0' + n % 10); +- n /= 10; +- } +- while (digits > 0) +- { +- if (digits == decimals) { UNITY_OUTPUT_CHAR('.'); } +- UNITY_OUTPUT_CHAR(buf[--digits]); +- } +- +- /* print exponent if needed */ +- if (exponent != 0) +- { +- UNITY_OUTPUT_CHAR('e'); +- +- if (exponent < 0) +- { +- UNITY_OUTPUT_CHAR('-'); +- exponent = -exponent; +- } +- else +- { +- UNITY_OUTPUT_CHAR('+'); +- } +- +- digits = 0; +- while ((exponent != 0) || (digits < 2)) +- { +- buf[digits++] = (char)('0' + exponent % 10); +- exponent /= 10; +- } +- while (digits > 0) +- { +- UNITY_OUTPUT_CHAR(buf[--digits]); +- } +- } +- } +-} +-#endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */ +- +-/*-----------------------------------------------*/ +-static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line) +-{ +-#ifdef UNITY_OUTPUT_FOR_ECLIPSE +- UNITY_OUTPUT_CHAR('('); +- UnityPrint(file); +- UNITY_OUTPUT_CHAR(':'); +- UnityPrintNumber((UNITY_INT)line); +- UNITY_OUTPUT_CHAR(')'); +- UNITY_OUTPUT_CHAR(' '); +- UnityPrint(Unity.CurrentTestName); +- UNITY_OUTPUT_CHAR(':'); +-#else +-#ifdef UNITY_OUTPUT_FOR_IAR_WORKBENCH +- UnityPrint("'); +- UnityPrint(Unity.CurrentTestName); +- UnityPrint(" "); +-#else +-#ifdef UNITY_OUTPUT_FOR_QT_CREATOR +- UnityPrint("file://"); +- UnityPrint(file); +- UNITY_OUTPUT_CHAR(':'); +- UnityPrintNumber((UNITY_INT)line); +- UNITY_OUTPUT_CHAR(' '); +- UnityPrint(Unity.CurrentTestName); +- UNITY_OUTPUT_CHAR(':'); +-#else +- UnityPrint(file); +- UNITY_OUTPUT_CHAR(':'); +- UnityPrintNumber((UNITY_INT)line); +- UNITY_OUTPUT_CHAR(':'); +- UnityPrint(Unity.CurrentTestName); +- UNITY_OUTPUT_CHAR(':'); +-#endif +-#endif +-#endif +-} +- +-/*-----------------------------------------------*/ +-static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line) +-{ +- UnityTestResultsBegin(Unity.TestFile, line); +- UnityPrint(UnityStrFail); +- UNITY_OUTPUT_CHAR(':'); +-} +- +-/*-----------------------------------------------*/ +-void UnityConcludeTest(void) +-{ +- if (Unity.CurrentTestIgnored) +- { +- Unity.TestIgnores++; +- } +- else if (!Unity.CurrentTestFailed) +- { +- UnityTestResultsBegin(Unity.TestFile, Unity.CurrentTestLineNumber); +- UnityPrint(UnityStrPass); +- } +- else +- { +- Unity.TestFailures++; +- } +- +- Unity.CurrentTestFailed = 0; +- Unity.CurrentTestIgnored = 0; +- UNITY_PRINT_EXEC_TIME(); +- UNITY_PRINT_EOL(); +- UNITY_FLUSH_CALL(); +-} +- +-/*-----------------------------------------------*/ +-static void UnityAddMsgIfSpecified(const char* msg) +-{ +- if (msg) +- { +- UnityPrint(UnityStrSpacer); +- +-#ifdef UNITY_PRINT_TEST_CONTEXT +- UNITY_PRINT_TEST_CONTEXT(); +-#endif +-#ifndef UNITY_EXCLUDE_DETAILS +- if (Unity.CurrentDetail1) +- { +- UnityPrint(UnityStrDetail1Name); +- UnityPrint(Unity.CurrentDetail1); +- if (Unity.CurrentDetail2) +- { +- UnityPrint(UnityStrDetail2Name); +- UnityPrint(Unity.CurrentDetail2); +- } +- UnityPrint(UnityStrSpacer); +- } +-#endif +- UnityPrint(msg); +- } +-} +- +-/*-----------------------------------------------*/ +-static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual) +-{ +- UnityPrint(UnityStrExpected); +- if (expected != NULL) +- { +- UNITY_OUTPUT_CHAR('\''); +- UnityPrint(expected); +- UNITY_OUTPUT_CHAR('\''); +- } +- else +- { +- UnityPrint(UnityStrNull); +- } +- UnityPrint(UnityStrWas); +- if (actual != NULL) +- { +- UNITY_OUTPUT_CHAR('\''); +- UnityPrint(actual); +- UNITY_OUTPUT_CHAR('\''); +- } +- else +- { +- UnityPrint(UnityStrNull); +- } +-} +- +-/*-----------------------------------------------*/ +-static void UnityPrintExpectedAndActualStringsLen(const char* expected, +- const char* actual, +- const UNITY_UINT32 length) +-{ +- UnityPrint(UnityStrExpected); +- if (expected != NULL) +- { +- UNITY_OUTPUT_CHAR('\''); +- UnityPrintLen(expected, length); +- UNITY_OUTPUT_CHAR('\''); +- } +- else +- { +- UnityPrint(UnityStrNull); +- } +- UnityPrint(UnityStrWas); +- if (actual != NULL) +- { +- UNITY_OUTPUT_CHAR('\''); +- UnityPrintLen(actual, length); +- UNITY_OUTPUT_CHAR('\''); +- } +- else +- { +- UnityPrint(UnityStrNull); +- } +-} +- +-/*----------------------------------------------- +- * Assertion & Control Helpers +- *-----------------------------------------------*/ +- +-/*-----------------------------------------------*/ +-static int UnityIsOneArrayNull(UNITY_INTERNAL_PTR expected, +- UNITY_INTERNAL_PTR actual, +- const UNITY_LINE_TYPE lineNumber, +- const char* msg) +-{ +- /* Both are NULL or same pointer */ +- if (expected == actual) { return 0; } +- +- /* print and return true if just expected is NULL */ +- if (expected == NULL) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrNullPointerForExpected); +- UnityAddMsgIfSpecified(msg); +- return 1; +- } +- +- /* print and return true if just actual is NULL */ +- if (actual == NULL) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrNullPointerForActual); +- UnityAddMsgIfSpecified(msg); +- return 1; +- } +- +- return 0; /* return false if neither is NULL */ +-} +- +-/*----------------------------------------------- +- * Assertion Functions +- *-----------------------------------------------*/ +- +-/*-----------------------------------------------*/ +-void UnityAssertBits(const UNITY_INT mask, +- const UNITY_INT expected, +- const UNITY_INT actual, +- const char* msg, +- const UNITY_LINE_TYPE lineNumber) +-{ +- RETURN_IF_FAIL_OR_IGNORE; +- +- if ((mask & expected) != (mask & actual)) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrExpected); +- UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)expected); +- UnityPrint(UnityStrWas); +- UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)actual); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityAssertEqualNumber(const UNITY_INT expected, +- const UNITY_INT actual, +- const char* msg, +- const UNITY_LINE_TYPE lineNumber, +- const UNITY_DISPLAY_STYLE_T style) +-{ +- RETURN_IF_FAIL_OR_IGNORE; +- +- if (expected != actual) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrExpected); +- UnityPrintNumberByStyle(expected, style); +- UnityPrint(UnityStrWas); +- UnityPrintNumberByStyle(actual, style); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +-} +- +-/*-----------------------------------------------*/ +-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) +-{ +- int failed = 0; +- RETURN_IF_FAIL_OR_IGNORE; +- +- if ((threshold == actual) && (compare & UNITY_EQUAL_TO)) { return; } +- if ((threshold == actual)) { failed = 1; } +- +- if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) +- { +- if ((actual > threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } +- if ((actual < threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } +- } +- else /* UINT or HEX */ +- { +- if (((UNITY_UINT)actual > (UNITY_UINT)threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } +- if (((UNITY_UINT)actual < (UNITY_UINT)threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } +- } +- +- if (failed) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrExpected); +- UnityPrintNumberByStyle(actual, style); +- if (compare & UNITY_GREATER_THAN) { UnityPrint(UnityStrGt); } +- if (compare & UNITY_SMALLER_THAN) { UnityPrint(UnityStrLt); } +- if (compare & UNITY_EQUAL_TO) { UnityPrint(UnityStrOrEqual); } +- if (compare == UNITY_NOT_EQUAL) { UnityPrint(UnityStrNotEqual); } +- UnityPrintNumberByStyle(threshold, style); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +-} +- +-#define UnityPrintPointlessAndBail() \ +-{ \ +- UnityTestResultsFailBegin(lineNumber); \ +- UnityPrint(UnityStrPointless); \ +- UnityAddMsgIfSpecified(msg); \ +- UNITY_FAIL_AND_BAIL; } +- +-/*-----------------------------------------------*/ +-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) +-{ +- UNITY_UINT32 elements = num_elements; +- unsigned int length = style & 0xF; +- unsigned int increment = 0; +- +- RETURN_IF_FAIL_OR_IGNORE; +- +- if (num_elements == 0) +- { +- UnityPrintPointlessAndBail(); +- } +- +- if (expected == actual) +- { +- return; /* Both are NULL or same pointer */ +- } +- +- if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) +- { +- UNITY_FAIL_AND_BAIL; +- } +- +- while ((elements > 0) && (elements--)) +- { +- UNITY_INT expect_val; +- UNITY_INT actual_val; +- +- switch (length) +- { +- case 1: +- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)expected; +- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)actual; +- increment = sizeof(UNITY_INT8); +- break; +- +- case 2: +- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)expected; +- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)actual; +- increment = sizeof(UNITY_INT16); +- break; +- +-#ifdef UNITY_SUPPORT_64 +- case 8: +- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)expected; +- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)actual; +- increment = sizeof(UNITY_INT64); +- break; +-#endif +- +- default: /* default is length 4 bytes */ +- case 4: +- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)expected; +- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)actual; +- increment = sizeof(UNITY_INT32); +- length = 4; +- break; +- } +- +- if (expect_val != actual_val) +- { +- if ((style & UNITY_DISPLAY_RANGE_UINT) && (length < (UNITY_INT_WIDTH / 8))) +- { /* For UINT, remove sign extension (padding 1's) from signed type casts above */ +- UNITY_INT mask = 1; +- mask = (mask << 8 * length) - 1; +- expect_val &= mask; +- actual_val &= mask; +- } +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrElement); +- UnityPrintNumberUnsigned(num_elements - elements - 1); +- UnityPrint(UnityStrExpected); +- UnityPrintNumberByStyle(expect_val, style); +- UnityPrint(UnityStrWas); +- UnityPrintNumberByStyle(actual_val, style); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +- /* Walk through array by incrementing the pointers */ +- if (flags == UNITY_ARRAY_TO_ARRAY) +- { +- expected = (UNITY_INTERNAL_PTR)((const char*)expected + increment); +- } +- actual = (UNITY_INTERNAL_PTR)((const char*)actual + increment); +- } +-} +- +-/*-----------------------------------------------*/ +-#ifndef UNITY_EXCLUDE_FLOAT +-/* Wrap this define in a function with variable types as float or double */ +-#define UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff) \ +- if (isinf(expected) && isinf(actual) && (((expected) < 0) == ((actual) < 0))) return 1; \ +- if (UNITY_NAN_CHECK) return 1; \ +- (diff) = (actual) - (expected); \ +- if ((diff) < 0) (diff) = -(diff); \ +- if ((delta) < 0) (delta) = -(delta); \ +- return !(isnan(diff) || isinf(diff) || ((diff) > (delta))) +- /* This first part of this condition will catch any NaN or Infinite values */ +-#ifndef UNITY_NAN_NOT_EQUAL_NAN +- #define UNITY_NAN_CHECK isnan(expected) && isnan(actual) +-#else +- #define UNITY_NAN_CHECK 0 +-#endif +- +-#ifndef UNITY_EXCLUDE_FLOAT_PRINT +- #define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \ +- { \ +- UnityPrint(UnityStrExpected); \ +- UnityPrintFloat(expected); \ +- UnityPrint(UnityStrWas); \ +- UnityPrintFloat(actual); } +-#else +- #define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \ +- UnityPrint(UnityStrDelta) +-#endif /* UNITY_EXCLUDE_FLOAT_PRINT */ +- +-/*-----------------------------------------------*/ +-static int UnityFloatsWithin(UNITY_FLOAT delta, UNITY_FLOAT expected, UNITY_FLOAT actual) +-{ +- UNITY_FLOAT diff; +- UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff); +-} +- +-/*-----------------------------------------------*/ +-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) +-{ +- UNITY_UINT32 elements = num_elements; +- UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_expected = expected; +- UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_actual = actual; +- +- RETURN_IF_FAIL_OR_IGNORE; +- +- if (elements == 0) +- { +- UnityPrintPointlessAndBail(); +- } +- +- if (expected == actual) +- { +- return; /* Both are NULL or same pointer */ +- } +- +- if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) +- { +- UNITY_FAIL_AND_BAIL; +- } +- +- while (elements--) +- { +- if (!UnityFloatsWithin(*ptr_expected * UNITY_FLOAT_PRECISION, *ptr_expected, *ptr_actual)) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrElement); +- UnityPrintNumberUnsigned(num_elements - elements - 1); +- UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)*ptr_expected, (UNITY_DOUBLE)*ptr_actual); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +- if (flags == UNITY_ARRAY_TO_ARRAY) +- { +- ptr_expected++; +- } +- ptr_actual++; +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityAssertFloatsWithin(const UNITY_FLOAT delta, +- const UNITY_FLOAT expected, +- const UNITY_FLOAT actual, +- const char* msg, +- const UNITY_LINE_TYPE lineNumber) +-{ +- RETURN_IF_FAIL_OR_IGNORE; +- +- +- if (!UnityFloatsWithin(delta, expected, actual)) +- { +- UnityTestResultsFailBegin(lineNumber); +- UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)expected, (UNITY_DOUBLE)actual); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityAssertFloatSpecial(const UNITY_FLOAT actual, +- const char* msg, +- const UNITY_LINE_TYPE lineNumber, +- const UNITY_FLOAT_TRAIT_T style) +-{ +- const char* trait_names[] = {UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet}; +- UNITY_INT should_be_trait = ((UNITY_INT)style & 1); +- UNITY_INT is_trait = !should_be_trait; +- UNITY_INT trait_index = (UNITY_INT)(style >> 1); +- +- RETURN_IF_FAIL_OR_IGNORE; +- +- switch (style) +- { +- case UNITY_FLOAT_IS_INF: +- case UNITY_FLOAT_IS_NOT_INF: +- is_trait = isinf(actual) && (actual > 0); +- break; +- case UNITY_FLOAT_IS_NEG_INF: +- case UNITY_FLOAT_IS_NOT_NEG_INF: +- is_trait = isinf(actual) && (actual < 0); +- break; +- +- case UNITY_FLOAT_IS_NAN: +- case UNITY_FLOAT_IS_NOT_NAN: +- is_trait = isnan(actual) ? 1 : 0; +- break; +- +- case UNITY_FLOAT_IS_DET: /* A determinate number is non infinite and not NaN. */ +- case UNITY_FLOAT_IS_NOT_DET: +- is_trait = !isinf(actual) && !isnan(actual); +- break; +- +- default: +- trait_index = 0; +- trait_names[0] = UnityStrInvalidFloatTrait; +- break; +- } +- +- if (is_trait != should_be_trait) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrExpected); +- if (!should_be_trait) +- { +- UnityPrint(UnityStrNot); +- } +- UnityPrint(trait_names[trait_index]); +- UnityPrint(UnityStrWas); +-#ifndef UNITY_EXCLUDE_FLOAT_PRINT +- UnityPrintFloat((UNITY_DOUBLE)actual); +-#else +- if (should_be_trait) +- { +- UnityPrint(UnityStrNot); +- } +- UnityPrint(trait_names[trait_index]); +-#endif +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +-} +- +-#endif /* not UNITY_EXCLUDE_FLOAT */ +- +-/*-----------------------------------------------*/ +-#ifndef UNITY_EXCLUDE_DOUBLE +-static int UnityDoublesWithin(UNITY_DOUBLE delta, UNITY_DOUBLE expected, UNITY_DOUBLE actual) +-{ +- UNITY_DOUBLE diff; +- UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff); +-} +- +-/*-----------------------------------------------*/ +-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) +-{ +- UNITY_UINT32 elements = num_elements; +- UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_expected = expected; +- UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_actual = actual; +- +- RETURN_IF_FAIL_OR_IGNORE; +- +- if (elements == 0) +- { +- UnityPrintPointlessAndBail(); +- } +- +- if (expected == actual) +- { +- return; /* Both are NULL or same pointer */ +- } +- +- if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) +- { +- UNITY_FAIL_AND_BAIL; +- } +- +- while (elements--) +- { +- if (!UnityDoublesWithin(*ptr_expected * UNITY_DOUBLE_PRECISION, *ptr_expected, *ptr_actual)) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrElement); +- UnityPrintNumberUnsigned(num_elements - elements - 1); +- UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(*ptr_expected, *ptr_actual); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +- if (flags == UNITY_ARRAY_TO_ARRAY) +- { +- ptr_expected++; +- } +- ptr_actual++; +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityAssertDoublesWithin(const UNITY_DOUBLE delta, +- const UNITY_DOUBLE expected, +- const UNITY_DOUBLE actual, +- const char* msg, +- const UNITY_LINE_TYPE lineNumber) +-{ +- RETURN_IF_FAIL_OR_IGNORE; +- +- if (!UnityDoublesWithin(delta, expected, actual)) +- { +- UnityTestResultsFailBegin(lineNumber); +- UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, +- const char* msg, +- const UNITY_LINE_TYPE lineNumber, +- const UNITY_FLOAT_TRAIT_T style) +-{ +- const char* trait_names[] = {UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet}; +- UNITY_INT should_be_trait = ((UNITY_INT)style & 1); +- UNITY_INT is_trait = !should_be_trait; +- UNITY_INT trait_index = (UNITY_INT)(style >> 1); +- +- RETURN_IF_FAIL_OR_IGNORE; +- +- switch (style) +- { +- case UNITY_FLOAT_IS_INF: +- case UNITY_FLOAT_IS_NOT_INF: +- is_trait = isinf(actual) && (actual > 0); +- break; +- case UNITY_FLOAT_IS_NEG_INF: +- case UNITY_FLOAT_IS_NOT_NEG_INF: +- is_trait = isinf(actual) && (actual < 0); +- break; +- +- case UNITY_FLOAT_IS_NAN: +- case UNITY_FLOAT_IS_NOT_NAN: +- is_trait = isnan(actual) ? 1 : 0; +- break; +- +- case UNITY_FLOAT_IS_DET: /* A determinate number is non infinite and not NaN. */ +- case UNITY_FLOAT_IS_NOT_DET: +- is_trait = !isinf(actual) && !isnan(actual); +- break; +- +- default: +- trait_index = 0; +- trait_names[0] = UnityStrInvalidFloatTrait; +- break; +- } +- +- if (is_trait != should_be_trait) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrExpected); +- if (!should_be_trait) +- { +- UnityPrint(UnityStrNot); +- } +- UnityPrint(trait_names[trait_index]); +- UnityPrint(UnityStrWas); +-#ifndef UNITY_EXCLUDE_FLOAT_PRINT +- UnityPrintFloat(actual); +-#else +- if (should_be_trait) +- { +- UnityPrint(UnityStrNot); +- } +- UnityPrint(trait_names[trait_index]); +-#endif +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +-} +- +-#endif /* not UNITY_EXCLUDE_DOUBLE */ +- +-/*-----------------------------------------------*/ +-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) +-{ +- RETURN_IF_FAIL_OR_IGNORE; +- +- if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) +- { +- if (actual > expected) +- { +- Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); +- } +- else +- { +- Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); +- } +- } +- else +- { +- if ((UNITY_UINT)actual > (UNITY_UINT)expected) +- { +- Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); +- } +- else +- { +- Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); +- } +- } +- +- if (Unity.CurrentTestFailed) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrDelta); +- UnityPrintNumberByStyle((UNITY_INT)delta, style); +- UnityPrint(UnityStrExpected); +- UnityPrintNumberByStyle(expected, style); +- UnityPrint(UnityStrWas); +- UnityPrintNumberByStyle(actual, style); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityAssertNumbersArrayWithin(const UNITY_UINT delta, +- 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) +-{ +- UNITY_UINT32 elements = num_elements; +- unsigned int length = style & 0xF; +- unsigned int increment = 0; +- +- RETURN_IF_FAIL_OR_IGNORE; +- +- if (num_elements == 0) +- { +- UnityPrintPointlessAndBail(); +- } +- +- if (expected == actual) +- { +- return; /* Both are NULL or same pointer */ +- } +- +- if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) +- { +- UNITY_FAIL_AND_BAIL; +- } +- +- while ((elements > 0) && (elements--)) +- { +- UNITY_INT expect_val; +- UNITY_INT actual_val; +- +- switch (length) +- { +- case 1: +- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)expected; +- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)actual; +- increment = sizeof(UNITY_INT8); +- break; +- +- case 2: +- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)expected; +- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)actual; +- increment = sizeof(UNITY_INT16); +- break; +- +-#ifdef UNITY_SUPPORT_64 +- case 8: +- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)expected; +- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)actual; +- increment = sizeof(UNITY_INT64); +- break; +-#endif +- +- default: /* default is length 4 bytes */ +- case 4: +- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)expected; +- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)actual; +- increment = sizeof(UNITY_INT32); +- length = 4; +- break; +- } +- +- if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) +- { +- if (actual_val > expect_val) +- { +- Unity.CurrentTestFailed = (((UNITY_UINT)actual_val - (UNITY_UINT)expect_val) > delta); +- } +- else +- { +- Unity.CurrentTestFailed = (((UNITY_UINT)expect_val - (UNITY_UINT)actual_val) > delta); +- } +- } +- else +- { +- if ((UNITY_UINT)actual_val > (UNITY_UINT)expect_val) +- { +- Unity.CurrentTestFailed = (((UNITY_UINT)actual_val - (UNITY_UINT)expect_val) > delta); +- } +- else +- { +- Unity.CurrentTestFailed = (((UNITY_UINT)expect_val - (UNITY_UINT)actual_val) > delta); +- } +- } +- +- if (Unity.CurrentTestFailed) +- { +- if ((style & UNITY_DISPLAY_RANGE_UINT) && (length < (UNITY_INT_WIDTH / 8))) +- { /* For UINT, remove sign extension (padding 1's) from signed type casts above */ +- UNITY_INT mask = 1; +- mask = (mask << 8 * length) - 1; +- expect_val &= mask; +- actual_val &= mask; +- } +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrDelta); +- UnityPrintNumberByStyle((UNITY_INT)delta, style); +- UnityPrint(UnityStrElement); +- UnityPrintNumberUnsigned(num_elements - elements - 1); +- UnityPrint(UnityStrExpected); +- UnityPrintNumberByStyle(expect_val, style); +- UnityPrint(UnityStrWas); +- UnityPrintNumberByStyle(actual_val, style); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +- /* Walk through array by incrementing the pointers */ +- if (flags == UNITY_ARRAY_TO_ARRAY) +- { +- expected = (UNITY_INTERNAL_PTR)((const char*)expected + increment); +- } +- actual = (UNITY_INTERNAL_PTR)((const char*)actual + increment); +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityAssertEqualString(const char* expected, +- const char* actual, +- const char* msg, +- const UNITY_LINE_TYPE lineNumber) +-{ +- UNITY_UINT32 i; +- +- RETURN_IF_FAIL_OR_IGNORE; +- +- /* if both pointers not null compare the strings */ +- if (expected && actual) +- { +- for (i = 0; expected[i] || actual[i]; i++) +- { +- if (expected[i] != actual[i]) +- { +- Unity.CurrentTestFailed = 1; +- break; +- } +- } +- } +- else +- { /* handle case of one pointers being null (if both null, test should pass) */ +- if (expected != actual) +- { +- Unity.CurrentTestFailed = 1; +- } +- } +- +- if (Unity.CurrentTestFailed) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrintExpectedAndActualStrings(expected, actual); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +-} +- +-/*-----------------------------------------------*/ +-void UnityAssertEqualStringLen(const char* expected, +- const char* actual, +- const UNITY_UINT32 length, +- const char* msg, +- const UNITY_LINE_TYPE lineNumber) +-{ +- UNITY_UINT32 i; +- +- RETURN_IF_FAIL_OR_IGNORE; +- +- /* if both pointers not null compare the strings */ +- if (expected && actual) +- { +- for (i = 0; (i < length) && (expected[i] || actual[i]); i++) +- { +- if (expected[i] != actual[i]) +- { +- Unity.CurrentTestFailed = 1; +- break; +- } +- } +- } +- else +- { /* handle case of one pointers being null (if both null, test should pass) */ +- if (expected != actual) +- { +- Unity.CurrentTestFailed = 1; +- } +- } +- +- if (Unity.CurrentTestFailed) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrintExpectedAndActualStringsLen(expected, actual, length); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +-} +- +-/*-----------------------------------------------*/ +-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) +-{ +- UNITY_UINT32 i = 0; +- UNITY_UINT32 j = 0; +- const char* expd = NULL; +- const char* act = NULL; +- +- RETURN_IF_FAIL_OR_IGNORE; +- +- /* if no elements, it's an error */ +- if (num_elements == 0) +- { +- UnityPrintPointlessAndBail(); +- } +- +- if ((const void*)expected == (const void*)actual) +- { +- return; /* Both are NULL or same pointer */ +- } +- +- if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) +- { +- UNITY_FAIL_AND_BAIL; +- } +- +- if (flags != UNITY_ARRAY_TO_ARRAY) +- { +- expd = (const char*)expected; +- } +- +- do +- { +- act = actual[j]; +- if (flags == UNITY_ARRAY_TO_ARRAY) +- { +- expd = ((const char* const*)expected)[j]; +- } +- +- /* if both pointers not null compare the strings */ +- if (expd && act) +- { +- for (i = 0; expd[i] || act[i]; i++) +- { +- if (expd[i] != act[i]) +- { +- Unity.CurrentTestFailed = 1; +- break; +- } +- } +- } +- else +- { /* handle case of one pointers being null (if both null, test should pass) */ +- if (expd != act) +- { +- Unity.CurrentTestFailed = 1; +- } +- } +- +- if (Unity.CurrentTestFailed) +- { +- UnityTestResultsFailBegin(lineNumber); +- if (num_elements > 1) +- { +- UnityPrint(UnityStrElement); +- UnityPrintNumberUnsigned(j); +- } +- UnityPrintExpectedAndActualStrings(expd, act); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +- } while (++j < num_elements); +-} +- +-/*-----------------------------------------------*/ +-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) +-{ +- UNITY_PTR_ATTRIBUTE const unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; +- UNITY_PTR_ATTRIBUTE const unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE const unsigned char*)actual; +- UNITY_UINT32 elements = num_elements; +- UNITY_UINT32 bytes; +- +- RETURN_IF_FAIL_OR_IGNORE; +- +- if ((elements == 0) || (length == 0)) +- { +- UnityPrintPointlessAndBail(); +- } +- +- if (expected == actual) +- { +- return; /* Both are NULL or same pointer */ +- } +- +- if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) +- { +- UNITY_FAIL_AND_BAIL; +- } +- +- while (elements--) +- { +- bytes = length; +- while (bytes--) +- { +- if (*ptr_exp != *ptr_act) +- { +- UnityTestResultsFailBegin(lineNumber); +- UnityPrint(UnityStrMemory); +- if (num_elements > 1) +- { +- UnityPrint(UnityStrElement); +- UnityPrintNumberUnsigned(num_elements - elements - 1); +- } +- UnityPrint(UnityStrByte); +- UnityPrintNumberUnsigned(length - bytes - 1); +- UnityPrint(UnityStrExpected); +- UnityPrintNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8); +- UnityPrint(UnityStrWas); +- UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8); +- UnityAddMsgIfSpecified(msg); +- UNITY_FAIL_AND_BAIL; +- } +- ptr_exp++; +- ptr_act++; +- } +- if (flags == UNITY_ARRAY_TO_VAL) +- { +- ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; +- } +- } +-} +- +-/*-----------------------------------------------*/ +- +-static union +-{ +- UNITY_INT8 i8; +- UNITY_INT16 i16; +- UNITY_INT32 i32; +-#ifdef UNITY_SUPPORT_64 +- UNITY_INT64 i64; +-#endif +-#ifndef UNITY_EXCLUDE_FLOAT +- float f; +-#endif +-#ifndef UNITY_EXCLUDE_DOUBLE +- double d; +-#endif +-} UnityQuickCompare; +- +-UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size) +-{ +- switch(size) +- { +- case 1: +- UnityQuickCompare.i8 = (UNITY_INT8)num; +- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i8); +- +- case 2: +- UnityQuickCompare.i16 = (UNITY_INT16)num; +- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i16); +- +-#ifdef UNITY_SUPPORT_64 +- case 8: +- UnityQuickCompare.i64 = (UNITY_INT64)num; +- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i64); +-#endif +- +- default: /* 4 bytes */ +- UnityQuickCompare.i32 = (UNITY_INT32)num; +- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i32); +- } +-} +- +-#ifndef UNITY_EXCLUDE_FLOAT +-/*-----------------------------------------------*/ +-UNITY_INTERNAL_PTR UnityFloatToPtr(const float num) +-{ +- UnityQuickCompare.f = num; +- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.f); +-} +-#endif +- +-#ifndef UNITY_EXCLUDE_DOUBLE +-/*-----------------------------------------------*/ +-UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num) +-{ +- UnityQuickCompare.d = num; +- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.d); +-} +-#endif +- +-/*----------------------------------------------- +- * printf helper function +- *-----------------------------------------------*/ +-#ifdef UNITY_INCLUDE_PRINT_FORMATTED +-static void UnityPrintFVA(const char* format, va_list va) +-{ +- const char* pch = format; +- if (pch != NULL) +- { +- while (*pch) +- { +- /* format identification character */ +- if (*pch == '%') +- { +- pch++; +- +- if (pch != NULL) +- { +- switch (*pch) +- { +- case 'd': +- case 'i': +- { +- const int number = va_arg(va, int); +- UnityPrintNumber((UNITY_INT)number); +- break; +- } +-#ifndef UNITY_EXCLUDE_FLOAT_PRINT +- case 'f': +- case 'g': +- { +- const double number = va_arg(va, double); +- UnityPrintFloat((UNITY_DOUBLE)number); +- break; +- } +-#endif +- case 'u': +- { +- const unsigned int number = va_arg(va, unsigned int); +- UnityPrintNumberUnsigned((UNITY_UINT)number); +- break; +- } +- case 'b': +- { +- const unsigned int number = va_arg(va, unsigned int); +- const UNITY_UINT mask = (UNITY_UINT)0 - (UNITY_UINT)1; +- UNITY_OUTPUT_CHAR('0'); +- UNITY_OUTPUT_CHAR('b'); +- UnityPrintMask(mask, (UNITY_UINT)number); +- break; +- } +- case 'x': +- case 'X': +- case 'p': +- { +- const unsigned int number = va_arg(va, unsigned int); +- UNITY_OUTPUT_CHAR('0'); +- UNITY_OUTPUT_CHAR('x'); +- UnityPrintNumberHex((UNITY_UINT)number, 8); +- break; +- } +- case 'c': +- { +- const int ch = va_arg(va, int); +- UnityPrintChar((const char *)&ch); +- break; +- } +- case 's': +- { +- const char * string = va_arg(va, const char *); +- UnityPrint(string); +- break; +- } +- case '%': +- { +- UnityPrintChar(pch); +- break; +- } +- default: +- { +- /* print the unknown format character */ +- UNITY_OUTPUT_CHAR('%'); +- UnityPrintChar(pch); +- break; +- } +- } +- } +- } +-#ifdef UNITY_OUTPUT_COLOR +- /* print ANSI escape code */ +- else if ((*pch == 27) && (*(pch + 1) == '[')) +- { +- pch += UnityPrintAnsiEscapeString(pch); +- continue; +- } +-#endif +- else if (*pch == '\n') +- { +- UNITY_PRINT_EOL(); +- } +- else +- { +- UnityPrintChar(pch); +- } +- +- pch++; +- } +- } +-} +- +-void UnityPrintF(const UNITY_LINE_TYPE line, const char* format, ...) +-{ +- UnityTestResultsBegin(Unity.TestFile, line); +- UnityPrint("INFO"); +- if(format != NULL) +- { +- UnityPrint(": "); +- va_list va; +- va_start(va, format); +- UnityPrintFVA(format, va); +- va_end(va); +- } +- UNITY_PRINT_EOL(); +-} +-#endif /* ! UNITY_INCLUDE_PRINT_FORMATTED */ +- +- +-/*----------------------------------------------- +- * Control Functions +- *-----------------------------------------------*/ +- +-/*-----------------------------------------------*/ +-void UnityFail(const char* msg, const UNITY_LINE_TYPE line) +-{ +- RETURN_IF_FAIL_OR_IGNORE; +- +- UnityTestResultsBegin(Unity.TestFile, line); +- UnityPrint(UnityStrFail); +- if (msg != NULL) +- { +- UNITY_OUTPUT_CHAR(':'); +- +-#ifdef UNITY_PRINT_TEST_CONTEXT +- UNITY_PRINT_TEST_CONTEXT(); +-#endif +-#ifndef UNITY_EXCLUDE_DETAILS +- if (Unity.CurrentDetail1) +- { +- UnityPrint(UnityStrDetail1Name); +- UnityPrint(Unity.CurrentDetail1); +- if (Unity.CurrentDetail2) +- { +- UnityPrint(UnityStrDetail2Name); +- UnityPrint(Unity.CurrentDetail2); +- } +- UnityPrint(UnityStrSpacer); +- } +-#endif +- if (msg[0] != ' ') +- { +- UNITY_OUTPUT_CHAR(' '); +- } +- UnityPrint(msg); +- } +- +- UNITY_FAIL_AND_BAIL; +-} +- +-/*-----------------------------------------------*/ +-void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line) +-{ +- RETURN_IF_FAIL_OR_IGNORE; +- +- UnityTestResultsBegin(Unity.TestFile, line); +- UnityPrint(UnityStrIgnore); +- if (msg != NULL) +- { +- UNITY_OUTPUT_CHAR(':'); +- UNITY_OUTPUT_CHAR(' '); +- UnityPrint(msg); +- } +- UNITY_IGNORE_AND_BAIL; +-} +- +-/*-----------------------------------------------*/ +-void UnityMessage(const char* msg, const UNITY_LINE_TYPE line) +-{ +- UnityTestResultsBegin(Unity.TestFile, line); +- UnityPrint("INFO"); +- if (msg != NULL) +- { +- UNITY_OUTPUT_CHAR(':'); +- UNITY_OUTPUT_CHAR(' '); +- UnityPrint(msg); +- } +- UNITY_PRINT_EOL(); +-} +- +-/*-----------------------------------------------*/ +-/* If we have not defined our own test runner, then include our default test runner to make life easier */ +-#ifndef UNITY_SKIP_DEFAULT_RUNNER +-void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum) +-{ +- Unity.CurrentTestName = FuncName; +- Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum; +- Unity.NumberOfTests++; +- UNITY_CLR_DETAILS(); +- UNITY_EXEC_TIME_START(); +- if (TEST_PROTECT()) +- { +- setUp(); +- Func(); +- } +- if (TEST_PROTECT()) +- { +- tearDown(); +- } +- UNITY_EXEC_TIME_STOP(); +- UnityConcludeTest(); +-} +-#endif +- +-/*-----------------------------------------------*/ +-void UnitySetTestFile(const char* filename) +-{ +- Unity.TestFile = filename; +-} +- +-/*-----------------------------------------------*/ +-void UnityBegin(const char* filename) +-{ +- Unity.TestFile = filename; +- Unity.CurrentTestName = NULL; +- Unity.CurrentTestLineNumber = 0; +- Unity.NumberOfTests = 0; +- Unity.TestFailures = 0; +- Unity.TestIgnores = 0; +- Unity.CurrentTestFailed = 0; +- Unity.CurrentTestIgnored = 0; +- +- UNITY_CLR_DETAILS(); +- UNITY_OUTPUT_START(); +-} +- +-/*-----------------------------------------------*/ +-int UnityEnd(void) +-{ +- UNITY_PRINT_EOL(); +- UnityPrint(UnityStrBreaker); +- UNITY_PRINT_EOL(); +- UnityPrintNumber((UNITY_INT)(Unity.NumberOfTests)); +- UnityPrint(UnityStrResultsTests); +- UnityPrintNumber((UNITY_INT)(Unity.TestFailures)); +- UnityPrint(UnityStrResultsFailures); +- UnityPrintNumber((UNITY_INT)(Unity.TestIgnores)); +- UnityPrint(UnityStrResultsIgnored); +- UNITY_PRINT_EOL(); +- if (Unity.TestFailures == 0U) +- { +- UnityPrint(UnityStrOk); +- } +- else +- { +- UnityPrint(UnityStrFail); +-#ifdef UNITY_DIFFERENTIATE_FINAL_FAIL +- UNITY_OUTPUT_CHAR('E'); UNITY_OUTPUT_CHAR('D'); +-#endif +- } +- UNITY_PRINT_EOL(); +- UNITY_FLUSH_CALL(); +- UNITY_OUTPUT_COMPLETE(); +- return (int)(Unity.TestFailures); +-} +- +-/*----------------------------------------------- +- * Command Line Argument Support +- *-----------------------------------------------*/ +-#ifdef UNITY_USE_COMMAND_LINE_ARGS +- +-char* UnityOptionIncludeNamed = NULL; +-char* UnityOptionExcludeNamed = NULL; +-int UnityVerbosity = 1; +- +-/*-----------------------------------------------*/ +-int UnityParseOptions(int argc, char** argv) +-{ +- int i; +- UnityOptionIncludeNamed = NULL; +- UnityOptionExcludeNamed = NULL; +- +- for (i = 1; i < argc; i++) +- { +- if (argv[i][0] == '-') +- { +- switch (argv[i][1]) +- { +- case 'l': /* list tests */ +- return -1; +- case 'n': /* include tests with name including this string */ +- case 'f': /* an alias for -n */ +- if (argv[i][2] == '=') +- { +- UnityOptionIncludeNamed = &argv[i][3]; +- } +- else if (++i < argc) +- { +- UnityOptionIncludeNamed = argv[i]; +- } +- else +- { +- UnityPrint("ERROR: No Test String to Include Matches For"); +- UNITY_PRINT_EOL(); +- return 1; +- } +- break; +- case 'q': /* quiet */ +- UnityVerbosity = 0; +- break; +- case 'v': /* verbose */ +- UnityVerbosity = 2; +- break; +- case 'x': /* exclude tests with name including this string */ +- if (argv[i][2] == '=') +- { +- UnityOptionExcludeNamed = &argv[i][3]; +- } +- else if (++i < argc) +- { +- UnityOptionExcludeNamed = argv[i]; +- } +- else +- { +- UnityPrint("ERROR: No Test String to Exclude Matches For"); +- UNITY_PRINT_EOL(); +- return 1; +- } +- break; +- default: +- UnityPrint("ERROR: Unknown Option "); +- UNITY_OUTPUT_CHAR(argv[i][1]); +- UNITY_PRINT_EOL(); +- return 1; +- } +- } +- } +- +- return 0; +-} +- +-/*-----------------------------------------------*/ +-int IsStringInBiggerString(const char* longstring, const char* shortstring) +-{ +- const char* lptr = longstring; +- const char* sptr = shortstring; +- const char* lnext = lptr; +- +- if (*sptr == '*') +- { +- return 1; +- } +- +- while (*lptr) +- { +- lnext = lptr + 1; +- +- /* If they current bytes match, go on to the next bytes */ +- while (*lptr && *sptr && (*lptr == *sptr)) +- { +- lptr++; +- sptr++; +- +- /* We're done if we match the entire string or up to a wildcard */ +- if (*sptr == '*') +- return 1; +- if (*sptr == ',') +- return 1; +- if (*sptr == '"') +- return 1; +- if (*sptr == '\'') +- return 1; +- if (*sptr == ':') +- return 2; +- if (*sptr == 0) +- return 1; +- } +- +- /* Otherwise we start in the long pointer 1 character further and try again */ +- lptr = lnext; +- sptr = shortstring; +- } +- +- return 0; +-} +- +-/*-----------------------------------------------*/ +-int UnityStringArgumentMatches(const char* str) +-{ +- int retval; +- const char* ptr1; +- const char* ptr2; +- const char* ptrf; +- +- /* Go through the options and get the substrings for matching one at a time */ +- ptr1 = str; +- while (ptr1[0] != 0) +- { +- if ((ptr1[0] == '"') || (ptr1[0] == '\'')) +- { +- ptr1++; +- } +- +- /* look for the start of the next partial */ +- ptr2 = ptr1; +- ptrf = 0; +- do +- { +- ptr2++; +- if ((ptr2[0] == ':') && (ptr2[1] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ',')) +- { +- ptrf = &ptr2[1]; +- } +- } while ((ptr2[0] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ',')); +- +- while ((ptr2[0] != 0) && ((ptr2[0] == ':') || (ptr2[0] == '\'') || (ptr2[0] == '"') || (ptr2[0] == ','))) +- { +- ptr2++; +- } +- +- /* done if complete filename match */ +- retval = IsStringInBiggerString(Unity.TestFile, ptr1); +- if (retval == 1) +- { +- return retval; +- } +- +- /* done if testname match after filename partial match */ +- if ((retval == 2) && (ptrf != 0)) +- { +- if (IsStringInBiggerString(Unity.CurrentTestName, ptrf)) +- { +- return 1; +- } +- } +- +- /* done if complete testname match */ +- if (IsStringInBiggerString(Unity.CurrentTestName, ptr1) == 1) +- { +- return 1; +- } +- +- ptr1 = ptr2; +- } +- +- /* we couldn't find a match for any substrings */ +- return 0; +-} +- +-/*-----------------------------------------------*/ +-int UnityTestMatches(void) +-{ +- /* Check if this test name matches the included test pattern */ +- int retval; +- if (UnityOptionIncludeNamed) +- { +- retval = UnityStringArgumentMatches(UnityOptionIncludeNamed); +- } +- else +- { +- retval = 1; +- } +- +- /* Check if this test name matches the excluded test pattern */ +- if (UnityOptionExcludeNamed) +- { +- if (UnityStringArgumentMatches(UnityOptionExcludeNamed)) +- { +- retval = 0; +- } +- } +- +- return retval; +-} +- +-#endif /* UNITY_USE_COMMAND_LINE_ARGS */ +-/*-----------------------------------------------*/ +diff --git a/components/testframework/libs/cmock/vendor/unity/src/unity.h b/components/testframework/libs/cmock/vendor/unity/src/unity.h +deleted file mode 100644 +index 8caa78529a..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/src/unity.h ++++ /dev/null +@@ -1,661 +0,0 @@ +-/* ========================================== +- Unity Project - A Test Framework for C +- Copyright (c) 2007-19 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 +- +-#define UNITY_VERSION_MAJOR 2 +-#define UNITY_VERSION_MINOR 5 +-#define UNITY_VERSION_BUILD 1 +-#define UNITY_VERSION ((UNITY_VERSION_MAJOR << 16) | (UNITY_VERSION_MINOR << 8) | UNITY_VERSION_BUILD) +- +-#ifdef __cplusplus +-extern "C" +-{ +-#endif +- +-#include "unity_internals.h" +- +-/*------------------------------------------------------- +- * Test Setup / Teardown +- *-------------------------------------------------------*/ +- +-/* These functions are intended to be called before and after each test. +- * If using unity directly, these will need to be provided for each test +- * executable built. If you are using the test runner generator and/or +- * Ceedling, these are optional. */ +-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(). If using +- * Unity directly, you're in charge of calling these if they are desired. +- * If using Ceedling or the test runner generator, these will be called +- * automatically if they exist. */ +-void suiteSetUp(void); +-int suiteTearDown(int num_failures); +- +-/*------------------------------------------------------- +- * Test Reset and Verify +- *-------------------------------------------------------*/ +- +-/* These functions are intended to be called before during tests in order +- * to support complex test loops, etc. Both are NOT built into Unity. Instead +- * the test runner generator will create them. resetTest will run teardown and +- * setup again, verifying any end-of-test needs between. verifyTest will only +- * run the verification. */ +-void resetTest(void); +-void verifyTest(void); +- +-/*------------------------------------------------------- +- * 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_MESSAGE(message) UnityMessage((message), __LINE__) +-#define TEST_ONLY() +-#ifdef UNITY_INCLUDE_PRINT_FORMATTED +-#define TEST_PRINTF(message, ...) UnityPrintF(__LINE__, (message), __VA_ARGS__) +-#endif +- +-/* 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() +-#define TEST_PASS_MESSAGE(message) do { UnityMessage((message), __LINE__); TEST_ABORT(); } while(0) +- +-/* 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") +-#define TEST_ASSERT_EMPTY(pointer) UNITY_TEST_ASSERT_EMPTY( (pointer), __LINE__, " Expected Empty") +-#define TEST_ASSERT_NOT_EMPTY(pointer) UNITY_TEST_ASSERT_NOT_EMPTY((pointer), __LINE__, " Expected Non-Empty") +- +-/* 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_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_size_t(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT((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_EQUAL_CHAR(expected, actual) UNITY_TEST_ASSERT_EQUAL_CHAR((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 Not Equal To (of all sizes) */ +-#define TEST_ASSERT_NOT_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT8((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT16((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT32((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_INT64((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT8((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT16((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT32((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT64((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_size_t(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX8((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_NOT_EQUAL_CHAR((threshold), (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_size_t(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT((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_GREATER_THAN_CHAR(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_CHAR((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_size_t(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((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_LESS_THAN_CHAR(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_CHAR((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_size_t(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((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_GREATER_OR_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR((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_size_t(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((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) +-#define TEST_ASSERT_LESS_OR_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR((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_size_t_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT_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) +-#define TEST_ASSERT_CHAR_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_CHAR_WITHIN((delta), (expected), (actual), __LINE__, NULL) +- +-/* Integer Array Ranges (of all sizes) */ +-#define TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_INT8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_INT16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_INT32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_UINT_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_UINT8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_UINT16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_UINT32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_size_t_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_HEX_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +-#define TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __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_size_t_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT_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) +-#define TEST_ASSERT_EQUAL_CHAR_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY((expected), (actual), (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_size_t(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((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) +-#define TEST_ASSERT_EACH_EQUAL_CHAR(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_CHAR((expected), (actual), (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) +- +-/* Shorthand */ +-#ifdef UNITY_SHORTHAND_AS_OLD +-#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") +-#endif +-#ifdef UNITY_SHORTHAND_AS_INT +-#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +-#endif +-#ifdef UNITY_SHORTHAND_AS_MEM +-#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_MEMORY((&expected), (&actual), sizeof(expected), __LINE__, NULL) +-#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +-#endif +-#ifdef UNITY_SHORTHAND_AS_RAW +-#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) == (actual)), __LINE__, " Expected Equal") +-#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, " Expected Not-Equal") +-#endif +-#ifdef UNITY_SHORTHAND_AS_NONE +-#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +-#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +-#endif +- +-/*------------------------------------------------------- +- * 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)) +-#define TEST_ASSERT_EMPTY_MESSAGE(pointer, message) UNITY_TEST_ASSERT_EMPTY( (pointer), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EMPTY_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NOT_EMPTY((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_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_size_t_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT( (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)) +-#define TEST_ASSERT_EQUAL_CHAR_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_CHAR((expected), (actual), __LINE__, (message)) +- +-/* Integer Not Equal To (of all sizes) */ +-#define TEST_ASSERT_NOT_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT8((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT16((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT32((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_INT64((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT8((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT16((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT32((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT64((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_UINT((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX8((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_NOT_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_NOT_EQUAL_CHAR((threshold), (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_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT((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_GREATER_THAN_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_CHAR((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_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((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_LESS_THAN_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_CHAR((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_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((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_GREATER_OR_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR((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_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((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_OR_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_LESS_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) +-#define TEST_ASSERT_LESS_OR_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR((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_size_t_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT_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)) +-#define TEST_ASSERT_CHAR_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_CHAR_WITHIN((delta), (expected), (actual), __LINE__, (message)) +- +-/* Integer Array Ranges (of all sizes) */ +-#define TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_INT32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_UINT32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_size_t_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_HEX_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +-#define TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __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_size_t_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT_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)) +-#define TEST_ASSERT_EQUAL_CHAR_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY((expected), (actual), (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_size_t_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((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)) +-#define TEST_ASSERT_EACH_EQUAL_CHAR_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_CHAR((expected), (actual), (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)) +- +-/* Shorthand */ +-#ifdef UNITY_SHORTHAND_AS_OLD +-#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)) +-#endif +-#ifdef UNITY_SHORTHAND_AS_INT +-#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_FAIL(__LINE__, UnityStrErrShorthand) +-#endif +-#ifdef UNITY_SHORTHAND_AS_MEM +-#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_MEMORY((&expected), (&actual), sizeof(expected), __LINE__, message) +-#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +-#endif +-#ifdef UNITY_SHORTHAND_AS_RAW +-#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) == (actual)), __LINE__, message) +-#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, message) +-#endif +-#ifdef UNITY_SHORTHAND_AS_NONE +-#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +-#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand) +-#endif +- +-/* end of UNITY_FRAMEWORK_H */ +-#ifdef __cplusplus +-} +-#endif +-#endif +diff --git a/components/testframework/libs/cmock/vendor/unity/src/unity_internals.h b/components/testframework/libs/cmock/vendor/unity/src/unity_internals.h +deleted file mode 100644 +index d7c2116c77..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/src/unity_internals.h ++++ /dev/null +@@ -1,1030 +0,0 @@ +-/* ========================================== +- Unity Project - A Test Framework for C +- Copyright (c) 2007-19 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 +- +-#ifdef UNITY_INCLUDE_CONFIG_H +-#include "unity_config.h" +-#endif +- +-#ifndef UNITY_EXCLUDE_SETJMP_H +-#include +-#endif +- +-#ifndef UNITY_EXCLUDE_MATH_H +-#include +-#endif +- +-#ifndef UNITY_EXCLUDE_STDDEF_H +-#include +-#endif +- +-#ifdef UNITY_INCLUDE_PRINT_FORMATTED +-#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. +- * Also sizeof(int) does return the size in addressable units on all platforms, +- * which may not necessarily be the size in bytes. +- * 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 +- *-------------------------------------------------------*/ +- +-/* Auto-detect 64 Bit Support */ +-#ifndef UNITY_SUPPORT_64 +- #if UNITY_LONG_WIDTH == 64 || UNITY_POINTER_WIDTH == 64 +- #define UNITY_SUPPORT_64 +- #endif +-#endif +- +-/* 64-Bit Support Dependent Configuration */ +-#ifndef UNITY_SUPPORT_64 +- /* No 64-bit Support */ +- typedef UNITY_UINT32 UNITY_UINT; +- typedef UNITY_INT32 UNITY_INT; +- #define UNITY_MAX_NIBBLES (8) /* Maximum number of nibbles in a UNITY_(U)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; +- #define UNITY_MAX_NIBBLES (16) /* Maximum number of nibbles in a UNITY_(U)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 +- /* If defined as something else, make sure we declare it here so it's ready for use */ +- #ifdef UNITY_OUTPUT_FLUSH_HEADER_DECLARATION +- extern void UNITY_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 +- +-#ifdef UNITY_INCLUDE_EXEC_TIME +- #if !defined(UNITY_EXEC_TIME_START) && \ +- !defined(UNITY_EXEC_TIME_STOP) && \ +- !defined(UNITY_PRINT_EXEC_TIME) && \ +- !defined(UNITY_TIME_TYPE) +- /* If none any of these macros are defined then try to provide a default implementation */ +- +- #if defined(UNITY_CLOCK_MS) +- /* This is a simple way to get a default implementation on platforms that support getting a millisecond counter */ +- #define UNITY_TIME_TYPE UNITY_UINT +- #define UNITY_EXEC_TIME_START() Unity.CurrentTestStartTime = UNITY_CLOCK_MS() +- #define UNITY_EXEC_TIME_STOP() Unity.CurrentTestStopTime = UNITY_CLOCK_MS() +- #define UNITY_PRINT_EXEC_TIME() { \ +- UNITY_UINT execTimeMs = (Unity.CurrentTestStopTime - Unity.CurrentTestStartTime); \ +- UnityPrint(" ("); \ +- UnityPrintNumberUnsigned(execTimeMs); \ +- UnityPrint(" ms)"); \ +- } +- #elif defined(_WIN32) +- #include +- #define UNITY_TIME_TYPE clock_t +- #define UNITY_GET_TIME(t) t = (clock_t)((clock() * 1000) / CLOCKS_PER_SEC) +- #define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime) +- #define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime) +- #define UNITY_PRINT_EXEC_TIME() { \ +- UNITY_UINT execTimeMs = (Unity.CurrentTestStopTime - Unity.CurrentTestStartTime); \ +- UnityPrint(" ("); \ +- UnityPrintNumberUnsigned(execTimeMs); \ +- UnityPrint(" ms)"); \ +- } +- #elif defined(__unix__) +- #include +- #define UNITY_TIME_TYPE struct timespec +- #define UNITY_GET_TIME(t) clock_gettime(CLOCK_MONOTONIC, &t) +- #define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime) +- #define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime) +- #define UNITY_PRINT_EXEC_TIME() { \ +- UNITY_UINT execTimeMs = ((Unity.CurrentTestStopTime.tv_sec - Unity.CurrentTestStartTime.tv_sec) * 1000L); \ +- execTimeMs += ((Unity.CurrentTestStopTime.tv_nsec - Unity.CurrentTestStartTime.tv_nsec) / 1000000L); \ +- UnityPrint(" ("); \ +- UnityPrintNumberUnsigned(execTimeMs); \ +- UnityPrint(" ms)"); \ +- } +- #endif +- #endif +-#endif +- +-#ifndef UNITY_EXEC_TIME_START +-#define UNITY_EXEC_TIME_START() do{}while(0) +-#endif +- +-#ifndef UNITY_EXEC_TIME_STOP +-#define UNITY_EXEC_TIME_STOP() do{}while(0) +-#endif +- +-#ifndef UNITY_TIME_TYPE +-#define UNITY_TIME_TYPE UNITY_UINT +-#endif +- +-#ifndef UNITY_PRINT_EXEC_TIME +-#define UNITY_PRINT_EXEC_TIME() do{}while(0) +-#endif +- +-/*------------------------------------------------------- +- * Footprint +- *-------------------------------------------------------*/ +- +-#ifndef UNITY_LINE_TYPE +-#define UNITY_LINE_TYPE UNITY_UINT +-#endif +- +-#ifndef UNITY_COUNTER_TYPE +-#define UNITY_COUNTER_TYPE UNITY_UINT +-#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) +-#define UNITY_DISPLAY_RANGE_CHAR (0x80) +- +-typedef enum +-{ +- UNITY_DISPLAY_STYLE_INT = (UNITY_INT_WIDTH / 8) + 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 = (UNITY_INT_WIDTH / 8) + 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_CHAR = 1 + UNITY_DISPLAY_RANGE_CHAR + UNITY_DISPLAY_RANGE_INT, +- +- UNITY_DISPLAY_STYLE_UNKNOWN +-} UNITY_DISPLAY_STYLE_T; +- +-typedef enum +-{ +- UNITY_WITHIN = 0x0, +- UNITY_EQUAL_TO = 0x1, +- UNITY_GREATER_THAN = 0x2, +- UNITY_GREATER_OR_EQUAL = 0x2 + UNITY_EQUAL_TO, +- UNITY_SMALLER_THAN = 0x4, +- UNITY_SMALLER_OR_EQUAL = 0x4 + UNITY_EQUAL_TO, +- UNITY_NOT_EQUAL = 0x0, +- UNITY_UNKNOWN +-} 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_ARRAY_UNKNOWN +-} 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; +-#ifdef UNITY_INCLUDE_EXEC_TIME +- UNITY_TIME_TYPE CurrentTestStartTime; +- UNITY_TIME_TYPE CurrentTestStopTime; +-#endif +-#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 UnitySetTestFile(const char* filename); +-void UnityConcludeTest(void); +- +-#ifndef RUN_TEST +-void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum); +-#else +-#define UNITY_SKIP_DEFAULT_RUNNER +-#endif +- +-/*------------------------------------------------------- +- * 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 +- +-#ifdef UNITY_PRINT_TEST_CONTEXT +-void UNITY_PRINT_TEST_CONTEXT(void); +-#endif +- +-/*------------------------------------------------------- +- * Test Output +- *-------------------------------------------------------*/ +- +-void UnityPrint(const char* string); +- +-#ifdef UNITY_INCLUDE_PRINT_FORMATTED +-void UnityPrintF(const UNITY_LINE_TYPE line, const char* format, ...); +-#endif +- +-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_to_print); +-void UnityPrintNumberUnsigned(const UNITY_UINT number); +-void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print); +- +-#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 UnityAssertNumbersArrayWithin(const UNITY_UINT delta, +- 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 UnityFail(const char* message, const UNITY_LINE_TYPE line); +-void UnityIgnore(const char* message, const UNITY_LINE_TYPE line); +-void UnityMessage(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 UnityStrOk[]; +-extern const char UnityStrPass[]; +-extern const char UnityStrFail[]; +-extern const char UnityStrIgnore[]; +- +-extern const char UnityStrErrFloat[]; +-extern const char UnityStrErrDouble[]; +-extern const char UnityStrErr64[]; +-extern const char UnityStrErrShorthand[]; +- +-/*------------------------------------------------------- +- * 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 UNITY_SUPPORT_VARIADIC_MACROS +-#endif +-#endif +-#ifdef UNITY_SUPPORT_VARIADIC_MACROS +-#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 +- +-/* 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 +- +-#ifndef UNITY_SHORTHAND_AS_INT +-#ifndef UNITY_SHORTHAND_AS_MEM +-#ifndef UNITY_SHORTHAND_AS_NONE +-#ifndef UNITY_SHORTHAND_AS_RAW +-#define UNITY_SHORTHAND_AS_OLD +-#endif +-#endif +-#endif +-#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) do {if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), (message));}} while(0) +-#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_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) == 0), (UNITY_LINE_TYPE)(line), (message)) +-#define UNITY_TEST_ASSERT_NOT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) != 0), (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_EQUAL_CHAR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) +-#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_NOT_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) +- +-#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_GREATER_THAN_CHAR(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_CHAR) +- +-#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_SMALLER_THAN_CHAR(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_CHAR) +- +-#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_GREATER_OR_EQUAL_CHAR(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_CHAR) +- +-#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_SMALLER_OR_EQUAL_CHAR(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_CHAR) +- +-#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_CHAR_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_CHAR) +- +-#define UNITY_TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (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_INT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (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_INT16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (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_INT32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (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_UINT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (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_UINT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (UNITY_UINT16)(delta), (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_UINT16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (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_UINT32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (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_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (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_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (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_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (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_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY) +- +- +-#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_EQUAL_CHAR_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_CHAR, UNITY_ARRAY_TO_ARRAY) +- +-#define UNITY_TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) (expected), (UNITY_INT_WIDTH / 8)), (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), (UNITY_INT_WIDTH / 8)), (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), (UNITY_POINTER_WIDTH / 8)), (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) +-#define UNITY_TEST_ASSERT_EACH_EQUAL_CHAR(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_CHAR, 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_NOT_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) +-#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (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) +-#define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (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_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (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_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (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) +-#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) +-#define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +-#define UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) +-#define UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements, 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/components/testframework/libs/cmock/vendor/unity/test/.rubocop.yml b/components/testframework/libs/cmock/vendor/unity/test/.rubocop.yml +deleted file mode 100644 +index 6c9542f52b..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/.rubocop.yml ++++ /dev/null +@@ -1,76 +0,0 @@ +-# This is the configuration used to check the rubocop source code. +- +-#inherit_from: .rubocop_todo.yml +- +-AllCops: +- TargetRubyVersion: 2.3 +- +-# These are areas where ThrowTheSwitch's coding style diverges from the Ruby standard +-Style/SpecialGlobalVars: +- EnforcedStyle: use_perl_names +-Style/FormatString: +- Enabled: false +-Style/GlobalVars: +- Enabled: false +-Style/FrozenStringLiteralComment: +- Enabled: false +-Style/RegexpLiteral: +- AllowInnerSlashes: true +-Style/HashSyntax: +- EnforcedStyle: no_mixed_keys +-Style/NumericPredicate: +- Enabled: false +-Style/MultilineBlockChain: +- Enabled: false +-Style/Alias: +- Enabled: false +-Style/EvalWithLocation: +- Enabled: false +-Style/MixinUsage: +- Enabled: false +- +-# These are also places we diverge... but we will likely comply down the road +-Style/IfUnlessModifier: +- Enabled: false +-Style/FormatStringToken: +- Enabled: false +- +-# This is disabled because it seems to get confused over nested hashes +-Layout/AlignHash: +- Enabled: false +- EnforcedHashRocketStyle: table +- EnforcedColonStyle: table +- +-# We purposefully use these insecure features because they're what makes Ruby awesome +-Security/Eval: +- Enabled: false +-Security/YAMLLoad: +- Enabled: false +- +-# At this point, we're not ready to enforce inline documentation requirements +-Style/Documentation: +- Enabled: false +-Style/DocumentationMethod: +- Enabled: false +- +-# At this point, we're not ready to enforce any metrics +-Metrics/AbcSize: +- Enabled: false +-Metrics/BlockLength: +- Enabled: false +-Metrics/BlockNesting: +- Enabled: false +-Metrics/ClassLength: +- Enabled: false +-Metrics/CyclomaticComplexity: +- Enabled: false +-Metrics/LineLength: +- Enabled: false +-Metrics/MethodLength: +- Enabled: false +-Metrics/ModuleLength: +- Enabled: false +-Metrics/ParameterLists: +- Enabled: false +-Metrics/PerceivedComplexity: +- Enabled: false +diff --git a/components/testframework/libs/cmock/vendor/unity/test/Makefile b/components/testframework/libs/cmock/vendor/unity/test/Makefile +deleted file mode 100644 +index d8d10d22e2..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/Makefile ++++ /dev/null +@@ -1,159 +0,0 @@ +-CC = gcc +-ifeq ($(shell uname -s), Darwin) +-CC = clang +-endif +-ifeq ($(findstring clang, $(CC)), clang) +-E = -Weverything +-CFLAGS += $E -Wno-unknown-warning-option -Wno-missing-prototypes +-CFLAGS += -Wno-unused-macros -Wno-padded -Wno-missing-noreturn +-endif +-CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror +-#CFLAGS += -Wconversion #disabled because if falsely complains about the isinf and isnan macros +-CFLAGS += -Wno-switch-enum -Wno-double-promotion +-CFLAGS += -Wbad-function-cast -Wcast-qual -Wold-style-definition -Wshadow -Wstrict-overflow \ +- -Wstrict-prototypes -Wswitch-default -Wundef +-#DEBUG = -O0 -g +-CFLAGS += $(DEBUG) +-UNITY_SUPPORT_64 = -D UNITY_SUPPORT_64 +-UNITY_INCLUDE_DOUBLE = -D UNITY_INCLUDE_DOUBLE +-DEFINES = -D UNITY_OUTPUT_CHAR=putcharSpy +-DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=putcharSpy\(int\) +-DEFINES += -D UNITY_OUTPUT_FLUSH=flushSpy +-DEFINES += -D UNITY_OUTPUT_FLUSH_HEADER_DECLARATION=flushSpy\(void\) +-DEFINES += $(UNITY_SUPPORT_64) $(UNITY_INCLUDE_DOUBLE) +-SRC1 = ../src/unity.c tests/test_unity_arrays.c build/test_unity_arraysRunner.c +-SRC2 = ../src/unity.c tests/test_unity_core.c build/test_unity_coreRunner.c +-SRC3 = ../src/unity.c tests/test_unity_doubles.c build/test_unity_doublesRunner.c +-SRC4 = ../src/unity.c tests/test_unity_floats.c build/test_unity_floatsRunner.c +-SRC5 = ../src/unity.c tests/test_unity_integers.c build/test_unity_integersRunner.c +-SRC6 = ../src/unity.c tests/test_unity_integers_64.c build/test_unity_integers_64Runner.c +-SRC7 = ../src/unity.c tests/test_unity_memory.c build/test_unity_memoryRunner.c +-SRC8 = ../src/unity.c tests/test_unity_strings.c build/test_unity_stringsRunner.c +-INC_DIR = -I ../src +-COV_FLAGS = -fprofile-arcs -ftest-coverage -I ../../src +-BUILD_DIR = build +-TARGET = build/testunity-cov.exe +- +-# To generate coverage, call 'make -s', the default target runs. +-# For verbose output of all the tests, run 'make test'. +-default: coverage +-.PHONY: default coverage test clean +-coverage: $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5) $(SRC6) $(SRC7) $(SRC8) +- cd $(BUILD_DIR) && \ +- $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC1), ../$i) $(COV_FLAGS) -o ../$(TARGET) +- rm -f $(BUILD_DIR)/*.gcda +- ./$(TARGET) | grep 'Tests\|]]]' -A1 +- cd $(BUILD_DIR) && \ +- gcov unity.c | head -3 +- grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true +- cd $(BUILD_DIR) && \ +- $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC2), ../$i) $(COV_FLAGS) -o ../$(TARGET) +- rm -f $(BUILD_DIR)/*.gcda +- ./$(TARGET) | grep 'Tests\|]]]' -A1 +- cd $(BUILD_DIR) && \ +- gcov unity.c | head -3 +- grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true +- cd $(BUILD_DIR) && \ +- $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC3), ../$i) $(COV_FLAGS) -o ../$(TARGET) +- rm -f $(BUILD_DIR)/*.gcda +- ./$(TARGET) | grep 'Tests\|]]]' -A1 +- cd $(BUILD_DIR) && \ +- gcov unity.c | head -3 +- grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true +- cd $(BUILD_DIR) && \ +- $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC4), ../$i) $(COV_FLAGS) -o ../$(TARGET) +- rm -f $(BUILD_DIR)/*.gcda +- ./$(TARGET) | grep 'Tests\|]]]' -A1 +- cd $(BUILD_DIR) && \ +- gcov unity.c | head -3 +- grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true +- cd $(BUILD_DIR) && \ +- $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC5), ../$i) $(COV_FLAGS) -o ../$(TARGET) +- rm -f $(BUILD_DIR)/*.gcda +- ./$(TARGET) | grep 'Tests\|]]]' -A1 +- cd $(BUILD_DIR) && \ +- gcov unity.c | head -3 +- grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true +- cd $(BUILD_DIR) && \ +- $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC6), ../$i) $(COV_FLAGS) -o ../$(TARGET) +- rm -f $(BUILD_DIR)/*.gcda +- ./$(TARGET) | grep 'Tests\|]]]' -A1 +- cd $(BUILD_DIR) && \ +- gcov unity.c | head -3 +- grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true +- cd $(BUILD_DIR) && \ +- $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC7), ../$i) $(COV_FLAGS) -o ../$(TARGET) +- rm -f $(BUILD_DIR)/*.gcda +- ./$(TARGET) | grep 'Tests\|]]]' -A1 +- cd $(BUILD_DIR) && \ +- gcov unity.c | head -3 +- grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true +- cd $(BUILD_DIR) && \ +- $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC8), ../$i) $(COV_FLAGS) -o ../$(TARGET) +- rm -f $(BUILD_DIR)/*.gcda +- ./$(TARGET) | grep 'Tests\|]]]' -A1 +- cd $(BUILD_DIR) && \ +- gcov unity.c | head -3 +- grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true +- +-test: $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5) $(SRC6) $(SRC7) $(SRC8) +- $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC1) -o $(TARGET) +- ./$(TARGET) +- $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC2) -o $(TARGET) +- ./$(TARGET) +- $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC3) -o $(TARGET) +- ./$(TARGET) +- $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC4) -o $(TARGET) +- ./$(TARGET) +- $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC5) -o $(TARGET) +- ./$(TARGET) +- $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC6) -o $(TARGET) +- ./$(TARGET) +- $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC7) -o $(TARGET) +- ./$(TARGET) +- $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC8) -o $(TARGET) +- ./$(TARGET) +- +-# Compile only, for testing that preprocessor detection works +-UNITY_C_ONLY =-c ../src/unity.c -o $(BUILD_DIR)/unity.o +-intDetection: +- $(CC) $(CFLAGS) $(INC_DIR) $(UNITY_C_ONLY) -D UNITY_EXCLUDE_STDINT_H +- $(CC) $(CFLAGS) $(INC_DIR) $(UNITY_C_ONLY) -D UNITY_EXCLUDE_LIMITS_H +- +-$(BUILD_DIR)/test_unity_arraysRunner.c: tests/test_unity_arrays.c | $(BUILD_DIR) +- awk $(AWK_SCRIPT) tests/test_unity_arrays.c > $@ +- +-$(BUILD_DIR)/test_unity_coreRunner.c: tests/test_unity_core.c | $(BUILD_DIR) +- awk $(AWK_SCRIPT) tests/test_unity_core.c > $@ +- +-$(BUILD_DIR)/test_unity_doublesRunner.c: tests/test_unity_doubles.c | $(BUILD_DIR) +- awk $(AWK_SCRIPT) tests/test_unity_doubles.c > $@ +- +-$(BUILD_DIR)/test_unity_floatsRunner.c: tests/test_unity_floats.c | $(BUILD_DIR) +- awk $(AWK_SCRIPT) tests/test_unity_floats.c > $@ +- +-$(BUILD_DIR)/test_unity_integersRunner.c: tests/test_unity_integers.c | $(BUILD_DIR) +- awk $(AWK_SCRIPT) tests/test_unity_integers.c > $@ +- +-$(BUILD_DIR)/test_unity_integers_64Runner.c: tests/test_unity_integers_64.c | $(BUILD_DIR) +- awk $(AWK_SCRIPT) tests/test_unity_integers_64.c > $@ +- +-$(BUILD_DIR)/test_unity_memoryRunner.c: tests/test_unity_memory.c | $(BUILD_DIR) +- awk $(AWK_SCRIPT) tests/test_unity_memory.c > $@ +- +-$(BUILD_DIR)/test_unity_stringsRunner.c: tests/test_unity_strings.c | $(BUILD_DIR) +- awk $(AWK_SCRIPT) tests/test_unity_strings.c > $@ +- +-AWK_SCRIPT=\ +- '/^void test/{ declarations[d++]=$$0; gsub(/\(?void\)? ?/,""); tests[t++]=$$0; line[u++]=NR } \ +- END{ print "\#include \"unity.h\" /* Autogenerated by awk in Makefile */" ; \ +- for (i=0; i +-#include +-#include "CException.h" +-#include "funky.h" +-#include "stanky.h" +-#include +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +-extern void test_TheThirdThingToTest(void); +-extern void test_TheFourthThingToTest(void); +- +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/testsample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- RUN_TEST(test_TheThirdThingToTest, 53); +- RUN_TEST(test_TheFourthThingToTest, 58); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_def.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_def.c +deleted file mode 100644 +index b8ad559f64..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_def.c ++++ /dev/null +@@ -1,57 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "funky.h" +-#include "stanky.h" +-#include +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +-extern void test_TheThirdThingToTest(void); +-extern void test_TheFourthThingToTest(void); +- +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/testsample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- RUN_TEST(test_TheThirdThingToTest, 53); +- RUN_TEST(test_TheFourthThingToTest, 58); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.c +deleted file mode 100644 +index 1d01551e83..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.c ++++ /dev/null +@@ -1,55 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "testsample_head1.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +-extern void test_TheThirdThingToTest(void); +-extern void test_TheFourthThingToTest(void); +- +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/testsample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- RUN_TEST(test_TheThirdThingToTest, 53); +- RUN_TEST(test_TheFourthThingToTest, 58); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.h b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_head1.h +deleted file mode 100644 +index da6b7ab26b..0000000000 +--- a/components/testframework/libs/cmock/vendor/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/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +deleted file mode 100644 +index 45a09af22e..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c ++++ /dev/null +@@ -1,80 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- CMock_Init(); \ +- UNITY_CLR_DETAILS(); \ +- if (TEST_PROTECT()) \ +- { \ +- CEXCEPTION_T e; \ +- Try { \ +- setUp(); \ +- TestFunc(); \ +- } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- CMock_Verify(); \ +- } \ +- CMock_Destroy(); \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include "cmock.h" +-#include +-#include +-#include "CException.h" +-#include "funky.h" +-#include +-#include "Mockstanky.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +- +- +-/*=======Mock Management=====*/ +-static void CMock_Init(void) +-{ +- Mockstanky_Init(); +-} +-static void CMock_Verify(void) +-{ +- Mockstanky_Verify(); +-} +-static void CMock_Destroy(void) +-{ +- Mockstanky_Destroy(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- CMock_Verify(); +- CMock_Destroy(); +- tearDown(); +- CMock_Init(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/mocksample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- +- CMock_Guts_MemFreeFinal(); +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_def.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +deleted file mode 100644 +index a7a26078be..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_def.c ++++ /dev/null +@@ -1,76 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- CMock_Init(); \ +- UNITY_CLR_DETAILS(); \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- CMock_Verify(); \ +- } \ +- CMock_Destroy(); \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include "cmock.h" +-#include +-#include +-#include "funky.h" +-#include +-#include "Mockstanky.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +- +- +-/*=======Mock Management=====*/ +-static void CMock_Init(void) +-{ +- Mockstanky_Init(); +-} +-static void CMock_Verify(void) +-{ +- Mockstanky_Verify(); +-} +-static void CMock_Destroy(void) +-{ +- Mockstanky_Destroy(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- CMock_Verify(); +- CMock_Destroy(); +- tearDown(); +- CMock_Init(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/mocksample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- +- CMock_Guts_MemFreeFinal(); +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c +deleted file mode 100644 +index 45829fe7e0..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c ++++ /dev/null +@@ -1,75 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- CMock_Init(); \ +- UNITY_CLR_DETAILS(); \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- CMock_Verify(); \ +- } \ +- CMock_Destroy(); \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include "cmock.h" +-#include +-#include +-#include "testsample_mock_head1.h" +-#include "Mockstanky.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +- +- +-/*=======Mock Management=====*/ +-static void CMock_Init(void) +-{ +- Mockstanky_Init(); +-} +-static void CMock_Verify(void) +-{ +- Mockstanky_Verify(); +-} +-static void CMock_Destroy(void) +-{ +- Mockstanky_Destroy(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- CMock_Verify(); +- CMock_Destroy(); +- tearDown(); +- CMock_Init(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/mocksample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- +- CMock_Guts_MemFreeFinal(); +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h +deleted file mode 100644 +index 30c509ad07..0000000000 +--- a/components/testframework/libs/cmock/vendor/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/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +deleted file mode 100644 +index 0061822e50..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c ++++ /dev/null +@@ -1,89 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- CMock_Init(); \ +- UNITY_CLR_DETAILS(); \ +- if (TEST_PROTECT()) \ +- { \ +- CEXCEPTION_T e; \ +- Try { \ +- setUp(); \ +- TestFunc(); \ +- } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- CMock_Verify(); \ +- } \ +- CMock_Destroy(); \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include "cmock.h" +-#include +-#include +-#include "CException.h" +-#include "one.h" +-#include "two.h" +-#include "funky.h" +-#include +-#include "Mockstanky.h" +- +-int GlobalExpectCount; +-int GlobalVerifyOrder; +-char* GlobalOrderError; +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +- +- +-/*=======Mock Management=====*/ +-static void CMock_Init(void) +-{ +- GlobalExpectCount = 0; +- GlobalVerifyOrder = 0; +- GlobalOrderError = NULL; +- Mockstanky_Init(); +-} +-static void CMock_Verify(void) +-{ +- Mockstanky_Verify(); +-} +-static void CMock_Destroy(void) +-{ +- Mockstanky_Destroy(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- CMock_Verify(); +- CMock_Destroy(); +- tearDown(); +- CMock_Init(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/mocksample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- +- CMock_Guts_MemFreeFinal(); +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +deleted file mode 100644 +index ee63cdc0bc..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c ++++ /dev/null +@@ -1,89 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- CMock_Init(); \ +- UNITY_CLR_DETAILS(); \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- CMock_Verify(); \ +- } \ +- CMock_Destroy(); \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include "cmock.h" +-#include +-#include +-#include "funky.h" +-#include +-#include "Mockstanky.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +- +- +-/*=======Mock Management=====*/ +-static void CMock_Init(void) +-{ +- Mockstanky_Init(); +-} +-static void CMock_Verify(void) +-{ +- Mockstanky_Verify(); +-} +-static void CMock_Destroy(void) +-{ +- Mockstanky_Destroy(); +-} +- +-/*=======Suite Setup=====*/ +-static int suite_setup(void) +-{ +-a_custom_setup(); +-} +- +-/*=======Suite Teardown=====*/ +-static int suite_teardown(int num_failures) +-{ +-a_custom_teardown(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- CMock_Verify(); +- CMock_Destroy(); +- tearDown(); +- CMock_Init(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- suite_setup(); +- UnityBegin("testdata/mocksample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- +- CMock_Guts_MemFreeFinal(); +- return suite_teardown(UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_param.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +deleted file mode 100644 +index a42b7deaed..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_param.c ++++ /dev/null +@@ -1,77 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST_NO_ARGS +-#define RUN_TEST(TestFunc, TestLineNum, ...) \ +-{ \ +- Unity.CurrentTestName = #TestFunc "(" #__VA_ARGS__ ")"; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- CMock_Init(); \ +- UNITY_CLR_DETAILS(); \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(__VA_ARGS__); \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- CMock_Verify(); \ +- } \ +- CMock_Destroy(); \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include "cmock.h" +-#include +-#include +-#include "funky.h" +-#include +-#include "Mockstanky.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +- +- +-/*=======Mock Management=====*/ +-static void CMock_Init(void) +-{ +- Mockstanky_Init(); +-} +-static void CMock_Verify(void) +-{ +- Mockstanky_Verify(); +-} +-static void CMock_Destroy(void) +-{ +- Mockstanky_Destroy(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- CMock_Verify(); +- CMock_Destroy(); +- tearDown(); +- CMock_Init(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/mocksample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21, RUN_TEST_NO_ARGS); +- RUN_TEST(test_TheSecondThingToTest, 43, RUN_TEST_NO_ARGS); +- +- CMock_Guts_MemFreeFinal(); +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +deleted file mode 100644 +index 0061822e50..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c ++++ /dev/null +@@ -1,89 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- CMock_Init(); \ +- UNITY_CLR_DETAILS(); \ +- if (TEST_PROTECT()) \ +- { \ +- CEXCEPTION_T e; \ +- Try { \ +- setUp(); \ +- TestFunc(); \ +- } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- CMock_Verify(); \ +- } \ +- CMock_Destroy(); \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include "cmock.h" +-#include +-#include +-#include "CException.h" +-#include "one.h" +-#include "two.h" +-#include "funky.h" +-#include +-#include "Mockstanky.h" +- +-int GlobalExpectCount; +-int GlobalVerifyOrder; +-char* GlobalOrderError; +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +- +- +-/*=======Mock Management=====*/ +-static void CMock_Init(void) +-{ +- GlobalExpectCount = 0; +- GlobalVerifyOrder = 0; +- GlobalOrderError = NULL; +- Mockstanky_Init(); +-} +-static void CMock_Verify(void) +-{ +- Mockstanky_Verify(); +-} +-static void CMock_Destroy(void) +-{ +- Mockstanky_Destroy(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- CMock_Verify(); +- CMock_Destroy(); +- tearDown(); +- CMock_Init(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/mocksample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- +- CMock_Guts_MemFreeFinal(); +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +deleted file mode 100644 +index ee63cdc0bc..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c ++++ /dev/null +@@ -1,89 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- CMock_Init(); \ +- UNITY_CLR_DETAILS(); \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- CMock_Verify(); \ +- } \ +- CMock_Destroy(); \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include "cmock.h" +-#include +-#include +-#include "funky.h" +-#include +-#include "Mockstanky.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +- +- +-/*=======Mock Management=====*/ +-static void CMock_Init(void) +-{ +- Mockstanky_Init(); +-} +-static void CMock_Verify(void) +-{ +- Mockstanky_Verify(); +-} +-static void CMock_Destroy(void) +-{ +- Mockstanky_Destroy(); +-} +- +-/*=======Suite Setup=====*/ +-static int suite_setup(void) +-{ +-a_custom_setup(); +-} +- +-/*=======Suite Teardown=====*/ +-static int suite_teardown(int num_failures) +-{ +-a_custom_teardown(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- CMock_Verify(); +- CMock_Destroy(); +- tearDown(); +- CMock_Init(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- suite_setup(); +- UnityBegin("testdata/mocksample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- +- CMock_Guts_MemFreeFinal(); +- return suite_teardown(UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +deleted file mode 100644 +index a24bb5a57a..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c ++++ /dev/null +@@ -1,90 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- CMock_Init(); \ +- UNITY_CLR_DETAILS(); \ +- if (TEST_PROTECT()) \ +- { \ +- CEXCEPTION_T e; \ +- Try { \ +- setUp(); \ +- TestFunc(); \ +- } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- CMock_Verify(); \ +- } \ +- CMock_Destroy(); \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include "cmock.h" +-#include +-#include +-#include "CException.h" +-#include "two.h" +-#include "three.h" +-#include +-#include "funky.h" +-#include +-#include "Mockstanky.h" +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +- +- +-/*=======Mock Management=====*/ +-static void CMock_Init(void) +-{ +- Mockstanky_Init(); +-} +-static void CMock_Verify(void) +-{ +- Mockstanky_Verify(); +-} +-static void CMock_Destroy(void) +-{ +- Mockstanky_Destroy(); +-} +- +-/*=======Suite Setup=====*/ +-static int suite_setup(void) +-{ +-a_yaml_setup(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- CMock_Verify(); +- CMock_Destroy(); +- tearDown(); +- CMock_Init(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- suite_setup(); +- UnityBegin("testdata/mocksample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- +- CMock_Guts_MemFreeFinal(); +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new1.c +deleted file mode 100644 +index 7dcd3fdfe6..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new1.c ++++ /dev/null +@@ -1,67 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- CEXCEPTION_T e; \ +- Try { \ +- setUp(); \ +- TestFunc(); \ +- } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "CException.h" +-#include "one.h" +-#include "two.h" +-#include "funky.h" +-#include "stanky.h" +-#include +- +-int GlobalExpectCount; +-int GlobalVerifyOrder; +-char* GlobalOrderError; +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +-extern void test_TheThirdThingToTest(void); +-extern void test_TheFourthThingToTest(void); +- +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/testsample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- RUN_TEST(test_TheThirdThingToTest, 53); +- RUN_TEST(test_TheFourthThingToTest, 58); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new2.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new2.c +deleted file mode 100644 +index c98c697f5b..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_new2.c ++++ /dev/null +@@ -1,70 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "funky.h" +-#include "stanky.h" +-#include +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +-extern void test_TheThirdThingToTest(void); +-extern void test_TheFourthThingToTest(void); +- +- +-/*=======Suite Setup=====*/ +-static int suite_setup(void) +-{ +-a_custom_setup(); +-} +- +-/*=======Suite Teardown=====*/ +-static int suite_teardown(int num_failures) +-{ +-a_custom_teardown(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- suite_setup(); +- UnityBegin("testdata/testsample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- RUN_TEST(test_TheThirdThingToTest, 53); +- RUN_TEST(test_TheFourthThingToTest, 58); +- +- return suite_teardown(UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_param.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_param.c +deleted file mode 100644 +index adf6c26268..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_param.c ++++ /dev/null +@@ -1,58 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST_NO_ARGS +-#define RUN_TEST(TestFunc, TestLineNum, ...) \ +-{ \ +- Unity.CurrentTestName = #TestFunc "(" #__VA_ARGS__ ")"; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(__VA_ARGS__); \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "funky.h" +-#include "stanky.h" +-#include +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +-extern void test_TheThirdThingToTest(void); +-extern void test_TheFourthThingToTest(void); +- +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/testsample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21, RUN_TEST_NO_ARGS); +- RUN_TEST(test_TheSecondThingToTest, 43, RUN_TEST_NO_ARGS); +- RUN_TEST(test_TheThirdThingToTest, 53, RUN_TEST_NO_ARGS); +- RUN_TEST(test_TheFourthThingToTest, 58, RUN_TEST_NO_ARGS); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run1.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run1.c +deleted file mode 100644 +index 7dcd3fdfe6..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run1.c ++++ /dev/null +@@ -1,67 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- CEXCEPTION_T e; \ +- Try { \ +- setUp(); \ +- TestFunc(); \ +- } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "CException.h" +-#include "one.h" +-#include "two.h" +-#include "funky.h" +-#include "stanky.h" +-#include +- +-int GlobalExpectCount; +-int GlobalVerifyOrder; +-char* GlobalOrderError; +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +-extern void test_TheThirdThingToTest(void); +-extern void test_TheFourthThingToTest(void); +- +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- UnityBegin("testdata/testsample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- RUN_TEST(test_TheThirdThingToTest, 53); +- RUN_TEST(test_TheFourthThingToTest, 58); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run2.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run2.c +deleted file mode 100644 +index c98c697f5b..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_run2.c ++++ /dev/null +@@ -1,70 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- setUp(); \ +- TestFunc(); \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "funky.h" +-#include "stanky.h" +-#include +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +-extern void test_TheThirdThingToTest(void); +-extern void test_TheFourthThingToTest(void); +- +- +-/*=======Suite Setup=====*/ +-static int suite_setup(void) +-{ +-a_custom_setup(); +-} +- +-/*=======Suite Teardown=====*/ +-static int suite_teardown(int num_failures) +-{ +-a_custom_teardown(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- suite_setup(); +- UnityBegin("testdata/testsample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- RUN_TEST(test_TheThirdThingToTest, 53); +- RUN_TEST(test_TheFourthThingToTest, 58); +- +- return suite_teardown(UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_yaml.c b/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_yaml.c +deleted file mode 100644 +index 3316024dfa..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/expectdata/testsample_yaml.c ++++ /dev/null +@@ -1,71 +0,0 @@ +-/* AUTOGENERATED FILE. DO NOT EDIT. */ +- +-/*=======Test Runner Used To Run Each Test Below=====*/ +-#define RUN_TEST(TestFunc, TestLineNum) \ +-{ \ +- Unity.CurrentTestName = #TestFunc; \ +- Unity.CurrentTestLineNumber = TestLineNum; \ +- Unity.NumberOfTests++; \ +- if (TEST_PROTECT()) \ +- { \ +- CEXCEPTION_T e; \ +- Try { \ +- setUp(); \ +- TestFunc(); \ +- } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \ +- } \ +- if (TEST_PROTECT() && !TEST_IS_IGNORED) \ +- { \ +- tearDown(); \ +- } \ +- UnityConcludeTest(); \ +-} +- +-/*=======Automagically Detected Files To Include=====*/ +-#include "unity.h" +-#include +-#include +-#include "CException.h" +-#include "two.h" +-#include "three.h" +-#include +-#include "funky.h" +-#include "stanky.h" +-#include +- +-/*=======External Functions This Runner Calls=====*/ +-extern void setUp(void); +-extern void tearDown(void); +-extern void test_TheFirstThingToTest(void); +-extern void test_TheSecondThingToTest(void); +-extern void test_TheThirdThingToTest(void); +-extern void test_TheFourthThingToTest(void); +- +- +-/*=======Suite Setup=====*/ +-static int suite_setup(void) +-{ +-a_yaml_setup(); +-} +- +-/*=======Test Reset Option=====*/ +-void resetTest(void); +-void resetTest(void) +-{ +- tearDown(); +- setUp(); +-} +- +- +-/*=======MAIN=====*/ +-int main(void) +-{ +- suite_setup(); +- UnityBegin("testdata/testsample.c"); +- RUN_TEST(test_TheFirstThingToTest, 21); +- RUN_TEST(test_TheSecondThingToTest, 43); +- RUN_TEST(test_TheThirdThingToTest, 53); +- RUN_TEST(test_TheFourthThingToTest, 58); +- +- return (UnityEnd()); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/rakefile b/components/testframework/libs/cmock/vendor/unity/test/rakefile +deleted file mode 100644 +index e5f3b748f6..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/rakefile ++++ /dev/null +@@ -1,163 +0,0 @@ +-# ========================================== +-# 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] +-# ========================================== +- +-$verbose = false +-$extra_paths = [] +- +-require 'rake' +-require 'rake/clean' +-require_relative 'rakefile_helper' +-require 'rspec/core/rake_task' +- +-TEMP_DIRS = [ +- File.join(__dir__, 'build'), +- File.join(__dir__, 'sandbox') +-] +- +-TEMP_DIRS.each do |dir| +- directory(dir) +- CLOBBER.include(dir) +-end +- +-task :prepare_for_tests => TEMP_DIRS +- +-include RakefileHelpers +- +-# Load proper GCC as defult configuration +-DEFAULT_CONFIG_FILE = 'gcc_auto_stdint.yml' +-configure_toolchain(DEFAULT_CONFIG_FILE) +- +-############# ALL THE SELF-TESTS WE CAN PERFORM +-namespace :test do +- desc "Build and test Unity" +- task :all => [:clean, :prepare_for_tests, 'test:scripts', 'test:unit', :style, 'test:fixture', 'test:memory', 'test:summary'] +- task :ci => [:clean, :prepare_for_tests, 'test:scripts', 'test:unit', :style, 'test:make', 'test:fixture', 'test:memory', 'test:summary'] +- +- desc "Test unity with its own unit tests" +- task :unit => [:prepare_for_tests] do +- run_tests unit_test_files +- end +- +- namespace :unit do +- unit_test_files.each do |f| +- desc "test this unit only" +- task File.basename(f,'.c').sub('test_unity_','') => [:prepare_for_tests] do +- run_tests [f] +- end +- end +- end +- +- desc "Test unity's helper scripts" +- task :scripts => [:prepare_for_tests] do +- Dir['tests/test_*.rb'].each do |scriptfile| +- require "./"+scriptfile +- end +- end +- +- desc "Test unity triggered from make" +- task :make => [:prepare_for_tests] do +- run_make_tests() +- end +- +- desc "Test unity fixture addon" +- task :fixture => [:prepare_for_tests] do +- test_fixtures() +- end +- +- desc "Test unity memory addon" +- task :memory => [:prepare_for_tests] do +- test_memory() +- end +- +- desc "Test unity examples" +- task :examples => [:prepare_for_tests] do +- execute("cd ../examples/example_1 && make -s ci", false) +- execute("cd ../examples/example_2 && make -s ci", false) +- execute("cd ../examples/example_3 && rake", false) +- end +- +- desc "Run all rspecs" +- RSpec::Core::RakeTask.new(:spec) do |t| +- t.pattern = 'spec/**/*_spec.rb' +- end +- +- desc "Generate test summary" +- task :summary do +- report_summary +- end +-end +- +-###################### Shorthand for many common tasks +-task :ci => ['test:ci'] +-task :all => ['test:all'] +-task :default => [:clobber, :all] +- +-desc "Load configuration" +-task :config, :config_file do |t, args| +- configure_toolchain(args[:config_file]) +-end +- +-task :no_color do +- $colour_output = false +-end +- +-task :verbose do +- $verbose = true +-end +- +-################### CODING STYLE VALIDATION +-namespace :style do +- desc "Check style" +- task :check do +- report "\nVERIFYING RUBY STYLE" +- report execute("rubocop ../auto ../examples ../extras --config .rubocop.yml", true) +- report "Styling Ruby:PASS" +- end +- +- namespace :check do +- Dir['../**/*.rb'].each do |f| +- filename = File.basename(f, '.rb') +- #desc "Check Style of #{filename}" +- task filename.to_sym => ['style:clean'] do +- report execute("rubocop #{f} --color --config .rubocop.yml", true) +- report "Style Checked for #{f}" +- end +- end +- end +- +- desc "Fix Style of all C Code" +- task :c do +- run_astyle("../src/*.* ../extras/fixture/src/*.*") +- end +- +- namespace :c do +- Dir['../{src,extras/**}/*.{c,h}'].each do |f| +- filename = File.basename(f)[0..-3] +- #desc "Check Style of #{filename}" +- task filename.to_sym do +- run_astyle f +- end +- end +- end +- +- desc "Attempt to Autocorrect style" +- task :auto => ['style:clean'] do +- execute("rubocop ../auto ../examples ../extras --auto-correct --config .rubocop.yml") +- report "Autocorrected What We Could." +- end +- +- desc "Update style todo list" +- task :todo => ['style:clean'] do +- execute("rubocop ../auto ../examples ../extras --auto-gen-config --config .rubocop.yml") +- report "Updated Style TODO List." +- end +- +- task :clean do +- File.delete(".rubocop_todo.yml") if File.exists?(".rubocop_todo.yml") +- end +-end +- +-task :style => ['style:check'] +diff --git a/components/testframework/libs/cmock/vendor/unity/test/rakefile_helper.rb b/components/testframework/libs/cmock/vendor/unity/test/rakefile_helper.rb +deleted file mode 100644 +index e205bc67d0..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/rakefile_helper.rb ++++ /dev/null +@@ -1,315 +0,0 @@ +-# ========================================== +-# 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] +-# ========================================== +- +-require 'yaml' +-require 'fileutils' +-require_relative '../auto/unity_test_summary' +-require_relative '../auto/generate_test_runner' +-require_relative '../auto/colour_reporter' +- +-module RakefileHelpers +- C_EXTENSION = '.c'.freeze +- def load_configuration(config_file) +- return if $configured +- +- $cfg_file = "targets/#{config_file}" unless config_file =~ /[\\|\/]/ +- $cfg = YAML.load(File.read($cfg_file)) +- $colour_output = false unless $cfg['colour'] +- $configured = true if config_file != DEFAULT_CONFIG_FILE +- end +- +- def configure_clean +- CLEAN.include('build/*.*') +- end +- +- def configure_toolchain(config_file = DEFAULT_CONFIG_FILE) +- config_file += '.yml' unless config_file =~ /\.yml$/ +- config_file = config_file unless config_file =~ /[\\|\/]/ +- load_configuration(config_file) +- configure_clean +- end +- +- def unit_test_files +- path = 'tests/test*' + C_EXTENSION +- path.tr!('\\', '/') +- FileList.new(path) +- end +- +- def local_include_dirs +- include_dirs = $cfg[:paths][:includes] || [] +- include_dirs += $cfg[:paths][:source] || [] +- include_dirs += $cfg[:paths][:test] || [] +- include_dirs += $cfg[:paths][:support] || [] +- include_dirs.delete_if { |dir| dir.is_a?(Array) } +- include_dirs +- end +- +- def extract_headers(filename) +- includes = [] +- lines = File.readlines(filename) +- lines.each do |line| +- m = line.match(/^\s*#include\s+\"\s*(.+\.[hH])\s*\"/) +- includes << m[1] unless m.nil? +- end +- includes +- end +- +- def find_source_file(header, paths) +- paths.each do |dir| +- src_file = dir + header.ext(C_EXTENSION) +- return src_file if File.exist?(src_file) +- end +- nil +- end +- +- def tackit(strings) +- result = if strings.is_a?(Array) +- "\"#{strings.join}\"" +- else +- strings +- end +- result +- end +- +- def squash(prefix, items) +- result = '' +- items.each { |item| result += " #{prefix}#{tackit(item)}" } +- result +- end +- +- def should(behave, &block) +- if block +- puts 'Should ' + behave +- yield block +- else +- puts "UNIMPLEMENTED CASE: Should #{behave}" +- end +- end +- +- def build_command_string(hash, values, defines = nil) +- +- # Replace named and numbered slots +- args = [] +- hash[:arguments].each do |arg| +- if arg.include? '$' +- if arg.include? ': COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- pattern = arg.gsub(': COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE','') +- [ File.join('..','src') ].each do |f| +- args << pattern.gsub(/\$/,f) +- end +- +- elsif arg.include? ': COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- pattern = arg.gsub(': COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR','') +- [ $extra_paths, 'src', File.join('tests'), File.join('testdata'), $cfg[:paths][:support] ].flatten.uniq.compact.each do |f| +- args << pattern.gsub(/\$/,f) +- end +- +- elsif arg.include? ': COLLECTION_DEFINES_TEST_AND_VENDOR' +- pattern = arg.gsub(': COLLECTION_DEFINES_TEST_AND_VENDOR','') +- [ $cfg[:defines][:test], defines ].flatten.uniq.compact.each do |f| +- args << pattern.gsub(/\$/,f) +- end +- +- elsif arg =~ /\$\{(\d+)\}/ +- i = $1.to_i - 1 +- if (values[i].is_a?(Array)) +- values[i].each {|v| args << arg.gsub(/\$\{\d+\}/, v)} +- else +- args << arg.gsub(/\$\{(\d)+\}/, values[i] || '') +- end +- +- else +- args << arg +- +- end +- else +- args << arg +- end +- end +- +- # Build Command +- return tackit(hash[:executable]) + squash('', args) +- end +- +- def compile(file, defines = []) +- out_file = File.join('build', File.basename(file, C_EXTENSION)) + $cfg[:extension][:object] +- cmd_str = build_command_string( $cfg[:tools][:test_compiler], [ file, out_file ], defines ) +- execute(cmd_str) +- out_file +- end +- +- def link_it(exe_name, obj_list) +- exe_name = File.join('build', File.basename(exe_name)) +- cmd_str = build_command_string( $cfg[:tools][:test_linker], [ obj_list, exe_name ] ) +- execute(cmd_str) +- end +- +- def runtest(bin_name, ok_to_fail = false, extra_args = nil) +- bin_name = File.join('build', File.basename(bin_name)) +- extra_args = extra_args.nil? ? "" : " " + extra_args +- if $cfg[:tools][:test_fixture] +- cmd_str = build_command_string( $cfg[:tools][:test_fixture], [ bin_name, extra_args ] ) +- else +- cmd_str = bin_name + extra_args +- end +- execute(cmd_str, ok_to_fail) +- end +- +- def run_astyle(style_what) +- report "Styling C Code..." +- command = "AStyle " \ +- "--style=allman --indent=spaces=4 --indent-switches --indent-preproc-define --indent-preproc-block " \ +- "--pad-oper --pad-comma --unpad-paren --pad-header " \ +- "--align-pointer=type --align-reference=name " \ +- "--add-brackets --mode=c --suffix=none " \ +- "#{style_what}" +- execute(command, false) +- report "Styling C:PASS" +- end +- +- def execute(command_string, ok_to_fail = false) +- report command_string if $verbose +- output = `#{command_string}`.chomp +- report(output) if $verbose && !output.nil? && !output.empty? +- raise "Command failed. (Returned #{$?.exitstatus})" if !$?.nil? && !$?.exitstatus.zero? && !ok_to_fail +- output +- end +- +- def report_summary +- summary = UnityTestSummary.new +- summary.root = __dir__ +- results_glob = File.join('build','*.test*') +- results_glob.tr!('\\', '/') +- results = Dir[results_glob] +- summary.targets = results +- report summary.run +- end +- +- def save_test_results(test_base, output) +- test_results = File.join('build',test_base) +- if output.match(/OK$/m).nil? +- test_results += '.testfail' +- else +- report output unless $verbose # Verbose already prints this line, as does a failure +- test_results += '.testpass' +- end +- File.open(test_results, 'w') { |f| f.print output } +- end +- +- def test_fixtures() +- report "\nRunning Fixture Addon" +- +- # Get a list of all source files needed +- src_files = Dir[File.join('..','extras','fixture','src','*.c')] +- src_files += Dir[File.join('..','extras','fixture','test','*.c')] +- src_files += Dir[File.join('..','extras','fixture','test','main','*.c')] +- src_files += Dir[File.join('..','extras','memory','src','*.c')] +- src_files << File.join('..','src','unity.c') +- +- # Build object files +- $extra_paths = [File.join('..','extras','fixture','src'), File.join('..','extras','memory','src')] +- obj_list = src_files.map { |f| compile(f, ['UNITY_SKIP_DEFAULT_RUNNER', 'UNITY_FIXTURE_NO_EXTRAS']) } +- +- # Link the test executable +- test_base = File.basename('framework_test', C_EXTENSION) +- link_it(test_base, obj_list) +- +- # Run and collect output +- output = runtest(test_base + " -v -r") +- save_test_results(test_base, output) +- end +- +- def test_memory() +- { 'w_malloc' => [], +- 'wo_malloc' => ['UNITY_EXCLUDE_STDLIB_MALLOC'] +- }.each_pair do |name, defs| +- report "\nRunning Memory Addon #{name}" +- +- # Get a list of all source files needed +- src_files = Dir[File.join('..','extras','memory','src','*.c')] +- src_files += Dir[File.join('..','extras','memory','test','*.c')] +- src_files += Dir[File.join('..','extras','memory','test','main','*.c')] +- src_files << File.join('..','src','unity.c') +- +- # Build object files +- $extra_paths = [File.join('..','extras','memory','src')] +- obj_list = src_files.map { |f| compile(f, defs) } +- +- # Link the test executable +- test_base = File.basename("memory_test_#{name}", C_EXTENSION) +- link_it(test_base, obj_list) +- +- # Run and collect output +- output = runtest(test_base) +- save_test_results(test_base, output) +- end +- end +- +- def run_tests(test_files) +- report "\nRunning Unity system tests" +- +- include_dirs = local_include_dirs +- +- # Build and execute each unit test +- test_files.each do |test| +- +- # Drop Out if we're skipping this type of test +- if $cfg[:skip_tests] +- if $cfg[:skip_tests].include?(:parameterized) && test.match(/parameterized/) +- report("Skipping Parameterized Tests for this Target:IGNORE") +- next +- end +- end +- +- report "\nRunning Tests in #{test}" +- obj_list = [] +- test_defines = [] +- +- # Detect dependencies and build required modules +- extract_headers(test).each do |header| +- # Compile corresponding source file if it exists +- src_file = find_source_file(header, include_dirs) +- +- obj_list << compile(src_file, test_defines) unless src_file.nil? +- end +- +- # Build the test runner (generate if configured to do so) +- test_base = File.basename(test, C_EXTENSION) +- runner_name = test_base + '_Runner.c' +- runner_path = File.join('build',runner_name) +- +- options = $cfg[:unity] +- options[:use_param_tests] = test =~ /parameterized/ ? true : false +- UnityTestRunnerGenerator.new(options).run(test, runner_path) +- obj_list << compile(runner_path, test_defines) +- +- # Build the test module +- obj_list << compile(test, test_defines) +- +- # Link the test executable +- link_it(test_base, obj_list) +- +- # Execute unit test and generate results file +- output = runtest(test_base) +- save_test_results(test_base, output) +- end +- end +- +- def run_make_tests() +- [ "make -s", # test with all defaults +- "make -s DEBUG=-m32", # test 32-bit architecture with 64-bit support +- "make -s DEBUG=-m32 UNITY_SUPPORT_64=", # test 32-bit build without 64-bit types +- "make -s UNITY_INCLUDE_DOUBLE= ", # test without double +- "cd #{File.join("..","extras","fixture",'test')} && make -s default noStdlibMalloc", +- "cd #{File.join("..","extras","fixture",'test')} && make -s C89", +- "cd #{File.join("..","extras","memory",'test')} && make -s default noStdlibMalloc", +- "cd #{File.join("..","extras","memory",'test')} && make -s C89", +- ].each do |cmd| +- report "Testing '#{cmd}'" +- execute(cmd, false) +- end +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb b/components/testframework/libs/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +deleted file mode 100644 +index 74e7fc8402..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb ++++ /dev/null +@@ -1,158 +0,0 @@ +- +-require '../auto/generate_module.rb' +-require 'fileutils' +- +-def touch_src(file) +- FileUtils.touch "sandbox/src/#{file}" +-end +- +-def touch_test(file) +- FileUtils.touch "sandbox/test/#{file}" +-end +- +-def create_src_with_known_content(file) +- File.open("sandbox/src/#{file}", "w") {|f| f.write("the original #{file}")} +-end +- +-def create_test_with_known_content(file) +- File.open("sandbox/test/#{file}", "w") {|f| f.write("the original #{file}")} +-end +- +-def expect_src_content_didnt_change(file) +- expect(File.read("sandbox/src/#{file}")).to eq("the original #{file}") +-end +- +-def expect_test_content_didnt_change(file) +- expect(File.read("sandbox/test/#{file}")).to eq("the original #{file}") +-end +- +-def expect_src_file_to_exist(file) +- expect(File.exist?("sandbox/src/#{file}")).to be true +-end +- +-def expect_test_file_to_exist(file) +- expect(File.exist?("sandbox/test/#{file}")).to be true +-end +- +-describe "UnityModuleGenerator" do +- +- before do +- # clean sandbox and setup our "project" folders +- FileUtils.rm_rf "sandbox" +- FileUtils.mkdir_p "sandbox" +- FileUtils.mkdir_p "sandbox/src" +- FileUtils.mkdir_p "sandbox/test" +- +- @options = { +- :path_src => "sandbox/src", +- :path_tst => "sandbox/test", +- } +- end +- +- context "with src pattern" do +- before do +- @options[:pattern] = "src" +- end +- +- it "fails when all files already exist" do +- # create an existing triad of files +- touch_src "meh.c" +- touch_src "meh.h" +- touch_test "Testmeh.c" +- expect { +- UnityModuleGenerator.new(@options).generate("meh") +- }.to raise_error("ERROR: File meh already exists. Exiting.") +- end +- +- it "creates the test file if the source and header files exist" do +- # Create the existing files. +- touch_src "meh.c" +- touch_src "meh.h" +- +- UnityModuleGenerator.new(@options).generate("meh") +- +- expect_test_file_to_exist "Testmeh.c" +- end +- +- it "does not alter existing files" do +- # Create some files with known content. +- create_src_with_known_content "meh.c" +- create_src_with_known_content "meh.h" +- +- UnityModuleGenerator.new(@options).generate("meh") +- +- expect_src_content_didnt_change "meh.c" +- expect_src_content_didnt_change "meh.c" +- end +- +- it "does not alter existing test files" do +- # Create some files with known content. +- create_test_with_known_content "Testmeh.c" +- +- UnityModuleGenerator.new(@options).generate("meh") +- +- expect_test_content_didnt_change "Testmeh.c" +- end +- +- end +- +- context "with mch pattern" do +- before do +- @options[:pattern] = "mch" +- end +- +- it "fails when all files exist" do +- touch_src "meh_model.c" +- touch_src "meh_conductor.c" +- touch_src "meh_hardware.c" +- touch_src "meh_model.h" +- touch_src "meh_conductor.h" +- touch_src "meh_hardware.h" +- touch_test "Testmeh_model.c" +- touch_test "Testmeh_conductor.c" +- touch_test "Testmeh_hardware.c" +- expect { +- UnityModuleGenerator.new(@options).generate("meh") +- }.to raise_error("ERROR: File meh_model already exists. Exiting.") +- end +- +- it "creates files that don't exist" do +- touch_src "meh_model.c" +- touch_src "meh_conductor.c" +- touch_src "meh_hardware.c" +- touch_src "meh_model.h" +- touch_src "meh_conductor.h" +- +- UnityModuleGenerator.new(@options).generate("meh") +- +- expect_src_file_to_exist "meh_hardware.h" +- expect_test_file_to_exist "Testmeh_model.c" +- expect_test_file_to_exist "Testmeh_conductor.c" +- expect_test_file_to_exist "Testmeh_hardware.c" +- end +- +- it "does not alter existing source files" do +- create_src_with_known_content "meh_model.c" +- create_src_with_known_content "meh_model.c" +- create_src_with_known_content "meh_model.c" +- create_src_with_known_content "meh_model.h" +- create_src_with_known_content "meh_model.c" +- +- UnityModuleGenerator.new(@options).generate("meh") +- +- expect_src_content_didnt_change "meh_model.c" +- expect_src_content_didnt_change "meh_model.c" +- expect_src_content_didnt_change "meh_model.c" +- expect_src_content_didnt_change "meh_model.c" +- end +- +- it "does not alter existing test files" do +- create_test_with_known_content "Testmeh_model.c" +- +- UnityModuleGenerator.new(@options).generate("meh") +- +- expect_test_content_didnt_change "Testmeh_model.c" +- end +- +- end +-end +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/ansi.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/ansi.yml +deleted file mode 100644 +index 81af4c7f5c..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/ansi.yml ++++ /dev/null +@@ -1,44 +0,0 @@ +---- +-colour: true +-:unity: +- :plugins: [] +-:skip_tests: +-- :parameterized +-:tools: +- :test_compiler: +- :name: compiler +- :executable: gcc +- :arguments: +- - "-c" +- - "-m64" +- - "-Wall" +- - "-Wno-address" +- - "-ansi" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: gcc +- :arguments: +- - "${1}" +- - "-lm" +- - "-m64" +- - "-o ${2}" +-:extension: +- :object: ".o" +- :executable: ".exe" +-:paths: +- :test: +- - src/ +- - "../src/" +- - testdata/ +- - tests/ +-:defines: +- :test: +- - UNITY_INCLUDE_DOUBLE +- - UNITY_SUPPORT_TEST_CASES +- - UNITY_EXCLUDE_TESTING_NEW_COMMENTS +- - UNITY_SUPPORT_64 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/clang_file.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/clang_file.yml +deleted file mode 100644 +index 964e8145cb..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/clang_file.yml ++++ /dev/null +@@ -1,72 +0,0 @@ +---- +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: clang +- :arguments: +- - "-c" +- - "-Wall" +- - "-Wextra" +- - "-Werror" +- - "-Wcast-qual" +- - "-Wconversion" +- - "-Wdisabled-optimization" +- - "-Wformat=2" +- - "-Winit-self" +- - "-Winline" +- - "-Winvalid-pch" +- - "-Wmissing-include-dirs" +- - "-Wnonnull" +- - "-Wpacked" +- - "-Wpointer-arith" +- - "-Wswitch-default" +- - "-Wstrict-aliasing" +- - "-Wstrict-overflow=5" +- - "-Wuninitialized" +- - "-Wunused" +- - "-Wreturn-type" +- - "-Wshadow" +- - "-Wundef" +- - "-Wwrite-strings" +- - "-Wno-nested-externs" +- - "-Wno-unused-parameter" +- - "-Wno-variadic-macros" +- - "-Wbad-function-cast" +- - "-fms-extensions" +- - "-fno-omit-frame-pointer" +- - "-ffloat-store" +- - "-fno-common" +- - "-fstrict-aliasing" +- - "-std=gnu99" +- - "-pedantic" +- - "-O0" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: clang +- :arguments: +- - "${1}" +- - "-lm" +- - "-m64" +- - "-o ${2}" +-:extension: +- :object: ".o" +- :executable: ".exe" +-:paths: +- :test: +- - src/ +- - "../src/" +- - testdata/ +- - tests/ +-:defines: +- :test: +- - UNITY_INCLUDE_DOUBLE +- - UNITY_SUPPORT_64 +- - UNITY_OUTPUT_RESULTS_FILE +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/clang_strict.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/clang_strict.yml +deleted file mode 100644 +index 04d5680648..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/clang_strict.yml ++++ /dev/null +@@ -1,71 +0,0 @@ +---- +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: clang +- :arguments: +- - "-c" +- - "-Wall" +- - "-Wextra" +- - "-Werror" +- - "-Wcast-qual" +- - "-Wconversion" +- - "-Wdisabled-optimization" +- - "-Wformat=2" +- - "-Winit-self" +- - "-Winline" +- - "-Winvalid-pch" +- - "-Wmissing-include-dirs" +- - "-Wnonnull" +- - "-Wpacked" +- - "-Wpointer-arith" +- - "-Wswitch-default" +- - "-Wstrict-aliasing" +- - "-Wstrict-overflow=5" +- - "-Wuninitialized" +- - "-Wunused" +- - "-Wreturn-type" +- - "-Wshadow" +- - "-Wundef" +- - "-Wwrite-strings" +- - "-Wno-nested-externs" +- - "-Wno-unused-parameter" +- - "-Wno-variadic-macros" +- - "-Wbad-function-cast" +- - "-fms-extensions" +- - "-fno-omit-frame-pointer" +- - "-fno-common" +- - "-fstrict-aliasing" +- - "-std=gnu99" +- - "-pedantic" +- - "-O0" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: clang +- :arguments: +- - "${1}" +- - "-lm" +- - "-m64" +- - "-o ${2}" +-:extension: +- :object: ".o" +- :executable: ".exe" +-:paths: +- :test: +- - src/ +- - "../src/" +- - testdata/ +- - tests/ +-:defines: +- :test: +- - UNITY_INCLUDE_DOUBLE +- - UNITY_SUPPORT_TEST_CASES +- - UNITY_SUPPORT_64 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_32.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_32.yml +deleted file mode 100644 +index ba388cf726..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_32.yml ++++ /dev/null +@@ -1,45 +0,0 @@ +---- +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: gcc +- :arguments: +- - "-c" +- - "-m32" +- - "-Wall" +- - "-Wno-address" +- - "-std=c99" +- - "-pedantic" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: gcc +- :arguments: +- - "${1}" +- - "-lm" +- - "-m32" +- - "-o ${2}" +-:extension: +- :object: ".o" +- :executable: ".exe" +-:paths: +- :test: +- - src/ +- - "../src/" +- - testdata/ +- - tests/ +-:defines: +- :test: +- - UNITY_EXCLUDE_STDINT_H +- - UNITY_EXCLUDE_LIMITS_H +- - UNITY_INCLUDE_DOUBLE +- - UNITY_SUPPORT_TEST_CASES +- - UNITY_INT_WIDTH=32 +- - UNITY_LONG_WIDTH=32 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_64.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_64.yml +deleted file mode 100644 +index ed9eb4a80d..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_64.yml ++++ /dev/null +@@ -1,46 +0,0 @@ +---- +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: gcc +- :arguments: +- - "-c" +- - "-m64" +- - "-Wall" +- - "-Wno-address" +- - "-std=c99" +- - "-pedantic" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: gcc +- :arguments: +- - "${1}" +- - "-lm" +- - "-m64" +- - "-o ${2}" +-:extension: +- :object: ".o" +- :executable: ".exe" +-:paths: +- :test: +- - src/ +- - "../src/" +- - testdata/ +- - tests/ +-:defines: +- :test: +- - UNITY_EXCLUDE_STDINT_H +- - UNITY_EXCLUDE_LIMITS_H +- - UNITY_INCLUDE_DOUBLE +- - UNITY_SUPPORT_TEST_CASES +- - UNITY_SUPPORT_64 +- - UNITY_INT_WIDTH=32 +- - UNITY_LONG_WIDTH=64 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_limits.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +deleted file mode 100644 +index 9cfda8d4a0..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_limits.yml ++++ /dev/null +@@ -1,43 +0,0 @@ +---- +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: gcc +- :arguments: +- - "-c" +- - "-m64" +- - "-Wall" +- - "-Wno-address" +- - "-std=c99" +- - "-pedantic" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: gcc +- :arguments: +- - "${1}" +- - "-lm" +- - "-m64" +- - "-o ${2}" +-:extension: +- :object: ".o" +- :executable: ".exe" +-:paths: +- :test: +- - src/ +- - "../src/" +- - testdata/ +- - tests/ +-:defines: +- :test: +- - UNITY_EXCLUDE_STDINT_H +- - UNITY_INCLUDE_DOUBLE +- - UNITY_SUPPORT_TEST_CASES +- - UNITY_SUPPORT_64 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +deleted file mode 100644 +index 66602ef71e..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml ++++ /dev/null +@@ -1,55 +0,0 @@ +---- +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: gcc +- :arguments: +- - "-c" +- - "-m64" +- - "-Wall" +- - "-Wno-address" +- - "-std=c99" +- - "-pedantic" +- - "-Wextra" +- - "-Werror" +- - "-Wpointer-arith" +- - "-Wcast-align" +- - "-Wwrite-strings" +- - "-Wswitch-default" +- - "-Wunreachable-code" +- - "-Winit-self" +- - "-Wmissing-field-initializers" +- - "-Wno-unknown-pragmas" +- - "-Wstrict-prototypes" +- - "-Wundef" +- - "-Wold-style-definition" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: gcc +- :arguments: +- - "${1}" +- - "-lm" +- - "-m64" +- - "-o ${2}" +-:extension: +- :object: ".o" +- :executable: ".exe" +-:paths: +- :test: +- - src/ +- - "../src/" +- - testdata/ +- - tests/ +-:defines: +- :test: +- - UNITY_INCLUDE_DOUBLE +- - UNITY_SUPPORT_TEST_CASES +- - UNITY_SUPPORT_64 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_manual_math.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_manual_math.yml +deleted file mode 100644 +index b1b5b82e53..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/gcc_manual_math.yml ++++ /dev/null +@@ -1,43 +0,0 @@ +---- +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: gcc +- :arguments: +- - "-c" +- - "-m64" +- - "-Wall" +- - "-Wno-address" +- - "-std=c99" +- - "-pedantic" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: gcc +- :arguments: +- - "${1}" +- - "-lm" +- - "-m64" +- - "-o ${2}" +-:extension: +- :object: ".o" +- :executable: ".exe" +-:paths: +- :test: +- - src/ +- - "../src/" +- - testdata/ +- - tests/ +-:defines: +- :test: +- - UNITY_EXCLUDE_MATH_H +- - UNITY_INCLUDE_DOUBLE +- - UNITY_SUPPORT_TEST_CASES +- - UNITY_SUPPORT_64 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/hitech_picc18.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/hitech_picc18.yml +deleted file mode 100644 +index b984edbd82..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/hitech_picc18.yml ++++ /dev/null +@@ -1,91 +0,0 @@ +---- +-:cmock: +- :plugins: [] +- :includes: +- - Types.h +- :suite_teardown: | +- if (num_failures) +- _FAILED_TEST(); +- else +- _PASSED_TESTS(); +- return 0; +-colour: true +-:tools: +- :test_compiler: +- :name: compiler +- :executable: cd build && picc18 +- :arguments: +- - "--chip=18F87J10" +- - "--ide=hitide" +- - "--q" +- - "--asmlist" +- - "--codeoffset=0" +- - "--emi=wordwrite" +- - "--warn=0" +- - "--errors=10" +- - "--char=unsigned" +- - "-Bl" +- - "-G" +- - "--cp=16" +- - "--double=24" +- - "-N255" +- - "--opt=none" +- - "-c" +- - "-M" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - " ${2}" +- :test_linker: +- :name: linker +- :executable: cd build && picc18 +- :arguments: +- - "${1}" +- - "--chip=18F87J10" +- - "--ide=hitide" +- - "--cp=24" +- - "--double=24" +- - "-Lw" +- - "--summary=mem,file" +- - "--summary=+psect" +- - "--summary=+hex" +- - "--output=+intel" +- - "--output=+mcof" +- - "--runtime=+init" +- - "--runtime=+clear" +- - "--runtime=+clib" +- - "--runtime=+keep" +- - "-G" +- - "-MIWasTheLastToBuild.map" +- - "--warn=0" +- - "-Bl" +- - "-O ${2}" +- :test_fixture: +- :name: simulator +- :executable: 'java -client -jar ' +- :arguments: +- - - C:\Program Files\HI-TECH Software\HI-TIDE\3.15\lib\ +- - simpic18.jar +- - 18F87J10 +- - "${1}" +-:extension: +- :object: ".obj" +- :executable: ".hex" +-:paths: +- :test: +- - c:/Projects/NexGen/Prototypes/CMockTest/src/ +- - c:/Projects/NexGen/Prototypes/CMockTest/mocks/ +- - c:/CMock/src/ +- - c:/CMock/examples/src/ +- - c:/CMock/vendor/unity/src/ +- - c:/CMock/vendor/unity/examples/helper/ +- - tests\ +-:defines: +- :test: +- - UNITY_INT_WIDTH=16 +- - UNITY_POINTER_WIDTH=16 +- - CMOCK_MEM_STATIC +- - CMOCK_MEM_SIZE=3000 +- - UNITY_SUPPORT_TEST_CASES +- - _PICC18 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v4.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v4.yml +deleted file mode 100644 +index 9a1a2761e3..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v4.yml ++++ /dev/null +@@ -1,98 +0,0 @@ +---- +-tools_root: C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - arm\bin\iccarm.exe +- :arguments: +- - "--dlib_config" +- - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - arm\lib\dl4tptinl8n.h +- - "-z3" +- - "--no_cse" +- - "--no_unroll" +- - "--no_inline" +- - "--no_code_motion" +- - "--no_tbaa" +- - "--no_clustering" +- - "--no_scheduling" +- - "--debug" +- - "--cpu_mode thumb" +- - "--endian little" +- - "--cpu ARM7TDMI" +- - "--stack_align 4" +- - "--interwork" +- - "-e" +- - "--silent" +- - "--warnings_are_errors" +- - "--fpu None" +- - "--diag_suppress Pa050" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - common\bin\xlink.exe +- :arguments: +- - "${1}" +- - "-rt" +- - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - arm\lib\dl4tptinl8n.r79 +- - "-D_L_EXTMEM_START=0" +- - "-D_L_EXTMEM_SIZE=0" +- - "-D_L_HEAP_SIZE=120" +- - "-D_L_STACK_SIZE=32" +- - "-e_small_write=_formatted_write" +- - "-s" +- - __program_start +- - "-f" +- - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - "\\arm\\config\\lnkarm.xcl" +- - "-o ${2}" +- :test_fixture: +- :name: simulator +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - common\bin\CSpyBat.exe +- :arguments: +- - "--silent" +- - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - arm\bin\armproc.dll +- - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - arm\bin\armsim.dll +- - "${1}" +- - "--plugin" +- - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - arm\bin\armbat.dll +- - "--backend" +- - "-B" +- - "-p" +- - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - arm\config\ioat91sam7X256.ddf +- - "-d" +- - sim +-:extension: +- :object: ".r79" +- :executable: ".d79" +-:paths: +- :test: +- - - C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\ +- - arm\inc\ +- - src\ +- - "..\\src\\" +- - testdata/ +- - tests\ +- - vendor\unity\src\ +-:defines: +- :test: +- - UNITY_SUPPORT_64 +- - UNITY_SUPPORT_TEST_CASES +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5.yml +deleted file mode 100644 +index d4b115f14e..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5.yml ++++ /dev/null +@@ -1,92 +0,0 @@ +---- +-tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\bin\iccarm.exe +- :arguments: +- - "--dlib_config" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\inc\DLib_Config_Normal.h +- - "--no_cse" +- - "--no_unroll" +- - "--no_inline" +- - "--no_code_motion" +- - "--no_tbaa" +- - "--no_clustering" +- - "--no_scheduling" +- - "--debug" +- - "--cpu_mode thumb" +- - "--endian=little" +- - "--cpu=ARM7TDMI" +- - "--interwork" +- - "--warnings_are_errors" +- - "--fpu=None" +- - "--diag_suppress=Pa050" +- - "--diag_suppress=Pe111" +- - "-e" +- - "-On" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\bin\ilinkarm.exe +- :arguments: +- - "${1}" +- - "--redirect _Printf=_PrintfLarge" +- - "--redirect _Scanf=_ScanfSmall" +- - "--semihosting" +- - "--entry __iar_program_start" +- - "--config" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\config\generic.icf +- - "-o ${2}" +- :test_fixture: +- :name: simulator +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - common\bin\CSpyBat.exe +- :arguments: +- - "--silent" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\bin\armproc.dll +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\bin\armsim.dll +- - "${1}" +- - "--plugin" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\bin\armbat.dll +- - "--backend" +- - "-B" +- - "-p" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\config\debugger\atmel\ioat91sam7X256.ddf +- - "-d" +- - sim +-:extension: +- :object: ".r79" +- :executable: ".out" +-:paths: +- :test: +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\inc\ +- - src\ +- - "..\\src\\" +- - testdata/ +- - tests\ +- - vendor\unity\src\ +- - iar\iar_v5\incIAR\ +-:defines: +- :test: +- - UNITY_SUPPORT_64 +- - UNITY_SUPPORT_TEST_CASES +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml +deleted file mode 100644 +index d4b115f14e..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml ++++ /dev/null +@@ -1,92 +0,0 @@ +---- +-tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\bin\iccarm.exe +- :arguments: +- - "--dlib_config" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\inc\DLib_Config_Normal.h +- - "--no_cse" +- - "--no_unroll" +- - "--no_inline" +- - "--no_code_motion" +- - "--no_tbaa" +- - "--no_clustering" +- - "--no_scheduling" +- - "--debug" +- - "--cpu_mode thumb" +- - "--endian=little" +- - "--cpu=ARM7TDMI" +- - "--interwork" +- - "--warnings_are_errors" +- - "--fpu=None" +- - "--diag_suppress=Pa050" +- - "--diag_suppress=Pe111" +- - "-e" +- - "-On" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\bin\ilinkarm.exe +- :arguments: +- - "${1}" +- - "--redirect _Printf=_PrintfLarge" +- - "--redirect _Scanf=_ScanfSmall" +- - "--semihosting" +- - "--entry __iar_program_start" +- - "--config" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\config\generic.icf +- - "-o ${2}" +- :test_fixture: +- :name: simulator +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - common\bin\CSpyBat.exe +- :arguments: +- - "--silent" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\bin\armproc.dll +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\bin\armsim.dll +- - "${1}" +- - "--plugin" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\bin\armbat.dll +- - "--backend" +- - "-B" +- - "-p" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\config\debugger\atmel\ioat91sam7X256.ddf +- - "-d" +- - sim +-:extension: +- :object: ".r79" +- :executable: ".out" +-:paths: +- :test: +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.3\ +- - arm\inc\ +- - src\ +- - "..\\src\\" +- - testdata/ +- - tests\ +- - vendor\unity\src\ +- - iar\iar_v5\incIAR\ +-:defines: +- :test: +- - UNITY_SUPPORT_64 +- - UNITY_SUPPORT_TEST_CASES +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +deleted file mode 100644 +index 1703fe27c5..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml ++++ /dev/null +@@ -1,90 +0,0 @@ +---- +-tools_root: C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: +- - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +- - arm\bin\iccarm.exe +- :arguments: +- - "--diag_suppress=Pa050" +- - "--debug" +- - "--endian=little" +- - "--cpu=Cortex-M3" +- - "--no_path_in_file_macros" +- - "-e" +- - "--fpu=None" +- - "--dlib_config" +- - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +- - arm\inc\DLib_Config_Normal.h +- - "--interwork" +- - "--warnings_are_errors" +- - "-Oh" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: +- - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +- - arm\bin\ilinkarm.exe +- :arguments: +- - "${1}" +- - "--redirect _Printf=_PrintfLarge" +- - "--redirect _Scanf=_ScanfSmall" +- - "--semihosting" +- - "--entry __iar_program_start" +- - "--config" +- - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +- - arm\config\generic.icf +- - "-o ${2}" +- :test_fixture: +- :name: simulator +- :executable: +- - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +- - common\bin\CSpyBat.exe +- :arguments: +- - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +- - arm\bin\armproc.dll +- - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +- - arm\bin\armsim2.dll +- - "${1}" +- - "--plugin" +- - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +- - arm\bin\armbat.dll +- - "--backend" +- - "-B" +- - "--endian=little" +- - "--cpu=Cortex-M3" +- - "--fpu=None" +- - "-p" +- - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +- - arm\config\debugger\TexasInstruments\iolm3sxxxx.ddf +- - "--semihosting" +- - "--device=LM3SxBxx" +-:extension: +- :object: ".r79" +- :executable: ".out" +-:paths: +- :test: +- - - C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\ +- - arm\inc\ +- - src\ +- - "..\\src\\" +- - testdata/ +- - tests\ +- - vendor\unity\src\ +- - iar\iar_v5\incIAR\ +-:defines: +- :test: +- - ewarm +- - PART_LM3S9B92 +- - TARGET_IS_TEMPEST_RB1 +- - USE_ROM_DRIVERS +- - UART_BUFFERED +- - UNITY_SUPPORT_64 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml +deleted file mode 100644 +index 8b0978ffa4..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml ++++ /dev/null +@@ -1,94 +0,0 @@ +---- +-tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +- - arm\bin\iccarm.exe +- :arguments: +- - "--dlib_config" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +- - arm\inc\DLib_Config_Normal.h +- - "--no_cse" +- - "--no_unroll" +- - "--no_inline" +- - "--no_code_motion" +- - "--no_tbaa" +- - "--no_clustering" +- - "--no_scheduling" +- - "--debug" +- - "--cpu_mode thumb" +- - "--endian=little" +- - "--cpu=Cortex-M3" +- - "--interwork" +- - "--warnings_are_errors" +- - "--fpu=None" +- - "--diag_suppress=Pa050" +- - "--diag_suppress=Pe111" +- - "-e" +- - "-On" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +- - arm\bin\ilinkarm.exe +- :arguments: +- - "${1}" +- - "--redirect _Printf=_PrintfLarge" +- - "--redirect _Scanf=_ScanfSmall" +- - "--semihosting" +- - "--entry __iar_program_start" +- - "--config" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +- - arm\config\generic_cortex.icf +- - "-o ${2}" +- :test_fixture: +- :name: simulator +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +- - common\bin\CSpyBat.exe +- :arguments: +- - "--silent" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +- - arm\bin\armproc.dll +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +- - arm\bin\armsim.dll +- - "${1}" +- - "--plugin" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +- - arm\bin\armbat.dll +- - "--backend" +- - "-B" +- - "-p" +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +- - arm\config\debugger\ST\iostm32f107xx.ddf +- - "--cpu=Cortex-M3" +- - "-d" +- - sim +-:extension: +- :object: ".r79" +- :executable: ".out" +-:paths: +- :test: +- - - C:\Program Files\IAR Systems\Embedded Workbench 5.4\ +- - arm\inc\ +- - src\ +- - "..\\src\\" +- - testdata/ +- - tests\ +- - vendor\unity\src\ +- - iar\iar_v5\incIAR\ +-:defines: +- :test: +- - IAR +- - UNITY_SUPPORT_64 +- - UNITY_SUPPORT_TEST_CASES +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_msp430.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_msp430.yml +deleted file mode 100644 +index 65872535fc..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_msp430.yml ++++ /dev/null +@@ -1,112 +0,0 @@ +---- +-tools_root: C:\Program Files\IAR Systems\Embedded Workbench 5.3 MSP430\ +-core_root: &1 +-- C:\Program Files\IAR Systems\Embedded Workbench 5.3 MSP430\ +-- 430\ +-core_bin: &2 +-- *1 +-- bin\ +-core_config: &4 +-- *1 +-- config\ +-core_lib: &3 +-- *1 +-- lib\ +-core_inc: &5 +-- *1 +-- inc\ +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: +- - *2 +- - icc430.exe +- :arguments: +- - "--dlib_config" +- - - *3 +- - dlib\dl430fn.h +- - "--no_cse" +- - "--no_unroll" +- - "--no_inline" +- - "--no_code_motion" +- - "--no_tbaa" +- - "--debug" +- - "-e" +- - "-Ol" +- - "--multiplier=16" +- - "--double=32" +- - "--diag_suppress Pa050" +- - "--diag_suppress Pe111" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: +- - *2 +- - xlink.exe +- :arguments: +- - "${1}" +- - "-rt" +- - - *3 +- - dlib\dl430fn.r43 +- - "-e_PrintfTiny=_Printf" +- - "-e_ScanfSmall=_Scanf" +- - "-s __program_start" +- - "-D_STACK_SIZE=50" +- - "-D_DATA16_HEAP_SIZE=50" +- - "-D_DATA20_HEAP_SIZE=50" +- - "-f" +- - - *4 +- - lnk430f5438.xcl +- - "-f" +- - - *4 +- - multiplier.xcl +- - "-o ${2}" +- :test_fixture: +- :name: simulator +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 5.3 MSP430\ +- - common\bin\CSpyBat.exe +- :arguments: +- - "--silent" +- - - *2 +- - 430proc.dll +- - - *2 +- - 430sim.dll +- - "${1}" +- - "--plugin" +- - - *2 +- - 430bat.dll +- - "--backend -B" +- - "--cpu MSP430F5438" +- - "-p" +- - - *4 +- - MSP430F5438.ddf +- - "-d sim" +-:extension: +- :object: ".r43" +- :executable: ".d79" +-:paths: +- :test: +- - *5 +- - - *5 +- - dlib +- - - *3 +- - dlib +- - src\ +- - "../src/" +- - testdata/ +- - tests\ +- - vendor\unity\src +-:defines: +- :test: +- - __MSP430F149__ +- - INT_WIDTH=16 +- - UNITY_EXCLUDE_FLOAT +- - UNITY_SUPPORT_TEST_CASES +diff --git a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml b/components/testframework/libs/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml +deleted file mode 100644 +index b4371cd0ad..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml ++++ /dev/null +@@ -1,99 +0,0 @@ +---- +-tools_root: C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +-colour: true +-:unity: +- :plugins: [] +-:tools: +- :test_compiler: +- :name: compiler +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - sh\bin\iccsh.exe +- :arguments: +- - "-e" +- - "--char_is_signed" +- - "-Ol" +- - "--no_cse" +- - "--no_unroll" +- - "--no_inline" +- - "--no_code_motion" +- - "--no_tbaa" +- - "--no_scheduling" +- - "--no_clustering" +- - "--debug" +- - "--dlib_config" +- - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - sh\inc\DLib_Product.h +- - "--double=32" +- - "--code_model=huge" +- - "--data_model=huge" +- - "--core=sh2afpu" +- - "--warnings_affect_exit_code" +- - "--warnings_are_errors" +- - "--mfc" +- - "--use_unix_directory_separators" +- - "--diag_suppress=Pe161" +- - '-I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE' +- - '-I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR' +- - "-D$: COLLECTION_DEFINES_TEST_AND_VENDOR" +- - "${1}" +- - "-o ${2}" +- :test_linker: +- :name: linker +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - sh\bin\ilinksh.exe +- :arguments: +- - "${1}" +- - "--redirect __Printf=__PrintfSmall" +- - "--redirect __Scanf=__ScanfSmall" +- - "--config" +- - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - sh\config\generic.icf +- - "--config_def _CSTACK_SIZE=0x800" +- - "--config_def _HEAP_SIZE=0x800" +- - "--config_def _INT_TABLE=0x10" +- - "--entry __iar_program_start" +- - "--debug_lib" +- - "-o ${2}" +- :test_fixture: +- :name: simulator +- :executable: +- - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - common\bin\CSpyBat.exe +- :arguments: +- - "--silent" +- - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - sh\bin\shproc.dll +- - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - sh\bin\shsim.dll +- - "${1}" +- - "--plugin" +- - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - sh\bin\shbat.dll +- - "--backend" +- - "-B" +- - "--core sh2afpu" +- - "-p" +- - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - sh\config\debugger\io7264.ddf +- - "-d" +- - sim +-:extension: +- :object: ".o" +- :executable: ".out" +-:paths: +- :test: +- - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - sh\inc\ +- - - C:\Program Files\IAR Systems\Embedded Workbench 6.0\ +- - sh\inc\c +- - src\ +- - "..\\src\\" +- - testdata/ +- - tests\ +- - vendor\unity\src\ +-:defines: +- :test: +- - UNITY_SUPPORT_64 +- - UNITY_SUPPORT_TEST_CASES +diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/CException.h b/components/testframework/libs/cmock/vendor/unity/test/testdata/CException.h +deleted file mode 100644 +index 3872fa75ff..0000000000 +--- a/components/testframework/libs/cmock/vendor/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 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/Defs.h b/components/testframework/libs/cmock/vendor/unity/test/testdata/Defs.h +deleted file mode 100644 +index b1dc83e9ba..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/testdata/Defs.h ++++ /dev/null +@@ -1,8 +0,0 @@ +-#ifndef DEF_H +-#define DEF_H +- +-#define EXTERN_DECL +- +-extern int CounterSuiteSetup; +- +-#endif +diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/cmock.h b/components/testframework/libs/cmock/vendor/unity/test/testdata/cmock.h +deleted file mode 100644 +index 33ddbfc567..0000000000 +--- a/components/testframework/libs/cmock/vendor/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 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/mockMock.h b/components/testframework/libs/cmock/vendor/unity/test/testdata/mockMock.h +deleted file mode 100644 +index 5c6829d77f..0000000000 +--- a/components/testframework/libs/cmock/vendor/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 +diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGenerator.c b/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGenerator.c +deleted file mode 100644 +index b5dd97f5d6..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGenerator.c ++++ /dev/null +@@ -1,189 +0,0 @@ +-/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ +- +-#include +-#include "unity.h" +-#include "Defs.h" +- +-#ifdef USE_CEXCEPTION +-#include "CException.h" +-#endif +- +-/* Notes about prefixes: +- test - normal default prefix. these are "always run" tests for this procedure +- spec - normal default prefix. required to run default setup/teardown calls. +- should - normal default prefix. +- qwiktest - custom prefix for when tests skip all setup/teardown calls. +- custtest - custom prefix for when tests use custom setup/teardown calls. +- paratest - custom prefix for when we want to verify parameterized tests. +- extest - custom prefix only used during cexception +- suitetest- custom prefix for when we want to use custom suite setup/teardown +-*/ +- +-/* Support for Meta Test Rig */ +-#define TEST_CASE(a) +- +-/* Include Passthroughs for Linking Tests */ +-void putcharSpy(int c) { (void)putchar(c);} +-void flushSpy(void) {} +- +-/* Global Variables Used During These Tests */ +-int CounterSetup = 0; +-int CounterTeardown = 0; +-int CounterSuiteSetup = 0; +- +-void setUp(void) +-{ +- CounterSetup = 1; +-} +- +-void tearDown(void) +-{ +- CounterTeardown = 1; +-} +- +-void custom_setup(void) +-{ +- CounterSetup = 2; +-} +- +-void custom_teardown(void) +-{ +- CounterTeardown = 2; +-} +- +-/* +-void test_OldSchoolCommentsShouldBeIgnored(void) +-{ +- TEST_ASSERT_FAIL("Old-School Comments Should Be Ignored"); +-} +-*/ +- +-void test_ThisTestAlwaysPasses(void) +-{ +- TEST_PASS(); +-} +- +-void test_ThisTestAlwaysFails(void) +-{ +- TEST_FAIL_MESSAGE("This Test Should Fail"); +-} +- +-void test_ThisTestAlwaysIgnored(void) +-{ +- TEST_IGNORE_MESSAGE("This Test Should Be Ignored"); +-} +- +-void qwiktest_ThisTestPassesWhenNoSetupRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(0, CounterSetup, "Setup Was Unexpectedly Run"); +-} +- +-void qwiktest_ThisTestPassesWhenNoTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(0, CounterTeardown, "Teardown Was Unexpectedly Run"); +-} +- +-void spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(0, CounterSuiteSetup, "Suite Setup Was Unexpectedly Run"); +-} +- +-void spec_ThisTestPassesWhenNormalSetupRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run"); +-} +- +-void spec_ThisTestPassesWhenNormalTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run"); +-} +- +-void custtest_ThisTestPassesWhenCustomSetupRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(2, CounterSetup, "Custom Setup Wasn't Run"); +-} +- +-void custtest_ThisTestPassesWhenCustomTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(2, CounterTeardown, "Custom Teardown Wasn't Run"); +-} +- +-#ifndef UNITY_EXCLUDE_TESTING_NEW_COMMENTS +-//void test_NewStyleCommentsShouldBeIgnored(void) +-//{ +-// TEST_ASSERT_FAIL("New Style Comments Should Be Ignored"); +-//} +-#endif +- +-void test_NotBeConfusedByLongComplicatedStrings(void) +-{ +- const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n"; +- +- TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are The Same"); +-} +- +-/* The next test should still appear even though we have this confusing nested comment thing going on http://looks_like_comments.com */ +-void test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings(void) +-{ +- TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True"); +- /* still should not break anything */ +-} +-/* nor should this */ +- +-void test_StillNotBeConfusedByLongComplicatedStrings(void) +-{ +- const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n"; +- +- TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are Still The Same"); +-} +- +-void should_RunTestsStartingWithShouldByDefault(void) +-{ +- TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True"); +-} +- +-TEST_CASE(25) +-TEST_CASE(125) +-TEST_CASE(5) +-void paratest_ShouldHandleParameterizedTests(int Num) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(0, (Num % 5), "All The Values Are Divisible By 5"); +-} +- +-TEST_CASE(7) +-void paratest_ShouldHandleParameterizedTests2(int Num) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(7, Num, "The Only Call To This Passes"); +-} +- +-void paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid(void) +-{ +- TEST_PASS(); +-} +- +-TEST_CASE(17) +-void paratest_ShouldHandleParameterizedTestsThatFail(int Num) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(3, Num, "This call should fail"); +-} +- +-#ifdef USE_CEXCEPTION +-void extest_ShouldHandleCExceptionInTest(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(1, CEXCEPTION_BEING_USED, "Should be pulling in CException"); +-} +-#endif +- +-#ifdef USE_ANOTHER_MAIN +-int custom_main(void); +- +-int main(void) +-{ +- return custom_main(); +-} +-#endif +- +-void suitetest_ThisTestPassesWhenCustomSuiteSetupAndTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(1, CounterSuiteSetup, "Suite Setup Should Have Run"); +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c b/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +deleted file mode 100644 +index c8aaf747eb..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c ++++ /dev/null +@@ -1,70 +0,0 @@ +-/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ +- +-#include +-#include "unity.h" +-#include "Defs.h" +- +-TEST_FILE("some_file.c") +- +-/* Notes about prefixes: +- test - normal default prefix. these are "always run" tests for this procedure +- spec - normal default prefix. required to run default setup/teardown calls. +-*/ +- +-/* Support for Meta Test Rig */ +-#define TEST_CASE(a) +- +-/* Include Passthroughs for Linking Tests */ +-void putcharSpy(int c) { (void)putchar(c);} +-void flushSpy(void) {} +- +-/* Global Variables Used During These Tests */ +-int CounterSetup = 0; +-int CounterTeardown = 0; +-int CounterSuiteSetup = 0; +- +-void setUp(void) +-{ +- CounterSetup = 1; +-} +- +-void tearDown(void) +-{ +- CounterTeardown = 1; +-} +- +-void custom_setup(void) +-{ +- CounterSetup = 2; +-} +- +-void custom_teardown(void) +-{ +- CounterTeardown = 2; +-} +- +-void test_ThisTestAlwaysPasses(void) +-{ +- TEST_PASS(); +-} +- +-void test_ThisTestAlwaysFails(void) +-{ +- TEST_FAIL_MESSAGE("This Test Should Fail"); +-} +- +-void test_ThisTestAlwaysIgnored(void) +-{ +- TEST_IGNORE_MESSAGE("This Test Should Be Ignored"); +-} +- +-void spec_ThisTestPassesWhenNormalSetupRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run"); +-} +- +-void spec_ThisTestPassesWhenNormalTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run"); +-} +- +diff --git a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c b/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +deleted file mode 100644 +index aaceda4460..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c ++++ /dev/null +@@ -1,197 +0,0 @@ +-/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ +- +-#include +-#include "unity.h" +-#include "Defs.h" +-#include "mockMock.h" +- +-#ifdef USE_CEXCEPTION +-#include "CException.h" +-#endif +- +-/* Notes about prefixes: +- test - normal default prefix. these are "always run" tests for this procedure +- spec - normal default prefix. required to run default setup/teardown calls. +- should - normal default prefix. +- qwiktest - custom prefix for when tests skip all setup/teardown calls. +- custtest - custom prefix for when tests use custom setup/teardown calls. +- paratest - custom prefix for when we want to verify parameterized tests. +- extest - custom prefix only used during cexception +- suitetest- custom prefix for when we want to use custom suite setup/teardown +-*/ +- +-/* Support for Meta Test Rig */ +-#define TEST_CASE(a) +- +-/* Include Passthroughs for Linking Tests */ +-void putcharSpy(int c) { (void)putchar(c);} +-void flushSpy(void) {} +- +-/* Global Variables Used During These Tests */ +-int CounterSetup = 0; +-int CounterTeardown = 0; +-int CounterSuiteSetup = 0; +- +-void setUp(void) +-{ +- CounterSetup = 1; +-} +- +-void tearDown(void) +-{ +- CounterTeardown = 1; +-} +- +-void custom_setup(void) +-{ +- CounterSetup = 2; +-} +- +-void custom_teardown(void) +-{ +- CounterTeardown = 2; +-} +- +-/* +-void test_OldSchoolCommentsShouldBeIgnored(void) +-{ +- TEST_ASSERT_FAIL("Old-School Comments Should Be Ignored"); +-} +-*/ +- +-void test_ThisTestAlwaysPasses(void) +-{ +- TEST_PASS(); +-} +- +-void test_ThisTestAlwaysFails(void) +-{ +- TEST_FAIL_MESSAGE("This Test Should Fail"); +-} +- +-void test_ThisTestAlwaysIgnored(void) +-{ +- TEST_IGNORE_MESSAGE("This Test Should Be Ignored"); +-} +- +-void qwiktest_ThisTestPassesWhenNoSetupRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(0, CounterSetup, "Setup Was Unexpectedly Run"); +-} +- +-void qwiktest_ThisTestPassesWhenNoTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(0, CounterTeardown, "Teardown Was Unexpectedly Run"); +-} +- +-void spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(0, CounterSuiteSetup, "Suite Setup Was Unexpectedly Run"); +-} +- +-void spec_ThisTestPassesWhenNormalSetupRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run"); +-} +- +-void spec_ThisTestPassesWhenNormalTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run"); +-} +- +-void custtest_ThisTestPassesWhenCustomSetupRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(2, CounterSetup, "Custom Setup Wasn't Run"); +-} +- +-void custtest_ThisTestPassesWhenCustomTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(2, CounterTeardown, "Custom Teardown Wasn't Run"); +-} +- +-#ifndef UNITY_EXCLUDE_TESTING_NEW_COMMENTS +-//void test_NewStyleCommentsShouldBeIgnored(void) +-//{ +-// TEST_ASSERT_FAIL("New Style Comments Should Be Ignored"); +-//} +-#endif +- +-void test_NotBeConfusedByLongComplicatedStrings(void) +-{ +- const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n"; +- +- TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are The Same"); +-} +- +-void test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings(void) +-{ +- TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True"); +-} +- +-void test_StillNotBeConfusedByLongComplicatedStrings(void) +-{ +- const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n"; +- +- TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are Still The Same"); +-} +- +-void should_RunTestsStartingWithShouldByDefault(void) +-{ +- TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True"); +-} +- +-TEST_CASE(25) +-TEST_CASE(125) +-TEST_CASE(5) +-void paratest_ShouldHandleParameterizedTests(int Num) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(0, (Num % 5), "All The Values Are Divisible By 5"); +-} +- +-TEST_CASE(7) +-void paratest_ShouldHandleParameterizedTests2(int Num) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(7, Num, "The Only Call To This Passes"); +-} +- +-void paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid(void) +-{ +- TEST_PASS(); +-} +- +-TEST_CASE(17) +-void paratest_ShouldHandleParameterizedTestsThatFail(int Num) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(3, Num, "This call should fail"); +-} +- +-#ifdef USE_CEXCEPTION +-void extest_ShouldHandleCExceptionInTest(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(1, CEXCEPTION_BEING_USED, "Should be pulling in CException"); +-} +-#endif +- +-#ifdef USE_ANOTHER_MAIN +-int custom_main(void); +- +-int main(void) +-{ +- return custom_main(); +-} +-#endif +- +-void suitetest_ThisTestPassesWhenCustomSuiteSetupAndTeardownRan(void) +-{ +- TEST_ASSERT_EQUAL_MESSAGE(1, CounterSuiteSetup, "Suite Setup Should Have Run"); +-} +- +-void test_ShouldCallMockInitAndVerifyFunctionsForEachTest(void) +-{ +- int passesOrIgnores = (int)(Unity.NumberOfTests - Unity.TestFailures); +- TEST_ASSERT_EQUAL_MESSAGE(Unity.NumberOfTests, mockMock_Init_Counter, "Mock Init Should Be Called Once Per Test Started"); +- TEST_ASSERT_EQUAL_MESSAGE(passesOrIgnores, mockMock_Verify_Counter, "Mock Verify Should Be Called Once Per Test Passed"); +- TEST_ASSERT_EQUAL_MESSAGE(Unity.NumberOfTests - 1, mockMock_Destroy_Counter, "Mock Destroy Should Be Called Once Per Test Completed"); +- TEST_ASSERT_EQUAL_MESSAGE(0, CMockMemFreeFinalCounter, "Mock MemFreeFinal Should Not Be Called Until End"); +-} +- +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/self_assessment_utils.h b/components/testframework/libs/cmock/vendor/unity/test/tests/self_assessment_utils.h +deleted file mode 100644 +index c8cb595db6..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/self_assessment_utils.h ++++ /dev/null +@@ -1,144 +0,0 @@ +-#ifdef TEST_INSTANCES +- +-#include +-#include +- +-/* Dividing by these constants produces +/- infinity. +- * The rationale is given in UnityAssertFloatIsInf's body. +- */ +-#ifndef UNITY_EXCLUDE_FLOAT +-static const UNITY_FLOAT f_zero = 0.0f; +-#endif +- +-#ifndef UNITY_EXCLUDE_DOUBLE +-static const UNITY_DOUBLE d_zero = 0.0; +-#endif +- +-/* Macros for Catching An Expected Failure or Ignore */ +-#define EXPECT_ABORT_BEGIN \ +- startPutcharSpy(); \ +- if (TEST_PROTECT()) \ +- { +- +-#define VERIFY_FAILS_END \ +- } \ +- endPutcharSpy(); /* start/end Spy to suppress output of failure message */ \ +- Unity.CurrentTestFailed = (Unity.CurrentTestFailed == 1) ? 0 : 1; \ +- if (Unity.CurrentTestFailed == 1) { \ +- SetToOneMeanWeAlreadyCheckedThisGuy = 1; \ +- UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \ +- UNITY_OUTPUT_CHAR(':'); \ +- UnityPrint(Unity.CurrentTestName); \ +- UnityPrint(":FAIL: [[[[ Test Should Have Failed But Did Not ]]]]"); \ +- UNITY_OUTPUT_CHAR('\n'); \ +- } +- +-#define VERIFY_IGNORES_END \ +- } \ +- endPutcharSpy(); /* start/end Spy to suppress output of ignore message */ \ +- Unity.CurrentTestFailed = (Unity.CurrentTestIgnored == 1) ? 0 : 1; \ +- Unity.CurrentTestIgnored = 0; \ +- if (Unity.CurrentTestFailed == 1) { \ +- SetToOneMeanWeAlreadyCheckedThisGuy = 1; \ +- UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \ +- UNITY_OUTPUT_CHAR(':'); \ +- UnityPrint(Unity.CurrentTestName); \ +- UnityPrint(":FAIL: [[[[ Test Should Have Ignored But Did Not ]]]]"); \ +- UNITY_OUTPUT_CHAR('\n'); \ +- } +- +-/* Tricky series of macros to set USING_OUTPUT_SPY */ +-#define USING_SPY_AS(a) EXPAND_AND_USE_2ND(ASSIGN_VALUE(a), 0) +-#define ASSIGN_VALUE(a) VAL_##a +-#define VAL_putcharSpy 0, 1 +-#define EXPAND_AND_USE_2ND(a, b) SECOND_PARAM(a, b, throwaway) +-#define SECOND_PARAM(a, b, ...) b +-#if USING_SPY_AS(UNITY_OUTPUT_CHAR) +- #define USING_OUTPUT_SPY /* true only if UNITY_OUTPUT_CHAR = putcharSpy */ +-#endif +- +-#ifdef USING_OUTPUT_SPY +-#include +-#define SPY_BUFFER_MAX 40 +-static char putcharSpyBuffer[SPY_BUFFER_MAX]; +-#endif +-static int indexSpyBuffer; +-static int putcharSpyEnabled; +- +-void startPutcharSpy(void) +-{ +- indexSpyBuffer = 0; +- putcharSpyEnabled = 1; +-} +- +-void endPutcharSpy(void) +-{ +- putcharSpyEnabled = 0; +-} +- +-char* getBufferPutcharSpy(void) +-{ +-#ifdef USING_OUTPUT_SPY +- putcharSpyBuffer[indexSpyBuffer] = '\0'; +- return putcharSpyBuffer; +-#else +- return NULL; +-#endif +-} +- +-void putcharSpy(int c) +-{ +-#ifdef USING_OUTPUT_SPY +- if (putcharSpyEnabled) +- { +- if (indexSpyBuffer < SPY_BUFFER_MAX - 1) +- putcharSpyBuffer[indexSpyBuffer++] = (char)c; +- } else +- putchar((char)c); +-#else +- (void)c; +-#endif +-} +- +-/* This is for counting the calls to the flushSpy */ +-static int flushSpyEnabled; +-static int flushSpyCalls = 0; +- +-void startFlushSpy(void) +-{ +- flushSpyCalls = 0; +- flushSpyEnabled = 1; +-} +- +-void endFlushSpy(void) +-{ +- flushSpyCalls = 0; +- flushSpyEnabled = 0; +-} +- +-int getFlushSpyCalls(void) +-{ +- return flushSpyCalls; +-} +- +-void flushSpy(void) +-{ +- if (flushSpyEnabled){ flushSpyCalls++; } +-} +- +-#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) { \ +- startPutcharSpy(); UnityPrintNumber((actual)); endPutcharSpy(); \ +- TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \ +- } +- +-#define TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS(expected, actual) { \ +- startPutcharSpy(); UnityPrintNumberUnsigned((actual)); endPutcharSpy(); \ +- TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \ +- } +- +-#define TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, actual) { \ +- startPutcharSpy(); UnityPrintFloat((actual)); endPutcharSpy(); \ +- TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \ +- } +- +-#endif +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_generate_test_runner.rb b/components/testframework/libs/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +deleted file mode 100644 +index 809b4494c6..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_generate_test_runner.rb ++++ /dev/null +@@ -1,1260 +0,0 @@ +-# ========================================== +-# CMock Project - Automatic Mock Generation for C +-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +-# [Released under MIT License. Please refer to license.txt for details] +-# ========================================== +- +-require '../auto/generate_test_runner.rb' +- +-$generate_test_runner_tests = 0 +-$generate_test_runner_failures = 0 +- +-OUT_FILE = 'build/testsample_' +- +-RUNNER_TESTS = [ +- { :name => 'DefaultsThroughOptions', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :options => nil, #defaults +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'DefaultsThroughCommandLine', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :cmdline => "", #defaults +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'DefaultsThroughYAMLFile', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :cmdline => "", #defaults +- :yaml => {}, #defaults +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ShorterFilterOfJustTest', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :options => { +- :test_prefix => "test", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ShorterFilterOfJustShould', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :options => { +- :test_prefix => "should", +- }, +- :expected => { +- :to_pass => [ 'should_RunTestsStartingWithShouldByDefault' ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ShorterFilterOfJustSpec', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :options => { +- :test_prefix => "spec", +- }, +- :expected => { +- :to_pass => [ 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'InjectIncludes', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :options => { +- :includes => ['Defs.h'], +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ParameterizedThroughOptions', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :options => { +- :test_prefix => "paratest", +- :use_param_tests => true, +- }, +- :features => [ :parameterized ], +- :expected => { +- :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', +- 'paratest_ShouldHandleParameterizedTests\(125\)', +- 'paratest_ShouldHandleParameterizedTests\(5\)', +- 'paratest_ShouldHandleParameterizedTests2\(7\)', +- 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', +- ], +- :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ParameterizedThroughCommandLine', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :cmdline => " --test_prefix=\"paratest\" --use_param_tests=1", +- :features => [ :parameterized ], +- :expected => { +- :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', +- 'paratest_ShouldHandleParameterizedTests\(125\)', +- 'paratest_ShouldHandleParameterizedTests\(5\)', +- 'paratest_ShouldHandleParameterizedTests2\(7\)', +- 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', +- ], +- :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ParameterizedThroughCommandLineAndYaml', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :cmdline => "--use_param_tests=1", +- :yaml => { +- :test_prefix => "paratest" +- }, +- :features => [ :parameterized ], +- :expected => { +- :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', +- 'paratest_ShouldHandleParameterizedTests\(125\)', +- 'paratest_ShouldHandleParameterizedTests\(5\)', +- 'paratest_ShouldHandleParameterizedTests2\(7\)', +- 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', +- ], +- :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'CException', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'USE_CEXCEPTION'], +- :options => { +- :test_prefix => "extest", +- :plugins => [ :cexception ], +- }, +- :expected => { +- :to_pass => [ 'extest_ShouldHandleCExceptionInTest' ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'CustomSetupAndTeardownThroughOptions', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :options => { +- :test_prefix => "custtest|test", +- :setup_name => "custom_setup", +- :teardown_name => "custom_teardown", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'custtest_ThisTestPassesWhenCustomSetupRan', +- 'custtest_ThisTestPassesWhenCustomTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'CustomSetupAndTeardownThroughCommandLine', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :cmdline => " --test_prefix=\"custtest|test\" --setup_name=\"custom_setup\" --teardown_name=\"custom_teardown\"", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'custtest_ThisTestPassesWhenCustomSetupRan', +- 'custtest_ThisTestPassesWhenCustomTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'CustomSetupAndTeardownThroughYaml', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :cmdline => " --test_prefix=\"custtest|test\"", +- :yaml => { +- :setup_name => "custom_setup", +- :teardown_name => "custom_teardown", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'custtest_ThisTestPassesWhenCustomSetupRan', +- 'custtest_ThisTestPassesWhenCustomTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'CustomMain', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', "USE_ANOTHER_MAIN"], +- :options => { +- :main_name => "custom_main", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'CustomSuiteSetupAndTeardown', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :includes => ['Defs.h'], +- :options => { +- :test_prefix => "suitetest|test", +- :suite_setup => " CounterSuiteSetup = 1;", +- :suite_teardown => " return num_failures;", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'suitetest_ThisTestPassesWhenCustomSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'MainExternDeclaration', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST'], +- :includes => ['Defs.h'], +- :options => { +- :main_export_decl => "EXTERN_DECL", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- +- #### WITH MOCKS ########################################## +- +- { :name => 'DefaultsThroughOptions', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :options => nil, #defaults +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'DefaultsThroughCommandLine', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :cmdline => "", #defaults +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'DefaultsThroughYAMLFile', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :cmdline => "", #defaults +- :yaml => {}, #defaults +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ShorterFilterOfJustTest', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :options => { +- :test_prefix => "test", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ShorterFilterOfJustShould', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :options => { +- :test_prefix => "should", +- }, +- :expected => { +- :to_pass => [ 'should_RunTestsStartingWithShouldByDefault' ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ShorterFilterOfJustSpec', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :options => { +- :test_prefix => "spec", +- }, +- :expected => { +- :to_pass => [ 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'InjectIncludes', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :options => { +- :includes => ['Defs.h'], +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ParameterizedThroughOptions', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :options => { +- :test_prefix => "paratest", +- :use_param_tests => true, +- }, +- :features => [ :parameterized ], +- :expected => { +- :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', +- 'paratest_ShouldHandleParameterizedTests\(125\)', +- 'paratest_ShouldHandleParameterizedTests\(5\)', +- 'paratest_ShouldHandleParameterizedTests2\(7\)', +- 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', +- ], +- :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ParameterizedThroughCommandLine', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :cmdline => " --test_prefix=\"paratest\" --use_param_tests=1", +- :features => [ :parameterized ], +- :expected => { +- :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', +- 'paratest_ShouldHandleParameterizedTests\(125\)', +- 'paratest_ShouldHandleParameterizedTests\(5\)', +- 'paratest_ShouldHandleParameterizedTests2\(7\)', +- 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', +- ], +- :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ParameterizedThroughCommandLineAndYaml', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :cmdline => "--use_param_tests=1", +- :yaml => { +- :test_prefix => "paratest" +- }, +- :features => [ :parameterized ], +- :expected => { +- :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', +- 'paratest_ShouldHandleParameterizedTests\(125\)', +- 'paratest_ShouldHandleParameterizedTests\(5\)', +- 'paratest_ShouldHandleParameterizedTests2\(7\)', +- 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', +- ], +- :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'CException', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST', 'USE_CEXCEPTION'], +- :options => { +- :test_prefix => "extest", +- :plugins => [ :cexception ], +- }, +- :expected => { +- :to_pass => [ 'extest_ShouldHandleCExceptionInTest' ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'CustomSetupAndTeardownThroughOptions', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :options => { +- :test_prefix => "custtest|test", +- :setup_name => "custom_setup", +- :teardown_name => "custom_teardown", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'custtest_ThisTestPassesWhenCustomSetupRan', +- 'custtest_ThisTestPassesWhenCustomTeardownRan', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'CustomSetupAndTeardownThroughCommandLine', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :cmdline => " --test_prefix=\"custtest|test\" --setup_name=\"custom_setup\" --teardown_name=\"custom_teardown\"", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'custtest_ThisTestPassesWhenCustomSetupRan', +- 'custtest_ThisTestPassesWhenCustomTeardownRan', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'CustomSetupAndTeardownThroughYaml', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :cmdline => " --test_prefix=\"custtest|test\"", +- :yaml => { +- :setup_name => "custom_setup", +- :teardown_name => "custom_teardown", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'custtest_ThisTestPassesWhenCustomSetupRan', +- 'custtest_ThisTestPassesWhenCustomTeardownRan', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'CustomMain', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST', "USE_ANOTHER_MAIN"], +- :options => { +- :main_name => "custom_main", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'CustomSuiteSetupAndTeardown', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :includes => ['Defs.h'], +- :options => { +- :test_prefix => "suitetest|test", +- :suite_setup => " CounterSuiteSetup = 1;", +- :suite_teardown => " return num_failures;", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'suitetest_ThisTestPassesWhenCustomSuiteSetupAndTeardownRan', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'MainExternDeclaration', +- :testfile => 'testdata/testRunnerGeneratorWithMocks.c', +- :testdefines => ['TEST'], +- :includes => ['Defs.h'], +- :options => { +- :main_export_decl => "EXTERN_DECL", +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- 'test_ShouldCallMockInitAndVerifyFunctionsForEachTest', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- +- +- #### WITH ARGS ########################################## +- +- { :name => 'ArgsThroughOptions', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsThroughCommandLine', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :cmdline => "--cmdline_args=1", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsThroughYAMLFile', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :cmdline => "", +- :yaml => { +- :cmdline_args => true, +- }, +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsNameFilterJustTest', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n test_", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsNameFilterJustShould', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n should_", +- :expected => { +- :to_pass => [ 'should_RunTestsStartingWithShouldByDefault' ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsNameFilterTestAndShould', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n should_,test_", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault' ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsNameFilterWithWildcardOnFile', +- :testfile => 'testdata/testRunnerGeneratorSmall.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n=testRunnerGeneratorSma*", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan' ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsNameFilterWithWildcardAsName', +- :testfile => 'testdata/testRunnerGeneratorSmall.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n testRunnerGeneratorSmall:*", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan' ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsNameFilterWithWildcardOnName', +- :testfile => 'testdata/testRunnerGeneratorSmall.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n testRunnerGeneratorSmall:test_*", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses' ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsNameFilterWithWildcardAndShortName', +- :testfile => 'testdata/testRunnerGeneratorSmall.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n testRunnerGeneratorSmall:te*", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses' ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsNameFilterWithWildcardOnBoth', +- :testfile => 'testdata/testRunnerGeneratorSmall.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n testRunnerGeneratorSm*:*", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan' ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsExcludeFilterJustTest', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-x test_", +- :expected => { +- :to_pass => [ 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- 'should_RunTestsStartingWithShouldByDefault', +- ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsIncludeAndExcludeFilter', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- :includes => ['Defs.h'], +- }, +- :cmdline_args => "-n test_ -x Ignored", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsIncludeSingleTest', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n ThisTestAlwaysPasses", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses' ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsIncludeSingleTestInSpecificFile', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n testRunnerGenerator:ThisTestAlwaysPasses", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses' ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsIncludeTestFileWithExtension', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n testRunnerGenerator.c:ThisTestAlwaysPasses", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses' ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsIncludeDoubleQuotes', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n \"testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails\"", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses' ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsIncludeSingleQuotes', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n 'testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails'", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses' ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsIncludeAValidTestForADifferentFile', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n AnotherFile:ThisTestDoesNotExist", +- :expected => { +- :to_pass => [ ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsIncludeNoTests', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n ThisTestDoesNotExist", +- :expected => { +- :to_pass => [ ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsExcludeAllTests', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-x _", +- :expected => { +- :to_pass => [ ], +- :to_fail => [ ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsIncludeFullFile', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n testRunnerGenerator", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses', +- 'spec_ThisTestPassesWhenNormalSetupRan', +- 'spec_ThisTestPassesWhenNormalTeardownRan', +- 'test_NotBeConfusedByLongComplicatedStrings', +- 'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings', +- 'test_StillNotBeConfusedByLongComplicatedStrings', +- 'should_RunTestsStartingWithShouldByDefault', +- 'spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan', +- ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ 'test_ThisTestAlwaysIgnored' ], +- } +- }, +- +- { :name => 'ArgsIncludeWithAlternateFlag', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-f=\"testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails\"", +- :expected => { +- :to_pass => [ 'test_ThisTestAlwaysPasses' ], +- :to_fail => [ 'test_ThisTestAlwaysFails' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsIncludeWithParameterized', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :cmdline => "--use_param_tests=1", +- :yaml => { +- :cmdline_args => true, +- :test_prefix => "paratest" +- }, +- :cmdline_args => "-n ShouldHandleParameterizedTests", +- :features => [ :parameterized ], +- :expected => { +- :to_pass => [ 'paratest_ShouldHandleParameterizedTests\(25\)', +- 'paratest_ShouldHandleParameterizedTests\(125\)', +- 'paratest_ShouldHandleParameterizedTests\(5\)', +- 'paratest_ShouldHandleParameterizedTests2\(7\)', +- ], +- :to_fail => [ 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' ], +- :to_ignore => [ ], +- } +- }, +- +- { :name => 'ArgsList', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-l", +- :expected => { +- :to_pass => [ ], +- :to_fail => [ ], +- :to_ignore => [ ], +- :text => [ "testRunnerGenerator", +- "test_ThisTestAlwaysPasses", +- "test_ThisTestAlwaysFails", +- "test_ThisTestAlwaysIgnored", +- "spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan", +- "spec_ThisTestPassesWhenNormalSetupRan", +- "spec_ThisTestPassesWhenNormalTeardownRan", +- "test_NotBeConfusedByLongComplicatedStrings", +- "test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings", +- "test_StillNotBeConfusedByLongComplicatedStrings", +- "should_RunTestsStartingWithShouldByDefault" +- ] +- } +- }, +- +- { :name => 'ArgsListParameterized', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :test_prefix => "paratest", +- :use_param_tests => true, +- :cmdline_args => true, +- }, +- :cmdline_args => "-l", +- :features => [ :parameterized ], +- :expected => { +- :to_pass => [ ], +- :to_fail => [ ], +- :to_ignore => [ ], +- :text => [ "testRunnerGenerator", +- 'paratest_ShouldHandleParameterizedTests\(25\)', +- 'paratest_ShouldHandleParameterizedTests\(125\)', +- 'paratest_ShouldHandleParameterizedTests\(5\)', +- 'paratest_ShouldHandleParameterizedTests2\(7\)', +- 'paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid', +- 'paratest_ShouldHandleParameterizedTestsThatFail\(17\)' +- ], +- } +- }, +- +- { :name => 'ArgsIncompleteIncludeFlags', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-n", +- :expected => { +- :to_pass => [ ], +- :to_fail => [ ], +- :to_ignore => [ ], +- :text => [ "ERROR: No Test String to Include Matches For" ], +- } +- }, +- +- { :name => 'ArgsIncompleteExcludeFlags', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-x", +- :expected => { +- :to_pass => [ ], +- :to_fail => [ ], +- :to_ignore => [ ], +- :text => [ "ERROR: No Test String to Exclude Matches For" ], +- } +- }, +- +- { :name => 'ArgsIllegalFlags', +- :testfile => 'testdata/testRunnerGenerator.c', +- :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], +- :options => { +- :cmdline_args => true, +- }, +- :cmdline_args => "-z", +- :expected => { +- :to_pass => [ ], +- :to_fail => [ ], +- :to_ignore => [ ], +- :text => [ "ERROR: Unknown Option z" ], +- } +- }, +-] +- +-def runner_test(test, runner, expected, test_defines, cmdline_args, features) +- # Tack on TEST define for compiling unit tests +- load_configuration($cfg_file) +- +- # Drop Out if we're skipping this type of test +- if $cfg[:skip_tests] && features +- if $cfg[:skip_tests].include?(:parameterized) && features.include?(:parameterized) +- report("Skipping Parameterized Tests for this Target:IGNORE") +- return true +- end +- end +- +- #compile objects +- obj_list = [ +- compile(runner, test_defines), +- compile(test, test_defines), +- compile('../src/unity.c', test_defines), +- ] +- +- # Link the test executable +- test_base = File.basename(test, C_EXTENSION) +- link_it(test_base, obj_list) +- +- # Execute unit test and generate results file +- output = runtest(test_base, true, cmdline_args) +- +- #compare to the expected pass/fail +- allgood = expected[:to_pass].inject(true) {|s,v| s && verify_match(/#{v}:PASS/, output) } +- allgood = expected[:to_fail].inject(allgood) {|s,v| s && verify_match(/#{v}:FAIL/, output) } +- allgood = expected[:to_ignore].inject(allgood) {|s,v| s && verify_match(/#{v}:IGNORE/, output) } +- +- #verify there weren't more pass/fail/etc than expected +- allgood &&= verify_number( expected[:to_pass], /(:PASS)/, output) +- allgood &&= verify_number( expected[:to_fail], /(:FAIL)/, output) +- allgood &&= verify_number( expected[:to_ignore], /(:IGNORE)/, output) +- +- #if we care about any other text, check that too +- if (expected[:text]) +- allgood = expected[:text].inject(allgood) {|s,v| s && verify_match(/#{v}/, output) } +- allgood &&= verify_number( expected[:text], /.+/, output ) +- end +- +- report output if (!allgood && !$verbose) #report failures if not already reporting everything +- return allgood +-end +- +-def verify_match(expression, output) +- if (expression =~ output) +- return true +- else +- report " FAIL: No Match For /#{expression.to_s}/" +- return false +- end +-end +- +-def verify_number(expected, expression, output) +- exp = expected.length +- act = output.scan(expression).length +- if (exp == act) +- return true +- else +- report " FAIL: Expected #{exp} Matches For /#{expression.to_s}/. Was #{act}" +- return false +- end +-end +- +-RUNNER_TESTS.each do |testset| +- basename = File.basename(testset[:testfile], C_EXTENSION) +- testset_name = "Runner_#{basename}_#{testset[:name]}" +- should testset_name do +- runner_name = OUT_FILE + testset[:name] + '_runner.c' +- +- #create a yaml file first if required +- yaml_option = "" +- if (testset[:yaml]) +- File.open("build/runner_options.yml",'w') {|f| f << { :unity => testset[:yaml] }.to_yaml } +- yaml_option = "build/runner_options.yml" +- end +- +- #run script via command line or through hash function call, as requested +- if (testset[:cmdline]) +- cmdstr = "ruby ../auto/generate_test_runner.rb #{yaml_option} #{testset[:cmdline]} \"#{testset[:testfile]}\" \"#{runner_name}\"" +- `#{cmdstr}` +- else +- UnityTestRunnerGenerator.new(testset[:options]).run(testset[:testfile], runner_name) +- end +- +- #test the script against the specified test file and check results +- if (runner_test(testset[:testfile], runner_name, testset[:expected], testset[:testdefines], testset[:cmdline_args], testset[:features])) +- report "#{testset_name}:PASS" +- else +- report "#{testset_name}:FAIL" +- $generate_test_runner_failures += 1 +- end +- $generate_test_runner_tests += 1 +- end +-end +- +-raise "There were #{$generate_test_runner_failures.to_s} failures while testing generate_test_runner.rb" if ($generate_test_runner_failures > 0) +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_arrays.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_arrays.c +deleted file mode 100644 +index ff90a6c429..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_arrays.c ++++ /dev/null +@@ -1,2874 +0,0 @@ +-/* ========================================== +- 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] +-========================================== */ +- +-#include "unity.h" +-#define TEST_INSTANCES +-#include "self_assessment_utils.h" +- +-static int SetToOneToFailInTearDown; +-static int SetToOneMeanWeAlreadyCheckedThisGuy; +- +-void setUp(void) +-{ +- SetToOneToFailInTearDown = 0; +- SetToOneMeanWeAlreadyCheckedThisGuy = 0; +-} +- +-void tearDown(void) +-{ +- endPutcharSpy(); /* Stop suppressing test output */ +- if (SetToOneToFailInTearDown == 1) +- { +- /* These will be skipped internally if already failed/ignored */ +- TEST_FAIL_MESSAGE("<= Failed in tearDown"); +- TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); +- } +- if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) +- { +- UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); +- UNITY_OUTPUT_CHAR('\n'); +- } +-} +- +-void testInt64ArrayWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualSmallDelta[] = {12345001, -12344996, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- TEST_ASSERT_INT64_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); +-#endif +-} +- +-void testInt64ArrayWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualSmallDelta[] = {12345001, -12344996, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); +-#endif +-} +- +-void tesUInt64ArrayNotWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayNotWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaPointless(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaPointlessAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaExpectedNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaActualNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, NULL, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaActualNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaSamePointer(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, expected, 3); +-#endif +-} +- +-void testInt64ArrayWithinDeltaSamePointerAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); +-#endif +-} +- +-void testIntArrayWithinDelta(void) +-{ +- UNITY_INT expected[] = {5000, -4995, 5005}; +- UNITY_INT actualSmallDelta[] = {5001, -4996, 5005}; +- UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; +- +- TEST_ASSERT_INT_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, actualBigDelta, 3); +-} +- +-void testIntArrayWithinDeltaAndMessage(void) +-{ +- UNITY_INT expected[] = {5000, -4995, 5005}; +- UNITY_INT actualSmallDelta[] = {5001, -4996, 5005}; +- UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; +- +- TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); +-} +- +-void testIntArrayNotWithinDelta(void) +-{ +- UNITY_INT expected[] = {5000, -4995, 5005}; +- UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testIntArrayNotWithinDeltaAndMessage(void) +-{ +- UNITY_INT expected[] = {5000, -4995, 5005}; +- UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testIntArrayWithinDeltaPointless(void) +-{ +- UNITY_INT expected[] = {5000, -4995, 5005}; +- UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-} +- +-void testIntArrayWithinDeltaPointlessAndMessage(void) +-{ +- UNITY_INT expected[] = {5000, -4995, 5005}; +- UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testIntArrayWithinDeltaExpectedNull(void) +-{ +- UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testIntArrayWithinDeltaExpectedNullAndMessage(void) +-{ +- UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testIntArrayWithinDeltaActualNull(void) +-{ +- UNITY_INT expected[] = {5000, -4995, 5005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, NULL, 3); +- VERIFY_FAILS_END +-} +- +-void testIntArrayWithinDeltaActualNullAndMessage(void) +-{ +- UNITY_INT expected[] = {5000, -4995, 5005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testIntArrayWithinDeltaSamePointer(void) +-{ +- UNITY_INT expected[] = {5000, -4995, 5005}; +- +- TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, expected, 3); +-} +- +-void testIntArrayWithinDeltaSamePointerAndMessage(void) +-{ +- UNITY_INT expected[] = {5000, -4995, 5005}; +- +- TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); +-} +- +-void testInt16ArrayWithinDelta(void) +-{ +- UNITY_INT16 expected[] = {5000, -4995, 5005}; +- UNITY_INT16 actualSmallDelta[] = {5001, -4996, 5005}; +- UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; +- +- TEST_ASSERT_INT16_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, actualBigDelta, 3); +-} +- +-void testInt16ArrayWithinDeltaAndMessage(void) +-{ +- UNITY_INT16 expected[] = {5000, -4995, 5005}; +- UNITY_INT16 actualSmallDelta[] = {5001, -4996, 5005}; +- UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; +- +- TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); +-} +- +-void testInt16ArrayNotWithinDelta(void) +-{ +- UNITY_INT16 expected[] = {5000, -4995, 5005}; +- UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testInt16ArrayNotWithinDeltaAndMessage(void) +-{ +- UNITY_INT16 expected[] = {5000, -4995, 5005}; +- UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testInt16ArrayWithinDeltaPointless(void) +-{ +- UNITY_INT16 expected[] = {5000, -4995, 5005}; +- UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-} +- +-void testInt16ArrayWithinDeltaPointlessAndMessage(void) +-{ +- UNITY_INT16 expected[] = {5000, -4995, 5005}; +- UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testInt16ArrayWithinDeltaExpectedNull(void) +-{ +- UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT16_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testInt16ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +- UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testInt16ArrayWithinDeltaActualNull(void) +-{ +- UNITY_INT16 expected[] = {5000, -4995, 5005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, NULL, 3); +- VERIFY_FAILS_END +-} +- +-void testInt16ArrayWithinDeltaActualNullAndMessage(void) +-{ +- UNITY_INT16 expected[] = {5000, -4995, 5005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testInt16ArrayWithinDeltaSamePointer(void) +-{ +- UNITY_INT16 expected[] = {5000, -4995, 5005}; +- +- TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, expected, 3); +-} +- +-void testInt16ArrayWithinDeltaSamePointerAndMessage(void) +-{ +- UNITY_INT16 expected[] = {5000, -4995, 5005}; +- +- TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); +-} +- +-void testInt8ArrayWithinDelta(void) +-{ +- UNITY_INT8 expected[] = {20, -95, 55}; +- UNITY_INT8 actualSmallDelta[] = {21, -94, 55}; +- UNITY_INT8 actualBigDelta[] = {11, -86, 45}; +- +- TEST_ASSERT_INT8_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, actualBigDelta, 3); +-} +- +-void testInt8ArrayWithinDeltaAndMessage(void) +-{ +- UNITY_INT8 expected[] = {20, -95, 55}; +- UNITY_INT8 actualSmallDelta[] = {21, -94, 55}; +- UNITY_INT8 actualBigDelta[] = {11, -86, 45}; +- +- TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 3, "Custom Message."); +-} +- +-void testInt8ArrayNotWithinDelta(void) +-{ +- UNITY_INT8 expected[] = {20, -95, 55}; +- UNITY_INT8 actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT8_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testInt8ArrayNotWithinDeltaAndMessage(void) +-{ +- UNITY_INT8 expected[] = {20, -95, 55}; +- UNITY_INT8 actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testInt8ArrayWithinDeltaPointless(void) +-{ +- UNITY_INT8 expected[] = {20, -95, 55}; +- UNITY_INT8 actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-} +- +-void testInt8ArrayWithinDeltaPointlessAndMessage(void) +-{ +- UNITY_INT8 expected[] = {20, -95, 55}; +- UNITY_INT8 actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testInt8ArrayWithinDeltaExpectedNull(void) +-{ +- UNITY_INT8 actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT8_ARRAY_WITHIN(11, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testInt8ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +- UNITY_INT8 actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testInt8ArrayWithinDeltaActualNull(void) +-{ +- UNITY_INT8 expected[] = {20, -95, 55}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, NULL, 3); +- VERIFY_FAILS_END +-} +- +-void testInt8ArrayWithinDeltaActualNullAndMessage(void) +-{ +- UNITY_INT8 expected[] = {20, -95, 55}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testInt8ArrayWithinDeltaSamePointer(void) +-{ +- UNITY_INT8 expected[] = {20, -95, 55}; +- +- TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, expected, 3); +-} +- +-void testInt8ArrayWithinDeltaSamePointerAndMessage(void) +-{ +- UNITY_INT8 expected[] = {20, -95, 55}; +- +- TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, expected, 3, "Custom Message."); +-} +- +-void testCHARArrayWithinDelta(void) +-{ +- char expected[] = {20, -95, 55}; +- char actualSmallDelta[] = {21, -94, 55}; +- char actualBigDelta[] = {11, -86, 45}; +- +- TEST_ASSERT_CHAR_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, actualBigDelta, 3); +-} +- +-void testCHARArrayWithinDeltaAndMessage(void) +-{ +- char expected[] = {20, -95, 55}; +- char actualSmallDelta[] = {21, -94, 55}; +- char actualBigDelta[] = {11, -86, 45}; +- +- TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 3, "Custom Message."); +-} +- +-void testCHARArrayNotWithinDelta(void) +-{ +- char expected[] = {20, -95, 55}; +- char actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_CHAR_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testCHARArrayNotWithinDeltaAndMessage(void) +-{ +- char expected[] = {20, -95, 55}; +- char actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testCHARArrayWithinDeltaPointless(void) +-{ +- char expected[] = {20, -95, 55}; +- char actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-} +- +-void testCHARArrayWithinDeltaPointlessAndMessage(void) +-{ +- char expected[] = {20, -95, 55}; +- char actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testCHARArrayWithinDeltaExpectedNull(void) +-{ +- char actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_CHAR_ARRAY_WITHIN(11, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testCHARArrayWithinDeltaExpectedNullAndMessage(void) +-{ +- char actualBigDelta[] = {11, -86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testCHARArrayWithinDeltaActualNull(void) +-{ +- char expected[] = {20, -95, 55}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, NULL, 3); +- VERIFY_FAILS_END +-} +- +-void testCHARArrayWithinDeltaActualNullAndMessage(void) +-{ +- char expected[] = {20, -95, 55}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testCHARArrayWithinDeltaSamePointer(void) +-{ +- char expected[] = {20, -95, 55}; +- +- TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, expected, 3); +-} +- +-void testCHARArrayWithinDeltaSamePointerAndMessage(void) +-{ +- char expected[] = {20, -95, 55}; +- +- TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, expected, 3, "Custom Message."); +-} +- +-void testUInt64ArrayWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualSmallDelta[] = {12345001, 12344996, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); +-#endif +-} +- +-void testUInt64ArrayWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualSmallDelta[] = {12345001, 12344996, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); +-#endif +-} +- +-void testUInt64ArrayNotWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayNotWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaPointless(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaPointlessAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaExpectedNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaActualNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, NULL, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaActualNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaSamePointer(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, expected, 3); +-#endif +-} +- +-void testUInt64ArrayWithinDeltaSamePointerAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); +-#endif +-} +- +-void testUIntArrayWithinDelta(void) +-{ +- UNITY_UINT expected[] = {125000, 124995, 125005}; +- UNITY_UINT actualSmallDelta[] = {125001, 124996, 125005}; +- UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; +- +- TEST_ASSERT_UINT_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, actualBigDelta, 3); +-} +- +-void testUIntArrayWithinDeltaAndMessage(void) +-{ +- UNITY_UINT expected[] = {125000, 124995, 125005}; +- UNITY_UINT actualSmallDelta[] = {125001, 124996, 125005}; +- UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; +- +- TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); +-} +- +-void testUIntArrayNotWithinDelta(void) +-{ +- UNITY_UINT expected[] = {125000, 124995, 125005}; +- UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testUIntArrayNotWithinDeltaAndMessage(void) +-{ +- UNITY_UINT expected[] = {125000, 124995, 125005}; +- UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUIntArrayWithinDeltaPointless(void) +-{ +- UNITY_UINT expected[] = {125000, 124995, 125005}; +- UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-} +- +-void testUIntArrayWithinDeltaPointlessAndMessage(void) +-{ +- UNITY_UINT expected[] = {125000, 124995, 125005}; +- UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUIntArrayWithinDeltaExpectedNull(void) +-{ +- UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testUIntArrayWithinDeltaExpectedNullAndMessage(void) +-{ +- UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUIntArrayWithinDeltaActualNull(void) +-{ +- UNITY_UINT expected[] = {125000, 124995, 125005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, NULL, 3); +- VERIFY_FAILS_END +-} +- +-void testUIntArrayWithinDeltaActualNullAndMessage(void) +-{ +- UNITY_UINT expected[] = {125000, 124995, 125005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUIntArrayWithinDeltaSamePointer(void) +-{ +- UNITY_UINT expected[] = {125000, 124995, 125005}; +- +- TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, expected, 3); +-} +- +-void testUIntArrayWithinDeltaSamePointerAndMessage(void) +-{ +- UNITY_UINT expected[] = {125000, 124995, 125005}; +- +- TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); +-} +- +-void testUInt16ArrayWithinDelta(void) +-{ +- UNITY_UINT16 expected[] = {5000, 4995, 5005}; +- UNITY_UINT16 actualSmallDelta[] = {5001, 4996, 5005}; +- UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; +- +- TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, actualBigDelta, 3); +-} +- +-void testUInt16ArrayWithinDeltaAndMessage(void) +-{ +- UNITY_UINT16 expected[] = {5000, 4995, 5005}; +- UNITY_UINT16 actualSmallDelta[] = {5001, 4996, 5005}; +- UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; +- +- TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); +-} +- +-void testUInt16ArrayNotWithinDelta(void) +-{ +- UNITY_UINT16 expected[] = {5000, 4995, 5005}; +- UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testUInt16ArrayNotWithinDeltaAndMessage(void) +-{ +- UNITY_UINT16 expected[] = {5000, 4995, 5005}; +- UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUInt16ArrayWithinDeltaPointless(void) +-{ +- UNITY_UINT16 expected[] = {5000, 4995, 5005}; +- UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-} +- +-void testUInt16ArrayWithinDeltaPointlessAndMessage(void) +-{ +- UNITY_UINT16 expected[] = {5000, 4995, 5005}; +- UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUInt16ArrayWithinDeltaExpectedNull(void) +-{ +- UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testUInt16ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +- UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUInt16ArrayWithinDeltaActualNull(void) +-{ +- UNITY_UINT16 expected[] = {5000, 4995, 5005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, NULL, 3); +- VERIFY_FAILS_END +-} +- +-void testUInt16ArrayWithinDeltaActualNullAndMessage(void) +-{ +- UNITY_UINT16 expected[] = {5000, 4995, 5005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUInt16ArrayWithinDeltaSamePointer(void) +-{ +- UNITY_UINT16 expected[] = {5000, 4995, 5005}; +- +- TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, expected, 3); +-} +- +-void testUInt16ArrayWithinDeltaSamePointerAndMessage(void) +-{ +- UNITY_UINT16 expected[] = {5000, 4995, 5005}; +- +- TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); +-} +- +-void testUInt8ArrayWithinDelta(void) +-{ +- UNITY_UINT8 expected[] = {20, 95, 55}; +- UNITY_UINT8 actualSmallDelta[] = {21, 94, 55}; +- UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; +- +- TEST_ASSERT_UINT8_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, actualBigDelta, 3); +-} +- +-void testUInt8ArrayWithinDeltaAndMessage(void) +-{ +- UNITY_UINT8 expected[] = {20, 95, 55}; +- UNITY_UINT8 actualSmallDelta[] = {21, 94, 55}; +- UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; +- +- TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 3, "Custom Message."); +-} +- +-void testUInt8ArrayNotWithinDelta(void) +-{ +- UNITY_UINT8 expected[] = {20, 95, 55}; +- UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT8_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testUInt8ArrayNotWithinDeltaAndMessage(void) +-{ +- UNITY_UINT8 expected[] = {20, 95, 55}; +- UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUInt8ArrayWithinDeltaPointless(void) +-{ +- UNITY_UINT8 expected[] = {20, 95, 55}; +- UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-} +- +-void testUInt8ArrayWithinDeltaPointlessAndMessage(void) +-{ +- UNITY_UINT8 expected[] = {20, 95, 55}; +- UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUInt8ArrayWithinDeltaExpectedNull(void) +-{ +- UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT8_ARRAY_WITHIN(11, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testUInt8ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +- UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUInt8ArrayWithinDeltaActualNull(void) +-{ +- UNITY_UINT8 expected[] = {20, 95, 55}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, NULL, 3); +- VERIFY_FAILS_END +-} +- +-void testUInt8ArrayWithinDeltaActualNullAndMessage(void) +-{ +- UNITY_UINT8 expected[] = {20, 95, 55}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUInt8ArrayWithinDeltaSamePointer(void) +-{ +- UNITY_UINT8 expected[] = {20, 95, 55}; +- +- TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, expected, 3); +-} +- +-void testUInt8ArrayWithinDeltaSamePointerAndMessage(void) +-{ +- UNITY_UINT8 expected[] = {20, 95, 55}; +- +- TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, expected, 3, "Custom Message."); +-} +- +-void testHEX64ArrayWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualSmallDelta[] = {0xABCD123500000000, 0xABCD112100000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x100000000, expected, actualSmallDelta, 3); +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, actualBigDelta, 3); +-#endif +-} +- +-void testHEX64ArrayWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualSmallDelta[] = {0xABCD123500000000, 0xABCD112100000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x100000000, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, actualBigDelta, 3, "Custom Message."); +-#endif +-} +- +-void testHEX64ArrayNotWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x100000000, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayNotWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x100000000, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaPointless(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaPointlessAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaExpectedNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaActualNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, NULL, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaActualNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaSamePointer(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, expected, 3); +-#endif +-} +- +-void testHEX64ArrayWithinDeltaSamePointerAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, expected, 3, "Custom Message."); +-#endif +-} +- +-void testHEX32ArrayWithinDelta(void) +-{ +- UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; +- UNITY_UINT actualSmallDelta[] = {0xABCD1235, 0xABCD1121, 0xABCD1277}; +- UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; +- +- TEST_ASSERT_HEX32_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, actualBigDelta, 3); +-} +- +-void testHEX32ArrayWithinDeltaAndMessage(void) +-{ +- UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; +- UNITY_UINT actualSmallDelta[] = {0xABCD1235, 0xABCD1121, 0xABCD1277}; +- UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; +- +- TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); +-} +- +-void testHEX32ArrayNotWithinDelta(void) +-{ +- UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; +- UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testHEX32ArrayNotWithinDeltaAndMessage(void) +-{ +- UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; +- UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX32ArrayWithinDeltaPointless(void) +-{ +- UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; +- UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-} +- +-void testHEX32ArrayWithinDeltaPointlessAndMessage(void) +-{ +- UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; +- UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX32ArrayWithinDeltaExpectedNull(void) +-{ +- UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testHEX32ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +- UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX32ArrayWithinDeltaActualNull(void) +-{ +- UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, NULL, 3); +- VERIFY_FAILS_END +-} +- +-void testHEX32ArrayWithinDeltaActualNullAndMessage(void) +-{ +- UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX32ArrayWithinDeltaSamePointer(void) +-{ +- UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; +- +- TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, expected, 3); +-} +- +-void testHEX32ArrayWithinDeltaSamePointerAndMessage(void) +-{ +- UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; +- +- TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); +-} +- +- +-void testHEX16ArrayWithinDelta(void) +-{ +- UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; +- UNITY_UINT16 actualSmallDelta[] = {0x1235, 0x1121, 0x1277}; +- UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; +- +- TEST_ASSERT_HEX16_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, actualBigDelta, 3); +-} +- +-void testHEX16ArrayWithinDeltaAndMessage(void) +-{ +- UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; +- UNITY_UINT16 actualSmallDelta[] = {0x1235, 0x1121, 0x1277}; +- UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; +- +- TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); +-} +- +-void testHEX16ArrayNotWithinDelta(void) +-{ +- UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; +- UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX16_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testHEX16ArrayNotWithinDeltaAndMessage(void) +-{ +- UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; +- UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX16ArrayWithinDeltaPointless(void) +-{ +- UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; +- UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-} +- +-void testHEX16ArrayWithinDeltaPointlessAndMessage(void) +-{ +- UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; +- UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX16ArrayWithinDeltaExpectedNull(void) +-{ +- UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX16_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testHEX16ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +- UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX16ArrayWithinDeltaActualNull(void) +-{ +- UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, NULL, 3); +- VERIFY_FAILS_END +-} +- +-void testHEX16ArrayWithinDeltaActualNullAndMessage(void) +-{ +- UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX16ArrayWithinDeltaSamePointer(void) +-{ +- UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; +- +- TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, expected, 3); +-} +- +-void testHEX16ArrayWithinDeltaSamePointerAndMessage(void) +-{ +- UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; +- +- TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); +-} +- +-void testHEX8ArrayWithinDelta(void) +-{ +- UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; +- UNITY_UINT8 actualSmallDelta[] = {0x35, 0x21, 0x77}; +- UNITY_UINT8 actualBigDelta[] = {0x47, 0x48, 0x4C}; +- +- TEST_ASSERT_HEX8_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, actualBigDelta, 3); +-} +- +-void testHEX8ArrayWithinDeltaAndMessage(void) +-{ +- UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; +- UNITY_UINT8 actualSmallDelta[] = {0x35, 0x21, 0x77}; +- UNITY_UINT8 actualBigDelta[] = {0x47, 0x48, 0x4C}; +- +- TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, actualBigDelta, 3, "Custom Message."); +-} +- +-void testHEX8ArrayNotWithinDelta(void) +-{ +- UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; +- UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX8_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testHEX8ArrayNotWithinDeltaAndMessage(void) +-{ +- UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; +- UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX8ArrayWithinDeltaPointless(void) +-{ +- UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; +- UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-} +- +-void testHEX8ArrayWithinDeltaPointlessAndMessage(void) +-{ +- UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; +- UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX8ArrayWithinDeltaExpectedNull(void) +-{ +- UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX8_ARRAY_WITHIN(60, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-} +- +-void testHEX8ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +- UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX8ArrayWithinDeltaActualNull(void) +-{ +- UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, NULL, 3); +- VERIFY_FAILS_END +-} +- +-void testHEX8ArrayWithinDeltaActualNullAndMessage(void) +-{ +- UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX8ArrayWithinDeltaSamePointer(void) +-{ +- UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; +- +- TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, expected, 3); +-} +- +-void testHEX8ArrayWithinDeltaSamePointerAndMessage(void) +-{ +- UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; +- +- TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, expected, 3, "Custom Message."); +-} +- +-void testEqualIntArrays(void) +-{ +- int p0[] = {1, 8, 987, -2}; +- int p1[] = {1, 8, 987, -2}; +- int p2[] = {1, 8, 987, 2}; +- int p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p3, 1); +- TEST_ASSERT_EQUAL_INT_ARRAY(NULL, NULL, 1); +-} +- +-void testNotEqualIntArraysNullExpected(void) +-{ +- int* p0 = NULL; +- int p1[] = {1, 8, 987, 2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualIntArraysNullActual(void) +-{ +- int* p1 = NULL; +- int p0[] = {1, 8, 987, 2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualIntArrays1(void) +-{ +- int p0[] = {1, 8, 987, -2}; +- int p1[] = {1, 8, 987, 2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualIntArrays2(void) +-{ +- int p0[] = {1, 8, 987, -2}; +- int p1[] = {2, 8, 987, -2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualIntArrays3(void) +-{ +- int p0[] = {1, 8, 987, -2}; +- int p1[] = {1, 8, 986, -2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualIntArraysLengthZero(void) +-{ +- UNITY_UINT32 p0[1] = {1}; +- UNITY_UINT32 p1[1] = {1}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 0); +- VERIFY_FAILS_END +-} +- +-void testEqualIntEachEqual(void) +-{ +- int p0[] = {1, 1, 1, 1}; +- int p1[] = {987, 987, 987, 987}; +- int p2[] = {-2, -2, -2, -3}; +- int p3[] = {1, 5, 600, 700}; +- +- TEST_ASSERT_EACH_EQUAL_INT(1, p0, 1); +- TEST_ASSERT_EACH_EQUAL_INT(1, p0, 4); +- TEST_ASSERT_EACH_EQUAL_INT(987, p1, 4); +- TEST_ASSERT_EACH_EQUAL_INT(-2, p2, 3); +- TEST_ASSERT_EACH_EQUAL_INT(1, p3, 1); +-} +- +-void testNotEqualIntEachEqualNullActual(void) +-{ +- int* p1 = NULL; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_INT(1, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualIntEachEqual1(void) +-{ +- int p0[] = {1, 1, 1, -2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_INT(1, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualIntEachEqual2(void) +-{ +- int p0[] = {-5, -5, -1, -5}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_INT(-5, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualIntEachEqual3(void) +-{ +- int p0[] = {1, 88, 88, 88}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_INT(88, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualEachEqualLengthZero(void) +-{ +- UNITY_UINT32 p0[1] = {1}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_INT(0, p0, 0); +- VERIFY_FAILS_END +-} +- +-void testEqualPtrArrays(void) +-{ +- char A = 1; +- char B = 2; +- char C = 3; +- char* p0[] = {&A, &B, &C}; +- char* p1[] = {&A, &B, &C, &A}; +- char* p2[] = {&A, &B}; +- char* p3[] = {&A}; +- +- TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p0, 3); +- TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p1, 3); +- TEST_ASSERT_EQUAL_PTR_ARRAY(p1, p2, 2); +- TEST_ASSERT_EQUAL_PTR_ARRAY(p3, p0, 1); +-} +- +-void testNotEqualPtrArraysNullExpected(void) +-{ +- char A = 1; +- char B = 2; +- char** p0 = NULL; +- char* p1[] = {&A, &B}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p1, 2); +- VERIFY_FAILS_END +-} +- +-void testNotEqualPtrArraysNullActual(void) +-{ +- char A = 1; +- char B = 2; +- char** p0 = NULL; +- char* p1[] = {&A, &B}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_PTR_ARRAY(p1, p0, 2); +- VERIFY_FAILS_END +-} +- +-void testNotEqualPtrArrays1(void) +-{ +- char A = 1; +- char B = 2; +- char C = 3; +- char* p0[] = {&A, &B, &C, &B}; +- char* p1[] = {&A, &B, &C, &A}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualPtrArrays2(void) +-{ +- char A = 1; +- char B = 2; +- char C = 3; +- char* p0[] = {&B, &B, &C, &A}; +- char* p1[] = {&A, &B, &C, &A}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualPtrArrays3(void) +-{ +- char A = 1; +- char B = 2; +- char C = 3; +- char* p0[] = {&A, &B, &B, &A}; +- char* p1[] = {&A, &B, &C, &A}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_PTR_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualPtrEachEqual(void) +-{ +- char A = 1; +- char B = 2; +- char C = 3; +- char* p0[] = {&A, &A, &A}; +- char* p1[] = {&A, &B, &C, &A}; +- char* p2[] = {&B, &B}; +- char* p3[] = {&C}; +- +- TEST_ASSERT_EACH_EQUAL_PTR(&A, p0, 1); +- TEST_ASSERT_EACH_EQUAL_PTR(&A, p0, 3); +- TEST_ASSERT_EACH_EQUAL_PTR(&A, p1, 1); +- TEST_ASSERT_EACH_EQUAL_PTR(&B, p2, 2); +- TEST_ASSERT_EACH_EQUAL_PTR(&C, p3, 1); +-} +- +-void testNotEqualPtrEachEqualNullExpected(void) +-{ +- char A = 1; +- char B = 1; +- char* p0[] = {&A, &B}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_PTR(&A, p0, 2); +- VERIFY_FAILS_END +-} +- +-void testNotEqualPtrEachEqualNullActual(void) +-{ +- char A = 1; +- char** p0 = NULL; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_PTR(&A, p0, 2); +- VERIFY_FAILS_END +-} +- +-void testNotEqualPtrEachEqual1(void) +-{ +- char A = 1; +- char B = 1; +- char* p0[] = {&A, &A, &A, &B}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_PTR(&A, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualPtrEachEqual2(void) +-{ +- char A = 1; +- char B = 1; +- char* p0[] = {&B, &B, &A, &B}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_PTR(&B, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualPtrEachEqual3(void) +-{ +- char A = 1; +- char B = 1; +- char* p0[] = {&A, &B, &B, &B}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_PTR(&B, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualInt8Arrays(void) +-{ +- UNITY_INT8 p0[] = {1, 8, 117, -2}; +- UNITY_INT8 p1[] = {1, 8, 117, -2}; +- UNITY_INT8 p2[] = {1, 8, 117, 2}; +- UNITY_INT8 p3[] = {1, 50, 60, 70}; +- +- TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualInt8Arrays(void) +-{ +- UNITY_INT8 p0[] = {1, 8, 36, -2}; +- UNITY_INT8 p1[] = {1, 8, 36, 2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT8_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualInt8EachEqual(void) +-{ +- UNITY_INT8 p0[] = {1, 1, 1, 1}; +- UNITY_INT8 p1[] = {117, 117, 117, -2}; +- UNITY_INT8 p2[] = {-1, -1, 117, 2}; +- UNITY_INT8 p3[] = {1, 50, 60, 70}; +- +- TEST_ASSERT_EACH_EQUAL_INT8(1, p0, 1); +- TEST_ASSERT_EACH_EQUAL_INT8(1, p0, 4); +- TEST_ASSERT_EACH_EQUAL_INT8(117, p1, 3); +- TEST_ASSERT_EACH_EQUAL_INT8(-1, p2, 2); +- TEST_ASSERT_EACH_EQUAL_INT8(1, p3, 1); +-} +- +-void testNotEqualInt8EachEqual(void) +-{ +- UNITY_INT8 p0[] = {1, 8, 36, -2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_INT8(1, p0, 2); +- VERIFY_FAILS_END +-} +- +-void testEqualCHARArrays(void) +-{ +- char p0[] = {1, 8, 117, -2}; +- char p1[] = {1, 8, 117, -2}; +- char p2[] = {1, 8, 117, 2}; +- char p3[] = {1, 50, 60, 70}; +- +- TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualCHARArrays(void) +-{ +- char p0[] = {1, 8, 36, -2}; +- char p1[] = {1, 8, 36, 2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualCHAREachEqual(void) +-{ +- char p0[] = {1, 1, 1, 1}; +- char p1[] = {117, 117, 117, -2}; +- char p2[] = {-1, -1, 117, 2}; +- char p3[] = {1, 50, 60, 70}; +- +- TEST_ASSERT_EACH_EQUAL_CHAR(1, p0, 1); +- TEST_ASSERT_EACH_EQUAL_CHAR(1, p0, 4); +- TEST_ASSERT_EACH_EQUAL_CHAR(117, p1, 3); +- TEST_ASSERT_EACH_EQUAL_CHAR(-1, p2, 2); +- TEST_ASSERT_EACH_EQUAL_CHAR(1, p3, 1); +-} +- +-void testNotEqualCHAREachEqual(void) +-{ +- char p0[] = {1, 8, 36, -2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_CHAR(1, p0, 2); +- VERIFY_FAILS_END +-} +- +-void testEqualUIntArrays(void) +-{ +- unsigned int p0[] = {1, 8, 987, 65132u}; +- unsigned int p1[] = {1, 8, 987, 65132u}; +- unsigned int p2[] = {1, 8, 987, 2}; +- unsigned int p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualUIntArrays1(void) +-{ +- unsigned int p0[] = {1, 8, 987, 65132u}; +- unsigned int p1[] = {1, 8, 987, 65131u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUIntArrays2(void) +-{ +- unsigned int p0[] = {1, 8, 987, 65132u}; +- unsigned int p1[] = {2, 8, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUIntArrays3(void) +-{ +- unsigned int p0[] = {1, 8, 987, 65132u}; +- unsigned int p1[] = {1, 8, 986, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualUIntEachEqual(void) +-{ +- unsigned int p0[] = {1, 1, 1, 1}; +- unsigned int p1[] = {65132u, 65132u, 65132u, 65132u}; +- unsigned int p2[] = {8, 8, 987, 2}; +- unsigned int p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EACH_EQUAL_UINT(1, p0, 1); +- TEST_ASSERT_EACH_EQUAL_UINT(1, p0, 4); +- TEST_ASSERT_EACH_EQUAL_UINT(65132u, p1, 4); +- TEST_ASSERT_EACH_EQUAL_UINT(8, p2, 2); +- TEST_ASSERT_EACH_EQUAL_UINT(1, p3, 1); +-} +- +-void testNotEqualUIntEachEqual1(void) +-{ +- unsigned int p0[] = {1, 65132u, 65132u, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT(65132u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUIntEachEqual2(void) +-{ +- unsigned int p0[] = {987, 8, 987, 987}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT(987, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUIntEachEqual3(void) +-{ +- unsigned int p0[] = {1, 1, 1, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT(1, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualInt16Arrays(void) +-{ +- UNITY_INT16 p0[] = {1, 8, 117, 3}; +- UNITY_INT16 p1[] = {1, 8, 117, 3}; +- UNITY_INT16 p2[] = {1, 8, 117, 2}; +- UNITY_INT16 p3[] = {1, 50, 60, 70}; +- +- TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualInt16Arrays(void) +-{ +- UNITY_INT16 p0[] = {1, 8, 127, 3}; +- UNITY_INT16 p1[] = {1, 8, 127, 2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT16_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualInt16EachEqual(void) +-{ +- UNITY_INT16 p0[] = {1, 1, 1, 1}; +- UNITY_INT16 p1[] = {32111, 32111, 32111, 3}; +- UNITY_INT16 p2[] = {-1, -1, -1, 2}; +- UNITY_INT16 p3[] = {1, 50, 60, 70}; +- +- TEST_ASSERT_EACH_EQUAL_INT16(1, p0, 1); +- TEST_ASSERT_EACH_EQUAL_INT16(1, p0, 4); +- TEST_ASSERT_EACH_EQUAL_INT16(32111, p1, 3); +- TEST_ASSERT_EACH_EQUAL_INT16(-1, p2, 3); +- TEST_ASSERT_EACH_EQUAL_INT16(1, p3, 1); +-} +- +-void testNotEqualInt16EachEqual(void) +-{ +- UNITY_INT16 p0[] = {127, 127, 127, 3}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_INT16(127, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualInt32Arrays(void) +-{ +- UNITY_INT32 p0[] = {1, 8, 117, 3}; +- UNITY_INT32 p1[] = {1, 8, 117, 3}; +- UNITY_INT32 p2[] = {1, 8, 117, 2}; +- UNITY_INT32 p3[] = {1, 50, 60, 70}; +- +- TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualInt32Arrays(void) +-{ +- UNITY_INT32 p0[] = {1, 8, 127, 3}; +- UNITY_INT32 p1[] = {1, 8, 127, 2}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT32_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualInt32EachEqual(void) +-{ +- UNITY_INT32 p0[] = {8, 8, 8, 8}; +- UNITY_INT32 p1[] = {65537, 65537, 65537, 65537}; +- UNITY_INT32 p2[] = {-3, -3, -3, 2}; +- UNITY_INT32 p3[] = {1, 50, 60, 70}; +- +- TEST_ASSERT_EACH_EQUAL_INT32(8, p0, 1); +- TEST_ASSERT_EACH_EQUAL_INT32(8, p0, 4); +- TEST_ASSERT_EACH_EQUAL_INT32(65537, p1, 4); +- TEST_ASSERT_EACH_EQUAL_INT32(-3, p2, 3); +- TEST_ASSERT_EACH_EQUAL_INT32(1, p3, 1); +-} +- +-void testNotEqualInt32EachEqual(void) +-{ +- UNITY_INT32 p0[] = {127, 8, 127, 127}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_INT32(127, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualUINT8Arrays(void) +-{ +- UNITY_UINT8 p0[] = {1, 8, 100, 127}; +- UNITY_UINT8 p1[] = {1, 8, 100, 127}; +- UNITY_UINT8 p2[] = {1, 8, 100, 2}; +- UNITY_UINT8 p3[] = {1, 50, 60, 70}; +- +- TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualUINT8Arrays1(void) +-{ +- unsigned char p0[] = {1, 8, 100, 127u}; +- unsigned char p1[] = {1, 8, 100, 255u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT8Arrays2(void) +-{ +- unsigned char p0[] = {1, 8, 100, 127u}; +- unsigned char p1[] = {1, 8, 100, 255u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT8Arrays3(void) +-{ +- unsigned char p0[] = {1, 8, 100, 127u}; +- unsigned char p1[] = {1, 8, 100, 255u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT8_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +- +-void testEqualUINT16Arrays(void) +-{ +- unsigned short p0[] = {1, 8, 987, 65132u}; +- unsigned short p1[] = {1, 8, 987, 65132u}; +- unsigned short p2[] = {1, 8, 987, 2}; +- unsigned short p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualUINT16Arrays1(void) +-{ +- unsigned short p0[] = {1, 8, 987, 65132u}; +- unsigned short p1[] = {1, 8, 987, 65131u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT16Arrays2(void) +-{ +- unsigned short p0[] = {1, 8, 987, 65132u}; +- unsigned short p1[] = {2, 8, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT16Arrays3(void) +-{ +- unsigned short p0[] = {1, 8, 987, 65132u}; +- unsigned short p1[] = {1, 8, 986, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT16_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualUINT32Arrays(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p2[] = {1, 8, 987, 2}; +- UNITY_UINT32 p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualUINT32Arrays1(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {1, 8, 987, 65131u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT32Arrays2(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {2, 8, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT32Arrays3(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {1, 8, 986, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT32_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualHEXArrays(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p2[] = {1, 8, 987, 2}; +- UNITY_UINT32 p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualHEXArrays1(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {1, 8, 987, 65131u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEXArrays2(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {2, 8, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEXArrays3(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {1, 8, 986, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualHEX32Arrays(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p2[] = {1, 8, 987, 2}; +- UNITY_UINT32 p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualHEX32Arrays1(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {1, 8, 987, 65131u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX32Arrays2(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {2, 8, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX32Arrays3(void) +-{ +- UNITY_UINT32 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT32 p1[] = {1, 8, 986, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualHEX16Arrays(void) +-{ +- unsigned short p0[] = {1, 8, 987, 65132u}; +- unsigned short p1[] = {1, 8, 987, 65132u}; +- unsigned short p2[] = {1, 8, 987, 2}; +- unsigned short p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualHEX16Arrays1(void) +-{ +- unsigned short p0[] = {1, 8, 987, 65132u}; +- unsigned short p1[] = {1, 8, 987, 65131u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX16Arrays2(void) +-{ +- unsigned short p0[] = {1, 8, 987, 65132u}; +- unsigned short p1[] = {2, 8, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX16Arrays3(void) +-{ +- unsigned short p0[] = {1, 8, 987, 65132u}; +- unsigned short p1[] = {1, 8, 986, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX16_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualHEX8Arrays(void) +-{ +- unsigned char p0[] = {1, 8, 254u, 123}; +- unsigned char p1[] = {1, 8, 254u, 123}; +- unsigned char p2[] = {1, 8, 254u, 2}; +- unsigned char p3[] = {1, 23, 25, 26}; +- +- TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p3, 1); +-} +- +-void testNotEqualHEX8Arrays1(void) +-{ +- unsigned char p0[] = {1, 8, 254u, 253u}; +- unsigned char p1[] = {1, 8, 254u, 252u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX8Arrays2(void) +-{ +- unsigned char p0[] = {1, 8, 254u, 253u}; +- unsigned char p1[] = {2, 8, 254u, 253u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX8Arrays3(void) +-{ +- unsigned char p0[] = {1, 8, 254u, 253u}; +- unsigned char p1[] = {1, 8, 255u, 253u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX8_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualUINT8EachEqual(void) +-{ +- UNITY_UINT8 p0[] = {127u, 127u, 127u, 127u}; +- UNITY_UINT8 p1[] = {1u, 1u, 1u, 1u}; +- UNITY_UINT8 p2[] = {128u, 128u, 128u, 2u}; +- UNITY_UINT8 p3[] = {1u, 50u, 60u, 70u}; +- +- TEST_ASSERT_EACH_EQUAL_UINT8(127u, p0, 1); +- TEST_ASSERT_EACH_EQUAL_UINT8(127u, p0, 4); +- TEST_ASSERT_EACH_EQUAL_UINT8(1u, p1, 4); +- TEST_ASSERT_EACH_EQUAL_UINT8(128u, p2, 3); +- TEST_ASSERT_EACH_EQUAL_UINT8(1u, p3, 1); +-} +- +-void testNotEqualUINT8EachEqual1(void) +-{ +- unsigned char p0[] = {127u, 127u, 128u, 127u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT8(127u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT8EachEqual2(void) +-{ +- unsigned char p0[] = {1, 1, 1, 127u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT8(1, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT8EachEqual3(void) +-{ +- unsigned char p0[] = {54u, 55u, 55u, 55u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT8(55u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualUINT16EachEqual(void) +-{ +- unsigned short p0[] = {65132u, 65132u, 65132u, 65132u}; +- unsigned short p1[] = {987, 987, 987, 987}; +- unsigned short p2[] = {1, 1, 1, 2}; +- unsigned short p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EACH_EQUAL_UINT16(65132u, p0, 1); +- TEST_ASSERT_EACH_EQUAL_UINT16(65132u, p0, 4); +- TEST_ASSERT_EACH_EQUAL_UINT16(987, p1, 4); +- TEST_ASSERT_EACH_EQUAL_UINT16(1, p2, 3); +- TEST_ASSERT_EACH_EQUAL_UINT16(1, p3, 1); +-} +- +-void testNotEqualUINT16EachEqual1(void) +-{ +- unsigned short p0[] = {1, 65132u, 65132u, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT16(65132u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT16EachEqual2(void) +-{ +- unsigned short p0[] = {65132u, 65132u, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT16(65132u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT16EachEqual3(void) +-{ +- unsigned short p0[] = {65132u, 65132u, 65132u, 65133u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT16(65132u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualUINT32EachEqual(void) +-{ +- UNITY_UINT32 p0[] = {65132u, 65132u, 65132u, 65132u}; +- UNITY_UINT32 p1[] = {987, 987, 987, 987}; +- UNITY_UINT32 p2[] = {8, 8, 8, 2}; +- UNITY_UINT32 p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EACH_EQUAL_UINT32(65132u, p0, 1); +- TEST_ASSERT_EACH_EQUAL_UINT32(65132u, p0, 4); +- TEST_ASSERT_EACH_EQUAL_UINT32(987, p1, 4); +- TEST_ASSERT_EACH_EQUAL_UINT32(8, p2, 3); +- TEST_ASSERT_EACH_EQUAL_UINT32(1, p3, 1); +-} +- +-void testNotEqualUINT32EachEqual1(void) +-{ +- UNITY_UINT32 p0[] = {65132u, 65132u, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT32(65132u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT32EachEqual2(void) +-{ +- UNITY_UINT32 p0[] = {1, 987, 987, 987}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT32(987, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT32EachEqual3(void) +-{ +- UNITY_UINT32 p0[] = {1, 1, 1, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_UINT32(1, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualHEXEachEqual(void) +-{ +- UNITY_UINT32 p0[] = {65132u, 65132u, 65132u, 65132u}; +- UNITY_UINT32 p1[] = {987, 987, 987, 987}; +- UNITY_UINT32 p2[] = {8, 8, 8, 2}; +- UNITY_UINT32 p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EACH_EQUAL_HEX(65132u, p0, 1); +- TEST_ASSERT_EACH_EQUAL_HEX(65132u, p0, 4); +- TEST_ASSERT_EACH_EQUAL_HEX(987, p1, 4); +- TEST_ASSERT_EACH_EQUAL_HEX(8, p2, 3); +- TEST_ASSERT_EACH_EQUAL_HEX(1, p3, 1); +-} +- +-void testNotEqualHEXEachEqual1(void) +-{ +- UNITY_UINT32 p0[] = {1, 65132u, 65132u, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX32(65132u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEXEachEqual2(void) +-{ +- UNITY_UINT32 p0[] = {987, 987, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX32(987, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEXEachEqual3(void) +-{ +- UNITY_UINT32 p0[] = {8, 8, 987, 8}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX(8, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualHEX32EachEqual(void) +-{ +- UNITY_UINT32 p0[] = {65132u, 65132u, 65132u, 65132u}; +- UNITY_UINT32 p1[] = {987, 987, 987, 987}; +- UNITY_UINT32 p2[] = {8, 8, 8, 2}; +- UNITY_UINT32 p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EACH_EQUAL_HEX32(65132u, p0, 1); +- TEST_ASSERT_EACH_EQUAL_HEX32(65132u, p0, 4); +- TEST_ASSERT_EACH_EQUAL_HEX32(987, p1, 4); +- TEST_ASSERT_EACH_EQUAL_HEX32(8, p2, 3); +- TEST_ASSERT_EACH_EQUAL_HEX32(1, p3, 1); +-} +- +-void testNotEqualHEX32EachEqual1(void) +-{ +- UNITY_UINT32 p0[] = {65132u, 8, 65132u, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX32(65132u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX32EachEqual2(void) +-{ +- UNITY_UINT32 p0[] = {1, 987, 987, 987}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX32(987, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX32EachEqual3(void) +-{ +- UNITY_UINT32 p0[] = {8, 8, 8, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX32(8, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualHEX16EachEqual(void) +-{ +- UNITY_UINT16 p0[] = {65132u, 65132u, 65132u, 65132u}; +- UNITY_UINT16 p1[] = {987, 987, 987, 987}; +- UNITY_UINT16 p2[] = {8, 8, 8, 2}; +- UNITY_UINT16 p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EACH_EQUAL_HEX16(65132u, p0, 1); +- TEST_ASSERT_EACH_EQUAL_HEX16(65132u, p0, 4); +- TEST_ASSERT_EACH_EQUAL_HEX16(987, p1, 4); +- TEST_ASSERT_EACH_EQUAL_HEX16(8, p2, 3); +- TEST_ASSERT_EACH_EQUAL_HEX16(1, p3, 1); +-} +- +-void testNotEqualHEX16EachEqual1(void) +-{ +- unsigned short p0[] = {65132u, 65132u, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX16(65132u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX16EachEqual2(void) +-{ +- unsigned short p0[] = {1, 987, 987, 987}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX16(987, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX16EachEqual3(void) +-{ +- unsigned short p0[] = {8, 8, 8, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX16(8, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualHEX8EachEqual(void) +-{ +- unsigned char p0[] = {254u, 254u, 254u, 254u}; +- unsigned char p1[] = {123, 123, 123, 123}; +- unsigned char p2[] = {8, 8, 8, 2}; +- unsigned char p3[] = {1, 23, 25, 26}; +- +- TEST_ASSERT_EACH_EQUAL_HEX8(254u, p0, 1); +- TEST_ASSERT_EACH_EQUAL_HEX8(254u, p0, 4); +- TEST_ASSERT_EACH_EQUAL_HEX8(123, p1, 4); +- TEST_ASSERT_EACH_EQUAL_HEX8(8, p2, 3); +- TEST_ASSERT_EACH_EQUAL_HEX8(1, p3, 1); +-} +- +-void testNotEqualHEX8EachEqual1(void) +-{ +- unsigned char p0[] = {253u, 253u, 254u, 253u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX8(253u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX8EachEqual2(void) +-{ +- unsigned char p0[] = {254u, 254u, 254u, 253u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX8(254u, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX8EachEqual3(void) +-{ +- unsigned char p0[] = {1, 8, 8, 8}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_HEX8(8, p0, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualHEX64Arrays(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT64 p1[] = {1, 8, 987, 65132u}; +- UNITY_UINT64 p2[] = {1, 8, 987, 2}; +- UNITY_UINT64 p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p3, 1); +-#endif +-} +- +-void testEqualUint64Arrays(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT64 p1[] = {1, 8, 987, 65132u}; +- UNITY_UINT64 p2[] = {1, 8, 987, 2}; +- UNITY_UINT64 p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p3, 1); +-#endif +-} +- +-void testEqualInt64Arrays(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 p0[] = {1, 8, 987, -65132}; +- UNITY_INT64 p1[] = {1, 8, 987, -65132}; +- UNITY_INT64 p2[] = {1, 8, 987, -2}; +- UNITY_INT64 p3[] = {1, 500, 600, 700}; +- +- TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p3, 1); +-#endif +-} +- +- +-void testNotEqualHEX64Arrays1(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT64 p1[] = {1, 8, 987, 65131u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualHEX64Arrays2(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT64 p1[] = {2, 8, 987, 65132u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX64_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualUint64Arrays(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 p0[] = {1, 8, 987, 65132u}; +- UNITY_UINT64 p1[] = {1, 8, 987, 65131u}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT64_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualInt64Arrays(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 p0[] = {1, 8, 987, -65132}; +- UNITY_INT64 p1[] = {1, 8, 987, -65131}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT64_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_core.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_core.c +deleted file mode 100644 +index d324e86194..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_core.c ++++ /dev/null +@@ -1,371 +0,0 @@ +-/* ========================================== +- 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] +-========================================== */ +- +-#include "unity.h" +-#define TEST_INSTANCES +-#include "self_assessment_utils.h" +- +-static int SetToOneToFailInTearDown; +-static int SetToOneMeanWeAlreadyCheckedThisGuy; +- +-void setUp(void) +-{ +- SetToOneToFailInTearDown = 0; +- SetToOneMeanWeAlreadyCheckedThisGuy = 0; +-} +- +-void tearDown(void) +-{ +- endPutcharSpy(); /* Stop suppressing test output */ +- if (SetToOneToFailInTearDown == 1) +- { +- /* These will be skipped internally if already failed/ignored */ +- TEST_FAIL_MESSAGE("<= Failed in tearDown"); +- TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); +- } +- if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) +- { +- UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); +- UNITY_OUTPUT_CHAR('\n'); +- } +-} +- +-void testUnitySizeInitializationReminder(void) +-{ +- /* This test ensures that sizeof(struct UNITY_STORAGE_T) doesn't change. If this +- * test breaks, go look at the initialization of the Unity global variable +- * in unity.c and make sure we're filling in the proper fields. */ +- const char* message = "Unexpected size for UNITY_STORAGE_T struct. Please check that " +- "the initialization of the Unity symbol in unity.c is " +- "still correct."; +- +- /* Define a structure with all the same fields as `struct UNITY_STORAGE_T`. */ +-#ifdef UNITY_EXCLUDE_DETAILS +- struct { +- const char* TestFile; +- const char* CurrentTestName; +- UNITY_LINE_TYPE CurrentTestLineNumber; +- UNITY_COUNTER_TYPE NumberOfTests; +- UNITY_COUNTER_TYPE TestFailures; +- UNITY_COUNTER_TYPE TestIgnores; +- UNITY_COUNTER_TYPE CurrentTestFailed; +- UNITY_COUNTER_TYPE CurrentTestIgnored; +-#ifdef UNITY_INCLUDE_EXEC_TIME +- UNITY_TIME_TYPE CurrentTestStartTime; +- UNITY_TIME_TYPE CurrentTestStopTime; +-#endif +-#ifndef UNITY_EXCLUDE_SETJMP_H +- jmp_buf AbortFrame; +-#endif +- } _Expected_Unity; +-#else +- struct { +- const char* TestFile; +- const char* CurrentTestName; +- const char* CurrentDetails1; +- const char* CurrentDetails2; +- UNITY_LINE_TYPE CurrentTestLineNumber; +- UNITY_COUNTER_TYPE NumberOfTests; +- UNITY_COUNTER_TYPE TestFailures; +- UNITY_COUNTER_TYPE TestIgnores; +- UNITY_COUNTER_TYPE CurrentTestFailed; +- UNITY_COUNTER_TYPE CurrentTestIgnored; +-#ifdef UNITY_INCLUDE_EXEC_TIME +- UNITY_COUNTER_TYPE CurrentTestStartTime; +- UNITY_COUNTER_TYPE CurrentTestStopTime; +-#endif +-#ifndef UNITY_EXCLUDE_SETJMP_H +- jmp_buf AbortFrame; +-#endif +- } _Expected_Unity; +-#endif +- +- /* Compare our fake structure's size to the actual structure's size. They +- * should be the same. +- * +- * This accounts for alignment, padding, and packing issues that might come +- * up between different architectures. */ +- TEST_ASSERT_EQUAL_MESSAGE(sizeof(_Expected_Unity), sizeof(Unity), message); +-} +- +-void testPassShouldEndImmediatelyWithPass(void) +-{ +- TEST_PASS(); +- TEST_FAIL_MESSAGE("We should have passed already and finished this test"); +-} +- +-void testPassShouldEndImmediatelyWithPassAndMessage(void) +-{ +- TEST_PASS_MESSAGE("Woohoo! This Automatically Passes!"); +- TEST_FAIL_MESSAGE("We should have passed already and finished this test"); +-} +- +-void testMessageShouldDisplayMessageWithoutEndingAndGoOnToPass(void) +-{ +- TEST_MESSAGE("This is just a message"); +- TEST_MESSAGE("This is another message"); +- TEST_PASS(); +-} +- +-void testMessageShouldDisplayMessageWithoutEndingAndGoOnToFail(void) +-{ +- TEST_MESSAGE("This is yet another message"); +- +- EXPECT_ABORT_BEGIN +- TEST_FAIL(); +- VERIFY_FAILS_END +-} +- +-void testTrue(void) +-{ +- TEST_ASSERT(1); +- +- TEST_ASSERT_TRUE(1); +-} +- +-void testFalse(void) +-{ +- TEST_ASSERT_FALSE(0); +- +- TEST_ASSERT_UNLESS(0); +-} +- +-void testSingleStatement(void) +-{ +- for(int i = 0; i < 2; i++) +- { +- /* TEST_ASSERT_TRUE should expand to a single C statement, minus +- * the semicolon. This if-else will fail to compile otherwise. */ +- if(i > 0) +- TEST_ASSERT_TRUE(i); +- else +- TEST_ASSERT_FALSE(i); +- } +-} +- +-void testPreviousPass(void) +-{ +- TEST_ASSERT_EQUAL_INT(0U, Unity.TestFailures); +-} +- +-void testNotVanilla(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT(0); +- VERIFY_FAILS_END +-} +- +-void testNotTrue(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_TRUE(0); +- VERIFY_FAILS_END +-} +- +-void testNotFalse(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FALSE(1); +- VERIFY_FAILS_END +-} +- +-void testNotUnless(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UNLESS(1); +- VERIFY_FAILS_END +-} +- +-void testNotNotEqual(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL(10, 10); +- VERIFY_FAILS_END +-} +- +-void testFail(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_FAIL_MESSAGE("Expected for testing"); +- VERIFY_FAILS_END +-} +- +-void testIsNull(void) +-{ +- char* ptr1 = NULL; +- const char* ptr2 = "hello"; +- +- TEST_ASSERT_NULL(ptr1); +- TEST_ASSERT_NOT_NULL(ptr2); +-} +- +-void testIsNullShouldFailIfNot(void) +-{ +- const char* ptr1 = "hello"; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NULL(ptr1); +- VERIFY_FAILS_END +-} +- +-void testNotNullShouldFailIfNULL(void) +-{ +- char* ptr1 = NULL; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_NULL(ptr1); +- VERIFY_FAILS_END +-} +- +-void testIsEmpty(void) +-{ +- const char* ptr1 = "\0"; +- const char* ptr2 = "hello"; +- +- TEST_ASSERT_EMPTY(ptr1); +- TEST_ASSERT_NOT_EMPTY(ptr2); +-} +- +-void testIsEmptyShouldFailIfNot(void) +-{ +- const char* ptr1 = "hello"; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EMPTY(ptr1); +- VERIFY_FAILS_END +-} +- +-void testNotEmptyShouldFailIfEmpty(void) +-{ +- const char* ptr1 = "\0"; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EMPTY(ptr1); +- VERIFY_FAILS_END +-} +- +-void testIgnore(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_IGNORE(); +- TEST_FAIL_MESSAGE("This should not be reached"); +- VERIFY_IGNORES_END +-} +- +-void testIgnoreMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_IGNORE_MESSAGE("This is an expected TEST_IGNORE_MESSAGE string!"); +- TEST_FAIL_MESSAGE("This should not be reached"); +- VERIFY_IGNORES_END +-} +- +-void testProtection(void) +-{ +- volatile int mask = 0; +- +- if (TEST_PROTECT()) +- { +- mask |= 1; +- TEST_ABORT(); +- } +- else +- { +- Unity.CurrentTestFailed = 0; +- mask |= 2; +- } +- +- TEST_ASSERT_EQUAL(3, mask); +-} +- +-void testIgnoredAndThenFailInTearDown(void) +-{ +- SetToOneToFailInTearDown = 1; +- TEST_IGNORE(); +-} +- +-void testFailureCountIncrementsAndIsReturnedAtEnd(void) +-{ +-#ifndef USING_OUTPUT_SPY +- TEST_IGNORE(); +-#else +- UNITY_UINT savedFailures = Unity.TestFailures; +- Unity.CurrentTestFailed = 1; +- startPutcharSpy(); /* Suppress output */ +- startFlushSpy(); +- TEST_ASSERT_EQUAL(0, getFlushSpyCalls()); +- UnityConcludeTest(); +- endPutcharSpy(); +- TEST_ASSERT_EQUAL(savedFailures + 1, Unity.TestFailures); +-#if defined(UNITY_OUTPUT_FLUSH) && defined(UNITY_OUTPUT_FLUSH_HEADER_DECLARATION) +- TEST_ASSERT_EQUAL(1, getFlushSpyCalls()); +-#else +- TEST_ASSERT_EQUAL(0, getFlushSpyCalls()); +-#endif +- endFlushSpy(); +- +- startPutcharSpy(); /* Suppress output */ +- int failures = UnityEnd(); +- Unity.TestFailures--; +- endPutcharSpy(); +- TEST_ASSERT_EQUAL(savedFailures + 1, failures); +-#endif +-} +- +-/* ===================== THESE TEST WILL RUN IF YOUR CONFIG INCLUDES DETAIL SUPPORT ================== */ +- +-void testThatDetailsCanBeHandleOneDetail(void) +-{ +-#ifdef UNITY_EXCLUDE_DETAILS +- TEST_IGNORE(); +-#else +- UNITY_SET_DETAIL("Detail1"); +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT_MESSAGE(5, 6, "Should Fail And Say Detail1"); +- VERIFY_FAILS_END +-#endif +-} +- +-void testThatDetailsCanHandleTestFail(void) +-{ +-#ifdef UNITY_EXCLUDE_DETAILS +- TEST_IGNORE(); +-#else +- UNITY_SET_DETAILS("Detail1","Detail2"); +- +- EXPECT_ABORT_BEGIN +- TEST_FAIL_MESSAGE("Should Fail And Say Detail1 and Detail2"); +- VERIFY_FAILS_END +-#endif +-} +- +-void testThatDetailsCanBeHandleTwoDetails(void) +-{ +-#ifdef UNITY_EXCLUDE_DETAILS +- TEST_IGNORE(); +-#else +- UNITY_SET_DETAILS("Detail1","Detail2"); +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX8_MESSAGE(7, 8, "Should Fail And Say Detail1 and Detail2"); +- VERIFY_FAILS_END +-#endif +-} +- +-void testThatDetailsCanBeHandleSingleDetailClearingTwoDetails(void) +-{ +-#ifdef UNITY_EXCLUDE_DETAILS +- TEST_IGNORE(); +-#else +- UNITY_SET_DETAILS("Detail1","Detail2"); +- UNITY_SET_DETAIL("DetailNew"); +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_MESSAGE("MEH", "GUH", "Should Fail And Say DetailNew"); +- VERIFY_FAILS_END +-#endif +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_doubles.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_doubles.c +deleted file mode 100644 +index 1bdedbc335..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_doubles.c ++++ /dev/null +@@ -1,773 +0,0 @@ +-/* ========================================== +- 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] +-========================================== */ +- +-#include "unity.h" +-#define TEST_INSTANCES +-#include "self_assessment_utils.h" +- +-static int SetToOneToFailInTearDown; +-static int SetToOneMeanWeAlreadyCheckedThisGuy; +- +-void setUp(void) +-{ +- SetToOneToFailInTearDown = 0; +- SetToOneMeanWeAlreadyCheckedThisGuy = 0; +-} +- +-void tearDown(void) +-{ +- endPutcharSpy(); /* Stop suppressing test output */ +- if (SetToOneToFailInTearDown == 1) +- { +- /* These will be skipped internally if already failed/ignored */ +- TEST_FAIL_MESSAGE("<= Failed in tearDown"); +- TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); +- } +- if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) +- { +- UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); +- UNITY_OUTPUT_CHAR('\n'); +- } +-} +- +-void testDoublesWithinDelta(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_DOUBLE_WITHIN(0.00003, 187245.03485, 187245.03488); +- TEST_ASSERT_DOUBLE_WITHIN(1.0, 187245.0, 187246.0); +- TEST_ASSERT_DOUBLE_WITHIN(0.05, 9273.2549, 9273.2049); +- TEST_ASSERT_DOUBLE_WITHIN(0.007, -726.93725, -726.94424); +-#endif +-} +- +-void testDoublesNotWithinDelta(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_WITHIN(0.05, 9273.2649, 9273.2049); +- VERIFY_FAILS_END +-#endif +-} +- +- +-void testDoublesEqual(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_DOUBLE(187245123456.0, 187245123456.0); +- TEST_ASSERT_EQUAL_DOUBLE(187241234567.5, 187241234567.6); +- TEST_ASSERT_EQUAL_DOUBLE(9273.2512345649, 9273.25123455699); +- TEST_ASSERT_EQUAL_DOUBLE(-726.12345693724, -726.1234569374); +-#endif +-} +- +-void testDoublesNotEqual(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE(9273.9649, 9273.0049); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoublesNotEqualNegative1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE(-9273.9649, -9273.0049); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoublesNotEqualNegative2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE(-9273.0049, -9273.9649); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoublesNotEqualActualNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE(85.963, 0.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoublesNotEqualExpectedNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE(0.0 / d_zero, 85.963); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoublesEqualBothNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_DOUBLE(0.0 / d_zero, 0.0 / d_zero); +-#endif +-} +- +-void testDoublesNotEqualInfNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE(1.0 / d_zero, 0.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoublesNotEqualNaNInf(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE(0.0 / d_zero, 1.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoublesNotEqualActualInf(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE(321.642, 1.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoublesNotEqualExpectedInf(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE(1.0 / d_zero, 321.642); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoublesEqualBothInf(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_DOUBLE(1.0 / d_zero, 1.0 / d_zero); +-#endif +-} +- +-void testDoublesNotEqualPlusMinusInf(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE(1.0 / d_zero, -1.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleIsPosInf1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_DOUBLE_IS_INF(2.0 / d_zero); +-#endif +-} +- +-void testDoubleIsPosInf2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_IS_NOT_INF(2.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleIsNegInf1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_DOUBLE_IS_NEG_INF(-3.0 / d_zero); +-#endif +-} +- +-void testDoubleIsNegInf2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(-3.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleIsNotPosInf1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_IS_INF(2.0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleIsNotPosInf2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_DOUBLE_IS_NOT_INF(2.0); +-#endif +-} +- +-void testDoubleIsNotNegInf(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_IS_NEG_INF(-999.876); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleIsNan1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_DOUBLE_IS_NAN(0.0 / d_zero); +-#endif +-} +- +-void testDoubleIsNan2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_IS_NOT_NAN(0.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleIsNotNan1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_IS_NAN(234.9); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleIsNotNan2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_DOUBLE_IS_NOT_NAN(234.9); +-#endif +-} +- +-void testDoubleInfIsNotNan(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_IS_NAN(1.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleNanIsNotInf(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_IS_INF(0.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleIsDeterminate1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_DOUBLE_IS_DETERMINATE(0.0); +- TEST_ASSERT_DOUBLE_IS_DETERMINATE(123.3); +- TEST_ASSERT_DOUBLE_IS_DETERMINATE(-88.3); +-#endif +-} +- +-void testDoubleIsDeterminate2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(-88.3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleIsNotDeterminate1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(1.0 / d_zero); +- TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(-1.0 / d_zero); +- TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(0.0 / d_zero); +-#endif +-} +- +-void testDoubleIsNotDeterminate2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_DOUBLE_IS_DETERMINATE(-1.0 / d_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoubleTraitFailsOnInvalidTrait(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- UnityAssertDoubleSpecial(1.0, NULL, __LINE__, UNITY_FLOAT_INVALID_TRAIT); +- VERIFY_FAILS_END +-#endif +-} +- +-void testEqualDoubleArrays(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {1.0, -8.0, 25.4, -0.123}; +- double p1[] = {1.0, -8.0, 25.4, -0.123}; +- double p2[] = {1.0, -8.0, 25.4, -0.2}; +- double p3[] = {1.0, -23.0, 25.0, -0.26}; +- +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p3, 1); +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(NULL, NULL, 1); +-#endif +-} +- +-void testNotEqualDoubleArraysExpectedNull(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double* p0 = NULL; +- double p1[] = {1.0, 8.0, 25.4, 0.252}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleArraysActualNull(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {1.0, 8.0, 25.4, 0.253}; +- double* p1 = NULL; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleArrays1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {1.0, 8.0, 25.4, 0.25666666667}; +- double p1[] = {1.0, 8.0, 25.4, 0.25666666666}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleArrays2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {1.0, 8.0, 25.4, 0.253}; +- double p1[] = {2.0, 8.0, 25.4, 0.253}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleArrays3(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {1.0, 8.0, 25.4, 0.253}; +- double p1[] = {1.0, 8.0, 25.5, 0.253}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleArraysNegative1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {-1.0, -8.0, -25.4, -0.2566666667}; +- double p1[] = {-1.0, -8.0, -25.4, -0.2566666666}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleArraysNegative2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {-1.0, -8.0, -25.4, -0.253}; +- double p1[] = {-2.0, -8.0, -25.4, -0.253}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleArraysNegative3(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {-1.0, -8.0, -25.4, -0.253}; +- double p1[] = {-1.0, -8.0, -25.5, -0.253}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testEqualDoubleArraysNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {1.0, 0.0 / d_zero, 25.4, 0.253}; +- double p1[] = {1.0, 0.0 / d_zero, 25.4, 0.253}; +- +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +-#endif +-} +- +-void testEqualDoubleArraysInf(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {1.0, 1.0 / d_zero, 25.4, 0.253}; +- double p1[] = {1.0, 1.0 / d_zero, 25.4, 0.253}; +- +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4); +-#endif +-} +- +-void testNotEqualDoubleArraysLengthZero(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[1] = {0.0}; +- double p1[1] = {0.0}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testEqualDoubleEachEqual(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {1.0, 1.0, 1.0, 1.0}; +- double p1[] = {-0.123, -0.123, -0.123, -0.123}; +- double p2[] = {25.4, 25.4, 25.4, -0.2}; +- double p3[] = {1.0, -23.0, 25.0, -0.26}; +- +- TEST_ASSERT_EACH_EQUAL_DOUBLE(1.0, p0, 1); +- TEST_ASSERT_EACH_EQUAL_DOUBLE(1.0, p0, 4); +- TEST_ASSERT_EACH_EQUAL_DOUBLE(-0.123, p1, 4); +- TEST_ASSERT_EACH_EQUAL_DOUBLE(25.4, p2, 3); +- TEST_ASSERT_EACH_EQUAL_DOUBLE(1.0, p3, 1); +-#endif +-} +- +-void testNotEqualDoubleEachEqualActualNull(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double* p0 = NULL; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_DOUBLE(5, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleEachEqual1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {0.253, 8.0, 0.253, 0.253}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_DOUBLE(0.253, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleEachEqual2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {8.0, 8.0, 8.0, 0.253}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_DOUBLE(8.0, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleEachEqual3(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {1.0, 1.0, 1.0, 0.253}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_DOUBLE(1.0, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleEachEqualNegative1(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {-1.0, -0.253, -0.253, -0.253}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_DOUBLE(-0.253, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleEachEqualNegative2(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {-25.4, -8.0, -25.4, -25.4}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_DOUBLE(-25.4, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualDoubleEachEqualNegative3(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {-8.0, -8.0, -8.0, -0.253}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_DOUBLE(-8.0, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testEqualDoubleEachEqualNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {0.0 / d_zero, 0.0 / d_zero, 0.0 / d_zero, 0.0 / d_zero}; +- +- TEST_ASSERT_EACH_EQUAL_DOUBLE(0.0 / d_zero, p0, 4); +-#endif +-} +- +-void testEqualDoubleEachEqualInf(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[] = {1.0 / d_zero, 1.0 / d_zero, 25.4, 0.253}; +- +- TEST_ASSERT_EACH_EQUAL_DOUBLE(1.0 / d_zero, p0, 2); +-#endif +-} +- +-void testNotEqualDoubleEachEqualLengthZero(void) +-{ +-#ifdef UNITY_EXCLUDE_DOUBLE +- TEST_IGNORE(); +-#else +- double p0[1] = {0.0}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_DOUBLE(0.0, p0, 0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testDoublePrinting(void) +-{ +-#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_EXCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_PRINT_FLOATING("0", 0.0); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("4.99e-07", 0.000000499); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("5.0000005e-07", 0.00000050000005); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("0.100469499", 0.100469499); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1", 0.9999999995); /*Rounding to int place*/ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1", 1.0); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1.25", 1.25); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("7.99999999", 7.99999999); /*Not rounding*/ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("16.0000002", 16.0000002); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("16.0000004", 16.0000004); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("16.0000006", 16.0000006); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("999999999", 999999999.0); /*Last full print integer*/ +- +- TEST_ASSERT_EQUAL_PRINT_FLOATING("0", -0.0); /* -0 no supported on all targets */ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-4.99e-07", -0.000000499); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-5.0000005e-07", -0.00000050000005); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-0.100469499", -0.100469499); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-1", -0.9999999995); /*Rounding to int place*/ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-1", -1.0); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-1.25", -1.25); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-7.99999999", -7.99999999); /*Not rounding*/ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.0000002", -16.0000002); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.0000004", -16.0000004); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.0000006", -16.0000006); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-999999999", -999999999.0); /*Last full print integer*/ +- +- TEST_ASSERT_EQUAL_PRINT_FLOATING("0.1004695", 0.10046949999999999); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("4.2949673e+09", 4294967295.9); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("4.2949673e+09", 4294967296.0); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1e+10", 9999999995.0); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("9.00719925e+15", 9007199254740990.0); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("7e+100", 7.0e+100); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("3e+200", 3.0e+200); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("9.23456789e+300", 9.23456789e+300); +- +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-0.1004695", -0.10046949999999999); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-4.2949673e+09", -4294967295.9); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-4.2949673e+09", -4294967296.0); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-7e+100", -7.0e+100); +-#endif +-} +- +-void testDoublePrintingRoundTiesToEven(void) +-{ +-#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_EXCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) +- TEST_IGNORE(); +-#else +- #ifdef UNITY_ROUND_TIES_AWAY_FROM_ZERO +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1.00000001e+10", 10000000050.0); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("9.00719925e+15", 9007199245000000.0); +- #else /* Default to Round ties to even */ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1e+10", 10000000050.0); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("9.00719924e+15", 9007199245000000.0); +- #endif +-#endif +-} +- +-void testDoublePrintingInfinityAndNaN(void) +-{ +-#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_EXCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_PRINT_FLOATING("inf", 1.0 / d_zero); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-inf", -1.0 / d_zero); +- +- TEST_ASSERT_EQUAL_PRINT_FLOATING("nan", 0.0 / d_zero); +-#endif +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_floats.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_floats.c +deleted file mode 100644 +index e89bec20e4..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_floats.c ++++ /dev/null +@@ -1,884 +0,0 @@ +-/* ========================================== +- 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] +-========================================== */ +- +-#include "unity.h" +-#define TEST_INSTANCES +-#include "self_assessment_utils.h" +- +-static int SetToOneToFailInTearDown; +-static int SetToOneMeanWeAlreadyCheckedThisGuy; +- +-void setUp(void) +-{ +- SetToOneToFailInTearDown = 0; +- SetToOneMeanWeAlreadyCheckedThisGuy = 0; +-} +- +-void tearDown(void) +-{ +- endPutcharSpy(); /* Stop suppressing test output */ +- if (SetToOneToFailInTearDown == 1) +- { +- /* These will be skipped internally if already failed/ignored */ +- TEST_FAIL_MESSAGE("<= Failed in tearDown"); +- TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); +- } +- if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) +- { +- UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); +- UNITY_OUTPUT_CHAR('\n'); +- } +-} +- +-void testFloatsWithinDelta(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_FLOAT_WITHIN(0.00003f, 187245.03485f, 187245.03488f); +- TEST_ASSERT_FLOAT_WITHIN(1.0f, 187245.0f, 187246.0f); +- TEST_ASSERT_FLOAT_WITHIN(0.05f, 9273.2549f, 9273.2049f); +- TEST_ASSERT_FLOAT_WITHIN(0.007f, -726.93724f, -726.94424f); +-#endif +-} +- +-void testFloatsNotWithinDelta(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_WITHIN(0.05f, 9273.2649f, 9273.2049f); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatsEqual(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_FLOAT(187245.0f, 187246.0f); +- TEST_ASSERT_EQUAL_FLOAT(18724.5f, 18724.6f); +- TEST_ASSERT_EQUAL_FLOAT(9273.2549f, 9273.2599f); +- TEST_ASSERT_EQUAL_FLOAT(-726.93724f, -726.9374f); +-#endif +-} +- +-void testFloatsNotEqual(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT(9273.9649f, 9273.0049f); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatsNotEqualNegative1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT(-9273.9649f, -9273.0049f); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatsNotEqualNegative2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT(-9273.0049f, -9273.9649f); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatsNotEqualActualNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT(85.963f, 0.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatsNotEqualExpectedNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT(0.0f / f_zero, 85.963f); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatsEqualBothNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_FLOAT(0.0f / f_zero, 0.0f / f_zero); +-#endif +-} +- +-void testFloatsNotEqualInfNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT(1.0f / f_zero, 0.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatsNotEqualNaNInf(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT(0.0f / f_zero, 1.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatsNotEqualActualInf(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT(321.642f, 1.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatsNotEqualExpectedInf(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT(1.0f / f_zero, 321.642f); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatsEqualBothInf(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_FLOAT(1.0f / f_zero, 1.0f / f_zero); +-#endif +-} +- +-void testFloatsNotEqualPlusMinusInf(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT(1.0f / f_zero, -1.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatIsPosInf1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_FLOAT_IS_INF(2.0f / f_zero); +-#endif +-} +- +-void testFloatIsPosInf2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_IS_NOT_INF(2.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatIsNegInf1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_FLOAT_IS_NEG_INF(-3.0f / f_zero); +-#endif +-} +- +-void testFloatIsNegInf2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(-3.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatIsNotPosInf1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_IS_INF(2.0f); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatIsNotPosInf2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_FLOAT_IS_NOT_INF(2.0f); +-#endif +-} +- +-void testFloatIsNotNegInf(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_IS_NEG_INF(-999.876f); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatIsNan1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_FLOAT_IS_NAN(0.0f / f_zero); +-#endif +-} +- +-void testFloatIsNan2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_IS_NOT_NAN(0.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatIsNotNan1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_IS_NAN(234.9f); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatIsNotNan2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_FLOAT_IS_NOT_NAN(234.9f); +-#endif +-} +- +-void testFloatInfIsNotNan(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_IS_NAN(1.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatNanIsNotInf(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_IS_INF(0.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatIsDeterminate1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_FLOAT_IS_DETERMINATE(0.0f); +- TEST_ASSERT_FLOAT_IS_DETERMINATE(123.3f); +- TEST_ASSERT_FLOAT_IS_DETERMINATE(-88.3f); +-#endif +-} +- +-void testFloatIsDeterminate2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(-88.3f); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatIsNotDeterminate1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(1.0f / f_zero); +- TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(-1.0f / f_zero); +- TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(0.0f / f_zero); +-#endif +-} +- +-void testFloatIsNotDeterminate2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_FLOAT_IS_DETERMINATE(-1.0f / f_zero); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatTraitFailsOnInvalidTrait(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- UnityAssertFloatSpecial(1.0f, NULL, __LINE__, UNITY_FLOAT_INVALID_TRAIT); +- VERIFY_FAILS_END +-#endif +-} +- +-void testEqualFloatArrays(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {1.0f, -8.0f, 25.4f, -0.123f}; +- float p1[] = {1.0f, -8.0f, 25.4f, -0.123f}; +- float p2[] = {1.0f, -8.0f, 25.4f, -0.2f}; +- float p3[] = {1.0f, -23.0f, 25.0f, -0.26f}; +- +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p0, 1); +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p0, 4); +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p2, 3); +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p3, 1); +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(NULL, NULL, 1); +-#endif +-} +- +-void testNotEqualFloatArraysExpectedNull(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float* p0 = NULL; +- float p1[] = {1.0f, 8.0f, 25.4f, 0.252f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatArraysActualNull(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {1.0f, 8.0f, 25.4f, 0.253f}; +- float* p1 = NULL; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatArrays1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {1.0f, 8.0f, 25.4f, 0.253f}; +- float p1[] = {1.0f, 8.0f, 25.4f, 0.252f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatArrays2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {1.0f, 8.0f, 25.4f, 0.253f}; +- float p1[] = {2.0f, 8.0f, 25.4f, 0.253f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatArrays3(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {1.0f, 8.0f, 25.4f, 0.253f}; +- float p1[] = {1.0f, 8.0f, 25.5f, 0.253f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatArraysNegative1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {-1.0f, -8.0f, -25.4f, -0.253f}; +- float p1[] = {-1.0f, -8.0f, -25.4f, -0.252f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatArraysNegative2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {-1.0f, -8.0f, -25.4f, -0.253f}; +- float p1[] = {-2.0f, -8.0f, -25.4f, -0.253f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatArraysNegative3(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {-1.0f, -8.0f, -25.4f, -0.253f}; +- float p1[] = {-1.0f, -8.0f, -25.5f, -0.253f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testEqualFloatArraysNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {1.0f, 0.0f / f_zero, 25.4f, 0.253f}; +- float p1[] = {1.0f, 0.0f / f_zero, 25.4f, 0.253f}; +- +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +-#endif +-} +- +-void testEqualFloatArraysInf(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {1.0f, 1.0f / f_zero, 25.4f, 0.253f}; +- float p1[] = {1.0f, 1.0f / f_zero, 25.4f, 0.253f}; +- +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4); +-#endif +-} +- +-void testNotEqualFloatArraysLengthZero(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[1] = {0.0f}; +- float p1[1] = {0.0f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testEqualFloatEachEqual(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {1.0f, 1.0f, 1.0f, 1.0f}; +- float p1[] = {-0.123f, -0.123f, -0.123f, -0.123f}; +- float p2[] = {25.4f, 25.4f, 25.4f, -0.2f}; +- float p3[] = {1.0f, -23.0f, 25.0f, -0.26f}; +- +- TEST_ASSERT_EACH_EQUAL_FLOAT(1.0f, p0, 1); +- TEST_ASSERT_EACH_EQUAL_FLOAT(1.0f, p0, 4); +- TEST_ASSERT_EACH_EQUAL_FLOAT(-0.123f, p1, 4); +- TEST_ASSERT_EACH_EQUAL_FLOAT(25.4f, p2, 3); +- TEST_ASSERT_EACH_EQUAL_FLOAT(1.0f, p3, 1); +-#endif +-} +- +-void testNotEqualFloatEachEqualActualNull(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float* p0 = NULL; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_FLOAT(5, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatEachEqual1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {0.253f, 8.0f, 0.253f, 0.253f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_FLOAT(0.253f, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatEachEqual2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {8.0f, 8.0f, 8.0f, 0.253f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_FLOAT(8.0f, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatEachEqual3(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {1.0f, 1.0f, 1.0f, 0.253f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_FLOAT(1.0f, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatEachEqualNegative1(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {-1.0f, -0.253f, -0.253f, -0.253f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_FLOAT(-0.253f, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatEachEqualNegative2(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {-25.4f, -8.0f, -25.4f, -25.4f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_FLOAT(-25.4f, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualFloatEachEqualNegative3(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {-8.0f, -8.0f, -8.0f, -0.253f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_FLOAT(-8.0f, p0, 4); +- VERIFY_FAILS_END +-#endif +-} +- +-void testEqualFloatEachEqualNaN(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {0.0f / f_zero, 0.0f / f_zero, 0.0f / f_zero, 0.0f / f_zero}; +- +- TEST_ASSERT_EACH_EQUAL_FLOAT(0.0f / f_zero, p0, 4); +-#endif +-} +- +-void testEqualFloatEachEqualInf(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[] = {1.0f / f_zero, 1.0f / f_zero, 25.4f, 0.253f}; +- +- TEST_ASSERT_EACH_EQUAL_FLOAT(1.0f / f_zero, p0, 2); +-#endif +-} +- +-void testNotEqualFloatEachEqualLengthZero(void) +-{ +-#ifdef UNITY_EXCLUDE_FLOAT +- TEST_IGNORE(); +-#else +- float p0[1] = {0.0f}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_FLOAT(0.0f, p0, 0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testFloatPrinting(void) +-{ +-#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_PRINT_FLOATING("0", 0.0f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("4.99e-07", 0.000000499f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("0.1004695", 0.100469499f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("2", 1.9999995f); /*Rounding to int place*/ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1", 1.0f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1.25", 1.25f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("7.999999", 7.999999f); /*Not rounding*/ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("16.00002", 16.00002f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("16.00004", 16.00004f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("16.00006", 16.00006f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("9999999", 9999999.0f); /*Last full print integer*/ +- +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-0", -0.0f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-4.99e-07", -0.000000499f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-0.1004695", -0.100469499f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-2", -1.9999995f); /*Rounding to int place*/ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-1", -1.0f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-1.25", -1.25f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-7.999999", -7.999999f); /*Not rounding*/ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.00002", -16.00002f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.00004", -16.00004f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-16.00006", -16.00006f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-9999999", -9999999.0f); /*Last full print integer*/ +- +- /* Fails, prints "4.294968e+09" due to FP math imprecision +- * TEST_ASSERT_EQUAL_PRINT_FLOATING("4.294967e+09", 4294967296.0f); */ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("5e+09", 5000000000.0f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("8e+09", 8.0e+09f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("8.309999e+09", 8309999104.0f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1e+10", 1.0e+10f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1e+10", 10000000000.0f); +- /* Some compilers have trouble with inexact float constants, a float cast works generally */ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1.000055e+10", (float)1.000055e+10f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1.1e+38", (float)1.10000005e+38f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("1.635299e+10", 1.63529943e+10f); +- /* Fails, prints "3.402824e+38" due to FP math imprecision +- * TEST_ASSERT_EQUAL_PRINT_FLOATING("3.402823e+38", 3.40282346638e38f); */ +- +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-1e+10", -1.0e+10f); +- /* Fails, prints "-3.402824e+38" due to FP math imprecision +- * TEST_ASSERT_EQUAL_PRINT_FLOATING("-3.402823e+38", -3.40282346638e38f); */ +-#endif +-} +- +-void testFloatPrintingRoundTiesToEven(void) +-{ +-#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY) +- TEST_IGNORE(); +-#else +- #ifdef UNITY_ROUND_TIES_AWAY_FROM_ZERO +- TEST_ASSERT_EQUAL_PRINT_FLOATING("0.0004882813", 0.00048828125f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("488281.3", 488281.25f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("5.000001e-07", 0.00000050000005f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-5.000001e-07", -0.00000050000005f); +- #else /* Default to Round ties to even */ +- TEST_ASSERT_EQUAL_PRINT_FLOATING("0.0004882812", 0.00048828125f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("488281.2", 488281.25f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("5e-07", 0.00000050000005f); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-5e-07", -0.00000050000005f); +- #endif +-#endif +-} +- +-void testFloatPrintingInfinityAndNaN(void) +-{ +-#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || !defined(USING_OUTPUT_SPY) +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_PRINT_FLOATING("inf", 1.0f / f_zero); +- TEST_ASSERT_EQUAL_PRINT_FLOATING("-inf", -1.0f / f_zero); +- +- TEST_ASSERT_EQUAL_PRINT_FLOATING("nan", 0.0f / f_zero); +-#endif +-} +- +-#if defined(UNITY_TEST_ALL_FLOATS_PRINT_OK) && defined(USING_OUTPUT_SPY) +-#ifdef UNITY_INCLUDE_DOUBLE +-static void printFloatValue(float f) +-{ +- char expected[18]; +- +- startPutcharSpy(); +- UnityPrintFloat(f); +- +- sprintf(expected, "%.9g", f); +- /* We print all NaN's as "nan", not "-nan" */ +- if (strcmp(expected, "-nan") == 0) strcpy(expected, "nan"); +- +- if (strcmp(expected, getBufferPutcharSpy())) +- { +- /* Fail with diagnostic printing */ +- TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, f); +- } +-} +-#else +-static void printFloatValue(float f) +-{ +- char expected[18]; +- char expected_lower[18]; +- char expected_lower2[18]; +- char expected_lower3[18]; +- char expected_higher[18]; +- char expected_higher2[18]; +- char expected_higher3[18]; +- +- startPutcharSpy(); +- UnityPrintFloat(f); +- +- sprintf(expected, "%.7g", f); +- /* We print all NaN's as "nan", not "-nan" */ +- if (strcmp(expected, "-nan") == 0) strcpy(expected, "nan"); +- +- strcpy(expected_lower, expected); +- strcpy(expected_lower2, expected); +- strcpy(expected_lower3, expected); +- strcpy(expected_higher, expected); +- strcpy(expected_higher2, expected); +- strcpy(expected_higher3, expected); +- +- /* Allow for rounding differences in the last digit */ +- double lower = (double)f * 0.99999995; +- double higher = (double)f * 1.00000005; +- +- if(isfinite(lower)) sprintf(expected_lower, "%.7g", lower); +- if(isfinite(higher)) sprintf(expected_higher, "%.7g", higher); +- +- /* Outside [1,10000000] allow for relative error of +/-2.5e-7 */ +- if (f < 1.0 || f > 10000000) +- { +- double lower2 = (double)f * 0.99999985; +- double lower3 = (double)f * 0.99999975; +- double higher2 = (double)f * 1.00000015; +- double higher3 = (double)f * 1.00000025; +- +- if (isfinite(lower2)) sprintf(expected_lower2, "%.7g", lower2); +- if (isfinite(lower3)) sprintf(expected_lower3, "%.7g", lower3); +- if (isfinite(higher2)) sprintf(expected_higher2, "%.7g", higher2); +- if (isfinite(higher3)) sprintf(expected_higher3, "%.7g", higher3); +- } +- +- if (strcmp(expected, getBufferPutcharSpy()) != 0 && +- strcmp(expected_lower, getBufferPutcharSpy()) != 0 && +- strcmp(expected_lower2, getBufferPutcharSpy()) != 0 && +- strcmp(expected_lower3, getBufferPutcharSpy()) != 0 && +- strcmp(expected_higher, getBufferPutcharSpy()) != 0 && +- strcmp(expected_higher2, getBufferPutcharSpy()) != 0 && +- strcmp(expected_higher3, getBufferPutcharSpy()) != 0) +- { +- /* Fail with diagnostic printing */ +- TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, f); +- } +-} +-#endif +-#endif +- +-void testFloatPrintingRandomSamples(void) +-{ +-#if !defined(UNITY_TEST_ALL_FLOATS_PRINT_OK) || !defined(USING_OUTPUT_SPY) +- TEST_IGNORE(); +-#else +- union { float f_value; uint32_t int_value; } u; +- +- /* These values are not covered by the MINSTD generator */ +- u.int_value = 0x00000000; printFloatValue(u.f_value); +- u.int_value = 0x80000000; printFloatValue(u.f_value); +- u.int_value = 0x7fffffff; printFloatValue(u.f_value); +- u.int_value = 0xffffffff; printFloatValue(u.f_value); +- +- uint32_t a = 1; +- for(int num_tested = 0; num_tested < 1000000; num_tested++) +- { +- /* MINSTD pseudo-random number generator */ +- a = (uint32_t)(((uint64_t)a * 48271u) % 2147483647u); +- +- /* MINSTD does not set the highest bit; test both possibilities */ +- u.int_value = a; printFloatValue(u.f_value); +- u.int_value = a | 0x80000000; printFloatValue(u.f_value); +- } +-#endif +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers.c +deleted file mode 100644 +index 7bdfa1442e..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers.c ++++ /dev/null +@@ -1,2847 +0,0 @@ +-/* ========================================== +- 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] +-========================================== */ +- +-#include "unity.h" +-#define TEST_INSTANCES +-#include "self_assessment_utils.h" +- +-static int SetToOneToFailInTearDown; +-static int SetToOneMeanWeAlreadyCheckedThisGuy; +- +-void setUp(void) +-{ +- SetToOneToFailInTearDown = 0; +- SetToOneMeanWeAlreadyCheckedThisGuy = 0; +-} +- +-void tearDown(void) +-{ +- endPutcharSpy(); /* Stop suppressing test output */ +- if (SetToOneToFailInTearDown == 1) +- { +- /* These will be skipped internally if already failed/ignored */ +- TEST_FAIL_MESSAGE("<= Failed in tearDown"); +- TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); +- } +- if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) +- { +- UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); +- UNITY_OUTPUT_CHAR('\n'); +- } +-} +- +-void testNotEqualInts(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT(3982, 3983); +- VERIFY_FAILS_END +-} +- +-void testNotEqualInt8s(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT8(-127, -126); +- VERIFY_FAILS_END +-} +- +-void testNotEqualChars(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_CHAR('A', 'a'); +- VERIFY_FAILS_END +-} +- +-void testNotEqualInt16s(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT16(-16383, -16382); +- VERIFY_FAILS_END +-} +- +-void testNotEqualInt32s(void) +-{ +- EXPECT_ABORT_BEGIN +- /*use largest 32 bit negative to test printability*/ +- /*note: (-2147483647 - 1) is used instead of -2147483648 because of C90 casting rules */ +- TEST_ASSERT_EQUAL_INT32(-2147483647, (-2147483647 - 1)); +- VERIFY_FAILS_END +-} +- +-void testNotEqualBits(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_BITS(0xFF00, 0x5555, 0x5A55); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUInts(void) +-{ +- UNITY_UINT16 v0, v1; +- +- v0 = 9000; +- v1 = 9001; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT(v0, v1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUInt8s(void) +-{ +- UNITY_UINT8 v0, v1; +- +- v0 = 254; +- v1 = 255; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT8(v0, v1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUInt16s(void) +-{ +- UNITY_UINT16 v0, v1; +- +- v0 = 65535u; +- v1 = 65534u; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT16(v0, v1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUInt32s(void) +-{ +- UNITY_UINT32 v0, v1; +- +- v0 = 4294967295u; +- v1 = 4294967294u; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT32(v0, v1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHex8s(void) +-{ +- UNITY_UINT8 v0, v1; +- +- v0 = 0x23; +- v1 = 0x22; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX8(v0, v1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHex8sIfSigned(void) +-{ +- UNITY_INT8 v0, v1; +- +- v0 = -2; +- v1 = 2; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX8(v0, v1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHex16s(void) +-{ +- UNITY_UINT16 v0, v1; +- +- v0 = 0x1234; +- v1 = 0x1235; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX16(v0, v1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHex16sIfSigned(void) +-{ +- UNITY_INT16 v0, v1; +- +- v0 = -1024; +- v1 = -1028; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX16(v0, v1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHex32s(void) +-{ +- UNITY_UINT32 v0, v1; +- +- v0 = 900000; +- v1 = 900001; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX32(v0, v1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHex32sIfSigned(void) +-{ +- UNITY_INT32 v0, v1; +- +- v0 = -900000; +- v1 = 900001; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX32(v0, v1); +- VERIFY_FAILS_END +-} +- +-void testEqualInts(void) +-{ +- int v0, v1; +- int *p0, *p1; +- +- v0 = 19467; +- v1 = 19467; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_INT(1837, 1837); +- TEST_ASSERT_EQUAL_INT(-27365, -27365); +- TEST_ASSERT_EQUAL_INT(v0, v1); +- TEST_ASSERT_EQUAL_INT(19467, v1); +- TEST_ASSERT_EQUAL_INT(v0, 19467); +- TEST_ASSERT_EQUAL_INT(*p0, v1); +- TEST_ASSERT_EQUAL_INT(*p0, *p1); +- TEST_ASSERT_EQUAL_INT(*p0, 19467); +-} +- +-void testEqualInt8s(void) +-{ +- UNITY_INT8 v0, v1; +- UNITY_INT8 *p0, *p1; +- +- v0 = 0x22; +- v1 = 0x22; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_INT8(0x22, 0x22); +- TEST_ASSERT_EQUAL_INT8(v0, v1); +- TEST_ASSERT_EQUAL_INT8(0x22, v1); +- TEST_ASSERT_EQUAL_INT8(v0, 0x22); +- TEST_ASSERT_EQUAL_INT8(*p0, v1); +- TEST_ASSERT_EQUAL_INT8(*p0, *p1); +- TEST_ASSERT_EQUAL_INT8(*p0, 0x22); +-} +- +-void testEqualInt8sWhenThereAreDifferencesOutside8Bits(void) +-{ +- TEST_ASSERT_EQUAL_INT8(0x321,0x421); +- TEST_ASSERT_EQUAL_INT8(0xFF21,0x0021); +-} +- +-void testEqualChars(void) +-{ +- char v0, v1; +- char *p0, *p1; +- +- v0 = 'A'; +- v1 = 'A'; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_CHAR('A', 'A'); +- TEST_ASSERT_EQUAL_CHAR(v0, v1); +- TEST_ASSERT_EQUAL_CHAR('A', v1); +- TEST_ASSERT_EQUAL_CHAR(v0, 'A'); +- TEST_ASSERT_EQUAL_CHAR(*p0, v1); +- TEST_ASSERT_EQUAL_CHAR(*p0, *p1); +- TEST_ASSERT_EQUAL_CHAR(*p0, 'A'); +-} +- +-void testEqualCharsWhenThereAreDifferencesOutside8Bits(void) +-{ +- TEST_ASSERT_EQUAL_CHAR(0x321,0x421); +- TEST_ASSERT_EQUAL_CHAR(0xFF21,0x0021); +-} +- +- +-void testEqualInt16s(void) +-{ +- UNITY_INT16 v0, v1; +- UNITY_INT16 *p0, *p1; +- +- v0 = 0x7876; +- v1 = 0x7876; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_INT16(0x7876, 0x7876); +- TEST_ASSERT_EQUAL_INT16(v0, v1); +- TEST_ASSERT_EQUAL_INT16(0x7876, v1); +- TEST_ASSERT_EQUAL_INT16(v0, 0x7876); +- TEST_ASSERT_EQUAL_INT16(*p0, v1); +- TEST_ASSERT_EQUAL_INT16(*p0, *p1); +- TEST_ASSERT_EQUAL_INT16(*p0, 0x7876); +-} +- +-void testEqualInt16sNegatives(void) +-{ +- UNITY_INT16 v0, v1; +- UNITY_INT16 *p0, *p1; +- +- v0 = -7876; +- v1 = -7876; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_INT16(-7876, -7876); +- TEST_ASSERT_EQUAL_INT16(v0, v1); +- TEST_ASSERT_EQUAL_INT16(-7876, v1); +- TEST_ASSERT_EQUAL_INT16(v0, -7876); +- TEST_ASSERT_EQUAL_INT16(*p0, v1); +- TEST_ASSERT_EQUAL_INT16(*p0, *p1); +- TEST_ASSERT_EQUAL_INT16(*p0, -7876); +-} +- +-void testEqualInt16sWhenThereAreDifferencesOutside16Bits(void) +-{ +- TEST_ASSERT_EQUAL_INT16(0x54321,0x64321); +- TEST_ASSERT_EQUAL_INT16(0xFFFF4321,0x00004321); +-} +- +-void testEqualInt32s(void) +-{ +- UNITY_INT32 v0, v1; +- UNITY_INT32 *p0, *p1; +- +- v0 = 0x78760000; +- v1 = 0x78760000; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_INT32(0x78760000, 0x78760000); +- TEST_ASSERT_EQUAL_INT32(v0, v1); +- TEST_ASSERT_EQUAL_INT32(0x78760000, v1); +- TEST_ASSERT_EQUAL_INT32(v0, 0x78760000); +- TEST_ASSERT_EQUAL_INT32(*p0, v1); +- TEST_ASSERT_EQUAL_INT32(*p0, *p1); +- TEST_ASSERT_EQUAL_INT32(*p0, 0x78760000); +-} +- +-void testEqualInt32sNegatives(void) +-{ +- UNITY_INT32 v0, v1; +- UNITY_INT32 *p0, *p1; +- +- v0 = -123456789; +- v1 = -123456789; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_INT32(-123456789, -123456789); +- TEST_ASSERT_EQUAL_INT32(v0, v1); +- TEST_ASSERT_EQUAL_INT32(-123456789, v1); +- TEST_ASSERT_EQUAL_INT32(v0, -123456789); +- TEST_ASSERT_EQUAL_INT32(*p0, v1); +- TEST_ASSERT_EQUAL_INT32(*p0, *p1); +- TEST_ASSERT_EQUAL_INT32(*p0, -123456789); +-} +- +- +-void testEqualUints(void) +-{ +- unsigned int v0, v1; +- unsigned int *p0, *p1; +- +- v0 = 19467; +- v1 = 19467; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_UINT(1837, 1837); +- TEST_ASSERT_EQUAL_UINT(v0, v1); +- TEST_ASSERT_EQUAL_UINT(19467, v1); +- TEST_ASSERT_EQUAL_UINT(v0, 19467); +- TEST_ASSERT_EQUAL_UINT(*p0, v1); +- TEST_ASSERT_EQUAL_UINT(*p0, *p1); +- TEST_ASSERT_EQUAL_UINT(*p0, 19467); +- TEST_ASSERT_EQUAL_UINT(60872u, 60872u); +-} +- +- +-void testEqualUint8s(void) +-{ +- UNITY_UINT8 v0, v1; +- UNITY_UINT8 *p0, *p1; +- +- v0 = 0x22; +- v1 = 0x22; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_UINT8(0x22, 0x22); +- TEST_ASSERT_EQUAL_UINT8(v0, v1); +- TEST_ASSERT_EQUAL_UINT8(0x22, v1); +- TEST_ASSERT_EQUAL_UINT8(v0, 0x22); +- TEST_ASSERT_EQUAL_UINT8(*p0, v1); +- TEST_ASSERT_EQUAL_UINT8(*p0, *p1); +- TEST_ASSERT_EQUAL_UINT8(*p0, 0x22); +-} +- +-void testEqualUint8sWhenThereAreDifferencesOutside8Bits(void) +-{ +- TEST_ASSERT_EQUAL_UINT8(0x321,0x421); +- TEST_ASSERT_EQUAL_UINT8(0xFF21,0x0021); +-} +- +-void testEqualUint16s(void) +-{ +- UNITY_UINT16 v0, v1; +- UNITY_UINT16 *p0, *p1; +- +- v0 = 0x9876; +- v1 = 0x9876; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_UINT16(0x9876, 0x9876); +- TEST_ASSERT_EQUAL_UINT16(v0, v1); +- TEST_ASSERT_EQUAL_UINT16(0x9876, v1); +- TEST_ASSERT_EQUAL_UINT16(v0, 0x9876); +- TEST_ASSERT_EQUAL_UINT16(*p0, v1); +- TEST_ASSERT_EQUAL_UINT16(*p0, *p1); +- TEST_ASSERT_EQUAL_UINT16(*p0, 0x9876); +-} +- +-void testEqualUint16sWhenThereAreDifferencesOutside16Bits(void) +-{ +- TEST_ASSERT_EQUAL_UINT16(0x54321,0x64321); +- TEST_ASSERT_EQUAL_UINT16(0xFFFF4321,0x00004321); +-} +- +-void testEqualUint32s(void) +-{ +- UNITY_UINT32 v0, v1; +- UNITY_UINT32 *p0, *p1; +- +- v0 = 0x98760000; +- v1 = 0x98760000; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_UINT32(0x98760000, 0x98760000); +- TEST_ASSERT_EQUAL_UINT32(v0, v1); +- TEST_ASSERT_EQUAL_UINT32(0x98760000, v1); +- TEST_ASSERT_EQUAL_UINT32(v0, 0x98760000); +- TEST_ASSERT_EQUAL_UINT32(*p0, v1); +- TEST_ASSERT_EQUAL_UINT32(*p0, *p1); +- TEST_ASSERT_EQUAL_UINT32(*p0, 0x98760000); +-} +- +-void testNotEqual(void) +-{ +- TEST_ASSERT_NOT_EQUAL(0, 1); +- TEST_ASSERT_NOT_EQUAL(1, 0); +- TEST_ASSERT_NOT_EQUAL(100, 101); +- TEST_ASSERT_NOT_EQUAL(0, -1); +- TEST_ASSERT_NOT_EQUAL(65535, -65535); +- TEST_ASSERT_NOT_EQUAL(75, 900); +- TEST_ASSERT_NOT_EQUAL(-100, -101); +-} +- +-void testEqualHex8s(void) +-{ +- UNITY_UINT8 v0, v1; +- UNITY_UINT8 *p0, *p1; +- +- v0 = 0x22; +- v1 = 0x22; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_HEX8(0x22, 0x22); +- TEST_ASSERT_EQUAL_HEX8(v0, v1); +- TEST_ASSERT_EQUAL_HEX8(0x22, v1); +- TEST_ASSERT_EQUAL_HEX8(v0, 0x22); +- TEST_ASSERT_EQUAL_HEX8(*p0, v1); +- TEST_ASSERT_EQUAL_HEX8(*p0, *p1); +- TEST_ASSERT_EQUAL_HEX8(*p0, 0x22); +-} +- +-void testEqualHex8sWhenThereAreDifferencesOutside8Bits(void) +-{ +- TEST_ASSERT_EQUAL_HEX8(0x321,0x421); +- TEST_ASSERT_EQUAL_HEX8(0xFF21,0x0021); +-} +- +-void testEqualHex8sNegatives(void) +-{ +- UNITY_UINT8 v0, v1; +- UNITY_UINT8 *p0, *p1; +- +- v0 = 0xDD; +- v1 = 0xDD; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_HEX8(0xDD, 0xDD); +- TEST_ASSERT_EQUAL_HEX8(v0, v1); +- TEST_ASSERT_EQUAL_HEX8(0xDD, v1); +- TEST_ASSERT_EQUAL_HEX8(v0, 0xDD); +- TEST_ASSERT_EQUAL_HEX8(*p0, v1); +- TEST_ASSERT_EQUAL_HEX8(*p0, *p1); +- TEST_ASSERT_EQUAL_HEX8(*p0, 0xDD); +-} +- +-void testEqualHex16s(void) +-{ +- UNITY_UINT16 v0, v1; +- UNITY_UINT16 *p0, *p1; +- +- v0 = 0x9876; +- v1 = 0x9876; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_HEX16(0x9876, 0x9876); +- TEST_ASSERT_EQUAL_HEX16(v0, v1); +- TEST_ASSERT_EQUAL_HEX16(0x9876, v1); +- TEST_ASSERT_EQUAL_HEX16(v0, 0x9876); +- TEST_ASSERT_EQUAL_HEX16(*p0, v1); +- TEST_ASSERT_EQUAL_HEX16(*p0, *p1); +- TEST_ASSERT_EQUAL_HEX16(*p0, 0x9876); +-} +- +-void testEqualHex16sWhenThereAreDifferencesOutside16Bits(void) +-{ +- TEST_ASSERT_EQUAL_HEX16(0x54321,0x64321); +- TEST_ASSERT_EQUAL_HEX16(0xFFFF4321,0x00004321); +-} +- +-void testEqualHex32s(void) +-{ +- UNITY_UINT32 v0, v1; +- UNITY_UINT32 *p0, *p1; +- +- v0 = 0x98765432ul; +- v1 = 0x98765432ul; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_HEX32(0x98765432ul, 0x98765432ul); +- TEST_ASSERT_EQUAL_HEX32(v0, v1); +- TEST_ASSERT_EQUAL_HEX32(0x98765432ul, v1); +- TEST_ASSERT_EQUAL_HEX32(v0, 0x98765432ul); +- TEST_ASSERT_EQUAL_HEX32(*p0, v1); +- TEST_ASSERT_EQUAL_HEX32(*p0, *p1); +- TEST_ASSERT_EQUAL_HEX32(*p0, 0x98765432ul); +-} +- +-void testEqualBits(void) +-{ +- UNITY_UINT32 v0 = 0xFF55AA00; +- UNITY_UINT32 v1 = 0x55550000; +- +- TEST_ASSERT_BITS(v1, v0, 0x55550000); +- TEST_ASSERT_BITS(v1, v0, 0xFF55CC00); +- TEST_ASSERT_BITS(0xFFFFFFFF, v0, 0xFF55AA00); +- TEST_ASSERT_BITS(0xFFFFFFFF, v0, v0); +- TEST_ASSERT_BITS(0xF0F0F0F0, v0, 0xFC5DAE0F); +- TEST_ASSERT_BITS_HIGH(v1, v0); +- TEST_ASSERT_BITS_LOW(0x000055FF, v0); +- TEST_ASSERT_BIT_HIGH(30, v0); +- TEST_ASSERT_BIT_LOW(5, v0); +-} +- +-void testNotEqualBitHigh(void) +-{ +- UNITY_UINT32 v0 = 0x7F55AA00; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_BIT_HIGH(31, v0); +- VERIFY_FAILS_END +-} +- +-void testNotEqualBitLow(void) +-{ +- UNITY_UINT32 v0 = 0xFF55AA00; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_BIT_LOW(30, v0); +- VERIFY_FAILS_END +-} +- +-void testNotEqualBitsHigh(void) +-{ +- UNITY_UINT32 v0 = 0xFF55AA00; +- UNITY_UINT32 v1 = 0x55550000; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_BITS_HIGH(v0, v1); +- VERIFY_FAILS_END +- +-} +- +-void testNotEqualBitsLow(void) +-{ +- UNITY_UINT32 v0 = 0xFF55AA00; +- UNITY_UINT32 v1 = 0x55550000; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_BITS_LOW(v0, v1); +- VERIFY_FAILS_END +-} +- +- +-void testEqualShorts(void) +-{ +- short v0, v1; +- short *p0, *p1; +- +- v0 = 19467; +- v1 = 19467; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_INT(1837, 1837); +- TEST_ASSERT_EQUAL_INT(-2987, -2987); +- TEST_ASSERT_EQUAL_INT(v0, v1); +- TEST_ASSERT_EQUAL_INT(19467, v1); +- TEST_ASSERT_EQUAL_INT(v0, 19467); +- TEST_ASSERT_EQUAL_INT(*p0, v1); +- TEST_ASSERT_EQUAL_INT(*p0, *p1); +- TEST_ASSERT_EQUAL_INT(*p0, 19467); +-} +- +-void testEqualUShorts(void) +-{ +- unsigned short v0, v1; +- unsigned short *p0, *p1; +- +- v0 = 19467; +- v1 = 19467; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_UINT(1837, 1837); +- TEST_ASSERT_EQUAL_UINT(2987, 2987); +- TEST_ASSERT_EQUAL_UINT(v0, v1); +- TEST_ASSERT_EQUAL_UINT(19467, v1); +- TEST_ASSERT_EQUAL_UINT(v0, 19467); +- TEST_ASSERT_EQUAL_UINT(*p0, v1); +- TEST_ASSERT_EQUAL_UINT(*p0, *p1); +- TEST_ASSERT_EQUAL_UINT(*p0, 19467); +-} +- +-void testEqualUInts(void) +-{ +- unsigned char v0, v1; +- unsigned char *p0, *p1; +- +- v0 = 109; +- v1 = 109; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_UINT(42, 42); +- TEST_ASSERT_EQUAL_UINT(-116, -116); +- TEST_ASSERT_EQUAL_UINT(v0, v1); +- TEST_ASSERT_EQUAL_UINT(109, v1); +- TEST_ASSERT_EQUAL_UINT(v0, 109); +- TEST_ASSERT_EQUAL_UINT(*p0, v1); +- TEST_ASSERT_EQUAL_UINT(*p0, *p1); +- TEST_ASSERT_EQUAL_UINT(*p0, 109); +-} +- +-void testEqualUChars(void) +-{ +- unsigned char v0, v1; +- unsigned char *p0, *p1; +- +- v0 = 251; +- v1 = 251; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_INT(42, 42); +- TEST_ASSERT_EQUAL_INT(v0, v1); +- TEST_ASSERT_EQUAL_INT(251, v1); +- TEST_ASSERT_EQUAL_INT(v0, 251); +- TEST_ASSERT_EQUAL_INT(*p0, v1); +- TEST_ASSERT_EQUAL_INT(*p0, *p1); +- TEST_ASSERT_EQUAL_INT(*p0, 251); +-} +- +-void testEqualPointers(void) +-{ +- int v0, v1; +- int *p0, *p1, *p2; +- +- v0 = 19467; +- v1 = 18271; +- p0 = &v0; +- p1 = &v1; +- p2 = &v1; +- +- TEST_ASSERT_EQUAL_PTR(p0, &v0); +- TEST_ASSERT_EQUAL_PTR(&v1, p1); +- TEST_ASSERT_EQUAL_PTR(p2, p1); +- TEST_ASSERT_EQUAL_PTR(&v0, &v0); +-} +- +-void testNotEqualPointers(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_PTR(0x12345678, 0x12345677); +- VERIFY_FAILS_END +-} +- +-void testIntsWithinDelta(void) +-{ +- TEST_ASSERT_INT_WITHIN(1, 5000, 5001); +- TEST_ASSERT_INT_WITHIN(5, 5000, 4996); +- TEST_ASSERT_INT_WITHIN(5, 5000, 5005); +- TEST_ASSERT_INT_WITHIN(500, 50, -440); +- +- TEST_ASSERT_INT_WITHIN(2, -1, -1); +- TEST_ASSERT_INT_WITHIN(5, 1, -1); +- TEST_ASSERT_INT_WITHIN(5, -1, 1); +-} +- +-void testIntsWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_INT_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); +- TEST_ASSERT_INT_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); +- TEST_ASSERT_INT_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); +- TEST_ASSERT_INT_WITHIN_MESSAGE(500, 50, -440, "Custom Message."); +- +- TEST_ASSERT_INT_WITHIN_MESSAGE(2, -1, -1, "Custom Message."); +- TEST_ASSERT_INT_WITHIN_MESSAGE(5, 1, -1, "Custom Message."); +- TEST_ASSERT_INT_WITHIN_MESSAGE(5, -1, 1, "Custom Message."); +-} +- +-void testIntsNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT_WITHIN(5, 5000, 5006); +- VERIFY_FAILS_END +-} +- +-void testIntsNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT_WITHIN_MESSAGE(5, 5000, 5006, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUIntsWithinDelta(void) +-{ +- TEST_ASSERT_UINT_WITHIN(1, 5000, 5001); +- TEST_ASSERT_UINT_WITHIN(5, 5000, 4996); +- TEST_ASSERT_UINT_WITHIN(5, 5000, 5005); +-} +- +-void testUIntsWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_UINT_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); +- TEST_ASSERT_UINT_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); +- TEST_ASSERT_UINT_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); +-} +- +-void testUIntsNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_WITHIN(1, 2147483647u, 2147483649u); +- VERIFY_FAILS_END +-} +- +-void testUIntsNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_WITHIN_MESSAGE(1, 2147483647u, 2147483649u, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUIntsNotWithinDeltaEvenThoughASignedIntWouldPassSmallFirst(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_WITHIN(5, 1, -1); +- VERIFY_FAILS_END +-} +- +-void testUIntsNotWithinDeltaEvenThoughASignedIntWouldPassSmallFirstAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_WITHIN_MESSAGE(5, 1, -1, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUIntsNotWithinDeltaEvenThoughASignedIntWouldPassBigFirst(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_WITHIN(5, -1, 1); +- VERIFY_FAILS_END +-} +- +-void testUIntsNotWithinDeltaEvenThoughASignedIntWouldPassBigFirstAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT_WITHIN_MESSAGE(5, -1, 1, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX32sWithinDelta(void) +-{ +- TEST_ASSERT_HEX32_WITHIN(1, 5000, 5001); +- TEST_ASSERT_HEX32_WITHIN(5, 5000, 4996); +- TEST_ASSERT_HEX32_WITHIN(5, 5000, 5005); +-} +- +-void testHEX32sWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_HEX32_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); +- TEST_ASSERT_HEX32_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); +- TEST_ASSERT_HEX32_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); +-} +- +-void testHEX32sNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_WITHIN(1, 2147483647u, 2147483649u); +- VERIFY_FAILS_END +-} +- +-void testHEX32sNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_WITHIN_MESSAGE(1, 2147483647u, 2147483649u, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX32sNotWithinDeltaEvenThoughASignedIntWouldPass(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_WITHIN(5, 1, -1); +- VERIFY_FAILS_END +-} +- +-void testHEX32sNotWithinDeltaEvenThoughASignedIntWouldPassAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX32_WITHIN_MESSAGE(5, 1, -1, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX16sWithinDelta(void) +-{ +- TEST_ASSERT_HEX16_WITHIN(1, 5000, 5001); +- TEST_ASSERT_HEX16_WITHIN(5, 5000, 4996); +- TEST_ASSERT_HEX16_WITHIN(5, 5000, 5005); +-} +- +-void testHEX16sWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_HEX16_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); +- TEST_ASSERT_HEX16_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); +- TEST_ASSERT_HEX16_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); +-} +- +-void testHEX16sWithinDeltaWhenThereAreDifferenceOutsideOf16Bits(void) +-{ +- TEST_ASSERT_HEX16_WITHIN(5, 0x54321, 0x44321); +-} +- +-void testHEX16sWithinDeltaWhenThereAreDifferenceOutsideOf16BitsAndCustomMessage(void) +-{ +- TEST_ASSERT_HEX16_WITHIN_MESSAGE(5, 0x54321, 0x44321, "Custom Message."); +-} +- +-void testHEX16sNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX16_WITHIN(2, 65535, 0); +- VERIFY_FAILS_END +-} +- +-void testHEX16sNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX16_WITHIN_MESSAGE(2, 65535, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testHEX8sWithinDelta(void) +-{ +- TEST_ASSERT_HEX8_WITHIN(1, 254, 255); +- TEST_ASSERT_HEX8_WITHIN(5, 251, 255); +- TEST_ASSERT_HEX8_WITHIN(5, 1, 4); +-} +- +-void testHEX8sWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_HEX8_WITHIN_MESSAGE(1, 254, 255, "Custom Message."); +- TEST_ASSERT_HEX8_WITHIN_MESSAGE(5, 251, 255, "Custom Message."); +- TEST_ASSERT_HEX8_WITHIN_MESSAGE(5, 1, 4, "Custom Message."); +-} +- +-void testHEX8sWithinDeltaWhenThereAreDifferenceOutsideOf8Bits(void) +-{ +- TEST_ASSERT_HEX8_WITHIN(5, 0x123, 0xF23); +-} +- +-void testHEX8sWithinDeltaWhenThereAreDifferenceOutsideOf8BitsAndCustomMessage(void) +-{ +- TEST_ASSERT_HEX8_WITHIN_MESSAGE(5, 0x123, 0xF23, "Custom Message."); +-} +- +-void testHEX8sNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX8_WITHIN(2, 255, 0); +- VERIFY_FAILS_END +-} +- +-void testHEX8sNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX8_WITHIN_MESSAGE(2, 255, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-/*-----------------*/ +- +-void testUINT32sWithinDelta(void) +-{ +- TEST_ASSERT_UINT32_WITHIN(1, 5000, 5001); +- TEST_ASSERT_UINT32_WITHIN(5, 5000, 4996); +- TEST_ASSERT_UINT32_WITHIN(5, 5000, 5005); +-} +- +-void testUINT32sWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_UINT32_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); +- TEST_ASSERT_UINT32_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); +- TEST_ASSERT_UINT32_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); +-} +- +-void testUINT32sNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT32_WITHIN(1, 2147483647u, 2147483649u); +- VERIFY_FAILS_END +-} +- +-void testUINT32sNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT32_WITHIN_MESSAGE(1, 2147483647u, 2147483649u, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUINT32sNotWithinDeltaEvenThoughASignedIntWouldPass(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT32_WITHIN(5, 1, -1); +- VERIFY_FAILS_END +-} +- +-void testUINT32sNotWithinDeltaEvenThoughASignedIntWouldPassAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT32_WITHIN_MESSAGE(5, 1, -1, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUINT16sWithinDelta(void) +-{ +- TEST_ASSERT_UINT16_WITHIN(1, 5000, 5001); +- TEST_ASSERT_UINT16_WITHIN(5, 5000, 4996); +- TEST_ASSERT_UINT16_WITHIN(5, 5000, 5005); +-} +- +-void testUINT16sWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_UINT16_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); +- TEST_ASSERT_UINT16_WITHIN_MESSAGE(5, 5000, 4996, "Custom Message."); +- TEST_ASSERT_UINT16_WITHIN_MESSAGE(5, 5000, 5005, "Custom Message."); +-} +- +-void testUINT16sWithinDeltaWhenThereAreDifferenceOutsideOf16Bits(void) +-{ +- TEST_ASSERT_UINT16_WITHIN(5, 0x54321, 0x44321); +-} +- +-void testUINT16sWithinDeltaWhenThereAreDifferenceOutsideOf16BitsAndCustomMessage(void) +-{ +- TEST_ASSERT_UINT16_WITHIN_MESSAGE(5, 0x54321, 0x44321, "Custom Message."); +-} +- +-void testUINT16sNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_WITHIN(2, 65535, 0); +- VERIFY_FAILS_END +-} +- +-void testUINT16sNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT16_WITHIN_MESSAGE(2, 65535, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testUINT8sWithinDelta(void) +-{ +- TEST_ASSERT_UINT8_WITHIN(1, 254, 255); +- TEST_ASSERT_UINT8_WITHIN(5, 251, 255); +- TEST_ASSERT_UINT8_WITHIN(5, 1, 4); +-} +- +-void testUINT8sWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_UINT8_WITHIN_MESSAGE(1, 254, 255, "Custom Message."); +- TEST_ASSERT_UINT8_WITHIN_MESSAGE(5, 251, 255, "Custom Message."); +- TEST_ASSERT_UINT8_WITHIN_MESSAGE(5, 1, 4, "Custom Message."); +-} +- +-void testUINT8sWithinDeltaWhenThereAreDifferenceOutsideOf8Bits(void) +-{ +- TEST_ASSERT_UINT8_WITHIN(5, 0x123, 0xF23); +-} +- +-void testUINT8sWithinDeltaWhenThereAreDifferenceOutsideOf8BitsAndCustomMessage(void) +-{ +- TEST_ASSERT_UINT8_WITHIN_MESSAGE(5, 0x123, 0xF23, "Custom Message."); +-} +- +-void testUINT8sNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT8_WITHIN(2, 255, 0); +- VERIFY_FAILS_END +-} +- +-void testUINT8sNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT8_WITHIN_MESSAGE(2, 255, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testINT32sWithinDelta(void) +-{ +- TEST_ASSERT_INT32_WITHIN(1, 5000, 5001); +- TEST_ASSERT_INT32_WITHIN(5, 1, -2); +- TEST_ASSERT_INT32_WITHIN(5, -2, 1); +-} +- +-void testINT32sWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_INT32_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); +-} +- +-void testINT32sNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT32_WITHIN(1, -3, 1); +- VERIFY_FAILS_END +-} +- +-void testINT32sNotWithinDeltaAndDifferenceOverflows(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT32_WITHIN(1, -1, 0x7FFFFFFF); +- VERIFY_FAILS_END +-} +-void testINT32sNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT32_WITHIN_MESSAGE(1, -2, 1, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testINT16sWithinDelta(void) +-{ +- TEST_ASSERT_INT16_WITHIN(1, 5000, 5001); +- TEST_ASSERT_INT16_WITHIN(5, 2, -2); +- TEST_ASSERT_INT16_WITHIN(5, -2, 2); +-} +- +-void testINT16sWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_INT16_WITHIN_MESSAGE(1, 5000, 5001, "Custom Message."); +-} +- +-void testINT16sWithinDeltaWhenThereAreDifferenceOutsideOf16Bits(void) +-{ +- TEST_ASSERT_INT16_WITHIN(5, 0x54321, 0x44321); +-} +- +-void testINT16sWithinDeltaWhenThereAreDifferenceOutsideOf16BitsAndCustomMessage(void) +-{ +- TEST_ASSERT_INT16_WITHIN_MESSAGE(5, 0x54321, 0x44321, "Custom Message."); +-} +- +-void testINT16sNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT16_WITHIN(2, 4, -2); +- VERIFY_FAILS_END +-} +- +-void testINT16sNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT16_WITHIN_MESSAGE(2, 3, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testINT8sWithinDelta(void) +-{ +- TEST_ASSERT_INT8_WITHIN(1, 127, 126); +- TEST_ASSERT_INT8_WITHIN(5, -2, 2); +- TEST_ASSERT_INT8_WITHIN(5, 2, -2); +-} +- +-void testINT8sWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_INT8_WITHIN_MESSAGE(5, 1, 4, "Custom Message."); +-} +- +-void testINT8sWithinDeltaWhenThereAreDifferenceOutsideOf8Bits(void) +-{ +- TEST_ASSERT_INT8_WITHIN(5, 0x123, 0xF23); +-} +- +-void testINT8sWithinDeltaWhenThereAreDifferenceOutsideOf8BitsAndCustomMessage(void) +-{ +- TEST_ASSERT_INT8_WITHIN_MESSAGE(5, 0x123, 0xF23, "Custom Message."); +-} +- +-void testINT8sNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT8_WITHIN(2, -3, 0); +- VERIFY_FAILS_END +-} +- +-void testINT8sNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT8_WITHIN_MESSAGE(2, -4, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testCHARsWithinDelta(void) +-{ +- TEST_ASSERT_CHAR_WITHIN(1, 'M', 'L'); +- TEST_ASSERT_CHAR_WITHIN(5, -2, 2); +- TEST_ASSERT_CHAR_WITHIN(5, 2, -2); +-} +- +-void testCHARsWithinDeltaAndCustomMessage(void) +-{ +- TEST_ASSERT_CHAR_WITHIN_MESSAGE(5, 1, 4, "Custom Message."); +-} +- +-void testCHARsWithinDeltaWhenThereAreDifferenceOutsideOf8Bits(void) +-{ +- TEST_ASSERT_CHAR_WITHIN(5, 0x123, 0xF23); +-} +- +-void testCHARsWithinDeltaWhenThereAreDifferenceOutsideOf8BitsAndCustomMessage(void) +-{ +- TEST_ASSERT_CHAR_WITHIN_MESSAGE(5, 0x123, 0xF23, "Custom Message."); +-} +- +-void testCHARsNotWithinDelta(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_CHAR_WITHIN(2, -3, 0); +- VERIFY_FAILS_END +-} +- +-void testCHARsNotWithinDeltaAndCustomMessage(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_CHAR_WITHIN_MESSAGE(2, -4, 0, "Custom Message."); +- VERIFY_FAILS_END +-} +- +-void testNotEqualINT(void) +-{ +- UNITY_INT v0, v1; +- UNITY_INT *p0, *p1; +- +- v0 = 302; +- v1 = 3334; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_INT(v0, v1); +- TEST_ASSERT_NOT_EQUAL_INT(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_INT(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_INT(*p1, *p0); +-} +- +-void testNotNotEqualINT(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_INT(302, 302); +- VERIFY_FAILS_END +-} +- +-void testNotEqualINT8(void) +-{ +- UNITY_INT8 v0, v1; +- UNITY_INT8 *p0, *p1; +- +- v0 = -128; +- v1 = 127; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_INT8(v0, v1); +- TEST_ASSERT_NOT_EQUAL_INT8(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_INT8(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_INT8(*p1, *p0); +-} +- +-void testNotNotEqualINT8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_INT8(-128, -128); +- VERIFY_FAILS_END +-} +- +-void testNotEqualCHAR(void) +-{ +- char v0, v1; +- char *p0, *p1; +- +- v0 = -128; +- v1 = 127; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_CHAR(v0, v1); +- TEST_ASSERT_NOT_EQUAL_CHAR(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_CHAR(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_CHAR(*p1, *p0); +-} +- +-void testNotNotEqualCHAR(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_CHAR(127, 127); +- VERIFY_FAILS_END +-} +- +-void testNotEqualINT16(void) +-{ +- UNITY_INT16 v0, v1; +- UNITY_INT16 *p0, *p1; +- +- v0 = -32768; +- v1 = 32767; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_INT16(v0, v1); +- TEST_ASSERT_NOT_EQUAL_INT16(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_INT16(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_INT16(*p1, *p0); +-} +- +-void testNotNotEqualINT16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_INT16(-32768, -32768); +- VERIFY_FAILS_END +-} +- +-void testNotEqualINT32(void) +-{ +- UNITY_INT32 v0, v1; +- UNITY_INT32 *p0, *p1; +- +- v0 = -214783648; +- v1 = 214783647; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_INT32(v0, v1); +- TEST_ASSERT_NOT_EQUAL_INT32(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_INT32(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_INT32(*p1, *p0); +-} +- +-void testNotNotEqualINT32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_INT32(-214783648, -214783648); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT(void) +-{ +- UNITY_UINT v0, v1; +- UNITY_UINT *p0, *p1; +- +- v0 = 0; +- v1 = 1; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_UINT(v0, v1); +- TEST_ASSERT_NOT_EQUAL_UINT(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_UINT(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_UINT(*p1, *p0); +-} +- +-void testNotNotEqualUINT(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_UINT(1, 1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT8(void) +-{ +- UNITY_UINT8 v0, v1; +- UNITY_UINT8 *p0, *p1; +- +- v0 = 0; +- v1 = 255; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_UINT8(v0, v1); +- TEST_ASSERT_NOT_EQUAL_UINT8(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_UINT8(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_UINT8(*p1, *p0); +-} +- +-void testNotNotEqualUINT8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_UINT8(255, 255); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT16(void) +-{ +- UNITY_UINT16 v0, v1; +- UNITY_UINT16 *p0, *p1; +- +- v0 = 0; +- v1 = 65535; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_UINT16(v0, v1); +- TEST_ASSERT_NOT_EQUAL_UINT16(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_UINT16(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_UINT16(*p1, *p0); +-} +- +-void testNotNotEqualUINT16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_UINT16(65535, 65535); +- VERIFY_FAILS_END +-} +- +-void testNotEqualUINT32(void) +-{ +- UNITY_UINT32 v0, v1; +- UNITY_UINT32 *p0, *p1; +- +- v0 = 0u; +- v1 = 4294967295u; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_UINT32(v0, v1); +- TEST_ASSERT_NOT_EQUAL_UINT32(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_UINT32(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_UINT32(*p1, *p0); +-} +- +-void testNotNotEqualUINT32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_UINT32(4294967295u, 4294967295u); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX8(void) +-{ +- UNITY_UINT8 v0, v1; +- UNITY_UINT8 *p0, *p1; +- +- v0 = 0x00; +- v1 = 0xFF; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_HEX8(v0, v1); +- TEST_ASSERT_NOT_EQUAL_HEX8(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_HEX8(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_HEX8(*p1, *p0); +-} +- +-void testNotNotEqualHEX8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_HEX8(0xFF, 0xFF); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX16(void) +-{ +- UNITY_UINT16 v0, v1; +- UNITY_UINT16 *p0, *p1; +- +- v0 = 0x0000; +- v1 = 0xFFFF; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_HEX16(v0, v1); +- TEST_ASSERT_NOT_EQUAL_HEX16(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_HEX16(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_HEX16(*p1, *p0); +-} +- +-void testNotNotEqualHEX16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_HEX16(0xFFFF, 0xFFFF); +- VERIFY_FAILS_END +-} +- +-void testNotEqualHEX32(void) +-{ +- UNITY_UINT32 v0, v1; +- UNITY_UINT32 *p0, *p1; +- +- v0 = 0x00000000; +- v1 = 0xFFFFFFFF; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_NOT_EQUAL_HEX32(v0, v1); +- TEST_ASSERT_NOT_EQUAL_HEX32(*p0, v1); +- TEST_ASSERT_NOT_EQUAL_HEX32(v0, *p1); +- TEST_ASSERT_NOT_EQUAL_HEX32(*p1, *p0); +-} +- +-void testNotNotEqualHEX32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_NOT_EQUAL_HEX32(0xFFFFFFFF, 0xFFFFFFFF); +- VERIFY_FAILS_END +-} +- +-/*-----------------*/ +- +-void testGreaterThan(void) +-{ +- UNITY_INT v0, v1; +- UNITY_INT *p0, *p1; +- +- v0 = 0; +- v1 = 1; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN(v0, v1); +- TEST_ASSERT_GREATER_THAN(*p0, v1); +- TEST_ASSERT_GREATER_THAN(v0, *p1); +- TEST_ASSERT_GREATER_THAN(*p0, *p1); +-} +- +-void testNotGreaterThan(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN(0, -1); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanINT(void) +-{ +- UNITY_INT v0, v1; +- UNITY_INT *p0, *p1; +- +- v0 = 302; +- v1 = 3334; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_INT(v0, v1); +- TEST_ASSERT_GREATER_THAN_INT(*p0, v1); +- TEST_ASSERT_GREATER_THAN_INT(v0, *p1); +- TEST_ASSERT_GREATER_THAN_INT(*p0, *p1); +-} +- +-void testNotGreaterThanINT(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_INT(3334, 302); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanINT8(void) +-{ +- UNITY_INT8 v0, v1; +- UNITY_INT8 *p0, *p1; +- +- v0 = -128; +- v1 = 127; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_INT8(v0, v1); +- TEST_ASSERT_GREATER_THAN_INT8(*p0, v1); +- TEST_ASSERT_GREATER_THAN_INT8(v0, *p1); +- TEST_ASSERT_GREATER_THAN_INT8(*p0, *p1); +-} +- +-void testNotGreaterThanINT8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_INT8(127, -128); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanCHAR(void) +-{ +- char v0, v1; +- char *p0, *p1; +- +- v0 = -128; +- v1 = 127; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_CHAR(v0, v1); +- TEST_ASSERT_GREATER_THAN_CHAR(*p0, v1); +- TEST_ASSERT_GREATER_THAN_CHAR(v0, *p1); +- TEST_ASSERT_GREATER_THAN_CHAR(*p0, *p1); +-} +- +-void testNotGreaterThanCHAR(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_CHAR(127, -128); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanINT16(void) +-{ +- UNITY_INT16 v0, v1; +- UNITY_INT16 *p0, *p1; +- +- v0 = -32768; +- v1 = 32767; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_INT16(v0, v1); +- TEST_ASSERT_GREATER_THAN_INT16(*p0, v1); +- TEST_ASSERT_GREATER_THAN_INT16(v0, *p1); +- TEST_ASSERT_GREATER_THAN_INT16(*p0, *p1); +-} +- +-void testNotGreaterThanINT16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_INT16(32768, -32768); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanINT32(void) +-{ +- UNITY_INT32 v0, v1; +- UNITY_INT32 *p0, *p1; +- +- v0 = -214783648; +- v1 = 214783647; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_INT32(v0, v1); +- TEST_ASSERT_GREATER_THAN_INT32(*p0, v1); +- TEST_ASSERT_GREATER_THAN_INT32(v0, *p1); +- TEST_ASSERT_GREATER_THAN_INT32(*p0, *p1); +-} +- +-void testNotGreaterThanINT32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_INT32(214783647, -214783648); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanUINT(void) +-{ +- UNITY_UINT v0, v1; +- UNITY_UINT *p0, *p1; +- +- v0 = 0; +- v1 = 1; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_UINT(v0, v1); +- TEST_ASSERT_GREATER_THAN_UINT(*p0, v1); +- TEST_ASSERT_GREATER_THAN_UINT(v0, *p1); +- TEST_ASSERT_GREATER_THAN_UINT(*p0, *p1); +-} +- +-void testNotGreaterThanUINT(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_UINT(1, 0); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanUINT8(void) +-{ +- UNITY_UINT8 v0, v1; +- UNITY_UINT8 *p0, *p1; +- +- v0 = 0; +- v1 = 255; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_UINT8(v0, v1); +- TEST_ASSERT_GREATER_THAN_UINT8(*p0, v1); +- TEST_ASSERT_GREATER_THAN_UINT8(v0, *p1); +- TEST_ASSERT_GREATER_THAN_UINT8(*p0, *p1); +-} +- +-void testNotGreaterThanUINT8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_UINT8(255, 0); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanUINT16(void) +-{ +- UNITY_UINT16 v0, v1; +- UNITY_UINT16 *p0, *p1; +- +- v0 = 0; +- v1 = 65535; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_UINT16(v0, v1); +- TEST_ASSERT_GREATER_THAN_UINT16(*p0, v1); +- TEST_ASSERT_GREATER_THAN_UINT16(v0, *p1); +- TEST_ASSERT_GREATER_THAN_UINT16(*p0, *p1); +-} +- +-void testNotGreaterThanUINT16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_UINT16(65535, 0); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanUINT32(void) +-{ +- UNITY_UINT32 v0, v1; +- UNITY_UINT32 *p0, *p1; +- +- v0 = 0u; +- v1 = 4294967295u; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_UINT32(v0, v1); +- TEST_ASSERT_GREATER_THAN_UINT32(*p0, v1); +- TEST_ASSERT_GREATER_THAN_UINT32(v0, *p1); +- TEST_ASSERT_GREATER_THAN_UINT32(*p0, *p1); +-} +- +-void testNotGreaterThanUINT32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_UINT32(4294967295u, 0); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanHEX8(void) +-{ +- UNITY_UINT8 v0, v1; +- UNITY_UINT8 *p0, *p1; +- +- v0 = 0x00; +- v1 = 0xFF; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_HEX8(v0, v1); +- TEST_ASSERT_GREATER_THAN_HEX8(*p0, v1); +- TEST_ASSERT_GREATER_THAN_HEX8(v0, *p1); +- TEST_ASSERT_GREATER_THAN_HEX8(*p0, *p1); +-} +- +-void testNotGreaterThanHEX8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_HEX8(0xFF, 0x00); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanHEX16(void) +-{ +- UNITY_UINT16 v0, v1; +- UNITY_UINT16 *p0, *p1; +- +- v0 = 0x0000; +- v1 = 0xFFFF; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_HEX16(v0, v1); +- TEST_ASSERT_GREATER_THAN_HEX16(*p0, v1); +- TEST_ASSERT_GREATER_THAN_HEX16(v0, *p1); +- TEST_ASSERT_GREATER_THAN_HEX16(*p0, *p1); +-} +- +-void testNotGreaterThanHEX16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_HEX16(0xFFFF, 0x00); +- VERIFY_FAILS_END +-} +- +-void testGreaterThanHEX32(void) +-{ +- UNITY_UINT32 v0, v1; +- UNITY_UINT32 *p0, *p1; +- +- v0 = 0x00000000; +- v1 = 0xFFFFFFFF; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_GREATER_THAN_HEX32(v0, v1); +- TEST_ASSERT_GREATER_THAN_HEX32(*p0, v1); +- TEST_ASSERT_GREATER_THAN_HEX32(v0, *p1); +- TEST_ASSERT_GREATER_THAN_HEX32(*p0, *p1); +-} +- +-void testNotGreaterThanHEX32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_THAN_HEX32(0xFFFFFFFF, 0x00); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqual(void) +-{ +- UNITY_INT v0, v1, v2; +- UNITY_INT *p0, *p1, *p2; +- +- v0 = 0; +- v1 = 1; +- v2 = 0; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL(*p0, *p2); +-} +- +-void testNotGreaterOrEqual(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL(0, -1); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualINT(void) +-{ +- UNITY_INT v0, v1, v2; +- UNITY_INT *p0, *p1, *p2; +- +- v0 = 302; +- v1 = 3334; +- v2 = 302; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_INT(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT(*p0, *p2); +-} +- +-void testNotGreaterOrEqualINT(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_INT(3334, 302); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualINT8(void) +-{ +- UNITY_INT8 v0, v1, v2; +- UNITY_INT8 *p0, *p1, *p2; +- +- v0 = -128; +- v1 = 127; +- v2 = -128; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_INT8(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT8(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT8(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT8(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT8(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT8(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT8(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT8(*p0, *p2); +-} +- +-void testNotGreaterOrEqualINT8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_INT8(127, -128); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualCHAR(void) +-{ +- char v0, v1, v2; +- char *p0, *p1, *p2; +- +- v0 = -128; +- v1 = 127; +- v2 = -128; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, *p2); +-} +- +-void testNotGreaterOrEqualCHAR(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_CHAR(127, -128); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualINT16(void) +-{ +- UNITY_INT16 v0, v1, v2; +- UNITY_INT16 *p0, *p1, *p2; +- +- v0 = -32768; +- v1 = 32767; +- v2 = -32768; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_INT16(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT16(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT16(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT16(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT16(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT16(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT16(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT16(*p0, *p2); +-} +- +-void testNotGreaterOrEqualINT16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_INT16(32767, -32768); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualINT32(void) +-{ +- UNITY_INT32 v0, v1, v2; +- UNITY_INT32 *p0, *p1, *p2; +- +- v0 = -214783648; +- v1 = 214783647; +- v2 = -214783648; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_INT32(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT32(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT32(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT32(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_INT32(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT32(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT32(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_INT32(*p0, *p2); +-} +- +-void testNotGreaterOrEqualINT32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_INT32(214783647, -214783648); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualUINT(void) +-{ +- UNITY_UINT v0, v1, v2; +- UNITY_UINT *p0, *p1, *p2; +- +- v0 = 0; +- v1 = 1; +- v2 = 0; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_UINT(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT(*p0, *p2); +-} +- +-void testNotGreaterOrEqualUINT(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_UINT(1, 0); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualUINT8(void) +-{ +- UNITY_UINT8 v0, v1, v2; +- UNITY_UINT8 *p0, *p1, *p2; +- +- v0 = 0; +- v1 = 255; +- v2 = 0; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_UINT8(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT8(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT8(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT8(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT8(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT8(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT8(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT8(*p0, *p2); +-} +- +-void testNotGreaterOrEqualUINT8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_UINT8(255, 0); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualUINT16(void) +-{ +- UNITY_UINT16 v0, v1, v2; +- UNITY_UINT16 *p0, *p1, *p2; +- +- v0 = 0; +- v1 = 65535; +- v2 = 0; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_UINT16(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT16(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT16(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT16(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT16(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT16(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT16(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT16(*p0, *p2); +-} +- +-void testNotGreaterOrEqualUINT16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_UINT16(65535, 0); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualUINT32(void) +-{ +- UNITY_UINT32 v0, v1, v2; +- UNITY_UINT32 *p0, *p1, *p2; +- +- v0 = 0; +- v1 = 4294967295u; +- v2 = 0; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_UINT32(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT32(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT32(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT32(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT32(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT32(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT32(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_UINT32(*p0, *p2); +-} +- +-void testNotGreaterOrEqualUINT32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_UINT32(4294967295u, 0); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualHEX8(void) +-{ +- UNITY_UINT8 v0, v1, v2; +- UNITY_UINT8 *p0, *p1, *p2; +- +- v0 = 0x00; +- v1 = 0xFF; +- v2 = 0x00; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_HEX8(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX8(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX8(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX8(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX8(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX8(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX8(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX8(*p0, *p2); +-} +- +-void testNotGreaterOrEqualHEX8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_HEX8(0xFF, 0x00); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualHEX16(void) +-{ +- UNITY_UINT16 v0, v1, v2; +- UNITY_UINT16 *p0, *p1, *p2; +- +- v0 = 0x0000; +- v1 = 0xFFFF; +- v2 = 0x0000; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_HEX16(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX16(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX16(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX16(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX16(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX16(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX16(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX16(*p0, *p2); +-} +- +-void testNotGreaterOrEqualHEX16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_HEX16(0xFFFF, 0x00); +- VERIFY_FAILS_END +-} +- +-void testGreaterOrEqualHEX32(void) +-{ +- UNITY_UINT32 v0, v1, v2; +- UNITY_UINT32 *p0, *p1, *p2; +- +- v0 = 0x00000000; +- v1 = 0xFFFFFFFF; +- v2 = 0x00000000; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_GREATER_OR_EQUAL_HEX32(v0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX32(*p0, v1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX32(v0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX32(*p0, *p1); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX32(v0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX32(*p0, v2); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX32(v0, *p2); +- TEST_ASSERT_GREATER_OR_EQUAL_HEX32(*p0, *p2); +-} +- +-void testNotGreaterOrEqualHEX32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_GREATER_OR_EQUAL_HEX32(0xFFFFFFFF, 0x00); +- VERIFY_FAILS_END +-} +- +-/*-----------------*/ +- +-void testLessThan(void) +-{ +- UNITY_INT v0, v1; +- UNITY_INT *p0, *p1; +- +- v0 = 0; +- v1 = -1; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN(v0, v1); +- TEST_ASSERT_LESS_THAN(*p0, v1); +- TEST_ASSERT_LESS_THAN(v0, *p1); +- TEST_ASSERT_LESS_THAN(*p0, *p1); +-} +- +-void testNotLessThan(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN(0, 1); +- VERIFY_FAILS_END +-} +- +-void testLessThanINT(void) +-{ +- UNITY_INT v0, v1; +- UNITY_INT *p0, *p1; +- +- v0 = 3334; +- v1 = 302; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_INT(v0, v1); +- TEST_ASSERT_LESS_THAN_INT(*p0, v1); +- TEST_ASSERT_LESS_THAN_INT(v0, *p1); +- TEST_ASSERT_LESS_THAN_INT(*p0, *p1); +-} +- +-void testNotLessThanINT(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_INT(302, 3334); +- VERIFY_FAILS_END +-} +- +-void testLessThanINT8(void) +-{ +- UNITY_INT8 v0, v1; +- UNITY_INT8 *p0, *p1; +- +- v0 = 127; +- v1 = -128; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_INT8(v0, v1); +- TEST_ASSERT_LESS_THAN_INT8(*p0, v1); +- TEST_ASSERT_LESS_THAN_INT8(v0, *p1); +- TEST_ASSERT_LESS_THAN_INT8(*p0, *p1); +-} +- +-void testNotLessThanINT8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_INT8(-128, 127); +- VERIFY_FAILS_END +-} +- +-void testLessThanCHAR(void) +-{ +- char v0, v1; +- char *p0, *p1; +- +- v0 = 127; +- v1 = -128; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_CHAR(v0, v1); +- TEST_ASSERT_LESS_THAN_CHAR(*p0, v1); +- TEST_ASSERT_LESS_THAN_CHAR(v0, *p1); +- TEST_ASSERT_LESS_THAN_CHAR(*p0, *p1); +-} +- +-void testNotLessThanCHAR(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_CHAR(-128, 127); +- VERIFY_FAILS_END +-} +- +-void testLessThanINT16(void) +-{ +- UNITY_INT16 v0, v1; +- UNITY_INT16 *p0, *p1; +- +- v0 = 32767; +- v1 = -32768; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_INT16(v0, v1); +- TEST_ASSERT_LESS_THAN_INT16(*p0, v1); +- TEST_ASSERT_LESS_THAN_INT16(v0, *p1); +- TEST_ASSERT_LESS_THAN_INT16(*p0, *p1); +-} +- +-void testNotLessThanINT16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_INT16(-32768, 32767); +- VERIFY_FAILS_END +-} +- +-void testLessThanINT32(void) +-{ +- UNITY_INT32 v0, v1; +- UNITY_INT32 *p0, *p1; +- +- v0 = 214783647; +- v1 = -214783648; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_INT32(v0, v1); +- TEST_ASSERT_LESS_THAN_INT32(*p0, v1); +- TEST_ASSERT_LESS_THAN_INT32(v0, *p1); +- TEST_ASSERT_LESS_THAN_INT32(*p0, *p1); +-} +- +-void testNotLessThanINT32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_INT32(-214783648, 214783647); +- VERIFY_FAILS_END +-} +- +-void testLessThanUINT(void) +-{ +- UNITY_UINT v0, v1; +- UNITY_UINT *p0, *p1; +- +- v0 = 1; +- v1 = 0; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_UINT(v0, v1); +- TEST_ASSERT_LESS_THAN_UINT(*p0, v1); +- TEST_ASSERT_LESS_THAN_UINT(v0, *p1); +- TEST_ASSERT_LESS_THAN_UINT(*p0, *p1); +-} +- +-void testNotLessThanUINT(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_UINT(0, 1); +- VERIFY_FAILS_END +-} +- +-void testLessThanUINT8(void) +-{ +- UNITY_UINT8 v0, v1; +- UNITY_UINT8 *p0, *p1; +- +- v0 = 255; +- v1 = 0; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_UINT8(v0, v1); +- TEST_ASSERT_LESS_THAN_UINT8(*p0, v1); +- TEST_ASSERT_LESS_THAN_UINT8(v0, *p1); +- TEST_ASSERT_LESS_THAN_UINT8(*p0, *p1); +-} +- +-void testNotLessThanUINT8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_UINT8(0, 255); +- VERIFY_FAILS_END +-} +- +-void testLessThanUINT16(void) +-{ +- UNITY_UINT16 v0, v1; +- UNITY_UINT16 *p0, *p1; +- +- v0 = 65535; +- v1 = 0; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_UINT16(v0, v1); +- TEST_ASSERT_LESS_THAN_UINT16(*p0, v1); +- TEST_ASSERT_LESS_THAN_UINT16(v0, *p1); +- TEST_ASSERT_LESS_THAN_UINT16(*p0, *p1); +-} +- +-void testNotLessThanUINT16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_UINT16(0, 65535); +- VERIFY_FAILS_END +-} +- +-void testLessThanUINT32(void) +-{ +- UNITY_UINT32 v0, v1; +- UNITY_UINT32 *p0, *p1; +- +- v0 = 4294967295u; +- v1 = 0; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_UINT32(v0, v1); +- TEST_ASSERT_LESS_THAN_UINT32(*p0, v1); +- TEST_ASSERT_LESS_THAN_UINT32(v0, *p1); +- TEST_ASSERT_LESS_THAN_UINT32(*p0, *p1); +-} +- +-void testNotLessThanUINT32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_UINT32(0, 4294967295u); +- VERIFY_FAILS_END +-} +- +-void testLessThanHEX8(void) +-{ +- UNITY_UINT8 v0, v1; +- UNITY_UINT8 *p0, *p1; +- +- v0 = 0xFF; +- v1 = 0x00; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_HEX8(v0, v1); +- TEST_ASSERT_LESS_THAN_HEX8(*p0, v1); +- TEST_ASSERT_LESS_THAN_HEX8(v0, *p1); +- TEST_ASSERT_LESS_THAN_HEX8(*p0, *p1); +-} +- +-void testNotLessThanHEX8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_HEX8(0x00, 0xFF); +- VERIFY_FAILS_END +-} +- +-void testLessThanHEX16(void) +-{ +- UNITY_UINT16 v0, v1; +- UNITY_UINT16 *p0, *p1; +- +- v0 = 0xFFFF; +- v1 = 0x0000; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_HEX16(v0, v1); +- TEST_ASSERT_LESS_THAN_HEX16(*p0, v1); +- TEST_ASSERT_LESS_THAN_HEX16(v0, *p1); +- TEST_ASSERT_LESS_THAN_HEX16(*p0, *p1); +-} +- +-void testNotLessThanHEX16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_HEX16(0x0000, 0xFFFF); +- VERIFY_FAILS_END +-} +- +-void testLessThanHEX32(void) +-{ +- UNITY_UINT32 v0, v1; +- UNITY_UINT32 *p0, *p1; +- +- v0 = 0xFFFFFFFF; +- v1 = 0x00000000; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_LESS_THAN_HEX32(v0, v1); +- TEST_ASSERT_LESS_THAN_HEX32(*p0, v1); +- TEST_ASSERT_LESS_THAN_HEX32(v0, *p1); +- TEST_ASSERT_LESS_THAN_HEX32(*p0, *p1); +-} +- +-void testNotLessThanHEX32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_THAN_HEX32(0x00000000, 0xFFFFFFFF); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqual(void) +-{ +- UNITY_INT v0, v1, v2; +- UNITY_INT *p0, *p1, *p2; +- +- v0 = 0; +- v1 = -1; +- v2 = 0; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL(*p0, *p2); +-} +- +-void testNotLessOrEqual(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL(0, 1); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualINT(void) +-{ +- UNITY_INT v0, v1, v2; +- UNITY_INT *p0, *p1, *p2; +- +- v0 = 3334; +- v1 = 302; +- v2 = 3334; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_INT(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_INT(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_INT(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_INT(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_INT(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_INT(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_INT(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_INT(*p0, *p2); +-} +- +-void testNotLessOrEqualINT(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_INT(302, 3334); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualINT8(void) +-{ +- UNITY_INT8 v0, v1, v2; +- UNITY_INT8 *p0, *p1, *p2; +- +- v0 = 127; +- v1 = -128; +- v2 = 127; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_INT8(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_INT8(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_INT8(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_INT8(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_INT8(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_INT8(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_INT8(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_INT8(*p0, *p2); +-} +- +-void testNotLessOrEqualINT8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_INT8(-128, 127); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualCHAR(void) +-{ +- char v0, v1, v2; +- char *p0, *p1, *p2; +- +- v0 = 127; +- v1 = -128; +- v2 = 127; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, *p2); +-} +- +-void testNotLessOrEqualCHAR(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_CHAR(-128, 127); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualINT16(void) +-{ +- UNITY_INT16 v0, v1, v2; +- UNITY_INT16 *p0, *p1, *p2; +- +- v0 = 32767; +- v1 = -32768; +- v2 = 32767; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_INT16(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_INT16(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_INT16(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_INT16(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_INT16(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_INT16(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_INT16(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_INT16(*p0, *p2); +-} +- +-void testNotLessOrEqualINT16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_INT16(-32768, 32767); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualINT32(void) +-{ +- UNITY_INT32 v0, v1, v2; +- UNITY_INT32 *p0, *p1, *p2; +- +- v0 = 214783647; +- v1 = -214783648; +- v2 = 214783647; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_INT32(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_INT32(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_INT32(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_INT32(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_INT32(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_INT32(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_INT32(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_INT32(*p0, *p2); +-} +- +-void testNotLessOrEqualINT32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_INT32(-214783648, 214783647); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualUINT(void) +-{ +- UNITY_UINT v0, v1, v2; +- UNITY_UINT *p0, *p1, *p2; +- +- v0 = 1; +- v1 = 0; +- v2 = 1; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_UINT(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT(*p0, *p2); +-} +- +-void testNotLessOrEqualUINT(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_UINT(0, 1); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualUINT8(void) +-{ +- UNITY_UINT8 v0, v1, v2; +- UNITY_UINT8 *p0, *p1, *p2; +- +- v0 = 255; +- v1 = 0; +- v2 = 255; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_UINT8(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT8(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT8(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT8(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT8(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT8(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT8(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT8(*p0, *p2); +-} +- +-void testNotLessOrEqualUINT8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_UINT8(0, 255); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualUINT16(void) +-{ +- UNITY_UINT16 v0, v1, v2; +- UNITY_UINT16 *p0, *p1, *p2; +- +- v0 = 65535; +- v1 = 0; +- v2 = 65535; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_UINT16(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT16(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT16(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT16(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT16(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT16(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT16(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT16(*p0, *p2); +-} +- +-void testNotLessOrEqualUINT16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_UINT16(0, 65535); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualUINT32(void) +-{ +- UNITY_UINT32 v0, v1, v2; +- UNITY_UINT32 *p0, *p1, *p2; +- +- v0 = 4294967295u; +- v1 = 0; +- v2 = 4294967295u; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(*p0, *p2); +-} +- +-void testNotLessOrEqualUINT32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_UINT32(0, 4294967295u); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualHEX8(void) +-{ +- UNITY_UINT8 v0, v1, v2; +- UNITY_UINT8 *p0, *p1, *p2; +- +- v0 = 0xFF; +- v1 = 0x00; +- v2 = 0xFF; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_HEX8(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX8(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX8(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX8(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX8(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_HEX8(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_HEX8(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_HEX8(*p0, *p2); +-} +- +-void testNotLessOrEqualHEX8(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_HEX8(0x00, 0xFF); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualHEX16(void) +-{ +- UNITY_UINT16 v0, v1, v2; +- UNITY_UINT16 *p0, *p1, *p2; +- +- v0 = 0xFFFF; +- v1 = 0x0000; +- v2 = 0xFFFF; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_HEX16(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX16(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX16(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX16(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX16(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_HEX16(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_HEX16(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_HEX16(*p0, *p2); +-} +- +-void testNotLessOrEqualHEX16(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_HEX16(0x0000, 0xFFFF); +- VERIFY_FAILS_END +-} +- +-void testLessOrEqualHEX32(void) +-{ +- UNITY_UINT32 v0, v1, v2; +- UNITY_UINT32 *p0, *p1, *p2; +- +- v0 = 0xFFFFFFFF; +- v1 = 0x00000000; +- v2 = 0xFFFFFFFF; +- p0 = &v0; +- p1 = &v1; +- p2 = &v2; +- +- TEST_ASSERT_LESS_OR_EQUAL_HEX32(v0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX32(*p0, v1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX32(v0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX32(*p0, *p1); +- TEST_ASSERT_LESS_OR_EQUAL_HEX32(v0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_HEX32(*p0, v2); +- TEST_ASSERT_LESS_OR_EQUAL_HEX32(v0, *p2); +- TEST_ASSERT_LESS_OR_EQUAL_HEX32(*p0, *p2); +-} +- +-void testNotLessOrEqualHEX32(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_LESS_OR_EQUAL_HEX32(0x00000000, 0xFFFFFFFF); +- VERIFY_FAILS_END +-} +- +-void testHexPrintsUpToMaxNumberOfNibbles(void) +-{ +-#ifndef USING_OUTPUT_SPY +- TEST_IGNORE(); +-#else +- startPutcharSpy(); +- UnityPrintNumberHex(0xBEE, 21); +- endPutcharSpy(); +-#ifdef UNITY_SUPPORT_64 +- TEST_ASSERT_EQUAL_INT(16, strlen(getBufferPutcharSpy())); +-#else +- TEST_ASSERT_EQUAL_INT( 8, strlen(getBufferPutcharSpy())); +-#endif +-#endif +-} +- +-void testPrintNumbers32(void) +-{ +-#ifndef USING_OUTPUT_SPY +- TEST_IGNORE_MESSAGE("Compile with '-D UNITY_OUTPUT_CHAR=putcharSpy' to enable print testing"); +-#else +- TEST_ASSERT_EQUAL_PRINT_NUMBERS("0", 0); +- TEST_ASSERT_EQUAL_PRINT_NUMBERS("1", 1); +- TEST_ASSERT_EQUAL_PRINT_NUMBERS("-1", -1); +- TEST_ASSERT_EQUAL_PRINT_NUMBERS("2000000000", 2000000000); +- TEST_ASSERT_EQUAL_PRINT_NUMBERS("-2147483648", (UNITY_INT32)0x80000000); +- TEST_ASSERT_EQUAL_PRINT_NUMBERS("-1", (UNITY_INT32)0xFFFFFFFF); +-#endif +-} +- +-void testPrintNumbersUnsigned32(void) +-{ +-#ifndef USING_OUTPUT_SPY +- TEST_IGNORE(); +-#else +- TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("0", 0); +- TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("1", 1); +- TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("1500000000", 1500000000); +- TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("2147483648", (UNITY_UINT32)0x80000000); +- TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("4294967295", (UNITY_UINT32)0xFFFFFFFF); +-#endif +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers_64.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers_64.c +deleted file mode 100644 +index e12566e830..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_integers_64.c ++++ /dev/null +@@ -1,773 +0,0 @@ +-/* ========================================== +- 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] +-========================================== */ +- +-#include "unity.h" +-#define TEST_INSTANCES +-#include "self_assessment_utils.h" +- +-static int SetToOneToFailInTearDown; +-static int SetToOneMeanWeAlreadyCheckedThisGuy; +- +-void setUp(void) +-{ +- SetToOneToFailInTearDown = 0; +- SetToOneMeanWeAlreadyCheckedThisGuy = 0; +-} +- +-void tearDown(void) +-{ +- endPutcharSpy(); /* Stop suppressing test output */ +- if (SetToOneToFailInTearDown == 1) +- { +- /* These will be skipped internally if already failed/ignored */ +- TEST_FAIL_MESSAGE("<= Failed in tearDown"); +- TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); +- } +- if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) +- { +- UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); +- UNITY_OUTPUT_CHAR('\n'); +- } +-} +- +-void testInt64ArrayWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualSmallDelta[] = {12345001, -12344996, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- TEST_ASSERT_INT64_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); +-#endif +-} +- +-void testInt64ArrayWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualSmallDelta[] = {12345001, -12344996, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); +-#endif +-} +- +-void tesUInt64ArrayNotWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayNotWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaPointless(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaPointlessAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaExpectedNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaActualNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, NULL, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaActualNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testInt64ArrayWithinDeltaSamePointer(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, expected, 3); +-#endif +-} +- +-void testInt64ArrayWithinDeltaSamePointerAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; +- +- TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); +-#endif +-} +- +-void testUInt64ArrayWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualSmallDelta[] = {12345001, 12344996, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualSmallDelta, 3); +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); +-#endif +-} +- +-void testUInt64ArrayWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualSmallDelta[] = {12345001, 12344996, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); +-#endif +-} +- +-void testUInt64ArrayNotWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayNotWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaPointless(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaPointlessAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaExpectedNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaActualNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, NULL, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaActualNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUInt64ArrayWithinDeltaSamePointer(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- +- TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, expected, 3); +-#endif +-} +- +-void testUInt64ArrayWithinDeltaSamePointerAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; +- +- TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, expected, 3, "Custom Message."); +-#endif +-} +- +-void testHEX64ArrayWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualSmallDelta[] = {0xABCD123500000000, 0xABCD112100000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x100000000, expected, actualSmallDelta, 3); +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, actualBigDelta, 3); +-#endif +-} +- +-void testHEX64ArrayWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualSmallDelta[] = {0xABCD123500000000, 0xABCD112100000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x100000000, expected, actualSmallDelta, 3, "Custom Message."); +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, actualBigDelta, 3, "Custom Message."); +-#endif +-} +- +-void testHEX64ArrayNotWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x100000000, expected, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayNotWithinDeltaAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x100000000, expected, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaPointless(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, actualBigDelta, 0); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaPointlessAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, actualBigDelta, 0, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaExpectedNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, NULL, actualBigDelta, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaExpectedNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 actualBigDelta[] = {0xABCD126700000000, 0xABCD118800000000, 0xABCD12AC00000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, NULL, actualBigDelta, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaActualNull(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, NULL, 3); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaActualNullAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, NULL, 3, "Custom Message."); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64ArrayWithinDeltaSamePointer(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- +- TEST_ASSERT_HEX64_ARRAY_WITHIN(0x6E00000000, expected, expected, 3); +-#endif +-} +- +-void testHEX64ArrayWithinDeltaSamePointerAndMessage(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 expected[] = {0xABCD123400000000, 0xABCD112200000000, 0xABCD127700000000}; +- +- TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(0x6E00000000, expected, expected, 3, "Custom Message."); +-#endif +-} +- +-void testEqualHex64s(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 v0, v1; +- UNITY_UINT64 *p0, *p1; +- +- v0 = 0x9876543201234567; +- v1 = 0x9876543201234567; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_HEX64(0x9876543201234567, 0x9876543201234567); +- TEST_ASSERT_EQUAL_HEX64(v0, v1); +- TEST_ASSERT_EQUAL_HEX64(0x9876543201234567, v1); +- TEST_ASSERT_EQUAL_HEX64(v0, 0x9876543201234567); +- TEST_ASSERT_EQUAL_HEX64(*p0, v1); +- TEST_ASSERT_EQUAL_HEX64(*p0, *p1); +- TEST_ASSERT_EQUAL_HEX64(*p0, 0x9876543201234567); +-#endif +-} +- +-void testEqualUint64s(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 v0, v1; +- UNITY_UINT64 *p0, *p1; +- +- v0 = 0x9876543201234567; +- v1 = 0x9876543201234567; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_UINT64(0x9876543201234567, 0x9876543201234567); +- TEST_ASSERT_EQUAL_UINT64(v0, v1); +- TEST_ASSERT_EQUAL_UINT64(0x9876543201234567, v1); +- TEST_ASSERT_EQUAL_UINT64(v0, 0x9876543201234567); +- TEST_ASSERT_EQUAL_UINT64(*p0, v1); +- TEST_ASSERT_EQUAL_UINT64(*p0, *p1); +- TEST_ASSERT_EQUAL_UINT64(*p0, 0x9876543201234567); +-#endif +-} +- +-void testEqualInt64s(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 v0, v1; +- UNITY_INT64 *p0, *p1; +- +- v0 = (UNITY_INT64)0x9876543201234567; +- v1 = (UNITY_INT64)0x9876543201234567; +- p0 = &v0; +- p1 = &v1; +- +- TEST_ASSERT_EQUAL_INT64(0x9876543201234567, 0x9876543201234567); +- TEST_ASSERT_EQUAL_INT64(v0, v1); +- TEST_ASSERT_EQUAL_INT64(0x9876543201234567, v1); +- TEST_ASSERT_EQUAL_INT64(v0, 0x9876543201234567); +- TEST_ASSERT_EQUAL_INT64(*p0, v1); +- TEST_ASSERT_EQUAL_INT64(*p0, *p1); +- TEST_ASSERT_EQUAL_INT64(*p0, 0x9876543201234567); +-#endif +-} +- +- +-void testNotEqualHex64s(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 v0, v1; +- +- v0 = 9000000000; +- v1 = 9100000000; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX64(v0, v1); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualUint64s(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_UINT64 v0, v1; +- +- v0 = 9000000000; +- v1 = 9100000000; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_UINT64(v0, v1); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualInt64s(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 v0, v1; +- +- v0 = -9000000000; +- v1 = 9100000000; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_INT64(v0, v1); +- VERIFY_FAILS_END +-#endif +-} +- +-void testNotEqualHex64sIfSigned(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- UNITY_INT64 v0, v1; +- +- v0 = -9000000000; +- v1 = 9000000000; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_HEX64(v0, v1); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64sWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- TEST_ASSERT_HEX64_WITHIN(1, 0x7FFFFFFFFFFFFFFF,0x7FFFFFFFFFFFFFFE); +- TEST_ASSERT_HEX64_WITHIN(5, 5000, 4996); +- TEST_ASSERT_HEX64_WITHIN(5, 5000, 5005); +-#endif +-} +- +-void testHEX64sNotWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_WITHIN(1, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFC); +- VERIFY_FAILS_END +-#endif +-} +- +-void testHEX64sNotWithinDeltaEvenThoughASignedIntWouldPass(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_HEX64_WITHIN(5, 1, -1); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUINT64sWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- TEST_ASSERT_UINT64_WITHIN(1, 0x7FFFFFFFFFFFFFFF,0x7FFFFFFFFFFFFFFE); +- TEST_ASSERT_UINT64_WITHIN(5, 5000, 4996); +- TEST_ASSERT_UINT64_WITHIN(5, 5000, 5005); +-#endif +-} +- +-void testUINT64sNotWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_WITHIN(1, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFC); +- VERIFY_FAILS_END +-#endif +-} +- +-void testUINT64sNotWithinDeltaEvenThoughASignedIntWouldPass(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_UINT64_WITHIN(5, 1, -1); +- VERIFY_FAILS_END +-#endif +-} +- +-void testINT64sWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- TEST_ASSERT_INT64_WITHIN(1, 0x7FFFFFFFFFFFFFFF,0x7FFFFFFFFFFFFFFE); +- TEST_ASSERT_INT64_WITHIN(5, 5000, 4996); +- TEST_ASSERT_INT64_WITHIN(5, 5000, 5005); +-#endif +-} +- +-void testINT64sNotWithinDelta(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_WITHIN(1, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFC); +- VERIFY_FAILS_END +-#endif +-} +- +-void testINT64sNotWithinDeltaAndDifferenceOverflows(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_INT64_WITHIN(1, 0x8000000000000000, 0x7FFFFFFFFFFFFFFF); +- VERIFY_FAILS_END +-#endif +-} +- +-void testPrintNumbersInt64(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- #ifndef USING_OUTPUT_SPY +- TEST_IGNORE(); +- #else +- TEST_ASSERT_EQUAL_PRINT_NUMBERS("0", 0); +- TEST_ASSERT_EQUAL_PRINT_NUMBERS("10000000000", 10000000000); +- TEST_ASSERT_EQUAL_PRINT_NUMBERS("-9223372036854775808", (UNITY_INT)0x8000000000000000); +- TEST_ASSERT_EQUAL_PRINT_NUMBERS("-1", (UNITY_INT)0xFFFFFFFFFFFFFFFF); +- #endif +-#endif +-} +- +-void testPrintNumbersUInt64(void) +-{ +-#ifndef UNITY_SUPPORT_64 +- TEST_IGNORE(); +-#else +- #ifndef USING_OUTPUT_SPY +- TEST_IGNORE(); +- #else +- TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("0", 0); +- TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("70000000000", 70000000000); +- TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("9223372036854775808", (UNITY_UINT)0x8000000000000000); +- TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS("18446744073709551615", (UNITY_UINT)0xFFFFFFFFFFFFFFFF); +- #endif +-#endif +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_memory.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_memory.c +deleted file mode 100644 +index b3cff1319b..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_memory.c ++++ /dev/null +@@ -1,81 +0,0 @@ +-/* ========================================== +- 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] +-========================================== */ +- +-#include "unity.h" +-#define TEST_INSTANCES +-#include "self_assessment_utils.h" +- +-static int SetToOneToFailInTearDown; +-static int SetToOneMeanWeAlreadyCheckedThisGuy; +- +-void setUp(void) +-{ +- SetToOneToFailInTearDown = 0; +- SetToOneMeanWeAlreadyCheckedThisGuy = 0; +-} +- +-void tearDown(void) +-{ +- endPutcharSpy(); /* Stop suppressing test output */ +- if (SetToOneToFailInTearDown == 1) +- { +- /* These will be skipped internally if already failed/ignored */ +- TEST_FAIL_MESSAGE("<= Failed in tearDown"); +- TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); +- } +- if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) +- { +- UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); +- UNITY_OUTPUT_CHAR('\n'); +- } +-} +- +-void testEqualMemory(void) +-{ +- const char *testString = "whatever"; +- +- TEST_ASSERT_EQUAL_MEMORY(testString, testString, 8); +- TEST_ASSERT_EQUAL_MEMORY("whatever", "whatever", 8); +- TEST_ASSERT_EQUAL_MEMORY("whatever", testString, 8); +- TEST_ASSERT_EQUAL_MEMORY(testString, "whatever", 8); +- TEST_ASSERT_EQUAL_MEMORY(testString, "whatever", 2); +- TEST_ASSERT_EQUAL_MEMORY(NULL, NULL, 1); +-} +- +-void testNotEqualMemory1(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_MEMORY("foo", "bar", 3); +- VERIFY_FAILS_END +-} +- +-void testNotEqualMemory2(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_MEMORY("fool", "food", 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualMemory3(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_MEMORY(NULL, "food", 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualMemory4(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_MEMORY("fool", NULL, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualMemoryLengthZero(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_MEMORY(NULL, NULL, 0); +- VERIFY_FAILS_END +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_parameterized.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_parameterized.c +deleted file mode 100644 +index 3129817e98..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_parameterized.c ++++ /dev/null +@@ -1,171 +0,0 @@ +-/* ========================================== +- 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] +-========================================== */ +- +-#include +-#include +-#include "unity.h" +- +-/* Support for Meta Test Rig */ +-#define TEST_CASE(...) +- +-/* Include Passthroughs for Linking Tests */ +-void putcharSpy(int c) { (void)putchar(c);} +-void flushSpy(void) {} +- +-#define EXPECT_ABORT_BEGIN \ +- if (TEST_PROTECT()) \ +- { +- +-#define VERIFY_FAILS_END \ +- } \ +- Unity.CurrentTestFailed = (Unity.CurrentTestFailed != 0) ? 0 : 1; \ +- if (Unity.CurrentTestFailed == 1) { \ +- SetToOneMeanWeAlreadyCheckedThisGuy = 1; \ +- UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \ +- UNITY_OUTPUT_CHAR(':'); \ +- UnityPrint(Unity.CurrentTestName); \ +- UnityPrint(":FAIL: [[[[ Test Should Have Failed But Did Not ]]]]"); \ +- UNITY_OUTPUT_CHAR('\n'); \ +- } +- +-#define VERIFY_IGNORES_END \ +- } \ +- Unity.CurrentTestFailed = (Unity.CurrentTestIgnored != 0) ? 0 : 1; \ +- Unity.CurrentTestIgnored = 0; \ +- if (Unity.CurrentTestFailed == 1) { \ +- SetToOneMeanWeAlreadyCheckedThisGuy = 1; \ +- UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \ +- UNITY_OUTPUT_CHAR(':'); \ +- UnityPrint(Unity.CurrentTestName); \ +- UnityPrint(":FAIL: [[[[ Test Should Have Ignored But Did Not ]]]]"); \ +- UNITY_OUTPUT_CHAR('\n'); \ +- } +- +-static int SetToOneToFailInTearDown; +-static int SetToOneMeanWeAlreadyCheckedThisGuy; +-static unsigned NextExpectedStringIndex; +-static unsigned NextExpectedCharIndex; +- +-void suiteSetUp(void) +-{ +- NextExpectedStringIndex = 0; +- NextExpectedCharIndex = 0; +-} +- +-void setUp(void) +-{ +- SetToOneToFailInTearDown = 0; +- SetToOneMeanWeAlreadyCheckedThisGuy = 0; +-} +- +-void tearDown(void) +-{ +- if (SetToOneToFailInTearDown == 1) +- TEST_FAIL_MESSAGE("<= Failed in tearDown"); +- if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) +- { +- UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); +- UNITY_OUTPUT_CHAR('\n'); +- } +-} +- +-TEST_CASE(0) +-TEST_CASE(44) +-TEST_CASE((90)+9) +-void test_TheseShouldAllPass(int Num) +-{ +- TEST_ASSERT_TRUE(Num < 100); +-} +- +-TEST_CASE(3) +-TEST_CASE(77) +-TEST_CASE( (99) + 1 - (1)) +-void test_TheseShouldAllFail(int Num) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_TRUE(Num > 100); +- VERIFY_FAILS_END +-} +- +-TEST_CASE(1) +-TEST_CASE(44) +-TEST_CASE(99) +-TEST_CASE(98) +-void test_TheseAreEveryOther(int Num) +-{ +- if (Num & 1) +- { +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_TRUE(Num > 100); +- VERIFY_FAILS_END +- } +- else +- { +- TEST_ASSERT_TRUE(Num < 100); +- } +-} +- +-void test_NormalPassesStillWork(void) +-{ +- TEST_ASSERT_TRUE(1); +-} +- +-void test_NormalFailsStillWork(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_TRUE(0); +- VERIFY_FAILS_END +-} +- +-TEST_CASE(0, "abc") +-TEST_CASE(1, "{") +-TEST_CASE(2, "}") +-TEST_CASE(3, ";") +-TEST_CASE(4, "\"quoted\"") +-void test_StringsArePreserved(unsigned index, const char * str) +-{ +- static const char * const expected[] = +- { +- "abc", +- "{", +- "}", +- ";", +- "\"quoted\"" +- }; +- +- /* Ensure that no test cases are skipped by tracking the next expected index */ +- TEST_ASSERT_EQUAL_UINT32(NextExpectedStringIndex, index); +- TEST_ASSERT_LESS_THAN(sizeof(expected) / sizeof(expected[0]), index); +- TEST_ASSERT_EQUAL_STRING(expected[index], str); +- +- NextExpectedStringIndex++; +-} +- +-TEST_CASE(0, 'x') +-TEST_CASE(1, '{') +-TEST_CASE(2, '}') +-TEST_CASE(3, ';') +-TEST_CASE(4, '\'') +-TEST_CASE(5, '"') +-void test_CharsArePreserved(unsigned index, char c) +-{ +- static const char expected[] = +- { +- 'x', +- '{', +- '}', +- ';', +- '\'', +- '"' +- }; +- +- /* Ensure that no test cases are skipped by tracking the next expected index */ +- TEST_ASSERT_EQUAL_UINT32(NextExpectedCharIndex, index); +- TEST_ASSERT_LESS_THAN(sizeof(expected) / sizeof(expected[0]), index); +- TEST_ASSERT_EQUAL(expected[index], c); +- +- NextExpectedCharIndex++; +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_strings.c b/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_strings.c +deleted file mode 100644 +index 964c5536db..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/test/tests/test_unity_strings.c ++++ /dev/null +@@ -1,329 +0,0 @@ +-/* ========================================== +- 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] +-========================================== */ +- +-#include "unity.h" +-#define TEST_INSTANCES +-#include "self_assessment_utils.h" +- +-static int SetToOneToFailInTearDown; +-static int SetToOneMeanWeAlreadyCheckedThisGuy; +- +-void setUp(void) +-{ +- SetToOneToFailInTearDown = 0; +- SetToOneMeanWeAlreadyCheckedThisGuy = 0; +-} +- +-void tearDown(void) +-{ +- endPutcharSpy(); /* Stop suppressing test output */ +- if (SetToOneToFailInTearDown == 1) +- { +- /* These will be skipped internally if already failed/ignored */ +- TEST_FAIL_MESSAGE("<= Failed in tearDown"); +- TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); +- } +- if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) +- { +- UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); +- UNITY_OUTPUT_CHAR('\n'); +- } +-} +- +-void testEqualStrings(void) +-{ +- const char *testString = "foo"; +- +- TEST_ASSERT_EQUAL_STRING(testString, testString); +- TEST_ASSERT_EQUAL_STRING_MESSAGE("foo", "foo", "foo isn't foo"); +- TEST_ASSERT_EQUAL_STRING("foo", testString); +- TEST_ASSERT_EQUAL_STRING(testString, "foo"); +- TEST_ASSERT_EQUAL_STRING("", ""); +-} +- +-void testEqualStringsLen(void) +-{ +- const char *testString = "foobar"; +- TEST_ASSERT_EQUAL_STRING_LEN(testString, testString, strlen(testString)); +- TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE("foobar", "foobaz", 5, "fooba isn't fooba"); +- TEST_ASSERT_EQUAL_STRING_LEN("foo", testString, 3); +- TEST_ASSERT_EQUAL_STRING_LEN(testString, "foo", 3); +- TEST_ASSERT_EQUAL_STRING_LEN("", "", 3); +-} +- +-void testEqualStringsWithCarriageReturnsAndLineFeeds(void) +-{ +- const char *testString = "foo\r\nbar"; +- +- TEST_ASSERT_EQUAL_STRING(testString, testString); +- TEST_ASSERT_EQUAL_STRING("foo\r\nbar", "foo\r\nbar"); +- TEST_ASSERT_EQUAL_STRING("foo\r\nbar", testString); +- TEST_ASSERT_EQUAL_STRING(testString, "foo\r\nbar"); +- TEST_ASSERT_EQUAL_STRING("", ""); +-} +- +-void testNotEqualString1(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING("foo", "bar"); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringLen1(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_LEN("foobar", "foobaz", 6); +- VERIFY_FAILS_END +-} +- +-void testNotEqualString2(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING("foo", ""); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringLen2(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_LEN("foo", "", 3); +- VERIFY_FAILS_END +-} +- +-void testNotEqualString3(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING("", "bar"); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringLen3(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_LEN("", "bar", 3); +- VERIFY_FAILS_END +-} +- +-void testNotEqualString4(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING("bar\r", "bar\n"); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringLen4(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_LEN("ba\r\x16", "ba\r\n", 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualString5(void) +-{ +- const char str1[] = { 0x41, 0x42, 0x03, 0x00 }; +- const char str2[] = { 0x41, 0x42, 0x04, 0x00 }; +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING(str1, str2); +- VERIFY_FAILS_END +-} +- +-void testNotEqualString_ExpectedStringIsNull(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING(NULL, "bar"); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringLen_ExpectedStringIsNull(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_LEN(NULL, "bar", 1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualString_ActualStringIsNull(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING("foo", NULL); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringLen_ActualStringIsNull(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_LEN("foo", NULL, 1); +- VERIFY_FAILS_END +-} +- +-void testNotEqualString_ExpectedStringIsLonger(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING("foo2", "foo"); +- VERIFY_FAILS_END +-} +- +-void testNotEqualString_ActualStringIsLonger(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING("foo", "foo2"); +- VERIFY_FAILS_END +-} +- +-void testEqualStringArrays(void) +-{ +- const char *testStrings[] = { "foo", "boo", "woo", "moo" }; +- const char *expStrings[] = { "foo", "boo", "woo", "zoo" }; +- +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, expStrings, 3); +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 3); +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 2); +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 1); +-} +- +-void testNotEqualStringArray1(void) +-{ +- const char *testStrings[] = { "foo", "boo", "woo", "moo" }; +- const char *expStrings[] = { "foo", "boo", "woo", "zoo" }; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringArray2(void) +-{ +- const char *testStrings[] = { "zoo", "boo", "woo", "moo" }; +- const char *expStrings[] = { "foo", "boo", "woo", "moo" }; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringArray3(void) +-{ +- const char *testStrings[] = { "foo", "boo", "woo", NULL }; +- const char *expStrings[] = { "foo", "boo", "woo", "zoo" }; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringArray4(void) +-{ +- const char *testStrings[] = { "foo", "boo", "woo", "moo" }; +- const char *expStrings[] = { "foo", NULL, "woo", "moo" }; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringArray5(void) +-{ +- const char **testStrings = NULL; +- const char *expStrings[] = { "foo", "boo", "woo", "zoo" }; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringArray6(void) +-{ +- const char *testStrings[] = { "foo", "boo", "woo", "zoo" }; +- const char **expStrings = NULL; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); +- VERIFY_FAILS_END +-} +- +-void testEqualStringArrayIfBothNulls(void) +-{ +- const char **testStrings = NULL; +- const char **expStrings = NULL; +- +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 4); +-} +- +-void testNotEqualStringArrayLengthZero(void) +-{ +- const char *testStrings[] = {NULL}; +- const char **expStrings = NULL; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EQUAL_STRING_ARRAY(expStrings, testStrings, 0); +- VERIFY_FAILS_END +-} +- +-void testEqualStringEachEqual(void) +-{ +- const char *testStrings1[] = { "foo", "foo", "foo", "foo" }; +- const char *testStrings2[] = { "boo", "boo", "boo", "zoo" }; +- const char *testStrings3[] = { "", "", "", "" }; +- +- TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings1, 4); +- TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings1, 1); +- TEST_ASSERT_EACH_EQUAL_STRING("boo", testStrings2, 3); +- TEST_ASSERT_EACH_EQUAL_STRING("", testStrings3, 4); +-} +- +-void testNotEqualStringEachEqual1(void) +-{ +- const char *testStrings[] = { "foo", "foo", "foo", "moo" }; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringEachEqual2(void) +-{ +- const char *testStrings[] = { "boo", "foo", "foo", "foo" }; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringEachEqual3(void) +-{ +- const char *testStrings[] = { "foo", "foo", "foo", NULL }; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringEachEqual4(void) +-{ +- const char *testStrings[] = { "foo", "foo", "woo", "foo" }; +- +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_STRING("foo", testStrings, 4); +- VERIFY_FAILS_END +-} +- +-void testNotEqualStringEachEqual5(void) +-{ +- EXPECT_ABORT_BEGIN +- TEST_ASSERT_EACH_EQUAL_STRING("foo", NULL, 1); +- VERIFY_FAILS_END +-} +- +-void testCstringsEscapeSequence(void) +-{ +-#ifndef USING_OUTPUT_SPY +- TEST_IGNORE(); +-#else +- startPutcharSpy(); +- UnityPrint("\x16\x10"); +- endPutcharSpy(); +- TEST_ASSERT_EQUAL_STRING("\\x16\\x10", getBufferPutcharSpy()); +-#endif +-} +diff --git a/components/testframework/libs/cmock/vendor/unity/unityConfig.cmake b/components/testframework/libs/cmock/vendor/unity/unityConfig.cmake +deleted file mode 100644 +index 55410ccc8d..0000000000 +--- a/components/testframework/libs/cmock/vendor/unity/unityConfig.cmake ++++ /dev/null +@@ -1 +0,0 @@ +-include(${CMAKE_CURRENT_LIST_DIR}/unityTargets.cmake) +\ No newline at end of file +-- +2.43.0 + diff --git a/patches/UnifySDK/0003-tests-p-cmock-Add-0001-Added-array_as_byte-config-op.patch b/patches/UnifySDK/0003-tests-p-cmock-Add-0001-Added-array_as_byte-config-op.patch new file mode 100644 index 000000000..86d3df334 --- /dev/null +++ b/patches/UnifySDK/0003-tests-p-cmock-Add-0001-Added-array_as_byte-config-op.patch @@ -0,0 +1,118 @@ +From ce3b93c662d8cfff47c27410850197fc4fe42aa8 Mon Sep 17 00:00:00 2001 +From: Philippe Coval +Date: Fri, 14 Mar 2025 15:42:31 +0100 +Subject: [PATCH] tests: p/cmock: Add + 0001-Added-array_as_byte-config-options.patch + +This change is needed for testing libs2 which is using anynomous type +(struct S2) + +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-protocol-controller/issues/60 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/6 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-protocol-controller/issues/75 +Signed-off-by: Philippe Coval +--- + ...1-Added-array_as_byte-config-options.patch | 91 +++++++++++++++++++ + 1 file changed, 91 insertions(+) + create mode 100644 patches/cmock/0001-Added-array_as_byte-config-options.patch + +diff --git a/patches/cmock/0001-Added-array_as_byte-config-options.patch b/patches/cmock/0001-Added-array_as_byte-config-options.patch +new file mode 100644 +index 0000000000..e4ea529e9a +--- /dev/null ++++ b/patches/cmock/0001-Added-array_as_byte-config-options.patch +@@ -0,0 +1,91 @@ ++From 2b089523835cf0ab3c4ac66984ee7b02f21a6d9d Mon Sep 17 00:00:00 2001 ++From: Philippe Coval ++Date: Fri, 24 Apr 2020 14:05:54 +0200 ++Subject: [PATCH] Added array_as_byte config options. ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++[Anders Esbensen] ++ ++Option to check arrays by the number of bytes instead of number of elements. ++ ++[Philippe Coval] ++ ++This change was applied to a fork (ths_cmock) used in a Z-Wave project. ++It was needed to generate mocks from a header that used annonymous structures. ++ ++The observed issue was: ++ ++(...)_mock.c:486:123: error: invalid application of ‘sizeof’ to incomplete type ‘struct (...)’ ++ ++Which was just declared in relative header. ++ ++The array_as_byte feature prevent this error. ++ ++Author: Anders Esbensen ++Origin-Upstream: https://github.com/ThrowTheSwitch/CMock/pull/503 ++Origin-SiliconLabs: v2.5.1-74-ga078d10 ++Relate-to: https://github.com/SiliconLabsSoftware/z-wave-protocol-controller/issues/75 ++Signed-off-by: Philippe Coval ++--- ++ docs/CMock_Summary.md | 4 ++++ ++ lib/cmock_config.rb | 1 + ++ lib/cmock_generator_utils.rb | 7 ++++++- ++ 3 files changed, 11 insertions(+), 1 deletion(-) ++ ++diff --git a/docs/CMock_Summary.md b/docs/CMock_Summary.md ++index 3183665..5cb201c 100644 ++--- a/docs/CMock_Summary.md +++++ b/docs/CMock_Summary.md ++@@ -738,6 +738,10 @@ from the defaults. We've tried to specify what the defaults are below. ++ ++ GoBananas_ExpectWithArray(b, 2, 2); ++ +++ `:array_as_byte`: +++ When checking arrays, the element size will always be 1, ie depth is the number +++ of bytes to check. +++ ++ * `:fail_on_unexpected_calls`: ++ By default, CMock will fail a test if a mock is called without `_Expect` and `_Ignore` ++ called first. While this forces test writers to be more explicit in their expectations, ++diff --git a/lib/cmock_config.rb b/lib/cmock_config.rb ++index ccbf4dc..27cece4 100644 ++--- a/lib/cmock_config.rb +++++ b/lib/cmock_config.rb ++@@ -41,6 +41,7 @@ class CMockConfig ++ :orig_header_include_fmt => '#include "%s"', ++ :array_size_type => [], ++ :array_size_name => 'size|len', +++ :array_as_byte => false, ++ :skeleton => false, ++ :exclude_setjmp_h => false, ++ ++diff --git a/lib/cmock_generator_utils.rb b/lib/cmock_generator_utils.rb ++index 83e762f..6f0ddc8 100644 ++--- a/lib/cmock_generator_utils.rb +++++ b/lib/cmock_generator_utils.rb ++@@ -21,6 +21,7 @@ class CMockGeneratorUtils ++ @ignore_stateless = @config.plugins.include? :ignore_stateless ++ @treat_as = @config.treat_as ++ @helpers = helpers +++ @array_as_byte = @config.array_as_byte ++ end ++ ++ def self.arg_type_with_const(arg) ++@@ -230,7 +231,11 @@ class CMockGeneratorUtils ++ lines << " { UNITY_TEST_ASSERT_NULL(#{arg_name}, cmock_line, CMockStringExpNULL); }\n" ++ lines << (depth_name != 1 ? " else if (#{depth_name} == 0)\n { UNITY_TEST_ASSERT_EQUAL_PTR(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch); }\n" : '') ++ lines << " else\n" ++- lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), #{depth_name}, cmock_line, CMockStringMismatch); }\n" +++ if @array_as_byte +++ lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), 1, #{depth_name}, cmock_line, CMockStringMismatch); }\n" +++ else +++ lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*', '')}), #{depth_name}, cmock_line, CMockStringMismatch); }\n" +++ end ++ end ++ when /_ARRAY/ ++ if pre == '&' ++-- ++2.39.5 ++ +-- +2.43.0 + diff --git a/patches/UnifySDK/0004-tests-build-cmake-Use-Upstream-cmock.patch b/patches/UnifySDK/0004-tests-build-cmake-Use-Upstream-cmock.patch new file mode 100644 index 000000000..04fb3fdbd --- /dev/null +++ b/patches/UnifySDK/0004-tests-build-cmake-Use-Upstream-cmock.patch @@ -0,0 +1,191 @@ +From f838d67ddc1b2975271ca1193dd0cd72804aa07d Mon Sep 17 00:00:00 2001 +From: Philippe Coval +Date: Thu, 6 Feb 2025 10:31:19 +0100 +Subject: [PATCH] tests: build: cmake: Use Upstream cmock + +Not this is not latest version but it aligned to the version used at zwa, +may unify-core align to it and synchronize all projects accordingly, +or reconsider the archtecture. + +cmake: Adjust cmock config + +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-protocol-controller/issues/60 +Bug-SiliconLabs: SWPROT-8953 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/6 +Signed-off-by: Philippe Coval +--- + CMakeLists.txt | 3 + + cmake/modules/FindCMock.cmake | 58 +++++++++++++++++++ + .../libs/testframework/CMakeLists.txt | 32 ++++++++-- + .../testframework/target_add_unittest.cmake | 26 ++++----- + 4 files changed, 100 insertions(+), 19 deletions(-) + create mode 100644 cmake/modules/FindCMock.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1f3b5dcdfa..95951d40cb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,6 +43,9 @@ include(cmake/include/package-helper.cmake) + include(cmake/include/uic_helper.cmake) + + if(BUILD_TESTING) ++ include(cmake/modules/FindCMock.cmake) ++ set(THS-CMOCK_LOCATION "${cmock_SOURCE_DIR}") ++ set(THS-UNITY_LOCATION "${cmock_SOURCE_DIR}/vendor/unity") + include(components/testframework/target_add_unittest.cmake) + endif() + +diff --git a/cmake/modules/FindCMock.cmake b/cmake/modules/FindCMock.cmake +new file mode 100644 +index 0000000000..3a96950060 +--- /dev/null ++++ b/cmake/modules/FindCMock.cmake +@@ -0,0 +1,58 @@ ++# SPDX-FileCopyrightText: Silicon Laboratories Inc. ++# SPDX-License-Identifier: Zlib ++# ++# This recipe allows to download CMock ++# It can be used by projects which are depending on it ++# Feel free to copy this (up to date) file everywhere it is needed ++ ++include(FetchContent) ++ ++if(NOT DEFINED CMOCK_GIT_REPOSITORY) ++ if(DEFINED ENV{CMOCK_GIT_REPOSITORY}) ++ set(CMOCK_GIT_REPOSITORY $ENV{CMOCK_GIT_REPOSITORY}) ++ endif() ++endif() ++if("${CMOCK_GIT_REPOSITORY}" STREQUAL "") ++ set(CMOCK_GIT_REPOSITORY "https://github.com/ThrowTheSwitch/CMock") ++endif() ++ ++if(NOT DEFINED CMOCK_GIT_TAG) ++ if(DEFINED ENV{CMOCK_GIT_TAG}) ++ set(CMOCK_GIT_TAG $ENV{CMOCK_GIT_TAG}) ++ else() ++ set(CMOCK_GIT_TAG "v2.5.3") ++ endif() ++endif() ++ ++file(GLOB CMOCK_PATCHES ++ LIST_DIRECTORIES false ++ ${PROJECT_SOURCE_DIR}/patches/cmock/*.patch ++) ++ ++find_package(Git) ++FetchContent_Declare( ++ CMock ++ GIT_REPOSITORY ${CMOCK_GIT_REPOSITORY} ++ GIT_TAG ${CMOCK_GIT_TAG} ++ GIT_SUBMODULES_RECURSE True ++ GIT_SHALLOW 1 ++ ++ # Prevent "fatal: unable to auto-detect email address" ++ GIT_CONFIG user.email=nobody@${CMAKE_PROJECT_NAME}.localhost ++ ++ PATCH_COMMAND ${GIT_EXECUTABLE} ++ -C am --ignore-whitespace ++ "${CMOCK_PATCHES}" ++) ++ ++message(STATUS "${CMAKE_PROJECT_NAME}: Depends: ${CMOCK_GIT_REPOSITORY}#${CMOCK_GIT_TAG}") ++string(REGEX MATCH ".*/?main/?.*" CMOCK_UNSTABLE_GIT_TAG "${CMOCK_GIT_TAG}") ++if(CMOCK_GIT_TAG STREQUAL "" OR CMOCK_UNSTABLE_GIT_TAG) ++ message(WARNING "${CMAKE_PROJECT_NAME}: Declare CMOCK_GIT_TAG to stable version not: ${CMOCK_UNSTABLE_GIT_TAG}") ++endif() ++ ++set(FETCHCONTENT_QUIET FALSE) ++FetchContent_MakeAvailable(CMock) ++ ++message(STATUS "CMock Sources: ${cmock_SOURCE_DIR}") ++message(STATUS "CMock Binaries: ${cmock_BINARY_DIR}") +diff --git a/components/testframework/libs/testframework/CMakeLists.txt b/components/testframework/libs/testframework/CMakeLists.txt +index 66da6a46fe..afd5b65d7b 100644 +--- a/components/testframework/libs/testframework/CMakeLists.txt ++++ b/components/testframework/libs/testframework/CMakeLists.txt +@@ -103,14 +103,38 @@ if (NOT COMMAND ADD_UNITY_TEST) + endif() + endfunction(ADD_UNITY_TEST) + ++set(DEFAULT_THS-CMOCK_PATH libs/cmock) ++if(EXISTS ${THS-CMOCK_LOCATION}) ++ set(THS-CMOCK_PATH ${THS-CMOCK_LOCATION}) ++else() ++ set(THS-CMOCK_PATH ${DEFAULT_THS-CMOCK_PATH}) ++endif() ++if(EXISTS ${THS-CMOCK_PATH}) ++ message(STATUS "Found ths-cmock: ${THS-CMOCK_PATH}") ++else() ++ message(STATUS "Did not find ths-cmock at ${THS-CMOCK_PATH}") ++endif() ++ ++set(DEFAULT_THS-UNITY_PATH libs/cmock/vendor/unity) ++if(EXISTS ${THS-UNITY_LOCATION}) ++ set(THS-UNITY_PATH ${THS-UNITY_LOCATION}) ++else() ++ set(THS-UNITY_PATH ${DEFAULT_THS-UNITY_PATH}) ++endif() ++if(EXISTS ${THS-UNITY_PATH}) ++ message(STATUS "Found ths-unity: ${THS-UNITY_PATH}") ++else() ++ message(STATUS "Did not find ths-unity at ${THS-UNITY_PATH}") ++endif() ++ + # compile the unity version bundled along with cmock sources. +- add_library(unity ../cmock/vendor/unity/src/unity.c) +- target_include_directories(unity PUBLIC ../cmock/vendor/unity/src) ++ add_library(unity ${THS-UNITY_PATH}/src/unity.c) ++ target_include_directories(unity PUBLIC ${THS-UNITY_PATH}/src) + target_compile_options(unity PRIVATE "-fPIC") + + # Build the cmock library and link the above compiled unity with the cmock library +- add_library(cmock2 STATIC ../cmock/src/cmock.c) +- target_include_directories(cmock2 PUBLIC ../cmock/src) ++ add_library(cmock2 STATIC ${THS-CMOCK_PATH}/src/cmock.c) ++ target_include_directories(cmock2 PUBLIC ${THS-CMOCK_PATH}/src) + target_link_libraries(cmock2 PUBLIC unity) + target_compile_options(cmock2 PRIVATE "-fPIC") + +diff --git a/components/testframework/target_add_unittest.cmake b/components/testframework/target_add_unittest.cmake +index 7129c27dc6..267393ea7d 100644 +--- a/components/testframework/target_add_unittest.cmake ++++ b/components/testframework/target_add_unittest.cmake +@@ -24,24 +24,20 @@ function(generate_unity_runner test_runner test_file) + endif() + if(EXISTS ${THS-UNITY_LOCATION}) + set(UNITY_DIR ${THS-UNITY_LOCATION}) +- add_custom_command( +- OUTPUT ${TEST_RUNNER} +- DEPENDS ${TEST_FILE} +- COMMAND +- ${UNITY2_RUBY_EXECUTABLE} ${UNITY_DIR}/auto/generate_test_runner.rb +- ${ZWAVE_UNITY_CONFIG} ${TEST_FILE} ${TEST_RUNNER} +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + else() + set(UNITY_DIR "${DIR_OF_TARGET_ADD_UNIT_TEST}/libs/cmock/vendor/unity") +- add_custom_command( +- OUTPUT ${TEST_RUNNER} +- DEPENDS ${TEST_FILE} +- COMMAND +- ${UNITY2_RUBY_EXECUTABLE} ${UNITY_DIR}/auto/generate_test_runner.rb +- ${DIR_OF_TARGET_ADD_UNIT_TEST}/zwave_unity_config.yml ${TEST_FILE} +- ${TEST_RUNNER} +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + endif() ++ if(NOT DEFINED ${UNIFY_UNITY_RUNNER_CONFIG}) ++ set(UNIFY_UNITY_RUNNER_CONFIG ${DIR_OF_TARGET_ADD_UNIT_TEST}/zwave_unity_config.yml) ++ endif() ++ add_custom_command( ++ OUTPUT ${TEST_RUNNER} ++ DEPENDS ${TEST_FILE} ${UNIFY_UNITY_RUNNER_CONFIG} ++ COMMAND ++ ${UNITY2_RUBY_EXECUTABLE} ${UNITY_DIR}/auto/generate_test_runner.rb ++ ${UNIFY_UNITY_RUNNER_CONFIG} ++ ${TEST_FILE} ${TEST_RUNNER} ++ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + endfunction() + + # This function creates unity2 test executables. It uses the provided target to setup and import configuration +-- +2.43.0 + diff --git a/patches/UnifySDK/0005-git-Remove-.gitattributes.patch b/patches/UnifySDK/0005-git-Remove-.gitattributes.patch new file mode 100644 index 000000000..7ada5795d --- /dev/null +++ b/patches/UnifySDK/0005-git-Remove-.gitattributes.patch @@ -0,0 +1,45 @@ +From 0af42e72014d597fd0a51843286533f7da37a5bd Mon Sep 17 00:00:00 2001 +From: Philippe Coval +Date: Tue, 18 Mar 2025 14:04:40 +0100 +Subject: [PATCH] git: Remove .gitattributes + +This change allow building UnifySDK on github. + +Removing LFS objects is a good start to slim down UnifySDK repo + +Observed issue: + + (...) + #11 538.0 100% tests passed, 0 tests failed out of 69 + #11 538.0 Total Test time (real) = 287.70 sec + #11 538.0 cmake --build build --target package + (...) + #11 538.2 [2/3] Run CPack packaging tool... + #11 538.2 CPack: Create package using DEB + #11 538.2 CPack: Install projects + #11 538.2 CPack: - Install project: uic [] + #11 538.2 CPack: - Install component: libunify-dev + #11 538.7 CMake Error at /usr/local/opt/unifysdk/build/components/cmake_install.cmake:195 (file): + #11 538.7 file INSTALL cannot copy file + +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/11 +Signed-off-by: Philippe Coval +--- + .gitattributes | 5 ----- + 1 file changed, 5 deletions(-) + delete mode 100644 .gitattributes + +diff --git a/.gitattributes b/.gitattributes +deleted file mode 100644 +index aa8de78071..0000000000 +--- a/.gitattributes ++++ /dev/null +@@ -1,5 +0,0 @@ +-"zap-2022.1.10.dmg" filter=lfs diff=lfs merge=lfs -text +-"slc_cli_mac.zip" filter=lfs diff=lfs merge=lfs -text +-"zap_apack_mac.zip" filter=lfs diff=lfs merge=lfs -text +-"slc_cli_linux.zip" filter=lfs diff=lfs merge=lfs -text +-"zap_apack_linux.zip" filter=lfs diff=lfs merge=lfs -text +-- +2.43.0 + diff --git a/patches/UnifySDK/0006-git-docker-uic-resources-Removed-as-not-part-of-Unif.patch b/patches/UnifySDK/0006-git-docker-uic-resources-Removed-as-not-part-of-Unif.patch new file mode 100644 index 000000000..a49240252 --- /dev/null +++ b/patches/UnifySDK/0006-git-docker-uic-resources-Removed-as-not-part-of-Unif.patch @@ -0,0 +1,156 @@ +From 17df372b7ecbf2df59fbe52458bdceff38444bf3 Mon Sep 17 00:00:00 2001 +From: Philippe Coval +Date: Mon, 24 Mar 2025 18:29:16 +0100 +Subject: [PATCH] git: docker/uic-resources: Removed as not part of UnifyCore + (LFS) + +This change is motivated by zeal project + +Tests are passing, but it fail later on installing package: + + #12 1.646 dpkg: error processing archive ./build/z-wave-protocol-controller_1.7.0_x86_64/libunify_1.7.0-65-gbc86741e_x86_64.deb (--install): + Error: No space left on device : '/home/runner/runners/2.323.0/_diag/pages/a643bedf-49e7-4c3e-9568-b498945dda79_dd23db01-cff6-57a4-373a-5c8097a97333_1.log' + +I suspect the cause it all the assets in tree, this has to be cleaned up. + +This change prevent this problem, further cleaning may be considered. + +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/11#issuecomment-2748887134 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-protocol-controller/issues/77 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/10 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/11 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/7 +Signed-off-by: Philippe Coval +--- + docker/uic-resources/README.md | 64 ------------------- + docker/uic-resources/linux/slc_cli_linux.zip | 3 - + .../uic-resources/linux/zap_apack_linux.zip | 3 - + docker/uic-resources/mac/slc_cli_mac.zip | 3 - + docker/uic-resources/mac/zap-2022.1.10.dmg | 3 - + docker/uic-resources/mac/zap_apack_mac.zip | 3 - + 6 files changed, 79 deletions(-) + delete mode 100644 docker/uic-resources/README.md + delete mode 100644 docker/uic-resources/linux/slc_cli_linux.zip + delete mode 100644 docker/uic-resources/linux/zap_apack_linux.zip + delete mode 100644 docker/uic-resources/mac/slc_cli_mac.zip + delete mode 100644 docker/uic-resources/mac/zap-2022.1.10.dmg + delete mode 100644 docker/uic-resources/mac/zap_apack_mac.zip + +diff --git a/docker/uic-resources/README.md b/docker/uic-resources/README.md +deleted file mode 100644 +index cf767433db..0000000000 +--- a/docker/uic-resources/README.md ++++ /dev/null +@@ -1,64 +0,0 @@ +-This repository holds binary resource dependencies for UIC +- +-# Overview of Artifacts +- +-## Silicon Labs Configurator(SLC) +-slc is a tool used to create Silicon Labs Universal Configurator(UC) projects. +- +-Artifact paths: +-- linux/slc_cli_linux.zip +-- mac/slc_cli_mac.zip +- +-See [UG520: Software Project Generation and +-Configuration with SLC-CLI](https://www.silabs.com/documents/public/user-guides/ug520-software-project-generation-configuration-with-slc-cli.pdf) for more details. +- +- +-## ZCL Configurator (ZAP) +-zap is a tool used to generate source code to handle ZCL cluster command and attribute consumption. +-Build information: ZAP internal build #[490](https://jenkins-cbs-gecko-sdk.silabs.net/job/ZAP/job/silabs/490/) +- +-Artifact paths: +-- linux/zap-2022.1.10_amd64.deb +-- linux/zap_apack_linux.zip +-- mac/zap-2022.1.10.dmg +-- mac/zap_apack_mac.zip +- +- +-See [AN1325: Zigbee Cluster Configurator User's Guide](https://www.silabs.com/documents/public/application-notes/an1325-zigbee-cluster-configurator-users-guide.pdf) for more details. +- +-> ### **WARNING**: The ZAP adaptor pack archives have been modified according to the changes below. Ensure these changes are made on subsequent updates to these archives. +- +-### Modifications Made to Adapter Pack +- +-Change in apack.json: Add `--no-sandbox` parameter in the `uc_generate` function: +-```diff +-diff --git a/apack.json b/apack.json +-index cf87a910..8bce7281 100644 +---- a/apack.json +-+++ b/apack.json +-@@ -36,7 +36,7 @@ +- "cmd": "$(zap) --version" +- }, +- "uc_generate": { +-- "cmd": "$(zap) generate --noUi --noServer -o ${generationOutput} --zcl ${sdkRoot}/app/zcl/zcl-zap.json --generationTemplate ${sdkRoot}/protocol/zigbee/app/framework/gen-temp +-late/gen-templates.json --in ${contentFolder}" +-+ "cmd": "$(zap) generate --noUi --noServer --no-sandbox -o ${generationOutput} --zcl ${sdkRoot}/app/zcl/zcl-zap.json --generationTemplate ${sdkRoot}/protocol/zigbee/app +-/framework/gen-template/gen-templates.json --in ${contentFolder}" +- }, +- "uc_upgrade": { +- "cmd": "$(zap) convert --noUi --noServer --in ${contentFolder} --zcl ${sdkRoot}/app/zcl/zcl-zap.json --generationTemplate ${sdkRoot}/protocol/zigbee/app/framework/gen-template/g +-en-templates.json" +-``` +- +-#### Instructions to modify zip archives: +- +-*ZIP_FILE = zap_apack_linux.zip OR zap_apack_mac.zip* +- +-```bash +-# Extract only apack.json from zip file +-$ unzip -p ZIP_FILE.zip apack.json > apack.json +-# Add --no-sandbox parameter to slc zap generate config +-$ sed -i 's/--noServer -o/--noServer --no-sandbox -o/' apack.json +-# Update apack.json in zip file +-$ zip ZIP_FILE.zip apack.json +-``` +diff --git a/docker/uic-resources/linux/slc_cli_linux.zip b/docker/uic-resources/linux/slc_cli_linux.zip +deleted file mode 100644 +index c7097892ad..0000000000 +--- a/docker/uic-resources/linux/slc_cli_linux.zip ++++ /dev/null +@@ -1,3 +0,0 @@ +-version https://git-lfs.github.com/spec/v1 +-oid sha256:4163ec1a48e63dbde26a7e589a1af569f82d9cbbe11fd71742ff0ae2f726e292 +-size 208440392 +diff --git a/docker/uic-resources/linux/zap_apack_linux.zip b/docker/uic-resources/linux/zap_apack_linux.zip +deleted file mode 100644 +index 0160f70038..0000000000 +--- a/docker/uic-resources/linux/zap_apack_linux.zip ++++ /dev/null +@@ -1,3 +0,0 @@ +-version https://git-lfs.github.com/spec/v1 +-oid sha256:73119ea68ad6f717e915f4d9854243321d27cd4bce12429548c2510a7ff1bf42 +-size 94376620 +diff --git a/docker/uic-resources/mac/slc_cli_mac.zip b/docker/uic-resources/mac/slc_cli_mac.zip +deleted file mode 100644 +index 89dbdf641d..0000000000 +--- a/docker/uic-resources/mac/slc_cli_mac.zip ++++ /dev/null +@@ -1,3 +0,0 @@ +-version https://git-lfs.github.com/spec/v1 +-oid sha256:e95ffb2e21aaa47a2ae220964abd566cac454fe04fcee0ce23c2bbcd86bac7e7 +-size 187615728 +diff --git a/docker/uic-resources/mac/zap-2022.1.10.dmg b/docker/uic-resources/mac/zap-2022.1.10.dmg +deleted file mode 100644 +index 5cbc724612..0000000000 +--- a/docker/uic-resources/mac/zap-2022.1.10.dmg ++++ /dev/null +@@ -1,3 +0,0 @@ +-version https://git-lfs.github.com/spec/v1 +-oid sha256:dc580a5b53751749236cab3c3af32a1dcad9fcb96e834300404bdf2e0d0b595e +-size 94185073 +diff --git a/docker/uic-resources/mac/zap_apack_mac.zip b/docker/uic-resources/mac/zap_apack_mac.zip +deleted file mode 100644 +index 2d1a47bdbc..0000000000 +--- a/docker/uic-resources/mac/zap_apack_mac.zip ++++ /dev/null +@@ -1,3 +0,0 @@ +-version https://git-lfs.github.com/spec/v1 +-oid sha256:f5ced7930d5a6289f26e81ed7913e9c02e93f1053a3bfa492bff9f9287b25522 +-size 94020675 +-- +2.43.0 + diff --git a/patches/UnifySDK/0007-UIC-3544-core-C-callback-for-uic_attribute_resolver.patch b/patches/UnifySDK/0007-UIC-3544-core-C-callback-for-uic_attribute_resolver.patch new file mode 100644 index 000000000..6aee5ff39 --- /dev/null +++ b/patches/UnifySDK/0007-UIC-3544-core-C-callback-for-uic_attribute_resolver.patch @@ -0,0 +1,782 @@ +From ea4bbf46cac6830b51c749c8af83931cc163f360 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Boris=20Labb=C3=A9?= +Date: Mon, 28 Oct 2024 10:09:07 +0100 +Subject: [PATCH] UIC-3544: core: C++ callback for uic_attribute_resolver + +attribute_resolver::register_rules is now available to register rules (set, get). + +Since we can't compare callbacks pointers since we are now using std::function, we added attribute_resolver::register_multiple_types_rules that mimic the old behavior for the same callback. You are now able to register the same callback to multiple attributes if needed to avoid to send multiple Get/Set. + +[Philippe Coval] + +This change is needed for zpc/zeal, it has been split in 2, +this part only target core. + +Origin: uic/pull-requests/2916 +Forwarded: uic/pull-requests/2983 +Forwarded: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/pull/27 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/6 +Signed-off-by: Philippe Coval +--- + .../uic_attribute_resolver/CMakeLists.txt | 5 +- + .../include/attribute_resolver.hpp | 103 +++++++++++ + .../include/attribute_resolver_rule.h | 23 +-- + .../src/attribute_resolver.cpp | 49 ++++- + .../src/attribute_resolver_rule.cpp | 168 ++++++++++-------- + .../src/attribute_resolver_rule_internal.h | 4 - + .../src/attribute_resolver_rule_internal.hpp | 23 +++ + .../test/attribute_resolver_common_test.cpp | 83 ++++----- + .../test/attribute_resolver_rule_mock.cpp | 21 ++- + .../test/workaround.hpp | 1 + + 10 files changed, 324 insertions(+), 156 deletions(-) + create mode 100644 components/uic_attribute_resolver/include/attribute_resolver.hpp + +diff --git a/components/uic_attribute_resolver/CMakeLists.txt b/components/uic_attribute_resolver/CMakeLists.txt +index 5921466c51..50e5568ec8 100644 +--- a/components/uic_attribute_resolver/CMakeLists.txt ++++ b/components/uic_attribute_resolver/CMakeLists.txt +@@ -1,6 +1,7 @@ + # Attribute resolver +-add_library(uic_attribute_resolver OBJECT src/attribute_resolver.cpp +- src/attribute_resolver_rule.cpp) ++add_library(uic_attribute_resolver OBJECT src/attribute_resolver_rule.cpp ++ src/attribute_resolver.cpp ++ ) + + target_include_directories( + uic_attribute_resolver +diff --git a/components/uic_attribute_resolver/include/attribute_resolver.hpp b/components/uic_attribute_resolver/include/attribute_resolver.hpp +new file mode 100644 +index 0000000000..159ef18074 +--- /dev/null ++++ b/components/uic_attribute_resolver/include/attribute_resolver.hpp +@@ -0,0 +1,103 @@ ++/****************************************************************************** ++ * # License ++ * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ++ ****************************************************************************** ++ * The licensor of this software is Silicon Laboratories Inc. Your use of this ++ * software is governed by the terms of Silicon Labs Master Software License ++ * Agreement (MSLA) available at ++ * www.silabs.com/about-us/legal/master-software-license-agreement. This ++ * software is distributed to you in Source Code format and is governed by the ++ * sections of the MSLA applicable to Source Code. ++ * ++ *****************************************************************************/ ++ ++#ifndef ATTRIBUTE_RESOLVER_HPP ++#define ATTRIBUTE_RESOLVER_HPP ++ ++#include "attribute_resolver.h" ++ ++#include "sl_status.h" ++#include "attribute_store.h" ++ ++#include ++#include ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++namespace attribute_resolver ++{ ++ ++using attribute_resolver_function ++ = std::function; ++ ++/** ++ * @brief Register same rule for multiples types. ++ * ++ * This allows you to bind multiple attributes to the same rules. ++ * ++ * @param node_type Attribute type for which these rules apply. ++ * @param set_func Generator function which will generate the SET command for ++ * this attribute type. ++ * @param get_func Generator function which will generate the GET command for ++ * this attribute type. ++ * @return sl_status_t ++ */ ++sl_status_t register_multiple_types_rules( ++ const std::set &node_type, ++ attribute_resolver_function set_func, ++ attribute_resolver_function get_func); ++ ++/** ++ * @brief Return the get function for a given attribute type ++ * ++ * @param node_type ++ * @returns NULL if this attribute type cannot be resolved. ++ * Else the attribute_resolver_function_t that can resolve ++ * this particular attribute ++ */ ++attribute_resolver_function ++ get_function(attribute_store_type_t node_type); ++ ++/** ++ * @brief Return the set function for a given attribute type ++ * ++ * @param node_type ++ * @returns NULL if this attribute type cannot be resolved. ++ * Else the attribute_resolver_function_t that can resolve ++ * this particular attribute ++ */ ++attribute_resolver_function ++ set_function(attribute_store_type_t node_type); ++ ++/** ++ * @brief Register an attribute rule. ++ * ++ * This function registers a new rule into the resolver rule book. ++ * Only one rule can exist per attribute type. Some attributes have both a set and get ++ * rule, some only have a set rule, some have only a get rule, some have no ++ * rules. ++ * ++ * @param node_type Attribute type for which these rules apply. ++ * @param set_func Generator function which will generate the SET command for ++ * this attribute type. ++ * @param get_func Generator function which will generate the GET command for ++ * this attribute type. ++ * @return sl_status_t ++ */ ++sl_status_t register_rules(attribute_store_type_t node_type, ++ attribute_resolver::attribute_resolver_function set_func, ++ attribute_resolver::attribute_resolver_function get_func); ++ ++} // namespace attribute_resolver ++ ++ ++ ++ ++#ifdef __cplusplus ++} // extern "C" ++#endif ++ ++#endif // ZWAVE_ATTRIBUTE_RESOLVER_H ++/** @} end attribute_resolver */ +diff --git a/components/uic_attribute_resolver/include/attribute_resolver_rule.h b/components/uic_attribute_resolver/include/attribute_resolver_rule.h +index 74d80e6874..7e699b2a24 100644 +--- a/components/uic_attribute_resolver/include/attribute_resolver_rule.h ++++ b/components/uic_attribute_resolver/include/attribute_resolver_rule.h +@@ -80,27 +80,6 @@ typedef void (*resolver_on_set_rule_registered_t)(attribute_store_type_t); + void attribute_resolver_register_set_rule_listener( + resolver_on_set_rule_registered_t function); + +-/** +- * @brief Return the get function for a given attribute type +- * +- * @param node_type +- * @returns NULL if this attribute type cannot be resolved. +- * Else the attribute_resolver_function_t that can resolve +- * this particular attribute +- */ +-attribute_resolver_function_t +- attribute_resolver_get_function(attribute_store_type_t node_type); +- +-/** +- * @brief Return the set function for a given attribute type +- * +- * @param node_type +- * @returns NULL if this attribute type cannot be resolved. +- * Else the attribute_resolver_function_t that can resolve +- * this particular attribute +- */ +-attribute_resolver_function_t +- attribute_resolver_set_function(attribute_store_type_t node_type); + + /** + * @brief Returns if the Rule Book can resolve a Set Rule for the attribute type +@@ -137,7 +116,7 @@ void on_resolver_send_data_complete(resolver_send_status_t status, + clock_time_t transmit_time, + attribute_store_node_t node, + resolver_rule_type_t rule_type); +- ++ + #ifdef __cplusplus + } + #endif +diff --git a/components/uic_attribute_resolver/src/attribute_resolver.cpp b/components/uic_attribute_resolver/src/attribute_resolver.cpp +index e4b6aedd0a..f690aa4ed7 100644 +--- a/components/uic_attribute_resolver/src/attribute_resolver.cpp ++++ b/components/uic_attribute_resolver/src/attribute_resolver.cpp +@@ -17,6 +17,7 @@ + #include "attribute_resolver_rule_internal.hpp" + + #include "attribute.hpp" ++#include "attribute_resolver.hpp" + + // Includes from other components + #include "multi_invoke.hpp" +@@ -950,16 +951,19 @@ void on_resolver_rule_execute_complete(attribute_store_node_t node, + } + } + ++ ++ + /////////////////////////////////////////////////////////////////////////////// +-// Attribute Resolver public functions ++// C++ wrapper + /////////////////////////////////////////////////////////////////////////////// +-sl_status_t +- attribute_resolver_register_rule(attribute_store_type_t node_type, +- attribute_resolver_function_t set_func, +- attribute_resolver_function_t get_func) ++namespace attribute_resolver + { +- attribute_resolver_rule_register(node_type, set_func, get_func); + ++void create_attribute_store_callbacks( ++ attribute_store_type_t node_type, ++ const attribute_resolver_function &set_func, ++ const attribute_resolver_function &get_func) ++{ + if (set_func != nullptr) { + // Both Get and Set or only Set rule registered, we want to know about both DESIRED and REPORTED updates. + attribute_store_register_callback_by_type(&on_resolver_node_update, +@@ -976,10 +980,43 @@ sl_status_t + scan_requested = true; + process_post(&attribute_resolver_process, RESOLVER_NEXT_EVENT, nullptr); + } ++} + ++sl_status_t register_rules(attribute_store_type_t node_type, ++ attribute_resolver::attribute_resolver_function set_func, ++ attribute_resolver::attribute_resolver_function get_func) ++{ ++ register_rules_internal(node_type, set_func, get_func); ++ create_attribute_store_callbacks(node_type, set_func, get_func); + return SL_STATUS_OK; + } + ++sl_status_t register_multiple_types_rules( ++ const std::set &node_types, ++ attribute_resolver_function set_func, ++ attribute_resolver_function get_func) ++{ ++ register_group_rules_internal(node_types, set_func, get_func); ++ ++ for (auto node_type: node_types) { ++ create_attribute_store_callbacks(node_type, set_func, get_func); ++ } ++ return SL_STATUS_OK; ++} ++ ++} // namespace attribute_resolver ++ ++/////////////////////////////////////////////////////////////////////////////// ++// Attribute Resolver public functions ++/////////////////////////////////////////////////////////////////////////////// ++sl_status_t ++ attribute_resolver_register_rule(attribute_store_type_t node_type, ++ attribute_resolver_function_t set_func, ++ attribute_resolver_function_t get_func) ++{ ++ return attribute_resolver::register_rules(node_type, set_func, get_func); ++} ++ + static sl_status_t + attribute_resolver_config_init(attribute_resolver_config_t resolver_config) + { +diff --git a/components/uic_attribute_resolver/src/attribute_resolver_rule.cpp b/components/uic_attribute_resolver/src/attribute_resolver_rule.cpp +index deb6863996..a3e9c870c2 100644 +--- a/components/uic_attribute_resolver/src/attribute_resolver_rule.cpp ++++ b/components/uic_attribute_resolver/src/attribute_resolver_rule.cpp +@@ -10,8 +10,12 @@ + * sections of the MSLA applicable to Source Code. + * + *****************************************************************************/ ++ ++#include "attribute_resolver.hpp" ++ + // Includes from this component + #include "attribute_resolver.h" ++ + #include "attribute_resolver_rule_internal.h" + #include "attribute_resolver_rule_internal.hpp" + #include "attribute_resolver_rule.h" +@@ -20,6 +24,7 @@ + #include + #include + #include ++#include + + // Unify Components + #include "attribute_store_helper.h" +@@ -31,10 +36,11 @@ constexpr char LOG_TAG[] = "attribute_resolver_rule"; + constexpr int DEFAULT_GROUPING_DEPTH = 1; + constexpr clock_time_t MAX_RESOLUTION_TIME = 60 * CLOCK_CONF_SECOND; + +-struct attribute_rule { +- attribute_resolver_function_t set_func; +- attribute_resolver_function_t get_func; ++struct attribute_rules { ++ attribute_resolver::attribute_resolver_function set_func; ++ attribute_resolver::attribute_resolver_function get_func; + }; ++using attribute_rules_ptr = std::shared_ptr; + + static enum { + RESOLVER_IDLE, +@@ -42,16 +48,15 @@ static enum { + RESOLVER_EXECUTING_GET_RULE, + } resolver_state; + +-static std::map rule_book; ++static std::map rule_book; ++// To save time we also have an inverted rule book ++// This allows us to quickly find all attributes that belong to the same rule book ++static std::multimap ++ rule_book_inverted; ++ + static std::map relatives; + +-/* Set of attributes in the same report message, this is deducted form the get function */ +-static std::multimap +- get_group; + +-/* Set of attribute in the same set function. */ +-static std::multimap +- set_group; + + static attribute_rule_complete_t compl_func; + static attribute_store_node_t node_pending_resolution +@@ -115,6 +120,7 @@ static const char * + } + } + ++ + void on_rule_execution_timeout(void *user) + { + sl_log_error(LOG_TAG, +@@ -139,23 +145,17 @@ void on_rule_execution_timeout(void *user) + static void + attribute_resolver_rule_get_group(resolver_rule_type_t rule_type, + attribute_store_type_t attribute_type, +- std::set &result) ++ std::set &output) + { +- // Start by inserting the node itself. +- result.insert(attribute_type); +- //do we have the attribute in the rule book +- if (rule_book.count(attribute_type)) { +- if (rule_type == RESOLVER_GET_RULE) { +- attribute_resolver_function_t f = rule_book.at(attribute_type).get_func; +- const auto range = get_group.equal_range(f); +- for (auto i = range.first; i != range.second; i++) { +- result.insert(i->second); +- } +- } else if (rule_type == RESOLVER_SET_RULE) { +- attribute_resolver_function_t f = rule_book.at(attribute_type).set_func; +- const auto range = set_group.equal_range(f); +- for (auto i = range.first; i != range.second; i++) { +- result.insert(i->second); ++ auto attribute_rule = rule_book[attribute_type]; ++ if (attribute_rule != nullptr) { ++ auto rule_range = rule_book_inverted.equal_range(attribute_rule); ++ for (auto i = rule_range.first; i != rule_range.second; ++i) { ++ if (rule_type == RESOLVER_GET_RULE && i->first->get_func != nullptr) { ++ output.insert(i->second); ++ } else if (rule_type == RESOLVER_SET_RULE ++ && i->first->set_func != nullptr) { ++ output.insert(i->second); + } + } + } +@@ -308,7 +308,7 @@ void attribute_resolver_register_set_rule_listener( + set_rule_listeners.insert(function); + // If they register themselves late, we notify of already existing rules. + for (auto it = rule_book.begin(); it != rule_book.end(); ++it) { +- if (it->second.set_func != nullptr) { ++ if (it->second->set_func != nullptr) { + function(it->first); + } + } +@@ -330,10 +330,8 @@ sl_status_t attribute_resolver_rule_execute(attribute_store_node_t node, + if (attribute_resolver_rule_busy() == true) { + return SL_STATUS_BUSY; + } +- +- attribute_resolver_function_t func = set_rule +- ? rule_book[attribute_type].set_func +- : rule_book[attribute_type].get_func; ++ const auto rules = rule_book[attribute_type]; ++ const auto func = set_rule ? rules->set_func : rules->get_func; + + if (func) { + try { +@@ -392,33 +390,9 @@ sl_status_t attribute_resolver_rule_execute(attribute_store_node_t node, + return SL_STATUS_NOT_SUPPORTED; + } + +-void attribute_resolver_rule_register(attribute_store_type_t node_type, +- attribute_resolver_function_t set_func, +- attribute_resolver_function_t get_func) +-{ +- rule_book[node_type] = {set_func, get_func}; +- +- if (get_func) { +- get_group.insert(std::make_pair(get_func, node_type)); +- } +- +- if (set_func) { +- set_group.insert(std::make_pair(set_func, node_type)); +- } +- +- // Notify set rule listeners +- if (set_func != nullptr) { +- for (auto it = set_rule_listeners.begin(); it != set_rule_listeners.end(); +- ++it) { +- (*it)(node_type); +- } +- } +-} + + void attribute_resolver_rule_init(attribute_rule_complete_t __compl_func) + { +- get_group.clear(); +- set_group.clear(); + relatives.clear(); + compl_func = __compl_func; + rule_book.clear(); +@@ -447,45 +421,95 @@ void attribute_resolver_rule_abort(attribute_store_node_t node) + } + } + +-attribute_resolver_function_t +- attribute_resolver_set_function(attribute_store_type_t node_type) ++ ++bool attribute_resolver_has_set_rule(attribute_store_type_t node_type) ++{ ++ return attribute_resolver::set_function(node_type) != nullptr; ++} ++ ++bool attribute_resolver_has_get_rule(attribute_store_type_t node_type) ++{ ++ return attribute_resolver::get_function(node_type) != nullptr; ++} ++ ++sl_status_t ++ attribute_resolver_set_attribute_depth(attribute_store_type_t node_type, ++ int depth) ++{ ++ if (relatives.count(node_type)) { ++ relatives.erase(node_type); ++ } ++ relatives.insert(std::make_pair(node_type, depth)); ++ return SL_STATUS_OK; ++} ++ ++ ++/////////////////////////////////////////////////////////////////////////// ++/// C++ Wrapper ++/////////////////////////////////////////////////////////////////////////// ++namespace attribute_resolver ++{ ++ ++attribute_resolver_function set_function(attribute_store_type_t node_type) + { + if (rule_book.find(node_type) == rule_book.end()) { + // No rule at all for this attribute + return nullptr; + } else { +- return rule_book[node_type].set_func; ++ return rule_book[node_type]->set_func; + } + } + +-attribute_resolver_function_t +- attribute_resolver_get_function(attribute_store_type_t node_type) ++attribute_resolver_function ++ get_function(attribute_store_type_t node_type) + { + if (rule_book.find(node_type) == rule_book.end()) { + // No rule at all for this attribute + return nullptr; + } else { +- return rule_book[node_type].get_func; ++ return rule_book[node_type]->get_func; + } + } + +-bool attribute_resolver_has_set_rule(attribute_store_type_t node_type) ++void helper_register_rules(attribute_store_type_t node_type, ++ attribute_rules_ptr rules, ++ bool notify_set_rule_listeners) + { +- return attribute_resolver_set_function(node_type) != nullptr; ++ rule_book[node_type] = rules; ++ rule_book_inverted.insert({rules, node_type}); ++ ++ if (notify_set_rule_listeners) { ++ for (auto set_rule_listener : set_rule_listeners) { ++ set_rule_listener(node_type); ++ } ++ } + } + +-bool attribute_resolver_has_get_rule(attribute_store_type_t node_type) ++void register_rules_internal(attribute_store_type_t node_type, ++ attribute_resolver_function set_func, ++ attribute_resolver_function get_func) + { +- return attribute_resolver_get_function(node_type) != nullptr; ++ auto rules = std::make_shared(); ++ rules->set_func = set_func; ++ rules->get_func = get_func; ++ ++ helper_register_rules(node_type, rules, set_func != nullptr); + } + +-sl_status_t +- attribute_resolver_set_attribute_depth(attribute_store_type_t node_type, +- int depth) ++void register_group_rules_internal( ++ const std::set &nodes, ++ attribute_resolver_function set_func, ++ attribute_resolver_function get_func) + { +- if (relatives.count(node_type)) { +- relatives.erase(node_type); ++ auto rules = std::make_shared(); ++ rules->set_func = set_func; ++ rules->get_func = get_func; ++ ++ for (auto node_type: nodes) { ++ helper_register_rules(node_type, rules, set_func != nullptr); + } +- relatives.insert(std::make_pair(node_type, depth)); +- return SL_STATUS_OK; + } ++ ++} // namespace attribute_resolver ++ ++ +diff --git a/components/uic_attribute_resolver/src/attribute_resolver_rule_internal.h b/components/uic_attribute_resolver/src/attribute_resolver_rule_internal.h +index 4aad50a95f..5fac341f1e 100644 +--- a/components/uic_attribute_resolver/src/attribute_resolver_rule_internal.h ++++ b/components/uic_attribute_resolver/src/attribute_resolver_rule_internal.h +@@ -53,10 +53,6 @@ typedef void (*attribute_rule_complete_t)(attribute_store_node_t, clock_time_t); + sl_status_t attribute_resolver_rule_execute(attribute_store_node_t node, + bool set_rule); + +-void attribute_resolver_rule_register(attribute_store_type_t node_type, +- attribute_resolver_function_t set_func, +- attribute_resolver_function_t get_func); +- + /** + * @brief Initialize the rule book + * +diff --git a/components/uic_attribute_resolver/src/attribute_resolver_rule_internal.hpp b/components/uic_attribute_resolver/src/attribute_resolver_rule_internal.hpp +index 5247290add..06ce88a367 100644 +--- a/components/uic_attribute_resolver/src/attribute_resolver_rule_internal.hpp ++++ b/components/uic_attribute_resolver/src/attribute_resolver_rule_internal.hpp +@@ -26,6 +26,11 @@ + #include + + #include "attribute_resolver_rule.h" ++#include "attribute_resolver.hpp" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif + + /** + * @brief Get a list of attribute types that has the same resolution method as a +@@ -44,5 +49,23 @@ std::set + attribute_resolver_rule_get_group_nodes(resolver_rule_type_t rule_type, + attribute_store_node_t group); + ++namespace attribute_resolver ++{ ++void register_rules_internal( ++ attribute_store_type_t node_type, ++ attribute_resolver_function set_func, ++ attribute_resolver_function get_func); ++ ++void register_group_rules_internal( ++ const std::set &nodes, ++ attribute_resolver_function set_func, ++ attribute_resolver_function get_func); ++ ++} // namespace attribute_resolver ++ ++#ifdef __cplusplus ++} // extern "C" ++#endif ++ + #endif //ATTRIBUTE_RESOLVER_RULE_INTERNAL_HPP + /** @} end attribute_resolver_rule_internal */ +diff --git a/components/uic_attribute_resolver/test/attribute_resolver_common_test.cpp b/components/uic_attribute_resolver/test/attribute_resolver_common_test.cpp +index b138f7ffb8..d2196d285f 100644 +--- a/components/uic_attribute_resolver/test/attribute_resolver_common_test.cpp ++++ b/components/uic_attribute_resolver/test/attribute_resolver_common_test.cpp +@@ -471,14 +471,12 @@ void test_attribute_resolver_common_get_node_groups() + attribute_resolver_set_attribute_depth(attribute_store_get_node_type(node_7), + 1); + +- // Register a rule for type 7 +- attribute_resolver_register_rule(attribute_store_get_node_type(node_7), +- NULL, +- &test_get_resolution_function); +- // Register the same rule for type 9 +- attribute_resolver_register_rule(attribute_store_get_node_type(node_9), +- NULL, +- &test_get_resolution_function); ++ // Register same rule for type 7 & type 9 ++ attribute_resolver::register_multiple_types_rules( ++ {attribute_store_get_node_type(node_7), ++ attribute_store_get_node_type(node_9)}, ++ nullptr, ++ &test_get_resolution_function); + + // Get the resolver to resolve: + attribute_store_undefine_reported(node_7); +@@ -514,14 +512,12 @@ void test_attribute_resolver_common_set_node_groups_ok_execution_verified() + attribute_resolver_set_attribute_depth(attribute_store_get_node_type(node_7), + 1); + +- // Register a rule for type 7 +- attribute_resolver_register_rule(attribute_store_get_node_type(node_7), +- &test_set_resolution_function, +- NULL); +- // Register the same rule for type 9 +- attribute_resolver_register_rule(attribute_store_get_node_type(node_9), +- &test_set_resolution_function, +- NULL); ++ // Register same rule for type 7 & type 9 ++ attribute_resolver::register_multiple_types_rules( ++ {attribute_store_get_node_type(node_7), ++ attribute_store_get_node_type(node_9)}, ++ &test_set_resolution_function, ++ NULL); + + // Get the resolver to resolve: + value = 1; +@@ -558,14 +554,12 @@ void test_attribute_resolver_common_set_node_groups_ok_execution_failed() + attribute_resolver_set_attribute_depth(attribute_store_get_node_type(node_7), + 1); + +- // Register a rule for type 7 +- attribute_resolver_register_rule(attribute_store_get_node_type(node_7), +- &test_set_resolution_function, +- NULL); +- // Register the same rule for type 9 +- attribute_resolver_register_rule(attribute_store_get_node_type(node_9), +- &test_set_resolution_function, +- NULL); ++ // Register same rule for type 7 & type 9 ++ attribute_resolver::register_multiple_types_rules( ++ {attribute_store_get_node_type(node_7), ++ attribute_store_get_node_type(node_9)}, ++ &test_set_resolution_function, ++ NULL); + + // Get the resolver to resolve: + value = 1; +@@ -995,14 +989,12 @@ void test_attribute_resolver_common_set_node_groups_with_restart() + attribute_resolver_set_attribute_depth(attribute_store_get_node_type(node_7), + 1); + +- // Register a rule for type 7 +- attribute_resolver_register_rule(attribute_store_get_node_type(node_7), +- &test_set_resolution_function, +- NULL); +- // Register the same rule for type 9 +- attribute_resolver_register_rule(attribute_store_get_node_type(node_9), +- &test_set_resolution_function, +- NULL); ++ // Register a rule for type 7 & type 9 ++ attribute_resolver::register_multiple_types_rules( ++ {attribute_store_get_node_type(node_7), ++ attribute_store_get_node_type(node_9)}, ++ &test_set_resolution_function, ++ NULL); + + // Get the resolver to resolve: + value = 1; +@@ -1713,14 +1705,12 @@ void test_attribute_resolver_give_up_on_group_get_rule() + attribute_resolver_set_attribute_depth(attribute_store_get_node_type(node_7), + 1); + +- // Register a rule for type 7 +- attribute_resolver_register_rule(attribute_store_get_node_type(node_7), +- NULL, +- &test_get_resolution_function); +- // Register the same rule for type 9 +- attribute_resolver_register_rule(attribute_store_get_node_type(node_9), +- NULL, +- &test_get_resolution_function); ++ // Register same rule for type 7 & type 9 ++ attribute_resolver::register_multiple_types_rules( ++ {attribute_store_get_node_type(node_7), ++ attribute_store_get_node_type(node_9)}, ++ nullptr, ++ &test_get_resolution_function); + + expected_node_for_listening_notification = node_2; + attribute_resolver_set_resolution_listener( +@@ -1800,15 +1790,10 @@ void test_attribute_resolver_rule_get_group_node() + attribute_resolver_rule_init(0); + // Let all node types B,C,D be resolved by the same frame + +- attribute_resolver_rule_register(0xb, +- &test_set_resolution_function, +- &test_get_resolution_function); +- attribute_resolver_rule_register(0xc, +- &test_set_resolution_function, +- &test_get_resolution_function); +- attribute_resolver_rule_register(0xd, +- &test_set_resolution_function, +- &test_get_resolution_function); ++ attribute_resolver::register_multiple_types_rules( ++ {0xb, 0xc, 0xd}, ++ &test_set_resolution_function, ++ &test_get_resolution_function); + + // Depth 0, means the node sits alone in its group + attribute_resolver_set_attribute_depth(0xb, 0); +diff --git a/components/uic_attribute_resolver/test/attribute_resolver_rule_mock.cpp b/components/uic_attribute_resolver/test/attribute_resolver_rule_mock.cpp +index 2767b28b7c..35b5f3697b 100644 +--- a/components/uic_attribute_resolver/test/attribute_resolver_rule_mock.cpp ++++ b/components/uic_attribute_resolver/test/attribute_resolver_rule_mock.cpp +@@ -19,4 +19,23 @@ std::set + { + return std::set(); + //NA +-} +\ No newline at end of file ++} ++ ++namespace attribute_resolver ++{ ++void register_rules_internal(attribute_store_type_t node_type, ++ attribute_resolver_function set_func, ++ attribute_resolver_function get_func) ++{ ++ return; ++}; ++ ++void register_group_rules_internal( ++ const std::set &nodes, ++ attribute_resolver_function set_func, ++ attribute_resolver_function get_func) ++{ ++ return; ++}; ++ ++} // namespace attribute_resolver +\ No newline at end of file +diff --git a/components/uic_attribute_resolver/test/workaround.hpp b/components/uic_attribute_resolver/test/workaround.hpp +index 3482aa3b73..61c3b27be4 100644 +--- a/components/uic_attribute_resolver/test/workaround.hpp ++++ b/components/uic_attribute_resolver/test/workaround.hpp +@@ -7,5 +7,6 @@ + + #ifdef __cplusplus + #include "attribute_resolver_rule_internal.hpp" ++#include "attribute_resolver.hpp" + #endif + #endif +-- +2.43.0 + diff --git a/patches/UnifySDK/0008-UIC-3517-core-Add-first_child-in-attribute.hpp-to-ea.patch b/patches/UnifySDK/0008-UIC-3517-core-Add-first_child-in-attribute.hpp-to-ea.patch new file mode 100644 index 000000000..c45f5f487 --- /dev/null +++ b/patches/UnifySDK/0008-UIC-3517-core-Add-first_child-in-attribute.hpp-to-ea.patch @@ -0,0 +1,67 @@ +From d7c7701b329a1f8e053cf74a5af1893b2a220fba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Boris=20Labb=C3=A9?= +Date: Fri, 22 Nov 2024 11:54:34 +0100 +Subject: [PATCH] UIC-3517: core: Add first_child in attribute.hpp to ease + debuging + +This function will write which attribute type was looked for to allows an easier time debugging stuff + +[Philippe Coval] + +This change is needed for zpc/zeal, it has been split in 2, +this part only target core. + +Origin: uic/pull-requests/2916 +Forwarded: uic/pull-requests/2983 +Forwarded: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/pull/27 +Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/6 +Signed-off-by: Philippe Coval +--- + .../uic_attribute_store/include/attribute.hpp | 24 +++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/components/uic_attribute_store/include/attribute.hpp b/components/uic_attribute_store/include/attribute.hpp +index 466ad9ffef..807f94fdf3 100644 +--- a/components/uic_attribute_store/include/attribute.hpp ++++ b/components/uic_attribute_store/include/attribute.hpp +@@ -38,6 +38,7 @@ + #include + #include + #include // for ostringstream ++ + namespace attribute_store + { + /** +@@ -337,6 +338,29 @@ class attribute + return attribute_store_get_node_child_by_type(_n, type, index); + } + ++ /** ++ * @brief Get first child of a given type ++ * ++ * @note If not found, an exception is thrown. Use child_by_type if you don't want an exception. ++ * ++ * @throw std::invalid_argument if no child of the given type is found ++ * ++ * @param type Attribute Store Type. ++ * ++ * @return attribute ++ */ ++ attribute first_child(attribute_store_type_t type) const ++ { ++ auto child_node = child_by_type(type); ++ if (!child_node.is_valid()) { ++ throw std::invalid_argument( ++ "No child of type " + std::string(attribute_store_get_type_name(type)) ++ + " found under " + name_and_id()); ++ } ++ ++ return child_node; ++ } ++ + /** + * @brief Returns a vector of children of this attribute + * +-- +2.43.0 + diff --git a/patches/UnifySDK/0009-Set-UIC_REPO-to-script-parent-dir.patch b/patches/UnifySDK/0009-Set-UIC_REPO-to-script-parent-dir.patch new file mode 100644 index 000000000..3118a84b0 --- /dev/null +++ b/patches/UnifySDK/0009-Set-UIC_REPO-to-script-parent-dir.patch @@ -0,0 +1,28 @@ +From 0b0f087b4cd8a8a1688cf79b36edb8143b0cfff0 Mon Sep 17 00:00:00 2001 +From: Adrian Gielniewski +Date: Thu, 25 May 2023 13:20:54 +0200 +Subject: [PATCH] Set UIC_REPO to script parent dir. + +(cherry picked from commit 9b6e3e191c282e6f204ff4f90f8701678d844d47) +--- + docker/runDockerUIC.sh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/docker/runDockerUIC.sh b/docker/runDockerUIC.sh +index 3db9b2cae5..32e465b5b8 100755 +--- a/docker/runDockerUIC.sh ++++ b/docker/runDockerUIC.sh +@@ -6,7 +6,8 @@ + + #UIC_REPO is the directory where the Unify source code is located + #this should always be filled in ++SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + GSDK_LOCATION="" +-UIC_REPO="" ++UIC_REPO="$(dirname "$SCRIPT_DIR")" + +-docker run -it --rm --env GSDK_LOCATION -v ${GSDK_LOCATION}:${GSDK_LOCATION} -v ${UIC_REPO}:${UIC_REPO} zpc bash ++docker run -it --rm --env GSDK_LOCATION=${GSDK_LOCATION} -v ${GSDK_LOCATION}:${GSDK_LOCATION} -v ${UIC_REPO}:${UIC_REPO} -w ${UIC_REPO} uic_amd64 bash +-- +2.43.0 + diff --git a/patches/UnifySDK/0010-Remove-dependency-to-uic_mqtt.patch b/patches/UnifySDK/0010-Remove-dependency-to-uic_mqtt.patch new file mode 100644 index 000000000..21e53abee --- /dev/null +++ b/patches/UnifySDK/0010-Remove-dependency-to-uic_mqtt.patch @@ -0,0 +1,54 @@ +From 8946809a38caad1d7bc82bd01a73fc83b6210897 Mon Sep 17 00:00:00 2001 +From: Adrian Gielniewski +Date: Thu, 25 May 2023 13:29:17 +0200 +Subject: [PATCH] Remove dependency to uic_mqtt. + +--- + components/uic_main/CMakeLists.txt | 1 - + components/uic_main/src/uic_component_fixtures_array.c | 4 +--- + 2 files changed, 1 insertion(+), 4 deletions(-) + +diff --git a/components/uic_main/CMakeLists.txt b/components/uic_main/CMakeLists.txt +index 43445fdee2..95cde0c35b 100644 +--- a/components/uic_main/CMakeLists.txt ++++ b/components/uic_main/CMakeLists.txt +@@ -13,7 +13,6 @@ target_link_libraries( + uic_main + uic_log + uic_config +- uic_mqtt + uic_stdin + uic_contiki_platform) + +diff --git a/components/uic_main/src/uic_component_fixtures_array.c b/components/uic_main/src/uic_component_fixtures_array.c +index fca5bdd864..ab4a10e0f2 100644 +--- a/components/uic_main/src/uic_component_fixtures_array.c ++++ b/components/uic_main/src/uic_component_fixtures_array.c +@@ -12,7 +12,6 @@ + #include + + #include "sl_log.h" +-#include "uic_mqtt.h" + #include "uic_stdin_process.h" + + #include "uic_component_fixtures_internal.h" +@@ -32,7 +31,6 @@ + */ + static uic_fixt_setup_step_t uic_fixt_setup_steps_list[] + = {{uic_signal_handler_setup, "Unify Signal Handler"}, +- {uic_mqtt_setup, "Unify MQTT Client"}, + {uic_stdin_setup, "Unify STDIN"}, + {NULL, "Terminator"}}; + +@@ -45,7 +43,7 @@ static uic_fixt_setup_step_t uic_fixt_setup_steps_list[] + * been stopped. + */ + static uic_fixt_shutdown_step_t uic_fixt_shutdown_steps_list[] +- = {{uic_mqtt_teardown, "Unify MQTT Client"}, ++ = { + {uic_stdin_teardown, "Unify STDIN"}, + {NULL, "Terminator"}}; + +-- +2.43.0 + diff --git a/patches/UnifySDK/0011-Remove-dependency-to-uic_stdin.patch b/patches/UnifySDK/0011-Remove-dependency-to-uic_stdin.patch new file mode 100644 index 000000000..8a41a2619 --- /dev/null +++ b/patches/UnifySDK/0011-Remove-dependency-to-uic_stdin.patch @@ -0,0 +1,80 @@ +From cd7718b017a688a55d7bfc09bbb75486d3ae2a94 Mon Sep 17 00:00:00 2001 +From: Adrian Gielniewski +Date: Tue, 7 Jun 2022 10:10:19 +0000 +Subject: [PATCH] Remove dependency to uic_stdin. + +--- + components/uic_main/CMakeLists.txt | 1 - + components/uic_main/src/uic_component_fixtures_array.c | 3 --- + components/uic_main/src/uic_main.c | 6 +++--- + 3 files changed, 3 insertions(+), 7 deletions(-) + +diff --git a/components/uic_main/CMakeLists.txt b/components/uic_main/CMakeLists.txt +index 95cde0c35b..8379bb23d3 100644 +--- a/components/uic_main/CMakeLists.txt ++++ b/components/uic_main/CMakeLists.txt +@@ -13,7 +13,6 @@ target_link_libraries( + uic_main + uic_log + uic_config +- uic_stdin + uic_contiki_platform) + + target_include_directories( +diff --git a/components/uic_main/src/uic_component_fixtures_array.c b/components/uic_main/src/uic_component_fixtures_array.c +index ab4a10e0f2..b50402e5d1 100644 +--- a/components/uic_main/src/uic_component_fixtures_array.c ++++ b/components/uic_main/src/uic_component_fixtures_array.c +@@ -12,7 +12,6 @@ + #include + + #include "sl_log.h" +-#include "uic_stdin_process.h" + + #include "uic_component_fixtures_internal.h" + #include "uic_signal_handler.h" +@@ -31,7 +30,6 @@ + */ + static uic_fixt_setup_step_t uic_fixt_setup_steps_list[] + = {{uic_signal_handler_setup, "Unify Signal Handler"}, +- {uic_stdin_setup, "Unify STDIN"}, + {NULL, "Terminator"}}; + + /** Final tear-down steps. +@@ -44,7 +42,6 @@ static uic_fixt_setup_step_t uic_fixt_setup_steps_list[] + */ + static uic_fixt_shutdown_step_t uic_fixt_shutdown_steps_list[] + = { +- {uic_stdin_teardown, "Unify STDIN"}, + {NULL, "Terminator"}}; + + /** +diff --git a/components/uic_main/src/uic_main.c b/components/uic_main/src/uic_main.c +index 6f9b42784d..0d75cd153e 100644 +--- a/components/uic_main/src/uic_main.c ++++ b/components/uic_main/src/uic_main.c +@@ -23,7 +23,7 @@ + + #define LOG_TAG "uic_main" + +-extern int uic_stdin_teardown(); ++// extern int uic_stdin_teardown(); + + int uic_main(const uic_fixt_setup_step_t *fixt_app_setup, + const uic_fixt_shutdown_step_t *fixt_app_shutdown, +@@ -36,10 +36,10 @@ int uic_main(const uic_fixt_setup_step_t *fixt_app_setup, + sl_status_t status = uic_init(fixt_app_setup, argc, argv, version); + + if (status == SL_STATUS_PRINT_INFO_MESSAGE) { +- uic_stdin_teardown(); ++ // uic_stdin_teardown(); + return 0; + } else if (status != SL_STATUS_OK) { +- uic_stdin_teardown(); ++ // uic_stdin_teardown(); + return status == SL_STATUS_ABORT ? 2 : 1; + } + +-- +2.43.0 + diff --git a/patches/UnifySDK/0012-Remove-dependency-to-uic-config.patch b/patches/UnifySDK/0012-Remove-dependency-to-uic-config.patch new file mode 100644 index 000000000..edc2f2da5 --- /dev/null +++ b/patches/UnifySDK/0012-Remove-dependency-to-uic-config.patch @@ -0,0 +1,125 @@ +From bc14d18301bd25f75d96eab081fbcf1fdd536550 Mon Sep 17 00:00:00 2001 +From: Adrian Gielniewski +Date: Tue, 26 Jul 2022 14:49:24 +0000 +Subject: [PATCH] Remove dependency to uic config. + +--- + components/uic_log/CMakeLists.txt | 1 - + components/uic_log/platform/posix/sl_log.cpp | 34 -------------------- + components/uic_main/CMakeLists.txt | 1 - + components/uic_main/src/uic_init.c | 13 -------- + 4 files changed, 49 deletions(-) + +diff --git a/components/uic_log/CMakeLists.txt b/components/uic_log/CMakeLists.txt +index f06736fa34..94ced65c99 100644 +--- a/components/uic_log/CMakeLists.txt ++++ b/components/uic_log/CMakeLists.txt +@@ -18,7 +18,6 @@ endif() + + target_link_libraries( + uic_log +- PUBLIC uic_config + PRIVATE Boost::log Boost::log_setup pthread) + + if(BUILD_TESTING) +diff --git a/components/uic_log/platform/posix/sl_log.cpp b/components/uic_log/platform/posix/sl_log.cpp +index dce6294784..b7a447de69 100644 +--- a/components/uic_log/platform/posix/sl_log.cpp ++++ b/components/uic_log/platform/posix/sl_log.cpp +@@ -39,7 +39,6 @@ + #include + #include + +-#include "config.h" + #include "sl_status.h" + + // Boost logging namespaces +@@ -187,39 +186,6 @@ sl_status_t sl_log_level_from_string(const char *level, sl_log_level_t *result) + return SL_STATUS_OK; + } + +-void sl_log_read_config() +-{ +- // Read log level from config +- const char *log_level_str; +- config_get_as_string(CONFIG_KEY_LOG_LEVEL, &log_level_str); +- sl_log_level_t log_level; +- if (CONFIG_STATUS_OK == sl_log_level_from_string(log_level_str, &log_level)) { +- sl_log_set_level(log_level); +- } +- // Read tag_levels from config in format :, :, ... +- const char *tag_level_str; +- if (CONFIG_STATUS_OK +- == config_get_as_string(CONFIG_KEY_LOG_TAG_LEVEL, &tag_level_str)) { +- boost::char_separator sep_list(","); +- std::string token_string(tag_level_str); +- boost::tokenizer> tokenizer_list(token_string, +- sep_list); +- for (auto &list_entry: tokenizer_list) { +- std::vector v; +- boost::algorithm::split(v, list_entry, [](char c) { return c == ':'; }); +- if (v.size() == 2) { +- // Remove trailing and leading whitespaces +- boost::algorithm::trim(v[0]); +- boost::algorithm::trim(v[1]); +- if (CONFIG_STATUS_OK +- == sl_log_level_from_string(v[1].c_str(), &log_level)) { +- sl_log_set_tag_level(v[0].c_str(), log_level); +- } +- } +- } +- } +-} +- + void sl_log(const char *const tag, + sl_log_level_t level, + const char *fmtstr, +diff --git a/components/uic_main/CMakeLists.txt b/components/uic_main/CMakeLists.txt +index 8379bb23d3..31e98fe0c8 100644 +--- a/components/uic_main/CMakeLists.txt ++++ b/components/uic_main/CMakeLists.txt +@@ -12,7 +12,6 @@ add_library(uic_main OBJECT ${UIC_MAIN_SRC}) + target_link_libraries( + uic_main + uic_log +- uic_config + uic_contiki_platform) + + target_include_directories( +diff --git a/components/uic_main/src/uic_init.c b/components/uic_main/src/uic_init.c +index c290fada4d..6e21abc85f 100644 +--- a/components/uic_main/src/uic_init.c ++++ b/components/uic_main/src/uic_init.c +@@ -23,7 +23,6 @@ + /* Includes from other components */ + #include "uic_version.h" + #include "sl_log.h" +-#include "config.h" + + /* Includes from this component */ + #include "uic_main.h" +@@ -60,21 +59,9 @@ sl_status_t uic_init(const uic_fixt_setup_step_t *fixt_app_setup, + char **argv, + const char *version) + { +- int ret = 0; + /* Import the system configuration. */ + sl_log_info(LOG_TAG, "# Unify build version: %s\n", UIC_VERSION); + sl_log_info(LOG_TAG, "# Unify build SHA: %s\n", UIC_VERSION_SHA); +- ret = config_parse(argc, argv, version); +- if (ret) { +- if (ret == CONFIG_STATUS_INFO_MESSAGE) { +- return SL_STATUS_PRINT_INFO_MESSAGE; +- } else if (ret != CONFIG_STATUS_OK) { +- sl_log_critical(LOG_TAG, "Cannot initialize UIC Main - goodbye!\n"); +- return SL_STATUS_FAIL; +- } +- } +- // Init log as early as possible after parsing config +- sl_log_read_config(NULL); + uic_main_contiki_setup(); + + /* Initialize system components. +-- +2.43.0 + diff --git a/patches/UnifySDK/0013-Log-to-file.patch b/patches/UnifySDK/0013-Log-to-file.patch new file mode 100644 index 000000000..cc4f43480 --- /dev/null +++ b/patches/UnifySDK/0013-Log-to-file.patch @@ -0,0 +1,78 @@ +From 2dfcc44f1a9c14928e88985a3a216072e9eb4847 Mon Sep 17 00:00:00 2001 +From: Adrian Gielniewski +Date: Tue, 7 Jun 2022 14:32:18 +0000 +Subject: [PATCH] Log to file. + +--- + components/uic_log/include/sl_log.h | 2 ++ + components/uic_log/platform/posix/sl_log.cpp | 26 +++++++++++++++----- + 2 files changed, 22 insertions(+), 6 deletions(-) + +diff --git a/components/uic_log/include/sl_log.h b/components/uic_log/include/sl_log.h +index af0de4d4b0..11b834ec95 100644 +--- a/components/uic_log/include/sl_log.h ++++ b/components/uic_log/include/sl_log.h +@@ -109,6 +109,8 @@ void sl_log_unset_tag_level(const char *tag); + */ + sl_status_t sl_log_level_from_string(const char *level, sl_log_level_t *result); + ++void sl_log_init(const char* log_file); ++ + /** + * @brief Read configuration from config library. + */ +diff --git a/components/uic_log/platform/posix/sl_log.cpp b/components/uic_log/platform/posix/sl_log.cpp +index b7a447de69..61b184bc20 100644 +--- a/components/uic_log/platform/posix/sl_log.cpp ++++ b/components/uic_log/platform/posix/sl_log.cpp +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -113,11 +114,25 @@ void color_formatter(logging::record_view const &rec, + strm << "\033[0m"; + } + +-// Initialisation of boost logging, wrapped in class to do a static initialisation +-class sl_log_singleton ++void sl_log_init(const char* log_file) + { +- public: +- sl_log_singleton() ++ if (log_file) ++ { ++ log_level = SL_LOG_DEBUG; ++ logging::add_common_attributes(); ++ logging::register_simple_formatter_factory( ++ "Severity"); ++ ++ auto sink = logging::add_file_log( ++ keywords::file_name = log_file, ++ keywords::target_file_name = log_file, ++ keywords::auto_flush = true ++ ); ++ sink->set_formatter(&std_formatter); ++ sink->set_filter( ++ phoenix::bind(&sl_log_filter, severity.or_none(), tag_attr.or_none())); ++ } ++ else + { + bool in_terminal = isatty(fileno(stderr)); + +@@ -135,8 +150,7 @@ class sl_log_singleton + sink->set_filter( + phoenix::bind(&sl_log_filter, severity.or_none(), tag_attr.or_none())); + } +-}; +-static sl_log_singleton singletron; ++} + + void sl_log_set_level(sl_log_level_t level) + { +-- +2.43.0 + diff --git a/patches/UnifySDK/0014-uic-SWPROT-9418-Add-testlib.patch b/patches/UnifySDK/0014-uic-SWPROT-9418-Add-testlib.patch new file mode 100644 index 000000000..54d3a54d7 --- /dev/null +++ b/patches/UnifySDK/0014-uic-SWPROT-9418-Add-testlib.patch @@ -0,0 +1,49 @@ +From 7ac27a73cdfd51a8c0e0b0b0bb166577eb736998 Mon Sep 17 00:00:00 2001 +From: Thomas du Boisrouvray +Date: Thu, 22 May 2025 11:52:40 +0200 +Subject: [PATCH] uic: SWPROT-9418: Add testlib + +--- + CMakeLists.txt | 3 +++ + components/CMakeLists.txt | 11 +++++++++-- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 95951d40cb..72211639b8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,6 +25,9 @@ project( + LANGUAGES C CXX + VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}) + ++ ++add_compile_options(-g3) ++ + # Set shared version string to use in filenames (deb packages etc.) + set(FILE_NAME_VERSIONING "${CMAKE_PROJECT_VERSION}") + if(VERSION_PATCH) +diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt +index 4704a689cb..3d8ec1e6c4 100644 +--- a/components/CMakeLists.txt ++++ b/components/CMakeLists.txt +@@ -167,8 +167,15 @@ set(unify-components + unify_validator + unify_application_monitoring) + +-add_library(unify SHARED) +-add_library(unify_static_non_bundle STATIC) ++add_library(unify INTERFACE) ++target_link_libraries(unify INTERFACE ++ uic_contiki ++ uic_contiki_platform ++ uic_definitions ++ uic_log ++ uic_main ++ uic_main_fd ++) + + foreach(component ${unify-components}) + if(TARGET ${component}) +-- +2.43.0 + diff --git a/patches/UnifySDK/0015-uic-SWPROT-9418-Add-support-for-emulated-tick-mode.patch b/patches/UnifySDK/0015-uic-SWPROT-9418-Add-support-for-emulated-tick-mode.patch new file mode 100644 index 000000000..38ec71a92 --- /dev/null +++ b/patches/UnifySDK/0015-uic-SWPROT-9418-Add-support-for-emulated-tick-mode.patch @@ -0,0 +1,58 @@ +From e6e10746876ec45ad6fc4a36d45be010ed43105d Mon Sep 17 00:00:00 2001 +From: Thomas du Boisrouvray +Date: Thu, 22 May 2025 11:53:55 +0200 +Subject: [PATCH] uic: SWPROT-9418: Add support for emulated tick mode + +--- + components/uic_contiki/platform/posix/clock.c | 24 ++++++++++++++----- + 1 file changed, 18 insertions(+), 6 deletions(-) + +diff --git a/components/uic_contiki/platform/posix/clock.c b/components/uic_contiki/platform/posix/clock.c +index 7e7312ed84..287bafdb1b 100644 +--- a/components/uic_contiki/platform/posix/clock.c ++++ b/components/uic_contiki/platform/posix/clock.c +@@ -48,23 +48,35 @@ + #ifndef CLOCK_MONOTONIC_RAW + #define CLOCK_MONOTONIC_RAW 4 + #endif ++ ++typedef uint32_t (*get_tick_t)(void); ++extern get_tick_t get_tick_fcn; ++ + /*---------------------------------------------------------------------------*/ + clock_time_t + clock_time(void) + { +- struct timespec ts; +- clock_gettime(CLOCK_MONOTONIC_RAW,&ts); ++ if (get_tick_fcn) { ++ return get_tick_fcn(); ++ } else { ++ struct timespec ts; ++ clock_gettime(CLOCK_MONOTONIC_RAW,&ts); + +- return ts.tv_sec * 1000 + ts.tv_nsec / 1000000; ++ return ts.tv_sec * 1000 + ts.tv_nsec / 1000000; ++ } + } + /*---------------------------------------------------------------------------*/ + unsigned long + clock_seconds(void) + { +- struct timespec ts; +- clock_gettime(CLOCK_MONOTONIC_RAW,&ts); ++ if (get_tick_fcn) { ++ return get_tick_fcn() / 1000; ++ } else { ++ struct timespec ts; ++ clock_gettime(CLOCK_MONOTONIC_RAW,&ts); + +- return ts.tv_sec; ++ return ts.tv_sec; ++ } + } + #else + #include "sys/clock.h" +-- +2.43.0 + diff --git a/patches/UnifySDK/0016-uic-SWPROT-9418-Restore-uic_main-and-create-library-.patch b/patches/UnifySDK/0016-uic-SWPROT-9418-Restore-uic_main-and-create-library-.patch new file mode 100644 index 000000000..24b78f1b6 --- /dev/null +++ b/patches/UnifySDK/0016-uic-SWPROT-9418-Restore-uic_main-and-create-library-.patch @@ -0,0 +1,94 @@ +From 97a88bde8e5c2fbf14a31bc0ee8a265b0134a9e9 Mon Sep 17 00:00:00 2001 +From: Thomas du Boisrouvray +Date: Thu, 22 May 2025 11:55:38 +0200 +Subject: [PATCH] uic: SWPROT-9418: Restore uic_main and create library + uic_main_testlib + +--- + components/uic_main/CMakeLists.txt | 24 +++++++++++++++++++ + .../src/uic_component_fixtures_array.c | 10 ++++++++ + 2 files changed, 34 insertions(+) + +diff --git a/components/uic_main/CMakeLists.txt b/components/uic_main/CMakeLists.txt +index 31e98fe0c8..932568d34d 100644 +--- a/components/uic_main/CMakeLists.txt ++++ b/components/uic_main/CMakeLists.txt +@@ -6,12 +6,15 @@ set(UIC_MAIN_SRC + src/uic_component_fixtures.c + src/uic_signal_handler.c + platform/${COMPATIBLE_PLATFORM}/uic_main_externals_platform.c) ++ + set(UIC_MAIN_INCLUDE $ + $) ++ + add_library(uic_main OBJECT ${UIC_MAIN_SRC}) + target_link_libraries( + uic_main + uic_log ++ uic_mqtt + uic_contiki_platform) + + target_include_directories( +@@ -24,3 +27,24 @@ install_headers(uic_main uic libuic-dev) + if(BUILD_TESTING) + add_subdirectory(test) + endif() ++ ++# ZWAVE_TESTLIB uic_main libary ++ ++add_library(uic_main_testlib OBJECT ${UIC_MAIN_SRC}) ++target_link_libraries( ++ uic_main_testlib ++ uic_log ++ uic_main_fd ++ uic_contiki_platform) ++ ++target_include_directories( ++ uic_main_testlib ++ PUBLIC ${UIC_MAIN_INCLUDE} $ ++ PRIVATE src/ platform/${COMPATIBLE_PLATFORM}/) ++ ++install_headers(uic_main_testlib uic libuic-dev) ++ ++target_compile_definitions( ++ uic_main_testlib ++ PRIVATE ZWAVE_TESTLIB) ++ +diff --git a/components/uic_main/src/uic_component_fixtures_array.c b/components/uic_main/src/uic_component_fixtures_array.c +index b50402e5d1..4377a71894 100644 +--- a/components/uic_main/src/uic_component_fixtures_array.c ++++ b/components/uic_main/src/uic_component_fixtures_array.c +@@ -13,6 +13,10 @@ + + #include "sl_log.h" + ++#ifndef ZWAVE_TESTLIB ++#include "uic_mqtt.h" ++#endif ++ + #include "uic_component_fixtures_internal.h" + #include "uic_signal_handler.h" + /** Pre-contiki set-up steps. +@@ -30,6 +34,9 @@ + */ + static uic_fixt_setup_step_t uic_fixt_setup_steps_list[] + = {{uic_signal_handler_setup, "Unify Signal Handler"}, ++#ifndef ZWAVE_TESTLIB ++ {uic_mqtt_setup, "Unify MQTT Client"}, ++#endif + {NULL, "Terminator"}}; + + /** Final tear-down steps. +@@ -42,6 +49,9 @@ static uic_fixt_setup_step_t uic_fixt_setup_steps_list[] + */ + static uic_fixt_shutdown_step_t uic_fixt_shutdown_steps_list[] + = { ++#ifndef ZWAVE_TESTLIB ++ {uic_mqtt_teardown, "Unify MQTT Client"}, ++#endif + {NULL, "Terminator"}}; + + /** +-- +2.43.0 + diff --git a/patches/UnifySDK/0017-SWPROT-9418-Restore-uic_stdin-functionnalities-in-ui.patch b/patches/UnifySDK/0017-SWPROT-9418-Restore-uic_stdin-functionnalities-in-ui.patch new file mode 100644 index 000000000..0defa4d87 --- /dev/null +++ b/patches/UnifySDK/0017-SWPROT-9418-Restore-uic_stdin-functionnalities-in-ui.patch @@ -0,0 +1,89 @@ +From 71590cd24571ae61bd2f996e4a4f72915ff759be Mon Sep 17 00:00:00 2001 +From: Thomas du Boisrouvray +Date: Tue, 25 Mar 2025 17:45:13 +0100 +Subject: [PATCH] SWPROT-9418: Restore uic_stdin functionnalities in uic_main + +Restore functionnalities removed in cf5f769da to be able to compile +testlib. Instead create a dedicated library uic_stdin_testlib to be able +to compile the testlib +--- + components/uic_main/CMakeLists.txt | 1 + + .../uic_main/src/uic_component_fixtures_array.c | 3 +++ + components/uic_main/src/uic_main.c | 12 +++++++++--- + 3 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/components/uic_main/CMakeLists.txt b/components/uic_main/CMakeLists.txt +index 932568d34d..4f7c8878c2 100644 +--- a/components/uic_main/CMakeLists.txt ++++ b/components/uic_main/CMakeLists.txt +@@ -15,6 +15,7 @@ target_link_libraries( + uic_main + uic_log + uic_mqtt ++ uic_stdin + uic_contiki_platform) + + target_include_directories( +diff --git a/components/uic_main/src/uic_component_fixtures_array.c b/components/uic_main/src/uic_component_fixtures_array.c +index 4377a71894..2d01ba54a7 100644 +--- a/components/uic_main/src/uic_component_fixtures_array.c ++++ b/components/uic_main/src/uic_component_fixtures_array.c +@@ -15,6 +15,7 @@ + + #ifndef ZWAVE_TESTLIB + #include "uic_mqtt.h" ++#include "uic_stdin_process.h" + #endif + + #include "uic_component_fixtures_internal.h" +@@ -36,6 +37,7 @@ static uic_fixt_setup_step_t uic_fixt_setup_steps_list[] + = {{uic_signal_handler_setup, "Unify Signal Handler"}, + #ifndef ZWAVE_TESTLIB + {uic_mqtt_setup, "Unify MQTT Client"}, ++ {uic_stdin_setup, "Unify STDIN"}, + #endif + {NULL, "Terminator"}}; + +@@ -51,6 +53,7 @@ static uic_fixt_shutdown_step_t uic_fixt_shutdown_steps_list[] + = { + #ifndef ZWAVE_TESTLIB + {uic_mqtt_teardown, "Unify MQTT Client"}, ++ {uic_stdin_teardown, "Unify STDIN"}, + #endif + {NULL, "Terminator"}}; + +diff --git a/components/uic_main/src/uic_main.c b/components/uic_main/src/uic_main.c +index 0d75cd153e..b991084440 100644 +--- a/components/uic_main/src/uic_main.c ++++ b/components/uic_main/src/uic_main.c +@@ -23,7 +23,9 @@ + + #define LOG_TAG "uic_main" + +-// extern int uic_stdin_teardown(); ++#ifndef ZWAVE_TESTLIB ++extern int uic_stdin_teardown(); ++#endif + + int uic_main(const uic_fixt_setup_step_t *fixt_app_setup, + const uic_fixt_shutdown_step_t *fixt_app_shutdown, +@@ -36,10 +38,14 @@ int uic_main(const uic_fixt_setup_step_t *fixt_app_setup, + sl_status_t status = uic_init(fixt_app_setup, argc, argv, version); + + if (status == SL_STATUS_PRINT_INFO_MESSAGE) { +- // uic_stdin_teardown(); ++#ifndef ZWAVE_TESTLIB ++ uic_stdin_teardown(); ++#endif + return 0; + } else if (status != SL_STATUS_OK) { +- // uic_stdin_teardown(); ++#ifndef ZWAVE_TESTLIB ++ uic_stdin_teardown(); ++#endif + return status == SL_STATUS_ABORT ? 2 : 1; + } + +-- +2.43.0 + diff --git a/patches/UnifySDK/0018-SWPROT-9418-Restore-uic_log-library-and-create-uic_l.patch b/patches/UnifySDK/0018-SWPROT-9418-Restore-uic_log-library-and-create-uic_l.patch new file mode 100644 index 000000000..14e7c92db --- /dev/null +++ b/patches/UnifySDK/0018-SWPROT-9418-Restore-uic_log-library-and-create-uic_l.patch @@ -0,0 +1,131 @@ +From 6451f1ba32941d3b2d86f73e448d45f20062f123 Mon Sep 17 00:00:00 2001 +From: Thomas du Boisrouvray +Date: Tue, 25 Mar 2025 17:55:34 +0100 +Subject: [PATCH] SWPROT-9418: Restore uic_log library and create + uic_log_testlib + +Restore functionnalities removed in f72ef71a6 to be able to compile the +testlib. Instead create uic_log_testlib library to compile the testlib. +--- + components/uic_log/CMakeLists.txt | 29 +++++++++++++++ + components/uic_log/platform/posix/sl_log.cpp | 38 ++++++++++++++++++++ + components/uic_main/CMakeLists.txt | 2 +- + 3 files changed, 68 insertions(+), 1 deletion(-) + +diff --git a/components/uic_log/CMakeLists.txt b/components/uic_log/CMakeLists.txt +index 94ced65c99..fc29ed9ab8 100644 +--- a/components/uic_log/CMakeLists.txt ++++ b/components/uic_log/CMakeLists.txt +@@ -18,6 +18,7 @@ endif() + + target_link_libraries( + uic_log ++ PUBLIC uic_config + PRIVATE Boost::log Boost::log_setup pthread) + + if(BUILD_TESTING) +@@ -29,3 +30,31 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_options(uic_log PRIVATE -Wno-psabi) + endif() + install_headers(uic_log uic libuic-dev) ++ ++# ZWAVE_TESTLIB uic_log library ++add_library(uic_log_testlib OBJECT platform/${COMPATIBLE_PLATFORM}/sl_log.cpp) ++if(EXISTS ${COMMON_LOCATION}) ++ target_include_directories(uic_log_testlib PUBLIC ++ $ ++ $ ++ $) ++else() ++ target_include_directories(uic_log_testlib PUBLIC ++ $ ++ $ ++ $) ++endif() ++ ++target_link_libraries( ++ uic_log_testlib ++ PRIVATE Boost::log Boost::log_setup pthread) ++ ++# Disable compiler note for ps abi on Linux ++if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") ++ target_compile_options(uic_log_testlib PRIVATE -Wno-psabi) ++endif() ++install_headers(uic_log_testlib uic libuic-dev) ++ ++target_compile_definitions( ++ uic_log_testlib ++ PRIVATE ZWAVE_TESTLIB) +\ No newline at end of file +diff --git a/components/uic_log/platform/posix/sl_log.cpp b/components/uic_log/platform/posix/sl_log.cpp +index 61b184bc20..2a6f6bd574 100644 +--- a/components/uic_log/platform/posix/sl_log.cpp ++++ b/components/uic_log/platform/posix/sl_log.cpp +@@ -40,6 +40,9 @@ + #include + #include + ++#ifndef ZWAVE_TESTLIB ++#include "config.h" ++#endif + #include "sl_status.h" + + // Boost logging namespaces +@@ -200,6 +203,41 @@ sl_status_t sl_log_level_from_string(const char *level, sl_log_level_t *result) + return SL_STATUS_OK; + } + ++#ifndef ZWAVE_TESTLIB ++void sl_log_read_config() ++{ ++ // Read log level from config ++ const char *log_level_str; ++ config_get_as_string(CONFIG_KEY_LOG_LEVEL, &log_level_str); ++ sl_log_level_t log_level; ++ if (CONFIG_STATUS_OK == sl_log_level_from_string(log_level_str, &log_level)) { ++ sl_log_set_level(log_level); ++ } ++ // Read tag_levels from config in format :, :, ... ++ const char *tag_level_str; ++ if (CONFIG_STATUS_OK ++ == config_get_as_string(CONFIG_KEY_LOG_TAG_LEVEL, &tag_level_str)) { ++ boost::char_separator sep_list(","); ++ std::string token_string(tag_level_str); ++ boost::tokenizer> tokenizer_list(token_string, ++ sep_list); ++ for (auto &list_entry: tokenizer_list) { ++ std::vector v; ++ boost::algorithm::split(v, list_entry, [](char c) { return c == ':'; }); ++ if (v.size() == 2) { ++ // Remove trailing and leading whitespaces ++ boost::algorithm::trim(v[0]); ++ boost::algorithm::trim(v[1]); ++ if (CONFIG_STATUS_OK ++ == sl_log_level_from_string(v[1].c_str(), &log_level)) { ++ sl_log_set_tag_level(v[0].c_str(), log_level); ++ } ++ } ++ } ++ } ++} ++#endif ++ + void sl_log(const char *const tag, + sl_log_level_t level, + const char *fmtstr, +diff --git a/components/uic_main/CMakeLists.txt b/components/uic_main/CMakeLists.txt +index 4f7c8878c2..5bfcb62143 100644 +--- a/components/uic_main/CMakeLists.txt ++++ b/components/uic_main/CMakeLists.txt +@@ -34,7 +34,7 @@ endif() + add_library(uic_main_testlib OBJECT ${UIC_MAIN_SRC}) + target_link_libraries( + uic_main_testlib +- uic_log ++ uic_log_testlib + uic_main_fd + uic_contiki_platform) + +-- +2.43.0 + diff --git a/patches/UnifySDK/0019-SWPROT-9418-Add-library-uic_main_fd_testlib.patch b/patches/UnifySDK/0019-SWPROT-9418-Add-library-uic_main_fd_testlib.patch new file mode 100644 index 000000000..fb7525099 --- /dev/null +++ b/patches/UnifySDK/0019-SWPROT-9418-Add-library-uic_main_fd_testlib.patch @@ -0,0 +1,30 @@ +From 6c5a5fddae586cdb8e70015d8263d2bc0364eef0 Mon Sep 17 00:00:00 2001 +From: Thomas du Boisrouvray +Date: Wed, 26 Mar 2025 16:21:51 +0100 +Subject: [PATCH] SWPROT-9418: Add library uic_main_fd_testlib + +--- + components/uic_main_fd/CMakeLists.txt | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/components/uic_main_fd/CMakeLists.txt b/components/uic_main_fd/CMakeLists.txt +index d8cf24d663..a3263f223a 100644 +--- a/components/uic_main_fd/CMakeLists.txt ++++ b/components/uic_main_fd/CMakeLists.txt +@@ -10,3 +10,13 @@ install_headers(uic_main_fd uic libuic-dev) + if(BUILD_TESTING) + target_add_mock(uic_main_fd) + endif() ++ ++# ZWAVE_TESTLIB uic_main_fd library ++add_library(uic_main_fd_testlib OBJECT src/uic_main_externals.c) ++target_link_libraries(uic_main_fd_testlib PUBLIC uic_contiki uic_log_testlib) ++target_include_directories( ++ uic_main_fd_testlib ++ PUBLIC $ ++ PRIVATE src/) ++ ++install_headers(uic_main_fd_testlib uic libuic-dev) +-- +2.43.0 + diff --git a/patches/UnifySDK/0020-uic-SWPROT-9418-Add-library-unify_testlib.patch b/patches/UnifySDK/0020-uic-SWPROT-9418-Add-library-unify_testlib.patch new file mode 100644 index 000000000..8a35ce726 --- /dev/null +++ b/patches/UnifySDK/0020-uic-SWPROT-9418-Add-library-unify_testlib.patch @@ -0,0 +1,72 @@ +From b29f61491501530e4ed8c4b067030992540338a9 Mon Sep 17 00:00:00 2001 +From: Thomas du Boisrouvray +Date: Thu, 22 May 2025 11:56:19 +0200 +Subject: [PATCH] uic: SWPROT-9418: Add library unify_testlib + +--- + components/CMakeLists.txt | 31 +++++++++++++++++++++--------- + components/uic_main/CMakeLists.txt | 2 +- + 2 files changed, 23 insertions(+), 10 deletions(-) + +diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt +index 3d8ec1e6c4..58737a11b9 100644 +--- a/components/CMakeLists.txt ++++ b/components/CMakeLists.txt +@@ -167,15 +167,8 @@ set(unify-components + unify_validator + unify_application_monitoring) + +-add_library(unify INTERFACE) +-target_link_libraries(unify INTERFACE +- uic_contiki +- uic_contiki_platform +- uic_definitions +- uic_log +- uic_main +- uic_main_fd +-) ++add_library(unify SHARED) ++add_library(unify_static_non_bundle STATIC) + + foreach(component ${unify-components}) + if(TARGET ${component}) +@@ -289,3 +282,23 @@ if (NOT EXISTS ${p}) + else() + include(${p}) + endif() ++ ++# unify testlib library ++add_library(unify_testlib INTERFACE) ++ ++set(unify-testlib-components ++ uic_contiki ++ uic_contiki_platform ++ uic_definitions ++ uic_log_testlib ++ uic_main_testlib ++ uic_main_fd_testlib ++) ++ ++foreach(component ${unify-testlib-components}) ++ if(TARGET ${component}) ++ set_property(TARGET ${component} PROPERTY POSITION_INDEPENDENT_CODE 1) ++ endif() ++endforeach() ++ ++target_link_libraries(unify_testlib INTERFACE ${unify-testlib-components}) +diff --git a/components/uic_main/CMakeLists.txt b/components/uic_main/CMakeLists.txt +index 5bfcb62143..9eabca21c6 100644 +--- a/components/uic_main/CMakeLists.txt ++++ b/components/uic_main/CMakeLists.txt +@@ -35,7 +35,7 @@ add_library(uic_main_testlib OBJECT ${UIC_MAIN_SRC}) + target_link_libraries( + uic_main_testlib + uic_log_testlib +- uic_main_fd ++ uic_main_fd_testlib + uic_contiki_platform) + + target_include_directories( +-- +2.43.0 + diff --git a/patches/UnifySDK/0021-SWPROT-9418-Restore-config-functionnality-in-uic_ini.patch b/patches/UnifySDK/0021-SWPROT-9418-Restore-config-functionnality-in-uic_ini.patch new file mode 100644 index 000000000..f48bfb761 --- /dev/null +++ b/patches/UnifySDK/0021-SWPROT-9418-Restore-config-functionnality-in-uic_ini.patch @@ -0,0 +1,60 @@ +From dd30e22f016c1b7b8a8e6a7fc9b1edb16adc06fb Mon Sep 17 00:00:00 2001 +From: Thomas du Boisrouvray +Date: Fri, 28 Mar 2025 16:39:10 +0100 +Subject: [PATCH] SWPROT-9418: Restore config functionnality in uic_init + +--- + components/uic_main/CMakeLists.txt | 1 + + components/uic_main/src/uic_init.c | 17 +++++++++++++++++ + 2 files changed, 18 insertions(+) + +diff --git a/components/uic_main/CMakeLists.txt b/components/uic_main/CMakeLists.txt +index 9eabca21c6..39caa559b4 100644 +--- a/components/uic_main/CMakeLists.txt ++++ b/components/uic_main/CMakeLists.txt +@@ -15,6 +15,7 @@ target_link_libraries( + uic_main + uic_log + uic_mqtt ++ uic_config + uic_stdin + uic_contiki_platform) + +diff --git a/components/uic_main/src/uic_init.c b/components/uic_main/src/uic_init.c +index 6e21abc85f..e87f7570e5 100644 +--- a/components/uic_main/src/uic_init.c ++++ b/components/uic_main/src/uic_init.c +@@ -23,6 +23,9 @@ + /* Includes from other components */ + #include "uic_version.h" + #include "sl_log.h" ++#ifndef ZWAVE_TESTLIB ++#include "config.h" ++#endif + + /* Includes from this component */ + #include "uic_main.h" +@@ -62,6 +65,20 @@ sl_status_t uic_init(const uic_fixt_setup_step_t *fixt_app_setup, + /* Import the system configuration. */ + sl_log_info(LOG_TAG, "# Unify build version: %s\n", UIC_VERSION); + sl_log_info(LOG_TAG, "# Unify build SHA: %s\n", UIC_VERSION_SHA); ++#ifndef ZWAVE_TESTLIB ++ int ret = 0; ++ ret = config_parse(argc, argv, version); ++ if (ret) { ++ if (ret == CONFIG_STATUS_INFO_MESSAGE) { ++ return SL_STATUS_PRINT_INFO_MESSAGE; ++ } else if (ret != CONFIG_STATUS_OK) { ++ sl_log_critical(LOG_TAG, "Cannot initialize UIC Main - goodbye!\n"); ++ return SL_STATUS_FAIL; ++ } ++ } ++ // Init log as early as possible after parsing config ++ sl_log_read_config(NULL); ++#endif + uic_main_contiki_setup(); + + /* Initialize system components. +-- +2.43.0 + diff --git a/patches/UnifySDK/0022-SWPROT-9418-Add-contiki-testlib-libraries.patch b/patches/UnifySDK/0022-SWPROT-9418-Add-contiki-testlib-libraries.patch new file mode 100644 index 000000000..b4fa103db --- /dev/null +++ b/patches/UnifySDK/0022-SWPROT-9418-Add-contiki-testlib-libraries.patch @@ -0,0 +1,111 @@ +From 310cbf78e2e7a270bf327a0282cb8145fbc4acca Mon Sep 17 00:00:00 2001 +From: Thomas du Boisrouvray +Date: Mon, 31 Mar 2025 11:23:32 +0200 +Subject: [PATCH] SWPROT-9418: Add contiki testlib libraries + +Testlib can override the default contiki get_time functions with an emulated +tick. Create _testlib library that support this behavior. +--- + components/CMakeLists.txt | 4 ++-- + components/uic_contiki/CMakeLists.txt | 23 +++++++++++++++++++ + components/uic_contiki/platform/posix/clock.c | 11 ++++++++- + 3 files changed, 35 insertions(+), 3 deletions(-) + +diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt +index 58737a11b9..1f3a1f73b9 100644 +--- a/components/CMakeLists.txt ++++ b/components/CMakeLists.txt +@@ -287,8 +287,8 @@ endif() + add_library(unify_testlib INTERFACE) + + set(unify-testlib-components +- uic_contiki +- uic_contiki_platform ++ uic_contiki_testlib ++ uic_contiki_platform_testlib + uic_definitions + uic_log_testlib + uic_main_testlib +diff --git a/components/uic_contiki/CMakeLists.txt b/components/uic_contiki/CMakeLists.txt +index 8a57bcfd5a..23ceb32a22 100644 +--- a/components/uic_contiki/CMakeLists.txt ++++ b/components/uic_contiki/CMakeLists.txt +@@ -78,3 +78,26 @@ if(BUILD_TESTING) + + add_subdirectory(test) + endif() ++ ++# uic_contiki _testlib libraries ++add_library(uic_contiki_testlib OBJECT ${CONTIKI_SRC} src/rust_process.c) ++target_include_directories(uic_contiki_testlib PUBLIC ${CONTIKI_INC}) ++ ++add_library(uic_contiki_platform_testlib OBJECT ++ platform/${COMPATIBLE_PLATFORM}/clock.c) ++ ++if(NOT APPLE) ++ target_link_libraries(uic_contiki_platform_testlib PRIVATE ${PRIVATE_LIB_LIST}) ++endif() ++ ++target_include_directories( ++ uic_contiki_platform_testlib ++ PUBLIC ++ $ ++ $ ++ $ ++ $) ++ ++target_compile_definitions(uic_contiki_platform_testlib PRIVATE ZWAVE_TESTLIB) ++ ++target_link_libraries(uic_contiki_testlib PRIVATE uic_contiki_platform_testlib uic_log_testlib) +diff --git a/components/uic_contiki/platform/posix/clock.c b/components/uic_contiki/platform/posix/clock.c +index 287bafdb1b..1b36ade70d 100644 +--- a/components/uic_contiki/platform/posix/clock.c ++++ b/components/uic_contiki/platform/posix/clock.c +@@ -49,34 +49,43 @@ + #define CLOCK_MONOTONIC_RAW 4 + #endif + ++#ifdef ZWAVE_TESTLIB + typedef uint32_t (*get_tick_t)(void); + extern get_tick_t get_tick_fcn; +- ++#endif + /*---------------------------------------------------------------------------*/ + clock_time_t + clock_time(void) + { ++#ifdef ZWAVE_TESTLIB + if (get_tick_fcn) { + return get_tick_fcn(); + } else { ++#endif + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC_RAW,&ts); + + return ts.tv_sec * 1000 + ts.tv_nsec / 1000000; ++#ifdef ZWAVE_TESTLIB + } ++#endif + } + /*---------------------------------------------------------------------------*/ + unsigned long + clock_seconds(void) + { ++#ifdef ZWAVE_TESTLIB + if (get_tick_fcn) { + return get_tick_fcn() / 1000; + } else { ++#endif + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC_RAW,&ts); + + return ts.tv_sec; ++#ifdef ZWAVE_TESTLIB + } ++#endif + } + #else + #include "sys/clock.h" +-- +2.43.0 + diff --git a/scripts/sd_card/pyshrink/LICENSE b/scripts/sd_card/pyshrink/LICENSE deleted file mode 100644 index 68119d274..000000000 --- a/scripts/sd_card/pyshrink/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Drew Bonasera - -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. - - diff --git a/scripts/sd_card/pyshrink/README.md b/scripts/sd_card/pyshrink/README.md deleted file mode 100644 index 9b7939769..000000000 --- a/scripts/sd_card/pyshrink/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -# PiShrink # - -PiShrink is a bash script that automatically shrink a pi image that will then resize to the max size of the SD card on boot. This will make putting the image back onto the SD card faster and the shrunk images will compress better. -In addition the shrunk image can be compressed with gzip and xz to create an even smaller image. Parallel compression of the image -using multiple cores is supported. - -## Usage ## - -``` -Usage: $0 [-adhrspvzZ] imagefile.img [newimagefile.img] - - -s Don't expand filesystem when image is booted the first time - -v Be verbose - -r Use advanced filesystem repair option if the normal one fails - -z Compress image after shrinking with gzip - -Z Compress image after shrinking with xz - -a Compress image in parallel using multiple cores - -p Remove logs, apt archives, dhcp leases and ssh hostkeys - -d Write debug messages in a debug log file -``` - -If you specify the `newimagefile.img` parameter, the script will make a copy of `imagefile.img` and work off that. You will need enough space to make a full copy of the image to use that option. - -* `-s` prevents automatic filesystem expansion on the images next boot -* `-v` enables more verbose output -* `-r` will attempt to repair the filesystem using additional options if the normal repair fails -* `-z` will compress the image after shrinking using gzip. `.gz` extension will be added to the filename. -* `-Z` will compress the image after shrinking using xz. `.xz` extension will be added to the filename. -* `-a` will use option -f9 for pigz and option -T0 for xz and compress in parallel. -* `-d` will create a logfile `pishrink.log` which may help for problem analysis. - -Default options for compressors can be overwritten by defining PISHRINK_GZIP or PSHRINK_XZ environment variables for gzip and xz. - -## Prerequisites ## - -If you are running PiShrink in VirtualBox you will likely encounter an error if you -attempt to use VirtualBox's "Shared Folder" feature. You can copy the image you wish to -shrink on to the VM from a Shared Folder, but shrinking directctly from the Shared Folder -is know to cause issues. - -If using Ubuntu, you will likely see an error about `e2fsck` being out of date and `metadata_csum`. The simplest fix for this is to use Ubuntu 16.10 and up, as it will save you a lot of hassle in the long run. - -## Installation ## - -```bash -wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh -chmod +x pishrink.sh -sudo mv pishrink.sh /usr/local/bin -``` - -## Example ## - -```bash -[user@localhost PiShrink]$ sudo pishrink.sh pi.img -e2fsck 1.42.9 (28-Dec-2013) -Pass 1: Checking inodes, blocks, and sizes -Pass 2: Checking directory structure -Pass 3: Checking directory connectivity -Pass 4: Checking reference counts -Pass 5: Checking group summary information -/dev/loop1: 88262/1929536 files (0.2% non-contiguous), 842728/7717632 blocks -resize2fs 1.42.9 (28-Dec-2013) -resize2fs 1.42.9 (28-Dec-2013) -Resizing the filesystem on /dev/loop1 to 773603 (4k) blocks. -Begin pass 2 (max = 100387) -Relocating blocks XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -Begin pass 3 (max = 236) -Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -Begin pass 4 (max = 7348) -Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -The filesystem on /dev/loop1 is now 773603 blocks long. - -Shrunk pi.img from 30G to 3.1G -``` - -## Contributing ## - -If you find a bug please create an issue for it. If you would like a new feature added, you can create an issue for it but I can't promise that I will get to it. - -Pull requests for new features and bug fixes are more than welcome! diff --git a/scripts/sd_card/pyshrink/pyshrink.sh b/scripts/sd_card/pyshrink/pyshrink.sh deleted file mode 100755 index fbaa07a98..000000000 --- a/scripts/sd_card/pyshrink/pyshrink.sh +++ /dev/null @@ -1,430 +0,0 @@ -#!/bin/bash - -version="v0.1.2" - -CURRENT_DIR="$(pwd)" -SCRIPTNAME="${0##*/}" -MYNAME="${SCRIPTNAME%.*}" -LOGFILE="${CURRENT_DIR}/${SCRIPTNAME%.*}.log" -REQUIRED_TOOLS="parted losetup tune2fs md5sum e2fsck resize2fs" -ZIPTOOLS=("gzip xz") -declare -A ZIP_PARALLEL_TOOL=( [gzip]="pigz" [xz]="xz" ) # parallel zip tool to use in parallel mode -declare -A ZIP_PARALLEL_OPTIONS=( [gzip]="-f9" [xz]="-T0" ) # options for zip tools in parallel mode -declare -A ZIPEXTENSIONS=( [gzip]="gz" [xz]="xz" ) # extensions of zipped files - -function info() { - echo "$SCRIPTNAME: $1 ..." -} - -function error() { - echo -n "$SCRIPTNAME: ERROR occurred in line $1: " - shift - echo "$@" -} - -function cleanup() { - if losetup "$loopback" &>/dev/null; then - losetup -d "$loopback" - fi - if [ "$debug" = true ]; then - local old_owner=$(stat -c %u:%g "$src") - chown "$old_owner" "$LOGFILE" - fi - -} - -function logVariables() { - if [ "$debug" = true ]; then - echo "Line $1" >> "$LOGFILE" - shift - local v var - for var in "$@"; do - eval "v=\$$var" - echo "$var: $v" >> "$LOGFILE" - done - fi -} - -function checkFilesystem() { - info "Checking filesystem" - e2fsck -pf "$loopback" - (( $? < 4 )) && return - - info "Filesystem error detected!" - - info "Trying to recover corrupted filesystem" - e2fsck -y "$loopback" - (( $? < 4 )) && return - -if [[ $repair == true ]]; then - info "Trying to recover corrupted filesystem - Phase 2" - e2fsck -fy -b 32768 "$loopback" - (( $? < 4 )) && return -fi - error $LINENO "Filesystem recoveries failed. Giving up..." - exit 9 - -} - -function set_autoexpand() { - #Make pi expand rootfs on next boot - mountdir=$(mktemp -d) - partprobe "$loopback" - mount "$loopback" "$mountdir" - - if [ ! -d "$mountdir/etc" ]; then - info "/etc not found, autoexpand will not be enabled" - umount "$mountdir" - return - fi - - if [[ -f "$mountdir/etc/rc.local" ]] && [[ "$(md5sum "$mountdir/etc/rc.local" | cut -d ' ' -f 1)" != "1c579c7d5b4292fd948399b6ece39009" ]]; then - echo "Creating new /etc/rc.local" - if [ -f "$mountdir/etc/rc.local" ]; then - mv "$mountdir/etc/rc.local" "$mountdir/etc/rc.local.bak" - fi - - #####Do not touch the following lines##### -cat <<\EOF1 > "$mountdir/etc/rc.local" -#!/bin/bash -do_expand_rootfs() { - ROOT_PART=$(mount | sed -n 's|^/dev/\(.*\) on / .*|\1|p') - - PART_NUM=${ROOT_PART#mmcblk0p} - if [ "$PART_NUM" = "$ROOT_PART" ]; then - echo "$ROOT_PART is not an SD card. Don't know how to expand" - return 0 - fi - - # Get the starting offset of the root partition - PART_START=$(parted /dev/mmcblk0 -ms unit s p | grep "^${PART_NUM}" | cut -f 2 -d: | sed 's/[^0-9]//g') - [ "$PART_START" ] || return 1 - # Return value will likely be error for fdisk as it fails to reload the - # partition table because the root fs is mounted - fdisk /dev/mmcblk0 < /etc/rc.local && -#!/bin/sh -echo "Expanding /dev/$ROOT_PART" -resize2fs /dev/$ROOT_PART -rm -f /etc/rc.local; cp -f /etc/rc.local.bak /etc/rc.local; /etc/rc.local - -EOF -reboot -exit -} -raspi_config_expand() { -/usr/bin/env raspi-config --expand-rootfs -if [[ $? != 0 ]]; then - return -1 -else - rm -f /etc/rc.local; cp -f /etc/rc.local.bak /etc/rc.local; /etc/rc.local - reboot - exit -fi -} -raspi_config_expand -echo "WARNING: Using backup expand..." -sleep 5 -do_expand_rootfs -echo "ERROR: Expanding failed..." -sleep 5 -if [[ -f /etc/rc.local.bak ]]; then - cp -f /etc/rc.local.bak /etc/rc.local - /etc/rc.local -fi -exit 0 -EOF1 - #####End no touch zone##### - chmod +x "$mountdir/etc/rc.local" - fi - umount "$mountdir" -} - -help() { - local help - read -r -d '' help << EOM -Usage: $0 [-adhrspvzZ] imagefile.img [newimagefile.img] - - -s Don't expand filesystem when image is booted the first time - -v Be verbose - -r Use advanced filesystem repair option if the normal one fails - -z Compress image after shrinking with gzip - -Z Compress image after shrinking with xz - -a Compress image in parallel using multiple cores - -p Remove logs, apt archives, dhcp leases and ssh hostkeys - -d Write debug messages in a debug log file -EOM - echo "$help" - exit 1 -} - -should_skip_autoexpand=false -debug=false -repair=false -parallel=false -verbose=false -prep=false -ziptool="" - -while getopts ":adhprsvzZ" opt; do - case "${opt}" in - a) parallel=true;; - d) debug=true;; - h) help;; - p) prep=true;; - r) repair=true;; - s) should_skip_autoexpand=true ;; - v) verbose=true;; - z) ziptool="gzip";; - Z) ziptool="xz";; - *) help;; - esac -done -shift $((OPTIND-1)) - -if [ "$debug" = true ]; then - info "Creating log file $LOGFILE" - rm "$LOGFILE" &>/dev/null - exec 1> >(stdbuf -i0 -o0 -e0 tee -a "$LOGFILE" >&1) - exec 2> >(stdbuf -i0 -o0 -e0 tee -a "$LOGFILE" >&2) -fi - -echo "${0##*/} $version" - -#Args -src="$1" -img="$1" - -#Usage checks -if [[ -z "$img" ]]; then - help -fi - -if [[ ! -f "$img" ]]; then - error $LINENO "$img is not a file..." - exit 2 -fi -if (( EUID != 0 )); then - error $LINENO "You need to be running as root." - exit 3 -fi - -# set locale to POSIX(English) temporarily -# these locale settings only affect the script and its sub processes - -export LANGUAGE=POSIX -export LC_ALL=POSIX -export LANG=POSIX - - -# check selected compression tool is supported and installed -if [[ -n $ziptool ]]; then - if [[ ! " ${ZIPTOOLS[@]} " =~ $ziptool ]]; then - error $LINENO "$ziptool is an unsupported ziptool." - exit 17 - else - if [[ $parallel == true && $ziptool == "gzip" ]]; then - REQUIRED_TOOLS="$REQUIRED_TOOLS pigz" - else - REQUIRED_TOOLS="$REQUIRED_TOOLS $ziptool" - fi - fi -fi - -#Check that what we need is installed -for command in $REQUIRED_TOOLS; do - command -v $command >/dev/null 2>&1 - if (( $? != 0 )); then - error $LINENO "$command is not installed." - exit 4 - fi -done - -#Copy to new file if requested -if [ -n "$2" ]; then - f="$2" - if [[ -n $ziptool && "${f##*.}" == "${ZIPEXTENSIONS[$ziptool]}" ]]; then # remove zip extension if zip requested because zip tool will complain about extension - f="${f%.*}" - fi - info "Copying $1 to $f..." - cp --reflink=auto --sparse=always "$1" "$f" - if (( $? != 0 )); then - error $LINENO "Could not copy file..." - exit 5 - fi - old_owner=$(stat -c %u:%g "$1") - chown "$old_owner" "$f" - img="$f" -fi - -# cleanup at script exit -trap cleanup EXIT - -#Gather info -info "Gathering data" -beforesize="$(ls -lh "$img" | cut -d ' ' -f 5)" -parted_output="$(parted -ms "$img" unit B print)" -rc=$? -if (( $rc )); then - error $LINENO "parted failed with rc $rc" - info "Possibly invalid image. Run 'parted $img unit B print' manually to investigate" - exit 6 -fi -partnum="$(echo "$parted_output" | tail -n 1 | cut -d ':' -f 1)" -partstart="$(echo "$parted_output" | tail -n 1 | cut -d ':' -f 2 | tr -d 'B')" -if [ -z "$(parted -s "$img" unit B print | grep "$partstart" | grep logical)" ]; then - parttype="primary" -else - parttype="logical" -fi -loopback="$(losetup -f --show -o "$partstart" "$img")" -tune2fs_output="$(tune2fs -l "$loopback")" -rc=$? -if (( $rc )); then - echo "$tune2fs_output" - error $LINENO "tune2fs failed. Unable to shrink this type of image" - exit 7 -fi - -currentsize="$(echo "$tune2fs_output" | grep '^Block count:' | tr -d ' ' | cut -d ':' -f 2)" -blocksize="$(echo "$tune2fs_output" | grep '^Block size:' | tr -d ' ' | cut -d ':' -f 2)" - -logVariables $LINENO beforesize parted_output partnum partstart parttype tune2fs_output currentsize blocksize - -#Check if we should make pi expand rootfs on next boot -if [ "$parttype" == "logical" ]; then - echo "WARNING: PiShrink does not yet support autoexpanding of this type of image" -elif [ "$should_skip_autoexpand" = false ]; then - set_autoexpand -else - echo "Skipping autoexpanding process..." -fi - -if [[ $prep == true ]]; then - info "Syspreping: Removing logs, apt archives, dhcp leases and ssh hostkeys" - mountdir=$(mktemp -d) - mount "$loopback" "$mountdir" - rm -rvf $mountdir/var/cache/apt/archives/* $mountdir/var/lib/dhcpcd5/* $mountdir/var/log/* $mountdir/var/tmp/* $mountdir/tmp/* $mountdir/etc/ssh/*_host_* - umount "$mountdir" -fi - - -#Make sure filesystem is ok -checkFilesystem - -if ! minsize=$(resize2fs -P "$loopback"); then - rc=$? - error $LINENO "resize2fs failed with rc $rc" - exit 10 -fi -minsize=$(cut -d ':' -f 2 <<< "$minsize" | tr -d ' ') -logVariables $LINENO currentsize minsize -if [[ $currentsize -eq $minsize ]]; then - info "Image already shrunk to smallest size" -else - #Add some free space to the end of the filesystem - extra_space=$(($currentsize - $minsize)) - logVariables $LINENO extra_space - for space in 5000 1000 100; do - if [[ $extra_space -gt $space ]]; then - minsize=$(($minsize + $space)) - break - fi - done - logVariables $LINENO minsize - - #Shrink filesystem - info "Shrinking filesystem" - resize2fs -p "$loopback" $minsize - rc=$? - if (( $rc )); then - error $LINENO "resize2fs failed with rc $rc" - mount "$loopback" "$mountdir" - mv "$mountdir/etc/rc.local.bak" "$mountdir/etc/rc.local" - umount "$mountdir" - losetup -d "$loopback" - exit 12 - fi - sleep 1 - - #Shrink partition - partnewsize=$(($minsize * $blocksize)) - newpartend=$(($partstart + $partnewsize)) - logVariables $LINENO partnewsize newpartend - parted -s -a minimal "$img" rm "$partnum" - rc=$? - if (( $rc )); then - error $LINENO "parted failed with rc $rc" - exit 13 - fi - - parted -s "$img" unit B mkpart "$parttype" "$partstart" "$newpartend" - rc=$? - if (( $rc )); then - error $LINENO "parted failed with rc $rc" - exit 14 - fi - - #Truncate the file - info "Shrinking image" - endresult=$(parted -ms "$img" unit B print free) - rc=$? - if (( $rc )); then - error $LINENO "parted failed with rc $rc" - exit 15 - fi - - endresult=$(tail -1 <<< "$endresult" | cut -d ':' -f 2 | tr -d 'B') - logVariables $LINENO endresult - truncate -s "$endresult" "$img" - rc=$? - if (( $rc )); then - error $LINENO "truncate failed with rc $rc" - exit 16 - fi -fi - -# handle compression -if [[ -n $ziptool ]]; then - options="" - envVarname="${MYNAME^^}_${ziptool^^}" # PISHRINK_GZIP or PISHRINK_XZ environment variables allow to override all options for gzip or xz - [[ $parallel == true ]] && options="${ZIP_PARALLEL_OPTIONS[$ziptool]}" - [[ -v $envVarname ]] && options="${!envVarname}" # if environment variable defined use these options - [[ $verbose == true ]] && options="$options -v" # add verbose flag if requested - - if [[ $parallel == true ]]; then - parallel_tool="${ZIP_PARALLEL_TOOL[$ziptool]}" - info "Using $parallel_tool on the shrunk image" - if ! $parallel_tool ${options} "$img"; then - rc=$? - error $LINENO "$parallel_tool failed with rc $rc" - exit 18 - fi - - else # sequential - info "Using $ziptool on the shrunk image" - if ! $ziptool ${options} "$img"; then - rc=$? - error $LINENO "$ziptool failed with rc $rc" - exit 19 - fi - fi - img=$img.${ZIPEXTENSIONS[$ziptool]} -fi - -aftersize=$(ls -lh "$img" | cut -d ' ' -f 5) -logVariables $LINENO aftersize - -info "Shrunk $img from $beforesize to $aftersize" diff --git a/scripts/tests/z-wave-stack-binaries-test.sh b/scripts/tests/z-wave-stack-binaries-test.sh new file mode 100755 index 000000000..3b1c3edbc --- /dev/null +++ b/scripts/tests/z-wave-stack-binaries-test.sh @@ -0,0 +1,598 @@ +#! /usr/bin/env bash +# -*- mode: Bash; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*- +# vim:shiftwidth=4:softtabstop=4:tabstop=4: +# +#% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * %# + +[ "" = "$debug" ] || set +[ "" = "$debug" ] || set -x +set -e +set -o pipefail + +# Default configuration can be overloaded from env + +# To be explicilty added to env +sudo="${sudo:=}" + +duration=3 # Allocated time in mins until watchdog quit + +ZPC_COMMAND="${ZPC_COMMAND:=/usr/bin/zpc}" +zpc_api="${zpc_api:=uic}" + +[ "" != "${z_wave_stack_binaries_bin_dir}" ] \ + || z_wave_stack_binaries_bin_dir="${PWD}/z-wave-stack-binaries/bin" + +# Internal + +name='z-wave' +code=0 +code_log="code.log.tmp" +zpc_log="zpc.log.tmp" +file="screen.rc" +mqtt_pub_log="mqtt_pub.log.tmp" +mqtt_sub_log="mqtt_sub.log.tmp" +mqtt_log="mqtt.log.tmp" +controller_log="controller.log.tmp" +node_log="node.log.tmp" + +nocol="\e[0m" +blue="\e[0;34m" +cyan='\e[1;36m' +green="\e[0;32m" +red="\e[0;31m" +yellow='\e[1;33m' + + +usage_() +{ + cat</dev/null 2>&1 || reset >/dev/null 2>&1 || : + printf "${yellow}info: $@ ${nocol}\n" +} + + +exit_() +{ + local code=0$1 + log_ "exit: $@ code=$code ; Use: debug=1 $0 # To trace script)" + sleep 10 + [ -z $debug ] || sleep 1000 + echo $code > $code_log + screen -S "$name" -X "quit" ||: + ls -l *.log.tmp && more *.log.tmp | cat + exit $code +} + + +run_() +{ + local task="$1" && shift + local log="$task.log.tmp" + rm -f "$log" + ${task}_ "$@" 2>&1 | tee "$log" +} + + +mqtt_() +{ + log_ "mqtt: Wait for broker then flush queue before use and log traffic" + while true ; do + pidof mosquitto \ + && mosquitto_sub \ + -v -t '#' --remove-retained --retained-only -W 1 \ + || [ 27 = $? ] && break ||: # Break on timeout + sleep .1 + done + log_ "mqtt: broker is ready, operating for ${duration} mins" + mosquitto_sub -v -t '#' -W $((60 * ${duration})) + log_ "mqtt: error: Should have finish before ${duration} may need to update it" + exit_ 10 +} + + +sub_() +{ + local sub="#" + local count=1 + local expect="" + + [ "$1" = "" ] || sub="$1" + [ "$2" = "" ] || expect="$2" + [ "$3" = "" ] || count="$3" + + printf "${cyan}sub: $sub${nocol} (count=${count})\n" + mosquitto_sub -v -t "$sub" -C $count | tee "$mqtt_sub_log" + [ "" = "$expect" ] || printf "${blue}exp: $expect${nocol}\n" + + if [ "" != "$expect" ] ; then + tail -n +$count "$mqtt_sub_log" \ + | head -n1 | grep -F "$expect" 2>&1 > /dev/null \ + || { printf "${red}exp: error:: ${expect}${nocol}\n" ; + cat "$mqtt_sub_log" ; + exit_ 11; } + fi +} + + +pub_() +{ + topic="$1" + message="$2" + log_ "pub: $@" + + [ "" = "$message" ] || printf "$message" | jq + sleep 1 + mosquitto_pub -t "$topic" -m "$message" + sleep 1 +} + + +pubsub_() +{ + echo "" + [ "" = "$debug" ] || log_ "pubsub_: $@" + local pub="$1" + local message="$2" + local sub="$pub" + local expect="$sub" + local delay=1 + local count=1 + + [ "$3" = "" ] || sub="$3" + [ "$4" = "" ] || expect="$4" + [ "$5" = "" ] || count="$5" + [ "$6" = "" ] || delay="$6" + + if [ "" != "$pub" ] ; then + printf "${green}pub: $pub${nocol}\n" + if [ "$message" != "" ] ; then + printf "$message" | jq --color-output + fi + fi + if [ "" != "$pub" ] ; then + mosquitto_pub -t "$pub" -m "$message" | tee "$mqtt_pub_log" + fi + sleep $delay # Needed to dedup + if [ "" != "$sub" ] ; then + sub_ "$sub" "$expect" "$count" + fi + sleep 1 + [ "0" = "$code" ] || exit_ $code # Quit on 1st failure +} + + +controller_() +{ + controller_app=$(realpath "${z_wave_stack_binaries_bin_dir}/ZW_zwave_ncp_serial_api_controller_"*"_REALTIME"*".elf" | head -n1) + file -E "${controller_app}" + ${controller_app} --pty +} + + +controller_cli_() +{ + while [ ! -e "${controller_log}" ] ; do sleep 1; done + sleep 1 + screen -S "$name" -p 1 -t "controller" -X stuff "$@^M" + sleep 1 + case $1 in + h) + echo "controller: Should display help" + ;; + + p) + PTY=$(grep 'PTY: ' ${controller_log} \ + | tail -n 1 | sed -e 's|PTY: \(.*\)|\1|g' ) + ;; + H) + homeid=$(grep 'HOME_ID: ' "${controller_log}" \ + | tail -n 1 | sed -e 's|HOME_ID: \(.*\)|\1|g' ) + echo "HOME_ID: ${homeid}" + [ ! -z $homeid ] || exit_ 19 + ;; + n) + contid=$(grep 'NODE_ID: ' "${controller_log}" \ + | tail -n 1 | sed -e 's|NODE_ID: \(.*\)|\1|g' ) + echo "NODE_ID: ${contid}" + contid=$(printf "%04d" $contid) + contunid="zw-$homeid-$contid" + echo "NODE_UNID: ${contunid}" + ;; + *) + echo "TODO: handle $1" + ;; + esac +} + + +node_() +{ + node_app=$(realpath "${z_wave_stack_binaries_bin_dir}/ZW_zwave_soc_switch_on_off_"*"_REALTIME"*".elf" | head -n1) + [ "$debug" = "" ] || file -E "${node_app}" + ${node_app} --pty +} + + +node_cli_() +{ + while [ ! -e "${node_log}" ] ; do sleep 1; done + screen -S "$name" -p 2 -t "node" -X stuff "$@^M" + sleep 1 + case $1 in + h) + echo "node: Should display help" + ;; + d) + DSK=$(grep 'DSK: ' "${node_log}" \ + | tail -n 1 | sed -e 's|DSK: \([0-9-]*\)|\1|g' ) + SecurityCode=$(echo "$DSK" | sed -e 's|\([0-9]*\)-[0-9-]*$|\1|g') + ;; + l) + echo "node: Set to learn mode ${nodeunid} needed on add_node" + ;; + H) + [ -z $debug ] || log_ "TODO: print HOME_ID: from device: https://github.com/Z-Wave-Alliance/z-wave-stack/issues/732" + while [ ! -e "${mqtt_log}" ] ; do sleep 1; done + [ "$homeid" != "" ] \ + || homeid=$(sed -n -e 's|ucl/by-unid/zw-\(.*\)-\([0-9]*\)/.*|\1|gp' "$mqtt_log" | tail -n1) + echo "HOME_ID: ${homeid}" + ;; + n) + nodeid=$(grep 'NODE_ID: ' $node_log \ + | tail -n 1 | sed -e 's|NODE_ID: \(.*\)|\1|g' ) + echo "NODE_ID: ${nodeid}" + nodeid=$(printf "%04d" $nodeid) + nodeunid="zw-$homeid-$nodeid" + echo "NODE_UNID: ${nodeunid}" + ;; + *) + echo "TODO: handle $1" + ;; + esac +} + + +zpc_() +{ + controller_cli_ p + file -E "$PTY" + export ZPC_DEVICE=$(realpath -- "$PTY") + if [[ "${ZPC_COMMAND}" = "/usr/bin/zpc" \ + || "${ZPC_COMMAND}" =~ .*build/.*/zpc.* ]] ; then + ZPC_COMMAND="${ZPC_COMMAND} --zpc.serial=${ZPC_DEVICE}" + fi + ${ZPC_COMMAND} + sleep 1 + zpc_cli_ version + zpc_cli_ help + exit_ 13 +} + + +zpc_cli_() +{ + log_ "TODO: Fix console that eat some chars, and discard next workaround" + log_ "TODO: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/30" + if ! true ; then + screen -S "$name" -p 3 -t zpc -X stuff "$@^M" + else + string="$@" + for (( i=0; i<${#string}; i++ )); do + char="${string:$i:1}" + screen -S "$name" -p 3 -t zpc -X stuff "$char" + sleep .1 + done + screen -S "$name" -p 3 -t zpc -X stuff "^M" + sleep 1 + screen -S "$name" -p 3 -t zpc -X hardcopy zpc_cli.log.tmp + fi +} + + +play_uic_net_add_node_() +{ + log_ "net: controller: Add node (set in learn mode)" + controller_cli_ H | grep "^HOME_ID: ........$" || exit_ 14 + controller_cli_ n | grep "^NODE_ID: " || exit_ 15 + + sub="ucl/by-mqtt-client/zpc/ApplicationMonitoring/SupportedCommands" + pub="$sub" # Can be anything + message="{}" + pubsub_ "$pub" "$message" "$sub" + + log_ "Find controller" + sub="ucl/by-unid/+/ProtocolController/NetworkManagement" + message="{}" + expect='{"State":"idle","SupportedStateList":["add node","remove node","reset"]}' + pubsub_ "$pub" "$message" "$sub" "$expect" + + log_ "net: node: Set to learn mode" + homeid=$(sed -n -e 's|ucl/by-unid/zw-\(.*\)-\([0-9]*\)/.*|\1|gp' "$mqtt_sub_log") + contid=$(sed -n -e 's|ucl/by-unid/zw-\(.*\)-\([0-9]*\)/.*|\2|gp' "$mqtt_sub_log") + contunid="zw-$homeid-$contid" + node_cli_ n | grep 'NODE_ID: 0' || exit_ 16 + node_cli_ l + + log_ "net: cont: Add node" + pub="ucl/by-unid/$contunid/ProtocolController/NetworkManagement/Write" + message='{"State":"add node"}' + sub="ucl/by-unid/+/State/SupportedCommands" + count="2" # NODEID=0001 is controller , NODEID=0002 is expected node + expect="State/SupportedCommands" + pubsub_ "$pub" "$message" "$sub" "$expect" + node_cli_ H | grep "HOME_ID: ${homeid}" || exit_ 17 + node_cli_ n # Should not be 0 + pub='' + sub=$(echo "$sub" | sed -e "s|/+/|/$nodeunid/|g") + pubsub_ "$pub" "$message" "$sub" "$sub" + + node_cli_ d + node_cli_ n + + log_ "Takes time from interviewing to functional" + pub="ucl/by-unid/$contunid/ProtocolController/NetworkManagement/Write" + message='{"State":"add node","StateParameters":{"UserAccept":true,"SecurityCode":"'${SecurityCode}'","AllowMultipleInclusions":false}}' + sub="ucl/by-unid/$nodeunid/State" + expect="$sub "'{"MaximumCommandDelay":1,"NetworkList":[""],"NetworkStatus":"Online functional","Security":"Z-Wave S2 Authenticated"}' + count="3" # "NetworkStatus": "Online interviewing" *2 + pubsub_ "$pub" "$message" "$sub" "$expect" "$count" + + pub="" + message="" + sub="ucl/by-unid/+/State/Attributes/EndpointIdList/Reported" + expect=$(echo "$sub "'{"value":[0]}' | sed -e "s|/+/|/$nodeunid/|g") + pubsub_ "$pub" "$message" "$sub" "$expect" 2 + node_cli_ n # 2 expected on 1st time +} + + +play_uic_net_remove_node_() +{ + echo + log_ "net: Remove node $nodeunid (~T738436)" + controller_cli_ n > /dev/null + + pub="ucl/by-unid/$contunid/ProtocolController/NetworkManagement/Write" + message='{"State":"remove node"}' + sub="ucl/by-unid/+/State/SupportedCommands" + node_cli_ n > /dev/null + expect=$(echo "$sub (null)" | sed -e "s|/+/|/$nodeunid/|g") + node_cli_ l + pubsub_ "$pub" "$message" "$sub" "$expect" 3 + node_cli_ n | grep '^NODE_ID: 0$' || exit_ 18 +} + + +play_uic_node_OnOff_() +{ + echo + type="OnOff" + node_cli_ n + log_ "$type: Play on $nodeunid ~T738437 ~T738442" + attribute="$type" + + message="{}" + sub="ucl/by-unid/$nodeunid/ep0/$type/Attributes/$attribute/Reported" + expect="$sub "'{"value":false}' + sub_ "$sub" "$expect" + sleep 1 + + command="ForceReadAttributes" + message="{ \"value\": [\"OnOff\"] }" + pub="ucl/by-unid/$nodeunid/ep0/$type/Commands/$command" + sub="ucl/by-unid/$nodeunid/ep0/$type/Attributes/$attribute/Reported" + expect="$sub "'{"value":false}' + pubsub_ "$pub" "$message" "$sub" "$expect" + sleep 1 + + command="Toggle" # T738442 + message="{}" + pub="ucl/by-unid/$nodeunid/ep0/$type/Commands/$command" + sub="ucl/by-unid/$nodeunid/ep0/$type/Attributes/$attribute/Reported" + expect="$sub "'{"value":true}' + pubsub_ "$pub" "$message" "$sub" "$expect" + sleep 1 + + expect="$sub "'{"value":false}' + pubsub_ "$pub" "$message" "$sub" "$expect" + sleep 1 + + command="On" # T738437 + pub="ucl/by-unid/$nodeunid/ep0/$type/Commands/$command" + expect="$sub "'{"value":true}' + pubsub_ "$pub" "$message" "$sub" "$expect" + sleep 1 + + command="Off" # T738437 + pub="ucl/by-unid/$nodeunid/ep0/$type/Commands/$command" + expect="$sub "'{"value":false}' + pubsub_ "$pub" "$message" "$sub" "$expect" + sleep 1 + + log_ "$type: Events from device $nodeunid" + node_cli_ 1 # From Off to On + expect="$sub "'{"value":true}' + sub_ "$sub" "$expect" + node_cli_ 1 # From On to Off + expect="$sub "'{"value":false}' + sub_ "$sub" "$expect" +} + + +play_uic_() +{ + play_uic_net_add_node_ + play_uic_net_remove_node_ + + play_uic_net_add_node_ + play_uic_node_OnOff_ + play_uic_net_remove_node_ +} + + +play_() +{ + log_ "play: Wait for zpc mqtt ready" + while ! grep -- "\[mqtt_wrapper_mosquitto\]" "${zpc_log}" ; do sleep 1 ; done + while ! grep -- "\[mqtt_client\] Connection to MQTT broker" "${zpc_log}" ; do sleep 1 ; done + + controller_cli_ h + node_cli_ h + + play_${zpc_api}_ || code=$? + exit_ 0$code +} + + +setup_() +{ + local project="z-wave-stack-binaries" + local url="https://github.com/Z-Wave-Alliance/${project}" + local pattern="$project-*.tar.gz" # TODO: Bump latest release + local rev="25.1.0-26-g29d304" + pattern="$project-${rev}-Linux.tar.gz" + + mkdir -p "${project}" && cd "${project}" + file -E "${pattern}" \ + || gh release download -R "$url" --pattern "$pattern" + tar xvfz "${project}"*.tar.gz + # TODO: https://github.com/eclipse-mosquitto/mosquitto/issues/3267 + mosquitto_pub --version \ + || which mosquitto_pub \ + || $sudo apt install mosquitto-clients +} + + +default_() +{ + usage_ + sleep 1 + + log_ "Setup check, if failing please setup using:" + echo "sudo=sudo $0 setup_" + + [ "" = "$debug" ] || set + + screen --version + + # TODO: https://github.com/eclipse-mosquitto/mosquitto/issues/3267 + mosquitto_pub --version \ + || which mosquitto_pub + + log_ "z-wave-stack-binaries: Check presence in ${z_wave_stack_binaries_bin_dir}" + file -E "${z_wave_stack_binaries_bin_dir}/"*"REALTIME"*".elf" + sleep 2 + + cat </dev/null + local detached_opt="" + [ -t 1 ] || detached_opt="-dm -L -Logfile /dev/stdout" + screen $detached_opt -S "$name" -c "${file}" + sleep 1 + + local ref=$(date -u +%s) + local delay=$((60 * ${duration})) + local beat=10 + local expired=$(($delay + $ref)) + local now=$ref + echo "info: Start watchdog to allow $duration minutes" + while [ $now -le $expired ]; do + screen -ls "$name" || break + [ -z $debug ] || { ls -l *.log.tmp && more *.log.tmp | cat ; } + more "${mqtt_log}" | tail ||: + sleep $beat + now=$(date -u +%s) + done + + screen -S "$name" -X quit ||: + cat "${mqtt_log}" + + code=$(cat ${code_log} || echo 254) + exit_ 0$code +} + + +[ "" != "$1" ] || default_ + +"$@" diff --git a/scripts/wslusb.ps1 b/scripts/wslusb.ps1 new file mode 100644 index 000000000..2eb080b37 --- /dev/null +++ b/scripts/wslusb.ps1 @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: ZLib +# This script can be used to attach and detach a device to your WSL2 distribution + +[CmdletBinding()] +param( + [Parameter(Mandatory= $false, HelpMessage = "Busid of the device you want to bind")] + [Alias("b")] + [string]$Busid, + + [Switch]$Attach, + [Switch]$Detach, + [Switch]$List +) + +# Unblock the script file +Unblock-File -Path $MyInvocation.MyCommand.Path + +Function List-devices { + usbipd list +} + +Function Attach-device { + param( + [string]$Busid + ) + Write-Host "Attaching device $Busid" + usbipd bind --busid $Busid --force + usbipd attach --wsl --busid $Busid --auto-attach +} + +Function Detach-device { + param( + [string]$Busid + ) + Write-Host "Detaching device $Busid" + usbipd detach --busid $Busid + usbipd unbind --busid $Busid +} + +if ($Attach -or $Detach -or $List) +{ + if($List) + { + List-devices + } + if ($Detach) + { + if ($Busid) + { + Detach-device -Busid $Busid + } + else + { + Write-Host "Busid not specified" + } + } + if ($Attach) + { + if ($Busid) + { + Attach-device -Busid $Busid + } + else + { + Write-Host "Busid not specified" + } + } +} +else +{ + Write-Host "No argument specified. Use -Attach, -Detach or -List" + Write-Host 'Ex: ./wslusb.ps1 -b "5-3" -Attach' +} \ No newline at end of file